Merge branch 'depends/omap-cleanup-headers-menelaus' into next/headers
authorOlof Johansson <olof@lixom.net>
Mon, 5 Nov 2012 18:28:21 +0000 (10:28 -0800)
committerOlof Johansson <olof@lixom.net>
Mon, 5 Nov 2012 18:28:21 +0000 (10:28 -0800)
Again, resolve conflicts identical to how Tony did.

Conflicts:
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/board-n8x0.c

Signed-off-by: Olof Johansson <olof@lixom.net>
981 files changed:
.gitignore
Documentation/DocBook/media/Makefile
Documentation/DocBook/networking.tmpl
Documentation/IPMI.txt
Documentation/hwmon/coretemp
Documentation/hwmon/submitting-patches
Documentation/sysrq.txt
MAINTAINERS
Makefile
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/dove.dtsi
arch/arm/boot/dts/imx6q-arm2.dts
arch/arm/boot/dts/kirkwood-lsxl.dtsi
arch/arm/boot/dts/wm8505.dtsi
arch/arm/kernel/entry-common.S
arch/arm/mach-dove/common.c
arch/arm/mach-dove/pcie.c
arch/arm/mach-kirkwood/board-dt.c
arch/arm/mach-kirkwood/common.c
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/board-fsample.c
arch/arm/mach-omap1/board-generic.c
arch/arm/mach-omap1/board-h2-mmc.c
arch/arm/mach-omap1/board-h2.c
arch/arm/mach-omap1/board-h3-mmc.c
arch/arm/mach-omap1/board-h3.c
arch/arm/mach-omap1/board-htcherald.c
arch/arm/mach-omap1/board-innovator.c
arch/arm/mach-omap1/board-nokia770.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/board-palmte.c
arch/arm/mach-omap1/board-palmtt.c
arch/arm/mach-omap1/board-palmz71.c
arch/arm/mach-omap1/board-perseus2.c
arch/arm/mach-omap1/board-sx1-mmc.c
arch/arm/mach-omap1/board-sx1.c
arch/arm/mach-omap1/board-voiceblue.c
arch/arm/mach-omap1/clock.c
arch/arm/mach-omap1/clock.h
arch/arm/mach-omap1/clock_data.c
arch/arm/mach-omap1/common.h
arch/arm/mach-omap1/devices.c
arch/arm/mach-omap1/dma.c
arch/arm/mach-omap1/dma.h [new file with mode: 0644]
arch/arm/mach-omap1/flash.c
arch/arm/mach-omap1/fpga.c
arch/arm/mach-omap1/i2c.c
arch/arm/mach-omap1/id.c
arch/arm/mach-omap1/include/mach/debug-macro.S
arch/arm/mach-omap1/include/mach/hardware.h
arch/arm/mach-omap1/include/mach/memory.h
arch/arm/mach-omap1/include/mach/omap1510.h
arch/arm/mach-omap1/include/mach/serial.h [new file with mode: 0644]
arch/arm/mach-omap1/include/mach/tc.h [new file with mode: 0644]
arch/arm/mach-omap1/include/mach/uncompress.h
arch/arm/mach-omap1/io.c
arch/arm/mach-omap1/irq.c
arch/arm/mach-omap1/lcd_dma.c
arch/arm/mach-omap1/mcbsp.c
arch/arm/mach-omap1/mmc.h [new file with mode: 0644]
arch/arm/mach-omap1/opp_data.c
arch/arm/mach-omap1/pm.c
arch/arm/mach-omap1/pm_bus.c
arch/arm/mach-omap1/serial.c
arch/arm/mach-omap1/soc.h [new file with mode: 0644]
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/am35xx-emac.c
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-3630sdp.c
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-am3517crane.c
arch/arm/mach-omap2/board-am3517evm.c
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/board-cm-t35.c
arch/arm/mach-omap2/board-cm-t3517.c
arch/arm/mach-omap2/board-devkit8000.c
arch/arm/mach-omap2/board-flash.c
arch/arm/mach-omap2/board-flash.h
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/board-igep0020.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-n8x0.c
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/board-omap3logic.c
arch/arm/mach-omap2/board-omap3pandora.c
arch/arm/mach-omap2/board-omap3stalker.c
arch/arm/mach-omap2/board-omap3touchbook.c
arch/arm/mach-omap2/board-omap4panda.c
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/board-rm680.c
arch/arm/mach-omap2/board-rx51-peripherals.c
arch/arm/mach-omap2/board-rx51.c
arch/arm/mach-omap2/board-ti8168evm.c
arch/arm/mach-omap2/board-zoom-debugboard.c
arch/arm/mach-omap2/board-zoom-display.c
arch/arm/mach-omap2/board-zoom-peripherals.c
arch/arm/mach-omap2/board-zoom.c
arch/arm/mach-omap2/board-zoom.h [new file with mode: 0644]
arch/arm/mach-omap2/clkt2xxx_apll.c
arch/arm/mach-omap2/clkt2xxx_dpll.c
arch/arm/mach-omap2/clkt2xxx_dpllcore.c
arch/arm/mach-omap2/clkt2xxx_osc.c
arch/arm/mach-omap2/clkt2xxx_sys.c
arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
arch/arm/mach-omap2/clkt34xx_dpll3m2.c
arch/arm/mach-omap2/clkt_clksel.c
arch/arm/mach-omap2/clkt_dpll.c
arch/arm/mach-omap2/clkt_iclk.c
arch/arm/mach-omap2/clock.c
arch/arm/mach-omap2/clock.h
arch/arm/mach-omap2/clock2420_data.c
arch/arm/mach-omap2/clock2430.c
arch/arm/mach-omap2/clock2430_data.c
arch/arm/mach-omap2/clock2xxx.c
arch/arm/mach-omap2/clock33xx_data.c
arch/arm/mach-omap2/clock34xx.c
arch/arm/mach-omap2/clock3517.c
arch/arm/mach-omap2/clock36xx.c
arch/arm/mach-omap2/clock3xxx.c
arch/arm/mach-omap2/clock3xxx_data.c
arch/arm/mach-omap2/clock44xx_data.c
arch/arm/mach-omap2/clockdomain.c
arch/arm/mach-omap2/clockdomain.h
arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
arch/arm/mach-omap2/clockdomains2420_data.c
arch/arm/mach-omap2/clockdomains2430_data.c
arch/arm/mach-omap2/clockdomains3xxx_data.c
arch/arm/mach-omap2/cm33xx.c
arch/arm/mach-omap2/common-board-devices.c
arch/arm/mach-omap2/common-board-devices.h
arch/arm/mach-omap2/common.c
arch/arm/mach-omap2/common.h
arch/arm/mach-omap2/control.c
arch/arm/mach-omap2/devices.c
arch/arm/mach-omap2/display.c
arch/arm/mach-omap2/dma.c
arch/arm/mach-omap2/dma.h [new file with mode: 0644]
arch/arm/mach-omap2/dpll3xxx.c
arch/arm/mach-omap2/dpll44xx.c
arch/arm/mach-omap2/drm.c
arch/arm/mach-omap2/dsp.c
arch/arm/mach-omap2/gpio.c
arch/arm/mach-omap2/gpmc-nand.c
arch/arm/mach-omap2/gpmc-nand.h [new file with mode: 0644]
arch/arm/mach-omap2/gpmc-onenand.c
arch/arm/mach-omap2/gpmc-onenand.h [new file with mode: 0644]
arch/arm/mach-omap2/gpmc-smc91x.c
arch/arm/mach-omap2/gpmc-smsc911x.c
arch/arm/mach-omap2/gpmc.c
arch/arm/mach-omap2/gpmc.h [new file with mode: 0644]
arch/arm/mach-omap2/hdq1w.c
arch/arm/mach-omap2/hdq1w.h
arch/arm/mach-omap2/hsmmc.c
arch/arm/mach-omap2/hwspinlock.c
arch/arm/mach-omap2/i2c.c
arch/arm/mach-omap2/i2c.h [new file with mode: 0644]
arch/arm/mach-omap2/include/mach/board-zoom.h [deleted file]
arch/arm/mach-omap2/include/mach/debug-macro.S
arch/arm/mach-omap2/include/mach/uncompress.h
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/mcbsp.c
arch/arm/mach-omap2/mmc.h [new file with mode: 0644]
arch/arm/mach-omap2/msdi.c
arch/arm/mach-omap2/mux.c
arch/arm/mach-omap2/omap-mpuss-lowpower.c
arch/arm/mach-omap2/omap-pm.h [new file with mode: 0644]
arch/arm/mach-omap2/omap-secure.c
arch/arm/mach-omap2/omap-secure.h
arch/arm/mach-omap2/omap4-common.c
arch/arm/mach-omap2/omap_device.c [new file with mode: 0644]
arch/arm/mach-omap2/omap_device.h [new file with mode: 0644]
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/mach-omap2/omap_hwmod.h [new file with mode: 0644]
arch/arm/mach-omap2/omap_hwmod_2420_data.c
arch/arm/mach-omap2/omap_hwmod_2430_data.c
arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_interconnect_data.c
arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
arch/arm/mach-omap2/omap_hwmod_33xx_data.c
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
arch/arm/mach-omap2/omap_hwmod_common_data.c
arch/arm/mach-omap2/omap_hwmod_common_data.h
arch/arm/mach-omap2/omap_opp_data.h
arch/arm/mach-omap2/omap_phy_internal.c
arch/arm/mach-omap2/omap_twl.c
arch/arm/mach-omap2/opp.c
arch/arm/mach-omap2/opp3xxx_data.c
arch/arm/mach-omap2/pm-debug.c
arch/arm/mach-omap2/pm.c
arch/arm/mach-omap2/pm24xx.c
arch/arm/mach-omap2/pm34xx.c
arch/arm/mach-omap2/pm44xx.c
arch/arm/mach-omap2/pmu.c
arch/arm/mach-omap2/powerdomain.h
arch/arm/mach-omap2/powerdomains2xxx_data.c
arch/arm/mach-omap2/prcm.c
arch/arm/mach-omap2/prm33xx.c
arch/arm/mach-omap2/prm_common.c
arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h
arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h
arch/arm/mach-omap2/sdram-nokia.c
arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h
arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h
arch/arm/mach-omap2/sdrc.c
arch/arm/mach-omap2/sdrc.h
arch/arm/mach-omap2/sdrc2xxx.c
arch/arm/mach-omap2/serial.c
arch/arm/mach-omap2/serial.h [new file with mode: 0644]
arch/arm/mach-omap2/sleep34xx.S
arch/arm/mach-omap2/soc.h
arch/arm/mach-omap2/sr_device.c
arch/arm/mach-omap2/timer.c
arch/arm/mach-omap2/twl-common.c
arch/arm/mach-omap2/usb-host.c
arch/arm/mach-omap2/usb-musb.c
arch/arm/mach-omap2/usb-tusb6010.c
arch/arm/mach-omap2/usb.h [new file with mode: 0644]
arch/arm/mach-omap2/wd_timer.c
arch/arm/mach-omap2/wd_timer.h
arch/arm/mach-prima2/include/mach/gpio.h [deleted file]
arch/arm/mach-s3c24xx/clock-s3c2440.c
arch/arm/mach-shmobile/board-armadillo800eva.c
arch/arm/mach-shmobile/clock-r8a7779.c
arch/arm/mach-tegra/board-dt-tegra20.c
arch/arm/mach-tegra/board-dt-tegra30.c
arch/arm/mach-tegra/board.h
arch/arm/mach-tegra/tegra20_clocks_data.c
arch/arm/mach-tegra/tegra30_clocks.c
arch/arm/mach-tegra/tegra30_clocks_data.c
arch/arm/mach-tegra/timer.c
arch/arm/plat-omap/Makefile
arch/arm/plat-omap/clock.c [deleted file]
arch/arm/plat-omap/common.c
arch/arm/plat-omap/common.h [new file with mode: 0644]
arch/arm/plat-omap/counter_32k.c
arch/arm/plat-omap/debug-devices.c
arch/arm/plat-omap/debug-leds.c
arch/arm/plat-omap/dma.c
arch/arm/plat-omap/dmtimer.c
arch/arm/plat-omap/fb.c
arch/arm/plat-omap/fpga.h [new file with mode: 0644]
arch/arm/plat-omap/i2c.c
arch/arm/plat-omap/i2c.h [new file with mode: 0644]
arch/arm/plat-omap/include/plat-omap/dma-omap.h [new file with mode: 0644]
arch/arm/plat-omap/include/plat/clkdev_omap.h [deleted file]
arch/arm/plat-omap/include/plat/clock.h [deleted file]
arch/arm/plat-omap/include/plat/common.h [deleted file]
arch/arm/plat-omap/include/plat/cpu.h
arch/arm/plat-omap/include/plat/dma-44xx.h [deleted file]
arch/arm/plat-omap/include/plat/dma.h [deleted file]
arch/arm/plat-omap/include/plat/fpga.h [deleted file]
arch/arm/plat-omap/include/plat/gpmc.h [deleted file]
arch/arm/plat-omap/include/plat/i2c.h [deleted file]
arch/arm/plat-omap/include/plat/led.h [deleted file]
arch/arm/plat-omap/include/plat/mmc.h [deleted file]
arch/arm/plat-omap/include/plat/multi.h [deleted file]
arch/arm/plat-omap/include/plat/omap-pm.h [deleted file]
arch/arm/plat-omap/include/plat/omap-secure.h [deleted file]
arch/arm/plat-omap/include/plat/omap_device.h [deleted file]
arch/arm/plat-omap/include/plat/omap_hwmod.h [deleted file]
arch/arm/plat-omap/include/plat/sdrc.h [deleted file]
arch/arm/plat-omap/include/plat/serial.h [deleted file]
arch/arm/plat-omap/include/plat/sram.h [deleted file]
arch/arm/plat-omap/include/plat/tc.h [deleted file]
arch/arm/plat-omap/include/plat/uncompress.h [deleted file]
arch/arm/plat-omap/include/plat/usb.h [deleted file]
arch/arm/plat-omap/include/plat/vrfb.h [deleted file]
arch/arm/plat-omap/omap-pm-noop.c
arch/arm/plat-omap/omap_device.c [deleted file]
arch/arm/plat-omap/sram.c
arch/arm/plat-omap/sram.h
arch/arm64/Kconfig
arch/arm64/include/asm/Kbuild
arch/arm64/include/asm/linkage.h [new file with mode: 0644]
arch/arm64/include/asm/processor.h
arch/arm64/include/uapi/asm/ptrace.h
arch/arm64/kernel/ptrace.c
arch/arm64/kernel/setup.c
arch/arm64/kernel/smp.c
arch/arm64/kernel/vdso.c
arch/frv/kernel/entry.S
arch/frv/kernel/process.c
arch/frv/kernel/setup.c
arch/hexagon/include/asm/Kbuild
arch/hexagon/include/asm/atomic.h
arch/hexagon/include/asm/barrier.h
arch/hexagon/include/asm/bitops.h
arch/hexagon/include/asm/bitsperlong.h [deleted file]
arch/hexagon/include/asm/byteorder.h [deleted file]
arch/hexagon/include/asm/cache.h
arch/hexagon/include/asm/cacheflush.h
arch/hexagon/include/asm/checksum.h
arch/hexagon/include/asm/cmpxchg.h
arch/hexagon/include/asm/delay.h
arch/hexagon/include/asm/dma-mapping.h
arch/hexagon/include/asm/dma.h
arch/hexagon/include/asm/elf.h
arch/hexagon/include/asm/exec.h
arch/hexagon/include/asm/fixmap.h
arch/hexagon/include/asm/hexagon_vm.h
arch/hexagon/include/asm/intrinsics.h
arch/hexagon/include/asm/io.h
arch/hexagon/include/asm/irq.h
arch/hexagon/include/asm/irqflags.h
arch/hexagon/include/asm/kgdb.h
arch/hexagon/include/asm/kvm_para.h [deleted file]
arch/hexagon/include/asm/linkage.h
arch/hexagon/include/asm/mem-layout.h
arch/hexagon/include/asm/mmu.h
arch/hexagon/include/asm/mmu_context.h
arch/hexagon/include/asm/module.h
arch/hexagon/include/asm/page.h
arch/hexagon/include/asm/param.h [deleted file]
arch/hexagon/include/asm/perf_event.h
arch/hexagon/include/asm/pgalloc.h
arch/hexagon/include/asm/pgtable.h
arch/hexagon/include/asm/processor.h
arch/hexagon/include/asm/ptrace.h [deleted file]
arch/hexagon/include/asm/registers.h [deleted file]
arch/hexagon/include/asm/setup.h [deleted file]
arch/hexagon/include/asm/sigcontext.h [deleted file]
arch/hexagon/include/asm/signal.h [deleted file]
arch/hexagon/include/asm/smp.h
arch/hexagon/include/asm/spinlock.h
arch/hexagon/include/asm/spinlock_types.h
arch/hexagon/include/asm/string.h
arch/hexagon/include/asm/suspend.h
arch/hexagon/include/asm/swab.h [deleted file]
arch/hexagon/include/asm/switch_to.h
arch/hexagon/include/asm/syscall.h
arch/hexagon/include/asm/thread_info.h
arch/hexagon/include/asm/time.h
arch/hexagon/include/asm/timer-regs.h
arch/hexagon/include/asm/timex.h
arch/hexagon/include/asm/tlb.h
arch/hexagon/include/asm/tlbflush.h
arch/hexagon/include/asm/traps.h
arch/hexagon/include/asm/uaccess.h
arch/hexagon/include/asm/unistd.h [deleted file]
arch/hexagon/include/asm/user.h [deleted file]
arch/hexagon/include/asm/vdso.h
arch/hexagon/include/asm/vm_fault.h
arch/hexagon/include/asm/vm_mmu.h
arch/hexagon/include/uapi/asm/Kbuild
arch/hexagon/include/uapi/asm/bitsperlong.h [new file with mode: 0644]
arch/hexagon/include/uapi/asm/byteorder.h [new file with mode: 0644]
arch/hexagon/include/uapi/asm/kvm_para.h [new file with mode: 0644]
arch/hexagon/include/uapi/asm/param.h [new file with mode: 0644]
arch/hexagon/include/uapi/asm/ptrace.h [new file with mode: 0644]
arch/hexagon/include/uapi/asm/registers.h [new file with mode: 0644]
arch/hexagon/include/uapi/asm/setup.h [new file with mode: 0644]
arch/hexagon/include/uapi/asm/sigcontext.h [new file with mode: 0644]
arch/hexagon/include/uapi/asm/signal.h [new file with mode: 0644]
arch/hexagon/include/uapi/asm/swab.h [new file with mode: 0644]
arch/hexagon/include/uapi/asm/unistd.h [new file with mode: 0644]
arch/hexagon/include/uapi/asm/user.h [new file with mode: 0644]
arch/hexagon/kernel/asm-offsets.c
arch/hexagon/kernel/dma.c
arch/hexagon/kernel/head.S
arch/hexagon/kernel/hexagon_ksyms.c
arch/hexagon/kernel/irq_cpu.c
arch/hexagon/kernel/kgdb.c
arch/hexagon/kernel/module.c
arch/hexagon/kernel/process.c
arch/hexagon/kernel/ptrace.c
arch/hexagon/kernel/reset.c
arch/hexagon/kernel/setup.c
arch/hexagon/kernel/signal.c
arch/hexagon/kernel/smp.c
arch/hexagon/kernel/stacktrace.c
arch/hexagon/kernel/syscall.c
arch/hexagon/kernel/syscalltab.c
arch/hexagon/kernel/time.c
arch/hexagon/kernel/topology.c
arch/hexagon/kernel/trampoline.S
arch/hexagon/kernel/traps.c
arch/hexagon/kernel/vdso.c
arch/hexagon/kernel/vm_entry.S
arch/hexagon/kernel/vm_events.c
arch/hexagon/kernel/vm_init_segtable.S
arch/hexagon/kernel/vm_ops.S
arch/hexagon/kernel/vm_switch.S
arch/hexagon/kernel/vm_vectors.S
arch/hexagon/kernel/vmlinux.lds.S
arch/hexagon/lib/checksum.c
arch/hexagon/lib/io.c
arch/hexagon/lib/memcpy.S
arch/hexagon/lib/memset.S
arch/hexagon/mm/cache.c
arch/hexagon/mm/copy_from_user.S
arch/hexagon/mm/copy_to_user.S
arch/hexagon/mm/copy_user_template.S
arch/hexagon/mm/init.c
arch/hexagon/mm/ioremap.c
arch/hexagon/mm/pgalloc.c
arch/hexagon/mm/strnlen_user.S
arch/hexagon/mm/uaccess.c
arch/hexagon/mm/vm_fault.c
arch/hexagon/mm/vm_tlb.c
arch/ia64/include/uapi/asm/Kbuild
arch/ia64/include/uapi/asm/kvm_para.h [deleted file]
arch/mips/include/asm/Kbuild
arch/mips/include/asm/delay.h
arch/mips/include/asm/pgtable-64.h
arch/mips/jz4740/serial.h
arch/mips/kernel/smp-cmp.c
arch/mips/lib/delay.c
arch/mips/lib/dump_tlb.c
arch/mips/mm/tlb-r4k.c
arch/mips/mm/tlbex.c
arch/mn10300/include/uapi/asm/setup.h
arch/parisc/include/asm/Kbuild
arch/parisc/include/asm/auxvec.h [deleted file]
arch/parisc/include/asm/bitsperlong.h [deleted file]
arch/parisc/include/asm/byteorder.h [deleted file]
arch/parisc/include/asm/compat_signal.h [deleted file]
arch/parisc/include/asm/cputime.h [deleted file]
arch/parisc/include/asm/device.h [deleted file]
arch/parisc/include/asm/div64.h [deleted file]
arch/parisc/include/asm/emergency-restart.h [deleted file]
arch/parisc/include/asm/errno.h [deleted file]
arch/parisc/include/asm/fcntl.h [deleted file]
arch/parisc/include/asm/hw_irq.h [deleted file]
arch/parisc/include/asm/ioctl.h [deleted file]
arch/parisc/include/asm/ioctls.h [deleted file]
arch/parisc/include/asm/ipcbuf.h [deleted file]
arch/parisc/include/asm/irq_regs.h [deleted file]
arch/parisc/include/asm/kdebug.h [deleted file]
arch/parisc/include/asm/kvm_para.h [deleted file]
arch/parisc/include/asm/local.h [deleted file]
arch/parisc/include/asm/local64.h [deleted file]
arch/parisc/include/asm/mman.h [deleted file]
arch/parisc/include/asm/msgbuf.h [deleted file]
arch/parisc/include/asm/mutex.h [deleted file]
arch/parisc/include/asm/param.h [deleted file]
arch/parisc/include/asm/pdc.h
arch/parisc/include/asm/percpu.h [deleted file]
arch/parisc/include/asm/poll.h [deleted file]
arch/parisc/include/asm/posix_types.h [deleted file]
arch/parisc/include/asm/ptrace.h
arch/parisc/include/asm/real.h [deleted file]
arch/parisc/include/asm/resource.h [deleted file]
arch/parisc/include/asm/segment.h [deleted file]
arch/parisc/include/asm/sembuf.h [deleted file]
arch/parisc/include/asm/setup.h [deleted file]
arch/parisc/include/asm/shmbuf.h [deleted file]
arch/parisc/include/asm/sigcontext.h [deleted file]
arch/parisc/include/asm/siginfo.h [deleted file]
arch/parisc/include/asm/signal.h
arch/parisc/include/asm/socket.h [deleted file]
arch/parisc/include/asm/sockios.h [deleted file]
arch/parisc/include/asm/stat.h [deleted file]
arch/parisc/include/asm/statfs.h [deleted file]
arch/parisc/include/asm/swab.h [deleted file]
arch/parisc/include/asm/termbits.h [deleted file]
arch/parisc/include/asm/termios.h
arch/parisc/include/asm/topology.h [deleted file]
arch/parisc/include/asm/types.h [deleted file]
arch/parisc/include/asm/unistd.h
arch/parisc/include/asm/user.h [deleted file]
arch/parisc/include/asm/vga.h [deleted file]
arch/parisc/include/asm/xor.h [deleted file]
arch/parisc/include/uapi/asm/Kbuild
arch/parisc/include/uapi/asm/bitsperlong.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/byteorder.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/errno.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/fcntl.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/ioctl.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/ioctls.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/ipcbuf.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/mman.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/msgbuf.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/pdc.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/posix_types.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/ptrace.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/resource.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/sembuf.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/setup.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/shmbuf.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/sigcontext.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/siginfo.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/signal.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/socket.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/sockios.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/stat.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/statfs.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/swab.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/termbits.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/termios.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/types.h [new file with mode: 0644]
arch/parisc/include/uapi/asm/unistd.h [new file with mode: 0644]
arch/powerpc/include/asm/kvm_book3s_32.h
arch/powerpc/include/asm/processor.h
arch/powerpc/kernel/sysfs.c
arch/powerpc/kvm/book3s_32_mmu_host.c
arch/powerpc/perf/core-book3s.c
arch/powerpc/platforms/pseries/processor_idle.c
arch/s390/include/uapi/asm/Kbuild
arch/s390/include/uapi/asm/kvm_para.h [deleted file]
arch/sh/include/asm/Kbuild
arch/sh/include/asm/auxvec.h [deleted file]
arch/sh/include/asm/byteorder.h [deleted file]
arch/sh/include/asm/cachectl.h [deleted file]
arch/sh/include/asm/cpu-features.h [deleted file]
arch/sh/include/asm/hw_breakpoint.h
arch/sh/include/asm/ioctls.h [deleted file]
arch/sh/include/asm/posix_types.h
arch/sh/include/asm/posix_types_32.h [deleted file]
arch/sh/include/asm/posix_types_64.h [deleted file]
arch/sh/include/asm/ptrace.h
arch/sh/include/asm/ptrace_32.h
arch/sh/include/asm/ptrace_64.h
arch/sh/include/asm/setup.h
arch/sh/include/asm/sigcontext.h [deleted file]
arch/sh/include/asm/signal.h [deleted file]
arch/sh/include/asm/sockios.h [deleted file]
arch/sh/include/asm/stat.h [deleted file]
arch/sh/include/asm/swab.h [deleted file]
arch/sh/include/asm/types.h
arch/sh/include/asm/unistd.h
arch/sh/include/asm/unistd_32.h [deleted file]
arch/sh/include/asm/unistd_64.h [deleted file]
arch/sh/include/uapi/asm/Kbuild
arch/sh/include/uapi/asm/auxvec.h [new file with mode: 0644]
arch/sh/include/uapi/asm/byteorder.h [new file with mode: 0644]
arch/sh/include/uapi/asm/cachectl.h [new file with mode: 0644]
arch/sh/include/uapi/asm/cpu-features.h [new file with mode: 0644]
arch/sh/include/uapi/asm/hw_breakpoint.h [new file with mode: 0644]
arch/sh/include/uapi/asm/ioctls.h [new file with mode: 0644]
arch/sh/include/uapi/asm/posix_types.h [new file with mode: 0644]
arch/sh/include/uapi/asm/posix_types_32.h [new file with mode: 0644]
arch/sh/include/uapi/asm/posix_types_64.h [new file with mode: 0644]
arch/sh/include/uapi/asm/ptrace.h [new file with mode: 0644]
arch/sh/include/uapi/asm/ptrace_32.h [new file with mode: 0644]
arch/sh/include/uapi/asm/ptrace_64.h [new file with mode: 0644]
arch/sh/include/uapi/asm/setup.h [new file with mode: 0644]
arch/sh/include/uapi/asm/sigcontext.h [new file with mode: 0644]
arch/sh/include/uapi/asm/signal.h [new file with mode: 0644]
arch/sh/include/uapi/asm/sockios.h [new file with mode: 0644]
arch/sh/include/uapi/asm/stat.h [new file with mode: 0644]
arch/sh/include/uapi/asm/swab.h [new file with mode: 0644]
arch/sh/include/uapi/asm/types.h [new file with mode: 0644]
arch/sh/include/uapi/asm/unistd.h [new file with mode: 0644]
arch/sh/include/uapi/asm/unistd_32.h [new file with mode: 0644]
arch/sh/include/uapi/asm/unistd_64.h [new file with mode: 0644]
arch/sh/kernel/syscalls_32.S
arch/sh/kernel/syscalls_64.S
arch/sparc/include/asm/ptrace.h
arch/sparc/include/asm/smp_64.h
arch/sparc/include/uapi/asm/sigcontext.h
arch/sparc/kernel/perf_event.c
arch/sparc/kernel/process_64.c
arch/sparc/kernel/smp_64.c
arch/sparc/mm/ultra.S
arch/tile/include/arch/Kbuild
arch/tile/include/asm/Kbuild
arch/tile/include/uapi/asm/Kbuild
arch/x86/Makefile
arch/x86/crypto/aesni-intel_glue.c
arch/x86/kernel/cpu/intel_cacheinfo.c
arch/x86/kernel/cpu/mcheck/mce.c
arch/x86/kernel/cpu/mcheck/mce_amd.c
arch/x86/kernel/cpu/perf_event.c
arch/x86/kernel/reboot.c
arch/x86/kernel/setup.c
arch/x86/realmode/rm/wakeup_asm.S
arch/xtensa/boot/boot-redboot/bootstrap.S
arch/xtensa/include/asm/Kbuild
arch/xtensa/include/asm/atomic.h
arch/xtensa/include/asm/auxvec.h [deleted file]
arch/xtensa/include/asm/bitsperlong.h [deleted file]
arch/xtensa/include/asm/bug.h [deleted file]
arch/xtensa/include/asm/byteorder.h [deleted file]
arch/xtensa/include/asm/cacheflush.h
arch/xtensa/include/asm/cmpxchg.h
arch/xtensa/include/asm/coprocessor.h
arch/xtensa/include/asm/cputime.h [deleted file]
arch/xtensa/include/asm/delay.h
arch/xtensa/include/asm/device.h [deleted file]
arch/xtensa/include/asm/div64.h [deleted file]
arch/xtensa/include/asm/emergency-restart.h [deleted file]
arch/xtensa/include/asm/errno.h [deleted file]
arch/xtensa/include/asm/fcntl.h [deleted file]
arch/xtensa/include/asm/futex.h [deleted file]
arch/xtensa/include/asm/hardirq.h [deleted file]
arch/xtensa/include/asm/ioctl.h [deleted file]
arch/xtensa/include/asm/ioctls.h [deleted file]
arch/xtensa/include/asm/ipcbuf.h [deleted file]
arch/xtensa/include/asm/irq_regs.h [deleted file]
arch/xtensa/include/asm/irqflags.h
arch/xtensa/include/asm/kdebug.h [deleted file]
arch/xtensa/include/asm/kmap_types.h [deleted file]
arch/xtensa/include/asm/kvm_para.h [deleted file]
arch/xtensa/include/asm/local.h [deleted file]
arch/xtensa/include/asm/local64.h [deleted file]
arch/xtensa/include/asm/mman.h [deleted file]
arch/xtensa/include/asm/mmu_context.h
arch/xtensa/include/asm/msgbuf.h [deleted file]
arch/xtensa/include/asm/param.h
arch/xtensa/include/asm/percpu.h [deleted file]
arch/xtensa/include/asm/poll.h [deleted file]
arch/xtensa/include/asm/posix_types.h [deleted file]
arch/xtensa/include/asm/ptrace.h
arch/xtensa/include/asm/regs.h
arch/xtensa/include/asm/resource.h [deleted file]
arch/xtensa/include/asm/scatterlist.h [deleted file]
arch/xtensa/include/asm/sections.h [deleted file]
arch/xtensa/include/asm/sembuf.h [deleted file]
arch/xtensa/include/asm/setup.h [deleted file]
arch/xtensa/include/asm/shmbuf.h [deleted file]
arch/xtensa/include/asm/sigcontext.h [deleted file]
arch/xtensa/include/asm/siginfo.h [deleted file]
arch/xtensa/include/asm/signal.h
arch/xtensa/include/asm/socket.h [deleted file]
arch/xtensa/include/asm/sockios.h [deleted file]
arch/xtensa/include/asm/stat.h [deleted file]
arch/xtensa/include/asm/statfs.h [deleted file]
arch/xtensa/include/asm/swab.h [deleted file]
arch/xtensa/include/asm/termbits.h [deleted file]
arch/xtensa/include/asm/termios.h [deleted file]
arch/xtensa/include/asm/timex.h
arch/xtensa/include/asm/tlbflush.h
arch/xtensa/include/asm/topology.h [deleted file]
arch/xtensa/include/asm/types.h
arch/xtensa/include/asm/unistd.h
arch/xtensa/include/asm/xor.h [deleted file]
arch/xtensa/include/uapi/asm/Kbuild
arch/xtensa/include/uapi/asm/auxvec.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/byteorder.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/ioctls.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/ipcbuf.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/mman.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/msgbuf.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/param.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/poll.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/posix_types.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/ptrace.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/sembuf.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/setup.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/shmbuf.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/sigcontext.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/signal.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/socket.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/sockios.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/stat.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/swab.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/termbits.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/types.h [new file with mode: 0644]
arch/xtensa/include/uapi/asm/unistd.h [new file with mode: 0644]
arch/xtensa/kernel/align.S
arch/xtensa/kernel/coprocessor.S
arch/xtensa/kernel/entry.S
arch/xtensa/kernel/head.S
arch/xtensa/kernel/irq.c
arch/xtensa/kernel/process.c
arch/xtensa/kernel/setup.c
arch/xtensa/kernel/syscall.c
arch/xtensa/kernel/traps.c
arch/xtensa/kernel/vectors.S
arch/xtensa/lib/memcopy.S
arch/xtensa/mm/fault.c
arch/xtensa/platforms/iss/console.c
arch/xtensa/platforms/iss/include/platform/simcall.h
arch/xtensa/platforms/iss/setup.c
arch/xtensa/platforms/xt2000/setup.c
drivers/Makefile
drivers/acpi/Makefile
drivers/bluetooth/hci_ldisc.c
drivers/char/Makefile
drivers/char/agp/intel-gtt.c
drivers/char/hw_random/omap-rng.c
drivers/char/ipmi/ipmi_msghandler.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/crypto/omap-aes.c
drivers/crypto/omap-sham.c
drivers/dma/omap-dma.c
drivers/firmware/memmap.c
drivers/gpio/gpio-mvebu.c
drivers/gpu/drm/drm_info.c
drivers/gpu/drm/i915/dvo_ch7xxx.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_overlay.c
drivers/gpu/drm/i915/intel_pm.c
drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c
drivers/gpu/drm/nouveau/core/subdev/therm/fan.c
drivers/gpu/drm/nouveau/nouveau_bo.c
drivers/gpu/drm/nouveau/nouveau_pm.c
drivers/gpu/drm/radeon/atombios_crtc.c
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/ni.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_acpi.c
drivers/gpu/drm/radeon/radeon_atpx_handler.c
drivers/gpu/drm/radeon/radeon_cs.c
drivers/gpu/drm/radeon/radeon_device.c
drivers/gpu/drm/radeon/radeon_gart.c
drivers/gpu/drm/radeon/radeon_kms.c
drivers/gpu/drm/radeon/radeon_legacy_encoders.c
drivers/gpu/drm/radeon/radeon_ring.c
drivers/gpu/drm/radeon/si.c
drivers/hwmon/coretemp.c
drivers/hwmon/pmbus/Kconfig
drivers/media/Kconfig
drivers/media/platform/omap/omap_vout.c
drivers/media/platform/omap/omap_vout_vrfb.c
drivers/media/platform/omap/omap_voutdef.h
drivers/media/platform/omap3isp/isphist.c
drivers/media/platform/omap3isp/ispstat.h
drivers/media/platform/soc_camera/omap1_camera.c
drivers/media/rc/ir-rx51.c
drivers/mfd/omap-usb-host.c
drivers/mfd/omap-usb-tll.c
drivers/mfd/omap-usb.h [new file with mode: 0644]
drivers/mmc/host/omap.c
drivers/mmc/host/omap_hsmmc.c
drivers/mtd/nand/omap2.c
drivers/mtd/onenand/omap2.c
drivers/net/bonding/bond_main.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
drivers/of/address.c
drivers/of/irq.c
drivers/of/platform.c
drivers/pcmcia/omap_cf.c
drivers/pcmcia/pxa2xx_sharpsl.c
drivers/pinctrl/pinctrl-bcm2835.c
drivers/pinctrl/pinctrl-nomadik.c
drivers/pinctrl/pinctrl-samsung.c
drivers/pinctrl/pinctrl-sirf.c
drivers/pinctrl/pinctrl-xway.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c
drivers/s390/net/smsgiucv.c
drivers/scsi/arm/fas216.c
drivers/scsi/arm/oak.c
drivers/sh/intc/access.c
drivers/sh/intc/chip.c
drivers/spi/spi-s3c64xx.c
drivers/staging/dgrp/dgrp_mon_ops.c
drivers/staging/dgrp/dgrp_specproc.c
drivers/staging/dgrp/dgrp_tty.c
drivers/staging/tidspbridge/include/dspbridge/host_os.h
drivers/thermal/Kconfig
drivers/tty/n_tty.c
drivers/tty/pty.c
drivers/tty/serial/8250/8250.c
drivers/tty/serial/8250/8250.h
drivers/tty/serial/8250/8250_early.c
drivers/tty/serial/8250/8250_hp300.c
drivers/tty/serial/Kconfig
drivers/tty/serial/samsung.c
drivers/tty/serial/sccnxp.c
drivers/tty/serial/sh-sci.c
drivers/tty/sysrq.c
drivers/tty/tty_audit.c
drivers/tty/tty_buffer.c
drivers/tty/tty_io.c
drivers/tty/tty_ldisc.c
drivers/tty/tty_port.c
drivers/tty/vt/selection.c
drivers/usb/class/cdc-acm.c
drivers/usb/core/devio.c
drivers/usb/core/driver.c
drivers/usb/core/hub.c
drivers/usb/dwc3/core.c
drivers/usb/dwc3/gadget.c
drivers/usb/gadget/Kconfig
drivers/usb/gadget/lpc32xx_udc.c
drivers/usb/gadget/omap_udc.c
drivers/usb/host/ehci-fsl.c
drivers/usb/host/ehci-omap.c
drivers/usb/host/ehci-orion.c
drivers/usb/host/ehci-vt8500.c
drivers/usb/host/ohci-omap.c
drivers/usb/host/ohci-omap3.c
drivers/usb/host/uhci-platform.c
drivers/usb/host/xhci.c
drivers/usb/musb/am35x.c
drivers/usb/musb/musb_dsps.c
drivers/usb/musb/omap2430.h
drivers/usb/musb/tusb6010_omap.c
drivers/usb/renesas_usbhs/mod.c
drivers/usb/renesas_usbhs/pipe.h
drivers/usb/serial/ark3116.c
drivers/usb/serial/belkin_sa.c
drivers/usb/serial/cp210x.c
drivers/usb/serial/cyberjack.c
drivers/usb/serial/cypress_m8.c
drivers/usb/serial/f81232.c
drivers/usb/serial/garmin_gps.c
drivers/usb/serial/io_edgeport.c
drivers/usb/serial/io_tables.h
drivers/usb/serial/io_ti.c
drivers/usb/serial/iuu_phoenix.c
drivers/usb/serial/keyspan_pda.c
drivers/usb/serial/kl5kusb105.c
drivers/usb/serial/kobil_sct.c
drivers/usb/serial/option.c
drivers/usb/serial/oti6858.c
drivers/usb/serial/pl2303.c
drivers/usb/serial/spcp8x5.c
drivers/usb/serial/ssu100.c
drivers/usb/serial/ti_usb_3410_5052.c
drivers/video/backlight/lm3639_bl.c
drivers/video/omap/lcd_inn1510.c
drivers/video/omap/lcdc.c
drivers/video/omap/omapfb_main.c
drivers/video/omap/sossi.c
drivers/video/omap2/dss/core.c
drivers/video/omap2/dss/dispc.c
drivers/video/omap2/dss/dss.c
drivers/video/omap2/dss/dss_features.c
drivers/video/omap2/dss/dss_features.h
drivers/video/omap2/dss/hdmi.c
drivers/video/omap2/omapfb/omapfb-ioctl.c
drivers/video/omap2/omapfb/omapfb-main.c
drivers/video/omap2/omapfb/omapfb-sysfs.c
drivers/video/omap2/vrfb.c
drivers/xen/xenbus/xenbus_xs.c
fs/coredump.c
fs/devpts/inode.c
fs/ext2/super.c
fs/ext3/namei.c
fs/ext3/namei.h
fs/ext3/super.c
fs/lockd/clntxdr.c
fs/lockd/svcproc.c
fs/proc/internal.h
fs/proc/task_mmu.c
fs/quota/dquot.c
fs/xattr.c
include/Kbuild
include/asm-generic/Kbuild [deleted file]
include/drm/Kbuild [deleted file]
include/linux/Kbuild
include/linux/byteorder/Kbuild [deleted file]
include/linux/caif/Kbuild [deleted file]
include/linux/can/Kbuild [deleted file]
include/linux/coredump.h
include/linux/devpts_fs.h
include/linux/dvb/Kbuild
include/linux/dvb/audio.h [deleted file]
include/linux/dvb/ca.h [deleted file]
include/linux/dvb/dmx.h
include/linux/dvb/frontend.h [deleted file]
include/linux/dvb/net.h [deleted file]
include/linux/dvb/osd.h [deleted file]
include/linux/dvb/version.h [deleted file]
include/linux/dvb/video.h
include/linux/elf-fdpic.h [new file with mode: 0644]
include/linux/fs.h
include/linux/hsi/Kbuild
include/linux/hsi/hsi_char.h [deleted file]
include/linux/isdn/Kbuild [deleted file]
include/linux/mmc/Kbuild [deleted file]
include/linux/netfilter/Kbuild [deleted file]
include/linux/netfilter/ipset/Kbuild [deleted file]
include/linux/netfilter_arp/Kbuild [deleted file]
include/linux/netfilter_bridge/Kbuild [deleted file]
include/linux/netfilter_ipv4/Kbuild [deleted file]
include/linux/netfilter_ipv6/Kbuild [deleted file]
include/linux/nfsd/Kbuild [deleted file]
include/linux/of.h
include/linux/of_address.h
include/linux/of_irq.h
include/linux/pid_namespace.h
include/linux/platform_data/leds-omap.h [new file with mode: 0644]
include/linux/platform_data/mmc-omap.h [new file with mode: 0644]
include/linux/platform_data/mtd-nand-omap2.h
include/linux/platform_data/mtd-onenand-omap2.h
include/linux/platform_data/usb-omap.h [new file with mode: 0644]
include/linux/ratelimit.h
include/linux/spi/Kbuild [deleted file]
include/linux/sunrpc/Kbuild [deleted file]
include/linux/tc_act/Kbuild [deleted file]
include/linux/tc_ematch/Kbuild [deleted file]
include/linux/tty.h
include/linux/tty_flip.h
include/linux/usb.h
include/linux/usb/Kbuild
include/linux/usb/audio.h
include/linux/usb/cdc.h [deleted file]
include/linux/usb/ch11.h [deleted file]
include/linux/usb/ch9.h
include/linux/usb/functionfs.h
include/linux/usb/g_printer.h [deleted file]
include/linux/usb/gadgetfs.h [deleted file]
include/linux/usb/midi.h [deleted file]
include/linux/usb/tmc.h [deleted file]
include/linux/usb/video.h [deleted file]
include/linux/wimax/Kbuild [deleted file]
include/mtd/Kbuild [deleted file]
include/uapi/asm-generic/kvm_para.h
include/uapi/linux/dvb/Kbuild
include/uapi/linux/dvb/audio.h [new file with mode: 0644]
include/uapi/linux/dvb/ca.h [new file with mode: 0644]
include/uapi/linux/dvb/dmx.h [new file with mode: 0644]
include/uapi/linux/dvb/frontend.h [new file with mode: 0644]
include/uapi/linux/dvb/net.h [new file with mode: 0644]
include/uapi/linux/dvb/osd.h [new file with mode: 0644]
include/uapi/linux/dvb/version.h [new file with mode: 0644]
include/uapi/linux/dvb/video.h [new file with mode: 0644]
include/uapi/linux/elf-fdpic.h
include/uapi/linux/fs.h
include/uapi/linux/hsi/Kbuild
include/uapi/linux/hsi/hsi_char.h [new file with mode: 0644]
include/uapi/linux/irqnr.h
include/uapi/linux/usb/Kbuild
include/uapi/linux/usb/audio.h [new file with mode: 0644]
include/uapi/linux/usb/cdc.h [new file with mode: 0644]
include/uapi/linux/usb/ch11.h [new file with mode: 0644]
include/uapi/linux/usb/ch9.h [new file with mode: 0644]
include/uapi/linux/usb/functionfs.h [new file with mode: 0644]
include/uapi/linux/usb/g_printer.h [new file with mode: 0644]
include/uapi/linux/usb/gadgetfs.h [new file with mode: 0644]
include/uapi/linux/usb/midi.h [new file with mode: 0644]
include/uapi/linux/usb/tmc.h [new file with mode: 0644]
include/uapi/linux/usb/video.h [new file with mode: 0644]
include/video/omapdss.h
include/video/omapvrfb.h [new file with mode: 0644]
include/xen/Kbuild [deleted file]
kernel/module-internal.h
kernel/module.c
kernel/module_signing.c
kernel/pid_namespace.c
kernel/printk.c
kernel/sys.c
lib/dma-debug.c
mm/compaction.c
mm/fremap.c
mm/huge_memory.c
mm/mempolicy.c
mm/slob.c
net/8021q/vlan_core.c
net/ipv6/addrconf.c
net/irda/ircomm/ircomm_tty.c
net/sctp/sm_sideeffect.c
net/sunrpc/cache.c
scripts/Makefile.asm-generic
scripts/Makefile.fwinst
scripts/Makefile.modinst
scripts/Makefile.modpost
scripts/dtc/dtc.h
scripts/sign-file [changed mode: 0644->0755]
scripts/x509keyid [deleted file]
security/apparmor/Makefile
security/selinux/hooks.c
sound/pci/ac97/ac97_codec.c
sound/pci/emu10k1/emu10k1_main.c
sound/pci/hda/hda_intel.c
sound/pci/hda/patch_realtek.c
sound/soc/Makefile
sound/soc/codecs/da9055.c
sound/soc/codecs/twl6040.c
sound/soc/codecs/wm2200.c
sound/soc/omap/ams-delta.c
sound/soc/omap/omap-abe-twl6040.c
sound/soc/omap/omap-mcpdm.c
sound/soc/omap/omap-pcm.c
sound/soc/pxa/mmp-pcm.c
sound/soc/samsung/bells.c
sound/soc/sh/fsi.c
sound/soc/soc-jack.c
tools/lib/traceevent/event-parse.c
tools/lib/traceevent/parse-filter.c
tools/perf/Makefile
tools/perf/perf.h
tools/perf/ui/browsers/hists.c
tools/perf/util/parse-events.c
tools/perf/util/setup.py
tools/perf/util/sort.c

index 0f2f40f71915fcdbf1a10b1e975131d137cdf2fa..92bd0e45dfa165cfdaddb3de4f91e2db61a7a927 100644 (file)
 *.o.*
 *.a
 *.s
-*.ko.unsigned
-*.ko.stripped
-*.ko.stripped.dig
-*.ko.stripped.sig
 *.ko
 *.so
 *.so.dbg
@@ -95,6 +91,4 @@ GTAGS
 extra_certificates
 signing_key.priv
 signing_key.x509
-signing_key.x509.keyid
-signing_key.x509.signer
 x509.genkey
index 9b7e4c55792803b1c053bc99026860a5ce56e88d..f9fd615427fbd4c0a718d66ed1b7de006ab796e6 100644 (file)
@@ -56,15 +56,15 @@ FUNCS = \
        write \
 
 IOCTLS = \
-       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/videodev2.h) \
-       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/audio.h) \
-       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/ca.h) \
-       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/dmx.h) \
-       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/frontend.h) \
-       $(shell perl -ne 'print "$$1 " if /\#define\s+([A-Z][^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/net.h) \
-       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/video.h) \
-       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/media.h) \
-       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/v4l2-subdev.h) \
+       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/videodev2.h) \
+       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/audio.h) \
+       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/ca.h) \
+       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/dmx.h) \
+       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/frontend.h) \
+       $(shell perl -ne 'print "$$1 " if /\#define\s+([A-Z][^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/net.h) \
+       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/video.h) \
+       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/media.h) \
+       $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/v4l2-subdev.h) \
        VIDIOC_SUBDEV_G_FRAME_INTERVAL \
        VIDIOC_SUBDEV_S_FRAME_INTERVAL \
        VIDIOC_SUBDEV_ENUM_MBUS_CODE \
@@ -74,32 +74,32 @@ IOCTLS = \
        VIDIOC_SUBDEV_S_SELECTION \
 
 TYPES = \
-       $(shell perl -ne 'print "$$1 " if /^typedef\s+[^\s]+\s+([^\s]+)\;/' $(srctree)/include/linux/videodev2.h) \
-       $(shell perl -ne 'print "$$1 " if /^}\s+([a-z0-9_]+_t)/' $(srctree)/include/linux/dvb/frontend.h)
+       $(shell perl -ne 'print "$$1 " if /^typedef\s+[^\s]+\s+([^\s]+)\;/' $(srctree)/include/uapi/linux/videodev2.h) \
+       $(shell perl -ne 'print "$$1 " if /^}\s+([a-z0-9_]+_t)/' $(srctree)/include/uapi/linux/dvb/frontend.h)
 
 ENUMS = \
-       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/videodev2.h) \
-       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/audio.h) \
-       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/ca.h) \
-       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/dmx.h) \
-       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/frontend.h) \
-       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/net.h) \
-       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/video.h) \
-       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/media.h) \
-       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-mediabus.h) \
-       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-subdev.h)
+       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/videodev2.h) \
+       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/audio.h) \
+       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/ca.h) \
+       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/dmx.h) \
+       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/frontend.h) \
+       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/net.h) \
+       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/video.h) \
+       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/media.h) \
+       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-mediabus.h) \
+       $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-subdev.h)
 
 STRUCTS = \
-       $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/videodev2.h) \
-       $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s\{]+)\s*/)' $(srctree)/include/linux/dvb/audio.h) \
-       $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/ca.h) \
-       $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/dmx.h) \
-       $(shell perl -ne 'print "$$1 " if (!/dtv\_cmds\_h/ && /^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/frontend.h) \
-       $(shell perl -ne 'print "$$1 " if (/^struct\s+([A-Z][^\s]+)\s+/)' $(srctree)/include/linux/dvb/net.h) \
-       $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/video.h) \
-       $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/media.h) \
-       $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-subdev.h) \
-       $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-mediabus.h)
+       $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/videodev2.h) \
+       $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s\{]+)\s*/)' $(srctree)/include/uapi/linux/dvb/audio.h) \
+       $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/ca.h) \
+       $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/dmx.h) \
+       $(shell perl -ne 'print "$$1 " if (!/dtv\_cmds\_h/ && /^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/frontend.h) \
+       $(shell perl -ne 'print "$$1 " if (/^struct\s+([A-Z][^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/net.h) \
+       $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/video.h) \
+       $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/media.h) \
+       $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-subdev.h) \
+       $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-mediabus.h)
 
 ERRORS = \
        E2BIG \
@@ -205,7 +205,7 @@ $(MEDIA_OBJ_DIR)/v4l2.xml: $(OBJIMGFILES)
        @(ln -sf $(MEDIA_SRC_DIR)/v4l/*xml $(MEDIA_OBJ_DIR)/)
        @(ln -sf $(MEDIA_SRC_DIR)/dvb/*xml $(MEDIA_OBJ_DIR)/)
 
-$(MEDIA_OBJ_DIR)/videodev2.h.xml: $(srctree)/include/linux/videodev2.h $(MEDIA_OBJ_DIR)/v4l2.xml
+$(MEDIA_OBJ_DIR)/videodev2.h.xml: $(srctree)/include/uapi/linux/videodev2.h $(MEDIA_OBJ_DIR)/v4l2.xml
        @$($(quiet)gen_xml)
        @(                                      \
        echo "<programlisting>") > $@
@@ -216,7 +216,7 @@ $(MEDIA_OBJ_DIR)/videodev2.h.xml: $(srctree)/include/linux/videodev2.h $(MEDIA_O
        @(                                      \
        echo "</programlisting>") >> $@
 
-$(MEDIA_OBJ_DIR)/audio.h.xml: $(srctree)/include/linux/dvb/audio.h $(MEDIA_OBJ_DIR)/v4l2.xml
+$(MEDIA_OBJ_DIR)/audio.h.xml: $(srctree)/include/uapi/linux/dvb/audio.h $(MEDIA_OBJ_DIR)/v4l2.xml
        @$($(quiet)gen_xml)
        @(                                      \
        echo "<programlisting>") > $@
@@ -227,7 +227,7 @@ $(MEDIA_OBJ_DIR)/audio.h.xml: $(srctree)/include/linux/dvb/audio.h $(MEDIA_OBJ_D
        @(                                      \
        echo "</programlisting>") >> $@
 
-$(MEDIA_OBJ_DIR)/ca.h.xml: $(srctree)/include/linux/dvb/ca.h $(MEDIA_OBJ_DIR)/v4l2.xml
+$(MEDIA_OBJ_DIR)/ca.h.xml: $(srctree)/include/uapi/linux/dvb/ca.h $(MEDIA_OBJ_DIR)/v4l2.xml
        @$($(quiet)gen_xml)
        @(                                      \
        echo "<programlisting>") > $@
@@ -238,7 +238,7 @@ $(MEDIA_OBJ_DIR)/ca.h.xml: $(srctree)/include/linux/dvb/ca.h $(MEDIA_OBJ_DIR)/v4
        @(                                      \
        echo "</programlisting>") >> $@
 
-$(MEDIA_OBJ_DIR)/dmx.h.xml: $(srctree)/include/linux/dvb/dmx.h $(MEDIA_OBJ_DIR)/v4l2.xml
+$(MEDIA_OBJ_DIR)/dmx.h.xml: $(srctree)/include/uapi/linux/dvb/dmx.h $(MEDIA_OBJ_DIR)/v4l2.xml
        @$($(quiet)gen_xml)
        @(                                      \
        echo "<programlisting>") > $@
@@ -249,7 +249,7 @@ $(MEDIA_OBJ_DIR)/dmx.h.xml: $(srctree)/include/linux/dvb/dmx.h $(MEDIA_OBJ_DIR)/
        @(                                      \
        echo "</programlisting>") >> $@
 
-$(MEDIA_OBJ_DIR)/frontend.h.xml: $(srctree)/include/linux/dvb/frontend.h $(MEDIA_OBJ_DIR)/v4l2.xml
+$(MEDIA_OBJ_DIR)/frontend.h.xml: $(srctree)/include/uapi/linux/dvb/frontend.h $(MEDIA_OBJ_DIR)/v4l2.xml
        @$($(quiet)gen_xml)
        @(                                      \
        echo "<programlisting>") > $@
@@ -260,7 +260,7 @@ $(MEDIA_OBJ_DIR)/frontend.h.xml: $(srctree)/include/linux/dvb/frontend.h $(MEDIA
        @(                                      \
        echo "</programlisting>") >> $@
 
-$(MEDIA_OBJ_DIR)/net.h.xml: $(srctree)/include/linux/dvb/net.h $(MEDIA_OBJ_DIR)/v4l2.xml
+$(MEDIA_OBJ_DIR)/net.h.xml: $(srctree)/include/uapi/linux/dvb/net.h $(MEDIA_OBJ_DIR)/v4l2.xml
        @$($(quiet)gen_xml)
        @(                                      \
        echo "<programlisting>") > $@
@@ -271,7 +271,7 @@ $(MEDIA_OBJ_DIR)/net.h.xml: $(srctree)/include/linux/dvb/net.h $(MEDIA_OBJ_DIR)/
        @(                                      \
        echo "</programlisting>") >> $@
 
-$(MEDIA_OBJ_DIR)/video.h.xml: $(srctree)/include/linux/dvb/video.h $(MEDIA_OBJ_DIR)/v4l2.xml
+$(MEDIA_OBJ_DIR)/video.h.xml: $(srctree)/include/uapi/linux/dvb/video.h $(MEDIA_OBJ_DIR)/v4l2.xml
        @$($(quiet)gen_xml)
        @(                                      \
        echo "<programlisting>") > $@
index 59ad69a9d777e768b26b9b21c63de8df59d805c7..29df25016c7c121b1965b7a79122a08b691c1ac4 100644 (file)
@@ -56,7 +56,7 @@
 !Enet/core/filter.c
      </sect1>
      <sect1><title>Generic Network Statistics</title>
-!Iinclude/linux/gen_stats.h
+!Iinclude/uapi/linux/gen_stats.h
 !Enet/core/gen_stats.c
 !Enet/core/gen_estimator.c
      </sect1>
@@ -80,7 +80,7 @@
 !Enet/wimax/op-rfkill.c
 !Enet/wimax/stack.c
 !Iinclude/net/wimax.h
-!Iinclude/linux/wimax.h
+!Iinclude/uapi/linux/wimax.h
      </sect1>
   </chapter>
 
index b2bea15137d29ce086d2666c4102358f2cafe207..16eb4c9e92330fe62214b3f6af5944c7bb92591e 100644 (file)
@@ -42,13 +42,7 @@ The driver interface depends on your hardware.  If your system
 properly provides the SMBIOS info for IPMI, the driver will detect it
 and just work.  If you have a board with a standard interface (These
 will generally be either "KCS", "SMIC", or "BT", consult your hardware
-manual), choose the 'IPMI SI handler' option.  A driver also exists
-for direct I2C access to the IPMI management controller.  Some boards
-support this, but it is unknown if it will work on every board.  For
-this, choose 'IPMI SMBus handler', but be ready to try to do some
-figuring to see if it will work on your system if the SMBIOS/APCI
-information is wrong or not present.  It is fairly safe to have both
-these enabled and let the drivers auto-detect what is present.
+manual), choose the 'IPMI SI handler' option.
 
 You should generally enable ACPI on your system, as systems with IPMI
 can have ACPI tables describing them.
@@ -58,8 +52,7 @@ their job correctly, the IPMI controller should be automatically
 detected (via ACPI or SMBIOS tables) and should just work.  Sadly,
 many boards do not have this information.  The driver attempts
 standard defaults, but they may not work.  If you fall into this
-situation, you need to read the section below named 'The SI Driver' or
-"The SMBus Driver" on how to hand-configure your system.
+situation, you need to read the section below named 'The SI Driver'.
 
 IPMI defines a standard watchdog timer.  You can enable this with the
 'IPMI Watchdog Timer' config option.  If you compile the driver into
@@ -104,12 +97,7 @@ driver, each open file for this device ties in to the message handler
 as an IPMI user.
 
 ipmi_si - A driver for various system interfaces.  This supports KCS,
-SMIC, and BT interfaces.  Unless you have an SMBus interface or your
-own custom interface, you probably need to use this.
-
-ipmi_smb - A driver for accessing BMCs on the SMBus. It uses the
-I2C kernel driver's SMBus interfaces to send and receive IPMI messages
-over the SMBus.
+SMIC, and BT interfaces.
 
 ipmi_watchdog - IPMI requires systems to have a very capable watchdog
 timer.  This driver implements the standard Linux watchdog timer
@@ -482,53 +470,6 @@ for specifying an interface.  Note that when removing an interface,
 only the first three parameters (si type, address type, and address)
 are used for the comparison.  Any options are ignored for removing.
 
-The SMBus Driver
-----------------
-
-The SMBus driver allows up to 4 SMBus devices to be configured in the
-system.  By default, the driver will register any SMBus interfaces it finds
-in the I2C address range of 0x20 to 0x4f on any adapter.  You can change this
-at module load time (for a module) with:
-
-  modprobe ipmi_smb.o
-       addr=<adapter1>,<i2caddr1>[,<adapter2>,<i2caddr2>[,...]]
-       dbg=<flags1>,<flags2>...
-       [defaultprobe=1] [dbg_probe=1]
-
-The addresses are specified in pairs, the first is the adapter ID and the
-second is the I2C address on that adapter.
-
-The debug flags are bit flags for each BMC found, they are:
-IPMI messages: 1, driver state: 2, timing: 4, I2C probe: 8
-
-Setting smb_defaultprobe to zero disabled the default probing of SMBus
-interfaces at address range 0x20 to 0x4f.  This means that only the
-BMCs specified on the smb_addr line will be detected.
-
-Setting smb_dbg_probe to 1 will enable debugging of the probing and
-detection process for BMCs on the SMBusses.
-
-Discovering the IPMI compliant BMC on the SMBus can cause devices
-on the I2C bus to fail. The SMBus driver writes a "Get Device ID" IPMI
-message as a block write to the I2C bus and waits for a response.
-This action can be detrimental to some I2C devices. It is highly recommended
-that the known I2c address be given to the SMBus driver in the smb_addr
-parameter. The default address range will not be used when a smb_addr
-parameter is provided.
-
-When compiled into the kernel, the addresses can be specified on the
-kernel command line as:
-
-  ipmb_smb.addr=<adapter1>,<i2caddr1>[,<adapter2>,<i2caddr2>[,...]]
-       ipmi_smb.dbg=<flags1>,<flags2>...
-       ipmi_smb.defaultprobe=0 ipmi_smb.dbg_probe=1
-
-These are the same options as on the module command line.
-
-Note that you might need some I2C changes if CONFIG_IPMI_PANIC_EVENT
-is enabled along with this, so the I2C driver knows to run to
-completion during sending a panic event.
-
 
 Other Pieces
 ------------
index c86b50c03ea8f02276d2a35deb4a6f5822d78be9..f17256f069baeebf2b8d8772ea9fa49147ccc2f2 100644 (file)
@@ -105,6 +105,7 @@ Process             Processor                                       TjMax(C)
                330/230                                         125
                E680/660/640/620                                90
                E680T/660T/640T/620T                            110
+               CE4170/4150/4110                                110
 
 45nm           Core2 Processors
                Solo ULV SU3500/3300                            100
index 790f774a303247c0693ed6c24c8d9dfd6103d2f0..843751c41fea59d207497d991a67bba5af1ee617 100644 (file)
@@ -60,8 +60,7 @@ increase the chances of your change being accepted.
 
 * Add the driver to Kconfig and Makefile in alphabetical order.
 
-* Make sure that all dependencies are listed in Kconfig. For new drivers, it
-  is most likely prudent to add a dependency on EXPERIMENTAL.
+* Make sure that all dependencies are listed in Kconfig.
 
 * Avoid forward declarations if you can. Rearrange the code if necessary.
 
index 642f84495b29888c5ff937d3b5f01faef5674ecc..2a4cdda4828ed8382809be4219e931565210d2d8 100644 (file)
@@ -116,6 +116,7 @@ On all -  write a character to /proc/sysrq-trigger.  e.g.:
 'w'    - Dumps tasks that are in uninterruptable (blocked) state.
 
 'x'    - Used by xmon interface on ppc/powerpc platforms.
+          Show global PMU Registers on sparc64.
 
 'y'    - Show global CPU Registers [SPARC-64 specific]
 
index e73060fe07888916a358331744397a1257cd1696..027ec2bfa135d4f5af20801b020c52d1f66a3f3f 100644 (file)
@@ -235,6 +235,7 @@ F:  drivers/platform/x86/acer-wmi.c
 
 ACPI
 M:     Len Brown <lenb@kernel.org>
+M:     Rafael J. Wysocki <rjw@sisk.pl>
 L:     linux-acpi@vger.kernel.org
 W:     http://www.lesswatts.org/projects/acpi/
 Q:     http://patchwork.kernel.org/project/linux-acpi/list/
@@ -4372,7 +4373,7 @@ F:        Documentation/scsi/53c700.txt
 F:     drivers/scsi/53c700*
 
 LED SUBSYSTEM
-M:     Bryan Wu <bryan.wu@canonical.com>
+M:     Bryan Wu <cooloney@gmail.com>
 M:     Richard Purdie <rpurdie@rpsys.net>
 L:     linux-leds@vger.kernel.org
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds.git
@@ -5019,6 +5020,20 @@ F:       net/ipv6/
 F:     include/net/ip*
 F:     arch/x86/net/*
 
+NETWORKING [IPSEC]
+M:     Steffen Klassert <steffen.klassert@secunet.com>
+M:     Herbert Xu <herbert@gondor.apana.org.au>
+M:     "David S. Miller" <davem@davemloft.net>
+L:     netdev@vger.kernel.org
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
+S:     Maintained
+F:     net/xfrm/
+F:     net/key/
+F:     net/ipv4/xfrm*
+F:     net/ipv6/xfrm*
+F:     include/uapi/linux/xfrm.h
+F:     include/net/xfrm.h
+
 NETWORKING [LABELED] (NetLabel, CIPSO, Labeled IPsec, SECMARK)
 M:     Paul Moore <paul@paul-moore.com>
 L:     netdev@vger.kernel.org
@@ -7731,6 +7746,13 @@ W:       http://www.ideasonboard.org/uvc/
 S:     Maintained
 F:     drivers/media/usb/uvc/
 
+USB WEBCAM GADGET
+M:     Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+L:     linux-usb@vger.kernel.org
+S:     Maintained
+F:     drivers/usb/gadget/*uvc*.c
+F:     drivers/usb/gadget/webcam.c
+
 USB WIRELESS RNDIS DRIVER (rndis_wlan)
 M:     Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
 L:     linux-wireless@vger.kernel.org
index 5be2ee8c90e4247b90ec1aed9421492226d5f7f8..14c93b39b9291a45d07bd6c4afe8fe792ede241f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 3
 PATCHLEVEL = 7
 SUBLEVEL = 0
-EXTRAVERSION = -rc1
+EXTRAVERSION = -rc2
 NAME = Terrified Chipmunk
 
 # *DOCUMENTATION*
@@ -437,7 +437,9 @@ endif
 PHONY += asm-generic
 asm-generic:
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
-                   obj=arch/$(SRCARCH)/include/generated/asm
+                   src=asm obj=arch/$(SRCARCH)/include/generated/asm
+       $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
+                   src=uapi/asm obj=arch/$(SRCARCH)/include/generated/uapi/asm
 
 # To make sure we do not include .config for any of the *config targets
 # catch them early, and hand them over to scripts/kconfig/Makefile
@@ -717,6 +719,17 @@ endif # INSTALL_MOD_STRIP
 export mod_strip_cmd
 
 
+ifeq ($(CONFIG_MODULE_SIG),y)
+MODSECKEY = ./signing_key.priv
+MODPUBKEY = ./signing_key.x509
+export MODPUBKEY
+mod_sign_cmd = perl $(srctree)/scripts/sign-file $(MODSECKEY) $(MODPUBKEY)
+else
+mod_sign_cmd = true
+endif
+export mod_sign_cmd
+
+
 ifeq ($(KBUILD_EXTMOD),)
 core-y         += kernel/ mm/ fs/ ipc/ security/ crypto/ block/
 
index c1ce813fcc4a1ea9094eb450ce4e50efd3d6048b..f37cf9fa5fa073318b3c6faad5d0a1480bd99826 100644 (file)
@@ -25,6 +25,8 @@ dtb-$(CONFIG_ARCH_EXYNOS) += exynos4210-origen.dtb \
        exynos4210-trats.dtb \
        exynos5250-smdk5250.dtb
 dtb-$(CONFIG_ARCH_HIGHBANK) += highbank.dtb
+dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \
+       integratorcp.dtb
 dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
 dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
        kirkwood-dns325.dtb \
index 96fb824b5e6ecb3dd26481dcdbd3d67bb691772d..5a00022383e74d7e457c34be0331eb3edf7c0521 100644 (file)
@@ -4,21 +4,32 @@
        compatible = "marvell,dove";
        model = "Marvell Armada 88AP510 SoC";
 
-       interrupt-parent = <&intc>;
-
-       intc: interrupt-controller {
-               compatible = "marvell,orion-intc";
-               interrupt-controller;
-               #interrupt-cells = <1>;
-               reg = <0xf1020204 0x04>,
-                     <0xf1020214 0x04>;
-       };
-
-       mbus@f1000000 {
+       soc@f1000000 {
                compatible = "simple-bus";
-               ranges = <0 0xf1000000 0x4000000>;
                #address-cells = <1>;
                #size-cells = <1>;
+               interrupt-parent = <&intc>;
+
+               ranges = <0xc8000000 0xc8000000 0x0100000   /* CESA SRAM   1M */
+                         0xe0000000 0xe0000000 0x8000000   /* PCIe0 Mem 128M */
+                         0xe8000000 0xe8000000 0x8000000   /* PCIe1 Mem 128M */
+                         0xf0000000 0xf0000000 0x0100000   /* ScratchPad  1M */
+                         0x00000000 0xf1000000 0x1000000   /* SB/NB regs 16M */
+                         0xf2000000 0xf2000000 0x0100000   /* PCIe0 I/O   1M */
+                         0xf2100000 0xf2100000 0x0100000   /* PCIe0 I/O   1M */
+                         0xf8000000 0xf8000000 0x8000000>; /* BootROM   128M */
+
+               l2: l2-cache {
+                       compatible = "marvell,tauros2-cache";
+                       marvell,tauros2-cache-features = <0>;
+               };
+
+               intc: interrupt-controller {
+                       compatible = "marvell,orion-intc";
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       reg = <0x20204 0x04>, <0x20214 0x04>;
+               };
 
                uart0: serial@12000 {
                        compatible = "ns16550a";
                        status = "disabled";
                };
 
-               wdt: wdt@20300 {
-                       compatible = "marvell,orion-wdt";
-                       reg = <0x20300 0x28>;
-               };
-
                gpio0: gpio@d0400 {
                        compatible = "marvell,orion-gpio";
                        #gpio-cells = <2>;
                        nr-ports = <1>;
                        status = "disabled";
                };
+
+               crypto: crypto@30000 {
+                       compatible = "marvell,orion-crypto";
+                       reg = <0x30000 0x10000>,
+                             <0xc8000000 0x800>;
+                       reg-names = "regs", "sram";
+                       interrupts = <31>;
+                       status = "okay";
+               };
        };
 };
index 15df4c105e89c3b0ac20c7c0800307f4aa644a62..5bfa02a3f85cdd027d25d488513272ec4082579c 100644 (file)
                                        pinctrl_hog: hoggrp {
                                                fsl,pins = <
                                                        176  0x80000000 /* MX6Q_PAD_EIM_D25__GPIO_3_25 */
+                                               >;
+                                       };
+                               };
+
+                               arm2 {
+                                       pinctrl_usdhc3_arm2: usdhc3grp-arm2 {
+                                               fsl,pins = <
                                                        1363 0x80000000 /* MX6Q_PAD_NANDF_CS0__GPIO_6_11 */
                                                        1369 0x80000000 /* MX6Q_PAD_NANDF_CS1__GPIO_6_14 */
                                                >;
@@ -58,7 +65,8 @@
                                wp-gpios = <&gpio6 14 0>;
                                vmmc-supply = <&reg_3p3v>;
                                pinctrl-names = "default";
-                               pinctrl-0 = <&pinctrl_usdhc3_1>;
+                               pinctrl-0 = <&pinctrl_usdhc3_1
+                                            &pinctrl_usdhc3_arm2>;
                                status = "okay";
                        };
 
index 8ac51c08269d303b77cd0560133e475dc7bfa927..8fea375c734d75e99ad06adac9f65f5413989285 100644 (file)
                #size-cells = <0>;
                button@1 {
                        label = "Function Button";
-                       linux,code = <132>;
+                       linux,code = <357>;
                        gpios = <&gpio1 9 1>;
                };
                button@2 {
                        label = "Power-on Switch";
-                       linux,code = <116>;
+                       linux,code = <0>;
+                       linux,input-type = <5>;
                        gpios = <&gpio1 10 1>;
                };
                button@3 {
                        label = "Power-auto Switch";
-                       linux,code = <142>;
+                       linux,code = <1>;
+                       linux,input-type = <5>;
                        gpios = <&gpio1 11 1>;
                };
        };
                compatible = "gpio-leds";
 
                led@1 {
-                       label = "lschlv2:blue:func";
+                       label = "lsxl:blue:func";
                        gpios = <&gpio1 4 1>;
                };
 
                led@2 {
-                       label = "lschlv2:red:alarm";
+                       label = "lsxl:red:alarm";
                        gpios = <&gpio1 5 1>;
                };
 
                led@3 {
-                       label = "lschlv2:amber:info";
+                       label = "lsxl:amber:info";
                        gpios = <&gpio1 6 1>;
                };
 
                led@4 {
-                       label = "lschlv2:blue:power";
+                       label = "lsxl:blue:power";
                        gpios = <&gpio1 7 1>;
                        linux,default-trigger = "default-on";
                };
 
                led@5 {
-                       label = "lschlv2:red:func";
+                       label = "lsxl:red:func";
                        gpios = <&gpio1 16 1>;
                };
        };
index b459691655ab653182817134a5b358696bab18d8..330f833ac3b03e97b376bbcdcf418770b3431a23 100644 (file)
                ehci@d8007100 {
                        compatible = "via,vt8500-ehci";
                        reg = <0xd8007100 0x200>;
-                       interrupts = <43>;
+                       interrupts = <1>;
                };
 
                uhci@d8007300 {
                        compatible = "platform-uhci";
                        reg = <0xd8007300 0x200>;
-                       interrupts = <43>;
+                       interrupts = <0>;
                };
 
                fb@d8050800 {
index 417bac1846bdeb71dc475bfe7bee3e729623caa4..34711757ba59a958592d31ea527170c1356c282c 100644 (file)
@@ -88,9 +88,9 @@ ENTRY(ret_from_fork)
        bl      schedule_tail
        cmp     r5, #0
        movne   r0, r4
-       movne   lr, pc
+       adrne   lr, BSYM(1f)
        movne   pc, r5
-       get_thread_info tsk
+1:     get_thread_info tsk
        b       ret_slow_syscall
 ENDPROC(ret_from_fork)
 
index b37bef1d5ffad9828f6734eb9a50262327ea950d..f723fe13d0f032c48126c1e745c894e296d7ccbf 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/irq.h>
 #include <plat/time.h>
 #include <linux/platform_data/usb-ehci-orion.h>
+#include <plat/irq.h>
 #include <plat/common.h>
 #include <plat/addr-map.h>
 #include "common.h"
@@ -109,8 +110,8 @@ static void __init dove_clk_init(void)
 
        orion_clkdev_add(NULL, "orion-ehci.0", usb0);
        orion_clkdev_add(NULL, "orion-ehci.1", usb1);
-       orion_clkdev_add(NULL, "mv643xx_eth.0", ge);
-       orion_clkdev_add("0", "sata_mv.0", sata);
+       orion_clkdev_add(NULL, "mv643xx_eth_port.0", ge);
+       orion_clkdev_add(NULL, "sata_mv.0", sata);
        orion_clkdev_add("0", "pcie", pex0);
        orion_clkdev_add("1", "pcie", pex1);
        orion_clkdev_add(NULL, "sdhci-dove.0", sdio0);
@@ -399,7 +400,7 @@ static void __init dove_dt_init(void)
                (dove_tclk + 499999) / 1000000);
 
 #ifdef CONFIG_CACHE_TAUROS2
-       tauros2_init();
+       tauros2_init(0);
 #endif
        dove_setup_cpu_mbus();
 
@@ -415,7 +416,6 @@ static void __init dove_dt_init(void)
        dove_ehci0_init();
        dove_ehci1_init();
        dove_pcie_init(1, 1);
-       dove_crypto_init();
 
        of_platform_populate(NULL, of_default_bus_match_table,
                             dove_auxdata_lookup, NULL);
index bb15b26041cb7d6bd13a5ca4d5532cb66632e2cc..0ef4435b16570dccde5af41737bf25987051270d 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <linux/kernel.h>
 #include <linux/pci.h>
+#include <linux/clk.h>
 #include <video/vga.h>
 #include <asm/mach/pci.h>
 #include <asm/mach/arch.h>
@@ -188,6 +189,10 @@ static void __init add_pcie_port(int index, void __iomem *base)
 
        if (orion_pcie_link_up(base)) {
                struct pcie_port *pp = &pcie_port[num_pcie_ports++];
+               struct clk *clk = clk_get_sys("pcie", (index ? "1" : "0"));
+
+               if (!IS_ERR(clk))
+                       clk_prepare_enable(clk);
 
                printk(KERN_INFO "link up\n");
 
index 70c5a28824093f675880aab0c5c595206ac7e1d6..d94872fed8c0cb2a5529260cb2ceca68d1c75a14 100644 (file)
@@ -51,9 +51,7 @@ static void __init kirkwood_dt_init(void)
 
        kirkwood_setup_cpu_mbus();
 
-#ifdef CONFIG_CACHE_FEROCEON_L2
        kirkwood_l2_init();
-#endif
 
        /* Setup root of clk tree */
        kirkwood_clk_init();
index 3991077f58a26aa5f3a77c2ff005e7c7838a1edb..2c6c218fb79e217cf607da9ad510ac7dece3222f 100644 (file)
@@ -633,6 +633,7 @@ char * __init kirkwood_id(void)
 
 void __init kirkwood_l2_init(void)
 {
+#ifdef CONFIG_CACHE_FEROCEON_L2
 #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
        writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
        feroceon_l2_init(1);
@@ -640,6 +641,7 @@ void __init kirkwood_l2_init(void)
        writel(readl(L2_CONFIG_REG) & ~L2_WRITETHROUGH, L2_CONFIG_REG);
        feroceon_l2_init(0);
 #endif
+#endif
 }
 
 void __init kirkwood_init(void)
@@ -657,9 +659,7 @@ void __init kirkwood_init(void)
 
        kirkwood_setup_cpu_mbus();
 
-#ifdef CONFIG_CACHE_FEROCEON_L2
        kirkwood_l2_init();
-#endif
 
        /* Setup root of clk tree */
        kirkwood_clk_init();
index 9518bf5996dccffbf11b284227837c4a96f61a59..a8fce3ccc707fcea16c27f9edd8a47ef8961d2a0 100644 (file)
@@ -444,16 +444,28 @@ static struct omap1_cam_platform_data ams_delta_camera_platform_data = {
        .lclk_khz_max   = 1334,         /* results in 5fps CIF, 10fps QCIF */
 };
 
+static struct platform_device ams_delta_audio_device = {
+       .name   = "ams-delta-audio",
+       .id     = -1,
+};
+
+static struct platform_device cx20442_codec_device = {
+       .name   = "cx20442-codec",
+       .id     = -1,
+};
+
 static struct platform_device *ams_delta_devices[] __initdata = {
        &latch1_gpio_device,
        &latch2_gpio_device,
        &ams_delta_kp_device,
        &ams_delta_camera_device,
+       &ams_delta_audio_device,
 };
 
 static struct platform_device *late_devices[] __initdata = {
        &ams_delta_nand_device,
        &ams_delta_lcd_device,
+       &cx20442_codec_device,
 };
 
 static void __init ams_delta_init(void)
@@ -613,7 +625,6 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
        .atag_offset    = 0x100,
        .map_io         = ams_delta_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = ams_delta_init,
        .init_late      = ams_delta_init_late,
index 4b6de70c47a686576795c1a59db319590a53efb8..8b5800acf726b28b9de35fd93ca3a1687b9e0ce1 100644 (file)
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <plat/tc.h>
+#include <mach/tc.h>
 #include <mach/mux.h>
 #include <mach/flash.h>
-#include <plat/fpga.h>
+#include <../plat-omap/fpga.h>
 #include <linux/platform_data/keypad-omap.h>
 
 #include <mach/hardware.h>
@@ -123,9 +123,9 @@ static struct resource smc91x_resources[] = {
 
 static void __init fsample_init_smc91x(void)
 {
-       fpga_write(1, H2P2_DBG_FPGA_LAN_RESET);
+       __raw_writeb(1, H2P2_DBG_FPGA_LAN_RESET);
        mdelay(50);
-       fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1,
+       __raw_writeb(__raw_readb(H2P2_DBG_FPGA_LAN_RESET) & ~1,
                   H2P2_DBG_FPGA_LAN_RESET);
        mdelay(50);
 }
@@ -362,7 +362,6 @@ MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
        .atag_offset    = 0x100,
        .map_io         = omap_fsample_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_fsample_init,
        .init_late      = omap1_init_late,
index 4ec579fdd366e15c034c07d186eeb3c16dacf4cb..608e7d2a27789b63c6aee7a90259083f7679b124 100644 (file)
@@ -81,7 +81,6 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
        .atag_offset    = 0x100,
        .map_io         = omap16xx_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_generic_init,
        .init_late      = omap1_init_late,
index e1362ce48497e53bc60ef3d81e9ee309f0601bfe..7119ef28e0adf2e7869da0d4238fe0b30ea677c7 100644 (file)
  */
 #include <linux/gpio.h>
 #include <linux/platform_device.h>
-
+#include <linux/platform_data/gpio-omap.h>
 #include <linux/i2c/tps65010.h>
 
-#include <plat/mmc.h>
-
 #include "board-h2.h"
+#include "mmc.h"
 
 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
 
index 376f7f29ef77391fc8de34c9cb8bb6264abdef09..9134b646f01b2760b245c9791929b781370e67a5 100644 (file)
@@ -39,8 +39,8 @@
 #include <asm/mach/map.h>
 
 #include <mach/mux.h>
-#include <plat/dma.h>
-#include <plat/tc.h>
+#include <plat-omap/dma-omap.h>
+#include <mach/tc.h>
 #include <mach/irda.h>
 #include <linux/platform_data/keypad-omap.h>
 #include <mach/flash.h>
@@ -50,6 +50,7 @@
 
 #include "common.h"
 #include "board-h2.h"
+#include "dma.h"
 
 /* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
 #define OMAP1610_ETHR_START            0x04000300
@@ -458,7 +459,6 @@ MACHINE_START(OMAP_H2, "TI-H2")
        .atag_offset    = 0x100,
        .map_io         = omap16xx_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = h2_init,
        .init_late      = omap1_init_late,
index c74daace8cd686482d3c440eb6a4d1a0472947c7..17d77914d769233d4c1360ef5159a3df98cda596 100644 (file)
@@ -16,9 +16,8 @@
 
 #include <linux/i2c/tps65010.h>
 
-#include <plat/mmc.h>
-
 #include "board-h3.h"
+#include "mmc.h"
 
 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
 
index ededdb7ef28c021aa2f43ed4dcacbb8fe1c6e723..bf213d1d807534bb0ed21674db4d3a72ca3c60fa 100644 (file)
@@ -41,9 +41,9 @@
 #include <asm/mach/map.h>
 
 #include <mach/mux.h>
-#include <plat/tc.h>
+#include <mach/tc.h>
 #include <linux/platform_data/keypad-omap.h>
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 #include <mach/flash.h>
 
 #include <mach/hardware.h>
@@ -452,7 +452,6 @@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
        .atag_offset    = 0x100,
        .map_io         = omap16xx_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = h3_init,
        .init_late      = omap1_init_late,
index 87ab2086ef9653a4dce67b93f0cc6d1916048b2e..356f816c84a6603c0fab318581f31074f42de95c 100644 (file)
@@ -43,7 +43,7 @@
 #include <asm/mach/arch.h>
 
 #include <mach/omap7xx.h>
-#include <plat/mmc.h>
+#include "mmc.h"
 
 #include <mach/irqs.h>
 #include <mach/usb.h>
@@ -600,7 +600,6 @@ MACHINE_START(HERALD, "HTC Herald")
        .atag_offset    = 0x100,
        .map_io         = htcherald_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = htcherald_init,
        .init_late      = omap1_init_late,
index db5f7d2976e7286af4d89e52d2c3d7ba02d5a4c0..c66334f22471f988346728b74047136433970035 100644 (file)
 
 #include <mach/mux.h>
 #include <mach/flash.h>
-#include <plat/fpga.h>
-#include <plat/tc.h>
+#include <../plat-omap/fpga.h>
+#include <mach/tc.h>
 #include <linux/platform_data/keypad-omap.h>
-#include <plat/mmc.h>
 
 #include <mach/hardware.h>
 #include <mach/usb.h>
 
 #include "iomap.h"
 #include "common.h"
+#include "mmc.h"
 
 /* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
 #define INNOVATOR1610_ETHR_START       0x04000300
@@ -215,7 +215,7 @@ static struct platform_device *innovator1510_devices[] __initdata = {
 
 static int innovator_get_pendown_state(void)
 {
-       return !(fpga_read(OMAP1510_FPGA_TOUCHSCREEN) & (1 << 5));
+       return !(__raw_readb(OMAP1510_FPGA_TOUCHSCREEN) & (1 << 5));
 }
 
 static const struct ads7846_platform_data innovator1510_ts_info = {
@@ -279,7 +279,7 @@ static struct platform_device *innovator1610_devices[] __initdata = {
 static void __init innovator_init_smc91x(void)
 {
        if (cpu_is_omap1510()) {
-               fpga_write(fpga_read(OMAP1510_FPGA_RST) & ~1,
+               __raw_writeb(__raw_readb(OMAP1510_FPGA_RST) & ~1,
                           OMAP1510_FPGA_RST);
                udelay(750);
        } else {
@@ -335,10 +335,10 @@ static int mmc_set_power(struct device *dev, int slot, int power_on,
                                int vdd)
 {
        if (power_on)
-               fpga_write(fpga_read(OMAP1510_FPGA_POWER) | (1 << 3),
+               __raw_writeb(__raw_readb(OMAP1510_FPGA_POWER) | (1 << 3),
                                OMAP1510_FPGA_POWER);
        else
-               fpga_write(fpga_read(OMAP1510_FPGA_POWER) & ~(1 << 3),
+               __raw_writeb(__raw_readb(OMAP1510_FPGA_POWER) & ~(1 << 3),
                                OMAP1510_FPGA_POWER);
 
        return 0;
@@ -390,14 +390,14 @@ static void __init innovator_init(void)
                omap_cfg_reg(UART3_TX);
                omap_cfg_reg(UART3_RX);
 
-               reg = fpga_read(OMAP1510_FPGA_POWER);
+               reg = __raw_readb(OMAP1510_FPGA_POWER);
                reg |= OMAP1510_FPGA_PCR_COM1_EN;
-               fpga_write(reg, OMAP1510_FPGA_POWER);
+               __raw_writeb(reg, OMAP1510_FPGA_POWER);
                udelay(10);
 
-               reg = fpga_read(OMAP1510_FPGA_POWER);
+               reg = __raw_readb(OMAP1510_FPGA_POWER);
                reg |= OMAP1510_FPGA_PCR_COM2_EN;
-               fpga_write(reg, OMAP1510_FPGA_POWER);
+               __raw_writeb(reg, OMAP1510_FPGA_POWER);
                udelay(10);
 
                platform_add_devices(innovator1510_devices, ARRAY_SIZE(innovator1510_devices));
@@ -437,6 +437,7 @@ static void __init innovator_init(void)
  */
 static void __init innovator_map_io(void)
 {
+#ifdef CONFIG_ARCH_OMAP15XX
        omap15xx_map_io();
 
        iotable_init(innovator1510_io_desc, ARRAY_SIZE(innovator1510_io_desc));
@@ -444,9 +445,10 @@ static void __init innovator_map_io(void)
 
        /* Dump the Innovator FPGA rev early - useful info for support. */
        pr_debug("Innovator FPGA Rev %d.%d Board Rev %d\n",
-                       fpga_read(OMAP1510_FPGA_REV_HIGH),
-                       fpga_read(OMAP1510_FPGA_REV_LOW),
-                       fpga_read(OMAP1510_FPGA_BOARD_REV));
+                       __raw_readb(OMAP1510_FPGA_REV_HIGH),
+                       __raw_readb(OMAP1510_FPGA_REV_LOW),
+                       __raw_readb(OMAP1510_FPGA_BOARD_REV));
+#endif
 }
 
 MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
@@ -454,7 +456,6 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
        .atag_offset    = 0x100,
        .map_io         = innovator_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = innovator_init,
        .init_late      = omap1_init_late,
index 7d5c06d6a52a4428cf9243d44f4239ee92616c98..3e8ead67e4598db020424fd4bb2003359a714ccf 100644 (file)
 #include <asm/mach/map.h>
 
 #include <mach/mux.h>
-#include <plat/mmc.h>
-#include <plat/clock.h>
 
 #include <mach/hardware.h>
 #include <mach/usb.h>
 
 #include "common.h"
+#include "clock.h"
+#include "mmc.h"
 
 #define ADS7846_PENDOWN_GPIO   15
 
@@ -251,7 +251,6 @@ MACHINE_START(NOKIA770, "Nokia 770")
        .atag_offset    = 0x100,
        .map_io         = omap16xx_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_nokia770_init,
        .init_late      = omap1_init_late,
index 5973945a8741a79ddeffcb2146046c88268169e9..872ea47cd28a810c61fa31c95a1c9ef61ad364bb 100644 (file)
@@ -48,7 +48,7 @@
 
 #include <mach/flash.h>
 #include <mach/mux.h>
-#include <plat/tc.h>
+#include <mach/tc.h>
 
 #include <mach/hardware.h>
 #include <mach/usb.h>
@@ -606,7 +606,6 @@ MACHINE_START(OMAP_OSK, "TI-OSK")
        .atag_offset    = 0x100,
        .map_io         = omap16xx_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = osk_init,
        .init_late      = omap1_init_late,
index 1c578d58923ab703179196fda89adf18336bcc00..584b6fab894bb4c5978a30fb2045ec339de0e623 100644 (file)
@@ -36,8 +36,8 @@
 
 #include <mach/flash.h>
 #include <mach/mux.h>
-#include <plat/tc.h>
-#include <plat/dma.h>
+#include <mach/tc.h>
+#include <plat-omap/dma-omap.h>
 #include <mach/irda.h>
 #include <linux/platform_data/keypad-omap.h>
 
@@ -45,6 +45,7 @@
 #include <mach/usb.h>
 
 #include "common.h"
+#include "dma.h"
 
 #define PALMTE_USBDETECT_GPIO  0
 #define PALMTE_USB_OR_DC_GPIO  1
@@ -264,7 +265,6 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
        .atag_offset    = 0x100,
        .map_io         = omap15xx_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_palmte_init,
        .init_late      = omap1_init_late,
index 97158095083ccdd87c9784087d535a34fe2df9fe..fbc986bfe69e1770e5201145febcc4e171778c24 100644 (file)
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
 #include <linux/platform_data/omap1_bl.h>
+#include <linux/platform_data/leds-omap.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <plat/led.h>
 #include <mach/flash.h>
 #include <mach/mux.h>
-#include <plat/dma.h>
-#include <plat/tc.h>
+#include <plat-omap/dma-omap.h>
+#include <mach/tc.h>
 #include <mach/irda.h>
 #include <linux/platform_data/keypad-omap.h>
 
@@ -45,6 +45,7 @@
 #include <mach/usb.h>
 
 #include "common.h"
+#include "dma.h"
 
 #define PALMTT_USBDETECT_GPIO  0
 #define PALMTT_CABLE_GPIO      1
@@ -310,7 +311,6 @@ MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
        .atag_offset    = 0x100,
        .map_io         = omap15xx_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_palmtt_init,
        .init_late      = omap1_init_late,
index e311032e7eebb3abbbd7540843b96de3ec314302..60d917a9376326e26a385ccc542213c2e94f0ca9 100644 (file)
@@ -38,8 +38,8 @@
 
 #include <mach/flash.h>
 #include <mach/mux.h>
-#include <plat/dma.h>
-#include <plat/tc.h>
+#include <plat-omap/dma-omap.h>
+#include <mach/tc.h>
 #include <mach/irda.h>
 #include <linux/platform_data/keypad-omap.h>
 
@@ -47,6 +47,7 @@
 #include <mach/usb.h>
 
 #include "common.h"
+#include "dma.h"
 
 #define PALMZ71_USBDETECT_GPIO 0
 #define PALMZ71_PENIRQ_GPIO    6
@@ -326,7 +327,6 @@ MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
        .atag_offset    = 0x100,
        .map_io         = omap15xx_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_palmz71_init,
        .init_late      = omap1_init_late,
index 198b05417bfcd49a6c9194e182743b3e5ebf7464..030bd48727be85c07ce8ed524e79ae59522f4f3e 100644 (file)
@@ -28,9 +28,9 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <plat/tc.h>
+#include <mach/tc.h>
 #include <mach/mux.h>
-#include <plat/fpga.h>
+#include <../plat-omap/fpga.h>
 #include <mach/flash.h>
 
 #include <mach/hardware.h>
@@ -231,9 +231,9 @@ static struct omap_lcd_config perseus2_lcd_config __initdata = {
 
 static void __init perseus2_init_smc91x(void)
 {
-       fpga_write(1, H2P2_DBG_FPGA_LAN_RESET);
+       __raw_writeb(1, H2P2_DBG_FPGA_LAN_RESET);
        mdelay(50);
-       fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1,
+       __raw_writeb(__raw_readb(H2P2_DBG_FPGA_LAN_RESET) & ~1,
                   H2P2_DBG_FPGA_LAN_RESET);
        mdelay(50);
 }
@@ -324,7 +324,6 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
        .atag_offset    = 0x100,
        .map_io         = omap_perseus2_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_perseus2_init,
        .init_late      = omap1_init_late,
index 5932d56e17bf559642b397f7df96deea24eaaf26..4fcf19c78a086e2c4a0529ca5ad85ef85dda3050 100644 (file)
 #include <linux/platform_device.h>
 
 #include <mach/hardware.h>
-#include <plat/mmc.h>
 #include <mach/board-sx1.h>
 
+#include "mmc.h"
+
 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
 
 static int mmc_set_power(struct device *dev, int slot, int power_on,
index 13bf2cc56814a988a03e7043f161ce741ce4e3ea..1ebc7e08d6e5b9cad9ce1386007c387d4fb0963f 100644 (file)
 
 #include <mach/flash.h>
 #include <mach/mux.h>
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 #include <mach/irda.h>
-#include <plat/tc.h>
+#include <mach/tc.h>
 #include <mach/board-sx1.h>
 
 #include <mach/hardware.h>
 #include <mach/usb.h>
 
 #include "common.h"
+#include "dma.h"
 
 /* Write to I2C device */
 int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value)
@@ -403,7 +404,6 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1")
        .atag_offset    = 0x100,
        .map_io         = omap15xx_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_sx1_init,
        .init_late      = omap1_init_late,
index ad75e3411d462c0fc62e5012a4b4801b397a6962..abf705f49b19777e21884f3795432e1cb709f84e 100644 (file)
@@ -34,7 +34,7 @@
 #include <mach/board-voiceblue.h>
 #include <mach/flash.h>
 #include <mach/mux.h>
-#include <plat/tc.h>
+#include <mach/tc.h>
 
 #include <mach/hardware.h>
 #include <mach/usb.h>
@@ -286,7 +286,6 @@ MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
        .atag_offset    = 0x100,
        .map_io         = omap15xx_map_io,
        .init_early     = omap1_init_early,
-       .reserve        = omap_reserve,
        .init_irq       = omap1_init_irq,
        .init_machine   = voiceblue_init,
        .init_late      = omap1_init_late,
index 638f4070fc7025a7d692607b28a5ed5a6888880c..931f3f6d396b368aacf088431c1a0060c9b3b8ed 100644 (file)
@@ -12,6 +12,7 @@
  * published by the Free Software Foundation.
  */
 #include <linux/kernel.h>
+#include <linux/export.h>
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/err.h>
 
 #include <asm/mach-types.h>
 
-#include <plat/cpu.h>
-#include <plat/usb.h>
-#include <plat/clock.h>
-#include <plat/sram.h>
-#include <plat/clkdev_omap.h>
-
 #include <mach/hardware.h>
 
+#include "../plat-omap/sram.h"
+
+#include "soc.h"
 #include "iomap.h"
 #include "clock.h"
 #include "opp.h"
 __u32 arm_idlect1_mask;
 struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p;
 
+static LIST_HEAD(clocks);
+static DEFINE_MUTEX(clocks_mutex);
+static DEFINE_SPINLOCK(clockfw_lock);
+
 /*
  * Omap1 specific clock functions
  */
@@ -607,3 +609,497 @@ void omap1_clk_disable_unused(struct clk *clk)
 }
 
 #endif
+
+
+int clk_enable(struct clk *clk)
+{
+       unsigned long flags;
+       int ret;
+
+       if (clk == NULL || IS_ERR(clk))
+               return -EINVAL;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       ret = omap1_clk_enable(clk);
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return ret;
+}
+EXPORT_SYMBOL(clk_enable);
+
+void clk_disable(struct clk *clk)
+{
+       unsigned long flags;
+
+       if (clk == NULL || IS_ERR(clk))
+               return;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       if (clk->usecount == 0) {
+               pr_err("Trying disable clock %s with 0 usecount\n",
+                      clk->name);
+               WARN_ON(1);
+               goto out;
+       }
+
+       omap1_clk_disable(clk);
+
+out:
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+}
+EXPORT_SYMBOL(clk_disable);
+
+unsigned long clk_get_rate(struct clk *clk)
+{
+       unsigned long flags;
+       unsigned long ret;
+
+       if (clk == NULL || IS_ERR(clk))
+               return 0;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       ret = clk->rate;
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return ret;
+}
+EXPORT_SYMBOL(clk_get_rate);
+
+/*
+ * Optional clock functions defined in include/linux/clk.h
+ */
+
+long clk_round_rate(struct clk *clk, unsigned long rate)
+{
+       unsigned long flags;
+       long ret;
+
+       if (clk == NULL || IS_ERR(clk))
+               return 0;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       ret = omap1_clk_round_rate(clk, rate);
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return ret;
+}
+EXPORT_SYMBOL(clk_round_rate);
+
+int clk_set_rate(struct clk *clk, unsigned long rate)
+{
+       unsigned long flags;
+       int ret = -EINVAL;
+
+       if (clk == NULL || IS_ERR(clk))
+               return ret;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       ret = omap1_clk_set_rate(clk, rate);
+       if (ret == 0)
+               propagate_rate(clk);
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return ret;
+}
+EXPORT_SYMBOL(clk_set_rate);
+
+int clk_set_parent(struct clk *clk, struct clk *parent)
+{
+       WARN_ONCE(1, "clk_set_parent() not implemented for OMAP1\n");
+
+       return -EINVAL;
+}
+EXPORT_SYMBOL(clk_set_parent);
+
+struct clk *clk_get_parent(struct clk *clk)
+{
+       return clk->parent;
+}
+EXPORT_SYMBOL(clk_get_parent);
+
+/*
+ * OMAP specific clock functions shared between omap1 and omap2
+ */
+
+int __initdata mpurate;
+
+/*
+ * By default we use the rate set by the bootloader.
+ * You can override this with mpurate= cmdline option.
+ */
+static int __init omap_clk_setup(char *str)
+{
+       get_option(&str, &mpurate);
+
+       if (!mpurate)
+               return 1;
+
+       if (mpurate < 1000)
+               mpurate *= 1000000;
+
+       return 1;
+}
+__setup("mpurate=", omap_clk_setup);
+
+/* Used for clocks that always have same value as the parent clock */
+unsigned long followparent_recalc(struct clk *clk)
+{
+       return clk->parent->rate;
+}
+
+/*
+ * Used for clocks that have the same value as the parent clock,
+ * divided by some factor
+ */
+unsigned long omap_fixed_divisor_recalc(struct clk *clk)
+{
+       WARN_ON(!clk->fixed_div);
+
+       return clk->parent->rate / clk->fixed_div;
+}
+
+void clk_reparent(struct clk *child, struct clk *parent)
+{
+       list_del_init(&child->sibling);
+       if (parent)
+               list_add(&child->sibling, &parent->children);
+       child->parent = parent;
+
+       /* now do the debugfs renaming to reattach the child
+          to the proper parent */
+}
+
+/* Propagate rate to children */
+void propagate_rate(struct clk *tclk)
+{
+       struct clk *clkp;
+
+       list_for_each_entry(clkp, &tclk->children, sibling) {
+               if (clkp->recalc)
+                       clkp->rate = clkp->recalc(clkp);
+               propagate_rate(clkp);
+       }
+}
+
+static LIST_HEAD(root_clks);
+
+/**
+ * recalculate_root_clocks - recalculate and propagate all root clocks
+ *
+ * Recalculates all root clocks (clocks with no parent), which if the
+ * clock's .recalc is set correctly, should also propagate their rates.
+ * Called at init.
+ */
+void recalculate_root_clocks(void)
+{
+       struct clk *clkp;
+
+       list_for_each_entry(clkp, &root_clks, sibling) {
+               if (clkp->recalc)
+                       clkp->rate = clkp->recalc(clkp);
+               propagate_rate(clkp);
+       }
+}
+
+/**
+ * clk_preinit - initialize any fields in the struct clk before clk init
+ * @clk: struct clk * to initialize
+ *
+ * Initialize any struct clk fields needed before normal clk initialization
+ * can run.  No return value.
+ */
+void clk_preinit(struct clk *clk)
+{
+       INIT_LIST_HEAD(&clk->children);
+}
+
+int clk_register(struct clk *clk)
+{
+       if (clk == NULL || IS_ERR(clk))
+               return -EINVAL;
+
+       /*
+        * trap out already registered clocks
+        */
+       if (clk->node.next || clk->node.prev)
+               return 0;
+
+       mutex_lock(&clocks_mutex);
+       if (clk->parent)
+               list_add(&clk->sibling, &clk->parent->children);
+       else
+               list_add(&clk->sibling, &root_clks);
+
+       list_add(&clk->node, &clocks);
+       if (clk->init)
+               clk->init(clk);
+       mutex_unlock(&clocks_mutex);
+
+       return 0;
+}
+EXPORT_SYMBOL(clk_register);
+
+void clk_unregister(struct clk *clk)
+{
+       if (clk == NULL || IS_ERR(clk))
+               return;
+
+       mutex_lock(&clocks_mutex);
+       list_del(&clk->sibling);
+       list_del(&clk->node);
+       mutex_unlock(&clocks_mutex);
+}
+EXPORT_SYMBOL(clk_unregister);
+
+void clk_enable_init_clocks(void)
+{
+       struct clk *clkp;
+
+       list_for_each_entry(clkp, &clocks, node)
+               if (clkp->flags & ENABLE_ON_INIT)
+                       clk_enable(clkp);
+}
+
+/**
+ * omap_clk_get_by_name - locate OMAP struct clk by its name
+ * @name: name of the struct clk to locate
+ *
+ * Locate an OMAP struct clk by its name.  Assumes that struct clk
+ * names are unique.  Returns NULL if not found or a pointer to the
+ * struct clk if found.
+ */
+struct clk *omap_clk_get_by_name(const char *name)
+{
+       struct clk *c;
+       struct clk *ret = NULL;
+
+       mutex_lock(&clocks_mutex);
+
+       list_for_each_entry(c, &clocks, node) {
+               if (!strcmp(c->name, name)) {
+                       ret = c;
+                       break;
+               }
+       }
+
+       mutex_unlock(&clocks_mutex);
+
+       return ret;
+}
+
+int omap_clk_enable_autoidle_all(void)
+{
+       struct clk *c;
+       unsigned long flags;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+
+       list_for_each_entry(c, &clocks, node)
+               if (c->ops->allow_idle)
+                       c->ops->allow_idle(c);
+
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return 0;
+}
+
+int omap_clk_disable_autoidle_all(void)
+{
+       struct clk *c;
+       unsigned long flags;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+
+       list_for_each_entry(c, &clocks, node)
+               if (c->ops->deny_idle)
+                       c->ops->deny_idle(c);
+
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return 0;
+}
+
+/*
+ * Low level helpers
+ */
+static int clkll_enable_null(struct clk *clk)
+{
+       return 0;
+}
+
+static void clkll_disable_null(struct clk *clk)
+{
+}
+
+const struct clkops clkops_null = {
+       .enable         = clkll_enable_null,
+       .disable        = clkll_disable_null,
+};
+
+/*
+ * Dummy clock
+ *
+ * Used for clock aliases that are needed on some OMAPs, but not others
+ */
+struct clk dummy_ck = {
+       .name   = "dummy",
+       .ops    = &clkops_null,
+};
+
+/*
+ *
+ */
+
+#ifdef CONFIG_OMAP_RESET_CLOCKS
+/*
+ * Disable any unused clocks left on by the bootloader
+ */
+static int __init clk_disable_unused(void)
+{
+       struct clk *ck;
+       unsigned long flags;
+
+       pr_info("clock: disabling unused clocks to save power\n");
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       list_for_each_entry(ck, &clocks, node) {
+               if (ck->ops == &clkops_null)
+                       continue;
+
+               if (ck->usecount > 0 || !ck->enable_reg)
+                       continue;
+
+               omap1_clk_disable_unused(ck);
+       }
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return 0;
+}
+late_initcall(clk_disable_unused);
+late_initcall(omap_clk_enable_autoidle_all);
+#endif
+
+#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
+/*
+ *     debugfs support to trace clock tree hierarchy and attributes
+ */
+
+#include <linux/debugfs.h>
+#include <linux/seq_file.h>
+
+static struct dentry *clk_debugfs_root;
+
+static int clk_dbg_show_summary(struct seq_file *s, void *unused)
+{
+       struct clk *c;
+       struct clk *pa;
+
+       mutex_lock(&clocks_mutex);
+       seq_printf(s, "%-30s %-30s %-10s %s\n",
+                  "clock-name", "parent-name", "rate", "use-count");
+
+       list_for_each_entry(c, &clocks, node) {
+               pa = c->parent;
+               seq_printf(s, "%-30s %-30s %-10lu %d\n",
+                          c->name, pa ? pa->name : "none", c->rate,
+                          c->usecount);
+       }
+       mutex_unlock(&clocks_mutex);
+
+       return 0;
+}
+
+static int clk_dbg_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, clk_dbg_show_summary, inode->i_private);
+}
+
+static const struct file_operations debug_clock_fops = {
+       .open           = clk_dbg_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = single_release,
+};
+
+static int clk_debugfs_register_one(struct clk *c)
+{
+       int err;
+       struct dentry *d;
+       struct clk *pa = c->parent;
+
+       d = debugfs_create_dir(c->name, pa ? pa->dent : clk_debugfs_root);
+       if (!d)
+               return -ENOMEM;
+       c->dent = d;
+
+       d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount);
+       if (!d) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+       d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
+       if (!d) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+       d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags);
+       if (!d) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+       return 0;
+
+err_out:
+       debugfs_remove_recursive(c->dent);
+       return err;
+}
+
+static int clk_debugfs_register(struct clk *c)
+{
+       int err;
+       struct clk *pa = c->parent;
+
+       if (pa && !pa->dent) {
+               err = clk_debugfs_register(pa);
+               if (err)
+                       return err;
+       }
+
+       if (!c->dent) {
+               err = clk_debugfs_register_one(c);
+               if (err)
+                       return err;
+       }
+       return 0;
+}
+
+static int __init clk_debugfs_init(void)
+{
+       struct clk *c;
+       struct dentry *d;
+       int err;
+
+       d = debugfs_create_dir("clock", NULL);
+       if (!d)
+               return -ENOMEM;
+       clk_debugfs_root = d;
+
+       list_for_each_entry(c, &clocks, node) {
+               err = clk_debugfs_register(c);
+               if (err)
+                       goto err_out;
+       }
+
+       d = debugfs_create_file("summary", S_IRUGO,
+               d, NULL, &debug_clock_fops);
+       if (!d)
+               return -ENOMEM;
+
+       return 0;
+err_out:
+       debugfs_remove_recursive(clk_debugfs_root);
+       return err;
+}
+late_initcall(clk_debugfs_init);
+
+#endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */
index 3d04f4f67676280a591f7bbcfb003c426fdba2dc..1e4918a3a5ee61a9509491be3ca6ed6cf2dad66a 100644 (file)
 #define __ARCH_ARM_MACH_OMAP1_CLOCK_H
 
 #include <linux/clk.h>
+#include <linux/list.h>
 
-#include <plat/clock.h>
+#include <linux/clkdev.h>
+
+struct module;
+struct clk;
+
+struct omap_clk {
+       u16                             cpu;
+       struct clk_lookup               lk;
+};
+
+#define CLK(dev, con, ck, cp)          \
+       {                               \
+                .cpu = cp,             \
+               .lk = {                 \
+                       .dev_id = dev,  \
+                       .con_id = con,  \
+                       .clk = ck,      \
+               },                      \
+       }
+
+/* Platform flags for the clkdev-OMAP integration code */
+#define CK_310         (1 << 0)
+#define CK_7XX         (1 << 1)        /* 7xx, 850 */
+#define CK_1510                (1 << 2)
+#define CK_16XX                (1 << 3)        /* 16xx, 17xx, 5912 */
+#define CK_1710                (1 << 4)        /* 1710 extra for rate selection */
+
+
+/* Temporary, needed during the common clock framework conversion */
+#define __clk_get_name(clk)    (clk->name)
+#define __clk_get_parent(clk)  (clk->parent)
+#define __clk_get_rate(clk)    (clk->rate)
+
+/**
+ * struct clkops - some clock function pointers
+ * @enable: fn ptr that enables the current clock in hardware
+ * @disable: fn ptr that enables the current clock in hardware
+ * @find_idlest: function returning the IDLEST register for the clock's IP blk
+ * @find_companion: function returning the "companion" clk reg for the clock
+ * @allow_idle: fn ptr that enables autoidle for the current clock in hardware
+ * @deny_idle: fn ptr that disables autoidle for the current clock in hardware
+ *
+ * A "companion" clk is an accompanying clock to the one being queried
+ * that must be enabled for the IP module connected to the clock to
+ * become accessible by the hardware.  Neither @find_idlest nor
+ * @find_companion should be needed; that information is IP
+ * block-specific; the hwmod code has been created to handle this, but
+ * until hwmod data is ready and drivers have been converted to use PM
+ * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and
+ * @find_companion must, unfortunately, remain.
+ */
+struct clkops {
+       int                     (*enable)(struct clk *);
+       void                    (*disable)(struct clk *);
+       void                    (*find_idlest)(struct clk *, void __iomem **,
+                                              u8 *, u8 *);
+       void                    (*find_companion)(struct clk *, void __iomem **,
+                                                 u8 *);
+       void                    (*allow_idle)(struct clk *);
+       void                    (*deny_idle)(struct clk *);
+};
+
+/*
+ * struct clk.flags possibilities
+ *
+ * XXX document the rest of the clock flags here
+ *
+ * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
+ *     bits share the same register.  This flag allows the
+ *     omap4_dpllmx*() code to determine which GATE_CTRL bit field
+ *     should be used.  This is a temporary solution - a better approach
+ *     would be to associate clock type-specific data with the clock,
+ *     similar to the struct dpll_data approach.
+ */
+#define ENABLE_REG_32BIT       (1 << 0)        /* Use 32-bit access */
+#define CLOCK_IDLE_CONTROL     (1 << 1)
+#define CLOCK_NO_IDLE_PARENT   (1 << 2)
+#define ENABLE_ON_INIT         (1 << 3)        /* Enable upon framework init */
+#define INVERT_ENABLE          (1 << 4)        /* 0 enables, 1 disables */
+#define CLOCK_CLKOUTX2         (1 << 5)
+
+/**
+ * struct clk - OMAP struct clk
+ * @node: list_head connecting this clock into the full clock list
+ * @ops: struct clkops * for this clock
+ * @name: the name of the clock in the hardware (used in hwmod data and debug)
+ * @parent: pointer to this clock's parent struct clk
+ * @children: list_head connecting to the child clks' @sibling list_heads
+ * @sibling: list_head connecting this clk to its parent clk's @children
+ * @rate: current clock rate
+ * @enable_reg: register to write to enable the clock (see @enable_bit)
+ * @recalc: fn ptr that returns the clock's current rate
+ * @set_rate: fn ptr that can change the clock's current rate
+ * @round_rate: fn ptr that can round the clock's current rate
+ * @init: fn ptr to do clock-specific initialization
+ * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
+ * @usecount: number of users that have requested this clock to be enabled
+ * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div
+ * @flags: see "struct clk.flags possibilities" above
+ * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
+ * @src_offset: bitshift for source selection bitfield (OMAP1 only)
+ *
+ * XXX @rate_offset, @src_offset should probably be removed and OMAP1
+ * clock code converted to use clksel.
+ *
+ * XXX @usecount is poorly named.  It should be "enable_count" or
+ * something similar.  "users" in the description refers to kernel
+ * code (core code or drivers) that have called clk_enable() and not
+ * yet called clk_disable(); the usecount of parent clocks is also
+ * incremented by the clock code when clk_enable() is called on child
+ * clocks and decremented by the clock code when clk_disable() is
+ * called on child clocks.
+ *
+ * XXX @clkdm, @usecount, @children, @sibling should be marked for
+ * internal use only.
+ *
+ * @children and @sibling are used to optimize parent-to-child clock
+ * tree traversals.  (child-to-parent traversals use @parent.)
+ *
+ * XXX The notion of the clock's current rate probably needs to be
+ * separated from the clock's target rate.
+ */
+struct clk {
+       struct list_head        node;
+       const struct clkops     *ops;
+       const char              *name;
+       struct clk              *parent;
+       struct list_head        children;
+       struct list_head        sibling;        /* node for children */
+       unsigned long           rate;
+       void __iomem            *enable_reg;
+       unsigned long           (*recalc)(struct clk *);
+       int                     (*set_rate)(struct clk *, unsigned long);
+       long                    (*round_rate)(struct clk *, unsigned long);
+       void                    (*init)(struct clk *);
+       u8                      enable_bit;
+       s8                      usecount;
+       u8                      fixed_div;
+       u8                      flags;
+       u8                      rate_offset;
+       u8                      src_offset;
+#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
+       struct dentry           *dent;  /* For visible tree hierarchy */
+#endif
+};
+
+struct clk_functions {
+       int             (*clk_enable)(struct clk *clk);
+       void            (*clk_disable)(struct clk *clk);
+       long            (*clk_round_rate)(struct clk *clk, unsigned long rate);
+       int             (*clk_set_rate)(struct clk *clk, unsigned long rate);
+       int             (*clk_set_parent)(struct clk *clk, struct clk *parent);
+       void            (*clk_allow_idle)(struct clk *clk);
+       void            (*clk_deny_idle)(struct clk *clk);
+       void            (*clk_disable_unused)(struct clk *clk);
+};
+
+extern int mpurate;
+
+extern int clk_init(struct clk_functions *custom_clocks);
+extern void clk_preinit(struct clk *clk);
+extern int clk_register(struct clk *clk);
+extern void clk_reparent(struct clk *child, struct clk *parent);
+extern void clk_unregister(struct clk *clk);
+extern void propagate_rate(struct clk *clk);
+extern void recalculate_root_clocks(void);
+extern unsigned long followparent_recalc(struct clk *clk);
+extern void clk_enable_init_clocks(void);
+unsigned long omap_fixed_divisor_recalc(struct clk *clk);
+extern struct clk *omap_clk_get_by_name(const char *name);
+extern int omap_clk_enable_autoidle_all(void);
+extern int omap_clk_disable_autoidle_all(void);
+
+extern const struct clkops clkops_null;
+
+extern struct clk dummy_ck;
 
 int omap1_clk_init(void);
 void omap1_clk_late_init(void);
index 9b45f4b0ee22833897d3dfa27d636c26fe5b5fcf..28aea55a412e77e7e6818927b7cf3d05e9e6fce6 100644 (file)
 
 #include <asm/mach-types.h>  /* for machine_is_* */
 
-#include <plat/clock.h>
-#include <plat/cpu.h>
-#include <plat/clkdev_omap.h>
-#include <plat/sram.h> /* for omap_sram_reprogram_clock() */
+#include "soc.h"
 
 #include <mach/hardware.h>
 #include <mach/usb.h>   /* for OTG_BASE */
 
+#include "../plat-omap/sram.h"
+
 #include "iomap.h"
 #include "clock.h"
 
@@ -765,14 +764,6 @@ static struct omap_clk omap_clks[] = {
  * init
  */
 
-static struct clk_functions omap1_clk_functions = {
-       .clk_enable             = omap1_clk_enable,
-       .clk_disable            = omap1_clk_disable,
-       .clk_round_rate         = omap1_clk_round_rate,
-       .clk_set_rate           = omap1_clk_set_rate,
-       .clk_disable_unused     = omap1_clk_disable_unused,
-};
-
 static void __init omap1_show_rates(void)
 {
        pr_notice("Clocking rate (xtal/DPLL1/MPU): %ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n",
@@ -803,8 +794,6 @@ int __init omap1_clk_init(void)
        if (!cpu_is_omap15xx())
                omap_writew(0, SOFT_REQ_REG2);
 
-       clk_init(&omap1_clk_functions);
-
        /* By default all idlect1 clocks are allowed to idle */
        arm_idlect1_mask = ~0;
 
index c2552b24f9f295381b36132cc4d59b850ade8d3f..26e19d3b792448edf53d26c2218d217137d69c47 100644 (file)
 #ifndef __ARCH_ARM_MACH_OMAP1_COMMON_H
 #define __ARCH_ARM_MACH_OMAP1_COMMON_H
 
-#include <plat/common.h>
+#include "../plat-omap/common.h"
 #include <linux/mtd/mtd.h>
+#include <linux/i2c-omap.h>
+
+#include "../plat-omap/i2c.h"
 
 #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
 void omap7xx_map_io(void);
@@ -38,6 +41,7 @@ static inline void omap7xx_map_io(void)
 #endif
 
 #ifdef CONFIG_ARCH_OMAP15XX
+void omap1510_fpga_init_irq(void);
 void omap15xx_map_io(void);
 #else
 static inline void omap15xx_map_io(void)
index d3fec92c54cb5d5d852974c9e9c3ec7ad58e72bc..645668e2b1d5db50c13a7319aff2e17f4c7d59ff 100644 (file)
 
 #include <asm/mach/map.h>
 
-#include <plat/tc.h>
+#include <mach/tc.h>
 #include <mach/mux.h>
-#include <plat/dma.h>
-#include <plat/mmc.h>
 
 #include <mach/omap7xx.h>
 #include <mach/camera.h>
 #include <mach/hardware.h>
 
+#include "../plat-omap/sram.h"
+
 #include "common.h"
 #include "clock.h"
+#include "dma.h"
+#include "mmc.h"
 
 #if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)
 
@@ -175,6 +177,13 @@ static int __init omap_mmc_add(const char *name, int id, unsigned long base,
        res[3].name = "tx";
        res[3].flags = IORESOURCE_DMA;
 
+       if (cpu_is_omap7xx())
+               data->slots[0].features = MMC_OMAP7XX;
+       if (cpu_is_omap15xx())
+               data->slots[0].features = MMC_OMAP15XX;
+       if (cpu_is_omap16xx())
+               data->slots[0].features = MMC_OMAP16XX;
+
        ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
        if (ret == 0)
                ret = platform_device_add_data(pdev, data, sizeof(*data));
index 29007fef84cd8d884aaddd1c295897afa0c824ed..71305c15fbd5566bf116fdea2aa8db9605513513 100644 (file)
 #include <linux/device.h>
 #include <linux/io.h>
 
-#include <plat/dma.h>
-#include <plat/tc.h>
+#include <plat-omap/dma-omap.h>
+#include <mach/tc.h>
 
 #include <mach/irqs.h>
 
+#include "dma.h"
+
 #define OMAP1_DMA_BASE                 (0xfffed800)
 #define OMAP1_LOGICAL_DMA_CH_COUNT     17
 #define OMAP1_DMA_STRIDE               0x40
diff --git a/arch/arm/mach-omap1/dma.h b/arch/arm/mach-omap1/dma.h
new file mode 100644 (file)
index 0000000..da6345d
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ *  OMAP1 DMA channel definitions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __OMAP1_DMA_CHANNEL_H
+#define __OMAP1_DMA_CHANNEL_H
+
+/* DMA channels for omap1 */
+#define OMAP_DMA_NO_DEVICE             0
+#define OMAP_DMA_MCSI1_TX              1
+#define OMAP_DMA_MCSI1_RX              2
+#define OMAP_DMA_I2C_RX                        3
+#define OMAP_DMA_I2C_TX                        4
+#define OMAP_DMA_EXT_NDMA_REQ          5
+#define OMAP_DMA_EXT_NDMA_REQ2         6
+#define OMAP_DMA_UWIRE_TX              7
+#define OMAP_DMA_MCBSP1_TX             8
+#define OMAP_DMA_MCBSP1_RX             9
+#define OMAP_DMA_MCBSP3_TX             10
+#define OMAP_DMA_MCBSP3_RX             11
+#define OMAP_DMA_UART1_TX              12
+#define OMAP_DMA_UART1_RX              13
+#define OMAP_DMA_UART2_TX              14
+#define OMAP_DMA_UART2_RX              15
+#define OMAP_DMA_MCBSP2_TX             16
+#define OMAP_DMA_MCBSP2_RX             17
+#define OMAP_DMA_UART3_TX              18
+#define OMAP_DMA_UART3_RX              19
+#define OMAP_DMA_CAMERA_IF_RX          20
+#define OMAP_DMA_MMC_TX                        21
+#define OMAP_DMA_MMC_RX                        22
+#define OMAP_DMA_NAND                  23
+#define OMAP_DMA_IRQ_LCD_LINE          24
+#define OMAP_DMA_MEMORY_STICK          25
+#define OMAP_DMA_USB_W2FC_RX0          26
+#define OMAP_DMA_USB_W2FC_RX1          27
+#define OMAP_DMA_USB_W2FC_RX2          28
+#define OMAP_DMA_USB_W2FC_TX0          29
+#define OMAP_DMA_USB_W2FC_TX1          30
+#define OMAP_DMA_USB_W2FC_TX2          31
+
+/* These are only for 1610 */
+#define OMAP_DMA_CRYPTO_DES_IN         32
+#define OMAP_DMA_SPI_TX                        33
+#define OMAP_DMA_SPI_RX                        34
+#define OMAP_DMA_CRYPTO_HASH           35
+#define OMAP_DMA_CCP_ATTN              36
+#define OMAP_DMA_CCP_FIFO_NOT_EMPTY    37
+#define OMAP_DMA_CMT_APE_TX_CHAN_0     38
+#define OMAP_DMA_CMT_APE_RV_CHAN_0     39
+#define OMAP_DMA_CMT_APE_TX_CHAN_1     40
+#define OMAP_DMA_CMT_APE_RV_CHAN_1     41
+#define OMAP_DMA_CMT_APE_TX_CHAN_2     42
+#define OMAP_DMA_CMT_APE_RV_CHAN_2     43
+#define OMAP_DMA_CMT_APE_TX_CHAN_3     44
+#define OMAP_DMA_CMT_APE_RV_CHAN_3     45
+#define OMAP_DMA_CMT_APE_TX_CHAN_4     46
+#define OMAP_DMA_CMT_APE_RV_CHAN_4     47
+#define OMAP_DMA_CMT_APE_TX_CHAN_5     48
+#define OMAP_DMA_CMT_APE_RV_CHAN_5     49
+#define OMAP_DMA_CMT_APE_TX_CHAN_6     50
+#define OMAP_DMA_CMT_APE_RV_CHAN_6     51
+#define OMAP_DMA_CMT_APE_TX_CHAN_7     52
+#define OMAP_DMA_CMT_APE_RV_CHAN_7     53
+#define OMAP_DMA_MMC2_TX               54
+#define OMAP_DMA_MMC2_RX               55
+#define OMAP_DMA_CRYPTO_DES_OUT                56
+
+#endif /* __OMAP1_DMA_CHANNEL_H */
index 73ae6169aa4a01829654f0c92f1958d1629cb432..b3fb531af94e7767d556a5730d5b62c171c22b63 100644 (file)
@@ -10,7 +10,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 
-#include <plat/tc.h>
+#include <mach/tc.h>
 #include <mach/flash.h>
 
 #include <mach/hardware.h>
index 29ec50fc688dcedc44af04b40d8dd998c8d8e088..4ec220d8da5c257c2a9393867356e958da391716 100644 (file)
@@ -27,7 +27,7 @@
 #include <asm/irq.h>
 #include <asm/mach/irq.h>
 
-#include <plat/fpga.h>
+#include <../plat-omap/fpga.h>
 
 #include <mach/hardware.h>
 
index a0551a6d7451efe3b851e0abb961c74be6038c35..32bcbb8d6c736868fe9bee84d6e9b35c7c1e2005 100644 (file)
  *
  */
 
-#include <plat/i2c.h>
+#include <linux/i2c-omap.h>
 #include <mach/mux.h>
-#include <plat/cpu.h>
+#include "soc.h"
 
-void __init omap1_i2c_mux_pins(int bus_id)
+#include "../plat-omap/i2c.h"
+
+#define OMAP_I2C_SIZE          0x3f
+#define OMAP1_I2C_BASE         0xfffb3800
+#define OMAP1_INT_I2C          (32 + 4)
+
+static const char name[] = "omap_i2c";
+
+static struct resource i2c_resources[2] = {
+};
+
+static struct platform_device omap_i2c_devices[1] = {
+};
+
+static void __init omap1_i2c_mux_pins(int bus_id)
 {
        if (cpu_is_omap7xx()) {
                omap_cfg_reg(I2C_7XX_SDA);
@@ -33,3 +47,44 @@ void __init omap1_i2c_mux_pins(int bus_id)
                omap_cfg_reg(I2C_SCL);
        }
 }
+
+int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *pdata,
+                               int bus_id)
+{
+       struct platform_device *pdev;
+       struct resource *res;
+
+       omap1_i2c_mux_pins(bus_id);
+
+       pdev = &omap_i2c_devices[bus_id - 1];
+       pdev->id = bus_id;
+       pdev->name = name;
+       pdev->num_resources = ARRAY_SIZE(i2c_resources);
+       res = i2c_resources;
+       res[0].start = OMAP1_I2C_BASE;
+       res[0].end = res[0].start + OMAP_I2C_SIZE;
+       res[0].flags = IORESOURCE_MEM;
+       res[1].start = OMAP1_INT_I2C;
+       res[1].flags = IORESOURCE_IRQ;
+       pdev->resource = res;
+
+       /* all OMAP1 have IP version 1 register set */
+       pdata->rev = OMAP_I2C_IP_VERSION_1;
+
+       /* all OMAP1 I2C are implemented like this */
+       pdata->flags = OMAP_I2C_FLAG_NO_FIFO |
+                      OMAP_I2C_FLAG_SIMPLE_CLOCK |
+                      OMAP_I2C_FLAG_16BIT_DATA_REG |
+                      OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK;
+
+       /* how the cpu bus is wired up differs for 7xx only */
+
+       if (cpu_is_omap7xx())
+               pdata->flags |= OMAP_I2C_FLAG_BUS_SHIFT_1;
+       else
+               pdata->flags |= OMAP_I2C_FLAG_BUS_SHIFT_2;
+
+       pdev->dev.platform_data = pdata;
+
+       return platform_device_register(pdev);
+}
index a1b846aacdaf15419d6ce45a55953fadf10c2967..52de382fc8047148f272dd57d7dd01354ec33801 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/io.h>
 #include <asm/system_info.h>
 
-#include <plat/cpu.h>
+#include "soc.h"
 
 #include <mach/hardware.h>
 
index 2b36a281dc842a55757459860164369b763edd28..5c1a26c9f49059c646d54ec60a63dc79ef8dab17 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <linux/serial_reg.h>
 
-#include <plat/serial.h>
+#include "serial.h"
 
                .pushsection .data
 omap_uart_phys:        .word   0x0
index 84248d250adb8eeda35da1093eb7a19f70cfb6f0..dc3237bd72d249a285378e330bc925790c6cdd82 100644 (file)
@@ -39,7 +39,7 @@
 #include <asm/sizes.h>
 #ifndef __ASSEMBLER__
 #include <asm/types.h>
-#include <plat/cpu.h>
+#include "../../mach-omap1/soc.h"
 
 /*
  * NOTE: Please use ioremap + __raw_read/write where possible instead of these
@@ -51,7 +51,7 @@ extern void omap_writeb(u8 v, u32 pa);
 extern void omap_writew(u16 v, u32 pa);
 extern void omap_writel(u32 v, u32 pa);
 
-#include <plat/tc.h>
+#include <mach/tc.h>
 
 /* Almost all documentation for chip and board memory maps assumes
  * BM is clear.  Most devel boards have a switch to control booting
@@ -72,7 +72,7 @@ static inline u32 omap_cs3_phys(void)
 
 #endif /* ifndef __ASSEMBLER__ */
 
-#include <plat/serial.h>
+#include <mach/serial.h>
 
 /*
  * ---------------------------------------------------------------------------
index 901082def9bd1ef72de49654a141e50724c7d22e..351ae4f2c514ce0304ea93bd74fe2c6c8a81eab9 100644 (file)
@@ -19,7 +19,7 @@
  * because of the strncmp().
  */
 #if defined(CONFIG_ARCH_OMAP15XX) && !defined(__ASSEMBLER__)
-#include <plat/cpu.h>
+#include "../../mach-omap1/soc.h"
 
 /*
  * OMAP-1510 Local Bus address offset
index 8fe05d6137c0abfaf2a7d8f1c2ec9125e5ff6087..3d235244bf5c401e7840ea9509e96da10f78cf25 100644 (file)
 
 #define OMAP1510_DSP_MMU_BASE  (0xfffed200)
 
+/*
+ * ---------------------------------------------------------------------------
+ *  OMAP-1510 FPGA
+ * ---------------------------------------------------------------------------
+ */
+#define OMAP1510_FPGA_BASE             0xE8000000              /* VA */
+#define OMAP1510_FPGA_SIZE             SZ_4K
+#define OMAP1510_FPGA_START            0x08000000              /* PA */
+
+/* Revision */
+#define OMAP1510_FPGA_REV_LOW                  IOMEM(OMAP1510_FPGA_BASE + 0x0)
+#define OMAP1510_FPGA_REV_HIGH                 IOMEM(OMAP1510_FPGA_BASE + 0x1)
+#define OMAP1510_FPGA_LCD_PANEL_CONTROL                IOMEM(OMAP1510_FPGA_BASE + 0x2)
+#define OMAP1510_FPGA_LED_DIGIT                        IOMEM(OMAP1510_FPGA_BASE + 0x3)
+#define INNOVATOR_FPGA_HID_SPI                 IOMEM(OMAP1510_FPGA_BASE + 0x4)
+#define OMAP1510_FPGA_POWER                    IOMEM(OMAP1510_FPGA_BASE + 0x5)
+
+/* Interrupt status */
+#define OMAP1510_FPGA_ISR_LO                   IOMEM(OMAP1510_FPGA_BASE + 0x6)
+#define OMAP1510_FPGA_ISR_HI                   IOMEM(OMAP1510_FPGA_BASE + 0x7)
+
+/* Interrupt mask */
+#define OMAP1510_FPGA_IMR_LO                   IOMEM(OMAP1510_FPGA_BASE + 0x8)
+#define OMAP1510_FPGA_IMR_HI                   IOMEM(OMAP1510_FPGA_BASE + 0x9)
+
+/* Reset registers */
+#define OMAP1510_FPGA_HOST_RESET               IOMEM(OMAP1510_FPGA_BASE + 0xa)
+#define OMAP1510_FPGA_RST                      IOMEM(OMAP1510_FPGA_BASE + 0xb)
+
+#define OMAP1510_FPGA_AUDIO                    IOMEM(OMAP1510_FPGA_BASE + 0xc)
+#define OMAP1510_FPGA_DIP                      IOMEM(OMAP1510_FPGA_BASE + 0xe)
+#define OMAP1510_FPGA_FPGA_IO                  IOMEM(OMAP1510_FPGA_BASE + 0xf)
+#define OMAP1510_FPGA_UART1                    IOMEM(OMAP1510_FPGA_BASE + 0x14)
+#define OMAP1510_FPGA_UART2                    IOMEM(OMAP1510_FPGA_BASE + 0x15)
+#define OMAP1510_FPGA_OMAP1510_STATUS          IOMEM(OMAP1510_FPGA_BASE + 0x16)
+#define OMAP1510_FPGA_BOARD_REV                        IOMEM(OMAP1510_FPGA_BASE + 0x18)
+#define INNOVATOR_FPGA_CAM_USB_CONTROL         IOMEM(OMAP1510_FPGA_BASE + 0x20c)
+#define OMAP1510P1_PPT_DATA                    IOMEM(OMAP1510_FPGA_BASE + 0x100)
+#define OMAP1510P1_PPT_STATUS                  IOMEM(OMAP1510_FPGA_BASE + 0x101)
+#define OMAP1510P1_PPT_CONTROL                 IOMEM(OMAP1510_FPGA_BASE + 0x102)
+
+#define OMAP1510_FPGA_TOUCHSCREEN              IOMEM(OMAP1510_FPGA_BASE + 0x204)
+
+#define INNOVATOR_FPGA_INFO                    IOMEM(OMAP1510_FPGA_BASE + 0x205)
+#define INNOVATOR_FPGA_LCD_BRIGHT_LO           IOMEM(OMAP1510_FPGA_BASE + 0x206)
+#define INNOVATOR_FPGA_LCD_BRIGHT_HI           IOMEM(OMAP1510_FPGA_BASE + 0x207)
+#define INNOVATOR_FPGA_LED_GRN_LO              IOMEM(OMAP1510_FPGA_BASE + 0x208)
+#define INNOVATOR_FPGA_LED_GRN_HI              IOMEM(OMAP1510_FPGA_BASE + 0x209)
+#define INNOVATOR_FPGA_LED_RED_LO              IOMEM(OMAP1510_FPGA_BASE + 0x20a)
+#define INNOVATOR_FPGA_LED_RED_HI              IOMEM(OMAP1510_FPGA_BASE + 0x20b)
+#define INNOVATOR_FPGA_EXP_CONTROL             IOMEM(OMAP1510_FPGA_BASE + 0x20d)
+#define INNOVATOR_FPGA_ISR2                    IOMEM(OMAP1510_FPGA_BASE + 0x20e)
+#define INNOVATOR_FPGA_IMR2                    IOMEM(OMAP1510_FPGA_BASE + 0x210)
+
+#define OMAP1510_FPGA_ETHR_START               (OMAP1510_FPGA_START + 0x300)
+
+/*
+ * Power up Giga UART driver, turn on HID clock.
+ * Turn off BT power, since we're not using it and it
+ * draws power.
+ */
+#define OMAP1510_FPGA_RESET_VALUE              0x42
+
+#define OMAP1510_FPGA_PCR_IF_PD0               (1 << 7)
+#define OMAP1510_FPGA_PCR_COM2_EN              (1 << 6)
+#define OMAP1510_FPGA_PCR_COM1_EN              (1 << 5)
+#define OMAP1510_FPGA_PCR_EXP_PD0              (1 << 4)
+#define OMAP1510_FPGA_PCR_EXP_PD1              (1 << 3)
+#define OMAP1510_FPGA_PCR_48MHZ_CLK            (1 << 2)
+#define OMAP1510_FPGA_PCR_4MHZ_CLK             (1 << 1)
+#define OMAP1510_FPGA_PCR_RSRVD_BIT0           (1 << 0)
+
+/*
+ * Innovator/OMAP1510 FPGA HID register bit definitions
+ */
+#define OMAP1510_FPGA_HID_SCLK (1<<0)  /* output */
+#define OMAP1510_FPGA_HID_MOSI (1<<1)  /* output */
+#define OMAP1510_FPGA_HID_nSS  (1<<2)  /* output 0/1 chip idle/select */
+#define OMAP1510_FPGA_HID_nHSUS        (1<<3)  /* output 0/1 host active/suspended */
+#define OMAP1510_FPGA_HID_MISO (1<<4)  /* input */
+#define OMAP1510_FPGA_HID_ATN  (1<<5)  /* input  0/1 chip idle/ATN */
+#define OMAP1510_FPGA_HID_rsrvd        (1<<6)
+#define OMAP1510_FPGA_HID_RESETn (1<<7)        /* output - 0/1 USAR reset/run */
+
+/* The FPGA IRQ is cascaded through GPIO_13 */
+#define OMAP1510_INT_FPGA              (IH_GPIO_BASE + 13)
+
+/* IRQ Numbers for interrupts muxed through the FPGA */
+#define OMAP1510_INT_FPGA_ATN          (OMAP_FPGA_IRQ_BASE + 0)
+#define OMAP1510_INT_FPGA_ACK          (OMAP_FPGA_IRQ_BASE + 1)
+#define OMAP1510_INT_FPGA2             (OMAP_FPGA_IRQ_BASE + 2)
+#define OMAP1510_INT_FPGA3             (OMAP_FPGA_IRQ_BASE + 3)
+#define OMAP1510_INT_FPGA4             (OMAP_FPGA_IRQ_BASE + 4)
+#define OMAP1510_INT_FPGA5             (OMAP_FPGA_IRQ_BASE + 5)
+#define OMAP1510_INT_FPGA6             (OMAP_FPGA_IRQ_BASE + 6)
+#define OMAP1510_INT_FPGA7             (OMAP_FPGA_IRQ_BASE + 7)
+#define OMAP1510_INT_FPGA8             (OMAP_FPGA_IRQ_BASE + 8)
+#define OMAP1510_INT_FPGA9             (OMAP_FPGA_IRQ_BASE + 9)
+#define OMAP1510_INT_FPGA10            (OMAP_FPGA_IRQ_BASE + 10)
+#define OMAP1510_INT_FPGA11            (OMAP_FPGA_IRQ_BASE + 11)
+#define OMAP1510_INT_FPGA12            (OMAP_FPGA_IRQ_BASE + 12)
+#define OMAP1510_INT_ETHER             (OMAP_FPGA_IRQ_BASE + 13)
+#define OMAP1510_INT_FPGAUART1         (OMAP_FPGA_IRQ_BASE + 14)
+#define OMAP1510_INT_FPGAUART2         (OMAP_FPGA_IRQ_BASE + 15)
+#define OMAP1510_INT_FPGA_TS           (OMAP_FPGA_IRQ_BASE + 16)
+#define OMAP1510_INT_FPGA17            (OMAP_FPGA_IRQ_BASE + 17)
+#define OMAP1510_INT_FPGA_CAM          (OMAP_FPGA_IRQ_BASE + 18)
+#define OMAP1510_INT_FPGA_RTC_A                (OMAP_FPGA_IRQ_BASE + 19)
+#define OMAP1510_INT_FPGA_RTC_B                (OMAP_FPGA_IRQ_BASE + 20)
+#define OMAP1510_INT_FPGA_CD           (OMAP_FPGA_IRQ_BASE + 21)
+#define OMAP1510_INT_FPGA22            (OMAP_FPGA_IRQ_BASE + 22)
+#define OMAP1510_INT_FPGA23            (OMAP_FPGA_IRQ_BASE + 23)
+
 #endif /*  __ASM_ARCH_OMAP15XX_H */
 
diff --git a/arch/arm/mach-omap1/include/mach/serial.h b/arch/arm/mach-omap1/include/mach/serial.h
new file mode 100644 (file)
index 0000000..2ce6a2d
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2009 Texas Instruments
+ * Added OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com>
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ASM_ARCH_SERIAL_H
+#define __ASM_ARCH_SERIAL_H
+
+#include <linux/init.h>
+
+/*
+ * Memory entry used for the DEBUG_LL UART configuration, relative to
+ * start of RAM. See also uncompress.h and debug-macro.S.
+ *
+ * Note that using a memory location for storing the UART configuration
+ * has at least two limitations:
+ *
+ * 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the
+ *    uncompress code could then partially overwrite itself
+ * 2. We assume printascii is called at least once before paging_init,
+ *    and addruart has a chance to read OMAP_UART_INFO
+ */
+#define OMAP_UART_INFO_OFS     0x3ffc
+
+/* OMAP1 serial ports */
+#define OMAP1_UART1_BASE       0xfffb0000
+#define OMAP1_UART2_BASE       0xfffb0800
+#define OMAP1_UART3_BASE       0xfffb9800
+
+#define OMAP_PORT_SHIFT                2
+#define OMAP7XX_PORT_SHIFT     0
+
+#define OMAP1510_BASE_BAUD     (12000000/16)
+#define OMAP16XX_BASE_BAUD     (48000000/16)
+
+/*
+ * DEBUG_LL port encoding stored into the UART1 scratchpad register by
+ * decomp_setup in uncompress.h
+ */
+#define OMAP1UART1             11
+#define OMAP1UART2             12
+#define OMAP1UART3             13
+
+#ifndef __ASSEMBLER__
+extern void omap_serial_init(void);
+#endif
+
+#endif
diff --git a/arch/arm/mach-omap1/include/mach/tc.h b/arch/arm/mach-omap1/include/mach/tc.h
new file mode 100644 (file)
index 0000000..1b4b2da
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * arch/arm/plat-omap/include/mach/tc.h
+ *
+ * OMAP Traffic Controller
+ *
+ * Copyright (C) 2004 Nokia Corporation
+ * Author: Imre Deak <imre.deak@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#ifndef __ASM_ARCH_TC_H
+#define __ASM_ARCH_TC_H
+
+#define TCMIF_BASE             0xfffecc00
+#define OMAP_TC_OCPT1_PRIOR    (TCMIF_BASE + 0x00)
+#define OMAP_TC_EMIFS_PRIOR    (TCMIF_BASE + 0x04)
+#define OMAP_TC_EMIFF_PRIOR    (TCMIF_BASE + 0x08)
+#define EMIFS_CONFIG           (TCMIF_BASE + 0x0c)
+#define EMIFS_CS0_CONFIG       (TCMIF_BASE + 0x10)
+#define EMIFS_CS1_CONFIG       (TCMIF_BASE + 0x14)
+#define EMIFS_CS2_CONFIG       (TCMIF_BASE + 0x18)
+#define EMIFS_CS3_CONFIG       (TCMIF_BASE + 0x1c)
+#define EMIFF_SDRAM_CONFIG     (TCMIF_BASE + 0x20)
+#define EMIFF_MRS              (TCMIF_BASE + 0x24)
+#define TC_TIMEOUT1            (TCMIF_BASE + 0x28)
+#define TC_TIMEOUT2            (TCMIF_BASE + 0x2c)
+#define TC_TIMEOUT3            (TCMIF_BASE + 0x30)
+#define TC_ENDIANISM           (TCMIF_BASE + 0x34)
+#define EMIFF_SDRAM_CONFIG_2   (TCMIF_BASE + 0x3c)
+#define EMIF_CFG_DYNAMIC_WS    (TCMIF_BASE + 0x40)
+#define EMIFS_ACS0             (TCMIF_BASE + 0x50)
+#define EMIFS_ACS1             (TCMIF_BASE + 0x54)
+#define EMIFS_ACS2             (TCMIF_BASE + 0x58)
+#define EMIFS_ACS3             (TCMIF_BASE + 0x5c)
+#define OMAP_TC_OCPT2_PRIOR    (TCMIF_BASE + 0xd0)
+
+/* external EMIFS chipselect regions */
+#define        OMAP_CS0_PHYS           0x00000000
+#define        OMAP_CS0_SIZE           SZ_64M
+
+#define        OMAP_CS1_PHYS           0x04000000
+#define        OMAP_CS1_SIZE           SZ_64M
+
+#define        OMAP_CS1A_PHYS          OMAP_CS1_PHYS
+#define        OMAP_CS1A_SIZE          SZ_32M
+
+#define        OMAP_CS1B_PHYS          (OMAP_CS1A_PHYS + OMAP_CS1A_SIZE)
+#define        OMAP_CS1B_SIZE          SZ_32M
+
+#define        OMAP_CS2_PHYS           0x08000000
+#define        OMAP_CS2_SIZE           SZ_64M
+
+#define        OMAP_CS2A_PHYS          OMAP_CS2_PHYS
+#define        OMAP_CS2A_SIZE          SZ_32M
+
+#define        OMAP_CS2B_PHYS          (OMAP_CS2A_PHYS + OMAP_CS2A_SIZE)
+#define        OMAP_CS2B_SIZE          SZ_32M
+
+#define        OMAP_CS3_PHYS           0x0c000000
+#define        OMAP_CS3_SIZE           SZ_64M
+
+#ifndef        __ASSEMBLER__
+
+/* EMIF Slow Interface Configuration Register */
+#define OMAP_EMIFS_CONFIG_FR           (1 << 4)
+#define OMAP_EMIFS_CONFIG_PDE          (1 << 3)
+#define OMAP_EMIFS_CONFIG_PWD_EN       (1 << 2)
+#define OMAP_EMIFS_CONFIG_BM           (1 << 1)
+#define OMAP_EMIFS_CONFIG_WP           (1 << 0)
+
+#define EMIFS_CCS(n)           (EMIFS_CS0_CONFIG + (4 * (n)))
+#define EMIFS_ACS(n)           (EMIFS_ACS0 + (4 * (n)))
+
+#endif /* __ASSEMBLER__ */
+
+#endif /* __ASM_ARCH_TC_H */
index 0ff22dc075c7826e9c37052da426d9e675c00b12..ad6fbe7d83f2d04d897da79678ff1d577006fc8e 100644 (file)
@@ -1,5 +1,122 @@
 /*
- * arch/arm/mach-omap1/include/mach/uncompress.h
+ * arch/arm/plat-omap/include/mach/uncompress.h
+ *
+ * Serial port stubs for kernel decompress status messages
+ *
+ * Initially based on:
+ * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h
+ * Copyright (C) 2000 RidgeRun, Inc.
+ * Author: Greg Lonnon <glonnon@ridgerun.com>
+ *
+ * Rewritten by:
+ * Author: <source@mvista.com>
+ * 2004 (c) MontaVista Software, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
  */
 
-#include <plat/uncompress.h>
+#include <linux/types.h>
+#include <linux/serial_reg.h>
+
+#include <asm/memory.h>
+#include <asm/mach-types.h>
+
+#include "serial.h"
+
+#define MDR1_MODE_MASK                 0x07
+
+volatile u8 *uart_base;
+int uart_shift;
+
+/*
+ * Store the DEBUG_LL uart number into memory.
+ * See also debug-macro.S, and serial.c for related code.
+ */
+static void set_omap_uart_info(unsigned char port)
+{
+       /*
+        * Get address of some.bss variable and round it down
+        * a la CONFIG_AUTO_ZRELADDR.
+        */
+       u32 ram_start = (u32)&uart_shift & 0xf8000000;
+       u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS);
+       *uart_info = port;
+}
+
+static void putc(int c)
+{
+       if (!uart_base)
+               return;
+
+       /* Check for UART 16x mode */
+       if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0)
+               return;
+
+       while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
+               barrier();
+       uart_base[UART_TX << uart_shift] = c;
+}
+
+static inline void flush(void)
+{
+}
+
+/*
+ * Macros to configure UART1 and debug UART
+ */
+#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id)              \
+       if (machine_is_##mach()) {                                      \
+               uart_base = (volatile u8 *)(dbg_uart);                  \
+               uart_shift = (dbg_shft);                                \
+               port = (dbg_id);                                        \
+               set_omap_uart_info(port);                               \
+               break;                                                  \
+       }
+
+#define DEBUG_LL_OMAP7XX(p, mach)                                      \
+       _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, \
+               OMAP1UART##p)
+
+#define DEBUG_LL_OMAP1(p, mach)                                                \
+       _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT,    \
+               OMAP1UART##p)
+
+static inline void arch_decomp_setup(void)
+{
+       int port = 0;
+
+       /*
+        * Initialize the port based on the machine ID from the bootloader.
+        * Note that we're using macros here instead of switch statement
+        * as machine_is functions are optimized out for the boards that
+        * are not selected.
+        */
+       do {
+               /* omap7xx/8xx based boards using UART1 with shift 0 */
+               DEBUG_LL_OMAP7XX(1, herald);
+               DEBUG_LL_OMAP7XX(1, omap_perseus2);
+
+               /* omap15xx/16xx based boards using UART1 */
+               DEBUG_LL_OMAP1(1, ams_delta);
+               DEBUG_LL_OMAP1(1, nokia770);
+               DEBUG_LL_OMAP1(1, omap_h2);
+               DEBUG_LL_OMAP1(1, omap_h3);
+               DEBUG_LL_OMAP1(1, omap_innovator);
+               DEBUG_LL_OMAP1(1, omap_osk);
+               DEBUG_LL_OMAP1(1, omap_palmte);
+               DEBUG_LL_OMAP1(1, omap_palmz71);
+
+               /* omap15xx/16xx based boards using UART2 */
+               DEBUG_LL_OMAP1(2, omap_palmtt);
+
+               /* omap15xx/16xx based boards using UART3 */
+               DEBUG_LL_OMAP1(3, sx1);
+       } while (0);
+}
+
+/*
+ * nothing to do
+ */
+#define arch_decomp_wdog()
index 6a5baab1f4cb690a46eb2086a97af7ca9babeaa1..44389d7cd25561705deec1eeb64b9bcfaee902ab 100644 (file)
@@ -17,8 +17,8 @@
 #include <asm/mach/map.h>
 
 #include <mach/mux.h>
-#include <plat/tc.h>
-#include <plat/dma.h>
+#include <mach/tc.h>
+#include <plat-omap/dma-omap.h>
 
 #include "iomap.h"
 #include "common.h"
index 6995fb6a33454d17f1f05d967f4c75ed2bb4d1e6..122ef67939a232cf2c2260e8ceae68870c7d7de9 100644 (file)
@@ -45,7 +45,7 @@
 #include <asm/irq.h>
 #include <asm/mach/irq.h>
 
-#include <plat/cpu.h>
+#include "soc.h"
 
 #include <mach/hardware.h>
 
index ed42628611bc23953c7e05a33b6a19c3fee6a34a..7ed8c1857d5650856a477e46101127065a4f05f1 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/io.h>
 
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 
 #include <mach/hardware.h>
 #include <mach/lcdc.h>
 
+#include "dma.h"
+
 int omap_lcd_dma_running(void)
 {
        /*
index bdc2e7541adb869fe27d20d2116225c74d2470a6..c6d8fdf92e9ca8fff8548cf1d5740a3220768bcb 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 #include <mach/mux.h>
-#include <plat/cpu.h>
+#include "soc.h"
 #include <linux/platform_data/asoc-ti-mcbsp.h>
 
 #include <mach/irqs.h>
 
 #include "iomap.h"
+#include "dma.h"
 
 #define DPS_RSTCT2_PER_EN      (1 << 0)
 #define DSP_RSTCT2_WD_PER_EN   (1 << 1)
diff --git a/arch/arm/mach-omap1/mmc.h b/arch/arm/mach-omap1/mmc.h
new file mode 100644 (file)
index 0000000..39c2b13
--- /dev/null
@@ -0,0 +1,18 @@
+#include <linux/mmc/host.h>
+#include <linux/platform_data/mmc-omap.h>
+
+#define OMAP15XX_NR_MMC                1
+#define OMAP16XX_NR_MMC                2
+#define OMAP1_MMC_SIZE         0x080
+#define OMAP1_MMC1_BASE                0xfffb7800
+#define OMAP1_MMC2_BASE                0xfffb7c00      /* omap16xx only */
+
+#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
+void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
+                               int nr_controllers);
+#else
+static inline void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
+                               int nr_controllers)
+{
+}
+#endif
index 9cd4ddb51397dc56fecc26c7384b0564836eaf0d..8dcebe6d8882bb0e4c150fa1d2c22fbbb25fd90a 100644 (file)
@@ -10,7 +10,7 @@
  * published by the Free Software Foundation.
  */
 
-#include <plat/clkdev_omap.h>
+#include "clock.h"
 #include "opp.h"
 
 /*-------------------------------------------------------------------------
index 47ec16155483b057bce3f8c375430923e0d09db6..b2c2328d7c18bb0c912fc9ea780964a3605abd7f 100644 (file)
 #include <asm/mach/time.h>
 #include <asm/mach/irq.h>
 
-#include <plat/cpu.h>
-#include <plat/clock.h>
-#include <plat/sram.h>
-#include <plat/tc.h>
+#include <mach/tc.h>
 #include <mach/mux.h>
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 #include <plat/dmtimer.h>
 
 #include <mach/irqs.h>
 
+#include "../plat-omap/sram.h"
+
 #include "iomap.h"
+#include "clock.h"
 #include "pm.h"
 
 static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];
index 7868e75ad0772a95eaec0885696c52a12d3bac5a..16bf2f95117c0749536da344d729c2f920949b45 100644 (file)
@@ -19,9 +19,6 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 
-#include <plat/omap_device.h>
-#include <plat/omap-pm.h>
-
 #ifdef CONFIG_PM_RUNTIME
 static int omap1_pm_runtime_suspend(struct device *dev)
 {
index b9d6834af835f27d4f41753dd7cf0aabb6a6ce37..d1ac08016f0bbaa99d9c6a99f38b4d38869b9675 100644 (file)
@@ -23,7 +23,6 @@
 #include <asm/mach-types.h>
 
 #include <mach/mux.h>
-#include <plat/fpga.h>
 
 #include "pm.h"
 
diff --git a/arch/arm/mach-omap1/soc.h b/arch/arm/mach-omap1/soc.h
new file mode 100644 (file)
index 0000000..6cf9c1c
--- /dev/null
@@ -0,0 +1,229 @@
+/*
+ * OMAP cpu type detection
+ *
+ * Copyright (C) 2004, 2008 Nokia Corporation
+ *
+ * Copyright (C) 2009-11 Texas Instruments.
+ *
+ * Written by Tony Lindgren <tony.lindgren@nokia.com>
+ *
+ * Added OMAP4/5 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ASM_ARCH_OMAP_CPU_H
+#define __ASM_ARCH_OMAP_CPU_H
+
+#ifndef __ASSEMBLY__
+
+#include <linux/bitops.h>
+
+/*
+ * Test if multicore OMAP support is needed
+ */
+#undef MULTI_OMAP1
+#undef OMAP_NAME
+
+#ifdef CONFIG_ARCH_OMAP730
+# ifdef OMAP_NAME
+#  undef  MULTI_OMAP1
+#  define MULTI_OMAP1
+# else
+#  define OMAP_NAME omap730
+# endif
+#endif
+#ifdef CONFIG_ARCH_OMAP850
+# ifdef OMAP_NAME
+#  undef  MULTI_OMAP1
+#  define MULTI_OMAP1
+# else
+#  define OMAP_NAME omap850
+# endif
+#endif
+#ifdef CONFIG_ARCH_OMAP15XX
+# ifdef OMAP_NAME
+#  undef  MULTI_OMAP1
+#  define MULTI_OMAP1
+# else
+#  define OMAP_NAME omap1510
+# endif
+#endif
+#ifdef CONFIG_ARCH_OMAP16XX
+# ifdef OMAP_NAME
+#  undef  MULTI_OMAP1
+#  define MULTI_OMAP1
+# else
+#  define OMAP_NAME omap16xx
+# endif
+#endif
+
+/*
+ * omap_rev bits:
+ * CPU id bits (0730, 1510, 1710, 2422...)     [31:16]
+ * CPU revision        (See _REV_ defined in cpu.h)    [15:08]
+ * CPU class bits (15xx, 16xx, 24xx, 34xx...)  [07:00]
+ */
+unsigned int omap_rev(void);
+
+/*
+ * Get the CPU revision for OMAP devices
+ */
+#define GET_OMAP_REVISION()    ((omap_rev() >> 8) & 0xff)
+
+/*
+ * Macros to group OMAP into cpu classes.
+ * These can be used in most places.
+ * cpu_is_omap7xx():   True for OMAP730, OMAP850
+ * cpu_is_omap15xx():  True for OMAP1510, OMAP5910 and OMAP310
+ * cpu_is_omap16xx():  True for OMAP1610, OMAP5912 and OMAP1710
+ */
+#define GET_OMAP_CLASS (omap_rev() & 0xff)
+
+#define IS_OMAP_CLASS(class, id)                       \
+static inline int is_omap ##class (void)               \
+{                                                      \
+       return (GET_OMAP_CLASS == (id)) ? 1 : 0;        \
+}
+
+#define GET_OMAP_SUBCLASS      ((omap_rev() >> 20) & 0x0fff)
+
+#define IS_OMAP_SUBCLASS(subclass, id)                 \
+static inline int is_omap ##subclass (void)            \
+{                                                      \
+       return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0;     \
+}
+
+IS_OMAP_CLASS(7xx, 0x07)
+IS_OMAP_CLASS(15xx, 0x15)
+IS_OMAP_CLASS(16xx, 0x16)
+
+#define cpu_is_omap7xx()               0
+#define cpu_is_omap15xx()              0
+#define cpu_is_omap16xx()              0
+
+#if defined(MULTI_OMAP1)
+# if defined(CONFIG_ARCH_OMAP730)
+#  undef  cpu_is_omap7xx
+#  define cpu_is_omap7xx()             is_omap7xx()
+# endif
+# if defined(CONFIG_ARCH_OMAP850)
+#  undef  cpu_is_omap7xx
+#  define cpu_is_omap7xx()             is_omap7xx()
+# endif
+# if defined(CONFIG_ARCH_OMAP15XX)
+#  undef  cpu_is_omap15xx
+#  define cpu_is_omap15xx()            is_omap15xx()
+# endif
+# if defined(CONFIG_ARCH_OMAP16XX)
+#  undef  cpu_is_omap16xx
+#  define cpu_is_omap16xx()            is_omap16xx()
+# endif
+#else
+# if defined(CONFIG_ARCH_OMAP730)
+#  undef  cpu_is_omap7xx
+#  define cpu_is_omap7xx()             1
+# endif
+# if defined(CONFIG_ARCH_OMAP850)
+#  undef  cpu_is_omap7xx
+#  define cpu_is_omap7xx()             1
+# endif
+# if defined(CONFIG_ARCH_OMAP15XX)
+#  undef  cpu_is_omap15xx
+#  define cpu_is_omap15xx()            1
+# endif
+# if defined(CONFIG_ARCH_OMAP16XX)
+#  undef  cpu_is_omap16xx
+#  define cpu_is_omap16xx()            1
+# endif
+#endif
+
+/*
+ * Macros to detect individual cpu types.
+ * These are only rarely needed.
+ * cpu_is_omap310():   True for OMAP310
+ * cpu_is_omap1510():  True for OMAP1510
+ * cpu_is_omap1610():  True for OMAP1610
+ * cpu_is_omap1611():  True for OMAP1611
+ * cpu_is_omap5912():  True for OMAP5912
+ * cpu_is_omap1621():  True for OMAP1621
+ * cpu_is_omap1710():  True for OMAP1710
+ */
+#define GET_OMAP_TYPE  ((omap_rev() >> 16) & 0xffff)
+
+#define IS_OMAP_TYPE(type, id)                         \
+static inline int is_omap ##type (void)                        \
+{                                                      \
+       return (GET_OMAP_TYPE == (id)) ? 1 : 0;         \
+}
+
+IS_OMAP_TYPE(310, 0x0310)
+IS_OMAP_TYPE(1510, 0x1510)
+IS_OMAP_TYPE(1610, 0x1610)
+IS_OMAP_TYPE(1611, 0x1611)
+IS_OMAP_TYPE(5912, 0x1611)
+IS_OMAP_TYPE(1621, 0x1621)
+IS_OMAP_TYPE(1710, 0x1710)
+
+#define cpu_is_omap310()               0
+#define cpu_is_omap1510()              0
+#define cpu_is_omap1610()              0
+#define cpu_is_omap5912()              0
+#define cpu_is_omap1611()              0
+#define cpu_is_omap1621()              0
+#define cpu_is_omap1710()              0
+
+/* These are needed to compile common code */
+#ifdef CONFIG_ARCH_OMAP1
+#define cpu_is_omap242x()              0
+#define cpu_is_omap2430()              0
+#define cpu_is_omap243x()              0
+#define cpu_is_omap24xx()              0
+#define cpu_is_omap34xx()              0
+#define cpu_is_omap44xx()              0
+#define soc_is_omap54xx()              0
+#define soc_is_am33xx()                        0
+#define cpu_class_is_omap1()           1
+#define cpu_class_is_omap2()           0
+#endif
+
+/*
+ * Whether we have MULTI_OMAP1 or not, we still need to distinguish
+ * between 310 vs. 1510 and 1611B/5912 vs. 1710.
+ */
+
+#if defined(CONFIG_ARCH_OMAP15XX)
+# undef  cpu_is_omap310
+# undef  cpu_is_omap1510
+# define cpu_is_omap310()              is_omap310()
+# define cpu_is_omap1510()             is_omap1510()
+#endif
+
+#if defined(CONFIG_ARCH_OMAP16XX)
+# undef  cpu_is_omap1610
+# undef  cpu_is_omap1611
+# undef  cpu_is_omap5912
+# undef  cpu_is_omap1621
+# undef  cpu_is_omap1710
+# define cpu_is_omap1610()             is_omap1610()
+# define cpu_is_omap1611()             is_omap1611()
+# define cpu_is_omap5912()             is_omap5912()
+# define cpu_is_omap1621()             is_omap1621()
+# define cpu_is_omap1710()             is_omap1710()
+#endif
+
+#endif /* __ASSEMBLY__ */
+#endif
index fe40d9e488c96cdf1c68ba1d6dd7acc9631b360b..46d9071f09386002fe06f11f0ed470b59a394787 100644 (file)
@@ -4,7 +4,8 @@
 
 # Common support
 obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer.o pm.o \
-        common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o
+        common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
+        omap_device.o
 
 # INTCPS IP block support - XXX should be moved to drivers/
 obj-$(CONFIG_ARCH_OMAP2)               += irq.o
index d0c54c573d3400dde7920d79e981b4f4c3982783..af11dcdb7e2c1372d436fbbe17ceab63826e0d14 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/err.h>
 #include <linux/davinci_emac.h>
 #include <asm/system.h>
-#include <plat/omap_device.h>
+#include "omap_device.h"
 #include "am35xx.h"
 #include "control.h"
 #include "am35xx-emac.h"
index 95b384d54f8aa847ff2c07b0cb33d3c94a2b1e64..3fc6d839fb3a900b47087468eb93cca4433c5a2d 100644 (file)
@@ -34,8 +34,7 @@
 #include <asm/mach/map.h>
 
 #include "common.h"
-#include <plat/gpmc.h>
-#include <plat/usb.h>
+#include "gpmc.h"
 #include "gpmc-smc91x.h"
 
 #include <video/omapdss.h>
index 96cd3693e1ae9990c621f8f44778775e1e2008cc..79fd9048fd7952d1acc1aff141205e322fb49119 100644 (file)
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <plat/usb.h>
 #include "common.h"
-#include <plat/dma.h>
-#include <plat/gpmc.h>
+#include <plat-omap/dma-omap.h>
 #include <video/omapdss.h>
 #include <video/omap-panel-tfp410.h>
 
+#include "gpmc.h"
 #include "gpmc-smc91x.h"
 
+#include "soc.h"
 #include "board-flash.h"
 #include "mux.h"
 #include "sdram-qimonda-hyb18m512160af-6.h"
index fc224ad86747a41362b884d33976f5882300339b..81871b1c735cd3193358925cb52f1847395eca92 100644 (file)
@@ -18,9 +18,8 @@
 
 #include "common.h"
 #include "gpmc-smc91x.h"
-#include <plat/usb.h>
 
-#include <mach/board-zoom.h>
+#include "board-zoom.h"
 
 #include "board-flash.h"
 #include "mux.h"
index 3669c120c7e8a7b29628273ea4dbf2d3bfac39b7..fd80d976872dfc2dfc8ce3d7621c239ae6f1f81c 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/leds.h>
 #include <linux/leds_pwm.h>
 #include <linux/platform_data/omap4-keypad.h>
+#include <linux/usb/musb.h>
 
 #include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
@@ -34,8 +35,6 @@
 #include <asm/mach/map.h>
 
 #include "common.h"
-#include <plat/usb.h>
-#include <plat/mmc.h>
 #include "omap4-keypad.h"
 #include <video/omapdss.h>
 #include <video/omap-panel-nokia-dsi.h>
@@ -45,6 +44,7 @@
 
 #include "soc.h"
 #include "mux.h"
+#include "mmc.h"
 #include "hsmmc.h"
 #include "control.h"
 #include "common-board-devices.h"
index 318feadb1d6e7ed4f6df2f6a9b152969a2d0f286..603503c587b77be41e8e4b3df60a6763d479ad31 100644 (file)
@@ -26,7 +26,6 @@
 #include <asm/mach/map.h>
 
 #include "common.h"
-#include <plat/usb.h>
 
 #include "am35xx-emac.h"
 #include "mux.h"
index e16289755f2e39b98674f8a10654c9805950c7d3..96d6c5ab5d4c8cfb109ff4c6bece4e17ef712879 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/can/platform/ti_hecc.h>
 #include <linux/davinci_emac.h>
 #include <linux/mmc/host.h>
+#include <linux/usb/musb.h>
 #include <linux/platform_data/gpio-omap.h>
 
 #include "am35xx.h"
@@ -33,7 +34,6 @@
 #include <asm/mach/map.h>
 
 #include "common.h"
-#include <plat/usb.h>
 #include <video/omapdss.h>
 #include <video/omap-panel-generic-dpi.h>
 #include <video/omap-panel-tfp410.h>
index cea3abace815716b4fea93aa1e9aae1c61238740..64cf1bde0f3b3feed5364b02bacfbfeb235ea151 100644 (file)
 #include <linux/clk.h>
 #include <linux/smc91x.h>
 #include <linux/gpio.h>
+#include <linux/platform_data/leds-omap.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/flash.h>
 
-#include <plat/led.h>
 #include "common.h"
-#include <plat/gpmc.h>
+#include "gpmc.h"
 
 #include <video/omapdss.h>
 #include <video/omap-panel-generic-dpi.h>
index 376d26eb601c371b75b4c4af7a3105ebe30bf8c4..cf9449bde1865689b22faf21bf581836ac06bde3 100644 (file)
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include "common.h"
 #include <linux/platform_data/mtd-nand-omap2.h>
-#include <plat/gpmc.h>
-#include <plat/usb.h>
 #include <video/omapdss.h>
 #include <video/omap-panel-generic-dpi.h>
 #include <video/omap-panel-tfp410.h>
 
 #include <mach/hardware.h>
 
+#include "common.h"
 #include "mux.h"
 #include "sdram-micron-mt46h32m32lf-6.h"
 #include "hsmmc.h"
 #include "common-board-devices.h"
+#include "gpmc.h"
+#include "gpmc-nand.h"
 
 #define CM_T35_GPIO_PENDOWN            57
 #define SB_T35_USB_HUB_RESET_GPIO      167
@@ -181,7 +181,7 @@ static struct omap_nand_platform_data cm_t35_nand_data = {
 
 static void __init cm_t35_init_nand(void)
 {
-       if (gpmc_nand_init(&cm_t35_nand_data) < 0)
+       if (gpmc_nand_init(&cm_t35_nand_data, NULL) < 0)
                pr_err("CM-T35: Unable to register NAND device\n");
 }
 #else
index 59c0a45f75b02aec82fbbb0d8ceb51a4a2879153..278664731d2cd5506005eae3c8c471fe1c84ea4a 100644 (file)
@@ -39,9 +39,8 @@
 #include <asm/mach/map.h>
 
 #include "common.h"
-#include <plat/usb.h>
 #include <linux/platform_data/mtd-nand-omap2.h>
-#include <plat/gpmc.h>
+#include "gpmc.h"
 
 #include "am35xx.h"
 
@@ -49,6 +48,7 @@
 #include "control.h"
 #include "common-board-devices.h"
 #include "am35xx-emac.h"
+#include "gpmc-nand.h"
 
 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
 static struct gpio_led cm_t3517_leds[] = {
@@ -240,7 +240,7 @@ static struct omap_nand_platform_data cm_t3517_nand_data = {
 
 static void __init cm_t3517_init_nand(void)
 {
-       if (gpmc_nand_init(&cm_t3517_nand_data) < 0)
+       if (gpmc_nand_init(&cm_t3517_nand_data, NULL) < 0)
                pr_err("CM-T3517: NAND initialization failed\n");
 }
 #else
index 1fd161e934c7e7df2d9eec52c3c35f3e8abfc964..933479e36737c2cec7c189765b43e08de6181097 100644 (file)
@@ -39,9 +39,8 @@
 #include <asm/mach/flash.h>
 
 #include "common.h"
-#include <plat/gpmc.h>
+#include "gpmc.h"
 #include <linux/platform_data/mtd-nand-omap2.h>
-#include <plat/usb.h>
 #include <video/omapdss.h>
 #include <video/omap-panel-generic-dpi.h>
 #include <video/omap-panel-tfp410.h>
 #include "sdram-micron-mt46h32m32lf-6.h"
 #include "mux.h"
 #include "hsmmc.h"
+#include "board-flash.h"
 #include "common-board-devices.h"
 
+#define        NAND_CS                 0
+
 #define OMAP_DM9000_GPIO_IRQ   25
 #define OMAP3_DEVKIT_TS_GPIO   27
 
@@ -621,8 +623,9 @@ static void __init devkit8000_init(void)
 
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
-       omap_nand_flash_init(NAND_BUSWIDTH_16, devkit8000_nand_partitions,
-                            ARRAY_SIZE(devkit8000_nand_partitions));
+       board_nand_init(devkit8000_nand_partitions,
+                       ARRAY_SIZE(devkit8000_nand_partitions), NAND_CS,
+                       NAND_BUSWIDTH_16, NULL);
        omap_twl4030_audio_init("omap3beagle");
 
        /* Ensure SDRC pins are mux'd for self-refresh */
index e642acf9cad0e1132bf3edcd6398d02c05d4cdaa..c33adea0247c661fb1530b14e129c19f8f7d8390 100644 (file)
 #include <linux/mtd/physmap.h>
 #include <linux/io.h>
 
-#include <plat/cpu.h>
-#include <plat/gpmc.h>
 #include <linux/platform_data/mtd-nand-omap2.h>
 #include <linux/platform_data/mtd-onenand-omap2.h>
-#include <plat/tc.h>
 
+#include "soc.h"
 #include "common.h"
 #include "board-flash.h"
+#include "gpmc-onenand.h"
+#include "gpmc-nand.h"
 
 #define REG_FPGA_REV                   0x10
 #define REG_FPGA_DIP_SWITCH_INPUT2     0x60
@@ -104,36 +104,35 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
                defined(CONFIG_MTD_NAND_OMAP2_MODULE)
 
 /* Note that all values in this struct are in nanoseconds */
-static struct gpmc_timings nand_timings = {
+struct gpmc_timings nand_default_timings[1] = {
+       {
+               .sync_clk = 0,
 
-       .sync_clk = 0,
+               .cs_on = 0,
+               .cs_rd_off = 36,
+               .cs_wr_off = 36,
 
-       .cs_on = 0,
-       .cs_rd_off = 36,
-       .cs_wr_off = 36,
+               .adv_on = 6,
+               .adv_rd_off = 24,
+               .adv_wr_off = 36,
 
-       .adv_on = 6,
-       .adv_rd_off = 24,
-       .adv_wr_off = 36,
+               .we_off = 30,
+               .oe_off = 48,
 
-       .we_off = 30,
-       .oe_off = 48,
+               .access = 54,
+               .rd_cycle = 72,
+               .wr_cycle = 72,
 
-       .access = 54,
-       .rd_cycle = 72,
-       .wr_cycle = 72,
-
-       .wr_access = 30,
-       .wr_data_mux_bus = 0,
+               .wr_access = 30,
+               .wr_data_mux_bus = 0,
+       },
 };
 
-static struct omap_nand_platform_data board_nand_data = {
-       .gpmc_t         = &nand_timings,
-};
+static struct omap_nand_platform_data board_nand_data;
 
 void
-__init board_nand_init(struct mtd_partition *nand_parts,
-                       u8 nr_parts, u8 cs, int nand_type)
+__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs,
+                               int nand_type, struct gpmc_timings *gpmc_t)
 {
        board_nand_data.cs              = cs;
        board_nand_data.parts           = nand_parts;
@@ -141,7 +140,7 @@ __init board_nand_init(struct mtd_partition *nand_parts,
        board_nand_data.devsize         = nand_type;
 
        board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT;
-       gpmc_nand_init(&board_nand_data);
+       gpmc_nand_init(&board_nand_data, gpmc_t);
 }
 #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */
 
@@ -238,5 +237,6 @@ void __init board_flash_init(struct flash_partitions partition_info[],
                pr_err("NAND: Unable to find configuration in GPMC\n");
        else
                board_nand_init(partition_info[2].parts,
-                       partition_info[2].nr_parts, nandcs, nand_type);
+                       partition_info[2].nr_parts, nandcs,
+                       nand_type, nand_default_timings);
 }
index c44b70d5202173a879519ea9ebf2cacdb1ac29d0..2fb5d41a9fae2679781a9c759913a032b1a69e9e 100644 (file)
@@ -12,7 +12,7 @@
  */
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
-#include <plat/gpmc.h>
+#include "gpmc.h"
 
 #define PDC_NOR                1
 #define PDC_NAND       2
@@ -40,12 +40,14 @@ static inline void board_flash_init(struct flash_partitions part[],
 #if defined(CONFIG_MTD_NAND_OMAP2) || \
                defined(CONFIG_MTD_NAND_OMAP2_MODULE)
 extern void board_nand_init(struct mtd_partition *nand_parts,
-                                       u8 nr_parts, u8 cs, int nand_type);
+               u8 nr_parts, u8 cs, int nand_type, struct gpmc_timings *gpmc_t);
+extern struct gpmc_timings nand_default_timings[];
 #else
 static inline void board_nand_init(struct mtd_partition *nand_parts,
-                                       u8 nr_parts, u8 cs, int nand_type)
+               u8 nr_parts, u8 cs, int nand_type, struct gpmc_timings *gpmc_t)
 {
 }
+#define        nand_default_timings    NULL
 #endif
 
 #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
index 3977a0276b4c6375808c71f67f2cedb49d415e61..bd11b0aa9495ceb879e5ea3ecb890ca4e1434909 100644 (file)
@@ -32,8 +32,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <plat/dma.h>
-#include <plat/gpmc.h>
+#include <plat-omap/dma-omap.h>
 #include "debug-devices.h"
 
 #include <video/omapdss.h>
@@ -42,6 +41,7 @@
 #include "common.h"
 #include "mux.h"
 #include "control.h"
+#include "gpmc.h"
 
 #define H4_FLASH_CS    0
 #define H4_SMC91X_CS   1
index 48d5e41dfbfabe3da59ef00f7457f5012cf2ec1a..dbc705ac4334222d6da12754871ad4feef100ae9 100644 (file)
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
-#include "common.h"
-#include <plat/gpmc.h>
-#include <plat/usb.h>
-
 #include <video/omapdss.h>
 #include <video/omap-panel-tfp410.h>
 #include <linux/platform_data/mtd-onenand-omap2.h>
 
+#include "common.h"
+#include "gpmc.h"
 #include "mux.h"
 #include "hsmmc.h"
 #include "sdram-numonyx-m65kxxxxam.h"
 #include "common-board-devices.h"
 #include "board-flash.h"
 #include "control.h"
+#include "gpmc-onenand.h"
 
 #define IGEP2_SMSC911X_CS       5
 #define IGEP2_SMSC911X_GPIO     176
@@ -175,7 +174,7 @@ static void __init igep_flash_init(void)
                pr_info("IGEP: initializing NAND memory device\n");
                board_nand_init(igep_flash_partitions,
                                ARRAY_SIZE(igep_flash_partitions),
-                               0, NAND_BUSWIDTH_16);
+                               0, NAND_BUSWIDTH_16, nand_default_timings);
        } else if (mux == IGEP_SYSBOOT_ONENAND) {
                pr_info("IGEP: initializing OneNAND memory device\n");
                board_onenand_init(igep_flash_partitions,
index ee8c3cfb95b392a50e207577679b7383dbc3aee1..1164b1061038156a80089b9178b61bdb863374e4 100644 (file)
@@ -35,9 +35,8 @@
 #include <asm/mach/map.h>
 
 #include "common.h"
-#include <plat/gpmc.h>
-#include <mach/board-zoom.h>
-#include <plat/usb.h>
+#include "board-zoom.h"
+#include "gpmc.h"
 #include "gpmc-smsc911x.h"
 
 #include <video/omapdss.h>
@@ -420,8 +419,8 @@ static void __init omap_ldp_init(void)
        omap_serial_init();
        omap_sdrc_init(NULL, NULL);
        usb_musb_init(NULL);
-       board_nand_init(ldp_nand_partitions,
-               ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0);
+       board_nand_init(ldp_nand_partitions, ARRAY_SIZE(ldp_nand_partitions),
+                       ZOOM_NAND_CS, 0, nand_default_timings);
 
        omap_hsmmc_init(mmc);
        ldp_display_init();
index e3e8325054b2fdf2945bfd691cd2e8610bec2bf8..e3efcb88cb3b2fdeeab86fab1d29e8fee8502fda 100644 (file)
 #include <asm/mach-types.h>
 
 #include "common.h"
-#include <plat/mmc.h>
+#include "mmc.h"
 
 #include "mux.h"
+#include "gpmc-onenand.h"
 
 #define TUSB6010_ASYNC_CS      1
 #define TUSB6010_SYNC_CS       4
index 388c431c745a0e4134c847f96f84b73912053bf7..85c09a09c5e38d8936f7a31376c30000e915152e 100644 (file)
 #include <asm/mach/map.h>
 #include <asm/mach/flash.h>
 
-#include "common.h"
 #include <video/omapdss.h>
 #include <video/omap-panel-tfp410.h>
-#include <plat/gpmc.h>
 #include <linux/platform_data/mtd-nand-omap2.h>
-#include <plat/usb.h>
-#include <plat/omap_device.h>
 
+#include "common.h"
+#include "omap_device.h"
+#include "gpmc.h"
+#include "soc.h"
 #include "mux.h"
 #include "hsmmc.h"
 #include "pm.h"
+#include "board-flash.h"
 #include "common-board-devices.h"
 
+#define        NAND_CS 0
+
 /*
  * OMAP3 Beagle revision
  * Run time detection of Beagle revision is done by reading GPIO.
@@ -512,8 +515,9 @@ static void __init omap3_beagle_init(void)
 
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
-       omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions,
-                            ARRAY_SIZE(omap3beagle_nand_partitions));
+       board_nand_init(omap3beagle_nand_partitions,
+                       ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS,
+                       NAND_BUSWIDTH_16, NULL);
        omap_twl4030_audio_init("omap3beagle");
 
        /* Ensure msecure is mux'd to be able to set the RTC. */
index b9b776b6c954c9a519f6ae2dee868b815a79d990..3c0b9a90f3b339d795b47f7e958bb671eb31ed5e 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/spi/ads7846.h>
 #include <linux/i2c/twl.h>
 #include <linux/usb/otg.h>
+#include <linux/usb/musb.h>
 #include <linux/usb/nop-usb-xceiv.h>
 #include <linux/smsc911x.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <plat/usb.h>
 #include <linux/platform_data/mtd-nand-omap2.h>
 #include "common.h"
 #include <linux/platform_data/spi-omap2-mcspi.h>
 #include <video/omapdss.h>
 #include <video/omap-panel-tfp410.h>
 
+#include "soc.h"
 #include "mux.h"
 #include "sdram-micron-mt46h32m32lf-6.h"
 #include "hsmmc.h"
 #include "common-board-devices.h"
+#include "board-flash.h"
+
+#define        NAND_CS                 0
 
 #define OMAP3_EVM_TS_GPIO      175
 #define OMAP3_EVM_EHCI_VBUS    22
@@ -731,8 +735,9 @@ static void __init omap3_evm_init(void)
        }
        usb_musb_init(&musb_board_data);
        usbhs_init(&usbhs_bdata);
-       omap_nand_flash_init(NAND_BUSWIDTH_16, omap3evm_nand_partitions,
-                            ARRAY_SIZE(omap3evm_nand_partitions));
+       board_nand_init(omap3evm_nand_partitions,
+                       ARRAY_SIZE(omap3evm_nand_partitions), NAND_CS,
+                       NAND_BUSWIDTH_16, NULL);
 
        omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);
        omap3evm_init_smsc911x();
index 7bd8253b5d1d61613ac6ad2e702a4efea26e5787..e84e2a875378134aaae80b8416c7edc9aea76aa5 100644 (file)
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include "gpmc-smsc911x.h"
-#include <plat/gpmc.h>
-#include <plat/sdrc.h>
-#include <plat/usb.h>
-
 #include "common.h"
 #include "mux.h"
 #include "hsmmc.h"
 #include "control.h"
 #include "common-board-devices.h"
+#include "gpmc.h"
+#include "gpmc-smsc911x.h"
 
 #define OMAP3LOGIC_SMSC911X_CS                 1
 
index 00a1f4ae6e4497c7bf62584e13470556fa329428..ce31bd329f380d6687c2c0b4f9146002890886de 100644 (file)
@@ -42,7 +42,6 @@
 #include <asm/mach/map.h>
 
 #include "common.h"
-#include <plat/usb.h>
 #include <video/omapdss.h>
 #include <linux/platform_data/mtd-nand-omap2.h>
 
@@ -50,6 +49,7 @@
 #include "sdram-micron-mt46h32m32lf-6.h"
 #include "hsmmc.h"
 #include "common-board-devices.h"
+#include "gpmc-nand.h"
 
 #define PANDORA_WIFI_IRQ_GPIO          21
 #define PANDORA_WIFI_NRESET_GPIO       23
@@ -602,7 +602,7 @@ static void __init omap3pandora_init(void)
        omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL);
        usbhs_init(&usbhs_bdata);
        usb_musb_init(NULL);
-       gpmc_nand_init(&pandora_nand_data);
+       gpmc_nand_init(&pandora_nand_data, NULL);
 
        /* Ensure SDRC pins are mux'd for self-refresh */
        omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
index 731235eb319e7456c10a20d2405d4d54bf5cff5d..ba1124538b9c3f8c2cc7e5b1b8a54e111cc0116d 100644 (file)
@@ -40,9 +40,8 @@
 #include <asm/mach/flash.h>
 
 #include "common.h"
-#include <plat/gpmc.h>
+#include "gpmc.h"
 #include <linux/platform_data/mtd-nand-omap2.h>
-#include <plat/usb.h>
 #include <video/omapdss.h>
 #include <video/omap-panel-generic-dpi.h>
 #include <video/omap-panel-tfp410.h>
index 944ffc436577f9fce420cf088af116329cb26132..a225d819633fd2a3b7a8231332d65da04cf35341 100644 (file)
 #include <asm/system_info.h>
 
 #include "common.h"
-#include <plat/gpmc.h>
+#include "gpmc.h"
 #include <linux/platform_data/mtd-nand-omap2.h>
-#include <plat/usb.h>
 
 #include "mux.h"
 #include "hsmmc.h"
+#include "board-flash.h"
 #include "common-board-devices.h"
 
 #include <asm/setup.h>
@@ -59,6 +59,8 @@
 #define TB_BL_PWM_TIMER                9
 #define TB_KILL_POWER_GPIO     168
 
+#define        NAND_CS                 0
+
 static unsigned long touchbook_revision;
 
 static struct mtd_partition omap3touchbook_nand_partitions[] = {
@@ -365,8 +367,9 @@ static void __init omap3_touchbook_init(void)
        omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata);
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
-       omap_nand_flash_init(NAND_BUSWIDTH_16, omap3touchbook_nand_partitions,
-                            ARRAY_SIZE(omap3touchbook_nand_partitions));
+       board_nand_init(omap3touchbook_nand_partitions,
+                       ARRAY_SIZE(omap3touchbook_nand_partitions), NAND_CS,
+                       NAND_BUSWIDTH_16, NULL);
 
        /* Ensure SDRC pins are mux'd for self-refresh */
        omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
index bfcd397e233c8750ee2d92f85b025d70c02c0699..8c00b99cd2a315821f1784c6891b9065385a5b66 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/regulator/machine.h>
 #include <linux/regulator/fixed.h>
 #include <linux/ti_wilink_st.h>
+#include <linux/usb/musb.h>
 #include <linux/wl12xx.h>
 #include <linux/platform_data/omap-abe-twl6040.h>
 
 #include <asm/mach/map.h>
 #include <video/omapdss.h>
 
-#include "common.h"
-#include <plat/usb.h>
-#include <plat/mmc.h>
 #include <video/omap-panel-tfp410.h>
 
+#include "common.h"
 #include "soc.h"
+#include "mmc.h"
 #include "hsmmc.h"
 #include "control.h"
 #include "mux.h"
index b700685762b50b70242f823e22bf393b2ebe4943..1cfb0374f5e27e3564d06a4ef47ed931e875abb9 100644 (file)
 #include <video/omapdss.h>
 #include <video/omap-panel-generic-dpi.h>
 #include <video/omap-panel-tfp410.h>
-#include <plat/gpmc.h>
-#include <plat/usb.h>
 
+#include "common.h"
 #include "mux.h"
 #include "sdram-micron-mt46h32m32lf-6.h"
+#include "gpmc.h"
 #include "hsmmc.h"
+#include "board-flash.h"
 #include "common-board-devices.h"
 
+#define        NAND_CS                 0
+
 #define OVERO_GPIO_BT_XGATE    15
 #define OVERO_GPIO_W2W_NRESET  16
 #define OVERO_GPIO_PENDOWN     114
@@ -495,8 +498,8 @@ static void __init overo_init(void)
        omap_serial_init();
        omap_sdrc_init(mt46h32m32lf6_sdrc_params,
                                  mt46h32m32lf6_sdrc_params);
-       omap_nand_flash_init(0, overo_nand_partitions,
-                            ARRAY_SIZE(overo_nand_partitions));
+       board_nand_init(overo_nand_partitions,
+                       ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL);
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
        overo_spi_init();
index 45997bfbcbd2e8b14eb94930eb9e227180a3b286..1997e0e722a1551d2d13b97f1c706d942a86c9ea 100644 (file)
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 
-#include <plat/i2c.h>
-#include <plat/mmc.h>
-#include <plat/usb.h>
-#include <plat/gpmc.h>
 #include "common.h"
-#include <plat/serial.h>
-
 #include "mux.h"
+#include "gpmc.h"
+#include "mmc.h"
 #include "hsmmc.h"
 #include "sdram-nokia.h"
 #include "common-board-devices.h"
+#include "gpmc-onenand.h"
 
 static struct regulator_consumer_supply rm680_vemmc_consumers[] = {
        REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
index 020e03c95bfe0843bdf9bac22f0077f6a4ce906f..07005fe40a2a65eecc529ea9d06fee342ff26150 100644 (file)
@@ -31,9 +31,7 @@
 #include <asm/system_info.h>
 
 #include "common.h"
-#include <plat/dma.h>
-#include <plat/gpmc.h>
-#include <plat/omap-pm.h>
+#include <plat-omap/dma-omap.h>
 #include "gpmc-smc91x.h"
 
 #include "board-rx51.h"
 #endif
 
 #include "mux.h"
+#include "omap-pm.h"
 #include "hsmmc.h"
 #include "common-board-devices.h"
+#include "gpmc.h"
+#include "gpmc-onenand.h"
 
 #define SYSTEM_REV_B_USES_VAUX3        0x1699
 #define SYSTEM_REV_S_USES_VAUX3 0x8
index 7bbb05d9689b806534b6b83bed6b1a2c6e1dd9cb..c388aec14799ae68cc2bd8086b8e45c4beef5be6 100644 (file)
 #include <linux/io.h>
 #include <linux/gpio.h>
 #include <linux/leds.h>
+#include <linux/usb/musb.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include "common.h"
-#include <plat/dma.h>
-#include <plat/gpmc.h>
-#include <plat/usb.h>
+#include <plat-omap/dma-omap.h>
 
+#include "common.h"
 #include "mux.h"
+#include "gpmc.h"
 #include "pm.h"
 #include "sdram-nokia.h"
 
index c4f8833b4c3c66a7eaa433622be930e7f5833f97..5e672c2b6a437d37db67a777e12de5979b59c5aa 100644 (file)
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/usb/musb.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
 #include "common.h"
-#include <plat/usb.h>
 
 static struct omap_musb_board_data musb_board_data = {
        .set_phy_power  = ti81xx_musb_phy_power,
index afb2278a29f6456c07f7c2d06b0c7a07d5957ca1..42e5f231a799560866d5ed53e653c593a0b6a267 100644 (file)
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
 
-#include <plat/gpmc.h>
+#include "gpmc.h"
 #include "gpmc-smsc911x.h"
 
-#include <mach/board-zoom.h>
+#include "board-zoom.h"
 
 #include "soc.h"
 #include "common.h"
index b940ab2259fb19705b892bc03a7f1b1ef1d36aa7..1c7c834a5b5f5fb819dc56b6c8bc01edfc62f4d8 100644 (file)
@@ -16,8 +16,9 @@
 #include <linux/spi/spi.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
 #include <video/omapdss.h>
-#include <mach/board-zoom.h>
+#include "board-zoom.h"
 
+#include "soc.h"
 #include "common.h"
 
 #define LCD_PANEL_RESET_GPIO_PROD      96
index c166fe1fdff9bbf1d92a276a72df028c8f89993f..26e07addc9d72b1c5540c1020043d171fe00a211 100644 (file)
@@ -26,9 +26,8 @@
 #include <asm/mach/map.h>
 
 #include "common.h"
-#include <plat/usb.h>
 
-#include <mach/board-zoom.h>
+#include "board-zoom.h"
 
 #include "mux.h"
 #include "hsmmc.h"
index 4994438e1f46cbdee5fee1f26d74afb2a596e7fb..8feb4d99b96d75deaac16392887e9eaf1801930d 100644 (file)
@@ -22,9 +22,8 @@
 #include <asm/mach/arch.h>
 
 #include "common.h"
-#include <plat/usb.h>
 
-#include <mach/board-zoom.h>
+#include "board-zoom.h"
 
 #include "board-flash.h"
 #include "mux.h"
@@ -113,8 +112,9 @@ static void __init omap_zoom_init(void)
                usbhs_init(&usbhs_bdata);
        }
 
-       board_nand_init(zoom_nand_partitions, ARRAY_SIZE(zoom_nand_partitions),
-                                               ZOOM_NAND_CS, NAND_BUSWIDTH_16);
+       board_nand_init(zoom_nand_partitions,
+                       ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS,
+                       NAND_BUSWIDTH_16, nand_default_timings);
        zoom_debugboard_init();
        zoom_peripherals_init();
 
diff --git a/arch/arm/mach-omap2/board-zoom.h b/arch/arm/mach-omap2/board-zoom.h
new file mode 100644 (file)
index 0000000..2e94869
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+ * Defines for zoom boards
+ */
+#include <video/omapdss.h>
+
+#define ZOOM_NAND_CS    0
+
+extern int __init zoom_debugboard_init(void);
+extern void __init zoom_peripherals_init(void);
+extern void __init zoom_display_init(void);
index c2d15212d64d768530e1b94b9d8cf4ad0ff8cec9..73a1414b89b07c5cea47eaea91bddfec870d3c57 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clock.h>
 #include <plat/prcm.h>
 
 #include "clock.h"
index 1502a7bc20bb2dbaa67a129c1aa5e18cb1d389f3..0890ba94a2821bedd9a6165a02fe4ee9ae47b88b 100644 (file)
@@ -14,8 +14,6 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clock.h>
-
 #include "clock.h"
 #include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
index 4ae439222085d3839fc32663e51240c4620a175c..3432f913f74326d03c3bf41ba91ebf1e18c6c8cd 100644 (file)
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clock.h>
-#include <plat/sram.h>
-#include <plat/sdrc.h>
+#include "../plat-omap/sram.h"
 
 #include "clock.h"
 #include "clock2xxx.h"
 #include "opp2xxx.h"
 #include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
+#include "sdrc.h"
 
 /* #define DOWN_VARIABLE_DPLL 1 */             /* Experimental */
 
index c3460928b5e0df94b436bb72b688b7cea7fe9668..e1777371bb5e9813c4c41baf664eb2eb3e3170c2 100644 (file)
@@ -23,8 +23,6 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clock.h>
-
 #include "clock.h"
 #include "clock2xxx.h"
 #include "prm2xxx_3xxx.h"
index 8693cfdac49afcc53dd213b93cb1eca21b3ccd3e..46683b3c2461be67fecb1422a7ae4da82ca954de 100644 (file)
@@ -22,8 +22,6 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clock.h>
-
 #include "clock.h"
 #include "clock2xxx.h"
 #include "prm2xxx_3xxx.h"
index 3524f0e7b6d5b0db13975d978850dc6fc42f4480..c66276b2bf0ae428c7f641800fb7a643fd38dc76 100644 (file)
@@ -33,9 +33,7 @@
 #include <linux/cpufreq.h>
 #include <linux/slab.h>
 
-#include <plat/clock.h>
-#include <plat/sram.h>
-#include <plat/sdrc.h>
+#include "../plat-omap/sram.h"
 
 #include "soc.h"
 #include "clock.h"
@@ -43,6 +41,7 @@
 #include "opp2xxx.h"
 #include "cm2xxx_3xxx.h"
 #include "cm-regbits-24xx.h"
+#include "sdrc.h"
 
 const struct prcm_config *curr_prcm_set;
 const struct prcm_config *rate_table;
index 7c6da2f731dc75683512af15df6510886f03c1e8..5510d92abe6eac5bf8e3158c167b608b1f5eedd5 100644 (file)
@@ -21,9 +21,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clock.h>
-#include <plat/sram.h>
-#include <plat/sdrc.h>
+#include "../plat-omap/sram.h"
 
 #include "clock.h"
 #include "clock3xxx.h"
index 3ff22114d702468192c781fe12ae72144691e509..53646facda45fe246df6b6eb264e896a527441fa 100644 (file)
@@ -45,8 +45,6 @@
 #include <linux/io.h>
 #include <linux/bug.h>
 
-#include <plat/clock.h>
-
 #include "clock.h"
 
 /* Private functions */
index 80411142f4823c9626115fb5847f87f35d7f1d8c..8463cc3562450155ee1a5b6eee6f506ba9366d89 100644 (file)
@@ -21,8 +21,6 @@
 
 #include <asm/div64.h>
 
-#include <plat/clock.h>
-
 #include "soc.h"
 #include "clock.h"
 #include "cm-regbits-24xx.h"
index 3d43fba2542f2a477bb1e908bc2baaa45658dbbc..7c8d41e49834824455ad4a8f84d0397dc38c673a 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clock.h>
 #include <plat/prcm.h>
 
 #include "clock.h"
index 961ac8f7e13d8c84a1cbb4587255ea685520bd18..8b30759f8f9e5fadf3fe4ca971dd51f6cd1efc4a 100644 (file)
@@ -15,6 +15,7 @@
 #undef DEBUG
 
 #include <linux/kernel.h>
+#include <linux/export.h>
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/err.h>
@@ -25,7 +26,6 @@
 
 #include <asm/cpu.h>
 
-#include <plat/clock.h>
 #include <plat/prcm.h>
 
 #include <trace/events/power.h>
@@ -47,6 +47,10 @@ u16 cpu_mask;
  */
 static bool clkdm_control = true;
 
+static LIST_HEAD(clocks);
+static DEFINE_MUTEX(clocks_mutex);
+static DEFINE_SPINLOCK(clockfw_lock);
+
 /*
  * OMAP2+ specific clock functions
  */
@@ -512,12 +516,510 @@ void __init omap2_clk_print_new_rates(const char *hfclkin_ck_name,
 
 /* Common data */
 
-struct clk_functions omap2_clk_functions = {
-       .clk_enable             = omap2_clk_enable,
-       .clk_disable            = omap2_clk_disable,
-       .clk_round_rate         = omap2_clk_round_rate,
-       .clk_set_rate           = omap2_clk_set_rate,
-       .clk_set_parent         = omap2_clk_set_parent,
-       .clk_disable_unused     = omap2_clk_disable_unused,
+int clk_enable(struct clk *clk)
+{
+       unsigned long flags;
+       int ret;
+
+       if (clk == NULL || IS_ERR(clk))
+               return -EINVAL;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       ret = omap2_clk_enable(clk);
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return ret;
+}
+EXPORT_SYMBOL(clk_enable);
+
+void clk_disable(struct clk *clk)
+{
+       unsigned long flags;
+
+       if (clk == NULL || IS_ERR(clk))
+               return;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       if (clk->usecount == 0) {
+               pr_err("Trying disable clock %s with 0 usecount\n",
+                      clk->name);
+               WARN_ON(1);
+               goto out;
+       }
+
+       omap2_clk_disable(clk);
+
+out:
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+}
+EXPORT_SYMBOL(clk_disable);
+
+unsigned long clk_get_rate(struct clk *clk)
+{
+       unsigned long flags;
+       unsigned long ret;
+
+       if (clk == NULL || IS_ERR(clk))
+               return 0;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       ret = clk->rate;
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return ret;
+}
+EXPORT_SYMBOL(clk_get_rate);
+
+/*
+ * Optional clock functions defined in include/linux/clk.h
+ */
+
+long clk_round_rate(struct clk *clk, unsigned long rate)
+{
+       unsigned long flags;
+       long ret;
+
+       if (clk == NULL || IS_ERR(clk))
+               return 0;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       ret = omap2_clk_round_rate(clk, rate);
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return ret;
+}
+EXPORT_SYMBOL(clk_round_rate);
+
+int clk_set_rate(struct clk *clk, unsigned long rate)
+{
+       unsigned long flags;
+       int ret = -EINVAL;
+
+       if (clk == NULL || IS_ERR(clk))
+               return ret;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       ret = omap2_clk_set_rate(clk, rate);
+       if (ret == 0)
+               propagate_rate(clk);
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return ret;
+}
+EXPORT_SYMBOL(clk_set_rate);
+
+int clk_set_parent(struct clk *clk, struct clk *parent)
+{
+       unsigned long flags;
+       int ret = -EINVAL;
+
+       if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent))
+               return ret;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       if (clk->usecount == 0) {
+               ret = omap2_clk_set_parent(clk, parent);
+               if (ret == 0)
+                       propagate_rate(clk);
+       } else {
+               ret = -EBUSY;
+       }
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return ret;
+}
+EXPORT_SYMBOL(clk_set_parent);
+
+struct clk *clk_get_parent(struct clk *clk)
+{
+       return clk->parent;
+}
+EXPORT_SYMBOL(clk_get_parent);
+
+/*
+ * OMAP specific clock functions shared between omap1 and omap2
+ */
+
+int __initdata mpurate;
+
+/*
+ * By default we use the rate set by the bootloader.
+ * You can override this with mpurate= cmdline option.
+ */
+static int __init omap_clk_setup(char *str)
+{
+       get_option(&str, &mpurate);
+
+       if (!mpurate)
+               return 1;
+
+       if (mpurate < 1000)
+               mpurate *= 1000000;
+
+       return 1;
+}
+__setup("mpurate=", omap_clk_setup);
+
+/* Used for clocks that always have same value as the parent clock */
+unsigned long followparent_recalc(struct clk *clk)
+{
+       return clk->parent->rate;
+}
+
+/*
+ * Used for clocks that have the same value as the parent clock,
+ * divided by some factor
+ */
+unsigned long omap_fixed_divisor_recalc(struct clk *clk)
+{
+       WARN_ON(!clk->fixed_div);
+
+       return clk->parent->rate / clk->fixed_div;
+}
+
+void clk_reparent(struct clk *child, struct clk *parent)
+{
+       list_del_init(&child->sibling);
+       if (parent)
+               list_add(&child->sibling, &parent->children);
+       child->parent = parent;
+
+       /* now do the debugfs renaming to reattach the child
+          to the proper parent */
+}
+
+/* Propagate rate to children */
+void propagate_rate(struct clk *tclk)
+{
+       struct clk *clkp;
+
+       list_for_each_entry(clkp, &tclk->children, sibling) {
+               if (clkp->recalc)
+                       clkp->rate = clkp->recalc(clkp);
+               propagate_rate(clkp);
+       }
+}
+
+static LIST_HEAD(root_clks);
+
+/**
+ * recalculate_root_clocks - recalculate and propagate all root clocks
+ *
+ * Recalculates all root clocks (clocks with no parent), which if the
+ * clock's .recalc is set correctly, should also propagate their rates.
+ * Called at init.
+ */
+void recalculate_root_clocks(void)
+{
+       struct clk *clkp;
+
+       list_for_each_entry(clkp, &root_clks, sibling) {
+               if (clkp->recalc)
+                       clkp->rate = clkp->recalc(clkp);
+               propagate_rate(clkp);
+       }
+}
+
+/**
+ * clk_preinit - initialize any fields in the struct clk before clk init
+ * @clk: struct clk * to initialize
+ *
+ * Initialize any struct clk fields needed before normal clk initialization
+ * can run.  No return value.
+ */
+void clk_preinit(struct clk *clk)
+{
+       INIT_LIST_HEAD(&clk->children);
+}
+
+int clk_register(struct clk *clk)
+{
+       if (clk == NULL || IS_ERR(clk))
+               return -EINVAL;
+
+       /*
+        * trap out already registered clocks
+        */
+       if (clk->node.next || clk->node.prev)
+               return 0;
+
+       mutex_lock(&clocks_mutex);
+       if (clk->parent)
+               list_add(&clk->sibling, &clk->parent->children);
+       else
+               list_add(&clk->sibling, &root_clks);
+
+       list_add(&clk->node, &clocks);
+       if (clk->init)
+               clk->init(clk);
+       mutex_unlock(&clocks_mutex);
+
+       return 0;
+}
+EXPORT_SYMBOL(clk_register);
+
+void clk_unregister(struct clk *clk)
+{
+       if (clk == NULL || IS_ERR(clk))
+               return;
+
+       mutex_lock(&clocks_mutex);
+       list_del(&clk->sibling);
+       list_del(&clk->node);
+       mutex_unlock(&clocks_mutex);
+}
+EXPORT_SYMBOL(clk_unregister);
+
+void clk_enable_init_clocks(void)
+{
+       struct clk *clkp;
+
+       list_for_each_entry(clkp, &clocks, node)
+               if (clkp->flags & ENABLE_ON_INIT)
+                       clk_enable(clkp);
+}
+
+/**
+ * omap_clk_get_by_name - locate OMAP struct clk by its name
+ * @name: name of the struct clk to locate
+ *
+ * Locate an OMAP struct clk by its name.  Assumes that struct clk
+ * names are unique.  Returns NULL if not found or a pointer to the
+ * struct clk if found.
+ */
+struct clk *omap_clk_get_by_name(const char *name)
+{
+       struct clk *c;
+       struct clk *ret = NULL;
+
+       mutex_lock(&clocks_mutex);
+
+       list_for_each_entry(c, &clocks, node) {
+               if (!strcmp(c->name, name)) {
+                       ret = c;
+                       break;
+               }
+       }
+
+       mutex_unlock(&clocks_mutex);
+
+       return ret;
+}
+
+int omap_clk_enable_autoidle_all(void)
+{
+       struct clk *c;
+       unsigned long flags;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+
+       list_for_each_entry(c, &clocks, node)
+               if (c->ops->allow_idle)
+                       c->ops->allow_idle(c);
+
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return 0;
+}
+
+int omap_clk_disable_autoidle_all(void)
+{
+       struct clk *c;
+       unsigned long flags;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+
+       list_for_each_entry(c, &clocks, node)
+               if (c->ops->deny_idle)
+                       c->ops->deny_idle(c);
+
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return 0;
+}
+
+/*
+ * Low level helpers
+ */
+static int clkll_enable_null(struct clk *clk)
+{
+       return 0;
+}
+
+static void clkll_disable_null(struct clk *clk)
+{
+}
+
+const struct clkops clkops_null = {
+       .enable         = clkll_enable_null,
+       .disable        = clkll_disable_null,
+};
+
+/*
+ * Dummy clock
+ *
+ * Used for clock aliases that are needed on some OMAPs, but not others
+ */
+struct clk dummy_ck = {
+       .name   = "dummy",
+       .ops    = &clkops_null,
+};
+
+/*
+ *
+ */
+
+#ifdef CONFIG_OMAP_RESET_CLOCKS
+/*
+ * Disable any unused clocks left on by the bootloader
+ */
+static int __init clk_disable_unused(void)
+{
+       struct clk *ck;
+       unsigned long flags;
+
+       pr_info("clock: disabling unused clocks to save power\n");
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       list_for_each_entry(ck, &clocks, node) {
+               if (ck->ops == &clkops_null)
+                       continue;
+
+               if (ck->usecount > 0 || !ck->enable_reg)
+                       continue;
+
+               omap2_clk_disable_unused(ck);
+       }
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return 0;
+}
+late_initcall(clk_disable_unused);
+late_initcall(omap_clk_enable_autoidle_all);
+#endif
+
+#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
+/*
+ *     debugfs support to trace clock tree hierarchy and attributes
+ */
+
+#include <linux/debugfs.h>
+#include <linux/seq_file.h>
+
+static struct dentry *clk_debugfs_root;
+
+static int clk_dbg_show_summary(struct seq_file *s, void *unused)
+{
+       struct clk *c;
+       struct clk *pa;
+
+       mutex_lock(&clocks_mutex);
+       seq_printf(s, "%-30s %-30s %-10s %s\n",
+                  "clock-name", "parent-name", "rate", "use-count");
+
+       list_for_each_entry(c, &clocks, node) {
+               pa = c->parent;
+               seq_printf(s, "%-30s %-30s %-10lu %d\n",
+                          c->name, pa ? pa->name : "none", c->rate,
+                          c->usecount);
+       }
+       mutex_unlock(&clocks_mutex);
+
+       return 0;
+}
+
+static int clk_dbg_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, clk_dbg_show_summary, inode->i_private);
+}
+
+static const struct file_operations debug_clock_fops = {
+       .open           = clk_dbg_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = single_release,
 };
 
+static int clk_debugfs_register_one(struct clk *c)
+{
+       int err;
+       struct dentry *d;
+       struct clk *pa = c->parent;
+
+       d = debugfs_create_dir(c->name, pa ? pa->dent : clk_debugfs_root);
+       if (!d)
+               return -ENOMEM;
+       c->dent = d;
+
+       d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount);
+       if (!d) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+       d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
+       if (!d) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+       d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags);
+       if (!d) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+       return 0;
+
+err_out:
+       debugfs_remove_recursive(c->dent);
+       return err;
+}
+
+static int clk_debugfs_register(struct clk *c)
+{
+       int err;
+       struct clk *pa = c->parent;
+
+       if (pa && !pa->dent) {
+               err = clk_debugfs_register(pa);
+               if (err)
+                       return err;
+       }
+
+       if (!c->dent) {
+               err = clk_debugfs_register_one(c);
+               if (err)
+                       return err;
+       }
+       return 0;
+}
+
+static int __init clk_debugfs_init(void)
+{
+       struct clk *c;
+       struct dentry *d;
+       int err;
+
+       d = debugfs_create_dir("clock", NULL);
+       if (!d)
+               return -ENOMEM;
+       clk_debugfs_root = d;
+
+       list_for_each_entry(c, &clocks, node) {
+               err = clk_debugfs_register(c);
+               if (err)
+                       goto err_out;
+       }
+
+       d = debugfs_create_file("summary", S_IRUGO,
+               d, NULL, &debug_clock_fops);
+       if (!d)
+               return -ENOMEM;
+
+       return 0;
+err_out:
+       debugfs_remove_recursive(clk_debugfs_root);
+       return err;
+}
+late_initcall(clk_debugfs_init);
+
+#endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */
+
index 35ec5f3d9a7361ee0b60647002a2a5251880580f..cfba1ffe5cc2ff650a721486e73d7512328215ae 100644 (file)
 #define __ARCH_ARM_MACH_OMAP2_CLOCK_H
 
 #include <linux/kernel.h>
+#include <linux/list.h>
+
+#include <linux/clkdev.h>
+
+struct omap_clk {
+       u16                             cpu;
+       struct clk_lookup               lk;
+};
+
+#define CLK(dev, con, ck, cp)          \
+       {                               \
+                .cpu = cp,             \
+               .lk = {                 \
+                       .dev_id = dev,  \
+                       .con_id = con,  \
+                       .clk = ck,      \
+               },                      \
+       }
+
+/* Platform flags for the clkdev-OMAP integration code */
+#define CK_242X                (1 << 0)
+#define CK_243X                (1 << 1)        /* 243x, 253x */
+#define CK_3430ES1     (1 << 2)        /* 34xxES1 only */
+#define CK_3430ES2PLUS (1 << 3)        /* 34xxES2, ES3, non-Sitara 35xx only */
+#define CK_AM35XX      (1 << 4)        /* Sitara AM35xx */
+#define CK_36XX                (1 << 5)        /* 36xx/37xx-specific clocks */
+#define CK_443X                (1 << 6)
+#define CK_TI816X      (1 << 7)
+#define CK_446X                (1 << 8)
+#define CK_AM33XX      (1 << 9)        /* AM33xx specific clocks */
+
+
+#define CK_34XX                (CK_3430ES1 | CK_3430ES2PLUS)
+#define CK_3XXX                (CK_34XX | CK_AM35XX | CK_36XX)
+
+struct module;
+struct clk;
+struct clockdomain;
+
+/* Temporary, needed during the common clock framework conversion */
+#define __clk_get_name(clk)    (clk->name)
+#define __clk_get_parent(clk)  (clk->parent)
+#define __clk_get_rate(clk)    (clk->rate)
+
+/**
+ * struct clkops - some clock function pointers
+ * @enable: fn ptr that enables the current clock in hardware
+ * @disable: fn ptr that enables the current clock in hardware
+ * @find_idlest: function returning the IDLEST register for the clock's IP blk
+ * @find_companion: function returning the "companion" clk reg for the clock
+ * @allow_idle: fn ptr that enables autoidle for the current clock in hardware
+ * @deny_idle: fn ptr that disables autoidle for the current clock in hardware
+ *
+ * A "companion" clk is an accompanying clock to the one being queried
+ * that must be enabled for the IP module connected to the clock to
+ * become accessible by the hardware.  Neither @find_idlest nor
+ * @find_companion should be needed; that information is IP
+ * block-specific; the hwmod code has been created to handle this, but
+ * until hwmod data is ready and drivers have been converted to use PM
+ * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and
+ * @find_companion must, unfortunately, remain.
+ */
+struct clkops {
+       int                     (*enable)(struct clk *);
+       void                    (*disable)(struct clk *);
+       void                    (*find_idlest)(struct clk *, void __iomem **,
+                                              u8 *, u8 *);
+       void                    (*find_companion)(struct clk *, void __iomem **,
+                                                 u8 *);
+       void                    (*allow_idle)(struct clk *);
+       void                    (*deny_idle)(struct clk *);
+};
+
+/* struct clksel_rate.flags possibilities */
+#define RATE_IN_242X           (1 << 0)
+#define RATE_IN_243X           (1 << 1)
+#define RATE_IN_3430ES1                (1 << 2)        /* 3430ES1 rates only */
+#define RATE_IN_3430ES2PLUS    (1 << 3)        /* 3430 ES >= 2 rates only */
+#define RATE_IN_36XX           (1 << 4)
+#define RATE_IN_4430           (1 << 5)
+#define RATE_IN_TI816X         (1 << 6)
+#define RATE_IN_4460           (1 << 7)
+#define RATE_IN_AM33XX         (1 << 8)
+#define RATE_IN_TI814X         (1 << 9)
+
+#define RATE_IN_24XX           (RATE_IN_242X | RATE_IN_243X)
+#define RATE_IN_34XX           (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
+#define RATE_IN_3XXX           (RATE_IN_34XX | RATE_IN_36XX)
+#define RATE_IN_44XX           (RATE_IN_4430 | RATE_IN_4460)
+
+/* RATE_IN_3430ES2PLUS_36XX includes 34xx/35xx with ES >=2, and all 36xx/37xx */
+#define RATE_IN_3430ES2PLUS_36XX       (RATE_IN_3430ES2PLUS | RATE_IN_36XX)
+
+
+/**
+ * struct clksel_rate - register bitfield values corresponding to clk divisors
+ * @val: register bitfield value (shifted to bit 0)
+ * @div: clock divisor corresponding to @val
+ * @flags: (see "struct clksel_rate.flags possibilities" above)
+ *
+ * @val should match the value of a read from struct clk.clksel_reg
+ * AND'ed with struct clk.clksel_mask, shifted right to bit 0.
+ *
+ * @div is the divisor that should be applied to the parent clock's rate
+ * to produce the current clock's rate.
+ */
+struct clksel_rate {
+       u32                     val;
+       u8                      div;
+       u16                     flags;
+};
+
+/**
+ * struct clksel - available parent clocks, and a pointer to their divisors
+ * @parent: struct clk * to a possible parent clock
+ * @rates: available divisors for this parent clock
+ *
+ * A struct clksel is always associated with one or more struct clks
+ * and one or more struct clksel_rates.
+ */
+struct clksel {
+       struct clk               *parent;
+       const struct clksel_rate *rates;
+};
+
+/**
+ * struct dpll_data - DPLL registers and integration data
+ * @mult_div1_reg: register containing the DPLL M and N bitfields
+ * @mult_mask: mask of the DPLL M bitfield in @mult_div1_reg
+ * @div1_mask: mask of the DPLL N bitfield in @mult_div1_reg
+ * @clk_bypass: struct clk pointer to the clock's bypass clock input
+ * @clk_ref: struct clk pointer to the clock's reference clock input
+ * @control_reg: register containing the DPLL mode bitfield
+ * @enable_mask: mask of the DPLL mode bitfield in @control_reg
+ * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate()
+ * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate()
+ * @max_multiplier: maximum valid non-bypass multiplier value (actual)
+ * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
+ * @min_divider: minimum valid non-bypass divider value (actual)
+ * @max_divider: maximum valid non-bypass divider value (actual)
+ * @modes: possible values of @enable_mask
+ * @autoidle_reg: register containing the DPLL autoidle mode bitfield
+ * @idlest_reg: register containing the DPLL idle status bitfield
+ * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg
+ * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg
+ * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg
+ * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg
+ * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs
+ * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs
+ * @flags: DPLL type/features (see below)
+ *
+ * Possible values for @flags:
+ * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs)
+ *
+ * @freqsel_mask is only used on the OMAP34xx family and AM35xx.
+ *
+ * XXX Some DPLLs have multiple bypass inputs, so it's not technically
+ * correct to only have one @clk_bypass pointer.
+ *
+ * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m,
+ * @last_rounded_n) should be separated from the runtime-fixed fields
+ * and placed into a different structure, so that the runtime-fixed data
+ * can be placed into read-only space.
+ */
+struct dpll_data {
+       void __iomem            *mult_div1_reg;
+       u32                     mult_mask;
+       u32                     div1_mask;
+       struct clk              *clk_bypass;
+       struct clk              *clk_ref;
+       void __iomem            *control_reg;
+       u32                     enable_mask;
+       unsigned long           last_rounded_rate;
+       u16                     last_rounded_m;
+       u16                     max_multiplier;
+       u8                      last_rounded_n;
+       u8                      min_divider;
+       u16                     max_divider;
+       u8                      modes;
+       void __iomem            *autoidle_reg;
+       void __iomem            *idlest_reg;
+       u32                     autoidle_mask;
+       u32                     freqsel_mask;
+       u32                     idlest_mask;
+       u32                     dco_mask;
+       u32                     sddiv_mask;
+       u8                      auto_recal_bit;
+       u8                      recal_en_bit;
+       u8                      recal_st_bit;
+       u8                      flags;
+};
+
+/*
+ * struct clk.flags possibilities
+ *
+ * XXX document the rest of the clock flags here
+ *
+ * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
+ *     bits share the same register.  This flag allows the
+ *     omap4_dpllmx*() code to determine which GATE_CTRL bit field
+ *     should be used.  This is a temporary solution - a better approach
+ *     would be to associate clock type-specific data with the clock,
+ *     similar to the struct dpll_data approach.
+ */
+#define ENABLE_REG_32BIT       (1 << 0)        /* Use 32-bit access */
+#define CLOCK_IDLE_CONTROL     (1 << 1)
+#define CLOCK_NO_IDLE_PARENT   (1 << 2)
+#define ENABLE_ON_INIT         (1 << 3)        /* Enable upon framework init */
+#define INVERT_ENABLE          (1 << 4)        /* 0 enables, 1 disables */
+#define CLOCK_CLKOUTX2         (1 << 5)
+
+/**
+ * struct clk - OMAP struct clk
+ * @node: list_head connecting this clock into the full clock list
+ * @ops: struct clkops * for this clock
+ * @name: the name of the clock in the hardware (used in hwmod data and debug)
+ * @parent: pointer to this clock's parent struct clk
+ * @children: list_head connecting to the child clks' @sibling list_heads
+ * @sibling: list_head connecting this clk to its parent clk's @children
+ * @rate: current clock rate
+ * @enable_reg: register to write to enable the clock (see @enable_bit)
+ * @recalc: fn ptr that returns the clock's current rate
+ * @set_rate: fn ptr that can change the clock's current rate
+ * @round_rate: fn ptr that can round the clock's current rate
+ * @init: fn ptr to do clock-specific initialization
+ * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
+ * @usecount: number of users that have requested this clock to be enabled
+ * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div
+ * @flags: see "struct clk.flags possibilities" above
+ * @clksel_reg: for clksel clks, register va containing src/divisor select
+ * @clksel_mask: bitmask in @clksel_reg for the src/divisor selector
+ * @clksel: for clksel clks, pointer to struct clksel for this clock
+ * @dpll_data: for DPLLs, pointer to struct dpll_data for this clock
+ * @clkdm_name: clockdomain name that this clock is contained in
+ * @clkdm: pointer to struct clockdomain, resolved from @clkdm_name at runtime
+ * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
+ * @src_offset: bitshift for source selection bitfield (OMAP1 only)
+ *
+ * XXX @rate_offset, @src_offset should probably be removed and OMAP1
+ * clock code converted to use clksel.
+ *
+ * XXX @usecount is poorly named.  It should be "enable_count" or
+ * something similar.  "users" in the description refers to kernel
+ * code (core code or drivers) that have called clk_enable() and not
+ * yet called clk_disable(); the usecount of parent clocks is also
+ * incremented by the clock code when clk_enable() is called on child
+ * clocks and decremented by the clock code when clk_disable() is
+ * called on child clocks.
+ *
+ * XXX @clkdm, @usecount, @children, @sibling should be marked for
+ * internal use only.
+ *
+ * @children and @sibling are used to optimize parent-to-child clock
+ * tree traversals.  (child-to-parent traversals use @parent.)
+ *
+ * XXX The notion of the clock's current rate probably needs to be
+ * separated from the clock's target rate.
+ */
+struct clk {
+       struct list_head        node;
+       const struct clkops     *ops;
+       const char              *name;
+       struct clk              *parent;
+       struct list_head        children;
+       struct list_head        sibling;        /* node for children */
+       unsigned long           rate;
+       void __iomem            *enable_reg;
+       unsigned long           (*recalc)(struct clk *);
+       int                     (*set_rate)(struct clk *, unsigned long);
+       long                    (*round_rate)(struct clk *, unsigned long);
+       void                    (*init)(struct clk *);
+       u8                      enable_bit;
+       s8                      usecount;
+       u8                      fixed_div;
+       u8                      flags;
+       void __iomem            *clksel_reg;
+       u32                     clksel_mask;
+       const struct clksel     *clksel;
+       struct dpll_data        *dpll_data;
+       const char              *clkdm_name;
+       struct clockdomain      *clkdm;
+#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
+       struct dentry           *dent;  /* For visible tree hierarchy */
+#endif
+};
+
+struct clk_functions {
+       int             (*clk_enable)(struct clk *clk);
+       void            (*clk_disable)(struct clk *clk);
+       long            (*clk_round_rate)(struct clk *clk, unsigned long rate);
+       int             (*clk_set_rate)(struct clk *clk, unsigned long rate);
+       int             (*clk_set_parent)(struct clk *clk, struct clk *parent);
+       void            (*clk_allow_idle)(struct clk *clk);
+       void            (*clk_deny_idle)(struct clk *clk);
+       void            (*clk_disable_unused)(struct clk *clk);
+};
+
+extern int mpurate;
+
+extern int clk_init(struct clk_functions *custom_clocks);
+extern void clk_preinit(struct clk *clk);
+extern int clk_register(struct clk *clk);
+extern void clk_reparent(struct clk *child, struct clk *parent);
+extern void clk_unregister(struct clk *clk);
+extern void propagate_rate(struct clk *clk);
+extern void recalculate_root_clocks(void);
+extern unsigned long followparent_recalc(struct clk *clk);
+extern void clk_enable_init_clocks(void);
+unsigned long omap_fixed_divisor_recalc(struct clk *clk);
+extern struct clk *omap_clk_get_by_name(const char *name);
+extern int omap_clk_enable_autoidle_all(void);
+extern int omap_clk_disable_autoidle_all(void);
+
+extern const struct clkops clkops_null;
+
+extern struct clk dummy_ck;
 
-#include <plat/clock.h>
 
 /* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */
 #define CORE_CLK_SRC_32K               0x0
index c3cde1a2b6de6d71956043cbd72054b6f3052438..ff47a6c2611d9f476cd16f77f4ad797047d3757e 100644 (file)
@@ -18,8 +18,6 @@
 #include <linux/clk.h>
 #include <linux/list.h>
 
-#include <plat/clkdev_omap.h>
-
 #include "soc.h"
 #include "iomap.h"
 #include "clock.h"
@@ -1935,8 +1933,6 @@ int __init omap2420_clk_init(void)
        cpu_mask = RATE_IN_242X;
        rate_table = omap2420_rate_table;
 
-       clk_init(&omap2_clk_functions);
-
        for (c = omap2420_clks; c < omap2420_clks + ARRAY_SIZE(omap2420_clks);
             c++)
                clk_preinit(c->lk.clk);
index a8e326177466dbf9bb7a23a44c2082ad4c37c081..850f83e8954fcb103ad5fbb411a52c19571d92b3 100644 (file)
@@ -21,8 +21,6 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clock.h>
-
 #include "soc.h"
 #include "iomap.h"
 #include "clock.h"
index 22404fe435e75369e288937b4b4e5d2e1969fd45..cab8e9c52d6e05734094232382e9f78df7bebba2 100644 (file)
@@ -17,8 +17,6 @@
 #include <linux/clk.h>
 #include <linux/list.h>
 
-#include <plat/clkdev_omap.h>
-
 #include "soc.h"
 #include "iomap.h"
 #include "clock.h"
@@ -2034,8 +2032,6 @@ int __init omap2430_clk_init(void)
        cpu_mask = RATE_IN_243X;
        rate_table = omap2430_rate_table;
 
-       clk_init(&omap2_clk_functions);
-
        for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks);
             c++)
                clk_preinit(c->lk.clk);
index e92be1fc1a00f7ccfeb2c7d11f83f22085de2b24..5feee16fee0ef0cbe88c8d5a24075a5113901e09 100644 (file)
@@ -22,8 +22,6 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clock.h>
-
 #include "soc.h"
 #include "clock.h"
 #include "clock2xxx.h"
index 114ab4b8e0e356883192bb847237172df9d46ab3..1cb79cc5808981b7600981c941aa4633f384b08e 100644 (file)
@@ -17,9 +17,8 @@
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/clk.h>
-#include <plat/clkdev_omap.h>
 
-#include "am33xx.h"
+#include "soc.h"
 #include "iomap.h"
 #include "control.h"
 #include "clock.h"
@@ -1085,8 +1084,6 @@ int __init am33xx_clk_init(void)
                cpu_clkflg = CK_AM33XX;
        }
 
-       clk_init(&omap2_clk_functions);
-
        for (c = am33xx_clks; c < am33xx_clks + ARRAY_SIZE(am33xx_clks); c++)
                clk_preinit(c->lk.clk);
 
index 1fc96b9ee330062171ae9e3ef81e32838ef99bae..baaaa4258708edad1810fce9c46b89ca98c15211 100644 (file)
@@ -21,8 +21,6 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clock.h>
-
 #include "clock.h"
 #include "clock34xx.h"
 #include "cm2xxx_3xxx.h"
index 2e97d08f0e567a1af1a3b7ee2cd1db1cdcb9098c..80209050cd7ae5bcd1027ea0b34fdd72676c2145 100644 (file)
@@ -21,8 +21,6 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clock.h>
-
 #include "clock.h"
 #include "clock3517.h"
 #include "cm2xxx_3xxx.h"
index 0c5e25ed8879cb1e311905269a5486a35b0b2a70..0e1e9e4e2fa43e7b51fb921f6d5f222999f75f36 100644 (file)
@@ -22,8 +22,6 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clock.h>
-
 #include "clock.h"
 #include "clock36xx.h"
 
index 83bb01427d405b4aa506c84882a4c522e8d58a7e..3e8aca2b1b61d71ec0da6382960088867ce5e0e9 100644 (file)
@@ -21,8 +21,6 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clock.h>
-
 #include "soc.h"
 #include "clock.h"
 #include "clock3xxx.h"
index 1f42c9d5ecf3131b5f55fd6d2152912d44b2d9ff..a02d158568e8c5d27a63daff50e12a1f6115c731 100644 (file)
@@ -21,8 +21,6 @@
 #include <linux/list.h>
 #include <linux/io.h>
 
-#include <plat/clkdev_omap.h>
-
 #include "soc.h"
 #include "iomap.h"
 #include "clock.h"
@@ -3573,8 +3571,6 @@ int __init omap3xxx_clk_init(void)
        else
                dpll4_dd = dpll4_dd_34xx;
 
-       clk_init(&omap2_clk_functions);
-
        for (c = omap3xxx_clks; c < omap3xxx_clks + ARRAY_SIZE(omap3xxx_clks);
             c++)
                clk_preinit(c->lk.clk);
index d661d138f27057d2dcc2130d741f6c0fa53bcb9d..2a450c9b9a7bd24bade47b3b1bcf0e544e084f0c 100644 (file)
@@ -28,8 +28,6 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clkdev_omap.h>
-
 #include "soc.h"
 #include "iomap.h"
 #include "clock.h"
@@ -3294,7 +3292,7 @@ static struct omap_clk omap44xx_clks[] = {
        CLK(NULL,       "auxclk5_src_ck",               &auxclk5_src_ck,        CK_443X),
        CLK(NULL,       "auxclk5_ck",                   &auxclk5_ck,    CK_443X),
        CLK(NULL,       "auxclkreq5_ck",                &auxclkreq5_ck, CK_443X),
-       CLK(NULL,       "gpmc_ck",                      &dummy_ck,      CK_443X),
+       CLK("omap-gpmc",        "fck",                          &dummy_ck,      CK_443X),
        CLK("omap_i2c.1",       "ick",                          &dummy_ck,      CK_443X),
        CLK("omap_i2c.2",       "ick",                          &dummy_ck,      CK_443X),
        CLK("omap_i2c.3",       "ick",                          &dummy_ck,      CK_443X),
@@ -3366,8 +3364,6 @@ int __init omap4xxx_clk_init(void)
                return 0;
        }
 
-       clk_init(&omap2_clk_functions);
-
        /*
         * Must stay commented until all OMAP SoC drivers are
         * converted to runtime PM, or drivers may start crashing
index cbb879139c51fd915c7ea50d00a6e91ad730d8b3..64e50465a4b58dddbaa36af027ac775de211c978 100644 (file)
@@ -27,7 +27,8 @@
 
 #include <linux/bitops.h>
 
-#include <plat/clock.h>
+#include "soc.h"
+#include "clock.h"
 #include "clockdomain.h"
 
 /* clkdm_list contains all registered struct clockdomains */
@@ -925,15 +926,18 @@ static int _clkdm_clk_hwmod_enable(struct clockdomain *clkdm)
        if (!clkdm || !arch_clkdm || !arch_clkdm->clkdm_clk_enable)
                return -EINVAL;
 
+       spin_lock_irqsave(&clkdm->lock, flags);
+
        /*
         * For arch's with no autodeps, clkcm_clk_enable
         * should be called for every clock instance or hwmod that is
         * enabled, so the clkdm can be force woken up.
         */
-       if ((atomic_inc_return(&clkdm->usecount) > 1) && autodeps)
+       if ((atomic_inc_return(&clkdm->usecount) > 1) && autodeps) {
+               spin_unlock_irqrestore(&clkdm->lock, flags);
                return 0;
+       }
 
-       spin_lock_irqsave(&clkdm->lock, flags);
        arch_clkdm->clkdm_clk_enable(clkdm);
        pwrdm_state_switch(clkdm->pwrdm.ptr);
        spin_unlock_irqrestore(&clkdm->lock, flags);
@@ -950,15 +954,19 @@ static int _clkdm_clk_hwmod_disable(struct clockdomain *clkdm)
        if (!clkdm || !arch_clkdm || !arch_clkdm->clkdm_clk_disable)
                return -EINVAL;
 
+       spin_lock_irqsave(&clkdm->lock, flags);
+
        if (atomic_read(&clkdm->usecount) == 0) {
+               spin_unlock_irqrestore(&clkdm->lock, flags);
                WARN_ON(1); /* underflow */
                return -ERANGE;
        }
 
-       if (atomic_dec_return(&clkdm->usecount) > 0)
+       if (atomic_dec_return(&clkdm->usecount) > 0) {
+               spin_unlock_irqrestore(&clkdm->lock, flags);
                return 0;
+       }
 
-       spin_lock_irqsave(&clkdm->lock, flags);
        arch_clkdm->clkdm_clk_disable(clkdm);
        pwrdm_state_switch(clkdm->pwrdm.ptr);
        spin_unlock_irqrestore(&clkdm->lock, flags);
index 629576be74445419fbc815fdfd8861cd2190943a..bc42446e23ab852fec7f5c268299b37160031351 100644 (file)
@@ -18,9 +18,8 @@
 #include <linux/spinlock.h>
 
 #include "powerdomain.h"
-#include <plat/clock.h>
-#include <plat/omap_hwmod.h>
-#include <plat/cpu.h>
+#include "clock.h"
+#include "omap_hwmod.h"
 
 /*
  * Clockdomain flags
index 70294f54e35af2b656cacaf10543612511d2d584..3e4e9209b2df162e72351a71aa31fb58e93ea7f3 100644 (file)
@@ -14,6 +14,8 @@
 
 #include <linux/types.h>
 #include <plat/prcm.h>
+
+#include "soc.h"
 #include "prm.h"
 #include "prm2xxx_3xxx.h"
 #include "cm.h"
index 5c741852fac0294748d9f417ce9b73494eb25f32..7e76becf3a4ae7dae8119d68f8be46f8fdc2229b 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/kernel.h>
 #include <linux/io.h>
 
+#include "soc.h"
 #include "clockdomain.h"
 #include "prm2xxx_3xxx.h"
 #include "cm2xxx_3xxx.h"
index f09617555e15d7da642621a1f076e2cdf8690bc5..b923007e45d005c5657e667fa2d4b6e959195ed6 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/kernel.h>
 #include <linux/io.h>
 
+#include "soc.h"
 #include "clockdomain.h"
 #include "prm2xxx_3xxx.h"
 #include "cm2xxx_3xxx.h"
index 933a35cd124a33a1184639054afba1d582623fc0..e6b91e552d3d9427bbfd5287e6762bbff5aaae54 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/kernel.h>
 #include <linux/io.h>
 
+#include "soc.h"
 #include "clockdomain.h"
 #include "prm2xxx_3xxx.h"
 #include "cm2xxx_3xxx.h"
index 13f56eafef03fb70071071884713d7f335e9228d..b4938abf28cc66d023b92df36ae7de002eaec6ed 100644 (file)
@@ -22,7 +22,7 @@
 #include <linux/err.h>
 #include <linux/io.h>
 
-#include <plat/common.h>
+#include "../plat-omap/common.h"
 
 #include "cm.h"
 #include "cm33xx.h"
index 48daac2581b4a154a768923681ac108c084a5c98..ad856092c06aa889c149a70142f0397573b26a8a 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/spi/ads7846.h>
 
 #include <linux/platform_data/spi-omap2-mcspi.h>
-#include <linux/platform_data/mtd-nand-omap2.h>
 
 #include "common.h"
 #include "common-board-devices.h"
@@ -96,48 +95,3 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
 {
 }
 #endif
-
-#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
-static struct omap_nand_platform_data nand_data;
-
-void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
-                                int nr_parts)
-{
-       u8 cs = 0;
-       u8 nandcs = GPMC_CS_NUM + 1;
-
-       /* find out the chip-select on which NAND exists */
-       while (cs < GPMC_CS_NUM) {
-               u32 ret = 0;
-               ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
-
-               if ((ret & 0xC00) == 0x800) {
-                       printk(KERN_INFO "Found NAND on CS%d\n", cs);
-                       if (nandcs > GPMC_CS_NUM)
-                               nandcs = cs;
-               }
-               cs++;
-       }
-
-       if (nandcs > GPMC_CS_NUM) {
-               pr_info("NAND: Unable to find configuration in GPMC\n");
-               return;
-       }
-
-       if (nandcs < GPMC_CS_NUM) {
-               nand_data.cs = nandcs;
-               nand_data.parts = parts;
-               nand_data.nr_parts = nr_parts;
-               nand_data.devsize = options;
-
-               printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
-               if (gpmc_nand_init(&nand_data) < 0)
-                       printk(KERN_ERR "Unable to register NAND device\n");
-       }
-}
-#else
-void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
-                                int nr_parts)
-{
-}
-#endif
index a0b4a42836ab9f7a29f1757ee410e37a237af00c..72bb41b3fd254382ce23a5759ba607a7f7777f1f 100644 (file)
@@ -10,6 +10,5 @@ struct ads7846_platform_data;
 
 void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
                       struct ads7846_platform_data *board_pdata);
-void omap_nand_flash_init(int opts, struct mtd_partition *parts, int n_parts);
 
 #endif /* __OMAP_COMMON_BOARD_DEVICES__ */
index 17950c6e130b12250fa0eb60aac4ae14686e5c85..34fb5b95859b49be8c5db93b2cd19ee94dad4162 100644 (file)
 #include <linux/init.h>
 #include <linux/clk.h>
 #include <linux/io.h>
+#include <linux/platform_data/dsp-omap.h>
 
-#include <plat/clock.h>
+#include <plat/vram.h>
 
 #include "soc.h"
 #include "iomap.h"
 #include "common.h"
+#include "clock.h"
 #include "sdrc.h"
 #include "control.h"
+#include "omap-secure.h"
 
 /* Global address base setup code */
 
@@ -200,3 +203,20 @@ void __init omap5_map_io(void)
        omap5_map_common_io();
 }
 #endif
+
+/*
+ * Stub function for OMAP2 so that common files
+ * continue to build when custom builds are used
+ */
+int __weak omap_secure_ram_reserve_memblock(void)
+{
+       return 0;
+}
+
+void __init omap_reserve(void)
+{
+       omap_vram_reserve_sdram_memblock();
+       omap_dsp_reserve_sdram_memblock();
+       omap_secure_ram_reserve_memblock();
+       omap_barrier_reserve_memblock();
+}
index 7045e4d61ac39608acb1a46ea60c5c020e067726..c925c805969fd5997711655ef283f06adc6a9d5e 100644 (file)
 
 #include <linux/irq.h>
 #include <linux/delay.h>
+#include <linux/i2c.h>
 #include <linux/i2c/twl.h>
+#include <linux/i2c-omap.h>
 
 #include <asm/proc-fns.h>
 
-#include <plat/cpu.h>
-#include <plat/serial.h>
-#include <plat/common.h>
+#include "../plat-omap/common.h"
+
+#include "i2c.h"
+#include "serial.h"
+
+#include "usb.h"
 
 #define OMAP_INTC_START                NR_IRQS
 
@@ -338,6 +343,7 @@ extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
                                      struct omap_sdrc_params *sdrc_cs1);
 struct omap2_hsmmc_info;
 extern int omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers);
+extern void omap_reserve(void);
 
 #endif /* __ASSEMBLER__ */
 #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
index d1ff8399a2223103a67d6ad2ff46210200c9097c..bf2be5c5468dc5bdaf66df1592637e5a2d518d00 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * OMAP2/3 System Control Module register access
  *
- * Copyright (C) 2007 Texas Instruments, Inc.
+ * Copyright (C) 2007, 2012 Texas Instruments, Inc.
  * Copyright (C) 2007 Nokia Corporation
  *
  * Written by Paul Walmsley
@@ -15,8 +15,6 @@
 #include <linux/kernel.h>
 #include <linux/io.h>
 
-#include <plat/sdrc.h>
-
 #include "soc.h"
 #include "iomap.h"
 #include "common.h"
index c8c211731d267a233b7b8ac56cd042f472d46985..2ad491d6910ba53775f0cd398b1a617facbcd129 100644 (file)
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
 
+#include <plat-omap/dma-omap.h>
+
 #include "iomap.h"
-#include <plat/dma.h>
-#include <plat/omap_hwmod.h>
-#include <plat/omap_device.h>
+#include "omap_hwmod.h"
+#include "omap_device.h"
 #include "omap4-keypad.h"
 
 #include "soc.h"
@@ -34,6 +35,7 @@
 #include "mux.h"
 #include "control.h"
 #include "devices.h"
+#include "dma.h"
 
 #define L3_MODULES_MAX_LEN 12
 #define L3_MODULES 3
@@ -341,7 +343,7 @@ static void __init omap_init_dmic(void)
 
        oh = omap_hwmod_lookup("dmic");
        if (!oh) {
-               printk(KERN_ERR "Could not look up mcpdm hw_mod\n");
+               pr_err("Could not look up dmic hw_mod\n");
                return;
        }
 
index 1011995f150a60c8f4453832835f4b974dbdd000..89c57129357a41eeb1d0e6c73745e1d1c7591f74 100644 (file)
 #include <linux/delay.h>
 
 #include <video/omapdss.h>
-#include <plat/omap_hwmod.h>
-#include <plat/omap_device.h>
-#include <plat/omap-pm.h>
+#include "omap_hwmod.h"
+#include "omap_device.h"
+#include "omap-pm.h"
 #include "common.h"
 
+#include "soc.h"
 #include "iomap.h"
 #include "mux.h"
 #include "control.h"
@@ -284,6 +285,35 @@ err:
        return ERR_PTR(r);
 }
 
+static enum omapdss_version __init omap_display_get_version(void)
+{
+       if (cpu_is_omap24xx())
+               return OMAPDSS_VER_OMAP24xx;
+       else if (cpu_is_omap3630())
+               return OMAPDSS_VER_OMAP3630;
+       else if (cpu_is_omap34xx()) {
+               if (soc_is_am35xx()) {
+                       return OMAPDSS_VER_AM35xx;
+               } else {
+                       if (omap_rev() < OMAP3430_REV_ES3_0)
+                               return OMAPDSS_VER_OMAP34xx_ES1;
+                       else
+                               return OMAPDSS_VER_OMAP34xx_ES3;
+               }
+       } else if (omap_rev() == OMAP4430_REV_ES1_0)
+               return OMAPDSS_VER_OMAP4430_ES1;
+       else if (omap_rev() == OMAP4430_REV_ES2_0 ||
+                       omap_rev() == OMAP4430_REV_ES2_1 ||
+                       omap_rev() == OMAP4430_REV_ES2_2)
+               return OMAPDSS_VER_OMAP4430_ES2;
+       else if (cpu_is_omap44xx())
+               return OMAPDSS_VER_OMAP4;
+       else if (soc_is_omap54xx())
+               return OMAPDSS_VER_OMAP5;
+       else
+               return OMAPDSS_VER_UNKNOWN;
+}
+
 int __init omap_display_init(struct omap_dss_board_info *board_data)
 {
        int r = 0;
@@ -291,9 +321,18 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
        int i, oh_count;
        const struct omap_dss_hwmod_data *curr_dss_hwmod;
        struct platform_device *dss_pdev;
+       enum omapdss_version ver;
 
        /* create omapdss device */
 
+       ver = omap_display_get_version();
+
+       if (ver == OMAPDSS_VER_UNKNOWN) {
+               pr_err("DSS not supported on this SoC\n");
+               return -ENODEV;
+       }
+
+       board_data->version = ver;
        board_data->dsi_enable_pads = omap_dsi_enable_pads;
        board_data->dsi_disable_pads = omap_dsi_disable_pads;
        board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count;
index ff75abe60af2c25eac226987d022584219cfa9fb..b1926cd70468e2b156c1d9e1645b872e50bc831a 100644 (file)
 #include <linux/init.h>
 #include <linux/device.h>
 
-#include <plat/omap_hwmod.h>
-#include <plat/omap_device.h>
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
+
+#include "soc.h"
+#include "omap_hwmod.h"
+#include "omap_device.h"
 
 #define OMAP2_DMA_STRIDE       0x60
 
diff --git a/arch/arm/mach-omap2/dma.h b/arch/arm/mach-omap2/dma.h
new file mode 100644 (file)
index 0000000..eba80db
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ *  OMAP2PLUS DMA channel definitions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __OMAP2PLUS_DMA_CHANNEL_H
+#define __OMAP2PLUS_DMA_CHANNEL_H
+
+
+/* DMA channels for 24xx */
+#define OMAP24XX_DMA_NO_DEVICE         0
+#define OMAP24XX_DMA_XTI_DMA           1       /* S_DMA_0 */
+#define OMAP24XX_DMA_EXT_DMAREQ0       2       /* S_DMA_1 */
+#define OMAP24XX_DMA_EXT_DMAREQ1       3       /* S_DMA_2 */
+#define OMAP24XX_DMA_GPMC              4       /* S_DMA_3 */
+#define OMAP24XX_DMA_GFX               5       /* S_DMA_4 */
+#define OMAP24XX_DMA_DSS               6       /* S_DMA_5 */
+#define OMAP242X_DMA_VLYNQ_TX          7       /* S_DMA_6 */
+#define OMAP24XX_DMA_EXT_DMAREQ2       7       /* S_DMA_6 */
+#define OMAP24XX_DMA_CWT               8       /* S_DMA_7 */
+#define OMAP24XX_DMA_AES_TX            9       /* S_DMA_8 */
+#define OMAP24XX_DMA_AES_RX            10      /* S_DMA_9 */
+#define OMAP24XX_DMA_DES_TX            11      /* S_DMA_10 */
+#define OMAP24XX_DMA_DES_RX            12      /* S_DMA_11 */
+#define OMAP24XX_DMA_SHA1MD5_RX                13      /* S_DMA_12 */
+#define OMAP34XX_DMA_SHA2MD5_RX                13      /* S_DMA_12 */
+#define OMAP242X_DMA_EXT_DMAREQ2       14      /* S_DMA_13 */
+#define OMAP242X_DMA_EXT_DMAREQ3       15      /* S_DMA_14 */
+#define OMAP242X_DMA_EXT_DMAREQ4       16      /* S_DMA_15 */
+#define OMAP242X_DMA_EAC_AC_RD         17      /* S_DMA_16 */
+#define OMAP242X_DMA_EAC_AC_WR         18      /* S_DMA_17 */
+#define OMAP242X_DMA_EAC_MD_UL_RD      19      /* S_DMA_18 */
+#define OMAP242X_DMA_EAC_MD_UL_WR      20      /* S_DMA_19 */
+#define OMAP242X_DMA_EAC_MD_DL_RD      21      /* S_DMA_20 */
+#define OMAP242X_DMA_EAC_MD_DL_WR      22      /* S_DMA_21 */
+#define OMAP242X_DMA_EAC_BT_UL_RD      23      /* S_DMA_22 */
+#define OMAP242X_DMA_EAC_BT_UL_WR      24      /* S_DMA_23 */
+#define OMAP242X_DMA_EAC_BT_DL_RD      25      /* S_DMA_24 */
+#define OMAP242X_DMA_EAC_BT_DL_WR      26      /* S_DMA_25 */
+#define OMAP243X_DMA_EXT_DMAREQ3       14      /* S_DMA_13 */
+#define OMAP24XX_DMA_SPI3_TX0          15      /* S_DMA_14 */
+#define OMAP24XX_DMA_SPI3_RX0          16      /* S_DMA_15 */
+#define OMAP24XX_DMA_MCBSP3_TX         17      /* S_DMA_16 */
+#define OMAP24XX_DMA_MCBSP3_RX         18      /* S_DMA_17 */
+#define OMAP24XX_DMA_MCBSP4_TX         19      /* S_DMA_18 */
+#define OMAP24XX_DMA_MCBSP4_RX         20      /* S_DMA_19 */
+#define OMAP24XX_DMA_MCBSP5_TX         21      /* S_DMA_20 */
+#define OMAP24XX_DMA_MCBSP5_RX         22      /* S_DMA_21 */
+#define OMAP24XX_DMA_SPI3_TX1          23      /* S_DMA_22 */
+#define OMAP24XX_DMA_SPI3_RX1          24      /* S_DMA_23 */
+#define OMAP243X_DMA_EXT_DMAREQ4       25      /* S_DMA_24 */
+#define OMAP243X_DMA_EXT_DMAREQ5       26      /* S_DMA_25 */
+#define OMAP34XX_DMA_I2C3_TX           25      /* S_DMA_24 */
+#define OMAP34XX_DMA_I2C3_RX           26      /* S_DMA_25 */
+#define OMAP24XX_DMA_I2C1_TX           27      /* S_DMA_26 */
+#define OMAP24XX_DMA_I2C1_RX           28      /* S_DMA_27 */
+#define OMAP24XX_DMA_I2C2_TX           29      /* S_DMA_28 */
+#define OMAP24XX_DMA_I2C2_RX           30      /* S_DMA_29 */
+#define OMAP24XX_DMA_MCBSP1_TX         31      /* S_DMA_30 */
+#define OMAP24XX_DMA_MCBSP1_RX         32      /* S_DMA_31 */
+#define OMAP24XX_DMA_MCBSP2_TX         33      /* S_DMA_32 */
+#define OMAP24XX_DMA_MCBSP2_RX         34      /* S_DMA_33 */
+#define OMAP24XX_DMA_SPI1_TX0          35      /* S_DMA_34 */
+#define OMAP24XX_DMA_SPI1_RX0          36      /* S_DMA_35 */
+#define OMAP24XX_DMA_SPI1_TX1          37      /* S_DMA_36 */
+#define OMAP24XX_DMA_SPI1_RX1          38      /* S_DMA_37 */
+#define OMAP24XX_DMA_SPI1_TX2          39      /* S_DMA_38 */
+#define OMAP24XX_DMA_SPI1_RX2          40      /* S_DMA_39 */
+#define OMAP24XX_DMA_SPI1_TX3          41      /* S_DMA_40 */
+#define OMAP24XX_DMA_SPI1_RX3          42      /* S_DMA_41 */
+#define OMAP24XX_DMA_SPI2_TX0          43      /* S_DMA_42 */
+#define OMAP24XX_DMA_SPI2_RX0          44      /* S_DMA_43 */
+#define OMAP24XX_DMA_SPI2_TX1          45      /* S_DMA_44 */
+#define OMAP24XX_DMA_SPI2_RX1          46      /* S_DMA_45 */
+#define OMAP24XX_DMA_MMC2_TX           47      /* S_DMA_46 */
+#define OMAP24XX_DMA_MMC2_RX           48      /* S_DMA_47 */
+#define OMAP24XX_DMA_UART1_TX          49      /* S_DMA_48 */
+#define OMAP24XX_DMA_UART1_RX          50      /* S_DMA_49 */
+#define OMAP24XX_DMA_UART2_TX          51      /* S_DMA_50 */
+#define OMAP24XX_DMA_UART2_RX          52      /* S_DMA_51 */
+#define OMAP24XX_DMA_UART3_TX          53      /* S_DMA_52 */
+#define OMAP24XX_DMA_UART3_RX          54      /* S_DMA_53 */
+#define OMAP24XX_DMA_USB_W2FC_TX0      55      /* S_DMA_54 */
+#define OMAP24XX_DMA_USB_W2FC_RX0      56      /* S_DMA_55 */
+#define OMAP24XX_DMA_USB_W2FC_TX1      57      /* S_DMA_56 */
+#define OMAP24XX_DMA_USB_W2FC_RX1      58      /* S_DMA_57 */
+#define OMAP24XX_DMA_USB_W2FC_TX2      59      /* S_DMA_58 */
+#define OMAP24XX_DMA_USB_W2FC_RX2      60      /* S_DMA_59 */
+#define OMAP24XX_DMA_MMC1_TX           61      /* S_DMA_60 */
+#define OMAP24XX_DMA_MMC1_RX           62      /* S_DMA_61 */
+#define OMAP24XX_DMA_MS                        63      /* S_DMA_62 */
+#define OMAP242X_DMA_EXT_DMAREQ5       64      /* S_DMA_63 */
+#define OMAP243X_DMA_EXT_DMAREQ6       64      /* S_DMA_63 */
+#define OMAP34XX_DMA_EXT_DMAREQ3       64      /* S_DMA_63 */
+#define OMAP34XX_DMA_AES2_TX           65      /* S_DMA_64 */
+#define OMAP34XX_DMA_AES2_RX           66      /* S_DMA_65 */
+#define OMAP34XX_DMA_DES2_TX           67      /* S_DMA_66 */
+#define OMAP34XX_DMA_DES2_RX           68      /* S_DMA_67 */
+#define OMAP34XX_DMA_SHA1MD5_RX                69      /* S_DMA_68 */
+#define OMAP34XX_DMA_SPI4_TX0          70      /* S_DMA_69 */
+#define OMAP34XX_DMA_SPI4_RX0          71      /* S_DMA_70 */
+#define OMAP34XX_DSS_DMA0              72      /* S_DMA_71 */
+#define OMAP34XX_DSS_DMA1              73      /* S_DMA_72 */
+#define OMAP34XX_DSS_DMA2              74      /* S_DMA_73 */
+#define OMAP34XX_DSS_DMA3              75      /* S_DMA_74 */
+#define OMAP34XX_DMA_MMC3_TX           77      /* S_DMA_76 */
+#define OMAP34XX_DMA_MMC3_RX           78      /* S_DMA_77 */
+#define OMAP34XX_DMA_USIM_TX           79      /* S_DMA_78 */
+#define OMAP34XX_DMA_USIM_RX           80      /* S_DMA_79 */
+
+#define OMAP36XX_DMA_UART4_TX          81      /* S_DMA_80 */
+#define OMAP36XX_DMA_UART4_RX          82      /* S_DMA_81 */
+
+/* Only for AM35xx */
+#define AM35XX_DMA_UART4_TX            54
+#define AM35XX_DMA_UART4_RX            55
+
+#endif /* __OMAP2PLUS_DMA_CHANNEL_H */
index 814e1808e1586c64e51a8b5ec07be860c2043940..eacf51f2bc27ba766f05571e34ba14da2ce1fb75 100644 (file)
@@ -28,8 +28,6 @@
 #include <linux/bitops.h>
 #include <linux/clkdev.h>
 
-#include <plat/clock.h>
-
 #include "soc.h"
 #include "clock.h"
 #include "cm2xxx_3xxx.h"
index 09d0ccccb86196650f2ff220b1134320f7c3fb8a..5854da168a9c4e74602893077d68a29c36c56ab5 100644 (file)
@@ -15,8 +15,6 @@
 #include <linux/io.h>
 #include <linux/bitops.h>
 
-#include <plat/clock.h>
-
 #include "soc.h"
 #include "clock.h"
 #include "clock44xx.h"
index 72e0f01b715cb221fd18df7587fdd73ce0304551..6282cc82661355afe27abdeb114f92ba6895b747 100644 (file)
@@ -24,8 +24,8 @@
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 
-#include <plat/omap_device.h>
-#include <plat/omap_hwmod.h>
+#include "omap_device.h"
+#include "omap_hwmod.h"
 
 #if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE)
 
index 98388109f22afd91363428c7410dfb5687c79dc5..b155500e84a8e12dc5eeb6b6d3844d7b2fe6b122 100644 (file)
@@ -27,7 +27,7 @@
 #include "cm2xxx_3xxx.h"
 #include "prm2xxx_3xxx.h"
 #ifdef CONFIG_BRIDGE_DVFS
-#include <plat/omap-pm.h>
+#include "omap-pm.h"
 #endif
 
 #include <linux/platform_data/dsp-omap.h>
index d1058f16fb40bbf85bbcdb17331a91523fadcf5b..399acabc3d0b96006641e30593fb4d586ad00737 100644 (file)
@@ -23,9 +23,9 @@
 #include <linux/of.h>
 #include <linux/platform_data/gpio-omap.h>
 
-#include <plat/omap_hwmod.h>
-#include <plat/omap_device.h>
-#include <plat/omap-pm.h>
+#include "omap_hwmod.h"
+#include "omap_device.h"
+#include "omap-pm.h"
 
 #include "powerdomain.h"
 
index 4acf497faeb3c14aeb2cdbb81f36f5e6cd45ac69..8607735b3ab3c96b8a6fecf25066843a47aaee57 100644 (file)
 
 #include <asm/mach/flash.h>
 
-#include <plat/gpmc.h>
-
+#include "gpmc.h"
 #include "soc.h"
+#include "gpmc-nand.h"
+
+/* minimum size for IO mapping */
+#define        NAND_IO_SIZE    4
 
 static struct resource gpmc_nand_resource[] = {
        {
@@ -40,41 +43,36 @@ static struct platform_device gpmc_nand_device = {
        .resource       = gpmc_nand_resource,
 };
 
-static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data)
+static int omap2_nand_gpmc_retime(
+                               struct omap_nand_platform_data *gpmc_nand_data,
+                               struct gpmc_timings *gpmc_t)
 {
        struct gpmc_timings t;
        int err;
 
-       if (!gpmc_nand_data->gpmc_t)
-               return 0;
-
        memset(&t, 0, sizeof(t));
-       t.sync_clk = gpmc_nand_data->gpmc_t->sync_clk;
-       t.cs_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_on);
-       t.adv_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->adv_on);
+       t.sync_clk = gpmc_t->sync_clk;
+       t.cs_on = gpmc_round_ns_to_ticks(gpmc_t->cs_on);
+       t.adv_on = gpmc_round_ns_to_ticks(gpmc_t->adv_on);
 
        /* Read */
-       t.adv_rd_off = gpmc_round_ns_to_ticks(
-                               gpmc_nand_data->gpmc_t->adv_rd_off);
+       t.adv_rd_off = gpmc_round_ns_to_ticks(gpmc_t->adv_rd_off);
        t.oe_on  = t.adv_on;
-       t.access = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->access);
-       t.oe_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->oe_off);
-       t.cs_rd_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_rd_off);
-       t.rd_cycle  = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->rd_cycle);
+       t.access = gpmc_round_ns_to_ticks(gpmc_t->access);
+       t.oe_off = gpmc_round_ns_to_ticks(gpmc_t->oe_off);
+       t.cs_rd_off = gpmc_round_ns_to_ticks(gpmc_t->cs_rd_off);
+       t.rd_cycle  = gpmc_round_ns_to_ticks(gpmc_t->rd_cycle);
 
        /* Write */
-       t.adv_wr_off = gpmc_round_ns_to_ticks(
-                               gpmc_nand_data->gpmc_t->adv_wr_off);
+       t.adv_wr_off = gpmc_round_ns_to_ticks(gpmc_t->adv_wr_off);
        t.we_on  = t.oe_on;
        if (cpu_is_omap34xx()) {
-           t.wr_data_mux_bus = gpmc_round_ns_to_ticks(
-                               gpmc_nand_data->gpmc_t->wr_data_mux_bus);
-           t.wr_access = gpmc_round_ns_to_ticks(
-                               gpmc_nand_data->gpmc_t->wr_access);
+           t.wr_data_mux_bus = gpmc_round_ns_to_ticks(gpmc_t->wr_data_mux_bus);
+           t.wr_access = gpmc_round_ns_to_ticks(gpmc_t->wr_access);
        }
-       t.we_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->we_off);
-       t.cs_wr_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_wr_off);
-       t.wr_cycle  = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle);
+       t.we_off = gpmc_round_ns_to_ticks(gpmc_t->we_off);
+       t.cs_wr_off = gpmc_round_ns_to_ticks(gpmc_t->cs_wr_off);
+       t.wr_cycle  = gpmc_round_ns_to_ticks(gpmc_t->wr_cycle);
 
        /* Configure GPMC */
        if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
@@ -91,7 +89,29 @@ static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data
        return 0;
 }
 
-int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data)
+static bool __init gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt)
+{
+       /* support only OMAP3 class */
+       if (!cpu_is_omap34xx()) {
+               pr_err("BCH ecc is not supported on this CPU\n");
+               return 0;
+       }
+
+       /*
+        * For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1.
+        * Other chips may be added if confirmed to work.
+        */
+       if ((ecc_opt == OMAP_ECC_BCH4_CODE_HW) &&
+           (!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0))) {
+               pr_err("BCH 4-bit mode is not supported on this CPU\n");
+               return 0;
+       }
+
+       return 1;
+}
+
+int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
+                         struct gpmc_timings *gpmc_t)
 {
        int err = 0;
        struct device *dev = &gpmc_nand_device.dev;
@@ -112,11 +132,13 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data)
                                gpmc_get_client_irq(GPMC_IRQ_FIFOEVENTENABLE);
        gpmc_nand_resource[2].start =
                                gpmc_get_client_irq(GPMC_IRQ_COUNT_EVENT);
-        /* Set timings in GPMC */
-       err = omap2_nand_gpmc_retime(gpmc_nand_data);
-       if (err < 0) {
-               dev_err(dev, "Unable to set gpmc timings: %d\n", err);
-               return err;
+
+       if (gpmc_t) {
+               err = omap2_nand_gpmc_retime(gpmc_nand_data, gpmc_t);
+               if (err < 0) {
+                       dev_err(dev, "Unable to set gpmc timings: %d\n", err);
+                       return err;
+               }
        }
 
        /* Enable RD PIN Monitoring Reg */
@@ -126,6 +148,9 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data)
 
        gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs);
 
+       if (!gpmc_hwecc_bch_capable(gpmc_nand_data->ecc_opt))
+               return -EINVAL;
+
        err = platform_device_register(&gpmc_nand_device);
        if (err < 0) {
                dev_err(dev, "Unable to register NAND device\n");
diff --git a/arch/arm/mach-omap2/gpmc-nand.h b/arch/arm/mach-omap2/gpmc-nand.h
new file mode 100644 (file)
index 0000000..d59e128
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ *  arch/arm/mach-omap2/gpmc-nand.h
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#ifndef        __OMAP2_GPMC_NAND_H
+#define        __OMAP2_GPMC_NAND_H
+
+#include "gpmc.h"
+#include <linux/platform_data/mtd-nand-omap2.h>
+
+#if IS_ENABLED(CONFIG_MTD_NAND_OMAP2)
+extern int gpmc_nand_init(struct omap_nand_platform_data *d,
+                         struct gpmc_timings *gpmc_t);
+#else
+static inline int gpmc_nand_init(struct omap_nand_platform_data *d,
+                                struct gpmc_timings *gpmc_t)
+{
+       return 0;
+}
+#endif
+
+#endif
index 916716e1da3bf6644799d7969a3d9924b1ed94e9..d102183ed9a5b21289b61678b9f4b49746d68c31 100644 (file)
 #include <linux/mtd/onenand_regs.h>
 #include <linux/io.h>
 #include <linux/platform_data/mtd-onenand-omap2.h>
+#include <linux/err.h>
 
 #include <asm/mach/flash.h>
 
-#include <plat/gpmc.h>
-
+#include "gpmc.h"
 #include "soc.h"
+#include "gpmc-onenand.h"
 
 #define        ONENAND_IO_SIZE SZ_128K
 
+#define        ONENAND_FLAG_SYNCREAD   (1 << 0)
+#define        ONENAND_FLAG_SYNCWRITE  (1 << 1)
+#define        ONENAND_FLAG_HF         (1 << 2)
+#define        ONENAND_FLAG_VHF        (1 << 3)
+
+static unsigned onenand_flags;
+static unsigned latency;
+static int fclk_offset;
+
 static struct omap_onenand_platform_data *gpmc_onenand_data;
 
 static struct resource gpmc_onenand_resource = {
@@ -38,11 +48,9 @@ static struct platform_device gpmc_onenand_device = {
        .resource       = &gpmc_onenand_resource,
 };
 
-static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
+static struct gpmc_timings omap2_onenand_calc_async_timings(void)
 {
        struct gpmc_timings t;
-       u32 reg;
-       int err;
 
        const int t_cer = 15;
        const int t_avdp = 12;
@@ -55,11 +63,6 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
        const int t_wpl = 40;
        const int t_wph = 30;
 
-       /* Ensure sync read and sync write are disabled */
-       reg = readw(onenand_base + ONENAND_REG_SYS_CFG1);
-       reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE;
-       writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
-
        memset(&t, 0, sizeof(t));
        t.sync_clk = 0;
        t.cs_on = 0;
@@ -86,25 +89,30 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
        t.cs_wr_off = t.we_off + gpmc_round_ns_to_ticks(t_wph);
        t.wr_cycle  = t.cs_wr_off + gpmc_round_ns_to_ticks(t_cez);
 
+       return t;
+}
+
+static int gpmc_set_async_mode(int cs, struct gpmc_timings *t)
+{
        /* Configure GPMC for asynchronous read */
        gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1,
                          GPMC_CONFIG1_DEVICESIZE_16 |
                          GPMC_CONFIG1_MUXADDDATA);
 
-       err = gpmc_cs_set_timings(cs, &t);
-       if (err)
-               return err;
+       return gpmc_cs_set_timings(cs, t);
+}
+
+static void omap2_onenand_set_async_mode(void __iomem *onenand_base)
+{
+       u32 reg;
 
        /* Ensure sync read and sync write are disabled */
        reg = readw(onenand_base + ONENAND_REG_SYS_CFG1);
        reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE;
        writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
-
-       return 0;
 }
 
-static void set_onenand_cfg(void __iomem *onenand_base, int latency,
-                               int sync_read, int sync_write, int hf, int vhf)
+static void set_onenand_cfg(void __iomem *onenand_base)
 {
        u32 reg;
 
@@ -112,19 +120,19 @@ static void set_onenand_cfg(void __iomem *onenand_base, int latency,
        reg &= ~((0x7 << ONENAND_SYS_CFG1_BRL_SHIFT) | (0x7 << 9));
        reg |=  (latency << ONENAND_SYS_CFG1_BRL_SHIFT) |
                ONENAND_SYS_CFG1_BL_16;
-       if (sync_read)
+       if (onenand_flags & ONENAND_FLAG_SYNCREAD)
                reg |= ONENAND_SYS_CFG1_SYNC_READ;
        else
                reg &= ~ONENAND_SYS_CFG1_SYNC_READ;
-       if (sync_write)
+       if (onenand_flags & ONENAND_FLAG_SYNCWRITE)
                reg |= ONENAND_SYS_CFG1_SYNC_WRITE;
        else
                reg &= ~ONENAND_SYS_CFG1_SYNC_WRITE;
-       if (hf)
+       if (onenand_flags & ONENAND_FLAG_HF)
                reg |= ONENAND_SYS_CFG1_HF;
        else
                reg &= ~ONENAND_SYS_CFG1_HF;
-       if (vhf)
+       if (onenand_flags & ONENAND_FLAG_VHF)
                reg |= ONENAND_SYS_CFG1_VHF;
        else
                reg &= ~ONENAND_SYS_CFG1_VHF;
@@ -132,21 +140,10 @@ static void set_onenand_cfg(void __iomem *onenand_base, int latency,
 }
 
 static int omap2_onenand_get_freq(struct omap_onenand_platform_data *cfg,
-                                 void __iomem *onenand_base, bool *clk_dep)
+                                 void __iomem *onenand_base)
 {
        u16 ver = readw(onenand_base + ONENAND_REG_VERSION_ID);
-       int freq = 0;
-
-       if (cfg->get_freq) {
-               struct onenand_freq_info fi;
-
-               fi.maf_id = readw(onenand_base + ONENAND_REG_MANUFACTURER_ID);
-               fi.dev_id = readw(onenand_base + ONENAND_REG_DEVICE_ID);
-               fi.ver_id = ver;
-               freq = cfg->get_freq(&fi, clk_dep);
-               if (freq)
-                       return freq;
-       }
+       int freq;
 
        switch ((ver >> 4) & 0xf) {
        case 0:
@@ -172,9 +169,9 @@ static int omap2_onenand_get_freq(struct omap_onenand_platform_data *cfg,
        return freq;
 }
 
-static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
-                                       void __iomem *onenand_base,
-                                       int *freq_ptr)
+static struct gpmc_timings
+omap2_onenand_calc_sync_timings(struct omap_onenand_platform_data *cfg,
+                               int freq)
 {
        struct gpmc_timings t;
        const int t_cer  = 15;
@@ -184,29 +181,15 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
        const int t_wpl  = 40;
        const int t_wph  = 30;
        int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo;
-       int div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency;
-       int first_time = 0, hf = 0, vhf = 0, sync_read = 0, sync_write = 0;
-       int err, ticks_cez;
-       int cs = cfg->cs, freq = *freq_ptr;
        u32 reg;
-       bool clk_dep = false;
+       int div, fclk_offset_ns, gpmc_clk_ns;
+       int ticks_cez;
+       int cs = cfg->cs;
 
-       if (cfg->flags & ONENAND_SYNC_READ) {
-               sync_read = 1;
-       } else if (cfg->flags & ONENAND_SYNC_READWRITE) {
-               sync_read = 1;
-               sync_write = 1;
-       } else
-               return omap2_onenand_set_async_mode(cs, onenand_base);
-
-       if (!freq) {
-               /* Very first call freq is not known */
-               err = omap2_onenand_set_async_mode(cs, onenand_base);
-               if (err)
-                       return err;
-               freq = omap2_onenand_get_freq(cfg, onenand_base, &clk_dep);
-               first_time = 1;
-       }
+       if (cfg->flags & ONENAND_SYNC_READ)
+               onenand_flags = ONENAND_FLAG_SYNCREAD;
+       else if (cfg->flags & ONENAND_SYNC_READWRITE)
+               onenand_flags = ONENAND_FLAG_SYNCREAD | ONENAND_FLAG_SYNCWRITE;
 
        switch (freq) {
        case 104:
@@ -244,44 +227,31 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
                t_ach   = 9;
                t_aavdh = 7;
                t_rdyo  = 15;
-               sync_write = 0;
+               onenand_flags &= ~ONENAND_FLAG_SYNCWRITE;
                break;
        }
 
-       div = gpmc_cs_calc_divider(cs, min_gpmc_clk_period);
+       div = gpmc_calc_divider(min_gpmc_clk_period);
        gpmc_clk_ns = gpmc_ticks_to_ns(div);
        if (gpmc_clk_ns < 15) /* >66Mhz */
-               hf = 1;
+               onenand_flags |= ONENAND_FLAG_HF;
+       else
+               onenand_flags &= ~ONENAND_FLAG_HF;
        if (gpmc_clk_ns < 12) /* >83Mhz */
-               vhf = 1;
-       if (vhf)
+               onenand_flags |= ONENAND_FLAG_VHF;
+       else
+               onenand_flags &= ~ONENAND_FLAG_VHF;
+       if (onenand_flags & ONENAND_FLAG_VHF)
                latency = 8;
-       else if (hf)
+       else if (onenand_flags & ONENAND_FLAG_HF)
                latency = 6;
        else if (gpmc_clk_ns >= 25) /* 40 MHz*/
                latency = 3;
        else
                latency = 4;
 
-       if (clk_dep) {
-               if (gpmc_clk_ns < 12) { /* >83Mhz */
-                       t_ces   = 3;
-                       t_avds  = 4;
-               } else if (gpmc_clk_ns < 15) { /* >66Mhz */
-                       t_ces   = 5;
-                       t_avds  = 4;
-               } else if (gpmc_clk_ns < 25) { /* >40Mhz */
-                       t_ces   = 6;
-                       t_avds  = 5;
-               } else {
-                       t_ces   = 7;
-                       t_avds  = 7;
-               }
-       }
-
-       if (first_time)
-               set_onenand_cfg(onenand_base, latency,
-                                       sync_read, sync_write, hf, vhf);
+       /* Set synchronous read timings */
+       memset(&t, 0, sizeof(t));
 
        if (div == 1) {
                reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG2);
@@ -307,8 +277,6 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
                gpmc_cs_write_reg(cs, GPMC_CS_CONFIG4, reg);
        }
 
-       /* Set synchronous read timings */
-       memset(&t, 0, sizeof(t));
        t.sync_clk = min_gpmc_clk_period;
        t.cs_on = 0;
        t.adv_on = 0;
@@ -330,7 +298,7 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
                     ticks_cez);
 
        /* Write */
-       if (sync_write) {
+       if (onenand_flags & ONENAND_FLAG_SYNCWRITE) {
                t.adv_wr_off = t.adv_rd_off;
                t.we_on  = 0;
                t.we_off = t.cs_rd_off;
@@ -355,6 +323,14 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
                }
        }
 
+       return t;
+}
+
+static int gpmc_set_sync_mode(int cs, struct gpmc_timings *t)
+{
+       unsigned sync_read = onenand_flags & ONENAND_FLAG_SYNCREAD;
+       unsigned sync_write = onenand_flags & ONENAND_FLAG_SYNCWRITE;
+
        /* Configure GPMC for synchronous read */
        gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1,
                          GPMC_CONFIG1_WRAPBURST_SUPP |
@@ -371,11 +347,45 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
                          GPMC_CONFIG1_DEVICETYPE_NOR |
                          GPMC_CONFIG1_MUXADDDATA);
 
-       err = gpmc_cs_set_timings(cs, &t);
-       if (err)
-               return err;
+       return gpmc_cs_set_timings(cs, t);
+}
+
+static int omap2_onenand_setup_async(void __iomem *onenand_base)
+{
+       struct gpmc_timings t;
+       int ret;
+
+       omap2_onenand_set_async_mode(onenand_base);
 
-       set_onenand_cfg(onenand_base, latency, sync_read, sync_write, hf, vhf);
+       t = omap2_onenand_calc_async_timings();
+
+       ret = gpmc_set_async_mode(gpmc_onenand_data->cs, &t);
+       if (IS_ERR_VALUE(ret))
+               return ret;
+
+       omap2_onenand_set_async_mode(onenand_base);
+
+       return 0;
+}
+
+static int omap2_onenand_setup_sync(void __iomem *onenand_base, int *freq_ptr)
+{
+       int ret, freq = *freq_ptr;
+       struct gpmc_timings t;
+
+       if (!freq) {
+               /* Very first call freq is not known */
+               freq = omap2_onenand_get_freq(gpmc_onenand_data, onenand_base);
+               set_onenand_cfg(onenand_base);
+       }
+
+       t = omap2_onenand_calc_sync_timings(gpmc_onenand_data, freq);
+
+       ret = gpmc_set_sync_mode(gpmc_onenand_data->cs, &t);
+       if (IS_ERR_VALUE(ret))
+               return ret;
+
+       set_onenand_cfg(onenand_base);
 
        *freq_ptr = freq;
 
@@ -385,15 +395,22 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
 static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr)
 {
        struct device *dev = &gpmc_onenand_device.dev;
+       unsigned l = ONENAND_SYNC_READ | ONENAND_SYNC_READWRITE;
+       int ret;
 
-       /* Set sync timings in GPMC */
-       if (omap2_onenand_set_sync_mode(gpmc_onenand_data, onenand_base,
-                       freq_ptr) < 0) {
-               dev_err(dev, "Unable to set synchronous mode\n");
-               return -EINVAL;
+       ret = omap2_onenand_setup_async(onenand_base);
+       if (ret) {
+               dev_err(dev, "unable to set to async mode\n");
+               return ret;
        }
 
-       return 0;
+       if (!(gpmc_onenand_data->flags & l))
+               return 0;
+
+       ret = omap2_onenand_setup_sync(onenand_base, freq_ptr);
+       if (ret)
+               dev_err(dev, "unable to set to sync mode\n");
+       return ret;
 }
 
 void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
@@ -411,6 +428,11 @@ void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
                gpmc_onenand_data->flags |= ONENAND_SYNC_READ;
        }
 
+       if (cpu_is_omap34xx())
+               gpmc_onenand_data->flags |= ONENAND_IN_OMAP34XX;
+       else
+               gpmc_onenand_data->flags &= ~ONENAND_IN_OMAP34XX;
+
        err = gpmc_cs_request(gpmc_onenand_data->cs, ONENAND_IO_SIZE,
                                (unsigned long *)&gpmc_onenand_resource.start);
        if (err < 0) {
diff --git a/arch/arm/mach-omap2/gpmc-onenand.h b/arch/arm/mach-omap2/gpmc-onenand.h
new file mode 100644 (file)
index 0000000..216f23a
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ *  arch/arm/mach-omap2/gpmc-onenand.h
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#ifndef        __OMAP2_GPMC_ONENAND_H
+#define        __OMAP2_GPMC_ONENAND_H
+
+#include <linux/platform_data/mtd-onenand-omap2.h>
+
+#if IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2)
+extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
+#else
+#define board_onenand_data     NULL
+static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
+{
+}
+#endif
+
+#endif
index 5654753103744dfa02f8fab8ddfd1ff037806c7a..6eed907d594cc700134ad0e7716df079d1b793c8 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/io.h>
 #include <linux/smc91x.h>
 
-#include <plat/gpmc.h>
+#include "gpmc.h"
 #include "gpmc-smc91x.h"
 
 #include "soc.h"
index 249a0b440cd6f5396a38bea78fbd9fdc28061c77..ef990118d32b2f4205c25c58aec555465096aa39 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/io.h>
 #include <linux/smsc911x.h>
 
-#include <plat/gpmc.h>
+#include "gpmc.h"
 #include "gpmc-smsc911x.h"
 
 static struct resource gpmc_smsc911x_resources[] = {
index 5ac5cf30406a81aef651ae361bab6351903d4c3e..bf6117c32f4bc0302522d0ea6f54b83d7c171ea3 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
 
-#include <asm/mach-types.h>
-#include <plat/gpmc.h>
+#include <linux/platform_data/mtd-nand-omap2.h>
 
-#include <plat/cpu.h>
-#include <plat/gpmc.h>
-#include <plat/sdrc.h>
-#include <plat/omap_device.h>
+#include <asm/mach-types.h>
 
 #include "soc.h"
 #include "common.h"
+#include "omap_device.h"
+#include "gpmc.h"
 
 #define        DEVICE_NAME             "omap-gpmc"
 
@@ -59,6 +57,9 @@
 #define GPMC_ECC_SIZE_CONFIG   0x1fc
 #define GPMC_ECC1_RESULT        0x200
 #define GPMC_ECC_BCH_RESULT_0   0x240   /* not available on OMAP2 */
+#define        GPMC_ECC_BCH_RESULT_1   0x244   /* not available on OMAP2 */
+#define        GPMC_ECC_BCH_RESULT_2   0x248   /* not available on OMAP2 */
+#define        GPMC_ECC_BCH_RESULT_3   0x24c   /* not available on OMAP2 */
 
 /* GPMC ECC control settings */
 #define GPMC_ECC_CTRL_ECCCLEAR         0x100
@@ -75,6 +76,7 @@
 
 #define GPMC_CS0_OFFSET                0x60
 #define GPMC_CS_SIZE           0x30
+#define        GPMC_BCH_SIZE           0x10
 
 #define GPMC_MEM_START         0x00000000
 #define GPMC_MEM_END           0x3FFFFFFF
@@ -137,7 +139,6 @@ static struct resource      gpmc_mem_root;
 static struct resource gpmc_cs_mem[GPMC_CS_NUM];
 static DEFINE_SPINLOCK(gpmc_mem_lock);
 static unsigned int gpmc_cs_map;       /* flag for cs which are initialized */
-static int gpmc_ecc_used = -EINVAL;    /* cs using ecc engine */
 static struct device *gpmc_dev;
 static int gpmc_irq;
 static resource_size_t phys_base, mem_size;
@@ -158,22 +159,6 @@ static u32 gpmc_read_reg(int idx)
        return __raw_readl(gpmc_base + idx);
 }
 
-static void gpmc_cs_write_byte(int cs, int idx, u8 val)
-{
-       void __iomem *reg_addr;
-
-       reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
-       __raw_writeb(val, reg_addr);
-}
-
-static u8 gpmc_cs_read_byte(int cs, int idx)
-{
-       void __iomem *reg_addr;
-
-       reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
-       return __raw_readb(reg_addr);
-}
-
 void gpmc_cs_write_reg(int cs, int idx, u32 val)
 {
        void __iomem *reg_addr;
@@ -288,7 +273,7 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
                return -1
 #endif
 
-int gpmc_cs_calc_divider(int cs, unsigned int sync_clk)
+int gpmc_calc_divider(unsigned int sync_clk)
 {
        int div;
        u32 l;
@@ -308,7 +293,7 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t)
        int div;
        u32 l;
 
-       div = gpmc_cs_calc_divider(cs, t->sync_clk);
+       div = gpmc_calc_divider(t->sync_clk);
        if (div < 0)
                return div;
 
@@ -508,44 +493,6 @@ void gpmc_cs_free(int cs)
 }
 EXPORT_SYMBOL(gpmc_cs_free);
 
-/**
- * gpmc_read_status - read access request to get the different gpmc status
- * @cmd: command type
- * @return status
- */
-int gpmc_read_status(int cmd)
-{
-       int     status = -EINVAL;
-       u32     regval = 0;
-
-       switch (cmd) {
-       case GPMC_GET_IRQ_STATUS:
-               status = gpmc_read_reg(GPMC_IRQSTATUS);
-               break;
-
-       case GPMC_PREFETCH_FIFO_CNT:
-               regval = gpmc_read_reg(GPMC_PREFETCH_STATUS);
-               status = GPMC_PREFETCH_STATUS_FIFO_CNT(regval);
-               break;
-
-       case GPMC_PREFETCH_COUNT:
-               regval = gpmc_read_reg(GPMC_PREFETCH_STATUS);
-               status = GPMC_PREFETCH_STATUS_COUNT(regval);
-               break;
-
-       case GPMC_STATUS_BUFFER:
-               regval = gpmc_read_reg(GPMC_STATUS);
-               /* 1 : buffer is available to write */
-               status = regval & GPMC_STATUS_BUFF_EMPTY;
-               break;
-
-       default:
-               printk(KERN_ERR "gpmc_read_status: Not supported\n");
-       }
-       return status;
-}
-EXPORT_SYMBOL(gpmc_read_status);
-
 /**
  * gpmc_cs_configure - write request to configure gpmc
  * @cs: chip select number
@@ -614,121 +561,10 @@ int gpmc_cs_configure(int cs, int cmd, int wval)
 }
 EXPORT_SYMBOL(gpmc_cs_configure);
 
-/**
- * gpmc_nand_read - nand specific read access request
- * @cs: chip select number
- * @cmd: command type
- */
-int gpmc_nand_read(int cs, int cmd)
-{
-       int rval = -EINVAL;
-
-       switch (cmd) {
-       case GPMC_NAND_DATA:
-               rval = gpmc_cs_read_byte(cs, GPMC_CS_NAND_DATA);
-               break;
-
-       default:
-               printk(KERN_ERR "gpmc_read_nand_ctrl: Not supported\n");
-       }
-       return rval;
-}
-EXPORT_SYMBOL(gpmc_nand_read);
-
-/**
- * gpmc_nand_write - nand specific write request
- * @cs: chip select number
- * @cmd: command type
- * @wval: value to write
- */
-int gpmc_nand_write(int cs, int cmd, int wval)
-{
-       int err = 0;
-
-       switch (cmd) {
-       case GPMC_NAND_COMMAND:
-               gpmc_cs_write_byte(cs, GPMC_CS_NAND_COMMAND, wval);
-               break;
-
-       case GPMC_NAND_ADDRESS:
-               gpmc_cs_write_byte(cs, GPMC_CS_NAND_ADDRESS, wval);
-               break;
-
-       case GPMC_NAND_DATA:
-               gpmc_cs_write_byte(cs, GPMC_CS_NAND_DATA, wval);
-
-       default:
-               printk(KERN_ERR "gpmc_write_nand_ctrl: Not supported\n");
-               err = -EINVAL;
-       }
-       return err;
-}
-EXPORT_SYMBOL(gpmc_nand_write);
-
-
-
-/**
- * gpmc_prefetch_enable - configures and starts prefetch transfer
- * @cs: cs (chip select) number
- * @fifo_th: fifo threshold to be used for read/ write
- * @dma_mode: dma mode enable (1) or disable (0)
- * @u32_count: number of bytes to be transferred
- * @is_write: prefetch read(0) or write post(1) mode
- */
-int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode,
-                               unsigned int u32_count, int is_write)
-{
-
-       if (fifo_th > PREFETCH_FIFOTHRESHOLD_MAX) {
-               pr_err("gpmc: fifo threshold is not supported\n");
-               return -1;
-       } else if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) {
-               /* Set the amount of bytes to be prefetched */
-               gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count);
-
-               /* Set dma/mpu mode, the prefetch read / post write and
-                * enable the engine. Set which cs is has requested for.
-                */
-               gpmc_write_reg(GPMC_PREFETCH_CONFIG1, ((cs << CS_NUM_SHIFT) |
-                                       PREFETCH_FIFOTHRESHOLD(fifo_th) |
-                                       ENABLE_PREFETCH |
-                                       (dma_mode << DMA_MPU_MODE) |
-                                       (0x1 & is_write)));
-
-               /*  Start the prefetch engine */
-               gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x1);
-       } else {
-               return -EBUSY;
-       }
-
-       return 0;
-}
-EXPORT_SYMBOL(gpmc_prefetch_enable);
-
-/**
- * gpmc_prefetch_reset - disables and stops the prefetch engine
- */
-int gpmc_prefetch_reset(int cs)
-{
-       u32 config1;
-
-       /* check if the same module/cs is trying to reset */
-       config1 = gpmc_read_reg(GPMC_PREFETCH_CONFIG1);
-       if (((config1 >> CS_NUM_SHIFT) & 0x7) != cs)
-               return -EINVAL;
-
-       /* Stop the PFPW engine */
-       gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x0);
-
-       /* Reset/disable the PFPW engine */
-       gpmc_write_reg(GPMC_PREFETCH_CONFIG1, 0x0);
-
-       return 0;
-}
-EXPORT_SYMBOL(gpmc_prefetch_reset);
-
 void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs)
 {
+       int i;
+
        reg->gpmc_status = gpmc_base + GPMC_STATUS;
        reg->gpmc_nand_command = gpmc_base + GPMC_CS0_OFFSET +
                                GPMC_CS_NAND_COMMAND + GPMC_CS_SIZE * cs;
@@ -744,7 +580,17 @@ void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs)
        reg->gpmc_ecc_control = gpmc_base + GPMC_ECC_CONTROL;
        reg->gpmc_ecc_size_config = gpmc_base + GPMC_ECC_SIZE_CONFIG;
        reg->gpmc_ecc1_result = gpmc_base + GPMC_ECC1_RESULT;
-       reg->gpmc_bch_result0 = gpmc_base + GPMC_ECC_BCH_RESULT_0;
+
+       for (i = 0; i < GPMC_BCH_NUM_REMAINDER; i++) {
+               reg->gpmc_bch_result0[i] = gpmc_base + GPMC_ECC_BCH_RESULT_0 +
+                                          GPMC_BCH_SIZE * i;
+               reg->gpmc_bch_result1[i] = gpmc_base + GPMC_ECC_BCH_RESULT_1 +
+                                          GPMC_BCH_SIZE * i;
+               reg->gpmc_bch_result2[i] = gpmc_base + GPMC_ECC_BCH_RESULT_2 +
+                                          GPMC_BCH_SIZE * i;
+               reg->gpmc_bch_result3[i] = gpmc_base + GPMC_ECC_BCH_RESULT_3 +
+                                          GPMC_BCH_SIZE * i;
+       }
 }
 
 int gpmc_get_client_irq(unsigned irq_config)
@@ -868,9 +714,9 @@ static void __devexit gpmc_mem_exit(void)
 
 }
 
-static void __devinit gpmc_mem_init(void)
+static int __devinit gpmc_mem_init(void)
 {
-       int cs;
+       int cs, rc;
        unsigned long boot_rom_space = 0;
 
        /* never allocate the first page, to facilitate bug detection;
@@ -890,13 +736,21 @@ static void __devinit gpmc_mem_init(void)
                if (!gpmc_cs_mem_enabled(cs))
                        continue;
                gpmc_cs_get_memconf(cs, &base, &size);
-               if (gpmc_cs_insert_mem(cs, base, size) < 0)
-                       BUG();
+               rc = gpmc_cs_insert_mem(cs, base, size);
+               if (IS_ERR_VALUE(rc)) {
+                       while (--cs >= 0)
+                               if (gpmc_cs_mem_enabled(cs))
+                                       gpmc_cs_delete_mem(cs);
+                       return rc;
+               }
        }
+
+       return 0;
 }
 
 static __devinit int gpmc_probe(struct platform_device *pdev)
 {
+       int rc;
        u32 l;
        struct resource *res;
 
@@ -936,7 +790,13 @@ static __devinit int gpmc_probe(struct platform_device *pdev)
        dev_info(gpmc_dev, "GPMC revision %d.%d\n", GPMC_REVISION_MAJOR(l),
                 GPMC_REVISION_MINOR(l));
 
-       gpmc_mem_init();
+       rc = gpmc_mem_init();
+       if (IS_ERR_VALUE(rc)) {
+               clk_disable_unprepare(gpmc_l3_clk);
+               clk_put(gpmc_l3_clk);
+               dev_err(gpmc_dev, "failed to reserve memory\n");
+               return rc;
+       }
 
        if (IS_ERR_VALUE(gpmc_setup_irq()))
                dev_warn(gpmc_dev, "gpmc_setup_irq failed\n");
@@ -1079,267 +939,3 @@ void omap3_gpmc_restore_context(void)
        }
 }
 #endif /* CONFIG_ARCH_OMAP3 */
-
-/**
- * gpmc_enable_hwecc - enable hardware ecc functionality
- * @cs: chip select number
- * @mode: read/write mode
- * @dev_width: device bus width(1 for x16, 0 for x8)
- * @ecc_size: bytes for which ECC will be generated
- */
-int gpmc_enable_hwecc(int cs, int mode, int dev_width, int ecc_size)
-{
-       unsigned int val;
-
-       /* check if ecc module is in used */
-       if (gpmc_ecc_used != -EINVAL)
-               return -EINVAL;
-
-       gpmc_ecc_used = cs;
-
-       /* clear ecc and enable bits */
-       gpmc_write_reg(GPMC_ECC_CONTROL,
-                       GPMC_ECC_CTRL_ECCCLEAR |
-                       GPMC_ECC_CTRL_ECCREG1);
-
-       /* program ecc and result sizes */
-       val = ((((ecc_size >> 1) - 1) << 22) | (0x0000000F));
-       gpmc_write_reg(GPMC_ECC_SIZE_CONFIG, val);
-
-       switch (mode) {
-       case GPMC_ECC_READ:
-       case GPMC_ECC_WRITE:
-               gpmc_write_reg(GPMC_ECC_CONTROL,
-                               GPMC_ECC_CTRL_ECCCLEAR |
-                               GPMC_ECC_CTRL_ECCREG1);
-               break;
-       case GPMC_ECC_READSYN:
-               gpmc_write_reg(GPMC_ECC_CONTROL,
-                               GPMC_ECC_CTRL_ECCCLEAR |
-                               GPMC_ECC_CTRL_ECCDISABLE);
-               break;
-       default:
-               printk(KERN_INFO "Error: Unrecognized Mode[%d]!\n", mode);
-               break;
-       }
-
-       /* (ECC 16 or 8 bit col) | ( CS  )  | ECC Enable */
-       val = (dev_width << 7) | (cs << 1) | (0x1);
-       gpmc_write_reg(GPMC_ECC_CONFIG, val);
-       return 0;
-}
-EXPORT_SYMBOL_GPL(gpmc_enable_hwecc);
-
-/**
- * gpmc_calculate_ecc - generate non-inverted ecc bytes
- * @cs: chip select number
- * @dat: data pointer over which ecc is computed
- * @ecc_code: ecc code buffer
- *
- * Using non-inverted ECC is considered ugly since writing a blank
- * page (padding) will clear the ECC bytes. This is not a problem as long
- * no one is trying to write data on the seemingly unused page. Reading
- * an erased page will produce an ECC mismatch between generated and read
- * ECC bytes that has to be dealt with separately.
- */
-int gpmc_calculate_ecc(int cs, const u_char *dat, u_char *ecc_code)
-{
-       unsigned int val = 0x0;
-
-       if (gpmc_ecc_used != cs)
-               return -EINVAL;
-
-       /* read ecc result */
-       val = gpmc_read_reg(GPMC_ECC1_RESULT);
-       *ecc_code++ = val;          /* P128e, ..., P1e */
-       *ecc_code++ = val >> 16;    /* P128o, ..., P1o */
-       /* P2048o, P1024o, P512o, P256o, P2048e, P1024e, P512e, P256e */
-       *ecc_code++ = ((val >> 8) & 0x0f) | ((val >> 20) & 0xf0);
-
-       gpmc_ecc_used = -EINVAL;
-       return 0;
-}
-EXPORT_SYMBOL_GPL(gpmc_calculate_ecc);
-
-#ifdef CONFIG_ARCH_OMAP3
-
-/**
- * gpmc_init_hwecc_bch - initialize hardware BCH ecc functionality
- * @cs: chip select number
- * @nsectors: how many 512-byte sectors to process
- * @nerrors: how many errors to correct per sector (4 or 8)
- *
- * This function must be executed before any call to gpmc_enable_hwecc_bch.
- */
-int gpmc_init_hwecc_bch(int cs, int nsectors, int nerrors)
-{
-       /* check if ecc module is in use */
-       if (gpmc_ecc_used != -EINVAL)
-               return -EINVAL;
-
-       /* support only OMAP3 class */
-       if (!cpu_is_omap34xx()) {
-               printk(KERN_ERR "BCH ecc is not supported on this CPU\n");
-               return -EINVAL;
-       }
-
-       /*
-        * For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1.
-        * Other chips may be added if confirmed to work.
-        */
-       if ((nerrors == 4) &&
-           (!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0))) {
-               printk(KERN_ERR "BCH 4-bit mode is not supported on this CPU\n");
-               return -EINVAL;
-       }
-
-       /* sanity check */
-       if (nsectors > 8) {
-               printk(KERN_ERR "BCH cannot process %d sectors (max is 8)\n",
-                      nsectors);
-               return -EINVAL;
-       }
-
-       return 0;
-}
-EXPORT_SYMBOL_GPL(gpmc_init_hwecc_bch);
-
-/**
- * gpmc_enable_hwecc_bch - enable hardware BCH ecc functionality
- * @cs: chip select number
- * @mode: read/write mode
- * @dev_width: device bus width(1 for x16, 0 for x8)
- * @nsectors: how many 512-byte sectors to process
- * @nerrors: how many errors to correct per sector (4 or 8)
- */
-int gpmc_enable_hwecc_bch(int cs, int mode, int dev_width, int nsectors,
-                         int nerrors)
-{
-       unsigned int val;
-
-       /* check if ecc module is in use */
-       if (gpmc_ecc_used != -EINVAL)
-               return -EINVAL;
-
-       gpmc_ecc_used = cs;
-
-       /* clear ecc and enable bits */
-       gpmc_write_reg(GPMC_ECC_CONTROL, 0x1);
-
-       /*
-        * When using BCH, sector size is hardcoded to 512 bytes.
-        * Here we are using wrapping mode 6 both for reading and writing, with:
-        *  size0 = 0  (no additional protected byte in spare area)
-        *  size1 = 32 (skip 32 nibbles = 16 bytes per sector in spare area)
-        */
-       gpmc_write_reg(GPMC_ECC_SIZE_CONFIG, (32 << 22) | (0 << 12));
-
-       /* BCH configuration */
-       val = ((1                        << 16) | /* enable BCH */
-              (((nerrors == 8) ? 1 : 0) << 12) | /* 8 or 4 bits */
-              (0x06                     <<  8) | /* wrap mode = 6 */
-              (dev_width                <<  7) | /* bus width */
-              (((nsectors-1) & 0x7)     <<  4) | /* number of sectors */
-              (cs                       <<  1) | /* ECC CS */
-              (0x1));                            /* enable ECC */
-
-       gpmc_write_reg(GPMC_ECC_CONFIG, val);
-       gpmc_write_reg(GPMC_ECC_CONTROL, 0x101);
-       return 0;
-}
-EXPORT_SYMBOL_GPL(gpmc_enable_hwecc_bch);
-
-/**
- * gpmc_calculate_ecc_bch4 - Generate 7 ecc bytes per sector of 512 data bytes
- * @cs:  chip select number
- * @dat: The pointer to data on which ecc is computed
- * @ecc: The ecc output buffer
- */
-int gpmc_calculate_ecc_bch4(int cs, const u_char *dat, u_char *ecc)
-{
-       int i;
-       unsigned long nsectors, reg, val1, val2;
-
-       if (gpmc_ecc_used != cs)
-               return -EINVAL;
-
-       nsectors = ((gpmc_read_reg(GPMC_ECC_CONFIG) >> 4) & 0x7) + 1;
-
-       for (i = 0; i < nsectors; i++) {
-
-               reg = GPMC_ECC_BCH_RESULT_0 + 16*i;
-
-               /* Read hw-computed remainder */
-               val1 = gpmc_read_reg(reg + 0);
-               val2 = gpmc_read_reg(reg + 4);
-
-               /*
-                * Add constant polynomial to remainder, in order to get an ecc
-                * sequence of 0xFFs for a buffer filled with 0xFFs; and
-                * left-justify the resulting polynomial.
-                */
-               *ecc++ = 0x28 ^ ((val2 >> 12) & 0xFF);
-               *ecc++ = 0x13 ^ ((val2 >>  4) & 0xFF);
-               *ecc++ = 0xcc ^ (((val2 & 0xF) << 4)|((val1 >> 28) & 0xF));
-               *ecc++ = 0x39 ^ ((val1 >> 20) & 0xFF);
-               *ecc++ = 0x96 ^ ((val1 >> 12) & 0xFF);
-               *ecc++ = 0xac ^ ((val1 >> 4) & 0xFF);
-               *ecc++ = 0x7f ^ ((val1 & 0xF) << 4);
-       }
-
-       gpmc_ecc_used = -EINVAL;
-       return 0;
-}
-EXPORT_SYMBOL_GPL(gpmc_calculate_ecc_bch4);
-
-/**
- * gpmc_calculate_ecc_bch8 - Generate 13 ecc bytes per block of 512 data bytes
- * @cs:  chip select number
- * @dat: The pointer to data on which ecc is computed
- * @ecc: The ecc output buffer
- */
-int gpmc_calculate_ecc_bch8(int cs, const u_char *dat, u_char *ecc)
-{
-       int i;
-       unsigned long nsectors, reg, val1, val2, val3, val4;
-
-       if (gpmc_ecc_used != cs)
-               return -EINVAL;
-
-       nsectors = ((gpmc_read_reg(GPMC_ECC_CONFIG) >> 4) & 0x7) + 1;
-
-       for (i = 0; i < nsectors; i++) {
-
-               reg = GPMC_ECC_BCH_RESULT_0 + 16*i;
-
-               /* Read hw-computed remainder */
-               val1 = gpmc_read_reg(reg + 0);
-               val2 = gpmc_read_reg(reg + 4);
-               val3 = gpmc_read_reg(reg + 8);
-               val4 = gpmc_read_reg(reg + 12);
-
-               /*
-                * Add constant polynomial to remainder, in order to get an ecc
-                * sequence of 0xFFs for a buffer filled with 0xFFs.
-                */
-               *ecc++ = 0xef ^ (val4 & 0xFF);
-               *ecc++ = 0x51 ^ ((val3 >> 24) & 0xFF);
-               *ecc++ = 0x2e ^ ((val3 >> 16) & 0xFF);
-               *ecc++ = 0x09 ^ ((val3 >> 8) & 0xFF);
-               *ecc++ = 0xed ^ (val3 & 0xFF);
-               *ecc++ = 0x93 ^ ((val2 >> 24) & 0xFF);
-               *ecc++ = 0x9a ^ ((val2 >> 16) & 0xFF);
-               *ecc++ = 0xc2 ^ ((val2 >> 8) & 0xFF);
-               *ecc++ = 0x97 ^ (val2 & 0xFF);
-               *ecc++ = 0x79 ^ ((val1 >> 24) & 0xFF);
-               *ecc++ = 0xe5 ^ ((val1 >> 16) & 0xFF);
-               *ecc++ = 0x24 ^ ((val1 >> 8) & 0xFF);
-               *ecc++ = 0xb5 ^ (val1 & 0xFF);
-       }
-
-       gpmc_ecc_used = -EINVAL;
-       return 0;
-}
-EXPORT_SYMBOL_GPL(gpmc_calculate_ecc_bch8);
-
-#endif /* CONFIG_ARCH_OMAP3 */
diff --git a/arch/arm/mach-omap2/gpmc.h b/arch/arm/mach-omap2/gpmc.h
new file mode 100644 (file)
index 0000000..79f4dfc
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * General-Purpose Memory Controller for OMAP2
+ *
+ * Copyright (C) 2005-2006 Nokia Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __OMAP2_GPMC_H
+#define __OMAP2_GPMC_H
+
+#include <linux/platform_data/mtd-nand-omap2.h>
+
+/* Maximum Number of Chip Selects */
+#define GPMC_CS_NUM            8
+
+#define GPMC_CS_CONFIG1                0x00
+#define GPMC_CS_CONFIG2                0x04
+#define GPMC_CS_CONFIG3                0x08
+#define GPMC_CS_CONFIG4                0x0c
+#define GPMC_CS_CONFIG5                0x10
+#define GPMC_CS_CONFIG6                0x14
+#define GPMC_CS_CONFIG7                0x18
+#define GPMC_CS_NAND_COMMAND   0x1c
+#define GPMC_CS_NAND_ADDRESS   0x20
+#define GPMC_CS_NAND_DATA      0x24
+
+/* Control Commands */
+#define GPMC_CONFIG_RDY_BSY    0x00000001
+#define GPMC_CONFIG_DEV_SIZE   0x00000002
+#define GPMC_CONFIG_DEV_TYPE   0x00000003
+#define GPMC_SET_IRQ_STATUS    0x00000004
+#define GPMC_CONFIG_WP         0x00000005
+
+#define GPMC_ENABLE_IRQ                0x0000000d
+
+/* ECC commands */
+#define GPMC_ECC_READ          0 /* Reset Hardware ECC for read */
+#define GPMC_ECC_WRITE         1 /* Reset Hardware ECC for write */
+#define GPMC_ECC_READSYN       2 /* Reset before syndrom is read back */
+
+#define GPMC_CONFIG1_WRAPBURST_SUPP     (1 << 31)
+#define GPMC_CONFIG1_READMULTIPLE_SUPP  (1 << 30)
+#define GPMC_CONFIG1_READTYPE_ASYNC     (0 << 29)
+#define GPMC_CONFIG1_READTYPE_SYNC      (1 << 29)
+#define GPMC_CONFIG1_WRITEMULTIPLE_SUPP (1 << 28)
+#define GPMC_CONFIG1_WRITETYPE_ASYNC    (0 << 27)
+#define GPMC_CONFIG1_WRITETYPE_SYNC     (1 << 27)
+#define GPMC_CONFIG1_CLKACTIVATIONTIME(val) ((val & 3) << 25)
+#define GPMC_CONFIG1_PAGE_LEN(val)      ((val & 3) << 23)
+#define GPMC_CONFIG1_WAIT_READ_MON      (1 << 22)
+#define GPMC_CONFIG1_WAIT_WRITE_MON     (1 << 21)
+#define GPMC_CONFIG1_WAIT_MON_IIME(val) ((val & 3) << 18)
+#define GPMC_CONFIG1_WAIT_PIN_SEL(val)  ((val & 3) << 16)
+#define GPMC_CONFIG1_DEVICESIZE(val)    ((val & 3) << 12)
+#define GPMC_CONFIG1_DEVICESIZE_16      GPMC_CONFIG1_DEVICESIZE(1)
+#define GPMC_CONFIG1_DEVICETYPE(val)    ((val & 3) << 10)
+#define GPMC_CONFIG1_DEVICETYPE_NOR     GPMC_CONFIG1_DEVICETYPE(0)
+#define GPMC_CONFIG1_MUXADDDATA         (1 << 9)
+#define GPMC_CONFIG1_TIME_PARA_GRAN     (1 << 4)
+#define GPMC_CONFIG1_FCLK_DIV(val)      (val & 3)
+#define GPMC_CONFIG1_FCLK_DIV2          (GPMC_CONFIG1_FCLK_DIV(1))
+#define GPMC_CONFIG1_FCLK_DIV3          (GPMC_CONFIG1_FCLK_DIV(2))
+#define GPMC_CONFIG1_FCLK_DIV4          (GPMC_CONFIG1_FCLK_DIV(3))
+#define GPMC_CONFIG7_CSVALID           (1 << 6)
+
+#define GPMC_DEVICETYPE_NOR            0
+#define GPMC_DEVICETYPE_NAND           2
+#define GPMC_CONFIG_WRITEPROTECT       0x00000010
+#define WR_RD_PIN_MONITORING           0x00600000
+#define GPMC_IRQ_FIFOEVENTENABLE       0x01
+#define GPMC_IRQ_COUNT_EVENT           0x02
+
+
+/*
+ * Note that all values in this struct are in nanoseconds except sync_clk
+ * (which is in picoseconds), while the register values are in gpmc_fck cycles.
+ */
+struct gpmc_timings {
+       /* Minimum clock period for synchronous mode (in picoseconds) */
+       u32 sync_clk;
+
+       /* Chip-select signal timings corresponding to GPMC_CS_CONFIG2 */
+       u16 cs_on;              /* Assertion time */
+       u16 cs_rd_off;          /* Read deassertion time */
+       u16 cs_wr_off;          /* Write deassertion time */
+
+       /* ADV signal timings corresponding to GPMC_CONFIG3 */
+       u16 adv_on;             /* Assertion time */
+       u16 adv_rd_off;         /* Read deassertion time */
+       u16 adv_wr_off;         /* Write deassertion time */
+
+       /* WE signals timings corresponding to GPMC_CONFIG4 */
+       u16 we_on;              /* WE assertion time */
+       u16 we_off;             /* WE deassertion time */
+
+       /* OE signals timings corresponding to GPMC_CONFIG4 */
+       u16 oe_on;              /* OE assertion time */
+       u16 oe_off;             /* OE deassertion time */
+
+       /* Access time and cycle time timings corresponding to GPMC_CONFIG5 */
+       u16 page_burst_access;  /* Multiple access word delay */
+       u16 access;             /* Start-cycle to first data valid delay */
+       u16 rd_cycle;           /* Total read cycle time */
+       u16 wr_cycle;           /* Total write cycle time */
+
+       /* The following are only on OMAP3430 */
+       u16 wr_access;          /* WRACCESSTIME */
+       u16 wr_data_mux_bus;    /* WRDATAONADMUXBUS */
+};
+
+extern void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs);
+extern int gpmc_get_client_irq(unsigned irq_config);
+
+extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns);
+extern unsigned int gpmc_ps_to_ticks(unsigned int time_ps);
+extern unsigned int gpmc_ticks_to_ns(unsigned int ticks);
+extern unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns);
+extern unsigned long gpmc_get_fclk_period(void);
+
+extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
+extern u32 gpmc_cs_read_reg(int cs, int idx);
+extern int gpmc_calc_divider(unsigned int sync_clk);
+extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t);
+extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
+extern void gpmc_cs_free(int cs);
+extern int gpmc_cs_set_reserved(int cs, int reserved);
+extern int gpmc_cs_reserved(int cs);
+extern void omap3_gpmc_save_context(void);
+extern void omap3_gpmc_restore_context(void);
+extern int gpmc_cs_configure(int cs, int cmd, int wval);
+
+#endif
index e003f2bba30c4c6e5d8e200ab7e186712f3fd307..3da8900598c88444d6729ffb8368e4f2509a6081 100644 (file)
@@ -27,8 +27,8 @@
 #include <linux/err.h>
 #include <linux/platform_device.h>
 
-#include <plat/omap_hwmod.h>
-#include <plat/omap_device.h>
+#include "omap_hwmod.h"
+#include "omap_device.h"
 #include "hdq1w.h"
 
 #include "common.h"
index 0c1efc846d8dddb5b23237a95993288aa6747166..c7e08d2a7a460c94bbd65d533e8922b0cec4e233 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef ARCH_ARM_MACH_OMAP2_HDQ1W_H
 #define ARCH_ARM_MACH_OMAP2_HDQ1W_H
 
-#include <plat/omap_hwmod.h>
+#include "omap_hwmod.h"
 
 /*
  * XXX A future cleanup patch should modify
index 4d3a6324155f95de768fd1416f81ad068e80c3bd..e3406dce59beacb155777857aade449e60d79d37 100644 (file)
 #include <mach/hardware.h>
 #include <linux/platform_data/gpio-omap.h>
 
-#include <plat/mmc.h>
-#include <plat/omap-pm.h>
-#include <plat/omap_device.h>
+#include "soc.h"
+#include "omap_device.h"
+#include "omap-pm.h"
 
 #include "mux.h"
+#include "mmc.h"
 #include "hsmmc.h"
 #include "control.h"
 
index 8763c8520dc2135030dc3a51cce0e5567fe4ca27..1df9b5feda16a5db49d09ca77e4ae8f374f1ee95 100644 (file)
@@ -21,8 +21,8 @@
 #include <linux/err.h>
 #include <linux/hwspinlock.h>
 
-#include <plat/omap_hwmod.h>
-#include <plat/omap_device.h>
+#include "omap_hwmod.h"
+#include "omap_device.h"
 
 static struct hwspinlock_pdata omap_hwspinlock_pdata __initdata = {
        .base_id = 0,
index fc57e67b321f3900b38f95df939f796eac8ef33b..ad55b943108fcfc17de50d471ce9afd034105d55 100644 (file)
  *
  */
 
-#include <plat/i2c.h>
+#include "soc.h"
 #include "common.h"
-#include <plat/omap_hwmod.h>
+#include "omap_hwmod.h"
+#include "omap_device.h"
 
 #include "mux.h"
+#include "i2c.h"
 
 /* In register I2C_CON, Bit 15 is the I2C enable bit */
 #define I2C_EN                                 BIT(15)
@@ -33,7 +35,9 @@
 /* Maximum microseconds to wait for OMAP module to softreset */
 #define MAX_MODULE_SOFTRESET_WAIT      10000
 
-void __init omap2_i2c_mux_pins(int bus_id)
+#define MAX_OMAP_I2C_HWMOD_NAME_LEN    16
+
+static void __init omap2_i2c_mux_pins(int bus_id)
 {
        char mux_name[sizeof("i2c2_scl.i2c2_scl")];
 
@@ -104,3 +108,46 @@ int omap_i2c_reset(struct omap_hwmod *oh)
 
        return 0;
 }
+
+static const char name[] = "omap_i2c";
+
+int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata,
+                               int bus_id)
+{
+       int l;
+       struct omap_hwmod *oh;
+       struct platform_device *pdev;
+       char oh_name[MAX_OMAP_I2C_HWMOD_NAME_LEN];
+       struct omap_i2c_bus_platform_data *pdata;
+       struct omap_i2c_dev_attr *dev_attr;
+
+       omap2_i2c_mux_pins(bus_id);
+
+       l = snprintf(oh_name, MAX_OMAP_I2C_HWMOD_NAME_LEN, "i2c%d", bus_id);
+       WARN(l >= MAX_OMAP_I2C_HWMOD_NAME_LEN,
+               "String buffer overflow in I2C%d device setup\n", bus_id);
+       oh = omap_hwmod_lookup(oh_name);
+       if (!oh) {
+                       pr_err("Could not look up %s\n", oh_name);
+                       return -EEXIST;
+       }
+
+       pdata = i2c_pdata;
+       /*
+        * pass the hwmod class's CPU-specific knowledge of I2C IP revision in
+        * use, and functionality implementation flags, up to the OMAP I2C
+        * driver via platform data
+        */
+       pdata->rev = oh->class->rev;
+
+       dev_attr = (struct omap_i2c_dev_attr *)oh->dev_attr;
+       pdata->flags = dev_attr->flags;
+
+       pdev = omap_device_build(name, bus_id, oh, pdata,
+                       sizeof(struct omap_i2c_bus_platform_data),
+                       NULL, 0, 0);
+       WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);
+
+       return PTR_RET(pdev);
+}
+
diff --git a/arch/arm/mach-omap2/i2c.h b/arch/arm/mach-omap2/i2c.h
new file mode 100644 (file)
index 0000000..81dbb99
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Helper module for board specific I2C bus registration
+ *
+ * Copyright (C) 2009 Nokia Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include "../plat-omap/i2c.h"
+
+#ifndef __MACH_OMAP2_I2C_H
+#define __MACH_OMAP2_I2C_H
+
+/**
+ * i2c_dev_attr - OMAP I2C controller device attributes for omap_hwmod
+ * @fifo_depth: total controller FIFO size (in bytes)
+ * @flags: differences in hardware support capability
+ *
+ * @fifo_depth represents what exists on the hardware, not what is
+ * actually configured at runtime by the device driver.
+ */
+struct omap_i2c_dev_attr {
+       u8      fifo_depth;
+       u32     flags;
+};
+
+int omap_i2c_reset(struct omap_hwmod *oh);
+
+#endif /* __MACH_OMAP2_I2C_H */
diff --git a/arch/arm/mach-omap2/include/mach/board-zoom.h b/arch/arm/mach-omap2/include/mach/board-zoom.h
deleted file mode 100644 (file)
index 2e94869..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * Defines for zoom boards
- */
-#include <video/omapdss.h>
-
-#define ZOOM_NAND_CS    0
-
-extern int __init zoom_debugboard_init(void);
-extern void __init zoom_peripherals_init(void);
-extern void __init zoom_display_init(void);
index 93d10de7129fc550bea299921a3a0f3a62239630..4b5cbdfac028e629143b2d0473887e4618ee56cd 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <linux/serial_reg.h>
 
-#include <plat/serial.h>
+#include <../mach-omap2/serial.h>
 
 #define UART_OFFSET(addr)      ((addr) & 0x00ffffff)
 
index 78e0557bfd4ed9fdef7a4828b5a9da8bd3574562..28d1ec0e869aa57fd8147647eeee2a6afdd4fdd2 100644 (file)
@@ -1,5 +1,176 @@
 /*
- * arch/arm/mach-omap2/include/mach/uncompress.h
+ * arch/arm/plat-omap/include/mach/uncompress.h
+ *
+ * Serial port stubs for kernel decompress status messages
+ *
+ * Initially based on:
+ * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h
+ * Copyright (C) 2000 RidgeRun, Inc.
+ * Author: Greg Lonnon <glonnon@ridgerun.com>
+ *
+ * Rewritten by:
+ * Author: <source@mvista.com>
+ * 2004 (c) MontaVista Software, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
  */
 
-#include <plat/uncompress.h>
+#include <linux/types.h>
+#include <linux/serial_reg.h>
+
+#include <asm/memory.h>
+#include <asm/mach-types.h>
+
+#include <../mach-omap2/serial.h>
+
+#define MDR1_MODE_MASK                 0x07
+
+volatile u8 *uart_base;
+int uart_shift;
+
+/*
+ * Store the DEBUG_LL uart number into memory.
+ * See also debug-macro.S, and serial.c for related code.
+ */
+static void set_omap_uart_info(unsigned char port)
+{
+       /*
+        * Get address of some.bss variable and round it down
+        * a la CONFIG_AUTO_ZRELADDR.
+        */
+       u32 ram_start = (u32)&uart_shift & 0xf8000000;
+       u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS);
+       *uart_info = port;
+}
+
+static void putc(int c)
+{
+       if (!uart_base)
+               return;
+
+       /* Check for UART 16x mode */
+       if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0)
+               return;
+
+       while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
+               barrier();
+       uart_base[UART_TX << uart_shift] = c;
+}
+
+static inline void flush(void)
+{
+}
+
+/*
+ * Macros to configure UART1 and debug UART
+ */
+#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id)              \
+       if (machine_is_##mach()) {                                      \
+               uart_base = (volatile u8 *)(dbg_uart);                  \
+               uart_shift = (dbg_shft);                                \
+               port = (dbg_id);                                        \
+               set_omap_uart_info(port);                               \
+               break;                                                  \
+       }
+
+#define DEBUG_LL_OMAP2(p, mach)                                                \
+       _DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT,    \
+               OMAP2UART##p)
+
+#define DEBUG_LL_OMAP3(p, mach)                                                \
+       _DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT,    \
+               OMAP3UART##p)
+
+#define DEBUG_LL_OMAP4(p, mach)                                                \
+       _DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT,    \
+               OMAP4UART##p)
+
+#define DEBUG_LL_OMAP5(p, mach)                                                \
+       _DEBUG_LL_ENTRY(mach, OMAP5_UART##p##_BASE, OMAP_PORT_SHIFT,    \
+               OMAP5UART##p)
+/* Zoom2/3 shift is different for UART1 and external port */
+#define DEBUG_LL_ZOOM(mach)                                            \
+       _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
+
+#define DEBUG_LL_TI81XX(p, mach)                                       \
+       _DEBUG_LL_ENTRY(mach, TI81XX_UART##p##_BASE, OMAP_PORT_SHIFT,   \
+               TI81XXUART##p)
+
+#define DEBUG_LL_AM33XX(p, mach)                                       \
+       _DEBUG_LL_ENTRY(mach, AM33XX_UART##p##_BASE, OMAP_PORT_SHIFT,   \
+               AM33XXUART##p)
+
+static inline void arch_decomp_setup(void)
+{
+       int port = 0;
+
+       /*
+        * Initialize the port based on the machine ID from the bootloader.
+        * Note that we're using macros here instead of switch statement
+        * as machine_is functions are optimized out for the boards that
+        * are not selected.
+        */
+       do {
+               /* omap2 based boards using UART1 */
+               DEBUG_LL_OMAP2(1, omap_2430sdp);
+               DEBUG_LL_OMAP2(1, omap_apollon);
+               DEBUG_LL_OMAP2(1, omap_h4);
+
+               /* omap2 based boards using UART3 */
+               DEBUG_LL_OMAP2(3, nokia_n800);
+               DEBUG_LL_OMAP2(3, nokia_n810);
+               DEBUG_LL_OMAP2(3, nokia_n810_wimax);
+
+               /* omap3 based boards using UART1 */
+               DEBUG_LL_OMAP2(1, omap3evm);
+               DEBUG_LL_OMAP3(1, omap_3430sdp);
+               DEBUG_LL_OMAP3(1, omap_3630sdp);
+               DEBUG_LL_OMAP3(1, omap3530_lv_som);
+               DEBUG_LL_OMAP3(1, omap3_torpedo);
+
+               /* omap3 based boards using UART3 */
+               DEBUG_LL_OMAP3(3, cm_t35);
+               DEBUG_LL_OMAP3(3, cm_t3517);
+               DEBUG_LL_OMAP3(3, cm_t3730);
+               DEBUG_LL_OMAP3(3, craneboard);
+               DEBUG_LL_OMAP3(3, devkit8000);
+               DEBUG_LL_OMAP3(3, igep0020);
+               DEBUG_LL_OMAP3(3, igep0030);
+               DEBUG_LL_OMAP3(3, nokia_rm680);
+               DEBUG_LL_OMAP3(3, nokia_rm696);
+               DEBUG_LL_OMAP3(3, nokia_rx51);
+               DEBUG_LL_OMAP3(3, omap3517evm);
+               DEBUG_LL_OMAP3(3, omap3_beagle);
+               DEBUG_LL_OMAP3(3, omap3_pandora);
+               DEBUG_LL_OMAP3(3, omap_ldp);
+               DEBUG_LL_OMAP3(3, overo);
+               DEBUG_LL_OMAP3(3, touchbook);
+
+               /* omap4 based boards using UART3 */
+               DEBUG_LL_OMAP4(3, omap_4430sdp);
+               DEBUG_LL_OMAP4(3, omap4_panda);
+
+               /* omap5 based boards using UART3 */
+               DEBUG_LL_OMAP5(3, omap5_sevm);
+
+               /* zoom2/3 external uart */
+               DEBUG_LL_ZOOM(omap_zoom2);
+               DEBUG_LL_ZOOM(omap_zoom3);
+
+               /* TI8168 base boards using UART3 */
+               DEBUG_LL_TI81XX(3, ti8168evm);
+
+               /* TI8148 base boards using UART1 */
+               DEBUG_LL_TI81XX(1, ti8148evm);
+
+               /* AM33XX base boards using UART1 */
+               DEBUG_LL_AM33XX(1, am335xevm);
+       } while (0);
+}
+
+/*
+ * nothing to do
+ */
+#define arch_decomp_wdog()
index 4234d28dc17177ffbf31d598328a4e8a75c18451..4fadc7895579a10523b94ca833a78a13b7d04a2e 100644 (file)
 #include <asm/tlb.h>
 #include <asm/mach/map.h>
 
-#include <plat/sram.h>
-#include <plat/sdrc.h>
-#include <plat/serial.h>
-#include <plat/omap-pm.h>
-#include <plat/omap_hwmod.h>
-#include <plat/multi.h>
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 
+#include "../plat-omap/sram.h"
+
+#include "omap_hwmod.h"
 #include "soc.h"
 #include "iomap.h"
 #include "voltage.h"
@@ -43,6 +40,9 @@
 #include "clock2xxx.h"
 #include "clock3xxx.h"
 #include "clock44xx.h"
+#include "omap-pm.h"
+#include "sdrc.h"
+#include "serial.h"
 
 /*
  * The machine specific code may provide the extra mapping besides the
index 37f8f948047baace501bc6ef4b09f551aa7c9cfa..a106c75c53381203eeacc80e06de8e125ee4d3fe 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/platform_data/asoc-ti-mcbsp.h>
-
-#include <plat/dma.h>
-#include <plat/omap_device.h>
 #include <linux/pm_runtime.h>
 
+#include <plat-omap/dma-omap.h>
+
+#include "omap_device.h"
+
 /*
  * FIXME: Find a mechanism to enable/disable runtime the McBSP ICLK autoidle.
  * Sidetone needs non-gated ICLK and sidetone autoidle is broken.
diff --git a/arch/arm/mach-omap2/mmc.h b/arch/arm/mach-omap2/mmc.h
new file mode 100644 (file)
index 0000000..0cd4b08
--- /dev/null
@@ -0,0 +1,23 @@
+#include <linux/mmc/host.h>
+#include <linux/platform_data/mmc-omap.h>
+
+#define OMAP24XX_NR_MMC                2
+#define OMAP2420_MMC_SIZE      OMAP1_MMC_SIZE
+#define OMAP2_MMC1_BASE                0x4809c000
+
+#define OMAP4_MMC_REG_OFFSET   0x100
+
+#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
+void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data);
+#else
+static inline void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
+{
+}
+#endif
+
+struct omap_hwmod;
+int omap_msdi_reset(struct omap_hwmod *oh);
+
+/* called from board-specific card detection service routine */
+extern void omap_mmc_notify_cover_event(struct device *dev, int slot,
+                                       int is_closed);
index 9e57b4aadb0694bedc233599ddeb30c8d45a2567..627e97e307432aec72cee47c10426675fe1b935f 100644 (file)
 #include <linux/err.h>
 #include <linux/platform_data/gpio-omap.h>
 
-#include <plat/omap_hwmod.h>
-#include <plat/omap_device.h>
-#include <plat/mmc.h>
-
 #include "common.h"
 #include "control.h"
+#include "omap_hwmod.h"
+#include "omap_device.h"
 #include "mux.h"
+#include "mmc.h"
 
 /*
  * MSDI_CON_OFFSET: offset in bytes of the MSDI IP block's CON register
index 701e17cba46855bb4c57e441d10ac76fc55c7fb9..26126343d6ac8a6badead78ca640bfc366e686cb 100644 (file)
@@ -36,8 +36,9 @@
 #include <linux/interrupt.h>
 
 
-#include <plat/omap_hwmod.h>
+#include "omap_hwmod.h"
 
+#include "soc.h"
 #include "control.h"
 #include "mux.h"
 #include "prm.h"
index ff4e6a0e9c7c7ef367ddffe6d92735a7e7e3389c..3f5fd7e3549dc36487e243f4840a5de2e0220b81 100644 (file)
@@ -50,6 +50,7 @@
 #include <asm/suspend.h>
 #include <asm/hardware/cache-l2x0.h>
 
+#include "soc.h"
 #include "common.h"
 #include "omap44xx.h"
 #include "omap4-sar-layout.h"
diff --git a/arch/arm/mach-omap2/omap-pm.h b/arch/arm/mach-omap2/omap-pm.h
new file mode 100644 (file)
index 0000000..67faa7b
--- /dev/null
@@ -0,0 +1,352 @@
+/*
+ * omap-pm.h - OMAP power management interface
+ *
+ * Copyright (C) 2008-2010 Texas Instruments, Inc.
+ * Copyright (C) 2008-2010 Nokia Corporation
+ * Paul Walmsley
+ *
+ * Interface developed by (in alphabetical order): Karthik Dasu, Jouni
+ * Högander, Tony Lindgren, Rajendra Nayak, Sakari Poussa,
+ * Veeramanikandan Raju, Anand Sawant, Igor Stoppa, Paul Walmsley,
+ * Richard Woodruff
+ */
+
+#ifndef ASM_ARM_ARCH_OMAP_OMAP_PM_H
+#define ASM_ARM_ARCH_OMAP_OMAP_PM_H
+
+#include <linux/device.h>
+#include <linux/cpufreq.h>
+#include <linux/clk.h>
+#include <linux/opp.h>
+
+/*
+ * agent_id values for use with omap_pm_set_min_bus_tput():
+ *
+ * OCP_INITIATOR_AGENT is only valid for devices that can act as
+ * initiators -- it represents the device's L3 interconnect
+ * connection.  OCP_TARGET_AGENT represents the device's L4
+ * interconnect connection.
+ */
+#define OCP_TARGET_AGENT               1
+#define OCP_INITIATOR_AGENT            2
+
+/**
+ * omap_pm_if_early_init - OMAP PM init code called before clock fw init
+ * @mpu_opp_table: array ptr to struct omap_opp for MPU
+ * @dsp_opp_table: array ptr to struct omap_opp for DSP
+ * @l3_opp_table : array ptr to struct omap_opp for CORE
+ *
+ * Initialize anything that must be configured before the clock
+ * framework starts.  The "_if_" is to avoid name collisions with the
+ * PM idle-loop code.
+ */
+int __init omap_pm_if_early_init(void);
+
+/**
+ * omap_pm_if_init - OMAP PM init code called after clock fw init
+ *
+ * The main initialization code.  OPP tables are passed in here.  The
+ * "_if_" is to avoid name collisions with the PM idle-loop code.
+ */
+int __init omap_pm_if_init(void);
+
+/**
+ * omap_pm_if_exit - OMAP PM exit code
+ *
+ * Exit code; currently unused.  The "_if_" is to avoid name
+ * collisions with the PM idle-loop code.
+ */
+void omap_pm_if_exit(void);
+
+/*
+ * Device-driver-originated constraints (via board-*.c files, platform_data)
+ */
+
+
+/**
+ * omap_pm_set_max_mpu_wakeup_lat - set the maximum MPU wakeup latency
+ * @dev: struct device * requesting the constraint
+ * @t: maximum MPU wakeup latency in microseconds
+ *
+ * Request that the maximum interrupt latency for the MPU to be no
+ * greater than @t microseconds. "Interrupt latency" in this case is
+ * defined as the elapsed time from the occurrence of a hardware or
+ * timer interrupt to the time when the device driver's interrupt
+ * service routine has been entered by the MPU.
+ *
+ * It is intended that underlying PM code will use this information to
+ * determine what power state to put the MPU powerdomain into, and
+ * possibly the CORE powerdomain as well, since interrupt handling
+ * code currently runs from SDRAM.  Advanced PM or board*.c code may
+ * also configure interrupt controller priorities, OCP bus priorities,
+ * CPU speed(s), etc.
+ *
+ * This function will not affect device wakeup latency, e.g., time
+ * elapsed from when a device driver enables a hardware device with
+ * clk_enable(), to when the device is ready for register access or
+ * other use.  To control this device wakeup latency, use
+ * omap_pm_set_max_dev_wakeup_lat()
+ *
+ * Multiple calls to omap_pm_set_max_mpu_wakeup_lat() will replace the
+ * previous t value.  To remove the latency target for the MPU, call
+ * with t = -1.
+ *
+ * XXX This constraint will be deprecated soon in favor of the more
+ * general omap_pm_set_max_dev_wakeup_lat()
+ *
+ * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
+ * is not satisfiable, or 0 upon success.
+ */
+int omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t);
+
+
+/**
+ * omap_pm_set_min_bus_tput - set minimum bus throughput needed by device
+ * @dev: struct device * requesting the constraint
+ * @tbus_id: interconnect to operate on (OCP_{INITIATOR,TARGET}_AGENT)
+ * @r: minimum throughput (in KiB/s)
+ *
+ * Request that the minimum data throughput on the OCP interconnect
+ * attached to device @dev interconnect agent @tbus_id be no less
+ * than @r KiB/s.
+ *
+ * It is expected that the OMAP PM or bus code will use this
+ * information to set the interconnect clock to run at the lowest
+ * possible speed that satisfies all current system users.  The PM or
+ * bus code will adjust the estimate based on its model of the bus, so
+ * device driver authors should attempt to specify an accurate
+ * quantity for their device use case, and let the PM or bus code
+ * overestimate the numbers as necessary to handle request/response
+ * latency, other competing users on the system, etc.  On OMAP2/3, if
+ * a driver requests a minimum L4 interconnect speed constraint, the
+ * code will also need to add an minimum L3 interconnect speed
+ * constraint,
+ *
+ * Multiple calls to omap_pm_set_min_bus_tput() will replace the
+ * previous rate value for this device.  To remove the interconnect
+ * throughput restriction for this device, call with r = 0.
+ *
+ * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
+ * is not satisfiable, or 0 upon success.
+ */
+int omap_pm_set_min_bus_tput(struct device *dev, u8 agent_id, unsigned long r);
+
+
+/**
+ * omap_pm_set_max_dev_wakeup_lat - set the maximum device enable latency
+ * @req_dev: struct device * requesting the constraint, or NULL if none
+ * @dev: struct device * to set the constraint one
+ * @t: maximum device wakeup latency in microseconds
+ *
+ * Request that the maximum amount of time necessary for a device @dev
+ * to become accessible after its clocks are enabled should be no
+ * greater than @t microseconds.  Specifically, this represents the
+ * time from when a device driver enables device clocks with
+ * clk_enable(), to when the register reads and writes on the device
+ * will succeed.  This function should be called before clk_disable()
+ * is called, since the power state transition decision may be made
+ * during clk_disable().
+ *
+ * It is intended that underlying PM code will use this information to
+ * determine what power state to put the powerdomain enclosing this
+ * device into.
+ *
+ * Multiple calls to omap_pm_set_max_dev_wakeup_lat() will replace the
+ * previous wakeup latency values for this device.  To remove the
+ * wakeup latency restriction for this device, call with t = -1.
+ *
+ * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
+ * is not satisfiable, or 0 upon success.
+ */
+int omap_pm_set_max_dev_wakeup_lat(struct device *req_dev, struct device *dev,
+                                  long t);
+
+
+/**
+ * omap_pm_set_max_sdma_lat - set the maximum system DMA transfer start latency
+ * @dev: struct device *
+ * @t: maximum DMA transfer start latency in microseconds
+ *
+ * Request that the maximum system DMA transfer start latency for this
+ * device 'dev' should be no greater than 't' microseconds.  "DMA
+ * transfer start latency" here is defined as the elapsed time from
+ * when a device (e.g., McBSP) requests that a system DMA transfer
+ * start or continue, to the time at which data starts to flow into
+ * that device from the system DMA controller.
+ *
+ * It is intended that underlying PM code will use this information to
+ * determine what power state to put the CORE powerdomain into.
+ *
+ * Since system DMA transfers may not involve the MPU, this function
+ * will not affect MPU wakeup latency.  Use set_max_cpu_lat() to do
+ * so.  Similarly, this function will not affect device wakeup latency
+ * -- use set_max_dev_wakeup_lat() to affect that.
+ *
+ * Multiple calls to set_max_sdma_lat() will replace the previous t
+ * value for this device.  To remove the maximum DMA latency for this
+ * device, call with t = -1.
+ *
+ * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
+ * is not satisfiable, or 0 upon success.
+ */
+int omap_pm_set_max_sdma_lat(struct device *dev, long t);
+
+
+/**
+ * omap_pm_set_min_clk_rate - set minimum clock rate requested by @dev
+ * @dev: struct device * requesting the constraint
+ * @clk: struct clk * to set the minimum rate constraint on
+ * @r: minimum rate in Hz
+ *
+ * Request that the minimum clock rate on the device @dev's clk @clk
+ * be no less than @r Hz.
+ *
+ * It is expected that the OMAP PM code will use this information to
+ * find an OPP or clock setting that will satisfy this clock rate
+ * constraint, along with any other applicable system constraints on
+ * the clock rate or corresponding voltage, etc.
+ *
+ * omap_pm_set_min_clk_rate() differs from the clock code's
+ * clk_set_rate() in that it considers other constraints before taking
+ * any hardware action, and may change a system OPP rather than just a
+ * clock rate.  clk_set_rate() is intended to be a low-level
+ * interface.
+ *
+ * omap_pm_set_min_clk_rate() is easily open to abuse.  A better API
+ * would be something like "omap_pm_set_min_dev_performance()";
+ * however, there is no easily-generalizable concept of performance
+ * that applies to all devices.  Only a device (and possibly the
+ * device subsystem) has both the subsystem-specific knowledge, and
+ * the hardware IP block-specific knowledge, to translate a constraint
+ * on "touchscreen sampling accuracy" or "number of pixels or polygons
+ * rendered per second" to a clock rate.  This translation can be
+ * dependent on the hardware IP block's revision, or firmware version,
+ * and the driver is the only code on the system that has this
+ * information and can know how to translate that into a clock rate.
+ *
+ * The intended use-case for this function is for userspace or other
+ * kernel code to communicate a particular performance requirement to
+ * a subsystem; then for the subsystem to communicate that requirement
+ * to something that is meaningful to the device driver; then for the
+ * device driver to convert that requirement to a clock rate, and to
+ * then call omap_pm_set_min_clk_rate().
+ *
+ * Users of this function (such as device drivers) should not simply
+ * call this function with some high clock rate to ensure "high
+ * performance."  Rather, the device driver should take a performance
+ * constraint from its subsystem, such as "render at least X polygons
+ * per second," and use some formula or table to convert that into a
+ * clock rate constraint given the hardware type and hardware
+ * revision.  Device drivers or subsystems should not assume that they
+ * know how to make a power/performance tradeoff - some device use
+ * cases may tolerate a lower-fidelity device function for lower power
+ * consumption; others may demand a higher-fidelity device function,
+ * no matter what the power consumption.
+ *
+ * Multiple calls to omap_pm_set_min_clk_rate() will replace the
+ * previous rate value for the device @dev.  To remove the minimum clock
+ * rate constraint for the device, call with r = 0.
+ *
+ * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
+ * is not satisfiable, or 0 upon success.
+ */
+int omap_pm_set_min_clk_rate(struct device *dev, struct clk *c, long r);
+
+/*
+ * DSP Bridge-specific constraints
+ */
+
+/**
+ * omap_pm_dsp_get_opp_table - get OPP->DSP clock frequency table
+ *
+ * Intended for use by DSPBridge.  Returns an array of OPP->DSP clock
+ * frequency entries.  The final item in the array should have .rate =
+ * .opp_id = 0.
+ */
+const struct omap_opp *omap_pm_dsp_get_opp_table(void);
+
+/**
+ * omap_pm_dsp_set_min_opp - receive desired OPP target ID from DSP Bridge
+ * @opp_id: target DSP OPP ID
+ *
+ * Set a minimum OPP ID for the DSP.  This is intended to be called
+ * only from the DSP Bridge MPU-side driver.  Unfortunately, the only
+ * information that code receives from the DSP/BIOS load estimator is the
+ * target OPP ID; hence, this interface.  No return value.
+ */
+void omap_pm_dsp_set_min_opp(u8 opp_id);
+
+/**
+ * omap_pm_dsp_get_opp - report the current DSP OPP ID
+ *
+ * Report the current OPP for the DSP.  Since on OMAP3, the DSP and
+ * MPU share a single voltage domain, the OPP ID returned back may
+ * represent a higher DSP speed than the OPP requested via
+ * omap_pm_dsp_set_min_opp().
+ *
+ * Returns the current VDD1 OPP ID, or 0 upon error.
+ */
+u8 omap_pm_dsp_get_opp(void);
+
+
+/*
+ * CPUFreq-originated constraint
+ *
+ * In the future, this should be handled by custom OPP clocktype
+ * functions.
+ */
+
+/**
+ * omap_pm_cpu_get_freq_table - return a cpufreq_frequency_table array ptr
+ *
+ * Provide a frequency table usable by CPUFreq for the current chip/board.
+ * Returns a pointer to a struct cpufreq_frequency_table array or NULL
+ * upon error.
+ */
+struct cpufreq_frequency_table **omap_pm_cpu_get_freq_table(void);
+
+/**
+ * omap_pm_cpu_set_freq - set the current minimum MPU frequency
+ * @f: MPU frequency in Hz
+ *
+ * Set the current minimum CPU frequency.  The actual CPU frequency
+ * used could end up higher if the DSP requested a higher OPP.
+ * Intended to be called by plat-omap/cpu_omap.c:omap_target().  No
+ * return value.
+ */
+void omap_pm_cpu_set_freq(unsigned long f);
+
+/**
+ * omap_pm_cpu_get_freq - report the current CPU frequency
+ *
+ * Returns the current MPU frequency, or 0 upon error.
+ */
+unsigned long omap_pm_cpu_get_freq(void);
+
+
+/*
+ * Device context loss tracking
+ */
+
+/**
+ * omap_pm_get_dev_context_loss_count - return count of times dev has lost ctx
+ * @dev: struct device *
+ *
+ * This function returns the number of times that the device @dev has
+ * lost its internal context.  This generally occurs on a powerdomain
+ * transition to OFF.  Drivers use this as an optimization to avoid restoring
+ * context if the device hasn't lost it.  To use, drivers should initially
+ * call this in their context save functions and store the result.  Early in
+ * the driver's context restore function, the driver should call this function
+ * again, and compare the result to the stored counter.  If they differ, the
+ * driver must restore device context.   If the number of context losses
+ * exceeds the maximum positive integer, the function will wrap to 0 and
+ * continue counting.  Returns the number of context losses for this device,
+ * or negative value upon error.
+ */
+int omap_pm_get_dev_context_loss_count(struct device *dev);
+
+void omap_pm_enable_off_mode(void);
+void omap_pm_disable_off_mode(void);
+
+#endif
index e089e4d1ae38f2d3a12890087ab514a69bf57ccd..b970440cffca0b5484c90dd7b6e08c7caf5b6bc2 100644 (file)
@@ -18,7 +18,6 @@
 #include <asm/cacheflush.h>
 #include <asm/memblock.h>
 
-#include <plat/omap-secure.h>
 #include "omap-secure.h"
 
 static phys_addr_t omap_secure_memblock_base;
index c90a43589abef73c787cd2fbda38c26a11b0b0ae..0e729170c46b81f2ee7a263c797853abc7d01ab3 100644 (file)
@@ -52,6 +52,13 @@ extern u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs,
                                u32 arg1, u32 arg2, u32 arg3, u32 arg4);
 extern u32 omap_smc2(u32 id, u32 falg, u32 pargs);
 extern phys_addr_t omap_secure_ram_mempool_base(void);
+extern int omap_secure_ram_reserve_memblock(void);
 
+#ifdef CONFIG_OMAP4_ERRATA_I688
+extern int omap_barrier_reserve_memblock(void);
+#else
+static inline void omap_barrier_reserve_memblock(void)
+{ }
+#endif
 #endif /* __ASSEMBLER__ */
 #endif /* OMAP_ARCH_OMAP_SECURE_H */
index e1f289748c5d5d7021b8f079c878bb723466785e..d25845c471daa2b6ebe2c6dce454be40a45ab0e4 100644 (file)
 #include <asm/mach/map.h>
 #include <asm/memblock.h>
 
-#include <plat/sram.h>
-#include <plat/omap-secure.h>
-#include <plat/mmc.h>
+#include "../plat-omap/sram.h"
 
 #include "omap-wakeupgen.h"
-
 #include "soc.h"
 #include "common.h"
+#include "mmc.h"
 #include "hsmmc.h"
 #include "omap4-sar-layout.h"
+#include "omap-secure.h"
 
 #ifdef CONFIG_CACHE_L2X0
 static void __iomem *l2cache_base;
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
new file mode 100644 (file)
index 0000000..0ef934f
--- /dev/null
@@ -0,0 +1,1277 @@
+/*
+ * omap_device implementation
+ *
+ * Copyright (C) 2009-2010 Nokia Corporation
+ * Paul Walmsley, Kevin Hilman
+ *
+ * Developed in collaboration with (alphabetical order): Benoit
+ * Cousson, Thara Gopinath, Tony Lindgren, Rajendra Nayak, Vikram
+ * Pandita, Sakari Poussa, Anand Sawant, Santosh Shilimkar, Richard
+ * Woodruff
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This code provides a consistent interface for OMAP device drivers
+ * to control power management and interconnect properties of their
+ * devices.
+ *
+ * In the medium- to long-term, this code should either be
+ * a) implemented via arch-specific pointers in platform_data
+ * or
+ * b) implemented as a proper omap_bus/omap_device in Linux, no more
+ *    platform_data func pointers
+ *
+ *
+ * Guidelines for usage by driver authors:
+ *
+ * 1. These functions are intended to be used by device drivers via
+ * function pointers in struct platform_data.  As an example,
+ * omap_device_enable() should be passed to the driver as
+ *
+ * struct foo_driver_platform_data {
+ * ...
+ *      int (*device_enable)(struct platform_device *pdev);
+ * ...
+ * }
+ *
+ * Note that the generic "device_enable" name is used, rather than
+ * "omap_device_enable".  This is so other architectures can pass in their
+ * own enable/disable functions here.
+ *
+ * This should be populated during device setup:
+ *
+ * ...
+ * pdata->device_enable = omap_device_enable;
+ * ...
+ *
+ * 2. Drivers should first check to ensure the function pointer is not null
+ * before calling it, as in:
+ *
+ * if (pdata->device_enable)
+ *     pdata->device_enable(pdev);
+ *
+ * This allows other architectures that don't use similar device_enable()/
+ * device_shutdown() functions to execute normally.
+ *
+ * ...
+ *
+ * Suggested usage by device drivers:
+ *
+ * During device initialization:
+ * device_enable()
+ *
+ * During device idle:
+ * (save remaining device context if necessary)
+ * device_idle();
+ *
+ * During device resume:
+ * device_enable();
+ * (restore context if necessary)
+ *
+ * During device shutdown:
+ * device_shutdown()
+ * (device must be reinitialized at this point to use it again)
+ *
+ */
+#undef DEBUG
+
+#include <linux/kernel.h>
+#include <linux/export.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/pm_runtime.h>
+#include <linux/of.h>
+#include <linux/notifier.h>
+
+#include "omap_device.h"
+#include "omap_hwmod.h"
+
+/* These parameters are passed to _omap_device_{de,}activate() */
+#define USE_WAKEUP_LAT                 0
+#define IGNORE_WAKEUP_LAT              1
+
+static int omap_early_device_register(struct platform_device *pdev);
+
+static struct omap_device_pm_latency omap_default_latency[] = {
+       {
+               .deactivate_func = omap_device_idle_hwmods,
+               .activate_func   = omap_device_enable_hwmods,
+               .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+       }
+};
+
+/* Private functions */
+
+/**
+ * _omap_device_activate - increase device readiness
+ * @od: struct omap_device *
+ * @ignore_lat: increase to latency target (0) or full readiness (1)?
+ *
+ * Increase readiness of omap_device @od (thus decreasing device
+ * wakeup latency, but consuming more power).  If @ignore_lat is
+ * IGNORE_WAKEUP_LAT, make the omap_device fully active.  Otherwise,
+ * if @ignore_lat is USE_WAKEUP_LAT, and the device's maximum wakeup
+ * latency is greater than the requested maximum wakeup latency, step
+ * backwards in the omap_device_pm_latency table to ensure the
+ * device's maximum wakeup latency is less than or equal to the
+ * requested maximum wakeup latency.  Returns 0.
+ */
+static int _omap_device_activate(struct omap_device *od, u8 ignore_lat)
+{
+       struct timespec a, b, c;
+
+       dev_dbg(&od->pdev->dev, "omap_device: activating\n");
+
+       while (od->pm_lat_level > 0) {
+               struct omap_device_pm_latency *odpl;
+               unsigned long long act_lat = 0;
+
+               od->pm_lat_level--;
+
+               odpl = od->pm_lats + od->pm_lat_level;
+
+               if (!ignore_lat &&
+                   (od->dev_wakeup_lat <= od->_dev_wakeup_lat_limit))
+                       break;
+
+               read_persistent_clock(&a);
+
+               /* XXX check return code */
+               odpl->activate_func(od);
+
+               read_persistent_clock(&b);
+
+               c = timespec_sub(b, a);
+               act_lat = timespec_to_ns(&c);
+
+               dev_dbg(&od->pdev->dev,
+                       "omap_device: pm_lat %d: activate: elapsed time %llu nsec\n",
+                       od->pm_lat_level, act_lat);
+
+               if (act_lat > odpl->activate_lat) {
+                       odpl->activate_lat_worst = act_lat;
+                       if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
+                               odpl->activate_lat = act_lat;
+                               dev_dbg(&od->pdev->dev,
+                                       "new worst case activate latency %d: %llu\n",
+                                       od->pm_lat_level, act_lat);
+                       } else
+                               dev_warn(&od->pdev->dev,
+                                        "activate latency %d higher than expected. (%llu > %d)\n",
+                                        od->pm_lat_level, act_lat,
+                                        odpl->activate_lat);
+               }
+
+               od->dev_wakeup_lat -= odpl->activate_lat;
+       }
+
+       return 0;
+}
+
+/**
+ * _omap_device_deactivate - decrease device readiness
+ * @od: struct omap_device *
+ * @ignore_lat: decrease to latency target (0) or full inactivity (1)?
+ *
+ * Decrease readiness of omap_device @od (thus increasing device
+ * wakeup latency, but conserving power).  If @ignore_lat is
+ * IGNORE_WAKEUP_LAT, make the omap_device fully inactive.  Otherwise,
+ * if @ignore_lat is USE_WAKEUP_LAT, and the device's maximum wakeup
+ * latency is less than the requested maximum wakeup latency, step
+ * forwards in the omap_device_pm_latency table to ensure the device's
+ * maximum wakeup latency is less than or equal to the requested
+ * maximum wakeup latency.  Returns 0.
+ */
+static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
+{
+       struct timespec a, b, c;
+
+       dev_dbg(&od->pdev->dev, "omap_device: deactivating\n");
+
+       while (od->pm_lat_level < od->pm_lats_cnt) {
+               struct omap_device_pm_latency *odpl;
+               unsigned long long deact_lat = 0;
+
+               odpl = od->pm_lats + od->pm_lat_level;
+
+               if (!ignore_lat &&
+                   ((od->dev_wakeup_lat + odpl->activate_lat) >
+                    od->_dev_wakeup_lat_limit))
+                       break;
+
+               read_persistent_clock(&a);
+
+               /* XXX check return code */
+               odpl->deactivate_func(od);
+
+               read_persistent_clock(&b);
+
+               c = timespec_sub(b, a);
+               deact_lat = timespec_to_ns(&c);
+
+               dev_dbg(&od->pdev->dev,
+                       "omap_device: pm_lat %d: deactivate: elapsed time %llu nsec\n",
+                       od->pm_lat_level, deact_lat);
+
+               if (deact_lat > odpl->deactivate_lat) {
+                       odpl->deactivate_lat_worst = deact_lat;
+                       if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
+                               odpl->deactivate_lat = deact_lat;
+                               dev_dbg(&od->pdev->dev,
+                                       "new worst case deactivate latency %d: %llu\n",
+                                       od->pm_lat_level, deact_lat);
+                       } else
+                               dev_warn(&od->pdev->dev,
+                                        "deactivate latency %d higher than expected. (%llu > %d)\n",
+                                        od->pm_lat_level, deact_lat,
+                                        odpl->deactivate_lat);
+               }
+
+               od->dev_wakeup_lat += odpl->activate_lat;
+
+               od->pm_lat_level++;
+       }
+
+       return 0;
+}
+
+static void _add_clkdev(struct omap_device *od, const char *clk_alias,
+                      const char *clk_name)
+{
+       struct clk *r;
+       struct clk_lookup *l;
+
+       if (!clk_alias || !clk_name)
+               return;
+
+       dev_dbg(&od->pdev->dev, "Creating %s -> %s\n", clk_alias, clk_name);
+
+       r = clk_get_sys(dev_name(&od->pdev->dev), clk_alias);
+       if (!IS_ERR(r)) {
+               dev_warn(&od->pdev->dev,
+                        "alias %s already exists\n", clk_alias);
+               clk_put(r);
+               return;
+       }
+
+       r = clk_get(NULL, clk_name);
+       if (IS_ERR(r)) {
+               dev_err(&od->pdev->dev,
+                       "clk_get for %s failed\n", clk_name);
+               return;
+       }
+
+       l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev->dev));
+       if (!l) {
+               dev_err(&od->pdev->dev,
+                       "clkdev_alloc for %s failed\n", clk_alias);
+               return;
+       }
+
+       clkdev_add(l);
+}
+
+/**
+ * _add_hwmod_clocks_clkdev - Add clkdev entry for hwmod optional clocks
+ * and main clock
+ * @od: struct omap_device *od
+ * @oh: struct omap_hwmod *oh
+ *
+ * For the main clock and every optional clock present per hwmod per
+ * omap_device, this function adds an entry in the clkdev table of the
+ * form <dev-id=dev_name, con-id=role> if it does not exist already.
+ *
+ * The function is called from inside omap_device_build_ss(), after
+ * omap_device_register.
+ *
+ * This allows drivers to get a pointer to its optional clocks based on its role
+ * by calling clk_get(<dev*>, <role>).
+ * In the case of the main clock, a "fck" alias is used.
+ *
+ * No return value.
+ */
+static void _add_hwmod_clocks_clkdev(struct omap_device *od,
+                                    struct omap_hwmod *oh)
+{
+       int i;
+
+       _add_clkdev(od, "fck", oh->main_clk);
+
+       for (i = 0; i < oh->opt_clks_cnt; i++)
+               _add_clkdev(od, oh->opt_clks[i].role, oh->opt_clks[i].clk);
+}
+
+
+/**
+ * omap_device_build_from_dt - build an omap_device with multiple hwmods
+ * @pdev_name: name of the platform_device driver to use
+ * @pdev_id: this platform_device's connection ID
+ * @oh: ptr to the single omap_hwmod that backs this omap_device
+ * @pdata: platform_data ptr to associate with the platform_device
+ * @pdata_len: amount of memory pointed to by @pdata
+ * @pm_lats: pointer to a omap_device_pm_latency array for this device
+ * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
+ * @is_early_device: should the device be registered as an early device or not
+ *
+ * Function for building an omap_device already registered from device-tree
+ *
+ * Returns 0 or PTR_ERR() on error.
+ */
+static int omap_device_build_from_dt(struct platform_device *pdev)
+{
+       struct omap_hwmod **hwmods;
+       struct omap_device *od;
+       struct omap_hwmod *oh;
+       struct device_node *node = pdev->dev.of_node;
+       const char *oh_name;
+       int oh_cnt, i, ret = 0;
+
+       oh_cnt = of_property_count_strings(node, "ti,hwmods");
+       if (!oh_cnt || IS_ERR_VALUE(oh_cnt)) {
+               dev_dbg(&pdev->dev, "No 'hwmods' to build omap_device\n");
+               return -ENODEV;
+       }
+
+       hwmods = kzalloc(sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL);
+       if (!hwmods) {
+               ret = -ENOMEM;
+               goto odbfd_exit;
+       }
+
+       for (i = 0; i < oh_cnt; i++) {
+               of_property_read_string_index(node, "ti,hwmods", i, &oh_name);
+               oh = omap_hwmod_lookup(oh_name);
+               if (!oh) {
+                       dev_err(&pdev->dev, "Cannot lookup hwmod '%s'\n",
+                               oh_name);
+                       ret = -EINVAL;
+                       goto odbfd_exit1;
+               }
+               hwmods[i] = oh;
+       }
+
+       od = omap_device_alloc(pdev, hwmods, oh_cnt, NULL, 0);
+       if (!od) {
+               dev_err(&pdev->dev, "Cannot allocate omap_device for :%s\n",
+                       oh_name);
+               ret = PTR_ERR(od);
+               goto odbfd_exit1;
+       }
+
+       /* Fix up missing resource names */
+       for (i = 0; i < pdev->num_resources; i++) {
+               struct resource *r = &pdev->resource[i];
+
+               if (r->name == NULL)
+                       r->name = dev_name(&pdev->dev);
+       }
+
+       if (of_get_property(node, "ti,no_idle_on_suspend", NULL))
+               omap_device_disable_idle_on_suspend(pdev);
+
+       pdev->dev.pm_domain = &omap_device_pm_domain;
+
+odbfd_exit1:
+       kfree(hwmods);
+odbfd_exit:
+       return ret;
+}
+
+static int _omap_device_notifier_call(struct notifier_block *nb,
+                                     unsigned long event, void *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct omap_device *od;
+
+       switch (event) {
+       case BUS_NOTIFY_DEL_DEVICE:
+               if (pdev->archdata.od)
+                       omap_device_delete(pdev->archdata.od);
+               break;
+       case BUS_NOTIFY_ADD_DEVICE:
+               if (pdev->dev.of_node)
+                       omap_device_build_from_dt(pdev);
+               /* fall through */
+       default:
+               od = to_omap_device(pdev);
+               if (od)
+                       od->_driver_status = event;
+       }
+
+       return NOTIFY_DONE;
+}
+
+
+/* Public functions for use by core code */
+
+/**
+ * omap_device_get_context_loss_count - get lost context count
+ * @od: struct omap_device *
+ *
+ * Using the primary hwmod, query the context loss count for this
+ * device.
+ *
+ * Callers should consider context for this device lost any time this
+ * function returns a value different than the value the caller got
+ * the last time it called this function.
+ *
+ * If any hwmods exist for the omap_device assoiated with @pdev,
+ * return the context loss counter for that hwmod, otherwise return
+ * zero.
+ */
+int omap_device_get_context_loss_count(struct platform_device *pdev)
+{
+       struct omap_device *od;
+       u32 ret = 0;
+
+       od = to_omap_device(pdev);
+
+       if (od->hwmods_cnt)
+               ret = omap_hwmod_get_context_loss_count(od->hwmods[0]);
+
+       return ret;
+}
+
+/**
+ * omap_device_count_resources - count number of struct resource entries needed
+ * @od: struct omap_device *
+ *
+ * Count the number of struct resource entries needed for this
+ * omap_device @od.  Used by omap_device_build_ss() to determine how
+ * much memory to allocate before calling
+ * omap_device_fill_resources().  Returns the count.
+ */
+static int omap_device_count_resources(struct omap_device *od)
+{
+       int c = 0;
+       int i;
+
+       for (i = 0; i < od->hwmods_cnt; i++)
+               c += omap_hwmod_count_resources(od->hwmods[i]);
+
+       pr_debug("omap_device: %s: counted %d total resources across %d hwmods\n",
+                od->pdev->name, c, od->hwmods_cnt);
+
+       return c;
+}
+
+/**
+ * omap_device_fill_resources - fill in array of struct resource
+ * @od: struct omap_device *
+ * @res: pointer to an array of struct resource to be filled in
+ *
+ * Populate one or more empty struct resource pointed to by @res with
+ * the resource data for this omap_device @od.  Used by
+ * omap_device_build_ss() after calling omap_device_count_resources().
+ * Ideally this function would not be needed at all.  If omap_device
+ * replaces platform_device, then we can specify our own
+ * get_resource()/ get_irq()/etc functions that use the underlying
+ * omap_hwmod information.  Or if platform_device is extended to use
+ * subarchitecture-specific function pointers, the various
+ * platform_device functions can simply call omap_device internal
+ * functions to get device resources.  Hacking around the existing
+ * platform_device code wastes memory.  Returns 0.
+ */
+static int omap_device_fill_resources(struct omap_device *od,
+                                     struct resource *res)
+{
+       int i, r;
+
+       for (i = 0; i < od->hwmods_cnt; i++) {
+               r = omap_hwmod_fill_resources(od->hwmods[i], res);
+               res += r;
+       }
+
+       return 0;
+}
+
+/**
+ * _od_fill_dma_resources - fill in array of struct resource with dma resources
+ * @od: struct omap_device *
+ * @res: pointer to an array of struct resource to be filled in
+ *
+ * Populate one or more empty struct resource pointed to by @res with
+ * the dma resource data for this omap_device @od.  Used by
+ * omap_device_alloc() after calling omap_device_count_resources().
+ *
+ * Ideally this function would not be needed at all.  If we have
+ * mechanism to get dma resources from DT.
+ *
+ * Returns 0.
+ */
+static int _od_fill_dma_resources(struct omap_device *od,
+                                     struct resource *res)
+{
+       int i, r;
+
+       for (i = 0; i < od->hwmods_cnt; i++) {
+               r = omap_hwmod_fill_dma_resources(od->hwmods[i], res);
+               res += r;
+       }
+
+       return 0;
+}
+
+/**
+ * omap_device_alloc - allocate an omap_device
+ * @pdev: platform_device that will be included in this omap_device
+ * @oh: ptr to the single omap_hwmod that backs this omap_device
+ * @pdata: platform_data ptr to associate with the platform_device
+ * @pdata_len: amount of memory pointed to by @pdata
+ * @pm_lats: pointer to a omap_device_pm_latency array for this device
+ * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
+ *
+ * Convenience function for allocating an omap_device structure and filling
+ * hwmods, resources and pm_latency attributes.
+ *
+ * Returns an struct omap_device pointer or ERR_PTR() on error;
+ */
+struct omap_device *omap_device_alloc(struct platform_device *pdev,
+                                       struct omap_hwmod **ohs, int oh_cnt,
+                                       struct omap_device_pm_latency *pm_lats,
+                                       int pm_lats_cnt)
+{
+       int ret = -ENOMEM;
+       struct omap_device *od;
+       struct resource *res = NULL;
+       int i, res_count;
+       struct omap_hwmod **hwmods;
+
+       od = kzalloc(sizeof(struct omap_device), GFP_KERNEL);
+       if (!od) {
+               ret = -ENOMEM;
+               goto oda_exit1;
+       }
+       od->hwmods_cnt = oh_cnt;
+
+       hwmods = kmemdup(ohs, sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL);
+       if (!hwmods)
+               goto oda_exit2;
+
+       od->hwmods = hwmods;
+       od->pdev = pdev;
+
+       res_count = omap_device_count_resources(od);
+       /*
+        * DT Boot:
+        *   OF framework will construct the resource structure (currently
+        *   does for MEM & IRQ resource) and we should respect/use these
+        *   resources, killing hwmod dependency.
+        *   If pdev->num_resources > 0, we assume that MEM & IRQ resources
+        *   have been allocated by OF layer already (through DTB).
+        *
+        * Non-DT Boot:
+        *   Here, pdev->num_resources = 0, and we should get all the
+        *   resources from hwmod.
+        *
+        * TODO: Once DMA resource is available from OF layer, we should
+        *   kill filling any resources from hwmod.
+        */
+       if (res_count > pdev->num_resources) {
+               /* Allocate resources memory to account for new resources */
+               res = kzalloc(sizeof(struct resource) * res_count, GFP_KERNEL);
+               if (!res)
+                       goto oda_exit3;
+
+               /*
+                * If pdev->num_resources > 0, then assume that,
+                * MEM and IRQ resources will only come from DT and only
+                * fill DMA resource from hwmod layer.
+                */
+               if (pdev->num_resources && pdev->resource) {
+                       dev_dbg(&pdev->dev, "%s(): resources already allocated %d\n",
+                               __func__, res_count);
+                       memcpy(res, pdev->resource,
+                              sizeof(struct resource) * pdev->num_resources);
+                       _od_fill_dma_resources(od, &res[pdev->num_resources]);
+               } else {
+                       dev_dbg(&pdev->dev, "%s(): using resources from hwmod %d\n",
+                               __func__, res_count);
+                       omap_device_fill_resources(od, res);
+               }
+
+               ret = platform_device_add_resources(pdev, res, res_count);
+               kfree(res);
+
+               if (ret)
+                       goto oda_exit3;
+       }
+
+       if (!pm_lats) {
+               pm_lats = omap_default_latency;
+               pm_lats_cnt = ARRAY_SIZE(omap_default_latency);
+       }
+
+       od->pm_lats_cnt = pm_lats_cnt;
+       od->pm_lats = kmemdup(pm_lats,
+                       sizeof(struct omap_device_pm_latency) * pm_lats_cnt,
+                       GFP_KERNEL);
+       if (!od->pm_lats)
+               goto oda_exit3;
+
+       pdev->archdata.od = od;
+
+       for (i = 0; i < oh_cnt; i++) {
+               hwmods[i]->od = od;
+               _add_hwmod_clocks_clkdev(od, hwmods[i]);
+       }
+
+       return od;
+
+oda_exit3:
+       kfree(hwmods);
+oda_exit2:
+       kfree(od);
+oda_exit1:
+       dev_err(&pdev->dev, "omap_device: build failed (%d)\n", ret);
+
+       return ERR_PTR(ret);
+}
+
+void omap_device_delete(struct omap_device *od)
+{
+       if (!od)
+               return;
+
+       od->pdev->archdata.od = NULL;
+       kfree(od->pm_lats);
+       kfree(od->hwmods);
+       kfree(od);
+}
+
+/**
+ * omap_device_build - build and register an omap_device with one omap_hwmod
+ * @pdev_name: name of the platform_device driver to use
+ * @pdev_id: this platform_device's connection ID
+ * @oh: ptr to the single omap_hwmod that backs this omap_device
+ * @pdata: platform_data ptr to associate with the platform_device
+ * @pdata_len: amount of memory pointed to by @pdata
+ * @pm_lats: pointer to a omap_device_pm_latency array for this device
+ * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
+ * @is_early_device: should the device be registered as an early device or not
+ *
+ * Convenience function for building and registering a single
+ * omap_device record, which in turn builds and registers a
+ * platform_device record.  See omap_device_build_ss() for more
+ * information.  Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise,
+ * passes along the return value of omap_device_build_ss().
+ */
+struct platform_device __init *omap_device_build(const char *pdev_name, int pdev_id,
+                                     struct omap_hwmod *oh, void *pdata,
+                                     int pdata_len,
+                                     struct omap_device_pm_latency *pm_lats,
+                                     int pm_lats_cnt, int is_early_device)
+{
+       struct omap_hwmod *ohs[] = { oh };
+
+       if (!oh)
+               return ERR_PTR(-EINVAL);
+
+       return omap_device_build_ss(pdev_name, pdev_id, ohs, 1, pdata,
+                                   pdata_len, pm_lats, pm_lats_cnt,
+                                   is_early_device);
+}
+
+/**
+ * omap_device_build_ss - build and register an omap_device with multiple hwmods
+ * @pdev_name: name of the platform_device driver to use
+ * @pdev_id: this platform_device's connection ID
+ * @oh: ptr to the single omap_hwmod that backs this omap_device
+ * @pdata: platform_data ptr to associate with the platform_device
+ * @pdata_len: amount of memory pointed to by @pdata
+ * @pm_lats: pointer to a omap_device_pm_latency array for this device
+ * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
+ * @is_early_device: should the device be registered as an early device or not
+ *
+ * Convenience function for building and registering an omap_device
+ * subsystem record.  Subsystem records consist of multiple
+ * omap_hwmods.  This function in turn builds and registers a
+ * platform_device record.  Returns an ERR_PTR() on error, or passes
+ * along the return value of omap_device_register().
+ */
+struct platform_device __init *omap_device_build_ss(const char *pdev_name, int pdev_id,
+                                        struct omap_hwmod **ohs, int oh_cnt,
+                                        void *pdata, int pdata_len,
+                                        struct omap_device_pm_latency *pm_lats,
+                                        int pm_lats_cnt, int is_early_device)
+{
+       int ret = -ENOMEM;
+       struct platform_device *pdev;
+       struct omap_device *od;
+
+       if (!ohs || oh_cnt == 0 || !pdev_name)
+               return ERR_PTR(-EINVAL);
+
+       if (!pdata && pdata_len > 0)
+               return ERR_PTR(-EINVAL);
+
+       pdev = platform_device_alloc(pdev_name, pdev_id);
+       if (!pdev) {
+               ret = -ENOMEM;
+               goto odbs_exit;
+       }
+
+       /* Set the dev_name early to allow dev_xxx in omap_device_alloc */
+       if (pdev->id != -1)
+               dev_set_name(&pdev->dev, "%s.%d", pdev->name,  pdev->id);
+       else
+               dev_set_name(&pdev->dev, "%s", pdev->name);
+
+       od = omap_device_alloc(pdev, ohs, oh_cnt, pm_lats, pm_lats_cnt);
+       if (IS_ERR(od))
+               goto odbs_exit1;
+
+       ret = platform_device_add_data(pdev, pdata, pdata_len);
+       if (ret)
+               goto odbs_exit2;
+
+       if (is_early_device)
+               ret = omap_early_device_register(pdev);
+       else
+               ret = omap_device_register(pdev);
+       if (ret)
+               goto odbs_exit2;
+
+       return pdev;
+
+odbs_exit2:
+       omap_device_delete(od);
+odbs_exit1:
+       platform_device_put(pdev);
+odbs_exit:
+
+       pr_err("omap_device: %s: build failed (%d)\n", pdev_name, ret);
+
+       return ERR_PTR(ret);
+}
+
+/**
+ * omap_early_device_register - register an omap_device as an early platform
+ * device.
+ * @od: struct omap_device * to register
+ *
+ * Register the omap_device structure.  This currently just calls
+ * platform_early_add_device() on the underlying platform_device.
+ * Returns 0 by default.
+ */
+static int __init omap_early_device_register(struct platform_device *pdev)
+{
+       struct platform_device *devices[1];
+
+       devices[0] = pdev;
+       early_platform_add_devices(devices, 1);
+       return 0;
+}
+
+#ifdef CONFIG_PM_RUNTIME
+static int _od_runtime_suspend(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       int ret;
+
+       ret = pm_generic_runtime_suspend(dev);
+
+       if (!ret)
+               omap_device_idle(pdev);
+
+       return ret;
+}
+
+static int _od_runtime_idle(struct device *dev)
+{
+       return pm_generic_runtime_idle(dev);
+}
+
+static int _od_runtime_resume(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+
+       omap_device_enable(pdev);
+
+       return pm_generic_runtime_resume(dev);
+}
+#endif
+
+#ifdef CONFIG_SUSPEND
+static int _od_suspend_noirq(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct omap_device *od = to_omap_device(pdev);
+       int ret;
+
+       /* Don't attempt late suspend on a driver that is not bound */
+       if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER)
+               return 0;
+
+       ret = pm_generic_suspend_noirq(dev);
+
+       if (!ret && !pm_runtime_status_suspended(dev)) {
+               if (pm_generic_runtime_suspend(dev) == 0) {
+                       if (!(od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND))
+                               omap_device_idle(pdev);
+                       od->flags |= OMAP_DEVICE_SUSPENDED;
+               }
+       }
+
+       return ret;
+}
+
+static int _od_resume_noirq(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct omap_device *od = to_omap_device(pdev);
+
+       if ((od->flags & OMAP_DEVICE_SUSPENDED) &&
+           !pm_runtime_status_suspended(dev)) {
+               od->flags &= ~OMAP_DEVICE_SUSPENDED;
+               if (!(od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND))
+                       omap_device_enable(pdev);
+               pm_generic_runtime_resume(dev);
+       }
+
+       return pm_generic_resume_noirq(dev);
+}
+#else
+#define _od_suspend_noirq NULL
+#define _od_resume_noirq NULL
+#endif
+
+struct dev_pm_domain omap_device_pm_domain = {
+       .ops = {
+               SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume,
+                                  _od_runtime_idle)
+               USE_PLATFORM_PM_SLEEP_OPS
+               .suspend_noirq = _od_suspend_noirq,
+               .resume_noirq = _od_resume_noirq,
+       }
+};
+
+/**
+ * omap_device_register - register an omap_device with one omap_hwmod
+ * @od: struct omap_device * to register
+ *
+ * Register the omap_device structure.  This currently just calls
+ * platform_device_register() on the underlying platform_device.
+ * Returns the return value of platform_device_register().
+ */
+int omap_device_register(struct platform_device *pdev)
+{
+       pr_debug("omap_device: %s: registering\n", pdev->name);
+
+       pdev->dev.pm_domain = &omap_device_pm_domain;
+       return platform_device_add(pdev);
+}
+
+
+/* Public functions for use by device drivers through struct platform_data */
+
+/**
+ * omap_device_enable - fully activate an omap_device
+ * @od: struct omap_device * to activate
+ *
+ * Do whatever is necessary for the hwmods underlying omap_device @od
+ * to be accessible and ready to operate.  This generally involves
+ * enabling clocks, setting SYSCONFIG registers; and in the future may
+ * involve remuxing pins.  Device drivers should call this function
+ * (through platform_data function pointers) where they would normally
+ * enable clocks, etc.  Returns -EINVAL if called when the omap_device
+ * is already enabled, or passes along the return value of
+ * _omap_device_activate().
+ */
+int omap_device_enable(struct platform_device *pdev)
+{
+       int ret;
+       struct omap_device *od;
+
+       od = to_omap_device(pdev);
+
+       if (od->_state == OMAP_DEVICE_STATE_ENABLED) {
+               dev_warn(&pdev->dev,
+                        "omap_device: %s() called from invalid state %d\n",
+                        __func__, od->_state);
+               return -EINVAL;
+       }
+
+       /* Enable everything if we're enabling this device from scratch */
+       if (od->_state == OMAP_DEVICE_STATE_UNKNOWN)
+               od->pm_lat_level = od->pm_lats_cnt;
+
+       ret = _omap_device_activate(od, IGNORE_WAKEUP_LAT);
+
+       od->dev_wakeup_lat = 0;
+       od->_dev_wakeup_lat_limit = UINT_MAX;
+       od->_state = OMAP_DEVICE_STATE_ENABLED;
+
+       return ret;
+}
+
+/**
+ * omap_device_idle - idle an omap_device
+ * @od: struct omap_device * to idle
+ *
+ * Idle omap_device @od by calling as many .deactivate_func() entries
+ * in the omap_device's pm_lats table as is possible without exceeding
+ * the device's maximum wakeup latency limit, pm_lat_limit.  Device
+ * drivers should call this function (through platform_data function
+ * pointers) where they would normally disable clocks after operations
+ * complete, etc..  Returns -EINVAL if the omap_device is not
+ * currently enabled, or passes along the return value of
+ * _omap_device_deactivate().
+ */
+int omap_device_idle(struct platform_device *pdev)
+{
+       int ret;
+       struct omap_device *od;
+
+       od = to_omap_device(pdev);
+
+       if (od->_state != OMAP_DEVICE_STATE_ENABLED) {
+               dev_warn(&pdev->dev,
+                        "omap_device: %s() called from invalid state %d\n",
+                        __func__, od->_state);
+               return -EINVAL;
+       }
+
+       ret = _omap_device_deactivate(od, USE_WAKEUP_LAT);
+
+       od->_state = OMAP_DEVICE_STATE_IDLE;
+
+       return ret;
+}
+
+/**
+ * omap_device_shutdown - shut down an omap_device
+ * @od: struct omap_device * to shut down
+ *
+ * Shut down omap_device @od by calling all .deactivate_func() entries
+ * in the omap_device's pm_lats table and then shutting down all of
+ * the underlying omap_hwmods.  Used when a device is being "removed"
+ * or a device driver is being unloaded.  Returns -EINVAL if the
+ * omap_device is not currently enabled or idle, or passes along the
+ * return value of _omap_device_deactivate().
+ */
+int omap_device_shutdown(struct platform_device *pdev)
+{
+       int ret, i;
+       struct omap_device *od;
+
+       od = to_omap_device(pdev);
+
+       if (od->_state != OMAP_DEVICE_STATE_ENABLED &&
+           od->_state != OMAP_DEVICE_STATE_IDLE) {
+               dev_warn(&pdev->dev,
+                        "omap_device: %s() called from invalid state %d\n",
+                        __func__, od->_state);
+               return -EINVAL;
+       }
+
+       ret = _omap_device_deactivate(od, IGNORE_WAKEUP_LAT);
+
+       for (i = 0; i < od->hwmods_cnt; i++)
+               omap_hwmod_shutdown(od->hwmods[i]);
+
+       od->_state = OMAP_DEVICE_STATE_SHUTDOWN;
+
+       return ret;
+}
+
+/**
+ * omap_device_assert_hardreset - set a device's hardreset line
+ * @pdev: struct platform_device * to reset
+ * @name: const char * name of the reset line
+ *
+ * Set the hardreset line identified by @name on the IP blocks
+ * associated with the hwmods backing the platform_device @pdev.  All
+ * of the hwmods associated with @pdev must have the same hardreset
+ * line linked to them for this to work.  Passes along the return value
+ * of omap_hwmod_assert_hardreset() in the event of any failure, or
+ * returns 0 upon success.
+ */
+int omap_device_assert_hardreset(struct platform_device *pdev, const char *name)
+{
+       struct omap_device *od = to_omap_device(pdev);
+       int ret = 0;
+       int i;
+
+       for (i = 0; i < od->hwmods_cnt; i++) {
+               ret = omap_hwmod_assert_hardreset(od->hwmods[i], name);
+               if (ret)
+                       break;
+       }
+
+       return ret;
+}
+
+/**
+ * omap_device_deassert_hardreset - release a device's hardreset line
+ * @pdev: struct platform_device * to reset
+ * @name: const char * name of the reset line
+ *
+ * Release the hardreset line identified by @name on the IP blocks
+ * associated with the hwmods backing the platform_device @pdev.  All
+ * of the hwmods associated with @pdev must have the same hardreset
+ * line linked to them for this to work.  Passes along the return
+ * value of omap_hwmod_deassert_hardreset() in the event of any
+ * failure, or returns 0 upon success.
+ */
+int omap_device_deassert_hardreset(struct platform_device *pdev,
+                                  const char *name)
+{
+       struct omap_device *od = to_omap_device(pdev);
+       int ret = 0;
+       int i;
+
+       for (i = 0; i < od->hwmods_cnt; i++) {
+               ret = omap_hwmod_deassert_hardreset(od->hwmods[i], name);
+               if (ret)
+                       break;
+       }
+
+       return ret;
+}
+
+/**
+ * omap_device_align_pm_lat - activate/deactivate device to match wakeup lat lim
+ * @od: struct omap_device *
+ *
+ * When a device's maximum wakeup latency limit changes, call some of
+ * the .activate_func or .deactivate_func function pointers in the
+ * omap_device's pm_lats array to ensure that the device's maximum
+ * wakeup latency is less than or equal to the new latency limit.
+ * Intended to be called by OMAP PM code whenever a device's maximum
+ * wakeup latency limit changes (e.g., via
+ * omap_pm_set_dev_wakeup_lat()).  Returns 0 if nothing needs to be
+ * done (e.g., if the omap_device is not currently idle, or if the
+ * wakeup latency is already current with the new limit) or passes
+ * along the return value of _omap_device_deactivate() or
+ * _omap_device_activate().
+ */
+int omap_device_align_pm_lat(struct platform_device *pdev,
+                            u32 new_wakeup_lat_limit)
+{
+       int ret = -EINVAL;
+       struct omap_device *od;
+
+       od = to_omap_device(pdev);
+
+       if (new_wakeup_lat_limit == od->dev_wakeup_lat)
+               return 0;
+
+       od->_dev_wakeup_lat_limit = new_wakeup_lat_limit;
+
+       if (od->_state != OMAP_DEVICE_STATE_IDLE)
+               return 0;
+       else if (new_wakeup_lat_limit > od->dev_wakeup_lat)
+               ret = _omap_device_deactivate(od, USE_WAKEUP_LAT);
+       else if (new_wakeup_lat_limit < od->dev_wakeup_lat)
+               ret = _omap_device_activate(od, USE_WAKEUP_LAT);
+
+       return ret;
+}
+
+/**
+ * omap_device_get_pwrdm - return the powerdomain * associated with @od
+ * @od: struct omap_device *
+ *
+ * Return the powerdomain associated with the first underlying
+ * omap_hwmod for this omap_device.  Intended for use by core OMAP PM
+ * code.  Returns NULL on error or a struct powerdomain * upon
+ * success.
+ */
+struct powerdomain *omap_device_get_pwrdm(struct omap_device *od)
+{
+       /*
+        * XXX Assumes that all omap_hwmod powerdomains are identical.
+        * This may not necessarily be true.  There should be a sanity
+        * check in here to WARN() if any difference appears.
+        */
+       if (!od->hwmods_cnt)
+               return NULL;
+
+       return omap_hwmod_get_pwrdm(od->hwmods[0]);
+}
+
+/**
+ * omap_device_get_mpu_rt_va - return the MPU's virtual addr for the hwmod base
+ * @od: struct omap_device *
+ *
+ * Return the MPU's virtual address for the base of the hwmod, from
+ * the ioremap() that the hwmod code does.  Only valid if there is one
+ * hwmod associated with this device.  Returns NULL if there are zero
+ * or more than one hwmods associated with this omap_device;
+ * otherwise, passes along the return value from
+ * omap_hwmod_get_mpu_rt_va().
+ */
+void __iomem *omap_device_get_rt_va(struct omap_device *od)
+{
+       if (od->hwmods_cnt != 1)
+               return NULL;
+
+       return omap_hwmod_get_mpu_rt_va(od->hwmods[0]);
+}
+
+/**
+ * omap_device_get_by_hwmod_name() - convert a hwmod name to
+ * device pointer.
+ * @oh_name: name of the hwmod device
+ *
+ * Returns back a struct device * pointer associated with a hwmod
+ * device represented by a hwmod_name
+ */
+struct device *omap_device_get_by_hwmod_name(const char *oh_name)
+{
+       struct omap_hwmod *oh;
+
+       if (!oh_name) {
+               WARN(1, "%s: no hwmod name!\n", __func__);
+               return ERR_PTR(-EINVAL);
+       }
+
+       oh = omap_hwmod_lookup(oh_name);
+       if (IS_ERR_OR_NULL(oh)) {
+               WARN(1, "%s: no hwmod for %s\n", __func__,
+                       oh_name);
+               return ERR_PTR(oh ? PTR_ERR(oh) : -ENODEV);
+       }
+       if (IS_ERR_OR_NULL(oh->od)) {
+               WARN(1, "%s: no omap_device for %s\n", __func__,
+                       oh_name);
+               return ERR_PTR(oh->od ? PTR_ERR(oh->od) : -ENODEV);
+       }
+
+       if (IS_ERR_OR_NULL(oh->od->pdev))
+               return ERR_PTR(oh->od->pdev ? PTR_ERR(oh->od->pdev) : -ENODEV);
+
+       return &oh->od->pdev->dev;
+}
+EXPORT_SYMBOL(omap_device_get_by_hwmod_name);
+
+/*
+ * Public functions intended for use in omap_device_pm_latency
+ * .activate_func and .deactivate_func function pointers
+ */
+
+/**
+ * omap_device_enable_hwmods - call omap_hwmod_enable() on all hwmods
+ * @od: struct omap_device *od
+ *
+ * Enable all underlying hwmods.  Returns 0.
+ */
+int omap_device_enable_hwmods(struct omap_device *od)
+{
+       int i;
+
+       for (i = 0; i < od->hwmods_cnt; i++)
+               omap_hwmod_enable(od->hwmods[i]);
+
+       /* XXX pass along return value here? */
+       return 0;
+}
+
+/**
+ * omap_device_idle_hwmods - call omap_hwmod_idle() on all hwmods
+ * @od: struct omap_device *od
+ *
+ * Idle all underlying hwmods.  Returns 0.
+ */
+int omap_device_idle_hwmods(struct omap_device *od)
+{
+       int i;
+
+       for (i = 0; i < od->hwmods_cnt; i++)
+               omap_hwmod_idle(od->hwmods[i]);
+
+       /* XXX pass along return value here? */
+       return 0;
+}
+
+/**
+ * omap_device_disable_clocks - disable all main and interface clocks
+ * @od: struct omap_device *od
+ *
+ * Disable the main functional clock and interface clock for all of the
+ * omap_hwmods associated with the omap_device.  Returns 0.
+ */
+int omap_device_disable_clocks(struct omap_device *od)
+{
+       int i;
+
+       for (i = 0; i < od->hwmods_cnt; i++)
+               omap_hwmod_disable_clocks(od->hwmods[i]);
+
+       /* XXX pass along return value here? */
+       return 0;
+}
+
+/**
+ * omap_device_enable_clocks - enable all main and interface clocks
+ * @od: struct omap_device *od
+ *
+ * Enable the main functional clock and interface clock for all of the
+ * omap_hwmods associated with the omap_device.  Returns 0.
+ */
+int omap_device_enable_clocks(struct omap_device *od)
+{
+       int i;
+
+       for (i = 0; i < od->hwmods_cnt; i++)
+               omap_hwmod_enable_clocks(od->hwmods[i]);
+
+       /* XXX pass along return value here? */
+       return 0;
+}
+
+static struct notifier_block platform_nb = {
+       .notifier_call = _omap_device_notifier_call,
+};
+
+static int __init omap_device_init(void)
+{
+       bus_register_notifier(&platform_bus_type, &platform_nb);
+       return 0;
+}
+core_initcall(omap_device_init);
+
+/**
+ * omap_device_late_idle - idle devices without drivers
+ * @dev: struct device * associated with omap_device
+ * @data: unused
+ *
+ * Check the driver bound status of this device, and idle it
+ * if there is no driver attached.
+ */
+static int __init omap_device_late_idle(struct device *dev, void *data)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct omap_device *od = to_omap_device(pdev);
+
+       if (!od)
+               return 0;
+
+       /*
+        * If omap_device state is enabled, but has no driver bound,
+        * idle it.
+        */
+       if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER) {
+               if (od->_state == OMAP_DEVICE_STATE_ENABLED) {
+                       dev_warn(dev, "%s: enabled but no driver.  Idling\n",
+                                __func__);
+                       omap_device_idle(pdev);
+               }
+       }
+
+       return 0;
+}
+
+static int __init omap_device_late_init(void)
+{
+       bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle);
+       return 0;
+}
+late_initcall(omap_device_late_init);
diff --git a/arch/arm/mach-omap2/omap_device.h b/arch/arm/mach-omap2/omap_device.h
new file mode 100644 (file)
index 0000000..0933c59
--- /dev/null
@@ -0,0 +1,176 @@
+/*
+ * omap_device headers
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Paul Walmsley
+ *
+ * Developed in collaboration with (alphabetical order): Benoit
+ * Cousson, Kevin Hilman, Tony Lindgren, Rajendra Nayak, Vikram
+ * Pandita, Sakari Poussa, Anand Sawant, Santosh Shilimkar, Richard
+ * Woodruff
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Eventually this type of functionality should either be
+ * a) implemented via arch-specific pointers in platform_device
+ * or
+ * b) implemented as a proper omap_bus/omap_device in Linux, no more
+ *    platform_device
+ *
+ * omap_device differs from omap_hwmod in that it includes external
+ * (e.g., board- and system-level) integration details.  omap_hwmod
+ * stores hardware data that is invariant for a given OMAP chip.
+ *
+ * To do:
+ * - GPIO integration
+ * - regulator integration
+ *
+ */
+#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H
+#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+
+#include "omap_hwmod.h"
+
+extern struct dev_pm_domain omap_device_pm_domain;
+
+/* omap_device._state values */
+#define OMAP_DEVICE_STATE_UNKNOWN      0
+#define OMAP_DEVICE_STATE_ENABLED      1
+#define OMAP_DEVICE_STATE_IDLE         2
+#define OMAP_DEVICE_STATE_SHUTDOWN     3
+
+/* omap_device.flags values */
+#define OMAP_DEVICE_SUSPENDED BIT(0)
+#define OMAP_DEVICE_NO_IDLE_ON_SUSPEND BIT(1)
+
+/**
+ * struct omap_device - omap_device wrapper for platform_devices
+ * @pdev: platform_device
+ * @hwmods: (one .. many per omap_device)
+ * @hwmods_cnt: ARRAY_SIZE() of @hwmods
+ * @pm_lats: ptr to an omap_device_pm_latency table
+ * @pm_lats_cnt: ARRAY_SIZE() of what is passed to @pm_lats
+ * @pm_lat_level: array index of the last odpl entry executed - -1 if never
+ * @dev_wakeup_lat: dev wakeup latency in nanoseconds
+ * @_dev_wakeup_lat_limit: dev wakeup latency limit in nsec - set by OMAP PM
+ * @_state: one of OMAP_DEVICE_STATE_* (see above)
+ * @flags: device flags
+ * @_driver_status: one of BUS_NOTIFY_*_DRIVER from <linux/device.h>
+ *
+ * Integrates omap_hwmod data into Linux platform_device.
+ *
+ * Field names beginning with underscores are for the internal use of
+ * the omap_device code.
+ *
+ */
+struct omap_device {
+       struct platform_device          *pdev;
+       struct omap_hwmod               **hwmods;
+       struct omap_device_pm_latency   *pm_lats;
+       u32                             dev_wakeup_lat;
+       u32                             _dev_wakeup_lat_limit;
+       unsigned long                   _driver_status;
+       u8                              pm_lats_cnt;
+       s8                              pm_lat_level;
+       u8                              hwmods_cnt;
+       u8                              _state;
+       u8                              flags;
+};
+
+/* Device driver interface (call via platform_data fn ptrs) */
+
+int omap_device_enable(struct platform_device *pdev);
+int omap_device_idle(struct platform_device *pdev);
+int omap_device_shutdown(struct platform_device *pdev);
+
+/* Core code interface */
+
+struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
+                                     struct omap_hwmod *oh, void *pdata,
+                                     int pdata_len,
+                                     struct omap_device_pm_latency *pm_lats,
+                                     int pm_lats_cnt, int is_early_device);
+
+struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
+                                        struct omap_hwmod **oh, int oh_cnt,
+                                        void *pdata, int pdata_len,
+                                        struct omap_device_pm_latency *pm_lats,
+                                        int pm_lats_cnt, int is_early_device);
+
+struct omap_device *omap_device_alloc(struct platform_device *pdev,
+                                     struct omap_hwmod **ohs, int oh_cnt,
+                                     struct omap_device_pm_latency *pm_lats,
+                                     int pm_lats_cnt);
+void omap_device_delete(struct omap_device *od);
+int omap_device_register(struct platform_device *pdev);
+
+void __iomem *omap_device_get_rt_va(struct omap_device *od);
+struct device *omap_device_get_by_hwmod_name(const char *oh_name);
+
+/* OMAP PM interface */
+int omap_device_align_pm_lat(struct platform_device *pdev,
+                            u32 new_wakeup_lat_limit);
+struct powerdomain *omap_device_get_pwrdm(struct omap_device *od);
+int omap_device_get_context_loss_count(struct platform_device *pdev);
+
+/* Other */
+
+int omap_device_assert_hardreset(struct platform_device *pdev,
+                                const char *name);
+int omap_device_deassert_hardreset(struct platform_device *pdev,
+                                const char *name);
+int omap_device_idle_hwmods(struct omap_device *od);
+int omap_device_enable_hwmods(struct omap_device *od);
+
+int omap_device_disable_clocks(struct omap_device *od);
+int omap_device_enable_clocks(struct omap_device *od);
+
+/*
+ * Entries should be kept in latency order ascending
+ *
+ * deact_lat is the maximum number of microseconds required to complete
+ * deactivate_func() at the device's slowest OPP.
+ *
+ * act_lat is the maximum number of microseconds required to complete
+ * activate_func() at the device's slowest OPP.
+ *
+ * This will result in some suboptimal power management decisions at fast
+ * OPPs, but avoids having to recompute all device power management decisions
+ * if the system shifts from a fast OPP to a slow OPP (in order to meet
+ * latency requirements).
+ *
+ * XXX should deactivate_func/activate_func() take platform_device pointers
+ * rather than omap_device pointers?
+ */
+struct omap_device_pm_latency {
+       u32 deactivate_lat;
+       u32 deactivate_lat_worst;
+       int (*deactivate_func)(struct omap_device *od);
+       u32 activate_lat;
+       u32 activate_lat_worst;
+       int (*activate_func)(struct omap_device *od);
+       u32 flags;
+};
+
+#define OMAP_DEVICE_LATENCY_AUTO_ADJUST BIT(1)
+
+/* Get omap_device pointer from platform_device pointer */
+static inline struct omap_device *to_omap_device(struct platform_device *pdev)
+{
+       return pdev ? pdev->archdata.od : NULL;
+}
+
+static inline
+void omap_device_disable_idle_on_suspend(struct platform_device *pdev)
+{
+       struct omap_device *od = to_omap_device(pdev);
+
+       od->flags |= OMAP_DEVICE_NO_IDLE_ON_SUSPEND;
+}
+
+#endif
index b969ab1d258b91894415c3507bd8b50cd2aefa50..87eee3b62a3cdd4ae0824c75b46e35ac30056d6a 100644 (file)
 #include <linux/slab.h>
 #include <linux/bootmem.h>
 
-#include <plat/clock.h>
-#include <plat/omap_hwmod.h>
+#include "clock.h"
+#include "omap_hwmod.h"
 #include <plat/prcm.h>
 
 #include "soc.h"
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
new file mode 100644 (file)
index 0000000..87b59b4
--- /dev/null
@@ -0,0 +1,675 @@
+/*
+ * omap_hwmod macros, structures
+ *
+ * Copyright (C) 2009-2011 Nokia Corporation
+ * Copyright (C) 2012 Texas Instruments, Inc.
+ * Paul Walmsley
+ *
+ * Created in collaboration with (alphabetical order): Benoît Cousson,
+ * Kevin Hilman, Tony Lindgren, Rajendra Nayak, Vikram Pandita, Sakari
+ * Poussa, Anand Sawant, Santosh Shilimkar, Richard Woodruff
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * These headers and macros are used to define OMAP on-chip module
+ * data and their integration with other OMAP modules and Linux.
+ * Copious documentation and references can also be found in the
+ * omap_hwmod code, in arch/arm/mach-omap2/omap_hwmod.c (as of this
+ * writing).
+ *
+ * To do:
+ * - add interconnect error log structures
+ * - add pinmuxing
+ * - init_conn_id_bit (CONNID_BIT_VECTOR)
+ * - implement default hwmod SMS/SDRC flags?
+ * - move Linux-specific data ("non-ROM data") out
+ *
+ */
+#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
+#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/list.h>
+#include <linux/ioport.h>
+#include <linux/spinlock.h>
+
+struct omap_device;
+
+extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type1;
+extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2;
+extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type3;
+
+/*
+ * OCP SYSCONFIG bit shifts/masks TYPE1. These are for IPs compliant
+ * with the original PRCM protocol defined for OMAP2420
+ */
+#define SYSC_TYPE1_MIDLEMODE_SHIFT     12
+#define SYSC_TYPE1_MIDLEMODE_MASK      (0x3 << SYSC_TYPE1_MIDLEMODE_SHIFT)
+#define SYSC_TYPE1_CLOCKACTIVITY_SHIFT 8
+#define SYSC_TYPE1_CLOCKACTIVITY_MASK  (0x3 << SYSC_TYPE1_CLOCKACTIVITY_SHIFT)
+#define SYSC_TYPE1_SIDLEMODE_SHIFT     3
+#define SYSC_TYPE1_SIDLEMODE_MASK      (0x3 << SYSC_TYPE1_SIDLEMODE_SHIFT)
+#define SYSC_TYPE1_ENAWAKEUP_SHIFT     2
+#define SYSC_TYPE1_ENAWAKEUP_MASK      (1 << SYSC_TYPE1_ENAWAKEUP_SHIFT)
+#define SYSC_TYPE1_SOFTRESET_SHIFT     1
+#define SYSC_TYPE1_SOFTRESET_MASK      (1 << SYSC_TYPE1_SOFTRESET_SHIFT)
+#define SYSC_TYPE1_AUTOIDLE_SHIFT      0
+#define SYSC_TYPE1_AUTOIDLE_MASK       (1 << SYSC_TYPE1_AUTOIDLE_SHIFT)
+
+/*
+ * OCP SYSCONFIG bit shifts/masks TYPE2. These are for IPs compliant
+ * with the new PRCM protocol defined for new OMAP4 IPs.
+ */
+#define SYSC_TYPE2_SOFTRESET_SHIFT     0
+#define SYSC_TYPE2_SOFTRESET_MASK      (1 << SYSC_TYPE2_SOFTRESET_SHIFT)
+#define SYSC_TYPE2_SIDLEMODE_SHIFT     2
+#define SYSC_TYPE2_SIDLEMODE_MASK      (0x3 << SYSC_TYPE2_SIDLEMODE_SHIFT)
+#define SYSC_TYPE2_MIDLEMODE_SHIFT     4
+#define SYSC_TYPE2_MIDLEMODE_MASK      (0x3 << SYSC_TYPE2_MIDLEMODE_SHIFT)
+#define SYSC_TYPE2_DMADISABLE_SHIFT    16
+#define SYSC_TYPE2_DMADISABLE_MASK     (0x1 << SYSC_TYPE2_DMADISABLE_SHIFT)
+
+/*
+ * OCP SYSCONFIG bit shifts/masks TYPE3.
+ * This is applicable for some IPs present in AM33XX
+ */
+#define SYSC_TYPE3_SIDLEMODE_SHIFT     0
+#define SYSC_TYPE3_SIDLEMODE_MASK      (0x3 << SYSC_TYPE3_SIDLEMODE_SHIFT)
+#define SYSC_TYPE3_MIDLEMODE_SHIFT     2
+#define SYSC_TYPE3_MIDLEMODE_MASK      (0x3 << SYSC_TYPE3_MIDLEMODE_SHIFT)
+
+/* OCP SYSSTATUS bit shifts/masks */
+#define SYSS_RESETDONE_SHIFT           0
+#define SYSS_RESETDONE_MASK            (1 << SYSS_RESETDONE_SHIFT)
+
+/* Master standby/slave idle mode flags */
+#define HWMOD_IDLEMODE_FORCE           (1 << 0)
+#define HWMOD_IDLEMODE_NO              (1 << 1)
+#define HWMOD_IDLEMODE_SMART           (1 << 2)
+#define HWMOD_IDLEMODE_SMART_WKUP      (1 << 3)
+
+/* modulemode control type (SW or HW) */
+#define MODULEMODE_HWCTRL              1
+#define MODULEMODE_SWCTRL              2
+
+
+/**
+ * struct omap_hwmod_mux_info - hwmod specific mux configuration
+ * @pads:              array of omap_device_pad entries
+ * @nr_pads:           number of omap_device_pad entries
+ *
+ * Note that this is currently built during init as needed.
+ */
+struct omap_hwmod_mux_info {
+       int                             nr_pads;
+       struct omap_device_pad          *pads;
+       int                             nr_pads_dynamic;
+       struct omap_device_pad          **pads_dynamic;
+       int                             *irqs;
+       bool                            enabled;
+};
+
+/**
+ * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod
+ * @name: name of the IRQ channel (module local name)
+ * @irq: IRQ channel ID (should be non-negative except -1 = terminator)
+ *
+ * @name should be something short, e.g., "tx" or "rx".  It is for use
+ * by platform_get_resource_byname().  It is defined locally to the
+ * hwmod.
+ */
+struct omap_hwmod_irq_info {
+       const char      *name;
+       s16             irq;
+};
+
+/**
+ * struct omap_hwmod_dma_info - DMA channels used by the hwmod
+ * @name: name of the DMA channel (module local name)
+ * @dma_req: DMA request ID (should be non-negative except -1 = terminator)
+ *
+ * @name should be something short, e.g., "tx" or "rx".  It is for use
+ * by platform_get_resource_byname().  It is defined locally to the
+ * hwmod.
+ */
+struct omap_hwmod_dma_info {
+       const char      *name;
+       s16             dma_req;
+};
+
+/**
+ * struct omap_hwmod_rst_info - IPs reset lines use by hwmod
+ * @name: name of the reset line (module local name)
+ * @rst_shift: Offset of the reset bit
+ * @st_shift: Offset of the reset status bit (OMAP2/3 only)
+ *
+ * @name should be something short, e.g., "cpu0" or "rst". It is defined
+ * locally to the hwmod.
+ */
+struct omap_hwmod_rst_info {
+       const char      *name;
+       u8              rst_shift;
+       u8              st_shift;
+};
+
+/**
+ * struct omap_hwmod_opt_clk - optional clocks used by this hwmod
+ * @role: "sys", "32k", "tv", etc -- for use in clk_get()
+ * @clk: opt clock: OMAP clock name
+ * @_clk: pointer to the struct clk (filled in at runtime)
+ *
+ * The module's interface clock and main functional clock should not
+ * be added as optional clocks.
+ */
+struct omap_hwmod_opt_clk {
+       const char      *role;
+       const char      *clk;
+       struct clk      *_clk;
+};
+
+
+/* omap_hwmod_omap2_firewall.flags bits */
+#define OMAP_FIREWALL_L3               (1 << 0)
+#define OMAP_FIREWALL_L4               (1 << 1)
+
+/**
+ * struct omap_hwmod_omap2_firewall - OMAP2/3 device firewall data
+ * @l3_perm_bit: bit shift for L3_PM_*_PERMISSION_*
+ * @l4_fw_region: L4 firewall region ID
+ * @l4_prot_group: L4 protection group ID
+ * @flags: (see omap_hwmod_omap2_firewall.flags macros above)
+ */
+struct omap_hwmod_omap2_firewall {
+       u8 l3_perm_bit;
+       u8 l4_fw_region;
+       u8 l4_prot_group;
+       u8 flags;
+};
+
+
+/*
+ * omap_hwmod_addr_space.flags bits
+ *
+ * ADDR_MAP_ON_INIT: Map this address space during omap_hwmod init.
+ * ADDR_TYPE_RT: Address space contains module register target data.
+ */
+#define ADDR_MAP_ON_INIT       (1 << 0)        /* XXX does not belong */
+#define ADDR_TYPE_RT           (1 << 1)
+
+/**
+ * struct omap_hwmod_addr_space - address space handled by the hwmod
+ * @name: name of the address space
+ * @pa_start: starting physical address
+ * @pa_end: ending physical address
+ * @flags: (see omap_hwmod_addr_space.flags macros above)
+ *
+ * Address space doesn't necessarily follow physical interconnect
+ * structure.  GPMC is one example.
+ */
+struct omap_hwmod_addr_space {
+       const char *name;
+       u32 pa_start;
+       u32 pa_end;
+       u8 flags;
+};
+
+
+/*
+ * omap_hwmod_ocp_if.user bits: these indicate the initiators that use this
+ * interface to interact with the hwmod.  Used to add sleep dependencies
+ * when the module is enabled or disabled.
+ */
+#define OCP_USER_MPU                   (1 << 0)
+#define OCP_USER_SDMA                  (1 << 1)
+#define OCP_USER_DSP                   (1 << 2)
+#define OCP_USER_IVA                   (1 << 3)
+
+/* omap_hwmod_ocp_if.flags bits */
+#define OCPIF_SWSUP_IDLE               (1 << 0)
+#define OCPIF_CAN_BURST                        (1 << 1)
+
+/* omap_hwmod_ocp_if._int_flags possibilities */
+#define _OCPIF_INT_FLAGS_REGISTERED    (1 << 0)
+
+
+/**
+ * struct omap_hwmod_ocp_if - OCP interface data
+ * @master: struct omap_hwmod that initiates OCP transactions on this link
+ * @slave: struct omap_hwmod that responds to OCP transactions on this link
+ * @addr: address space associated with this link
+ * @clk: interface clock: OMAP clock name
+ * @_clk: pointer to the interface struct clk (filled in at runtime)
+ * @fw: interface firewall data
+ * @width: OCP data width
+ * @user: initiators using this interface (see OCP_USER_* macros above)
+ * @flags: OCP interface flags (see OCPIF_* macros above)
+ * @_int_flags: internal flags (see _OCPIF_INT_FLAGS* macros above)
+ *
+ * It may also be useful to add a tag_cnt field for OCP2.x devices.
+ *
+ * Parameter names beginning with an underscore are managed internally by
+ * the omap_hwmod code and should not be set during initialization.
+ */
+struct omap_hwmod_ocp_if {
+       struct omap_hwmod               *master;
+       struct omap_hwmod               *slave;
+       struct omap_hwmod_addr_space    *addr;
+       const char                      *clk;
+       struct clk                      *_clk;
+       union {
+               struct omap_hwmod_omap2_firewall omap2;
+       }                               fw;
+       u8                              width;
+       u8                              user;
+       u8                              flags;
+       u8                              _int_flags;
+};
+
+
+/* Macros for use in struct omap_hwmod_sysconfig */
+
+/* Flags for use in omap_hwmod_sysconfig.idlemodes */
+#define MASTER_STANDBY_SHIFT   4
+#define SLAVE_IDLE_SHIFT       0
+#define SIDLE_FORCE            (HWMOD_IDLEMODE_FORCE << SLAVE_IDLE_SHIFT)
+#define SIDLE_NO               (HWMOD_IDLEMODE_NO << SLAVE_IDLE_SHIFT)
+#define SIDLE_SMART            (HWMOD_IDLEMODE_SMART << SLAVE_IDLE_SHIFT)
+#define SIDLE_SMART_WKUP       (HWMOD_IDLEMODE_SMART_WKUP << SLAVE_IDLE_SHIFT)
+#define MSTANDBY_FORCE         (HWMOD_IDLEMODE_FORCE << MASTER_STANDBY_SHIFT)
+#define MSTANDBY_NO            (HWMOD_IDLEMODE_NO << MASTER_STANDBY_SHIFT)
+#define MSTANDBY_SMART         (HWMOD_IDLEMODE_SMART << MASTER_STANDBY_SHIFT)
+#define MSTANDBY_SMART_WKUP    (HWMOD_IDLEMODE_SMART_WKUP << MASTER_STANDBY_SHIFT)
+
+/* omap_hwmod_sysconfig.sysc_flags capability flags */
+#define SYSC_HAS_AUTOIDLE      (1 << 0)
+#define SYSC_HAS_SOFTRESET     (1 << 1)
+#define SYSC_HAS_ENAWAKEUP     (1 << 2)
+#define SYSC_HAS_EMUFREE       (1 << 3)
+#define SYSC_HAS_CLOCKACTIVITY (1 << 4)
+#define SYSC_HAS_SIDLEMODE     (1 << 5)
+#define SYSC_HAS_MIDLEMODE     (1 << 6)
+#define SYSS_HAS_RESET_STATUS  (1 << 7)
+#define SYSC_NO_CACHE          (1 << 8)  /* XXX SW flag, belongs elsewhere */
+#define SYSC_HAS_RESET_STATUS  (1 << 9)
+#define SYSC_HAS_DMADISABLE    (1 << 10)
+
+/* omap_hwmod_sysconfig.clockact flags */
+#define CLOCKACT_TEST_BOTH     0x0
+#define CLOCKACT_TEST_MAIN     0x1
+#define CLOCKACT_TEST_ICLK     0x2
+#define CLOCKACT_TEST_NONE     0x3
+
+/**
+ * struct omap_hwmod_sysc_fields - hwmod OCP_SYSCONFIG register field offsets.
+ * @midle_shift: Offset of the midle bit
+ * @clkact_shift: Offset of the clockactivity bit
+ * @sidle_shift: Offset of the sidle bit
+ * @enwkup_shift: Offset of the enawakeup bit
+ * @srst_shift: Offset of the softreset bit
+ * @autoidle_shift: Offset of the autoidle bit
+ * @dmadisable_shift: Offset of the dmadisable bit
+ */
+struct omap_hwmod_sysc_fields {
+       u8 midle_shift;
+       u8 clkact_shift;
+       u8 sidle_shift;
+       u8 enwkup_shift;
+       u8 srst_shift;
+       u8 autoidle_shift;
+       u8 dmadisable_shift;
+};
+
+/**
+ * struct omap_hwmod_class_sysconfig - hwmod class OCP_SYS* data
+ * @rev_offs: IP block revision register offset (from module base addr)
+ * @sysc_offs: OCP_SYSCONFIG register offset (from module base addr)
+ * @syss_offs: OCP_SYSSTATUS register offset (from module base addr)
+ * @srst_udelay: Delay needed after doing a softreset in usecs
+ * @idlemodes: One or more of {SIDLE,MSTANDBY}_{OFF,FORCE,SMART}
+ * @sysc_flags: SYS{C,S}_HAS* flags indicating SYSCONFIG bits supported
+ * @clockact: the default value of the module CLOCKACTIVITY bits
+ *
+ * @clockact describes to the module which clocks are likely to be
+ * disabled when the PRCM issues its idle request to the module.  Some
+ * modules have separate clockdomains for the interface clock and main
+ * functional clock, and can check whether they should acknowledge the
+ * idle request based on the internal module functionality that has
+ * been associated with the clocks marked in @clockact.  This field is
+ * only used if HWMOD_SET_DEFAULT_CLOCKACT is set (see below)
+ *
+ * @sysc_fields: structure containing the offset positions of various bits in
+ * SYSCONFIG register. This can be populated using omap_hwmod_sysc_type1 or
+ * omap_hwmod_sysc_type2 defined in omap_hwmod_common_data.c depending on
+ * whether the device ip is compliant with the original PRCM protocol
+ * defined for OMAP2420 or the new PRCM protocol for new OMAP4 IPs.
+ * If the device follows a different scheme for the sysconfig register ,
+ * then this field has to be populated with the correct offset structure.
+ */
+struct omap_hwmod_class_sysconfig {
+       u32 rev_offs;
+       u32 sysc_offs;
+       u32 syss_offs;
+       u16 sysc_flags;
+       struct omap_hwmod_sysc_fields *sysc_fields;
+       u8 srst_udelay;
+       u8 idlemodes;
+       u8 clockact;
+};
+
+/**
+ * struct omap_hwmod_omap2_prcm - OMAP2/3-specific PRCM data
+ * @module_offs: PRCM submodule offset from the start of the PRM/CM
+ * @prcm_reg_id: PRCM register ID (e.g., 3 for CM_AUTOIDLE3)
+ * @module_bit: register bit shift for AUTOIDLE, WKST, WKEN, GRPSEL regs
+ * @idlest_reg_id: IDLEST register ID (e.g., 3 for CM_IDLEST3)
+ * @idlest_idle_bit: register bit shift for CM_IDLEST slave idle bit
+ * @idlest_stdby_bit: register bit shift for CM_IDLEST master standby bit
+ *
+ * @prcm_reg_id and @module_bit are specific to the AUTOIDLE, WKST,
+ * WKEN, GRPSEL registers.  In an ideal world, no extra information
+ * would be needed for IDLEST information, but alas, there are some
+ * exceptions, so @idlest_reg_id, @idlest_idle_bit, @idlest_stdby_bit
+ * are needed for the IDLEST registers (c.f. 2430 I2CHS, 3430 USBHOST)
+ */
+struct omap_hwmod_omap2_prcm {
+       s16 module_offs;
+       u8 prcm_reg_id;
+       u8 module_bit;
+       u8 idlest_reg_id;
+       u8 idlest_idle_bit;
+       u8 idlest_stdby_bit;
+};
+
+/*
+ * Possible values for struct omap_hwmod_omap4_prcm.flags
+ *
+ * HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT: Some IP blocks don't have a PRCM
+ *     module-level context loss register associated with them; this
+ *     flag bit should be set in those cases
+ */
+#define HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT                (1 << 0)
+
+/**
+ * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data
+ * @clkctrl_reg: PRCM address of the clock control register
+ * @rstctrl_reg: address of the XXX_RSTCTRL register located in the PRM
+ * @lostcontext_mask: bitmask for selecting bits from RM_*_CONTEXT register
+ * @rstst_reg: (AM33XX only) address of the XXX_RSTST register in the PRM
+ * @submodule_wkdep_bit: bit shift of the WKDEP range
+ * @flags: PRCM register capabilities for this IP block
+ *
+ * If @lostcontext_mask is not defined, context loss check code uses
+ * whole register without masking. @lostcontext_mask should only be
+ * defined in cases where @context_offs register is shared by two or
+ * more hwmods.
+ */
+struct omap_hwmod_omap4_prcm {
+       u16             clkctrl_offs;
+       u16             rstctrl_offs;
+       u16             rstst_offs;
+       u16             context_offs;
+       u32             lostcontext_mask;
+       u8              submodule_wkdep_bit;
+       u8              modulemode;
+       u8              flags;
+};
+
+
+/*
+ * omap_hwmod.flags definitions
+ *
+ * HWMOD_SWSUP_SIDLE: omap_hwmod code should manually bring module in and out
+ *     of idle, rather than relying on module smart-idle
+ * HWMOD_SWSUP_MSTDBY: omap_hwmod code should manually bring module in and out
+ *     of standby, rather than relying on module smart-standby
+ * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for
+ *     SDRAM controller, etc. XXX probably belongs outside the main hwmod file
+ *     XXX Should be HWMOD_SETUP_NO_RESET
+ * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM
+ *     controller, etc. XXX probably belongs outside the main hwmod file
+ *     XXX Should be HWMOD_SETUP_NO_IDLE
+ * HWMOD_NO_OCP_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE)
+ *     when module is enabled, rather than the default, which is to
+ *     enable autoidle
+ * HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup
+ * HWMOD_NO_IDLEST: this module does not have idle status - this is the case
+ *     only for few initiator modules on OMAP2 & 3.
+ * HWMOD_CONTROL_OPT_CLKS_IN_RESET: Enable all optional clocks during reset.
+ *     This is needed for devices like DSS that require optional clocks enabled
+ *     in order to complete the reset. Optional clocks will be disabled
+ *     again after the reset.
+ * HWMOD_16BIT_REG: Module has 16bit registers
+ */
+#define HWMOD_SWSUP_SIDLE                      (1 << 0)
+#define HWMOD_SWSUP_MSTANDBY                   (1 << 1)
+#define HWMOD_INIT_NO_RESET                    (1 << 2)
+#define HWMOD_INIT_NO_IDLE                     (1 << 3)
+#define HWMOD_NO_OCP_AUTOIDLE                  (1 << 4)
+#define HWMOD_SET_DEFAULT_CLOCKACT             (1 << 5)
+#define HWMOD_NO_IDLEST                                (1 << 6)
+#define HWMOD_CONTROL_OPT_CLKS_IN_RESET                (1 << 7)
+#define HWMOD_16BIT_REG                                (1 << 8)
+
+/*
+ * omap_hwmod._int_flags definitions
+ * These are for internal use only and are managed by the omap_hwmod code.
+ *
+ * _HWMOD_NO_MPU_PORT: no path exists for the MPU to write to this module
+ * _HWMOD_WAKEUP_ENABLED: set when the omap_hwmod code has enabled ENAWAKEUP
+ * _HWMOD_SYSCONFIG_LOADED: set when the OCP_SYSCONFIG value has been cached
+ * _HWMOD_SKIP_ENABLE: set if hwmod enabled during init (HWMOD_INIT_NO_IDLE) -
+ *     causes the first call to _enable() to only update the pinmux
+ */
+#define _HWMOD_NO_MPU_PORT                     (1 << 0)
+#define _HWMOD_WAKEUP_ENABLED                  (1 << 1)
+#define _HWMOD_SYSCONFIG_LOADED                        (1 << 2)
+#define _HWMOD_SKIP_ENABLE                     (1 << 3)
+
+/*
+ * omap_hwmod._state definitions
+ *
+ * INITIALIZED: reset (optionally), initialized, enabled, disabled
+ *              (optionally)
+ *
+ *
+ */
+#define _HWMOD_STATE_UNKNOWN                   0
+#define _HWMOD_STATE_REGISTERED                        1
+#define _HWMOD_STATE_CLKS_INITED               2
+#define _HWMOD_STATE_INITIALIZED               3
+#define _HWMOD_STATE_ENABLED                   4
+#define _HWMOD_STATE_IDLE                      5
+#define _HWMOD_STATE_DISABLED                  6
+
+/**
+ * struct omap_hwmod_class - the type of an IP block
+ * @name: name of the hwmod_class
+ * @sysc: device SYSCONFIG/SYSSTATUS register data
+ * @rev: revision of the IP class
+ * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
+ * @reset: ptr to fn to be executed in place of the standard hwmod reset fn
+ *
+ * Represent the class of a OMAP hardware "modules" (e.g. timer,
+ * smartreflex, gpio, uart...)
+ *
+ * @pre_shutdown is a function that will be run immediately before
+ * hwmod clocks are disabled, etc.  It is intended for use for hwmods
+ * like the MPU watchdog, which cannot be disabled with the standard
+ * omap_hwmod_shutdown().  The function should return 0 upon success,
+ * or some negative error upon failure.  Returning an error will cause
+ * omap_hwmod_shutdown() to abort the device shutdown and return an
+ * error.
+ *
+ * If @reset is defined, then the function it points to will be
+ * executed in place of the standard hwmod _reset() code in
+ * mach-omap2/omap_hwmod.c.  This is needed for IP blocks which have
+ * unusual reset sequences - usually processor IP blocks like the IVA.
+ */
+struct omap_hwmod_class {
+       const char                              *name;
+       struct omap_hwmod_class_sysconfig       *sysc;
+       u32                                     rev;
+       int                                     (*pre_shutdown)(struct omap_hwmod *oh);
+       int                                     (*reset)(struct omap_hwmod *oh);
+};
+
+/**
+ * struct omap_hwmod_link - internal structure linking hwmods with ocp_ifs
+ * @ocp_if: OCP interface structure record pointer
+ * @node: list_head pointing to next struct omap_hwmod_link in a list
+ */
+struct omap_hwmod_link {
+       struct omap_hwmod_ocp_if        *ocp_if;
+       struct list_head                node;
+};
+
+/**
+ * struct omap_hwmod - integration data for OMAP hardware "modules" (IP blocks)
+ * @name: name of the hwmod
+ * @class: struct omap_hwmod_class * to the class of this hwmod
+ * @od: struct omap_device currently associated with this hwmod (internal use)
+ * @mpu_irqs: ptr to an array of MPU IRQs
+ * @sdma_reqs: ptr to an array of System DMA request IDs
+ * @prcm: PRCM data pertaining to this hwmod
+ * @main_clk: main clock: OMAP clock name
+ * @_clk: pointer to the main struct clk (filled in at runtime)
+ * @opt_clks: other device clocks that drivers can request (0..*)
+ * @voltdm: pointer to voltage domain (filled in at runtime)
+ * @dev_attr: arbitrary device attributes that can be passed to the driver
+ * @_sysc_cache: internal-use hwmod flags
+ * @_mpu_rt_va: cached register target start address (internal use)
+ * @_mpu_port: cached MPU register target slave (internal use)
+ * @opt_clks_cnt: number of @opt_clks
+ * @master_cnt: number of @master entries
+ * @slaves_cnt: number of @slave entries
+ * @response_lat: device OCP response latency (in interface clock cycles)
+ * @_int_flags: internal-use hwmod flags
+ * @_state: internal-use hwmod state
+ * @_postsetup_state: internal-use state to leave the hwmod in after _setup()
+ * @flags: hwmod flags (documented below)
+ * @_lock: spinlock serializing operations on this hwmod
+ * @node: list node for hwmod list (internal use)
+ *
+ * @main_clk refers to this module's "main clock," which for our
+ * purposes is defined as "the functional clock needed for register
+ * accesses to complete."  Modules may not have a main clock if the
+ * interface clock also serves as a main clock.
+ *
+ * Parameter names beginning with an underscore are managed internally by
+ * the omap_hwmod code and should not be set during initialization.
+ *
+ * @masters and @slaves are now deprecated.
+ */
+struct omap_hwmod {
+       const char                      *name;
+       struct omap_hwmod_class         *class;
+       struct omap_device              *od;
+       struct omap_hwmod_mux_info      *mux;
+       struct omap_hwmod_irq_info      *mpu_irqs;
+       struct omap_hwmod_dma_info      *sdma_reqs;
+       struct omap_hwmod_rst_info      *rst_lines;
+       union {
+               struct omap_hwmod_omap2_prcm omap2;
+               struct omap_hwmod_omap4_prcm omap4;
+       }                               prcm;
+       const char                      *main_clk;
+       struct clk                      *_clk;
+       struct omap_hwmod_opt_clk       *opt_clks;
+       char                            *clkdm_name;
+       struct clockdomain              *clkdm;
+       struct list_head                master_ports; /* connect to *_IA */
+       struct list_head                slave_ports; /* connect to *_TA */
+       void                            *dev_attr;
+       u32                             _sysc_cache;
+       void __iomem                    *_mpu_rt_va;
+       spinlock_t                      _lock;
+       struct list_head                node;
+       struct omap_hwmod_ocp_if        *_mpu_port;
+       u16                             flags;
+       u8                              response_lat;
+       u8                              rst_lines_cnt;
+       u8                              opt_clks_cnt;
+       u8                              masters_cnt;
+       u8                              slaves_cnt;
+       u8                              hwmods_cnt;
+       u8                              _int_flags;
+       u8                              _state;
+       u8                              _postsetup_state;
+};
+
+struct omap_hwmod *omap_hwmod_lookup(const char *name);
+int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
+                       void *data);
+
+int __init omap_hwmod_setup_one(const char *name);
+
+int omap_hwmod_enable(struct omap_hwmod *oh);
+int omap_hwmod_idle(struct omap_hwmod *oh);
+int omap_hwmod_shutdown(struct omap_hwmod *oh);
+
+int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name);
+int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name);
+int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name);
+
+int omap_hwmod_enable_clocks(struct omap_hwmod *oh);
+int omap_hwmod_disable_clocks(struct omap_hwmod *oh);
+
+int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode);
+int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle);
+
+int omap_hwmod_reset(struct omap_hwmod *oh);
+void omap_hwmod_ocp_barrier(struct omap_hwmod *oh);
+
+void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs);
+u32 omap_hwmod_read(struct omap_hwmod *oh, u16 reg_offs);
+int omap_hwmod_softreset(struct omap_hwmod *oh);
+
+int omap_hwmod_count_resources(struct omap_hwmod *oh);
+int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res);
+int omap_hwmod_fill_dma_resources(struct omap_hwmod *oh, struct resource *res);
+int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type,
+                                  const char *name, struct resource *res);
+
+struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh);
+void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh);
+
+int omap_hwmod_add_initiator_dep(struct omap_hwmod *oh,
+                                struct omap_hwmod *init_oh);
+int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
+                                struct omap_hwmod *init_oh);
+
+int omap_hwmod_enable_wakeup(struct omap_hwmod *oh);
+int omap_hwmod_disable_wakeup(struct omap_hwmod *oh);
+
+int omap_hwmod_for_each_by_class(const char *classname,
+                                int (*fn)(struct omap_hwmod *oh,
+                                          void *user),
+                                void *user);
+
+int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
+int omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
+
+int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
+
+int omap_hwmod_pad_route_irq(struct omap_hwmod *oh, int pad_idx, int irq_idx);
+
+extern void __init omap_hwmod_init(void);
+
+const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);
+
+/*
+ * Chip variant-specific hwmod init routines - XXX should be converted
+ * to use initcalls once the initial boot ordering is straightened out
+ */
+extern int omap2420_hwmod_init(void);
+extern int omap2430_hwmod_init(void);
+extern int omap3xxx_hwmod_init(void);
+extern int omap44xx_hwmod_init(void);
+extern int am33xx_hwmod_init(void);
+
+extern int __init omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois);
+
+#endif
index b5db6007c523413cfd0e2b4f1063b5451a231f00..a8b3368dca3dff7825509174d903595ae4d1da87 100644 (file)
  * XXX handle crossbar/shared link difference for L3?
  * XXX these should be marked initdata for multi-OMAP kernels
  */
+
+#include <linux/i2c-omap.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
 
-#include <plat/omap_hwmod.h>
-#include <plat/dma.h>
-#include <plat/serial.h>
-#include <plat/i2c.h>
+#include <plat-omap/dma-omap.h>
 #include <plat/dmtimer.h>
+
+#include "omap_hwmod.h"
 #include "l3_2xxx.h"
 #include "l4_2xxx.h"
-#include <plat/mmc.h>
 
 #include "omap_hwmod_common_data.h"
 
 #include "cm-regbits-24xx.h"
 #include "prm-regbits-24xx.h"
+#include "i2c.h"
+#include "mmc.h"
+#include "serial.h"
 #include "wd_timer.h"
 
 /*
index c455e41b02374ce7028a2bb3b9c0f8c45a57f1eb..dc768c50e523d4c49dda1a0580a5c3d089424103 100644 (file)
  * XXX handle crossbar/shared link difference for L3?
  * XXX these should be marked initdata for multi-OMAP kernels
  */
+
+#include <linux/i2c-omap.h>
 #include <linux/platform_data/asoc-ti-mcbsp.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
 
-#include <plat/omap_hwmod.h>
-#include <plat/dma.h>
-#include <plat/serial.h>
-#include <plat/i2c.h>
+#include <plat-omap/dma-omap.h>
 #include <plat/dmtimer.h>
-#include <plat/mmc.h>
+
+#include "omap_hwmod.h"
+#include "mmc.h"
 #include "l3_2xxx.h"
 
 #include "soc.h"
 #include "omap_hwmod_common_data.h"
 #include "prm-regbits-24xx.h"
 #include "cm-regbits-24xx.h"
+#include "i2c.h"
 #include "wd_timer.h"
 
 /*
index cbb4ef6544adfba32c0336c6f5054ec5b10aef45..0413daba2dba1bdc88e4522cf9c6c04bf76acca0 100644 (file)
@@ -13,8 +13,7 @@
  */
 #include <asm/sizes.h>
 
-#include <plat/omap_hwmod.h>
-#include <plat/serial.h>
+#include "omap_hwmod.h"
 
 #include "omap_hwmod_common_data.h"
 
index 8851bbb6bb2414e1206449e3e954232c4c443c1b..05c6a5906550bd569b71c44fcdc0897fa03925c3 100644 (file)
@@ -9,13 +9,16 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <plat/omap_hwmod.h>
-#include <plat/serial.h>
-#include <plat/dma.h>
-#include <plat/common.h>
+
+#include <plat-omap/dma-omap.h>
+
+#include "../plat-omap/common.h"
+
+#include "omap_hwmod.h"
 #include "hdq1w.h"
 
 #include "omap_hwmod_common_data.h"
+#include "dma.h"
 
 /* UART */
 
index 1a1287d62648df38ebe2f20474d91afa4c1ddf92..47901a5e76de517b9f86d5f4bc83b0614857e5e1 100644 (file)
  */
 #include <asm/sizes.h>
 
-#include <plat/omap_hwmod.h>
-#include <plat/serial.h>
+#include "omap_hwmod.h"
 #include "l3_2xxx.h"
 #include "l4_2xxx.h"
+#include "serial.h"
 
 #include "omap_hwmod_common_data.h"
 
index bd9220ed5ab9d9fda89cca30b4bf1c339cad9f6d..a0116d08cf4575bd5cc604feed0595019b9c4611 100644 (file)
@@ -8,13 +8,13 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <plat/omap_hwmod.h>
-#include <plat/serial.h>
+
 #include <linux/platform_data/gpio-omap.h>
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 #include <plat/dmtimer.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
 
+#include "omap_hwmod.h"
 #include "omap_hwmod_common_data.h"
 #include "cm-regbits-24xx.h"
 #include "prm-regbits-24xx.h"
index 59d5c1cd316d5eb71c924b3b945ff166e94b9088..ad8d43b33273917edd49b6e228fe06f978abdc41 100644 (file)
  * GNU General Public License for more details.
  */
 
-#include <plat/omap_hwmod.h>
-#include <plat/cpu.h>
+#include <linux/i2c-omap.h>
+
+#include "omap_hwmod.h"
 #include <linux/platform_data/gpio-omap.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
-#include <plat/dma.h>
-#include <plat/mmc.h>
-#include <plat/i2c.h>
 
 #include "omap_hwmod_common_data.h"
 
@@ -28,6 +26,8 @@
 #include "cm33xx.h"
 #include "prm33xx.h"
 #include "prm-regbits-33xx.h"
+#include "i2c.h"
+#include "mmc.h"
 
 /*
  * IP blocks
index f67b7ee07dd4f5575e206c2098bb67c88fa32873..abe66ced903fe0e5a032bd827f547c79640fffc1 100644 (file)
  *
  * XXX these should be marked initdata for multi-OMAP kernels
  */
+
+#include <linux/i2c-omap.h>
 #include <linux/power/smartreflex.h>
 #include <linux/platform_data/gpio-omap.h>
 
-#include <plat/omap_hwmod.h>
-#include <plat/dma.h>
-#include <plat/serial.h>
+#include <plat-omap/dma-omap.h>
 #include "l3_3xxx.h"
 #include "l4_3xxx.h"
-#include <plat/i2c.h>
-#include <plat/mmc.h>
 #include <linux/platform_data/asoc-ti-mcbsp.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
 #include <plat/dmtimer.h>
 #include "am35xx.h"
 
 #include "soc.h"
+#include "omap_hwmod.h"
 #include "omap_hwmod_common_data.h"
 #include "prm-regbits-34xx.h"
 #include "cm-regbits-34xx.h"
+
+#include "dma.h"
+#include "i2c.h"
+#include "mmc.h"
 #include "wd_timer.h"
+#include "serial.h"
 
 /*
  * OMAP3xxx hardware module integration data
index 652d0285bd6dd7b1a445bcbab02e395e04c5e11a..5b9be734709c25be723adbc3ed202f78c443f613 100644 (file)
 #include <linux/io.h>
 #include <linux/platform_data/gpio-omap.h>
 #include <linux/power/smartreflex.h>
+#include <linux/i2c-omap.h>
+
+#include <plat-omap/dma-omap.h>
 
-#include <plat/omap_hwmod.h>
-#include <plat/i2c.h>
-#include <plat/dma.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
 #include <linux/platform_data/asoc-ti-mcbsp.h>
-#include <plat/mmc.h>
 #include <plat/dmtimer.h>
-#include <plat/common.h>
 #include <plat/iommu.h>
 
+#include "../plat-omap/common.h"
+
+#include "omap_hwmod.h"
 #include "omap_hwmod_common_data.h"
 #include "cm1_44xx.h"
 #include "cm2_44xx.h"
 #include "prm44xx.h"
 #include "prm-regbits-44xx.h"
+#include "i2c.h"
+#include "mmc.h"
 #include "wd_timer.h"
 
 /* Base offset for all OMAP4 interrupts external to MPUSS */
index 9f1ccdc8cc8cc0e137cc8b694a650f623c194646..79d623b83e496d5d79d6901a61c36754a9635b77 100644 (file)
@@ -16,7 +16,7 @@
  * data and their integration with other OMAP modules and Linux.
  */
 
-#include <plat/omap_hwmod.h>
+#include "omap_hwmod.h"
 
 #include "omap_hwmod_common_data.h"
 
index 2bc8f1705d4aa7ce18d779c27089116990979d14..cfcce299177c537750d7143919e294ff6aec2532 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef __ARCH_ARM_MACH_OMAP2_OMAP_HWMOD_COMMON_DATA_H
 #define __ARCH_ARM_MACH_OMAP2_OMAP_HWMOD_COMMON_DATA_H
 
-#include <plat/omap_hwmod.h>
+#include "omap_hwmod.h"
 
 #include "common.h"
 #include "display.h"
index c784c12f98a1445e3ea9ef97e77f2fea904aa05a..7e437bf6024ca2ef694913c3a3eac9dac1f16e87 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H
 #define __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H
 
-#include <plat/omap_hwmod.h>
+#include "omap_hwmod.h"
 
 #include "voltage.h"
 
index d992db8ff0b07481fe21f24b410f9771dd3cda83..4d76a3ca5bf3de373b08104bc1792e013671e835 100644 (file)
 #include <linux/io.h>
 #include <linux/err.h>
 #include <linux/usb.h>
-
-#include <plat/usb.h>
+#include <linux/usb/musb.h>
 
 #include "soc.h"
 #include "control.h"
+#include "usb.h"
 
 void am35x_musb_reset(void)
 {
index f515a1a056d55c96facdb49c9eec0911d8f6c728..2bf35dc091be445ac8cc8ef3f833a261c76a96bb 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/kernel.h>
 #include <linux/i2c/twl.h>
 
+#include "soc.h"
 #include "voltage.h"
 
 #include "pm.h"
index 58e16aef40bbd92f73ea631ce2e777028ddfaf53..bd41d59a7cab08ecbca342a665f5f944aa67b6bc 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/opp.h>
 #include <linux/cpu.h>
 
-#include <plat/omap_device.h>
+#include "omap_device.h"
 
 #include "omap_opp_data.h"
 
index 75cef5f67a8a6bbc9b39840d7e1339d7bbc16a2d..62772e0e0d6959061068b31c8472f18ae84451a7 100644 (file)
@@ -19,6 +19,7 @@
  */
 #include <linux/module.h>
 
+#include "soc.h"
 #include "control.h"
 #include "omap_opp_data.h"
 #include "pm.h"
index 46092cd806fae24d14b90829c163190579104a05..3cf4fdfd7ab0b11a0a7b1695d14092529e7db863 100644 (file)
 #include <linux/module.h>
 #include <linux/slab.h>
 
-#include <plat/clock.h>
+#include "clock.h"
 #include "powerdomain.h"
 #include "clockdomain.h"
 #include <plat/dmtimer.h>
-#include <plat/omap-pm.h>
+#include "omap-pm.h"
 
+#include "soc.h"
 #include "cm2xxx_3xxx.h"
 #include "prm2xxx_3xxx.h"
 #include "pm.h"
index ea61c32957bdaeeb69f5f21467dcc291b05d397f..331478f9b86403cd73d770bc564602c6b912b01e 100644 (file)
 
 #include <asm/system_misc.h>
 
-#include <plat/omap-pm.h>
-#include <plat/omap_device.h>
+#include "omap-pm.h"
+#include "omap_device.h"
 #include "common.h"
 
+#include "soc.h"
 #include "prcm-common.h"
 #include "voltage.h"
 #include "powerdomain.h"
index 8af6cd6ac331ffd2cfdf32c53782a9fdafad952f..6d17e044ffb8d9836457f82b44a1c9f9c1316b26 100644 (file)
 #include <asm/mach-types.h>
 #include <asm/system_misc.h>
 
-#include <plat/clock.h>
-#include <plat/sram.h>
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 
+#include "../plat-omap/sram.h"
+
+#include "soc.h"
 #include "common.h"
+#include "clock.h"
 #include "prm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 #include "cm2xxx_3xxx.h"
index ba670db1fd37416a8da3e1d343b319afa8161adf..160fa250c41e2451a082571f4f85a10654442a11 100644 (file)
 #include <asm/suspend.h>
 #include <asm/system_misc.h>
 
-#include <plat/sram.h>
 #include "clockdomain.h"
 #include "powerdomain.h"
-#include <plat/sdrc.h>
 #include <plat/prcm.h>
-#include <plat/gpmc.h>
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 
+#include "../plat-omap/sram.h"
+
+#include "soc.h"
 #include "common.h"
 #include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
+#include "gpmc.h"
 #include "prm-regbits-34xx.h"
 
 #include "prm2xxx_3xxx.h"
index 04922d1490683d8c0a7d443ea6806a9032535b29..7da75aed1514bf8374aa54310b70c29a7d895693 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/slab.h>
 #include <asm/system_misc.h>
 
+#include "soc.h"
 #include "common.h"
 #include "clockdomain.h"
 #include "powerdomain.h"
index 2a791766283d171b145fb7678ae0c78e1e1cb121..3cf79b54ce61ac7fc3c72a0de6bc52a43e68f2a2 100644 (file)
@@ -15,8 +15,9 @@
 
 #include <asm/pmu.h>
 
-#include <plat/omap_hwmod.h>
-#include <plat/omap_device.h>
+#include "soc.h"
+#include "omap_hwmod.h"
+#include "omap_device.h"
 
 static char *omap2_pmu_oh_names[] = {"mpu"};
 static char *omap3_pmu_oh_names[] = {"mpu", "debugss"};
index baee90608d11b8ddd444df041e401b4ef5314456..5277d56eb37f283fb9de3c33846639ee05ebba96 100644 (file)
@@ -22,8 +22,6 @@
 
 #include <linux/atomic.h>
 
-#include <plat/cpu.h>
-
 #include "voltage.h"
 
 /* Powerdomain basic power states */
index 2385c1f009ee32338db1508a71863801dbd6e60c..ba520d4f7c7bf45d81503497a01ae9d9f555b032 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 
+#include "soc.h"
 #include "powerdomain.h"
 #include "powerdomains2xxx_3xxx_data.h"
 
index 0f51e034e0aa5ba0e35e265001ae99eb489fa9ef..cff270a178c51b9541f8608d83799878af7f8ffa 100644 (file)
@@ -28,6 +28,7 @@
 #include "common.h"
 #include <plat/prcm.h>
 
+#include "soc.h"
 #include "clock.h"
 #include "clock2xxx.h"
 #include "cm2xxx_3xxx.h"
index e7dbb6cf1255dd077aca1a4965dc9f59f659de24..624ade5c3c337b37e5578c605fc02c889a96fe3e 100644 (file)
@@ -19,7 +19,7 @@
 #include <linux/err.h>
 #include <linux/io.h>
 
-#include <plat/common.h>
+#include "../plat-omap/common.h"
 
 #include "common.h"
 #include "prm33xx.h"
index 6b4d332be2f63d46d8bc3d1cd25ce08a8af4f7b4..6fabbd816d6b537cf1a05c6bebcb2e08569c649f 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 
-#include <plat/common.h>
+#include "../plat-omap/common.h"
 #include <plat/prcm.h>
 
 #include "prm2xxx_3xxx.h"
index 8bfaf342a028a166084c1a2cffd1b694410d0763..1ee58c281a3107cd1b964d769b7d0fd84520c3fa 100644 (file)
@@ -11,7 +11,7 @@
 #ifndef __ARCH_ARM_MACH_OMAP2_SDRAM_HYNIX_H8MBX00U0MER0EM
 #define __ARCH_ARM_MACH_OMAP2_SDRAM_HYNIX_H8MBX00U0MER0EM
 
-#include <plat/sdrc.h>
+#include "sdrc.h"
 
 /* Hynix H8MBX00U0MER-0EM */
 static struct omap_sdrc_params h8mbx00u0mer0em_sdrc_params[] = {
index a391b4939f74f0ce910087d53bd1bb40a2c0ac91..85cccc004c06921bdaaa7a2bbbcaf487b3f84f37 100644 (file)
@@ -14,7 +14,7 @@
 #ifndef ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF
 #define ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF
 
-#include <plat/sdrc.h>
+#include "sdrc.h"
 
 /* Micron MT46H32M32LF-6 */
 /* XXX Using ARE = 0x1 (no autorefresh burst) -- can this be changed? */
index 845c4fd2b125238fd9516297c152a004300bc1e6..0fa7ffa9b5ed27f138258b8177450b6aada64db1 100644 (file)
 #include <linux/io.h>
 
 #include "common.h"
-#include <plat/clock.h>
-#include <plat/sdrc.h>
-
 #include "sdram-nokia.h"
+#include "sdrc.h"
 
 /* In picoseconds, except for tREF (ns), tXP, tCKE, tWTR (clks) */
 struct sdram_timings {
index cd4352917022d68d4bef930be0f47cc12af0e803..003f7bf4e2e337c0abd2c815eda62516a6809783 100644 (file)
@@ -11,7 +11,7 @@
 #ifndef __ARCH_ARM_MACH_OMAP2_SDRAM_NUMONYX_M65KXXXXAM
 #define __ARCH_ARM_MACH_OMAP2_SDRAM_NUMONYX_M65KXXXXAM
 
-#include <plat/sdrc.h>
+#include "sdrc.h"
 
 /* Numonyx  M65KXXXXAM */
 static struct omap_sdrc_params m65kxxxxam_sdrc_params[] = {
index 0e518a72831fa52eb19d17a55fbd787fd2ab35cf..8dc3de5ebb5b1d891eb063804faff8f9f912d45f 100644 (file)
@@ -14,7 +14,7 @@
 #ifndef ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6
 #define ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6
 
-#include <plat/sdrc.h>
+#include "sdrc.h"
 
 /* Qimonda HYB18M512160AF-6 */
 static struct omap_sdrc_params hyb18m512160af6_sdrc_params[] = {
index e3d345f464094c0709382b9ab160ef70384f581d..94d4082f87ed1d9f6ddb5f61b364d5401626f327 100644 (file)
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include "common.h"
-#include <plat/clock.h>
-#include <plat/sram.h>
+#include "../plat-omap/sram.h"
 
-#include <plat/sdrc.h>
+#include "common.h"
+#include "clock.h"
 #include "sdrc.h"
 
 static struct omap_sdrc_params *sdrc_init_params_cs0, *sdrc_init_params_cs1;
@@ -160,19 +159,3 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
        sdrc_write_reg(l, SDRC_POWER);
        omap2_sms_save_context();
 }
-
-void omap2_sms_write_rot_control(u32 val, unsigned ctx)
-{
-       sms_write_reg(val, SMS_ROT_CONTROL(ctx));
-}
-
-void omap2_sms_write_rot_size(u32 val, unsigned ctx)
-{
-       sms_write_reg(val, SMS_ROT_SIZE(ctx));
-}
-
-void omap2_sms_write_rot_physical_ba(u32 val, unsigned ctx)
-{
-       sms_write_reg(val, SMS_ROT_PHYSICAL_BA(ctx));
-}
-
index b3f83799e6cf0701d4388aa7785049a6241fad8d..69c4b329452ec01abafca74fc825f03410bf7d90 100644 (file)
@@ -2,12 +2,14 @@
 #define __ARCH_ARM_MACH_OMAP2_SDRC_H
 
 /*
- * OMAP2 SDRC register definitions
+ * OMAP2/3 SDRC/SMS macros and prototypes
  *
- * Copyright (C) 2007 Texas Instruments, Inc.
- * Copyright (C) 2007 Nokia Corporation
+ * Copyright (C) 2007-2008, 2012 Texas Instruments, Inc.
+ * Copyright (C) 2007-2008 Nokia Corporation
  *
- * Written by Paul Walmsley
+ * Paul Walmsley
+ * Tony Lindgren
+ * Richard Woodruff
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -15,8 +17,6 @@
  */
 #undef DEBUG
 
-#include <plat/sdrc.h>
-
 #ifndef __ASSEMBLER__
 
 #include <linux/io.h>
@@ -50,6 +50,58 @@ static inline u32 sms_read_reg(u16 reg)
 {
        return __raw_readl(OMAP_SMS_REGADDR(reg));
 }
+
+
+/**
+ * struct omap_sdrc_params - SDRC parameters for a given SDRC clock rate
+ * @rate: SDRC clock rate (in Hz)
+ * @actim_ctrla: Value to program to SDRC_ACTIM_CTRLA for this rate
+ * @actim_ctrlb: Value to program to SDRC_ACTIM_CTRLB for this rate
+ * @rfr_ctrl: Value to program to SDRC_RFR_CTRL for this rate
+ * @mr: Value to program to SDRC_MR for this rate
+ *
+ * This structure holds a pre-computed set of register values for the
+ * SDRC for a given SDRC clock rate and SDRAM chip.  These are
+ * intended to be pre-computed and specified in an array in the board-*.c
+ * files.  The structure is keyed off the 'rate' field.
+ */
+struct omap_sdrc_params {
+       unsigned long rate;
+       u32 actim_ctrla;
+       u32 actim_ctrlb;
+       u32 rfr_ctrl;
+       u32 mr;
+};
+
+#ifdef CONFIG_SOC_HAS_OMAP2_SDRC
+void omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
+                           struct omap_sdrc_params *sdrc_cs1);
+#else
+static inline void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
+                                         struct omap_sdrc_params *sdrc_cs1) {};
+#endif
+
+int omap2_sdrc_get_params(unsigned long r,
+                         struct omap_sdrc_params **sdrc_cs0,
+                         struct omap_sdrc_params **sdrc_cs1);
+void omap2_sms_save_context(void);
+void omap2_sms_restore_context(void);
+
+struct memory_timings {
+       u32 m_type;             /* ddr = 1, sdr = 0 */
+       u32 dll_mode;           /* use lock mode = 1, unlock mode = 0 */
+       u32 slow_dll_ctrl;      /* unlock mode, dll value for slow speed */
+       u32 fast_dll_ctrl;      /* unlock mode, dll value for fast speed */
+       u32 base_cs;            /* base chip select to use for calculations */
+};
+
+extern void omap2xxx_sdrc_init_params(u32 force_lock_to_unlock_mode);
+struct omap_sdrc_params *rx51_get_sdram_timings(void);
+
+u32 omap2xxx_sdrc_dll_is_unlocked(void);
+u32 omap2xxx_sdrc_reprogram(u32 level, u32 force);
+
+
 #else
 #define OMAP242X_SDRC_REGADDR(reg)                                     \
                        OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE + (reg))
@@ -57,6 +109,7 @@ static inline u32 sms_read_reg(u16 reg)
                        OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE + (reg))
 #define OMAP34XX_SDRC_REGADDR(reg)                                     \
                        OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE + (reg))
+
 #endif /* __ASSEMBLER__ */
 
 /* Minimum frequency that the SDRC DLL can lock at */
@@ -74,4 +127,85 @@ static inline u32 sms_read_reg(u16 reg)
  */
 #define SDRC_MPURATE_LOOPS             96
 
+/* SDRC register offsets - read/write with sdrc_{read,write}_reg() */
+
+#define SDRC_SYSCONFIG         0x010
+#define SDRC_CS_CFG            0x040
+#define SDRC_SHARING           0x044
+#define SDRC_ERR_TYPE          0x04C
+#define SDRC_DLLA_CTRL         0x060
+#define SDRC_DLLA_STATUS       0x064
+#define SDRC_DLLB_CTRL         0x068
+#define SDRC_DLLB_STATUS       0x06C
+#define SDRC_POWER             0x070
+#define SDRC_MCFG_0            0x080
+#define SDRC_MR_0              0x084
+#define SDRC_EMR2_0            0x08c
+#define SDRC_ACTIM_CTRL_A_0    0x09c
+#define SDRC_ACTIM_CTRL_B_0    0x0a0
+#define SDRC_RFR_CTRL_0                0x0a4
+#define SDRC_MANUAL_0          0x0a8
+#define SDRC_MCFG_1            0x0B0
+#define SDRC_MR_1              0x0B4
+#define SDRC_EMR2_1            0x0BC
+#define SDRC_ACTIM_CTRL_A_1    0x0C4
+#define SDRC_ACTIM_CTRL_B_1    0x0C8
+#define SDRC_RFR_CTRL_1                0x0D4
+#define SDRC_MANUAL_1          0x0D8
+
+#define SDRC_POWER_AUTOCOUNT_SHIFT     8
+#define SDRC_POWER_AUTOCOUNT_MASK      (0xffff << SDRC_POWER_AUTOCOUNT_SHIFT)
+#define SDRC_POWER_CLKCTRL_SHIFT       4
+#define SDRC_POWER_CLKCTRL_MASK                (0x3 << SDRC_POWER_CLKCTRL_SHIFT)
+#define SDRC_SELF_REFRESH_ON_AUTOCOUNT (0x2 << SDRC_POWER_CLKCTRL_SHIFT)
+
+/*
+ * These values represent the number of memory clock cycles between
+ * autorefresh initiation.  They assume 1 refresh per 64 ms (JEDEC), 8192
+ * rows per device, and include a subtraction of a 50 cycle window in the
+ * event that the autorefresh command is delayed due to other SDRC activity.
+ * The '| 1' sets the ARE field to send one autorefresh when the autorefresh
+ * counter reaches 0.
+ *
+ * These represent optimal values for common parts, it won't work for all.
+ * As long as you scale down, most parameters are still work, they just
+ * become sub-optimal. The RFR value goes in the opposite direction. If you
+ * don't adjust it down as your clock period increases the refresh interval
+ * will not be met. Setting all parameters for complete worst case may work,
+ * but may cut memory performance by 2x. Due to errata the DLLs need to be
+ * unlocked and their value needs run time calibration.        A dynamic call is
+ * need for that as no single right value exists acorss production samples.
+ *
+ * Only the FULL speed values are given. Current code is such that rate
+ * changes must be made at DPLLoutx2. The actual value adjustment for low
+ * frequency operation will be handled by omap_set_performance()
+ *
+ * By having the boot loader boot up in the fastest L4 speed available likely
+ * will result in something which you can switch between.
+ */
+#define SDRC_RFR_CTRL_165MHz   (0x00044c00 | 1)
+#define SDRC_RFR_CTRL_133MHz   (0x0003de00 | 1)
+#define SDRC_RFR_CTRL_100MHz   (0x0002da01 | 1)
+#define SDRC_RFR_CTRL_110MHz   (0x0002da01 | 1) /* Need to calc */
+#define SDRC_RFR_CTRL_BYPASS   (0x00005000 | 1) /* Need to calc */
+
+
+/*
+ * SMS register access
+ */
+
+#define OMAP242X_SMS_REGADDR(reg)                                      \
+               (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE + reg)
+#define OMAP243X_SMS_REGADDR(reg)                                      \
+               (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE + reg)
+#define OMAP343X_SMS_REGADDR(reg)                                      \
+               (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE + reg)
+
+/* SMS register offsets - read/write with sms_{read,write}_reg() */
+
+#define SMS_SYSCONFIG                  0x010
+/* REVISIT: fill in other SMS registers here */
+
+
+
 #endif
index 73e55e4853294cdd4c1fb1f443cd24b700378356..3b8bfdf848d546e552b1b9769516bd4639036339 100644 (file)
@@ -24,9 +24,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/clock.h>
-#include <plat/sram.h>
-#include <plat/sdrc.h>
+#include "../plat-omap/sram.h"
 
 #include "soc.h"
 #include "iomap.h"
index 0405c8190803a34ef666dd197a15f18dccdcad8f..812976eac5364818033e4626e31f14de24c5865f 100644 (file)
 #include <linux/console.h>
 
 #include <plat/omap-serial.h>
-#include "common.h"
-#include <plat/dma.h>
-#include <plat/omap_hwmod.h>
-#include <plat/omap_device.h>
-#include <plat/omap-pm.h>
-#include <plat/serial.h>
+#include <plat-omap/dma-omap.h>
 
+#include "common.h"
+#include "omap_hwmod.h"
+#include "omap_device.h"
+#include "omap-pm.h"
+#include "soc.h"
 #include "prm2xxx_3xxx.h"
 #include "pm.h"
 #include "cm2xxx_3xxx.h"
 #include "prm-regbits-34xx.h"
 #include "control.h"
 #include "mux.h"
+#include "serial.h"
 
 /*
  * NOTE: By default the serial auto_suspend timeout is disabled as it causes
diff --git a/arch/arm/mach-omap2/serial.h b/arch/arm/mach-omap2/serial.h
new file mode 100644 (file)
index 0000000..6a68062
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * arch/arm/plat-omap/include/mach/serial.h
+ *
+ * Copyright (C) 2009 Texas Instruments
+ * Added OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com>
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ASM_ARCH_SERIAL_H
+#define __ASM_ARCH_SERIAL_H
+
+#include <linux/init.h>
+
+/*
+ * Memory entry used for the DEBUG_LL UART configuration, relative to
+ * start of RAM. See also uncompress.h and debug-macro.S.
+ *
+ * Note that using a memory location for storing the UART configuration
+ * has at least two limitations:
+ *
+ * 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the
+ *    uncompress code could then partially overwrite itself
+ * 2. We assume printascii is called at least once before paging_init,
+ *    and addruart has a chance to read OMAP_UART_INFO
+ */
+#define OMAP_UART_INFO_OFS     0x3ffc
+
+/* OMAP2 serial ports */
+#define OMAP2_UART1_BASE       0x4806a000
+#define OMAP2_UART2_BASE       0x4806c000
+#define OMAP2_UART3_BASE       0x4806e000
+
+/* OMAP3 serial ports */
+#define OMAP3_UART1_BASE       OMAP2_UART1_BASE
+#define OMAP3_UART2_BASE       OMAP2_UART2_BASE
+#define OMAP3_UART3_BASE       0x49020000
+#define OMAP3_UART4_BASE       0x49042000      /* Only on 36xx */
+#define OMAP3_UART4_AM35XX_BASE        0x4809E000      /* Only on AM35xx */
+
+/* OMAP4 serial ports */
+#define OMAP4_UART1_BASE       OMAP2_UART1_BASE
+#define OMAP4_UART2_BASE       OMAP2_UART2_BASE
+#define OMAP4_UART3_BASE       0x48020000
+#define OMAP4_UART4_BASE       0x4806e000
+
+/* TI81XX serial ports */
+#define TI81XX_UART1_BASE      0x48020000
+#define TI81XX_UART2_BASE      0x48022000
+#define TI81XX_UART3_BASE      0x48024000
+
+/* AM3505/3517 UART4 */
+#define AM35XX_UART4_BASE      0x4809E000      /* Only on AM3505/3517 */
+
+/* AM33XX serial port */
+#define AM33XX_UART1_BASE      0x44E09000
+
+/* OMAP5 serial ports */
+#define OMAP5_UART1_BASE       OMAP2_UART1_BASE
+#define OMAP5_UART2_BASE       OMAP2_UART2_BASE
+#define OMAP5_UART3_BASE       OMAP4_UART3_BASE
+#define OMAP5_UART4_BASE       OMAP4_UART4_BASE
+#define OMAP5_UART5_BASE       0x48066000
+#define OMAP5_UART6_BASE       0x48068000
+
+/* External port on Zoom2/3 */
+#define ZOOM_UART_BASE         0x10000000
+#define ZOOM_UART_VIRT         0xfa400000
+
+#define OMAP_PORT_SHIFT                2
+#define ZOOM_PORT_SHIFT                1
+
+#define OMAP24XX_BASE_BAUD     (48000000/16)
+
+/*
+ * DEBUG_LL port encoding stored into the UART1 scratchpad register by
+ * decomp_setup in uncompress.h
+ */
+#define OMAP2UART1             21
+#define OMAP2UART2             22
+#define OMAP2UART3             23
+#define OMAP3UART1             OMAP2UART1
+#define OMAP3UART2             OMAP2UART2
+#define OMAP3UART3             33
+#define OMAP3UART4             34              /* Only on 36xx */
+#define OMAP4UART1             OMAP2UART1
+#define OMAP4UART2             OMAP2UART2
+#define OMAP4UART3             43
+#define OMAP4UART4             44
+#define TI81XXUART1            81
+#define TI81XXUART2            82
+#define TI81XXUART3            83
+#define AM33XXUART1            84
+#define OMAP5UART3             OMAP4UART3
+#define OMAP5UART4             OMAP4UART4
+#define ZOOM_UART              95              /* Only on zoom2/3 */
+
+#ifndef __ASSEMBLER__
+
+struct omap_board_data;
+struct omap_uart_port_info;
+
+extern void omap_serial_init(void);
+extern void omap_serial_board_init(struct omap_uart_port_info *platform_data);
+extern void omap_serial_init_port(struct omap_board_data *bdata,
+               struct omap_uart_port_info *platform_data);
+#endif
+
+#endif
index 506987979c1cd4e882f846968e550aa1b5ecfcc2..75afe11207ff2363c973bd7b692103b06b80a7d4 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <asm/assembler.h>
 
-#include <plat/sram.h>
+#include "../plat-omap/sram.h"
 
 #include "omap34xx.h"
 #include "iomap.h"
index fc9b96daf851cc84810399fc87626322e156db8e..070096496e205ca4b5a76fe293799840833b65c9 100644 (file)
@@ -1,7 +1,473 @@
-#include <plat/cpu.h>
+/*
+ * OMAP cpu type detection
+ *
+ * Copyright (C) 2004, 2008 Nokia Corporation
+ *
+ * Copyright (C) 2009-11 Texas Instruments.
+ *
+ * Written by Tony Lindgren <tony.lindgren@nokia.com>
+ *
+ * Added OMAP4/5 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
 #include "omap24xx.h"
 #include "omap34xx.h"
 #include "omap44xx.h"
 #include "ti81xx.h"
 #include "am33xx.h"
 #include "omap54xx.h"
+
+#ifndef __ASSEMBLY__
+
+#include <linux/bitops.h>
+
+/*
+ * Test if multicore OMAP support is needed
+ */
+#undef MULTI_OMAP2
+#undef OMAP_NAME
+
+#ifdef CONFIG_SOC_OMAP2420
+# ifdef OMAP_NAME
+#  undef  MULTI_OMAP2
+#  define MULTI_OMAP2
+# else
+#  define OMAP_NAME omap2420
+# endif
+#endif
+#ifdef CONFIG_SOC_OMAP2430
+# ifdef OMAP_NAME
+#  undef  MULTI_OMAP2
+#  define MULTI_OMAP2
+# else
+#  define OMAP_NAME omap2430
+# endif
+#endif
+#ifdef CONFIG_ARCH_OMAP3
+# ifdef OMAP_NAME
+#  undef  MULTI_OMAP2
+#  define MULTI_OMAP2
+# else
+#  define OMAP_NAME omap3
+# endif
+#endif
+#ifdef CONFIG_ARCH_OMAP4
+# ifdef OMAP_NAME
+#  undef  MULTI_OMAP2
+#  define MULTI_OMAP2
+# else
+#  define OMAP_NAME omap4
+# endif
+#endif
+
+#ifdef CONFIG_SOC_OMAP5
+# ifdef OMAP_NAME
+#  undef  MULTI_OMAP2
+#  define MULTI_OMAP2
+# else
+#  define OMAP_NAME omap5
+# endif
+#endif
+
+#ifdef CONFIG_SOC_AM33XX
+# ifdef OMAP_NAME
+#  undef  MULTI_OMAP2
+#  define MULTI_OMAP2
+# else
+#  define OMAP_NAME am33xx
+# endif
+#endif
+
+/*
+ * Omap device type i.e. EMU/HS/TST/GP/BAD
+ */
+#define OMAP2_DEVICE_TYPE_TEST         0
+#define OMAP2_DEVICE_TYPE_EMU          1
+#define OMAP2_DEVICE_TYPE_SEC          2
+#define OMAP2_DEVICE_TYPE_GP           3
+#define OMAP2_DEVICE_TYPE_BAD          4
+
+int omap_type(void);
+
+/*
+ * omap_rev bits:
+ * CPU id bits (0730, 1510, 1710, 2422...)     [31:16]
+ * CPU revision        (See _REV_ defined in cpu.h)    [15:08]
+ * CPU class bits (15xx, 16xx, 24xx, 34xx...)  [07:00]
+ */
+unsigned int omap_rev(void);
+
+/*
+ * Get the CPU revision for OMAP devices
+ */
+#define GET_OMAP_REVISION()    ((omap_rev() >> 8) & 0xff)
+
+/*
+ * Macros to group OMAP into cpu classes.
+ * These can be used in most places.
+ * cpu_is_omap24xx():  True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
+ * cpu_is_omap242x():  True for OMAP2420, OMAP2422, OMAP2423
+ * cpu_is_omap243x():  True for OMAP2430
+ * cpu_is_omap343x():  True for OMAP3430
+ * cpu_is_omap443x():  True for OMAP4430
+ * cpu_is_omap446x():  True for OMAP4460
+ * cpu_is_omap447x():  True for OMAP4470
+ * soc_is_omap543x():  True for OMAP5430, OMAP5432
+ */
+#define GET_OMAP_CLASS (omap_rev() & 0xff)
+
+#define IS_OMAP_CLASS(class, id)                       \
+static inline int is_omap ##class (void)               \
+{                                                      \
+       return (GET_OMAP_CLASS == (id)) ? 1 : 0;        \
+}
+
+#define GET_AM_CLASS   ((omap_rev() >> 24) & 0xff)
+
+#define IS_AM_CLASS(class, id)                         \
+static inline int is_am ##class (void)                 \
+{                                                      \
+       return (GET_AM_CLASS == (id)) ? 1 : 0;          \
+}
+
+#define GET_TI_CLASS   ((omap_rev() >> 24) & 0xff)
+
+#define IS_TI_CLASS(class, id)                 \
+static inline int is_ti ##class (void)         \
+{                                                      \
+       return (GET_TI_CLASS == (id)) ? 1 : 0;  \
+}
+
+#define GET_OMAP_SUBCLASS      ((omap_rev() >> 20) & 0x0fff)
+
+#define IS_OMAP_SUBCLASS(subclass, id)                 \
+static inline int is_omap ##subclass (void)            \
+{                                                      \
+       return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0;     \
+}
+
+#define IS_TI_SUBCLASS(subclass, id)                   \
+static inline int is_ti ##subclass (void)              \
+{                                                      \
+       return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0;     \
+}
+
+#define IS_AM_SUBCLASS(subclass, id)                   \
+static inline int is_am ##subclass (void)              \
+{                                                      \
+       return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0;     \
+}
+
+IS_OMAP_CLASS(24xx, 0x24)
+IS_OMAP_CLASS(34xx, 0x34)
+IS_OMAP_CLASS(44xx, 0x44)
+IS_AM_CLASS(35xx, 0x35)
+IS_OMAP_CLASS(54xx, 0x54)
+IS_AM_CLASS(33xx, 0x33)
+
+IS_TI_CLASS(81xx, 0x81)
+
+IS_OMAP_SUBCLASS(242x, 0x242)
+IS_OMAP_SUBCLASS(243x, 0x243)
+IS_OMAP_SUBCLASS(343x, 0x343)
+IS_OMAP_SUBCLASS(363x, 0x363)
+IS_OMAP_SUBCLASS(443x, 0x443)
+IS_OMAP_SUBCLASS(446x, 0x446)
+IS_OMAP_SUBCLASS(447x, 0x447)
+IS_OMAP_SUBCLASS(543x, 0x543)
+
+IS_TI_SUBCLASS(816x, 0x816)
+IS_TI_SUBCLASS(814x, 0x814)
+IS_AM_SUBCLASS(335x, 0x335)
+
+#define cpu_is_omap24xx()              0
+#define cpu_is_omap242x()              0
+#define cpu_is_omap243x()              0
+#define cpu_is_omap34xx()              0
+#define cpu_is_omap343x()              0
+#define cpu_is_ti81xx()                        0
+#define cpu_is_ti816x()                        0
+#define cpu_is_ti814x()                        0
+#define soc_is_am35xx()                        0
+#define soc_is_am33xx()                        0
+#define soc_is_am335x()                        0
+#define cpu_is_omap44xx()              0
+#define cpu_is_omap443x()              0
+#define cpu_is_omap446x()              0
+#define cpu_is_omap447x()              0
+#define soc_is_omap54xx()              0
+#define soc_is_omap543x()              0
+
+#if defined(MULTI_OMAP2)
+# if defined(CONFIG_ARCH_OMAP2)
+#  undef  cpu_is_omap24xx
+#  define cpu_is_omap24xx()            is_omap24xx()
+# endif
+# if defined (CONFIG_SOC_OMAP2420)
+#  undef  cpu_is_omap242x
+#  define cpu_is_omap242x()            is_omap242x()
+# endif
+# if defined (CONFIG_SOC_OMAP2430)
+#  undef  cpu_is_omap243x
+#  define cpu_is_omap243x()            is_omap243x()
+# endif
+# if defined(CONFIG_ARCH_OMAP3)
+#  undef  cpu_is_omap34xx
+#  undef  cpu_is_omap343x
+#  define cpu_is_omap34xx()            is_omap34xx()
+#  define cpu_is_omap343x()            is_omap343x()
+# endif
+#else
+# if defined(CONFIG_ARCH_OMAP2)
+#  undef  cpu_is_omap24xx
+#  define cpu_is_omap24xx()            1
+# endif
+# if defined(CONFIG_SOC_OMAP2420)
+#  undef  cpu_is_omap242x
+#  define cpu_is_omap242x()            1
+# endif
+# if defined(CONFIG_SOC_OMAP2430)
+#  undef  cpu_is_omap243x
+#  define cpu_is_omap243x()            1
+# endif
+# if defined(CONFIG_ARCH_OMAP3)
+#  undef  cpu_is_omap34xx
+#  define cpu_is_omap34xx()            1
+# endif
+# if defined(CONFIG_SOC_OMAP3430)
+#  undef  cpu_is_omap343x
+#  define cpu_is_omap343x()            1
+# endif
+#endif
+
+/*
+ * Macros to detect individual cpu types.
+ * These are only rarely needed.
+ * cpu_is_omap2420():  True for OMAP2420
+ * cpu_is_omap2422():  True for OMAP2422
+ * cpu_is_omap2423():  True for OMAP2423
+ * cpu_is_omap2430():  True for OMAP2430
+ * cpu_is_omap3430():  True for OMAP3430
+ */
+#define GET_OMAP_TYPE  ((omap_rev() >> 16) & 0xffff)
+
+#define IS_OMAP_TYPE(type, id)                         \
+static inline int is_omap ##type (void)                        \
+{                                                      \
+       return (GET_OMAP_TYPE == (id)) ? 1 : 0;         \
+}
+
+IS_OMAP_TYPE(2420, 0x2420)
+IS_OMAP_TYPE(2422, 0x2422)
+IS_OMAP_TYPE(2423, 0x2423)
+IS_OMAP_TYPE(2430, 0x2430)
+IS_OMAP_TYPE(3430, 0x3430)
+
+#define cpu_is_omap2420()              0
+#define cpu_is_omap2422()              0
+#define cpu_is_omap2423()              0
+#define cpu_is_omap2430()              0
+#define cpu_is_omap3430()              0
+#define cpu_is_omap3630()              0
+#define soc_is_omap5430()              0
+
+/* These are needed for the common code */
+#ifdef CONFIG_ARCH_OMAP2PLUS
+#define cpu_is_omap7xx()               0
+#define cpu_is_omap15xx()              0
+#define cpu_is_omap16xx()              0
+#define cpu_is_omap1510()              0
+#define cpu_is_omap1610()              0
+#define cpu_is_omap1611()              0
+#define cpu_is_omap1621()              0
+#define cpu_is_omap1710()              0
+#define cpu_class_is_omap1()           0
+#define cpu_class_is_omap2()           1
+#endif
+
+#if defined(CONFIG_ARCH_OMAP2)
+# undef  cpu_is_omap2420
+# undef  cpu_is_omap2422
+# undef  cpu_is_omap2423
+# undef  cpu_is_omap2430
+# define cpu_is_omap2420()             is_omap2420()
+# define cpu_is_omap2422()             is_omap2422()
+# define cpu_is_omap2423()             is_omap2423()
+# define cpu_is_omap2430()             is_omap2430()
+#endif
+
+#if defined(CONFIG_ARCH_OMAP3)
+# undef cpu_is_omap3430
+# undef cpu_is_ti81xx
+# undef cpu_is_ti816x
+# undef cpu_is_ti814x
+# undef soc_is_am35xx
+# define cpu_is_omap3430()             is_omap3430()
+# undef cpu_is_omap3630
+# define cpu_is_omap3630()             is_omap363x()
+# define cpu_is_ti81xx()               is_ti81xx()
+# define cpu_is_ti816x()               is_ti816x()
+# define cpu_is_ti814x()               is_ti814x()
+# define soc_is_am35xx()               is_am35xx()
+#endif
+
+# if defined(CONFIG_SOC_AM33XX)
+# undef soc_is_am33xx
+# undef soc_is_am335x
+# define soc_is_am33xx()               is_am33xx()
+# define soc_is_am335x()               is_am335x()
+#endif
+
+# if defined(CONFIG_ARCH_OMAP4)
+# undef cpu_is_omap44xx
+# undef cpu_is_omap443x
+# undef cpu_is_omap446x
+# undef cpu_is_omap447x
+# define cpu_is_omap44xx()             is_omap44xx()
+# define cpu_is_omap443x()             is_omap443x()
+# define cpu_is_omap446x()             is_omap446x()
+# define cpu_is_omap447x()             is_omap447x()
+# endif
+
+# if defined(CONFIG_SOC_OMAP5)
+# undef soc_is_omap54xx
+# undef soc_is_omap543x
+# define soc_is_omap54xx()             is_omap54xx()
+# define soc_is_omap543x()             is_omap543x()
+#endif
+
+/* Various silicon revisions for omap2 */
+#define OMAP242X_CLASS         0x24200024
+#define OMAP2420_REV_ES1_0     OMAP242X_CLASS
+#define OMAP2420_REV_ES2_0     (OMAP242X_CLASS | (0x1 << 8))
+
+#define OMAP243X_CLASS         0x24300024
+#define OMAP2430_REV_ES1_0     OMAP243X_CLASS
+
+#define OMAP343X_CLASS         0x34300034
+#define OMAP3430_REV_ES1_0     OMAP343X_CLASS
+#define OMAP3430_REV_ES2_0     (OMAP343X_CLASS | (0x1 << 8))
+#define OMAP3430_REV_ES2_1     (OMAP343X_CLASS | (0x2 << 8))
+#define OMAP3430_REV_ES3_0     (OMAP343X_CLASS | (0x3 << 8))
+#define OMAP3430_REV_ES3_1     (OMAP343X_CLASS | (0x4 << 8))
+#define OMAP3430_REV_ES3_1_2   (OMAP343X_CLASS | (0x5 << 8))
+
+#define OMAP363X_CLASS         0x36300034
+#define OMAP3630_REV_ES1_0     OMAP363X_CLASS
+#define OMAP3630_REV_ES1_1     (OMAP363X_CLASS | (0x1 << 8))
+#define OMAP3630_REV_ES1_2     (OMAP363X_CLASS | (0x2 << 8))
+
+#define TI816X_CLASS           0x81600034
+#define TI8168_REV_ES1_0       TI816X_CLASS
+#define TI8168_REV_ES1_1       (TI816X_CLASS | (0x1 << 8))
+
+#define TI814X_CLASS           0x81400034
+#define TI8148_REV_ES1_0       TI814X_CLASS
+#define TI8148_REV_ES2_0       (TI814X_CLASS | (0x1 << 8))
+#define TI8148_REV_ES2_1       (TI814X_CLASS | (0x2 << 8))
+
+#define AM35XX_CLASS           0x35170034
+#define AM35XX_REV_ES1_0       AM35XX_CLASS
+#define AM35XX_REV_ES1_1       (AM35XX_CLASS | (0x1 << 8))
+
+#define AM335X_CLASS           0x33500033
+#define AM335X_REV_ES1_0       AM335X_CLASS
+
+#define OMAP443X_CLASS         0x44300044
+#define OMAP4430_REV_ES1_0     (OMAP443X_CLASS | (0x10 << 8))
+#define OMAP4430_REV_ES2_0     (OMAP443X_CLASS | (0x20 << 8))
+#define OMAP4430_REV_ES2_1     (OMAP443X_CLASS | (0x21 << 8))
+#define OMAP4430_REV_ES2_2     (OMAP443X_CLASS | (0x22 << 8))
+#define OMAP4430_REV_ES2_3     (OMAP443X_CLASS | (0x23 << 8))
+
+#define OMAP446X_CLASS         0x44600044
+#define OMAP4460_REV_ES1_0     (OMAP446X_CLASS | (0x10 << 8))
+#define OMAP4460_REV_ES1_1     (OMAP446X_CLASS | (0x11 << 8))
+
+#define OMAP447X_CLASS         0x44700044
+#define OMAP4470_REV_ES1_0     (OMAP447X_CLASS | (0x10 << 8))
+
+#define OMAP54XX_CLASS         0x54000054
+#define OMAP5430_REV_ES1_0     (OMAP54XX_CLASS | (0x30 << 16) | (0x10 << 8))
+#define OMAP5432_REV_ES1_0     (OMAP54XX_CLASS | (0x32 << 16) | (0x10 << 8))
+
+void omap2xxx_check_revision(void);
+void omap3xxx_check_revision(void);
+void omap4xxx_check_revision(void);
+void omap5xxx_check_revision(void);
+void omap3xxx_check_features(void);
+void ti81xx_check_features(void);
+void omap4xxx_check_features(void);
+
+/*
+ * Runtime detection of OMAP3 features
+ *
+ * OMAP3_HAS_IO_CHAIN_CTRL: Some later members of the OMAP3 chip
+ *    family have OS-level control over the I/O chain clock.  This is
+ *    to avoid a window during which wakeups could potentially be lost
+ *    during powerdomain transitions.  If this bit is set, it
+ *    indicates that the chip does support OS-level control of this
+ *    feature.
+ */
+extern u32 omap_features;
+
+#define OMAP3_HAS_L2CACHE              BIT(0)
+#define OMAP3_HAS_IVA                  BIT(1)
+#define OMAP3_HAS_SGX                  BIT(2)
+#define OMAP3_HAS_NEON                 BIT(3)
+#define OMAP3_HAS_ISP                  BIT(4)
+#define OMAP3_HAS_192MHZ_CLK           BIT(5)
+#define OMAP3_HAS_IO_WAKEUP            BIT(6)
+#define OMAP3_HAS_SDRC                 BIT(7)
+#define OMAP3_HAS_IO_CHAIN_CTRL                BIT(8)
+#define OMAP4_HAS_MPU_1GHZ             BIT(9)
+#define OMAP4_HAS_MPU_1_2GHZ           BIT(10)
+#define OMAP4_HAS_MPU_1_5GHZ           BIT(11)
+
+
+#define OMAP3_HAS_FEATURE(feat,flag)                   \
+static inline unsigned int omap3_has_ ##feat(void)     \
+{                                                      \
+       return omap_features & OMAP3_HAS_ ##flag;       \
+}                                                      \
+
+OMAP3_HAS_FEATURE(l2cache, L2CACHE)
+OMAP3_HAS_FEATURE(sgx, SGX)
+OMAP3_HAS_FEATURE(iva, IVA)
+OMAP3_HAS_FEATURE(neon, NEON)
+OMAP3_HAS_FEATURE(isp, ISP)
+OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
+OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
+OMAP3_HAS_FEATURE(sdrc, SDRC)
+OMAP3_HAS_FEATURE(io_chain_ctrl, IO_CHAIN_CTRL)
+
+/*
+ * Runtime detection of OMAP4 features
+ */
+#define OMAP4_HAS_FEATURE(feat, flag)                  \
+static inline unsigned int omap4_has_ ##feat(void)     \
+{                                                      \
+       return omap_features & OMAP4_HAS_ ##flag;       \
+}                                                      \
+
+OMAP4_HAS_FEATURE(mpu_1ghz, MPU_1GHZ)
+OMAP4_HAS_FEATURE(mpu_1_2ghz, MPU_1_2GHZ)
+OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ)
+
+#endif /* __ASSEMBLY__ */
+
index f8217a5a4a26db510350dbeb9daf9f140fd2204d..b0e77a40704773a190b4510e496edf93cb1d61e3 100644 (file)
@@ -23,8 +23,8 @@
 #include <linux/slab.h>
 #include <linux/io.h>
 
-#include <plat/omap_device.h>
-
+#include "soc.h"
+#include "omap_device.h"
 #include "voltage.h"
 #include "control.h"
 #include "pm.h"
index 44f9aa7ec0c0a63e089137342accb6a52ab48ef7..565e5755c9bc9f9352a3876341e958c5a39a2074 100644 (file)
 #include <asm/sched_clock.h>
 
 #include <asm/arch_timer.h>
-#include <plat/omap_hwmod.h>
-#include <plat/omap_device.h>
+#include "omap_hwmod.h"
+#include "omap_device.h"
 #include <plat/dmtimer.h>
-#include <plat/omap-pm.h>
+#include "omap-pm.h"
 
 #include "soc.h"
 #include "common.h"
@@ -467,7 +467,7 @@ OMAP_SYS_TIMER(3_am33xx)
 #ifdef CONFIG_ARCH_OMAP4
 #ifdef CONFIG_LOCAL_TIMERS
 static DEFINE_TWD_LOCAL_TIMER(twd_local_timer,
-                             OMAP44XX_LOCAL_TWD_BASE, 29 + OMAP_INTC_START);
+                             OMAP44XX_LOCAL_TWD_BASE, 29);
 #endif
 
 static void __init omap4_timer_init(void)
index 635e109f5ad352e97e04dfad00c11e8728c72c98..827f54a1dd1d6fdb0deff2549bcd0ef65aea12d2 100644 (file)
@@ -26,9 +26,6 @@
 #include <linux/regulator/machine.h>
 #include <linux/regulator/fixed.h>
 
-#include <plat/i2c.h>
-#include <plat/usb.h>
-
 #include "soc.h"
 #include "twl-common.h"
 #include "pm.h"
index 3c434498e12e6faf034e1411d1b09b4b75a81c50..d1dbe125b34fa343e5aab112f060429096045fbf 100644 (file)
 
 #include <asm/io.h>
 
-#include <plat/usb.h>
-#include <plat/omap_device.h>
-
+#include "soc.h"
+#include "omap_device.h"
 #include "mux.h"
+#include "usb.h"
 
 #ifdef CONFIG_MFD_OMAP_USB_HOST
 
index 51da21cb78f1eba2237dc9b2ea7870ff91d538e3..7b33b375fe77d0f816268b0ce0e8f2f189203d3f 100644 (file)
 #include <linux/io.h>
 #include <linux/usb/musb.h>
 
-#include <plat/usb.h>
-#include <plat/omap_device.h>
-
-#include "am35xx.h"
-
+#include "omap_device.h"
+#include "soc.h"
 #include "mux.h"
+#include "usb.h"
 
 static struct musb_hdrc_config musb_config = {
        .multipoint     = 1,
index 805bea6edf1711adf0de68e8f68318bdd4c44b80..a8795ff19e6deb6f415ee01b584fb0047e40e27b 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
 #include <linux/export.h>
+#include <linux/platform_data/usb-omap.h>
 
 #include <linux/usb/musb.h>
 
-#include <plat/gpmc.h>
+#include "gpmc.h"
 
 #include "mux.h"
 
diff --git a/arch/arm/mach-omap2/usb.h b/arch/arm/mach-omap2/usb.h
new file mode 100644 (file)
index 0000000..9b986ea
--- /dev/null
@@ -0,0 +1,82 @@
+#include <linux/platform_data/usb-omap.h>
+
+/* AM35x */
+/* USB 2.0 PHY Control */
+#define CONF2_PHY_GPIOMODE     (1 << 23)
+#define CONF2_OTGMODE          (3 << 14)
+#define CONF2_NO_OVERRIDE      (0 << 14)
+#define CONF2_FORCE_HOST       (1 << 14)
+#define CONF2_FORCE_DEVICE     (2 << 14)
+#define CONF2_FORCE_HOST_VBUS_LOW (3 << 14)
+#define CONF2_SESENDEN         (1 << 13)
+#define CONF2_VBDTCTEN         (1 << 12)
+#define CONF2_REFFREQ_24MHZ    (2 << 8)
+#define CONF2_REFFREQ_26MHZ    (7 << 8)
+#define CONF2_REFFREQ_13MHZ    (6 << 8)
+#define CONF2_REFFREQ          (0xf << 8)
+#define CONF2_PHYCLKGD         (1 << 7)
+#define CONF2_VBUSSENSE                (1 << 6)
+#define CONF2_PHY_PLLON                (1 << 5)
+#define CONF2_RESET            (1 << 4)
+#define CONF2_PHYPWRDN         (1 << 3)
+#define CONF2_OTGPWRDN         (1 << 2)
+#define CONF2_DATPOL           (1 << 1)
+
+/* TI81XX specific definitions */
+#define USBCTRL0       0x620
+#define USBSTAT0       0x624
+
+/* TI816X PHY controls bits */
+#define TI816X_USBPHY0_NORMAL_MODE     (1 << 0)
+#define TI816X_USBPHY_REFCLK_OSC       (1 << 8)
+
+/* TI814X PHY controls bits */
+#define USBPHY_CM_PWRDN                (1 << 0)
+#define USBPHY_OTG_PWRDN       (1 << 1)
+#define USBPHY_CHGDET_DIS      (1 << 2)
+#define USBPHY_CHGDET_RSTRT    (1 << 3)
+#define USBPHY_SRCONDM         (1 << 4)
+#define USBPHY_SINKONDP                (1 << 5)
+#define USBPHY_CHGISINK_EN     (1 << 6)
+#define USBPHY_CHGVSRC_EN      (1 << 7)
+#define USBPHY_DMPULLUP                (1 << 8)
+#define USBPHY_DPPULLUP                (1 << 9)
+#define USBPHY_CDET_EXTCTL     (1 << 10)
+#define USBPHY_GPIO_MODE       (1 << 12)
+#define USBPHY_DPOPBUFCTL      (1 << 13)
+#define USBPHY_DMOPBUFCTL      (1 << 14)
+#define USBPHY_DPINPUT         (1 << 15)
+#define USBPHY_DMINPUT         (1 << 16)
+#define USBPHY_DPGPIO_PD       (1 << 17)
+#define USBPHY_DMGPIO_PD       (1 << 18)
+#define USBPHY_OTGVDET_EN      (1 << 19)
+#define USBPHY_OTGSESSEND_EN   (1 << 20)
+#define USBPHY_DATA_POLARITY   (1 << 23)
+
+struct usbhs_omap_board_data {
+       enum usbhs_omap_port_mode       port_mode[OMAP3_HS_USB_PORTS];
+
+       /* have to be valid if phy_reset is true and portx is in phy mode */
+       int     reset_gpio_port[OMAP3_HS_USB_PORTS];
+
+       /* Set this to true for ES2.x silicon */
+       unsigned                        es2_compatibility:1;
+
+       unsigned                        phy_reset:1;
+
+       /*
+        * Regulators for USB PHYs.
+        * Each PHY can have a separate regulator.
+        */
+       struct regulator                *regulator[OMAP3_HS_USB_PORTS];
+};
+
+extern void usb_musb_init(struct omap_musb_board_data *board_data);
+extern void usbhs_init(const struct usbhs_omap_board_data *pdata);
+
+extern void am35x_musb_reset(void);
+extern void am35x_musb_phy_power(u8 on);
+extern void am35x_musb_clear_irq(void);
+extern void am35x_set_mode(u8 musb_mode);
+extern void ti81xx_musb_phy_power(u8 on);
+
index b2f1c67043a2b61b3b391ddedf6b6b6da75e8177..f6b6c37ac3f45fe5de8b3131315f6189397f4a43 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/io.h>
 #include <linux/err.h>
 
-#include <plat/omap_hwmod.h>
+#include "omap_hwmod.h"
 
 #include "wd_timer.h"
 #include "common.h"
index f6bbba73b535873aafd10168a7d6ebaf725cacfa..a78f81034a9fd44ad201f7e5806372a57e618c18 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef __ARCH_ARM_MACH_OMAP2_WD_TIMER_H
 #define __ARCH_ARM_MACH_OMAP2_WD_TIMER_H
 
-#include <plat/omap_hwmod.h>
+#include "omap_hwmod.h"
 
 extern int omap2_wd_timer_disable(struct omap_hwmod *oh);
 extern int omap2_wd_timer_reset(struct omap_hwmod *oh);
diff --git a/arch/arm/mach-prima2/include/mach/gpio.h b/arch/arm/mach-prima2/include/mach/gpio.h
deleted file mode 100644 (file)
index 1904bb0..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __MACH_GPIO_H
-#define __MACH_GPIO_H
-
-/* Pull up/down values */
-enum sirfsoc_gpio_pull {
-       SIRFSOC_GPIO_PULL_NONE,
-       SIRFSOC_GPIO_PULL_UP,
-       SIRFSOC_GPIO_PULL_DOWN,
-};
-
-void sirfsoc_gpio_set_pull(unsigned gpio, unsigned mode);
-
-#endif
index 749220f91a7079e8a4a1e65561189497e9743c36..4407b17305396267b56d407f3ae80fb3dd4ef8b4 100644 (file)
@@ -163,7 +163,7 @@ static struct clk_lookup s3c2440_clk_lookup[] = {
        CLKDEV_INIT(NULL, "clk_uart_baud3", &s3c2440_clk_fclk_n),
 };
 
-static int s3c2440_clk_add(struct device *dev, struct subsys_interface *sif)
+static int __init_refok s3c2440_clk_add(struct device *dev, struct subsys_interface *sif)
 {
        struct clk *clock_upll;
        struct clk *clock_h;
index 2912eab3b967bddedb8a42e39747e9612f04d237..3cc8b1c21da9edffc4dfc7dd8a0d2288a4f69e05 100644 (file)
@@ -1196,7 +1196,7 @@ static void __init eva_init(void)
 
 #ifdef CONFIG_CACHE_L2X0
        /* Early BRESP enable, Shared attribute override enable, 32K*8way */
-       l2x0_init(__io(0xf0002000), 0x40440000, 0x82000fff);
+       l2x0_init(IOMEM(0xf0002000), 0x40440000, 0x82000fff);
 #endif
 
        i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices));
index 3cafb6ab5e9aafb09e900b4821e291eab3493e29..37b2a3133b3b8681f3de1cdf0511dc0d51013823 100644 (file)
 #include <linux/clkdev.h>
 #include <mach/common.h>
 
-#define FRQMR   0xffc80014
-#define MSTPCR0 0xffc80030
-#define MSTPCR1 0xffc80034
-#define MSTPCR3 0xffc8003c
-#define MSTPSR1 0xffc80044
-#define MSTPSR4 0xffc80048
-#define MSTPSR6 0xffc8004c
-#define MSTPCR4 0xffc80050
-#define MSTPCR5 0xffc80054
-#define MSTPCR6 0xffc80058
-#define MSTPCR7 0xffc80040
+#define FRQMR          IOMEM(0xffc80014)
+#define MSTPCR0                IOMEM(0xffc80030)
+#define MSTPCR1                IOMEM(0xffc80034)
+#define MSTPCR3                IOMEM(0xffc8003c)
+#define MSTPSR1                IOMEM(0xffc80044)
+#define MSTPSR4                IOMEM(0xffc80048)
+#define MSTPSR6                IOMEM(0xffc8004c)
+#define MSTPCR4                IOMEM(0xffc80050)
+#define MSTPCR5                IOMEM(0xffc80054)
+#define MSTPCR6                IOMEM(0xffc80058)
+#define MSTPCR7                IOMEM(0xffc80040)
 
 /* ioremap() through clock mapping mandatory to avoid
  * collision with ARM coherent DMA virtual memory range.
index 57e235f4ac74a81da9ff15619ca44a69bc0b1509..aa5325cd1c4289ab16d9a6566ac4ee8c740bbc24 100644 (file)
@@ -182,7 +182,7 @@ DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)")
        .init_early     = tegra20_init_early,
        .init_irq       = tegra_dt_init_irq,
        .handle_irq     = gic_handle_irq,
-       .timer          = &tegra_timer,
+       .timer          = &tegra_sys_timer,
        .init_machine   = tegra_dt_init,
        .init_late      = tegra_dt_init_late,
        .restart        = tegra_assert_system_reset,
index e4a676d4ddf720316ba5c7e96ed72e9ac7ad3616..5e92a81f9a2e24b6e02f7237a37d78229dda3543 100644 (file)
@@ -89,7 +89,7 @@ DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)")
        .init_early     = tegra30_init_early,
        .init_irq       = tegra_dt_init_irq,
        .handle_irq     = gic_handle_irq,
-       .timer          = &tegra_timer,
+       .timer          = &tegra_sys_timer,
        .init_machine   = tegra30_dt_init,
        .init_late      = tegra_init_late,
        .restart        = tegra_assert_system_reset,
index f88e5143c767989e7cc8e634635d858055f9de61..91fbe733a21eae9be6a5e24df8740ab3d3474efd 100644 (file)
@@ -55,5 +55,5 @@ static inline int harmony_pcie_init(void) { return 0; }
 
 void __init tegra_paz00_wifikill_init(void);
 
-extern struct sys_timer tegra_timer;
+extern struct sys_timer tegra_sys_timer;
 #endif
index cc9b5fd8c3d314d10c560074f9b833cb69bad4bc..8d398a33adf738e7c263ef04cba9b8e5eaa773b9 100644 (file)
@@ -953,6 +953,7 @@ PERIPH_CLK(pcie_xclk,       NULL,             "pcie_xclk",  74,     0,      26000000,  mux_clk_m,
 static struct clk *tegra_list_clks[] = {
        &tegra_apbdma,
        &tegra_rtc,
+       &tegra_timer,
        &tegra_i2s1,
        &tegra_i2s2,
        &tegra_spdif_out,
index 5cd502c271631d24a9c4e18af47afa5f8f752d1f..e9de5dfd94ec339e5f5c0c7c15eaad1f5a7944c4 100644 (file)
@@ -1199,7 +1199,7 @@ static long tegra30_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 {
        struct clk_tegra *c = to_clk_tegra(hw);
        unsigned long input_rate = *prate;
-       unsigned long output_rate = *prate;
+       u64 output_rate = *prate;
        const struct clk_pll_freq_table *sel;
        struct clk_pll_freq_table cfg;
        int mul;
index d92cb556ae351fb81b1a581133ac6400a3d84352..3d2e5532a9ea27d4a9eb561ddd1db0f65ecf46a0 100644 (file)
@@ -1143,6 +1143,7 @@ struct clk *tegra_list_clks[] = {
        &tegra_apbdma,
        &tegra_rtc,
        &tegra_kbc,
+       &tegra_timer,
        &tegra_kfuse,
        &tegra_fuse,
        &tegra_fuse_burn,
index eccdce983043a46439b67610c3fe2488c937faca..d3b8c8e7368fd938285438cafb6d77f2d5ee7ebf 100644 (file)
@@ -245,7 +245,7 @@ static void __init tegra_init_timer(void)
        register_persistent_clock(NULL, tegra_read_persistent_clock);
 }
 
-struct sys_timer tegra_timer = {
+struct sys_timer tegra_sys_timer = {
        .init = tegra_init_timer,
 };
 
index dacaee009a4efd21bdbcfd11ad0a820828316ef8..4bd0ace20e983d691cf3f76382b47b9dcdc940b3 100644 (file)
@@ -3,13 +3,12 @@
 #
 
 # Common support
-obj-y := common.o sram.o clock.o dma.o fb.o counter_32k.o
+obj-y := common.o sram.o dma.o fb.o counter_32k.o
 obj-m :=
 obj-n :=
 obj-  :=
 
 # omap_device support (OMAP2+ only at the moment)
-obj-$(CONFIG_ARCH_OMAP2PLUS) += omap_device.o
 
 obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
 obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
deleted file mode 100644 (file)
index 9d7ac20..0000000
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
- *  linux/arch/arm/plat-omap/clock.c
- *
- *  Copyright (C) 2004 - 2008 Nokia corporation
- *  Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
- *
- *  Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/export.h>
-#include <linux/err.h>
-#include <linux/string.h>
-#include <linux/clk.h>
-#include <linux/mutex.h>
-#include <linux/cpufreq.h>
-#include <linux/io.h>
-
-#include <plat/clock.h>
-
-static LIST_HEAD(clocks);
-static DEFINE_MUTEX(clocks_mutex);
-static DEFINE_SPINLOCK(clockfw_lock);
-
-static struct clk_functions *arch_clock;
-
-/*
- * Standard clock functions defined in include/linux/clk.h
- */
-
-int clk_enable(struct clk *clk)
-{
-       unsigned long flags;
-       int ret;
-
-       if (clk == NULL || IS_ERR(clk))
-               return -EINVAL;
-
-       if (!arch_clock || !arch_clock->clk_enable)
-               return -EINVAL;
-
-       spin_lock_irqsave(&clockfw_lock, flags);
-       ret = arch_clock->clk_enable(clk);
-       spin_unlock_irqrestore(&clockfw_lock, flags);
-
-       return ret;
-}
-EXPORT_SYMBOL(clk_enable);
-
-void clk_disable(struct clk *clk)
-{
-       unsigned long flags;
-
-       if (clk == NULL || IS_ERR(clk))
-               return;
-
-       if (!arch_clock || !arch_clock->clk_disable)
-               return;
-
-       spin_lock_irqsave(&clockfw_lock, flags);
-       if (clk->usecount == 0) {
-               pr_err("Trying disable clock %s with 0 usecount\n",
-                      clk->name);
-               WARN_ON(1);
-               goto out;
-       }
-
-       arch_clock->clk_disable(clk);
-
-out:
-       spin_unlock_irqrestore(&clockfw_lock, flags);
-}
-EXPORT_SYMBOL(clk_disable);
-
-unsigned long clk_get_rate(struct clk *clk)
-{
-       unsigned long flags;
-       unsigned long ret;
-
-       if (clk == NULL || IS_ERR(clk))
-               return 0;
-
-       spin_lock_irqsave(&clockfw_lock, flags);
-       ret = clk->rate;
-       spin_unlock_irqrestore(&clockfw_lock, flags);
-
-       return ret;
-}
-EXPORT_SYMBOL(clk_get_rate);
-
-/*
- * Optional clock functions defined in include/linux/clk.h
- */
-
-long clk_round_rate(struct clk *clk, unsigned long rate)
-{
-       unsigned long flags;
-       long ret;
-
-       if (clk == NULL || IS_ERR(clk))
-               return 0;
-
-       if (!arch_clock || !arch_clock->clk_round_rate)
-               return 0;
-
-       spin_lock_irqsave(&clockfw_lock, flags);
-       ret = arch_clock->clk_round_rate(clk, rate);
-       spin_unlock_irqrestore(&clockfw_lock, flags);
-
-       return ret;
-}
-EXPORT_SYMBOL(clk_round_rate);
-
-int clk_set_rate(struct clk *clk, unsigned long rate)
-{
-       unsigned long flags;
-       int ret = -EINVAL;
-
-       if (clk == NULL || IS_ERR(clk))
-               return ret;
-
-       if (!arch_clock || !arch_clock->clk_set_rate)
-               return ret;
-
-       spin_lock_irqsave(&clockfw_lock, flags);
-       ret = arch_clock->clk_set_rate(clk, rate);
-       if (ret == 0)
-               propagate_rate(clk);
-       spin_unlock_irqrestore(&clockfw_lock, flags);
-
-       return ret;
-}
-EXPORT_SYMBOL(clk_set_rate);
-
-int clk_set_parent(struct clk *clk, struct clk *parent)
-{
-       unsigned long flags;
-       int ret = -EINVAL;
-
-       if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent))
-               return ret;
-
-       if (!arch_clock || !arch_clock->clk_set_parent)
-               return ret;
-
-       spin_lock_irqsave(&clockfw_lock, flags);
-       if (clk->usecount == 0) {
-               ret = arch_clock->clk_set_parent(clk, parent);
-               if (ret == 0)
-                       propagate_rate(clk);
-       } else
-               ret = -EBUSY;
-       spin_unlock_irqrestore(&clockfw_lock, flags);
-
-       return ret;
-}
-EXPORT_SYMBOL(clk_set_parent);
-
-struct clk *clk_get_parent(struct clk *clk)
-{
-       return clk->parent;
-}
-EXPORT_SYMBOL(clk_get_parent);
-
-/*
- * OMAP specific clock functions shared between omap1 and omap2
- */
-
-int __initdata mpurate;
-
-/*
- * By default we use the rate set by the bootloader.
- * You can override this with mpurate= cmdline option.
- */
-static int __init omap_clk_setup(char *str)
-{
-       get_option(&str, &mpurate);
-
-       if (!mpurate)
-               return 1;
-
-       if (mpurate < 1000)
-               mpurate *= 1000000;
-
-       return 1;
-}
-__setup("mpurate=", omap_clk_setup);
-
-/* Used for clocks that always have same value as the parent clock */
-unsigned long followparent_recalc(struct clk *clk)
-{
-       return clk->parent->rate;
-}
-
-/*
- * Used for clocks that have the same value as the parent clock,
- * divided by some factor
- */
-unsigned long omap_fixed_divisor_recalc(struct clk *clk)
-{
-       WARN_ON(!clk->fixed_div);
-
-       return clk->parent->rate / clk->fixed_div;
-}
-
-void clk_reparent(struct clk *child, struct clk *parent)
-{
-       list_del_init(&child->sibling);
-       if (parent)
-               list_add(&child->sibling, &parent->children);
-       child->parent = parent;
-
-       /* now do the debugfs renaming to reattach the child
-          to the proper parent */
-}
-
-/* Propagate rate to children */
-void propagate_rate(struct clk *tclk)
-{
-       struct clk *clkp;
-
-       list_for_each_entry(clkp, &tclk->children, sibling) {
-               if (clkp->recalc)
-                       clkp->rate = clkp->recalc(clkp);
-               propagate_rate(clkp);
-       }
-}
-
-static LIST_HEAD(root_clks);
-
-/**
- * recalculate_root_clocks - recalculate and propagate all root clocks
- *
- * Recalculates all root clocks (clocks with no parent), which if the
- * clock's .recalc is set correctly, should also propagate their rates.
- * Called at init.
- */
-void recalculate_root_clocks(void)
-{
-       struct clk *clkp;
-
-       list_for_each_entry(clkp, &root_clks, sibling) {
-               if (clkp->recalc)
-                       clkp->rate = clkp->recalc(clkp);
-               propagate_rate(clkp);
-       }
-}
-
-/**
- * clk_preinit - initialize any fields in the struct clk before clk init
- * @clk: struct clk * to initialize
- *
- * Initialize any struct clk fields needed before normal clk initialization
- * can run.  No return value.
- */
-void clk_preinit(struct clk *clk)
-{
-       INIT_LIST_HEAD(&clk->children);
-}
-
-int clk_register(struct clk *clk)
-{
-       if (clk == NULL || IS_ERR(clk))
-               return -EINVAL;
-
-       /*
-        * trap out already registered clocks
-        */
-       if (clk->node.next || clk->node.prev)
-               return 0;
-
-       mutex_lock(&clocks_mutex);
-       if (clk->parent)
-               list_add(&clk->sibling, &clk->parent->children);
-       else
-               list_add(&clk->sibling, &root_clks);
-
-       list_add(&clk->node, &clocks);
-       if (clk->init)
-               clk->init(clk);
-       mutex_unlock(&clocks_mutex);
-
-       return 0;
-}
-EXPORT_SYMBOL(clk_register);
-
-void clk_unregister(struct clk *clk)
-{
-       if (clk == NULL || IS_ERR(clk))
-               return;
-
-       mutex_lock(&clocks_mutex);
-       list_del(&clk->sibling);
-       list_del(&clk->node);
-       mutex_unlock(&clocks_mutex);
-}
-EXPORT_SYMBOL(clk_unregister);
-
-void clk_enable_init_clocks(void)
-{
-       struct clk *clkp;
-
-       list_for_each_entry(clkp, &clocks, node) {
-               if (clkp->flags & ENABLE_ON_INIT)
-                       clk_enable(clkp);
-       }
-}
-
-int omap_clk_enable_autoidle_all(void)
-{
-       struct clk *c;
-       unsigned long flags;
-
-       spin_lock_irqsave(&clockfw_lock, flags);
-
-       list_for_each_entry(c, &clocks, node)
-               if (c->ops->allow_idle)
-                       c->ops->allow_idle(c);
-
-       spin_unlock_irqrestore(&clockfw_lock, flags);
-
-       return 0;
-}
-
-int omap_clk_disable_autoidle_all(void)
-{
-       struct clk *c;
-       unsigned long flags;
-
-       spin_lock_irqsave(&clockfw_lock, flags);
-
-       list_for_each_entry(c, &clocks, node)
-               if (c->ops->deny_idle)
-                       c->ops->deny_idle(c);
-
-       spin_unlock_irqrestore(&clockfw_lock, flags);
-
-       return 0;
-}
-
-/*
- * Low level helpers
- */
-static int clkll_enable_null(struct clk *clk)
-{
-       return 0;
-}
-
-static void clkll_disable_null(struct clk *clk)
-{
-}
-
-const struct clkops clkops_null = {
-       .enable         = clkll_enable_null,
-       .disable        = clkll_disable_null,
-};
-
-/*
- * Dummy clock
- *
- * Used for clock aliases that are needed on some OMAPs, but not others
- */
-struct clk dummy_ck = {
-       .name   = "dummy",
-       .ops    = &clkops_null,
-};
-
-/*
- *
- */
-
-#ifdef CONFIG_OMAP_RESET_CLOCKS
-/*
- * Disable any unused clocks left on by the bootloader
- */
-static int __init clk_disable_unused(void)
-{
-       struct clk *ck;
-       unsigned long flags;
-
-       if (!arch_clock || !arch_clock->clk_disable_unused)
-               return 0;
-
-       pr_info("clock: disabling unused clocks to save power\n");
-
-       spin_lock_irqsave(&clockfw_lock, flags);
-       list_for_each_entry(ck, &clocks, node) {
-               if (ck->ops == &clkops_null)
-                       continue;
-
-               if (ck->usecount > 0 || !ck->enable_reg)
-                       continue;
-
-               arch_clock->clk_disable_unused(ck);
-       }
-       spin_unlock_irqrestore(&clockfw_lock, flags);
-
-       return 0;
-}
-late_initcall(clk_disable_unused);
-late_initcall(omap_clk_enable_autoidle_all);
-#endif
-
-int __init clk_init(struct clk_functions * custom_clocks)
-{
-       if (!custom_clocks) {
-               pr_err("No custom clock functions registered\n");
-               BUG();
-       }
-
-       arch_clock = custom_clocks;
-
-       return 0;
-}
-
-#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
-/*
- *     debugfs support to trace clock tree hierarchy and attributes
- */
-
-#include <linux/debugfs.h>
-#include <linux/seq_file.h>
-
-static struct dentry *clk_debugfs_root;
-
-static int clk_dbg_show_summary(struct seq_file *s, void *unused)
-{
-       struct clk *c;
-       struct clk *pa;
-
-       mutex_lock(&clocks_mutex);
-       seq_printf(s, "%-30s %-30s %-10s %s\n",
-               "clock-name", "parent-name", "rate", "use-count");
-
-       list_for_each_entry(c, &clocks, node) {
-               pa = c->parent;
-               seq_printf(s, "%-30s %-30s %-10lu %d\n",
-                       c->name, pa ? pa->name : "none", c->rate, c->usecount);
-       }
-       mutex_unlock(&clocks_mutex);
-
-       return 0;
-}
-
-static int clk_dbg_open(struct inode *inode, struct file *file)
-{
-       return single_open(file, clk_dbg_show_summary, inode->i_private);
-}
-
-static const struct file_operations debug_clock_fops = {
-       .open           = clk_dbg_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
-};
-
-static int clk_debugfs_register_one(struct clk *c)
-{
-       int err;
-       struct dentry *d;
-       struct clk *pa = c->parent;
-
-       d = debugfs_create_dir(c->name, pa ? pa->dent : clk_debugfs_root);
-       if (!d)
-               return -ENOMEM;
-       c->dent = d;
-
-       d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount);
-       if (!d) {
-               err = -ENOMEM;
-               goto err_out;
-       }
-       d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
-       if (!d) {
-               err = -ENOMEM;
-               goto err_out;
-       }
-       d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags);
-       if (!d) {
-               err = -ENOMEM;
-               goto err_out;
-       }
-       return 0;
-
-err_out:
-       debugfs_remove_recursive(c->dent);
-       return err;
-}
-
-static int clk_debugfs_register(struct clk *c)
-{
-       int err;
-       struct clk *pa = c->parent;
-
-       if (pa && !pa->dent) {
-               err = clk_debugfs_register(pa);
-               if (err)
-                       return err;
-       }
-
-       if (!c->dent) {
-               err = clk_debugfs_register_one(c);
-               if (err)
-                       return err;
-       }
-       return 0;
-}
-
-static int __init clk_debugfs_init(void)
-{
-       struct clk *c;
-       struct dentry *d;
-       int err;
-
-       d = debugfs_create_dir("clock", NULL);
-       if (!d)
-               return -ENOMEM;
-       clk_debugfs_root = d;
-
-       list_for_each_entry(c, &clocks, node) {
-               err = clk_debugfs_register(c);
-               if (err)
-                       goto err_out;
-       }
-
-       d = debugfs_create_file("summary", S_IRUGO,
-               d, NULL, &debug_clock_fops);
-       if (!d)
-               return -ENOMEM;
-
-       return 0;
-err_out:
-       debugfs_remove_recursive(clk_debugfs_root);
-       return err;
-}
-late_initcall(clk_debugfs_init);
-
-#endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */
index 111315a69354943450be64243490a697bb1e3f23..a1555e0281233bb72087378f02aa261164aa7a15 100644 (file)
 #include <linux/io.h>
 #include <linux/dma-mapping.h>
 
-#include <plat/common.h>
-#include <plat/vram.h>
-#include <linux/platform_data/dsp-omap.h>
-#include <plat/dma.h>
-
-#include <plat/omap-secure.h>
-
-void __init omap_reserve(void)
-{
-       omap_vram_reserve_sdram_memblock();
-       omap_dsp_reserve_sdram_memblock();
-       omap_secure_ram_reserve_memblock();
-       omap_barrier_reserve_memblock();
-}
+#include "common.h"
+#include <plat-omap/dma-omap.h>
 
 void __init omap_init_consistent_dma_size(void)
 {
@@ -37,12 +25,3 @@ void __init omap_init_consistent_dma_size(void)
        init_consistent_dma_size(CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE << 20);
 #endif
 }
-
-/*
- * Stub function for OMAP2 so that common files
- * continue to build when custom builds are used
- */
-int __weak omap_secure_ram_reserve_memblock(void)
-{
-       return 0;
-}
diff --git a/arch/arm/plat-omap/common.h b/arch/arm/plat-omap/common.h
new file mode 100644 (file)
index 0000000..8ae0542
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Header for shared OMAP code in plat-omap.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the  GNU General Public License along
+ * with this program; if not, write  to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP_COMMON_H
+#define __ARCH_ARM_MACH_OMAP_COMMON_H
+
+extern int __init omap_init_clocksource_32k(void __iomem *vbase);
+
+extern void __init omap_check_revision(void);
+
+extern void omap_reserve(void);
+struct omap_hwmod;
+extern int omap_dss_reset(struct omap_hwmod *);
+
+#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
index 87ba8dd0d7910c2072e2b22fa5f4a4f58f79fbc9..66bf3f9324fe77e1c73e1f82419af657222670b9 100644 (file)
@@ -22,8 +22,7 @@
 #include <asm/mach/time.h>
 #include <asm/sched_clock.h>
 
-#include <plat/common.h>
-#include <plat/clock.h>
+#include "common.h"
 
 /* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */
 #define OMAP2_32KSYNCNT_REV_OFF                0x0
index c7a4c0902b386f90e8e6d37a21fc7ead498b6ea5..5a4678edd65a9a8eb31a766fd566ee86a968e8f9 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/smc91x.h>
 
 #include <mach/hardware.h>
+#include "../mach-omap2/debug-devices.h"
 
 /* Many OMAP development platforms reuse the same "debug board"; these
  * platforms include H2, H3, H4, and Perseus2.
index ea29bbe8e5cfd5168a864e9fa53783376dcfefab..feca128bc8edd408b31c9eabedc02cac6299a15a 100644 (file)
@@ -20,7 +20,7 @@
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
 
-#include <plat/fpga.h>
+#include "fpga.h"
 
 /* Many OMAP development platforms reuse the same "debug board"; these
  * platforms include H2, H3, H4, and Perseus2.  There are 16 LEDs on the
index c76ed8bff8389c752f389ac0c26253ff39dc4802..49803cc18787fe3fbe0522ccf7a5031bbd5d160e 100644 (file)
 #include <linux/slab.h>
 #include <linux/delay.h>
 
-#include <plat/cpu.h>
-#include <plat/dma.h>
-#include <plat/tc.h>
+#include <plat-omap/dma-omap.h>
+
+#include "../mach-omap1/soc.h"
+#include "../mach-omap2/soc.h"
 
 /*
  * MAX_LOGICAL_DMA_CH_COUNT: the maximum number of logical DMA
@@ -175,6 +176,7 @@ static inline void set_gdma_dev(int req, int dev)
 #define omap_writel(val, reg)  do {} while (0)
 #endif
 
+#ifdef CONFIG_ARCH_OMAP1
 void omap_set_dma_priority(int lch, int dst_port, int priority)
 {
        unsigned long reg;
@@ -203,18 +205,22 @@ void omap_set_dma_priority(int lch, int dst_port, int priority)
                l |= (priority & 0xf) << 8;
                omap_writel(l, reg);
        }
+}
+#endif
 
-       if (cpu_class_is_omap2()) {
-               u32 ccr;
+#ifdef CONFIG_ARCH_OMAP2PLUS
+void omap_set_dma_priority(int lch, int dst_port, int priority)
+{
+       u32 ccr;
 
-               ccr = p->dma_read(CCR, lch);
-               if (priority)
-                       ccr |= (1 << 6);
-               else
-                       ccr &= ~(1 << 6);
-               p->dma_write(ccr, CCR, lch);
-       }
+       ccr = p->dma_read(CCR, lch);
+       if (priority)
+               ccr |= (1 << 6);
+       else
+               ccr &= ~(1 << 6);
+       p->dma_write(ccr, CCR, lch);
 }
+#endif
 EXPORT_SYMBOL(omap_set_dma_priority);
 
 void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
index 938b50a33439b092202de715e81267b18b5f73cb..4a0b30a4ebda90fb81a1d4c3518626dd6192a86f 100644 (file)
 #include <linux/pm_runtime.h>
 
 #include <plat/dmtimer.h>
-#include <plat/omap-pm.h>
 
 #include <mach/hardware.h>
 
+#include "../mach-omap2/omap-pm.h"
+
 static u32 omap_reserved_systimers;
 static LIST_HEAD(omap_timer_list);
 static DEFINE_SPINLOCK(dm_timer_lock);
index bcbb9d5dc293e4066264dc6aba714af8aa6594f4..f868caeedfd6a545ee31f279680dbc52fbdf38fe 100644 (file)
 #include <mach/hardware.h>
 #include <asm/mach/map.h>
 
+#include <plat/cpu.h>
+
+#ifdef CONFIG_OMAP2_VRFB
+
+/*
+ * The first memory resource is the register region for VRFB,
+ * the rest are VRFB virtual memory areas for each VRFB context.
+ */
+
+static const struct resource omap2_vrfb_resources[] = {
+       DEFINE_RES_MEM_NAMED(0x68008000u, 0x40, "vrfb-regs"),
+       DEFINE_RES_MEM_NAMED(0x70000000u, 0x4000000, "vrfb-area-0"),
+       DEFINE_RES_MEM_NAMED(0x74000000u, 0x4000000, "vrfb-area-1"),
+       DEFINE_RES_MEM_NAMED(0x78000000u, 0x4000000, "vrfb-area-2"),
+       DEFINE_RES_MEM_NAMED(0x7c000000u, 0x4000000, "vrfb-area-3"),
+};
+
+static const struct resource omap3_vrfb_resources[] = {
+       DEFINE_RES_MEM_NAMED(0x6C000180u, 0xc0, "vrfb-regs"),
+       DEFINE_RES_MEM_NAMED(0x70000000u, 0x4000000, "vrfb-area-0"),
+       DEFINE_RES_MEM_NAMED(0x74000000u, 0x4000000, "vrfb-area-1"),
+       DEFINE_RES_MEM_NAMED(0x78000000u, 0x4000000, "vrfb-area-2"),
+       DEFINE_RES_MEM_NAMED(0x7c000000u, 0x4000000, "vrfb-area-3"),
+       DEFINE_RES_MEM_NAMED(0xe0000000u, 0x4000000, "vrfb-area-4"),
+       DEFINE_RES_MEM_NAMED(0xe4000000u, 0x4000000, "vrfb-area-5"),
+       DEFINE_RES_MEM_NAMED(0xe8000000u, 0x4000000, "vrfb-area-6"),
+       DEFINE_RES_MEM_NAMED(0xec000000u, 0x4000000, "vrfb-area-7"),
+       DEFINE_RES_MEM_NAMED(0xf0000000u, 0x4000000, "vrfb-area-8"),
+       DEFINE_RES_MEM_NAMED(0xf4000000u, 0x4000000, "vrfb-area-9"),
+       DEFINE_RES_MEM_NAMED(0xf8000000u, 0x4000000, "vrfb-area-10"),
+       DEFINE_RES_MEM_NAMED(0xfc000000u, 0x4000000, "vrfb-area-11"),
+};
+
+static int __init omap_init_vrfb(void)
+{
+       struct platform_device *pdev;
+       const struct resource *res;
+       unsigned int num_res;
+
+       if (cpu_is_omap24xx()) {
+               res = omap2_vrfb_resources;
+               num_res = ARRAY_SIZE(omap2_vrfb_resources);
+       } else if (cpu_is_omap34xx()) {
+               res = omap3_vrfb_resources;
+               num_res = ARRAY_SIZE(omap3_vrfb_resources);
+       } else {
+               return 0;
+       }
+
+       pdev = platform_device_register_resndata(NULL, "omapvrfb", -1,
+                       res, num_res, NULL, 0);
+
+       if (IS_ERR(pdev))
+               return PTR_ERR(pdev);
+       else
+               return 0;
+}
+
+arch_initcall(omap_init_vrfb);
+#endif
+
 #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
 
 static bool omapfb_lcd_configured;
diff --git a/arch/arm/plat-omap/fpga.h b/arch/arm/plat-omap/fpga.h
new file mode 100644 (file)
index 0000000..54faaa9
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * arch/arm/plat-omap/include/mach/fpga.h
+ *
+ * Interrupt handler for OMAP-1510 FPGA
+ *
+ * Copyright (C) 2001 RidgeRun, Inc.
+ * Author: Greg Lonnon <glonnon@ridgerun.com>
+ *
+ * Copyright (C) 2002 MontaVista Software, Inc.
+ *
+ * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6
+ * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_ARCH_OMAP_FPGA_H
+#define __ASM_ARCH_OMAP_FPGA_H
+
+/*
+ * ---------------------------------------------------------------------------
+ *  H2/P2 Debug board FPGA
+ * ---------------------------------------------------------------------------
+ */
+/* maps in the FPGA registers and the ETHR registers */
+#define H2P2_DBG_FPGA_BASE             0xE8000000              /* VA */
+#define H2P2_DBG_FPGA_SIZE             SZ_4K                   /* SIZE */
+#define H2P2_DBG_FPGA_START            0x04000000              /* PA */
+
+#define H2P2_DBG_FPGA_ETHR_START       (H2P2_DBG_FPGA_START + 0x300)
+#define H2P2_DBG_FPGA_FPGA_REV         IOMEM(H2P2_DBG_FPGA_BASE + 0x10)        /* FPGA Revision */
+#define H2P2_DBG_FPGA_BOARD_REV                IOMEM(H2P2_DBG_FPGA_BASE + 0x12)        /* Board Revision */
+#define H2P2_DBG_FPGA_GPIO             IOMEM(H2P2_DBG_FPGA_BASE + 0x14)        /* GPIO outputs */
+#define H2P2_DBG_FPGA_LEDS             IOMEM(H2P2_DBG_FPGA_BASE + 0x16)        /* LEDs outputs */
+#define H2P2_DBG_FPGA_MISC_INPUTS      IOMEM(H2P2_DBG_FPGA_BASE + 0x18)        /* Misc inputs */
+#define H2P2_DBG_FPGA_LAN_STATUS       IOMEM(H2P2_DBG_FPGA_BASE + 0x1A)        /* LAN Status line */
+#define H2P2_DBG_FPGA_LAN_RESET                IOMEM(H2P2_DBG_FPGA_BASE + 0x1C)        /* LAN Reset line */
+
+/* NOTE:  most boards don't have a static mapping for the FPGA ... */
+struct h2p2_dbg_fpga {
+       /* offset 0x00 */
+       u16             smc91x[8];
+       /* offset 0x10 */
+       u16             fpga_rev;
+       u16             board_rev;
+       u16             gpio_outputs;
+       u16             leds;
+       /* offset 0x18 */
+       u16             misc_inputs;
+       u16             lan_status;
+       u16             lan_reset;
+       u16             reserved0;
+       /* offset 0x20 */
+       u16             ps2_data;
+       u16             ps2_ctrl;
+       /* plus also 4 rs232 ports ... */
+};
+
+/* LEDs definition on debug board (16 LEDs, all physically green) */
+#define H2P2_DBG_FPGA_LED_GREEN                (1 << 15)
+#define H2P2_DBG_FPGA_LED_AMBER                (1 << 14)
+#define H2P2_DBG_FPGA_LED_RED          (1 << 13)
+#define H2P2_DBG_FPGA_LED_BLUE         (1 << 12)
+/*  cpu0 load-meter LEDs */
+#define H2P2_DBG_FPGA_LOAD_METER       (1 << 0)        // A bit of fun on our board ...
+#define H2P2_DBG_FPGA_LOAD_METER_SIZE  11
+#define H2P2_DBG_FPGA_LOAD_METER_MASK  ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1)
+
+#define H2P2_DBG_FPGA_P2_LED_TIMER             (1 << 0)
+#define H2P2_DBG_FPGA_P2_LED_IDLE              (1 << 1)
+
+#endif
index a5683a84c6ee0e313cb8f9daeeb7c72106952a4e..be6deb7c12ec8fe9df3bef6315814b6e1206ed68 100644 (file)
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/i2c.h>
+#include <linux/i2c-omap.h>
 #include <linux/slab.h>
 #include <linux/err.h>
 #include <linux/clk.h>
 
 #include <mach/irqs.h>
-#include <plat/i2c.h>
-#include <plat/omap_device.h>
 
-#define OMAP_I2C_SIZE          0x3f
-#define OMAP1_I2C_BASE         0xfffb3800
-#define OMAP1_INT_I2C          (32 + 4)
+#include "../mach-omap1/soc.h"
+#include "../mach-omap2/soc.h"
 
-static const char name[] = "omap_i2c";
+#include "i2c.h"
 
-#define I2C_RESOURCE_BUILDER(base, irq)                        \
-       {                                               \
-               .start  = (base),                       \
-               .end    = (base) + OMAP_I2C_SIZE,       \
-               .flags  = IORESOURCE_MEM,               \
-       },                                              \
-       {                                               \
-               .start  = (irq),                        \
-               .flags  = IORESOURCE_IRQ,               \
-       },
-
-static struct resource i2c_resources[][2] = {
-       { I2C_RESOURCE_BUILDER(0, 0) },
-};
-
-#define I2C_DEV_BUILDER(bus_id, res, data)             \
-       {                                               \
-               .id     = (bus_id),                     \
-               .name   = name,                         \
-               .num_resources  = ARRAY_SIZE(res),      \
-               .resource       = (res),                \
-               .dev            = {                     \
-                       .platform_data  = (data),       \
-               },                                      \
-       }
-
-#define MAX_OMAP_I2C_HWMOD_NAME_LEN    16
 #define OMAP_I2C_MAX_CONTROLLERS 4
 static struct omap_i2c_bus_platform_data i2c_pdata[OMAP_I2C_MAX_CONTROLLERS];
-static struct platform_device omap_i2c_devices[] = {
-       I2C_DEV_BUILDER(1, i2c_resources[0], &i2c_pdata[0]),
-};
 
 #define OMAP_I2C_CMDLINE_SETUP (BIT(31))
 
@@ -91,95 +59,6 @@ static int __init omap_i2c_nr_ports(void)
        return ports;
 }
 
-static inline int omap1_i2c_add_bus(int bus_id)
-{
-       struct platform_device *pdev;
-       struct omap_i2c_bus_platform_data *pdata;
-       struct resource *res;
-
-       omap1_i2c_mux_pins(bus_id);
-
-       pdev = &omap_i2c_devices[bus_id - 1];
-       res = pdev->resource;
-       res[0].start = OMAP1_I2C_BASE;
-       res[0].end = res[0].start + OMAP_I2C_SIZE;
-       res[1].start = OMAP1_INT_I2C;
-       pdata = &i2c_pdata[bus_id - 1];
-
-       /* all OMAP1 have IP version 1 register set */
-       pdata->rev = OMAP_I2C_IP_VERSION_1;
-
-       /* all OMAP1 I2C are implemented like this */
-       pdata->flags = OMAP_I2C_FLAG_NO_FIFO |
-                      OMAP_I2C_FLAG_SIMPLE_CLOCK |
-                      OMAP_I2C_FLAG_16BIT_DATA_REG |
-                      OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK;
-
-       /* how the cpu bus is wired up differs for 7xx only */
-
-       if (cpu_is_omap7xx())
-               pdata->flags |= OMAP_I2C_FLAG_BUS_SHIFT_1;
-       else
-               pdata->flags |= OMAP_I2C_FLAG_BUS_SHIFT_2;
-
-       return platform_device_register(pdev);
-}
-
-
-#ifdef CONFIG_ARCH_OMAP2PLUS
-static inline int omap2_i2c_add_bus(int bus_id)
-{
-       int l;
-       struct omap_hwmod *oh;
-       struct platform_device *pdev;
-       char oh_name[MAX_OMAP_I2C_HWMOD_NAME_LEN];
-       struct omap_i2c_bus_platform_data *pdata;
-       struct omap_i2c_dev_attr *dev_attr;
-
-       omap2_i2c_mux_pins(bus_id);
-
-       l = snprintf(oh_name, MAX_OMAP_I2C_HWMOD_NAME_LEN, "i2c%d", bus_id);
-       WARN(l >= MAX_OMAP_I2C_HWMOD_NAME_LEN,
-               "String buffer overflow in I2C%d device setup\n", bus_id);
-       oh = omap_hwmod_lookup(oh_name);
-       if (!oh) {
-                       pr_err("Could not look up %s\n", oh_name);
-                       return -EEXIST;
-       }
-
-       pdata = &i2c_pdata[bus_id - 1];
-       /*
-        * pass the hwmod class's CPU-specific knowledge of I2C IP revision in
-        * use, and functionality implementation flags, up to the OMAP I2C
-        * driver via platform data
-        */
-       pdata->rev = oh->class->rev;
-
-       dev_attr = (struct omap_i2c_dev_attr *)oh->dev_attr;
-       pdata->flags = dev_attr->flags;
-
-       pdev = omap_device_build(name, bus_id, oh, pdata,
-                       sizeof(struct omap_i2c_bus_platform_data),
-                       NULL, 0, 0);
-       WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);
-
-       return PTR_RET(pdev);
-}
-#else
-static inline int omap2_i2c_add_bus(int bus_id)
-{
-       return 0;
-}
-#endif
-
-static int __init omap_i2c_add_bus(int bus_id)
-{
-       if (cpu_class_is_omap1())
-               return omap1_i2c_add_bus(bus_id);
-       else
-               return omap2_i2c_add_bus(bus_id);
-}
-
 /**
  * omap_i2c_bus_setup - Process command line options for the I2C bus speed
  * @str: String of options
@@ -218,7 +97,7 @@ static int __init omap_register_i2c_bus_cmdline(void)
        for (i = 0; i < ARRAY_SIZE(i2c_pdata); i++)
                if (i2c_pdata[i].clkrate & OMAP_I2C_CMDLINE_SETUP) {
                        i2c_pdata[i].clkrate &= ~OMAP_I2C_CMDLINE_SETUP;
-                       err = omap_i2c_add_bus(i + 1);
+                       err = omap_i2c_add_bus(&i2c_pdata[i], i + 1);
                        if (err)
                                goto out;
                }
@@ -256,5 +135,5 @@ int __init omap_register_i2c_bus(int bus_id, u32 clkrate,
 
        i2c_pdata[bus_id - 1].clkrate &= ~OMAP_I2C_CMDLINE_SETUP;
 
-       return omap_i2c_add_bus(bus_id);
+       return omap_i2c_add_bus(&i2c_pdata[bus_id - 1], bus_id);
 }
diff --git a/arch/arm/plat-omap/i2c.h b/arch/arm/plat-omap/i2c.h
new file mode 100644 (file)
index 0000000..7a9028c
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Helper module for board specific I2C bus registration
+ *
+ * Copyright (C) 2009 Nokia Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef __PLAT_OMAP_I2C_H
+#define __PLAT_OMAP_I2C_H
+
+struct i2c_board_info;
+struct omap_i2c_bus_platform_data;
+
+int omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata,
+                       int bus_id);
+
+#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
+extern int omap_register_i2c_bus(int bus_id, u32 clkrate,
+                                struct i2c_board_info const *info,
+                                unsigned len);
+#else
+static inline int omap_register_i2c_bus(int bus_id, u32 clkrate,
+                                struct i2c_board_info const *info,
+                                unsigned len)
+{
+       return 0;
+}
+#endif
+
+struct omap_hwmod;
+int omap_i2c_reset(struct omap_hwmod *oh);
+
+#endif /* __PLAT_OMAP_I2C_H */
diff --git a/arch/arm/plat-omap/include/plat-omap/dma-omap.h b/arch/arm/plat-omap/include/plat-omap/dma-omap.h
new file mode 100644 (file)
index 0000000..222be7e
--- /dev/null
@@ -0,0 +1,367 @@
+/*
+ *  OMAP DMA handling defines and function
+ *
+ *  Copyright (C) 2003 Nokia Corporation
+ *  Author: Juha Yrjölä <juha.yrjola@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __ASM_ARCH_DMA_H
+#define __ASM_ARCH_DMA_H
+
+#include <linux/platform_device.h>
+
+#define INT_DMA_LCD                    25
+
+#define OMAP1_DMA_TOUT_IRQ             (1 << 0)
+#define OMAP_DMA_DROP_IRQ              (1 << 1)
+#define OMAP_DMA_HALF_IRQ              (1 << 2)
+#define OMAP_DMA_FRAME_IRQ             (1 << 3)
+#define OMAP_DMA_LAST_IRQ              (1 << 4)
+#define OMAP_DMA_BLOCK_IRQ             (1 << 5)
+#define OMAP1_DMA_SYNC_IRQ             (1 << 6)
+#define OMAP2_DMA_PKT_IRQ              (1 << 7)
+#define OMAP2_DMA_TRANS_ERR_IRQ                (1 << 8)
+#define OMAP2_DMA_SECURE_ERR_IRQ       (1 << 9)
+#define OMAP2_DMA_SUPERVISOR_ERR_IRQ   (1 << 10)
+#define OMAP2_DMA_MISALIGNED_ERR_IRQ   (1 << 11)
+
+#define OMAP_DMA_CCR_EN                        (1 << 7)
+#define OMAP_DMA_CCR_RD_ACTIVE         (1 << 9)
+#define OMAP_DMA_CCR_WR_ACTIVE         (1 << 10)
+#define OMAP_DMA_CCR_SEL_SRC_DST_SYNC  (1 << 24)
+#define OMAP_DMA_CCR_BUFFERING_DISABLE (1 << 25)
+
+#define OMAP_DMA_DATA_TYPE_S8          0x00
+#define OMAP_DMA_DATA_TYPE_S16         0x01
+#define OMAP_DMA_DATA_TYPE_S32         0x02
+
+#define OMAP_DMA_SYNC_ELEMENT          0x00
+#define OMAP_DMA_SYNC_FRAME            0x01
+#define OMAP_DMA_SYNC_BLOCK            0x02
+#define OMAP_DMA_SYNC_PACKET           0x03
+
+#define OMAP_DMA_DST_SYNC_PREFETCH     0x02
+#define OMAP_DMA_SRC_SYNC              0x01
+#define OMAP_DMA_DST_SYNC              0x00
+
+#define OMAP_DMA_PORT_EMIFF            0x00
+#define OMAP_DMA_PORT_EMIFS            0x01
+#define OMAP_DMA_PORT_OCP_T1           0x02
+#define OMAP_DMA_PORT_TIPB             0x03
+#define OMAP_DMA_PORT_OCP_T2           0x04
+#define OMAP_DMA_PORT_MPUI             0x05
+
+#define OMAP_DMA_AMODE_CONSTANT                0x00
+#define OMAP_DMA_AMODE_POST_INC                0x01
+#define OMAP_DMA_AMODE_SINGLE_IDX      0x02
+#define OMAP_DMA_AMODE_DOUBLE_IDX      0x03
+
+#define DMA_DEFAULT_FIFO_DEPTH         0x10
+#define DMA_DEFAULT_ARB_RATE           0x01
+/* Pass THREAD_RESERVE ORed with THREAD_FIFO for tparams */
+#define DMA_THREAD_RESERVE_NORM                (0x00 << 12) /* Def */
+#define DMA_THREAD_RESERVE_ONET                (0x01 << 12)
+#define DMA_THREAD_RESERVE_TWOT                (0x02 << 12)
+#define DMA_THREAD_RESERVE_THREET      (0x03 << 12)
+#define DMA_THREAD_FIFO_NONE           (0x00 << 14) /* Def */
+#define DMA_THREAD_FIFO_75             (0x01 << 14)
+#define DMA_THREAD_FIFO_25             (0x02 << 14)
+#define DMA_THREAD_FIFO_50             (0x03 << 14)
+
+/* DMA4_OCP_SYSCONFIG bits */
+#define DMA_SYSCONFIG_MIDLEMODE_MASK           (3 << 12)
+#define DMA_SYSCONFIG_CLOCKACTIVITY_MASK       (3 << 8)
+#define DMA_SYSCONFIG_EMUFREE                  (1 << 5)
+#define DMA_SYSCONFIG_SIDLEMODE_MASK           (3 << 3)
+#define DMA_SYSCONFIG_SOFTRESET                        (1 << 2)
+#define DMA_SYSCONFIG_AUTOIDLE                 (1 << 0)
+
+#define DMA_SYSCONFIG_MIDLEMODE(n)             ((n) << 12)
+#define DMA_SYSCONFIG_SIDLEMODE(n)             ((n) << 3)
+
+#define DMA_IDLEMODE_SMARTIDLE                 0x2
+#define DMA_IDLEMODE_NO_IDLE                   0x1
+#define DMA_IDLEMODE_FORCE_IDLE                        0x0
+
+/* Chaining modes*/
+#ifndef CONFIG_ARCH_OMAP1
+#define OMAP_DMA_STATIC_CHAIN          0x1
+#define OMAP_DMA_DYNAMIC_CHAIN         0x2
+#define OMAP_DMA_CHAIN_ACTIVE          0x1
+#define OMAP_DMA_CHAIN_INACTIVE                0x0
+#endif
+
+#define DMA_CH_PRIO_HIGH               0x1
+#define DMA_CH_PRIO_LOW                        0x0 /* Def */
+
+/* Errata handling */
+#define IS_DMA_ERRATA(id)              (errata & (id))
+#define SET_DMA_ERRATA(id)             (errata |= (id))
+
+#define DMA_ERRATA_IFRAME_BUFFERING    BIT(0x0)
+#define DMA_ERRATA_PARALLEL_CHANNELS   BIT(0x1)
+#define DMA_ERRATA_i378                        BIT(0x2)
+#define DMA_ERRATA_i541                        BIT(0x3)
+#define DMA_ERRATA_i88                 BIT(0x4)
+#define DMA_ERRATA_3_3                 BIT(0x5)
+#define DMA_ROMCODE_BUG                        BIT(0x6)
+
+/* Attributes for OMAP DMA Contrller */
+#define DMA_LINKED_LCH                 BIT(0x0)
+#define GLOBAL_PRIORITY                        BIT(0x1)
+#define RESERVE_CHANNEL                        BIT(0x2)
+#define IS_CSSA_32                     BIT(0x3)
+#define IS_CDSA_32                     BIT(0x4)
+#define IS_RW_PRIORITY                 BIT(0x5)
+#define ENABLE_1510_MODE               BIT(0x6)
+#define SRC_PORT                       BIT(0x7)
+#define DST_PORT                       BIT(0x8)
+#define SRC_INDEX                      BIT(0x9)
+#define DST_INDEX                      BIT(0xA)
+#define IS_BURST_ONLY4                 BIT(0xB)
+#define CLEAR_CSR_ON_READ              BIT(0xC)
+#define IS_WORD_16                     BIT(0xD)
+
+/* Defines for DMA Capabilities */
+#define DMA_HAS_TRANSPARENT_CAPS       (0x1 << 18)
+#define DMA_HAS_CONSTANT_FILL_CAPS     (0x1 << 19)
+#define DMA_HAS_DESCRIPTOR_CAPS                (0x3 << 20)
+
+enum omap_reg_offsets {
+
+GCR,           GSCR,           GRST1,          HW_ID,
+PCH2_ID,       PCH0_ID,        PCH1_ID,        PCHG_ID,
+PCHD_ID,       CAPS_0,         CAPS_1,         CAPS_2,
+CAPS_3,                CAPS_4,         PCH2_SR,        PCH0_SR,
+PCH1_SR,       PCHD_SR,        REVISION,       IRQSTATUS_L0,
+IRQSTATUS_L1,  IRQSTATUS_L2,   IRQSTATUS_L3,   IRQENABLE_L0,
+IRQENABLE_L1,  IRQENABLE_L2,   IRQENABLE_L3,   SYSSTATUS,
+OCP_SYSCONFIG,
+
+/* omap1+ specific */
+CPC, CCR2, LCH_CTRL,
+
+/* Common registers for all omap's */
+CSDP,          CCR,            CICR,           CSR,
+CEN,           CFN,            CSFI,           CSEI,
+CSAC,          CDAC,           CDEI,
+CDFI,          CLNK_CTRL,
+
+/* Channel specific registers */
+CSSA,          CDSA,           COLOR,
+CCEN,          CCFN,
+
+/* omap3630 and omap4 specific */
+CDP,           CNDP,           CCDN,
+
+};
+
+enum omap_dma_burst_mode {
+       OMAP_DMA_DATA_BURST_DIS = 0,
+       OMAP_DMA_DATA_BURST_4,
+       OMAP_DMA_DATA_BURST_8,
+       OMAP_DMA_DATA_BURST_16,
+};
+
+enum end_type {
+       OMAP_DMA_LITTLE_ENDIAN = 0,
+       OMAP_DMA_BIG_ENDIAN
+};
+
+enum omap_dma_color_mode {
+       OMAP_DMA_COLOR_DIS = 0,
+       OMAP_DMA_CONSTANT_FILL,
+       OMAP_DMA_TRANSPARENT_COPY
+};
+
+enum omap_dma_write_mode {
+       OMAP_DMA_WRITE_NON_POSTED = 0,
+       OMAP_DMA_WRITE_POSTED,
+       OMAP_DMA_WRITE_LAST_NON_POSTED
+};
+
+enum omap_dma_channel_mode {
+       OMAP_DMA_LCH_2D = 0,
+       OMAP_DMA_LCH_G,
+       OMAP_DMA_LCH_P,
+       OMAP_DMA_LCH_PD
+};
+
+struct omap_dma_channel_params {
+       int data_type;          /* data type 8,16,32 */
+       int elem_count;         /* number of elements in a frame */
+       int frame_count;        /* number of frames in a element */
+
+       int src_port;           /* Only on OMAP1 REVISIT: Is this needed? */
+       int src_amode;          /* constant, post increment, indexed,
+                                       double indexed */
+       unsigned long src_start;        /* source address : physical */
+       int src_ei;             /* source element index */
+       int src_fi;             /* source frame index */
+
+       int dst_port;           /* Only on OMAP1 REVISIT: Is this needed? */
+       int dst_amode;          /* constant, post increment, indexed,
+                                       double indexed */
+       unsigned long dst_start;        /* source address : physical */
+       int dst_ei;             /* source element index */
+       int dst_fi;             /* source frame index */
+
+       int trigger;            /* trigger attached if the channel is
+                                       synchronized */
+       int sync_mode;          /* sycn on element, frame , block or packet */
+       int src_or_dst_synch;   /* source synch(1) or destination synch(0) */
+
+       int ie;                 /* interrupt enabled */
+
+       unsigned char read_prio;/* read priority */
+       unsigned char write_prio;/* write priority */
+
+#ifndef CONFIG_ARCH_OMAP1
+       enum omap_dma_burst_mode burst_mode; /* Burst mode 4/8/16 words */
+#endif
+};
+
+struct omap_dma_lch {
+       int next_lch;
+       int dev_id;
+       u16 saved_csr;
+       u16 enabled_irqs;
+       const char *dev_name;
+       void (*callback)(int lch, u16 ch_status, void *data);
+       void *data;
+       long flags;
+       /* required for Dynamic chaining */
+       int prev_linked_ch;
+       int next_linked_ch;
+       int state;
+       int chain_id;
+       int status;
+};
+
+struct omap_dma_dev_attr {
+       u32 dev_caps;
+       u16 lch_count;
+       u16 chan_count;
+       struct omap_dma_lch *chan;
+};
+
+/* System DMA platform data structure */
+struct omap_system_dma_plat_info {
+       struct omap_dma_dev_attr *dma_attr;
+       u32 errata;
+       void (*disable_irq_lch)(int lch);
+       void (*show_dma_caps)(void);
+       void (*clear_lch_regs)(int lch);
+       void (*clear_dma)(int lch);
+       void (*dma_write)(u32 val, int reg, int lch);
+       u32 (*dma_read)(int reg, int lch);
+};
+
+extern void __init omap_init_consistent_dma_size(void);
+extern void omap_set_dma_priority(int lch, int dst_port, int priority);
+extern int omap_request_dma(int dev_id, const char *dev_name,
+                       void (*callback)(int lch, u16 ch_status, void *data),
+                       void *data, int *dma_ch);
+extern void omap_enable_dma_irq(int ch, u16 irq_bits);
+extern void omap_disable_dma_irq(int ch, u16 irq_bits);
+extern void omap_free_dma(int ch);
+extern void omap_start_dma(int lch);
+extern void omap_stop_dma(int lch);
+extern void omap_set_dma_transfer_params(int lch, int data_type,
+                                        int elem_count, int frame_count,
+                                        int sync_mode,
+                                        int dma_trigger, int src_or_dst_synch);
+extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode,
+                                   u32 color);
+extern void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode);
+extern void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode);
+
+extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
+                                   unsigned long src_start,
+                                   int src_ei, int src_fi);
+extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
+extern void omap_set_dma_src_data_pack(int lch, int enable);
+extern void omap_set_dma_src_burst_mode(int lch,
+                                       enum omap_dma_burst_mode burst_mode);
+
+extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
+                                    unsigned long dest_start,
+                                    int dst_ei, int dst_fi);
+extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
+extern void omap_set_dma_dest_data_pack(int lch, int enable);
+extern void omap_set_dma_dest_burst_mode(int lch,
+                                        enum omap_dma_burst_mode burst_mode);
+
+extern void omap_set_dma_params(int lch,
+                               struct omap_dma_channel_params *params);
+
+extern void omap_dma_link_lch(int lch_head, int lch_queue);
+extern void omap_dma_unlink_lch(int lch_head, int lch_queue);
+
+extern int omap_set_dma_callback(int lch,
+                       void (*callback)(int lch, u16 ch_status, void *data),
+                       void *data);
+extern dma_addr_t omap_get_dma_src_pos(int lch);
+extern dma_addr_t omap_get_dma_dst_pos(int lch);
+extern void omap_clear_dma(int lch);
+extern int omap_get_dma_active_status(int lch);
+extern int omap_dma_running(void);
+extern void omap_dma_set_global_params(int arb_rate, int max_fifo_depth,
+                                      int tparams);
+extern int omap_dma_set_prio_lch(int lch, unsigned char read_prio,
+                                unsigned char write_prio);
+extern void omap_set_dma_dst_endian_type(int lch, enum end_type etype);
+extern void omap_set_dma_src_endian_type(int lch, enum end_type etype);
+extern int omap_get_dma_index(int lch, int *ei, int *fi);
+
+void omap_dma_global_context_save(void);
+void omap_dma_global_context_restore(void);
+
+extern void omap_dma_disable_irq(int lch);
+
+/* Chaining APIs */
+#ifndef CONFIG_ARCH_OMAP1
+extern int omap_request_dma_chain(int dev_id, const char *dev_name,
+                                 void (*callback) (int lch, u16 ch_status,
+                                                   void *data),
+                                 int *chain_id, int no_of_chans,
+                                 int chain_mode,
+                                 struct omap_dma_channel_params params);
+extern int omap_free_dma_chain(int chain_id);
+extern int omap_dma_chain_a_transfer(int chain_id, int src_start,
+                                    int dest_start, int elem_count,
+                                    int frame_count, void *callbk_data);
+extern int omap_start_dma_chain_transfers(int chain_id);
+extern int omap_stop_dma_chain_transfers(int chain_id);
+extern int omap_get_dma_chain_index(int chain_id, int *ei, int *fi);
+extern int omap_get_dma_chain_dst_pos(int chain_id);
+extern int omap_get_dma_chain_src_pos(int chain_id);
+
+extern int omap_modify_dma_chain_params(int chain_id,
+                                       struct omap_dma_channel_params params);
+extern int omap_dma_chain_status(int chain_id);
+#endif
+
+#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_FB_OMAP)
+#include <mach/lcd_dma.h>
+#else
+static inline int omap_lcd_dma_running(void)
+{
+       return 0;
+}
+#endif
+
+#endif /* __ASM_ARCH_DMA_H */
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h b/arch/arm/plat-omap/include/plat/clkdev_omap.h
deleted file mode 100644 (file)
index 025d85a..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * clkdev <-> OMAP integration
- *
- * Russell King <linux@arm.linux.org.uk>
- *
- */
-
-#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H
-#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H
-
-#include <linux/clkdev.h>
-
-struct omap_clk {
-       u16                             cpu;
-       struct clk_lookup               lk;
-};
-
-#define CLK(dev, con, ck, cp)          \
-       {                               \
-                .cpu = cp,             \
-               .lk = {                 \
-                       .dev_id = dev,  \
-                       .con_id = con,  \
-                       .clk = ck,      \
-               },                      \
-       }
-
-/* Platform flags for the clkdev-OMAP integration code */
-#define CK_310         (1 << 0)
-#define CK_7XX         (1 << 1)        /* 7xx, 850 */
-#define CK_1510                (1 << 2)
-#define CK_16XX                (1 << 3)        /* 16xx, 17xx, 5912 */
-#define CK_242X                (1 << 4)
-#define CK_243X                (1 << 5)        /* 243x, 253x */
-#define CK_3430ES1     (1 << 6)        /* 34xxES1 only */
-#define CK_3430ES2PLUS (1 << 7)        /* 34xxES2, ES3, non-Sitara 35xx only */
-#define CK_AM35XX      (1 << 9)        /* Sitara AM35xx */
-#define CK_36XX                (1 << 10)       /* 36xx/37xx-specific clocks */
-#define CK_443X                (1 << 11)
-#define CK_TI816X      (1 << 12)
-#define CK_446X                (1 << 13)
-#define CK_AM33XX      (1 << 14)       /* AM33xx specific clocks */
-#define CK_1710                (1 << 15)       /* 1710 extra for rate selection */
-
-
-#define CK_34XX                (CK_3430ES1 | CK_3430ES2PLUS)
-#define CK_3XXX                (CK_34XX | CK_AM35XX | CK_36XX)
-
-
-#endif
-
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
deleted file mode 100644 (file)
index e2e2d04..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * OMAP clock: data structure definitions, function prototypes, shared macros
- *
- * Copyright (C) 2004-2005, 2008-2010 Nokia Corporation
- * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
- * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __ARCH_ARM_OMAP_CLOCK_H
-#define __ARCH_ARM_OMAP_CLOCK_H
-
-#include <linux/list.h>
-
-struct module;
-struct clk;
-struct clockdomain;
-
-/* Temporary, needed during the common clock framework conversion */
-#define __clk_get_name(clk)    (clk->name)
-#define __clk_get_parent(clk)  (clk->parent)
-#define __clk_get_rate(clk)    (clk->rate)
-
-/**
- * struct clkops - some clock function pointers
- * @enable: fn ptr that enables the current clock in hardware
- * @disable: fn ptr that enables the current clock in hardware
- * @find_idlest: function returning the IDLEST register for the clock's IP blk
- * @find_companion: function returning the "companion" clk reg for the clock
- * @allow_idle: fn ptr that enables autoidle for the current clock in hardware
- * @deny_idle: fn ptr that disables autoidle for the current clock in hardware
- *
- * A "companion" clk is an accompanying clock to the one being queried
- * that must be enabled for the IP module connected to the clock to
- * become accessible by the hardware.  Neither @find_idlest nor
- * @find_companion should be needed; that information is IP
- * block-specific; the hwmod code has been created to handle this, but
- * until hwmod data is ready and drivers have been converted to use PM
- * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and
- * @find_companion must, unfortunately, remain.
- */
-struct clkops {
-       int                     (*enable)(struct clk *);
-       void                    (*disable)(struct clk *);
-       void                    (*find_idlest)(struct clk *, void __iomem **,
-                                              u8 *, u8 *);
-       void                    (*find_companion)(struct clk *, void __iomem **,
-                                                 u8 *);
-       void                    (*allow_idle)(struct clk *);
-       void                    (*deny_idle)(struct clk *);
-};
-
-#ifdef CONFIG_ARCH_OMAP2PLUS
-
-/* struct clksel_rate.flags possibilities */
-#define RATE_IN_242X           (1 << 0)
-#define RATE_IN_243X           (1 << 1)
-#define RATE_IN_3430ES1                (1 << 2)        /* 3430ES1 rates only */
-#define RATE_IN_3430ES2PLUS    (1 << 3)        /* 3430 ES >= 2 rates only */
-#define RATE_IN_36XX           (1 << 4)
-#define RATE_IN_4430           (1 << 5)
-#define RATE_IN_TI816X         (1 << 6)
-#define RATE_IN_4460           (1 << 7)
-#define RATE_IN_AM33XX         (1 << 8)
-#define RATE_IN_TI814X         (1 << 9)
-
-#define RATE_IN_24XX           (RATE_IN_242X | RATE_IN_243X)
-#define RATE_IN_34XX           (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
-#define RATE_IN_3XXX           (RATE_IN_34XX | RATE_IN_36XX)
-#define RATE_IN_44XX           (RATE_IN_4430 | RATE_IN_4460)
-
-/* RATE_IN_3430ES2PLUS_36XX includes 34xx/35xx with ES >=2, and all 36xx/37xx */
-#define RATE_IN_3430ES2PLUS_36XX       (RATE_IN_3430ES2PLUS | RATE_IN_36XX)
-
-
-/**
- * struct clksel_rate - register bitfield values corresponding to clk divisors
- * @val: register bitfield value (shifted to bit 0)
- * @div: clock divisor corresponding to @val
- * @flags: (see "struct clksel_rate.flags possibilities" above)
- *
- * @val should match the value of a read from struct clk.clksel_reg
- * AND'ed with struct clk.clksel_mask, shifted right to bit 0.
- *
- * @div is the divisor that should be applied to the parent clock's rate
- * to produce the current clock's rate.
- */
-struct clksel_rate {
-       u32                     val;
-       u8                      div;
-       u16                     flags;
-};
-
-/**
- * struct clksel - available parent clocks, and a pointer to their divisors
- * @parent: struct clk * to a possible parent clock
- * @rates: available divisors for this parent clock
- *
- * A struct clksel is always associated with one or more struct clks
- * and one or more struct clksel_rates.
- */
-struct clksel {
-       struct clk               *parent;
-       const struct clksel_rate *rates;
-};
-
-/**
- * struct dpll_data - DPLL registers and integration data
- * @mult_div1_reg: register containing the DPLL M and N bitfields
- * @mult_mask: mask of the DPLL M bitfield in @mult_div1_reg
- * @div1_mask: mask of the DPLL N bitfield in @mult_div1_reg
- * @clk_bypass: struct clk pointer to the clock's bypass clock input
- * @clk_ref: struct clk pointer to the clock's reference clock input
- * @control_reg: register containing the DPLL mode bitfield
- * @enable_mask: mask of the DPLL mode bitfield in @control_reg
- * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate()
- * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate()
- * @max_multiplier: maximum valid non-bypass multiplier value (actual)
- * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
- * @min_divider: minimum valid non-bypass divider value (actual)
- * @max_divider: maximum valid non-bypass divider value (actual)
- * @modes: possible values of @enable_mask
- * @autoidle_reg: register containing the DPLL autoidle mode bitfield
- * @idlest_reg: register containing the DPLL idle status bitfield
- * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg
- * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg
- * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg
- * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg
- * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs
- * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs
- * @flags: DPLL type/features (see below)
- *
- * Possible values for @flags:
- * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs)
- *
- * @freqsel_mask is only used on the OMAP34xx family and AM35xx.
- *
- * XXX Some DPLLs have multiple bypass inputs, so it's not technically
- * correct to only have one @clk_bypass pointer.
- *
- * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m,
- * @last_rounded_n) should be separated from the runtime-fixed fields
- * and placed into a different structure, so that the runtime-fixed data
- * can be placed into read-only space.
- */
-struct dpll_data {
-       void __iomem            *mult_div1_reg;
-       u32                     mult_mask;
-       u32                     div1_mask;
-       struct clk              *clk_bypass;
-       struct clk              *clk_ref;
-       void __iomem            *control_reg;
-       u32                     enable_mask;
-       unsigned long           last_rounded_rate;
-       u16                     last_rounded_m;
-       u16                     max_multiplier;
-       u8                      last_rounded_n;
-       u8                      min_divider;
-       u16                     max_divider;
-       u8                      modes;
-       void __iomem            *autoidle_reg;
-       void __iomem            *idlest_reg;
-       u32                     autoidle_mask;
-       u32                     freqsel_mask;
-       u32                     idlest_mask;
-       u32                     dco_mask;
-       u32                     sddiv_mask;
-       u8                      auto_recal_bit;
-       u8                      recal_en_bit;
-       u8                      recal_st_bit;
-       u8                      flags;
-};
-
-#endif
-
-/*
- * struct clk.flags possibilities
- *
- * XXX document the rest of the clock flags here
- *
- * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
- *     bits share the same register.  This flag allows the
- *     omap4_dpllmx*() code to determine which GATE_CTRL bit field
- *     should be used.  This is a temporary solution - a better approach
- *     would be to associate clock type-specific data with the clock,
- *     similar to the struct dpll_data approach.
- */
-#define ENABLE_REG_32BIT       (1 << 0)        /* Use 32-bit access */
-#define CLOCK_IDLE_CONTROL     (1 << 1)
-#define CLOCK_NO_IDLE_PARENT   (1 << 2)
-#define ENABLE_ON_INIT         (1 << 3)        /* Enable upon framework init */
-#define INVERT_ENABLE          (1 << 4)        /* 0 enables, 1 disables */
-#define CLOCK_CLKOUTX2         (1 << 5)
-
-/**
- * struct clk - OMAP struct clk
- * @node: list_head connecting this clock into the full clock list
- * @ops: struct clkops * for this clock
- * @name: the name of the clock in the hardware (used in hwmod data and debug)
- * @parent: pointer to this clock's parent struct clk
- * @children: list_head connecting to the child clks' @sibling list_heads
- * @sibling: list_head connecting this clk to its parent clk's @children
- * @rate: current clock rate
- * @enable_reg: register to write to enable the clock (see @enable_bit)
- * @recalc: fn ptr that returns the clock's current rate
- * @set_rate: fn ptr that can change the clock's current rate
- * @round_rate: fn ptr that can round the clock's current rate
- * @init: fn ptr to do clock-specific initialization
- * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
- * @usecount: number of users that have requested this clock to be enabled
- * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div
- * @flags: see "struct clk.flags possibilities" above
- * @clksel_reg: for clksel clks, register va containing src/divisor select
- * @clksel_mask: bitmask in @clksel_reg for the src/divisor selector
- * @clksel: for clksel clks, pointer to struct clksel for this clock
- * @dpll_data: for DPLLs, pointer to struct dpll_data for this clock
- * @clkdm_name: clockdomain name that this clock is contained in
- * @clkdm: pointer to struct clockdomain, resolved from @clkdm_name at runtime
- * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
- * @src_offset: bitshift for source selection bitfield (OMAP1 only)
- *
- * XXX @rate_offset, @src_offset should probably be removed and OMAP1
- * clock code converted to use clksel.
- *
- * XXX @usecount is poorly named.  It should be "enable_count" or
- * something similar.  "users" in the description refers to kernel
- * code (core code or drivers) that have called clk_enable() and not
- * yet called clk_disable(); the usecount of parent clocks is also
- * incremented by the clock code when clk_enable() is called on child
- * clocks and decremented by the clock code when clk_disable() is
- * called on child clocks.
- *
- * XXX @clkdm, @usecount, @children, @sibling should be marked for
- * internal use only.
- *
- * @children and @sibling are used to optimize parent-to-child clock
- * tree traversals.  (child-to-parent traversals use @parent.)
- *
- * XXX The notion of the clock's current rate probably needs to be
- * separated from the clock's target rate.
- */
-struct clk {
-       struct list_head        node;
-       const struct clkops     *ops;
-       const char              *name;
-       struct clk              *parent;
-       struct list_head        children;
-       struct list_head        sibling;        /* node for children */
-       unsigned long           rate;
-       void __iomem            *enable_reg;
-       unsigned long           (*recalc)(struct clk *);
-       int                     (*set_rate)(struct clk *, unsigned long);
-       long                    (*round_rate)(struct clk *, unsigned long);
-       void                    (*init)(struct clk *);
-       u8                      enable_bit;
-       s8                      usecount;
-       u8                      fixed_div;
-       u8                      flags;
-#ifdef CONFIG_ARCH_OMAP2PLUS
-       void __iomem            *clksel_reg;
-       u32                     clksel_mask;
-       const struct clksel     *clksel;
-       struct dpll_data        *dpll_data;
-       const char              *clkdm_name;
-       struct clockdomain      *clkdm;
-#else
-       u8                      rate_offset;
-       u8                      src_offset;
-#endif
-#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
-       struct dentry           *dent;  /* For visible tree hierarchy */
-#endif
-};
-
-struct clk_functions {
-       int             (*clk_enable)(struct clk *clk);
-       void            (*clk_disable)(struct clk *clk);
-       long            (*clk_round_rate)(struct clk *clk, unsigned long rate);
-       int             (*clk_set_rate)(struct clk *clk, unsigned long rate);
-       int             (*clk_set_parent)(struct clk *clk, struct clk *parent);
-       void            (*clk_allow_idle)(struct clk *clk);
-       void            (*clk_deny_idle)(struct clk *clk);
-       void            (*clk_disable_unused)(struct clk *clk);
-};
-
-extern int mpurate;
-
-extern int clk_init(struct clk_functions *custom_clocks);
-extern void clk_preinit(struct clk *clk);
-extern int clk_register(struct clk *clk);
-extern void clk_reparent(struct clk *child, struct clk *parent);
-extern void clk_unregister(struct clk *clk);
-extern void propagate_rate(struct clk *clk);
-extern void recalculate_root_clocks(void);
-extern unsigned long followparent_recalc(struct clk *clk);
-extern void clk_enable_init_clocks(void);
-unsigned long omap_fixed_divisor_recalc(struct clk *clk);
-extern struct clk *omap_clk_get_by_name(const char *name);
-extern int omap_clk_enable_autoidle_all(void);
-extern int omap_clk_disable_autoidle_all(void);
-
-extern const struct clkops clkops_null;
-
-extern struct clk dummy_ck;
-
-#endif
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
deleted file mode 100644 (file)
index d1cb6f5..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * arch/arm/plat-omap/include/mach/common.h
- *
- * Header for code common to all OMAP machines.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
- * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * You should have received a copy of the  GNU General Public License along
- * with this program; if not, write  to the Free Software Foundation, Inc.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __ARCH_ARM_MACH_OMAP_COMMON_H
-#define __ARCH_ARM_MACH_OMAP_COMMON_H
-
-#include <plat/i2c.h>
-#include <plat/omap_hwmod.h>
-
-extern int __init omap_init_clocksource_32k(void __iomem *vbase);
-
-extern void __init omap_check_revision(void);
-
-extern void omap_reserve(void);
-extern int omap_dss_reset(struct omap_hwmod *);
-
-void omap_sram_init(void);
-
-#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
index 67da857783ce6e7155cf3b5424cac1fe693a52d3..ba542ec8d5133fbbf4e31d52b07c8e23fb2e583f 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * arch/arm/plat-omap/include/mach/cpu.h
- *
  * OMAP cpu type detection
  *
  * Copyright (C) 2004, 2008 Nokia Corporation
 #ifndef __ASM_ARCH_OMAP_CPU_H
 #define __ASM_ARCH_OMAP_CPU_H
 
-#ifndef __ASSEMBLY__
-
-#include <linux/bitops.h>
-#include <plat/multi.h>
-
-/*
- * Omap device type i.e. EMU/HS/TST/GP/BAD
- */
-#define OMAP2_DEVICE_TYPE_TEST         0
-#define OMAP2_DEVICE_TYPE_EMU          1
-#define OMAP2_DEVICE_TYPE_SEC          2
-#define OMAP2_DEVICE_TYPE_GP           3
-#define OMAP2_DEVICE_TYPE_BAD          4
-
-int omap_type(void);
-
-/*
- * omap_rev bits:
- * CPU id bits (0730, 1510, 1710, 2422...)     [31:16]
- * CPU revision        (See _REV_ defined in cpu.h)    [15:08]
- * CPU class bits (15xx, 16xx, 24xx, 34xx...)  [07:00]
- */
-unsigned int omap_rev(void);
-
-/*
- * Get the CPU revision for OMAP devices
- */
-#define GET_OMAP_REVISION()    ((omap_rev() >> 8) & 0xff)
-
-/*
- * Macros to group OMAP into cpu classes.
- * These can be used in most places.
- * cpu_is_omap7xx():   True for OMAP730, OMAP850
- * cpu_is_omap15xx():  True for OMAP1510, OMAP5910 and OMAP310
- * cpu_is_omap16xx():  True for OMAP1610, OMAP5912 and OMAP1710
- * cpu_is_omap24xx():  True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
- * cpu_is_omap242x():  True for OMAP2420, OMAP2422, OMAP2423
- * cpu_is_omap243x():  True for OMAP2430
- * cpu_is_omap343x():  True for OMAP3430
- * cpu_is_omap443x():  True for OMAP4430
- * cpu_is_omap446x():  True for OMAP4460
- * cpu_is_omap447x():  True for OMAP4470
- * soc_is_omap543x():  True for OMAP5430, OMAP5432
- */
-#define GET_OMAP_CLASS (omap_rev() & 0xff)
-
-#define IS_OMAP_CLASS(class, id)                       \
-static inline int is_omap ##class (void)               \
-{                                                      \
-       return (GET_OMAP_CLASS == (id)) ? 1 : 0;        \
-}
-
-#define GET_AM_CLASS   ((omap_rev() >> 24) & 0xff)
-
-#define IS_AM_CLASS(class, id)                         \
-static inline int is_am ##class (void)                 \
-{                                                      \
-       return (GET_AM_CLASS == (id)) ? 1 : 0;          \
-}
-
-#define GET_TI_CLASS   ((omap_rev() >> 24) & 0xff)
-
-#define IS_TI_CLASS(class, id)                 \
-static inline int is_ti ##class (void)         \
-{                                                      \
-       return (GET_TI_CLASS == (id)) ? 1 : 0;  \
-}
-
-#define GET_OMAP_SUBCLASS      ((omap_rev() >> 20) & 0x0fff)
-
-#define IS_OMAP_SUBCLASS(subclass, id)                 \
-static inline int is_omap ##subclass (void)            \
-{                                                      \
-       return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0;     \
-}
-
-#define IS_TI_SUBCLASS(subclass, id)                   \
-static inline int is_ti ##subclass (void)              \
-{                                                      \
-       return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0;     \
-}
-
-#define IS_AM_SUBCLASS(subclass, id)                   \
-static inline int is_am ##subclass (void)              \
-{                                                      \
-       return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0;     \
-}
-
-IS_OMAP_CLASS(7xx, 0x07)
-IS_OMAP_CLASS(15xx, 0x15)
-IS_OMAP_CLASS(16xx, 0x16)
-IS_OMAP_CLASS(24xx, 0x24)
-IS_OMAP_CLASS(34xx, 0x34)
-IS_OMAP_CLASS(44xx, 0x44)
-IS_AM_CLASS(35xx, 0x35)
-IS_OMAP_CLASS(54xx, 0x54)
-IS_AM_CLASS(33xx, 0x33)
-
-IS_TI_CLASS(81xx, 0x81)
-
-IS_OMAP_SUBCLASS(242x, 0x242)
-IS_OMAP_SUBCLASS(243x, 0x243)
-IS_OMAP_SUBCLASS(343x, 0x343)
-IS_OMAP_SUBCLASS(363x, 0x363)
-IS_OMAP_SUBCLASS(443x, 0x443)
-IS_OMAP_SUBCLASS(446x, 0x446)
-IS_OMAP_SUBCLASS(447x, 0x447)
-IS_OMAP_SUBCLASS(543x, 0x543)
-
-IS_TI_SUBCLASS(816x, 0x816)
-IS_TI_SUBCLASS(814x, 0x814)
-IS_AM_SUBCLASS(335x, 0x335)
-
-#define cpu_is_omap7xx()               0
-#define cpu_is_omap15xx()              0
-#define cpu_is_omap16xx()              0
-#define cpu_is_omap24xx()              0
-#define cpu_is_omap242x()              0
-#define cpu_is_omap243x()              0
-#define cpu_is_omap34xx()              0
-#define cpu_is_omap343x()              0
-#define cpu_is_ti81xx()                        0
-#define cpu_is_ti816x()                        0
-#define cpu_is_ti814x()                        0
-#define soc_is_am35xx()                        0
-#define soc_is_am33xx()                        0
-#define soc_is_am335x()                        0
-#define cpu_is_omap44xx()              0
-#define cpu_is_omap443x()              0
-#define cpu_is_omap446x()              0
-#define cpu_is_omap447x()              0
-#define soc_is_omap54xx()              0
-#define soc_is_omap543x()              0
-
-#if defined(MULTI_OMAP1)
-# if defined(CONFIG_ARCH_OMAP730)
-#  undef  cpu_is_omap7xx
-#  define cpu_is_omap7xx()             is_omap7xx()
-# endif
-# if defined(CONFIG_ARCH_OMAP850)
-#  undef  cpu_is_omap7xx
-#  define cpu_is_omap7xx()             is_omap7xx()
-# endif
-# if defined(CONFIG_ARCH_OMAP15XX)
-#  undef  cpu_is_omap15xx
-#  define cpu_is_omap15xx()            is_omap15xx()
-# endif
-# if defined(CONFIG_ARCH_OMAP16XX)
-#  undef  cpu_is_omap16xx
-#  define cpu_is_omap16xx()            is_omap16xx()
-# endif
-#else
-# if defined(CONFIG_ARCH_OMAP730)
-#  undef  cpu_is_omap7xx
-#  define cpu_is_omap7xx()             1
-# endif
-# if defined(CONFIG_ARCH_OMAP850)
-#  undef  cpu_is_omap7xx
-#  define cpu_is_omap7xx()             1
-# endif
-# if defined(CONFIG_ARCH_OMAP15XX)
-#  undef  cpu_is_omap15xx
-#  define cpu_is_omap15xx()            1
-# endif
-# if defined(CONFIG_ARCH_OMAP16XX)
-#  undef  cpu_is_omap16xx
-#  define cpu_is_omap16xx()            1
-# endif
-#endif
-
-#if defined(MULTI_OMAP2)
-# if defined(CONFIG_ARCH_OMAP2)
-#  undef  cpu_is_omap24xx
-#  define cpu_is_omap24xx()            is_omap24xx()
-# endif
-# if defined (CONFIG_SOC_OMAP2420)
-#  undef  cpu_is_omap242x
-#  define cpu_is_omap242x()            is_omap242x()
-# endif
-# if defined (CONFIG_SOC_OMAP2430)
-#  undef  cpu_is_omap243x
-#  define cpu_is_omap243x()            is_omap243x()
-# endif
-# if defined(CONFIG_ARCH_OMAP3)
-#  undef  cpu_is_omap34xx
-#  undef  cpu_is_omap343x
-#  define cpu_is_omap34xx()            is_omap34xx()
-#  define cpu_is_omap343x()            is_omap343x()
-# endif
-#else
-# if defined(CONFIG_ARCH_OMAP2)
-#  undef  cpu_is_omap24xx
-#  define cpu_is_omap24xx()            1
-# endif
-# if defined(CONFIG_SOC_OMAP2420)
-#  undef  cpu_is_omap242x
-#  define cpu_is_omap242x()            1
-# endif
-# if defined(CONFIG_SOC_OMAP2430)
-#  undef  cpu_is_omap243x
-#  define cpu_is_omap243x()            1
-# endif
-# if defined(CONFIG_ARCH_OMAP3)
-#  undef  cpu_is_omap34xx
-#  define cpu_is_omap34xx()            1
-# endif
-# if defined(CONFIG_SOC_OMAP3430)
-#  undef  cpu_is_omap343x
-#  define cpu_is_omap343x()            1
-# endif
-#endif
-
-/*
- * Macros to detect individual cpu types.
- * These are only rarely needed.
- * cpu_is_omap310():   True for OMAP310
- * cpu_is_omap1510():  True for OMAP1510
- * cpu_is_omap1610():  True for OMAP1610
- * cpu_is_omap1611():  True for OMAP1611
- * cpu_is_omap5912():  True for OMAP5912
- * cpu_is_omap1621():  True for OMAP1621
- * cpu_is_omap1710():  True for OMAP1710
- * cpu_is_omap2420():  True for OMAP2420
- * cpu_is_omap2422():  True for OMAP2422
- * cpu_is_omap2423():  True for OMAP2423
- * cpu_is_omap2430():  True for OMAP2430
- * cpu_is_omap3430():  True for OMAP3430
- */
-#define GET_OMAP_TYPE  ((omap_rev() >> 16) & 0xffff)
-
-#define IS_OMAP_TYPE(type, id)                         \
-static inline int is_omap ##type (void)                        \
-{                                                      \
-       return (GET_OMAP_TYPE == (id)) ? 1 : 0;         \
-}
-
-IS_OMAP_TYPE(310, 0x0310)
-IS_OMAP_TYPE(1510, 0x1510)
-IS_OMAP_TYPE(1610, 0x1610)
-IS_OMAP_TYPE(1611, 0x1611)
-IS_OMAP_TYPE(5912, 0x1611)
-IS_OMAP_TYPE(1621, 0x1621)
-IS_OMAP_TYPE(1710, 0x1710)
-IS_OMAP_TYPE(2420, 0x2420)
-IS_OMAP_TYPE(2422, 0x2422)
-IS_OMAP_TYPE(2423, 0x2423)
-IS_OMAP_TYPE(2430, 0x2430)
-IS_OMAP_TYPE(3430, 0x3430)
-
-#define cpu_is_omap310()               0
-#define cpu_is_omap1510()              0
-#define cpu_is_omap1610()              0
-#define cpu_is_omap5912()              0
-#define cpu_is_omap1611()              0
-#define cpu_is_omap1621()              0
-#define cpu_is_omap1710()              0
-#define cpu_is_omap2420()              0
-#define cpu_is_omap2422()              0
-#define cpu_is_omap2423()              0
-#define cpu_is_omap2430()              0
-#define cpu_is_omap3430()              0
-#define cpu_is_omap3630()              0
-#define soc_is_omap5430()              0
-
-/*
- * Whether we have MULTI_OMAP1 or not, we still need to distinguish
- * between 310 vs. 1510 and 1611B/5912 vs. 1710.
- */
-
-#if defined(CONFIG_ARCH_OMAP15XX)
-# undef  cpu_is_omap310
-# undef  cpu_is_omap1510
-# define cpu_is_omap310()              is_omap310()
-# define cpu_is_omap1510()             is_omap1510()
-#endif
-
-#if defined(CONFIG_ARCH_OMAP16XX)
-# undef  cpu_is_omap1610
-# undef  cpu_is_omap1611
-# undef  cpu_is_omap5912
-# undef  cpu_is_omap1621
-# undef  cpu_is_omap1710
-# define cpu_is_omap1610()             is_omap1610()
-# define cpu_is_omap1611()             is_omap1611()
-# define cpu_is_omap5912()             is_omap5912()
-# define cpu_is_omap1621()             is_omap1621()
-# define cpu_is_omap1710()             is_omap1710()
-#endif
-
-#if defined(CONFIG_ARCH_OMAP2)
-# undef  cpu_is_omap2420
-# undef  cpu_is_omap2422
-# undef  cpu_is_omap2423
-# undef  cpu_is_omap2430
-# define cpu_is_omap2420()             is_omap2420()
-# define cpu_is_omap2422()             is_omap2422()
-# define cpu_is_omap2423()             is_omap2423()
-# define cpu_is_omap2430()             is_omap2430()
-#endif
-
-#if defined(CONFIG_ARCH_OMAP3)
-# undef cpu_is_omap3430
-# undef cpu_is_ti81xx
-# undef cpu_is_ti816x
-# undef cpu_is_ti814x
-# undef soc_is_am35xx
-# define cpu_is_omap3430()             is_omap3430()
-# undef cpu_is_omap3630
-# define cpu_is_omap3630()             is_omap363x()
-# define cpu_is_ti81xx()               is_ti81xx()
-# define cpu_is_ti816x()               is_ti816x()
-# define cpu_is_ti814x()               is_ti814x()
-# define soc_is_am35xx()               is_am35xx()
+#ifdef CONFIG_ARCH_OMAP1
+#include "../../mach-omap1/soc.h"
 #endif
 
-# if defined(CONFIG_SOC_AM33XX)
-# undef soc_is_am33xx
-# undef soc_is_am335x
-# define soc_is_am33xx()               is_am33xx()
-# define soc_is_am335x()               is_am335x()
+#ifdef CONFIG_ARCH_OMAP2PLUS
+#include "../../mach-omap2/soc.h"
 #endif
 
-# if defined(CONFIG_ARCH_OMAP4)
-# undef cpu_is_omap44xx
-# undef cpu_is_omap443x
-# undef cpu_is_omap446x
-# undef cpu_is_omap447x
-# define cpu_is_omap44xx()             is_omap44xx()
-# define cpu_is_omap443x()             is_omap443x()
-# define cpu_is_omap446x()             is_omap446x()
-# define cpu_is_omap447x()             is_omap447x()
-# endif
-
-# if defined(CONFIG_SOC_OMAP5)
-# undef soc_is_omap54xx
-# undef soc_is_omap543x
-# define soc_is_omap54xx()             is_omap54xx()
-# define soc_is_omap543x()             is_omap543x()
-#endif
-
-/* Macros to detect if we have OMAP1 or OMAP2 */
-#define cpu_class_is_omap1()   (cpu_is_omap7xx() || cpu_is_omap15xx() || \
-                               cpu_is_omap16xx())
-#define cpu_class_is_omap2()   (cpu_is_omap24xx() || cpu_is_omap34xx() || \
-                               cpu_is_omap44xx() || soc_is_omap54xx() || \
-                               soc_is_am33xx())
-
-/* Various silicon revisions for omap2 */
-#define OMAP242X_CLASS         0x24200024
-#define OMAP2420_REV_ES1_0     OMAP242X_CLASS
-#define OMAP2420_REV_ES2_0     (OMAP242X_CLASS | (0x1 << 8))
-
-#define OMAP243X_CLASS         0x24300024
-#define OMAP2430_REV_ES1_0     OMAP243X_CLASS
-
-#define OMAP343X_CLASS         0x34300034
-#define OMAP3430_REV_ES1_0     OMAP343X_CLASS
-#define OMAP3430_REV_ES2_0     (OMAP343X_CLASS | (0x1 << 8))
-#define OMAP3430_REV_ES2_1     (OMAP343X_CLASS | (0x2 << 8))
-#define OMAP3430_REV_ES3_0     (OMAP343X_CLASS | (0x3 << 8))
-#define OMAP3430_REV_ES3_1     (OMAP343X_CLASS | (0x4 << 8))
-#define OMAP3430_REV_ES3_1_2   (OMAP343X_CLASS | (0x5 << 8))
-
-#define OMAP363X_CLASS         0x36300034
-#define OMAP3630_REV_ES1_0     OMAP363X_CLASS
-#define OMAP3630_REV_ES1_1     (OMAP363X_CLASS | (0x1 << 8))
-#define OMAP3630_REV_ES1_2     (OMAP363X_CLASS | (0x2 << 8))
-
-#define TI816X_CLASS           0x81600034
-#define TI8168_REV_ES1_0       TI816X_CLASS
-#define TI8168_REV_ES1_1       (TI816X_CLASS | (0x1 << 8))
-
-#define TI814X_CLASS           0x81400034
-#define TI8148_REV_ES1_0       TI814X_CLASS
-#define TI8148_REV_ES2_0       (TI814X_CLASS | (0x1 << 8))
-#define TI8148_REV_ES2_1       (TI814X_CLASS | (0x2 << 8))
-
-#define AM35XX_CLASS           0x35170034
-#define AM35XX_REV_ES1_0       AM35XX_CLASS
-#define AM35XX_REV_ES1_1       (AM35XX_CLASS | (0x1 << 8))
-
-#define AM335X_CLASS           0x33500033
-#define AM335X_REV_ES1_0       AM335X_CLASS
-
-#define OMAP443X_CLASS         0x44300044
-#define OMAP4430_REV_ES1_0     (OMAP443X_CLASS | (0x10 << 8))
-#define OMAP4430_REV_ES2_0     (OMAP443X_CLASS | (0x20 << 8))
-#define OMAP4430_REV_ES2_1     (OMAP443X_CLASS | (0x21 << 8))
-#define OMAP4430_REV_ES2_2     (OMAP443X_CLASS | (0x22 << 8))
-#define OMAP4430_REV_ES2_3     (OMAP443X_CLASS | (0x23 << 8))
-
-#define OMAP446X_CLASS         0x44600044
-#define OMAP4460_REV_ES1_0     (OMAP446X_CLASS | (0x10 << 8))
-#define OMAP4460_REV_ES1_1     (OMAP446X_CLASS | (0x11 << 8))
-
-#define OMAP447X_CLASS         0x44700044
-#define OMAP4470_REV_ES1_0     (OMAP447X_CLASS | (0x10 << 8))
-
-#define OMAP54XX_CLASS         0x54000054
-#define OMAP5430_REV_ES1_0     (OMAP54XX_CLASS | (0x30 << 16) | (0x10 << 8))
-#define OMAP5432_REV_ES1_0     (OMAP54XX_CLASS | (0x32 << 16) | (0x10 << 8))
-
-void omap2xxx_check_revision(void);
-void omap3xxx_check_revision(void);
-void omap4xxx_check_revision(void);
-void omap5xxx_check_revision(void);
-void omap3xxx_check_features(void);
-void ti81xx_check_features(void);
-void omap4xxx_check_features(void);
-
-/*
- * Runtime detection of OMAP3 features
- *
- * OMAP3_HAS_IO_CHAIN_CTRL: Some later members of the OMAP3 chip
- *    family have OS-level control over the I/O chain clock.  This is
- *    to avoid a window during which wakeups could potentially be lost
- *    during powerdomain transitions.  If this bit is set, it
- *    indicates that the chip does support OS-level control of this
- *    feature.
- */
-extern u32 omap_features;
-
-#define OMAP3_HAS_L2CACHE              BIT(0)
-#define OMAP3_HAS_IVA                  BIT(1)
-#define OMAP3_HAS_SGX                  BIT(2)
-#define OMAP3_HAS_NEON                 BIT(3)
-#define OMAP3_HAS_ISP                  BIT(4)
-#define OMAP3_HAS_192MHZ_CLK           BIT(5)
-#define OMAP3_HAS_IO_WAKEUP            BIT(6)
-#define OMAP3_HAS_SDRC                 BIT(7)
-#define OMAP3_HAS_IO_CHAIN_CTRL                BIT(8)
-#define OMAP4_HAS_MPU_1GHZ             BIT(9)
-#define OMAP4_HAS_MPU_1_2GHZ           BIT(10)
-#define OMAP4_HAS_MPU_1_5GHZ           BIT(11)
-
-
-#define OMAP3_HAS_FEATURE(feat,flag)                   \
-static inline unsigned int omap3_has_ ##feat(void)     \
-{                                                      \
-       return omap_features & OMAP3_HAS_ ##flag;       \
-}                                                      \
-
-OMAP3_HAS_FEATURE(l2cache, L2CACHE)
-OMAP3_HAS_FEATURE(sgx, SGX)
-OMAP3_HAS_FEATURE(iva, IVA)
-OMAP3_HAS_FEATURE(neon, NEON)
-OMAP3_HAS_FEATURE(isp, ISP)
-OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
-OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
-OMAP3_HAS_FEATURE(sdrc, SDRC)
-OMAP3_HAS_FEATURE(io_chain_ctrl, IO_CHAIN_CTRL)
-
-/*
- * Runtime detection of OMAP4 features
- */
-#define OMAP4_HAS_FEATURE(feat, flag)                  \
-static inline unsigned int omap4_has_ ##feat(void)     \
-{                                                      \
-       return omap_features & OMAP4_HAS_ ##flag;       \
-}                                                      \
-
-OMAP4_HAS_FEATURE(mpu_1ghz, MPU_1GHZ)
-OMAP4_HAS_FEATURE(mpu_1_2ghz, MPU_1_2GHZ)
-OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ)
-
-#endif /* __ASSEMBLY__ */
 #endif
diff --git a/arch/arm/plat-omap/include/plat/dma-44xx.h b/arch/arm/plat-omap/include/plat/dma-44xx.h
deleted file mode 100644 (file)
index 1f767cb..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * OMAP4 SDMA channel definitions
- *
- * Copyright (C) 2009-2010 Texas Instruments, Inc.
- * Copyright (C) 2009-2010 Nokia Corporation
- *
- * Santosh Shilimkar (santosh.shilimkar@ti.com)
- * Benoit Cousson (b-cousson@ti.com)
- * Paul Walmsley (paul@pwsan.com)
- *
- * This file is automatically generated from the OMAP hardware databases.
- * We respectfully ask that any modifications to this file be coordinated
- * with the public linux-omap@vger.kernel.org mailing list and the
- * authors above to ensure that the autogeneration scripts are kept
- * up-to-date with the file contents.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __ARCH_ARM_MACH_OMAP2_OMAP44XX_DMA_H
-#define __ARCH_ARM_MACH_OMAP2_OMAP44XX_DMA_H
-
-#define OMAP44XX_DMA_SYS_REQ0                  2
-#define OMAP44XX_DMA_SYS_REQ1                  3
-#define OMAP44XX_DMA_GPMC                      4
-#define OMAP44XX_DMA_DSS_DISPC_REQ             6
-#define OMAP44XX_DMA_SYS_REQ2                  7
-#define OMAP44XX_DMA_MCASP1_AXEVT              8
-#define OMAP44XX_DMA_ISS_REQ1                  9
-#define OMAP44XX_DMA_ISS_REQ2                  10
-#define OMAP44XX_DMA_MCASP1_AREVT              11
-#define OMAP44XX_DMA_ISS_REQ3                  12
-#define OMAP44XX_DMA_ISS_REQ4                  13
-#define OMAP44XX_DMA_DSS_RFBI_REQ              14
-#define OMAP44XX_DMA_SPI3_TX0                  15
-#define OMAP44XX_DMA_SPI3_RX0                  16
-#define OMAP44XX_DMA_MCBSP2_TX                 17
-#define OMAP44XX_DMA_MCBSP2_RX                 18
-#define OMAP44XX_DMA_MCBSP3_TX                 19
-#define OMAP44XX_DMA_MCBSP3_RX                 20
-#define OMAP44XX_DMA_C2C_SSCM_GPO0             21
-#define OMAP44XX_DMA_C2C_SSCM_GPO1             22
-#define OMAP44XX_DMA_SPI3_TX1                  23
-#define OMAP44XX_DMA_SPI3_RX1                  24
-#define OMAP44XX_DMA_I2C3_TX                   25
-#define OMAP44XX_DMA_I2C3_RX                   26
-#define OMAP44XX_DMA_I2C1_TX                   27
-#define OMAP44XX_DMA_I2C1_RX                   28
-#define OMAP44XX_DMA_I2C2_TX                   29
-#define OMAP44XX_DMA_I2C2_RX                   30
-#define OMAP44XX_DMA_MCBSP4_TX                 31
-#define OMAP44XX_DMA_MCBSP4_RX                 32
-#define OMAP44XX_DMA_MCBSP1_TX                 33
-#define OMAP44XX_DMA_MCBSP1_RX                 34
-#define OMAP44XX_DMA_SPI1_TX0                  35
-#define OMAP44XX_DMA_SPI1_RX0                  36
-#define OMAP44XX_DMA_SPI1_TX1                  37
-#define OMAP44XX_DMA_SPI1_RX1                  38
-#define OMAP44XX_DMA_SPI1_TX2                  39
-#define OMAP44XX_DMA_SPI1_RX2                  40
-#define OMAP44XX_DMA_SPI1_TX3                  41
-#define OMAP44XX_DMA_SPI1_RX3                  42
-#define OMAP44XX_DMA_SPI2_TX0                  43
-#define OMAP44XX_DMA_SPI2_RX0                  44
-#define OMAP44XX_DMA_SPI2_TX1                  45
-#define OMAP44XX_DMA_SPI2_RX1                  46
-#define OMAP44XX_DMA_MMC2_TX                   47
-#define OMAP44XX_DMA_MMC2_RX                   48
-#define OMAP44XX_DMA_UART1_TX                  49
-#define OMAP44XX_DMA_UART1_RX                  50
-#define OMAP44XX_DMA_UART2_TX                  51
-#define OMAP44XX_DMA_UART2_RX                  52
-#define OMAP44XX_DMA_UART3_TX                  53
-#define OMAP44XX_DMA_UART3_RX                  54
-#define OMAP44XX_DMA_UART4_TX                  55
-#define OMAP44XX_DMA_UART4_RX                  56
-#define OMAP44XX_DMA_MMC4_TX                   57
-#define OMAP44XX_DMA_MMC4_RX                   58
-#define OMAP44XX_DMA_MMC5_TX                   59
-#define OMAP44XX_DMA_MMC5_RX                   60
-#define OMAP44XX_DMA_MMC1_TX                   61
-#define OMAP44XX_DMA_MMC1_RX                   62
-#define OMAP44XX_DMA_SYS_REQ3                  64
-#define OMAP44XX_DMA_MCPDM_UP                  65
-#define OMAP44XX_DMA_MCPDM_DL                  66
-#define OMAP44XX_DMA_DMIC_REQ                  67
-#define OMAP44XX_DMA_C2C_SSCM_GPO2             68
-#define OMAP44XX_DMA_C2C_SSCM_GPO3             69
-#define OMAP44XX_DMA_SPI4_TX0                  70
-#define OMAP44XX_DMA_SPI4_RX0                  71
-#define OMAP44XX_DMA_DSS_DSI1_REQ0             72
-#define OMAP44XX_DMA_DSS_DSI1_REQ1             73
-#define OMAP44XX_DMA_DSS_DSI1_REQ2             74
-#define OMAP44XX_DMA_DSS_DSI1_REQ3             75
-#define OMAP44XX_DMA_DSS_HDMI_REQ              76
-#define OMAP44XX_DMA_MMC3_TX                   77
-#define OMAP44XX_DMA_MMC3_RX                   78
-#define OMAP44XX_DMA_USIM_TX                   79
-#define OMAP44XX_DMA_USIM_RX                   80
-#define OMAP44XX_DMA_DSS_DSI2_REQ0             81
-#define OMAP44XX_DMA_DSS_DSI2_REQ1             82
-#define OMAP44XX_DMA_DSS_DSI2_REQ2             83
-#define OMAP44XX_DMA_DSS_DSI2_REQ3             84
-#define OMAP44XX_DMA_SLIMBUS1_TX0              85
-#define OMAP44XX_DMA_SLIMBUS1_TX1              86
-#define OMAP44XX_DMA_SLIMBUS1_TX2              87
-#define OMAP44XX_DMA_SLIMBUS1_TX3              88
-#define OMAP44XX_DMA_SLIMBUS1_RX0              89
-#define OMAP44XX_DMA_SLIMBUS1_RX1              90
-#define OMAP44XX_DMA_SLIMBUS1_RX2              91
-#define OMAP44XX_DMA_SLIMBUS1_RX3              92
-#define OMAP44XX_DMA_SLIMBUS2_TX0              93
-#define OMAP44XX_DMA_SLIMBUS2_TX1              94
-#define OMAP44XX_DMA_SLIMBUS2_TX2              95
-#define OMAP44XX_DMA_SLIMBUS2_TX3              96
-#define OMAP44XX_DMA_SLIMBUS2_RX0              97
-#define OMAP44XX_DMA_SLIMBUS2_RX1              98
-#define OMAP44XX_DMA_SLIMBUS2_RX2              99
-#define OMAP44XX_DMA_SLIMBUS2_RX3              100
-#define OMAP44XX_DMA_ABE_REQ_0                 101
-#define OMAP44XX_DMA_ABE_REQ_1                 102
-#define OMAP44XX_DMA_ABE_REQ_2                 103
-#define OMAP44XX_DMA_ABE_REQ_3                 104
-#define OMAP44XX_DMA_ABE_REQ_4                 105
-#define OMAP44XX_DMA_ABE_REQ_5                 106
-#define OMAP44XX_DMA_ABE_REQ_6                 107
-#define OMAP44XX_DMA_ABE_REQ_7                 108
-#define OMAP44XX_DMA_AES1_P_CTX_IN_REQ         109
-#define OMAP44XX_DMA_AES1_P_DATA_IN_REQ                110
-#define OMAP44XX_DMA_AES1_P_DATA_OUT_REQ       111
-#define OMAP44XX_DMA_AES2_P_CTX_IN_REQ         112
-#define OMAP44XX_DMA_AES2_P_DATA_IN_REQ                113
-#define OMAP44XX_DMA_AES2_P_DATA_OUT_REQ       114
-#define OMAP44XX_DMA_DES_P_CTX_IN_REQ          115
-#define OMAP44XX_DMA_DES_P_DATA_IN_REQ         116
-#define OMAP44XX_DMA_DES_P_DATA_OUT_REQ                117
-#define OMAP44XX_DMA_SHA2_CTXIN_P              118
-#define OMAP44XX_DMA_SHA2_DIN_P                        119
-#define OMAP44XX_DMA_SHA2_CTXOUT_P             120
-#define OMAP44XX_DMA_AES1_P_CONTEXT_OUT_REQ    121
-#define OMAP44XX_DMA_AES2_P_CONTEXT_OUT_REQ    122
-#define OMAP44XX_DMA_I2C4_TX                   124
-#define OMAP44XX_DMA_I2C4_RX                   125
-
-#endif
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h
deleted file mode 100644 (file)
index 0a87b05..0000000
+++ /dev/null
@@ -1,546 +0,0 @@
-/*
- *  arch/arm/plat-omap/include/mach/dma.h
- *
- *  Copyright (C) 2003 Nokia Corporation
- *  Author: Juha Yrjölä <juha.yrjola@nokia.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-#ifndef __ASM_ARCH_DMA_H
-#define __ASM_ARCH_DMA_H
-
-#include <linux/platform_device.h>
-
-/*
- * TODO: These dma channel defines should go away once all
- * the omap drivers hwmod adapted.
- */
-
-/* Move omap4 specific defines to dma-44xx.h */
-#include "dma-44xx.h"
-
-#define INT_DMA_LCD                    25
-
-/* DMA channels for omap1 */
-#define OMAP_DMA_NO_DEVICE             0
-#define OMAP_DMA_MCSI1_TX              1
-#define OMAP_DMA_MCSI1_RX              2
-#define OMAP_DMA_I2C_RX                        3
-#define OMAP_DMA_I2C_TX                        4
-#define OMAP_DMA_EXT_NDMA_REQ          5
-#define OMAP_DMA_EXT_NDMA_REQ2         6
-#define OMAP_DMA_UWIRE_TX              7
-#define OMAP_DMA_MCBSP1_TX             8
-#define OMAP_DMA_MCBSP1_RX             9
-#define OMAP_DMA_MCBSP3_TX             10
-#define OMAP_DMA_MCBSP3_RX             11
-#define OMAP_DMA_UART1_TX              12
-#define OMAP_DMA_UART1_RX              13
-#define OMAP_DMA_UART2_TX              14
-#define OMAP_DMA_UART2_RX              15
-#define OMAP_DMA_MCBSP2_TX             16
-#define OMAP_DMA_MCBSP2_RX             17
-#define OMAP_DMA_UART3_TX              18
-#define OMAP_DMA_UART3_RX              19
-#define OMAP_DMA_CAMERA_IF_RX          20
-#define OMAP_DMA_MMC_TX                        21
-#define OMAP_DMA_MMC_RX                        22
-#define OMAP_DMA_NAND                  23
-#define OMAP_DMA_IRQ_LCD_LINE          24
-#define OMAP_DMA_MEMORY_STICK          25
-#define OMAP_DMA_USB_W2FC_RX0          26
-#define OMAP_DMA_USB_W2FC_RX1          27
-#define OMAP_DMA_USB_W2FC_RX2          28
-#define OMAP_DMA_USB_W2FC_TX0          29
-#define OMAP_DMA_USB_W2FC_TX1          30
-#define OMAP_DMA_USB_W2FC_TX2          31
-
-/* These are only for 1610 */
-#define OMAP_DMA_CRYPTO_DES_IN         32
-#define OMAP_DMA_SPI_TX                        33
-#define OMAP_DMA_SPI_RX                        34
-#define OMAP_DMA_CRYPTO_HASH           35
-#define OMAP_DMA_CCP_ATTN              36
-#define OMAP_DMA_CCP_FIFO_NOT_EMPTY    37
-#define OMAP_DMA_CMT_APE_TX_CHAN_0     38
-#define OMAP_DMA_CMT_APE_RV_CHAN_0     39
-#define OMAP_DMA_CMT_APE_TX_CHAN_1     40
-#define OMAP_DMA_CMT_APE_RV_CHAN_1     41
-#define OMAP_DMA_CMT_APE_TX_CHAN_2     42
-#define OMAP_DMA_CMT_APE_RV_CHAN_2     43
-#define OMAP_DMA_CMT_APE_TX_CHAN_3     44
-#define OMAP_DMA_CMT_APE_RV_CHAN_3     45
-#define OMAP_DMA_CMT_APE_TX_CHAN_4     46
-#define OMAP_DMA_CMT_APE_RV_CHAN_4     47
-#define OMAP_DMA_CMT_APE_TX_CHAN_5     48
-#define OMAP_DMA_CMT_APE_RV_CHAN_5     49
-#define OMAP_DMA_CMT_APE_TX_CHAN_6     50
-#define OMAP_DMA_CMT_APE_RV_CHAN_6     51
-#define OMAP_DMA_CMT_APE_TX_CHAN_7     52
-#define OMAP_DMA_CMT_APE_RV_CHAN_7     53
-#define OMAP_DMA_MMC2_TX               54
-#define OMAP_DMA_MMC2_RX               55
-#define OMAP_DMA_CRYPTO_DES_OUT                56
-
-/* DMA channels for 24xx */
-#define OMAP24XX_DMA_NO_DEVICE         0
-#define OMAP24XX_DMA_XTI_DMA           1       /* S_DMA_0 */
-#define OMAP24XX_DMA_EXT_DMAREQ0       2       /* S_DMA_1 */
-#define OMAP24XX_DMA_EXT_DMAREQ1       3       /* S_DMA_2 */
-#define OMAP24XX_DMA_GPMC              4       /* S_DMA_3 */
-#define OMAP24XX_DMA_GFX               5       /* S_DMA_4 */
-#define OMAP24XX_DMA_DSS               6       /* S_DMA_5 */
-#define OMAP242X_DMA_VLYNQ_TX          7       /* S_DMA_6 */
-#define OMAP24XX_DMA_EXT_DMAREQ2       7       /* S_DMA_6 */
-#define OMAP24XX_DMA_CWT               8       /* S_DMA_7 */
-#define OMAP24XX_DMA_AES_TX            9       /* S_DMA_8 */
-#define OMAP24XX_DMA_AES_RX            10      /* S_DMA_9 */
-#define OMAP24XX_DMA_DES_TX            11      /* S_DMA_10 */
-#define OMAP24XX_DMA_DES_RX            12      /* S_DMA_11 */
-#define OMAP24XX_DMA_SHA1MD5_RX                13      /* S_DMA_12 */
-#define OMAP34XX_DMA_SHA2MD5_RX                13      /* S_DMA_12 */
-#define OMAP242X_DMA_EXT_DMAREQ2       14      /* S_DMA_13 */
-#define OMAP242X_DMA_EXT_DMAREQ3       15      /* S_DMA_14 */
-#define OMAP242X_DMA_EXT_DMAREQ4       16      /* S_DMA_15 */
-#define OMAP242X_DMA_EAC_AC_RD         17      /* S_DMA_16 */
-#define OMAP242X_DMA_EAC_AC_WR         18      /* S_DMA_17 */
-#define OMAP242X_DMA_EAC_MD_UL_RD      19      /* S_DMA_18 */
-#define OMAP242X_DMA_EAC_MD_UL_WR      20      /* S_DMA_19 */
-#define OMAP242X_DMA_EAC_MD_DL_RD      21      /* S_DMA_20 */
-#define OMAP242X_DMA_EAC_MD_DL_WR      22      /* S_DMA_21 */
-#define OMAP242X_DMA_EAC_BT_UL_RD      23      /* S_DMA_22 */
-#define OMAP242X_DMA_EAC_BT_UL_WR      24      /* S_DMA_23 */
-#define OMAP242X_DMA_EAC_BT_DL_RD      25      /* S_DMA_24 */
-#define OMAP242X_DMA_EAC_BT_DL_WR      26      /* S_DMA_25 */
-#define OMAP243X_DMA_EXT_DMAREQ3       14      /* S_DMA_13 */
-#define OMAP24XX_DMA_SPI3_TX0          15      /* S_DMA_14 */
-#define OMAP24XX_DMA_SPI3_RX0          16      /* S_DMA_15 */
-#define OMAP24XX_DMA_MCBSP3_TX         17      /* S_DMA_16 */
-#define OMAP24XX_DMA_MCBSP3_RX         18      /* S_DMA_17 */
-#define OMAP24XX_DMA_MCBSP4_TX         19      /* S_DMA_18 */
-#define OMAP24XX_DMA_MCBSP4_RX         20      /* S_DMA_19 */
-#define OMAP24XX_DMA_MCBSP5_TX         21      /* S_DMA_20 */
-#define OMAP24XX_DMA_MCBSP5_RX         22      /* S_DMA_21 */
-#define OMAP24XX_DMA_SPI3_TX1          23      /* S_DMA_22 */
-#define OMAP24XX_DMA_SPI3_RX1          24      /* S_DMA_23 */
-#define OMAP243X_DMA_EXT_DMAREQ4       25      /* S_DMA_24 */
-#define OMAP243X_DMA_EXT_DMAREQ5       26      /* S_DMA_25 */
-#define OMAP34XX_DMA_I2C3_TX           25      /* S_DMA_24 */
-#define OMAP34XX_DMA_I2C3_RX           26      /* S_DMA_25 */
-#define OMAP24XX_DMA_I2C1_TX           27      /* S_DMA_26 */
-#define OMAP24XX_DMA_I2C1_RX           28      /* S_DMA_27 */
-#define OMAP24XX_DMA_I2C2_TX           29      /* S_DMA_28 */
-#define OMAP24XX_DMA_I2C2_RX           30      /* S_DMA_29 */
-#define OMAP24XX_DMA_MCBSP1_TX         31      /* S_DMA_30 */
-#define OMAP24XX_DMA_MCBSP1_RX         32      /* S_DMA_31 */
-#define OMAP24XX_DMA_MCBSP2_TX         33      /* S_DMA_32 */
-#define OMAP24XX_DMA_MCBSP2_RX         34      /* S_DMA_33 */
-#define OMAP24XX_DMA_SPI1_TX0          35      /* S_DMA_34 */
-#define OMAP24XX_DMA_SPI1_RX0          36      /* S_DMA_35 */
-#define OMAP24XX_DMA_SPI1_TX1          37      /* S_DMA_36 */
-#define OMAP24XX_DMA_SPI1_RX1          38      /* S_DMA_37 */
-#define OMAP24XX_DMA_SPI1_TX2          39      /* S_DMA_38 */
-#define OMAP24XX_DMA_SPI1_RX2          40      /* S_DMA_39 */
-#define OMAP24XX_DMA_SPI1_TX3          41      /* S_DMA_40 */
-#define OMAP24XX_DMA_SPI1_RX3          42      /* S_DMA_41 */
-#define OMAP24XX_DMA_SPI2_TX0          43      /* S_DMA_42 */
-#define OMAP24XX_DMA_SPI2_RX0          44      /* S_DMA_43 */
-#define OMAP24XX_DMA_SPI2_TX1          45      /* S_DMA_44 */
-#define OMAP24XX_DMA_SPI2_RX1          46      /* S_DMA_45 */
-#define OMAP24XX_DMA_MMC2_TX           47      /* S_DMA_46 */
-#define OMAP24XX_DMA_MMC2_RX           48      /* S_DMA_47 */
-#define OMAP24XX_DMA_UART1_TX          49      /* S_DMA_48 */
-#define OMAP24XX_DMA_UART1_RX          50      /* S_DMA_49 */
-#define OMAP24XX_DMA_UART2_TX          51      /* S_DMA_50 */
-#define OMAP24XX_DMA_UART2_RX          52      /* S_DMA_51 */
-#define OMAP24XX_DMA_UART3_TX          53      /* S_DMA_52 */
-#define OMAP24XX_DMA_UART3_RX          54      /* S_DMA_53 */
-#define OMAP24XX_DMA_USB_W2FC_TX0      55      /* S_DMA_54 */
-#define OMAP24XX_DMA_USB_W2FC_RX0      56      /* S_DMA_55 */
-#define OMAP24XX_DMA_USB_W2FC_TX1      57      /* S_DMA_56 */
-#define OMAP24XX_DMA_USB_W2FC_RX1      58      /* S_DMA_57 */
-#define OMAP24XX_DMA_USB_W2FC_TX2      59      /* S_DMA_58 */
-#define OMAP24XX_DMA_USB_W2FC_RX2      60      /* S_DMA_59 */
-#define OMAP24XX_DMA_MMC1_TX           61      /* S_DMA_60 */
-#define OMAP24XX_DMA_MMC1_RX           62      /* S_DMA_61 */
-#define OMAP24XX_DMA_MS                        63      /* S_DMA_62 */
-#define OMAP242X_DMA_EXT_DMAREQ5       64      /* S_DMA_63 */
-#define OMAP243X_DMA_EXT_DMAREQ6       64      /* S_DMA_63 */
-#define OMAP34XX_DMA_EXT_DMAREQ3       64      /* S_DMA_63 */
-#define OMAP34XX_DMA_AES2_TX           65      /* S_DMA_64 */
-#define OMAP34XX_DMA_AES2_RX           66      /* S_DMA_65 */
-#define OMAP34XX_DMA_DES2_TX           67      /* S_DMA_66 */
-#define OMAP34XX_DMA_DES2_RX           68      /* S_DMA_67 */
-#define OMAP34XX_DMA_SHA1MD5_RX                69      /* S_DMA_68 */
-#define OMAP34XX_DMA_SPI4_TX0          70      /* S_DMA_69 */
-#define OMAP34XX_DMA_SPI4_RX0          71      /* S_DMA_70 */
-#define OMAP34XX_DSS_DMA0              72      /* S_DMA_71 */
-#define OMAP34XX_DSS_DMA1              73      /* S_DMA_72 */
-#define OMAP34XX_DSS_DMA2              74      /* S_DMA_73 */
-#define OMAP34XX_DSS_DMA3              75      /* S_DMA_74 */
-#define OMAP34XX_DMA_MMC3_TX           77      /* S_DMA_76 */
-#define OMAP34XX_DMA_MMC3_RX           78      /* S_DMA_77 */
-#define OMAP34XX_DMA_USIM_TX           79      /* S_DMA_78 */
-#define OMAP34XX_DMA_USIM_RX           80      /* S_DMA_79 */
-
-#define OMAP36XX_DMA_UART4_TX          81      /* S_DMA_80 */
-#define OMAP36XX_DMA_UART4_RX          82      /* S_DMA_81 */
-
-/* Only for AM35xx */
-#define AM35XX_DMA_UART4_TX            54
-#define AM35XX_DMA_UART4_RX            55
-
-/*----------------------------------------------------------------------------*/
-
-#define OMAP1_DMA_TOUT_IRQ             (1 << 0)
-#define OMAP_DMA_DROP_IRQ              (1 << 1)
-#define OMAP_DMA_HALF_IRQ              (1 << 2)
-#define OMAP_DMA_FRAME_IRQ             (1 << 3)
-#define OMAP_DMA_LAST_IRQ              (1 << 4)
-#define OMAP_DMA_BLOCK_IRQ             (1 << 5)
-#define OMAP1_DMA_SYNC_IRQ             (1 << 6)
-#define OMAP2_DMA_PKT_IRQ              (1 << 7)
-#define OMAP2_DMA_TRANS_ERR_IRQ                (1 << 8)
-#define OMAP2_DMA_SECURE_ERR_IRQ       (1 << 9)
-#define OMAP2_DMA_SUPERVISOR_ERR_IRQ   (1 << 10)
-#define OMAP2_DMA_MISALIGNED_ERR_IRQ   (1 << 11)
-
-#define OMAP_DMA_CCR_EN                        (1 << 7)
-#define OMAP_DMA_CCR_RD_ACTIVE         (1 << 9)
-#define OMAP_DMA_CCR_WR_ACTIVE         (1 << 10)
-#define OMAP_DMA_CCR_SEL_SRC_DST_SYNC  (1 << 24)
-#define OMAP_DMA_CCR_BUFFERING_DISABLE (1 << 25)
-
-#define OMAP_DMA_DATA_TYPE_S8          0x00
-#define OMAP_DMA_DATA_TYPE_S16         0x01
-#define OMAP_DMA_DATA_TYPE_S32         0x02
-
-#define OMAP_DMA_SYNC_ELEMENT          0x00
-#define OMAP_DMA_SYNC_FRAME            0x01
-#define OMAP_DMA_SYNC_BLOCK            0x02
-#define OMAP_DMA_SYNC_PACKET           0x03
-
-#define OMAP_DMA_DST_SYNC_PREFETCH     0x02
-#define OMAP_DMA_SRC_SYNC              0x01
-#define OMAP_DMA_DST_SYNC              0x00
-
-#define OMAP_DMA_PORT_EMIFF            0x00
-#define OMAP_DMA_PORT_EMIFS            0x01
-#define OMAP_DMA_PORT_OCP_T1           0x02
-#define OMAP_DMA_PORT_TIPB             0x03
-#define OMAP_DMA_PORT_OCP_T2           0x04
-#define OMAP_DMA_PORT_MPUI             0x05
-
-#define OMAP_DMA_AMODE_CONSTANT                0x00
-#define OMAP_DMA_AMODE_POST_INC                0x01
-#define OMAP_DMA_AMODE_SINGLE_IDX      0x02
-#define OMAP_DMA_AMODE_DOUBLE_IDX      0x03
-
-#define DMA_DEFAULT_FIFO_DEPTH         0x10
-#define DMA_DEFAULT_ARB_RATE           0x01
-/* Pass THREAD_RESERVE ORed with THREAD_FIFO for tparams */
-#define DMA_THREAD_RESERVE_NORM                (0x00 << 12) /* Def */
-#define DMA_THREAD_RESERVE_ONET                (0x01 << 12)
-#define DMA_THREAD_RESERVE_TWOT                (0x02 << 12)
-#define DMA_THREAD_RESERVE_THREET      (0x03 << 12)
-#define DMA_THREAD_FIFO_NONE           (0x00 << 14) /* Def */
-#define DMA_THREAD_FIFO_75             (0x01 << 14)
-#define DMA_THREAD_FIFO_25             (0x02 << 14)
-#define DMA_THREAD_FIFO_50             (0x03 << 14)
-
-/* DMA4_OCP_SYSCONFIG bits */
-#define DMA_SYSCONFIG_MIDLEMODE_MASK           (3 << 12)
-#define DMA_SYSCONFIG_CLOCKACTIVITY_MASK       (3 << 8)
-#define DMA_SYSCONFIG_EMUFREE                  (1 << 5)
-#define DMA_SYSCONFIG_SIDLEMODE_MASK           (3 << 3)
-#define DMA_SYSCONFIG_SOFTRESET                        (1 << 2)
-#define DMA_SYSCONFIG_AUTOIDLE                 (1 << 0)
-
-#define DMA_SYSCONFIG_MIDLEMODE(n)             ((n) << 12)
-#define DMA_SYSCONFIG_SIDLEMODE(n)             ((n) << 3)
-
-#define DMA_IDLEMODE_SMARTIDLE                 0x2
-#define DMA_IDLEMODE_NO_IDLE                   0x1
-#define DMA_IDLEMODE_FORCE_IDLE                        0x0
-
-/* Chaining modes*/
-#ifndef CONFIG_ARCH_OMAP1
-#define OMAP_DMA_STATIC_CHAIN          0x1
-#define OMAP_DMA_DYNAMIC_CHAIN         0x2
-#define OMAP_DMA_CHAIN_ACTIVE          0x1
-#define OMAP_DMA_CHAIN_INACTIVE                0x0
-#endif
-
-#define DMA_CH_PRIO_HIGH               0x1
-#define DMA_CH_PRIO_LOW                        0x0 /* Def */
-
-/* Errata handling */
-#define IS_DMA_ERRATA(id)              (errata & (id))
-#define SET_DMA_ERRATA(id)             (errata |= (id))
-
-#define DMA_ERRATA_IFRAME_BUFFERING    BIT(0x0)
-#define DMA_ERRATA_PARALLEL_CHANNELS   BIT(0x1)
-#define DMA_ERRATA_i378                        BIT(0x2)
-#define DMA_ERRATA_i541                        BIT(0x3)
-#define DMA_ERRATA_i88                 BIT(0x4)
-#define DMA_ERRATA_3_3                 BIT(0x5)
-#define DMA_ROMCODE_BUG                        BIT(0x6)
-
-/* Attributes for OMAP DMA Contrller */
-#define DMA_LINKED_LCH                 BIT(0x0)
-#define GLOBAL_PRIORITY                        BIT(0x1)
-#define RESERVE_CHANNEL                        BIT(0x2)
-#define IS_CSSA_32                     BIT(0x3)
-#define IS_CDSA_32                     BIT(0x4)
-#define IS_RW_PRIORITY                 BIT(0x5)
-#define ENABLE_1510_MODE               BIT(0x6)
-#define SRC_PORT                       BIT(0x7)
-#define DST_PORT                       BIT(0x8)
-#define SRC_INDEX                      BIT(0x9)
-#define DST_INDEX                      BIT(0xA)
-#define IS_BURST_ONLY4                 BIT(0xB)
-#define CLEAR_CSR_ON_READ              BIT(0xC)
-#define IS_WORD_16                     BIT(0xD)
-
-/* Defines for DMA Capabilities */
-#define DMA_HAS_TRANSPARENT_CAPS       (0x1 << 18)
-#define DMA_HAS_CONSTANT_FILL_CAPS     (0x1 << 19)
-#define DMA_HAS_DESCRIPTOR_CAPS                (0x3 << 20)
-
-enum omap_reg_offsets {
-
-GCR,           GSCR,           GRST1,          HW_ID,
-PCH2_ID,       PCH0_ID,        PCH1_ID,        PCHG_ID,
-PCHD_ID,       CAPS_0,         CAPS_1,         CAPS_2,
-CAPS_3,                CAPS_4,         PCH2_SR,        PCH0_SR,
-PCH1_SR,       PCHD_SR,        REVISION,       IRQSTATUS_L0,
-IRQSTATUS_L1,  IRQSTATUS_L2,   IRQSTATUS_L3,   IRQENABLE_L0,
-IRQENABLE_L1,  IRQENABLE_L2,   IRQENABLE_L3,   SYSSTATUS,
-OCP_SYSCONFIG,
-
-/* omap1+ specific */
-CPC, CCR2, LCH_CTRL,
-
-/* Common registers for all omap's */
-CSDP,          CCR,            CICR,           CSR,
-CEN,           CFN,            CSFI,           CSEI,
-CSAC,          CDAC,           CDEI,
-CDFI,          CLNK_CTRL,
-
-/* Channel specific registers */
-CSSA,          CDSA,           COLOR,
-CCEN,          CCFN,
-
-/* omap3630 and omap4 specific */
-CDP,           CNDP,           CCDN,
-
-};
-
-enum omap_dma_burst_mode {
-       OMAP_DMA_DATA_BURST_DIS = 0,
-       OMAP_DMA_DATA_BURST_4,
-       OMAP_DMA_DATA_BURST_8,
-       OMAP_DMA_DATA_BURST_16,
-};
-
-enum end_type {
-       OMAP_DMA_LITTLE_ENDIAN = 0,
-       OMAP_DMA_BIG_ENDIAN
-};
-
-enum omap_dma_color_mode {
-       OMAP_DMA_COLOR_DIS = 0,
-       OMAP_DMA_CONSTANT_FILL,
-       OMAP_DMA_TRANSPARENT_COPY
-};
-
-enum omap_dma_write_mode {
-       OMAP_DMA_WRITE_NON_POSTED = 0,
-       OMAP_DMA_WRITE_POSTED,
-       OMAP_DMA_WRITE_LAST_NON_POSTED
-};
-
-enum omap_dma_channel_mode {
-       OMAP_DMA_LCH_2D = 0,
-       OMAP_DMA_LCH_G,
-       OMAP_DMA_LCH_P,
-       OMAP_DMA_LCH_PD
-};
-
-struct omap_dma_channel_params {
-       int data_type;          /* data type 8,16,32 */
-       int elem_count;         /* number of elements in a frame */
-       int frame_count;        /* number of frames in a element */
-
-       int src_port;           /* Only on OMAP1 REVISIT: Is this needed? */
-       int src_amode;          /* constant, post increment, indexed,
-                                       double indexed */
-       unsigned long src_start;        /* source address : physical */
-       int src_ei;             /* source element index */
-       int src_fi;             /* source frame index */
-
-       int dst_port;           /* Only on OMAP1 REVISIT: Is this needed? */
-       int dst_amode;          /* constant, post increment, indexed,
-                                       double indexed */
-       unsigned long dst_start;        /* source address : physical */
-       int dst_ei;             /* source element index */
-       int dst_fi;             /* source frame index */
-
-       int trigger;            /* trigger attached if the channel is
-                                       synchronized */
-       int sync_mode;          /* sycn on element, frame , block or packet */
-       int src_or_dst_synch;   /* source synch(1) or destination synch(0) */
-
-       int ie;                 /* interrupt enabled */
-
-       unsigned char read_prio;/* read priority */
-       unsigned char write_prio;/* write priority */
-
-#ifndef CONFIG_ARCH_OMAP1
-       enum omap_dma_burst_mode burst_mode; /* Burst mode 4/8/16 words */
-#endif
-};
-
-struct omap_dma_lch {
-       int next_lch;
-       int dev_id;
-       u16 saved_csr;
-       u16 enabled_irqs;
-       const char *dev_name;
-       void (*callback)(int lch, u16 ch_status, void *data);
-       void *data;
-       long flags;
-       /* required for Dynamic chaining */
-       int prev_linked_ch;
-       int next_linked_ch;
-       int state;
-       int chain_id;
-       int status;
-};
-
-struct omap_dma_dev_attr {
-       u32 dev_caps;
-       u16 lch_count;
-       u16 chan_count;
-       struct omap_dma_lch *chan;
-};
-
-/* System DMA platform data structure */
-struct omap_system_dma_plat_info {
-       struct omap_dma_dev_attr *dma_attr;
-       u32 errata;
-       void (*disable_irq_lch)(int lch);
-       void (*show_dma_caps)(void);
-       void (*clear_lch_regs)(int lch);
-       void (*clear_dma)(int lch);
-       void (*dma_write)(u32 val, int reg, int lch);
-       u32 (*dma_read)(int reg, int lch);
-};
-
-extern void __init omap_init_consistent_dma_size(void);
-extern void omap_set_dma_priority(int lch, int dst_port, int priority);
-extern int omap_request_dma(int dev_id, const char *dev_name,
-                       void (*callback)(int lch, u16 ch_status, void *data),
-                       void *data, int *dma_ch);
-extern void omap_enable_dma_irq(int ch, u16 irq_bits);
-extern void omap_disable_dma_irq(int ch, u16 irq_bits);
-extern void omap_free_dma(int ch);
-extern void omap_start_dma(int lch);
-extern void omap_stop_dma(int lch);
-extern void omap_set_dma_transfer_params(int lch, int data_type,
-                                        int elem_count, int frame_count,
-                                        int sync_mode,
-                                        int dma_trigger, int src_or_dst_synch);
-extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode,
-                                   u32 color);
-extern void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode);
-extern void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode);
-
-extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
-                                   unsigned long src_start,
-                                   int src_ei, int src_fi);
-extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
-extern void omap_set_dma_src_data_pack(int lch, int enable);
-extern void omap_set_dma_src_burst_mode(int lch,
-                                       enum omap_dma_burst_mode burst_mode);
-
-extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
-                                    unsigned long dest_start,
-                                    int dst_ei, int dst_fi);
-extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
-extern void omap_set_dma_dest_data_pack(int lch, int enable);
-extern void omap_set_dma_dest_burst_mode(int lch,
-                                        enum omap_dma_burst_mode burst_mode);
-
-extern void omap_set_dma_params(int lch,
-                               struct omap_dma_channel_params *params);
-
-extern void omap_dma_link_lch(int lch_head, int lch_queue);
-extern void omap_dma_unlink_lch(int lch_head, int lch_queue);
-
-extern int omap_set_dma_callback(int lch,
-                       void (*callback)(int lch, u16 ch_status, void *data),
-                       void *data);
-extern dma_addr_t omap_get_dma_src_pos(int lch);
-extern dma_addr_t omap_get_dma_dst_pos(int lch);
-extern void omap_clear_dma(int lch);
-extern int omap_get_dma_active_status(int lch);
-extern int omap_dma_running(void);
-extern void omap_dma_set_global_params(int arb_rate, int max_fifo_depth,
-                                      int tparams);
-extern int omap_dma_set_prio_lch(int lch, unsigned char read_prio,
-                                unsigned char write_prio);
-extern void omap_set_dma_dst_endian_type(int lch, enum end_type etype);
-extern void omap_set_dma_src_endian_type(int lch, enum end_type etype);
-extern int omap_get_dma_index(int lch, int *ei, int *fi);
-
-void omap_dma_global_context_save(void);
-void omap_dma_global_context_restore(void);
-
-extern void omap_dma_disable_irq(int lch);
-
-/* Chaining APIs */
-#ifndef CONFIG_ARCH_OMAP1
-extern int omap_request_dma_chain(int dev_id, const char *dev_name,
-                                 void (*callback) (int lch, u16 ch_status,
-                                                   void *data),
-                                 int *chain_id, int no_of_chans,
-                                 int chain_mode,
-                                 struct omap_dma_channel_params params);
-extern int omap_free_dma_chain(int chain_id);
-extern int omap_dma_chain_a_transfer(int chain_id, int src_start,
-                                    int dest_start, int elem_count,
-                                    int frame_count, void *callbk_data);
-extern int omap_start_dma_chain_transfers(int chain_id);
-extern int omap_stop_dma_chain_transfers(int chain_id);
-extern int omap_get_dma_chain_index(int chain_id, int *ei, int *fi);
-extern int omap_get_dma_chain_dst_pos(int chain_id);
-extern int omap_get_dma_chain_src_pos(int chain_id);
-
-extern int omap_modify_dma_chain_params(int chain_id,
-                                       struct omap_dma_channel_params params);
-extern int omap_dma_chain_status(int chain_id);
-#endif
-
-#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_FB_OMAP)
-#include <mach/lcd_dma.h>
-#else
-static inline int omap_lcd_dma_running(void)
-{
-       return 0;
-}
-#endif
-
-#endif /* __ASM_ARCH_DMA_H */
diff --git a/arch/arm/plat-omap/include/plat/fpga.h b/arch/arm/plat-omap/include/plat/fpga.h
deleted file mode 100644 (file)
index bd3c632..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * arch/arm/plat-omap/include/mach/fpga.h
- *
- * Interrupt handler for OMAP-1510 FPGA
- *
- * Copyright (C) 2001 RidgeRun, Inc.
- * Author: Greg Lonnon <glonnon@ridgerun.com>
- *
- * Copyright (C) 2002 MontaVista Software, Inc.
- *
- * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6
- * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __ASM_ARCH_OMAP_FPGA_H
-#define __ASM_ARCH_OMAP_FPGA_H
-
-extern void omap1510_fpga_init_irq(void);
-
-#define fpga_read(reg)                 __raw_readb(reg)
-#define fpga_write(val, reg)           __raw_writeb(val, reg)
-
-/*
- * ---------------------------------------------------------------------------
- *  H2/P2 Debug board FPGA
- * ---------------------------------------------------------------------------
- */
-/* maps in the FPGA registers and the ETHR registers */
-#define H2P2_DBG_FPGA_BASE             0xE8000000              /* VA */
-#define H2P2_DBG_FPGA_SIZE             SZ_4K                   /* SIZE */
-#define H2P2_DBG_FPGA_START            0x04000000              /* PA */
-
-#define H2P2_DBG_FPGA_ETHR_START       (H2P2_DBG_FPGA_START + 0x300)
-#define H2P2_DBG_FPGA_FPGA_REV         IOMEM(H2P2_DBG_FPGA_BASE + 0x10)        /* FPGA Revision */
-#define H2P2_DBG_FPGA_BOARD_REV                IOMEM(H2P2_DBG_FPGA_BASE + 0x12)        /* Board Revision */
-#define H2P2_DBG_FPGA_GPIO             IOMEM(H2P2_DBG_FPGA_BASE + 0x14)        /* GPIO outputs */
-#define H2P2_DBG_FPGA_LEDS             IOMEM(H2P2_DBG_FPGA_BASE + 0x16)        /* LEDs outputs */
-#define H2P2_DBG_FPGA_MISC_INPUTS      IOMEM(H2P2_DBG_FPGA_BASE + 0x18)        /* Misc inputs */
-#define H2P2_DBG_FPGA_LAN_STATUS       IOMEM(H2P2_DBG_FPGA_BASE + 0x1A)        /* LAN Status line */
-#define H2P2_DBG_FPGA_LAN_RESET                IOMEM(H2P2_DBG_FPGA_BASE + 0x1C)        /* LAN Reset line */
-
-/* NOTE:  most boards don't have a static mapping for the FPGA ... */
-struct h2p2_dbg_fpga {
-       /* offset 0x00 */
-       u16             smc91x[8];
-       /* offset 0x10 */
-       u16             fpga_rev;
-       u16             board_rev;
-       u16             gpio_outputs;
-       u16             leds;
-       /* offset 0x18 */
-       u16             misc_inputs;
-       u16             lan_status;
-       u16             lan_reset;
-       u16             reserved0;
-       /* offset 0x20 */
-       u16             ps2_data;
-       u16             ps2_ctrl;
-       /* plus also 4 rs232 ports ... */
-};
-
-/* LEDs definition on debug board (16 LEDs, all physically green) */
-#define H2P2_DBG_FPGA_LED_GREEN                (1 << 15)
-#define H2P2_DBG_FPGA_LED_AMBER                (1 << 14)
-#define H2P2_DBG_FPGA_LED_RED          (1 << 13)
-#define H2P2_DBG_FPGA_LED_BLUE         (1 << 12)
-/*  cpu0 load-meter LEDs */
-#define H2P2_DBG_FPGA_LOAD_METER       (1 << 0)        // A bit of fun on our board ...
-#define H2P2_DBG_FPGA_LOAD_METER_SIZE  11
-#define H2P2_DBG_FPGA_LOAD_METER_MASK  ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1)
-
-#define H2P2_DBG_FPGA_P2_LED_TIMER             (1 << 0)
-#define H2P2_DBG_FPGA_P2_LED_IDLE              (1 << 1)
-
-/*
- * ---------------------------------------------------------------------------
- *  OMAP-1510 FPGA
- * ---------------------------------------------------------------------------
- */
-#define OMAP1510_FPGA_BASE             0xE8000000              /* VA */
-#define OMAP1510_FPGA_SIZE             SZ_4K
-#define OMAP1510_FPGA_START            0x08000000              /* PA */
-
-/* Revision */
-#define OMAP1510_FPGA_REV_LOW                  IOMEM(OMAP1510_FPGA_BASE + 0x0)
-#define OMAP1510_FPGA_REV_HIGH                 IOMEM(OMAP1510_FPGA_BASE + 0x1)
-
-#define OMAP1510_FPGA_LCD_PANEL_CONTROL                IOMEM(OMAP1510_FPGA_BASE + 0x2)
-#define OMAP1510_FPGA_LED_DIGIT                        IOMEM(OMAP1510_FPGA_BASE + 0x3)
-#define INNOVATOR_FPGA_HID_SPI                 IOMEM(OMAP1510_FPGA_BASE + 0x4)
-#define OMAP1510_FPGA_POWER                    IOMEM(OMAP1510_FPGA_BASE + 0x5)
-
-/* Interrupt status */
-#define OMAP1510_FPGA_ISR_LO                   IOMEM(OMAP1510_FPGA_BASE + 0x6)
-#define OMAP1510_FPGA_ISR_HI                   IOMEM(OMAP1510_FPGA_BASE + 0x7)
-
-/* Interrupt mask */
-#define OMAP1510_FPGA_IMR_LO                   IOMEM(OMAP1510_FPGA_BASE + 0x8)
-#define OMAP1510_FPGA_IMR_HI                   IOMEM(OMAP1510_FPGA_BASE + 0x9)
-
-/* Reset registers */
-#define OMAP1510_FPGA_HOST_RESET               IOMEM(OMAP1510_FPGA_BASE + 0xa)
-#define OMAP1510_FPGA_RST                      IOMEM(OMAP1510_FPGA_BASE + 0xb)
-
-#define OMAP1510_FPGA_AUDIO                    IOMEM(OMAP1510_FPGA_BASE + 0xc)
-#define OMAP1510_FPGA_DIP                      IOMEM(OMAP1510_FPGA_BASE + 0xe)
-#define OMAP1510_FPGA_FPGA_IO                  IOMEM(OMAP1510_FPGA_BASE + 0xf)
-#define OMAP1510_FPGA_UART1                    IOMEM(OMAP1510_FPGA_BASE + 0x14)
-#define OMAP1510_FPGA_UART2                    IOMEM(OMAP1510_FPGA_BASE + 0x15)
-#define OMAP1510_FPGA_OMAP1510_STATUS          IOMEM(OMAP1510_FPGA_BASE + 0x16)
-#define OMAP1510_FPGA_BOARD_REV                        IOMEM(OMAP1510_FPGA_BASE + 0x18)
-#define OMAP1510P1_PPT_DATA                    IOMEM(OMAP1510_FPGA_BASE + 0x100)
-#define OMAP1510P1_PPT_STATUS                  IOMEM(OMAP1510_FPGA_BASE + 0x101)
-#define OMAP1510P1_PPT_CONTROL                 IOMEM(OMAP1510_FPGA_BASE + 0x102)
-
-#define OMAP1510_FPGA_TOUCHSCREEN              IOMEM(OMAP1510_FPGA_BASE + 0x204)
-
-#define INNOVATOR_FPGA_INFO                    IOMEM(OMAP1510_FPGA_BASE + 0x205)
-#define INNOVATOR_FPGA_LCD_BRIGHT_LO           IOMEM(OMAP1510_FPGA_BASE + 0x206)
-#define INNOVATOR_FPGA_LCD_BRIGHT_HI           IOMEM(OMAP1510_FPGA_BASE + 0x207)
-#define INNOVATOR_FPGA_LED_GRN_LO              IOMEM(OMAP1510_FPGA_BASE + 0x208)
-#define INNOVATOR_FPGA_LED_GRN_HI              IOMEM(OMAP1510_FPGA_BASE + 0x209)
-#define INNOVATOR_FPGA_LED_RED_LO              IOMEM(OMAP1510_FPGA_BASE + 0x20a)
-#define INNOVATOR_FPGA_LED_RED_HI              IOMEM(OMAP1510_FPGA_BASE + 0x20b)
-#define INNOVATOR_FPGA_CAM_USB_CONTROL         IOMEM(OMAP1510_FPGA_BASE + 0x20c)
-#define INNOVATOR_FPGA_EXP_CONTROL             IOMEM(OMAP1510_FPGA_BASE + 0x20d)
-#define INNOVATOR_FPGA_ISR2                    IOMEM(OMAP1510_FPGA_BASE + 0x20e)
-#define INNOVATOR_FPGA_IMR2                    IOMEM(OMAP1510_FPGA_BASE + 0x210)
-
-#define OMAP1510_FPGA_ETHR_START               (OMAP1510_FPGA_START + 0x300)
-
-/*
- * Power up Giga UART driver, turn on HID clock.
- * Turn off BT power, since we're not using it and it
- * draws power.
- */
-#define OMAP1510_FPGA_RESET_VALUE              0x42
-
-#define OMAP1510_FPGA_PCR_IF_PD0               (1 << 7)
-#define OMAP1510_FPGA_PCR_COM2_EN              (1 << 6)
-#define OMAP1510_FPGA_PCR_COM1_EN              (1 << 5)
-#define OMAP1510_FPGA_PCR_EXP_PD0              (1 << 4)
-#define OMAP1510_FPGA_PCR_EXP_PD1              (1 << 3)
-#define OMAP1510_FPGA_PCR_48MHZ_CLK            (1 << 2)
-#define OMAP1510_FPGA_PCR_4MHZ_CLK             (1 << 1)
-#define OMAP1510_FPGA_PCR_RSRVD_BIT0           (1 << 0)
-
-/*
- * Innovator/OMAP1510 FPGA HID register bit definitions
- */
-#define OMAP1510_FPGA_HID_SCLK (1<<0)  /* output */
-#define OMAP1510_FPGA_HID_MOSI (1<<1)  /* output */
-#define OMAP1510_FPGA_HID_nSS  (1<<2)  /* output 0/1 chip idle/select */
-#define OMAP1510_FPGA_HID_nHSUS        (1<<3)  /* output 0/1 host active/suspended */
-#define OMAP1510_FPGA_HID_MISO (1<<4)  /* input */
-#define OMAP1510_FPGA_HID_ATN  (1<<5)  /* input  0/1 chip idle/ATN */
-#define OMAP1510_FPGA_HID_rsrvd        (1<<6)
-#define OMAP1510_FPGA_HID_RESETn (1<<7)        /* output - 0/1 USAR reset/run */
-
-/* The FPGA IRQ is cascaded through GPIO_13 */
-#define OMAP1510_INT_FPGA              (IH_GPIO_BASE + 13)
-
-/* IRQ Numbers for interrupts muxed through the FPGA */
-#define OMAP1510_INT_FPGA_ATN          (OMAP_FPGA_IRQ_BASE + 0)
-#define OMAP1510_INT_FPGA_ACK          (OMAP_FPGA_IRQ_BASE + 1)
-#define OMAP1510_INT_FPGA2             (OMAP_FPGA_IRQ_BASE + 2)
-#define OMAP1510_INT_FPGA3             (OMAP_FPGA_IRQ_BASE + 3)
-#define OMAP1510_INT_FPGA4             (OMAP_FPGA_IRQ_BASE + 4)
-#define OMAP1510_INT_FPGA5             (OMAP_FPGA_IRQ_BASE + 5)
-#define OMAP1510_INT_FPGA6             (OMAP_FPGA_IRQ_BASE + 6)
-#define OMAP1510_INT_FPGA7             (OMAP_FPGA_IRQ_BASE + 7)
-#define OMAP1510_INT_FPGA8             (OMAP_FPGA_IRQ_BASE + 8)
-#define OMAP1510_INT_FPGA9             (OMAP_FPGA_IRQ_BASE + 9)
-#define OMAP1510_INT_FPGA10            (OMAP_FPGA_IRQ_BASE + 10)
-#define OMAP1510_INT_FPGA11            (OMAP_FPGA_IRQ_BASE + 11)
-#define OMAP1510_INT_FPGA12            (OMAP_FPGA_IRQ_BASE + 12)
-#define OMAP1510_INT_ETHER             (OMAP_FPGA_IRQ_BASE + 13)
-#define OMAP1510_INT_FPGAUART1         (OMAP_FPGA_IRQ_BASE + 14)
-#define OMAP1510_INT_FPGAUART2         (OMAP_FPGA_IRQ_BASE + 15)
-#define OMAP1510_INT_FPGA_TS           (OMAP_FPGA_IRQ_BASE + 16)
-#define OMAP1510_INT_FPGA17            (OMAP_FPGA_IRQ_BASE + 17)
-#define OMAP1510_INT_FPGA_CAM          (OMAP_FPGA_IRQ_BASE + 18)
-#define OMAP1510_INT_FPGA_RTC_A                (OMAP_FPGA_IRQ_BASE + 19)
-#define OMAP1510_INT_FPGA_RTC_B                (OMAP_FPGA_IRQ_BASE + 20)
-#define OMAP1510_INT_FPGA_CD           (OMAP_FPGA_IRQ_BASE + 21)
-#define OMAP1510_INT_FPGA22            (OMAP_FPGA_IRQ_BASE + 22)
-#define OMAP1510_INT_FPGA23            (OMAP_FPGA_IRQ_BASE + 23)
-
-#endif
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h
deleted file mode 100644 (file)
index 2e6e259..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * General-Purpose Memory Controller for OMAP2
- *
- * Copyright (C) 2005-2006 Nokia Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __OMAP2_GPMC_H
-#define __OMAP2_GPMC_H
-
-/* Maximum Number of Chip Selects */
-#define GPMC_CS_NUM            8
-
-#define GPMC_CS_CONFIG1                0x00
-#define GPMC_CS_CONFIG2                0x04
-#define GPMC_CS_CONFIG3                0x08
-#define GPMC_CS_CONFIG4                0x0c
-#define GPMC_CS_CONFIG5                0x10
-#define GPMC_CS_CONFIG6                0x14
-#define GPMC_CS_CONFIG7                0x18
-#define GPMC_CS_NAND_COMMAND   0x1c
-#define GPMC_CS_NAND_ADDRESS   0x20
-#define GPMC_CS_NAND_DATA      0x24
-
-/* Control Commands */
-#define GPMC_CONFIG_RDY_BSY    0x00000001
-#define GPMC_CONFIG_DEV_SIZE   0x00000002
-#define GPMC_CONFIG_DEV_TYPE   0x00000003
-#define GPMC_SET_IRQ_STATUS    0x00000004
-#define GPMC_CONFIG_WP         0x00000005
-
-#define GPMC_GET_IRQ_STATUS    0x00000006
-#define GPMC_PREFETCH_FIFO_CNT 0x00000007 /* bytes available in FIFO for r/w */
-#define GPMC_PREFETCH_COUNT    0x00000008 /* remaining bytes to be read/write*/
-#define GPMC_STATUS_BUFFER     0x00000009 /* 1: buffer is available to write */
-
-#define GPMC_NAND_COMMAND      0x0000000a
-#define GPMC_NAND_ADDRESS      0x0000000b
-#define GPMC_NAND_DATA         0x0000000c
-
-#define GPMC_ENABLE_IRQ                0x0000000d
-
-/* ECC commands */
-#define GPMC_ECC_READ          0 /* Reset Hardware ECC for read */
-#define GPMC_ECC_WRITE         1 /* Reset Hardware ECC for write */
-#define GPMC_ECC_READSYN       2 /* Reset before syndrom is read back */
-
-#define GPMC_CONFIG1_WRAPBURST_SUPP     (1 << 31)
-#define GPMC_CONFIG1_READMULTIPLE_SUPP  (1 << 30)
-#define GPMC_CONFIG1_READTYPE_ASYNC     (0 << 29)
-#define GPMC_CONFIG1_READTYPE_SYNC      (1 << 29)
-#define GPMC_CONFIG1_WRITEMULTIPLE_SUPP (1 << 28)
-#define GPMC_CONFIG1_WRITETYPE_ASYNC    (0 << 27)
-#define GPMC_CONFIG1_WRITETYPE_SYNC     (1 << 27)
-#define GPMC_CONFIG1_CLKACTIVATIONTIME(val) ((val & 3) << 25)
-#define GPMC_CONFIG1_PAGE_LEN(val)      ((val & 3) << 23)
-#define GPMC_CONFIG1_WAIT_READ_MON      (1 << 22)
-#define GPMC_CONFIG1_WAIT_WRITE_MON     (1 << 21)
-#define GPMC_CONFIG1_WAIT_MON_IIME(val) ((val & 3) << 18)
-#define GPMC_CONFIG1_WAIT_PIN_SEL(val)  ((val & 3) << 16)
-#define GPMC_CONFIG1_DEVICESIZE(val)    ((val & 3) << 12)
-#define GPMC_CONFIG1_DEVICESIZE_16      GPMC_CONFIG1_DEVICESIZE(1)
-#define GPMC_CONFIG1_DEVICETYPE(val)    ((val & 3) << 10)
-#define GPMC_CONFIG1_DEVICETYPE_NOR     GPMC_CONFIG1_DEVICETYPE(0)
-#define GPMC_CONFIG1_MUXADDDATA         (1 << 9)
-#define GPMC_CONFIG1_TIME_PARA_GRAN     (1 << 4)
-#define GPMC_CONFIG1_FCLK_DIV(val)      (val & 3)
-#define GPMC_CONFIG1_FCLK_DIV2          (GPMC_CONFIG1_FCLK_DIV(1))
-#define GPMC_CONFIG1_FCLK_DIV3          (GPMC_CONFIG1_FCLK_DIV(2))
-#define GPMC_CONFIG1_FCLK_DIV4          (GPMC_CONFIG1_FCLK_DIV(3))
-#define GPMC_CONFIG7_CSVALID           (1 << 6)
-
-#define GPMC_DEVICETYPE_NOR            0
-#define GPMC_DEVICETYPE_NAND           2
-#define GPMC_CONFIG_WRITEPROTECT       0x00000010
-#define GPMC_STATUS_BUFF_EMPTY         0x00000001
-#define WR_RD_PIN_MONITORING           0x00600000
-#define GPMC_PREFETCH_STATUS_FIFO_CNT(val)     ((val >> 24) & 0x7F)
-#define GPMC_PREFETCH_STATUS_COUNT(val)        (val & 0x00003fff)
-#define GPMC_IRQ_FIFOEVENTENABLE       0x01
-#define GPMC_IRQ_COUNT_EVENT           0x02
-
-#define PREFETCH_FIFOTHRESHOLD_MAX     0x40
-#define PREFETCH_FIFOTHRESHOLD(val)    ((val) << 8)
-
-enum omap_ecc {
-               /* 1-bit ecc: stored at end of spare area */
-       OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */
-       OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */
-               /* 1-bit ecc: stored at beginning of spare area as romcode */
-       OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */
-       OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */
-       OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */
-};
-
-/*
- * Note that all values in this struct are in nanoseconds except sync_clk
- * (which is in picoseconds), while the register values are in gpmc_fck cycles.
- */
-struct gpmc_timings {
-       /* Minimum clock period for synchronous mode (in picoseconds) */
-       u32 sync_clk;
-
-       /* Chip-select signal timings corresponding to GPMC_CS_CONFIG2 */
-       u16 cs_on;              /* Assertion time */
-       u16 cs_rd_off;          /* Read deassertion time */
-       u16 cs_wr_off;          /* Write deassertion time */
-
-       /* ADV signal timings corresponding to GPMC_CONFIG3 */
-       u16 adv_on;             /* Assertion time */
-       u16 adv_rd_off;         /* Read deassertion time */
-       u16 adv_wr_off;         /* Write deassertion time */
-
-       /* WE signals timings corresponding to GPMC_CONFIG4 */
-       u16 we_on;              /* WE assertion time */
-       u16 we_off;             /* WE deassertion time */
-
-       /* OE signals timings corresponding to GPMC_CONFIG4 */
-       u16 oe_on;              /* OE assertion time */
-       u16 oe_off;             /* OE deassertion time */
-
-       /* Access time and cycle time timings corresponding to GPMC_CONFIG5 */
-       u16 page_burst_access;  /* Multiple access word delay */
-       u16 access;             /* Start-cycle to first data valid delay */
-       u16 rd_cycle;           /* Total read cycle time */
-       u16 wr_cycle;           /* Total write cycle time */
-
-       /* The following are only on OMAP3430 */
-       u16 wr_access;          /* WRACCESSTIME */
-       u16 wr_data_mux_bus;    /* WRDATAONADMUXBUS */
-};
-
-struct gpmc_nand_regs {
-       void __iomem    *gpmc_status;
-       void __iomem    *gpmc_nand_command;
-       void __iomem    *gpmc_nand_address;
-       void __iomem    *gpmc_nand_data;
-       void __iomem    *gpmc_prefetch_config1;
-       void __iomem    *gpmc_prefetch_config2;
-       void __iomem    *gpmc_prefetch_control;
-       void __iomem    *gpmc_prefetch_status;
-       void __iomem    *gpmc_ecc_config;
-       void __iomem    *gpmc_ecc_control;
-       void __iomem    *gpmc_ecc_size_config;
-       void __iomem    *gpmc_ecc1_result;
-       void __iomem    *gpmc_bch_result0;
-};
-
-extern void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs);
-extern int gpmc_get_client_irq(unsigned irq_config);
-
-extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns);
-extern unsigned int gpmc_ps_to_ticks(unsigned int time_ps);
-extern unsigned int gpmc_ticks_to_ns(unsigned int ticks);
-extern unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns);
-extern unsigned long gpmc_get_fclk_period(void);
-
-extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
-extern u32 gpmc_cs_read_reg(int cs, int idx);
-extern int gpmc_cs_calc_divider(int cs, unsigned int sync_clk);
-extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t);
-extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
-extern void gpmc_cs_free(int cs);
-extern int gpmc_cs_set_reserved(int cs, int reserved);
-extern int gpmc_cs_reserved(int cs);
-extern int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode,
-                                       unsigned int u32_count, int is_write);
-extern int gpmc_prefetch_reset(int cs);
-extern void omap3_gpmc_save_context(void);
-extern void omap3_gpmc_restore_context(void);
-extern int gpmc_read_status(int cmd);
-extern int gpmc_cs_configure(int cs, int cmd, int wval);
-extern int gpmc_nand_read(int cs, int cmd);
-extern int gpmc_nand_write(int cs, int cmd, int wval);
-
-int gpmc_enable_hwecc(int cs, int mode, int dev_width, int ecc_size);
-int gpmc_calculate_ecc(int cs, const u_char *dat, u_char *ecc_code);
-
-#ifdef CONFIG_ARCH_OMAP3
-int gpmc_init_hwecc_bch(int cs, int nsectors, int nerrors);
-int gpmc_enable_hwecc_bch(int cs, int mode, int dev_width, int nsectors,
-                         int nerrors);
-int gpmc_calculate_ecc_bch4(int cs, const u_char *dat, u_char *ecc);
-int gpmc_calculate_ecc_bch8(int cs, const u_char *dat, u_char *ecc);
-#endif /* CONFIG_ARCH_OMAP3 */
-
-#endif
diff --git a/arch/arm/plat-omap/include/plat/i2c.h b/arch/arm/plat-omap/include/plat/i2c.h
deleted file mode 100644 (file)
index 7c22b9e..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Helper module for board specific I2C bus registration
- *
- * Copyright (C) 2009 Nokia Corporation.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-#ifndef __ASM__ARCH_OMAP_I2C_H
-#define __ASM__ARCH_OMAP_I2C_H
-
-#include <linux/i2c.h>
-#include <linux/i2c-omap.h>
-
-#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
-extern int omap_register_i2c_bus(int bus_id, u32 clkrate,
-                                struct i2c_board_info const *info,
-                                unsigned len);
-#else
-static inline int omap_register_i2c_bus(int bus_id, u32 clkrate,
-                                struct i2c_board_info const *info,
-                                unsigned len)
-{
-       return 0;
-}
-#endif
-
-/**
- * i2c_dev_attr - OMAP I2C controller device attributes for omap_hwmod
- * @fifo_depth: total controller FIFO size (in bytes)
- * @flags: differences in hardware support capability
- *
- * @fifo_depth represents what exists on the hardware, not what is
- * actually configured at runtime by the device driver.
- */
-struct omap_i2c_dev_attr {
-       u8      fifo_depth;
-       u32     flags;
-};
-
-void __init omap1_i2c_mux_pins(int bus_id);
-void __init omap2_i2c_mux_pins(int bus_id);
-
-struct omap_hwmod;
-int omap_i2c_reset(struct omap_hwmod *oh);
-
-#endif /* __ASM__ARCH_OMAP_I2C_H */
diff --git a/arch/arm/plat-omap/include/plat/led.h b/arch/arm/plat-omap/include/plat/led.h
deleted file mode 100644 (file)
index 25e451e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- *  arch/arm/plat-omap/include/mach/led.h
- *
- *  Copyright (C) 2006 Samsung Electronics
- *  Kyungmin Park <kyungmin.park@samsung.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#ifndef ASMARM_ARCH_LED_H
-#define ASMARM_ARCH_LED_H
-
-struct omap_led_config {
-       struct led_classdev     cdev;
-       s16                     gpio;
-};
-
-struct omap_led_platform_data {
-       s16                     nr_leds;
-       struct omap_led_config  *leds;
-};
-
-#endif
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
deleted file mode 100644 (file)
index 8b4e4f2..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * MMC definitions for OMAP2
- *
- * Copyright (C) 2006 Nokia Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __OMAP2_MMC_H
-#define __OMAP2_MMC_H
-
-#include <linux/types.h>
-#include <linux/device.h>
-#include <linux/mmc/host.h>
-
-#include <plat/omap_hwmod.h>
-
-#define OMAP15XX_NR_MMC                1
-#define OMAP16XX_NR_MMC                2
-#define OMAP1_MMC_SIZE         0x080
-#define OMAP1_MMC1_BASE                0xfffb7800
-#define OMAP1_MMC2_BASE                0xfffb7c00      /* omap16xx only */
-
-#define OMAP24XX_NR_MMC                2
-#define OMAP2420_MMC_SIZE      OMAP1_MMC_SIZE
-#define OMAP2_MMC1_BASE                0x4809c000
-
-#define OMAP4_MMC_REG_OFFSET   0x100
-
-#define OMAP_MMC_MAX_SLOTS     2
-
-/*
- * struct omap_mmc_dev_attr.flags possibilities
- *
- * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can
- *    operate with either 1.8Vdc or 3.0Vdc card voltages; this flag
- *    should be set if this is the case.  See for example Section 22.5.3
- *    "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia
- *    Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R).
- *
- * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers
- *    don't work correctly on some MMC controller instances on some
- *    OMAP3 SoCs; this flag should be set if this is the case.  See
- *    for example Advisory 2.1.1.128 "MMC: Multiple Block Read
- *    Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_
- *    Revision F (October 2010) (SPRZ278F).
- */
-#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT          BIT(0)
-#define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ      BIT(1)
-
-struct omap_mmc_dev_attr {
-       u8 flags;
-};
-
-struct omap_mmc_platform_data {
-       /* back-link to device */
-       struct device *dev;
-
-       /* number of slots per controller */
-       unsigned nr_slots:2;
-
-       /* set if your board has components or wiring that limits the
-        * maximum frequency on the MMC bus */
-       unsigned int max_freq;
-
-       /* switch the bus to a new slot */
-       int (*switch_slot)(struct device *dev, int slot);
-       /* initialize board-specific MMC functionality, can be NULL if
-        * not supported */
-       int (*init)(struct device *dev);
-       void (*cleanup)(struct device *dev);
-       void (*shutdown)(struct device *dev);
-
-       /* To handle board related suspend/resume functionality for MMC */
-       int (*suspend)(struct device *dev, int slot);
-       int (*resume)(struct device *dev, int slot);
-
-       /* Return context loss count due to PM states changing */
-       int (*get_context_loss_count)(struct device *dev);
-
-       /* Integrating attributes from the omap_hwmod layer */
-       u8 controller_flags;
-
-       /* Register offset deviation */
-       u16 reg_offset;
-
-       struct omap_mmc_slot_data {
-
-               /*
-                * 4/8 wires and any additional host capabilities
-                * need to OR'd all capabilities (ref. linux/mmc/host.h)
-                */
-               u8  wires;      /* Used for the MMC driver on omap1 and 2420 */
-               u32 caps;       /* Used for the MMC driver on 2430 and later */
-               u32 pm_caps;    /* PM capabilities of the mmc */
-
-               /*
-                * nomux means "standard" muxing is wrong on this board, and
-                * that board-specific code handled it before common init logic.
-                */
-               unsigned nomux:1;
-
-               /* switch pin can be for card detect (default) or card cover */
-               unsigned cover:1;
-
-               /* use the internal clock */
-               unsigned internal_clock:1;
-
-               /* nonremovable e.g. eMMC */
-               unsigned nonremovable:1;
-
-               /* Try to sleep or power off when possible */
-               unsigned power_saving:1;
-
-               /* If using power_saving and the MMC power is not to go off */
-               unsigned no_off:1;
-
-               /* eMMC does not handle power off when not in sleep state */
-               unsigned no_regulator_off_init:1;
-
-               /* Regulator off remapped to sleep */
-               unsigned vcc_aux_disable_is_sleep:1;
-
-               /* we can put the features above into this variable */
-#define HSMMC_HAS_PBIAS                (1 << 0)
-#define HSMMC_HAS_UPDATED_RESET        (1 << 1)
-               unsigned features;
-
-               int switch_pin;                 /* gpio (card detect) */
-               int gpio_wp;                    /* gpio (write protect) */
-
-               int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
-               int (*set_power)(struct device *dev, int slot,
-                                int power_on, int vdd);
-               int (*get_ro)(struct device *dev, int slot);
-               void (*remux)(struct device *dev, int slot, int power_on);
-               /* Call back before enabling / disabling regulators */
-               void (*before_set_reg)(struct device *dev, int slot,
-                                      int power_on, int vdd);
-               /* Call back after enabling / disabling regulators */
-               void (*after_set_reg)(struct device *dev, int slot,
-                                     int power_on, int vdd);
-               /* if we have special card, init it using this callback */
-               void (*init_card)(struct mmc_card *card);
-
-               /* return MMC cover switch state, can be NULL if not supported.
-                *
-                * possible return values:
-                *   0 - closed
-                *   1 - open
-                */
-               int (*get_cover_state)(struct device *dev, int slot);
-
-               const char *name;
-               u32 ocr_mask;
-
-               /* Card detection IRQs */
-               int card_detect_irq;
-               int (*card_detect)(struct device *dev, int slot);
-
-               unsigned int ban_openended:1;
-
-       } slots[OMAP_MMC_MAX_SLOTS];
-};
-
-/* called from board-specific card detection service routine */
-extern void omap_mmc_notify_cover_event(struct device *dev, int slot,
-                                       int is_closed);
-
-#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
-void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
-                               int nr_controllers);
-void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data);
-#else
-static inline void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
-                               int nr_controllers)
-{
-}
-static inline void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
-{
-}
-#endif
-
-extern int omap_msdi_reset(struct omap_hwmod *oh);
-
-#endif
diff --git a/arch/arm/plat-omap/include/plat/multi.h b/arch/arm/plat-omap/include/plat/multi.h
deleted file mode 100644 (file)
index 324d31b..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Support for compiling in multiple OMAP processors
- *
- * Copyright (C) 2010 Nokia Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#ifndef __PLAT_OMAP_MULTI_H
-#define __PLAT_OMAP_MULTI_H
-
-/*
- * Test if multicore OMAP support is needed
- */
-#undef MULTI_OMAP1
-#undef MULTI_OMAP2
-#undef OMAP_NAME
-
-#ifdef CONFIG_ARCH_OMAP730
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP1
-#  define MULTI_OMAP1
-# else
-#  define OMAP_NAME omap730
-# endif
-#endif
-#ifdef CONFIG_ARCH_OMAP850
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP1
-#  define MULTI_OMAP1
-# else
-#  define OMAP_NAME omap850
-# endif
-#endif
-#ifdef CONFIG_ARCH_OMAP15XX
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP1
-#  define MULTI_OMAP1
-# else
-#  define OMAP_NAME omap1510
-# endif
-#endif
-#ifdef CONFIG_ARCH_OMAP16XX
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP1
-#  define MULTI_OMAP1
-# else
-#  define OMAP_NAME omap16xx
-# endif
-#endif
-#ifdef CONFIG_ARCH_OMAP2PLUS
-# if (defined(OMAP_NAME) || defined(MULTI_OMAP1))
-#  error "OMAP1 and OMAP2PLUS can't be selected at the same time"
-# endif
-#endif
-#ifdef CONFIG_SOC_OMAP2420
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP2
-#  define MULTI_OMAP2
-# else
-#  define OMAP_NAME omap2420
-# endif
-#endif
-#ifdef CONFIG_SOC_OMAP2430
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP2
-#  define MULTI_OMAP2
-# else
-#  define OMAP_NAME omap2430
-# endif
-#endif
-#ifdef CONFIG_ARCH_OMAP3
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP2
-#  define MULTI_OMAP2
-# else
-#  define OMAP_NAME omap3
-# endif
-#endif
-#ifdef CONFIG_ARCH_OMAP4
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP2
-#  define MULTI_OMAP2
-# else
-#  define OMAP_NAME omap4
-# endif
-#endif
-
-#ifdef CONFIG_SOC_OMAP5
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP2
-#  define MULTI_OMAP2
-# else
-#  define OMAP_NAME omap5
-# endif
-#endif
-
-#ifdef CONFIG_SOC_AM33XX
-# ifdef OMAP_NAME
-#  undef  MULTI_OMAP2
-#  define MULTI_OMAP2
-# else
-#  define OMAP_NAME am33xx
-# endif
-#endif
-
-#endif /* __PLAT_OMAP_MULTI_H */
diff --git a/arch/arm/plat-omap/include/plat/omap-pm.h b/arch/arm/plat-omap/include/plat/omap-pm.h
deleted file mode 100644 (file)
index 67faa7b..0000000
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * omap-pm.h - OMAP power management interface
- *
- * Copyright (C) 2008-2010 Texas Instruments, Inc.
- * Copyright (C) 2008-2010 Nokia Corporation
- * Paul Walmsley
- *
- * Interface developed by (in alphabetical order): Karthik Dasu, Jouni
- * Högander, Tony Lindgren, Rajendra Nayak, Sakari Poussa,
- * Veeramanikandan Raju, Anand Sawant, Igor Stoppa, Paul Walmsley,
- * Richard Woodruff
- */
-
-#ifndef ASM_ARM_ARCH_OMAP_OMAP_PM_H
-#define ASM_ARM_ARCH_OMAP_OMAP_PM_H
-
-#include <linux/device.h>
-#include <linux/cpufreq.h>
-#include <linux/clk.h>
-#include <linux/opp.h>
-
-/*
- * agent_id values for use with omap_pm_set_min_bus_tput():
- *
- * OCP_INITIATOR_AGENT is only valid for devices that can act as
- * initiators -- it represents the device's L3 interconnect
- * connection.  OCP_TARGET_AGENT represents the device's L4
- * interconnect connection.
- */
-#define OCP_TARGET_AGENT               1
-#define OCP_INITIATOR_AGENT            2
-
-/**
- * omap_pm_if_early_init - OMAP PM init code called before clock fw init
- * @mpu_opp_table: array ptr to struct omap_opp for MPU
- * @dsp_opp_table: array ptr to struct omap_opp for DSP
- * @l3_opp_table : array ptr to struct omap_opp for CORE
- *
- * Initialize anything that must be configured before the clock
- * framework starts.  The "_if_" is to avoid name collisions with the
- * PM idle-loop code.
- */
-int __init omap_pm_if_early_init(void);
-
-/**
- * omap_pm_if_init - OMAP PM init code called after clock fw init
- *
- * The main initialization code.  OPP tables are passed in here.  The
- * "_if_" is to avoid name collisions with the PM idle-loop code.
- */
-int __init omap_pm_if_init(void);
-
-/**
- * omap_pm_if_exit - OMAP PM exit code
- *
- * Exit code; currently unused.  The "_if_" is to avoid name
- * collisions with the PM idle-loop code.
- */
-void omap_pm_if_exit(void);
-
-/*
- * Device-driver-originated constraints (via board-*.c files, platform_data)
- */
-
-
-/**
- * omap_pm_set_max_mpu_wakeup_lat - set the maximum MPU wakeup latency
- * @dev: struct device * requesting the constraint
- * @t: maximum MPU wakeup latency in microseconds
- *
- * Request that the maximum interrupt latency for the MPU to be no
- * greater than @t microseconds. "Interrupt latency" in this case is
- * defined as the elapsed time from the occurrence of a hardware or
- * timer interrupt to the time when the device driver's interrupt
- * service routine has been entered by the MPU.
- *
- * It is intended that underlying PM code will use this information to
- * determine what power state to put the MPU powerdomain into, and
- * possibly the CORE powerdomain as well, since interrupt handling
- * code currently runs from SDRAM.  Advanced PM or board*.c code may
- * also configure interrupt controller priorities, OCP bus priorities,
- * CPU speed(s), etc.
- *
- * This function will not affect device wakeup latency, e.g., time
- * elapsed from when a device driver enables a hardware device with
- * clk_enable(), to when the device is ready for register access or
- * other use.  To control this device wakeup latency, use
- * omap_pm_set_max_dev_wakeup_lat()
- *
- * Multiple calls to omap_pm_set_max_mpu_wakeup_lat() will replace the
- * previous t value.  To remove the latency target for the MPU, call
- * with t = -1.
- *
- * XXX This constraint will be deprecated soon in favor of the more
- * general omap_pm_set_max_dev_wakeup_lat()
- *
- * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
- * is not satisfiable, or 0 upon success.
- */
-int omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t);
-
-
-/**
- * omap_pm_set_min_bus_tput - set minimum bus throughput needed by device
- * @dev: struct device * requesting the constraint
- * @tbus_id: interconnect to operate on (OCP_{INITIATOR,TARGET}_AGENT)
- * @r: minimum throughput (in KiB/s)
- *
- * Request that the minimum data throughput on the OCP interconnect
- * attached to device @dev interconnect agent @tbus_id be no less
- * than @r KiB/s.
- *
- * It is expected that the OMAP PM or bus code will use this
- * information to set the interconnect clock to run at the lowest
- * possible speed that satisfies all current system users.  The PM or
- * bus code will adjust the estimate based on its model of the bus, so
- * device driver authors should attempt to specify an accurate
- * quantity for their device use case, and let the PM or bus code
- * overestimate the numbers as necessary to handle request/response
- * latency, other competing users on the system, etc.  On OMAP2/3, if
- * a driver requests a minimum L4 interconnect speed constraint, the
- * code will also need to add an minimum L3 interconnect speed
- * constraint,
- *
- * Multiple calls to omap_pm_set_min_bus_tput() will replace the
- * previous rate value for this device.  To remove the interconnect
- * throughput restriction for this device, call with r = 0.
- *
- * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
- * is not satisfiable, or 0 upon success.
- */
-int omap_pm_set_min_bus_tput(struct device *dev, u8 agent_id, unsigned long r);
-
-
-/**
- * omap_pm_set_max_dev_wakeup_lat - set the maximum device enable latency
- * @req_dev: struct device * requesting the constraint, or NULL if none
- * @dev: struct device * to set the constraint one
- * @t: maximum device wakeup latency in microseconds
- *
- * Request that the maximum amount of time necessary for a device @dev
- * to become accessible after its clocks are enabled should be no
- * greater than @t microseconds.  Specifically, this represents the
- * time from when a device driver enables device clocks with
- * clk_enable(), to when the register reads and writes on the device
- * will succeed.  This function should be called before clk_disable()
- * is called, since the power state transition decision may be made
- * during clk_disable().
- *
- * It is intended that underlying PM code will use this information to
- * determine what power state to put the powerdomain enclosing this
- * device into.
- *
- * Multiple calls to omap_pm_set_max_dev_wakeup_lat() will replace the
- * previous wakeup latency values for this device.  To remove the
- * wakeup latency restriction for this device, call with t = -1.
- *
- * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
- * is not satisfiable, or 0 upon success.
- */
-int omap_pm_set_max_dev_wakeup_lat(struct device *req_dev, struct device *dev,
-                                  long t);
-
-
-/**
- * omap_pm_set_max_sdma_lat - set the maximum system DMA transfer start latency
- * @dev: struct device *
- * @t: maximum DMA transfer start latency in microseconds
- *
- * Request that the maximum system DMA transfer start latency for this
- * device 'dev' should be no greater than 't' microseconds.  "DMA
- * transfer start latency" here is defined as the elapsed time from
- * when a device (e.g., McBSP) requests that a system DMA transfer
- * start or continue, to the time at which data starts to flow into
- * that device from the system DMA controller.
- *
- * It is intended that underlying PM code will use this information to
- * determine what power state to put the CORE powerdomain into.
- *
- * Since system DMA transfers may not involve the MPU, this function
- * will not affect MPU wakeup latency.  Use set_max_cpu_lat() to do
- * so.  Similarly, this function will not affect device wakeup latency
- * -- use set_max_dev_wakeup_lat() to affect that.
- *
- * Multiple calls to set_max_sdma_lat() will replace the previous t
- * value for this device.  To remove the maximum DMA latency for this
- * device, call with t = -1.
- *
- * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
- * is not satisfiable, or 0 upon success.
- */
-int omap_pm_set_max_sdma_lat(struct device *dev, long t);
-
-
-/**
- * omap_pm_set_min_clk_rate - set minimum clock rate requested by @dev
- * @dev: struct device * requesting the constraint
- * @clk: struct clk * to set the minimum rate constraint on
- * @r: minimum rate in Hz
- *
- * Request that the minimum clock rate on the device @dev's clk @clk
- * be no less than @r Hz.
- *
- * It is expected that the OMAP PM code will use this information to
- * find an OPP or clock setting that will satisfy this clock rate
- * constraint, along with any other applicable system constraints on
- * the clock rate or corresponding voltage, etc.
- *
- * omap_pm_set_min_clk_rate() differs from the clock code's
- * clk_set_rate() in that it considers other constraints before taking
- * any hardware action, and may change a system OPP rather than just a
- * clock rate.  clk_set_rate() is intended to be a low-level
- * interface.
- *
- * omap_pm_set_min_clk_rate() is easily open to abuse.  A better API
- * would be something like "omap_pm_set_min_dev_performance()";
- * however, there is no easily-generalizable concept of performance
- * that applies to all devices.  Only a device (and possibly the
- * device subsystem) has both the subsystem-specific knowledge, and
- * the hardware IP block-specific knowledge, to translate a constraint
- * on "touchscreen sampling accuracy" or "number of pixels or polygons
- * rendered per second" to a clock rate.  This translation can be
- * dependent on the hardware IP block's revision, or firmware version,
- * and the driver is the only code on the system that has this
- * information and can know how to translate that into a clock rate.
- *
- * The intended use-case for this function is for userspace or other
- * kernel code to communicate a particular performance requirement to
- * a subsystem; then for the subsystem to communicate that requirement
- * to something that is meaningful to the device driver; then for the
- * device driver to convert that requirement to a clock rate, and to
- * then call omap_pm_set_min_clk_rate().
- *
- * Users of this function (such as device drivers) should not simply
- * call this function with some high clock rate to ensure "high
- * performance."  Rather, the device driver should take a performance
- * constraint from its subsystem, such as "render at least X polygons
- * per second," and use some formula or table to convert that into a
- * clock rate constraint given the hardware type and hardware
- * revision.  Device drivers or subsystems should not assume that they
- * know how to make a power/performance tradeoff - some device use
- * cases may tolerate a lower-fidelity device function for lower power
- * consumption; others may demand a higher-fidelity device function,
- * no matter what the power consumption.
- *
- * Multiple calls to omap_pm_set_min_clk_rate() will replace the
- * previous rate value for the device @dev.  To remove the minimum clock
- * rate constraint for the device, call with r = 0.
- *
- * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
- * is not satisfiable, or 0 upon success.
- */
-int omap_pm_set_min_clk_rate(struct device *dev, struct clk *c, long r);
-
-/*
- * DSP Bridge-specific constraints
- */
-
-/**
- * omap_pm_dsp_get_opp_table - get OPP->DSP clock frequency table
- *
- * Intended for use by DSPBridge.  Returns an array of OPP->DSP clock
- * frequency entries.  The final item in the array should have .rate =
- * .opp_id = 0.
- */
-const struct omap_opp *omap_pm_dsp_get_opp_table(void);
-
-/**
- * omap_pm_dsp_set_min_opp - receive desired OPP target ID from DSP Bridge
- * @opp_id: target DSP OPP ID
- *
- * Set a minimum OPP ID for the DSP.  This is intended to be called
- * only from the DSP Bridge MPU-side driver.  Unfortunately, the only
- * information that code receives from the DSP/BIOS load estimator is the
- * target OPP ID; hence, this interface.  No return value.
- */
-void omap_pm_dsp_set_min_opp(u8 opp_id);
-
-/**
- * omap_pm_dsp_get_opp - report the current DSP OPP ID
- *
- * Report the current OPP for the DSP.  Since on OMAP3, the DSP and
- * MPU share a single voltage domain, the OPP ID returned back may
- * represent a higher DSP speed than the OPP requested via
- * omap_pm_dsp_set_min_opp().
- *
- * Returns the current VDD1 OPP ID, or 0 upon error.
- */
-u8 omap_pm_dsp_get_opp(void);
-
-
-/*
- * CPUFreq-originated constraint
- *
- * In the future, this should be handled by custom OPP clocktype
- * functions.
- */
-
-/**
- * omap_pm_cpu_get_freq_table - return a cpufreq_frequency_table array ptr
- *
- * Provide a frequency table usable by CPUFreq for the current chip/board.
- * Returns a pointer to a struct cpufreq_frequency_table array or NULL
- * upon error.
- */
-struct cpufreq_frequency_table **omap_pm_cpu_get_freq_table(void);
-
-/**
- * omap_pm_cpu_set_freq - set the current minimum MPU frequency
- * @f: MPU frequency in Hz
- *
- * Set the current minimum CPU frequency.  The actual CPU frequency
- * used could end up higher if the DSP requested a higher OPP.
- * Intended to be called by plat-omap/cpu_omap.c:omap_target().  No
- * return value.
- */
-void omap_pm_cpu_set_freq(unsigned long f);
-
-/**
- * omap_pm_cpu_get_freq - report the current CPU frequency
- *
- * Returns the current MPU frequency, or 0 upon error.
- */
-unsigned long omap_pm_cpu_get_freq(void);
-
-
-/*
- * Device context loss tracking
- */
-
-/**
- * omap_pm_get_dev_context_loss_count - return count of times dev has lost ctx
- * @dev: struct device *
- *
- * This function returns the number of times that the device @dev has
- * lost its internal context.  This generally occurs on a powerdomain
- * transition to OFF.  Drivers use this as an optimization to avoid restoring
- * context if the device hasn't lost it.  To use, drivers should initially
- * call this in their context save functions and store the result.  Early in
- * the driver's context restore function, the driver should call this function
- * again, and compare the result to the stored counter.  If they differ, the
- * driver must restore device context.   If the number of context losses
- * exceeds the maximum positive integer, the function will wrap to 0 and
- * continue counting.  Returns the number of context losses for this device,
- * or negative value upon error.
- */
-int omap_pm_get_dev_context_loss_count(struct device *dev);
-
-void omap_pm_enable_off_mode(void);
-void omap_pm_disable_off_mode(void);
-
-#endif
diff --git a/arch/arm/plat-omap/include/plat/omap-secure.h b/arch/arm/plat-omap/include/plat/omap-secure.h
deleted file mode 100644 (file)
index 0e4acd2..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __OMAP_SECURE_H__
-#define __OMAP_SECURE_H__
-
-#include <linux/types.h>
-
-extern int omap_secure_ram_reserve_memblock(void);
-
-#ifdef CONFIG_OMAP4_ERRATA_I688
-extern int omap_barrier_reserve_memblock(void);
-#else
-static inline void omap_barrier_reserve_memblock(void)
-{ }
-#endif
-#endif /* __OMAP_SECURE_H__ */
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
deleted file mode 100644 (file)
index 106f506..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * omap_device headers
- *
- * Copyright (C) 2009 Nokia Corporation
- * Paul Walmsley
- *
- * Developed in collaboration with (alphabetical order): Benoit
- * Cousson, Kevin Hilman, Tony Lindgren, Rajendra Nayak, Vikram
- * Pandita, Sakari Poussa, Anand Sawant, Santosh Shilimkar, Richard
- * Woodruff
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Eventually this type of functionality should either be
- * a) implemented via arch-specific pointers in platform_device
- * or
- * b) implemented as a proper omap_bus/omap_device in Linux, no more
- *    platform_device
- *
- * omap_device differs from omap_hwmod in that it includes external
- * (e.g., board- and system-level) integration details.  omap_hwmod
- * stores hardware data that is invariant for a given OMAP chip.
- *
- * To do:
- * - GPIO integration
- * - regulator integration
- *
- */
-#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H
-#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H
-
-#include <linux/kernel.h>
-#include <linux/platform_device.h>
-
-#include <plat/omap_hwmod.h>
-
-extern struct dev_pm_domain omap_device_pm_domain;
-
-/* omap_device._state values */
-#define OMAP_DEVICE_STATE_UNKNOWN      0
-#define OMAP_DEVICE_STATE_ENABLED      1
-#define OMAP_DEVICE_STATE_IDLE         2
-#define OMAP_DEVICE_STATE_SHUTDOWN     3
-
-/* omap_device.flags values */
-#define OMAP_DEVICE_SUSPENDED BIT(0)
-#define OMAP_DEVICE_NO_IDLE_ON_SUSPEND BIT(1)
-
-/**
- * struct omap_device - omap_device wrapper for platform_devices
- * @pdev: platform_device
- * @hwmods: (one .. many per omap_device)
- * @hwmods_cnt: ARRAY_SIZE() of @hwmods
- * @pm_lats: ptr to an omap_device_pm_latency table
- * @pm_lats_cnt: ARRAY_SIZE() of what is passed to @pm_lats
- * @pm_lat_level: array index of the last odpl entry executed - -1 if never
- * @dev_wakeup_lat: dev wakeup latency in nanoseconds
- * @_dev_wakeup_lat_limit: dev wakeup latency limit in nsec - set by OMAP PM
- * @_state: one of OMAP_DEVICE_STATE_* (see above)
- * @flags: device flags
- * @_driver_status: one of BUS_NOTIFY_*_DRIVER from <linux/device.h>
- *
- * Integrates omap_hwmod data into Linux platform_device.
- *
- * Field names beginning with underscores are for the internal use of
- * the omap_device code.
- *
- */
-struct omap_device {
-       struct platform_device          *pdev;
-       struct omap_hwmod               **hwmods;
-       struct omap_device_pm_latency   *pm_lats;
-       u32                             dev_wakeup_lat;
-       u32                             _dev_wakeup_lat_limit;
-       unsigned long                   _driver_status;
-       u8                              pm_lats_cnt;
-       s8                              pm_lat_level;
-       u8                              hwmods_cnt;
-       u8                              _state;
-       u8                              flags;
-};
-
-/* Device driver interface (call via platform_data fn ptrs) */
-
-int omap_device_enable(struct platform_device *pdev);
-int omap_device_idle(struct platform_device *pdev);
-int omap_device_shutdown(struct platform_device *pdev);
-
-/* Core code interface */
-
-struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
-                                     struct omap_hwmod *oh, void *pdata,
-                                     int pdata_len,
-                                     struct omap_device_pm_latency *pm_lats,
-                                     int pm_lats_cnt, int is_early_device);
-
-struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
-                                        struct omap_hwmod **oh, int oh_cnt,
-                                        void *pdata, int pdata_len,
-                                        struct omap_device_pm_latency *pm_lats,
-                                        int pm_lats_cnt, int is_early_device);
-
-struct omap_device *omap_device_alloc(struct platform_device *pdev,
-                                     struct omap_hwmod **ohs, int oh_cnt,
-                                     struct omap_device_pm_latency *pm_lats,
-                                     int pm_lats_cnt);
-void omap_device_delete(struct omap_device *od);
-int omap_device_register(struct platform_device *pdev);
-
-void __iomem *omap_device_get_rt_va(struct omap_device *od);
-struct device *omap_device_get_by_hwmod_name(const char *oh_name);
-
-/* OMAP PM interface */
-int omap_device_align_pm_lat(struct platform_device *pdev,
-                            u32 new_wakeup_lat_limit);
-struct powerdomain *omap_device_get_pwrdm(struct omap_device *od);
-int omap_device_get_context_loss_count(struct platform_device *pdev);
-
-/* Other */
-
-int omap_device_assert_hardreset(struct platform_device *pdev,
-                                const char *name);
-int omap_device_deassert_hardreset(struct platform_device *pdev,
-                                const char *name);
-int omap_device_idle_hwmods(struct omap_device *od);
-int omap_device_enable_hwmods(struct omap_device *od);
-
-int omap_device_disable_clocks(struct omap_device *od);
-int omap_device_enable_clocks(struct omap_device *od);
-
-/*
- * Entries should be kept in latency order ascending
- *
- * deact_lat is the maximum number of microseconds required to complete
- * deactivate_func() at the device's slowest OPP.
- *
- * act_lat is the maximum number of microseconds required to complete
- * activate_func() at the device's slowest OPP.
- *
- * This will result in some suboptimal power management decisions at fast
- * OPPs, but avoids having to recompute all device power management decisions
- * if the system shifts from a fast OPP to a slow OPP (in order to meet
- * latency requirements).
- *
- * XXX should deactivate_func/activate_func() take platform_device pointers
- * rather than omap_device pointers?
- */
-struct omap_device_pm_latency {
-       u32 deactivate_lat;
-       u32 deactivate_lat_worst;
-       int (*deactivate_func)(struct omap_device *od);
-       u32 activate_lat;
-       u32 activate_lat_worst;
-       int (*activate_func)(struct omap_device *od);
-       u32 flags;
-};
-
-#define OMAP_DEVICE_LATENCY_AUTO_ADJUST BIT(1)
-
-/* Get omap_device pointer from platform_device pointer */
-static inline struct omap_device *to_omap_device(struct platform_device *pdev)
-{
-       return pdev ? pdev->archdata.od : NULL;
-}
-
-static inline
-void omap_device_disable_idle_on_suspend(struct platform_device *pdev)
-{
-       struct omap_device *od = to_omap_device(pdev);
-
-       od->flags |= OMAP_DEVICE_NO_IDLE_ON_SUSPEND;
-}
-
-#endif
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
deleted file mode 100644 (file)
index b3349f7..0000000
+++ /dev/null
@@ -1,676 +0,0 @@
-/*
- * omap_hwmod macros, structures
- *
- * Copyright (C) 2009-2011 Nokia Corporation
- * Copyright (C) 2012 Texas Instruments, Inc.
- * Paul Walmsley
- *
- * Created in collaboration with (alphabetical order): Benoît Cousson,
- * Kevin Hilman, Tony Lindgren, Rajendra Nayak, Vikram Pandita, Sakari
- * Poussa, Anand Sawant, Santosh Shilimkar, Richard Woodruff
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * These headers and macros are used to define OMAP on-chip module
- * data and their integration with other OMAP modules and Linux.
- * Copious documentation and references can also be found in the
- * omap_hwmod code, in arch/arm/mach-omap2/omap_hwmod.c (as of this
- * writing).
- *
- * To do:
- * - add interconnect error log structures
- * - add pinmuxing
- * - init_conn_id_bit (CONNID_BIT_VECTOR)
- * - implement default hwmod SMS/SDRC flags?
- * - move Linux-specific data ("non-ROM data") out
- *
- */
-#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
-#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/list.h>
-#include <linux/ioport.h>
-#include <linux/spinlock.h>
-#include <plat/cpu.h>
-
-struct omap_device;
-
-extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type1;
-extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2;
-extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type3;
-
-/*
- * OCP SYSCONFIG bit shifts/masks TYPE1. These are for IPs compliant
- * with the original PRCM protocol defined for OMAP2420
- */
-#define SYSC_TYPE1_MIDLEMODE_SHIFT     12
-#define SYSC_TYPE1_MIDLEMODE_MASK      (0x3 << SYSC_TYPE1_MIDLEMODE_SHIFT)
-#define SYSC_TYPE1_CLOCKACTIVITY_SHIFT 8
-#define SYSC_TYPE1_CLOCKACTIVITY_MASK  (0x3 << SYSC_TYPE1_CLOCKACTIVITY_SHIFT)
-#define SYSC_TYPE1_SIDLEMODE_SHIFT     3
-#define SYSC_TYPE1_SIDLEMODE_MASK      (0x3 << SYSC_TYPE1_SIDLEMODE_SHIFT)
-#define SYSC_TYPE1_ENAWAKEUP_SHIFT     2
-#define SYSC_TYPE1_ENAWAKEUP_MASK      (1 << SYSC_TYPE1_ENAWAKEUP_SHIFT)
-#define SYSC_TYPE1_SOFTRESET_SHIFT     1
-#define SYSC_TYPE1_SOFTRESET_MASK      (1 << SYSC_TYPE1_SOFTRESET_SHIFT)
-#define SYSC_TYPE1_AUTOIDLE_SHIFT      0
-#define SYSC_TYPE1_AUTOIDLE_MASK       (1 << SYSC_TYPE1_AUTOIDLE_SHIFT)
-
-/*
- * OCP SYSCONFIG bit shifts/masks TYPE2. These are for IPs compliant
- * with the new PRCM protocol defined for new OMAP4 IPs.
- */
-#define SYSC_TYPE2_SOFTRESET_SHIFT     0
-#define SYSC_TYPE2_SOFTRESET_MASK      (1 << SYSC_TYPE2_SOFTRESET_SHIFT)
-#define SYSC_TYPE2_SIDLEMODE_SHIFT     2
-#define SYSC_TYPE2_SIDLEMODE_MASK      (0x3 << SYSC_TYPE2_SIDLEMODE_SHIFT)
-#define SYSC_TYPE2_MIDLEMODE_SHIFT     4
-#define SYSC_TYPE2_MIDLEMODE_MASK      (0x3 << SYSC_TYPE2_MIDLEMODE_SHIFT)
-#define SYSC_TYPE2_DMADISABLE_SHIFT    16
-#define SYSC_TYPE2_DMADISABLE_MASK     (0x1 << SYSC_TYPE2_DMADISABLE_SHIFT)
-
-/*
- * OCP SYSCONFIG bit shifts/masks TYPE3.
- * This is applicable for some IPs present in AM33XX
- */
-#define SYSC_TYPE3_SIDLEMODE_SHIFT     0
-#define SYSC_TYPE3_SIDLEMODE_MASK      (0x3 << SYSC_TYPE3_SIDLEMODE_SHIFT)
-#define SYSC_TYPE3_MIDLEMODE_SHIFT     2
-#define SYSC_TYPE3_MIDLEMODE_MASK      (0x3 << SYSC_TYPE3_MIDLEMODE_SHIFT)
-
-/* OCP SYSSTATUS bit shifts/masks */
-#define SYSS_RESETDONE_SHIFT           0
-#define SYSS_RESETDONE_MASK            (1 << SYSS_RESETDONE_SHIFT)
-
-/* Master standby/slave idle mode flags */
-#define HWMOD_IDLEMODE_FORCE           (1 << 0)
-#define HWMOD_IDLEMODE_NO              (1 << 1)
-#define HWMOD_IDLEMODE_SMART           (1 << 2)
-#define HWMOD_IDLEMODE_SMART_WKUP      (1 << 3)
-
-/* modulemode control type (SW or HW) */
-#define MODULEMODE_HWCTRL              1
-#define MODULEMODE_SWCTRL              2
-
-
-/**
- * struct omap_hwmod_mux_info - hwmod specific mux configuration
- * @pads:              array of omap_device_pad entries
- * @nr_pads:           number of omap_device_pad entries
- *
- * Note that this is currently built during init as needed.
- */
-struct omap_hwmod_mux_info {
-       int                             nr_pads;
-       struct omap_device_pad          *pads;
-       int                             nr_pads_dynamic;
-       struct omap_device_pad          **pads_dynamic;
-       int                             *irqs;
-       bool                            enabled;
-};
-
-/**
- * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod
- * @name: name of the IRQ channel (module local name)
- * @irq: IRQ channel ID (should be non-negative except -1 = terminator)
- *
- * @name should be something short, e.g., "tx" or "rx".  It is for use
- * by platform_get_resource_byname().  It is defined locally to the
- * hwmod.
- */
-struct omap_hwmod_irq_info {
-       const char      *name;
-       s16             irq;
-};
-
-/**
- * struct omap_hwmod_dma_info - DMA channels used by the hwmod
- * @name: name of the DMA channel (module local name)
- * @dma_req: DMA request ID (should be non-negative except -1 = terminator)
- *
- * @name should be something short, e.g., "tx" or "rx".  It is for use
- * by platform_get_resource_byname().  It is defined locally to the
- * hwmod.
- */
-struct omap_hwmod_dma_info {
-       const char      *name;
-       s16             dma_req;
-};
-
-/**
- * struct omap_hwmod_rst_info - IPs reset lines use by hwmod
- * @name: name of the reset line (module local name)
- * @rst_shift: Offset of the reset bit
- * @st_shift: Offset of the reset status bit (OMAP2/3 only)
- *
- * @name should be something short, e.g., "cpu0" or "rst". It is defined
- * locally to the hwmod.
- */
-struct omap_hwmod_rst_info {
-       const char      *name;
-       u8              rst_shift;
-       u8              st_shift;
-};
-
-/**
- * struct omap_hwmod_opt_clk - optional clocks used by this hwmod
- * @role: "sys", "32k", "tv", etc -- for use in clk_get()
- * @clk: opt clock: OMAP clock name
- * @_clk: pointer to the struct clk (filled in at runtime)
- *
- * The module's interface clock and main functional clock should not
- * be added as optional clocks.
- */
-struct omap_hwmod_opt_clk {
-       const char      *role;
-       const char      *clk;
-       struct clk      *_clk;
-};
-
-
-/* omap_hwmod_omap2_firewall.flags bits */
-#define OMAP_FIREWALL_L3               (1 << 0)
-#define OMAP_FIREWALL_L4               (1 << 1)
-
-/**
- * struct omap_hwmod_omap2_firewall - OMAP2/3 device firewall data
- * @l3_perm_bit: bit shift for L3_PM_*_PERMISSION_*
- * @l4_fw_region: L4 firewall region ID
- * @l4_prot_group: L4 protection group ID
- * @flags: (see omap_hwmod_omap2_firewall.flags macros above)
- */
-struct omap_hwmod_omap2_firewall {
-       u8 l3_perm_bit;
-       u8 l4_fw_region;
-       u8 l4_prot_group;
-       u8 flags;
-};
-
-
-/*
- * omap_hwmod_addr_space.flags bits
- *
- * ADDR_MAP_ON_INIT: Map this address space during omap_hwmod init.
- * ADDR_TYPE_RT: Address space contains module register target data.
- */
-#define ADDR_MAP_ON_INIT       (1 << 0)        /* XXX does not belong */
-#define ADDR_TYPE_RT           (1 << 1)
-
-/**
- * struct omap_hwmod_addr_space - address space handled by the hwmod
- * @name: name of the address space
- * @pa_start: starting physical address
- * @pa_end: ending physical address
- * @flags: (see omap_hwmod_addr_space.flags macros above)
- *
- * Address space doesn't necessarily follow physical interconnect
- * structure.  GPMC is one example.
- */
-struct omap_hwmod_addr_space {
-       const char *name;
-       u32 pa_start;
-       u32 pa_end;
-       u8 flags;
-};
-
-
-/*
- * omap_hwmod_ocp_if.user bits: these indicate the initiators that use this
- * interface to interact with the hwmod.  Used to add sleep dependencies
- * when the module is enabled or disabled.
- */
-#define OCP_USER_MPU                   (1 << 0)
-#define OCP_USER_SDMA                  (1 << 1)
-#define OCP_USER_DSP                   (1 << 2)
-#define OCP_USER_IVA                   (1 << 3)
-
-/* omap_hwmod_ocp_if.flags bits */
-#define OCPIF_SWSUP_IDLE               (1 << 0)
-#define OCPIF_CAN_BURST                        (1 << 1)
-
-/* omap_hwmod_ocp_if._int_flags possibilities */
-#define _OCPIF_INT_FLAGS_REGISTERED    (1 << 0)
-
-
-/**
- * struct omap_hwmod_ocp_if - OCP interface data
- * @master: struct omap_hwmod that initiates OCP transactions on this link
- * @slave: struct omap_hwmod that responds to OCP transactions on this link
- * @addr: address space associated with this link
- * @clk: interface clock: OMAP clock name
- * @_clk: pointer to the interface struct clk (filled in at runtime)
- * @fw: interface firewall data
- * @width: OCP data width
- * @user: initiators using this interface (see OCP_USER_* macros above)
- * @flags: OCP interface flags (see OCPIF_* macros above)
- * @_int_flags: internal flags (see _OCPIF_INT_FLAGS* macros above)
- *
- * It may also be useful to add a tag_cnt field for OCP2.x devices.
- *
- * Parameter names beginning with an underscore are managed internally by
- * the omap_hwmod code and should not be set during initialization.
- */
-struct omap_hwmod_ocp_if {
-       struct omap_hwmod               *master;
-       struct omap_hwmod               *slave;
-       struct omap_hwmod_addr_space    *addr;
-       const char                      *clk;
-       struct clk                      *_clk;
-       union {
-               struct omap_hwmod_omap2_firewall omap2;
-       }                               fw;
-       u8                              width;
-       u8                              user;
-       u8                              flags;
-       u8                              _int_flags;
-};
-
-
-/* Macros for use in struct omap_hwmod_sysconfig */
-
-/* Flags for use in omap_hwmod_sysconfig.idlemodes */
-#define MASTER_STANDBY_SHIFT   4
-#define SLAVE_IDLE_SHIFT       0
-#define SIDLE_FORCE            (HWMOD_IDLEMODE_FORCE << SLAVE_IDLE_SHIFT)
-#define SIDLE_NO               (HWMOD_IDLEMODE_NO << SLAVE_IDLE_SHIFT)
-#define SIDLE_SMART            (HWMOD_IDLEMODE_SMART << SLAVE_IDLE_SHIFT)
-#define SIDLE_SMART_WKUP       (HWMOD_IDLEMODE_SMART_WKUP << SLAVE_IDLE_SHIFT)
-#define MSTANDBY_FORCE         (HWMOD_IDLEMODE_FORCE << MASTER_STANDBY_SHIFT)
-#define MSTANDBY_NO            (HWMOD_IDLEMODE_NO << MASTER_STANDBY_SHIFT)
-#define MSTANDBY_SMART         (HWMOD_IDLEMODE_SMART << MASTER_STANDBY_SHIFT)
-#define MSTANDBY_SMART_WKUP    (HWMOD_IDLEMODE_SMART_WKUP << MASTER_STANDBY_SHIFT)
-
-/* omap_hwmod_sysconfig.sysc_flags capability flags */
-#define SYSC_HAS_AUTOIDLE      (1 << 0)
-#define SYSC_HAS_SOFTRESET     (1 << 1)
-#define SYSC_HAS_ENAWAKEUP     (1 << 2)
-#define SYSC_HAS_EMUFREE       (1 << 3)
-#define SYSC_HAS_CLOCKACTIVITY (1 << 4)
-#define SYSC_HAS_SIDLEMODE     (1 << 5)
-#define SYSC_HAS_MIDLEMODE     (1 << 6)
-#define SYSS_HAS_RESET_STATUS  (1 << 7)
-#define SYSC_NO_CACHE          (1 << 8)  /* XXX SW flag, belongs elsewhere */
-#define SYSC_HAS_RESET_STATUS  (1 << 9)
-#define SYSC_HAS_DMADISABLE    (1 << 10)
-
-/* omap_hwmod_sysconfig.clockact flags */
-#define CLOCKACT_TEST_BOTH     0x0
-#define CLOCKACT_TEST_MAIN     0x1
-#define CLOCKACT_TEST_ICLK     0x2
-#define CLOCKACT_TEST_NONE     0x3
-
-/**
- * struct omap_hwmod_sysc_fields - hwmod OCP_SYSCONFIG register field offsets.
- * @midle_shift: Offset of the midle bit
- * @clkact_shift: Offset of the clockactivity bit
- * @sidle_shift: Offset of the sidle bit
- * @enwkup_shift: Offset of the enawakeup bit
- * @srst_shift: Offset of the softreset bit
- * @autoidle_shift: Offset of the autoidle bit
- * @dmadisable_shift: Offset of the dmadisable bit
- */
-struct omap_hwmod_sysc_fields {
-       u8 midle_shift;
-       u8 clkact_shift;
-       u8 sidle_shift;
-       u8 enwkup_shift;
-       u8 srst_shift;
-       u8 autoidle_shift;
-       u8 dmadisable_shift;
-};
-
-/**
- * struct omap_hwmod_class_sysconfig - hwmod class OCP_SYS* data
- * @rev_offs: IP block revision register offset (from module base addr)
- * @sysc_offs: OCP_SYSCONFIG register offset (from module base addr)
- * @syss_offs: OCP_SYSSTATUS register offset (from module base addr)
- * @srst_udelay: Delay needed after doing a softreset in usecs
- * @idlemodes: One or more of {SIDLE,MSTANDBY}_{OFF,FORCE,SMART}
- * @sysc_flags: SYS{C,S}_HAS* flags indicating SYSCONFIG bits supported
- * @clockact: the default value of the module CLOCKACTIVITY bits
- *
- * @clockact describes to the module which clocks are likely to be
- * disabled when the PRCM issues its idle request to the module.  Some
- * modules have separate clockdomains for the interface clock and main
- * functional clock, and can check whether they should acknowledge the
- * idle request based on the internal module functionality that has
- * been associated with the clocks marked in @clockact.  This field is
- * only used if HWMOD_SET_DEFAULT_CLOCKACT is set (see below)
- *
- * @sysc_fields: structure containing the offset positions of various bits in
- * SYSCONFIG register. This can be populated using omap_hwmod_sysc_type1 or
- * omap_hwmod_sysc_type2 defined in omap_hwmod_common_data.c depending on
- * whether the device ip is compliant with the original PRCM protocol
- * defined for OMAP2420 or the new PRCM protocol for new OMAP4 IPs.
- * If the device follows a different scheme for the sysconfig register ,
- * then this field has to be populated with the correct offset structure.
- */
-struct omap_hwmod_class_sysconfig {
-       u32 rev_offs;
-       u32 sysc_offs;
-       u32 syss_offs;
-       u16 sysc_flags;
-       struct omap_hwmod_sysc_fields *sysc_fields;
-       u8 srst_udelay;
-       u8 idlemodes;
-       u8 clockact;
-};
-
-/**
- * struct omap_hwmod_omap2_prcm - OMAP2/3-specific PRCM data
- * @module_offs: PRCM submodule offset from the start of the PRM/CM
- * @prcm_reg_id: PRCM register ID (e.g., 3 for CM_AUTOIDLE3)
- * @module_bit: register bit shift for AUTOIDLE, WKST, WKEN, GRPSEL regs
- * @idlest_reg_id: IDLEST register ID (e.g., 3 for CM_IDLEST3)
- * @idlest_idle_bit: register bit shift for CM_IDLEST slave idle bit
- * @idlest_stdby_bit: register bit shift for CM_IDLEST master standby bit
- *
- * @prcm_reg_id and @module_bit are specific to the AUTOIDLE, WKST,
- * WKEN, GRPSEL registers.  In an ideal world, no extra information
- * would be needed for IDLEST information, but alas, there are some
- * exceptions, so @idlest_reg_id, @idlest_idle_bit, @idlest_stdby_bit
- * are needed for the IDLEST registers (c.f. 2430 I2CHS, 3430 USBHOST)
- */
-struct omap_hwmod_omap2_prcm {
-       s16 module_offs;
-       u8 prcm_reg_id;
-       u8 module_bit;
-       u8 idlest_reg_id;
-       u8 idlest_idle_bit;
-       u8 idlest_stdby_bit;
-};
-
-/*
- * Possible values for struct omap_hwmod_omap4_prcm.flags
- *
- * HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT: Some IP blocks don't have a PRCM
- *     module-level context loss register associated with them; this
- *     flag bit should be set in those cases
- */
-#define HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT                (1 << 0)
-
-/**
- * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data
- * @clkctrl_reg: PRCM address of the clock control register
- * @rstctrl_reg: address of the XXX_RSTCTRL register located in the PRM
- * @lostcontext_mask: bitmask for selecting bits from RM_*_CONTEXT register
- * @rstst_reg: (AM33XX only) address of the XXX_RSTST register in the PRM
- * @submodule_wkdep_bit: bit shift of the WKDEP range
- * @flags: PRCM register capabilities for this IP block
- *
- * If @lostcontext_mask is not defined, context loss check code uses
- * whole register without masking. @lostcontext_mask should only be
- * defined in cases where @context_offs register is shared by two or
- * more hwmods.
- */
-struct omap_hwmod_omap4_prcm {
-       u16             clkctrl_offs;
-       u16             rstctrl_offs;
-       u16             rstst_offs;
-       u16             context_offs;
-       u32             lostcontext_mask;
-       u8              submodule_wkdep_bit;
-       u8              modulemode;
-       u8              flags;
-};
-
-
-/*
- * omap_hwmod.flags definitions
- *
- * HWMOD_SWSUP_SIDLE: omap_hwmod code should manually bring module in and out
- *     of idle, rather than relying on module smart-idle
- * HWMOD_SWSUP_MSTDBY: omap_hwmod code should manually bring module in and out
- *     of standby, rather than relying on module smart-standby
- * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for
- *     SDRAM controller, etc. XXX probably belongs outside the main hwmod file
- *     XXX Should be HWMOD_SETUP_NO_RESET
- * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM
- *     controller, etc. XXX probably belongs outside the main hwmod file
- *     XXX Should be HWMOD_SETUP_NO_IDLE
- * HWMOD_NO_OCP_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE)
- *     when module is enabled, rather than the default, which is to
- *     enable autoidle
- * HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup
- * HWMOD_NO_IDLEST: this module does not have idle status - this is the case
- *     only for few initiator modules on OMAP2 & 3.
- * HWMOD_CONTROL_OPT_CLKS_IN_RESET: Enable all optional clocks during reset.
- *     This is needed for devices like DSS that require optional clocks enabled
- *     in order to complete the reset. Optional clocks will be disabled
- *     again after the reset.
- * HWMOD_16BIT_REG: Module has 16bit registers
- */
-#define HWMOD_SWSUP_SIDLE                      (1 << 0)
-#define HWMOD_SWSUP_MSTANDBY                   (1 << 1)
-#define HWMOD_INIT_NO_RESET                    (1 << 2)
-#define HWMOD_INIT_NO_IDLE                     (1 << 3)
-#define HWMOD_NO_OCP_AUTOIDLE                  (1 << 4)
-#define HWMOD_SET_DEFAULT_CLOCKACT             (1 << 5)
-#define HWMOD_NO_IDLEST                                (1 << 6)
-#define HWMOD_CONTROL_OPT_CLKS_IN_RESET                (1 << 7)
-#define HWMOD_16BIT_REG                                (1 << 8)
-
-/*
- * omap_hwmod._int_flags definitions
- * These are for internal use only and are managed by the omap_hwmod code.
- *
- * _HWMOD_NO_MPU_PORT: no path exists for the MPU to write to this module
- * _HWMOD_WAKEUP_ENABLED: set when the omap_hwmod code has enabled ENAWAKEUP
- * _HWMOD_SYSCONFIG_LOADED: set when the OCP_SYSCONFIG value has been cached
- * _HWMOD_SKIP_ENABLE: set if hwmod enabled during init (HWMOD_INIT_NO_IDLE) -
- *     causes the first call to _enable() to only update the pinmux
- */
-#define _HWMOD_NO_MPU_PORT                     (1 << 0)
-#define _HWMOD_WAKEUP_ENABLED                  (1 << 1)
-#define _HWMOD_SYSCONFIG_LOADED                        (1 << 2)
-#define _HWMOD_SKIP_ENABLE                     (1 << 3)
-
-/*
- * omap_hwmod._state definitions
- *
- * INITIALIZED: reset (optionally), initialized, enabled, disabled
- *              (optionally)
- *
- *
- */
-#define _HWMOD_STATE_UNKNOWN                   0
-#define _HWMOD_STATE_REGISTERED                        1
-#define _HWMOD_STATE_CLKS_INITED               2
-#define _HWMOD_STATE_INITIALIZED               3
-#define _HWMOD_STATE_ENABLED                   4
-#define _HWMOD_STATE_IDLE                      5
-#define _HWMOD_STATE_DISABLED                  6
-
-/**
- * struct omap_hwmod_class - the type of an IP block
- * @name: name of the hwmod_class
- * @sysc: device SYSCONFIG/SYSSTATUS register data
- * @rev: revision of the IP class
- * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
- * @reset: ptr to fn to be executed in place of the standard hwmod reset fn
- *
- * Represent the class of a OMAP hardware "modules" (e.g. timer,
- * smartreflex, gpio, uart...)
- *
- * @pre_shutdown is a function that will be run immediately before
- * hwmod clocks are disabled, etc.  It is intended for use for hwmods
- * like the MPU watchdog, which cannot be disabled with the standard
- * omap_hwmod_shutdown().  The function should return 0 upon success,
- * or some negative error upon failure.  Returning an error will cause
- * omap_hwmod_shutdown() to abort the device shutdown and return an
- * error.
- *
- * If @reset is defined, then the function it points to will be
- * executed in place of the standard hwmod _reset() code in
- * mach-omap2/omap_hwmod.c.  This is needed for IP blocks which have
- * unusual reset sequences - usually processor IP blocks like the IVA.
- */
-struct omap_hwmod_class {
-       const char                              *name;
-       struct omap_hwmod_class_sysconfig       *sysc;
-       u32                                     rev;
-       int                                     (*pre_shutdown)(struct omap_hwmod *oh);
-       int                                     (*reset)(struct omap_hwmod *oh);
-};
-
-/**
- * struct omap_hwmod_link - internal structure linking hwmods with ocp_ifs
- * @ocp_if: OCP interface structure record pointer
- * @node: list_head pointing to next struct omap_hwmod_link in a list
- */
-struct omap_hwmod_link {
-       struct omap_hwmod_ocp_if        *ocp_if;
-       struct list_head                node;
-};
-
-/**
- * struct omap_hwmod - integration data for OMAP hardware "modules" (IP blocks)
- * @name: name of the hwmod
- * @class: struct omap_hwmod_class * to the class of this hwmod
- * @od: struct omap_device currently associated with this hwmod (internal use)
- * @mpu_irqs: ptr to an array of MPU IRQs
- * @sdma_reqs: ptr to an array of System DMA request IDs
- * @prcm: PRCM data pertaining to this hwmod
- * @main_clk: main clock: OMAP clock name
- * @_clk: pointer to the main struct clk (filled in at runtime)
- * @opt_clks: other device clocks that drivers can request (0..*)
- * @voltdm: pointer to voltage domain (filled in at runtime)
- * @dev_attr: arbitrary device attributes that can be passed to the driver
- * @_sysc_cache: internal-use hwmod flags
- * @_mpu_rt_va: cached register target start address (internal use)
- * @_mpu_port: cached MPU register target slave (internal use)
- * @opt_clks_cnt: number of @opt_clks
- * @master_cnt: number of @master entries
- * @slaves_cnt: number of @slave entries
- * @response_lat: device OCP response latency (in interface clock cycles)
- * @_int_flags: internal-use hwmod flags
- * @_state: internal-use hwmod state
- * @_postsetup_state: internal-use state to leave the hwmod in after _setup()
- * @flags: hwmod flags (documented below)
- * @_lock: spinlock serializing operations on this hwmod
- * @node: list node for hwmod list (internal use)
- *
- * @main_clk refers to this module's "main clock," which for our
- * purposes is defined as "the functional clock needed for register
- * accesses to complete."  Modules may not have a main clock if the
- * interface clock also serves as a main clock.
- *
- * Parameter names beginning with an underscore are managed internally by
- * the omap_hwmod code and should not be set during initialization.
- *
- * @masters and @slaves are now deprecated.
- */
-struct omap_hwmod {
-       const char                      *name;
-       struct omap_hwmod_class         *class;
-       struct omap_device              *od;
-       struct omap_hwmod_mux_info      *mux;
-       struct omap_hwmod_irq_info      *mpu_irqs;
-       struct omap_hwmod_dma_info      *sdma_reqs;
-       struct omap_hwmod_rst_info      *rst_lines;
-       union {
-               struct omap_hwmod_omap2_prcm omap2;
-               struct omap_hwmod_omap4_prcm omap4;
-       }                               prcm;
-       const char                      *main_clk;
-       struct clk                      *_clk;
-       struct omap_hwmod_opt_clk       *opt_clks;
-       char                            *clkdm_name;
-       struct clockdomain              *clkdm;
-       struct list_head                master_ports; /* connect to *_IA */
-       struct list_head                slave_ports; /* connect to *_TA */
-       void                            *dev_attr;
-       u32                             _sysc_cache;
-       void __iomem                    *_mpu_rt_va;
-       spinlock_t                      _lock;
-       struct list_head                node;
-       struct omap_hwmod_ocp_if        *_mpu_port;
-       u16                             flags;
-       u8                              response_lat;
-       u8                              rst_lines_cnt;
-       u8                              opt_clks_cnt;
-       u8                              masters_cnt;
-       u8                              slaves_cnt;
-       u8                              hwmods_cnt;
-       u8                              _int_flags;
-       u8                              _state;
-       u8                              _postsetup_state;
-};
-
-struct omap_hwmod *omap_hwmod_lookup(const char *name);
-int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
-                       void *data);
-
-int __init omap_hwmod_setup_one(const char *name);
-
-int omap_hwmod_enable(struct omap_hwmod *oh);
-int omap_hwmod_idle(struct omap_hwmod *oh);
-int omap_hwmod_shutdown(struct omap_hwmod *oh);
-
-int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name);
-int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name);
-int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name);
-
-int omap_hwmod_enable_clocks(struct omap_hwmod *oh);
-int omap_hwmod_disable_clocks(struct omap_hwmod *oh);
-
-int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode);
-int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle);
-
-int omap_hwmod_reset(struct omap_hwmod *oh);
-void omap_hwmod_ocp_barrier(struct omap_hwmod *oh);
-
-void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs);
-u32 omap_hwmod_read(struct omap_hwmod *oh, u16 reg_offs);
-int omap_hwmod_softreset(struct omap_hwmod *oh);
-
-int omap_hwmod_count_resources(struct omap_hwmod *oh);
-int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res);
-int omap_hwmod_fill_dma_resources(struct omap_hwmod *oh, struct resource *res);
-int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type,
-                                  const char *name, struct resource *res);
-
-struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh);
-void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh);
-
-int omap_hwmod_add_initiator_dep(struct omap_hwmod *oh,
-                                struct omap_hwmod *init_oh);
-int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
-                                struct omap_hwmod *init_oh);
-
-int omap_hwmod_enable_wakeup(struct omap_hwmod *oh);
-int omap_hwmod_disable_wakeup(struct omap_hwmod *oh);
-
-int omap_hwmod_for_each_by_class(const char *classname,
-                                int (*fn)(struct omap_hwmod *oh,
-                                          void *user),
-                                void *user);
-
-int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
-int omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
-
-int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
-
-int omap_hwmod_pad_route_irq(struct omap_hwmod *oh, int pad_idx, int irq_idx);
-
-extern void __init omap_hwmod_init(void);
-
-const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);
-
-/*
- * Chip variant-specific hwmod init routines - XXX should be converted
- * to use initcalls once the initial boot ordering is straightened out
- */
-extern int omap2420_hwmod_init(void);
-extern int omap2430_hwmod_init(void);
-extern int omap3xxx_hwmod_init(void);
-extern int omap44xx_hwmod_init(void);
-extern int am33xx_hwmod_init(void);
-
-extern int __init omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois);
-
-#endif
diff --git a/arch/arm/plat-omap/include/plat/sdrc.h b/arch/arm/plat-omap/include/plat/sdrc.h
deleted file mode 100644 (file)
index 36d6a76..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-#ifndef ____ASM_ARCH_SDRC_H
-#define ____ASM_ARCH_SDRC_H
-
-/*
- * OMAP2/3 SDRC/SMS register definitions
- *
- * Copyright (C) 2007-2008 Texas Instruments, Inc.
- * Copyright (C) 2007-2008 Nokia Corporation
- *
- * Tony Lindgren
- * Paul Walmsley
- * Richard Woodruff
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-
-/* SDRC register offsets - read/write with sdrc_{read,write}_reg() */
-
-#define SDRC_SYSCONFIG         0x010
-#define SDRC_CS_CFG            0x040
-#define SDRC_SHARING           0x044
-#define SDRC_ERR_TYPE          0x04C
-#define SDRC_DLLA_CTRL         0x060
-#define SDRC_DLLA_STATUS       0x064
-#define SDRC_DLLB_CTRL         0x068
-#define SDRC_DLLB_STATUS       0x06C
-#define SDRC_POWER             0x070
-#define SDRC_MCFG_0            0x080
-#define SDRC_MR_0              0x084
-#define SDRC_EMR2_0            0x08c
-#define SDRC_ACTIM_CTRL_A_0    0x09c
-#define SDRC_ACTIM_CTRL_B_0    0x0a0
-#define SDRC_RFR_CTRL_0                0x0a4
-#define SDRC_MANUAL_0          0x0a8
-#define SDRC_MCFG_1            0x0B0
-#define SDRC_MR_1              0x0B4
-#define SDRC_EMR2_1            0x0BC
-#define SDRC_ACTIM_CTRL_A_1    0x0C4
-#define SDRC_ACTIM_CTRL_B_1    0x0C8
-#define SDRC_RFR_CTRL_1                0x0D4
-#define SDRC_MANUAL_1          0x0D8
-
-#define SDRC_POWER_AUTOCOUNT_SHIFT     8
-#define SDRC_POWER_AUTOCOUNT_MASK      (0xffff << SDRC_POWER_AUTOCOUNT_SHIFT)
-#define SDRC_POWER_CLKCTRL_SHIFT       4
-#define SDRC_POWER_CLKCTRL_MASK                (0x3 << SDRC_POWER_CLKCTRL_SHIFT)
-#define SDRC_SELF_REFRESH_ON_AUTOCOUNT (0x2 << SDRC_POWER_CLKCTRL_SHIFT)
-
-/*
- * These values represent the number of memory clock cycles between
- * autorefresh initiation.  They assume 1 refresh per 64 ms (JEDEC), 8192
- * rows per device, and include a subtraction of a 50 cycle window in the
- * event that the autorefresh command is delayed due to other SDRC activity.
- * The '| 1' sets the ARE field to send one autorefresh when the autorefresh
- * counter reaches 0.
- *
- * These represent optimal values for common parts, it won't work for all.
- * As long as you scale down, most parameters are still work, they just
- * become sub-optimal. The RFR value goes in the opposite direction. If you
- * don't adjust it down as your clock period increases the refresh interval
- * will not be met. Setting all parameters for complete worst case may work,
- * but may cut memory performance by 2x. Due to errata the DLLs need to be
- * unlocked and their value needs run time calibration.        A dynamic call is
- * need for that as no single right value exists acorss production samples.
- *
- * Only the FULL speed values are given. Current code is such that rate
- * changes must be made at DPLLoutx2. The actual value adjustment for low
- * frequency operation will be handled by omap_set_performance()
- *
- * By having the boot loader boot up in the fastest L4 speed available likely
- * will result in something which you can switch between.
- */
-#define SDRC_RFR_CTRL_165MHz   (0x00044c00 | 1)
-#define SDRC_RFR_CTRL_133MHz   (0x0003de00 | 1)
-#define SDRC_RFR_CTRL_100MHz   (0x0002da01 | 1)
-#define SDRC_RFR_CTRL_110MHz   (0x0002da01 | 1) /* Need to calc */
-#define SDRC_RFR_CTRL_BYPASS   (0x00005000 | 1) /* Need to calc */
-
-
-/*
- * SMS register access
- */
-
-#define OMAP242X_SMS_REGADDR(reg)                                      \
-               (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE + reg)
-#define OMAP243X_SMS_REGADDR(reg)                                      \
-               (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE + reg)
-#define OMAP343X_SMS_REGADDR(reg)                                      \
-               (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE + reg)
-
-/* SMS register offsets - read/write with sms_{read,write}_reg() */
-
-#define SMS_SYSCONFIG                  0x010
-#define SMS_ROT_CONTROL(context)       (0x180 + 0x10 * context)
-#define SMS_ROT_SIZE(context)          (0x184 + 0x10 * context)
-#define SMS_ROT_PHYSICAL_BA(context)   (0x188 + 0x10 * context)
-/* REVISIT: fill in other SMS registers here */
-
-
-#ifndef __ASSEMBLER__
-
-/**
- * struct omap_sdrc_params - SDRC parameters for a given SDRC clock rate
- * @rate: SDRC clock rate (in Hz)
- * @actim_ctrla: Value to program to SDRC_ACTIM_CTRLA for this rate
- * @actim_ctrlb: Value to program to SDRC_ACTIM_CTRLB for this rate
- * @rfr_ctrl: Value to program to SDRC_RFR_CTRL for this rate
- * @mr: Value to program to SDRC_MR for this rate
- *
- * This structure holds a pre-computed set of register values for the
- * SDRC for a given SDRC clock rate and SDRAM chip.  These are
- * intended to be pre-computed and specified in an array in the board-*.c
- * files.  The structure is keyed off the 'rate' field.
- */
-struct omap_sdrc_params {
-       unsigned long rate;
-       u32 actim_ctrla;
-       u32 actim_ctrlb;
-       u32 rfr_ctrl;
-       u32 mr;
-};
-
-#ifdef CONFIG_SOC_HAS_OMAP2_SDRC
-void omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
-                           struct omap_sdrc_params *sdrc_cs1);
-#else
-static inline void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
-                                         struct omap_sdrc_params *sdrc_cs1) {};
-#endif
-
-int omap2_sdrc_get_params(unsigned long r,
-                         struct omap_sdrc_params **sdrc_cs0,
-                         struct omap_sdrc_params **sdrc_cs1);
-void omap2_sms_save_context(void);
-void omap2_sms_restore_context(void);
-
-void omap2_sms_write_rot_control(u32 val, unsigned ctx);
-void omap2_sms_write_rot_size(u32 val, unsigned ctx);
-void omap2_sms_write_rot_physical_ba(u32 val, unsigned ctx);
-
-#ifdef CONFIG_ARCH_OMAP2
-
-struct memory_timings {
-       u32 m_type;             /* ddr = 1, sdr = 0 */
-       u32 dll_mode;           /* use lock mode = 1, unlock mode = 0 */
-       u32 slow_dll_ctrl;      /* unlock mode, dll value for slow speed */
-       u32 fast_dll_ctrl;      /* unlock mode, dll value for fast speed */
-       u32 base_cs;            /* base chip select to use for calculations */
-};
-
-extern void omap2xxx_sdrc_init_params(u32 force_lock_to_unlock_mode);
-struct omap_sdrc_params *rx51_get_sdram_timings(void);
-
-u32 omap2xxx_sdrc_dll_is_unlocked(void);
-u32 omap2xxx_sdrc_reprogram(u32 level, u32 force);
-
-#endif  /* CONFIG_ARCH_OMAP2 */
-
-#endif  /* __ASSEMBLER__ */
-
-#endif
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
deleted file mode 100644 (file)
index 65fce44..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * arch/arm/plat-omap/include/mach/serial.h
- *
- * Copyright (C) 2009 Texas Instruments
- * Added OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com>
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#ifndef __ASM_ARCH_SERIAL_H
-#define __ASM_ARCH_SERIAL_H
-
-#include <linux/init.h>
-
-/*
- * Memory entry used for the DEBUG_LL UART configuration, relative to
- * start of RAM. See also uncompress.h and debug-macro.S.
- *
- * Note that using a memory location for storing the UART configuration
- * has at least two limitations:
- *
- * 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the
- *    uncompress code could then partially overwrite itself
- * 2. We assume printascii is called at least once before paging_init,
- *    and addruart has a chance to read OMAP_UART_INFO
- */
-#define OMAP_UART_INFO_OFS     0x3ffc
-
-/* OMAP1 serial ports */
-#define OMAP1_UART1_BASE       0xfffb0000
-#define OMAP1_UART2_BASE       0xfffb0800
-#define OMAP1_UART3_BASE       0xfffb9800
-
-/* OMAP2 serial ports */
-#define OMAP2_UART1_BASE       0x4806a000
-#define OMAP2_UART2_BASE       0x4806c000
-#define OMAP2_UART3_BASE       0x4806e000
-
-/* OMAP3 serial ports */
-#define OMAP3_UART1_BASE       OMAP2_UART1_BASE
-#define OMAP3_UART2_BASE       OMAP2_UART2_BASE
-#define OMAP3_UART3_BASE       0x49020000
-#define OMAP3_UART4_BASE       0x49042000      /* Only on 36xx */
-#define OMAP3_UART4_AM35XX_BASE        0x4809E000      /* Only on AM35xx */
-
-/* OMAP4 serial ports */
-#define OMAP4_UART1_BASE       OMAP2_UART1_BASE
-#define OMAP4_UART2_BASE       OMAP2_UART2_BASE
-#define OMAP4_UART3_BASE       0x48020000
-#define OMAP4_UART4_BASE       0x4806e000
-
-/* TI81XX serial ports */
-#define TI81XX_UART1_BASE      0x48020000
-#define TI81XX_UART2_BASE      0x48022000
-#define TI81XX_UART3_BASE      0x48024000
-
-/* AM3505/3517 UART4 */
-#define AM35XX_UART4_BASE      0x4809E000      /* Only on AM3505/3517 */
-
-/* AM33XX serial port */
-#define AM33XX_UART1_BASE      0x44E09000
-
-/* OMAP5 serial ports */
-#define OMAP5_UART1_BASE       OMAP2_UART1_BASE
-#define OMAP5_UART2_BASE       OMAP2_UART2_BASE
-#define OMAP5_UART3_BASE       OMAP4_UART3_BASE
-#define OMAP5_UART4_BASE       OMAP4_UART4_BASE
-#define OMAP5_UART5_BASE       0x48066000
-#define OMAP5_UART6_BASE       0x48068000
-
-/* External port on Zoom2/3 */
-#define ZOOM_UART_BASE         0x10000000
-#define ZOOM_UART_VIRT         0xfa400000
-
-#define OMAP_PORT_SHIFT                2
-#define OMAP7XX_PORT_SHIFT     0
-#define ZOOM_PORT_SHIFT                1
-
-#define OMAP1510_BASE_BAUD     (12000000/16)
-#define OMAP16XX_BASE_BAUD     (48000000/16)
-#define OMAP24XX_BASE_BAUD     (48000000/16)
-
-/*
- * DEBUG_LL port encoding stored into the UART1 scratchpad register by
- * decomp_setup in uncompress.h
- */
-#define OMAP1UART1             11
-#define OMAP1UART2             12
-#define OMAP1UART3             13
-#define OMAP2UART1             21
-#define OMAP2UART2             22
-#define OMAP2UART3             23
-#define OMAP3UART1             OMAP2UART1
-#define OMAP3UART2             OMAP2UART2
-#define OMAP3UART3             33
-#define OMAP3UART4             34              /* Only on 36xx */
-#define OMAP4UART1             OMAP2UART1
-#define OMAP4UART2             OMAP2UART2
-#define OMAP4UART3             43
-#define OMAP4UART4             44
-#define TI81XXUART1            81
-#define TI81XXUART2            82
-#define TI81XXUART3            83
-#define AM33XXUART1            84
-#define OMAP5UART3             OMAP4UART3
-#define OMAP5UART4             OMAP4UART4
-#define ZOOM_UART              95              /* Only on zoom2/3 */
-
-/* This is only used by 8250.c for omap1510 */
-#define is_omap_port(pt)       ({int __ret = 0;                        \
-                       if ((pt)->port.mapbase == OMAP1_UART1_BASE ||   \
-                           (pt)->port.mapbase == OMAP1_UART2_BASE ||   \
-                           (pt)->port.mapbase == OMAP1_UART3_BASE)     \
-                               __ret = 1;                              \
-                       __ret;                                          \
-                       })
-
-#ifndef __ASSEMBLER__
-
-struct omap_board_data;
-struct omap_uart_port_info;
-
-extern void omap_serial_init(void);
-extern void omap_serial_board_init(struct omap_uart_port_info *platform_data);
-extern void omap_serial_init_port(struct omap_board_data *bdata,
-               struct omap_uart_port_info *platform_data);
-#endif
-
-#endif
diff --git a/arch/arm/plat-omap/include/plat/sram.h b/arch/arm/plat-omap/include/plat/sram.h
deleted file mode 100644 (file)
index 227ae26..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * arch/arm/plat-omap/include/mach/sram.h
- *
- * Interface for functions that need to be run in internal SRAM
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __ARCH_ARM_OMAP_SRAM_H
-#define __ARCH_ARM_OMAP_SRAM_H
-
-#ifndef __ASSEMBLY__
-#include <asm/fncpy.h>
-
-extern void *omap_sram_push_address(unsigned long size);
-
-/* Macro to push a function to the internal SRAM, using the fncpy API */
-#define omap_sram_push(funcp, size) ({                         \
-       typeof(&(funcp)) _res = NULL;                           \
-       void *_sram_address = omap_sram_push_address(size);     \
-       if (_sram_address)                                      \
-               _res = fncpy(_sram_address, &(funcp), size);    \
-       _res;                                                   \
-})
-
-extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
-
-extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
-                               u32 base_cs, u32 force_unlock);
-extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
-                                     u32 mem_type);
-extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass);
-
-extern u32 omap3_configure_core_dpll(
-                       u32 m2, u32 unlock_dll, u32 f, u32 inc,
-                       u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
-                       u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
-                       u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
-                       u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
-extern void omap3_sram_restore_context(void);
-
-/* Do not use these */
-extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
-extern unsigned long omap1_sram_reprogram_clock_sz;
-
-extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
-extern unsigned long omap24xx_sram_reprogram_clock_sz;
-
-extern void omap242x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
-                                               u32 base_cs, u32 force_unlock);
-extern unsigned long omap242x_sram_ddr_init_sz;
-
-extern u32 omap242x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val,
-                                               int bypass);
-extern unsigned long omap242x_sram_set_prcm_sz;
-
-extern void omap242x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
-                                               u32 mem_type);
-extern unsigned long omap242x_sram_reprogram_sdrc_sz;
-
-
-extern void omap243x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
-                                               u32 base_cs, u32 force_unlock);
-extern unsigned long omap243x_sram_ddr_init_sz;
-
-extern u32 omap243x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val,
-                                               int bypass);
-extern unsigned long omap243x_sram_set_prcm_sz;
-
-extern void omap243x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
-                                               u32 mem_type);
-extern unsigned long omap243x_sram_reprogram_sdrc_sz;
-
-extern u32 omap3_sram_configure_core_dpll(
-                       u32 m2, u32 unlock_dll, u32 f, u32 inc,
-                       u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
-                       u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
-                       u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
-                       u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
-extern unsigned long omap3_sram_configure_core_dpll_sz;
-
-#ifdef CONFIG_PM
-extern void omap_push_sram_idle(void);
-#else
-static inline void omap_push_sram_idle(void) {}
-#endif /* CONFIG_PM */
-
-#endif /* __ASSEMBLY__ */
-
-/*
- * OMAP2+: define the SRAM PA addresses.
- * Used by the SRAM management code and the idle sleep code.
- */
-#define OMAP2_SRAM_PA          0x40200000
-#define OMAP3_SRAM_PA           0x40200000
-#ifdef CONFIG_OMAP4_ERRATA_I688
-#define OMAP4_SRAM_PA          0x40304000
-#define OMAP4_SRAM_VA          0xfe404000
-#else
-#define OMAP4_SRAM_PA          0x40300000
-#endif
-#define AM33XX_SRAM_PA         0x40300000
-#endif
diff --git a/arch/arm/plat-omap/include/plat/tc.h b/arch/arm/plat-omap/include/plat/tc.h
deleted file mode 100644 (file)
index 1b4b2da..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * arch/arm/plat-omap/include/mach/tc.h
- *
- * OMAP Traffic Controller
- *
- * Copyright (C) 2004 Nokia Corporation
- * Author: Imre Deak <imre.deak@nokia.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-#ifndef __ASM_ARCH_TC_H
-#define __ASM_ARCH_TC_H
-
-#define TCMIF_BASE             0xfffecc00
-#define OMAP_TC_OCPT1_PRIOR    (TCMIF_BASE + 0x00)
-#define OMAP_TC_EMIFS_PRIOR    (TCMIF_BASE + 0x04)
-#define OMAP_TC_EMIFF_PRIOR    (TCMIF_BASE + 0x08)
-#define EMIFS_CONFIG           (TCMIF_BASE + 0x0c)
-#define EMIFS_CS0_CONFIG       (TCMIF_BASE + 0x10)
-#define EMIFS_CS1_CONFIG       (TCMIF_BASE + 0x14)
-#define EMIFS_CS2_CONFIG       (TCMIF_BASE + 0x18)
-#define EMIFS_CS3_CONFIG       (TCMIF_BASE + 0x1c)
-#define EMIFF_SDRAM_CONFIG     (TCMIF_BASE + 0x20)
-#define EMIFF_MRS              (TCMIF_BASE + 0x24)
-#define TC_TIMEOUT1            (TCMIF_BASE + 0x28)
-#define TC_TIMEOUT2            (TCMIF_BASE + 0x2c)
-#define TC_TIMEOUT3            (TCMIF_BASE + 0x30)
-#define TC_ENDIANISM           (TCMIF_BASE + 0x34)
-#define EMIFF_SDRAM_CONFIG_2   (TCMIF_BASE + 0x3c)
-#define EMIF_CFG_DYNAMIC_WS    (TCMIF_BASE + 0x40)
-#define EMIFS_ACS0             (TCMIF_BASE + 0x50)
-#define EMIFS_ACS1             (TCMIF_BASE + 0x54)
-#define EMIFS_ACS2             (TCMIF_BASE + 0x58)
-#define EMIFS_ACS3             (TCMIF_BASE + 0x5c)
-#define OMAP_TC_OCPT2_PRIOR    (TCMIF_BASE + 0xd0)
-
-/* external EMIFS chipselect regions */
-#define        OMAP_CS0_PHYS           0x00000000
-#define        OMAP_CS0_SIZE           SZ_64M
-
-#define        OMAP_CS1_PHYS           0x04000000
-#define        OMAP_CS1_SIZE           SZ_64M
-
-#define        OMAP_CS1A_PHYS          OMAP_CS1_PHYS
-#define        OMAP_CS1A_SIZE          SZ_32M
-
-#define        OMAP_CS1B_PHYS          (OMAP_CS1A_PHYS + OMAP_CS1A_SIZE)
-#define        OMAP_CS1B_SIZE          SZ_32M
-
-#define        OMAP_CS2_PHYS           0x08000000
-#define        OMAP_CS2_SIZE           SZ_64M
-
-#define        OMAP_CS2A_PHYS          OMAP_CS2_PHYS
-#define        OMAP_CS2A_SIZE          SZ_32M
-
-#define        OMAP_CS2B_PHYS          (OMAP_CS2A_PHYS + OMAP_CS2A_SIZE)
-#define        OMAP_CS2B_SIZE          SZ_32M
-
-#define        OMAP_CS3_PHYS           0x0c000000
-#define        OMAP_CS3_SIZE           SZ_64M
-
-#ifndef        __ASSEMBLER__
-
-/* EMIF Slow Interface Configuration Register */
-#define OMAP_EMIFS_CONFIG_FR           (1 << 4)
-#define OMAP_EMIFS_CONFIG_PDE          (1 << 3)
-#define OMAP_EMIFS_CONFIG_PWD_EN       (1 << 2)
-#define OMAP_EMIFS_CONFIG_BM           (1 << 1)
-#define OMAP_EMIFS_CONFIG_WP           (1 << 0)
-
-#define EMIFS_CCS(n)           (EMIFS_CS0_CONFIG + (4 * (n)))
-#define EMIFS_ACS(n)           (EMIFS_ACS0 + (4 * (n)))
-
-#endif /* __ASSEMBLER__ */
-
-#endif /* __ASM_ARCH_TC_H */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
deleted file mode 100644 (file)
index 7f7b112..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * arch/arm/plat-omap/include/mach/uncompress.h
- *
- * Serial port stubs for kernel decompress status messages
- *
- * Initially based on:
- * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h
- * Copyright (C) 2000 RidgeRun, Inc.
- * Author: Greg Lonnon <glonnon@ridgerun.com>
- *
- * Rewritten by:
- * Author: <source@mvista.com>
- * 2004 (c) MontaVista Software, Inc.
- *
- * This file is licensed under the terms of the GNU General Public License
- * version 2. This program is licensed "as is" without any warranty of any
- * kind, whether express or implied.
- */
-
-#include <linux/types.h>
-#include <linux/serial_reg.h>
-
-#include <asm/memory.h>
-#include <asm/mach-types.h>
-
-#include <plat/serial.h>
-
-#define MDR1_MODE_MASK                 0x07
-
-volatile u8 *uart_base;
-int uart_shift;
-
-/*
- * Store the DEBUG_LL uart number into memory.
- * See also debug-macro.S, and serial.c for related code.
- */
-static void set_omap_uart_info(unsigned char port)
-{
-       /*
-        * Get address of some.bss variable and round it down
-        * a la CONFIG_AUTO_ZRELADDR.
-        */
-       u32 ram_start = (u32)&uart_shift & 0xf8000000;
-       u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS);
-       *uart_info = port;
-}
-
-static void putc(int c)
-{
-       if (!uart_base)
-               return;
-
-       /* Check for UART 16x mode */
-       if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0)
-               return;
-
-       while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
-               barrier();
-       uart_base[UART_TX << uart_shift] = c;
-}
-
-static inline void flush(void)
-{
-}
-
-/*
- * Macros to configure UART1 and debug UART
- */
-#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id)              \
-       if (machine_is_##mach()) {                                      \
-               uart_base = (volatile u8 *)(dbg_uart);                  \
-               uart_shift = (dbg_shft);                                \
-               port = (dbg_id);                                        \
-               set_omap_uart_info(port);                               \
-               break;                                                  \
-       }
-
-#define DEBUG_LL_OMAP7XX(p, mach)                                      \
-       _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, \
-               OMAP1UART##p)
-
-#define DEBUG_LL_OMAP1(p, mach)                                                \
-       _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT,    \
-               OMAP1UART##p)
-
-#define DEBUG_LL_OMAP2(p, mach)                                                \
-       _DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT,    \
-               OMAP2UART##p)
-
-#define DEBUG_LL_OMAP3(p, mach)                                                \
-       _DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT,    \
-               OMAP3UART##p)
-
-#define DEBUG_LL_OMAP4(p, mach)                                                \
-       _DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT,    \
-               OMAP4UART##p)
-
-#define DEBUG_LL_OMAP5(p, mach)                                                \
-       _DEBUG_LL_ENTRY(mach, OMAP5_UART##p##_BASE, OMAP_PORT_SHIFT,    \
-               OMAP5UART##p)
-/* Zoom2/3 shift is different for UART1 and external port */
-#define DEBUG_LL_ZOOM(mach)                                            \
-       _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
-
-#define DEBUG_LL_TI81XX(p, mach)                                       \
-       _DEBUG_LL_ENTRY(mach, TI81XX_UART##p##_BASE, OMAP_PORT_SHIFT,   \
-               TI81XXUART##p)
-
-#define DEBUG_LL_AM33XX(p, mach)                                       \
-       _DEBUG_LL_ENTRY(mach, AM33XX_UART##p##_BASE, OMAP_PORT_SHIFT,   \
-               AM33XXUART##p)
-
-static inline void arch_decomp_setup(void)
-{
-       int port = 0;
-
-       /*
-        * Initialize the port based on the machine ID from the bootloader.
-        * Note that we're using macros here instead of switch statement
-        * as machine_is functions are optimized out for the boards that
-        * are not selected.
-        */
-       do {
-               /* omap7xx/8xx based boards using UART1 with shift 0 */
-               DEBUG_LL_OMAP7XX(1, herald);
-               DEBUG_LL_OMAP7XX(1, omap_perseus2);
-
-               /* omap15xx/16xx based boards using UART1 */
-               DEBUG_LL_OMAP1(1, ams_delta);
-               DEBUG_LL_OMAP1(1, nokia770);
-               DEBUG_LL_OMAP1(1, omap_h2);
-               DEBUG_LL_OMAP1(1, omap_h3);
-               DEBUG_LL_OMAP1(1, omap_innovator);
-               DEBUG_LL_OMAP1(1, omap_osk);
-               DEBUG_LL_OMAP1(1, omap_palmte);
-               DEBUG_LL_OMAP1(1, omap_palmz71);
-
-               /* omap15xx/16xx based boards using UART2 */
-               DEBUG_LL_OMAP1(2, omap_palmtt);
-
-               /* omap15xx/16xx based boards using UART3 */
-               DEBUG_LL_OMAP1(3, sx1);
-
-               /* omap2 based boards using UART1 */
-               DEBUG_LL_OMAP2(1, omap_2430sdp);
-               DEBUG_LL_OMAP2(1, omap_apollon);
-               DEBUG_LL_OMAP2(1, omap_h4);
-
-               /* omap2 based boards using UART3 */
-               DEBUG_LL_OMAP2(3, nokia_n800);
-               DEBUG_LL_OMAP2(3, nokia_n810);
-               DEBUG_LL_OMAP2(3, nokia_n810_wimax);
-
-               /* omap3 based boards using UART1 */
-               DEBUG_LL_OMAP2(1, omap3evm);
-               DEBUG_LL_OMAP3(1, omap_3430sdp);
-               DEBUG_LL_OMAP3(1, omap_3630sdp);
-               DEBUG_LL_OMAP3(1, omap3530_lv_som);
-               DEBUG_LL_OMAP3(1, omap3_torpedo);
-
-               /* omap3 based boards using UART3 */
-               DEBUG_LL_OMAP3(3, cm_t35);
-               DEBUG_LL_OMAP3(3, cm_t3517);
-               DEBUG_LL_OMAP3(3, cm_t3730);
-               DEBUG_LL_OMAP3(3, craneboard);
-               DEBUG_LL_OMAP3(3, devkit8000);
-               DEBUG_LL_OMAP3(3, igep0020);
-               DEBUG_LL_OMAP3(3, igep0030);
-               DEBUG_LL_OMAP3(3, nokia_rm680);
-               DEBUG_LL_OMAP3(3, nokia_rm696);
-               DEBUG_LL_OMAP3(3, nokia_rx51);
-               DEBUG_LL_OMAP3(3, omap3517evm);
-               DEBUG_LL_OMAP3(3, omap3_beagle);
-               DEBUG_LL_OMAP3(3, omap3_pandora);
-               DEBUG_LL_OMAP3(3, omap_ldp);
-               DEBUG_LL_OMAP3(3, overo);
-               DEBUG_LL_OMAP3(3, touchbook);
-
-               /* omap4 based boards using UART3 */
-               DEBUG_LL_OMAP4(3, omap_4430sdp);
-               DEBUG_LL_OMAP4(3, omap4_panda);
-
-               /* omap5 based boards using UART3 */
-               DEBUG_LL_OMAP5(3, omap5_sevm);
-
-               /* zoom2/3 external uart */
-               DEBUG_LL_ZOOM(omap_zoom2);
-               DEBUG_LL_ZOOM(omap_zoom3);
-
-               /* TI8168 base boards using UART3 */
-               DEBUG_LL_TI81XX(3, ti8168evm);
-
-               /* TI8148 base boards using UART1 */
-               DEBUG_LL_TI81XX(1, ti8148evm);
-
-               /* AM33XX base boards using UART1 */
-               DEBUG_LL_AM33XX(1, am335xevm);
-       } while (0);
-}
-
-/*
- * nothing to do
- */
-#define arch_decomp_wdog()
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
deleted file mode 100644 (file)
index 87ee140..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-// include/asm-arm/mach-omap/usb.h
-
-#ifndef        __ASM_ARCH_OMAP_USB_H
-#define        __ASM_ARCH_OMAP_USB_H
-
-#include <linux/io.h>
-#include <linux/platform_device.h>
-#include <linux/usb/musb.h>
-
-#define OMAP3_HS_USB_PORTS     3
-
-enum usbhs_omap_port_mode {
-       OMAP_USBHS_PORT_MODE_UNUSED,
-       OMAP_EHCI_PORT_MODE_PHY,
-       OMAP_EHCI_PORT_MODE_TLL,
-       OMAP_EHCI_PORT_MODE_HSIC,
-       OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0,
-       OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM,
-       OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0,
-       OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
-       OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0,
-       OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM,
-       OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0,
-       OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM,
-       OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0,
-       OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM
-};
-
-struct usbhs_omap_board_data {
-       enum usbhs_omap_port_mode       port_mode[OMAP3_HS_USB_PORTS];
-
-       /* have to be valid if phy_reset is true and portx is in phy mode */
-       int     reset_gpio_port[OMAP3_HS_USB_PORTS];
-
-       /* Set this to true for ES2.x silicon */
-       unsigned                        es2_compatibility:1;
-
-       unsigned                        phy_reset:1;
-
-       /*
-        * Regulators for USB PHYs.
-        * Each PHY can have a separate regulator.
-        */
-       struct regulator                *regulator[OMAP3_HS_USB_PORTS];
-};
-
-#ifdef CONFIG_ARCH_OMAP2PLUS
-
-struct ehci_hcd_omap_platform_data {
-       enum usbhs_omap_port_mode       port_mode[OMAP3_HS_USB_PORTS];
-       int                             reset_gpio_port[OMAP3_HS_USB_PORTS];
-       struct regulator                *regulator[OMAP3_HS_USB_PORTS];
-       unsigned                        phy_reset:1;
-};
-
-struct ohci_hcd_omap_platform_data {
-       enum usbhs_omap_port_mode       port_mode[OMAP3_HS_USB_PORTS];
-       unsigned                        es2_compatibility:1;
-};
-
-struct usbhs_omap_platform_data {
-       enum usbhs_omap_port_mode               port_mode[OMAP3_HS_USB_PORTS];
-
-       struct ehci_hcd_omap_platform_data      *ehci_data;
-       struct ohci_hcd_omap_platform_data      *ohci_data;
-};
-
-struct usbtll_omap_platform_data {
-       enum usbhs_omap_port_mode               port_mode[OMAP3_HS_USB_PORTS];
-};
-/*-------------------------------------------------------------------------*/
-
-struct omap_musb_board_data {
-       u8      interface_type;
-       u8      mode;
-       u16     power;
-       unsigned extvbus:1;
-       void    (*set_phy_power)(u8 on);
-       void    (*clear_irq)(void);
-       void    (*set_mode)(u8 mode);
-       void    (*reset)(void);
-};
-
-enum musb_interface    {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI};
-
-extern void usb_musb_init(struct omap_musb_board_data *board_data);
-
-extern void usbhs_init(const struct usbhs_omap_board_data *pdata);
-extern int omap_tll_enable(void);
-extern int omap_tll_disable(void);
-
-extern int omap4430_phy_power(struct device *dev, int ID, int on);
-extern int omap4430_phy_set_clk(struct device *dev, int on);
-extern int omap4430_phy_init(struct device *dev);
-extern int omap4430_phy_exit(struct device *dev);
-extern int omap4430_phy_suspend(struct device *dev, int suspend);
-
-#endif
-
-extern void am35x_musb_reset(void);
-extern void am35x_musb_phy_power(u8 on);
-extern void am35x_musb_clear_irq(void);
-extern void am35x_set_mode(u8 musb_mode);
-extern void ti81xx_musb_phy_power(u8 on);
-
-/* AM35x */
-/* USB 2.0 PHY Control */
-#define CONF2_PHY_GPIOMODE     (1 << 23)
-#define CONF2_OTGMODE          (3 << 14)
-#define CONF2_NO_OVERRIDE      (0 << 14)
-#define CONF2_FORCE_HOST       (1 << 14)
-#define CONF2_FORCE_DEVICE     (2 << 14)
-#define CONF2_FORCE_HOST_VBUS_LOW (3 << 14)
-#define CONF2_SESENDEN         (1 << 13)
-#define CONF2_VBDTCTEN         (1 << 12)
-#define CONF2_REFFREQ_24MHZ    (2 << 8)
-#define CONF2_REFFREQ_26MHZ    (7 << 8)
-#define CONF2_REFFREQ_13MHZ    (6 << 8)
-#define CONF2_REFFREQ          (0xf << 8)
-#define CONF2_PHYCLKGD         (1 << 7)
-#define CONF2_VBUSSENSE                (1 << 6)
-#define CONF2_PHY_PLLON                (1 << 5)
-#define CONF2_RESET            (1 << 4)
-#define CONF2_PHYPWRDN         (1 << 3)
-#define CONF2_OTGPWRDN         (1 << 2)
-#define CONF2_DATPOL           (1 << 1)
-
-/* TI81XX specific definitions */
-#define USBCTRL0       0x620
-#define USBSTAT0       0x624
-
-/* TI816X PHY controls bits */
-#define TI816X_USBPHY0_NORMAL_MODE     (1 << 0)
-#define TI816X_USBPHY_REFCLK_OSC       (1 << 8)
-
-/* TI814X PHY controls bits */
-#define USBPHY_CM_PWRDN                (1 << 0)
-#define USBPHY_OTG_PWRDN       (1 << 1)
-#define USBPHY_CHGDET_DIS      (1 << 2)
-#define USBPHY_CHGDET_RSTRT    (1 << 3)
-#define USBPHY_SRCONDM         (1 << 4)
-#define USBPHY_SINKONDP                (1 << 5)
-#define USBPHY_CHGISINK_EN     (1 << 6)
-#define USBPHY_CHGVSRC_EN      (1 << 7)
-#define USBPHY_DMPULLUP                (1 << 8)
-#define USBPHY_DPPULLUP                (1 << 9)
-#define USBPHY_CDET_EXTCTL     (1 << 10)
-#define USBPHY_GPIO_MODE       (1 << 12)
-#define USBPHY_DPOPBUFCTL      (1 << 13)
-#define USBPHY_DMOPBUFCTL      (1 << 14)
-#define USBPHY_DPINPUT         (1 << 15)
-#define USBPHY_DMINPUT         (1 << 16)
-#define USBPHY_DPGPIO_PD       (1 << 17)
-#define USBPHY_DMGPIO_PD       (1 << 18)
-#define USBPHY_OTGVDET_EN      (1 << 19)
-#define USBPHY_OTGSESSEND_EN   (1 << 20)
-#define USBPHY_DATA_POLARITY   (1 << 23)
-
-#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_USB)
-u32 omap1_usb0_init(unsigned nwires, unsigned is_device);
-u32 omap1_usb1_init(unsigned nwires);
-u32 omap1_usb2_init(unsigned nwires, unsigned alt_pingroup);
-#else
-static inline u32 omap1_usb0_init(unsigned nwires, unsigned is_device)
-{
-       return 0;
-}
-static inline u32 omap1_usb1_init(unsigned nwires)
-{
-       return 0;
-
-}
-static inline u32 omap1_usb2_init(unsigned nwires, unsigned alt_pingroup)
-{
-       return 0;
-}
-#endif
-
-#endif /* __ASM_ARCH_OMAP_USB_H */
diff --git a/arch/arm/plat-omap/include/plat/vrfb.h b/arch/arm/plat-omap/include/plat/vrfb.h
deleted file mode 100644 (file)
index 3792bde..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * VRFB Rotation Engine
- *
- * Copyright (C) 2009 Nokia Corporation
- * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-#ifndef __OMAP_VRFB_H__
-#define __OMAP_VRFB_H__
-
-#define OMAP_VRFB_LINE_LEN 2048
-
-struct vrfb {
-       u8 context;
-       void __iomem *vaddr[4];
-       unsigned long paddr[4];
-       u16 xres;
-       u16 yres;
-       u16 xoffset;
-       u16 yoffset;
-       u8 bytespp;
-       bool yuv_mode;
-};
-
-#ifdef CONFIG_OMAP2_VRFB
-extern int omap_vrfb_request_ctx(struct vrfb *vrfb);
-extern void omap_vrfb_release_ctx(struct vrfb *vrfb);
-extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
-               u8 bytespp);
-extern u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp);
-extern u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp);
-extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
-               u16 width, u16 height,
-               unsigned bytespp, bool yuv_mode);
-extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot);
-extern void omap_vrfb_restore_context(void);
-
-#else
-static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; }
-static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {}
-static inline void omap_vrfb_adjust_size(u16 *width, u16 *height,
-               u8 bytespp) {}
-static inline u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp)
-               { return 0; }
-static inline u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp)
-               { return 0; }
-static inline void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
-               u16 width, u16 height, unsigned bytespp, bool yuv_mode) {}
-static inline int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot)
-               { return 0; }
-static inline void omap_vrfb_restore_context(void) {}
-#endif
-#endif /* __VRFB_H */
index 9722f418ae1fa845b4008afd3a38b722ecf942d2..198685b894b02174c63e70d854fb02090e630819 100644 (file)
@@ -22,9 +22,8 @@
 #include <linux/device.h>
 #include <linux/platform_device.h>
 
-/* Interface documentation is in mach/omap-pm.h */
-#include <plat/omap-pm.h>
-#include <plat/omap_device.h>
+#include "../mach-omap2/omap_device.h"
+#include "../mach-omap2/omap-pm.h"
 
 static bool off_mode_enabled;
 static int dummy_context_loss_counter;
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
deleted file mode 100644 (file)
index 7a7d1f2..0000000
+++ /dev/null
@@ -1,1278 +0,0 @@
-/*
- * omap_device implementation
- *
- * Copyright (C) 2009-2010 Nokia Corporation
- * Paul Walmsley, Kevin Hilman
- *
- * Developed in collaboration with (alphabetical order): Benoit
- * Cousson, Thara Gopinath, Tony Lindgren, Rajendra Nayak, Vikram
- * Pandita, Sakari Poussa, Anand Sawant, Santosh Shilimkar, Richard
- * Woodruff
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This code provides a consistent interface for OMAP device drivers
- * to control power management and interconnect properties of their
- * devices.
- *
- * In the medium- to long-term, this code should either be
- * a) implemented via arch-specific pointers in platform_data
- * or
- * b) implemented as a proper omap_bus/omap_device in Linux, no more
- *    platform_data func pointers
- *
- *
- * Guidelines for usage by driver authors:
- *
- * 1. These functions are intended to be used by device drivers via
- * function pointers in struct platform_data.  As an example,
- * omap_device_enable() should be passed to the driver as
- *
- * struct foo_driver_platform_data {
- * ...
- *      int (*device_enable)(struct platform_device *pdev);
- * ...
- * }
- *
- * Note that the generic "device_enable" name is used, rather than
- * "omap_device_enable".  This is so other architectures can pass in their
- * own enable/disable functions here.
- *
- * This should be populated during device setup:
- *
- * ...
- * pdata->device_enable = omap_device_enable;
- * ...
- *
- * 2. Drivers should first check to ensure the function pointer is not null
- * before calling it, as in:
- *
- * if (pdata->device_enable)
- *     pdata->device_enable(pdev);
- *
- * This allows other architectures that don't use similar device_enable()/
- * device_shutdown() functions to execute normally.
- *
- * ...
- *
- * Suggested usage by device drivers:
- *
- * During device initialization:
- * device_enable()
- *
- * During device idle:
- * (save remaining device context if necessary)
- * device_idle();
- *
- * During device resume:
- * device_enable();
- * (restore context if necessary)
- *
- * During device shutdown:
- * device_shutdown()
- * (device must be reinitialized at this point to use it again)
- *
- */
-#undef DEBUG
-
-#include <linux/kernel.h>
-#include <linux/export.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/clk.h>
-#include <linux/clkdev.h>
-#include <linux/pm_runtime.h>
-#include <linux/of.h>
-#include <linux/notifier.h>
-
-#include <plat/omap_device.h>
-#include <plat/omap_hwmod.h>
-#include <plat/clock.h>
-
-/* These parameters are passed to _omap_device_{de,}activate() */
-#define USE_WAKEUP_LAT                 0
-#define IGNORE_WAKEUP_LAT              1
-
-static int omap_early_device_register(struct platform_device *pdev);
-
-static struct omap_device_pm_latency omap_default_latency[] = {
-       {
-               .deactivate_func = omap_device_idle_hwmods,
-               .activate_func   = omap_device_enable_hwmods,
-               .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
-       }
-};
-
-/* Private functions */
-
-/**
- * _omap_device_activate - increase device readiness
- * @od: struct omap_device *
- * @ignore_lat: increase to latency target (0) or full readiness (1)?
- *
- * Increase readiness of omap_device @od (thus decreasing device
- * wakeup latency, but consuming more power).  If @ignore_lat is
- * IGNORE_WAKEUP_LAT, make the omap_device fully active.  Otherwise,
- * if @ignore_lat is USE_WAKEUP_LAT, and the device's maximum wakeup
- * latency is greater than the requested maximum wakeup latency, step
- * backwards in the omap_device_pm_latency table to ensure the
- * device's maximum wakeup latency is less than or equal to the
- * requested maximum wakeup latency.  Returns 0.
- */
-static int _omap_device_activate(struct omap_device *od, u8 ignore_lat)
-{
-       struct timespec a, b, c;
-
-       dev_dbg(&od->pdev->dev, "omap_device: activating\n");
-
-       while (od->pm_lat_level > 0) {
-               struct omap_device_pm_latency *odpl;
-               unsigned long long act_lat = 0;
-
-               od->pm_lat_level--;
-
-               odpl = od->pm_lats + od->pm_lat_level;
-
-               if (!ignore_lat &&
-                   (od->dev_wakeup_lat <= od->_dev_wakeup_lat_limit))
-                       break;
-
-               read_persistent_clock(&a);
-
-               /* XXX check return code */
-               odpl->activate_func(od);
-
-               read_persistent_clock(&b);
-
-               c = timespec_sub(b, a);
-               act_lat = timespec_to_ns(&c);
-
-               dev_dbg(&od->pdev->dev,
-                       "omap_device: pm_lat %d: activate: elapsed time %llu nsec\n",
-                       od->pm_lat_level, act_lat);
-
-               if (act_lat > odpl->activate_lat) {
-                       odpl->activate_lat_worst = act_lat;
-                       if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
-                               odpl->activate_lat = act_lat;
-                               dev_dbg(&od->pdev->dev,
-                                       "new worst case activate latency %d: %llu\n",
-                                       od->pm_lat_level, act_lat);
-                       } else
-                               dev_warn(&od->pdev->dev,
-                                        "activate latency %d higher than expected. (%llu > %d)\n",
-                                        od->pm_lat_level, act_lat,
-                                        odpl->activate_lat);
-               }
-
-               od->dev_wakeup_lat -= odpl->activate_lat;
-       }
-
-       return 0;
-}
-
-/**
- * _omap_device_deactivate - decrease device readiness
- * @od: struct omap_device *
- * @ignore_lat: decrease to latency target (0) or full inactivity (1)?
- *
- * Decrease readiness of omap_device @od (thus increasing device
- * wakeup latency, but conserving power).  If @ignore_lat is
- * IGNORE_WAKEUP_LAT, make the omap_device fully inactive.  Otherwise,
- * if @ignore_lat is USE_WAKEUP_LAT, and the device's maximum wakeup
- * latency is less than the requested maximum wakeup latency, step
- * forwards in the omap_device_pm_latency table to ensure the device's
- * maximum wakeup latency is less than or equal to the requested
- * maximum wakeup latency.  Returns 0.
- */
-static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
-{
-       struct timespec a, b, c;
-
-       dev_dbg(&od->pdev->dev, "omap_device: deactivating\n");
-
-       while (od->pm_lat_level < od->pm_lats_cnt) {
-               struct omap_device_pm_latency *odpl;
-               unsigned long long deact_lat = 0;
-
-               odpl = od->pm_lats + od->pm_lat_level;
-
-               if (!ignore_lat &&
-                   ((od->dev_wakeup_lat + odpl->activate_lat) >
-                    od->_dev_wakeup_lat_limit))
-                       break;
-
-               read_persistent_clock(&a);
-
-               /* XXX check return code */
-               odpl->deactivate_func(od);
-
-               read_persistent_clock(&b);
-
-               c = timespec_sub(b, a);
-               deact_lat = timespec_to_ns(&c);
-
-               dev_dbg(&od->pdev->dev,
-                       "omap_device: pm_lat %d: deactivate: elapsed time %llu nsec\n",
-                       od->pm_lat_level, deact_lat);
-
-               if (deact_lat > odpl->deactivate_lat) {
-                       odpl->deactivate_lat_worst = deact_lat;
-                       if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
-                               odpl->deactivate_lat = deact_lat;
-                               dev_dbg(&od->pdev->dev,
-                                       "new worst case deactivate latency %d: %llu\n",
-                                       od->pm_lat_level, deact_lat);
-                       } else
-                               dev_warn(&od->pdev->dev,
-                                        "deactivate latency %d higher than expected. (%llu > %d)\n",
-                                        od->pm_lat_level, deact_lat,
-                                        odpl->deactivate_lat);
-               }
-
-               od->dev_wakeup_lat += odpl->activate_lat;
-
-               od->pm_lat_level++;
-       }
-
-       return 0;
-}
-
-static void _add_clkdev(struct omap_device *od, const char *clk_alias,
-                      const char *clk_name)
-{
-       struct clk *r;
-       struct clk_lookup *l;
-
-       if (!clk_alias || !clk_name)
-               return;
-
-       dev_dbg(&od->pdev->dev, "Creating %s -> %s\n", clk_alias, clk_name);
-
-       r = clk_get_sys(dev_name(&od->pdev->dev), clk_alias);
-       if (!IS_ERR(r)) {
-               dev_warn(&od->pdev->dev,
-                        "alias %s already exists\n", clk_alias);
-               clk_put(r);
-               return;
-       }
-
-       r = clk_get(NULL, clk_name);
-       if (IS_ERR(r)) {
-               dev_err(&od->pdev->dev,
-                       "clk_get for %s failed\n", clk_name);
-               return;
-       }
-
-       l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev->dev));
-       if (!l) {
-               dev_err(&od->pdev->dev,
-                       "clkdev_alloc for %s failed\n", clk_alias);
-               return;
-       }
-
-       clkdev_add(l);
-}
-
-/**
- * _add_hwmod_clocks_clkdev - Add clkdev entry for hwmod optional clocks
- * and main clock
- * @od: struct omap_device *od
- * @oh: struct omap_hwmod *oh
- *
- * For the main clock and every optional clock present per hwmod per
- * omap_device, this function adds an entry in the clkdev table of the
- * form <dev-id=dev_name, con-id=role> if it does not exist already.
- *
- * The function is called from inside omap_device_build_ss(), after
- * omap_device_register.
- *
- * This allows drivers to get a pointer to its optional clocks based on its role
- * by calling clk_get(<dev*>, <role>).
- * In the case of the main clock, a "fck" alias is used.
- *
- * No return value.
- */
-static void _add_hwmod_clocks_clkdev(struct omap_device *od,
-                                    struct omap_hwmod *oh)
-{
-       int i;
-
-       _add_clkdev(od, "fck", oh->main_clk);
-
-       for (i = 0; i < oh->opt_clks_cnt; i++)
-               _add_clkdev(od, oh->opt_clks[i].role, oh->opt_clks[i].clk);
-}
-
-
-/**
- * omap_device_build_from_dt - build an omap_device with multiple hwmods
- * @pdev_name: name of the platform_device driver to use
- * @pdev_id: this platform_device's connection ID
- * @oh: ptr to the single omap_hwmod that backs this omap_device
- * @pdata: platform_data ptr to associate with the platform_device
- * @pdata_len: amount of memory pointed to by @pdata
- * @pm_lats: pointer to a omap_device_pm_latency array for this device
- * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
- * @is_early_device: should the device be registered as an early device or not
- *
- * Function for building an omap_device already registered from device-tree
- *
- * Returns 0 or PTR_ERR() on error.
- */
-static int omap_device_build_from_dt(struct platform_device *pdev)
-{
-       struct omap_hwmod **hwmods;
-       struct omap_device *od;
-       struct omap_hwmod *oh;
-       struct device_node *node = pdev->dev.of_node;
-       const char *oh_name;
-       int oh_cnt, i, ret = 0;
-
-       oh_cnt = of_property_count_strings(node, "ti,hwmods");
-       if (!oh_cnt || IS_ERR_VALUE(oh_cnt)) {
-               dev_dbg(&pdev->dev, "No 'hwmods' to build omap_device\n");
-               return -ENODEV;
-       }
-
-       hwmods = kzalloc(sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL);
-       if (!hwmods) {
-               ret = -ENOMEM;
-               goto odbfd_exit;
-       }
-
-       for (i = 0; i < oh_cnt; i++) {
-               of_property_read_string_index(node, "ti,hwmods", i, &oh_name);
-               oh = omap_hwmod_lookup(oh_name);
-               if (!oh) {
-                       dev_err(&pdev->dev, "Cannot lookup hwmod '%s'\n",
-                               oh_name);
-                       ret = -EINVAL;
-                       goto odbfd_exit1;
-               }
-               hwmods[i] = oh;
-       }
-
-       od = omap_device_alloc(pdev, hwmods, oh_cnt, NULL, 0);
-       if (!od) {
-               dev_err(&pdev->dev, "Cannot allocate omap_device for :%s\n",
-                       oh_name);
-               ret = PTR_ERR(od);
-               goto odbfd_exit1;
-       }
-
-       /* Fix up missing resource names */
-       for (i = 0; i < pdev->num_resources; i++) {
-               struct resource *r = &pdev->resource[i];
-
-               if (r->name == NULL)
-                       r->name = dev_name(&pdev->dev);
-       }
-
-       if (of_get_property(node, "ti,no_idle_on_suspend", NULL))
-               omap_device_disable_idle_on_suspend(pdev);
-
-       pdev->dev.pm_domain = &omap_device_pm_domain;
-
-odbfd_exit1:
-       kfree(hwmods);
-odbfd_exit:
-       return ret;
-}
-
-static int _omap_device_notifier_call(struct notifier_block *nb,
-                                     unsigned long event, void *dev)
-{
-       struct platform_device *pdev = to_platform_device(dev);
-       struct omap_device *od;
-
-       switch (event) {
-       case BUS_NOTIFY_DEL_DEVICE:
-               if (pdev->archdata.od)
-                       omap_device_delete(pdev->archdata.od);
-               break;
-       case BUS_NOTIFY_ADD_DEVICE:
-               if (pdev->dev.of_node)
-                       omap_device_build_from_dt(pdev);
-               /* fall through */
-       default:
-               od = to_omap_device(pdev);
-               if (od)
-                       od->_driver_status = event;
-       }
-
-       return NOTIFY_DONE;
-}
-
-
-/* Public functions for use by core code */
-
-/**
- * omap_device_get_context_loss_count - get lost context count
- * @od: struct omap_device *
- *
- * Using the primary hwmod, query the context loss count for this
- * device.
- *
- * Callers should consider context for this device lost any time this
- * function returns a value different than the value the caller got
- * the last time it called this function.
- *
- * If any hwmods exist for the omap_device assoiated with @pdev,
- * return the context loss counter for that hwmod, otherwise return
- * zero.
- */
-int omap_device_get_context_loss_count(struct platform_device *pdev)
-{
-       struct omap_device *od;
-       u32 ret = 0;
-
-       od = to_omap_device(pdev);
-
-       if (od->hwmods_cnt)
-               ret = omap_hwmod_get_context_loss_count(od->hwmods[0]);
-
-       return ret;
-}
-
-/**
- * omap_device_count_resources - count number of struct resource entries needed
- * @od: struct omap_device *
- *
- * Count the number of struct resource entries needed for this
- * omap_device @od.  Used by omap_device_build_ss() to determine how
- * much memory to allocate before calling
- * omap_device_fill_resources().  Returns the count.
- */
-static int omap_device_count_resources(struct omap_device *od)
-{
-       int c = 0;
-       int i;
-
-       for (i = 0; i < od->hwmods_cnt; i++)
-               c += omap_hwmod_count_resources(od->hwmods[i]);
-
-       pr_debug("omap_device: %s: counted %d total resources across %d hwmods\n",
-                od->pdev->name, c, od->hwmods_cnt);
-
-       return c;
-}
-
-/**
- * omap_device_fill_resources - fill in array of struct resource
- * @od: struct omap_device *
- * @res: pointer to an array of struct resource to be filled in
- *
- * Populate one or more empty struct resource pointed to by @res with
- * the resource data for this omap_device @od.  Used by
- * omap_device_build_ss() after calling omap_device_count_resources().
- * Ideally this function would not be needed at all.  If omap_device
- * replaces platform_device, then we can specify our own
- * get_resource()/ get_irq()/etc functions that use the underlying
- * omap_hwmod information.  Or if platform_device is extended to use
- * subarchitecture-specific function pointers, the various
- * platform_device functions can simply call omap_device internal
- * functions to get device resources.  Hacking around the existing
- * platform_device code wastes memory.  Returns 0.
- */
-static int omap_device_fill_resources(struct omap_device *od,
-                                     struct resource *res)
-{
-       int i, r;
-
-       for (i = 0; i < od->hwmods_cnt; i++) {
-               r = omap_hwmod_fill_resources(od->hwmods[i], res);
-               res += r;
-       }
-
-       return 0;
-}
-
-/**
- * _od_fill_dma_resources - fill in array of struct resource with dma resources
- * @od: struct omap_device *
- * @res: pointer to an array of struct resource to be filled in
- *
- * Populate one or more empty struct resource pointed to by @res with
- * the dma resource data for this omap_device @od.  Used by
- * omap_device_alloc() after calling omap_device_count_resources().
- *
- * Ideally this function would not be needed at all.  If we have
- * mechanism to get dma resources from DT.
- *
- * Returns 0.
- */
-static int _od_fill_dma_resources(struct omap_device *od,
-                                     struct resource *res)
-{
-       int i, r;
-
-       for (i = 0; i < od->hwmods_cnt; i++) {
-               r = omap_hwmod_fill_dma_resources(od->hwmods[i], res);
-               res += r;
-       }
-
-       return 0;
-}
-
-/**
- * omap_device_alloc - allocate an omap_device
- * @pdev: platform_device that will be included in this omap_device
- * @oh: ptr to the single omap_hwmod that backs this omap_device
- * @pdata: platform_data ptr to associate with the platform_device
- * @pdata_len: amount of memory pointed to by @pdata
- * @pm_lats: pointer to a omap_device_pm_latency array for this device
- * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
- *
- * Convenience function for allocating an omap_device structure and filling
- * hwmods, resources and pm_latency attributes.
- *
- * Returns an struct omap_device pointer or ERR_PTR() on error;
- */
-struct omap_device *omap_device_alloc(struct platform_device *pdev,
-                                       struct omap_hwmod **ohs, int oh_cnt,
-                                       struct omap_device_pm_latency *pm_lats,
-                                       int pm_lats_cnt)
-{
-       int ret = -ENOMEM;
-       struct omap_device *od;
-       struct resource *res = NULL;
-       int i, res_count;
-       struct omap_hwmod **hwmods;
-
-       od = kzalloc(sizeof(struct omap_device), GFP_KERNEL);
-       if (!od) {
-               ret = -ENOMEM;
-               goto oda_exit1;
-       }
-       od->hwmods_cnt = oh_cnt;
-
-       hwmods = kmemdup(ohs, sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL);
-       if (!hwmods)
-               goto oda_exit2;
-
-       od->hwmods = hwmods;
-       od->pdev = pdev;
-
-       res_count = omap_device_count_resources(od);
-       /*
-        * DT Boot:
-        *   OF framework will construct the resource structure (currently
-        *   does for MEM & IRQ resource) and we should respect/use these
-        *   resources, killing hwmod dependency.
-        *   If pdev->num_resources > 0, we assume that MEM & IRQ resources
-        *   have been allocated by OF layer already (through DTB).
-        *
-        * Non-DT Boot:
-        *   Here, pdev->num_resources = 0, and we should get all the
-        *   resources from hwmod.
-        *
-        * TODO: Once DMA resource is available from OF layer, we should
-        *   kill filling any resources from hwmod.
-        */
-       if (res_count > pdev->num_resources) {
-               /* Allocate resources memory to account for new resources */
-               res = kzalloc(sizeof(struct resource) * res_count, GFP_KERNEL);
-               if (!res)
-                       goto oda_exit3;
-
-               /*
-                * If pdev->num_resources > 0, then assume that,
-                * MEM and IRQ resources will only come from DT and only
-                * fill DMA resource from hwmod layer.
-                */
-               if (pdev->num_resources && pdev->resource) {
-                       dev_dbg(&pdev->dev, "%s(): resources already allocated %d\n",
-                               __func__, res_count);
-                       memcpy(res, pdev->resource,
-                              sizeof(struct resource) * pdev->num_resources);
-                       _od_fill_dma_resources(od, &res[pdev->num_resources]);
-               } else {
-                       dev_dbg(&pdev->dev, "%s(): using resources from hwmod %d\n",
-                               __func__, res_count);
-                       omap_device_fill_resources(od, res);
-               }
-
-               ret = platform_device_add_resources(pdev, res, res_count);
-               kfree(res);
-
-               if (ret)
-                       goto oda_exit3;
-       }
-
-       if (!pm_lats) {
-               pm_lats = omap_default_latency;
-               pm_lats_cnt = ARRAY_SIZE(omap_default_latency);
-       }
-
-       od->pm_lats_cnt = pm_lats_cnt;
-       od->pm_lats = kmemdup(pm_lats,
-                       sizeof(struct omap_device_pm_latency) * pm_lats_cnt,
-                       GFP_KERNEL);
-       if (!od->pm_lats)
-               goto oda_exit3;
-
-       pdev->archdata.od = od;
-
-       for (i = 0; i < oh_cnt; i++) {
-               hwmods[i]->od = od;
-               _add_hwmod_clocks_clkdev(od, hwmods[i]);
-       }
-
-       return od;
-
-oda_exit3:
-       kfree(hwmods);
-oda_exit2:
-       kfree(od);
-oda_exit1:
-       dev_err(&pdev->dev, "omap_device: build failed (%d)\n", ret);
-
-       return ERR_PTR(ret);
-}
-
-void omap_device_delete(struct omap_device *od)
-{
-       if (!od)
-               return;
-
-       od->pdev->archdata.od = NULL;
-       kfree(od->pm_lats);
-       kfree(od->hwmods);
-       kfree(od);
-}
-
-/**
- * omap_device_build - build and register an omap_device with one omap_hwmod
- * @pdev_name: name of the platform_device driver to use
- * @pdev_id: this platform_device's connection ID
- * @oh: ptr to the single omap_hwmod that backs this omap_device
- * @pdata: platform_data ptr to associate with the platform_device
- * @pdata_len: amount of memory pointed to by @pdata
- * @pm_lats: pointer to a omap_device_pm_latency array for this device
- * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
- * @is_early_device: should the device be registered as an early device or not
- *
- * Convenience function for building and registering a single
- * omap_device record, which in turn builds and registers a
- * platform_device record.  See omap_device_build_ss() for more
- * information.  Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise,
- * passes along the return value of omap_device_build_ss().
- */
-struct platform_device __init *omap_device_build(const char *pdev_name, int pdev_id,
-                                     struct omap_hwmod *oh, void *pdata,
-                                     int pdata_len,
-                                     struct omap_device_pm_latency *pm_lats,
-                                     int pm_lats_cnt, int is_early_device)
-{
-       struct omap_hwmod *ohs[] = { oh };
-
-       if (!oh)
-               return ERR_PTR(-EINVAL);
-
-       return omap_device_build_ss(pdev_name, pdev_id, ohs, 1, pdata,
-                                   pdata_len, pm_lats, pm_lats_cnt,
-                                   is_early_device);
-}
-
-/**
- * omap_device_build_ss - build and register an omap_device with multiple hwmods
- * @pdev_name: name of the platform_device driver to use
- * @pdev_id: this platform_device's connection ID
- * @oh: ptr to the single omap_hwmod that backs this omap_device
- * @pdata: platform_data ptr to associate with the platform_device
- * @pdata_len: amount of memory pointed to by @pdata
- * @pm_lats: pointer to a omap_device_pm_latency array for this device
- * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
- * @is_early_device: should the device be registered as an early device or not
- *
- * Convenience function for building and registering an omap_device
- * subsystem record.  Subsystem records consist of multiple
- * omap_hwmods.  This function in turn builds and registers a
- * platform_device record.  Returns an ERR_PTR() on error, or passes
- * along the return value of omap_device_register().
- */
-struct platform_device __init *omap_device_build_ss(const char *pdev_name, int pdev_id,
-                                        struct omap_hwmod **ohs, int oh_cnt,
-                                        void *pdata, int pdata_len,
-                                        struct omap_device_pm_latency *pm_lats,
-                                        int pm_lats_cnt, int is_early_device)
-{
-       int ret = -ENOMEM;
-       struct platform_device *pdev;
-       struct omap_device *od;
-
-       if (!ohs || oh_cnt == 0 || !pdev_name)
-               return ERR_PTR(-EINVAL);
-
-       if (!pdata && pdata_len > 0)
-               return ERR_PTR(-EINVAL);
-
-       pdev = platform_device_alloc(pdev_name, pdev_id);
-       if (!pdev) {
-               ret = -ENOMEM;
-               goto odbs_exit;
-       }
-
-       /* Set the dev_name early to allow dev_xxx in omap_device_alloc */
-       if (pdev->id != -1)
-               dev_set_name(&pdev->dev, "%s.%d", pdev->name,  pdev->id);
-       else
-               dev_set_name(&pdev->dev, "%s", pdev->name);
-
-       od = omap_device_alloc(pdev, ohs, oh_cnt, pm_lats, pm_lats_cnt);
-       if (IS_ERR(od))
-               goto odbs_exit1;
-
-       ret = platform_device_add_data(pdev, pdata, pdata_len);
-       if (ret)
-               goto odbs_exit2;
-
-       if (is_early_device)
-               ret = omap_early_device_register(pdev);
-       else
-               ret = omap_device_register(pdev);
-       if (ret)
-               goto odbs_exit2;
-
-       return pdev;
-
-odbs_exit2:
-       omap_device_delete(od);
-odbs_exit1:
-       platform_device_put(pdev);
-odbs_exit:
-
-       pr_err("omap_device: %s: build failed (%d)\n", pdev_name, ret);
-
-       return ERR_PTR(ret);
-}
-
-/**
- * omap_early_device_register - register an omap_device as an early platform
- * device.
- * @od: struct omap_device * to register
- *
- * Register the omap_device structure.  This currently just calls
- * platform_early_add_device() on the underlying platform_device.
- * Returns 0 by default.
- */
-static int __init omap_early_device_register(struct platform_device *pdev)
-{
-       struct platform_device *devices[1];
-
-       devices[0] = pdev;
-       early_platform_add_devices(devices, 1);
-       return 0;
-}
-
-#ifdef CONFIG_PM_RUNTIME
-static int _od_runtime_suspend(struct device *dev)
-{
-       struct platform_device *pdev = to_platform_device(dev);
-       int ret;
-
-       ret = pm_generic_runtime_suspend(dev);
-
-       if (!ret)
-               omap_device_idle(pdev);
-
-       return ret;
-}
-
-static int _od_runtime_idle(struct device *dev)
-{
-       return pm_generic_runtime_idle(dev);
-}
-
-static int _od_runtime_resume(struct device *dev)
-{
-       struct platform_device *pdev = to_platform_device(dev);
-
-       omap_device_enable(pdev);
-
-       return pm_generic_runtime_resume(dev);
-}
-#endif
-
-#ifdef CONFIG_SUSPEND
-static int _od_suspend_noirq(struct device *dev)
-{
-       struct platform_device *pdev = to_platform_device(dev);
-       struct omap_device *od = to_omap_device(pdev);
-       int ret;
-
-       /* Don't attempt late suspend on a driver that is not bound */
-       if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER)
-               return 0;
-
-       ret = pm_generic_suspend_noirq(dev);
-
-       if (!ret && !pm_runtime_status_suspended(dev)) {
-               if (pm_generic_runtime_suspend(dev) == 0) {
-                       if (!(od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND))
-                               omap_device_idle(pdev);
-                       od->flags |= OMAP_DEVICE_SUSPENDED;
-               }
-       }
-
-       return ret;
-}
-
-static int _od_resume_noirq(struct device *dev)
-{
-       struct platform_device *pdev = to_platform_device(dev);
-       struct omap_device *od = to_omap_device(pdev);
-
-       if ((od->flags & OMAP_DEVICE_SUSPENDED) &&
-           !pm_runtime_status_suspended(dev)) {
-               od->flags &= ~OMAP_DEVICE_SUSPENDED;
-               if (!(od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND))
-                       omap_device_enable(pdev);
-               pm_generic_runtime_resume(dev);
-       }
-
-       return pm_generic_resume_noirq(dev);
-}
-#else
-#define _od_suspend_noirq NULL
-#define _od_resume_noirq NULL
-#endif
-
-struct dev_pm_domain omap_device_pm_domain = {
-       .ops = {
-               SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume,
-                                  _od_runtime_idle)
-               USE_PLATFORM_PM_SLEEP_OPS
-               .suspend_noirq = _od_suspend_noirq,
-               .resume_noirq = _od_resume_noirq,
-       }
-};
-
-/**
- * omap_device_register - register an omap_device with one omap_hwmod
- * @od: struct omap_device * to register
- *
- * Register the omap_device structure.  This currently just calls
- * platform_device_register() on the underlying platform_device.
- * Returns the return value of platform_device_register().
- */
-int omap_device_register(struct platform_device *pdev)
-{
-       pr_debug("omap_device: %s: registering\n", pdev->name);
-
-       pdev->dev.pm_domain = &omap_device_pm_domain;
-       return platform_device_add(pdev);
-}
-
-
-/* Public functions for use by device drivers through struct platform_data */
-
-/**
- * omap_device_enable - fully activate an omap_device
- * @od: struct omap_device * to activate
- *
- * Do whatever is necessary for the hwmods underlying omap_device @od
- * to be accessible and ready to operate.  This generally involves
- * enabling clocks, setting SYSCONFIG registers; and in the future may
- * involve remuxing pins.  Device drivers should call this function
- * (through platform_data function pointers) where they would normally
- * enable clocks, etc.  Returns -EINVAL if called when the omap_device
- * is already enabled, or passes along the return value of
- * _omap_device_activate().
- */
-int omap_device_enable(struct platform_device *pdev)
-{
-       int ret;
-       struct omap_device *od;
-
-       od = to_omap_device(pdev);
-
-       if (od->_state == OMAP_DEVICE_STATE_ENABLED) {
-               dev_warn(&pdev->dev,
-                        "omap_device: %s() called from invalid state %d\n",
-                        __func__, od->_state);
-               return -EINVAL;
-       }
-
-       /* Enable everything if we're enabling this device from scratch */
-       if (od->_state == OMAP_DEVICE_STATE_UNKNOWN)
-               od->pm_lat_level = od->pm_lats_cnt;
-
-       ret = _omap_device_activate(od, IGNORE_WAKEUP_LAT);
-
-       od->dev_wakeup_lat = 0;
-       od->_dev_wakeup_lat_limit = UINT_MAX;
-       od->_state = OMAP_DEVICE_STATE_ENABLED;
-
-       return ret;
-}
-
-/**
- * omap_device_idle - idle an omap_device
- * @od: struct omap_device * to idle
- *
- * Idle omap_device @od by calling as many .deactivate_func() entries
- * in the omap_device's pm_lats table as is possible without exceeding
- * the device's maximum wakeup latency limit, pm_lat_limit.  Device
- * drivers should call this function (through platform_data function
- * pointers) where they would normally disable clocks after operations
- * complete, etc..  Returns -EINVAL if the omap_device is not
- * currently enabled, or passes along the return value of
- * _omap_device_deactivate().
- */
-int omap_device_idle(struct platform_device *pdev)
-{
-       int ret;
-       struct omap_device *od;
-
-       od = to_omap_device(pdev);
-
-       if (od->_state != OMAP_DEVICE_STATE_ENABLED) {
-               dev_warn(&pdev->dev,
-                        "omap_device: %s() called from invalid state %d\n",
-                        __func__, od->_state);
-               return -EINVAL;
-       }
-
-       ret = _omap_device_deactivate(od, USE_WAKEUP_LAT);
-
-       od->_state = OMAP_DEVICE_STATE_IDLE;
-
-       return ret;
-}
-
-/**
- * omap_device_shutdown - shut down an omap_device
- * @od: struct omap_device * to shut down
- *
- * Shut down omap_device @od by calling all .deactivate_func() entries
- * in the omap_device's pm_lats table and then shutting down all of
- * the underlying omap_hwmods.  Used when a device is being "removed"
- * or a device driver is being unloaded.  Returns -EINVAL if the
- * omap_device is not currently enabled or idle, or passes along the
- * return value of _omap_device_deactivate().
- */
-int omap_device_shutdown(struct platform_device *pdev)
-{
-       int ret, i;
-       struct omap_device *od;
-
-       od = to_omap_device(pdev);
-
-       if (od->_state != OMAP_DEVICE_STATE_ENABLED &&
-           od->_state != OMAP_DEVICE_STATE_IDLE) {
-               dev_warn(&pdev->dev,
-                        "omap_device: %s() called from invalid state %d\n",
-                        __func__, od->_state);
-               return -EINVAL;
-       }
-
-       ret = _omap_device_deactivate(od, IGNORE_WAKEUP_LAT);
-
-       for (i = 0; i < od->hwmods_cnt; i++)
-               omap_hwmod_shutdown(od->hwmods[i]);
-
-       od->_state = OMAP_DEVICE_STATE_SHUTDOWN;
-
-       return ret;
-}
-
-/**
- * omap_device_assert_hardreset - set a device's hardreset line
- * @pdev: struct platform_device * to reset
- * @name: const char * name of the reset line
- *
- * Set the hardreset line identified by @name on the IP blocks
- * associated with the hwmods backing the platform_device @pdev.  All
- * of the hwmods associated with @pdev must have the same hardreset
- * line linked to them for this to work.  Passes along the return value
- * of omap_hwmod_assert_hardreset() in the event of any failure, or
- * returns 0 upon success.
- */
-int omap_device_assert_hardreset(struct platform_device *pdev, const char *name)
-{
-       struct omap_device *od = to_omap_device(pdev);
-       int ret = 0;
-       int i;
-
-       for (i = 0; i < od->hwmods_cnt; i++) {
-               ret = omap_hwmod_assert_hardreset(od->hwmods[i], name);
-               if (ret)
-                       break;
-       }
-
-       return ret;
-}
-
-/**
- * omap_device_deassert_hardreset - release a device's hardreset line
- * @pdev: struct platform_device * to reset
- * @name: const char * name of the reset line
- *
- * Release the hardreset line identified by @name on the IP blocks
- * associated with the hwmods backing the platform_device @pdev.  All
- * of the hwmods associated with @pdev must have the same hardreset
- * line linked to them for this to work.  Passes along the return
- * value of omap_hwmod_deassert_hardreset() in the event of any
- * failure, or returns 0 upon success.
- */
-int omap_device_deassert_hardreset(struct platform_device *pdev,
-                                  const char *name)
-{
-       struct omap_device *od = to_omap_device(pdev);
-       int ret = 0;
-       int i;
-
-       for (i = 0; i < od->hwmods_cnt; i++) {
-               ret = omap_hwmod_deassert_hardreset(od->hwmods[i], name);
-               if (ret)
-                       break;
-       }
-
-       return ret;
-}
-
-/**
- * omap_device_align_pm_lat - activate/deactivate device to match wakeup lat lim
- * @od: struct omap_device *
- *
- * When a device's maximum wakeup latency limit changes, call some of
- * the .activate_func or .deactivate_func function pointers in the
- * omap_device's pm_lats array to ensure that the device's maximum
- * wakeup latency is less than or equal to the new latency limit.
- * Intended to be called by OMAP PM code whenever a device's maximum
- * wakeup latency limit changes (e.g., via
- * omap_pm_set_dev_wakeup_lat()).  Returns 0 if nothing needs to be
- * done (e.g., if the omap_device is not currently idle, or if the
- * wakeup latency is already current with the new limit) or passes
- * along the return value of _omap_device_deactivate() or
- * _omap_device_activate().
- */
-int omap_device_align_pm_lat(struct platform_device *pdev,
-                            u32 new_wakeup_lat_limit)
-{
-       int ret = -EINVAL;
-       struct omap_device *od;
-
-       od = to_omap_device(pdev);
-
-       if (new_wakeup_lat_limit == od->dev_wakeup_lat)
-               return 0;
-
-       od->_dev_wakeup_lat_limit = new_wakeup_lat_limit;
-
-       if (od->_state != OMAP_DEVICE_STATE_IDLE)
-               return 0;
-       else if (new_wakeup_lat_limit > od->dev_wakeup_lat)
-               ret = _omap_device_deactivate(od, USE_WAKEUP_LAT);
-       else if (new_wakeup_lat_limit < od->dev_wakeup_lat)
-               ret = _omap_device_activate(od, USE_WAKEUP_LAT);
-
-       return ret;
-}
-
-/**
- * omap_device_get_pwrdm - return the powerdomain * associated with @od
- * @od: struct omap_device *
- *
- * Return the powerdomain associated with the first underlying
- * omap_hwmod for this omap_device.  Intended for use by core OMAP PM
- * code.  Returns NULL on error or a struct powerdomain * upon
- * success.
- */
-struct powerdomain *omap_device_get_pwrdm(struct omap_device *od)
-{
-       /*
-        * XXX Assumes that all omap_hwmod powerdomains are identical.
-        * This may not necessarily be true.  There should be a sanity
-        * check in here to WARN() if any difference appears.
-        */
-       if (!od->hwmods_cnt)
-               return NULL;
-
-       return omap_hwmod_get_pwrdm(od->hwmods[0]);
-}
-
-/**
- * omap_device_get_mpu_rt_va - return the MPU's virtual addr for the hwmod base
- * @od: struct omap_device *
- *
- * Return the MPU's virtual address for the base of the hwmod, from
- * the ioremap() that the hwmod code does.  Only valid if there is one
- * hwmod associated with this device.  Returns NULL if there are zero
- * or more than one hwmods associated with this omap_device;
- * otherwise, passes along the return value from
- * omap_hwmod_get_mpu_rt_va().
- */
-void __iomem *omap_device_get_rt_va(struct omap_device *od)
-{
-       if (od->hwmods_cnt != 1)
-               return NULL;
-
-       return omap_hwmod_get_mpu_rt_va(od->hwmods[0]);
-}
-
-/**
- * omap_device_get_by_hwmod_name() - convert a hwmod name to
- * device pointer.
- * @oh_name: name of the hwmod device
- *
- * Returns back a struct device * pointer associated with a hwmod
- * device represented by a hwmod_name
- */
-struct device *omap_device_get_by_hwmod_name(const char *oh_name)
-{
-       struct omap_hwmod *oh;
-
-       if (!oh_name) {
-               WARN(1, "%s: no hwmod name!\n", __func__);
-               return ERR_PTR(-EINVAL);
-       }
-
-       oh = omap_hwmod_lookup(oh_name);
-       if (IS_ERR_OR_NULL(oh)) {
-               WARN(1, "%s: no hwmod for %s\n", __func__,
-                       oh_name);
-               return ERR_PTR(oh ? PTR_ERR(oh) : -ENODEV);
-       }
-       if (IS_ERR_OR_NULL(oh->od)) {
-               WARN(1, "%s: no omap_device for %s\n", __func__,
-                       oh_name);
-               return ERR_PTR(oh->od ? PTR_ERR(oh->od) : -ENODEV);
-       }
-
-       if (IS_ERR_OR_NULL(oh->od->pdev))
-               return ERR_PTR(oh->od->pdev ? PTR_ERR(oh->od->pdev) : -ENODEV);
-
-       return &oh->od->pdev->dev;
-}
-EXPORT_SYMBOL(omap_device_get_by_hwmod_name);
-
-/*
- * Public functions intended for use in omap_device_pm_latency
- * .activate_func and .deactivate_func function pointers
- */
-
-/**
- * omap_device_enable_hwmods - call omap_hwmod_enable() on all hwmods
- * @od: struct omap_device *od
- *
- * Enable all underlying hwmods.  Returns 0.
- */
-int omap_device_enable_hwmods(struct omap_device *od)
-{
-       int i;
-
-       for (i = 0; i < od->hwmods_cnt; i++)
-               omap_hwmod_enable(od->hwmods[i]);
-
-       /* XXX pass along return value here? */
-       return 0;
-}
-
-/**
- * omap_device_idle_hwmods - call omap_hwmod_idle() on all hwmods
- * @od: struct omap_device *od
- *
- * Idle all underlying hwmods.  Returns 0.
- */
-int omap_device_idle_hwmods(struct omap_device *od)
-{
-       int i;
-
-       for (i = 0; i < od->hwmods_cnt; i++)
-               omap_hwmod_idle(od->hwmods[i]);
-
-       /* XXX pass along return value here? */
-       return 0;
-}
-
-/**
- * omap_device_disable_clocks - disable all main and interface clocks
- * @od: struct omap_device *od
- *
- * Disable the main functional clock and interface clock for all of the
- * omap_hwmods associated with the omap_device.  Returns 0.
- */
-int omap_device_disable_clocks(struct omap_device *od)
-{
-       int i;
-
-       for (i = 0; i < od->hwmods_cnt; i++)
-               omap_hwmod_disable_clocks(od->hwmods[i]);
-
-       /* XXX pass along return value here? */
-       return 0;
-}
-
-/**
- * omap_device_enable_clocks - enable all main and interface clocks
- * @od: struct omap_device *od
- *
- * Enable the main functional clock and interface clock for all of the
- * omap_hwmods associated with the omap_device.  Returns 0.
- */
-int omap_device_enable_clocks(struct omap_device *od)
-{
-       int i;
-
-       for (i = 0; i < od->hwmods_cnt; i++)
-               omap_hwmod_enable_clocks(od->hwmods[i]);
-
-       /* XXX pass along return value here? */
-       return 0;
-}
-
-static struct notifier_block platform_nb = {
-       .notifier_call = _omap_device_notifier_call,
-};
-
-static int __init omap_device_init(void)
-{
-       bus_register_notifier(&platform_bus_type, &platform_nb);
-       return 0;
-}
-core_initcall(omap_device_init);
-
-/**
- * omap_device_late_idle - idle devices without drivers
- * @dev: struct device * associated with omap_device
- * @data: unused
- *
- * Check the driver bound status of this device, and idle it
- * if there is no driver attached.
- */
-static int __init omap_device_late_idle(struct device *dev, void *data)
-{
-       struct platform_device *pdev = to_platform_device(dev);
-       struct omap_device *od = to_omap_device(pdev);
-
-       if (!od)
-               return 0;
-
-       /*
-        * If omap_device state is enabled, but has no driver bound,
-        * idle it.
-        */
-       if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER) {
-               if (od->_state == OMAP_DEVICE_STATE_ENABLED) {
-                       dev_warn(dev, "%s: enabled but no driver.  Idling\n",
-                                __func__);
-                       omap_device_idle(pdev);
-               }
-       }
-
-       return 0;
-}
-
-static int __init omap_device_late_init(void)
-{
-       bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle);
-       return 0;
-}
-late_initcall(omap_device_late_init);
index 28acb383e7df0182d5538a1c47d9c23b7dafb2f9..70dcc225157f312d209d14c53180048e75147796 100644 (file)
@@ -25,8 +25,8 @@
 
 #include <asm/mach/map.h>
 
-#include <plat/sram.h>
-#include <plat/cpu.h>
+#include "../mach-omap1/soc.h"
+#include "../mach-omap2/soc.h"
 
 #include "sram.h"
 
index 29b43ef97f20eca9b499c68e76ef01f6569c8799..cefda2e098696e69a90fba5b2ab707c5a412ecf0 100644 (file)
@@ -1,6 +1,107 @@
-#ifndef __PLAT_OMAP_SRAM_H__
-#define __PLAT_OMAP_SRAM_H__
+/*
+ * arch/arm/plat-omap/include/mach/sram.h
+ *
+ * Interface for functions that need to be run in internal SRAM
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
 
-extern int __init omap_sram_init(void);
+#ifndef __ARCH_ARM_OMAP_SRAM_H
+#define __ARCH_ARM_OMAP_SRAM_H
 
-#endif /* __PLAT_OMAP_SRAM_H__ */
+#ifndef __ASSEMBLY__
+#include <asm/fncpy.h>
+
+int __init omap_sram_init(void);
+
+extern void *omap_sram_push_address(unsigned long size);
+
+/* Macro to push a function to the internal SRAM, using the fncpy API */
+#define omap_sram_push(funcp, size) ({                         \
+       typeof(&(funcp)) _res = NULL;                           \
+       void *_sram_address = omap_sram_push_address(size);     \
+       if (_sram_address)                                      \
+               _res = fncpy(_sram_address, &(funcp), size);    \
+       _res;                                                   \
+})
+
+extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
+
+extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
+                               u32 base_cs, u32 force_unlock);
+extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
+                                     u32 mem_type);
+extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass);
+
+extern u32 omap3_configure_core_dpll(
+                       u32 m2, u32 unlock_dll, u32 f, u32 inc,
+                       u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
+                       u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
+                       u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
+                       u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
+extern void omap3_sram_restore_context(void);
+
+/* Do not use these */
+extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
+extern unsigned long omap1_sram_reprogram_clock_sz;
+
+extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
+extern unsigned long omap24xx_sram_reprogram_clock_sz;
+
+extern void omap242x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
+                                               u32 base_cs, u32 force_unlock);
+extern unsigned long omap242x_sram_ddr_init_sz;
+
+extern u32 omap242x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val,
+                                               int bypass);
+extern unsigned long omap242x_sram_set_prcm_sz;
+
+extern void omap242x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
+                                               u32 mem_type);
+extern unsigned long omap242x_sram_reprogram_sdrc_sz;
+
+
+extern void omap243x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
+                                               u32 base_cs, u32 force_unlock);
+extern unsigned long omap243x_sram_ddr_init_sz;
+
+extern u32 omap243x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val,
+                                               int bypass);
+extern unsigned long omap243x_sram_set_prcm_sz;
+
+extern void omap243x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
+                                               u32 mem_type);
+extern unsigned long omap243x_sram_reprogram_sdrc_sz;
+
+extern u32 omap3_sram_configure_core_dpll(
+                       u32 m2, u32 unlock_dll, u32 f, u32 inc,
+                       u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
+                       u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
+                       u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
+                       u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
+extern unsigned long omap3_sram_configure_core_dpll_sz;
+
+#ifdef CONFIG_PM
+extern void omap_push_sram_idle(void);
+#else
+static inline void omap_push_sram_idle(void) {}
+#endif /* CONFIG_PM */
+
+#endif /* __ASSEMBLY__ */
+
+/*
+ * OMAP2+: define the SRAM PA addresses.
+ * Used by the SRAM management code and the idle sleep code.
+ */
+#define OMAP2_SRAM_PA          0x40200000
+#define OMAP3_SRAM_PA           0x40200000
+#ifdef CONFIG_OMAP4_ERRATA_I688
+#define OMAP4_SRAM_PA          0x40304000
+#define OMAP4_SRAM_VA          0xfe404000
+#else
+#define OMAP4_SRAM_PA          0x40300000
+#endif
+#define AM33XX_SRAM_PA         0x40300000
+#endif
index 7ff68c9460737d7b016763475c9a01dfdf882a57..ef54a59a9e89cba5e4920b8733aeea067d19d9e5 100644 (file)
@@ -22,6 +22,7 @@ config ARM64
        select HAVE_PERF_EVENTS
        select HAVE_SPARSE_IRQ
        select IRQ_DOMAIN
+       select MODULES_USE_ELF_RELA
        select NO_BOOTMEM
        select OF
        select OF_EARLY_FLATTREE
index fe77e51a7847bf872ebcc7cb18102d71c1b0af4a..a581a2205938db09064604a53244b756ca650d0a 100644 (file)
@@ -18,7 +18,6 @@ generic-y += ipcbuf.h
 generic-y += irq_regs.h
 generic-y += kdebug.h
 generic-y += kmap_types.h
-generic-y += linkage.h
 generic-y += local.h
 generic-y += local64.h
 generic-y += mman.h
diff --git a/arch/arm64/include/asm/linkage.h b/arch/arm64/include/asm/linkage.h
new file mode 100644 (file)
index 0000000..636c1bc
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef __ASM_LINKAGE_H
+#define __ASM_LINKAGE_H
+
+#define __ALIGN                .align 4
+#define __ALIGN_STR    ".align 4"
+
+#endif
index 39a208a392f7df5b372c2cda150f2164121e8446..5d810044fedabf7fb897ffc603c3f8a3aae271db 100644 (file)
@@ -92,30 +92,20 @@ static inline void start_thread_common(struct pt_regs *regs, unsigned long pc)
 static inline void start_thread(struct pt_regs *regs, unsigned long pc,
                                unsigned long sp)
 {
-       unsigned long *stack = (unsigned long *)sp;
-
        start_thread_common(regs, pc);
        regs->pstate = PSR_MODE_EL0t;
        regs->sp = sp;
-       regs->regs[2] = stack[2];       /* x2 (envp) */
-       regs->regs[1] = stack[1];       /* x1 (argv) */
-       regs->regs[0] = stack[0];       /* x0 (argc) */
 }
 
 #ifdef CONFIG_COMPAT
 static inline void compat_start_thread(struct pt_regs *regs, unsigned long pc,
                                       unsigned long sp)
 {
-       unsigned int *stack = (unsigned int *)sp;
-
        start_thread_common(regs, pc);
        regs->pstate = COMPAT_PSR_MODE_USR;
        if (pc & 1)
                regs->pstate |= COMPAT_PSR_T_BIT;
        regs->compat_sp = sp;
-       regs->regs[2] = stack[2];       /* x2 (envp) */
-       regs->regs[1] = stack[1];       /* x1 (argv) */
-       regs->regs[0] = stack[0];       /* x0 (argc) */
 }
 #endif
 
index 9b131b4efa0bb1caaa51348be06be65950d10aca..6913643bbe54ebd5005bfeb74302329fa5e2d0f5 100644 (file)
@@ -79,13 +79,14 @@ struct user_fpsimd_state {
 
 struct user_hwdebug_state {
        __u32           dbg_info;
+       __u32           pad;
        struct {
                __u64   addr;
                __u32   ctrl;
+               __u32   pad;
        }               dbg_regs[16];
 };
 
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* _UAPI__ASM_PTRACE_H */
index 2ea3968367c265f99830db7f365668919f5f6a7c..6e1e77f1831c0cb0bf31306822ebc72ba8d3158a 100644 (file)
@@ -234,28 +234,33 @@ static int ptrace_hbp_fill_attr_ctrl(unsigned int note_type,
                                     struct arch_hw_breakpoint_ctrl ctrl,
                                     struct perf_event_attr *attr)
 {
-       int err, len, type;
+       int err, len, type, disabled = !ctrl.enabled;
 
-       err = arch_bp_generic_fields(ctrl, &len, &type);
-       if (err)
-               return err;
-
-       switch (note_type) {
-       case NT_ARM_HW_BREAK:
-               if ((type & HW_BREAKPOINT_X) != type)
-                       return -EINVAL;
-               break;
-       case NT_ARM_HW_WATCH:
-               if ((type & HW_BREAKPOINT_RW) != type)
+       if (disabled) {
+               len = 0;
+               type = HW_BREAKPOINT_EMPTY;
+       } else {
+               err = arch_bp_generic_fields(ctrl, &len, &type);
+               if (err)
+                       return err;
+
+               switch (note_type) {
+               case NT_ARM_HW_BREAK:
+                       if ((type & HW_BREAKPOINT_X) != type)
+                               return -EINVAL;
+                       break;
+               case NT_ARM_HW_WATCH:
+                       if ((type & HW_BREAKPOINT_RW) != type)
+                               return -EINVAL;
+                       break;
+               default:
                        return -EINVAL;
-               break;
-       default:
-               return -EINVAL;
+               }
        }
 
        attr->bp_len    = len;
        attr->bp_type   = type;
-       attr->disabled  = !ctrl.enabled;
+       attr->disabled  = disabled;
 
        return 0;
 }
@@ -372,7 +377,7 @@ static int ptrace_hbp_set_addr(unsigned int note_type,
 
 #define PTRACE_HBP_ADDR_SZ     sizeof(u64)
 #define PTRACE_HBP_CTRL_SZ     sizeof(u32)
-#define PTRACE_HBP_REG_OFF     sizeof(u32)
+#define PTRACE_HBP_PAD_SZ      sizeof(u32)
 
 static int hw_break_get(struct task_struct *target,
                        const struct user_regset *regset,
@@ -380,7 +385,7 @@ static int hw_break_get(struct task_struct *target,
                        void *kbuf, void __user *ubuf)
 {
        unsigned int note_type = regset->core_note_type;
-       int ret, idx = 0, offset = PTRACE_HBP_REG_OFF, limit;
+       int ret, idx = 0, offset, limit;
        u32 info, ctrl;
        u64 addr;
 
@@ -389,11 +394,20 @@ static int hw_break_get(struct task_struct *target,
        if (ret)
                return ret;
 
-       ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, &info, 0, 4);
+       ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, &info, 0,
+                                 sizeof(info));
+       if (ret)
+               return ret;
+
+       /* Pad */
+       offset = offsetof(struct user_hwdebug_state, pad);
+       ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf, offset,
+                                      offset + PTRACE_HBP_PAD_SZ);
        if (ret)
                return ret;
 
        /* (address, ctrl) registers */
+       offset = offsetof(struct user_hwdebug_state, dbg_regs);
        limit = regset->n * regset->size;
        while (count && offset < limit) {
                ret = ptrace_hbp_get_addr(note_type, target, idx, &addr);
@@ -413,6 +427,13 @@ static int hw_break_get(struct task_struct *target,
                if (ret)
                        return ret;
                offset += PTRACE_HBP_CTRL_SZ;
+
+               ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf,
+                                              offset,
+                                              offset + PTRACE_HBP_PAD_SZ);
+               if (ret)
+                       return ret;
+               offset += PTRACE_HBP_PAD_SZ;
                idx++;
        }
 
@@ -425,12 +446,13 @@ static int hw_break_set(struct task_struct *target,
                        const void *kbuf, const void __user *ubuf)
 {
        unsigned int note_type = regset->core_note_type;
-       int ret, idx = 0, offset = PTRACE_HBP_REG_OFF, limit;
+       int ret, idx = 0, offset, limit;
        u32 ctrl;
        u64 addr;
 
-       /* Resource info */
-       ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, 4);
+       /* Resource info and pad */
+       offset = offsetof(struct user_hwdebug_state, dbg_regs);
+       ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, offset);
        if (ret)
                return ret;
 
@@ -454,6 +476,13 @@ static int hw_break_set(struct task_struct *target,
                if (ret)
                        return ret;
                offset += PTRACE_HBP_CTRL_SZ;
+
+               ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
+                                               offset,
+                                               offset + PTRACE_HBP_PAD_SZ);
+               if (ret)
+                       return ret;
+               offset += PTRACE_HBP_PAD_SZ;
                idx++;
        }
 
index 48ffb9fb3fe3619c6bc600452554e6e76b29ec51..7665a9bfdb1e53ebe689033eac02a78d8cf7ab99 100644 (file)
@@ -170,7 +170,19 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)
 
 void __init early_init_dt_add_memory_arch(u64 base, u64 size)
 {
+       base &= PAGE_MASK;
        size &= PAGE_MASK;
+       if (base + size < PHYS_OFFSET) {
+               pr_warning("Ignoring memory block 0x%llx - 0x%llx\n",
+                          base, base + size);
+               return;
+       }
+       if (base < PHYS_OFFSET) {
+               pr_warning("Ignoring memory range 0x%llx - 0x%llx\n",
+                          base, PHYS_OFFSET);
+               size -= PHYS_OFFSET - base;
+               base = PHYS_OFFSET;
+       }
        memblock_add(base, size);
 }
 
index b711525be21fb0116ecdfacdeeb7d0d7ca89ec73..226b6bf6e9c296ffbc0c94599b17222d69cae15d 100644 (file)
@@ -46,7 +46,6 @@
 #include <asm/sections.h>
 #include <asm/tlbflush.h>
 #include <asm/ptrace.h>
-#include <asm/mmu_context.h>
 
 /*
  * as from 2.5, kernels no longer have an init_tasks structure
index 17948fc7d663b21269f3ae738ea545b0df9ceb09..ba457943a16b26f8fb3301ef2f65e192ccbe3c94 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/slab.h>
+#include <linux/timekeeper_internal.h>
 #include <linux/vmalloc.h>
 
 #include <asm/cacheflush.h>
@@ -222,11 +223,10 @@ struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
 /*
  * Update the vDSO data page to keep in sync with kernel timekeeping.
  */
-void update_vsyscall(struct timespec *ts, struct timespec *wtm,
-                    struct clocksource *clock, u32 mult)
+void update_vsyscall(struct timekeeper *tk)
 {
        struct timespec xtime_coarse;
-       u32 use_syscall = strcmp(clock->name, "arch_sys_counter");
+       u32 use_syscall = strcmp(tk->clock->name, "arch_sys_counter");
 
        ++vdso_data->tb_seq_count;
        smp_wmb();
@@ -237,13 +237,13 @@ void update_vsyscall(struct timespec *ts, struct timespec *wtm,
        vdso_data->xtime_coarse_nsec            = xtime_coarse.tv_nsec;
 
        if (!use_syscall) {
-               vdso_data->cs_cycle_last        = clock->cycle_last;
-               vdso_data->xtime_clock_sec      = ts->tv_sec;
-               vdso_data->xtime_clock_nsec     = ts->tv_nsec;
-               vdso_data->cs_mult              = mult;
-               vdso_data->cs_shift             = clock->shift;
-               vdso_data->wtm_clock_sec        = wtm->tv_sec;
-               vdso_data->wtm_clock_nsec       = wtm->tv_nsec;
+               vdso_data->cs_cycle_last        = tk->clock->cycle_last;
+               vdso_data->xtime_clock_sec      = tk->xtime_sec;
+               vdso_data->xtime_clock_nsec     = tk->xtime_nsec >> tk->shift;
+               vdso_data->cs_mult              = tk->mult;
+               vdso_data->cs_shift             = tk->shift;
+               vdso_data->wtm_clock_sec        = tk->wall_to_monotonic.tv_sec;
+               vdso_data->wtm_clock_nsec       = tk->wall_to_monotonic.tv_nsec;
        }
 
        smp_wmb();
index 002732960315ee429d3cce6a95c8a0440064c64d..ee0beb354e4df38e0c067410e8f9643deec2856f 100644 (file)
@@ -867,8 +867,8 @@ ret_from_fork:
 ret_from_kernel_thread:
        lddi.p          @(gr28,#REG_GR(8)),gr20
        call            schedule_tail
-       or.p            gr20,gr20,gr8
-       calll           @(gr21,gr0)
+       calll.p         @(gr21,gr0)
+       or              gr20,gr20,gr8
        bra             sys_exit
 
        .globl          ret_from_kernel_execve
index 655d90d20bb0cad25df015e7bdc9dee6dbf4e37b..e1e3aa196aa4c25adcb33ed09fe1296b4be8e69d 100644 (file)
@@ -194,7 +194,7 @@ int copy_thread(unsigned long clone_flags,
                memset(childregs, 0, sizeof(struct pt_regs));
                childregs->gr9 = usp; /* function */
                childregs->gr8 = arg;
-               chilregs->psr = PSR_S;
+               childregs->psr = PSR_S;
                p->thread.pc = (unsigned long) ret_from_kernel_thread;
                save_user_regs(p->thread.user);
                return 0;
index 1f1e5efb338514c17171b31c037427d1d5c5d5a4..b8993c87d3de8473d95141560fdb82aef0aa1085 100644 (file)
@@ -112,9 +112,11 @@ char __initdata redboot_command_line[COMMAND_LINE_SIZE];
 #ifdef CONFIG_PM
 #define __pminit
 #define __pminitdata
+#define __pminitconst
 #else
 #define __pminit __init
 #define __pminitdata __initdata
+#define __pminitconst __initconst
 #endif
 
 struct clock_cmode {
index 3364b6966d268b3f82fda0ae501be048b6d858c1..3bfa9b30f448b3f464d5087ba622f6dde4523446 100644 (file)
@@ -1,8 +1,5 @@
-include include/asm-generic/Kbuild.asm
 
-header-y += registers.h
 header-y += ucontext.h
-header-y += user.h
 
 generic-y += auxvec.h
 generic-y += bug.h
index 3e258043337b322a44322bfda4b2eb1f70595df5..468fbb0781cdfb9a4ebc6d2b1b2a7ccb16c55dd3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Atomic operations for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  *
  * This program is free software; you can redistribute it and/or modify
index a4ed6e26cb1df2948d4ac74132854ca3865d5665..1041a8e70ce85cea7e8b2d9372dbb8fef19c8496 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Memory barrier definitions for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 4caa649ad78b06551120f7be0749e2e986892132..9b1e4afbab3c6530c2e28b0179ac0597ed567137 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Bit operations for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  *
  * This program is free software; you can redistribute it and/or modify
diff --git a/arch/hexagon/include/asm/bitsperlong.h b/arch/hexagon/include/asm/bitsperlong.h
deleted file mode 100644 (file)
index 2701cae..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-#ifndef __ASM_HEXAGON_BITSPERLONG_H
-#define __ASM_HEXAGON_BITSPERLONG_H
-
-#define __BITS_PER_LONG 32
-
-#include <asm-generic/bitsperlong.h>
-
-#endif
diff --git a/arch/hexagon/include/asm/byteorder.h b/arch/hexagon/include/asm/byteorder.h
deleted file mode 100644 (file)
index 0e19b9f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-#ifndef _ASM_BYTEORDER_H
-#define _ASM_BYTEORDER_H
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#endif
-
-#include <linux/byteorder/little_endian.h>
-
-#endif /* _ASM_BYTEORDER_H */
index 0f01de2eb4abf9fc8b6bc58d548c652782221ff5..f4ca594fdf8c258a13d1d2e99849a820041442f8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Cache definitions for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 6865c1be927a1662bbf4c27148dfbadf7d0e6945..49e0896ec2401464f93ef32ba4f279d1ca88181c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Cache flush operations for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 3ce4ecd44f824c54502f8b2e39e7b636d3b663aa..46ec8a7fd65f876a0de86d36abd5392bf505c1c2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index c5f9527e1df6983c4a7c90694781596377c64e13..9e7802911a57f22b01d9f6852d3c11b2f34c1869 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * xchg/cmpxchg operations for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  *
  * This program is free software; you can redistribute it and/or modify
index 9ab12e9a872bcaf025396e09ef58384e3971f34c..53079719d6678d4105437986a371f901966a4c39 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 233ed3d2d25e61ede6d63ccff367f860c969f421..85e9935660cbaf70626f61bda3e6a4a3f60cc0ef 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * DMA operations for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index da6d2f61a93a9ff2491f81cd677dd14c8d68631d..9e34ff49f3b7d22536c4c9111e885bdf105f344e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 82b499621e052f2a272cd137c81f23c84fe2ccf3..1ba4b3bff5edee550741adfb7762e6eb7f34bae2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * ELF definitions for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 350e6d497d44732edf3270609a965eb0e07322f5..c32b2132614bae75f7f0fbf1fee5906754d43e55 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Process execution related definitions for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index b27f4941645b3fedefc9297b60795e07b46c9c3c..b75b6bf4269c6a3e2a3152f1402f5ae63cfd5a65 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Fixmap support for Hexagon - enough to support highmem features
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 182cb9d547691748075b632acd29878655a107a5..c144bee6cabe506afc9f99071ad741c9727da8d7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Declarations for to Hexagon Virtal Machine.
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 1c02186d2e9a18da7639248570e57bd91f2a49c5..ca587737fb2af875d5ee1edd21942092c9333182 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index b3acc2cc71bff7277cedb0dc32c5c291bc523d4b..e527cfeff5bac6dd18473deb1930ffc77034c13f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * IO definitions for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index ded8c15cf3e50548348f13acde7bcbe33871536c..51661db389d6f0c9f14cdecdc57f60a45408a790 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index ec1523655416f641cae39ca3a98afb20db960104..e5fd9492d60fbcdc65259e1f6d38d62dbeea6ac6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * IRQ support for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 9e8779702f100b0dd651871738ed332bf90b2eea..32a6fb66944a96e889a2b861d0f461b3a115d332 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/hexagon/include/asm/kgdb.h - Hexagon KGDB Support
  *
- * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
diff --git a/arch/hexagon/include/asm/kvm_para.h b/arch/hexagon/include/asm/kvm_para.h
deleted file mode 100644 (file)
index 14fab8f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/kvm_para.h>
index a00b85f680b8f0ef63386623f9b7fbe05110bbce..31b4cbe7e5831c3c9e59d6b874a749c0f5ba0423 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 72e5dcda79f5078ad227445eaa0ce480d3efa4f4..af16e977c55ee4a43cb56e0087c13935640541cf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Memory layout definitions for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 30a5d8d2659d9f4acf1ba7bb0ee06208673746e5..2288b19fd0f2d09cf3107419fac8d05775053ea3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index b4fe5a5411b6f9cba29a590a68b5fa879cdbd82e..d423d2e73c3088d428e1a48de233d2f0d752dc05 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * MM context support for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 72ba494e6d7d5e2e8452465e6eb5ec8947e9aedd..6b4323acef44161a0970d00473029b96e9d52613 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index edd97626c482eb3b3e71e74f75699b55eebe9cf9..692adc213429a3e2d85a6c7955e43d54ba62261e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Page management definitions for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
diff --git a/arch/hexagon/include/asm/param.h b/arch/hexagon/include/asm/param.h
deleted file mode 100644 (file)
index 285344b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-#ifndef _ASM_PARAM_H
-#define _ASM_PARAM_H
-
-#define EXEC_PAGESIZE  16384
-
-#include <asm-generic/param.h>
-
-#endif
index 8b8526b491c7ae8d57a10583d8e23d7cedb56d2e..430978b1de381a54aeb09732541138aa8879056b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 13443c7751315e3b8e7c25e1b0f28ab8da6fa3d5..679bf6d664871377ef33a7c16f5cb6b25169c253 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Page table support for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index ca619bf225ef3d5402c02fe0c5ce65b7843c8a7b..20d55f69fe5571cd6a32a1515dbf1db7eb70db61 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Page table support for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index e8ea459002a4cf6adfc824092c87b94a5cacc891..a03323ab9d44040a3db7902b1215615ff9fc5ef2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Process/processor support for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
diff --git a/arch/hexagon/include/asm/ptrace.h b/arch/hexagon/include/asm/ptrace.h
deleted file mode 100644 (file)
index 3d2f607..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Ptrace definitions for the Hexagon architecture
- *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-#ifndef _ASM_PTRACE_H
-#define _ASM_PTRACE_H
-
-#include <asm/registers.h>
-
-#define instruction_pointer(regs) pt_elr(regs)
-#define user_stack_pointer(regs) ((regs)->r29)
-
-#define profile_pc(regs) instruction_pointer(regs)
-
-/* kprobe-based event tracer support */
-extern int regs_query_register_offset(const char *name);
-extern const char *regs_query_register_name(unsigned int offset);
-
-#endif
diff --git a/arch/hexagon/include/asm/registers.h b/arch/hexagon/include/asm/registers.h
deleted file mode 100644 (file)
index 4dd741b..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Register definitions for the Hexagon architecture
- *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-#ifndef _ASM_REGISTERS_H
-#define _ASM_REGISTERS_H
-
-#define SP r29
-
-#ifndef __ASSEMBLY__
-
-/*  See kernel/entry.S for further documentation.  */
-
-/*
- * Entry code copies the event record out of guest registers into
- * this structure (which is on the stack).
- */
-
-struct hvm_event_record {
-       unsigned long vmel;     /* Event Linkage (return address) */
-       unsigned long vmest;    /* Event context - pre-event SSR values */
-       unsigned long vmpsp;    /* Previous stack pointer */
-       unsigned long vmbadva;  /* Bad virtual address for addressing events */
-};
-
-struct pt_regs {
-       long restart_r0;        /* R0 checkpoint for syscall restart */
-       long syscall_nr;        /* Only used in system calls */
-       union {
-               struct {
-                       unsigned long usr;
-                       unsigned long preds;
-               };
-               long long int predsusr;
-       };
-       union {
-               struct {
-                       unsigned long m0;
-                       unsigned long m1;
-               };
-               long long int m1m0;
-       };
-       union {
-               struct {
-                       unsigned long sa1;
-                       unsigned long lc1;
-               };
-               long long int lc1sa1;
-       };
-       union {
-               struct {
-                       unsigned long sa0;
-                       unsigned long lc0;
-               };
-               long long int lc0sa0;
-       };
-       union {
-               struct {
-                       unsigned long gp;
-                       unsigned long ugp;
-               };
-               long long int ugpgp;
-       };
-       /*
-       * Be extremely careful with rearranging these, if at all.  Some code
-       * assumes the 32 registers exist exactly like this in memory;
-       * e.g. kernel/ptrace.c
-       * e.g. kernel/signal.c (restore_sigcontext)
-       */
-       union {
-               struct {
-                       unsigned long r00;
-                       unsigned long r01;
-               };
-               long long int r0100;
-       };
-       union {
-               struct {
-                       unsigned long r02;
-                       unsigned long r03;
-               };
-               long long int r0302;
-       };
-       union {
-               struct {
-                       unsigned long r04;
-                       unsigned long r05;
-               };
-               long long int r0504;
-       };
-       union {
-               struct {
-                       unsigned long r06;
-                       unsigned long r07;
-               };
-               long long int r0706;
-       };
-       union {
-               struct {
-                       unsigned long r08;
-                       unsigned long r09;
-               };
-               long long int r0908;
-       };
-       union {
-              struct {
-                       unsigned long r10;
-                       unsigned long r11;
-              };
-              long long int r1110;
-       };
-       union {
-              struct {
-                       unsigned long r12;
-                       unsigned long r13;
-              };
-              long long int r1312;
-       };
-       union {
-              struct {
-                       unsigned long r14;
-                       unsigned long r15;
-              };
-              long long int r1514;
-       };
-       union {
-               struct {
-                       unsigned long r16;
-                       unsigned long r17;
-               };
-               long long int r1716;
-       };
-       union {
-               struct {
-                       unsigned long r18;
-                       unsigned long r19;
-               };
-               long long int r1918;
-       };
-       union {
-               struct {
-                       unsigned long r20;
-                       unsigned long r21;
-               };
-               long long int r2120;
-       };
-       union {
-               struct {
-                       unsigned long r22;
-                       unsigned long r23;
-               };
-               long long int r2322;
-       };
-       union {
-               struct {
-                       unsigned long r24;
-                       unsigned long r25;
-               };
-               long long int r2524;
-       };
-       union {
-               struct {
-                       unsigned long r26;
-                       unsigned long r27;
-               };
-               long long int r2726;
-       };
-       union {
-               struct {
-                       unsigned long r28;
-                       unsigned long r29;
-              };
-              long long int r2928;
-       };
-       union {
-               struct {
-                       unsigned long r30;
-                       unsigned long r31;
-               };
-               long long int r3130;
-       };
-       /* VM dispatch pushes event record onto stack - we can build on it */
-       struct hvm_event_record hvmer;
-};
-
-/* Defines to conveniently access the values  */
-
-/*
- * As of the VM spec 0.5, these registers are now set/retrieved via a
- * VM call.  On the in-bound side, we just fetch the values
- * at the entry points and stuff them into the old record in pt_regs.
- * However, on the outbound side, probably at VM rte, we set the
- * registers back.
- */
-
-#define pt_elr(regs) ((regs)->hvmer.vmel)
-#define pt_set_elr(regs, val) ((regs)->hvmer.vmel = (val))
-#define pt_cause(regs) ((regs)->hvmer.vmest & (HVM_VMEST_CAUSE_MSK))
-#define user_mode(regs) \
-       (((regs)->hvmer.vmest & (HVM_VMEST_UM_MSK << HVM_VMEST_UM_SFT)) != 0)
-#define ints_enabled(regs) \
-       (((regs)->hvmer.vmest & (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)) != 0)
-#define pt_psp(regs) ((regs)->hvmer.vmpsp)
-#define pt_badva(regs) ((regs)->hvmer.vmbadva)
-
-#define pt_set_rte_sp(regs, sp) do {\
-       pt_psp(regs) = (sp);\
-       (regs)->SP = (unsigned long) &((regs)->hvmer);\
-       } while (0)
-
-#define pt_set_kmode(regs) \
-       (regs)->hvmer.vmest = (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)
-
-#define pt_set_usermode(regs) \
-       (regs)->hvmer.vmest = (HVM_VMEST_UM_MSK << HVM_VMEST_UM_SFT) \
-                           | (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)
-
-#endif  /*  ifndef __ASSEMBLY  */
-
-#endif
diff --git a/arch/hexagon/include/asm/setup.h b/arch/hexagon/include/asm/setup.h
deleted file mode 100644 (file)
index 3b754c5..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-#ifndef _ASM_SETUP_H
-#define _ASM_SETUP_H
-
-#include <linux/init.h>
-#include <asm-generic/setup.h>
-
-extern char external_cmdline_buffer;
-
-void __init setup_arch_memory(void);
-
-#endif
diff --git a/arch/hexagon/include/asm/sigcontext.h b/arch/hexagon/include/asm/sigcontext.h
deleted file mode 100644 (file)
index ce6dcd9..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-#ifndef _ASM_SIGCONTEXT_H
-#define _ASM_SIGCONTEXT_H
-
-#include <asm/user.h>
-
-/*
- * Signal context structure - contains all info to do with the state
- * before the signal handler was invoked.  Note: only add new entries
- * to the end of the structure.
- */
-struct sigcontext {
-       struct user_regs_struct sc_regs;
-} __aligned(8);
-
-#endif
diff --git a/arch/hexagon/include/asm/signal.h b/arch/hexagon/include/asm/signal.h
deleted file mode 100644 (file)
index 471c056..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-#ifndef _ASM_SIGNAL_H
-#define _ASM_SIGNAL_H
-
-extern unsigned long __rt_sigtramp_template[2];
-
-#include <asm-generic/signal.h>
-
-#endif
index 87c869a6a897d9e52a17d5f75e0886252458c5fa..2b9b974e09522bcbaac7e0e4deac5935694d31e0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * SMP definitions for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 168a920485a85973d1e78ec4406eacbdd6e9a675..12ca4ebc033855c93879c81bafc65af93b9bde97 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Spinlock support for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  *
  * This program is free software; you can redistribute it and/or modify
index 99b5a7575c21416449c856e17e9a85b15088a6fc..7a906b5214a430602b851775388057bfbc9b59c3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Spinlock support for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index f4489c15942c39cd905eef8760135b69dd371c80..7d37f47a1d070213c9ffbf1c8c2ba6047ffb9958 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 089dd82687919b827f03748cf2bf1c59b9947d73..18b44b557fbc0cf08833bf9ca0ffb795cb1f10cb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
diff --git a/arch/hexagon/include/asm/swab.h b/arch/hexagon/include/asm/swab.h
deleted file mode 100644 (file)
index 99cf0be..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-#ifndef _ASM_SWAB_H
-#define _ASM_SWAB_H
-
-#define __SWAB_64_THRU_32__
-
-#endif
index 28ca0dfb6064fc97d9e414f8ea93e5091ba561b1..96745e7b3e3ca5c02119d206eb82f8f1049eebcc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Task switching definitions for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 3e7d61d38d9761f076c70ccb9dc329ed390c3558..fb0e9d48faa668fe62dc174ac13bf3b5b8a67c87 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Syscall support for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index e4a0aad69cbbb0164bbe3cbbb007aade36c31df7..f7c32406a711a5b619d53037fe76d8689107e3c6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Thread support for the Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 081b82cac9a9d18d02c343d0c42d9878c7115bf6..deda170c03b8ccc8bb336bbb86318534ca424506 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index d80db239a7b6a341f591da7bb237b2daea3b94cb..79912b8c1e5baef2f47c9ebf4135797d60e4136f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Timer support for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index b11c62b23f31050f285bbc1f5723d3a840fb2bde..f63fe132f072ca8323a63d9363178a513d7a28a2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 473abde01d62aa4e7a4c5cf5a7105730da69c781..2f00772cc08a551df873985b29647ac388fb1e55 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index b89a90251225aa74a9daba05f21b6827fd1901ee..62d95a9705c4a319f3ba750bc58a3af702b1618e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * TLB flush support for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 6a407f6e5e24bac942576b048e1a726771446578..ec11285012cf1d3e82943c6c777190acde5a2772 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Trap support for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 7e706eadbf0a2f7f80a10fd5e79bc5de994c634c..e4127e4d6a5bbde7f1d0ec42017df98353177c93 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * User memory access support for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
diff --git a/arch/hexagon/include/asm/unistd.h b/arch/hexagon/include/asm/unistd.h
deleted file mode 100644 (file)
index c0d5565..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Syscall support for Hexagon
- *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-/*
- *  The kernel pulls this unistd.h in three different ways:
- *  1.  the "normal" way which gets all the __NR defines
- *  2.  with __SYSCALL defined to produce function declarations
- *  3.  with __SYSCALL defined to produce syscall table initialization
- *  See also:  syscalltab.c
- */
-
-#define sys_mmap2 sys_mmap_pgoff
-
-#include <asm-generic/unistd.h>
diff --git a/arch/hexagon/include/asm/user.h b/arch/hexagon/include/asm/user.h
deleted file mode 100644 (file)
index 3a55078..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-#ifndef HEXAGON_ASM_USER_H
-#define HEXAGON_ASM_USER_H
-
-/*
- * Layout for registers passed in elf core dumps to userspace.
- *
- * Basically a rearranged subset of "pt_regs".
- *
- * Interested parties:  libc, gdb...
- */
-
-struct user_regs_struct {
-       unsigned long r0;
-       unsigned long r1;
-       unsigned long r2;
-       unsigned long r3;
-       unsigned long r4;
-       unsigned long r5;
-       unsigned long r6;
-       unsigned long r7;
-       unsigned long r8;
-       unsigned long r9;
-       unsigned long r10;
-       unsigned long r11;
-       unsigned long r12;
-       unsigned long r13;
-       unsigned long r14;
-       unsigned long r15;
-       unsigned long r16;
-       unsigned long r17;
-       unsigned long r18;
-       unsigned long r19;
-       unsigned long r20;
-       unsigned long r21;
-       unsigned long r22;
-       unsigned long r23;
-       unsigned long r24;
-       unsigned long r25;
-       unsigned long r26;
-       unsigned long r27;
-       unsigned long r28;
-       unsigned long r29;
-       unsigned long r30;
-       unsigned long r31;
-       unsigned long sa0;
-       unsigned long lc0;
-       unsigned long sa1;
-       unsigned long lc1;
-       unsigned long m0;
-       unsigned long m1;
-       unsigned long usr;
-       unsigned long p3_0;
-       unsigned long gp;
-       unsigned long ugp;
-       unsigned long pc;
-       unsigned long cause;
-       unsigned long badva;
-       unsigned long pad1;  /* pad out to 48 words total */
-       unsigned long pad2;  /* pad out to 48 words total */
-       unsigned long pad3;  /* pad out to 48 words total */
-};
-
-#endif
index 2d95cbba3572cac44663978261d5ea3be6091284..ed08e6c6886d8774e4f892419b2eae25561bbaa9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * vDSO implementation for Hexagon
  *
- * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index cacda36ef5d5cd2ccb44fe6f843bb1de857b1387..9b0e9c50ceda4bc09e94c4376bfcec1746b7529b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 580462de5cca35eb2c0b1e011708d3322e844307..9a94de7969bb5e192f57bb9d5bc6ca877376f23c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Hexagon VM page table entry definitions
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index baebb3da1d44160fc6f6f259886656e6f494b167..c31706c38631b75779b0f472667d5f01fe2c0936 100644 (file)
@@ -1,3 +1,15 @@
 # UAPI Header export list
 include include/uapi/asm-generic/Kbuild.asm
 
+header-y += bitsperlong.h
+header-y += byteorder.h
+header-y += kvm_para.h
+header-y += param.h
+header-y += ptrace.h
+header-y += registers.h
+header-y += setup.h
+header-y += sigcontext.h
+header-y += signal.h
+header-y += swab.h
+header-y += unistd.h
+header-y += user.h
diff --git a/arch/hexagon/include/uapi/asm/bitsperlong.h b/arch/hexagon/include/uapi/asm/bitsperlong.h
new file mode 100644 (file)
index 0000000..4a65815
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef __ASM_HEXAGON_BITSPERLONG_H
+#define __ASM_HEXAGON_BITSPERLONG_H
+
+#define __BITS_PER_LONG 32
+
+#include <asm-generic/bitsperlong.h>
+
+#endif
diff --git a/arch/hexagon/include/uapi/asm/byteorder.h b/arch/hexagon/include/uapi/asm/byteorder.h
new file mode 100644 (file)
index 0000000..e31f3f7
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef _ASM_BYTEORDER_H
+#define _ASM_BYTEORDER_H
+
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+#  define __BYTEORDER_HAS_U64__
+#endif
+
+#include <linux/byteorder/little_endian.h>
+
+#endif /* _ASM_BYTEORDER_H */
diff --git a/arch/hexagon/include/uapi/asm/kvm_para.h b/arch/hexagon/include/uapi/asm/kvm_para.h
new file mode 100644 (file)
index 0000000..14fab8f
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/kvm_para.h>
diff --git a/arch/hexagon/include/uapi/asm/param.h b/arch/hexagon/include/uapi/asm/param.h
new file mode 100644 (file)
index 0000000..5cec8c0
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef _ASM_PARAM_H
+#define _ASM_PARAM_H
+
+#define EXEC_PAGESIZE  16384
+
+#include <asm-generic/param.h>
+
+#endif
diff --git a/arch/hexagon/include/uapi/asm/ptrace.h b/arch/hexagon/include/uapi/asm/ptrace.h
new file mode 100644 (file)
index 0000000..8ef7840
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Ptrace definitions for the Hexagon architecture
+ *
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef _ASM_PTRACE_H
+#define _ASM_PTRACE_H
+
+#include <asm/registers.h>
+
+#define instruction_pointer(regs) pt_elr(regs)
+#define user_stack_pointer(regs) ((regs)->r29)
+
+#define profile_pc(regs) instruction_pointer(regs)
+
+/* kprobe-based event tracer support */
+extern int regs_query_register_offset(const char *name);
+extern const char *regs_query_register_name(unsigned int offset);
+
+#endif
diff --git a/arch/hexagon/include/uapi/asm/registers.h b/arch/hexagon/include/uapi/asm/registers.h
new file mode 100644 (file)
index 0000000..c20406f
--- /dev/null
@@ -0,0 +1,221 @@
+/*
+ * Register definitions for the Hexagon architecture
+ */
+
+
+#ifndef _ASM_REGISTERS_H
+#define _ASM_REGISTERS_H
+
+#define SP r29
+
+#ifndef __ASSEMBLY__
+
+/*  See kernel/entry.S for further documentation.  */
+
+/*
+ * Entry code copies the event record out of guest registers into
+ * this structure (which is on the stack).
+ */
+
+struct hvm_event_record {
+       unsigned long vmel;     /* Event Linkage (return address) */
+       unsigned long vmest;    /* Event context - pre-event SSR values */
+       unsigned long vmpsp;    /* Previous stack pointer */
+       unsigned long vmbadva;  /* Bad virtual address for addressing events */
+};
+
+struct pt_regs {
+       long restart_r0;        /* R0 checkpoint for syscall restart */
+       long syscall_nr;        /* Only used in system calls */
+       union {
+               struct {
+                       unsigned long usr;
+                       unsigned long preds;
+               };
+               long long int predsusr;
+       };
+       union {
+               struct {
+                       unsigned long m0;
+                       unsigned long m1;
+               };
+               long long int m1m0;
+       };
+       union {
+               struct {
+                       unsigned long sa1;
+                       unsigned long lc1;
+               };
+               long long int lc1sa1;
+       };
+       union {
+               struct {
+                       unsigned long sa0;
+                       unsigned long lc0;
+               };
+               long long int lc0sa0;
+       };
+       union {
+               struct {
+                       unsigned long gp;
+                       unsigned long ugp;
+               };
+               long long int ugpgp;
+       };
+       /*
+       * Be extremely careful with rearranging these, if at all.  Some code
+       * assumes the 32 registers exist exactly like this in memory;
+       * e.g. kernel/ptrace.c
+       * e.g. kernel/signal.c (restore_sigcontext)
+       */
+       union {
+               struct {
+                       unsigned long r00;
+                       unsigned long r01;
+               };
+               long long int r0100;
+       };
+       union {
+               struct {
+                       unsigned long r02;
+                       unsigned long r03;
+               };
+               long long int r0302;
+       };
+       union {
+               struct {
+                       unsigned long r04;
+                       unsigned long r05;
+               };
+               long long int r0504;
+       };
+       union {
+               struct {
+                       unsigned long r06;
+                       unsigned long r07;
+               };
+               long long int r0706;
+       };
+       union {
+               struct {
+                       unsigned long r08;
+                       unsigned long r09;
+               };
+               long long int r0908;
+       };
+       union {
+              struct {
+                       unsigned long r10;
+                       unsigned long r11;
+              };
+              long long int r1110;
+       };
+       union {
+              struct {
+                       unsigned long r12;
+                       unsigned long r13;
+              };
+              long long int r1312;
+       };
+       union {
+              struct {
+                       unsigned long r14;
+                       unsigned long r15;
+              };
+              long long int r1514;
+       };
+       union {
+               struct {
+                       unsigned long r16;
+                       unsigned long r17;
+               };
+               long long int r1716;
+       };
+       union {
+               struct {
+                       unsigned long r18;
+                       unsigned long r19;
+               };
+               long long int r1918;
+       };
+       union {
+               struct {
+                       unsigned long r20;
+                       unsigned long r21;
+               };
+               long long int r2120;
+       };
+       union {
+               struct {
+                       unsigned long r22;
+                       unsigned long r23;
+               };
+               long long int r2322;
+       };
+       union {
+               struct {
+                       unsigned long r24;
+                       unsigned long r25;
+               };
+               long long int r2524;
+       };
+       union {
+               struct {
+                       unsigned long r26;
+                       unsigned long r27;
+               };
+               long long int r2726;
+       };
+       union {
+               struct {
+                       unsigned long r28;
+                       unsigned long r29;
+              };
+              long long int r2928;
+       };
+       union {
+               struct {
+                       unsigned long r30;
+                       unsigned long r31;
+               };
+               long long int r3130;
+       };
+       /* VM dispatch pushes event record onto stack - we can build on it */
+       struct hvm_event_record hvmer;
+};
+
+/* Defines to conveniently access the values  */
+
+/*
+ * As of the VM spec 0.5, these registers are now set/retrieved via a
+ * VM call.  On the in-bound side, we just fetch the values
+ * at the entry points and stuff them into the old record in pt_regs.
+ * However, on the outbound side, probably at VM rte, we set the
+ * registers back.
+ */
+
+#define pt_elr(regs) ((regs)->hvmer.vmel)
+#define pt_set_elr(regs, val) ((regs)->hvmer.vmel = (val))
+#define pt_cause(regs) ((regs)->hvmer.vmest & (HVM_VMEST_CAUSE_MSK))
+#define user_mode(regs) \
+       (((regs)->hvmer.vmest & (HVM_VMEST_UM_MSK << HVM_VMEST_UM_SFT)) != 0)
+#define ints_enabled(regs) \
+       (((regs)->hvmer.vmest & (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)) != 0)
+#define pt_psp(regs) ((regs)->hvmer.vmpsp)
+#define pt_badva(regs) ((regs)->hvmer.vmbadva)
+
+#define pt_set_rte_sp(regs, sp) do {\
+       pt_psp(regs) = (sp);\
+       (regs)->SP = (unsigned long) &((regs)->hvmer);\
+       } while (0)
+
+#define pt_set_kmode(regs) \
+       (regs)->hvmer.vmest = (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)
+
+#define pt_set_usermode(regs) \
+       (regs)->hvmer.vmest = (HVM_VMEST_UM_MSK << HVM_VMEST_UM_SFT) \
+                           | (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)
+
+#endif  /*  ifndef __ASSEMBLY  */
+
+#endif
diff --git a/arch/hexagon/include/uapi/asm/setup.h b/arch/hexagon/include/uapi/asm/setup.h
new file mode 100644 (file)
index 0000000..e48285e
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef _ASM_SETUP_H
+#define _ASM_SETUP_H
+
+#include <linux/init.h>
+#include <asm-generic/setup.h>
+
+extern char external_cmdline_buffer;
+
+void __init setup_arch_memory(void);
+
+#endif
diff --git a/arch/hexagon/include/uapi/asm/sigcontext.h b/arch/hexagon/include/uapi/asm/sigcontext.h
new file mode 100644 (file)
index 0000000..b6ba536
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef _ASM_SIGCONTEXT_H
+#define _ASM_SIGCONTEXT_H
+
+#include <asm/user.h>
+
+/*
+ * Signal context structure - contains all info to do with the state
+ * before the signal handler was invoked.  Note: only add new entries
+ * to the end of the structure.
+ */
+struct sigcontext {
+       struct user_regs_struct sc_regs;
+} __aligned(8);
+
+#endif
diff --git a/arch/hexagon/include/uapi/asm/signal.h b/arch/hexagon/include/uapi/asm/signal.h
new file mode 100644 (file)
index 0000000..9395568
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef _ASM_SIGNAL_H
+#define _ASM_SIGNAL_H
+
+extern unsigned long __rt_sigtramp_template[2];
+
+#include <asm-generic/signal.h>
+
+#endif
diff --git a/arch/hexagon/include/uapi/asm/swab.h b/arch/hexagon/include/uapi/asm/swab.h
new file mode 100644 (file)
index 0000000..9069e92
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef _ASM_SWAB_H
+#define _ASM_SWAB_H
+
+#define __SWAB_64_THRU_32__
+
+#endif
diff --git a/arch/hexagon/include/uapi/asm/unistd.h b/arch/hexagon/include/uapi/asm/unistd.h
new file mode 100644 (file)
index 0000000..81312d6
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Syscall support for Hexagon
+ *
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+/*
+ *  The kernel pulls this unistd.h in three different ways:
+ *  1.  the "normal" way which gets all the __NR defines
+ *  2.  with __SYSCALL defined to produce function declarations
+ *  3.  with __SYSCALL defined to produce syscall table initialization
+ *  See also:  syscalltab.c
+ */
+
+#define sys_mmap2 sys_mmap_pgoff
+
+#include <asm-generic/unistd.h>
diff --git a/arch/hexagon/include/uapi/asm/user.h b/arch/hexagon/include/uapi/asm/user.h
new file mode 100644 (file)
index 0000000..cef13ee
--- /dev/null
@@ -0,0 +1,63 @@
+#ifndef HEXAGON_ASM_USER_H
+#define HEXAGON_ASM_USER_H
+
+/*
+ * Layout for registers passed in elf core dumps to userspace.
+ *
+ * Basically a rearranged subset of "pt_regs".
+ *
+ * Interested parties:  libc, gdb...
+ */
+
+struct user_regs_struct {
+       unsigned long r0;
+       unsigned long r1;
+       unsigned long r2;
+       unsigned long r3;
+       unsigned long r4;
+       unsigned long r5;
+       unsigned long r6;
+       unsigned long r7;
+       unsigned long r8;
+       unsigned long r9;
+       unsigned long r10;
+       unsigned long r11;
+       unsigned long r12;
+       unsigned long r13;
+       unsigned long r14;
+       unsigned long r15;
+       unsigned long r16;
+       unsigned long r17;
+       unsigned long r18;
+       unsigned long r19;
+       unsigned long r20;
+       unsigned long r21;
+       unsigned long r22;
+       unsigned long r23;
+       unsigned long r24;
+       unsigned long r25;
+       unsigned long r26;
+       unsigned long r27;
+       unsigned long r28;
+       unsigned long r29;
+       unsigned long r30;
+       unsigned long r31;
+       unsigned long sa0;
+       unsigned long lc0;
+       unsigned long sa1;
+       unsigned long lc1;
+       unsigned long m0;
+       unsigned long m1;
+       unsigned long usr;
+       unsigned long p3_0;
+       unsigned long gp;
+       unsigned long ugp;
+       unsigned long pc;
+       unsigned long cause;
+       unsigned long badva;
+       unsigned long pad1;  /* pad out to 48 words total */
+       unsigned long pad2;  /* pad out to 48 words total */
+       unsigned long pad3;  /* pad out to 48 words total */
+};
+
+#endif
index 89ffa514611f51754ef1ed3fe3c33e1149ac3f5b..2d5e84d3b00d69a738eb52e90388a184fb790d54 100644 (file)
@@ -5,7 +5,7 @@
  * Kevin Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 2000 MIPS Technologies, Inc.
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 2b48751aa5f75848c0e4d7674c412a479390ac5a..65c7bdcf565ef94b02882a30a6be129075cee511 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * DMA implementation for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 8e6b819125a3e8f10760e2a6f9bef5c6a28431ec..d859402c73bac00251cfde0109ce6a42bab7bf72 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Early kernel startup code for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  *
  * This program is free software; you can redistribute it and/or modify
index 7f1892471805c189e49798c513a468dc05a40086..32b1379d68772a7077929d6bb95f7ea09590458b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Export of symbols defined in assembly files and/or libgcc.
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index d4416a1a431ed77ee06aedf6de65bdc93e1a07ed..85883e1fdc12e950898239ba1f608934e5fe225f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * First-level interrupt controller model for Hexagon.
  *
- * Copyright (c) 2010-2011 Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index fe4aa1bcca503fc5ad67c682f671065503b0cb9b..344645370646bfdb91ffa1e21c0a9a93e060ab52 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/hexagon/kernel/kgdb.c - Hexagon KGDB Support
  *
- * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 61a76bae3668e61be566c3dd4c08d2decac1f53b..477d07a5646c59691a9603dd9069ce3dac8eb1de 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Kernel module loader for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index af51de63b8359fface711d6b89424afc7f2d937d..9f6d7411b5747d87901e59733c1d1646ec72d631 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Process creation support for Hexagon
  *
- * Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 96c3b2c4dbaded2a24bb0c62a13a5f669637c90d..670b1b0bee63bf740e5979a28a12298b8b8084a8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Ptrace support for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 4d72fc58e9b18f4e2ad804ddbf2681dfe4d4e1f0..6aeabc962b3b41348ea84e55970d4b2db67cd25d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 1202f78d25cb9ab8ca08f6ea339546424f20b497..94a38783500870f06945f993e0840fbc01b0cb75 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Arch related setup for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 1ea16bec7b91385ca9bb9de3563d44e0958546af..5047b8b879c02376f44c9b06114ce1facde7b013 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Signal support for Hexagon processor
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 149fbefc1a4d36988d6f5ce3422aaac57d029b60..8e095dffd070da9b57fa03ab67b93014013e7e0d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * SMP support for Hexagon
  *
- * Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 11c597b2ac59ef2ac3b3c0e731170758d13b9081..f94918b449a8aa4258a5f04cc98c7b42b1b27fda 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Stacktrace support for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 25a9bfe3445d941f3386e05dd8ae5c0c2ece0f95..319fa6494f58cd70c8823619fce09972e9846af3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Hexagon system calls
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index c550f4177ab84f8e9875c784cab2a49b8902347c..7024b1ddc08a3f1519fb8ce347da44b7617d0a28 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * System call table for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 36ba641857112e1382579d16bd8badf1942115ae..9903fad997f3e2dc210b85905e832d268df31b5b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Time related functions for Hexagon architecture
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index ba4475184432b86245e8f6677fbc8cfad3ae2840..352f27e809fdde4bfb99a640f7656ad65eb9bb70 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * CPU topology for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 06c36c036b981edb77b2d66598281a50c8418080..18110a9056b02b0ec47150f5cd6915481102468e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index f08857d0715b87d3162d4fcd2fbadfad68df0e3b..a41eeb8eeaa1a7734e7d170ec679c1438e70adc9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Kernel traps/events for Hexagon processor
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 5d39f42f7085bb1fec3c44a101dceb3615c0cc2d..0bf5a87e4d0a9b7f5e57a2831fbb81118285549d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * vDSO implementation for Hexagon
  *
- * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 5b99066cbc8d40d118ed2d688ee3b50b0cd4b721..cd71673ac25983cebe108f19a58efd656a523b03 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Event entry/exit for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 591fc1b68635e00b86bb2ba73134d2e71d5c0125..9b5a4a295a68ba1afbec0f636c58ed072e02a013 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Mostly IRQ support for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index aebb35b6465e914531f081aeeeea0ebfe6e80e95..80967f2192b37aee002b0f05c0aff64cd5e02f16 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Initial page table for Linux kernel under Hexagon VM,
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 24d7fcac4ff262808b23beb83e3ee561eebf4b3e..9fb77b3f6cf2950391c0eedf980187ce3f357c85 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Hexagon VM instruction support
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 0decf2f58e3202f8857d2147fe876e7817d2a3ec..62c6df91b3bb3f64523d5551082ce47db20b80ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Context switch support for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 97a4b50b00dfce0f2fff21473a40bfbc91517d10..620f42cc582a17180083058a001d3464b57ac907 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Event jump tables
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 071d3c30edfbe60da04634d33b0a0ec41a170ef1..14e793f6abbfff6a4313720710646826233be8ea 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Linker script for Hexagon kernel
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 93005522d52b1af1c15a47262519262986e50fde..8169f78a46a70f5bc0359b4fa006070772116d59 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Checksum functions for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 8ae47ba0e7057fe3c70897bd29ae49c1f374c1eb..885c9626d5e08b4a9472359419beba4bfbf8d972 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * I/O access functions for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 2101c339566524ea44b68947f21790674e6dac20..81c561c4b4d606ee7159f18742a2d5fe4c81b20d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  *
  * This program is free software; you can redistribute it and/or modify
index 26d961439ab0c8de3d717a26c3f75c598c8f4c82..9341889ea3f67877e64819fdd43e26301838a2b4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index c5cf6ee2758777de0d948b55eb315fe8cfd3d7af..fe14ccf285613c39f8801a8ca29389c5df6afa44 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Cache management functions for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 8eb1d4d61a3d55118c29b120890049a185853d08..7fc94f3e66425b8d3020e808420cda7b9b78ba58 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * User memory copy functions for kernel
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index cb9740ed9e7dd867672e3fbf0b54beeb9f3c1570..0cfbcc09d1d942d47aa594b90f773de80a971372 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * User memory copying routines for the Hexagon Kernel
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 08d7d7b23daa70f70e4f3edc75be620254cffdbd..254d8cc766bb9f7746425c83326ef2290e43d57c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index b57d741750b22225d9c20cf287306161e8ba4246..69ffcfd2879450de9fd16538be3d4acc7ee9e5f7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Memory subsystem initialization for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 3a37bc3b01163b02b3c96dcd21f4f0d69f465d5b..5905fd5f97f666fa9379c7860699fe9bf8807407 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * I/O remap functions for Hexagon
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index b175e2d42b895aaf3d27e62fc3a2c0fa3c52e8e9..19760a4611d97a7e7eed513d411436d3e1eae03b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 5c6a16c7c72ac9527e6858fd82f17428524fba5b..0eecb7a768fe0edd87ece9e8b9c55974ab9e74b1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * User string length functions for kernel
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index e748108b47a7f7a8c93350137874eae96866a677..34127261c2b7124d4fc43e36ddb7bb84dcf7900b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 513b74cb397eb4dffab84d240367f2e71d8a4263..308ef0ce648baeb77ed933a6c30de55a94d96438 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Memory fault handling for Hexagon
  *
- * Copyright (c) 2010-2011 Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index c6ff415754615dd5be37bc032823c2b9e8dd0845..9647d00cb761002c3d4370df41785b740f6c980c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Hexagon Virtual Machine TLB functions
  *
- * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
index 30cafac937030ab7f174252949a05948a153b0ef..1b3f5eb5fcdb4566d66f5bd09f4d0b2ffb161926 100644 (file)
@@ -1,6 +1,8 @@
 # UAPI Header export list
 include include/uapi/asm-generic/Kbuild.asm
 
+generic-y += kvm_para.h
+
 header-y += auxvec.h
 header-y += bitsperlong.h
 header-y += break.h
diff --git a/arch/ia64/include/uapi/asm/kvm_para.h b/arch/ia64/include/uapi/asm/kvm_para.h
deleted file mode 100644 (file)
index e69de29..0000000
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..533053d12cede054a47d225534b1a4ec34b07986 100644 (file)
@@ -0,0 +1 @@
+# MIPS headers
index e7cd78277c2314cee30aec8d078d2e9cd3a8e69e..dc0a5f77a35c8d9a6c09567e61e54b7e349b55ae 100644 (file)
@@ -13,9 +13,9 @@
 
 #include <linux/param.h>
 
-extern void __delay(unsigned int loops);
-extern void __ndelay(unsigned int ns);
-extern void __udelay(unsigned int us);
+extern void __delay(unsigned long loops);
+extern void __ndelay(unsigned long ns);
+extern void __udelay(unsigned long us);
 
 #define ndelay(ns) __ndelay(ns)
 #define udelay(us) __udelay(us)
index c26e182500799b7ba6cf97b2ef540f6feb82b6c8..f5b521d5a67d744e3f250c5a99e5023c77deaee0 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef _ASM_PGTABLE_64_H
 #define _ASM_PGTABLE_64_H
 
+#include <linux/compiler.h>
 #include <linux/linkage.h>
 
 #include <asm/addrspace.h>
@@ -172,7 +173,19 @@ static inline int pmd_none(pmd_t pmd)
        return pmd_val(pmd) == (unsigned long) invalid_pte_table;
 }
 
-#define pmd_bad(pmd)           (pmd_val(pmd) & ~PAGE_MASK)
+static inline int pmd_bad(pmd_t pmd)
+{
+#ifdef CONFIG_HUGETLB_PAGE
+       /* pmd_huge(pmd) but inline */
+       if (unlikely(pmd_val(pmd) & _PAGE_HUGE))
+               return 0;
+#endif
+
+       if (unlikely(pmd_val(pmd) & ~PAGE_MASK))
+               return 1;
+
+       return 0;
+}
 
 static inline int pmd_present(pmd_t pmd)
 {
index b9fe3ade028987f67a97b29e1192ef8768d72c17..8eb715bb1ea871f0141c0508a55a18f755257d5f 100644 (file)
@@ -14,6 +14,9 @@
  */
 
 #ifndef __MIPS_JZ4740_SERIAL_H__
+#define __MIPS_JZ4740_SERIAL_H__
+
+struct uart_port;
 
 void jz4740_serial_out(struct uart_port *p, int offset, int value);
 
index afc379ca375301f7e916a4fd46447239ad478a38..06cd0c610f4475a3cfc03f6907e00542117fe2ba 100644 (file)
@@ -97,7 +97,7 @@ static void cmp_init_secondary(void)
 
        /* Enable per-cpu interrupts: platform specific */
 
-       c->core = (read_c0_ebase() >> 1) & 0xff;
+       c->core = (read_c0_ebase() >> 1) & 0x1ff;
 #if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC)
        c->vpe_id = (read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE;
 #endif
index 5995969e8c42b4c4b0d6a1f44005104429c50479..dc81ca8dc0dd4b0ccd81ae2edc78b059aa8fd016 100644 (file)
 #include <asm/compiler.h>
 #include <asm/war.h>
 
-inline void __delay(unsigned int loops)
+void __delay(unsigned long loops)
 {
        __asm__ __volatile__ (
        "       .set    noreorder                               \n"
        "       .align  3                                       \n"
        "1:     bnez    %0, 1b                                  \n"
+#if __SIZEOF_LONG__ == 4
        "       subu    %0, 1                                   \n"
+#else
+       "       dsubu   %0, 1                                   \n"
+#endif
        "       .set    reorder                                 \n"
        : "=r" (loops)
        : "0" (loops));
index 3f69725556afb3fc78d5ac3bab04be6176e28017..a99c1d3fc56769dc91f58ce64e117e0eb8533b44 100644 (file)
@@ -50,8 +50,9 @@ static void dump_tlb(int first, int last)
 {
        unsigned long s_entryhi, entryhi, asid;
        unsigned long long entrylo0, entrylo1;
-       unsigned int s_index, pagemask, c0, c1, i;
+       unsigned int s_index, s_pagemask, pagemask, c0, c1, i;
 
+       s_pagemask = read_c0_pagemask();
        s_entryhi = read_c0_entryhi();
        s_index = read_c0_index();
        asid = s_entryhi & 0xff;
@@ -103,6 +104,7 @@ static void dump_tlb(int first, int last)
 
        write_c0_entryhi(s_entryhi);
        write_c0_index(s_index);
+       write_c0_pagemask(s_pagemask);
 }
 
 void dump_tlb_all(void)
index 87b9cfcc30ff9ee44a982ae40982073e3eb5b855..4b9b935a070e0c4d0160f2c259c3dc553c40b35e 100644 (file)
@@ -320,6 +320,7 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
                        tlb_write_random();
                else
                        tlb_write_indexed();
+               tlbw_use_hazard();
                write_c0_pagemask(PM_DEFAULT_MASK);
        } else
 #endif
index 658a520364ce76979191defd64c56a1da88899fb..2833dcb67b5adeaf838536580728176bbc715a77 100644 (file)
@@ -148,8 +148,8 @@ enum label_id {
        label_leave,
        label_vmalloc,
        label_vmalloc_done,
-       label_tlbw_hazard,
-       label_split,
+       label_tlbw_hazard_0,
+       label_split = label_tlbw_hazard_0 + 8,
        label_tlbl_goaround1,
        label_tlbl_goaround2,
        label_nopage_tlbl,
@@ -167,7 +167,7 @@ UASM_L_LA(_second_part)
 UASM_L_LA(_leave)
 UASM_L_LA(_vmalloc)
 UASM_L_LA(_vmalloc_done)
-UASM_L_LA(_tlbw_hazard)
+/* _tlbw_hazard_x is handled differently.  */
 UASM_L_LA(_split)
 UASM_L_LA(_tlbl_goaround1)
 UASM_L_LA(_tlbl_goaround2)
@@ -181,6 +181,30 @@ UASM_L_LA(_large_segbits_fault)
 UASM_L_LA(_tlb_huge_update)
 #endif
 
+static int __cpuinitdata hazard_instance;
+
+static void uasm_bgezl_hazard(u32 **p, struct uasm_reloc **r, int instance)
+{
+       switch (instance) {
+       case 0 ... 7:
+               uasm_il_bgezl(p, r, 0, label_tlbw_hazard_0 + instance);
+               return;
+       default:
+               BUG();
+       }
+}
+
+static void uasm_bgezl_label(struct uasm_label **l, u32 **p, int instance)
+{
+       switch (instance) {
+       case 0 ... 7:
+               uasm_build_label(l, *p, label_tlbw_hazard_0 + instance);
+               break;
+       default:
+               BUG();
+       }
+}
+
 /*
  * For debug purposes.
  */
@@ -478,21 +502,28 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
                 * This branch uses up a mtc0 hazard nop slot and saves
                 * two nops after the tlbw instruction.
                 */
-               uasm_il_bgezl(p, r, 0, label_tlbw_hazard);
+               uasm_bgezl_hazard(p, r, hazard_instance);
                tlbw(p);
-               uasm_l_tlbw_hazard(l, *p);
+               uasm_bgezl_label(l, p, hazard_instance);
+               hazard_instance++;
                uasm_i_nop(p);
                break;
 
        case CPU_R4600:
        case CPU_R4700:
-       case CPU_R5000:
-       case CPU_R5000A:
                uasm_i_nop(p);
                tlbw(p);
                uasm_i_nop(p);
                break;
 
+       case CPU_R5000:
+       case CPU_R5000A:
+       case CPU_NEVADA:
+               uasm_i_nop(p); /* QED specifies 2 nops hazard */
+               uasm_i_nop(p); /* QED specifies 2 nops hazard */
+               tlbw(p);
+               break;
+
        case CPU_R4300:
        case CPU_5KC:
        case CPU_TX49XX:
@@ -526,17 +557,6 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
                tlbw(p);
                break;
 
-       case CPU_NEVADA:
-               uasm_i_nop(p); /* QED specifies 2 nops hazard */
-               /*
-                * This branch uses up a mtc0 hazard nop slot and saves
-                * a nop after the tlbw instruction.
-                */
-               uasm_il_bgezl(p, r, 0, label_tlbw_hazard);
-               tlbw(p);
-               uasm_l_tlbw_hazard(l, *p);
-               break;
-
        case CPU_RM7000:
                uasm_i_nop(p);
                uasm_i_nop(p);
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ae5704fa77ad6d15e8de4623ca6465f24f2341b9 100644 (file)
@@ -0,0 +1,4 @@
+/*
+ * There isn't anything here anymore, but the file must not be empty or patch
+ * will delete it.
+ */
index 458371a1565aa2fdcbaa75e27ab398d8741019a9..bac8debecffb067ca8b550e0773a3c7c204d1e0b 100644 (file)
@@ -1,6 +1,5 @@
-include include/asm-generic/Kbuild.asm
 
-header-y += pdc.h
-generic-y += clkdev.h
-generic-y += word-at-a-time.h
-generic-y += exec.h
+generic-y += word-at-a-time.h auxvec.h user.h cputime.h emergency-restart.h \
+         segment.h topology.h vga.h device.h percpu.h hw_irq.h mutex.h \
+         div64.h irq_regs.h kdebug.h kvm_para.h local64.h local.h param.h \
+         poll.h xor.h clkdev.h exec.h
diff --git a/arch/parisc/include/asm/auxvec.h b/arch/parisc/include/asm/auxvec.h
deleted file mode 100644 (file)
index 9c3ac4b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef __ASMPARISC_AUXVEC_H
-#define __ASMPARISC_AUXVEC_H
-
-#endif
diff --git a/arch/parisc/include/asm/bitsperlong.h b/arch/parisc/include/asm/bitsperlong.h
deleted file mode 100644 (file)
index 75196b4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef __ASM_PARISC_BITSPERLONG_H
-#define __ASM_PARISC_BITSPERLONG_H
-
-/*
- * using CONFIG_* outside of __KERNEL__ is wrong,
- * __LP64__ was also removed from headers, so what
- * is the right approach on parisc?
- *     -arnd
- */
-#if (defined(__KERNEL__) && defined(CONFIG_64BIT)) || defined (__LP64__)
-#define __BITS_PER_LONG 64
-#define SHIFT_PER_LONG 6
-#else
-#define __BITS_PER_LONG 32
-#define SHIFT_PER_LONG 5
-#endif
-
-#include <asm-generic/bitsperlong.h>
-
-#endif /* __ASM_PARISC_BITSPERLONG_H */
diff --git a/arch/parisc/include/asm/byteorder.h b/arch/parisc/include/asm/byteorder.h
deleted file mode 100644 (file)
index 58af2c5..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _PARISC_BYTEORDER_H
-#define _PARISC_BYTEORDER_H
-
-#include <linux/byteorder/big_endian.h>
-
-#endif /* _PARISC_BYTEORDER_H */
diff --git a/arch/parisc/include/asm/compat_signal.h b/arch/parisc/include/asm/compat_signal.h
deleted file mode 100644 (file)
index 6ad02c3..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Use generic */
-#include <asm-generic/compat_signal.h>
diff --git a/arch/parisc/include/asm/cputime.h b/arch/parisc/include/asm/cputime.h
deleted file mode 100644 (file)
index dcdf2fb..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __PARISC_CPUTIME_H
-#define __PARISC_CPUTIME_H
-
-#include <asm-generic/cputime.h>
-
-#endif /* __PARISC_CPUTIME_H */
diff --git a/arch/parisc/include/asm/device.h b/arch/parisc/include/asm/device.h
deleted file mode 100644 (file)
index d8f9872..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * Arch specific extensions to struct device
- *
- * This file is released under the GPLv2
- */
-#include <asm-generic/device.h>
-
diff --git a/arch/parisc/include/asm/div64.h b/arch/parisc/include/asm/div64.h
deleted file mode 100644 (file)
index 6cd978c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/div64.h>
diff --git a/arch/parisc/include/asm/emergency-restart.h b/arch/parisc/include/asm/emergency-restart.h
deleted file mode 100644 (file)
index 108d8c4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_EMERGENCY_RESTART_H
-#define _ASM_EMERGENCY_RESTART_H
-
-#include <asm-generic/emergency-restart.h>
-
-#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/arch/parisc/include/asm/errno.h b/arch/parisc/include/asm/errno.h
deleted file mode 100644 (file)
index 135ad60..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#ifndef _PARISC_ERRNO_H
-#define _PARISC_ERRNO_H
-
-#include <asm-generic/errno-base.h>
-
-#define        ENOMSG          35      /* No message of desired type */
-#define        EIDRM           36      /* Identifier removed */
-#define        ECHRNG          37      /* Channel number out of range */
-#define        EL2NSYNC        38      /* Level 2 not synchronized */
-#define        EL3HLT          39      /* Level 3 halted */
-#define        EL3RST          40      /* Level 3 reset */
-#define        ELNRNG          41      /* Link number out of range */
-#define        EUNATCH         42      /* Protocol driver not attached */
-#define        ENOCSI          43      /* No CSI structure available */
-#define        EL2HLT          44      /* Level 2 halted */
-#define        EDEADLK         45      /* Resource deadlock would occur */
-#define        EDEADLOCK       EDEADLK
-#define        ENOLCK          46      /* No record locks available */
-#define        EILSEQ          47      /* Illegal byte sequence */
-
-#define        ENONET          50      /* Machine is not on the network */
-#define        ENODATA         51      /* No data available */
-#define        ETIME           52      /* Timer expired */
-#define        ENOSR           53      /* Out of streams resources */
-#define        ENOSTR          54      /* Device not a stream */
-#define        ENOPKG          55      /* Package not installed */
-
-#define        ENOLINK         57      /* Link has been severed */
-#define        EADV            58      /* Advertise error */
-#define        ESRMNT          59      /* Srmount error */
-#define        ECOMM           60      /* Communication error on send */
-#define        EPROTO          61      /* Protocol error */
-
-#define        EMULTIHOP       64      /* Multihop attempted */
-
-#define        EDOTDOT         66      /* RFS specific error */
-#define        EBADMSG         67      /* Not a data message */
-#define        EUSERS          68      /* Too many users */
-#define        EDQUOT          69      /* Quota exceeded */
-#define        ESTALE          70      /* Stale NFS file handle */
-#define        EREMOTE         71      /* Object is remote */
-#define        EOVERFLOW       72      /* Value too large for defined data type */
-
-/* these errnos are defined by Linux but not HPUX. */
-
-#define        EBADE           160     /* Invalid exchange */
-#define        EBADR           161     /* Invalid request descriptor */
-#define        EXFULL          162     /* Exchange full */
-#define        ENOANO          163     /* No anode */
-#define        EBADRQC         164     /* Invalid request code */
-#define        EBADSLT         165     /* Invalid slot */
-#define        EBFONT          166     /* Bad font file format */
-#define        ENOTUNIQ        167     /* Name not unique on network */
-#define        EBADFD          168     /* File descriptor in bad state */
-#define        EREMCHG         169     /* Remote address changed */
-#define        ELIBACC         170     /* Can not access a needed shared library */
-#define        ELIBBAD         171     /* Accessing a corrupted shared library */
-#define        ELIBSCN         172     /* .lib section in a.out corrupted */
-#define        ELIBMAX         173     /* Attempting to link in too many shared libraries */
-#define        ELIBEXEC        174     /* Cannot exec a shared library directly */
-#define        ERESTART        175     /* Interrupted system call should be restarted */
-#define        ESTRPIPE        176     /* Streams pipe error */
-#define        EUCLEAN         177     /* Structure needs cleaning */
-#define        ENOTNAM         178     /* Not a XENIX named type file */
-#define        ENAVAIL         179     /* No XENIX semaphores available */
-#define        EISNAM          180     /* Is a named type file */
-#define        EREMOTEIO       181     /* Remote I/O error */
-#define        ENOMEDIUM       182     /* No medium found */
-#define        EMEDIUMTYPE     183     /* Wrong medium type */
-#define        ENOKEY          184     /* Required key not available */
-#define        EKEYEXPIRED     185     /* Key has expired */
-#define        EKEYREVOKED     186     /* Key has been revoked */
-#define        EKEYREJECTED    187     /* Key was rejected by service */
-
-/* We now return you to your regularly scheduled HPUX. */
-
-#define ENOSYM         215     /* symbol does not exist in executable */
-#define        ENOTSOCK        216     /* Socket operation on non-socket */
-#define        EDESTADDRREQ    217     /* Destination address required */
-#define        EMSGSIZE        218     /* Message too long */
-#define        EPROTOTYPE      219     /* Protocol wrong type for socket */
-#define        ENOPROTOOPT     220     /* Protocol not available */
-#define        EPROTONOSUPPORT 221     /* Protocol not supported */
-#define        ESOCKTNOSUPPORT 222     /* Socket type not supported */
-#define        EOPNOTSUPP      223     /* Operation not supported on transport endpoint */
-#define        EPFNOSUPPORT    224     /* Protocol family not supported */
-#define        EAFNOSUPPORT    225     /* Address family not supported by protocol */
-#define        EADDRINUSE      226     /* Address already in use */
-#define        EADDRNOTAVAIL   227     /* Cannot assign requested address */
-#define        ENETDOWN        228     /* Network is down */
-#define        ENETUNREACH     229     /* Network is unreachable */
-#define        ENETRESET       230     /* Network dropped connection because of reset */
-#define        ECONNABORTED    231     /* Software caused connection abort */
-#define        ECONNRESET      232     /* Connection reset by peer */
-#define        ENOBUFS         233     /* No buffer space available */
-#define        EISCONN         234     /* Transport endpoint is already connected */
-#define        ENOTCONN        235     /* Transport endpoint is not connected */
-#define        ESHUTDOWN       236     /* Cannot send after transport endpoint shutdown */
-#define        ETOOMANYREFS    237     /* Too many references: cannot splice */
-#define EREFUSED       ECONNREFUSED    /* for HP's NFS apparently */
-#define        ETIMEDOUT       238     /* Connection timed out */
-#define        ECONNREFUSED    239     /* Connection refused */
-#define EREMOTERELEASE 240     /* Remote peer released connection */
-#define        EHOSTDOWN       241     /* Host is down */
-#define        EHOSTUNREACH    242     /* No route to host */
-
-#define        EALREADY        244     /* Operation already in progress */
-#define        EINPROGRESS     245     /* Operation now in progress */
-#define        EWOULDBLOCK     246     /* Operation would block (Linux returns EAGAIN) */
-#define        ENOTEMPTY       247     /* Directory not empty */
-#define        ENAMETOOLONG    248     /* File name too long */
-#define        ELOOP           249     /* Too many symbolic links encountered */
-#define        ENOSYS          251     /* Function not implemented */
-
-#define ENOTSUP                252     /* Function not implemented (POSIX.4 / HPUX) */
-#define ECANCELLED     253     /* aio request was canceled before complete (POSIX.4 / HPUX) */
-#define ECANCELED      ECANCELLED      /* SuSv3 and Solaris wants one 'L' */
-
-/* for robust mutexes */
-#define EOWNERDEAD     254     /* Owner died */
-#define ENOTRECOVERABLE        255     /* State not recoverable */
-
-#define        ERFKILL         256     /* Operation not possible due to RF-kill */
-
-#define EHWPOISON      257     /* Memory page has hardware error */
-
-#endif
diff --git a/arch/parisc/include/asm/fcntl.h b/arch/parisc/include/asm/fcntl.h
deleted file mode 100644 (file)
index 0304b92..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef _PARISC_FCNTL_H
-#define _PARISC_FCNTL_H
-
-#define O_APPEND       000000010
-#define O_BLKSEEK      000000100 /* HPUX only */
-#define O_CREAT                000000400 /* not fcntl */
-#define O_EXCL         000002000 /* not fcntl */
-#define O_LARGEFILE    000004000
-#define __O_SYNC       000100000
-#define O_SYNC         (__O_SYNC|O_DSYNC)
-#define O_NONBLOCK     000200004 /* HPUX has separate NDELAY & NONBLOCK */
-#define O_NOCTTY       000400000 /* not fcntl */
-#define O_DSYNC                001000000 /* HPUX only */
-#define O_RSYNC                002000000 /* HPUX only */
-#define O_NOATIME      004000000
-#define O_CLOEXEC      010000000 /* set close_on_exec */
-
-#define O_DIRECTORY    000010000 /* must be a directory */
-#define O_NOFOLLOW     000000200 /* don't follow links */
-#define O_INVISIBLE    004000000 /* invisible I/O, for DMAPI/XDSM */
-
-#define O_PATH         020000000
-
-#define F_GETLK64      8
-#define F_SETLK64      9
-#define F_SETLKW64     10
-
-#define F_GETOWN       11      /*  for sockets. */
-#define F_SETOWN       12      /*  for sockets. */
-#define F_SETSIG       13      /*  for sockets. */
-#define F_GETSIG       14      /*  for sockets. */
-
-/* for posix fcntl() and lockf() */
-#define F_RDLCK                01
-#define F_WRLCK                02
-#define F_UNLCK                03
-
-#include <asm-generic/fcntl.h>
-
-#endif
diff --git a/arch/parisc/include/asm/hw_irq.h b/arch/parisc/include/asm/hw_irq.h
deleted file mode 100644 (file)
index 6707f7d..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _ASM_HW_IRQ_H
-#define _ASM_HW_IRQ_H
-
-/*
- *     linux/include/asm/hw_irq.h
- */
-
-#endif
diff --git a/arch/parisc/include/asm/ioctl.h b/arch/parisc/include/asm/ioctl.h
deleted file mode 100644 (file)
index ec8efa0..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *    Linux/PA-RISC Project (http://www.parisc-linux.org/)
- *    Copyright (C) 1999,2003 Matthew Wilcox < willy at debian . org >
- *    portions from "linux/ioctl.h for Linux" by H.H. Bergman.
- *
- *    This program is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 2 of the License, or
- *    (at your option) any later version.
- *
- *    This program is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with this program; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-
-#ifndef _ASM_PARISC_IOCTL_H
-#define _ASM_PARISC_IOCTL_H
-
-/* ioctl command encoding: 32 bits total, command in lower 16 bits,
- * size of the parameter structure in the lower 14 bits of the
- * upper 16 bits.
- * Encoding the size of the parameter structure in the ioctl request
- * is useful for catching programs compiled with old versions
- * and to avoid overwriting user space outside the user buffer area.
- * The highest 2 bits are reserved for indicating the ``access mode''.
- * NOTE: This limits the max parameter size to 16kB -1 !
- */
-
-/*
- * Direction bits.
- */
-#define _IOC_NONE      0U
-#define _IOC_WRITE     2U
-#define _IOC_READ      1U
-
-#include <asm-generic/ioctl.h>
-
-#endif /* _ASM_PARISC_IOCTL_H */
diff --git a/arch/parisc/include/asm/ioctls.h b/arch/parisc/include/asm/ioctls.h
deleted file mode 100644 (file)
index 054ec06..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef __ARCH_PARISC_IOCTLS_H__
-#define __ARCH_PARISC_IOCTLS_H__
-
-#include <asm/ioctl.h>
-
-/* 0x54 is just a magic number to make these relatively unique ('T') */
-
-#define TCGETS         _IOR('T', 16, struct termios) /* TCGETATTR */
-#define TCSETS         _IOW('T', 17, struct termios) /* TCSETATTR */
-#define TCSETSW                _IOW('T', 18, struct termios) /* TCSETATTRD */
-#define TCSETSF                _IOW('T', 19, struct termios) /* TCSETATTRF */
-#define TCGETA         _IOR('T', 1, struct termio)
-#define TCSETA         _IOW('T', 2, struct termio)
-#define TCSETAW                _IOW('T', 3, struct termio)
-#define TCSETAF                _IOW('T', 4, struct termio)
-#define TCSBRK         _IO('T', 5)
-#define TCXONC         _IO('T', 6)
-#define TCFLSH         _IO('T', 7)
-#define TIOCEXCL       0x540C
-#define TIOCNXCL       0x540D
-#define TIOCSCTTY      0x540E
-#define TIOCGPGRP      _IOR('T', 30, int)
-#define TIOCSPGRP      _IOW('T', 29, int)
-#define TIOCOUTQ       0x5411
-#define TIOCSTI                0x5412
-#define TIOCGWINSZ     0x5413
-#define TIOCSWINSZ     0x5414
-#define TIOCMGET       0x5415
-#define TIOCMBIS       0x5416
-#define TIOCMBIC       0x5417
-#define TIOCMSET       0x5418
-#define TIOCGSOFTCAR   0x5419
-#define TIOCSSOFTCAR   0x541A
-#define FIONREAD       0x541B
-#define TIOCINQ                FIONREAD
-#define TIOCLINUX      0x541C
-#define TIOCCONS       0x541D
-#define TIOCGSERIAL    0x541E
-#define TIOCSSERIAL    0x541F
-#define TIOCPKT                0x5420
-#define FIONBIO                0x5421
-#define TIOCNOTTY      0x5422
-#define TIOCSETD       0x5423
-#define TIOCGETD       0x5424
-#define TCSBRKP                0x5425  /* Needed for POSIX tcsendbreak() */
-#define TIOCSBRK       0x5427  /* BSD compatibility */
-#define TIOCCBRK       0x5428  /* BSD compatibility */
-#define TIOCGSID       _IOR('T', 20, int) /* Return the session ID of FD */
-#define TCGETS2                _IOR('T',0x2A, struct termios2)
-#define TCSETS2                _IOW('T',0x2B, struct termios2)
-#define TCSETSW2       _IOW('T',0x2C, struct termios2)
-#define TCSETSF2       _IOW('T',0x2D, struct termios2)
-#define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
-#define TIOCGDEV       _IOR('T',0x32, int)  /* Get primary device node of /dev/console */
-#define TIOCSIG                _IOW('T',0x36, int)  /* Generate signal on Pty slave */
-#define TIOCVHANGUP    0x5437
-
-#define FIONCLEX       0x5450  /* these numbers need to be adjusted. */
-#define FIOCLEX                0x5451
-#define FIOASYNC       0x5452
-#define TIOCSERCONFIG  0x5453
-#define TIOCSERGWILD   0x5454
-#define TIOCSERSWILD   0x5455
-#define TIOCGLCKTRMIOS 0x5456
-#define TIOCSLCKTRMIOS 0x5457
-#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
-#define TIOCSERGETLSR   0x5459 /* Get line status register */
-#define TIOCSERGETMULTI 0x545A /* Get multiport config  */
-#define TIOCSERSETMULTI 0x545B /* Set multiport config */
-
-#define TIOCMIWAIT     0x545C  /* wait for a change on serial input line(s) */
-#define TIOCGICOUNT    0x545D  /* read serial port inline interrupt counts */
-#define FIOQSIZE       0x5460  /* Get exact space used by quota */
-
-#define TIOCSTART      0x5461
-#define TIOCSTOP       0x5462
-#define TIOCSLTC       0x5462
-
-/* Used for packet mode */
-#define TIOCPKT_DATA            0
-#define TIOCPKT_FLUSHREAD       1
-#define TIOCPKT_FLUSHWRITE      2
-#define TIOCPKT_STOP            4
-#define TIOCPKT_START           8
-#define TIOCPKT_NOSTOP         16
-#define TIOCPKT_DOSTOP         32
-#define TIOCPKT_IOCTL          64
-
-#define TIOCSER_TEMT    0x01   /* Transmitter physically empty */
-
-#endif /* _ASM_PARISC_IOCTLS_H */
diff --git a/arch/parisc/include/asm/ipcbuf.h b/arch/parisc/include/asm/ipcbuf.h
deleted file mode 100644 (file)
index bd956c4..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __PARISC_IPCBUF_H__
-#define __PARISC_IPCBUF_H__
-
-/*
- * The ipc64_perm structure for PA-RISC is almost identical to
- * kern_ipc_perm as we have always had 32-bit UIDs and GIDs in the kernel.
- * 'seq' has been changed from long to int so that it's the same size
- * on 64-bit kernels as on 32-bit ones.
- */
-
-struct ipc64_perm
-{
-       key_t           key;
-       uid_t           uid;
-       gid_t           gid;
-       uid_t           cuid;
-       gid_t           cgid;
-       unsigned short int      __pad1;
-       mode_t          mode;
-       unsigned short int      __pad2;
-       unsigned short int      seq;
-       unsigned int    __pad3;
-       unsigned long long int __unused1;
-       unsigned long long int __unused2;
-};
-
-#endif /* __PARISC_IPCBUF_H__ */
diff --git a/arch/parisc/include/asm/irq_regs.h b/arch/parisc/include/asm/irq_regs.h
deleted file mode 100644 (file)
index 3dd9c0b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/irq_regs.h>
diff --git a/arch/parisc/include/asm/kdebug.h b/arch/parisc/include/asm/kdebug.h
deleted file mode 100644 (file)
index 6ece1b0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/kdebug.h>
diff --git a/arch/parisc/include/asm/kvm_para.h b/arch/parisc/include/asm/kvm_para.h
deleted file mode 100644 (file)
index 14fab8f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/kvm_para.h>
diff --git a/arch/parisc/include/asm/local.h b/arch/parisc/include/asm/local.h
deleted file mode 100644 (file)
index c11c530..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/local.h>
diff --git a/arch/parisc/include/asm/local64.h b/arch/parisc/include/asm/local64.h
deleted file mode 100644 (file)
index 36c93b5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/local64.h>
diff --git a/arch/parisc/include/asm/mman.h b/arch/parisc/include/asm/mman.h
deleted file mode 100644 (file)
index 12219eb..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef __PARISC_MMAN_H__
-#define __PARISC_MMAN_H__
-
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x03            /* Mask for type of mapping */
-#define MAP_FIXED      0x04            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x10            /* don't use a file */
-
-#define MAP_DENYWRITE  0x0800          /* ETXTBSY */
-#define MAP_EXECUTABLE 0x1000          /* mark it as an executable */
-#define MAP_LOCKED     0x2000          /* pages are locked */
-#define MAP_NORESERVE  0x4000          /* don't check for reservations */
-#define MAP_GROWSDOWN  0x8000          /* stack-like segment */
-#define MAP_POPULATE   0x10000         /* populate (prefault) pagetables */
-#define MAP_NONBLOCK   0x20000         /* do not block on IO */
-#define MAP_STACK      0x40000         /* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB    0x80000         /* create a huge page mapping */
-
-#define MS_SYNC                1               /* synchronous memory sync */
-#define MS_ASYNC       2               /* sync memory asynchronously */
-#define MS_INVALIDATE  4               /* invalidate the caches */
-
-#define MCL_CURRENT    1               /* lock all current mappings */
-#define MCL_FUTURE     2               /* lock all future mappings */
-
-#define MADV_NORMAL     0               /* no further special treatment */
-#define MADV_RANDOM     1               /* expect random page references */
-#define MADV_SEQUENTIAL 2               /* expect sequential page references */
-#define MADV_WILLNEED   3               /* will need these pages */
-#define MADV_DONTNEED   4               /* don't need these pages */
-#define MADV_SPACEAVAIL 5               /* insure that resources are reserved */
-#define MADV_VPS_PURGE  6               /* Purge pages from VM page cache */
-#define MADV_VPS_INHERIT 7              /* Inherit parents page size */
-
-/* common/generic parameters */
-#define MADV_REMOVE    9               /* remove these pages & resources */
-#define MADV_DONTFORK  10              /* don't inherit across fork */
-#define MADV_DOFORK    11              /* do inherit across fork */
-
-/* The range 12-64 is reserved for page size specification. */
-#define MADV_4K_PAGES   12              /* Use 4K pages  */
-#define MADV_16K_PAGES  14              /* Use 16K pages */
-#define MADV_64K_PAGES  16              /* Use 64K pages */
-#define MADV_256K_PAGES 18              /* Use 256K pages */
-#define MADV_1M_PAGES   20              /* Use 1 Megabyte pages */
-#define MADV_4M_PAGES   22              /* Use 4 Megabyte pages */
-#define MADV_16M_PAGES  24              /* Use 16 Megabyte pages */
-#define MADV_64M_PAGES  26              /* Use 64 Megabyte pages */
-
-#define MADV_MERGEABLE   65            /* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 66            /* KSM may not merge identical pages */
-
-#define MADV_HUGEPAGE  67              /* Worth backing with hugepages */
-#define MADV_NOHUGEPAGE        68              /* Not worth backing with hugepages */
-
-#define MADV_DONTDUMP   69             /* Explicity exclude from the core dump,
-                                          overrides the coredump filter bits */
-#define MADV_DODUMP    70              /* Clear the MADV_NODUMP flag */
-
-/* compatibility flags */
-#define MAP_FILE       0
-#define MAP_VARIABLE   0
-
-#endif /* __PARISC_MMAN_H__ */
diff --git a/arch/parisc/include/asm/msgbuf.h b/arch/parisc/include/asm/msgbuf.h
deleted file mode 100644 (file)
index fe88f26..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef _PARISC_MSGBUF_H
-#define _PARISC_MSGBUF_H
-
-/* 
- * The msqid64_ds structure for parisc architecture, copied from sparc.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 64-bit time_t to solve y2038 problem
- * - 2 miscellaneous 32-bit values
- */
-
-struct msqid64_ds {
-       struct ipc64_perm msg_perm;
-#ifndef CONFIG_64BIT
-       unsigned int   __pad1;
-#endif
-       __kernel_time_t msg_stime;      /* last msgsnd time */
-#ifndef CONFIG_64BIT
-       unsigned int   __pad2;
-#endif
-       __kernel_time_t msg_rtime;      /* last msgrcv time */
-#ifndef CONFIG_64BIT
-       unsigned int   __pad3;
-#endif
-       __kernel_time_t msg_ctime;      /* last change time */
-       unsigned int  msg_cbytes;       /* current number of bytes on queue */
-       unsigned int  msg_qnum; /* number of messages in queue */
-       unsigned int  msg_qbytes;       /* max number of bytes on queue */
-       __kernel_pid_t msg_lspid;       /* pid of last msgsnd */
-       __kernel_pid_t msg_lrpid;       /* last receive pid */
-       unsigned int  __unused1;
-       unsigned int  __unused2;
-};
-
-#endif /* _PARISC_MSGBUF_H */
diff --git a/arch/parisc/include/asm/mutex.h b/arch/parisc/include/asm/mutex.h
deleted file mode 100644 (file)
index 458c1f7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Pull in the generic implementation for the mutex fastpath.
- *
- * TODO: implement optimized primitives instead, or leave the generic
- * implementation in place, or pick the atomic_xchg() based generic
- * implementation. (see asm-generic/mutex-xchg.h for details)
- */
-
-#include <asm-generic/mutex-dec.h>
diff --git a/arch/parisc/include/asm/param.h b/arch/parisc/include/asm/param.h
deleted file mode 100644 (file)
index 965d454..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/param.h>
index 7f0f2d23059d3f1acbb1990c04016025446643d2..7eb616e4bf8aee7cc2e89b8b05b11ed9dc76228f 100644 (file)
 #ifndef _PARISC_PDC_H
 #define _PARISC_PDC_H
 
-/*
- *     PDC return values ...
- *     All PDC calls return a subset of these errors. 
- */
-
-#define PDC_WARN                 3     /* Call completed with a warning */
-#define PDC_REQ_ERR_1            2     /* See above                     */
-#define PDC_REQ_ERR_0            1     /* Call would generate a requestor error */
-#define PDC_OK                   0     /* Call completed successfully  */
-#define PDC_BAD_PROC            -1     /* Called non-existent procedure*/
-#define PDC_BAD_OPTION          -2     /* Called with non-existent option */
-#define PDC_ERROR               -3     /* Call could not complete without an error */
-#define PDC_NE_MOD              -5     /* Module not found             */
-#define PDC_NE_CELL_MOD                 -7     /* Cell module not found        */
-#define PDC_INVALID_ARG                -10     /* Called with an invalid argument */
-#define PDC_BUS_POW_WARN       -12     /* Call could not complete in allowed power budget */
-#define PDC_NOT_NARROW         -17     /* Narrow mode not supported    */
-
-/*
- *     PDC entry points...
- */
-
-#define PDC_POW_FAIL   1               /* perform a power-fail         */
-#define PDC_POW_FAIL_PREPARE   0       /* prepare for powerfail        */
-
-#define PDC_CHASSIS    2               /* PDC-chassis functions        */
-#define PDC_CHASSIS_DISP       0       /* update chassis display       */
-#define PDC_CHASSIS_WARN       1       /* return chassis warnings      */
-#define PDC_CHASSIS_DISPWARN   2       /* update&return chassis status */
-#define PDC_RETURN_CHASSIS_INFO 128    /* HVERSION dependent: return chassis LED/LCD info  */
-
-#define PDC_PIM         3               /* Get PIM data                 */
-#define PDC_PIM_HPMC            0       /* Transfer HPMC data           */
-#define PDC_PIM_RETURN_SIZE     1       /* Get Max buffer needed for PIM*/
-#define PDC_PIM_LPMC            2       /* Transfer HPMC data           */
-#define PDC_PIM_SOFT_BOOT       3       /* Transfer Soft Boot data      */
-#define PDC_PIM_TOC             4       /* Transfer TOC data            */
-
-#define PDC_MODEL      4               /* PDC model information call   */
-#define PDC_MODEL_INFO         0       /* returns information          */
-#define PDC_MODEL_BOOTID       1       /* set the BOOT_ID              */
-#define PDC_MODEL_VERSIONS     2       /* returns cpu-internal versions*/
-#define PDC_MODEL_SYSMODEL     3       /* return system model info     */
-#define PDC_MODEL_ENSPEC       4       /* enable specific option       */
-#define PDC_MODEL_DISPEC       5       /* disable specific option      */
-#define PDC_MODEL_CPU_ID       6       /* returns cpu-id (only newer machines!) */
-#define PDC_MODEL_CAPABILITIES 7       /* returns OS32/OS64-flags      */
-/* Values for PDC_MODEL_CAPABILITIES non-equivalent virtual aliasing support */
-#define  PDC_MODEL_OS64                        (1 << 0)
-#define  PDC_MODEL_OS32                        (1 << 1)
-#define  PDC_MODEL_IOPDIR_FDC          (1 << 2)
-#define  PDC_MODEL_NVA_MASK            (3 << 4)
-#define  PDC_MODEL_NVA_SUPPORTED       (0 << 4)
-#define  PDC_MODEL_NVA_SLOW            (1 << 4)
-#define  PDC_MODEL_NVA_UNSUPPORTED     (3 << 4)
-#define PDC_MODEL_GET_BOOT__OP 8       /* returns boot test options    */
-#define PDC_MODEL_SET_BOOT__OP 9       /* set boot test options        */
-
-#define PA89_INSTRUCTION_SET   0x4     /* capatibilies returned        */
-#define PA90_INSTRUCTION_SET   0x8
-
-#define PDC_CACHE      5               /* return/set cache (& TLB) info*/
-#define PDC_CACHE_INFO         0       /* returns information          */
-#define PDC_CACHE_SET_COH      1       /* set coherence state          */
-#define PDC_CACHE_RET_SPID     2       /* returns space-ID bits        */
-
-#define PDC_HPA                6               /* return HPA of processor      */
-#define PDC_HPA_PROCESSOR      0
-#define PDC_HPA_MODULES                1
-
-#define PDC_COPROC     7               /* Co-Processor (usually FP unit(s)) */
-#define PDC_COPROC_CFG         0       /* Co-Processor Cfg (FP unit(s) enabled?) */
-
-#define PDC_IODC       8               /* talk to IODC                 */
-#define PDC_IODC_READ          0       /* read IODC entry point        */
-/*      PDC_IODC_RI_                    * INDEX parameter of PDC_IODC_READ */
-#define PDC_IODC_RI_DATA_BYTES 0       /* IODC Data Bytes              */
-/*                             1, 2       obsolete - HVERSION dependent*/
-#define PDC_IODC_RI_INIT       3       /* Initialize module            */
-#define PDC_IODC_RI_IO         4       /* Module input/output          */
-#define PDC_IODC_RI_SPA                5       /* Module input/output          */
-#define PDC_IODC_RI_CONFIG     6       /* Module input/output          */
-/*                             7         obsolete - HVERSION dependent */
-#define PDC_IODC_RI_TEST       8       /* Module input/output          */
-#define PDC_IODC_RI_TLB                9       /* Module input/output          */
-#define PDC_IODC_NINIT         2       /* non-destructive init         */
-#define PDC_IODC_DINIT         3       /* destructive init             */
-#define PDC_IODC_MEMERR                4       /* check for memory errors      */
-#define PDC_IODC_INDEX_DATA    0       /* get first 16 bytes from mod IODC */
-#define PDC_IODC_BUS_ERROR     -4      /* bus error return value       */
-#define PDC_IODC_INVALID_INDEX -5      /* invalid index return value   */
-#define PDC_IODC_COUNT         -6      /* count is too small           */
-
-#define PDC_TOD                9               /* time-of-day clock (TOD)      */
-#define PDC_TOD_READ           0       /* read TOD                     */
-#define PDC_TOD_WRITE          1       /* write TOD                    */
-
-
-#define PDC_STABLE     10              /* stable storage (sprockets)   */
-#define PDC_STABLE_READ                0
-#define PDC_STABLE_WRITE       1
-#define PDC_STABLE_RETURN_SIZE 2
-#define PDC_STABLE_VERIFY_CONTENTS 3
-#define PDC_STABLE_INITIALIZE  4
-
-#define PDC_NVOLATILE  11              /* often not implemented        */
-
-#define PDC_ADD_VALID  12              /* Memory validation PDC call   */
-#define PDC_ADD_VALID_VERIFY   0       /* Make PDC_ADD_VALID verify region */
-
-#define PDC_INSTR      15              /* get instr to invoke PDCE_CHECK() */
-
-#define PDC_PROC       16              /* (sprockets)                  */
-
-#define PDC_CONFIG     16              /* (sprockets)                  */
-#define PDC_CONFIG_DECONFIG    0
-#define PDC_CONFIG_DRECONFIG   1
-#define PDC_CONFIG_DRETURN_CONFIG 2
-
-#define PDC_BLOCK_TLB  18              /* manage hardware block-TLB    */
-#define PDC_BTLB_INFO          0       /* returns parameter            */
-#define PDC_BTLB_INSERT                1       /* insert BTLB entry            */
-#define PDC_BTLB_PURGE         2       /* purge BTLB entries           */
-#define PDC_BTLB_PURGE_ALL     3       /* purge all BTLB entries       */
-
-#define PDC_TLB                19              /* manage hardware TLB miss handling */
-#define PDC_TLB_INFO           0       /* returns parameter            */
-#define PDC_TLB_SETUP          1       /* set up miss handling         */
-
-#define PDC_MEM                20              /* Manage memory                */
-#define PDC_MEM_MEMINFO                0
-#define PDC_MEM_ADD_PAGE       1
-#define PDC_MEM_CLEAR_PDT      2
-#define PDC_MEM_READ_PDT       3
-#define PDC_MEM_RESET_CLEAR    4
-#define PDC_MEM_GOODMEM                5
-#define PDC_MEM_TABLE          128     /* Non contig mem map (sprockets) */
-#define PDC_MEM_RETURN_ADDRESS_TABLE   PDC_MEM_TABLE
-#define PDC_MEM_GET_MEMORY_SYSTEM_TABLES_SIZE  131
-#define PDC_MEM_GET_MEMORY_SYSTEM_TABLES       132
-#define PDC_MEM_GET_PHYSICAL_LOCATION_FROM_MEMORY_ADDRESS 133
-
-#define PDC_MEM_RET_SBE_REPLACED       5       /* PDC_MEM return values */
-#define PDC_MEM_RET_DUPLICATE_ENTRY    4
-#define PDC_MEM_RET_BUF_SIZE_SMALL     1
-#define PDC_MEM_RET_PDT_FULL           -11
-#define PDC_MEM_RET_INVALID_PHYSICAL_LOCATION ~0ULL
-
-#define PDC_PSW                21              /* Get/Set default System Mask  */
-#define PDC_PSW_MASK           0       /* Return mask                  */
-#define PDC_PSW_GET_DEFAULTS   1       /* Return defaults              */
-#define PDC_PSW_SET_DEFAULTS   2       /* Set default                  */
-#define PDC_PSW_ENDIAN_BIT     1       /* set for big endian           */
-#define PDC_PSW_WIDE_BIT       2       /* set for wide mode            */ 
-
-#define PDC_SYSTEM_MAP 22              /* find system modules          */
-#define PDC_FIND_MODULE        0
-#define PDC_FIND_ADDRESS       1
-#define PDC_TRANSLATE_PATH     2
-
-#define PDC_SOFT_POWER 23              /* soft power switch            */
-#define PDC_SOFT_POWER_INFO    0       /* return info about the soft power switch */
-#define PDC_SOFT_POWER_ENABLE  1       /* enable/disable soft power switch */
-
-
-/* HVERSION dependent */
-
-/* The PDC_MEM_MAP calls */
-#define PDC_MEM_MAP    128             /* on s700: return page info    */
-#define PDC_MEM_MAP_HPA                0       /* returns hpa of a module      */
-
-#define PDC_EEPROM     129             /* EEPROM access                */
-#define PDC_EEPROM_READ_WORD   0
-#define PDC_EEPROM_WRITE_WORD  1
-#define PDC_EEPROM_READ_BYTE   2
-#define PDC_EEPROM_WRITE_BYTE  3
-#define PDC_EEPROM_EEPROM_PASSWORD -1000
-
-#define PDC_NVM                130             /* NVM (non-volatile memory) access */
-#define PDC_NVM_READ_WORD      0
-#define PDC_NVM_WRITE_WORD     1
-#define PDC_NVM_READ_BYTE      2
-#define PDC_NVM_WRITE_BYTE     3
-
-#define PDC_SEED_ERROR 132             /* (sprockets)                  */
-
-#define PDC_IO         135             /* log error info, reset IO system */
-#define PDC_IO_READ_AND_CLEAR_ERRORS   0
-#define PDC_IO_RESET                   1
-#define PDC_IO_RESET_DEVICES           2
-/* sets bits 6&7 (little endian) of the HcControl Register */
-#define PDC_IO_USB_SUSPEND     0xC000000000000000
-#define PDC_IO_EEPROM_IO_ERR_TABLE_FULL        -5      /* return value */
-#define PDC_IO_NO_SUSPEND              -6      /* return value */
-
-#define PDC_BROADCAST_RESET 136                /* reset all processors         */
-#define PDC_DO_RESET           0       /* option: perform a broadcast reset */
-#define PDC_DO_FIRM_TEST_RESET 1       /* Do broadcast reset with bitmap */
-#define PDC_BR_RECONFIGURATION 2       /* reset w/reconfiguration      */
-#define PDC_FIRM_TEST_MAGIC    0xab9ec36fUL    /* for this reboot only */
-
-#define PDC_LAN_STATION_ID 138         /* Hversion dependent mechanism for */
-#define PDC_LAN_STATION_ID_READ        0       /* getting the lan station address  */
-
-#define        PDC_LAN_STATION_ID_SIZE 6
-
-#define PDC_CHECK_RANGES 139           /* (sprockets)                  */
-
-#define PDC_NV_SECTIONS        141             /* (sprockets)                  */
-
-#define PDC_PERFORMANCE        142             /* performance monitoring       */
-
-#define PDC_SYSTEM_INFO        143             /* system information           */
-#define PDC_SYSINFO_RETURN_INFO_SIZE   0
-#define PDC_SYSINFO_RRETURN_SYS_INFO   1
-#define PDC_SYSINFO_RRETURN_ERRORS     2
-#define PDC_SYSINFO_RRETURN_WARNINGS   3
-#define PDC_SYSINFO_RETURN_REVISIONS   4
-#define PDC_SYSINFO_RRETURN_DIAGNOSE   5
-#define PDC_SYSINFO_RRETURN_HV_DIAGNOSE        1005
-
-#define PDC_RDR                144             /* (sprockets)                  */
-#define PDC_RDR_READ_BUFFER    0
-#define PDC_RDR_READ_SINGLE    1
-#define PDC_RDR_WRITE_SINGLE   2
-
-#define PDC_INTRIGUE   145             /* (sprockets)                  */
-#define PDC_INTRIGUE_WRITE_BUFFER       0
-#define PDC_INTRIGUE_GET_SCRATCH_BUFSIZE 1
-#define PDC_INTRIGUE_START_CPU_COUNTERS         2
-#define PDC_INTRIGUE_STOP_CPU_COUNTERS  3
-
-#define PDC_STI                146             /* STI access                   */
-/* same as PDC_PCI_XXX values (see below) */
-
-/* Legacy PDC definitions for same stuff */
-#define PDC_PCI_INDEX  147
-#define PDC_PCI_INTERFACE_INFO         0
-#define PDC_PCI_SLOT_INFO              1
-#define PDC_PCI_INFLIGHT_BYTES         2
-#define PDC_PCI_READ_CONFIG            3
-#define PDC_PCI_WRITE_CONFIG           4
-#define PDC_PCI_READ_PCI_IO            5
-#define PDC_PCI_WRITE_PCI_IO           6
-#define PDC_PCI_READ_CONFIG_DELAY      7
-#define PDC_PCI_UPDATE_CONFIG_DELAY    8
-#define PDC_PCI_PCI_PATH_TO_PCI_HPA    9
-#define PDC_PCI_PCI_HPA_TO_PCI_PATH    10
-#define PDC_PCI_PCI_PATH_TO_PCI_BUS    11
-#define PDC_PCI_PCI_RESERVED           12
-#define PDC_PCI_PCI_INT_ROUTE_SIZE     13
-#define PDC_PCI_GET_INT_TBL_SIZE       PDC_PCI_PCI_INT_ROUTE_SIZE
-#define PDC_PCI_PCI_INT_ROUTE          14
-#define PDC_PCI_GET_INT_TBL            PDC_PCI_PCI_INT_ROUTE 
-#define PDC_PCI_READ_MON_TYPE          15
-#define PDC_PCI_WRITE_MON_TYPE         16
-
-
-/* Get SCSI Interface Card info:  SDTR, SCSI ID, mode (SE vs LVD) */
-#define PDC_INITIATOR  163
-#define PDC_GET_INITIATOR      0
-#define PDC_SET_INITIATOR      1
-#define PDC_DELETE_INITIATOR   2
-#define PDC_RETURN_TABLE_SIZE  3
-#define PDC_RETURN_TABLE       4
-
-#define PDC_LINK       165             /* (sprockets)                  */
-#define PDC_LINK_PCI_ENTRY_POINTS      0  /* list (Arg1) = 0 */
-#define PDC_LINK_USB_ENTRY_POINTS      1  /* list (Arg1) = 1 */
-
-/* cl_class
- * page 3-33 of IO-Firmware ARS
- * IODC ENTRY_INIT(Search first) RET[1]
- */
-#define        CL_NULL         0       /* invalid */
-#define        CL_RANDOM       1       /* random access (as disk) */
-#define        CL_SEQU         2       /* sequential access (as tape) */
-#define        CL_DUPLEX       7       /* full-duplex point-to-point (RS-232, Net) */
-#define        CL_KEYBD        8       /* half-duplex console (HIL Keyboard) */
-#define        CL_DISPL        9       /* half-duplex console (display) */
-#define        CL_FC           10      /* FiberChannel access media */
-
-/* IODC ENTRY_INIT() */
-#define ENTRY_INIT_SRCH_FRST   2
-#define ENTRY_INIT_SRCH_NEXT   3
-#define ENTRY_INIT_MOD_DEV     4
-#define ENTRY_INIT_DEV         5
-#define ENTRY_INIT_MOD         6
-#define ENTRY_INIT_MSG         9
-
-/* IODC ENTRY_IO() */
-#define ENTRY_IO_BOOTIN                0
-#define ENTRY_IO_BOOTOUT       1
-#define ENTRY_IO_CIN           2
-#define ENTRY_IO_COUT          3
-#define ENTRY_IO_CLOSE         4
-#define ENTRY_IO_GETMSG                9
-#define ENTRY_IO_BBLOCK_IN     16
-#define ENTRY_IO_BBLOCK_OUT    17
-
-/* IODC ENTRY_SPA() */
-
-/* IODC ENTRY_CONFIG() */
-
-/* IODC ENTRY_TEST() */
-
-/* IODC ENTRY_TLB() */
-
-/* constants for OS (NVM...) */
-#define OS_ID_NONE             0       /* Undefined OS ID      */
-#define OS_ID_HPUX             1       /* HP-UX OS             */
-#define OS_ID_MPEXL            2       /* MPE XL OS            */
-#define OS_ID_OSF              3       /* OSF OS               */
-#define OS_ID_HPRT             4       /* HP-RT OS             */
-#define OS_ID_NOVEL            5       /* NOVELL OS            */
-#define OS_ID_LINUX            6       /* Linux                */
-
-
-/* constants for PDC_CHASSIS */
-#define OSTAT_OFF              0
-#define OSTAT_FLT              1 
-#define OSTAT_TEST             2
-#define OSTAT_INIT             3
-#define OSTAT_SHUT             4
-#define OSTAT_WARN             5
-#define OSTAT_RUN              6
-#define OSTAT_ON               7
-
-/* Page Zero constant offsets used by the HPMC handler */
-#define BOOT_CONSOLE_HPA_OFFSET  0x3c0
-#define BOOT_CONSOLE_SPA_OFFSET  0x3c4
-#define BOOT_CONSOLE_PATH_OFFSET 0x3a8
-
-/* size of the pdc_result buffer for firmware.c */
-#define NUM_PDC_RESULT 32
+#include <uapi/asm/pdc.h>
 
 #if !defined(__ASSEMBLY__)
 
-#include <linux/types.h>
-
-#ifdef __KERNEL__
-
 extern int pdc_type;
 
 /* Values for pdc_type */
@@ -673,88 +335,5 @@ static inline char * os_id_to_string(u16 os_id) {
        }
 }
 
-#endif /* __KERNEL__ */
-
-/* flags of the device_path */
-#define        PF_AUTOBOOT     0x80
-#define        PF_AUTOSEARCH   0x40
-#define        PF_TIMER        0x0F
-
-struct device_path {           /* page 1-69 */
-       unsigned char flags;    /* flags see above! */
-       unsigned char bc[6];    /* bus converter routing info */
-       unsigned char mod;
-       unsigned int  layers[6];/* device-specific layer-info */
-} __attribute__((aligned(8))) ;
-
-struct pz_device {
-       struct  device_path dp; /* see above */
-       /* struct       iomod *hpa; */
-       unsigned int hpa;       /* HPA base address */
-       /* char *spa; */
-       unsigned int spa;       /* SPA base address */
-       /* int  (*iodc_io)(struct iomod*, ...); */
-       unsigned int iodc_io;   /* device entry point */
-       short   pad;            /* reserved */
-       unsigned short cl_class;/* see below */
-} __attribute__((aligned(8))) ;
-
-struct zeropage {
-       /* [0x000] initialize vectors (VEC) */
-       unsigned int    vec_special;            /* must be zero */
-       /* int  (*vec_pow_fail)(void);*/
-       unsigned int    vec_pow_fail; /* power failure handler */
-       /* int  (*vec_toc)(void); */
-       unsigned int    vec_toc;
-       unsigned int    vec_toclen;
-       /* int  (*vec_rendz)(void); */
-       unsigned int vec_rendz;
-       int     vec_pow_fail_flen;
-       int     vec_pad[10];            
-       
-       /* [0x040] reserved processor dependent */
-       int     pad0[112];
-
-       /* [0x200] reserved */
-       int     pad1[84];
-
-       /* [0x350] memory configuration (MC) */
-       int     memc_cont;              /* contiguous mem size (bytes) */
-       int     memc_phsize;            /* physical memory size */
-       int     memc_adsize;            /* additional mem size, bytes of SPA space used by PDC */
-       unsigned int mem_pdc_hi;        /* used for 64-bit */
-
-       /* [0x360] various parameters for the boot-CPU */
-       /* unsigned int *mem_booterr[8]; */
-       unsigned int mem_booterr[8];    /* ptr to boot errors */
-       unsigned int mem_free;          /* first location, where OS can be loaded */
-       /* struct iomod *mem_hpa; */
-       unsigned int mem_hpa;           /* HPA of the boot-CPU */
-       /* int (*mem_pdc)(int, ...); */
-       unsigned int mem_pdc;           /* PDC entry point */
-       unsigned int mem_10msec;        /* number of clock ticks in 10msec */
-
-       /* [0x390] initial memory module (IMM) */
-       /* struct iomod *imm_hpa; */
-       unsigned int imm_hpa;           /* HPA of the IMM */
-       int     imm_soft_boot;          /* 0 = was hard boot, 1 = was soft boot */
-       unsigned int    imm_spa_size;           /* SPA size of the IMM in bytes */
-       unsigned int    imm_max_mem;            /* bytes of mem in IMM */
-
-       /* [0x3A0] boot console, display device and keyboard */
-       struct pz_device mem_cons;      /* description of console device */
-       struct pz_device mem_boot;      /* description of boot device */
-       struct pz_device mem_kbd;       /* description of keyboard device */
-
-       /* [0x430] reserved */
-       int     pad430[116];
-
-       /* [0x600] processor dependent */
-       __u32   pad600[1];
-       __u32   proc_sti;               /* pointer to STI ROM */
-       __u32   pad608[126];
-};
-
 #endif /* !defined(__ASSEMBLY__) */
-
 #endif /* _PARISC_PDC_H */
diff --git a/arch/parisc/include/asm/percpu.h b/arch/parisc/include/asm/percpu.h
deleted file mode 100644 (file)
index a0dcd19..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _PARISC_PERCPU_H
-#define _PARISC_PERCPU_H
-
-#include <asm-generic/percpu.h>
-
-#endif 
-
diff --git a/arch/parisc/include/asm/poll.h b/arch/parisc/include/asm/poll.h
deleted file mode 100644 (file)
index c98509d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/poll.h>
diff --git a/arch/parisc/include/asm/posix_types.h b/arch/parisc/include/asm/posix_types.h
deleted file mode 100644 (file)
index b934425..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __ARCH_PARISC_POSIX_TYPES_H
-#define __ARCH_PARISC_POSIX_TYPES_H
-
-/*
- * This file is generally used by user-level software, so you need to
- * be a little careful about namespace pollution etc.  Also, we cannot
- * assume GCC is being used.
- */
-
-typedef unsigned short         __kernel_mode_t;
-#define __kernel_mode_t __kernel_mode_t
-
-typedef unsigned short         __kernel_ipc_pid_t;
-#define __kernel_ipc_pid_t __kernel_ipc_pid_t
-
-typedef int                    __kernel_suseconds_t;
-#define __kernel_suseconds_t __kernel_suseconds_t
-
-typedef long long              __kernel_off64_t;
-typedef unsigned long long     __kernel_ino64_t;
-
-#include <asm-generic/posix_types.h>
-
-#endif
index 250ae35aa06220d7b4a3072ac447d0b14271eee6..a2db278a5def69c4a6ac4745c3685e45600df156 100644 (file)
@@ -1,49 +1,11 @@
-#ifndef _PARISC_PTRACE_H
-#define _PARISC_PTRACE_H
-
 /* written by Philipp Rumpf, Copyright (C) 1999 SuSE GmbH Nuernberg
 ** Copyright (C) 2000 Grant Grundler, Hewlett-Packard
 */
+#ifndef _PARISC_PTRACE_H
+#define _PARISC_PTRACE_H
 
-#include <linux/types.h>
-
-/* This struct defines the way the registers are stored on the 
- * stack during a system call.
- *
- * N.B. gdb/strace care about the size and offsets within this
- * structure. If you change things, you may break object compatibility
- * for those applications.
- */
-
-struct pt_regs {
-       unsigned long gr[32];   /* PSW is in gr[0] */
-       __u64 fr[32];
-       unsigned long sr[ 8];
-       unsigned long iasq[2];
-       unsigned long iaoq[2];
-       unsigned long cr27;
-       unsigned long pad0;     /* available for other uses */
-       unsigned long orig_r28;
-       unsigned long ksp;
-       unsigned long kpc;
-       unsigned long sar;      /* CR11 */
-       unsigned long iir;      /* CR19 */
-       unsigned long isr;      /* CR20 */
-       unsigned long ior;      /* CR21 */
-       unsigned long ipsw;     /* CR22 */
-};
-
-/*
- * The numbers chosen here are somewhat arbitrary but absolutely MUST
- * not overlap with any of the number assigned in <linux/ptrace.h>.
- *
- * These ones are taken from IA-64 on the assumption that theirs are
- * the most correct (and we also want to support PTRACE_SINGLEBLOCK
- * since we have taken branch traps too)
- */
-#define PTRACE_SINGLEBLOCK     12      /* resume execution until next branch */
+#include <uapi/asm/ptrace.h>
 
-#ifdef __KERNEL__
 
 #define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
 
@@ -58,6 +20,4 @@ struct pt_regs {
 unsigned long profile_pc(struct pt_regs *);
 
 
-#endif /* __KERNEL__ */
-
 #endif
diff --git a/arch/parisc/include/asm/real.h b/arch/parisc/include/asm/real.h
deleted file mode 100644 (file)
index 82acb25..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifndef _PARISC_REAL_H
-#define _PARISC_REAL_H
-
-
-#endif
diff --git a/arch/parisc/include/asm/resource.h b/arch/parisc/include/asm/resource.h
deleted file mode 100644 (file)
index 8b06343..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _ASM_PARISC_RESOURCE_H
-#define _ASM_PARISC_RESOURCE_H
-
-#define _STK_LIM_MAX   10 * _STK_LIM
-#include <asm-generic/resource.h>
-
-#endif
diff --git a/arch/parisc/include/asm/segment.h b/arch/parisc/include/asm/segment.h
deleted file mode 100644 (file)
index 26794dd..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __PARISC_SEGMENT_H
-#define __PARISC_SEGMENT_H
-
-/* Only here because we have some old header files that expect it.. */
-
-#endif
diff --git a/arch/parisc/include/asm/sembuf.h b/arch/parisc/include/asm/sembuf.h
deleted file mode 100644 (file)
index 1e59ffd..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef _PARISC_SEMBUF_H
-#define _PARISC_SEMBUF_H
-
-/* 
- * The semid64_ds structure for parisc architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 64-bit time_t to solve y2038 problem
- * - 2 miscellaneous 32-bit values
- */
-
-struct semid64_ds {
-       struct ipc64_perm sem_perm;             /* permissions .. see ipc.h */
-#ifndef CONFIG_64BIT
-       unsigned int    __pad1;
-#endif
-       __kernel_time_t sem_otime;              /* last semop time */
-#ifndef CONFIG_64BIT
-       unsigned int    __pad2;
-#endif
-       __kernel_time_t sem_ctime;              /* last change time */
-       unsigned int    sem_nsems;              /* no. of semaphores in array */
-       unsigned int    __unused1;
-       unsigned int    __unused2;
-};
-
-#endif /* _PARISC_SEMBUF_H */
diff --git a/arch/parisc/include/asm/setup.h b/arch/parisc/include/asm/setup.h
deleted file mode 100644 (file)
index 7da2e5b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _PARISC_SETUP_H
-#define _PARISC_SETUP_H
-
-#define COMMAND_LINE_SIZE      1024
-
-#endif /* _PARISC_SETUP_H */
diff --git a/arch/parisc/include/asm/shmbuf.h b/arch/parisc/include/asm/shmbuf.h
deleted file mode 100644 (file)
index 0a3eada..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _PARISC_SHMBUF_H
-#define _PARISC_SHMBUF_H
-
-/* 
- * The shmid64_ds structure for parisc architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 64-bit time_t to solve y2038 problem
- * - 2 miscellaneous 32-bit values
- */
-
-struct shmid64_ds {
-       struct ipc64_perm       shm_perm;       /* operation perms */
-#ifndef CONFIG_64BIT
-       unsigned int            __pad1;
-#endif
-       __kernel_time_t         shm_atime;      /* last attach time */
-#ifndef CONFIG_64BIT
-       unsigned int            __pad2;
-#endif
-       __kernel_time_t         shm_dtime;      /* last detach time */
-#ifndef CONFIG_64BIT
-       unsigned int            __pad3;
-#endif
-       __kernel_time_t         shm_ctime;      /* last change time */
-#ifndef CONFIG_64BIT
-       unsigned int            __pad4;
-#endif
-       size_t                  shm_segsz;      /* size of segment (bytes) */
-       __kernel_pid_t          shm_cpid;       /* pid of creator */
-       __kernel_pid_t          shm_lpid;       /* pid of last operator */
-       unsigned int            shm_nattch;     /* no. of current attaches */
-       unsigned int            __unused1;
-       unsigned int            __unused2;
-};
-
-#ifdef CONFIG_64BIT
-/* The 'unsigned int' (formerly 'unsigned long') data types below will
- * ensure that a 32-bit app calling shmctl(*,IPC_INFO,*) will work on
- * a wide kernel, but if some of these values are meant to contain pointers
- * they may need to be 'long long' instead. -PB XXX FIXME
- */
-#endif
-struct shminfo64 {
-       unsigned int    shmmax;
-       unsigned int    shmmin;
-       unsigned int    shmmni;
-       unsigned int    shmseg;
-       unsigned int    shmall;
-       unsigned int    __unused1;
-       unsigned int    __unused2;
-       unsigned int    __unused3;
-       unsigned int    __unused4;
-};
-
-#endif /* _PARISC_SHMBUF_H */
diff --git a/arch/parisc/include/asm/sigcontext.h b/arch/parisc/include/asm/sigcontext.h
deleted file mode 100644 (file)
index 27ef31b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef _ASMPARISC_SIGCONTEXT_H
-#define _ASMPARISC_SIGCONTEXT_H
-
-#define PARISC_SC_FLAG_ONSTACK 1<<0
-#define PARISC_SC_FLAG_IN_SYSCALL 1<<1
-
-/* We will add more stuff here as it becomes necessary, until we know
-   it works. */
-struct sigcontext {
-       unsigned long sc_flags;
-
-       unsigned long sc_gr[32]; /* PSW in sc_gr[0] */
-       unsigned long long sc_fr[32]; /* FIXME, do we need other state info? */
-       unsigned long sc_iasq[2];
-       unsigned long sc_iaoq[2];
-       unsigned long sc_sar; /* cr11 */
-};
-
-
-#endif
diff --git a/arch/parisc/include/asm/siginfo.h b/arch/parisc/include/asm/siginfo.h
deleted file mode 100644 (file)
index d703472..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _PARISC_SIGINFO_H
-#define _PARISC_SIGINFO_H
-
-#include <asm-generic/siginfo.h>
-
-#undef NSIGTRAP
-#define NSIGTRAP       4
-
-#endif
index c20356375d1d5630f07d98ed27212b6e5d08a257..21abf4fc169a3086123327a6528dd302498a1b8b 100644 (file)
 #ifndef _ASM_PARISC_SIGNAL_H
 #define _ASM_PARISC_SIGNAL_H
 
-#define SIGHUP          1
-#define SIGINT          2
-#define SIGQUIT                 3
-#define SIGILL          4
-#define SIGTRAP                 5
-#define SIGABRT                 6
-#define SIGIOT          6
-#define SIGEMT          7
-#define SIGFPE          8
-#define SIGKILL                 9
-#define SIGBUS         10
-#define SIGSEGV                11
-#define SIGSYS         12 /* Linux doesn't use this */
-#define SIGPIPE                13
-#define SIGALRM                14
-#define SIGTERM                15
-#define SIGUSR1                16
-#define SIGUSR2                17
-#define SIGCHLD                18
-#define SIGPWR         19
-#define SIGVTALRM      20
-#define SIGPROF                21
-#define SIGIO          22
-#define SIGPOLL                SIGIO
-#define SIGWINCH       23
-#define SIGSTOP                24
-#define SIGTSTP                25
-#define SIGCONT                26
-#define SIGTTIN                27
-#define SIGTTOU                28
-#define SIGURG         29
-#define SIGLOST                30 /* Linux doesn't use this either */
-#define        SIGUNUSED       31
-#define SIGRESERVE     SIGUNUSED
+#include <uapi/asm/signal.h>
 
-#define SIGXCPU                33
-#define SIGXFSZ                34
-#define SIGSTKFLT      36
-
-/* These should not be considered constants from userland.  */
-#define SIGRTMIN       37
-#define SIGRTMAX       _NSIG /* it's 44 under HP/UX */
-
-/*
- * SA_FLAGS values:
- *
- * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_RESTART flag to get restarting signals (which were the default long ago)
- * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
- * SA_RESETHAND clears the handler when the signal is delivered.
- * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
- * SA_NODEFER prevents the current signal from being masked in the handler.
- *
- * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
- * Unix names RESETHAND and NODEFER respectively.
- */
-#define SA_ONSTACK     0x00000001
-#define SA_RESETHAND   0x00000004
-#define SA_NOCLDSTOP   0x00000008
-#define SA_SIGINFO     0x00000010
-#define SA_NODEFER     0x00000020
-#define SA_RESTART     0x00000040
-#define SA_NOCLDWAIT   0x00000080
-#define _SA_SIGGFAULT  0x00000100 /* HPUX */
-
-#define SA_NOMASK      SA_NODEFER
-#define SA_ONESHOT     SA_RESETHAND
-
-#define SA_RESTORER    0x04000000 /* obsolete -- ignored */
-
-/* 
- * sigaltstack controls
- */
-#define SS_ONSTACK     1
-#define SS_DISABLE     2
-
-#define MINSIGSTKSZ    2048
-#define SIGSTKSZ       8192
-
-#ifdef __KERNEL__
 
 #define _NSIG          64
 /* bits-per-word, where word apparently means 'long' not 'int' */
 #define _NSIG_BPW      BITS_PER_LONG
 #define _NSIG_WORDS    (_NSIG / _NSIG_BPW)
 
-#endif /* __KERNEL__ */
-
-#define SIG_BLOCK          0   /* for blocking signals */
-#define SIG_UNBLOCK        1   /* for unblocking signals */
-#define SIG_SETMASK        2   /* for setting the signal mask */
-
-#define SIG_DFL        ((__sighandler_t)0)     /* default signal handling */
-#define SIG_IGN        ((__sighandler_t)1)     /* ignore signal */
-#define SIG_ERR        ((__sighandler_t)-1)    /* error return from signal */
-
 # ifndef __ASSEMBLY__
-
-#  include <linux/types.h>
-
-/* Avoid too many header ordering problems.  */
-struct siginfo;
-
-/* Type of a signal handler.  */
 #ifdef CONFIG_64BIT
-/* function pointers on 64-bit parisc are pointers to little structs and the
- * compiler doesn't support code which changes or tests the address of
- * the function in the little struct.  This is really ugly -PB
- */
-typedef char __user *__sighandler_t;
 #else
-typedef void __signalfn_t(int);
-typedef __signalfn_t __user *__sighandler_t;
 #endif
 
-typedef struct sigaltstack {
-       void __user *ss_sp;
-       int ss_flags;
-       size_t ss_size;
-} stack_t;
-
-#ifdef __KERNEL__
-
 /* Most things should be clean enough to redefine this at will, if care
    is taken to make libc match.  */
 
@@ -148,6 +38,5 @@ struct k_sigaction {
 
 #include <asm/sigcontext.h>
 
-#endif /* __KERNEL__ */
 #endif /* !__ASSEMBLY */
 #endif /* _ASM_PARISC_SIGNAL_H */
diff --git a/arch/parisc/include/asm/socket.h b/arch/parisc/include/asm/socket.h
deleted file mode 100644 (file)
index 1b52c2c..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef _ASM_SOCKET_H
-#define _ASM_SOCKET_H
-
-#include <asm/sockios.h>
-
-/* For setsockopt(2) */
-#define SOL_SOCKET     0xffff
-
-#define SO_DEBUG       0x0001
-#define SO_REUSEADDR   0x0004
-#define SO_KEEPALIVE   0x0008
-#define SO_DONTROUTE   0x0010
-#define SO_BROADCAST   0x0020
-#define SO_LINGER      0x0080
-#define SO_OOBINLINE   0x0100
-/* To add :#define SO_REUSEPORT 0x0200 */
-#define SO_SNDBUF      0x1001
-#define SO_RCVBUF      0x1002
-#define SO_SNDBUFFORCE 0x100a
-#define SO_RCVBUFFORCE 0x100b
-#define SO_SNDLOWAT    0x1003
-#define SO_RCVLOWAT    0x1004
-#define SO_SNDTIMEO    0x1005
-#define SO_RCVTIMEO    0x1006
-#define SO_ERROR       0x1007
-#define SO_TYPE                0x1008
-#define SO_PROTOCOL    0x1028
-#define SO_DOMAIN      0x1029
-#define SO_PEERNAME    0x2000
-
-#define SO_NO_CHECK    0x400b
-#define SO_PRIORITY    0x400c
-#define SO_BSDCOMPAT   0x400e
-#define SO_PASSCRED    0x4010
-#define SO_PEERCRED    0x4011
-#define SO_TIMESTAMP   0x4012
-#define SCM_TIMESTAMP  SO_TIMESTAMP
-#define SO_TIMESTAMPNS 0x4013
-#define SCM_TIMESTAMPNS        SO_TIMESTAMPNS
-
-/* Security levels - as per NRL IPv6 - don't actually do anything */
-#define SO_SECURITY_AUTHENTICATION             0x4016
-#define SO_SECURITY_ENCRYPTION_TRANSPORT       0x4017
-#define SO_SECURITY_ENCRYPTION_NETWORK         0x4018
-
-#define SO_BINDTODEVICE        0x4019
-
-/* Socket filtering */
-#define SO_ATTACH_FILTER        0x401a
-#define SO_DETACH_FILTER        0x401b
-
-#define SO_ACCEPTCONN          0x401c
-
-#define SO_PEERSEC             0x401d
-#define SO_PASSSEC             0x401e
-
-#define SO_MARK                        0x401f
-
-#define SO_TIMESTAMPING                0x4020
-#define SCM_TIMESTAMPING       SO_TIMESTAMPING
-
-#define SO_RXQ_OVFL             0x4021
-
-#define SO_WIFI_STATUS         0x4022
-#define SCM_WIFI_STATUS                SO_WIFI_STATUS
-#define SO_PEEK_OFF            0x4023
-
-/* Instruct lower device to use last 4-bytes of skb data as FCS */
-#define SO_NOFCS               0x4024
-
-
-/* O_NONBLOCK clashes with the bits used for socket types.  Therefore we
- * have to define SOCK_NONBLOCK to a different value here.
- */
-#define SOCK_NONBLOCK   0x40000000
-
-#endif /* _ASM_SOCKET_H */
diff --git a/arch/parisc/include/asm/sockios.h b/arch/parisc/include/asm/sockios.h
deleted file mode 100644 (file)
index dabfbc7..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __ARCH_PARISC_SOCKIOS__
-#define __ARCH_PARISC_SOCKIOS__
-
-/* Socket-level I/O control calls. */
-#define FIOSETOWN      0x8901
-#define SIOCSPGRP      0x8902
-#define FIOGETOWN      0x8903
-#define SIOCGPGRP      0x8904
-#define SIOCATMARK     0x8905
-#define SIOCGSTAMP     0x8906          /* Get stamp (timeval) */
-#define SIOCGSTAMPNS   0x8907          /* Get stamp (timespec) */
-
-#endif
diff --git a/arch/parisc/include/asm/stat.h b/arch/parisc/include/asm/stat.h
deleted file mode 100644 (file)
index d76fbda..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef _PARISC_STAT_H
-#define _PARISC_STAT_H
-
-#include <linux/types.h>
-
-struct stat {
-       unsigned int    st_dev;         /* dev_t is 32 bits on parisc */
-       ino_t           st_ino;         /* 32 bits */
-       mode_t          st_mode;        /* 16 bits */
-       unsigned short  st_nlink;       /* 16 bits */
-       unsigned short  st_reserved1;   /* old st_uid */
-       unsigned short  st_reserved2;   /* old st_gid */
-       unsigned int    st_rdev;
-       off_t           st_size;
-       time_t          st_atime;
-       unsigned int    st_atime_nsec;
-       time_t          st_mtime;
-       unsigned int    st_mtime_nsec;
-       time_t          st_ctime;
-       unsigned int    st_ctime_nsec;
-       int             st_blksize;
-       int             st_blocks;
-       unsigned int    __unused1;      /* ACL stuff */
-       unsigned int    __unused2;      /* network */
-       ino_t           __unused3;      /* network */
-       unsigned int    __unused4;      /* cnodes */
-       unsigned short  __unused5;      /* netsite */
-       short           st_fstype;
-       unsigned int    st_realdev;
-       unsigned short  st_basemode;
-       unsigned short  st_spareshort;
-       uid_t           st_uid;
-       gid_t           st_gid;
-       unsigned int    st_spare4[3];
-};
-
-#define STAT_HAVE_NSEC
-
-typedef __kernel_off64_t       off64_t;
-
-struct hpux_stat64 {
-       unsigned int    st_dev;         /* dev_t is 32 bits on parisc */
-       ino_t           st_ino;         /* 32 bits */
-       mode_t          st_mode;        /* 16 bits */
-       unsigned short  st_nlink;       /* 16 bits */
-       unsigned short  st_reserved1;   /* old st_uid */
-       unsigned short  st_reserved2;   /* old st_gid */
-       unsigned int    st_rdev;
-       off64_t         st_size;
-       time_t          st_atime;
-       unsigned int    st_spare1;
-       time_t          st_mtime;
-       unsigned int    st_spare2;
-       time_t          st_ctime;
-       unsigned int    st_spare3;
-       int             st_blksize;
-       __u64           st_blocks;
-       unsigned int    __unused1;      /* ACL stuff */
-       unsigned int    __unused2;      /* network */
-       ino_t           __unused3;      /* network */
-       unsigned int    __unused4;      /* cnodes */
-       unsigned short  __unused5;      /* netsite */
-       short           st_fstype;
-       unsigned int    st_realdev;
-       unsigned short  st_basemode;
-       unsigned short  st_spareshort;
-       uid_t           st_uid;
-       gid_t           st_gid;
-       unsigned int    st_spare4[3];
-};
-
-/* This is the struct that 32-bit userspace applications are expecting.
- * How 64-bit apps are going to be compiled, I have no idea.  But at least
- * this way, we don't have a wrapper in the kernel.
- */
-struct stat64 {
-       unsigned long long      st_dev;
-       unsigned int            __pad1;
-
-       unsigned int            __st_ino;       /* Not actually filled in */
-       unsigned int            st_mode;
-       unsigned int            st_nlink;
-       unsigned int            st_uid;
-       unsigned int            st_gid;
-       unsigned long long      st_rdev;
-       unsigned int            __pad2;
-       signed long long        st_size;
-       signed int              st_blksize;
-
-       signed long long        st_blocks;
-       signed int              st_atime;
-       unsigned int            st_atime_nsec;
-       signed int              st_mtime;
-       unsigned int            st_mtime_nsec;
-       signed int              st_ctime;
-       unsigned int            st_ctime_nsec;
-       unsigned long long      st_ino;
-};
-
-#endif
diff --git a/arch/parisc/include/asm/statfs.h b/arch/parisc/include/asm/statfs.h
deleted file mode 100644 (file)
index 324bea9..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _PARISC_STATFS_H
-#define _PARISC_STATFS_H
-
-#define __statfs_word long
-#include <asm-generic/statfs.h>
-
-#endif
diff --git a/arch/parisc/include/asm/swab.h b/arch/parisc/include/asm/swab.h
deleted file mode 100644 (file)
index e78403b..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef _PARISC_SWAB_H
-#define _PARISC_SWAB_H
-
-#include <linux/types.h>
-#include <linux/compiler.h>
-
-#define __SWAB_64_THRU_32__
-
-static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
-{
-       __asm__("dep %0, 15, 8, %0\n\t"         /* deposit 00ab -> 0bab */
-               "shd %%r0, %0, 8, %0"           /* shift 000000ab -> 00ba */
-               : "=r" (x)
-               : "0" (x));
-       return x;
-}
-#define __arch_swab16 __arch_swab16
-
-static inline __attribute_const__ __u32 __arch_swab24(__u32 x)
-{
-       __asm__("shd %0, %0, 8, %0\n\t"         /* shift xabcxabc -> cxab */
-               "dep %0, 15, 8, %0\n\t"         /* deposit cxab -> cbab */
-               "shd %%r0, %0, 8, %0"           /* shift 0000cbab -> 0cba */
-               : "=r" (x)
-               : "0" (x));
-       return x;
-}
-
-static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
-{
-       unsigned int temp;
-       __asm__("shd %0, %0, 16, %1\n\t"        /* shift abcdabcd -> cdab */
-               "dep %1, 15, 8, %1\n\t"         /* deposit cdab -> cbab */
-               "shd %0, %1, 8, %0"             /* shift abcdcbab -> dcba */
-               : "=r" (x), "=&r" (temp)
-               : "0" (x));
-       return x;
-}
-#define __arch_swab32 __arch_swab32
-
-#if BITS_PER_LONG > 32
-/*
-** From "PA-RISC 2.0 Architecture", HP Professional Books.
-** See Appendix I page 8 , "Endian Byte Swapping".
-**
-** Pretty cool algorithm: (* == zero'd bits)
-**      PERMH   01234567 -> 67452301 into %0
-**      HSHL    67452301 -> 7*5*3*1* into %1
-**      HSHR    67452301 -> *6*4*2*0 into %0
-**      OR      %0 | %1  -> 76543210 into %0 (all done!)
-*/
-static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
-{
-       __u64 temp;
-       __asm__("permh,3210 %0, %0\n\t"
-               "hshl %0, 8, %1\n\t"
-               "hshr,u %0, 8, %0\n\t"
-               "or %1, %0, %0"
-               : "=r" (x), "=&r" (temp)
-               : "0" (x));
-       return x;
-}
-#define __arch_swab64 __arch_swab64
-#endif /* BITS_PER_LONG > 32 */
-
-#endif /* _PARISC_SWAB_H */
diff --git a/arch/parisc/include/asm/termbits.h b/arch/parisc/include/asm/termbits.h
deleted file mode 100644 (file)
index d1ab921..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-#ifndef __ARCH_PARISC_TERMBITS_H__
-#define __ARCH_PARISC_TERMBITS_H__
-
-#include <linux/posix_types.h>
-
-typedef unsigned char  cc_t;
-typedef unsigned int   speed_t;
-typedef unsigned int   tcflag_t;
-
-#define NCCS 19
-struct termios {
-       tcflag_t c_iflag;               /* input mode flags */
-       tcflag_t c_oflag;               /* output mode flags */
-       tcflag_t c_cflag;               /* control mode flags */
-       tcflag_t c_lflag;               /* local mode flags */
-       cc_t c_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-};
-
-struct termios2 {
-       tcflag_t c_iflag;               /* input mode flags */
-       tcflag_t c_oflag;               /* output mode flags */
-       tcflag_t c_cflag;               /* control mode flags */
-       tcflag_t c_lflag;               /* local mode flags */
-       cc_t c_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-       speed_t c_ispeed;               /* input speed */
-       speed_t c_ospeed;               /* output speed */
-};
-
-struct ktermios {
-       tcflag_t c_iflag;               /* input mode flags */
-       tcflag_t c_oflag;               /* output mode flags */
-       tcflag_t c_cflag;               /* control mode flags */
-       tcflag_t c_lflag;               /* local mode flags */
-       cc_t c_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-       speed_t c_ispeed;               /* input speed */
-       speed_t c_ospeed;               /* output speed */
-};
-
-/* c_cc characters */
-#define VINTR 0
-#define VQUIT 1
-#define VERASE 2
-#define VKILL 3
-#define VEOF 4
-#define VTIME 5
-#define VMIN 6
-#define VSWTC 7
-#define VSTART 8
-#define VSTOP 9
-#define VSUSP 10
-#define VEOL 11
-#define VREPRINT 12
-#define VDISCARD 13
-#define VWERASE 14
-#define VLNEXT 15
-#define VEOL2 16
-
-
-/* c_iflag bits */
-#define IGNBRK 0000001
-#define BRKINT 0000002
-#define IGNPAR 0000004
-#define PARMRK 0000010
-#define INPCK  0000020
-#define ISTRIP 0000040
-#define INLCR  0000100
-#define IGNCR  0000200
-#define ICRNL  0000400
-#define IUCLC  0001000
-#define IXON   0002000
-#define IXANY  0004000
-#define IXOFF  0010000
-#define IMAXBEL        0040000
-#define IUTF8  0100000
-
-/* c_oflag bits */
-#define OPOST  0000001
-#define OLCUC  0000002
-#define ONLCR  0000004
-#define OCRNL  0000010
-#define ONOCR  0000020
-#define ONLRET 0000040
-#define OFILL  0000100
-#define OFDEL  0000200
-#define NLDLY  0000400
-#define   NL0  0000000
-#define   NL1  0000400
-#define CRDLY  0003000
-#define   CR0  0000000
-#define   CR1  0001000
-#define   CR2  0002000
-#define   CR3  0003000
-#define TABDLY 0014000
-#define   TAB0 0000000
-#define   TAB1 0004000
-#define   TAB2 0010000
-#define   TAB3 0014000
-#define   XTABS        0014000
-#define BSDLY  0020000
-#define   BS0  0000000
-#define   BS1  0020000
-#define VTDLY  0040000
-#define   VT0  0000000
-#define   VT1  0040000
-#define FFDLY  0100000
-#define   FF0  0000000
-#define   FF1  0100000
-
-/* c_cflag bit meaning */
-#define CBAUD   0010017
-#define  B0     0000000         /* hang up */
-#define  B50    0000001
-#define  B75    0000002
-#define  B110   0000003
-#define  B134   0000004
-#define  B150   0000005
-#define  B200   0000006
-#define  B300   0000007
-#define  B600   0000010
-#define  B1200  0000011
-#define  B1800  0000012
-#define  B2400  0000013
-#define  B4800  0000014
-#define  B9600  0000015
-#define  B19200 0000016
-#define  B38400 0000017
-#define EXTA B19200
-#define EXTB B38400
-#define CSIZE   0000060
-#define   CS5   0000000
-#define   CS6   0000020
-#define   CS7   0000040
-#define   CS8   0000060
-#define CSTOPB  0000100
-#define CREAD   0000200
-#define PARENB  0000400
-#define PARODD  0001000
-#define HUPCL   0002000
-#define CLOCAL  0004000
-#define CBAUDEX 0010000
-#define    BOTHER 0010000
-#define    B57600 0010001
-#define   B115200 0010002
-#define   B230400 0010003
-#define   B460800 0010004
-#define   B500000 0010005
-#define   B576000 0010006
-#define   B921600 0010007
-#define  B1000000 0010010
-#define  B1152000 0010011
-#define  B1500000 0010012
-#define  B2000000 0010013
-#define  B2500000 0010014
-#define  B3000000 0010015
-#define  B3500000 0010016
-#define  B4000000 0010017
-#define CIBAUD    002003600000         /* input baud rate */
-#define CMSPAR    010000000000          /* mark or space (stick) parity */
-#define CRTSCTS   020000000000          /* flow control */
-
-#define IBSHIFT        16              /* Shift from CBAUD to CIBAUD */
-
-
-/* c_lflag bits */
-#define ISIG    0000001
-#define ICANON  0000002
-#define XCASE   0000004
-#define ECHO    0000010
-#define ECHOE   0000020
-#define ECHOK   0000040
-#define ECHONL  0000100
-#define NOFLSH  0000200
-#define TOSTOP  0000400
-#define ECHOCTL 0001000
-#define ECHOPRT 0002000
-#define ECHOKE  0004000
-#define FLUSHO  0010000
-#define PENDIN  0040000
-#define IEXTEN  0100000
-#define EXTPROC        0200000
-
-/* tcflow() and TCXONC use these */
-#define        TCOOFF          0
-#define        TCOON           1
-#define        TCIOFF          2
-#define        TCION           3
-
-/* tcflush() and TCFLSH use these */
-#define        TCIFLUSH        0
-#define        TCOFLUSH        1
-#define        TCIOFLUSH       2
-
-/* tcsetattr uses these */
-#define        TCSANOW         0
-#define        TCSADRAIN       1
-#define        TCSAFLUSH       2
-
-#endif
index a2a57a4548af7bd6d7c745a54d755d6a8fa0418e..9bbc0c8974ea90fc6fc6b68c4614936007512952 100644 (file)
@@ -1,45 +1,8 @@
 #ifndef _PARISC_TERMIOS_H
 #define _PARISC_TERMIOS_H
 
-#include <asm/termbits.h>
-#include <asm/ioctls.h>
+#include <uapi/asm/termios.h>
 
-struct winsize {
-       unsigned short ws_row;
-       unsigned short ws_col;
-       unsigned short ws_xpixel;
-       unsigned short ws_ypixel;
-};
-
-#define NCC 8
-struct termio {
-       unsigned short c_iflag;         /* input mode flags */
-       unsigned short c_oflag;         /* output mode flags */
-       unsigned short c_cflag;         /* control mode flags */
-       unsigned short c_lflag;         /* local mode flags */
-       unsigned char c_line;           /* line discipline */
-       unsigned char c_cc[NCC];        /* control characters */
-};
-
-/* modem lines */
-#define TIOCM_LE       0x001
-#define TIOCM_DTR      0x002
-#define TIOCM_RTS      0x004
-#define TIOCM_ST       0x008
-#define TIOCM_SR       0x010
-#define TIOCM_CTS      0x020
-#define TIOCM_CAR      0x040
-#define TIOCM_RNG      0x080
-#define TIOCM_DSR      0x100
-#define TIOCM_CD       TIOCM_CAR
-#define TIOCM_RI       TIOCM_RNG
-#define TIOCM_OUT1     0x2000
-#define TIOCM_OUT2     0x4000
-#define TIOCM_LOOP     0x8000
-
-/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-
-#ifdef __KERNEL__
 
 /*     intr=^C         quit=^\         erase=del       kill=^U
        eof=^D          vtime=\0        vmin=\1         sxtc=\0
@@ -85,6 +48,4 @@ struct termio {
 #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
 #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
 
-#endif /* __KERNEL__ */
-
 #endif /* _PARISC_TERMIOS_H */
diff --git a/arch/parisc/include/asm/topology.h b/arch/parisc/include/asm/topology.h
deleted file mode 100644 (file)
index d8133eb..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_PARISC_TOPOLOGY_H
-#define _ASM_PARISC_TOPOLOGY_H
-
-#include <asm-generic/topology.h>
-
-#endif /* _ASM_PARISC_TOPOLOGY_H */
diff --git a/arch/parisc/include/asm/types.h b/arch/parisc/include/asm/types.h
deleted file mode 100644 (file)
index 8866f9b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _PARISC_TYPES_H
-#define _PARISC_TYPES_H
-
-#include <asm-generic/int-ll64.h>
-
-#endif
index d61de64f990af771e6d56a41beda7473f062060f..541639c3f60717487015518a5336475346ff5639 100644 (file)
@@ -1,840 +1,8 @@
 #ifndef _ASM_PARISC_UNISTD_H_
 #define _ASM_PARISC_UNISTD_H_
 
-/*
- * This file contains the system call numbers.
- */
-
-/*
- *   HP-UX system calls get their native numbers for binary compatibility.
- */
-
-#define __NR_HPUX_exit                    1
-#define __NR_HPUX_fork                    2
-#define __NR_HPUX_read                    3
-#define __NR_HPUX_write                   4
-#define __NR_HPUX_open                    5
-#define __NR_HPUX_close                   6
-#define __NR_HPUX_wait                    7
-#define __NR_HPUX_creat                   8
-#define __NR_HPUX_link                    9
-#define __NR_HPUX_unlink                 10
-#define __NR_HPUX_execv                  11
-#define __NR_HPUX_chdir                  12
-#define __NR_HPUX_time                   13
-#define __NR_HPUX_mknod                  14
-#define __NR_HPUX_chmod                  15
-#define __NR_HPUX_chown                  16
-#define __NR_HPUX_break                  17
-#define __NR_HPUX_lchmod                 18
-#define __NR_HPUX_lseek                  19
-#define __NR_HPUX_getpid                 20
-#define __NR_HPUX_mount                  21
-#define __NR_HPUX_umount                 22
-#define __NR_HPUX_setuid                 23
-#define __NR_HPUX_getuid                 24
-#define __NR_HPUX_stime                  25
-#define __NR_HPUX_ptrace                 26
-#define __NR_HPUX_alarm                  27
-#define __NR_HPUX_oldfstat               28
-#define __NR_HPUX_pause                  29
-#define __NR_HPUX_utime                  30
-#define __NR_HPUX_stty                   31
-#define __NR_HPUX_gtty                   32
-#define __NR_HPUX_access                 33
-#define __NR_HPUX_nice                   34
-#define __NR_HPUX_ftime                  35
-#define __NR_HPUX_sync                   36
-#define __NR_HPUX_kill                   37
-#define __NR_HPUX_stat                   38
-#define __NR_HPUX_setpgrp3               39
-#define __NR_HPUX_lstat                  40
-#define __NR_HPUX_dup                    41
-#define __NR_HPUX_pipe                   42
-#define __NR_HPUX_times                  43
-#define __NR_HPUX_profil                 44
-#define __NR_HPUX_ki_call                45
-#define __NR_HPUX_setgid                 46
-#define __NR_HPUX_getgid                 47
-#define __NR_HPUX_sigsys                 48
-#define __NR_HPUX_reserved1              49
-#define __NR_HPUX_reserved2              50
-#define __NR_HPUX_acct                   51
-#define __NR_HPUX_set_userthreadid       52
-#define __NR_HPUX_oldlock                53
-#define __NR_HPUX_ioctl                  54
-#define __NR_HPUX_reboot                 55
-#define __NR_HPUX_symlink                56
-#define __NR_HPUX_utssys                 57
-#define __NR_HPUX_readlink               58
-#define __NR_HPUX_execve                 59
-#define __NR_HPUX_umask                  60
-#define __NR_HPUX_chroot                 61
-#define __NR_HPUX_fcntl                  62
-#define __NR_HPUX_ulimit                 63
-#define __NR_HPUX_getpagesize            64
-#define __NR_HPUX_mremap                 65
-#define __NR_HPUX_vfork                  66
-#define __NR_HPUX_vread                  67
-#define __NR_HPUX_vwrite                 68
-#define __NR_HPUX_sbrk                   69
-#define __NR_HPUX_sstk                   70
-#define __NR_HPUX_mmap                   71
-#define __NR_HPUX_vadvise                72
-#define __NR_HPUX_munmap                 73
-#define __NR_HPUX_mprotect               74
-#define __NR_HPUX_madvise                75
-#define __NR_HPUX_vhangup                76
-#define __NR_HPUX_swapoff                77
-#define __NR_HPUX_mincore                78
-#define __NR_HPUX_getgroups              79
-#define __NR_HPUX_setgroups              80
-#define __NR_HPUX_getpgrp2               81
-#define __NR_HPUX_setpgrp2               82
-#define __NR_HPUX_setitimer              83
-#define __NR_HPUX_wait3                  84
-#define __NR_HPUX_swapon                 85
-#define __NR_HPUX_getitimer              86
-#define __NR_HPUX_gethostname42          87
-#define __NR_HPUX_sethostname42          88
-#define __NR_HPUX_getdtablesize          89
-#define __NR_HPUX_dup2                   90
-#define __NR_HPUX_getdopt                91
-#define __NR_HPUX_fstat                  92
-#define __NR_HPUX_select                 93
-#define __NR_HPUX_setdopt                94
-#define __NR_HPUX_fsync                  95
-#define __NR_HPUX_setpriority            96
-#define __NR_HPUX_socket_old             97
-#define __NR_HPUX_connect_old            98
-#define __NR_HPUX_accept_old             99
-#define __NR_HPUX_getpriority           100
-#define __NR_HPUX_send_old              101
-#define __NR_HPUX_recv_old              102
-#define __NR_HPUX_socketaddr_old        103
-#define __NR_HPUX_bind_old              104
-#define __NR_HPUX_setsockopt_old        105
-#define __NR_HPUX_listen_old            106
-#define __NR_HPUX_vtimes_old            107
-#define __NR_HPUX_sigvector             108
-#define __NR_HPUX_sigblock              109
-#define __NR_HPUX_siggetmask            110
-#define __NR_HPUX_sigpause              111
-#define __NR_HPUX_sigstack              112
-#define __NR_HPUX_recvmsg_old           113
-#define __NR_HPUX_sendmsg_old           114
-#define __NR_HPUX_vtrace_old            115
-#define __NR_HPUX_gettimeofday          116
-#define __NR_HPUX_getrusage             117
-#define __NR_HPUX_getsockopt_old        118
-#define __NR_HPUX_resuba_old            119
-#define __NR_HPUX_readv                 120
-#define __NR_HPUX_writev                121
-#define __NR_HPUX_settimeofday          122
-#define __NR_HPUX_fchown                123
-#define __NR_HPUX_fchmod                124
-#define __NR_HPUX_recvfrom_old          125
-#define __NR_HPUX_setresuid             126
-#define __NR_HPUX_setresgid             127
-#define __NR_HPUX_rename                128
-#define __NR_HPUX_truncate              129
-#define __NR_HPUX_ftruncate             130
-#define __NR_HPUX_flock_old             131
-#define __NR_HPUX_sysconf               132
-#define __NR_HPUX_sendto_old            133
-#define __NR_HPUX_shutdown_old          134
-#define __NR_HPUX_socketpair_old        135
-#define __NR_HPUX_mkdir                 136
-#define __NR_HPUX_rmdir                 137
-#define __NR_HPUX_utimes_old            138
-#define __NR_HPUX_sigcleanup_old        139
-#define __NR_HPUX_setcore               140
-#define __NR_HPUX_getpeername_old       141
-#define __NR_HPUX_gethostid             142
-#define __NR_HPUX_sethostid             143
-#define __NR_HPUX_getrlimit             144
-#define __NR_HPUX_setrlimit             145
-#define __NR_HPUX_killpg_old            146
-#define __NR_HPUX_cachectl              147
-#define __NR_HPUX_quotactl              148
-#define __NR_HPUX_get_sysinfo           149
-#define __NR_HPUX_getsockname_old       150
-#define __NR_HPUX_privgrp               151
-#define __NR_HPUX_rtprio                152
-#define __NR_HPUX_plock                 153
-#define __NR_HPUX_reserved3             154
-#define __NR_HPUX_lockf                 155
-#define __NR_HPUX_semget                156
-#define __NR_HPUX_osemctl               157
-#define __NR_HPUX_semop                 158
-#define __NR_HPUX_msgget                159
-#define __NR_HPUX_omsgctl               160
-#define __NR_HPUX_msgsnd                161
-#define __NR_HPUX_msgrecv               162
-#define __NR_HPUX_shmget                163
-#define __NR_HPUX_oshmctl               164
-#define __NR_HPUX_shmat                 165
-#define __NR_HPUX_shmdt                 166
-#define __NR_HPUX_m68020_advise         167
-/* [168,189] are for Discless/DUX */
-#define __NR_HPUX_csp                   168
-#define __NR_HPUX_cluster               169
-#define __NR_HPUX_mkrnod                170
-#define __NR_HPUX_test                  171
-#define __NR_HPUX_unsp_open             172
-#define __NR_HPUX_reserved4             173
-#define __NR_HPUX_getcontext_old        174
-#define __NR_HPUX_osetcontext           175
-#define __NR_HPUX_bigio                 176
-#define __NR_HPUX_pipenode              177
-#define __NR_HPUX_lsync                 178
-#define __NR_HPUX_getmachineid          179
-#define __NR_HPUX_cnodeid               180
-#define __NR_HPUX_cnodes                181
-#define __NR_HPUX_swapclients           182
-#define __NR_HPUX_rmt_process           183
-#define __NR_HPUX_dskless_stats         184
-#define __NR_HPUX_sigprocmask           185
-#define __NR_HPUX_sigpending            186
-#define __NR_HPUX_sigsuspend            187
-#define __NR_HPUX_sigaction             188
-#define __NR_HPUX_reserved5             189
-#define __NR_HPUX_nfssvc                190
-#define __NR_HPUX_getfh                 191
-#define __NR_HPUX_getdomainname         192
-#define __NR_HPUX_setdomainname         193
-#define __NR_HPUX_async_daemon          194
-#define __NR_HPUX_getdirentries         195
-#define __NR_HPUX_statfs                196
-#define __NR_HPUX_fstatfs               197
-#define __NR_HPUX_vfsmount              198
-#define __NR_HPUX_reserved6             199
-#define __NR_HPUX_waitpid               200
-/* 201 - 223 missing */
-#define __NR_HPUX_sigsetreturn          224
-#define __NR_HPUX_sigsetstatemask       225
-/* 226 missing */
-#define __NR_HPUX_cs                    227
-#define __NR_HPUX_cds                   228
-#define __NR_HPUX_set_no_trunc          229
-#define __NR_HPUX_pathconf              230
-#define __NR_HPUX_fpathconf             231
-/* 232, 233 missing */
-#define __NR_HPUX_nfs_fcntl             234
-#define __NR_HPUX_ogetacl               235
-#define __NR_HPUX_ofgetacl              236
-#define __NR_HPUX_osetacl               237
-#define __NR_HPUX_ofsetacl              238
-#define __NR_HPUX_pstat                 239
-#define __NR_HPUX_getaudid              240
-#define __NR_HPUX_setaudid              241
-#define __NR_HPUX_getaudproc            242
-#define __NR_HPUX_setaudproc            243
-#define __NR_HPUX_getevent              244
-#define __NR_HPUX_setevent              245
-#define __NR_HPUX_audwrite              246
-#define __NR_HPUX_audswitch             247
-#define __NR_HPUX_audctl                248
-#define __NR_HPUX_ogetaccess            249
-#define __NR_HPUX_fsctl                 250
-/* 251 - 258 missing */
-#define __NR_HPUX_swapfs                259
-#define __NR_HPUX_fss                   260
-/* 261 - 266 missing */
-#define __NR_HPUX_tsync                 267
-#define __NR_HPUX_getnumfds             268
-#define __NR_HPUX_poll                  269
-#define __NR_HPUX_getmsg                270
-#define __NR_HPUX_putmsg                271
-#define __NR_HPUX_fchdir                272
-#define __NR_HPUX_getmount_cnt          273
-#define __NR_HPUX_getmount_entry        274
-#define __NR_HPUX_accept                275
-#define __NR_HPUX_bind                  276
-#define __NR_HPUX_connect               277
-#define __NR_HPUX_getpeername           278
-#define __NR_HPUX_getsockname           279
-#define __NR_HPUX_getsockopt            280
-#define __NR_HPUX_listen                281
-#define __NR_HPUX_recv                  282
-#define __NR_HPUX_recvfrom              283
-#define __NR_HPUX_recvmsg               284
-#define __NR_HPUX_send                  285
-#define __NR_HPUX_sendmsg               286
-#define __NR_HPUX_sendto                287
-#define __NR_HPUX_setsockopt            288
-#define __NR_HPUX_shutdown              289
-#define __NR_HPUX_socket                290
-#define __NR_HPUX_socketpair            291
-#define __NR_HPUX_proc_open             292
-#define __NR_HPUX_proc_close            293
-#define __NR_HPUX_proc_send             294
-#define __NR_HPUX_proc_recv             295
-#define __NR_HPUX_proc_sendrecv         296
-#define __NR_HPUX_proc_syscall          297
-/* 298 - 311 missing */
-#define __NR_HPUX_semctl                312
-#define __NR_HPUX_msgctl                313
-#define __NR_HPUX_shmctl                314
-#define __NR_HPUX_mpctl                 315
-#define __NR_HPUX_exportfs              316
-#define __NR_HPUX_getpmsg               317
-#define __NR_HPUX_putpmsg               318
-/* 319 missing */
-#define __NR_HPUX_msync                 320
-#define __NR_HPUX_msleep                321
-#define __NR_HPUX_mwakeup               322
-#define __NR_HPUX_msem_init             323
-#define __NR_HPUX_msem_remove           324
-#define __NR_HPUX_adjtime               325
-#define __NR_HPUX_kload                 326
-#define __NR_HPUX_fattach               327
-#define __NR_HPUX_fdetach               328
-#define __NR_HPUX_serialize             329
-#define __NR_HPUX_statvfs               330
-#define __NR_HPUX_fstatvfs              331
-#define __NR_HPUX_lchown                332
-#define __NR_HPUX_getsid                333
-#define __NR_HPUX_sysfs                 334
-/* 335, 336 missing */
-#define __NR_HPUX_sched_setparam        337
-#define __NR_HPUX_sched_getparam        338
-#define __NR_HPUX_sched_setscheduler    339
-#define __NR_HPUX_sched_getscheduler    340
-#define __NR_HPUX_sched_yield           341
-#define __NR_HPUX_sched_get_priority_max 342
-#define __NR_HPUX_sched_get_priority_min 343
-#define __NR_HPUX_sched_rr_get_interval 344
-#define __NR_HPUX_clock_settime         345
-#define __NR_HPUX_clock_gettime         346
-#define __NR_HPUX_clock_getres          347
-#define __NR_HPUX_timer_create          348
-#define __NR_HPUX_timer_delete          349
-#define __NR_HPUX_timer_settime         350
-#define __NR_HPUX_timer_gettime         351
-#define __NR_HPUX_timer_getoverrun      352
-#define __NR_HPUX_nanosleep             353
-#define __NR_HPUX_toolbox               354
-/* 355 missing */
-#define __NR_HPUX_getdents              356
-#define __NR_HPUX_getcontext            357
-#define __NR_HPUX_sysinfo               358
-#define __NR_HPUX_fcntl64               359
-#define __NR_HPUX_ftruncate64           360
-#define __NR_HPUX_fstat64               361
-#define __NR_HPUX_getdirentries64       362
-#define __NR_HPUX_getrlimit64           363
-#define __NR_HPUX_lockf64               364
-#define __NR_HPUX_lseek64               365
-#define __NR_HPUX_lstat64               366
-#define __NR_HPUX_mmap64                367
-#define __NR_HPUX_setrlimit64           368
-#define __NR_HPUX_stat64                369
-#define __NR_HPUX_truncate64            370
-#define __NR_HPUX_ulimit64              371
-#define __NR_HPUX_pread                 372
-#define __NR_HPUX_preadv                373
-#define __NR_HPUX_pwrite                374
-#define __NR_HPUX_pwritev               375
-#define __NR_HPUX_pread64               376
-#define __NR_HPUX_preadv64              377
-#define __NR_HPUX_pwrite64              378
-#define __NR_HPUX_pwritev64             379
-#define __NR_HPUX_setcontext            380
-#define __NR_HPUX_sigaltstack           381
-#define __NR_HPUX_waitid                382
-#define __NR_HPUX_setpgrp               383
-#define __NR_HPUX_recvmsg2              384
-#define __NR_HPUX_sendmsg2              385
-#define __NR_HPUX_socket2               386
-#define __NR_HPUX_socketpair2           387
-#define __NR_HPUX_setregid              388
-#define __NR_HPUX_lwp_create            389
-#define __NR_HPUX_lwp_terminate         390
-#define __NR_HPUX_lwp_wait              391
-#define __NR_HPUX_lwp_suspend           392
-#define __NR_HPUX_lwp_resume            393
-/* 394 missing */
-#define __NR_HPUX_lwp_abort_syscall     395
-#define __NR_HPUX_lwp_info              396
-#define __NR_HPUX_lwp_kill              397
-#define __NR_HPUX_ksleep                398
-#define __NR_HPUX_kwakeup               399
-/* 400 missing */
-#define __NR_HPUX_pstat_getlwp          401
-#define __NR_HPUX_lwp_exit              402
-#define __NR_HPUX_lwp_continue          403
-#define __NR_HPUX_getacl                404
-#define __NR_HPUX_fgetacl               405
-#define __NR_HPUX_setacl                406
-#define __NR_HPUX_fsetacl               407
-#define __NR_HPUX_getaccess             408
-#define __NR_HPUX_lwp_mutex_init        409
-#define __NR_HPUX_lwp_mutex_lock_sys    410
-#define __NR_HPUX_lwp_mutex_unlock      411
-#define __NR_HPUX_lwp_cond_init         412
-#define __NR_HPUX_lwp_cond_signal       413
-#define __NR_HPUX_lwp_cond_broadcast    414
-#define __NR_HPUX_lwp_cond_wait_sys     415
-#define __NR_HPUX_lwp_getscheduler      416
-#define __NR_HPUX_lwp_setscheduler      417
-#define __NR_HPUX_lwp_getstate          418
-#define __NR_HPUX_lwp_setstate          419
-#define __NR_HPUX_lwp_detach            420
-#define __NR_HPUX_mlock                 421
-#define __NR_HPUX_munlock               422
-#define __NR_HPUX_mlockall              423
-#define __NR_HPUX_munlockall            424
-#define __NR_HPUX_shm_open              425
-#define __NR_HPUX_shm_unlink            426
-#define __NR_HPUX_sigqueue              427
-#define __NR_HPUX_sigwaitinfo           428
-#define __NR_HPUX_sigtimedwait          429
-#define __NR_HPUX_sigwait               430
-#define __NR_HPUX_aio_read              431
-#define __NR_HPUX_aio_write             432
-#define __NR_HPUX_lio_listio            433
-#define __NR_HPUX_aio_error             434
-#define __NR_HPUX_aio_return            435
-#define __NR_HPUX_aio_cancel            436
-#define __NR_HPUX_aio_suspend           437
-#define __NR_HPUX_aio_fsync             438
-#define __NR_HPUX_mq_open               439
-#define __NR_HPUX_mq_close              440
-#define __NR_HPUX_mq_unlink             441
-#define __NR_HPUX_mq_send               442
-#define __NR_HPUX_mq_receive            443
-#define __NR_HPUX_mq_notify             444
-#define __NR_HPUX_mq_setattr            445
-#define __NR_HPUX_mq_getattr            446
-#define __NR_HPUX_ksem_open             447
-#define __NR_HPUX_ksem_unlink           448
-#define __NR_HPUX_ksem_close            449
-#define __NR_HPUX_ksem_post             450
-#define __NR_HPUX_ksem_wait             451
-#define __NR_HPUX_ksem_read             452
-#define __NR_HPUX_ksem_trywait          453
-#define __NR_HPUX_lwp_rwlock_init       454
-#define __NR_HPUX_lwp_rwlock_destroy    455
-#define __NR_HPUX_lwp_rwlock_rdlock_sys 456
-#define __NR_HPUX_lwp_rwlock_wrlock_sys 457
-#define __NR_HPUX_lwp_rwlock_tryrdlock  458
-#define __NR_HPUX_lwp_rwlock_trywrlock  459
-#define __NR_HPUX_lwp_rwlock_unlock     460
-#define __NR_HPUX_ttrace                461
-#define __NR_HPUX_ttrace_wait           462
-#define __NR_HPUX_lf_wire_mem           463
-#define __NR_HPUX_lf_unwire_mem         464
-#define __NR_HPUX_lf_send_pin_map       465
-#define __NR_HPUX_lf_free_buf           466
-#define __NR_HPUX_lf_wait_nq            467
-#define __NR_HPUX_lf_wakeup_conn_q      468
-#define __NR_HPUX_lf_unused             469
-#define __NR_HPUX_lwp_sema_init         470
-#define __NR_HPUX_lwp_sema_post         471
-#define __NR_HPUX_lwp_sema_wait         472
-#define __NR_HPUX_lwp_sema_trywait      473
-#define __NR_HPUX_lwp_sema_destroy      474
-#define __NR_HPUX_statvfs64             475
-#define __NR_HPUX_fstatvfs64            476
-#define __NR_HPUX_msh_register          477
-#define __NR_HPUX_ptrace64              478
-#define __NR_HPUX_sendfile              479
-#define __NR_HPUX_sendpath              480
-#define __NR_HPUX_sendfile64            481
-#define __NR_HPUX_sendpath64            482
-#define __NR_HPUX_modload               483
-#define __NR_HPUX_moduload              484
-#define __NR_HPUX_modpath               485
-#define __NR_HPUX_getksym               486
-#define __NR_HPUX_modadm                487
-#define __NR_HPUX_modstat               488
-#define __NR_HPUX_lwp_detached_exit     489
-#define __NR_HPUX_crashconf             490
-#define __NR_HPUX_siginhibit            491
-#define __NR_HPUX_sigenable             492
-#define __NR_HPUX_spuctl                493
-#define __NR_HPUX_zerokernelsum         494
-#define __NR_HPUX_nfs_kstat             495
-#define __NR_HPUX_aio_read64            496
-#define __NR_HPUX_aio_write64           497
-#define __NR_HPUX_aio_error64           498
-#define __NR_HPUX_aio_return64          499
-#define __NR_HPUX_aio_cancel64          500
-#define __NR_HPUX_aio_suspend64         501
-#define __NR_HPUX_aio_fsync64           502
-#define __NR_HPUX_lio_listio64          503
-#define __NR_HPUX_recv2                 504
-#define __NR_HPUX_recvfrom2             505
-#define __NR_HPUX_send2                 506
-#define __NR_HPUX_sendto2               507
-#define __NR_HPUX_acl                   508
-#define __NR_HPUX___cnx_p2p_ctl         509
-#define __NR_HPUX___cnx_gsched_ctl      510
-#define __NR_HPUX___cnx_pmon_ctl        511
-
-#define __NR_HPUX_syscalls             512
-
-/*
- * Linux system call numbers.
- *
- * Cary Coutant says that we should just use another syscall gateway
- * page to avoid clashing with the HPUX space, and I think he's right:
- * it will would keep a branch out of our syscall entry path, at the
- * very least.  If we decide to change it later, we can ``just'' tweak
- * the LINUX_GATEWAY_ADDR define at the bottom and make __NR_Linux be
- * 1024 or something.  Oh, and recompile libc. =)
- *
- * 64-bit HPUX binaries get the syscall gateway address passed in a register
- * from the kernel at startup, which seems a sane strategy.
- */
-
-#define __NR_Linux                0
-#define __NR_restart_syscall      (__NR_Linux + 0)
-#define __NR_exit                 (__NR_Linux + 1)
-#define __NR_fork                 (__NR_Linux + 2)
-#define __NR_read                 (__NR_Linux + 3)
-#define __NR_write                (__NR_Linux + 4)
-#define __NR_open                 (__NR_Linux + 5)
-#define __NR_close                (__NR_Linux + 6)
-#define __NR_waitpid              (__NR_Linux + 7)
-#define __NR_creat                (__NR_Linux + 8)
-#define __NR_link                 (__NR_Linux + 9)
-#define __NR_unlink              (__NR_Linux + 10)
-#define __NR_execve              (__NR_Linux + 11)
-#define __NR_chdir               (__NR_Linux + 12)
-#define __NR_time                (__NR_Linux + 13)
-#define __NR_mknod               (__NR_Linux + 14)
-#define __NR_chmod               (__NR_Linux + 15)
-#define __NR_lchown              (__NR_Linux + 16)
-#define __NR_socket              (__NR_Linux + 17)
-#define __NR_stat                (__NR_Linux + 18)
-#define __NR_lseek               (__NR_Linux + 19)
-#define __NR_getpid              (__NR_Linux + 20)
-#define __NR_mount               (__NR_Linux + 21)
-#define __NR_bind                (__NR_Linux + 22)
-#define __NR_setuid              (__NR_Linux + 23)
-#define __NR_getuid              (__NR_Linux + 24)
-#define __NR_stime               (__NR_Linux + 25)
-#define __NR_ptrace              (__NR_Linux + 26)
-#define __NR_alarm               (__NR_Linux + 27)
-#define __NR_fstat               (__NR_Linux + 28)
-#define __NR_pause               (__NR_Linux + 29)
-#define __NR_utime               (__NR_Linux + 30)
-#define __NR_connect             (__NR_Linux + 31)
-#define __NR_listen              (__NR_Linux + 32)
-#define __NR_access              (__NR_Linux + 33)
-#define __NR_nice                (__NR_Linux + 34)
-#define __NR_accept              (__NR_Linux + 35)
-#define __NR_sync                (__NR_Linux + 36)
-#define __NR_kill                (__NR_Linux + 37)
-#define __NR_rename              (__NR_Linux + 38)
-#define __NR_mkdir               (__NR_Linux + 39)
-#define __NR_rmdir               (__NR_Linux + 40)
-#define __NR_dup                 (__NR_Linux + 41)
-#define __NR_pipe                (__NR_Linux + 42)
-#define __NR_times               (__NR_Linux + 43)
-#define __NR_getsockname         (__NR_Linux + 44)
-#define __NR_brk                 (__NR_Linux + 45)
-#define __NR_setgid              (__NR_Linux + 46)
-#define __NR_getgid              (__NR_Linux + 47)
-#define __NR_signal              (__NR_Linux + 48)
-#define __NR_geteuid             (__NR_Linux + 49)
-#define __NR_getegid             (__NR_Linux + 50)
-#define __NR_acct                (__NR_Linux + 51)
-#define __NR_umount2             (__NR_Linux + 52)
-#define __NR_getpeername         (__NR_Linux + 53)
-#define __NR_ioctl               (__NR_Linux + 54)
-#define __NR_fcntl               (__NR_Linux + 55)
-#define __NR_socketpair          (__NR_Linux + 56)
-#define __NR_setpgid             (__NR_Linux + 57)
-#define __NR_send                (__NR_Linux + 58)
-#define __NR_uname               (__NR_Linux + 59)
-#define __NR_umask               (__NR_Linux + 60)
-#define __NR_chroot              (__NR_Linux + 61)
-#define __NR_ustat               (__NR_Linux + 62)
-#define __NR_dup2                (__NR_Linux + 63)
-#define __NR_getppid             (__NR_Linux + 64)
-#define __NR_getpgrp             (__NR_Linux + 65)
-#define __NR_setsid              (__NR_Linux + 66)
-#define __NR_pivot_root          (__NR_Linux + 67)
-#define __NR_sgetmask            (__NR_Linux + 68)
-#define __NR_ssetmask            (__NR_Linux + 69)
-#define __NR_setreuid            (__NR_Linux + 70)
-#define __NR_setregid            (__NR_Linux + 71)
-#define __NR_mincore             (__NR_Linux + 72)
-#define __NR_sigpending          (__NR_Linux + 73)
-#define __NR_sethostname         (__NR_Linux + 74)
-#define __NR_setrlimit           (__NR_Linux + 75)
-#define __NR_getrlimit           (__NR_Linux + 76)
-#define __NR_getrusage           (__NR_Linux + 77)
-#define __NR_gettimeofday        (__NR_Linux + 78)
-#define __NR_settimeofday        (__NR_Linux + 79)
-#define __NR_getgroups           (__NR_Linux + 80)
-#define __NR_setgroups           (__NR_Linux + 81)
-#define __NR_sendto              (__NR_Linux + 82)
-#define __NR_symlink             (__NR_Linux + 83)
-#define __NR_lstat               (__NR_Linux + 84)
-#define __NR_readlink            (__NR_Linux + 85)
-#define __NR_uselib              (__NR_Linux + 86)
-#define __NR_swapon              (__NR_Linux + 87)
-#define __NR_reboot              (__NR_Linux + 88)
-#define __NR_mmap2             (__NR_Linux + 89)
-#define __NR_mmap                (__NR_Linux + 90)
-#define __NR_munmap              (__NR_Linux + 91)
-#define __NR_truncate            (__NR_Linux + 92)
-#define __NR_ftruncate           (__NR_Linux + 93)
-#define __NR_fchmod              (__NR_Linux + 94)
-#define __NR_fchown              (__NR_Linux + 95)
-#define __NR_getpriority         (__NR_Linux + 96)
-#define __NR_setpriority         (__NR_Linux + 97)
-#define __NR_recv                (__NR_Linux + 98)
-#define __NR_statfs              (__NR_Linux + 99)
-#define __NR_fstatfs            (__NR_Linux + 100)
-#define __NR_stat64           (__NR_Linux + 101)
-/* #define __NR_socketcall         (__NR_Linux + 102) */
-#define __NR_syslog             (__NR_Linux + 103)
-#define __NR_setitimer          (__NR_Linux + 104)
-#define __NR_getitimer          (__NR_Linux + 105)
-#define __NR_capget             (__NR_Linux + 106)
-#define __NR_capset             (__NR_Linux + 107)
-#define __NR_pread64            (__NR_Linux + 108)
-#define __NR_pwrite64           (__NR_Linux + 109)
-#define __NR_getcwd             (__NR_Linux + 110)
-#define __NR_vhangup            (__NR_Linux + 111)
-#define __NR_fstat64            (__NR_Linux + 112)
-#define __NR_vfork              (__NR_Linux + 113)
-#define __NR_wait4              (__NR_Linux + 114)
-#define __NR_swapoff            (__NR_Linux + 115)
-#define __NR_sysinfo            (__NR_Linux + 116)
-#define __NR_shutdown           (__NR_Linux + 117)
-#define __NR_fsync              (__NR_Linux + 118)
-#define __NR_madvise            (__NR_Linux + 119)
-#define __NR_clone              (__NR_Linux + 120)
-#define __NR_setdomainname      (__NR_Linux + 121)
-#define __NR_sendfile           (__NR_Linux + 122)
-#define __NR_recvfrom           (__NR_Linux + 123)
-#define __NR_adjtimex           (__NR_Linux + 124)
-#define __NR_mprotect           (__NR_Linux + 125)
-#define __NR_sigprocmask        (__NR_Linux + 126)
-#define __NR_create_module      (__NR_Linux + 127)
-#define __NR_init_module        (__NR_Linux + 128)
-#define __NR_delete_module      (__NR_Linux + 129)
-#define __NR_get_kernel_syms    (__NR_Linux + 130)
-#define __NR_quotactl           (__NR_Linux + 131)
-#define __NR_getpgid            (__NR_Linux + 132)
-#define __NR_fchdir             (__NR_Linux + 133)
-#define __NR_bdflush            (__NR_Linux + 134)
-#define __NR_sysfs              (__NR_Linux + 135)
-#define __NR_personality        (__NR_Linux + 136)
-#define __NR_afs_syscall        (__NR_Linux + 137) /* Syscall for Andrew File System */
-#define __NR_setfsuid           (__NR_Linux + 138)
-#define __NR_setfsgid           (__NR_Linux + 139)
-#define __NR__llseek            (__NR_Linux + 140)
-#define __NR_getdents           (__NR_Linux + 141)
-#define __NR__newselect         (__NR_Linux + 142)
-#define __NR_flock              (__NR_Linux + 143)
-#define __NR_msync              (__NR_Linux + 144)
-#define __NR_readv              (__NR_Linux + 145)
-#define __NR_writev             (__NR_Linux + 146)
-#define __NR_getsid             (__NR_Linux + 147)
-#define __NR_fdatasync          (__NR_Linux + 148)
-#define __NR__sysctl            (__NR_Linux + 149)
-#define __NR_mlock              (__NR_Linux + 150)
-#define __NR_munlock            (__NR_Linux + 151)
-#define __NR_mlockall           (__NR_Linux + 152)
-#define __NR_munlockall         (__NR_Linux + 153)
-#define __NR_sched_setparam             (__NR_Linux + 154)
-#define __NR_sched_getparam             (__NR_Linux + 155)
-#define __NR_sched_setscheduler         (__NR_Linux + 156)
-#define __NR_sched_getscheduler         (__NR_Linux + 157)
-#define __NR_sched_yield                (__NR_Linux + 158)
-#define __NR_sched_get_priority_max     (__NR_Linux + 159)
-#define __NR_sched_get_priority_min     (__NR_Linux + 160)
-#define __NR_sched_rr_get_interval      (__NR_Linux + 161)
-#define __NR_nanosleep          (__NR_Linux + 162)
-#define __NR_mremap             (__NR_Linux + 163)
-#define __NR_setresuid          (__NR_Linux + 164)
-#define __NR_getresuid          (__NR_Linux + 165)
-#define __NR_sigaltstack        (__NR_Linux + 166)
-#define __NR_query_module       (__NR_Linux + 167)
-#define __NR_poll               (__NR_Linux + 168)
-#define __NR_nfsservctl         (__NR_Linux + 169)
-#define __NR_setresgid          (__NR_Linux + 170)
-#define __NR_getresgid          (__NR_Linux + 171)
-#define __NR_prctl              (__NR_Linux + 172)
-#define __NR_rt_sigreturn       (__NR_Linux + 173)
-#define __NR_rt_sigaction       (__NR_Linux + 174)
-#define __NR_rt_sigprocmask     (__NR_Linux + 175)
-#define __NR_rt_sigpending      (__NR_Linux + 176)
-#define __NR_rt_sigtimedwait    (__NR_Linux + 177)
-#define __NR_rt_sigqueueinfo    (__NR_Linux + 178)
-#define __NR_rt_sigsuspend      (__NR_Linux + 179)
-#define __NR_chown              (__NR_Linux + 180)
-#define __NR_setsockopt         (__NR_Linux + 181)
-#define __NR_getsockopt         (__NR_Linux + 182)
-#define __NR_sendmsg            (__NR_Linux + 183)
-#define __NR_recvmsg            (__NR_Linux + 184)
-#define __NR_semop              (__NR_Linux + 185)
-#define __NR_semget             (__NR_Linux + 186)
-#define __NR_semctl             (__NR_Linux + 187)
-#define __NR_msgsnd             (__NR_Linux + 188)
-#define __NR_msgrcv             (__NR_Linux + 189)
-#define __NR_msgget             (__NR_Linux + 190)
-#define __NR_msgctl             (__NR_Linux + 191)
-#define __NR_shmat              (__NR_Linux + 192)
-#define __NR_shmdt              (__NR_Linux + 193)
-#define __NR_shmget             (__NR_Linux + 194)
-#define __NR_shmctl             (__NR_Linux + 195)
-
-#define __NR_getpmsg           (__NR_Linux + 196) /* Somebody *wants* streams? */
-#define __NR_putpmsg           (__NR_Linux + 197)
-
-#define __NR_lstat64            (__NR_Linux + 198)
-#define __NR_truncate64         (__NR_Linux + 199)
-#define __NR_ftruncate64        (__NR_Linux + 200)
-#define __NR_getdents64         (__NR_Linux + 201)
-#define __NR_fcntl64            (__NR_Linux + 202)
-#define __NR_attrctl            (__NR_Linux + 203)
-#define __NR_acl_get            (__NR_Linux + 204)
-#define __NR_acl_set            (__NR_Linux + 205)
-#define __NR_gettid             (__NR_Linux + 206)
-#define __NR_readahead          (__NR_Linux + 207)
-#define __NR_tkill              (__NR_Linux + 208)
-#define __NR_sendfile64         (__NR_Linux + 209)
-#define __NR_futex              (__NR_Linux + 210)
-#define __NR_sched_setaffinity  (__NR_Linux + 211)
-#define __NR_sched_getaffinity  (__NR_Linux + 212)
-#define __NR_set_thread_area    (__NR_Linux + 213)
-#define __NR_get_thread_area    (__NR_Linux + 214)
-#define __NR_io_setup           (__NR_Linux + 215)
-#define __NR_io_destroy         (__NR_Linux + 216)
-#define __NR_io_getevents       (__NR_Linux + 217)
-#define __NR_io_submit          (__NR_Linux + 218)
-#define __NR_io_cancel          (__NR_Linux + 219)
-#define __NR_alloc_hugepages    (__NR_Linux + 220)
-#define __NR_free_hugepages     (__NR_Linux + 221)
-#define __NR_exit_group         (__NR_Linux + 222)
-#define __NR_lookup_dcookie     (__NR_Linux + 223)
-#define __NR_epoll_create       (__NR_Linux + 224)
-#define __NR_epoll_ctl          (__NR_Linux + 225)
-#define __NR_epoll_wait         (__NR_Linux + 226)
-#define __NR_remap_file_pages   (__NR_Linux + 227)
-#define __NR_semtimedop         (__NR_Linux + 228)
-#define __NR_mq_open            (__NR_Linux + 229)
-#define __NR_mq_unlink          (__NR_Linux + 230)
-#define __NR_mq_timedsend       (__NR_Linux + 231)
-#define __NR_mq_timedreceive    (__NR_Linux + 232)
-#define __NR_mq_notify          (__NR_Linux + 233)
-#define __NR_mq_getsetattr      (__NR_Linux + 234)
-#define __NR_waitid            (__NR_Linux + 235)
-#define __NR_fadvise64_64      (__NR_Linux + 236)
-#define __NR_set_tid_address   (__NR_Linux + 237)
-#define __NR_setxattr          (__NR_Linux + 238)
-#define __NR_lsetxattr         (__NR_Linux + 239)
-#define __NR_fsetxattr         (__NR_Linux + 240)
-#define __NR_getxattr          (__NR_Linux + 241)
-#define __NR_lgetxattr         (__NR_Linux + 242)
-#define __NR_fgetxattr         (__NR_Linux + 243)
-#define __NR_listxattr         (__NR_Linux + 244)
-#define __NR_llistxattr                (__NR_Linux + 245)
-#define __NR_flistxattr                (__NR_Linux + 246)
-#define __NR_removexattr       (__NR_Linux + 247)
-#define __NR_lremovexattr      (__NR_Linux + 248)
-#define __NR_fremovexattr      (__NR_Linux + 249)
-#define __NR_timer_create      (__NR_Linux + 250)
-#define __NR_timer_settime     (__NR_Linux + 251)
-#define __NR_timer_gettime     (__NR_Linux + 252)
-#define __NR_timer_getoverrun  (__NR_Linux + 253)
-#define __NR_timer_delete      (__NR_Linux + 254)
-#define __NR_clock_settime     (__NR_Linux + 255)
-#define __NR_clock_gettime     (__NR_Linux + 256)
-#define __NR_clock_getres      (__NR_Linux + 257)
-#define __NR_clock_nanosleep   (__NR_Linux + 258)
-#define __NR_tgkill            (__NR_Linux + 259)
-#define __NR_mbind             (__NR_Linux + 260)
-#define __NR_get_mempolicy     (__NR_Linux + 261)
-#define __NR_set_mempolicy     (__NR_Linux + 262)
-#define __NR_vserver           (__NR_Linux + 263)
-#define __NR_add_key           (__NR_Linux + 264)
-#define __NR_request_key       (__NR_Linux + 265)
-#define __NR_keyctl            (__NR_Linux + 266)
-#define __NR_ioprio_set                (__NR_Linux + 267)
-#define __NR_ioprio_get                (__NR_Linux + 268)
-#define __NR_inotify_init      (__NR_Linux + 269)
-#define __NR_inotify_add_watch (__NR_Linux + 270)
-#define __NR_inotify_rm_watch  (__NR_Linux + 271)
-#define __NR_migrate_pages     (__NR_Linux + 272)
-#define __NR_pselect6          (__NR_Linux + 273)
-#define __NR_ppoll             (__NR_Linux + 274)
-#define __NR_openat            (__NR_Linux + 275)
-#define __NR_mkdirat           (__NR_Linux + 276)
-#define __NR_mknodat           (__NR_Linux + 277)
-#define __NR_fchownat          (__NR_Linux + 278)
-#define __NR_futimesat         (__NR_Linux + 279)
-#define __NR_fstatat64         (__NR_Linux + 280)
-#define __NR_unlinkat          (__NR_Linux + 281)
-#define __NR_renameat          (__NR_Linux + 282)
-#define __NR_linkat            (__NR_Linux + 283)
-#define __NR_symlinkat         (__NR_Linux + 284)
-#define __NR_readlinkat                (__NR_Linux + 285)
-#define __NR_fchmodat          (__NR_Linux + 286)
-#define __NR_faccessat         (__NR_Linux + 287)
-#define __NR_unshare           (__NR_Linux + 288)
-#define __NR_set_robust_list   (__NR_Linux + 289)
-#define __NR_get_robust_list   (__NR_Linux + 290)
-#define __NR_splice            (__NR_Linux + 291)
-#define __NR_sync_file_range   (__NR_Linux + 292)
-#define __NR_tee               (__NR_Linux + 293)
-#define __NR_vmsplice          (__NR_Linux + 294)
-#define __NR_move_pages                (__NR_Linux + 295)
-#define __NR_getcpu            (__NR_Linux + 296)
-#define __NR_epoll_pwait       (__NR_Linux + 297)
-#define __NR_statfs64          (__NR_Linux + 298)
-#define __NR_fstatfs64         (__NR_Linux + 299)
-#define __NR_kexec_load                (__NR_Linux + 300)
-#define __NR_utimensat         (__NR_Linux + 301)
-#define __NR_signalfd          (__NR_Linux + 302)
-#define __NR_timerfd           (__NR_Linux + 303)
-#define __NR_eventfd           (__NR_Linux + 304)
-#define __NR_fallocate         (__NR_Linux + 305)
-#define __NR_timerfd_create    (__NR_Linux + 306)
-#define __NR_timerfd_settime   (__NR_Linux + 307)
-#define __NR_timerfd_gettime   (__NR_Linux + 308)
-#define __NR_signalfd4         (__NR_Linux + 309)
-#define __NR_eventfd2          (__NR_Linux + 310)
-#define __NR_epoll_create1     (__NR_Linux + 311)
-#define __NR_dup3              (__NR_Linux + 312)
-#define __NR_pipe2             (__NR_Linux + 313)
-#define __NR_inotify_init1     (__NR_Linux + 314)
-#define __NR_preadv            (__NR_Linux + 315)
-#define __NR_pwritev           (__NR_Linux + 316)
-#define __NR_rt_tgsigqueueinfo (__NR_Linux + 317)
-#define __NR_perf_event_open   (__NR_Linux + 318)
-#define __NR_recvmmsg          (__NR_Linux + 319)
-#define __NR_accept4           (__NR_Linux + 320)
-#define __NR_prlimit64         (__NR_Linux + 321)
-#define __NR_fanotify_init     (__NR_Linux + 322)
-#define __NR_fanotify_mark     (__NR_Linux + 323)
-#define __NR_clock_adjtime     (__NR_Linux + 324)
-#define __NR_name_to_handle_at (__NR_Linux + 325)
-#define __NR_open_by_handle_at (__NR_Linux + 326)
-#define __NR_syncfs            (__NR_Linux + 327)
-#define __NR_setns             (__NR_Linux + 328)
-#define __NR_sendmmsg          (__NR_Linux + 329)
-
-#define __NR_Linux_syscalls    (__NR_sendmmsg + 1)
-
-
-#define __IGNORE_select                /* newselect */
-#define __IGNORE_fadvise64     /* fadvise64_64 */
-#define __IGNORE_utimes                /* utime */
-
-
-#define HPUX_GATEWAY_ADDR       0xC0000004
-#define LINUX_GATEWAY_ADDR      0x100
+#include <uapi/asm/unistd.h>
 
-#ifdef __KERNEL__
 #ifndef __ASSEMBLY__
 
 #define SYS_ify(syscall_name)   __NR_##syscall_name
@@ -1008,5 +176,4 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)      \
  */
 #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
 
-#endif /* __KERNEL__ */
 #endif /* _ASM_PARISC_UNISTD_H_ */
diff --git a/arch/parisc/include/asm/user.h b/arch/parisc/include/asm/user.h
deleted file mode 100644 (file)
index 8022475..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/* This file should not exist, but lots of generic code still includes
-   it. It's a hangover from old a.out days and the traditional core
-   dump format.  We are ELF-only, and so are our core dumps.  If we
-   need to support HP/UX core format then we'll do it here
-   eventually. */
diff --git a/arch/parisc/include/asm/vga.h b/arch/parisc/include/asm/vga.h
deleted file mode 100644 (file)
index 171399a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_PARISC_VGA_H__
-#define __ASM_PARISC_VGA_H__
-
-/* nothing */
-
-#endif /* __ASM_PARISC_VGA_H__ */
diff --git a/arch/parisc/include/asm/xor.h b/arch/parisc/include/asm/xor.h
deleted file mode 100644 (file)
index c82eb12..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/xor.h>
index baebb3da1d44160fc6f6f259886656e6f494b167..a580642555b6f0e7f087ade117ce062cb303d429 100644 (file)
@@ -1,3 +1,31 @@
 # UAPI Header export list
 include include/uapi/asm-generic/Kbuild.asm
 
+header-y += bitsperlong.h
+header-y += byteorder.h
+header-y += errno.h
+header-y += fcntl.h
+header-y += ioctl.h
+header-y += ioctls.h
+header-y += ipcbuf.h
+header-y += mman.h
+header-y += msgbuf.h
+header-y += pdc.h
+header-y += posix_types.h
+header-y += ptrace.h
+header-y += resource.h
+header-y += sembuf.h
+header-y += setup.h
+header-y += shmbuf.h
+header-y += sigcontext.h
+header-y += siginfo.h
+header-y += signal.h
+header-y += socket.h
+header-y += sockios.h
+header-y += stat.h
+header-y += statfs.h
+header-y += swab.h
+header-y += termbits.h
+header-y += termios.h
+header-y += types.h
+header-y += unistd.h
diff --git a/arch/parisc/include/uapi/asm/bitsperlong.h b/arch/parisc/include/uapi/asm/bitsperlong.h
new file mode 100644 (file)
index 0000000..75196b4
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef __ASM_PARISC_BITSPERLONG_H
+#define __ASM_PARISC_BITSPERLONG_H
+
+/*
+ * using CONFIG_* outside of __KERNEL__ is wrong,
+ * __LP64__ was also removed from headers, so what
+ * is the right approach on parisc?
+ *     -arnd
+ */
+#if (defined(__KERNEL__) && defined(CONFIG_64BIT)) || defined (__LP64__)
+#define __BITS_PER_LONG 64
+#define SHIFT_PER_LONG 6
+#else
+#define __BITS_PER_LONG 32
+#define SHIFT_PER_LONG 5
+#endif
+
+#include <asm-generic/bitsperlong.h>
+
+#endif /* __ASM_PARISC_BITSPERLONG_H */
diff --git a/arch/parisc/include/uapi/asm/byteorder.h b/arch/parisc/include/uapi/asm/byteorder.h
new file mode 100644 (file)
index 0000000..58af2c5
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _PARISC_BYTEORDER_H
+#define _PARISC_BYTEORDER_H
+
+#include <linux/byteorder/big_endian.h>
+
+#endif /* _PARISC_BYTEORDER_H */
diff --git a/arch/parisc/include/uapi/asm/errno.h b/arch/parisc/include/uapi/asm/errno.h
new file mode 100644 (file)
index 0000000..135ad60
--- /dev/null
@@ -0,0 +1,127 @@
+#ifndef _PARISC_ERRNO_H
+#define _PARISC_ERRNO_H
+
+#include <asm-generic/errno-base.h>
+
+#define        ENOMSG          35      /* No message of desired type */
+#define        EIDRM           36      /* Identifier removed */
+#define        ECHRNG          37      /* Channel number out of range */
+#define        EL2NSYNC        38      /* Level 2 not synchronized */
+#define        EL3HLT          39      /* Level 3 halted */
+#define        EL3RST          40      /* Level 3 reset */
+#define        ELNRNG          41      /* Link number out of range */
+#define        EUNATCH         42      /* Protocol driver not attached */
+#define        ENOCSI          43      /* No CSI structure available */
+#define        EL2HLT          44      /* Level 2 halted */
+#define        EDEADLK         45      /* Resource deadlock would occur */
+#define        EDEADLOCK       EDEADLK
+#define        ENOLCK          46      /* No record locks available */
+#define        EILSEQ          47      /* Illegal byte sequence */
+
+#define        ENONET          50      /* Machine is not on the network */
+#define        ENODATA         51      /* No data available */
+#define        ETIME           52      /* Timer expired */
+#define        ENOSR           53      /* Out of streams resources */
+#define        ENOSTR          54      /* Device not a stream */
+#define        ENOPKG          55      /* Package not installed */
+
+#define        ENOLINK         57      /* Link has been severed */
+#define        EADV            58      /* Advertise error */
+#define        ESRMNT          59      /* Srmount error */
+#define        ECOMM           60      /* Communication error on send */
+#define        EPROTO          61      /* Protocol error */
+
+#define        EMULTIHOP       64      /* Multihop attempted */
+
+#define        EDOTDOT         66      /* RFS specific error */
+#define        EBADMSG         67      /* Not a data message */
+#define        EUSERS          68      /* Too many users */
+#define        EDQUOT          69      /* Quota exceeded */
+#define        ESTALE          70      /* Stale NFS file handle */
+#define        EREMOTE         71      /* Object is remote */
+#define        EOVERFLOW       72      /* Value too large for defined data type */
+
+/* these errnos are defined by Linux but not HPUX. */
+
+#define        EBADE           160     /* Invalid exchange */
+#define        EBADR           161     /* Invalid request descriptor */
+#define        EXFULL          162     /* Exchange full */
+#define        ENOANO          163     /* No anode */
+#define        EBADRQC         164     /* Invalid request code */
+#define        EBADSLT         165     /* Invalid slot */
+#define        EBFONT          166     /* Bad font file format */
+#define        ENOTUNIQ        167     /* Name not unique on network */
+#define        EBADFD          168     /* File descriptor in bad state */
+#define        EREMCHG         169     /* Remote address changed */
+#define        ELIBACC         170     /* Can not access a needed shared library */
+#define        ELIBBAD         171     /* Accessing a corrupted shared library */
+#define        ELIBSCN         172     /* .lib section in a.out corrupted */
+#define        ELIBMAX         173     /* Attempting to link in too many shared libraries */
+#define        ELIBEXEC        174     /* Cannot exec a shared library directly */
+#define        ERESTART        175     /* Interrupted system call should be restarted */
+#define        ESTRPIPE        176     /* Streams pipe error */
+#define        EUCLEAN         177     /* Structure needs cleaning */
+#define        ENOTNAM         178     /* Not a XENIX named type file */
+#define        ENAVAIL         179     /* No XENIX semaphores available */
+#define        EISNAM          180     /* Is a named type file */
+#define        EREMOTEIO       181     /* Remote I/O error */
+#define        ENOMEDIUM       182     /* No medium found */
+#define        EMEDIUMTYPE     183     /* Wrong medium type */
+#define        ENOKEY          184     /* Required key not available */
+#define        EKEYEXPIRED     185     /* Key has expired */
+#define        EKEYREVOKED     186     /* Key has been revoked */
+#define        EKEYREJECTED    187     /* Key was rejected by service */
+
+/* We now return you to your regularly scheduled HPUX. */
+
+#define ENOSYM         215     /* symbol does not exist in executable */
+#define        ENOTSOCK        216     /* Socket operation on non-socket */
+#define        EDESTADDRREQ    217     /* Destination address required */
+#define        EMSGSIZE        218     /* Message too long */
+#define        EPROTOTYPE      219     /* Protocol wrong type for socket */
+#define        ENOPROTOOPT     220     /* Protocol not available */
+#define        EPROTONOSUPPORT 221     /* Protocol not supported */
+#define        ESOCKTNOSUPPORT 222     /* Socket type not supported */
+#define        EOPNOTSUPP      223     /* Operation not supported on transport endpoint */
+#define        EPFNOSUPPORT    224     /* Protocol family not supported */
+#define        EAFNOSUPPORT    225     /* Address family not supported by protocol */
+#define        EADDRINUSE      226     /* Address already in use */
+#define        EADDRNOTAVAIL   227     /* Cannot assign requested address */
+#define        ENETDOWN        228     /* Network is down */
+#define        ENETUNREACH     229     /* Network is unreachable */
+#define        ENETRESET       230     /* Network dropped connection because of reset */
+#define        ECONNABORTED    231     /* Software caused connection abort */
+#define        ECONNRESET      232     /* Connection reset by peer */
+#define        ENOBUFS         233     /* No buffer space available */
+#define        EISCONN         234     /* Transport endpoint is already connected */
+#define        ENOTCONN        235     /* Transport endpoint is not connected */
+#define        ESHUTDOWN       236     /* Cannot send after transport endpoint shutdown */
+#define        ETOOMANYREFS    237     /* Too many references: cannot splice */
+#define EREFUSED       ECONNREFUSED    /* for HP's NFS apparently */
+#define        ETIMEDOUT       238     /* Connection timed out */
+#define        ECONNREFUSED    239     /* Connection refused */
+#define EREMOTERELEASE 240     /* Remote peer released connection */
+#define        EHOSTDOWN       241     /* Host is down */
+#define        EHOSTUNREACH    242     /* No route to host */
+
+#define        EALREADY        244     /* Operation already in progress */
+#define        EINPROGRESS     245     /* Operation now in progress */
+#define        EWOULDBLOCK     246     /* Operation would block (Linux returns EAGAIN) */
+#define        ENOTEMPTY       247     /* Directory not empty */
+#define        ENAMETOOLONG    248     /* File name too long */
+#define        ELOOP           249     /* Too many symbolic links encountered */
+#define        ENOSYS          251     /* Function not implemented */
+
+#define ENOTSUP                252     /* Function not implemented (POSIX.4 / HPUX) */
+#define ECANCELLED     253     /* aio request was canceled before complete (POSIX.4 / HPUX) */
+#define ECANCELED      ECANCELLED      /* SuSv3 and Solaris wants one 'L' */
+
+/* for robust mutexes */
+#define EOWNERDEAD     254     /* Owner died */
+#define ENOTRECOVERABLE        255     /* State not recoverable */
+
+#define        ERFKILL         256     /* Operation not possible due to RF-kill */
+
+#define EHWPOISON      257     /* Memory page has hardware error */
+
+#endif
diff --git a/arch/parisc/include/uapi/asm/fcntl.h b/arch/parisc/include/uapi/asm/fcntl.h
new file mode 100644 (file)
index 0000000..0304b92
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef _PARISC_FCNTL_H
+#define _PARISC_FCNTL_H
+
+#define O_APPEND       000000010
+#define O_BLKSEEK      000000100 /* HPUX only */
+#define O_CREAT                000000400 /* not fcntl */
+#define O_EXCL         000002000 /* not fcntl */
+#define O_LARGEFILE    000004000
+#define __O_SYNC       000100000
+#define O_SYNC         (__O_SYNC|O_DSYNC)
+#define O_NONBLOCK     000200004 /* HPUX has separate NDELAY & NONBLOCK */
+#define O_NOCTTY       000400000 /* not fcntl */
+#define O_DSYNC                001000000 /* HPUX only */
+#define O_RSYNC                002000000 /* HPUX only */
+#define O_NOATIME      004000000
+#define O_CLOEXEC      010000000 /* set close_on_exec */
+
+#define O_DIRECTORY    000010000 /* must be a directory */
+#define O_NOFOLLOW     000000200 /* don't follow links */
+#define O_INVISIBLE    004000000 /* invisible I/O, for DMAPI/XDSM */
+
+#define O_PATH         020000000
+
+#define F_GETLK64      8
+#define F_SETLK64      9
+#define F_SETLKW64     10
+
+#define F_GETOWN       11      /*  for sockets. */
+#define F_SETOWN       12      /*  for sockets. */
+#define F_SETSIG       13      /*  for sockets. */
+#define F_GETSIG       14      /*  for sockets. */
+
+/* for posix fcntl() and lockf() */
+#define F_RDLCK                01
+#define F_WRLCK                02
+#define F_UNLCK                03
+
+#include <asm-generic/fcntl.h>
+
+#endif
diff --git a/arch/parisc/include/uapi/asm/ioctl.h b/arch/parisc/include/uapi/asm/ioctl.h
new file mode 100644 (file)
index 0000000..ec8efa0
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ *    Linux/PA-RISC Project (http://www.parisc-linux.org/)
+ *    Copyright (C) 1999,2003 Matthew Wilcox < willy at debian . org >
+ *    portions from "linux/ioctl.h for Linux" by H.H. Bergman.
+ *
+ *    This program is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    This program is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with this program; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
+#ifndef _ASM_PARISC_IOCTL_H
+#define _ASM_PARISC_IOCTL_H
+
+/* ioctl command encoding: 32 bits total, command in lower 16 bits,
+ * size of the parameter structure in the lower 14 bits of the
+ * upper 16 bits.
+ * Encoding the size of the parameter structure in the ioctl request
+ * is useful for catching programs compiled with old versions
+ * and to avoid overwriting user space outside the user buffer area.
+ * The highest 2 bits are reserved for indicating the ``access mode''.
+ * NOTE: This limits the max parameter size to 16kB -1 !
+ */
+
+/*
+ * Direction bits.
+ */
+#define _IOC_NONE      0U
+#define _IOC_WRITE     2U
+#define _IOC_READ      1U
+
+#include <asm-generic/ioctl.h>
+
+#endif /* _ASM_PARISC_IOCTL_H */
diff --git a/arch/parisc/include/uapi/asm/ioctls.h b/arch/parisc/include/uapi/asm/ioctls.h
new file mode 100644 (file)
index 0000000..054ec06
--- /dev/null
@@ -0,0 +1,92 @@
+#ifndef __ARCH_PARISC_IOCTLS_H__
+#define __ARCH_PARISC_IOCTLS_H__
+
+#include <asm/ioctl.h>
+
+/* 0x54 is just a magic number to make these relatively unique ('T') */
+
+#define TCGETS         _IOR('T', 16, struct termios) /* TCGETATTR */
+#define TCSETS         _IOW('T', 17, struct termios) /* TCSETATTR */
+#define TCSETSW                _IOW('T', 18, struct termios) /* TCSETATTRD */
+#define TCSETSF                _IOW('T', 19, struct termios) /* TCSETATTRF */
+#define TCGETA         _IOR('T', 1, struct termio)
+#define TCSETA         _IOW('T', 2, struct termio)
+#define TCSETAW                _IOW('T', 3, struct termio)
+#define TCSETAF                _IOW('T', 4, struct termio)
+#define TCSBRK         _IO('T', 5)
+#define TCXONC         _IO('T', 6)
+#define TCFLSH         _IO('T', 7)
+#define TIOCEXCL       0x540C
+#define TIOCNXCL       0x540D
+#define TIOCSCTTY      0x540E
+#define TIOCGPGRP      _IOR('T', 30, int)
+#define TIOCSPGRP      _IOW('T', 29, int)
+#define TIOCOUTQ       0x5411
+#define TIOCSTI                0x5412
+#define TIOCGWINSZ     0x5413
+#define TIOCSWINSZ     0x5414
+#define TIOCMGET       0x5415
+#define TIOCMBIS       0x5416
+#define TIOCMBIC       0x5417
+#define TIOCMSET       0x5418
+#define TIOCGSOFTCAR   0x5419
+#define TIOCSSOFTCAR   0x541A
+#define FIONREAD       0x541B
+#define TIOCINQ                FIONREAD
+#define TIOCLINUX      0x541C
+#define TIOCCONS       0x541D
+#define TIOCGSERIAL    0x541E
+#define TIOCSSERIAL    0x541F
+#define TIOCPKT                0x5420
+#define FIONBIO                0x5421
+#define TIOCNOTTY      0x5422
+#define TIOCSETD       0x5423
+#define TIOCGETD       0x5424
+#define TCSBRKP                0x5425  /* Needed for POSIX tcsendbreak() */
+#define TIOCSBRK       0x5427  /* BSD compatibility */
+#define TIOCCBRK       0x5428  /* BSD compatibility */
+#define TIOCGSID       _IOR('T', 20, int) /* Return the session ID of FD */
+#define TCGETS2                _IOR('T',0x2A, struct termios2)
+#define TCSETS2                _IOW('T',0x2B, struct termios2)
+#define TCSETSW2       _IOW('T',0x2C, struct termios2)
+#define TCSETSF2       _IOW('T',0x2D, struct termios2)
+#define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
+#define TIOCGDEV       _IOR('T',0x32, int)  /* Get primary device node of /dev/console */
+#define TIOCSIG                _IOW('T',0x36, int)  /* Generate signal on Pty slave */
+#define TIOCVHANGUP    0x5437
+
+#define FIONCLEX       0x5450  /* these numbers need to be adjusted. */
+#define FIOCLEX                0x5451
+#define FIOASYNC       0x5452
+#define TIOCSERCONFIG  0x5453
+#define TIOCSERGWILD   0x5454
+#define TIOCSERSWILD   0x5455
+#define TIOCGLCKTRMIOS 0x5456
+#define TIOCSLCKTRMIOS 0x5457
+#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
+#define TIOCSERGETLSR   0x5459 /* Get line status register */
+#define TIOCSERGETMULTI 0x545A /* Get multiport config  */
+#define TIOCSERSETMULTI 0x545B /* Set multiport config */
+
+#define TIOCMIWAIT     0x545C  /* wait for a change on serial input line(s) */
+#define TIOCGICOUNT    0x545D  /* read serial port inline interrupt counts */
+#define FIOQSIZE       0x5460  /* Get exact space used by quota */
+
+#define TIOCSTART      0x5461
+#define TIOCSTOP       0x5462
+#define TIOCSLTC       0x5462
+
+/* Used for packet mode */
+#define TIOCPKT_DATA            0
+#define TIOCPKT_FLUSHREAD       1
+#define TIOCPKT_FLUSHWRITE      2
+#define TIOCPKT_STOP            4
+#define TIOCPKT_START           8
+#define TIOCPKT_NOSTOP         16
+#define TIOCPKT_DOSTOP         32
+#define TIOCPKT_IOCTL          64
+
+#define TIOCSER_TEMT    0x01   /* Transmitter physically empty */
+
+#endif /* _ASM_PARISC_IOCTLS_H */
diff --git a/arch/parisc/include/uapi/asm/ipcbuf.h b/arch/parisc/include/uapi/asm/ipcbuf.h
new file mode 100644 (file)
index 0000000..bd956c4
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef __PARISC_IPCBUF_H__
+#define __PARISC_IPCBUF_H__
+
+/*
+ * The ipc64_perm structure for PA-RISC is almost identical to
+ * kern_ipc_perm as we have always had 32-bit UIDs and GIDs in the kernel.
+ * 'seq' has been changed from long to int so that it's the same size
+ * on 64-bit kernels as on 32-bit ones.
+ */
+
+struct ipc64_perm
+{
+       key_t           key;
+       uid_t           uid;
+       gid_t           gid;
+       uid_t           cuid;
+       gid_t           cgid;
+       unsigned short int      __pad1;
+       mode_t          mode;
+       unsigned short int      __pad2;
+       unsigned short int      seq;
+       unsigned int    __pad3;
+       unsigned long long int __unused1;
+       unsigned long long int __unused2;
+};
+
+#endif /* __PARISC_IPCBUF_H__ */
diff --git a/arch/parisc/include/uapi/asm/mman.h b/arch/parisc/include/uapi/asm/mman.h
new file mode 100644 (file)
index 0000000..12219eb
--- /dev/null
@@ -0,0 +1,73 @@
+#ifndef __PARISC_MMAN_H__
+#define __PARISC_MMAN_H__
+
+#define PROT_READ      0x1             /* page can be read */
+#define PROT_WRITE     0x2             /* page can be written */
+#define PROT_EXEC      0x4             /* page can be executed */
+#define PROT_SEM       0x8             /* page may be used for atomic ops */
+#define PROT_NONE      0x0             /* page can not be accessed */
+#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
+#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
+
+#define MAP_SHARED     0x01            /* Share changes */
+#define MAP_PRIVATE    0x02            /* Changes are private */
+#define MAP_TYPE       0x03            /* Mask for type of mapping */
+#define MAP_FIXED      0x04            /* Interpret addr exactly */
+#define MAP_ANONYMOUS  0x10            /* don't use a file */
+
+#define MAP_DENYWRITE  0x0800          /* ETXTBSY */
+#define MAP_EXECUTABLE 0x1000          /* mark it as an executable */
+#define MAP_LOCKED     0x2000          /* pages are locked */
+#define MAP_NORESERVE  0x4000          /* don't check for reservations */
+#define MAP_GROWSDOWN  0x8000          /* stack-like segment */
+#define MAP_POPULATE   0x10000         /* populate (prefault) pagetables */
+#define MAP_NONBLOCK   0x20000         /* do not block on IO */
+#define MAP_STACK      0x40000         /* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB    0x80000         /* create a huge page mapping */
+
+#define MS_SYNC                1               /* synchronous memory sync */
+#define MS_ASYNC       2               /* sync memory asynchronously */
+#define MS_INVALIDATE  4               /* invalidate the caches */
+
+#define MCL_CURRENT    1               /* lock all current mappings */
+#define MCL_FUTURE     2               /* lock all future mappings */
+
+#define MADV_NORMAL     0               /* no further special treatment */
+#define MADV_RANDOM     1               /* expect random page references */
+#define MADV_SEQUENTIAL 2               /* expect sequential page references */
+#define MADV_WILLNEED   3               /* will need these pages */
+#define MADV_DONTNEED   4               /* don't need these pages */
+#define MADV_SPACEAVAIL 5               /* insure that resources are reserved */
+#define MADV_VPS_PURGE  6               /* Purge pages from VM page cache */
+#define MADV_VPS_INHERIT 7              /* Inherit parents page size */
+
+/* common/generic parameters */
+#define MADV_REMOVE    9               /* remove these pages & resources */
+#define MADV_DONTFORK  10              /* don't inherit across fork */
+#define MADV_DOFORK    11              /* do inherit across fork */
+
+/* The range 12-64 is reserved for page size specification. */
+#define MADV_4K_PAGES   12              /* Use 4K pages  */
+#define MADV_16K_PAGES  14              /* Use 16K pages */
+#define MADV_64K_PAGES  16              /* Use 64K pages */
+#define MADV_256K_PAGES 18              /* Use 256K pages */
+#define MADV_1M_PAGES   20              /* Use 1 Megabyte pages */
+#define MADV_4M_PAGES   22              /* Use 4 Megabyte pages */
+#define MADV_16M_PAGES  24              /* Use 16 Megabyte pages */
+#define MADV_64M_PAGES  26              /* Use 64 Megabyte pages */
+
+#define MADV_MERGEABLE   65            /* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 66            /* KSM may not merge identical pages */
+
+#define MADV_HUGEPAGE  67              /* Worth backing with hugepages */
+#define MADV_NOHUGEPAGE        68              /* Not worth backing with hugepages */
+
+#define MADV_DONTDUMP   69             /* Explicity exclude from the core dump,
+                                          overrides the coredump filter bits */
+#define MADV_DODUMP    70              /* Clear the MADV_NODUMP flag */
+
+/* compatibility flags */
+#define MAP_FILE       0
+#define MAP_VARIABLE   0
+
+#endif /* __PARISC_MMAN_H__ */
diff --git a/arch/parisc/include/uapi/asm/msgbuf.h b/arch/parisc/include/uapi/asm/msgbuf.h
new file mode 100644 (file)
index 0000000..fe88f26
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef _PARISC_MSGBUF_H
+#define _PARISC_MSGBUF_H
+
+/* 
+ * The msqid64_ds structure for parisc architecture, copied from sparc.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct msqid64_ds {
+       struct ipc64_perm msg_perm;
+#ifndef CONFIG_64BIT
+       unsigned int   __pad1;
+#endif
+       __kernel_time_t msg_stime;      /* last msgsnd time */
+#ifndef CONFIG_64BIT
+       unsigned int   __pad2;
+#endif
+       __kernel_time_t msg_rtime;      /* last msgrcv time */
+#ifndef CONFIG_64BIT
+       unsigned int   __pad3;
+#endif
+       __kernel_time_t msg_ctime;      /* last change time */
+       unsigned int  msg_cbytes;       /* current number of bytes on queue */
+       unsigned int  msg_qnum; /* number of messages in queue */
+       unsigned int  msg_qbytes;       /* max number of bytes on queue */
+       __kernel_pid_t msg_lspid;       /* pid of last msgsnd */
+       __kernel_pid_t msg_lrpid;       /* last receive pid */
+       unsigned int  __unused1;
+       unsigned int  __unused2;
+};
+
+#endif /* _PARISC_MSGBUF_H */
diff --git a/arch/parisc/include/uapi/asm/pdc.h b/arch/parisc/include/uapi/asm/pdc.h
new file mode 100644 (file)
index 0000000..702498f
--- /dev/null
@@ -0,0 +1,427 @@
+#ifndef _UAPI_PARISC_PDC_H
+#define _UAPI_PARISC_PDC_H
+
+/*
+ *     PDC return values ...
+ *     All PDC calls return a subset of these errors. 
+ */
+
+#define PDC_WARN                 3     /* Call completed with a warning */
+#define PDC_REQ_ERR_1            2     /* See above                     */
+#define PDC_REQ_ERR_0            1     /* Call would generate a requestor error */
+#define PDC_OK                   0     /* Call completed successfully  */
+#define PDC_BAD_PROC            -1     /* Called non-existent procedure*/
+#define PDC_BAD_OPTION          -2     /* Called with non-existent option */
+#define PDC_ERROR               -3     /* Call could not complete without an error */
+#define PDC_NE_MOD              -5     /* Module not found             */
+#define PDC_NE_CELL_MOD                 -7     /* Cell module not found        */
+#define PDC_INVALID_ARG                -10     /* Called with an invalid argument */
+#define PDC_BUS_POW_WARN       -12     /* Call could not complete in allowed power budget */
+#define PDC_NOT_NARROW         -17     /* Narrow mode not supported    */
+
+/*
+ *     PDC entry points...
+ */
+
+#define PDC_POW_FAIL   1               /* perform a power-fail         */
+#define PDC_POW_FAIL_PREPARE   0       /* prepare for powerfail        */
+
+#define PDC_CHASSIS    2               /* PDC-chassis functions        */
+#define PDC_CHASSIS_DISP       0       /* update chassis display       */
+#define PDC_CHASSIS_WARN       1       /* return chassis warnings      */
+#define PDC_CHASSIS_DISPWARN   2       /* update&return chassis status */
+#define PDC_RETURN_CHASSIS_INFO 128    /* HVERSION dependent: return chassis LED/LCD info  */
+
+#define PDC_PIM         3               /* Get PIM data                 */
+#define PDC_PIM_HPMC            0       /* Transfer HPMC data           */
+#define PDC_PIM_RETURN_SIZE     1       /* Get Max buffer needed for PIM*/
+#define PDC_PIM_LPMC            2       /* Transfer HPMC data           */
+#define PDC_PIM_SOFT_BOOT       3       /* Transfer Soft Boot data      */
+#define PDC_PIM_TOC             4       /* Transfer TOC data            */
+
+#define PDC_MODEL      4               /* PDC model information call   */
+#define PDC_MODEL_INFO         0       /* returns information          */
+#define PDC_MODEL_BOOTID       1       /* set the BOOT_ID              */
+#define PDC_MODEL_VERSIONS     2       /* returns cpu-internal versions*/
+#define PDC_MODEL_SYSMODEL     3       /* return system model info     */
+#define PDC_MODEL_ENSPEC       4       /* enable specific option       */
+#define PDC_MODEL_DISPEC       5       /* disable specific option      */
+#define PDC_MODEL_CPU_ID       6       /* returns cpu-id (only newer machines!) */
+#define PDC_MODEL_CAPABILITIES 7       /* returns OS32/OS64-flags      */
+/* Values for PDC_MODEL_CAPABILITIES non-equivalent virtual aliasing support */
+#define  PDC_MODEL_OS64                        (1 << 0)
+#define  PDC_MODEL_OS32                        (1 << 1)
+#define  PDC_MODEL_IOPDIR_FDC          (1 << 2)
+#define  PDC_MODEL_NVA_MASK            (3 << 4)
+#define  PDC_MODEL_NVA_SUPPORTED       (0 << 4)
+#define  PDC_MODEL_NVA_SLOW            (1 << 4)
+#define  PDC_MODEL_NVA_UNSUPPORTED     (3 << 4)
+#define PDC_MODEL_GET_BOOT__OP 8       /* returns boot test options    */
+#define PDC_MODEL_SET_BOOT__OP 9       /* set boot test options        */
+
+#define PA89_INSTRUCTION_SET   0x4     /* capatibilies returned        */
+#define PA90_INSTRUCTION_SET   0x8
+
+#define PDC_CACHE      5               /* return/set cache (& TLB) info*/
+#define PDC_CACHE_INFO         0       /* returns information          */
+#define PDC_CACHE_SET_COH      1       /* set coherence state          */
+#define PDC_CACHE_RET_SPID     2       /* returns space-ID bits        */
+
+#define PDC_HPA                6               /* return HPA of processor      */
+#define PDC_HPA_PROCESSOR      0
+#define PDC_HPA_MODULES                1
+
+#define PDC_COPROC     7               /* Co-Processor (usually FP unit(s)) */
+#define PDC_COPROC_CFG         0       /* Co-Processor Cfg (FP unit(s) enabled?) */
+
+#define PDC_IODC       8               /* talk to IODC                 */
+#define PDC_IODC_READ          0       /* read IODC entry point        */
+/*      PDC_IODC_RI_                    * INDEX parameter of PDC_IODC_READ */
+#define PDC_IODC_RI_DATA_BYTES 0       /* IODC Data Bytes              */
+/*                             1, 2       obsolete - HVERSION dependent*/
+#define PDC_IODC_RI_INIT       3       /* Initialize module            */
+#define PDC_IODC_RI_IO         4       /* Module input/output          */
+#define PDC_IODC_RI_SPA                5       /* Module input/output          */
+#define PDC_IODC_RI_CONFIG     6       /* Module input/output          */
+/*                             7         obsolete - HVERSION dependent */
+#define PDC_IODC_RI_TEST       8       /* Module input/output          */
+#define PDC_IODC_RI_TLB                9       /* Module input/output          */
+#define PDC_IODC_NINIT         2       /* non-destructive init         */
+#define PDC_IODC_DINIT         3       /* destructive init             */
+#define PDC_IODC_MEMERR                4       /* check for memory errors      */
+#define PDC_IODC_INDEX_DATA    0       /* get first 16 bytes from mod IODC */
+#define PDC_IODC_BUS_ERROR     -4      /* bus error return value       */
+#define PDC_IODC_INVALID_INDEX -5      /* invalid index return value   */
+#define PDC_IODC_COUNT         -6      /* count is too small           */
+
+#define PDC_TOD                9               /* time-of-day clock (TOD)      */
+#define PDC_TOD_READ           0       /* read TOD                     */
+#define PDC_TOD_WRITE          1       /* write TOD                    */
+
+
+#define PDC_STABLE     10              /* stable storage (sprockets)   */
+#define PDC_STABLE_READ                0
+#define PDC_STABLE_WRITE       1
+#define PDC_STABLE_RETURN_SIZE 2
+#define PDC_STABLE_VERIFY_CONTENTS 3
+#define PDC_STABLE_INITIALIZE  4
+
+#define PDC_NVOLATILE  11              /* often not implemented        */
+
+#define PDC_ADD_VALID  12              /* Memory validation PDC call   */
+#define PDC_ADD_VALID_VERIFY   0       /* Make PDC_ADD_VALID verify region */
+
+#define PDC_INSTR      15              /* get instr to invoke PDCE_CHECK() */
+
+#define PDC_PROC       16              /* (sprockets)                  */
+
+#define PDC_CONFIG     16              /* (sprockets)                  */
+#define PDC_CONFIG_DECONFIG    0
+#define PDC_CONFIG_DRECONFIG   1
+#define PDC_CONFIG_DRETURN_CONFIG 2
+
+#define PDC_BLOCK_TLB  18              /* manage hardware block-TLB    */
+#define PDC_BTLB_INFO          0       /* returns parameter            */
+#define PDC_BTLB_INSERT                1       /* insert BTLB entry            */
+#define PDC_BTLB_PURGE         2       /* purge BTLB entries           */
+#define PDC_BTLB_PURGE_ALL     3       /* purge all BTLB entries       */
+
+#define PDC_TLB                19              /* manage hardware TLB miss handling */
+#define PDC_TLB_INFO           0       /* returns parameter            */
+#define PDC_TLB_SETUP          1       /* set up miss handling         */
+
+#define PDC_MEM                20              /* Manage memory                */
+#define PDC_MEM_MEMINFO                0
+#define PDC_MEM_ADD_PAGE       1
+#define PDC_MEM_CLEAR_PDT      2
+#define PDC_MEM_READ_PDT       3
+#define PDC_MEM_RESET_CLEAR    4
+#define PDC_MEM_GOODMEM                5
+#define PDC_MEM_TABLE          128     /* Non contig mem map (sprockets) */
+#define PDC_MEM_RETURN_ADDRESS_TABLE   PDC_MEM_TABLE
+#define PDC_MEM_GET_MEMORY_SYSTEM_TABLES_SIZE  131
+#define PDC_MEM_GET_MEMORY_SYSTEM_TABLES       132
+#define PDC_MEM_GET_PHYSICAL_LOCATION_FROM_MEMORY_ADDRESS 133
+
+#define PDC_MEM_RET_SBE_REPLACED       5       /* PDC_MEM return values */
+#define PDC_MEM_RET_DUPLICATE_ENTRY    4
+#define PDC_MEM_RET_BUF_SIZE_SMALL     1
+#define PDC_MEM_RET_PDT_FULL           -11
+#define PDC_MEM_RET_INVALID_PHYSICAL_LOCATION ~0ULL
+
+#define PDC_PSW                21              /* Get/Set default System Mask  */
+#define PDC_PSW_MASK           0       /* Return mask                  */
+#define PDC_PSW_GET_DEFAULTS   1       /* Return defaults              */
+#define PDC_PSW_SET_DEFAULTS   2       /* Set default                  */
+#define PDC_PSW_ENDIAN_BIT     1       /* set for big endian           */
+#define PDC_PSW_WIDE_BIT       2       /* set for wide mode            */ 
+
+#define PDC_SYSTEM_MAP 22              /* find system modules          */
+#define PDC_FIND_MODULE        0
+#define PDC_FIND_ADDRESS       1
+#define PDC_TRANSLATE_PATH     2
+
+#define PDC_SOFT_POWER 23              /* soft power switch            */
+#define PDC_SOFT_POWER_INFO    0       /* return info about the soft power switch */
+#define PDC_SOFT_POWER_ENABLE  1       /* enable/disable soft power switch */
+
+
+/* HVERSION dependent */
+
+/* The PDC_MEM_MAP calls */
+#define PDC_MEM_MAP    128             /* on s700: return page info    */
+#define PDC_MEM_MAP_HPA                0       /* returns hpa of a module      */
+
+#define PDC_EEPROM     129             /* EEPROM access                */
+#define PDC_EEPROM_READ_WORD   0
+#define PDC_EEPROM_WRITE_WORD  1
+#define PDC_EEPROM_READ_BYTE   2
+#define PDC_EEPROM_WRITE_BYTE  3
+#define PDC_EEPROM_EEPROM_PASSWORD -1000
+
+#define PDC_NVM                130             /* NVM (non-volatile memory) access */
+#define PDC_NVM_READ_WORD      0
+#define PDC_NVM_WRITE_WORD     1
+#define PDC_NVM_READ_BYTE      2
+#define PDC_NVM_WRITE_BYTE     3
+
+#define PDC_SEED_ERROR 132             /* (sprockets)                  */
+
+#define PDC_IO         135             /* log error info, reset IO system */
+#define PDC_IO_READ_AND_CLEAR_ERRORS   0
+#define PDC_IO_RESET                   1
+#define PDC_IO_RESET_DEVICES           2
+/* sets bits 6&7 (little endian) of the HcControl Register */
+#define PDC_IO_USB_SUSPEND     0xC000000000000000
+#define PDC_IO_EEPROM_IO_ERR_TABLE_FULL        -5      /* return value */
+#define PDC_IO_NO_SUSPEND              -6      /* return value */
+
+#define PDC_BROADCAST_RESET 136                /* reset all processors         */
+#define PDC_DO_RESET           0       /* option: perform a broadcast reset */
+#define PDC_DO_FIRM_TEST_RESET 1       /* Do broadcast reset with bitmap */
+#define PDC_BR_RECONFIGURATION 2       /* reset w/reconfiguration      */
+#define PDC_FIRM_TEST_MAGIC    0xab9ec36fUL    /* for this reboot only */
+
+#define PDC_LAN_STATION_ID 138         /* Hversion dependent mechanism for */
+#define PDC_LAN_STATION_ID_READ        0       /* getting the lan station address  */
+
+#define        PDC_LAN_STATION_ID_SIZE 6
+
+#define PDC_CHECK_RANGES 139           /* (sprockets)                  */
+
+#define PDC_NV_SECTIONS        141             /* (sprockets)                  */
+
+#define PDC_PERFORMANCE        142             /* performance monitoring       */
+
+#define PDC_SYSTEM_INFO        143             /* system information           */
+#define PDC_SYSINFO_RETURN_INFO_SIZE   0
+#define PDC_SYSINFO_RRETURN_SYS_INFO   1
+#define PDC_SYSINFO_RRETURN_ERRORS     2
+#define PDC_SYSINFO_RRETURN_WARNINGS   3
+#define PDC_SYSINFO_RETURN_REVISIONS   4
+#define PDC_SYSINFO_RRETURN_DIAGNOSE   5
+#define PDC_SYSINFO_RRETURN_HV_DIAGNOSE        1005
+
+#define PDC_RDR                144             /* (sprockets)                  */
+#define PDC_RDR_READ_BUFFER    0
+#define PDC_RDR_READ_SINGLE    1
+#define PDC_RDR_WRITE_SINGLE   2
+
+#define PDC_INTRIGUE   145             /* (sprockets)                  */
+#define PDC_INTRIGUE_WRITE_BUFFER       0
+#define PDC_INTRIGUE_GET_SCRATCH_BUFSIZE 1
+#define PDC_INTRIGUE_START_CPU_COUNTERS         2
+#define PDC_INTRIGUE_STOP_CPU_COUNTERS  3
+
+#define PDC_STI                146             /* STI access                   */
+/* same as PDC_PCI_XXX values (see below) */
+
+/* Legacy PDC definitions for same stuff */
+#define PDC_PCI_INDEX  147
+#define PDC_PCI_INTERFACE_INFO         0
+#define PDC_PCI_SLOT_INFO              1
+#define PDC_PCI_INFLIGHT_BYTES         2
+#define PDC_PCI_READ_CONFIG            3
+#define PDC_PCI_WRITE_CONFIG           4
+#define PDC_PCI_READ_PCI_IO            5
+#define PDC_PCI_WRITE_PCI_IO           6
+#define PDC_PCI_READ_CONFIG_DELAY      7
+#define PDC_PCI_UPDATE_CONFIG_DELAY    8
+#define PDC_PCI_PCI_PATH_TO_PCI_HPA    9
+#define PDC_PCI_PCI_HPA_TO_PCI_PATH    10
+#define PDC_PCI_PCI_PATH_TO_PCI_BUS    11
+#define PDC_PCI_PCI_RESERVED           12
+#define PDC_PCI_PCI_INT_ROUTE_SIZE     13
+#define PDC_PCI_GET_INT_TBL_SIZE       PDC_PCI_PCI_INT_ROUTE_SIZE
+#define PDC_PCI_PCI_INT_ROUTE          14
+#define PDC_PCI_GET_INT_TBL            PDC_PCI_PCI_INT_ROUTE 
+#define PDC_PCI_READ_MON_TYPE          15
+#define PDC_PCI_WRITE_MON_TYPE         16
+
+
+/* Get SCSI Interface Card info:  SDTR, SCSI ID, mode (SE vs LVD) */
+#define PDC_INITIATOR  163
+#define PDC_GET_INITIATOR      0
+#define PDC_SET_INITIATOR      1
+#define PDC_DELETE_INITIATOR   2
+#define PDC_RETURN_TABLE_SIZE  3
+#define PDC_RETURN_TABLE       4
+
+#define PDC_LINK       165             /* (sprockets)                  */
+#define PDC_LINK_PCI_ENTRY_POINTS      0  /* list (Arg1) = 0 */
+#define PDC_LINK_USB_ENTRY_POINTS      1  /* list (Arg1) = 1 */
+
+/* cl_class
+ * page 3-33 of IO-Firmware ARS
+ * IODC ENTRY_INIT(Search first) RET[1]
+ */
+#define        CL_NULL         0       /* invalid */
+#define        CL_RANDOM       1       /* random access (as disk) */
+#define        CL_SEQU         2       /* sequential access (as tape) */
+#define        CL_DUPLEX       7       /* full-duplex point-to-point (RS-232, Net) */
+#define        CL_KEYBD        8       /* half-duplex console (HIL Keyboard) */
+#define        CL_DISPL        9       /* half-duplex console (display) */
+#define        CL_FC           10      /* FiberChannel access media */
+
+/* IODC ENTRY_INIT() */
+#define ENTRY_INIT_SRCH_FRST   2
+#define ENTRY_INIT_SRCH_NEXT   3
+#define ENTRY_INIT_MOD_DEV     4
+#define ENTRY_INIT_DEV         5
+#define ENTRY_INIT_MOD         6
+#define ENTRY_INIT_MSG         9
+
+/* IODC ENTRY_IO() */
+#define ENTRY_IO_BOOTIN                0
+#define ENTRY_IO_BOOTOUT       1
+#define ENTRY_IO_CIN           2
+#define ENTRY_IO_COUT          3
+#define ENTRY_IO_CLOSE         4
+#define ENTRY_IO_GETMSG                9
+#define ENTRY_IO_BBLOCK_IN     16
+#define ENTRY_IO_BBLOCK_OUT    17
+
+/* IODC ENTRY_SPA() */
+
+/* IODC ENTRY_CONFIG() */
+
+/* IODC ENTRY_TEST() */
+
+/* IODC ENTRY_TLB() */
+
+/* constants for OS (NVM...) */
+#define OS_ID_NONE             0       /* Undefined OS ID      */
+#define OS_ID_HPUX             1       /* HP-UX OS             */
+#define OS_ID_MPEXL            2       /* MPE XL OS            */
+#define OS_ID_OSF              3       /* OSF OS               */
+#define OS_ID_HPRT             4       /* HP-RT OS             */
+#define OS_ID_NOVEL            5       /* NOVELL OS            */
+#define OS_ID_LINUX            6       /* Linux                */
+
+
+/* constants for PDC_CHASSIS */
+#define OSTAT_OFF              0
+#define OSTAT_FLT              1 
+#define OSTAT_TEST             2
+#define OSTAT_INIT             3
+#define OSTAT_SHUT             4
+#define OSTAT_WARN             5
+#define OSTAT_RUN              6
+#define OSTAT_ON               7
+
+/* Page Zero constant offsets used by the HPMC handler */
+#define BOOT_CONSOLE_HPA_OFFSET  0x3c0
+#define BOOT_CONSOLE_SPA_OFFSET  0x3c4
+#define BOOT_CONSOLE_PATH_OFFSET 0x3a8
+
+/* size of the pdc_result buffer for firmware.c */
+#define NUM_PDC_RESULT 32
+
+#if !defined(__ASSEMBLY__)
+
+#include <linux/types.h>
+
+
+/* flags of the device_path */
+#define        PF_AUTOBOOT     0x80
+#define        PF_AUTOSEARCH   0x40
+#define        PF_TIMER        0x0F
+
+struct device_path {           /* page 1-69 */
+       unsigned char flags;    /* flags see above! */
+       unsigned char bc[6];    /* bus converter routing info */
+       unsigned char mod;
+       unsigned int  layers[6];/* device-specific layer-info */
+} __attribute__((aligned(8))) ;
+
+struct pz_device {
+       struct  device_path dp; /* see above */
+       /* struct       iomod *hpa; */
+       unsigned int hpa;       /* HPA base address */
+       /* char *spa; */
+       unsigned int spa;       /* SPA base address */
+       /* int  (*iodc_io)(struct iomod*, ...); */
+       unsigned int iodc_io;   /* device entry point */
+       short   pad;            /* reserved */
+       unsigned short cl_class;/* see below */
+} __attribute__((aligned(8))) ;
+
+struct zeropage {
+       /* [0x000] initialize vectors (VEC) */
+       unsigned int    vec_special;            /* must be zero */
+       /* int  (*vec_pow_fail)(void);*/
+       unsigned int    vec_pow_fail; /* power failure handler */
+       /* int  (*vec_toc)(void); */
+       unsigned int    vec_toc;
+       unsigned int    vec_toclen;
+       /* int  (*vec_rendz)(void); */
+       unsigned int vec_rendz;
+       int     vec_pow_fail_flen;
+       int     vec_pad[10];            
+       
+       /* [0x040] reserved processor dependent */
+       int     pad0[112];
+
+       /* [0x200] reserved */
+       int     pad1[84];
+
+       /* [0x350] memory configuration (MC) */
+       int     memc_cont;              /* contiguous mem size (bytes) */
+       int     memc_phsize;            /* physical memory size */
+       int     memc_adsize;            /* additional mem size, bytes of SPA space used by PDC */
+       unsigned int mem_pdc_hi;        /* used for 64-bit */
+
+       /* [0x360] various parameters for the boot-CPU */
+       /* unsigned int *mem_booterr[8]; */
+       unsigned int mem_booterr[8];    /* ptr to boot errors */
+       unsigned int mem_free;          /* first location, where OS can be loaded */
+       /* struct iomod *mem_hpa; */
+       unsigned int mem_hpa;           /* HPA of the boot-CPU */
+       /* int (*mem_pdc)(int, ...); */
+       unsigned int mem_pdc;           /* PDC entry point */
+       unsigned int mem_10msec;        /* number of clock ticks in 10msec */
+
+       /* [0x390] initial memory module (IMM) */
+       /* struct iomod *imm_hpa; */
+       unsigned int imm_hpa;           /* HPA of the IMM */
+       int     imm_soft_boot;          /* 0 = was hard boot, 1 = was soft boot */
+       unsigned int    imm_spa_size;           /* SPA size of the IMM in bytes */
+       unsigned int    imm_max_mem;            /* bytes of mem in IMM */
+
+       /* [0x3A0] boot console, display device and keyboard */
+       struct pz_device mem_cons;      /* description of console device */
+       struct pz_device mem_boot;      /* description of boot device */
+       struct pz_device mem_kbd;       /* description of keyboard device */
+
+       /* [0x430] reserved */
+       int     pad430[116];
+
+       /* [0x600] processor dependent */
+       __u32   pad600[1];
+       __u32   proc_sti;               /* pointer to STI ROM */
+       __u32   pad608[126];
+};
+
+#endif /* !defined(__ASSEMBLY__) */
+
+#endif /* _UAPI_PARISC_PDC_H */
diff --git a/arch/parisc/include/uapi/asm/posix_types.h b/arch/parisc/include/uapi/asm/posix_types.h
new file mode 100644 (file)
index 0000000..b934425
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef __ARCH_PARISC_POSIX_TYPES_H
+#define __ARCH_PARISC_POSIX_TYPES_H
+
+/*
+ * This file is generally used by user-level software, so you need to
+ * be a little careful about namespace pollution etc.  Also, we cannot
+ * assume GCC is being used.
+ */
+
+typedef unsigned short         __kernel_mode_t;
+#define __kernel_mode_t __kernel_mode_t
+
+typedef unsigned short         __kernel_ipc_pid_t;
+#define __kernel_ipc_pid_t __kernel_ipc_pid_t
+
+typedef int                    __kernel_suseconds_t;
+#define __kernel_suseconds_t __kernel_suseconds_t
+
+typedef long long              __kernel_off64_t;
+typedef unsigned long long     __kernel_ino64_t;
+
+#include <asm-generic/posix_types.h>
+
+#endif
diff --git a/arch/parisc/include/uapi/asm/ptrace.h b/arch/parisc/include/uapi/asm/ptrace.h
new file mode 100644 (file)
index 0000000..c4fa6c8
--- /dev/null
@@ -0,0 +1,47 @@
+/* written by Philipp Rumpf, Copyright (C) 1999 SuSE GmbH Nuernberg
+** Copyright (C) 2000 Grant Grundler, Hewlett-Packard
+*/
+#ifndef _UAPI_PARISC_PTRACE_H
+#define _UAPI_PARISC_PTRACE_H
+
+
+#include <linux/types.h>
+
+/* This struct defines the way the registers are stored on the 
+ * stack during a system call.
+ *
+ * N.B. gdb/strace care about the size and offsets within this
+ * structure. If you change things, you may break object compatibility
+ * for those applications.
+ */
+
+struct pt_regs {
+       unsigned long gr[32];   /* PSW is in gr[0] */
+       __u64 fr[32];
+       unsigned long sr[ 8];
+       unsigned long iasq[2];
+       unsigned long iaoq[2];
+       unsigned long cr27;
+       unsigned long pad0;     /* available for other uses */
+       unsigned long orig_r28;
+       unsigned long ksp;
+       unsigned long kpc;
+       unsigned long sar;      /* CR11 */
+       unsigned long iir;      /* CR19 */
+       unsigned long isr;      /* CR20 */
+       unsigned long ior;      /* CR21 */
+       unsigned long ipsw;     /* CR22 */
+};
+
+/*
+ * The numbers chosen here are somewhat arbitrary but absolutely MUST
+ * not overlap with any of the number assigned in <linux/ptrace.h>.
+ *
+ * These ones are taken from IA-64 on the assumption that theirs are
+ * the most correct (and we also want to support PTRACE_SINGLEBLOCK
+ * since we have taken branch traps too)
+ */
+#define PTRACE_SINGLEBLOCK     12      /* resume execution until next branch */
+
+
+#endif /* _UAPI_PARISC_PTRACE_H */
diff --git a/arch/parisc/include/uapi/asm/resource.h b/arch/parisc/include/uapi/asm/resource.h
new file mode 100644 (file)
index 0000000..8b06343
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef _ASM_PARISC_RESOURCE_H
+#define _ASM_PARISC_RESOURCE_H
+
+#define _STK_LIM_MAX   10 * _STK_LIM
+#include <asm-generic/resource.h>
+
+#endif
diff --git a/arch/parisc/include/uapi/asm/sembuf.h b/arch/parisc/include/uapi/asm/sembuf.h
new file mode 100644 (file)
index 0000000..1e59ffd
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef _PARISC_SEMBUF_H
+#define _PARISC_SEMBUF_H
+
+/* 
+ * The semid64_ds structure for parisc architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct semid64_ds {
+       struct ipc64_perm sem_perm;             /* permissions .. see ipc.h */
+#ifndef CONFIG_64BIT
+       unsigned int    __pad1;
+#endif
+       __kernel_time_t sem_otime;              /* last semop time */
+#ifndef CONFIG_64BIT
+       unsigned int    __pad2;
+#endif
+       __kernel_time_t sem_ctime;              /* last change time */
+       unsigned int    sem_nsems;              /* no. of semaphores in array */
+       unsigned int    __unused1;
+       unsigned int    __unused2;
+};
+
+#endif /* _PARISC_SEMBUF_H */
diff --git a/arch/parisc/include/uapi/asm/setup.h b/arch/parisc/include/uapi/asm/setup.h
new file mode 100644 (file)
index 0000000..7da2e5b
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _PARISC_SETUP_H
+#define _PARISC_SETUP_H
+
+#define COMMAND_LINE_SIZE      1024
+
+#endif /* _PARISC_SETUP_H */
diff --git a/arch/parisc/include/uapi/asm/shmbuf.h b/arch/parisc/include/uapi/asm/shmbuf.h
new file mode 100644 (file)
index 0000000..0a3eada
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef _PARISC_SHMBUF_H
+#define _PARISC_SHMBUF_H
+
+/* 
+ * The shmid64_ds structure for parisc architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct shmid64_ds {
+       struct ipc64_perm       shm_perm;       /* operation perms */
+#ifndef CONFIG_64BIT
+       unsigned int            __pad1;
+#endif
+       __kernel_time_t         shm_atime;      /* last attach time */
+#ifndef CONFIG_64BIT
+       unsigned int            __pad2;
+#endif
+       __kernel_time_t         shm_dtime;      /* last detach time */
+#ifndef CONFIG_64BIT
+       unsigned int            __pad3;
+#endif
+       __kernel_time_t         shm_ctime;      /* last change time */
+#ifndef CONFIG_64BIT
+       unsigned int            __pad4;
+#endif
+       size_t                  shm_segsz;      /* size of segment (bytes) */
+       __kernel_pid_t          shm_cpid;       /* pid of creator */
+       __kernel_pid_t          shm_lpid;       /* pid of last operator */
+       unsigned int            shm_nattch;     /* no. of current attaches */
+       unsigned int            __unused1;
+       unsigned int            __unused2;
+};
+
+#ifdef CONFIG_64BIT
+/* The 'unsigned int' (formerly 'unsigned long') data types below will
+ * ensure that a 32-bit app calling shmctl(*,IPC_INFO,*) will work on
+ * a wide kernel, but if some of these values are meant to contain pointers
+ * they may need to be 'long long' instead. -PB XXX FIXME
+ */
+#endif
+struct shminfo64 {
+       unsigned int    shmmax;
+       unsigned int    shmmin;
+       unsigned int    shmmni;
+       unsigned int    shmseg;
+       unsigned int    shmall;
+       unsigned int    __unused1;
+       unsigned int    __unused2;
+       unsigned int    __unused3;
+       unsigned int    __unused4;
+};
+
+#endif /* _PARISC_SHMBUF_H */
diff --git a/arch/parisc/include/uapi/asm/sigcontext.h b/arch/parisc/include/uapi/asm/sigcontext.h
new file mode 100644 (file)
index 0000000..27ef31b
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef _ASMPARISC_SIGCONTEXT_H
+#define _ASMPARISC_SIGCONTEXT_H
+
+#define PARISC_SC_FLAG_ONSTACK 1<<0
+#define PARISC_SC_FLAG_IN_SYSCALL 1<<1
+
+/* We will add more stuff here as it becomes necessary, until we know
+   it works. */
+struct sigcontext {
+       unsigned long sc_flags;
+
+       unsigned long sc_gr[32]; /* PSW in sc_gr[0] */
+       unsigned long long sc_fr[32]; /* FIXME, do we need other state info? */
+       unsigned long sc_iasq[2];
+       unsigned long sc_iaoq[2];
+       unsigned long sc_sar; /* cr11 */
+};
+
+
+#endif
diff --git a/arch/parisc/include/uapi/asm/siginfo.h b/arch/parisc/include/uapi/asm/siginfo.h
new file mode 100644 (file)
index 0000000..d703472
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef _PARISC_SIGINFO_H
+#define _PARISC_SIGINFO_H
+
+#include <asm-generic/siginfo.h>
+
+#undef NSIGTRAP
+#define NSIGTRAP       4
+
+#endif
diff --git a/arch/parisc/include/uapi/asm/signal.h b/arch/parisc/include/uapi/asm/signal.h
new file mode 100644 (file)
index 0000000..b1ddaa2
--- /dev/null
@@ -0,0 +1,118 @@
+#ifndef _UAPI_ASM_PARISC_SIGNAL_H
+#define _UAPI_ASM_PARISC_SIGNAL_H
+
+#define SIGHUP          1
+#define SIGINT          2
+#define SIGQUIT                 3
+#define SIGILL          4
+#define SIGTRAP                 5
+#define SIGABRT                 6
+#define SIGIOT          6
+#define SIGEMT          7
+#define SIGFPE          8
+#define SIGKILL                 9
+#define SIGBUS         10
+#define SIGSEGV                11
+#define SIGSYS         12 /* Linux doesn't use this */
+#define SIGPIPE                13
+#define SIGALRM                14
+#define SIGTERM                15
+#define SIGUSR1                16
+#define SIGUSR2                17
+#define SIGCHLD                18
+#define SIGPWR         19
+#define SIGVTALRM      20
+#define SIGPROF                21
+#define SIGIO          22
+#define SIGPOLL                SIGIO
+#define SIGWINCH       23
+#define SIGSTOP                24
+#define SIGTSTP                25
+#define SIGCONT                26
+#define SIGTTIN                27
+#define SIGTTOU                28
+#define SIGURG         29
+#define SIGLOST                30 /* Linux doesn't use this either */
+#define        SIGUNUSED       31
+#define SIGRESERVE     SIGUNUSED
+
+#define SIGXCPU                33
+#define SIGXFSZ                34
+#define SIGSTKFLT      36
+
+/* These should not be considered constants from userland.  */
+#define SIGRTMIN       37
+#define SIGRTMAX       _NSIG /* it's 44 under HP/UX */
+
+/*
+ * SA_FLAGS values:
+ *
+ * SA_ONSTACK indicates that a registered stack_t will be used.
+ * SA_RESTART flag to get restarting signals (which were the default long ago)
+ * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
+ * SA_RESETHAND clears the handler when the signal is delivered.
+ * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
+ * SA_NODEFER prevents the current signal from being masked in the handler.
+ *
+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
+ * Unix names RESETHAND and NODEFER respectively.
+ */
+#define SA_ONSTACK     0x00000001
+#define SA_RESETHAND   0x00000004
+#define SA_NOCLDSTOP   0x00000008
+#define SA_SIGINFO     0x00000010
+#define SA_NODEFER     0x00000020
+#define SA_RESTART     0x00000040
+#define SA_NOCLDWAIT   0x00000080
+#define _SA_SIGGFAULT  0x00000100 /* HPUX */
+
+#define SA_NOMASK      SA_NODEFER
+#define SA_ONESHOT     SA_RESETHAND
+
+#define SA_RESTORER    0x04000000 /* obsolete -- ignored */
+
+/* 
+ * sigaltstack controls
+ */
+#define SS_ONSTACK     1
+#define SS_DISABLE     2
+
+#define MINSIGSTKSZ    2048
+#define SIGSTKSZ       8192
+
+
+#define SIG_BLOCK          0   /* for blocking signals */
+#define SIG_UNBLOCK        1   /* for unblocking signals */
+#define SIG_SETMASK        2   /* for setting the signal mask */
+
+#define SIG_DFL        ((__sighandler_t)0)     /* default signal handling */
+#define SIG_IGN        ((__sighandler_t)1)     /* ignore signal */
+#define SIG_ERR        ((__sighandler_t)-1)    /* error return from signal */
+
+# ifndef __ASSEMBLY__
+
+#  include <linux/types.h>
+
+/* Avoid too many header ordering problems.  */
+struct siginfo;
+
+/* Type of a signal handler.  */
+#ifdef CONFIG_64BIT
+/* function pointers on 64-bit parisc are pointers to little structs and the
+ * compiler doesn't support code which changes or tests the address of
+ * the function in the little struct.  This is really ugly -PB
+ */
+typedef char __user *__sighandler_t;
+#else
+typedef void __signalfn_t(int);
+typedef __signalfn_t __user *__sighandler_t;
+#endif
+
+typedef struct sigaltstack {
+       void __user *ss_sp;
+       int ss_flags;
+       size_t ss_size;
+} stack_t;
+
+#endif /* !__ASSEMBLY */
+#endif /* _UAPI_ASM_PARISC_SIGNAL_H */
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h
new file mode 100644 (file)
index 0000000..1b52c2c
--- /dev/null
@@ -0,0 +1,77 @@
+#ifndef _ASM_SOCKET_H
+#define _ASM_SOCKET_H
+
+#include <asm/sockios.h>
+
+/* For setsockopt(2) */
+#define SOL_SOCKET     0xffff
+
+#define SO_DEBUG       0x0001
+#define SO_REUSEADDR   0x0004
+#define SO_KEEPALIVE   0x0008
+#define SO_DONTROUTE   0x0010
+#define SO_BROADCAST   0x0020
+#define SO_LINGER      0x0080
+#define SO_OOBINLINE   0x0100
+/* To add :#define SO_REUSEPORT 0x0200 */
+#define SO_SNDBUF      0x1001
+#define SO_RCVBUF      0x1002
+#define SO_SNDBUFFORCE 0x100a
+#define SO_RCVBUFFORCE 0x100b
+#define SO_SNDLOWAT    0x1003
+#define SO_RCVLOWAT    0x1004
+#define SO_SNDTIMEO    0x1005
+#define SO_RCVTIMEO    0x1006
+#define SO_ERROR       0x1007
+#define SO_TYPE                0x1008
+#define SO_PROTOCOL    0x1028
+#define SO_DOMAIN      0x1029
+#define SO_PEERNAME    0x2000
+
+#define SO_NO_CHECK    0x400b
+#define SO_PRIORITY    0x400c
+#define SO_BSDCOMPAT   0x400e
+#define SO_PASSCRED    0x4010
+#define SO_PEERCRED    0x4011
+#define SO_TIMESTAMP   0x4012
+#define SCM_TIMESTAMP  SO_TIMESTAMP
+#define SO_TIMESTAMPNS 0x4013
+#define SCM_TIMESTAMPNS        SO_TIMESTAMPNS
+
+/* Security levels - as per NRL IPv6 - don't actually do anything */
+#define SO_SECURITY_AUTHENTICATION             0x4016
+#define SO_SECURITY_ENCRYPTION_TRANSPORT       0x4017
+#define SO_SECURITY_ENCRYPTION_NETWORK         0x4018
+
+#define SO_BINDTODEVICE        0x4019
+
+/* Socket filtering */
+#define SO_ATTACH_FILTER        0x401a
+#define SO_DETACH_FILTER        0x401b
+
+#define SO_ACCEPTCONN          0x401c
+
+#define SO_PEERSEC             0x401d
+#define SO_PASSSEC             0x401e
+
+#define SO_MARK                        0x401f
+
+#define SO_TIMESTAMPING                0x4020
+#define SCM_TIMESTAMPING       SO_TIMESTAMPING
+
+#define SO_RXQ_OVFL             0x4021
+
+#define SO_WIFI_STATUS         0x4022
+#define SCM_WIFI_STATUS                SO_WIFI_STATUS
+#define SO_PEEK_OFF            0x4023
+
+/* Instruct lower device to use last 4-bytes of skb data as FCS */
+#define SO_NOFCS               0x4024
+
+
+/* O_NONBLOCK clashes with the bits used for socket types.  Therefore we
+ * have to define SOCK_NONBLOCK to a different value here.
+ */
+#define SOCK_NONBLOCK   0x40000000
+
+#endif /* _ASM_SOCKET_H */
diff --git a/arch/parisc/include/uapi/asm/sockios.h b/arch/parisc/include/uapi/asm/sockios.h
new file mode 100644 (file)
index 0000000..dabfbc7
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __ARCH_PARISC_SOCKIOS__
+#define __ARCH_PARISC_SOCKIOS__
+
+/* Socket-level I/O control calls. */
+#define FIOSETOWN      0x8901
+#define SIOCSPGRP      0x8902
+#define FIOGETOWN      0x8903
+#define SIOCGPGRP      0x8904
+#define SIOCATMARK     0x8905
+#define SIOCGSTAMP     0x8906          /* Get stamp (timeval) */
+#define SIOCGSTAMPNS   0x8907          /* Get stamp (timespec) */
+
+#endif
diff --git a/arch/parisc/include/uapi/asm/stat.h b/arch/parisc/include/uapi/asm/stat.h
new file mode 100644 (file)
index 0000000..d76fbda
--- /dev/null
@@ -0,0 +1,100 @@
+#ifndef _PARISC_STAT_H
+#define _PARISC_STAT_H
+
+#include <linux/types.h>
+
+struct stat {
+       unsigned int    st_dev;         /* dev_t is 32 bits on parisc */
+       ino_t           st_ino;         /* 32 bits */
+       mode_t          st_mode;        /* 16 bits */
+       unsigned short  st_nlink;       /* 16 bits */
+       unsigned short  st_reserved1;   /* old st_uid */
+       unsigned short  st_reserved2;   /* old st_gid */
+       unsigned int    st_rdev;
+       off_t           st_size;
+       time_t          st_atime;
+       unsigned int    st_atime_nsec;
+       time_t          st_mtime;
+       unsigned int    st_mtime_nsec;
+       time_t          st_ctime;
+       unsigned int    st_ctime_nsec;
+       int             st_blksize;
+       int             st_blocks;
+       unsigned int    __unused1;      /* ACL stuff */
+       unsigned int    __unused2;      /* network */
+       ino_t           __unused3;      /* network */
+       unsigned int    __unused4;      /* cnodes */
+       unsigned short  __unused5;      /* netsite */
+       short           st_fstype;
+       unsigned int    st_realdev;
+       unsigned short  st_basemode;
+       unsigned short  st_spareshort;
+       uid_t           st_uid;
+       gid_t           st_gid;
+       unsigned int    st_spare4[3];
+};
+
+#define STAT_HAVE_NSEC
+
+typedef __kernel_off64_t       off64_t;
+
+struct hpux_stat64 {
+       unsigned int    st_dev;         /* dev_t is 32 bits on parisc */
+       ino_t           st_ino;         /* 32 bits */
+       mode_t          st_mode;        /* 16 bits */
+       unsigned short  st_nlink;       /* 16 bits */
+       unsigned short  st_reserved1;   /* old st_uid */
+       unsigned short  st_reserved2;   /* old st_gid */
+       unsigned int    st_rdev;
+       off64_t         st_size;
+       time_t          st_atime;
+       unsigned int    st_spare1;
+       time_t          st_mtime;
+       unsigned int    st_spare2;
+       time_t          st_ctime;
+       unsigned int    st_spare3;
+       int             st_blksize;
+       __u64           st_blocks;
+       unsigned int    __unused1;      /* ACL stuff */
+       unsigned int    __unused2;      /* network */
+       ino_t           __unused3;      /* network */
+       unsigned int    __unused4;      /* cnodes */
+       unsigned short  __unused5;      /* netsite */
+       short           st_fstype;
+       unsigned int    st_realdev;
+       unsigned short  st_basemode;
+       unsigned short  st_spareshort;
+       uid_t           st_uid;
+       gid_t           st_gid;
+       unsigned int    st_spare4[3];
+};
+
+/* This is the struct that 32-bit userspace applications are expecting.
+ * How 64-bit apps are going to be compiled, I have no idea.  But at least
+ * this way, we don't have a wrapper in the kernel.
+ */
+struct stat64 {
+       unsigned long long      st_dev;
+       unsigned int            __pad1;
+
+       unsigned int            __st_ino;       /* Not actually filled in */
+       unsigned int            st_mode;
+       unsigned int            st_nlink;
+       unsigned int            st_uid;
+       unsigned int            st_gid;
+       unsigned long long      st_rdev;
+       unsigned int            __pad2;
+       signed long long        st_size;
+       signed int              st_blksize;
+
+       signed long long        st_blocks;
+       signed int              st_atime;
+       unsigned int            st_atime_nsec;
+       signed int              st_mtime;
+       unsigned int            st_mtime_nsec;
+       signed int              st_ctime;
+       unsigned int            st_ctime_nsec;
+       unsigned long long      st_ino;
+};
+
+#endif
diff --git a/arch/parisc/include/uapi/asm/statfs.h b/arch/parisc/include/uapi/asm/statfs.h
new file mode 100644 (file)
index 0000000..324bea9
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef _PARISC_STATFS_H
+#define _PARISC_STATFS_H
+
+#define __statfs_word long
+#include <asm-generic/statfs.h>
+
+#endif
diff --git a/arch/parisc/include/uapi/asm/swab.h b/arch/parisc/include/uapi/asm/swab.h
new file mode 100644 (file)
index 0000000..e78403b
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef _PARISC_SWAB_H
+#define _PARISC_SWAB_H
+
+#include <linux/types.h>
+#include <linux/compiler.h>
+
+#define __SWAB_64_THRU_32__
+
+static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
+{
+       __asm__("dep %0, 15, 8, %0\n\t"         /* deposit 00ab -> 0bab */
+               "shd %%r0, %0, 8, %0"           /* shift 000000ab -> 00ba */
+               : "=r" (x)
+               : "0" (x));
+       return x;
+}
+#define __arch_swab16 __arch_swab16
+
+static inline __attribute_const__ __u32 __arch_swab24(__u32 x)
+{
+       __asm__("shd %0, %0, 8, %0\n\t"         /* shift xabcxabc -> cxab */
+               "dep %0, 15, 8, %0\n\t"         /* deposit cxab -> cbab */
+               "shd %%r0, %0, 8, %0"           /* shift 0000cbab -> 0cba */
+               : "=r" (x)
+               : "0" (x));
+       return x;
+}
+
+static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
+{
+       unsigned int temp;
+       __asm__("shd %0, %0, 16, %1\n\t"        /* shift abcdabcd -> cdab */
+               "dep %1, 15, 8, %1\n\t"         /* deposit cdab -> cbab */
+               "shd %0, %1, 8, %0"             /* shift abcdcbab -> dcba */
+               : "=r" (x), "=&r" (temp)
+               : "0" (x));
+       return x;
+}
+#define __arch_swab32 __arch_swab32
+
+#if BITS_PER_LONG > 32
+/*
+** From "PA-RISC 2.0 Architecture", HP Professional Books.
+** See Appendix I page 8 , "Endian Byte Swapping".
+**
+** Pretty cool algorithm: (* == zero'd bits)
+**      PERMH   01234567 -> 67452301 into %0
+**      HSHL    67452301 -> 7*5*3*1* into %1
+**      HSHR    67452301 -> *6*4*2*0 into %0
+**      OR      %0 | %1  -> 76543210 into %0 (all done!)
+*/
+static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
+{
+       __u64 temp;
+       __asm__("permh,3210 %0, %0\n\t"
+               "hshl %0, 8, %1\n\t"
+               "hshr,u %0, 8, %0\n\t"
+               "or %1, %0, %0"
+               : "=r" (x), "=&r" (temp)
+               : "0" (x));
+       return x;
+}
+#define __arch_swab64 __arch_swab64
+#endif /* BITS_PER_LONG > 32 */
+
+#endif /* _PARISC_SWAB_H */
diff --git a/arch/parisc/include/uapi/asm/termbits.h b/arch/parisc/include/uapi/asm/termbits.h
new file mode 100644 (file)
index 0000000..d1ab921
--- /dev/null
@@ -0,0 +1,201 @@
+#ifndef __ARCH_PARISC_TERMBITS_H__
+#define __ARCH_PARISC_TERMBITS_H__
+
+#include <linux/posix_types.h>
+
+typedef unsigned char  cc_t;
+typedef unsigned int   speed_t;
+typedef unsigned int   tcflag_t;
+
+#define NCCS 19
+struct termios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+};
+
+struct termios2 {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
+/* c_cc characters */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+
+/* c_iflag bits */
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK  0000020
+#define ISTRIP 0000040
+#define INLCR  0000100
+#define IGNCR  0000200
+#define ICRNL  0000400
+#define IUCLC  0001000
+#define IXON   0002000
+#define IXANY  0004000
+#define IXOFF  0010000
+#define IMAXBEL        0040000
+#define IUTF8  0100000
+
+/* c_oflag bits */
+#define OPOST  0000001
+#define OLCUC  0000002
+#define ONLCR  0000004
+#define OCRNL  0000010
+#define ONOCR  0000020
+#define ONLRET 0000040
+#define OFILL  0000100
+#define OFDEL  0000200
+#define NLDLY  0000400
+#define   NL0  0000000
+#define   NL1  0000400
+#define CRDLY  0003000
+#define   CR0  0000000
+#define   CR1  0001000
+#define   CR2  0002000
+#define   CR3  0003000
+#define TABDLY 0014000
+#define   TAB0 0000000
+#define   TAB1 0004000
+#define   TAB2 0010000
+#define   TAB3 0014000
+#define   XTABS        0014000
+#define BSDLY  0020000
+#define   BS0  0000000
+#define   BS1  0020000
+#define VTDLY  0040000
+#define   VT0  0000000
+#define   VT1  0040000
+#define FFDLY  0100000
+#define   FF0  0000000
+#define   FF1  0100000
+
+/* c_cflag bit meaning */
+#define CBAUD   0010017
+#define  B0     0000000         /* hang up */
+#define  B50    0000001
+#define  B75    0000002
+#define  B110   0000003
+#define  B134   0000004
+#define  B150   0000005
+#define  B200   0000006
+#define  B300   0000007
+#define  B600   0000010
+#define  B1200  0000011
+#define  B1800  0000012
+#define  B2400  0000013
+#define  B4800  0000014
+#define  B9600  0000015
+#define  B19200 0000016
+#define  B38400 0000017
+#define EXTA B19200
+#define EXTB B38400
+#define CSIZE   0000060
+#define   CS5   0000000
+#define   CS6   0000020
+#define   CS7   0000040
+#define   CS8   0000060
+#define CSTOPB  0000100
+#define CREAD   0000200
+#define PARENB  0000400
+#define PARODD  0001000
+#define HUPCL   0002000
+#define CLOCAL  0004000
+#define CBAUDEX 0010000
+#define    BOTHER 0010000
+#define    B57600 0010001
+#define   B115200 0010002
+#define   B230400 0010003
+#define   B460800 0010004
+#define   B500000 0010005
+#define   B576000 0010006
+#define   B921600 0010007
+#define  B1000000 0010010
+#define  B1152000 0010011
+#define  B1500000 0010012
+#define  B2000000 0010013
+#define  B2500000 0010014
+#define  B3000000 0010015
+#define  B3500000 0010016
+#define  B4000000 0010017
+#define CIBAUD    002003600000         /* input baud rate */
+#define CMSPAR    010000000000          /* mark or space (stick) parity */
+#define CRTSCTS   020000000000          /* flow control */
+
+#define IBSHIFT        16              /* Shift from CBAUD to CIBAUD */
+
+
+/* c_lflag bits */
+#define ISIG    0000001
+#define ICANON  0000002
+#define XCASE   0000004
+#define ECHO    0000010
+#define ECHOE   0000020
+#define ECHOK   0000040
+#define ECHONL  0000100
+#define NOFLSH  0000200
+#define TOSTOP  0000400
+#define ECHOCTL 0001000
+#define ECHOPRT 0002000
+#define ECHOKE  0004000
+#define FLUSHO  0010000
+#define PENDIN  0040000
+#define IEXTEN  0100000
+#define EXTPROC        0200000
+
+/* tcflow() and TCXONC use these */
+#define        TCOOFF          0
+#define        TCOON           1
+#define        TCIOFF          2
+#define        TCION           3
+
+/* tcflush() and TCFLSH use these */
+#define        TCIFLUSH        0
+#define        TCOFLUSH        1
+#define        TCIOFLUSH       2
+
+/* tcsetattr uses these */
+#define        TCSANOW         0
+#define        TCSADRAIN       1
+#define        TCSAFLUSH       2
+
+#endif
diff --git a/arch/parisc/include/uapi/asm/termios.h b/arch/parisc/include/uapi/asm/termios.h
new file mode 100644 (file)
index 0000000..f337739
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef _UAPI_PARISC_TERMIOS_H
+#define _UAPI_PARISC_TERMIOS_H
+
+#include <asm/termbits.h>
+#include <asm/ioctls.h>
+
+struct winsize {
+       unsigned short ws_row;
+       unsigned short ws_col;
+       unsigned short ws_xpixel;
+       unsigned short ws_ypixel;
+};
+
+#define NCC 8
+struct termio {
+       unsigned short c_iflag;         /* input mode flags */
+       unsigned short c_oflag;         /* output mode flags */
+       unsigned short c_cflag;         /* control mode flags */
+       unsigned short c_lflag;         /* local mode flags */
+       unsigned char c_line;           /* line discipline */
+       unsigned char c_cc[NCC];        /* control characters */
+};
+
+/* modem lines */
+#define TIOCM_LE       0x001
+#define TIOCM_DTR      0x002
+#define TIOCM_RTS      0x004
+#define TIOCM_ST       0x008
+#define TIOCM_SR       0x010
+#define TIOCM_CTS      0x020
+#define TIOCM_CAR      0x040
+#define TIOCM_RNG      0x080
+#define TIOCM_DSR      0x100
+#define TIOCM_CD       TIOCM_CAR
+#define TIOCM_RI       TIOCM_RNG
+#define TIOCM_OUT1     0x2000
+#define TIOCM_OUT2     0x4000
+#define TIOCM_LOOP     0x8000
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+
+
+#endif /* _UAPI_PARISC_TERMIOS_H */
diff --git a/arch/parisc/include/uapi/asm/types.h b/arch/parisc/include/uapi/asm/types.h
new file mode 100644 (file)
index 0000000..8866f9b
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _PARISC_TYPES_H
+#define _PARISC_TYPES_H
+
+#include <asm-generic/int-ll64.h>
+
+#endif
diff --git a/arch/parisc/include/uapi/asm/unistd.h b/arch/parisc/include/uapi/asm/unistd.h
new file mode 100644 (file)
index 0000000..e178f30
--- /dev/null
@@ -0,0 +1,837 @@
+#ifndef _UAPI_ASM_PARISC_UNISTD_H_
+#define _UAPI_ASM_PARISC_UNISTD_H_
+
+/*
+ * This file contains the system call numbers.
+ */
+
+/*
+ *   HP-UX system calls get their native numbers for binary compatibility.
+ */
+
+#define __NR_HPUX_exit                    1
+#define __NR_HPUX_fork                    2
+#define __NR_HPUX_read                    3
+#define __NR_HPUX_write                   4
+#define __NR_HPUX_open                    5
+#define __NR_HPUX_close                   6
+#define __NR_HPUX_wait                    7
+#define __NR_HPUX_creat                   8
+#define __NR_HPUX_link                    9
+#define __NR_HPUX_unlink                 10
+#define __NR_HPUX_execv                  11
+#define __NR_HPUX_chdir                  12
+#define __NR_HPUX_time                   13
+#define __NR_HPUX_mknod                  14
+#define __NR_HPUX_chmod                  15
+#define __NR_HPUX_chown                  16
+#define __NR_HPUX_break                  17
+#define __NR_HPUX_lchmod                 18
+#define __NR_HPUX_lseek                  19
+#define __NR_HPUX_getpid                 20
+#define __NR_HPUX_mount                  21
+#define __NR_HPUX_umount                 22
+#define __NR_HPUX_setuid                 23
+#define __NR_HPUX_getuid                 24
+#define __NR_HPUX_stime                  25
+#define __NR_HPUX_ptrace                 26
+#define __NR_HPUX_alarm                  27
+#define __NR_HPUX_oldfstat               28
+#define __NR_HPUX_pause                  29
+#define __NR_HPUX_utime                  30
+#define __NR_HPUX_stty                   31
+#define __NR_HPUX_gtty                   32
+#define __NR_HPUX_access                 33
+#define __NR_HPUX_nice                   34
+#define __NR_HPUX_ftime                  35
+#define __NR_HPUX_sync                   36
+#define __NR_HPUX_kill                   37
+#define __NR_HPUX_stat                   38
+#define __NR_HPUX_setpgrp3               39
+#define __NR_HPUX_lstat                  40
+#define __NR_HPUX_dup                    41
+#define __NR_HPUX_pipe                   42
+#define __NR_HPUX_times                  43
+#define __NR_HPUX_profil                 44
+#define __NR_HPUX_ki_call                45
+#define __NR_HPUX_setgid                 46
+#define __NR_HPUX_getgid                 47
+#define __NR_HPUX_sigsys                 48
+#define __NR_HPUX_reserved1              49
+#define __NR_HPUX_reserved2              50
+#define __NR_HPUX_acct                   51
+#define __NR_HPUX_set_userthreadid       52
+#define __NR_HPUX_oldlock                53
+#define __NR_HPUX_ioctl                  54
+#define __NR_HPUX_reboot                 55
+#define __NR_HPUX_symlink                56
+#define __NR_HPUX_utssys                 57
+#define __NR_HPUX_readlink               58
+#define __NR_HPUX_execve                 59
+#define __NR_HPUX_umask                  60
+#define __NR_HPUX_chroot                 61
+#define __NR_HPUX_fcntl                  62
+#define __NR_HPUX_ulimit                 63
+#define __NR_HPUX_getpagesize            64
+#define __NR_HPUX_mremap                 65
+#define __NR_HPUX_vfork                  66
+#define __NR_HPUX_vread                  67
+#define __NR_HPUX_vwrite                 68
+#define __NR_HPUX_sbrk                   69
+#define __NR_HPUX_sstk                   70
+#define __NR_HPUX_mmap                   71
+#define __NR_HPUX_vadvise                72
+#define __NR_HPUX_munmap                 73
+#define __NR_HPUX_mprotect               74
+#define __NR_HPUX_madvise                75
+#define __NR_HPUX_vhangup                76
+#define __NR_HPUX_swapoff                77
+#define __NR_HPUX_mincore                78
+#define __NR_HPUX_getgroups              79
+#define __NR_HPUX_setgroups              80
+#define __NR_HPUX_getpgrp2               81
+#define __NR_HPUX_setpgrp2               82
+#define __NR_HPUX_setitimer              83
+#define __NR_HPUX_wait3                  84
+#define __NR_HPUX_swapon                 85
+#define __NR_HPUX_getitimer              86
+#define __NR_HPUX_gethostname42          87
+#define __NR_HPUX_sethostname42          88
+#define __NR_HPUX_getdtablesize          89
+#define __NR_HPUX_dup2                   90
+#define __NR_HPUX_getdopt                91
+#define __NR_HPUX_fstat                  92
+#define __NR_HPUX_select                 93
+#define __NR_HPUX_setdopt                94
+#define __NR_HPUX_fsync                  95
+#define __NR_HPUX_setpriority            96
+#define __NR_HPUX_socket_old             97
+#define __NR_HPUX_connect_old            98
+#define __NR_HPUX_accept_old             99
+#define __NR_HPUX_getpriority           100
+#define __NR_HPUX_send_old              101
+#define __NR_HPUX_recv_old              102
+#define __NR_HPUX_socketaddr_old        103
+#define __NR_HPUX_bind_old              104
+#define __NR_HPUX_setsockopt_old        105
+#define __NR_HPUX_listen_old            106
+#define __NR_HPUX_vtimes_old            107
+#define __NR_HPUX_sigvector             108
+#define __NR_HPUX_sigblock              109
+#define __NR_HPUX_siggetmask            110
+#define __NR_HPUX_sigpause              111
+#define __NR_HPUX_sigstack              112
+#define __NR_HPUX_recvmsg_old           113
+#define __NR_HPUX_sendmsg_old           114
+#define __NR_HPUX_vtrace_old            115
+#define __NR_HPUX_gettimeofday          116
+#define __NR_HPUX_getrusage             117
+#define __NR_HPUX_getsockopt_old        118
+#define __NR_HPUX_resuba_old            119
+#define __NR_HPUX_readv                 120
+#define __NR_HPUX_writev                121
+#define __NR_HPUX_settimeofday          122
+#define __NR_HPUX_fchown                123
+#define __NR_HPUX_fchmod                124
+#define __NR_HPUX_recvfrom_old          125
+#define __NR_HPUX_setresuid             126
+#define __NR_HPUX_setresgid             127
+#define __NR_HPUX_rename                128
+#define __NR_HPUX_truncate              129
+#define __NR_HPUX_ftruncate             130
+#define __NR_HPUX_flock_old             131
+#define __NR_HPUX_sysconf               132
+#define __NR_HPUX_sendto_old            133
+#define __NR_HPUX_shutdown_old          134
+#define __NR_HPUX_socketpair_old        135
+#define __NR_HPUX_mkdir                 136
+#define __NR_HPUX_rmdir                 137
+#define __NR_HPUX_utimes_old            138
+#define __NR_HPUX_sigcleanup_old        139
+#define __NR_HPUX_setcore               140
+#define __NR_HPUX_getpeername_old       141
+#define __NR_HPUX_gethostid             142
+#define __NR_HPUX_sethostid             143
+#define __NR_HPUX_getrlimit             144
+#define __NR_HPUX_setrlimit             145
+#define __NR_HPUX_killpg_old            146
+#define __NR_HPUX_cachectl              147
+#define __NR_HPUX_quotactl              148
+#define __NR_HPUX_get_sysinfo           149
+#define __NR_HPUX_getsockname_old       150
+#define __NR_HPUX_privgrp               151
+#define __NR_HPUX_rtprio                152
+#define __NR_HPUX_plock                 153
+#define __NR_HPUX_reserved3             154
+#define __NR_HPUX_lockf                 155
+#define __NR_HPUX_semget                156
+#define __NR_HPUX_osemctl               157
+#define __NR_HPUX_semop                 158
+#define __NR_HPUX_msgget                159
+#define __NR_HPUX_omsgctl               160
+#define __NR_HPUX_msgsnd                161
+#define __NR_HPUX_msgrecv               162
+#define __NR_HPUX_shmget                163
+#define __NR_HPUX_oshmctl               164
+#define __NR_HPUX_shmat                 165
+#define __NR_HPUX_shmdt                 166
+#define __NR_HPUX_m68020_advise         167
+/* [168,189] are for Discless/DUX */
+#define __NR_HPUX_csp                   168
+#define __NR_HPUX_cluster               169
+#define __NR_HPUX_mkrnod                170
+#define __NR_HPUX_test                  171
+#define __NR_HPUX_unsp_open             172
+#define __NR_HPUX_reserved4             173
+#define __NR_HPUX_getcontext_old        174
+#define __NR_HPUX_osetcontext           175
+#define __NR_HPUX_bigio                 176
+#define __NR_HPUX_pipenode              177
+#define __NR_HPUX_lsync                 178
+#define __NR_HPUX_getmachineid          179
+#define __NR_HPUX_cnodeid               180
+#define __NR_HPUX_cnodes                181
+#define __NR_HPUX_swapclients           182
+#define __NR_HPUX_rmt_process           183
+#define __NR_HPUX_dskless_stats         184
+#define __NR_HPUX_sigprocmask           185
+#define __NR_HPUX_sigpending            186
+#define __NR_HPUX_sigsuspend            187
+#define __NR_HPUX_sigaction             188
+#define __NR_HPUX_reserved5             189
+#define __NR_HPUX_nfssvc                190
+#define __NR_HPUX_getfh                 191
+#define __NR_HPUX_getdomainname         192
+#define __NR_HPUX_setdomainname         193
+#define __NR_HPUX_async_daemon          194
+#define __NR_HPUX_getdirentries         195
+#define __NR_HPUX_statfs                196
+#define __NR_HPUX_fstatfs               197
+#define __NR_HPUX_vfsmount              198
+#define __NR_HPUX_reserved6             199
+#define __NR_HPUX_waitpid               200
+/* 201 - 223 missing */
+#define __NR_HPUX_sigsetreturn          224
+#define __NR_HPUX_sigsetstatemask       225
+/* 226 missing */
+#define __NR_HPUX_cs                    227
+#define __NR_HPUX_cds                   228
+#define __NR_HPUX_set_no_trunc          229
+#define __NR_HPUX_pathconf              230
+#define __NR_HPUX_fpathconf             231
+/* 232, 233 missing */
+#define __NR_HPUX_nfs_fcntl             234
+#define __NR_HPUX_ogetacl               235
+#define __NR_HPUX_ofgetacl              236
+#define __NR_HPUX_osetacl               237
+#define __NR_HPUX_ofsetacl              238
+#define __NR_HPUX_pstat                 239
+#define __NR_HPUX_getaudid              240
+#define __NR_HPUX_setaudid              241
+#define __NR_HPUX_getaudproc            242
+#define __NR_HPUX_setaudproc            243
+#define __NR_HPUX_getevent              244
+#define __NR_HPUX_setevent              245
+#define __NR_HPUX_audwrite              246
+#define __NR_HPUX_audswitch             247
+#define __NR_HPUX_audctl                248
+#define __NR_HPUX_ogetaccess            249
+#define __NR_HPUX_fsctl                 250
+/* 251 - 258 missing */
+#define __NR_HPUX_swapfs                259
+#define __NR_HPUX_fss                   260
+/* 261 - 266 missing */
+#define __NR_HPUX_tsync                 267
+#define __NR_HPUX_getnumfds             268
+#define __NR_HPUX_poll                  269
+#define __NR_HPUX_getmsg                270
+#define __NR_HPUX_putmsg                271
+#define __NR_HPUX_fchdir                272
+#define __NR_HPUX_getmount_cnt          273
+#define __NR_HPUX_getmount_entry        274
+#define __NR_HPUX_accept                275
+#define __NR_HPUX_bind                  276
+#define __NR_HPUX_connect               277
+#define __NR_HPUX_getpeername           278
+#define __NR_HPUX_getsockname           279
+#define __NR_HPUX_getsockopt            280
+#define __NR_HPUX_listen                281
+#define __NR_HPUX_recv                  282
+#define __NR_HPUX_recvfrom              283
+#define __NR_HPUX_recvmsg               284
+#define __NR_HPUX_send                  285
+#define __NR_HPUX_sendmsg               286
+#define __NR_HPUX_sendto                287
+#define __NR_HPUX_setsockopt            288
+#define __NR_HPUX_shutdown              289
+#define __NR_HPUX_socket                290
+#define __NR_HPUX_socketpair            291
+#define __NR_HPUX_proc_open             292
+#define __NR_HPUX_proc_close            293
+#define __NR_HPUX_proc_send             294
+#define __NR_HPUX_proc_recv             295
+#define __NR_HPUX_proc_sendrecv         296
+#define __NR_HPUX_proc_syscall          297
+/* 298 - 311 missing */
+#define __NR_HPUX_semctl                312
+#define __NR_HPUX_msgctl                313
+#define __NR_HPUX_shmctl                314
+#define __NR_HPUX_mpctl                 315
+#define __NR_HPUX_exportfs              316
+#define __NR_HPUX_getpmsg               317
+#define __NR_HPUX_putpmsg               318
+/* 319 missing */
+#define __NR_HPUX_msync                 320
+#define __NR_HPUX_msleep                321
+#define __NR_HPUX_mwakeup               322
+#define __NR_HPUX_msem_init             323
+#define __NR_HPUX_msem_remove           324
+#define __NR_HPUX_adjtime               325
+#define __NR_HPUX_kload                 326
+#define __NR_HPUX_fattach               327
+#define __NR_HPUX_fdetach               328
+#define __NR_HPUX_serialize             329
+#define __NR_HPUX_statvfs               330
+#define __NR_HPUX_fstatvfs              331
+#define __NR_HPUX_lchown                332
+#define __NR_HPUX_getsid                333
+#define __NR_HPUX_sysfs                 334
+/* 335, 336 missing */
+#define __NR_HPUX_sched_setparam        337
+#define __NR_HPUX_sched_getparam        338
+#define __NR_HPUX_sched_setscheduler    339
+#define __NR_HPUX_sched_getscheduler    340
+#define __NR_HPUX_sched_yield           341
+#define __NR_HPUX_sched_get_priority_max 342
+#define __NR_HPUX_sched_get_priority_min 343
+#define __NR_HPUX_sched_rr_get_interval 344
+#define __NR_HPUX_clock_settime         345
+#define __NR_HPUX_clock_gettime         346
+#define __NR_HPUX_clock_getres          347
+#define __NR_HPUX_timer_create          348
+#define __NR_HPUX_timer_delete          349
+#define __NR_HPUX_timer_settime         350
+#define __NR_HPUX_timer_gettime         351
+#define __NR_HPUX_timer_getoverrun      352
+#define __NR_HPUX_nanosleep             353
+#define __NR_HPUX_toolbox               354
+/* 355 missing */
+#define __NR_HPUX_getdents              356
+#define __NR_HPUX_getcontext            357
+#define __NR_HPUX_sysinfo               358
+#define __NR_HPUX_fcntl64               359
+#define __NR_HPUX_ftruncate64           360
+#define __NR_HPUX_fstat64               361
+#define __NR_HPUX_getdirentries64       362
+#define __NR_HPUX_getrlimit64           363
+#define __NR_HPUX_lockf64               364
+#define __NR_HPUX_lseek64               365
+#define __NR_HPUX_lstat64               366
+#define __NR_HPUX_mmap64                367
+#define __NR_HPUX_setrlimit64           368
+#define __NR_HPUX_stat64                369
+#define __NR_HPUX_truncate64            370
+#define __NR_HPUX_ulimit64              371
+#define __NR_HPUX_pread                 372
+#define __NR_HPUX_preadv                373
+#define __NR_HPUX_pwrite                374
+#define __NR_HPUX_pwritev               375
+#define __NR_HPUX_pread64               376
+#define __NR_HPUX_preadv64              377
+#define __NR_HPUX_pwrite64              378
+#define __NR_HPUX_pwritev64             379
+#define __NR_HPUX_setcontext            380
+#define __NR_HPUX_sigaltstack           381
+#define __NR_HPUX_waitid                382
+#define __NR_HPUX_setpgrp               383
+#define __NR_HPUX_recvmsg2              384
+#define __NR_HPUX_sendmsg2              385
+#define __NR_HPUX_socket2               386
+#define __NR_HPUX_socketpair2           387
+#define __NR_HPUX_setregid              388
+#define __NR_HPUX_lwp_create            389
+#define __NR_HPUX_lwp_terminate         390
+#define __NR_HPUX_lwp_wait              391
+#define __NR_HPUX_lwp_suspend           392
+#define __NR_HPUX_lwp_resume            393
+/* 394 missing */
+#define __NR_HPUX_lwp_abort_syscall     395
+#define __NR_HPUX_lwp_info              396
+#define __NR_HPUX_lwp_kill              397
+#define __NR_HPUX_ksleep                398
+#define __NR_HPUX_kwakeup               399
+/* 400 missing */
+#define __NR_HPUX_pstat_getlwp          401
+#define __NR_HPUX_lwp_exit              402
+#define __NR_HPUX_lwp_continue          403
+#define __NR_HPUX_getacl                404
+#define __NR_HPUX_fgetacl               405
+#define __NR_HPUX_setacl                406
+#define __NR_HPUX_fsetacl               407
+#define __NR_HPUX_getaccess             408
+#define __NR_HPUX_lwp_mutex_init        409
+#define __NR_HPUX_lwp_mutex_lock_sys    410
+#define __NR_HPUX_lwp_mutex_unlock      411
+#define __NR_HPUX_lwp_cond_init         412
+#define __NR_HPUX_lwp_cond_signal       413
+#define __NR_HPUX_lwp_cond_broadcast    414
+#define __NR_HPUX_lwp_cond_wait_sys     415
+#define __NR_HPUX_lwp_getscheduler      416
+#define __NR_HPUX_lwp_setscheduler      417
+#define __NR_HPUX_lwp_getstate          418
+#define __NR_HPUX_lwp_setstate          419
+#define __NR_HPUX_lwp_detach            420
+#define __NR_HPUX_mlock                 421
+#define __NR_HPUX_munlock               422
+#define __NR_HPUX_mlockall              423
+#define __NR_HPUX_munlockall            424
+#define __NR_HPUX_shm_open              425
+#define __NR_HPUX_shm_unlink            426
+#define __NR_HPUX_sigqueue              427
+#define __NR_HPUX_sigwaitinfo           428
+#define __NR_HPUX_sigtimedwait          429
+#define __NR_HPUX_sigwait               430
+#define __NR_HPUX_aio_read              431
+#define __NR_HPUX_aio_write             432
+#define __NR_HPUX_lio_listio            433
+#define __NR_HPUX_aio_error             434
+#define __NR_HPUX_aio_return            435
+#define __NR_HPUX_aio_cancel            436
+#define __NR_HPUX_aio_suspend           437
+#define __NR_HPUX_aio_fsync             438
+#define __NR_HPUX_mq_open               439
+#define __NR_HPUX_mq_close              440
+#define __NR_HPUX_mq_unlink             441
+#define __NR_HPUX_mq_send               442
+#define __NR_HPUX_mq_receive            443
+#define __NR_HPUX_mq_notify             444
+#define __NR_HPUX_mq_setattr            445
+#define __NR_HPUX_mq_getattr            446
+#define __NR_HPUX_ksem_open             447
+#define __NR_HPUX_ksem_unlink           448
+#define __NR_HPUX_ksem_close            449
+#define __NR_HPUX_ksem_post             450
+#define __NR_HPUX_ksem_wait             451
+#define __NR_HPUX_ksem_read             452
+#define __NR_HPUX_ksem_trywait          453
+#define __NR_HPUX_lwp_rwlock_init       454
+#define __NR_HPUX_lwp_rwlock_destroy    455
+#define __NR_HPUX_lwp_rwlock_rdlock_sys 456
+#define __NR_HPUX_lwp_rwlock_wrlock_sys 457
+#define __NR_HPUX_lwp_rwlock_tryrdlock  458
+#define __NR_HPUX_lwp_rwlock_trywrlock  459
+#define __NR_HPUX_lwp_rwlock_unlock     460
+#define __NR_HPUX_ttrace                461
+#define __NR_HPUX_ttrace_wait           462
+#define __NR_HPUX_lf_wire_mem           463
+#define __NR_HPUX_lf_unwire_mem         464
+#define __NR_HPUX_lf_send_pin_map       465
+#define __NR_HPUX_lf_free_buf           466
+#define __NR_HPUX_lf_wait_nq            467
+#define __NR_HPUX_lf_wakeup_conn_q      468
+#define __NR_HPUX_lf_unused             469
+#define __NR_HPUX_lwp_sema_init         470
+#define __NR_HPUX_lwp_sema_post         471
+#define __NR_HPUX_lwp_sema_wait         472
+#define __NR_HPUX_lwp_sema_trywait      473
+#define __NR_HPUX_lwp_sema_destroy      474
+#define __NR_HPUX_statvfs64             475
+#define __NR_HPUX_fstatvfs64            476
+#define __NR_HPUX_msh_register          477
+#define __NR_HPUX_ptrace64              478
+#define __NR_HPUX_sendfile              479
+#define __NR_HPUX_sendpath              480
+#define __NR_HPUX_sendfile64            481
+#define __NR_HPUX_sendpath64            482
+#define __NR_HPUX_modload               483
+#define __NR_HPUX_moduload              484
+#define __NR_HPUX_modpath               485
+#define __NR_HPUX_getksym               486
+#define __NR_HPUX_modadm                487
+#define __NR_HPUX_modstat               488
+#define __NR_HPUX_lwp_detached_exit     489
+#define __NR_HPUX_crashconf             490
+#define __NR_HPUX_siginhibit            491
+#define __NR_HPUX_sigenable             492
+#define __NR_HPUX_spuctl                493
+#define __NR_HPUX_zerokernelsum         494
+#define __NR_HPUX_nfs_kstat             495
+#define __NR_HPUX_aio_read64            496
+#define __NR_HPUX_aio_write64           497
+#define __NR_HPUX_aio_error64           498
+#define __NR_HPUX_aio_return64          499
+#define __NR_HPUX_aio_cancel64          500
+#define __NR_HPUX_aio_suspend64         501
+#define __NR_HPUX_aio_fsync64           502
+#define __NR_HPUX_lio_listio64          503
+#define __NR_HPUX_recv2                 504
+#define __NR_HPUX_recvfrom2             505
+#define __NR_HPUX_send2                 506
+#define __NR_HPUX_sendto2               507
+#define __NR_HPUX_acl                   508
+#define __NR_HPUX___cnx_p2p_ctl         509
+#define __NR_HPUX___cnx_gsched_ctl      510
+#define __NR_HPUX___cnx_pmon_ctl        511
+
+#define __NR_HPUX_syscalls             512
+
+/*
+ * Linux system call numbers.
+ *
+ * Cary Coutant says that we should just use another syscall gateway
+ * page to avoid clashing with the HPUX space, and I think he's right:
+ * it will would keep a branch out of our syscall entry path, at the
+ * very least.  If we decide to change it later, we can ``just'' tweak
+ * the LINUX_GATEWAY_ADDR define at the bottom and make __NR_Linux be
+ * 1024 or something.  Oh, and recompile libc. =)
+ *
+ * 64-bit HPUX binaries get the syscall gateway address passed in a register
+ * from the kernel at startup, which seems a sane strategy.
+ */
+
+#define __NR_Linux                0
+#define __NR_restart_syscall      (__NR_Linux + 0)
+#define __NR_exit                 (__NR_Linux + 1)
+#define __NR_fork                 (__NR_Linux + 2)
+#define __NR_read                 (__NR_Linux + 3)
+#define __NR_write                (__NR_Linux + 4)
+#define __NR_open                 (__NR_Linux + 5)
+#define __NR_close                (__NR_Linux + 6)
+#define __NR_waitpid              (__NR_Linux + 7)
+#define __NR_creat                (__NR_Linux + 8)
+#define __NR_link                 (__NR_Linux + 9)
+#define __NR_unlink              (__NR_Linux + 10)
+#define __NR_execve              (__NR_Linux + 11)
+#define __NR_chdir               (__NR_Linux + 12)
+#define __NR_time                (__NR_Linux + 13)
+#define __NR_mknod               (__NR_Linux + 14)
+#define __NR_chmod               (__NR_Linux + 15)
+#define __NR_lchown              (__NR_Linux + 16)
+#define __NR_socket              (__NR_Linux + 17)
+#define __NR_stat                (__NR_Linux + 18)
+#define __NR_lseek               (__NR_Linux + 19)
+#define __NR_getpid              (__NR_Linux + 20)
+#define __NR_mount               (__NR_Linux + 21)
+#define __NR_bind                (__NR_Linux + 22)
+#define __NR_setuid              (__NR_Linux + 23)
+#define __NR_getuid              (__NR_Linux + 24)
+#define __NR_stime               (__NR_Linux + 25)
+#define __NR_ptrace              (__NR_Linux + 26)
+#define __NR_alarm               (__NR_Linux + 27)
+#define __NR_fstat               (__NR_Linux + 28)
+#define __NR_pause               (__NR_Linux + 29)
+#define __NR_utime               (__NR_Linux + 30)
+#define __NR_connect             (__NR_Linux + 31)
+#define __NR_listen              (__NR_Linux + 32)
+#define __NR_access              (__NR_Linux + 33)
+#define __NR_nice                (__NR_Linux + 34)
+#define __NR_accept              (__NR_Linux + 35)
+#define __NR_sync                (__NR_Linux + 36)
+#define __NR_kill                (__NR_Linux + 37)
+#define __NR_rename              (__NR_Linux + 38)
+#define __NR_mkdir               (__NR_Linux + 39)
+#define __NR_rmdir               (__NR_Linux + 40)
+#define __NR_dup                 (__NR_Linux + 41)
+#define __NR_pipe                (__NR_Linux + 42)
+#define __NR_times               (__NR_Linux + 43)
+#define __NR_getsockname         (__NR_Linux + 44)
+#define __NR_brk                 (__NR_Linux + 45)
+#define __NR_setgid              (__NR_Linux + 46)
+#define __NR_getgid              (__NR_Linux + 47)
+#define __NR_signal              (__NR_Linux + 48)
+#define __NR_geteuid             (__NR_Linux + 49)
+#define __NR_getegid             (__NR_Linux + 50)
+#define __NR_acct                (__NR_Linux + 51)
+#define __NR_umount2             (__NR_Linux + 52)
+#define __NR_getpeername         (__NR_Linux + 53)
+#define __NR_ioctl               (__NR_Linux + 54)
+#define __NR_fcntl               (__NR_Linux + 55)
+#define __NR_socketpair          (__NR_Linux + 56)
+#define __NR_setpgid             (__NR_Linux + 57)
+#define __NR_send                (__NR_Linux + 58)
+#define __NR_uname               (__NR_Linux + 59)
+#define __NR_umask               (__NR_Linux + 60)
+#define __NR_chroot              (__NR_Linux + 61)
+#define __NR_ustat               (__NR_Linux + 62)
+#define __NR_dup2                (__NR_Linux + 63)
+#define __NR_getppid             (__NR_Linux + 64)
+#define __NR_getpgrp             (__NR_Linux + 65)
+#define __NR_setsid              (__NR_Linux + 66)
+#define __NR_pivot_root          (__NR_Linux + 67)
+#define __NR_sgetmask            (__NR_Linux + 68)
+#define __NR_ssetmask            (__NR_Linux + 69)
+#define __NR_setreuid            (__NR_Linux + 70)
+#define __NR_setregid            (__NR_Linux + 71)
+#define __NR_mincore             (__NR_Linux + 72)
+#define __NR_sigpending          (__NR_Linux + 73)
+#define __NR_sethostname         (__NR_Linux + 74)
+#define __NR_setrlimit           (__NR_Linux + 75)
+#define __NR_getrlimit           (__NR_Linux + 76)
+#define __NR_getrusage           (__NR_Linux + 77)
+#define __NR_gettimeofday        (__NR_Linux + 78)
+#define __NR_settimeofday        (__NR_Linux + 79)
+#define __NR_getgroups           (__NR_Linux + 80)
+#define __NR_setgroups           (__NR_Linux + 81)
+#define __NR_sendto              (__NR_Linux + 82)
+#define __NR_symlink             (__NR_Linux + 83)
+#define __NR_lstat               (__NR_Linux + 84)
+#define __NR_readlink            (__NR_Linux + 85)
+#define __NR_uselib              (__NR_Linux + 86)
+#define __NR_swapon              (__NR_Linux + 87)
+#define __NR_reboot              (__NR_Linux + 88)
+#define __NR_mmap2             (__NR_Linux + 89)
+#define __NR_mmap                (__NR_Linux + 90)
+#define __NR_munmap              (__NR_Linux + 91)
+#define __NR_truncate            (__NR_Linux + 92)
+#define __NR_ftruncate           (__NR_Linux + 93)
+#define __NR_fchmod              (__NR_Linux + 94)
+#define __NR_fchown              (__NR_Linux + 95)
+#define __NR_getpriority         (__NR_Linux + 96)
+#define __NR_setpriority         (__NR_Linux + 97)
+#define __NR_recv                (__NR_Linux + 98)
+#define __NR_statfs              (__NR_Linux + 99)
+#define __NR_fstatfs            (__NR_Linux + 100)
+#define __NR_stat64           (__NR_Linux + 101)
+/* #define __NR_socketcall         (__NR_Linux + 102) */
+#define __NR_syslog             (__NR_Linux + 103)
+#define __NR_setitimer          (__NR_Linux + 104)
+#define __NR_getitimer          (__NR_Linux + 105)
+#define __NR_capget             (__NR_Linux + 106)
+#define __NR_capset             (__NR_Linux + 107)
+#define __NR_pread64            (__NR_Linux + 108)
+#define __NR_pwrite64           (__NR_Linux + 109)
+#define __NR_getcwd             (__NR_Linux + 110)
+#define __NR_vhangup            (__NR_Linux + 111)
+#define __NR_fstat64            (__NR_Linux + 112)
+#define __NR_vfork              (__NR_Linux + 113)
+#define __NR_wait4              (__NR_Linux + 114)
+#define __NR_swapoff            (__NR_Linux + 115)
+#define __NR_sysinfo            (__NR_Linux + 116)
+#define __NR_shutdown           (__NR_Linux + 117)
+#define __NR_fsync              (__NR_Linux + 118)
+#define __NR_madvise            (__NR_Linux + 119)
+#define __NR_clone              (__NR_Linux + 120)
+#define __NR_setdomainname      (__NR_Linux + 121)
+#define __NR_sendfile           (__NR_Linux + 122)
+#define __NR_recvfrom           (__NR_Linux + 123)
+#define __NR_adjtimex           (__NR_Linux + 124)
+#define __NR_mprotect           (__NR_Linux + 125)
+#define __NR_sigprocmask        (__NR_Linux + 126)
+#define __NR_create_module      (__NR_Linux + 127)
+#define __NR_init_module        (__NR_Linux + 128)
+#define __NR_delete_module      (__NR_Linux + 129)
+#define __NR_get_kernel_syms    (__NR_Linux + 130)
+#define __NR_quotactl           (__NR_Linux + 131)
+#define __NR_getpgid            (__NR_Linux + 132)
+#define __NR_fchdir             (__NR_Linux + 133)
+#define __NR_bdflush            (__NR_Linux + 134)
+#define __NR_sysfs              (__NR_Linux + 135)
+#define __NR_personality        (__NR_Linux + 136)
+#define __NR_afs_syscall        (__NR_Linux + 137) /* Syscall for Andrew File System */
+#define __NR_setfsuid           (__NR_Linux + 138)
+#define __NR_setfsgid           (__NR_Linux + 139)
+#define __NR__llseek            (__NR_Linux + 140)
+#define __NR_getdents           (__NR_Linux + 141)
+#define __NR__newselect         (__NR_Linux + 142)
+#define __NR_flock              (__NR_Linux + 143)
+#define __NR_msync              (__NR_Linux + 144)
+#define __NR_readv              (__NR_Linux + 145)
+#define __NR_writev             (__NR_Linux + 146)
+#define __NR_getsid             (__NR_Linux + 147)
+#define __NR_fdatasync          (__NR_Linux + 148)
+#define __NR__sysctl            (__NR_Linux + 149)
+#define __NR_mlock              (__NR_Linux + 150)
+#define __NR_munlock            (__NR_Linux + 151)
+#define __NR_mlockall           (__NR_Linux + 152)
+#define __NR_munlockall         (__NR_Linux + 153)
+#define __NR_sched_setparam             (__NR_Linux + 154)
+#define __NR_sched_getparam             (__NR_Linux + 155)
+#define __NR_sched_setscheduler         (__NR_Linux + 156)
+#define __NR_sched_getscheduler         (__NR_Linux + 157)
+#define __NR_sched_yield                (__NR_Linux + 158)
+#define __NR_sched_get_priority_max     (__NR_Linux + 159)
+#define __NR_sched_get_priority_min     (__NR_Linux + 160)
+#define __NR_sched_rr_get_interval      (__NR_Linux + 161)
+#define __NR_nanosleep          (__NR_Linux + 162)
+#define __NR_mremap             (__NR_Linux + 163)
+#define __NR_setresuid          (__NR_Linux + 164)
+#define __NR_getresuid          (__NR_Linux + 165)
+#define __NR_sigaltstack        (__NR_Linux + 166)
+#define __NR_query_module       (__NR_Linux + 167)
+#define __NR_poll               (__NR_Linux + 168)
+#define __NR_nfsservctl         (__NR_Linux + 169)
+#define __NR_setresgid          (__NR_Linux + 170)
+#define __NR_getresgid          (__NR_Linux + 171)
+#define __NR_prctl              (__NR_Linux + 172)
+#define __NR_rt_sigreturn       (__NR_Linux + 173)
+#define __NR_rt_sigaction       (__NR_Linux + 174)
+#define __NR_rt_sigprocmask     (__NR_Linux + 175)
+#define __NR_rt_sigpending      (__NR_Linux + 176)
+#define __NR_rt_sigtimedwait    (__NR_Linux + 177)
+#define __NR_rt_sigqueueinfo    (__NR_Linux + 178)
+#define __NR_rt_sigsuspend      (__NR_Linux + 179)
+#define __NR_chown              (__NR_Linux + 180)
+#define __NR_setsockopt         (__NR_Linux + 181)
+#define __NR_getsockopt         (__NR_Linux + 182)
+#define __NR_sendmsg            (__NR_Linux + 183)
+#define __NR_recvmsg            (__NR_Linux + 184)
+#define __NR_semop              (__NR_Linux + 185)
+#define __NR_semget             (__NR_Linux + 186)
+#define __NR_semctl             (__NR_Linux + 187)
+#define __NR_msgsnd             (__NR_Linux + 188)
+#define __NR_msgrcv             (__NR_Linux + 189)
+#define __NR_msgget             (__NR_Linux + 190)
+#define __NR_msgctl             (__NR_Linux + 191)
+#define __NR_shmat              (__NR_Linux + 192)
+#define __NR_shmdt              (__NR_Linux + 193)
+#define __NR_shmget             (__NR_Linux + 194)
+#define __NR_shmctl             (__NR_Linux + 195)
+
+#define __NR_getpmsg           (__NR_Linux + 196) /* Somebody *wants* streams? */
+#define __NR_putpmsg           (__NR_Linux + 197)
+
+#define __NR_lstat64            (__NR_Linux + 198)
+#define __NR_truncate64         (__NR_Linux + 199)
+#define __NR_ftruncate64        (__NR_Linux + 200)
+#define __NR_getdents64         (__NR_Linux + 201)
+#define __NR_fcntl64            (__NR_Linux + 202)
+#define __NR_attrctl            (__NR_Linux + 203)
+#define __NR_acl_get            (__NR_Linux + 204)
+#define __NR_acl_set            (__NR_Linux + 205)
+#define __NR_gettid             (__NR_Linux + 206)
+#define __NR_readahead          (__NR_Linux + 207)
+#define __NR_tkill              (__NR_Linux + 208)
+#define __NR_sendfile64         (__NR_Linux + 209)
+#define __NR_futex              (__NR_Linux + 210)
+#define __NR_sched_setaffinity  (__NR_Linux + 211)
+#define __NR_sched_getaffinity  (__NR_Linux + 212)
+#define __NR_set_thread_area    (__NR_Linux + 213)
+#define __NR_get_thread_area    (__NR_Linux + 214)
+#define __NR_io_setup           (__NR_Linux + 215)
+#define __NR_io_destroy         (__NR_Linux + 216)
+#define __NR_io_getevents       (__NR_Linux + 217)
+#define __NR_io_submit          (__NR_Linux + 218)
+#define __NR_io_cancel          (__NR_Linux + 219)
+#define __NR_alloc_hugepages    (__NR_Linux + 220)
+#define __NR_free_hugepages     (__NR_Linux + 221)
+#define __NR_exit_group         (__NR_Linux + 222)
+#define __NR_lookup_dcookie     (__NR_Linux + 223)
+#define __NR_epoll_create       (__NR_Linux + 224)
+#define __NR_epoll_ctl          (__NR_Linux + 225)
+#define __NR_epoll_wait         (__NR_Linux + 226)
+#define __NR_remap_file_pages   (__NR_Linux + 227)
+#define __NR_semtimedop         (__NR_Linux + 228)
+#define __NR_mq_open            (__NR_Linux + 229)
+#define __NR_mq_unlink          (__NR_Linux + 230)
+#define __NR_mq_timedsend       (__NR_Linux + 231)
+#define __NR_mq_timedreceive    (__NR_Linux + 232)
+#define __NR_mq_notify          (__NR_Linux + 233)
+#define __NR_mq_getsetattr      (__NR_Linux + 234)
+#define __NR_waitid            (__NR_Linux + 235)
+#define __NR_fadvise64_64      (__NR_Linux + 236)
+#define __NR_set_tid_address   (__NR_Linux + 237)
+#define __NR_setxattr          (__NR_Linux + 238)
+#define __NR_lsetxattr         (__NR_Linux + 239)
+#define __NR_fsetxattr         (__NR_Linux + 240)
+#define __NR_getxattr          (__NR_Linux + 241)
+#define __NR_lgetxattr         (__NR_Linux + 242)
+#define __NR_fgetxattr         (__NR_Linux + 243)
+#define __NR_listxattr         (__NR_Linux + 244)
+#define __NR_llistxattr                (__NR_Linux + 245)
+#define __NR_flistxattr                (__NR_Linux + 246)
+#define __NR_removexattr       (__NR_Linux + 247)
+#define __NR_lremovexattr      (__NR_Linux + 248)
+#define __NR_fremovexattr      (__NR_Linux + 249)
+#define __NR_timer_create      (__NR_Linux + 250)
+#define __NR_timer_settime     (__NR_Linux + 251)
+#define __NR_timer_gettime     (__NR_Linux + 252)
+#define __NR_timer_getoverrun  (__NR_Linux + 253)
+#define __NR_timer_delete      (__NR_Linux + 254)
+#define __NR_clock_settime     (__NR_Linux + 255)
+#define __NR_clock_gettime     (__NR_Linux + 256)
+#define __NR_clock_getres      (__NR_Linux + 257)
+#define __NR_clock_nanosleep   (__NR_Linux + 258)
+#define __NR_tgkill            (__NR_Linux + 259)
+#define __NR_mbind             (__NR_Linux + 260)
+#define __NR_get_mempolicy     (__NR_Linux + 261)
+#define __NR_set_mempolicy     (__NR_Linux + 262)
+#define __NR_vserver           (__NR_Linux + 263)
+#define __NR_add_key           (__NR_Linux + 264)
+#define __NR_request_key       (__NR_Linux + 265)
+#define __NR_keyctl            (__NR_Linux + 266)
+#define __NR_ioprio_set                (__NR_Linux + 267)
+#define __NR_ioprio_get                (__NR_Linux + 268)
+#define __NR_inotify_init      (__NR_Linux + 269)
+#define __NR_inotify_add_watch (__NR_Linux + 270)
+#define __NR_inotify_rm_watch  (__NR_Linux + 271)
+#define __NR_migrate_pages     (__NR_Linux + 272)
+#define __NR_pselect6          (__NR_Linux + 273)
+#define __NR_ppoll             (__NR_Linux + 274)
+#define __NR_openat            (__NR_Linux + 275)
+#define __NR_mkdirat           (__NR_Linux + 276)
+#define __NR_mknodat           (__NR_Linux + 277)
+#define __NR_fchownat          (__NR_Linux + 278)
+#define __NR_futimesat         (__NR_Linux + 279)
+#define __NR_fstatat64         (__NR_Linux + 280)
+#define __NR_unlinkat          (__NR_Linux + 281)
+#define __NR_renameat          (__NR_Linux + 282)
+#define __NR_linkat            (__NR_Linux + 283)
+#define __NR_symlinkat         (__NR_Linux + 284)
+#define __NR_readlinkat                (__NR_Linux + 285)
+#define __NR_fchmodat          (__NR_Linux + 286)
+#define __NR_faccessat         (__NR_Linux + 287)
+#define __NR_unshare           (__NR_Linux + 288)
+#define __NR_set_robust_list   (__NR_Linux + 289)
+#define __NR_get_robust_list   (__NR_Linux + 290)
+#define __NR_splice            (__NR_Linux + 291)
+#define __NR_sync_file_range   (__NR_Linux + 292)
+#define __NR_tee               (__NR_Linux + 293)
+#define __NR_vmsplice          (__NR_Linux + 294)
+#define __NR_move_pages                (__NR_Linux + 295)
+#define __NR_getcpu            (__NR_Linux + 296)
+#define __NR_epoll_pwait       (__NR_Linux + 297)
+#define __NR_statfs64          (__NR_Linux + 298)
+#define __NR_fstatfs64         (__NR_Linux + 299)
+#define __NR_kexec_load                (__NR_Linux + 300)
+#define __NR_utimensat         (__NR_Linux + 301)
+#define __NR_signalfd          (__NR_Linux + 302)
+#define __NR_timerfd           (__NR_Linux + 303)
+#define __NR_eventfd           (__NR_Linux + 304)
+#define __NR_fallocate         (__NR_Linux + 305)
+#define __NR_timerfd_create    (__NR_Linux + 306)
+#define __NR_timerfd_settime   (__NR_Linux + 307)
+#define __NR_timerfd_gettime   (__NR_Linux + 308)
+#define __NR_signalfd4         (__NR_Linux + 309)
+#define __NR_eventfd2          (__NR_Linux + 310)
+#define __NR_epoll_create1     (__NR_Linux + 311)
+#define __NR_dup3              (__NR_Linux + 312)
+#define __NR_pipe2             (__NR_Linux + 313)
+#define __NR_inotify_init1     (__NR_Linux + 314)
+#define __NR_preadv            (__NR_Linux + 315)
+#define __NR_pwritev           (__NR_Linux + 316)
+#define __NR_rt_tgsigqueueinfo (__NR_Linux + 317)
+#define __NR_perf_event_open   (__NR_Linux + 318)
+#define __NR_recvmmsg          (__NR_Linux + 319)
+#define __NR_accept4           (__NR_Linux + 320)
+#define __NR_prlimit64         (__NR_Linux + 321)
+#define __NR_fanotify_init     (__NR_Linux + 322)
+#define __NR_fanotify_mark     (__NR_Linux + 323)
+#define __NR_clock_adjtime     (__NR_Linux + 324)
+#define __NR_name_to_handle_at (__NR_Linux + 325)
+#define __NR_open_by_handle_at (__NR_Linux + 326)
+#define __NR_syncfs            (__NR_Linux + 327)
+#define __NR_setns             (__NR_Linux + 328)
+#define __NR_sendmmsg          (__NR_Linux + 329)
+
+#define __NR_Linux_syscalls    (__NR_sendmmsg + 1)
+
+
+#define __IGNORE_select                /* newselect */
+#define __IGNORE_fadvise64     /* fadvise64_64 */
+#define __IGNORE_utimes                /* utime */
+
+
+#define HPUX_GATEWAY_ADDR       0xC0000004
+#define LINUX_GATEWAY_ADDR      0x100
+
+#endif /* _UAPI_ASM_PARISC_UNISTD_H_ */
index 38040ff82063c5572a35e70bde330e90386ec465..ce0ef6ce8f86a07ce74e6a11fcfaaa424a1e991c 100644 (file)
@@ -42,5 +42,6 @@ static inline void svcpu_put(struct kvmppc_book3s_shadow_vcpu *svcpu)
 #define SID_SHIFT      28
 #define ESID_MASK      0xf0000000
 #define VSID_MASK      0x00fffffff0000000ULL
+#define VPN_SHIFT      12
 
 #endif /* __ASM_KVM_BOOK3S_32_H__ */
index 8734b3855272b3583aa9ba7c723f5e6df01772b1..87502046c0dcfa9ed80ea856643abe05762aca13 100644 (file)
@@ -388,9 +388,9 @@ extern int powersave_nap;   /* set if nap mode can be used in idle loop */
 extern void power7_nap(void);
 
 #ifdef CONFIG_PSERIES_IDLE
-extern void update_smt_snooze_delay(int snooze);
+extern void update_smt_snooze_delay(int cpu, int residency);
 #else
-static inline void update_smt_snooze_delay(int snooze) {}
+static inline void update_smt_snooze_delay(int cpu, int residency) {}
 #endif
 
 extern void flush_instruction_cache(void);
index 8302af6492195b77ac8a5b7f5dfbc69dfc7d43b8..cf357a059ddb73856275ad7c1fda70170356751d 100644 (file)
@@ -50,7 +50,7 @@ static ssize_t store_smt_snooze_delay(struct device *dev,
                return -EINVAL;
 
        per_cpu(smt_snooze_delay, cpu->dev.id) = snooze;
-       update_smt_snooze_delay(snooze);
+       update_smt_snooze_delay(cpu->dev.id, snooze);
 
        return count;
 }
index 00aa61268e0d6e66f34c9625365951ce29403990..b0f625a33345a6e7cf690d21b041507adae5f61f 100644 (file)
@@ -173,8 +173,8 @@ int kvmppc_mmu_map_page(struct kvm_vcpu *vcpu, struct kvmppc_pte *orig_pte)
        BUG_ON(!map);
 
        vsid = map->host_vsid;
-       vpn = (vsid << (SID_SHIFT - VPN_SHIFT)) | ((eaddr & ~ESID_MASK) >> VPN_SHIFT)
-
+       vpn = (vsid << (SID_SHIFT - VPN_SHIFT)) |
+               ((eaddr & ~ESID_MASK) >> VPN_SHIFT);
 next_pteg:
        if (rr == 16) {
                primary = !primary;
index 0db88f501f91c953c86dcbef4ab2d768be126f9d..aa2465e21f1a87b989e49eae2027fee72dc4948f 100644 (file)
@@ -1463,7 +1463,7 @@ static void perf_event_interrupt(struct pt_regs *regs)
                if (!event->hw.idx || is_limited_pmc(event->hw.idx))
                        continue;
                val = read_pmc(event->hw.idx);
-               if (pmc_overflow(val)) {
+               if ((int)val < 0) {
                        /* event has overflowed */
                        found = 1;
                        record_and_restart(event, val, regs);
index 455760b1fe6e1fde723ec96a4afeb24b75af6ca8..45d00e5fe14dad1f827acf3dacddddac067e003b 100644 (file)
@@ -33,13 +33,6 @@ static int max_idle_state = MAX_IDLE_STATE_COUNT - 1;
 static struct cpuidle_device __percpu *pseries_cpuidle_devices;
 static struct cpuidle_state *cpuidle_state_table;
 
-void update_smt_snooze_delay(int snooze)
-{
-       struct cpuidle_driver *drv = cpuidle_get_driver();
-       if (drv)
-               drv->states[0].target_residency = snooze;
-}
-
 static inline void idle_loop_prolog(unsigned long *in_purr, ktime_t *kt_before)
 {
 
@@ -66,32 +59,22 @@ static int snooze_loop(struct cpuidle_device *dev,
 {
        unsigned long in_purr;
        ktime_t kt_before;
-       unsigned long start_snooze;
-       long snooze = drv->states[0].target_residency;
+       int cpu = dev->cpu;
 
        idle_loop_prolog(&in_purr, &kt_before);
+       local_irq_enable();
+       set_thread_flag(TIF_POLLING_NRFLAG);
 
-       if (snooze) {
-               start_snooze = get_tb() + snooze * tb_ticks_per_usec;
-               local_irq_enable();
-               set_thread_flag(TIF_POLLING_NRFLAG);
-
-               while ((snooze < 0) || (get_tb() < start_snooze)) {
-                       if (need_resched() || cpu_is_offline(dev->cpu))
-                               goto out;
-                       ppc64_runlatch_off();
-                       HMT_low();
-                       HMT_very_low();
-               }
-
-               HMT_medium();
-               clear_thread_flag(TIF_POLLING_NRFLAG);
-               smp_mb();
-               local_irq_disable();
+       while ((!need_resched()) && cpu_online(cpu)) {
+               ppc64_runlatch_off();
+               HMT_low();
+               HMT_very_low();
        }
 
-out:
        HMT_medium();
+       clear_thread_flag(TIF_POLLING_NRFLAG);
+       smp_mb();
+
        dev->last_residency =
                (int)idle_loop_epilog(in_purr, kt_before);
        return index;
@@ -172,8 +155,8 @@ static struct cpuidle_state dedicated_states[MAX_IDLE_STATE_COUNT] = {
                .name = "CEDE",
                .desc = "CEDE",
                .flags = CPUIDLE_FLAG_TIME_VALID,
-               .exit_latency = 1,
-               .target_residency = 10,
+               .exit_latency = 10,
+               .target_residency = 100,
                .enter = &dedicated_cede_loop },
 };
 
@@ -190,6 +173,23 @@ static struct cpuidle_state shared_states[MAX_IDLE_STATE_COUNT] = {
                .enter = &shared_cede_loop },
 };
 
+void update_smt_snooze_delay(int cpu, int residency)
+{
+       struct cpuidle_driver *drv = cpuidle_get_driver();
+       struct cpuidle_device *dev = per_cpu(cpuidle_devices, cpu);
+
+       if (cpuidle_state_table != dedicated_states)
+               return;
+
+       if (residency < 0) {
+               /* Disable the Nap state on that cpu */
+               if (dev)
+                       dev->states_usage[1].disable = 1;
+       } else
+               if (drv)
+                       drv->states[1].target_residency = residency;
+}
+
 static int pseries_cpuidle_add_cpu_notifier(struct notifier_block *n,
                        unsigned long action, void *hcpu)
 {
@@ -246,10 +246,6 @@ static int pseries_cpuidle_driver_init(void)
                drv->states[drv->state_count] = /* structure copy */
                        cpuidle_state_table[idle_state];
 
-               if (cpuidle_state_table == dedicated_states)
-                       drv->states[drv->state_count].target_residency =
-                               __get_cpu_var(smt_snooze_delay);
-
                drv->state_count += 1;
        }
 
index 7bf68fff7c5d28cd2255d8d86189eb55368ddd71..59b67ed423b422bb6ed353f516b796278f5bcb38 100644 (file)
@@ -1,6 +1,8 @@
 # UAPI Header export list
 include include/uapi/asm-generic/Kbuild.asm
 
+generic-y += kvm_para.h
+
 header-y += auxvec.h
 header-y += bitsperlong.h
 header-y += byteorder.h
diff --git a/arch/s390/include/uapi/asm/kvm_para.h b/arch/s390/include/uapi/asm/kvm_para.h
deleted file mode 100644 (file)
index e69de29..0000000
index 86eadceff097481b4ba5ce3494d60134f50e02ae..29f83beeef7a4c463d814ee445f73e47e2ff24b8 100644 (file)
@@ -1,4 +1,3 @@
-include include/asm-generic/Kbuild.asm
 
 generic-y += bitsperlong.h
 generic-y += cputime.h
@@ -34,13 +33,3 @@ generic-y += termbits.h
 generic-y += termios.h
 generic-y += ucontext.h
 generic-y += xor.h
-
-header-y += cachectl.h
-header-y += cpu-features.h
-header-y += hw_breakpoint.h
-header-y += posix_types_32.h
-header-y += posix_types_64.h
-header-y += ptrace_32.h
-header-y += ptrace_64.h
-header-y += unistd_32.h
-header-y += unistd_64.h
diff --git a/arch/sh/include/asm/auxvec.h b/arch/sh/include/asm/auxvec.h
deleted file mode 100644 (file)
index 8bcc51a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef __ASM_SH_AUXVEC_H
-#define __ASM_SH_AUXVEC_H
-
-/*
- * Architecture-neutral AT_ values in 0-17, leave some room
- * for more of them.
- */
-
-/*
- * This entry gives some information about the FPU initialization
- * performed by the kernel.
- */
-#define AT_FPUCW               18      /* Used FPU control word.  */
-
-#if defined(CONFIG_VSYSCALL) || !defined(__KERNEL__)
-/*
- * Only define this in the vsyscall case, the entry point to
- * the vsyscall page gets placed here. The kernel will attempt
- * to build a gate VMA we don't care about otherwise..
- */
-#define AT_SYSINFO_EHDR                33
-#endif
-
-/*
- * More complete cache descriptions than AT_[DIU]CACHEBSIZE.  If the
- * value is -1, then the cache doesn't exist.  Otherwise:
- *
- *    bit 0-3:   Cache set-associativity; 0 means fully associative.
- *    bit 4-7:   Log2 of cacheline size.
- *    bit 8-31:          Size of the entire cache >> 8.
- */
-#define AT_L1I_CACHESHAPE      34
-#define AT_L1D_CACHESHAPE      35
-#define AT_L2_CACHESHAPE       36
-
-#define AT_VECTOR_SIZE_ARCH 5 /* entries in ARCH_DLINFO */
-
-#endif /* __ASM_SH_AUXVEC_H */
diff --git a/arch/sh/include/asm/byteorder.h b/arch/sh/include/asm/byteorder.h
deleted file mode 100644 (file)
index db2f5d7..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __ASM_SH_BYTEORDER_H
-#define __ASM_SH_BYTEORDER_H
-
-#ifdef __LITTLE_ENDIAN__
-#include <linux/byteorder/little_endian.h>
-#else
-#include <linux/byteorder/big_endian.h>
-#endif
-
-#endif /* __ASM_SH_BYTEORDER_H */
diff --git a/arch/sh/include/asm/cachectl.h b/arch/sh/include/asm/cachectl.h
deleted file mode 100644 (file)
index 6ffb4b7..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _SH_CACHECTL_H
-#define _SH_CACHECTL_H
-
-/* Definitions for the cacheflush system call.  */
-
-#define CACHEFLUSH_D_INVAL     0x1     /* invalidate (without write back) */
-#define CACHEFLUSH_D_WB                0x2     /* write back (without invalidate) */
-#define CACHEFLUSH_D_PURGE     0x3     /* writeback and invalidate */
-
-#define CACHEFLUSH_I           0x4
-
-/*
- * Options for cacheflush system call
- */
-#define ICACHE CACHEFLUSH_I            /* flush instruction cache */
-#define DCACHE CACHEFLUSH_D_PURGE      /* writeback and flush data cache */
-#define BCACHE (ICACHE|DCACHE)         /* flush both caches */
-
-#endif /* _SH_CACHECTL_H */
diff --git a/arch/sh/include/asm/cpu-features.h b/arch/sh/include/asm/cpu-features.h
deleted file mode 100644 (file)
index 694abe4..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef __ASM_SH_CPU_FEATURES_H
-#define __ASM_SH_CPU_FEATURES_H
-
-/*
- * Processor flags
- *
- * Note: When adding a new flag, keep cpu_flags[] in
- * arch/sh/kernel/setup.c in sync so symbolic name
- * mapping of the processor flags has a chance of being
- * reasonably accurate.
- *
- * These flags are also available through the ELF
- * auxiliary vector as AT_HWCAP.
- */
-#define CPU_HAS_FPU            0x0001  /* Hardware FPU support */
-#define CPU_HAS_P2_FLUSH_BUG   0x0002  /* Need to flush the cache in P2 area */
-#define CPU_HAS_MMU_PAGE_ASSOC 0x0004  /* SH3: TLB way selection bit support */
-#define CPU_HAS_DSP            0x0008  /* SH-DSP: DSP support */
-#define CPU_HAS_PERF_COUNTER   0x0010  /* Hardware performance counters */
-#define CPU_HAS_PTEA           0x0020  /* PTEA register */
-#define CPU_HAS_LLSC           0x0040  /* movli.l/movco.l */
-#define CPU_HAS_L2_CACHE       0x0080  /* Secondary cache / URAM */
-#define CPU_HAS_OP32           0x0100  /* 32-bit instruction support */
-#define CPU_HAS_PTEAEX         0x0200  /* PTE ASID Extension support */
-
-#endif /* __ASM_SH_CPU_FEATURES_H */
index 89890f61a7b91d495a0cf4c72a45780fe6f389be..ec9ad593c3da743bacbd5875a577709a94e3333b 100644 (file)
@@ -1,7 +1,8 @@
 #ifndef __ASM_SH_HW_BREAKPOINT_H
 #define __ASM_SH_HW_BREAKPOINT_H
 
-#ifdef __KERNEL__
+#include <uapi/asm/hw_breakpoint.h>
+
 #define __ARCH_HW_BREAKPOINT_H
 
 #include <linux/kdebug.h>
@@ -66,5 +67,4 @@ extern int register_sh_ubc(struct sh_ubc *);
 
 extern struct pmu perf_ops_bp;
 
-#endif /* __KERNEL__ */
 #endif /* __ASM_SH_HW_BREAKPOINT_H */
diff --git a/arch/sh/include/asm/ioctls.h b/arch/sh/include/asm/ioctls.h
deleted file mode 100644 (file)
index a6769f3..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-#ifndef __ASM_SH_IOCTLS_H
-#define __ASM_SH_IOCTLS_H
-
-#include <asm/ioctl.h>
-
-#define FIOCLEX                _IO('f', 1)
-#define FIONCLEX       _IO('f', 2)
-#define FIOASYNC       _IOW('f', 125, int)
-#define FIONBIO                _IOW('f', 126, int)
-#define FIONREAD       _IOR('f', 127, int)
-#define TIOCINQ                FIONREAD
-#define FIOQSIZE       _IOR('f', 128, loff_t)
-
-#define TCGETS         0x5401
-#define TCSETS         0x5402
-#define TCSETSW                0x5403
-#define TCSETSF                0x5404
-
-#define TCGETA         0x80127417      /* _IOR('t', 23, struct termio) */
-#define TCSETA         0x40127418      /* _IOW('t', 24, struct termio) */
-#define TCSETAW                0x40127419      /* _IOW('t', 25, struct termio) */
-#define TCSETAF                0x4012741C      /* _IOW('t', 28, struct termio) */
-
-#define TCSBRK         _IO('t', 29)
-#define TCXONC         _IO('t', 30)
-#define TCFLSH         _IO('t', 31)
-
-#define TIOCSWINSZ     0x40087467      /* _IOW('t', 103, struct winsize) */
-#define TIOCGWINSZ     0x80087468      /* _IOR('t', 104, struct winsize) */
-#define        TIOCSTART       _IO('t', 110)           /* start output, like ^Q */
-#define        TIOCSTOP        _IO('t', 111)           /* stop output, like ^S */
-#define TIOCOUTQ        _IOR('t', 115, int)     /* output queue size */
-
-#define TIOCSPGRP      _IOW('t', 118, int)
-#define TIOCGPGRP      _IOR('t', 119, int)
-
-#define TIOCEXCL       _IO('T', 12) /* 0x540C */
-#define TIOCNXCL       _IO('T', 13) /* 0x540D */
-#define TIOCSCTTY      _IO('T', 14) /* 0x540E */
-
-#define TIOCSTI                _IOW('T', 18, char) /* 0x5412 */
-#define TIOCMGET       _IOR('T', 21, unsigned int) /* 0x5415 */
-#define TIOCMBIS       _IOW('T', 22, unsigned int) /* 0x5416 */
-#define TIOCMBIC       _IOW('T', 23, unsigned int) /* 0x5417 */
-#define TIOCMSET       _IOW('T', 24, unsigned int) /* 0x5418 */
-# define TIOCM_LE      0x001
-# define TIOCM_DTR     0x002
-# define TIOCM_RTS     0x004
-# define TIOCM_ST      0x008
-# define TIOCM_SR      0x010
-# define TIOCM_CTS     0x020
-# define TIOCM_CAR     0x040
-# define TIOCM_RNG     0x080
-# define TIOCM_DSR     0x100
-# define TIOCM_CD      TIOCM_CAR
-# define TIOCM_RI      TIOCM_RNG
-
-#define TIOCGSOFTCAR   _IOR('T', 25, unsigned int) /* 0x5419 */
-#define TIOCSSOFTCAR   _IOW('T', 26, unsigned int) /* 0x541A */
-#define TIOCLINUX      _IOW('T', 28, char) /* 0x541C */
-#define TIOCCONS       _IO('T', 29) /* 0x541D */
-#define TIOCGSERIAL    0x803C541E      /* _IOR('T', 30, struct serial_struct) 0x541E */
-#define TIOCSSERIAL    0x403C541F      /* _IOW('T', 31, struct serial_struct) 0x541F */
-#define TIOCPKT                _IOW('T', 32, int) /* 0x5420 */
-# define TIOCPKT_DATA           0
-# define TIOCPKT_FLUSHREAD      1
-# define TIOCPKT_FLUSHWRITE     2
-# define TIOCPKT_STOP           4
-# define TIOCPKT_START          8
-# define TIOCPKT_NOSTOP                16
-# define TIOCPKT_DOSTOP                32
-# define TIOCPKT_IOCTL         64
-
-
-#define TIOCNOTTY      _IO('T', 34) /* 0x5422 */
-#define TIOCSETD       _IOW('T', 35, int) /* 0x5423 */
-#define TIOCGETD       _IOR('T', 36, int) /* 0x5424 */
-#define TCSBRKP                _IOW('T', 37, int) /* 0x5425 */ /* Needed for POSIX tcsendbreak() */
-#define TIOCSBRK       _IO('T', 39) /* 0x5427 */ /* BSD compatibility */
-#define TIOCCBRK       _IO('T', 40) /* 0x5428 */ /* BSD compatibility */
-#define TIOCGSID       _IOR('T', 41, pid_t) /* 0x5429 */ /* Return the session ID of FD */
-#define TCGETS2                _IOR('T', 42, struct termios2)
-#define TCSETS2                _IOW('T', 43, struct termios2)
-#define TCSETSW2       _IOW('T', 44, struct termios2)
-#define TCSETSF2       _IOW('T', 45, struct termios2)
-#define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
-#define TIOCGDEV       _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
-#define TIOCSIG                _IOW('T',0x36, int)  /* Generate signal on Pty slave */
-#define TIOCVHANGUP    _IO('T', 0x37)
-
-#define TIOCSERCONFIG  _IO('T', 83) /* 0x5453 */
-#define TIOCSERGWILD   _IOR('T', 84,  int) /* 0x5454 */
-#define TIOCSERSWILD   _IOW('T', 85,  int) /* 0x5455 */
-#define TIOCGLCKTRMIOS 0x5456
-#define TIOCSLCKTRMIOS 0x5457
-#define TIOCSERGSTRUCT 0x80d85458      /* _IOR('T', 88, struct async_struct) 0x5458 */ /* For debugging only */
-#define TIOCSERGETLSR   _IOR('T', 89, unsigned int) /* 0x5459 */ /* Get line status register */
-  /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-# define TIOCSER_TEMT    0x01  /* Transmitter physically empty */
-#define TIOCSERGETMULTI 0x80A8545A     /* _IOR('T', 90, struct serial_multiport_struct) 0x545A */ /* Get multiport config */
-#define TIOCSERSETMULTI 0x40A8545B     /* _IOW('T', 91, struct serial_multiport_struct) 0x545B */ /* Set multiport config */
-
-#define TIOCMIWAIT     _IO('T', 92) /* 0x545C */       /* wait for a change on serial input line(s) */
-#define TIOCGICOUNT    0x545D  /* read serial port inline interrupt counts */
-
-#endif /* __ASM_SH_IOCTLS_H */
index f08449bcbde7e747f96d27d4397c46f97d0b593f..1aa781079b1edb4aaeeebd5b325475a35a7dfd6a 100644 (file)
@@ -1,13 +1,5 @@
-#ifdef __KERNEL__
 # ifdef CONFIG_SUPERH32
 #  include <asm/posix_types_32.h>
 # else
 #  include <asm/posix_types_64.h>
 # endif
-#else
-# ifdef __SH5__
-#  include <asm/posix_types_64.h>
-# else
-#  include <asm/posix_types_32.h>
-# endif
-#endif /* __KERNEL__ */
diff --git a/arch/sh/include/asm/posix_types_32.h b/arch/sh/include/asm/posix_types_32.h
deleted file mode 100644 (file)
index ba0bdc4..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef __ASM_SH_POSIX_TYPES_32_H
-#define __ASM_SH_POSIX_TYPES_32_H
-
-typedef unsigned short __kernel_mode_t;
-#define __kernel_mode_t __kernel_mode_t
-typedef unsigned short __kernel_ipc_pid_t;
-#define __kernel_ipc_pid_t __kernel_ipc_pid_t
-typedef unsigned short __kernel_uid_t;
-#define __kernel_uid_t __kernel_uid_t
-typedef unsigned short __kernel_gid_t;
-#define __kernel_gid_t __kernel_gid_t
-
-typedef unsigned short __kernel_old_uid_t;
-#define __kernel_old_uid_t __kernel_old_uid_t
-typedef unsigned short __kernel_old_gid_t;
-#define __kernel_old_gid_t __kernel_old_gid_t
-typedef unsigned short __kernel_old_dev_t;
-#define __kernel_old_dev_t __kernel_old_dev_t
-
-#include <asm-generic/posix_types.h>
-
-#endif /* __ASM_SH_POSIX_TYPES_32_H */
diff --git a/arch/sh/include/asm/posix_types_64.h b/arch/sh/include/asm/posix_types_64.h
deleted file mode 100644 (file)
index 244f7e9..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef __ASM_SH_POSIX_TYPES_64_H
-#define __ASM_SH_POSIX_TYPES_64_H
-
-typedef unsigned short __kernel_mode_t;
-#define __kernel_mode_t __kernel_mode_t
-typedef unsigned short __kernel_ipc_pid_t;
-#define __kernel_ipc_pid_t __kernel_ipc_pid_t
-typedef unsigned short __kernel_uid_t;
-#define __kernel_uid_t __kernel_uid_t
-typedef unsigned short __kernel_gid_t;
-#define __kernel_gid_t __kernel_gid_t
-typedef long unsigned int      __kernel_size_t;
-#define __kernel_size_t __kernel_size_t
-typedef int            __kernel_ssize_t;
-#define __kernel_ssize_t __kernel_ssize_t
-typedef int            __kernel_ptrdiff_t;
-#define __kernel_ptrdiff_t __kernel_ptrdiff_t
-
-typedef unsigned short __kernel_old_uid_t;
-#define __kernel_old_uid_t __kernel_old_uid_t
-typedef unsigned short __kernel_old_gid_t;
-#define __kernel_old_gid_t __kernel_old_gid_t
-typedef unsigned short __kernel_old_dev_t;
-#define __kernel_old_dev_t __kernel_old_dev_t
-
-#include <asm-generic/posix_types.h>
-
-#endif /* __ASM_SH_POSIX_TYPES_64_H */
index a4a38dff997adc4e01b50188d5ef5df796f0644f..2506c7db76b70ef83db681e14f49cee27ccb5933 100644 (file)
@@ -1,42 +1,16 @@
-#ifndef __ASM_SH_PTRACE_H
-#define __ASM_SH_PTRACE_H
-
 /*
  * Copyright (C) 1999, 2000  Niibe Yutaka
  */
+#ifndef __ASM_SH_PTRACE_H
+#define __ASM_SH_PTRACE_H
 
-#define PTRACE_GETREGS         12      /* General registers */
-#define PTRACE_SETREGS         13
-
-#define PTRACE_GETFPREGS       14      /* FPU registers */
-#define PTRACE_SETFPREGS       15
-
-#define PTRACE_GETFDPIC                31      /* get the ELF fdpic loadmap address */
-
-#define PTRACE_GETFDPIC_EXEC   0       /* [addr] request the executable loadmap */
-#define PTRACE_GETFDPIC_INTERP 1       /* [addr] request the interpreter loadmap */
-
-#define        PTRACE_GETDSPREGS       55      /* DSP registers */
-#define        PTRACE_SETDSPREGS       56
-
-#define PT_TEXT_END_ADDR       240
-#define PT_TEXT_ADDR           244     /* &(struct user)->start_code */
-#define PT_DATA_ADDR           248     /* &(struct user)->start_data */
-#define PT_TEXT_LEN            252
-
-#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
-#include <asm/ptrace_64.h>
-#else
-#include <asm/ptrace_32.h>
-#endif
-
-#ifdef __KERNEL__
 
 #include <linux/stringify.h>
 #include <linux/stddef.h>
 #include <linux/thread_info.h>
 #include <asm/addrspace.h>
 #include <asm/page.h>
+#include <uapi/asm/ptrace.h>
 
 #define user_mode(regs)                        (((regs)->sr & 0x40000000)==0)
 #define kernel_stack_pointer(_regs)    ((unsigned long)(_regs)->regs[15])
@@ -140,6 +114,4 @@ static inline unsigned long profile_pc(struct pt_regs *regs)
 #define profile_pc profile_pc
 
 #include <asm-generic/ptrace.h>
-#endif /* __KERNEL__ */
-
 #endif /* __ASM_SH_PTRACE_H */
index 2d3e906aa72252d3b827a12405546465127d5f78..1dd4480c5363f5e413dc35e0b65c9278ffbc1bae 100644 (file)
@@ -1,79 +1,8 @@
 #ifndef __ASM_SH_PTRACE_32_H
 #define __ASM_SH_PTRACE_32_H
 
-/*
- * GCC defines register number like this:
- * -----------------------------
- *      0 - 15 are integer registers
- *     17 - 22 are control/special registers
- *     24 - 39 fp registers
- *     40 - 47 xd registers
- *     48 -    fpscr register
- * -----------------------------
- *
- * We follows above, except:
- *     16 --- program counter (PC)
- *     22 --- syscall #
- *     23 --- floating point communication register
- */
-#define REG_REG0        0
-#define REG_REG15      15
+#include <uapi/asm/ptrace_32.h>
 
-#define REG_PC         16
-
-#define REG_PR         17
-#define REG_SR         18
-#define REG_GBR                19
-#define REG_MACH       20
-#define REG_MACL       21
-
-#define REG_SYSCALL    22
-
-#define REG_FPREG0     23
-#define REG_FPREG15    38
-#define REG_XFREG0     39
-#define REG_XFREG15    54
-
-#define REG_FPSCR      55
-#define REG_FPUL       56
-
-/*
- * This struct defines the way the registers are stored on the
- * kernel stack during a system call or other kernel entry.
- */
-struct pt_regs {
-       unsigned long regs[16];
-       unsigned long pc;
-       unsigned long pr;
-       unsigned long sr;
-       unsigned long gbr;
-       unsigned long mach;
-       unsigned long macl;
-       long tra;
-};
-
-/*
- * This struct defines the way the DSP registers are stored on the
- * kernel stack during a system call or other kernel entry.
- */
-struct pt_dspregs {
-       unsigned long   a1;
-       unsigned long   a0g;
-       unsigned long   a1g;
-       unsigned long   m0;
-       unsigned long   m1;
-       unsigned long   a0;
-       unsigned long   x0;
-       unsigned long   x1;
-       unsigned long   y0;
-       unsigned long   y1;
-       unsigned long   dsr;
-       unsigned long   rs;
-       unsigned long   re;
-       unsigned long   mod;
-};
-
-#ifdef __KERNEL__
 
 #define MAX_REG_OFFSET         offsetof(struct pt_regs, tra)
 static inline long regs_return_value(struct pt_regs *regs)
@@ -81,6 +10,4 @@ static inline long regs_return_value(struct pt_regs *regs)
        return regs->regs[0];
 }
 
-#endif /* __KERNEL__ */
-
 #endif /* __ASM_SH_PTRACE_32_H */
index eb3fcceaf64b7bb5942a081637e78c5d479bad86..97f4b5660f2cdc62d112183e2e600c4456b6476e 100644 (file)
@@ -1,16 +1,8 @@
 #ifndef __ASM_SH_PTRACE_64_H
 #define __ASM_SH_PTRACE_64_H
 
-struct pt_regs {
-       unsigned long long pc;
-       unsigned long long sr;
-       long long syscall_nr;
-       unsigned long long regs[63];
-       unsigned long long tregs[8];
-       unsigned long long pad[2];
-};
+#include <uapi/asm/ptrace_64.h>
 
-#ifdef __KERNEL__
 
 #define MAX_REG_OFFSET         offsetof(struct pt_regs, tregs[7])
 static inline long regs_return_value(struct pt_regs *regs)
@@ -18,6 +10,4 @@ static inline long regs_return_value(struct pt_regs *regs)
        return regs->regs[3];
 }
 
-#endif /* __KERNEL__ */
-
 #endif /* __ASM_SH_PTRACE_64_H */
index 465a22df8fd029baa750e02c47b8ca438e22bd70..99238108e7a51b6af6815e42a6e34f1799a0bc99 100644 (file)
@@ -1,9 +1,8 @@
 #ifndef _SH_SETUP_H
 #define _SH_SETUP_H
 
-#include <asm-generic/setup.h>
+#include <uapi/asm/setup.h>
 
-#ifdef __KERNEL__
 /*
  * This is set up by the setup-routine at boot-time
  */
@@ -22,6 +21,4 @@ void sh_mv_setup(void);
 void check_for_initrd(void);
 void per_cpu_trap_init(void);
 
-#endif /* __KERNEL__ */
-
 #endif /* _SH_SETUP_H */
diff --git a/arch/sh/include/asm/sigcontext.h b/arch/sh/include/asm/sigcontext.h
deleted file mode 100644 (file)
index 8ce1435..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef __ASM_SH_SIGCONTEXT_H
-#define __ASM_SH_SIGCONTEXT_H
-
-struct sigcontext {
-       unsigned long   oldmask;
-
-#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
-       /* CPU registers */
-       unsigned long long sc_regs[63];
-       unsigned long long sc_tregs[8];
-       unsigned long long sc_pc;
-       unsigned long long sc_sr;
-
-       /* FPU registers */
-       unsigned long long sc_fpregs[32];
-       unsigned int sc_fpscr;
-       unsigned int sc_fpvalid;
-#else
-       /* CPU registers */
-       unsigned long sc_regs[16];
-       unsigned long sc_pc;
-       unsigned long sc_pr;
-       unsigned long sc_sr;
-       unsigned long sc_gbr;
-       unsigned long sc_mach;
-       unsigned long sc_macl;
-
-#if defined(__SH4__) || defined(CONFIG_CPU_SH4) || \
-    defined(__SH2A__) || defined(CONFIG_CPU_SH2A)
-       /* FPU registers */
-       unsigned long sc_fpregs[16];
-       unsigned long sc_xfpregs[16];
-       unsigned int sc_fpscr;
-       unsigned int sc_fpul;
-       unsigned int sc_ownedfp;
-#endif
-#endif
-};
-
-#endif /* __ASM_SH_SIGCONTEXT_H */
diff --git a/arch/sh/include/asm/signal.h b/arch/sh/include/asm/signal.h
deleted file mode 100644 (file)
index 9ac530a..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef __ASM_SH_SIGNAL_H
-#define __ASM_SH_SIGNAL_H
-
-#define SA_RESTORER    0x04000000
-
-#include <asm-generic/signal.h>
-
-struct old_sigaction {
-       __sighandler_t sa_handler;
-       old_sigset_t sa_mask;
-       unsigned long sa_flags;
-       void (*sa_restorer)(void);
-};
-
-#endif /* __ASM_SH_SIGNAL_H */
diff --git a/arch/sh/include/asm/sockios.h b/arch/sh/include/asm/sockios.h
deleted file mode 100644 (file)
index cf8b96b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __ASM_SH_SOCKIOS_H
-#define __ASM_SH_SOCKIOS_H
-
-/* Socket-level I/O control calls. */
-#define FIOGETOWN      _IOR('f', 123, int)
-#define FIOSETOWN      _IOW('f', 124, int)
-
-#define SIOCATMARK     _IOR('s', 7, int)
-#define SIOCSPGRP      _IOW('s', 8, pid_t)
-#define SIOCGPGRP      _IOR('s', 9, pid_t)
-
-#define SIOCGSTAMP     _IOR('s', 100, struct timeval) /* Get stamp (timeval) */
-#define SIOCGSTAMPNS   _IOR('s', 101, struct timespec) /* Get stamp (timespec) */
-#endif /* __ASM_SH_SOCKIOS_H */
diff --git a/arch/sh/include/asm/stat.h b/arch/sh/include/asm/stat.h
deleted file mode 100644 (file)
index e1810cc..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-#ifndef __ASM_SH_STAT_H
-#define __ASM_SH_STAT_H
-
-struct __old_kernel_stat {
-       unsigned short st_dev;
-       unsigned short st_ino;
-       unsigned short st_mode;
-       unsigned short st_nlink;
-       unsigned short st_uid;
-       unsigned short st_gid;
-       unsigned short st_rdev;
-       unsigned long  st_size;
-       unsigned long  st_atime;
-       unsigned long  st_mtime;
-       unsigned long  st_ctime;
-};
-
-#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
-struct stat {
-       unsigned short st_dev;
-       unsigned short __pad1;
-       unsigned long st_ino;
-       unsigned short st_mode;
-       unsigned short st_nlink;
-       unsigned short st_uid;
-       unsigned short st_gid;
-       unsigned short st_rdev;
-       unsigned short __pad2;
-       unsigned long  st_size;
-       unsigned long  st_blksize;
-       unsigned long  st_blocks;
-       unsigned long  st_atime;
-       unsigned long  st_atime_nsec;
-       unsigned long  st_mtime;
-       unsigned long  st_mtime_nsec;
-       unsigned long  st_ctime;
-       unsigned long  st_ctime_nsec;
-       unsigned long  __unused4;
-       unsigned long  __unused5;
-};
-
-/* This matches struct stat64 in glibc2.1, hence the absolutely
- * insane amounts of padding around dev_t's.
- */
-struct stat64 {
-       unsigned short  st_dev;
-       unsigned char   __pad0[10];
-
-       unsigned long   st_ino;
-       unsigned int    st_mode;
-       unsigned int    st_nlink;
-
-       unsigned long   st_uid;
-       unsigned long   st_gid;
-
-       unsigned short  st_rdev;
-       unsigned char   __pad3[10];
-
-       long long       st_size;
-       unsigned long   st_blksize;
-
-       unsigned long   st_blocks;      /* Number 512-byte blocks allocated. */
-       unsigned long   __pad4;         /* future possible st_blocks high bits */
-
-       unsigned long   st_atime;
-       unsigned long   st_atime_nsec;
-
-       unsigned long   st_mtime;
-       unsigned long   st_mtime_nsec;
-
-       unsigned long   st_ctime;
-       unsigned long   st_ctime_nsec;  /* will be high 32 bits of ctime someday */
-
-       unsigned long   __unused1;
-       unsigned long   __unused2;
-};
-#else
-struct stat {
-       unsigned long  st_dev;
-       unsigned long  st_ino;
-       unsigned short st_mode;
-       unsigned short st_nlink;
-       unsigned short st_uid;
-       unsigned short st_gid;
-       unsigned long  st_rdev;
-       unsigned long  st_size;
-       unsigned long  st_blksize;
-       unsigned long  st_blocks;
-       unsigned long  st_atime;
-       unsigned long  st_atime_nsec;
-       unsigned long  st_mtime;
-       unsigned long  st_mtime_nsec;
-       unsigned long  st_ctime;
-       unsigned long  st_ctime_nsec;
-       unsigned long  __unused4;
-       unsigned long  __unused5;
-};
-
-/* This matches struct stat64 in glibc2.1, hence the absolutely
- * insane amounts of padding around dev_t's.
- */
-struct stat64 {
-       unsigned long long      st_dev;
-       unsigned char   __pad0[4];
-
-#define STAT64_HAS_BROKEN_ST_INO       1
-       unsigned long   __st_ino;
-
-       unsigned int    st_mode;
-       unsigned int    st_nlink;
-
-       unsigned long   st_uid;
-       unsigned long   st_gid;
-
-       unsigned long long      st_rdev;
-       unsigned char   __pad3[4];
-
-       long long       st_size;
-       unsigned long   st_blksize;
-
-       unsigned long long      st_blocks;      /* Number 512-byte blocks allocated. */
-
-       unsigned long   st_atime;
-       unsigned long   st_atime_nsec;
-
-       unsigned long   st_mtime;
-       unsigned long   st_mtime_nsec;
-
-       unsigned long   st_ctime;
-       unsigned long   st_ctime_nsec;
-
-       unsigned long long      st_ino;
-};
-
-#define STAT_HAVE_NSEC 1
-#endif
-
-#endif /* __ASM_SH_STAT_H */
diff --git a/arch/sh/include/asm/swab.h b/arch/sh/include/asm/swab.h
deleted file mode 100644 (file)
index 1cd0976..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef __ASM_SH_SWAB_H
-#define __ASM_SH_SWAB_H
-
-/*
- * Copyright (C) 1999  Niibe Yutaka
- * Copyright (C) 2000, 2001  Paolo Alberelli
- */
-#include <linux/compiler.h>
-#include <linux/types.h>
-#include <asm-generic/swab.h>
-
-static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
-{
-       __asm__(
-#ifdef __SH5__
-               "byterev        %1, %0\n\t"
-               "shari          %0, 32, %0"
-#else
-               "swap.b         %1, %0\n\t"
-               "swap.w         %0, %0\n\t"
-               "swap.b         %0, %0"
-#endif
-               : "=r" (x)
-               : "r" (x));
-
-       return x;
-}
-#define __arch_swab32 __arch_swab32
-
-static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
-{
-       __asm__(
-#ifdef __SH5__
-               "byterev        %1, %0\n\t"
-               "shari          %0, 32, %0"
-#else
-               "swap.b         %1, %0"
-#endif
-               : "=r" (x)
-               :  "r" (x));
-
-       return x;
-}
-#define __arch_swab16 __arch_swab16
-
-static inline __u64 __arch_swab64(__u64 val)
-{
-       union {
-               struct { __u32 a,b; } s;
-               __u64 u;
-       } v, w;
-       v.u = val;
-       w.s.b = __arch_swab32(v.s.a);
-       w.s.a = __arch_swab32(v.s.b);
-       return w.u;
-}
-#define __arch_swab64 __arch_swab64
-
-#endif /* __ASM_SH_SWAB_H */
index f8421f7ad63a8b0c79ad3dc5e2fd6b64e2832203..6a31053fa5e32f4cd53a260ed9cf61f8e3ed1eb8 100644 (file)
@@ -1,12 +1,11 @@
 #ifndef __ASM_SH_TYPES_H
 #define __ASM_SH_TYPES_H
 
-#include <asm-generic/types.h>
+#include <uapi/asm/types.h>
 
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
-#ifdef __KERNEL__
 #ifndef __ASSEMBLY__
 
 #ifdef CONFIG_SUPERH32
@@ -18,6 +17,4 @@ typedef u64 reg_size_t;
 #endif
 
 #endif /* __ASSEMBLY__ */
-#endif /* __KERNEL__ */
-
 #endif /* __ASM_SH_TYPES_H */
index 307201a854f3902b84a100a4f0f72911a3a37932..38956dfa76f7fb52137375470d0ccb5b35f1741d 100644 (file)
@@ -1,4 +1,3 @@
-#ifdef __KERNEL__
 # ifdef CONFIG_SUPERH32
 #  include <asm/unistd_32.h>
 # else
  */
 # define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
 
-#else
-# ifdef __SH5__
-#  include <asm/unistd_64.h>
-# else
-#  include <asm/unistd_32.h>
-# endif
-#endif
+#include <uapi/asm/unistd.h>
diff --git a/arch/sh/include/asm/unistd_32.h b/arch/sh/include/asm/unistd_32.h
deleted file mode 100644 (file)
index 72fd1e0..0000000
+++ /dev/null
@@ -1,384 +0,0 @@
-#ifndef __ASM_SH_UNISTD_32_H
-#define __ASM_SH_UNISTD_32_H
-
-/*
- * Copyright (C) 1999  Niibe Yutaka
- */
-
-/*
- * This file contains the system call numbers.
- */
-
-#define __NR_restart_syscall     0
-#define __NR_exit                1
-#define __NR_fork                2
-#define __NR_read                3
-#define __NR_write               4
-#define __NR_open                5
-#define __NR_close               6
-#define __NR_waitpid             7
-#define __NR_creat               8
-#define __NR_link                9
-#define __NR_unlink             10
-#define __NR_execve             11
-#define __NR_chdir              12
-#define __NR_time               13
-#define __NR_mknod              14
-#define __NR_chmod              15
-#define __NR_lchown             16
-                                /* 17 was sys_break */
-#define __NR_oldstat            18
-#define __NR_lseek              19
-#define __NR_getpid             20
-#define __NR_mount              21
-#define __NR_umount             22
-#define __NR_setuid             23
-#define __NR_getuid             24
-#define __NR_stime              25
-#define __NR_ptrace             26
-#define __NR_alarm              27
-#define __NR_oldfstat           28
-#define __NR_pause              29
-#define __NR_utime              30
-                                /* 31 was sys_stty */
-                                /* 32 was sys_gtty */
-#define __NR_access             33
-#define __NR_nice               34
-                                /* 35 was sys_ftime */
-#define __NR_sync               36
-#define __NR_kill               37
-#define __NR_rename             38
-#define __NR_mkdir              39
-#define __NR_rmdir              40
-#define __NR_dup                41
-#define __NR_pipe               42
-#define __NR_times              43
-                                /* 44 was sys_prof */
-#define __NR_brk                45
-#define __NR_setgid             46
-#define __NR_getgid             47
-#define __NR_signal             48
-#define __NR_geteuid            49
-#define __NR_getegid            50
-#define __NR_acct               51
-#define __NR_umount2            52
-                                /* 53 was sys_lock */
-#define __NR_ioctl              54
-#define __NR_fcntl              55
-                                /* 56 was sys_mpx */
-#define __NR_setpgid            57
-                                /* 58 was sys_ulimit */
-                                /* 59 was sys_olduname */
-#define __NR_umask              60
-#define __NR_chroot             61
-#define __NR_ustat              62
-#define __NR_dup2               63
-#define __NR_getppid            64
-#define __NR_getpgrp            65
-#define __NR_setsid             66
-#define __NR_sigaction          67
-#define __NR_sgetmask           68
-#define __NR_ssetmask           69
-#define __NR_setreuid           70
-#define __NR_setregid           71
-#define __NR_sigsuspend                 72
-#define __NR_sigpending                 73
-#define __NR_sethostname        74
-#define __NR_setrlimit          75
-#define __NR_getrlimit          76     /* Back compatible 2Gig limited rlimit */
-#define __NR_getrusage          77
-#define __NR_gettimeofday       78
-#define __NR_settimeofday       79
-#define __NR_getgroups          80
-#define __NR_setgroups          81
-                                /* 82 was sys_oldselect */
-#define __NR_symlink            83
-#define __NR_oldlstat           84
-#define __NR_readlink           85
-#define __NR_uselib             86
-#define __NR_swapon             87
-#define __NR_reboot             88
-#define __NR_readdir            89
-#define __NR_mmap               90
-#define __NR_munmap             91
-#define __NR_truncate           92
-#define __NR_ftruncate          93
-#define __NR_fchmod             94
-#define __NR_fchown             95
-#define __NR_getpriority        96
-#define __NR_setpriority        97
-                                /* 98 was sys_profil */
-#define __NR_statfs             99
-#define __NR_fstatfs           100
-                               /* 101 was sys_ioperm */
-#define __NR_socketcall                102
-#define __NR_syslog            103
-#define __NR_setitimer         104
-#define __NR_getitimer         105
-#define __NR_stat              106
-#define __NR_lstat             107
-#define __NR_fstat             108
-#define __NR_olduname          109
-                               /* 110 was sys_iopl */
-#define __NR_vhangup           111
-                               /* 112 was sys_idle */
-                               /* 113 was sys_vm86old */
-#define __NR_wait4             114
-#define __NR_swapoff           115
-#define __NR_sysinfo           116
-#define __NR_ipc               117
-#define __NR_fsync             118
-#define __NR_sigreturn         119
-#define __NR_clone             120
-#define __NR_setdomainname     121
-#define __NR_uname             122
-#define __NR_cacheflush                123
-#define __NR_adjtimex          124
-#define __NR_mprotect          125
-#define __NR_sigprocmask       126
-                               /* 127 was sys_create_module */
-#define __NR_init_module       128
-#define __NR_delete_module     129
-                               /* 130 was sys_get_kernel_syms */
-#define __NR_quotactl          131
-#define __NR_getpgid           132
-#define __NR_fchdir            133
-#define __NR_bdflush           134
-#define __NR_sysfs             135
-#define __NR_personality       136
-                               /* 137 was sys_afs_syscall */
-#define __NR_setfsuid          138
-#define __NR_setfsgid          139
-#define __NR__llseek           140
-#define __NR_getdents          141
-#define __NR__newselect                142
-#define __NR_flock             143
-#define __NR_msync             144
-#define __NR_readv             145
-#define __NR_writev            146
-#define __NR_getsid            147
-#define __NR_fdatasync         148
-#define __NR__sysctl           149
-#define __NR_mlock             150
-#define __NR_munlock           151
-#define __NR_mlockall          152
-#define __NR_munlockall                153
-#define __NR_sched_setparam            154
-#define __NR_sched_getparam            155
-#define __NR_sched_setscheduler                156
-#define __NR_sched_getscheduler                157
-#define __NR_sched_yield               158
-#define __NR_sched_get_priority_max    159
-#define __NR_sched_get_priority_min    160
-#define __NR_sched_rr_get_interval     161
-#define __NR_nanosleep         162
-#define __NR_mremap            163
-#define __NR_setresuid         164
-#define __NR_getresuid         165
-                               /* 166 was sys_vm86 */
-                               /* 167 was sys_query_module */
-#define __NR_poll              168
-#define __NR_nfsservctl                169
-#define __NR_setresgid         170
-#define __NR_getresgid         171
-#define __NR_prctl              172
-#define __NR_rt_sigreturn      173
-#define __NR_rt_sigaction      174
-#define __NR_rt_sigprocmask    175
-#define __NR_rt_sigpending     176
-#define __NR_rt_sigtimedwait   177
-#define __NR_rt_sigqueueinfo   178
-#define __NR_rt_sigsuspend     179
-#define __NR_pread64           180
-#define __NR_pwrite64          181
-#define __NR_chown             182
-#define __NR_getcwd            183
-#define __NR_capget            184
-#define __NR_capset            185
-#define __NR_sigaltstack       186
-#define __NR_sendfile          187
-                               /* 188 reserved for sys_getpmsg */
-                               /* 189 reserved for sys_putpmsg */
-#define __NR_vfork             190
-#define __NR_ugetrlimit                191     /* SuS compliant getrlimit */
-#define __NR_mmap2             192
-#define __NR_truncate64                193
-#define __NR_ftruncate64       194
-#define __NR_stat64            195
-#define __NR_lstat64           196
-#define __NR_fstat64           197
-#define __NR_lchown32          198
-#define __NR_getuid32          199
-#define __NR_getgid32          200
-#define __NR_geteuid32         201
-#define __NR_getegid32         202
-#define __NR_setreuid32                203
-#define __NR_setregid32                204
-#define __NR_getgroups32       205
-#define __NR_setgroups32       206
-#define __NR_fchown32          207
-#define __NR_setresuid32       208
-#define __NR_getresuid32       209
-#define __NR_setresgid32       210
-#define __NR_getresgid32       211
-#define __NR_chown32           212
-#define __NR_setuid32          213
-#define __NR_setgid32          214
-#define __NR_setfsuid32                215
-#define __NR_setfsgid32                216
-#define __NR_pivot_root                217
-#define __NR_mincore           218
-#define __NR_madvise           219
-#define __NR_getdents64                220
-#define __NR_fcntl64           221
-                               /* 222 is reserved for tux */
-                               /* 223 is unused */
-#define __NR_gettid            224
-#define __NR_readahead         225
-#define __NR_setxattr          226
-#define __NR_lsetxattr         227
-#define __NR_fsetxattr         228
-#define __NR_getxattr          229
-#define __NR_lgetxattr         230
-#define __NR_fgetxattr         231
-#define __NR_listxattr         232
-#define __NR_llistxattr                233
-#define __NR_flistxattr                234
-#define __NR_removexattr       235
-#define __NR_lremovexattr      236
-#define __NR_fremovexattr      237
-#define __NR_tkill             238
-#define __NR_sendfile64                239
-#define __NR_futex             240
-#define __NR_sched_setaffinity 241
-#define __NR_sched_getaffinity 242
-                               /* 243 is reserved for set_thread_area */
-                               /* 244 is reserved for get_thread_area */
-#define __NR_io_setup          245
-#define __NR_io_destroy                246
-#define __NR_io_getevents      247
-#define __NR_io_submit         248
-#define __NR_io_cancel         249
-#define __NR_fadvise64         250
-                               /* 251 is unused */
-#define __NR_exit_group                252
-#define __NR_lookup_dcookie    253
-#define __NR_epoll_create      254
-#define __NR_epoll_ctl         255
-#define __NR_epoll_wait                256
-#define __NR_remap_file_pages  257
-#define __NR_set_tid_address   258
-#define __NR_timer_create      259
-#define __NR_timer_settime     (__NR_timer_create+1)
-#define __NR_timer_gettime     (__NR_timer_create+2)
-#define __NR_timer_getoverrun  (__NR_timer_create+3)
-#define __NR_timer_delete      (__NR_timer_create+4)
-#define __NR_clock_settime     (__NR_timer_create+5)
-#define __NR_clock_gettime     (__NR_timer_create+6)
-#define __NR_clock_getres      (__NR_timer_create+7)
-#define __NR_clock_nanosleep   (__NR_timer_create+8)
-#define __NR_statfs64          268
-#define __NR_fstatfs64         269
-#define __NR_tgkill            270
-#define __NR_utimes            271
-#define __NR_fadvise64_64      272
-                               /* 273 is reserved for vserver */
-#define __NR_mbind              274
-#define __NR_get_mempolicy      275
-#define __NR_set_mempolicy      276
-#define __NR_mq_open            277
-#define __NR_mq_unlink          (__NR_mq_open+1)
-#define __NR_mq_timedsend       (__NR_mq_open+2)
-#define __NR_mq_timedreceive    (__NR_mq_open+3)
-#define __NR_mq_notify          (__NR_mq_open+4)
-#define __NR_mq_getsetattr      (__NR_mq_open+5)
-#define __NR_kexec_load                283
-#define __NR_waitid            284
-#define __NR_add_key           285
-#define __NR_request_key       286
-#define __NR_keyctl            287
-#define __NR_ioprio_set                288
-#define __NR_ioprio_get                289
-#define __NR_inotify_init      290
-#define __NR_inotify_add_watch 291
-#define __NR_inotify_rm_watch  292
-                               /* 293 is unused */
-#define __NR_migrate_pages     294
-#define __NR_openat            295
-#define __NR_mkdirat           296
-#define __NR_mknodat           297
-#define __NR_fchownat          298
-#define __NR_futimesat         299
-#define __NR_fstatat64         300
-#define __NR_unlinkat          301
-#define __NR_renameat          302
-#define __NR_linkat            303
-#define __NR_symlinkat         304
-#define __NR_readlinkat                305
-#define __NR_fchmodat          306
-#define __NR_faccessat         307
-#define __NR_pselect6          308
-#define __NR_ppoll             309
-#define __NR_unshare           310
-#define __NR_set_robust_list   311
-#define __NR_get_robust_list   312
-#define __NR_splice            313
-#define __NR_sync_file_range   314
-#define __NR_tee               315
-#define __NR_vmsplice          316
-#define __NR_move_pages                317
-#define __NR_getcpu            318
-#define __NR_epoll_pwait       319
-#define __NR_utimensat         320
-#define __NR_signalfd          321
-#define __NR_timerfd_create    322
-#define __NR_eventfd           323
-#define __NR_fallocate         324
-#define __NR_timerfd_settime   325
-#define __NR_timerfd_gettime   326
-#define __NR_signalfd4         327
-#define __NR_eventfd2          328
-#define __NR_epoll_create1     329
-#define __NR_dup3              330
-#define __NR_pipe2             331
-#define __NR_inotify_init1     332
-#define __NR_preadv            333
-#define __NR_pwritev           334
-#define __NR_rt_tgsigqueueinfo 335
-#define __NR_perf_event_open   336
-#define __NR_fanotify_init     337
-#define __NR_fanotify_mark     338
-#define __NR_prlimit64         339
-
-/* Non-multiplexed socket family */
-#define __NR_socket            340
-#define __NR_bind              341
-#define __NR_connect           342
-#define __NR_listen            343
-#define __NR_accept            344
-#define __NR_getsockname       345
-#define __NR_getpeername       346
-#define __NR_socketpair                347
-#define __NR_send              348
-#define __NR_sendto            349
-#define __NR_recv              350
-#define __NR_recvfrom          351
-#define __NR_shutdown          352
-#define __NR_setsockopt                353
-#define __NR_getsockopt                354
-#define __NR_sendmsg           355
-#define __NR_recvmsg           356
-#define __NR_recvmmsg          357
-#define __NR_accept4           358
-#define __NR_name_to_handle_at 359
-#define __NR_open_by_handle_at 360
-#define __NR_clock_adjtime     361
-#define __NR_syncfs            362
-#define __NR_sendmmsg          363
-#define __NR_setns             364
-#define __NR_process_vm_readv  365
-#define __NR_process_vm_writev 366
-
-#define NR_syscalls 367
-
-#endif /* __ASM_SH_UNISTD_32_H */
diff --git a/arch/sh/include/asm/unistd_64.h b/arch/sh/include/asm/unistd_64.h
deleted file mode 100644 (file)
index a28edc3..0000000
+++ /dev/null
@@ -1,404 +0,0 @@
-#ifndef __ASM_SH_UNISTD_64_H
-#define __ASM_SH_UNISTD_64_H
-
-/*
- * include/asm-sh/unistd_64.h
- *
- * This file contains the system call numbers.
- *
- * Copyright (C) 2000, 2001  Paolo Alberelli
- * Copyright (C) 2003 - 2007 Paul Mundt
- * Copyright (C) 2004  Sean McGoogan
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#define __NR_restart_syscall     0
-#define __NR_exit                1
-#define __NR_fork                2
-#define __NR_read                3
-#define __NR_write               4
-#define __NR_open                5
-#define __NR_close               6
-#define __NR_waitpid             7
-#define __NR_creat               8
-#define __NR_link                9
-#define __NR_unlink             10
-#define __NR_execve             11
-#define __NR_chdir              12
-#define __NR_time               13
-#define __NR_mknod              14
-#define __NR_chmod              15
-#define __NR_lchown             16
-                                /* 17 was sys_break */
-#define __NR_oldstat            18
-#define __NR_lseek              19
-#define __NR_getpid             20
-#define __NR_mount              21
-#define __NR_umount             22
-#define __NR_setuid             23
-#define __NR_getuid             24
-#define __NR_stime              25
-#define __NR_ptrace             26
-#define __NR_alarm              27
-#define __NR_oldfstat           28
-#define __NR_pause              29
-#define __NR_utime              30
-                                /* 31 was sys_stty */
-                                /* 32 was sys_gtty */
-#define __NR_access             33
-#define __NR_nice               34
-                                /* 35 was sys_ftime */
-#define __NR_sync               36
-#define __NR_kill               37
-#define __NR_rename             38
-#define __NR_mkdir              39
-#define __NR_rmdir              40
-#define __NR_dup                41
-#define __NR_pipe               42
-#define __NR_times              43
-                                /* 44 was sys_prof */
-#define __NR_brk                45
-#define __NR_setgid             46
-#define __NR_getgid             47
-#define __NR_signal             48
-#define __NR_geteuid            49
-#define __NR_getegid            50
-#define __NR_acct               51
-#define __NR_umount2            52
-                                /* 53 was sys_lock */
-#define __NR_ioctl              54
-#define __NR_fcntl              55
-                                /* 56 was sys_mpx */
-#define __NR_setpgid            57
-                                /* 58 was sys_ulimit */
-                                /* 59 was sys_olduname */
-#define __NR_umask              60
-#define __NR_chroot             61
-#define __NR_ustat              62
-#define __NR_dup2               63
-#define __NR_getppid            64
-#define __NR_getpgrp            65
-#define __NR_setsid             66
-#define __NR_sigaction          67
-#define __NR_sgetmask           68
-#define __NR_ssetmask           69
-#define __NR_setreuid           70
-#define __NR_setregid           71
-#define __NR_sigsuspend                 72
-#define __NR_sigpending                 73
-#define __NR_sethostname        74
-#define __NR_setrlimit          75
-#define __NR_getrlimit          76     /* Back compatible 2Gig limited rlimit */
-#define __NR_getrusage          77
-#define __NR_gettimeofday       78
-#define __NR_settimeofday       79
-#define __NR_getgroups          80
-#define __NR_setgroups          81
-                                /* 82 was sys_select */
-#define __NR_symlink            83
-#define __NR_oldlstat           84
-#define __NR_readlink           85
-#define __NR_uselib             86
-#define __NR_swapon             87
-#define __NR_reboot             88
-#define __NR_readdir            89
-#define __NR_mmap               90
-#define __NR_munmap             91
-#define __NR_truncate           92
-#define __NR_ftruncate          93
-#define __NR_fchmod             94
-#define __NR_fchown             95
-#define __NR_getpriority        96
-#define __NR_setpriority        97
-                                /* 98 was sys_profil */
-#define __NR_statfs             99
-#define __NR_fstatfs           100
-                               /* 101 was sys_ioperm */
-#define __NR_socketcall                102     /* old implementation of socket systemcall */
-#define __NR_syslog            103
-#define __NR_setitimer         104
-#define __NR_getitimer         105
-#define __NR_stat              106
-#define __NR_lstat             107
-#define __NR_fstat             108
-#define __NR_olduname          109
-                               /* 110 was sys_iopl */
-#define __NR_vhangup           111
-                               /* 112 was sys_idle */
-                               /* 113 was sys_vm86old */
-#define __NR_wait4             114
-#define __NR_swapoff           115
-#define __NR_sysinfo           116
-#define __NR_ipc               117
-#define __NR_fsync             118
-#define __NR_sigreturn         119
-#define __NR_clone             120
-#define __NR_setdomainname     121
-#define __NR_uname             122
-#define __NR_cacheflush                123
-#define __NR_adjtimex          124
-#define __NR_mprotect          125
-#define __NR_sigprocmask       126
-                               /* 127 was sys_create_module */
-#define __NR_init_module       128
-#define __NR_delete_module     129
-                               /* 130 was sys_get_kernel_syms */
-#define __NR_quotactl          131
-#define __NR_getpgid           132
-#define __NR_fchdir            133
-#define __NR_bdflush           134
-#define __NR_sysfs             135
-#define __NR_personality       136
-                               /* 137 was sys_afs_syscall */
-#define __NR_setfsuid          138
-#define __NR_setfsgid          139
-#define __NR__llseek           140
-#define __NR_getdents          141
-#define __NR__newselect                142
-#define __NR_flock             143
-#define __NR_msync             144
-#define __NR_readv             145
-#define __NR_writev            146
-#define __NR_getsid            147
-#define __NR_fdatasync         148
-#define __NR__sysctl           149
-#define __NR_mlock             150
-#define __NR_munlock           151
-#define __NR_mlockall          152
-#define __NR_munlockall                153
-#define __NR_sched_setparam            154
-#define __NR_sched_getparam            155
-#define __NR_sched_setscheduler                156
-#define __NR_sched_getscheduler                157
-#define __NR_sched_yield               158
-#define __NR_sched_get_priority_max    159
-#define __NR_sched_get_priority_min    160
-#define __NR_sched_rr_get_interval     161
-#define __NR_nanosleep         162
-#define __NR_mremap            163
-#define __NR_setresuid         164
-#define __NR_getresuid         165
-                               /* 166 was sys_vm86 */
-                               /* 167 was sys_query_module */
-#define __NR_poll              168
-#define __NR_nfsservctl                169
-#define __NR_setresgid         170
-#define __NR_getresgid         171
-#define __NR_prctl              172
-#define __NR_rt_sigreturn      173
-#define __NR_rt_sigaction      174
-#define __NR_rt_sigprocmask    175
-#define __NR_rt_sigpending     176
-#define __NR_rt_sigtimedwait   177
-#define __NR_rt_sigqueueinfo   178
-#define __NR_rt_sigsuspend     179
-#define __NR_pread64           180
-#define __NR_pwrite64          181
-#define __NR_chown             182
-#define __NR_getcwd            183
-#define __NR_capget            184
-#define __NR_capset            185
-#define __NR_sigaltstack       186
-#define __NR_sendfile          187
-                               /* 188 reserved for getpmsg */
-                               /* 189 reserved for putpmsg */
-#define __NR_vfork             190
-#define __NR_ugetrlimit                191     /* SuS compliant getrlimit */
-#define __NR_mmap2             192
-#define __NR_truncate64                193
-#define __NR_ftruncate64       194
-#define __NR_stat64            195
-#define __NR_lstat64           196
-#define __NR_fstat64           197
-#define __NR_lchown32          198
-#define __NR_getuid32          199
-#define __NR_getgid32          200
-#define __NR_geteuid32         201
-#define __NR_getegid32         202
-#define __NR_setreuid32                203
-#define __NR_setregid32                204
-#define __NR_getgroups32       205
-#define __NR_setgroups32       206
-#define __NR_fchown32          207
-#define __NR_setresuid32       208
-#define __NR_getresuid32       209
-#define __NR_setresgid32       210
-#define __NR_getresgid32       211
-#define __NR_chown32           212
-#define __NR_setuid32          213
-#define __NR_setgid32          214
-#define __NR_setfsuid32                215
-#define __NR_setfsgid32                216
-#define __NR_pivot_root                217
-#define __NR_mincore           218
-#define __NR_madvise           219
-
-/* Non-multiplexed socket family */
-#define __NR_socket            220
-#define __NR_bind              221
-#define __NR_connect           222
-#define __NR_listen            223
-#define __NR_accept            224
-#define __NR_getsockname       225
-#define __NR_getpeername       226
-#define __NR_socketpair                227
-#define __NR_send              228
-#define __NR_sendto            229
-#define __NR_recv              230
-#define __NR_recvfrom          231
-#define __NR_shutdown          232
-#define __NR_setsockopt                233
-#define __NR_getsockopt                234
-#define __NR_sendmsg           235
-#define __NR_recvmsg           236
-
-/* Non-multiplexed IPC family */
-#define __NR_semop             237
-#define __NR_semget            238
-#define __NR_semctl            239
-#define __NR_msgsnd            240
-#define __NR_msgrcv            241
-#define __NR_msgget            242
-#define __NR_msgctl            243
-#define __NR_shmat             244
-#define __NR_shmdt             245
-#define __NR_shmget            246
-#define __NR_shmctl            247
-
-#define __NR_getdents64                248
-#define __NR_fcntl64           249
-                               /* 250 is reserved for tux */
-                               /* 251 is unused */
-#define __NR_gettid            252
-#define __NR_readahead         253
-#define __NR_setxattr          254
-#define __NR_lsetxattr         255
-#define __NR_fsetxattr         256
-#define __NR_getxattr          257
-#define __NR_lgetxattr         258
-#define __NR_fgetxattr         269
-#define __NR_listxattr         260
-#define __NR_llistxattr                261
-#define __NR_flistxattr                262
-#define __NR_removexattr       263
-#define __NR_lremovexattr      264
-#define __NR_fremovexattr      265
-#define __NR_tkill             266
-#define __NR_sendfile64                267
-#define __NR_futex             268
-#define __NR_sched_setaffinity 269
-#define __NR_sched_getaffinity 270
-                               /* 271 is reserved for set_thread_area */
-                               /* 272 is reserved for get_thread_area */
-#define __NR_io_setup          273
-#define __NR_io_destroy                274
-#define __NR_io_getevents      275
-#define __NR_io_submit         276
-#define __NR_io_cancel         277
-#define __NR_fadvise64         278
-                               /* 279 is unused */
-#define __NR_exit_group                280
-
-#define __NR_lookup_dcookie    281
-#define __NR_epoll_create      282
-#define __NR_epoll_ctl         283
-#define __NR_epoll_wait                284
-#define __NR_remap_file_pages  285
-#define __NR_set_tid_address   286
-#define __NR_timer_create      287
-#define __NR_timer_settime     (__NR_timer_create+1)
-#define __NR_timer_gettime     (__NR_timer_create+2)
-#define __NR_timer_getoverrun  (__NR_timer_create+3)
-#define __NR_timer_delete      (__NR_timer_create+4)
-#define __NR_clock_settime     (__NR_timer_create+5)
-#define __NR_clock_gettime     (__NR_timer_create+6)
-#define __NR_clock_getres      (__NR_timer_create+7)
-#define __NR_clock_nanosleep   (__NR_timer_create+8)
-#define __NR_statfs64          296
-#define __NR_fstatfs64         297
-#define __NR_tgkill            298
-#define __NR_utimes            299
-#define __NR_fadvise64_64      300
-                               /* 301 is reserved for vserver */
-                               /* 302 is reserved for mbind */
-                               /* 303 is reserved for get_mempolicy */
-                               /* 304 is reserved for set_mempolicy */
-#define __NR_mq_open            305
-#define __NR_mq_unlink          (__NR_mq_open+1)
-#define __NR_mq_timedsend       (__NR_mq_open+2)
-#define __NR_mq_timedreceive    (__NR_mq_open+3)
-#define __NR_mq_notify          (__NR_mq_open+4)
-#define __NR_mq_getsetattr      (__NR_mq_open+5)
-                               /* 311 is reserved for kexec */
-#define __NR_waitid            312
-#define __NR_add_key           313
-#define __NR_request_key       314
-#define __NR_keyctl            315
-#define __NR_ioprio_set                316
-#define __NR_ioprio_get                317
-#define __NR_inotify_init      318
-#define __NR_inotify_add_watch 319
-#define __NR_inotify_rm_watch  320
-                               /* 321 is unused */
-#define __NR_migrate_pages     322
-#define __NR_openat            323
-#define __NR_mkdirat           324
-#define __NR_mknodat           325
-#define __NR_fchownat          326
-#define __NR_futimesat         327
-#define __NR_fstatat64         328
-#define __NR_unlinkat          329
-#define __NR_renameat          330
-#define __NR_linkat            331
-#define __NR_symlinkat         332
-#define __NR_readlinkat                333
-#define __NR_fchmodat          334
-#define __NR_faccessat         335
-#define __NR_pselect6          336
-#define __NR_ppoll             337
-#define __NR_unshare           338
-#define __NR_set_robust_list   339
-#define __NR_get_robust_list   340
-#define __NR_splice            341
-#define __NR_sync_file_range   342
-#define __NR_tee               343
-#define __NR_vmsplice          344
-#define __NR_move_pages                345
-#define __NR_getcpu            346
-#define __NR_epoll_pwait       347
-#define __NR_utimensat         348
-#define __NR_signalfd          349
-#define __NR_timerfd_create    350
-#define __NR_eventfd           351
-#define __NR_fallocate         352
-#define __NR_timerfd_settime   353
-#define __NR_timerfd_gettime   354
-#define __NR_signalfd4         355
-#define __NR_eventfd2          356
-#define __NR_epoll_create1     357
-#define __NR_dup3              358
-#define __NR_pipe2             359
-#define __NR_inotify_init1     360
-#define __NR_preadv            361
-#define __NR_pwritev           362
-#define __NR_rt_tgsigqueueinfo 363
-#define __NR_perf_event_open   364
-#define __NR_recvmmsg          365
-#define __NR_accept4           366
-#define __NR_fanotify_init     367
-#define __NR_fanotify_mark     368
-#define __NR_prlimit64         369
-#define __NR_name_to_handle_at 370
-#define __NR_open_by_handle_at 371
-#define __NR_clock_adjtime     372
-#define __NR_syncfs            373
-#define __NR_sendmmsg          374
-#define __NR_setns             375
-#define __NR_process_vm_readv  376
-#define __NR_process_vm_writev 377
-
-#define NR_syscalls 378
-
-#endif /* __ASM_SH_UNISTD_64_H */
index baebb3da1d44160fc6f6f259886656e6f494b167..60613ae78513a0c60ed146e9d11a0cf734adc4d0 100644 (file)
@@ -1,3 +1,25 @@
 # UAPI Header export list
 include include/uapi/asm-generic/Kbuild.asm
 
+header-y += auxvec.h
+header-y += byteorder.h
+header-y += cachectl.h
+header-y += cpu-features.h
+header-y += hw_breakpoint.h
+header-y += ioctls.h
+header-y += posix_types.h
+header-y += posix_types_32.h
+header-y += posix_types_64.h
+header-y += ptrace.h
+header-y += ptrace_32.h
+header-y += ptrace_64.h
+header-y += setup.h
+header-y += sigcontext.h
+header-y += signal.h
+header-y += sockios.h
+header-y += stat.h
+header-y += swab.h
+header-y += types.h
+header-y += unistd.h
+header-y += unistd_32.h
+header-y += unistd_64.h
diff --git a/arch/sh/include/uapi/asm/auxvec.h b/arch/sh/include/uapi/asm/auxvec.h
new file mode 100644 (file)
index 0000000..8bcc51a
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef __ASM_SH_AUXVEC_H
+#define __ASM_SH_AUXVEC_H
+
+/*
+ * Architecture-neutral AT_ values in 0-17, leave some room
+ * for more of them.
+ */
+
+/*
+ * This entry gives some information about the FPU initialization
+ * performed by the kernel.
+ */
+#define AT_FPUCW               18      /* Used FPU control word.  */
+
+#if defined(CONFIG_VSYSCALL) || !defined(__KERNEL__)
+/*
+ * Only define this in the vsyscall case, the entry point to
+ * the vsyscall page gets placed here. The kernel will attempt
+ * to build a gate VMA we don't care about otherwise..
+ */
+#define AT_SYSINFO_EHDR                33
+#endif
+
+/*
+ * More complete cache descriptions than AT_[DIU]CACHEBSIZE.  If the
+ * value is -1, then the cache doesn't exist.  Otherwise:
+ *
+ *    bit 0-3:   Cache set-associativity; 0 means fully associative.
+ *    bit 4-7:   Log2 of cacheline size.
+ *    bit 8-31:          Size of the entire cache >> 8.
+ */
+#define AT_L1I_CACHESHAPE      34
+#define AT_L1D_CACHESHAPE      35
+#define AT_L2_CACHESHAPE       36
+
+#define AT_VECTOR_SIZE_ARCH 5 /* entries in ARCH_DLINFO */
+
+#endif /* __ASM_SH_AUXVEC_H */
diff --git a/arch/sh/include/uapi/asm/byteorder.h b/arch/sh/include/uapi/asm/byteorder.h
new file mode 100644 (file)
index 0000000..db2f5d7
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef __ASM_SH_BYTEORDER_H
+#define __ASM_SH_BYTEORDER_H
+
+#ifdef __LITTLE_ENDIAN__
+#include <linux/byteorder/little_endian.h>
+#else
+#include <linux/byteorder/big_endian.h>
+#endif
+
+#endif /* __ASM_SH_BYTEORDER_H */
diff --git a/arch/sh/include/uapi/asm/cachectl.h b/arch/sh/include/uapi/asm/cachectl.h
new file mode 100644 (file)
index 0000000..6ffb4b7
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef _SH_CACHECTL_H
+#define _SH_CACHECTL_H
+
+/* Definitions for the cacheflush system call.  */
+
+#define CACHEFLUSH_D_INVAL     0x1     /* invalidate (without write back) */
+#define CACHEFLUSH_D_WB                0x2     /* write back (without invalidate) */
+#define CACHEFLUSH_D_PURGE     0x3     /* writeback and invalidate */
+
+#define CACHEFLUSH_I           0x4
+
+/*
+ * Options for cacheflush system call
+ */
+#define ICACHE CACHEFLUSH_I            /* flush instruction cache */
+#define DCACHE CACHEFLUSH_D_PURGE      /* writeback and flush data cache */
+#define BCACHE (ICACHE|DCACHE)         /* flush both caches */
+
+#endif /* _SH_CACHECTL_H */
diff --git a/arch/sh/include/uapi/asm/cpu-features.h b/arch/sh/include/uapi/asm/cpu-features.h
new file mode 100644 (file)
index 0000000..694abe4
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef __ASM_SH_CPU_FEATURES_H
+#define __ASM_SH_CPU_FEATURES_H
+
+/*
+ * Processor flags
+ *
+ * Note: When adding a new flag, keep cpu_flags[] in
+ * arch/sh/kernel/setup.c in sync so symbolic name
+ * mapping of the processor flags has a chance of being
+ * reasonably accurate.
+ *
+ * These flags are also available through the ELF
+ * auxiliary vector as AT_HWCAP.
+ */
+#define CPU_HAS_FPU            0x0001  /* Hardware FPU support */
+#define CPU_HAS_P2_FLUSH_BUG   0x0002  /* Need to flush the cache in P2 area */
+#define CPU_HAS_MMU_PAGE_ASSOC 0x0004  /* SH3: TLB way selection bit support */
+#define CPU_HAS_DSP            0x0008  /* SH-DSP: DSP support */
+#define CPU_HAS_PERF_COUNTER   0x0010  /* Hardware performance counters */
+#define CPU_HAS_PTEA           0x0020  /* PTEA register */
+#define CPU_HAS_LLSC           0x0040  /* movli.l/movco.l */
+#define CPU_HAS_L2_CACHE       0x0080  /* Secondary cache / URAM */
+#define CPU_HAS_OP32           0x0100  /* 32-bit instruction support */
+#define CPU_HAS_PTEAEX         0x0200  /* PTE ASID Extension support */
+
+#endif /* __ASM_SH_CPU_FEATURES_H */
diff --git a/arch/sh/include/uapi/asm/hw_breakpoint.h b/arch/sh/include/uapi/asm/hw_breakpoint.h
new file mode 100644 (file)
index 0000000..ae5704f
--- /dev/null
@@ -0,0 +1,4 @@
+/*
+ * There isn't anything here anymore, but the file must not be empty or patch
+ * will delete it.
+ */
diff --git a/arch/sh/include/uapi/asm/ioctls.h b/arch/sh/include/uapi/asm/ioctls.h
new file mode 100644 (file)
index 0000000..a6769f3
--- /dev/null
@@ -0,0 +1,107 @@
+#ifndef __ASM_SH_IOCTLS_H
+#define __ASM_SH_IOCTLS_H
+
+#include <asm/ioctl.h>
+
+#define FIOCLEX                _IO('f', 1)
+#define FIONCLEX       _IO('f', 2)
+#define FIOASYNC       _IOW('f', 125, int)
+#define FIONBIO                _IOW('f', 126, int)
+#define FIONREAD       _IOR('f', 127, int)
+#define TIOCINQ                FIONREAD
+#define FIOQSIZE       _IOR('f', 128, loff_t)
+
+#define TCGETS         0x5401
+#define TCSETS         0x5402
+#define TCSETSW                0x5403
+#define TCSETSF                0x5404
+
+#define TCGETA         0x80127417      /* _IOR('t', 23, struct termio) */
+#define TCSETA         0x40127418      /* _IOW('t', 24, struct termio) */
+#define TCSETAW                0x40127419      /* _IOW('t', 25, struct termio) */
+#define TCSETAF                0x4012741C      /* _IOW('t', 28, struct termio) */
+
+#define TCSBRK         _IO('t', 29)
+#define TCXONC         _IO('t', 30)
+#define TCFLSH         _IO('t', 31)
+
+#define TIOCSWINSZ     0x40087467      /* _IOW('t', 103, struct winsize) */
+#define TIOCGWINSZ     0x80087468      /* _IOR('t', 104, struct winsize) */
+#define        TIOCSTART       _IO('t', 110)           /* start output, like ^Q */
+#define        TIOCSTOP        _IO('t', 111)           /* stop output, like ^S */
+#define TIOCOUTQ        _IOR('t', 115, int)     /* output queue size */
+
+#define TIOCSPGRP      _IOW('t', 118, int)
+#define TIOCGPGRP      _IOR('t', 119, int)
+
+#define TIOCEXCL       _IO('T', 12) /* 0x540C */
+#define TIOCNXCL       _IO('T', 13) /* 0x540D */
+#define TIOCSCTTY      _IO('T', 14) /* 0x540E */
+
+#define TIOCSTI                _IOW('T', 18, char) /* 0x5412 */
+#define TIOCMGET       _IOR('T', 21, unsigned int) /* 0x5415 */
+#define TIOCMBIS       _IOW('T', 22, unsigned int) /* 0x5416 */
+#define TIOCMBIC       _IOW('T', 23, unsigned int) /* 0x5417 */
+#define TIOCMSET       _IOW('T', 24, unsigned int) /* 0x5418 */
+# define TIOCM_LE      0x001
+# define TIOCM_DTR     0x002
+# define TIOCM_RTS     0x004
+# define TIOCM_ST      0x008
+# define TIOCM_SR      0x010
+# define TIOCM_CTS     0x020
+# define TIOCM_CAR     0x040
+# define TIOCM_RNG     0x080
+# define TIOCM_DSR     0x100
+# define TIOCM_CD      TIOCM_CAR
+# define TIOCM_RI      TIOCM_RNG
+
+#define TIOCGSOFTCAR   _IOR('T', 25, unsigned int) /* 0x5419 */
+#define TIOCSSOFTCAR   _IOW('T', 26, unsigned int) /* 0x541A */
+#define TIOCLINUX      _IOW('T', 28, char) /* 0x541C */
+#define TIOCCONS       _IO('T', 29) /* 0x541D */
+#define TIOCGSERIAL    0x803C541E      /* _IOR('T', 30, struct serial_struct) 0x541E */
+#define TIOCSSERIAL    0x403C541F      /* _IOW('T', 31, struct serial_struct) 0x541F */
+#define TIOCPKT                _IOW('T', 32, int) /* 0x5420 */
+# define TIOCPKT_DATA           0
+# define TIOCPKT_FLUSHREAD      1
+# define TIOCPKT_FLUSHWRITE     2
+# define TIOCPKT_STOP           4
+# define TIOCPKT_START          8
+# define TIOCPKT_NOSTOP                16
+# define TIOCPKT_DOSTOP                32
+# define TIOCPKT_IOCTL         64
+
+
+#define TIOCNOTTY      _IO('T', 34) /* 0x5422 */
+#define TIOCSETD       _IOW('T', 35, int) /* 0x5423 */
+#define TIOCGETD       _IOR('T', 36, int) /* 0x5424 */
+#define TCSBRKP                _IOW('T', 37, int) /* 0x5425 */ /* Needed for POSIX tcsendbreak() */
+#define TIOCSBRK       _IO('T', 39) /* 0x5427 */ /* BSD compatibility */
+#define TIOCCBRK       _IO('T', 40) /* 0x5428 */ /* BSD compatibility */
+#define TIOCGSID       _IOR('T', 41, pid_t) /* 0x5429 */ /* Return the session ID of FD */
+#define TCGETS2                _IOR('T', 42, struct termios2)
+#define TCSETS2                _IOW('T', 43, struct termios2)
+#define TCSETSW2       _IOW('T', 44, struct termios2)
+#define TCSETSF2       _IOW('T', 45, struct termios2)
+#define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
+#define TIOCGDEV       _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
+#define TIOCSIG                _IOW('T',0x36, int)  /* Generate signal on Pty slave */
+#define TIOCVHANGUP    _IO('T', 0x37)
+
+#define TIOCSERCONFIG  _IO('T', 83) /* 0x5453 */
+#define TIOCSERGWILD   _IOR('T', 84,  int) /* 0x5454 */
+#define TIOCSERSWILD   _IOW('T', 85,  int) /* 0x5455 */
+#define TIOCGLCKTRMIOS 0x5456
+#define TIOCSLCKTRMIOS 0x5457
+#define TIOCSERGSTRUCT 0x80d85458      /* _IOR('T', 88, struct async_struct) 0x5458 */ /* For debugging only */
+#define TIOCSERGETLSR   _IOR('T', 89, unsigned int) /* 0x5459 */ /* Get line status register */
+  /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+# define TIOCSER_TEMT    0x01  /* Transmitter physically empty */
+#define TIOCSERGETMULTI 0x80A8545A     /* _IOR('T', 90, struct serial_multiport_struct) 0x545A */ /* Get multiport config */
+#define TIOCSERSETMULTI 0x40A8545B     /* _IOW('T', 91, struct serial_multiport_struct) 0x545B */ /* Set multiport config */
+
+#define TIOCMIWAIT     _IO('T', 92) /* 0x545C */       /* wait for a change on serial input line(s) */
+#define TIOCGICOUNT    0x545D  /* read serial port inline interrupt counts */
+
+#endif /* __ASM_SH_IOCTLS_H */
diff --git a/arch/sh/include/uapi/asm/posix_types.h b/arch/sh/include/uapi/asm/posix_types.h
new file mode 100644 (file)
index 0000000..dc55e5a
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef __KERNEL__
+# ifdef __SH5__
+#  include <asm/posix_types_64.h>
+# else
+#  include <asm/posix_types_32.h>
+# endif
+#endif /* __KERNEL__ */
diff --git a/arch/sh/include/uapi/asm/posix_types_32.h b/arch/sh/include/uapi/asm/posix_types_32.h
new file mode 100644 (file)
index 0000000..ba0bdc4
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef __ASM_SH_POSIX_TYPES_32_H
+#define __ASM_SH_POSIX_TYPES_32_H
+
+typedef unsigned short __kernel_mode_t;
+#define __kernel_mode_t __kernel_mode_t
+typedef unsigned short __kernel_ipc_pid_t;
+#define __kernel_ipc_pid_t __kernel_ipc_pid_t
+typedef unsigned short __kernel_uid_t;
+#define __kernel_uid_t __kernel_uid_t
+typedef unsigned short __kernel_gid_t;
+#define __kernel_gid_t __kernel_gid_t
+
+typedef unsigned short __kernel_old_uid_t;
+#define __kernel_old_uid_t __kernel_old_uid_t
+typedef unsigned short __kernel_old_gid_t;
+#define __kernel_old_gid_t __kernel_old_gid_t
+typedef unsigned short __kernel_old_dev_t;
+#define __kernel_old_dev_t __kernel_old_dev_t
+
+#include <asm-generic/posix_types.h>
+
+#endif /* __ASM_SH_POSIX_TYPES_32_H */
diff --git a/arch/sh/include/uapi/asm/posix_types_64.h b/arch/sh/include/uapi/asm/posix_types_64.h
new file mode 100644 (file)
index 0000000..244f7e9
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef __ASM_SH_POSIX_TYPES_64_H
+#define __ASM_SH_POSIX_TYPES_64_H
+
+typedef unsigned short __kernel_mode_t;
+#define __kernel_mode_t __kernel_mode_t
+typedef unsigned short __kernel_ipc_pid_t;
+#define __kernel_ipc_pid_t __kernel_ipc_pid_t
+typedef unsigned short __kernel_uid_t;
+#define __kernel_uid_t __kernel_uid_t
+typedef unsigned short __kernel_gid_t;
+#define __kernel_gid_t __kernel_gid_t
+typedef long unsigned int      __kernel_size_t;
+#define __kernel_size_t __kernel_size_t
+typedef int            __kernel_ssize_t;
+#define __kernel_ssize_t __kernel_ssize_t
+typedef int            __kernel_ptrdiff_t;
+#define __kernel_ptrdiff_t __kernel_ptrdiff_t
+
+typedef unsigned short __kernel_old_uid_t;
+#define __kernel_old_uid_t __kernel_old_uid_t
+typedef unsigned short __kernel_old_gid_t;
+#define __kernel_old_gid_t __kernel_old_gid_t
+typedef unsigned short __kernel_old_dev_t;
+#define __kernel_old_dev_t __kernel_old_dev_t
+
+#include <asm-generic/posix_types.h>
+
+#endif /* __ASM_SH_POSIX_TYPES_64_H */
diff --git a/arch/sh/include/uapi/asm/ptrace.h b/arch/sh/include/uapi/asm/ptrace.h
new file mode 100644 (file)
index 0000000..8b8c5ac
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 1999, 2000  Niibe Yutaka
+ */
+#ifndef _UAPI__ASM_SH_PTRACE_H
+#define _UAPI__ASM_SH_PTRACE_H
+
+
+#define PTRACE_GETREGS         12      /* General registers */
+#define PTRACE_SETREGS         13
+
+#define PTRACE_GETFPREGS       14      /* FPU registers */
+#define PTRACE_SETFPREGS       15
+
+#define PTRACE_GETFDPIC                31      /* get the ELF fdpic loadmap address */
+
+#define PTRACE_GETFDPIC_EXEC   0       /* [addr] request the executable loadmap */
+#define PTRACE_GETFDPIC_INTERP 1       /* [addr] request the interpreter loadmap */
+
+#define        PTRACE_GETDSPREGS       55      /* DSP registers */
+#define        PTRACE_SETDSPREGS       56
+
+#define PT_TEXT_END_ADDR       240
+#define PT_TEXT_ADDR           244     /* &(struct user)->start_code */
+#define PT_DATA_ADDR           248     /* &(struct user)->start_data */
+#define PT_TEXT_LEN            252
+
+#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
+#include <asm/ptrace_64.h>
+#else
+#include <asm/ptrace_32.h>
+#endif
+
+
+#endif /* _UAPI__ASM_SH_PTRACE_H */
diff --git a/arch/sh/include/uapi/asm/ptrace_32.h b/arch/sh/include/uapi/asm/ptrace_32.h
new file mode 100644 (file)
index 0000000..926e0ce
--- /dev/null
@@ -0,0 +1,77 @@
+#ifndef _UAPI__ASM_SH_PTRACE_32_H
+#define _UAPI__ASM_SH_PTRACE_32_H
+
+/*
+ * GCC defines register number like this:
+ * -----------------------------
+ *      0 - 15 are integer registers
+ *     17 - 22 are control/special registers
+ *     24 - 39 fp registers
+ *     40 - 47 xd registers
+ *     48 -    fpscr register
+ * -----------------------------
+ *
+ * We follows above, except:
+ *     16 --- program counter (PC)
+ *     22 --- syscall #
+ *     23 --- floating point communication register
+ */
+#define REG_REG0        0
+#define REG_REG15      15
+
+#define REG_PC         16
+
+#define REG_PR         17
+#define REG_SR         18
+#define REG_GBR                19
+#define REG_MACH       20
+#define REG_MACL       21
+
+#define REG_SYSCALL    22
+
+#define REG_FPREG0     23
+#define REG_FPREG15    38
+#define REG_XFREG0     39
+#define REG_XFREG15    54
+
+#define REG_FPSCR      55
+#define REG_FPUL       56
+
+/*
+ * This struct defines the way the registers are stored on the
+ * kernel stack during a system call or other kernel entry.
+ */
+struct pt_regs {
+       unsigned long regs[16];
+       unsigned long pc;
+       unsigned long pr;
+       unsigned long sr;
+       unsigned long gbr;
+       unsigned long mach;
+       unsigned long macl;
+       long tra;
+};
+
+/*
+ * This struct defines the way the DSP registers are stored on the
+ * kernel stack during a system call or other kernel entry.
+ */
+struct pt_dspregs {
+       unsigned long   a1;
+       unsigned long   a0g;
+       unsigned long   a1g;
+       unsigned long   m0;
+       unsigned long   m1;
+       unsigned long   a0;
+       unsigned long   x0;
+       unsigned long   x1;
+       unsigned long   y0;
+       unsigned long   y1;
+       unsigned long   dsr;
+       unsigned long   rs;
+       unsigned long   re;
+       unsigned long   mod;
+};
+
+
+#endif /* _UAPI__ASM_SH_PTRACE_32_H */
diff --git a/arch/sh/include/uapi/asm/ptrace_64.h b/arch/sh/include/uapi/asm/ptrace_64.h
new file mode 100644 (file)
index 0000000..0e52ee8
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef _UAPI__ASM_SH_PTRACE_64_H
+#define _UAPI__ASM_SH_PTRACE_64_H
+
+struct pt_regs {
+       unsigned long long pc;
+       unsigned long long sr;
+       long long syscall_nr;
+       unsigned long long regs[63];
+       unsigned long long tregs[8];
+       unsigned long long pad[2];
+};
+
+
+#endif /* _UAPI__ASM_SH_PTRACE_64_H */
diff --git a/arch/sh/include/uapi/asm/setup.h b/arch/sh/include/uapi/asm/setup.h
new file mode 100644 (file)
index 0000000..552df83
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/setup.h>
diff --git a/arch/sh/include/uapi/asm/sigcontext.h b/arch/sh/include/uapi/asm/sigcontext.h
new file mode 100644 (file)
index 0000000..8ce1435
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef __ASM_SH_SIGCONTEXT_H
+#define __ASM_SH_SIGCONTEXT_H
+
+struct sigcontext {
+       unsigned long   oldmask;
+
+#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
+       /* CPU registers */
+       unsigned long long sc_regs[63];
+       unsigned long long sc_tregs[8];
+       unsigned long long sc_pc;
+       unsigned long long sc_sr;
+
+       /* FPU registers */
+       unsigned long long sc_fpregs[32];
+       unsigned int sc_fpscr;
+       unsigned int sc_fpvalid;
+#else
+       /* CPU registers */
+       unsigned long sc_regs[16];
+       unsigned long sc_pc;
+       unsigned long sc_pr;
+       unsigned long sc_sr;
+       unsigned long sc_gbr;
+       unsigned long sc_mach;
+       unsigned long sc_macl;
+
+#if defined(__SH4__) || defined(CONFIG_CPU_SH4) || \
+    defined(__SH2A__) || defined(CONFIG_CPU_SH2A)
+       /* FPU registers */
+       unsigned long sc_fpregs[16];
+       unsigned long sc_xfpregs[16];
+       unsigned int sc_fpscr;
+       unsigned int sc_fpul;
+       unsigned int sc_ownedfp;
+#endif
+#endif
+};
+
+#endif /* __ASM_SH_SIGCONTEXT_H */
diff --git a/arch/sh/include/uapi/asm/signal.h b/arch/sh/include/uapi/asm/signal.h
new file mode 100644 (file)
index 0000000..9ac530a
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef __ASM_SH_SIGNAL_H
+#define __ASM_SH_SIGNAL_H
+
+#define SA_RESTORER    0x04000000
+
+#include <asm-generic/signal.h>
+
+struct old_sigaction {
+       __sighandler_t sa_handler;
+       old_sigset_t sa_mask;
+       unsigned long sa_flags;
+       void (*sa_restorer)(void);
+};
+
+#endif /* __ASM_SH_SIGNAL_H */
diff --git a/arch/sh/include/uapi/asm/sockios.h b/arch/sh/include/uapi/asm/sockios.h
new file mode 100644 (file)
index 0000000..cf8b96b
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef __ASM_SH_SOCKIOS_H
+#define __ASM_SH_SOCKIOS_H
+
+/* Socket-level I/O control calls. */
+#define FIOGETOWN      _IOR('f', 123, int)
+#define FIOSETOWN      _IOW('f', 124, int)
+
+#define SIOCATMARK     _IOR('s', 7, int)
+#define SIOCSPGRP      _IOW('s', 8, pid_t)
+#define SIOCGPGRP      _IOR('s', 9, pid_t)
+
+#define SIOCGSTAMP     _IOR('s', 100, struct timeval) /* Get stamp (timeval) */
+#define SIOCGSTAMPNS   _IOR('s', 101, struct timespec) /* Get stamp (timespec) */
+#endif /* __ASM_SH_SOCKIOS_H */
diff --git a/arch/sh/include/uapi/asm/stat.h b/arch/sh/include/uapi/asm/stat.h
new file mode 100644 (file)
index 0000000..e1810cc
--- /dev/null
@@ -0,0 +1,138 @@
+#ifndef __ASM_SH_STAT_H
+#define __ASM_SH_STAT_H
+
+struct __old_kernel_stat {
+       unsigned short st_dev;
+       unsigned short st_ino;
+       unsigned short st_mode;
+       unsigned short st_nlink;
+       unsigned short st_uid;
+       unsigned short st_gid;
+       unsigned short st_rdev;
+       unsigned long  st_size;
+       unsigned long  st_atime;
+       unsigned long  st_mtime;
+       unsigned long  st_ctime;
+};
+
+#if defined(__SH5__) || defined(CONFIG_CPU_SH5)
+struct stat {
+       unsigned short st_dev;
+       unsigned short __pad1;
+       unsigned long st_ino;
+       unsigned short st_mode;
+       unsigned short st_nlink;
+       unsigned short st_uid;
+       unsigned short st_gid;
+       unsigned short st_rdev;
+       unsigned short __pad2;
+       unsigned long  st_size;
+       unsigned long  st_blksize;
+       unsigned long  st_blocks;
+       unsigned long  st_atime;
+       unsigned long  st_atime_nsec;
+       unsigned long  st_mtime;
+       unsigned long  st_mtime_nsec;
+       unsigned long  st_ctime;
+       unsigned long  st_ctime_nsec;
+       unsigned long  __unused4;
+       unsigned long  __unused5;
+};
+
+/* This matches struct stat64 in glibc2.1, hence the absolutely
+ * insane amounts of padding around dev_t's.
+ */
+struct stat64 {
+       unsigned short  st_dev;
+       unsigned char   __pad0[10];
+
+       unsigned long   st_ino;
+       unsigned int    st_mode;
+       unsigned int    st_nlink;
+
+       unsigned long   st_uid;
+       unsigned long   st_gid;
+
+       unsigned short  st_rdev;
+       unsigned char   __pad3[10];
+
+       long long       st_size;
+       unsigned long   st_blksize;
+
+       unsigned long   st_blocks;      /* Number 512-byte blocks allocated. */
+       unsigned long   __pad4;         /* future possible st_blocks high bits */
+
+       unsigned long   st_atime;
+       unsigned long   st_atime_nsec;
+
+       unsigned long   st_mtime;
+       unsigned long   st_mtime_nsec;
+
+       unsigned long   st_ctime;
+       unsigned long   st_ctime_nsec;  /* will be high 32 bits of ctime someday */
+
+       unsigned long   __unused1;
+       unsigned long   __unused2;
+};
+#else
+struct stat {
+       unsigned long  st_dev;
+       unsigned long  st_ino;
+       unsigned short st_mode;
+       unsigned short st_nlink;
+       unsigned short st_uid;
+       unsigned short st_gid;
+       unsigned long  st_rdev;
+       unsigned long  st_size;
+       unsigned long  st_blksize;
+       unsigned long  st_blocks;
+       unsigned long  st_atime;
+       unsigned long  st_atime_nsec;
+       unsigned long  st_mtime;
+       unsigned long  st_mtime_nsec;
+       unsigned long  st_ctime;
+       unsigned long  st_ctime_nsec;
+       unsigned long  __unused4;
+       unsigned long  __unused5;
+};
+
+/* This matches struct stat64 in glibc2.1, hence the absolutely
+ * insane amounts of padding around dev_t's.
+ */
+struct stat64 {
+       unsigned long long      st_dev;
+       unsigned char   __pad0[4];
+
+#define STAT64_HAS_BROKEN_ST_INO       1
+       unsigned long   __st_ino;
+
+       unsigned int    st_mode;
+       unsigned int    st_nlink;
+
+       unsigned long   st_uid;
+       unsigned long   st_gid;
+
+       unsigned long long      st_rdev;
+       unsigned char   __pad3[4];
+
+       long long       st_size;
+       unsigned long   st_blksize;
+
+       unsigned long long      st_blocks;      /* Number 512-byte blocks allocated. */
+
+       unsigned long   st_atime;
+       unsigned long   st_atime_nsec;
+
+       unsigned long   st_mtime;
+       unsigned long   st_mtime_nsec;
+
+       unsigned long   st_ctime;
+       unsigned long   st_ctime_nsec;
+
+       unsigned long long      st_ino;
+};
+
+#define STAT_HAVE_NSEC 1
+#endif
+
+#endif /* __ASM_SH_STAT_H */
diff --git a/arch/sh/include/uapi/asm/swab.h b/arch/sh/include/uapi/asm/swab.h
new file mode 100644 (file)
index 0000000..1cd0976
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef __ASM_SH_SWAB_H
+#define __ASM_SH_SWAB_H
+
+/*
+ * Copyright (C) 1999  Niibe Yutaka
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ */
+#include <linux/compiler.h>
+#include <linux/types.h>
+#include <asm-generic/swab.h>
+
+static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
+{
+       __asm__(
+#ifdef __SH5__
+               "byterev        %1, %0\n\t"
+               "shari          %0, 32, %0"
+#else
+               "swap.b         %1, %0\n\t"
+               "swap.w         %0, %0\n\t"
+               "swap.b         %0, %0"
+#endif
+               : "=r" (x)
+               : "r" (x));
+
+       return x;
+}
+#define __arch_swab32 __arch_swab32
+
+static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
+{
+       __asm__(
+#ifdef __SH5__
+               "byterev        %1, %0\n\t"
+               "shari          %0, 32, %0"
+#else
+               "swap.b         %1, %0"
+#endif
+               : "=r" (x)
+               :  "r" (x));
+
+       return x;
+}
+#define __arch_swab16 __arch_swab16
+
+static inline __u64 __arch_swab64(__u64 val)
+{
+       union {
+               struct { __u32 a,b; } s;
+               __u64 u;
+       } v, w;
+       v.u = val;
+       w.s.b = __arch_swab32(v.s.a);
+       w.s.a = __arch_swab32(v.s.b);
+       return w.u;
+}
+#define __arch_swab64 __arch_swab64
+
+#endif /* __ASM_SH_SWAB_H */
diff --git a/arch/sh/include/uapi/asm/types.h b/arch/sh/include/uapi/asm/types.h
new file mode 100644 (file)
index 0000000..b9e79bc
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/types.h>
diff --git a/arch/sh/include/uapi/asm/unistd.h b/arch/sh/include/uapi/asm/unistd.h
new file mode 100644 (file)
index 0000000..eeef88d
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef __KERNEL__
+# ifdef __SH5__
+#  include <asm/unistd_64.h>
+# else
+#  include <asm/unistd_32.h>
+# endif
+#endif
diff --git a/arch/sh/include/uapi/asm/unistd_32.h b/arch/sh/include/uapi/asm/unistd_32.h
new file mode 100644 (file)
index 0000000..9e465f2
--- /dev/null
@@ -0,0 +1,385 @@
+#ifndef __ASM_SH_UNISTD_32_H
+#define __ASM_SH_UNISTD_32_H
+
+/*
+ * Copyright (C) 1999  Niibe Yutaka
+ */
+
+/*
+ * This file contains the system call numbers.
+ */
+
+#define __NR_restart_syscall     0
+#define __NR_exit                1
+#define __NR_fork                2
+#define __NR_read                3
+#define __NR_write               4
+#define __NR_open                5
+#define __NR_close               6
+#define __NR_waitpid             7
+#define __NR_creat               8
+#define __NR_link                9
+#define __NR_unlink             10
+#define __NR_execve             11
+#define __NR_chdir              12
+#define __NR_time               13
+#define __NR_mknod              14
+#define __NR_chmod              15
+#define __NR_lchown             16
+                                /* 17 was sys_break */
+#define __NR_oldstat            18
+#define __NR_lseek              19
+#define __NR_getpid             20
+#define __NR_mount              21
+#define __NR_umount             22
+#define __NR_setuid             23
+#define __NR_getuid             24
+#define __NR_stime              25
+#define __NR_ptrace             26
+#define __NR_alarm              27
+#define __NR_oldfstat           28
+#define __NR_pause              29
+#define __NR_utime              30
+                                /* 31 was sys_stty */
+                                /* 32 was sys_gtty */
+#define __NR_access             33
+#define __NR_nice               34
+                                /* 35 was sys_ftime */
+#define __NR_sync               36
+#define __NR_kill               37
+#define __NR_rename             38
+#define __NR_mkdir              39
+#define __NR_rmdir              40
+#define __NR_dup                41
+#define __NR_pipe               42
+#define __NR_times              43
+                                /* 44 was sys_prof */
+#define __NR_brk                45
+#define __NR_setgid             46
+#define __NR_getgid             47
+#define __NR_signal             48
+#define __NR_geteuid            49
+#define __NR_getegid            50
+#define __NR_acct               51
+#define __NR_umount2            52
+                                /* 53 was sys_lock */
+#define __NR_ioctl              54
+#define __NR_fcntl              55
+                                /* 56 was sys_mpx */
+#define __NR_setpgid            57
+                                /* 58 was sys_ulimit */
+                                /* 59 was sys_olduname */
+#define __NR_umask              60
+#define __NR_chroot             61
+#define __NR_ustat              62
+#define __NR_dup2               63
+#define __NR_getppid            64
+#define __NR_getpgrp            65
+#define __NR_setsid             66
+#define __NR_sigaction          67
+#define __NR_sgetmask           68
+#define __NR_ssetmask           69
+#define __NR_setreuid           70
+#define __NR_setregid           71
+#define __NR_sigsuspend                 72
+#define __NR_sigpending                 73
+#define __NR_sethostname        74
+#define __NR_setrlimit          75
+#define __NR_getrlimit          76     /* Back compatible 2Gig limited rlimit */
+#define __NR_getrusage          77
+#define __NR_gettimeofday       78
+#define __NR_settimeofday       79
+#define __NR_getgroups          80
+#define __NR_setgroups          81
+                                /* 82 was sys_oldselect */
+#define __NR_symlink            83
+#define __NR_oldlstat           84
+#define __NR_readlink           85
+#define __NR_uselib             86
+#define __NR_swapon             87
+#define __NR_reboot             88
+#define __NR_readdir            89
+#define __NR_mmap               90
+#define __NR_munmap             91
+#define __NR_truncate           92
+#define __NR_ftruncate          93
+#define __NR_fchmod             94
+#define __NR_fchown             95
+#define __NR_getpriority        96
+#define __NR_setpriority        97
+                                /* 98 was sys_profil */
+#define __NR_statfs             99
+#define __NR_fstatfs           100
+                               /* 101 was sys_ioperm */
+#define __NR_socketcall                102
+#define __NR_syslog            103
+#define __NR_setitimer         104
+#define __NR_getitimer         105
+#define __NR_stat              106
+#define __NR_lstat             107
+#define __NR_fstat             108
+#define __NR_olduname          109
+                               /* 110 was sys_iopl */
+#define __NR_vhangup           111
+                               /* 112 was sys_idle */
+                               /* 113 was sys_vm86old */
+#define __NR_wait4             114
+#define __NR_swapoff           115
+#define __NR_sysinfo           116
+#define __NR_ipc               117
+#define __NR_fsync             118
+#define __NR_sigreturn         119
+#define __NR_clone             120
+#define __NR_setdomainname     121
+#define __NR_uname             122
+#define __NR_cacheflush                123
+#define __NR_adjtimex          124
+#define __NR_mprotect          125
+#define __NR_sigprocmask       126
+                               /* 127 was sys_create_module */
+#define __NR_init_module       128
+#define __NR_delete_module     129
+                               /* 130 was sys_get_kernel_syms */
+#define __NR_quotactl          131
+#define __NR_getpgid           132
+#define __NR_fchdir            133
+#define __NR_bdflush           134
+#define __NR_sysfs             135
+#define __NR_personality       136
+                               /* 137 was sys_afs_syscall */
+#define __NR_setfsuid          138
+#define __NR_setfsgid          139
+#define __NR__llseek           140
+#define __NR_getdents          141
+#define __NR__newselect                142
+#define __NR_flock             143
+#define __NR_msync             144
+#define __NR_readv             145
+#define __NR_writev            146
+#define __NR_getsid            147
+#define __NR_fdatasync         148
+#define __NR__sysctl           149
+#define __NR_mlock             150
+#define __NR_munlock           151
+#define __NR_mlockall          152
+#define __NR_munlockall                153
+#define __NR_sched_setparam            154
+#define __NR_sched_getparam            155
+#define __NR_sched_setscheduler                156
+#define __NR_sched_getscheduler                157
+#define __NR_sched_yield               158
+#define __NR_sched_get_priority_max    159
+#define __NR_sched_get_priority_min    160
+#define __NR_sched_rr_get_interval     161
+#define __NR_nanosleep         162
+#define __NR_mremap            163
+#define __NR_setresuid         164
+#define __NR_getresuid         165
+                               /* 166 was sys_vm86 */
+                               /* 167 was sys_query_module */
+#define __NR_poll              168
+#define __NR_nfsservctl                169
+#define __NR_setresgid         170
+#define __NR_getresgid         171
+#define __NR_prctl              172
+#define __NR_rt_sigreturn      173
+#define __NR_rt_sigaction      174
+#define __NR_rt_sigprocmask    175
+#define __NR_rt_sigpending     176
+#define __NR_rt_sigtimedwait   177
+#define __NR_rt_sigqueueinfo   178
+#define __NR_rt_sigsuspend     179
+#define __NR_pread64           180
+#define __NR_pwrite64          181
+#define __NR_chown             182
+#define __NR_getcwd            183
+#define __NR_capget            184
+#define __NR_capset            185
+#define __NR_sigaltstack       186
+#define __NR_sendfile          187
+                               /* 188 reserved for sys_getpmsg */
+                               /* 189 reserved for sys_putpmsg */
+#define __NR_vfork             190
+#define __NR_ugetrlimit                191     /* SuS compliant getrlimit */
+#define __NR_mmap2             192
+#define __NR_truncate64                193
+#define __NR_ftruncate64       194
+#define __NR_stat64            195
+#define __NR_lstat64           196
+#define __NR_fstat64           197
+#define __NR_lchown32          198
+#define __NR_getuid32          199
+#define __NR_getgid32          200
+#define __NR_geteuid32         201
+#define __NR_getegid32         202
+#define __NR_setreuid32                203
+#define __NR_setregid32                204
+#define __NR_getgroups32       205
+#define __NR_setgroups32       206
+#define __NR_fchown32          207
+#define __NR_setresuid32       208
+#define __NR_getresuid32       209
+#define __NR_setresgid32       210
+#define __NR_getresgid32       211
+#define __NR_chown32           212
+#define __NR_setuid32          213
+#define __NR_setgid32          214
+#define __NR_setfsuid32                215
+#define __NR_setfsgid32                216
+#define __NR_pivot_root                217
+#define __NR_mincore           218
+#define __NR_madvise           219
+#define __NR_getdents64                220
+#define __NR_fcntl64           221
+                               /* 222 is reserved for tux */
+                               /* 223 is unused */
+#define __NR_gettid            224
+#define __NR_readahead         225
+#define __NR_setxattr          226
+#define __NR_lsetxattr         227
+#define __NR_fsetxattr         228
+#define __NR_getxattr          229
+#define __NR_lgetxattr         230
+#define __NR_fgetxattr         231
+#define __NR_listxattr         232
+#define __NR_llistxattr                233
+#define __NR_flistxattr                234
+#define __NR_removexattr       235
+#define __NR_lremovexattr      236
+#define __NR_fremovexattr      237
+#define __NR_tkill             238
+#define __NR_sendfile64                239
+#define __NR_futex             240
+#define __NR_sched_setaffinity 241
+#define __NR_sched_getaffinity 242
+                               /* 243 is reserved for set_thread_area */
+                               /* 244 is reserved for get_thread_area */
+#define __NR_io_setup          245
+#define __NR_io_destroy                246
+#define __NR_io_getevents      247
+#define __NR_io_submit         248
+#define __NR_io_cancel         249
+#define __NR_fadvise64         250
+                               /* 251 is unused */
+#define __NR_exit_group                252
+#define __NR_lookup_dcookie    253
+#define __NR_epoll_create      254
+#define __NR_epoll_ctl         255
+#define __NR_epoll_wait                256
+#define __NR_remap_file_pages  257
+#define __NR_set_tid_address   258
+#define __NR_timer_create      259
+#define __NR_timer_settime     (__NR_timer_create+1)
+#define __NR_timer_gettime     (__NR_timer_create+2)
+#define __NR_timer_getoverrun  (__NR_timer_create+3)
+#define __NR_timer_delete      (__NR_timer_create+4)
+#define __NR_clock_settime     (__NR_timer_create+5)
+#define __NR_clock_gettime     (__NR_timer_create+6)
+#define __NR_clock_getres      (__NR_timer_create+7)
+#define __NR_clock_nanosleep   (__NR_timer_create+8)
+#define __NR_statfs64          268
+#define __NR_fstatfs64         269
+#define __NR_tgkill            270
+#define __NR_utimes            271
+#define __NR_fadvise64_64      272
+                               /* 273 is reserved for vserver */
+#define __NR_mbind              274
+#define __NR_get_mempolicy      275
+#define __NR_set_mempolicy      276
+#define __NR_mq_open            277
+#define __NR_mq_unlink          (__NR_mq_open+1)
+#define __NR_mq_timedsend       (__NR_mq_open+2)
+#define __NR_mq_timedreceive    (__NR_mq_open+3)
+#define __NR_mq_notify          (__NR_mq_open+4)
+#define __NR_mq_getsetattr      (__NR_mq_open+5)
+#define __NR_kexec_load                283
+#define __NR_waitid            284
+#define __NR_add_key           285
+#define __NR_request_key       286
+#define __NR_keyctl            287
+#define __NR_ioprio_set                288
+#define __NR_ioprio_get                289
+#define __NR_inotify_init      290
+#define __NR_inotify_add_watch 291
+#define __NR_inotify_rm_watch  292
+                               /* 293 is unused */
+#define __NR_migrate_pages     294
+#define __NR_openat            295
+#define __NR_mkdirat           296
+#define __NR_mknodat           297
+#define __NR_fchownat          298
+#define __NR_futimesat         299
+#define __NR_fstatat64         300
+#define __NR_unlinkat          301
+#define __NR_renameat          302
+#define __NR_linkat            303
+#define __NR_symlinkat         304
+#define __NR_readlinkat                305
+#define __NR_fchmodat          306
+#define __NR_faccessat         307
+#define __NR_pselect6          308
+#define __NR_ppoll             309
+#define __NR_unshare           310
+#define __NR_set_robust_list   311
+#define __NR_get_robust_list   312
+#define __NR_splice            313
+#define __NR_sync_file_range   314
+#define __NR_tee               315
+#define __NR_vmsplice          316
+#define __NR_move_pages                317
+#define __NR_getcpu            318
+#define __NR_epoll_pwait       319
+#define __NR_utimensat         320
+#define __NR_signalfd          321
+#define __NR_timerfd_create    322
+#define __NR_eventfd           323
+#define __NR_fallocate         324
+#define __NR_timerfd_settime   325
+#define __NR_timerfd_gettime   326
+#define __NR_signalfd4         327
+#define __NR_eventfd2          328
+#define __NR_epoll_create1     329
+#define __NR_dup3              330
+#define __NR_pipe2             331
+#define __NR_inotify_init1     332
+#define __NR_preadv            333
+#define __NR_pwritev           334
+#define __NR_rt_tgsigqueueinfo 335
+#define __NR_perf_event_open   336
+#define __NR_fanotify_init     337
+#define __NR_fanotify_mark     338
+#define __NR_prlimit64         339
+
+/* Non-multiplexed socket family */
+#define __NR_socket            340
+#define __NR_bind              341
+#define __NR_connect           342
+#define __NR_listen            343
+#define __NR_accept            344
+#define __NR_getsockname       345
+#define __NR_getpeername       346
+#define __NR_socketpair                347
+#define __NR_send              348
+#define __NR_sendto            349
+#define __NR_recv              350
+#define __NR_recvfrom          351
+#define __NR_shutdown          352
+#define __NR_setsockopt                353
+#define __NR_getsockopt                354
+#define __NR_sendmsg           355
+#define __NR_recvmsg           356
+#define __NR_recvmmsg          357
+#define __NR_accept4           358
+#define __NR_name_to_handle_at 359
+#define __NR_open_by_handle_at 360
+#define __NR_clock_adjtime     361
+#define __NR_syncfs            362
+#define __NR_sendmmsg          363
+#define __NR_setns             364
+#define __NR_process_vm_readv  365
+#define __NR_process_vm_writev 366
+#define __NR_kcmp              367
+
+#define NR_syscalls 368
+
+#endif /* __ASM_SH_UNISTD_32_H */
diff --git a/arch/sh/include/uapi/asm/unistd_64.h b/arch/sh/include/uapi/asm/unistd_64.h
new file mode 100644 (file)
index 0000000..8e3a2ed
--- /dev/null
@@ -0,0 +1,405 @@
+#ifndef __ASM_SH_UNISTD_64_H
+#define __ASM_SH_UNISTD_64_H
+
+/*
+ * include/asm-sh/unistd_64.h
+ *
+ * This file contains the system call numbers.
+ *
+ * Copyright (C) 2000, 2001  Paolo Alberelli
+ * Copyright (C) 2003 - 2007 Paul Mundt
+ * Copyright (C) 2004  Sean McGoogan
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#define __NR_restart_syscall     0
+#define __NR_exit                1
+#define __NR_fork                2
+#define __NR_read                3
+#define __NR_write               4
+#define __NR_open                5
+#define __NR_close               6
+#define __NR_waitpid             7
+#define __NR_creat               8
+#define __NR_link                9
+#define __NR_unlink             10
+#define __NR_execve             11
+#define __NR_chdir              12
+#define __NR_time               13
+#define __NR_mknod              14
+#define __NR_chmod              15
+#define __NR_lchown             16
+                                /* 17 was sys_break */
+#define __NR_oldstat            18
+#define __NR_lseek              19
+#define __NR_getpid             20
+#define __NR_mount              21
+#define __NR_umount             22
+#define __NR_setuid             23
+#define __NR_getuid             24
+#define __NR_stime              25
+#define __NR_ptrace             26
+#define __NR_alarm              27
+#define __NR_oldfstat           28
+#define __NR_pause              29
+#define __NR_utime              30
+                                /* 31 was sys_stty */
+                                /* 32 was sys_gtty */
+#define __NR_access             33
+#define __NR_nice               34
+                                /* 35 was sys_ftime */
+#define __NR_sync               36
+#define __NR_kill               37
+#define __NR_rename             38
+#define __NR_mkdir              39
+#define __NR_rmdir              40
+#define __NR_dup                41
+#define __NR_pipe               42
+#define __NR_times              43
+                                /* 44 was sys_prof */
+#define __NR_brk                45
+#define __NR_setgid             46
+#define __NR_getgid             47
+#define __NR_signal             48
+#define __NR_geteuid            49
+#define __NR_getegid            50
+#define __NR_acct               51
+#define __NR_umount2            52
+                                /* 53 was sys_lock */
+#define __NR_ioctl              54
+#define __NR_fcntl              55
+                                /* 56 was sys_mpx */
+#define __NR_setpgid            57
+                                /* 58 was sys_ulimit */
+                                /* 59 was sys_olduname */
+#define __NR_umask              60
+#define __NR_chroot             61
+#define __NR_ustat              62
+#define __NR_dup2               63
+#define __NR_getppid            64
+#define __NR_getpgrp            65
+#define __NR_setsid             66
+#define __NR_sigaction          67
+#define __NR_sgetmask           68
+#define __NR_ssetmask           69
+#define __NR_setreuid           70
+#define __NR_setregid           71
+#define __NR_sigsuspend                 72
+#define __NR_sigpending                 73
+#define __NR_sethostname        74
+#define __NR_setrlimit          75
+#define __NR_getrlimit          76     /* Back compatible 2Gig limited rlimit */
+#define __NR_getrusage          77
+#define __NR_gettimeofday       78
+#define __NR_settimeofday       79
+#define __NR_getgroups          80
+#define __NR_setgroups          81
+                                /* 82 was sys_select */
+#define __NR_symlink            83
+#define __NR_oldlstat           84
+#define __NR_readlink           85
+#define __NR_uselib             86
+#define __NR_swapon             87
+#define __NR_reboot             88
+#define __NR_readdir            89
+#define __NR_mmap               90
+#define __NR_munmap             91
+#define __NR_truncate           92
+#define __NR_ftruncate          93
+#define __NR_fchmod             94
+#define __NR_fchown             95
+#define __NR_getpriority        96
+#define __NR_setpriority        97
+                                /* 98 was sys_profil */
+#define __NR_statfs             99
+#define __NR_fstatfs           100
+                               /* 101 was sys_ioperm */
+#define __NR_socketcall                102     /* old implementation of socket systemcall */
+#define __NR_syslog            103
+#define __NR_setitimer         104
+#define __NR_getitimer         105
+#define __NR_stat              106
+#define __NR_lstat             107
+#define __NR_fstat             108
+#define __NR_olduname          109
+                               /* 110 was sys_iopl */
+#define __NR_vhangup           111
+                               /* 112 was sys_idle */
+                               /* 113 was sys_vm86old */
+#define __NR_wait4             114
+#define __NR_swapoff           115
+#define __NR_sysinfo           116
+#define __NR_ipc               117
+#define __NR_fsync             118
+#define __NR_sigreturn         119
+#define __NR_clone             120
+#define __NR_setdomainname     121
+#define __NR_uname             122
+#define __NR_cacheflush                123
+#define __NR_adjtimex          124
+#define __NR_mprotect          125
+#define __NR_sigprocmask       126
+                               /* 127 was sys_create_module */
+#define __NR_init_module       128
+#define __NR_delete_module     129
+                               /* 130 was sys_get_kernel_syms */
+#define __NR_quotactl          131
+#define __NR_getpgid           132
+#define __NR_fchdir            133
+#define __NR_bdflush           134
+#define __NR_sysfs             135
+#define __NR_personality       136
+                               /* 137 was sys_afs_syscall */
+#define __NR_setfsuid          138
+#define __NR_setfsgid          139
+#define __NR__llseek           140
+#define __NR_getdents          141
+#define __NR__newselect                142
+#define __NR_flock             143
+#define __NR_msync             144
+#define __NR_readv             145
+#define __NR_writev            146
+#define __NR_getsid            147
+#define __NR_fdatasync         148
+#define __NR__sysctl           149
+#define __NR_mlock             150
+#define __NR_munlock           151
+#define __NR_mlockall          152
+#define __NR_munlockall                153
+#define __NR_sched_setparam            154
+#define __NR_sched_getparam            155
+#define __NR_sched_setscheduler                156
+#define __NR_sched_getscheduler                157
+#define __NR_sched_yield               158
+#define __NR_sched_get_priority_max    159
+#define __NR_sched_get_priority_min    160
+#define __NR_sched_rr_get_interval     161
+#define __NR_nanosleep         162
+#define __NR_mremap            163
+#define __NR_setresuid         164
+#define __NR_getresuid         165
+                               /* 166 was sys_vm86 */
+                               /* 167 was sys_query_module */
+#define __NR_poll              168
+#define __NR_nfsservctl                169
+#define __NR_setresgid         170
+#define __NR_getresgid         171
+#define __NR_prctl              172
+#define __NR_rt_sigreturn      173
+#define __NR_rt_sigaction      174
+#define __NR_rt_sigprocmask    175
+#define __NR_rt_sigpending     176
+#define __NR_rt_sigtimedwait   177
+#define __NR_rt_sigqueueinfo   178
+#define __NR_rt_sigsuspend     179
+#define __NR_pread64           180
+#define __NR_pwrite64          181
+#define __NR_chown             182
+#define __NR_getcwd            183
+#define __NR_capget            184
+#define __NR_capset            185
+#define __NR_sigaltstack       186
+#define __NR_sendfile          187
+                               /* 188 reserved for getpmsg */
+                               /* 189 reserved for putpmsg */
+#define __NR_vfork             190
+#define __NR_ugetrlimit                191     /* SuS compliant getrlimit */
+#define __NR_mmap2             192
+#define __NR_truncate64                193
+#define __NR_ftruncate64       194
+#define __NR_stat64            195
+#define __NR_lstat64           196
+#define __NR_fstat64           197
+#define __NR_lchown32          198
+#define __NR_getuid32          199
+#define __NR_getgid32          200
+#define __NR_geteuid32         201
+#define __NR_getegid32         202
+#define __NR_setreuid32                203
+#define __NR_setregid32                204
+#define __NR_getgroups32       205
+#define __NR_setgroups32       206
+#define __NR_fchown32          207
+#define __NR_setresuid32       208
+#define __NR_getresuid32       209
+#define __NR_setresgid32       210
+#define __NR_getresgid32       211
+#define __NR_chown32           212
+#define __NR_setuid32          213
+#define __NR_setgid32          214
+#define __NR_setfsuid32                215
+#define __NR_setfsgid32                216
+#define __NR_pivot_root                217
+#define __NR_mincore           218
+#define __NR_madvise           219
+
+/* Non-multiplexed socket family */
+#define __NR_socket            220
+#define __NR_bind              221
+#define __NR_connect           222
+#define __NR_listen            223
+#define __NR_accept            224
+#define __NR_getsockname       225
+#define __NR_getpeername       226
+#define __NR_socketpair                227
+#define __NR_send              228
+#define __NR_sendto            229
+#define __NR_recv              230
+#define __NR_recvfrom          231
+#define __NR_shutdown          232
+#define __NR_setsockopt                233
+#define __NR_getsockopt                234
+#define __NR_sendmsg           235
+#define __NR_recvmsg           236
+
+/* Non-multiplexed IPC family */
+#define __NR_semop             237
+#define __NR_semget            238
+#define __NR_semctl            239
+#define __NR_msgsnd            240
+#define __NR_msgrcv            241
+#define __NR_msgget            242
+#define __NR_msgctl            243
+#define __NR_shmat             244
+#define __NR_shmdt             245
+#define __NR_shmget            246
+#define __NR_shmctl            247
+
+#define __NR_getdents64                248
+#define __NR_fcntl64           249
+                               /* 250 is reserved for tux */
+                               /* 251 is unused */
+#define __NR_gettid            252
+#define __NR_readahead         253
+#define __NR_setxattr          254
+#define __NR_lsetxattr         255
+#define __NR_fsetxattr         256
+#define __NR_getxattr          257
+#define __NR_lgetxattr         258
+#define __NR_fgetxattr         269
+#define __NR_listxattr         260
+#define __NR_llistxattr                261
+#define __NR_flistxattr                262
+#define __NR_removexattr       263
+#define __NR_lremovexattr      264
+#define __NR_fremovexattr      265
+#define __NR_tkill             266
+#define __NR_sendfile64                267
+#define __NR_futex             268
+#define __NR_sched_setaffinity 269
+#define __NR_sched_getaffinity 270
+                               /* 271 is reserved for set_thread_area */
+                               /* 272 is reserved for get_thread_area */
+#define __NR_io_setup          273
+#define __NR_io_destroy                274
+#define __NR_io_getevents      275
+#define __NR_io_submit         276
+#define __NR_io_cancel         277
+#define __NR_fadvise64         278
+                               /* 279 is unused */
+#define __NR_exit_group                280
+
+#define __NR_lookup_dcookie    281
+#define __NR_epoll_create      282
+#define __NR_epoll_ctl         283
+#define __NR_epoll_wait                284
+#define __NR_remap_file_pages  285
+#define __NR_set_tid_address   286
+#define __NR_timer_create      287
+#define __NR_timer_settime     (__NR_timer_create+1)
+#define __NR_timer_gettime     (__NR_timer_create+2)
+#define __NR_timer_getoverrun  (__NR_timer_create+3)
+#define __NR_timer_delete      (__NR_timer_create+4)
+#define __NR_clock_settime     (__NR_timer_create+5)
+#define __NR_clock_gettime     (__NR_timer_create+6)
+#define __NR_clock_getres      (__NR_timer_create+7)
+#define __NR_clock_nanosleep   (__NR_timer_create+8)
+#define __NR_statfs64          296
+#define __NR_fstatfs64         297
+#define __NR_tgkill            298
+#define __NR_utimes            299
+#define __NR_fadvise64_64      300
+                               /* 301 is reserved for vserver */
+                               /* 302 is reserved for mbind */
+                               /* 303 is reserved for get_mempolicy */
+                               /* 304 is reserved for set_mempolicy */
+#define __NR_mq_open            305
+#define __NR_mq_unlink          (__NR_mq_open+1)
+#define __NR_mq_timedsend       (__NR_mq_open+2)
+#define __NR_mq_timedreceive    (__NR_mq_open+3)
+#define __NR_mq_notify          (__NR_mq_open+4)
+#define __NR_mq_getsetattr      (__NR_mq_open+5)
+                               /* 311 is reserved for kexec */
+#define __NR_waitid            312
+#define __NR_add_key           313
+#define __NR_request_key       314
+#define __NR_keyctl            315
+#define __NR_ioprio_set                316
+#define __NR_ioprio_get                317
+#define __NR_inotify_init      318
+#define __NR_inotify_add_watch 319
+#define __NR_inotify_rm_watch  320
+                               /* 321 is unused */
+#define __NR_migrate_pages     322
+#define __NR_openat            323
+#define __NR_mkdirat           324
+#define __NR_mknodat           325
+#define __NR_fchownat          326
+#define __NR_futimesat         327
+#define __NR_fstatat64         328
+#define __NR_unlinkat          329
+#define __NR_renameat          330
+#define __NR_linkat            331
+#define __NR_symlinkat         332
+#define __NR_readlinkat                333
+#define __NR_fchmodat          334
+#define __NR_faccessat         335
+#define __NR_pselect6          336
+#define __NR_ppoll             337
+#define __NR_unshare           338
+#define __NR_set_robust_list   339
+#define __NR_get_robust_list   340
+#define __NR_splice            341
+#define __NR_sync_file_range   342
+#define __NR_tee               343
+#define __NR_vmsplice          344
+#define __NR_move_pages                345
+#define __NR_getcpu            346
+#define __NR_epoll_pwait       347
+#define __NR_utimensat         348
+#define __NR_signalfd          349
+#define __NR_timerfd_create    350
+#define __NR_eventfd           351
+#define __NR_fallocate         352
+#define __NR_timerfd_settime   353
+#define __NR_timerfd_gettime   354
+#define __NR_signalfd4         355
+#define __NR_eventfd2          356
+#define __NR_epoll_create1     357
+#define __NR_dup3              358
+#define __NR_pipe2             359
+#define __NR_inotify_init1     360
+#define __NR_preadv            361
+#define __NR_pwritev           362
+#define __NR_rt_tgsigqueueinfo 363
+#define __NR_perf_event_open   364
+#define __NR_recvmmsg          365
+#define __NR_accept4           366
+#define __NR_fanotify_init     367
+#define __NR_fanotify_mark     368
+#define __NR_prlimit64         369
+#define __NR_name_to_handle_at 370
+#define __NR_open_by_handle_at 371
+#define __NR_clock_adjtime     372
+#define __NR_syncfs            373
+#define __NR_sendmmsg          374
+#define __NR_setns             375
+#define __NR_process_vm_readv  376
+#define __NR_process_vm_writev 377
+#define __NR_kcmp              378
+
+#define NR_syscalls 379
+
+#endif /* __ASM_SH_UNISTD_64_H */
index 4b68f0f79761e404c5830d617547feae2806a712..fe97ae5e56f168e642e4825fc76575a8a61811b2 100644 (file)
@@ -384,3 +384,4 @@ ENTRY(sys_call_table)
        .long sys_setns
        .long sys_process_vm_readv      /* 365 */
        .long sys_process_vm_writev
+       .long sys_kcmp
index 0956345b36efecd9e6729180701aecf423979a86..5c7b1c67bdc1c04f9c858644c066063a7eaf6919 100644 (file)
@@ -404,3 +404,4 @@ sys_call_table:
        .long sys_setns                 /* 375 */
        .long sys_process_vm_readv
        .long sys_process_vm_writev
+       .long sys_kcmp
index 0c6f6b068289ad4e74f8ea563a6ccd569f6743f5..da43bdc622943bf422a396abba301148151f8f96 100644 (file)
@@ -42,7 +42,18 @@ struct global_reg_snapshot {
        struct thread_info      *thread;
        unsigned long           pad1;
 };
-extern struct global_reg_snapshot global_reg_snapshot[NR_CPUS];
+
+struct global_pmu_snapshot {
+       unsigned long           pcr[4];
+       unsigned long           pic[4];
+};
+
+union global_cpu_snapshot {
+       struct global_reg_snapshot      reg;
+       struct global_pmu_snapshot      pmu;
+};
+
+extern union global_cpu_snapshot global_cpu_snapshot[NR_CPUS];
 
 #define force_successful_syscall_return()          \
 do {   current_thread_info()->syscall_noerror = 1; \
index 29862a9e906581d5fc58378db16c885992fcfa94..dd3bef4b9896c8921f2257cf5fab24399722495d 100644 (file)
@@ -48,6 +48,7 @@ extern void smp_fill_in_sib_core_maps(void);
 extern void cpu_play_dead(void);
 
 extern void smp_fetch_global_regs(void);
+extern void smp_fetch_global_pmu(void);
 
 struct seq_file;
 void smp_bogo(struct seq_file *);
@@ -65,6 +66,7 @@ extern void __cpu_die(unsigned int cpu);
 #define hard_smp_processor_id()                0
 #define smp_fill_in_sib_core_maps() do { } while (0)
 #define smp_fetch_global_regs() do { } while (0)
+#define smp_fetch_global_pmu() do { } while (0)
 
 #endif /* !(CONFIG_SMP) */
 
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ae5704fa77ad6d15e8de4623ca6465f24f2341b9 100644 (file)
@@ -0,0 +1,4 @@
+/*
+ * There isn't anything here anymore, but the file must not be empty or patch
+ * will delete it.
+ */
index e48651dace1bdca7812d285dd198f05e5068ab47..885a8af74064b1425be7e424ca205996c4add704 100644 (file)
@@ -817,15 +817,17 @@ static u64 nop_for_index(int idx)
 
 static inline void sparc_pmu_enable_event(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc, int idx)
 {
-       u64 val, mask = mask_for_index(idx);
+       u64 enc, val, mask = mask_for_index(idx);
        int pcr_index = 0;
 
        if (sparc_pmu->num_pcrs > 1)
                pcr_index = idx;
 
+       enc = perf_event_get_enc(cpuc->events[idx]);
+
        val = cpuc->pcr[pcr_index];
        val &= ~mask;
-       val |= hwc->config;
+       val |= event_encoding(enc, idx);
        cpuc->pcr[pcr_index] = val;
 
        pcr_ops->write_pcr(pcr_index, cpuc->pcr[pcr_index]);
@@ -1738,8 +1740,6 @@ static void perf_callchain_user_64(struct perf_callchain_entry *entry,
 {
        unsigned long ufp;
 
-       perf_callchain_store(entry, regs->tpc);
-
        ufp = regs->u_regs[UREG_I6] + STACK_BIAS;
        do {
                struct sparc_stackf *usf, sf;
@@ -1760,8 +1760,6 @@ static void perf_callchain_user_32(struct perf_callchain_entry *entry,
 {
        unsigned long ufp;
 
-       perf_callchain_store(entry, regs->tpc);
-
        ufp = regs->u_regs[UREG_I6] & 0xffffffffUL;
        do {
                struct sparc_stackf32 *usf, sf;
@@ -1780,6 +1778,11 @@ static void perf_callchain_user_32(struct perf_callchain_entry *entry,
 void
 perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
 {
+       perf_callchain_store(entry, regs->tpc);
+
+       if (!current->mm)
+               return;
+
        flushw_user();
        if (test_thread_flag(TIF_32BIT))
                perf_callchain_user_32(entry, regs);
index fcaa59421126edf297d4e14dbbf2b90239d5d406..d778248ef3f8ea7b48de69d0a68ca586e5acfef3 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/tick.h>
 #include <linux/init.h>
 #include <linux/cpu.h>
+#include <linux/perf_event.h>
 #include <linux/elfcore.h>
 #include <linux/sysrq.h>
 #include <linux/nmi.h>
@@ -47,6 +48,7 @@
 #include <asm/syscalls.h>
 #include <asm/irq_regs.h>
 #include <asm/smp.h>
+#include <asm/pcr.h>
 
 #include "kstack.h"
 
@@ -204,18 +206,22 @@ void show_regs(struct pt_regs *regs)
        show_stack(current, (unsigned long *) regs->u_regs[UREG_FP]);
 }
 
-struct global_reg_snapshot global_reg_snapshot[NR_CPUS];
-static DEFINE_SPINLOCK(global_reg_snapshot_lock);
+union global_cpu_snapshot global_cpu_snapshot[NR_CPUS];
+static DEFINE_SPINLOCK(global_cpu_snapshot_lock);
 
 static void __global_reg_self(struct thread_info *tp, struct pt_regs *regs,
                              int this_cpu)
 {
+       struct global_reg_snapshot *rp;
+
        flushw_all();
 
-       global_reg_snapshot[this_cpu].tstate = regs->tstate;
-       global_reg_snapshot[this_cpu].tpc = regs->tpc;
-       global_reg_snapshot[this_cpu].tnpc = regs->tnpc;
-       global_reg_snapshot[this_cpu].o7 = regs->u_regs[UREG_I7];
+       rp = &global_cpu_snapshot[this_cpu].reg;
+
+       rp->tstate = regs->tstate;
+       rp->tpc = regs->tpc;
+       rp->tnpc = regs->tnpc;
+       rp->o7 = regs->u_regs[UREG_I7];
 
        if (regs->tstate & TSTATE_PRIV) {
                struct reg_window *rw;
@@ -223,17 +229,17 @@ static void __global_reg_self(struct thread_info *tp, struct pt_regs *regs,
                rw = (struct reg_window *)
                        (regs->u_regs[UREG_FP] + STACK_BIAS);
                if (kstack_valid(tp, (unsigned long) rw)) {
-                       global_reg_snapshot[this_cpu].i7 = rw->ins[7];
+                       rp->i7 = rw->ins[7];
                        rw = (struct reg_window *)
                                (rw->ins[6] + STACK_BIAS);
                        if (kstack_valid(tp, (unsigned long) rw))
-                               global_reg_snapshot[this_cpu].rpc = rw->ins[7];
+                               rp->rpc = rw->ins[7];
                }
        } else {
-               global_reg_snapshot[this_cpu].i7 = 0;
-               global_reg_snapshot[this_cpu].rpc = 0;
+               rp->i7 = 0;
+               rp->rpc = 0;
        }
-       global_reg_snapshot[this_cpu].thread = tp;
+       rp->thread = tp;
 }
 
 /* In order to avoid hangs we do not try to synchronize with the
@@ -261,9 +267,9 @@ void arch_trigger_all_cpu_backtrace(void)
        if (!regs)
                regs = tp->kregs;
 
-       spin_lock_irqsave(&global_reg_snapshot_lock, flags);
+       spin_lock_irqsave(&global_cpu_snapshot_lock, flags);
 
-       memset(global_reg_snapshot, 0, sizeof(global_reg_snapshot));
+       memset(global_cpu_snapshot, 0, sizeof(global_cpu_snapshot));
 
        this_cpu = raw_smp_processor_id();
 
@@ -272,7 +278,7 @@ void arch_trigger_all_cpu_backtrace(void)
        smp_fetch_global_regs();
 
        for_each_online_cpu(cpu) {
-               struct global_reg_snapshot *gp = &global_reg_snapshot[cpu];
+               struct global_reg_snapshot *gp = &global_cpu_snapshot[cpu].reg;
 
                __global_reg_poll(gp);
 
@@ -295,9 +301,9 @@ void arch_trigger_all_cpu_backtrace(void)
                }
        }
 
-       memset(global_reg_snapshot, 0, sizeof(global_reg_snapshot));
+       memset(global_cpu_snapshot, 0, sizeof(global_cpu_snapshot));
 
-       spin_unlock_irqrestore(&global_reg_snapshot_lock, flags);
+       spin_unlock_irqrestore(&global_cpu_snapshot_lock, flags);
 }
 
 #ifdef CONFIG_MAGIC_SYSRQ
@@ -309,16 +315,90 @@ static void sysrq_handle_globreg(int key)
 
 static struct sysrq_key_op sparc_globalreg_op = {
        .handler        = sysrq_handle_globreg,
-       .help_msg       = "Globalregs",
+       .help_msg       = "global-regs(Y)",
        .action_msg     = "Show Global CPU Regs",
 };
 
-static int __init sparc_globreg_init(void)
+static void __global_pmu_self(int this_cpu)
+{
+       struct global_pmu_snapshot *pp;
+       int i, num;
+
+       pp = &global_cpu_snapshot[this_cpu].pmu;
+
+       num = 1;
+       if (tlb_type == hypervisor &&
+           sun4v_chip_type >= SUN4V_CHIP_NIAGARA4)
+               num = 4;
+
+       for (i = 0; i < num; i++) {
+               pp->pcr[i] = pcr_ops->read_pcr(i);
+               pp->pic[i] = pcr_ops->read_pic(i);
+       }
+}
+
+static void __global_pmu_poll(struct global_pmu_snapshot *pp)
+{
+       int limit = 0;
+
+       while (!pp->pcr[0] && ++limit < 100) {
+               barrier();
+               udelay(1);
+       }
+}
+
+static void pmu_snapshot_all_cpus(void)
 {
-       return register_sysrq_key('y', &sparc_globalreg_op);
+       unsigned long flags;
+       int this_cpu, cpu;
+
+       spin_lock_irqsave(&global_cpu_snapshot_lock, flags);
+
+       memset(global_cpu_snapshot, 0, sizeof(global_cpu_snapshot));
+
+       this_cpu = raw_smp_processor_id();
+
+       __global_pmu_self(this_cpu);
+
+       smp_fetch_global_pmu();
+
+       for_each_online_cpu(cpu) {
+               struct global_pmu_snapshot *pp = &global_cpu_snapshot[cpu].pmu;
+
+               __global_pmu_poll(pp);
+
+               printk("%c CPU[%3d]: PCR[%08lx:%08lx:%08lx:%08lx] PIC[%08lx:%08lx:%08lx:%08lx]\n",
+                      (cpu == this_cpu ? '*' : ' '), cpu,
+                      pp->pcr[0], pp->pcr[1], pp->pcr[2], pp->pcr[3],
+                      pp->pic[0], pp->pic[1], pp->pic[2], pp->pic[3]);
+       }
+
+       memset(global_cpu_snapshot, 0, sizeof(global_cpu_snapshot));
+
+       spin_unlock_irqrestore(&global_cpu_snapshot_lock, flags);
+}
+
+static void sysrq_handle_globpmu(int key)
+{
+       pmu_snapshot_all_cpus();
+}
+
+static struct sysrq_key_op sparc_globalpmu_op = {
+       .handler        = sysrq_handle_globpmu,
+       .help_msg       = "global-pmu(X)",
+       .action_msg     = "Show Global PMU Regs",
+};
+
+static int __init sparc_sysrq_init(void)
+{
+       int ret = register_sysrq_key('y', &sparc_globalreg_op);
+
+       if (!ret)
+               ret = register_sysrq_key('x', &sparc_globalpmu_op);
+       return ret;
 }
 
-core_initcall(sparc_globreg_init);
+core_initcall(sparc_sysrq_init);
 
 #endif
 
index 781bcb10b8bd6f0ac34e1df6cf079dd0d3d59106..d94b878577b7ea34bd674c50ab2817be7d2d93db 100644 (file)
@@ -852,6 +852,8 @@ extern unsigned long xcall_flush_tlb_mm;
 extern unsigned long xcall_flush_tlb_pending;
 extern unsigned long xcall_flush_tlb_kernel_range;
 extern unsigned long xcall_fetch_glob_regs;
+extern unsigned long xcall_fetch_glob_pmu;
+extern unsigned long xcall_fetch_glob_pmu_n4;
 extern unsigned long xcall_receive_signal;
 extern unsigned long xcall_new_mmu_context_version;
 #ifdef CONFIG_KGDB
@@ -1000,6 +1002,15 @@ void smp_fetch_global_regs(void)
        smp_cross_call(&xcall_fetch_glob_regs, 0, 0, 0);
 }
 
+void smp_fetch_global_pmu(void)
+{
+       if (tlb_type == hypervisor &&
+           sun4v_chip_type >= SUN4V_CHIP_NIAGARA4)
+               smp_cross_call(&xcall_fetch_glob_pmu_n4, 0, 0, 0);
+       else
+               smp_cross_call(&xcall_fetch_glob_pmu, 0, 0, 0);
+}
+
 /* We know that the window frames of the user have been flushed
  * to the stack before we get here because all callers of us
  * are flush_tlb_*() routines, and these run after flush_cache_*()
index 874162a11ceb824eb9e1af311c81be052a934927..f8e13d421fcbf415dd49a50bc2ed4aaf2b3b6494 100644 (file)
@@ -481,8 +481,8 @@ xcall_sync_tick:
 
        .globl          xcall_fetch_glob_regs
 xcall_fetch_glob_regs:
-       sethi           %hi(global_reg_snapshot), %g1
-       or              %g1, %lo(global_reg_snapshot), %g1
+       sethi           %hi(global_cpu_snapshot), %g1
+       or              %g1, %lo(global_cpu_snapshot), %g1
        __GET_CPUID(%g2)
        sllx            %g2, 6, %g3
        add             %g1, %g3, %g1
@@ -509,6 +509,66 @@ xcall_fetch_glob_regs:
        stx             %g3, [%g1 + GR_SNAP_THREAD]
        retry
 
+       .globl          xcall_fetch_glob_pmu
+xcall_fetch_glob_pmu:
+       sethi           %hi(global_cpu_snapshot), %g1
+       or              %g1, %lo(global_cpu_snapshot), %g1
+       __GET_CPUID(%g2)
+       sllx            %g2, 6, %g3
+       add             %g1, %g3, %g1
+       rd              %pic, %g7
+       stx             %g7, [%g1 + (4 * 8)]
+       rd              %pcr, %g7
+       stx             %g7, [%g1 + (0 * 8)]
+       retry
+
+       .globl          xcall_fetch_glob_pmu_n4
+xcall_fetch_glob_pmu_n4:
+       sethi           %hi(global_cpu_snapshot), %g1
+       or              %g1, %lo(global_cpu_snapshot), %g1
+       __GET_CPUID(%g2)
+       sllx            %g2, 6, %g3
+       add             %g1, %g3, %g1
+
+       ldxa            [%g0] ASI_PIC, %g7
+       stx             %g7, [%g1 + (4 * 8)]
+       mov             0x08, %g3
+       ldxa            [%g3] ASI_PIC, %g7
+       stx             %g7, [%g1 + (5 * 8)]
+       mov             0x10, %g3
+       ldxa            [%g3] ASI_PIC, %g7
+       stx             %g7, [%g1 + (6 * 8)]
+       mov             0x18, %g3
+       ldxa            [%g3] ASI_PIC, %g7
+       stx             %g7, [%g1 + (7 * 8)]
+
+       mov             %o0, %g2
+       mov             %o1, %g3
+       mov             %o5, %g7
+
+       mov             HV_FAST_VT_GET_PERFREG, %o5
+       mov             3, %o0
+       ta              HV_FAST_TRAP
+       stx             %o1, [%g1 + (3 * 8)]
+       mov             HV_FAST_VT_GET_PERFREG, %o5
+       mov             2, %o0
+       ta              HV_FAST_TRAP
+       stx             %o1, [%g1 + (2 * 8)]
+       mov             HV_FAST_VT_GET_PERFREG, %o5
+       mov             1, %o0
+       ta              HV_FAST_TRAP
+       stx             %o1, [%g1 + (1 * 8)]
+       mov             HV_FAST_VT_GET_PERFREG, %o5
+       mov             0, %o0
+       ta              HV_FAST_TRAP
+       stx             %o1, [%g1 + (0 * 8)]
+
+       mov             %g2, %o0
+       mov             %g3, %o1
+       mov             %g7, %o5
+
+       retry
+
 #ifdef DCACHE_ALIASING_POSSIBLE
        .align          32
        .globl          xcall_flush_dcache_page_cheetah
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3751c9fabcf29b1a4f1164e8ff040ec8ac5ec9cf 100644 (file)
@@ -0,0 +1 @@
+# Tile arch headers
index c68808a09da7732ccab05fd2415e449c1e46bb99..6948015e08a2af582a8a539438460951ea3c8b45 100644 (file)
@@ -1,8 +1,6 @@
 
 header-y += ../arch/
 
-header-y += ucontext.h
-
 generic-y += bug.h
 generic-y += bugs.h
 generic-y += clkdev.h
@@ -37,5 +35,4 @@ generic-y += statfs.h
 generic-y += termbits.h
 generic-y += termios.h
 generic-y += types.h
-generic-y += ucontext.h
 generic-y += xor.h
index 5c6915fd30b5c4397e12fe4e7662316320f0c68f..c20db8e428bf698cca387f3c71a29e44f1df48ce 100644 (file)
@@ -15,4 +15,7 @@ header-y += siginfo.h
 header-y += signal.h
 header-y += stat.h
 header-y += swab.h
+header-y += ucontext.h
 header-y += unistd.h
+
+generic-y += ucontext.h
index 58790bd85c1d38b1f1080f0284fbe170e8b5acb9..05afcca66de68cf65c7c354b543881ea96a2cf74 100644 (file)
@@ -142,7 +142,7 @@ KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
 KBUILD_CFLAGS += $(mflags-y)
 KBUILD_AFLAGS += $(mflags-y)
 
-archscripts:
+archscripts: scripts_basic
        $(Q)$(MAKE) $(build)=arch/x86/tools relocs
 
 ###
index 7c04d0da709b10a002ecd26db5bf0ec0b7b3bb6c..1b9c22bea8a7de8f6e63b200d77733bd2bb0f3c5 100644 (file)
@@ -515,6 +515,11 @@ static int xts_aesni_setkey(struct crypto_tfm *tfm, const u8 *key,
 }
 
 
+static void aesni_xts_tweak(void *ctx, u8 *out, const u8 *in)
+{
+       aesni_enc(ctx, out, in);
+}
+
 static int xts_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
                       struct scatterlist *src, unsigned int nbytes)
 {
@@ -525,7 +530,7 @@ static int xts_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
                .tbuflen = sizeof(buf),
 
                .tweak_ctx = aes_ctx(ctx->raw_tweak_ctx),
-               .tweak_fn = XTS_TWEAK_CAST(aesni_enc),
+               .tweak_fn = aesni_xts_tweak,
                .crypt_ctx = aes_ctx(ctx->raw_crypt_ctx),
                .crypt_fn = lrw_xts_encrypt_callback,
        };
@@ -550,7 +555,7 @@ static int xts_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
                .tbuflen = sizeof(buf),
 
                .tweak_ctx = aes_ctx(ctx->raw_tweak_ctx),
-               .tweak_fn = XTS_TWEAK_CAST(aesni_enc),
+               .tweak_fn = aesni_xts_tweak,
                .crypt_ctx = aes_ctx(ctx->raw_crypt_ctx),
                .crypt_fn = lrw_xts_decrypt_callback,
        };
index 9a7c90d80bc4c87bafd96cb73efb46ced84b5276..93c5451bdd527ca9436a98b661e9f3165e484570 100644 (file)
@@ -991,7 +991,7 @@ static struct attribute ** __cpuinit amd_l3_attrs(void)
        if (attrs)
                return attrs;
 
-       n = sizeof (default_attrs) / sizeof (struct attribute *);
+       n = ARRAY_SIZE(default_attrs);
 
        if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE))
                n += 2;
index 29e87d3b2843610207ebd875071a4291bec02cfe..46cbf8689692fdbd3d0517d6e20d20a9e192f5e0 100644 (file)
@@ -2209,11 +2209,6 @@ static struct dev_ext_attribute dev_attr_cmci_disabled = {
        &mce_cmci_disabled
 };
 
-static struct dev_ext_attribute dev_attr_bios_cmci_threshold = {
-       __ATTR(bios_cmci_threshold, 0444, device_show_int, NULL),
-       &mce_bios_cmci_threshold
-};
-
 static struct device_attribute *mce_device_attrs[] = {
        &dev_attr_tolerant.attr,
        &dev_attr_check_interval.attr,
@@ -2222,7 +2217,6 @@ static struct device_attribute *mce_device_attrs[] = {
        &dev_attr_dont_log_ce.attr,
        &dev_attr_ignore_ce.attr,
        &dev_attr_cmci_disabled.attr,
-       &dev_attr_bios_cmci_threshold.attr,
        NULL
 };
 
index c4e916d773780f4239ac831478c15aa2325c7382..698b6ec12e0f40f9c292b9f84206b38214d9fe7e 100644 (file)
@@ -576,12 +576,10 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
        int err = 0;
 
        if (shared_bank[bank]) {
-
                nb = node_to_amd_nb(amd_get_nb_id(cpu));
-               WARN_ON(!nb);
 
                /* threshold descriptor already initialized on this node? */
-               if (nb->bank4) {
+               if (nb && nb->bank4) {
                        /* yes, use it */
                        b = nb->bank4;
                        err = kobject_add(b->kobj, &dev->kobj, name);
@@ -615,8 +613,10 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
                atomic_set(&b->cpus, 1);
 
                /* nb is already initialized, see above */
-               WARN_ON(nb->bank4);
-               nb->bank4 = b;
+               if (nb) {
+                       WARN_ON(nb->bank4);
+                       nb->bank4 = b;
+               }
        }
 
        err = allocate_threshold_blocks(cpu, bank, 0,
index 915b876edd1e2b8a509786446642302648989a73..3373f84d139750276cf33a3a6bf757c171975a40 100644 (file)
@@ -338,6 +338,9 @@ int x86_setup_perfctr(struct perf_event *event)
                /* BTS is currently only allowed for user-mode. */
                if (!attr->exclude_kernel)
                        return -EOPNOTSUPP;
+
+               if (!attr->exclude_guest)
+                       return -EOPNOTSUPP;
        }
 
        hwc->config |= config;
@@ -380,6 +383,9 @@ int x86_pmu_hw_config(struct perf_event *event)
        if (event->attr.precise_ip) {
                int precise = 0;
 
+               if (!event->attr.exclude_guest)
+                       return -EOPNOTSUPP;
+
                /* Support for constant skid */
                if (x86_pmu.pebs_active && !x86_pmu.pebs_broken) {
                        precise++;
index 52190a938b4ac0d26a85704e6db4c131dd938aca..4e8ba39eaf0fd93cbca557eaecf3efcd954ee05b 100644 (file)
@@ -358,14 +358,6 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
                },
        },
-       {       /* Handle problems with rebooting on CompuLab SBC-FITPC2 */
-               .callback = set_bios_reboot,
-               .ident = "CompuLab SBC-FITPC2",
-               .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "CompuLab"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "SBC-FITPC2"),
-               },
-       },
        {       /* Handle problems with rebooting on ASUS P4S800 */
                .callback = set_bios_reboot,
                .ident = "ASUS P4S800",
index a2bb18e02839489dcbf9dbc1e3d348f5fb176c34..468e98dfd44e72fd7d0b29690b4bb777356a52a5 100644 (file)
@@ -920,8 +920,21 @@ void __init setup_arch(char **cmdline_p)
 
 #ifdef CONFIG_X86_64
        if (max_pfn > max_low_pfn) {
-               max_pfn_mapped = init_memory_mapping(1UL<<32,
-                                                    max_pfn<<PAGE_SHIFT);
+               int i;
+               for (i = 0; i < e820.nr_map; i++) {
+                       struct e820entry *ei = &e820.map[i];
+
+                       if (ei->addr + ei->size <= 1UL << 32)
+                               continue;
+
+                       if (ei->type == E820_RESERVED)
+                               continue;
+
+                       max_pfn_mapped = init_memory_mapping(
+                               ei->addr < 1UL << 32 ? 1UL << 32 : ei->addr,
+                               ei->addr + ei->size);
+               }
+
                /* can we preseve max_low_pfn ?*/
                max_low_pfn = max_pfn;
        }
index e56479e580534ffd0cd5b3eb70531d4dd716869f..9e7e14797a72dda0b85d4c70afca61fdb2fdf92e 100644 (file)
@@ -74,18 +74,9 @@ ENTRY(wakeup_start)
 
        lidtl   wakeup_idt
 
-       /* Clear the EFLAGS but remember if we have EFLAGS.ID */
-       movl $X86_EFLAGS_ID, %ecx
-       pushl %ecx
-       popfl
-       pushfl
-       popl %edi
+       /* Clear the EFLAGS */
        pushl $0
        popfl
-       pushfl
-       popl %edx
-       xorl %edx, %edi
-       andl %ecx, %edi         /* %edi is zero iff CPUID & %cr4 are missing */
 
        /* Check header signature... */
        movl    signature, %eax
@@ -120,12 +111,12 @@ ENTRY(wakeup_start)
        movl    %eax, %cr3
 
        btl     $WAKEUP_BEHAVIOR_RESTORE_CR4, %edi
-       j     1f
+       jnc     1f
        movl    pmode_cr4, %eax
        movl    %eax, %cr4
 1:
        btl     $WAKEUP_BEHAVIOR_RESTORE_EFER, %edi
-       j     1f
+       jnc     1f
        movl    pmode_efer, %eax
        movl    pmode_efer + 4, %edx
        movl    $MSR_EFER, %ecx
index 4c316cd28a542b2f06685179eb0e37b7819b539a..86c34dbc9cd0abdf1b5b055f6d9a7b46e082aae2 100644 (file)
@@ -51,17 +51,17 @@ _start:
        /* 'reset' window registers */
 
        movi    a4, 1
-       wsr     a4, PS
+       wsr     a4, ps
        rsync
 
-       rsr     a5, WINDOWBASE
+       rsr     a5, windowbase
        ssl     a5
        sll     a4, a4
-       wsr     a4, WINDOWSTART
+       wsr     a4, windowstart
        rsync
 
        movi    a4, 0x00040000
-       wsr     a4, PS
+       wsr     a4, ps
        rsync
 
        /* copy the loader to its address
index fccd81eddff1f6de89b07cc13c362809364c9507..6d13027899957d528a142964db0b299d36b74a13 100644 (file)
@@ -1,4 +1,28 @@
-include include/asm-generic/Kbuild.asm
-
+generic-y += bitsperlong.h
+generic-y += bug.h
 generic-y += clkdev.h
+generic-y += cputime.h
+generic-y += device.h
+generic-y += div64.h
+generic-y += emergency-restart.h
+generic-y += errno.h
 generic-y += exec.h
+generic-y += fcntl.h
+generic-y += futex.h
+generic-y += hardirq.h
+generic-y += ioctl.h
+generic-y += irq_regs.h
+generic-y += kdebug.h
+generic-y += kmap_types.h
+generic-y += kvm_para.h
+generic-y += local.h
+generic-y += local64.h
+generic-y += percpu.h
+generic-y += resource.h
+generic-y += scatterlist.h
+generic-y += sections.h
+generic-y += siginfo.h
+generic-y += statfs.h
+generic-y += termios.h
+generic-y += topology.h
+generic-y += xor.h
index b4098930877587d7dec309bbc702a5ed674c94f6..24f50cada70c27ae041356f960b728dc285e4e5b 100644 (file)
@@ -73,7 +73,7 @@ static inline void atomic_add(int i, atomic_t * v)
        "l32i    %0, %2, 0              \n\t"
        "add     %0, %0, %1             \n\t"
        "s32i    %0, %2, 0              \n\t"
-       "wsr     a15, "__stringify(PS)"       \n\t"
+       "wsr     a15, ps                \n\t"
        "rsync                          \n"
        : "=&a" (vval)
        : "a" (i), "a" (v)
@@ -97,7 +97,7 @@ static inline void atomic_sub(int i, atomic_t *v)
        "l32i    %0, %2, 0              \n\t"
        "sub     %0, %0, %1             \n\t"
        "s32i    %0, %2, 0              \n\t"
-       "wsr     a15, "__stringify(PS)"       \n\t"
+       "wsr     a15, ps                \n\t"
        "rsync                          \n"
        : "=&a" (vval)
        : "a" (i), "a" (v)
@@ -118,7 +118,7 @@ static inline int atomic_add_return(int i, atomic_t * v)
        "l32i    %0, %2, 0             \n\t"
        "add     %0, %0, %1            \n\t"
        "s32i    %0, %2, 0             \n\t"
-       "wsr     a15, "__stringify(PS)"      \n\t"
+       "wsr     a15, ps               \n\t"
        "rsync                         \n"
        : "=&a" (vval)
        : "a" (i), "a" (v)
@@ -137,7 +137,7 @@ static inline int atomic_sub_return(int i, atomic_t * v)
        "l32i    %0, %2, 0             \n\t"
        "sub     %0, %0, %1            \n\t"
        "s32i    %0, %2, 0             \n\t"
-       "wsr     a15, "__stringify(PS)"       \n\t"
+       "wsr     a15, ps               \n\t"
        "rsync                         \n"
        : "=&a" (vval)
        : "a" (i), "a" (v)
@@ -260,7 +260,7 @@ static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
        "xor     %1, %4, %3            \n\t"
        "and     %0, %0, %4            \n\t"
        "s32i    %0, %2, 0             \n\t"
-       "wsr     a15, "__stringify(PS)"      \n\t"
+       "wsr     a15, ps               \n\t"
        "rsync                         \n"
        : "=&a" (vval), "=a" (mask)
        : "a" (v), "a" (all_f), "1" (mask)
@@ -277,7 +277,7 @@ static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
        "l32i    %0, %2, 0             \n\t"
        "or      %0, %0, %1            \n\t"
        "s32i    %0, %2, 0             \n\t"
-       "wsr     a15, "__stringify(PS)"       \n\t"
+       "wsr     a15, ps               \n\t"
        "rsync                         \n"
        : "=&a" (vval)
        : "a" (mask), "a" (v)
diff --git a/arch/xtensa/include/asm/auxvec.h b/arch/xtensa/include/asm/auxvec.h
deleted file mode 100644 (file)
index 257dec7..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef __XTENSA_AUXVEC_H
-#define __XTENSA_AUXVEC_H
-
-#endif
diff --git a/arch/xtensa/include/asm/bitsperlong.h b/arch/xtensa/include/asm/bitsperlong.h
deleted file mode 100644 (file)
index 6dc0bb0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/bitsperlong.h>
diff --git a/arch/xtensa/include/asm/bug.h b/arch/xtensa/include/asm/bug.h
deleted file mode 100644 (file)
index 3e52d72..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * include/asm-xtensa/bug.h
- *
- * Macros to cause a 'bug' message.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_BUG_H
-#define _XTENSA_BUG_H
-
-#include <asm-generic/bug.h>
-
-#endif /* _XTENSA_BUG_H */
diff --git a/arch/xtensa/include/asm/byteorder.h b/arch/xtensa/include/asm/byteorder.h
deleted file mode 100644 (file)
index 54eb631..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _XTENSA_BYTEORDER_H
-#define _XTENSA_BYTEORDER_H
-
-#ifdef __XTENSA_EL__
-#include <linux/byteorder/little_endian.h>
-#elif defined(__XTENSA_EB__)
-#include <linux/byteorder/big_endian.h>
-#else
-# error processor byte order undefined!
-#endif
-
-#endif /* _XTENSA_BYTEORDER_H */
index 376cd9d5f45529c48078b7a84e9c7618ad865060..569fec4f9a20db0899e8ee92085ba4faea2fa4d2 100644 (file)
@@ -165,7 +165,7 @@ extern void copy_from_user_page(struct vm_area_struct*, struct page*,
 static inline u32 xtensa_get_cacheattr(void)
 {
        u32 r;
-       asm volatile("  rsr %0, CACHEATTR" : "=a"(r));
+       asm volatile("  rsr %0, cacheattr" : "=a"(r));
        return r;
 }
 
index e32149063d83163cdb3ac68132f5c10e981f0ce4..64dad04a9d276453cfca46df63eabcad816a07e2 100644 (file)
@@ -27,7 +27,7 @@ __cmpxchg_u32(volatile int *p, int old, int new)
                       "bne     %0, %2, 1f             \n\t"
                       "s32i    %3, %1, 0              \n\t"
                       "1:                             \n\t"
-                      "wsr     a15, "__stringify(PS)" \n\t"
+                      "wsr     a15, ps                \n\t"
                       "rsync                          \n\t"
                       : "=&a" (old)
                       : "a" (p), "a" (old), "r" (new)
@@ -97,7 +97,7 @@ static inline unsigned long xchg_u32(volatile int * m, unsigned long val)
   __asm__ __volatile__("rsil    a15, "__stringify(LOCKLEVEL)"\n\t"
                       "l32i    %0, %1, 0              \n\t"
                       "s32i    %2, %1, 0              \n\t"
-                      "wsr     a15, "__stringify(PS)" \n\t"
+                      "wsr     a15, ps                \n\t"
                       "rsync                          \n\t"
                       : "=&a" (tmp)
                       : "a" (m), "a" (val)
index 75c94a1658b02b81b14ec3759c5f29cb8db97a4d..677501b32dfcfa0b5a8471c73cc118b3d4415855 100644 (file)
 #if XCHAL_HAVE_CP
 
 #define RSR_CPENABLE(x)        do {                                              \
-       __asm__ __volatile__("rsr %0," __stringify(CPENABLE) : "=a" (x)); \
+       __asm__ __volatile__("rsr %0, cpenable" : "=a" (x));              \
        } while(0);
 #define WSR_CPENABLE(x)        do {                                              \
-       __asm__ __volatile__("wsr %0," __stringify(CPENABLE) "; rsync"    \
-                            :: "a" (x));                                 \
+       __asm__ __volatile__("wsr %0, cpenable; rsync" :: "a" (x));       \
        } while(0);
 
 #endif /* XCHAL_HAVE_CP */
diff --git a/arch/xtensa/include/asm/cputime.h b/arch/xtensa/include/asm/cputime.h
deleted file mode 100644 (file)
index a7fb864..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _XTENSA_CPUTIME_H
-#define _XTENSA_CPUTIME_H
-
-#include <asm-generic/cputime.h>
-
-#endif /* _XTENSA_CPUTIME_H */
index e1d8c9e010c1df976624ce71ea0449d6c8f47ae4..58c0a4fd4003891f18cd1c9a4f8babe4f1923be3 100644 (file)
@@ -27,7 +27,7 @@ static inline void __delay(unsigned long loops)
 static __inline__ u32 xtensa_get_ccount(void)
 {
        u32 ccount;
-       asm volatile ("rsr %0, 234; # CCOUNT\n" : "=r" (ccount));
+       asm volatile ("rsr %0, ccount\n" : "=r" (ccount));
        return ccount;
 }
 
diff --git a/arch/xtensa/include/asm/device.h b/arch/xtensa/include/asm/device.h
deleted file mode 100644 (file)
index d8f9872..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * Arch specific extensions to struct device
- *
- * This file is released under the GPLv2
- */
-#include <asm-generic/device.h>
-
diff --git a/arch/xtensa/include/asm/div64.h b/arch/xtensa/include/asm/div64.h
deleted file mode 100644 (file)
index f35678c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * include/asm-xtensa/div64.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2007 Tensilica Inc.
- */
-
-#ifndef _XTENSA_DIV64_H
-#define _XTENSA_DIV64_H
-
-#include <asm-generic/div64.h>
-
-#endif /* _XTENSA_DIV64_H */
diff --git a/arch/xtensa/include/asm/emergency-restart.h b/arch/xtensa/include/asm/emergency-restart.h
deleted file mode 100644 (file)
index 108d8c4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_EMERGENCY_RESTART_H
-#define _ASM_EMERGENCY_RESTART_H
-
-#include <asm-generic/emergency-restart.h>
-
-#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/arch/xtensa/include/asm/errno.h b/arch/xtensa/include/asm/errno.h
deleted file mode 100644 (file)
index a0f3b96..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * include/asm-xtensa/errno.h
- *
- * This file is subject to the terms and conditions of the GNU General
- * Public License.  See the file "COPYING" in the main directory of
- * this archive for more details.
- *
- * Copyright (C) 2002 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_ERRNO_H
-#define _XTENSA_ERRNO_H
-
-#include <asm-generic/errno.h>
-
-#endif /* _XTENSA_ERRNO_H */
diff --git a/arch/xtensa/include/asm/fcntl.h b/arch/xtensa/include/asm/fcntl.h
deleted file mode 100644 (file)
index 46ab12d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/fcntl.h>
diff --git a/arch/xtensa/include/asm/futex.h b/arch/xtensa/include/asm/futex.h
deleted file mode 100644 (file)
index 0b74582..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/futex.h>
diff --git a/arch/xtensa/include/asm/hardirq.h b/arch/xtensa/include/asm/hardirq.h
deleted file mode 100644 (file)
index 91695a1..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * include/asm-xtensa/hardirq.h
- *
- * This file is subject to the terms and conditions of the GNU General
- * Public License.  See the file "COPYING" in the main directory of
- * this archive for more details.
- *
- * Copyright (C) 2002 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_HARDIRQ_H
-#define _XTENSA_HARDIRQ_H
-
-#include <asm-generic/hardirq.h>
-
-#endif /* _XTENSA_HARDIRQ_H */
diff --git a/arch/xtensa/include/asm/ioctl.h b/arch/xtensa/include/asm/ioctl.h
deleted file mode 100644 (file)
index b279fe0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/ioctl.h>
diff --git a/arch/xtensa/include/asm/ioctls.h b/arch/xtensa/include/asm/ioctls.h
deleted file mode 100644 (file)
index 2aa4cd9..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * include/asm-xtensa/ioctls.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2003 - 2005 Tensilica Inc.
- *
- * Derived from "include/asm-i386/ioctls.h"
- */
-
-#ifndef _XTENSA_IOCTLS_H
-#define _XTENSA_IOCTLS_H
-
-#include <asm/ioctl.h>
-
-#define FIOCLEX                _IO('f', 1)
-#define FIONCLEX       _IO('f', 2)
-#define FIOASYNC       _IOW('f', 125, int)
-#define FIONBIO                _IOW('f', 126, int)
-#define FIONREAD       _IOR('f', 127, int)
-#define TIOCINQ                FIONREAD
-#define FIOQSIZE       _IOR('f', 128, loff_t)
-
-#define TCGETS         0x5401
-#define TCSETS         0x5402
-#define TCSETSW                0x5403
-#define TCSETSF                0x5404
-
-#define TCGETA         _IOR('t', 23, struct termio)
-#define TCSETA         _IOW('t', 24, struct termio)
-#define TCSETAW                _IOW('t', 25, struct termio)
-#define TCSETAF                _IOW('t', 28, struct termio)
-
-#define TCSBRK         _IO('t', 29)
-#define TCXONC         _IO('t', 30)
-#define TCFLSH         _IO('t', 31)
-
-#define TIOCSWINSZ     _IOW('t', 103, struct winsize)
-#define TIOCGWINSZ     _IOR('t', 104, struct winsize)
-#define        TIOCSTART       _IO('t', 110)           /* start output, like ^Q */
-#define        TIOCSTOP        _IO('t', 111)           /* stop output, like ^S */
-#define TIOCOUTQ        _IOR('t', 115, int)     /* output queue size */
-
-#define TIOCSPGRP      _IOW('t', 118, int)
-#define TIOCGPGRP      _IOR('t', 119, int)
-
-#define TIOCEXCL       _IO('T', 12)
-#define TIOCNXCL       _IO('T', 13)
-#define TIOCSCTTY      _IO('T', 14)
-
-#define TIOCSTI                _IOW('T', 18, char)
-#define TIOCMGET       _IOR('T', 21, unsigned int)
-#define TIOCMBIS       _IOW('T', 22, unsigned int)
-#define TIOCMBIC       _IOW('T', 23, unsigned int)
-#define TIOCMSET       _IOW('T', 24, unsigned int)
-# define TIOCM_LE      0x001
-# define TIOCM_DTR     0x002
-# define TIOCM_RTS     0x004
-# define TIOCM_ST      0x008
-# define TIOCM_SR      0x010
-# define TIOCM_CTS     0x020
-# define TIOCM_CAR     0x040
-# define TIOCM_RNG     0x080
-# define TIOCM_DSR     0x100
-# define TIOCM_CD      TIOCM_CAR
-# define TIOCM_RI      TIOCM_RNG
-
-#define TIOCGSOFTCAR   _IOR('T', 25, unsigned int)
-#define TIOCSSOFTCAR   _IOW('T', 26, unsigned int)
-#define TIOCLINUX      _IOW('T', 28, char)
-#define TIOCCONS       _IO('T', 29)
-#define TIOCGSERIAL    0x803C541E      /*_IOR('T', 30, struct serial_struct)*/
-#define TIOCSSERIAL    0x403C541F      /*_IOW('T', 31, struct serial_struct)*/
-#define TIOCPKT                _IOW('T', 32, int)
-# define TIOCPKT_DATA           0
-# define TIOCPKT_FLUSHREAD      1
-# define TIOCPKT_FLUSHWRITE     2
-# define TIOCPKT_STOP           4
-# define TIOCPKT_START          8
-# define TIOCPKT_NOSTOP                16
-# define TIOCPKT_DOSTOP                32
-# define TIOCPKT_IOCTL         64
-
-
-#define TIOCNOTTY      _IO('T', 34)
-#define TIOCSETD       _IOW('T', 35, int)
-#define TIOCGETD       _IOR('T', 36, int)
-#define TCSBRKP                _IOW('T', 37, int)   /* Needed for POSIX tcsendbreak()*/
-#define TIOCTTYGSTRUCT _IOR('T', 38, struct tty_struct) /* For debugging only*/
-#define TIOCSBRK       _IO('T', 39)         /* BSD compatibility */
-#define TIOCCBRK       _IO('T', 40)         /* BSD compatibility */
-#define TIOCGSID       _IOR('T', 41, pid_t) /* Return the session ID of FD*/
-#define TCGETS2                _IOR('T', 42, struct termios2)
-#define TCSETS2                _IOW('T', 43, struct termios2)
-#define TCSETSW2       _IOW('T', 44, struct termios2)
-#define TCSETSF2       _IOW('T', 45, struct termios2)
-#define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
-#define TIOCGDEV       _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
-#define TIOCSIG                _IOW('T',0x36, int)  /* Generate signal on Pty slave */
-#define TIOCVHANGUP    _IO('T', 0x37)
-
-#define TIOCSERCONFIG  _IO('T', 83)
-#define TIOCSERGWILD   _IOR('T', 84,  int)
-#define TIOCSERSWILD   _IOW('T', 85,  int)
-#define TIOCGLCKTRMIOS 0x5456
-#define TIOCSLCKTRMIOS 0x5457
-#define TIOCSERGSTRUCT 0x5458               /* For debugging only */
-#define TIOCSERGETLSR   _IOR('T', 89, unsigned int) /* Get line status reg. */
-  /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-# define TIOCSER_TEMT    0x01               /* Transmitter physically empty */
-#define TIOCSERGETMULTI _IOR('T', 90, struct serial_multiport_struct) /* Get multiport config  */
-#define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */
-
-#define TIOCMIWAIT     _IO('T', 92) /* wait for a change on serial input line(s) */
-#define TIOCGICOUNT    0x545D  /* read serial port inline interrupt counts */
-
-#endif /* _XTENSA_IOCTLS_H */
diff --git a/arch/xtensa/include/asm/ipcbuf.h b/arch/xtensa/include/asm/ipcbuf.h
deleted file mode 100644 (file)
index c33aa6a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * include/asm-xtensa/ipcbuf.h
- *
- * The ipc64_perm structure for the Xtensa architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_IPCBUF_H
-#define _XTENSA_IPCBUF_H
-
-/*
- * Pad space is left for:
- * - 32-bit mode_t and seq
- * - 2 miscellaneous 32-bit values
- *
- * This file is subject to the terms and conditions of the GNU General
- * Public License.  See the file "COPYING" in the main directory of
- * this archive for more details.
- */
-
-struct ipc64_perm
-{
-       __kernel_key_t          key;
-       __kernel_uid32_t        uid;
-       __kernel_gid32_t        gid;
-       __kernel_uid32_t        cuid;
-       __kernel_gid32_t        cgid;
-       __kernel_mode_t         mode;
-       unsigned long           seq;
-       unsigned long           __unused1;
-       unsigned long           __unused2;
-};
-
-#endif /* _XTENSA_IPCBUF_H */
diff --git a/arch/xtensa/include/asm/irq_regs.h b/arch/xtensa/include/asm/irq_regs.h
deleted file mode 100644 (file)
index 3dd9c0b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/irq_regs.h>
index dae9a8bdcb1725ce6a38db642fdc777403d354e1..f865b1c1eae497fefdba3cccf90ac07d218e9d06 100644 (file)
@@ -16,7 +16,7 @@
 static inline unsigned long arch_local_save_flags(void)
 {
        unsigned long flags;
-       asm volatile("rsr %0,"__stringify(PS) : "=a" (flags));
+       asm volatile("rsr %0, ps" : "=a" (flags));
        return flags;
 }
 
@@ -41,7 +41,7 @@ static inline void arch_local_irq_enable(void)
 
 static inline void arch_local_irq_restore(unsigned long flags)
 {
-       asm volatile("wsr %0, "__stringify(PS)" ; rsync"
+       asm volatile("wsr %0, ps; rsync"
                     :: "a" (flags) : "memory");
 }
 
diff --git a/arch/xtensa/include/asm/kdebug.h b/arch/xtensa/include/asm/kdebug.h
deleted file mode 100644 (file)
index 6ece1b0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/kdebug.h>
diff --git a/arch/xtensa/include/asm/kmap_types.h b/arch/xtensa/include/asm/kmap_types.h
deleted file mode 100644 (file)
index 11c687e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _XTENSA_KMAP_TYPES_H
-#define _XTENSA_KMAP_TYPES_H
-
-#include <asm-generic/kmap_types.h>
-
-#endif /* _XTENSA_KMAP_TYPES_H */
diff --git a/arch/xtensa/include/asm/kvm_para.h b/arch/xtensa/include/asm/kvm_para.h
deleted file mode 100644 (file)
index 14fab8f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/kvm_para.h>
diff --git a/arch/xtensa/include/asm/local.h b/arch/xtensa/include/asm/local.h
deleted file mode 100644 (file)
index 48723e5..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * include/asm-xtensa/local.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_LOCAL_H
-#define _XTENSA_LOCAL_H
-
-#include <asm-generic/local.h>
-
-#endif /* _XTENSA_LOCAL_H */
diff --git a/arch/xtensa/include/asm/local64.h b/arch/xtensa/include/asm/local64.h
deleted file mode 100644 (file)
index 36c93b5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/local64.h>
diff --git a/arch/xtensa/include/asm/mman.h b/arch/xtensa/include/asm/mman.h
deleted file mode 100644 (file)
index 25bc6c1..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * include/asm-xtensa/mman.h
- *
- * Xtensa Processor memory-manager definitions
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1995 by Ralf Baechle
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_MMAN_H
-#define _XTENSA_MMAN_H
-
-/*
- * Protections are chosen from these bits, OR'd together.  The
- * implementation does not necessarily support PROT_EXEC or PROT_WRITE
- * without PROT_READ.  The only guarantees are that no writing will be
- * allowed without PROT_WRITE and no access will be allowed for PROT_NONE.
- */
-
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-
-#define PROT_SEM       0x10            /* page may be used for atomic ops */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end fo growsup vma */
-
-/*
- * Flags for mmap
- */
-#define MAP_SHARED     0x001           /* Share changes */
-#define MAP_PRIVATE    0x002           /* Changes are private */
-#define MAP_TYPE       0x00f           /* Mask for type of mapping */
-#define MAP_FIXED      0x010           /* Interpret addr exactly */
-
-/* not used by linux, but here to make sure we don't clash with ABI defines */
-#define MAP_RENAME     0x020           /* Assign page to file */
-#define MAP_AUTOGROW   0x040           /* File may grow by writing */
-#define MAP_LOCAL      0x080           /* Copy on fork/sproc */
-#define MAP_AUTORSRV   0x100           /* Logical swap reserved on demand */
-
-/* These are linux-specific */
-#define MAP_NORESERVE  0x0400          /* don't check for reservations */
-#define MAP_ANONYMOUS  0x0800          /* don't use a file */
-#define MAP_GROWSDOWN  0x1000          /* stack-like segment */
-#define MAP_DENYWRITE  0x2000          /* ETXTBSY */
-#define MAP_EXECUTABLE 0x4000          /* mark it as an executable */
-#define MAP_LOCKED     0x8000          /* pages are locked */
-#define MAP_POPULATE   0x10000         /* populate (prefault) pagetables */
-#define MAP_NONBLOCK   0x20000         /* do not block on IO */
-#define MAP_STACK      0x40000         /* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB    0x80000         /* create a huge page mapping */
-
-/*
- * Flags for msync
- */
-#define MS_ASYNC       0x0001          /* sync memory asynchronously */
-#define MS_INVALIDATE  0x0002          /* invalidate mappings & caches */
-#define MS_SYNC                0x0004          /* synchronous memory sync */
-
-/*
- * Flags for mlockall
- */
-#define MCL_CURRENT    1               /* lock all current mappings */
-#define MCL_FUTURE     2               /* lock all future mappings */
-
-#define MADV_NORMAL    0               /* no further special treatment */
-#define MADV_RANDOM    1               /* expect random page references */
-#define MADV_SEQUENTIAL        2               /* expect sequential page references */
-#define MADV_WILLNEED  3               /* will need these pages */
-#define MADV_DONTNEED  4               /* don't need these pages */
-
-/* common parameters: try to keep these consistent across architectures */
-#define MADV_REMOVE    9               /* remove these pages & resources */
-#define MADV_DONTFORK  10              /* don't inherit across fork */
-#define MADV_DOFORK    11              /* do inherit across fork */
-
-#define MADV_MERGEABLE   12            /* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 13            /* KSM may not merge identical pages */
-
-#define MADV_HUGEPAGE  14              /* Worth backing with hugepages */
-#define MADV_NOHUGEPAGE        15              /* Not worth backing with hugepages */
-
-#define MADV_DONTDUMP   16             /* Explicity exclude from the core dump,
-                                          overrides the coredump filter bits */
-#define MADV_DODUMP    17              /* Clear the MADV_NODUMP flag */
-
-/* compatibility flags */
-#define MAP_FILE       0
-
-#endif /* _XTENSA_MMAN_H */
index dbd8731a876aec90c2765df2dd1a1c6d5e2310d0..feb10af96519900e3cf64341b6c425b5e017e924 100644 (file)
@@ -51,14 +51,14 @@ extern unsigned long asid_cache;
 
 static inline void set_rasid_register (unsigned long val)
 {
-       __asm__ __volatile__ (" wsr %0, "__stringify(RASID)"\n\t"
+       __asm__ __volatile__ (" wsr %0, rasid\n\t"
                              " isync\n" : : "a" (val));
 }
 
 static inline unsigned long get_rasid_register (void)
 {
        unsigned long tmp;
-       __asm__ __volatile__ (" rsr %0,"__stringify(RASID)"\n\t" : "=a" (tmp));
+       __asm__ __volatile__ (" rsr %0, rasid\n\t" : "=a" (tmp));
        return tmp;
 }
 
diff --git a/arch/xtensa/include/asm/msgbuf.h b/arch/xtensa/include/asm/msgbuf.h
deleted file mode 100644 (file)
index 693c967..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * include/asm-xtensa/msgbuf.h
- *
- * The msqid64_ds structure for the Xtensa architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 64-bit time_t to solve y2038 problem
- * - 2 miscellaneous 32-bit values
- *
- * This file is subject to the terms and conditions of the GNU General
- * Public License.  See the file "COPYING" in the main directory of
- * this archive for more details.
- */
-
-#ifndef _XTENSA_MSGBUF_H
-#define _XTENSA_MSGBUF_H
-
-struct msqid64_ds {
-       struct ipc64_perm msg_perm;
-#ifdef __XTENSA_EB__
-       unsigned int    __unused1;
-       __kernel_time_t msg_stime;      /* last msgsnd time */
-       unsigned int    __unused2;
-       __kernel_time_t msg_rtime;      /* last msgrcv time */
-       unsigned int    __unused3;
-       __kernel_time_t msg_ctime;      /* last change time */
-#elif defined(__XTENSA_EL__)
-       __kernel_time_t msg_stime;      /* last msgsnd time */
-       unsigned int    __unused1;
-       __kernel_time_t msg_rtime;      /* last msgrcv time */
-       unsigned int    __unused2;
-       __kernel_time_t msg_ctime;      /* last change time */
-       unsigned int    __unused3;
-#else
-# error processor byte order undefined!
-#endif
-       unsigned long  msg_cbytes;      /* current number of bytes on queue */
-       unsigned long  msg_qnum;        /* number of messages in queue */
-       unsigned long  msg_qbytes;      /* max number of bytes on queue */
-       __kernel_pid_t msg_lspid;       /* pid of last msgsnd */
-       __kernel_pid_t msg_lrpid;       /* last receive pid */
-       unsigned long  __unused4;
-       unsigned long  __unused5;
-};
-
-#endif /* _XTENSA_MSGBUF_H */
index ba03d5aeab6b085d21bd0b14db47163552f04be7..0a70e780ef2a33f3466fe9201897578d2771ba70 100644 (file)
@@ -7,28 +7,12 @@
  *
  * Copyright (C) 2001 - 2005 Tensilica Inc.
  */
-
 #ifndef _XTENSA_PARAM_H
 #define _XTENSA_PARAM_H
 
-#ifdef __KERNEL__
+#include <uapi/asm/param.h>
+
 # define HZ            CONFIG_HZ       /* internal timer frequency */
 # define USER_HZ       100             /* for user interfaces in "ticks" */
 # define CLOCKS_PER_SEC (USER_HZ)      /* frequnzy at which times() counts */
-#else
-# define HZ            100
-#endif
-
-#define EXEC_PAGESIZE  4096
-
-#ifndef NGROUPS
-#define NGROUPS                32
-#endif
-
-#ifndef NOGROUP
-#define NOGROUP                (-1)
-#endif
-
-#define MAXHOSTNAMELEN 64      /* max length of hostname */
-
 #endif /* _XTENSA_PARAM_H */
diff --git a/arch/xtensa/include/asm/percpu.h b/arch/xtensa/include/asm/percpu.h
deleted file mode 100644 (file)
index 6d2bc2a..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * linux/include/asm-xtensa/percpu.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_PERCPU__
-#define _XTENSA_PERCPU__
-
-#include <asm-generic/percpu.h>
-
-#endif /* _XTENSA_PERCPU__ */
diff --git a/arch/xtensa/include/asm/poll.h b/arch/xtensa/include/asm/poll.h
deleted file mode 100644 (file)
index 9d2d599..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * include/asm-xtensa/poll.h
- *
- * This file is subject to the terms and conditions of the GNU General
- * Public License.  See the file "COPYING" in the main directory of
- * this archive for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_POLL_H
-#define _XTENSA_POLL_H
-
-#define POLLWRNORM     POLLOUT
-#define POLLWRBAND     0x0100
-#define POLLREMOVE     0x0800
-
-#include <asm-generic/poll.h>
-
-#endif /* _XTENSA_POLL_H */
diff --git a/arch/xtensa/include/asm/posix_types.h b/arch/xtensa/include/asm/posix_types.h
deleted file mode 100644 (file)
index 6e96be0..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * include/asm-xtensa/posix_types.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Largely copied from include/asm-ppc/posix_types.h
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_POSIX_TYPES_H
-#define _XTENSA_POSIX_TYPES_H
-
-/*
- * This file is generally used by user-level software, so you need to
- * be a little careful about namespace pollution etc.  Also, we cannot
- * assume GCC is being used.
- */
-
-typedef unsigned short __kernel_ipc_pid_t;
-#define __kernel_ipc_pid_t __kernel_ipc_pid_t
-
-typedef unsigned int   __kernel_size_t;
-typedef int            __kernel_ssize_t;
-typedef long           __kernel_ptrdiff_t;
-#define __kernel_size_t __kernel_size_t
-
-typedef unsigned short __kernel_old_uid_t;
-typedef unsigned short __kernel_old_gid_t;
-#define __kernel_old_uid_t __kernel_old_uid_t
-
-typedef unsigned short __kernel_old_dev_t;
-#define __kernel_old_dev_t __kernel_old_dev_t
-
-#include <asm-generic/posix_types.h>
-
-#endif /* _XTENSA_POSIX_TYPES_H */
index d85d38da8eecc28df1be5c318e08e550b4b7e4eb..da21c17f23aad235c313c02683e87ccbfb9e23bf 100644 (file)
@@ -7,73 +7,11 @@
  *
  * Copyright (C) 2001 - 2005 Tensilica Inc.
  */
-
 #ifndef _XTENSA_PTRACE_H
 #define _XTENSA_PTRACE_H
 
-/*
- * Kernel stack
- *
- *             +-----------------------+  -------- STACK_SIZE
- *             |     register file     |  |
- *             +-----------------------+  |
- *             |    struct pt_regs     |  |
- *             +-----------------------+  | ------ PT_REGS_OFFSET
- * double      :  16 bytes spill area  :  |  ^
- * excetion    :- - - - - - - - - - - -:  |  |
- * frame       :    struct pt_regs     :  |  |
- *             :- - - - - - - - - - - -:  |  |
- *             |                       |  |  |
- *             |     memory stack      |  |  |
- *             |                       |  |  |
- *             ~                       ~  ~  ~
- *             ~                       ~  ~  ~
- *             |                       |  |  |
- *             |                       |  |  |
- *             +-----------------------+  |  | --- STACK_BIAS
- *             |  struct task_struct   |  |  |  ^
- *  current --> +-----------------------+  |  |  |
- *             |  struct thread_info   |  |  |  |
- *             +-----------------------+ --------
- */
-
-#define KERNEL_STACK_SIZE (2 * PAGE_SIZE)
-
-/*  Offsets for exception_handlers[] (3 x 64-entries x 4-byte tables). */
-
-#define EXC_TABLE_KSTK         0x004   /* Kernel Stack */
-#define EXC_TABLE_DOUBLE_SAVE  0x008   /* Double exception save area for a0 */
-#define EXC_TABLE_FIXUP                0x00c   /* Fixup handler */
-#define EXC_TABLE_PARAM                0x010   /* For passing a parameter to fixup */
-#define EXC_TABLE_SYSCALL_SAVE 0x014   /* For fast syscall handler */
-#define EXC_TABLE_FAST_USER    0x100   /* Fast user exception handler */
-#define EXC_TABLE_FAST_KERNEL  0x200   /* Fast kernel exception handler */
-#define EXC_TABLE_DEFAULT      0x300   /* Default C-Handler */
-#define EXC_TABLE_SIZE         0x400
+#include <uapi/asm/ptrace.h>
 
-/* Registers used by strace */
-
-#define REG_A_BASE     0x0000
-#define REG_AR_BASE    0x0100
-#define REG_PC         0x0020
-#define REG_PS         0x02e6
-#define REG_WB         0x0248
-#define REG_WS         0x0249
-#define REG_LBEG       0x0200
-#define REG_LEND       0x0201
-#define REG_LCOUNT     0x0202
-#define REG_SAR                0x0203
-
-#define SYSCALL_NR     0x00ff
-
-/* Other PTRACE_ values defined in <linux/ptrace.h> using values 0-9,16,17,24 */
-
-#define PTRACE_GETREGS         12
-#define PTRACE_SETREGS         13
-#define PTRACE_GETXTREGS       18
-#define PTRACE_SETXTREGS       19
-
-#ifdef __KERNEL__
 
 #ifndef __ASSEMBLY__
 
@@ -132,6 +70,4 @@ struct pt_regs {
 
 #endif /* !__ASSEMBLY__ */
 
-#endif  /* __KERNEL__ */
-
 #endif /* _XTENSA_PTRACE_H */
index a3075b12aff112c4f3ed7176fccb8125b9336db8..8a8aa61ccc8df27075e4f2671715e9884571cc26 100644 (file)
 
 /*  Special registers.  */
 
-#define LBEG           0
-#define LEND           1
-#define LCOUNT         2
-#define SAR            3
-#define BR             4
-#define SCOMPARE1      12
-#define ACCHI          16
-#define ACCLO          17
-#define MR             32
-#define WINDOWBASE     72
-#define WINDOWSTART    73
-#define PTEVADDR       83
-#define RASID          90
-#define ITLBCFG                91
-#define DTLBCFG                92
-#define IBREAKENABLE   96
-#define DDR            104
-#define IBREAKA                128
-#define DBREAKA                144
-#define DBREAKC                160
-#define EPC            176
-#define EPC_1          177
-#define DEPC           192
-#define EPS            192
-#define EPS_1          193
-#define EXCSAVE                208
-#define EXCSAVE_1      209
-#define INTERRUPT      226
-#define INTENABLE      228
-#define PS             230
-#define THREADPTR      231
-#define EXCCAUSE       232
-#define DEBUGCAUSE     233
-#define CCOUNT         234
-#define PRID           235
-#define ICOUNT         236
-#define ICOUNTLEVEL    237
-#define EXCVADDR       238
-#define CCOMPARE       240
-#define MISC_SR                244
-
-/*  Special names for read-only and write-only interrupt registers.  */
-
-#define INTREAD                226
-#define INTSET         226
-#define INTCLEAR       227
+#define SREG_MR                        32
+#define SREG_IBREAKA           128
+#define SREG_DBREAKA           144
+#define SREG_DBREAKC           160
+#define SREG_EPC               176
+#define SREG_EPS               192
+#define SREG_EXCSAVE           208
+#define SREG_CCOMPARE          240
+#define SREG_MISC              244
 
 /*  EXCCAUSE register fields  */
 
diff --git a/arch/xtensa/include/asm/resource.h b/arch/xtensa/include/asm/resource.h
deleted file mode 100644 (file)
index 17b5ab3..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * include/asm-xtensa/resource.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_RESOURCE_H
-#define _XTENSA_RESOURCE_H
-
-#include <asm-generic/resource.h>
-
-#endif /* _XTENSA_RESOURCE_H */
diff --git a/arch/xtensa/include/asm/scatterlist.h b/arch/xtensa/include/asm/scatterlist.h
deleted file mode 100644 (file)
index a0421a6..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * include/asm-xtensa/scatterlist.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_SCATTERLIST_H
-#define _XTENSA_SCATTERLIST_H
-
-#include <asm-generic/scatterlist.h>
-
-#endif /* _XTENSA_SCATTERLIST_H */
diff --git a/arch/xtensa/include/asm/sections.h b/arch/xtensa/include/asm/sections.h
deleted file mode 100644 (file)
index 40b5191..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * include/asm-xtensa/sections.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_SECTIONS_H
-#define _XTENSA_SECTIONS_H
-
-#include <asm-generic/sections.h>
-
-#endif /* _XTENSA_SECTIONS_H */
diff --git a/arch/xtensa/include/asm/sembuf.h b/arch/xtensa/include/asm/sembuf.h
deleted file mode 100644 (file)
index c158704..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * include/asm-xtensa/sembuf.h
- *
- * The semid64_ds structure for Xtensa architecture.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- *
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 64-bit time_t to solve y2038 problem
- * - 2 miscellaneous 32-bit values
- *
- */
-
-#ifndef _XTENSA_SEMBUF_H
-#define _XTENSA_SEMBUF_H
-
-#include <asm/byteorder.h>
-
-struct semid64_ds {
-       struct ipc64_perm sem_perm;             /* permissions .. see ipc.h */
-#ifdef __XTENSA_EL__
-       __kernel_time_t sem_otime;              /* last semop time */
-       unsigned long   __unused1;
-       __kernel_time_t sem_ctime;              /* last change time */
-       unsigned long   __unused2;
-#else
-       unsigned long   __unused1;
-       __kernel_time_t sem_otime;              /* last semop time */
-       unsigned long   __unused2;
-       __kernel_time_t sem_ctime;              /* last change time */
-#endif
-       unsigned long   sem_nsems;              /* no. of semaphores in array */
-       unsigned long   __unused3;
-       unsigned long   __unused4;
-};
-
-#endif /* __ASM_XTENSA_SEMBUF_H */
diff --git a/arch/xtensa/include/asm/setup.h b/arch/xtensa/include/asm/setup.h
deleted file mode 100644 (file)
index 9fa8ad9..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * include/asm-xtensa/setup.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_SETUP_H
-#define _XTENSA_SETUP_H
-
-#define COMMAND_LINE_SIZE      256
-
-extern void set_except_vector(int n, void *addr);
-
-#endif
diff --git a/arch/xtensa/include/asm/shmbuf.h b/arch/xtensa/include/asm/shmbuf.h
deleted file mode 100644 (file)
index ad4b012..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * include/asm-xtensa/shmbuf.h
- *
- * The shmid64_ds structure for Xtensa architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 64-bit time_t to solve y2038 problem
- * - 2 miscellaneous 32-bit values
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_SHMBUF_H
-#define _XTENSA_SHMBUF_H
-
-#if defined (__XTENSA_EL__)
-struct shmid64_ds {
-       struct ipc64_perm       shm_perm;       /* operation perms */
-       size_t                  shm_segsz;      /* size of segment (bytes) */
-       __kernel_time_t         shm_atime;      /* last attach time */
-       unsigned long           __unused1;
-       __kernel_time_t         shm_dtime;      /* last detach time */
-       unsigned long           __unused2;
-       __kernel_time_t         shm_ctime;      /* last change time */
-       unsigned long           __unused3;
-       __kernel_pid_t          shm_cpid;       /* pid of creator */
-       __kernel_pid_t          shm_lpid;       /* pid of last operator */
-       unsigned long           shm_nattch;     /* no. of current attaches */
-       unsigned long           __unused4;
-       unsigned long           __unused5;
-};
-#elif defined (__XTENSA_EB__)
-struct shmid64_ds {
-       struct ipc64_perm       shm_perm;       /* operation perms */
-       size_t                  shm_segsz;      /* size of segment (bytes) */
-       __kernel_time_t         shm_atime;      /* last attach time */
-       unsigned long           __unused1;
-       __kernel_time_t         shm_dtime;      /* last detach time */
-       unsigned long           __unused2;
-       __kernel_time_t         shm_ctime;      /* last change time */
-       unsigned long           __unused3;
-       __kernel_pid_t          shm_cpid;       /* pid of creator */
-       __kernel_pid_t          shm_lpid;       /* pid of last operator */
-       unsigned long           shm_nattch;     /* no. of current attaches */
-       unsigned long           __unused4;
-       unsigned long           __unused5;
-};
-#else
-# error endian order not defined
-#endif
-
-
-struct shminfo64 {
-       unsigned long   shmmax;
-       unsigned long   shmmin;
-       unsigned long   shmmni;
-       unsigned long   shmseg;
-       unsigned long   shmall;
-       unsigned long   __unused1;
-       unsigned long   __unused2;
-       unsigned long   __unused3;
-       unsigned long   __unused4;
-};
-
-#endif /* _XTENSA_SHMBUF_H */
diff --git a/arch/xtensa/include/asm/sigcontext.h b/arch/xtensa/include/asm/sigcontext.h
deleted file mode 100644 (file)
index 03383af..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * include/asm-xtensa/sigcontext.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2007 Tensilica Inc.
- */
-
-#ifndef _XTENSA_SIGCONTEXT_H
-#define _XTENSA_SIGCONTEXT_H
-
-
-struct sigcontext {
-       unsigned long sc_pc;
-       unsigned long sc_ps;
-       unsigned long sc_lbeg;
-       unsigned long sc_lend;
-       unsigned long sc_lcount;
-       unsigned long sc_sar;
-       unsigned long sc_acclo;
-       unsigned long sc_acchi;
-       unsigned long sc_a[16];
-       void *sc_xtregs;
-};
-
-#endif /* _XTENSA_SIGCONTEXT_H */
diff --git a/arch/xtensa/include/asm/siginfo.h b/arch/xtensa/include/asm/siginfo.h
deleted file mode 100644 (file)
index 6916248..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * include/asm-xtensa/siginfo.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_SIGINFO_H
-#define _XTENSA_SIGINFO_H
-
-#include <asm-generic/siginfo.h>
-
-#endif /* _XTENSA_SIGINFO_H */
index 7f201b9d4195747f153c13f4e2f495fd53343bf5..72fd44c85b702ad3c2c78da2e6cf64bc74545d46 100644 (file)
  *
  * Copyright (C) 2001 - 2005 Tensilica Inc.
  */
-
 #ifndef _XTENSA_SIGNAL_H
 #define _XTENSA_SIGNAL_H
 
-
-#define _NSIG          64
-#define _NSIG_BPW      32
-#define _NSIG_WORDS    (_NSIG / _NSIG_BPW)
-
-#ifndef __ASSEMBLY__
-
-#include <linux/types.h>
-
-/* Avoid too many header ordering problems.  */
-struct siginfo;
-typedef unsigned long old_sigset_t;            /* at least 32 bits */
-typedef struct {
-       unsigned long sig[_NSIG_WORDS];
-} sigset_t;
-
-#endif
-
-#define SIGHUP          1
-#define SIGINT          2
-#define SIGQUIT                 3
-#define SIGILL          4
-#define SIGTRAP                 5
-#define SIGABRT                 6
-#define SIGIOT          6
-#define SIGBUS          7
-#define SIGFPE          8
-#define SIGKILL                 9
-#define SIGUSR1                10
-#define SIGSEGV                11
-#define SIGUSR2                12
-#define SIGPIPE                13
-#define SIGALRM                14
-#define SIGTERM                15
-#define SIGSTKFLT      16
-#define SIGCHLD                17
-#define SIGCONT                18
-#define SIGSTOP                19
-#define SIGTSTP                20
-#define SIGTTIN                21
-#define SIGTTOU                22
-#define SIGURG         23
-#define SIGXCPU                24
-#define SIGXFSZ                25
-#define SIGVTALRM      26
-#define SIGPROF                27
-#define SIGWINCH       28
-#define SIGIO          29
-#define SIGPOLL                SIGIO
-/* #define SIGLOST             29 */
-#define SIGPWR         30
-#define SIGSYS         31
-#define        SIGUNUSED       31
-
-/* These should not be considered constants from userland.  */
-#define SIGRTMIN       32
-#define SIGRTMAX       (_NSIG-1)
-
-/*
- * SA_FLAGS values:
- *
- * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_RESTART flag to get restarting signals (which were the default long ago)
- * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
- * SA_RESETHAND clears the handler when the signal is delivered.
- * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
- * SA_NODEFER prevents the current signal from being masked in the handler.
- *
- * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
- * Unix names RESETHAND and NODEFER respectively.
- */
-#define SA_NOCLDSTOP   0x00000001
-#define SA_NOCLDWAIT   0x00000002 /* not supported yet */
-#define SA_SIGINFO     0x00000004
-#define SA_ONSTACK     0x08000000
-#define SA_RESTART     0x10000000
-#define SA_NODEFER     0x40000000
-#define SA_RESETHAND   0x80000000
-
-#define SA_NOMASK      SA_NODEFER
-#define SA_ONESHOT     SA_RESETHAND
-
-#define SA_RESTORER    0x04000000
-
-/*
- * sigaltstack controls
- */
-#define SS_ONSTACK     1
-#define SS_DISABLE     2
-
-#define MINSIGSTKSZ    2048
-#define SIGSTKSZ       8192
+#include <uapi/asm/signal.h>
 
 #ifndef __ASSEMBLY__
-
-#define SIG_BLOCK          0   /* for blocking signals */
-#define SIG_UNBLOCK        1   /* for unblocking signals */
-#define SIG_SETMASK        2   /* for setting the signal mask */
-
-/* Type of a signal handler.  */
-typedef void (*__sighandler_t)(int);
-
-#define SIG_DFL        ((__sighandler_t)0)     /* default signal handling */
-#define SIG_IGN        ((__sighandler_t)1)     /* ignore signal */
-#define SIG_ERR        ((__sighandler_t)-1)    /* error return from signal */
-
-#ifdef __KERNEL__
 struct sigaction {
        __sighandler_t sa_handler;
        unsigned long sa_flags;
@@ -131,35 +26,8 @@ struct k_sigaction {
        struct sigaction sa;
 };
 
-#else
-
-/* Here we must cater to libcs that poke about in kernel headers.  */
-
-struct sigaction {
-       union {
-         __sighandler_t _sa_handler;
-         void (*_sa_sigaction)(int, struct siginfo *, void *);
-       } _u;
-       sigset_t sa_mask;
-       unsigned long sa_flags;
-       void (*sa_restorer)(void);
-};
-
-#define sa_handler     _u._sa_handler
-#define sa_sigaction   _u._sa_sigaction
-
-#endif /* __KERNEL__ */
-
-typedef struct sigaltstack {
-       void *ss_sp;
-       int ss_flags;
-       size_t ss_size;
-} stack_t;
-
-#ifdef __KERNEL__
 #include <asm/sigcontext.h>
 #define ptrace_signal_deliver(regs, cookie) do { } while (0)
 
-#endif /* __KERNEL__ */
 #endif /* __ASSEMBLY__ */
 #endif /* _XTENSA_SIGNAL_H */
diff --git a/arch/xtensa/include/asm/socket.h b/arch/xtensa/include/asm/socket.h
deleted file mode 100644 (file)
index e36c681..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * include/asm-xtensa/socket.h
- *
- * Copied from i386.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-
-#ifndef _XTENSA_SOCKET_H
-#define _XTENSA_SOCKET_H
-
-#include <asm/sockios.h>
-
-/* For setsockoptions(2) */
-#define SOL_SOCKET     1
-
-#define SO_DEBUG       1
-#define SO_REUSEADDR   2
-#define SO_TYPE                3
-#define SO_ERROR       4
-#define SO_DONTROUTE   5
-#define SO_BROADCAST   6
-#define SO_SNDBUF      7
-#define SO_RCVBUF      8
-#define SO_SNDBUFFORCE 32
-#define SO_RCVBUFFORCE 33
-#define SO_KEEPALIVE   9
-#define SO_OOBINLINE   10
-#define SO_NO_CHECK    11
-#define SO_PRIORITY    12
-#define SO_LINGER      13
-#define SO_BSDCOMPAT   14
-/* To add :#define SO_REUSEPORT 15 */
-#define SO_PASSCRED    16
-#define SO_PEERCRED    17
-#define SO_RCVLOWAT    18
-#define SO_SNDLOWAT    19
-#define SO_RCVTIMEO    20
-#define SO_SNDTIMEO    21
-
-/* Security levels - as per NRL IPv6 - don't actually do anything */
-
-#define SO_SECURITY_AUTHENTICATION             22
-#define SO_SECURITY_ENCRYPTION_TRANSPORT       23
-#define SO_SECURITY_ENCRYPTION_NETWORK         24
-
-#define SO_BINDTODEVICE        25
-
-/* Socket filtering */
-
-#define SO_ATTACH_FILTER        26
-#define SO_DETACH_FILTER        27
-
-#define SO_PEERNAME            28
-#define SO_TIMESTAMP           29
-#define SCM_TIMESTAMP          SO_TIMESTAMP
-
-#define SO_ACCEPTCONN          30
-#define SO_PEERSEC             31
-#define SO_PASSSEC             34
-#define SO_TIMESTAMPNS         35
-#define SCM_TIMESTAMPNS                SO_TIMESTAMPNS
-
-#define SO_MARK                        36
-
-#define SO_TIMESTAMPING                37
-#define SCM_TIMESTAMPING       SO_TIMESTAMPING
-
-#define SO_PROTOCOL            38
-#define SO_DOMAIN              39
-
-#define SO_RXQ_OVFL             40
-
-#define SO_WIFI_STATUS         41
-#define SCM_WIFI_STATUS                SO_WIFI_STATUS
-#define SO_PEEK_OFF            42
-
-/* Instruct lower device to use last 4-bytes of skb data as FCS */
-#define SO_NOFCS               43
-
-#endif /* _XTENSA_SOCKET_H */
diff --git a/arch/xtensa/include/asm/sockios.h b/arch/xtensa/include/asm/sockios.h
deleted file mode 100644 (file)
index efe0af3..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * include/asm-xtensa/sockios.h
- *
- * Socket-level I/O control calls.  Copied from MIPS.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1995 by Ralf Baechle
- * Copyright (C) 2001 Tensilica Inc.
- */
-
-#ifndef _XTENSA_SOCKIOS_H
-#define _XTENSA_SOCKIOS_H
-
-#include <asm/ioctl.h>
-
-/* Socket-level I/O control calls. */
-
-#define FIOGETOWN      _IOR('f', 123, int)
-#define FIOSETOWN      _IOW('f', 124, int)
-
-#define SIOCATMARK     _IOR('s', 7, int)
-#define SIOCSPGRP      _IOW('s', 8, pid_t)
-#define SIOCGPGRP      _IOR('s', 9, pid_t)
-
-#define SIOCGSTAMP     0x8906          /* Get stamp (timeval) */
-#define SIOCGSTAMPNS   0x8907          /* Get stamp (timespec) */
-
-#endif /* _XTENSA_SOCKIOS_H */
diff --git a/arch/xtensa/include/asm/stat.h b/arch/xtensa/include/asm/stat.h
deleted file mode 100644 (file)
index c499203..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * include/asm-xtensa/stat.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2007 Tensilica Inc.
- */
-
-#ifndef _XTENSA_STAT_H
-#define _XTENSA_STAT_H
-
-#define STAT_HAVE_NSEC 1
-
-struct stat {
-       unsigned long   st_dev;
-       unsigned long   st_ino;
-       unsigned int    st_mode;
-       unsigned int    st_nlink;
-       unsigned int    st_uid;
-       unsigned int    st_gid;
-       unsigned long   st_rdev;
-       long            st_size;
-       unsigned long   st_blksize;
-       unsigned long   st_blocks;
-       unsigned long   st_atime;
-       unsigned long   st_atime_nsec;
-       unsigned long   st_mtime;
-       unsigned long   st_mtime_nsec;
-       unsigned long   st_ctime;
-       unsigned long   st_ctime_nsec;
-       unsigned long   __unused4;
-       unsigned long   __unused5;
-};
-
-struct stat64  {
-       unsigned long long st_dev;      /* Device */
-       unsigned long long st_ino;      /* File serial number */
-       unsigned int  st_mode;          /* File mode. */
-       unsigned int  st_nlink;         /* Link count. */
-       unsigned int  st_uid;           /* User ID of the file's owner. */
-       unsigned int  st_gid;           /* Group ID of the file's group. */
-       unsigned long long st_rdev;     /* Device number, if device. */
-       long long st_size;              /* Size of file, in bytes. */
-       unsigned long st_blksize;       /* Optimal block size for I/O. */
-       unsigned long __unused2;
-       unsigned long long st_blocks;   /* Number 512-byte blocks allocated. */
-       unsigned long st_atime;         /* Time of last access. */
-       unsigned long st_atime_nsec;
-       unsigned long st_mtime;         /* Time of last modification. */
-       unsigned long st_mtime_nsec;
-       unsigned long st_ctime;         /* Time of last status change. */
-       unsigned long st_ctime_nsec;
-       unsigned long __unused4;
-       unsigned long __unused5;
-};
-
-#endif /* _XTENSA_STAT_H */
diff --git a/arch/xtensa/include/asm/statfs.h b/arch/xtensa/include/asm/statfs.h
deleted file mode 100644 (file)
index 9c3d1a2..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * include/asm-xtensa/statfs.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_STATFS_H
-#define _XTENSA_STATFS_H
-
-#include <asm-generic/statfs.h>
-
-#endif /* _XTENSA_STATFS_H */
-
diff --git a/arch/xtensa/include/asm/swab.h b/arch/xtensa/include/asm/swab.h
deleted file mode 100644 (file)
index 226a391..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * include/asm-xtensa/swab.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_SWAB_H
-#define _XTENSA_SWAB_H
-
-#include <linux/types.h>
-#include <linux/compiler.h>
-
-#define __SWAB_64_THRU_32__
-
-static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
-{
-    __u32 res;
-    /* instruction sequence from Xtensa ISA release 2/2000 */
-    __asm__("ssai     8           \n\t"
-           "srli     %0, %1, 16  \n\t"
-           "src      %0, %0, %1  \n\t"
-           "src      %0, %0, %0  \n\t"
-           "src      %0, %1, %0  \n"
-           : "=&a" (res)
-           : "a" (x)
-           );
-    return res;
-}
-#define __arch_swab32 __arch_swab32
-
-static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
-{
-    /* Given that 'short' values are signed (i.e., can be negative),
-     * we cannot assume that the upper 16-bits of the register are
-     * zero.  We are careful to mask values after shifting.
-     */
-
-    /* There exists an anomaly between xt-gcc and xt-xcc.  xt-gcc
-     * inserts an extui instruction after putting this function inline
-     * to ensure that it uses only the least-significant 16 bits of
-     * the result.  xt-xcc doesn't use an extui, but assumes the
-     * __asm__ macro follows convention that the upper 16 bits of an
-     * 'unsigned short' result are still zero.  This macro doesn't
-     * follow convention; indeed, it leaves garbage in the upport 16
-     * bits of the register.
-
-     * Declaring the temporary variables 'res' and 'tmp' to be 32-bit
-     * types while the return type of the function is a 16-bit type
-     * forces both compilers to insert exactly one extui instruction
-     * (or equivalent) to mask off the upper 16 bits. */
-
-    __u32 res;
-    __u32 tmp;
-
-    __asm__("extui    %1, %2, 8, 8\n\t"
-           "slli     %0, %2, 8   \n\t"
-           "or       %0, %0, %1  \n"
-           : "=&a" (res), "=&a" (tmp)
-           : "a" (x)
-           );
-
-    return res;
-}
-#define __arch_swab16 __arch_swab16
-
-#endif /* _XTENSA_SWAB_H */
diff --git a/arch/xtensa/include/asm/termbits.h b/arch/xtensa/include/asm/termbits.h
deleted file mode 100644 (file)
index 0d6c871..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * include/asm-xtensa/termbits.h
- *
- * Copied from SH.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_TERMBITS_H
-#define _XTENSA_TERMBITS_H
-
-
-#include <linux/posix_types.h>
-
-typedef unsigned char  cc_t;
-typedef unsigned int   speed_t;
-typedef unsigned int   tcflag_t;
-
-#define NCCS 19
-struct termios {
-       tcflag_t c_iflag;               /* input mode flags */
-       tcflag_t c_oflag;               /* output mode flags */
-       tcflag_t c_cflag;               /* control mode flags */
-       tcflag_t c_lflag;               /* local mode flags */
-       cc_t c_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-};
-
-struct termios2 {
-       tcflag_t c_iflag;               /* input mode flags */
-       tcflag_t c_oflag;               /* output mode flags */
-       tcflag_t c_cflag;               /* control mode flags */
-       tcflag_t c_lflag;               /* local mode flags */
-       cc_t c_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-       speed_t c_ispeed;               /* input speed */
-       speed_t c_ospeed;               /* output speed */
-};
-
-struct ktermios {
-       tcflag_t c_iflag;               /* input mode flags */
-       tcflag_t c_oflag;               /* output mode flags */
-       tcflag_t c_cflag;               /* control mode flags */
-       tcflag_t c_lflag;               /* local mode flags */
-       cc_t c_line;                    /* line discipline */
-       cc_t c_cc[NCCS];                /* control characters */
-       speed_t c_ispeed;               /* input speed */
-       speed_t c_ospeed;               /* output speed */
-};
-
-/* c_cc characters */
-
-#define VINTR 0
-#define VQUIT 1
-#define VERASE 2
-#define VKILL 3
-#define VEOF 4
-#define VTIME 5
-#define VMIN 6
-#define VSWTC 7
-#define VSTART 8
-#define VSTOP 9
-#define VSUSP 10
-#define VEOL 11
-#define VREPRINT 12
-#define VDISCARD 13
-#define VWERASE 14
-#define VLNEXT 15
-#define VEOL2 16
-
-/* c_iflag bits */
-
-#define IGNBRK 0000001
-#define BRKINT 0000002
-#define IGNPAR 0000004
-#define PARMRK 0000010
-#define INPCK  0000020
-#define ISTRIP 0000040
-#define INLCR  0000100
-#define IGNCR  0000200
-#define ICRNL  0000400
-#define IUCLC  0001000
-#define IXON   0002000
-#define IXANY  0004000
-#define IXOFF  0010000
-#define IMAXBEL        0020000
-#define IUTF8  0040000
-
-/* c_oflag bits */
-
-#define OPOST  0000001
-#define OLCUC  0000002
-#define ONLCR  0000004
-#define OCRNL  0000010
-#define ONOCR  0000020
-#define ONLRET 0000040
-#define OFILL  0000100
-#define OFDEL  0000200
-#define NLDLY  0000400
-#define   NL0  0000000
-#define   NL1  0000400
-#define CRDLY  0003000
-#define   CR0  0000000
-#define   CR1  0001000
-#define   CR2  0002000
-#define   CR3  0003000
-#define TABDLY 0014000
-#define   TAB0 0000000
-#define   TAB1 0004000
-#define   TAB2 0010000
-#define   TAB3 0014000
-#define   XTABS        0014000
-#define BSDLY  0020000
-#define   BS0  0000000
-#define   BS1  0020000
-#define VTDLY  0040000
-#define   VT0  0000000
-#define   VT1  0040000
-#define FFDLY  0100000
-#define   FF0  0000000
-#define   FF1  0100000
-
-/* c_cflag bit meaning */
-
-#define CBAUD  0010017
-#define  B0    0000000         /* hang up */
-#define  B50   0000001
-#define  B75   0000002
-#define  B110  0000003
-#define  B134  0000004
-#define  B150  0000005
-#define  B200  0000006
-#define  B300  0000007
-#define  B600  0000010
-#define  B1200 0000011
-#define  B1800 0000012
-#define  B2400 0000013
-#define  B4800 0000014
-#define  B9600 0000015
-#define  B19200        0000016
-#define  B38400        0000017
-#define EXTA B19200
-#define EXTB B38400
-#define CSIZE  0000060
-#define   CS5  0000000
-#define   CS6  0000020
-#define   CS7  0000040
-#define   CS8  0000060
-#define CSTOPB 0000100
-#define CREAD  0000200
-#define PARENB 0000400
-#define PARODD 0001000
-#define HUPCL  0002000
-#define CLOCAL 0004000
-#define CBAUDEX 0010000
-#define           BOTHER 0010000
-#define    B57600 0010001
-#define   B115200 0010002
-#define   B230400 0010003
-#define   B460800 0010004
-#define   B500000 0010005
-#define   B576000 0010006
-#define   B921600 0010007
-#define  B1000000 0010010
-#define  B1152000 0010011
-#define  B1500000 0010012
-#define  B2000000 0010013
-#define  B2500000 0010014
-#define  B3000000 0010015
-#define  B3500000 0010016
-#define  B4000000 0010017
-#define CIBAUD   002003600000          /* input baud rate */
-#define CMSPAR   010000000000          /* mark or space (stick) parity */
-#define CRTSCTS          020000000000          /* flow control */
-
-#define IBSHIFT        16              /* Shift from CBAUD to CIBAUD */
-
-/* c_lflag bits */
-
-#define ISIG   0000001
-#define ICANON 0000002
-#define XCASE  0000004
-#define ECHO   0000010
-#define ECHOE  0000020
-#define ECHOK  0000040
-#define ECHONL 0000100
-#define NOFLSH 0000200
-#define TOSTOP 0000400
-#define ECHOCTL        0001000
-#define ECHOPRT        0002000
-#define ECHOKE 0004000
-#define FLUSHO 0010000
-#define PENDIN 0040000
-#define IEXTEN 0100000
-#define EXTPROC        0200000
-
-/* tcflow() and TCXONC use these */
-
-#define        TCOOFF          0
-#define        TCOON           1
-#define        TCIOFF          2
-#define        TCION           3
-
-/* tcflush() and TCFLSH use these */
-
-#define        TCIFLUSH        0
-#define        TCOFLUSH        1
-#define        TCIOFLUSH       2
-
-/* tcsetattr uses these */
-
-#define        TCSANOW         0
-#define        TCSADRAIN       1
-#define        TCSAFLUSH       2
-
-#endif /* _XTENSA_TERMBITS_H */
diff --git a/arch/xtensa/include/asm/termios.h b/arch/xtensa/include/asm/termios.h
deleted file mode 100644 (file)
index 4673f42..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * include/asm-xtensa/termios.h
- *
- * Copied from SH.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_TERMIOS_H
-#define _XTENSA_TERMIOS_H
-
-#include <asm/termbits.h>
-#include <asm/ioctls.h>
-
-struct winsize {
-       unsigned short ws_row;
-       unsigned short ws_col;
-       unsigned short ws_xpixel;
-       unsigned short ws_ypixel;
-};
-
-#define NCC 8
-struct termio {
-       unsigned short c_iflag;         /* input mode flags */
-       unsigned short c_oflag;         /* output mode flags */
-       unsigned short c_cflag;         /* control mode flags */
-       unsigned short c_lflag;         /* local mode flags */
-       unsigned char c_line;           /* line discipline */
-       unsigned char c_cc[NCC];        /* control characters */
-};
-
-/* Modem lines */
-
-#define TIOCM_LE       0x001
-#define TIOCM_DTR      0x002
-#define TIOCM_RTS      0x004
-#define TIOCM_ST       0x008
-#define TIOCM_SR       0x010
-#define TIOCM_CTS      0x020
-#define TIOCM_CAR      0x040
-#define TIOCM_RNG      0x080
-#define TIOCM_DSR      0x100
-#define TIOCM_CD       TIOCM_CAR
-#define TIOCM_RI       TIOCM_RNG
-#define TIOCM_OUT1     0x2000
-#define TIOCM_OUT2     0x4000
-#define TIOCM_LOOP     0x8000
-
-/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-
-#ifdef __KERNEL__
-
-/*     intr=^C         quit=^\         erase=del       kill=^U
-       eof=^D          vtime=\0        vmin=\1         sxtc=\0
-       start=^Q        stop=^S         susp=^Z         eol=\0
-       reprint=^R      discard=^U      werase=^W       lnext=^V
-       eol2=\0
-*/
-#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
-
-/*
- * Translate a "termio" structure into a "termios". Ugh.
- */
-
-#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
-       unsigned short __tmp; \
-       get_user(__tmp,&(termio)->x); \
-       *(unsigned short *) &(termios)->x = __tmp; \
-}
-
-#define user_termio_to_kernel_termios(termios, termio) \
-({ \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
-       SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
-       copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
-})
-
-/*
- * Translate a "termios" structure into a "termio". Ugh.
- */
-
-#define kernel_termios_to_user_termio(termio, termios) \
-({ \
-       put_user((termios)->c_iflag, &(termio)->c_iflag); \
-       put_user((termios)->c_oflag, &(termio)->c_oflag); \
-       put_user((termios)->c_cflag, &(termio)->c_cflag); \
-       put_user((termios)->c_lflag, &(termio)->c_lflag); \
-       put_user((termios)->c_line,  &(termio)->c_line); \
-       copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
-})
-
-#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
-#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
-#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
-#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
-
-#endif /* __KERNEL__ */
-
-#endif /* _XTENSA_TERMIOS_H */
index 053bc42721067de7dbdf51fd50ab2b3c75b6dc27..175b3d5e1b01cd29f8c849f37db3496cc0005531 100644 (file)
@@ -63,10 +63,10 @@ extern cycles_t cacheflush_time;
  * Register access.
  */
 
-#define WSR_CCOUNT(r)    asm volatile ("wsr %0,"__stringify(CCOUNT) :: "a" (r))
-#define RSR_CCOUNT(r)    asm volatile ("rsr %0,"__stringify(CCOUNT) : "=a" (r))
-#define WSR_CCOMPARE(x,r) asm volatile ("wsr %0,"__stringify(CCOMPARE)"+"__stringify(x) :: "a"(r))
-#define RSR_CCOMPARE(x,r) asm volatile ("rsr %0,"__stringify(CCOMPARE)"+"__stringify(x) : "=a"(r))
+#define WSR_CCOUNT(r)    asm volatile ("wsr %0, ccount" :: "a" (r))
+#define RSR_CCOUNT(r)    asm volatile ("rsr %0, ccount" : "=a" (r))
+#define WSR_CCOMPARE(x,r) asm volatile ("wsr %0,"__stringify(SREG_CCOMPARE)"+"__stringify(x) :: "a"(r))
+#define RSR_CCOMPARE(x,r) asm volatile ("rsr %0,"__stringify(SREG_CCOMPARE)"+"__stringify(x) : "=a"(r))
 
 static inline unsigned long get_ccount (void)
 {
index 46d240074f747aa622711b35d0b130cedba6b812..43dd348a5a478d27daa70f2e8b019b8cfa0fcd22 100644 (file)
@@ -86,26 +86,26 @@ static inline void invalidate_dtlb_entry_no_isync (unsigned entry)
 
 static inline void set_itlbcfg_register (unsigned long val)
 {
-       __asm__ __volatile__("wsr  %0, "__stringify(ITLBCFG)"\n\t" "isync\n\t"
+       __asm__ __volatile__("wsr  %0, itlbcfg\n\t" "isync\n\t"
                             : : "a" (val));
 }
 
 static inline void set_dtlbcfg_register (unsigned long val)
 {
-       __asm__ __volatile__("wsr  %0, "__stringify(DTLBCFG)"; dsync\n\t"
+       __asm__ __volatile__("wsr  %0, dtlbcfg; dsync\n\t"
                             : : "a" (val));
 }
 
 static inline void set_ptevaddr_register (unsigned long val)
 {
-       __asm__ __volatile__(" wsr  %0, "__stringify(PTEVADDR)"; isync\n"
+       __asm__ __volatile__(" wsr  %0, ptevaddr; isync\n"
                             : : "a" (val));
 }
 
 static inline unsigned long read_ptevaddr_register (void)
 {
        unsigned long tmp;
-       __asm__ __volatile__("rsr  %0, "__stringify(PTEVADDR)"\n\t" : "=a" (tmp));
+       __asm__ __volatile__("rsr  %0, ptevaddr\n\t" : "=a" (tmp));
        return tmp;
 }
 
diff --git a/arch/xtensa/include/asm/topology.h b/arch/xtensa/include/asm/topology.h
deleted file mode 100644 (file)
index 7309e38..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * include/asm-xtensa/topology.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_TOPOLOGY_H
-#define _XTENSA_TOPOLOGY_H
-
-#include <asm-generic/topology.h>
-
-#endif /* _XTENSA_TOPOLOGY_H */
index 6d4db7e8ffac608520d9985a3680fddcfcfc9a1b..2b410b8c7f79fcbe4e9e29fb1901dc8ad73395cb 100644 (file)
@@ -7,30 +7,17 @@
  *
  * Copyright (C) 2001 - 2005 Tensilica Inc.
  */
-
 #ifndef _XTENSA_TYPES_H
 #define _XTENSA_TYPES_H
 
-#include <asm-generic/int-ll64.h>
-
-#ifdef __ASSEMBLY__
-# define __XTENSA_UL(x)                (x)
-# define __XTENSA_UL_CONST(x)  x
-#else
-# define __XTENSA_UL(x)                ((unsigned long)(x))
-# define __XTENSA_UL_CONST(x)  x##UL
-#endif
+#include <uapi/asm/types.h>
 
 #ifndef __ASSEMBLY__
-
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
-#ifdef __KERNEL__
 
 #define BITS_PER_LONG 32
 
-#endif /* __KERNEL__ */
 #endif
-
 #endif /* _XTENSA_TYPES_H */
index bc7e005faa602f5eb61beaf886f5a83c1ea1d209..9ef1c31d2c8363fdae934f157abce35d1ef21e89 100644 (file)
@@ -8,705 +8,8 @@
  * Copyright (C) 2001 - 2005 Tensilica Inc.
  */
 
-#ifndef _XTENSA_UNISTD_H
-#define _XTENSA_UNISTD_H
+#include <uapi/asm/unistd.h>
 
-#ifndef __SYSCALL
-# define __SYSCALL(nr,func,nargs)
-#endif
-
-#define __NR_spill                               0
-__SYSCALL(  0, sys_ni_syscall, 0)
-#define __NR_xtensa                              1
-__SYSCALL(  1, sys_ni_syscall, 0)
-#define __NR_available4                                  2
-__SYSCALL(  2, sys_ni_syscall, 0)
-#define __NR_available5                                  3
-__SYSCALL(  3, sys_ni_syscall, 0)
-#define __NR_available6                                  4
-__SYSCALL(  4, sys_ni_syscall, 0)
-#define __NR_available7                                  5
-__SYSCALL(  5, sys_ni_syscall, 0)
-#define __NR_available8                                  6
-__SYSCALL(  6, sys_ni_syscall, 0)
-#define __NR_available9                                  7
-__SYSCALL(  7, sys_ni_syscall, 0)
-
-/* File Operations */
-
-#define __NR_open                                8
-__SYSCALL(  8, sys_open, 3)
-#define __NR_close                               9
-__SYSCALL(  9, sys_close, 1)
-#define __NR_dup                                10
-__SYSCALL( 10, sys_dup, 1)
-#define __NR_dup2                               11
-__SYSCALL( 11, sys_dup2, 2)
-#define __NR_read                               12
-__SYSCALL( 12, sys_read, 3)
-#define __NR_write                              13
-__SYSCALL( 13, sys_write, 3)
-#define __NR_select                             14
-__SYSCALL( 14, sys_select, 5)
-#define __NR_lseek                              15
-__SYSCALL( 15, sys_lseek, 3)
-#define __NR_poll                               16
-__SYSCALL( 16, sys_poll, 3)
-#define __NR__llseek                            17
-__SYSCALL( 17, sys_llseek, 5)
-#define __NR_epoll_wait                         18
-__SYSCALL( 18, sys_epoll_wait, 4)
-#define __NR_epoll_ctl                                  19
-__SYSCALL( 19, sys_epoll_ctl, 4)
-#define __NR_epoll_create                       20
-__SYSCALL( 20, sys_epoll_create, 1)
-#define __NR_creat                              21
-__SYSCALL( 21, sys_creat, 2)
-#define __NR_truncate                           22
-__SYSCALL( 22, sys_truncate, 2)
-#define __NR_ftruncate                                  23
-__SYSCALL( 23, sys_ftruncate, 2)
-#define __NR_readv                              24
-__SYSCALL( 24, sys_readv, 3)
-#define __NR_writev                             25
-__SYSCALL( 25, sys_writev, 3)
-#define __NR_fsync                              26
-__SYSCALL( 26, sys_fsync, 1)
-#define __NR_fdatasync                                  27
-__SYSCALL( 27, sys_fdatasync, 1)
-#define __NR_truncate64                         28
-__SYSCALL( 28, sys_truncate64, 2)
-#define __NR_ftruncate64                        29
-__SYSCALL( 29, sys_ftruncate64, 2)
-#define __NR_pread64                            30
-__SYSCALL( 30, sys_pread64, 6)
-#define __NR_pwrite64                           31
-__SYSCALL( 31, sys_pwrite64, 6)
-
-#define __NR_link                               32
-__SYSCALL( 32, sys_link, 2)
-#define __NR_rename                             33
-__SYSCALL( 33, sys_rename, 2)
-#define __NR_symlink                            34
-__SYSCALL( 34, sys_symlink, 2)
-#define __NR_readlink                           35
-__SYSCALL( 35, sys_readlink, 3)
-#define __NR_mknod                              36
-__SYSCALL( 36, sys_mknod, 3)
-#define __NR_pipe                               37
-__SYSCALL( 37, sys_pipe, 1)
-#define __NR_unlink                             38
-__SYSCALL( 38, sys_unlink, 1)
-#define __NR_rmdir                              39
-__SYSCALL( 39, sys_rmdir, 1)
-
-#define __NR_mkdir                              40
-__SYSCALL( 40, sys_mkdir, 2)
-#define __NR_chdir                              41
-__SYSCALL( 41, sys_chdir, 1)
-#define __NR_fchdir                             42
-__SYSCALL( 42, sys_fchdir, 1)
-#define __NR_getcwd                             43
-__SYSCALL( 43, sys_getcwd, 2)
-
-#define __NR_chmod                              44
-__SYSCALL( 44, sys_chmod, 2)
-#define __NR_chown                              45
-__SYSCALL( 45, sys_chown, 3)
-#define __NR_stat                               46
-__SYSCALL( 46, sys_newstat, 2)
-#define __NR_stat64                             47
-__SYSCALL( 47, sys_stat64, 2)
-
-#define __NR_lchown                             48
-__SYSCALL( 48, sys_lchown, 3)
-#define __NR_lstat                              49
-__SYSCALL( 49, sys_newlstat, 2)
-#define __NR_lstat64                            50
-__SYSCALL( 50, sys_lstat64, 2)
-#define __NR_available51                        51
-__SYSCALL( 51, sys_ni_syscall, 0)
-
-#define __NR_fchmod                             52
-__SYSCALL( 52, sys_fchmod, 2)
-#define __NR_fchown                             53
-__SYSCALL( 53, sys_fchown, 3)
-#define __NR_fstat                              54
-__SYSCALL( 54, sys_newfstat, 2)
-#define __NR_fstat64                            55
-__SYSCALL( 55, sys_fstat64, 2)
-
-#define __NR_flock                              56
-__SYSCALL( 56, sys_flock, 2)
-#define __NR_access                             57
-__SYSCALL( 57, sys_access, 2)
-#define __NR_umask                              58
-__SYSCALL( 58, sys_umask, 1)
-#define __NR_getdents                           59
-__SYSCALL( 59, sys_getdents, 3)
-#define __NR_getdents64                         60
-__SYSCALL( 60, sys_getdents64, 3)
-#define __NR_fcntl64                            61
-__SYSCALL( 61, sys_fcntl64, 3)
-#define __NR_available62                        62
-__SYSCALL( 62, sys_ni_syscall, 0)
-#define __NR_fadvise64_64                       63
-__SYSCALL( 63, xtensa_fadvise64_64, 6)
-#define __NR_utime                              64     /* glibc 2.3.3 ?? */
-__SYSCALL( 64, sys_utime, 2)
-#define __NR_utimes                             65
-__SYSCALL( 65, sys_utimes, 2)
-#define __NR_ioctl                              66
-__SYSCALL( 66, sys_ioctl, 3)
-#define __NR_fcntl                              67
-__SYSCALL( 67, sys_fcntl, 3)
-
-#define __NR_setxattr                           68
-__SYSCALL( 68, sys_setxattr, 5)
-#define __NR_getxattr                           69
-__SYSCALL( 69, sys_getxattr, 4)
-#define __NR_listxattr                                  70
-__SYSCALL( 70, sys_listxattr, 3)
-#define __NR_removexattr                        71
-__SYSCALL( 71, sys_removexattr, 2)
-#define __NR_lsetxattr                                  72
-__SYSCALL( 72, sys_lsetxattr, 5)
-#define __NR_lgetxattr                                  73
-__SYSCALL( 73, sys_lgetxattr, 4)
-#define __NR_llistxattr                         74
-__SYSCALL( 74, sys_llistxattr, 3)
-#define __NR_lremovexattr                       75
-__SYSCALL( 75, sys_lremovexattr, 2)
-#define __NR_fsetxattr                                  76
-__SYSCALL( 76, sys_fsetxattr, 5)
-#define __NR_fgetxattr                                  77
-__SYSCALL( 77, sys_fgetxattr, 4)
-#define __NR_flistxattr                         78
-__SYSCALL( 78, sys_flistxattr, 3)
-#define __NR_fremovexattr                       79
-__SYSCALL( 79, sys_fremovexattr, 2)
-
-/* File Map / Shared Memory Operations */
-
-#define __NR_mmap2                              80
-__SYSCALL( 80, sys_mmap_pgoff, 6)
-#define __NR_munmap                             81
-__SYSCALL( 81, sys_munmap, 2)
-#define __NR_mprotect                           82
-__SYSCALL( 82, sys_mprotect, 3)
-#define __NR_brk                                83
-__SYSCALL( 83, sys_brk, 1)
-#define __NR_mlock                              84
-__SYSCALL( 84, sys_mlock, 2)
-#define __NR_munlock                            85
-__SYSCALL( 85, sys_munlock, 2)
-#define __NR_mlockall                           86
-__SYSCALL( 86, sys_mlockall, 1)
-#define __NR_munlockall                         87
-__SYSCALL( 87, sys_munlockall, 0)
-#define __NR_mremap                             88
-__SYSCALL( 88, sys_mremap, 4)
-#define __NR_msync                              89
-__SYSCALL( 89, sys_msync, 3)
-#define __NR_mincore                            90
-__SYSCALL( 90, sys_mincore, 3)
-#define __NR_madvise                            91
-__SYSCALL( 91, sys_madvise, 3)
-#define __NR_shmget                             92
-__SYSCALL( 92, sys_shmget, 4)
-#define __NR_shmat                              93
-__SYSCALL( 93, xtensa_shmat, 4)
-#define __NR_shmctl                             94
-__SYSCALL( 94, sys_shmctl, 4)
-#define __NR_shmdt                              95
-__SYSCALL( 95, sys_shmdt, 4)
-
-/* Socket Operations */
-
-#define __NR_socket                             96
-__SYSCALL( 96, sys_socket, 3)
-#define __NR_setsockopt                         97
-__SYSCALL( 97, sys_setsockopt, 5)
-#define __NR_getsockopt                         98
-__SYSCALL( 98, sys_getsockopt, 5)
-#define __NR_shutdown                           99
-__SYSCALL( 99, sys_shutdown, 2)
-
-#define __NR_bind                              100
-__SYSCALL(100, sys_bind, 3)
-#define __NR_connect                           101
-__SYSCALL(101, sys_connect, 3)
-#define __NR_listen                            102
-__SYSCALL(102, sys_listen, 2)
-#define __NR_accept                            103
-__SYSCALL(103, sys_accept, 3)
-
-#define __NR_getsockname                       104
-__SYSCALL(104, sys_getsockname, 3)
-#define __NR_getpeername                       105
-__SYSCALL(105, sys_getpeername, 3)
-#define __NR_sendmsg                           106
-__SYSCALL(106, sys_sendmsg, 3)
-#define __NR_recvmsg                           107
-__SYSCALL(107, sys_recvmsg, 3)
-#define __NR_send                              108
-__SYSCALL(108, sys_send, 4)
-#define __NR_recv                              109
-__SYSCALL(109, sys_recv, 4)
-#define __NR_sendto                            110
-__SYSCALL(110, sys_sendto, 6)
-#define __NR_recvfrom                          111
-__SYSCALL(111, sys_recvfrom, 6)
-
-#define __NR_socketpair                        112
-__SYSCALL(112, sys_socketpair, 4)
-#define __NR_sendfile                          113
-__SYSCALL(113, sys_sendfile, 4)
-#define __NR_sendfile64                        114
-__SYSCALL(114, sys_sendfile64, 4)
-#define __NR_available115                      115
-__SYSCALL(115, sys_ni_syscall, 0)
-
-/* Process Operations */
-
-#define __NR_clone                             116
-__SYSCALL(116, xtensa_clone, 5)
-#define __NR_execve                            117
-__SYSCALL(117, xtensa_execve, 3)
-#define __NR_exit                              118
-__SYSCALL(118, sys_exit, 1)
-#define __NR_exit_group                        119
-__SYSCALL(119, sys_exit_group, 1)
-#define __NR_getpid                            120
-__SYSCALL(120, sys_getpid, 0)
-#define __NR_wait4                             121
-__SYSCALL(121, sys_wait4, 4)
-#define __NR_waitid                            122
-__SYSCALL(122, sys_waitid, 5)
-#define __NR_kill                              123
-__SYSCALL(123, sys_kill, 2)
-#define __NR_tkill                             124
-__SYSCALL(124, sys_tkill, 2)
-#define __NR_tgkill                            125
-__SYSCALL(125, sys_tgkill, 3)
-#define __NR_set_tid_address                   126
-__SYSCALL(126, sys_set_tid_address, 1)
-#define __NR_gettid                            127
-__SYSCALL(127, sys_gettid, 0)
-#define __NR_setsid                            128
-__SYSCALL(128, sys_setsid, 0)
-#define __NR_getsid                            129
-__SYSCALL(129, sys_getsid, 1)
-#define __NR_prctl                             130
-__SYSCALL(130, sys_prctl, 5)
-#define __NR_personality                       131
-__SYSCALL(131, sys_personality, 1)
-#define __NR_getpriority                       132
-__SYSCALL(132, sys_getpriority, 2)
-#define __NR_setpriority                       133
-__SYSCALL(133, sys_setpriority, 3)
-#define __NR_setitimer                                 134
-__SYSCALL(134, sys_setitimer, 3)
-#define __NR_getitimer                                 135
-__SYSCALL(135, sys_getitimer, 2)
-#define __NR_setuid                            136
-__SYSCALL(136, sys_setuid, 1)
-#define __NR_getuid                            137
-__SYSCALL(137, sys_getuid, 0)
-#define __NR_setgid                            138
-__SYSCALL(138, sys_setgid, 1)
-#define __NR_getgid                            139
-__SYSCALL(139, sys_getgid, 0)
-#define __NR_geteuid                           140
-__SYSCALL(140, sys_geteuid, 0)
-#define __NR_getegid                           141
-__SYSCALL(141, sys_getegid, 0)
-#define __NR_setreuid                          142
-__SYSCALL(142, sys_setreuid, 2)
-#define __NR_setregid                          143
-__SYSCALL(143, sys_setregid, 2)
-#define __NR_setresuid                                 144
-__SYSCALL(144, sys_setresuid, 3)
-#define __NR_getresuid                                 145
-__SYSCALL(145, sys_getresuid, 3)
-#define __NR_setresgid                                 146
-__SYSCALL(146, sys_setresgid, 3)
-#define __NR_getresgid                                 147
-__SYSCALL(147, sys_getresgid, 3)
-#define __NR_setpgid                           148
-__SYSCALL(148, sys_setpgid, 2)
-#define __NR_getpgid                           149
-__SYSCALL(149, sys_getpgid, 1)
-#define __NR_getppid                           150
-__SYSCALL(150, sys_getppid, 0)
-#define __NR_getpgrp                           151
-__SYSCALL(151, sys_getpgrp, 0)
-
-#define __NR_reserved152                       152     /* set_thread_area */
-__SYSCALL(152, sys_ni_syscall, 0)
-#define __NR_reserved153                       153     /* get_thread_area */
-__SYSCALL(153, sys_ni_syscall, 0)
-#define __NR_times                             154
-__SYSCALL(154, sys_times, 1)
-#define __NR_acct                              155
-__SYSCALL(155, sys_acct, 1)
-#define __NR_sched_setaffinity                         156
-__SYSCALL(156, sys_sched_setaffinity, 3)
-#define __NR_sched_getaffinity                         157
-__SYSCALL(157, sys_sched_getaffinity, 3)
-#define __NR_capget                            158
-__SYSCALL(158, sys_capget, 2)
-#define __NR_capset                            159
-__SYSCALL(159, sys_capset, 2)
-#define __NR_ptrace                            160
-__SYSCALL(160, sys_ptrace, 4)
-#define __NR_semtimedop                                161
-__SYSCALL(161, sys_semtimedop, 5)
-#define __NR_semget                            162
-__SYSCALL(162, sys_semget, 4)
-#define __NR_semop                             163
-__SYSCALL(163, sys_semop, 4)
-#define __NR_semctl                            164
-__SYSCALL(164, sys_semctl, 4)
-#define __NR_available165                      165
-__SYSCALL(165, sys_ni_syscall, 0)
-#define __NR_msgget                            166
-__SYSCALL(166, sys_msgget, 4)
-#define __NR_msgsnd                            167
-__SYSCALL(167, sys_msgsnd, 4)
-#define __NR_msgrcv                            168
-__SYSCALL(168, sys_msgrcv, 4)
-#define __NR_msgctl                            169
-__SYSCALL(169, sys_msgctl, 4)
-#define __NR_available170                      170
-__SYSCALL(170, sys_ni_syscall, 0)
-#define __NR_available171                      171
-__SYSCALL(171, sys_ni_syscall, 0)
-
-/* File System */
-
-#define __NR_mount                             172
-__SYSCALL(172, sys_mount, 5)
-#define __NR_swapon                            173
-__SYSCALL(173, sys_swapon, 2)
-#define __NR_chroot                            174
-__SYSCALL(174, sys_chroot, 1)
-#define __NR_pivot_root                        175
-__SYSCALL(175, sys_pivot_root, 2)
-#define __NR_umount                            176
-__SYSCALL(176, sys_umount, 2)
-#define __NR_swapoff                           177
-__SYSCALL(177, sys_swapoff, 1)
-#define __NR_sync                              178
-__SYSCALL(178, sys_sync, 0)
-#define __NR_available179                      179
-__SYSCALL(179, sys_ni_syscall, 0)
-#define __NR_setfsuid                          180
-__SYSCALL(180, sys_setfsuid, 1)
-#define __NR_setfsgid                          181
-__SYSCALL(181, sys_setfsgid, 1)
-#define __NR_sysfs                             182
-__SYSCALL(182, sys_sysfs, 3)
-#define __NR_ustat                             183
-__SYSCALL(183, sys_ustat, 2)
-#define __NR_statfs                            184
-__SYSCALL(184, sys_statfs, 2)
-#define __NR_fstatfs                           185
-__SYSCALL(185, sys_fstatfs, 2)
-#define __NR_statfs64                          186
-__SYSCALL(186, sys_statfs64, 3)
-#define __NR_fstatfs64                                 187
-__SYSCALL(187, sys_fstatfs64, 3)
-
-/* System */
-
-#define __NR_setrlimit                                 188
-__SYSCALL(188, sys_setrlimit, 2)
-#define __NR_getrlimit                                 189
-__SYSCALL(189, sys_getrlimit, 2)
-#define __NR_getrusage                                 190
-__SYSCALL(190, sys_getrusage, 2)
-#define __NR_futex                             191
-__SYSCALL(191, sys_futex, 5)
-#define __NR_gettimeofday                      192
-__SYSCALL(192, sys_gettimeofday, 2)
-#define __NR_settimeofday                      193
-__SYSCALL(193, sys_settimeofday, 2)
-#define __NR_adjtimex                          194
-__SYSCALL(194, sys_adjtimex, 1)
-#define __NR_nanosleep                         195
-__SYSCALL(195, sys_nanosleep, 2)
-#define __NR_getgroups                                 196
-__SYSCALL(196, sys_getgroups, 2)
-#define __NR_setgroups                                 197
-__SYSCALL(197, sys_setgroups, 2)
-#define __NR_sethostname                       198
-__SYSCALL(198, sys_sethostname, 2)
-#define __NR_setdomainname                     199
-__SYSCALL(199, sys_setdomainname, 2)
-#define __NR_syslog                            200
-__SYSCALL(200, sys_syslog, 3)
-#define __NR_vhangup                           201
-__SYSCALL(201, sys_vhangup, 0)
-#define __NR_uselib                            202
-__SYSCALL(202, sys_uselib, 1)
-#define __NR_reboot                            203
-__SYSCALL(203, sys_reboot, 3)
-#define __NR_quotactl                          204
-__SYSCALL(204, sys_quotactl, 4)
-#define __NR_nfsservctl                        205
-__SYSCALL(205, sys_ni_syscall, 0)
-#define __NR__sysctl                           206
-__SYSCALL(206, sys_sysctl, 1)
-#define __NR_bdflush                           207
-__SYSCALL(207, sys_bdflush, 2)
-#define __NR_uname                             208
-__SYSCALL(208, sys_newuname, 1)
-#define __NR_sysinfo                           209
-__SYSCALL(209, sys_sysinfo, 1)
-#define __NR_init_module                       210
-__SYSCALL(210, sys_init_module, 2)
-#define __NR_delete_module                     211
-__SYSCALL(211, sys_delete_module, 1)
-
-#define __NR_sched_setparam                    212
-__SYSCALL(212, sys_sched_setparam, 2)
-#define __NR_sched_getparam                    213
-__SYSCALL(213, sys_sched_getparam, 2)
-#define __NR_sched_setscheduler                214
-__SYSCALL(214, sys_sched_setscheduler, 3)
-#define __NR_sched_getscheduler                215
-__SYSCALL(215, sys_sched_getscheduler, 1)
-#define __NR_sched_get_priority_max            216
-__SYSCALL(216, sys_sched_get_priority_max, 1)
-#define __NR_sched_get_priority_min            217
-__SYSCALL(217, sys_sched_get_priority_min, 1)
-#define __NR_sched_rr_get_interval             218
-__SYSCALL(218, sys_sched_rr_get_interval, 2)
-#define __NR_sched_yield                       219
-__SYSCALL(219, sys_sched_yield, 0)
-#define __NR_available222                      222
-__SYSCALL(222, sys_ni_syscall, 0)
-
-/* Signal Handling */
-
-#define __NR_restart_syscall                   223
-__SYSCALL(223, sys_restart_syscall, 0)
-#define __NR_sigaltstack                       224
-__SYSCALL(224, xtensa_sigaltstack, 2)
-#define __NR_rt_sigreturn                      225
-__SYSCALL(225, xtensa_rt_sigreturn, 1)
-#define __NR_rt_sigaction                      226
-__SYSCALL(226, sys_rt_sigaction, 4)
-#define __NR_rt_sigprocmask                    227
-__SYSCALL(227, sys_rt_sigprocmask, 4)
-#define __NR_rt_sigpending                     228
-__SYSCALL(228, sys_rt_sigpending, 2)
-#define __NR_rt_sigtimedwait                   229
-__SYSCALL(229, sys_rt_sigtimedwait, 4)
-#define __NR_rt_sigqueueinfo                   230
-__SYSCALL(230, sys_rt_sigqueueinfo, 3)
-#define __NR_rt_sigsuspend                     231
-__SYSCALL(231, sys_rt_sigsuspend, 2)
-
-/* Message */
-
-#define __NR_mq_open                           232
-__SYSCALL(232, sys_mq_open, 4)
-#define __NR_mq_unlink                                 233
-__SYSCALL(233, sys_mq_unlink, 1)
-#define __NR_mq_timedsend                      234
-__SYSCALL(234, sys_mq_timedsend, 5)
-#define __NR_mq_timedreceive                   235
-__SYSCALL(235, sys_mq_timedreceive, 5)
-#define __NR_mq_notify                                 236
-__SYSCALL(236, sys_mq_notify, 2)
-#define __NR_mq_getsetattr                     237
-__SYSCALL(237, sys_mq_getsetattr, 3)
-#define __NR_available238                      238
-__SYSCALL(238, sys_ni_syscall, 0)
-
-/* IO */
-
-#define __NR_io_setup                          239
-__SYSCALL(239, sys_io_setup, 2)
-#define __NR_io_destroy                        240
-__SYSCALL(240, sys_io_destroy, 1)
-#define __NR_io_submit                                 241
-__SYSCALL(241, sys_io_submit, 3)
-#define __NR_io_getevents                      242
-__SYSCALL(242, sys_io_getevents, 5)
-#define __NR_io_cancel                                 243
-__SYSCALL(243, sys_io_cancel, 3)
-#define __NR_clock_settime                     244
-__SYSCALL(244, sys_clock_settime, 2)
-#define __NR_clock_gettime                     245
-__SYSCALL(245, sys_clock_gettime, 2)
-#define __NR_clock_getres                      246
-__SYSCALL(246, sys_clock_getres, 2)
-#define __NR_clock_nanosleep                   247
-__SYSCALL(247, sys_clock_nanosleep, 4)
-
-/* Timer */
-
-#define __NR_timer_create                      248
-__SYSCALL(248, sys_timer_create, 3)
-#define __NR_timer_delete                      249
-__SYSCALL(249, sys_timer_delete, 1)
-#define __NR_timer_settime                     250
-__SYSCALL(250, sys_timer_settime, 4)
-#define __NR_timer_gettime                     251
-__SYSCALL(251, sys_timer_gettime, 2)
-#define __NR_timer_getoverrun                  252
-__SYSCALL(252, sys_timer_getoverrun, 1)
-
-/* System */
-
-#define __NR_reserved244                       253
-__SYSCALL(253, sys_ni_syscall, 0)
-#define __NR_lookup_dcookie                    254
-__SYSCALL(254, sys_lookup_dcookie, 4)
-#define __NR_available255                      255
-__SYSCALL(255, sys_ni_syscall, 0)
-#define __NR_add_key                           256
-__SYSCALL(256, sys_add_key, 5)
-#define __NR_request_key                       257
-__SYSCALL(257, sys_request_key, 5)
-#define __NR_keyctl                            258
-__SYSCALL(258, sys_keyctl, 5)
-#define __NR_available259                      259
-__SYSCALL(259, sys_ni_syscall, 0)
-
-
-#define __NR_readahead                         260
-__SYSCALL(260, sys_readahead, 5)
-#define __NR_remap_file_pages                  261
-__SYSCALL(261, sys_remap_file_pages, 5)
-#define __NR_migrate_pages                     262
-__SYSCALL(262, sys_migrate_pages, 0)
-#define __NR_mbind                             263
-__SYSCALL(263, sys_mbind, 6)
-#define __NR_get_mempolicy                     264
-__SYSCALL(264, sys_get_mempolicy, 5)
-#define __NR_set_mempolicy                     265
-__SYSCALL(265, sys_set_mempolicy, 3)
-#define __NR_unshare                           266
-__SYSCALL(266, sys_unshare, 1)
-#define __NR_move_pages                                267
-__SYSCALL(267, sys_move_pages, 0)
-#define __NR_splice                            268
-__SYSCALL(268, sys_splice, 0)
-#define __NR_tee                               269
-__SYSCALL(269, sys_tee, 0)
-#define __NR_vmsplice                          270
-__SYSCALL(270, sys_vmsplice, 0)
-#define __NR_available271                      271
-__SYSCALL(271, sys_ni_syscall, 0)
-
-#define __NR_pselect6                          272
-__SYSCALL(272, sys_pselect6, 0)
-#define __NR_ppoll                             273
-__SYSCALL(273, sys_ppoll, 0)
-#define __NR_epoll_pwait                       274
-__SYSCALL(274, sys_epoll_pwait, 0)
-#define __NR_available275                      275
-__SYSCALL(275, sys_ni_syscall, 0)
-
-#define __NR_inotify_init                      276
-__SYSCALL(276, sys_inotify_init, 0)
-#define __NR_inotify_add_watch                 277
-__SYSCALL(277, sys_inotify_add_watch, 3)
-#define __NR_inotify_rm_watch                  278
-__SYSCALL(278, sys_inotify_rm_watch, 2)
-#define __NR_available279                      279
-__SYSCALL(279, sys_ni_syscall, 0)
-
-#define __NR_getcpu                            280
-__SYSCALL(280, sys_getcpu, 0)
-#define __NR_kexec_load                                281
-__SYSCALL(281, sys_ni_syscall, 0)
-
-#define __NR_ioprio_set                                282
-__SYSCALL(282, sys_ioprio_set, 2)
-#define __NR_ioprio_get                                283
-__SYSCALL(283, sys_ioprio_get, 3)
-
-#define __NR_set_robust_list                   284
-__SYSCALL(284, sys_set_robust_list, 3)
-#define __NR_get_robust_list                   285
-__SYSCALL(285, sys_get_robust_list, 3)
-#define __NR_reserved286                       286     /* sync_file_rangeX */
-__SYSCALL(286, sys_ni_syscall, 3)
-#define __NR_available287                      287
-__SYSCALL(287, sys_faccessat, 0)
-
-/* Relative File Operations */
-
-#define __NR_openat                            288
-__SYSCALL(288, sys_openat, 4)
-#define __NR_mkdirat                           289
-__SYSCALL(289, sys_mkdirat, 3)
-#define __NR_mknodat                           290
-__SYSCALL(290, sys_mknodat, 4)
-#define __NR_unlinkat                          291
-__SYSCALL(291, sys_unlinkat, 3)
-#define __NR_renameat                          292
-__SYSCALL(292, sys_renameat, 4)
-#define __NR_linkat                            293
-__SYSCALL(293, sys_linkat, 5)
-#define __NR_symlinkat                         294
-__SYSCALL(294, sys_symlinkat, 3)
-#define __NR_readlinkat                                295
-__SYSCALL(295, sys_readlinkat, 4)
-#define __NR_utimensat                         296
-__SYSCALL(296, sys_utimensat, 0)
-#define __NR_fchownat                          297
-__SYSCALL(297, sys_fchownat, 5)
-#define __NR_futimesat                         298
-__SYSCALL(298, sys_futimesat, 4)
-#define __NR_fstatat64                         299
-__SYSCALL(299, sys_fstatat64, 0)
-#define __NR_fchmodat                          300
-__SYSCALL(300, sys_fchmodat, 4)
-#define __NR_faccessat                         301
-__SYSCALL(301, sys_faccessat, 4)
-#define __NR_available302                      302
-__SYSCALL(302, sys_ni_syscall, 0)
-#define __NR_available303                      303
-__SYSCALL(303, sys_ni_syscall, 0)
-
-#define __NR_signalfd                          304
-__SYSCALL(304, sys_signalfd, 3)
-/*  305 was __NR_timerfd  */
-__SYSCALL(305, sys_ni_syscall, 0)
-#define __NR_eventfd                           306
-__SYSCALL(306, sys_eventfd, 1)
-#define __NR_recvmmsg                          307
-__SYSCALL(307, sys_recvmmsg, 5)
-#define __NR_setns                             308
-__SYSCALL(308, sys_setns, 2)
-
-#define __NR_syscall_count                     309
-
-/*
- * sysxtensa syscall handler
- *
- * int sysxtensa (SYS_XTENSA_ATOMIC_SET,     ptr, val,    unused);
- * int sysxtensa (SYS_XTENSA_ATOMIC_ADD,     ptr, val,    unused);
- * int sysxtensa (SYS_XTENSA_ATOMIC_EXG_ADD, ptr, val,    unused);
- * int sysxtensa (SYS_XTENSA_ATOMIC_CMP_SWP, ptr, oldval, newval);
- *        a2            a6                   a3    a4      a5
- */
-
-#define SYS_XTENSA_RESERVED               0     /* don't use this */
-#define SYS_XTENSA_ATOMIC_SET             1     /* set variable */
-#define SYS_XTENSA_ATOMIC_EXG_ADD         2     /* exchange memory and add */
-#define SYS_XTENSA_ATOMIC_ADD             3     /* add to memory */
-#define SYS_XTENSA_ATOMIC_CMP_SWP         4     /* compare and swap */
-
-#define SYS_XTENSA_COUNT                  5     /* count */
-
-#ifdef __KERNEL__
 
 /*
  * "Conditional" syscalls
@@ -734,6 +37,3 @@ __SYSCALL(308, sys_setns, 2)
 #define __IGNORE_mmap                          /* use mmap2 */
 #define __IGNORE_vfork                         /* use clone */
 #define __IGNORE_fadvise64                     /* use fadvise64_64 */
-
-#endif /* __KERNEL__ */
-#endif /* _XTENSA_UNISTD_H */
diff --git a/arch/xtensa/include/asm/xor.h b/arch/xtensa/include/asm/xor.h
deleted file mode 100644 (file)
index e7b1f08..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * include/asm-xtensa/xor.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_XOR_H
-#define _XTENSA_XOR_H
-
-#include <asm-generic/xor.h>
-
-#endif
index baebb3da1d44160fc6f6f259886656e6f494b167..56aad54e7fb7b7fd62c5a55e13589705d194ebb7 100644 (file)
@@ -1,3 +1,25 @@
 # UAPI Header export list
 include include/uapi/asm-generic/Kbuild.asm
 
+header-y += auxvec.h
+header-y += byteorder.h
+header-y += ioctls.h
+header-y += ipcbuf.h
+header-y += mman.h
+header-y += msgbuf.h
+header-y += param.h
+header-y += poll.h
+header-y += posix_types.h
+header-y += ptrace.h
+header-y += sembuf.h
+header-y += setup.h
+header-y += shmbuf.h
+header-y += sigcontext.h
+header-y += signal.h
+header-y += socket.h
+header-y += sockios.h
+header-y += stat.h
+header-y += swab.h
+header-y += termbits.h
+header-y += types.h
+header-y += unistd.h
diff --git a/arch/xtensa/include/uapi/asm/auxvec.h b/arch/xtensa/include/uapi/asm/auxvec.h
new file mode 100644 (file)
index 0000000..257dec7
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef __XTENSA_AUXVEC_H
+#define __XTENSA_AUXVEC_H
+
+#endif
diff --git a/arch/xtensa/include/uapi/asm/byteorder.h b/arch/xtensa/include/uapi/asm/byteorder.h
new file mode 100644 (file)
index 0000000..54eb631
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef _XTENSA_BYTEORDER_H
+#define _XTENSA_BYTEORDER_H
+
+#ifdef __XTENSA_EL__
+#include <linux/byteorder/little_endian.h>
+#elif defined(__XTENSA_EB__)
+#include <linux/byteorder/big_endian.h>
+#else
+# error processor byte order undefined!
+#endif
+
+#endif /* _XTENSA_BYTEORDER_H */
diff --git a/arch/xtensa/include/uapi/asm/ioctls.h b/arch/xtensa/include/uapi/asm/ioctls.h
new file mode 100644 (file)
index 0000000..2aa4cd9
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * include/asm-xtensa/ioctls.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2003 - 2005 Tensilica Inc.
+ *
+ * Derived from "include/asm-i386/ioctls.h"
+ */
+
+#ifndef _XTENSA_IOCTLS_H
+#define _XTENSA_IOCTLS_H
+
+#include <asm/ioctl.h>
+
+#define FIOCLEX                _IO('f', 1)
+#define FIONCLEX       _IO('f', 2)
+#define FIOASYNC       _IOW('f', 125, int)
+#define FIONBIO                _IOW('f', 126, int)
+#define FIONREAD       _IOR('f', 127, int)
+#define TIOCINQ                FIONREAD
+#define FIOQSIZE       _IOR('f', 128, loff_t)
+
+#define TCGETS         0x5401
+#define TCSETS         0x5402
+#define TCSETSW                0x5403
+#define TCSETSF                0x5404
+
+#define TCGETA         _IOR('t', 23, struct termio)
+#define TCSETA         _IOW('t', 24, struct termio)
+#define TCSETAW                _IOW('t', 25, struct termio)
+#define TCSETAF                _IOW('t', 28, struct termio)
+
+#define TCSBRK         _IO('t', 29)
+#define TCXONC         _IO('t', 30)
+#define TCFLSH         _IO('t', 31)
+
+#define TIOCSWINSZ     _IOW('t', 103, struct winsize)
+#define TIOCGWINSZ     _IOR('t', 104, struct winsize)
+#define        TIOCSTART       _IO('t', 110)           /* start output, like ^Q */
+#define        TIOCSTOP        _IO('t', 111)           /* stop output, like ^S */
+#define TIOCOUTQ        _IOR('t', 115, int)     /* output queue size */
+
+#define TIOCSPGRP      _IOW('t', 118, int)
+#define TIOCGPGRP      _IOR('t', 119, int)
+
+#define TIOCEXCL       _IO('T', 12)
+#define TIOCNXCL       _IO('T', 13)
+#define TIOCSCTTY      _IO('T', 14)
+
+#define TIOCSTI                _IOW('T', 18, char)
+#define TIOCMGET       _IOR('T', 21, unsigned int)
+#define TIOCMBIS       _IOW('T', 22, unsigned int)
+#define TIOCMBIC       _IOW('T', 23, unsigned int)
+#define TIOCMSET       _IOW('T', 24, unsigned int)
+# define TIOCM_LE      0x001
+# define TIOCM_DTR     0x002
+# define TIOCM_RTS     0x004
+# define TIOCM_ST      0x008
+# define TIOCM_SR      0x010
+# define TIOCM_CTS     0x020
+# define TIOCM_CAR     0x040
+# define TIOCM_RNG     0x080
+# define TIOCM_DSR     0x100
+# define TIOCM_CD      TIOCM_CAR
+# define TIOCM_RI      TIOCM_RNG
+
+#define TIOCGSOFTCAR   _IOR('T', 25, unsigned int)
+#define TIOCSSOFTCAR   _IOW('T', 26, unsigned int)
+#define TIOCLINUX      _IOW('T', 28, char)
+#define TIOCCONS       _IO('T', 29)
+#define TIOCGSERIAL    0x803C541E      /*_IOR('T', 30, struct serial_struct)*/
+#define TIOCSSERIAL    0x403C541F      /*_IOW('T', 31, struct serial_struct)*/
+#define TIOCPKT                _IOW('T', 32, int)
+# define TIOCPKT_DATA           0
+# define TIOCPKT_FLUSHREAD      1
+# define TIOCPKT_FLUSHWRITE     2
+# define TIOCPKT_STOP           4
+# define TIOCPKT_START          8
+# define TIOCPKT_NOSTOP                16
+# define TIOCPKT_DOSTOP                32
+# define TIOCPKT_IOCTL         64
+
+
+#define TIOCNOTTY      _IO('T', 34)
+#define TIOCSETD       _IOW('T', 35, int)
+#define TIOCGETD       _IOR('T', 36, int)
+#define TCSBRKP                _IOW('T', 37, int)   /* Needed for POSIX tcsendbreak()*/
+#define TIOCTTYGSTRUCT _IOR('T', 38, struct tty_struct) /* For debugging only*/
+#define TIOCSBRK       _IO('T', 39)         /* BSD compatibility */
+#define TIOCCBRK       _IO('T', 40)         /* BSD compatibility */
+#define TIOCGSID       _IOR('T', 41, pid_t) /* Return the session ID of FD*/
+#define TCGETS2                _IOR('T', 42, struct termios2)
+#define TCSETS2                _IOW('T', 43, struct termios2)
+#define TCSETSW2       _IOW('T', 44, struct termios2)
+#define TCSETSF2       _IOW('T', 45, struct termios2)
+#define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
+#define TIOCGDEV       _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
+#define TIOCSIG                _IOW('T',0x36, int)  /* Generate signal on Pty slave */
+#define TIOCVHANGUP    _IO('T', 0x37)
+
+#define TIOCSERCONFIG  _IO('T', 83)
+#define TIOCSERGWILD   _IOR('T', 84,  int)
+#define TIOCSERSWILD   _IOW('T', 85,  int)
+#define TIOCGLCKTRMIOS 0x5456
+#define TIOCSLCKTRMIOS 0x5457
+#define TIOCSERGSTRUCT 0x5458               /* For debugging only */
+#define TIOCSERGETLSR   _IOR('T', 89, unsigned int) /* Get line status reg. */
+  /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+# define TIOCSER_TEMT    0x01               /* Transmitter physically empty */
+#define TIOCSERGETMULTI _IOR('T', 90, struct serial_multiport_struct) /* Get multiport config  */
+#define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */
+
+#define TIOCMIWAIT     _IO('T', 92) /* wait for a change on serial input line(s) */
+#define TIOCGICOUNT    0x545D  /* read serial port inline interrupt counts */
+
+#endif /* _XTENSA_IOCTLS_H */
diff --git a/arch/xtensa/include/uapi/asm/ipcbuf.h b/arch/xtensa/include/uapi/asm/ipcbuf.h
new file mode 100644 (file)
index 0000000..c33aa6a
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * include/asm-xtensa/ipcbuf.h
+ *
+ * The ipc64_perm structure for the Xtensa architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Copyright (C) 2001 - 2005 Tensilica Inc.
+ */
+
+#ifndef _XTENSA_IPCBUF_H
+#define _XTENSA_IPCBUF_H
+
+/*
+ * Pad space is left for:
+ * - 32-bit mode_t and seq
+ * - 2 miscellaneous 32-bit values
+ *
+ * This file is subject to the terms and conditions of the GNU General
+ * Public License.  See the file "COPYING" in the main directory of
+ * this archive for more details.
+ */
+
+struct ipc64_perm
+{
+       __kernel_key_t          key;
+       __kernel_uid32_t        uid;
+       __kernel_gid32_t        gid;
+       __kernel_uid32_t        cuid;
+       __kernel_gid32_t        cgid;
+       __kernel_mode_t         mode;
+       unsigned long           seq;
+       unsigned long           __unused1;
+       unsigned long           __unused2;
+};
+
+#endif /* _XTENSA_IPCBUF_H */
diff --git a/arch/xtensa/include/uapi/asm/mman.h b/arch/xtensa/include/uapi/asm/mman.h
new file mode 100644 (file)
index 0000000..25bc6c1
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * include/asm-xtensa/mman.h
+ *
+ * Xtensa Processor memory-manager definitions
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995 by Ralf Baechle
+ * Copyright (C) 2001 - 2005 Tensilica Inc.
+ */
+
+#ifndef _XTENSA_MMAN_H
+#define _XTENSA_MMAN_H
+
+/*
+ * Protections are chosen from these bits, OR'd together.  The
+ * implementation does not necessarily support PROT_EXEC or PROT_WRITE
+ * without PROT_READ.  The only guarantees are that no writing will be
+ * allowed without PROT_WRITE and no access will be allowed for PROT_NONE.
+ */
+
+#define PROT_NONE      0x0             /* page can not be accessed */
+#define PROT_READ      0x1             /* page can be read */
+#define PROT_WRITE     0x2             /* page can be written */
+#define PROT_EXEC      0x4             /* page can be executed */
+
+#define PROT_SEM       0x10            /* page may be used for atomic ops */
+#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
+#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end fo growsup vma */
+
+/*
+ * Flags for mmap
+ */
+#define MAP_SHARED     0x001           /* Share changes */
+#define MAP_PRIVATE    0x002           /* Changes are private */
+#define MAP_TYPE       0x00f           /* Mask for type of mapping */
+#define MAP_FIXED      0x010           /* Interpret addr exactly */
+
+/* not used by linux, but here to make sure we don't clash with ABI defines */
+#define MAP_RENAME     0x020           /* Assign page to file */
+#define MAP_AUTOGROW   0x040           /* File may grow by writing */
+#define MAP_LOCAL      0x080           /* Copy on fork/sproc */
+#define MAP_AUTORSRV   0x100           /* Logical swap reserved on demand */
+
+/* These are linux-specific */
+#define MAP_NORESERVE  0x0400          /* don't check for reservations */
+#define MAP_ANONYMOUS  0x0800          /* don't use a file */
+#define MAP_GROWSDOWN  0x1000          /* stack-like segment */
+#define MAP_DENYWRITE  0x2000          /* ETXTBSY */
+#define MAP_EXECUTABLE 0x4000          /* mark it as an executable */
+#define MAP_LOCKED     0x8000          /* pages are locked */
+#define MAP_POPULATE   0x10000         /* populate (prefault) pagetables */
+#define MAP_NONBLOCK   0x20000         /* do not block on IO */
+#define MAP_STACK      0x40000         /* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB    0x80000         /* create a huge page mapping */
+
+/*
+ * Flags for msync
+ */
+#define MS_ASYNC       0x0001          /* sync memory asynchronously */
+#define MS_INVALIDATE  0x0002          /* invalidate mappings & caches */
+#define MS_SYNC                0x0004          /* synchronous memory sync */
+
+/*
+ * Flags for mlockall
+ */
+#define MCL_CURRENT    1               /* lock all current mappings */
+#define MCL_FUTURE     2               /* lock all future mappings */
+
+#define MADV_NORMAL    0               /* no further special treatment */
+#define MADV_RANDOM    1               /* expect random page references */
+#define MADV_SEQUENTIAL        2               /* expect sequential page references */
+#define MADV_WILLNEED  3               /* will need these pages */
+#define MADV_DONTNEED  4               /* don't need these pages */
+
+/* common parameters: try to keep these consistent across architectures */
+#define MADV_REMOVE    9               /* remove these pages & resources */
+#define MADV_DONTFORK  10              /* don't inherit across fork */
+#define MADV_DOFORK    11              /* do inherit across fork */
+
+#define MADV_MERGEABLE   12            /* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 13            /* KSM may not merge identical pages */
+
+#define MADV_HUGEPAGE  14              /* Worth backing with hugepages */
+#define MADV_NOHUGEPAGE        15              /* Not worth backing with hugepages */
+
+#define MADV_DONTDUMP   16             /* Explicity exclude from the core dump,
+                                          overrides the coredump filter bits */
+#define MADV_DODUMP    17              /* Clear the MADV_NODUMP flag */
+
+/* compatibility flags */
+#define MAP_FILE       0
+
+#endif /* _XTENSA_MMAN_H */
diff --git a/arch/xtensa/include/uapi/asm/msgbuf.h b/arch/xtensa/include/uapi/asm/msgbuf.h
new file mode 100644 (file)
index 0000000..693c967
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * include/asm-xtensa/msgbuf.h
+ *
+ * The msqid64_ds structure for the Xtensa architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ *
+ * This file is subject to the terms and conditions of the GNU General
+ * Public License.  See the file "COPYING" in the main directory of
+ * this archive for more details.
+ */
+
+#ifndef _XTENSA_MSGBUF_H
+#define _XTENSA_MSGBUF_H
+
+struct msqid64_ds {
+       struct ipc64_perm msg_perm;
+#ifdef __XTENSA_EB__
+       unsigned int    __unused1;
+       __kernel_time_t msg_stime;      /* last msgsnd time */
+       unsigned int    __unused2;
+       __kernel_time_t msg_rtime;      /* last msgrcv time */
+       unsigned int    __unused3;
+       __kernel_time_t msg_ctime;      /* last change time */
+#elif defined(__XTENSA_EL__)
+       __kernel_time_t msg_stime;      /* last msgsnd time */
+       unsigned int    __unused1;
+       __kernel_time_t msg_rtime;      /* last msgrcv time */
+       unsigned int    __unused2;
+       __kernel_time_t msg_ctime;      /* last change time */
+       unsigned int    __unused3;
+#else
+# error processor byte order undefined!
+#endif
+       unsigned long  msg_cbytes;      /* current number of bytes on queue */
+       unsigned long  msg_qnum;        /* number of messages in queue */
+       unsigned long  msg_qbytes;      /* max number of bytes on queue */
+       __kernel_pid_t msg_lspid;       /* pid of last msgsnd */
+       __kernel_pid_t msg_lrpid;       /* last receive pid */
+       unsigned long  __unused4;
+       unsigned long  __unused5;
+};
+
+#endif /* _XTENSA_MSGBUF_H */
diff --git a/arch/xtensa/include/uapi/asm/param.h b/arch/xtensa/include/uapi/asm/param.h
new file mode 100644 (file)
index 0000000..87bc2ea
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * include/asm-xtensa/param.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 - 2005 Tensilica Inc.
+ */
+
+#ifndef _UAPI_XTENSA_PARAM_H
+#define _UAPI_XTENSA_PARAM_H
+
+#ifndef __KERNEL__
+# define HZ            100
+#endif
+
+#define EXEC_PAGESIZE  4096
+
+#ifndef NGROUPS
+#define NGROUPS                32
+#endif
+
+#ifndef NOGROUP
+#define NOGROUP                (-1)
+#endif
+
+#define MAXHOSTNAMELEN 64      /* max length of hostname */
+
+#endif /* _UAPI_XTENSA_PARAM_H */
diff --git a/arch/xtensa/include/uapi/asm/poll.h b/arch/xtensa/include/uapi/asm/poll.h
new file mode 100644 (file)
index 0000000..9d2d599
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * include/asm-xtensa/poll.h
+ *
+ * This file is subject to the terms and conditions of the GNU General
+ * Public License.  See the file "COPYING" in the main directory of
+ * this archive for more details.
+ *
+ * Copyright (C) 2001 - 2005 Tensilica Inc.
+ */
+
+#ifndef _XTENSA_POLL_H
+#define _XTENSA_POLL_H
+
+#define POLLWRNORM     POLLOUT
+#define POLLWRBAND     0x0100
+#define POLLREMOVE     0x0800
+
+#include <asm-generic/poll.h>
+
+#endif /* _XTENSA_POLL_H */
diff --git a/arch/xtensa/include/uapi/asm/posix_types.h b/arch/xtensa/include/uapi/asm/posix_types.h
new file mode 100644 (file)
index 0000000..6e96be0
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * include/asm-xtensa/posix_types.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Largely copied from include/asm-ppc/posix_types.h
+ *
+ * Copyright (C) 2001 - 2005 Tensilica Inc.
+ */
+
+#ifndef _XTENSA_POSIX_TYPES_H
+#define _XTENSA_POSIX_TYPES_H
+
+/*
+ * This file is generally used by user-level software, so you need to
+ * be a little careful about namespace pollution etc.  Also, we cannot
+ * assume GCC is being used.
+ */
+
+typedef unsigned short __kernel_ipc_pid_t;
+#define __kernel_ipc_pid_t __kernel_ipc_pid_t
+
+typedef unsigned int   __kernel_size_t;
+typedef int            __kernel_ssize_t;
+typedef long           __kernel_ptrdiff_t;
+#define __kernel_size_t __kernel_size_t
+
+typedef unsigned short __kernel_old_uid_t;
+typedef unsigned short __kernel_old_gid_t;
+#define __kernel_old_uid_t __kernel_old_uid_t
+
+typedef unsigned short __kernel_old_dev_t;
+#define __kernel_old_dev_t __kernel_old_dev_t
+
+#include <asm-generic/posix_types.h>
+
+#endif /* _XTENSA_POSIX_TYPES_H */
diff --git a/arch/xtensa/include/uapi/asm/ptrace.h b/arch/xtensa/include/uapi/asm/ptrace.h
new file mode 100644 (file)
index 0000000..ee17aa8
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * include/asm-xtensa/ptrace.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 - 2005 Tensilica Inc.
+ */
+
+#ifndef _UAPI_XTENSA_PTRACE_H
+#define _UAPI_XTENSA_PTRACE_H
+
+/*
+ * Kernel stack
+ *
+ *             +-----------------------+  -------- STACK_SIZE
+ *             |     register file     |  |
+ *             +-----------------------+  |
+ *             |    struct pt_regs     |  |
+ *             +-----------------------+  | ------ PT_REGS_OFFSET
+ * double      :  16 bytes spill area  :  |  ^
+ * excetion    :- - - - - - - - - - - -:  |  |
+ * frame       :    struct pt_regs     :  |  |
+ *             :- - - - - - - - - - - -:  |  |
+ *             |                       |  |  |
+ *             |     memory stack      |  |  |
+ *             |                       |  |  |
+ *             ~                       ~  ~  ~
+ *             ~                       ~  ~  ~
+ *             |                       |  |  |
+ *             |                       |  |  |
+ *             +-----------------------+  |  | --- STACK_BIAS
+ *             |  struct task_struct   |  |  |  ^
+ *  current --> +-----------------------+  |  |  |
+ *             |  struct thread_info   |  |  |  |
+ *             +-----------------------+ --------
+ */
+
+#define KERNEL_STACK_SIZE (2 * PAGE_SIZE)
+
+/*  Offsets for exception_handlers[] (3 x 64-entries x 4-byte tables). */
+
+#define EXC_TABLE_KSTK         0x004   /* Kernel Stack */
+#define EXC_TABLE_DOUBLE_SAVE  0x008   /* Double exception save area for a0 */
+#define EXC_TABLE_FIXUP                0x00c   /* Fixup handler */
+#define EXC_TABLE_PARAM                0x010   /* For passing a parameter to fixup */
+#define EXC_TABLE_SYSCALL_SAVE 0x014   /* For fast syscall handler */
+#define EXC_TABLE_FAST_USER    0x100   /* Fast user exception handler */
+#define EXC_TABLE_FAST_KERNEL  0x200   /* Fast kernel exception handler */
+#define EXC_TABLE_DEFAULT      0x300   /* Default C-Handler */
+#define EXC_TABLE_SIZE         0x400
+
+/* Registers used by strace */
+
+#define REG_A_BASE     0x0000
+#define REG_AR_BASE    0x0100
+#define REG_PC         0x0020
+#define REG_PS         0x02e6
+#define REG_WB         0x0248
+#define REG_WS         0x0249
+#define REG_LBEG       0x0200
+#define REG_LEND       0x0201
+#define REG_LCOUNT     0x0202
+#define REG_SAR                0x0203
+
+#define SYSCALL_NR     0x00ff
+
+/* Other PTRACE_ values defined in <linux/ptrace.h> using values 0-9,16,17,24 */
+
+#define PTRACE_GETREGS         12
+#define PTRACE_SETREGS         13
+#define PTRACE_GETXTREGS       18
+#define PTRACE_SETXTREGS       19
+
+
+#endif /* _UAPI_XTENSA_PTRACE_H */
diff --git a/arch/xtensa/include/uapi/asm/sembuf.h b/arch/xtensa/include/uapi/asm/sembuf.h
new file mode 100644 (file)
index 0000000..c158704
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * include/asm-xtensa/sembuf.h
+ *
+ * The semid64_ds structure for Xtensa architecture.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 - 2005 Tensilica Inc.
+ *
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ *
+ */
+
+#ifndef _XTENSA_SEMBUF_H
+#define _XTENSA_SEMBUF_H
+
+#include <asm/byteorder.h>
+
+struct semid64_ds {
+       struct ipc64_perm sem_perm;             /* permissions .. see ipc.h */
+#ifdef __XTENSA_EL__
+       __kernel_time_t sem_otime;              /* last semop time */
+       unsigned long   __unused1;
+       __kernel_time_t sem_ctime;              /* last change time */
+       unsigned long   __unused2;
+#else
+       unsigned long   __unused1;
+       __kernel_time_t sem_otime;              /* last semop time */
+       unsigned long   __unused2;
+       __kernel_time_t sem_ctime;              /* last change time */
+#endif
+       unsigned long   sem_nsems;              /* no. of semaphores in array */
+       unsigned long   __unused3;
+       unsigned long   __unused4;
+};
+
+#endif /* __ASM_XTENSA_SEMBUF_H */
diff --git a/arch/xtensa/include/uapi/asm/setup.h b/arch/xtensa/include/uapi/asm/setup.h
new file mode 100644 (file)
index 0000000..9fa8ad9
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * include/asm-xtensa/setup.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 - 2005 Tensilica Inc.
+ */
+
+#ifndef _XTENSA_SETUP_H
+#define _XTENSA_SETUP_H
+
+#define COMMAND_LINE_SIZE      256
+
+extern void set_except_vector(int n, void *addr);
+
+#endif
diff --git a/arch/xtensa/include/uapi/asm/shmbuf.h b/arch/xtensa/include/uapi/asm/shmbuf.h
new file mode 100644 (file)
index 0000000..ad4b012
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * include/asm-xtensa/shmbuf.h
+ *
+ * The shmid64_ds structure for Xtensa architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 - 2005 Tensilica Inc.
+ */
+
+#ifndef _XTENSA_SHMBUF_H
+#define _XTENSA_SHMBUF_H
+
+#if defined (__XTENSA_EL__)
+struct shmid64_ds {
+       struct ipc64_perm       shm_perm;       /* operation perms */
+       size_t                  shm_segsz;      /* size of segment (bytes) */
+       __kernel_time_t         shm_atime;      /* last attach time */
+       unsigned long           __unused1;
+       __kernel_time_t         shm_dtime;      /* last detach time */
+       unsigned long           __unused2;
+       __kernel_time_t         shm_ctime;      /* last change time */
+       unsigned long           __unused3;
+       __kernel_pid_t          shm_cpid;       /* pid of creator */
+       __kernel_pid_t          shm_lpid;       /* pid of last operator */
+       unsigned long           shm_nattch;     /* no. of current attaches */
+       unsigned long           __unused4;
+       unsigned long           __unused5;
+};
+#elif defined (__XTENSA_EB__)
+struct shmid64_ds {
+       struct ipc64_perm       shm_perm;       /* operation perms */
+       size_t                  shm_segsz;      /* size of segment (bytes) */
+       __kernel_time_t         shm_atime;      /* last attach time */
+       unsigned long           __unused1;
+       __kernel_time_t         shm_dtime;      /* last detach time */
+       unsigned long           __unused2;
+       __kernel_time_t         shm_ctime;      /* last change time */
+       unsigned long           __unused3;
+       __kernel_pid_t          shm_cpid;       /* pid of creator */
+       __kernel_pid_t          shm_lpid;       /* pid of last operator */
+       unsigned long           shm_nattch;     /* no. of current attaches */
+       unsigned long           __unused4;
+       unsigned long           __unused5;
+};
+#else
+# error endian order not defined
+#endif
+
+
+struct shminfo64 {
+       unsigned long   shmmax;
+       unsigned long   shmmin;
+       unsigned long   shmmni;
+       unsigned long   shmseg;
+       unsigned long   shmall;
+       unsigned long   __unused1;
+       unsigned long   __unused2;
+       unsigned long   __unused3;
+       unsigned long   __unused4;
+};
+
+#endif /* _XTENSA_SHMBUF_H */
diff --git a/arch/xtensa/include/uapi/asm/sigcontext.h b/arch/xtensa/include/uapi/asm/sigcontext.h
new file mode 100644 (file)
index 0000000..03383af
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * include/asm-xtensa/sigcontext.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 - 2007 Tensilica Inc.
+ */
+
+#ifndef _XTENSA_SIGCONTEXT_H
+#define _XTENSA_SIGCONTEXT_H
+
+
+struct sigcontext {
+       unsigned long sc_pc;
+       unsigned long sc_ps;
+       unsigned long sc_lbeg;
+       unsigned long sc_lend;
+       unsigned long sc_lcount;
+       unsigned long sc_sar;
+       unsigned long sc_acclo;
+       unsigned long sc_acchi;
+       unsigned long sc_a[16];
+       void *sc_xtregs;
+};
+
+#endif /* _XTENSA_SIGCONTEXT_H */
diff --git a/arch/xtensa/include/uapi/asm/signal.h b/arch/xtensa/include/uapi/asm/signal.h
new file mode 100644 (file)
index 0000000..b88ce96
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * include/asm-xtensa/signal.h
+ *
+ * Swiped from SH.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 - 2005 Tensilica Inc.
+ */
+
+#ifndef _UAPI_XTENSA_SIGNAL_H
+#define _UAPI_XTENSA_SIGNAL_H
+
+
+#define _NSIG          64
+#define _NSIG_BPW      32
+#define _NSIG_WORDS    (_NSIG / _NSIG_BPW)
+
+#ifndef __ASSEMBLY__
+
+#include <linux/types.h>
+
+/* Avoid too many header ordering problems.  */
+struct siginfo;
+typedef unsigned long old_sigset_t;            /* at least 32 bits */
+typedef struct {
+       unsigned long sig[_NSIG_WORDS];
+} sigset_t;
+
+#endif
+
+#define SIGHUP          1
+#define SIGINT          2
+#define SIGQUIT                 3
+#define SIGILL          4
+#define SIGTRAP                 5
+#define SIGABRT                 6
+#define SIGIOT          6
+#define SIGBUS          7
+#define SIGFPE          8
+#define SIGKILL                 9
+#define SIGUSR1                10
+#define SIGSEGV                11
+#define SIGUSR2                12
+#define SIGPIPE                13
+#define SIGALRM                14
+#define SIGTERM                15
+#define SIGSTKFLT      16
+#define SIGCHLD                17
+#define SIGCONT                18
+#define SIGSTOP                19
+#define SIGTSTP                20
+#define SIGTTIN                21
+#define SIGTTOU                22
+#define SIGURG         23
+#define SIGXCPU                24
+#define SIGXFSZ                25
+#define SIGVTALRM      26
+#define SIGPROF                27
+#define SIGWINCH       28
+#define SIGIO          29
+#define SIGPOLL                SIGIO
+/* #define SIGLOST             29 */
+#define SIGPWR         30
+#define SIGSYS         31
+#define        SIGUNUSED       31
+
+/* These should not be considered constants from userland.  */
+#define SIGRTMIN       32
+#define SIGRTMAX       (_NSIG-1)
+
+/*
+ * SA_FLAGS values:
+ *
+ * SA_ONSTACK indicates that a registered stack_t will be used.
+ * SA_RESTART flag to get restarting signals (which were the default long ago)
+ * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
+ * SA_RESETHAND clears the handler when the signal is delivered.
+ * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
+ * SA_NODEFER prevents the current signal from being masked in the handler.
+ *
+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
+ * Unix names RESETHAND and NODEFER respectively.
+ */
+#define SA_NOCLDSTOP   0x00000001
+#define SA_NOCLDWAIT   0x00000002 /* not supported yet */
+#define SA_SIGINFO     0x00000004
+#define SA_ONSTACK     0x08000000
+#define SA_RESTART     0x10000000
+#define SA_NODEFER     0x40000000
+#define SA_RESETHAND   0x80000000
+
+#define SA_NOMASK      SA_NODEFER
+#define SA_ONESHOT     SA_RESETHAND
+
+#define SA_RESTORER    0x04000000
+
+/*
+ * sigaltstack controls
+ */
+#define SS_ONSTACK     1
+#define SS_DISABLE     2
+
+#define MINSIGSTKSZ    2048
+#define SIGSTKSZ       8192
+
+#ifndef __ASSEMBLY__
+
+#define SIG_BLOCK          0   /* for blocking signals */
+#define SIG_UNBLOCK        1   /* for unblocking signals */
+#define SIG_SETMASK        2   /* for setting the signal mask */
+
+/* Type of a signal handler.  */
+typedef void (*__sighandler_t)(int);
+
+#define SIG_DFL        ((__sighandler_t)0)     /* default signal handling */
+#define SIG_IGN        ((__sighandler_t)1)     /* ignore signal */
+#define SIG_ERR        ((__sighandler_t)-1)    /* error return from signal */
+
+#ifndef __KERNEL__
+
+/* Here we must cater to libcs that poke about in kernel headers.  */
+
+struct sigaction {
+       union {
+         __sighandler_t _sa_handler;
+         void (*_sa_sigaction)(int, struct siginfo *, void *);
+       } _u;
+       sigset_t sa_mask;
+       unsigned long sa_flags;
+       void (*sa_restorer)(void);
+};
+
+#define sa_handler     _u._sa_handler
+#define sa_sigaction   _u._sa_sigaction
+
+#endif /* __KERNEL__ */
+
+typedef struct sigaltstack {
+       void *ss_sp;
+       int ss_flags;
+       size_t ss_size;
+} stack_t;
+
+#endif /* __ASSEMBLY__ */
+#endif /* _UAPI_XTENSA_SIGNAL_H */
diff --git a/arch/xtensa/include/uapi/asm/socket.h b/arch/xtensa/include/uapi/asm/socket.h
new file mode 100644 (file)
index 0000000..e36c681
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * include/asm-xtensa/socket.h
+ *
+ * Copied from i386.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#ifndef _XTENSA_SOCKET_H
+#define _XTENSA_SOCKET_H
+
+#include <asm/sockios.h>
+
+/* For setsockoptions(2) */
+#define SOL_SOCKET     1
+
+#define SO_DEBUG       1
+#define SO_REUSEADDR   2
+#define SO_TYPE                3
+#define SO_ERROR       4
+#define SO_DONTROUTE   5
+#define SO_BROADCAST   6
+#define SO_SNDBUF      7
+#define SO_RCVBUF      8
+#define SO_SNDBUFFORCE 32
+#define SO_RCVBUFFORCE 33
+#define SO_KEEPALIVE   9
+#define SO_OOBINLINE   10
+#define SO_NO_CHECK    11
+#define SO_PRIORITY    12
+#define SO_LINGER      13
+#define SO_BSDCOMPAT   14
+/* To add :#define SO_REUSEPORT 15 */
+#define SO_PASSCRED    16
+#define SO_PEERCRED    17
+#define SO_RCVLOWAT    18
+#define SO_SNDLOWAT    19
+#define SO_RCVTIMEO    20
+#define SO_SNDTIMEO    21
+
+/* Security levels - as per NRL IPv6 - don't actually do anything */
+
+#define SO_SECURITY_AUTHENTICATION             22
+#define SO_SECURITY_ENCRYPTION_TRANSPORT       23
+#define SO_SECURITY_ENCRYPTION_NETWORK         24
+
+#define SO_BINDTODEVICE        25
+
+/* Socket filtering */
+
+#define SO_ATTACH_FILTER        26
+#define SO_DETACH_FILTER        27
+
+#define SO_PEERNAME            28
+#define SO_TIMESTAMP           29
+#define SCM_TIMESTAMP          SO_TIMESTAMP
+
+#define SO_ACCEPTCONN          30
+#define SO_PEERSEC             31
+#define SO_PASSSEC             34
+#define SO_TIMESTAMPNS         35
+#define SCM_TIMESTAMPNS                SO_TIMESTAMPNS
+
+#define SO_MARK                        36
+
+#define SO_TIMESTAMPING                37
+#define SCM_TIMESTAMPING       SO_TIMESTAMPING
+
+#define SO_PROTOCOL            38
+#define SO_DOMAIN              39
+
+#define SO_RXQ_OVFL             40
+
+#define SO_WIFI_STATUS         41
+#define SCM_WIFI_STATUS                SO_WIFI_STATUS
+#define SO_PEEK_OFF            42
+
+/* Instruct lower device to use last 4-bytes of skb data as FCS */
+#define SO_NOFCS               43
+
+#endif /* _XTENSA_SOCKET_H */
diff --git a/arch/xtensa/include/uapi/asm/sockios.h b/arch/xtensa/include/uapi/asm/sockios.h
new file mode 100644 (file)
index 0000000..efe0af3
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * include/asm-xtensa/sockios.h
+ *
+ * Socket-level I/O control calls.  Copied from MIPS.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995 by Ralf Baechle
+ * Copyright (C) 2001 Tensilica Inc.
+ */
+
+#ifndef _XTENSA_SOCKIOS_H
+#define _XTENSA_SOCKIOS_H
+
+#include <asm/ioctl.h>
+
+/* Socket-level I/O control calls. */
+
+#define FIOGETOWN      _IOR('f', 123, int)
+#define FIOSETOWN      _IOW('f', 124, int)
+
+#define SIOCATMARK     _IOR('s', 7, int)
+#define SIOCSPGRP      _IOW('s', 8, pid_t)
+#define SIOCGPGRP      _IOR('s', 9, pid_t)
+
+#define SIOCGSTAMP     0x8906          /* Get stamp (timeval) */
+#define SIOCGSTAMPNS   0x8907          /* Get stamp (timespec) */
+
+#endif /* _XTENSA_SOCKIOS_H */
diff --git a/arch/xtensa/include/uapi/asm/stat.h b/arch/xtensa/include/uapi/asm/stat.h
new file mode 100644 (file)
index 0000000..c499203
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * include/asm-xtensa/stat.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 - 2007 Tensilica Inc.
+ */
+
+#ifndef _XTENSA_STAT_H
+#define _XTENSA_STAT_H
+
+#define STAT_HAVE_NSEC 1
+
+struct stat {
+       unsigned long   st_dev;
+       unsigned long   st_ino;
+       unsigned int    st_mode;
+       unsigned int    st_nlink;
+       unsigned int    st_uid;
+       unsigned int    st_gid;
+       unsigned long   st_rdev;
+       long            st_size;
+       unsigned long   st_blksize;
+       unsigned long   st_blocks;
+       unsigned long   st_atime;
+       unsigned long   st_atime_nsec;
+       unsigned long   st_mtime;
+       unsigned long   st_mtime_nsec;
+       unsigned long   st_ctime;
+       unsigned long   st_ctime_nsec;
+       unsigned long   __unused4;
+       unsigned long   __unused5;
+};
+
+struct stat64  {
+       unsigned long long st_dev;      /* Device */
+       unsigned long long st_ino;      /* File serial number */
+       unsigned int  st_mode;          /* File mode. */
+       unsigned int  st_nlink;         /* Link count. */
+       unsigned int  st_uid;           /* User ID of the file's owner. */
+       unsigned int  st_gid;           /* Group ID of the file's group. */
+       unsigned long long st_rdev;     /* Device number, if device. */
+       long long st_size;              /* Size of file, in bytes. */
+       unsigned long st_blksize;       /* Optimal block size for I/O. */
+       unsigned long __unused2;
+       unsigned long long st_blocks;   /* Number 512-byte blocks allocated. */
+       unsigned long st_atime;         /* Time of last access. */
+       unsigned long st_atime_nsec;
+       unsigned long st_mtime;         /* Time of last modification. */
+       unsigned long st_mtime_nsec;
+       unsigned long st_ctime;         /* Time of last status change. */
+       unsigned long st_ctime_nsec;
+       unsigned long __unused4;
+       unsigned long __unused5;
+};
+
+#endif /* _XTENSA_STAT_H */
diff --git a/arch/xtensa/include/uapi/asm/swab.h b/arch/xtensa/include/uapi/asm/swab.h
new file mode 100644 (file)
index 0000000..226a391
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * include/asm-xtensa/swab.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 - 2005 Tensilica Inc.
+ */
+
+#ifndef _XTENSA_SWAB_H
+#define _XTENSA_SWAB_H
+
+#include <linux/types.h>
+#include <linux/compiler.h>
+
+#define __SWAB_64_THRU_32__
+
+static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
+{
+    __u32 res;
+    /* instruction sequence from Xtensa ISA release 2/2000 */
+    __asm__("ssai     8           \n\t"
+           "srli     %0, %1, 16  \n\t"
+           "src      %0, %0, %1  \n\t"
+           "src      %0, %0, %0  \n\t"
+           "src      %0, %1, %0  \n"
+           : "=&a" (res)
+           : "a" (x)
+           );
+    return res;
+}
+#define __arch_swab32 __arch_swab32
+
+static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
+{
+    /* Given that 'short' values are signed (i.e., can be negative),
+     * we cannot assume that the upper 16-bits of the register are
+     * zero.  We are careful to mask values after shifting.
+     */
+
+    /* There exists an anomaly between xt-gcc and xt-xcc.  xt-gcc
+     * inserts an extui instruction after putting this function inline
+     * to ensure that it uses only the least-significant 16 bits of
+     * the result.  xt-xcc doesn't use an extui, but assumes the
+     * __asm__ macro follows convention that the upper 16 bits of an
+     * 'unsigned short' result are still zero.  This macro doesn't
+     * follow convention; indeed, it leaves garbage in the upport 16
+     * bits of the register.
+
+     * Declaring the temporary variables 'res' and 'tmp' to be 32-bit
+     * types while the return type of the function is a 16-bit type
+     * forces both compilers to insert exactly one extui instruction
+     * (or equivalent) to mask off the upper 16 bits. */
+
+    __u32 res;
+    __u32 tmp;
+
+    __asm__("extui    %1, %2, 8, 8\n\t"
+           "slli     %0, %2, 8   \n\t"
+           "or       %0, %0, %1  \n"
+           : "=&a" (res), "=&a" (tmp)
+           : "a" (x)
+           );
+
+    return res;
+}
+#define __arch_swab16 __arch_swab16
+
+#endif /* _XTENSA_SWAB_H */
diff --git a/arch/xtensa/include/uapi/asm/termbits.h b/arch/xtensa/include/uapi/asm/termbits.h
new file mode 100644 (file)
index 0000000..0d6c871
--- /dev/null
@@ -0,0 +1,220 @@
+/*
+ * include/asm-xtensa/termbits.h
+ *
+ * Copied from SH.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 - 2005 Tensilica Inc.
+ */
+
+#ifndef _XTENSA_TERMBITS_H
+#define _XTENSA_TERMBITS_H
+
+
+#include <linux/posix_types.h>
+
+typedef unsigned char  cc_t;
+typedef unsigned int   speed_t;
+typedef unsigned int   tcflag_t;
+
+#define NCCS 19
+struct termios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+};
+
+struct termios2 {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
+/* c_cc characters */
+
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+/* c_iflag bits */
+
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK  0000020
+#define ISTRIP 0000040
+#define INLCR  0000100
+#define IGNCR  0000200
+#define ICRNL  0000400
+#define IUCLC  0001000
+#define IXON   0002000
+#define IXANY  0004000
+#define IXOFF  0010000
+#define IMAXBEL        0020000
+#define IUTF8  0040000
+
+/* c_oflag bits */
+
+#define OPOST  0000001
+#define OLCUC  0000002
+#define ONLCR  0000004
+#define OCRNL  0000010
+#define ONOCR  0000020
+#define ONLRET 0000040
+#define OFILL  0000100
+#define OFDEL  0000200
+#define NLDLY  0000400
+#define   NL0  0000000
+#define   NL1  0000400
+#define CRDLY  0003000
+#define   CR0  0000000
+#define   CR1  0001000
+#define   CR2  0002000
+#define   CR3  0003000
+#define TABDLY 0014000
+#define   TAB0 0000000
+#define   TAB1 0004000
+#define   TAB2 0010000
+#define   TAB3 0014000
+#define   XTABS        0014000
+#define BSDLY  0020000
+#define   BS0  0000000
+#define   BS1  0020000
+#define VTDLY  0040000
+#define   VT0  0000000
+#define   VT1  0040000
+#define FFDLY  0100000
+#define   FF0  0000000
+#define   FF1  0100000
+
+/* c_cflag bit meaning */
+
+#define CBAUD  0010017
+#define  B0    0000000         /* hang up */
+#define  B50   0000001
+#define  B75   0000002
+#define  B110  0000003
+#define  B134  0000004
+#define  B150  0000005
+#define  B200  0000006
+#define  B300  0000007
+#define  B600  0000010
+#define  B1200 0000011
+#define  B1800 0000012
+#define  B2400 0000013
+#define  B4800 0000014
+#define  B9600 0000015
+#define  B19200        0000016
+#define  B38400        0000017
+#define EXTA B19200
+#define EXTB B38400
+#define CSIZE  0000060
+#define   CS5  0000000
+#define   CS6  0000020
+#define   CS7  0000040
+#define   CS8  0000060
+#define CSTOPB 0000100
+#define CREAD  0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL  0002000
+#define CLOCAL 0004000
+#define CBAUDEX 0010000
+#define           BOTHER 0010000
+#define    B57600 0010001
+#define   B115200 0010002
+#define   B230400 0010003
+#define   B460800 0010004
+#define   B500000 0010005
+#define   B576000 0010006
+#define   B921600 0010007
+#define  B1000000 0010010
+#define  B1152000 0010011
+#define  B1500000 0010012
+#define  B2000000 0010013
+#define  B2500000 0010014
+#define  B3000000 0010015
+#define  B3500000 0010016
+#define  B4000000 0010017
+#define CIBAUD   002003600000          /* input baud rate */
+#define CMSPAR   010000000000          /* mark or space (stick) parity */
+#define CRTSCTS          020000000000          /* flow control */
+
+#define IBSHIFT        16              /* Shift from CBAUD to CIBAUD */
+
+/* c_lflag bits */
+
+#define ISIG   0000001
+#define ICANON 0000002
+#define XCASE  0000004
+#define ECHO   0000010
+#define ECHOE  0000020
+#define ECHOK  0000040
+#define ECHONL 0000100
+#define NOFLSH 0000200
+#define TOSTOP 0000400
+#define ECHOCTL        0001000
+#define ECHOPRT        0002000
+#define ECHOKE 0004000
+#define FLUSHO 0010000
+#define PENDIN 0040000
+#define IEXTEN 0100000
+#define EXTPROC        0200000
+
+/* tcflow() and TCXONC use these */
+
+#define        TCOOFF          0
+#define        TCOON           1
+#define        TCIOFF          2
+#define        TCION           3
+
+/* tcflush() and TCFLSH use these */
+
+#define        TCIFLUSH        0
+#define        TCOFLUSH        1
+#define        TCIOFLUSH       2
+
+/* tcsetattr uses these */
+
+#define        TCSANOW         0
+#define        TCSADRAIN       1
+#define        TCSAFLUSH       2
+
+#endif /* _XTENSA_TERMBITS_H */
diff --git a/arch/xtensa/include/uapi/asm/types.h b/arch/xtensa/include/uapi/asm/types.h
new file mode 100644 (file)
index 0000000..87ec7ae
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * include/asm-xtensa/types.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 - 2005 Tensilica Inc.
+ */
+
+#ifndef _UAPI_XTENSA_TYPES_H
+#define _UAPI_XTENSA_TYPES_H
+
+#include <asm-generic/int-ll64.h>
+
+#ifdef __ASSEMBLY__
+# define __XTENSA_UL(x)                (x)
+# define __XTENSA_UL_CONST(x)  x
+#else
+# define __XTENSA_UL(x)                ((unsigned long)(x))
+# define __XTENSA_UL_CONST(x)  x##UL
+#endif
+
+#ifndef __ASSEMBLY__
+
+#endif
+
+#endif /* _UAPI_XTENSA_TYPES_H */
diff --git a/arch/xtensa/include/uapi/asm/unistd.h b/arch/xtensa/include/uapi/asm/unistd.h
new file mode 100644 (file)
index 0000000..479abae
--- /dev/null
@@ -0,0 +1,762 @@
+/*
+ * include/asm-xtensa/unistd.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 - 2012 Tensilica Inc.
+ */
+
+#ifndef _UAPI_XTENSA_UNISTD_H
+#define _UAPI_XTENSA_UNISTD_H
+
+#ifndef __SYSCALL
+# define __SYSCALL(nr,func,nargs)
+#endif
+
+#define __NR_spill                               0
+__SYSCALL(  0, sys_ni_syscall, 0)
+#define __NR_xtensa                              1
+__SYSCALL(  1, sys_ni_syscall, 0)
+#define __NR_available4                                  2
+__SYSCALL(  2, sys_ni_syscall, 0)
+#define __NR_available5                                  3
+__SYSCALL(  3, sys_ni_syscall, 0)
+#define __NR_available6                                  4
+__SYSCALL(  4, sys_ni_syscall, 0)
+#define __NR_available7                                  5
+__SYSCALL(  5, sys_ni_syscall, 0)
+#define __NR_available8                                  6
+__SYSCALL(  6, sys_ni_syscall, 0)
+#define __NR_available9                                  7
+__SYSCALL(  7, sys_ni_syscall, 0)
+
+/* File Operations */
+
+#define __NR_open                                8
+__SYSCALL(  8, sys_open, 3)
+#define __NR_close                               9
+__SYSCALL(  9, sys_close, 1)
+#define __NR_dup                                10
+__SYSCALL( 10, sys_dup, 1)
+#define __NR_dup2                               11
+__SYSCALL( 11, sys_dup2, 2)
+#define __NR_read                               12
+__SYSCALL( 12, sys_read, 3)
+#define __NR_write                              13
+__SYSCALL( 13, sys_write, 3)
+#define __NR_select                             14
+__SYSCALL( 14, sys_select, 5)
+#define __NR_lseek                              15
+__SYSCALL( 15, sys_lseek, 3)
+#define __NR_poll                               16
+__SYSCALL( 16, sys_poll, 3)
+#define __NR__llseek                            17
+__SYSCALL( 17, sys_llseek, 5)
+#define __NR_epoll_wait                         18
+__SYSCALL( 18, sys_epoll_wait, 4)
+#define __NR_epoll_ctl                                  19
+__SYSCALL( 19, sys_epoll_ctl, 4)
+#define __NR_epoll_create                       20
+__SYSCALL( 20, sys_epoll_create, 1)
+#define __NR_creat                              21
+__SYSCALL( 21, sys_creat, 2)
+#define __NR_truncate                           22
+__SYSCALL( 22, sys_truncate, 2)
+#define __NR_ftruncate                                  23
+__SYSCALL( 23, sys_ftruncate, 2)
+#define __NR_readv                              24
+__SYSCALL( 24, sys_readv, 3)
+#define __NR_writev                             25
+__SYSCALL( 25, sys_writev, 3)
+#define __NR_fsync                              26
+__SYSCALL( 26, sys_fsync, 1)
+#define __NR_fdatasync                                  27
+__SYSCALL( 27, sys_fdatasync, 1)
+#define __NR_truncate64                         28
+__SYSCALL( 28, sys_truncate64, 2)
+#define __NR_ftruncate64                        29
+__SYSCALL( 29, sys_ftruncate64, 2)
+#define __NR_pread64                            30
+__SYSCALL( 30, sys_pread64, 6)
+#define __NR_pwrite64                           31
+__SYSCALL( 31, sys_pwrite64, 6)
+
+#define __NR_link                               32
+__SYSCALL( 32, sys_link, 2)
+#define __NR_rename                             33
+__SYSCALL( 33, sys_rename, 2)
+#define __NR_symlink                            34
+__SYSCALL( 34, sys_symlink, 2)
+#define __NR_readlink                           35
+__SYSCALL( 35, sys_readlink, 3)
+#define __NR_mknod                              36
+__SYSCALL( 36, sys_mknod, 3)
+#define __NR_pipe                               37
+__SYSCALL( 37, sys_pipe, 1)
+#define __NR_unlink                             38
+__SYSCALL( 38, sys_unlink, 1)
+#define __NR_rmdir                              39
+__SYSCALL( 39, sys_rmdir, 1)
+
+#define __NR_mkdir                              40
+__SYSCALL( 40, sys_mkdir, 2)
+#define __NR_chdir                              41
+__SYSCALL( 41, sys_chdir, 1)
+#define __NR_fchdir                             42
+__SYSCALL( 42, sys_fchdir, 1)
+#define __NR_getcwd                             43
+__SYSCALL( 43, sys_getcwd, 2)
+
+#define __NR_chmod                              44
+__SYSCALL( 44, sys_chmod, 2)
+#define __NR_chown                              45
+__SYSCALL( 45, sys_chown, 3)
+#define __NR_stat                               46
+__SYSCALL( 46, sys_newstat, 2)
+#define __NR_stat64                             47
+__SYSCALL( 47, sys_stat64, 2)
+
+#define __NR_lchown                             48
+__SYSCALL( 48, sys_lchown, 3)
+#define __NR_lstat                              49
+__SYSCALL( 49, sys_newlstat, 2)
+#define __NR_lstat64                            50
+__SYSCALL( 50, sys_lstat64, 2)
+#define __NR_available51                        51
+__SYSCALL( 51, sys_ni_syscall, 0)
+
+#define __NR_fchmod                             52
+__SYSCALL( 52, sys_fchmod, 2)
+#define __NR_fchown                             53
+__SYSCALL( 53, sys_fchown, 3)
+#define __NR_fstat                              54
+__SYSCALL( 54, sys_newfstat, 2)
+#define __NR_fstat64                            55
+__SYSCALL( 55, sys_fstat64, 2)
+
+#define __NR_flock                              56
+__SYSCALL( 56, sys_flock, 2)
+#define __NR_access                             57
+__SYSCALL( 57, sys_access, 2)
+#define __NR_umask                              58
+__SYSCALL( 58, sys_umask, 1)
+#define __NR_getdents                           59
+__SYSCALL( 59, sys_getdents, 3)
+#define __NR_getdents64                         60
+__SYSCALL( 60, sys_getdents64, 3)
+#define __NR_fcntl64                            61
+__SYSCALL( 61, sys_fcntl64, 3)
+#define __NR_fallocate                          62
+__SYSCALL( 62, sys_fallocate, 6)
+#define __NR_fadvise64_64                       63
+__SYSCALL( 63, xtensa_fadvise64_64, 6)
+#define __NR_utime                              64     /* glibc 2.3.3 ?? */
+__SYSCALL( 64, sys_utime, 2)
+#define __NR_utimes                             65
+__SYSCALL( 65, sys_utimes, 2)
+#define __NR_ioctl                              66
+__SYSCALL( 66, sys_ioctl, 3)
+#define __NR_fcntl                              67
+__SYSCALL( 67, sys_fcntl, 3)
+
+#define __NR_setxattr                           68
+__SYSCALL( 68, sys_setxattr, 5)
+#define __NR_getxattr                           69
+__SYSCALL( 69, sys_getxattr, 4)
+#define __NR_listxattr                                  70
+__SYSCALL( 70, sys_listxattr, 3)
+#define __NR_removexattr                        71
+__SYSCALL( 71, sys_removexattr, 2)
+#define __NR_lsetxattr                                  72
+__SYSCALL( 72, sys_lsetxattr, 5)
+#define __NR_lgetxattr                                  73
+__SYSCALL( 73, sys_lgetxattr, 4)
+#define __NR_llistxattr                         74
+__SYSCALL( 74, sys_llistxattr, 3)
+#define __NR_lremovexattr                       75
+__SYSCALL( 75, sys_lremovexattr, 2)
+#define __NR_fsetxattr                                  76
+__SYSCALL( 76, sys_fsetxattr, 5)
+#define __NR_fgetxattr                                  77
+__SYSCALL( 77, sys_fgetxattr, 4)
+#define __NR_flistxattr                         78
+__SYSCALL( 78, sys_flistxattr, 3)
+#define __NR_fremovexattr                       79
+__SYSCALL( 79, sys_fremovexattr, 2)
+
+/* File Map / Shared Memory Operations */
+
+#define __NR_mmap2                              80
+__SYSCALL( 80, sys_mmap_pgoff, 6)
+#define __NR_munmap                             81
+__SYSCALL( 81, sys_munmap, 2)
+#define __NR_mprotect                           82
+__SYSCALL( 82, sys_mprotect, 3)
+#define __NR_brk                                83
+__SYSCALL( 83, sys_brk, 1)
+#define __NR_mlock                              84
+__SYSCALL( 84, sys_mlock, 2)
+#define __NR_munlock                            85
+__SYSCALL( 85, sys_munlock, 2)
+#define __NR_mlockall                           86
+__SYSCALL( 86, sys_mlockall, 1)
+#define __NR_munlockall                         87
+__SYSCALL( 87, sys_munlockall, 0)
+#define __NR_mremap                             88
+__SYSCALL( 88, sys_mremap, 4)
+#define __NR_msync                              89
+__SYSCALL( 89, sys_msync, 3)
+#define __NR_mincore                            90
+__SYSCALL( 90, sys_mincore, 3)
+#define __NR_madvise                            91
+__SYSCALL( 91, sys_madvise, 3)
+#define __NR_shmget                             92
+__SYSCALL( 92, sys_shmget, 4)
+#define __NR_shmat                              93
+__SYSCALL( 93, xtensa_shmat, 4)
+#define __NR_shmctl                             94
+__SYSCALL( 94, sys_shmctl, 4)
+#define __NR_shmdt                              95
+__SYSCALL( 95, sys_shmdt, 4)
+
+/* Socket Operations */
+
+#define __NR_socket                             96
+__SYSCALL( 96, sys_socket, 3)
+#define __NR_setsockopt                         97
+__SYSCALL( 97, sys_setsockopt, 5)
+#define __NR_getsockopt                         98
+__SYSCALL( 98, sys_getsockopt, 5)
+#define __NR_shutdown                           99
+__SYSCALL( 99, sys_shutdown, 2)
+
+#define __NR_bind                              100
+__SYSCALL(100, sys_bind, 3)
+#define __NR_connect                           101
+__SYSCALL(101, sys_connect, 3)
+#define __NR_listen                            102
+__SYSCALL(102, sys_listen, 2)
+#define __NR_accept                            103
+__SYSCALL(103, sys_accept, 3)
+
+#define __NR_getsockname                       104
+__SYSCALL(104, sys_getsockname, 3)
+#define __NR_getpeername                       105
+__SYSCALL(105, sys_getpeername, 3)
+#define __NR_sendmsg                           106
+__SYSCALL(106, sys_sendmsg, 3)
+#define __NR_recvmsg                           107
+__SYSCALL(107, sys_recvmsg, 3)
+#define __NR_send                              108
+__SYSCALL(108, sys_send, 4)
+#define __NR_recv                              109
+__SYSCALL(109, sys_recv, 4)
+#define __NR_sendto                            110
+__SYSCALL(110, sys_sendto, 6)
+#define __NR_recvfrom                          111
+__SYSCALL(111, sys_recvfrom, 6)
+
+#define __NR_socketpair                        112
+__SYSCALL(112, sys_socketpair, 4)
+#define __NR_sendfile                          113
+__SYSCALL(113, sys_sendfile, 4)
+#define __NR_sendfile64                        114
+__SYSCALL(114, sys_sendfile64, 4)
+#define __NR_sendmmsg                          115
+__SYSCALL(115, sys_sendmmsg, 4)
+
+/* Process Operations */
+
+#define __NR_clone                             116
+__SYSCALL(116, xtensa_clone, 5)
+#define __NR_execve                            117
+__SYSCALL(117, xtensa_execve, 3)
+#define __NR_exit                              118
+__SYSCALL(118, sys_exit, 1)
+#define __NR_exit_group                        119
+__SYSCALL(119, sys_exit_group, 1)
+#define __NR_getpid                            120
+__SYSCALL(120, sys_getpid, 0)
+#define __NR_wait4                             121
+__SYSCALL(121, sys_wait4, 4)
+#define __NR_waitid                            122
+__SYSCALL(122, sys_waitid, 5)
+#define __NR_kill                              123
+__SYSCALL(123, sys_kill, 2)
+#define __NR_tkill                             124
+__SYSCALL(124, sys_tkill, 2)
+#define __NR_tgkill                            125
+__SYSCALL(125, sys_tgkill, 3)
+#define __NR_set_tid_address                   126
+__SYSCALL(126, sys_set_tid_address, 1)
+#define __NR_gettid                            127
+__SYSCALL(127, sys_gettid, 0)
+#define __NR_setsid                            128
+__SYSCALL(128, sys_setsid, 0)
+#define __NR_getsid                            129
+__SYSCALL(129, sys_getsid, 1)
+#define __NR_prctl                             130
+__SYSCALL(130, sys_prctl, 5)
+#define __NR_personality                       131
+__SYSCALL(131, sys_personality, 1)
+#define __NR_getpriority                       132
+__SYSCALL(132, sys_getpriority, 2)
+#define __NR_setpriority                       133
+__SYSCALL(133, sys_setpriority, 3)
+#define __NR_setitimer                                 134
+__SYSCALL(134, sys_setitimer, 3)
+#define __NR_getitimer                                 135
+__SYSCALL(135, sys_getitimer, 2)
+#define __NR_setuid                            136
+__SYSCALL(136, sys_setuid, 1)
+#define __NR_getuid                            137
+__SYSCALL(137, sys_getuid, 0)
+#define __NR_setgid                            138
+__SYSCALL(138, sys_setgid, 1)
+#define __NR_getgid                            139
+__SYSCALL(139, sys_getgid, 0)
+#define __NR_geteuid                           140
+__SYSCALL(140, sys_geteuid, 0)
+#define __NR_getegid                           141
+__SYSCALL(141, sys_getegid, 0)
+#define __NR_setreuid                          142
+__SYSCALL(142, sys_setreuid, 2)
+#define __NR_setregid                          143
+__SYSCALL(143, sys_setregid, 2)
+#define __NR_setresuid                                 144
+__SYSCALL(144, sys_setresuid, 3)
+#define __NR_getresuid                                 145
+__SYSCALL(145, sys_getresuid, 3)
+#define __NR_setresgid                                 146
+__SYSCALL(146, sys_setresgid, 3)
+#define __NR_getresgid                                 147
+__SYSCALL(147, sys_getresgid, 3)
+#define __NR_setpgid                           148
+__SYSCALL(148, sys_setpgid, 2)
+#define __NR_getpgid                           149
+__SYSCALL(149, sys_getpgid, 1)
+#define __NR_getppid                           150
+__SYSCALL(150, sys_getppid, 0)
+#define __NR_getpgrp                           151
+__SYSCALL(151, sys_getpgrp, 0)
+
+#define __NR_reserved152                       152     /* set_thread_area */
+__SYSCALL(152, sys_ni_syscall, 0)
+#define __NR_reserved153                       153     /* get_thread_area */
+__SYSCALL(153, sys_ni_syscall, 0)
+#define __NR_times                             154
+__SYSCALL(154, sys_times, 1)
+#define __NR_acct                              155
+__SYSCALL(155, sys_acct, 1)
+#define __NR_sched_setaffinity                         156
+__SYSCALL(156, sys_sched_setaffinity, 3)
+#define __NR_sched_getaffinity                         157
+__SYSCALL(157, sys_sched_getaffinity, 3)
+#define __NR_capget                            158
+__SYSCALL(158, sys_capget, 2)
+#define __NR_capset                            159
+__SYSCALL(159, sys_capset, 2)
+#define __NR_ptrace                            160
+__SYSCALL(160, sys_ptrace, 4)
+#define __NR_semtimedop                                161
+__SYSCALL(161, sys_semtimedop, 5)
+#define __NR_semget                            162
+__SYSCALL(162, sys_semget, 4)
+#define __NR_semop                             163
+__SYSCALL(163, sys_semop, 4)
+#define __NR_semctl                            164
+__SYSCALL(164, sys_semctl, 4)
+#define __NR_available165                      165
+__SYSCALL(165, sys_ni_syscall, 0)
+#define __NR_msgget                            166
+__SYSCALL(166, sys_msgget, 4)
+#define __NR_msgsnd                            167
+__SYSCALL(167, sys_msgsnd, 4)
+#define __NR_msgrcv                            168
+__SYSCALL(168, sys_msgrcv, 4)
+#define __NR_msgctl                            169
+__SYSCALL(169, sys_msgctl, 4)
+#define __NR_available170                      170
+__SYSCALL(170, sys_ni_syscall, 0)
+
+/* File System */
+
+#define __NR_umount2                           171
+__SYSCALL(171, sys_umount, 2)
+#define __NR_mount                             172
+__SYSCALL(172, sys_mount, 5)
+#define __NR_swapon                            173
+__SYSCALL(173, sys_swapon, 2)
+#define __NR_chroot                            174
+__SYSCALL(174, sys_chroot, 1)
+#define __NR_pivot_root                        175
+__SYSCALL(175, sys_pivot_root, 2)
+#define __NR_umount                            176
+__SYSCALL(176, sys_umount, 2)
+#define __NR_swapoff                           177
+__SYSCALL(177, sys_swapoff, 1)
+#define __NR_sync                              178
+__SYSCALL(178, sys_sync, 0)
+#define __NR_syncfs                            179
+__SYSCALL(179, sys_syncfs, 1)
+#define __NR_setfsuid                          180
+__SYSCALL(180, sys_setfsuid, 1)
+#define __NR_setfsgid                          181
+__SYSCALL(181, sys_setfsgid, 1)
+#define __NR_sysfs                             182
+__SYSCALL(182, sys_sysfs, 3)
+#define __NR_ustat                             183
+__SYSCALL(183, sys_ustat, 2)
+#define __NR_statfs                            184
+__SYSCALL(184, sys_statfs, 2)
+#define __NR_fstatfs                           185
+__SYSCALL(185, sys_fstatfs, 2)
+#define __NR_statfs64                          186
+__SYSCALL(186, sys_statfs64, 3)
+#define __NR_fstatfs64                                 187
+__SYSCALL(187, sys_fstatfs64, 3)
+
+/* System */
+
+#define __NR_setrlimit                                 188
+__SYSCALL(188, sys_setrlimit, 2)
+#define __NR_getrlimit                                 189
+__SYSCALL(189, sys_getrlimit, 2)
+#define __NR_getrusage                                 190
+__SYSCALL(190, sys_getrusage, 2)
+#define __NR_futex                             191
+__SYSCALL(191, sys_futex, 5)
+#define __NR_gettimeofday                      192
+__SYSCALL(192, sys_gettimeofday, 2)
+#define __NR_settimeofday                      193
+__SYSCALL(193, sys_settimeofday, 2)
+#define __NR_adjtimex                          194
+__SYSCALL(194, sys_adjtimex, 1)
+#define __NR_nanosleep                         195
+__SYSCALL(195, sys_nanosleep, 2)
+#define __NR_getgroups                                 196
+__SYSCALL(196, sys_getgroups, 2)
+#define __NR_setgroups                                 197
+__SYSCALL(197, sys_setgroups, 2)
+#define __NR_sethostname                       198
+__SYSCALL(198, sys_sethostname, 2)
+#define __NR_setdomainname                     199
+__SYSCALL(199, sys_setdomainname, 2)
+#define __NR_syslog                            200
+__SYSCALL(200, sys_syslog, 3)
+#define __NR_vhangup                           201
+__SYSCALL(201, sys_vhangup, 0)
+#define __NR_uselib                            202
+__SYSCALL(202, sys_uselib, 1)
+#define __NR_reboot                            203
+__SYSCALL(203, sys_reboot, 3)
+#define __NR_quotactl                          204
+__SYSCALL(204, sys_quotactl, 4)
+#define __NR_nfsservctl                        205
+__SYSCALL(205, sys_ni_syscall, 0)                      /* old nfsservctl */
+#define __NR__sysctl                           206
+__SYSCALL(206, sys_sysctl, 1)
+#define __NR_bdflush                           207
+__SYSCALL(207, sys_bdflush, 2)
+#define __NR_uname                             208
+__SYSCALL(208, sys_newuname, 1)
+#define __NR_sysinfo                           209
+__SYSCALL(209, sys_sysinfo, 1)
+#define __NR_init_module                       210
+__SYSCALL(210, sys_init_module, 2)
+#define __NR_delete_module                     211
+__SYSCALL(211, sys_delete_module, 1)
+
+#define __NR_sched_setparam                    212
+__SYSCALL(212, sys_sched_setparam, 2)
+#define __NR_sched_getparam                    213
+__SYSCALL(213, sys_sched_getparam, 2)
+#define __NR_sched_setscheduler                214
+__SYSCALL(214, sys_sched_setscheduler, 3)
+#define __NR_sched_getscheduler                215
+__SYSCALL(215, sys_sched_getscheduler, 1)
+#define __NR_sched_get_priority_max            216
+__SYSCALL(216, sys_sched_get_priority_max, 1)
+#define __NR_sched_get_priority_min            217
+__SYSCALL(217, sys_sched_get_priority_min, 1)
+#define __NR_sched_rr_get_interval             218
+__SYSCALL(218, sys_sched_rr_get_interval, 2)
+#define __NR_sched_yield                       219
+__SYSCALL(219, sys_sched_yield, 0)
+#define __NR_available222                      222
+__SYSCALL(222, sys_ni_syscall, 0)
+
+/* Signal Handling */
+
+#define __NR_restart_syscall                   223
+__SYSCALL(223, sys_restart_syscall, 0)
+#define __NR_sigaltstack                       224
+__SYSCALL(224, xtensa_sigaltstack, 2)
+#define __NR_rt_sigreturn                      225
+__SYSCALL(225, xtensa_rt_sigreturn, 1)
+#define __NR_rt_sigaction                      226
+__SYSCALL(226, sys_rt_sigaction, 4)
+#define __NR_rt_sigprocmask                    227
+__SYSCALL(227, sys_rt_sigprocmask, 4)
+#define __NR_rt_sigpending                     228
+__SYSCALL(228, sys_rt_sigpending, 2)
+#define __NR_rt_sigtimedwait                   229
+__SYSCALL(229, sys_rt_sigtimedwait, 4)
+#define __NR_rt_sigqueueinfo                   230
+__SYSCALL(230, sys_rt_sigqueueinfo, 3)
+#define __NR_rt_sigsuspend                     231
+__SYSCALL(231, sys_rt_sigsuspend, 2)
+
+/* Message */
+
+#define __NR_mq_open                           232
+__SYSCALL(232, sys_mq_open, 4)
+#define __NR_mq_unlink                                 233
+__SYSCALL(233, sys_mq_unlink, 1)
+#define __NR_mq_timedsend                      234
+__SYSCALL(234, sys_mq_timedsend, 5)
+#define __NR_mq_timedreceive                   235
+__SYSCALL(235, sys_mq_timedreceive, 5)
+#define __NR_mq_notify                                 236
+__SYSCALL(236, sys_mq_notify, 2)
+#define __NR_mq_getsetattr                     237
+__SYSCALL(237, sys_mq_getsetattr, 3)
+#define __NR_available238                      238
+__SYSCALL(238, sys_ni_syscall, 0)
+
+/* IO */
+
+#define __NR_io_setup                          239
+__SYSCALL(239, sys_io_setup, 2)
+#define __NR_io_destroy                        240
+__SYSCALL(240, sys_io_destroy, 1)
+#define __NR_io_submit                                 241
+__SYSCALL(241, sys_io_submit, 3)
+#define __NR_io_getevents                      242
+__SYSCALL(242, sys_io_getevents, 5)
+#define __NR_io_cancel                                 243
+__SYSCALL(243, sys_io_cancel, 3)
+#define __NR_clock_settime                     244
+__SYSCALL(244, sys_clock_settime, 2)
+#define __NR_clock_gettime                     245
+__SYSCALL(245, sys_clock_gettime, 2)
+#define __NR_clock_getres                      246
+__SYSCALL(246, sys_clock_getres, 2)
+#define __NR_clock_nanosleep                   247
+__SYSCALL(247, sys_clock_nanosleep, 4)
+
+/* Timer */
+
+#define __NR_timer_create                      248
+__SYSCALL(248, sys_timer_create, 3)
+#define __NR_timer_delete                      249
+__SYSCALL(249, sys_timer_delete, 1)
+#define __NR_timer_settime                     250
+__SYSCALL(250, sys_timer_settime, 4)
+#define __NR_timer_gettime                     251
+__SYSCALL(251, sys_timer_gettime, 2)
+#define __NR_timer_getoverrun                  252
+__SYSCALL(252, sys_timer_getoverrun, 1)
+
+/* System */
+
+#define __NR_reserved253                       253
+__SYSCALL(253, sys_ni_syscall, 0)
+#define __NR_lookup_dcookie                    254
+__SYSCALL(254, sys_lookup_dcookie, 4)
+#define __NR_available255                      255
+__SYSCALL(255, sys_ni_syscall, 0)
+#define __NR_add_key                           256
+__SYSCALL(256, sys_add_key, 5)
+#define __NR_request_key                       257
+__SYSCALL(257, sys_request_key, 5)
+#define __NR_keyctl                            258
+__SYSCALL(258, sys_keyctl, 5)
+#define __NR_available259                      259
+__SYSCALL(259, sys_ni_syscall, 0)
+
+
+#define __NR_readahead                         260
+__SYSCALL(260, sys_readahead, 5)
+#define __NR_remap_file_pages                  261
+__SYSCALL(261, sys_remap_file_pages, 5)
+#define __NR_migrate_pages                     262
+__SYSCALL(262, sys_migrate_pages, 0)
+#define __NR_mbind                             263
+__SYSCALL(263, sys_mbind, 6)
+#define __NR_get_mempolicy                     264
+__SYSCALL(264, sys_get_mempolicy, 5)
+#define __NR_set_mempolicy                     265
+__SYSCALL(265, sys_set_mempolicy, 3)
+#define __NR_unshare                           266
+__SYSCALL(266, sys_unshare, 1)
+#define __NR_move_pages                                267
+__SYSCALL(267, sys_move_pages, 0)
+#define __NR_splice                            268
+__SYSCALL(268, sys_splice, 0)
+#define __NR_tee                               269
+__SYSCALL(269, sys_tee, 0)
+#define __NR_vmsplice                          270
+__SYSCALL(270, sys_vmsplice, 0)
+#define __NR_available271                      271
+__SYSCALL(271, sys_ni_syscall, 0)
+
+#define __NR_pselect6                          272
+__SYSCALL(272, sys_pselect6, 0)
+#define __NR_ppoll                             273
+__SYSCALL(273, sys_ppoll, 0)
+#define __NR_epoll_pwait                       274
+__SYSCALL(274, sys_epoll_pwait, 0)
+#define __NR_epoll_create1             275
+__SYSCALL(275, sys_epoll_create1, 1)
+
+#define __NR_inotify_init                      276
+__SYSCALL(276, sys_inotify_init, 0)
+#define __NR_inotify_add_watch                 277
+__SYSCALL(277, sys_inotify_add_watch, 3)
+#define __NR_inotify_rm_watch                  278
+__SYSCALL(278, sys_inotify_rm_watch, 2)
+#define __NR_inotify_init1                     279
+__SYSCALL(279, sys_inotify_init1, 1)
+
+#define __NR_getcpu                            280
+__SYSCALL(280, sys_getcpu, 0)
+#define __NR_kexec_load                                281
+__SYSCALL(281, sys_ni_syscall, 0)
+
+#define __NR_ioprio_set                                282
+__SYSCALL(282, sys_ioprio_set, 2)
+#define __NR_ioprio_get                                283
+__SYSCALL(283, sys_ioprio_get, 3)
+
+#define __NR_set_robust_list                   284
+__SYSCALL(284, sys_set_robust_list, 3)
+#define __NR_get_robust_list                   285
+__SYSCALL(285, sys_get_robust_list, 3)
+#define __NR_available286                      286
+__SYSCALL(286, sys_ni_syscall, 0)
+#define __NR_available287                      287
+__SYSCALL(287, sys_ni_syscall, 0)
+
+/* Relative File Operations */
+
+#define __NR_openat                            288
+__SYSCALL(288, sys_openat, 4)
+#define __NR_mkdirat                           289
+__SYSCALL(289, sys_mkdirat, 3)
+#define __NR_mknodat                           290
+__SYSCALL(290, sys_mknodat, 4)
+#define __NR_unlinkat                          291
+__SYSCALL(291, sys_unlinkat, 3)
+#define __NR_renameat                          292
+__SYSCALL(292, sys_renameat, 4)
+#define __NR_linkat                            293
+__SYSCALL(293, sys_linkat, 5)
+#define __NR_symlinkat                         294
+__SYSCALL(294, sys_symlinkat, 3)
+#define __NR_readlinkat                                295
+__SYSCALL(295, sys_readlinkat, 4)
+#define __NR_utimensat                         296
+__SYSCALL(296, sys_utimensat, 0)
+#define __NR_fchownat                          297
+__SYSCALL(297, sys_fchownat, 5)
+#define __NR_futimesat                         298
+__SYSCALL(298, sys_futimesat, 4)
+#define __NR_fstatat64                         299
+__SYSCALL(299, sys_fstatat64, 0)
+#define __NR_fchmodat                          300
+__SYSCALL(300, sys_fchmodat, 4)
+#define __NR_faccessat                         301
+__SYSCALL(301, sys_faccessat, 4)
+#define __NR_available302                      302
+__SYSCALL(302, sys_ni_syscall, 0)
+#define __NR_available303                      303
+__SYSCALL(303, sys_ni_syscall, 0)
+
+#define __NR_signalfd                          304
+__SYSCALL(304, sys_signalfd, 3)
+/*  305 was __NR_timerfd  */
+__SYSCALL(305, sys_ni_syscall, 0)
+#define __NR_eventfd                           306
+__SYSCALL(306, sys_eventfd, 1)
+#define __NR_recvmmsg                          307
+__SYSCALL(307, sys_recvmmsg, 5)
+
+#define __NR_setns                             308
+__SYSCALL(308, sys_setns, 2)
+#define __NR_signalfd4                         309
+__SYSCALL(309, sys_signalfd4, 4)
+#define __NR_dup3                              310
+__SYSCALL(310, sys_dup3, 3)
+#define __NR_pipe2                             311
+__SYSCALL(311, sys_pipe2, 2)
+
+#define __NR_timerfd_create                    312
+__SYSCALL(312, sys_timerfd_create, 2)
+#define __NR_timerfd_settime                   313
+__SYSCALL(313, sys_timerfd_settime, 4)
+#define __NR_timerfd_gettime                   314
+__SYSCALL(314, sys_timerfd_gettime, 2)
+#define __NR_available315                      315
+__SYSCALL(315, sys_ni_syscall, 0)
+
+#define __NR_eventfd2                          316
+__SYSCALL(316, sys_eventfd2, 2)
+#define __NR_preadv                            317
+__SYSCALL(317, sys_preadv, 5)
+#define __NR_pwritev                           318
+__SYSCALL(318, sys_pwritev, 5)
+#define __NR_available319                      319
+__SYSCALL(319, sys_ni_syscall, 0)
+
+#define __NR_fanotify_init                     320
+__SYSCALL(320, sys_fanotify_init, 2)
+#define __NR_fanotify_mark                     321
+__SYSCALL(321, sys_fanotify_mark, 6)
+#define __NR_process_vm_readv                  322
+__SYSCALL(322, sys_process_vm_readv, 6)
+#define __NR_process_vm_writev                 323
+__SYSCALL(323, sys_process_vm_writev, 6)
+
+#define __NR_name_to_handle_at                 324
+__SYSCALL(324, sys_name_to_handle_at, 5)
+#define __NR_open_by_handle_at                 325
+__SYSCALL(325, sys_open_by_handle_at, 3)
+#define __NR_sync_file_range                   326
+__SYSCALL(326, sys_sync_file_range2, 6)
+#define __NR_perf_event_open                   327
+__SYSCALL(327, sys_perf_event_open, 5)
+
+#define __NR_rt_tgsigqueueinfo                 328
+__SYSCALL(328, sys_rt_tgsigqueueinfo, 4)
+#define __NR_clock_adjtime                     329
+__SYSCALL(329, sys_clock_adjtime, 2)
+#define __NR_prlimit64                         330
+__SYSCALL(330, sys_prlimit64, 4)
+#define __NR_kcmp                              331
+__SYSCALL(331, sys_kcmp, 5)
+
+
+#define __NR_syscall_count                     332
+
+/*
+ * sysxtensa syscall handler
+ *
+ * int sysxtensa (SYS_XTENSA_ATOMIC_SET,     ptr, val,    unused);
+ * int sysxtensa (SYS_XTENSA_ATOMIC_ADD,     ptr, val,    unused);
+ * int sysxtensa (SYS_XTENSA_ATOMIC_EXG_ADD, ptr, val,    unused);
+ * int sysxtensa (SYS_XTENSA_ATOMIC_CMP_SWP, ptr, oldval, newval);
+ *        a2            a6                   a3    a4      a5
+ */
+
+#define SYS_XTENSA_RESERVED               0     /* don't use this */
+#define SYS_XTENSA_ATOMIC_SET             1     /* set variable */
+#define SYS_XTENSA_ATOMIC_EXG_ADD         2     /* exchange memory and add */
+#define SYS_XTENSA_ATOMIC_ADD             3     /* add to memory */
+#define SYS_XTENSA_ATOMIC_CMP_SWP         4     /* compare and swap */
+
+#define SYS_XTENSA_COUNT                  5     /* count */
+
+#endif /* _UAPI_XTENSA_UNISTD_H */
index 33d6e9d2e83ca10ec0301689457727c27fb58ec7..934ae58e2c79766f46cba80ac12ed63649faae9b 100644 (file)
@@ -170,15 +170,15 @@ ENTRY(fast_unaligned)
        s32i    a7, a2, PT_AREG7
        s32i    a8, a2, PT_AREG8
 
-       rsr     a0, DEPC
-       xsr     a3, EXCSAVE_1
+       rsr     a0, depc
+       xsr     a3, excsave1
        s32i    a0, a2, PT_AREG2
        s32i    a3, a2, PT_AREG3
 
        /* Keep value of SAR in a0 */
 
-       rsr     a0, SAR
-       rsr     a8, EXCVADDR            # load unaligned memory address
+       rsr     a0, sar
+       rsr     a8, excvaddr            # load unaligned memory address
 
        /* Now, identify one of the following load/store instructions.
         *
@@ -197,7 +197,7 @@ ENTRY(fast_unaligned)
 
        /* Extract the instruction that caused the unaligned access. */
 
-       rsr     a7, EPC_1       # load exception address
+       rsr     a7, epc1        # load exception address
        movi    a3, ~3
        and     a3, a3, a7      # mask lower bits
 
@@ -275,16 +275,16 @@ ENTRY(fast_unaligned)
 1:
 
 #if XCHAL_HAVE_LOOPS
-       rsr     a5, LEND                # check if we reached LEND
+       rsr     a5, lend                # check if we reached LEND
        bne     a7, a5, 1f
-       rsr     a5, LCOUNT              # and LCOUNT != 0
+       rsr     a5, lcount              # and LCOUNT != 0
        beqz    a5, 1f
        addi    a5, a5, -1              # decrement LCOUNT and set
-       rsr     a7, LBEG                # set PC to LBEGIN
-       wsr     a5, LCOUNT
+       rsr     a7, lbeg                # set PC to LBEGIN
+       wsr     a5, lcount
 #endif
 
-1:     wsr     a7, EPC_1               # skip load instruction
+1:     wsr     a7, epc1                # skip load instruction
        extui   a4, a4, INSN_T, 4       # extract target register
        movi    a5, .Lload_table
        addx8   a4, a4, a5
@@ -355,16 +355,16 @@ ENTRY(fast_unaligned)
 
 1:
 #if XCHAL_HAVE_LOOPS
-       rsr     a4, LEND                # check if we reached LEND
+       rsr     a4, lend                # check if we reached LEND
        bne     a7, a4, 1f
-       rsr     a4, LCOUNT              # and LCOUNT != 0
+       rsr     a4, lcount              # and LCOUNT != 0
        beqz    a4, 1f
        addi    a4, a4, -1              # decrement LCOUNT and set
-       rsr     a7, LBEG                # set PC to LBEGIN
-       wsr     a4, LCOUNT
+       rsr     a7, lbeg                # set PC to LBEGIN
+       wsr     a4, lcount
 #endif
 
-1:     wsr     a7, EPC_1               # skip store instruction
+1:     wsr     a7, epc1                # skip store instruction
        movi    a4, ~3
        and     a4, a4, a8              # align memory address
 
@@ -406,7 +406,7 @@ ENTRY(fast_unaligned)
 
 .Lexit:
        movi    a4, 0
-       rsr     a3, EXCSAVE_1
+       rsr     a3, excsave1
        s32i    a4, a3, EXC_TABLE_FIXUP
 
        /* Restore working register */
@@ -420,7 +420,7 @@ ENTRY(fast_unaligned)
 
        /* restore SAR and return */
 
-       wsr     a0, SAR
+       wsr     a0, sar
        l32i    a0, a2, PT_AREG0
        l32i    a2, a2, PT_AREG2
        rfe
@@ -438,10 +438,10 @@ ENTRY(fast_unaligned)
        l32i    a6, a2, PT_AREG6
        l32i    a5, a2, PT_AREG5
        l32i    a4, a2, PT_AREG4
-       wsr     a0, SAR
+       wsr     a0, sar
        mov     a1, a2
 
-       rsr     a0, PS
+       rsr     a0, ps
         bbsi.l  a2, PS_UM_BIT, 1f     # jump if user mode
 
        movi    a0, _kernel_exception
index 2bc1e145c0a46d66512826db3bcf41aa65d92491..54c3be313bfa8141e79f84606f8f3d6093d6946f 100644 (file)
@@ -43,7 +43,7 @@
 /* IO protection is currently unsupported. */
 
 ENTRY(fast_io_protect)
-       wsr     a0, EXCSAVE_1
+       wsr     a0, excsave1
        movi    a0, unrecoverable_exception
        callx0  a0
 
@@ -220,7 +220,7 @@ ENTRY(coprocessor_restore)
  */
 
 ENTRY(fast_coprocessor_double)
-       wsr     a0, EXCSAVE_1
+       wsr     a0, excsave1
        movi    a0, unrecoverable_exception
        callx0  a0
 
@@ -229,13 +229,13 @@ ENTRY(fast_coprocessor)
 
        /* Save remaining registers a1-a3 and SAR */
 
-       xsr     a3, EXCSAVE_1
+       xsr     a3, excsave1
        s32i    a3, a2, PT_AREG3
-       rsr     a3, SAR
+       rsr     a3, sar
        s32i    a1, a2, PT_AREG1
        s32i    a3, a2, PT_SAR
        mov     a1, a2
-       rsr     a2, DEPC
+       rsr     a2, depc
        s32i    a2, a1, PT_AREG2
 
        /*
@@ -248,17 +248,17 @@ ENTRY(fast_coprocessor)
 
        /* Find coprocessor number. Subtract first CP EXCCAUSE from EXCCAUSE */
 
-       rsr     a3, EXCCAUSE
+       rsr     a3, exccause
        addi    a3, a3, -EXCCAUSE_COPROCESSOR0_DISABLED
 
        /* Set corresponding CPENABLE bit -> (sar:cp-index, a3: 1<<cp-index)*/
 
        ssl     a3                      # SAR: 32 - coprocessor_number
        movi    a2, 1
-       rsr     a0, CPENABLE
+       rsr     a0, cpenable
        sll     a2, a2
        or      a0, a0, a2
-       wsr     a0, CPENABLE
+       wsr     a0, cpenable
        rsync
 
        /* Retrieve previous owner. (a3 still holds CP number) */
@@ -291,7 +291,7 @@ ENTRY(fast_coprocessor)
 
        /* Note that only a0 and a1 were preserved. */
 
-2:     rsr     a3, EXCCAUSE
+2:     rsr     a3, exccause
        addi    a3, a3, -EXCCAUSE_COPROCESSOR0_DISABLED
        movi    a0, coprocessor_owner
        addx4   a0, a3, a0
@@ -321,7 +321,7 @@ ENTRY(fast_coprocessor)
        l32i    a0, a1, PT_SAR
        l32i    a3, a1, PT_AREG3
        l32i    a2, a1, PT_AREG2
-       wsr     a0, SAR
+       wsr     a0, sar
        l32i    a0, a1, PT_AREG0
        l32i    a1, a1, PT_AREG1
 
index 7e62360733971886161bfc80bd318a41cc21feb4..18453067c2582034e896adee07c0d474912a98d2 100644 (file)
@@ -112,8 +112,8 @@ ENTRY(user_exception)
 
        /* Save a2, a3, and depc, restore excsave_1 and set SP. */
 
-       xsr     a3, EXCSAVE_1
-       rsr     a0, DEPC
+       xsr     a3, excsave1
+       rsr     a0, depc
        s32i    a1, a2, PT_AREG1
        s32i    a0, a2, PT_AREG2
        s32i    a3, a2, PT_AREG3
@@ -125,16 +125,16 @@ _user_exception:
        /* Save SAR and turn off single stepping */
 
        movi    a2, 0
-       rsr     a3, SAR
-       xsr     a2, ICOUNTLEVEL
+       rsr     a3, sar
+       xsr     a2, icountlevel
        s32i    a3, a1, PT_SAR
        s32i    a2, a1, PT_ICOUNTLEVEL
 
        /* Rotate ws so that the current windowbase is at bit0. */
        /* Assume ws = xxwww1yyyy. Rotate ws right, so that a2 = yyyyxxwww1 */
 
-       rsr     a2, WINDOWBASE
-       rsr     a3, WINDOWSTART
+       rsr     a2, windowbase
+       rsr     a3, windowstart
        ssr     a2
        s32i    a2, a1, PT_WINDOWBASE
        s32i    a3, a1, PT_WINDOWSTART
@@ -205,12 +205,12 @@ _user_exception:
 
        /* WINDOWBASE still in SAR! */
 
-       rsr     a2, SAR                 # original WINDOWBASE
+       rsr     a2, sar                 # original WINDOWBASE
        movi    a3, 1
        ssl     a2
        sll     a3, a3
-       wsr     a3, WINDOWSTART         # set corresponding WINDOWSTART bit
-       wsr     a2, WINDOWBASE          # and WINDOWSTART
+       wsr     a3, windowstart         # set corresponding WINDOWSTART bit
+       wsr     a2, windowbase          # and WINDOWSTART
        rsync
 
        /* We are back to the original stack pointer (a1) */
@@ -252,8 +252,8 @@ ENTRY(kernel_exception)
 
        /* Save a0, a2, a3, DEPC and set SP. */
 
-       xsr     a3, EXCSAVE_1           # restore a3, excsave_1
-       rsr     a0, DEPC                # get a2
+       xsr     a3, excsave1            # restore a3, excsave_1
+       rsr     a0, depc                # get a2
        s32i    a1, a2, PT_AREG1
        s32i    a0, a2, PT_AREG2
        s32i    a3, a2, PT_AREG3
@@ -265,16 +265,16 @@ _kernel_exception:
        /* Save SAR and turn off single stepping */
 
        movi    a2, 0
-       rsr     a3, SAR
-       xsr     a2, ICOUNTLEVEL
+       rsr     a3, sar
+       xsr     a2, icountlevel
        s32i    a3, a1, PT_SAR
        s32i    a2, a1, PT_ICOUNTLEVEL
 
        /* Rotate ws so that the current windowbase is at bit0. */
        /* Assume ws = xxwww1yyyy. Rotate ws right, so that a2 = yyyyxxwww1 */
 
-       rsr     a2, WINDOWBASE          # don't need to save these, we only
-       rsr     a3, WINDOWSTART         # need shifted windowstart: windowmask
+       rsr     a2, windowbase          # don't need to save these, we only
+       rsr     a3, windowstart         # need shifted windowstart: windowmask
        ssr     a2
        slli    a2, a3, 32-WSBITS
        src     a2, a3, a2
@@ -323,24 +323,24 @@ common_exception:
 
        /* Save some registers, disable loops and clear the syscall flag. */
 
-       rsr     a2, DEBUGCAUSE
-       rsr     a3, EPC_1
+       rsr     a2, debugcause
+       rsr     a3, epc1
        s32i    a2, a1, PT_DEBUGCAUSE
        s32i    a3, a1, PT_PC
 
        movi    a2, -1
-       rsr     a3, EXCVADDR
+       rsr     a3, excvaddr
        s32i    a2, a1, PT_SYSCALL
        movi    a2, 0
        s32i    a3, a1, PT_EXCVADDR
-       xsr     a2, LCOUNT
+       xsr     a2, lcount
        s32i    a2, a1, PT_LCOUNT
 
        /* It is now save to restore the EXC_TABLE_FIXUP variable. */
 
-       rsr     a0, EXCCAUSE
+       rsr     a0, exccause
        movi    a3, 0
-       rsr     a2, EXCSAVE_1
+       rsr     a2, excsave1
        s32i    a0, a1, PT_EXCCAUSE
        s32i    a3, a2, EXC_TABLE_FIXUP
 
@@ -352,22 +352,22 @@ common_exception:
         *     (interrupts disabled) and if this exception is not an interrupt.
         */
 
-       rsr     a3, PS
+       rsr     a3, ps
        addi    a0, a0, -4
        movi    a2, 1
        extui   a3, a3, 0, 1            # a3 = PS.INTLEVEL[0]
        moveqz  a3, a2, a0              # a3 = 1 iff interrupt exception
        movi    a2, 1 << PS_WOE_BIT
        or      a3, a3, a2
-       rsr     a0, EXCCAUSE
-       xsr     a3, PS
+       rsr     a0, exccause
+       xsr     a3, ps
 
        s32i    a3, a1, PT_PS           # save ps
 
-       /* Save LBEG, LEND */
+       /* Save lbeg, lend */
 
-       rsr     a2, LBEG
-       rsr     a3, LEND
+       rsr     a2, lbeg
+       rsr     a3, lend
        s32i    a2, a1, PT_LBEG
        s32i    a3, a1, PT_LEND
 
@@ -432,7 +432,7 @@ common_exception_return:
 
        load_xtregs_opt a1 a2 a4 a5 a6 a7 PT_XTREGS_OPT
 
-       wsr     a3, PS          /* disable interrupts */
+       wsr     a3, ps          /* disable interrupts */
 
        _bbci.l a3, PS_UM_BIT, kernel_exception_exit
 
@@ -444,12 +444,12 @@ user_exception_exit:
 
        l32i    a2, a1, PT_WINDOWBASE
        l32i    a3, a1, PT_WINDOWSTART
-       wsr     a1, DEPC                # use DEPC as temp storage
-       wsr     a3, WINDOWSTART         # restore WINDOWSTART
+       wsr     a1, depc                # use DEPC as temp storage
+       wsr     a3, windowstart         # restore WINDOWSTART
        ssr     a2                      # preserve user's WB in the SAR
-       wsr     a2, WINDOWBASE          # switch to user's saved WB
+       wsr     a2, windowbase          # switch to user's saved WB
        rsync
-       rsr     a1, DEPC                # restore stack pointer
+       rsr     a1, depc                # restore stack pointer
        l32i    a2, a1, PT_WMASK        # register frames saved (in bits 4...9)
        rotw    -1                      # we restore a4..a7
        _bltui  a6, 16, 1f              # only have to restore current window?
@@ -475,8 +475,8 @@ user_exception_exit:
 
        /* Clear unrestored registers (don't leak anything to user-land */
 
-1:     rsr     a0, WINDOWBASE
-       rsr     a3, SAR
+1:     rsr     a0, windowbase
+       rsr     a3, sar
        sub     a3, a0, a3
        beqz    a3, 2f
        extui   a3, a3, 0, WBBITS
@@ -556,7 +556,7 @@ kernel_exception_exit:
 
        /* Test WINDOWSTART now. If spilled, do the movsp */
 
-       rsr     a3, WINDOWSTART
+       rsr     a3, windowstart
        addi    a0, a3, -1
        and     a3, a3, a0
        _bnez   a3, common_exception_exit
@@ -604,24 +604,24 @@ common_exception_exit:
 
 1:     l32i    a2, a1, PT_PC
        l32i    a3, a1, PT_SAR
-       wsr     a2, EPC_1
-       wsr     a3, SAR
+       wsr     a2, epc1
+       wsr     a3, sar
 
        /* Restore LBEG, LEND, LCOUNT */
 
        l32i    a2, a1, PT_LBEG
        l32i    a3, a1, PT_LEND
-       wsr     a2, LBEG
+       wsr     a2, lbeg
        l32i    a2, a1, PT_LCOUNT
-       wsr     a3, LEND
-       wsr     a2, LCOUNT
+       wsr     a3, lend
+       wsr     a2, lcount
 
        /* We control single stepping through the ICOUNTLEVEL register. */
 
        l32i    a2, a1, PT_ICOUNTLEVEL
        movi    a3, -2
-       wsr     a2, ICOUNTLEVEL
-       wsr     a3, ICOUNT
+       wsr     a2, icountlevel
+       wsr     a3, icount
 
        /* Check if it was double exception. */
 
@@ -636,7 +636,7 @@ common_exception_exit:
        l32i    a1, a1, PT_AREG1
        rfe
 
-1:     wsr     a0, DEPC
+1:     wsr     a0, depc
        l32i    a0, a1, PT_AREG0
        l32i    a1, a1, PT_AREG1
        rfde
@@ -651,25 +651,25 @@ common_exception_exit:
 
 ENTRY(debug_exception)
 
-       rsr     a0, EPS + XCHAL_DEBUGLEVEL
+       rsr     a0, SREG_EPS + XCHAL_DEBUGLEVEL
        bbsi.l  a0, PS_EXCM_BIT, 1f     # exception mode
 
-       /* Set EPC_1 and EXCCAUSE */
+       /* Set EPC1 and EXCCAUSE */
 
-       wsr     a2, DEPC                # save a2 temporarily
-       rsr     a2, EPC + XCHAL_DEBUGLEVEL
-       wsr     a2, EPC_1
+       wsr     a2, depc                # save a2 temporarily
+       rsr     a2, SREG_EPC + XCHAL_DEBUGLEVEL
+       wsr     a2, epc1
 
        movi    a2, EXCCAUSE_MAPPED_DEBUG
-       wsr     a2, EXCCAUSE
+       wsr     a2, exccause
 
        /* Restore PS to the value before the debug exc but with PS.EXCM set.*/
 
        movi    a2, 1 << PS_EXCM_BIT
        or      a2, a0, a2
        movi    a0, debug_exception     # restore a3, debug jump vector
-       wsr     a2, PS
-       xsr     a0, EXCSAVE + XCHAL_DEBUGLEVEL
+       wsr     a2, ps
+       xsr     a0, SREG_EXCSAVE + XCHAL_DEBUGLEVEL
 
        /* Switch to kernel/user stack, restore jump vector, and save a0 */
 
@@ -680,19 +680,19 @@ ENTRY(debug_exception)
        movi    a0, 0
        s32i    a1, a2, PT_AREG1
        s32i    a0, a2, PT_DEPC         # mark it as a regular exception
-       xsr     a0, DEPC
+       xsr     a0, depc
        s32i    a3, a2, PT_AREG3
        s32i    a0, a2, PT_AREG2
        mov     a1, a2
        j       _kernel_exception
 
-2:     rsr     a2, EXCSAVE_1
+2:     rsr     a2, excsave1
        l32i    a2, a2, EXC_TABLE_KSTK  # load kernel stack pointer
        s32i    a0, a2, PT_AREG0
        movi    a0, 0
        s32i    a1, a2, PT_AREG1
        s32i    a0, a2, PT_DEPC
-       xsr     a0, DEPC
+       xsr     a0, depc
        s32i    a3, a2, PT_AREG3
        s32i    a0, a2, PT_AREG2
        mov     a1, a2
@@ -732,12 +732,12 @@ ENTRY(unrecoverable_exception)
        movi    a0, 1
        movi    a1, 0
 
-       wsr     a0, WINDOWSTART
-       wsr     a1, WINDOWBASE
+       wsr     a0, windowstart
+       wsr     a1, windowbase
        rsync
 
        movi    a1, (1 << PS_WOE_BIT) | 1
-       wsr     a1, PS
+       wsr     a1, ps
        rsync
 
        movi    a1, init_task
@@ -793,7 +793,7 @@ ENTRY(fast_alloca)
        l32i    a0, a2, PT_DEPC
        _bgeui  a0, VALID_DOUBLE_EXCEPTION_ADDRESS, .Lunhandled_double
 
-       rsr     a0, DEPC                # get a2
+       rsr     a0, depc                # get a2
        s32i    a4, a2, PT_AREG4        # save a4 and
        s32i    a0, a2, PT_AREG2        # a2 to stack
 
@@ -804,8 +804,8 @@ ENTRY(fast_alloca)
 
        /* Restore a3, excsave_1 */
 
-       xsr     a3, EXCSAVE_1           # make sure excsave_1 is valid for dbl.
-       rsr     a4, EPC_1               # get exception address
+       xsr     a3, excsave1            # make sure excsave_1 is valid for dbl.
+       rsr     a4, epc1                # get exception address
        s32i    a3, a2, PT_AREG3        # save a3 to stack
 
 #ifdef ALLOCA_EXCEPTION_IN_IRAM
@@ -820,7 +820,7 @@ ENTRY(fast_alloca)
        jx      a3
 
 .Lunhandled_double:
-       wsr     a0, EXCSAVE_1
+       wsr     a0, excsave1
        movi    a0, unrecoverable_exception
        callx0  a0
 
@@ -852,7 +852,7 @@ ENTRY(fast_alloca)
 #endif
        addi    a4, a4, 3               # step over movsp
        _EXTUI_MOVSP_DST(a0)            # extract destination register
-       wsr     a4, EPC_1               # save new epc_1
+       wsr     a4, epc1                # save new epc_1
 
        _bnei   a0, 1, 1f               # no 'movsp a1, ax': jump
 
@@ -953,14 +953,14 @@ ENTRY(fast_syscall_kernel)
 
        /* Skip syscall. */
 
-       rsr     a0, EPC_1
+       rsr     a0, epc1
        addi    a0, a0, 3
-       wsr     a0, EPC_1
+       wsr     a0, epc1
 
        l32i    a0, a2, PT_DEPC
        bgeui   a0, VALID_DOUBLE_EXCEPTION_ADDRESS, fast_syscall_unrecoverable
 
-       rsr     a0, DEPC                        # get syscall-nr
+       rsr     a0, depc                        # get syscall-nr
        _beqz   a0, fast_syscall_spill_registers
        _beqi   a0, __NR_xtensa, fast_syscall_xtensa
 
@@ -970,14 +970,14 @@ ENTRY(fast_syscall_user)
 
        /* Skip syscall. */
 
-       rsr     a0, EPC_1
+       rsr     a0, epc1
        addi    a0, a0, 3
-       wsr     a0, EPC_1
+       wsr     a0, epc1
 
        l32i    a0, a2, PT_DEPC
        bgeui   a0, VALID_DOUBLE_EXCEPTION_ADDRESS, fast_syscall_unrecoverable
 
-       rsr     a0, DEPC                        # get syscall-nr
+       rsr     a0, depc                        # get syscall-nr
        _beqz   a0, fast_syscall_spill_registers
        _beqi   a0, __NR_xtensa, fast_syscall_xtensa
 
@@ -988,10 +988,10 @@ ENTRY(fast_syscall_unrecoverable)
         /* Restore all states. */
 
         l32i    a0, a2, PT_AREG0        # restore a0
-        xsr     a2, DEPC                # restore a2, depc
-        rsr     a3, EXCSAVE_1
+        xsr     a2, depc                # restore a2, depc
+        rsr     a3, excsave1
 
-        wsr     a0, EXCSAVE_1
+        wsr     a0, excsave1
         movi    a0, unrecoverable_exception
         callx0  a0
 
@@ -1047,7 +1047,7 @@ ENTRY(fast_syscall_unrecoverable)
 
 ENTRY(fast_syscall_xtensa)
 
-       xsr     a3, EXCSAVE_1           # restore a3, excsave1
+       xsr     a3, excsave1            # restore a3, excsave1
 
        s32i    a7, a2, PT_AREG7        # we need an additional register
        movi    a7, 4                   # sizeof(unsigned int)
@@ -1124,13 +1124,13 @@ ENTRY(fast_syscall_spill_registers)
 
        movi    a0, fast_syscall_spill_registers_fixup
        s32i    a0, a3, EXC_TABLE_FIXUP
-       rsr     a0, WINDOWBASE
+       rsr     a0, windowbase
        s32i    a0, a3, EXC_TABLE_PARAM
 
        /* Save a3 and SAR on stack. */
 
-       rsr     a0, SAR
-       xsr     a3, EXCSAVE_1           # restore a3 and excsave_1
+       rsr     a0, sar
+       xsr     a3, excsave1            # restore a3 and excsave_1
        s32i    a3, a2, PT_AREG3
        s32i    a4, a2, PT_AREG4
        s32i    a0, a2, PT_AREG5        # store SAR to PT_AREG5
@@ -1148,7 +1148,7 @@ ENTRY(fast_syscall_spill_registers)
        l32i    a3, a2, PT_AREG5
        l32i    a4, a2, PT_AREG4
        l32i    a0, a2, PT_AREG0
-       wsr     a3, SAR
+       wsr     a3, sar
        l32i    a3, a2, PT_AREG3
 
        /* Restore clobbered registers. */
@@ -1173,8 +1173,8 @@ ENTRY(fast_syscall_spill_registers)
 
 fast_syscall_spill_registers_fixup:
 
-       rsr     a2, WINDOWBASE  # get current windowbase (a2 is saved)
-       xsr     a0, DEPC        # restore depc and a0
+       rsr     a2, windowbase  # get current windowbase (a2 is saved)
+       xsr     a0, depc        # restore depc and a0
        ssl     a2              # set shift (32 - WB)
 
        /* We need to make sure the current registers (a0-a3) are preserved.
@@ -1182,12 +1182,12 @@ fast_syscall_spill_registers_fixup:
         * in WS, so that the exception handlers save them to the task stack.
         */
 
-       rsr     a3, EXCSAVE_1   # get spill-mask
+       rsr     a3, excsave1    # get spill-mask
        slli    a2, a3, 1       # shift left by one
 
        slli    a3, a2, 32-WSBITS
        src     a2, a2, a3      # a1 = xxwww1yyxxxwww1yy......
-       wsr     a2, WINDOWSTART # set corrected windowstart
+       wsr     a2, windowstart # set corrected windowstart
 
        movi    a3, exc_table
        l32i    a2, a3, EXC_TABLE_DOUBLE_SAVE   # restore a2
@@ -1201,7 +1201,7 @@ fast_syscall_spill_registers_fixup:
         * excsave_1:   a3
         */
 
-       wsr     a3, WINDOWBASE
+       wsr     a3, windowbase
        rsync
 
        /* We are now in the original frame when we entered _spill_registers:
@@ -1227,7 +1227,7 @@ fast_syscall_spill_registers_fixup:
        /* Jump to the exception handler. */
 
        movi    a3, exc_table
-       rsr     a0, EXCCAUSE
+       rsr     a0, exccause
         addx4  a0, a0, a3                      # find entry in table
         l32i   a0, a0, EXC_TABLE_FAST_USER     # load handler
         jx     a0
@@ -1236,28 +1236,28 @@ fast_syscall_spill_registers_fixup_return:
 
        /* When we return here, all registers have been restored (a2: DEPC) */
 
-       wsr     a2, DEPC                # exception address
+       wsr     a2, depc                # exception address
 
        /* Restore fixup handler. */
 
-       xsr     a3, EXCSAVE_1
+       xsr     a3, excsave1
        movi    a2, fast_syscall_spill_registers_fixup
        s32i    a2, a3, EXC_TABLE_FIXUP
-       rsr     a2, WINDOWBASE
+       rsr     a2, windowbase
        s32i    a2, a3, EXC_TABLE_PARAM
        l32i    a2, a3, EXC_TABLE_KSTK
 
        /* Load WB at the time the exception occurred. */
 
-       rsr     a3, SAR                 # WB is still in SAR
+       rsr     a3, sar                 # WB is still in SAR
        neg     a3, a3
-       wsr     a3, WINDOWBASE
+       wsr     a3, windowbase
        rsync
 
        /* Restore a3 and return. */
 
        movi    a3, exc_table
-       xsr     a3, EXCSAVE_1
+       xsr     a3, excsave1
 
        rfde
 
@@ -1283,8 +1283,8 @@ ENTRY(_spill_registers)
         * Rotate ws right so that a4 = yyxxxwww1.
         */
 
-       rsr     a4, WINDOWBASE
-       rsr     a3, WINDOWSTART         # a3 = xxxwww1yy
+       rsr     a4, windowbase
+       rsr     a3, windowstart         # a3 = xxxwww1yy
        ssr     a4                      # holds WB
        slli    a4, a3, WSBITS
        or      a3, a3, a4              # a3 = xxxwww1yyxxxwww1yy
@@ -1302,7 +1302,7 @@ ENTRY(_spill_registers)
 
        /* Skip empty frames - get 'oldest' WINDOWSTART-bit. */
 
-       wsr     a3, WINDOWSTART         # save shifted windowstart
+       wsr     a3, windowstart         # save shifted windowstart
        neg     a4, a3
        and     a3, a4, a3              # first bit set from right: 000010000
 
@@ -1311,12 +1311,12 @@ ENTRY(_spill_registers)
        sub     a4, a3, a4              # WSBITS-a4:number of 0-bits from right
        ssr     a4                      # save in SAR for later.
 
-       rsr     a3, WINDOWBASE
+       rsr     a3, windowbase
        add     a3, a3, a4
-       wsr     a3, WINDOWBASE
+       wsr     a3, windowbase
        rsync
 
-       rsr     a3, WINDOWSTART
+       rsr     a3, windowstart
        srl     a3, a3                  # shift windowstart
 
        /* WB is now just one frame below the oldest frame in the register
@@ -1364,11 +1364,11 @@ ENTRY(_spill_registers)
 .Lexit: /* Done. Do the final rotation, set WS, and return. */
 
        rotw    1
-       rsr     a3, WINDOWBASE
+       rsr     a3, windowbase
        ssl     a3
        movi    a3, 1
        sll     a3, a3
-       wsr     a3, WINDOWSTART
+       wsr     a3, windowstart
        ret
 
 .Lc4:  s32e    a4, a9, -16
@@ -1429,7 +1429,7 @@ ENTRY(_spill_registers)
         * however, this condition is unrecoverable in kernel space.
         */
 
-       rsr     a0, PS
+       rsr     a0, ps
        _bbci.l a0, PS_UM_BIT, 1f
 
        /* User space: Setup a dummy frame and kill application.
@@ -1439,18 +1439,18 @@ ENTRY(_spill_registers)
        movi    a0, 1
        movi    a1, 0
 
-       wsr     a0, WINDOWSTART
-       wsr     a1, WINDOWBASE
+       wsr     a0, windowstart
+       wsr     a1, windowbase
        rsync
 
        movi    a0, 0
 
        movi    a3, exc_table
        l32i    a1, a3, EXC_TABLE_KSTK
-       wsr     a3, EXCSAVE_1
+       wsr     a3, excsave1
 
        movi    a4, (1 << PS_WOE_BIT) | 1
-       wsr     a4, PS
+       wsr     a4, ps
        rsync
 
        movi    a6, SIGSEGV
@@ -1459,7 +1459,7 @@ ENTRY(_spill_registers)
 
 1:     /* Kernel space: PANIC! */
 
-       wsr     a0, EXCSAVE_1
+       wsr     a0, excsave1
        movi    a0, unrecoverable_exception
        callx0  a0              # should not return
 1:     j       1b
@@ -1524,7 +1524,7 @@ ENTRY(fast_second_level_miss)
 
        /* We deliberately destroy a3 that holds the exception table. */
 
-8:     rsr     a3, EXCVADDR            # fault address
+8:     rsr     a3, excvaddr            # fault address
        _PGD_OFFSET(a0, a3, a1)
        l32i    a0, a0, 0               # read pmdval
        beqz    a0, 2f
@@ -1542,7 +1542,7 @@ ENTRY(fast_second_level_miss)
         * pteval = ((pmdval - PAGE_OFFSET) & PAGE_MASK) | PAGE_DIRECTORY
         */
 
-       movi    a1, -PAGE_OFFSET
+       movi    a1, (-PAGE_OFFSET) & 0xffffffff
        add     a0, a0, a1              # pmdval - PAGE_OFFSET
        extui   a1, a0, 0, PAGE_SHIFT   # ... & PAGE_MASK
        xor     a0, a0, a1
@@ -1561,7 +1561,7 @@ ENTRY(fast_second_level_miss)
         */
 
        extui   a3, a3, 28, 2           # addr. bit 28 and 29   0,1,2,3
-       rsr     a1, PTEVADDR
+       rsr     a1, ptevaddr
        addx2   a3, a3, a3              # ->                    0,3,6,9
        srli    a1, a1, PAGE_SHIFT
        extui   a3, a3, 2, 2            # ->                    0,0,1,2
@@ -1583,18 +1583,18 @@ ENTRY(fast_second_level_miss)
        l32i    a0, a2, PT_AREG0
        l32i    a1, a2, PT_AREG1
        l32i    a2, a2, PT_DEPC
-       xsr     a3, EXCSAVE_1
+       xsr     a3, excsave1
 
        bgeui   a2, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f
 
        /* Restore excsave1 and return. */
 
-       rsr     a2, DEPC
+       rsr     a2, depc
        rfe
 
        /* Return from double exception. */
 
-1:     xsr     a2, DEPC
+1:     xsr     a2, depc
        esync
        rfde
 
@@ -1618,7 +1618,7 @@ ENTRY(fast_second_level_miss)
        /* Make sure the exception originated in the special functions */
 
        movi    a0, __tlbtemp_mapping_start
-       rsr     a3, EPC_1
+       rsr     a3, epc1
        bltu    a3, a0, 2f
        movi    a0, __tlbtemp_mapping_end
        bgeu    a3, a0, 2f
@@ -1626,7 +1626,7 @@ ENTRY(fast_second_level_miss)
        /* Check if excvaddr was in one of the TLBTEMP_BASE areas. */
 
        movi    a3, TLBTEMP_BASE_1
-       rsr     a0, EXCVADDR
+       rsr     a0, excvaddr
        bltu    a0, a3, 2f
 
        addi    a1, a0, -(2 << (DCACHE_ALIAS_ORDER + PAGE_SHIFT))
@@ -1635,7 +1635,7 @@ ENTRY(fast_second_level_miss)
        /* Check if we have to restore an ITLB mapping. */
 
        movi    a1, __tlbtemp_mapping_itlb
-       rsr     a3, EPC_1
+       rsr     a3, epc1
        sub     a3, a3, a1
 
        /* Calculate VPN */
@@ -1671,13 +1671,13 @@ ENTRY(fast_second_level_miss)
 2:     /* Invalid PGD, default exception handling */
 
        movi    a3, exc_table
-       rsr     a1, DEPC
-       xsr     a3, EXCSAVE_1
+       rsr     a1, depc
+       xsr     a3, excsave1
        s32i    a1, a2, PT_AREG2
        s32i    a3, a2, PT_AREG3
        mov     a1, a2
 
-       rsr     a2, PS
+       rsr     a2, ps
        bbsi.l  a2, PS_UM_BIT, 1f
        j       _kernel_exception
 1:     j       _user_exception
@@ -1712,7 +1712,7 @@ ENTRY(fast_store_prohibited)
        l32i    a0, a1, TASK_MM         # tsk->mm
        beqz    a0, 9f
 
-8:     rsr     a1, EXCVADDR            # fault address
+8:     rsr     a1, excvaddr            # fault address
        _PGD_OFFSET(a0, a1, a4)
        l32i    a0, a0, 0
        beqz    a0, 2f
@@ -1725,7 +1725,7 @@ ENTRY(fast_store_prohibited)
 
        movi    a1, _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_HW_WRITE
        or      a4, a4, a1
-       rsr     a1, EXCVADDR
+       rsr     a1, excvaddr
        s32i    a4, a0, 0
 
        /* We need to flush the cache if we have page coloring. */
@@ -1749,15 +1749,15 @@ ENTRY(fast_store_prohibited)
 
        /* Restore excsave1 and a3. */
 
-       xsr     a3, EXCSAVE_1
+       xsr     a3, excsave1
        bgeui   a2, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f
 
-       rsr     a2, DEPC
+       rsr     a2, depc
        rfe
 
        /* Double exception. Restore FIXUP handler and return. */
 
-1:     xsr     a2, DEPC
+1:     xsr     a2, depc
        esync
        rfde
 
@@ -1766,14 +1766,14 @@ ENTRY(fast_store_prohibited)
 
 2:     /* If there was a problem, handle fault in C */
 
-       rsr     a4, DEPC        # still holds a2
-       xsr     a3, EXCSAVE_1
+       rsr     a4, depc        # still holds a2
+       xsr     a3, excsave1
        s32i    a4, a2, PT_AREG2
        s32i    a3, a2, PT_AREG3
        l32i    a4, a2, PT_AREG4
        mov     a1, a2
 
-       rsr     a2, PS
+       rsr     a2, ps
        bbsi.l  a2, PS_UM_BIT, 1f
        j       _kernel_exception
 1:     j       _user_exception
@@ -1901,8 +1901,8 @@ ENTRY(_switch_to)
        /* Disable ints while we manipulate the stack pointer. */
 
        movi    a14, (1 << PS_EXCM_BIT) | LOCKLEVEL
-       xsr     a14, PS
-       rsr     a3, EXCSAVE_1
+       xsr     a14, ps
+       rsr     a3, excsave1
        rsync
        s32i    a3, a3, EXC_TABLE_FIXUP /* enter critical section */
 
@@ -1910,7 +1910,7 @@ ENTRY(_switch_to)
 
 #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS)
        l32i    a3, a5, THREAD_CPENABLE
-       xsr     a3, CPENABLE
+       xsr     a3, cpenable
        s32i    a3, a4, THREAD_CPENABLE
 #endif
 
@@ -1924,7 +1924,7 @@ ENTRY(_switch_to)
         *       we return from kernel space.
         */
 
-       rsr     a3, EXCSAVE_1           # exc_table
+       rsr     a3, excsave1            # exc_table
        movi    a6, 0
        addi    a7, a5, PT_REGS_OFFSET
        s32i    a6, a3, EXC_TABLE_FIXUP
@@ -1937,7 +1937,7 @@ ENTRY(_switch_to)
 
        load_xtregs_user a5 a6 a8 a9 a10 a11 THREAD_XTREGS_USER
 
-       wsr     a14, PS
+       wsr     a14, ps
        mov     a2, a12                 # return 'prev'
        rsync
 
index 3ef91a73652d31bb943c4ca00949d05e270a8390..bdc50788f35e13e9e4d89b54e65af887f1a26610 100644 (file)
@@ -61,18 +61,18 @@ _startup:
        /* Disable interrupts and exceptions. */
 
        movi    a0, LOCKLEVEL
-       wsr     a0, PS
+       wsr     a0, ps
 
        /* Preserve the pointer to the boot parameter list in EXCSAVE_1 */
 
-       wsr     a2, EXCSAVE_1
+       wsr     a2, excsave1
 
        /* Start with a fresh windowbase and windowstart.  */
 
        movi    a1, 1
        movi    a0, 0
-       wsr     a1, WINDOWSTART
-       wsr     a0, WINDOWBASE
+       wsr     a1, windowstart
+       wsr     a0, windowbase
        rsync
 
        /* Set a0 to 0 for the remaining initialization. */
@@ -82,46 +82,46 @@ _startup:
        /* Clear debugging registers. */
 
 #if XCHAL_HAVE_DEBUG
-       wsr     a0, IBREAKENABLE
-       wsr     a0, ICOUNT
+       wsr     a0, ibreakenable
+       wsr     a0, icount
        movi    a1, 15
-       wsr     a0, ICOUNTLEVEL
+       wsr     a0, icountlevel
 
        .set    _index, 0
        .rept   XCHAL_NUM_DBREAK - 1
-       wsr     a0, DBREAKC + _index
+       wsr     a0, SREG_DBREAKC + _index
        .set    _index, _index + 1
        .endr
 #endif
 
        /* Clear CCOUNT (not really necessary, but nice) */
 
-       wsr     a0, CCOUNT      # not really necessary, but nice
+       wsr     a0, ccount      # not really necessary, but nice
 
        /* Disable zero-loops. */
 
 #if XCHAL_HAVE_LOOPS
-       wsr     a0, LCOUNT
+       wsr     a0, lcount
 #endif
 
        /* Disable all timers. */
 
        .set    _index, 0
        .rept   XCHAL_NUM_TIMERS - 1
-       wsr     a0, CCOMPARE + _index
+       wsr     a0, SREG_CCOMPARE + _index
        .set    _index, _index + 1
        .endr
 
        /* Interrupt initialization. */
 
        movi    a2, XCHAL_INTTYPE_MASK_SOFTWARE | XCHAL_INTTYPE_MASK_EXTERN_EDGE
-       wsr     a0, INTENABLE
-       wsr     a2, INTCLEAR
+       wsr     a0, intenable
+       wsr     a2, intclear
 
        /* Disable coprocessors. */
 
 #if XCHAL_CP_NUM > 0
-       wsr     a0, CPENABLE
+       wsr     a0, cpenable
 #endif
 
        /* Set PS.INTLEVEL=1, PS.WOE=0, kernel stack, PS.EXCM=0
@@ -132,7 +132,7 @@ _startup:
         */
 
        movi    a1, 1
-       wsr     a1, PS
+       wsr     a1, ps
        rsync
 
        /*  Initialize the caches.
@@ -206,18 +206,18 @@ _startup:
        addi    a1, a1, KERNEL_STACK_SIZE
 
        movi    a2, 0x00040001          # WOE=1, INTLEVEL=1, UM=0
-       wsr     a2, PS                  # (enable reg-windows; progmode stack)
+       wsr     a2, ps                  # (enable reg-windows; progmode stack)
        rsync
 
        /* Set up EXCSAVE[DEBUGLEVEL] to point to the Debug Exception Handler.*/
 
        movi    a2, debug_exception
-       wsr     a2, EXCSAVE + XCHAL_DEBUGLEVEL
+       wsr     a2, SREG_EXCSAVE + XCHAL_DEBUGLEVEL
 
        /* Set up EXCSAVE[1] to point to the exc_table. */
 
        movi    a6, exc_table
-       xsr     a6, EXCSAVE_1
+       xsr     a6, excsave1
 
        /* init_arch kick-starts the linux kernel */
 
index 98e77c3ef1c38d9e1401b7238a7a4a4c51cea460..a6ce3e563739f1b56d34eea2a0c2f770159c9f46 100644 (file)
@@ -72,13 +72,13 @@ int arch_show_interrupts(struct seq_file *p, int prec)
 static void xtensa_irq_mask(struct irq_data *d)
 {
        cached_irq_mask &= ~(1 << d->irq);
-       set_sr (cached_irq_mask, INTENABLE);
+       set_sr (cached_irq_mask, intenable);
 }
 
 static void xtensa_irq_unmask(struct irq_data *d)
 {
        cached_irq_mask |= 1 << d->irq;
-       set_sr (cached_irq_mask, INTENABLE);
+       set_sr (cached_irq_mask, intenable);
 }
 
 static void xtensa_irq_enable(struct irq_data *d)
@@ -95,7 +95,7 @@ static void xtensa_irq_disable(struct irq_data *d)
 
 static void xtensa_irq_ack(struct irq_data *d)
 {
-       set_sr(1 << d->irq, INTCLEAR);
+       set_sr(1 << d->irq, intclear);
 }
 
 static int xtensa_irq_retrigger(struct irq_data *d)
index bc020825cce55197e6aaf7dfc127203a143e3553..1908f6642d31e0073c5884b0f90445641452cb75 100644 (file)
@@ -173,6 +173,16 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
  *
  * Note: This is a pristine frame, so we don't need any spill region on top of
  *       childregs.
+ *
+ * The fun part:  if we're keeping the same VM (i.e. cloning a thread,
+ * not an entire process), we're normally given a new usp, and we CANNOT share
+ * any live address register windows.  If we just copy those live frames over,
+ * the two threads (parent and child) will overflow the same frames onto the
+ * parent stack at different times, likely corrupting the parent stack (esp.
+ * if the parent returns from functions that called clone() and calls new
+ * ones, before the child overflows its now old copies of its parent windows).
+ * One solution is to spill windows to the parent stack, but that's fairly
+ * involved.  Much simpler to just not copy those live frames across.
  */
 
 int copy_thread(unsigned long clone_flags, unsigned long usp,
@@ -180,10 +190,13 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
                 struct task_struct * p, struct pt_regs * regs)
 {
        struct pt_regs *childregs;
-       struct thread_info *ti;
        unsigned long tos;
        int user_mode = user_mode(regs);
 
+#if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS)
+       struct thread_info *ti;
+#endif
+
        /* Set up new TSS. */
        tos = (unsigned long)task_stack_page(p) + THREAD_SIZE;
        if (user_mode)
@@ -191,13 +204,14 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
        else
                childregs = (struct pt_regs*)tos - 1;
 
+       /* This does not copy all the regs.  In a bout of brilliance or madness,
+          ARs beyond a0-a15 exist past the end of the struct. */
        *childregs = *regs;
 
        /* Create a call4 dummy-frame: a0 = 0, a1 = childregs. */
        *((int*)childregs - 3) = (unsigned long)childregs;
        *((int*)childregs - 4) = 0;
 
-       childregs->areg[1] = tos;
        childregs->areg[2] = 0;
        p->set_child_tid = p->clear_child_tid = NULL;
        p->thread.ra = MAKE_RA_FOR_CALL((unsigned long)ret_from_fork, 0x1);
@@ -205,10 +219,14 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 
        if (user_mode(regs)) {
 
-               int len = childregs->wmask & ~0xf;
                childregs->areg[1] = usp;
-               memcpy(&childregs->areg[XCHAL_NUM_AREGS - len/4],
-                      &regs->areg[XCHAL_NUM_AREGS - len/4], len);
+               if (clone_flags & CLONE_VM) {
+                       childregs->wmask = 1;   /* can't share live windows */
+               } else {
+                       int len = childregs->wmask & ~0xf;
+                       memcpy(&childregs->areg[XCHAL_NUM_AREGS - len/4],
+                              &regs->areg[XCHAL_NUM_AREGS - len/4], len);
+               }
 // FIXME: we need to set THREADPTR in thread_info...
                if (clone_flags & CLONE_SETTLS)
                        childregs->areg[2] = childregs->areg[6];
@@ -216,6 +234,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
        } else {
                /* In kernel space, we start a new thread with a new stack. */
                childregs->wmask = 1;
+               childregs->areg[1] = tos;
        }
 
 #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS)
index 270360d9806ca6832d0ff7d4aeeff62dfad910c7..b237988ba6d77b789ca2766509e66fd50985c840 100644 (file)
@@ -100,7 +100,7 @@ typedef struct tagtable {
 } tagtable_t;
 
 #define __tagtable(tag, fn) static tagtable_t __tagtable_##fn          \
-       __attribute__((unused, __section__(".taglist"))) = { tag, fn }
+       __attribute__((used, section(".taglist"))) = { tag, fn }
 
 /* parse current tag */
 
@@ -120,7 +120,7 @@ static int __init parse_tag_mem(const bp_tag_t *tag)
        }
        sysmem.bank[sysmem.nr_banks].type  = mi->type;
        sysmem.bank[sysmem.nr_banks].start = PAGE_ALIGN(mi->start);
-       sysmem.bank[sysmem.nr_banks].end   = mi->end & PAGE_SIZE;
+       sysmem.bank[sysmem.nr_banks].end   = mi->end & PAGE_MASK;
        sysmem.nr_banks++;
 
        return 0;
index 05b3f093d5d7cd09435c0395cf5a20e0a07e26ec..a5c01e74d5d5590f3c5287dace8f23c10c527cd9 100644 (file)
@@ -34,7 +34,6 @@ syscall_t sys_call_table[__NR_syscall_count] /* FIXME __cacheline_aligned */= {
 
 #undef __SYSCALL
 #define __SYSCALL(nr,symbol,nargs) [ nr ] = (syscall_t)symbol,
-#undef _XTENSA_UNISTD_H
 #undef  __KERNEL_SYSCALLS__
 #include <asm/unistd.h>
 };
index bc1e14cf93692b811c09c7440c83d9309cc00834..5caf2b64d43ac846c7a0c148166c54877dec8178 100644 (file)
@@ -97,7 +97,7 @@ static dispatch_init_table_t __initdata dispatch_init_table[] = {
 /* EXCCAUSE_INTEGER_DIVIDE_BY_ZERO unhandled */
 /* EXCCAUSE_PRIVILEGED unhandled */
 #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION
-#ifdef CONFIG_UNALIGNED_USER
+#ifdef CONFIG_XTENSA_UNALIGNED_USER
 { EXCCAUSE_UNALIGNED,          USER,      fast_unaligned },
 #else
 { EXCCAUSE_UNALIGNED,          0,         do_unaligned_user },
@@ -202,8 +202,8 @@ extern void do_IRQ(int, struct pt_regs *);
 
 void do_interrupt (struct pt_regs *regs)
 {
-       unsigned long intread = get_sr (INTREAD);
-       unsigned long intenable = get_sr (INTENABLE);
+       unsigned long intread = get_sr (interrupt);
+       unsigned long intenable = get_sr (intenable);
        int i, mask;
 
        /* Handle all interrupts (no priorities).
@@ -213,7 +213,7 @@ void do_interrupt (struct pt_regs *regs)
 
        for (i=0, mask = 1; i < XCHAL_NUM_INTERRUPTS; i++, mask <<= 1) {
                if (mask & (intread & intenable)) {
-                       set_sr (mask, INTCLEAR);
+                       set_sr (mask, intclear);
                        do_IRQ (i,regs);
                }
        }
@@ -244,7 +244,7 @@ do_illegal_instruction(struct pt_regs *regs)
  */
 
 #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION
-#ifndef CONFIG_UNALIGNED_USER
+#ifndef CONFIG_XTENSA_UNALIGNED_USER
 void
 do_unaligned_user (struct pt_regs *regs)
 {
@@ -339,7 +339,7 @@ void __init trap_init(void)
        /* Initialize EXCSAVE_1 to hold the address of the exception table. */
 
        i = (unsigned long)exc_table;
-       __asm__ __volatile__("wsr  %0, "__stringify(EXCSAVE_1)"\n" : : "a" (i));
+       __asm__ __volatile__("wsr  %0, excsave1\n" : : "a" (i));
 }
 
 /*
@@ -386,16 +386,16 @@ static inline void spill_registers(void)
        unsigned int a0, ps;
 
        __asm__ __volatile__ (
-               "movi   a14," __stringify (PS_EXCM_BIT) " | 1\n\t"
+               "movi   a14, " __stringify(PS_EXCM_BIT | 1) "\n\t"
                "mov    a12, a0\n\t"
-               "rsr    a13," __stringify(SAR) "\n\t"
-               "xsr    a14," __stringify(PS) "\n\t"
+               "rsr    a13, sar\n\t"
+               "xsr    a14, ps\n\t"
                "movi   a0, _spill_registers\n\t"
                "rsync\n\t"
                "callx0 a0\n\t"
                "mov    a0, a12\n\t"
-               "wsr    a13," __stringify(SAR) "\n\t"
-               "wsr    a14," __stringify(PS) "\n\t"
+               "wsr    a13, sar\n\t"
+               "wsr    a14, ps\n\t"
                :: "a" (&a0), "a" (&ps)
                : "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15", "memory");
 }
index 70066e3582d0b878f427832f56d5f983fc5e11bb..4462c1e595c2b1ed87f772e11335561ed1885d6d 100644 (file)
 
 ENTRY(_UserExceptionVector)
 
-       xsr     a3, EXCSAVE_1           # save a3 and get dispatch table
-       wsr     a2, DEPC                # save a2
+       xsr     a3, excsave1            # save a3 and get dispatch table
+       wsr     a2, depc                # save a2
        l32i    a2, a3, EXC_TABLE_KSTK  # load kernel stack to a2
        s32i    a0, a2, PT_AREG0        # save a0 to ESF
-       rsr     a0, EXCCAUSE            # retrieve exception cause
+       rsr     a0, exccause            # retrieve exception cause
        s32i    a0, a2, PT_DEPC         # mark it as a regular exception
        addx4   a0, a0, a3              # find entry in table
        l32i    a0, a0, EXC_TABLE_FAST_USER     # load handler
@@ -93,11 +93,11 @@ ENTRY(_UserExceptionVector)
 
 ENTRY(_KernelExceptionVector)
 
-       xsr     a3, EXCSAVE_1           # save a3, and get dispatch table
-       wsr     a2, DEPC                # save a2
+       xsr     a3, excsave1            # save a3, and get dispatch table
+       wsr     a2, depc                # save a2
        addi    a2, a1, -16-PT_SIZE     # adjust stack pointer
        s32i    a0, a2, PT_AREG0        # save a0 to ESF
-       rsr     a0, EXCCAUSE            # retrieve exception cause
+       rsr     a0, exccause            # retrieve exception cause
        s32i    a0, a2, PT_DEPC         # mark it as a regular exception
        addx4   a0, a0, a3              # find entry in table
        l32i    a0, a0, EXC_TABLE_FAST_KERNEL   # load handler address
@@ -205,17 +205,17 @@ ENTRY(_DoubleExceptionVector)
 
        /* Deliberately destroy excsave (don't assume it's value was valid). */
 
-       wsr     a3, EXCSAVE_1           # save a3
+       wsr     a3, excsave1            # save a3
 
        /* Check for kernel double exception (usually fatal). */
 
-       rsr     a3, PS
+       rsr     a3, ps
        _bbci.l a3, PS_UM_BIT, .Lksp
 
        /* Check if we are currently handling a window exception. */
        /* Note: We don't need to indicate that we enter a critical section. */
 
-       xsr     a0, DEPC                # get DEPC, save a0
+       xsr     a0, depc                # get DEPC, save a0
 
        movi    a3, XCHAL_WINDOW_VECTORS_VADDR
        _bltu   a0, a3, .Lfixup
@@ -243,21 +243,21 @@ ENTRY(_DoubleExceptionVector)
         * Note: We can trash the current window frame (a0...a3) and depc!
         */
 
-       wsr     a2, DEPC                # save stack pointer temporarily
-       rsr     a0, PS
+       wsr     a2, depc                # save stack pointer temporarily
+       rsr     a0, ps
        extui   a0, a0, PS_OWB_SHIFT, 4
-       wsr     a0, WINDOWBASE
+       wsr     a0, windowbase
        rsync
 
        /* We are now in the previous window frame. Save registers again. */
 
-       xsr     a2, DEPC                # save a2 and get stack pointer
+       xsr     a2, depc                # save a2 and get stack pointer
        s32i    a0, a2, PT_AREG0
 
-       wsr     a3, EXCSAVE_1           # save a3
+       wsr     a3, excsave1            # save a3
        movi    a3, exc_table
 
-       rsr     a0, EXCCAUSE
+       rsr     a0, exccause
        s32i    a0, a2, PT_DEPC         # mark it as a regular exception
        addx4   a0, a0, a3
        l32i    a0, a0, EXC_TABLE_FAST_USER
@@ -290,14 +290,14 @@ ENTRY(_DoubleExceptionVector)
 
        /* a0: depc, a1: a1, a2: kstk, a3: a2, depc: a0, excsave: a3 */
 
-       xsr     a3, DEPC
+       xsr     a3, depc
        s32i    a0, a2, PT_DEPC
        s32i    a3, a2, PT_AREG0
 
        /* a0: avail, a1: a1, a2: kstk, a3: avail, depc: a2, excsave: a3 */
 
        movi    a3, exc_table
-       rsr     a0, EXCCAUSE
+       rsr     a0, exccause
        addx4   a0, a0, a3
        l32i    a0, a0, EXC_TABLE_FAST_USER
        jx      a0
@@ -312,7 +312,7 @@ ENTRY(_DoubleExceptionVector)
 
 .Lksp: /* a0: a0, a1: a1, a2: a2, a3: trashed, depc: depc, excsave: a3 */
 
-       rsr     a3, EXCCAUSE
+       rsr     a3, exccause
        beqi    a3, EXCCAUSE_ITLB_MISS, 1f
        addi    a3, a3, -EXCCAUSE_DTLB_MISS
        bnez    a3, .Lunrecoverable
@@ -328,11 +328,11 @@ ENTRY(_DoubleExceptionVector)
 
 .Lunrecoverable_fixup:
        l32i    a2, a3, EXC_TABLE_DOUBLE_SAVE
-       xsr     a0, DEPC
+       xsr     a0, depc
 
 .Lunrecoverable:
-       rsr     a3, EXCSAVE_1
-       wsr     a0, EXCSAVE_1
+       rsr     a3, excsave1
+       wsr     a0, excsave1
        movi    a0, unrecoverable_exception
        callx0  a0
 
@@ -349,7 +349,7 @@ ENTRY(_DoubleExceptionVector)
        .section .DebugInterruptVector.text, "ax"
 
 ENTRY(_DebugInterruptVector)
-       xsr     a0, EXCSAVE + XCHAL_DEBUGLEVEL
+       xsr     a0, SREG_EXCSAVE + XCHAL_DEBUGLEVEL
        jx      a0
 
 
index ea59dcd038666da7af3004c68da1eb7d9964d9dd..c48b80acb5f014813c9d509f425e95e4f3b872e0 100644 (file)
@@ -6,7 +6,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2002 - 2005 Tensilica Inc.
+ * Copyright (C) 2002 - 2012 Tensilica Inc.
  */
 
 #include <variant/core.h>
 #endif
        .endm
 
-
 /*
  * void *memcpy(void *dst, const void *src, size_t len);
- * void *memmove(void *dst, const void *src, size_t len);
- * void *bcopy(const void *src, void *dst, size_t len);
  *
  * This function is intended to do the same thing as the standard
- * library function memcpy() (or bcopy()) for most cases.
+ * library function memcpy() for most cases.
  * However, where the source and/or destination references
  * an instruction RAM or ROM or a data RAM or ROM, that
  * source and/or destination will always be accessed with
@@ -45,9 +42,6 @@
  * !!!!!!!  Handling of IRAM/IROM has not yet
  * !!!!!!!  been implemented.
  *
- * The bcopy version is provided here to avoid the overhead
- * of an extra call, for callers that require this convention.
- *
  * The (general case) algorithm is as follows:
  *   If destination is unaligned, align it by conditionally
  *     copying 1 and 2 bytes.
  */
 
        .text
-       .align  4
-       .global bcopy
-       .type   bcopy,@function
-bcopy:
-       entry   sp, 16          # minimal stack frame
-       # a2=src, a3=dst, a4=len
-       mov     a5, a3          # copy dst so that a2 is return value
-       mov     a3, a2
-       mov     a2, a5
-       j       .Lcommon        # go to common code for memcpy+bcopy
-
 
 /*
  * Byte by byte copy
@@ -107,7 +90,7 @@ bcopy:
        s8i     a6, a5, 0
        addi    a5, a5, 1
 #if !XCHAL_HAVE_LOOPS
-       blt     a3, a7, .Lnextbyte
+       bne     a3, a7, .Lnextbyte # continue loop if $a3:src != $a7:src_end
 #endif /* !XCHAL_HAVE_LOOPS */
 .Lbytecopydone:
        retw
@@ -144,9 +127,6 @@ bcopy:
        .global memcpy
        .type   memcpy,@function
 memcpy:
-       .global memmove
-       .type   memmove,@function
-memmove:
 
        entry   sp, 16          # minimal stack frame
        # a2/ dst, a3/ src, a4/ len
@@ -182,7 +162,7 @@ memmove:
        s32i    a7, a5, 12
        addi    a5, a5, 16
 #if !XCHAL_HAVE_LOOPS
-       blt     a3, a8, .Loop1
+       bne     a3, a8, .Loop1  # continue loop if a3:src != a8:src_end
 #endif /* !XCHAL_HAVE_LOOPS */
 .Loop1done:
        bbci.l  a4, 3, .L2
@@ -260,7 +240,7 @@ memmove:
        s32i    a9, a5, 12
        addi    a5, a5, 16
 #if !XCHAL_HAVE_LOOPS
-       blt     a3, a10, .Loop2
+       bne     a3, a10, .Loop2 # continue loop if a3:src != a10:src_end
 #endif /* !XCHAL_HAVE_LOOPS */
 .Loop2done:
        bbci.l  a4, 3, .L12
@@ -305,6 +285,285 @@ memmove:
        l8ui    a6, a3,  0
        s8i     a6, a5,  0
        retw
+
+
+/*
+ * void bcopy(const void *src, void *dest, size_t n);
+ */
+       .align  4
+       .global bcopy
+       .type   bcopy,@function
+bcopy:
+       entry   sp, 16          # minimal stack frame
+       # a2=src, a3=dst, a4=len
+       mov     a5, a3
+       mov     a3, a2
+       mov     a2, a5
+       j       .Lmovecommon    # go to common code for memmove+bcopy
+
+/*
+ * void *memmove(void *dst, const void *src, size_t len);
+ *
+ * This function is intended to do the same thing as the standard
+ * library function memmove() for most cases.
+ * However, where the source and/or destination references
+ * an instruction RAM or ROM or a data RAM or ROM, that
+ * source and/or destination will always be accessed with
+ * 32-bit load and store instructions (as required for these
+ * types of devices).
+ *
+ * !!!!!!!  XTFIXME:
+ * !!!!!!!  Handling of IRAM/IROM has not yet
+ * !!!!!!!  been implemented.
+ *
+ * The (general case) algorithm is as follows:
+ *   If end of source doesn't overlap destination then use memcpy.
+ *   Otherwise do memcpy backwards.
+ *
+ * Register use:
+ *     a0/ return address
+ *     a1/ stack pointer
+ *     a2/ return value
+ *     a3/ src
+ *     a4/ length
+ *     a5/ dst
+ *     a6/ tmp
+ *     a7/ tmp
+ *     a8/ tmp
+ *     a9/ tmp
+ *     a10/ tmp
+ *     a11/ tmp
+ */
+
+/*
+ * Byte by byte copy
+ */
+       .align  4
+       .byte   0               # 1 mod 4 alignment for LOOPNEZ
+                               # (0 mod 4 alignment for LBEG)
+.Lbackbytecopy:
+#if XCHAL_HAVE_LOOPS
+       loopnez a4, .Lbackbytecopydone
+#else /* !XCHAL_HAVE_LOOPS */
+       beqz    a4, .Lbackbytecopydone
+       sub     a7, a3, a4      # a7 = start address for source
+#endif /* !XCHAL_HAVE_LOOPS */
+.Lbacknextbyte:
+       addi    a3, a3, -1
+       l8ui    a6, a3, 0
+       addi    a5, a5, -1
+       s8i     a6, a5, 0
+#if !XCHAL_HAVE_LOOPS
+       bne     a3, a7, .Lbacknextbyte # continue loop if
+                                      # $a3:src != $a7:src_start
+#endif /* !XCHAL_HAVE_LOOPS */
+.Lbackbytecopydone:
+       retw
+
+/*
+ * Destination is unaligned
+ */
+
+       .align  4
+.Lbackdst1mod2:        # dst is only byte aligned
+       _bltui  a4, 7, .Lbackbytecopy   # do short copies byte by byte
+
+       # copy 1 byte
+       addi    a3, a3, -1
+       l8ui    a6, a3,  0
+       addi    a5, a5, -1
+       s8i     a6, a5,  0
+       addi    a4, a4, -1
+       _bbci.l a5, 1, .Lbackdstaligned # if dst is now aligned, then
+                                       # return to main algorithm
+.Lbackdst2mod4:        # dst 16-bit aligned
+       # copy 2 bytes
+       _bltui  a4, 6, .Lbackbytecopy   # do short copies byte by byte
+       addi    a3, a3, -2
+       l8ui    a6, a3,  0
+       l8ui    a7, a3,  1
+       addi    a5, a5, -2
+       s8i     a6, a5,  0
+       s8i     a7, a5,  1
+       addi    a4, a4, -2
+       j       .Lbackdstaligned        # dst is now aligned,
+                                       # return to main algorithm
+
+       .align  4
+       .global memmove
+       .type   memmove,@function
+memmove:
+
+       entry   sp, 16          # minimal stack frame
+       # a2/ dst, a3/ src, a4/ len
+       mov     a5, a2          # copy dst so that a2 is return value
+.Lmovecommon:
+       sub     a6, a5, a3
+       bgeu    a6, a4, .Lcommon
+
+       add     a5, a5, a4
+       add     a3, a3, a4
+
+       _bbsi.l a5, 0, .Lbackdst1mod2   # if dst is 1 mod 2
+       _bbsi.l a5, 1, .Lbackdst2mod4   # if dst is 2 mod 4
+.Lbackdstaligned:      # return here from .Lbackdst?mod? once dst is aligned
+       srli    a7, a4, 4       # number of loop iterations with 16B
+                               # per iteration
+       movi    a8, 3           # if source is not aligned,
+       _bany   a3, a8, .Lbacksrcunaligned      # then use shifting copy
+       /*
+        * Destination and source are word-aligned, use word copy.
+        */
+       # copy 16 bytes per iteration for word-aligned dst and word-aligned src
+#if XCHAL_HAVE_LOOPS
+       loopnez a7, .backLoop1done
+#else /* !XCHAL_HAVE_LOOPS */
+       beqz    a7, .backLoop1done
+       slli    a8, a7, 4
+       sub     a8, a3, a8      # a8 = start of first 16B source chunk
+#endif /* !XCHAL_HAVE_LOOPS */
+.backLoop1:
+       addi    a3, a3, -16
+       l32i    a7, a3, 12
+       l32i    a6, a3,  8
+       addi    a5, a5, -16
+       s32i    a7, a5, 12
+       l32i    a7, a3,  4
+       s32i    a6, a5,  8
+       l32i    a6, a3,  0
+       s32i    a7, a5,  4
+       s32i    a6, a5,  0
+#if !XCHAL_HAVE_LOOPS
+       bne     a3, a8, .backLoop1  # continue loop if a3:src != a8:src_start
+#endif /* !XCHAL_HAVE_LOOPS */
+.backLoop1done:
+       bbci.l  a4, 3, .Lback2
+       # copy 8 bytes
+       addi    a3, a3, -8
+       l32i    a6, a3,  0
+       l32i    a7, a3,  4
+       addi    a5, a5, -8
+       s32i    a6, a5,  0
+       s32i    a7, a5,  4
+.Lback2:
+       bbsi.l  a4, 2, .Lback3
+       bbsi.l  a4, 1, .Lback4
+       bbsi.l  a4, 0, .Lback5
+       retw
+.Lback3:
+       # copy 4 bytes
+       addi    a3, a3, -4
+       l32i    a6, a3,  0
+       addi    a5, a5, -4
+       s32i    a6, a5,  0
+       bbsi.l  a4, 1, .Lback4
+       bbsi.l  a4, 0, .Lback5
+       retw
+.Lback4:
+       # copy 2 bytes
+       addi    a3, a3, -2
+       l16ui   a6, a3,  0
+       addi    a5, a5, -2
+       s16i    a6, a5,  0
+       bbsi.l  a4, 0, .Lback5
+       retw
+.Lback5:
+       # copy 1 byte
+       addi    a3, a3, -1
+       l8ui    a6, a3,  0
+       addi    a5, a5, -1
+       s8i     a6, a5,  0
+       retw
+
+/*
+ * Destination is aligned, Source is unaligned
+ */
+
+       .align  4
+.Lbacksrcunaligned:
+       _beqz   a4, .Lbackdone  # avoid loading anything for zero-length copies
+       # copy 16 bytes per iteration for word-aligned dst and unaligned src
+       ssa8    a3              # set shift amount from byte offset
+#define SIM_CHECKS_ALIGNMENT   1       /* set to 1 when running on ISS with
+                                        * the lint or ferret client, or 0
+                                        * to save a few cycles */
+#if XCHAL_UNALIGNED_LOAD_EXCEPTION || SIM_CHECKS_ALIGNMENT
+       and     a11, a3, a8     # save unalignment offset for below
+       sub     a3, a3, a11     # align a3
+#endif
+       l32i    a6, a3, 0       # load first word
+#if XCHAL_HAVE_LOOPS
+       loopnez a7, .backLoop2done
+#else /* !XCHAL_HAVE_LOOPS */
+       beqz    a7, .backLoop2done
+       slli    a10, a7, 4
+       sub     a10, a3, a10    # a10 = start of first 16B source chunk
+#endif /* !XCHAL_HAVE_LOOPS */
+.backLoop2:
+       addi    a3, a3, -16
+       l32i    a7, a3, 12
+       l32i    a8, a3,  8
+       addi    a5, a5, -16
+       src_b   a6, a7, a6
+       s32i    a6, a5, 12
+       l32i    a9, a3,  4
+       src_b   a7, a8, a7
+       s32i    a7, a5,  8
+       l32i    a6, a3,  0
+       src_b   a8, a9, a8
+       s32i    a8, a5,  4
+       src_b   a9, a6, a9
+       s32i    a9, a5,  0
+#if !XCHAL_HAVE_LOOPS
+       bne     a3, a10, .backLoop2 # continue loop if a3:src != a10:src_start
+#endif /* !XCHAL_HAVE_LOOPS */
+.backLoop2done:
+       bbci.l  a4, 3, .Lback12
+       # copy 8 bytes
+       addi    a3, a3, -8
+       l32i    a7, a3,  4
+       l32i    a8, a3,  0
+       addi    a5, a5, -8
+       src_b   a6, a7, a6
+       s32i    a6, a5,  4
+       src_b   a7, a8, a7
+       s32i    a7, a5,  0
+       mov     a6, a8
+.Lback12:
+       bbci.l  a4, 2, .Lback13
+       # copy 4 bytes
+       addi    a3, a3, -4
+       l32i    a7, a3,  0
+       addi    a5, a5, -4
+       src_b   a6, a7, a6
+       s32i    a6, a5,  0
+       mov     a6, a7
+.Lback13:
+#if XCHAL_UNALIGNED_LOAD_EXCEPTION || SIM_CHECKS_ALIGNMENT
+       add     a3, a3, a11     # readjust a3 with correct misalignment
+#endif
+       bbsi.l  a4, 1, .Lback14
+       bbsi.l  a4, 0, .Lback15
+.Lbackdone:
+       retw
+.Lback14:
+       # copy 2 bytes
+       addi    a3, a3, -2
+       l8ui    a6, a3,  0
+       l8ui    a7, a3,  1
+       addi    a5, a5, -2
+       s8i     a6, a5,  0
+       s8i     a7, a5,  1
+       bbsi.l  a4, 0, .Lback15
+       retw
+.Lback15:
+       # copy 1 byte
+       addi    a3, a3, -1
+       addi    a5, a5, -1
+       l8ui    a6, a3,  0
+       s8i     a6, a5,  0
+       retw
+
 \f
 /*
  * Local Variables:
index 2c2f710ed1dc905a8c9e0509d36cd76ed073e0ce..245b08f7eaf4bb98fd3a731c7f6d329214a5b55a 100644 (file)
@@ -6,7 +6,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
+ * Copyright (C) 2001 - 2010 Tensilica Inc.
  *
  * Chris Zankel <chris@zankel.net>
  * Joe Taylor  <joe@tensilica.com, joetylr@yahoo.com>
@@ -186,6 +186,7 @@ do_sigbus:
        /* Kernel mode? Handle exceptions or die */
        if (!user_mode(regs))
                bad_page_fault(regs, address, SIGBUS);
+       return;
 
 vmalloc_fault:
        {
index 8ab47edd7c82b677a5d893391d4f340454c1cb48..7e74895eee04c8e17333d159998ce0cc0b10cccb 100644 (file)
@@ -91,7 +91,7 @@ static int rs_write(struct tty_struct * tty,
 {
        /* see drivers/char/serialX.c to reference original version */
 
-       __simc (SYS_write, 1, (unsigned long)buf, count, 0, 0);
+       simc_write(1, buf, count);
        return count;
 }
 
@@ -122,12 +122,7 @@ static void rs_poll(unsigned long priv)
 
 static int rs_put_char(struct tty_struct *tty, unsigned char ch)
 {
-       char buf[2];
-
-       buf[0] = ch;
-       buf[1] = '\0';          /* Is this NULL necessary? */
-       __simc (SYS_write, 1, (unsigned long) buf, 1, 0, 0);
-       return 1;
+       return rs_write(tty, &ch, 1);
 }
 
 static void rs_flush_chars(struct tty_struct *tty)
index 8c43bfea05e1e6257ad37f53f6eb12c4aaf45b85..bd78192e2fc9e61e72dbd8c38eda423598c6e2bb 100644 (file)
@@ -78,8 +78,9 @@ static inline int __simc(int a, int b, int c, int d, int e, int f)
        return ret;
 }
 
-static inline int simc_open(char *file, int flags, int mode)
+static inline int simc_open(const char *file, int flags, int mode)
 {
+       wmb();
        return __simc(SYS_open, (int) file, flags, mode, 0, 0);
 }
 
@@ -90,16 +91,19 @@ static inline int simc_close(int fd)
 
 static inline int simc_ioctl(int fd, int request, void *arg)
 {
+       wmb();
        return __simc(SYS_ioctl, fd, request, (int) arg, 0, 0);
 }
 
 static inline int simc_read(int fd, void *buf, size_t count)
 {
+       rmb();
        return __simc(SYS_read, fd, (int) buf, count, 0, 0);
 }
 
-static inline int simc_write(int fd, void *buf, size_t count)
+static inline int simc_write(int fd, const void *buf, size_t count)
 {
+       wmb();
        return __simc(SYS_write, fd, (int) buf, count, 0, 0);
 }
 
@@ -107,6 +111,7 @@ static inline int simc_poll(int fd)
 {
        struct timeval tv = { .tv_sec = 0, .tv_usec = 0 };
 
+       wmb();
        return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&tv,
                        0, 0);
 }
index 927acf378ea35e3bb6364bfb78cfc1347f829ecb..e1700102f35ee8039d66661250f1a41ca26fc5d0 100644 (file)
@@ -61,13 +61,13 @@ void platform_restart(void)
         * jump to the reset vector. */
 
        __asm__ __volatile__("movi      a2, 15\n\t"
-                            "wsr       a2, " __stringify(ICOUNTLEVEL) "\n\t"
+                            "wsr       a2, icountlevel\n\t"
                             "movi      a2, 0\n\t"
-                            "wsr       a2, " __stringify(ICOUNT) "\n\t"
-                            "wsr       a2, " __stringify(IBREAKENABLE) "\n\t"
-                            "wsr       a2, " __stringify(LCOUNT) "\n\t"
+                            "wsr       a2, icount\n\t"
+                            "wsr       a2, ibreakenable\n\t"
+                            "wsr       a2, lcount\n\t"
                             "movi      a2, 0x1f\n\t"
-                            "wsr       a2, " __stringify(PS) "\n\t"
+                            "wsr       a2, ps\n\t"
                             "isync\n\t"
                             "jx        %0\n\t"
                             :
index 9e83940ac26577f3f60c92784b6bb482f98f736e..c7d90f17886e1fd86a1fc17df51bab8cbd2c939d 100644 (file)
@@ -66,13 +66,13 @@ void platform_restart(void)
         * jump to the reset vector. */
 
        __asm__ __volatile__ ("movi     a2, 15\n\t"
-                             "wsr      a2, " __stringify(ICOUNTLEVEL) "\n\t"
+                             "wsr      a2, icountlevel\n\t"
                              "movi     a2, 0\n\t"
-                             "wsr      a2, " __stringify(ICOUNT) "\n\t"
-                             "wsr      a2, " __stringify(IBREAKENABLE) "\n\t"
-                             "wsr      a2, " __stringify(LCOUNT) "\n\t"
+                             "wsr      a2, icount\n\t"
+                             "wsr      a2, ibreakenable\n\t"
+                             "wsr      a2, lcount\n\t"
                              "movi     a2, 0x1f\n\t"
-                             "wsr      a2, " __stringify(PS) "\n\t"
+                             "wsr      a2, ps\n\t"
                              "isync\n\t"
                              "jx       %0\n\t"
                              :
index 03da5b663aef8ea6c2991484b98cb315a16b87db..a16a8d001ae0c3fd0afd8cf3648cebe5c839d75b 100644 (file)
@@ -17,6 +17,10 @@ obj-$(CONFIG_PARISC)         += parisc/
 obj-$(CONFIG_RAPIDIO)          += rapidio/
 obj-y                          += video/
 obj-y                          += idle/
+
+# IPMI must come before ACPI in order to provide IPMI opregion support
+obj-$(CONFIG_IPMI_HANDLER)     += char/ipmi/
+
 obj-$(CONFIG_ACPI)             += acpi/
 obj-$(CONFIG_SFI)              += sfi/
 # PnP must come after ACPI since it will eventually need to check if acpi
index 47199e2a9130a6c929290e34917fc0fdc0714519..82422fe90f8192126ef25f02f1d7fe72fd2c9807 100644 (file)
@@ -47,6 +47,10 @@ acpi-y                               += video_detect.o
 endif
 
 # These are (potentially) separate modules
+
+# IPMI may be used by other drivers, so it has to initialise before them
+obj-$(CONFIG_ACPI_IPMI)                += acpi_ipmi.o
+
 obj-$(CONFIG_ACPI_AC)          += ac.o
 obj-$(CONFIG_ACPI_BUTTON)      += button.o
 obj-$(CONFIG_ACPI_FAN)         += fan.o
@@ -70,6 +74,5 @@ processor-y                   += processor_idle.o processor_thermal.o
 processor-$(CONFIG_CPU_FREQ)   += processor_perflib.o
 
 obj-$(CONFIG_ACPI_PROCESSOR_AGGREGATOR) += acpi_pad.o
-obj-$(CONFIG_ACPI_IPMI)                += acpi_ipmi.o
 
 obj-$(CONFIG_ACPI_APEI)                += apei/
index c8abce3d2d9c0618f2092c94398e3197d0396b27..ed0fade46aed279097f105d3b9c6208eb2b0fe46 100644 (file)
@@ -270,15 +270,10 @@ static int hci_uart_send_frame(struct sk_buff *skb)
  */
 static int hci_uart_tty_open(struct tty_struct *tty)
 {
-       struct hci_uart *hu = (void *) tty->disc_data;
+       struct hci_uart *hu;
 
        BT_DBG("tty %p", tty);
 
-       /* FIXME: This btw is bogus, nothing requires the old ldisc to clear
-          the pointer */
-       if (hu)
-               return -EEXIST;
-
        /* Error if the tty has no write op instead of leaving an exploitable
           hole */
        if (tty->ops->write == NULL)
index d0b27a39f1d48cee2c994797805bd33941a7e2e6..7ff1d0d208a7c3f89f6827fd3e9ba8815dad202d 100644 (file)
@@ -52,7 +52,6 @@ obj-$(CONFIG_TELCLOCK)                += tlclk.o
 obj-$(CONFIG_MWAVE)            += mwave/
 obj-$(CONFIG_AGP)              += agp/
 obj-$(CONFIG_PCMCIA)           += pcmcia/
-obj-$(CONFIG_IPMI_HANDLER)     += ipmi/
 
 obj-$(CONFIG_HANGCHECK_TIMER)  += hangcheck-timer.o
 obj-$(CONFIG_TCG_TPM)          += tpm/
index e01f5eaaec82a9317724c90337d9d8e45da1bb39..38390f7c6ab679ef3ed3ce0c4f9e28b7fa1e11b5 100644 (file)
@@ -667,7 +667,7 @@ static int intel_gtt_init(void)
        gtt_map_size = intel_private.base.gtt_total_entries * 4;
 
        intel_private.gtt = NULL;
-       if (INTEL_GTT_GEN < 6)
+       if (INTEL_GTT_GEN < 6 && INTEL_GTT_GEN > 2)
                intel_private.gtt = ioremap_wc(intel_private.gtt_bus_addr,
                                               gtt_map_size);
        if (intel_private.gtt == NULL)
index a5effd813abddbcdb6a0603148caa822b7dd36f6..45e467dcc8c886996966a2488c148b68d7f792b2 100644 (file)
@@ -27,8 +27,6 @@
 
 #include <asm/io.h>
 
-#include <plat/cpu.h>
-
 #define RNG_OUT_REG            0x00            /* Output register */
 #define RNG_STAT_REG           0x04            /* Status register
                                                        [0] = STAT_BUSY */
index 2c29942b132654747af55e6b70ea4857dc9e0de4..a0c84bb30856073aa7a46c52690f163789bbd9bc 100644 (file)
@@ -1880,7 +1880,7 @@ int ipmi_request_supply_msgs(ipmi_user_t          user,
                             struct ipmi_recv_msg *supplied_recv,
                             int                  priority)
 {
-       unsigned char saddr, lun;
+       unsigned char saddr = 0, lun = 0;
        int           rv;
 
        if (!user)
index 83f85cf7fb1b424afd4dde0b104af0ea21a51f7b..32a6c7e256bd82496f7461999a7ea3408342f423 100644 (file)
@@ -2424,6 +2424,38 @@ static void ipmi_pci_cleanup(struct smi_info *info)
        pci_disable_device(pdev);
 }
 
+static int __devinit ipmi_pci_probe_regspacing(struct smi_info *info)
+{
+       if (info->si_type == SI_KCS) {
+               unsigned char   status;
+               int             regspacing;
+
+               info->io.regsize = DEFAULT_REGSIZE;
+               info->io.regshift = 0;
+               info->io_size = 2;
+               info->handlers = &kcs_smi_handlers;
+
+               /* detect 1, 4, 16byte spacing */
+               for (regspacing = DEFAULT_REGSPACING; regspacing <= 16;) {
+                       info->io.regspacing = regspacing;
+                       if (info->io_setup(info)) {
+                               dev_err(info->dev,
+                                       "Could not setup I/O space\n");
+                               return DEFAULT_REGSPACING;
+                       }
+                       /* write invalid cmd */
+                       info->io.outputb(&info->io, 1, 0x10);
+                       /* read status back */
+                       status = info->io.inputb(&info->io, 1);
+                       info->io_cleanup(info);
+                       if (status)
+                               return regspacing;
+                       regspacing *= 4;
+               }
+       }
+       return DEFAULT_REGSPACING;
+}
+
 static int __devinit ipmi_pci_probe(struct pci_dev *pdev,
                                    const struct pci_device_id *ent)
 {
@@ -2476,8 +2508,8 @@ static int __devinit ipmi_pci_probe(struct pci_dev *pdev,
        }
        info->io.addr_data = pci_resource_start(pdev, 0);
 
-       info->io.regspacing = DEFAULT_REGSPACING;
-       info->io.regsize = DEFAULT_REGSPACING;
+       info->io.regspacing = ipmi_pci_probe_regspacing(info);
+       info->io.regsize = DEFAULT_REGSIZE;
        info->io.regshift = 0;
 
        info->irq = pdev->irq;
index 093a8af59cbe46711fd0e750552598eb26f04d85..649a146e1382b61b3143493125eb79d38c63a894 100644 (file)
@@ -29,8 +29,7 @@
 #include <crypto/scatterwalk.h>
 #include <crypto/aes.h>
 
-#include <plat/cpu.h>
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 
 /* OMAP TRM gives bitfields as start:end, where start is the higher bit
    number. For example 7:0 */
@@ -941,11 +940,6 @@ static int __init omap_aes_mod_init(void)
 {
        pr_info("loading %s driver\n", "omap-aes");
 
-       if (!cpu_class_is_omap2() || omap_type() != OMAP2_DEVICE_TYPE_SEC) {
-               pr_err("Unsupported cpu\n");
-               return -ENODEV;
-       }
-
        return  platform_driver_register(&omap_aes_driver);
 }
 
index a3fd6fc504b136d8e44d4435bbeb5c833dd194b1..d76fe06b9417d64a733849f3b961d6d358ab6336 100644 (file)
@@ -37,8 +37,7 @@
 #include <crypto/hash.h>
 #include <crypto/internal/hash.h>
 
-#include <plat/cpu.h>
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 #include <mach/irqs.h>
 
 #define SHA_REG_DIGEST(x)              (0x00 + ((x) * 0x04))
@@ -1289,13 +1288,6 @@ static int __init omap_sham_mod_init(void)
 {
        pr_info("loading %s driver\n", "omap-sham");
 
-       if (!cpu_class_is_omap2() ||
-               (omap_type() != OMAP2_DEVICE_TYPE_SEC &&
-                       omap_type() != OMAP2_DEVICE_TYPE_EMU)) {
-               pr_err("Unsupported cpu\n");
-               return -ENODEV;
-       }
-
        return platform_driver_register(&omap_sham_driver);
 }
 
index bb2d8e7029eb638c8d18f9ed3a9db01d795aef2c..56d925312a5cca89ba90c28119dbd1ce9f3c31c2 100644 (file)
 
 #include "virt-dma.h"
 
-#include <plat/cpu.h>
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
+
+#ifdef CONFIG_ARCH_OMAP2PLUS
+#define dma_omap2plus()        1
+#else
+#define dma_omap2plus()        0
+#endif
 
 struct omap_dmadev {
        struct dma_device ddev;
@@ -438,7 +443,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_cyclic(
                omap_disable_dma_irq(c->dma_ch, OMAP_DMA_BLOCK_IRQ);
        }
 
-       if (!cpu_class_is_omap1()) {
+       if (dma_omap2plus()) {
                omap_set_dma_src_burst_mode(c->dma_ch, OMAP_DMA_DATA_BURST_16);
                omap_set_dma_dest_burst_mode(c->dma_ch, OMAP_DMA_DATA_BURST_16);
        }
index c1cdc9236666f60ee6891206f5a1f90bba2c4a0f..90723e65b08172ac49e67d01065aa79ca7f7ee54 100644 (file)
@@ -237,7 +237,7 @@ static ssize_t memmap_attr_show(struct kobject *kobj,
  * firmware_map_add() or firmware_map_add_early() afterwards, the entries
  * are not added to sysfs.
  */
-static int __init memmap_init(void)
+static int __init firmware_memmap_init(void)
 {
        struct firmware_map_entry *entry;
 
@@ -246,5 +246,5 @@ static int __init memmap_init(void)
 
        return 0;
 }
-late_initcall(memmap_init);
+late_initcall(firmware_memmap_init);
 
index 902af437eaf26e9dc1b5c2cf3f1e902b70d5e237..7a874129e5d8f3634b68ea45d5d73a2a316f8bae 100644 (file)
@@ -381,11 +381,13 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type)
                u = readl_relaxed(mvebu_gpioreg_in_pol(mvchip));
                u &= ~(1 << pin);
                writel_relaxed(u, mvebu_gpioreg_in_pol(mvchip));
+               break;
        case IRQ_TYPE_EDGE_FALLING:
        case IRQ_TYPE_LEVEL_LOW:
                u = readl_relaxed(mvebu_gpioreg_in_pol(mvchip));
                u |= 1 << pin;
                writel_relaxed(u, mvebu_gpioreg_in_pol(mvchip));
+               break;
        case IRQ_TYPE_EDGE_BOTH: {
                u32 v;
 
@@ -401,6 +403,7 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type)
                else
                        u &= ~(1 << pin);       /* rising */
                writel_relaxed(u, mvebu_gpioreg_in_pol(mvchip));
+               break;
        }
        }
        return 0;
index cdf8b1e7602db2fdd46891b88d7555f6cae7be3e..441ebc1bdbef5455c6a8cc7aa34103926dd963fa 100644 (file)
@@ -239,7 +239,7 @@ int drm_vma_info(struct seq_file *m, void *data)
        mutex_lock(&dev->struct_mutex);
        seq_printf(m, "vma use count: %d, high_memory = %pK, 0x%pK\n",
                   atomic_read(&dev->vma_count),
-                  high_memory, (void *)virt_to_phys(high_memory));
+                  high_memory, (void *)(unsigned long)virt_to_phys(high_memory));
 
        list_for_each_entry(pt, &dev->vmalist, head) {
                vma = pt->vma;
index 38f3a6cb8c7d72272c9cffae2466818b440282e9..3edd981e077013f780cc8d637b9a5ba60b0f2aa6 100644 (file)
@@ -303,10 +303,10 @@ static bool ch7xxx_get_hw_state(struct intel_dvo_device *dvo)
 
        ch7xxx_readb(dvo, CH7xxx_PM, &val);
 
-       if (val & CH7xxx_PM_FPD)
-               return false;
-       else
+       if (val & (CH7xxx_PM_DVIL | CH7xxx_PM_DVIP))
                return true;
+       else
+               return false;
 }
 
 static void ch7xxx_dump_regs(struct intel_dvo_device *dvo)
index 4f2831aa5fedd517a4f49189bc19b4803e69b71a..b84f7861e4388cb3ccd8baa86ec3d994e4e52ceb 100644 (file)
@@ -1341,9 +1341,14 @@ int __must_check i915_gem_object_get_pages(struct drm_i915_gem_object *obj);
 static inline struct page *i915_gem_object_get_page(struct drm_i915_gem_object *obj, int n)
 {
        struct scatterlist *sg = obj->pages->sgl;
-       while (n >= SG_MAX_SINGLE_ALLOC) {
+       int nents = obj->pages->nents;
+       while (nents > SG_MAX_SINGLE_ALLOC) {
+               if (n < SG_MAX_SINGLE_ALLOC - 1)
+                       break;
+
                sg = sg_chain_ptr(sg + SG_MAX_SINGLE_ALLOC - 1);
                n -= SG_MAX_SINGLE_ALLOC - 1;
+               nents -= SG_MAX_SINGLE_ALLOC - 1;
        }
        return sg_page(sg+n);
 }
@@ -1427,7 +1432,7 @@ int __must_check i915_gpu_idle(struct drm_device *dev);
 int __must_check i915_gem_idle(struct drm_device *dev);
 int i915_add_request(struct intel_ring_buffer *ring,
                     struct drm_file *file,
-                    struct drm_i915_gem_request *request);
+                    u32 *seqno);
 int __must_check i915_wait_seqno(struct intel_ring_buffer *ring,
                                 uint32_t seqno);
 int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
index 19dbdd7dd5648e93b48062c54fd9bc3f6100e425..d33d02d13c9678a7dd64b1fb4c9e9c5f9682d223 100644 (file)
@@ -1955,11 +1955,12 @@ i915_gem_next_request_seqno(struct intel_ring_buffer *ring)
 int
 i915_add_request(struct intel_ring_buffer *ring,
                 struct drm_file *file,
-                struct drm_i915_gem_request *request)
+                u32 *out_seqno)
 {
        drm_i915_private_t *dev_priv = ring->dev->dev_private;
-       uint32_t seqno;
+       struct drm_i915_gem_request *request;
        u32 request_ring_position;
+       u32 seqno;
        int was_empty;
        int ret;
 
@@ -1974,11 +1975,9 @@ i915_add_request(struct intel_ring_buffer *ring,
        if (ret)
                return ret;
 
-       if (request == NULL) {
-               request = kmalloc(sizeof(*request), GFP_KERNEL);
-               if (request == NULL)
-                       return -ENOMEM;
-       }
+       request = kmalloc(sizeof(*request), GFP_KERNEL);
+       if (request == NULL)
+               return -ENOMEM;
 
        seqno = i915_gem_next_request_seqno(ring);
 
@@ -2030,6 +2029,8 @@ i915_add_request(struct intel_ring_buffer *ring,
                }
        }
 
+       if (out_seqno)
+               *out_seqno = seqno;
        return 0;
 }
 
@@ -3959,6 +3960,9 @@ i915_gem_init_hw(struct drm_device *dev)
        if (!intel_enable_gtt())
                return -EIO;
 
+       if (IS_HASWELL(dev) && (I915_READ(0x120010) == 1))
+               I915_WRITE(0x9008, I915_READ(0x9008) | 0xf0000);
+
        i915_gem_l3_remap(dev);
 
        i915_gem_init_swizzling(dev);
@@ -4098,7 +4102,6 @@ i915_gem_entervt_ioctl(struct drm_device *dev, void *data,
        }
 
        BUG_ON(!list_empty(&dev_priv->mm.active_list));
-       BUG_ON(!list_empty(&dev_priv->mm.inactive_list));
        mutex_unlock(&dev->struct_mutex);
 
        ret = drm_irq_install(dev);
index 64c1be0a9cfdb033ab33e66da2463b8b28fc8ffb..a4162ddff6c5e0e38c3c7b298aa4806d02bcb992 100644 (file)
  */
 # define _3D_CHICKEN2_WM_READ_PIPELINED                        (1 << 14)
 #define _3D_CHICKEN3   0x02090
-#define  _3D_CHICKEN_SF_DISABLE_FASTCLIP_CULL          (1 << 5)
+#define  _3D_CHICKEN3_SF_DISABLE_FASTCLIP_CULL         (1 << 5)
 
 #define MI_MODE                0x0209c
 # define VS_TIMER_DISPATCH                             (1 << 6)
index 2b6ce9b2674a9d899dd34a6e2b6e2622dc08c631..682bd3729baf62369fc66d23434f058a643ffc78 100644 (file)
@@ -3253,6 +3253,16 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
 
        if (HAS_PCH_CPT(dev))
                intel_cpt_verify_modeset(dev, intel_crtc->pipe);
+
+       /*
+        * There seems to be a race in PCH platform hw (at least on some
+        * outputs) where an enabled pipe still completes any pageflip right
+        * away (as if the pipe is off) instead of waiting for vblank. As soon
+        * as the first vblank happend, everything works as expected. Hence just
+        * wait for one vblank before returning to avoid strange things
+        * happening.
+        */
+       intel_wait_for_vblank(dev, intel_crtc->pipe);
 }
 
 static void ironlake_crtc_disable(struct drm_crtc *crtc)
@@ -7892,8 +7902,7 @@ static struct intel_quirk intel_quirks[] = {
        /* ThinkPad T60 needs pipe A force quirk (bug #16494) */
        { 0x2782, 0x17aa, 0x201a, quirk_pipea_force },
 
-       /* 855 & before need to leave pipe A & dpll A up */
-       { 0x3582, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force },
+       /* 830/845 need to leave pipe A & dpll A up */
        { 0x2562, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force },
        { 0x3577, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force },
 
@@ -8049,29 +8058,42 @@ static void intel_enable_pipe_a(struct drm_device *dev)
 
 }
 
+static bool
+intel_check_plane_mapping(struct intel_crtc *crtc)
+{
+       struct drm_i915_private *dev_priv = crtc->base.dev->dev_private;
+       u32 reg, val;
+
+       if (dev_priv->num_pipe == 1)
+               return true;
+
+       reg = DSPCNTR(!crtc->plane);
+       val = I915_READ(reg);
+
+       if ((val & DISPLAY_PLANE_ENABLE) &&
+           (!!(val & DISPPLANE_SEL_PIPE_MASK) == crtc->pipe))
+               return false;
+
+       return true;
+}
+
 static void intel_sanitize_crtc(struct intel_crtc *crtc)
 {
        struct drm_device *dev = crtc->base.dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
-       u32 reg, val;
+       u32 reg;
 
        /* Clear any frame start delays used for debugging left by the BIOS */
        reg = PIPECONF(crtc->pipe);
        I915_WRITE(reg, I915_READ(reg) & ~PIPECONF_FRAME_START_DELAY_MASK);
 
        /* We need to sanitize the plane -> pipe mapping first because this will
-        * disable the crtc (and hence change the state) if it is wrong. */
-       if (!HAS_PCH_SPLIT(dev)) {
+        * disable the crtc (and hence change the state) if it is wrong. Note
+        * that gen4+ has a fixed plane -> pipe mapping.  */
+       if (INTEL_INFO(dev)->gen < 4 && !intel_check_plane_mapping(crtc)) {
                struct intel_connector *connector;
                bool plane;
 
-               reg = DSPCNTR(crtc->plane);
-               val = I915_READ(reg);
-
-               if ((val & DISPLAY_PLANE_ENABLE) == 0 &&
-                   (!!(val & DISPPLANE_SEL_PIPE_MASK) == crtc->pipe))
-                       goto ok;
-
                DRM_DEBUG_KMS("[CRTC:%d] wrong plane connection detected!\n",
                              crtc->base.base.id);
 
@@ -8095,7 +8117,6 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
                WARN_ON(crtc->active);
                crtc->base.enabled = false;
        }
-ok:
 
        if (dev_priv->quirks & QUIRK_PIPEA_FORCE &&
            crtc->pipe == PIPE_A && !crtc->active) {
index d1e8ddb2d6c0801e42a25c30e1eb66c29fb80150..1b727a5c9ee5680364343be93e15203df42e2369 100644 (file)
@@ -2369,8 +2369,9 @@ static void
 intel_dp_destroy(struct drm_connector *connector)
 {
        struct drm_device *dev = connector->dev;
+       struct intel_dp *intel_dp = intel_attached_dp(connector);
 
-       if (intel_dpd_is_edp(dev))
+       if (is_edp(intel_dp))
                intel_panel_destroy_backlight(dev);
 
        drm_sysfs_connector_remove(connector);
index ebff850a9ab6ff8f7b35c17fced205be45d84205..495625914e4a084f01f476d93524bed83db7ac42 100644 (file)
@@ -209,7 +209,6 @@ static void intel_overlay_unmap_regs(struct intel_overlay *overlay,
 }
 
 static int intel_overlay_do_wait_request(struct intel_overlay *overlay,
-                                        struct drm_i915_gem_request *request,
                                         void (*tail)(struct intel_overlay *))
 {
        struct drm_device *dev = overlay->dev;
@@ -218,12 +217,10 @@ static int intel_overlay_do_wait_request(struct intel_overlay *overlay,
        int ret;
 
        BUG_ON(overlay->last_flip_req);
-       ret = i915_add_request(ring, NULL, request);
-       if (ret) {
-           kfree(request);
-           return ret;
-       }
-       overlay->last_flip_req = request->seqno;
+       ret = i915_add_request(ring, NULL, &overlay->last_flip_req);
+       if (ret)
+               return ret;
+
        overlay->flip_tail = tail;
        ret = i915_wait_seqno(ring, overlay->last_flip_req);
        if (ret)
@@ -240,7 +237,6 @@ static int intel_overlay_on(struct intel_overlay *overlay)
        struct drm_device *dev = overlay->dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct intel_ring_buffer *ring = &dev_priv->ring[RCS];
-       struct drm_i915_gem_request *request;
        int ret;
 
        BUG_ON(overlay->active);
@@ -248,17 +244,9 @@ static int intel_overlay_on(struct intel_overlay *overlay)
 
        WARN_ON(IS_I830(dev) && !(dev_priv->quirks & QUIRK_PIPEA_FORCE));
 
-       request = kzalloc(sizeof(*request), GFP_KERNEL);
-       if (request == NULL) {
-               ret = -ENOMEM;
-               goto out;
-       }
-
        ret = intel_ring_begin(ring, 4);
-       if (ret) {
-               kfree(request);
-               goto out;
-       }
+       if (ret)
+               return ret;
 
        intel_ring_emit(ring, MI_OVERLAY_FLIP | MI_OVERLAY_ON);
        intel_ring_emit(ring, overlay->flip_addr | OFC_UPDATE);
@@ -266,9 +254,7 @@ static int intel_overlay_on(struct intel_overlay *overlay)
        intel_ring_emit(ring, MI_NOOP);
        intel_ring_advance(ring);
 
-       ret = intel_overlay_do_wait_request(overlay, request, NULL);
-out:
-       return ret;
+       return intel_overlay_do_wait_request(overlay, NULL);
 }
 
 /* overlay needs to be enabled in OCMD reg */
@@ -278,17 +264,12 @@ static int intel_overlay_continue(struct intel_overlay *overlay,
        struct drm_device *dev = overlay->dev;
        drm_i915_private_t *dev_priv = dev->dev_private;
        struct intel_ring_buffer *ring = &dev_priv->ring[RCS];
-       struct drm_i915_gem_request *request;
        u32 flip_addr = overlay->flip_addr;
        u32 tmp;
        int ret;
 
        BUG_ON(!overlay->active);
 
-       request = kzalloc(sizeof(*request), GFP_KERNEL);
-       if (request == NULL)
-               return -ENOMEM;
-
        if (load_polyphase_filter)
                flip_addr |= OFC_UPDATE;
 
@@ -298,22 +279,14 @@ static int intel_overlay_continue(struct intel_overlay *overlay,
                DRM_DEBUG("overlay underrun, DOVSTA: %x\n", tmp);
 
        ret = intel_ring_begin(ring, 2);
-       if (ret) {
-               kfree(request);
+       if (ret)
                return ret;
-       }
+
        intel_ring_emit(ring, MI_OVERLAY_FLIP | MI_OVERLAY_CONTINUE);
        intel_ring_emit(ring, flip_addr);
        intel_ring_advance(ring);
 
-       ret = i915_add_request(ring, NULL, request);
-       if (ret) {
-               kfree(request);
-               return ret;
-       }
-
-       overlay->last_flip_req = request->seqno;
-       return 0;
+       return i915_add_request(ring, NULL, &overlay->last_flip_req);
 }
 
 static void intel_overlay_release_old_vid_tail(struct intel_overlay *overlay)
@@ -349,15 +322,10 @@ static int intel_overlay_off(struct intel_overlay *overlay)
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct intel_ring_buffer *ring = &dev_priv->ring[RCS];
        u32 flip_addr = overlay->flip_addr;
-       struct drm_i915_gem_request *request;
        int ret;
 
        BUG_ON(!overlay->active);
 
-       request = kzalloc(sizeof(*request), GFP_KERNEL);
-       if (request == NULL)
-               return -ENOMEM;
-
        /* According to intel docs the overlay hw may hang (when switching
         * off) without loading the filter coeffs. It is however unclear whether
         * this applies to the disabling of the overlay or to the switching off
@@ -365,10 +333,9 @@ static int intel_overlay_off(struct intel_overlay *overlay)
        flip_addr |= OFC_UPDATE;
 
        ret = intel_ring_begin(ring, 6);
-       if (ret) {
-               kfree(request);
+       if (ret)
                return ret;
-       }
+
        /* wait for overlay to go idle */
        intel_ring_emit(ring, MI_OVERLAY_FLIP | MI_OVERLAY_CONTINUE);
        intel_ring_emit(ring, flip_addr);
@@ -379,8 +346,7 @@ static int intel_overlay_off(struct intel_overlay *overlay)
        intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);
        intel_ring_advance(ring);
 
-       return intel_overlay_do_wait_request(overlay, request,
-                                            intel_overlay_off_tail);
+       return intel_overlay_do_wait_request(overlay, intel_overlay_off_tail);
 }
 
 /* recover from an interruption due to a signal
@@ -425,24 +391,16 @@ static int intel_overlay_release_old_vid(struct intel_overlay *overlay)
                return 0;
 
        if (I915_READ(ISR) & I915_OVERLAY_PLANE_FLIP_PENDING_INTERRUPT) {
-               struct drm_i915_gem_request *request;
-
                /* synchronous slowpath */
-               request = kzalloc(sizeof(*request), GFP_KERNEL);
-               if (request == NULL)
-                       return -ENOMEM;
-
                ret = intel_ring_begin(ring, 2);
-               if (ret) {
-                       kfree(request);
+               if (ret)
                        return ret;
-               }
 
                intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);
                intel_ring_emit(ring, MI_NOOP);
                intel_ring_advance(ring);
 
-               ret = intel_overlay_do_wait_request(overlay, request,
+               ret = intel_overlay_do_wait_request(overlay,
                                                    intel_overlay_release_old_vid_tail);
                if (ret)
                        return ret;
index b3b4b6cea8b001e4c31e79604fe56015a1bcae11..72f41aaa71ff330637bdc82d4ee8e0c04091bdf2 100644 (file)
@@ -3442,8 +3442,8 @@ static void gen6_init_clock_gating(struct drm_device *dev)
                   GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
 
        /* Bspec says we need to always set all mask bits. */
-       I915_WRITE(_3D_CHICKEN, (0xFFFF << 16) |
-                  _3D_CHICKEN_SF_DISABLE_FASTCLIP_CULL);
+       I915_WRITE(_3D_CHICKEN3, (0xFFFF << 16) |
+                  _3D_CHICKEN3_SF_DISABLE_FASTCLIP_CULL);
 
        /*
         * According to the spec the following bits should be
index 9ed6e728a94c920ef870ea35d516f0a79863309a..7d750382a833c33b64fbbf40c98a1d8f936399e2 100644 (file)
@@ -43,7 +43,7 @@ dcb_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
        *ver = nv_ro08(bios, dcb);
 
        if (*ver >= 0x41) {
-               nv_warn(bios, "DCB *ver 0x%02x unknown\n", *ver);
+               nv_warn(bios, "DCB version 0x%02x unknown\n", *ver);
                return 0x0000;
        } else
        if (*ver >= 0x30) {
index 436e9efe7ef5d862c047a308b77d394c10238118..42d7539e65250d239a9e7f8c65efd68855b76c90 100644 (file)
@@ -277,7 +277,6 @@ nv50_fb_dtor(struct nouveau_object *object)
                __free_page(priv->r100c08_page);
        }
 
-       nouveau_mm_fini(&priv->base.vram);
        nouveau_fb_destroy(&priv->base);
 }
 
index b29237970fa082ba3cdc5dcd9497e5d7bbe0714b..5231786851805da5e68840668a29db856f56cdb6 100644 (file)
@@ -134,7 +134,7 @@ nouveau_therm_fan_sense(struct nouveau_therm *therm)
        end = ptimer->read(ptimer);
 
        if (cycles == 5) {
-               tach = (u64)60000000000;
+               tach = (u64)60000000000ULL;
                do_div(tach, (end - start));
                return tach;
        } else
index 259e5f1adf4754ba270b22f8d32cc992695a28be..35ac57f0aab640c034b29cc15c8ca0315d1f8ec5 100644 (file)
@@ -456,6 +456,7 @@ static struct ttm_tt *
 nouveau_ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size,
                      uint32_t page_flags, struct page *dummy_read)
 {
+#if __OS_HAS_AGP
        struct nouveau_drm *drm = nouveau_bdev(bdev);
        struct drm_device *dev = drm->dev;
 
@@ -463,6 +464,7 @@ nouveau_ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size,
                return ttm_agp_tt_create(bdev, dev->agp->bridge, size,
                                         page_flags, dummy_read);
        }
+#endif
 
        return nouveau_sgdma_create_ttm(bdev, size, page_flags, dummy_read);
 }
index 0bf64c90aa206cc42879e2621a8da1f5481e7f4d..5566172774df4b2ff891db4745483b8655754a5b 100644 (file)
@@ -52,7 +52,7 @@ nouveau_pm_perflvl_aux(struct drm_device *dev, struct nouveau_pm_level *perflvl,
 {
        struct nouveau_drm *drm = nouveau_drm(dev);
        struct nouveau_pm *pm = nouveau_pm(dev);
-       struct nouveau_therm *therm = nouveau_therm(drm);
+       struct nouveau_therm *therm = nouveau_therm(drm->device);
        int ret;
 
        /*XXX: not on all boards, we should control based on temperature
@@ -64,7 +64,6 @@ nouveau_pm_perflvl_aux(struct drm_device *dev, struct nouveau_pm_level *perflvl,
                ret = therm->fan_set(therm, perflvl->fanspeed);
                if (ret && ret != -ENODEV) {
                        NV_ERROR(drm, "fanspeed set failed: %d\n", ret);
-                       return ret;
                }
        }
 
@@ -706,8 +705,7 @@ nouveau_hwmon_init(struct drm_device *dev)
        struct device *hwmon_dev;
        int ret = 0;
 
-       if (!therm || !therm->temp_get || !therm->attr_get ||
-               !therm->attr_set || therm->temp_get(therm) < 0)
+       if (!therm || !therm->temp_get || !therm->attr_get || !therm->attr_set)
                return -ENODEV;
 
        hwmon_dev = hwmon_device_register(&dev->pdev->dev);
index 96184d02c8d924969527c307d137a55664c6f96c..2e566e123e9e747e988f7482a3a5b827b7ca121f 100644 (file)
@@ -1690,10 +1690,10 @@ static int radeon_atom_pick_pll(struct drm_crtc *crtc)
                }
                /* all other cases */
                pll_in_use = radeon_get_pll_use_mask(crtc);
-               if (!(pll_in_use & (1 << ATOM_PPLL2)))
-                       return ATOM_PPLL2;
                if (!(pll_in_use & (1 << ATOM_PPLL1)))
                        return ATOM_PPLL1;
+               if (!(pll_in_use & (1 << ATOM_PPLL2)))
+                       return ATOM_PPLL2;
                DRM_ERROR("unable to allocate a PPLL\n");
                return ATOM_PPLL_INVALID;
        } else {
@@ -1715,10 +1715,10 @@ static int radeon_atom_pick_pll(struct drm_crtc *crtc)
                        }
                        /* all other cases */
                        pll_in_use = radeon_get_pll_use_mask(crtc);
-                       if (!(pll_in_use & (1 << ATOM_PPLL2)))
-                               return ATOM_PPLL2;
                        if (!(pll_in_use & (1 << ATOM_PPLL1)))
                                return ATOM_PPLL1;
+                       if (!(pll_in_use & (1 << ATOM_PPLL2)))
+                               return ATOM_PPLL2;
                        DRM_ERROR("unable to allocate a PPLL\n");
                        return ATOM_PPLL_INVALID;
                } else {
index a1f49c5fd74b2ce287f0fe2786434853779fa033..14313ad43b7680f28b322b913997cf653242bb07 100644 (file)
@@ -3431,9 +3431,14 @@ void evergreen_pcie_gen2_enable(struct radeon_device *rdev)
        if (!(mask & DRM_PCIE_SPEED_50))
                return;
 
+       speed_cntl = RREG32_PCIE_P(PCIE_LC_SPEED_CNTL);
+       if (speed_cntl & LC_CURRENT_DATA_RATE) {
+               DRM_INFO("PCIE gen 2 link speeds already enabled\n");
+               return;
+       }
+
        DRM_INFO("enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0\n");
 
-       speed_cntl = RREG32_PCIE_P(PCIE_LC_SPEED_CNTL);
        if ((speed_cntl & LC_OTHER_SIDE_EVER_SENT_GEN2) ||
            (speed_cntl & LC_OTHER_SIDE_SUPPORTS_GEN2)) {
 
index 8bcb554ea0c527126d7b4a618c2b53d504ecf7ff..8c74c729586db21185e54465d23289a15bc4d979 100644 (file)
@@ -770,9 +770,13 @@ static int cayman_pcie_gart_enable(struct radeon_device *rdev)
        WREG32(0x15DC, 0);
 
        /* empty context1-7 */
+       /* Assign the pt base to something valid for now; the pts used for
+        * the VMs are determined by the application and setup and assigned
+        * on the fly in the vm part of radeon_gart.c
+        */
        for (i = 1; i < 8; i++) {
                WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR + (i << 2), 0);
-               WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR + (i << 2), 0);
+               WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR + (i << 2), rdev->vm_manager.max_pfn);
                WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (i << 2),
                        rdev->gart.table_addr >> 12);
        }
@@ -1572,12 +1576,6 @@ void cayman_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm)
        if (vm == NULL)
                return;
 
-       radeon_ring_write(ring, PACKET0(VM_CONTEXT0_PAGE_TABLE_START_ADDR + (vm->id << 2), 0));
-       radeon_ring_write(ring, 0);
-
-       radeon_ring_write(ring, PACKET0(VM_CONTEXT0_PAGE_TABLE_END_ADDR + (vm->id << 2), 0));
-       radeon_ring_write(ring, vm->last_pfn);
-
        radeon_ring_write(ring, PACKET0(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (vm->id << 2), 0));
        radeon_ring_write(ring, vm->pd_gpu_addr >> 12);
 
index 70c800ff61901ba6a30d0e714491cc9ccc190d3b..cda280d157da95725b414f54ebcc5cce9f78b7fc 100644 (file)
@@ -3703,6 +3703,12 @@ static void r600_pcie_gen2_enable(struct radeon_device *rdev)
        if (!(mask & DRM_PCIE_SPEED_50))
                return;
 
+       speed_cntl = RREG32_PCIE_P(PCIE_LC_SPEED_CNTL);
+       if (speed_cntl & LC_CURRENT_DATA_RATE) {
+               DRM_INFO("PCIE gen 2 link speeds already enabled\n");
+               return;
+       }
+
        DRM_INFO("enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0\n");
 
        /* 55 nm r6xx asics */
index b04c06444d8b13b21107e87a842603714f569001..8c42d54c2e26ad56ce7d0c7873128f466e60b801 100644 (file)
@@ -663,9 +663,14 @@ struct radeon_vm {
        struct list_head                list;
        struct list_head                va;
        unsigned                        id;
-       unsigned                        last_pfn;
-       u64                             pd_gpu_addr;
-       struct radeon_sa_bo             *sa_bo;
+
+       /* contains the page directory */
+       struct radeon_sa_bo             *page_directory;
+       uint64_t                        pd_gpu_addr;
+
+       /* array of page tables, one for each page directory entry */
+       struct radeon_sa_bo             **page_tables;
+
        struct mutex                    mutex;
        /* last fence for cs using this vm */
        struct radeon_fence             *fence;
@@ -1843,9 +1848,10 @@ extern void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size
  */
 int radeon_vm_manager_init(struct radeon_device *rdev);
 void radeon_vm_manager_fini(struct radeon_device *rdev);
-int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm);
+void radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm);
 void radeon_vm_fini(struct radeon_device *rdev, struct radeon_vm *vm);
 int radeon_vm_alloc_pt(struct radeon_device *rdev, struct radeon_vm *vm);
+void radeon_vm_add_to_lru(struct radeon_device *rdev, struct radeon_vm *vm);
 struct radeon_fence *radeon_vm_grab_id(struct radeon_device *rdev,
                                       struct radeon_vm *vm, int ring);
 void radeon_vm_fence(struct radeon_device *rdev,
index b0a5688c67f8c98d91340551207979b810a33fed..196d28d995705f408fe817a08093abad3e370626 100644 (file)
@@ -201,7 +201,7 @@ static int radeon_atif_verify_interface(acpi_handle handle,
 
        size = *(u16 *) info->buffer.pointer;
        if (size < 12) {
-               DRM_INFO("ATIF buffer is too small: %lu\n", size);
+               DRM_INFO("ATIF buffer is too small: %zu\n", size);
                err = -EINVAL;
                goto out;
        }
@@ -370,6 +370,7 @@ int radeon_atif_handler(struct radeon_device *rdev,
 
                        radeon_set_backlight_level(rdev, enc, req.backlight_level);
 
+#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
                        if (rdev->is_atom_bios) {
                                struct radeon_encoder_atom_dig *dig = enc->enc_priv;
                                backlight_force_update(dig->bl_dev,
@@ -379,6 +380,7 @@ int radeon_atif_handler(struct radeon_device *rdev,
                                backlight_force_update(dig->bl_dev,
                                                       BACKLIGHT_UPDATE_HOTKEY);
                        }
+#endif
                }
        }
        /* TODO: check other events */
@@ -485,7 +487,7 @@ static int radeon_atcs_verify_interface(acpi_handle handle,
 
        size = *(u16 *) info->buffer.pointer;
        if (size < 8) {
-               DRM_INFO("ATCS buffer is too small: %lu\n", size);
+               DRM_INFO("ATCS buffer is too small: %zu\n", size);
                err = -EINVAL;
                goto out;
        }
index 582e99449c12f28a01482dfc3138bf2ec1ead2d8..1aa3f910b99328e9f3de367859742bb57722732b 100644 (file)
@@ -148,7 +148,7 @@ static int radeon_atpx_verify_interface(struct radeon_atpx *atpx)
 
        size = *(u16 *) info->buffer.pointer;
        if (size < 8) {
-               printk("ATPX buffer is too small: %lu\n", size);
+               printk("ATPX buffer is too small: %zu\n", size);
                err = -EINVAL;
                goto out;
        }
index cb7b7c062fef407d0dbbb0a1e6c0c50e7d930690..41672cc563fb13005bc732d581844d9811473047 100644 (file)
@@ -478,6 +478,7 @@ static int radeon_cs_ib_vm_chunk(struct radeon_device *rdev,
        }
 
 out:
+       radeon_vm_add_to_lru(rdev, vm);
        mutex_unlock(&vm->mutex);
        mutex_unlock(&rdev->vm_manager.lock);
        return r;
index 64a42647f08a43cacdabd7a76bc7b52dde6c762b..bd13ca09eb626efcc2c312ef68569ffcf7655db9 100644 (file)
@@ -1018,6 +1018,10 @@ int radeon_device_init(struct radeon_device *rdev,
                return r;
        /* initialize vm here */
        mutex_init(&rdev->vm_manager.lock);
+       /* Adjust VM size here.
+        * Currently set to 4GB ((1 << 20) 4k pages).
+        * Max GPUVM size for cayman and SI is 40 bits.
+        */
        rdev->vm_manager.max_pfn = 1 << 20;
        INIT_LIST_HEAD(&rdev->vm_manager.lru_vm);
 
index f0c06d196b752379712acaefb44f0aa537fa0cee..a7677dd1ce98573121a395643b31a57480e60c76 100644 (file)
@@ -422,6 +422,18 @@ void radeon_gart_fini(struct radeon_device *rdev)
  * TODO bind a default page at vm initialization for default address
  */
 
+/**
+ * radeon_vm_num_pde - return the number of page directory entries
+ *
+ * @rdev: radeon_device pointer
+ *
+ * Calculate the number of page directory entries (cayman+).
+ */
+static unsigned radeon_vm_num_pdes(struct radeon_device *rdev)
+{
+       return rdev->vm_manager.max_pfn >> RADEON_VM_BLOCK_SIZE;
+}
+
 /**
  * radeon_vm_directory_size - returns the size of the page directory in bytes
  *
@@ -431,7 +443,7 @@ void radeon_gart_fini(struct radeon_device *rdev)
  */
 static unsigned radeon_vm_directory_size(struct radeon_device *rdev)
 {
-       return (rdev->vm_manager.max_pfn >> RADEON_VM_BLOCK_SIZE) * 8;
+       return RADEON_GPU_PAGE_ALIGN(radeon_vm_num_pdes(rdev) * 8);
 }
 
 /**
@@ -451,11 +463,11 @@ int radeon_vm_manager_init(struct radeon_device *rdev)
 
        if (!rdev->vm_manager.enabled) {
                /* allocate enough for 2 full VM pts */
-               size = RADEON_GPU_PAGE_ALIGN(radeon_vm_directory_size(rdev));
-               size += RADEON_GPU_PAGE_ALIGN(rdev->vm_manager.max_pfn * 8);
+               size = radeon_vm_directory_size(rdev);
+               size += rdev->vm_manager.max_pfn * 8;
                size *= 2;
                r = radeon_sa_bo_manager_init(rdev, &rdev->vm_manager.sa_manager,
-                                             size,
+                                             RADEON_GPU_PAGE_ALIGN(size),
                                              RADEON_GEM_DOMAIN_VRAM);
                if (r) {
                        dev_err(rdev->dev, "failed to allocate vm bo (%dKB)\n",
@@ -476,7 +488,7 @@ int radeon_vm_manager_init(struct radeon_device *rdev)
 
        /* restore page table */
        list_for_each_entry(vm, &rdev->vm_manager.lru_vm, list) {
-               if (vm->sa_bo == NULL)
+               if (vm->page_directory == NULL)
                        continue;
 
                list_for_each_entry(bo_va, &vm->va, vm_list) {
@@ -500,16 +512,25 @@ static void radeon_vm_free_pt(struct radeon_device *rdev,
                                    struct radeon_vm *vm)
 {
        struct radeon_bo_va *bo_va;
+       int i;
 
-       if (!vm->sa_bo)
+       if (!vm->page_directory)
                return;
 
        list_del_init(&vm->list);
-       radeon_sa_bo_free(rdev, &vm->sa_bo, vm->fence);
+       radeon_sa_bo_free(rdev, &vm->page_directory, vm->fence);
 
        list_for_each_entry(bo_va, &vm->va, vm_list) {
                bo_va->valid = false;
        }
+
+       if (vm->page_tables == NULL)
+               return;
+
+       for (i = 0; i < radeon_vm_num_pdes(rdev); i++)
+               radeon_sa_bo_free(rdev, &vm->page_tables[i], vm->fence);
+
+       kfree(vm->page_tables);
 }
 
 /**
@@ -545,6 +566,35 @@ void radeon_vm_manager_fini(struct radeon_device *rdev)
        rdev->vm_manager.enabled = false;
 }
 
+/**
+ * radeon_vm_evict - evict page table to make room for new one
+ *
+ * @rdev: radeon_device pointer
+ * @vm: VM we want to allocate something for
+ *
+ * Evict a VM from the lru, making sure that it isn't @vm. (cayman+).
+ * Returns 0 for success, -ENOMEM for failure.
+ *
+ * Global and local mutex must be locked!
+ */
+int radeon_vm_evict(struct radeon_device *rdev, struct radeon_vm *vm)
+{
+       struct radeon_vm *vm_evict;
+
+       if (list_empty(&rdev->vm_manager.lru_vm))
+               return -ENOMEM;
+
+       vm_evict = list_first_entry(&rdev->vm_manager.lru_vm,
+                                   struct radeon_vm, list);
+       if (vm_evict == vm)
+               return -ENOMEM;
+
+       mutex_lock(&vm_evict->mutex);
+       radeon_vm_free_pt(rdev, vm_evict);
+       mutex_unlock(&vm_evict->mutex);
+       return 0;
+}
+
 /**
  * radeon_vm_alloc_pt - allocates a page table for a VM
  *
@@ -552,57 +602,71 @@ void radeon_vm_manager_fini(struct radeon_device *rdev)
  * @vm: vm to bind
  *
  * Allocate a page table for the requested vm (cayman+).
- * Also starts to populate the page table.
  * Returns 0 for success, error for failure.
  *
  * Global and local mutex must be locked!
  */
 int radeon_vm_alloc_pt(struct radeon_device *rdev, struct radeon_vm *vm)
 {
-       struct radeon_vm *vm_evict;
-       int r;
+       unsigned pd_size, pts_size;
        u64 *pd_addr;
-       int tables_size;
+       int r;
 
        if (vm == NULL) {
                return -EINVAL;
        }
 
-       /* allocate enough to cover the current VM size */
-       tables_size = RADEON_GPU_PAGE_ALIGN(radeon_vm_directory_size(rdev));
-       tables_size += RADEON_GPU_PAGE_ALIGN(vm->last_pfn * 8);
-
-       if (vm->sa_bo != NULL) {
-               /* update lru */
-               list_del_init(&vm->list);
-               list_add_tail(&vm->list, &rdev->vm_manager.lru_vm);
+       if (vm->page_directory != NULL) {
                return 0;
        }
 
 retry:
-       r = radeon_sa_bo_new(rdev, &rdev->vm_manager.sa_manager, &vm->sa_bo,
-                            tables_size, RADEON_GPU_PAGE_SIZE, false);
+       pd_size = RADEON_GPU_PAGE_ALIGN(radeon_vm_directory_size(rdev));
+       r = radeon_sa_bo_new(rdev, &rdev->vm_manager.sa_manager,
+                            &vm->page_directory, pd_size,
+                            RADEON_GPU_PAGE_SIZE, false);
        if (r == -ENOMEM) {
-               if (list_empty(&rdev->vm_manager.lru_vm)) {
+               r = radeon_vm_evict(rdev, vm);
+               if (r)
                        return r;
-               }
-               vm_evict = list_first_entry(&rdev->vm_manager.lru_vm, struct radeon_vm, list);
-               mutex_lock(&vm_evict->mutex);
-               radeon_vm_free_pt(rdev, vm_evict);
-               mutex_unlock(&vm_evict->mutex);
                goto retry;
 
        } else if (r) {
                return r;
        }
 
-       pd_addr = radeon_sa_bo_cpu_addr(vm->sa_bo);
-       vm->pd_gpu_addr = radeon_sa_bo_gpu_addr(vm->sa_bo);
-       memset(pd_addr, 0, tables_size);
+       vm->pd_gpu_addr = radeon_sa_bo_gpu_addr(vm->page_directory);
+
+       /* Initially clear the page directory */
+       pd_addr = radeon_sa_bo_cpu_addr(vm->page_directory);
+       memset(pd_addr, 0, pd_size);
+
+       pts_size = radeon_vm_num_pdes(rdev) * sizeof(struct radeon_sa_bo *);
+       vm->page_tables = kzalloc(pts_size, GFP_KERNEL);
+
+       if (vm->page_tables == NULL) {
+               DRM_ERROR("Cannot allocate memory for page table array\n");
+               radeon_sa_bo_free(rdev, &vm->page_directory, vm->fence);
+               return -ENOMEM;
+       }
+
+       return 0;
+}
 
+/**
+ * radeon_vm_add_to_lru - add VMs page table to LRU list
+ *
+ * @rdev: radeon_device pointer
+ * @vm: vm to add to LRU
+ *
+ * Add the allocated page table to the LRU list (cayman+).
+ *
+ * Global mutex must be locked!
+ */
+void radeon_vm_add_to_lru(struct radeon_device *rdev, struct radeon_vm *vm)
+{
+       list_del_init(&vm->list);
        list_add_tail(&vm->list, &rdev->vm_manager.lru_vm);
-       return radeon_vm_bo_update_pte(rdev, vm, rdev->ring_tmp_bo.bo,
-                                      &rdev->ring_tmp_bo.bo->tbo.mem);
 }
 
 /**
@@ -793,20 +857,6 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
        }
 
        mutex_lock(&vm->mutex);
-       if (last_pfn > vm->last_pfn) {
-               /* release mutex and lock in right order */
-               mutex_unlock(&vm->mutex);
-               mutex_lock(&rdev->vm_manager.lock);
-               mutex_lock(&vm->mutex);
-               /* and check again */
-               if (last_pfn > vm->last_pfn) {
-                       /* grow va space 32M by 32M */
-                       unsigned align = ((32 << 20) >> 12) - 1;
-                       radeon_vm_free_pt(rdev, vm);
-                       vm->last_pfn = (last_pfn + align) & ~align;
-               }
-               mutex_unlock(&rdev->vm_manager.lock);
-       }
        head = &vm->va;
        last_offset = 0;
        list_for_each_entry(tmp, &vm->va, vm_list) {
@@ -864,6 +914,155 @@ uint64_t radeon_vm_map_gart(struct radeon_device *rdev, uint64_t addr)
        return result;
 }
 
+/**
+ * radeon_vm_update_pdes - make sure that page directory is valid
+ *
+ * @rdev: radeon_device pointer
+ * @vm: requested vm
+ * @start: start of GPU address range
+ * @end: end of GPU address range
+ *
+ * Allocates new page tables if necessary
+ * and updates the page directory (cayman+).
+ * Returns 0 for success, error for failure.
+ *
+ * Global and local mutex must be locked!
+ */
+static int radeon_vm_update_pdes(struct radeon_device *rdev,
+                                struct radeon_vm *vm,
+                                uint64_t start, uint64_t end)
+{
+       static const uint32_t incr = RADEON_VM_PTE_COUNT * 8;
+
+       uint64_t last_pde = ~0, last_pt = ~0;
+       unsigned count = 0;
+       uint64_t pt_idx;
+       int r;
+
+       start = (start / RADEON_GPU_PAGE_SIZE) >> RADEON_VM_BLOCK_SIZE;
+       end = (end / RADEON_GPU_PAGE_SIZE) >> RADEON_VM_BLOCK_SIZE;
+
+       /* walk over the address space and update the page directory */
+       for (pt_idx = start; pt_idx <= end; ++pt_idx) {
+               uint64_t pde, pt;
+
+               if (vm->page_tables[pt_idx])
+                       continue;
+
+retry:
+               r = radeon_sa_bo_new(rdev, &rdev->vm_manager.sa_manager,
+                                    &vm->page_tables[pt_idx],
+                                    RADEON_VM_PTE_COUNT * 8,
+                                    RADEON_GPU_PAGE_SIZE, false);
+
+               if (r == -ENOMEM) {
+                       r = radeon_vm_evict(rdev, vm);
+                       if (r)
+                               return r;
+                       goto retry;
+               } else if (r) {
+                       return r;
+               }
+
+               pde = vm->pd_gpu_addr + pt_idx * 8;
+
+               pt = radeon_sa_bo_gpu_addr(vm->page_tables[pt_idx]);
+
+               if (((last_pde + 8 * count) != pde) ||
+                   ((last_pt + incr * count) != pt)) {
+
+                       if (count) {
+                               radeon_asic_vm_set_page(rdev, last_pde,
+                                                       last_pt, count, incr,
+                                                       RADEON_VM_PAGE_VALID);
+                       }
+
+                       count = 1;
+                       last_pde = pde;
+                       last_pt = pt;
+               } else {
+                       ++count;
+               }
+       }
+
+       if (count) {
+               radeon_asic_vm_set_page(rdev, last_pde, last_pt, count,
+                                       incr, RADEON_VM_PAGE_VALID);
+
+       }
+
+       return 0;
+}
+
+/**
+ * radeon_vm_update_ptes - make sure that page tables are valid
+ *
+ * @rdev: radeon_device pointer
+ * @vm: requested vm
+ * @start: start of GPU address range
+ * @end: end of GPU address range
+ * @dst: destination address to map to
+ * @flags: mapping flags
+ *
+ * Update the page tables in the range @start - @end (cayman+).
+ *
+ * Global and local mutex must be locked!
+ */
+static void radeon_vm_update_ptes(struct radeon_device *rdev,
+                                 struct radeon_vm *vm,
+                                 uint64_t start, uint64_t end,
+                                 uint64_t dst, uint32_t flags)
+{
+       static const uint64_t mask = RADEON_VM_PTE_COUNT - 1;
+
+       uint64_t last_pte = ~0, last_dst = ~0;
+       unsigned count = 0;
+       uint64_t addr;
+
+       start = start / RADEON_GPU_PAGE_SIZE;
+       end = end / RADEON_GPU_PAGE_SIZE;
+
+       /* walk over the address space and update the page tables */
+       for (addr = start; addr < end; ) {
+               uint64_t pt_idx = addr >> RADEON_VM_BLOCK_SIZE;
+               unsigned nptes;
+               uint64_t pte;
+
+               if ((addr & ~mask) == (end & ~mask))
+                       nptes = end - addr;
+               else
+                       nptes = RADEON_VM_PTE_COUNT - (addr & mask);
+
+               pte = radeon_sa_bo_gpu_addr(vm->page_tables[pt_idx]);
+               pte += (addr & mask) * 8;
+
+               if (((last_pte + 8 * count) != pte) ||
+                   ((count + nptes) > 1 << 11)) {
+
+                       if (count) {
+                               radeon_asic_vm_set_page(rdev, last_pte,
+                                                       last_dst, count,
+                                                       RADEON_GPU_PAGE_SIZE,
+                                                       flags);
+                       }
+
+                       count = nptes;
+                       last_pte = pte;
+                       last_dst = dst;
+               } else {
+                       count += nptes;
+               }
+
+               addr += nptes;
+               dst += nptes * RADEON_GPU_PAGE_SIZE;
+       }
+
+       if (count) {
+               radeon_asic_vm_set_page(rdev, last_pte, last_dst, count,
+                                       RADEON_GPU_PAGE_SIZE, flags);
+       }
+}
+
 /**
  * radeon_vm_bo_update_pte - map a bo into the vm page table
  *
@@ -887,12 +1086,11 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev,
        struct radeon_semaphore *sem = NULL;
        struct radeon_bo_va *bo_va;
        unsigned nptes, npdes, ndw;
-       uint64_t pe, addr;
-       uint64_t pfn;
+       uint64_t addr;
        int r;
 
        /* nothing to do if vm isn't bound */
-       if (vm->sa_bo == NULL)
+       if (vm->page_directory == NULL)
                return 0;
 
        bo_va = radeon_vm_bo_find(vm, bo);
@@ -939,25 +1137,29 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev,
                }
        }
 
-       /* estimate number of dw needed */
-       /* reserve space for 32-bit padding */
-       ndw = 32;
-
        nptes = radeon_bo_ngpu_pages(bo);
 
-       pfn = (bo_va->soffset / RADEON_GPU_PAGE_SIZE);
+       /* assume two extra pdes in case the mapping overlaps the borders */
+       npdes = (nptes >> RADEON_VM_BLOCK_SIZE) + 2;
 
-       /* handle cases where a bo spans several pdes  */
-       npdes = (ALIGN(pfn + nptes, RADEON_VM_PTE_COUNT) -
-                (pfn & ~(RADEON_VM_PTE_COUNT - 1))) >> RADEON_VM_BLOCK_SIZE;
+       /* estimate number of dw needed */
+       /* semaphore, fence and padding */
+       ndw = 32;
+
+       if (RADEON_VM_BLOCK_SIZE > 11)
+               /* reserve space for one header for every 2k dwords */
+               ndw += (nptes >> 11) * 3;
+       else
+               /* reserve space for one header for
+                   every (1 << BLOCK_SIZE) entries */
+               ndw += (nptes >> RADEON_VM_BLOCK_SIZE) * 3;
 
-       /* reserve space for one header for every 2k dwords */
-       ndw += (nptes >> 11) * 3;
        /* reserve space for pte addresses */
        ndw += nptes * 2;
 
        /* reserve space for one header for every 2k dwords */
        ndw += (npdes >> 11) * 3;
+
        /* reserve space for pde addresses */
        ndw += npdes * 2;
 
@@ -971,22 +1173,14 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev,
                radeon_fence_note_sync(vm->fence, ridx);
        }
 
-       /* update page table entries */
-       pe = vm->pd_gpu_addr;
-       pe += radeon_vm_directory_size(rdev);
-       pe += (bo_va->soffset / RADEON_GPU_PAGE_SIZE) * 8;
-
-       radeon_asic_vm_set_page(rdev, pe, addr, nptes,
-                               RADEON_GPU_PAGE_SIZE, bo_va->flags);
-
-       /* update page directory entries */
-       addr = pe;
-
-       pe = vm->pd_gpu_addr;
-       pe += ((bo_va->soffset / RADEON_GPU_PAGE_SIZE) >> RADEON_VM_BLOCK_SIZE) * 8;
+       r = radeon_vm_update_pdes(rdev, vm, bo_va->soffset, bo_va->eoffset);
+       if (r) {
+               radeon_ring_unlock_undo(rdev, ring);
+               return r;
+       }
 
-       radeon_asic_vm_set_page(rdev, pe, addr, npdes,
-                               RADEON_VM_PTE_COUNT * 8, RADEON_VM_PAGE_VALID);
+       radeon_vm_update_ptes(rdev, vm, bo_va->soffset, bo_va->eoffset,
+                             addr, bo_va->flags);
 
        radeon_fence_unref(&vm->fence);
        r = radeon_fence_emit(rdev, &vm->fence, ridx);
@@ -997,6 +1191,7 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev,
        radeon_ring_unlock_commit(rdev, ring);
        radeon_semaphore_free(rdev, &sem, vm->fence);
        radeon_fence_unref(&vm->last_flush);
+
        return 0;
 }
 
@@ -1056,31 +1251,15 @@ void radeon_vm_bo_invalidate(struct radeon_device *rdev,
  * @rdev: radeon_device pointer
  * @vm: requested vm
  *
- * Init @vm (cayman+).
- * Map the IB pool and any other shared objects into the VM
- * by default as it's used by all VMs.
- * Returns 0 for success, error for failure.
+ * Init @vm fields (cayman+).
  */
-int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm)
+void radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm)
 {
-       struct radeon_bo_va *bo_va;
-       int r;
-
        vm->id = 0;
        vm->fence = NULL;
-       vm->last_pfn = 0;
        mutex_init(&vm->mutex);
        INIT_LIST_HEAD(&vm->list);
        INIT_LIST_HEAD(&vm->va);
-
-       /* map the ib pool buffer at 0 in virtual address space, set
-        * read only
-        */
-       bo_va = radeon_vm_bo_add(rdev, vm, rdev->ring_tmp_bo.bo);
-       r = radeon_vm_bo_set_addr(rdev, bo_va, RADEON_VA_IB_OFFSET,
-                                 RADEON_VM_PAGE_READABLE |
-                                 RADEON_VM_PAGE_SNOOPED);
-       return r;
 }
 
 /**
@@ -1102,17 +1281,6 @@ void radeon_vm_fini(struct radeon_device *rdev, struct radeon_vm *vm)
        radeon_vm_free_pt(rdev, vm);
        mutex_unlock(&rdev->vm_manager.lock);
 
-       /* remove all bo at this point non are busy any more because unbind
-        * waited for the last vm fence to signal
-        */
-       r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
-       if (!r) {
-               bo_va = radeon_vm_bo_find(vm, rdev->ring_tmp_bo.bo);
-               list_del_init(&bo_va->bo_list);
-               list_del_init(&bo_va->vm_list);
-               radeon_bo_unreserve(rdev->ring_tmp_bo.bo);
-               kfree(bo_va);
-       }
        if (!list_empty(&vm->va)) {
                dev_err(rdev->dev, "still active bo inside vm\n");
        }
index 83b8d8aa71c0daf541a8da98c28dee949a5d98d4..dc781c49b96b3848c116cb6fe013dd8abd669ddc 100644 (file)
@@ -419,6 +419,7 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
        /* new gpu have virtual address space support */
        if (rdev->family >= CHIP_CAYMAN) {
                struct radeon_fpriv *fpriv;
+               struct radeon_bo_va *bo_va;
                int r;
 
                fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL);
@@ -426,7 +427,15 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
                        return -ENOMEM;
                }
 
-               r = radeon_vm_init(rdev, &fpriv->vm);
+               radeon_vm_init(rdev, &fpriv->vm);
+
+               /* map the ib pool buffer read only into
+                * virtual address space */
+               bo_va = radeon_vm_bo_add(rdev, &fpriv->vm,
+                                        rdev->ring_tmp_bo.bo);
+               r = radeon_vm_bo_set_addr(rdev, bo_va, RADEON_VA_IB_OFFSET,
+                                         RADEON_VM_PAGE_READABLE |
+                                         RADEON_VM_PAGE_SNOOPED);
                if (r) {
                        radeon_vm_fini(rdev, &fpriv->vm);
                        kfree(fpriv);
@@ -454,6 +463,17 @@ void radeon_driver_postclose_kms(struct drm_device *dev,
        /* new gpu have virtual address space support */
        if (rdev->family >= CHIP_CAYMAN && file_priv->driver_priv) {
                struct radeon_fpriv *fpriv = file_priv->driver_priv;
+               struct radeon_bo_va *bo_va;
+               int r;
+
+               r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
+               if (!r) {
+                       bo_va = radeon_vm_bo_find(&fpriv->vm,
+                                                 rdev->ring_tmp_bo.bo);
+                       if (bo_va)
+                               radeon_vm_bo_rmv(rdev, bo_va);
+                       radeon_bo_unreserve(rdev->ring_tmp_bo.bo);
+               }
 
                radeon_vm_fini(rdev, &fpriv->vm);
                kfree(fpriv);
index 92487e614778a93e40d253689ccaf085f019f291..a13ad9d707cfcccdab04d085a62d4be0ab3690df 100644 (file)
@@ -269,27 +269,6 @@ static const struct drm_encoder_helper_funcs radeon_legacy_lvds_helper_funcs = {
        .disable = radeon_legacy_encoder_disable,
 };
 
-#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
-
-static uint8_t radeon_legacy_lvds_level(struct backlight_device *bd)
-{
-       struct radeon_backlight_privdata *pdata = bl_get_data(bd);
-       uint8_t level;
-
-       /* Convert brightness to hardware level */
-       if (bd->props.brightness < 0)
-               level = 0;
-       else if (bd->props.brightness > RADEON_MAX_BL_LEVEL)
-               level = RADEON_MAX_BL_LEVEL;
-       else
-               level = bd->props.brightness;
-
-       if (pdata->negative)
-               level = RADEON_MAX_BL_LEVEL - level;
-
-       return level;
-}
-
 u8
 radeon_legacy_get_backlight_level(struct radeon_encoder *radeon_encoder)
 {
@@ -331,6 +310,27 @@ radeon_legacy_set_backlight_level(struct radeon_encoder *radeon_encoder, u8 leve
        radeon_legacy_lvds_update(&radeon_encoder->base, dpms_mode);
 }
 
+#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
+
+static uint8_t radeon_legacy_lvds_level(struct backlight_device *bd)
+{
+       struct radeon_backlight_privdata *pdata = bl_get_data(bd);
+       uint8_t level;
+
+       /* Convert brightness to hardware level */
+       if (bd->props.brightness < 0)
+               level = 0;
+       else if (bd->props.brightness > RADEON_MAX_BL_LEVEL)
+               level = RADEON_MAX_BL_LEVEL;
+       else
+               level = bd->props.brightness;
+
+       if (pdata->negative)
+               level = RADEON_MAX_BL_LEVEL - level;
+
+       return level;
+}
+
 static int radeon_legacy_backlight_update_status(struct backlight_device *bd)
 {
        struct radeon_backlight_privdata *pdata = bl_get_data(bd);
@@ -991,11 +991,7 @@ static void radeon_legacy_tmds_ext_mode_set(struct drm_encoder *encoder,
 static void radeon_ext_tmds_enc_destroy(struct drm_encoder *encoder)
 {
        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
-       struct radeon_encoder_ext_tmds *tmds = radeon_encoder->enc_priv;
-       if (tmds) {
-               if (tmds->i2c_bus)
-                       radeon_i2c_destroy(tmds->i2c_bus);
-       }
+       /* don't destroy the i2c bus record here, this will be done in radeon_i2c_fini */
        kfree(radeon_encoder->enc_priv);
        drm_encoder_cleanup(encoder);
        kfree(radeon_encoder);
index bba66902c83b6ada2e3a475572fa5f7101a05a6b..47634f27f2e5eca62cc6335d95fc246e13a6deb2 100644 (file)
@@ -305,7 +305,7 @@ void radeon_ring_write(struct radeon_ring *ring, uint32_t v)
 {
 #if DRM_DEBUG_CODE
        if (ring->count_dw <= 0) {
-               DRM_ERROR("radeon: writting more dword to ring than expected !\n");
+               DRM_ERROR("radeon: writing more dwords to the ring than expected!\n");
        }
 #endif
        ring->ring[ring->wptr++] = v;
index f79633a036c394f22d81182fc56036aa830e190e..df8dd77016436373dcfcfce4e3fb3e8410a3d873 100644 (file)
@@ -2407,12 +2407,13 @@ static int si_pcie_gart_enable(struct radeon_device *rdev)
        WREG32(0x15DC, 0);
 
        /* empty context1-15 */
-       /* FIXME start with 4G, once using 2 level pt switch to full
-        * vm size space
-        */
        /* set vm size, must be a multiple of 4 */
        WREG32(VM_CONTEXT1_PAGE_TABLE_START_ADDR, 0);
        WREG32(VM_CONTEXT1_PAGE_TABLE_END_ADDR, rdev->vm_manager.max_pfn);
+       /* Assign the pt base to something valid for now; the pts used for
+        * the VMs are determined by the application and setup and assigned
+        * on the fly in the vm part of radeon_gart.c
+        */
        for (i = 1; i < 16; i++) {
                if (i < 8)
                        WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (i << 2),
index 984a3f13923b615b7c6849cd59b396689680ed20..47b8d84b489ddb748bd0a3fea2b1aa2582be1002 100644 (file)
@@ -205,8 +205,11 @@ static const struct tjmax __cpuinitconst tjmax_table[] = {
        { "CPU N455", 100000 },
        { "CPU N470", 100000 },
        { "CPU N475", 100000 },
-       { "CPU  230", 100000 },
-       { "CPU  330", 125000 },
+       { "CPU  230", 100000 },         /* Model 0x1c, stepping 2       */
+       { "CPU  330", 125000 },         /* Model 0x1c, stepping 2       */
+       { "CPU CE4110", 110000 },       /* Model 0x1c, stepping 10      */
+       { "CPU CE4150", 110000 },       /* Model 0x1c, stepping 10      */
+       { "CPU CE4170", 110000 },       /* Model 0x1c, stepping 10      */
 };
 
 static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,
index 2ca6a5a4f5a795a23721467581ff9e02cc5baf5a..60745a535821d3b787af31a00cfcecd41743c7ec 100644 (file)
@@ -4,7 +4,7 @@
 
 menuconfig PMBUS
        tristate "PMBus support"
-       depends on I2C && EXPERIMENTAL
+       depends on I2C
        default n
        help
          Say yes here if you want to enable PMBus support.
index dd13e3a4c272965bf23cde32b3409bd28dda6f62..4ef0d80b57f412cb32b5da897a71e5cbff4e1d0b 100644 (file)
@@ -163,19 +163,21 @@ source "drivers/media/common/Kconfig"
 #
 
 config MEDIA_SUBDRV_AUTOSELECT
-       bool "Autoselect analog and hybrid tuner modules to build"
-       depends on MEDIA_TUNER
+       bool "Autoselect tuners and i2c modules to build"
+       depends on MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_CAMERA_SUPPORT
        default y
        help
-         By default, a TV driver auto-selects all possible tuners
-         thar could be used by the driver.
+         By default, a media driver auto-selects all possible i2c
+         devices that are used by any of the supported devices.
 
          This is generally the right thing to do, except when there
-         are strict constraints with regards to the kernel size.
+         are strict constraints with regards to the kernel size,
+         like on embedded systems.
 
-         Use this option with care, as deselecting tuner drivers which
-         are in fact necessary will result in TV devices which cannot
-         be tuned due to lack of the tuning driver.
+         Use this option with care, as deselecting ancillary drivers which
+         are, in fact, necessary will result in the lack of the needed
+         functionality for your device (it may not tune or may not have
+         the need demodulers).
 
          If unsure say Y.
 
index a3b1a34c896db9257000f6c1a3e8fb8bb7cd7df0..4b1becc86e54a77d6beea297b2128236992dd8bb 100644 (file)
@@ -45,8 +45,8 @@
 #include <media/v4l2-ioctl.h>
 
 #include <plat/cpu.h>
-#include <plat/dma.h>
-#include <plat/vrfb.h>
+#include <plat-omap/dma-omap.h>
+#include <video/omapvrfb.h>
 #include <video/omapdss.h>
 
 #include "omap_voutlib.h"
index 4be26abf6cea7a323ef0b15e7e1cedf3177ab916..8340445a0ee597dfe65566d8924a1bcc482e385f 100644 (file)
 #include <media/videobuf-dma-contig.h>
 #include <media/v4l2-device.h>
 
-#include <plat/dma.h>
-#include <plat/vrfb.h>
+#include <plat-omap/dma-omap.h>
+#include <video/omapvrfb.h>
 
 #include "omap_voutdef.h"
 #include "omap_voutlib.h"
 
+#define OMAP_DMA_NO_DEVICE     0
+
 /*
  * Function for allocating video buffers
  */
index 27a95d23b913493db67d20b90857e37f621fdd10..9ccfe1f475a4dce9ec07bae935c3bbdce447f7de 100644 (file)
@@ -12,7 +12,7 @@
 #define OMAP_VOUTDEF_H
 
 #include <video/omapdss.h>
-#include <plat/vrfb.h>
+#include <video/omapvrfb.h>
 
 #define YUYV_BPP        2
 #define RGB565_BPP      2
index d1a8dee5e1ca4720adb96fde8c87e6280187d862..e7f9c4292cc61b40190dee390731faa75c73f9d8 100644 (file)
@@ -34,6 +34,8 @@
 #include "ispreg.h"
 #include "isphist.h"
 
+#define OMAP24XX_DMA_NO_DEVICE         0
+
 #define HIST_CONFIG_DMA        1
 
 #define HIST_USING_DMA(hist) ((hist)->dma_ch >= 0)
index a6fe653eb237dc171c6aef71f31d62ddc1a30550..40f87cdd79944656580f7cc0ccca36d5db1db927 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <linux/types.h>
 #include <linux/omap3isp.h>
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 #include <media/v4l2-event.h>
 
 #include "isp.h"
index fa08c7695ccb05aa61d680d8bcf4f002516d2894..cae9ce6275e9f06cebe33ab1fcb89497a645618b 100644 (file)
 #include <media/videobuf-dma-contig.h>
 #include <media/videobuf-dma-sg.h>
 
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 
 
 #define DRIVER_NAME            "omap1-camera"
 #define DRIVER_VERSION         "0.0.2"
 
+#define OMAP_DMA_CAMERA_IF_RX          20
 
 /*
  * ---------------------------------------------------------------------------
index 546199e9ccc7268f1600a7bc89415b96b10566f2..82e6c1e282d5e6a72784f1fa57489553d4d82e9b 100644 (file)
@@ -28,7 +28,6 @@
 
 #include <plat/dmtimer.h>
 #include <plat/clock.h>
-#include <plat/omap-pm.h>
 
 #include <media/lirc.h>
 #include <media/lirc_dev.h>
index 23cec57c02ba9d7e995900ce5d66e1d4e3704bb7..cebfe0a68aa7666f0749412741f803d3867eb425 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/gpio.h>
 #include <plat/cpu.h>
-#include <plat/usb.h>
+#include <linux/platform_device.h>
+#include <linux/platform_data/usb-omap.h>
 #include <linux/pm_runtime.h>
 
+#include "omap-usb.h"
+
 #define USBHS_DRIVER_NAME      "usbhs_omap"
 #define OMAP_EHCI_DEVICE       "ehci-omap"
 #define OMAP_OHCI_DEVICE       "ohci-omap3"
index 4b7757b8430195dbb8683cab2e21b3d3ca51b738..0db0dfa3d08c312c89d760e199e59692e3cf1550 100644 (file)
@@ -25,8 +25,8 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/err.h>
-#include <plat/usb.h>
 #include <linux/pm_runtime.h>
+#include <linux/platform_data/usb-omap.h>
 
 #define USBTLL_DRIVER_NAME     "usbhs_tll"
 
diff --git a/drivers/mfd/omap-usb.h b/drivers/mfd/omap-usb.h
new file mode 100644 (file)
index 0000000..972aa96
--- /dev/null
@@ -0,0 +1,2 @@
+extern int omap_tll_enable(void);
+extern int omap_tll_disable(void);
index 48ad361613efb2ebaca728ac53f87a147e8beb45..ae115c01283b0c9a426bf8f73bb47e9f7741882f 100644 (file)
@@ -28,9 +28,8 @@
 #include <linux/clk.h>
 #include <linux/scatterlist.h>
 #include <linux/slab.h>
+#include <linux/platform_data/mmc-omap.h>
 
-#include <plat/mmc.h>
-#include <plat/dma.h>
 
 #define        OMAP_MMC_REG_CMD        0x00
 #define        OMAP_MMC_REG_ARGL       0x01
 #define        OMAP_MMC_STAT_CARD_BUSY         (1 <<  2)
 #define        OMAP_MMC_STAT_END_OF_CMD        (1 <<  0)
 
+#define mmc_omap7xx()  (host->features & MMC_OMAP7XX)
+#define mmc_omap15xx() (host->features & MMC_OMAP15XX)
+#define mmc_omap16xx() (host->features & MMC_OMAP16XX)
+#define MMC_OMAP1_MASK (MMC_OMAP7XX | MMC_OMAP15XX | MMC_OMAP16XX)
+#define mmc_omap1()    (host->features & MMC_OMAP1_MASK)
+#define mmc_omap2()    (!mmc_omap1())
+
 #define OMAP_MMC_REG(host, reg)                (OMAP_MMC_REG_##reg << (host)->reg_shift)
 #define OMAP_MMC_READ(host, reg)       __raw_readw((host)->virt_base + OMAP_MMC_REG(host, reg))
 #define OMAP_MMC_WRITE(host, reg, val) __raw_writew((val), (host)->virt_base + OMAP_MMC_REG(host, reg))
 #define OMAP_MMC_CMDTYPE_AC    2
 #define OMAP_MMC_CMDTYPE_ADTC  3
 
+#define OMAP_DMA_MMC_TX                21
+#define OMAP_DMA_MMC_RX                22
+#define OMAP_DMA_MMC2_TX       54
+#define OMAP_DMA_MMC2_RX       55
+
+#define OMAP24XX_DMA_MMC2_TX   47
+#define OMAP24XX_DMA_MMC2_RX   48
+#define OMAP24XX_DMA_MMC1_TX   61
+#define OMAP24XX_DMA_MMC1_RX   62
+
 
 #define DRIVER_NAME "mmci-omap"
 
@@ -147,6 +163,7 @@ struct mmc_omap_host {
        u32                     buffer_bytes_left;
        u32                     total_bytes_left;
 
+       unsigned                features;
        unsigned                use_dma:1;
        unsigned                brs_received:1, dma_done:1;
        unsigned                dma_in_use:1;
@@ -988,7 +1005,7 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req)
                 * blocksize is at least that large. Blocksize is
                 * usually 512 bytes; but not for some SD reads.
                 */
-               burst = cpu_is_omap15xx() ? 32 : 64;
+               burst = mmc_omap15xx() ? 32 : 64;
                if (burst > data->blksz)
                        burst = data->blksz;
 
@@ -1104,8 +1121,7 @@ static void mmc_omap_set_power(struct mmc_omap_slot *slot, int power_on,
        if (slot->pdata->set_power != NULL)
                slot->pdata->set_power(mmc_dev(slot->mmc), slot->id, power_on,
                                        vdd);
-
-       if (cpu_is_omap24xx()) {
+       if (mmc_omap2()) {
                u16 w;
 
                if (power_on) {
@@ -1239,7 +1255,7 @@ static int __devinit mmc_omap_new_slot(struct mmc_omap_host *host, int id)
        mmc->ops = &mmc_omap_ops;
        mmc->f_min = 400000;
 
-       if (cpu_class_is_omap2())
+       if (mmc_omap2())
                mmc->f_max = 48000000;
        else
                mmc->f_max = 24000000;
@@ -1359,6 +1375,7 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev)
        init_waitqueue_head(&host->slot_wq);
 
        host->pdata = pdata;
+       host->features = host->pdata->slots[0].features;
        host->dev = &pdev->dev;
        platform_set_drvdata(pdev, host);
 
@@ -1391,7 +1408,7 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev)
        host->dma_tx_burst = -1;
        host->dma_rx_burst = -1;
 
-       if (cpu_is_omap24xx())
+       if (mmc_omap2())
                sig = host->id == 0 ? OMAP24XX_DMA_MMC1_TX : OMAP24XX_DMA_MMC2_TX;
        else
                sig = host->id == 0 ? OMAP_DMA_MMC_TX : OMAP_DMA_MMC2_TX;
@@ -1407,7 +1424,7 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev)
                dev_warn(host->dev, "unable to obtain TX DMA engine channel %u\n",
                        sig);
 #endif
-       if (cpu_is_omap24xx())
+       if (mmc_omap2())
                sig = host->id == 0 ? OMAP24XX_DMA_MMC1_RX : OMAP24XX_DMA_MMC2_RX;
        else
                sig = host->id == 0 ? OMAP_DMA_MMC_RX : OMAP_DMA_MMC2_RX;
@@ -1435,7 +1452,7 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev)
        }
 
        host->nr_slots = pdata->nr_slots;
-       host->reg_shift = (cpu_is_omap7xx() ? 1 : 2);
+       host->reg_shift = (mmc_omap7xx() ? 1 : 2);
 
        host->mmc_omap_wq = alloc_workqueue("mmc_omap", 0, 0);
        if (!host->mmc_omap_wq)
index 54bfd0cc106b92280cd75818310d81aa56c48ccb..9b24bd46aad3ea5fd26d887e91eef1f46bdb76b5 100644 (file)
@@ -38,9 +38,7 @@
 #include <linux/gpio.h>
 #include <linux/regulator/consumer.h>
 #include <linux/pm_runtime.h>
-#include <mach/hardware.h>
-#include <plat/mmc.h>
-#include <plat/cpu.h>
+#include <linux/platform_data/mmc-omap.h>
 
 /* OMAP HSMMC Host Controller Registers */
 #define OMAP_HSMMC_SYSSTATUS   0x0014
index 5b3138620646af9b5b7c544529a3ae9250858745..5c8978e90240904b2e4642fcc9c8520a838b42da 100644 (file)
@@ -27,8 +27,7 @@
 #include <linux/bch.h>
 #endif
 
-#include <plat/dma.h>
-#include <plat/gpmc.h>
+#include <plat-omap/dma-omap.h>
 #include <linux/platform_data/mtd-nand-omap2.h>
 
 #define        DRIVER_NAME     "omap2-nand"
 #define        CS_MASK                         0x7
 #define        ENABLE_PREFETCH                 (0x1 << 7)
 #define        DMA_MPU_MODE_SHIFT              2
+#define        ECCSIZE0_SHIFT                  12
 #define        ECCSIZE1_SHIFT                  22
 #define        ECC1RESULTSIZE                  0x1
 #define        ECCCLEAR                        0x100
 #define        ECC1                            0x1
+#define        PREFETCH_FIFOTHRESHOLD_MAX      0x40
+#define        PREFETCH_FIFOTHRESHOLD(val)     ((val) << 8)
+#define        PREFETCH_STATUS_COUNT(val)      (val & 0x00003fff)
+#define        PREFETCH_STATUS_FIFO_CNT(val)   ((val >> 24) & 0x7F)
+#define        STATUS_BUFF_EMPTY               0x00000001
+
+#define OMAP24XX_DMA_GPMC              4
 
 /* oob info generated runtime depending on ecc algorithm and layout selected */
 static struct nand_ecclayout omap_oobinfo;
@@ -269,7 +276,7 @@ static void omap_write_buf8(struct mtd_info *mtd, const u_char *buf, int len)
                /* wait until buffer is available for write */
                do {
                        status = readl(info->reg.gpmc_status) &
-                                       GPMC_STATUS_BUFF_EMPTY;
+                                       STATUS_BUFF_EMPTY;
                } while (!status);
        }
 }
@@ -307,7 +314,7 @@ static void omap_write_buf16(struct mtd_info *mtd, const u_char * buf, int len)
                /* wait until buffer is available for write */
                do {
                        status = readl(info->reg.gpmc_status) &
-                                       GPMC_STATUS_BUFF_EMPTY;
+                                       STATUS_BUFF_EMPTY;
                } while (!status);
        }
 }
@@ -348,7 +355,7 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len)
        } else {
                do {
                        r_count = readl(info->reg.gpmc_prefetch_status);
-                       r_count = GPMC_PREFETCH_STATUS_FIFO_CNT(r_count);
+                       r_count = PREFETCH_STATUS_FIFO_CNT(r_count);
                        r_count = r_count >> 2;
                        ioread32_rep(info->nand.IO_ADDR_R, p, r_count);
                        p += r_count;
@@ -395,7 +402,7 @@ static void omap_write_buf_pref(struct mtd_info *mtd,
        } else {
                while (len) {
                        w_count = readl(info->reg.gpmc_prefetch_status);
-                       w_count = GPMC_PREFETCH_STATUS_FIFO_CNT(w_count);
+                       w_count = PREFETCH_STATUS_FIFO_CNT(w_count);
                        w_count = w_count >> 1;
                        for (i = 0; (i < w_count) && len; i++, len -= 2)
                                iowrite16(*p++, info->nand.IO_ADDR_W);
@@ -407,7 +414,7 @@ static void omap_write_buf_pref(struct mtd_info *mtd,
                do {
                        cpu_relax();
                        val = readl(info->reg.gpmc_prefetch_status);
-                       val = GPMC_PREFETCH_STATUS_COUNT(val);
+                       val = PREFETCH_STATUS_COUNT(val);
                } while (val && (tim++ < limit));
 
                /* disable and stop the PFPW engine */
@@ -493,7 +500,7 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
        do {
                cpu_relax();
                val = readl(info->reg.gpmc_prefetch_status);
-               val = GPMC_PREFETCH_STATUS_COUNT(val);
+               val = PREFETCH_STATUS_COUNT(val);
        } while (val && (tim++ < limit));
 
        /* disable and stop the PFPW engine */
@@ -556,7 +563,7 @@ static irqreturn_t omap_nand_irq(int this_irq, void *dev)
        u32 bytes;
 
        bytes = readl(info->reg.gpmc_prefetch_status);
-       bytes = GPMC_PREFETCH_STATUS_FIFO_CNT(bytes);
+       bytes = PREFETCH_STATUS_FIFO_CNT(bytes);
        bytes = bytes  & 0xFFFC; /* io in multiple of 4 bytes */
        if (info->iomode == OMAP_NAND_IO_WRITE) { /* checks for write io */
                if (this_irq == info->gpmc_irq_count)
@@ -682,7 +689,7 @@ static void omap_write_buf_irq_pref(struct mtd_info *mtd,
        limit = (loops_per_jiffy *  msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS));
        do {
                val = readl(info->reg.gpmc_prefetch_status);
-               val = GPMC_PREFETCH_STATUS_COUNT(val);
+               val = PREFETCH_STATUS_COUNT(val);
                cpu_relax();
        } while (val && (tim++ < limit));
 
@@ -996,7 +1003,7 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip *chip)
                cond_resched();
        }
 
-       status = gpmc_nand_read(info->gpmc_cs, GPMC_NAND_DATA);
+       status = readb(info->reg.gpmc_nand_data);
        return status;
 }
 
@@ -1029,19 +1036,45 @@ static int omap_dev_ready(struct mtd_info *mtd)
 static void omap3_enable_hwecc_bch(struct mtd_info *mtd, int mode)
 {
        int nerrors;
-       unsigned int dev_width;
+       unsigned int dev_width, nsectors;
        struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
                                                   mtd);
        struct nand_chip *chip = mtd->priv;
+       u32 val;
 
        nerrors = (info->nand.ecc.bytes == 13) ? 8 : 4;
        dev_width = (chip->options & NAND_BUSWIDTH_16) ? 1 : 0;
+       nsectors = 1;
        /*
         * Program GPMC to perform correction on one 512-byte sector at a time.
         * Using 4 sectors at a time (i.e. ecc.size = 2048) is also possible and
         * gives a slight (5%) performance gain (but requires additional code).
         */
-       (void)gpmc_enable_hwecc_bch(info->gpmc_cs, mode, dev_width, 1, nerrors);
+
+       writel(ECC1, info->reg.gpmc_ecc_control);
+
+       /*
+        * When using BCH, sector size is hardcoded to 512 bytes.
+        * Here we are using wrapping mode 6 both for reading and writing, with:
+        *  size0 = 0  (no additional protected byte in spare area)
+        *  size1 = 32 (skip 32 nibbles = 16 bytes per sector in spare area)
+        */
+       val = (32 << ECCSIZE1_SHIFT) | (0 << ECCSIZE0_SHIFT);
+       writel(val, info->reg.gpmc_ecc_size_config);
+
+       /* BCH configuration */
+       val = ((1                        << 16) | /* enable BCH */
+              (((nerrors == 8) ? 1 : 0) << 12) | /* 8 or 4 bits */
+              (0x06                     <<  8) | /* wrap mode = 6 */
+              (dev_width                <<  7) | /* bus width */
+              (((nsectors-1) & 0x7)     <<  4) | /* number of sectors */
+              (info->gpmc_cs            <<  1) | /* ECC CS */
+              (0x1));                            /* enable ECC */
+
+       writel(val, info->reg.gpmc_ecc_config);
+
+       /* clear ecc and enable bits */
+       writel(ECCCLEAR | ECC1, info->reg.gpmc_ecc_control);
 }
 
 /**
@@ -1055,7 +1088,32 @@ static int omap3_calculate_ecc_bch4(struct mtd_info *mtd, const u_char *dat,
 {
        struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
                                                   mtd);
-       return gpmc_calculate_ecc_bch4(info->gpmc_cs, dat, ecc_code);
+       unsigned long nsectors, val1, val2;
+       int i;
+
+       nsectors = ((readl(info->reg.gpmc_ecc_config) >> 4) & 0x7) + 1;
+
+       for (i = 0; i < nsectors; i++) {
+
+               /* Read hw-computed remainder */
+               val1 = readl(info->reg.gpmc_bch_result0[i]);
+               val2 = readl(info->reg.gpmc_bch_result1[i]);
+
+               /*
+                * Add constant polynomial to remainder, in order to get an ecc
+                * sequence of 0xFFs for a buffer filled with 0xFFs; and
+                * left-justify the resulting polynomial.
+                */
+               *ecc_code++ = 0x28 ^ ((val2 >> 12) & 0xFF);
+               *ecc_code++ = 0x13 ^ ((val2 >>  4) & 0xFF);
+               *ecc_code++ = 0xcc ^ (((val2 & 0xF) << 4)|((val1 >> 28) & 0xF));
+               *ecc_code++ = 0x39 ^ ((val1 >> 20) & 0xFF);
+               *ecc_code++ = 0x96 ^ ((val1 >> 12) & 0xFF);
+               *ecc_code++ = 0xac ^ ((val1 >> 4) & 0xFF);
+               *ecc_code++ = 0x7f ^ ((val1 & 0xF) << 4);
+       }
+
+       return 0;
 }
 
 /**
@@ -1069,7 +1127,39 @@ static int omap3_calculate_ecc_bch8(struct mtd_info *mtd, const u_char *dat,
 {
        struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
                                                   mtd);
-       return gpmc_calculate_ecc_bch8(info->gpmc_cs, dat, ecc_code);
+       unsigned long nsectors, val1, val2, val3, val4;
+       int i;
+
+       nsectors = ((readl(info->reg.gpmc_ecc_config) >> 4) & 0x7) + 1;
+
+       for (i = 0; i < nsectors; i++) {
+
+               /* Read hw-computed remainder */
+               val1 = readl(info->reg.gpmc_bch_result0[i]);
+               val2 = readl(info->reg.gpmc_bch_result1[i]);
+               val3 = readl(info->reg.gpmc_bch_result2[i]);
+               val4 = readl(info->reg.gpmc_bch_result3[i]);
+
+               /*
+                * Add constant polynomial to remainder, in order to get an ecc
+                * sequence of 0xFFs for a buffer filled with 0xFFs.
+                */
+               *ecc_code++ = 0xef ^ (val4 & 0xFF);
+               *ecc_code++ = 0x51 ^ ((val3 >> 24) & 0xFF);
+               *ecc_code++ = 0x2e ^ ((val3 >> 16) & 0xFF);
+               *ecc_code++ = 0x09 ^ ((val3 >> 8) & 0xFF);
+               *ecc_code++ = 0xed ^ (val3 & 0xFF);
+               *ecc_code++ = 0x93 ^ ((val2 >> 24) & 0xFF);
+               *ecc_code++ = 0x9a ^ ((val2 >> 16) & 0xFF);
+               *ecc_code++ = 0xc2 ^ ((val2 >> 8) & 0xFF);
+               *ecc_code++ = 0x97 ^ (val2 & 0xFF);
+               *ecc_code++ = 0x79 ^ ((val1 >> 24) & 0xFF);
+               *ecc_code++ = 0xe5 ^ ((val1 >> 16) & 0xFF);
+               *ecc_code++ = 0x24 ^ ((val1 >> 8) & 0xFF);
+               *ecc_code++ = 0xb5 ^ (val1 & 0xFF);
+       }
+
+       return 0;
 }
 
 /**
@@ -1125,7 +1215,7 @@ static void omap3_free_bch(struct mtd_info *mtd)
  */
 static int omap3_init_bch(struct mtd_info *mtd, int ecc_opt)
 {
-       int ret, max_errors;
+       int max_errors;
        struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
                                                   mtd);
 #ifdef CONFIG_MTD_NAND_OMAP_BCH8
@@ -1142,11 +1232,6 @@ static int omap3_init_bch(struct mtd_info *mtd, int ecc_opt)
                goto fail;
        }
 
-       /* initialize GPMC BCH engine */
-       ret = gpmc_init_hwecc_bch(info->gpmc_cs, 1, max_errors);
-       if (ret)
-               goto fail;
-
        /* software bch library is only used to detect and locate errors */
        info->bch = init_bch(13, max_errors, 0x201b /* hw polynomial */);
        if (!info->bch)
@@ -1513,7 +1598,7 @@ static int omap_nand_remove(struct platform_device *pdev)
        /* Release NAND device, its internal structures and partitions */
        nand_release(&info->mtd);
        iounmap(info->nand.IO_ADDR_R);
-       release_mem_region(info->phys_base, NAND_IO_SIZE);
+       release_mem_region(info->phys_base, info->mem_size);
        kfree(info);
        return 0;
 }
index 1961be985171ce1e11abb77c9c164373cb7d4cd2..53069aef1f489f76579741a30d781a13752ab491 100644 (file)
 #include <linux/regulator/consumer.h>
 
 #include <asm/mach/flash.h>
-#include <plat/gpmc.h>
 #include <linux/platform_data/mtd-onenand-omap2.h>
 #include <asm/gpio.h>
 
-#include <plat/dma.h>
-#include <plat/cpu.h>
+#include <plat-omap/dma-omap.h>
 
 #define DRIVER_NAME "omap2-onenand"
 
@@ -63,6 +61,7 @@ struct omap2_onenand {
        int freq;
        int (*setup)(void __iomem *base, int *freq_ptr);
        struct regulator *regulator;
+       u8 flags;
 };
 
 static void omap2_onenand_dma_cb(int lch, u16 ch_status, void *data)
@@ -155,7 +154,7 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
                if (!(syscfg & ONENAND_SYS_CFG1_IOBE)) {
                        syscfg |= ONENAND_SYS_CFG1_IOBE;
                        write_reg(c, syscfg, ONENAND_REG_SYS_CFG1);
-                       if (cpu_is_omap34xx())
+                       if (c->flags & ONENAND_IN_OMAP34XX)
                                /* Add a delay to let GPIO settle */
                                syscfg = read_reg(c, ONENAND_REG_SYS_CFG1);
                }
@@ -639,6 +638,7 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev)
 
        init_completion(&c->irq_done);
        init_completion(&c->dma_done);
+       c->flags = pdata->flags;
        c->gpmc_cs = pdata->cs;
        c->gpio_irq = pdata->gpio_irq;
        c->dma_channel = pdata->dma_channel;
@@ -729,7 +729,7 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev)
        this = &c->onenand;
        if (c->dma_channel >= 0) {
                this->wait = omap2_onenand_wait;
-               if (cpu_is_omap34xx()) {
+               if (c->flags & ONENAND_IN_OMAP34XX) {
                        this->read_bufferram = omap3_onenand_read_bufferram;
                        this->write_bufferram = omap3_onenand_write_bufferram;
                } else {
@@ -803,7 +803,6 @@ static int __devexit omap2_onenand_remove(struct platform_device *pdev)
        }
        iounmap(c->onenand.base);
        release_mem_region(c->phys_base, c->mem_size);
-       gpmc_cs_free(c->gpmc_cs);
        kfree(c);
 
        return 0;
index b721902bb6b4ab785497fb345cd76f683a11f78b..b2530b00212558411f917abbe077ec75cb985f5e 100644 (file)
@@ -1519,7 +1519,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
        /* no need to lock since we're protected by rtnl_lock */
        if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) {
                pr_debug("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name);
-               if (bond_vlan_used(bond)) {
+               if (vlan_uses_dev(bond_dev)) {
                        pr_err("%s: Error: cannot enslave VLAN challenged slave %s on VLAN enabled bond %s\n",
                               bond_dev->name, slave_dev->name, bond_dev->name);
                        return -EPERM;
index 24220992413ff95fd391e785b4e9edba221422bc..4833b6a9031ceef2e9cfa57390ff52e719eb5ac9 100644 (file)
@@ -2957,9 +2957,13 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        skb_shinfo(skb)->nr_frags +
                        BDS_PER_TX_PKT +
                        NEXT_CNT_PER_TX_PKT(MAX_BDS_PER_TX_PKT))) {
-               bnx2x_fp_qstats(bp, txdata->parent_fp)->driver_xoff++;
-               netif_tx_stop_queue(txq);
-               BNX2X_ERR("BUG! Tx ring full when queue awake!\n");
+               /* Handle special storage cases separately */
+               if (txdata->tx_ring_size != 0) {
+                       BNX2X_ERR("BUG! Tx ring full when queue awake!\n");
+                       bnx2x_fp_qstats(bp, txdata->parent_fp)->driver_xoff++;
+                       netif_tx_stop_queue(txq);
+               }
+
                return NETDEV_TX_BUSY;
        }
 
index 71971a161bd199746595d501691f19300c5ff2ad..614981c02264bcc957d7dd99f629768492746e6b 100644 (file)
@@ -126,7 +126,7 @@ static inline int bnx2x_exe_queue_add(struct bnx2x *bp,
                /* Check if this request is ok */
                rc = o->validate(bp, o->owner, elem);
                if (rc) {
-                       BNX2X_ERR("Preamble failed: %d\n", rc);
+                       DP(BNX2X_MSG_SP, "Preamble failed: %d\n", rc);
                        goto free_and_exit;
                }
        }
index 72e496f1e9b082d576f439c442a07721330f1928..0125524c08c48437080c5842657bb913a937455e 100644 (file)
@@ -37,9 +37,9 @@ struct of_bus {
        int             (*match)(struct device_node *parent);
        void            (*count_cells)(struct device_node *child,
                                       int *addrc, int *sizec);
-       u64             (*map)(u32 *addr, const __be32 *range,
+       u64             (*map)(__be32 *addr, const __be32 *range,
                                int na, int ns, int pna);
-       int             (*translate)(u32 *addr, u64 offset, int na);
+       int             (*translate)(__be32 *addr, u64 offset, int na);
        unsigned int    (*get_flags)(const __be32 *addr);
 };
 
@@ -56,7 +56,7 @@ static void of_bus_default_count_cells(struct device_node *dev,
                *sizec = of_n_size_cells(dev);
 }
 
-static u64 of_bus_default_map(u32 *addr, const __be32 *range,
+static u64 of_bus_default_map(__be32 *addr, const __be32 *range,
                int na, int ns, int pna)
 {
        u64 cp, s, da;
@@ -82,7 +82,7 @@ static u64 of_bus_default_map(u32 *addr, const __be32 *range,
        return da - cp;
 }
 
-static int of_bus_default_translate(u32 *addr, u64 offset, int na)
+static int of_bus_default_translate(__be32 *addr, u64 offset, int na)
 {
        u64 a = of_read_number(addr, na);
        memset(addr, 0, na * 4);
@@ -138,7 +138,7 @@ static unsigned int of_bus_pci_get_flags(const __be32 *addr)
        return flags;
 }
 
-static u64 of_bus_pci_map(u32 *addr, const __be32 *range, int na, int ns,
+static u64 of_bus_pci_map(__be32 *addr, const __be32 *range, int na, int ns,
                int pna)
 {
        u64 cp, s, da;
@@ -165,7 +165,7 @@ static u64 of_bus_pci_map(u32 *addr, const __be32 *range, int na, int ns,
        return da - cp;
 }
 
-static int of_bus_pci_translate(u32 *addr, u64 offset, int na)
+static int of_bus_pci_translate(__be32 *addr, u64 offset, int na)
 {
        return of_bus_default_translate(addr + 1, offset, na - 1);
 }
@@ -247,7 +247,7 @@ static void of_bus_isa_count_cells(struct device_node *child,
                *sizec = 1;
 }
 
-static u64 of_bus_isa_map(u32 *addr, const __be32 *range, int na, int ns,
+static u64 of_bus_isa_map(__be32 *addr, const __be32 *range, int na, int ns,
                int pna)
 {
        u64 cp, s, da;
@@ -270,7 +270,7 @@ static u64 of_bus_isa_map(u32 *addr, const __be32 *range, int na, int ns,
        return da - cp;
 }
 
-static int of_bus_isa_translate(u32 *addr, u64 offset, int na)
+static int of_bus_isa_translate(__be32 *addr, u64 offset, int na)
 {
        return of_bus_default_translate(addr + 1, offset, na - 1);
 }
@@ -338,7 +338,7 @@ static struct of_bus *of_match_bus(struct device_node *np)
 }
 
 static int of_translate_one(struct device_node *parent, struct of_bus *bus,
-                           struct of_bus *pbus, u32 *addr,
+                           struct of_bus *pbus, __be32 *addr,
                            int na, int ns, int pna, const char *rprop)
 {
        const __be32 *ranges;
@@ -409,12 +409,12 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
  * that can be mapped to a cpu physical address). This is not really specified
  * that way, but this is traditionally the way IBM at least do things
  */
-u64 __of_translate_address(struct device_node *dev, const __be32 *in_addr,
-                          const char *rprop)
+static u64 __of_translate_address(struct device_node *dev,
+                                 const __be32 *in_addr, const char *rprop)
 {
        struct device_node *parent = NULL;
        struct of_bus *bus, *pbus;
-       u32 addr[OF_MAX_ADDR_CELLS];
+       __be32 addr[OF_MAX_ADDR_CELLS];
        int na, ns, pna, pns;
        u64 result = OF_BAD_ADDR;
 
index a23ec7779997b553269ad7af6e36a2580f98375c..a3c1c5aae6a9eaa5de0ecd0dd0335771ac8f7fab 100644 (file)
@@ -192,11 +192,13 @@ int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
                        /* Compare specifiers */
                        match = 1;
                        for (i = 0; i < addrsize && match; ++i) {
-                               u32 mask = imask ? imask[i] : 0xffffffffu;
+                               __be32 mask = imask ? imask[i]
+                                                   : cpu_to_be32(0xffffffffu);
                                match = ((addr[i] ^ imap[i]) & mask) == 0;
                        }
                        for (; i < (addrsize + intsize) && match; ++i) {
-                               u32 mask = imask ? imask[i] : 0xffffffffu;
+                               __be32 mask = imask ? imask[i]
+                                                   : cpu_to_be32(0xffffffffu);
                                match =
                                   ((intspec[i-addrsize] ^ imap[i]) & mask) == 0;
                        }
@@ -465,7 +467,7 @@ void __init of_irq_init(const struct of_device_id *matches)
                        pr_debug("of_irq_init: init %s @ %p, parent %p\n",
                                 match->compatible,
                                 desc->dev, desc->interrupt_parent);
-                       irq_init_cb = match->data;
+                       irq_init_cb = (of_irq_init_cb_t)match->data;
                        ret = irq_init_cb(desc->dev, desc->interrupt_parent);
                        if (ret) {
                                kfree(desc);
index 9bdeaf30b17dd5a197f373f9baa18401338ef3d8..b80891b438168491b6434afb2086b4f2424ffc7e 100644 (file)
@@ -76,7 +76,7 @@ void of_device_make_bus_id(struct device *dev)
 {
        static atomic_t bus_no_reg_magic;
        struct device_node *node = dev->of_node;
-       const u32 *reg;
+       const __be32 *reg;
        u64 addr;
        const __be32 *addrp;
        int magic;
index fa74efe82206bb0e24addf015ddddc8e379cd087..25c4b1993b3dc38c84f8813d2479d6ad653c0cc0 100644 (file)
@@ -25,7 +25,7 @@
 #include <asm/sizes.h>
 
 #include <mach/mux.h>
-#include <plat/tc.h>
+#include <mach/tc.h>
 
 
 /* NOTE:  don't expect this to support many I/O cards.  The 16xx chips have
index b066273b6b4f4dc5a87ee9c37ee589938f8b0d39..7dd879ce514df8cffdf23de397923fb96e878eef 100644 (file)
@@ -194,7 +194,7 @@ static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
        sharpsl_pcmcia_init_reset(skt);
 }
 
-static struct pcmcia_low_level sharpsl_pcmcia_ops __initdata = {
+static struct pcmcia_low_level sharpsl_pcmcia_ops = {
        .owner                  = THIS_MODULE,
        .hw_init                = sharpsl_pcmcia_hw_init,
        .socket_state           = sharpsl_pcmcia_socket_state,
index a4adee633fa91f5d3f09ccf3d03d29053d114da5..7e9be18ec2d2b92922373f7f62d8543d43febf50 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/irq.h>
 #include <linux/irqdesc.h>
 #include <linux/irqdomain.h>
-#include <linux/irq.h>
 #include <linux/module.h>
 #include <linux/of_address.h>
 #include <linux/of.h>
@@ -960,7 +959,7 @@ static int __devinit bcm2835_pinctrl_probe(struct platform_device *pdev)
                return err;
        }
 
-       pc->base = devm_request_and_ioremap(&pdev->dev, &iomem);
+       pc->base = devm_request_and_ioremap(dev, &iomem);
        if (!pc->base)
                return -EADDRNOTAVAIL;
 
@@ -1032,7 +1031,7 @@ static int __devinit bcm2835_pinctrl_probe(struct platform_device *pdev)
        pc->pctl_dev = pinctrl_register(&bcm2835_pinctrl_desc, dev, pc);
        if (!pc->pctl_dev) {
                gpiochip_remove(&pc->gpio_chip);
-               return PTR_ERR(pc->pctl_dev);
+               return -EINVAL;
        }
 
        pc->gpio_range = bcm2835_pinctrl_gpio_range;
index fec9c30133d43b2731a9fe8d765ba05106d5eda1..01aea1c3b5fa3188a50cfe4e41ea13e48c50f56d 100644 (file)
 #include <linux/pinctrl/pinconf.h>
 /* Since we request GPIOs from ourself */
 #include <linux/pinctrl/consumer.h>
+/*
+ * For the U8500 archs, use the PRCMU register interface, for the older
+ * Nomadik, provide some stubs. The functions using these will only be
+ * called on the U8500 series.
+ */
+#ifdef CONFIG_ARCH_U8500
 #include <linux/mfd/dbx500-prcmu.h>
+#else
+static inline u32 prcmu_read(unsigned int reg) {
+       return 0;
+}
+static inline void prcmu_write(unsigned int reg, u32 value) {}
+static inline void prcmu_write_masked(unsigned int reg, u32 mask, u32 value) {}
+#endif
 
 #include <asm/mach/irq.h>
 
@@ -1268,6 +1281,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
        struct clk *clk;
        int secondary_irq;
        void __iomem *base;
+       int irq_start = -1;
        int irq;
        int ret;
 
@@ -1371,19 +1385,11 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
 
        platform_set_drvdata(dev, nmk_chip);
 
-       if (np) {
-               /* The DT case will just grab a set of IRQ numbers */
-               nmk_chip->domain = irq_domain_add_linear(np, NMK_GPIO_PER_CHIP,
-                               &nmk_gpio_irq_simple_ops, nmk_chip);
-       } else {
-               /* Non-DT legacy mode, use hardwired IRQ numbers */
-               int irq_start;
-
+       if (!np)
                irq_start = NOMADIK_GPIO_TO_IRQ(pdata->first_gpio);
-               nmk_chip->domain = irq_domain_add_simple(NULL,
+       nmk_chip->domain = irq_domain_add_simple(NULL,
                                NMK_GPIO_PER_CHIP, irq_start,
                                &nmk_gpio_irq_simple_ops, nmk_chip);
-       }
        if (!nmk_chip->domain) {
                dev_err(&dev->dev, "failed to create irqdomain\n");
                ret = -ENOSYS;
index dd108a94acf95028929a5c2b82a3fdaf7a906267..861cd5f04d5e12ba2aa497cc39934a56b0680a7b 100644 (file)
@@ -513,7 +513,7 @@ static int samsung_gpio_direction_output(struct gpio_chip *gc, unsigned offset,
  * Parse the pin names listed in the 'samsung,pins' property and convert it
  * into a list of gpio numbers are create a pin group from it.
  */
-static int __init samsung_pinctrl_parse_dt_pins(struct platform_device *pdev,
+static int __devinit samsung_pinctrl_parse_dt_pins(struct platform_device *pdev,
                        struct device_node *cfg_np, struct pinctrl_desc *pctl,
                        unsigned int **pin_list, unsigned int *npins)
 {
@@ -560,7 +560,7 @@ static int __init samsung_pinctrl_parse_dt_pins(struct platform_device *pdev,
  * from device node of the pin-controller. A pin group is formed with all
  * the pins listed in the "samsung,pins" property.
  */
-static int __init samsung_pinctrl_parse_dt(struct platform_device *pdev,
+static int __devinit samsung_pinctrl_parse_dt(struct platform_device *pdev,
                                struct samsung_pinctrl_drv_data *drvdata)
 {
        struct device *dev = &pdev->dev;
@@ -655,7 +655,7 @@ static int __init samsung_pinctrl_parse_dt(struct platform_device *pdev,
 }
 
 /* register the pinctrl interface with the pinctrl subsystem */
-static int __init samsung_pinctrl_register(struct platform_device *pdev,
+static int __devinit samsung_pinctrl_register(struct platform_device *pdev,
                                struct samsung_pinctrl_drv_data *drvdata)
 {
        struct pinctrl_desc *ctrldesc = &drvdata->pctl;
@@ -729,7 +729,7 @@ static int __init samsung_pinctrl_register(struct platform_device *pdev,
 }
 
 /* register the gpiolib interface with the gpiolib subsystem */
-static int __init samsung_gpiolib_register(struct platform_device *pdev,
+static int __devinit samsung_gpiolib_register(struct platform_device *pdev,
                                struct samsung_pinctrl_drv_data *drvdata)
 {
        struct gpio_chip *gc;
@@ -762,7 +762,7 @@ static int __init samsung_gpiolib_register(struct platform_device *pdev,
 }
 
 /* unregister the gpiolib interface with the gpiolib subsystem */
-static int __init samsung_gpiolib_unregister(struct platform_device *pdev,
+static int __devinit samsung_gpiolib_unregister(struct platform_device *pdev,
                                struct samsung_pinctrl_drv_data *drvdata)
 {
        int ret = gpiochip_remove(drvdata->gc);
index 675497c15149f2e3725cdb9f1031d78dc1859750..9ecacf3d0a759715db3d1081677747b51905626f 100644 (file)
@@ -1323,41 +1323,6 @@ static inline struct sirfsoc_gpio_bank *sirfsoc_gpio_to_bank(unsigned int gpio)
        return &sgpio_bank[gpio / SIRFSOC_GPIO_BANK_SIZE];
 }
 
-void sirfsoc_gpio_set_pull(unsigned gpio, unsigned mode)
-{
-       struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(gpio);
-       int idx = sirfsoc_gpio_to_offset(gpio);
-       u32 val, offset;
-       unsigned long flags;
-
-       offset = SIRFSOC_GPIO_CTRL(bank->id, idx);
-
-       spin_lock_irqsave(&sgpio_lock, flags);
-
-       val = readl(bank->chip.regs + offset);
-
-       switch (mode) {
-       case SIRFSOC_GPIO_PULL_NONE:
-               val &= ~SIRFSOC_GPIO_CTL_PULL_MASK;
-               break;
-       case SIRFSOC_GPIO_PULL_UP:
-               val |= SIRFSOC_GPIO_CTL_PULL_MASK;
-               val |= SIRFSOC_GPIO_CTL_PULL_HIGH;
-               break;
-       case SIRFSOC_GPIO_PULL_DOWN:
-               val |= SIRFSOC_GPIO_CTL_PULL_MASK;
-               val &= ~SIRFSOC_GPIO_CTL_PULL_HIGH;
-               break;
-       default:
-               break;
-       }
-
-       writel(val, bank->chip.regs + offset);
-
-       spin_unlock_irqrestore(&sgpio_lock, flags);
-}
-EXPORT_SYMBOL(sirfsoc_gpio_set_pull);
-
 static inline struct sirfsoc_gpio_bank *sirfsoc_irqchip_to_bank(struct gpio_chip *chip)
 {
        return container_of(to_of_mm_gpio_chip(chip), struct sirfsoc_gpio_bank, chip);
index f8d917d40c92c9ae23ff6fd1d108f60db8c8e3dd..b9bcaec6622381ca3461212cad85144b857e1b48 100644 (file)
@@ -17,8 +17,6 @@
 #include <linux/ioport.h>
 #include <linux/io.h>
 #include <linux/device.h>
-#include <linux/module.h>
-#include <linux/io.h>
 #include <linux/platform_device.h>
 
 #include "pinctrl-lantiq.h"
index 2db409330c217f4d38f9d67bde47ba91fddc98ad..e67e0258aec582a8d441e3eff5591c1eec2058ec 100644 (file)
@@ -1141,11 +1141,12 @@ static int qeth_l2_recover(void *ptr)
                dev_info(&card->gdev->dev,
                        "Device successfully recovered!\n");
        else {
-               rtnl_lock();
-               dev_close(card->dev);
-               rtnl_unlock();
-               dev_warn(&card->gdev->dev, "The qeth device driver "
-                       "failed to recover an error on the device\n");
+               if (rtnl_trylock()) {
+                       dev_close(card->dev);
+                       rtnl_unlock();
+                       dev_warn(&card->gdev->dev, "The qeth device driver "
+                               "failed to recover an error on the device\n");
+               }
        }
        qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD);
        qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD);
index 4cd310cb5bdf8f1c070cc1193294928015834a94..5ba390658498afb4b0b0b583b8ee371aea8863de 100644 (file)
@@ -3510,11 +3510,12 @@ static int qeth_l3_recover(void *ptr)
                dev_info(&card->gdev->dev,
                        "Device successfully recovered!\n");
        else {
-               rtnl_lock();
-               dev_close(card->dev);
-               rtnl_unlock();
-               dev_warn(&card->gdev->dev, "The qeth device driver "
-                       "failed to recover an error on the device\n");
+               if (rtnl_trylock()) {
+                       dev_close(card->dev);
+                       rtnl_unlock();
+                       dev_warn(&card->gdev->dev, "The qeth device driver "
+                               "failed to recover an error on the device\n");
+               }
        }
        qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD);
        qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD);
index 207b7d7424435ccefd62700a07cd424a0e732c40..d8f990b6b332c62f41c90b747347c71f56ef1709 100644 (file)
@@ -157,7 +157,7 @@ static int smsg_pm_restore_thaw(struct device *dev)
 #ifdef CONFIG_PM_DEBUG
        printk(KERN_WARNING "smsg_pm_restore_thaw\n");
 #endif
-       if (smsg_path && iucv_path_connected) {
+       if (smsg_path && !iucv_path_connected) {
                memset(smsg_path, 0, sizeof(*smsg_path));
                smsg_path->msglim = 255;
                smsg_path->flags = 0;
index 6206a666a8ec6d76a5ecba29f5069d77be339b61..737554c37d9ec1ea2f794bf026d4ee96bb5f0c1b 100644 (file)
@@ -179,6 +179,7 @@ static void print_SCp(struct scsi_pointer *SCp, const char *prefix, const char *
                SCp->buffers_residual, suffix);
 }
 
+#ifdef CHECK_STRUCTURE
 static void fas216_dumpinfo(FAS216_Info *info)
 {
        static int used = 0;
@@ -223,7 +224,6 @@ static void fas216_dumpinfo(FAS216_Info *info)
                info->internal_done, info->magic_end);
 }
 
-#ifdef CHECK_STRUCTURE
 static void __fas216_checkmagic(FAS216_Info *info, const char *func)
 {
        int corruption = 0;
index d25f944b59c27a42e1c034a3e85b75a68326f5e9..fc6a5aabf66eadf9a90d2e6c11e2cc45018d6f8a 100644 (file)
@@ -21,6 +21,7 @@
 /*#define PSEUDO_DMA*/
 
 #define OAKSCSI_PUBLIC_RELEASE 1
+#define DONT_USE_INTR
 
 #define priv(host)                     ((struct NCR5380_hostdata *)(host)->hostdata)
 #define NCR5380_local_declare()                void __iomem *_base
index f892ae1d212a10a6671b88c60d8ec8a3ad9b822c..114390f967d26e0426a93c3d2e7adf76ba7d3371 100644 (file)
@@ -75,54 +75,61 @@ unsigned long intc_get_field_from_handle(unsigned int value, unsigned int handle
 static unsigned long test_8(unsigned long addr, unsigned long h,
                            unsigned long ignore)
 {
-       return intc_get_field_from_handle(__raw_readb(addr), h);
+       void __iomem *ptr = (void __iomem *)addr;
+       return intc_get_field_from_handle(__raw_readb(ptr), h);
 }
 
 static unsigned long test_16(unsigned long addr, unsigned long h,
                             unsigned long ignore)
 {
-       return intc_get_field_from_handle(__raw_readw(addr), h);
+       void __iomem *ptr = (void __iomem *)addr;
+       return intc_get_field_from_handle(__raw_readw(ptr), h);
 }
 
 static unsigned long test_32(unsigned long addr, unsigned long h,
                             unsigned long ignore)
 {
-       return intc_get_field_from_handle(__raw_readl(addr), h);
+       void __iomem *ptr = (void __iomem *)addr;
+       return intc_get_field_from_handle(__raw_readl(ptr), h);
 }
 
 static unsigned long write_8(unsigned long addr, unsigned long h,
                             unsigned long data)
 {
-       __raw_writeb(intc_set_field_from_handle(0, data, h), addr);
-       (void)__raw_readb(addr);        /* Defeat write posting */
+       void __iomem *ptr = (void __iomem *)addr;
+       __raw_writeb(intc_set_field_from_handle(0, data, h), ptr);
+       (void)__raw_readb(ptr); /* Defeat write posting */
        return 0;
 }
 
 static unsigned long write_16(unsigned long addr, unsigned long h,
                              unsigned long data)
 {
-       __raw_writew(intc_set_field_from_handle(0, data, h), addr);
-       (void)__raw_readw(addr);        /* Defeat write posting */
+       void __iomem *ptr = (void __iomem *)addr;
+       __raw_writew(intc_set_field_from_handle(0, data, h), ptr);
+       (void)__raw_readw(ptr); /* Defeat write posting */
        return 0;
 }
 
 static unsigned long write_32(unsigned long addr, unsigned long h,
                              unsigned long data)
 {
-       __raw_writel(intc_set_field_from_handle(0, data, h), addr);
-       (void)__raw_readl(addr);        /* Defeat write posting */
+       void __iomem *ptr = (void __iomem *)addr;
+       __raw_writel(intc_set_field_from_handle(0, data, h), ptr);
+       (void)__raw_readl(ptr); /* Defeat write posting */
        return 0;
 }
 
 static unsigned long modify_8(unsigned long addr, unsigned long h,
                              unsigned long data)
 {
+       void __iomem *ptr = (void __iomem *)addr;
        unsigned long flags;
        unsigned int value;
        local_irq_save(flags);
-       value = intc_set_field_from_handle(__raw_readb(addr), data, h);
-       __raw_writeb(value, addr);
-       (void)__raw_readb(addr);        /* Defeat write posting */
+       value = intc_set_field_from_handle(__raw_readb(ptr), data, h);
+       __raw_writeb(value, ptr);
+       (void)__raw_readb(ptr); /* Defeat write posting */
        local_irq_restore(flags);
        return 0;
 }
@@ -130,12 +137,13 @@ static unsigned long modify_8(unsigned long addr, unsigned long h,
 static unsigned long modify_16(unsigned long addr, unsigned long h,
                               unsigned long data)
 {
+       void __iomem *ptr = (void __iomem *)addr;
        unsigned long flags;
        unsigned int value;
        local_irq_save(flags);
-       value = intc_set_field_from_handle(__raw_readw(addr), data, h);
-       __raw_writew(value, addr);
-       (void)__raw_readw(addr);        /* Defeat write posting */
+       value = intc_set_field_from_handle(__raw_readw(ptr), data, h);
+       __raw_writew(value, ptr);
+       (void)__raw_readw(ptr); /* Defeat write posting */
        local_irq_restore(flags);
        return 0;
 }
@@ -143,12 +151,13 @@ static unsigned long modify_16(unsigned long addr, unsigned long h,
 static unsigned long modify_32(unsigned long addr, unsigned long h,
                               unsigned long data)
 {
+       void __iomem *ptr = (void __iomem *)addr;
        unsigned long flags;
        unsigned int value;
        local_irq_save(flags);
-       value = intc_set_field_from_handle(__raw_readl(addr), data, h);
-       __raw_writel(value, addr);
-       (void)__raw_readl(addr);        /* Defeat write posting */
+       value = intc_set_field_from_handle(__raw_readl(ptr), data, h);
+       __raw_writel(value, ptr);
+       (void)__raw_readl(ptr); /* Defeat write posting */
        local_irq_restore(flags);
        return 0;
 }
index 012df2676a267950b77c713eb23afc56b1a341c8..46427b48e2f1767fcc1fa8732aff3536fb38ec66 100644 (file)
@@ -83,7 +83,7 @@ static void intc_mask_ack(struct irq_data *data)
        unsigned int irq = data->irq;
        struct intc_desc_int *d = get_intc_desc(irq);
        unsigned long handle = intc_get_ack_handle(irq);
-       unsigned long addr;
+       void __iomem *addr;
 
        intc_disable(data);
 
@@ -91,7 +91,7 @@ static void intc_mask_ack(struct irq_data *data)
        if (handle) {
                unsigned int value;
 
-               addr = INTC_REG(d, _INTC_ADDR_D(handle), 0);
+               addr = (void __iomem *)INTC_REG(d, _INTC_ADDR_D(handle), 0);
                value = intc_set_field_from_handle(0, 1, handle);
 
                switch (_INTC_FN(handle)) {
index 1a81c90a4a71dc69ce4ec459342a98af3d26b872..6e7a805d324d19d6bec848a8bca2f2a74a4303af 100644 (file)
 
 struct s3c64xx_spi_dma_data {
        unsigned                ch;
-       enum dma_data_direction direction;
+       enum dma_transfer_direction direction;
        enum dma_ch     dmach;
        struct property         *dma_prop;
 };
@@ -1067,11 +1067,11 @@ static int __devinit s3c64xx_spi_get_dmares(
 
        if (tx) {
                dma_data = &sdd->tx_dma;
-               dma_data->direction = DMA_TO_DEVICE;
+               dma_data->direction = DMA_MEM_TO_DEV;
                chan_str = "tx";
        } else {
                dma_data = &sdd->rx_dma;
-               dma_data->direction = DMA_FROM_DEVICE;
+               dma_data->direction = DMA_DEV_TO_MEM;
                chan_str = "rx";
        }
 
index 268dcb95204b1501901a7eb0baf20c563bed4cd7..4792d056a36532b179968dda51f73b37ce56cb95 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/sched.h>
 #include <asm/unaligned.h>
 #include <linux/proc_fs.h>
+#include <linux/uaccess.h>
 
 #include "dgrp_common.h"
 
index 28f5c9ab6b4349200f65062e0dc2a5adb275afc3..24327c3bad83427c208a03c231504f5fa42b0510 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/proc_fs.h>
 #include <linux/ctype.h>
 #include <linux/seq_file.h>
+#include <linux/uaccess.h>
 #include <linux/vmalloc.h>
 
 #include "dgrp_common.h"
@@ -228,6 +229,9 @@ static void register_proc_table(struct dgrp_proc_entry *table,
        int len;
        mode_t mode;
 
+       if (table == NULL)
+               return;
+
        for (; table->id; table++) {
                /* Can't do anything without a proc name. */
                if (!table->name)
@@ -296,6 +300,9 @@ static void unregister_proc_table(struct dgrp_proc_entry *table,
        struct proc_dir_entry *de;
        struct nd_struct *tmp;
 
+       if (table == NULL)
+               return;
+
        list_for_each_entry(tmp, &nd_struct_list, list) {
                if ((table == dgrp_net_table) && (tmp->nd_net_de)) {
                        unregister_dgrp_device(tmp->nd_net_de);
index 7d7de873870c68d6b0965a5fbc51784963836388..e125b03598d73e5b40815cad70887793162802c5 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/tty.h>
 #include <linux/tty_flip.h>
 #include <linux/sched.h>
+#include <linux/uaccess.h>
 
 #include "dgrp_common.h"
 
@@ -3172,6 +3173,9 @@ dgrp_tty_init(struct nd_struct *nd)
         */
 
        nd->nd_serial_ttdriver = alloc_tty_driver(CHAN_MAX);
+       if (!nd->nd_serial_ttdriver)
+               return -ENOMEM;
+
        sprintf(nd->nd_serial_name,  "tty_dgrp_%s_", id);
 
        nd->nd_serial_ttdriver->owner = THIS_MODULE;
@@ -3231,6 +3235,9 @@ dgrp_tty_init(struct nd_struct *nd)
        }
 
        nd->nd_callout_ttdriver = alloc_tty_driver(CHAN_MAX);
+       if (!nd->nd_callout_ttdriver)
+               return -ENOMEM;
+
        sprintf(nd->nd_callout_name, "cu_dgrp_%s_",  id);
 
        nd->nd_callout_ttdriver->owner = THIS_MODULE;
@@ -3268,6 +3275,9 @@ dgrp_tty_init(struct nd_struct *nd)
 
 
        nd->nd_xprint_ttdriver = alloc_tty_driver(CHAN_MAX);
+       if (!nd->nd_xprint_ttdriver)
+               return -ENOMEM;
+
        sprintf(nd->nd_xprint_name,  "pr_dgrp_%s_", id);
 
        nd->nd_xprint_ttdriver->owner = THIS_MODULE;
index ed00d3da3205a0074333fb0a4dfd778ca6417280..896f1579d5d7be4d3e07e6a77579f3913f90d56c 100644 (file)
@@ -40,7 +40,6 @@
 #include <linux/vmalloc.h>
 #include <linux/ioport.h>
 #include <linux/platform_device.h>
-#include <plat/clock.h>
 #include <linux/clk.h>
 #include <plat/mailbox.h>
 #include <linux/pagemap.h>
index edfd67d2501349c99a9abe1540c23252488008b1..e1cb6bd75f60335517dc26d50d7b5726205da41a 100644 (file)
@@ -22,6 +22,7 @@ config THERMAL_HWMON
 config CPU_THERMAL
        bool "generic cpu cooling support"
        depends on THERMAL && CPU_FREQ
+       select CPU_FREQ_TABLE
        help
          This implements the generic cpu cooling mechanism through frequency
          reduction, cpu hotplug and any other ways of reducing temperature. An
@@ -50,6 +51,7 @@ config RCAR_THERMAL
 config EXYNOS_THERMAL
        tristate "Temperature sensor on Samsung EXYNOS"
        depends on (ARCH_EXYNOS4 || ARCH_EXYNOS5) && THERMAL
+       select CPU_FREQ_TABLE
        help
          If you say yes here you get support for TMU (Thermal Managment
          Unit) on SAMSUNG EXYNOS series of SoC.
index 8c0b7b42319c44d7038892d0026582797acad95a..60b076cc4e20c28fb2c4e89a0445c61c0355925d 100644 (file)
 #define ECHO_OP_SET_CANON_COL 0x81
 #define ECHO_OP_ERASE_TAB 0x82
 
+struct n_tty_data {
+       unsigned int column;
+       unsigned long overrun_time;
+       int num_overrun;
+
+       unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1;
+       unsigned char echo_overrun:1;
+
+       DECLARE_BITMAP(process_char_map, 256);
+       DECLARE_BITMAP(read_flags, N_TTY_BUF_SIZE);
+
+       char *read_buf;
+       int read_head;
+       int read_tail;
+       int read_cnt;
+
+       unsigned char *echo_buf;
+       unsigned int echo_pos;
+       unsigned int echo_cnt;
+
+       int canon_data;
+       unsigned long canon_head;
+       unsigned int canon_column;
+
+       struct mutex atomic_read_lock;
+       struct mutex output_lock;
+       struct mutex echo_lock;
+       spinlock_t read_lock;
+};
+
 static inline int tty_put_user(struct tty_struct *tty, unsigned char x,
                               unsigned char __user *ptr)
 {
-       tty_audit_add_data(tty, &x, 1);
+       struct n_tty_data *ldata = tty->disc_data;
+
+       tty_audit_add_data(tty, &x, 1, ldata->icanon);
        return put_user(x, ptr);
 }
 
@@ -92,17 +124,18 @@ static inline int tty_put_user(struct tty_struct *tty, unsigned char x,
 
 static void n_tty_set_room(struct tty_struct *tty)
 {
+       struct n_tty_data *ldata = tty->disc_data;
        int left;
        int old_left;
 
-       /* tty->read_cnt is not read locked ? */
+       /* ldata->read_cnt is not read locked ? */
        if (I_PARMRK(tty)) {
                /* Multiply read_cnt by 3, since each byte might take up to
                 * three times as many spaces when PARMRK is set (depending on
                 * its flags, e.g. parity error). */
-               left = N_TTY_BUF_SIZE - tty->read_cnt * 3 - 1;
+               left = N_TTY_BUF_SIZE - ldata->read_cnt * 3 - 1;
        } else
-               left = N_TTY_BUF_SIZE - tty->read_cnt - 1;
+               left = N_TTY_BUF_SIZE - ldata->read_cnt - 1;
 
        /*
         * If we are doing input canonicalization, and there are no
@@ -111,44 +144,47 @@ static void n_tty_set_room(struct tty_struct *tty)
         * characters will be beeped.
         */
        if (left <= 0)
-               left = tty->icanon && !tty->canon_data;
+               left = ldata->icanon && !ldata->canon_data;
        old_left = tty->receive_room;
        tty->receive_room = left;
 
        /* Did this open up the receive buffer? We may need to flip */
-       if (left && !old_left)
-               schedule_work(&tty->buf.work);
+       if (left && !old_left) {
+               WARN_RATELIMIT(tty->port->itty == NULL,
+                               "scheduling with invalid itty");
+               schedule_work(&tty->port->buf.work);
+       }
 }
 
-static void put_tty_queue_nolock(unsigned char c, struct tty_struct *tty)
+static void put_tty_queue_nolock(unsigned char c, struct n_tty_data *ldata)
 {
-       if (tty->read_cnt < N_TTY_BUF_SIZE) {
-               tty->read_buf[tty->read_head] = c;
-               tty->read_head = (tty->read_head + 1) & (N_TTY_BUF_SIZE-1);
-               tty->read_cnt++;
+       if (ldata->read_cnt < N_TTY_BUF_SIZE) {
+               ldata->read_buf[ldata->read_head] = c;
+               ldata->read_head = (ldata->read_head + 1) & (N_TTY_BUF_SIZE-1);
+               ldata->read_cnt++;
        }
 }
 
 /**
  *     put_tty_queue           -       add character to tty
  *     @c: character
- *     @tty: tty device
+ *     @ldata: n_tty data
  *
  *     Add a character to the tty read_buf queue. This is done under the
  *     read_lock to serialize character addition and also to protect us
  *     against parallel reads or flushes
  */
 
-static void put_tty_queue(unsigned char c, struct tty_struct *tty)
+static void put_tty_queue(unsigned char c, struct n_tty_data *ldata)
 {
        unsigned long flags;
        /*
         *      The problem of stomping on the buffers ends here.
         *      Why didn't anyone see this one coming? --AJK
        */
-       spin_lock_irqsave(&tty->read_lock, flags);
-       put_tty_queue_nolock(c, tty);
-       spin_unlock_irqrestore(&tty->read_lock, flags);
+       spin_lock_irqsave(&ldata->read_lock, flags);
+       put_tty_queue_nolock(c, ldata);
+       spin_unlock_irqrestore(&ldata->read_lock, flags);
 }
 
 /**
@@ -179,18 +215,19 @@ static void check_unthrottle(struct tty_struct *tty)
 
 static void reset_buffer_flags(struct tty_struct *tty)
 {
+       struct n_tty_data *ldata = tty->disc_data;
        unsigned long flags;
 
-       spin_lock_irqsave(&tty->read_lock, flags);
-       tty->read_head = tty->read_tail = tty->read_cnt = 0;
-       spin_unlock_irqrestore(&tty->read_lock, flags);
+       spin_lock_irqsave(&ldata->read_lock, flags);
+       ldata->read_head = ldata->read_tail = ldata->read_cnt = 0;
+       spin_unlock_irqrestore(&ldata->read_lock, flags);
 
-       mutex_lock(&tty->echo_lock);
-       tty->echo_pos = tty->echo_cnt = tty->echo_overrun = 0;
-       mutex_unlock(&tty->echo_lock);
+       mutex_lock(&ldata->echo_lock);
+       ldata->echo_pos = ldata->echo_cnt = ldata->echo_overrun = 0;
+       mutex_unlock(&ldata->echo_lock);
 
-       tty->canon_head = tty->canon_data = tty->erasing = 0;
-       memset(&tty->read_flags, 0, sizeof tty->read_flags);
+       ldata->canon_head = ldata->canon_data = ldata->erasing = 0;
+       bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE);
        n_tty_set_room(tty);
 }
 
@@ -235,18 +272,19 @@ static void n_tty_flush_buffer(struct tty_struct *tty)
 
 static ssize_t n_tty_chars_in_buffer(struct tty_struct *tty)
 {
+       struct n_tty_data *ldata = tty->disc_data;
        unsigned long flags;
        ssize_t n = 0;
 
-       spin_lock_irqsave(&tty->read_lock, flags);
-       if (!tty->icanon) {
-               n = tty->read_cnt;
-       } else if (tty->canon_data) {
-               n = (tty->canon_head > tty->read_tail) ?
-                       tty->canon_head - tty->read_tail :
-                       tty->canon_head + (N_TTY_BUF_SIZE - tty->read_tail);
+       spin_lock_irqsave(&ldata->read_lock, flags);
+       if (!ldata->icanon) {
+               n = ldata->read_cnt;
+       } else if (ldata->canon_data) {
+               n = (ldata->canon_head > ldata->read_tail) ?
+                       ldata->canon_head - ldata->read_tail :
+                       ldata->canon_head + (N_TTY_BUF_SIZE - ldata->read_tail);
        }
-       spin_unlock_irqrestore(&tty->read_lock, flags);
+       spin_unlock_irqrestore(&ldata->read_lock, flags);
        return n;
 }
 
@@ -301,6 +339,7 @@ static inline int is_continuation(unsigned char c, struct tty_struct *tty)
 
 static int do_output_char(unsigned char c, struct tty_struct *tty, int space)
 {
+       struct n_tty_data *ldata = tty->disc_data;
        int     spaces;
 
        if (!space)
@@ -309,48 +348,48 @@ static int do_output_char(unsigned char c, struct tty_struct *tty, int space)
        switch (c) {
        case '\n':
                if (O_ONLRET(tty))
-                       tty->column = 0;
+                       ldata->column = 0;
                if (O_ONLCR(tty)) {
                        if (space < 2)
                                return -1;
-                       tty->canon_column = tty->column = 0;
+                       ldata->canon_column = ldata->column = 0;
                        tty->ops->write(tty, "\r\n", 2);
                        return 2;
                }
-               tty->canon_column = tty->column;
+               ldata->canon_column = ldata->column;
                break;
        case '\r':
-               if (O_ONOCR(tty) && tty->column == 0)
+               if (O_ONOCR(tty) && ldata->column == 0)
                        return 0;
                if (O_OCRNL(tty)) {
                        c = '\n';
                        if (O_ONLRET(tty))
-                               tty->canon_column = tty->column = 0;
+                               ldata->canon_column = ldata->column = 0;
                        break;
                }
-               tty->canon_column = tty->column = 0;
+               ldata->canon_column = ldata->column = 0;
                break;
        case '\t':
-               spaces = 8 - (tty->column & 7);
+               spaces = 8 - (ldata->column & 7);
                if (O_TABDLY(tty) == XTABS) {
                        if (space < spaces)
                                return -1;
-                       tty->column += spaces;
+                       ldata->column += spaces;
                        tty->ops->write(tty, "        ", spaces);
                        return spaces;
                }
-               tty->column += spaces;
+               ldata->column += spaces;
                break;
        case '\b':
-               if (tty->column > 0)
-                       tty->column--;
+               if (ldata->column > 0)
+                       ldata->column--;
                break;
        default:
                if (!iscntrl(c)) {
                        if (O_OLCUC(tty))
                                c = toupper(c);
                        if (!is_continuation(c, tty))
-                               tty->column++;
+                               ldata->column++;
                }
                break;
        }
@@ -375,14 +414,15 @@ static int do_output_char(unsigned char c, struct tty_struct *tty, int space)
 
 static int process_output(unsigned char c, struct tty_struct *tty)
 {
+       struct n_tty_data *ldata = tty->disc_data;
        int     space, retval;
 
-       mutex_lock(&tty->output_lock);
+       mutex_lock(&ldata->output_lock);
 
        space = tty_write_room(tty);
        retval = do_output_char(c, tty, space);
 
-       mutex_unlock(&tty->output_lock);
+       mutex_unlock(&ldata->output_lock);
        if (retval < 0)
                return -1;
        else
@@ -411,15 +451,16 @@ static int process_output(unsigned char c, struct tty_struct *tty)
 static ssize_t process_output_block(struct tty_struct *tty,
                                    const unsigned char *buf, unsigned int nr)
 {
+       struct n_tty_data *ldata = tty->disc_data;
        int     space;
        int     i;
        const unsigned char *cp;
 
-       mutex_lock(&tty->output_lock);
+       mutex_lock(&ldata->output_lock);
 
        space = tty_write_room(tty);
        if (!space) {
-               mutex_unlock(&tty->output_lock);
+               mutex_unlock(&ldata->output_lock);
                return 0;
        }
        if (nr > space)
@@ -431,30 +472,30 @@ static ssize_t process_output_block(struct tty_struct *tty,
                switch (c) {
                case '\n':
                        if (O_ONLRET(tty))
-                               tty->column = 0;
+                               ldata->column = 0;
                        if (O_ONLCR(tty))
                                goto break_out;
-                       tty->canon_column = tty->column;
+                       ldata->canon_column = ldata->column;
                        break;
                case '\r':
-                       if (O_ONOCR(tty) && tty->column == 0)
+                       if (O_ONOCR(tty) && ldata->column == 0)
                                goto break_out;
                        if (O_OCRNL(tty))
                                goto break_out;
-                       tty->canon_column = tty->column = 0;
+                       ldata->canon_column = ldata->column = 0;
                        break;
                case '\t':
                        goto break_out;
                case '\b':
-                       if (tty->column > 0)
-                               tty->column--;
+                       if (ldata->column > 0)
+                               ldata->column--;
                        break;
                default:
                        if (!iscntrl(c)) {
                                if (O_OLCUC(tty))
                                        goto break_out;
                                if (!is_continuation(c, tty))
-                                       tty->column++;
+                                       ldata->column++;
                        }
                        break;
                }
@@ -462,7 +503,7 @@ static ssize_t process_output_block(struct tty_struct *tty,
 break_out:
        i = tty->ops->write(tty, buf, i);
 
-       mutex_unlock(&tty->output_lock);
+       mutex_unlock(&ldata->output_lock);
        return i;
 }
 
@@ -494,21 +535,22 @@ break_out:
 
 static void process_echoes(struct tty_struct *tty)
 {
+       struct n_tty_data *ldata = tty->disc_data;
        int     space, nr;
        unsigned char c;
        unsigned char *cp, *buf_end;
 
-       if (!tty->echo_cnt)
+       if (!ldata->echo_cnt)
                return;
 
-       mutex_lock(&tty->output_lock);
-       mutex_lock(&tty->echo_lock);
+       mutex_lock(&ldata->output_lock);
+       mutex_lock(&ldata->echo_lock);
 
        space = tty_write_room(tty);
 
-       buf_end = tty->echo_buf + N_TTY_BUF_SIZE;
-       cp = tty->echo_buf + tty->echo_pos;
-       nr = tty->echo_cnt;
+       buf_end = ldata->echo_buf + N_TTY_BUF_SIZE;
+       cp = ldata->echo_buf + ldata->echo_pos;
+       nr = ldata->echo_cnt;
        while (nr > 0) {
                c = *cp;
                if (c == ECHO_OP_START) {
@@ -545,7 +587,7 @@ static void process_echoes(struct tty_struct *tty)
                                 * Otherwise, tab spacing is normal.
                                 */
                                if (!(num_chars & 0x80))
-                                       num_chars += tty->canon_column;
+                                       num_chars += ldata->canon_column;
                                num_bs = 8 - (num_chars & 7);
 
                                if (num_bs > space) {
@@ -555,22 +597,22 @@ static void process_echoes(struct tty_struct *tty)
                                space -= num_bs;
                                while (num_bs--) {
                                        tty_put_char(tty, '\b');
-                                       if (tty->column > 0)
-                                               tty->column--;
+                                       if (ldata->column > 0)
+                                               ldata->column--;
                                }
                                cp += 3;
                                nr -= 3;
                                break;
 
                        case ECHO_OP_SET_CANON_COL:
-                               tty->canon_column = tty->column;
+                               ldata->canon_column = ldata->column;
                                cp += 2;
                                nr -= 2;
                                break;
 
                        case ECHO_OP_MOVE_BACK_COL:
-                               if (tty->column > 0)
-                                       tty->column--;
+                               if (ldata->column > 0)
+                                       ldata->column--;
                                cp += 2;
                                nr -= 2;
                                break;
@@ -582,7 +624,7 @@ static void process_echoes(struct tty_struct *tty)
                                        break;
                                }
                                tty_put_char(tty, ECHO_OP_START);
-                               tty->column++;
+                               ldata->column++;
                                space--;
                                cp += 2;
                                nr -= 2;
@@ -604,7 +646,7 @@ static void process_echoes(struct tty_struct *tty)
                                }
                                tty_put_char(tty, '^');
                                tty_put_char(tty, op ^ 0100);
-                               tty->column += 2;
+                               ldata->column += 2;
                                space -= 2;
                                cp += 2;
                                nr -= 2;
@@ -635,20 +677,20 @@ static void process_echoes(struct tty_struct *tty)
        }
 
        if (nr == 0) {
-               tty->echo_pos = 0;
-               tty->echo_cnt = 0;
-               tty->echo_overrun = 0;
+               ldata->echo_pos = 0;
+               ldata->echo_cnt = 0;
+               ldata->echo_overrun = 0;
        } else {
-               int num_processed = tty->echo_cnt - nr;
-               tty->echo_pos += num_processed;
-               tty->echo_pos &= N_TTY_BUF_SIZE - 1;
-               tty->echo_cnt = nr;
+               int num_processed = ldata->echo_cnt - nr;
+               ldata->echo_pos += num_processed;
+               ldata->echo_pos &= N_TTY_BUF_SIZE - 1;
+               ldata->echo_cnt = nr;
                if (num_processed > 0)
-                       tty->echo_overrun = 0;
+                       ldata->echo_overrun = 0;
        }
 
-       mutex_unlock(&tty->echo_lock);
-       mutex_unlock(&tty->output_lock);
+       mutex_unlock(&ldata->echo_lock);
+       mutex_unlock(&ldata->output_lock);
 
        if (tty->ops->flush_chars)
                tty->ops->flush_chars(tty);
@@ -657,72 +699,70 @@ static void process_echoes(struct tty_struct *tty)
 /**
  *     add_echo_byte   -       add a byte to the echo buffer
  *     @c: unicode byte to echo
- *     @tty: terminal device
+ *     @ldata: n_tty data
  *
  *     Add a character or operation byte to the echo buffer.
  *
  *     Should be called under the echo lock to protect the echo buffer.
  */
 
-static void add_echo_byte(unsigned char c, struct tty_struct *tty)
+static void add_echo_byte(unsigned char c, struct n_tty_data *ldata)
 {
        int     new_byte_pos;
 
-       if (tty->echo_cnt == N_TTY_BUF_SIZE) {
+       if (ldata->echo_cnt == N_TTY_BUF_SIZE) {
                /* Circular buffer is already at capacity */
-               new_byte_pos = tty->echo_pos;
+               new_byte_pos = ldata->echo_pos;
 
                /*
                 * Since the buffer start position needs to be advanced,
                 * be sure to step by a whole operation byte group.
                 */
-               if (tty->echo_buf[tty->echo_pos] == ECHO_OP_START) {
-                       if (tty->echo_buf[(tty->echo_pos + 1) &
+               if (ldata->echo_buf[ldata->echo_pos] == ECHO_OP_START) {
+                       if (ldata->echo_buf[(ldata->echo_pos + 1) &
                                          (N_TTY_BUF_SIZE - 1)] ==
                                                ECHO_OP_ERASE_TAB) {
-                               tty->echo_pos += 3;
-                               tty->echo_cnt -= 2;
+                               ldata->echo_pos += 3;
+                               ldata->echo_cnt -= 2;
                        } else {
-                               tty->echo_pos += 2;
-                               tty->echo_cnt -= 1;
+                               ldata->echo_pos += 2;
+                               ldata->echo_cnt -= 1;
                        }
                } else {
-                       tty->echo_pos++;
+                       ldata->echo_pos++;
                }
-               tty->echo_pos &= N_TTY_BUF_SIZE - 1;
+               ldata->echo_pos &= N_TTY_BUF_SIZE - 1;
 
-               tty->echo_overrun = 1;
+               ldata->echo_overrun = 1;
        } else {
-               new_byte_pos = tty->echo_pos + tty->echo_cnt;
+               new_byte_pos = ldata->echo_pos + ldata->echo_cnt;
                new_byte_pos &= N_TTY_BUF_SIZE - 1;
-               tty->echo_cnt++;
+               ldata->echo_cnt++;
        }
 
-       tty->echo_buf[new_byte_pos] = c;
+       ldata->echo_buf[new_byte_pos] = c;
 }
 
 /**
  *     echo_move_back_col      -       add operation to move back a column
- *     @tty: terminal device
+ *     @ldata: n_tty data
  *
  *     Add an operation to the echo buffer to move back one column.
  *
  *     Locking: echo_lock to protect the echo buffer
  */
 
-static void echo_move_back_col(struct tty_struct *tty)
+static void echo_move_back_col(struct n_tty_data *ldata)
 {
-       mutex_lock(&tty->echo_lock);
-
-       add_echo_byte(ECHO_OP_START, tty);
-       add_echo_byte(ECHO_OP_MOVE_BACK_COL, tty);
-
-       mutex_unlock(&tty->echo_lock);
+       mutex_lock(&ldata->echo_lock);
+       add_echo_byte(ECHO_OP_START, ldata);
+       add_echo_byte(ECHO_OP_MOVE_BACK_COL, ldata);
+       mutex_unlock(&ldata->echo_lock);
 }
 
 /**
  *     echo_set_canon_col      -       add operation to set the canon column
- *     @tty: terminal device
+ *     @ldata: n_tty data
  *
  *     Add an operation to the echo buffer to set the canon column
  *     to the current column.
@@ -730,21 +770,19 @@ static void echo_move_back_col(struct tty_struct *tty)
  *     Locking: echo_lock to protect the echo buffer
  */
 
-static void echo_set_canon_col(struct tty_struct *tty)
+static void echo_set_canon_col(struct n_tty_data *ldata)
 {
-       mutex_lock(&tty->echo_lock);
-
-       add_echo_byte(ECHO_OP_START, tty);
-       add_echo_byte(ECHO_OP_SET_CANON_COL, tty);
-
-       mutex_unlock(&tty->echo_lock);
+       mutex_lock(&ldata->echo_lock);
+       add_echo_byte(ECHO_OP_START, ldata);
+       add_echo_byte(ECHO_OP_SET_CANON_COL, ldata);
+       mutex_unlock(&ldata->echo_lock);
 }
 
 /**
  *     echo_erase_tab  -       add operation to erase a tab
  *     @num_chars: number of character columns already used
  *     @after_tab: true if num_chars starts after a previous tab
- *     @tty: terminal device
+ *     @ldata: n_tty data
  *
  *     Add an operation to the echo buffer to erase a tab.
  *
@@ -758,12 +796,12 @@ static void echo_set_canon_col(struct tty_struct *tty)
  */
 
 static void echo_erase_tab(unsigned int num_chars, int after_tab,
-                          struct tty_struct *tty)
+                          struct n_tty_data *ldata)
 {
-       mutex_lock(&tty->echo_lock);
+       mutex_lock(&ldata->echo_lock);
 
-       add_echo_byte(ECHO_OP_START, tty);
-       add_echo_byte(ECHO_OP_ERASE_TAB, tty);
+       add_echo_byte(ECHO_OP_START, ldata);
+       add_echo_byte(ECHO_OP_ERASE_TAB, ldata);
 
        /* We only need to know this modulo 8 (tab spacing) */
        num_chars &= 7;
@@ -772,9 +810,9 @@ static void echo_erase_tab(unsigned int num_chars, int after_tab,
        if (after_tab)
                num_chars |= 0x80;
 
-       add_echo_byte(num_chars, tty);
+       add_echo_byte(num_chars, ldata);
 
-       mutex_unlock(&tty->echo_lock);
+       mutex_unlock(&ldata->echo_lock);
 }
 
 /**
@@ -790,18 +828,16 @@ static void echo_erase_tab(unsigned int num_chars, int after_tab,
  *     Locking: echo_lock to protect the echo buffer
  */
 
-static void echo_char_raw(unsigned char c, struct tty_struct *tty)
+static void echo_char_raw(unsigned char c, struct n_tty_data *ldata)
 {
-       mutex_lock(&tty->echo_lock);
-
+       mutex_lock(&ldata->echo_lock);
        if (c == ECHO_OP_START) {
-               add_echo_byte(ECHO_OP_START, tty);
-               add_echo_byte(ECHO_OP_START, tty);
+               add_echo_byte(ECHO_OP_START, ldata);
+               add_echo_byte(ECHO_OP_START, ldata);
        } else {
-               add_echo_byte(c, tty);
+               add_echo_byte(c, ldata);
        }
-
-       mutex_unlock(&tty->echo_lock);
+       mutex_unlock(&ldata->echo_lock);
 }
 
 /**
@@ -820,30 +856,32 @@ static void echo_char_raw(unsigned char c, struct tty_struct *tty)
 
 static void echo_char(unsigned char c, struct tty_struct *tty)
 {
-       mutex_lock(&tty->echo_lock);
+       struct n_tty_data *ldata = tty->disc_data;
+
+       mutex_lock(&ldata->echo_lock);
 
        if (c == ECHO_OP_START) {
-               add_echo_byte(ECHO_OP_START, tty);
-               add_echo_byte(ECHO_OP_START, tty);
+               add_echo_byte(ECHO_OP_START, ldata);
+               add_echo_byte(ECHO_OP_START, ldata);
        } else {
                if (L_ECHOCTL(tty) && iscntrl(c) && c != '\t')
-                       add_echo_byte(ECHO_OP_START, tty);
-               add_echo_byte(c, tty);
+                       add_echo_byte(ECHO_OP_START, ldata);
+               add_echo_byte(c, ldata);
        }
 
-       mutex_unlock(&tty->echo_lock);
+       mutex_unlock(&ldata->echo_lock);
 }
 
 /**
  *     finish_erasing          -       complete erase
- *     @tty: tty doing the erase
+ *     @ldata: n_tty data
  */
 
-static inline void finish_erasing(struct tty_struct *tty)
+static inline void finish_erasing(struct n_tty_data *ldata)
 {
-       if (tty->erasing) {
-               echo_char_raw('/', tty);
-               tty->erasing = 0;
+       if (ldata->erasing) {
+               echo_char_raw('/', ldata);
+               ldata->erasing = 0;
        }
 }
 
@@ -861,12 +899,13 @@ static inline void finish_erasing(struct tty_struct *tty)
 
 static void eraser(unsigned char c, struct tty_struct *tty)
 {
+       struct n_tty_data *ldata = tty->disc_data;
        enum { ERASE, WERASE, KILL } kill_type;
        int head, seen_alnums, cnt;
        unsigned long flags;
 
        /* FIXME: locking needed ? */
-       if (tty->read_head == tty->canon_head) {
+       if (ldata->read_head == ldata->canon_head) {
                /* process_output('\a', tty); */ /* what do you think? */
                return;
        }
@@ -876,24 +915,24 @@ static void eraser(unsigned char c, struct tty_struct *tty)
                kill_type = WERASE;
        else {
                if (!L_ECHO(tty)) {
-                       spin_lock_irqsave(&tty->read_lock, flags);
-                       tty->read_cnt -= ((tty->read_head - tty->canon_head) &
+                       spin_lock_irqsave(&ldata->read_lock, flags);
+                       ldata->read_cnt -= ((ldata->read_head - ldata->canon_head) &
                                          (N_TTY_BUF_SIZE - 1));
-                       tty->read_head = tty->canon_head;
-                       spin_unlock_irqrestore(&tty->read_lock, flags);
+                       ldata->read_head = ldata->canon_head;
+                       spin_unlock_irqrestore(&ldata->read_lock, flags);
                        return;
                }
                if (!L_ECHOK(tty) || !L_ECHOKE(tty) || !L_ECHOE(tty)) {
-                       spin_lock_irqsave(&tty->read_lock, flags);
-                       tty->read_cnt -= ((tty->read_head - tty->canon_head) &
+                       spin_lock_irqsave(&ldata->read_lock, flags);
+                       ldata->read_cnt -= ((ldata->read_head - ldata->canon_head) &
                                          (N_TTY_BUF_SIZE - 1));
-                       tty->read_head = tty->canon_head;
-                       spin_unlock_irqrestore(&tty->read_lock, flags);
-                       finish_erasing(tty);
+                       ldata->read_head = ldata->canon_head;
+                       spin_unlock_irqrestore(&ldata->read_lock, flags);
+                       finish_erasing(ldata);
                        echo_char(KILL_CHAR(tty), tty);
                        /* Add a newline if ECHOK is on and ECHOKE is off. */
                        if (L_ECHOK(tty))
-                               echo_char_raw('\n', tty);
+                               echo_char_raw('\n', ldata);
                        return;
                }
                kill_type = KILL;
@@ -901,14 +940,14 @@ static void eraser(unsigned char c, struct tty_struct *tty)
 
        seen_alnums = 0;
        /* FIXME: Locking ?? */
-       while (tty->read_head != tty->canon_head) {
-               head = tty->read_head;
+       while (ldata->read_head != ldata->canon_head) {
+               head = ldata->read_head;
 
                /* erase a single possibly multibyte character */
                do {
                        head = (head - 1) & (N_TTY_BUF_SIZE-1);
-                       c = tty->read_buf[head];
-               } while (is_continuation(c, tty) && head != tty->canon_head);
+                       c = ldata->read_buf[head];
+               } while (is_continuation(c, tty) && head != ldata->canon_head);
 
                /* do not partially erase */
                if (is_continuation(c, tty))
@@ -921,30 +960,31 @@ static void eraser(unsigned char c, struct tty_struct *tty)
                        else if (seen_alnums)
                                break;
                }
-               cnt = (tty->read_head - head) & (N_TTY_BUF_SIZE-1);
-               spin_lock_irqsave(&tty->read_lock, flags);
-               tty->read_head = head;
-               tty->read_cnt -= cnt;
-               spin_unlock_irqrestore(&tty->read_lock, flags);
+               cnt = (ldata->read_head - head) & (N_TTY_BUF_SIZE-1);
+               spin_lock_irqsave(&ldata->read_lock, flags);
+               ldata->read_head = head;
+               ldata->read_cnt -= cnt;
+               spin_unlock_irqrestore(&ldata->read_lock, flags);
                if (L_ECHO(tty)) {
                        if (L_ECHOPRT(tty)) {
-                               if (!tty->erasing) {
-                                       echo_char_raw('\\', tty);
-                                       tty->erasing = 1;
+                               if (!ldata->erasing) {
+                                       echo_char_raw('\\', ldata);
+                                       ldata->erasing = 1;
                                }
                                /* if cnt > 1, output a multi-byte character */
                                echo_char(c, tty);
                                while (--cnt > 0) {
                                        head = (head+1) & (N_TTY_BUF_SIZE-1);
-                                       echo_char_raw(tty->read_buf[head], tty);
-                                       echo_move_back_col(tty);
+                                       echo_char_raw(ldata->read_buf[head],
+                                                       ldata);
+                                       echo_move_back_col(ldata);
                                }
                        } else if (kill_type == ERASE && !L_ECHOE(tty)) {
                                echo_char(ERASE_CHAR(tty), tty);
                        } else if (c == '\t') {
                                unsigned int num_chars = 0;
                                int after_tab = 0;
-                               unsigned long tail = tty->read_head;
+                               unsigned long tail = ldata->read_head;
 
                                /*
                                 * Count the columns used for characters
@@ -953,9 +993,9 @@ static void eraser(unsigned char c, struct tty_struct *tty)
                                 * This info is used to go back the correct
                                 * number of columns.
                                 */
-                               while (tail != tty->canon_head) {
+                               while (tail != ldata->canon_head) {
                                        tail = (tail-1) & (N_TTY_BUF_SIZE-1);
-                                       c = tty->read_buf[tail];
+                                       c = ldata->read_buf[tail];
                                        if (c == '\t') {
                                                after_tab = 1;
                                                break;
@@ -966,25 +1006,25 @@ static void eraser(unsigned char c, struct tty_struct *tty)
                                                num_chars++;
                                        }
                                }
-                               echo_erase_tab(num_chars, after_tab, tty);
+                               echo_erase_tab(num_chars, after_tab, ldata);
                        } else {
                                if (iscntrl(c) && L_ECHOCTL(tty)) {
-                                       echo_char_raw('\b', tty);
-                                       echo_char_raw(' ', tty);
-                                       echo_char_raw('\b', tty);
+                                       echo_char_raw('\b', ldata);
+                                       echo_char_raw(' ', ldata);
+                                       echo_char_raw('\b', ldata);
                                }
                                if (!iscntrl(c) || L_ECHOCTL(tty)) {
-                                       echo_char_raw('\b', tty);
-                                       echo_char_raw(' ', tty);
-                                       echo_char_raw('\b', tty);
+                                       echo_char_raw('\b', ldata);
+                                       echo_char_raw(' ', ldata);
+                                       echo_char_raw('\b', ldata);
                                }
                        }
                }
                if (kill_type == ERASE)
                        break;
        }
-       if (tty->read_head == tty->canon_head && L_ECHO(tty))
-               finish_erasing(tty);
+       if (ldata->read_head == ldata->canon_head && L_ECHO(tty))
+               finish_erasing(ldata);
 }
 
 /**
@@ -1023,6 +1063,8 @@ static inline void isig(int sig, struct tty_struct *tty, int flush)
 
 static inline void n_tty_receive_break(struct tty_struct *tty)
 {
+       struct n_tty_data *ldata = tty->disc_data;
+
        if (I_IGNBRK(tty))
                return;
        if (I_BRKINT(tty)) {
@@ -1030,10 +1072,10 @@ static inline void n_tty_receive_break(struct tty_struct *tty)
                return;
        }
        if (I_PARMRK(tty)) {
-               put_tty_queue('\377', tty);
-               put_tty_queue('\0', tty);
+               put_tty_queue('\377', ldata);
+               put_tty_queue('\0', ldata);
        }
-       put_tty_queue('\0', tty);
+       put_tty_queue('\0', ldata);
        wake_up_interruptible(&tty->read_wait);
 }
 
@@ -1052,16 +1094,17 @@ static inline void n_tty_receive_break(struct tty_struct *tty)
 
 static inline void n_tty_receive_overrun(struct tty_struct *tty)
 {
+       struct n_tty_data *ldata = tty->disc_data;
        char buf[64];
 
-       tty->num_overrun++;
-       if (time_before(tty->overrun_time, jiffies - HZ) ||
-                       time_after(tty->overrun_time, jiffies)) {
+       ldata->num_overrun++;
+       if (time_after(jiffies, ldata->overrun_time + HZ) ||
+                       time_after(ldata->overrun_time, jiffies)) {
                printk(KERN_WARNING "%s: %d input overrun(s)\n",
                        tty_name(tty, buf),
-                       tty->num_overrun);
-               tty->overrun_time = jiffies;
-               tty->num_overrun = 0;
+                       ldata->num_overrun);
+               ldata->overrun_time = jiffies;
+               ldata->num_overrun = 0;
        }
 }
 
@@ -1076,16 +1119,18 @@ static inline void n_tty_receive_overrun(struct tty_struct *tty)
 static inline void n_tty_receive_parity_error(struct tty_struct *tty,
                                              unsigned char c)
 {
+       struct n_tty_data *ldata = tty->disc_data;
+
        if (I_IGNPAR(tty))
                return;
        if (I_PARMRK(tty)) {
-               put_tty_queue('\377', tty);
-               put_tty_queue('\0', tty);
-               put_tty_queue(c, tty);
+               put_tty_queue('\377', ldata);
+               put_tty_queue('\0', ldata);
+               put_tty_queue(c, ldata);
        } else  if (I_INPCK(tty))
-               put_tty_queue('\0', tty);
+               put_tty_queue('\0', ldata);
        else
-               put_tty_queue(c, tty);
+               put_tty_queue(c, ldata);
        wake_up_interruptible(&tty->read_wait);
 }
 
@@ -1101,11 +1146,12 @@ static inline void n_tty_receive_parity_error(struct tty_struct *tty,
 
 static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
 {
+       struct n_tty_data *ldata = tty->disc_data;
        unsigned long flags;
        int parmrk;
 
-       if (tty->raw) {
-               put_tty_queue(c, tty);
+       if (ldata->raw) {
+               put_tty_queue(c, ldata);
                return;
        }
 
@@ -1115,7 +1161,7 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
                c = tolower(c);
 
        if (L_EXTPROC(tty)) {
-               put_tty_queue(c, tty);
+               put_tty_queue(c, ldata);
                return;
        }
 
@@ -1143,26 +1189,26 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
         * handle specially, do shortcut processing to speed things
         * up.
         */
-       if (!test_bit(c, tty->process_char_map) || tty->lnext) {
-               tty->lnext = 0;
+       if (!test_bit(c, ldata->process_char_map) || ldata->lnext) {
+               ldata->lnext = 0;
                parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0;
-               if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) {
+               if (ldata->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) {
                        /* beep if no space */
                        if (L_ECHO(tty))
                                process_output('\a', tty);
                        return;
                }
                if (L_ECHO(tty)) {
-                       finish_erasing(tty);
+                       finish_erasing(ldata);
                        /* Record the column of first canon char. */
-                       if (tty->canon_head == tty->read_head)
-                               echo_set_canon_col(tty);
+                       if (ldata->canon_head == ldata->read_head)
+                               echo_set_canon_col(ldata);
                        echo_char(c, tty);
                        process_echoes(tty);
                }
                if (parmrk)
-                       put_tty_queue(c, tty);
-               put_tty_queue(c, tty);
+                       put_tty_queue(c, ldata);
+               put_tty_queue(c, ldata);
                return;
        }
 
@@ -1218,7 +1264,7 @@ send_signal:
        } else if (c == '\n' && I_INLCR(tty))
                c = '\r';
 
-       if (tty->icanon) {
+       if (ldata->icanon) {
                if (c == ERASE_CHAR(tty) || c == KILL_CHAR(tty) ||
                    (c == WERASE_CHAR(tty) && L_IEXTEN(tty))) {
                        eraser(c, tty);
@@ -1226,12 +1272,12 @@ send_signal:
                        return;
                }
                if (c == LNEXT_CHAR(tty) && L_IEXTEN(tty)) {
-                       tty->lnext = 1;
+                       ldata->lnext = 1;
                        if (L_ECHO(tty)) {
-                               finish_erasing(tty);
+                               finish_erasing(ldata);
                                if (L_ECHOCTL(tty)) {
-                                       echo_char_raw('^', tty);
-                                       echo_char_raw('\b', tty);
+                                       echo_char_raw('^', ldata);
+                                       echo_char_raw('\b', ldata);
                                        process_echoes(tty);
                                }
                        }
@@ -1239,34 +1285,34 @@ send_signal:
                }
                if (c == REPRINT_CHAR(tty) && L_ECHO(tty) &&
                    L_IEXTEN(tty)) {
-                       unsigned long tail = tty->canon_head;
+                       unsigned long tail = ldata->canon_head;
 
-                       finish_erasing(tty);
+                       finish_erasing(ldata);
                        echo_char(c, tty);
-                       echo_char_raw('\n', tty);
-                       while (tail != tty->read_head) {
-                               echo_char(tty->read_buf[tail], tty);
+                       echo_char_raw('\n', ldata);
+                       while (tail != ldata->read_head) {
+                               echo_char(ldata->read_buf[tail], tty);
                                tail = (tail+1) & (N_TTY_BUF_SIZE-1);
                        }
                        process_echoes(tty);
                        return;
                }
                if (c == '\n') {
-                       if (tty->read_cnt >= N_TTY_BUF_SIZE) {
+                       if (ldata->read_cnt >= N_TTY_BUF_SIZE) {
                                if (L_ECHO(tty))
                                        process_output('\a', tty);
                                return;
                        }
                        if (L_ECHO(tty) || L_ECHONL(tty)) {
-                               echo_char_raw('\n', tty);
+                               echo_char_raw('\n', ldata);
                                process_echoes(tty);
                        }
                        goto handle_newline;
                }
                if (c == EOF_CHAR(tty)) {
-                       if (tty->read_cnt >= N_TTY_BUF_SIZE)
+                       if (ldata->read_cnt >= N_TTY_BUF_SIZE)
                                return;
-                       if (tty->canon_head != tty->read_head)
+                       if (ldata->canon_head != ldata->read_head)
                                set_bit(TTY_PUSH, &tty->flags);
                        c = __DISABLED_CHAR;
                        goto handle_newline;
@@ -1275,7 +1321,7 @@ send_signal:
                    (c == EOL2_CHAR(tty) && L_IEXTEN(tty))) {
                        parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty))
                                 ? 1 : 0;
-                       if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk)) {
+                       if (ldata->read_cnt >= (N_TTY_BUF_SIZE - parmrk)) {
                                if (L_ECHO(tty))
                                        process_output('\a', tty);
                                return;
@@ -1285,8 +1331,8 @@ send_signal:
                         */
                        if (L_ECHO(tty)) {
                                /* Record the column of first canon char. */
-                               if (tty->canon_head == tty->read_head)
-                                       echo_set_canon_col(tty);
+                               if (ldata->canon_head == ldata->read_head)
+                                       echo_set_canon_col(ldata);
                                echo_char(c, tty);
                                process_echoes(tty);
                        }
@@ -1295,15 +1341,15 @@ send_signal:
                         * EOL_CHAR and EOL2_CHAR?
                         */
                        if (parmrk)
-                               put_tty_queue(c, tty);
+                               put_tty_queue(c, ldata);
 
 handle_newline:
-                       spin_lock_irqsave(&tty->read_lock, flags);
-                       set_bit(tty->read_head, tty->read_flags);
-                       put_tty_queue_nolock(c, tty);
-                       tty->canon_head = tty->read_head;
-                       tty->canon_data++;
-                       spin_unlock_irqrestore(&tty->read_lock, flags);
+                       spin_lock_irqsave(&ldata->read_lock, flags);
+                       set_bit(ldata->read_head, ldata->read_flags);
+                       put_tty_queue_nolock(c, ldata);
+                       ldata->canon_head = ldata->read_head;
+                       ldata->canon_data++;
+                       spin_unlock_irqrestore(&ldata->read_lock, flags);
                        kill_fasync(&tty->fasync, SIGIO, POLL_IN);
                        if (waitqueue_active(&tty->read_wait))
                                wake_up_interruptible(&tty->read_wait);
@@ -1312,29 +1358,29 @@ handle_newline:
        }
 
        parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0;
-       if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) {
+       if (ldata->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) {
                /* beep if no space */
                if (L_ECHO(tty))
                        process_output('\a', tty);
                return;
        }
        if (L_ECHO(tty)) {
-               finish_erasing(tty);
+               finish_erasing(ldata);
                if (c == '\n')
-                       echo_char_raw('\n', tty);
+                       echo_char_raw('\n', ldata);
                else {
                        /* Record the column of first canon char. */
-                       if (tty->canon_head == tty->read_head)
-                               echo_set_canon_col(tty);
+                       if (ldata->canon_head == ldata->read_head)
+                               echo_set_canon_col(ldata);
                        echo_char(c, tty);
                }
                process_echoes(tty);
        }
 
        if (parmrk)
-               put_tty_queue(c, tty);
+               put_tty_queue(c, ldata);
 
-       put_tty_queue(c, tty);
+       put_tty_queue(c, ldata);
 }
 
 
@@ -1369,33 +1415,31 @@ static void n_tty_write_wakeup(struct tty_struct *tty)
 static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
                              char *fp, int count)
 {
+       struct n_tty_data *ldata = tty->disc_data;
        const unsigned char *p;
        char *f, flags = TTY_NORMAL;
        int     i;
        char    buf[64];
        unsigned long cpuflags;
 
-       if (!tty->read_buf)
-               return;
-
-       if (tty->real_raw) {
-               spin_lock_irqsave(&tty->read_lock, cpuflags);
-               i = min(N_TTY_BUF_SIZE - tty->read_cnt,
-                       N_TTY_BUF_SIZE - tty->read_head);
+       if (ldata->real_raw) {
+               spin_lock_irqsave(&ldata->read_lock, cpuflags);
+               i = min(N_TTY_BUF_SIZE - ldata->read_cnt,
+                       N_TTY_BUF_SIZE - ldata->read_head);
                i = min(count, i);
-               memcpy(tty->read_buf + tty->read_head, cp, i);
-               tty->read_head = (tty->read_head + i) & (N_TTY_BUF_SIZE-1);
-               tty->read_cnt += i;
+               memcpy(ldata->read_buf + ldata->read_head, cp, i);
+               ldata->read_head = (ldata->read_head + i) & (N_TTY_BUF_SIZE-1);
+               ldata->read_cnt += i;
                cp += i;
                count -= i;
 
-               i = min(N_TTY_BUF_SIZE - tty->read_cnt,
-                       N_TTY_BUF_SIZE - tty->read_head);
+               i = min(N_TTY_BUF_SIZE - ldata->read_cnt,
+                       N_TTY_BUF_SIZE - ldata->read_head);
                i = min(count, i);
-               memcpy(tty->read_buf + tty->read_head, cp, i);
-               tty->read_head = (tty->read_head + i) & (N_TTY_BUF_SIZE-1);
-               tty->read_cnt += i;
-               spin_unlock_irqrestore(&tty->read_lock, cpuflags);
+               memcpy(ldata->read_buf + ldata->read_head, cp, i);
+               ldata->read_head = (ldata->read_head + i) & (N_TTY_BUF_SIZE-1);
+               ldata->read_cnt += i;
+               spin_unlock_irqrestore(&ldata->read_lock, cpuflags);
        } else {
                for (i = count, p = cp, f = fp; i; i--, p++) {
                        if (f)
@@ -1426,7 +1470,7 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
 
        n_tty_set_room(tty);
 
-       if ((!tty->icanon && (tty->read_cnt >= tty->minimum_to_wake)) ||
+       if ((!ldata->icanon && (ldata->read_cnt >= tty->minimum_to_wake)) ||
                L_EXTPROC(tty)) {
                kill_fasync(&tty->fasync, SIGIO, POLL_IN);
                if (waitqueue_active(&tty->read_wait))
@@ -1470,25 +1514,25 @@ int is_ignored(int sig)
 
 static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
 {
+       struct n_tty_data *ldata = tty->disc_data;
        int canon_change = 1;
-       BUG_ON(!tty);
 
        if (old)
                canon_change = (old->c_lflag ^ tty->termios.c_lflag) & ICANON;
        if (canon_change) {
-               memset(&tty->read_flags, 0, sizeof tty->read_flags);
-               tty->canon_head = tty->read_tail;
-               tty->canon_data = 0;
-               tty->erasing = 0;
+               bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE);
+               ldata->canon_head = ldata->read_tail;
+               ldata->canon_data = 0;
+               ldata->erasing = 0;
        }
 
-       if (canon_change && !L_ICANON(tty) && tty->read_cnt)
+       if (canon_change && !L_ICANON(tty) && ldata->read_cnt)
                wake_up_interruptible(&tty->read_wait);
 
-       tty->icanon = (L_ICANON(tty) != 0);
+       ldata->icanon = (L_ICANON(tty) != 0);
        if (test_bit(TTY_HW_COOK_IN, &tty->flags)) {
-               tty->raw = 1;
-               tty->real_raw = 1;
+               ldata->raw = 1;
+               ldata->real_raw = 1;
                n_tty_set_room(tty);
                return;
        }
@@ -1496,51 +1540,51 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
            I_ICRNL(tty) || I_INLCR(tty) || L_ICANON(tty) ||
            I_IXON(tty) || L_ISIG(tty) || L_ECHO(tty) ||
            I_PARMRK(tty)) {
-               memset(tty->process_char_map, 0, 256/8);
+               bitmap_zero(ldata->process_char_map, 256);
 
                if (I_IGNCR(tty) || I_ICRNL(tty))
-                       set_bit('\r', tty->process_char_map);
+                       set_bit('\r', ldata->process_char_map);
                if (I_INLCR(tty))
-                       set_bit('\n', tty->process_char_map);
+                       set_bit('\n', ldata->process_char_map);
 
                if (L_ICANON(tty)) {
-                       set_bit(ERASE_CHAR(tty), tty->process_char_map);
-                       set_bit(KILL_CHAR(tty), tty->process_char_map);
-                       set_bit(EOF_CHAR(tty), tty->process_char_map);
-                       set_bit('\n', tty->process_char_map);
-                       set_bit(EOL_CHAR(tty), tty->process_char_map);
+                       set_bit(ERASE_CHAR(tty), ldata->process_char_map);
+                       set_bit(KILL_CHAR(tty), ldata->process_char_map);
+                       set_bit(EOF_CHAR(tty), ldata->process_char_map);
+                       set_bit('\n', ldata->process_char_map);
+                       set_bit(EOL_CHAR(tty), ldata->process_char_map);
                        if (L_IEXTEN(tty)) {
                                set_bit(WERASE_CHAR(tty),
-                                       tty->process_char_map);
+                                       ldata->process_char_map);
                                set_bit(LNEXT_CHAR(tty),
-                                       tty->process_char_map);
+                                       ldata->process_char_map);
                                set_bit(EOL2_CHAR(tty),
-                                       tty->process_char_map);
+                                       ldata->process_char_map);
                                if (L_ECHO(tty))
                                        set_bit(REPRINT_CHAR(tty),
-                                               tty->process_char_map);
+                                               ldata->process_char_map);
                        }
                }
                if (I_IXON(tty)) {
-                       set_bit(START_CHAR(tty), tty->process_char_map);
-                       set_bit(STOP_CHAR(tty), tty->process_char_map);
+                       set_bit(START_CHAR(tty), ldata->process_char_map);
+                       set_bit(STOP_CHAR(tty), ldata->process_char_map);
                }
                if (L_ISIG(tty)) {
-                       set_bit(INTR_CHAR(tty), tty->process_char_map);
-                       set_bit(QUIT_CHAR(tty), tty->process_char_map);
-                       set_bit(SUSP_CHAR(tty), tty->process_char_map);
+                       set_bit(INTR_CHAR(tty), ldata->process_char_map);
+                       set_bit(QUIT_CHAR(tty), ldata->process_char_map);
+                       set_bit(SUSP_CHAR(tty), ldata->process_char_map);
                }
-               clear_bit(__DISABLED_CHAR, tty->process_char_map);
-               tty->raw = 0;
-               tty->real_raw = 0;
+               clear_bit(__DISABLED_CHAR, ldata->process_char_map);
+               ldata->raw = 0;
+               ldata->real_raw = 0;
        } else {
-               tty->raw = 1;
+               ldata->raw = 1;
                if ((I_IGNBRK(tty) || (!I_BRKINT(tty) && !I_PARMRK(tty))) &&
                    (I_IGNPAR(tty) || !I_INPCK(tty)) &&
                    (tty->driver->flags & TTY_DRIVER_REAL_RAW))
-                       tty->real_raw = 1;
+                       ldata->real_raw = 1;
                else
-                       tty->real_raw = 0;
+                       ldata->real_raw = 0;
        }
        n_tty_set_room(tty);
        /* The termios change make the tty ready for I/O */
@@ -1560,15 +1604,13 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
 
 static void n_tty_close(struct tty_struct *tty)
 {
+       struct n_tty_data *ldata = tty->disc_data;
+
        n_tty_flush_buffer(tty);
-       if (tty->read_buf) {
-               kfree(tty->read_buf);
-               tty->read_buf = NULL;
-       }
-       if (tty->echo_buf) {
-               kfree(tty->echo_buf);
-               tty->echo_buf = NULL;
-       }
+       kfree(ldata->read_buf);
+       kfree(ldata->echo_buf);
+       kfree(ldata);
+       tty->disc_data = NULL;
 }
 
 /**
@@ -1583,37 +1625,50 @@ static void n_tty_close(struct tty_struct *tty)
 
 static int n_tty_open(struct tty_struct *tty)
 {
-       if (!tty)
-               return -EINVAL;
+       struct n_tty_data *ldata;
+
+       ldata = kzalloc(sizeof(*ldata), GFP_KERNEL);
+       if (!ldata)
+               goto err;
+
+       ldata->overrun_time = jiffies;
+       mutex_init(&ldata->atomic_read_lock);
+       mutex_init(&ldata->output_lock);
+       mutex_init(&ldata->echo_lock);
+       spin_lock_init(&ldata->read_lock);
 
        /* These are ugly. Currently a malloc failure here can panic */
-       if (!tty->read_buf) {
-               tty->read_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL);
-               if (!tty->read_buf)
-                       return -ENOMEM;
-       }
-       if (!tty->echo_buf) {
-               tty->echo_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL);
+       ldata->read_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL);
+       ldata->echo_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL);
+       if (!ldata->read_buf || !ldata->echo_buf)
+               goto err_free_bufs;
 
-               if (!tty->echo_buf)
-                       return -ENOMEM;
-       }
+       tty->disc_data = ldata;
        reset_buffer_flags(tty);
        tty_unthrottle(tty);
-       tty->column = 0;
+       ldata->column = 0;
        n_tty_set_termios(tty, NULL);
        tty->minimum_to_wake = 1;
        tty->closing = 0;
+
        return 0;
+err_free_bufs:
+       kfree(ldata->read_buf);
+       kfree(ldata->echo_buf);
+       kfree(ldata);
+err:
+       return -ENOMEM;
 }
 
 static inline int input_available_p(struct tty_struct *tty, int amt)
 {
+       struct n_tty_data *ldata = tty->disc_data;
+
        tty_flush_to_ldisc(tty);
-       if (tty->icanon && !L_EXTPROC(tty)) {
-               if (tty->canon_data)
+       if (ldata->icanon && !L_EXTPROC(tty)) {
+               if (ldata->canon_data)
                        return 1;
-       } else if (tty->read_cnt >= (amt ? amt : 1))
+       } else if (ldata->read_cnt >= (amt ? amt : 1))
                return 1;
 
        return 0;
@@ -1632,7 +1687,7 @@ static inline int input_available_p(struct tty_struct *tty, int amt)
  *     buffer, and once to drain the space from the (physical) beginning of
  *     the buffer to head pointer.
  *
- *     Called under the tty->atomic_read_lock sem
+ *     Called under the ldata->atomic_read_lock sem
  *
  */
 
@@ -1641,29 +1696,31 @@ static int copy_from_read_buf(struct tty_struct *tty,
                                      size_t *nr)
 
 {
+       struct n_tty_data *ldata = tty->disc_data;
        int retval;
        size_t n;
        unsigned long flags;
        bool is_eof;
 
        retval = 0;
-       spin_lock_irqsave(&tty->read_lock, flags);
-       n = min(tty->read_cnt, N_TTY_BUF_SIZE - tty->read_tail);
+       spin_lock_irqsave(&ldata->read_lock, flags);
+       n = min(ldata->read_cnt, N_TTY_BUF_SIZE - ldata->read_tail);
        n = min(*nr, n);
-       spin_unlock_irqrestore(&tty->read_lock, flags);
+       spin_unlock_irqrestore(&ldata->read_lock, flags);
        if (n) {
-               retval = copy_to_user(*b, &tty->read_buf[tty->read_tail], n);
+               retval = copy_to_user(*b, &ldata->read_buf[ldata->read_tail], n);
                n -= retval;
                is_eof = n == 1 &&
-                       tty->read_buf[tty->read_tail] == EOF_CHAR(tty);
-               tty_audit_add_data(tty, &tty->read_buf[tty->read_tail], n);
-               spin_lock_irqsave(&tty->read_lock, flags);
-               tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1);
-               tty->read_cnt -= n;
+                       ldata->read_buf[ldata->read_tail] == EOF_CHAR(tty);
+               tty_audit_add_data(tty, &ldata->read_buf[ldata->read_tail], n,
+                               ldata->icanon);
+               spin_lock_irqsave(&ldata->read_lock, flags);
+               ldata->read_tail = (ldata->read_tail + n) & (N_TTY_BUF_SIZE-1);
+               ldata->read_cnt -= n;
                /* Turn single EOF into zero-length read */
-               if (L_EXTPROC(tty) && tty->icanon && is_eof && !tty->read_cnt)
+               if (L_EXTPROC(tty) && ldata->icanon && is_eof && !ldata->read_cnt)
                        n = 0;
-               spin_unlock_irqrestore(&tty->read_lock, flags);
+               spin_unlock_irqrestore(&ldata->read_lock, flags);
                *b += n;
                *nr -= n;
        }
@@ -1730,6 +1787,7 @@ static int job_control(struct tty_struct *tty, struct file *file)
 static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
                         unsigned char __user *buf, size_t nr)
 {
+       struct n_tty_data *ldata = tty->disc_data;
        unsigned char __user *b = buf;
        DECLARE_WAITQUEUE(wait, current);
        int c;
@@ -1741,17 +1799,13 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
        int packet;
 
 do_it_again:
-
-       if (WARN_ON(!tty->read_buf))
-               return -EAGAIN;
-
        c = job_control(tty, file);
        if (c < 0)
                return c;
 
        minimum = time = 0;
        timeout = MAX_SCHEDULE_TIMEOUT;
-       if (!tty->icanon) {
+       if (!ldata->icanon) {
                time = (HZ / 10) * TIME_CHAR(tty);
                minimum = MIN_CHAR(tty);
                if (minimum) {
@@ -1774,10 +1828,10 @@ do_it_again:
         *      Internal serialization of reads.
         */
        if (file->f_flags & O_NONBLOCK) {
-               if (!mutex_trylock(&tty->atomic_read_lock))
+               if (!mutex_trylock(&ldata->atomic_read_lock))
                        return -EAGAIN;
        } else {
-               if (mutex_lock_interruptible(&tty->atomic_read_lock))
+               if (mutex_lock_interruptible(&ldata->atomic_read_lock))
                        return -ERESTARTSYS;
        }
        packet = tty->packet;
@@ -1830,7 +1884,6 @@ do_it_again:
                        /* FIXME: does n_tty_set_room need locking ? */
                        n_tty_set_room(tty);
                        timeout = schedule_timeout(timeout);
-                       BUG_ON(!tty->read_buf);
                        continue;
                }
                __set_current_state(TASK_RUNNING);
@@ -1845,45 +1898,45 @@ do_it_again:
                        nr--;
                }
 
-               if (tty->icanon && !L_EXTPROC(tty)) {
+               if (ldata->icanon && !L_EXTPROC(tty)) {
                        /* N.B. avoid overrun if nr == 0 */
-                       spin_lock_irqsave(&tty->read_lock, flags);
-                       while (nr && tty->read_cnt) {
+                       spin_lock_irqsave(&ldata->read_lock, flags);
+                       while (nr && ldata->read_cnt) {
                                int eol;
 
-                               eol = test_and_clear_bit(tty->read_tail,
-                                               tty->read_flags);
-                               c = tty->read_buf[tty->read_tail];
-                               tty->read_tail = ((tty->read_tail+1) &
+                               eol = test_and_clear_bit(ldata->read_tail,
+                                               ldata->read_flags);
+                               c = ldata->read_buf[ldata->read_tail];
+                               ldata->read_tail = ((ldata->read_tail+1) &
                                                  (N_TTY_BUF_SIZE-1));
-                               tty->read_cnt--;
+                               ldata->read_cnt--;
                                if (eol) {
                                        /* this test should be redundant:
                                         * we shouldn't be reading data if
                                         * canon_data is 0
                                         */
-                                       if (--tty->canon_data < 0)
-                                               tty->canon_data = 0;
+                                       if (--ldata->canon_data < 0)
+                                               ldata->canon_data = 0;
                                }
-                               spin_unlock_irqrestore(&tty->read_lock, flags);
+                               spin_unlock_irqrestore(&ldata->read_lock, flags);
 
                                if (!eol || (c != __DISABLED_CHAR)) {
                                        if (tty_put_user(tty, c, b++)) {
                                                retval = -EFAULT;
                                                b--;
-                                               spin_lock_irqsave(&tty->read_lock, flags);
+                                               spin_lock_irqsave(&ldata->read_lock, flags);
                                                break;
                                        }
                                        nr--;
                                }
                                if (eol) {
                                        tty_audit_push(tty);
-                                       spin_lock_irqsave(&tty->read_lock, flags);
+                                       spin_lock_irqsave(&ldata->read_lock, flags);
                                        break;
                                }
-                               spin_lock_irqsave(&tty->read_lock, flags);
+                               spin_lock_irqsave(&ldata->read_lock, flags);
                        }
-                       spin_unlock_irqrestore(&tty->read_lock, flags);
+                       spin_unlock_irqrestore(&ldata->read_lock, flags);
                        if (retval)
                                break;
                } else {
@@ -1915,7 +1968,7 @@ do_it_again:
                if (time)
                        timeout = time;
        }
-       mutex_unlock(&tty->atomic_read_lock);
+       mutex_unlock(&ldata->atomic_read_lock);
        remove_wait_queue(&tty->read_wait, &wait);
 
        if (!waitqueue_active(&tty->read_wait))
@@ -2076,19 +2129,19 @@ static unsigned int n_tty_poll(struct tty_struct *tty, struct file *file,
        return mask;
 }
 
-static unsigned long inq_canon(struct tty_struct *tty)
+static unsigned long inq_canon(struct n_tty_data *ldata)
 {
        int nr, head, tail;
 
-       if (!tty->canon_data)
+       if (!ldata->canon_data)
                return 0;
-       head = tty->canon_head;
-       tail = tty->read_tail;
+       head = ldata->canon_head;
+       tail = ldata->read_tail;
        nr = (head - tail) & (N_TTY_BUF_SIZE-1);
        /* Skip EOF-chars.. */
        while (head != tail) {
-               if (test_bit(tail, tty->read_flags) &&
-                   tty->read_buf[tail] == __DISABLED_CHAR)
+               if (test_bit(tail, ldata->read_flags) &&
+                   ldata->read_buf[tail] == __DISABLED_CHAR)
                        nr--;
                tail = (tail+1) & (N_TTY_BUF_SIZE-1);
        }
@@ -2098,6 +2151,7 @@ static unsigned long inq_canon(struct tty_struct *tty)
 static int n_tty_ioctl(struct tty_struct *tty, struct file *file,
                       unsigned int cmd, unsigned long arg)
 {
+       struct n_tty_data *ldata = tty->disc_data;
        int retval;
 
        switch (cmd) {
@@ -2105,9 +2159,9 @@ static int n_tty_ioctl(struct tty_struct *tty, struct file *file,
                return put_user(tty_chars_in_buffer(tty), (int __user *) arg);
        case TIOCINQ:
                /* FIXME: Locking */
-               retval = tty->read_cnt;
+               retval = ldata->read_cnt;
                if (L_ICANON(tty))
-                       retval = inq_canon(tty);
+                       retval = inq_canon(ldata);
                return put_user(retval, (unsigned int __user *) arg);
        default:
                return n_tty_ioctl_helper(tty, file, cmd, arg);
index a82b39939a9cab4fc02a6d6d0be13607284d68ce..4219f040adb8ff55f35109accc5eea5e55ef2366 100644 (file)
@@ -4,9 +4,6 @@
  *  Added support for a Unix98-style ptmx device.
  *    -- C. Scott Ananian <cananian@alumni.princeton.edu>, 14-Jan-1998
  *
- *  When reading this code see also fs/devpts. In particular note that the
- *  driver_data field is used by the devpts side as a binding to the devpts
- *  inode.
  */
 
 #include <linux/module.h>
@@ -59,7 +56,7 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
 #ifdef CONFIG_UNIX98_PTYS
                if (tty->driver == ptm_driver) {
                        mutex_lock(&devpts_mutex);
-                       devpts_pty_kill(tty->link);
+                       devpts_pty_kill(tty->link->driver_data);
                        mutex_unlock(&devpts_mutex);
                }
 #endif
@@ -96,7 +93,7 @@ static void pty_unthrottle(struct tty_struct *tty)
 
 static int pty_space(struct tty_struct *to)
 {
-       int n = 8192 - to->buf.memory_used;
+       int n = 8192 - to->port->buf.memory_used;
        if (n < 0)
                return 0;
        return n;
@@ -348,6 +345,7 @@ static int pty_common_install(struct tty_driver *driver, struct tty_struct *tty,
        tty_port_init(ports[1]);
        o_tty->port = ports[0];
        tty->port = ports[1];
+       o_tty->port->itty = o_tty;
 
        tty_driver_kref_get(driver);
        tty->count++;
@@ -366,8 +364,15 @@ err:
        return retval;
 }
 
+/* this is called once with whichever end is closed last */
+static void pty_unix98_shutdown(struct tty_struct *tty)
+{
+       devpts_kill_index(tty->driver_data, tty->index);
+}
+
 static void pty_cleanup(struct tty_struct *tty)
 {
+       tty->port->itty = NULL;
        kfree(tty->port);
 }
 
@@ -547,7 +552,7 @@ static struct tty_struct *pts_unix98_lookup(struct tty_driver *driver,
        struct tty_struct *tty;
 
        mutex_lock(&devpts_mutex);
-       tty = devpts_get_tty(pts_inode, idx);
+       tty = devpts_get_priv(pts_inode);
        mutex_unlock(&devpts_mutex);
        /* Master must be open before slave */
        if (!tty)
@@ -581,6 +586,7 @@ static const struct tty_operations ptm_unix98_ops = {
        .set_termios = pty_set_termios,
        .ioctl = pty_unix98_ioctl,
        .resize = pty_resize,
+       .shutdown = pty_unix98_shutdown,
        .cleanup = pty_cleanup
 };
 
@@ -596,6 +602,7 @@ static const struct tty_operations pty_unix98_ops = {
        .chars_in_buffer = pty_chars_in_buffer,
        .unthrottle = pty_unthrottle,
        .set_termios = pty_set_termios,
+       .shutdown = pty_unix98_shutdown,
        .cleanup = pty_cleanup,
 };
 
@@ -614,6 +621,7 @@ static const struct tty_operations pty_unix98_ops = {
 static int ptmx_open(struct inode *inode, struct file *filp)
 {
        struct tty_struct *tty;
+       struct inode *slave_inode;
        int retval;
        int index;
 
@@ -650,15 +658,21 @@ static int ptmx_open(struct inode *inode, struct file *filp)
 
        tty_add_file(tty, filp);
 
-       retval = devpts_pty_new(inode, tty->link);
-       if (retval)
+       slave_inode = devpts_pty_new(inode,
+                       MKDEV(UNIX98_PTY_SLAVE_MAJOR, index), index,
+                       tty->link);
+       if (IS_ERR(slave_inode)) {
+               retval = PTR_ERR(slave_inode);
                goto err_release;
+       }
 
        retval = ptm_driver->ops->open(tty, filp);
        if (retval)
                goto err_release;
 
        tty_unlock(tty);
+       tty->driver_data = inode;
+       tty->link->driver_data = slave_inode;
        return 0;
 err_release:
        tty_unlock(tty);
index 3ba4234592bc8a7285b2d488ce9b0db010e2e018..5ccbd90540cfdf4bef3be26c15d2202393ced213 100644 (file)
@@ -2349,16 +2349,14 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
                        serial_port_out(port, UART_EFR, efr);
        }
 
-#ifdef CONFIG_ARCH_OMAP1
        /* Workaround to enable 115200 baud on OMAP1510 internal ports */
-       if (cpu_is_omap1510() && is_omap_port(up)) {
+       if (is_omap1510_8250(up)) {
                if (baud == 115200) {
                        quot = 1;
                        serial_port_out(port, UART_OMAP_OSC_12M_SEL, 1);
                } else
                        serial_port_out(port, UART_OMAP_OSC_12M_SEL, 0);
        }
-#endif
 
        /*
         * For NatSemi, switch to bank 2 not bank 1, to avoid resetting EXCR2,
@@ -2439,10 +2437,9 @@ static unsigned int serial8250_port_size(struct uart_8250_port *pt)
 {
        if (pt->port.iotype == UPIO_AU)
                return 0x1000;
-#ifdef CONFIG_ARCH_OMAP1
-       if (is_omap_port(pt))
+       if (is_omap1_8250(pt))
                return 0x16 << pt->port.regshift;
-#endif
+
        return 8 << pt->port.regshift;
 }
 
index 5a76f9c8d36b98d943ef574de25c4400579c0551..3b4ea84898c2e719dc233ecddde63dc3c421bd0d 100644 (file)
@@ -106,3 +106,39 @@ static inline int serial8250_pnp_init(void) { return 0; }
 static inline void serial8250_pnp_exit(void) { }
 #endif
 
+#ifdef CONFIG_ARCH_OMAP1
+static inline int is_omap1_8250(struct uart_8250_port *pt)
+{
+       int res;
+
+       switch (pt->port.mapbase) {
+       case OMAP1_UART1_BASE:
+       case OMAP1_UART2_BASE:
+       case OMAP1_UART3_BASE:
+               res = 1;
+               break;
+       default:
+               res = 0;
+               break;
+       }
+
+       return res;
+}
+
+static inline int is_omap1510_8250(struct uart_8250_port *pt)
+{
+       if (!cpu_is_omap1510())
+               return 0;
+
+       return is_omap1_8250(pt);
+}
+#else
+static inline int is_omap1_8250(struct uart_8250_port *pt)
+{
+       return 0;
+}
+static inline int is_omap1510_8250(struct uart_8250_port *pt)
+{
+       return 0;
+}
+#endif
index eaafb98debed89e2f1b2e5e83ac33cd79301792e..843a150ba1053dd84d547e15565599ab24791ea3 100644 (file)
@@ -140,7 +140,7 @@ static void __init init_port(struct early_serial8250_device *device)
        serial_out(port, UART_FCR, 0);          /* no fifo */
        serial_out(port, UART_MCR, 0x3);        /* DTR + RTS */
 
-       divisor = port->uartclk / (16 * device->baud);
+       divisor = DIV_ROUND_CLOSEST(port->uartclk, 16 * device->baud);
        c = serial_in(port, UART_LCR);
        serial_out(port, UART_LCR, c | UART_LCR_DLAB);
        serial_out(port, UART_DLL, divisor & 0xff);
index 8f1dd2cc00a8de79ac9538248271d2be376336aa..f3d0edf46644da2505db40ee0422b3bca2ee8234 100644 (file)
@@ -162,7 +162,7 @@ int __init hp300_setup_serial_console(void)
 static int __devinit hpdca_init_one(struct dio_dev *d,
                                const struct dio_device_id *ent)
 {
-       struct uart_port port;
+       struct uart_8250_port uart;
        int line;
 
 #ifdef CONFIG_SERIAL_8250_CONSOLE
@@ -174,19 +174,19 @@ static int __devinit hpdca_init_one(struct dio_dev *d,
        memset(&uart, 0, sizeof(uart));
 
        /* Memory mapped I/O */
-       port.iotype = UPIO_MEM;
-       port.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF;
-       port.irq = d->ipl;
-       port.uartclk = HPDCA_BAUD_BASE * 16;
-       port.mapbase = (d->resource.start + UART_OFFSET);
-       port.membase = (char *)(port.mapbase + DIO_VIRADDRBASE);
-       port.regshift = 1;
-       port.dev = &d->dev;
+       uart.port.iotype = UPIO_MEM;
+       uart.port.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF;
+       uart.port.irq = d->ipl;
+       uart.port.uartclk = HPDCA_BAUD_BASE * 16;
+       uart.port.mapbase = (d->resource.start + UART_OFFSET);
+       uart.port.membase = (char *)(uart.port.mapbase + DIO_VIRADDRBASE);
+       uart.port.regshift = 1;
+       uart.port.dev = &d->dev;
        line = serial8250_register_8250_port(&uart);
 
        if (line < 0) {
                printk(KERN_NOTICE "8250_hp300: register_serial() DCA scode %d"
-                      " irq %d failed\n", d->scode, port.irq);
+                      " irq %d failed\n", d->scode, uart.port.irq);
                return -ENOMEM;
        }
 
index 233fbaaf25596ae4515f0d3e1890d4b62da617d6..2a53be5f010d9af3ee0ed1950f5951524e9a7cb3 100644 (file)
@@ -1150,7 +1150,7 @@ config SERIAL_SC26XX_CONSOLE
          Support for Console on SC2681/SC2692 serial ports.
 
 config SERIAL_SCCNXP
-       bool "SCCNXP serial port support"
+       tristate "SCCNXP serial port support"
        depends on !SERIAL_SC26XX
        select SERIAL_CORE
        default n
@@ -1162,7 +1162,7 @@ config SERIAL_SCCNXP
 
 config SERIAL_SCCNXP_CONSOLE
        bool "Console on SCCNXP serial port"
-       depends on SERIAL_SCCNXP
+       depends on SERIAL_SCCNXP=y
        select SERIAL_CORE_CONSOLE
        help
          Support for console on SCCNXP serial ports.
index 7f04717176aa42c8ba6232719903eb547e673df3..740458ca62cca5e82a8fc579e61d69ab52b0074c 100644 (file)
@@ -530,16 +530,16 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level,
        switch (level) {
        case 3:
                if (!IS_ERR(ourport->baudclk))
-                       clk_disable(ourport->baudclk);
+                       clk_disable_unprepare(ourport->baudclk);
 
-               clk_disable(ourport->clk);
+               clk_disable_unprepare(ourport->clk);
                break;
 
        case 0:
-               clk_enable(ourport->clk);
+               clk_prepare_enable(ourport->clk);
 
                if (!IS_ERR(ourport->baudclk))
-                       clk_enable(ourport->baudclk);
+                       clk_prepare_enable(ourport->baudclk);
 
                break;
        default:
@@ -713,11 +713,11 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
                s3c24xx_serial_setsource(port, clk_sel);
 
                if (!IS_ERR(ourport->baudclk)) {
-                       clk_disable(ourport->baudclk);
+                       clk_disable_unprepare(ourport->baudclk);
                        ourport->baudclk = ERR_PTR(-EINVAL);
                }
 
-               clk_enable(clk);
+               clk_prepare_enable(clk);
 
                ourport->baudclk = clk;
                ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0;
@@ -1287,9 +1287,9 @@ static int s3c24xx_serial_resume(struct device *dev)
        struct s3c24xx_uart_port *ourport = to_ourport(port);
 
        if (port) {
-               clk_enable(ourport->clk);
+               clk_prepare_enable(ourport->clk);
                s3c24xx_serial_resetport(port, s3c24xx_port_to_cfg(port));
-               clk_disable(ourport->clk);
+               clk_disable_unprepare(ourport->clk);
 
                uart_resume_port(&s3c24xx_uart_drv, port);
        }
index b7086d004f5f36cb47422d5225edf5540ad7d8b2..e821068cd95b0f798dc7a9bb39d6507c6733812c 100644 (file)
@@ -971,6 +971,7 @@ static const struct platform_device_id sccnxp_id_table[] = {
        { "sc28202",    SCCNXP_TYPE_SC28202 },
        { "sc68681",    SCCNXP_TYPE_SC68681 },
        { "sc68692",    SCCNXP_TYPE_SC68692 },
+       { },
 };
 MODULE_DEVICE_TABLE(platform, sccnxp_id_table);
 
index 9be296cf729518d1cc48f7f6918229860f49bda0..6ee59001d61d742d1c0bd0f73355c10421fb3f4d 100644 (file)
@@ -530,7 +530,8 @@ static inline int sci_rxd_in(struct uart_port *port)
        if (s->cfg->port_reg <= 0)
                return 1;
 
-       return !!__raw_readb(s->cfg->port_reg);
+       /* Cast for ARM damage */
+       return !!__raw_readb((void __iomem *)s->cfg->port_reg);
 }
 
 /* ********************************************************************** *
index 05728894a88c23330e7b57eb8994f50477fc1b73..16ee6cee07da6b3ba904dea07127f41d98c65133 100644 (file)
@@ -452,6 +452,7 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
        NULL,                           /* v */
        &sysrq_showstate_blocked_op,    /* w */
        /* x: May be registered on ppc/powerpc for xmon */
+       /* x: May be registered on sparc64 for global PMU dump */
        NULL,                           /* x */
        /* y: May be registered on sparc64 for global register dump */
        NULL,                           /* y */
index b0b39b823ccf16ec2e0b82264721a0be7e54005f..6953dc82850cb278fd99da209e560021d4d0c1e8 100644 (file)
@@ -23,7 +23,7 @@ struct tty_audit_buf {
 };
 
 static struct tty_audit_buf *tty_audit_buf_alloc(int major, int minor,
-                                                int icanon)
+                                                unsigned icanon)
 {
        struct tty_audit_buf *buf;
 
@@ -239,7 +239,8 @@ int tty_audit_push_task(struct task_struct *tsk, kuid_t loginuid, u32 sessionid)
  *     if TTY auditing is disabled or out of memory.  Otherwise, return a new
  *     reference to the buffer.
  */
-static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty)
+static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty,
+               unsigned icanon)
 {
        struct tty_audit_buf *buf, *buf2;
 
@@ -257,7 +258,7 @@ static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty)
 
        buf2 = tty_audit_buf_alloc(tty->driver->major,
                                   tty->driver->minor_start + tty->index,
-                                  tty->icanon);
+                                  icanon);
        if (buf2 == NULL) {
                audit_log_lost("out of memory in TTY auditing");
                return NULL;
@@ -287,7 +288,7 @@ static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty)
  *     Audit @data of @size from @tty, if necessary.
  */
 void tty_audit_add_data(struct tty_struct *tty, unsigned char *data,
-                       size_t size)
+                       size_t size, unsigned icanon)
 {
        struct tty_audit_buf *buf;
        int major, minor;
@@ -299,7 +300,7 @@ void tty_audit_add_data(struct tty_struct *tty, unsigned char *data,
            && tty->driver->subtype == PTY_TYPE_MASTER)
                return;
 
-       buf = tty_audit_buf_get(tty);
+       buf = tty_audit_buf_get(tty, icanon);
        if (!buf)
                return;
 
@@ -307,11 +308,11 @@ void tty_audit_add_data(struct tty_struct *tty, unsigned char *data,
        major = tty->driver->major;
        minor = tty->driver->minor_start + tty->index;
        if (buf->major != major || buf->minor != minor
-           || buf->icanon != tty->icanon) {
+           || buf->icanon != icanon) {
                tty_audit_buf_push_current(buf);
                buf->major = major;
                buf->minor = minor;
-               buf->icanon = tty->icanon;
+               buf->icanon = icanon;
        }
        do {
                size_t run;
index 91e326ffe7db826054c2607c1ea2688ed047bb81..6cf87d7afb7efb14264b7a20c7394a99adbb7946 100644 (file)
  *     Locking: none
  */
 
-void tty_buffer_free_all(struct tty_struct *tty)
+void tty_buffer_free_all(struct tty_port *port)
 {
+       struct tty_bufhead *buf = &port->buf;
        struct tty_buffer *thead;
-       while ((thead = tty->buf.head) != NULL) {
-               tty->buf.head = thead->next;
+
+       while ((thead = buf->head) != NULL) {
+               buf->head = thead->next;
                kfree(thead);
        }
-       while ((thead = tty->buf.free) != NULL) {
-               tty->buf.free = thead->next;
+       while ((thead = buf->free) != NULL) {
+               buf->free = thead->next;
                kfree(thead);
        }
-       tty->buf.tail = NULL;
-       tty->buf.memory_used = 0;
+       buf->tail = NULL;
+       buf->memory_used = 0;
 }
 
 /**
@@ -54,11 +56,11 @@ void tty_buffer_free_all(struct tty_struct *tty)
  *     Locking: Caller must hold tty->buf.lock
  */
 
-static struct tty_buffer *tty_buffer_alloc(struct tty_struct *tty, size_t size)
+static struct tty_buffer *tty_buffer_alloc(struct tty_port *port, size_t size)
 {
        struct tty_buffer *p;
 
-       if (tty->buf.memory_used + size > 65536)
+       if (port->buf.memory_used + size > 65536)
                return NULL;
        p = kmalloc(sizeof(struct tty_buffer) + 2 * size, GFP_ATOMIC);
        if (p == NULL)
@@ -70,7 +72,7 @@ static struct tty_buffer *tty_buffer_alloc(struct tty_struct *tty, size_t size)
        p->read = 0;
        p->char_buf_ptr = (char *)(p->data);
        p->flag_buf_ptr = (unsigned char *)p->char_buf_ptr + size;
-       tty->buf.memory_used += size;
+       port->buf.memory_used += size;
        return p;
 }
 
@@ -85,17 +87,19 @@ static struct tty_buffer *tty_buffer_alloc(struct tty_struct *tty, size_t size)
  *     Locking: Caller must hold tty->buf.lock
  */
 
-static void tty_buffer_free(struct tty_struct *tty, struct tty_buffer *b)
+static void tty_buffer_free(struct tty_port *port, struct tty_buffer *b)
 {
+       struct tty_bufhead *buf = &port->buf;
+
        /* Dumb strategy for now - should keep some stats */
-       tty->buf.memory_used -= b->size;
-       WARN_ON(tty->buf.memory_used < 0);
+       buf->memory_used -= b->size;
+       WARN_ON(buf->memory_used < 0);
 
        if (b->size >= 512)
                kfree(b);
        else {
-               b->next = tty->buf.free;
-               tty->buf.free = b;
+               b->next = buf->free;
+               buf->free = b;
        }
 }
 
@@ -110,15 +114,16 @@ static void tty_buffer_free(struct tty_struct *tty, struct tty_buffer *b)
  *     Locking: Caller must hold tty->buf.lock
  */
 
-static void __tty_buffer_flush(struct tty_struct *tty)
+static void __tty_buffer_flush(struct tty_port *port)
 {
+       struct tty_bufhead *buf = &port->buf;
        struct tty_buffer *thead;
 
-       while ((thead = tty->buf.head) != NULL) {
-               tty->buf.head = thead->next;
-               tty_buffer_free(tty, thead);
+       while ((thead = buf->head) != NULL) {
+               buf->head = thead->next;
+               tty_buffer_free(port, thead);
        }
-       tty->buf.tail = NULL;
+       buf->tail = NULL;
 }
 
 /**
@@ -134,21 +139,24 @@ static void __tty_buffer_flush(struct tty_struct *tty)
 
 void tty_buffer_flush(struct tty_struct *tty)
 {
+       struct tty_port *port = tty->port;
+       struct tty_bufhead *buf = &port->buf;
        unsigned long flags;
-       spin_lock_irqsave(&tty->buf.lock, flags);
+
+       spin_lock_irqsave(&buf->lock, flags);
 
        /* If the data is being pushed to the tty layer then we can't
           process it here. Instead set a flag and the flush_to_ldisc
           path will process the flush request before it exits */
-       if (test_bit(TTY_FLUSHING, &tty->flags)) {
-               set_bit(TTY_FLUSHPENDING, &tty->flags);
-               spin_unlock_irqrestore(&tty->buf.lock, flags);
+       if (test_bit(TTYP_FLUSHING, &port->iflags)) {
+               set_bit(TTYP_FLUSHPENDING, &port->iflags);
+               spin_unlock_irqrestore(&buf->lock, flags);
                wait_event(tty->read_wait,
-                               test_bit(TTY_FLUSHPENDING, &tty->flags) == 0);
+                               test_bit(TTYP_FLUSHPENDING, &port->iflags) == 0);
                return;
        } else
-               __tty_buffer_flush(tty);
-       spin_unlock_irqrestore(&tty->buf.lock, flags);
+               __tty_buffer_flush(port);
+       spin_unlock_irqrestore(&buf->lock, flags);
 }
 
 /**
@@ -163,9 +171,9 @@ void tty_buffer_flush(struct tty_struct *tty)
  *     Locking: Caller must hold tty->buf.lock
  */
 
-static struct tty_buffer *tty_buffer_find(struct tty_struct *tty, size_t size)
+static struct tty_buffer *tty_buffer_find(struct tty_port *port, size_t size)
 {
-       struct tty_buffer **tbh = &tty->buf.free;
+       struct tty_buffer **tbh = &port->buf.free;
        while ((*tbh) != NULL) {
                struct tty_buffer *t = *tbh;
                if (t->size >= size) {
@@ -174,14 +182,14 @@ static struct tty_buffer *tty_buffer_find(struct tty_struct *tty, size_t size)
                        t->used = 0;
                        t->commit = 0;
                        t->read = 0;
-                       tty->buf.memory_used += t->size;
+                       port->buf.memory_used += t->size;
                        return t;
                }
                tbh = &((*tbh)->next);
        }
        /* Round the buffer size out */
        size = (size + 0xFF) & ~0xFF;
-       return tty_buffer_alloc(tty, size);
+       return tty_buffer_alloc(port, size);
        /* Should possibly check if this fails for the largest buffer we
           have queued and recycle that ? */
 }
@@ -192,29 +200,31 @@ static struct tty_buffer *tty_buffer_find(struct tty_struct *tty, size_t size)
  *
  *     Make at least size bytes of linear space available for the tty
  *     buffer. If we fail return the size we managed to find.
- *      Locking: Caller must hold tty->buf.lock
+ *      Locking: Caller must hold port->buf.lock
  */
-static int __tty_buffer_request_room(struct tty_struct *tty, size_t size)
+static int __tty_buffer_request_room(struct tty_port *port, size_t size)
 {
+       struct tty_bufhead *buf = &port->buf;
        struct tty_buffer *b, *n;
        int left;
        /* OPTIMISATION: We could keep a per tty "zero" sized buffer to
           remove this conditional if its worth it. This would be invisible
           to the callers */
-       if ((b = tty->buf.tail) != NULL)
+       b = buf->tail;
+       if (b != NULL)
                left = b->size - b->used;
        else
                left = 0;
 
        if (left < size) {
                /* This is the slow path - looking for new buffers to use */
-               if ((n = tty_buffer_find(tty, size)) != NULL) {
+               if ((n = tty_buffer_find(port, size)) != NULL) {
                        if (b != NULL) {
                                b->next = n;
                                b->commit = b->used;
                        } else
-                               tty->buf.head = n;
-                       tty->buf.tail = n;
+                               buf->head = n;
+                       buf->tail = n;
                } else
                        size = left;
        }
@@ -231,16 +241,17 @@ static int __tty_buffer_request_room(struct tty_struct *tty, size_t size)
  *     Make at least size bytes of linear space available for the tty
  *     buffer. If we fail return the size we managed to find.
  *
- *     Locking: Takes tty->buf.lock
+ *     Locking: Takes port->buf.lock
  */
 int tty_buffer_request_room(struct tty_struct *tty, size_t size)
 {
+       struct tty_port *port = tty->port;
        unsigned long flags;
        int length;
 
-       spin_lock_irqsave(&tty->buf.lock, flags);
-       length = __tty_buffer_request_room(tty, size);
-       spin_unlock_irqrestore(&tty->buf.lock, flags);
+       spin_lock_irqsave(&port->buf.lock, flags);
+       length = __tty_buffer_request_room(port, size);
+       spin_unlock_irqrestore(&port->buf.lock, flags);
        return length;
 }
 EXPORT_SYMBOL_GPL(tty_buffer_request_room);
@@ -255,12 +266,13 @@ EXPORT_SYMBOL_GPL(tty_buffer_request_room);
  *     Queue a series of bytes to the tty buffering. All the characters
  *     passed are marked with the supplied flag. Returns the number added.
  *
- *     Locking: Called functions may take tty->buf.lock
+ *     Locking: Called functions may take port->buf.lock
  */
 
 int tty_insert_flip_string_fixed_flag(struct tty_struct *tty,
                const unsigned char *chars, char flag, size_t size)
 {
+       struct tty_bufhead *buf = &tty->port->buf;
        int copied = 0;
        do {
                int goal = min_t(size_t, size - copied, TTY_BUFFER_PAGE);
@@ -268,18 +280,18 @@ int tty_insert_flip_string_fixed_flag(struct tty_struct *tty,
                unsigned long flags;
                struct tty_buffer *tb;
 
-               spin_lock_irqsave(&tty->buf.lock, flags);
-               space = __tty_buffer_request_room(tty, goal);
-               tb = tty->buf.tail;
+               spin_lock_irqsave(&buf->lock, flags);
+               space = __tty_buffer_request_room(tty->port, goal);
+               tb = buf->tail;
                /* If there is no space then tb may be NULL */
                if (unlikely(space == 0)) {
-                       spin_unlock_irqrestore(&tty->buf.lock, flags);
+                       spin_unlock_irqrestore(&buf->lock, flags);
                        break;
                }
                memcpy(tb->char_buf_ptr + tb->used, chars, space);
                memset(tb->flag_buf_ptr + tb->used, flag, space);
                tb->used += space;
-               spin_unlock_irqrestore(&tty->buf.lock, flags);
+               spin_unlock_irqrestore(&buf->lock, flags);
                copied += space;
                chars += space;
                /* There is a small chance that we need to split the data over
@@ -300,12 +312,13 @@ EXPORT_SYMBOL(tty_insert_flip_string_fixed_flag);
  *     the flags array indicates the status of the character. Returns the
  *     number added.
  *
- *     Locking: Called functions may take tty->buf.lock
+ *     Locking: Called functions may take port->buf.lock
  */
 
 int tty_insert_flip_string_flags(struct tty_struct *tty,
                const unsigned char *chars, const char *flags, size_t size)
 {
+       struct tty_bufhead *buf = &tty->port->buf;
        int copied = 0;
        do {
                int goal = min_t(size_t, size - copied, TTY_BUFFER_PAGE);
@@ -313,18 +326,18 @@ int tty_insert_flip_string_flags(struct tty_struct *tty,
                unsigned long __flags;
                struct tty_buffer *tb;
 
-               spin_lock_irqsave(&tty->buf.lock, __flags);
-               space = __tty_buffer_request_room(tty, goal);
-               tb = tty->buf.tail;
+               spin_lock_irqsave(&buf->lock, __flags);
+               space = __tty_buffer_request_room(tty->port, goal);
+               tb = buf->tail;
                /* If there is no space then tb may be NULL */
                if (unlikely(space == 0)) {
-                       spin_unlock_irqrestore(&tty->buf.lock, __flags);
+                       spin_unlock_irqrestore(&buf->lock, __flags);
                        break;
                }
                memcpy(tb->char_buf_ptr + tb->used, chars, space);
                memcpy(tb->flag_buf_ptr + tb->used, flags, space);
                tb->used += space;
-               spin_unlock_irqrestore(&tty->buf.lock, __flags);
+               spin_unlock_irqrestore(&buf->lock, __flags);
                copied += space;
                chars += space;
                flags += space;
@@ -342,18 +355,23 @@ EXPORT_SYMBOL(tty_insert_flip_string_flags);
  *     Takes any pending buffers and transfers their ownership to the
  *     ldisc side of the queue. It then schedules those characters for
  *     processing by the line discipline.
+ *     Note that this function can only be used when the low_latency flag
+ *     is unset. Otherwise the workqueue won't be flushed.
  *
- *     Locking: Takes tty->buf.lock
+ *     Locking: Takes port->buf.lock
  */
 
 void tty_schedule_flip(struct tty_struct *tty)
 {
+       struct tty_bufhead *buf = &tty->port->buf;
        unsigned long flags;
-       spin_lock_irqsave(&tty->buf.lock, flags);
-       if (tty->buf.tail != NULL)
-               tty->buf.tail->commit = tty->buf.tail->used;
-       spin_unlock_irqrestore(&tty->buf.lock, flags);
-       schedule_work(&tty->buf.work);
+       WARN_ON(tty->low_latency);
+
+       spin_lock_irqsave(&buf->lock, flags);
+       if (buf->tail != NULL)
+               buf->tail->commit = buf->tail->used;
+       spin_unlock_irqrestore(&buf->lock, flags);
+       schedule_work(&buf->work);
 }
 EXPORT_SYMBOL(tty_schedule_flip);
 
@@ -369,26 +387,27 @@ EXPORT_SYMBOL(tty_schedule_flip);
  *     that need their own block copy routines into the buffer. There is no
  *     guarantee the buffer is a DMA target!
  *
- *     Locking: May call functions taking tty->buf.lock
+ *     Locking: May call functions taking port->buf.lock
  */
 
 int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars,
-                                                               size_t size)
+               size_t size)
 {
+       struct tty_bufhead *buf = &tty->port->buf;
        int space;
        unsigned long flags;
        struct tty_buffer *tb;
 
-       spin_lock_irqsave(&tty->buf.lock, flags);
-       space = __tty_buffer_request_room(tty, size);
+       spin_lock_irqsave(&buf->lock, flags);
+       space = __tty_buffer_request_room(tty->port, size);
 
-       tb = tty->buf.tail;
+       tb = buf->tail;
        if (likely(space)) {
                *chars = tb->char_buf_ptr + tb->used;
                memset(tb->flag_buf_ptr + tb->used, TTY_NORMAL, space);
                tb->used += space;
        }
-       spin_unlock_irqrestore(&tty->buf.lock, flags);
+       spin_unlock_irqrestore(&buf->lock, flags);
        return space;
 }
 EXPORT_SYMBOL_GPL(tty_prepare_flip_string);
@@ -406,26 +425,27 @@ EXPORT_SYMBOL_GPL(tty_prepare_flip_string);
  *     that need their own block copy routines into the buffer. There is no
  *     guarantee the buffer is a DMA target!
  *
- *     Locking: May call functions taking tty->buf.lock
+ *     Locking: May call functions taking port->buf.lock
  */
 
 int tty_prepare_flip_string_flags(struct tty_struct *tty,
                        unsigned char **chars, char **flags, size_t size)
 {
+       struct tty_bufhead *buf = &tty->port->buf;
        int space;
        unsigned long __flags;
        struct tty_buffer *tb;
 
-       spin_lock_irqsave(&tty->buf.lock, __flags);
-       space = __tty_buffer_request_room(tty, size);
+       spin_lock_irqsave(&buf->lock, __flags);
+       space = __tty_buffer_request_room(tty->port, size);
 
-       tb = tty->buf.tail;
+       tb = buf->tail;
        if (likely(space)) {
                *chars = tb->char_buf_ptr + tb->used;
                *flags = tb->flag_buf_ptr + tb->used;
                tb->used += space;
        }
-       spin_unlock_irqrestore(&tty->buf.lock, __flags);
+       spin_unlock_irqrestore(&buf->lock, __flags);
        return space;
 }
 EXPORT_SYMBOL_GPL(tty_prepare_flip_string_flags);
@@ -446,20 +466,25 @@ EXPORT_SYMBOL_GPL(tty_prepare_flip_string_flags);
 
 static void flush_to_ldisc(struct work_struct *work)
 {
-       struct tty_struct *tty =
-               container_of(work, struct tty_struct, buf.work);
+       struct tty_port *port = container_of(work, struct tty_port, buf.work);
+       struct tty_bufhead *buf = &port->buf;
+       struct tty_struct *tty;
        unsigned long   flags;
        struct tty_ldisc *disc;
 
+       tty = port->itty;
+       if (WARN_RATELIMIT(tty == NULL, "tty is NULL"))
+               return;
+
        disc = tty_ldisc_ref(tty);
        if (disc == NULL)       /*  !TTY_LDISC */
                return;
 
-       spin_lock_irqsave(&tty->buf.lock, flags);
+       spin_lock_irqsave(&buf->lock, flags);
 
-       if (!test_and_set_bit(TTY_FLUSHING, &tty->flags)) {
+       if (!test_and_set_bit(TTYP_FLUSHING, &port->iflags)) {
                struct tty_buffer *head;
-               while ((head = tty->buf.head) != NULL) {
+               while ((head = buf->head) != NULL) {
                        int count;
                        char *char_buf;
                        unsigned char *flag_buf;
@@ -468,14 +493,14 @@ static void flush_to_ldisc(struct work_struct *work)
                        if (!count) {
                                if (head->next == NULL)
                                        break;
-                               tty->buf.head = head->next;
-                               tty_buffer_free(tty, head);
+                               buf->head = head->next;
+                               tty_buffer_free(port, head);
                                continue;
                        }
                        /* Ldisc or user is trying to flush the buffers
                           we are feeding to the ldisc, stop feeding the
                           line discipline as we want to empty the queue */
-                       if (test_bit(TTY_FLUSHPENDING, &tty->flags))
+                       if (test_bit(TTYP_FLUSHPENDING, &port->iflags))
                                break;
                        if (!tty->receive_room)
                                break;
@@ -484,22 +509,22 @@ static void flush_to_ldisc(struct work_struct *work)
                        char_buf = head->char_buf_ptr + head->read;
                        flag_buf = head->flag_buf_ptr + head->read;
                        head->read += count;
-                       spin_unlock_irqrestore(&tty->buf.lock, flags);
+                       spin_unlock_irqrestore(&buf->lock, flags);
                        disc->ops->receive_buf(tty, char_buf,
                                                        flag_buf, count);
-                       spin_lock_irqsave(&tty->buf.lock, flags);
+                       spin_lock_irqsave(&buf->lock, flags);
                }
-               clear_bit(TTY_FLUSHING, &tty->flags);
+               clear_bit(TTYP_FLUSHING, &port->iflags);
        }
 
        /* We may have a deferred request to flush the input buffer,
           if so pull the chain under the lock and empty the queue */
-       if (test_bit(TTY_FLUSHPENDING, &tty->flags)) {
-               __tty_buffer_flush(tty);
-               clear_bit(TTY_FLUSHPENDING, &tty->flags);
+       if (test_bit(TTYP_FLUSHPENDING, &port->iflags)) {
+               __tty_buffer_flush(port);
+               clear_bit(TTYP_FLUSHPENDING, &port->iflags);
                wake_up(&tty->read_wait);
        }
-       spin_unlock_irqrestore(&tty->buf.lock, flags);
+       spin_unlock_irqrestore(&buf->lock, flags);
 
        tty_ldisc_deref(disc);
 }
@@ -514,7 +539,8 @@ static void flush_to_ldisc(struct work_struct *work)
  */
 void tty_flush_to_ldisc(struct tty_struct *tty)
 {
-       flush_work(&tty->buf.work);
+       if (!tty->low_latency)
+               flush_work(&tty->port->buf.work);
 }
 
 /**
@@ -532,16 +558,18 @@ void tty_flush_to_ldisc(struct tty_struct *tty)
 
 void tty_flip_buffer_push(struct tty_struct *tty)
 {
+       struct tty_bufhead *buf = &tty->port->buf;
        unsigned long flags;
-       spin_lock_irqsave(&tty->buf.lock, flags);
-       if (tty->buf.tail != NULL)
-               tty->buf.tail->commit = tty->buf.tail->used;
-       spin_unlock_irqrestore(&tty->buf.lock, flags);
+
+       spin_lock_irqsave(&buf->lock, flags);
+       if (buf->tail != NULL)
+               buf->tail->commit = buf->tail->used;
+       spin_unlock_irqrestore(&buf->lock, flags);
 
        if (tty->low_latency)
-               flush_to_ldisc(&tty->buf.work);
+               flush_to_ldisc(&buf->work);
        else
-               schedule_work(&tty->buf.work);
+               schedule_work(&buf->work);
 }
 EXPORT_SYMBOL(tty_flip_buffer_push);
 
@@ -555,13 +583,15 @@ EXPORT_SYMBOL(tty_flip_buffer_push);
  *     Locking: none
  */
 
-void tty_buffer_init(struct tty_struct *tty)
+void tty_buffer_init(struct tty_port *port)
 {
-       spin_lock_init(&tty->buf.lock);
-       tty->buf.head = NULL;
-       tty->buf.tail = NULL;
-       tty->buf.free = NULL;
-       tty->buf.memory_used = 0;
-       INIT_WORK(&tty->buf.work, flush_to_ldisc);
+       struct tty_bufhead *buf = &port->buf;
+
+       spin_lock_init(&buf->lock);
+       buf->head = NULL;
+       buf->tail = NULL;
+       buf->free = NULL;
+       buf->memory_used = 0;
+       INIT_WORK(&buf->work, flush_to_ldisc);
 }
 
index 2ea176b2280e60f201aefec32af4beb8d7892702..a3eba7f359ed2b50ac3c3da6c7ec22384bd16732 100644 (file)
@@ -186,7 +186,6 @@ void free_tty_struct(struct tty_struct *tty)
        if (tty->dev)
                put_device(tty->dev);
        kfree(tty->write_buf);
-       tty_buffer_free_all(tty);
        tty->magic = 0xDEADDEAD;
        kfree(tty);
 }
@@ -1417,6 +1416,8 @@ struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx)
                        "%s: %s driver does not set tty->port. This will crash the kernel later. Fix the driver!\n",
                        __func__, tty->driver->name);
 
+       tty->port->itty = tty;
+
        /*
         * Structures all installed ... call the ldisc open routines.
         * If we fail here just call release_tty to clean up.  No need
@@ -1552,6 +1553,7 @@ static void release_tty(struct tty_struct *tty, int idx)
                tty->ops->shutdown(tty);
        tty_free_termios(tty);
        tty_driver_remove_tty(tty->driver, tty);
+       tty->port->itty = NULL;
 
        if (tty->link)
                tty_kref_put(tty->link);
@@ -1625,7 +1627,6 @@ int tty_release(struct inode *inode, struct file *filp)
        struct tty_struct *tty = file_tty(filp);
        struct tty_struct *o_tty;
        int     pty_master, tty_closing, o_tty_closing, do_sleep;
-       int     devpts;
        int     idx;
        char    buf[64];
 
@@ -1640,7 +1641,6 @@ int tty_release(struct inode *inode, struct file *filp)
        idx = tty->index;
        pty_master = (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
                      tty->driver->subtype == PTY_TYPE_MASTER);
-       devpts = (tty->driver->flags & TTY_DRIVER_DEVPTS_MEM) != 0;
        /* Review: parallel close */
        o_tty = tty->link;
 
@@ -1799,9 +1799,6 @@ int tty_release(struct inode *inode, struct file *filp)
        release_tty(tty, idx);
        mutex_unlock(&tty_mutex);
 
-       /* Make this pty number available for reallocation */
-       if (devpts)
-               devpts_kill_index(inode, idx);
        return 0;
 }
 
@@ -2937,19 +2934,13 @@ void initialize_tty_struct(struct tty_struct *tty,
        tty_ldisc_init(tty);
        tty->session = NULL;
        tty->pgrp = NULL;
-       tty->overrun_time = jiffies;
-       tty_buffer_init(tty);
        mutex_init(&tty->legacy_mutex);
        mutex_init(&tty->termios_mutex);
        mutex_init(&tty->ldisc_mutex);
        init_waitqueue_head(&tty->write_wait);
        init_waitqueue_head(&tty->read_wait);
        INIT_WORK(&tty->hangup_work, do_tty_hangup);
-       mutex_init(&tty->atomic_read_lock);
        mutex_init(&tty->atomic_write_lock);
-       mutex_init(&tty->output_lock);
-       mutex_init(&tty->echo_lock);
-       spin_lock_init(&tty->read_lock);
        spin_lock_init(&tty->ctrl_lock);
        INIT_LIST_HEAD(&tty->tty_files);
        INIT_WORK(&tty->SAK_work, do_SAK_work);
index 0f2a2c5e704c3560755069f1c102f6714e0ae4b6..f4e6754525dc4e015d95db0db5ddd49295f77dd0 100644 (file)
@@ -512,7 +512,7 @@ static void tty_ldisc_restore(struct tty_struct *tty, struct tty_ldisc *old)
 static int tty_ldisc_halt(struct tty_struct *tty)
 {
        clear_bit(TTY_LDISC, &tty->flags);
-       return cancel_work_sync(&tty->buf.work);
+       return cancel_work_sync(&tty->port->buf.work);
 }
 
 /**
@@ -525,7 +525,7 @@ static void tty_ldisc_flush_works(struct tty_struct *tty)
 {
        flush_work(&tty->hangup_work);
        flush_work(&tty->SAK_work);
-       flush_work(&tty->buf.work);
+       flush_work(&tty->port->buf.work);
 }
 
 /**
@@ -704,9 +704,9 @@ enable:
        /* Restart the work queue in case no characters kick it off. Safe if
           already running */
        if (work)
-               schedule_work(&tty->buf.work);
+               schedule_work(&tty->port->buf.work);
        if (o_work)
-               schedule_work(&o_tty->buf.work);
+               schedule_work(&o_tty->port->buf.work);
        mutex_unlock(&tty->ldisc_mutex);
        tty_unlock(tty);
        return retval;
@@ -817,7 +817,7 @@ void tty_ldisc_hangup(struct tty_struct *tty)
         */
        clear_bit(TTY_LDISC, &tty->flags);
        tty_unlock(tty);
-       cancel_work_sync(&tty->buf.work);
+       cancel_work_sync(&tty->port->buf.work);
        mutex_unlock(&tty->ldisc_mutex);
 retry:
        tty_lock(tty);
@@ -897,6 +897,11 @@ int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty)
 
 static void tty_ldisc_kill(struct tty_struct *tty)
 {
+       /* There cannot be users from userspace now. But there still might be
+        * drivers holding a reference via tty_ldisc_ref. Do not steal them the
+        * ldisc until they are done. */
+       tty_ldisc_wait_idle(tty, MAX_SCHEDULE_TIMEOUT);
+
        mutex_lock(&tty->ldisc_mutex);
        /*
         * Now kill off the ldisc
index d7bdd8d0c23f0faa832aee87447af772958ceb13..416b42f7c346680067ea6eb8d4679421cf5596c8 100644 (file)
@@ -21,6 +21,7 @@
 void tty_port_init(struct tty_port *port)
 {
        memset(port, 0, sizeof(*port));
+       tty_buffer_init(port);
        init_waitqueue_head(&port->open_wait);
        init_waitqueue_head(&port->close_wait);
        init_waitqueue_head(&port->delta_msr_wait);
@@ -126,6 +127,7 @@ static void tty_port_destructor(struct kref *kref)
        struct tty_port *port = container_of(kref, struct tty_port, kref);
        if (port->xmit_buf)
                free_page((unsigned long)port->xmit_buf);
+       tty_buffer_free_all(port);
        if (port->ops->destruct)
                port->ops->destruct(port);
        else
index 8e9b4be97a2d202c4b1725ff44f97943627b132d..60b7b69260592e9b413b599dcf572117f8487450 100644 (file)
@@ -341,15 +341,11 @@ int paste_selection(struct tty_struct *tty)
        struct  tty_ldisc *ld;
        DECLARE_WAITQUEUE(wait, current);
 
-
        console_lock();
        poke_blanked_console();
        console_unlock();
 
-       /* FIXME: wtf is this supposed to achieve ? */
-       ld = tty_ldisc_ref(tty);
-       if (!ld)
-               ld = tty_ldisc_ref_wait(tty);
+       ld = tty_ldisc_ref_wait(tty);
 
        /* FIXME: this is completely unsafe */
        add_wait_queue(&vc->paste_wait, &wait);
@@ -361,8 +357,7 @@ int paste_selection(struct tty_struct *tty)
                }
                count = sel_buffer_lth - pasted;
                count = min(count, tty->receive_room);
-               tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted,
-                                                               NULL, count);
+               ld->ops->receive_buf(tty, sel_buffer + pasted, NULL, count);
                pasted += count;
        }
        remove_wait_queue(&vc->paste_wait, &wait);
index 981f2132d1283c44234f4fa79466c4d11241c94e..6e49ec6f3adcaeae67898e53cc1c5eb6cd62b756 100644 (file)
@@ -817,10 +817,6 @@ static const __u32 acm_tty_speed[] = {
        2500000, 3000000, 3500000, 4000000
 };
 
-static const __u8 acm_tty_size[] = {
-       5, 6, 7, 8
-};
-
 static void acm_tty_set_termios(struct tty_struct *tty,
                                                struct ktermios *termios_old)
 {
@@ -834,7 +830,21 @@ static void acm_tty_set_termios(struct tty_struct *tty,
        newline.bParityType = termios->c_cflag & PARENB ?
                                (termios->c_cflag & PARODD ? 1 : 2) +
                                (termios->c_cflag & CMSPAR ? 2 : 0) : 0;
-       newline.bDataBits = acm_tty_size[(termios->c_cflag & CSIZE) >> 4];
+       switch (termios->c_cflag & CSIZE) {
+       case CS5:
+               newline.bDataBits = 5;
+               break;
+       case CS6:
+               newline.bDataBits = 6;
+               break;
+       case CS7:
+               newline.bDataBits = 7;
+               break;
+       case CS8:
+       default:
+               newline.bDataBits = 8;
+               break;
+       }
        /* FIXME: Needs to clear unsupported bits in the termios */
        acm->clocal = ((termios->c_cflag & CLOCAL) != 0);
 
@@ -1233,7 +1243,7 @@ made_compressed_probe:
 
                if (usb_endpoint_xfer_int(epwrite))
                        usb_fill_int_urb(snd->urb, usb_dev,
-                               usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
+                               usb_sndintpipe(usb_dev, epwrite->bEndpointAddress),
                                NULL, acm->writesize, acm_write_bulk, snd, epwrite->bInterval);
                else
                        usb_fill_bulk_urb(snd->urb, usb_dev,
index e0356cb859b5910eaaf5aa6e0b324808c56f4c0a..b78fbe222b72c2e3bc662973e9f9f08941ce2628 100644 (file)
@@ -1348,6 +1348,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
                                        ret = -EFAULT;
                                        goto error;
                                }
+                               uurb->buffer += u;
                        }
                        totlen -= u;
                }
index ddd820d25288b57da71336bf4eed397a4cc16410..6056db7af410fac833ed00d8c5f793773f628931 100644 (file)
@@ -367,6 +367,10 @@ static int usb_probe_interface(struct device *dev)
        intf->condition = USB_INTERFACE_UNBOUND;
        usb_cancel_queued_reset(intf);
 
+       /* If the LPM disable succeeded, balance the ref counts. */
+       if (!lpm_disable_error)
+               usb_unlocked_enable_lpm(udev);
+
        /* Unbound interfaces are always runtime-PM-disabled and -suspended */
        if (driver->supports_autosuspend)
                pm_runtime_disable(dev);
index 673ee46962621e8013b102f2876c918bfa1d56f0..64854d76f52901f39bf658a17790d4b512853a81 100644 (file)
@@ -3241,8 +3241,7 @@ static int usb_req_set_sel(struct usb_device *udev, enum usb3_link_state state)
                        (state == USB3_LPM_U2 &&
                         (u2_sel > USB3_LPM_MAX_U2_SEL_PEL ||
                          u2_pel > USB3_LPM_MAX_U2_SEL_PEL))) {
-               dev_dbg(&udev->dev, "Device-initiated %s disabled due "
-                               "to long SEL %llu ms or PEL %llu ms\n",
+               dev_dbg(&udev->dev, "Device-initiated %s disabled due to long SEL %llu us or PEL %llu us\n",
                                usb3_lpm_names[state], u1_sel, u1_pel);
                return -EINVAL;
        }
@@ -3319,16 +3318,6 @@ static int usb_set_device_initiated_lpm(struct usb_device *udev,
        }
 
        if (enable) {
-               /*
-                * First, let the device know about the exit latencies
-                * associated with the link state we're about to enable.
-                */
-               ret = usb_req_set_sel(udev, state);
-               if (ret < 0) {
-                       dev_warn(&udev->dev, "Set SEL for device-initiated "
-                                       "%s failed.\n", usb3_lpm_names[state]);
-                       return -EBUSY;
-               }
                /*
                 * Now send the control transfer to enable device-initiated LPM
                 * for either U1 or U2.
@@ -3414,7 +3403,28 @@ static int usb_set_lpm_timeout(struct usb_device *udev,
 static void usb_enable_link_state(struct usb_hcd *hcd, struct usb_device *udev,
                enum usb3_link_state state)
 {
-       int timeout;
+       int timeout, ret;
+       __u8 u1_mel = udev->bos->ss_cap->bU1devExitLat;
+       __le16 u2_mel = udev->bos->ss_cap->bU2DevExitLat;
+
+       /* If the device says it doesn't have *any* exit latency to come out of
+        * U1 or U2, it's probably lying.  Assume it doesn't implement that link
+        * state.
+        */
+       if ((state == USB3_LPM_U1 && u1_mel == 0) ||
+                       (state == USB3_LPM_U2 && u2_mel == 0))
+               return;
+
+       /*
+        * First, let the device know about the exit latencies
+        * associated with the link state we're about to enable.
+        */
+       ret = usb_req_set_sel(udev, state);
+       if (ret < 0) {
+               dev_warn(&udev->dev, "Set SEL for device-initiated %s failed.\n",
+                               usb3_lpm_names[state]);
+               return;
+       }
 
        /* We allow the host controller to set the U1/U2 timeout internally
         * first, so that it can change its schedule to account for the
index b415c0c859d3d2b3e990fc571b57d4e6e88f81fd..c14ebc975ba422028b663b4b90ac6e605c1c6115 100644 (file)
@@ -409,6 +409,10 @@ static void dwc3_core_exit(struct dwc3 *dwc)
 {
        dwc3_event_buffers_cleanup(dwc);
        dwc3_free_event_buffers(dwc);
+
+       usb_phy_shutdown(dwc->usb2_phy);
+       usb_phy_shutdown(dwc->usb3_phy);
+
 }
 
 #define DWC3_ALIGN_MASK                (16 - 1)
index c9e729a4bf6562876ba58b1776ce235ecc5ca5ed..7b7deddf6a52a264f02b7d47fa84d1916c461e6f 100644 (file)
@@ -1904,7 +1904,7 @@ static void dwc3_stop_active_transfer(struct dwc3 *dwc, u32 epnum)
        ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, &params);
        WARN_ON_ONCE(ret);
        dep->resource_index = 0;
-
+       dep->flags &= ~DWC3_EP_BUSY;
        udelay(100);
 }
 
index dfb51a45496c10cbaa2d930ae6a6f45ffb9860a4..e0ff51b895296ab66988e509bd6b73d94a663701 100644 (file)
@@ -952,6 +952,7 @@ endif
 config USB_G_WEBCAM
        tristate "USB Webcam Gadget"
        depends on VIDEO_DEV
+       select USB_LIBCOMPOSITE
        help
          The Webcam Gadget acts as a composite USB Audio and Video Class
          device. It provides a userspace API to process UVC control requests
index f696fb9b136ded4b8c32ba8b360ef2550551f73d..21a9861dabf0a9660a3c1cf74f04d055fbb0b649 100644 (file)
@@ -2930,10 +2930,10 @@ static void vbus_work(struct work_struct *work)
 
                /* Get the VBUS status from the transceiver */
                value = i2c_smbus_read_byte_data(udc->isp1301_i2c_client,
-                                                ISP1301_I2C_OTG_CONTROL_2);
+                                                ISP1301_I2C_INTERRUPT_SOURCE);
 
                /* VBUS on or off? */
-               if (value & OTG_B_SESS_VLD)
+               if (value & INT_SESS_VLD)
                        udc->vbus = 1;
                else
                        udc->vbus = 0;
index 2a4749c3eb3f7bd7679f768ca5cdab27de0db72f..23afa06b65a44abf2268dfd4e18dab7e95261414 100644 (file)
@@ -44,7 +44,7 @@
 #include <asm/unaligned.h>
 #include <asm/mach-types.h>
 
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 
 #include <mach/usb.h>
 
@@ -61,6 +61,8 @@
 #define        DRIVER_DESC     "OMAP UDC driver"
 #define        DRIVER_VERSION  "4 October 2004"
 
+#define OMAP_DMA_USB_W2FC_TX0          29
+
 /*
  * The OMAP UDC needs _very_ early endpoint setup:  before enabling the
  * D+ pullup to allow enumeration.  That's too early for the gadget
index 9bfde82078ecabde8236fc504aaf2a1794d25fb3..0d2f35ca93f1d5e7091cc77122e70b162f22679d 100644 (file)
@@ -222,7 +222,7 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd,
 
        if (pdata->controller_ver < 0) {
                dev_warn(hcd->self.controller, "Could not get controller version\n");
-               return;
+               return -ENODEV;
        }
 
        portsc = ehci_readl(ehci, &ehci->regs->port_status[port_offset]);
index d7fe287d067803e484d56efdf53060546634ea1e..0d5ac36fdf47aab8dec5cf96e082ac48ad1e0f65 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/usb/ulpi.h>
-#include <plat/usb.h>
 #include <linux/regulator/consumer.h>
 #include <linux/pm_runtime.h>
 #include <linux/gpio.h>
 #include <linux/clk.h>
 
+#include <linux/platform_data/usb-omap.h>
+
 /* EHCI Register Set */
 #define EHCI_INSNREG04                                 (0xA0)
 #define EHCI_INSNREG04_DISABLE_UNSUSPEND               (1 << 5)
index 8e7eca62f169fc204c6e1ef2034f26acdf2729dc..9c2717d66730ad74d9f99ef2aa0795b25c716a1b 100644 (file)
@@ -160,7 +160,7 @@ static const struct hc_driver ehci_orion_hc_driver = {
        .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
 };
 
-static void __init
+static void __devinit
 ehci_orion_conf_mbus_windows(struct usb_hcd *hcd,
                             const struct mbus_dram_target_info *dram)
 {
index 96722bfebc84ba0bed49f6cd4c0aa3313f7f55dd..d3c9a3e397b99ed4f423ee41575038890ff4e4eb 100644 (file)
@@ -85,6 +85,8 @@ static const struct hc_driver vt8500_ehci_hc_driver = {
        .clear_tt_buffer_complete       = ehci_clear_tt_buffer_complete,
 };
 
+static u64 vt8500_ehci_dma_mask = DMA_BIT_MASK(32);
+
 static int vt8500_ehci_drv_probe(struct platform_device *pdev)
 {
        struct usb_hcd *hcd;
@@ -95,6 +97,14 @@ static int vt8500_ehci_drv_probe(struct platform_device *pdev)
        if (usb_disabled())
                return -ENODEV;
 
+       /*
+        * Right now device-tree probed devices don't get dma_mask set.
+        * Since shared usb code relies on it, set it here for now.
+        * Once we have dma capability bindings this can go away.
+        */
+       if (!pdev->dev.dma_mask)
+               pdev->dev.dma_mask = &vt8500_ehci_dma_mask;
+
        if (pdev->resource[1].flags != IORESOURCE_IRQ) {
                pr_debug("resource[1] is not IORESOURCE_IRQ");
                return -ENOMEM;
index 4531d03503c32371f4b1c5cd505ac38243dafe13..439e6e4f2d6b96c3cb69ad8179aaf5b15be34666 100644 (file)
@@ -25,7 +25,6 @@
 #include <asm/mach-types.h>
 
 #include <mach/mux.h>
-#include <plat/fpga.h>
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
@@ -93,14 +92,14 @@ static int omap_ohci_transceiver_power(int on)
 {
        if (on) {
                if (machine_is_omap_innovator() && cpu_is_omap1510())
-                       fpga_write(fpga_read(INNOVATOR_FPGA_CAM_USB_CONTROL)
+                       __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL)
                                | ((1 << 5/*usb1*/) | (1 << 3/*usb2*/)),
                               INNOVATOR_FPGA_CAM_USB_CONTROL);
                else if (machine_is_omap_osk())
                        tps65010_set_gpio_out_value(GPIO1, LOW);
        } else {
                if (machine_is_omap_innovator() && cpu_is_omap1510())
-                       fpga_write(fpga_read(INNOVATOR_FPGA_CAM_USB_CONTROL)
+                       __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL)
                                & ~((1 << 5/*usb1*/) | (1 << 3/*usb2*/)),
                               INNOVATOR_FPGA_CAM_USB_CONTROL);
                else if (machine_is_omap_osk())
index 1b8133b6e451a7a30965eae265a4106c3050521f..bd7803dce9bed70e2d9802dfe9c8a508e5959752 100644 (file)
@@ -30,7 +30,6 @@
  */
 
 #include <linux/platform_device.h>
-#include <plat/usb.h>
 #include <linux/pm_runtime.h>
 
 /*-------------------------------------------------------------------------*/
index e4780491df4a8255de5f5196ca0813be6f44c681..68ebf20e15192f954eaf1a1e69735fadc878bd68 100644 (file)
@@ -60,6 +60,7 @@ static const struct hc_driver uhci_platform_hc_driver = {
        .hub_control =          uhci_hub_control,
 };
 
+static u64 platform_uhci_dma_mask = DMA_BIT_MASK(32);
 
 static int __devinit uhci_hcd_platform_probe(struct platform_device *pdev)
 {
@@ -71,6 +72,14 @@ static int __devinit uhci_hcd_platform_probe(struct platform_device *pdev)
        if (usb_disabled())
                return -ENODEV;
 
+       /*
+        * Right now device-tree probed devices don't get dma_mask set.
+        * Since shared usb code relies on it, set it here for now.
+        * Once we have dma capability bindings this can go away.
+        */
+       if (!pdev->dev.dma_mask)
+               pdev->dev.dma_mask = &platform_uhci_dma_mask;
+
        hcd = usb_create_hcd(&uhci_platform_hc_driver, &pdev->dev,
                        pdev->name);
        if (!hcd)
index 8d7fcbbe6ade92df9dab163402be686544ae7f84..7d462bf20092cee0d35adad12d42ea1d2a28e595 100644 (file)
@@ -479,7 +479,8 @@ static bool compliance_mode_recovery_timer_quirk_check(void)
 
        if (strstr(dmi_product_name, "Z420") ||
                        strstr(dmi_product_name, "Z620") ||
-                       strstr(dmi_product_name, "Z820"))
+                       strstr(dmi_product_name, "Z820") ||
+                       strstr(dmi_product_name, "Z1"))
                return true;
 
        return false;
index 457f25e62c519a33be80e39dcbb8b222cee8de12..a87cdd2387cf5dc1f8b44834585b032a5940c843 100644 (file)
@@ -34,8 +34,7 @@
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/usb/nop-usb-xceiv.h>
-
-#include <plat/usb.h>
+#include <linux/platform_data/usb-omap.h>
 
 #include "musb_core.h"
 
@@ -305,6 +304,12 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci)
                ret = IRQ_HANDLED;
        }
 
+       /* Drop spurious RX and TX if device is disconnected */
+       if (musb->int_usb & MUSB_INTR_DISCONNECT) {
+               musb->int_tx = 0;
+               musb->int_rx = 0;
+       }
+
        if (musb->int_tx || musb->int_rx || musb->int_usb)
                ret |= musb_interrupt(musb);
 
index 444346e1e10d768086b1e10487f6b6428c892897..a67af21c1460125c5bb1eb23dd4ced8552973c4a 100644 (file)
 #include <linux/pm_runtime.h>
 #include <linux/module.h>
 #include <linux/usb/nop-usb-xceiv.h>
+#include <linux/platform_data/usb-omap.h>
 
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_address.h>
 
-#include <plat/usb.h>
-
 #include "musb_core.h"
 
 #ifdef CONFIG_OF
index b85f3973e78c372061221a9e4e75852af5944629..8ef656659fcbdbf9d3d98854ce76c880e1414fb1 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef __MUSB_OMAP243X_H__
 #define __MUSB_OMAP243X_H__
 
-#include <plat/usb.h>
+#include <linux/platform_data/usb-omap.h>
 
 /*
  * OMAP2430-specific definitions
index 7a62b95dac2455dc3c209296e37f74c92cd59729..bfca114f7c5613cb83c4e4c45d3a2ccdcccce84b 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/slab.h>
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 
 #include "musb_core.h"
 #include "tusb6010.h"
 
 #define MAX_DMAREQ             5       /* REVISIT: Really 6, but req5 not OK */
 
+#define OMAP24XX_DMA_EXT_DMAREQ0       2
+#define OMAP24XX_DMA_EXT_DMAREQ1       3
+#define OMAP242X_DMA_EXT_DMAREQ2       14
+#define OMAP242X_DMA_EXT_DMAREQ3       15
+#define OMAP242X_DMA_EXT_DMAREQ4       16
+#define OMAP242X_DMA_EXT_DMAREQ5       64
+
 struct tusb_omap_dma_ch {
        struct musb             *musb;
        void __iomem            *tbase;
index 35c5208f32494d7c55f4fd98fa79cf517425ca46..61933a90e5bfdbe41fed1679979977e6ff849b4b 100644 (file)
@@ -273,9 +273,9 @@ static irqreturn_t usbhs_interrupt(int irq, void *data)
        usbhs_write(priv, INTSTS0, ~irq_state.intsts0 & INTSTS0_MAGIC);
        usbhs_write(priv, INTSTS1, ~irq_state.intsts1 & INTSTS1_MAGIC);
 
-       usbhs_write(priv, BRDYSTS, 0);
-       usbhs_write(priv, NRDYSTS, 0);
-       usbhs_write(priv, BEMPSTS, 0);
+       usbhs_write(priv, BRDYSTS, ~irq_state.brdysts);
+       usbhs_write(priv, NRDYSTS, ~irq_state.nrdysts);
+       usbhs_write(priv, BEMPSTS, ~irq_state.bempsts);
 
        /*
         * call irq callback functions
index 08786c06dcf1d21f0784ea6d02553c381a11dfd0..3d80c7b1fd1b4ba15133e2ffcd3c5db7be2e9933 100644 (file)
@@ -54,7 +54,7 @@ struct usbhs_pipe_info {
  * pipe list
  */
 #define __usbhs_for_each_pipe(start, pos, info, i)     \
-       for (i = start, pos = (info)->pipe;             \
+       for (i = start, pos = (info)->pipe + i;         \
             i < (info)->size;                          \
             i++, pos = (info)->pipe + i)
 
index cf2522c397d3957c0477a591d20f59d108496aa2..bd50a8a41a0f583a589c06586d09765ae2c13a27 100644 (file)
@@ -125,9 +125,6 @@ static inline int calc_divisor(int bps)
 
 static int ark3116_attach(struct usb_serial *serial)
 {
-       struct usb_serial_port *port = serial->port[0];
-       struct ark3116_private *priv;
-
        /* make sure we have our end-points */
        if ((serial->num_bulk_in == 0) ||
            (serial->num_bulk_out == 0) ||
@@ -142,8 +139,15 @@ static int ark3116_attach(struct usb_serial *serial)
                return -EINVAL;
        }
 
-       priv = kzalloc(sizeof(struct ark3116_private),
-                      GFP_KERNEL);
+       return 0;
+}
+
+static int ark3116_port_probe(struct usb_serial_port *port)
+{
+       struct usb_serial *serial = port->serial;
+       struct ark3116_private *priv;
+
+       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
        if (!priv)
                return -ENOMEM;
 
@@ -198,18 +202,15 @@ static int ark3116_attach(struct usb_serial *serial)
        return 0;
 }
 
-static void ark3116_release(struct usb_serial *serial)
+static int ark3116_port_remove(struct usb_serial_port *port)
 {
-       struct usb_serial_port *port = serial->port[0];
        struct ark3116_private *priv = usb_get_serial_port_data(port);
 
        /* device is closed, so URBs and DMA should be down */
-
-       usb_set_serial_port_data(port, NULL);
-
        mutex_destroy(&priv->hw_lock);
-
        kfree(priv);
+
+       return 0;
 }
 
 static void ark3116_init_termios(struct tty_struct *tty)
@@ -723,7 +724,8 @@ static struct usb_serial_driver ark3116_device = {
        .id_table =             id_table,
        .num_ports =            1,
        .attach =               ark3116_attach,
-       .release =              ark3116_release,
+       .port_probe =           ark3116_port_probe,
+       .port_remove =          ark3116_port_remove,
        .set_termios =          ark3116_set_termios,
        .init_termios =         ark3116_init_termios,
        .ioctl =                ark3116_ioctl,
index 99449424193f7295f5e3e5160e7993542080bda1..ea29556f0d7222a87475afa34e6fe683f6b4e513 100644 (file)
@@ -45,8 +45,8 @@
 #define DRIVER_DESC "USB Belkin Serial converter driver"
 
 /* function prototypes for a Belkin USB Serial Adapter F5U103 */
-static int  belkin_sa_startup(struct usb_serial *serial);
-static void belkin_sa_release(struct usb_serial *serial);
+static int belkin_sa_port_probe(struct usb_serial_port *port);
+static int belkin_sa_port_remove(struct usb_serial_port *port);
 static int  belkin_sa_open(struct tty_struct *tty,
                        struct usb_serial_port *port);
 static void belkin_sa_close(struct usb_serial_port *port);
@@ -88,8 +88,8 @@ static struct usb_serial_driver belkin_device = {
        .break_ctl =            belkin_sa_break_ctl,
        .tiocmget =             belkin_sa_tiocmget,
        .tiocmset =             belkin_sa_tiocmset,
-       .attach =               belkin_sa_startup,
-       .release =              belkin_sa_release,
+       .port_probe =           belkin_sa_port_probe,
+       .port_remove =          belkin_sa_port_remove,
 };
 
 static struct usb_serial_driver * const serial_drivers[] = {
@@ -118,17 +118,15 @@ struct belkin_sa_private {
                                            (c), BELKIN_SA_SET_REQUEST_TYPE, \
                                            (v), 0, NULL, 0, WDR_TIMEOUT)
 
-/* do some startup allocations not currently performed by usb_serial_probe() */
-static int belkin_sa_startup(struct usb_serial *serial)
+static int belkin_sa_port_probe(struct usb_serial_port *port)
 {
-       struct usb_device *dev = serial->dev;
+       struct usb_device *dev = port->serial->dev;
        struct belkin_sa_private *priv;
 
-       /* allocate the private data structure */
        priv = kmalloc(sizeof(struct belkin_sa_private), GFP_KERNEL);
        if (!priv)
-               return -1; /* error */
-       /* set initial values for control structures */
+               return -ENOMEM;
+
        spin_lock_init(&priv->lock);
        priv->control_state = 0;
        priv->last_lsr = 0;
@@ -140,18 +138,19 @@ static int belkin_sa_startup(struct usb_serial *serial)
                                        le16_to_cpu(dev->descriptor.bcdDevice),
                                        priv->bad_flow_control);
 
-       init_waitqueue_head(&serial->port[0]->write_wait);
-       usb_set_serial_port_data(serial->port[0], priv);
+       usb_set_serial_port_data(port, priv);
 
        return 0;
 }
 
-static void belkin_sa_release(struct usb_serial *serial)
+static int belkin_sa_port_remove(struct usb_serial_port *port)
 {
-       int i;
+       struct belkin_sa_private *priv;
 
-       for (i = 0; i < serial->num_ports; ++i)
-               kfree(usb_get_serial_port_data(serial->port[i]));
+       priv = usb_get_serial_port_data(port);
+       kfree(priv);
+
+       return 0;
 }
 
 static int belkin_sa_open(struct tty_struct *tty,
index 28af5acc3360c57beaad356f1b4aa016fc221810..eb033fc92a156bf3c8f43e94a248ead38f695642 100644 (file)
@@ -162,7 +162,7 @@ static const struct usb_device_id id_table[] = {
 
 MODULE_DEVICE_TABLE(usb, id_table);
 
-struct cp210x_port_private {
+struct cp210x_serial_private {
        __u8                    bInterfaceNumber;
 };
 
@@ -276,7 +276,7 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request,
                unsigned int *data, int size)
 {
        struct usb_serial *serial = port->serial;
-       struct cp210x_port_private *port_priv = usb_get_serial_port_data(port);
+       struct cp210x_serial_private *spriv = usb_get_serial_data(serial);
        __le32 *buf;
        int result, i, length;
 
@@ -292,7 +292,7 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request,
        /* Issue the request, attempting to read 'size' bytes */
        result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
                                request, REQTYPE_INTERFACE_TO_HOST, 0x0000,
-                               port_priv->bInterfaceNumber, buf, size,
+                               spriv->bInterfaceNumber, buf, size,
                                USB_CTRL_GET_TIMEOUT);
 
        /* Convert data into an array of integers */
@@ -323,7 +323,7 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request,
                unsigned int *data, int size)
 {
        struct usb_serial *serial = port->serial;
-       struct cp210x_port_private *port_priv = usb_get_serial_port_data(port);
+       struct cp210x_serial_private *spriv = usb_get_serial_data(serial);
        __le32 *buf;
        int result, i, length;
 
@@ -345,13 +345,13 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request,
                result = usb_control_msg(serial->dev,
                                usb_sndctrlpipe(serial->dev, 0),
                                request, REQTYPE_HOST_TO_INTERFACE, 0x0000,
-                               port_priv->bInterfaceNumber, buf, size,
+                               spriv->bInterfaceNumber, buf, size,
                                USB_CTRL_SET_TIMEOUT);
        } else {
                result = usb_control_msg(serial->dev,
                                usb_sndctrlpipe(serial->dev, 0),
                                request, REQTYPE_HOST_TO_INTERFACE, data[0],
-                               port_priv->bInterfaceNumber, NULL, 0,
+                               spriv->bInterfaceNumber, NULL, 0,
                                USB_CTRL_SET_TIMEOUT);
        }
 
@@ -845,36 +845,30 @@ static void cp210x_break_ctl (struct tty_struct *tty, int break_state)
 
 static int cp210x_startup(struct usb_serial *serial)
 {
-       struct cp210x_port_private *port_priv;
-       int i;
+       struct usb_host_interface *cur_altsetting;
+       struct cp210x_serial_private *spriv;
 
        /* cp210x buffers behave strangely unless device is reset */
        usb_reset_device(serial->dev);
 
-       for (i = 0; i < serial->num_ports; i++) {
-               port_priv = kzalloc(sizeof(*port_priv), GFP_KERNEL);
-               if (!port_priv)
-                       return -ENOMEM;
+       spriv = kzalloc(sizeof(*spriv), GFP_KERNEL);
+       if (!spriv)
+               return -ENOMEM;
 
-               port_priv->bInterfaceNumber =
-                   serial->interface->cur_altsetting->desc.bInterfaceNumber;
+       cur_altsetting = serial->interface->cur_altsetting;
+       spriv->bInterfaceNumber = cur_altsetting->desc.bInterfaceNumber;
 
-               usb_set_serial_port_data(serial->port[i], port_priv);
-       }
+       usb_set_serial_data(serial, spriv);
 
        return 0;
 }
 
 static void cp210x_release(struct usb_serial *serial)
 {
-       struct cp210x_port_private *port_priv;
-       int i;
+       struct cp210x_serial_private *spriv;
 
-       for (i = 0; i < serial->num_ports; i++) {
-               port_priv = usb_get_serial_port_data(serial->port[i]);
-               kfree(port_priv);
-               usb_set_serial_port_data(serial->port[i], NULL);
-       }
+       spriv = usb_get_serial_data(serial);
+       kfree(spriv);
 }
 
 module_usb_serial_driver(serial_drivers, id_table);
index 2a7aecc72237ccaac68b2c922093182c878acbda..4ee77dcbe690dc73e95f79ebf2d3d75e2784326b 100644 (file)
@@ -55,9 +55,9 @@
 #define CYBERJACK_PRODUCT_ID   0x0100
 
 /* Function prototypes */
-static int cyberjack_startup(struct usb_serial *serial);
 static void cyberjack_disconnect(struct usb_serial *serial);
-static void cyberjack_release(struct usb_serial *serial);
+static int cyberjack_port_probe(struct usb_serial_port *port);
+static int cyberjack_port_remove(struct usb_serial_port *port);
 static int  cyberjack_open(struct tty_struct *tty,
        struct usb_serial_port *port);
 static void cyberjack_close(struct usb_serial_port *port);
@@ -83,9 +83,9 @@ static struct usb_serial_driver cyberjack_device = {
        .description =          "Reiner SCT Cyberjack USB card reader",
        .id_table =             id_table,
        .num_ports =            1,
-       .attach =               cyberjack_startup,
        .disconnect =           cyberjack_disconnect,
-       .release =              cyberjack_release,
+       .port_probe =           cyberjack_port_probe,
+       .port_remove =          cyberjack_port_remove,
        .open =                 cyberjack_open,
        .close =                cyberjack_close,
        .write =                cyberjack_write,
@@ -107,56 +107,45 @@ struct cyberjack_private {
        short           wrsent;         /* Data already sent */
 };
 
-/* do some startup allocations not currently performed by usb_serial_probe() */
-static int cyberjack_startup(struct usb_serial *serial)
+static int cyberjack_port_probe(struct usb_serial_port *port)
 {
        struct cyberjack_private *priv;
-       int i;
+       int result;
 
-       /* allocate the private data structure */
        priv = kmalloc(sizeof(struct cyberjack_private), GFP_KERNEL);
        if (!priv)
                return -ENOMEM;
 
-       /* set initial values */
        spin_lock_init(&priv->lock);
        priv->rdtodo = 0;
        priv->wrfilled = 0;
        priv->wrsent = 0;
-       usb_set_serial_port_data(serial->port[0], priv);
 
-       init_waitqueue_head(&serial->port[0]->write_wait);
+       usb_set_serial_port_data(port, priv);
 
-       for (i = 0; i < serial->num_ports; ++i) {
-               int result;
-               result = usb_submit_urb(serial->port[i]->interrupt_in_urb,
-                                       GFP_KERNEL);
-               if (result)
-                       dev_err(&serial->dev->dev,
-                               "usb_submit_urb(read int) failed\n");
-               dev_dbg(&serial->dev->dev, "%s - usb_submit_urb(int urb)\n",
-                       __func__);
-       }
+       result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
+       if (result)
+               dev_err(&port->dev, "usb_submit_urb(read int) failed\n");
 
        return 0;
 }
 
-static void cyberjack_disconnect(struct usb_serial *serial)
+static int cyberjack_port_remove(struct usb_serial_port *port)
 {
-       int i;
+       struct cyberjack_private *priv;
 
-       for (i = 0; i < serial->num_ports; ++i)
-               usb_kill_urb(serial->port[i]->interrupt_in_urb);
+       priv = usb_get_serial_port_data(port);
+       kfree(priv);
+
+       return 0;
 }
 
-static void cyberjack_release(struct usb_serial *serial)
+static void cyberjack_disconnect(struct usb_serial *serial)
 {
        int i;
 
-       for (i = 0; i < serial->num_ports; ++i) {
-               /* My special items, the standard routines free my urbs */
-               kfree(usb_get_serial_port_data(serial->port[i]));
-       }
+       for (i = 0; i < serial->num_ports; ++i)
+               usb_kill_urb(serial->port[i]->interrupt_in_urb);
 }
 
 static int  cyberjack_open(struct tty_struct *tty,
index 1befce21e1734df489e940e49023a9b8a3c37d95..f0da1279c11410ece644a5fd4f4cf9e4532588c8 100644 (file)
@@ -123,10 +123,10 @@ struct cypress_private {
 };
 
 /* function prototypes for the Cypress USB to serial device */
-static int  cypress_earthmate_startup(struct usb_serial *serial);
-static int  cypress_hidcom_startup(struct usb_serial *serial);
-static int  cypress_ca42v2_startup(struct usb_serial *serial);
-static void cypress_release(struct usb_serial *serial);
+static int  cypress_earthmate_port_probe(struct usb_serial_port *port);
+static int  cypress_hidcom_port_probe(struct usb_serial_port *port);
+static int  cypress_ca42v2_port_probe(struct usb_serial_port *port);
+static int  cypress_port_remove(struct usb_serial_port *port);
 static int  cypress_open(struct tty_struct *tty, struct usb_serial_port *port);
 static void cypress_close(struct usb_serial_port *port);
 static void cypress_dtr_rts(struct usb_serial_port *port, int on);
@@ -156,8 +156,8 @@ static struct usb_serial_driver cypress_earthmate_device = {
        .description =                  "DeLorme Earthmate USB",
        .id_table =                     id_table_earthmate,
        .num_ports =                    1,
-       .attach =                       cypress_earthmate_startup,
-       .release =                      cypress_release,
+       .port_probe =                   cypress_earthmate_port_probe,
+       .port_remove =                  cypress_port_remove,
        .open =                         cypress_open,
        .close =                        cypress_close,
        .dtr_rts =                      cypress_dtr_rts,
@@ -182,8 +182,8 @@ static struct usb_serial_driver cypress_hidcom_device = {
        .description =                  "HID->COM RS232 Adapter",
        .id_table =                     id_table_cyphidcomrs232,
        .num_ports =                    1,
-       .attach =                       cypress_hidcom_startup,
-       .release =                      cypress_release,
+       .port_probe =                   cypress_hidcom_port_probe,
+       .port_remove =                  cypress_port_remove,
        .open =                         cypress_open,
        .close =                        cypress_close,
        .dtr_rts =                      cypress_dtr_rts,
@@ -208,8 +208,8 @@ static struct usb_serial_driver cypress_ca42v2_device = {
        .description =                  "Nokia CA-42 V2 Adapter",
        .id_table =                     id_table_nokiaca42v2,
        .num_ports =                    1,
-       .attach =                       cypress_ca42v2_startup,
-       .release =                      cypress_release,
+       .port_probe =                   cypress_ca42v2_port_probe,
+       .port_remove =                  cypress_port_remove,
        .open =                         cypress_open,
        .close =                        cypress_close,
        .dtr_rts =                      cypress_dtr_rts,
@@ -438,10 +438,10 @@ static void cypress_set_dead(struct usb_serial_port *port)
  *****************************************************************************/
 
 
-static int generic_startup(struct usb_serial *serial)
+static int cypress_generic_port_probe(struct usb_serial_port *port)
 {
+       struct usb_serial *serial = port->serial;
        struct cypress_private *priv;
-       struct usb_serial_port *port = serial->port[0];
 
        priv = kzalloc(sizeof(struct cypress_private), GFP_KERNEL);
        if (!priv)
@@ -490,14 +490,16 @@ static int generic_startup(struct usb_serial *serial)
 }
 
 
-static int cypress_earthmate_startup(struct usb_serial *serial)
+static int cypress_earthmate_port_probe(struct usb_serial_port *port)
 {
+       struct usb_serial *serial = port->serial;
        struct cypress_private *priv;
-       struct usb_serial_port *port = serial->port[0];
+       int ret;
 
-       if (generic_startup(serial)) {
+       ret = cypress_generic_port_probe(port);
+       if (ret) {
                dev_dbg(&port->dev, "%s - Failed setting up port\n", __func__);
-               return 1;
+               return ret;
        }
 
        priv = usb_get_serial_port_data(port);
@@ -518,56 +520,53 @@ static int cypress_earthmate_startup(struct usb_serial *serial)
        }
 
        return 0;
-} /* cypress_earthmate_startup */
-
+}
 
-static int cypress_hidcom_startup(struct usb_serial *serial)
+static int cypress_hidcom_port_probe(struct usb_serial_port *port)
 {
        struct cypress_private *priv;
-       struct usb_serial_port *port = serial->port[0];
+       int ret;
 
-       if (generic_startup(serial)) {
+       ret = cypress_generic_port_probe(port);
+       if (ret) {
                dev_dbg(&port->dev, "%s - Failed setting up port\n", __func__);
-               return 1;
+               return ret;
        }
 
        priv = usb_get_serial_port_data(port);
        priv->chiptype = CT_CYPHIDCOM;
 
        return 0;
-} /* cypress_hidcom_startup */
-
+}
 
-static int cypress_ca42v2_startup(struct usb_serial *serial)
+static int cypress_ca42v2_port_probe(struct usb_serial_port *port)
 {
        struct cypress_private *priv;
-       struct usb_serial_port *port = serial->port[0];
+       int ret;
 
-       if (generic_startup(serial)) {
+       ret = cypress_generic_port_probe(port);
+       if (ret) {
                dev_dbg(&port->dev, "%s - Failed setting up port\n", __func__);
-               return 1;
+               return ret;
        }
 
        priv = usb_get_serial_port_data(port);
        priv->chiptype = CT_CA42V2;
 
        return 0;
-} /* cypress_ca42v2_startup */
-
+}
 
-static void cypress_release(struct usb_serial *serial)
+static int cypress_port_remove(struct usb_serial_port *port)
 {
        struct cypress_private *priv;
 
-       /* all open ports are closed at this point */
-       priv = usb_get_serial_port_data(serial->port[0]);
+       priv = usb_get_serial_port_data(port);
 
-       if (priv) {
-               kfifo_free(&priv->write_fifo);
-               kfree(priv);
-       }
-}
+       kfifo_free(&priv->write_fifo);
+       kfree(priv);
 
+       return 0;
+}
 
 static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port)
 {
index 244477107e2f1f1b9a13e0d26349eac502563c0a..6e4eb57d0177406c5eb8f9d30c83f0551dd159f7 100644 (file)
@@ -318,39 +318,30 @@ static int f81232_ioctl(struct tty_struct *tty,
        return -ENOIOCTLCMD;
 }
 
-static int f81232_startup(struct usb_serial *serial)
+static int f81232_port_probe(struct usb_serial_port *port)
 {
        struct f81232_private *priv;
-       int i;
 
-       for (i = 0; i < serial->num_ports; ++i) {
-               priv = kzalloc(sizeof(struct f81232_private), GFP_KERNEL);
-               if (!priv)
-                       goto cleanup;
-               spin_lock_init(&priv->lock);
-               init_waitqueue_head(&priv->delta_msr_wait);
-               usb_set_serial_port_data(serial->port[i], priv);
-       }
-       return 0;
+       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
 
-cleanup:
-       for (--i; i >= 0; --i) {
-               priv = usb_get_serial_port_data(serial->port[i]);
-               kfree(priv);
-               usb_set_serial_port_data(serial->port[i], NULL);
-       }
-       return -ENOMEM;
+       spin_lock_init(&priv->lock);
+       init_waitqueue_head(&priv->delta_msr_wait);
+
+       usb_set_serial_port_data(port, priv);
+
+       return 0;
 }
 
-static void f81232_release(struct usb_serial *serial)
+static int f81232_port_remove(struct usb_serial_port *port)
 {
-       int i;
        struct f81232_private *priv;
 
-       for (i = 0; i < serial->num_ports; ++i) {
-               priv = usb_get_serial_port_data(serial->port[i]);
-               kfree(priv);
-       }
+       priv = usb_get_serial_port_data(port);
+       kfree(priv);
+
+       return 0;
 }
 
 static struct usb_serial_driver f81232_device = {
@@ -373,8 +364,8 @@ static struct usb_serial_driver f81232_device = {
        .tiocmset =             f81232_tiocmset,
        .process_read_urb =     f81232_process_read_urb,
        .read_int_callback =    f81232_read_int_callback,
-       .attach =               f81232_startup,
-       .release =              f81232_release,
+       .port_probe =           f81232_port_probe,
+       .port_remove =          f81232_port_remove,
 };
 
 static struct usb_serial_driver * const serial_drivers[] = {
index 3ee92648c02dd589a75dc7d29125f26d3aa1f9ff..203358d7e7bc6ed23d78bf0a35cbf797e3e4f4bb 100644 (file)
@@ -1405,11 +1405,10 @@ static void timeout_handler(unsigned long data)
 
 
 
-static int garmin_attach(struct usb_serial *serial)
+static int garmin_port_probe(struct usb_serial_port *port)
 {
-       int status = 0;
-       struct usb_serial_port *port = serial->port[0];
-       struct garmin_data *garmin_data_p = NULL;
+       int status;
+       struct garmin_data *garmin_data_p;
 
        garmin_data_p = kzalloc(sizeof(struct garmin_data), GFP_KERNEL);
        if (garmin_data_p == NULL) {
@@ -1434,22 +1433,14 @@ static int garmin_attach(struct usb_serial *serial)
 }
 
 
-static void garmin_disconnect(struct usb_serial *serial)
+static int garmin_port_remove(struct usb_serial_port *port)
 {
-       struct usb_serial_port *port = serial->port[0];
        struct garmin_data *garmin_data_p = usb_get_serial_port_data(port);
 
        usb_kill_urb(port->interrupt_in_urb);
        del_timer_sync(&garmin_data_p->timer);
-}
-
-
-static void garmin_release(struct usb_serial *serial)
-{
-       struct usb_serial_port *port = serial->port[0];
-       struct garmin_data *garmin_data_p = usb_get_serial_port_data(port);
-
        kfree(garmin_data_p);
+       return 0;
 }
 
 
@@ -1466,9 +1457,8 @@ static struct usb_serial_driver garmin_device = {
        .close               = garmin_close,
        .throttle            = garmin_throttle,
        .unthrottle          = garmin_unthrottle,
-       .attach              = garmin_attach,
-       .disconnect          = garmin_disconnect,
-       .release             = garmin_release,
+       .port_probe             = garmin_port_probe,
+       .port_remove            = garmin_port_remove,
        .write               = garmin_write,
        .write_room          = garmin_write_room,
        .write_bulk_callback = garmin_write_bulk_callback,
index 8e6faaf3580cb102abaea73be8d3636446dba7b6..5acc0d13864a400344a012400f20bc989fa23574 100644 (file)
@@ -225,6 +225,8 @@ static int  edge_get_icount(struct tty_struct *tty,
 static int  edge_startup(struct usb_serial *serial);
 static void edge_disconnect(struct usb_serial *serial);
 static void edge_release(struct usb_serial *serial);
+static int edge_port_probe(struct usb_serial_port *port);
+static int edge_port_remove(struct usb_serial_port *port);
 
 #include "io_tables.h" /* all of the devices that this driver supports */
 
@@ -2875,10 +2877,9 @@ static void load_application_firmware(struct edgeport_serial *edge_serial)
 static int edge_startup(struct usb_serial *serial)
 {
        struct edgeport_serial *edge_serial;
-       struct edgeport_port *edge_port;
        struct usb_device *dev;
        struct device *ddev = &serial->dev->dev;
-       int i, j;
+       int i;
        int response;
        bool interrupt_in_found;
        bool bulk_in_found;
@@ -2961,25 +2962,6 @@ static int edge_startup(struct usb_serial *serial)
        /* we set up the pointers to the endpoints in the edge_open function,
         * as the structures aren't created yet. */
 
-       /* set up our port private structures */
-       for (i = 0; i < serial->num_ports; ++i) {
-               edge_port = kzalloc(sizeof(struct edgeport_port), GFP_KERNEL);
-               if (edge_port == NULL) {
-                       dev_err(ddev, "%s - Out of memory\n", __func__);
-                       for (j = 0; j < i; ++j) {
-                               kfree(usb_get_serial_port_data(serial->port[j]));
-                               usb_set_serial_port_data(serial->port[j],
-                                                                       NULL);
-                       }
-                       usb_set_serial_data(serial, NULL);
-                       kfree(edge_serial);
-                       return -ENOMEM;
-               }
-               spin_lock_init(&edge_port->ep_lock);
-               edge_port->port = serial->port[i];
-               usb_set_serial_port_data(serial->port[i], edge_port);
-       }
-
        response = 0;
 
        if (edge_serial->is_epic) {
@@ -3120,14 +3102,36 @@ static void edge_disconnect(struct usb_serial *serial)
 static void edge_release(struct usb_serial *serial)
 {
        struct edgeport_serial *edge_serial = usb_get_serial_data(serial);
-       int i;
-
-       for (i = 0; i < serial->num_ports; ++i)
-               kfree(usb_get_serial_port_data(serial->port[i]));
 
        kfree(edge_serial);
 }
 
+static int edge_port_probe(struct usb_serial_port *port)
+{
+       struct edgeport_port *edge_port;
+
+       edge_port = kzalloc(sizeof(*edge_port), GFP_KERNEL);
+       if (!edge_port)
+               return -ENOMEM;
+
+       spin_lock_init(&edge_port->ep_lock);
+       edge_port->port = port;
+
+       usb_set_serial_port_data(port, edge_port);
+
+       return 0;
+}
+
+static int edge_port_remove(struct usb_serial_port *port)
+{
+       struct edgeport_port *edge_port;
+
+       edge_port = usb_get_serial_port_data(port);
+       kfree(edge_port);
+
+       return 0;
+}
+
 module_usb_serial_driver(serial_drivers, id_table_combined);
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
index 350afddb55ba8c1fd276068518de05c78ac280ee..1511dd0ad3242650e6da605d316b2d7165b1fb2d 100644 (file)
@@ -110,6 +110,8 @@ static struct usb_serial_driver edgeport_2port_device = {
        .attach                 = edge_startup,
        .disconnect             = edge_disconnect,
        .release                = edge_release,
+       .port_probe             = edge_port_probe,
+       .port_remove            = edge_port_remove,
        .ioctl                  = edge_ioctl,
        .set_termios            = edge_set_termios,
        .tiocmget               = edge_tiocmget,
@@ -139,6 +141,8 @@ static struct usb_serial_driver edgeport_4port_device = {
        .attach                 = edge_startup,
        .disconnect             = edge_disconnect,
        .release                = edge_release,
+       .port_probe             = edge_port_probe,
+       .port_remove            = edge_port_remove,
        .ioctl                  = edge_ioctl,
        .set_termios            = edge_set_termios,
        .tiocmget               = edge_tiocmget,
@@ -168,6 +172,8 @@ static struct usb_serial_driver edgeport_8port_device = {
        .attach                 = edge_startup,
        .disconnect             = edge_disconnect,
        .release                = edge_release,
+       .port_probe             = edge_port_probe,
+       .port_remove            = edge_port_remove,
        .ioctl                  = edge_ioctl,
        .set_termios            = edge_set_termios,
        .tiocmget               = edge_tiocmget,
@@ -197,6 +203,8 @@ static struct usb_serial_driver epic_device = {
        .attach                 = edge_startup,
        .disconnect             = edge_disconnect,
        .release                = edge_release,
+       .port_probe             = edge_port_probe,
+       .port_remove            = edge_port_remove,
        .ioctl                  = edge_ioctl,
        .set_termios            = edge_set_termios,
        .tiocmget               = edge_tiocmget,
index a2209cd4509396d3827d4a0627c59f42b5d713be..60023c2d2a317008d7aab0c78bd5120f77b1597c 100644 (file)
@@ -2532,12 +2532,7 @@ static void edge_break(struct tty_struct *tty, int break_state)
 static int edge_startup(struct usb_serial *serial)
 {
        struct edgeport_serial *edge_serial;
-       struct edgeport_port *edge_port;
-       struct usb_device *dev;
        int status;
-       int i;
-
-       dev = serial->dev;
 
        /* create our private serial structure */
        edge_serial = kzalloc(sizeof(struct edgeport_serial), GFP_KERNEL);
@@ -2555,40 +2550,7 @@ static int edge_startup(struct usb_serial *serial)
                return status;
        }
 
-       /* set up our port private structures */
-       for (i = 0; i < serial->num_ports; ++i) {
-               edge_port = kzalloc(sizeof(struct edgeport_port), GFP_KERNEL);
-               if (edge_port == NULL) {
-                       dev_err(&serial->dev->dev, "%s - Out of memory\n",
-                                                               __func__);
-                       goto cleanup;
-               }
-               spin_lock_init(&edge_port->ep_lock);
-               if (kfifo_alloc(&edge_port->write_fifo, EDGE_OUT_BUF_SIZE,
-                                                               GFP_KERNEL)) {
-                       dev_err(&serial->dev->dev, "%s - Out of memory\n",
-                                                               __func__);
-                       kfree(edge_port);
-                       goto cleanup;
-               }
-               edge_port->port = serial->port[i];
-               edge_port->edge_serial = edge_serial;
-               usb_set_serial_port_data(serial->port[i], edge_port);
-               edge_port->bUartMode = default_uart_mode;
-       }
-
        return 0;
-
-cleanup:
-       for (--i; i >= 0; --i) {
-               edge_port = usb_get_serial_port_data(serial->port[i]);
-               kfifo_free(&edge_port->write_fifo);
-               kfree(edge_port);
-               usb_set_serial_port_data(serial->port[i], NULL);
-       }
-       kfree(edge_serial);
-       usb_set_serial_data(serial, NULL);
-       return -ENOMEM;
 }
 
 static void edge_disconnect(struct usb_serial *serial)
@@ -2597,17 +2559,54 @@ static void edge_disconnect(struct usb_serial *serial)
 
 static void edge_release(struct usb_serial *serial)
 {
-       int i;
+       kfree(usb_get_serial_data(serial));
+}
+
+static int edge_port_probe(struct usb_serial_port *port)
+{
        struct edgeport_port *edge_port;
+       int ret;
 
-       for (i = 0; i < serial->num_ports; ++i) {
-               edge_port = usb_get_serial_port_data(serial->port[i]);
+       edge_port = kzalloc(sizeof(*edge_port), GFP_KERNEL);
+       if (!edge_port)
+               return -ENOMEM;
+
+       ret = kfifo_alloc(&edge_port->write_fifo, EDGE_OUT_BUF_SIZE,
+                                                               GFP_KERNEL);
+       if (ret) {
+               kfree(edge_port);
+               return -ENOMEM;
+       }
+
+       spin_lock_init(&edge_port->ep_lock);
+       edge_port->port = port;
+       edge_port->edge_serial = usb_get_serial_data(port->serial);
+       edge_port->bUartMode = default_uart_mode;
+
+       usb_set_serial_port_data(port, edge_port);
+
+       ret = edge_create_sysfs_attrs(port);
+       if (ret) {
                kfifo_free(&edge_port->write_fifo);
                kfree(edge_port);
+               return ret;
        }
-       kfree(usb_get_serial_data(serial));
+
+       return 0;
 }
 
+static int edge_port_remove(struct usb_serial_port *port)
+{
+       struct edgeport_port *edge_port;
+
+       edge_port = usb_get_serial_port_data(port);
+
+       edge_remove_sysfs_attrs(port);
+       kfifo_free(&edge_port->write_fifo);
+       kfree(edge_port);
+
+       return 0;
+}
 
 /* Sysfs Attributes */
 
@@ -2667,8 +2666,8 @@ static struct usb_serial_driver edgeport_1port_device = {
        .attach                 = edge_startup,
        .disconnect             = edge_disconnect,
        .release                = edge_release,
-       .port_probe             = edge_create_sysfs_attrs,
-       .port_remove            = edge_remove_sysfs_attrs,
+       .port_probe             = edge_port_probe,
+       .port_remove            = edge_port_remove,
        .ioctl                  = edge_ioctl,
        .set_termios            = edge_set_termios,
        .tiocmget               = edge_tiocmget,
@@ -2698,8 +2697,8 @@ static struct usb_serial_driver edgeport_2port_device = {
        .attach                 = edge_startup,
        .disconnect             = edge_disconnect,
        .release                = edge_release,
-       .port_probe             = edge_create_sysfs_attrs,
-       .port_remove            = edge_remove_sysfs_attrs,
+       .port_probe             = edge_port_probe,
+       .port_remove            = edge_port_remove,
        .ioctl                  = edge_ioctl,
        .set_termios            = edge_set_termios,
        .tiocmget               = edge_tiocmget,
index 01da3ea36e89d5363a8890339eac6165dec0e14c..cd5533e81de7e113d77898795996346ce036378a 100644 (file)
@@ -53,6 +53,8 @@ static int iuu_cardout;
 static bool xmas;
 static int vcc_default = 5;
 
+static int iuu_create_sysfs_attrs(struct usb_serial_port *port);
+static int iuu_remove_sysfs_attrs(struct usb_serial_port *port);
 static void read_rxcmd_callback(struct urb *urb);
 
 struct iuu_private {
@@ -72,63 +74,55 @@ struct iuu_private {
        u32 clk;
 };
 
-
-static void iuu_free_buf(struct iuu_private *priv)
-{
-       kfree(priv->buf);
-       kfree(priv->writebuf);
-}
-
-static int iuu_alloc_buf(struct usb_serial *serial, struct iuu_private *priv)
-{
-       priv->buf = kzalloc(256, GFP_KERNEL);
-       priv->writebuf = kzalloc(256, GFP_KERNEL);
-       if (!priv->buf || !priv->writebuf) {
-               iuu_free_buf(priv);
-               dev_dbg(&serial->dev->dev, "%s problem allocation buffer\n", __func__);
-               return -ENOMEM;
-       }
-       dev_dbg(&serial->dev->dev, "%s - Privates buffers allocation success\n", __func__);
-       return 0;
-}
-
-static int iuu_startup(struct usb_serial *serial)
+static int iuu_port_probe(struct usb_serial_port *port)
 {
        struct iuu_private *priv;
+       int ret;
 
        priv = kzalloc(sizeof(struct iuu_private), GFP_KERNEL);
-       dev_dbg(&serial->dev->dev, "%s- priv allocation success\n", __func__);
        if (!priv)
                return -ENOMEM;
-       if (iuu_alloc_buf(serial, priv)) {
+
+       priv->buf = kzalloc(256, GFP_KERNEL);
+       if (!priv->buf) {
+               kfree(priv);
+               return -ENOMEM;
+       }
+
+       priv->writebuf = kzalloc(256, GFP_KERNEL);
+       if (!priv->writebuf) {
+               kfree(priv->buf);
                kfree(priv);
                return -ENOMEM;
        }
+
        priv->vcc = vcc_default;
        spin_lock_init(&priv->lock);
        init_waitqueue_head(&priv->delta_msr_wait);
-       usb_set_serial_port_data(serial->port[0], priv);
+
+       usb_set_serial_port_data(port, priv);
+
+       ret = iuu_create_sysfs_attrs(port);
+       if (ret) {
+               kfree(priv->writebuf);
+               kfree(priv->buf);
+               kfree(priv);
+               return ret;
+       }
+
        return 0;
 }
 
-/* Release function */
-static void iuu_release(struct usb_serial *serial)
+static int iuu_port_remove(struct usb_serial_port *port)
 {
-       struct usb_serial_port *port = serial->port[0];
        struct iuu_private *priv = usb_get_serial_port_data(port);
-       if (!port)
-               return;
 
-       if (priv) {
-               iuu_free_buf(priv);
-               dev_dbg(&port->dev, "%s - I will free all\n", __func__);
-               usb_set_serial_port_data(port, NULL);
-
-               dev_dbg(&port->dev, "%s - priv is not anymore in port structure\n", __func__);
-               kfree(priv);
+       iuu_remove_sysfs_attrs(port);
+       kfree(priv->writebuf);
+       kfree(priv->buf);
+       kfree(priv);
 
-               dev_dbg(&port->dev, "%s priv is now kfree\n", __func__);
-       }
+       return 0;
 }
 
 static int iuu_tiocmset(struct tty_struct *tty,
@@ -1215,8 +1209,6 @@ static struct usb_serial_driver iuu_device = {
        .num_ports = 1,
        .bulk_in_size = 512,
        .bulk_out_size = 512,
-       .port_probe = iuu_create_sysfs_attrs,
-       .port_remove = iuu_remove_sysfs_attrs,
        .open = iuu_open,
        .close = iuu_close,
        .write = iuu_uart_write,
@@ -1225,8 +1217,8 @@ static struct usb_serial_driver iuu_device = {
        .tiocmset = iuu_tiocmset,
        .set_termios = iuu_set_termios,
        .init_termios = iuu_init_termios,
-       .attach = iuu_startup,
-       .release = iuu_release,
+       .port_probe = iuu_port_probe,
+       .port_remove = iuu_port_remove,
 };
 
 static struct usb_serial_driver * const serial_drivers[] = {
index ca43ecb4a2bdd494e997a36ecd591b3a410132d2..bb87e29c4ac29645804b05a9e52455f8125ff05c 100644 (file)
@@ -713,29 +713,33 @@ MODULE_FIRMWARE("keyspan_pda/keyspan_pda.fw");
 MODULE_FIRMWARE("keyspan_pda/xircom_pgs.fw");
 #endif
 
-static int keyspan_pda_startup(struct usb_serial *serial)
+static int keyspan_pda_port_probe(struct usb_serial_port *port)
 {
 
        struct keyspan_pda_private *priv;
 
-       /* allocate the private data structures for all ports. Well, for all
-          one ports. */
-
        priv = kmalloc(sizeof(struct keyspan_pda_private), GFP_KERNEL);
        if (!priv)
-               return 1; /* error */
-       usb_set_serial_port_data(serial->port[0], priv);
-       init_waitqueue_head(&serial->port[0]->write_wait);
+               return -ENOMEM;
+
        INIT_WORK(&priv->wakeup_work, keyspan_pda_wakeup_write);
        INIT_WORK(&priv->unthrottle_work, keyspan_pda_request_unthrottle);
-       priv->serial = serial;
-       priv->port = serial->port[0];
+       priv->serial = port->serial;
+       priv->port = port;
+
+       usb_set_serial_port_data(port, priv);
+
        return 0;
 }
 
-static void keyspan_pda_release(struct usb_serial *serial)
+static int keyspan_pda_port_remove(struct usb_serial_port *port)
 {
-       kfree(usb_get_serial_port_data(serial->port[0]));
+       struct keyspan_pda_private *priv;
+
+       priv = usb_get_serial_port_data(port);
+       kfree(priv);
+
+       return 0;
 }
 
 #ifdef KEYSPAN
@@ -786,8 +790,8 @@ static struct usb_serial_driver keyspan_pda_device = {
        .break_ctl =            keyspan_pda_break_ctl,
        .tiocmget =             keyspan_pda_tiocmget,
        .tiocmset =             keyspan_pda_tiocmset,
-       .attach =               keyspan_pda_startup,
-       .release =              keyspan_pda_release,
+       .port_probe =           keyspan_pda_port_probe,
+       .port_remove =          keyspan_pda_port_remove,
 };
 
 static struct usb_serial_driver * const serial_drivers[] = {
index 3f6d7376c02d48e5a145449d79fe5ed4a3f01b3d..1f4517864cd25cd6bdf665bce9d154f0c708f99d 100644 (file)
@@ -60,8 +60,8 @@
 /*
  * Function prototypes
  */
-static int  klsi_105_startup(struct usb_serial *serial);
-static void klsi_105_release(struct usb_serial *serial);
+static int klsi_105_port_probe(struct usb_serial_port *port);
+static int klsi_105_port_remove(struct usb_serial_port *port);
 static int  klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port);
 static void klsi_105_close(struct usb_serial_port *port);
 static void klsi_105_set_termios(struct tty_struct *tty,
@@ -99,8 +99,8 @@ static struct usb_serial_driver kl5kusb105d_device = {
        /*.break_ctl =          klsi_105_break_ctl,*/
        .tiocmget =             klsi_105_tiocmget,
        .tiocmset =             klsi_105_tiocmset,
-       .attach =               klsi_105_startup,
-       .release =              klsi_105_release,
+       .port_probe =           klsi_105_port_probe,
+       .port_remove =          klsi_105_port_remove,
        .throttle =             usb_serial_generic_throttle,
        .unthrottle =           usb_serial_generic_unthrottle,
        .process_read_urb =     klsi_105_process_read_urb,
@@ -223,60 +223,40 @@ static int klsi_105_get_line_state(struct usb_serial_port *port,
  * Driver's tty interface functions
  */
 
-static int klsi_105_startup(struct usb_serial *serial)
+static int klsi_105_port_probe(struct usb_serial_port *port)
 {
        struct klsi_105_private *priv;
-       int i;
 
-       /* check if we support the product id (see keyspan.c)
-        * FIXME
-        */
+       priv = kmalloc(sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
 
-       /* allocate the private data structure */
-       for (i = 0; i < serial->num_ports; i++) {
-               priv = kmalloc(sizeof(struct klsi_105_private),
-                                                  GFP_KERNEL);
-               if (!priv) {
-                       dev_dbg(&serial->interface->dev,
-                               "%s - kmalloc for klsi_105_private failed.\n",
-                               __func__);
-                       i--;
-                       goto err_cleanup;
-               }
-               /* set initial values for control structures */
-               priv->cfg.pktlen    = 5;
-               priv->cfg.baudrate  = kl5kusb105a_sio_b9600;
-               priv->cfg.databits  = kl5kusb105a_dtb_8;
-               priv->cfg.unknown1  = 0;
-               priv->cfg.unknown2  = 1;
+       /* set initial values for control structures */
+       priv->cfg.pktlen    = 5;
+       priv->cfg.baudrate  = kl5kusb105a_sio_b9600;
+       priv->cfg.databits  = kl5kusb105a_dtb_8;
+       priv->cfg.unknown1  = 0;
+       priv->cfg.unknown2  = 1;
 
-               priv->line_state    = 0;
+       priv->line_state    = 0;
 
-               usb_set_serial_port_data(serial->port[i], priv);
+       spin_lock_init(&priv->lock);
 
-               spin_lock_init(&priv->lock);
+       /* priv->termios is left uninitialized until port opening */
 
-               /* priv->termios is left uninitialized until port opening */
-               init_waitqueue_head(&serial->port[i]->write_wait);
-       }
+       usb_set_serial_port_data(port, priv);
 
        return 0;
-
-err_cleanup:
-       for (; i >= 0; i--) {
-               priv = usb_get_serial_port_data(serial->port[i]);
-               kfree(priv);
-               usb_set_serial_port_data(serial->port[i], NULL);
-       }
-       return -ENOMEM;
 }
 
-static void klsi_105_release(struct usb_serial *serial)
+static int klsi_105_port_remove(struct usb_serial_port *port)
 {
-       int i;
+       struct klsi_105_private *priv;
+
+       priv = usb_get_serial_port_data(port);
+       kfree(priv);
 
-       for (i = 0; i < serial->num_ports; ++i)
-               kfree(usb_get_serial_port_data(serial->port[i]));
+       return 0;
 }
 
 static int  klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port)
index 5c4d2fbd4e11892e7c40479b322c3f56e74e7294..c9ca7a5b12e09c883f08562ca93a8fbede32e82b 100644 (file)
@@ -54,8 +54,8 @@
 
 
 /* Function prototypes */
-static int  kobil_startup(struct usb_serial *serial);
-static void kobil_release(struct usb_serial *serial);
+static int kobil_port_probe(struct usb_serial_port *probe);
+static int kobil_port_remove(struct usb_serial_port *probe);
 static int  kobil_open(struct tty_struct *tty, struct usb_serial_port *port);
 static void kobil_close(struct usb_serial_port *port);
 static int  kobil_write(struct tty_struct *tty, struct usb_serial_port *port,
@@ -89,8 +89,8 @@ static struct usb_serial_driver kobil_device = {
        .description =          "KOBIL USB smart card terminal",
        .id_table =             id_table,
        .num_ports =            1,
-       .attach =               kobil_startup,
-       .release =              kobil_release,
+       .port_probe =           kobil_port_probe,
+       .port_remove =          kobil_port_remove,
        .ioctl =                kobil_ioctl,
        .set_termios =          kobil_set_termios,
        .init_termios =         kobil_init_termios,
@@ -117,9 +117,10 @@ struct kobil_private {
 };
 
 
-static int kobil_startup(struct usb_serial *serial)
+static int kobil_port_probe(struct usb_serial_port *port)
 {
        int i;
+       struct usb_serial *serial = port->serial;
        struct kobil_private *priv;
        struct usb_device *pdev;
        struct usb_host_config *actconfig;
@@ -149,7 +150,7 @@ static int kobil_startup(struct usb_serial *serial)
                dev_dbg(&serial->dev->dev, "KOBIL KAAN SIM detected\n");
                break;
        }
-       usb_set_serial_port_data(serial->port[0], priv);
+       usb_set_serial_port_data(port, priv);
 
        /* search for the necessary endpoints */
        pdev = serial->dev;
@@ -179,12 +180,14 @@ static int kobil_startup(struct usb_serial *serial)
 }
 
 
-static void kobil_release(struct usb_serial *serial)
+static int kobil_port_remove(struct usb_serial_port *port)
 {
-       int i;
+       struct kobil_private *priv;
 
-       for (i = 0; i < serial->num_ports; ++i)
-               kfree(usb_get_serial_port_data(serial->port[i]));
+       priv = usb_get_serial_port_data(port);
+       kfree(priv);
+
+       return 0;
 }
 
 static void kobil_init_termios(struct tty_struct *tty)
index 30cff03e9f012ffee6ecc2548477f8b1020c66f6..54d4148d01d120a6d5c2085eb3d884328405a109 100644 (file)
@@ -503,11 +503,19 @@ static const struct option_blacklist_info net_intf5_blacklist = {
        .reserved = BIT(5),
 };
 
+static const struct option_blacklist_info net_intf6_blacklist = {
+       .reserved = BIT(6),
+};
+
 static const struct option_blacklist_info zte_mf626_blacklist = {
        .sendsetup = BIT(0) | BIT(1),
        .reserved = BIT(4),
 };
 
+static const struct option_blacklist_info zte_1255_blacklist = {
+       .reserved = BIT(3) | BIT(4),
+};
+
 static const struct usb_device_id option_ids[] = {
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -853,13 +861,19 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0113, 0xff, 0xff, 0xff),
                .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0117, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0118, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0121, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0118, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0121, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0122, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0123, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0124, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0125, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0126, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0123, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0124, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0125, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf6_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0126, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0128, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0142, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0143, 0xff, 0xff, 0xff) },
@@ -872,7 +886,8 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0156, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0157, 0xff, 0xff, 0xff),
          .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0158, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0158, 0xff, 0xff, 0xff),
+         .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0159, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0161, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0162, 0xff, 0xff, 0xff) },
@@ -880,13 +895,22 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0167, 0xff, 0xff, 0xff),
          .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0191, 0xff, 0xff, 0xff), /* ZTE EuFi890 */
+         .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0199, 0xff, 0xff, 0xff), /* ZTE MF820S */
+         .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */
+         .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0326, 0xff, 0xff, 0xff),
          .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff),
          .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff),
          .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff),
+         .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1021, 0xff, 0xff, 0xff),
+         .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1057, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1058, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1059, 0xff, 0xff, 0xff) },
@@ -1002,18 +1026,24 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1169, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1170, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1244, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1245, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1245, 0xff, 0xff, 0xff),
+         .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1246, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1247, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1247, 0xff, 0xff, 0xff),
+         .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1248, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1249, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1250, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1251, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1252, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1252, 0xff, 0xff, 0xff),
+         .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1253, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1254, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1255, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1256, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1254, 0xff, 0xff, 0xff),
+         .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1255, 0xff, 0xff, 0xff),
+         .driver_info = (kernel_ulong_t)&zte_1255_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1256, 0xff, 0xff, 0xff),
+         .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1257, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1258, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1259, 0xff, 0xff, 0xff) },
@@ -1058,8 +1088,16 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1401, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff),
                .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1424, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1425, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff),  /* ZTE MF91 */
+               .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff,
          0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
@@ -1071,15 +1109,21 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0094, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0133, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0133, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0147, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0170, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
 
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
index 933241f03fd8382f9e1dcd6f9fee38c8d1b89298..cee9a52ca891cd0857b324fba5f99933b03771f0 100644 (file)
@@ -137,8 +137,8 @@ static int oti6858_chars_in_buffer(struct tty_struct *tty);
 static int oti6858_tiocmget(struct tty_struct *tty);
 static int oti6858_tiocmset(struct tty_struct *tty,
                                unsigned int set, unsigned int clear);
-static int oti6858_startup(struct usb_serial *serial);
-static void oti6858_release(struct usb_serial *serial);
+static int oti6858_port_probe(struct usb_serial_port *port);
+static int oti6858_port_remove(struct usb_serial_port *port);
 
 /* device info */
 static struct usb_serial_driver oti6858_device = {
@@ -161,8 +161,8 @@ static struct usb_serial_driver oti6858_device = {
        .write_bulk_callback =  oti6858_write_bulk_callback,
        .write_room =           oti6858_write_room,
        .chars_in_buffer =      oti6858_chars_in_buffer,
-       .attach =               oti6858_startup,
-       .release =              oti6858_release,
+       .port_probe =           oti6858_port_probe,
+       .port_remove =          oti6858_port_remove,
 };
 
 static struct usb_serial_driver * const serial_drivers[] = {
@@ -331,36 +331,33 @@ static void send_data(struct work_struct *work)
        usb_serial_port_softint(port);
 }
 
-static int oti6858_startup(struct usb_serial *serial)
+static int oti6858_port_probe(struct usb_serial_port *port)
 {
-       struct usb_serial_port *port = serial->port[0];
        struct oti6858_private *priv;
-       int i;
-
-       for (i = 0; i < serial->num_ports; ++i) {
-               priv = kzalloc(sizeof(struct oti6858_private), GFP_KERNEL);
-               if (!priv)
-                       break;
-
-               spin_lock_init(&priv->lock);
-               init_waitqueue_head(&priv->intr_wait);
-/*             INIT_WORK(&priv->setup_work, setup_line, serial->port[i]); */
-/*             INIT_WORK(&priv->write_work, send_data, serial->port[i]); */
-               priv->port = port;
-               INIT_DELAYED_WORK(&priv->delayed_setup_work, setup_line);
-               INIT_DELAYED_WORK(&priv->delayed_write_work, send_data);
-
-               usb_set_serial_port_data(serial->port[i], priv);
-       }
-       if (i == serial->num_ports)
-               return 0;
 
-       for (--i; i >= 0; --i) {
-               priv = usb_get_serial_port_data(serial->port[i]);
-               kfree(priv);
-               usb_set_serial_port_data(serial->port[i], NULL);
-       }
-       return -ENOMEM;
+       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
+
+       spin_lock_init(&priv->lock);
+       init_waitqueue_head(&priv->intr_wait);
+       priv->port = port;
+       INIT_DELAYED_WORK(&priv->delayed_setup_work, setup_line);
+       INIT_DELAYED_WORK(&priv->delayed_write_work, send_data);
+
+       usb_set_serial_port_data(port, priv);
+
+       return 0;
+}
+
+static int oti6858_port_remove(struct usb_serial_port *port)
+{
+       struct oti6858_private *priv;
+
+       priv = usb_get_serial_port_data(port);
+       kfree(priv);
+
+       return 0;
 }
 
 static int oti6858_write(struct tty_struct *tty, struct usb_serial_port *port,
@@ -709,15 +706,6 @@ static int oti6858_ioctl(struct tty_struct *tty,
        return -ENOIOCTLCMD;
 }
 
-
-static void oti6858_release(struct usb_serial *serial)
-{
-       int i;
-
-       for (i = 0; i < serial->num_ports; ++i)
-               kfree(usb_get_serial_port_data(serial->port[i]));
-}
-
 static void oti6858_read_int_callback(struct urb *urb)
 {
        struct usb_serial_port *port =  urb->context;
index 892ebdc7a364b29572a908453c37443374965513..600241901361e62458d0d002e22261e1e5c0bc5f 100644 (file)
@@ -133,12 +133,15 @@ enum pl2303_type {
        HX,             /* HX version of the pl2303 chip */
 };
 
+struct pl2303_serial_private {
+       enum pl2303_type type;
+};
+
 struct pl2303_private {
        spinlock_t lock;
        wait_queue_head_t delta_msr_wait;
        u8 line_control;
        u8 line_status;
-       enum pl2303_type type;
 };
 
 static int pl2303_vendor_read(__u16 value, __u16 index,
@@ -167,14 +170,19 @@ static int pl2303_vendor_write(__u16 value, __u16 index,
 
 static int pl2303_startup(struct usb_serial *serial)
 {
-       struct pl2303_private *priv;
+       struct pl2303_serial_private *spriv;
        enum pl2303_type type = type_0;
        unsigned char *buf;
-       int i;
+
+       spriv = kzalloc(sizeof(*spriv), GFP_KERNEL);
+       if (!spriv)
+               return -ENOMEM;
 
        buf = kmalloc(10, GFP_KERNEL);
-       if (buf == NULL)
+       if (!buf) {
+               kfree(spriv);
                return -ENOMEM;
+       }
 
        if (serial->dev->descriptor.bDeviceClass == 0x02)
                type = type_0;
@@ -186,15 +194,8 @@ static int pl2303_startup(struct usb_serial *serial)
                type = type_1;
        dev_dbg(&serial->interface->dev, "device type: %d\n", type);
 
-       for (i = 0; i < serial->num_ports; ++i) {
-               priv = kzalloc(sizeof(struct pl2303_private), GFP_KERNEL);
-               if (!priv)
-                       goto cleanup;
-               spin_lock_init(&priv->lock);
-               init_waitqueue_head(&priv->delta_msr_wait);
-               priv->type = type;
-               usb_set_serial_port_data(serial->port[i], priv);
-       }
+       spriv->type = type;
+       usb_set_serial_data(serial, spriv);
 
        pl2303_vendor_read(0x8484, 0, serial, buf);
        pl2303_vendor_write(0x0404, 0, serial);
@@ -213,15 +214,40 @@ static int pl2303_startup(struct usb_serial *serial)
 
        kfree(buf);
        return 0;
+}
 
-cleanup:
-       kfree(buf);
-       for (--i; i >= 0; --i) {
-               priv = usb_get_serial_port_data(serial->port[i]);
-               kfree(priv);
-               usb_set_serial_port_data(serial->port[i], NULL);
-       }
-       return -ENOMEM;
+static void pl2303_release(struct usb_serial *serial)
+{
+       struct pl2303_serial_private *spriv;
+
+       spriv = usb_get_serial_data(serial);
+       kfree(spriv);
+}
+
+static int pl2303_port_probe(struct usb_serial_port *port)
+{
+       struct pl2303_private *priv;
+
+       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
+
+       spin_lock_init(&priv->lock);
+       init_waitqueue_head(&priv->delta_msr_wait);
+
+       usb_set_serial_port_data(port, priv);
+
+       return 0;
+}
+
+static int pl2303_port_remove(struct usb_serial_port *port)
+{
+       struct pl2303_private *priv;
+
+       priv = usb_get_serial_port_data(port);
+       kfree(priv);
+
+       return 0;
 }
 
 static int set_control_lines(struct usb_device *dev, u8 value)
@@ -240,6 +266,7 @@ static void pl2303_set_termios(struct tty_struct *tty,
                struct usb_serial_port *port, struct ktermios *old_termios)
 {
        struct usb_serial *serial = port->serial;
+       struct pl2303_serial_private *spriv = usb_get_serial_data(serial);
        struct pl2303_private *priv = usb_get_serial_port_data(port);
        unsigned long flags;
        unsigned int cflag;
@@ -323,7 +350,7 @@ static void pl2303_set_termios(struct tty_struct *tty,
                }
                if (baud > 1228800) {
                        /* type_0, type_1 only support up to 1228800 baud */
-                       if (priv->type != HX)
+                       if (spriv->type != HX)
                                baud = 1228800;
                        else if (baud > 6000000)
                                baud = 6000000;
@@ -426,7 +453,7 @@ static void pl2303_set_termios(struct tty_struct *tty,
             buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
 
        if (cflag & CRTSCTS) {
-               if (priv->type == HX)
+               if (spriv->type == HX)
                        pl2303_vendor_write(0x0, 0x61, serial);
                else
                        pl2303_vendor_write(0x0, 0x41, serial);
@@ -468,10 +495,10 @@ static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port)
 {
        struct ktermios tmp_termios;
        struct usb_serial *serial = port->serial;
-       struct pl2303_private *priv = usb_get_serial_port_data(port);
+       struct pl2303_serial_private *spriv = usb_get_serial_data(serial);
        int result;
 
-       if (priv->type != HX) {
+       if (spriv->type != HX) {
                usb_clear_halt(serial->dev, port->write_urb->pipe);
                usb_clear_halt(serial->dev, port->read_urb->pipe);
        } else {
@@ -655,17 +682,6 @@ static void pl2303_break_ctl(struct tty_struct *tty, int break_state)
                dev_err(&port->dev, "error sending break = %d\n", result);
 }
 
-static void pl2303_release(struct usb_serial *serial)
-{
-       int i;
-       struct pl2303_private *priv;
-
-       for (i = 0; i < serial->num_ports; ++i) {
-               priv = usb_get_serial_port_data(serial->port[i]);
-               kfree(priv);
-       }
-}
-
 static void pl2303_update_line_status(struct usb_serial_port *port,
                                      unsigned char *data,
                                      unsigned int actual_length)
@@ -827,6 +843,8 @@ static struct usb_serial_driver pl2303_device = {
        .read_int_callback =    pl2303_read_int_callback,
        .attach =               pl2303_startup,
        .release =              pl2303_release,
+       .port_probe =           pl2303_port_probe,
+       .port_remove =          pl2303_port_remove,
 };
 
 static struct usb_serial_driver * const serial_drivers[] = {
index 9716efe92955bdd26d2aa7d5d5a3ea3ebdf9f540..769c137f8975689fd9a798e12fda23bf27036728 100644 (file)
@@ -157,13 +157,10 @@ struct spcp8x5_private {
        u8                      line_status;
 };
 
-/* desc : when device plug in,this function would be called.
- * thanks to usb_serial subsystem,then do almost every things for us. And what
- * we should do just alloc the buffer */
-static int spcp8x5_startup(struct usb_serial *serial)
+static int spcp8x5_port_probe(struct usb_serial_port *port)
 {
+       struct usb_serial *serial = port->serial;
        struct spcp8x5_private *priv;
-       int i;
        enum spcp8x5_type type = SPCP825_007_TYPE;
        u16 product = le16_to_cpu(serial->dev->descriptor.idProduct);
 
@@ -180,34 +177,27 @@ static int spcp8x5_startup(struct usb_serial *serial)
                type = SPCP825_PHILIP_TYPE;
        dev_dbg(&serial->dev->dev, "device type = %d\n", (int)type);
 
-       for (i = 0; i < serial->num_ports; ++i) {
-               priv = kzalloc(sizeof(struct spcp8x5_private), GFP_KERNEL);
-               if (!priv)
-                       goto cleanup;
+       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
 
-               spin_lock_init(&priv->lock);
-               init_waitqueue_head(&priv->delta_msr_wait);
-               priv->type = type;
-               usb_set_serial_port_data(serial->port[i] , priv);
-       }
+       spin_lock_init(&priv->lock);
+       init_waitqueue_head(&priv->delta_msr_wait);
+       priv->type = type;
+
+       usb_set_serial_port_data(port , priv);
 
        return 0;
-cleanup:
-       for (--i; i >= 0; --i) {
-               priv = usb_get_serial_port_data(serial->port[i]);
-               kfree(priv);
-               usb_set_serial_port_data(serial->port[i] , NULL);
-       }
-       return -ENOMEM;
 }
 
-/* call when the device plug out. free all the memory alloced by probe */
-static void spcp8x5_release(struct usb_serial *serial)
+static int spcp8x5_port_remove(struct usb_serial_port *port)
 {
-       int i;
+       struct spcp8x5_private *priv;
 
-       for (i = 0; i < serial->num_ports; i++)
-               kfree(usb_get_serial_port_data(serial->port[i]));
+       priv = usb_get_serial_port_data(port);
+       kfree(priv);
+
+       return 0;
 }
 
 /* set the modem control line of the device.
@@ -649,8 +639,8 @@ static struct usb_serial_driver spcp8x5_device = {
        .ioctl                  = spcp8x5_ioctl,
        .tiocmget               = spcp8x5_tiocmget,
        .tiocmset               = spcp8x5_tiocmset,
-       .attach                 = spcp8x5_startup,
-       .release                = spcp8x5_release,
+       .port_probe             = spcp8x5_port_probe,
+       .port_remove            = spcp8x5_port_remove,
        .process_read_urb       = spcp8x5_process_read_urb,
 };
 
index 015810b3785bb72938d60691b81433a918583750..868d1e6852e2ab6086a354cd62a352a241cb51c7 100644 (file)
@@ -67,13 +67,6 @@ struct ssu100_port_private {
        struct async_icount icount;
 };
 
-static void ssu100_release(struct usb_serial *serial)
-{
-       struct ssu100_port_private *priv = usb_get_serial_port_data(*serial->port);
-
-       kfree(priv);
-}
-
 static inline int ssu100_control_msg(struct usb_device *dev,
                                     u8 request, u16 data, u16 index)
 {
@@ -441,22 +434,34 @@ static int ssu100_ioctl(struct tty_struct *tty,
 }
 
 static int ssu100_attach(struct usb_serial *serial)
+{
+       return ssu100_initdevice(serial->dev);
+}
+
+static int ssu100_port_probe(struct usb_serial_port *port)
 {
        struct ssu100_port_private *priv;
-       struct usb_serial_port *port = *serial->port;
 
        priv = kzalloc(sizeof(*priv), GFP_KERNEL);
-       if (!priv) {
-               dev_err(&port->dev, "%s- kmalloc(%Zd) failed.\n", __func__,
-                       sizeof(*priv));
+       if (!priv)
                return -ENOMEM;
-       }
 
        spin_lock_init(&priv->status_lock);
        init_waitqueue_head(&priv->delta_msr_wait);
+
        usb_set_serial_port_data(port, priv);
 
-       return ssu100_initdevice(serial->dev);
+       return 0;
+}
+
+static int ssu100_port_remove(struct usb_serial_port *port)
+{
+       struct ssu100_port_private *priv;
+
+       priv = usb_get_serial_port_data(port);
+       kfree(priv);
+
+       return 0;
 }
 
 static int ssu100_tiocmget(struct tty_struct *tty)
@@ -647,7 +652,8 @@ static struct usb_serial_driver ssu100_device = {
        .open                = ssu100_open,
        .close               = ssu100_close,
        .attach              = ssu100_attach,
-       .release             = ssu100_release,
+       .port_probe          = ssu100_port_probe,
+       .port_remove         = ssu100_port_remove,
        .dtr_rts             = ssu100_dtr_rts,
        .process_read_urb    = ssu100_process_read_urb,
        .tiocmget            = ssu100_tiocmget,
index 6f49392cda5bdb889192a118c94a0573b48348a8..f2530d2ef3c42af788e75c1db2554a95642c6207 100644 (file)
@@ -97,6 +97,8 @@ struct ti_device {
 
 static int ti_startup(struct usb_serial *serial);
 static void ti_release(struct usb_serial *serial);
+static int ti_port_probe(struct usb_serial_port *port);
+static int ti_port_remove(struct usb_serial_port *port);
 static int ti_open(struct tty_struct *tty, struct usb_serial_port *port);
 static void ti_close(struct usb_serial_port *port);
 static int ti_write(struct tty_struct *tty, struct usb_serial_port *port,
@@ -221,6 +223,8 @@ static struct usb_serial_driver ti_1port_device = {
        .num_ports              = 1,
        .attach                 = ti_startup,
        .release                = ti_release,
+       .port_probe             = ti_port_probe,
+       .port_remove            = ti_port_remove,
        .open                   = ti_open,
        .close                  = ti_close,
        .write                  = ti_write,
@@ -249,6 +253,8 @@ static struct usb_serial_driver ti_2port_device = {
        .num_ports              = 2,
        .attach                 = ti_startup,
        .release                = ti_release,
+       .port_probe             = ti_port_probe,
+       .port_remove            = ti_port_remove,
        .open                   = ti_open,
        .close                  = ti_close,
        .write                  = ti_write,
@@ -347,11 +353,8 @@ module_exit(ti_exit);
 static int ti_startup(struct usb_serial *serial)
 {
        struct ti_device *tdev;
-       struct ti_port *tport;
        struct usb_device *dev = serial->dev;
        int status;
-       int i;
-
 
        dev_dbg(&dev->dev,
                "%s - product 0x%4X, num configurations %d, configuration value %d",
@@ -399,42 +402,8 @@ static int ti_startup(struct usb_serial *serial)
                goto free_tdev;
        }
 
-       /* set up port structures */
-       for (i = 0; i < serial->num_ports; ++i) {
-               tport = kzalloc(sizeof(struct ti_port), GFP_KERNEL);
-               if (tport == NULL) {
-                       dev_err(&dev->dev, "%s - out of memory\n", __func__);
-                       status = -ENOMEM;
-                       goto free_tports;
-               }
-               spin_lock_init(&tport->tp_lock);
-               tport->tp_uart_base_addr = (i == 0 ?
-                               TI_UART1_BASE_ADDR : TI_UART2_BASE_ADDR);
-               tport->tp_closing_wait = closing_wait;
-               init_waitqueue_head(&tport->tp_msr_wait);
-               init_waitqueue_head(&tport->tp_write_wait);
-               if (kfifo_alloc(&tport->write_fifo, TI_WRITE_BUF_SIZE,
-                                                               GFP_KERNEL)) {
-                       dev_err(&dev->dev, "%s - out of memory\n", __func__);
-                       kfree(tport);
-                       status = -ENOMEM;
-                       goto free_tports;
-               }
-               tport->tp_port = serial->port[i];
-               tport->tp_tdev = tdev;
-               usb_set_serial_port_data(serial->port[i], tport);
-               tport->tp_uart_mode = 0;        /* default is RS232 */
-       }
-
        return 0;
 
-free_tports:
-       for (--i; i >= 0; --i) {
-               tport = usb_get_serial_port_data(serial->port[i]);
-               kfifo_free(&tport->write_fifo);
-               kfree(tport);
-               usb_set_serial_port_data(serial->port[i], NULL);
-       }
 free_tdev:
        kfree(tdev);
        usb_set_serial_data(serial, NULL);
@@ -444,21 +413,50 @@ free_tdev:
 
 static void ti_release(struct usb_serial *serial)
 {
-       int i;
        struct ti_device *tdev = usb_get_serial_data(serial);
+
+       kfree(tdev);
+}
+
+static int ti_port_probe(struct usb_serial_port *port)
+{
        struct ti_port *tport;
 
-       for (i = 0; i < serial->num_ports; ++i) {
-               tport = usb_get_serial_port_data(serial->port[i]);
-               if (tport) {
-                       kfifo_free(&tport->write_fifo);
-                       kfree(tport);
-               }
+       tport = kzalloc(sizeof(*tport), GFP_KERNEL);
+       if (!tport)
+               return -ENOMEM;
+
+       spin_lock_init(&tport->tp_lock);
+       if (port == port->serial->port[0])
+               tport->tp_uart_base_addr = TI_UART1_BASE_ADDR;
+       else
+               tport->tp_uart_base_addr = TI_UART2_BASE_ADDR;
+       tport->tp_closing_wait = closing_wait;
+       init_waitqueue_head(&tport->tp_msr_wait);
+       init_waitqueue_head(&tport->tp_write_wait);
+       if (kfifo_alloc(&tport->write_fifo, TI_WRITE_BUF_SIZE, GFP_KERNEL)) {
+               kfree(tport);
+               return -ENOMEM;
        }
+       tport->tp_port = port;
+       tport->tp_tdev = usb_get_serial_data(port->serial);
+       tport->tp_uart_mode = 0;        /* default is RS232 */
 
-       kfree(tdev);
+       usb_set_serial_port_data(port, tport);
+
+       return 0;
 }
 
+static int ti_port_remove(struct usb_serial_port *port)
+{
+       struct ti_port *tport;
+
+       tport = usb_get_serial_port_data(port);
+       kfifo_free(&tport->write_fifo);
+       kfree(tport);
+
+       return 0;
+}
 
 static int ti_open(struct tty_struct *tty, struct usb_serial_port *port)
 {
index c6915c6c3cd1e5fc3941a8a3e6fe242fa9db0310..585949b570550fd5e681b23a2564f8f65eb8f83a 100644 (file)
@@ -206,11 +206,11 @@ static ssize_t lm3639_bled_mode_store(struct device *dev,
 
 out:
        dev_err(pchip->dev, "%s:i2c access fail to register\n", __func__);
-       return size;
+       return ret;
 
 out_input:
        dev_err(pchip->dev, "%s:input conversion fail\n", __func__);
-       return size;
+       return ret;
 
 }
 
index b38b1dd15ce35f059c446a36313424d2ab11274c..2ee423279e358f59d8799ef2d47309a0e074dd4d 100644 (file)
@@ -23,7 +23,8 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 
-#include <plat/fpga.h>
+#include <mach/hardware.h>
+
 #include "omapfb.h"
 
 static int innovator1510_panel_init(struct lcd_panel *panel,
@@ -38,13 +39,13 @@ static void innovator1510_panel_cleanup(struct lcd_panel *panel)
 
 static int innovator1510_panel_enable(struct lcd_panel *panel)
 {
-       fpga_write(0x7, OMAP1510_FPGA_LCD_PANEL_CONTROL);
+       __raw_writeb(0x7, OMAP1510_FPGA_LCD_PANEL_CONTROL);
        return 0;
 }
 
 static void innovator1510_panel_disable(struct lcd_panel *panel)
 {
-       fpga_write(0x0, OMAP1510_FPGA_LCD_PANEL_CONTROL);
+       __raw_writeb(0x0, OMAP1510_FPGA_LCD_PANEL_CONTROL);
 }
 
 static unsigned long innovator1510_panel_get_caps(struct lcd_panel *panel)
index 7767338f8b14028fe4ff409eed4717e99296f0ba..c39d6e46f8c52796d113076ee9b3532890b7a814 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/gfp.h>
 
 #include <mach/lcdc.h>
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 
 #include <asm/mach-types.h>
 
index 4351c438b76f5f52cd0ea7f03c28c1b9cb48492d..1b5ee8ec192ac35a0d7843402a554d3a0643fc0f 100644 (file)
@@ -30,7 +30,7 @@
 #include <linux/uaccess.h>
 #include <linux/module.h>
 
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 
 #include "omapfb.h"
 #include "lcdc.h"
index f79c137753d708f0130031fd32b99e5a6e0469e0..c510a445739818827cd5d8a51b143956e6f45eb4 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/io.h>
 #include <linux/interrupt.h>
 
-#include <plat/dma.h>
+#include <plat-omap/dma-omap.h>
 
 #include "omapfb.h"
 #include "lcdc.h"
index b2af72dc20bdb2cf0cc5f880008916fb85d09826..d94ef9e31a354b877f2eb3dcee6cb4be1bda2462 100644 (file)
@@ -237,7 +237,7 @@ static int __init omap_dss_probe(struct platform_device *pdev)
 
        core.pdev = pdev;
 
-       dss_features_init();
+       dss_features_init(pdata->version);
 
        dss_apply_init();
 
index b43477a5fae869e5e8981faaea48f51c15827e49..a5ab354f267ae1a458ae1ba0fd5d6c8104f74b4f 100644 (file)
@@ -37,8 +37,6 @@
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
-#include <plat/cpu.h>
-
 #include <video/omapdss.h>
 
 #include "dss.h"
@@ -4042,29 +4040,44 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
        .gfx_fifo_workaround    =       true,
 };
 
-static int __init dispc_init_features(struct device *dev)
+static int __init dispc_init_features(struct platform_device *pdev)
 {
+       struct omap_dss_board_info *pdata = pdev->dev.platform_data;
        const struct dispc_features *src;
        struct dispc_features *dst;
 
-       dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL);
+       dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL);
        if (!dst) {
-               dev_err(dev, "Failed to allocate DISPC Features\n");
+               dev_err(&pdev->dev, "Failed to allocate DISPC Features\n");
                return -ENOMEM;
        }
 
-       if (cpu_is_omap24xx()) {
+       switch (pdata->version) {
+       case OMAPDSS_VER_OMAP24xx:
                src = &omap24xx_dispc_feats;
-       } else if (cpu_is_omap34xx()) {
-               if (omap_rev() < OMAP3430_REV_ES3_0)
-                       src = &omap34xx_rev1_0_dispc_feats;
-               else
-                       src = &omap34xx_rev3_0_dispc_feats;
-       } else if (cpu_is_omap44xx()) {
+               break;
+
+       case OMAPDSS_VER_OMAP34xx_ES1:
+               src = &omap34xx_rev1_0_dispc_feats;
+               break;
+
+       case OMAPDSS_VER_OMAP34xx_ES3:
+       case OMAPDSS_VER_OMAP3630:
+       case OMAPDSS_VER_AM35xx:
+               src = &omap34xx_rev3_0_dispc_feats;
+               break;
+
+       case OMAPDSS_VER_OMAP4430_ES1:
+       case OMAPDSS_VER_OMAP4430_ES2:
+       case OMAPDSS_VER_OMAP4:
                src = &omap44xx_dispc_feats;
-       } else if (soc_is_omap54xx()) {
+               break;
+
+       case OMAPDSS_VER_OMAP5:
                src = &omap44xx_dispc_feats;
-       } else {
+               break;
+
+       default:
                return -ENODEV;
        }
 
@@ -4084,7 +4097,7 @@ static int __init omap_dispchw_probe(struct platform_device *pdev)
 
        dispc.pdev = pdev;
 
-       r = dispc_init_features(&dispc.pdev->dev);
+       r = dispc_init_features(dispc.pdev);
        if (r)
                return r;
 
index 2ab1c3e96553d81297ad5f942eed2cfb76a5064b..363852a0f76491271a68505fbe4bdbde7673e951 100644 (file)
@@ -35,8 +35,6 @@
 
 #include <video/omapdss.h>
 
-#include <plat/cpu.h>
-
 #include "dss.h"
 #include "dss_features.h"
 
@@ -792,29 +790,46 @@ static const struct dss_features omap54xx_dss_feats __initconst = {
        .dpi_select_source      =       &dss_dpi_select_source_omap5,
 };
 
-static int __init dss_init_features(struct device *dev)
+static int __init dss_init_features(struct platform_device *pdev)
 {
+       struct omap_dss_board_info *pdata = pdev->dev.platform_data;
        const struct dss_features *src;
        struct dss_features *dst;
 
-       dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL);
+       dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL);
        if (!dst) {
-               dev_err(dev, "Failed to allocate local DSS Features\n");
+               dev_err(&pdev->dev, "Failed to allocate local DSS Features\n");
                return -ENOMEM;
        }
 
-       if (cpu_is_omap24xx())
+       switch (pdata->version) {
+       case OMAPDSS_VER_OMAP24xx:
                src = &omap24xx_dss_feats;
-       else if (cpu_is_omap34xx())
+               break;
+
+       case OMAPDSS_VER_OMAP34xx_ES1:
+       case OMAPDSS_VER_OMAP34xx_ES3:
+       case OMAPDSS_VER_AM35xx:
                src = &omap34xx_dss_feats;
-       else if (cpu_is_omap3630())
+               break;
+
+       case OMAPDSS_VER_OMAP3630:
                src = &omap3630_dss_feats;
-       else if (cpu_is_omap44xx())
+               break;
+
+       case OMAPDSS_VER_OMAP4430_ES1:
+       case OMAPDSS_VER_OMAP4430_ES2:
+       case OMAPDSS_VER_OMAP4:
                src = &omap44xx_dss_feats;
-       else if (soc_is_omap54xx())
+               break;
+
+       case OMAPDSS_VER_OMAP5:
                src = &omap54xx_dss_feats;
-       else
+               break;
+
+       default:
                return -ENODEV;
+       }
 
        memcpy(dst, src, sizeof(*dst));
        dss.feat = dst;
@@ -831,7 +846,7 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
 
        dss.pdev = pdev;
 
-       r = dss_init_features(&dss.pdev->dev);
+       r = dss_init_features(dss.pdev);
        if (r)
                return r;
 
index acbc1e1efba3650aaccba2d86b000816973d23ba..3e8287c8709dcfe2175ac4f36bc143b8df30eeaa 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/slab.h>
 
 #include <video/omapdss.h>
-#include <plat/cpu.h>
 
 #include "dss.h"
 #include "dss_features.h"
@@ -825,10 +824,20 @@ static const struct ti_hdmi_ip_ops omap4_hdmi_functions = {
 
 };
 
-void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data)
+void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data,
+               enum omapdss_version version)
 {
-       if (cpu_is_omap44xx())
+       switch (version) {
+       case OMAPDSS_VER_OMAP4430_ES1:
+       case OMAPDSS_VER_OMAP4430_ES2:
+       case OMAPDSS_VER_OMAP4:
                ip_data->ops = &omap4_hdmi_functions;
+               break;
+       default:
+               ip_data->ops = NULL;
+       }
+
+       WARN_ON(ip_data->ops == NULL);
 }
 #endif
 
@@ -929,29 +938,44 @@ bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type)
        return omap_current_dss_features->supported_rotation_types & rot_type;
 }
 
-void dss_features_init(void)
+void dss_features_init(enum omapdss_version version)
 {
-       if (cpu_is_omap24xx())
+       switch (version) {
+       case OMAPDSS_VER_OMAP24xx:
                omap_current_dss_features = &omap2_dss_features;
-       else if (cpu_is_omap3630())
+               break;
+
+       case OMAPDSS_VER_OMAP34xx_ES1:
+       case OMAPDSS_VER_OMAP34xx_ES3:
+               omap_current_dss_features = &omap3430_dss_features;
+               break;
+
+       case OMAPDSS_VER_OMAP3630:
                omap_current_dss_features = &omap3630_dss_features;
-       else if (cpu_is_omap34xx()) {
-               if (soc_is_am35xx()) {
-                       omap_current_dss_features = &am35xx_dss_features;
-               } else {
-                       omap_current_dss_features = &omap3430_dss_features;
-               }
-       }
-       else if (omap_rev() == OMAP4430_REV_ES1_0)
+               break;
+
+       case OMAPDSS_VER_OMAP4430_ES1:
                omap_current_dss_features = &omap4430_es1_0_dss_features;
-       else if (omap_rev() == OMAP4430_REV_ES2_0 ||
-               omap_rev() == OMAP4430_REV_ES2_1 ||
-               omap_rev() == OMAP4430_REV_ES2_2)
+               break;
+
+       case OMAPDSS_VER_OMAP4430_ES2:
                omap_current_dss_features = &omap4430_es2_0_1_2_dss_features;
-       else if (cpu_is_omap44xx())
+               break;
+
+       case OMAPDSS_VER_OMAP4:
                omap_current_dss_features = &omap4_dss_features;
-       else if (soc_is_omap54xx())
+               break;
+
+       case OMAPDSS_VER_OMAP5:
                omap_current_dss_features = &omap5_dss_features;
-       else
+               break;
+
+       case OMAPDSS_VER_AM35xx:
+               omap_current_dss_features = &am35xx_dss_features;
+               break;
+
+       default:
                DSSWARN("Unsupported OMAP version");
+               break;
+       }
 }
index 9218113b5e88c2c5488acb2f989e06ff080cfe06..fc492ef72a51b35f523b09a7c8622cbd3103851c 100644 (file)
@@ -123,8 +123,9 @@ bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type);
 
 bool dss_has_feature(enum dss_feat_id id);
 void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end);
-void dss_features_init(void);
+void dss_features_init(enum omapdss_version version);
 #if defined(CONFIG_OMAP4_DSS_HDMI)
-void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data);
+void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data,
+               enum omapdss_version version);
 #endif
 #endif
index a48a7dd75b3303a3bba28e10b01e4c1f133c00d3..adcc906d12f860fee01fce8089d2cce253960a73 100644 (file)
@@ -323,6 +323,7 @@ static void hdmi_runtime_put(void)
 
 static int __init hdmi_init_display(struct omap_dss_device *dssdev)
 {
+       struct omap_dss_board_info *pdata = hdmi.pdev->dev.platform_data;
        int r;
 
        struct gpio gpios[] = {
@@ -333,7 +334,7 @@ static int __init hdmi_init_display(struct omap_dss_device *dssdev)
 
        DSSDBG("init_display\n");
 
-       dss_init_hdmi_ip_ops(&hdmi.ip_data);
+       dss_init_hdmi_ip_ops(&hdmi.ip_data, pdata->version);
 
        if (hdmi.vdda_hdmi_dac_reg == NULL) {
                struct regulator *reg;
index 606b89f12351d4e1cc2cb234fd4e5c481bf82cda..55a39be694a5f907e2e75d1a02c268313a342083 100644 (file)
@@ -30,7 +30,7 @@
 #include <linux/export.h>
 
 #include <video/omapdss.h>
-#include <plat/vrfb.h>
+#include <video/omapvrfb.h>
 #include <plat/vram.h>
 
 #include "omapfb.h"
index 16db1589bd9180a01920078f156b3650971b2311..bc225e46fdd2da8125bf48d1dfd7cf2cbda9625e 100644 (file)
@@ -31,9 +31,8 @@
 #include <linux/omapfb.h>
 
 #include <video/omapdss.h>
-#include <plat/cpu.h>
 #include <plat/vram.h>
-#include <plat/vrfb.h>
+#include <video/omapvrfb.h>
 
 #include "omapfb.h"
 
@@ -2396,10 +2395,7 @@ static int __init omapfb_probe(struct platform_device *pdev)
                goto err0;
        }
 
-       /* TODO : Replace cpu check with omap_has_vrfb once HAS_FEATURE
-       *        available for OMAP2 and OMAP3
-       */
-       if (def_vrfb && !cpu_is_omap24xx() && !cpu_is_omap34xx()) {
+       if (def_vrfb && !omap_vrfb_supported()) {
                def_vrfb = 0;
                dev_warn(&pdev->dev, "VRFB is not supported on this hardware, "
                                "ignoring the module parameter vrfb=y\n");
index e8d8cc76a4351ce58e306d5a67b4b947cec2e9c1..17aa174e187c94cb617065ebeeccb2b45985ba94 100644 (file)
@@ -30,7 +30,7 @@
 #include <linux/omapfb.h>
 
 #include <video/omapdss.h>
-#include <plat/vrfb.h>
+#include <video/omapvrfb.h>
 
 #include "omapfb.h"
 
index 7e990220ad2a6f52a25ff861f754d86e447a8358..5d8fdac3b8003982242d1f5f865492752ccac4bf 100644 (file)
@@ -26,9 +26,9 @@
 #include <linux/io.h>
 #include <linux/bitops.h>
 #include <linux/mutex.h>
+#include <linux/platform_device.h>
 
-#include <plat/vrfb.h>
-#include <plat/sdrc.h>
+#include <video/omapvrfb.h>
 
 #ifdef DEBUG
 #define DBG(format, ...) pr_debug("VRFB: " format, ## __VA_ARGS__)
 #define DBG(format, ...)
 #endif
 
-#define SMS_ROT_VIRT_BASE(context, rot) \
-       (((context >= 4) ? 0xD0000000 : 0x70000000) \
-        + (0x4000000 * (context)) \
-        + (0x1000000 * (rot)))
+#define SMS_ROT_CONTROL(context)       (0x0 + 0x10 * context)
+#define SMS_ROT_SIZE(context)          (0x4 + 0x10 * context)
+#define SMS_ROT_PHYSICAL_BA(context)   (0x8 + 0x10 * context)
+#define SMS_ROT_VIRT_BASE(rot)         (0x1000000 * (rot))
 
 #define OMAP_VRFB_SIZE                 (2048 * 2048 * 4)
 
 #define SMS_PW_OFFSET          4
 #define SMS_PS_OFFSET          0
 
-#define VRFB_NUM_CTXS 12
 /* bitmap of reserved contexts */
 static unsigned long ctx_map;
 
+struct vrfb_ctx {
+       u32 base;
+       u32 physical_ba;
+       u32 control;
+       u32 size;
+};
+
 static DEFINE_MUTEX(ctx_lock);
 
 /*
@@ -65,17 +71,34 @@ static DEFINE_MUTEX(ctx_lock);
  * we don't need locking, since no drivers will run until after the wake-up
  * has finished.
  */
-static struct {
-       u32 physical_ba;
-       u32 control;
-       u32 size;
-} vrfb_hw_context[VRFB_NUM_CTXS];
+
+static void __iomem *vrfb_base;
+
+static int num_ctxs;
+static struct vrfb_ctx *ctxs;
+
+static bool vrfb_loaded;
+
+static void omap2_sms_write_rot_control(u32 val, unsigned ctx)
+{
+       __raw_writel(val, vrfb_base + SMS_ROT_CONTROL(ctx));
+}
+
+static void omap2_sms_write_rot_size(u32 val, unsigned ctx)
+{
+       __raw_writel(val, vrfb_base + SMS_ROT_SIZE(ctx));
+}
+
+static void omap2_sms_write_rot_physical_ba(u32 val, unsigned ctx)
+{
+       __raw_writel(val, vrfb_base + SMS_ROT_PHYSICAL_BA(ctx));
+}
 
 static inline void restore_hw_context(int ctx)
 {
-       omap2_sms_write_rot_control(vrfb_hw_context[ctx].control, ctx);
-       omap2_sms_write_rot_size(vrfb_hw_context[ctx].size, ctx);
-       omap2_sms_write_rot_physical_ba(vrfb_hw_context[ctx].physical_ba, ctx);
+       omap2_sms_write_rot_control(ctxs[ctx].control, ctx);
+       omap2_sms_write_rot_size(ctxs[ctx].size, ctx);
+       omap2_sms_write_rot_physical_ba(ctxs[ctx].physical_ba, ctx);
 }
 
 static u32 get_image_width_roundup(u16 width, u8 bytespp)
@@ -196,9 +219,9 @@ void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
        control |= VRFB_PAGE_WIDTH_EXP  << SMS_PW_OFFSET;
        control |= VRFB_PAGE_HEIGHT_EXP << SMS_PH_OFFSET;
 
-       vrfb_hw_context[ctx].physical_ba = paddr;
-       vrfb_hw_context[ctx].size = size;
-       vrfb_hw_context[ctx].control = control;
+       ctxs[ctx].physical_ba = paddr;
+       ctxs[ctx].size = size;
+       ctxs[ctx].control = control;
 
        omap2_sms_write_rot_physical_ba(paddr, ctx);
        omap2_sms_write_rot_size(size, ctx);
@@ -274,11 +297,11 @@ int omap_vrfb_request_ctx(struct vrfb *vrfb)
 
        mutex_lock(&ctx_lock);
 
-       for (ctx = 0; ctx < VRFB_NUM_CTXS; ++ctx)
+       for (ctx = 0; ctx < num_ctxs; ++ctx)
                if ((ctx_map & (1 << ctx)) == 0)
                        break;
 
-       if (ctx == VRFB_NUM_CTXS) {
+       if (ctx == num_ctxs) {
                pr_err("vrfb: no free contexts\n");
                r = -EBUSY;
                goto out;
@@ -293,7 +316,7 @@ int omap_vrfb_request_ctx(struct vrfb *vrfb)
        vrfb->context = ctx;
 
        for (rot = 0; rot < 4; ++rot) {
-               paddr = SMS_ROT_VIRT_BASE(ctx, rot);
+               paddr = ctxs[ctx].base + SMS_ROT_VIRT_BASE(rot);
                if (!request_mem_region(paddr, OMAP_VRFB_SIZE, "vrfb")) {
                        pr_err("vrfb: failed to reserve VRFB "
                                        "area for ctx %d, rotation %d\n",
@@ -314,3 +337,80 @@ out:
        return r;
 }
 EXPORT_SYMBOL(omap_vrfb_request_ctx);
+
+bool omap_vrfb_supported(void)
+{
+       return vrfb_loaded;
+}
+EXPORT_SYMBOL(omap_vrfb_supported);
+
+static int __init vrfb_probe(struct platform_device *pdev)
+{
+       struct resource *mem;
+       int i;
+
+       /* first resource is the register res, the rest are vrfb contexts */
+
+       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!mem) {
+               dev_err(&pdev->dev, "can't get vrfb base address\n");
+               return -EINVAL;
+       }
+
+       vrfb_base = devm_request_and_ioremap(&pdev->dev, mem);
+       if (!vrfb_base) {
+               dev_err(&pdev->dev, "can't ioremap vrfb memory\n");
+               return -ENOMEM;
+       }
+
+       num_ctxs = pdev->num_resources - 1;
+
+       ctxs = devm_kzalloc(&pdev->dev,
+                       sizeof(struct vrfb_ctx) * num_ctxs,
+                       GFP_KERNEL);
+
+       if (!ctxs)
+               return -ENOMEM;
+
+       for (i = 0; i < num_ctxs; ++i) {
+               mem = platform_get_resource(pdev, IORESOURCE_MEM, 1 + i);
+               if (!mem) {
+                       dev_err(&pdev->dev, "can't get vrfb ctx %d address\n",
+                                       i);
+                       return -EINVAL;
+               }
+
+               ctxs[i].base = mem->start;
+       }
+
+       vrfb_loaded = true;
+
+       return 0;
+}
+
+static void __exit vrfb_remove(struct platform_device *pdev)
+{
+       vrfb_loaded = false;
+}
+
+static struct platform_driver vrfb_driver = {
+       .driver.name    = "omapvrfb",
+       .remove         = __exit_p(vrfb_remove),
+};
+
+static int __init vrfb_init(void)
+{
+       return platform_driver_probe(&vrfb_driver, &vrfb_probe);
+}
+
+static void __exit vrfb_exit(void)
+{
+       platform_driver_unregister(&vrfb_driver);
+}
+
+module_init(vrfb_init);
+module_exit(vrfb_exit);
+
+MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@ti.com>");
+MODULE_DESCRIPTION("OMAP VRFB");
+MODULE_LICENSE("GPL v2");
index 48220e129f854435292065c5e928f95d982a4ad3..f5dda83ad7a55048256f29ab79756c092450c08f 100644 (file)
@@ -625,7 +625,7 @@ static struct xenbus_watch *find_watch(const char *token)
  * so if we are running on anything older than 4 do not attempt to read
  * control/platform-feature-xs_reset_watches.
  */
-static bool xen_strict_xenbus_quirk()
+static bool xen_strict_xenbus_quirk(void)
 {
        uint32_t eax, ebx, ecx, edx, base;
 
index fd37facac8dc55f40281008ceb6799c667105588..ce47379bfa61cfecb7bc747d3fbc7031a65f3080 100644 (file)
@@ -450,11 +450,12 @@ static int umh_pipe_setup(struct subprocess_info *info, struct cred *new)
 
        cp->file = files[1];
 
-       replace_fd(0, files[0], 0);
+       err = replace_fd(0, files[0], 0);
+       fput(files[0]);
        /* and disallow core files too */
        current->signal->rlim[RLIMIT_CORE] = (struct rlimit){1, 1};
 
-       return 0;
+       return err;
 }
 
 void do_coredump(siginfo_t *siginfo, struct pt_regs *regs)
index 14afbabe65464e226549894404ec1af9d1a3f747..472e6befc54d3640d4ca8f7b3a6458aeb7eddce6 100644 (file)
@@ -545,37 +545,38 @@ void devpts_kill_index(struct inode *ptmx_inode, int idx)
        mutex_unlock(&allocated_ptys_lock);
 }
 
-int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)
+/**
+ * devpts_pty_new -- create a new inode in /dev/pts/
+ * @ptmx_inode: inode of the master
+ * @device: major+minor of the node to be created
+ * @index: used as a name of the node
+ * @priv: what's given back by devpts_get_priv
+ *
+ * The created inode is returned. Remove it from /dev/pts/ by devpts_pty_kill.
+ */
+struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index,
+               void *priv)
 {
-       /* tty layer puts index from devpts_new_index() in here */
-       int number = tty->index;
-       struct tty_driver *driver = tty->driver;
-       dev_t device = MKDEV(driver->major, driver->minor_start+number);
        struct dentry *dentry;
        struct super_block *sb = pts_sb_from_inode(ptmx_inode);
-       struct inode *inode = new_inode(sb);
+       struct inode *inode;
        struct dentry *root = sb->s_root;
        struct pts_fs_info *fsi = DEVPTS_SB(sb);
        struct pts_mount_opts *opts = &fsi->mount_opts;
-       int ret = 0;
        char s[12];
 
-       /* We're supposed to be given the slave end of a pty */
-       BUG_ON(driver->type != TTY_DRIVER_TYPE_PTY);
-       BUG_ON(driver->subtype != PTY_TYPE_SLAVE);
-
+       inode = new_inode(sb);
        if (!inode)
-               return -ENOMEM;
+               return ERR_PTR(-ENOMEM);
 
-       inode->i_ino = number + 3;
+       inode->i_ino = index + 3;
        inode->i_uid = opts->setuid ? opts->uid : current_fsuid();
        inode->i_gid = opts->setgid ? opts->gid : current_fsgid();
        inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
        init_special_inode(inode, S_IFCHR|opts->mode, device);
-       inode->i_private = tty;
-       tty->driver_data = inode;
+       inode->i_private = priv;
 
-       sprintf(s, "%d", number);
+       sprintf(s, "%d", index);
 
        mutex_lock(&root->d_inode->i_mutex);
 
@@ -585,18 +586,24 @@ int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)
                fsnotify_create(root->d_inode, dentry);
        } else {
                iput(inode);
-               ret = -ENOMEM;
+               inode = ERR_PTR(-ENOMEM);
        }
 
        mutex_unlock(&root->d_inode->i_mutex);
 
-       return ret;
+       return inode;
 }
 
-struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number)
+/**
+ * devpts_get_priv -- get private data for a slave
+ * @pts_inode: inode of the slave
+ *
+ * Returns whatever was passed as priv in devpts_pty_new for a given inode.
+ */
+void *devpts_get_priv(struct inode *pts_inode)
 {
        struct dentry *dentry;
-       struct tty_struct *tty;
+       void *priv = NULL;
 
        BUG_ON(pts_inode->i_rdev == MKDEV(TTYAUX_MAJOR, PTMX_MINOR));
 
@@ -605,18 +612,22 @@ struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number)
        if (!dentry)
                return NULL;
 
-       tty = NULL;
        if (pts_inode->i_sb->s_magic == DEVPTS_SUPER_MAGIC)
-               tty = (struct tty_struct *)pts_inode->i_private;
+               priv = pts_inode->i_private;
 
        dput(dentry);
 
-       return tty;
+       return priv;
 }
 
-void devpts_pty_kill(struct tty_struct *tty)
+/**
+ * devpts_pty_kill -- remove inode form /dev/pts/
+ * @inode: inode of the slave to be removed
+ *
+ * This is an inverse operation of devpts_pty_new.
+ */
+void devpts_pty_kill(struct inode *inode)
 {
-       struct inode *inode = tty->driver_data;
        struct super_block *sb = pts_sb_from_inode(inode);
        struct dentry *root = sb->s_root;
        struct dentry *dentry;
index 6c205d0c565b2595fe837eab5cf789d995df2d18..fa04d023177e71dcd8376adfbc097d2ddb4ee3ae 100644 (file)
@@ -469,7 +469,7 @@ static int parse_options(char *options, struct super_block *sb)
                        uid = make_kuid(current_user_ns(), option);
                        if (!uid_valid(uid)) {
                                ext2_msg(sb, KERN_ERR, "Invalid uid value %d", option);
-                               return -1;
+                               return 0;
 
                        }
                        sbi->s_resuid = uid;
@@ -480,7 +480,7 @@ static int parse_options(char *options, struct super_block *sb)
                        gid = make_kgid(current_user_ns(), option);
                        if (!gid_valid(gid)) {
                                ext2_msg(sb, KERN_ERR, "Invalid gid value %d", option);
-                               return -1;
+                               return 0;
                        }
                        sbi->s_resgid = gid;
                        break;
index 8f4fddac01a679456c8ef867d0a2e33f6592cbee..890b8947c5468b863327e87985ef42334f53fa74 100644 (file)
@@ -46,8 +46,7 @@ static struct buffer_head *ext3_append(handle_t *handle,
 
        *block = inode->i_size >> inode->i_sb->s_blocksize_bits;
 
-       bh = ext3_bread(handle, inode, *block, 1, err);
-       if (bh) {
+       if ((bh = ext3_dir_bread(handle, inode, *block, 1, err))) {
                inode->i_size += inode->i_sb->s_blocksize;
                EXT3_I(inode)->i_disksize = inode->i_size;
                *err = ext3_journal_get_write_access(handle, bh);
@@ -339,8 +338,10 @@ dx_probe(struct qstr *entry, struct inode *dir,
        u32 hash;
 
        frame->bh = NULL;
-       if (!(bh = ext3_bread (NULL,dir, 0, 0, err)))
+       if (!(bh = ext3_dir_bread(NULL, dir, 0, 0, err))) {
+               *err = ERR_BAD_DX_DIR;
                goto fail;
+       }
        root = (struct dx_root *) bh->b_data;
        if (root->info.hash_version != DX_HASH_TEA &&
            root->info.hash_version != DX_HASH_HALF_MD4 &&
@@ -436,8 +437,10 @@ dx_probe(struct qstr *entry, struct inode *dir,
                frame->entries = entries;
                frame->at = at;
                if (!indirect--) return frame;
-               if (!(bh = ext3_bread (NULL,dir, dx_get_block(at), 0, err)))
+               if (!(bh = ext3_dir_bread(NULL, dir, dx_get_block(at), 0, err))) {
+                       *err = ERR_BAD_DX_DIR;
                        goto fail2;
+               }
                at = entries = ((struct dx_node *) bh->b_data)->entries;
                if (dx_get_limit(entries) != dx_node_limit (dir)) {
                        ext3_warning(dir->i_sb, __func__,
@@ -535,8 +538,8 @@ static int ext3_htree_next_block(struct inode *dir, __u32 hash,
         * block so no check is necessary
         */
        while (num_frames--) {
-               if (!(bh = ext3_bread(NULL, dir, dx_get_block(p->at),
-                                     0, &err)))
+               if (!(bh = ext3_dir_bread(NULL, dir, dx_get_block(p->at),
+                                         0, &err)))
                        return err; /* Failure */
                p++;
                brelse (p->bh);
@@ -559,10 +562,11 @@ static int htree_dirblock_to_tree(struct file *dir_file,
 {
        struct buffer_head *bh;
        struct ext3_dir_entry_2 *de, *top;
-       int err, count = 0;
+       int err = 0, count = 0;
 
        dxtrace(printk("In htree dirblock_to_tree: block %d\n", block));
-       if (!(bh = ext3_bread (NULL, dir, block, 0, &err)))
+
+       if (!(bh = ext3_dir_bread(NULL, dir, block, 0, &err)))
                return err;
 
        de = (struct ext3_dir_entry_2 *) bh->b_data;
@@ -976,7 +980,7 @@ static struct buffer_head * ext3_dx_find_entry(struct inode *dir,
                return NULL;
        do {
                block = dx_get_block(frame->at);
-               if (!(bh = ext3_bread (NULL,dir, block, 0, err)))
+               if (!(bh = ext3_dir_bread (NULL, dir, block, 0, err)))
                        goto errout;
 
                retval = search_dirblock(bh, dir, entry,
@@ -1458,9 +1462,9 @@ static int ext3_add_entry (handle_t *handle, struct dentry *dentry,
        }
        blocks = dir->i_size >> sb->s_blocksize_bits;
        for (block = 0; block < blocks; block++) {
-               bh = ext3_bread(handle, dir, block, 0, &retval);
-               if(!bh)
+               if (!(bh = ext3_dir_bread(handle, dir, block, 0, &retval)))
                        return retval;
+
                retval = add_dirent_to_buf(handle, dentry, inode, NULL, bh);
                if (retval != -ENOSPC)
                        return retval;
@@ -1500,7 +1504,7 @@ static int ext3_dx_add_entry(handle_t *handle, struct dentry *dentry,
        entries = frame->entries;
        at = frame->at;
 
-       if (!(bh = ext3_bread(handle,dir, dx_get_block(frame->at), 0, &err)))
+       if (!(bh = ext3_dir_bread(handle, dir, dx_get_block(frame->at), 0, &err)))
                goto cleanup;
 
        BUFFER_TRACE(bh, "get_write_access");
@@ -1790,8 +1794,7 @@ retry:
        inode->i_op = &ext3_dir_inode_operations;
        inode->i_fop = &ext3_dir_operations;
        inode->i_size = EXT3_I(inode)->i_disksize = inode->i_sb->s_blocksize;
-       dir_block = ext3_bread (handle, inode, 0, 1, &err);
-       if (!dir_block)
+       if (!(dir_block = ext3_dir_bread(handle, inode, 0, 1, &err)))
                goto out_clear_inode;
 
        BUFFER_TRACE(dir_block, "get_write_access");
@@ -1859,7 +1862,7 @@ static int empty_dir (struct inode * inode)
 
        sb = inode->i_sb;
        if (inode->i_size < EXT3_DIR_REC_LEN(1) + EXT3_DIR_REC_LEN(2) ||
-           !(bh = ext3_bread (NULL, inode, 0, 0, &err))) {
+           !(bh = ext3_dir_bread(NULL, inode, 0, 0, &err))) {
                if (err)
                        ext3_error(inode->i_sb, __func__,
                                   "error %d reading directory #%lu offset 0",
@@ -1890,9 +1893,8 @@ static int empty_dir (struct inode * inode)
                        (void *) de >= (void *) (bh->b_data+sb->s_blocksize)) {
                        err = 0;
                        brelse (bh);
-                       bh = ext3_bread (NULL, inode,
-                               offset >> EXT3_BLOCK_SIZE_BITS(sb), 0, &err);
-                       if (!bh) {
+                       if (!(bh = ext3_dir_bread (NULL, inode,
+                               offset >> EXT3_BLOCK_SIZE_BITS(sb), 0, &err))) {
                                if (err)
                                        ext3_error(sb, __func__,
                                                   "error %d reading directory"
@@ -2388,7 +2390,7 @@ static int ext3_rename (struct inode * old_dir, struct dentry *old_dentry,
                                goto end_rename;
                }
                retval = -EIO;
-               dir_bh = ext3_bread (handle, old_inode, 0, 0, &retval);
+               dir_bh = ext3_dir_bread(handle, old_inode, 0, 0, &retval);
                if (!dir_bh)
                        goto end_rename;
                if (le32_to_cpu(PARENT_INO(dir_bh->b_data)) != old_dir->i_ino)
index f2ce2b0065c944640cac8f30361db7b9cbb29c04..46304d8c9f0a05d60dd7c31b65dc42ce311c4cb9 100644 (file)
@@ -6,3 +6,22 @@
 */
 
 extern struct dentry *ext3_get_parent(struct dentry *child);
+
+static inline struct buffer_head *ext3_dir_bread(handle_t *handle,
+                                                struct inode *inode,
+                                                int block, int create,
+                                                int *err)
+{
+       struct buffer_head *bh;
+
+       bh = ext3_bread(handle, inode, block, create, err);
+
+       if (!bh && !(*err)) {
+               *err = -EIO;
+               ext3_error(inode->i_sb, __func__,
+                          "Directory hole detected on inode %lu\n",
+                          inode->i_ino);
+               return NULL;
+       }
+       return bh;
+}
index 29e79713c7eb6ccd37eac31c20c02fb5fd826744..5366393528dfbd622120549729cf22a891026f44 100644 (file)
@@ -1001,7 +1001,7 @@ static int parse_options (char *options, struct super_block *sb,
                        uid = make_kuid(current_user_ns(), option);
                        if (!uid_valid(uid)) {
                                ext3_msg(sb, KERN_ERR, "Invalid uid value %d", option);
-                               return -1;
+                               return 0;
 
                        }
                        sbi->s_resuid = uid;
@@ -1012,7 +1012,7 @@ static int parse_options (char *options, struct super_block *sb,
                        gid = make_kgid(current_user_ns(), option);
                        if (!gid_valid(gid)) {
                                ext3_msg(sb, KERN_ERR, "Invalid gid value %d", option);
-                               return -1;
+                               return 0;
                        }
                        sbi->s_resgid = gid;
                        break;
index d269ada7670e155c7544a2aa01ea0697e98f3991..982d2676e1f813b7e011b05223606af3a63451cc 100644 (file)
@@ -223,7 +223,7 @@ static void encode_nlm_stat(struct xdr_stream *xdr,
 {
        __be32 *p;
 
-       BUG_ON(be32_to_cpu(stat) > NLM_LCK_DENIED_GRACE_PERIOD);
+       WARN_ON_ONCE(be32_to_cpu(stat) > NLM_LCK_DENIED_GRACE_PERIOD);
        p = xdr_reserve_space(xdr, 4);
        *p = stat;
 }
index 3009a365e082e37764ea817d070165c3b828146b..21171f0c6477560d7a5f6deb3e336e6c98581f96 100644 (file)
@@ -68,7 +68,8 @@ nlmsvc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,
 
        /* Obtain file pointer. Not used by FREE_ALL call. */
        if (filp != NULL) {
-               if ((error = nlm_lookup_file(rqstp, &file, &lock->fh)) != 0)
+               error = cast_status(nlm_lookup_file(rqstp, &file, &lock->fh));
+               if (error != 0)
                        goto no_locks;
                *filp = file;
 
index cceaab07ad549caaa124b71e3db01f126052ef59..43973b084abf25649fdb12e16ad3d169c0e29c9e 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/sched.h>
 #include <linux/proc_fs.h>
 struct  ctl_table_header;
+struct  mempolicy;
 
 extern struct proc_dir_entry proc_root;
 #ifdef CONFIG_PROC_SYSCTL
@@ -74,6 +75,9 @@ struct proc_maps_private {
 #ifdef CONFIG_MMU
        struct vm_area_struct *tail_vma;
 #endif
+#ifdef CONFIG_NUMA
+       struct mempolicy *task_mempolicy;
+#endif
 };
 
 void proc_init_inodecache(void);
index 79827ce03e3bc00208aced44caa7ae9fd2d08bd3..90c63f9392a595318c5d1e03e1d69305bf9413fa 100644 (file)
@@ -90,10 +90,55 @@ static void pad_len_spaces(struct seq_file *m, int len)
        seq_printf(m, "%*c", len, ' ');
 }
 
+#ifdef CONFIG_NUMA
+/*
+ * These functions are for numa_maps but called in generic **maps seq_file
+ * ->start(), ->stop() ops.
+ *
+ * numa_maps scans all vmas under mmap_sem and checks their mempolicy.
+ * Each mempolicy object is controlled by reference counting. The problem here
+ * is how to avoid accessing dead mempolicy object.
+ *
+ * Because we're holding mmap_sem while reading seq_file, it's safe to access
+ * each vma's mempolicy, no vma objects will never drop refs to mempolicy.
+ *
+ * A task's mempolicy (task->mempolicy) has different behavior. task->mempolicy
+ * is set and replaced under mmap_sem but unrefed and cleared under task_lock().
+ * So, without task_lock(), we cannot trust get_vma_policy() because we cannot
+ * gurantee the task never exits under us. But taking task_lock() around
+ * get_vma_plicy() causes lock order problem.
+ *
+ * To access task->mempolicy without lock, we hold a reference count of an
+ * object pointed by task->mempolicy and remember it. This will guarantee
+ * that task->mempolicy points to an alive object or NULL in numa_maps accesses.
+ */
+static void hold_task_mempolicy(struct proc_maps_private *priv)
+{
+       struct task_struct *task = priv->task;
+
+       task_lock(task);
+       priv->task_mempolicy = task->mempolicy;
+       mpol_get(priv->task_mempolicy);
+       task_unlock(task);
+}
+static void release_task_mempolicy(struct proc_maps_private *priv)
+{
+       mpol_put(priv->task_mempolicy);
+}
+#else
+static void hold_task_mempolicy(struct proc_maps_private *priv)
+{
+}
+static void release_task_mempolicy(struct proc_maps_private *priv)
+{
+}
+#endif
+
 static void vma_stop(struct proc_maps_private *priv, struct vm_area_struct *vma)
 {
        if (vma && vma != priv->tail_vma) {
                struct mm_struct *mm = vma->vm_mm;
+               release_task_mempolicy(priv);
                up_read(&mm->mmap_sem);
                mmput(mm);
        }
@@ -132,7 +177,7 @@ static void *m_start(struct seq_file *m, loff_t *pos)
 
        tail_vma = get_gate_vma(priv->task->mm);
        priv->tail_vma = tail_vma;
-
+       hold_task_mempolicy(priv);
        /* Start with last addr hint */
        vma = find_vma(mm, last_addr);
        if (last_addr && vma) {
@@ -159,6 +204,7 @@ out:
        if (vma)
                return vma;
 
+       release_task_mempolicy(priv);
        /* End of vmas has been reached */
        m->version = (tail_vma != NULL)? 0: -1UL;
        up_read(&mm->mmap_sem);
@@ -1158,6 +1204,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
        struct vm_area_struct *vma = v;
        struct numa_maps *md = &numa_priv->md;
        struct file *file = vma->vm_file;
+       struct task_struct *task = proc_priv->task;
        struct mm_struct *mm = vma->vm_mm;
        struct mm_walk walk = {};
        struct mempolicy *pol;
@@ -1177,7 +1224,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
        walk.private = md;
        walk.mm = mm;
 
-       pol = get_vma_policy(proc_priv->task, vma, vma->vm_start);
+       pol = get_vma_policy(task, vma, vma->vm_start);
        mpol_to_str(buffer, sizeof(buffer), pol, 0);
        mpol_cond_put(pol);
 
@@ -1189,7 +1236,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
        } else if (vma->vm_start <= mm->brk && vma->vm_end >= mm->start_brk) {
                seq_printf(m, " heap");
        } else {
-               pid_t tid = vm_is_stack(proc_priv->task, vma, is_pid);
+               pid_t tid = vm_is_stack(task, vma, is_pid);
                if (tid != 0) {
                        /*
                         * Thread stack in /proc/PID/task/TID/maps or
index 557a9c20a2154856c1e1595e2d0e457d9487aaad..05ae3c97f7a5fc552e771f9cf7312e4b61cffc1f 100644 (file)
@@ -1160,6 +1160,8 @@ static int need_print_warning(struct dquot_warn *warn)
                        return uid_eq(current_fsuid(), warn->w_dq_id.uid);
                case GRPQUOTA:
                        return in_group_p(warn->w_dq_id.gid);
+               case PRJQUOTA:  /* Never taken... Just make gcc happy */
+                       return 0;
        }
        return 0;
 }
index e164dddb8e9660dc1de0cfb1d6a6abd3da13ed6b..e21c119f4f99d8512208a9c08983dd5f9c25d821 100644 (file)
@@ -846,7 +846,7 @@ static int __simple_xattr_set(struct simple_xattrs *xattrs, const char *name,
                              const void *value, size_t size, int flags)
 {
        struct simple_xattr *xattr;
-       struct simple_xattr *uninitialized_var(new_xattr);
+       struct simple_xattr *new_xattr = NULL;
        int err = 0;
 
        /* value == NULL means remove */
index 8d226bfa2696a6f7a1dbefa4ccbf1bff4b391bf6..83256b64166a85380eb6a20adc357195ca8bfe77 100644 (file)
@@ -1,12 +1,8 @@
 # Top-level Makefile calls into asm-$(ARCH)
 # List only non-arch directories below
 
-header-y += asm-generic/
 header-y += linux/
 header-y += sound/
-header-y += mtd/
 header-y += rdma/
 header-y += video/
-header-y += drm/
-header-y += xen/
 header-y += scsi/
diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/include/drm/Kbuild b/include/drm/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
index 5b57367e28db9b848de3e54c32830faa62793924..7fe2dae251e59a4b7313b914b6bcbfcf33fce283 100644 (file)
@@ -1,31 +1,5 @@
-header-y += byteorder/
-header-y += can/
-header-y += caif/
 header-y += dvb/
 header-y += hdlc/
 header-y += hsi/
-header-y += isdn/
-header-y += mmc/
-header-y += nfsd/
 header-y += raid/
-header-y += spi/
-header-y += sunrpc/
-header-y += tc_act/
-header-y += tc_ematch/
-header-y += netfilter/
-header-y += netfilter_arp/
-header-y += netfilter_bridge/
-header-y += netfilter_ipv4/
-header-y += netfilter_ipv6/
 header-y += usb/
-header-y += wimax/
-
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
-                 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h),)
-endif
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
-                 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h),)
-endif
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
-                 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),)
-endif
diff --git a/include/linux/byteorder/Kbuild b/include/linux/byteorder/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/include/linux/caif/Kbuild b/include/linux/caif/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/include/linux/can/Kbuild b/include/linux/can/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
index 1775eb8acc03665d36bf8b094c440a41ba10764d..1d7399314a8933eab0516daf5ff4bf7f87777d88 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/fs.h>
+#include <asm/siginfo.h>
 
 /*
  * These are the only things you should do on a core-file: use only these
index 5ce0e5fd712e0fe67d0e05b455fffbb85c16fb7c..251a2090a55444cec55ce4f04510b6ef83a69cfb 100644 (file)
 int devpts_new_index(struct inode *ptmx_inode);
 void devpts_kill_index(struct inode *ptmx_inode, int idx);
 /* mknod in devpts */
-int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty);
-/* get tty structure */
-struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number);
+struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index,
+               void *priv);
+/* get private structure */
+void *devpts_get_priv(struct inode *pts_inode);
 /* unlink */
-void devpts_pty_kill(struct tty_struct *tty);
+void devpts_pty_kill(struct inode *inode);
 
 #else
 
 /* Dummy stubs in the no-pty case */
 static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }
 static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { }
-static inline int devpts_pty_new(struct inode *ptmx_inode,
-                               struct tty_struct *tty)
+static inline struct inode *devpts_pty_new(struct inode *ptmx_inode,
+               dev_t device, int index, void *priv)
 {
-       return -EINVAL;
+       return ERR_PTR(-EINVAL);
 }
-static inline struct tty_struct *devpts_get_tty(struct inode *pts_inode,
-               int number)
+static inline void *devpts_get_priv(struct inode *pts_inode)
 {
        return NULL;
 }
-static inline void devpts_pty_kill(struct tty_struct *tty) { }
+static inline void devpts_pty_kill(struct inode *inode) { }
 
 #endif
 
index f4dba8637f9807c999664d517ed2c7379eadca60..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,8 +0,0 @@
-header-y += audio.h
-header-y += ca.h
-header-y += dmx.h
-header-y += frontend.h
-header-y += net.h
-header-y += osd.h
-header-y += version.h
-header-y += video.h
diff --git a/include/linux/dvb/audio.h b/include/linux/dvb/audio.h
deleted file mode 100644 (file)
index d47bccd..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * audio.h
- *
- * Copyright (C) 2000 Ralph  Metzler <ralph@convergence.de>
- *                  & Marcus Metzler <marcus@convergence.de>
- *                    for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Lesser Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- */
-
-#ifndef _DVBAUDIO_H_
-#define _DVBAUDIO_H_
-
-#include <linux/types.h>
-
-typedef enum {
-       AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */
-       AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */
-} audio_stream_source_t;
-
-
-typedef enum {
-       AUDIO_STOPPED,      /* Device is stopped */
-       AUDIO_PLAYING,      /* Device is currently playing */
-       AUDIO_PAUSED        /* Device is paused */
-} audio_play_state_t;
-
-
-typedef enum {
-       AUDIO_STEREO,
-       AUDIO_MONO_LEFT,
-       AUDIO_MONO_RIGHT,
-       AUDIO_MONO,
-       AUDIO_STEREO_SWAPPED
-} audio_channel_select_t;
-
-
-typedef struct audio_mixer {
-       unsigned int volume_left;
-       unsigned int volume_right;
-  // what else do we need? bass, pass-through, ...
-} audio_mixer_t;
-
-
-typedef struct audio_status {
-       int                    AV_sync_state;  /* sync audio and video? */
-       int                    mute_state;     /* audio is muted */
-       audio_play_state_t     play_state;     /* current playback state */
-       audio_stream_source_t  stream_source;  /* current stream source */
-       audio_channel_select_t channel_select; /* currently selected channel */
-       int                    bypass_mode;    /* pass on audio data to */
-       audio_mixer_t          mixer_state;    /* current mixer state */
-} audio_status_t;                              /* separate decoder hardware */
-
-
-typedef
-struct audio_karaoke {  /* if Vocal1 or Vocal2 are non-zero, they get mixed  */
-       int vocal1;    /* into left and right t at 70% each */
-       int vocal2;    /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/
-       int melody;    /* mixed into the left channel and */
-                      /* Vocal2 into the right channel at 100% each. */
-                      /* if Melody is non-zero, the melody channel gets mixed*/
-} audio_karaoke_t;     /* into left and right  */
-
-
-typedef __u16 audio_attributes_t;
-/*   bits: descr. */
-/*   15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */
-/*   12    multichannel extension */
-/*   11-10 audio type (0=not spec, 1=language included) */
-/*    9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) */
-/*    7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit,  */
-/*    5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */
-/*    2- 0 number of audio channels (n+1 channels) */
-
-
-/* for GET_CAPABILITIES and SET_FORMAT, the latter should only set one bit */
-#define AUDIO_CAP_DTS    1
-#define AUDIO_CAP_LPCM   2
-#define AUDIO_CAP_MP1    4
-#define AUDIO_CAP_MP2    8
-#define AUDIO_CAP_MP3   16
-#define AUDIO_CAP_AAC   32
-#define AUDIO_CAP_OGG   64
-#define AUDIO_CAP_SDDS 128
-#define AUDIO_CAP_AC3  256
-
-#define AUDIO_STOP                 _IO('o', 1)
-#define AUDIO_PLAY                 _IO('o', 2)
-#define AUDIO_PAUSE                _IO('o', 3)
-#define AUDIO_CONTINUE             _IO('o', 4)
-#define AUDIO_SELECT_SOURCE        _IO('o', 5)
-#define AUDIO_SET_MUTE             _IO('o', 6)
-#define AUDIO_SET_AV_SYNC          _IO('o', 7)
-#define AUDIO_SET_BYPASS_MODE      _IO('o', 8)
-#define AUDIO_CHANNEL_SELECT       _IO('o', 9)
-#define AUDIO_GET_STATUS           _IOR('o', 10, audio_status_t)
-
-#define AUDIO_GET_CAPABILITIES     _IOR('o', 11, unsigned int)
-#define AUDIO_CLEAR_BUFFER         _IO('o',  12)
-#define AUDIO_SET_ID               _IO('o', 13)
-#define AUDIO_SET_MIXER            _IOW('o', 14, audio_mixer_t)
-#define AUDIO_SET_STREAMTYPE       _IO('o', 15)
-#define AUDIO_SET_EXT_ID           _IO('o', 16)
-#define AUDIO_SET_ATTRIBUTES       _IOW('o', 17, audio_attributes_t)
-#define AUDIO_SET_KARAOKE          _IOW('o', 18, audio_karaoke_t)
-
-/**
- * AUDIO_GET_PTS
- *
- * Read the 33 bit presentation time stamp as defined
- * in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
- *
- * The PTS should belong to the currently played
- * frame if possible, but may also be a value close to it
- * like the PTS of the last decoded frame or the last PTS
- * extracted by the PES parser.
- */
-#define AUDIO_GET_PTS              _IOR('o', 19, __u64)
-#define AUDIO_BILINGUAL_CHANNEL_SELECT _IO('o', 20)
-
-#endif /* _DVBAUDIO_H_ */
diff --git a/include/linux/dvb/ca.h b/include/linux/dvb/ca.h
deleted file mode 100644 (file)
index c18537f..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * ca.h
- *
- * Copyright (C) 2000 Ralph  Metzler <ralph@convergence.de>
- *                  & Marcus Metzler <marcus@convergence.de>
- *                    for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Lesser Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- */
-
-#ifndef _DVBCA_H_
-#define _DVBCA_H_
-
-/* slot interface types and info */
-
-typedef struct ca_slot_info {
-       int num;               /* slot number */
-
-       int type;              /* CA interface this slot supports */
-#define CA_CI            1     /* CI high level interface */
-#define CA_CI_LINK       2     /* CI link layer level interface */
-#define CA_CI_PHYS       4     /* CI physical layer level interface */
-#define CA_DESCR         8     /* built-in descrambler */
-#define CA_SC          128     /* simple smart card interface */
-
-       unsigned int flags;
-#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
-#define CA_CI_MODULE_READY   2
-} ca_slot_info_t;
-
-
-/* descrambler types and info */
-
-typedef struct ca_descr_info {
-       unsigned int num;          /* number of available descramblers (keys) */
-       unsigned int type;         /* type of supported scrambling system */
-#define CA_ECD           1
-#define CA_NDS           2
-#define CA_DSS           4
-} ca_descr_info_t;
-
-typedef struct ca_caps {
-       unsigned int slot_num;     /* total number of CA card and module slots */
-       unsigned int slot_type;    /* OR of all supported types */
-       unsigned int descr_num;    /* total number of descrambler slots (keys) */
-       unsigned int descr_type;   /* OR of all supported types */
-} ca_caps_t;
-
-/* a message to/from a CI-CAM */
-typedef struct ca_msg {
-       unsigned int index;
-       unsigned int type;
-       unsigned int length;
-       unsigned char msg[256];
-} ca_msg_t;
-
-typedef struct ca_descr {
-       unsigned int index;
-       unsigned int parity;    /* 0 == even, 1 == odd */
-       unsigned char cw[8];
-} ca_descr_t;
-
-typedef struct ca_pid {
-       unsigned int pid;
-       int index;              /* -1 == disable*/
-} ca_pid_t;
-
-#define CA_RESET          _IO('o', 128)
-#define CA_GET_CAP        _IOR('o', 129, ca_caps_t)
-#define CA_GET_SLOT_INFO  _IOR('o', 130, ca_slot_info_t)
-#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t)
-#define CA_GET_MSG        _IOR('o', 132, ca_msg_t)
-#define CA_SEND_MSG       _IOW('o', 133, ca_msg_t)
-#define CA_SET_DESCR      _IOW('o', 134, ca_descr_t)
-#define CA_SET_PID        _IOW('o', 135, ca_pid_t)
-
-#endif
index f078f3ac82d4bc606c345926722fefce6fdb4abe..0be6d8f2b52b99f501eaac22fa9c7117749e60a7 100644 (file)
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
  */
-
 #ifndef _DVBDMX_H_
 #define _DVBDMX_H_
 
-#include <linux/types.h>
-#ifdef __KERNEL__
 #include <linux/time.h>
-#else
-#include <time.h>
-#endif
-
-
-#define DMX_FILTER_SIZE 16
-
-typedef enum
-{
-       DMX_OUT_DECODER, /* Streaming directly to decoder. */
-       DMX_OUT_TAP,     /* Output going to a memory buffer */
-                        /* (to be retrieved via the read command).*/
-       DMX_OUT_TS_TAP,  /* Output multiplexed into a new TS  */
-                        /* (to be retrieved by reading from the */
-                        /* logical DVR device).                 */
-       DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */
-} dmx_output_t;
-
-
-typedef enum
-{
-       DMX_IN_FRONTEND, /* Input from a front-end device.  */
-       DMX_IN_DVR       /* Input from the logical DVR device.  */
-} dmx_input_t;
-
-
-typedef enum
-{
-       DMX_PES_AUDIO0,
-       DMX_PES_VIDEO0,
-       DMX_PES_TELETEXT0,
-       DMX_PES_SUBTITLE0,
-       DMX_PES_PCR0,
-
-       DMX_PES_AUDIO1,
-       DMX_PES_VIDEO1,
-       DMX_PES_TELETEXT1,
-       DMX_PES_SUBTITLE1,
-       DMX_PES_PCR1,
-
-       DMX_PES_AUDIO2,
-       DMX_PES_VIDEO2,
-       DMX_PES_TELETEXT2,
-       DMX_PES_SUBTITLE2,
-       DMX_PES_PCR2,
-
-       DMX_PES_AUDIO3,
-       DMX_PES_VIDEO3,
-       DMX_PES_TELETEXT3,
-       DMX_PES_SUBTITLE3,
-       DMX_PES_PCR3,
-
-       DMX_PES_OTHER
-} dmx_pes_type_t;
-
-#define DMX_PES_AUDIO    DMX_PES_AUDIO0
-#define DMX_PES_VIDEO    DMX_PES_VIDEO0
-#define DMX_PES_TELETEXT DMX_PES_TELETEXT0
-#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
-#define DMX_PES_PCR      DMX_PES_PCR0
-
-
-typedef struct dmx_filter
-{
-       __u8  filter[DMX_FILTER_SIZE];
-       __u8  mask[DMX_FILTER_SIZE];
-       __u8  mode[DMX_FILTER_SIZE];
-} dmx_filter_t;
-
-
-struct dmx_sct_filter_params
-{
-       __u16          pid;
-       dmx_filter_t   filter;
-       __u32          timeout;
-       __u32          flags;
-#define DMX_CHECK_CRC       1
-#define DMX_ONESHOT         2
-#define DMX_IMMEDIATE_START 4
-#define DMX_KERNEL_CLIENT   0x8000
-};
-
-
-struct dmx_pes_filter_params
-{
-       __u16          pid;
-       dmx_input_t    input;
-       dmx_output_t   output;
-       dmx_pes_type_t pes_type;
-       __u32          flags;
-};
-
-typedef struct dmx_caps {
-       __u32 caps;
-       int num_decoders;
-} dmx_caps_t;
-
-typedef enum {
-       DMX_SOURCE_FRONT0 = 0,
-       DMX_SOURCE_FRONT1,
-       DMX_SOURCE_FRONT2,
-       DMX_SOURCE_FRONT3,
-       DMX_SOURCE_DVR0   = 16,
-       DMX_SOURCE_DVR1,
-       DMX_SOURCE_DVR2,
-       DMX_SOURCE_DVR3
-} dmx_source_t;
-
-struct dmx_stc {
-       unsigned int num;       /* input : which STC? 0..N */
-       unsigned int base;      /* output: divisor for stc to get 90 kHz clock */
-       __u64 stc;              /* output: stc in 'base'*90 kHz units */
-};
-
-
-#define DMX_START                _IO('o', 41)
-#define DMX_STOP                 _IO('o', 42)
-#define DMX_SET_FILTER           _IOW('o', 43, struct dmx_sct_filter_params)
-#define DMX_SET_PES_FILTER       _IOW('o', 44, struct dmx_pes_filter_params)
-#define DMX_SET_BUFFER_SIZE      _IO('o', 45)
-#define DMX_GET_PES_PIDS         _IOR('o', 47, __u16[5])
-#define DMX_GET_CAPS             _IOR('o', 48, dmx_caps_t)
-#define DMX_SET_SOURCE           _IOW('o', 49, dmx_source_t)
-#define DMX_GET_STC              _IOWR('o', 50, struct dmx_stc)
-#define DMX_ADD_PID              _IOW('o', 51, __u16)
-#define DMX_REMOVE_PID           _IOW('o', 52, __u16)
+#include <uapi/linux/dvb/dmx.h>
 
 #endif /*_DVBDMX_H_*/
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h
deleted file mode 100644 (file)
index c12d452..0000000
+++ /dev/null
@@ -1,516 +0,0 @@
-/*
- * frontend.h
- *
- * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
- *                 Ralph  Metzler <ralph@convergence.de>
- *                 Holger Waechtler <holger@convergence.de>
- *                 Andre Draszik <ad@convergence.de>
- *                 for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- */
-
-#ifndef _DVBFRONTEND_H_
-#define _DVBFRONTEND_H_
-
-#include <linux/types.h>
-
-typedef enum fe_type {
-       FE_QPSK,
-       FE_QAM,
-       FE_OFDM,
-       FE_ATSC
-} fe_type_t;
-
-
-typedef enum fe_caps {
-       FE_IS_STUPID                    = 0,
-       FE_CAN_INVERSION_AUTO           = 0x1,
-       FE_CAN_FEC_1_2                  = 0x2,
-       FE_CAN_FEC_2_3                  = 0x4,
-       FE_CAN_FEC_3_4                  = 0x8,
-       FE_CAN_FEC_4_5                  = 0x10,
-       FE_CAN_FEC_5_6                  = 0x20,
-       FE_CAN_FEC_6_7                  = 0x40,
-       FE_CAN_FEC_7_8                  = 0x80,
-       FE_CAN_FEC_8_9                  = 0x100,
-       FE_CAN_FEC_AUTO                 = 0x200,
-       FE_CAN_QPSK                     = 0x400,
-       FE_CAN_QAM_16                   = 0x800,
-       FE_CAN_QAM_32                   = 0x1000,
-       FE_CAN_QAM_64                   = 0x2000,
-       FE_CAN_QAM_128                  = 0x4000,
-       FE_CAN_QAM_256                  = 0x8000,
-       FE_CAN_QAM_AUTO                 = 0x10000,
-       FE_CAN_TRANSMISSION_MODE_AUTO   = 0x20000,
-       FE_CAN_BANDWIDTH_AUTO           = 0x40000,
-       FE_CAN_GUARD_INTERVAL_AUTO      = 0x80000,
-       FE_CAN_HIERARCHY_AUTO           = 0x100000,
-       FE_CAN_8VSB                     = 0x200000,
-       FE_CAN_16VSB                    = 0x400000,
-       FE_HAS_EXTENDED_CAPS            = 0x800000,   /* We need more bitspace for newer APIs, indicate this. */
-       FE_CAN_MULTISTREAM              = 0x4000000,  /* frontend supports multistream filtering */
-       FE_CAN_TURBO_FEC                = 0x8000000,  /* frontend supports "turbo fec modulation" */
-       FE_CAN_2G_MODULATION            = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */
-       FE_NEEDS_BENDING                = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
-       FE_CAN_RECOVER                  = 0x40000000, /* frontend can recover from a cable unplug automatically */
-       FE_CAN_MUTE_TS                  = 0x80000000  /* frontend can stop spurious TS data output */
-} fe_caps_t;
-
-
-struct dvb_frontend_info {
-       char       name[128];
-       fe_type_t  type;                        /* DEPRECATED. Use DTV_ENUM_DELSYS instead */
-       __u32      frequency_min;
-       __u32      frequency_max;
-       __u32      frequency_stepsize;
-       __u32      frequency_tolerance;
-       __u32      symbol_rate_min;
-       __u32      symbol_rate_max;
-       __u32      symbol_rate_tolerance;       /* ppm */
-       __u32      notifier_delay;              /* DEPRECATED */
-       fe_caps_t  caps;
-};
-
-
-/**
- *  Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
- *  the meaning of this struct...
- */
-struct dvb_diseqc_master_cmd {
-       __u8 msg [6];   /*  { framing, address, command, data [3] } */
-       __u8 msg_len;   /*  valid values are 3...6  */
-};
-
-
-struct dvb_diseqc_slave_reply {
-       __u8 msg [4];   /*  { framing, data [3] } */
-       __u8 msg_len;   /*  valid values are 0...4, 0 means no msg  */
-       int  timeout;   /*  return from ioctl after timeout ms with */
-};                     /*  errorcode when no message was received  */
-
-
-typedef enum fe_sec_voltage {
-       SEC_VOLTAGE_13,
-       SEC_VOLTAGE_18,
-       SEC_VOLTAGE_OFF
-} fe_sec_voltage_t;
-
-
-typedef enum fe_sec_tone_mode {
-       SEC_TONE_ON,
-       SEC_TONE_OFF
-} fe_sec_tone_mode_t;
-
-
-typedef enum fe_sec_mini_cmd {
-       SEC_MINI_A,
-       SEC_MINI_B
-} fe_sec_mini_cmd_t;
-
-
-/**
- * enum fe_status - enumerates the possible frontend status
- * @FE_HAS_SIGNAL:     found something above the noise level
- * @FE_HAS_CARRIER:    found a DVB signal
- * @FE_HAS_VITERBI:    FEC is stable
- * @FE_HAS_SYNC:       found sync bytes
- * @FE_HAS_LOCK:       everything's working
- * @FE_TIMEDOUT:       no lock within the last ~2 seconds
- * @FE_REINIT:         frontend was reinitialized, application is recommended
- *                     to reset DiSEqC, tone and parameters
- */
-
-typedef enum fe_status {
-       FE_HAS_SIGNAL           = 0x01,
-       FE_HAS_CARRIER          = 0x02,
-       FE_HAS_VITERBI          = 0x04,
-       FE_HAS_SYNC             = 0x08,
-       FE_HAS_LOCK             = 0x10,
-       FE_TIMEDOUT             = 0x20,
-       FE_REINIT               = 0x40,
-} fe_status_t;
-
-typedef enum fe_spectral_inversion {
-       INVERSION_OFF,
-       INVERSION_ON,
-       INVERSION_AUTO
-} fe_spectral_inversion_t;
-
-
-typedef enum fe_code_rate {
-       FEC_NONE = 0,
-       FEC_1_2,
-       FEC_2_3,
-       FEC_3_4,
-       FEC_4_5,
-       FEC_5_6,
-       FEC_6_7,
-       FEC_7_8,
-       FEC_8_9,
-       FEC_AUTO,
-       FEC_3_5,
-       FEC_9_10,
-       FEC_2_5,
-} fe_code_rate_t;
-
-
-typedef enum fe_modulation {
-       QPSK,
-       QAM_16,
-       QAM_32,
-       QAM_64,
-       QAM_128,
-       QAM_256,
-       QAM_AUTO,
-       VSB_8,
-       VSB_16,
-       PSK_8,
-       APSK_16,
-       APSK_32,
-       DQPSK,
-       QAM_4_NR,
-} fe_modulation_t;
-
-typedef enum fe_transmit_mode {
-       TRANSMISSION_MODE_2K,
-       TRANSMISSION_MODE_8K,
-       TRANSMISSION_MODE_AUTO,
-       TRANSMISSION_MODE_4K,
-       TRANSMISSION_MODE_1K,
-       TRANSMISSION_MODE_16K,
-       TRANSMISSION_MODE_32K,
-       TRANSMISSION_MODE_C1,
-       TRANSMISSION_MODE_C3780,
-} fe_transmit_mode_t;
-
-#if defined(__DVB_CORE__) || !defined (__KERNEL__)
-typedef enum fe_bandwidth {
-       BANDWIDTH_8_MHZ,
-       BANDWIDTH_7_MHZ,
-       BANDWIDTH_6_MHZ,
-       BANDWIDTH_AUTO,
-       BANDWIDTH_5_MHZ,
-       BANDWIDTH_10_MHZ,
-       BANDWIDTH_1_712_MHZ,
-} fe_bandwidth_t;
-#endif
-
-typedef enum fe_guard_interval {
-       GUARD_INTERVAL_1_32,
-       GUARD_INTERVAL_1_16,
-       GUARD_INTERVAL_1_8,
-       GUARD_INTERVAL_1_4,
-       GUARD_INTERVAL_AUTO,
-       GUARD_INTERVAL_1_128,
-       GUARD_INTERVAL_19_128,
-       GUARD_INTERVAL_19_256,
-       GUARD_INTERVAL_PN420,
-       GUARD_INTERVAL_PN595,
-       GUARD_INTERVAL_PN945,
-} fe_guard_interval_t;
-
-
-typedef enum fe_hierarchy {
-       HIERARCHY_NONE,
-       HIERARCHY_1,
-       HIERARCHY_2,
-       HIERARCHY_4,
-       HIERARCHY_AUTO
-} fe_hierarchy_t;
-
-enum fe_interleaving {
-       INTERLEAVING_NONE,
-       INTERLEAVING_AUTO,
-       INTERLEAVING_240,
-       INTERLEAVING_720,
-};
-
-#if defined(__DVB_CORE__) || !defined (__KERNEL__)
-struct dvb_qpsk_parameters {
-       __u32           symbol_rate;  /* symbol rate in Symbols per second */
-       fe_code_rate_t  fec_inner;    /* forward error correction (see above) */
-};
-
-struct dvb_qam_parameters {
-       __u32           symbol_rate; /* symbol rate in Symbols per second */
-       fe_code_rate_t  fec_inner;   /* forward error correction (see above) */
-       fe_modulation_t modulation;  /* modulation type (see above) */
-};
-
-struct dvb_vsb_parameters {
-       fe_modulation_t modulation;  /* modulation type (see above) */
-};
-
-struct dvb_ofdm_parameters {
-       fe_bandwidth_t      bandwidth;
-       fe_code_rate_t      code_rate_HP;  /* high priority stream code rate */
-       fe_code_rate_t      code_rate_LP;  /* low priority stream code rate */
-       fe_modulation_t     constellation; /* modulation type (see above) */
-       fe_transmit_mode_t  transmission_mode;
-       fe_guard_interval_t guard_interval;
-       fe_hierarchy_t      hierarchy_information;
-};
-
-
-struct dvb_frontend_parameters {
-       __u32 frequency;     /* (absolute) frequency in Hz for QAM/OFDM/ATSC */
-                            /* intermediate frequency in kHz for QPSK */
-       fe_spectral_inversion_t inversion;
-       union {
-               struct dvb_qpsk_parameters qpsk;
-               struct dvb_qam_parameters  qam;
-               struct dvb_ofdm_parameters ofdm;
-               struct dvb_vsb_parameters vsb;
-       } u;
-};
-
-struct dvb_frontend_event {
-       fe_status_t status;
-       struct dvb_frontend_parameters parameters;
-};
-#endif
-
-/* S2API Commands */
-#define DTV_UNDEFINED          0
-#define DTV_TUNE               1
-#define DTV_CLEAR              2
-#define DTV_FREQUENCY          3
-#define DTV_MODULATION         4
-#define DTV_BANDWIDTH_HZ       5
-#define DTV_INVERSION          6
-#define DTV_DISEQC_MASTER      7
-#define DTV_SYMBOL_RATE                8
-#define DTV_INNER_FEC          9
-#define DTV_VOLTAGE            10
-#define DTV_TONE               11
-#define DTV_PILOT              12
-#define DTV_ROLLOFF            13
-#define DTV_DISEQC_SLAVE_REPLY 14
-
-/* Basic enumeration set for querying unlimited capabilities */
-#define DTV_FE_CAPABILITY_COUNT        15
-#define DTV_FE_CAPABILITY      16
-#define DTV_DELIVERY_SYSTEM    17
-
-/* ISDB-T and ISDB-Tsb */
-#define DTV_ISDBT_PARTIAL_RECEPTION    18
-#define DTV_ISDBT_SOUND_BROADCASTING   19
-
-#define DTV_ISDBT_SB_SUBCHANNEL_ID     20
-#define DTV_ISDBT_SB_SEGMENT_IDX       21
-#define DTV_ISDBT_SB_SEGMENT_COUNT     22
-
-#define DTV_ISDBT_LAYERA_FEC                   23
-#define DTV_ISDBT_LAYERA_MODULATION            24
-#define DTV_ISDBT_LAYERA_SEGMENT_COUNT         25
-#define DTV_ISDBT_LAYERA_TIME_INTERLEAVING     26
-
-#define DTV_ISDBT_LAYERB_FEC                   27
-#define DTV_ISDBT_LAYERB_MODULATION            28
-#define DTV_ISDBT_LAYERB_SEGMENT_COUNT         29
-#define DTV_ISDBT_LAYERB_TIME_INTERLEAVING     30
-
-#define DTV_ISDBT_LAYERC_FEC                   31
-#define DTV_ISDBT_LAYERC_MODULATION            32
-#define DTV_ISDBT_LAYERC_SEGMENT_COUNT         33
-#define DTV_ISDBT_LAYERC_TIME_INTERLEAVING     34
-
-#define DTV_API_VERSION                35
-
-#define DTV_CODE_RATE_HP       36
-#define DTV_CODE_RATE_LP       37
-#define DTV_GUARD_INTERVAL     38
-#define DTV_TRANSMISSION_MODE  39
-#define DTV_HIERARCHY          40
-
-#define DTV_ISDBT_LAYER_ENABLED        41
-
-#define DTV_STREAM_ID          42
-#define DTV_ISDBS_TS_ID_LEGACY DTV_STREAM_ID
-#define DTV_DVBT2_PLP_ID_LEGACY        43
-
-#define DTV_ENUM_DELSYS                44
-
-/* ATSC-MH */
-#define DTV_ATSCMH_FIC_VER             45
-#define DTV_ATSCMH_PARADE_ID           46
-#define DTV_ATSCMH_NOG                 47
-#define DTV_ATSCMH_TNOG                        48
-#define DTV_ATSCMH_SGN                 49
-#define DTV_ATSCMH_PRC                 50
-#define DTV_ATSCMH_RS_FRAME_MODE       51
-#define DTV_ATSCMH_RS_FRAME_ENSEMBLE   52
-#define DTV_ATSCMH_RS_CODE_MODE_PRI    53
-#define DTV_ATSCMH_RS_CODE_MODE_SEC    54
-#define DTV_ATSCMH_SCCC_BLOCK_MODE     55
-#define DTV_ATSCMH_SCCC_CODE_MODE_A    56
-#define DTV_ATSCMH_SCCC_CODE_MODE_B    57
-#define DTV_ATSCMH_SCCC_CODE_MODE_C    58
-#define DTV_ATSCMH_SCCC_CODE_MODE_D    59
-
-#define DTV_INTERLEAVING                       60
-#define DTV_LNA                                        61
-
-#define DTV_MAX_COMMAND                                DTV_LNA
-
-typedef enum fe_pilot {
-       PILOT_ON,
-       PILOT_OFF,
-       PILOT_AUTO,
-} fe_pilot_t;
-
-typedef enum fe_rolloff {
-       ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */
-       ROLLOFF_20,
-       ROLLOFF_25,
-       ROLLOFF_AUTO,
-} fe_rolloff_t;
-
-typedef enum fe_delivery_system {
-       SYS_UNDEFINED,
-       SYS_DVBC_ANNEX_A,
-       SYS_DVBC_ANNEX_B,
-       SYS_DVBT,
-       SYS_DSS,
-       SYS_DVBS,
-       SYS_DVBS2,
-       SYS_DVBH,
-       SYS_ISDBT,
-       SYS_ISDBS,
-       SYS_ISDBC,
-       SYS_ATSC,
-       SYS_ATSCMH,
-       SYS_DTMB,
-       SYS_CMMB,
-       SYS_DAB,
-       SYS_DVBT2,
-       SYS_TURBO,
-       SYS_DVBC_ANNEX_C,
-} fe_delivery_system_t;
-
-/* backward compatibility */
-#define SYS_DVBC_ANNEX_AC      SYS_DVBC_ANNEX_A
-#define SYS_DMBTH SYS_DTMB /* DMB-TH is legacy name, use DTMB instead */
-
-/* ATSC-MH */
-
-enum atscmh_sccc_block_mode {
-       ATSCMH_SCCC_BLK_SEP      = 0,
-       ATSCMH_SCCC_BLK_COMB     = 1,
-       ATSCMH_SCCC_BLK_RES      = 2,
-};
-
-enum atscmh_sccc_code_mode {
-       ATSCMH_SCCC_CODE_HLF     = 0,
-       ATSCMH_SCCC_CODE_QTR     = 1,
-       ATSCMH_SCCC_CODE_RES     = 2,
-};
-
-enum atscmh_rs_frame_ensemble {
-       ATSCMH_RSFRAME_ENS_PRI   = 0,
-       ATSCMH_RSFRAME_ENS_SEC   = 1,
-};
-
-enum atscmh_rs_frame_mode {
-       ATSCMH_RSFRAME_PRI_ONLY  = 0,
-       ATSCMH_RSFRAME_PRI_SEC   = 1,
-       ATSCMH_RSFRAME_RES       = 2,
-};
-
-enum atscmh_rs_code_mode {
-       ATSCMH_RSCODE_211_187    = 0,
-       ATSCMH_RSCODE_223_187    = 1,
-       ATSCMH_RSCODE_235_187    = 2,
-       ATSCMH_RSCODE_RES        = 3,
-};
-
-#define NO_STREAM_ID_FILTER    (~0U)
-#define LNA_AUTO                (~0U)
-
-struct dtv_cmds_h {
-       char    *name;          /* A display name for debugging purposes */
-
-       __u32   cmd;            /* A unique ID */
-
-       /* Flags */
-       __u32   set:1;          /* Either a set or get property */
-       __u32   buffer:1;       /* Does this property use the buffer? */
-       __u32   reserved:30;    /* Align */
-};
-
-struct dtv_property {
-       __u32 cmd;
-       __u32 reserved[3];
-       union {
-               __u32 data;
-               struct {
-                       __u8 data[32];
-                       __u32 len;
-                       __u32 reserved1[3];
-                       void *reserved2;
-               } buffer;
-       } u;
-       int result;
-} __attribute__ ((packed));
-
-/* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
-#define DTV_IOCTL_MAX_MSGS 64
-
-struct dtv_properties {
-       __u32 num;
-       struct dtv_property *props;
-};
-
-#define FE_SET_PROPERTY                   _IOW('o', 82, struct dtv_properties)
-#define FE_GET_PROPERTY                   _IOR('o', 83, struct dtv_properties)
-
-
-/**
- * When set, this flag will disable any zigzagging or other "normal" tuning
- * behaviour. Additionally, there will be no automatic monitoring of the lock
- * status, and hence no frontend events will be generated. If a frontend device
- * is closed, this flag will be automatically turned off when the device is
- * reopened read-write.
- */
-#define FE_TUNE_MODE_ONESHOT 0x01
-
-
-#define FE_GET_INFO               _IOR('o', 61, struct dvb_frontend_info)
-
-#define FE_DISEQC_RESET_OVERLOAD   _IO('o', 62)
-#define FE_DISEQC_SEND_MASTER_CMD  _IOW('o', 63, struct dvb_diseqc_master_cmd)
-#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)
-#define FE_DISEQC_SEND_BURST       _IO('o', 65)  /* fe_sec_mini_cmd_t */
-
-#define FE_SET_TONE               _IO('o', 66)  /* fe_sec_tone_mode_t */
-#define FE_SET_VOLTAGE            _IO('o', 67)  /* fe_sec_voltage_t */
-#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68)  /* int */
-
-#define FE_READ_STATUS            _IOR('o', 69, fe_status_t)
-#define FE_READ_BER               _IOR('o', 70, __u32)
-#define FE_READ_SIGNAL_STRENGTH    _IOR('o', 71, __u16)
-#define FE_READ_SNR               _IOR('o', 72, __u16)
-#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)
-
-#define FE_SET_FRONTEND                   _IOW('o', 76, struct dvb_frontend_parameters)
-#define FE_GET_FRONTEND                   _IOR('o', 77, struct dvb_frontend_parameters)
-#define FE_SET_FRONTEND_TUNE_MODE  _IO('o', 81) /* unsigned int */
-#define FE_GET_EVENT              _IOR('o', 78, struct dvb_frontend_event)
-
-#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
-
-#endif /*_DVBFRONTEND_H_*/
diff --git a/include/linux/dvb/net.h b/include/linux/dvb/net.h
deleted file mode 100644 (file)
index f451e7e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * net.h
- *
- * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
- *                  & Ralph  Metzler <ralph@convergence.de>
- *                    for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- */
-
-#ifndef _DVBNET_H_
-#define _DVBNET_H_
-
-#include <linux/types.h>
-
-struct dvb_net_if {
-       __u16 pid;
-       __u16 if_num;
-       __u8  feedtype;
-#define DVB_NET_FEEDTYPE_MPE 0 /* multi protocol encapsulation */
-#define DVB_NET_FEEDTYPE_ULE 1 /* ultra lightweight encapsulation */
-};
-
-
-#define NET_ADD_IF    _IOWR('o', 52, struct dvb_net_if)
-#define NET_REMOVE_IF _IO('o', 53)
-#define NET_GET_IF    _IOWR('o', 54, struct dvb_net_if)
-
-
-/* binary compatibility cruft: */
-struct __dvb_net_if_old {
-       __u16 pid;
-       __u16 if_num;
-};
-#define __NET_ADD_IF_OLD _IOWR('o', 52, struct __dvb_net_if_old)
-#define __NET_GET_IF_OLD _IOWR('o', 54, struct __dvb_net_if_old)
-
-
-#endif /*_DVBNET_H_*/
diff --git a/include/linux/dvb/osd.h b/include/linux/dvb/osd.h
deleted file mode 100644 (file)
index 880e684..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * osd.h
- *
- * Copyright (C) 2001 Ralph  Metzler <ralph@convergence.de>
- *                  & Marcus Metzler <marcus@convergence.de>
- *                    for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Lesser Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- */
-
-#ifndef _DVBOSD_H_
-#define _DVBOSD_H_
-
-#include <linux/compiler.h>
-
-typedef enum {
-  // All functions return -2 on "not open"
-  OSD_Close=1,    // ()
-  // Disables OSD and releases the buffers
-  // returns 0 on success
-  OSD_Open,       // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0))
-  // Opens OSD with this size and bit depth
-  // returns 0 on success, -1 on DRAM allocation error, -2 on "already open"
-  OSD_Show,       // ()
-  // enables OSD mode
-  // returns 0 on success
-  OSD_Hide,       // ()
-  // disables OSD mode
-  // returns 0 on success
-  OSD_Clear,      // ()
-  // Sets all pixel to color 0
-  // returns 0 on success
-  OSD_Fill,       // (color)
-  // Sets all pixel to color <col>
-  // returns 0 on success
-  OSD_SetColor,   // (color,R{x0},G{y0},B{x1},opacity{y1})
-  // set palette entry <num> to <r,g,b>, <mix> and <trans> apply
-  // R,G,B: 0..255
-  // R=Red, G=Green, B=Blue
-  // opacity=0:      pixel opacity 0% (only video pixel shows)
-  // opacity=1..254: pixel opacity as specified in header
-  // opacity=255:    pixel opacity 100% (only OSD pixel shows)
-  // returns 0 on success, -1 on error
-  OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data)
-  // Set a number of entries in the palette
-  // sets the entries "firstcolor" through "lastcolor" from the array "data"
-  // data has 4 byte for each color:
-  // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel
-  OSD_SetTrans,   // (transparency{color})
-  // Sets transparency of mixed pixel (0..15)
-  // returns 0 on success
-  OSD_SetPixel,   // (x0,y0,color)
-  // sets pixel <x>,<y> to color number <col>
-  // returns 0 on success, -1 on error
-  OSD_GetPixel,   // (x0,y0)
-  // returns color number of pixel <x>,<y>,  or -1
-  OSD_SetRow,     // (x0,y0,x1,data)
-  // fills pixels x0,y through  x1,y with the content of data[]
-  // returns 0 on success, -1 on clipping all pixel (no pixel drawn)
-  OSD_SetBlock,   // (x0,y0,x1,y1,increment{color},data)
-  // fills pixels x0,y0 through  x1,y1 with the content of data[]
-  // inc contains the width of one line in the data block,
-  // inc<=0 uses blockwidth as linewidth
-  // returns 0 on success, -1 on clipping all pixel
-  OSD_FillRow,    // (x0,y0,x1,color)
-  // fills pixels x0,y through  x1,y with the color <col>
-  // returns 0 on success, -1 on clipping all pixel
-  OSD_FillBlock,  // (x0,y0,x1,y1,color)
-  // fills pixels x0,y0 through  x1,y1 with the color <col>
-  // returns 0 on success, -1 on clipping all pixel
-  OSD_Line,       // (x0,y0,x1,y1,color)
-  // draw a line from x0,y0 to x1,y1 with the color <col>
-  // returns 0 on success
-  OSD_Query,      // (x0,y0,x1,y1,xasp{color}}), yasp=11
-  // fills parameters with the picture dimensions and the pixel aspect ratio
-  // returns 0 on success
-  OSD_Test,       // ()
-  // draws a test picture. for debugging purposes only
-  // returns 0 on success
-// TODO: remove "test" in final version
-  OSD_Text,       // (x0,y0,size,color,text)
-  OSD_SetWindow, //  (x0) set window with number 0<x0<8 as current
-  OSD_MoveWindow, //  move current window to (x0, y0)
-  OSD_OpenRaw, // Open other types of OSD windows
-} OSD_Command;
-
-typedef struct osd_cmd_s {
-       OSD_Command cmd;
-       int x0;
-       int y0;
-       int x1;
-       int y1;
-       int color;
-       void __user *data;
-} osd_cmd_t;
-
-/* OSD_OpenRaw: set 'color' to desired window type */
-typedef enum {
-       OSD_BITMAP1,           /* 1 bit bitmap */
-       OSD_BITMAP2,           /* 2 bit bitmap */
-       OSD_BITMAP4,           /* 4 bit bitmap */
-       OSD_BITMAP8,           /* 8 bit bitmap */
-       OSD_BITMAP1HR,         /* 1 Bit bitmap half resolution */
-       OSD_BITMAP2HR,         /* 2 bit bitmap half resolution */
-       OSD_BITMAP4HR,         /* 4 bit bitmap half resolution */
-       OSD_BITMAP8HR,         /* 8 bit bitmap half resolution */
-       OSD_YCRCB422,          /* 4:2:2 YCRCB Graphic Display */
-       OSD_YCRCB444,          /* 4:4:4 YCRCB Graphic Display */
-       OSD_YCRCB444HR,        /* 4:4:4 YCRCB graphic half resolution */
-       OSD_VIDEOTSIZE,        /* True Size Normal MPEG Video Display */
-       OSD_VIDEOHSIZE,        /* MPEG Video Display Half Resolution */
-       OSD_VIDEOQSIZE,        /* MPEG Video Display Quarter Resolution */
-       OSD_VIDEODSIZE,        /* MPEG Video Display Double Resolution */
-       OSD_VIDEOTHSIZE,       /* True Size MPEG Video Display Half Resolution */
-       OSD_VIDEOTQSIZE,       /* True Size MPEG Video Display Quarter Resolution*/
-       OSD_VIDEOTDSIZE,       /* True Size MPEG Video Display Double Resolution */
-       OSD_VIDEONSIZE,        /* Full Size MPEG Video Display */
-       OSD_CURSOR             /* Cursor */
-} osd_raw_window_t;
-
-typedef struct osd_cap_s {
-       int  cmd;
-#define OSD_CAP_MEMSIZE         1  /* memory size */
-       long val;
-} osd_cap_t;
-
-
-#define OSD_SEND_CMD            _IOW('o', 160, osd_cmd_t)
-#define OSD_GET_CAPABILITY      _IOR('o', 161, osd_cap_t)
-
-#endif
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h
deleted file mode 100644 (file)
index 827cce7..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * version.h
- *
- * Copyright (C) 2000 Holger Waechtler <holger@convergence.de>
- *                    for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- */
-
-#ifndef _DVBVERSION_H_
-#define _DVBVERSION_H_
-
-#define DVB_API_VERSION 5
-#define DVB_API_VERSION_MINOR 9
-
-#endif /*_DVBVERSION_H_*/
index 1d750c0fd86e1622505c4761fef63ec383b4dba9..85c20d925696d56c33ad2f7683b919ab2b3ff7df 100644 (file)
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
  */
-
 #ifndef _DVBVIDEO_H_
 #define _DVBVIDEO_H_
 
-#include <linux/types.h>
-#ifdef __KERNEL__
 #include <linux/compiler.h>
-#else
-#include <stdint.h>
-#include <time.h>
-#endif
-
-typedef enum {
-       VIDEO_FORMAT_4_3,     /* Select 4:3 format */
-       VIDEO_FORMAT_16_9,    /* Select 16:9 format. */
-       VIDEO_FORMAT_221_1    /* 2.21:1 */
-} video_format_t;
-
-
-typedef enum {
-        VIDEO_SYSTEM_PAL,
-        VIDEO_SYSTEM_NTSC,
-        VIDEO_SYSTEM_PALN,
-        VIDEO_SYSTEM_PALNc,
-        VIDEO_SYSTEM_PALM,
-        VIDEO_SYSTEM_NTSC60,
-        VIDEO_SYSTEM_PAL60,
-        VIDEO_SYSTEM_PALM60
-} video_system_t;
-
-
-typedef enum {
-       VIDEO_PAN_SCAN,       /* use pan and scan format */
-       VIDEO_LETTER_BOX,     /* use letterbox format */
-       VIDEO_CENTER_CUT_OUT  /* use center cut out format */
-} video_displayformat_t;
-
-typedef struct {
-       int w;
-       int h;
-       video_format_t aspect_ratio;
-} video_size_t;
-
-typedef enum {
-       VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */
-       VIDEO_SOURCE_MEMORY /* If this source is selected, the stream
-                              comes from the user through the write
-                              system call */
-} video_stream_source_t;
-
-
-typedef enum {
-       VIDEO_STOPPED, /* Video is stopped */
-       VIDEO_PLAYING, /* Video is currently playing */
-       VIDEO_FREEZED  /* Video is freezed */
-} video_play_state_t;
-
-
-/* Decoder commands */
-#define VIDEO_CMD_PLAY        (0)
-#define VIDEO_CMD_STOP        (1)
-#define VIDEO_CMD_FREEZE      (2)
-#define VIDEO_CMD_CONTINUE    (3)
-
-/* Flags for VIDEO_CMD_FREEZE */
-#define VIDEO_CMD_FREEZE_TO_BLACK      (1 << 0)
-
-/* Flags for VIDEO_CMD_STOP */
-#define VIDEO_CMD_STOP_TO_BLACK        (1 << 0)
-#define VIDEO_CMD_STOP_IMMEDIATELY             (1 << 1)
-
-/* Play input formats: */
-/* The decoder has no special format requirements */
-#define VIDEO_PLAY_FMT_NONE         (0)
-/* The decoder requires full GOPs */
-#define VIDEO_PLAY_FMT_GOP          (1)
-
-/* The structure must be zeroed before use by the application
-   This ensures it can be extended safely in the future. */
-struct video_command {
-       __u32 cmd;
-       __u32 flags;
-       union {
-               struct {
-                       __u64 pts;
-               } stop;
-
-               struct {
-                       /* 0 or 1000 specifies normal speed,
-                          1 specifies forward single stepping,
-                          -1 specifies backward single stepping,
-                          >1: playback at speed/1000 of the normal speed,
-                          <-1: reverse playback at (-speed/1000) of the normal speed. */
-                       __s32 speed;
-                       __u32 format;
-               } play;
-
-               struct {
-                       __u32 data[16];
-               } raw;
-       };
-};
-
-/* FIELD_UNKNOWN can be used if the hardware does not know whether
-   the Vsync is for an odd, even or progressive (i.e. non-interlaced)
-   field. */
-#define VIDEO_VSYNC_FIELD_UNKNOWN      (0)
-#define VIDEO_VSYNC_FIELD_ODD          (1)
-#define VIDEO_VSYNC_FIELD_EVEN         (2)
-#define VIDEO_VSYNC_FIELD_PROGRESSIVE  (3)
-
-struct video_event {
-       __s32 type;
-#define VIDEO_EVENT_SIZE_CHANGED       1
-#define VIDEO_EVENT_FRAME_RATE_CHANGED 2
-#define VIDEO_EVENT_DECODER_STOPPED    3
-#define VIDEO_EVENT_VSYNC              4
-       __kernel_time_t timestamp;
-       union {
-               video_size_t size;
-               unsigned int frame_rate;        /* in frames per 1000sec */
-               unsigned char vsync_field;      /* unknown/odd/even/progressive */
-       } u;
-};
-
-
-struct video_status {
-       int                   video_blank;   /* blank video on freeze? */
-       video_play_state_t    play_state;    /* current state of playback */
-       video_stream_source_t stream_source; /* current source (demux/memory) */
-       video_format_t        video_format;  /* current aspect ratio of stream*/
-       video_displayformat_t display_format;/* selected cropping mode */
-};
-
-
-struct video_still_picture {
-       char __user *iFrame;        /* pointer to a single iframe in memory */
-       __s32 size;
-};
-
-
-typedef
-struct video_highlight {
-       int     active;      /*    1=show highlight, 0=hide highlight */
-       __u8    contrast1;   /*    7- 4  Pattern pixel contrast */
-                            /*    3- 0  Background pixel contrast */
-       __u8    contrast2;   /*    7- 4  Emphasis pixel-2 contrast */
-                            /*    3- 0  Emphasis pixel-1 contrast */
-       __u8    color1;      /*    7- 4  Pattern pixel color */
-                            /*    3- 0  Background pixel color */
-       __u8    color2;      /*    7- 4  Emphasis pixel-2 color */
-                            /*    3- 0  Emphasis pixel-1 color */
-       __u32    ypos;       /*   23-22  auto action mode */
-                            /*   21-12  start y */
-                            /*    9- 0  end y */
-       __u32    xpos;       /*   23-22  button color number */
-                            /*   21-12  start x */
-                            /*    9- 0  end x */
-} video_highlight_t;
-
-
-typedef struct video_spu {
-       int active;
-       int stream_id;
-} video_spu_t;
-
-
-typedef struct video_spu_palette {      /* SPU Palette information */
-       int length;
-       __u8 __user *palette;
-} video_spu_palette_t;
-
-
-typedef struct video_navi_pack {
-       int length;          /* 0 ... 1024 */
-       __u8 data[1024];
-} video_navi_pack_t;
-
-
-typedef __u16 video_attributes_t;
-/*   bits: descr. */
-/*   15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */
-/*   13-12 TV system (0=525/60, 1=625/50) */
-/*   11-10 Aspect ratio (0=4:3, 3=16:9) */
-/*    9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */
-/*    7    line 21-1 data present in GOP (1=yes, 0=no) */
-/*    6    line 21-2 data present in GOP (1=yes, 0=no) */
-/*    5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */
-/*    2    source letterboxed (1=yes, 0=no) */
-/*    0    film/camera mode (0=camera, 1=film (625/50 only)) */
-
-
-/* bit definitions for capabilities: */
-/* can the hardware decode MPEG1 and/or MPEG2? */
-#define VIDEO_CAP_MPEG1   1
-#define VIDEO_CAP_MPEG2   2
-/* can you send a system and/or program stream to video device?
-   (you still have to open the video and the audio device but only
-    send the stream to the video device) */
-#define VIDEO_CAP_SYS     4
-#define VIDEO_CAP_PROG    8
-/* can the driver also handle SPU, NAVI and CSS encoded data?
-   (CSS API is not present yet) */
-#define VIDEO_CAP_SPU    16
-#define VIDEO_CAP_NAVI   32
-#define VIDEO_CAP_CSS    64
-
-
-#define VIDEO_STOP                 _IO('o', 21)
-#define VIDEO_PLAY                 _IO('o', 22)
-#define VIDEO_FREEZE               _IO('o', 23)
-#define VIDEO_CONTINUE             _IO('o', 24)
-#define VIDEO_SELECT_SOURCE        _IO('o', 25)
-#define VIDEO_SET_BLANK            _IO('o', 26)
-#define VIDEO_GET_STATUS           _IOR('o', 27, struct video_status)
-#define VIDEO_GET_EVENT            _IOR('o', 28, struct video_event)
-#define VIDEO_SET_DISPLAY_FORMAT   _IO('o', 29)
-#define VIDEO_STILLPICTURE         _IOW('o', 30, struct video_still_picture)
-#define VIDEO_FAST_FORWARD         _IO('o', 31)
-#define VIDEO_SLOWMOTION           _IO('o', 32)
-#define VIDEO_GET_CAPABILITIES     _IOR('o', 33, unsigned int)
-#define VIDEO_CLEAR_BUFFER         _IO('o',  34)
-#define VIDEO_SET_ID               _IO('o', 35)
-#define VIDEO_SET_STREAMTYPE       _IO('o', 36)
-#define VIDEO_SET_FORMAT           _IO('o', 37)
-#define VIDEO_SET_SYSTEM           _IO('o', 38)
-#define VIDEO_SET_HIGHLIGHT        _IOW('o', 39, video_highlight_t)
-#define VIDEO_SET_SPU              _IOW('o', 50, video_spu_t)
-#define VIDEO_SET_SPU_PALETTE      _IOW('o', 51, video_spu_palette_t)
-#define VIDEO_GET_NAVI             _IOR('o', 52, video_navi_pack_t)
-#define VIDEO_SET_ATTRIBUTES       _IO('o', 53)
-#define VIDEO_GET_SIZE             _IOR('o', 55, video_size_t)
-#define VIDEO_GET_FRAME_RATE       _IOR('o', 56, unsigned int)
-
-/**
- * VIDEO_GET_PTS
- *
- * Read the 33 bit presentation time stamp as defined
- * in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
- *
- * The PTS should belong to the currently played
- * frame if possible, but may also be a value close to it
- * like the PTS of the last decoded frame or the last PTS
- * extracted by the PES parser.
- */
-#define VIDEO_GET_PTS              _IOR('o', 57, __u64)
-
-/* Read the number of displayed frames since the decoder was started */
-#define VIDEO_GET_FRAME_COUNT             _IOR('o', 58, __u64)
-
-#define VIDEO_COMMAND             _IOWR('o', 59, struct video_command)
-#define VIDEO_TRY_COMMAND         _IOWR('o', 60, struct video_command)
+#include <uapi/linux/dvb/video.h>
 
 #endif /*_DVBVIDEO_H_*/
diff --git a/include/linux/elf-fdpic.h b/include/linux/elf-fdpic.h
new file mode 100644 (file)
index 0000000..3864403
--- /dev/null
@@ -0,0 +1,51 @@
+/* FDPIC ELF load map
+ *
+ * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_ELF_FDPIC_H
+#define _LINUX_ELF_FDPIC_H
+
+#include <uapi/linux/elf-fdpic.h>
+
+/*
+ * binfmt binary parameters structure
+ */
+struct elf_fdpic_params {
+       struct elfhdr                   hdr;            /* ref copy of ELF header */
+       struct elf_phdr                 *phdrs;         /* ref copy of PT_PHDR table */
+       struct elf32_fdpic_loadmap      *loadmap;       /* loadmap to be passed to userspace */
+       unsigned long                   elfhdr_addr;    /* mapped ELF header user address */
+       unsigned long                   ph_addr;        /* mapped PT_PHDR user address */
+       unsigned long                   map_addr;       /* mapped loadmap user address */
+       unsigned long                   entry_addr;     /* mapped entry user address */
+       unsigned long                   stack_size;     /* stack size requested (PT_GNU_STACK) */
+       unsigned long                   dynamic_addr;   /* mapped PT_DYNAMIC user address */
+       unsigned long                   load_addr;      /* user address at which to map binary */
+       unsigned long                   flags;
+#define ELF_FDPIC_FLAG_ARRANGEMENT     0x0000000f      /* PT_LOAD arrangement flags */
+#define ELF_FDPIC_FLAG_INDEPENDENT     0x00000000      /* PT_LOADs can be put anywhere */
+#define ELF_FDPIC_FLAG_HONOURVADDR     0x00000001      /* PT_LOAD.vaddr must be honoured */
+#define ELF_FDPIC_FLAG_CONSTDISP       0x00000002      /* PT_LOADs require constant
+                                                        * displacement */
+#define ELF_FDPIC_FLAG_CONTIGUOUS      0x00000003      /* PT_LOADs should be contiguous */
+#define ELF_FDPIC_FLAG_EXEC_STACK      0x00000010      /* T if stack to be executable */
+#define ELF_FDPIC_FLAG_NOEXEC_STACK    0x00000020      /* T if stack not to be executable */
+#define ELF_FDPIC_FLAG_EXECUTABLE      0x00000040      /* T if this object is the executable */
+#define ELF_FDPIC_FLAG_PRESENT         0x80000000      /* T if this object is present */
+};
+
+#ifdef CONFIG_MMU
+extern void elf_fdpic_arch_lay_out_mm(struct elf_fdpic_params *exec_params,
+                                     struct elf_fdpic_params *interp_params,
+                                     unsigned long *start_stack,
+                                     unsigned long *start_brk);
+#endif
+
+#endif /* _LINUX_ELF_FDPIC_H */
index 001c7cff2d4826e4e54b6395596483030c86fc11..b33cfc97b9caef81de7e525c44e23c4db6a5ba18 100644 (file)
@@ -64,6 +64,73 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
                        ssize_t bytes, void *private, int ret,
                        bool is_async);
 
+#define MAY_EXEC               0x00000001
+#define MAY_WRITE              0x00000002
+#define MAY_READ               0x00000004
+#define MAY_APPEND             0x00000008
+#define MAY_ACCESS             0x00000010
+#define MAY_OPEN               0x00000020
+#define MAY_CHDIR              0x00000040
+/* called from RCU mode, don't block */
+#define MAY_NOT_BLOCK          0x00000080
+
+/*
+ * flags in file.f_mode.  Note that FMODE_READ and FMODE_WRITE must correspond
+ * to O_WRONLY and O_RDWR via the strange trick in __dentry_open()
+ */
+
+/* file is open for reading */
+#define FMODE_READ             ((__force fmode_t)0x1)
+/* file is open for writing */
+#define FMODE_WRITE            ((__force fmode_t)0x2)
+/* file is seekable */
+#define FMODE_LSEEK            ((__force fmode_t)0x4)
+/* file can be accessed using pread */
+#define FMODE_PREAD            ((__force fmode_t)0x8)
+/* file can be accessed using pwrite */
+#define FMODE_PWRITE           ((__force fmode_t)0x10)
+/* File is opened for execution with sys_execve / sys_uselib */
+#define FMODE_EXEC             ((__force fmode_t)0x20)
+/* File is opened with O_NDELAY (only set for block devices) */
+#define FMODE_NDELAY           ((__force fmode_t)0x40)
+/* File is opened with O_EXCL (only set for block devices) */
+#define FMODE_EXCL             ((__force fmode_t)0x80)
+/* File is opened using open(.., 3, ..) and is writeable only for ioctls
+   (specialy hack for floppy.c) */
+#define FMODE_WRITE_IOCTL      ((__force fmode_t)0x100)
+/* 32bit hashes as llseek() offset (for directories) */
+#define FMODE_32BITHASH         ((__force fmode_t)0x200)
+/* 64bit hashes as llseek() offset (for directories) */
+#define FMODE_64BITHASH         ((__force fmode_t)0x400)
+
+/*
+ * Don't update ctime and mtime.
+ *
+ * Currently a special hack for the XFS open_by_handle ioctl, but we'll
+ * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon.
+ */
+#define FMODE_NOCMTIME         ((__force fmode_t)0x800)
+
+/* Expect random access pattern */
+#define FMODE_RANDOM           ((__force fmode_t)0x1000)
+
+/* File is huge (eg. /dev/kmem): treat loff_t as unsigned */
+#define FMODE_UNSIGNED_OFFSET  ((__force fmode_t)0x2000)
+
+/* File is opened with O_PATH; almost nothing can be done with it */
+#define FMODE_PATH             ((__force fmode_t)0x4000)
+
+/* File was opened by fanotify and shouldn't generate fanotify events */
+#define FMODE_NONOTIFY         ((__force fmode_t)0x1000000)
+
+/*
+ * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector
+ * that indicates that they should check the contents of the iovec are
+ * valid, but not check the memory that the iovec elements
+ * points too.
+ */
+#define CHECK_IOVEC_ONLY -1
+
 /*
  * The below are the various read and write types that we support. Some of
  * them include behavioral modifiers that send information down to the
@@ -1556,6 +1623,60 @@ struct super_operations {
        void (*free_cached_objects)(struct super_block *, int);
 };
 
+/*
+ * Inode flags - they have no relation to superblock flags now
+ */
+#define S_SYNC         1       /* Writes are synced at once */
+#define S_NOATIME      2       /* Do not update access times */
+#define S_APPEND       4       /* Append-only file */
+#define S_IMMUTABLE    8       /* Immutable file */
+#define S_DEAD         16      /* removed, but still open directory */
+#define S_NOQUOTA      32      /* Inode is not counted to quota */
+#define S_DIRSYNC      64      /* Directory modifications are synchronous */
+#define S_NOCMTIME     128     /* Do not update file c/mtime */
+#define S_SWAPFILE     256     /* Do not truncate: swapon got its bmaps */
+#define S_PRIVATE      512     /* Inode is fs-internal */
+#define S_IMA          1024    /* Inode has an associated IMA struct */
+#define S_AUTOMOUNT    2048    /* Automount/referral quasi-directory */
+#define S_NOSEC                4096    /* no suid or xattr security attributes */
+
+/*
+ * Note that nosuid etc flags are inode-specific: setting some file-system
+ * flags just means all the inodes inherit those flags by default. It might be
+ * possible to override it selectively if you really wanted to with some
+ * ioctl() that is not currently implemented.
+ *
+ * Exception: MS_RDONLY is always applied to the entire file system.
+ *
+ * Unfortunately, it is possible to change a filesystems flags with it mounted
+ * with files in use.  This means that all of the inodes will not have their
+ * i_flags updated.  Hence, i_flags no longer inherit the superblock mount
+ * flags, so these have to be checked separately. -- rmk@arm.uk.linux.org
+ */
+#define __IS_FLG(inode, flg)   ((inode)->i_sb->s_flags & (flg))
+
+#define IS_RDONLY(inode)       ((inode)->i_sb->s_flags & MS_RDONLY)
+#define IS_SYNC(inode)         (__IS_FLG(inode, MS_SYNCHRONOUS) || \
+                                       ((inode)->i_flags & S_SYNC))
+#define IS_DIRSYNC(inode)      (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \
+                                       ((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
+#define IS_MANDLOCK(inode)     __IS_FLG(inode, MS_MANDLOCK)
+#define IS_NOATIME(inode)      __IS_FLG(inode, MS_RDONLY|MS_NOATIME)
+#define IS_I_VERSION(inode)    __IS_FLG(inode, MS_I_VERSION)
+
+#define IS_NOQUOTA(inode)      ((inode)->i_flags & S_NOQUOTA)
+#define IS_APPEND(inode)       ((inode)->i_flags & S_APPEND)
+#define IS_IMMUTABLE(inode)    ((inode)->i_flags & S_IMMUTABLE)
+#define IS_POSIXACL(inode)     __IS_FLG(inode, MS_POSIXACL)
+
+#define IS_DEADDIR(inode)      ((inode)->i_flags & S_DEAD)
+#define IS_NOCMTIME(inode)     ((inode)->i_flags & S_NOCMTIME)
+#define IS_SWAPFILE(inode)     ((inode)->i_flags & S_SWAPFILE)
+#define IS_PRIVATE(inode)      ((inode)->i_flags & S_PRIVATE)
+#define IS_IMA(inode)          ((inode)->i_flags & S_IMA)
+#define IS_AUTOMOUNT(inode)    ((inode)->i_flags & S_AUTOMOUNT)
+#define IS_NOSEC(inode)                ((inode)->i_flags & S_NOSEC)
+
 /*
  * Inode state bits.  Protected by inode->i_lock
  *
@@ -1688,6 +1809,11 @@ int sync_inode_metadata(struct inode *inode, int wait);
 struct file_system_type {
        const char *name;
        int fs_flags;
+#define FS_REQUIRES_DEV                1 
+#define FS_BINARY_MOUNTDATA    2
+#define FS_HAS_SUBTYPE         4
+#define FS_REVAL_DOT           16384   /* Check the paths ".", ".." for staleness */
+#define FS_RENAME_DOES_D_MOVE  32768   /* FS will handle d_move() during rename() internally. */
        struct dentry *(*mount) (struct file_system_type *, int,
                       const char *, void *);
        void (*kill_sb) (struct super_block *);
index 271a770b47843934075c64ed8893144a0fd570d7..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-header-y += hsi_char.h
diff --git a/include/linux/hsi/hsi_char.h b/include/linux/hsi/hsi_char.h
deleted file mode 100644 (file)
index 76160b4..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Part of the HSI character device driver.
- *
- * Copyright (C) 2010 Nokia Corporation. All rights reserved.
- *
- * Contact: Andras Domokos <andras.domokos at nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- */
-
-
-#ifndef __HSI_CHAR_H
-#define __HSI_CHAR_H
-
-#define HSI_CHAR_MAGIC         'k'
-#define HSC_IOW(num, dtype)    _IOW(HSI_CHAR_MAGIC, num, dtype)
-#define HSC_IOR(num, dtype)    _IOR(HSI_CHAR_MAGIC, num, dtype)
-#define HSC_IOWR(num, dtype)   _IOWR(HSI_CHAR_MAGIC, num, dtype)
-#define HSC_IO(num)            _IO(HSI_CHAR_MAGIC, num)
-
-#define HSC_RESET              HSC_IO(16)
-#define HSC_SET_PM             HSC_IO(17)
-#define HSC_SEND_BREAK         HSC_IO(18)
-#define HSC_SET_RX             HSC_IOW(19, struct hsc_rx_config)
-#define HSC_GET_RX             HSC_IOW(20, struct hsc_rx_config)
-#define HSC_SET_TX             HSC_IOW(21, struct hsc_tx_config)
-#define HSC_GET_TX             HSC_IOW(22, struct hsc_tx_config)
-
-#define HSC_PM_DISABLE         0
-#define HSC_PM_ENABLE          1
-
-#define HSC_MODE_STREAM                1
-#define HSC_MODE_FRAME         2
-#define HSC_FLOW_SYNC          0
-#define HSC_ARB_RR             0
-#define HSC_ARB_PRIO           1
-
-struct hsc_rx_config {
-       uint32_t mode;
-       uint32_t flow;
-       uint32_t channels;
-};
-
-struct hsc_tx_config {
-       uint32_t mode;
-       uint32_t channels;
-       uint32_t speed;
-       uint32_t arb_mode;
-};
-
-#endif /* __HSI_CHAR_H */
diff --git a/include/linux/isdn/Kbuild b/include/linux/isdn/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/include/linux/mmc/Kbuild b/include/linux/mmc/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
deleted file mode 100644 (file)
index b332202..0000000
+++ /dev/null
@@ -1 +0,0 @@
-header-y += ipset/
diff --git a/include/linux/netfilter/ipset/Kbuild b/include/linux/netfilter/ipset/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/include/linux/netfilter_arp/Kbuild b/include/linux/netfilter_arp/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/include/linux/netfilter_bridge/Kbuild b/include/linux/netfilter_bridge/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/include/linux/netfilter_ipv6/Kbuild b/include/linux/netfilter_ipv6/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/include/linux/nfsd/Kbuild b/include/linux/nfsd/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
index 72843b72a2b2619a5343be071d1ad104a9cb75af..b4e50d56fc7440b1b1d03849e33b77acf7ee41b6 100644 (file)
@@ -331,6 +331,13 @@ static inline bool of_have_populated_dt(void)
 #define for_each_child_of_node(parent, child) \
        while (0)
 
+static inline struct device_node *of_get_child_by_name(
+                                       const struct device_node *node,
+                                       const char *name)
+{
+       return NULL;
+}
+
 static inline int of_get_child_count(const struct device_node *np)
 {
        return 0;
index c3cdc1025c30694eee350d9cd62609e4db40de02..a1984dd037da8c13d11a18336fdff331c356fc97 100644 (file)
@@ -19,7 +19,7 @@ extern void __iomem *of_iomap(struct device_node *device, int index);
  * the address space flags too. The PCI version uses a BAR number
  * instead of an absolute index
  */
-extern const u32 *of_get_address(struct device_node *dev, int index,
+extern const __be32 *of_get_address(struct device_node *dev, int index,
                           u64 *size, unsigned int *flags);
 
 #ifndef pci_address_to_pio
@@ -44,7 +44,7 @@ static inline void __iomem *of_iomap(struct device_node *device, int index)
 {
        return NULL;
 }
-static inline const u32 *of_get_address(struct device_node *dev, int index,
+static inline const __be32 *of_get_address(struct device_node *dev, int index,
                                        u64 *size, unsigned int *flags)
 {
        return NULL;
index b8e241125201d6a4ed29bfb30fded26e5d711654..535cecf1e02f7823a1ec3f416c3b06382ea6d8fa 100644 (file)
@@ -58,8 +58,8 @@ static inline int of_irq_map_oldworld(struct device_node *device, int index,
 #endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */
 
 
-extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec,
-                         u32 ointsize, const u32 *addr,
+extern int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
+                         u32 ointsize, const __be32 *addr,
                          struct of_irq *out_irq);
 extern int of_irq_map_one(struct device_node *device, int index,
                          struct of_irq *out_irq);
index 00474b047145ed1f54f3003fe597873a4665cc48..65e3e87eacc59aab1d95a8bd1a14a2e61f29c1f3 100644 (file)
@@ -47,15 +47,9 @@ static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns)
 }
 
 extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns);
-extern void free_pid_ns(struct kref *kref);
 extern void zap_pid_ns_processes(struct pid_namespace *pid_ns);
 extern int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd);
-
-static inline void put_pid_ns(struct pid_namespace *ns)
-{
-       if (ns != &init_pid_ns)
-               kref_put(&ns->kref, free_pid_ns);
-}
+extern void put_pid_ns(struct pid_namespace *ns);
 
 #else /* !CONFIG_PID_NS */
 #include <linux/err.h>
diff --git a/include/linux/platform_data/leds-omap.h b/include/linux/platform_data/leds-omap.h
new file mode 100644 (file)
index 0000000..56c9b2a
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ *  Copyright (C) 2006 Samsung Electronics
+ *  Kyungmin Park <kyungmin.park@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef ASMARM_ARCH_LED_H
+#define ASMARM_ARCH_LED_H
+
+struct omap_led_config {
+       struct led_classdev     cdev;
+       s16                     gpio;
+};
+
+struct omap_led_platform_data {
+       s16                     nr_leds;
+       struct omap_led_config  *leds;
+};
+
+#endif
diff --git a/include/linux/platform_data/mmc-omap.h b/include/linux/platform_data/mmc-omap.h
new file mode 100644 (file)
index 0000000..2bf6ea8
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * MMC definitions for OMAP2
+ *
+ * Copyright (C) 2006 Nokia Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#define OMAP_MMC_MAX_SLOTS     2
+
+/*
+ * struct omap_mmc_dev_attr.flags possibilities
+ *
+ * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can
+ *    operate with either 1.8Vdc or 3.0Vdc card voltages; this flag
+ *    should be set if this is the case.  See for example Section 22.5.3
+ *    "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia
+ *    Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R).
+ *
+ * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers
+ *    don't work correctly on some MMC controller instances on some
+ *    OMAP3 SoCs; this flag should be set if this is the case.  See
+ *    for example Advisory 2.1.1.128 "MMC: Multiple Block Read
+ *    Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_
+ *    Revision F (October 2010) (SPRZ278F).
+ */
+#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT          BIT(0)
+#define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ      BIT(1)
+
+struct mmc_card;
+
+struct omap_mmc_dev_attr {
+       u8 flags;
+};
+
+struct omap_mmc_platform_data {
+       /* back-link to device */
+       struct device *dev;
+
+       /* number of slots per controller */
+       unsigned nr_slots:2;
+
+       /* set if your board has components or wiring that limits the
+        * maximum frequency on the MMC bus */
+       unsigned int max_freq;
+
+       /* switch the bus to a new slot */
+       int (*switch_slot)(struct device *dev, int slot);
+       /* initialize board-specific MMC functionality, can be NULL if
+        * not supported */
+       int (*init)(struct device *dev);
+       void (*cleanup)(struct device *dev);
+       void (*shutdown)(struct device *dev);
+
+       /* To handle board related suspend/resume functionality for MMC */
+       int (*suspend)(struct device *dev, int slot);
+       int (*resume)(struct device *dev, int slot);
+
+       /* Return context loss count due to PM states changing */
+       int (*get_context_loss_count)(struct device *dev);
+
+       /* Integrating attributes from the omap_hwmod layer */
+       u8 controller_flags;
+
+       /* Register offset deviation */
+       u16 reg_offset;
+
+       struct omap_mmc_slot_data {
+
+               /*
+                * 4/8 wires and any additional host capabilities
+                * need to OR'd all capabilities (ref. linux/mmc/host.h)
+                */
+               u8  wires;      /* Used for the MMC driver on omap1 and 2420 */
+               u32 caps;       /* Used for the MMC driver on 2430 and later */
+               u32 pm_caps;    /* PM capabilities of the mmc */
+
+               /*
+                * nomux means "standard" muxing is wrong on this board, and
+                * that board-specific code handled it before common init logic.
+                */
+               unsigned nomux:1;
+
+               /* switch pin can be for card detect (default) or card cover */
+               unsigned cover:1;
+
+               /* use the internal clock */
+               unsigned internal_clock:1;
+
+               /* nonremovable e.g. eMMC */
+               unsigned nonremovable:1;
+
+               /* Try to sleep or power off when possible */
+               unsigned power_saving:1;
+
+               /* If using power_saving and the MMC power is not to go off */
+               unsigned no_off:1;
+
+               /* eMMC does not handle power off when not in sleep state */
+               unsigned no_regulator_off_init:1;
+
+               /* Regulator off remapped to sleep */
+               unsigned vcc_aux_disable_is_sleep:1;
+
+               /* we can put the features above into this variable */
+#define HSMMC_HAS_PBIAS                (1 << 0)
+#define HSMMC_HAS_UPDATED_RESET        (1 << 1)
+#define MMC_OMAP7XX            (1 << 2)
+#define MMC_OMAP15XX           (1 << 3)
+#define MMC_OMAP16XX           (1 << 4)
+               unsigned features;
+
+               int switch_pin;                 /* gpio (card detect) */
+               int gpio_wp;                    /* gpio (write protect) */
+
+               int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
+               int (*set_power)(struct device *dev, int slot,
+                                int power_on, int vdd);
+               int (*get_ro)(struct device *dev, int slot);
+               void (*remux)(struct device *dev, int slot, int power_on);
+               /* Call back before enabling / disabling regulators */
+               void (*before_set_reg)(struct device *dev, int slot,
+                                      int power_on, int vdd);
+               /* Call back after enabling / disabling regulators */
+               void (*after_set_reg)(struct device *dev, int slot,
+                                     int power_on, int vdd);
+               /* if we have special card, init it using this callback */
+               void (*init_card)(struct mmc_card *card);
+
+               /* return MMC cover switch state, can be NULL if not supported.
+                *
+                * possible return values:
+                *   0 - closed
+                *   1 - open
+                */
+               int (*get_cover_state)(struct device *dev, int slot);
+
+               const char *name;
+               u32 ocr_mask;
+
+               /* Card detection IRQs */
+               int card_detect_irq;
+               int (*card_detect)(struct device *dev, int slot);
+
+               unsigned int ban_openended:1;
+
+       } slots[OMAP_MMC_MAX_SLOTS];
+};
index 1a68c1e5fe537a0b0b52c70521ef8672ad66a4ff..24d32ca34bef0724751e350fe90a48f7faa60281 100644 (file)
@@ -8,9 +8,13 @@
  * published by the Free Software Foundation.
  */
 
-#include <plat/gpmc.h>
+#ifndef        _MTD_NAND_OMAP2_H
+#define        _MTD_NAND_OMAP2_H
+
 #include <linux/mtd/partitions.h>
 
+#define        GPMC_BCH_NUM_REMAINDER  8
+
 enum nand_io {
        NAND_OMAP_PREFETCH_POLLED = 0,  /* prefetch polled mode, default */
        NAND_OMAP_POLLED,               /* polled mode, without prefetch */
@@ -18,10 +22,38 @@ enum nand_io {
        NAND_OMAP_PREFETCH_IRQ          /* prefetch enabled irq mode */
 };
 
+enum omap_ecc {
+               /* 1-bit ecc: stored at end of spare area */
+       OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */
+       OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */
+               /* 1-bit ecc: stored at beginning of spare area as romcode */
+       OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */
+       OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */
+       OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */
+};
+
+struct gpmc_nand_regs {
+       void __iomem    *gpmc_status;
+       void __iomem    *gpmc_nand_command;
+       void __iomem    *gpmc_nand_address;
+       void __iomem    *gpmc_nand_data;
+       void __iomem    *gpmc_prefetch_config1;
+       void __iomem    *gpmc_prefetch_config2;
+       void __iomem    *gpmc_prefetch_control;
+       void __iomem    *gpmc_prefetch_status;
+       void __iomem    *gpmc_ecc_config;
+       void __iomem    *gpmc_ecc_control;
+       void __iomem    *gpmc_ecc_size_config;
+       void __iomem    *gpmc_ecc1_result;
+       void __iomem    *gpmc_bch_result0[GPMC_BCH_NUM_REMAINDER];
+       void __iomem    *gpmc_bch_result1[GPMC_BCH_NUM_REMAINDER];
+       void __iomem    *gpmc_bch_result2[GPMC_BCH_NUM_REMAINDER];
+       void __iomem    *gpmc_bch_result3[GPMC_BCH_NUM_REMAINDER];
+};
+
 struct omap_nand_platform_data {
        int                     cs;
        struct mtd_partition    *parts;
-       struct gpmc_timings     *gpmc_t;
        int                     nr_parts;
        bool                    dev_ready;
        enum nand_io            xfer_type;
@@ -30,14 +62,4 @@ struct omap_nand_platform_data {
        struct gpmc_nand_regs   reg;
 };
 
-/* minimum size for IO mapping */
-#define        NAND_IO_SIZE    4
-
-#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
-extern int gpmc_nand_init(struct omap_nand_platform_data *d);
-#else
-static inline int gpmc_nand_init(struct omap_nand_platform_data *d)
-{
-       return 0;
-}
 #endif
index 2858667d2e4f7505502c5e3a8317ff0bdfb4fbe6..685af7e8b12076d3e295f3136207e8189dc56e41 100644 (file)
@@ -9,17 +9,15 @@
  * published by the Free Software Foundation.
  */
 
+#ifndef        __MTD_ONENAND_OMAP2_H
+#define        __MTD_ONENAND_OMAP2_H
+
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 
 #define ONENAND_SYNC_READ      (1 << 0)
 #define ONENAND_SYNC_READWRITE (1 << 1)
-
-struct onenand_freq_info {
-       u16                     maf_id;
-       u16                     dev_id;
-       u16                     ver_id;
-};
+#define        ONENAND_IN_OMAP34XX     (1 << 2)
 
 struct omap_onenand_platform_data {
        int                     cs;
@@ -27,27 +25,9 @@ struct omap_onenand_platform_data {
        struct mtd_partition    *parts;
        int                     nr_parts;
        int                     (*onenand_setup)(void __iomem *, int *freq_ptr);
-       int             (*get_freq)(const struct onenand_freq_info *freq_info,
-                                   bool *clk_dep);
        int                     dma_channel;
        u8                      flags;
        u8                      regulator_can_sleep;
        u8                      skip_initial_unlocking;
 };
-
-#define ONENAND_MAX_PARTITIONS 8
-
-#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
-       defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
-
-extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
-
-#else
-
-#define board_onenand_data     NULL
-
-static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
-{
-}
-
 #endif
diff --git a/include/linux/platform_data/usb-omap.h b/include/linux/platform_data/usb-omap.h
new file mode 100644 (file)
index 0000000..8570bcf
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * usb-omap.h - Platform data for the various OMAP USB IPs
+ *
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com
+ *
+ * This software is distributed under the terms of the GNU General Public
+ * License ("GPL") version 2, as published by the Free Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define OMAP3_HS_USB_PORTS     3
+
+enum usbhs_omap_port_mode {
+       OMAP_USBHS_PORT_MODE_UNUSED,
+       OMAP_EHCI_PORT_MODE_PHY,
+       OMAP_EHCI_PORT_MODE_TLL,
+       OMAP_EHCI_PORT_MODE_HSIC,
+       OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0,
+       OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM,
+       OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0,
+       OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
+       OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0,
+       OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM,
+       OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0,
+       OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM,
+       OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0,
+       OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM
+};
+
+struct usbtll_omap_platform_data {
+       enum usbhs_omap_port_mode               port_mode[OMAP3_HS_USB_PORTS];
+};
+
+struct ehci_hcd_omap_platform_data {
+       enum usbhs_omap_port_mode       port_mode[OMAP3_HS_USB_PORTS];
+       int                             reset_gpio_port[OMAP3_HS_USB_PORTS];
+       struct regulator                *regulator[OMAP3_HS_USB_PORTS];
+       unsigned                        phy_reset:1;
+};
+
+struct ohci_hcd_omap_platform_data {
+       enum usbhs_omap_port_mode       port_mode[OMAP3_HS_USB_PORTS];
+       unsigned                        es2_compatibility:1;
+};
+
+struct usbhs_omap_platform_data {
+       enum usbhs_omap_port_mode               port_mode[OMAP3_HS_USB_PORTS];
+
+       struct ehci_hcd_omap_platform_data      *ehci_data;
+       struct ohci_hcd_omap_platform_data      *ohci_data;
+};
+
+/*-------------------------------------------------------------------------*/
+
+struct omap_musb_board_data {
+       u8      interface_type;
+       u8      mode;
+       u16     power;
+       unsigned extvbus:1;
+       void    (*set_phy_power)(u8 on);
+       void    (*clear_irq)(void);
+       void    (*set_mode)(u8 mode);
+       void    (*reset)(void);
+};
+
+enum musb_interface {
+       MUSB_INTERFACE_ULPI,
+       MUSB_INTERFACE_UTMI
+};
index e11ccb4cf48dd5f6874322f375ce1537d007974c..0a260d8a18bf92dc3b8d4b582d3506e169d9dac5 100644 (file)
@@ -46,20 +46,17 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
 #define WARN_ON_RATELIMIT(condition, state)                    \
                WARN_ON((condition) && __ratelimit(state))
 
-#define __WARN_RATELIMIT(condition, state, format...)          \
-({                                                             \
-       int rtn = 0;                                            \
-       if (unlikely(__ratelimit(state)))                       \
-               rtn = WARN(condition, format);                  \
-       rtn;                                                    \
-})
-
-#define WARN_RATELIMIT(condition, format...)                   \
+#define WARN_RATELIMIT(condition, format, ...)                 \
 ({                                                             \
        static DEFINE_RATELIMIT_STATE(_rs,                      \
                                      DEFAULT_RATELIMIT_INTERVAL,       \
                                      DEFAULT_RATELIMIT_BURST); \
-       __WARN_RATELIMIT(condition, &_rs, format);              \
+       int rtn = !!(condition);                                \
+                                                               \
+       if (unlikely(rtn && __ratelimit(&_rs)))                 \
+               WARN(rtn, format, ##__VA_ARGS__);               \
+                                                               \
+       rtn;                                                    \
 })
 
 #else
@@ -67,15 +64,9 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
 #define WARN_ON_RATELIMIT(condition, state)                    \
        WARN_ON(condition)
 
-#define __WARN_RATELIMIT(condition, state, format...)          \
-({                                                             \
-       int rtn = WARN(condition, format);                      \
-       rtn;                                                    \
-})
-
-#define WARN_RATELIMIT(condition, format...)                   \
+#define WARN_RATELIMIT(condition, format, ...)                 \
 ({                                                             \
-       int rtn = WARN(condition, format);                      \
+       int rtn = WARN(condition, format, ##__VA_ARGS__);       \
        rtn;                                                    \
 })
 
diff --git a/include/linux/spi/Kbuild b/include/linux/spi/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/include/linux/sunrpc/Kbuild b/include/linux/sunrpc/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/include/linux/tc_act/Kbuild b/include/linux/tc_act/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/include/linux/tc_ematch/Kbuild b/include/linux/tc_ematch/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
index f0b4eb47297c8b10a356c96d929e272702a7dd7b..d7ff88fb896715ba58838fe89d329ed0821439bb 100644 (file)
@@ -188,7 +188,9 @@ struct tty_port_operations {
 };
        
 struct tty_port {
+       struct tty_bufhead      buf;            /* Locked internally */
        struct tty_struct       *tty;           /* Back pointer */
+       struct tty_struct       *itty;          /* internal back ptr */
        const struct tty_port_operations *ops;  /* Port operations */
        spinlock_t              lock;           /* Lock protecting tty field */
        int                     blocked_open;   /* Waiting to open */
@@ -197,6 +199,9 @@ struct tty_port {
        wait_queue_head_t       close_wait;     /* Close waiters */
        wait_queue_head_t       delta_msr_wait; /* Modem status change */
        unsigned long           flags;          /* TTY flags ASY_*/
+       unsigned long           iflags;         /* TTYP_ internal flags */
+#define TTYP_FLUSHING                  1  /* Flushing to ldisc in progress */
+#define TTYP_FLUSHPENDING              2  /* Queued buffer flush pending */
        unsigned char           console:1;      /* port is a console */
        struct mutex            mutex;          /* Locking */
        struct mutex            buf_mutex;      /* Buffer alloc lock */
@@ -235,6 +240,7 @@ struct tty_struct {
        struct mutex ldisc_mutex;
        struct tty_ldisc *ldisc;
 
+       struct mutex atomic_write_lock;
        struct mutex legacy_mutex;
        struct mutex termios_mutex;
        spinlock_t ctrl_lock;
@@ -254,7 +260,6 @@ struct tty_struct {
 
        struct tty_struct *link;
        struct fasync_struct *fasync;
-       struct tty_bufhead buf;         /* Locked internally */
        int alt_speed;          /* For magic substitution of 38400 bps */
        wait_queue_head_t write_wait;
        wait_queue_head_t read_wait;
@@ -265,37 +270,10 @@ struct tty_struct {
 
 #define N_TTY_BUF_SIZE 4096
 
-       /*
-        * The following is data for the N_TTY line discipline.  For
-        * historical reasons, this is included in the tty structure.
-        * Mostly locked by the BKL.
-        */
-       unsigned int column;
-       unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1;
        unsigned char closing:1;
-       unsigned char echo_overrun:1;
        unsigned short minimum_to_wake;
-       unsigned long overrun_time;
-       int num_overrun;
-       unsigned long process_char_map[256/(8*sizeof(unsigned long))];
-       char *read_buf;
-       int read_head;
-       int read_tail;
-       int read_cnt;
-       unsigned long read_flags[N_TTY_BUF_SIZE/(8*sizeof(unsigned long))];
-       unsigned char *echo_buf;
-       unsigned int echo_pos;
-       unsigned int echo_cnt;
-       int canon_data;
-       unsigned long canon_head;
-       unsigned int canon_column;
-       struct mutex atomic_read_lock;
-       struct mutex atomic_write_lock;
-       struct mutex output_lock;
-       struct mutex echo_lock;
        unsigned char *write_buf;
        int write_cnt;
-       spinlock_t read_lock;
        /* If the tty has a pending do_SAK, queue it here - akpm */
        struct work_struct SAK_work;
        struct tty_port *port;
@@ -335,8 +313,6 @@ struct tty_file_private {
 #define TTY_PTY_LOCK           16      /* pty private */
 #define TTY_NO_WRITE_SPLIT     17      /* Preserve write boundaries to driver */
 #define TTY_HUPPED             18      /* Post driver->hangup() */
-#define TTY_FLUSHING           19      /* Flushing to ldisc in progress */
-#define TTY_FLUSHPENDING       20      /* Queued buffer flush pending */
 #define TTY_HUPPING            21      /* ->hangup() in progress */
 
 #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
@@ -412,9 +388,9 @@ extern void disassociate_ctty(int priv);
 extern void no_tty(void);
 extern void tty_flip_buffer_push(struct tty_struct *tty);
 extern void tty_flush_to_ldisc(struct tty_struct *tty);
-extern void tty_buffer_free_all(struct tty_struct *tty);
+extern void tty_buffer_free_all(struct tty_port *port);
 extern void tty_buffer_flush(struct tty_struct *tty);
-extern void tty_buffer_init(struct tty_struct *tty);
+extern void tty_buffer_init(struct tty_port *port);
 extern speed_t tty_get_baud_rate(struct tty_struct *tty);
 extern speed_t tty_termios_baud_rate(struct ktermios *termios);
 extern speed_t tty_termios_input_baud_rate(struct ktermios *termios);
@@ -535,7 +511,7 @@ extern void n_tty_inherit_ops(struct tty_ldisc_ops *ops);
 /* tty_audit.c */
 #ifdef CONFIG_AUDIT
 extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data,
-                              size_t size);
+                              size_t size, unsigned icanon);
 extern void tty_audit_exit(void);
 extern void tty_audit_fork(struct signal_struct *sig);
 extern void tty_audit_tiocsti(struct tty_struct *tty, char ch);
@@ -544,7 +520,7 @@ extern int tty_audit_push_task(struct task_struct *tsk,
                               kuid_t loginuid, u32 sessionid);
 #else
 static inline void tty_audit_add_data(struct tty_struct *tty,
-                                     unsigned char *data, size_t size)
+               unsigned char *data, size_t size, unsigned icanon)
 {
 }
 static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch)
index 9239d033a0a3a94f503d11682bf6324a53179bd8..2002344ed36ad9de8c152b666eff10922ba930b8 100644 (file)
@@ -11,7 +11,7 @@ void tty_schedule_flip(struct tty_struct *tty);
 static inline int tty_insert_flip_char(struct tty_struct *tty,
                                        unsigned char ch, char flag)
 {
-       struct tty_buffer *tb = tty->buf.tail;
+       struct tty_buffer *tb = tty->port->buf.tail;
        if (tb && tb->used < tb->size) {
                tb->flag_buf_ptr[tb->used] = flag;
                tb->char_buf_ptr[tb->used++] = ch;
index 07915a32fb9dcda932989cb495798cdc48bb1059..10278d18709cf439d3fc2aeea2b7057f22eee16a 100644 (file)
@@ -1778,17 +1778,6 @@ static inline int usb_translate_errors(int error_code)
 extern void usb_register_notify(struct notifier_block *nb);
 extern void usb_unregister_notify(struct notifier_block *nb);
 
-#ifdef DEBUG
-#define dbg(format, arg...)                                            \
-       printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg)
-#else
-#define dbg(format, arg...)                                            \
-do {                                                                   \
-       if (0)                                                          \
-               printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \
-} while (0)
-#endif
-
 /* debugfs stuff */
 extern struct dentry *usb_debug_root;
 
index b607f3532e880011453fd04462cbe90801538a6d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,10 +0,0 @@
-header-y += audio.h
-header-y += cdc.h
-header-y += ch9.h
-header-y += ch11.h
-header-y += functionfs.h
-header-y += gadgetfs.h
-header-y += midi.h
-header-y += g_printer.h
-header-y += tmc.h
-header-y += video.h
index a54b8255d75f099259c8e77ced1c8eef9aeb1158..3d84619110a4691f6d49900538f93077aa65251b 100644 (file)
  * Types and defines in this file are either specific to version 1.0 of
  * this standard or common for newer versions.
  */
-
 #ifndef __LINUX_USB_AUDIO_H
 #define __LINUX_USB_AUDIO_H
 
-#include <linux/types.h>
-
-/* bInterfaceProtocol values to denote the version of the standard used */
-#define UAC_VERSION_1                  0x00
-#define UAC_VERSION_2                  0x20
-
-/* A.2 Audio Interface Subclass Codes */
-#define USB_SUBCLASS_AUDIOCONTROL      0x01
-#define USB_SUBCLASS_AUDIOSTREAMING    0x02
-#define USB_SUBCLASS_MIDISTREAMING     0x03
-
-/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */
-#define UAC_HEADER                     0x01
-#define UAC_INPUT_TERMINAL             0x02
-#define UAC_OUTPUT_TERMINAL            0x03
-#define UAC_MIXER_UNIT                 0x04
-#define UAC_SELECTOR_UNIT              0x05
-#define UAC_FEATURE_UNIT               0x06
-#define UAC1_PROCESSING_UNIT           0x07
-#define UAC1_EXTENSION_UNIT            0x08
-
-/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */
-#define UAC_AS_GENERAL                 0x01
-#define UAC_FORMAT_TYPE                        0x02
-#define UAC_FORMAT_SPECIFIC            0x03
-
-/* A.7 Processing Unit Process Types */
-#define UAC_PROCESS_UNDEFINED          0x00
-#define UAC_PROCESS_UP_DOWNMIX         0x01
-#define UAC_PROCESS_DOLBY_PROLOGIC     0x02
-#define UAC_PROCESS_STEREO_EXTENDER    0x03
-#define UAC_PROCESS_REVERB             0x04
-#define UAC_PROCESS_CHORUS             0x05
-#define UAC_PROCESS_DYN_RANGE_COMP     0x06
-
-/* A.8 Audio Class-Specific Endpoint Descriptor Subtypes */
-#define UAC_EP_GENERAL                 0x01
-
-/* A.9 Audio Class-Specific Request Codes */
-#define UAC_SET_                       0x00
-#define UAC_GET_                       0x80
-
-#define UAC__CUR                       0x1
-#define UAC__MIN                       0x2
-#define UAC__MAX                       0x3
-#define UAC__RES                       0x4
-#define UAC__MEM                       0x5
-
-#define UAC_SET_CUR                    (UAC_SET_ | UAC__CUR)
-#define UAC_GET_CUR                    (UAC_GET_ | UAC__CUR)
-#define UAC_SET_MIN                    (UAC_SET_ | UAC__MIN)
-#define UAC_GET_MIN                    (UAC_GET_ | UAC__MIN)
-#define UAC_SET_MAX                    (UAC_SET_ | UAC__MAX)
-#define UAC_GET_MAX                    (UAC_GET_ | UAC__MAX)
-#define UAC_SET_RES                    (UAC_SET_ | UAC__RES)
-#define UAC_GET_RES                    (UAC_GET_ | UAC__RES)
-#define UAC_SET_MEM                    (UAC_SET_ | UAC__MEM)
-#define UAC_GET_MEM                    (UAC_GET_ | UAC__MEM)
-
-#define UAC_GET_STAT                   0xff
-
-/* A.10 Control Selector Codes */
-
-/* A.10.1 Terminal Control Selectors */
-#define UAC_TERM_COPY_PROTECT          0x01
-
-/* A.10.2 Feature Unit Control Selectors */
-#define UAC_FU_MUTE                    0x01
-#define UAC_FU_VOLUME                  0x02
-#define UAC_FU_BASS                    0x03
-#define UAC_FU_MID                     0x04
-#define UAC_FU_TREBLE                  0x05
-#define UAC_FU_GRAPHIC_EQUALIZER       0x06
-#define UAC_FU_AUTOMATIC_GAIN          0x07
-#define UAC_FU_DELAY                   0x08
-#define UAC_FU_BASS_BOOST              0x09
-#define UAC_FU_LOUDNESS                        0x0a
-
-#define UAC_CONTROL_BIT(CS)    (1 << ((CS) - 1))
-
-/* A.10.3.1 Up/Down-mix Processing Unit Controls Selectors */
-#define UAC_UD_ENABLE                  0x01
-#define UAC_UD_MODE_SELECT             0x02
-
-/* A.10.3.2 Dolby Prologic (tm) Processing Unit Controls Selectors */
-#define UAC_DP_ENABLE                  0x01
-#define UAC_DP_MODE_SELECT             0x02
-
-/* A.10.3.3 3D Stereo Extender Processing Unit Control Selectors */
-#define UAC_3D_ENABLE                  0x01
-#define UAC_3D_SPACE                   0x02
-
-/* A.10.3.4 Reverberation Processing Unit Control Selectors */
-#define UAC_REVERB_ENABLE              0x01
-#define UAC_REVERB_LEVEL               0x02
-#define UAC_REVERB_TIME                        0x03
-#define UAC_REVERB_FEEDBACK            0x04
-
-/* A.10.3.5 Chorus Processing Unit Control Selectors */
-#define UAC_CHORUS_ENABLE              0x01
-#define UAC_CHORUS_LEVEL               0x02
-#define UAC_CHORUS_RATE                        0x03
-#define UAC_CHORUS_DEPTH               0x04
-
-/* A.10.3.6 Dynamic Range Compressor Unit Control Selectors */
-#define UAC_DCR_ENABLE                 0x01
-#define UAC_DCR_RATE                   0x02
-#define UAC_DCR_MAXAMPL                        0x03
-#define UAC_DCR_THRESHOLD              0x04
-#define UAC_DCR_ATTACK_TIME            0x05
-#define UAC_DCR_RELEASE_TIME           0x06
-
-/* A.10.4 Extension Unit Control Selectors */
-#define UAC_XU_ENABLE                  0x01
-
-/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */
-#define UAC_MS_HEADER                  0x01
-#define UAC_MIDI_IN_JACK               0x02
-#define UAC_MIDI_OUT_JACK              0x03
-
-/* MIDI - A.1 MS Class-Specific Endpoint Descriptor Subtypes */
-#define UAC_MS_GENERAL                 0x01
-
-/* Terminals - 2.1 USB Terminal Types */
-#define UAC_TERMINAL_UNDEFINED         0x100
-#define UAC_TERMINAL_STREAMING         0x101
-#define UAC_TERMINAL_VENDOR_SPEC       0x1FF
-
-/* Terminal Control Selectors */
-/* 4.3.2  Class-Specific AC Interface Descriptor */
-struct uac1_ac_header_descriptor {
-       __u8  bLength;                  /* 8 + n */
-       __u8  bDescriptorType;          /* USB_DT_CS_INTERFACE */
-       __u8  bDescriptorSubtype;       /* UAC_MS_HEADER */
-       __le16 bcdADC;                  /* 0x0100 */
-       __le16 wTotalLength;            /* includes Unit and Terminal desc. */
-       __u8  bInCollection;            /* n */
-       __u8  baInterfaceNr[];          /* [n] */
-} __attribute__ ((packed));
-
-#define UAC_DT_AC_HEADER_SIZE(n)       (8 + (n))
-
-/* As above, but more useful for defining your own descriptors: */
-#define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n)                    \
-struct uac1_ac_header_descriptor_##n {                 \
-       __u8  bLength;                                          \
-       __u8  bDescriptorType;                                  \
-       __u8  bDescriptorSubtype;                               \
-       __le16 bcdADC;                                          \
-       __le16 wTotalLength;                                    \
-       __u8  bInCollection;                                    \
-       __u8  baInterfaceNr[n];                                 \
-} __attribute__ ((packed))
-
-/* 4.3.2.1 Input Terminal Descriptor */
-struct uac_input_terminal_descriptor {
-       __u8  bLength;                  /* in bytes: 12 */
-       __u8  bDescriptorType;          /* CS_INTERFACE descriptor type */
-       __u8  bDescriptorSubtype;       /* INPUT_TERMINAL descriptor subtype */
-       __u8  bTerminalID;              /* Constant uniquely terminal ID */
-       __le16 wTerminalType;           /* USB Audio Terminal Types */
-       __u8  bAssocTerminal;           /* ID of the Output Terminal associated */
-       __u8  bNrChannels;              /* Number of logical output channels */
-       __le16 wChannelConfig;
-       __u8  iChannelNames;
-       __u8  iTerminal;
-} __attribute__ ((packed));
-
-#define UAC_DT_INPUT_TERMINAL_SIZE                     12
-
-/* Terminals - 2.2 Input Terminal Types */
-#define UAC_INPUT_TERMINAL_UNDEFINED                   0x200
-#define UAC_INPUT_TERMINAL_MICROPHONE                  0x201
-#define UAC_INPUT_TERMINAL_DESKTOP_MICROPHONE          0x202
-#define UAC_INPUT_TERMINAL_PERSONAL_MICROPHONE         0x203
-#define UAC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE         0x204
-#define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY            0x205
-#define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY       0x206
-
-/* Terminals - control selectors */
-
-#define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL           0x01
-
-/* 4.3.2.2 Output Terminal Descriptor */
-struct uac1_output_terminal_descriptor {
-       __u8  bLength;                  /* in bytes: 9 */
-       __u8  bDescriptorType;          /* CS_INTERFACE descriptor type */
-       __u8  bDescriptorSubtype;       /* OUTPUT_TERMINAL descriptor subtype */
-       __u8  bTerminalID;              /* Constant uniquely terminal ID */
-       __le16 wTerminalType;           /* USB Audio Terminal Types */
-       __u8  bAssocTerminal;           /* ID of the Input Terminal associated */
-       __u8  bSourceID;                /* ID of the connected Unit or Terminal*/
-       __u8  iTerminal;
-} __attribute__ ((packed));
-
-#define UAC_DT_OUTPUT_TERMINAL_SIZE                    9
-
-/* Terminals - 2.3 Output Terminal Types */
-#define UAC_OUTPUT_TERMINAL_UNDEFINED                  0x300
-#define UAC_OUTPUT_TERMINAL_SPEAKER                    0x301
-#define UAC_OUTPUT_TERMINAL_HEADPHONES                 0x302
-#define UAC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303
-#define UAC_OUTPUT_TERMINAL_DESKTOP_SPEAKER            0x304
-#define UAC_OUTPUT_TERMINAL_ROOM_SPEAKER               0x305
-#define UAC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER      0x306
-#define UAC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER   0x307
-
-/* Set bControlSize = 2 as default setting */
-#define UAC_DT_FEATURE_UNIT_SIZE(ch)           (7 + ((ch) + 1) * 2)
-
-/* As above, but more useful for defining your own descriptors: */
-#define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch)                        \
-struct uac_feature_unit_descriptor_##ch {                      \
-       __u8  bLength;                                          \
-       __u8  bDescriptorType;                                  \
-       __u8  bDescriptorSubtype;                               \
-       __u8  bUnitID;                                          \
-       __u8  bSourceID;                                        \
-       __u8  bControlSize;                                     \
-       __le16 bmaControls[ch + 1];                             \
-       __u8  iFeature;                                         \
-} __attribute__ ((packed))
-
-/* 4.3.2.3 Mixer Unit Descriptor */
-struct uac_mixer_unit_descriptor {
-       __u8 bLength;
-       __u8 bDescriptorType;
-       __u8 bDescriptorSubtype;
-       __u8 bUnitID;
-       __u8 bNrInPins;
-       __u8 baSourceID[];
-} __attribute__ ((packed));
+#include <uapi/linux/usb/audio.h>
 
-static inline __u8 uac_mixer_unit_bNrChannels(struct uac_mixer_unit_descriptor *desc)
-{
-       return desc->baSourceID[desc->bNrInPins];
-}
-
-static inline __u32 uac_mixer_unit_wChannelConfig(struct uac_mixer_unit_descriptor *desc,
-                                                 int protocol)
-{
-       if (protocol == UAC_VERSION_1)
-               return (desc->baSourceID[desc->bNrInPins + 2] << 8) |
-                       desc->baSourceID[desc->bNrInPins + 1];
-       else
-               return  (desc->baSourceID[desc->bNrInPins + 4] << 24) |
-                       (desc->baSourceID[desc->bNrInPins + 3] << 16) |
-                       (desc->baSourceID[desc->bNrInPins + 2] << 8)  |
-                       (desc->baSourceID[desc->bNrInPins + 1]);
-}
-
-static inline __u8 uac_mixer_unit_iChannelNames(struct uac_mixer_unit_descriptor *desc,
-                                               int protocol)
-{
-       return (protocol == UAC_VERSION_1) ?
-               desc->baSourceID[desc->bNrInPins + 3] :
-               desc->baSourceID[desc->bNrInPins + 5];
-}
-
-static inline __u8 *uac_mixer_unit_bmControls(struct uac_mixer_unit_descriptor *desc,
-                                             int protocol)
-{
-       return (protocol == UAC_VERSION_1) ?
-               &desc->baSourceID[desc->bNrInPins + 4] :
-               &desc->baSourceID[desc->bNrInPins + 6];
-}
-
-static inline __u8 uac_mixer_unit_iMixer(struct uac_mixer_unit_descriptor *desc)
-{
-       __u8 *raw = (__u8 *) desc;
-       return raw[desc->bLength - 1];
-}
-
-/* 4.3.2.4 Selector Unit Descriptor */
-struct uac_selector_unit_descriptor {
-       __u8 bLength;
-       __u8 bDescriptorType;
-       __u8 bDescriptorSubtype;
-       __u8 bUintID;
-       __u8 bNrInPins;
-       __u8 baSourceID[];
-} __attribute__ ((packed));
-
-static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc)
-{
-       __u8 *raw = (__u8 *) desc;
-       return raw[desc->bLength - 1];
-}
-
-/* 4.3.2.5 Feature Unit Descriptor */
-struct uac_feature_unit_descriptor {
-       __u8 bLength;
-       __u8 bDescriptorType;
-       __u8 bDescriptorSubtype;
-       __u8 bUnitID;
-       __u8 bSourceID;
-       __u8 bControlSize;
-       __u8 bmaControls[0]; /* variable length */
-} __attribute__((packed));
-
-static inline __u8 uac_feature_unit_iFeature(struct uac_feature_unit_descriptor *desc)
-{
-       __u8 *raw = (__u8 *) desc;
-       return raw[desc->bLength - 1];
-}
-
-/* 4.3.2.6 Processing Unit Descriptors */
-struct uac_processing_unit_descriptor {
-       __u8 bLength;
-       __u8 bDescriptorType;
-       __u8 bDescriptorSubtype;
-       __u8 bUnitID;
-       __u16 wProcessType;
-       __u8 bNrInPins;
-       __u8 baSourceID[];
-} __attribute__ ((packed));
-
-static inline __u8 uac_processing_unit_bNrChannels(struct uac_processing_unit_descriptor *desc)
-{
-       return desc->baSourceID[desc->bNrInPins];
-}
-
-static inline __u32 uac_processing_unit_wChannelConfig(struct uac_processing_unit_descriptor *desc,
-                                                      int protocol)
-{
-       if (protocol == UAC_VERSION_1)
-               return (desc->baSourceID[desc->bNrInPins + 2] << 8) |
-                       desc->baSourceID[desc->bNrInPins + 1];
-       else
-               return  (desc->baSourceID[desc->bNrInPins + 4] << 24) |
-                       (desc->baSourceID[desc->bNrInPins + 3] << 16) |
-                       (desc->baSourceID[desc->bNrInPins + 2] << 8)  |
-                       (desc->baSourceID[desc->bNrInPins + 1]);
-}
-
-static inline __u8 uac_processing_unit_iChannelNames(struct uac_processing_unit_descriptor *desc,
-                                                    int protocol)
-{
-       return (protocol == UAC_VERSION_1) ?
-               desc->baSourceID[desc->bNrInPins + 3] :
-               desc->baSourceID[desc->bNrInPins + 5];
-}
-
-static inline __u8 uac_processing_unit_bControlSize(struct uac_processing_unit_descriptor *desc,
-                                                   int protocol)
-{
-       return (protocol == UAC_VERSION_1) ?
-               desc->baSourceID[desc->bNrInPins + 4] :
-               desc->baSourceID[desc->bNrInPins + 6];
-}
-
-static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc,
-                                                  int protocol)
-{
-       return (protocol == UAC_VERSION_1) ?
-               &desc->baSourceID[desc->bNrInPins + 5] :
-               &desc->baSourceID[desc->bNrInPins + 7];
-}
-
-static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc,
-                                                  int protocol)
-{
-       __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
-       return desc->baSourceID[desc->bNrInPins + control_size];
-}
-
-static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc,
-                                                int protocol)
-{
-       __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
-       return &desc->baSourceID[desc->bNrInPins + control_size + 1];
-}
-
-/* 4.5.2 Class-Specific AS Interface Descriptor */
-struct uac1_as_header_descriptor {
-       __u8  bLength;                  /* in bytes: 7 */
-       __u8  bDescriptorType;          /* USB_DT_CS_INTERFACE */
-       __u8  bDescriptorSubtype;       /* AS_GENERAL */
-       __u8  bTerminalLink;            /* Terminal ID of connected Terminal */
-       __u8  bDelay;                   /* Delay introduced by the data path */
-       __le16 wFormatTag;              /* The Audio Data Format */
-} __attribute__ ((packed));
-
-#define UAC_DT_AS_HEADER_SIZE          7
-
-/* Formats - A.1.1 Audio Data Format Type I Codes */
-#define UAC_FORMAT_TYPE_I_UNDEFINED    0x0
-#define UAC_FORMAT_TYPE_I_PCM          0x1
-#define UAC_FORMAT_TYPE_I_PCM8         0x2
-#define UAC_FORMAT_TYPE_I_IEEE_FLOAT   0x3
-#define UAC_FORMAT_TYPE_I_ALAW         0x4
-#define UAC_FORMAT_TYPE_I_MULAW                0x5
-
-struct uac_format_type_i_continuous_descriptor {
-       __u8  bLength;                  /* in bytes: 8 + (ns * 3) */
-       __u8  bDescriptorType;          /* USB_DT_CS_INTERFACE */
-       __u8  bDescriptorSubtype;       /* FORMAT_TYPE */
-       __u8  bFormatType;              /* FORMAT_TYPE_1 */
-       __u8  bNrChannels;              /* physical channels in the stream */
-       __u8  bSubframeSize;            /* */
-       __u8  bBitResolution;
-       __u8  bSamFreqType;
-       __u8  tLowerSamFreq[3];
-       __u8  tUpperSamFreq[3];
-} __attribute__ ((packed));
-
-#define UAC_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14
-
-struct uac_format_type_i_discrete_descriptor {
-       __u8  bLength;                  /* in bytes: 8 + (ns * 3) */
-       __u8  bDescriptorType;          /* USB_DT_CS_INTERFACE */
-       __u8  bDescriptorSubtype;       /* FORMAT_TYPE */
-       __u8  bFormatType;              /* FORMAT_TYPE_1 */
-       __u8  bNrChannels;              /* physical channels in the stream */
-       __u8  bSubframeSize;            /* */
-       __u8  bBitResolution;
-       __u8  bSamFreqType;
-       __u8  tSamFreq[][3];
-} __attribute__ ((packed));
-
-#define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n)             \
-struct uac_format_type_i_discrete_descriptor_##n {             \
-       __u8  bLength;                                          \
-       __u8  bDescriptorType;                                  \
-       __u8  bDescriptorSubtype;                               \
-       __u8  bFormatType;                                      \
-       __u8  bNrChannels;                                      \
-       __u8  bSubframeSize;                                    \
-       __u8  bBitResolution;                                   \
-       __u8  bSamFreqType;                                     \
-       __u8  tSamFreq[n][3];                                   \
-} __attribute__ ((packed))
-
-#define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n)        (8 + (n * 3))
-
-struct uac_format_type_i_ext_descriptor {
-       __u8 bLength;
-       __u8 bDescriptorType;
-       __u8 bDescriptorSubtype;
-       __u8 bFormatType;
-       __u8 bSubslotSize;
-       __u8 bBitResolution;
-       __u8 bHeaderLength;
-       __u8 bControlSize;
-       __u8 bSideBandProtocol;
-} __attribute__((packed));
-
-/* Formats - Audio Data Format Type I Codes */
-
-#define UAC_FORMAT_TYPE_II_MPEG        0x1001
-#define UAC_FORMAT_TYPE_II_AC3 0x1002
-
-struct uac_format_type_ii_discrete_descriptor {
-       __u8 bLength;
-       __u8 bDescriptorType;
-       __u8 bDescriptorSubtype;
-       __u8 bFormatType;
-       __le16 wMaxBitRate;
-       __le16 wSamplesPerFrame;
-       __u8 bSamFreqType;
-       __u8 tSamFreq[][3];
-} __attribute__((packed));
-
-struct uac_format_type_ii_ext_descriptor {
-       __u8 bLength;
-       __u8 bDescriptorType;
-       __u8 bDescriptorSubtype;
-       __u8 bFormatType;
-       __u16 wMaxBitRate;
-       __u16 wSamplesPerFrame;
-       __u8 bHeaderLength;
-       __u8 bSideBandProtocol;
-} __attribute__((packed));
-
-/* type III */
-#define UAC_FORMAT_TYPE_III_IEC1937_AC3        0x2001
-#define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1       0x2002
-#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT        0x2003
-#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT  0x2004
-#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS    0x2005
-#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS   0x2006
-
-/* Formats - A.2 Format Type Codes */
-#define UAC_FORMAT_TYPE_UNDEFINED      0x0
-#define UAC_FORMAT_TYPE_I              0x1
-#define UAC_FORMAT_TYPE_II             0x2
-#define UAC_FORMAT_TYPE_III            0x3
-#define UAC_EXT_FORMAT_TYPE_I          0x81
-#define UAC_EXT_FORMAT_TYPE_II         0x82
-#define UAC_EXT_FORMAT_TYPE_III                0x83
-
-struct uac_iso_endpoint_descriptor {
-       __u8  bLength;                  /* in bytes: 7 */
-       __u8  bDescriptorType;          /* USB_DT_CS_ENDPOINT */
-       __u8  bDescriptorSubtype;       /* EP_GENERAL */
-       __u8  bmAttributes;
-       __u8  bLockDelayUnits;
-       __le16 wLockDelay;
-} __attribute__((packed));
-#define UAC_ISO_ENDPOINT_DESC_SIZE     7
-
-#define UAC_EP_CS_ATTR_SAMPLE_RATE     0x01
-#define UAC_EP_CS_ATTR_PITCH_CONTROL   0x02
-#define UAC_EP_CS_ATTR_FILL_MAX                0x80
-
-/* status word format (3.7.1.1) */
-
-#define UAC1_STATUS_TYPE_ORIG_MASK             0x0f
-#define UAC1_STATUS_TYPE_ORIG_AUDIO_CONTROL_IF 0x0
-#define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_IF  0x1
-#define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_EP  0x2
-
-#define UAC1_STATUS_TYPE_IRQ_PENDING           (1 << 7)
-#define UAC1_STATUS_TYPE_MEM_CHANGED           (1 << 6)
-
-struct uac1_status_word {
-       __u8 bStatusType;
-       __u8 bOriginator;
-} __attribute__((packed));
-
-#ifdef __KERNEL__
 
 struct usb_audio_control {
        struct list_head list;
@@ -561,6 +41,4 @@ struct usb_audio_control_selector {
        struct usb_descriptor_header *desc;
 };
 
-#endif /* __KERNEL__ */
-
 #endif /* __LINUX_USB_AUDIO_H */
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h
deleted file mode 100644 (file)
index 81a9279..0000000
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * USB Communications Device Class (CDC) definitions
- *
- * CDC says how to talk to lots of different types of network adapters,
- * notably ethernet adapters and various modems.  It's used mostly with
- * firmware based USB peripherals.
- */
-
-#ifndef __LINUX_USB_CDC_H
-#define __LINUX_USB_CDC_H
-
-#include <linux/types.h>
-
-#define USB_CDC_SUBCLASS_ACM                   0x02
-#define USB_CDC_SUBCLASS_ETHERNET              0x06
-#define USB_CDC_SUBCLASS_WHCM                  0x08
-#define USB_CDC_SUBCLASS_DMM                   0x09
-#define USB_CDC_SUBCLASS_MDLM                  0x0a
-#define USB_CDC_SUBCLASS_OBEX                  0x0b
-#define USB_CDC_SUBCLASS_EEM                   0x0c
-#define USB_CDC_SUBCLASS_NCM                   0x0d
-
-#define USB_CDC_PROTO_NONE                     0
-
-#define USB_CDC_ACM_PROTO_AT_V25TER            1
-#define USB_CDC_ACM_PROTO_AT_PCCA101           2
-#define USB_CDC_ACM_PROTO_AT_PCCA101_WAKE      3
-#define USB_CDC_ACM_PROTO_AT_GSM               4
-#define USB_CDC_ACM_PROTO_AT_3G                        5
-#define USB_CDC_ACM_PROTO_AT_CDMA              6
-#define USB_CDC_ACM_PROTO_VENDOR               0xff
-
-#define USB_CDC_PROTO_EEM                      7
-
-#define USB_CDC_NCM_PROTO_NTB                  1
-
-/*-------------------------------------------------------------------------*/
-
-/*
- * Class-Specific descriptors ... there are a couple dozen of them
- */
-
-#define USB_CDC_HEADER_TYPE            0x00    /* header_desc */
-#define USB_CDC_CALL_MANAGEMENT_TYPE   0x01    /* call_mgmt_descriptor */
-#define USB_CDC_ACM_TYPE               0x02    /* acm_descriptor */
-#define USB_CDC_UNION_TYPE             0x06    /* union_desc */
-#define USB_CDC_COUNTRY_TYPE           0x07
-#define USB_CDC_NETWORK_TERMINAL_TYPE  0x0a    /* network_terminal_desc */
-#define USB_CDC_ETHERNET_TYPE          0x0f    /* ether_desc */
-#define USB_CDC_WHCM_TYPE              0x11
-#define USB_CDC_MDLM_TYPE              0x12    /* mdlm_desc */
-#define USB_CDC_MDLM_DETAIL_TYPE       0x13    /* mdlm_detail_desc */
-#define USB_CDC_DMM_TYPE               0x14
-#define USB_CDC_OBEX_TYPE              0x15
-#define USB_CDC_NCM_TYPE               0x1a
-
-/* "Header Functional Descriptor" from CDC spec  5.2.3.1 */
-struct usb_cdc_header_desc {
-       __u8    bLength;
-       __u8    bDescriptorType;
-       __u8    bDescriptorSubType;
-
-       __le16  bcdCDC;
-} __attribute__ ((packed));
-
-/* "Call Management Descriptor" from CDC spec  5.2.3.2 */
-struct usb_cdc_call_mgmt_descriptor {
-       __u8    bLength;
-       __u8    bDescriptorType;
-       __u8    bDescriptorSubType;
-
-       __u8    bmCapabilities;
-#define USB_CDC_CALL_MGMT_CAP_CALL_MGMT                0x01
-#define USB_CDC_CALL_MGMT_CAP_DATA_INTF                0x02
-
-       __u8    bDataInterface;
-} __attribute__ ((packed));
-
-/* "Abstract Control Management Descriptor" from CDC spec  5.2.3.3 */
-struct usb_cdc_acm_descriptor {
-       __u8    bLength;
-       __u8    bDescriptorType;
-       __u8    bDescriptorSubType;
-
-       __u8    bmCapabilities;
-} __attribute__ ((packed));
-
-/* capabilities from 5.2.3.3 */
-
-#define USB_CDC_COMM_FEATURE   0x01
-#define USB_CDC_CAP_LINE       0x02
-#define USB_CDC_CAP_BRK                0x04
-#define USB_CDC_CAP_NOTIFY     0x08
-
-/* "Union Functional Descriptor" from CDC spec 5.2.3.8 */
-struct usb_cdc_union_desc {
-       __u8    bLength;
-       __u8    bDescriptorType;
-       __u8    bDescriptorSubType;
-
-       __u8    bMasterInterface0;
-       __u8    bSlaveInterface0;
-       /* ... and there could be other slave interfaces */
-} __attribute__ ((packed));
-
-/* "Country Selection Functional Descriptor" from CDC spec 5.2.3.9 */
-struct usb_cdc_country_functional_desc {
-       __u8    bLength;
-       __u8    bDescriptorType;
-       __u8    bDescriptorSubType;
-
-       __u8    iCountryCodeRelDate;
-       __le16  wCountyCode0;
-       /* ... and there can be a lot of country codes */
-} __attribute__ ((packed));
-
-/* "Network Channel Terminal Functional Descriptor" from CDC spec 5.2.3.11 */
-struct usb_cdc_network_terminal_desc {
-       __u8    bLength;
-       __u8    bDescriptorType;
-       __u8    bDescriptorSubType;
-
-       __u8    bEntityId;
-       __u8    iName;
-       __u8    bChannelIndex;
-       __u8    bPhysicalInterface;
-} __attribute__ ((packed));
-
-/* "Ethernet Networking Functional Descriptor" from CDC spec 5.2.3.16 */
-struct usb_cdc_ether_desc {
-       __u8    bLength;
-       __u8    bDescriptorType;
-       __u8    bDescriptorSubType;
-
-       __u8    iMACAddress;
-       __le32  bmEthernetStatistics;
-       __le16  wMaxSegmentSize;
-       __le16  wNumberMCFilters;
-       __u8    bNumberPowerFilters;
-} __attribute__ ((packed));
-
-/* "Telephone Control Model Functional Descriptor" from CDC WMC spec 6.3..3 */
-struct usb_cdc_dmm_desc {
-       __u8    bFunctionLength;
-       __u8    bDescriptorType;
-       __u8    bDescriptorSubtype;
-       __u16   bcdVersion;
-       __le16  wMaxCommand;
-} __attribute__ ((packed));
-
-/* "MDLM Functional Descriptor" from CDC WMC spec 6.7.2.3 */
-struct usb_cdc_mdlm_desc {
-       __u8    bLength;
-       __u8    bDescriptorType;
-       __u8    bDescriptorSubType;
-
-       __le16  bcdVersion;
-       __u8    bGUID[16];
-} __attribute__ ((packed));
-
-/* "MDLM Detail Functional Descriptor" from CDC WMC spec 6.7.2.4 */
-struct usb_cdc_mdlm_detail_desc {
-       __u8    bLength;
-       __u8    bDescriptorType;
-       __u8    bDescriptorSubType;
-
-       /* type is associated with mdlm_desc.bGUID */
-       __u8    bGuidDescriptorType;
-       __u8    bDetailData[0];
-} __attribute__ ((packed));
-
-/* "OBEX Control Model Functional Descriptor" */
-struct usb_cdc_obex_desc {
-       __u8    bLength;
-       __u8    bDescriptorType;
-       __u8    bDescriptorSubType;
-
-       __le16  bcdVersion;
-} __attribute__ ((packed));
-
-/* "NCM Control Model Functional Descriptor" */
-struct usb_cdc_ncm_desc {
-       __u8    bLength;
-       __u8    bDescriptorType;
-       __u8    bDescriptorSubType;
-
-       __le16  bcdNcmVersion;
-       __u8    bmNetworkCapabilities;
-} __attribute__ ((packed));
-/*-------------------------------------------------------------------------*/
-
-/*
- * Class-Specific Control Requests (6.2)
- *
- * section 3.6.2.1 table 4 has the ACM profile, for modems.
- * section 3.8.2 table 10 has the ethernet profile.
- *
- * Microsoft's RNDIS stack for Ethernet is a vendor-specific CDC ACM variant,
- * heavily dependent on the encapsulated (proprietary) command mechanism.
- */
-
-#define USB_CDC_SEND_ENCAPSULATED_COMMAND      0x00
-#define USB_CDC_GET_ENCAPSULATED_RESPONSE      0x01
-#define USB_CDC_REQ_SET_LINE_CODING            0x20
-#define USB_CDC_REQ_GET_LINE_CODING            0x21
-#define USB_CDC_REQ_SET_CONTROL_LINE_STATE     0x22
-#define USB_CDC_REQ_SEND_BREAK                 0x23
-#define USB_CDC_SET_ETHERNET_MULTICAST_FILTERS 0x40
-#define USB_CDC_SET_ETHERNET_PM_PATTERN_FILTER 0x41
-#define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42
-#define USB_CDC_SET_ETHERNET_PACKET_FILTER     0x43
-#define USB_CDC_GET_ETHERNET_STATISTIC         0x44
-#define USB_CDC_GET_NTB_PARAMETERS             0x80
-#define USB_CDC_GET_NET_ADDRESS                        0x81
-#define USB_CDC_SET_NET_ADDRESS                        0x82
-#define USB_CDC_GET_NTB_FORMAT                 0x83
-#define USB_CDC_SET_NTB_FORMAT                 0x84
-#define USB_CDC_GET_NTB_INPUT_SIZE             0x85
-#define USB_CDC_SET_NTB_INPUT_SIZE             0x86
-#define USB_CDC_GET_MAX_DATAGRAM_SIZE          0x87
-#define USB_CDC_SET_MAX_DATAGRAM_SIZE          0x88
-#define USB_CDC_GET_CRC_MODE                   0x89
-#define USB_CDC_SET_CRC_MODE                   0x8a
-
-/* Line Coding Structure from CDC spec 6.2.13 */
-struct usb_cdc_line_coding {
-       __le32  dwDTERate;
-       __u8    bCharFormat;
-#define USB_CDC_1_STOP_BITS                    0
-#define USB_CDC_1_5_STOP_BITS                  1
-#define USB_CDC_2_STOP_BITS                    2
-
-       __u8    bParityType;
-#define USB_CDC_NO_PARITY                      0
-#define USB_CDC_ODD_PARITY                     1
-#define USB_CDC_EVEN_PARITY                    2
-#define USB_CDC_MARK_PARITY                    3
-#define USB_CDC_SPACE_PARITY                   4
-
-       __u8    bDataBits;
-} __attribute__ ((packed));
-
-/* table 62; bits in multicast filter */
-#define        USB_CDC_PACKET_TYPE_PROMISCUOUS         (1 << 0)
-#define        USB_CDC_PACKET_TYPE_ALL_MULTICAST       (1 << 1) /* no filter */
-#define        USB_CDC_PACKET_TYPE_DIRECTED            (1 << 2)
-#define        USB_CDC_PACKET_TYPE_BROADCAST           (1 << 3)
-#define        USB_CDC_PACKET_TYPE_MULTICAST           (1 << 4) /* filtered */
-
-
-/*-------------------------------------------------------------------------*/
-
-/*
- * Class-Specific Notifications (6.3) sent by interrupt transfers
- *
- * section 3.8.2 table 11 of the CDC spec lists Ethernet notifications
- * section 3.6.2.1 table 5 specifies ACM notifications, accepted by RNDIS
- * RNDIS also defines its own bit-incompatible notifications
- */
-
-#define USB_CDC_NOTIFY_NETWORK_CONNECTION      0x00
-#define USB_CDC_NOTIFY_RESPONSE_AVAILABLE      0x01
-#define USB_CDC_NOTIFY_SERIAL_STATE            0x20
-#define USB_CDC_NOTIFY_SPEED_CHANGE            0x2a
-
-struct usb_cdc_notification {
-       __u8    bmRequestType;
-       __u8    bNotificationType;
-       __le16  wValue;
-       __le16  wIndex;
-       __le16  wLength;
-} __attribute__ ((packed));
-
-struct usb_cdc_speed_change {
-       __le32  DLBitRRate;     /* contains the downlink bit rate (IN pipe) */
-       __le32  ULBitRate;      /* contains the uplink bit rate (OUT pipe) */
-} __attribute__ ((packed));
-
-/*-------------------------------------------------------------------------*/
-
-/*
- * Class Specific structures and constants
- *
- * CDC NCM NTB parameters structure, CDC NCM subclass 6.2.1
- *
- */
-
-struct usb_cdc_ncm_ntb_parameters {
-       __le16  wLength;
-       __le16  bmNtbFormatsSupported;
-       __le32  dwNtbInMaxSize;
-       __le16  wNdpInDivisor;
-       __le16  wNdpInPayloadRemainder;
-       __le16  wNdpInAlignment;
-       __le16  wPadding1;
-       __le32  dwNtbOutMaxSize;
-       __le16  wNdpOutDivisor;
-       __le16  wNdpOutPayloadRemainder;
-       __le16  wNdpOutAlignment;
-       __le16  wNtbOutMaxDatagrams;
-} __attribute__ ((packed));
-
-/*
- * CDC NCM transfer headers, CDC NCM subclass 3.2
- */
-
-#define USB_CDC_NCM_NTH16_SIGN         0x484D434E /* NCMH */
-#define USB_CDC_NCM_NTH32_SIGN         0x686D636E /* ncmh */
-
-struct usb_cdc_ncm_nth16 {
-       __le32  dwSignature;
-       __le16  wHeaderLength;
-       __le16  wSequence;
-       __le16  wBlockLength;
-       __le16  wNdpIndex;
-} __attribute__ ((packed));
-
-struct usb_cdc_ncm_nth32 {
-       __le32  dwSignature;
-       __le16  wHeaderLength;
-       __le16  wSequence;
-       __le32  dwBlockLength;
-       __le32  dwNdpIndex;
-} __attribute__ ((packed));
-
-/*
- * CDC NCM datagram pointers, CDC NCM subclass 3.3
- */
-
-#define USB_CDC_NCM_NDP16_CRC_SIGN     0x314D434E /* NCM1 */
-#define USB_CDC_NCM_NDP16_NOCRC_SIGN   0x304D434E /* NCM0 */
-#define USB_CDC_NCM_NDP32_CRC_SIGN     0x316D636E /* ncm1 */
-#define USB_CDC_NCM_NDP32_NOCRC_SIGN   0x306D636E /* ncm0 */
-
-/* 16-bit NCM Datagram Pointer Entry */
-struct usb_cdc_ncm_dpe16 {
-       __le16  wDatagramIndex;
-       __le16  wDatagramLength;
-} __attribute__((__packed__));
-
-/* 16-bit NCM Datagram Pointer Table */
-struct usb_cdc_ncm_ndp16 {
-       __le32  dwSignature;
-       __le16  wLength;
-       __le16  wNextNdpIndex;
-       struct  usb_cdc_ncm_dpe16 dpe16[0];
-} __attribute__ ((packed));
-
-/* 32-bit NCM Datagram Pointer Entry */
-struct usb_cdc_ncm_dpe32 {
-       __le32  dwDatagramIndex;
-       __le32  dwDatagramLength;
-} __attribute__((__packed__));
-
-/* 32-bit NCM Datagram Pointer Table */
-struct usb_cdc_ncm_ndp32 {
-       __le32  dwSignature;
-       __le16  wLength;
-       __le16  wReserved6;
-       __le32  dwNextNdpIndex;
-       __le32  dwReserved12;
-       struct  usb_cdc_ncm_dpe32 dpe32[0];
-} __attribute__ ((packed));
-
-/* CDC NCM subclass 3.2.1 and 3.2.2 */
-#define USB_CDC_NCM_NDP16_INDEX_MIN                    0x000C
-#define USB_CDC_NCM_NDP32_INDEX_MIN                    0x0010
-
-/* CDC NCM subclass 3.3.3 Datagram Formatting */
-#define USB_CDC_NCM_DATAGRAM_FORMAT_CRC                        0x30
-#define USB_CDC_NCM_DATAGRAM_FORMAT_NOCRC              0X31
-
-/* CDC NCM subclass 4.2 NCM Communications Interface Protocol Code */
-#define USB_CDC_NCM_PROTO_CODE_NO_ENCAP_COMMANDS       0x00
-#define USB_CDC_NCM_PROTO_CODE_EXTERN_PROTO            0xFE
-
-/* CDC NCM subclass 5.2.1 NCM Functional Descriptor, bmNetworkCapabilities */
-#define USB_CDC_NCM_NCAP_ETH_FILTER                    (1 << 0)
-#define USB_CDC_NCM_NCAP_NET_ADDRESS                   (1 << 1)
-#define USB_CDC_NCM_NCAP_ENCAP_COMMAND                 (1 << 2)
-#define USB_CDC_NCM_NCAP_MAX_DATAGRAM_SIZE             (1 << 3)
-#define USB_CDC_NCM_NCAP_CRC_MODE                      (1 << 4)
-#define        USB_CDC_NCM_NCAP_NTB_INPUT_SIZE                 (1 << 5)
-
-/* CDC NCM subclass Table 6-3: NTB Parameter Structure */
-#define USB_CDC_NCM_NTB16_SUPPORTED                    (1 << 0)
-#define USB_CDC_NCM_NTB32_SUPPORTED                    (1 << 1)
-
-/* CDC NCM subclass Table 6-3: NTB Parameter Structure */
-#define USB_CDC_NCM_NDP_ALIGN_MIN_SIZE                 0x04
-#define USB_CDC_NCM_NTB_MAX_LENGTH                     0x1C
-
-/* CDC NCM subclass 6.2.5 SetNtbFormat */
-#define USB_CDC_NCM_NTB16_FORMAT                       0x00
-#define USB_CDC_NCM_NTB32_FORMAT                       0x01
-
-/* CDC NCM subclass 6.2.7 SetNtbInputSize */
-#define USB_CDC_NCM_NTB_MIN_IN_SIZE                    2048
-#define USB_CDC_NCM_NTB_MIN_OUT_SIZE                   2048
-
-/* NTB Input Size Structure */
-struct usb_cdc_ncm_ndp_input_size {
-       __le32  dwNtbInMaxSize;
-       __le16  wNtbInMaxDatagrams;
-       __le16  wReserved;
-} __attribute__ ((packed));
-
-/* CDC NCM subclass 6.2.11 SetCrcMode */
-#define USB_CDC_NCM_CRC_NOT_APPENDED                   0x00
-#define USB_CDC_NCM_CRC_APPENDED                       0x01
-
-#endif /* __LINUX_USB_CDC_H */
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h
deleted file mode 100644 (file)
index 7692dc6..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * This file holds Hub protocol constants and data structures that are
- * defined in chapter 11 (Hub Specification) of the USB 2.0 specification.
- *
- * It is used/shared between the USB core, the HCDs and couple of other USB
- * drivers.
- */
-
-#ifndef __LINUX_CH11_H
-#define __LINUX_CH11_H
-
-#include <linux/types.h>       /* __u8 etc */
-
-/*
- * Hub request types
- */
-
-#define USB_RT_HUB     (USB_TYPE_CLASS | USB_RECIP_DEVICE)
-#define USB_RT_PORT    (USB_TYPE_CLASS | USB_RECIP_OTHER)
-
-/*
- * Hub class requests
- * See USB 2.0 spec Table 11-16
- */
-#define HUB_CLEAR_TT_BUFFER    8
-#define HUB_RESET_TT           9
-#define HUB_GET_TT_STATE       10
-#define HUB_STOP_TT            11
-
-/*
- * Hub class additional requests defined by USB 3.0 spec
- * See USB 3.0 spec Table 10-6
- */
-#define HUB_SET_DEPTH          12
-#define HUB_GET_PORT_ERR_COUNT 13
-
-/*
- * Hub Class feature numbers
- * See USB 2.0 spec Table 11-17
- */
-#define C_HUB_LOCAL_POWER      0
-#define C_HUB_OVER_CURRENT     1
-
-/*
- * Port feature numbers
- * See USB 2.0 spec Table 11-17
- */
-#define USB_PORT_FEAT_CONNECTION       0
-#define USB_PORT_FEAT_ENABLE           1
-#define USB_PORT_FEAT_SUSPEND          2       /* L2 suspend */
-#define USB_PORT_FEAT_OVER_CURRENT     3
-#define USB_PORT_FEAT_RESET            4
-#define USB_PORT_FEAT_L1               5       /* L1 suspend */
-#define USB_PORT_FEAT_POWER            8
-#define USB_PORT_FEAT_LOWSPEED         9       /* Should never be used */
-#define USB_PORT_FEAT_C_CONNECTION     16
-#define USB_PORT_FEAT_C_ENABLE         17
-#define USB_PORT_FEAT_C_SUSPEND                18
-#define USB_PORT_FEAT_C_OVER_CURRENT   19
-#define USB_PORT_FEAT_C_RESET          20
-#define USB_PORT_FEAT_TEST              21
-#define USB_PORT_FEAT_INDICATOR         22
-#define USB_PORT_FEAT_C_PORT_L1         23
-
-/*
- * Port feature selectors added by USB 3.0 spec.
- * See USB 3.0 spec Table 10-7
- */
-#define USB_PORT_FEAT_LINK_STATE               5
-#define USB_PORT_FEAT_U1_TIMEOUT               23
-#define USB_PORT_FEAT_U2_TIMEOUT               24
-#define USB_PORT_FEAT_C_PORT_LINK_STATE                25
-#define USB_PORT_FEAT_C_PORT_CONFIG_ERROR      26
-#define USB_PORT_FEAT_REMOTE_WAKE_MASK         27
-#define USB_PORT_FEAT_BH_PORT_RESET            28
-#define USB_PORT_FEAT_C_BH_PORT_RESET          29
-#define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT      30
-
-#define USB_PORT_LPM_TIMEOUT(p)                        (((p) & 0xff) << 8)
-
-/* USB 3.0 hub remote wake mask bits, see table 10-14 */
-#define USB_PORT_FEAT_REMOTE_WAKE_CONNECT      (1 << 8)
-#define USB_PORT_FEAT_REMOTE_WAKE_DISCONNECT   (1 << 9)
-#define USB_PORT_FEAT_REMOTE_WAKE_OVER_CURRENT (1 << 10)
-
-/*
- * Hub Status and Hub Change results
- * See USB 2.0 spec Table 11-19 and Table 11-20
- */
-struct usb_port_status {
-       __le16 wPortStatus;
-       __le16 wPortChange;
-} __attribute__ ((packed));
-
-/*
- * wPortStatus bit field
- * See USB 2.0 spec Table 11-21
- */
-#define USB_PORT_STAT_CONNECTION       0x0001
-#define USB_PORT_STAT_ENABLE           0x0002
-#define USB_PORT_STAT_SUSPEND          0x0004
-#define USB_PORT_STAT_OVERCURRENT      0x0008
-#define USB_PORT_STAT_RESET            0x0010
-#define USB_PORT_STAT_L1               0x0020
-/* bits 6 to 7 are reserved */
-#define USB_PORT_STAT_POWER            0x0100
-#define USB_PORT_STAT_LOW_SPEED                0x0200
-#define USB_PORT_STAT_HIGH_SPEED        0x0400
-#define USB_PORT_STAT_TEST              0x0800
-#define USB_PORT_STAT_INDICATOR         0x1000
-/* bits 13 to 15 are reserved */
-
-/*
- * Additions to wPortStatus bit field from USB 3.0
- * See USB 3.0 spec Table 10-10
- */
-#define USB_PORT_STAT_LINK_STATE       0x01e0
-#define USB_SS_PORT_STAT_POWER         0x0200
-#define USB_SS_PORT_STAT_SPEED         0x1c00
-#define USB_PORT_STAT_SPEED_5GBPS      0x0000
-/* Valid only if port is enabled */
-/* Bits that are the same from USB 2.0 */
-#define USB_SS_PORT_STAT_MASK (USB_PORT_STAT_CONNECTION |          \
-                               USB_PORT_STAT_ENABLE |      \
-                               USB_PORT_STAT_OVERCURRENT | \
-                               USB_PORT_STAT_RESET)
-
-/*
- * Definitions for PORT_LINK_STATE values
- * (bits 5-8) in wPortStatus
- */
-#define USB_SS_PORT_LS_U0              0x0000
-#define USB_SS_PORT_LS_U1              0x0020
-#define USB_SS_PORT_LS_U2              0x0040
-#define USB_SS_PORT_LS_U3              0x0060
-#define USB_SS_PORT_LS_SS_DISABLED     0x0080
-#define USB_SS_PORT_LS_RX_DETECT       0x00a0
-#define USB_SS_PORT_LS_SS_INACTIVE     0x00c0
-#define USB_SS_PORT_LS_POLLING         0x00e0
-#define USB_SS_PORT_LS_RECOVERY                0x0100
-#define USB_SS_PORT_LS_HOT_RESET       0x0120
-#define USB_SS_PORT_LS_COMP_MOD                0x0140
-#define USB_SS_PORT_LS_LOOPBACK                0x0160
-
-/*
- * wPortChange bit field
- * See USB 2.0 spec Table 11-22 and USB 2.0 LPM ECN Table-4.10
- * Bits 0 to 5 shown, bits 6 to 15 are reserved
- */
-#define USB_PORT_STAT_C_CONNECTION     0x0001
-#define USB_PORT_STAT_C_ENABLE         0x0002
-#define USB_PORT_STAT_C_SUSPEND                0x0004
-#define USB_PORT_STAT_C_OVERCURRENT    0x0008
-#define USB_PORT_STAT_C_RESET          0x0010
-#define USB_PORT_STAT_C_L1             0x0020
-/*
- * USB 3.0 wPortChange bit fields
- * See USB 3.0 spec Table 10-11
- */
-#define USB_PORT_STAT_C_BH_RESET       0x0020
-#define USB_PORT_STAT_C_LINK_STATE     0x0040
-#define USB_PORT_STAT_C_CONFIG_ERROR   0x0080
-
-/*
- * wHubCharacteristics (masks)
- * See USB 2.0 spec Table 11-13, offset 3
- */
-#define HUB_CHAR_LPSM          0x0003 /* Logical Power Switching Mode mask */
-#define HUB_CHAR_COMMON_LPSM   0x0000 /* All ports power control at once */
-#define HUB_CHAR_INDV_PORT_LPSM        0x0001 /* per-port power control */
-#define HUB_CHAR_NO_LPSM       0x0002 /* no power switching */
-
-#define HUB_CHAR_COMPOUND      0x0004 /* hub is part of a compound device */
-
-#define HUB_CHAR_OCPM          0x0018 /* Over-Current Protection Mode mask */
-#define HUB_CHAR_COMMON_OCPM   0x0000 /* All ports Over-Current reporting */
-#define HUB_CHAR_INDV_PORT_OCPM        0x0008 /* per-port Over-current reporting */
-#define HUB_CHAR_NO_OCPM       0x0010 /* No Over-current Protection support */
-
-#define HUB_CHAR_TTTT          0x0060 /* TT Think Time mask */
-#define HUB_CHAR_PORTIND       0x0080 /* per-port indicators (LEDs) */
-
-struct usb_hub_status {
-       __le16 wHubStatus;
-       __le16 wHubChange;
-} __attribute__ ((packed));
-
-/*
- * Hub Status & Hub Change bit masks
- * See USB 2.0 spec Table 11-19 and Table 11-20
- * Bits 0 and 1 for wHubStatus and wHubChange
- * Bits 2 to 15 are reserved for both
- */
-#define HUB_STATUS_LOCAL_POWER 0x0001
-#define HUB_STATUS_OVERCURRENT 0x0002
-#define HUB_CHANGE_LOCAL_POWER 0x0001
-#define HUB_CHANGE_OVERCURRENT 0x0002
-
-
-/*
- * Hub descriptor
- * See USB 2.0 spec Table 11-13
- */
-
-#define USB_DT_HUB                     (USB_TYPE_CLASS | 0x09)
-#define USB_DT_SS_HUB                  (USB_TYPE_CLASS | 0x0a)
-#define USB_DT_HUB_NONVAR_SIZE         7
-#define USB_DT_SS_HUB_SIZE              12
-
-/*
- * Hub Device descriptor
- * USB Hub class device protocols
- */
-
-#define USB_HUB_PR_FS          0 /* Full speed hub */
-#define USB_HUB_PR_HS_NO_TT    0 /* Hi-speed hub without TT */
-#define USB_HUB_PR_HS_SINGLE_TT        1 /* Hi-speed hub with single TT */
-#define USB_HUB_PR_HS_MULTI_TT 2 /* Hi-speed hub with multiple TT */
-#define USB_HUB_PR_SS          3 /* Super speed hub */
-
-struct usb_hub_descriptor {
-       __u8  bDescLength;
-       __u8  bDescriptorType;
-       __u8  bNbrPorts;
-       __le16 wHubCharacteristics;
-       __u8  bPwrOn2PwrGood;
-       __u8  bHubContrCurrent;
-
-       /* 2.0 and 3.0 hubs differ here */
-       union {
-               struct {
-                       /* add 1 bit for hub status change; round to bytes */
-                       __u8  DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8];
-                       __u8  PortPwrCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8];
-               }  __attribute__ ((packed)) hs;
-
-               struct {
-                       __u8 bHubHdrDecLat;
-                       __le16 wHubDelay;
-                       __le16 DeviceRemovable;
-               }  __attribute__ ((packed)) ss;
-       } u;
-} __attribute__ ((packed));
-
-/* port indicator status selectors, tables 11-7 and 11-25 */
-#define HUB_LED_AUTO   0
-#define HUB_LED_AMBER  1
-#define HUB_LED_GREEN  2
-#define HUB_LED_OFF    3
-
-enum hub_led_mode {
-       INDICATOR_AUTO = 0,
-       INDICATOR_CYCLE,
-       /* software blinks for attention:  software, hardware, reserved */
-       INDICATOR_GREEN_BLINK, INDICATOR_GREEN_BLINK_OFF,
-       INDICATOR_AMBER_BLINK, INDICATOR_AMBER_BLINK_OFF,
-       INDICATOR_ALT_BLINK, INDICATOR_ALT_BLINK_OFF
-} __attribute__ ((packed));
-
-/* Transaction Translator Think Times, in bits */
-#define HUB_TTTT_8_BITS                0x00
-#define HUB_TTTT_16_BITS       0x20
-#define HUB_TTTT_24_BITS       0x40
-#define HUB_TTTT_32_BITS       0x60
-
-#endif /* __LINUX_CH11_H */
index d1d732c2838d3a48788c16fe87bd9552a8558ab8..9c210f2283dfd0268e1e7e580b1b6b3091801429 100644 (file)
  *     someone that the two other points are non-issues for that
  *     particular descriptor type.
  */
-
 #ifndef __LINUX_USB_CH9_H
 #define __LINUX_USB_CH9_H
 
-#include <linux/types.h>       /* __u8 etc */
-#include <asm/byteorder.h>     /* le16_to_cpu */
-
-/*-------------------------------------------------------------------------*/
-
-/* CONTROL REQUEST SUPPORT */
-
-/*
- * USB directions
- *
- * This bit flag is used in endpoint descriptors' bEndpointAddress field.
- * It's also one of three fields in control requests bRequestType.
- */
-#define USB_DIR_OUT                    0               /* to device */
-#define USB_DIR_IN                     0x80            /* to host */
-
-/*
- * USB types, the second of three bRequestType fields
- */
-#define USB_TYPE_MASK                  (0x03 << 5)
-#define USB_TYPE_STANDARD              (0x00 << 5)
-#define USB_TYPE_CLASS                 (0x01 << 5)
-#define USB_TYPE_VENDOR                        (0x02 << 5)
-#define USB_TYPE_RESERVED              (0x03 << 5)
-
-/*
- * USB recipients, the third of three bRequestType fields
- */
-#define USB_RECIP_MASK                 0x1f
-#define USB_RECIP_DEVICE               0x00
-#define USB_RECIP_INTERFACE            0x01
-#define USB_RECIP_ENDPOINT             0x02
-#define USB_RECIP_OTHER                        0x03
-/* From Wireless USB 1.0 */
-#define USB_RECIP_PORT                 0x04
-#define USB_RECIP_RPIPE                0x05
-
-/*
- * Standard requests, for the bRequest field of a SETUP packet.
- *
- * These are qualified by the bRequestType field, so that for example
- * TYPE_CLASS or TYPE_VENDOR specific feature flags could be retrieved
- * by a GET_STATUS request.
- */
-#define USB_REQ_GET_STATUS             0x00
-#define USB_REQ_CLEAR_FEATURE          0x01
-#define USB_REQ_SET_FEATURE            0x03
-#define USB_REQ_SET_ADDRESS            0x05
-#define USB_REQ_GET_DESCRIPTOR         0x06
-#define USB_REQ_SET_DESCRIPTOR         0x07
-#define USB_REQ_GET_CONFIGURATION      0x08
-#define USB_REQ_SET_CONFIGURATION      0x09
-#define USB_REQ_GET_INTERFACE          0x0A
-#define USB_REQ_SET_INTERFACE          0x0B
-#define USB_REQ_SYNCH_FRAME            0x0C
-#define USB_REQ_SET_SEL                        0x30
-#define USB_REQ_SET_ISOCH_DELAY                0x31
-
-#define USB_REQ_SET_ENCRYPTION         0x0D    /* Wireless USB */
-#define USB_REQ_GET_ENCRYPTION         0x0E
-#define USB_REQ_RPIPE_ABORT            0x0E
-#define USB_REQ_SET_HANDSHAKE          0x0F
-#define USB_REQ_RPIPE_RESET            0x0F
-#define USB_REQ_GET_HANDSHAKE          0x10
-#define USB_REQ_SET_CONNECTION         0x11
-#define USB_REQ_SET_SECURITY_DATA      0x12
-#define USB_REQ_GET_SECURITY_DATA      0x13
-#define USB_REQ_SET_WUSB_DATA          0x14
-#define USB_REQ_LOOPBACK_DATA_WRITE    0x15
-#define USB_REQ_LOOPBACK_DATA_READ     0x16
-#define USB_REQ_SET_INTERFACE_DS       0x17
-
-/* The Link Power Management (LPM) ECN defines USB_REQ_TEST_AND_SET command,
- * used by hubs to put ports into a new L1 suspend state, except that it
- * forgot to define its number ...
- */
-
-/*
- * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and
- * are read as a bit array returned by USB_REQ_GET_STATUS.  (So there
- * are at most sixteen features of each type.)  Hubs may also support a
- * new USB_REQ_TEST_AND_SET_FEATURE to put ports into L1 suspend.
- */
-#define USB_DEVICE_SELF_POWERED                0       /* (read only) */
-#define USB_DEVICE_REMOTE_WAKEUP       1       /* dev may initiate wakeup */
-#define USB_DEVICE_TEST_MODE           2       /* (wired high speed only) */
-#define USB_DEVICE_BATTERY             2       /* (wireless) */
-#define USB_DEVICE_B_HNP_ENABLE                3       /* (otg) dev may initiate HNP */
-#define USB_DEVICE_WUSB_DEVICE         3       /* (wireless)*/
-#define USB_DEVICE_A_HNP_SUPPORT       4       /* (otg) RH port supports HNP */
-#define USB_DEVICE_A_ALT_HNP_SUPPORT   5       /* (otg) other RH port does */
-#define USB_DEVICE_DEBUG_MODE          6       /* (special devices only) */
-
-/*
- * Test Mode Selectors
- * See USB 2.0 spec Table 9-7
- */
-#define        TEST_J          1
-#define        TEST_K          2
-#define        TEST_SE0_NAK    3
-#define        TEST_PACKET     4
-#define        TEST_FORCE_EN   5
-
-/*
- * New Feature Selectors as added by USB 3.0
- * See USB 3.0 spec Table 9-6
- */
-#define USB_DEVICE_U1_ENABLE   48      /* dev may initiate U1 transition */
-#define USB_DEVICE_U2_ENABLE   49      /* dev may initiate U2 transition */
-#define USB_DEVICE_LTM_ENABLE  50      /* dev may send LTM */
-#define USB_INTRF_FUNC_SUSPEND 0       /* function suspend */
-
-#define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00
-/*
- * Suspend Options, Table 9-7 USB 3.0 spec
- */
-#define USB_INTRF_FUNC_SUSPEND_LP      (1 << (8 + 0))
-#define USB_INTRF_FUNC_SUSPEND_RW      (1 << (8 + 1))
-
-#define USB_ENDPOINT_HALT              0       /* IN/OUT will STALL */
-
-/* Bit array elements as returned by the USB_REQ_GET_STATUS request. */
-#define USB_DEV_STAT_U1_ENABLED                2       /* transition into U1 state */
-#define USB_DEV_STAT_U2_ENABLED                3       /* transition into U2 state */
-#define USB_DEV_STAT_LTM_ENABLED       4       /* Latency tolerance messages */
-
-/**
- * struct usb_ctrlrequest - SETUP data for a USB device control request
- * @bRequestType: matches the USB bmRequestType field
- * @bRequest: matches the USB bRequest field
- * @wValue: matches the USB wValue field (le16 byte order)
- * @wIndex: matches the USB wIndex field (le16 byte order)
- * @wLength: matches the USB wLength field (le16 byte order)
- *
- * This structure is used to send control requests to a USB device.  It matches
- * the different fields of the USB 2.0 Spec section 9.3, table 9-2.  See the
- * USB spec for a fuller description of the different fields, and what they are
- * used for.
- *
- * Note that the driver for any interface can issue control requests.
- * For most devices, interfaces don't coordinate with each other, so
- * such requests may be made at any time.
- */
-struct usb_ctrlrequest {
-       __u8 bRequestType;
-       __u8 bRequest;
-       __le16 wValue;
-       __le16 wIndex;
-       __le16 wLength;
-} __attribute__ ((packed));
-
-/*-------------------------------------------------------------------------*/
-
-/*
- * STANDARD DESCRIPTORS ... as returned by GET_DESCRIPTOR, or
- * (rarely) accepted by SET_DESCRIPTOR.
- *
- * Note that all multi-byte values here are encoded in little endian
- * byte order "on the wire".  Within the kernel and when exposed
- * through the Linux-USB APIs, they are not converted to cpu byte
- * order; it is the responsibility of the client code to do this.
- * The single exception is when device and configuration descriptors (but
- * not other descriptors) are read from usbfs (i.e. /proc/bus/usb/BBB/DDD);
- * in this case the fields are converted to host endianness by the kernel.
- */
-
-/*
- * Descriptor types ... USB 2.0 spec table 9.5
- */
-#define USB_DT_DEVICE                  0x01
-#define USB_DT_CONFIG                  0x02
-#define USB_DT_STRING                  0x03
-#define USB_DT_INTERFACE               0x04
-#define USB_DT_ENDPOINT                        0x05
-#define USB_DT_DEVICE_QUALIFIER                0x06
-#define USB_DT_OTHER_SPEED_CONFIG      0x07
-#define USB_DT_INTERFACE_POWER         0x08
-/* these are from a minor usb 2.0 revision (ECN) */
-#define USB_DT_OTG                     0x09
-#define USB_DT_DEBUG                   0x0a
-#define USB_DT_INTERFACE_ASSOCIATION   0x0b
-/* these are from the Wireless USB spec */
-#define USB_DT_SECURITY                        0x0c
-#define USB_DT_KEY                     0x0d
-#define USB_DT_ENCRYPTION_TYPE         0x0e
-#define USB_DT_BOS                     0x0f
-#define USB_DT_DEVICE_CAPABILITY       0x10
-#define USB_DT_WIRELESS_ENDPOINT_COMP  0x11
-#define USB_DT_WIRE_ADAPTER            0x21
-#define USB_DT_RPIPE                   0x22
-#define USB_DT_CS_RADIO_CONTROL                0x23
-/* From the T10 UAS specification */
-#define USB_DT_PIPE_USAGE              0x24
-/* From the USB 3.0 spec */
-#define        USB_DT_SS_ENDPOINT_COMP         0x30
-
-/* Conventional codes for class-specific descriptors.  The convention is
- * defined in the USB "Common Class" Spec (3.11).  Individual class specs
- * are authoritative for their usage, not the "common class" writeup.
- */
-#define USB_DT_CS_DEVICE               (USB_TYPE_CLASS | USB_DT_DEVICE)
-#define USB_DT_CS_CONFIG               (USB_TYPE_CLASS | USB_DT_CONFIG)
-#define USB_DT_CS_STRING               (USB_TYPE_CLASS | USB_DT_STRING)
-#define USB_DT_CS_INTERFACE            (USB_TYPE_CLASS | USB_DT_INTERFACE)
-#define USB_DT_CS_ENDPOINT             (USB_TYPE_CLASS | USB_DT_ENDPOINT)
-
-/* All standard descriptors have these 2 fields at the beginning */
-struct usb_descriptor_header {
-       __u8  bLength;
-       __u8  bDescriptorType;
-} __attribute__ ((packed));
-
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_DEVICE: Device descriptor */
-struct usb_device_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __le16 bcdUSB;
-       __u8  bDeviceClass;
-       __u8  bDeviceSubClass;
-       __u8  bDeviceProtocol;
-       __u8  bMaxPacketSize0;
-       __le16 idVendor;
-       __le16 idProduct;
-       __le16 bcdDevice;
-       __u8  iManufacturer;
-       __u8  iProduct;
-       __u8  iSerialNumber;
-       __u8  bNumConfigurations;
-} __attribute__ ((packed));
-
-#define USB_DT_DEVICE_SIZE             18
-
-
-/*
- * Device and/or Interface Class codes
- * as found in bDeviceClass or bInterfaceClass
- * and defined by www.usb.org documents
- */
-#define USB_CLASS_PER_INTERFACE                0       /* for DeviceClass */
-#define USB_CLASS_AUDIO                        1
-#define USB_CLASS_COMM                 2
-#define USB_CLASS_HID                  3
-#define USB_CLASS_PHYSICAL             5
-#define USB_CLASS_STILL_IMAGE          6
-#define USB_CLASS_PRINTER              7
-#define USB_CLASS_MASS_STORAGE         8
-#define USB_CLASS_HUB                  9
-#define USB_CLASS_CDC_DATA             0x0a
-#define USB_CLASS_CSCID                        0x0b    /* chip+ smart card */
-#define USB_CLASS_CONTENT_SEC          0x0d    /* content security */
-#define USB_CLASS_VIDEO                        0x0e
-#define USB_CLASS_WIRELESS_CONTROLLER  0xe0
-#define USB_CLASS_MISC                 0xef
-#define USB_CLASS_APP_SPEC             0xfe
-#define USB_CLASS_VENDOR_SPEC          0xff
-
-#define USB_SUBCLASS_VENDOR_SPEC       0xff
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_CONFIG: Configuration descriptor information.
- *
- * USB_DT_OTHER_SPEED_CONFIG is the same descriptor, except that the
- * descriptor type is different.  Highspeed-capable devices can look
- * different depending on what speed they're currently running.  Only
- * devices with a USB_DT_DEVICE_QUALIFIER have any OTHER_SPEED_CONFIG
- * descriptors.
- */
-struct usb_config_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __le16 wTotalLength;
-       __u8  bNumInterfaces;
-       __u8  bConfigurationValue;
-       __u8  iConfiguration;
-       __u8  bmAttributes;
-       __u8  bMaxPower;
-} __attribute__ ((packed));
-
-#define USB_DT_CONFIG_SIZE             9
-
-/* from config descriptor bmAttributes */
-#define USB_CONFIG_ATT_ONE             (1 << 7)        /* must be set */
-#define USB_CONFIG_ATT_SELFPOWER       (1 << 6)        /* self powered */
-#define USB_CONFIG_ATT_WAKEUP          (1 << 5)        /* can wakeup */
-#define USB_CONFIG_ATT_BATTERY         (1 << 4)        /* battery powered */
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_STRING: String descriptor */
-struct usb_string_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __le16 wData[1];                /* UTF-16LE encoded */
-} __attribute__ ((packed));
-
-/* note that "string" zero is special, it holds language codes that
- * the device supports, not Unicode characters.
- */
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_INTERFACE: Interface descriptor */
-struct usb_interface_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __u8  bInterfaceNumber;
-       __u8  bAlternateSetting;
-       __u8  bNumEndpoints;
-       __u8  bInterfaceClass;
-       __u8  bInterfaceSubClass;
-       __u8  bInterfaceProtocol;
-       __u8  iInterface;
-} __attribute__ ((packed));
-
-#define USB_DT_INTERFACE_SIZE          9
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_ENDPOINT: Endpoint descriptor */
-struct usb_endpoint_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __u8  bEndpointAddress;
-       __u8  bmAttributes;
-       __le16 wMaxPacketSize;
-       __u8  bInterval;
-
-       /* NOTE:  these two are _only_ in audio endpoints. */
-       /* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */
-       __u8  bRefresh;
-       __u8  bSynchAddress;
-} __attribute__ ((packed));
-
-#define USB_DT_ENDPOINT_SIZE           7
-#define USB_DT_ENDPOINT_AUDIO_SIZE     9       /* Audio extension */
-
-
-/*
- * Endpoints
- */
-#define USB_ENDPOINT_NUMBER_MASK       0x0f    /* in bEndpointAddress */
-#define USB_ENDPOINT_DIR_MASK          0x80
-
-#define USB_ENDPOINT_XFERTYPE_MASK     0x03    /* in bmAttributes */
-#define USB_ENDPOINT_XFER_CONTROL      0
-#define USB_ENDPOINT_XFER_ISOC         1
-#define USB_ENDPOINT_XFER_BULK         2
-#define USB_ENDPOINT_XFER_INT          3
-#define USB_ENDPOINT_MAX_ADJUSTABLE    0x80
-
-/* The USB 3.0 spec redefines bits 5:4 of bmAttributes as interrupt ep type. */
-#define USB_ENDPOINT_INTRTYPE          0x30
-#define USB_ENDPOINT_INTR_PERIODIC     (0 << 4)
-#define USB_ENDPOINT_INTR_NOTIFICATION (1 << 4)
-
-#define USB_ENDPOINT_SYNCTYPE          0x0c
-#define USB_ENDPOINT_SYNC_NONE         (0 << 2)
-#define USB_ENDPOINT_SYNC_ASYNC                (1 << 2)
-#define USB_ENDPOINT_SYNC_ADAPTIVE     (2 << 2)
-#define USB_ENDPOINT_SYNC_SYNC         (3 << 2)
-
-#define USB_ENDPOINT_USAGE_MASK                0x30
-#define USB_ENDPOINT_USAGE_DATA                0x00
-#define USB_ENDPOINT_USAGE_FEEDBACK    0x10
-#define USB_ENDPOINT_USAGE_IMPLICIT_FB 0x20    /* Implicit feedback Data endpoint */
-
-/*-------------------------------------------------------------------------*/
-
-/**
- * usb_endpoint_num - get the endpoint's number
- * @epd: endpoint to be checked
- *
- * Returns @epd's number: 0 to 15.
- */
-static inline int usb_endpoint_num(const struct usb_endpoint_descriptor *epd)
-{
-       return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
-}
-
-/**
- * usb_endpoint_type - get the endpoint's transfer type
- * @epd: endpoint to be checked
- *
- * Returns one of USB_ENDPOINT_XFER_{CONTROL, ISOC, BULK, INT} according
- * to @epd's transfer type.
- */
-static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd)
-{
-       return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
-}
-
-/**
- * usb_endpoint_dir_in - check if the endpoint has IN direction
- * @epd: endpoint to be checked
- *
- * Returns true if the endpoint is of type IN, otherwise it returns false.
- */
-static inline int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd)
-{
-       return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN);
-}
-
-/**
- * usb_endpoint_dir_out - check if the endpoint has OUT direction
- * @epd: endpoint to be checked
- *
- * Returns true if the endpoint is of type OUT, otherwise it returns false.
- */
-static inline int usb_endpoint_dir_out(
-                               const struct usb_endpoint_descriptor *epd)
-{
-       return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT);
-}
-
-/**
- * usb_endpoint_xfer_bulk - check if the endpoint has bulk transfer type
- * @epd: endpoint to be checked
- *
- * Returns true if the endpoint is of type bulk, otherwise it returns false.
- */
-static inline int usb_endpoint_xfer_bulk(
-                               const struct usb_endpoint_descriptor *epd)
-{
-       return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
-               USB_ENDPOINT_XFER_BULK);
-}
-
-/**
- * usb_endpoint_xfer_control - check if the endpoint has control transfer type
- * @epd: endpoint to be checked
- *
- * Returns true if the endpoint is of type control, otherwise it returns false.
- */
-static inline int usb_endpoint_xfer_control(
-                               const struct usb_endpoint_descriptor *epd)
-{
-       return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
-               USB_ENDPOINT_XFER_CONTROL);
-}
-
-/**
- * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type
- * @epd: endpoint to be checked
- *
- * Returns true if the endpoint is of type interrupt, otherwise it returns
- * false.
- */
-static inline int usb_endpoint_xfer_int(
-                               const struct usb_endpoint_descriptor *epd)
-{
-       return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
-               USB_ENDPOINT_XFER_INT);
-}
-
-/**
- * usb_endpoint_xfer_isoc - check if the endpoint has isochronous transfer type
- * @epd: endpoint to be checked
- *
- * Returns true if the endpoint is of type isochronous, otherwise it returns
- * false.
- */
-static inline int usb_endpoint_xfer_isoc(
-                               const struct usb_endpoint_descriptor *epd)
-{
-       return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
-               USB_ENDPOINT_XFER_ISOC);
-}
-
-/**
- * usb_endpoint_is_bulk_in - check if the endpoint is bulk IN
- * @epd: endpoint to be checked
- *
- * Returns true if the endpoint has bulk transfer type and IN direction,
- * otherwise it returns false.
- */
-static inline int usb_endpoint_is_bulk_in(
-                               const struct usb_endpoint_descriptor *epd)
-{
-       return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd);
-}
-
-/**
- * usb_endpoint_is_bulk_out - check if the endpoint is bulk OUT
- * @epd: endpoint to be checked
- *
- * Returns true if the endpoint has bulk transfer type and OUT direction,
- * otherwise it returns false.
- */
-static inline int usb_endpoint_is_bulk_out(
-                               const struct usb_endpoint_descriptor *epd)
-{
-       return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd);
-}
-
-/**
- * usb_endpoint_is_int_in - check if the endpoint is interrupt IN
- * @epd: endpoint to be checked
- *
- * Returns true if the endpoint has interrupt transfer type and IN direction,
- * otherwise it returns false.
- */
-static inline int usb_endpoint_is_int_in(
-                               const struct usb_endpoint_descriptor *epd)
-{
-       return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd);
-}
-
-/**
- * usb_endpoint_is_int_out - check if the endpoint is interrupt OUT
- * @epd: endpoint to be checked
- *
- * Returns true if the endpoint has interrupt transfer type and OUT direction,
- * otherwise it returns false.
- */
-static inline int usb_endpoint_is_int_out(
-                               const struct usb_endpoint_descriptor *epd)
-{
-       return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd);
-}
-
-/**
- * usb_endpoint_is_isoc_in - check if the endpoint is isochronous IN
- * @epd: endpoint to be checked
- *
- * Returns true if the endpoint has isochronous transfer type and IN direction,
- * otherwise it returns false.
- */
-static inline int usb_endpoint_is_isoc_in(
-                               const struct usb_endpoint_descriptor *epd)
-{
-       return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd);
-}
-
-/**
- * usb_endpoint_is_isoc_out - check if the endpoint is isochronous OUT
- * @epd: endpoint to be checked
- *
- * Returns true if the endpoint has isochronous transfer type and OUT direction,
- * otherwise it returns false.
- */
-static inline int usb_endpoint_is_isoc_out(
-                               const struct usb_endpoint_descriptor *epd)
-{
-       return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd);
-}
-
-/**
- * usb_endpoint_maxp - get endpoint's max packet size
- * @epd: endpoint to be checked
- *
- * Returns @epd's max packet
- */
-static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd)
-{
-       return __le16_to_cpu(epd->wMaxPacketSize);
-}
-
-static inline int usb_endpoint_interrupt_type(
-               const struct usb_endpoint_descriptor *epd)
-{
-       return epd->bmAttributes & USB_ENDPOINT_INTRTYPE;
-}
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */
-struct usb_ss_ep_comp_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __u8  bMaxBurst;
-       __u8  bmAttributes;
-       __le16 wBytesPerInterval;
-} __attribute__ ((packed));
-
-#define USB_DT_SS_EP_COMP_SIZE         6
-
-/* Bits 4:0 of bmAttributes if this is a bulk endpoint */
-static inline int
-usb_ss_max_streams(const struct usb_ss_ep_comp_descriptor *comp)
-{
-       int             max_streams;
-
-       if (!comp)
-               return 0;
-
-       max_streams = comp->bmAttributes & 0x1f;
-
-       if (!max_streams)
-               return 0;
-
-       max_streams = 1 << max_streams;
-
-       return max_streams;
-}
-
-/* Bits 1:0 of bmAttributes if this is an isoc endpoint */
-#define USB_SS_MULT(p)                 (1 + ((p) & 0x3))
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_DEVICE_QUALIFIER: Device Qualifier descriptor */
-struct usb_qualifier_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __le16 bcdUSB;
-       __u8  bDeviceClass;
-       __u8  bDeviceSubClass;
-       __u8  bDeviceProtocol;
-       __u8  bMaxPacketSize0;
-       __u8  bNumConfigurations;
-       __u8  bRESERVED;
-} __attribute__ ((packed));
-
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_OTG (from OTG 1.0a supplement) */
-struct usb_otg_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __u8  bmAttributes;     /* support for HNP, SRP, etc */
-} __attribute__ ((packed));
-
-/* from usb_otg_descriptor.bmAttributes */
-#define USB_OTG_SRP            (1 << 0)
-#define USB_OTG_HNP            (1 << 1)        /* swap host/device roles */
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_DEBUG:  for special highspeed devices, replacing serial console */
-struct usb_debug_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       /* bulk endpoints with 8 byte maxpacket */
-       __u8  bDebugInEndpoint;
-       __u8  bDebugOutEndpoint;
-} __attribute__((packed));
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */
-struct usb_interface_assoc_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __u8  bFirstInterface;
-       __u8  bInterfaceCount;
-       __u8  bFunctionClass;
-       __u8  bFunctionSubClass;
-       __u8  bFunctionProtocol;
-       __u8  iFunction;
-} __attribute__ ((packed));
-
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_SECURITY:  group of wireless security descriptors, including
- * encryption types available for setting up a CC/association.
- */
-struct usb_security_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __le16 wTotalLength;
-       __u8  bNumEncryptionTypes;
-} __attribute__((packed));
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_KEY:  used with {GET,SET}_SECURITY_DATA; only public keys
- * may be retrieved.
- */
-struct usb_key_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __u8  tTKID[3];
-       __u8  bReserved;
-       __u8  bKeyData[0];
-} __attribute__((packed));
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_ENCRYPTION_TYPE:  bundled in DT_SECURITY groups */
-struct usb_encryption_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __u8  bEncryptionType;
-#define        USB_ENC_TYPE_UNSECURE           0
-#define        USB_ENC_TYPE_WIRED              1       /* non-wireless mode */
-#define        USB_ENC_TYPE_CCM_1              2       /* aes128/cbc session */
-#define        USB_ENC_TYPE_RSA_1              3       /* rsa3072/sha1 auth */
-       __u8  bEncryptionValue;         /* use in SET_ENCRYPTION */
-       __u8  bAuthKeyIndex;
-} __attribute__((packed));
-
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_BOS:  group of device-level capabilities */
-struct usb_bos_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __le16 wTotalLength;
-       __u8  bNumDeviceCaps;
-} __attribute__((packed));
-
-#define USB_DT_BOS_SIZE                5
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_DEVICE_CAPABILITY:  grouped with BOS */
-struct usb_dev_cap_header {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDevCapabilityType;
-} __attribute__((packed));
-
-#define        USB_CAP_TYPE_WIRELESS_USB       1
-
-struct usb_wireless_cap_descriptor {   /* Ultra Wide Band */
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDevCapabilityType;
-
-       __u8  bmAttributes;
-#define        USB_WIRELESS_P2P_DRD            (1 << 1)
-#define        USB_WIRELESS_BEACON_MASK        (3 << 2)
-#define        USB_WIRELESS_BEACON_SELF        (1 << 2)
-#define        USB_WIRELESS_BEACON_DIRECTED    (2 << 2)
-#define        USB_WIRELESS_BEACON_NONE        (3 << 2)
-       __le16 wPHYRates;       /* bit rates, Mbps */
-#define        USB_WIRELESS_PHY_53             (1 << 0)        /* always set */
-#define        USB_WIRELESS_PHY_80             (1 << 1)
-#define        USB_WIRELESS_PHY_107            (1 << 2)        /* always set */
-#define        USB_WIRELESS_PHY_160            (1 << 3)
-#define        USB_WIRELESS_PHY_200            (1 << 4)        /* always set */
-#define        USB_WIRELESS_PHY_320            (1 << 5)
-#define        USB_WIRELESS_PHY_400            (1 << 6)
-#define        USB_WIRELESS_PHY_480            (1 << 7)
-       __u8  bmTFITXPowerInfo; /* TFI power levels */
-       __u8  bmFFITXPowerInfo; /* FFI power levels */
-       __le16 bmBandGroup;
-       __u8  bReserved;
-} __attribute__((packed));
-
-/* USB 2.0 Extension descriptor */
-#define        USB_CAP_TYPE_EXT                2
-
-struct usb_ext_cap_descriptor {                /* Link Power Management */
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDevCapabilityType;
-       __le32 bmAttributes;
-#define USB_LPM_SUPPORT                        (1 << 1)        /* supports LPM */
-#define USB_BESL_SUPPORT               (1 << 2)        /* supports BESL */
-#define USB_BESL_BASELINE_VALID                (1 << 3)        /* Baseline BESL valid*/
-#define USB_BESL_DEEP_VALID            (1 << 4)        /* Deep BESL valid */
-#define USB_GET_BESL_BASELINE(p)       (((p) & (0xf << 8)) >> 8)
-#define USB_GET_BESL_DEEP(p)           (((p) & (0xf << 12)) >> 12)
-} __attribute__((packed));
-
-#define USB_DT_USB_EXT_CAP_SIZE        7
-
-/*
- * SuperSpeed USB Capability descriptor: Defines the set of SuperSpeed USB
- * specific device level capabilities
- */
-#define                USB_SS_CAP_TYPE         3
-struct usb_ss_cap_descriptor {         /* Link Power Management */
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDevCapabilityType;
-       __u8  bmAttributes;
-#define USB_LTM_SUPPORT                        (1 << 1) /* supports LTM */
-       __le16 wSpeedSupported;
-#define USB_LOW_SPEED_OPERATION                (1)      /* Low speed operation */
-#define USB_FULL_SPEED_OPERATION       (1 << 1) /* Full speed operation */
-#define USB_HIGH_SPEED_OPERATION       (1 << 2) /* High speed operation */
-#define USB_5GBPS_OPERATION            (1 << 3) /* Operation at 5Gbps */
-       __u8  bFunctionalitySupport;
-       __u8  bU1devExitLat;
-       __le16 bU2DevExitLat;
-} __attribute__((packed));
-
-#define USB_DT_USB_SS_CAP_SIZE 10
-
-/*
- * Container ID Capability descriptor: Defines the instance unique ID used to
- * identify the instance across all operating modes
- */
-#define        CONTAINER_ID_TYPE       4
-struct usb_ss_container_id_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDevCapabilityType;
-       __u8  bReserved;
-       __u8  ContainerID[16]; /* 128-bit number */
-} __attribute__((packed));
-
-#define USB_DT_USB_SS_CONTN_ID_SIZE    20
-/*-------------------------------------------------------------------------*/
-
-/* USB_DT_WIRELESS_ENDPOINT_COMP:  companion descriptor associated with
- * each endpoint descriptor for a wireless device
- */
-struct usb_wireless_ep_comp_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __u8  bMaxBurst;
-       __u8  bMaxSequence;
-       __le16 wMaxStreamDelay;
-       __le16 wOverTheAirPacketSize;
-       __u8  bOverTheAirInterval;
-       __u8  bmCompAttributes;
-#define USB_ENDPOINT_SWITCH_MASK       0x03    /* in bmCompAttributes */
-#define USB_ENDPOINT_SWITCH_NO         0
-#define USB_ENDPOINT_SWITCH_SWITCH     1
-#define USB_ENDPOINT_SWITCH_SCALE      2
-} __attribute__((packed));
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_REQ_SET_HANDSHAKE is a four-way handshake used between a wireless
- * host and a device for connection set up, mutual authentication, and
- * exchanging short lived session keys.  The handshake depends on a CC.
- */
-struct usb_handshake {
-       __u8 bMessageNumber;
-       __u8 bStatus;
-       __u8 tTKID[3];
-       __u8 bReserved;
-       __u8 CDID[16];
-       __u8 nonce[16];
-       __u8 MIC[8];
-} __attribute__((packed));
-
-/*-------------------------------------------------------------------------*/
-
-/* USB_REQ_SET_CONNECTION modifies or revokes a connection context (CC).
- * A CC may also be set up using non-wireless secure channels (including
- * wired USB!), and some devices may support CCs with multiple hosts.
- */
-struct usb_connection_context {
-       __u8 CHID[16];          /* persistent host id */
-       __u8 CDID[16];          /* device id (unique w/in host context) */
-       __u8 CK[16];            /* connection key */
-} __attribute__((packed));
-
-/*-------------------------------------------------------------------------*/
+#include <uapi/linux/usb/ch9.h>
 
-/* USB 2.0 defines three speeds, here's how Linux identifies them */
-
-enum usb_device_speed {
-       USB_SPEED_UNKNOWN = 0,                  /* enumerating */
-       USB_SPEED_LOW, USB_SPEED_FULL,          /* usb 1.1 */
-       USB_SPEED_HIGH,                         /* usb 2.0 */
-       USB_SPEED_WIRELESS,                     /* wireless (usb 2.5) */
-       USB_SPEED_SUPER,                        /* usb 3.0 */
-};
-
-#ifdef __KERNEL__
 
 /**
  * usb_speed_string() - Returns human readable-name of the speed.
@@ -919,86 +43,4 @@ enum usb_device_speed {
  */
 extern const char *usb_speed_string(enum usb_device_speed speed);
 
-#endif
-
-enum usb_device_state {
-       /* NOTATTACHED isn't in the USB spec, and this state acts
-        * the same as ATTACHED ... but it's clearer this way.
-        */
-       USB_STATE_NOTATTACHED = 0,
-
-       /* chapter 9 and authentication (wireless) device states */
-       USB_STATE_ATTACHED,
-       USB_STATE_POWERED,                      /* wired */
-       USB_STATE_RECONNECTING,                 /* auth */
-       USB_STATE_UNAUTHENTICATED,              /* auth */
-       USB_STATE_DEFAULT,                      /* limited function */
-       USB_STATE_ADDRESS,
-       USB_STATE_CONFIGURED,                   /* most functions */
-
-       USB_STATE_SUSPENDED
-
-       /* NOTE:  there are actually four different SUSPENDED
-        * states, returning to POWERED, DEFAULT, ADDRESS, or
-        * CONFIGURED respectively when SOF tokens flow again.
-        * At this level there's no difference between L1 and L2
-        * suspend states.  (L2 being original USB 1.1 suspend.)
-        */
-};
-
-enum usb3_link_state {
-       USB3_LPM_U0 = 0,
-       USB3_LPM_U1,
-       USB3_LPM_U2,
-       USB3_LPM_U3
-};
-
-/*
- * A U1 timeout of 0x0 means the parent hub will reject any transitions to U1.
- * 0xff means the parent hub will accept transitions to U1, but will not
- * initiate a transition.
- *
- * A U1 timeout of 0x1 to 0x7F also causes the hub to initiate a transition to
- * U1 after that many microseconds.  Timeouts of 0x80 to 0xFE are reserved
- * values.
- *
- * A U2 timeout of 0x0 means the parent hub will reject any transitions to U2.
- * 0xff means the parent hub will accept transitions to U2, but will not
- * initiate a transition.
- *
- * A U2 timeout of 0x1 to 0xFE also causes the hub to initiate a transition to
- * U2 after N*256 microseconds.  Therefore a U2 timeout value of 0x1 means a U2
- * idle timer of 256 microseconds, 0x2 means 512 microseconds, 0xFE means
- * 65.024ms.
- */
-#define USB3_LPM_DISABLED              0x0
-#define USB3_LPM_U1_MAX_TIMEOUT                0x7F
-#define USB3_LPM_U2_MAX_TIMEOUT                0xFE
-#define USB3_LPM_DEVICE_INITIATED      0xFF
-
-struct usb_set_sel_req {
-       __u8    u1_sel;
-       __u8    u1_pel;
-       __le16  u2_sel;
-       __le16  u2_pel;
-} __attribute__ ((packed));
-
-/*
- * The Set System Exit Latency control transfer provides one byte each for
- * U1 SEL and U1 PEL, so the max exit latency is 0xFF.  U2 SEL and U2 PEL each
- * are two bytes long.
- */
-#define USB3_LPM_MAX_U1_SEL_PEL                0xFF
-#define USB3_LPM_MAX_U2_SEL_PEL                0xFFFF
-
-/*-------------------------------------------------------------------------*/
-
-/*
- * As per USB compliance update, a device that is actively drawing
- * more than 100mA from USB must report itself as bus-powered in
- * the GetStatus(DEVICE) call.
- * http://compliance.usb.org/index.asp?UpdateFile=Electrical&Format=Standard#34
- */
-#define USB_SELF_POWER_VBUS_MAX_DRAW           100
-
 #endif /* __LINUX_USB_CH9_H */
index a843d085136459974720cc6c9f5149406c6877c6..65d0a88dbc675c8bb7d2bfe6256183cfd8a18ec0 100644 (file)
@@ -1,171 +1,8 @@
 #ifndef __LINUX_FUNCTIONFS_H__
 #define __LINUX_FUNCTIONFS_H__ 1
 
+#include <uapi/linux/usb/functionfs.h>
 
-#include <linux/types.h>
-#include <linux/ioctl.h>
-
-#include <linux/usb/ch9.h>
-
-
-enum {
-       FUNCTIONFS_DESCRIPTORS_MAGIC = 1,
-       FUNCTIONFS_STRINGS_MAGIC     = 2
-};
-
-
-#ifndef __KERNEL__
-
-/* Descriptor of an non-audio endpoint */
-struct usb_endpoint_descriptor_no_audio {
-       __u8  bLength;
-       __u8  bDescriptorType;
-
-       __u8  bEndpointAddress;
-       __u8  bmAttributes;
-       __le16 wMaxPacketSize;
-       __u8  bInterval;
-} __attribute__((packed));
-
-
-/*
- * All numbers must be in little endian order.
- */
-
-struct usb_functionfs_descs_head {
-       __le32 magic;
-       __le32 length;
-       __le32 fs_count;
-       __le32 hs_count;
-} __attribute__((packed));
-
-/*
- * Descriptors format:
- *
- * | off | name      | type         | description                          |
- * |-----+-----------+--------------+--------------------------------------|
- * |   0 | magic     | LE32         | FUNCTIONFS_{FS,HS}_DESCRIPTORS_MAGIC |
- * |   4 | length    | LE32         | length of the whole data chunk       |
- * |   8 | fs_count  | LE32         | number of full-speed descriptors     |
- * |  12 | hs_count  | LE32         | number of high-speed descriptors     |
- * |  16 | fs_descrs | Descriptor[] | list of full-speed descriptors       |
- * |     | hs_descrs | Descriptor[] | list of high-speed descriptors       |
- *
- * descs are just valid USB descriptors and have the following format:
- *
- * | off | name            | type | description              |
- * |-----+-----------------+------+--------------------------|
- * |   0 | bLength         | U8   | length of the descriptor |
- * |   1 | bDescriptorType | U8   | descriptor type          |
- * |   2 | payload         |      | descriptor's payload     |
- */
-
-struct usb_functionfs_strings_head {
-       __le32 magic;
-       __le32 length;
-       __le32 str_count;
-       __le32 lang_count;
-} __attribute__((packed));
-
-/*
- * Strings format:
- *
- * | off | name       | type                  | description                |
- * |-----+------------+-----------------------+----------------------------|
- * |   0 | magic      | LE32                  | FUNCTIONFS_STRINGS_MAGIC   |
- * |   4 | length     | LE32                  | length of the data chunk   |
- * |   8 | str_count  | LE32                  | number of strings          |
- * |  12 | lang_count | LE32                  | number of languages        |
- * |  16 | stringtab  | StringTab[lang_count] | table of strings per lang  |
- *
- * For each language there is one stringtab entry (ie. there are lang_count
- * stringtab entires).  Each StringTab has following format:
- *
- * | off | name    | type              | description                        |
- * |-----+---------+-------------------+------------------------------------|
- * |   0 | lang    | LE16              | language code                      |
- * |   2 | strings | String[str_count] | array of strings in given language |
- *
- * For each string there is one strings entry (ie. there are str_count
- * string entries).  Each String is a NUL terminated string encoded in
- * UTF-8.
- */
-
-#endif
-
-
-/*
- * Events are delivered on the ep0 file descriptor, when the user mode driver
- * reads from this file descriptor after writing the descriptors.  Don't
- * stop polling this descriptor.
- */
-
-enum usb_functionfs_event_type {
-       FUNCTIONFS_BIND,
-       FUNCTIONFS_UNBIND,
-
-       FUNCTIONFS_ENABLE,
-       FUNCTIONFS_DISABLE,
-
-       FUNCTIONFS_SETUP,
-
-       FUNCTIONFS_SUSPEND,
-       FUNCTIONFS_RESUME
-};
-
-/* NOTE:  this structure must stay the same size and layout on
- * both 32-bit and 64-bit kernels.
- */
-struct usb_functionfs_event {
-       union {
-               /* SETUP: packet; DATA phase i/o precedes next event
-                *(setup.bmRequestType & USB_DIR_IN) flags direction */
-               struct usb_ctrlrequest  setup;
-       } __attribute__((packed)) u;
-
-       /* enum usb_functionfs_event_type */
-       __u8                            type;
-       __u8                            _pad[3];
-} __attribute__((packed));
-
-
-/* Endpoint ioctls */
-/* The same as in gadgetfs */
-
-/* IN transfers may be reported to the gadget driver as complete
- *     when the fifo is loaded, before the host reads the data;
- * OUT transfers may be reported to the host's "client" driver as
- *     complete when they're sitting in the FIFO unread.
- * THIS returns how many bytes are "unclaimed" in the endpoint fifo
- * (needed for precise fault handling, when the hardware allows it)
- */
-#define        FUNCTIONFS_FIFO_STATUS  _IO('g', 1)
-
-/* discards any unclaimed data in the fifo. */
-#define        FUNCTIONFS_FIFO_FLUSH   _IO('g', 2)
-
-/* resets endpoint halt+toggle; used to implement set_interface.
- * some hardware (like pxa2xx) can't support this.
- */
-#define        FUNCTIONFS_CLEAR_HALT   _IO('g', 3)
-
-/* Specific for functionfs */
-
-/*
- * Returns reverse mapping of an interface.  Called on EP0.  If there
- * is no such interface returns -EDOM.  If function is not active
- * returns -ENODEV.
- */
-#define        FUNCTIONFS_INTERFACE_REVMAP     _IO('g', 128)
-
-/*
- * Returns real bEndpointAddress of an endpoint.  If function is not
- * active returns -ENODEV.
- */
-#define        FUNCTIONFS_ENDPOINT_REVMAP      _IO('g', 129)
-
-
-#ifdef __KERNEL__
 
 struct ffs_data;
 struct usb_composite_dev;
@@ -197,5 +34,3 @@ static void functionfs_release_dev_callback(struct ffs_data *ffs_data)
 
 
 #endif
-
-#endif
diff --git a/include/linux/usb/g_printer.h b/include/linux/usb/g_printer.h
deleted file mode 100644 (file)
index 6178fde..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * g_printer.h -- Header file for USB Printer gadget driver
- *
- * Copyright (C) 2007 Craig W. Nadler
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __LINUX_USB_G_PRINTER_H
-#define __LINUX_USB_G_PRINTER_H
-
-#define PRINTER_NOT_ERROR      0x08
-#define PRINTER_SELECTED       0x10
-#define PRINTER_PAPER_EMPTY    0x20
-
-/* The 'g' code is also used by gadgetfs ioctl requests.
- * Don't add any colliding codes to either driver, and keep
- * them in unique ranges (size 0x20 for now).
- */
-#define GADGET_GET_PRINTER_STATUS      _IOR('g', 0x21, unsigned char)
-#define GADGET_SET_PRINTER_STATUS      _IOWR('g', 0x22, unsigned char)
-
-#endif /* __LINUX_USB_G_PRINTER_H */
diff --git a/include/linux/usb/gadgetfs.h b/include/linux/usb/gadgetfs.h
deleted file mode 100644 (file)
index 0bb12e0..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Filesystem based user-mode API to USB Gadget controller hardware
- *
- * Other than ep0 operations, most things are done by read() and write()
- * on endpoint files found in one directory.  They are configured by
- * writing descriptors, and then may be used for normal stream style
- * i/o requests.  When ep0 is configured, the device can enumerate;
- * when it's closed, the device disconnects from usb.  Operations on
- * ep0 require ioctl() operations.
- *
- * Configuration and device descriptors get written to /dev/gadget/$CHIP,
- * which may then be used to read usb_gadgetfs_event structs.  The driver
- * may activate endpoints as it handles SET_CONFIGURATION setup events,
- * or earlier; writing endpoint descriptors to /dev/gadget/$ENDPOINT
- * then performing data transfers by reading or writing.
- */
-
-#ifndef __LINUX_USB_GADGETFS_H
-#define __LINUX_USB_GADGETFS_H
-
-#include <linux/types.h>
-#include <linux/ioctl.h>
-
-#include <linux/usb/ch9.h>
-
-/*
- * Events are delivered on the ep0 file descriptor, when the user mode driver
- * reads from this file descriptor after writing the descriptors.  Don't
- * stop polling this descriptor.
- */
-
-enum usb_gadgetfs_event_type {
-       GADGETFS_NOP = 0,
-
-       GADGETFS_CONNECT,
-       GADGETFS_DISCONNECT,
-       GADGETFS_SETUP,
-       GADGETFS_SUSPEND,
-       /* and likely more ! */
-};
-
-/* NOTE:  this structure must stay the same size and layout on
- * both 32-bit and 64-bit kernels.
- */
-struct usb_gadgetfs_event {
-       union {
-               /* NOP, DISCONNECT, SUSPEND: nothing
-                * ... some hardware can't report disconnection
-                */
-
-               /* CONNECT: just the speed */
-               enum usb_device_speed   speed;
-
-               /* SETUP: packet; DATA phase i/o precedes next event
-                *(setup.bmRequestType & USB_DIR_IN) flags direction
-                * ... includes SET_CONFIGURATION, SET_INTERFACE
-                */
-               struct usb_ctrlrequest  setup;
-       } u;
-       enum usb_gadgetfs_event_type    type;
-};
-
-
-/* The 'g' code is also used by printer gadget ioctl requests.
- * Don't add any colliding codes to either driver, and keep
- * them in unique ranges (size 0x20 for now).
- */
-
-/* endpoint ioctls */
-
-/* IN transfers may be reported to the gadget driver as complete
- *     when the fifo is loaded, before the host reads the data;
- * OUT transfers may be reported to the host's "client" driver as
- *     complete when they're sitting in the FIFO unread.
- * THIS returns how many bytes are "unclaimed" in the endpoint fifo
- * (needed for precise fault handling, when the hardware allows it)
- */
-#define        GADGETFS_FIFO_STATUS    _IO('g', 1)
-
-/* discards any unclaimed data in the fifo. */
-#define        GADGETFS_FIFO_FLUSH     _IO('g', 2)
-
-/* resets endpoint halt+toggle; used to implement set_interface.
- * some hardware (like pxa2xx) can't support this.
- */
-#define        GADGETFS_CLEAR_HALT     _IO('g', 3)
-
-#endif /* __LINUX_USB_GADGETFS_H */
diff --git a/include/linux/usb/midi.h b/include/linux/usb/midi.h
deleted file mode 100644 (file)
index c8c52e3..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * <linux/usb/midi.h> -- USB MIDI definitions.
- *
- * Copyright (C) 2006 Thumtronics Pty Ltd.
- * Developed for Thumtronics by Grey Innovation
- * Ben Williamson <ben.williamson@greyinnovation.com>
- *
- * This software is distributed under the terms of the GNU General Public
- * License ("GPL") version 2, as published by the Free Software Foundation.
- *
- * This file holds USB constants and structures defined
- * by the USB Device Class Definition for MIDI Devices.
- * Comments below reference relevant sections of that document:
- *
- * http://www.usb.org/developers/devclass_docs/midi10.pdf
- */
-
-#ifndef __LINUX_USB_MIDI_H
-#define __LINUX_USB_MIDI_H
-
-#include <linux/types.h>
-
-/* A.1  MS Class-Specific Interface Descriptor Subtypes */
-#define USB_MS_HEADER          0x01
-#define USB_MS_MIDI_IN_JACK    0x02
-#define USB_MS_MIDI_OUT_JACK   0x03
-#define USB_MS_ELEMENT         0x04
-
-/* A.2  MS Class-Specific Endpoint Descriptor Subtypes */
-#define USB_MS_GENERAL         0x01
-
-/* A.3  MS MIDI IN and OUT Jack Types */
-#define USB_MS_EMBEDDED                0x01
-#define USB_MS_EXTERNAL                0x02
-
-/* 6.1.2.1  Class-Specific MS Interface Header Descriptor */
-struct usb_ms_header_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubtype;
-       __le16 bcdMSC;
-       __le16 wTotalLength;
-} __attribute__ ((packed));
-
-#define USB_DT_MS_HEADER_SIZE  7
-
-/* 6.1.2.2  MIDI IN Jack Descriptor */
-struct usb_midi_in_jack_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;          /* USB_DT_CS_INTERFACE */
-       __u8  bDescriptorSubtype;       /* USB_MS_MIDI_IN_JACK */
-       __u8  bJackType;                /* USB_MS_EMBEDDED/EXTERNAL */
-       __u8  bJackID;
-       __u8  iJack;
-} __attribute__ ((packed));
-
-#define USB_DT_MIDI_IN_SIZE    6
-
-struct usb_midi_source_pin {
-       __u8  baSourceID;
-       __u8  baSourcePin;
-} __attribute__ ((packed));
-
-/* 6.1.2.3  MIDI OUT Jack Descriptor */
-struct usb_midi_out_jack_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;          /* USB_DT_CS_INTERFACE */
-       __u8  bDescriptorSubtype;       /* USB_MS_MIDI_OUT_JACK */
-       __u8  bJackType;                /* USB_MS_EMBEDDED/EXTERNAL */
-       __u8  bJackID;
-       __u8  bNrInputPins;             /* p */
-       struct usb_midi_source_pin pins[]; /* [p] */
-       /*__u8  iJack;  -- omitted due to variable-sized pins[] */
-} __attribute__ ((packed));
-
-#define USB_DT_MIDI_OUT_SIZE(p)        (7 + 2 * (p))
-
-/* As above, but more useful for defining your own descriptors: */
-#define DECLARE_USB_MIDI_OUT_JACK_DESCRIPTOR(p)                        \
-struct usb_midi_out_jack_descriptor_##p {                      \
-       __u8  bLength;                                          \
-       __u8  bDescriptorType;                                  \
-       __u8  bDescriptorSubtype;                               \
-       __u8  bJackType;                                        \
-       __u8  bJackID;                                          \
-       __u8  bNrInputPins;                                     \
-       struct usb_midi_source_pin pins[p];                     \
-       __u8  iJack;                                            \
-} __attribute__ ((packed))
-
-/* 6.2.2  Class-Specific MS Bulk Data Endpoint Descriptor */
-struct usb_ms_endpoint_descriptor {
-       __u8  bLength;                  /* 4+n */
-       __u8  bDescriptorType;          /* USB_DT_CS_ENDPOINT */
-       __u8  bDescriptorSubtype;       /* USB_MS_GENERAL */
-       __u8  bNumEmbMIDIJack;          /* n */
-       __u8  baAssocJackID[];          /* [n] */
-} __attribute__ ((packed));
-
-#define USB_DT_MS_ENDPOINT_SIZE(n)     (4 + (n))
-
-/* As above, but more useful for defining your own descriptors: */
-#define DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(n)                  \
-struct usb_ms_endpoint_descriptor_##n {                                \
-       __u8  bLength;                                          \
-       __u8  bDescriptorType;                                  \
-       __u8  bDescriptorSubtype;                               \
-       __u8  bNumEmbMIDIJack;                                  \
-       __u8  baAssocJackID[n];                                 \
-} __attribute__ ((packed))
-
-#endif /* __LINUX_USB_MIDI_H */
diff --git a/include/linux/usb/tmc.h b/include/linux/usb/tmc.h
deleted file mode 100644 (file)
index c045ae1..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2007 Stefan Kopp, Gechingen, Germany
- * Copyright (C) 2008 Novell, Inc.
- * Copyright (C) 2008 Greg Kroah-Hartman <gregkh@suse.de>
- *
- * This file holds USB constants defined by the USB Device Class
- * Definition for Test and Measurement devices published by the USB-IF.
- *
- * It also has the ioctl definitions for the usbtmc kernel driver that
- * userspace needs to know about.
- */
-
-#ifndef __LINUX_USB_TMC_H
-#define __LINUX_USB_TMC_H
-
-/* USB TMC status values */
-#define USBTMC_STATUS_SUCCESS                          0x01
-#define USBTMC_STATUS_PENDING                          0x02
-#define USBTMC_STATUS_FAILED                           0x80
-#define USBTMC_STATUS_TRANSFER_NOT_IN_PROGRESS         0x81
-#define USBTMC_STATUS_SPLIT_NOT_IN_PROGRESS            0x82
-#define USBTMC_STATUS_SPLIT_IN_PROGRESS                        0x83
-
-/* USB TMC requests values */
-#define USBTMC_REQUEST_INITIATE_ABORT_BULK_OUT         1
-#define USBTMC_REQUEST_CHECK_ABORT_BULK_OUT_STATUS     2
-#define USBTMC_REQUEST_INITIATE_ABORT_BULK_IN          3
-#define USBTMC_REQUEST_CHECK_ABORT_BULK_IN_STATUS      4
-#define USBTMC_REQUEST_INITIATE_CLEAR                  5
-#define USBTMC_REQUEST_CHECK_CLEAR_STATUS              6
-#define USBTMC_REQUEST_GET_CAPABILITIES                        7
-#define USBTMC_REQUEST_INDICATOR_PULSE                 64
-
-/* Request values for USBTMC driver's ioctl entry point */
-#define USBTMC_IOC_NR                  91
-#define USBTMC_IOCTL_INDICATOR_PULSE   _IO(USBTMC_IOC_NR, 1)
-#define USBTMC_IOCTL_CLEAR             _IO(USBTMC_IOC_NR, 2)
-#define USBTMC_IOCTL_ABORT_BULK_OUT    _IO(USBTMC_IOC_NR, 3)
-#define USBTMC_IOCTL_ABORT_BULK_IN     _IO(USBTMC_IOC_NR, 4)
-#define USBTMC_IOCTL_CLEAR_OUT_HALT    _IO(USBTMC_IOC_NR, 6)
-#define USBTMC_IOCTL_CLEAR_IN_HALT     _IO(USBTMC_IOC_NR, 7)
-
-#endif
diff --git a/include/linux/usb/video.h b/include/linux/usb/video.h
deleted file mode 100644 (file)
index 3b3b95e..0000000
+++ /dev/null
@@ -1,568 +0,0 @@
-/*
- * USB Video Class definitions.
- *
- * Copyright (C) 2009 Laurent Pinchart <laurent.pinchart@skynet.be>
- *
- * This file holds USB constants and structures defined by the USB Device
- * Class Definition for Video Devices. Unless otherwise stated, comments
- * below reference relevant sections of the USB Video Class 1.1 specification
- * available at
- *
- * http://www.usb.org/developers/devclass_docs/USB_Video_Class_1_1.zip
- */
-
-#ifndef __LINUX_USB_VIDEO_H
-#define __LINUX_USB_VIDEO_H
-
-#include <linux/types.h>
-
-/* --------------------------------------------------------------------------
- * UVC constants
- */
-
-/* A.2. Video Interface Subclass Codes */
-#define UVC_SC_UNDEFINED                               0x00
-#define UVC_SC_VIDEOCONTROL                            0x01
-#define UVC_SC_VIDEOSTREAMING                          0x02
-#define UVC_SC_VIDEO_INTERFACE_COLLECTION              0x03
-
-/* A.3. Video Interface Protocol Codes */
-#define UVC_PC_PROTOCOL_UNDEFINED                      0x00
-
-/* A.5. Video Class-Specific VC Interface Descriptor Subtypes */
-#define UVC_VC_DESCRIPTOR_UNDEFINED                    0x00
-#define UVC_VC_HEADER                                  0x01
-#define UVC_VC_INPUT_TERMINAL                          0x02
-#define UVC_VC_OUTPUT_TERMINAL                         0x03
-#define UVC_VC_SELECTOR_UNIT                           0x04
-#define UVC_VC_PROCESSING_UNIT                         0x05
-#define UVC_VC_EXTENSION_UNIT                          0x06
-
-/* A.6. Video Class-Specific VS Interface Descriptor Subtypes */
-#define UVC_VS_UNDEFINED                               0x00
-#define UVC_VS_INPUT_HEADER                            0x01
-#define UVC_VS_OUTPUT_HEADER                           0x02
-#define UVC_VS_STILL_IMAGE_FRAME                       0x03
-#define UVC_VS_FORMAT_UNCOMPRESSED                     0x04
-#define UVC_VS_FRAME_UNCOMPRESSED                      0x05
-#define UVC_VS_FORMAT_MJPEG                            0x06
-#define UVC_VS_FRAME_MJPEG                             0x07
-#define UVC_VS_FORMAT_MPEG2TS                          0x0a
-#define UVC_VS_FORMAT_DV                               0x0c
-#define UVC_VS_COLORFORMAT                             0x0d
-#define UVC_VS_FORMAT_FRAME_BASED                      0x10
-#define UVC_VS_FRAME_FRAME_BASED                       0x11
-#define UVC_VS_FORMAT_STREAM_BASED                     0x12
-
-/* A.7. Video Class-Specific Endpoint Descriptor Subtypes */
-#define UVC_EP_UNDEFINED                               0x00
-#define UVC_EP_GENERAL                                 0x01
-#define UVC_EP_ENDPOINT                                        0x02
-#define UVC_EP_INTERRUPT                               0x03
-
-/* A.8. Video Class-Specific Request Codes */
-#define UVC_RC_UNDEFINED                               0x00
-#define UVC_SET_CUR                                    0x01
-#define UVC_GET_CUR                                    0x81
-#define UVC_GET_MIN                                    0x82
-#define UVC_GET_MAX                                    0x83
-#define UVC_GET_RES                                    0x84
-#define UVC_GET_LEN                                    0x85
-#define UVC_GET_INFO                                   0x86
-#define UVC_GET_DEF                                    0x87
-
-/* A.9.1. VideoControl Interface Control Selectors */
-#define UVC_VC_CONTROL_UNDEFINED                       0x00
-#define UVC_VC_VIDEO_POWER_MODE_CONTROL                        0x01
-#define UVC_VC_REQUEST_ERROR_CODE_CONTROL              0x02
-
-/* A.9.2. Terminal Control Selectors */
-#define UVC_TE_CONTROL_UNDEFINED                       0x00
-
-/* A.9.3. Selector Unit Control Selectors */
-#define UVC_SU_CONTROL_UNDEFINED                       0x00
-#define UVC_SU_INPUT_SELECT_CONTROL                    0x01
-
-/* A.9.4. Camera Terminal Control Selectors */
-#define UVC_CT_CONTROL_UNDEFINED                       0x00
-#define UVC_CT_SCANNING_MODE_CONTROL                   0x01
-#define UVC_CT_AE_MODE_CONTROL                         0x02
-#define UVC_CT_AE_PRIORITY_CONTROL                     0x03
-#define UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL          0x04
-#define UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL          0x05
-#define UVC_CT_FOCUS_ABSOLUTE_CONTROL                  0x06
-#define UVC_CT_FOCUS_RELATIVE_CONTROL                  0x07
-#define UVC_CT_FOCUS_AUTO_CONTROL                      0x08
-#define UVC_CT_IRIS_ABSOLUTE_CONTROL                   0x09
-#define UVC_CT_IRIS_RELATIVE_CONTROL                   0x0a
-#define UVC_CT_ZOOM_ABSOLUTE_CONTROL                   0x0b
-#define UVC_CT_ZOOM_RELATIVE_CONTROL                   0x0c
-#define UVC_CT_PANTILT_ABSOLUTE_CONTROL                        0x0d
-#define UVC_CT_PANTILT_RELATIVE_CONTROL                        0x0e
-#define UVC_CT_ROLL_ABSOLUTE_CONTROL                   0x0f
-#define UVC_CT_ROLL_RELATIVE_CONTROL                   0x10
-#define UVC_CT_PRIVACY_CONTROL                         0x11
-
-/* A.9.5. Processing Unit Control Selectors */
-#define UVC_PU_CONTROL_UNDEFINED                       0x00
-#define UVC_PU_BACKLIGHT_COMPENSATION_CONTROL          0x01
-#define UVC_PU_BRIGHTNESS_CONTROL                      0x02
-#define UVC_PU_CONTRAST_CONTROL                                0x03
-#define UVC_PU_GAIN_CONTROL                            0x04
-#define UVC_PU_POWER_LINE_FREQUENCY_CONTROL            0x05
-#define UVC_PU_HUE_CONTROL                             0x06
-#define UVC_PU_SATURATION_CONTROL                      0x07
-#define UVC_PU_SHARPNESS_CONTROL                       0x08
-#define UVC_PU_GAMMA_CONTROL                           0x09
-#define UVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL       0x0a
-#define UVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL  0x0b
-#define UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL         0x0c
-#define UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL    0x0d
-#define UVC_PU_DIGITAL_MULTIPLIER_CONTROL              0x0e
-#define UVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL                0x0f
-#define UVC_PU_HUE_AUTO_CONTROL                                0x10
-#define UVC_PU_ANALOG_VIDEO_STANDARD_CONTROL           0x11
-#define UVC_PU_ANALOG_LOCK_STATUS_CONTROL              0x12
-
-/* A.9.7. VideoStreaming Interface Control Selectors */
-#define UVC_VS_CONTROL_UNDEFINED                       0x00
-#define UVC_VS_PROBE_CONTROL                           0x01
-#define UVC_VS_COMMIT_CONTROL                          0x02
-#define UVC_VS_STILL_PROBE_CONTROL                     0x03
-#define UVC_VS_STILL_COMMIT_CONTROL                    0x04
-#define UVC_VS_STILL_IMAGE_TRIGGER_CONTROL             0x05
-#define UVC_VS_STREAM_ERROR_CODE_CONTROL               0x06
-#define UVC_VS_GENERATE_KEY_FRAME_CONTROL              0x07
-#define UVC_VS_UPDATE_FRAME_SEGMENT_CONTROL            0x08
-#define UVC_VS_SYNC_DELAY_CONTROL                      0x09
-
-/* B.1. USB Terminal Types */
-#define UVC_TT_VENDOR_SPECIFIC                         0x0100
-#define UVC_TT_STREAMING                               0x0101
-
-/* B.2. Input Terminal Types */
-#define UVC_ITT_VENDOR_SPECIFIC                                0x0200
-#define UVC_ITT_CAMERA                                 0x0201
-#define UVC_ITT_MEDIA_TRANSPORT_INPUT                  0x0202
-
-/* B.3. Output Terminal Types */
-#define UVC_OTT_VENDOR_SPECIFIC                                0x0300
-#define UVC_OTT_DISPLAY                                        0x0301
-#define UVC_OTT_MEDIA_TRANSPORT_OUTPUT                 0x0302
-
-/* B.4. External Terminal Types */
-#define UVC_EXTERNAL_VENDOR_SPECIFIC                   0x0400
-#define UVC_COMPOSITE_CONNECTOR                                0x0401
-#define UVC_SVIDEO_CONNECTOR                           0x0402
-#define UVC_COMPONENT_CONNECTOR                                0x0403
-
-/* 2.4.2.2. Status Packet Type */
-#define UVC_STATUS_TYPE_CONTROL                                1
-#define UVC_STATUS_TYPE_STREAMING                      2
-
-/* 2.4.3.3. Payload Header Information */
-#define UVC_STREAM_EOH                                 (1 << 7)
-#define UVC_STREAM_ERR                                 (1 << 6)
-#define UVC_STREAM_STI                                 (1 << 5)
-#define UVC_STREAM_RES                                 (1 << 4)
-#define UVC_STREAM_SCR                                 (1 << 3)
-#define UVC_STREAM_PTS                                 (1 << 2)
-#define UVC_STREAM_EOF                                 (1 << 1)
-#define UVC_STREAM_FID                                 (1 << 0)
-
-/* 4.1.2. Control Capabilities */
-#define UVC_CONTROL_CAP_GET                            (1 << 0)
-#define UVC_CONTROL_CAP_SET                            (1 << 1)
-#define UVC_CONTROL_CAP_DISABLED                       (1 << 2)
-#define UVC_CONTROL_CAP_AUTOUPDATE                     (1 << 3)
-#define UVC_CONTROL_CAP_ASYNCHRONOUS                   (1 << 4)
-
-/* ------------------------------------------------------------------------
- * UVC structures
- */
-
-/* All UVC descriptors have these 3 fields at the beginning */
-struct uvc_descriptor_header {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-} __attribute__((packed));
-
-/* 3.7.2. Video Control Interface Header Descriptor */
-struct uvc_header_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u16 bcdUVC;
-       __u16 wTotalLength;
-       __u32 dwClockFrequency;
-       __u8  bInCollection;
-       __u8  baInterfaceNr[];
-} __attribute__((__packed__));
-
-#define UVC_DT_HEADER_SIZE(n)                          (12+(n))
-
-#define UVC_HEADER_DESCRIPTOR(n) \
-       uvc_header_descriptor_##n
-
-#define DECLARE_UVC_HEADER_DESCRIPTOR(n)               \
-struct UVC_HEADER_DESCRIPTOR(n) {                      \
-       __u8  bLength;                                  \
-       __u8  bDescriptorType;                          \
-       __u8  bDescriptorSubType;                       \
-       __u16 bcdUVC;                                   \
-       __u16 wTotalLength;                             \
-       __u32 dwClockFrequency;                         \
-       __u8  bInCollection;                            \
-       __u8  baInterfaceNr[n];                         \
-} __attribute__ ((packed))
-
-/* 3.7.2.1. Input Terminal Descriptor */
-struct uvc_input_terminal_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u8  bTerminalID;
-       __u16 wTerminalType;
-       __u8  bAssocTerminal;
-       __u8  iTerminal;
-} __attribute__((__packed__));
-
-#define UVC_DT_INPUT_TERMINAL_SIZE                     8
-
-/* 3.7.2.2. Output Terminal Descriptor */
-struct uvc_output_terminal_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u8  bTerminalID;
-       __u16 wTerminalType;
-       __u8  bAssocTerminal;
-       __u8  bSourceID;
-       __u8  iTerminal;
-} __attribute__((__packed__));
-
-#define UVC_DT_OUTPUT_TERMINAL_SIZE                    9
-
-/* 3.7.2.3. Camera Terminal Descriptor */
-struct uvc_camera_terminal_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u8  bTerminalID;
-       __u16 wTerminalType;
-       __u8  bAssocTerminal;
-       __u8  iTerminal;
-       __u16 wObjectiveFocalLengthMin;
-       __u16 wObjectiveFocalLengthMax;
-       __u16 wOcularFocalLength;
-       __u8  bControlSize;
-       __u8  bmControls[3];
-} __attribute__((__packed__));
-
-#define UVC_DT_CAMERA_TERMINAL_SIZE(n)                 (15+(n))
-
-/* 3.7.2.4. Selector Unit Descriptor */
-struct uvc_selector_unit_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u8  bUnitID;
-       __u8  bNrInPins;
-       __u8  baSourceID[0];
-       __u8  iSelector;
-} __attribute__((__packed__));
-
-#define UVC_DT_SELECTOR_UNIT_SIZE(n)                   (6+(n))
-
-#define UVC_SELECTOR_UNIT_DESCRIPTOR(n)        \
-       uvc_selector_unit_descriptor_##n
-
-#define DECLARE_UVC_SELECTOR_UNIT_DESCRIPTOR(n)        \
-struct UVC_SELECTOR_UNIT_DESCRIPTOR(n) {               \
-       __u8  bLength;                                  \
-       __u8  bDescriptorType;                          \
-       __u8  bDescriptorSubType;                       \
-       __u8  bUnitID;                                  \
-       __u8  bNrInPins;                                \
-       __u8  baSourceID[n];                            \
-       __u8  iSelector;                                \
-} __attribute__ ((packed))
-
-/* 3.7.2.5. Processing Unit Descriptor */
-struct uvc_processing_unit_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u8  bUnitID;
-       __u8  bSourceID;
-       __u16 wMaxMultiplier;
-       __u8  bControlSize;
-       __u8  bmControls[2];
-       __u8  iProcessing;
-} __attribute__((__packed__));
-
-#define UVC_DT_PROCESSING_UNIT_SIZE(n)                 (9+(n))
-
-/* 3.7.2.6. Extension Unit Descriptor */
-struct uvc_extension_unit_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u8  bUnitID;
-       __u8  guidExtensionCode[16];
-       __u8  bNumControls;
-       __u8  bNrInPins;
-       __u8  baSourceID[0];
-       __u8  bControlSize;
-       __u8  bmControls[0];
-       __u8  iExtension;
-} __attribute__((__packed__));
-
-#define UVC_DT_EXTENSION_UNIT_SIZE(p, n)               (24+(p)+(n))
-
-#define UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) \
-       uvc_extension_unit_descriptor_##p_##n
-
-#define DECLARE_UVC_EXTENSION_UNIT_DESCRIPTOR(p, n)    \
-struct UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) {           \
-       __u8  bLength;                                  \
-       __u8  bDescriptorType;                          \
-       __u8  bDescriptorSubType;                       \
-       __u8  bUnitID;                                  \
-       __u8  guidExtensionCode[16];                    \
-       __u8  bNumControls;                             \
-       __u8  bNrInPins;                                \
-       __u8  baSourceID[p];                            \
-       __u8  bControlSize;                             \
-       __u8  bmControls[n];                            \
-       __u8  iExtension;                               \
-} __attribute__ ((packed))
-
-/* 3.8.2.2. Video Control Interrupt Endpoint Descriptor */
-struct uvc_control_endpoint_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u16 wMaxTransferSize;
-} __attribute__((__packed__));
-
-#define UVC_DT_CONTROL_ENDPOINT_SIZE                   5
-
-/* 3.9.2.1. Input Header Descriptor */
-struct uvc_input_header_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u8  bNumFormats;
-       __u16 wTotalLength;
-       __u8  bEndpointAddress;
-       __u8  bmInfo;
-       __u8  bTerminalLink;
-       __u8  bStillCaptureMethod;
-       __u8  bTriggerSupport;
-       __u8  bTriggerUsage;
-       __u8  bControlSize;
-       __u8  bmaControls[];
-} __attribute__((__packed__));
-
-#define UVC_DT_INPUT_HEADER_SIZE(n, p)                 (13+(n*p))
-
-#define UVC_INPUT_HEADER_DESCRIPTOR(n, p) \
-       uvc_input_header_descriptor_##n_##p
-
-#define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n, p)      \
-struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) {             \
-       __u8  bLength;                                  \
-       __u8  bDescriptorType;                          \
-       __u8  bDescriptorSubType;                       \
-       __u8  bNumFormats;                              \
-       __u16 wTotalLength;                             \
-       __u8  bEndpointAddress;                         \
-       __u8  bmInfo;                                   \
-       __u8  bTerminalLink;                            \
-       __u8  bStillCaptureMethod;                      \
-       __u8  bTriggerSupport;                          \
-       __u8  bTriggerUsage;                            \
-       __u8  bControlSize;                             \
-       __u8  bmaControls[p][n];                        \
-} __attribute__ ((packed))
-
-/* 3.9.2.2. Output Header Descriptor */
-struct uvc_output_header_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u8  bNumFormats;
-       __u16 wTotalLength;
-       __u8  bEndpointAddress;
-       __u8  bTerminalLink;
-       __u8  bControlSize;
-       __u8  bmaControls[];
-} __attribute__((__packed__));
-
-#define UVC_DT_OUTPUT_HEADER_SIZE(n, p)                        (9+(n*p))
-
-#define UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \
-       uvc_output_header_descriptor_##n_##p
-
-#define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n, p)     \
-struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) {            \
-       __u8  bLength;                                  \
-       __u8  bDescriptorType;                          \
-       __u8  bDescriptorSubType;                       \
-       __u8  bNumFormats;                              \
-       __u16 wTotalLength;                             \
-       __u8  bEndpointAddress;                         \
-       __u8  bTerminalLink;                            \
-       __u8  bControlSize;                             \
-       __u8  bmaControls[p][n];                        \
-} __attribute__ ((packed))
-
-/* 3.9.2.6. Color matching descriptor */
-struct uvc_color_matching_descriptor {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u8  bColorPrimaries;
-       __u8  bTransferCharacteristics;
-       __u8  bMatrixCoefficients;
-} __attribute__((__packed__));
-
-#define UVC_DT_COLOR_MATCHING_SIZE                     6
-
-/* 4.3.1.1. Video Probe and Commit Controls */
-struct uvc_streaming_control {
-       __u16 bmHint;
-       __u8  bFormatIndex;
-       __u8  bFrameIndex;
-       __u32 dwFrameInterval;
-       __u16 wKeyFrameRate;
-       __u16 wPFrameRate;
-       __u16 wCompQuality;
-       __u16 wCompWindowSize;
-       __u16 wDelay;
-       __u32 dwMaxVideoFrameSize;
-       __u32 dwMaxPayloadTransferSize;
-       __u32 dwClockFrequency;
-       __u8  bmFramingInfo;
-       __u8  bPreferedVersion;
-       __u8  bMinVersion;
-       __u8  bMaxVersion;
-} __attribute__((__packed__));
-
-/* Uncompressed Payload - 3.1.1. Uncompressed Video Format Descriptor */
-struct uvc_format_uncompressed {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u8  bFormatIndex;
-       __u8  bNumFrameDescriptors;
-       __u8  guidFormat[16];
-       __u8  bBitsPerPixel;
-       __u8  bDefaultFrameIndex;
-       __u8  bAspectRatioX;
-       __u8  bAspectRatioY;
-       __u8  bmInterfaceFlags;
-       __u8  bCopyProtect;
-} __attribute__((__packed__));
-
-#define UVC_DT_FORMAT_UNCOMPRESSED_SIZE                        27
-
-/* Uncompressed Payload - 3.1.2. Uncompressed Video Frame Descriptor */
-struct uvc_frame_uncompressed {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u8  bFrameIndex;
-       __u8  bmCapabilities;
-       __u16 wWidth;
-       __u16 wHeight;
-       __u32 dwMinBitRate;
-       __u32 dwMaxBitRate;
-       __u32 dwMaxVideoFrameBufferSize;
-       __u32 dwDefaultFrameInterval;
-       __u8  bFrameIntervalType;
-       __u32 dwFrameInterval[];
-} __attribute__((__packed__));
-
-#define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n)              (26+4*(n))
-
-#define UVC_FRAME_UNCOMPRESSED(n) \
-       uvc_frame_uncompressed_##n
-
-#define DECLARE_UVC_FRAME_UNCOMPRESSED(n)              \
-struct UVC_FRAME_UNCOMPRESSED(n) {                     \
-       __u8  bLength;                                  \
-       __u8  bDescriptorType;                          \
-       __u8  bDescriptorSubType;                       \
-       __u8  bFrameIndex;                              \
-       __u8  bmCapabilities;                           \
-       __u16 wWidth;                                   \
-       __u16 wHeight;                                  \
-       __u32 dwMinBitRate;                             \
-       __u32 dwMaxBitRate;                             \
-       __u32 dwMaxVideoFrameBufferSize;                \
-       __u32 dwDefaultFrameInterval;                   \
-       __u8  bFrameIntervalType;                       \
-       __u32 dwFrameInterval[n];                       \
-} __attribute__ ((packed))
-
-/* MJPEG Payload - 3.1.1. MJPEG Video Format Descriptor */
-struct uvc_format_mjpeg {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u8  bFormatIndex;
-       __u8  bNumFrameDescriptors;
-       __u8  bmFlags;
-       __u8  bDefaultFrameIndex;
-       __u8  bAspectRatioX;
-       __u8  bAspectRatioY;
-       __u8  bmInterfaceFlags;
-       __u8  bCopyProtect;
-} __attribute__((__packed__));
-
-#define UVC_DT_FORMAT_MJPEG_SIZE                       11
-
-/* MJPEG Payload - 3.1.2. MJPEG Video Frame Descriptor */
-struct uvc_frame_mjpeg {
-       __u8  bLength;
-       __u8  bDescriptorType;
-       __u8  bDescriptorSubType;
-       __u8  bFrameIndex;
-       __u8  bmCapabilities;
-       __u16 wWidth;
-       __u16 wHeight;
-       __u32 dwMinBitRate;
-       __u32 dwMaxBitRate;
-       __u32 dwMaxVideoFrameBufferSize;
-       __u32 dwDefaultFrameInterval;
-       __u8  bFrameIntervalType;
-       __u32 dwFrameInterval[];
-} __attribute__((__packed__));
-
-#define UVC_DT_FRAME_MJPEG_SIZE(n)                     (26+4*(n))
-
-#define UVC_FRAME_MJPEG(n) \
-       uvc_frame_mjpeg_##n
-
-#define DECLARE_UVC_FRAME_MJPEG(n)                     \
-struct UVC_FRAME_MJPEG(n) {                            \
-       __u8  bLength;                                  \
-       __u8  bDescriptorType;                          \
-       __u8  bDescriptorSubType;                       \
-       __u8  bFrameIndex;                              \
-       __u8  bmCapabilities;                           \
-       __u16 wWidth;                                   \
-       __u16 wHeight;                                  \
-       __u32 dwMinBitRate;                             \
-       __u32 dwMaxBitRate;                             \
-       __u32 dwMaxVideoFrameBufferSize;                \
-       __u32 dwDefaultFrameInterval;                   \
-       __u8  bFrameIntervalType;                       \
-       __u32 dwFrameInterval[n];                       \
-} __attribute__ ((packed))
-
-#endif /* __LINUX_USB_VIDEO_H */
-
diff --git a/include/linux/wimax/Kbuild b/include/linux/wimax/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/include/mtd/Kbuild b/include/mtd/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..486f0af73c39e05aabb8cae5650dfab9ba10ac6f 100644 (file)
@@ -0,0 +1,4 @@
+/*
+ * There isn't anything here, but the file must not be empty or patch
+ * will delete it.
+ */
index aafaa5aa54d46bb9a93a8137a22344408298223f..d40942cfc627f43b4b0da73a925d72264f778be0 100644 (file)
@@ -1 +1,9 @@
 # UAPI Header export list
+header-y += audio.h
+header-y += ca.h
+header-y += dmx.h
+header-y += frontend.h
+header-y += net.h
+header-y += osd.h
+header-y += version.h
+header-y += video.h
diff --git a/include/uapi/linux/dvb/audio.h b/include/uapi/linux/dvb/audio.h
new file mode 100644 (file)
index 0000000..d47bccd
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * audio.h
+ *
+ * Copyright (C) 2000 Ralph  Metzler <ralph@convergence.de>
+ *                  & Marcus Metzler <marcus@convergence.de>
+ *                    for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Lesser Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBAUDIO_H_
+#define _DVBAUDIO_H_
+
+#include <linux/types.h>
+
+typedef enum {
+       AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */
+       AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */
+} audio_stream_source_t;
+
+
+typedef enum {
+       AUDIO_STOPPED,      /* Device is stopped */
+       AUDIO_PLAYING,      /* Device is currently playing */
+       AUDIO_PAUSED        /* Device is paused */
+} audio_play_state_t;
+
+
+typedef enum {
+       AUDIO_STEREO,
+       AUDIO_MONO_LEFT,
+       AUDIO_MONO_RIGHT,
+       AUDIO_MONO,
+       AUDIO_STEREO_SWAPPED
+} audio_channel_select_t;
+
+
+typedef struct audio_mixer {
+       unsigned int volume_left;
+       unsigned int volume_right;
+  // what else do we need? bass, pass-through, ...
+} audio_mixer_t;
+
+
+typedef struct audio_status {
+       int                    AV_sync_state;  /* sync audio and video? */
+       int                    mute_state;     /* audio is muted */
+       audio_play_state_t     play_state;     /* current playback state */
+       audio_stream_source_t  stream_source;  /* current stream source */
+       audio_channel_select_t channel_select; /* currently selected channel */
+       int                    bypass_mode;    /* pass on audio data to */
+       audio_mixer_t          mixer_state;    /* current mixer state */
+} audio_status_t;                              /* separate decoder hardware */
+
+
+typedef
+struct audio_karaoke {  /* if Vocal1 or Vocal2 are non-zero, they get mixed  */
+       int vocal1;    /* into left and right t at 70% each */
+       int vocal2;    /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/
+       int melody;    /* mixed into the left channel and */
+                      /* Vocal2 into the right channel at 100% each. */
+                      /* if Melody is non-zero, the melody channel gets mixed*/
+} audio_karaoke_t;     /* into left and right  */
+
+
+typedef __u16 audio_attributes_t;
+/*   bits: descr. */
+/*   15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */
+/*   12    multichannel extension */
+/*   11-10 audio type (0=not spec, 1=language included) */
+/*    9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) */
+/*    7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit,  */
+/*    5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */
+/*    2- 0 number of audio channels (n+1 channels) */
+
+
+/* for GET_CAPABILITIES and SET_FORMAT, the latter should only set one bit */
+#define AUDIO_CAP_DTS    1
+#define AUDIO_CAP_LPCM   2
+#define AUDIO_CAP_MP1    4
+#define AUDIO_CAP_MP2    8
+#define AUDIO_CAP_MP3   16
+#define AUDIO_CAP_AAC   32
+#define AUDIO_CAP_OGG   64
+#define AUDIO_CAP_SDDS 128
+#define AUDIO_CAP_AC3  256
+
+#define AUDIO_STOP                 _IO('o', 1)
+#define AUDIO_PLAY                 _IO('o', 2)
+#define AUDIO_PAUSE                _IO('o', 3)
+#define AUDIO_CONTINUE             _IO('o', 4)
+#define AUDIO_SELECT_SOURCE        _IO('o', 5)
+#define AUDIO_SET_MUTE             _IO('o', 6)
+#define AUDIO_SET_AV_SYNC          _IO('o', 7)
+#define AUDIO_SET_BYPASS_MODE      _IO('o', 8)
+#define AUDIO_CHANNEL_SELECT       _IO('o', 9)
+#define AUDIO_GET_STATUS           _IOR('o', 10, audio_status_t)
+
+#define AUDIO_GET_CAPABILITIES     _IOR('o', 11, unsigned int)
+#define AUDIO_CLEAR_BUFFER         _IO('o',  12)
+#define AUDIO_SET_ID               _IO('o', 13)
+#define AUDIO_SET_MIXER            _IOW('o', 14, audio_mixer_t)
+#define AUDIO_SET_STREAMTYPE       _IO('o', 15)
+#define AUDIO_SET_EXT_ID           _IO('o', 16)
+#define AUDIO_SET_ATTRIBUTES       _IOW('o', 17, audio_attributes_t)
+#define AUDIO_SET_KARAOKE          _IOW('o', 18, audio_karaoke_t)
+
+/**
+ * AUDIO_GET_PTS
+ *
+ * Read the 33 bit presentation time stamp as defined
+ * in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
+ *
+ * The PTS should belong to the currently played
+ * frame if possible, but may also be a value close to it
+ * like the PTS of the last decoded frame or the last PTS
+ * extracted by the PES parser.
+ */
+#define AUDIO_GET_PTS              _IOR('o', 19, __u64)
+#define AUDIO_BILINGUAL_CHANNEL_SELECT _IO('o', 20)
+
+#endif /* _DVBAUDIO_H_ */
diff --git a/include/uapi/linux/dvb/ca.h b/include/uapi/linux/dvb/ca.h
new file mode 100644 (file)
index 0000000..c18537f
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * ca.h
+ *
+ * Copyright (C) 2000 Ralph  Metzler <ralph@convergence.de>
+ *                  & Marcus Metzler <marcus@convergence.de>
+ *                    for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Lesser Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBCA_H_
+#define _DVBCA_H_
+
+/* slot interface types and info */
+
+typedef struct ca_slot_info {
+       int num;               /* slot number */
+
+       int type;              /* CA interface this slot supports */
+#define CA_CI            1     /* CI high level interface */
+#define CA_CI_LINK       2     /* CI link layer level interface */
+#define CA_CI_PHYS       4     /* CI physical layer level interface */
+#define CA_DESCR         8     /* built-in descrambler */
+#define CA_SC          128     /* simple smart card interface */
+
+       unsigned int flags;
+#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
+#define CA_CI_MODULE_READY   2
+} ca_slot_info_t;
+
+
+/* descrambler types and info */
+
+typedef struct ca_descr_info {
+       unsigned int num;          /* number of available descramblers (keys) */
+       unsigned int type;         /* type of supported scrambling system */
+#define CA_ECD           1
+#define CA_NDS           2
+#define CA_DSS           4
+} ca_descr_info_t;
+
+typedef struct ca_caps {
+       unsigned int slot_num;     /* total number of CA card and module slots */
+       unsigned int slot_type;    /* OR of all supported types */
+       unsigned int descr_num;    /* total number of descrambler slots (keys) */
+       unsigned int descr_type;   /* OR of all supported types */
+} ca_caps_t;
+
+/* a message to/from a CI-CAM */
+typedef struct ca_msg {
+       unsigned int index;
+       unsigned int type;
+       unsigned int length;
+       unsigned char msg[256];
+} ca_msg_t;
+
+typedef struct ca_descr {
+       unsigned int index;
+       unsigned int parity;    /* 0 == even, 1 == odd */
+       unsigned char cw[8];
+} ca_descr_t;
+
+typedef struct ca_pid {
+       unsigned int pid;
+       int index;              /* -1 == disable*/
+} ca_pid_t;
+
+#define CA_RESET          _IO('o', 128)
+#define CA_GET_CAP        _IOR('o', 129, ca_caps_t)
+#define CA_GET_SLOT_INFO  _IOR('o', 130, ca_slot_info_t)
+#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t)
+#define CA_GET_MSG        _IOR('o', 132, ca_msg_t)
+#define CA_SEND_MSG       _IOW('o', 133, ca_msg_t)
+#define CA_SET_DESCR      _IOW('o', 134, ca_descr_t)
+#define CA_SET_PID        _IOW('o', 135, ca_pid_t)
+
+#endif
diff --git a/include/uapi/linux/dvb/dmx.h b/include/uapi/linux/dvb/dmx.h
new file mode 100644 (file)
index 0000000..b2a9ad8
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+ * dmx.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ *                  & Ralph  Metzler <ralph@convergence.de>
+ *                    for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ */
+
+#ifndef _UAPI_DVBDMX_H_
+#define _UAPI_DVBDMX_H_
+
+#include <linux/types.h>
+#ifndef __KERNEL__
+#include <time.h>
+#endif
+
+
+#define DMX_FILTER_SIZE 16
+
+typedef enum
+{
+       DMX_OUT_DECODER, /* Streaming directly to decoder. */
+       DMX_OUT_TAP,     /* Output going to a memory buffer */
+                        /* (to be retrieved via the read command).*/
+       DMX_OUT_TS_TAP,  /* Output multiplexed into a new TS  */
+                        /* (to be retrieved by reading from the */
+                        /* logical DVR device).                 */
+       DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */
+} dmx_output_t;
+
+
+typedef enum
+{
+       DMX_IN_FRONTEND, /* Input from a front-end device.  */
+       DMX_IN_DVR       /* Input from the logical DVR device.  */
+} dmx_input_t;
+
+
+typedef enum
+{
+       DMX_PES_AUDIO0,
+       DMX_PES_VIDEO0,
+       DMX_PES_TELETEXT0,
+       DMX_PES_SUBTITLE0,
+       DMX_PES_PCR0,
+
+       DMX_PES_AUDIO1,
+       DMX_PES_VIDEO1,
+       DMX_PES_TELETEXT1,
+       DMX_PES_SUBTITLE1,
+       DMX_PES_PCR1,
+
+       DMX_PES_AUDIO2,
+       DMX_PES_VIDEO2,
+       DMX_PES_TELETEXT2,
+       DMX_PES_SUBTITLE2,
+       DMX_PES_PCR2,
+
+       DMX_PES_AUDIO3,
+       DMX_PES_VIDEO3,
+       DMX_PES_TELETEXT3,
+       DMX_PES_SUBTITLE3,
+       DMX_PES_PCR3,
+
+       DMX_PES_OTHER
+} dmx_pes_type_t;
+
+#define DMX_PES_AUDIO    DMX_PES_AUDIO0
+#define DMX_PES_VIDEO    DMX_PES_VIDEO0
+#define DMX_PES_TELETEXT DMX_PES_TELETEXT0
+#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
+#define DMX_PES_PCR      DMX_PES_PCR0
+
+
+typedef struct dmx_filter
+{
+       __u8  filter[DMX_FILTER_SIZE];
+       __u8  mask[DMX_FILTER_SIZE];
+       __u8  mode[DMX_FILTER_SIZE];
+} dmx_filter_t;
+
+
+struct dmx_sct_filter_params
+{
+       __u16          pid;
+       dmx_filter_t   filter;
+       __u32          timeout;
+       __u32          flags;
+#define DMX_CHECK_CRC       1
+#define DMX_ONESHOT         2
+#define DMX_IMMEDIATE_START 4
+#define DMX_KERNEL_CLIENT   0x8000
+};
+
+
+struct dmx_pes_filter_params
+{
+       __u16          pid;
+       dmx_input_t    input;
+       dmx_output_t   output;
+       dmx_pes_type_t pes_type;
+       __u32          flags;
+};
+
+typedef struct dmx_caps {
+       __u32 caps;
+       int num_decoders;
+} dmx_caps_t;
+
+typedef enum {
+       DMX_SOURCE_FRONT0 = 0,
+       DMX_SOURCE_FRONT1,
+       DMX_SOURCE_FRONT2,
+       DMX_SOURCE_FRONT3,
+       DMX_SOURCE_DVR0   = 16,
+       DMX_SOURCE_DVR1,
+       DMX_SOURCE_DVR2,
+       DMX_SOURCE_DVR3
+} dmx_source_t;
+
+struct dmx_stc {
+       unsigned int num;       /* input : which STC? 0..N */
+       unsigned int base;      /* output: divisor for stc to get 90 kHz clock */
+       __u64 stc;              /* output: stc in 'base'*90 kHz units */
+};
+
+
+#define DMX_START                _IO('o', 41)
+#define DMX_STOP                 _IO('o', 42)
+#define DMX_SET_FILTER           _IOW('o', 43, struct dmx_sct_filter_params)
+#define DMX_SET_PES_FILTER       _IOW('o', 44, struct dmx_pes_filter_params)
+#define DMX_SET_BUFFER_SIZE      _IO('o', 45)
+#define DMX_GET_PES_PIDS         _IOR('o', 47, __u16[5])
+#define DMX_GET_CAPS             _IOR('o', 48, dmx_caps_t)
+#define DMX_SET_SOURCE           _IOW('o', 49, dmx_source_t)
+#define DMX_GET_STC              _IOWR('o', 50, struct dmx_stc)
+#define DMX_ADD_PID              _IOW('o', 51, __u16)
+#define DMX_REMOVE_PID           _IOW('o', 52, __u16)
+
+#endif /* _UAPI_DVBDMX_H_ */
diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h
new file mode 100644 (file)
index 0000000..c12d452
--- /dev/null
@@ -0,0 +1,516 @@
+/*
+ * frontend.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ *                 Ralph  Metzler <ralph@convergence.de>
+ *                 Holger Waechtler <holger@convergence.de>
+ *                 Andre Draszik <ad@convergence.de>
+ *                 for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBFRONTEND_H_
+#define _DVBFRONTEND_H_
+
+#include <linux/types.h>
+
+typedef enum fe_type {
+       FE_QPSK,
+       FE_QAM,
+       FE_OFDM,
+       FE_ATSC
+} fe_type_t;
+
+
+typedef enum fe_caps {
+       FE_IS_STUPID                    = 0,
+       FE_CAN_INVERSION_AUTO           = 0x1,
+       FE_CAN_FEC_1_2                  = 0x2,
+       FE_CAN_FEC_2_3                  = 0x4,
+       FE_CAN_FEC_3_4                  = 0x8,
+       FE_CAN_FEC_4_5                  = 0x10,
+       FE_CAN_FEC_5_6                  = 0x20,
+       FE_CAN_FEC_6_7                  = 0x40,
+       FE_CAN_FEC_7_8                  = 0x80,
+       FE_CAN_FEC_8_9                  = 0x100,
+       FE_CAN_FEC_AUTO                 = 0x200,
+       FE_CAN_QPSK                     = 0x400,
+       FE_CAN_QAM_16                   = 0x800,
+       FE_CAN_QAM_32                   = 0x1000,
+       FE_CAN_QAM_64                   = 0x2000,
+       FE_CAN_QAM_128                  = 0x4000,
+       FE_CAN_QAM_256                  = 0x8000,
+       FE_CAN_QAM_AUTO                 = 0x10000,
+       FE_CAN_TRANSMISSION_MODE_AUTO   = 0x20000,
+       FE_CAN_BANDWIDTH_AUTO           = 0x40000,
+       FE_CAN_GUARD_INTERVAL_AUTO      = 0x80000,
+       FE_CAN_HIERARCHY_AUTO           = 0x100000,
+       FE_CAN_8VSB                     = 0x200000,
+       FE_CAN_16VSB                    = 0x400000,
+       FE_HAS_EXTENDED_CAPS            = 0x800000,   /* We need more bitspace for newer APIs, indicate this. */
+       FE_CAN_MULTISTREAM              = 0x4000000,  /* frontend supports multistream filtering */
+       FE_CAN_TURBO_FEC                = 0x8000000,  /* frontend supports "turbo fec modulation" */
+       FE_CAN_2G_MODULATION            = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */
+       FE_NEEDS_BENDING                = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
+       FE_CAN_RECOVER                  = 0x40000000, /* frontend can recover from a cable unplug automatically */
+       FE_CAN_MUTE_TS                  = 0x80000000  /* frontend can stop spurious TS data output */
+} fe_caps_t;
+
+
+struct dvb_frontend_info {
+       char       name[128];
+       fe_type_t  type;                        /* DEPRECATED. Use DTV_ENUM_DELSYS instead */
+       __u32      frequency_min;
+       __u32      frequency_max;
+       __u32      frequency_stepsize;
+       __u32      frequency_tolerance;
+       __u32      symbol_rate_min;
+       __u32      symbol_rate_max;
+       __u32      symbol_rate_tolerance;       /* ppm */
+       __u32      notifier_delay;              /* DEPRECATED */
+       fe_caps_t  caps;
+};
+
+
+/**
+ *  Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
+ *  the meaning of this struct...
+ */
+struct dvb_diseqc_master_cmd {
+       __u8 msg [6];   /*  { framing, address, command, data [3] } */
+       __u8 msg_len;   /*  valid values are 3...6  */
+};
+
+
+struct dvb_diseqc_slave_reply {
+       __u8 msg [4];   /*  { framing, data [3] } */
+       __u8 msg_len;   /*  valid values are 0...4, 0 means no msg  */
+       int  timeout;   /*  return from ioctl after timeout ms with */
+};                     /*  errorcode when no message was received  */
+
+
+typedef enum fe_sec_voltage {
+       SEC_VOLTAGE_13,
+       SEC_VOLTAGE_18,
+       SEC_VOLTAGE_OFF
+} fe_sec_voltage_t;
+
+
+typedef enum fe_sec_tone_mode {
+       SEC_TONE_ON,
+       SEC_TONE_OFF
+} fe_sec_tone_mode_t;
+
+
+typedef enum fe_sec_mini_cmd {
+       SEC_MINI_A,
+       SEC_MINI_B
+} fe_sec_mini_cmd_t;
+
+
+/**
+ * enum fe_status - enumerates the possible frontend status
+ * @FE_HAS_SIGNAL:     found something above the noise level
+ * @FE_HAS_CARRIER:    found a DVB signal
+ * @FE_HAS_VITERBI:    FEC is stable
+ * @FE_HAS_SYNC:       found sync bytes
+ * @FE_HAS_LOCK:       everything's working
+ * @FE_TIMEDOUT:       no lock within the last ~2 seconds
+ * @FE_REINIT:         frontend was reinitialized, application is recommended
+ *                     to reset DiSEqC, tone and parameters
+ */
+
+typedef enum fe_status {
+       FE_HAS_SIGNAL           = 0x01,
+       FE_HAS_CARRIER          = 0x02,
+       FE_HAS_VITERBI          = 0x04,
+       FE_HAS_SYNC             = 0x08,
+       FE_HAS_LOCK             = 0x10,
+       FE_TIMEDOUT             = 0x20,
+       FE_REINIT               = 0x40,
+} fe_status_t;
+
+typedef enum fe_spectral_inversion {
+       INVERSION_OFF,
+       INVERSION_ON,
+       INVERSION_AUTO
+} fe_spectral_inversion_t;
+
+
+typedef enum fe_code_rate {
+       FEC_NONE = 0,
+       FEC_1_2,
+       FEC_2_3,
+       FEC_3_4,
+       FEC_4_5,
+       FEC_5_6,
+       FEC_6_7,
+       FEC_7_8,
+       FEC_8_9,
+       FEC_AUTO,
+       FEC_3_5,
+       FEC_9_10,
+       FEC_2_5,
+} fe_code_rate_t;
+
+
+typedef enum fe_modulation {
+       QPSK,
+       QAM_16,
+       QAM_32,
+       QAM_64,
+       QAM_128,
+       QAM_256,
+       QAM_AUTO,
+       VSB_8,
+       VSB_16,
+       PSK_8,
+       APSK_16,
+       APSK_32,
+       DQPSK,
+       QAM_4_NR,
+} fe_modulation_t;
+
+typedef enum fe_transmit_mode {
+       TRANSMISSION_MODE_2K,
+       TRANSMISSION_MODE_8K,
+       TRANSMISSION_MODE_AUTO,
+       TRANSMISSION_MODE_4K,
+       TRANSMISSION_MODE_1K,
+       TRANSMISSION_MODE_16K,
+       TRANSMISSION_MODE_32K,
+       TRANSMISSION_MODE_C1,
+       TRANSMISSION_MODE_C3780,
+} fe_transmit_mode_t;
+
+#if defined(__DVB_CORE__) || !defined (__KERNEL__)
+typedef enum fe_bandwidth {
+       BANDWIDTH_8_MHZ,
+       BANDWIDTH_7_MHZ,
+       BANDWIDTH_6_MHZ,
+       BANDWIDTH_AUTO,
+       BANDWIDTH_5_MHZ,
+       BANDWIDTH_10_MHZ,
+       BANDWIDTH_1_712_MHZ,
+} fe_bandwidth_t;
+#endif
+
+typedef enum fe_guard_interval {
+       GUARD_INTERVAL_1_32,
+       GUARD_INTERVAL_1_16,
+       GUARD_INTERVAL_1_8,
+       GUARD_INTERVAL_1_4,
+       GUARD_INTERVAL_AUTO,
+       GUARD_INTERVAL_1_128,
+       GUARD_INTERVAL_19_128,
+       GUARD_INTERVAL_19_256,
+       GUARD_INTERVAL_PN420,
+       GUARD_INTERVAL_PN595,
+       GUARD_INTERVAL_PN945,
+} fe_guard_interval_t;
+
+
+typedef enum fe_hierarchy {
+       HIERARCHY_NONE,
+       HIERARCHY_1,
+       HIERARCHY_2,
+       HIERARCHY_4,
+       HIERARCHY_AUTO
+} fe_hierarchy_t;
+
+enum fe_interleaving {
+       INTERLEAVING_NONE,
+       INTERLEAVING_AUTO,
+       INTERLEAVING_240,
+       INTERLEAVING_720,
+};
+
+#if defined(__DVB_CORE__) || !defined (__KERNEL__)
+struct dvb_qpsk_parameters {
+       __u32           symbol_rate;  /* symbol rate in Symbols per second */
+       fe_code_rate_t  fec_inner;    /* forward error correction (see above) */
+};
+
+struct dvb_qam_parameters {
+       __u32           symbol_rate; /* symbol rate in Symbols per second */
+       fe_code_rate_t  fec_inner;   /* forward error correction (see above) */
+       fe_modulation_t modulation;  /* modulation type (see above) */
+};
+
+struct dvb_vsb_parameters {
+       fe_modulation_t modulation;  /* modulation type (see above) */
+};
+
+struct dvb_ofdm_parameters {
+       fe_bandwidth_t      bandwidth;
+       fe_code_rate_t      code_rate_HP;  /* high priority stream code rate */
+       fe_code_rate_t      code_rate_LP;  /* low priority stream code rate */
+       fe_modulation_t     constellation; /* modulation type (see above) */
+       fe_transmit_mode_t  transmission_mode;
+       fe_guard_interval_t guard_interval;
+       fe_hierarchy_t      hierarchy_information;
+};
+
+
+struct dvb_frontend_parameters {
+       __u32 frequency;     /* (absolute) frequency in Hz for QAM/OFDM/ATSC */
+                            /* intermediate frequency in kHz for QPSK */
+       fe_spectral_inversion_t inversion;
+       union {
+               struct dvb_qpsk_parameters qpsk;
+               struct dvb_qam_parameters  qam;
+               struct dvb_ofdm_parameters ofdm;
+               struct dvb_vsb_parameters vsb;
+       } u;
+};
+
+struct dvb_frontend_event {
+       fe_status_t status;
+       struct dvb_frontend_parameters parameters;
+};
+#endif
+
+/* S2API Commands */
+#define DTV_UNDEFINED          0
+#define DTV_TUNE               1
+#define DTV_CLEAR              2
+#define DTV_FREQUENCY          3
+#define DTV_MODULATION         4
+#define DTV_BANDWIDTH_HZ       5
+#define DTV_INVERSION          6
+#define DTV_DISEQC_MASTER      7
+#define DTV_SYMBOL_RATE                8
+#define DTV_INNER_FEC          9
+#define DTV_VOLTAGE            10
+#define DTV_TONE               11
+#define DTV_PILOT              12
+#define DTV_ROLLOFF            13
+#define DTV_DISEQC_SLAVE_REPLY 14
+
+/* Basic enumeration set for querying unlimited capabilities */
+#define DTV_FE_CAPABILITY_COUNT        15
+#define DTV_FE_CAPABILITY      16
+#define DTV_DELIVERY_SYSTEM    17
+
+/* ISDB-T and ISDB-Tsb */
+#define DTV_ISDBT_PARTIAL_RECEPTION    18
+#define DTV_ISDBT_SOUND_BROADCASTING   19
+
+#define DTV_ISDBT_SB_SUBCHANNEL_ID     20
+#define DTV_ISDBT_SB_SEGMENT_IDX       21
+#define DTV_ISDBT_SB_SEGMENT_COUNT     22
+
+#define DTV_ISDBT_LAYERA_FEC                   23
+#define DTV_ISDBT_LAYERA_MODULATION            24
+#define DTV_ISDBT_LAYERA_SEGMENT_COUNT         25
+#define DTV_ISDBT_LAYERA_TIME_INTERLEAVING     26
+
+#define DTV_ISDBT_LAYERB_FEC                   27
+#define DTV_ISDBT_LAYERB_MODULATION            28
+#define DTV_ISDBT_LAYERB_SEGMENT_COUNT         29
+#define DTV_ISDBT_LAYERB_TIME_INTERLEAVING     30
+
+#define DTV_ISDBT_LAYERC_FEC                   31
+#define DTV_ISDBT_LAYERC_MODULATION            32
+#define DTV_ISDBT_LAYERC_SEGMENT_COUNT         33
+#define DTV_ISDBT_LAYERC_TIME_INTERLEAVING     34
+
+#define DTV_API_VERSION                35
+
+#define DTV_CODE_RATE_HP       36
+#define DTV_CODE_RATE_LP       37
+#define DTV_GUARD_INTERVAL     38
+#define DTV_TRANSMISSION_MODE  39
+#define DTV_HIERARCHY          40
+
+#define DTV_ISDBT_LAYER_ENABLED        41
+
+#define DTV_STREAM_ID          42
+#define DTV_ISDBS_TS_ID_LEGACY DTV_STREAM_ID
+#define DTV_DVBT2_PLP_ID_LEGACY        43
+
+#define DTV_ENUM_DELSYS                44
+
+/* ATSC-MH */
+#define DTV_ATSCMH_FIC_VER             45
+#define DTV_ATSCMH_PARADE_ID           46
+#define DTV_ATSCMH_NOG                 47
+#define DTV_ATSCMH_TNOG                        48
+#define DTV_ATSCMH_SGN                 49
+#define DTV_ATSCMH_PRC                 50
+#define DTV_ATSCMH_RS_FRAME_MODE       51
+#define DTV_ATSCMH_RS_FRAME_ENSEMBLE   52
+#define DTV_ATSCMH_RS_CODE_MODE_PRI    53
+#define DTV_ATSCMH_RS_CODE_MODE_SEC    54
+#define DTV_ATSCMH_SCCC_BLOCK_MODE     55
+#define DTV_ATSCMH_SCCC_CODE_MODE_A    56
+#define DTV_ATSCMH_SCCC_CODE_MODE_B    57
+#define DTV_ATSCMH_SCCC_CODE_MODE_C    58
+#define DTV_ATSCMH_SCCC_CODE_MODE_D    59
+
+#define DTV_INTERLEAVING                       60
+#define DTV_LNA                                        61
+
+#define DTV_MAX_COMMAND                                DTV_LNA
+
+typedef enum fe_pilot {
+       PILOT_ON,
+       PILOT_OFF,
+       PILOT_AUTO,
+} fe_pilot_t;
+
+typedef enum fe_rolloff {
+       ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */
+       ROLLOFF_20,
+       ROLLOFF_25,
+       ROLLOFF_AUTO,
+} fe_rolloff_t;
+
+typedef enum fe_delivery_system {
+       SYS_UNDEFINED,
+       SYS_DVBC_ANNEX_A,
+       SYS_DVBC_ANNEX_B,
+       SYS_DVBT,
+       SYS_DSS,
+       SYS_DVBS,
+       SYS_DVBS2,
+       SYS_DVBH,
+       SYS_ISDBT,
+       SYS_ISDBS,
+       SYS_ISDBC,
+       SYS_ATSC,
+       SYS_ATSCMH,
+       SYS_DTMB,
+       SYS_CMMB,
+       SYS_DAB,
+       SYS_DVBT2,
+       SYS_TURBO,
+       SYS_DVBC_ANNEX_C,
+} fe_delivery_system_t;
+
+/* backward compatibility */
+#define SYS_DVBC_ANNEX_AC      SYS_DVBC_ANNEX_A
+#define SYS_DMBTH SYS_DTMB /* DMB-TH is legacy name, use DTMB instead */
+
+/* ATSC-MH */
+
+enum atscmh_sccc_block_mode {
+       ATSCMH_SCCC_BLK_SEP      = 0,
+       ATSCMH_SCCC_BLK_COMB     = 1,
+       ATSCMH_SCCC_BLK_RES      = 2,
+};
+
+enum atscmh_sccc_code_mode {
+       ATSCMH_SCCC_CODE_HLF     = 0,
+       ATSCMH_SCCC_CODE_QTR     = 1,
+       ATSCMH_SCCC_CODE_RES     = 2,
+};
+
+enum atscmh_rs_frame_ensemble {
+       ATSCMH_RSFRAME_ENS_PRI   = 0,
+       ATSCMH_RSFRAME_ENS_SEC   = 1,
+};
+
+enum atscmh_rs_frame_mode {
+       ATSCMH_RSFRAME_PRI_ONLY  = 0,
+       ATSCMH_RSFRAME_PRI_SEC   = 1,
+       ATSCMH_RSFRAME_RES       = 2,
+};
+
+enum atscmh_rs_code_mode {
+       ATSCMH_RSCODE_211_187    = 0,
+       ATSCMH_RSCODE_223_187    = 1,
+       ATSCMH_RSCODE_235_187    = 2,
+       ATSCMH_RSCODE_RES        = 3,
+};
+
+#define NO_STREAM_ID_FILTER    (~0U)
+#define LNA_AUTO                (~0U)
+
+struct dtv_cmds_h {
+       char    *name;          /* A display name for debugging purposes */
+
+       __u32   cmd;            /* A unique ID */
+
+       /* Flags */
+       __u32   set:1;          /* Either a set or get property */
+       __u32   buffer:1;       /* Does this property use the buffer? */
+       __u32   reserved:30;    /* Align */
+};
+
+struct dtv_property {
+       __u32 cmd;
+       __u32 reserved[3];
+       union {
+               __u32 data;
+               struct {
+                       __u8 data[32];
+                       __u32 len;
+                       __u32 reserved1[3];
+                       void *reserved2;
+               } buffer;
+       } u;
+       int result;
+} __attribute__ ((packed));
+
+/* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
+#define DTV_IOCTL_MAX_MSGS 64
+
+struct dtv_properties {
+       __u32 num;
+       struct dtv_property *props;
+};
+
+#define FE_SET_PROPERTY                   _IOW('o', 82, struct dtv_properties)
+#define FE_GET_PROPERTY                   _IOR('o', 83, struct dtv_properties)
+
+
+/**
+ * When set, this flag will disable any zigzagging or other "normal" tuning
+ * behaviour. Additionally, there will be no automatic monitoring of the lock
+ * status, and hence no frontend events will be generated. If a frontend device
+ * is closed, this flag will be automatically turned off when the device is
+ * reopened read-write.
+ */
+#define FE_TUNE_MODE_ONESHOT 0x01
+
+
+#define FE_GET_INFO               _IOR('o', 61, struct dvb_frontend_info)
+
+#define FE_DISEQC_RESET_OVERLOAD   _IO('o', 62)
+#define FE_DISEQC_SEND_MASTER_CMD  _IOW('o', 63, struct dvb_diseqc_master_cmd)
+#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)
+#define FE_DISEQC_SEND_BURST       _IO('o', 65)  /* fe_sec_mini_cmd_t */
+
+#define FE_SET_TONE               _IO('o', 66)  /* fe_sec_tone_mode_t */
+#define FE_SET_VOLTAGE            _IO('o', 67)  /* fe_sec_voltage_t */
+#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68)  /* int */
+
+#define FE_READ_STATUS            _IOR('o', 69, fe_status_t)
+#define FE_READ_BER               _IOR('o', 70, __u32)
+#define FE_READ_SIGNAL_STRENGTH    _IOR('o', 71, __u16)
+#define FE_READ_SNR               _IOR('o', 72, __u16)
+#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)
+
+#define FE_SET_FRONTEND                   _IOW('o', 76, struct dvb_frontend_parameters)
+#define FE_GET_FRONTEND                   _IOR('o', 77, struct dvb_frontend_parameters)
+#define FE_SET_FRONTEND_TUNE_MODE  _IO('o', 81) /* unsigned int */
+#define FE_GET_EVENT              _IOR('o', 78, struct dvb_frontend_event)
+
+#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
+
+#endif /*_DVBFRONTEND_H_*/
diff --git a/include/uapi/linux/dvb/net.h b/include/uapi/linux/dvb/net.h
new file mode 100644 (file)
index 0000000..f451e7e
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * net.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ *                  & Ralph  Metzler <ralph@convergence.de>
+ *                    for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBNET_H_
+#define _DVBNET_H_
+
+#include <linux/types.h>
+
+struct dvb_net_if {
+       __u16 pid;
+       __u16 if_num;
+       __u8  feedtype;
+#define DVB_NET_FEEDTYPE_MPE 0 /* multi protocol encapsulation */
+#define DVB_NET_FEEDTYPE_ULE 1 /* ultra lightweight encapsulation */
+};
+
+
+#define NET_ADD_IF    _IOWR('o', 52, struct dvb_net_if)
+#define NET_REMOVE_IF _IO('o', 53)
+#define NET_GET_IF    _IOWR('o', 54, struct dvb_net_if)
+
+
+/* binary compatibility cruft: */
+struct __dvb_net_if_old {
+       __u16 pid;
+       __u16 if_num;
+};
+#define __NET_ADD_IF_OLD _IOWR('o', 52, struct __dvb_net_if_old)
+#define __NET_GET_IF_OLD _IOWR('o', 54, struct __dvb_net_if_old)
+
+
+#endif /*_DVBNET_H_*/
diff --git a/include/uapi/linux/dvb/osd.h b/include/uapi/linux/dvb/osd.h
new file mode 100644 (file)
index 0000000..880e684
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * osd.h
+ *
+ * Copyright (C) 2001 Ralph  Metzler <ralph@convergence.de>
+ *                  & Marcus Metzler <marcus@convergence.de>
+ *                    for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Lesser Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBOSD_H_
+#define _DVBOSD_H_
+
+#include <linux/compiler.h>
+
+typedef enum {
+  // All functions return -2 on "not open"
+  OSD_Close=1,    // ()
+  // Disables OSD and releases the buffers
+  // returns 0 on success
+  OSD_Open,       // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0))
+  // Opens OSD with this size and bit depth
+  // returns 0 on success, -1 on DRAM allocation error, -2 on "already open"
+  OSD_Show,       // ()
+  // enables OSD mode
+  // returns 0 on success
+  OSD_Hide,       // ()
+  // disables OSD mode
+  // returns 0 on success
+  OSD_Clear,      // ()
+  // Sets all pixel to color 0
+  // returns 0 on success
+  OSD_Fill,       // (color)
+  // Sets all pixel to color <col>
+  // returns 0 on success
+  OSD_SetColor,   // (color,R{x0},G{y0},B{x1},opacity{y1})
+  // set palette entry <num> to <r,g,b>, <mix> and <trans> apply
+  // R,G,B: 0..255
+  // R=Red, G=Green, B=Blue
+  // opacity=0:      pixel opacity 0% (only video pixel shows)
+  // opacity=1..254: pixel opacity as specified in header
+  // opacity=255:    pixel opacity 100% (only OSD pixel shows)
+  // returns 0 on success, -1 on error
+  OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data)
+  // Set a number of entries in the palette
+  // sets the entries "firstcolor" through "lastcolor" from the array "data"
+  // data has 4 byte for each color:
+  // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel
+  OSD_SetTrans,   // (transparency{color})
+  // Sets transparency of mixed pixel (0..15)
+  // returns 0 on success
+  OSD_SetPixel,   // (x0,y0,color)
+  // sets pixel <x>,<y> to color number <col>
+  // returns 0 on success, -1 on error
+  OSD_GetPixel,   // (x0,y0)
+  // returns color number of pixel <x>,<y>,  or -1
+  OSD_SetRow,     // (x0,y0,x1,data)
+  // fills pixels x0,y through  x1,y with the content of data[]
+  // returns 0 on success, -1 on clipping all pixel (no pixel drawn)
+  OSD_SetBlock,   // (x0,y0,x1,y1,increment{color},data)
+  // fills pixels x0,y0 through  x1,y1 with the content of data[]
+  // inc contains the width of one line in the data block,
+  // inc<=0 uses blockwidth as linewidth
+  // returns 0 on success, -1 on clipping all pixel
+  OSD_FillRow,    // (x0,y0,x1,color)
+  // fills pixels x0,y through  x1,y with the color <col>
+  // returns 0 on success, -1 on clipping all pixel
+  OSD_FillBlock,  // (x0,y0,x1,y1,color)
+  // fills pixels x0,y0 through  x1,y1 with the color <col>
+  // returns 0 on success, -1 on clipping all pixel
+  OSD_Line,       // (x0,y0,x1,y1,color)
+  // draw a line from x0,y0 to x1,y1 with the color <col>
+  // returns 0 on success
+  OSD_Query,      // (x0,y0,x1,y1,xasp{color}}), yasp=11
+  // fills parameters with the picture dimensions and the pixel aspect ratio
+  // returns 0 on success
+  OSD_Test,       // ()
+  // draws a test picture. for debugging purposes only
+  // returns 0 on success
+// TODO: remove "test" in final version
+  OSD_Text,       // (x0,y0,size,color,text)
+  OSD_SetWindow, //  (x0) set window with number 0<x0<8 as current
+  OSD_MoveWindow, //  move current window to (x0, y0)
+  OSD_OpenRaw, // Open other types of OSD windows
+} OSD_Command;
+
+typedef struct osd_cmd_s {
+       OSD_Command cmd;
+       int x0;
+       int y0;
+       int x1;
+       int y1;
+       int color;
+       void __user *data;
+} osd_cmd_t;
+
+/* OSD_OpenRaw: set 'color' to desired window type */
+typedef enum {
+       OSD_BITMAP1,           /* 1 bit bitmap */
+       OSD_BITMAP2,           /* 2 bit bitmap */
+       OSD_BITMAP4,           /* 4 bit bitmap */
+       OSD_BITMAP8,           /* 8 bit bitmap */
+       OSD_BITMAP1HR,         /* 1 Bit bitmap half resolution */
+       OSD_BITMAP2HR,         /* 2 bit bitmap half resolution */
+       OSD_BITMAP4HR,         /* 4 bit bitmap half resolution */
+       OSD_BITMAP8HR,         /* 8 bit bitmap half resolution */
+       OSD_YCRCB422,          /* 4:2:2 YCRCB Graphic Display */
+       OSD_YCRCB444,          /* 4:4:4 YCRCB Graphic Display */
+       OSD_YCRCB444HR,        /* 4:4:4 YCRCB graphic half resolution */
+       OSD_VIDEOTSIZE,        /* True Size Normal MPEG Video Display */
+       OSD_VIDEOHSIZE,        /* MPEG Video Display Half Resolution */
+       OSD_VIDEOQSIZE,        /* MPEG Video Display Quarter Resolution */
+       OSD_VIDEODSIZE,        /* MPEG Video Display Double Resolution */
+       OSD_VIDEOTHSIZE,       /* True Size MPEG Video Display Half Resolution */
+       OSD_VIDEOTQSIZE,       /* True Size MPEG Video Display Quarter Resolution*/
+       OSD_VIDEOTDSIZE,       /* True Size MPEG Video Display Double Resolution */
+       OSD_VIDEONSIZE,        /* Full Size MPEG Video Display */
+       OSD_CURSOR             /* Cursor */
+} osd_raw_window_t;
+
+typedef struct osd_cap_s {
+       int  cmd;
+#define OSD_CAP_MEMSIZE         1  /* memory size */
+       long val;
+} osd_cap_t;
+
+
+#define OSD_SEND_CMD            _IOW('o', 160, osd_cmd_t)
+#define OSD_GET_CAPABILITY      _IOR('o', 161, osd_cap_t)
+
+#endif
diff --git a/include/uapi/linux/dvb/version.h b/include/uapi/linux/dvb/version.h
new file mode 100644 (file)
index 0000000..827cce7
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * version.h
+ *
+ * Copyright (C) 2000 Holger Waechtler <holger@convergence.de>
+ *                    for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBVERSION_H_
+#define _DVBVERSION_H_
+
+#define DVB_API_VERSION 5
+#define DVB_API_VERSION_MINOR 9
+
+#endif /*_DVBVERSION_H_*/
diff --git a/include/uapi/linux/dvb/video.h b/include/uapi/linux/dvb/video.h
new file mode 100644 (file)
index 0000000..d3d14a5
--- /dev/null
@@ -0,0 +1,274 @@
+/*
+ * video.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ *                  & Ralph  Metzler <ralph@convergence.de>
+ *                    for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ */
+
+#ifndef _UAPI_DVBVIDEO_H_
+#define _UAPI_DVBVIDEO_H_
+
+#include <linux/types.h>
+#ifndef __KERNEL__
+#include <stdint.h>
+#include <time.h>
+#endif
+
+typedef enum {
+       VIDEO_FORMAT_4_3,     /* Select 4:3 format */
+       VIDEO_FORMAT_16_9,    /* Select 16:9 format. */
+       VIDEO_FORMAT_221_1    /* 2.21:1 */
+} video_format_t;
+
+
+typedef enum {
+        VIDEO_SYSTEM_PAL,
+        VIDEO_SYSTEM_NTSC,
+        VIDEO_SYSTEM_PALN,
+        VIDEO_SYSTEM_PALNc,
+        VIDEO_SYSTEM_PALM,
+        VIDEO_SYSTEM_NTSC60,
+        VIDEO_SYSTEM_PAL60,
+        VIDEO_SYSTEM_PALM60
+} video_system_t;
+
+
+typedef enum {
+       VIDEO_PAN_SCAN,       /* use pan and scan format */
+       VIDEO_LETTER_BOX,     /* use letterbox format */
+       VIDEO_CENTER_CUT_OUT  /* use center cut out format */
+} video_displayformat_t;
+
+typedef struct {
+       int w;
+       int h;
+       video_format_t aspect_ratio;
+} video_size_t;
+
+typedef enum {
+       VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */
+       VIDEO_SOURCE_MEMORY /* If this source is selected, the stream
+                              comes from the user through the write
+                              system call */
+} video_stream_source_t;
+
+
+typedef enum {
+       VIDEO_STOPPED, /* Video is stopped */
+       VIDEO_PLAYING, /* Video is currently playing */
+       VIDEO_FREEZED  /* Video is freezed */
+} video_play_state_t;
+
+
+/* Decoder commands */
+#define VIDEO_CMD_PLAY        (0)
+#define VIDEO_CMD_STOP        (1)
+#define VIDEO_CMD_FREEZE      (2)
+#define VIDEO_CMD_CONTINUE    (3)
+
+/* Flags for VIDEO_CMD_FREEZE */
+#define VIDEO_CMD_FREEZE_TO_BLACK      (1 << 0)
+
+/* Flags for VIDEO_CMD_STOP */
+#define VIDEO_CMD_STOP_TO_BLACK        (1 << 0)
+#define VIDEO_CMD_STOP_IMMEDIATELY             (1 << 1)
+
+/* Play input formats: */
+/* The decoder has no special format requirements */
+#define VIDEO_PLAY_FMT_NONE         (0)
+/* The decoder requires full GOPs */
+#define VIDEO_PLAY_FMT_GOP          (1)
+
+/* The structure must be zeroed before use by the application
+   This ensures it can be extended safely in the future. */
+struct video_command {
+       __u32 cmd;
+       __u32 flags;
+       union {
+               struct {
+                       __u64 pts;
+               } stop;
+
+               struct {
+                       /* 0 or 1000 specifies normal speed,
+                          1 specifies forward single stepping,
+                          -1 specifies backward single stepping,
+                          >1: playback at speed/1000 of the normal speed,
+                          <-1: reverse playback at (-speed/1000) of the normal speed. */
+                       __s32 speed;
+                       __u32 format;
+               } play;
+
+               struct {
+                       __u32 data[16];
+               } raw;
+       };
+};
+
+/* FIELD_UNKNOWN can be used if the hardware does not know whether
+   the Vsync is for an odd, even or progressive (i.e. non-interlaced)
+   field. */
+#define VIDEO_VSYNC_FIELD_UNKNOWN      (0)
+#define VIDEO_VSYNC_FIELD_ODD          (1)
+#define VIDEO_VSYNC_FIELD_EVEN         (2)
+#define VIDEO_VSYNC_FIELD_PROGRESSIVE  (3)
+
+struct video_event {
+       __s32 type;
+#define VIDEO_EVENT_SIZE_CHANGED       1
+#define VIDEO_EVENT_FRAME_RATE_CHANGED 2
+#define VIDEO_EVENT_DECODER_STOPPED    3
+#define VIDEO_EVENT_VSYNC              4
+       __kernel_time_t timestamp;
+       union {
+               video_size_t size;
+               unsigned int frame_rate;        /* in frames per 1000sec */
+               unsigned char vsync_field;      /* unknown/odd/even/progressive */
+       } u;
+};
+
+
+struct video_status {
+       int                   video_blank;   /* blank video on freeze? */
+       video_play_state_t    play_state;    /* current state of playback */
+       video_stream_source_t stream_source; /* current source (demux/memory) */
+       video_format_t        video_format;  /* current aspect ratio of stream*/
+       video_displayformat_t display_format;/* selected cropping mode */
+};
+
+
+struct video_still_picture {
+       char __user *iFrame;        /* pointer to a single iframe in memory */
+       __s32 size;
+};
+
+
+typedef
+struct video_highlight {
+       int     active;      /*    1=show highlight, 0=hide highlight */
+       __u8    contrast1;   /*    7- 4  Pattern pixel contrast */
+                            /*    3- 0  Background pixel contrast */
+       __u8    contrast2;   /*    7- 4  Emphasis pixel-2 contrast */
+                            /*    3- 0  Emphasis pixel-1 contrast */
+       __u8    color1;      /*    7- 4  Pattern pixel color */
+                            /*    3- 0  Background pixel color */
+       __u8    color2;      /*    7- 4  Emphasis pixel-2 color */
+                            /*    3- 0  Emphasis pixel-1 color */
+       __u32    ypos;       /*   23-22  auto action mode */
+                            /*   21-12  start y */
+                            /*    9- 0  end y */
+       __u32    xpos;       /*   23-22  button color number */
+                            /*   21-12  start x */
+                            /*    9- 0  end x */
+} video_highlight_t;
+
+
+typedef struct video_spu {
+       int active;
+       int stream_id;
+} video_spu_t;
+
+
+typedef struct video_spu_palette {      /* SPU Palette information */
+       int length;
+       __u8 __user *palette;
+} video_spu_palette_t;
+
+
+typedef struct video_navi_pack {
+       int length;          /* 0 ... 1024 */
+       __u8 data[1024];
+} video_navi_pack_t;
+
+
+typedef __u16 video_attributes_t;
+/*   bits: descr. */
+/*   15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */
+/*   13-12 TV system (0=525/60, 1=625/50) */
+/*   11-10 Aspect ratio (0=4:3, 3=16:9) */
+/*    9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */
+/*    7    line 21-1 data present in GOP (1=yes, 0=no) */
+/*    6    line 21-2 data present in GOP (1=yes, 0=no) */
+/*    5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */
+/*    2    source letterboxed (1=yes, 0=no) */
+/*    0    film/camera mode (0=camera, 1=film (625/50 only)) */
+
+
+/* bit definitions for capabilities: */
+/* can the hardware decode MPEG1 and/or MPEG2? */
+#define VIDEO_CAP_MPEG1   1
+#define VIDEO_CAP_MPEG2   2
+/* can you send a system and/or program stream to video device?
+   (you still have to open the video and the audio device but only
+    send the stream to the video device) */
+#define VIDEO_CAP_SYS     4
+#define VIDEO_CAP_PROG    8
+/* can the driver also handle SPU, NAVI and CSS encoded data?
+   (CSS API is not present yet) */
+#define VIDEO_CAP_SPU    16
+#define VIDEO_CAP_NAVI   32
+#define VIDEO_CAP_CSS    64
+
+
+#define VIDEO_STOP                 _IO('o', 21)
+#define VIDEO_PLAY                 _IO('o', 22)
+#define VIDEO_FREEZE               _IO('o', 23)
+#define VIDEO_CONTINUE             _IO('o', 24)
+#define VIDEO_SELECT_SOURCE        _IO('o', 25)
+#define VIDEO_SET_BLANK            _IO('o', 26)
+#define VIDEO_GET_STATUS           _IOR('o', 27, struct video_status)
+#define VIDEO_GET_EVENT            _IOR('o', 28, struct video_event)
+#define VIDEO_SET_DISPLAY_FORMAT   _IO('o', 29)
+#define VIDEO_STILLPICTURE         _IOW('o', 30, struct video_still_picture)
+#define VIDEO_FAST_FORWARD         _IO('o', 31)
+#define VIDEO_SLOWMOTION           _IO('o', 32)
+#define VIDEO_GET_CAPABILITIES     _IOR('o', 33, unsigned int)
+#define VIDEO_CLEAR_BUFFER         _IO('o',  34)
+#define VIDEO_SET_ID               _IO('o', 35)
+#define VIDEO_SET_STREAMTYPE       _IO('o', 36)
+#define VIDEO_SET_FORMAT           _IO('o', 37)
+#define VIDEO_SET_SYSTEM           _IO('o', 38)
+#define VIDEO_SET_HIGHLIGHT        _IOW('o', 39, video_highlight_t)
+#define VIDEO_SET_SPU              _IOW('o', 50, video_spu_t)
+#define VIDEO_SET_SPU_PALETTE      _IOW('o', 51, video_spu_palette_t)
+#define VIDEO_GET_NAVI             _IOR('o', 52, video_navi_pack_t)
+#define VIDEO_SET_ATTRIBUTES       _IO('o', 53)
+#define VIDEO_GET_SIZE             _IOR('o', 55, video_size_t)
+#define VIDEO_GET_FRAME_RATE       _IOR('o', 56, unsigned int)
+
+/**
+ * VIDEO_GET_PTS
+ *
+ * Read the 33 bit presentation time stamp as defined
+ * in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
+ *
+ * The PTS should belong to the currently played
+ * frame if possible, but may also be a value close to it
+ * like the PTS of the last decoded frame or the last PTS
+ * extracted by the PES parser.
+ */
+#define VIDEO_GET_PTS              _IOR('o', 57, __u64)
+
+/* Read the number of displayed frames since the decoder was started */
+#define VIDEO_GET_FRAME_COUNT             _IOR('o', 58, __u64)
+
+#define VIDEO_COMMAND             _IOWR('o', 59, struct video_command)
+#define VIDEO_TRY_COMMAND         _IOWR('o', 60, struct video_command)
+
+#endif /* _UAPI_DVBVIDEO_H_ */
index 1065078938f9f144e7c206301da7f87c24458b11..3921e33aec8e36da1775c63a6ee4e2998faa313b 100644 (file)
@@ -9,8 +9,8 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#ifndef _LINUX_ELF_FDPIC_H
-#define _LINUX_ELF_FDPIC_H
+#ifndef _UAPI_LINUX_ELF_FDPIC_H
+#define _UAPI_LINUX_ELF_FDPIC_H
 
 #include <linux/elf.h>
 
@@ -31,40 +31,4 @@ struct elf32_fdpic_loadmap {
 
 #define ELF32_FDPIC_LOADMAP_VERSION    0x0000
 
-#ifndef __KERNEL__
-/*
- * binfmt binary parameters structure
- */
-struct elf_fdpic_params {
-       struct elfhdr                   hdr;            /* ref copy of ELF header */
-       struct elf_phdr                 *phdrs;         /* ref copy of PT_PHDR table */
-       struct elf32_fdpic_loadmap      *loadmap;       /* loadmap to be passed to userspace */
-       unsigned long                   elfhdr_addr;    /* mapped ELF header user address */
-       unsigned long                   ph_addr;        /* mapped PT_PHDR user address */
-       unsigned long                   map_addr;       /* mapped loadmap user address */
-       unsigned long                   entry_addr;     /* mapped entry user address */
-       unsigned long                   stack_size;     /* stack size requested (PT_GNU_STACK) */
-       unsigned long                   dynamic_addr;   /* mapped PT_DYNAMIC user address */
-       unsigned long                   load_addr;      /* user address at which to map binary */
-       unsigned long                   flags;
-#define ELF_FDPIC_FLAG_ARRANGEMENT     0x0000000f      /* PT_LOAD arrangement flags */
-#define ELF_FDPIC_FLAG_INDEPENDENT     0x00000000      /* PT_LOADs can be put anywhere */
-#define ELF_FDPIC_FLAG_HONOURVADDR     0x00000001      /* PT_LOAD.vaddr must be honoured */
-#define ELF_FDPIC_FLAG_CONSTDISP       0x00000002      /* PT_LOADs require constant
-                                                        * displacement */
-#define ELF_FDPIC_FLAG_CONTIGUOUS      0x00000003      /* PT_LOADs should be contiguous */
-#define ELF_FDPIC_FLAG_EXEC_STACK      0x00000010      /* T if stack to be executable */
-#define ELF_FDPIC_FLAG_NOEXEC_STACK    0x00000020      /* T if stack not to be executable */
-#define ELF_FDPIC_FLAG_EXECUTABLE      0x00000040      /* T if this object is the executable */
-#define ELF_FDPIC_FLAG_PRESENT         0x80000000      /* T if this object is present */
-};
-
-#ifdef CONFIG_MMU
-extern void elf_fdpic_arch_lay_out_mm(struct elf_fdpic_params *exec_params,
-                                     struct elf_fdpic_params *interp_params,
-                                     unsigned long *start_stack,
-                                     unsigned long *start_brk);
-#endif
-#endif /* __KERNEL__ */
-
-#endif /* _LINUX_ELF_FDPIC_H */
+#endif /* _UAPI_LINUX_ELF_FDPIC_H */
index 9fcc880d4be2fe7a17c5b6f64af2d41b0315c1d6..780d4c6093eb767ff7bd15ee30cd07bb76b04763 100644 (file)
@@ -57,85 +57,6 @@ struct inodes_stat_t {
 
 #define NR_FILE  8192  /* this can well be larger on a larger system */
 
-#define MAY_EXEC               0x00000001
-#define MAY_WRITE              0x00000002
-#define MAY_READ               0x00000004
-#define MAY_APPEND             0x00000008
-#define MAY_ACCESS             0x00000010
-#define MAY_OPEN               0x00000020
-#define MAY_CHDIR              0x00000040
-/* called from RCU mode, don't block */
-#define MAY_NOT_BLOCK          0x00000080
-
-/*
- * flags in file.f_mode.  Note that FMODE_READ and FMODE_WRITE must correspond
- * to O_WRONLY and O_RDWR via the strange trick in __dentry_open()
- */
-
-/* file is open for reading */
-#define FMODE_READ             ((__force fmode_t)0x1)
-/* file is open for writing */
-#define FMODE_WRITE            ((__force fmode_t)0x2)
-/* file is seekable */
-#define FMODE_LSEEK            ((__force fmode_t)0x4)
-/* file can be accessed using pread */
-#define FMODE_PREAD            ((__force fmode_t)0x8)
-/* file can be accessed using pwrite */
-#define FMODE_PWRITE           ((__force fmode_t)0x10)
-/* File is opened for execution with sys_execve / sys_uselib */
-#define FMODE_EXEC             ((__force fmode_t)0x20)
-/* File is opened with O_NDELAY (only set for block devices) */
-#define FMODE_NDELAY           ((__force fmode_t)0x40)
-/* File is opened with O_EXCL (only set for block devices) */
-#define FMODE_EXCL             ((__force fmode_t)0x80)
-/* File is opened using open(.., 3, ..) and is writeable only for ioctls
-   (specialy hack for floppy.c) */
-#define FMODE_WRITE_IOCTL      ((__force fmode_t)0x100)
-/* 32bit hashes as llseek() offset (for directories) */
-#define FMODE_32BITHASH         ((__force fmode_t)0x200)
-/* 64bit hashes as llseek() offset (for directories) */
-#define FMODE_64BITHASH         ((__force fmode_t)0x400)
-
-/*
- * Don't update ctime and mtime.
- *
- * Currently a special hack for the XFS open_by_handle ioctl, but we'll
- * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon.
- */
-#define FMODE_NOCMTIME         ((__force fmode_t)0x800)
-
-/* Expect random access pattern */
-#define FMODE_RANDOM           ((__force fmode_t)0x1000)
-
-/* File is huge (eg. /dev/kmem): treat loff_t as unsigned */
-#define FMODE_UNSIGNED_OFFSET  ((__force fmode_t)0x2000)
-
-/* File is opened with O_PATH; almost nothing can be done with it */
-#define FMODE_PATH             ((__force fmode_t)0x4000)
-
-/* File was opened by fanotify and shouldn't generate fanotify events */
-#define FMODE_NONOTIFY         ((__force fmode_t)0x1000000)
-
-/*
- * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector
- * that indicates that they should check the contents of the iovec are
- * valid, but not check the memory that the iovec elements
- * points too.
- */
-#define CHECK_IOVEC_ONLY -1
-
-#define SEL_IN         1
-#define SEL_OUT                2
-#define SEL_EX         4
-
-/* public flags for file_system_type */
-#define FS_REQUIRES_DEV 1 
-#define FS_BINARY_MOUNTDATA 2
-#define FS_HAS_SUBTYPE 4
-#define FS_REVAL_DOT   16384   /* Check the paths ".", ".." for staleness */
-#define FS_RENAME_DOES_D_MOVE  32768   /* FS will handle d_move()
-                                        * during rename() internally.
-                                        */
 
 /*
  * These are the fs-independent mount-flags: up to 32 flags are supported
@@ -181,59 +102,6 @@ struct inodes_stat_t {
 #define MS_MGC_VAL 0xC0ED0000
 #define MS_MGC_MSK 0xffff0000
 
-/* Inode flags - they have nothing to superblock flags now */
-
-#define S_SYNC         1       /* Writes are synced at once */
-#define S_NOATIME      2       /* Do not update access times */
-#define S_APPEND       4       /* Append-only file */
-#define S_IMMUTABLE    8       /* Immutable file */
-#define S_DEAD         16      /* removed, but still open directory */
-#define S_NOQUOTA      32      /* Inode is not counted to quota */
-#define S_DIRSYNC      64      /* Directory modifications are synchronous */
-#define S_NOCMTIME     128     /* Do not update file c/mtime */
-#define S_SWAPFILE     256     /* Do not truncate: swapon got its bmaps */
-#define S_PRIVATE      512     /* Inode is fs-internal */
-#define S_IMA          1024    /* Inode has an associated IMA struct */
-#define S_AUTOMOUNT    2048    /* Automount/referral quasi-directory */
-#define S_NOSEC                4096    /* no suid or xattr security attributes */
-
-/*
- * Note that nosuid etc flags are inode-specific: setting some file-system
- * flags just means all the inodes inherit those flags by default. It might be
- * possible to override it selectively if you really wanted to with some
- * ioctl() that is not currently implemented.
- *
- * Exception: MS_RDONLY is always applied to the entire file system.
- *
- * Unfortunately, it is possible to change a filesystems flags with it mounted
- * with files in use.  This means that all of the inodes will not have their
- * i_flags updated.  Hence, i_flags no longer inherit the superblock mount
- * flags, so these have to be checked separately. -- rmk@arm.uk.linux.org
- */
-#define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg))
-
-#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY)
-#define IS_SYNC(inode)         (__IS_FLG(inode, MS_SYNCHRONOUS) || \
-                                       ((inode)->i_flags & S_SYNC))
-#define IS_DIRSYNC(inode)      (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \
-                                       ((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
-#define IS_MANDLOCK(inode)     __IS_FLG(inode, MS_MANDLOCK)
-#define IS_NOATIME(inode)   __IS_FLG(inode, MS_RDONLY|MS_NOATIME)
-#define IS_I_VERSION(inode)   __IS_FLG(inode, MS_I_VERSION)
-
-#define IS_NOQUOTA(inode)      ((inode)->i_flags & S_NOQUOTA)
-#define IS_APPEND(inode)       ((inode)->i_flags & S_APPEND)
-#define IS_IMMUTABLE(inode)    ((inode)->i_flags & S_IMMUTABLE)
-#define IS_POSIXACL(inode)     __IS_FLG(inode, MS_POSIXACL)
-
-#define IS_DEADDIR(inode)      ((inode)->i_flags & S_DEAD)
-#define IS_NOCMTIME(inode)     ((inode)->i_flags & S_NOCMTIME)
-#define IS_SWAPFILE(inode)     ((inode)->i_flags & S_SWAPFILE)
-#define IS_PRIVATE(inode)      ((inode)->i_flags & S_PRIVATE)
-#define IS_IMA(inode)          ((inode)->i_flags & S_IMA)
-#define IS_AUTOMOUNT(inode)    ((inode)->i_flags & S_AUTOMOUNT)
-#define IS_NOSEC(inode)                ((inode)->i_flags & S_NOSEC)
-
 /* the read-only stuff doesn't really belong here, but any other place is
    probably as bad and I don't want to create yet another include file. */
 
index aafaa5aa54d46bb9a93a8137a22344408298223f..30ab3cd3b8a55b7f347eda392cae4578645af9e0 100644 (file)
@@ -1 +1,2 @@
 # UAPI Header export list
+header-y += hsi_char.h
diff --git a/include/uapi/linux/hsi/hsi_char.h b/include/uapi/linux/hsi/hsi_char.h
new file mode 100644 (file)
index 0000000..76160b4
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Part of the HSI character device driver.
+ *
+ * Copyright (C) 2010 Nokia Corporation. All rights reserved.
+ *
+ * Contact: Andras Domokos <andras.domokos at nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef __HSI_CHAR_H
+#define __HSI_CHAR_H
+
+#define HSI_CHAR_MAGIC         'k'
+#define HSC_IOW(num, dtype)    _IOW(HSI_CHAR_MAGIC, num, dtype)
+#define HSC_IOR(num, dtype)    _IOR(HSI_CHAR_MAGIC, num, dtype)
+#define HSC_IOWR(num, dtype)   _IOWR(HSI_CHAR_MAGIC, num, dtype)
+#define HSC_IO(num)            _IO(HSI_CHAR_MAGIC, num)
+
+#define HSC_RESET              HSC_IO(16)
+#define HSC_SET_PM             HSC_IO(17)
+#define HSC_SEND_BREAK         HSC_IO(18)
+#define HSC_SET_RX             HSC_IOW(19, struct hsc_rx_config)
+#define HSC_GET_RX             HSC_IOW(20, struct hsc_rx_config)
+#define HSC_SET_TX             HSC_IOW(21, struct hsc_tx_config)
+#define HSC_GET_TX             HSC_IOW(22, struct hsc_tx_config)
+
+#define HSC_PM_DISABLE         0
+#define HSC_PM_ENABLE          1
+
+#define HSC_MODE_STREAM                1
+#define HSC_MODE_FRAME         2
+#define HSC_FLOW_SYNC          0
+#define HSC_ARB_RR             0
+#define HSC_ARB_PRIO           1
+
+struct hsc_rx_config {
+       uint32_t mode;
+       uint32_t flow;
+       uint32_t channels;
+};
+
+struct hsc_tx_config {
+       uint32_t mode;
+       uint32_t channels;
+       uint32_t speed;
+       uint32_t arb_mode;
+};
+
+#endif /* __HSI_CHAR_H */
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ae5704fa77ad6d15e8de4623ca6465f24f2341b9 100644 (file)
@@ -0,0 +1,4 @@
+/*
+ * There isn't anything here anymore, but the file must not be empty or patch
+ * will delete it.
+ */
index aafaa5aa54d46bb9a93a8137a22344408298223f..6cb4ea8268349b44864c93d94960a6670059f4ed 100644 (file)
@@ -1 +1,11 @@
 # UAPI Header export list
+header-y += audio.h
+header-y += cdc.h
+header-y += ch11.h
+header-y += ch9.h
+header-y += functionfs.h
+header-y += g_printer.h
+header-y += gadgetfs.h
+header-y += midi.h
+header-y += tmc.h
+header-y += video.h
diff --git a/include/uapi/linux/usb/audio.h b/include/uapi/linux/usb/audio.h
new file mode 100644 (file)
index 0000000..ac90037
--- /dev/null
@@ -0,0 +1,545 @@
+/*
+ * <linux/usb/audio.h> -- USB Audio definitions.
+ *
+ * Copyright (C) 2006 Thumtronics Pty Ltd.
+ * Developed for Thumtronics by Grey Innovation
+ * Ben Williamson <ben.williamson@greyinnovation.com>
+ *
+ * This software is distributed under the terms of the GNU General Public
+ * License ("GPL") version 2, as published by the Free Software Foundation.
+ *
+ * This file holds USB constants and structures defined
+ * by the USB Device Class Definition for Audio Devices.
+ * Comments below reference relevant sections of that document:
+ *
+ * http://www.usb.org/developers/devclass_docs/audio10.pdf
+ *
+ * Types and defines in this file are either specific to version 1.0 of
+ * this standard or common for newer versions.
+ */
+
+#ifndef _UAPI__LINUX_USB_AUDIO_H
+#define _UAPI__LINUX_USB_AUDIO_H
+
+#include <linux/types.h>
+
+/* bInterfaceProtocol values to denote the version of the standard used */
+#define UAC_VERSION_1                  0x00
+#define UAC_VERSION_2                  0x20
+
+/* A.2 Audio Interface Subclass Codes */
+#define USB_SUBCLASS_AUDIOCONTROL      0x01
+#define USB_SUBCLASS_AUDIOSTREAMING    0x02
+#define USB_SUBCLASS_MIDISTREAMING     0x03
+
+/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */
+#define UAC_HEADER                     0x01
+#define UAC_INPUT_TERMINAL             0x02
+#define UAC_OUTPUT_TERMINAL            0x03
+#define UAC_MIXER_UNIT                 0x04
+#define UAC_SELECTOR_UNIT              0x05
+#define UAC_FEATURE_UNIT               0x06
+#define UAC1_PROCESSING_UNIT           0x07
+#define UAC1_EXTENSION_UNIT            0x08
+
+/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */
+#define UAC_AS_GENERAL                 0x01
+#define UAC_FORMAT_TYPE                        0x02
+#define UAC_FORMAT_SPECIFIC            0x03
+
+/* A.7 Processing Unit Process Types */
+#define UAC_PROCESS_UNDEFINED          0x00
+#define UAC_PROCESS_UP_DOWNMIX         0x01
+#define UAC_PROCESS_DOLBY_PROLOGIC     0x02
+#define UAC_PROCESS_STEREO_EXTENDER    0x03
+#define UAC_PROCESS_REVERB             0x04
+#define UAC_PROCESS_CHORUS             0x05
+#define UAC_PROCESS_DYN_RANGE_COMP     0x06
+
+/* A.8 Audio Class-Specific Endpoint Descriptor Subtypes */
+#define UAC_EP_GENERAL                 0x01
+
+/* A.9 Audio Class-Specific Request Codes */
+#define UAC_SET_                       0x00
+#define UAC_GET_                       0x80
+
+#define UAC__CUR                       0x1
+#define UAC__MIN                       0x2
+#define UAC__MAX                       0x3
+#define UAC__RES                       0x4
+#define UAC__MEM                       0x5
+
+#define UAC_SET_CUR                    (UAC_SET_ | UAC__CUR)
+#define UAC_GET_CUR                    (UAC_GET_ | UAC__CUR)
+#define UAC_SET_MIN                    (UAC_SET_ | UAC__MIN)
+#define UAC_GET_MIN                    (UAC_GET_ | UAC__MIN)
+#define UAC_SET_MAX                    (UAC_SET_ | UAC__MAX)
+#define UAC_GET_MAX                    (UAC_GET_ | UAC__MAX)
+#define UAC_SET_RES                    (UAC_SET_ | UAC__RES)
+#define UAC_GET_RES                    (UAC_GET_ | UAC__RES)
+#define UAC_SET_MEM                    (UAC_SET_ | UAC__MEM)
+#define UAC_GET_MEM                    (UAC_GET_ | UAC__MEM)
+
+#define UAC_GET_STAT                   0xff
+
+/* A.10 Control Selector Codes */
+
+/* A.10.1 Terminal Control Selectors */
+#define UAC_TERM_COPY_PROTECT          0x01
+
+/* A.10.2 Feature Unit Control Selectors */
+#define UAC_FU_MUTE                    0x01
+#define UAC_FU_VOLUME                  0x02
+#define UAC_FU_BASS                    0x03
+#define UAC_FU_MID                     0x04
+#define UAC_FU_TREBLE                  0x05
+#define UAC_FU_GRAPHIC_EQUALIZER       0x06
+#define UAC_FU_AUTOMATIC_GAIN          0x07
+#define UAC_FU_DELAY                   0x08
+#define UAC_FU_BASS_BOOST              0x09
+#define UAC_FU_LOUDNESS                        0x0a
+
+#define UAC_CONTROL_BIT(CS)    (1 << ((CS) - 1))
+
+/* A.10.3.1 Up/Down-mix Processing Unit Controls Selectors */
+#define UAC_UD_ENABLE                  0x01
+#define UAC_UD_MODE_SELECT             0x02
+
+/* A.10.3.2 Dolby Prologic (tm) Processing Unit Controls Selectors */
+#define UAC_DP_ENABLE                  0x01
+#define UAC_DP_MODE_SELECT             0x02
+
+/* A.10.3.3 3D Stereo Extender Processing Unit Control Selectors */
+#define UAC_3D_ENABLE                  0x01
+#define UAC_3D_SPACE                   0x02
+
+/* A.10.3.4 Reverberation Processing Unit Control Selectors */
+#define UAC_REVERB_ENABLE              0x01
+#define UAC_REVERB_LEVEL               0x02
+#define UAC_REVERB_TIME                        0x03
+#define UAC_REVERB_FEEDBACK            0x04
+
+/* A.10.3.5 Chorus Processing Unit Control Selectors */
+#define UAC_CHORUS_ENABLE              0x01
+#define UAC_CHORUS_LEVEL               0x02
+#define UAC_CHORUS_RATE                        0x03
+#define UAC_CHORUS_DEPTH               0x04
+
+/* A.10.3.6 Dynamic Range Compressor Unit Control Selectors */
+#define UAC_DCR_ENABLE                 0x01
+#define UAC_DCR_RATE                   0x02
+#define UAC_DCR_MAXAMPL                        0x03
+#define UAC_DCR_THRESHOLD              0x04
+#define UAC_DCR_ATTACK_TIME            0x05
+#define UAC_DCR_RELEASE_TIME           0x06
+
+/* A.10.4 Extension Unit Control Selectors */
+#define UAC_XU_ENABLE                  0x01
+
+/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */
+#define UAC_MS_HEADER                  0x01
+#define UAC_MIDI_IN_JACK               0x02
+#define UAC_MIDI_OUT_JACK              0x03
+
+/* MIDI - A.1 MS Class-Specific Endpoint Descriptor Subtypes */
+#define UAC_MS_GENERAL                 0x01
+
+/* Terminals - 2.1 USB Terminal Types */
+#define UAC_TERMINAL_UNDEFINED         0x100
+#define UAC_TERMINAL_STREAMING         0x101
+#define UAC_TERMINAL_VENDOR_SPEC       0x1FF
+
+/* Terminal Control Selectors */
+/* 4.3.2  Class-Specific AC Interface Descriptor */
+struct uac1_ac_header_descriptor {
+       __u8  bLength;                  /* 8 + n */
+       __u8  bDescriptorType;          /* USB_DT_CS_INTERFACE */
+       __u8  bDescriptorSubtype;       /* UAC_MS_HEADER */
+       __le16 bcdADC;                  /* 0x0100 */
+       __le16 wTotalLength;            /* includes Unit and Terminal desc. */
+       __u8  bInCollection;            /* n */
+       __u8  baInterfaceNr[];          /* [n] */
+} __attribute__ ((packed));
+
+#define UAC_DT_AC_HEADER_SIZE(n)       (8 + (n))
+
+/* As above, but more useful for defining your own descriptors: */
+#define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n)                    \
+struct uac1_ac_header_descriptor_##n {                 \
+       __u8  bLength;                                          \
+       __u8  bDescriptorType;                                  \
+       __u8  bDescriptorSubtype;                               \
+       __le16 bcdADC;                                          \
+       __le16 wTotalLength;                                    \
+       __u8  bInCollection;                                    \
+       __u8  baInterfaceNr[n];                                 \
+} __attribute__ ((packed))
+
+/* 4.3.2.1 Input Terminal Descriptor */
+struct uac_input_terminal_descriptor {
+       __u8  bLength;                  /* in bytes: 12 */
+       __u8  bDescriptorType;          /* CS_INTERFACE descriptor type */
+       __u8  bDescriptorSubtype;       /* INPUT_TERMINAL descriptor subtype */
+       __u8  bTerminalID;              /* Constant uniquely terminal ID */
+       __le16 wTerminalType;           /* USB Audio Terminal Types */
+       __u8  bAssocTerminal;           /* ID of the Output Terminal associated */
+       __u8  bNrChannels;              /* Number of logical output channels */
+       __le16 wChannelConfig;
+       __u8  iChannelNames;
+       __u8  iTerminal;
+} __attribute__ ((packed));
+
+#define UAC_DT_INPUT_TERMINAL_SIZE                     12
+
+/* Terminals - 2.2 Input Terminal Types */
+#define UAC_INPUT_TERMINAL_UNDEFINED                   0x200
+#define UAC_INPUT_TERMINAL_MICROPHONE                  0x201
+#define UAC_INPUT_TERMINAL_DESKTOP_MICROPHONE          0x202
+#define UAC_INPUT_TERMINAL_PERSONAL_MICROPHONE         0x203
+#define UAC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE         0x204
+#define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY            0x205
+#define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY       0x206
+
+/* Terminals - control selectors */
+
+#define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL           0x01
+
+/* 4.3.2.2 Output Terminal Descriptor */
+struct uac1_output_terminal_descriptor {
+       __u8  bLength;                  /* in bytes: 9 */
+       __u8  bDescriptorType;          /* CS_INTERFACE descriptor type */
+       __u8  bDescriptorSubtype;       /* OUTPUT_TERMINAL descriptor subtype */
+       __u8  bTerminalID;              /* Constant uniquely terminal ID */
+       __le16 wTerminalType;           /* USB Audio Terminal Types */
+       __u8  bAssocTerminal;           /* ID of the Input Terminal associated */
+       __u8  bSourceID;                /* ID of the connected Unit or Terminal*/
+       __u8  iTerminal;
+} __attribute__ ((packed));
+
+#define UAC_DT_OUTPUT_TERMINAL_SIZE                    9
+
+/* Terminals - 2.3 Output Terminal Types */
+#define UAC_OUTPUT_TERMINAL_UNDEFINED                  0x300
+#define UAC_OUTPUT_TERMINAL_SPEAKER                    0x301
+#define UAC_OUTPUT_TERMINAL_HEADPHONES                 0x302
+#define UAC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303
+#define UAC_OUTPUT_TERMINAL_DESKTOP_SPEAKER            0x304
+#define UAC_OUTPUT_TERMINAL_ROOM_SPEAKER               0x305
+#define UAC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER      0x306
+#define UAC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER   0x307
+
+/* Set bControlSize = 2 as default setting */
+#define UAC_DT_FEATURE_UNIT_SIZE(ch)           (7 + ((ch) + 1) * 2)
+
+/* As above, but more useful for defining your own descriptors: */
+#define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch)                        \
+struct uac_feature_unit_descriptor_##ch {                      \
+       __u8  bLength;                                          \
+       __u8  bDescriptorType;                                  \
+       __u8  bDescriptorSubtype;                               \
+       __u8  bUnitID;                                          \
+       __u8  bSourceID;                                        \
+       __u8  bControlSize;                                     \
+       __le16 bmaControls[ch + 1];                             \
+       __u8  iFeature;                                         \
+} __attribute__ ((packed))
+
+/* 4.3.2.3 Mixer Unit Descriptor */
+struct uac_mixer_unit_descriptor {
+       __u8 bLength;
+       __u8 bDescriptorType;
+       __u8 bDescriptorSubtype;
+       __u8 bUnitID;
+       __u8 bNrInPins;
+       __u8 baSourceID[];
+} __attribute__ ((packed));
+
+static inline __u8 uac_mixer_unit_bNrChannels(struct uac_mixer_unit_descriptor *desc)
+{
+       return desc->baSourceID[desc->bNrInPins];
+}
+
+static inline __u32 uac_mixer_unit_wChannelConfig(struct uac_mixer_unit_descriptor *desc,
+                                                 int protocol)
+{
+       if (protocol == UAC_VERSION_1)
+               return (desc->baSourceID[desc->bNrInPins + 2] << 8) |
+                       desc->baSourceID[desc->bNrInPins + 1];
+       else
+               return  (desc->baSourceID[desc->bNrInPins + 4] << 24) |
+                       (desc->baSourceID[desc->bNrInPins + 3] << 16) |
+                       (desc->baSourceID[desc->bNrInPins + 2] << 8)  |
+                       (desc->baSourceID[desc->bNrInPins + 1]);
+}
+
+static inline __u8 uac_mixer_unit_iChannelNames(struct uac_mixer_unit_descriptor *desc,
+                                               int protocol)
+{
+       return (protocol == UAC_VERSION_1) ?
+               desc->baSourceID[desc->bNrInPins + 3] :
+               desc->baSourceID[desc->bNrInPins + 5];
+}
+
+static inline __u8 *uac_mixer_unit_bmControls(struct uac_mixer_unit_descriptor *desc,
+                                             int protocol)
+{
+       return (protocol == UAC_VERSION_1) ?
+               &desc->baSourceID[desc->bNrInPins + 4] :
+               &desc->baSourceID[desc->bNrInPins + 6];
+}
+
+static inline __u8 uac_mixer_unit_iMixer(struct uac_mixer_unit_descriptor *desc)
+{
+       __u8 *raw = (__u8 *) desc;
+       return raw[desc->bLength - 1];
+}
+
+/* 4.3.2.4 Selector Unit Descriptor */
+struct uac_selector_unit_descriptor {
+       __u8 bLength;
+       __u8 bDescriptorType;
+       __u8 bDescriptorSubtype;
+       __u8 bUintID;
+       __u8 bNrInPins;
+       __u8 baSourceID[];
+} __attribute__ ((packed));
+
+static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc)
+{
+       __u8 *raw = (__u8 *) desc;
+       return raw[desc->bLength - 1];
+}
+
+/* 4.3.2.5 Feature Unit Descriptor */
+struct uac_feature_unit_descriptor {
+       __u8 bLength;
+       __u8 bDescriptorType;
+       __u8 bDescriptorSubtype;
+       __u8 bUnitID;
+       __u8 bSourceID;
+       __u8 bControlSize;
+       __u8 bmaControls[0]; /* variable length */
+} __attribute__((packed));
+
+static inline __u8 uac_feature_unit_iFeature(struct uac_feature_unit_descriptor *desc)
+{
+       __u8 *raw = (__u8 *) desc;
+       return raw[desc->bLength - 1];
+}
+
+/* 4.3.2.6 Processing Unit Descriptors */
+struct uac_processing_unit_descriptor {
+       __u8 bLength;
+       __u8 bDescriptorType;
+       __u8 bDescriptorSubtype;
+       __u8 bUnitID;
+       __u16 wProcessType;
+       __u8 bNrInPins;
+       __u8 baSourceID[];
+} __attribute__ ((packed));
+
+static inline __u8 uac_processing_unit_bNrChannels(struct uac_processing_unit_descriptor *desc)
+{
+       return desc->baSourceID[desc->bNrInPins];
+}
+
+static inline __u32 uac_processing_unit_wChannelConfig(struct uac_processing_unit_descriptor *desc,
+                                                      int protocol)
+{
+       if (protocol == UAC_VERSION_1)
+               return (desc->baSourceID[desc->bNrInPins + 2] << 8) |
+                       desc->baSourceID[desc->bNrInPins + 1];
+       else
+               return  (desc->baSourceID[desc->bNrInPins + 4] << 24) |
+                       (desc->baSourceID[desc->bNrInPins + 3] << 16) |
+                       (desc->baSourceID[desc->bNrInPins + 2] << 8)  |
+                       (desc->baSourceID[desc->bNrInPins + 1]);
+}
+
+static inline __u8 uac_processing_unit_iChannelNames(struct uac_processing_unit_descriptor *desc,
+                                                    int protocol)
+{
+       return (protocol == UAC_VERSION_1) ?
+               desc->baSourceID[desc->bNrInPins + 3] :
+               desc->baSourceID[desc->bNrInPins + 5];
+}
+
+static inline __u8 uac_processing_unit_bControlSize(struct uac_processing_unit_descriptor *desc,
+                                                   int protocol)
+{
+       return (protocol == UAC_VERSION_1) ?
+               desc->baSourceID[desc->bNrInPins + 4] :
+               desc->baSourceID[desc->bNrInPins + 6];
+}
+
+static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc,
+                                                  int protocol)
+{
+       return (protocol == UAC_VERSION_1) ?
+               &desc->baSourceID[desc->bNrInPins + 5] :
+               &desc->baSourceID[desc->bNrInPins + 7];
+}
+
+static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc,
+                                                  int protocol)
+{
+       __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
+       return desc->baSourceID[desc->bNrInPins + control_size];
+}
+
+static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc,
+                                                int protocol)
+{
+       __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
+       return &desc->baSourceID[desc->bNrInPins + control_size + 1];
+}
+
+/* 4.5.2 Class-Specific AS Interface Descriptor */
+struct uac1_as_header_descriptor {
+       __u8  bLength;                  /* in bytes: 7 */
+       __u8  bDescriptorType;          /* USB_DT_CS_INTERFACE */
+       __u8  bDescriptorSubtype;       /* AS_GENERAL */
+       __u8  bTerminalLink;            /* Terminal ID of connected Terminal */
+       __u8  bDelay;                   /* Delay introduced by the data path */
+       __le16 wFormatTag;              /* The Audio Data Format */
+} __attribute__ ((packed));
+
+#define UAC_DT_AS_HEADER_SIZE          7
+
+/* Formats - A.1.1 Audio Data Format Type I Codes */
+#define UAC_FORMAT_TYPE_I_UNDEFINED    0x0
+#define UAC_FORMAT_TYPE_I_PCM          0x1
+#define UAC_FORMAT_TYPE_I_PCM8         0x2
+#define UAC_FORMAT_TYPE_I_IEEE_FLOAT   0x3
+#define UAC_FORMAT_TYPE_I_ALAW         0x4
+#define UAC_FORMAT_TYPE_I_MULAW                0x5
+
+struct uac_format_type_i_continuous_descriptor {
+       __u8  bLength;                  /* in bytes: 8 + (ns * 3) */
+       __u8  bDescriptorType;          /* USB_DT_CS_INTERFACE */
+       __u8  bDescriptorSubtype;       /* FORMAT_TYPE */
+       __u8  bFormatType;              /* FORMAT_TYPE_1 */
+       __u8  bNrChannels;              /* physical channels in the stream */
+       __u8  bSubframeSize;            /* */
+       __u8  bBitResolution;
+       __u8  bSamFreqType;
+       __u8  tLowerSamFreq[3];
+       __u8  tUpperSamFreq[3];
+} __attribute__ ((packed));
+
+#define UAC_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14
+
+struct uac_format_type_i_discrete_descriptor {
+       __u8  bLength;                  /* in bytes: 8 + (ns * 3) */
+       __u8  bDescriptorType;          /* USB_DT_CS_INTERFACE */
+       __u8  bDescriptorSubtype;       /* FORMAT_TYPE */
+       __u8  bFormatType;              /* FORMAT_TYPE_1 */
+       __u8  bNrChannels;              /* physical channels in the stream */
+       __u8  bSubframeSize;            /* */
+       __u8  bBitResolution;
+       __u8  bSamFreqType;
+       __u8  tSamFreq[][3];
+} __attribute__ ((packed));
+
+#define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n)             \
+struct uac_format_type_i_discrete_descriptor_##n {             \
+       __u8  bLength;                                          \
+       __u8  bDescriptorType;                                  \
+       __u8  bDescriptorSubtype;                               \
+       __u8  bFormatType;                                      \
+       __u8  bNrChannels;                                      \
+       __u8  bSubframeSize;                                    \
+       __u8  bBitResolution;                                   \
+       __u8  bSamFreqType;                                     \
+       __u8  tSamFreq[n][3];                                   \
+} __attribute__ ((packed))
+
+#define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n)        (8 + (n * 3))
+
+struct uac_format_type_i_ext_descriptor {
+       __u8 bLength;
+       __u8 bDescriptorType;
+       __u8 bDescriptorSubtype;
+       __u8 bFormatType;
+       __u8 bSubslotSize;
+       __u8 bBitResolution;
+       __u8 bHeaderLength;
+       __u8 bControlSize;
+       __u8 bSideBandProtocol;
+} __attribute__((packed));
+
+/* Formats - Audio Data Format Type I Codes */
+
+#define UAC_FORMAT_TYPE_II_MPEG        0x1001
+#define UAC_FORMAT_TYPE_II_AC3 0x1002
+
+struct uac_format_type_ii_discrete_descriptor {
+       __u8 bLength;
+       __u8 bDescriptorType;
+       __u8 bDescriptorSubtype;
+       __u8 bFormatType;
+       __le16 wMaxBitRate;
+       __le16 wSamplesPerFrame;
+       __u8 bSamFreqType;
+       __u8 tSamFreq[][3];
+} __attribute__((packed));
+
+struct uac_format_type_ii_ext_descriptor {
+       __u8 bLength;
+       __u8 bDescriptorType;
+       __u8 bDescriptorSubtype;
+       __u8 bFormatType;
+       __u16 wMaxBitRate;
+       __u16 wSamplesPerFrame;
+       __u8 bHeaderLength;
+       __u8 bSideBandProtocol;
+} __attribute__((packed));
+
+/* type III */
+#define UAC_FORMAT_TYPE_III_IEC1937_AC3        0x2001
+#define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1       0x2002
+#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT        0x2003
+#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT  0x2004
+#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS    0x2005
+#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS   0x2006
+
+/* Formats - A.2 Format Type Codes */
+#define UAC_FORMAT_TYPE_UNDEFINED      0x0
+#define UAC_FORMAT_TYPE_I              0x1
+#define UAC_FORMAT_TYPE_II             0x2
+#define UAC_FORMAT_TYPE_III            0x3
+#define UAC_EXT_FORMAT_TYPE_I          0x81
+#define UAC_EXT_FORMAT_TYPE_II         0x82
+#define UAC_EXT_FORMAT_TYPE_III                0x83
+
+struct uac_iso_endpoint_descriptor {
+       __u8  bLength;                  /* in bytes: 7 */
+       __u8  bDescriptorType;          /* USB_DT_CS_ENDPOINT */
+       __u8  bDescriptorSubtype;       /* EP_GENERAL */
+       __u8  bmAttributes;
+       __u8  bLockDelayUnits;
+       __le16 wLockDelay;
+} __attribute__((packed));
+#define UAC_ISO_ENDPOINT_DESC_SIZE     7
+
+#define UAC_EP_CS_ATTR_SAMPLE_RATE     0x01
+#define UAC_EP_CS_ATTR_PITCH_CONTROL   0x02
+#define UAC_EP_CS_ATTR_FILL_MAX                0x80
+
+/* status word format (3.7.1.1) */
+
+#define UAC1_STATUS_TYPE_ORIG_MASK             0x0f
+#define UAC1_STATUS_TYPE_ORIG_AUDIO_CONTROL_IF 0x0
+#define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_IF  0x1
+#define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_EP  0x2
+
+#define UAC1_STATUS_TYPE_IRQ_PENDING           (1 << 7)
+#define UAC1_STATUS_TYPE_MEM_CHANGED           (1 << 6)
+
+struct uac1_status_word {
+       __u8 bStatusType;
+       __u8 bOriginator;
+} __attribute__((packed));
+
+
+#endif /* _UAPI__LINUX_USB_AUDIO_H */
diff --git a/include/uapi/linux/usb/cdc.h b/include/uapi/linux/usb/cdc.h
new file mode 100644 (file)
index 0000000..81a9279
--- /dev/null
@@ -0,0 +1,412 @@
+/*
+ * USB Communications Device Class (CDC) definitions
+ *
+ * CDC says how to talk to lots of different types of network adapters,
+ * notably ethernet adapters and various modems.  It's used mostly with
+ * firmware based USB peripherals.
+ */
+
+#ifndef __LINUX_USB_CDC_H
+#define __LINUX_USB_CDC_H
+
+#include <linux/types.h>
+
+#define USB_CDC_SUBCLASS_ACM                   0x02
+#define USB_CDC_SUBCLASS_ETHERNET              0x06
+#define USB_CDC_SUBCLASS_WHCM                  0x08
+#define USB_CDC_SUBCLASS_DMM                   0x09
+#define USB_CDC_SUBCLASS_MDLM                  0x0a
+#define USB_CDC_SUBCLASS_OBEX                  0x0b
+#define USB_CDC_SUBCLASS_EEM                   0x0c
+#define USB_CDC_SUBCLASS_NCM                   0x0d
+
+#define USB_CDC_PROTO_NONE                     0
+
+#define USB_CDC_ACM_PROTO_AT_V25TER            1
+#define USB_CDC_ACM_PROTO_AT_PCCA101           2
+#define USB_CDC_ACM_PROTO_AT_PCCA101_WAKE      3
+#define USB_CDC_ACM_PROTO_AT_GSM               4
+#define USB_CDC_ACM_PROTO_AT_3G                        5
+#define USB_CDC_ACM_PROTO_AT_CDMA              6
+#define USB_CDC_ACM_PROTO_VENDOR               0xff
+
+#define USB_CDC_PROTO_EEM                      7
+
+#define USB_CDC_NCM_PROTO_NTB                  1
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * Class-Specific descriptors ... there are a couple dozen of them
+ */
+
+#define USB_CDC_HEADER_TYPE            0x00    /* header_desc */
+#define USB_CDC_CALL_MANAGEMENT_TYPE   0x01    /* call_mgmt_descriptor */
+#define USB_CDC_ACM_TYPE               0x02    /* acm_descriptor */
+#define USB_CDC_UNION_TYPE             0x06    /* union_desc */
+#define USB_CDC_COUNTRY_TYPE           0x07
+#define USB_CDC_NETWORK_TERMINAL_TYPE  0x0a    /* network_terminal_desc */
+#define USB_CDC_ETHERNET_TYPE          0x0f    /* ether_desc */
+#define USB_CDC_WHCM_TYPE              0x11
+#define USB_CDC_MDLM_TYPE              0x12    /* mdlm_desc */
+#define USB_CDC_MDLM_DETAIL_TYPE       0x13    /* mdlm_detail_desc */
+#define USB_CDC_DMM_TYPE               0x14
+#define USB_CDC_OBEX_TYPE              0x15
+#define USB_CDC_NCM_TYPE               0x1a
+
+/* "Header Functional Descriptor" from CDC spec  5.2.3.1 */
+struct usb_cdc_header_desc {
+       __u8    bLength;
+       __u8    bDescriptorType;
+       __u8    bDescriptorSubType;
+
+       __le16  bcdCDC;
+} __attribute__ ((packed));
+
+/* "Call Management Descriptor" from CDC spec  5.2.3.2 */
+struct usb_cdc_call_mgmt_descriptor {
+       __u8    bLength;
+       __u8    bDescriptorType;
+       __u8    bDescriptorSubType;
+
+       __u8    bmCapabilities;
+#define USB_CDC_CALL_MGMT_CAP_CALL_MGMT                0x01
+#define USB_CDC_CALL_MGMT_CAP_DATA_INTF                0x02
+
+       __u8    bDataInterface;
+} __attribute__ ((packed));
+
+/* "Abstract Control Management Descriptor" from CDC spec  5.2.3.3 */
+struct usb_cdc_acm_descriptor {
+       __u8    bLength;
+       __u8    bDescriptorType;
+       __u8    bDescriptorSubType;
+
+       __u8    bmCapabilities;
+} __attribute__ ((packed));
+
+/* capabilities from 5.2.3.3 */
+
+#define USB_CDC_COMM_FEATURE   0x01
+#define USB_CDC_CAP_LINE       0x02
+#define USB_CDC_CAP_BRK                0x04
+#define USB_CDC_CAP_NOTIFY     0x08
+
+/* "Union Functional Descriptor" from CDC spec 5.2.3.8 */
+struct usb_cdc_union_desc {
+       __u8    bLength;
+       __u8    bDescriptorType;
+       __u8    bDescriptorSubType;
+
+       __u8    bMasterInterface0;
+       __u8    bSlaveInterface0;
+       /* ... and there could be other slave interfaces */
+} __attribute__ ((packed));
+
+/* "Country Selection Functional Descriptor" from CDC spec 5.2.3.9 */
+struct usb_cdc_country_functional_desc {
+       __u8    bLength;
+       __u8    bDescriptorType;
+       __u8    bDescriptorSubType;
+
+       __u8    iCountryCodeRelDate;
+       __le16  wCountyCode0;
+       /* ... and there can be a lot of country codes */
+} __attribute__ ((packed));
+
+/* "Network Channel Terminal Functional Descriptor" from CDC spec 5.2.3.11 */
+struct usb_cdc_network_terminal_desc {
+       __u8    bLength;
+       __u8    bDescriptorType;
+       __u8    bDescriptorSubType;
+
+       __u8    bEntityId;
+       __u8    iName;
+       __u8    bChannelIndex;
+       __u8    bPhysicalInterface;
+} __attribute__ ((packed));
+
+/* "Ethernet Networking Functional Descriptor" from CDC spec 5.2.3.16 */
+struct usb_cdc_ether_desc {
+       __u8    bLength;
+       __u8    bDescriptorType;
+       __u8    bDescriptorSubType;
+
+       __u8    iMACAddress;
+       __le32  bmEthernetStatistics;
+       __le16  wMaxSegmentSize;
+       __le16  wNumberMCFilters;
+       __u8    bNumberPowerFilters;
+} __attribute__ ((packed));
+
+/* "Telephone Control Model Functional Descriptor" from CDC WMC spec 6.3..3 */
+struct usb_cdc_dmm_desc {
+       __u8    bFunctionLength;
+       __u8    bDescriptorType;
+       __u8    bDescriptorSubtype;
+       __u16   bcdVersion;
+       __le16  wMaxCommand;
+} __attribute__ ((packed));
+
+/* "MDLM Functional Descriptor" from CDC WMC spec 6.7.2.3 */
+struct usb_cdc_mdlm_desc {
+       __u8    bLength;
+       __u8    bDescriptorType;
+       __u8    bDescriptorSubType;
+
+       __le16  bcdVersion;
+       __u8    bGUID[16];
+} __attribute__ ((packed));
+
+/* "MDLM Detail Functional Descriptor" from CDC WMC spec 6.7.2.4 */
+struct usb_cdc_mdlm_detail_desc {
+       __u8    bLength;
+       __u8    bDescriptorType;
+       __u8    bDescriptorSubType;
+
+       /* type is associated with mdlm_desc.bGUID */
+       __u8    bGuidDescriptorType;
+       __u8    bDetailData[0];
+} __attribute__ ((packed));
+
+/* "OBEX Control Model Functional Descriptor" */
+struct usb_cdc_obex_desc {
+       __u8    bLength;
+       __u8    bDescriptorType;
+       __u8    bDescriptorSubType;
+
+       __le16  bcdVersion;
+} __attribute__ ((packed));
+
+/* "NCM Control Model Functional Descriptor" */
+struct usb_cdc_ncm_desc {
+       __u8    bLength;
+       __u8    bDescriptorType;
+       __u8    bDescriptorSubType;
+
+       __le16  bcdNcmVersion;
+       __u8    bmNetworkCapabilities;
+} __attribute__ ((packed));
+/*-------------------------------------------------------------------------*/
+
+/*
+ * Class-Specific Control Requests (6.2)
+ *
+ * section 3.6.2.1 table 4 has the ACM profile, for modems.
+ * section 3.8.2 table 10 has the ethernet profile.
+ *
+ * Microsoft's RNDIS stack for Ethernet is a vendor-specific CDC ACM variant,
+ * heavily dependent on the encapsulated (proprietary) command mechanism.
+ */
+
+#define USB_CDC_SEND_ENCAPSULATED_COMMAND      0x00
+#define USB_CDC_GET_ENCAPSULATED_RESPONSE      0x01
+#define USB_CDC_REQ_SET_LINE_CODING            0x20
+#define USB_CDC_REQ_GET_LINE_CODING            0x21
+#define USB_CDC_REQ_SET_CONTROL_LINE_STATE     0x22
+#define USB_CDC_REQ_SEND_BREAK                 0x23
+#define USB_CDC_SET_ETHERNET_MULTICAST_FILTERS 0x40
+#define USB_CDC_SET_ETHERNET_PM_PATTERN_FILTER 0x41
+#define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42
+#define USB_CDC_SET_ETHERNET_PACKET_FILTER     0x43
+#define USB_CDC_GET_ETHERNET_STATISTIC         0x44
+#define USB_CDC_GET_NTB_PARAMETERS             0x80
+#define USB_CDC_GET_NET_ADDRESS                        0x81
+#define USB_CDC_SET_NET_ADDRESS                        0x82
+#define USB_CDC_GET_NTB_FORMAT                 0x83
+#define USB_CDC_SET_NTB_FORMAT                 0x84
+#define USB_CDC_GET_NTB_INPUT_SIZE             0x85
+#define USB_CDC_SET_NTB_INPUT_SIZE             0x86
+#define USB_CDC_GET_MAX_DATAGRAM_SIZE          0x87
+#define USB_CDC_SET_MAX_DATAGRAM_SIZE          0x88
+#define USB_CDC_GET_CRC_MODE                   0x89
+#define USB_CDC_SET_CRC_MODE                   0x8a
+
+/* Line Coding Structure from CDC spec 6.2.13 */
+struct usb_cdc_line_coding {
+       __le32  dwDTERate;
+       __u8    bCharFormat;
+#define USB_CDC_1_STOP_BITS                    0
+#define USB_CDC_1_5_STOP_BITS                  1
+#define USB_CDC_2_STOP_BITS                    2
+
+       __u8    bParityType;
+#define USB_CDC_NO_PARITY                      0
+#define USB_CDC_ODD_PARITY                     1
+#define USB_CDC_EVEN_PARITY                    2
+#define USB_CDC_MARK_PARITY                    3
+#define USB_CDC_SPACE_PARITY                   4
+
+       __u8    bDataBits;
+} __attribute__ ((packed));
+
+/* table 62; bits in multicast filter */
+#define        USB_CDC_PACKET_TYPE_PROMISCUOUS         (1 << 0)
+#define        USB_CDC_PACKET_TYPE_ALL_MULTICAST       (1 << 1) /* no filter */
+#define        USB_CDC_PACKET_TYPE_DIRECTED            (1 << 2)
+#define        USB_CDC_PACKET_TYPE_BROADCAST           (1 << 3)
+#define        USB_CDC_PACKET_TYPE_MULTICAST           (1 << 4) /* filtered */
+
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * Class-Specific Notifications (6.3) sent by interrupt transfers
+ *
+ * section 3.8.2 table 11 of the CDC spec lists Ethernet notifications
+ * section 3.6.2.1 table 5 specifies ACM notifications, accepted by RNDIS
+ * RNDIS also defines its own bit-incompatible notifications
+ */
+
+#define USB_CDC_NOTIFY_NETWORK_CONNECTION      0x00
+#define USB_CDC_NOTIFY_RESPONSE_AVAILABLE      0x01
+#define USB_CDC_NOTIFY_SERIAL_STATE            0x20
+#define USB_CDC_NOTIFY_SPEED_CHANGE            0x2a
+
+struct usb_cdc_notification {
+       __u8    bmRequestType;
+       __u8    bNotificationType;
+       __le16  wValue;
+       __le16  wIndex;
+       __le16  wLength;
+} __attribute__ ((packed));
+
+struct usb_cdc_speed_change {
+       __le32  DLBitRRate;     /* contains the downlink bit rate (IN pipe) */
+       __le32  ULBitRate;      /* contains the uplink bit rate (OUT pipe) */
+} __attribute__ ((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * Class Specific structures and constants
+ *
+ * CDC NCM NTB parameters structure, CDC NCM subclass 6.2.1
+ *
+ */
+
+struct usb_cdc_ncm_ntb_parameters {
+       __le16  wLength;
+       __le16  bmNtbFormatsSupported;
+       __le32  dwNtbInMaxSize;
+       __le16  wNdpInDivisor;
+       __le16  wNdpInPayloadRemainder;
+       __le16  wNdpInAlignment;
+       __le16  wPadding1;
+       __le32  dwNtbOutMaxSize;
+       __le16  wNdpOutDivisor;
+       __le16  wNdpOutPayloadRemainder;
+       __le16  wNdpOutAlignment;
+       __le16  wNtbOutMaxDatagrams;
+} __attribute__ ((packed));
+
+/*
+ * CDC NCM transfer headers, CDC NCM subclass 3.2
+ */
+
+#define USB_CDC_NCM_NTH16_SIGN         0x484D434E /* NCMH */
+#define USB_CDC_NCM_NTH32_SIGN         0x686D636E /* ncmh */
+
+struct usb_cdc_ncm_nth16 {
+       __le32  dwSignature;
+       __le16  wHeaderLength;
+       __le16  wSequence;
+       __le16  wBlockLength;
+       __le16  wNdpIndex;
+} __attribute__ ((packed));
+
+struct usb_cdc_ncm_nth32 {
+       __le32  dwSignature;
+       __le16  wHeaderLength;
+       __le16  wSequence;
+       __le32  dwBlockLength;
+       __le32  dwNdpIndex;
+} __attribute__ ((packed));
+
+/*
+ * CDC NCM datagram pointers, CDC NCM subclass 3.3
+ */
+
+#define USB_CDC_NCM_NDP16_CRC_SIGN     0x314D434E /* NCM1 */
+#define USB_CDC_NCM_NDP16_NOCRC_SIGN   0x304D434E /* NCM0 */
+#define USB_CDC_NCM_NDP32_CRC_SIGN     0x316D636E /* ncm1 */
+#define USB_CDC_NCM_NDP32_NOCRC_SIGN   0x306D636E /* ncm0 */
+
+/* 16-bit NCM Datagram Pointer Entry */
+struct usb_cdc_ncm_dpe16 {
+       __le16  wDatagramIndex;
+       __le16  wDatagramLength;
+} __attribute__((__packed__));
+
+/* 16-bit NCM Datagram Pointer Table */
+struct usb_cdc_ncm_ndp16 {
+       __le32  dwSignature;
+       __le16  wLength;
+       __le16  wNextNdpIndex;
+       struct  usb_cdc_ncm_dpe16 dpe16[0];
+} __attribute__ ((packed));
+
+/* 32-bit NCM Datagram Pointer Entry */
+struct usb_cdc_ncm_dpe32 {
+       __le32  dwDatagramIndex;
+       __le32  dwDatagramLength;
+} __attribute__((__packed__));
+
+/* 32-bit NCM Datagram Pointer Table */
+struct usb_cdc_ncm_ndp32 {
+       __le32  dwSignature;
+       __le16  wLength;
+       __le16  wReserved6;
+       __le32  dwNextNdpIndex;
+       __le32  dwReserved12;
+       struct  usb_cdc_ncm_dpe32 dpe32[0];
+} __attribute__ ((packed));
+
+/* CDC NCM subclass 3.2.1 and 3.2.2 */
+#define USB_CDC_NCM_NDP16_INDEX_MIN                    0x000C
+#define USB_CDC_NCM_NDP32_INDEX_MIN                    0x0010
+
+/* CDC NCM subclass 3.3.3 Datagram Formatting */
+#define USB_CDC_NCM_DATAGRAM_FORMAT_CRC                        0x30
+#define USB_CDC_NCM_DATAGRAM_FORMAT_NOCRC              0X31
+
+/* CDC NCM subclass 4.2 NCM Communications Interface Protocol Code */
+#define USB_CDC_NCM_PROTO_CODE_NO_ENCAP_COMMANDS       0x00
+#define USB_CDC_NCM_PROTO_CODE_EXTERN_PROTO            0xFE
+
+/* CDC NCM subclass 5.2.1 NCM Functional Descriptor, bmNetworkCapabilities */
+#define USB_CDC_NCM_NCAP_ETH_FILTER                    (1 << 0)
+#define USB_CDC_NCM_NCAP_NET_ADDRESS                   (1 << 1)
+#define USB_CDC_NCM_NCAP_ENCAP_COMMAND                 (1 << 2)
+#define USB_CDC_NCM_NCAP_MAX_DATAGRAM_SIZE             (1 << 3)
+#define USB_CDC_NCM_NCAP_CRC_MODE                      (1 << 4)
+#define        USB_CDC_NCM_NCAP_NTB_INPUT_SIZE                 (1 << 5)
+
+/* CDC NCM subclass Table 6-3: NTB Parameter Structure */
+#define USB_CDC_NCM_NTB16_SUPPORTED                    (1 << 0)
+#define USB_CDC_NCM_NTB32_SUPPORTED                    (1 << 1)
+
+/* CDC NCM subclass Table 6-3: NTB Parameter Structure */
+#define USB_CDC_NCM_NDP_ALIGN_MIN_SIZE                 0x04
+#define USB_CDC_NCM_NTB_MAX_LENGTH                     0x1C
+
+/* CDC NCM subclass 6.2.5 SetNtbFormat */
+#define USB_CDC_NCM_NTB16_FORMAT                       0x00
+#define USB_CDC_NCM_NTB32_FORMAT                       0x01
+
+/* CDC NCM subclass 6.2.7 SetNtbInputSize */
+#define USB_CDC_NCM_NTB_MIN_IN_SIZE                    2048
+#define USB_CDC_NCM_NTB_MIN_OUT_SIZE                   2048
+
+/* NTB Input Size Structure */
+struct usb_cdc_ncm_ndp_input_size {
+       __le32  dwNtbInMaxSize;
+       __le16  wNtbInMaxDatagrams;
+       __le16  wReserved;
+} __attribute__ ((packed));
+
+/* CDC NCM subclass 6.2.11 SetCrcMode */
+#define USB_CDC_NCM_CRC_NOT_APPENDED                   0x00
+#define USB_CDC_NCM_CRC_APPENDED                       0x01
+
+#endif /* __LINUX_USB_CDC_H */
diff --git a/include/uapi/linux/usb/ch11.h b/include/uapi/linux/usb/ch11.h
new file mode 100644 (file)
index 0000000..7692dc6
--- /dev/null
@@ -0,0 +1,266 @@
+/*
+ * This file holds Hub protocol constants and data structures that are
+ * defined in chapter 11 (Hub Specification) of the USB 2.0 specification.
+ *
+ * It is used/shared between the USB core, the HCDs and couple of other USB
+ * drivers.
+ */
+
+#ifndef __LINUX_CH11_H
+#define __LINUX_CH11_H
+
+#include <linux/types.h>       /* __u8 etc */
+
+/*
+ * Hub request types
+ */
+
+#define USB_RT_HUB     (USB_TYPE_CLASS | USB_RECIP_DEVICE)
+#define USB_RT_PORT    (USB_TYPE_CLASS | USB_RECIP_OTHER)
+
+/*
+ * Hub class requests
+ * See USB 2.0 spec Table 11-16
+ */
+#define HUB_CLEAR_TT_BUFFER    8
+#define HUB_RESET_TT           9
+#define HUB_GET_TT_STATE       10
+#define HUB_STOP_TT            11
+
+/*
+ * Hub class additional requests defined by USB 3.0 spec
+ * See USB 3.0 spec Table 10-6
+ */
+#define HUB_SET_DEPTH          12
+#define HUB_GET_PORT_ERR_COUNT 13
+
+/*
+ * Hub Class feature numbers
+ * See USB 2.0 spec Table 11-17
+ */
+#define C_HUB_LOCAL_POWER      0
+#define C_HUB_OVER_CURRENT     1
+
+/*
+ * Port feature numbers
+ * See USB 2.0 spec Table 11-17
+ */
+#define USB_PORT_FEAT_CONNECTION       0
+#define USB_PORT_FEAT_ENABLE           1
+#define USB_PORT_FEAT_SUSPEND          2       /* L2 suspend */
+#define USB_PORT_FEAT_OVER_CURRENT     3
+#define USB_PORT_FEAT_RESET            4
+#define USB_PORT_FEAT_L1               5       /* L1 suspend */
+#define USB_PORT_FEAT_POWER            8
+#define USB_PORT_FEAT_LOWSPEED         9       /* Should never be used */
+#define USB_PORT_FEAT_C_CONNECTION     16
+#define USB_PORT_FEAT_C_ENABLE         17
+#define USB_PORT_FEAT_C_SUSPEND                18
+#define USB_PORT_FEAT_C_OVER_CURRENT   19
+#define USB_PORT_FEAT_C_RESET          20
+#define USB_PORT_FEAT_TEST              21
+#define USB_PORT_FEAT_INDICATOR         22
+#define USB_PORT_FEAT_C_PORT_L1         23
+
+/*
+ * Port feature selectors added by USB 3.0 spec.
+ * See USB 3.0 spec Table 10-7
+ */
+#define USB_PORT_FEAT_LINK_STATE               5
+#define USB_PORT_FEAT_U1_TIMEOUT               23
+#define USB_PORT_FEAT_U2_TIMEOUT               24
+#define USB_PORT_FEAT_C_PORT_LINK_STATE                25
+#define USB_PORT_FEAT_C_PORT_CONFIG_ERROR      26
+#define USB_PORT_FEAT_REMOTE_WAKE_MASK         27
+#define USB_PORT_FEAT_BH_PORT_RESET            28
+#define USB_PORT_FEAT_C_BH_PORT_RESET          29
+#define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT      30
+
+#define USB_PORT_LPM_TIMEOUT(p)                        (((p) & 0xff) << 8)
+
+/* USB 3.0 hub remote wake mask bits, see table 10-14 */
+#define USB_PORT_FEAT_REMOTE_WAKE_CONNECT      (1 << 8)
+#define USB_PORT_FEAT_REMOTE_WAKE_DISCONNECT   (1 << 9)
+#define USB_PORT_FEAT_REMOTE_WAKE_OVER_CURRENT (1 << 10)
+
+/*
+ * Hub Status and Hub Change results
+ * See USB 2.0 spec Table 11-19 and Table 11-20
+ */
+struct usb_port_status {
+       __le16 wPortStatus;
+       __le16 wPortChange;
+} __attribute__ ((packed));
+
+/*
+ * wPortStatus bit field
+ * See USB 2.0 spec Table 11-21
+ */
+#define USB_PORT_STAT_CONNECTION       0x0001
+#define USB_PORT_STAT_ENABLE           0x0002
+#define USB_PORT_STAT_SUSPEND          0x0004
+#define USB_PORT_STAT_OVERCURRENT      0x0008
+#define USB_PORT_STAT_RESET            0x0010
+#define USB_PORT_STAT_L1               0x0020
+/* bits 6 to 7 are reserved */
+#define USB_PORT_STAT_POWER            0x0100
+#define USB_PORT_STAT_LOW_SPEED                0x0200
+#define USB_PORT_STAT_HIGH_SPEED        0x0400
+#define USB_PORT_STAT_TEST              0x0800
+#define USB_PORT_STAT_INDICATOR         0x1000
+/* bits 13 to 15 are reserved */
+
+/*
+ * Additions to wPortStatus bit field from USB 3.0
+ * See USB 3.0 spec Table 10-10
+ */
+#define USB_PORT_STAT_LINK_STATE       0x01e0
+#define USB_SS_PORT_STAT_POWER         0x0200
+#define USB_SS_PORT_STAT_SPEED         0x1c00
+#define USB_PORT_STAT_SPEED_5GBPS      0x0000
+/* Valid only if port is enabled */
+/* Bits that are the same from USB 2.0 */
+#define USB_SS_PORT_STAT_MASK (USB_PORT_STAT_CONNECTION |          \
+                               USB_PORT_STAT_ENABLE |      \
+                               USB_PORT_STAT_OVERCURRENT | \
+                               USB_PORT_STAT_RESET)
+
+/*
+ * Definitions for PORT_LINK_STATE values
+ * (bits 5-8) in wPortStatus
+ */
+#define USB_SS_PORT_LS_U0              0x0000
+#define USB_SS_PORT_LS_U1              0x0020
+#define USB_SS_PORT_LS_U2              0x0040
+#define USB_SS_PORT_LS_U3              0x0060
+#define USB_SS_PORT_LS_SS_DISABLED     0x0080
+#define USB_SS_PORT_LS_RX_DETECT       0x00a0
+#define USB_SS_PORT_LS_SS_INACTIVE     0x00c0
+#define USB_SS_PORT_LS_POLLING         0x00e0
+#define USB_SS_PORT_LS_RECOVERY                0x0100
+#define USB_SS_PORT_LS_HOT_RESET       0x0120
+#define USB_SS_PORT_LS_COMP_MOD                0x0140
+#define USB_SS_PORT_LS_LOOPBACK                0x0160
+
+/*
+ * wPortChange bit field
+ * See USB 2.0 spec Table 11-22 and USB 2.0 LPM ECN Table-4.10
+ * Bits 0 to 5 shown, bits 6 to 15 are reserved
+ */
+#define USB_PORT_STAT_C_CONNECTION     0x0001
+#define USB_PORT_STAT_C_ENABLE         0x0002
+#define USB_PORT_STAT_C_SUSPEND                0x0004
+#define USB_PORT_STAT_C_OVERCURRENT    0x0008
+#define USB_PORT_STAT_C_RESET          0x0010
+#define USB_PORT_STAT_C_L1             0x0020
+/*
+ * USB 3.0 wPortChange bit fields
+ * See USB 3.0 spec Table 10-11
+ */
+#define USB_PORT_STAT_C_BH_RESET       0x0020
+#define USB_PORT_STAT_C_LINK_STATE     0x0040
+#define USB_PORT_STAT_C_CONFIG_ERROR   0x0080
+
+/*
+ * wHubCharacteristics (masks)
+ * See USB 2.0 spec Table 11-13, offset 3
+ */
+#define HUB_CHAR_LPSM          0x0003 /* Logical Power Switching Mode mask */
+#define HUB_CHAR_COMMON_LPSM   0x0000 /* All ports power control at once */
+#define HUB_CHAR_INDV_PORT_LPSM        0x0001 /* per-port power control */
+#define HUB_CHAR_NO_LPSM       0x0002 /* no power switching */
+
+#define HUB_CHAR_COMPOUND      0x0004 /* hub is part of a compound device */
+
+#define HUB_CHAR_OCPM          0x0018 /* Over-Current Protection Mode mask */
+#define HUB_CHAR_COMMON_OCPM   0x0000 /* All ports Over-Current reporting */
+#define HUB_CHAR_INDV_PORT_OCPM        0x0008 /* per-port Over-current reporting */
+#define HUB_CHAR_NO_OCPM       0x0010 /* No Over-current Protection support */
+
+#define HUB_CHAR_TTTT          0x0060 /* TT Think Time mask */
+#define HUB_CHAR_PORTIND       0x0080 /* per-port indicators (LEDs) */
+
+struct usb_hub_status {
+       __le16 wHubStatus;
+       __le16 wHubChange;
+} __attribute__ ((packed));
+
+/*
+ * Hub Status & Hub Change bit masks
+ * See USB 2.0 spec Table 11-19 and Table 11-20
+ * Bits 0 and 1 for wHubStatus and wHubChange
+ * Bits 2 to 15 are reserved for both
+ */
+#define HUB_STATUS_LOCAL_POWER 0x0001
+#define HUB_STATUS_OVERCURRENT 0x0002
+#define HUB_CHANGE_LOCAL_POWER 0x0001
+#define HUB_CHANGE_OVERCURRENT 0x0002
+
+
+/*
+ * Hub descriptor
+ * See USB 2.0 spec Table 11-13
+ */
+
+#define USB_DT_HUB                     (USB_TYPE_CLASS | 0x09)
+#define USB_DT_SS_HUB                  (USB_TYPE_CLASS | 0x0a)
+#define USB_DT_HUB_NONVAR_SIZE         7
+#define USB_DT_SS_HUB_SIZE              12
+
+/*
+ * Hub Device descriptor
+ * USB Hub class device protocols
+ */
+
+#define USB_HUB_PR_FS          0 /* Full speed hub */
+#define USB_HUB_PR_HS_NO_TT    0 /* Hi-speed hub without TT */
+#define USB_HUB_PR_HS_SINGLE_TT        1 /* Hi-speed hub with single TT */
+#define USB_HUB_PR_HS_MULTI_TT 2 /* Hi-speed hub with multiple TT */
+#define USB_HUB_PR_SS          3 /* Super speed hub */
+
+struct usb_hub_descriptor {
+       __u8  bDescLength;
+       __u8  bDescriptorType;
+       __u8  bNbrPorts;
+       __le16 wHubCharacteristics;
+       __u8  bPwrOn2PwrGood;
+       __u8  bHubContrCurrent;
+
+       /* 2.0 and 3.0 hubs differ here */
+       union {
+               struct {
+                       /* add 1 bit for hub status change; round to bytes */
+                       __u8  DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8];
+                       __u8  PortPwrCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8];
+               }  __attribute__ ((packed)) hs;
+
+               struct {
+                       __u8 bHubHdrDecLat;
+                       __le16 wHubDelay;
+                       __le16 DeviceRemovable;
+               }  __attribute__ ((packed)) ss;
+       } u;
+} __attribute__ ((packed));
+
+/* port indicator status selectors, tables 11-7 and 11-25 */
+#define HUB_LED_AUTO   0
+#define HUB_LED_AMBER  1
+#define HUB_LED_GREEN  2
+#define HUB_LED_OFF    3
+
+enum hub_led_mode {
+       INDICATOR_AUTO = 0,
+       INDICATOR_CYCLE,
+       /* software blinks for attention:  software, hardware, reserved */
+       INDICATOR_GREEN_BLINK, INDICATOR_GREEN_BLINK_OFF,
+       INDICATOR_AMBER_BLINK, INDICATOR_AMBER_BLINK_OFF,
+       INDICATOR_ALT_BLINK, INDICATOR_ALT_BLINK_OFF
+} __attribute__ ((packed));
+
+/* Transaction Translator Think Times, in bits */
+#define HUB_TTTT_8_BITS                0x00
+#define HUB_TTTT_16_BITS       0x20
+#define HUB_TTTT_24_BITS       0x40
+#define HUB_TTTT_32_BITS       0x60
+
+#endif /* __LINUX_CH11_H */
diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h
new file mode 100644 (file)
index 0000000..5059847
--- /dev/null
@@ -0,0 +1,993 @@
+/*
+ * This file holds USB constants and structures that are needed for
+ * USB device APIs.  These are used by the USB device model, which is
+ * defined in chapter 9 of the USB 2.0 specification and in the
+ * Wireless USB 1.0 (spread around).  Linux has several APIs in C that
+ * need these:
+ *
+ * - the master/host side Linux-USB kernel driver API;
+ * - the "usbfs" user space API; and
+ * - the Linux "gadget" slave/device/peripheral side driver API.
+ *
+ * USB 2.0 adds an additional "On The Go" (OTG) mode, which lets systems
+ * act either as a USB master/host or as a USB slave/device.  That means
+ * the master and slave side APIs benefit from working well together.
+ *
+ * There's also "Wireless USB", using low power short range radios for
+ * peripheral interconnection but otherwise building on the USB framework.
+ *
+ * Note all descriptors are declared '__attribute__((packed))' so that:
+ *
+ * [a] they never get padded, either internally (USB spec writers
+ *     probably handled that) or externally;
+ *
+ * [b] so that accessing bigger-than-a-bytes fields will never
+ *     generate bus errors on any platform, even when the location of
+ *     its descriptor inside a bundle isn't "naturally aligned", and
+ *
+ * [c] for consistency, removing all doubt even when it appears to
+ *     someone that the two other points are non-issues for that
+ *     particular descriptor type.
+ */
+
+#ifndef _UAPI__LINUX_USB_CH9_H
+#define _UAPI__LINUX_USB_CH9_H
+
+#include <linux/types.h>       /* __u8 etc */
+#include <asm/byteorder.h>     /* le16_to_cpu */
+
+/*-------------------------------------------------------------------------*/
+
+/* CONTROL REQUEST SUPPORT */
+
+/*
+ * USB directions
+ *
+ * This bit flag is used in endpoint descriptors' bEndpointAddress field.
+ * It's also one of three fields in control requests bRequestType.
+ */
+#define USB_DIR_OUT                    0               /* to device */
+#define USB_DIR_IN                     0x80            /* to host */
+
+/*
+ * USB types, the second of three bRequestType fields
+ */
+#define USB_TYPE_MASK                  (0x03 << 5)
+#define USB_TYPE_STANDARD              (0x00 << 5)
+#define USB_TYPE_CLASS                 (0x01 << 5)
+#define USB_TYPE_VENDOR                        (0x02 << 5)
+#define USB_TYPE_RESERVED              (0x03 << 5)
+
+/*
+ * USB recipients, the third of three bRequestType fields
+ */
+#define USB_RECIP_MASK                 0x1f
+#define USB_RECIP_DEVICE               0x00
+#define USB_RECIP_INTERFACE            0x01
+#define USB_RECIP_ENDPOINT             0x02
+#define USB_RECIP_OTHER                        0x03
+/* From Wireless USB 1.0 */
+#define USB_RECIP_PORT                 0x04
+#define USB_RECIP_RPIPE                0x05
+
+/*
+ * Standard requests, for the bRequest field of a SETUP packet.
+ *
+ * These are qualified by the bRequestType field, so that for example
+ * TYPE_CLASS or TYPE_VENDOR specific feature flags could be retrieved
+ * by a GET_STATUS request.
+ */
+#define USB_REQ_GET_STATUS             0x00
+#define USB_REQ_CLEAR_FEATURE          0x01
+#define USB_REQ_SET_FEATURE            0x03
+#define USB_REQ_SET_ADDRESS            0x05
+#define USB_REQ_GET_DESCRIPTOR         0x06
+#define USB_REQ_SET_DESCRIPTOR         0x07
+#define USB_REQ_GET_CONFIGURATION      0x08
+#define USB_REQ_SET_CONFIGURATION      0x09
+#define USB_REQ_GET_INTERFACE          0x0A
+#define USB_REQ_SET_INTERFACE          0x0B
+#define USB_REQ_SYNCH_FRAME            0x0C
+#define USB_REQ_SET_SEL                        0x30
+#define USB_REQ_SET_ISOCH_DELAY                0x31
+
+#define USB_REQ_SET_ENCRYPTION         0x0D    /* Wireless USB */
+#define USB_REQ_GET_ENCRYPTION         0x0E
+#define USB_REQ_RPIPE_ABORT            0x0E
+#define USB_REQ_SET_HANDSHAKE          0x0F
+#define USB_REQ_RPIPE_RESET            0x0F
+#define USB_REQ_GET_HANDSHAKE          0x10
+#define USB_REQ_SET_CONNECTION         0x11
+#define USB_REQ_SET_SECURITY_DATA      0x12
+#define USB_REQ_GET_SECURITY_DATA      0x13
+#define USB_REQ_SET_WUSB_DATA          0x14
+#define USB_REQ_LOOPBACK_DATA_WRITE    0x15
+#define USB_REQ_LOOPBACK_DATA_READ     0x16
+#define USB_REQ_SET_INTERFACE_DS       0x17
+
+/* The Link Power Management (LPM) ECN defines USB_REQ_TEST_AND_SET command,
+ * used by hubs to put ports into a new L1 suspend state, except that it
+ * forgot to define its number ...
+ */
+
+/*
+ * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and
+ * are read as a bit array returned by USB_REQ_GET_STATUS.  (So there
+ * are at most sixteen features of each type.)  Hubs may also support a
+ * new USB_REQ_TEST_AND_SET_FEATURE to put ports into L1 suspend.
+ */
+#define USB_DEVICE_SELF_POWERED                0       /* (read only) */
+#define USB_DEVICE_REMOTE_WAKEUP       1       /* dev may initiate wakeup */
+#define USB_DEVICE_TEST_MODE           2       /* (wired high speed only) */
+#define USB_DEVICE_BATTERY             2       /* (wireless) */
+#define USB_DEVICE_B_HNP_ENABLE                3       /* (otg) dev may initiate HNP */
+#define USB_DEVICE_WUSB_DEVICE         3       /* (wireless)*/
+#define USB_DEVICE_A_HNP_SUPPORT       4       /* (otg) RH port supports HNP */
+#define USB_DEVICE_A_ALT_HNP_SUPPORT   5       /* (otg) other RH port does */
+#define USB_DEVICE_DEBUG_MODE          6       /* (special devices only) */
+
+/*
+ * Test Mode Selectors
+ * See USB 2.0 spec Table 9-7
+ */
+#define        TEST_J          1
+#define        TEST_K          2
+#define        TEST_SE0_NAK    3
+#define        TEST_PACKET     4
+#define        TEST_FORCE_EN   5
+
+/*
+ * New Feature Selectors as added by USB 3.0
+ * See USB 3.0 spec Table 9-6
+ */
+#define USB_DEVICE_U1_ENABLE   48      /* dev may initiate U1 transition */
+#define USB_DEVICE_U2_ENABLE   49      /* dev may initiate U2 transition */
+#define USB_DEVICE_LTM_ENABLE  50      /* dev may send LTM */
+#define USB_INTRF_FUNC_SUSPEND 0       /* function suspend */
+
+#define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00
+/*
+ * Suspend Options, Table 9-7 USB 3.0 spec
+ */
+#define USB_INTRF_FUNC_SUSPEND_LP      (1 << (8 + 0))
+#define USB_INTRF_FUNC_SUSPEND_RW      (1 << (8 + 1))
+
+#define USB_ENDPOINT_HALT              0       /* IN/OUT will STALL */
+
+/* Bit array elements as returned by the USB_REQ_GET_STATUS request. */
+#define USB_DEV_STAT_U1_ENABLED                2       /* transition into U1 state */
+#define USB_DEV_STAT_U2_ENABLED                3       /* transition into U2 state */
+#define USB_DEV_STAT_LTM_ENABLED       4       /* Latency tolerance messages */
+
+/**
+ * struct usb_ctrlrequest - SETUP data for a USB device control request
+ * @bRequestType: matches the USB bmRequestType field
+ * @bRequest: matches the USB bRequest field
+ * @wValue: matches the USB wValue field (le16 byte order)
+ * @wIndex: matches the USB wIndex field (le16 byte order)
+ * @wLength: matches the USB wLength field (le16 byte order)
+ *
+ * This structure is used to send control requests to a USB device.  It matches
+ * the different fields of the USB 2.0 Spec section 9.3, table 9-2.  See the
+ * USB spec for a fuller description of the different fields, and what they are
+ * used for.
+ *
+ * Note that the driver for any interface can issue control requests.
+ * For most devices, interfaces don't coordinate with each other, so
+ * such requests may be made at any time.
+ */
+struct usb_ctrlrequest {
+       __u8 bRequestType;
+       __u8 bRequest;
+       __le16 wValue;
+       __le16 wIndex;
+       __le16 wLength;
+} __attribute__ ((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * STANDARD DESCRIPTORS ... as returned by GET_DESCRIPTOR, or
+ * (rarely) accepted by SET_DESCRIPTOR.
+ *
+ * Note that all multi-byte values here are encoded in little endian
+ * byte order "on the wire".  Within the kernel and when exposed
+ * through the Linux-USB APIs, they are not converted to cpu byte
+ * order; it is the responsibility of the client code to do this.
+ * The single exception is when device and configuration descriptors (but
+ * not other descriptors) are read from usbfs (i.e. /proc/bus/usb/BBB/DDD);
+ * in this case the fields are converted to host endianness by the kernel.
+ */
+
+/*
+ * Descriptor types ... USB 2.0 spec table 9.5
+ */
+#define USB_DT_DEVICE                  0x01
+#define USB_DT_CONFIG                  0x02
+#define USB_DT_STRING                  0x03
+#define USB_DT_INTERFACE               0x04
+#define USB_DT_ENDPOINT                        0x05
+#define USB_DT_DEVICE_QUALIFIER                0x06
+#define USB_DT_OTHER_SPEED_CONFIG      0x07
+#define USB_DT_INTERFACE_POWER         0x08
+/* these are from a minor usb 2.0 revision (ECN) */
+#define USB_DT_OTG                     0x09
+#define USB_DT_DEBUG                   0x0a
+#define USB_DT_INTERFACE_ASSOCIATION   0x0b
+/* these are from the Wireless USB spec */
+#define USB_DT_SECURITY                        0x0c
+#define USB_DT_KEY                     0x0d
+#define USB_DT_ENCRYPTION_TYPE         0x0e
+#define USB_DT_BOS                     0x0f
+#define USB_DT_DEVICE_CAPABILITY       0x10
+#define USB_DT_WIRELESS_ENDPOINT_COMP  0x11
+#define USB_DT_WIRE_ADAPTER            0x21
+#define USB_DT_RPIPE                   0x22
+#define USB_DT_CS_RADIO_CONTROL                0x23
+/* From the T10 UAS specification */
+#define USB_DT_PIPE_USAGE              0x24
+/* From the USB 3.0 spec */
+#define        USB_DT_SS_ENDPOINT_COMP         0x30
+
+/* Conventional codes for class-specific descriptors.  The convention is
+ * defined in the USB "Common Class" Spec (3.11).  Individual class specs
+ * are authoritative for their usage, not the "common class" writeup.
+ */
+#define USB_DT_CS_DEVICE               (USB_TYPE_CLASS | USB_DT_DEVICE)
+#define USB_DT_CS_CONFIG               (USB_TYPE_CLASS | USB_DT_CONFIG)
+#define USB_DT_CS_STRING               (USB_TYPE_CLASS | USB_DT_STRING)
+#define USB_DT_CS_INTERFACE            (USB_TYPE_CLASS | USB_DT_INTERFACE)
+#define USB_DT_CS_ENDPOINT             (USB_TYPE_CLASS | USB_DT_ENDPOINT)
+
+/* All standard descriptors have these 2 fields at the beginning */
+struct usb_descriptor_header {
+       __u8  bLength;
+       __u8  bDescriptorType;
+} __attribute__ ((packed));
+
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_DEVICE: Device descriptor */
+struct usb_device_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __le16 bcdUSB;
+       __u8  bDeviceClass;
+       __u8  bDeviceSubClass;
+       __u8  bDeviceProtocol;
+       __u8  bMaxPacketSize0;
+       __le16 idVendor;
+       __le16 idProduct;
+       __le16 bcdDevice;
+       __u8  iManufacturer;
+       __u8  iProduct;
+       __u8  iSerialNumber;
+       __u8  bNumConfigurations;
+} __attribute__ ((packed));
+
+#define USB_DT_DEVICE_SIZE             18
+
+
+/*
+ * Device and/or Interface Class codes
+ * as found in bDeviceClass or bInterfaceClass
+ * and defined by www.usb.org documents
+ */
+#define USB_CLASS_PER_INTERFACE                0       /* for DeviceClass */
+#define USB_CLASS_AUDIO                        1
+#define USB_CLASS_COMM                 2
+#define USB_CLASS_HID                  3
+#define USB_CLASS_PHYSICAL             5
+#define USB_CLASS_STILL_IMAGE          6
+#define USB_CLASS_PRINTER              7
+#define USB_CLASS_MASS_STORAGE         8
+#define USB_CLASS_HUB                  9
+#define USB_CLASS_CDC_DATA             0x0a
+#define USB_CLASS_CSCID                        0x0b    /* chip+ smart card */
+#define USB_CLASS_CONTENT_SEC          0x0d    /* content security */
+#define USB_CLASS_VIDEO                        0x0e
+#define USB_CLASS_WIRELESS_CONTROLLER  0xe0
+#define USB_CLASS_MISC                 0xef
+#define USB_CLASS_APP_SPEC             0xfe
+#define USB_CLASS_VENDOR_SPEC          0xff
+
+#define USB_SUBCLASS_VENDOR_SPEC       0xff
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_CONFIG: Configuration descriptor information.
+ *
+ * USB_DT_OTHER_SPEED_CONFIG is the same descriptor, except that the
+ * descriptor type is different.  Highspeed-capable devices can look
+ * different depending on what speed they're currently running.  Only
+ * devices with a USB_DT_DEVICE_QUALIFIER have any OTHER_SPEED_CONFIG
+ * descriptors.
+ */
+struct usb_config_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __le16 wTotalLength;
+       __u8  bNumInterfaces;
+       __u8  bConfigurationValue;
+       __u8  iConfiguration;
+       __u8  bmAttributes;
+       __u8  bMaxPower;
+} __attribute__ ((packed));
+
+#define USB_DT_CONFIG_SIZE             9
+
+/* from config descriptor bmAttributes */
+#define USB_CONFIG_ATT_ONE             (1 << 7)        /* must be set */
+#define USB_CONFIG_ATT_SELFPOWER       (1 << 6)        /* self powered */
+#define USB_CONFIG_ATT_WAKEUP          (1 << 5)        /* can wakeup */
+#define USB_CONFIG_ATT_BATTERY         (1 << 4)        /* battery powered */
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_STRING: String descriptor */
+struct usb_string_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __le16 wData[1];                /* UTF-16LE encoded */
+} __attribute__ ((packed));
+
+/* note that "string" zero is special, it holds language codes that
+ * the device supports, not Unicode characters.
+ */
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_INTERFACE: Interface descriptor */
+struct usb_interface_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __u8  bInterfaceNumber;
+       __u8  bAlternateSetting;
+       __u8  bNumEndpoints;
+       __u8  bInterfaceClass;
+       __u8  bInterfaceSubClass;
+       __u8  bInterfaceProtocol;
+       __u8  iInterface;
+} __attribute__ ((packed));
+
+#define USB_DT_INTERFACE_SIZE          9
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_ENDPOINT: Endpoint descriptor */
+struct usb_endpoint_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __u8  bEndpointAddress;
+       __u8  bmAttributes;
+       __le16 wMaxPacketSize;
+       __u8  bInterval;
+
+       /* NOTE:  these two are _only_ in audio endpoints. */
+       /* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */
+       __u8  bRefresh;
+       __u8  bSynchAddress;
+} __attribute__ ((packed));
+
+#define USB_DT_ENDPOINT_SIZE           7
+#define USB_DT_ENDPOINT_AUDIO_SIZE     9       /* Audio extension */
+
+
+/*
+ * Endpoints
+ */
+#define USB_ENDPOINT_NUMBER_MASK       0x0f    /* in bEndpointAddress */
+#define USB_ENDPOINT_DIR_MASK          0x80
+
+#define USB_ENDPOINT_XFERTYPE_MASK     0x03    /* in bmAttributes */
+#define USB_ENDPOINT_XFER_CONTROL      0
+#define USB_ENDPOINT_XFER_ISOC         1
+#define USB_ENDPOINT_XFER_BULK         2
+#define USB_ENDPOINT_XFER_INT          3
+#define USB_ENDPOINT_MAX_ADJUSTABLE    0x80
+
+/* The USB 3.0 spec redefines bits 5:4 of bmAttributes as interrupt ep type. */
+#define USB_ENDPOINT_INTRTYPE          0x30
+#define USB_ENDPOINT_INTR_PERIODIC     (0 << 4)
+#define USB_ENDPOINT_INTR_NOTIFICATION (1 << 4)
+
+#define USB_ENDPOINT_SYNCTYPE          0x0c
+#define USB_ENDPOINT_SYNC_NONE         (0 << 2)
+#define USB_ENDPOINT_SYNC_ASYNC                (1 << 2)
+#define USB_ENDPOINT_SYNC_ADAPTIVE     (2 << 2)
+#define USB_ENDPOINT_SYNC_SYNC         (3 << 2)
+
+#define USB_ENDPOINT_USAGE_MASK                0x30
+#define USB_ENDPOINT_USAGE_DATA                0x00
+#define USB_ENDPOINT_USAGE_FEEDBACK    0x10
+#define USB_ENDPOINT_USAGE_IMPLICIT_FB 0x20    /* Implicit feedback Data endpoint */
+
+/*-------------------------------------------------------------------------*/
+
+/**
+ * usb_endpoint_num - get the endpoint's number
+ * @epd: endpoint to be checked
+ *
+ * Returns @epd's number: 0 to 15.
+ */
+static inline int usb_endpoint_num(const struct usb_endpoint_descriptor *epd)
+{
+       return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
+}
+
+/**
+ * usb_endpoint_type - get the endpoint's transfer type
+ * @epd: endpoint to be checked
+ *
+ * Returns one of USB_ENDPOINT_XFER_{CONTROL, ISOC, BULK, INT} according
+ * to @epd's transfer type.
+ */
+static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd)
+{
+       return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
+}
+
+/**
+ * usb_endpoint_dir_in - check if the endpoint has IN direction
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint is of type IN, otherwise it returns false.
+ */
+static inline int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd)
+{
+       return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN);
+}
+
+/**
+ * usb_endpoint_dir_out - check if the endpoint has OUT direction
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint is of type OUT, otherwise it returns false.
+ */
+static inline int usb_endpoint_dir_out(
+                               const struct usb_endpoint_descriptor *epd)
+{
+       return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT);
+}
+
+/**
+ * usb_endpoint_xfer_bulk - check if the endpoint has bulk transfer type
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint is of type bulk, otherwise it returns false.
+ */
+static inline int usb_endpoint_xfer_bulk(
+                               const struct usb_endpoint_descriptor *epd)
+{
+       return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+               USB_ENDPOINT_XFER_BULK);
+}
+
+/**
+ * usb_endpoint_xfer_control - check if the endpoint has control transfer type
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint is of type control, otherwise it returns false.
+ */
+static inline int usb_endpoint_xfer_control(
+                               const struct usb_endpoint_descriptor *epd)
+{
+       return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+               USB_ENDPOINT_XFER_CONTROL);
+}
+
+/**
+ * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint is of type interrupt, otherwise it returns
+ * false.
+ */
+static inline int usb_endpoint_xfer_int(
+                               const struct usb_endpoint_descriptor *epd)
+{
+       return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+               USB_ENDPOINT_XFER_INT);
+}
+
+/**
+ * usb_endpoint_xfer_isoc - check if the endpoint has isochronous transfer type
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint is of type isochronous, otherwise it returns
+ * false.
+ */
+static inline int usb_endpoint_xfer_isoc(
+                               const struct usb_endpoint_descriptor *epd)
+{
+       return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+               USB_ENDPOINT_XFER_ISOC);
+}
+
+/**
+ * usb_endpoint_is_bulk_in - check if the endpoint is bulk IN
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint has bulk transfer type and IN direction,
+ * otherwise it returns false.
+ */
+static inline int usb_endpoint_is_bulk_in(
+                               const struct usb_endpoint_descriptor *epd)
+{
+       return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd);
+}
+
+/**
+ * usb_endpoint_is_bulk_out - check if the endpoint is bulk OUT
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint has bulk transfer type and OUT direction,
+ * otherwise it returns false.
+ */
+static inline int usb_endpoint_is_bulk_out(
+                               const struct usb_endpoint_descriptor *epd)
+{
+       return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd);
+}
+
+/**
+ * usb_endpoint_is_int_in - check if the endpoint is interrupt IN
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint has interrupt transfer type and IN direction,
+ * otherwise it returns false.
+ */
+static inline int usb_endpoint_is_int_in(
+                               const struct usb_endpoint_descriptor *epd)
+{
+       return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd);
+}
+
+/**
+ * usb_endpoint_is_int_out - check if the endpoint is interrupt OUT
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint has interrupt transfer type and OUT direction,
+ * otherwise it returns false.
+ */
+static inline int usb_endpoint_is_int_out(
+                               const struct usb_endpoint_descriptor *epd)
+{
+       return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd);
+}
+
+/**
+ * usb_endpoint_is_isoc_in - check if the endpoint is isochronous IN
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint has isochronous transfer type and IN direction,
+ * otherwise it returns false.
+ */
+static inline int usb_endpoint_is_isoc_in(
+                               const struct usb_endpoint_descriptor *epd)
+{
+       return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd);
+}
+
+/**
+ * usb_endpoint_is_isoc_out - check if the endpoint is isochronous OUT
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint has isochronous transfer type and OUT direction,
+ * otherwise it returns false.
+ */
+static inline int usb_endpoint_is_isoc_out(
+                               const struct usb_endpoint_descriptor *epd)
+{
+       return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd);
+}
+
+/**
+ * usb_endpoint_maxp - get endpoint's max packet size
+ * @epd: endpoint to be checked
+ *
+ * Returns @epd's max packet
+ */
+static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd)
+{
+       return __le16_to_cpu(epd->wMaxPacketSize);
+}
+
+static inline int usb_endpoint_interrupt_type(
+               const struct usb_endpoint_descriptor *epd)
+{
+       return epd->bmAttributes & USB_ENDPOINT_INTRTYPE;
+}
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */
+struct usb_ss_ep_comp_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __u8  bMaxBurst;
+       __u8  bmAttributes;
+       __le16 wBytesPerInterval;
+} __attribute__ ((packed));
+
+#define USB_DT_SS_EP_COMP_SIZE         6
+
+/* Bits 4:0 of bmAttributes if this is a bulk endpoint */
+static inline int
+usb_ss_max_streams(const struct usb_ss_ep_comp_descriptor *comp)
+{
+       int             max_streams;
+
+       if (!comp)
+               return 0;
+
+       max_streams = comp->bmAttributes & 0x1f;
+
+       if (!max_streams)
+               return 0;
+
+       max_streams = 1 << max_streams;
+
+       return max_streams;
+}
+
+/* Bits 1:0 of bmAttributes if this is an isoc endpoint */
+#define USB_SS_MULT(p)                 (1 + ((p) & 0x3))
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_DEVICE_QUALIFIER: Device Qualifier descriptor */
+struct usb_qualifier_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __le16 bcdUSB;
+       __u8  bDeviceClass;
+       __u8  bDeviceSubClass;
+       __u8  bDeviceProtocol;
+       __u8  bMaxPacketSize0;
+       __u8  bNumConfigurations;
+       __u8  bRESERVED;
+} __attribute__ ((packed));
+
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_OTG (from OTG 1.0a supplement) */
+struct usb_otg_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __u8  bmAttributes;     /* support for HNP, SRP, etc */
+} __attribute__ ((packed));
+
+/* from usb_otg_descriptor.bmAttributes */
+#define USB_OTG_SRP            (1 << 0)
+#define USB_OTG_HNP            (1 << 1)        /* swap host/device roles */
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_DEBUG:  for special highspeed devices, replacing serial console */
+struct usb_debug_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       /* bulk endpoints with 8 byte maxpacket */
+       __u8  bDebugInEndpoint;
+       __u8  bDebugOutEndpoint;
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */
+struct usb_interface_assoc_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __u8  bFirstInterface;
+       __u8  bInterfaceCount;
+       __u8  bFunctionClass;
+       __u8  bFunctionSubClass;
+       __u8  bFunctionProtocol;
+       __u8  iFunction;
+} __attribute__ ((packed));
+
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_SECURITY:  group of wireless security descriptors, including
+ * encryption types available for setting up a CC/association.
+ */
+struct usb_security_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __le16 wTotalLength;
+       __u8  bNumEncryptionTypes;
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_KEY:  used with {GET,SET}_SECURITY_DATA; only public keys
+ * may be retrieved.
+ */
+struct usb_key_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __u8  tTKID[3];
+       __u8  bReserved;
+       __u8  bKeyData[0];
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_ENCRYPTION_TYPE:  bundled in DT_SECURITY groups */
+struct usb_encryption_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __u8  bEncryptionType;
+#define        USB_ENC_TYPE_UNSECURE           0
+#define        USB_ENC_TYPE_WIRED              1       /* non-wireless mode */
+#define        USB_ENC_TYPE_CCM_1              2       /* aes128/cbc session */
+#define        USB_ENC_TYPE_RSA_1              3       /* rsa3072/sha1 auth */
+       __u8  bEncryptionValue;         /* use in SET_ENCRYPTION */
+       __u8  bAuthKeyIndex;
+} __attribute__((packed));
+
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_BOS:  group of device-level capabilities */
+struct usb_bos_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __le16 wTotalLength;
+       __u8  bNumDeviceCaps;
+} __attribute__((packed));
+
+#define USB_DT_BOS_SIZE                5
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_DEVICE_CAPABILITY:  grouped with BOS */
+struct usb_dev_cap_header {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDevCapabilityType;
+} __attribute__((packed));
+
+#define        USB_CAP_TYPE_WIRELESS_USB       1
+
+struct usb_wireless_cap_descriptor {   /* Ultra Wide Band */
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDevCapabilityType;
+
+       __u8  bmAttributes;
+#define        USB_WIRELESS_P2P_DRD            (1 << 1)
+#define        USB_WIRELESS_BEACON_MASK        (3 << 2)
+#define        USB_WIRELESS_BEACON_SELF        (1 << 2)
+#define        USB_WIRELESS_BEACON_DIRECTED    (2 << 2)
+#define        USB_WIRELESS_BEACON_NONE        (3 << 2)
+       __le16 wPHYRates;       /* bit rates, Mbps */
+#define        USB_WIRELESS_PHY_53             (1 << 0)        /* always set */
+#define        USB_WIRELESS_PHY_80             (1 << 1)
+#define        USB_WIRELESS_PHY_107            (1 << 2)        /* always set */
+#define        USB_WIRELESS_PHY_160            (1 << 3)
+#define        USB_WIRELESS_PHY_200            (1 << 4)        /* always set */
+#define        USB_WIRELESS_PHY_320            (1 << 5)
+#define        USB_WIRELESS_PHY_400            (1 << 6)
+#define        USB_WIRELESS_PHY_480            (1 << 7)
+       __u8  bmTFITXPowerInfo; /* TFI power levels */
+       __u8  bmFFITXPowerInfo; /* FFI power levels */
+       __le16 bmBandGroup;
+       __u8  bReserved;
+} __attribute__((packed));
+
+/* USB 2.0 Extension descriptor */
+#define        USB_CAP_TYPE_EXT                2
+
+struct usb_ext_cap_descriptor {                /* Link Power Management */
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDevCapabilityType;
+       __le32 bmAttributes;
+#define USB_LPM_SUPPORT                        (1 << 1)        /* supports LPM */
+#define USB_BESL_SUPPORT               (1 << 2)        /* supports BESL */
+#define USB_BESL_BASELINE_VALID                (1 << 3)        /* Baseline BESL valid*/
+#define USB_BESL_DEEP_VALID            (1 << 4)        /* Deep BESL valid */
+#define USB_GET_BESL_BASELINE(p)       (((p) & (0xf << 8)) >> 8)
+#define USB_GET_BESL_DEEP(p)           (((p) & (0xf << 12)) >> 12)
+} __attribute__((packed));
+
+#define USB_DT_USB_EXT_CAP_SIZE        7
+
+/*
+ * SuperSpeed USB Capability descriptor: Defines the set of SuperSpeed USB
+ * specific device level capabilities
+ */
+#define                USB_SS_CAP_TYPE         3
+struct usb_ss_cap_descriptor {         /* Link Power Management */
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDevCapabilityType;
+       __u8  bmAttributes;
+#define USB_LTM_SUPPORT                        (1 << 1) /* supports LTM */
+       __le16 wSpeedSupported;
+#define USB_LOW_SPEED_OPERATION                (1)      /* Low speed operation */
+#define USB_FULL_SPEED_OPERATION       (1 << 1) /* Full speed operation */
+#define USB_HIGH_SPEED_OPERATION       (1 << 2) /* High speed operation */
+#define USB_5GBPS_OPERATION            (1 << 3) /* Operation at 5Gbps */
+       __u8  bFunctionalitySupport;
+       __u8  bU1devExitLat;
+       __le16 bU2DevExitLat;
+} __attribute__((packed));
+
+#define USB_DT_USB_SS_CAP_SIZE 10
+
+/*
+ * Container ID Capability descriptor: Defines the instance unique ID used to
+ * identify the instance across all operating modes
+ */
+#define        CONTAINER_ID_TYPE       4
+struct usb_ss_container_id_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDevCapabilityType;
+       __u8  bReserved;
+       __u8  ContainerID[16]; /* 128-bit number */
+} __attribute__((packed));
+
+#define USB_DT_USB_SS_CONTN_ID_SIZE    20
+/*-------------------------------------------------------------------------*/
+
+/* USB_DT_WIRELESS_ENDPOINT_COMP:  companion descriptor associated with
+ * each endpoint descriptor for a wireless device
+ */
+struct usb_wireless_ep_comp_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __u8  bMaxBurst;
+       __u8  bMaxSequence;
+       __le16 wMaxStreamDelay;
+       __le16 wOverTheAirPacketSize;
+       __u8  bOverTheAirInterval;
+       __u8  bmCompAttributes;
+#define USB_ENDPOINT_SWITCH_MASK       0x03    /* in bmCompAttributes */
+#define USB_ENDPOINT_SWITCH_NO         0
+#define USB_ENDPOINT_SWITCH_SWITCH     1
+#define USB_ENDPOINT_SWITCH_SCALE      2
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_REQ_SET_HANDSHAKE is a four-way handshake used between a wireless
+ * host and a device for connection set up, mutual authentication, and
+ * exchanging short lived session keys.  The handshake depends on a CC.
+ */
+struct usb_handshake {
+       __u8 bMessageNumber;
+       __u8 bStatus;
+       __u8 tTKID[3];
+       __u8 bReserved;
+       __u8 CDID[16];
+       __u8 nonce[16];
+       __u8 MIC[8];
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB_REQ_SET_CONNECTION modifies or revokes a connection context (CC).
+ * A CC may also be set up using non-wireless secure channels (including
+ * wired USB!), and some devices may support CCs with multiple hosts.
+ */
+struct usb_connection_context {
+       __u8 CHID[16];          /* persistent host id */
+       __u8 CDID[16];          /* device id (unique w/in host context) */
+       __u8 CK[16];            /* connection key */
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
+/* USB 2.0 defines three speeds, here's how Linux identifies them */
+
+enum usb_device_speed {
+       USB_SPEED_UNKNOWN = 0,                  /* enumerating */
+       USB_SPEED_LOW, USB_SPEED_FULL,          /* usb 1.1 */
+       USB_SPEED_HIGH,                         /* usb 2.0 */
+       USB_SPEED_WIRELESS,                     /* wireless (usb 2.5) */
+       USB_SPEED_SUPER,                        /* usb 3.0 */
+};
+
+
+enum usb_device_state {
+       /* NOTATTACHED isn't in the USB spec, and this state acts
+        * the same as ATTACHED ... but it's clearer this way.
+        */
+       USB_STATE_NOTATTACHED = 0,
+
+       /* chapter 9 and authentication (wireless) device states */
+       USB_STATE_ATTACHED,
+       USB_STATE_POWERED,                      /* wired */
+       USB_STATE_RECONNECTING,                 /* auth */
+       USB_STATE_UNAUTHENTICATED,              /* auth */
+       USB_STATE_DEFAULT,                      /* limited function */
+       USB_STATE_ADDRESS,
+       USB_STATE_CONFIGURED,                   /* most functions */
+
+       USB_STATE_SUSPENDED
+
+       /* NOTE:  there are actually four different SUSPENDED
+        * states, returning to POWERED, DEFAULT, ADDRESS, or
+        * CONFIGURED respectively when SOF tokens flow again.
+        * At this level there's no difference between L1 and L2
+        * suspend states.  (L2 being original USB 1.1 suspend.)
+        */
+};
+
+enum usb3_link_state {
+       USB3_LPM_U0 = 0,
+       USB3_LPM_U1,
+       USB3_LPM_U2,
+       USB3_LPM_U3
+};
+
+/*
+ * A U1 timeout of 0x0 means the parent hub will reject any transitions to U1.
+ * 0xff means the parent hub will accept transitions to U1, but will not
+ * initiate a transition.
+ *
+ * A U1 timeout of 0x1 to 0x7F also causes the hub to initiate a transition to
+ * U1 after that many microseconds.  Timeouts of 0x80 to 0xFE are reserved
+ * values.
+ *
+ * A U2 timeout of 0x0 means the parent hub will reject any transitions to U2.
+ * 0xff means the parent hub will accept transitions to U2, but will not
+ * initiate a transition.
+ *
+ * A U2 timeout of 0x1 to 0xFE also causes the hub to initiate a transition to
+ * U2 after N*256 microseconds.  Therefore a U2 timeout value of 0x1 means a U2
+ * idle timer of 256 microseconds, 0x2 means 512 microseconds, 0xFE means
+ * 65.024ms.
+ */
+#define USB3_LPM_DISABLED              0x0
+#define USB3_LPM_U1_MAX_TIMEOUT                0x7F
+#define USB3_LPM_U2_MAX_TIMEOUT                0xFE
+#define USB3_LPM_DEVICE_INITIATED      0xFF
+
+struct usb_set_sel_req {
+       __u8    u1_sel;
+       __u8    u1_pel;
+       __le16  u2_sel;
+       __le16  u2_pel;
+} __attribute__ ((packed));
+
+/*
+ * The Set System Exit Latency control transfer provides one byte each for
+ * U1 SEL and U1 PEL, so the max exit latency is 0xFF.  U2 SEL and U2 PEL each
+ * are two bytes long.
+ */
+#define USB3_LPM_MAX_U1_SEL_PEL                0xFF
+#define USB3_LPM_MAX_U2_SEL_PEL                0xFFFF
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * As per USB compliance update, a device that is actively drawing
+ * more than 100mA from USB must report itself as bus-powered in
+ * the GetStatus(DEVICE) call.
+ * http://compliance.usb.org/index.asp?UpdateFile=Electrical&Format=Standard#34
+ */
+#define USB_SELF_POWER_VBUS_MAX_DRAW           100
+
+#endif /* _UAPI__LINUX_USB_CH9_H */
diff --git a/include/uapi/linux/usb/functionfs.h b/include/uapi/linux/usb/functionfs.h
new file mode 100644 (file)
index 0000000..d6b0128
--- /dev/null
@@ -0,0 +1,169 @@
+#ifndef _UAPI__LINUX_FUNCTIONFS_H__
+#define _UAPI__LINUX_FUNCTIONFS_H__
+
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+#include <linux/usb/ch9.h>
+
+
+enum {
+       FUNCTIONFS_DESCRIPTORS_MAGIC = 1,
+       FUNCTIONFS_STRINGS_MAGIC     = 2
+};
+
+
+#ifndef __KERNEL__
+
+/* Descriptor of an non-audio endpoint */
+struct usb_endpoint_descriptor_no_audio {
+       __u8  bLength;
+       __u8  bDescriptorType;
+
+       __u8  bEndpointAddress;
+       __u8  bmAttributes;
+       __le16 wMaxPacketSize;
+       __u8  bInterval;
+} __attribute__((packed));
+
+
+/*
+ * All numbers must be in little endian order.
+ */
+
+struct usb_functionfs_descs_head {
+       __le32 magic;
+       __le32 length;
+       __le32 fs_count;
+       __le32 hs_count;
+} __attribute__((packed));
+
+/*
+ * Descriptors format:
+ *
+ * | off | name      | type         | description                          |
+ * |-----+-----------+--------------+--------------------------------------|
+ * |   0 | magic     | LE32         | FUNCTIONFS_{FS,HS}_DESCRIPTORS_MAGIC |
+ * |   4 | length    | LE32         | length of the whole data chunk       |
+ * |   8 | fs_count  | LE32         | number of full-speed descriptors     |
+ * |  12 | hs_count  | LE32         | number of high-speed descriptors     |
+ * |  16 | fs_descrs | Descriptor[] | list of full-speed descriptors       |
+ * |     | hs_descrs | Descriptor[] | list of high-speed descriptors       |
+ *
+ * descs are just valid USB descriptors and have the following format:
+ *
+ * | off | name            | type | description              |
+ * |-----+-----------------+------+--------------------------|
+ * |   0 | bLength         | U8   | length of the descriptor |
+ * |   1 | bDescriptorType | U8   | descriptor type          |
+ * |   2 | payload         |      | descriptor's payload     |
+ */
+
+struct usb_functionfs_strings_head {
+       __le32 magic;
+       __le32 length;
+       __le32 str_count;
+       __le32 lang_count;
+} __attribute__((packed));
+
+/*
+ * Strings format:
+ *
+ * | off | name       | type                  | description                |
+ * |-----+------------+-----------------------+----------------------------|
+ * |   0 | magic      | LE32                  | FUNCTIONFS_STRINGS_MAGIC   |
+ * |   4 | length     | LE32                  | length of the data chunk   |
+ * |   8 | str_count  | LE32                  | number of strings          |
+ * |  12 | lang_count | LE32                  | number of languages        |
+ * |  16 | stringtab  | StringTab[lang_count] | table of strings per lang  |
+ *
+ * For each language there is one stringtab entry (ie. there are lang_count
+ * stringtab entires).  Each StringTab has following format:
+ *
+ * | off | name    | type              | description                        |
+ * |-----+---------+-------------------+------------------------------------|
+ * |   0 | lang    | LE16              | language code                      |
+ * |   2 | strings | String[str_count] | array of strings in given language |
+ *
+ * For each string there is one strings entry (ie. there are str_count
+ * string entries).  Each String is a NUL terminated string encoded in
+ * UTF-8.
+ */
+
+#endif
+
+
+/*
+ * Events are delivered on the ep0 file descriptor, when the user mode driver
+ * reads from this file descriptor after writing the descriptors.  Don't
+ * stop polling this descriptor.
+ */
+
+enum usb_functionfs_event_type {
+       FUNCTIONFS_BIND,
+       FUNCTIONFS_UNBIND,
+
+       FUNCTIONFS_ENABLE,
+       FUNCTIONFS_DISABLE,
+
+       FUNCTIONFS_SETUP,
+
+       FUNCTIONFS_SUSPEND,
+       FUNCTIONFS_RESUME
+};
+
+/* NOTE:  this structure must stay the same size and layout on
+ * both 32-bit and 64-bit kernels.
+ */
+struct usb_functionfs_event {
+       union {
+               /* SETUP: packet; DATA phase i/o precedes next event
+                *(setup.bmRequestType & USB_DIR_IN) flags direction */
+               struct usb_ctrlrequest  setup;
+       } __attribute__((packed)) u;
+
+       /* enum usb_functionfs_event_type */
+       __u8                            type;
+       __u8                            _pad[3];
+} __attribute__((packed));
+
+
+/* Endpoint ioctls */
+/* The same as in gadgetfs */
+
+/* IN transfers may be reported to the gadget driver as complete
+ *     when the fifo is loaded, before the host reads the data;
+ * OUT transfers may be reported to the host's "client" driver as
+ *     complete when they're sitting in the FIFO unread.
+ * THIS returns how many bytes are "unclaimed" in the endpoint fifo
+ * (needed for precise fault handling, when the hardware allows it)
+ */
+#define        FUNCTIONFS_FIFO_STATUS  _IO('g', 1)
+
+/* discards any unclaimed data in the fifo. */
+#define        FUNCTIONFS_FIFO_FLUSH   _IO('g', 2)
+
+/* resets endpoint halt+toggle; used to implement set_interface.
+ * some hardware (like pxa2xx) can't support this.
+ */
+#define        FUNCTIONFS_CLEAR_HALT   _IO('g', 3)
+
+/* Specific for functionfs */
+
+/*
+ * Returns reverse mapping of an interface.  Called on EP0.  If there
+ * is no such interface returns -EDOM.  If function is not active
+ * returns -ENODEV.
+ */
+#define        FUNCTIONFS_INTERFACE_REVMAP     _IO('g', 128)
+
+/*
+ * Returns real bEndpointAddress of an endpoint.  If function is not
+ * active returns -ENODEV.
+ */
+#define        FUNCTIONFS_ENDPOINT_REVMAP      _IO('g', 129)
+
+
+
+#endif /* _UAPI__LINUX_FUNCTIONFS_H__ */
diff --git a/include/uapi/linux/usb/g_printer.h b/include/uapi/linux/usb/g_printer.h
new file mode 100644 (file)
index 0000000..6178fde
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * g_printer.h -- Header file for USB Printer gadget driver
+ *
+ * Copyright (C) 2007 Craig W. Nadler
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __LINUX_USB_G_PRINTER_H
+#define __LINUX_USB_G_PRINTER_H
+
+#define PRINTER_NOT_ERROR      0x08
+#define PRINTER_SELECTED       0x10
+#define PRINTER_PAPER_EMPTY    0x20
+
+/* The 'g' code is also used by gadgetfs ioctl requests.
+ * Don't add any colliding codes to either driver, and keep
+ * them in unique ranges (size 0x20 for now).
+ */
+#define GADGET_GET_PRINTER_STATUS      _IOR('g', 0x21, unsigned char)
+#define GADGET_SET_PRINTER_STATUS      _IOWR('g', 0x22, unsigned char)
+
+#endif /* __LINUX_USB_G_PRINTER_H */
diff --git a/include/uapi/linux/usb/gadgetfs.h b/include/uapi/linux/usb/gadgetfs.h
new file mode 100644 (file)
index 0000000..0bb12e0
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Filesystem based user-mode API to USB Gadget controller hardware
+ *
+ * Other than ep0 operations, most things are done by read() and write()
+ * on endpoint files found in one directory.  They are configured by
+ * writing descriptors, and then may be used for normal stream style
+ * i/o requests.  When ep0 is configured, the device can enumerate;
+ * when it's closed, the device disconnects from usb.  Operations on
+ * ep0 require ioctl() operations.
+ *
+ * Configuration and device descriptors get written to /dev/gadget/$CHIP,
+ * which may then be used to read usb_gadgetfs_event structs.  The driver
+ * may activate endpoints as it handles SET_CONFIGURATION setup events,
+ * or earlier; writing endpoint descriptors to /dev/gadget/$ENDPOINT
+ * then performing data transfers by reading or writing.
+ */
+
+#ifndef __LINUX_USB_GADGETFS_H
+#define __LINUX_USB_GADGETFS_H
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+#include <linux/usb/ch9.h>
+
+/*
+ * Events are delivered on the ep0 file descriptor, when the user mode driver
+ * reads from this file descriptor after writing the descriptors.  Don't
+ * stop polling this descriptor.
+ */
+
+enum usb_gadgetfs_event_type {
+       GADGETFS_NOP = 0,
+
+       GADGETFS_CONNECT,
+       GADGETFS_DISCONNECT,
+       GADGETFS_SETUP,
+       GADGETFS_SUSPEND,
+       /* and likely more ! */
+};
+
+/* NOTE:  this structure must stay the same size and layout on
+ * both 32-bit and 64-bit kernels.
+ */
+struct usb_gadgetfs_event {
+       union {
+               /* NOP, DISCONNECT, SUSPEND: nothing
+                * ... some hardware can't report disconnection
+                */
+
+               /* CONNECT: just the speed */
+               enum usb_device_speed   speed;
+
+               /* SETUP: packet; DATA phase i/o precedes next event
+                *(setup.bmRequestType & USB_DIR_IN) flags direction
+                * ... includes SET_CONFIGURATION, SET_INTERFACE
+                */
+               struct usb_ctrlrequest  setup;
+       } u;
+       enum usb_gadgetfs_event_type    type;
+};
+
+
+/* The 'g' code is also used by printer gadget ioctl requests.
+ * Don't add any colliding codes to either driver, and keep
+ * them in unique ranges (size 0x20 for now).
+ */
+
+/* endpoint ioctls */
+
+/* IN transfers may be reported to the gadget driver as complete
+ *     when the fifo is loaded, before the host reads the data;
+ * OUT transfers may be reported to the host's "client" driver as
+ *     complete when they're sitting in the FIFO unread.
+ * THIS returns how many bytes are "unclaimed" in the endpoint fifo
+ * (needed for precise fault handling, when the hardware allows it)
+ */
+#define        GADGETFS_FIFO_STATUS    _IO('g', 1)
+
+/* discards any unclaimed data in the fifo. */
+#define        GADGETFS_FIFO_FLUSH     _IO('g', 2)
+
+/* resets endpoint halt+toggle; used to implement set_interface.
+ * some hardware (like pxa2xx) can't support this.
+ */
+#define        GADGETFS_CLEAR_HALT     _IO('g', 3)
+
+#endif /* __LINUX_USB_GADGETFS_H */
diff --git a/include/uapi/linux/usb/midi.h b/include/uapi/linux/usb/midi.h
new file mode 100644 (file)
index 0000000..c8c52e3
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * <linux/usb/midi.h> -- USB MIDI definitions.
+ *
+ * Copyright (C) 2006 Thumtronics Pty Ltd.
+ * Developed for Thumtronics by Grey Innovation
+ * Ben Williamson <ben.williamson@greyinnovation.com>
+ *
+ * This software is distributed under the terms of the GNU General Public
+ * License ("GPL") version 2, as published by the Free Software Foundation.
+ *
+ * This file holds USB constants and structures defined
+ * by the USB Device Class Definition for MIDI Devices.
+ * Comments below reference relevant sections of that document:
+ *
+ * http://www.usb.org/developers/devclass_docs/midi10.pdf
+ */
+
+#ifndef __LINUX_USB_MIDI_H
+#define __LINUX_USB_MIDI_H
+
+#include <linux/types.h>
+
+/* A.1  MS Class-Specific Interface Descriptor Subtypes */
+#define USB_MS_HEADER          0x01
+#define USB_MS_MIDI_IN_JACK    0x02
+#define USB_MS_MIDI_OUT_JACK   0x03
+#define USB_MS_ELEMENT         0x04
+
+/* A.2  MS Class-Specific Endpoint Descriptor Subtypes */
+#define USB_MS_GENERAL         0x01
+
+/* A.3  MS MIDI IN and OUT Jack Types */
+#define USB_MS_EMBEDDED                0x01
+#define USB_MS_EXTERNAL                0x02
+
+/* 6.1.2.1  Class-Specific MS Interface Header Descriptor */
+struct usb_ms_header_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubtype;
+       __le16 bcdMSC;
+       __le16 wTotalLength;
+} __attribute__ ((packed));
+
+#define USB_DT_MS_HEADER_SIZE  7
+
+/* 6.1.2.2  MIDI IN Jack Descriptor */
+struct usb_midi_in_jack_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;          /* USB_DT_CS_INTERFACE */
+       __u8  bDescriptorSubtype;       /* USB_MS_MIDI_IN_JACK */
+       __u8  bJackType;                /* USB_MS_EMBEDDED/EXTERNAL */
+       __u8  bJackID;
+       __u8  iJack;
+} __attribute__ ((packed));
+
+#define USB_DT_MIDI_IN_SIZE    6
+
+struct usb_midi_source_pin {
+       __u8  baSourceID;
+       __u8  baSourcePin;
+} __attribute__ ((packed));
+
+/* 6.1.2.3  MIDI OUT Jack Descriptor */
+struct usb_midi_out_jack_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;          /* USB_DT_CS_INTERFACE */
+       __u8  bDescriptorSubtype;       /* USB_MS_MIDI_OUT_JACK */
+       __u8  bJackType;                /* USB_MS_EMBEDDED/EXTERNAL */
+       __u8  bJackID;
+       __u8  bNrInputPins;             /* p */
+       struct usb_midi_source_pin pins[]; /* [p] */
+       /*__u8  iJack;  -- omitted due to variable-sized pins[] */
+} __attribute__ ((packed));
+
+#define USB_DT_MIDI_OUT_SIZE(p)        (7 + 2 * (p))
+
+/* As above, but more useful for defining your own descriptors: */
+#define DECLARE_USB_MIDI_OUT_JACK_DESCRIPTOR(p)                        \
+struct usb_midi_out_jack_descriptor_##p {                      \
+       __u8  bLength;                                          \
+       __u8  bDescriptorType;                                  \
+       __u8  bDescriptorSubtype;                               \
+       __u8  bJackType;                                        \
+       __u8  bJackID;                                          \
+       __u8  bNrInputPins;                                     \
+       struct usb_midi_source_pin pins[p];                     \
+       __u8  iJack;                                            \
+} __attribute__ ((packed))
+
+/* 6.2.2  Class-Specific MS Bulk Data Endpoint Descriptor */
+struct usb_ms_endpoint_descriptor {
+       __u8  bLength;                  /* 4+n */
+       __u8  bDescriptorType;          /* USB_DT_CS_ENDPOINT */
+       __u8  bDescriptorSubtype;       /* USB_MS_GENERAL */
+       __u8  bNumEmbMIDIJack;          /* n */
+       __u8  baAssocJackID[];          /* [n] */
+} __attribute__ ((packed));
+
+#define USB_DT_MS_ENDPOINT_SIZE(n)     (4 + (n))
+
+/* As above, but more useful for defining your own descriptors: */
+#define DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(n)                  \
+struct usb_ms_endpoint_descriptor_##n {                                \
+       __u8  bLength;                                          \
+       __u8  bDescriptorType;                                  \
+       __u8  bDescriptorSubtype;                               \
+       __u8  bNumEmbMIDIJack;                                  \
+       __u8  baAssocJackID[n];                                 \
+} __attribute__ ((packed))
+
+#endif /* __LINUX_USB_MIDI_H */
diff --git a/include/uapi/linux/usb/tmc.h b/include/uapi/linux/usb/tmc.h
new file mode 100644 (file)
index 0000000..c045ae1
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2007 Stefan Kopp, Gechingen, Germany
+ * Copyright (C) 2008 Novell, Inc.
+ * Copyright (C) 2008 Greg Kroah-Hartman <gregkh@suse.de>
+ *
+ * This file holds USB constants defined by the USB Device Class
+ * Definition for Test and Measurement devices published by the USB-IF.
+ *
+ * It also has the ioctl definitions for the usbtmc kernel driver that
+ * userspace needs to know about.
+ */
+
+#ifndef __LINUX_USB_TMC_H
+#define __LINUX_USB_TMC_H
+
+/* USB TMC status values */
+#define USBTMC_STATUS_SUCCESS                          0x01
+#define USBTMC_STATUS_PENDING                          0x02
+#define USBTMC_STATUS_FAILED                           0x80
+#define USBTMC_STATUS_TRANSFER_NOT_IN_PROGRESS         0x81
+#define USBTMC_STATUS_SPLIT_NOT_IN_PROGRESS            0x82
+#define USBTMC_STATUS_SPLIT_IN_PROGRESS                        0x83
+
+/* USB TMC requests values */
+#define USBTMC_REQUEST_INITIATE_ABORT_BULK_OUT         1
+#define USBTMC_REQUEST_CHECK_ABORT_BULK_OUT_STATUS     2
+#define USBTMC_REQUEST_INITIATE_ABORT_BULK_IN          3
+#define USBTMC_REQUEST_CHECK_ABORT_BULK_IN_STATUS      4
+#define USBTMC_REQUEST_INITIATE_CLEAR                  5
+#define USBTMC_REQUEST_CHECK_CLEAR_STATUS              6
+#define USBTMC_REQUEST_GET_CAPABILITIES                        7
+#define USBTMC_REQUEST_INDICATOR_PULSE                 64
+
+/* Request values for USBTMC driver's ioctl entry point */
+#define USBTMC_IOC_NR                  91
+#define USBTMC_IOCTL_INDICATOR_PULSE   _IO(USBTMC_IOC_NR, 1)
+#define USBTMC_IOCTL_CLEAR             _IO(USBTMC_IOC_NR, 2)
+#define USBTMC_IOCTL_ABORT_BULK_OUT    _IO(USBTMC_IOC_NR, 3)
+#define USBTMC_IOCTL_ABORT_BULK_IN     _IO(USBTMC_IOC_NR, 4)
+#define USBTMC_IOCTL_CLEAR_OUT_HALT    _IO(USBTMC_IOC_NR, 6)
+#define USBTMC_IOCTL_CLEAR_IN_HALT     _IO(USBTMC_IOC_NR, 7)
+
+#endif
diff --git a/include/uapi/linux/usb/video.h b/include/uapi/linux/usb/video.h
new file mode 100644 (file)
index 0000000..3b3b95e
--- /dev/null
@@ -0,0 +1,568 @@
+/*
+ * USB Video Class definitions.
+ *
+ * Copyright (C) 2009 Laurent Pinchart <laurent.pinchart@skynet.be>
+ *
+ * This file holds USB constants and structures defined by the USB Device
+ * Class Definition for Video Devices. Unless otherwise stated, comments
+ * below reference relevant sections of the USB Video Class 1.1 specification
+ * available at
+ *
+ * http://www.usb.org/developers/devclass_docs/USB_Video_Class_1_1.zip
+ */
+
+#ifndef __LINUX_USB_VIDEO_H
+#define __LINUX_USB_VIDEO_H
+
+#include <linux/types.h>
+
+/* --------------------------------------------------------------------------
+ * UVC constants
+ */
+
+/* A.2. Video Interface Subclass Codes */
+#define UVC_SC_UNDEFINED                               0x00
+#define UVC_SC_VIDEOCONTROL                            0x01
+#define UVC_SC_VIDEOSTREAMING                          0x02
+#define UVC_SC_VIDEO_INTERFACE_COLLECTION              0x03
+
+/* A.3. Video Interface Protocol Codes */
+#define UVC_PC_PROTOCOL_UNDEFINED                      0x00
+
+/* A.5. Video Class-Specific VC Interface Descriptor Subtypes */
+#define UVC_VC_DESCRIPTOR_UNDEFINED                    0x00
+#define UVC_VC_HEADER                                  0x01
+#define UVC_VC_INPUT_TERMINAL                          0x02
+#define UVC_VC_OUTPUT_TERMINAL                         0x03
+#define UVC_VC_SELECTOR_UNIT                           0x04
+#define UVC_VC_PROCESSING_UNIT                         0x05
+#define UVC_VC_EXTENSION_UNIT                          0x06
+
+/* A.6. Video Class-Specific VS Interface Descriptor Subtypes */
+#define UVC_VS_UNDEFINED                               0x00
+#define UVC_VS_INPUT_HEADER                            0x01
+#define UVC_VS_OUTPUT_HEADER                           0x02
+#define UVC_VS_STILL_IMAGE_FRAME                       0x03
+#define UVC_VS_FORMAT_UNCOMPRESSED                     0x04
+#define UVC_VS_FRAME_UNCOMPRESSED                      0x05
+#define UVC_VS_FORMAT_MJPEG                            0x06
+#define UVC_VS_FRAME_MJPEG                             0x07
+#define UVC_VS_FORMAT_MPEG2TS                          0x0a
+#define UVC_VS_FORMAT_DV                               0x0c
+#define UVC_VS_COLORFORMAT                             0x0d
+#define UVC_VS_FORMAT_FRAME_BASED                      0x10
+#define UVC_VS_FRAME_FRAME_BASED                       0x11
+#define UVC_VS_FORMAT_STREAM_BASED                     0x12
+
+/* A.7. Video Class-Specific Endpoint Descriptor Subtypes */
+#define UVC_EP_UNDEFINED                               0x00
+#define UVC_EP_GENERAL                                 0x01
+#define UVC_EP_ENDPOINT                                        0x02
+#define UVC_EP_INTERRUPT                               0x03
+
+/* A.8. Video Class-Specific Request Codes */
+#define UVC_RC_UNDEFINED                               0x00
+#define UVC_SET_CUR                                    0x01
+#define UVC_GET_CUR                                    0x81
+#define UVC_GET_MIN                                    0x82
+#define UVC_GET_MAX                                    0x83
+#define UVC_GET_RES                                    0x84
+#define UVC_GET_LEN                                    0x85
+#define UVC_GET_INFO                                   0x86
+#define UVC_GET_DEF                                    0x87
+
+/* A.9.1. VideoControl Interface Control Selectors */
+#define UVC_VC_CONTROL_UNDEFINED                       0x00
+#define UVC_VC_VIDEO_POWER_MODE_CONTROL                        0x01
+#define UVC_VC_REQUEST_ERROR_CODE_CONTROL              0x02
+
+/* A.9.2. Terminal Control Selectors */
+#define UVC_TE_CONTROL_UNDEFINED                       0x00
+
+/* A.9.3. Selector Unit Control Selectors */
+#define UVC_SU_CONTROL_UNDEFINED                       0x00
+#define UVC_SU_INPUT_SELECT_CONTROL                    0x01
+
+/* A.9.4. Camera Terminal Control Selectors */
+#define UVC_CT_CONTROL_UNDEFINED                       0x00
+#define UVC_CT_SCANNING_MODE_CONTROL                   0x01
+#define UVC_CT_AE_MODE_CONTROL                         0x02
+#define UVC_CT_AE_PRIORITY_CONTROL                     0x03
+#define UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL          0x04
+#define UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL          0x05
+#define UVC_CT_FOCUS_ABSOLUTE_CONTROL                  0x06
+#define UVC_CT_FOCUS_RELATIVE_CONTROL                  0x07
+#define UVC_CT_FOCUS_AUTO_CONTROL                      0x08
+#define UVC_CT_IRIS_ABSOLUTE_CONTROL                   0x09
+#define UVC_CT_IRIS_RELATIVE_CONTROL                   0x0a
+#define UVC_CT_ZOOM_ABSOLUTE_CONTROL                   0x0b
+#define UVC_CT_ZOOM_RELATIVE_CONTROL                   0x0c
+#define UVC_CT_PANTILT_ABSOLUTE_CONTROL                        0x0d
+#define UVC_CT_PANTILT_RELATIVE_CONTROL                        0x0e
+#define UVC_CT_ROLL_ABSOLUTE_CONTROL                   0x0f
+#define UVC_CT_ROLL_RELATIVE_CONTROL                   0x10
+#define UVC_CT_PRIVACY_CONTROL                         0x11
+
+/* A.9.5. Processing Unit Control Selectors */
+#define UVC_PU_CONTROL_UNDEFINED                       0x00
+#define UVC_PU_BACKLIGHT_COMPENSATION_CONTROL          0x01
+#define UVC_PU_BRIGHTNESS_CONTROL                      0x02
+#define UVC_PU_CONTRAST_CONTROL                                0x03
+#define UVC_PU_GAIN_CONTROL                            0x04
+#define UVC_PU_POWER_LINE_FREQUENCY_CONTROL            0x05
+#define UVC_PU_HUE_CONTROL                             0x06
+#define UVC_PU_SATURATION_CONTROL                      0x07
+#define UVC_PU_SHARPNESS_CONTROL                       0x08
+#define UVC_PU_GAMMA_CONTROL                           0x09
+#define UVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL       0x0a
+#define UVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL  0x0b
+#define UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL         0x0c
+#define UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL    0x0d
+#define UVC_PU_DIGITAL_MULTIPLIER_CONTROL              0x0e
+#define UVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL                0x0f
+#define UVC_PU_HUE_AUTO_CONTROL                                0x10
+#define UVC_PU_ANALOG_VIDEO_STANDARD_CONTROL           0x11
+#define UVC_PU_ANALOG_LOCK_STATUS_CONTROL              0x12
+
+/* A.9.7. VideoStreaming Interface Control Selectors */
+#define UVC_VS_CONTROL_UNDEFINED                       0x00
+#define UVC_VS_PROBE_CONTROL                           0x01
+#define UVC_VS_COMMIT_CONTROL                          0x02
+#define UVC_VS_STILL_PROBE_CONTROL                     0x03
+#define UVC_VS_STILL_COMMIT_CONTROL                    0x04
+#define UVC_VS_STILL_IMAGE_TRIGGER_CONTROL             0x05
+#define UVC_VS_STREAM_ERROR_CODE_CONTROL               0x06
+#define UVC_VS_GENERATE_KEY_FRAME_CONTROL              0x07
+#define UVC_VS_UPDATE_FRAME_SEGMENT_CONTROL            0x08
+#define UVC_VS_SYNC_DELAY_CONTROL                      0x09
+
+/* B.1. USB Terminal Types */
+#define UVC_TT_VENDOR_SPECIFIC                         0x0100
+#define UVC_TT_STREAMING                               0x0101
+
+/* B.2. Input Terminal Types */
+#define UVC_ITT_VENDOR_SPECIFIC                                0x0200
+#define UVC_ITT_CAMERA                                 0x0201
+#define UVC_ITT_MEDIA_TRANSPORT_INPUT                  0x0202
+
+/* B.3. Output Terminal Types */
+#define UVC_OTT_VENDOR_SPECIFIC                                0x0300
+#define UVC_OTT_DISPLAY                                        0x0301
+#define UVC_OTT_MEDIA_TRANSPORT_OUTPUT                 0x0302
+
+/* B.4. External Terminal Types */
+#define UVC_EXTERNAL_VENDOR_SPECIFIC                   0x0400
+#define UVC_COMPOSITE_CONNECTOR                                0x0401
+#define UVC_SVIDEO_CONNECTOR                           0x0402
+#define UVC_COMPONENT_CONNECTOR                                0x0403
+
+/* 2.4.2.2. Status Packet Type */
+#define UVC_STATUS_TYPE_CONTROL                                1
+#define UVC_STATUS_TYPE_STREAMING                      2
+
+/* 2.4.3.3. Payload Header Information */
+#define UVC_STREAM_EOH                                 (1 << 7)
+#define UVC_STREAM_ERR                                 (1 << 6)
+#define UVC_STREAM_STI                                 (1 << 5)
+#define UVC_STREAM_RES                                 (1 << 4)
+#define UVC_STREAM_SCR                                 (1 << 3)
+#define UVC_STREAM_PTS                                 (1 << 2)
+#define UVC_STREAM_EOF                                 (1 << 1)
+#define UVC_STREAM_FID                                 (1 << 0)
+
+/* 4.1.2. Control Capabilities */
+#define UVC_CONTROL_CAP_GET                            (1 << 0)
+#define UVC_CONTROL_CAP_SET                            (1 << 1)
+#define UVC_CONTROL_CAP_DISABLED                       (1 << 2)
+#define UVC_CONTROL_CAP_AUTOUPDATE                     (1 << 3)
+#define UVC_CONTROL_CAP_ASYNCHRONOUS                   (1 << 4)
+
+/* ------------------------------------------------------------------------
+ * UVC structures
+ */
+
+/* All UVC descriptors have these 3 fields at the beginning */
+struct uvc_descriptor_header {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+} __attribute__((packed));
+
+/* 3.7.2. Video Control Interface Header Descriptor */
+struct uvc_header_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u16 bcdUVC;
+       __u16 wTotalLength;
+       __u32 dwClockFrequency;
+       __u8  bInCollection;
+       __u8  baInterfaceNr[];
+} __attribute__((__packed__));
+
+#define UVC_DT_HEADER_SIZE(n)                          (12+(n))
+
+#define UVC_HEADER_DESCRIPTOR(n) \
+       uvc_header_descriptor_##n
+
+#define DECLARE_UVC_HEADER_DESCRIPTOR(n)               \
+struct UVC_HEADER_DESCRIPTOR(n) {                      \
+       __u8  bLength;                                  \
+       __u8  bDescriptorType;                          \
+       __u8  bDescriptorSubType;                       \
+       __u16 bcdUVC;                                   \
+       __u16 wTotalLength;                             \
+       __u32 dwClockFrequency;                         \
+       __u8  bInCollection;                            \
+       __u8  baInterfaceNr[n];                         \
+} __attribute__ ((packed))
+
+/* 3.7.2.1. Input Terminal Descriptor */
+struct uvc_input_terminal_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u8  bTerminalID;
+       __u16 wTerminalType;
+       __u8  bAssocTerminal;
+       __u8  iTerminal;
+} __attribute__((__packed__));
+
+#define UVC_DT_INPUT_TERMINAL_SIZE                     8
+
+/* 3.7.2.2. Output Terminal Descriptor */
+struct uvc_output_terminal_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u8  bTerminalID;
+       __u16 wTerminalType;
+       __u8  bAssocTerminal;
+       __u8  bSourceID;
+       __u8  iTerminal;
+} __attribute__((__packed__));
+
+#define UVC_DT_OUTPUT_TERMINAL_SIZE                    9
+
+/* 3.7.2.3. Camera Terminal Descriptor */
+struct uvc_camera_terminal_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u8  bTerminalID;
+       __u16 wTerminalType;
+       __u8  bAssocTerminal;
+       __u8  iTerminal;
+       __u16 wObjectiveFocalLengthMin;
+       __u16 wObjectiveFocalLengthMax;
+       __u16 wOcularFocalLength;
+       __u8  bControlSize;
+       __u8  bmControls[3];
+} __attribute__((__packed__));
+
+#define UVC_DT_CAMERA_TERMINAL_SIZE(n)                 (15+(n))
+
+/* 3.7.2.4. Selector Unit Descriptor */
+struct uvc_selector_unit_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u8  bUnitID;
+       __u8  bNrInPins;
+       __u8  baSourceID[0];
+       __u8  iSelector;
+} __attribute__((__packed__));
+
+#define UVC_DT_SELECTOR_UNIT_SIZE(n)                   (6+(n))
+
+#define UVC_SELECTOR_UNIT_DESCRIPTOR(n)        \
+       uvc_selector_unit_descriptor_##n
+
+#define DECLARE_UVC_SELECTOR_UNIT_DESCRIPTOR(n)        \
+struct UVC_SELECTOR_UNIT_DESCRIPTOR(n) {               \
+       __u8  bLength;                                  \
+       __u8  bDescriptorType;                          \
+       __u8  bDescriptorSubType;                       \
+       __u8  bUnitID;                                  \
+       __u8  bNrInPins;                                \
+       __u8  baSourceID[n];                            \
+       __u8  iSelector;                                \
+} __attribute__ ((packed))
+
+/* 3.7.2.5. Processing Unit Descriptor */
+struct uvc_processing_unit_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u8  bUnitID;
+       __u8  bSourceID;
+       __u16 wMaxMultiplier;
+       __u8  bControlSize;
+       __u8  bmControls[2];
+       __u8  iProcessing;
+} __attribute__((__packed__));
+
+#define UVC_DT_PROCESSING_UNIT_SIZE(n)                 (9+(n))
+
+/* 3.7.2.6. Extension Unit Descriptor */
+struct uvc_extension_unit_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u8  bUnitID;
+       __u8  guidExtensionCode[16];
+       __u8  bNumControls;
+       __u8  bNrInPins;
+       __u8  baSourceID[0];
+       __u8  bControlSize;
+       __u8  bmControls[0];
+       __u8  iExtension;
+} __attribute__((__packed__));
+
+#define UVC_DT_EXTENSION_UNIT_SIZE(p, n)               (24+(p)+(n))
+
+#define UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) \
+       uvc_extension_unit_descriptor_##p_##n
+
+#define DECLARE_UVC_EXTENSION_UNIT_DESCRIPTOR(p, n)    \
+struct UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) {           \
+       __u8  bLength;                                  \
+       __u8  bDescriptorType;                          \
+       __u8  bDescriptorSubType;                       \
+       __u8  bUnitID;                                  \
+       __u8  guidExtensionCode[16];                    \
+       __u8  bNumControls;                             \
+       __u8  bNrInPins;                                \
+       __u8  baSourceID[p];                            \
+       __u8  bControlSize;                             \
+       __u8  bmControls[n];                            \
+       __u8  iExtension;                               \
+} __attribute__ ((packed))
+
+/* 3.8.2.2. Video Control Interrupt Endpoint Descriptor */
+struct uvc_control_endpoint_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u16 wMaxTransferSize;
+} __attribute__((__packed__));
+
+#define UVC_DT_CONTROL_ENDPOINT_SIZE                   5
+
+/* 3.9.2.1. Input Header Descriptor */
+struct uvc_input_header_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u8  bNumFormats;
+       __u16 wTotalLength;
+       __u8  bEndpointAddress;
+       __u8  bmInfo;
+       __u8  bTerminalLink;
+       __u8  bStillCaptureMethod;
+       __u8  bTriggerSupport;
+       __u8  bTriggerUsage;
+       __u8  bControlSize;
+       __u8  bmaControls[];
+} __attribute__((__packed__));
+
+#define UVC_DT_INPUT_HEADER_SIZE(n, p)                 (13+(n*p))
+
+#define UVC_INPUT_HEADER_DESCRIPTOR(n, p) \
+       uvc_input_header_descriptor_##n_##p
+
+#define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n, p)      \
+struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) {             \
+       __u8  bLength;                                  \
+       __u8  bDescriptorType;                          \
+       __u8  bDescriptorSubType;                       \
+       __u8  bNumFormats;                              \
+       __u16 wTotalLength;                             \
+       __u8  bEndpointAddress;                         \
+       __u8  bmInfo;                                   \
+       __u8  bTerminalLink;                            \
+       __u8  bStillCaptureMethod;                      \
+       __u8  bTriggerSupport;                          \
+       __u8  bTriggerUsage;                            \
+       __u8  bControlSize;                             \
+       __u8  bmaControls[p][n];                        \
+} __attribute__ ((packed))
+
+/* 3.9.2.2. Output Header Descriptor */
+struct uvc_output_header_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u8  bNumFormats;
+       __u16 wTotalLength;
+       __u8  bEndpointAddress;
+       __u8  bTerminalLink;
+       __u8  bControlSize;
+       __u8  bmaControls[];
+} __attribute__((__packed__));
+
+#define UVC_DT_OUTPUT_HEADER_SIZE(n, p)                        (9+(n*p))
+
+#define UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \
+       uvc_output_header_descriptor_##n_##p
+
+#define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n, p)     \
+struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) {            \
+       __u8  bLength;                                  \
+       __u8  bDescriptorType;                          \
+       __u8  bDescriptorSubType;                       \
+       __u8  bNumFormats;                              \
+       __u16 wTotalLength;                             \
+       __u8  bEndpointAddress;                         \
+       __u8  bTerminalLink;                            \
+       __u8  bControlSize;                             \
+       __u8  bmaControls[p][n];                        \
+} __attribute__ ((packed))
+
+/* 3.9.2.6. Color matching descriptor */
+struct uvc_color_matching_descriptor {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u8  bColorPrimaries;
+       __u8  bTransferCharacteristics;
+       __u8  bMatrixCoefficients;
+} __attribute__((__packed__));
+
+#define UVC_DT_COLOR_MATCHING_SIZE                     6
+
+/* 4.3.1.1. Video Probe and Commit Controls */
+struct uvc_streaming_control {
+       __u16 bmHint;
+       __u8  bFormatIndex;
+       __u8  bFrameIndex;
+       __u32 dwFrameInterval;
+       __u16 wKeyFrameRate;
+       __u16 wPFrameRate;
+       __u16 wCompQuality;
+       __u16 wCompWindowSize;
+       __u16 wDelay;
+       __u32 dwMaxVideoFrameSize;
+       __u32 dwMaxPayloadTransferSize;
+       __u32 dwClockFrequency;
+       __u8  bmFramingInfo;
+       __u8  bPreferedVersion;
+       __u8  bMinVersion;
+       __u8  bMaxVersion;
+} __attribute__((__packed__));
+
+/* Uncompressed Payload - 3.1.1. Uncompressed Video Format Descriptor */
+struct uvc_format_uncompressed {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u8  bFormatIndex;
+       __u8  bNumFrameDescriptors;
+       __u8  guidFormat[16];
+       __u8  bBitsPerPixel;
+       __u8  bDefaultFrameIndex;
+       __u8  bAspectRatioX;
+       __u8  bAspectRatioY;
+       __u8  bmInterfaceFlags;
+       __u8  bCopyProtect;
+} __attribute__((__packed__));
+
+#define UVC_DT_FORMAT_UNCOMPRESSED_SIZE                        27
+
+/* Uncompressed Payload - 3.1.2. Uncompressed Video Frame Descriptor */
+struct uvc_frame_uncompressed {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u8  bFrameIndex;
+       __u8  bmCapabilities;
+       __u16 wWidth;
+       __u16 wHeight;
+       __u32 dwMinBitRate;
+       __u32 dwMaxBitRate;
+       __u32 dwMaxVideoFrameBufferSize;
+       __u32 dwDefaultFrameInterval;
+       __u8  bFrameIntervalType;
+       __u32 dwFrameInterval[];
+} __attribute__((__packed__));
+
+#define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n)              (26+4*(n))
+
+#define UVC_FRAME_UNCOMPRESSED(n) \
+       uvc_frame_uncompressed_##n
+
+#define DECLARE_UVC_FRAME_UNCOMPRESSED(n)              \
+struct UVC_FRAME_UNCOMPRESSED(n) {                     \
+       __u8  bLength;                                  \
+       __u8  bDescriptorType;                          \
+       __u8  bDescriptorSubType;                       \
+       __u8  bFrameIndex;                              \
+       __u8  bmCapabilities;                           \
+       __u16 wWidth;                                   \
+       __u16 wHeight;                                  \
+       __u32 dwMinBitRate;                             \
+       __u32 dwMaxBitRate;                             \
+       __u32 dwMaxVideoFrameBufferSize;                \
+       __u32 dwDefaultFrameInterval;                   \
+       __u8  bFrameIntervalType;                       \
+       __u32 dwFrameInterval[n];                       \
+} __attribute__ ((packed))
+
+/* MJPEG Payload - 3.1.1. MJPEG Video Format Descriptor */
+struct uvc_format_mjpeg {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u8  bFormatIndex;
+       __u8  bNumFrameDescriptors;
+       __u8  bmFlags;
+       __u8  bDefaultFrameIndex;
+       __u8  bAspectRatioX;
+       __u8  bAspectRatioY;
+       __u8  bmInterfaceFlags;
+       __u8  bCopyProtect;
+} __attribute__((__packed__));
+
+#define UVC_DT_FORMAT_MJPEG_SIZE                       11
+
+/* MJPEG Payload - 3.1.2. MJPEG Video Frame Descriptor */
+struct uvc_frame_mjpeg {
+       __u8  bLength;
+       __u8  bDescriptorType;
+       __u8  bDescriptorSubType;
+       __u8  bFrameIndex;
+       __u8  bmCapabilities;
+       __u16 wWidth;
+       __u16 wHeight;
+       __u32 dwMinBitRate;
+       __u32 dwMaxBitRate;
+       __u32 dwMaxVideoFrameBufferSize;
+       __u32 dwDefaultFrameInterval;
+       __u8  bFrameIntervalType;
+       __u32 dwFrameInterval[];
+} __attribute__((__packed__));
+
+#define UVC_DT_FRAME_MJPEG_SIZE(n)                     (26+4*(n))
+
+#define UVC_FRAME_MJPEG(n) \
+       uvc_frame_mjpeg_##n
+
+#define DECLARE_UVC_FRAME_MJPEG(n)                     \
+struct UVC_FRAME_MJPEG(n) {                            \
+       __u8  bLength;                                  \
+       __u8  bDescriptorType;                          \
+       __u8  bDescriptorSubType;                       \
+       __u8  bFrameIndex;                              \
+       __u8  bmCapabilities;                           \
+       __u16 wWidth;                                   \
+       __u16 wHeight;                                  \
+       __u32 dwMinBitRate;                             \
+       __u32 dwMaxBitRate;                             \
+       __u32 dwMaxVideoFrameBufferSize;                \
+       __u32 dwDefaultFrameInterval;                   \
+       __u8  bFrameIntervalType;                       \
+       __u32 dwFrameInterval[n];                       \
+} __attribute__ ((packed))
+
+#endif /* __LINUX_USB_VIDEO_H */
+
index 3729173b7fbcec618be006af9fa8507824a6db7c..88c829466fc1151c61edac08789939d0c00aba47 100644 (file)
@@ -314,6 +314,19 @@ int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel);
 int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel);
 void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel);
 
+enum omapdss_version {
+       OMAPDSS_VER_UNKNOWN = 0,
+       OMAPDSS_VER_OMAP24xx,
+       OMAPDSS_VER_OMAP34xx_ES1,       /* OMAP3430 ES1.0, 2.0 */
+       OMAPDSS_VER_OMAP34xx_ES3,       /* OMAP3430 ES3.0+ */
+       OMAPDSS_VER_OMAP3630,
+       OMAPDSS_VER_AM35xx,
+       OMAPDSS_VER_OMAP4430_ES1,       /* OMAP4430 ES1.0 */
+       OMAPDSS_VER_OMAP4430_ES2,       /* OMAP4430 ES2.0, 2.1, 2.2 */
+       OMAPDSS_VER_OMAP4,              /* All other OMAP4s */
+       OMAPDSS_VER_OMAP5,
+};
+
 /* Board specific data */
 struct omap_dss_board_info {
        int (*get_context_loss_count)(struct device *dev);
@@ -323,6 +336,7 @@ struct omap_dss_board_info {
        int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask);
        void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask);
        int (*set_min_bus_tput)(struct device *dev, unsigned long r);
+       enum omapdss_version version;
 };
 
 /* Init with the board info */
diff --git a/include/video/omapvrfb.h b/include/video/omapvrfb.h
new file mode 100644 (file)
index 0000000..bb0bd89
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * VRFB Rotation Engine
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#ifndef __OMAP_VRFB_H__
+#define __OMAP_VRFB_H__
+
+#define OMAP_VRFB_LINE_LEN 2048
+
+struct vrfb {
+       u8 context;
+       void __iomem *vaddr[4];
+       unsigned long paddr[4];
+       u16 xres;
+       u16 yres;
+       u16 xoffset;
+       u16 yoffset;
+       u8 bytespp;
+       bool yuv_mode;
+};
+
+#ifdef CONFIG_OMAP2_VRFB
+extern bool omap_vrfb_supported(void);
+extern int omap_vrfb_request_ctx(struct vrfb *vrfb);
+extern void omap_vrfb_release_ctx(struct vrfb *vrfb);
+extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
+               u8 bytespp);
+extern u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp);
+extern u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp);
+extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
+               u16 width, u16 height,
+               unsigned bytespp, bool yuv_mode);
+extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot);
+extern void omap_vrfb_restore_context(void);
+
+#else
+static inline bool omap_vrfb_supported(void) { return false; }
+static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; }
+static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {}
+static inline void omap_vrfb_adjust_size(u16 *width, u16 *height,
+               u8 bytespp) {}
+static inline u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp)
+               { return 0; }
+static inline u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp)
+               { return 0; }
+static inline void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
+               u16 width, u16 height, unsigned bytespp, bool yuv_mode) {}
+static inline int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot)
+               { return 0; }
+static inline void omap_vrfb_restore_context(void) {}
+#endif
+#endif /* __VRFB_H */
diff --git a/include/xen/Kbuild b/include/xen/Kbuild
deleted file mode 100644 (file)
index e69de29..0000000
index 6114a13419bdc3e7424e82db981131c580f6349c..24f9247b7d0214d4b3755bb4396f14d9ef712753 100644 (file)
@@ -11,5 +11,4 @@
 
 extern struct key *modsign_keyring;
 
-extern int mod_verify_sig(const void *mod, unsigned long modlen,
-                         const void *sig, unsigned long siglen);
+extern int mod_verify_sig(const void *mod, unsigned long *_modlen);
index 0e2da8695f8ed2d80b4b498eed883e49936fc59f..6085f5ef88eaf1fd95159f3db724b16cf43b54d3 100644 (file)
@@ -2421,25 +2421,17 @@ static inline void kmemleak_load_module(const struct module *mod,
 
 #ifdef CONFIG_MODULE_SIG
 static int module_sig_check(struct load_info *info,
-                           const void *mod, unsigned long *len)
+                           const void *mod, unsigned long *_len)
 {
        int err = -ENOKEY;
-       const unsigned long markerlen = sizeof(MODULE_SIG_STRING) - 1;
-       const void *p = mod, *end = mod + *len;
-
-       /* Poor man's memmem. */
-       while ((p = memchr(p, MODULE_SIG_STRING[0], end - p))) {
-               if (p + markerlen > end)
-                       break;
-
-               if (memcmp(p, MODULE_SIG_STRING, markerlen) == 0) {
-                       const void *sig = p + markerlen;
-                       /* Truncate module up to signature. */
-                       *len = p - mod;
-                       err = mod_verify_sig(mod, *len, sig, end - sig);
-                       break;
-               }
-               p++;
+       unsigned long markerlen = sizeof(MODULE_SIG_STRING) - 1;
+       unsigned long len = *_len;
+
+       if (len > markerlen &&
+           memcmp(mod + len - markerlen, MODULE_SIG_STRING, markerlen) == 0) {
+               /* We truncate the module to discard the signature */
+               *_len -= markerlen;
+               err = mod_verify_sig(mod, _len);
        }
 
        if (!err) {
index 6b09f6983ac0d75ef35828ebacccb74db57a1817..d492a23df99c8a4fa99527b89c1223941229cb41 100644 (file)
@@ -183,27 +183,33 @@ static struct key *request_asymmetric_key(const char *signer, size_t signer_len,
 /*
  * Verify the signature on a module.
  */
-int mod_verify_sig(const void *mod, unsigned long modlen,
-                  const void *sig, unsigned long siglen)
+int mod_verify_sig(const void *mod, unsigned long *_modlen)
 {
        struct public_key_signature *pks;
        struct module_signature ms;
        struct key *key;
-       size_t sig_len;
+       const void *sig;
+       size_t modlen = *_modlen, sig_len;
        int ret;
 
-       pr_devel("==>%s(,%lu,,%lu,)\n", __func__, modlen, siglen);
+       pr_devel("==>%s(,%lu)\n", __func__, modlen);
 
-       if (siglen <= sizeof(ms))
+       if (modlen <= sizeof(ms))
                return -EBADMSG;
 
-       memcpy(&ms, sig + (siglen - sizeof(ms)), sizeof(ms));
-       siglen -= sizeof(ms);
+       memcpy(&ms, mod + (modlen - sizeof(ms)), sizeof(ms));
+       modlen -= sizeof(ms);
 
        sig_len = be32_to_cpu(ms.sig_len);
-       if (sig_len >= siglen ||
-           siglen - sig_len != (size_t)ms.signer_len + ms.key_id_len)
+       if (sig_len >= modlen)
                return -EBADMSG;
+       modlen -= sig_len;
+       if ((size_t)ms.signer_len + ms.key_id_len >= modlen)
+               return -EBADMSG;
+       modlen -= (size_t)ms.signer_len + ms.key_id_len;
+
+       *_modlen = modlen;
+       sig = mod + modlen;
 
        /* For the moment, only support RSA and X.509 identifiers */
        if (ms.algo != PKEY_ALGO_RSA ||
index 478bad2745e3a8357fcc2f9a56059d167bf67e49..eb00be205811959c708fe2bf5e3aee0547dcfa36 100644 (file)
@@ -133,19 +133,26 @@ struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *old
        return create_pid_namespace(old_ns);
 }
 
-void free_pid_ns(struct kref *kref)
+static void free_pid_ns(struct kref *kref)
 {
-       struct pid_namespace *ns, *parent;
+       struct pid_namespace *ns;
 
        ns = container_of(kref, struct pid_namespace, kref);
-
-       parent = ns->parent;
        destroy_pid_namespace(ns);
+}
 
-       if (parent != NULL)
-               put_pid_ns(parent);
+void put_pid_ns(struct pid_namespace *ns)
+{
+       struct pid_namespace *parent;
+
+       while (ns != &init_pid_ns) {
+               parent = ns->parent;
+               if (!kref_put(&ns->kref, free_pid_ns))
+                       break;
+               ns = parent;
+       }
 }
-EXPORT_SYMBOL_GPL(free_pid_ns);
+EXPORT_SYMBOL_GPL(put_pid_ns);
 
 void zap_pid_ns_processes(struct pid_namespace *pid_ns)
 {
index 66a2ea37b5763b450929a5f955e3bc81ad130a1c..22e070f3470a66569f12d917bcf9b655f4817d4d 100644 (file)
@@ -87,6 +87,12 @@ static DEFINE_SEMAPHORE(console_sem);
 struct console *console_drivers;
 EXPORT_SYMBOL_GPL(console_drivers);
 
+#ifdef CONFIG_LOCKDEP
+static struct lockdep_map console_lock_dep_map = {
+       .name = "console_lock"
+};
+#endif
+
 /*
  * This is used for debugging the mess that is the VT code by
  * keeping track if we have the console semaphore held. It's
@@ -1890,7 +1896,6 @@ static int __cpuinit console_cpu_notify(struct notifier_block *self,
        switch (action) {
        case CPU_ONLINE:
        case CPU_DEAD:
-       case CPU_DYING:
        case CPU_DOWN_FAILED:
        case CPU_UP_CANCELED:
                console_lock();
@@ -1909,12 +1914,14 @@ static int __cpuinit console_cpu_notify(struct notifier_block *self,
  */
 void console_lock(void)
 {
-       BUG_ON(in_interrupt());
+       might_sleep();
+
        down(&console_sem);
        if (console_suspended)
                return;
        console_locked = 1;
        console_may_schedule = 1;
+       mutex_acquire(&console_lock_dep_map, 0, 0, _RET_IP_);
 }
 EXPORT_SYMBOL(console_lock);
 
@@ -1936,6 +1943,7 @@ int console_trylock(void)
        }
        console_locked = 1;
        console_may_schedule = 0;
+       mutex_acquire(&console_lock_dep_map, 0, 1, _RET_IP_);
        return 1;
 }
 EXPORT_SYMBOL(console_trylock);
@@ -2096,6 +2104,7 @@ skip:
                local_irq_restore(flags);
        }
        console_locked = 0;
+       mutex_release(&console_lock_dep_map, 1, _RET_IP_);
 
        /* Release the exclusive_console once it is used */
        if (unlikely(exclusive_console))
index c5cb5b99cb8152808f569f6b993010a33e646bce..e6e0ece5f6a04401506d62fb602d7034d4273fe1 100644 (file)
@@ -1265,15 +1265,16 @@ DECLARE_RWSEM(uts_sem);
  * Work around broken programs that cannot handle "Linux 3.0".
  * Instead we map 3.x to 2.6.40+x, so e.g. 3.0 would be 2.6.40
  */
-static int override_release(char __user *release, int len)
+static int override_release(char __user *release, size_t len)
 {
        int ret = 0;
-       char buf[65];
 
        if (current->personality & UNAME26) {
-               char *rest = UTS_RELEASE;
+               const char *rest = UTS_RELEASE;
+               char buf[65] = { 0 };
                int ndots = 0;
                unsigned v;
+               size_t copy;
 
                while (*rest) {
                        if (*rest == '.' && ++ndots >= 3)
@@ -1283,8 +1284,9 @@ static int override_release(char __user *release, int len)
                        rest++;
                }
                v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40;
-               snprintf(buf, len, "2.6.%u%s", v, rest);
-               ret = copy_to_user(release, buf, len);
+               copy = clamp_t(size_t, len, 1, sizeof(buf));
+               copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
+               ret = copy_to_user(release, buf, copy + 1);
        }
        return ret;
 }
index b9087bff008be9ef4b4eb2ebb7acea898b69be8d..d84beb994f36f1c0b6d7e82fa02fc558a13f88c9 100644 (file)
@@ -264,7 +264,7 @@ static struct dma_debug_entry *__hash_bucket_find(struct hash_bucket *bucket,
                                                  match_fn match)
 {
        struct dma_debug_entry *entry, *ret = NULL;
-       int matches = 0, match_lvl, last_lvl = 0;
+       int matches = 0, match_lvl, last_lvl = -1;
 
        list_for_each_entry(entry, &bucket->list, list) {
                if (!match(ref, entry))
@@ -293,7 +293,7 @@ static struct dma_debug_entry *__hash_bucket_find(struct hash_bucket *bucket,
                } else if (match_lvl > last_lvl) {
                        /*
                         * We found an entry that fits better then the
-                        * previous one
+                        * previous one or it is the 1st match.
                         */
                        last_lvl = match_lvl;
                        ret      = entry;
index 2c4ce17651d825c97c7d89ecea52bf53f17ce0aa..9eef55838fca5ff99580982e85ea0c0fa6dea839 100644 (file)
@@ -346,7 +346,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
         * pages requested were isolated. If there were any failures, 0 is
         * returned and CMA will fail.
         */
-       if (strict && nr_strict_required != total_isolated)
+       if (strict && nr_strict_required > total_isolated)
                total_isolated = 0;
 
        if (locked)
index 3899a86851ceb6bf021e51c014fef16e0893a7f0..a0aaf0e56800394be8b9ae0d0da47712b6e0bb53 100644 (file)
@@ -169,7 +169,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
        if (vma->vm_private_data && !(vma->vm_flags & VM_NONLINEAR))
                goto out;
 
-       if (!vma->vm_ops->remap_pages)
+       if (!vma->vm_ops || !vma->vm_ops->remap_pages)
                goto out;
 
        if (start < vma->vm_start || start + size > vma->vm_end)
index a863af26c79c0190f378c36ac4e680add06f700a..40f17c34b4153fab93b4f1a2685dee0b8cac4da8 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/khugepaged.h>
 #include <linux/freezer.h>
 #include <linux/mman.h>
+#include <linux/pagemap.h>
 #include <asm/tlb.h>
 #include <asm/pgalloc.h>
 #include "internal.h"
index 0b78fb9ea65b60afa08287f0eff1d797d75c9a7e..d04a8a54c294f852f55e624e3c41d1b03b7a56e9 100644 (file)
@@ -1536,9 +1536,8 @@ asmlinkage long compat_sys_mbind(compat_ulong_t start, compat_ulong_t len,
  *
  * Returns effective policy for a VMA at specified address.
  * Falls back to @task or system default policy, as necessary.
- * Current or other task's task mempolicy and non-shared vma policies
- * are protected by the task's mmap_sem, which must be held for read by
- * the caller.
+ * Current or other task's task mempolicy and non-shared vma policies must be
+ * protected by task_lock(task) by the caller.
  * Shared policies [those marked as MPOL_F_SHARED] require an extra reference
  * count--added by the get_policy() vm_op, as appropriate--to protect against
  * freeing by another task.  It is the caller's responsibility to free the
index a08e4681fd0d630ff212e299f5b657f71e48c4b0..1e921c5e9576b6db64cc07fb4f4c90a8f4e2729e 100644 (file)
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -429,7 +429,7 @@ static __always_inline void *
 __do_kmalloc_node(size_t size, gfp_t gfp, int node, unsigned long caller)
 {
        unsigned int *m;
-       int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN);
+       int align = max_t(size_t, ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN);
        void *ret;
 
        gfp &= gfp_allowed_mask;
@@ -502,7 +502,7 @@ void kfree(const void *block)
 
        sp = virt_to_page(block);
        if (PageSlab(sp)) {
-               int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN);
+               int align = max_t(size_t, ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN);
                unsigned int *m = (unsigned int *)(block - align);
                slob_free(m, *m + align);
        } else
@@ -521,7 +521,7 @@ size_t ksize(const void *block)
 
        sp = virt_to_page(block);
        if (PageSlab(sp)) {
-               int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN);
+               int align = max_t(size_t, ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN);
                unsigned int *m = (unsigned int *)(block - align);
                return SLOB_UNITS(*m) * SLOB_UNIT;
        } else
index fbbf1fa00940e2c843f1706ea1a6bcfff349c555..65e06abe023f7fba92f468120937d84fd5911d43 100644 (file)
@@ -366,6 +366,13 @@ EXPORT_SYMBOL(vlan_vids_del_by_dev);
 
 bool vlan_uses_dev(const struct net_device *dev)
 {
-       return rtnl_dereference(dev->vlan_info) ? true : false;
+       struct vlan_info *vlan_info;
+
+       ASSERT_RTNL();
+
+       vlan_info = rtnl_dereference(dev->vlan_info);
+       if (!vlan_info)
+               return false;
+       return vlan_info->grp.nr_vlan_devs ? true : false;
 }
 EXPORT_SYMBOL(vlan_uses_dev);
index d7c56f8a5b4e76028ebd4f66e5a928ea4ea0887e..0424e4e27414d3bd6c79f5094d0d3907e62b02f5 100644 (file)
@@ -3064,14 +3064,15 @@ static struct inet6_ifaddr *if6_get_first(struct seq_file *seq, loff_t pos)
                struct hlist_node *n;
                hlist_for_each_entry_rcu_bh(ifa, n, &inet6_addr_lst[state->bucket],
                                         addr_lst) {
+                       if (!net_eq(dev_net(ifa->idev->dev), net))
+                               continue;
                        /* sync with offset */
                        if (p < state->offset) {
                                p++;
                                continue;
                        }
                        state->offset++;
-                       if (net_eq(dev_net(ifa->idev->dev), net))
-                               return ifa;
+                       return ifa;
                }
 
                /* prepare for next bucket */
@@ -3089,18 +3090,20 @@ static struct inet6_ifaddr *if6_get_next(struct seq_file *seq,
        struct hlist_node *n = &ifa->addr_lst;
 
        hlist_for_each_entry_continue_rcu_bh(ifa, n, addr_lst) {
+               if (!net_eq(dev_net(ifa->idev->dev), net))
+                       continue;
                state->offset++;
-               if (net_eq(dev_net(ifa->idev->dev), net))
-                       return ifa;
+               return ifa;
        }
 
        while (++state->bucket < IN6_ADDR_HSIZE) {
                state->offset = 0;
                hlist_for_each_entry_rcu_bh(ifa, n,
                                     &inet6_addr_lst[state->bucket], addr_lst) {
+                       if (!net_eq(dev_net(ifa->idev->dev), net))
+                               continue;
                        state->offset++;
-                       if (net_eq(dev_net(ifa->idev->dev), net))
-                               return ifa;
+                       return ifa;
                }
        }
 
index 95a3a7a336ba86a0b8b3790a7ce8e722f17db1a2..496ce2cebcd7316f7a1eab1051758e2f90b22263 100644 (file)
@@ -421,6 +421,8 @@ static int ircomm_tty_install(struct tty_driver *driver, struct tty_struct *tty)
                hashbin_insert(ircomm_tty, (irda_queue_t *) self, line, NULL);
        }
 
+       tty->driver_data = self;
+
        return tty_port_install(&self->port, driver, tty);
 }
 
index 57f7de839b038b8a6ae626820dd4a63e4ef0b384..6773d7803627ff15f9a5d2c144203d17226d9622 100644 (file)
@@ -1642,8 +1642,9 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
                                        asoc->outqueue.outstanding_bytes;
                        sackh.num_gap_ack_blocks = 0;
                        sackh.num_dup_tsns = 0;
+                       chunk->subh.sack_hdr = &sackh;
                        sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_SACK,
-                                       SCTP_SACKH(&sackh));
+                                       SCTP_CHUNK(chunk));
                        break;
 
                case SCTP_CMD_DISCARD_PACKET:
index 2a68bb3db772a4d6001716e28af4385bb9c066bb..fc2f7aa4dca7aa04b3e7bc45cd39d47b744a1da4 100644 (file)
@@ -1409,11 +1409,11 @@ static ssize_t read_flush(struct file *file, char __user *buf,
                          size_t count, loff_t *ppos,
                          struct cache_detail *cd)
 {
-       char tbuf[20];
+       char tbuf[22];
        unsigned long p = *ppos;
        size_t len;
 
-       sprintf(tbuf, "%lu\n", convert_to_wallclock(cd->flush_time));
+       snprintf(tbuf, sizeof(tbuf), "%lu\n", convert_to_wallclock(cd->flush_time));
        len = strlen(tbuf);
        if (p >= len)
                return 0;
index 40caf3c26cd5abdb3b22493715ebba38aa691a8a..d17e0ea911edd568a039c905330420810223d07f 100644 (file)
@@ -5,7 +5,7 @@
 # and for each file listed in this file with generic-y creates
 # a small wrapper file in $(obj) (arch/$(SRCARCH)/include/generated/asm)
 
-kbuild-file := $(srctree)/arch/$(SRCARCH)/include/asm/Kbuild
+kbuild-file := $(srctree)/arch/$(SRCARCH)/include/$(src)/Kbuild
 -include $(kbuild-file)
 
 include scripts/Kbuild.include
index c3f69ae275d1f7710b5f38c02e9daf6b45b947a4..4d908d16c035c4e6c582e254e531998e7f6156ae 100644 (file)
@@ -27,7 +27,7 @@ endif
 installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw))
 
 installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all))
-installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/.
+installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./
 
 # Workaround for make < 3.81, where .SECONDEXPANSION doesn't work.
 PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs
@@ -42,7 +42,7 @@ quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@)
 $(installed-fw-dirs):
        $(call cmd,mkdir)
 
-$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $$(dir $(INSTALL_FW_PATH)/%)
+$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %)
        $(call cmd,install)
 
 PHONY +=  __fw_install __fw_modinst FORCE
index 3d13d3a3edfe821c9663de081d78045c96e69809..dda4b2b619275517826af60a61de2edb731f5524 100644 (file)
@@ -17,7 +17,7 @@ __modinst: $(modules)
        @:
 
 quiet_cmd_modules_install = INSTALL $@
-      cmd_modules_install = mkdir -p $(2); cp $@ $(2) ; $(mod_strip_cmd) $(2)/$(notdir $@)
+      cmd_modules_install = mkdir -p $(2); cp $@ $(2) ; $(mod_strip_cmd) $(2)/$(notdir $@) ; $(mod_sign_cmd) $(2)/$(notdir $@)
 
 # Modules built outside the kernel source tree go into extra by default
 INSTALL_MOD_DIR ?= extra
index 002089141df448fa569688a3e5e57b130d68e88b..a1cb0222ebe642b6fd91093f2a01bd301b026e6e 100644 (file)
@@ -14,8 +14,7 @@
 # 3)  create one <module>.mod.c file pr. module
 # 4)  create one Module.symvers file with CRC for all exported symbols
 # 5) compile all <module>.mod.c files
-# 6) final link of the module to a <module.ko> (or <module.unsigned>) file
-# 7) signs the modules to a <module.ko> file
+# 6) final link of the module to a <module.ko> file
 
 # Step 3 is used to place certain information in the module's ELF
 # section, including information such as:
@@ -33,8 +32,6 @@
 # Step 4 is solely used to allow module versioning in external modules,
 # where the CRC of each module is retrieved from the Module.symvers file.
 
-# Step 7 is dependent on CONFIG_MODULE_SIG being enabled.
-
 # KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined
 # symbols in the final module linking stage
 # KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
@@ -119,7 +116,6 @@ $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
 targets += $(modules:.ko=.mod.o)
 
 # Step 6), final link of the modules
-ifneq ($(CONFIG_MODULE_SIG),y)
 quiet_cmd_ld_ko_o = LD [M]  $@
       cmd_ld_ko_o = $(LD) -r $(LDFLAGS)                                 \
                              $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
@@ -129,78 +125,7 @@ $(modules): %.ko :%.o %.mod.o FORCE
        $(call if_changed,ld_ko_o)
 
 targets += $(modules)
-else
-quiet_cmd_ld_ko_unsigned_o = LD [M]  $@
-      cmd_ld_ko_unsigned_o =                                           \
-               $(LD) -r $(LDFLAGS)                                     \
-                        $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE)     \
-                        -o $@ $(filter-out FORCE,$^)                   \
-               $(if $(AFTER_LINK),; $(AFTER_LINK))
-
-$(modules:.ko=.ko.unsigned): %.ko.unsigned :%.o %.mod.o FORCE
-       $(call if_changed,ld_ko_unsigned_o)
-
-targets += $(modules:.ko=.ko.unsigned)
-
-# Step 7), sign the modules
-MODSECKEY = ./signing_key.priv
-MODPUBKEY = ./signing_key.x509
-
-ifeq ($(wildcard $(MODSECKEY))+$(wildcard $(MODPUBKEY)),$(MODSECKEY)+$(MODPUBKEY))
-ifeq ($(KBUILD_SRC),)
-       # no O= is being used
-       SCRIPTS_DIR := scripts
-else
-       SCRIPTS_DIR := $(KBUILD_SRC)/scripts
-endif
-SIGN_MODULES := 1
-else
-SIGN_MODULES := 0
-endif
-
-# only sign if it's an in-tree module
-ifneq ($(KBUILD_EXTMOD),)
-SIGN_MODULES := 0
-endif
 
-# We strip the module as best we can - note that using both strip and eu-strip
-# results in a smaller module than using either alone.
-EU_STRIP = $(shell which eu-strip || echo true)
-
-quiet_cmd_sign_ko_stripped_ko_unsigned = STRIP [M] $@
-      cmd_sign_ko_stripped_ko_unsigned = \
-               cp $< $@ && \
-               strip -x -g $@ && \
-               $(EU_STRIP) $@
-
-ifeq ($(SIGN_MODULES),1)
-
-quiet_cmd_genkeyid = GENKEYID $@
-      cmd_genkeyid = \
-               perl $(SCRIPTS_DIR)/x509keyid $< $<.signer $<.keyid
-
-%.signer %.keyid: %
-       $(call if_changed,genkeyid)
-
-KEYRING_DEP := $(MODSECKEY) $(MODPUBKEY) $(MODPUBKEY).signer $(MODPUBKEY).keyid
-quiet_cmd_sign_ko_ko_stripped = SIGN [M] $@
-      cmd_sign_ko_ko_stripped = \
-               sh $(SCRIPTS_DIR)/sign-file $(MODSECKEY) $(MODPUBKEY) $< $@
-else
-KEYRING_DEP :=
-quiet_cmd_sign_ko_ko_unsigned = NO SIGN [M] $@
-      cmd_sign_ko_ko_unsigned = \
-               cp $< $@
-endif
-
-$(modules): %.ko :%.ko.stripped $(KEYRING_DEP) FORCE
-       $(call if_changed,sign_ko_ko_stripped)
-
-$(patsubst %.ko,%.ko.stripped,$(modules)): %.ko.stripped :%.ko.unsigned FORCE
-       $(call if_changed,sign_ko_stripped_ko_unsigned)
-
-targets += $(modules)
-endif
 
 # Add FORCE to the prequisites of a target to force it to be always rebuilt.
 # ---------------------------------------------------------------------------
index d501c8605f2670627b4a03fe92d47c2be9b65af1..3e42a071070e6bbf985bf4a0c813f1e677327748 100644 (file)
@@ -161,51 +161,27 @@ struct node {
        struct label *labels;
 };
 
-static inline struct label *for_each_label_next(struct label *l)
-{
-       do {
-               l = l->next;
-       } while (l && l->deleted);
-
-       return l;
-}
-
-#define for_each_label(l0, l) \
-       for ((l) = (l0); (l); (l) = for_each_label_next(l))
-
 #define for_each_label_withdel(l0, l) \
        for ((l) = (l0); (l); (l) = (l)->next)
 
-static inline struct property *for_each_property_next(struct property *p)
-{
-       do {
-               p = p->next;
-       } while (p && p->deleted);
-
-       return p;
-}
-
-#define for_each_property(n, p) \
-       for ((p) = (n)->proplist; (p); (p) = for_each_property_next(p))
+#define for_each_label(l0, l) \
+       for_each_label_withdel(l0, l) \
+               if (!(l)->deleted)
 
 #define for_each_property_withdel(n, p) \
        for ((p) = (n)->proplist; (p); (p) = (p)->next)
 
-static inline struct node *for_each_child_next(struct node *c)
-{
-       do {
-               c = c->next_sibling;
-       } while (c && c->deleted);
-
-       return c;
-}
-
-#define for_each_child(n, c) \
-       for ((c) = (n)->children; (c); (c) = for_each_child_next(c))
+#define for_each_property(n, p) \
+       for_each_property_withdel(n, p) \
+               if (!(p)->deleted)
 
 #define for_each_child_withdel(n, c) \
        for ((c) = (n)->children; (c); (c) = (c)->next_sibling)
 
+#define for_each_child(n, c) \
+       for_each_child_withdel(n, c) \
+               if (!(c)->deleted)
+
 void add_label(struct label **labels, char *label);
 void delete_labels(struct label **labels);
 
old mode 100644 (file)
new mode 100755 (executable)
index e58e34e..87ca59d
-#!/bin/sh
+#!/usr/bin/perl -w
 #
 # Sign a module file using the given key.
 #
-# Format: sign-file <key> <x509> <src-file> <dst-file>
-#
-
-scripts=`dirname $0`
-
-CONFIG_MODULE_SIG_SHA512=y
-if [ -r .config ]
-then
-    . ./.config
-fi
-
-key="$1"
-x509="$2"
-src="$3"
-dst="$4"
-
-if [ ! -r "$key" ]
-then
-    echo "Can't read private key" >&2
-    exit 2
-fi
-
-if [ ! -r "$x509" ]
-then
-    echo "Can't read X.509 certificate" >&2
-    exit 2
-fi
-if [ ! -r "$x509.signer" ]
-then
-    echo "Can't read Signer name" >&2
-    exit 2;
-fi
-if [ ! -r "$x509.keyid" ]
-then
-    echo "Can't read Key identifier" >&2
-    exit 2;
-fi
+# Format:
+#
+#      ./scripts/sign-file [-v] <key> <x509> <module> [<dest>]
+#
+#
+use strict;
+use FileHandle;
+use IPC::Open2;
+
+my $verbose = 0;
+if ($#ARGV >= 0 && $ARGV[0] eq "-v") {
+    $verbose = 1;
+    shift;
+}
+
+die "Format: ./scripts/sign-file [-v] <key> <x509> <module> [<dest>]\n"
+    if ($#ARGV != 2 && $#ARGV != 3);
+
+my $private_key = $ARGV[0];
+my $x509 = $ARGV[1];
+my $module = $ARGV[2];
+my $dest = ($#ARGV == 3) ? $ARGV[3] : $ARGV[2] . "~";
+
+die "Can't read private key\n" unless (-r $private_key);
+die "Can't read X.509 certificate\n" unless (-r $x509);
+die "Can't read module\n" unless (-r $module);
+
+#
+# Read the kernel configuration
+#
+my %config = (
+    CONFIG_MODULE_SIG_SHA512 => 1
+    );
+
+if (-r ".config") {
+    open(FD, "<.config") || die ".config";
+    while (<FD>) {
+       if ($_ =~ /^(CONFIG_.*)=[ym]/) {
+           $config{$1} = 1;
+       }
+    }
+    close(FD);
+}
+
+#
+# Function to read the contents of a file into a variable.
+#
+sub read_file($)
+{
+    my ($file) = @_;
+    my $contents;
+    my $len;
+
+    open(FD, "<$file") || die $file;
+    binmode FD;
+    my @st = stat(FD);
+    die $file if (!@st);
+    $len = read(FD, $contents, $st[7]) || die $file;
+    close(FD) || die $file;
+    die "$file: Wanted length ", $st[7], ", got ", $len, "\n"
+       if ($len != $st[7]);
+    return $contents;
+}
+
+###############################################################################
+#
+# First of all, we have to parse the X.509 certificate to find certain details
+# about it.
+#
+# We read the DER-encoded X509 certificate and parse it to extract the Subject
+# name and Subject Key Identifier.  Theis provides the data we need to build
+# the certificate identifier.
+#
+# The signer's name part of the identifier is fabricated from the commonName,
+# the organizationName or the emailAddress components of the X.509 subject
+# name.
+#
+# The subject key ID is used to select which of that signer's certificates
+# we're intending to use to sign the module.
+#
+###############################################################################
+my $x509_certificate = read_file($x509);
+
+my $UNIV = 0 << 6;
+my $APPL = 1 << 6;
+my $CONT = 2 << 6;
+my $PRIV = 3 << 6;
+
+my $CONS = 0x20;
+
+my $BOOLEAN    = 0x01;
+my $INTEGER    = 0x02;
+my $BIT_STRING = 0x03;
+my $OCTET_STRING = 0x04;
+my $NULL       = 0x05;
+my $OBJ_ID     = 0x06;
+my $UTF8String = 0x0c;
+my $SEQUENCE   = 0x10;
+my $SET                = 0x11;
+my $UTCTime    = 0x17;
+my $GeneralizedTime = 0x18;
+
+my %OIDs = (
+    pack("CCC", 85, 4, 3)      => "commonName",
+    pack("CCC", 85, 4, 6)      => "countryName",
+    pack("CCC", 85, 4, 10)     => "organizationName",
+    pack("CCC", 85, 4, 11)     => "organizationUnitName",
+    pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 1, 1) => "rsaEncryption",
+    pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 1, 5) => "sha1WithRSAEncryption",
+    pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 9, 1) => "emailAddress",
+    pack("CCC", 85, 29, 35)    => "authorityKeyIdentifier",
+    pack("CCC", 85, 29, 14)    => "subjectKeyIdentifier",
+    pack("CCC", 85, 29, 19)    => "basicConstraints"
+);
+
+###############################################################################
+#
+# Extract an ASN.1 element from a string and return information about it.
+#
+###############################################################################
+sub asn1_extract($$@)
+{
+    my ($cursor, $expected_tag, $optional) = @_;
+
+    return [ -1 ]
+       if ($cursor->[1] == 0 && $optional);
+
+    die $x509, ": ", $cursor->[0], ": ASN.1 data underrun (elem ", $cursor->[1], ")\n"
+       if ($cursor->[1] < 2);
+
+    my ($tag, $len) = unpack("CC", substr(${$cursor->[2]}, $cursor->[0], 2));
+
+    if ($expected_tag != -1 && $tag != $expected_tag) {
+       return [ -1 ]
+           if ($optional);
+       die $x509, ": ", $cursor->[0], ": ASN.1 unexpected tag (", $tag,
+       " not ", $expected_tag, ")\n";
+    }
+
+    $cursor->[0] += 2;
+    $cursor->[1] -= 2;
+
+    die $x509, ": ", $cursor->[0], ": ASN.1 long tag\n"
+       if (($tag & 0x1f) == 0x1f);
+    die $x509, ": ", $cursor->[0], ": ASN.1 indefinite length\n"
+       if ($len == 0x80);
+
+    if ($len > 0x80) {
+       my $l = $len - 0x80;
+       die $x509, ": ", $cursor->[0], ": ASN.1 data underrun (len len $l)\n"
+           if ($cursor->[1] < $l);
+
+       if ($l == 0x1) {
+           $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1));
+       } elsif ($l = 0x2) {
+           $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0], 2));
+       } elsif ($l = 0x3) {
+           $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1)) << 16;
+           $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0] + 1, 2));
+       } elsif ($l = 0x4) {
+           $len = unpack("N", substr(${$cursor->[2]}, $cursor->[0], 4));
+       } else {
+           die $x509, ": ", $cursor->[0], ": ASN.1 element too long (", $l, ")\n";
+       }
+
+       $cursor->[0] += $l;
+       $cursor->[1] -= $l;
+    }
+
+    die $x509, ": ", $cursor->[0], ": ASN.1 data underrun (", $len, ")\n"
+       if ($cursor->[1] < $len);
+
+    my $ret = [ $tag, [ $cursor->[0], $len, $cursor->[2] ] ];
+    $cursor->[0] += $len;
+    $cursor->[1] -= $len;
+
+    return $ret;
+}
+
+###############################################################################
+#
+# Retrieve the data referred to by a cursor
+#
+###############################################################################
+sub asn1_retrieve($)
+{
+    my ($cursor) = @_;
+    my ($offset, $len, $data) = @$cursor;
+    return substr($$data, $offset, $len);
+}
+
+###############################################################################
+#
+# Roughly parse the X.509 certificate
+#
+###############################################################################
+my $cursor = [ 0, length($x509_certificate), \$x509_certificate ];
+
+my $cert = asn1_extract($cursor, $UNIV | $CONS | $SEQUENCE);
+my $tbs = asn1_extract($cert->[1], $UNIV | $CONS | $SEQUENCE);
+my $version = asn1_extract($tbs->[1], $CONT | $CONS | 0, 1);
+my $serial_number = asn1_extract($tbs->[1], $UNIV | $INTEGER);
+my $sig_type = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
+my $issuer = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
+my $validity = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
+my $subject = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
+my $key = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
+my $issuer_uid = asn1_extract($tbs->[1], $CONT | $CONS | 1, 1);
+my $subject_uid = asn1_extract($tbs->[1], $CONT | $CONS | 2, 1);
+my $extension_list = asn1_extract($tbs->[1], $CONT | $CONS | 3, 1);
+
+my $subject_key_id = ();
+my $authority_key_id = ();
+
+#
+# Parse the extension list
+#
+if ($extension_list->[0] != -1) {
+    my $extensions = asn1_extract($extension_list->[1], $UNIV | $CONS | $SEQUENCE);
+
+    while ($extensions->[1]->[1] > 0) {
+       my $ext = asn1_extract($extensions->[1], $UNIV | $CONS | $SEQUENCE);
+       my $x_oid = asn1_extract($ext->[1], $UNIV | $OBJ_ID);
+       my $x_crit = asn1_extract($ext->[1], $UNIV | $BOOLEAN, 1);
+       my $x_val = asn1_extract($ext->[1], $UNIV | $OCTET_STRING);
+
+       my $raw_oid = asn1_retrieve($x_oid->[1]);
+       next if (!exists($OIDs{$raw_oid}));
+       my $x_type = $OIDs{$raw_oid};
+
+       my $raw_value = asn1_retrieve($x_val->[1]);
+
+       if ($x_type eq "subjectKeyIdentifier") {
+           my $vcursor = [ 0, length($raw_value), \$raw_value ];
+
+           $subject_key_id = asn1_extract($vcursor, $UNIV | $OCTET_STRING);
+       }
+    }
+}
+
+###############################################################################
+#
+# Determine what we're going to use as the signer's name.  In order of
+# preference, take one of: commonName, organizationName or emailAddress.
+#
+###############################################################################
+my $org = "";
+my $cn = "";
+my $email = "";
+
+while ($subject->[1]->[1] > 0) {
+    my $rdn = asn1_extract($subject->[1], $UNIV | $CONS | $SET);
+    my $attr = asn1_extract($rdn->[1], $UNIV | $CONS | $SEQUENCE);
+    my $n_oid = asn1_extract($attr->[1], $UNIV | $OBJ_ID);
+    my $n_val = asn1_extract($attr->[1], -1);
+
+    my $raw_oid = asn1_retrieve($n_oid->[1]);
+    next if (!exists($OIDs{$raw_oid}));
+    my $n_type = $OIDs{$raw_oid};
+
+    my $raw_value = asn1_retrieve($n_val->[1]);
+
+    if ($n_type eq "organizationName") {
+       $org = $raw_value;
+    } elsif ($n_type eq "commonName") {
+       $cn = $raw_value;
+    } elsif ($n_type eq "emailAddress") {
+       $email = $raw_value;
+    }
+}
+
+my $signers_name = $email;
+
+if ($org && $cn) {
+    # Don't use the organizationName if the commonName repeats it
+    if (length($org) <= length($cn) &&
+       substr($cn, 0, length($org)) eq $org) {
+       $signers_name = $cn;
+       goto got_id_name;
+    }
+
+    # Or a signifcant chunk of it
+    if (length($org) >= 7 &&
+       length($cn) >= 7 &&
+       substr($cn, 0, 7) eq substr($org, 0, 7)) {
+       $signers_name = $cn;
+       goto got_id_name;
+    }
+
+    $signers_name = $org . ": " . $cn;
+} elsif ($org) {
+    $signers_name = $org;
+} elsif ($cn) {
+    $signers_name = $cn;
+}
+
+got_id_name:
+
+die $x509, ": ", "X.509: Couldn't find the Subject Key Identifier extension\n"
+    if (!$subject_key_id);
+
+my $key_identifier = asn1_retrieve($subject_key_id->[1]);
+
+###############################################################################
+#
+# Create and attach the module signature
+#
+###############################################################################
 
 #
 # Signature parameters
 #
-algo=1         # Public-key crypto algorithm: RSA
-hash=          # Digest algorithm
-id_type=1      # Identifier type: X.509
+my $algo = 1;          # Public-key crypto algorithm: RSA
+my $hash = 0;          # Digest algorithm
+my $id_type = 1;       # Identifier type: X.509
 
 #
 # Digest the data
 #
-dgst=
-if [ "$CONFIG_MODULE_SIG_SHA1" = "y" ]
-then
-    prologue="0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x04, 0x14"
-    dgst=-sha1
-    hash=2
-elif [ "$CONFIG_MODULE_SIG_SHA224" = "y" ]
-then
-    prologue="0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1C"
-    dgst=-sha224
-    hash=7
-elif [ "$CONFIG_MODULE_SIG_SHA256" = "y" ]
-then
-    prologue="0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20"
-    dgst=-sha256
-    hash=4
-elif [ "$CONFIG_MODULE_SIG_SHA384" = "y" ]
-then
-    prologue="0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30"
-    dgst=-sha384
-    hash=5
-elif [ "$CONFIG_MODULE_SIG_SHA512" = "y" ]
-then
-    prologue="0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40"
-    dgst=-sha512
-    hash=6
-else
-    echo "$0: Can't determine hash algorithm" >&2
-    exit 2
-fi
-
-(
-perl -e "binmode STDOUT; print pack(\"C*\", $prologue)" || exit $?
-openssl dgst $dgst -binary $src || exit $?
-) >$src.dig || exit $?
+my ($dgst, $prologue) = ();
+if (exists $config{"CONFIG_MODULE_SIG_SHA1"}) {
+    $prologue = pack("C*",
+                    0x30, 0x21, 0x30, 0x09, 0x06, 0x05,
+                    0x2B, 0x0E, 0x03, 0x02, 0x1A,
+                    0x05, 0x00, 0x04, 0x14);
+    $dgst = "-sha1";
+    $hash = 2;
+} elsif (exists $config{"CONFIG_MODULE_SIG_SHA224"}) {
+    $prologue = pack("C*",
+                    0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09,
+                    0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04,
+                    0x05, 0x00, 0x04, 0x1C);
+    $dgst = "-sha224";
+    $hash = 7;
+} elsif (exists $config{"CONFIG_MODULE_SIG_SHA256"}) {
+    $prologue = pack("C*",
+                    0x30, 0x31, 0x30, 0x0d, 0x06, 0x09,
+                    0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01,
+                    0x05, 0x00, 0x04, 0x20);
+    $dgst = "-sha256";
+    $hash = 4;
+} elsif (exists $config{"CONFIG_MODULE_SIG_SHA384"}) {
+    $prologue = pack("C*",
+                    0x30, 0x41, 0x30, 0x0d, 0x06, 0x09,
+                    0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02,
+                    0x05, 0x00, 0x04, 0x30);
+    $dgst = "-sha384";
+    $hash = 5;
+} elsif (exists $config{"CONFIG_MODULE_SIG_SHA512"}) {
+    $prologue = pack("C*",
+                    0x30, 0x51, 0x30, 0x0d, 0x06, 0x09,
+                    0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03,
+                    0x05, 0x00, 0x04, 0x40);
+    $dgst = "-sha512";
+    $hash = 6;
+} else {
+    die "Can't determine hash algorithm";
+}
+
+#
+# Generate the digest and read from openssl's stdout
+#
+my $digest;
+$digest = readpipe("openssl dgst $dgst -binary $module") || die "openssl dgst";
 
 #
 # Generate the binary signature, which will be just the integer that comprises
 # the signature with no metadata attached.
 #
-openssl rsautl -sign -inkey $key -keyform PEM -in $src.dig -out $src.sig || exit $?
-signerlen=`stat -c %s $x509.signer`
-keyidlen=`stat -c %s $x509.keyid`
-siglen=`stat -c %s $src.sig`
+my $pid;
+$pid = open2(*read_from, *write_to,
+            "openssl rsautl -sign -inkey $private_key -keyform PEM") ||
+    die "openssl rsautl";
+binmode write_to;
+print write_to $prologue . $digest || die "pipe to openssl rsautl";
+close(write_to) || die "pipe to openssl rsautl";
+
+binmode read_from;
+my $signature;
+read(read_from, $signature, 4096) || die "pipe from openssl rsautl";
+close(read_from) || die "pipe from openssl rsautl";
+$signature = pack("n", length($signature)) . $signature,
+
+waitpid($pid, 0) || die;
+die "openssl rsautl died: $?" if ($? >> 8);
 
 #
 # Build the signed binary
 #
-(
-    cat $src || exit $?
-    echo '~Module signature appended~' || exit $?
-    cat $x509.signer $x509.keyid || exit $?
+my $unsigned_module = read_file($module);
+
+my $magic_number = "~Module signature appended~\n";
+
+my $info = pack("CCCCCxxxN",
+               $algo, $hash, $id_type,
+               length($signers_name),
+               length($key_identifier),
+               length($signature));
 
-    # Preface each signature integer with a 2-byte BE length
-    perl -e "binmode STDOUT; print pack(\"n\", $siglen)" || exit $?
-    cat $src.sig || exit $?
+if ($verbose) {
+    print "Size of unsigned module: ", length($unsigned_module), "\n";
+    print "Size of signer's name  : ", length($signers_name), "\n";
+    print "Size of key identifier : ", length($key_identifier), "\n";
+    print "Size of signature      : ", length($signature), "\n";
+    print "Size of informaton     : ", length($info), "\n";
+    print "Size of magic number   : ", length($magic_number), "\n";
+    print "Signer's name          : '", $signers_name, "'\n";
+    print "Digest                 : $dgst\n";
+}
 
-    # Generate the information block
-    perl -e "binmode STDOUT; print pack(\"CCCCCxxxN\", $algo, $hash, $id_type, $signerlen, $keyidlen, $siglen + 2)" || exit $?
-) >$dst~ || exit $?
+open(FD, ">$dest") || die $dest;
+binmode FD;
+print FD
+    $unsigned_module,
+    $signers_name,
+    $key_identifier,
+    $signature,
+    $info,
+    $magic_number
+    ;
+close FD || die $dest;
 
-# Permit in-place signing
-mv $dst~ $dst || exit $?
+if ($#ARGV != 3) {
+    rename($dest, $module) || die $module;
+}
diff --git a/scripts/x509keyid b/scripts/x509keyid
deleted file mode 100755 (executable)
index c8e91a4..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Generate an identifier from an X.509 certificate that can be placed in a
-# module signature to indentify the key to use.
-#
-# Format:
-#
-#      ./scripts/x509keyid <x509-cert> <signer's-name> <key-id>
-#
-# We read the DER-encoded X509 certificate and parse it to extract the Subject
-# name and Subject Key Identifier.  The provide the data we need to build the
-# certificate identifier.
-#
-# The signer's name part of the identifier is fabricated from the commonName,
-# the organizationName or the emailAddress components of the X.509 subject
-# name and written to the second named file.
-#
-# The subject key ID to select which of that signer's certificates we're
-# intending to use to sign the module is written to the third named file.
-#
-use strict;
-
-my $raw_data;
-
-die "Need three filenames\n" if ($#ARGV != 2);
-
-my $src = $ARGV[0];
-
-open(FD, "<$src") || die $src;
-binmode FD;
-my @st = stat(FD);
-die $src if (!@st);
-read(FD, $raw_data, $st[7]) || die $src;
-close(FD);
-
-my $UNIV = 0 << 6;
-my $APPL = 1 << 6;
-my $CONT = 2 << 6;
-my $PRIV = 3 << 6;
-
-my $CONS = 0x20;
-
-my $BOOLEAN    = 0x01;
-my $INTEGER    = 0x02;
-my $BIT_STRING = 0x03;
-my $OCTET_STRING = 0x04;
-my $NULL       = 0x05;
-my $OBJ_ID     = 0x06;
-my $UTF8String = 0x0c;
-my $SEQUENCE   = 0x10;
-my $SET                = 0x11;
-my $UTCTime    = 0x17;
-my $GeneralizedTime = 0x18;
-
-my %OIDs = (
-    pack("CCC", 85, 4, 3)      => "commonName",
-    pack("CCC", 85, 4, 6)      => "countryName",
-    pack("CCC", 85, 4, 10)     => "organizationName",
-    pack("CCC", 85, 4, 11)     => "organizationUnitName",
-    pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 1, 1) => "rsaEncryption",
-    pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 1, 5) => "sha1WithRSAEncryption",
-    pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 9, 1) => "emailAddress",
-    pack("CCC", 85, 29, 35)    => "authorityKeyIdentifier",
-    pack("CCC", 85, 29, 14)    => "subjectKeyIdentifier",
-    pack("CCC", 85, 29, 19)    => "basicConstraints"
-);
-
-###############################################################################
-#
-# Extract an ASN.1 element from a string and return information about it.
-#
-###############################################################################
-sub asn1_extract($$@)
-{
-    my ($cursor, $expected_tag, $optional) = @_;
-
-    return [ -1 ]
-       if ($cursor->[1] == 0 && $optional);
-
-    die $src, ": ", $cursor->[0], ": ASN.1 data underrun (elem ", $cursor->[1], ")\n"
-       if ($cursor->[1] < 2);
-
-    my ($tag, $len) = unpack("CC", substr(${$cursor->[2]}, $cursor->[0], 2));
-
-    if ($expected_tag != -1 && $tag != $expected_tag) {
-       return [ -1 ]
-           if ($optional);
-       die $src, ": ", $cursor->[0], ": ASN.1 unexpected tag (", $tag,
-       " not ", $expected_tag, ")\n";
-    }
-
-    $cursor->[0] += 2;
-    $cursor->[1] -= 2;
-
-    die $src, ": ", $cursor->[0], ": ASN.1 long tag\n"
-       if (($tag & 0x1f) == 0x1f);
-    die $src, ": ", $cursor->[0], ": ASN.1 indefinite length\n"
-       if ($len == 0x80);
-
-    if ($len > 0x80) {
-       my $l = $len - 0x80;
-       die $src, ": ", $cursor->[0], ": ASN.1 data underrun (len len $l)\n"
-           if ($cursor->[1] < $l);
-
-       if ($l == 0x1) {
-           $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1));
-       } elsif ($l = 0x2) {
-           $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0], 2));
-       } elsif ($l = 0x3) {
-           $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1)) << 16;
-           $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0] + 1, 2));
-       } elsif ($l = 0x4) {
-           $len = unpack("N", substr(${$cursor->[2]}, $cursor->[0], 4));
-       } else {
-           die $src, ": ", $cursor->[0], ": ASN.1 element too long (", $l, ")\n";
-       }
-
-       $cursor->[0] += $l;
-       $cursor->[1] -= $l;
-    }
-
-    die $src, ": ", $cursor->[0], ": ASN.1 data underrun (", $len, ")\n"
-       if ($cursor->[1] < $len);
-
-    my $ret = [ $tag, [ $cursor->[0], $len, $cursor->[2] ] ];
-    $cursor->[0] += $len;
-    $cursor->[1] -= $len;
-
-    return $ret;
-}
-
-###############################################################################
-#
-# Retrieve the data referred to by a cursor
-#
-###############################################################################
-sub asn1_retrieve($)
-{
-    my ($cursor) = @_;
-    my ($offset, $len, $data) = @$cursor;
-    return substr($$data, $offset, $len);
-}
-
-###############################################################################
-#
-# Roughly parse the X.509 certificate
-#
-###############################################################################
-my $cursor = [ 0, length($raw_data), \$raw_data ];
-
-my $cert = asn1_extract($cursor, $UNIV | $CONS | $SEQUENCE);
-my $tbs = asn1_extract($cert->[1], $UNIV | $CONS | $SEQUENCE);
-my $version = asn1_extract($tbs->[1], $CONT | $CONS | 0, 1);
-my $serial_number = asn1_extract($tbs->[1], $UNIV | $INTEGER);
-my $sig_type = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
-my $issuer = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
-my $validity = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
-my $subject = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
-my $key = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
-my $issuer_uid = asn1_extract($tbs->[1], $CONT | $CONS | 1, 1);
-my $subject_uid = asn1_extract($tbs->[1], $CONT | $CONS | 2, 1);
-my $extension_list = asn1_extract($tbs->[1], $CONT | $CONS | 3, 1);
-
-my $subject_key_id = ();
-my $authority_key_id = ();
-
-#
-# Parse the extension list
-#
-if ($extension_list->[0] != -1) {
-    my $extensions = asn1_extract($extension_list->[1], $UNIV | $CONS | $SEQUENCE);
-
-    while ($extensions->[1]->[1] > 0) {
-       my $ext = asn1_extract($extensions->[1], $UNIV | $CONS | $SEQUENCE);
-       my $x_oid = asn1_extract($ext->[1], $UNIV | $OBJ_ID);
-       my $x_crit = asn1_extract($ext->[1], $UNIV | $BOOLEAN, 1);
-       my $x_val = asn1_extract($ext->[1], $UNIV | $OCTET_STRING);
-
-       my $raw_oid = asn1_retrieve($x_oid->[1]);
-       next if (!exists($OIDs{$raw_oid}));
-       my $x_type = $OIDs{$raw_oid};
-
-       my $raw_value = asn1_retrieve($x_val->[1]);
-
-       if ($x_type eq "subjectKeyIdentifier") {
-           my $vcursor = [ 0, length($raw_value), \$raw_value ];
-
-           $subject_key_id = asn1_extract($vcursor, $UNIV | $OCTET_STRING);
-       }
-    }
-}
-
-###############################################################################
-#
-# Determine what we're going to use as the signer's name.  In order of
-# preference, take one of: commonName, organizationName or emailAddress.
-#
-###############################################################################
-my $org = "";
-my $cn = "";
-my $email = "";
-
-while ($subject->[1]->[1] > 0) {
-    my $rdn = asn1_extract($subject->[1], $UNIV | $CONS | $SET);
-    my $attr = asn1_extract($rdn->[1], $UNIV | $CONS | $SEQUENCE);
-    my $n_oid = asn1_extract($attr->[1], $UNIV | $OBJ_ID);
-    my $n_val = asn1_extract($attr->[1], -1);
-
-    my $raw_oid = asn1_retrieve($n_oid->[1]);
-    next if (!exists($OIDs{$raw_oid}));
-    my $n_type = $OIDs{$raw_oid};
-
-    my $raw_value = asn1_retrieve($n_val->[1]);
-
-    if ($n_type eq "organizationName") {
-       $org = $raw_value;
-    } elsif ($n_type eq "commonName") {
-       $cn = $raw_value;
-    } elsif ($n_type eq "emailAddress") {
-       $email = $raw_value;
-    }
-}
-
-my $id_name = $email;
-
-if ($org && $cn) {
-    # Don't use the organizationName if the commonName repeats it
-    if (length($org) <= length($cn) &&
-       substr($cn, 0, length($org)) eq $org) {
-       $id_name = $cn;
-       goto got_id_name;
-    }
-
-    # Or a signifcant chunk of it
-    if (length($org) >= 7 &&
-       length($cn) >= 7 &&
-       substr($cn, 0, 7) eq substr($org, 0, 7)) {
-       $id_name = $cn;
-       goto got_id_name;
-    }
-
-    $id_name = $org . ": " . $cn;
-} elsif ($org) {
-    $id_name = $org;
-} elsif ($cn) {
-    $id_name = $cn;
-}
-
-got_id_name:
-
-###############################################################################
-#
-# Output the signer's name and the key identifier that we're going to include
-# in module signatures.
-#
-###############################################################################
-die $src, ": ", "X.509: Couldn't find the Subject Key Identifier extension\n"
-    if (!$subject_key_id);
-
-my $id_key_id = asn1_retrieve($subject_key_id->[1]);
-
-open(OUTFD, ">$ARGV[1]") || die $ARGV[1];
-print OUTFD $id_name;
-close OUTFD || die $ARGV[1];
-
-open(OUTFD, ">$ARGV[2]") || die $ARGV[2];
-print OUTFD $id_key_id;
-close OUTFD || die $ARGV[2];
index 7b3021cebbea3f2cf68d8cc3ed833459a626e153..5706b74c857f550a2515dc445164063154a12cac 100644 (file)
@@ -57,7 +57,7 @@ cmd_make-rlim = echo "static const char *const rlim_names[RLIM_NLIMITS] = {" \
 
 $(obj)/capability.o : $(obj)/capability_names.h
 $(obj)/resource.o : $(obj)/rlim_names.h
-$(obj)/capability_names.h : $(srctree)/include/linux/capability.h \
+$(obj)/capability_names.h : $(srctree)/include/uapi/linux/capability.h \
                            $(src)/Makefile
        $(call cmd,make-caps)
 $(obj)/rlim_names.h : $(srctree)/include/uapi/asm-generic/resource.h \
index 24ab4148547c2ba925042126ca9350a25a9969f8..61a53367d0292600fbb2d11da95c21118164fca4 100644 (file)
@@ -2132,18 +2132,14 @@ static inline void flush_unauthorized_files(const struct cred *cred,
                return;
 
        devnull = dentry_open(&selinux_null, O_RDWR, cred);
-       if (!IS_ERR(devnull)) {
-               /* replace all the matching ones with this */
-               do {
-                       replace_fd(n - 1, get_file(devnull), 0);
-               } while ((n = iterate_fd(files, n, match_file, cred)) != 0);
+       if (IS_ERR(devnull))
+               devnull = NULL;
+       /* replace all the matching ones with this */
+       do {
+               replace_fd(n - 1, devnull, 0);
+       } while ((n = iterate_fd(files, n, match_file, cred)) != 0);
+       if (devnull)
                fput(devnull);
-       } else {
-               /* just close all the matching ones */
-               do {
-                       replace_fd(n - 1, NULL, 0);
-               } while ((n = iterate_fd(files, n, match_file, cred)) != 0);
-       }
 }
 
 /*
index 9473fca9681dd7e291595501a6270c47793aa3bc..8b0f996883034c4b99b4823ea7a6f01b6d064587 100644 (file)
@@ -1271,6 +1271,8 @@ static int snd_ac97_cvol_new(struct snd_card *card, char *name, int reg, unsigne
                tmp.index = ac97->num;
                kctl = snd_ctl_new1(&tmp, ac97);
        }
+       if (!kctl)
+               return -ENOMEM;
        if (reg >= AC97_PHONE && reg <= AC97_PCM)
                set_tlv_db_scale(kctl, db_scale_5bit_12db_max);
        else
index bed4485f34f61fa7b90cfaa6bc5a3da3b9e55150..c21adb6ef1d5d5b642c375febb1274e40b0cc9df 100644 (file)
@@ -1416,6 +1416,15 @@ static struct snd_emu_chip_details emu_chip_details[] = {
         .ca0108_chip = 1,
         .spk71 = 1,
         .emu_model = EMU_MODEL_EMU1010B}, /* EMU 1010 new revision */
+       /* Tested by Maxim Kachur <mcdebugger@duganet.ru> 17th Oct 2012. */
+       /* This is MAEM8986, 0202 is MAEM8980 */
+       {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40071102,
+        .driver = "Audigy2", .name = "E-mu 1010 PCIe [MAEM8986]",
+        .id = "EMU1010",
+        .emu10k2_chip = 1,
+        .ca0108_chip = 1,
+        .spk71 = 1,
+        .emu_model = EMU_MODEL_EMU1010B}, /* EMU 1010 PCIe */
        /* Tested by James@superbug.co.uk 8th July 2005. */
        /* This is MAEM8810, 0202 is MAEM8820 */
        {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40011102,
index 6833835a218b9f581a58c5c0b3fe6aa36d8df51d..72b085ae7d469e14559267558e515a578e3142dd 100644 (file)
@@ -501,6 +501,7 @@ struct azx {
 
        /* VGA-switcheroo setup */
        unsigned int use_vga_switcheroo:1;
+       unsigned int vga_switcheroo_registered:1;
        unsigned int init_failed:1; /* delayed init failed */
        unsigned int disabled:1; /* disabled by VGA-switcher */
 
@@ -2157,9 +2158,12 @@ static unsigned int azx_get_position(struct azx *chip,
                if (delay < 0)
                        delay += azx_dev->bufsize;
                if (delay >= azx_dev->period_bytes) {
-                       snd_printdd("delay %d > period_bytes %d\n",
-                               delay, azx_dev->period_bytes);
-                       delay = 0; /* something is wrong */
+                       snd_printk(KERN_WARNING SFX
+                                  "Unstable LPIB (%d >= %d); "
+                                  "disabling LPIB delay counting\n",
+                                  delay, azx_dev->period_bytes);
+                       delay = 0;
+                       chip->driver_caps &= ~AZX_DCAPS_COUNT_LPIB_DELAY;
                }
                azx_dev->substream->runtime->delay =
                        bytes_to_frames(azx_dev->substream->runtime, delay);
@@ -2640,7 +2644,9 @@ static void azx_vs_set_state(struct pci_dev *pci,
                if (disabled) {
                        azx_suspend(&pci->dev);
                        chip->disabled = true;
-                       snd_hda_lock_devices(chip->bus);
+                       if (snd_hda_lock_devices(chip->bus))
+                               snd_printk(KERN_WARNING SFX
+                                          "Cannot lock devices!\n");
                } else {
                        snd_hda_unlock_devices(chip->bus);
                        chip->disabled = false;
@@ -2683,14 +2689,20 @@ static const struct vga_switcheroo_client_ops azx_vs_ops = {
 
 static int __devinit register_vga_switcheroo(struct azx *chip)
 {
+       int err;
+
        if (!chip->use_vga_switcheroo)
                return 0;
        /* FIXME: currently only handling DIS controller
         * is there any machine with two switchable HDMI audio controllers?
         */
-       return vga_switcheroo_register_audio_client(chip->pci, &azx_vs_ops,
+       err = vga_switcheroo_register_audio_client(chip->pci, &azx_vs_ops,
                                                    VGA_SWITCHEROO_DIS,
                                                    chip->bus != NULL);
+       if (err < 0)
+               return err;
+       chip->vga_switcheroo_registered = 1;
+       return 0;
 }
 #else
 #define init_vga_switcheroo(chip)              /* NOP */
@@ -2712,7 +2724,8 @@ static int azx_free(struct azx *chip)
        if (use_vga_switcheroo(chip)) {
                if (chip->disabled && chip->bus)
                        snd_hda_unlock_devices(chip->bus);
-               vga_switcheroo_unregister_client(chip->pci);
+               if (chip->vga_switcheroo_registered)
+                       vga_switcheroo_unregister_client(chip->pci);
        }
 
        if (chip->initialized) {
@@ -2813,8 +2826,6 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = {
        SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
        SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB),
        SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB),
-       SND_PCI_QUIRK(0x1043, 0x1ac3, "ASUS X53S", POS_FIX_POSBUF),
-       SND_PCI_QUIRK(0x1043, 0x1b43, "ASUS K53E", POS_FIX_POSBUF),
        SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB),
        SND_PCI_QUIRK(0x10de, 0xcb89, "Macbook Pro 7,1", POS_FIX_LPIB),
        SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB),
@@ -3062,14 +3073,6 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
        }
 
  ok:
-       err = register_vga_switcheroo(chip);
-       if (err < 0) {
-               snd_printk(KERN_ERR SFX
-                          "Error registering VGA-switcheroo client\n");
-               azx_free(chip);
-               return err;
-       }
-
        err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
        if (err < 0) {
                snd_printk(KERN_ERR SFX "Error creating device [card]!\n");
@@ -3340,6 +3343,13 @@ static int __devinit azx_probe(struct pci_dev *pci,
        if (pci_dev_run_wake(pci))
                pm_runtime_put_noidle(&pci->dev);
 
+       err = register_vga_switcheroo(chip);
+       if (err < 0) {
+               snd_printk(KERN_ERR SFX
+                          "Error registering VGA-switcheroo client\n");
+               goto out_free;
+       }
+
        dev++;
        return 0;
 
index 8253b4eeb6a1bea0687675e8ac66ca41b9a84758..48d9d609f89b06bca17210b8ca9dfaec2a600c1d 100644 (file)
@@ -2598,8 +2598,10 @@ static const char *alc_get_line_out_pfx(struct alc_spec *spec, int ch,
                        return "PCM";
                break;
        }
-       if (snd_BUG_ON(ch >= ARRAY_SIZE(channel_name)))
+       if (ch >= ARRAY_SIZE(channel_name)) {
+               snd_BUG();
                return "PCM";
+       }
 
        return channel_name[ch];
 }
index bcbf1d00aa858ef62fc11d4767c0cb3b4f270eb3..99f32f7c0692713f90ca1d917dd23103bcebc601 100644 (file)
@@ -1,8 +1,9 @@
 snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o
 snd-soc-core-objs += soc-pcm.o soc-compress.o soc-io.o
 
-snd-soc-dmaengine-pcm-objs := soc-dmaengine-pcm.o
-obj-$(CONFIG_SND_SOC_DMAENGINE_PCM) += snd-soc-dmaengine-pcm.o
+ifneq ($(CONFIG_SND_SOC_DMAENGINE_PCM),)
+snd-soc-core-objs += soc-dmaengine-pcm.o
+endif
 
 obj-$(CONFIG_SND_SOC)  += snd-soc-core.o
 obj-$(CONFIG_SND_SOC)  += codecs/
index 185d8dd36399ef28ada474fac14823fc1f67065c..f379b085c39204dfeb2a6fc34d7c07d9f15c9f0b 100644 (file)
 #define DA9055_AIF_WORD_S24_LE         (2 << 2)
 #define DA9055_AIF_WORD_S32_LE         (3 << 2)
 
+/* MIC_L_CTRL bit fields */
+#define DA9055_MIC_L_MUTE_EN           (1 << 6)
+
+/* MIC_R_CTRL bit fields */
+#define DA9055_MIC_R_MUTE_EN           (1 << 6)
+
 /* MIXIN_L_CTRL bit fields */
 #define DA9055_MIXIN_L_MIX_EN          (1 << 3)
 
@@ -476,7 +482,7 @@ static int da9055_put_alc_sw(struct snd_kcontrol *kcontrol,
                             struct snd_ctl_elem_value *ucontrol)
 {
        struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
-       u8 reg_val, adc_left, adc_right;
+       u8 reg_val, adc_left, adc_right, mic_left, mic_right;
        int avg_left_data, avg_right_data, offset_l, offset_r;
 
        if (ucontrol->value.integer.value[0]) {
@@ -485,6 +491,16 @@ static int da9055_put_alc_sw(struct snd_kcontrol *kcontrol,
                 * offsets must be done first
                 */
 
+               /* Save current values from Mic control registers */
+               mic_left = snd_soc_read(codec, DA9055_MIC_L_CTRL);
+               mic_right = snd_soc_read(codec, DA9055_MIC_R_CTRL);
+
+               /* Mute Mic PGA Left and Right */
+               snd_soc_update_bits(codec, DA9055_MIC_L_CTRL,
+                                   DA9055_MIC_L_MUTE_EN, DA9055_MIC_L_MUTE_EN);
+               snd_soc_update_bits(codec, DA9055_MIC_R_CTRL,
+                                   DA9055_MIC_R_MUTE_EN, DA9055_MIC_R_MUTE_EN);
+
                /* Save current values from ADC control registers */
                adc_left = snd_soc_read(codec, DA9055_ADC_L_CTRL);
                adc_right = snd_soc_read(codec, DA9055_ADC_R_CTRL);
@@ -520,6 +536,10 @@ static int da9055_put_alc_sw(struct snd_kcontrol *kcontrol,
                /* Restore original values of ADC control registers */
                snd_soc_write(codec, DA9055_ADC_L_CTRL, adc_left);
                snd_soc_write(codec, DA9055_ADC_R_CTRL, adc_right);
+
+               /* Restore original values of Mic control registers */
+               snd_soc_write(codec, DA9055_MIC_L_CTRL, mic_left);
+               snd_soc_write(codec, DA9055_MIC_R_CTRL, mic_right);
        }
 
        return snd_soc_put_volsw(kcontrol, ucontrol);
index e8f97af75928ea3548c0d389f9e70d7f676ba2c3..00b85cc1b9a3508f8db9a677bac90d4e2af50038 100644 (file)
@@ -820,10 +820,10 @@ static const struct snd_soc_dapm_route intercon[] = {
        {"VIBRA DAC", NULL, "Vibra Playback"},
 
        /* ADC -> Stream mapping */
-       {"ADC Left", NULL, "Legacy Capture"},
-       {"ADC Left", NULL, "Capture"},
-       {"ADC Right", NULL, "Legacy Capture"},
-       {"ADC Right", NULL, "Capture"},
+       {"Legacy Capture" , NULL, "ADC Left"},
+       {"Capture", NULL, "ADC Left"},
+       {"Legacy Capture", NULL, "ADC Right"},
+       {"Capture" , NULL, "ADC Right"},
 
        /* Capture path */
        {"Analog Left Capture Route", "Headset Mic", "HSMIC"},
index efa93dbb01915a2112582e2c0a4f939bb96ff643..eab64a193989ac2917773a4df7613cbf644dd58f 100644 (file)
@@ -1028,7 +1028,7 @@ SOC_DOUBLE_R_TLV("OUT2 Digital Volume", WM2200_DAC_DIGITAL_VOLUME_2L,
                 WM2200_DAC_DIGITAL_VOLUME_2R, WM2200_OUT2L_VOL_SHIFT, 0x9f, 0,
                 digital_tlv),
 SOC_DOUBLE("OUT2 Switch", WM2200_PDM_1, WM2200_SPK1L_MUTE_SHIFT,
-          WM2200_SPK1R_MUTE_SHIFT, 1, 0),
+          WM2200_SPK1R_MUTE_SHIFT, 1, 1),
 };
 
 WM2200_MIXER_ENUMS(OUT1L, WM2200_OUT1LMIX_INPUT_1_SOURCE);
@@ -2091,6 +2091,7 @@ static __devinit int wm2200_i2c_probe(struct i2c_client *i2c,
 
        switch (wm2200->rev) {
        case 0:
+       case 1:
                ret = regmap_register_patch(wm2200->regmap, wm2200_reva_patch,
                                            ARRAY_SIZE(wm2200_reva_patch));
                if (ret != 0) {
index dc0ee76266261c998ec58a0f433dea92272767b3..d8e96b2cd03ec201306ceaebf3962531f48f0cac 100644 (file)
@@ -575,56 +575,53 @@ static struct snd_soc_card ams_delta_audio_card = {
 };
 
 /* Module init/exit */
-static struct platform_device *ams_delta_audio_platform_device;
-static struct platform_device *cx20442_platform_device;
-
-static int __init ams_delta_module_init(void)
+static __devinit int ams_delta_probe(struct platform_device *pdev)
 {
+       struct snd_soc_card *card = &ams_delta_audio_card;
        int ret;
 
-       if (!(machine_is_ams_delta()))
-               return -ENODEV;
-
-       ams_delta_audio_platform_device =
-                       platform_device_alloc("soc-audio", -1);
-       if (!ams_delta_audio_platform_device)
-               return -ENOMEM;
+       card->dev = &pdev->dev;
 
-       platform_set_drvdata(ams_delta_audio_platform_device,
-                               &ams_delta_audio_card);
-
-       ret = platform_device_add(ams_delta_audio_platform_device);
-       if (ret)
-               goto err;
-
-       /*
-        * Codec platform device could be registered from elsewhere (board?),
-        * but I do it here as it makes sense only if used with the card.
-        */
-       cx20442_platform_device =
-               platform_device_register_simple("cx20442-codec", -1, NULL, 0);
+       ret = snd_soc_register_card(card);
+       if (ret) {
+               dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
+               card->dev = NULL;
+               return ret;
+       }
        return 0;
-err:
-       platform_device_put(ams_delta_audio_platform_device);
-       return ret;
 }
-late_initcall(ams_delta_module_init);
 
-static void __exit ams_delta_module_exit(void)
+static int __devexit ams_delta_remove(struct platform_device *pdev)
 {
+       struct snd_soc_card *card = platform_get_drvdata(pdev);
+
        if (tty_unregister_ldisc(N_V253) != 0)
-               dev_warn(&ams_delta_audio_platform_device->dev,
+               dev_warn(&pdev->dev,
                        "failed to unregister V253 line discipline\n");
 
        snd_soc_jack_free_gpios(&ams_delta_hook_switch,
                        ARRAY_SIZE(ams_delta_hook_switch_gpios),
                        ams_delta_hook_switch_gpios);
 
-       platform_device_unregister(cx20442_platform_device);
-       platform_device_unregister(ams_delta_audio_platform_device);
+       snd_soc_unregister_card(card);
+       card->dev = NULL;
+       return 0;
 }
-module_exit(ams_delta_module_exit);
+
+#define DRV_NAME "ams-delta-audio"
+
+static struct platform_driver ams_delta_driver = {
+       .driver = {
+               .name = DRV_NAME,
+               .owner = THIS_MODULE,
+       },
+       .probe = ams_delta_probe,
+       .remove = __devexit_p(ams_delta_remove),
+};
+
+module_platform_driver(ams_delta_driver);
 
 MODULE_AUTHOR("Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>");
 MODULE_DESCRIPTION("ALSA SoC driver for Amstrad E3 (Delta) videophone");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:" DRV_NAME);
index 4a73ef3ae12fdb35bced35e444f45b2eb144275c..a57a4e68dcc6166a2161b49b1d21ab7a8e49dc87 100644 (file)
@@ -216,7 +216,7 @@ static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
        twl6040_disconnect_pin(dapm, pdata->has_hf, "Ext Spk");
        twl6040_disconnect_pin(dapm, pdata->has_ep, "Earphone Spk");
        twl6040_disconnect_pin(dapm, pdata->has_aux, "Line Out");
-       twl6040_disconnect_pin(dapm, pdata->has_vibra, "Vinrator");
+       twl6040_disconnect_pin(dapm, pdata->has_vibra, "Vibrator");
        twl6040_disconnect_pin(dapm, pdata->has_hsmic, "Headset Mic");
        twl6040_disconnect_pin(dapm, pdata->has_mainmic, "Main Handset Mic");
        twl6040_disconnect_pin(dapm, pdata->has_submic, "Sub Handset Mic");
index c02b001ee4b51816235147ddb420186c525ecd43..56965bb3275ccd5c2fea1dc3fe143e3e3e7b622d 100644 (file)
@@ -40,7 +40,6 @@
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
 
-#include <plat/omap_hwmod.h>
 #include "omap-mcpdm.h"
 #include "omap-pcm.h"
 
@@ -260,13 +259,9 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream,
        mutex_lock(&mcpdm->mutex);
 
        if (!dai->active) {
-               /* Enable watch dog for ES above ES 1.0 to avoid saturation */
-               if (omap_rev() != OMAP4430_REV_ES1_0) {
-                       u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
+               u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
 
-                       omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL,
-                                        ctrl | MCPDM_WD_EN);
-               }
+               omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, ctrl | MCPDM_WD_EN);
                omap_mcpdm_open_streams(mcpdm);
        }
        mutex_unlock(&mcpdm->mutex);
index 340874ebf9ae79cb550cbfe54e81850802448e16..52977aa303554d54113530805e421f450db68e33 100644 (file)
 #include <sound/dmaengine_pcm.h>
 #include <sound/soc.h>
 
-#include <plat/cpu.h>
 #include "omap-pcm.h"
 
+#ifdef CONFIG_ARCH_OMAP1
+#define pcm_omap1510() cpu_is_omap1510()
+#else
+#define pcm_omap1510() 0
+#endif
+
 static const struct snd_pcm_hardware omap_pcm_hardware = {
        .info                   = SNDRV_PCM_INFO_MMAP |
                                  SNDRV_PCM_INFO_MMAP_VALID |
@@ -159,7 +164,7 @@ static snd_pcm_uframes_t omap_pcm_pointer(struct snd_pcm_substream *substream)
 {
        snd_pcm_uframes_t offset;
 
-       if (cpu_is_omap1510())
+       if (pcm_omap1510())
                offset = snd_dmaengine_pcm_pointer_no_residue(substream);
        else
                offset = snd_dmaengine_pcm_pointer(substream);
index 73ac5463c9e49efdee1dea93704e30438d1c7c37..e834faf859fdcf91e5c1889b1975b2fff357e206 100644 (file)
 #include <linux/slab.h>
 #include <linux/dma-mapping.h>
 #include <linux/dmaengine.h>
+#include <linux/platform_data/dma-mmp_tdma.h>
 #include <linux/platform_data/mmp_audio.h>
 #include <sound/pxa2xx-lib.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
-#include <mach/sram.h>
 #include <sound/dmaengine_pcm.h>
 
 struct mmp_dma_data {
index 5dc10dfc0d421e1f5722f53def90f868598efc8c..b0d46d63d55ea784f2f6970cd77bd2915a1c32fa 100644 (file)
@@ -212,7 +212,7 @@ static struct snd_soc_dai_link bells_dai_wm5102[] = {
        {
                .name = "Sub",
                .stream_name = "Sub",
-               .cpu_dai_name = "wm5102-aif3",
+               .cpu_dai_name = "wm5110-aif3",
                .codec_dai_name = "wm9081-hifi",
                .codec_name = "wm9081.1-006c",
                .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
@@ -247,7 +247,7 @@ static struct snd_soc_dai_link bells_dai_wm5110[] = {
        {
                .name = "Sub",
                .stream_name = "Sub",
-               .cpu_dai_name = "wm5102-aif3",
+               .cpu_dai_name = "wm5110-aif3",
                .codec_dai_name = "wm9081-hifi",
                .codec_name = "wm9081.1-006c",
                .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
index 5328ae5539f16e67571566f313a5d9689f79cac5..9d7f30774a44d9524cb71f6697fc0ce96825295c 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/sh_dma.h>
 #include <linux/slab.h>
 #include <linux/module.h>
+#include <linux/workqueue.h>
 #include <sound/soc.h>
 #include <sound/sh_fsi.h>
 
@@ -223,7 +224,7 @@ struct fsi_stream {
         */
        struct dma_chan         *chan;
        struct sh_dmae_slave    slave; /* see fsi_handler_init() */
-       struct tasklet_struct   tasklet;
+       struct work_struct      work;
        dma_addr_t              dma;
 };
 
@@ -1085,9 +1086,9 @@ static void fsi_dma_complete(void *data)
        snd_pcm_period_elapsed(io->substream);
 }
 
-static void fsi_dma_do_tasklet(unsigned long data)
+static void fsi_dma_do_work(struct work_struct *work)
 {
-       struct fsi_stream *io = (struct fsi_stream *)data;
+       struct fsi_stream *io = container_of(work, struct fsi_stream, work);
        struct fsi_priv *fsi = fsi_stream_to_priv(io);
        struct snd_soc_dai *dai;
        struct dma_async_tx_descriptor *desc;
@@ -1129,7 +1130,7 @@ static void fsi_dma_do_tasklet(unsigned long data)
         * FIXME
         *
         * In DMAEngine case, codec and FSI cannot be started simultaneously
-        * since FSI is using tasklet.
+        * since FSI is using the scheduler work queue.
         * Therefore, in capture case, probably FSI FIFO will have got
         * overflow error in this point.
         * in that case, DMA cannot start transfer until error was cleared.
@@ -1153,7 +1154,7 @@ static bool fsi_dma_filter(struct dma_chan *chan, void *param)
 
 static int fsi_dma_transfer(struct fsi_priv *fsi, struct fsi_stream *io)
 {
-       tasklet_schedule(&io->tasklet);
+       schedule_work(&io->work);
 
        return 0;
 }
@@ -1195,14 +1196,14 @@ static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io, struct dev
                return fsi_stream_probe(fsi, dev);
        }
 
-       tasklet_init(&io->tasklet, fsi_dma_do_tasklet, (unsigned long)io);
+       INIT_WORK(&io->work, fsi_dma_do_work);
 
        return 0;
 }
 
 static int fsi_dma_remove(struct fsi_priv *fsi, struct fsi_stream *io)
 {
-       tasklet_kill(&io->tasklet);
+       cancel_work_sync(&io->work);
 
        fsi_stream_stop(fsi, io);
 
index fa0fd8ddae90fc17f280543c9399741c9a33038b..1ab5fe04bfccb066853fc664d9db9bea68a9f8ce 100644 (file)
@@ -22,7 +22,7 @@
 
 /**
  * snd_soc_jack_new - Create a new jack
- * @card:  ASoC card
+ * @codec: ASoC codec
  * @id:    an identifying string for this jack
  * @type:  a bitmask of enum snd_jack_type values that can be detected by
  *         this jack
@@ -133,12 +133,13 @@ EXPORT_SYMBOL_GPL(snd_soc_jack_add_zones);
 
 /**
  * snd_soc_jack_get_type - Based on the mic bias value, this function returns
- * the type of jack from the zones delcared in the jack type
+ * the type of jack from the zones declared in the jack type
  *
+ * @jack:  ASoC jack
  * @micbias_voltage:  mic bias voltage at adc channel when jack is plugged in
  *
  * Based on the mic bias value passed, this function helps identify
- * the type of jack from the already delcared jack zones
+ * the type of jack from the already declared jack zones
  */
 int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage)
 {
index 47264b4652b990f3d237531607060f94036ad7cf..f2989c525e48a6865729cff8962fca28d39532fc 100644 (file)
@@ -2602,6 +2602,9 @@ find_func_handler(struct pevent *pevent, char *func_name)
 {
        struct pevent_function_handler *func;
 
+       if (!pevent)
+               return NULL;
+
        for (func = pevent->func_handlers; func; func = func->next) {
                if (strcmp(func->name, func_name) == 0)
                        break;
@@ -4938,6 +4941,9 @@ enum pevent_errno __pevent_parse_format(struct event_format **eventp,
                goto event_alloc_failed;
        }
 
+       /* Add pevent to event so that it can be referenced */
+       event->pevent = pevent;
+
        ret = event_read_format(event);
        if (ret < 0) {
                ret = PEVENT_ERRNO__READ_FORMAT_FAILED;
@@ -5041,9 +5047,6 @@ enum pevent_errno pevent_parse_event(struct pevent *pevent, const char *buf,
        if (event == NULL)
                return ret;
 
-       /* Add pevent to event so that it can be referenced */
-       event->pevent = pevent;
-
        if (add_event(pevent, event)) {
                ret = PEVENT_ERRNO__MEM_ALLOC_FAILED;
                goto event_add_failed;
index ad17855528f9adaa82cb37b0e6a8fe7ede2ed755..5ea4326ad11f5d16901d49ff68ddc36648671bf4 100644 (file)
@@ -209,7 +209,16 @@ static void free_arg(struct filter_arg *arg)
        switch (arg->type) {
        case FILTER_ARG_NONE:
        case FILTER_ARG_BOOLEAN:
+               break;
+
        case FILTER_ARG_NUM:
+               free_arg(arg->num.left);
+               free_arg(arg->num.right);
+               break;
+
+       case FILTER_ARG_EXP:
+               free_arg(arg->exp.left);
+               free_arg(arg->exp.right);
                break;
 
        case FILTER_ARG_STR:
@@ -218,6 +227,12 @@ static void free_arg(struct filter_arg *arg)
                free(arg->str.buffer);
                break;
 
+       case FILTER_ARG_VALUE:
+               if (arg->value.type == FILTER_STRING ||
+                   arg->value.type == FILTER_CHAR)
+                       free(arg->value.str);
+               break;
+
        case FILTER_ARG_OP:
                free_arg(arg->op.left);
                free_arg(arg->op.right);
index f7c968ad51780760fb5630e35b5091a8b0699826..00deed4d61598c5d40d8c607a0da1f42402cefd6 100644 (file)
@@ -184,9 +184,22 @@ SCRIPT_SH += perf-archive.sh
 grep-libs = $(filter -l%,$(1))
 strip-libs = $(filter-out -l%,$(1))
 
+TRACE_EVENT_DIR = ../lib/traceevent/
+
+ifneq ($(OUTPUT),)
+       TE_PATH=$(OUTPUT)
+else
+       TE_PATH=$(TRACE_EVENT_DIR)
+endif
+
+LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
+TE_LIB := -L$(TE_PATH) -ltraceevent
+
 PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
 PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py
 
+export LIBTRACEEVENT
+
 $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
        $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \
          --quiet build_ext; \
@@ -198,17 +211,6 @@ $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
 
 SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
 
-TRACE_EVENT_DIR = ../lib/traceevent/
-
-ifneq ($(OUTPUT),)
-       TE_PATH=$(OUTPUT)
-else
-       TE_PATH=$(TRACE_EVENT_DIR)
-endif
-
-LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
-TE_LIB := -L$(TE_PATH) -ltraceevent
-
 #
 # Single 'perf' binary right now:
 #
index 276287783a03759af243ff3d55c3b848cd357d3f..c50985eaec41f479d2593dab749d061d3cb03c3d 100644 (file)
@@ -57,7 +57,7 @@ void get_term_dimensions(struct winsize *ws);
 #endif
 
 #ifdef __sparc__
-#include "../../arch/sparc/include/asm/unistd.h"
+#include "../../arch/sparc/include/uapi/asm/unistd.h"
 #define rmb()          asm volatile("":::"memory")
 #define cpu_relax()    asm volatile("":::"memory")
 #define CPUINFO_PROC   "cpu"
index 0568536ecf674fd3ce7e1b397e900a9fd515edcf..ef2f93ca7496d677592255d3bfaf91ed9ebb7c58 100644 (file)
@@ -610,6 +610,7 @@ static int hist_browser__show_entry(struct hist_browser *browser,
        char folded_sign = ' ';
        bool current_entry = ui_browser__is_current_entry(&browser->b, row);
        off_t row_offset = entry->row_offset;
+       bool first = true;
 
        if (current_entry) {
                browser->he_selection = entry;
@@ -633,10 +634,11 @@ static int hist_browser__show_entry(struct hist_browser *browser,
                        if (!perf_hpp__format[i].cond)
                                continue;
 
-                       if (i) {
+                       if (!first) {
                                slsmg_printf("  ");
                                width -= 2;
                        }
+                       first = false;
 
                        if (perf_hpp__format[i].color) {
                                hpp.ptr = &percent;
@@ -645,7 +647,7 @@ static int hist_browser__show_entry(struct hist_browser *browser,
 
                                ui_browser__set_percent_color(&browser->b, percent, current_entry);
 
-                               if (i == 0 && symbol_conf.use_callchain) {
+                               if (i == PERF_HPP__OVERHEAD && symbol_conf.use_callchain) {
                                        slsmg_printf("%c ", folded_sign);
                                        width -= 2;
                                }
index aed38e4b9dfaf143020d3502c56a913acf9b0bb4..75c7b0fca6d96baadc7b084c84a73d3f89ea3273 100644 (file)
@@ -690,6 +690,9 @@ static int get_event_modifier(struct event_modifier *mod, char *str,
                        eH = 0;
                } else if (*str == 'p') {
                        precise++;
+                       /* use of precise requires exclude_guest */
+                       if (!exclude_GH)
+                               eG = 1;
                } else
                        break;
 
index d0f9f29cf181ad98900ebd9fe6baf2a915a32866..73d510269784a9ec1c68e3860f8f15dd24553567 100644 (file)
@@ -23,6 +23,7 @@ cflags += getenv('CFLAGS', '').split()
 
 build_lib = getenv('PYTHON_EXTBUILD_LIB')
 build_tmp = getenv('PYTHON_EXTBUILD_TMP')
+libtraceevent = getenv('LIBTRACEEVENT')
 
 ext_sources = [f.strip() for f in file('util/python-ext-sources')
                                if len(f.strip()) > 0 and f[0] != '#']
@@ -31,6 +32,7 @@ perf = Extension('perf',
                  sources = ext_sources,
                  include_dirs = ['util/include'],
                  extra_compile_args = cflags,
+                 extra_objects = [libtraceevent],
                  )
 
 setup(name='perf',
index b5b1b9211960884efd1a4c707fa8c56910db01f1..cfd1c0feb32d7da84d0b8b73b81883729fa623df 100644 (file)
@@ -260,6 +260,12 @@ static int hist_entry__srcline_snprintf(struct hist_entry *self, char *bf,
        if (path != NULL)
                goto out_path;
 
+       if (!self->ms.map)
+               goto out_ip;
+
+       if (!strncmp(self->ms.map->dso->long_name, "/tmp/perf-", 10))
+               goto out_ip;
+
        snprintf(cmd, sizeof(cmd), "addr2line -e %s %016" PRIx64,
                 self->ms.map->dso->long_name, self->ip);
        fp = popen(cmd, "r");
This page took 0.884747 seconds and 5 git commands to generate.