aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/topology.h3
-rw-r--r--include/asm-arm/arch-at91/at91_ecc.h10
-rw-r--r--include/asm-arm/arch-at91/at91_pmc.h15
-rw-r--r--include/asm-arm/arch-at91/at91_shdwc.h2
-rw-r--r--include/asm-arm/arch-at91/at91cap9_ddrsdr.h100
-rw-r--r--include/asm-arm/arch-at91/at91sam9_sdramc.h (renamed from include/asm-arm/arch-at91/at91sam926x_mc.h)68
-rw-r--r--include/asm-arm/arch-at91/at91sam9_smc.h73
-rw-r--r--include/asm-arm/arch-ep93xx/gpio.h21
-rw-r--r--include/asm-arm/arch-ks8695/devices.h5
-rw-r--r--include/asm-arm/arch-mxc/board-mx31ads.h124
-rw-r--r--include/asm-arm/arch-mxc/dma.h7
-rw-r--r--include/asm-arm/arch-mxc/hardware.h33
-rw-r--r--include/asm-arm/arch-mxc/io.h15
-rw-r--r--include/asm-arm/arch-mxc/irqs.h21
-rw-r--r--include/asm-arm/arch-mxc/memory.h13
-rw-r--r--include/asm-arm/arch-mxc/mx31.h30
-rw-r--r--include/asm-arm/arch-mxc/mxc.h11
-rw-r--r--include/asm-arm/arch-mxc/system.h18
-rw-r--r--include/asm-arm/arch-mxc/vmalloc.h14
-rw-r--r--include/asm-arm/arch-ns9xxx/board.h28
-rw-r--r--include/asm-arm/arch-ns9xxx/clock.h71
-rw-r--r--include/asm-arm/arch-ns9xxx/entry-macro.S6
-rw-r--r--include/asm-arm/arch-ns9xxx/irqs.h67
-rw-r--r--include/asm-arm/arch-ns9xxx/module.h60
-rw-r--r--include/asm-arm/arch-ns9xxx/processor-ns9360.h32
-rw-r--r--include/asm-arm/arch-ns9xxx/processor.h31
-rw-r--r--include/asm-arm/arch-ns9xxx/regs-sys-common.h31
-rw-r--r--include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h (renamed from include/asm-arm/arch-ns9xxx/regs-sys.h)25
-rw-r--r--include/asm-arm/arch-ns9xxx/system.h17
-rw-r--r--include/asm-arm/arch-ns9xxx/uncompress.h143
-rw-r--r--include/asm-arm/arch-omap/board-osk.h11
-rw-r--r--include/asm-arm/arch-omap/clock.h75
-rw-r--r--include/asm-arm/arch-omap/control.h191
-rw-r--r--include/asm-arm/arch-omap/entry-macro.S2
-rw-r--r--include/asm-arm/arch-omap/gpio.h57
-rw-r--r--include/asm-arm/arch-omap/io.h70
-rw-r--r--include/asm-arm/arch-omap/mmc.h2
-rw-r--r--include/asm-arm/arch-omap/mux.h66
-rw-r--r--include/asm-arm/arch-omap/omap24xx.h96
-rw-r--r--include/asm-arm/arch-omap/sdrc.h75
-rw-r--r--include/asm-arm/arch-omap/usb.h5
-rw-r--r--include/asm-arm/arch-orion/io.h27
-rw-r--r--include/asm-arm/arch-orion/irqs.h61
-rw-r--r--include/asm-arm/arch-orion/orion.h165
-rw-r--r--include/asm-arm/arch-orion/timex.h12
-rw-r--r--include/asm-arm/arch-orion5x/debug-macro.S (renamed from include/asm-arm/arch-orion/debug-macro.S)8
-rw-r--r--include/asm-arm/arch-orion5x/dma.h (renamed from include/asm-arm/arch-orion/dma.h)0
-rw-r--r--include/asm-arm/arch-orion5x/entry-macro.S (renamed from include/asm-arm/arch-orion/entry-macro.S)4
-rw-r--r--include/asm-arm/arch-orion5x/gpio.h (renamed from include/asm-arm/arch-orion/gpio.h)8
-rw-r--r--include/asm-arm/arch-orion5x/hardware.h (renamed from include/asm-arm/arch-orion/hardware.h)10
-rw-r--r--include/asm-arm/arch-orion5x/io.h68
-rw-r--r--include/asm-arm/arch-orion5x/irqs.h62
-rw-r--r--include/asm-arm/arch-orion5x/memory.h (renamed from include/asm-arm/arch-orion/memory.h)7
-rw-r--r--include/asm-arm/arch-orion5x/orion5x.h159
-rw-r--r--include/asm-arm/arch-orion5x/system.h (renamed from include/asm-arm/arch-orion/system.h)13
-rw-r--r--include/asm-arm/arch-orion5x/timex.h13
-rw-r--r--include/asm-arm/arch-orion5x/uncompress.h (renamed from include/asm-arm/arch-orion/uncompress.h)8
-rw-r--r--include/asm-arm/arch-orion5x/vmalloc.h (renamed from include/asm-arm/arch-orion/vmalloc.h)2
-rw-r--r--include/asm-arm/arch-pxa/camera.h48
-rw-r--r--include/asm-arm/arch-pxa/gumstix.h96
-rw-r--r--include/asm-arm/arch-pxa/irda.h2
-rw-r--r--include/asm-arm/arch-pxa/irqs.h3
-rw-r--r--include/asm-arm/arch-pxa/magician.h57
-rw-r--r--include/asm-arm/arch-pxa/mfp-pxa25x.h161
-rw-r--r--include/asm-arm/arch-pxa/mfp-pxa27x.h432
-rw-r--r--include/asm-arm/arch-pxa/mfp-pxa2xx.h132
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h330
-rw-r--r--include/asm-arm/arch-pxa/pxa27x_keypad.h2
-rw-r--r--include/asm-arm/arch-pxa/pxa2xx-gpio.h357
-rw-r--r--include/asm-arm/arch-pxa/pxa3xx-regs.h9
-rw-r--r--include/asm-arm/arch-pxa/tosa.h40
-rw-r--r--include/asm-arm/arch-pxa/zylonite.h2
-rw-r--r--include/asm-arm/arch-realview/board-eb.h20
-rw-r--r--include/asm-arm/arch-realview/board-pb1176.h152
-rw-r--r--include/asm-arm/arch-realview/board-pb11mp.h186
-rw-r--r--include/asm-arm/arch-realview/debug-macro.S2
-rw-r--r--include/asm-arm/arch-realview/hardware.h2
-rw-r--r--include/asm-arm/arch-realview/irqs.h2
-rw-r--r--include/asm-arm/arch-realview/platform.h27
-rw-r--r--include/asm-arm/arch-realview/scu.h11
-rw-r--r--include/asm-arm/arch-realview/uncompress.h38
-rw-r--r--include/asm-arm/arch-s3c2410/regs-clock.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpio.h4
-rw-r--r--include/asm-arm/arch-s3c2410/regs-s3c2412-mem.h29
-rw-r--r--include/asm-arm/arch-s3c2410/system-reset.h64
-rw-r--r--include/asm-arm/arch-s3c2410/system.h46
-rw-r--r--include/asm-arm/arch-sa1100/gpio.h31
-rw-r--r--include/asm-arm/cpu-multi32.h4
-rw-r--r--include/asm-arm/glue.h87
-rw-r--r--include/asm-arm/hardware/arm_scu.h15
-rw-r--r--include/asm-arm/hardware/iop3xx-adma.h4
-rw-r--r--include/asm-arm/hardware/iop3xx.h9
-rw-r--r--include/asm-arm/hardware/scoop.h5
-rw-r--r--include/asm-arm/hwcap.h1
-rw-r--r--include/asm-arm/mach/pci.h1
-rw-r--r--include/asm-arm/memory.h3
-rw-r--r--include/asm-arm/plat-orion/ehci-orion.h19
-rw-r--r--include/asm-arm/plat-orion/irq.h17
-rw-r--r--include/asm-arm/plat-orion/orion_nand.h (renamed from include/asm-arm/arch-orion/platform.h)11
-rw-r--r--include/asm-arm/plat-orion/pcie.h31
-rw-r--r--include/asm-arm/plat-orion/time.h17
-rw-r--r--include/asm-arm/sparsemem.h10
-rw-r--r--include/asm-arm/thread_info.h3
-rw-r--r--include/asm-arm/unistd.h4
-rw-r--r--include/asm-avr32/arch-at32ap/board.h9
-rw-r--r--include/asm-avr32/arch-at32ap/pm.h48
-rw-r--r--include/asm-avr32/arch-at32ap/time.h112
-rw-r--r--include/asm-avr32/asm.h8
-rw-r--r--include/asm-avr32/intc.h128
-rw-r--r--include/asm-avr32/irq.h5
-rw-r--r--include/asm-avr32/page.h8
-rw-r--r--include/asm-avr32/serial.h13
-rw-r--r--include/asm-avr32/xor.h6
-rw-r--r--include/asm-blackfin/dma.h1
-rw-r--r--include/asm-frv/system.h5
-rw-r--r--include/asm-frv/topology.h4
-rw-r--r--include/asm-generic/topology.h14
-rw-r--r--include/asm-ia64/sn/nodepda.h1
-rw-r--r--include/asm-ia64/topology.h7
-rw-r--r--include/asm-powerpc/Kbuild2
-rw-r--r--include/asm-powerpc/abs_addr.h3
-rw-r--r--include/asm-powerpc/bitops.h32
-rw-r--r--include/asm-powerpc/cpm.h14
-rw-r--r--include/asm-powerpc/cpm1.h13
-rw-r--r--include/asm-powerpc/cpm2.h11
-rw-r--r--include/asm-powerpc/cputhreads.h2
-rw-r--r--include/asm-powerpc/dcr-native.h17
-rw-r--r--include/asm-powerpc/dcr-regs.h78
-rw-r--r--include/asm-powerpc/exception.h6
-rw-r--r--include/asm-powerpc/fsl_lbc.h311
-rw-r--r--include/asm-powerpc/gpio.h56
-rw-r--r--include/asm-powerpc/hw_irq.h13
-rw-r--r--include/asm-powerpc/immap_qe.h3
-rw-r--r--include/asm-powerpc/irqflags.h37
-rw-r--r--include/asm-powerpc/iseries/alpaca.h31
-rw-r--r--include/asm-powerpc/iseries/it_lp_reg_save.h85
-rw-r--r--include/asm-powerpc/lmb.h82
-rw-r--r--include/asm-powerpc/machdep.h5
-rw-r--r--include/asm-powerpc/macio.h2
-rw-r--r--include/asm-powerpc/mmu-40x.h2
-rw-r--r--include/asm-powerpc/mmu-44x.h2
-rw-r--r--include/asm-powerpc/mmu-8xx.h2
-rw-r--r--include/asm-powerpc/mmu-fsl-booke.h6
-rw-r--r--include/asm-powerpc/mmu-hash32.h2
-rw-r--r--include/asm-powerpc/mmu-hash64.h3
-rw-r--r--include/asm-powerpc/paca.h12
-rw-r--r--include/asm-powerpc/page.h1
-rw-r--r--include/asm-powerpc/page_32.h2
-rw-r--r--include/asm-powerpc/pasemi_dma.h77
-rw-r--r--include/asm-powerpc/pci-bridge.h4
-rw-r--r--include/asm-powerpc/pgtable-ppc32.h8
-rw-r--r--include/asm-powerpc/phyp_dump.h47
-rw-r--r--include/asm-powerpc/pmi.h2
-rw-r--r--include/asm-powerpc/ppc4xx.h18
-rw-r--r--include/asm-powerpc/ps3.h7
-rw-r--r--include/asm-powerpc/ptrace.h9
-rw-r--r--include/asm-powerpc/qe.h12
-rw-r--r--include/asm-powerpc/rwsem.h35
-rw-r--r--include/asm-powerpc/sparsemem.h1
-rw-r--r--include/asm-powerpc/spinlock.h1
-rw-r--r--include/asm-powerpc/string.h2
-rw-r--r--include/asm-powerpc/system.h1
-rw-r--r--include/asm-powerpc/topology.h3
-rw-r--r--include/asm-powerpc/types.h7
-rw-r--r--include/asm-ppc/ocp.h1
-rw-r--r--include/asm-sh/bugs.h2
-rw-r--r--include/asm-sh/cpu-sh4/freq.h6
-rw-r--r--include/asm-sh/cpu-sh4/rtc.h5
-rw-r--r--include/asm-sh/migor.h58
-rw-r--r--include/asm-sh/mpc1211/pci.h2
-rw-r--r--include/asm-sh/processor.h5
-rw-r--r--include/asm-sh/r7780rp.h22
-rw-r--r--include/asm-sh/se7721.h70
-rw-r--r--include/asm-sh/se7722.h2
-rw-r--r--include/asm-sh/sh_keysc.h13
-rw-r--r--include/asm-sh/system.h2
-rw-r--r--include/asm-sh/topology.h2
-rw-r--r--include/asm-sh/uaccess_32.h5
-rw-r--r--include/asm-sparc/Kbuild1
-rw-r--r--include/asm-sparc/a.out-core.h52
-rw-r--r--include/asm-sparc/a.out.h97
-rw-r--r--include/asm-sparc/floppy.h2
-rw-r--r--include/asm-sparc/head.h33
-rw-r--r--include/asm-sparc/ioctls.h2
-rw-r--r--include/asm-sparc/mman.h13
-rw-r--r--include/asm-sparc/namei.h15
-rw-r--r--include/asm-sparc/pconf.h25
-rw-r--r--include/asm-sparc/processor.h3
-rw-r--r--include/asm-sparc/socket.h3
-rw-r--r--include/asm-sparc/solerrno.h132
-rw-r--r--include/asm-sparc/svr4.h119
-rw-r--r--include/asm-sparc/termios.h5
-rw-r--r--include/asm-sparc/user.h56
-rw-r--r--include/asm-sparc64/Kbuild1
-rw-r--r--include/asm-sparc64/a.out-core.h31
-rw-r--r--include/asm-sparc64/a.out.h1
-rw-r--r--include/asm-sparc64/ioctls.h2
-rw-r--r--include/asm-sparc64/lmb.h10
-rw-r--r--include/asm-sparc64/mman.h13
-rw-r--r--include/asm-sparc64/namei.h15
-rw-r--r--include/asm-sparc64/pconf.h25
-rw-r--r--include/asm-sparc64/socket.h3
-rw-r--r--include/asm-sparc64/solerrno.h132
-rw-r--r--include/asm-sparc64/svr4.h120
-rw-r--r--include/asm-sparc64/termios.h5
-rw-r--r--include/asm-sparc64/ttable.h18
-rw-r--r--include/asm-sparc64/unistd.h10
-rw-r--r--include/asm-sparc64/user.h61
-rw-r--r--include/asm-x86/boot.h8
-rw-r--r--include/asm-x86/dma-mapping.h238
-rw-r--r--include/asm-x86/dma-mapping_32.h187
-rw-r--r--include/asm-x86/dma-mapping_64.h202
-rw-r--r--include/asm-x86/e820_32.h2
-rw-r--r--include/asm-x86/genapic_32.h1
-rw-r--r--include/asm-x86/i387.h37
-rw-r--r--include/asm-x86/numa_64.h3
-rw-r--r--include/asm-x86/pci_64.h1
-rw-r--r--include/asm-x86/processor.h16
-rw-r--r--include/asm-x86/scatterlist.h2
-rw-r--r--include/asm-x86/thread_info.h9
-rw-r--r--include/asm-x86/thread_info_32.h2
-rw-r--r--include/asm-x86/thread_info_64.h6
-rw-r--r--include/asm-x86/topology.h22
-rw-r--r--include/asm-x86/tsc.h1
-rw-r--r--include/crypto/aes.h8
-rw-r--r--include/keys/rxrpc-type.h2
-rw-r--r--include/linux/Kbuild4
-rw-r--r--include/linux/aer.h5
-rw-r--r--include/linux/ata_platform.h3
-rw-r--r--include/linux/atmel_tc.h252
-rw-r--r--include/linux/attribute_container.h28
-rw-r--r--include/linux/bio.h2
-rw-r--r--include/linux/bitmap.h1
-rw-r--r--include/linux/blkdev.h9
-rw-r--r--include/linux/bsg.h2
-rw-r--r--include/linux/cdrom.h5
-rw-r--r--include/linux/cpu.h1
-rw-r--r--include/linux/cpumask.h25
-rw-r--r--include/linux/cpuset.h13
-rw-r--r--include/linux/crypto.h7
-rw-r--r--include/linux/device.h37
-rw-r--r--include/linux/dmaengine.h2
-rw-r--r--include/linux/efi.h7
-rw-r--r--include/linux/enclosure.h11
-rw-r--r--include/linux/file.h1
-rw-r--r--include/linux/fs.h54
-rw-r--r--include/linux/hid.h17
-rw-r--r--include/linux/hidraw.h1
-rw-r--r--include/linux/hil_mlc.h2
-rw-r--r--include/linux/hw_random.h10
-rw-r--r--include/linux/i2c/tps65010.h30
-rw-r--r--include/linux/i2o.h2
-rw-r--r--include/linux/ide.h1
-rw-r--r--include/linux/if_pppox.h1
-rw-r--r--include/linux/init_task.h3
-rw-r--r--include/linux/ioport.h5
-rw-r--r--include/linux/irqflags.h6
-rw-r--r--include/linux/iscsi_ibft.h50
-rw-r--r--include/linux/jbd.h2
-rw-r--r--include/linux/jbd2.h2
-rw-r--r--include/linux/jiffies.h18
-rw-r--r--include/linux/kernel.h6
-rw-r--r--include/linux/kernelcapi.h1
-rw-r--r--include/linux/ktime.h6
-rw-r--r--include/linux/leds.h10
-rw-r--r--include/linux/libata.h2
-rw-r--r--include/linux/list.h48
-rw-r--r--include/linux/lmb.h85
-rw-r--r--include/linux/mbus.h36
-rw-r--r--include/linux/memory.h5
-rw-r--r--include/linux/memstick.h2
-rw-r--r--include/linux/mfd/htc-egpio.h57
-rw-r--r--include/linux/mfd/htc-pasic3.h55
-rw-r--r--include/linux/miscdevice.h10
-rw-r--r--include/linux/mmzone.h1
-rw-r--r--include/linux/mount.h11
-rw-r--r--include/linux/of.h1
-rw-r--r--include/linux/of_gpio.h69
-rw-r--r--include/linux/of_i2c.h24
-rw-r--r--include/linux/parport.h2
-rw-r--r--include/linux/pci-aspm.h56
-rw-r--r--include/linux/pci.h30
-rw-r--r--include/linux/pci_regs.h8
-rw-r--r--include/linux/pm.h43
-rw-r--r--include/linux/pm_wakeup.h90
-rw-r--r--include/linux/prctl.h6
-rw-r--r--include/linux/raid/md.h1
-rw-r--r--include/linux/raid_class.h12
-rw-r--r--include/linux/sched.h57
-rw-r--r--include/linux/skbuff.h1
-rw-r--r--include/linux/syscalls.h1
-rw-r--r--include/linux/sysdev.h17
-rw-r--r--include/linux/sysfs.h9
-rw-r--r--include/linux/topology.h46
-rw-r--r--include/linux/transport_class.h6
-rw-r--r--include/linux/udf_fs.h51
-rw-r--r--include/linux/udf_fs_i.h31
-rw-r--r--include/linux/udf_fs_sb.h117
-rw-r--r--include/linux/usb/atmel_usba_udc.h22
-rw-r--r--include/rdma/ib_verbs.h2
-rw-r--r--include/scsi/libsas.h1
-rw-r--r--include/scsi/scsi_device.h10
-rw-r--r--include/scsi/scsi_host.h7
-rw-r--r--include/scsi/scsi_transport.h2
-rw-r--r--include/scsi/scsi_transport_fc.h14
-rw-r--r--include/scsi/scsi_transport_sas.h12
-rw-r--r--include/scsi/sd.h4
307 files changed, 6144 insertions, 3846 deletions
diff --git a/include/asm-alpha/topology.h b/include/asm-alpha/topology.h
index 420ccde6b916..149532e162c4 100644
--- a/include/asm-alpha/topology.h
+++ b/include/asm-alpha/topology.h
@@ -41,8 +41,7 @@ static inline cpumask_t node_to_cpumask(int node)
41 41
42#define pcibus_to_cpumask(bus) (cpu_online_map) 42#define pcibus_to_cpumask(bus) (cpu_online_map)
43 43
44#else /* CONFIG_NUMA */
45# include <asm-generic/topology.h>
46#endif /* !CONFIG_NUMA */ 44#endif /* !CONFIG_NUMA */
45# include <asm-generic/topology.h>
47 46
48#endif /* _ASM_ALPHA_TOPOLOGY_H */ 47#endif /* _ASM_ALPHA_TOPOLOGY_H */
diff --git a/include/asm-arm/arch-at91/at91_ecc.h b/include/asm-arm/arch-at91/at91_ecc.h
index ff93df516d6d..1e5a8caca2d1 100644
--- a/include/asm-arm/arch-at91/at91_ecc.h
+++ b/include/asm-arm/arch-at91/at91_ecc.h
@@ -13,26 +13,26 @@
13#ifndef AT91_ECC_H 13#ifndef AT91_ECC_H
14#define AT91_ECC_H 14#define AT91_ECC_H
15 15
16#define AT91_ECC_CR (AT91_ECC + 0x00) /* Control register */ 16#define AT91_ECC_CR 0x00 /* Control register */
17#define AT91_ECC_RST (1 << 0) /* Reset parity */ 17#define AT91_ECC_RST (1 << 0) /* Reset parity */
18 18
19#define AT91_ECC_MR (AT91_ECC + 0x04) /* Mode register */ 19#define AT91_ECC_MR 0x04 /* Mode register */
20#define AT91_ECC_PAGESIZE (3 << 0) /* Page Size */ 20#define AT91_ECC_PAGESIZE (3 << 0) /* Page Size */
21#define AT91_ECC_PAGESIZE_528 (0) 21#define AT91_ECC_PAGESIZE_528 (0)
22#define AT91_ECC_PAGESIZE_1056 (1) 22#define AT91_ECC_PAGESIZE_1056 (1)
23#define AT91_ECC_PAGESIZE_2112 (2) 23#define AT91_ECC_PAGESIZE_2112 (2)
24#define AT91_ECC_PAGESIZE_4224 (3) 24#define AT91_ECC_PAGESIZE_4224 (3)
25 25
26#define AT91_ECC_SR (AT91_ECC + 0x08) /* Status register */ 26#define AT91_ECC_SR 0x08 /* Status register */
27#define AT91_ECC_RECERR (1 << 0) /* Recoverable Error */ 27#define AT91_ECC_RECERR (1 << 0) /* Recoverable Error */
28#define AT91_ECC_ECCERR (1 << 1) /* ECC Single Bit Error */ 28#define AT91_ECC_ECCERR (1 << 1) /* ECC Single Bit Error */
29#define AT91_ECC_MULERR (1 << 2) /* Multiple Errors */ 29#define AT91_ECC_MULERR (1 << 2) /* Multiple Errors */
30 30
31#define AT91_ECC_PR (AT91_ECC + 0x0c) /* Parity register */ 31#define AT91_ECC_PR 0x0c /* Parity register */
32#define AT91_ECC_BITADDR (0xf << 0) /* Bit Error Address */ 32#define AT91_ECC_BITADDR (0xf << 0) /* Bit Error Address */
33#define AT91_ECC_WORDADDR (0xfff << 4) /* Word Error Address */ 33#define AT91_ECC_WORDADDR (0xfff << 4) /* Word Error Address */
34 34
35#define AT91_ECC_NPR (AT91_ECC + 0x10) /* NParity register */ 35#define AT91_ECC_NPR 0x10 /* NParity register */
36#define AT91_ECC_NPARITY (0xffff << 0) /* NParity */ 36#define AT91_ECC_NPARITY (0xffff << 0) /* NParity */
37 37
38#endif 38#endif
diff --git a/include/asm-arm/arch-at91/at91_pmc.h b/include/asm-arm/arch-at91/at91_pmc.h
index 52cd8e5dabc9..c2b13c280155 100644
--- a/include/asm-arm/arch-at91/at91_pmc.h
+++ b/include/asm-arm/arch-at91/at91_pmc.h
@@ -76,10 +76,17 @@
76#define AT91_PMC_PRES_32 (5 << 2) 76#define AT91_PMC_PRES_32 (5 << 2)
77#define AT91_PMC_PRES_64 (6 << 2) 77#define AT91_PMC_PRES_64 (6 << 2)
78#define AT91_PMC_MDIV (3 << 8) /* Master Clock Division */ 78#define AT91_PMC_MDIV (3 << 8) /* Master Clock Division */
79#define AT91_PMC_MDIV_1 (0 << 8) 79#define AT91RM9200_PMC_MDIV_1 (0 << 8) /* [AT91RM9200 only] */
80#define AT91_PMC_MDIV_2 (1 << 8) 80#define AT91RM9200_PMC_MDIV_2 (1 << 8)
81#define AT91_PMC_MDIV_3 (2 << 8) 81#define AT91RM9200_PMC_MDIV_3 (2 << 8)
82#define AT91_PMC_MDIV_4 (3 << 8) 82#define AT91RM9200_PMC_MDIV_4 (3 << 8)
83#define AT91SAM9_PMC_MDIV_1 (0 << 8) /* [SAM9,CAP9 only] */
84#define AT91SAM9_PMC_MDIV_2 (1 << 8)
85#define AT91SAM9_PMC_MDIV_4 (2 << 8)
86#define AT91SAM9_PMC_MDIV_6 (3 << 8)
87#define AT91_PMC_PDIV (1 << 12) /* Processor Clock Division [some SAM9 only] */
88#define AT91_PMC_PDIV_1 (0 << 12)
89#define AT91_PMC_PDIV_2 (1 << 12)
83 90
84#define AT91_PMC_PCKR(n) (AT91_PMC + 0x40 + ((n) * 4)) /* Programmable Clock 0-3 Registers */ 91#define AT91_PMC_PCKR(n) (AT91_PMC + 0x40 + ((n) * 4)) /* Programmable Clock 0-3 Registers */
85 92
diff --git a/include/asm-arm/arch-at91/at91_shdwc.h b/include/asm-arm/arch-at91/at91_shdwc.h
index 01b433de2272..581fa41d90e8 100644
--- a/include/asm-arm/arch-at91/at91_shdwc.h
+++ b/include/asm-arm/arch-at91/at91_shdwc.h
@@ -24,10 +24,12 @@
24#define AT91_SHDW_WKMODE0_LOW 2 24#define AT91_SHDW_WKMODE0_LOW 2
25#define AT91_SHDW_WKMODE0_ANYLEVEL 3 25#define AT91_SHDW_WKMODE0_ANYLEVEL 3
26#define AT91_SHDW_CPTWK0 (0xf << 4) /* Counter On Wake Up 0 */ 26#define AT91_SHDW_CPTWK0 (0xf << 4) /* Counter On Wake Up 0 */
27#define AT91_SHDW_CPTWK0_(x) ((x) << 4)
27#define AT91_SHDW_RTTWKEN (1 << 16) /* Real Time Timer Wake-up Enable */ 28#define AT91_SHDW_RTTWKEN (1 << 16) /* Real Time Timer Wake-up Enable */
28 29
29#define AT91_SHDW_SR (AT91_SHDWC + 0x08) /* Shut Down Status Register */ 30#define AT91_SHDW_SR (AT91_SHDWC + 0x08) /* Shut Down Status Register */
30#define AT91_SHDW_WAKEUP0 (1 << 0) /* Wake-up 0 Status */ 31#define AT91_SHDW_WAKEUP0 (1 << 0) /* Wake-up 0 Status */
31#define AT91_SHDW_RTTWK (1 << 16) /* Real-time Timer Wake-up */ 32#define AT91_SHDW_RTTWK (1 << 16) /* Real-time Timer Wake-up */
33#define AT91_SHDW_RTCWK (1 << 17) /* Real-time Clock Wake-up [SAM9RL] */
32 34
33#endif 35#endif
diff --git a/include/asm-arm/arch-at91/at91cap9_ddrsdr.h b/include/asm-arm/arch-at91/at91cap9_ddrsdr.h
new file mode 100644
index 000000000000..efdb23af1ee4
--- /dev/null
+++ b/include/asm-arm/arch-at91/at91cap9_ddrsdr.h
@@ -0,0 +1,100 @@
1/*
2 * include/asm-arm/arch-at91/at91cap9_ddrsdr.h
3 *
4 * DDR/SDR Controller (DDRSDRC) - System peripherals registers.
5 * Based on AT91CAP9 datasheet revision B.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef AT91CAP9_DDRSDR_H
14#define AT91CAP9_DDRSDR_H
15
16#define AT91_DDRSDRC_MR (AT91_DDRSDRC + 0x00) /* Mode Register */
17#define AT91_DDRSDRC_MODE (0xf << 0) /* Command Mode */
18#define AT91_DDRSDRC_MODE_NORMAL 0
19#define AT91_DDRSDRC_MODE_NOP 1
20#define AT91_DDRSDRC_MODE_PRECHARGE 2
21#define AT91_DDRSDRC_MODE_LMR 3
22#define AT91_DDRSDRC_MODE_REFRESH 4
23#define AT91_DDRSDRC_MODE_EXT_LMR 5
24#define AT91_DDRSDRC_MODE_DEEP 6
25
26#define AT91_DDRSDRC_RTR (AT91_DDRSDRC + 0x04) /* Refresh Timer Register */
27#define AT91_DDRSDRC_COUNT (0xfff << 0) /* Refresh Timer Counter */
28
29#define AT91_DDRSDRC_CR (AT91_DDRSDRC + 0x08) /* Configuration Register */
30#define AT91_DDRSDRC_NC (3 << 0) /* Number of Column Bits */
31#define AT91_DDRSDRC_NC_SDR8 (0 << 0)
32#define AT91_DDRSDRC_NC_SDR9 (1 << 0)
33#define AT91_DDRSDRC_NC_SDR10 (2 << 0)
34#define AT91_DDRSDRC_NC_SDR11 (3 << 0)
35#define AT91_DDRSDRC_NC_DDR9 (0 << 0)
36#define AT91_DDRSDRC_NC_DDR10 (1 << 0)
37#define AT91_DDRSDRC_NC_DDR11 (2 << 0)
38#define AT91_DDRSDRC_NC_DDR12 (3 << 0)
39#define AT91_DDRSDRC_NR (3 << 2) /* Number of Row Bits */
40#define AT91_DDRSDRC_NR_11 (0 << 2)
41#define AT91_DDRSDRC_NR_12 (1 << 2)
42#define AT91_DDRSDRC_NR_13 (2 << 2)
43#define AT91_DDRSDRC_CAS (7 << 4) /* CAS Latency */
44#define AT91_DDRSDRC_CAS_2 (2 << 4)
45#define AT91_DDRSDRC_CAS_3 (3 << 4)
46#define AT91_DDRSDRC_CAS_25 (6 << 4)
47#define AT91_DDRSDRC_DLL (1 << 7) /* Reset DLL */
48#define AT91_DDRSDRC_DICDS (1 << 8) /* Output impedance control */
49
50#define AT91_DDRSDRC_T0PR (AT91_DDRSDRC + 0x0C) /* Timing 0 Register */
51#define AT91_DDRSDRC_TRAS (0xf << 0) /* Active to Precharge delay */
52#define AT91_DDRSDRC_TRCD (0xf << 4) /* Row to Column delay */
53#define AT91_DDRSDRC_TWR (0xf << 8) /* Write recovery delay */
54#define AT91_DDRSDRC_TRC (0xf << 12) /* Row cycle delay */
55#define AT91_DDRSDRC_TRP (0xf << 16) /* Row precharge delay */
56#define AT91_DDRSDRC_TRRD (0xf << 20) /* Active BankA to BankB */
57#define AT91_DDRSDRC_TWTR (1 << 24) /* Internal Write to Read delay */
58#define AT91_DDRSDRC_TMRD (0xf << 28) /* Load mode to active/refresh delay */
59
60#define AT91_DDRSDRC_T1PR (AT91_DDRSDRC + 0x10) /* Timing 1 Register */
61#define AT91_DDRSDRC_TRFC (0x1f << 0) /* Row Cycle Delay */
62#define AT91_DDRSDRC_TXSNR (0xff << 8) /* Exit self-refresh to non-read */
63#define AT91_DDRSDRC_TXSRD (0xff << 16) /* Exit self-refresh to read */
64#define AT91_DDRSDRC_TXP (0xf << 24) /* Exit power-down delay */
65
66#define AT91_DDRSDRC_LPR (AT91_DDRSDRC + 0x18) /* Low Power Register */
67#define AT91_DDRSDRC_LPCB (3 << 0) /* Low-power Configurations */
68#define AT91_DDRSDRC_LPCB_DISABLE 0
69#define AT91_DDRSDRC_LPCB_SELF_REFRESH 1
70#define AT91_DDRSDRC_LPCB_POWER_DOWN 2
71#define AT91_DDRSDRC_LPCB_DEEP_POWER_DOWN 3
72#define AT91_DDRSDRC_CLKFR (1 << 2) /* Clock Frozen */
73#define AT91_DDRSDRC_PASR (7 << 4) /* Partial Array Self Refresh */
74#define AT91_DDRSDRC_TCSR (3 << 8) /* Temperature Compensated Self Refresh */
75#define AT91_DDRSDRC_DS (3 << 10) /* Drive Strength */
76#define AT91_DDRSDRC_TIMEOUT (3 << 12) /* Time to define when Low Power Mode is enabled */
77#define AT91_DDRSDRC_TIMEOUT_0_CLK_CYCLES (0 << 12)
78#define AT91_DDRSDRC_TIMEOUT_64_CLK_CYCLES (1 << 12)
79#define AT91_DDRSDRC_TIMEOUT_128_CLK_CYCLES (2 << 12)
80
81#define AT91_DDRSDRC_MDR (AT91_DDRSDRC + 0x1C) /* Memory Device Register */
82#define AT91_DDRSDRC_MD (3 << 0) /* Memory Device Type */
83#define AT91_DDRSDRC_MD_SDR 0
84#define AT91_DDRSDRC_MD_LOW_POWER_SDR 1
85#define AT91_DDRSDRC_MD_DDR 2
86#define AT91_DDRSDRC_MD_LOW_POWER_DDR 3
87
88#define AT91_DDRSDRC_DLLR (AT91_DDRSDRC + 0x20) /* DLL Information Register */
89#define AT91_DDRSDRC_MDINC (1 << 0) /* Master Delay increment */
90#define AT91_DDRSDRC_MDDEC (1 << 1) /* Master Delay decrement */
91#define AT91_DDRSDRC_MDOVF (1 << 2) /* Master Delay Overflow */
92#define AT91_DDRSDRC_SDCOVF (1 << 3) /* Slave Delay Correction Overflow */
93#define AT91_DDRSDRC_SDCUDF (1 << 4) /* Slave Delay Correction Underflow */
94#define AT91_DDRSDRC_SDERF (1 << 5) /* Slave Delay Correction error */
95#define AT91_DDRSDRC_MDVAL (0xff << 8) /* Master Delay value */
96#define AT91_DDRSDRC_SDVAL (0xff << 16) /* Slave Delay value */
97#define AT91_DDRSDRC_SDCVAL (0xff << 24) /* Slave Delay Correction value */
98
99
100#endif
diff --git a/include/asm-arm/arch-at91/at91sam926x_mc.h b/include/asm-arm/arch-at91/at91sam9_sdramc.h
index d82631c251f1..d3b8b3da6b4d 100644
--- a/include/asm-arm/arch-at91/at91sam926x_mc.h
+++ b/include/asm-arm/arch-at91/at91sam9_sdramc.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-arm/arch-at91/at91sam926x_mc.h 2 * include/asm-arm/arch-at91/at91sam9_sdramc.h
3 * 3 *
4 * Memory Controllers (SMC, SDRAMC) - System peripherals registers. 4 * SDRAM Controllers (SDRAMC) - System peripherals registers.
5 * Based on AT91SAM9261 datasheet revision D. 5 * Based on AT91SAM9261 datasheet revision D.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -10,8 +10,8 @@
10 * (at your option) any later version. 10 * (at your option) any later version.
11 */ 11 */
12 12
13#ifndef AT91SAM926x_MC_H 13#ifndef AT91SAM9_SDRAMC_H
14#define AT91SAM926x_MC_H 14#define AT91SAM9_SDRAMC_H
15 15
16/* SDRAM Controller (SDRAMC) registers */ 16/* SDRAM Controller (SDRAMC) registers */
17#define AT91_SDRAMC_MR (AT91_SDRAMC + 0x00) /* SDRAM Controller Mode Register */ 17#define AT91_SDRAMC_MR (AT91_SDRAMC + 0x00) /* SDRAM Controller Mode Register */
@@ -62,7 +62,7 @@
62#define AT91_SDRAMC_LPCB_DEEP_POWER_DOWN 3 62#define AT91_SDRAMC_LPCB_DEEP_POWER_DOWN 3
63#define AT91_SDRAMC_PASR (7 << 4) /* Partial Array Self Refresh */ 63#define AT91_SDRAMC_PASR (7 << 4) /* Partial Array Self Refresh */
64#define AT91_SDRAMC_TCSR (3 << 8) /* Temperature Compensated Self Refresh */ 64#define AT91_SDRAMC_TCSR (3 << 8) /* Temperature Compensated Self Refresh */
65#define AT91_SDRAMC_DS (3 << 10) /* Drive Strenght */ 65#define AT91_SDRAMC_DS (3 << 10) /* Drive Strength */
66#define AT91_SDRAMC_TIMEOUT (3 << 12) /* Time to define when Low Power Mode is enabled */ 66#define AT91_SDRAMC_TIMEOUT (3 << 12) /* Time to define when Low Power Mode is enabled */
67#define AT91_SDRAMC_TIMEOUT_0_CLK_CYCLES (0 << 12) 67#define AT91_SDRAMC_TIMEOUT_0_CLK_CYCLES (0 << 12)
68#define AT91_SDRAMC_TIMEOUT_64_CLK_CYCLES (1 << 12) 68#define AT91_SDRAMC_TIMEOUT_64_CLK_CYCLES (1 << 12)
@@ -80,62 +80,4 @@
80#define AT91_SDRAMC_MD_LOW_POWER_SDRAM 1 80#define AT91_SDRAMC_MD_LOW_POWER_SDRAM 1
81 81
82 82
83/* Static Memory Controller (SMC) registers */
84#define AT91_SMC_SETUP(n) (AT91_SMC + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
85#define AT91_SMC_NWESETUP (0x3f << 0) /* NWE Setup Length */
86#define AT91_SMC_NWESETUP_(x) ((x) << 0)
87#define AT91_SMC_NCS_WRSETUP (0x3f << 8) /* NCS Setup Length in Write Access */
88#define AT91_SMC_NCS_WRSETUP_(x) ((x) << 8)
89#define AT91_SMC_NRDSETUP (0x3f << 16) /* NRD Setup Length */
90#define AT91_SMC_NRDSETUP_(x) ((x) << 16)
91#define AT91_SMC_NCS_RDSETUP (0x3f << 24) /* NCS Setup Length in Read Access */
92#define AT91_SMC_NCS_RDSETUP_(x) ((x) << 24)
93
94#define AT91_SMC_PULSE(n) (AT91_SMC + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
95#define AT91_SMC_NWEPULSE (0x7f << 0) /* NWE Pulse Length */
96#define AT91_SMC_NWEPULSE_(x) ((x) << 0)
97#define AT91_SMC_NCS_WRPULSE (0x7f << 8) /* NCS Pulse Length in Write Access */
98#define AT91_SMC_NCS_WRPULSE_(x)((x) << 8)
99#define AT91_SMC_NRDPULSE (0x7f << 16) /* NRD Pulse Length */
100#define AT91_SMC_NRDPULSE_(x) ((x) << 16)
101#define AT91_SMC_NCS_RDPULSE (0x7f << 24) /* NCS Pulse Length in Read Access */
102#define AT91_SMC_NCS_RDPULSE_(x)((x) << 24)
103
104#define AT91_SMC_CYCLE(n) (AT91_SMC + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
105#define AT91_SMC_NWECYCLE (0x1ff << 0 ) /* Total Write Cycle Length */
106#define AT91_SMC_NWECYCLE_(x) ((x) << 0)
107#define AT91_SMC_NRDCYCLE (0x1ff << 16) /* Total Read Cycle Length */
108#define AT91_SMC_NRDCYCLE_(x) ((x) << 16)
109
110#define AT91_SMC_MODE(n) (AT91_SMC + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
111#define AT91_SMC_READMODE (1 << 0) /* Read Mode */
112#define AT91_SMC_WRITEMODE (1 << 1) /* Write Mode */
113#define AT91_SMC_EXNWMODE (3 << 4) /* NWAIT Mode */
114#define AT91_SMC_EXNWMODE_DISABLE (0 << 4)
115#define AT91_SMC_EXNWMODE_FROZEN (2 << 4)
116#define AT91_SMC_EXNWMODE_READY (3 << 4)
117#define AT91_SMC_BAT (1 << 8) /* Byte Access Type */
118#define AT91_SMC_BAT_SELECT (0 << 8)
119#define AT91_SMC_BAT_WRITE (1 << 8)
120#define AT91_SMC_DBW (3 << 12) /* Data Bus Width */
121#define AT91_SMC_DBW_8 (0 << 12)
122#define AT91_SMC_DBW_16 (1 << 12)
123#define AT91_SMC_DBW_32 (2 << 12)
124#define AT91_SMC_TDF (0xf << 16) /* Data Float Time. */
125#define AT91_SMC_TDF_(x) ((x) << 16)
126#define AT91_SMC_TDFMODE (1 << 20) /* TDF Optimization - Enabled */
127#define AT91_SMC_PMEN (1 << 24) /* Page Mode Enabled */
128#define AT91_SMC_PS (3 << 28) /* Page Size */
129#define AT91_SMC_PS_4 (0 << 28)
130#define AT91_SMC_PS_8 (1 << 28)
131#define AT91_SMC_PS_16 (2 << 28)
132#define AT91_SMC_PS_32 (3 << 28)
133
134#if defined(AT91_SMC1) /* The AT91SAM9263 has 2 Static Memory contollers */
135#define AT91_SMC1_SETUP(n) (AT91_SMC1 + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
136#define AT91_SMC1_PULSE(n) (AT91_SMC1 + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
137#define AT91_SMC1_CYCLE(n) (AT91_SMC1 + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
138#define AT91_SMC1_MODE(n) (AT91_SMC1 + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
139#endif
140
141#endif 83#endif
diff --git a/include/asm-arm/arch-at91/at91sam9_smc.h b/include/asm-arm/arch-at91/at91sam9_smc.h
new file mode 100644
index 000000000000..9e49eed31e50
--- /dev/null
+++ b/include/asm-arm/arch-at91/at91sam9_smc.h
@@ -0,0 +1,73 @@
1/*
2 * include/asm-arm/arch-at91/at91sam9_smc.h
3 *
4 * Static Memory Controllers (SMC) - System peripherals registers.
5 * Based on AT91SAM9261 datasheet revision D.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef AT91SAM9_SMC_H
14#define AT91SAM9_SMC_H
15
16#define AT91_SMC_SETUP(n) (AT91_SMC + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
17#define AT91_SMC_NWESETUP (0x3f << 0) /* NWE Setup Length */
18#define AT91_SMC_NWESETUP_(x) ((x) << 0)
19#define AT91_SMC_NCS_WRSETUP (0x3f << 8) /* NCS Setup Length in Write Access */
20#define AT91_SMC_NCS_WRSETUP_(x) ((x) << 8)
21#define AT91_SMC_NRDSETUP (0x3f << 16) /* NRD Setup Length */
22#define AT91_SMC_NRDSETUP_(x) ((x) << 16)
23#define AT91_SMC_NCS_RDSETUP (0x3f << 24) /* NCS Setup Length in Read Access */
24#define AT91_SMC_NCS_RDSETUP_(x) ((x) << 24)
25
26#define AT91_SMC_PULSE(n) (AT91_SMC + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
27#define AT91_SMC_NWEPULSE (0x7f << 0) /* NWE Pulse Length */
28#define AT91_SMC_NWEPULSE_(x) ((x) << 0)
29#define AT91_SMC_NCS_WRPULSE (0x7f << 8) /* NCS Pulse Length in Write Access */
30#define AT91_SMC_NCS_WRPULSE_(x)((x) << 8)
31#define AT91_SMC_NRDPULSE (0x7f << 16) /* NRD Pulse Length */
32#define AT91_SMC_NRDPULSE_(x) ((x) << 16)
33#define AT91_SMC_NCS_RDPULSE (0x7f << 24) /* NCS Pulse Length in Read Access */
34#define AT91_SMC_NCS_RDPULSE_(x)((x) << 24)
35
36#define AT91_SMC_CYCLE(n) (AT91_SMC + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
37#define AT91_SMC_NWECYCLE (0x1ff << 0 ) /* Total Write Cycle Length */
38#define AT91_SMC_NWECYCLE_(x) ((x) << 0)
39#define AT91_SMC_NRDCYCLE (0x1ff << 16) /* Total Read Cycle Length */
40#define AT91_SMC_NRDCYCLE_(x) ((x) << 16)
41
42#define AT91_SMC_MODE(n) (AT91_SMC + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
43#define AT91_SMC_READMODE (1 << 0) /* Read Mode */
44#define AT91_SMC_WRITEMODE (1 << 1) /* Write Mode */
45#define AT91_SMC_EXNWMODE (3 << 4) /* NWAIT Mode */
46#define AT91_SMC_EXNWMODE_DISABLE (0 << 4)
47#define AT91_SMC_EXNWMODE_FROZEN (2 << 4)
48#define AT91_SMC_EXNWMODE_READY (3 << 4)
49#define AT91_SMC_BAT (1 << 8) /* Byte Access Type */
50#define AT91_SMC_BAT_SELECT (0 << 8)
51#define AT91_SMC_BAT_WRITE (1 << 8)
52#define AT91_SMC_DBW (3 << 12) /* Data Bus Width */
53#define AT91_SMC_DBW_8 (0 << 12)
54#define AT91_SMC_DBW_16 (1 << 12)
55#define AT91_SMC_DBW_32 (2 << 12)
56#define AT91_SMC_TDF (0xf << 16) /* Data Float Time. */
57#define AT91_SMC_TDF_(x) ((x) << 16)
58#define AT91_SMC_TDFMODE (1 << 20) /* TDF Optimization - Enabled */
59#define AT91_SMC_PMEN (1 << 24) /* Page Mode Enabled */
60#define AT91_SMC_PS (3 << 28) /* Page Size */
61#define AT91_SMC_PS_4 (0 << 28)
62#define AT91_SMC_PS_8 (1 << 28)
63#define AT91_SMC_PS_16 (2 << 28)
64#define AT91_SMC_PS_32 (3 << 28)
65
66#if defined(AT91_SMC1) /* The AT91SAM9263 has 2 Static Memory contollers */
67#define AT91_SMC1_SETUP(n) (AT91_SMC1 + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
68#define AT91_SMC1_PULSE(n) (AT91_SMC1 + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
69#define AT91_SMC1_CYCLE(n) (AT91_SMC1 + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
70#define AT91_SMC1_MODE(n) (AT91_SMC1 + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
71#endif
72
73#endif
diff --git a/include/asm-arm/arch-ep93xx/gpio.h b/include/asm-arm/arch-ep93xx/gpio.h
index 9b1864bbd9a8..186e7c715f8a 100644
--- a/include/asm-arm/arch-ep93xx/gpio.h
+++ b/include/asm-arm/arch-ep93xx/gpio.h
@@ -101,30 +101,17 @@
101 101
102/* new generic GPIO API - see Documentation/gpio.txt */ 102/* new generic GPIO API - see Documentation/gpio.txt */
103 103
104static inline int gpio_request(unsigned gpio, const char *label) 104#include <asm-generic/gpio.h>
105{
106 if (gpio > EP93XX_GPIO_LINE_MAX)
107 return -EINVAL;
108 return 0;
109}
110 105
111static inline void gpio_free(unsigned gpio) 106#define gpio_get_value __gpio_get_value
112{ 107#define gpio_set_value __gpio_set_value
113} 108#define gpio_cansleep __gpio_cansleep
114
115int gpio_direction_input(unsigned gpio);
116int gpio_direction_output(unsigned gpio, int value);
117int gpio_get_value(unsigned gpio);
118void gpio_set_value(unsigned gpio, int value);
119
120#include <asm-generic/gpio.h> /* cansleep wrappers */
121 109
122/* 110/*
123 * Map GPIO A0..A7 (0..7) to irq 64..71, 111 * Map GPIO A0..A7 (0..7) to irq 64..71,
124 * B0..B7 (7..15) to irq 72..79, and 112 * B0..B7 (7..15) to irq 72..79, and
125 * F0..F7 (16..24) to irq 80..87. 113 * F0..F7 (16..24) to irq 80..87.
126 */ 114 */
127
128static inline int gpio_to_irq(unsigned gpio) 115static inline int gpio_to_irq(unsigned gpio)
129{ 116{
130 if (gpio <= EP93XX_GPIO_LINE_MAX_IRQ) 117 if (gpio <= EP93XX_GPIO_LINE_MAX_IRQ)
diff --git a/include/asm-arm/arch-ks8695/devices.h b/include/asm-arm/arch-ks8695/devices.h
index b0364dce463f..7ad2c656e162 100644
--- a/include/asm-arm/arch-ks8695/devices.h
+++ b/include/asm-arm/arch-ks8695/devices.h
@@ -18,6 +18,11 @@ extern void __init ks8695_add_device_wan(void);
18extern void __init ks8695_add_device_lan(void); 18extern void __init ks8695_add_device_lan(void);
19extern void __init ks8695_add_device_hpna(void); 19extern void __init ks8695_add_device_hpna(void);
20 20
21 /* LEDs */
22extern short ks8695_leds_cpu;
23extern short ks8695_leds_timer;
24extern void __init ks8695_init_leds(u8 cpu_led, u8 timer_led);
25
21 /* PCI */ 26 /* PCI */
22#define KS8695_MODE_PCI 0 27#define KS8695_MODE_PCI 0
23#define KS8695_MODE_MINIPCI 1 28#define KS8695_MODE_MINIPCI 1
diff --git a/include/asm-arm/arch-mxc/board-mx31ads.h b/include/asm-arm/arch-mxc/board-mx31ads.h
index be29b83ad4ae..8590127760a8 100644
--- a/include/asm-arm/arch-mxc/board-mx31ads.h
+++ b/include/asm-arm/arch-mxc/board-mx31ads.h
@@ -11,107 +11,77 @@
11#ifndef __ASM_ARCH_MXC_BOARD_MX31ADS_H__ 11#ifndef __ASM_ARCH_MXC_BOARD_MX31ADS_H__
12#define __ASM_ARCH_MXC_BOARD_MX31ADS_H__ 12#define __ASM_ARCH_MXC_BOARD_MX31ADS_H__
13 13
14/*! 14/* Base address of PBC controller */
15 * @name PBC Controller parameters
16 */
17/*! @{ */
18/*!
19 * Base address of PBC controller
20 */
21#define PBC_BASE_ADDRESS IO_ADDRESS(CS4_BASE_ADDR) 15#define PBC_BASE_ADDRESS IO_ADDRESS(CS4_BASE_ADDR)
22/* Offsets for the PBC Controller register */ 16/* Offsets for the PBC Controller register */
23/*! 17
24 * PBC Board status register offset 18/* PBC Board status register offset */
25 */
26#define PBC_BSTAT 0x000002 19#define PBC_BSTAT 0x000002
27/*! 20
28 * PBC Board control register 1 set address. 21/* PBC Board control register 1 set address */
29 */
30#define PBC_BCTRL1_SET 0x000004 22#define PBC_BCTRL1_SET 0x000004
31/*! 23
32 * PBC Board control register 1 clear address. 24/* PBC Board control register 1 clear address */
33 */
34#define PBC_BCTRL1_CLEAR 0x000006 25#define PBC_BCTRL1_CLEAR 0x000006
35/*! 26
36 * PBC Board control register 2 set address. 27/* PBC Board control register 2 set address */
37 */
38#define PBC_BCTRL2_SET 0x000008 28#define PBC_BCTRL2_SET 0x000008
39/*! 29
40 * PBC Board control register 2 clear address. 30/* PBC Board control register 2 clear address */
41 */
42#define PBC_BCTRL2_CLEAR 0x00000A 31#define PBC_BCTRL2_CLEAR 0x00000A
43/*! 32
44 * PBC Board control register 3 set address. 33/* PBC Board control register 3 set address */
45 */
46#define PBC_BCTRL3_SET 0x00000C 34#define PBC_BCTRL3_SET 0x00000C
47/*! 35
48 * PBC Board control register 3 clear address. 36/* PBC Board control register 3 clear address */
49 */
50#define PBC_BCTRL3_CLEAR 0x00000E 37#define PBC_BCTRL3_CLEAR 0x00000E
51/*! 38
52 * PBC Board control register 4 set address. 39/* PBC Board control register 4 set address */
53 */
54#define PBC_BCTRL4_SET 0x000010 40#define PBC_BCTRL4_SET 0x000010
55/*! 41
56 * PBC Board control register 4 clear address. 42/* PBC Board control register 4 clear address */
57 */
58#define PBC_BCTRL4_CLEAR 0x000012 43#define PBC_BCTRL4_CLEAR 0x000012
59/*! 44
60 * PBC Board status register 1. 45/* PBC Board status register 1 */
61 */
62#define PBC_BSTAT1 0x000014 46#define PBC_BSTAT1 0x000014
63/*! 47
64 * PBC Board interrupt status register. 48/* PBC Board interrupt status register */
65 */
66#define PBC_INTSTATUS 0x000016 49#define PBC_INTSTATUS 0x000016
67/*! 50
68 * PBC Board interrupt current status register. 51/* PBC Board interrupt current status register */
69 */
70#define PBC_INTCURR_STATUS 0x000018 52#define PBC_INTCURR_STATUS 0x000018
71/*! 53
72 * PBC Interrupt mask register set address. 54/* PBC Interrupt mask register set address */
73 */
74#define PBC_INTMASK_SET 0x00001A 55#define PBC_INTMASK_SET 0x00001A
75/*! 56
76 * PBC Interrupt mask register clear address. 57/* PBC Interrupt mask register clear address */
77 */
78#define PBC_INTMASK_CLEAR 0x00001C 58#define PBC_INTMASK_CLEAR 0x00001C
79 59
80/*! 60/* External UART A */
81 * External UART A.
82 */
83#define PBC_SC16C652_UARTA 0x010000 61#define PBC_SC16C652_UARTA 0x010000
84/*! 62
85 * External UART B. 63/* External UART B */
86 */
87#define PBC_SC16C652_UARTB 0x010010 64#define PBC_SC16C652_UARTB 0x010010
88/*! 65
89 * Ethernet Controller IO base address. 66/* Ethernet Controller IO base address */
90 */
91#define PBC_CS8900A_IOBASE 0x020000 67#define PBC_CS8900A_IOBASE 0x020000
92/*! 68
93 * Ethernet Controller Memory base address. 69/* Ethernet Controller Memory base address */
94 */
95#define PBC_CS8900A_MEMBASE 0x021000 70#define PBC_CS8900A_MEMBASE 0x021000
96/*! 71
97 * Ethernet Controller DMA base address. 72/* Ethernet Controller DMA base address */
98 */
99#define PBC_CS8900A_DMABASE 0x022000 73#define PBC_CS8900A_DMABASE 0x022000
100/*! 74
101 * External chip select 0. 75/* External chip select 0 */
102 */
103#define PBC_XCS0 0x040000 76#define PBC_XCS0 0x040000
104/*! 77
105 * LCD Display enable. 78/* LCD Display enable */
106 */
107#define PBC_LCD_EN_B 0x060000 79#define PBC_LCD_EN_B 0x060000
108/*! 80
109 * Code test debug enable. 81/* Code test debug enable */
110 */
111#define PBC_CODE_B 0x070000 82#define PBC_CODE_B 0x070000
112/*! 83
113 * PSRAM memory select. 84/* PSRAM memory select */
114 */
115#define PBC_PSRAM_B 0x5000000 85#define PBC_PSRAM_B 0x5000000
116 86
117#define PBC_INTSTATUS_REG (PBC_INTSTATUS + PBC_BASE_ADDRESS) 87#define PBC_INTSTATUS_REG (PBC_INTSTATUS + PBC_BASE_ADDRESS)
@@ -139,4 +109,4 @@
139 109
140#define MXC_MAX_EXP_IO_LINES 16 110#define MXC_MAX_EXP_IO_LINES 16
141 111
142#endif /* __ASM_ARCH_MXC_BOARD_MX31ADS_H__ */ 112#endif /* __ASM_ARCH_MXC_BOARD_MX31ADS_H__ */
diff --git a/include/asm-arm/arch-mxc/dma.h b/include/asm-arm/arch-mxc/dma.h
index 65e639d51d2b..c822d569a05e 100644
--- a/include/asm-arm/arch-mxc/dma.h
+++ b/include/asm-arm/arch-mxc/dma.h
@@ -11,11 +11,4 @@
11#ifndef __ASM_ARCH_MXC_DMA_H__ 11#ifndef __ASM_ARCH_MXC_DMA_H__
12#define __ASM_ARCH_MXC_DMA_H__ 12#define __ASM_ARCH_MXC_DMA_H__
13 13
14/*!
15 * @file dma.h
16 * @brief This file contains Unified DMA API for all MXC platforms.
17 * The API is platform independent.
18 *
19 * @ingroup SDMA
20 */
21#endif 14#endif
diff --git a/include/asm-arm/arch-mxc/hardware.h b/include/asm-arm/arch-mxc/hardware.h
index 3c09b92fef0d..e87ff0679d5e 100644
--- a/include/asm-arm/arch-mxc/hardware.h
+++ b/include/asm-arm/arch-mxc/hardware.h
@@ -8,45 +8,24 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11/*!
12 * @file hardware.h
13 * @brief This file contains the hardware definitions of the board.
14 *
15 * @ingroup System
16 */
17#ifndef __ASM_ARCH_MXC_HARDWARE_H__ 11#ifndef __ASM_ARCH_MXC_HARDWARE_H__
18#define __ASM_ARCH_MXC_HARDWARE_H__ 12#define __ASM_ARCH_MXC_HARDWARE_H__
19 13
20#include <asm/sizes.h> 14#include <asm/sizes.h>
21 15
22#include <asm/arch/mx31.h> 16#ifdef CONFIG_ARCH_MX3
17# include <asm/arch/mx31.h>
18#endif
23 19
24#include <asm/arch/mxc.h> 20#include <asm/arch/mxc.h>
25 21
26#define MXC_MAX_GPIO_LINES (GPIO_NUM_PIN * GPIO_PORT_NUM)
27
28/* 22/*
29 * --------------------------------------------------------------------------- 23 * ---------------------------------------------------------------------------
30 * Board specific defines 24 * Board specific defines
31 * --------------------------------------------------------------------------- 25 * ---------------------------------------------------------------------------
32 */ 26 */
33#define MXC_EXP_IO_BASE (MXC_GPIO_INT_BASE + MXC_MAX_GPIO_LINES) 27#ifdef CONFIG_MACH_MX31ADS
34 28# include <asm/arch/board-mx31ads.h>
35#include <asm/arch/board-mx31ads.h>
36
37#ifndef MXC_MAX_EXP_IO_LINES
38#define MXC_MAX_EXP_IO_LINES 0
39#endif 29#endif
40 30
41#define MXC_MAX_VIRTUAL_INTS 16 31#endif /* __ASM_ARCH_MXC_HARDWARE_H__ */
42#define MXC_VIRTUAL_INTS_BASE (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES)
43#define MXC_SDIO1_CARD_IRQ MXC_VIRTUAL_INTS_BASE
44#define MXC_SDIO2_CARD_IRQ (MXC_VIRTUAL_INTS_BASE + 1)
45#define MXC_SDIO3_CARD_IRQ (MXC_VIRTUAL_INTS_BASE + 2)
46
47#define MXC_MAX_INTS (MXC_MAX_INT_LINES + \
48 MXC_MAX_GPIO_LINES + \
49 MXC_MAX_EXP_IO_LINES + \
50 MXC_MAX_VIRTUAL_INTS)
51
52#endif /* __ASM_ARCH_MXC_HARDWARE_H__ */
diff --git a/include/asm-arm/arch-mxc/io.h b/include/asm-arm/arch-mxc/io.h
index cf6c83a4b9f7..65b6810124c1 100644
--- a/include/asm-arm/arch-mxc/io.h
+++ b/include/asm-arm/arch-mxc/io.h
@@ -8,24 +8,13 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11/*!
12 * @file io.h
13 * @brief This file contains some memory mapping macros.
14 * @note There is no real ISA or PCI buses. But have to define these macros
15 * for some drivers to compile.
16 *
17 * @ingroup System
18 */
19
20#ifndef __ASM_ARCH_MXC_IO_H__ 11#ifndef __ASM_ARCH_MXC_IO_H__
21#define __ASM_ARCH_MXC_IO_H__ 12#define __ASM_ARCH_MXC_IO_H__
22 13
23/*! Allow IO space to be anywhere in the memory */ 14/* Allow IO space to be anywhere in the memory */
24#define IO_SPACE_LIMIT 0xffffffff 15#define IO_SPACE_LIMIT 0xffffffff
25 16
26/*! 17/* io address mapping macro */
27 * io address mapping macro
28 */
29#define __io(a) ((void __iomem *)(a)) 18#define __io(a) ((void __iomem *)(a))
30 19
31#define __mem_pci(a) (a) 20#define __mem_pci(a) (a)
diff --git a/include/asm-arm/arch-mxc/irqs.h b/include/asm-arm/arch-mxc/irqs.h
index e4686c6bc4bf..b2c5205e1962 100644
--- a/include/asm-arm/arch-mxc/irqs.h
+++ b/include/asm-arm/arch-mxc/irqs.h
@@ -13,26 +13,17 @@
13 13
14#include <asm/hardware.h> 14#include <asm/hardware.h>
15 15
16/*!
17 * @file irqs.h
18 * @brief This file defines the number of normal interrupts and fast interrupts
19 *
20 * @ingroup Interrupt
21 */
22
23#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE) 16#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE)
24 17
25#define MXC_IRQ_TO_GPIO(irq) ((irq) - MXC_GPIO_INT_BASE) 18#define MXC_IRQ_TO_GPIO(irq) ((irq) - MXC_GPIO_INT_BASE)
26#define MXC_GPIO_TO_IRQ(x) (MXC_GPIO_INT_BASE + x) 19#define MXC_GPIO_TO_IRQ(x) (MXC_GPIO_INT_BASE + x)
27 20
28/*! 21/* Number of normal interrupts */
29 * Number of normal interrupts 22#define NR_IRQS (MXC_MAX_INT_LINES + \
30 */ 23 MXC_MAX_GPIO_LINES + \
31#define NR_IRQS MXC_MAX_INTS 24 MXC_MAX_VIRTUAL_INTS)
32 25
33/*! 26/* Number of fast interrupts */
34 * Number of fast interrupts
35 */
36#define NR_FIQS MXC_MAX_INTS 27#define NR_FIQS MXC_MAX_INTS
37 28
38#endif /* __ASM_ARCH_MXC_IRQS_H__ */ 29#endif /* __ASM_ARCH_MXC_IRQS_H__ */
diff --git a/include/asm-arm/arch-mxc/memory.h b/include/asm-arm/arch-mxc/memory.h
index c89aac83a407..059f83023a10 100644
--- a/include/asm-arm/arch-mxc/memory.h
+++ b/include/asm-arm/arch-mxc/memory.h
@@ -13,24 +13,17 @@
13 13
14#include <asm/hardware.h> 14#include <asm/hardware.h>
15 15
16/*! 16/*
17 * @file memory.h
18 * @brief This file contains macros needed by the Linux kernel and drivers.
19 *
20 * @ingroup Memory
21 */
22
23/*!
24 * Virtual view <-> DMA view memory address translations 17 * Virtual view <-> DMA view memory address translations
25 * This macro is used to translate the virtual address to an address 18 * This macro is used to translate the virtual address to an address
26 * suitable to be passed to set_dma_addr() 19 * suitable to be passed to set_dma_addr()
27 */ 20 */
28#define __virt_to_bus(a) __virt_to_phys(a) 21#define __virt_to_bus(a) __virt_to_phys(a)
29 22
30/*! 23/*
31 * Used to convert an address for DMA operations to an address that the 24 * Used to convert an address for DMA operations to an address that the
32 * kernel can use. 25 * kernel can use.
33 */ 26 */
34#define __bus_to_virt(a) __phys_to_virt(a) 27#define __bus_to_virt(a) __phys_to_virt(a)
35 28
36#endif /* __ASM_ARCH_MXC_MEMORY_H__ */ 29#endif /* __ASM_ARCH_MXC_MEMORY_H__ */
diff --git a/include/asm-arm/arch-mxc/mx31.h b/include/asm-arm/arch-mxc/mx31.h
index 85c49c9e5d15..36a1af495bb3 100644
--- a/include/asm-arm/arch-mxc/mx31.h
+++ b/include/asm-arm/arch-mxc/mx31.h
@@ -317,6 +317,8 @@
317#define MXC_MAX_INT_LINES 64 317#define MXC_MAX_INT_LINES 64
318 318
319#define MXC_GPIO_INT_BASE MXC_MAX_INT_LINES 319#define MXC_GPIO_INT_BASE MXC_MAX_INT_LINES
320#define MXC_MAX_GPIO_LINES (GPIO_NUM_PIN * GPIO_PORT_NUM)
321#define MXC_MAX_VIRTUAL_INTS 16
320 322
321/*! 323/*!
322 * Number of GPIO port as defined in the IC Spec 324 * Number of GPIO port as defined in the IC Spec
@@ -329,7 +331,33 @@
329 331
330#define PROD_SIGNATURE 0x1 /* For MX31 */ 332#define PROD_SIGNATURE 0x1 /* For MX31 */
331 333
334/* silicon revisions specific to i.MX31 */
335#define CHIP_REV_1_0 0x10
336#define CHIP_REV_1_1 0x11
337#define CHIP_REV_1_2 0x12
338#define CHIP_REV_1_3 0x13
339#define CHIP_REV_2_0 0x20
340#define CHIP_REV_2_1 0x21
341#define CHIP_REV_2_2 0x22
342#define CHIP_REV_2_3 0x23
343#define CHIP_REV_3_0 0x30
344#define CHIP_REV_3_1 0x31
345#define CHIP_REV_3_2 0x32
346
332#define SYSTEM_REV_MIN CHIP_REV_1_0 347#define SYSTEM_REV_MIN CHIP_REV_1_0
333#define SYSTEM_REV_NUM 3 348#define SYSTEM_REV_NUM 3
334 349
335#endif /* __ASM_ARCH_MXC_MX31_H__ */ 350#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
351
352/* this is a i.MX31 CPU */
353#define cpu_is_mx31() (1)
354
355extern unsigned int system_rev;
356
357static inline int mx31_revision(void)
358{
359 return system_rev;
360}
361#endif
362
363#endif /* __ASM_ARCH_MXC_MX31_H__ */
diff --git a/include/asm-arm/arch-mxc/mxc.h b/include/asm-arm/arch-mxc/mxc.h
index 0837f1f9ca31..146d3f60951a 100644
--- a/include/asm-arm/arch-mxc/mxc.h
+++ b/include/asm-arm/arch-mxc/mxc.h
@@ -15,6 +15,11 @@
15#error "Do not include directly." 15#error "Do not include directly."
16#endif 16#endif
17 17
18/* clean up all things that are not used */
19#ifndef CONFIG_ARCH_MX3
20# define cpu_is_mx31() (0)
21#endif
22
18/* 23/*
19 ***************************************** 24 *****************************************
20 * GPT Register definitions * 25 * GPT Register definitions *
@@ -31,9 +36,7 @@
31#define MXC_GPT_GPTICR2 IO_ADDRESS(GPT1_BASE_ADDR + 0x20) 36#define MXC_GPT_GPTICR2 IO_ADDRESS(GPT1_BASE_ADDR + 0x20)
32#define MXC_GPT_GPTCNT IO_ADDRESS(GPT1_BASE_ADDR + 0x24) 37#define MXC_GPT_GPTCNT IO_ADDRESS(GPT1_BASE_ADDR + 0x24)
33 38
34/*! 39/* GPT Control register bit definitions */
35 * GPT Control register bit definitions
36 */
37#define GPTCR_FO3 (1 << 31) 40#define GPTCR_FO3 (1 << 31)
38#define GPTCR_FO2 (1 << 30) 41#define GPTCR_FO2 (1 << 30)
39#define GPTCR_FO1 (1 << 29) 42#define GPTCR_FO1 (1 << 29)
@@ -146,4 +149,4 @@
146#define IIM_PROD_REV_SH 3 149#define IIM_PROD_REV_SH 3
147#define IIM_PROD_REV_LEN 5 150#define IIM_PROD_REV_LEN 5
148 151
149#endif /* __ASM_ARCH_MXC_H__ */ 152#endif /* __ASM_ARCH_MXC_H__ */
diff --git a/include/asm-arm/arch-mxc/system.h b/include/asm-arm/arch-mxc/system.h
index 109956b41aca..bbfc37465fc5 100644
--- a/include/asm-arm/arch-mxc/system.h
+++ b/include/asm-arm/arch-mxc/system.h
@@ -21,30 +21,14 @@
21#ifndef __ASM_ARCH_MXC_SYSTEM_H__ 21#ifndef __ASM_ARCH_MXC_SYSTEM_H__
22#define __ASM_ARCH_MXC_SYSTEM_H__ 22#define __ASM_ARCH_MXC_SYSTEM_H__
23 23
24/*!
25 * @file system.h
26 * @brief This file contains idle and reset functions.
27 *
28 * @ingroup System
29 */
30
31/*!
32 * This function puts the CPU into idle mode. It is called by default_idle()
33 * in process.c file.
34 */
35static inline void arch_idle(void) 24static inline void arch_idle(void)
36{ 25{
37 cpu_do_idle(); 26 cpu_do_idle();
38} 27}
39 28
40/*
41 * This function resets the system. It is called by machine_restart().
42 *
43 * @param mode indicates different kinds of resets
44 */
45static inline void arch_reset(char mode) 29static inline void arch_reset(char mode)
46{ 30{
47 cpu_reset(0); 31 cpu_reset(0);
48} 32}
49 33
50#endif /* __ASM_ARCH_MXC_SYSTEM_H__ */ 34#endif /* __ASM_ARCH_MXC_SYSTEM_H__ */
diff --git a/include/asm-arm/arch-mxc/vmalloc.h b/include/asm-arm/arch-mxc/vmalloc.h
index 83a73da895eb..62d97623412f 100644
--- a/include/asm-arm/arch-mxc/vmalloc.h
+++ b/include/asm-arm/arch-mxc/vmalloc.h
@@ -20,17 +20,7 @@
20#ifndef __ASM_ARCH_MXC_VMALLOC_H__ 20#ifndef __ASM_ARCH_MXC_VMALLOC_H__
21#define __ASM_ARCH_MXC_VMALLOC_H__ 21#define __ASM_ARCH_MXC_VMALLOC_H__
22 22
23/*! 23/* vmalloc ending address */
24 * @file vmalloc.h
25 *
26 * @brief This file contains platform specific macros for vmalloc.
27 *
28 * @ingroup System
29 */
30
31/*!
32 * vmalloc ending address
33 */
34#define VMALLOC_END 0xF4000000 24#define VMALLOC_END 0xF4000000
35 25
36#endif /* __ASM_ARCH_MXC_VMALLOC_H__ */ 26#endif /* __ASM_ARCH_MXC_VMALLOC_H__ */
diff --git a/include/asm-arm/arch-ns9xxx/board.h b/include/asm-arm/arch-ns9xxx/board.h
index 716f34fdb716..e57443bdbbd9 100644
--- a/include/asm-arm/arch-ns9xxx/board.h
+++ b/include/asm-arm/arch-ns9xxx/board.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-arm/arch-ns9xxx/board.h 2 * include/asm-arm/arch-ns9xxx/board.h
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -13,8 +13,30 @@
13 13
14#include <asm/mach-types.h> 14#include <asm/mach-types.h>
15 15
16#define board_is_a9m9750dev() (machine_is_cc9p9360dev()) 16#define board_is_a9m9750dev() (0 \
17 || machine_is_cc9p9360dev() \
18 || machine_is_cc9p9750dev() \
19 )
17 20
18#define board_is_jscc9p9360() (machine_is_cc9p9360js()) 21#define board_is_a9mvali() (0 \
22 || machine_is_cc9p9360val() \
23 || machine_is_cc9p9750val() \
24 )
25
26#define board_is_jscc9p9210() (0 \
27 || machine_is_cc9p9210js() \
28 )
29
30#define board_is_jscc9p9215() (0 \
31 || machine_is_cc9p9215js() \
32 )
33
34#define board_is_jscc9p9360() (0 \
35 || machine_is_cc9p9360js() \
36 )
37
38#define board_is_uncbas() (0 \
39 || machine_is_cc7ucamry() \
40 )
19 41
20#endif /* ifndef __ASM_ARCH_BOARD_H */ 42#endif /* ifndef __ASM_ARCH_BOARD_H */
diff --git a/include/asm-arm/arch-ns9xxx/clock.h b/include/asm-arm/arch-ns9xxx/clock.h
deleted file mode 100644
index b943d3a92a1d..000000000000
--- a/include/asm-arm/arch-ns9xxx/clock.h
+++ /dev/null
@@ -1,71 +0,0 @@
1/*
2 * include/asm-arm/arch-ns9xxx/clock.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_CLOCK_H
12#define __ASM_ARCH_CLOCK_H
13
14#include <asm/arch-ns9xxx/regs-sys.h>
15
16#define CRYSTAL 29491200 /* Hz */
17
18/* The HRM calls this value f_vco */
19static inline u32 ns9xxx_systemclock(void) __attribute__((const));
20static inline u32 ns9xxx_systemclock(void)
21{
22 u32 pll = __raw_readl(SYS_PLL);
23
24 /*
25 * The system clock should be a multiple of HZ * TIMERCLOCKSELECT (in
26 * time.c).
27 *
28 * The following values are given:
29 * - TIMERCLOCKSELECT == 2^i for an i in {0 .. 6}
30 * - CRYSTAL == 29491200 == 2^17 * 3^2 * 5^2
31 * - ND in {0 .. 31}
32 * - FS in {0 .. 3}
33 *
34 * Assuming the worst, we consider:
35 * - TIMERCLOCKSELECT == 64
36 * - ND == 0
37 * - FS == 3
38 *
39 * So HZ should be a divisor of:
40 * (CRYSTAL * (ND + 1) >> FS) / TIMERCLOCKSELECT
41 * == (2^17 * 3^2 * 5^2 * 1 >> 3) / 64
42 * == 2^8 * 3^2 * 5^2
43 * == 57600
44 *
45 * Currently HZ is defined to be 100 for this platform.
46 *
47 * Fine.
48 */
49 return CRYSTAL * (REGGETIM(pll, SYS_PLL, ND) + 1)
50 >> REGGETIM(pll, SYS_PLL, FS);
51}
52
53static inline u32 ns9xxx_cpuclock(void) __attribute__((const));
54static inline u32 ns9xxx_cpuclock(void)
55{
56 return ns9xxx_systemclock() / 2;
57}
58
59static inline u32 ns9xxx_ahbclock(void) __attribute__((const));
60static inline u32 ns9xxx_ahbclock(void)
61{
62 return ns9xxx_systemclock() / 4;
63}
64
65static inline u32 ns9xxx_bbusclock(void) __attribute__((const));
66static inline u32 ns9xxx_bbusclock(void)
67{
68 return ns9xxx_systemclock() / 8;
69}
70
71#endif /* ifndef __ASM_ARCH_CLOCK_H */
diff --git a/include/asm-arm/arch-ns9xxx/entry-macro.S b/include/asm-arm/arch-ns9xxx/entry-macro.S
index 86aec87303e4..89a21c530468 100644
--- a/include/asm-arm/arch-ns9xxx/entry-macro.S
+++ b/include/asm-arm/arch-ns9xxx/entry-macro.S
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-arm/arch-ns9xxx/entry-macro.S 2 * include/asm-arm/arch-ns9xxx/entry-macro.S
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -9,16 +9,16 @@
9 * the Free Software Foundation. 9 * the Free Software Foundation.
10 */ 10 */
11#include <asm/hardware.h> 11#include <asm/hardware.h>
12#include <asm/arch-ns9xxx/regs-sys.h> 12#include <asm/arch-ns9xxx/regs-sys-common.h>
13 13
14 .macro get_irqnr_preamble, base, tmp 14 .macro get_irqnr_preamble, base, tmp
15 ldr \base, =SYS_ISRADDR
15 .endm 16 .endm
16 17
17 .macro arch_ret_to_user, tmp1, tmp2 18 .macro arch_ret_to_user, tmp1, tmp2
18 .endm 19 .endm
19 20
20 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 21 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
21 ldr \base, =SYS_ISRADDR
22 ldr \irqstat, [\base, #(SYS_ISA - SYS_ISRADDR)] 22 ldr \irqstat, [\base, #(SYS_ISA - SYS_ISRADDR)]
23 cmp \irqstat, #0 23 cmp \irqstat, #0
24 ldrne \irqnr, [\base] 24 ldrne \irqnr, [\base]
diff --git a/include/asm-arm/arch-ns9xxx/irqs.h b/include/asm-arm/arch-ns9xxx/irqs.h
index 25d8d28b27f3..e83d48ec42c9 100644
--- a/include/asm-arm/arch-ns9xxx/irqs.h
+++ b/include/asm-arm/arch-ns9xxx/irqs.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-arm/arch-ns9xxx/irqs.h 2 * include/asm-arm/arch-ns9xxx/irqs.h
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -11,38 +11,39 @@
11#ifndef __ASM_ARCH_IRQS_H 11#ifndef __ASM_ARCH_IRQS_H
12#define __ASM_ARCH_IRQS_H 12#define __ASM_ARCH_IRQS_H
13 13
14#define IRQ_WATCHDOG 0 14/* NetSilicon 9360 */
15#define IRQ_AHBBUSERR 1 15#define IRQ_NS9XXX_WATCHDOG 0
16#define IRQ_BBUSAGG 2 16#define IRQ_NS9XXX_AHBBUSERR 1
17#define IRQ_NS9360_BBUSAGG 2
17/* irq 3 is reserved for NS9360 */ 18/* irq 3 is reserved for NS9360 */
18#define IRQ_ETHRX 4 19#define IRQ_NS9XXX_ETHRX 4
19#define IRQ_ETHTX 5 20#define IRQ_NS9XXX_ETHTX 5
20#define IRQ_ETHPHY 6 21#define IRQ_NS9XXX_ETHPHY 6
21#define IRQ_LCD 7 22#define IRQ_NS9360_LCD 7
22#define IRQ_SERBRX 8 23#define IRQ_NS9360_SERBRX 8
23#define IRQ_SERBTX 9 24#define IRQ_NS9360_SERBTX 9
24#define IRQ_SERARX 10 25#define IRQ_NS9360_SERARX 10
25#define IRQ_SERATX 11 26#define IRQ_NS9360_SERATX 11
26#define IRQ_SERCRX 12 27#define IRQ_NS9360_SERCRX 12
27#define IRQ_SERCTX 13 28#define IRQ_NS9360_SERCTX 13
28#define IRQ_I2C 14 29#define IRQ_NS9360_I2C 14
29#define IRQ_BBUSDMA 15 30#define IRQ_NS9360_BBUSDMA 15
30#define IRQ_TIMER0 16 31#define IRQ_NS9360_TIMER0 16
31#define IRQ_TIMER1 17 32#define IRQ_NS9360_TIMER1 17
32#define IRQ_TIMER2 18 33#define IRQ_NS9360_TIMER2 18
33#define IRQ_TIMER3 19 34#define IRQ_NS9360_TIMER3 19
34#define IRQ_TIMER4 20 35#define IRQ_NS9360_TIMER4 20
35#define IRQ_TIMER5 21 36#define IRQ_NS9360_TIMER5 21
36#define IRQ_TIMER6 22 37#define IRQ_NS9360_TIMER6 22
37#define IRQ_TIMER7 23 38#define IRQ_NS9360_TIMER7 23
38#define IRQ_RTC 24 39#define IRQ_NS9360_RTC 24
39#define IRQ_USBHOST 25 40#define IRQ_NS9360_USBHOST 25
40#define IRQ_USBDEVICE 26 41#define IRQ_NS9360_USBDEVICE 26
41#define IRQ_IEEE1284 27 42#define IRQ_NS9360_IEEE1284 27
42#define IRQ_EXT0 28 43#define IRQ_NS9XXX_EXT0 28
43#define IRQ_EXT1 29 44#define IRQ_NS9XXX_EXT1 29
44#define IRQ_EXT2 30 45#define IRQ_NS9XXX_EXT2 30
45#define IRQ_EXT3 31 46#define IRQ_NS9XXX_EXT3 31
46 47
47#define BBUS_IRQ(irq) (32 + irq) 48#define BBUS_IRQ(irq) (32 + irq)
48 49
@@ -67,7 +68,7 @@
67/* 68/*
68 * these Interrupts are specific for the a9m9750dev board. 69 * these Interrupts are specific for the a9m9750dev board.
69 * They are generated by an FPGA that interrupts the CPU on 70 * They are generated by an FPGA that interrupts the CPU on
70 * IRQ_EXT2 71 * IRQ_NS9360_EXT2
71 */ 72 */
72#define FPGA_IRQ(irq) (64 + irq) 73#define FPGA_IRQ(irq) (64 + irq)
73 74
diff --git a/include/asm-arm/arch-ns9xxx/module.h b/include/asm-arm/arch-ns9xxx/module.h
new file mode 100644
index 000000000000..ac08a31111e4
--- /dev/null
+++ b/include/asm-arm/arch-ns9xxx/module.h
@@ -0,0 +1,60 @@
1/*
2 * include/asm-arm/arch-ns9xxx/module.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_MODULE_H
12#define __ASM_ARCH_MODULE_H
13
14#include <asm/mach-types.h>
15
16#define module_is_cc7ucamry() (0 \
17 || machine_is_cc7ucamry() \
18 )
19
20#define module_is_cc9c() (0 \
21 || machine_is_cc9c() \
22 )
23
24#define module_is_cc9p9210() (0 \
25 || machine_is_cc9p9210() \
26 || machine_is_cc9p9210js() \
27 )
28
29#define module_is_cc9p9215() (0 \
30 || machine_is_cc9p9215() \
31 || machine_is_cc9p9215js() \
32 )
33
34#define module_is_cc9p9360() (0 \
35 || machine_is_a9m9360() \
36 || machine_is_cc9p9360dev() \
37 || machine_is_cc9p9360js() \
38 || machine_is_cc9p9360val() \
39 )
40
41#define module_is_cc9p9750() (0 \
42 || machine_is_a9m9750() \
43 || machine_is_cc9p9750dev() \
44 || machine_is_cc9p9750js() \
45 || machine_is_cc9p9750val() \
46 )
47
48#define module_is_ccw9c() (0 \
49 || machine_is_ccw9c() \
50 )
51
52#define module_is_inc20otter() (0 \
53 || machine_is_inc20otter() \
54 )
55
56#define module_is_otter() (0 \
57 || machine_is_otter() \
58 )
59
60#endif /* ifndef __ASM_ARCH_MODULE_H */
diff --git a/include/asm-arm/arch-ns9xxx/processor-ns9360.h b/include/asm-arm/arch-ns9xxx/processor-ns9360.h
new file mode 100644
index 000000000000..f3aa6c50dbe5
--- /dev/null
+++ b/include/asm-arm/arch-ns9xxx/processor-ns9360.h
@@ -0,0 +1,32 @@
1/*
2 * include/asm-arm/arch-ns9xxx/processor-ns9360.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_PROCESSORNS9360_H
12#define __ASM_ARCH_PROCESSORNS9360_H
13
14#include <linux/init.h>
15
16void ns9360_reset(char mode);
17
18unsigned long ns9360_systemclock(void) __attribute__((const));
19
20static inline unsigned long ns9360_cpuclock(void) __attribute__((const));
21static inline unsigned long ns9360_cpuclock(void)
22{
23 return ns9360_systemclock() / 2;
24}
25
26void __init ns9360_map_io(void);
27
28extern struct sys_timer ns9360_timer;
29
30int ns9360_gpio_configure(unsigned gpio, int inv, int func);
31
32#endif /* ifndef __ASM_ARCH_PROCESSORNS9360_H */
diff --git a/include/asm-arm/arch-ns9xxx/processor.h b/include/asm-arm/arch-ns9xxx/processor.h
index 223e51b8e104..f7b53b65de81 100644
--- a/include/asm-arm/arch-ns9xxx/processor.h
+++ b/include/asm-arm/arch-ns9xxx/processor.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-arm/arch-ns9xxx/processor.h 2 * include/asm-arm/arch-ns9xxx/processor.h
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -11,9 +11,32 @@
11#ifndef __ASM_ARCH_PROCESSOR_H 11#ifndef __ASM_ARCH_PROCESSOR_H
12#define __ASM_ARCH_PROCESSOR_H 12#define __ASM_ARCH_PROCESSOR_H
13 13
14#include <asm/mach-types.h> 14#include <asm/arch-ns9xxx/module.h>
15 15
16#define processor_is_ns9360() (machine_is_cc9p9360dev() \ 16#define processor_is_ns9210() (0 \
17 || machine_is_cc9p9360js()) 17 || module_is_cc7ucamry() \
18 || module_is_cc9p9210() \
19 || module_is_inc20otter() \
20 || module_is_otter() \
21 )
22
23#define processor_is_ns9215() (0 \
24 || module_is_cc9p9215() \
25 )
26
27#define processor_is_ns9360() (0 \
28 || module_is_cc9p9360() \
29 || module_is_cc9c() \
30 || module_is_ccw9c() \
31 )
32
33#define processor_is_ns9750() (0 \
34 || module_is_cc9p9750() \
35 )
36
37#define processor_is_ns921x() (0 \
38 || processor_is_ns9210() \
39 || processor_is_ns9215() \
40 )
18 41
19#endif /* ifndef __ASM_ARCH_PROCESSOR_H */ 42#endif /* ifndef __ASM_ARCH_PROCESSOR_H */
diff --git a/include/asm-arm/arch-ns9xxx/regs-sys-common.h b/include/asm-arm/arch-ns9xxx/regs-sys-common.h
new file mode 100644
index 000000000000..956c57cb781f
--- /dev/null
+++ b/include/asm-arm/arch-ns9xxx/regs-sys-common.h
@@ -0,0 +1,31 @@
1/*
2 * include/asm-arm/arch-ns9xxx/regs-sys-common.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11
12#ifndef __ASM_ARCH_REGSSYSCOMMON_H
13#define __ASM_ARCH_REGSSYSCOMMON_H
14#include <asm/hardware.h>
15
16/* Interrupt Vector Address Register Level x */
17#define SYS_IVA(x) __REG2(0xa09000c4, (x))
18
19/* Interrupt Configuration registers */
20#define SYS_IC(x) __REG2(0xa0900144, (x))
21
22/* ISRADDR */
23#define SYS_ISRADDR __REG(0xa0900164)
24
25/* Interrupt Status Active */
26#define SYS_ISA __REG(0xa0900168)
27
28/* Interrupt Status Raw */
29#define SYS_ISR __REG(0xa090016c)
30
31#endif /* ifndef __ASM_ARCH_REGSSYSCOMMON_H */
diff --git a/include/asm-arm/arch-ns9xxx/regs-sys.h b/include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h
index 749262f86204..318b6945afb6 100644
--- a/include/asm-arm/arch-ns9xxx/regs-sys.h
+++ b/include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h
@@ -1,15 +1,15 @@
1/* 1/*
2 * include/asm-arm/arch-ns9xxx/regs-sys.h 2 * include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by 8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation. 9 * the Free Software Foundation.
10 */ 10 */
11#ifndef __ASM_ARCH_REGSSYS_H 11#ifndef __ASM_ARCH_REGSSYSNS9360_H
12#define __ASM_ARCH_REGSSYS_H 12#define __ASM_ARCH_REGSSYSNS9360_H
13 13
14#include <asm/hardware.h> 14#include <asm/hardware.h>
15 15
@@ -27,21 +27,6 @@
27/* Timer x Read register */ 27/* Timer x Read register */
28#define SYS_TR(x) __REG2(0xa0900084, (x)) 28#define SYS_TR(x) __REG2(0xa0900084, (x))
29 29
30/* Interrupt Vector Address Register Level x */
31#define SYS_IVA(x) __REG2(0xa09000c4, (x))
32
33/* Interrupt Configuration registers */
34#define SYS_IC(x) __REG2(0xa0900144, (x))
35
36/* ISRADDR */
37#define SYS_ISRADDR __REG(0xa0900164)
38
39/* Interrupt Status Active */
40#define SYS_ISA __REG(0xa0900168)
41
42/* Interrupt Status Raw */
43#define SYS_ISR __REG(0xa090016c)
44
45/* Timer Interrupt Status register */ 30/* Timer Interrupt Status register */
46#define SYS_TIS __REG(0xa0900170) 31#define SYS_TIS __REG(0xa0900170)
47 32
@@ -160,4 +145,4 @@
160#define SYS_EIC_LVEDG_LEVEL __REGVAL(SYS_EIC_LVEDG, 0) 145#define SYS_EIC_LVEDG_LEVEL __REGVAL(SYS_EIC_LVEDG, 0)
161#define SYS_EIC_LVEDG_EDGE __REGVAL(SYS_EIC_LVEDG, 1) 146#define SYS_EIC_LVEDG_EDGE __REGVAL(SYS_EIC_LVEDG, 1)
162 147
163#endif /* ifndef __ASM_ARCH_REGSSYS_H */ 148#endif /* ifndef __ASM_ARCH_REGSSYSNS9360_H */
diff --git a/include/asm-arm/arch-ns9xxx/system.h b/include/asm-arm/arch-ns9xxx/system.h
index c1082bd8977c..1348073afe48 100644
--- a/include/asm-arm/arch-ns9xxx/system.h
+++ b/include/asm-arm/arch-ns9xxx/system.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-arm/arch-ns9xxx/system.h 2 * include/asm-arm/arch-ns9xxx/system.h
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -12,8 +12,8 @@
12#define __ASM_ARCH_SYSTEM_H 12#define __ASM_ARCH_SYSTEM_H
13 13
14#include <asm/proc-fns.h> 14#include <asm/proc-fns.h>
15#include <asm/arch-ns9xxx/regs-sys.h> 15#include <asm/arch-ns9xxx/processor.h>
16#include <asm/mach-types.h> 16#include <asm/arch-ns9xxx/processor-ns9360.h>
17 17
18static inline void arch_idle(void) 18static inline void arch_idle(void)
19{ 19{
@@ -22,11 +22,12 @@ static inline void arch_idle(void)
22 22
23static inline void arch_reset(char mode) 23static inline void arch_reset(char mode)
24{ 24{
25 u32 reg; 25#ifdef CONFIG_PROCESSOR_NS9360
26 26 if (processor_is_ns9360())
27 reg = __raw_readl(SYS_PLL) >> 16; 27 ns9360_reset(mode);
28 REGSET(reg, SYS_PLL, SWC, YES); 28 else
29 __raw_writel(reg, SYS_PLL); 29#endif
30 BUG();
30 31
31 BUG(); 32 BUG();
32} 33}
diff --git a/include/asm-arm/arch-ns9xxx/uncompress.h b/include/asm-arm/arch-ns9xxx/uncompress.h
index 961ca7dc9954..71066baceab7 100644
--- a/include/asm-arm/arch-ns9xxx/uncompress.h
+++ b/include/asm-arm/arch-ns9xxx/uncompress.h
@@ -11,20 +11,149 @@
11#ifndef __ASM_ARCH_UNCOMPRESS_H 11#ifndef __ASM_ARCH_UNCOMPRESS_H
12#define __ASM_ARCH_UNCOMPRESS_H 12#define __ASM_ARCH_UNCOMPRESS_H
13 13
14static void putc(char c) 14#include <asm/io.h>
15
16#define __REG(x) ((void __iomem __force *)(x))
17
18static void putc_dummy(char c, void __iomem *base)
15{ 19{
16 volatile u8 *base = (volatile u8 *)0x40000000; 20 /* nothing */
17 int t = 0x10000; 21}
18 22
23static void putc_ns9360(char c, void __iomem *base)
24{
25 static int t = 0x10000;
26 do {
27 if (t)
28 --t;
29
30 if (__raw_readl(base + 8) & (1 << 3)) {
31 __raw_writeb(c, base + 16);
32 t = 0x10000;
33 break;
34 }
35 } while (t);
36}
37
38static void putc_a9m9750dev(char c, void __iomem *base)
39{
40 static int t = 0x10000;
41 do {
42 if (t)
43 --t;
44
45 if (__raw_readb(base + 5) & (1 << 5)) {
46 __raw_writeb(c, base);
47 t = 0x10000;
48 break;
49 }
50 } while (t);
51
52}
53
54static void putc_ns921x(char c, void __iomem *base)
55{
56 static int t = 0x10000;
19 do { 57 do {
20 if (base[5] & 0x20) { 58 if (t)
21 base[0] = c; 59 --t;
60
61 if (!(__raw_readl(base) & (1 << 11))) {
62 __raw_writeb(c, base + 0x0028);
63 t = 0x10000;
22 break; 64 break;
23 } 65 }
24 } while (--t); 66 } while (t);
25} 67}
26 68
27#define arch_decomp_setup() 69#define MSCS __REG(0xA0900184)
70
71#define NS9360_UARTA __REG(0x90200040)
72#define NS9360_UARTB __REG(0x90200000)
73#define NS9360_UARTC __REG(0x90300000)
74#define NS9360_UARTD __REG(0x90300040)
75
76#define NS9360_UART_ENABLED(base) \
77 (__raw_readl(NS9360_UARTA) & (1 << 31))
78
79#define A9M9750DEV_UARTA __REG(0x40000000)
80
81#define NS921XSYS_CLOCK __REG(0xa090017c)
82#define NS921X_UARTA __REG(0x90010000)
83#define NS921X_UARTB __REG(0x90018000)
84#define NS921X_UARTC __REG(0x90020000)
85#define NS921X_UARTD __REG(0x90028000)
86
87#define NS921X_UART_ENABLED(base) \
88 (__raw_readl((base) + 0x1000) & (1 << 29))
89
90static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base)
91{
92 if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) {
93 /* ns9360 or ns9750 */
94 if (NS9360_UART_ENABLED(NS9360_UARTA)) {
95 *putc = putc_ns9360;
96 *base = NS9360_UARTA;
97 return;
98 } else if (NS9360_UART_ENABLED(NS9360_UARTB)) {
99 *putc = putc_ns9360;
100 *base = NS9360_UARTB;
101 return;
102 } else if (NS9360_UART_ENABLED(NS9360_UARTC)) {
103 *putc = putc_ns9360;
104 *base = NS9360_UARTC;
105 return;
106 } else if (NS9360_UART_ENABLED(NS9360_UARTD)) {
107 *putc = putc_ns9360;
108 *base = NS9360_UARTD;
109 return;
110 } else if (__raw_readl(__REG(0xa09001f4)) == 0xfffff001) {
111 *putc = putc_a9m9750dev;
112 *base = A9M9750DEV_UARTA;
113 return;
114 }
115 } else if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x02) {
116 /* ns921x */
117 u32 clock = __raw_readl(NS921XSYS_CLOCK);
118
119 if ((clock & (1 << 1)) &&
120 NS921X_UART_ENABLED(NS921X_UARTA)) {
121 *putc = putc_ns921x;
122 *base = NS921X_UARTA;
123 return;
124 } else if ((clock & (1 << 2)) &&
125 NS921X_UART_ENABLED(NS921X_UARTB)) {
126 *putc = putc_ns921x;
127 *base = NS921X_UARTB;
128 return;
129 } else if ((clock & (1 << 3)) &&
130 NS921X_UART_ENABLED(NS921X_UARTC)) {
131 *putc = putc_ns921x;
132 *base = NS921X_UARTC;
133 return;
134 } else if ((clock & (1 << 4)) &&
135 NS921X_UART_ENABLED(NS921X_UARTD)) {
136 *putc = putc_ns921x;
137 *base = NS921X_UARTD;
138 return;
139 }
140 }
141
142 *putc = putc_dummy;
143}
144
145void (*myputc)(char, void __iomem *);
146void __iomem *base;
147
148static void putc(char c)
149{
150 myputc(c, base);
151}
152
153static void arch_decomp_setup(void)
154{
155 autodetect(&myputc, &base);
156}
28#define arch_decomp_wdog() 157#define arch_decomp_wdog()
29 158
30static void flush(void) 159static void flush(void)
diff --git a/include/asm-arm/arch-omap/board-osk.h b/include/asm-arm/arch-omap/board-osk.h
index 2b1a8a4fe44e..94926090e475 100644
--- a/include/asm-arm/arch-omap/board-osk.h
+++ b/include/asm-arm/arch-omap/board-osk.h
@@ -32,5 +32,16 @@
32/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */ 32/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */
33#define OMAP_OSK_ETHR_START 0x04800300 33#define OMAP_OSK_ETHR_START 0x04800300
34 34
35/* TPS65010 has four GPIOs. nPG and LED2 can be treated like GPIOs with
36 * alternate pin configurations for hardware-controlled blinking.
37 */
38#define OSK_TPS_GPIO_BASE (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */)
39# define OSK_TPS_GPIO_USB_PWR_EN (OSK_TPS_GPIO_BASE + 0)
40# define OSK_TPS_GPIO_LED_D3 (OSK_TPS_GPIO_BASE + 1)
41# define OSK_TPS_GPIO_LAN_RESET (OSK_TPS_GPIO_BASE + 2)
42# define OSK_TPS_GPIO_DSP_PWR_EN (OSK_TPS_GPIO_BASE + 3)
43# define OSK_TPS_GPIO_LED_D9 (OSK_TPS_GPIO_BASE + 4)
44# define OSK_TPS_GPIO_LED_D2 (OSK_TPS_GPIO_BASE + 5)
45
35#endif /* __ASM_ARCH_OMAP_OSK_H */ 46#endif /* __ASM_ARCH_OMAP_OSK_H */
36 47
diff --git a/include/asm-arm/arch-omap/clock.h b/include/asm-arm/arch-omap/clock.h
index fa6881049903..57523bdb642b 100644
--- a/include/asm-arm/arch-omap/clock.h
+++ b/include/asm-arm/arch-omap/clock.h
@@ -14,6 +14,35 @@
14#define __ARCH_ARM_OMAP_CLOCK_H 14#define __ARCH_ARM_OMAP_CLOCK_H
15 15
16struct module; 16struct module;
17struct clk;
18
19#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
20
21struct clksel_rate {
22 u8 div;
23 u32 val;
24 u8 flags;
25};
26
27struct clksel {
28 struct clk *parent;
29 const struct clksel_rate *rates;
30};
31
32struct dpll_data {
33 void __iomem *mult_div1_reg;
34 u32 mult_mask;
35 u32 div1_mask;
36# if defined(CONFIG_ARCH_OMAP3)
37 void __iomem *control_reg;
38 u32 enable_mask;
39 u8 auto_recal_bit;
40 u8 recal_en_bit;
41 u8 recal_st_bit;
42# endif
43};
44
45#endif
17 46
18struct clk { 47struct clk {
19 struct list_head node; 48 struct list_head node;
@@ -25,8 +54,6 @@ struct clk {
25 __u32 flags; 54 __u32 flags;
26 void __iomem *enable_reg; 55 void __iomem *enable_reg;
27 __u8 enable_bit; 56 __u8 enable_bit;
28 __u8 rate_offset;
29 __u8 src_offset;
30 __s8 usecount; 57 __s8 usecount;
31 void (*recalc)(struct clk *); 58 void (*recalc)(struct clk *);
32 int (*set_rate)(struct clk *, unsigned long); 59 int (*set_rate)(struct clk *, unsigned long);
@@ -34,6 +61,16 @@ struct clk {
34 void (*init)(struct clk *); 61 void (*init)(struct clk *);
35 int (*enable)(struct clk *); 62 int (*enable)(struct clk *);
36 void (*disable)(struct clk *); 63 void (*disable)(struct clk *);
64#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
65 u8 fixed_div;
66 void __iomem *clksel_reg;
67 u32 clksel_mask;
68 const struct clksel *clksel;
69 const struct dpll_data *dpll_data;
70#else
71 __u8 rate_offset;
72 __u8 src_offset;
73#endif
37}; 74};
38 75
39struct clk_functions { 76struct clk_functions {
@@ -54,10 +91,12 @@ extern int clk_init(struct clk_functions * custom_clocks);
54extern int clk_register(struct clk *clk); 91extern int clk_register(struct clk *clk);
55extern void clk_unregister(struct clk *clk); 92extern void clk_unregister(struct clk *clk);
56extern void propagate_rate(struct clk *clk); 93extern void propagate_rate(struct clk *clk);
94extern void recalculate_root_clocks(void);
57extern void followparent_recalc(struct clk * clk); 95extern void followparent_recalc(struct clk * clk);
58extern void clk_allow_idle(struct clk *clk); 96extern void clk_allow_idle(struct clk *clk);
59extern void clk_deny_idle(struct clk *clk); 97extern void clk_deny_idle(struct clk *clk);
60extern int clk_get_usecount(struct clk *clk); 98extern int clk_get_usecount(struct clk *clk);
99extern void clk_enable_init_clocks(void);
61 100
62/* Clock flags */ 101/* Clock flags */
63#define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */ 102#define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */
@@ -71,21 +110,33 @@ extern int clk_get_usecount(struct clk *clk);
71#define CLOCK_NO_IDLE_PARENT (1 << 8) 110#define CLOCK_NO_IDLE_PARENT (1 << 8)
72#define DELAYED_APP (1 << 9) /* Delay application of clock */ 111#define DELAYED_APP (1 << 9) /* Delay application of clock */
73#define CONFIG_PARTICIPANT (1 << 10) /* Fundamental clock */ 112#define CONFIG_PARTICIPANT (1 << 10) /* Fundamental clock */
74#define CM_MPU_SEL1 (1 << 11) /* Domain divider/source */ 113#define ENABLE_ON_INIT (1 << 11) /* Enable upon framework init */
75#define CM_DSP_SEL1 (1 << 12) 114#define INVERT_ENABLE (1 << 12) /* 0 enables, 1 disables */
76#define CM_GFX_SEL1 (1 << 13) 115/* bits 13-20 are currently free */
77#define CM_MODEM_SEL1 (1 << 14)
78#define CM_CORE_SEL1 (1 << 15) /* Sets divider for many */
79#define CM_CORE_SEL2 (1 << 16) /* sets parent for GPT */
80#define CM_WKUP_SEL1 (1 << 17)
81#define CM_PLL_SEL1 (1 << 18)
82#define CM_PLL_SEL2 (1 << 19)
83#define CM_SYSCLKOUT_SEL1 (1 << 20)
84#define CLOCK_IN_OMAP310 (1 << 21) 116#define CLOCK_IN_OMAP310 (1 << 21)
85#define CLOCK_IN_OMAP730 (1 << 22) 117#define CLOCK_IN_OMAP730 (1 << 22)
86#define CLOCK_IN_OMAP1510 (1 << 23) 118#define CLOCK_IN_OMAP1510 (1 << 23)
87#define CLOCK_IN_OMAP16XX (1 << 24) 119#define CLOCK_IN_OMAP16XX (1 << 24)
88#define CLOCK_IN_OMAP242X (1 << 25) 120#define CLOCK_IN_OMAP242X (1 << 25)
89#define CLOCK_IN_OMAP243X (1 << 26) 121#define CLOCK_IN_OMAP243X (1 << 26)
122#define CLOCK_IN_OMAP343X (1 << 27) /* clocks common to all 343X */
123#define PARENT_CONTROLS_CLOCK (1 << 28)
124#define CLOCK_IN_OMAP3430ES1 (1 << 29) /* 3430ES1 clocks only */
125#define CLOCK_IN_OMAP3430ES2 (1 << 30) /* 3430ES2 clocks only */
126
127/* Clksel_rate flags */
128#define DEFAULT_RATE (1 << 0)
129#define RATE_IN_242X (1 << 1)
130#define RATE_IN_243X (1 << 2)
131#define RATE_IN_343X (1 << 3) /* rates common to all 343X */
132#define RATE_IN_3430ES2 (1 << 4) /* 3430ES2 rates only */
133
134#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
135
136
137/* CM_CLKSEL2_PLL.CORE_CLK_SRC options (24XX) */
138#define CORE_CLK_SRC_32K 0
139#define CORE_CLK_SRC_DPLL 1
140#define CORE_CLK_SRC_DPLL_X2 2
90 141
91#endif 142#endif
diff --git a/include/asm-arm/arch-omap/control.h b/include/asm-arm/arch-omap/control.h
new file mode 100644
index 000000000000..9944bb5d5330
--- /dev/null
+++ b/include/asm-arm/arch-omap/control.h
@@ -0,0 +1,191 @@
1#ifndef __ASM_ARCH_CONTROL_H
2#define __ASM_ARCH_CONTROL_H
3
4/*
5 * include/asm-arm/arch-omap/control.h
6 *
7 * OMAP2/3 System Control Module definitions
8 *
9 * Copyright (C) 2007 Texas Instruments, Inc.
10 * Copyright (C) 2007 Nokia Corporation
11 *
12 * Written by Paul Walmsley
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation.
17 */
18
19#include <asm/arch/io.h>
20
21#define OMAP242X_CTRL_REGADDR(reg) \
22 (void __iomem *)IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
23#define OMAP243X_CTRL_REGADDR(reg) \
24 (void __iomem *)IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
25#define OMAP343X_CTRL_REGADDR(reg) \
26 (void __iomem *)IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
27
28/*
29 * As elsewhere, the "OMAP2_" prefix indicates that the macro is valid for
30 * OMAP24XX and OMAP34XX.
31 */
32
33/* Control submodule offsets */
34
35#define OMAP2_CONTROL_INTERFACE 0x000
36#define OMAP2_CONTROL_PADCONFS 0x030
37#define OMAP2_CONTROL_GENERAL 0x270
38#define OMAP343X_CONTROL_MEM_WKUP 0x600
39#define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
40#define OMAP343X_CONTROL_GENERAL_WKUP 0xa60
41
42/* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
43
44#define OMAP2_CONTROL_SYSCONFIG (OMAP2_CONTROL_INTERFACE + 0x10)
45
46/* CONTROL_GENERAL register offsets common to OMAP2 & 3 */
47#define OMAP2_CONTROL_DEVCONF0 (OMAP2_CONTROL_GENERAL + 0x0004)
48#define OMAP2_CONTROL_MSUSPENDMUX_0 (OMAP2_CONTROL_GENERAL + 0x0020)
49#define OMAP2_CONTROL_MSUSPENDMUX_1 (OMAP2_CONTROL_GENERAL + 0x0024)
50#define OMAP2_CONTROL_MSUSPENDMUX_2 (OMAP2_CONTROL_GENERAL + 0x0028)
51#define OMAP2_CONTROL_MSUSPENDMUX_3 (OMAP2_CONTROL_GENERAL + 0x002c)
52#define OMAP2_CONTROL_MSUSPENDMUX_4 (OMAP2_CONTROL_GENERAL + 0x0030)
53#define OMAP2_CONTROL_MSUSPENDMUX_5 (OMAP2_CONTROL_GENERAL + 0x0034)
54#define OMAP2_CONTROL_SEC_CTRL (OMAP2_CONTROL_GENERAL + 0x0040)
55#define OMAP2_CONTROL_RPUB_KEY_H_0 (OMAP2_CONTROL_GENERAL + 0x0090)
56#define OMAP2_CONTROL_RPUB_KEY_H_1 (OMAP2_CONTROL_GENERAL + 0x0094)
57#define OMAP2_CONTROL_RPUB_KEY_H_2 (OMAP2_CONTROL_GENERAL + 0x0098)
58#define OMAP2_CONTROL_RPUB_KEY_H_3 (OMAP2_CONTROL_GENERAL + 0x009c)
59
60/* 242x-only CONTROL_GENERAL register offsets */
61#define OMAP242X_CONTROL_DEVCONF OMAP2_CONTROL_DEVCONF0 /* match TRM */
62#define OMAP242X_CONTROL_OCM_RAM_PERM (OMAP2_CONTROL_GENERAL + 0x0068)
63
64/* 243x-only CONTROL_GENERAL register offsets */
65/* CONTROL_IVA2_BOOT{ADDR,MOD} are at the same place on 343x - noted below */
66#define OMAP243X_CONTROL_DEVCONF1 (OMAP2_CONTROL_GENERAL + 0x0078)
67#define OMAP243X_CONTROL_CSIRXFE (OMAP2_CONTROL_GENERAL + 0x007c)
68#define OMAP243X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190)
69#define OMAP243X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194)
70#define OMAP243X_CONTROL_IVA2_GEMCFG (OMAP2_CONTROL_GENERAL + 0x0198)
71
72/* 24xx-only CONTROL_GENERAL register offsets */
73#define OMAP24XX_CONTROL_DEBOBS (OMAP2_CONTROL_GENERAL + 0x0000)
74#define OMAP24XX_CONTROL_EMU_SUPPORT (OMAP2_CONTROL_GENERAL + 0x0008)
75#define OMAP24XX_CONTROL_SEC_TEST (OMAP2_CONTROL_GENERAL + 0x0044)
76#define OMAP24XX_CONTROL_PSA_CTRL (OMAP2_CONTROL_GENERAL + 0x0048)
77#define OMAP24XX_CONTROL_PSA_CMD (OMAP2_CONTROL_GENERAL + 0x004c)
78#define OMAP24XX_CONTROL_PSA_VALUE (OMAP2_CONTROL_GENERAL + 0x0050)
79#define OMAP24XX_CONTROL_SEC_EMU (OMAP2_CONTROL_GENERAL + 0x0060)
80#define OMAP24XX_CONTROL_SEC_TAP (OMAP2_CONTROL_GENERAL + 0x0064)
81#define OMAP24XX_CONTROL_OCM_PUB_RAM_ADD (OMAP2_CONTROL_GENERAL + 0x006c)
82#define OMAP24XX_CONTROL_EXT_SEC_RAM_START_ADD (OMAP2_CONTROL_GENERAL + 0x0070)
83#define OMAP24XX_CONTROL_EXT_SEC_RAM_STOP_ADD (OMAP2_CONTROL_GENERAL + 0x0074
84#define OMAP24XX_CONTROL_SEC_STATUS (OMAP2_CONTROL_GENERAL + 0x0080)
85#define OMAP24XX_CONTROL_SEC_ERR_STATUS (OMAP2_CONTROL_GENERAL + 0x0084)
86#define OMAP24XX_CONTROL_STATUS (OMAP2_CONTROL_GENERAL + 0x0088)
87#define OMAP24XX_CONTROL_GENERAL_PURPOSE_STATUS (OMAP2_CONTROL_GENERAL + 0x008c)
88#define OMAP24XX_CONTROL_RAND_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00a0)
89#define OMAP24XX_CONTROL_RAND_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00a4)
90#define OMAP24XX_CONTROL_RAND_KEY_2 (OMAP2_CONTROL_GENERAL + 0x00a8)
91#define OMAP24XX_CONTROL_RAND_KEY_3 (OMAP2_CONTROL_GENERAL + 0x00ac)
92#define OMAP24XX_CONTROL_CUST_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00b0)
93#define OMAP24XX_CONTROL_CUST_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00b4)
94#define OMAP24XX_CONTROL_TEST_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00c0)
95#define OMAP24XX_CONTROL_TEST_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00c4)
96#define OMAP24XX_CONTROL_TEST_KEY_2 (OMAP2_CONTROL_GENERAL + 0x00c8)
97#define OMAP24XX_CONTROL_TEST_KEY_3 (OMAP2_CONTROL_GENERAL + 0x00cc)
98#define OMAP24XX_CONTROL_TEST_KEY_4 (OMAP2_CONTROL_GENERAL + 0x00d0)
99#define OMAP24XX_CONTROL_TEST_KEY_5 (OMAP2_CONTROL_GENERAL + 0x00d4)
100#define OMAP24XX_CONTROL_TEST_KEY_6 (OMAP2_CONTROL_GENERAL + 0x00d8)
101#define OMAP24XX_CONTROL_TEST_KEY_7 (OMAP2_CONTROL_GENERAL + 0x00dc)
102#define OMAP24XX_CONTROL_TEST_KEY_8 (OMAP2_CONTROL_GENERAL + 0x00e0)
103#define OMAP24XX_CONTROL_TEST_KEY_9 (OMAP2_CONTROL_GENERAL + 0x00e4)
104
105/* 34xx-only CONTROL_GENERAL register offsets */
106#define OMAP343X_CONTROL_PADCONF_OFF (OMAP2_CONTROL_GENERAL + 0x0000)
107#define OMAP343X_CONTROL_MEM_DFTRW0 (OMAP2_CONTROL_GENERAL + 0x0008)
108#define OMAP343X_CONTROL_MEM_DFTRW1 (OMAP2_CONTROL_GENERAL + 0x000c)
109#define OMAP343X_CONTROL_DEVCONF1 (OMAP2_CONTROL_GENERAL + 0x0068)
110#define OMAP343X_CONTROL_CSIRXFE (OMAP2_CONTROL_GENERAL + 0x006c)
111#define OMAP343X_CONTROL_SEC_STATUS (OMAP2_CONTROL_GENERAL + 0x0070)
112#define OMAP343X_CONTROL_SEC_ERR_STATUS (OMAP2_CONTROL_GENERAL + 0x0074)
113#define OMAP343X_CONTROL_SEC_ERR_STATUS_DEBUG (OMAP2_CONTROL_GENERAL + 0x0078)
114#define OMAP343X_CONTROL_STATUS (OMAP2_CONTROL_GENERAL + 0x0080)
115#define OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS (OMAP2_CONTROL_GENERAL + 0x0084)
116#define OMAP343X_CONTROL_RPUB_KEY_H_4 (OMAP2_CONTROL_GENERAL + 0x00a0)
117#define OMAP343X_CONTROL_RAND_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00a8)
118#define OMAP343X_CONTROL_RAND_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00ac)
119#define OMAP343X_CONTROL_RAND_KEY_2 (OMAP2_CONTROL_GENERAL + 0x00b0)
120#define OMAP343X_CONTROL_RAND_KEY_3 (OMAP2_CONTROL_GENERAL + 0x00b4)
121#define OMAP343X_CONTROL_TEST_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00c8)
122#define OMAP343X_CONTROL_TEST_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00cc)
123#define OMAP343X_CONTROL_TEST_KEY_2 (OMAP2_CONTROL_GENERAL + 0x00d0)
124#define OMAP343X_CONTROL_TEST_KEY_3 (OMAP2_CONTROL_GENERAL + 0x00d4)
125#define OMAP343X_CONTROL_TEST_KEY_4 (OMAP2_CONTROL_GENERAL + 0x00d8)
126#define OMAP343X_CONTROL_TEST_KEY_5 (OMAP2_CONTROL_GENERAL + 0x00dc)
127#define OMAP343X_CONTROL_TEST_KEY_6 (OMAP2_CONTROL_GENERAL + 0x00e0)
128#define OMAP343X_CONTROL_TEST_KEY_7 (OMAP2_CONTROL_GENERAL + 0x00e4)
129#define OMAP343X_CONTROL_TEST_KEY_8 (OMAP2_CONTROL_GENERAL + 0x00e8)
130#define OMAP343X_CONTROL_TEST_KEY_9 (OMAP2_CONTROL_GENERAL + 0x00ec)
131#define OMAP343X_CONTROL_TEST_KEY_10 (OMAP2_CONTROL_GENERAL + 0x00f0)
132#define OMAP343X_CONTROL_TEST_KEY_11 (OMAP2_CONTROL_GENERAL + 0x00f4)
133#define OMAP343X_CONTROL_TEST_KEY_12 (OMAP2_CONTROL_GENERAL + 0x00f8)
134#define OMAP343X_CONTROL_TEST_KEY_13 (OMAP2_CONTROL_GENERAL + 0x00fc)
135#define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190)
136#define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194)
137
138/*
139 * REVISIT: This list of registers is not comprehensive - there are more
140 * that should be added.
141 */
142
143/*
144 * Control module register bit defines - these should eventually go into
145 * their own regbits file. Some of these will be complicated, depending
146 * on the device type (general-purpose, emulator, test, secure, bad, other)
147 * and the security mode (secure, non-secure, don't care)
148 */
149/* CONTROL_DEVCONF0 bits */
150#define OMAP24XX_USBSTANDBYCTRL (1 << 15)
151#define OMAP2_MCBSP2_CLKS_MASK (1 << 6)
152#define OMAP2_MCBSP1_CLKS_MASK (1 << 2)
153
154/* CONTROL_DEVCONF1 bits */
155#define OMAP2_MCBSP5_CLKS_MASK (1 << 4) /* > 242x */
156#define OMAP2_MCBSP4_CLKS_MASK (1 << 2) /* > 242x */
157#define OMAP2_MCBSP3_CLKS_MASK (1 << 0) /* > 242x */
158
159/* CONTROL_STATUS bits */
160#define OMAP2_DEVICETYPE_MASK (0x7 << 8)
161#define OMAP2_SYSBOOT_5_MASK (1 << 5)
162#define OMAP2_SYSBOOT_4_MASK (1 << 4)
163#define OMAP2_SYSBOOT_3_MASK (1 << 3)
164#define OMAP2_SYSBOOT_2_MASK (1 << 2)
165#define OMAP2_SYSBOOT_1_MASK (1 << 1)
166#define OMAP2_SYSBOOT_0_MASK (1 << 0)
167
168#ifndef __ASSEMBLY__
169#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
170extern void omap_ctrl_base_set(u32 base);
171extern u32 omap_ctrl_base_get(void);
172extern u8 omap_ctrl_readb(u16 offset);
173extern u16 omap_ctrl_readw(u16 offset);
174extern u32 omap_ctrl_readl(u16 offset);
175extern void omap_ctrl_writeb(u8 val, u16 offset);
176extern void omap_ctrl_writew(u16 val, u16 offset);
177extern void omap_ctrl_writel(u32 val, u16 offset);
178#else
179#define omap_ctrl_base_set(x) WARN_ON(1)
180#define omap_ctrl_base_get() 0
181#define omap_ctrl_readb(x) 0
182#define omap_ctrl_readw(x) 0
183#define omap_ctrl_readl(x) 0
184#define omap_ctrl_writeb(x, y) WARN_ON(1)
185#define omap_ctrl_writew(x, y) WARN_ON(1)
186#define omap_ctrl_writel(x, y) WARN_ON(1)
187#endif
188#endif /* __ASSEMBLY__ */
189
190#endif /* __ASM_ARCH_CONTROL_H */
191
diff --git a/include/asm-arm/arch-omap/entry-macro.S b/include/asm-arm/arch-omap/entry-macro.S
index f6967c8df323..74cd57221c8e 100644
--- a/include/asm-arm/arch-omap/entry-macro.S
+++ b/include/asm-arm/arch-omap/entry-macro.S
@@ -68,7 +68,7 @@
68 .endm 68 .endm
69 69
70 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 70 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
71 ldr \base, =VA_IC_BASE 71 ldr \base, =OMAP2_VA_IC_BASE
72 ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */ 72 ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */
73 cmp \irqnr, #0x0 73 cmp \irqnr, #0x0
74 bne 2222f 74 bne 2222f
diff --git a/include/asm-arm/arch-omap/gpio.h b/include/asm-arm/arch-omap/gpio.h
index 164da09be095..86621a04cd8f 100644
--- a/include/asm-arm/arch-omap/gpio.h
+++ b/include/asm-arm/arch-omap/gpio.h
@@ -82,62 +82,35 @@ extern void omap_set_gpio_debounce_time(int gpio, int enable);
82 82
83/*-------------------------------------------------------------------------*/ 83/*-------------------------------------------------------------------------*/
84 84
85/* wrappers for "new style" GPIO calls. the old OMAP-specfic ones should 85/* Wrappers for "new style" GPIO calls, using the new infrastructure
86 * eventually be removed (along with this errno.h inclusion), and maybe 86 * which lets us plug in FPGA, I2C, and other implementations.
87 * gpios should put MPUIOs last too. 87 * *
88 * The original OMAP-specfic calls should eventually be removed.
88 */ 89 */
89 90
90#include <asm/errno.h> 91#include <linux/errno.h>
91 92#include <asm-generic/gpio.h>
92static inline int gpio_request(unsigned gpio, const char *label)
93{
94 return omap_request_gpio(gpio);
95}
96
97static inline void gpio_free(unsigned gpio)
98{
99 omap_free_gpio(gpio);
100}
101
102static inline int __gpio_set_direction(unsigned gpio, int is_input)
103{
104 if (cpu_class_is_omap2()) {
105 if (gpio > OMAP_MAX_GPIO_LINES)
106 return -EINVAL;
107 } else {
108 if (gpio > (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */))
109 return -EINVAL;
110 }
111 omap_set_gpio_direction(gpio, is_input);
112 return 0;
113}
114
115static inline int gpio_direction_input(unsigned gpio)
116{
117 return __gpio_set_direction(gpio, 1);
118}
119
120static inline int gpio_direction_output(unsigned gpio, int value)
121{
122 omap_set_gpio_dataout(gpio, value);
123 return __gpio_set_direction(gpio, 0);
124}
125 93
126static inline int gpio_get_value(unsigned gpio) 94static inline int gpio_get_value(unsigned gpio)
127{ 95{
128 return omap_get_gpio_datain(gpio); 96 return __gpio_get_value(gpio);
129} 97}
130 98
131static inline void gpio_set_value(unsigned gpio, int value) 99static inline void gpio_set_value(unsigned gpio, int value)
132{ 100{
133 omap_set_gpio_dataout(gpio, value); 101 __gpio_set_value(gpio, value);
134} 102}
135 103
136#include <asm-generic/gpio.h> /* cansleep wrappers */ 104static inline int gpio_cansleep(unsigned gpio)
105{
106 return __gpio_cansleep(gpio);
107}
137 108
138static inline int gpio_to_irq(unsigned gpio) 109static inline int gpio_to_irq(unsigned gpio)
139{ 110{
140 return OMAP_GPIO_IRQ(gpio); 111 if (gpio < (OMAP_MAX_GPIO_LINES + 16))
112 return OMAP_GPIO_IRQ(gpio);
113 return -EINVAL;
141} 114}
142 115
143static inline int irq_to_gpio(unsigned irq) 116static inline int irq_to_gpio(unsigned irq)
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h
index 289082d07f14..160578e1f557 100644
--- a/include/asm-arm/arch-omap/io.h
+++ b/include/asm-arm/arch-omap/io.h
@@ -80,6 +80,13 @@
80#define OMAP243X_GPMC_PHYS OMAP243X_GPMC_BASE /* 0x49000000 */ 80#define OMAP243X_GPMC_PHYS OMAP243X_GPMC_BASE /* 0x49000000 */
81#define OMAP243X_GPMC_VIRT 0xFE000000 81#define OMAP243X_GPMC_VIRT 0xFE000000
82#define OMAP243X_GPMC_SIZE SZ_1M 82#define OMAP243X_GPMC_SIZE SZ_1M
83#define OMAP243X_SDRC_PHYS OMAP243X_SDRC_BASE
84#define OMAP243X_SDRC_VIRT 0xFD000000
85#define OMAP243X_SDRC_SIZE SZ_1M
86#define OMAP243X_SMS_PHYS OMAP243X_SMS_BASE
87#define OMAP243X_SMS_VIRT 0xFC000000
88#define OMAP243X_SMS_SIZE SZ_1M
89
83#endif 90#endif
84 91
85#define IO_OFFSET 0x90000000 92#define IO_OFFSET 0x90000000
@@ -88,16 +95,73 @@
88#define io_v2p(va) ((va) - IO_OFFSET) /* Works for L3 and L4 */ 95#define io_v2p(va) ((va) - IO_OFFSET) /* Works for L3 and L4 */
89 96
90/* DSP */ 97/* DSP */
91#define DSP_MEM_24XX_PHYS OMAP24XX_DSP_MEM_BASE /* 0x58000000 */ 98#define DSP_MEM_24XX_PHYS OMAP2420_DSP_MEM_BASE /* 0x58000000 */
92#define DSP_MEM_24XX_VIRT 0xe0000000 99#define DSP_MEM_24XX_VIRT 0xe0000000
93#define DSP_MEM_24XX_SIZE 0x28000 100#define DSP_MEM_24XX_SIZE 0x28000
94#define DSP_IPI_24XX_PHYS OMAP24XX_DSP_IPI_BASE /* 0x59000000 */ 101#define DSP_IPI_24XX_PHYS OMAP2420_DSP_IPI_BASE /* 0x59000000 */
95#define DSP_IPI_24XX_VIRT 0xe1000000 102#define DSP_IPI_24XX_VIRT 0xe1000000
96#define DSP_IPI_24XX_SIZE SZ_4K 103#define DSP_IPI_24XX_SIZE SZ_4K
97#define DSP_MMU_24XX_PHYS OMAP24XX_DSP_MMU_BASE /* 0x5a000000 */ 104#define DSP_MMU_24XX_PHYS OMAP2420_DSP_MMU_BASE /* 0x5a000000 */
98#define DSP_MMU_24XX_VIRT 0xe2000000 105#define DSP_MMU_24XX_VIRT 0xe2000000
99#define DSP_MMU_24XX_SIZE SZ_4K 106#define DSP_MMU_24XX_SIZE SZ_4K
100 107
108#elif defined(CONFIG_ARCH_OMAP3)
109
110/* We map both L3 and L4 on OMAP3 */
111#define L3_34XX_PHYS L3_34XX_BASE /* 0x68000000 */
112#define L3_34XX_VIRT 0xf8000000
113#define L3_34XX_SIZE SZ_1M /* 44kB of 128MB used, want 1MB sect */
114
115#define L4_34XX_PHYS L4_34XX_BASE /* 0x48000000 */
116#define L4_34XX_VIRT 0xd8000000
117#define L4_34XX_SIZE SZ_4M /* 1MB of 128MB used, want 1MB sect */
118
119/*
120 * Need to look at the Size 4M for L4.
121 * VPOM3430 was not working for Int controller
122 */
123
124#define L4_WK_34XX_PHYS L4_WK_34XX_BASE /* 0x48300000 */
125#define L4_WK_34XX_VIRT 0xd8300000
126#define L4_WK_34XX_SIZE SZ_1M
127
128#define L4_PER_34XX_PHYS L4_PER_34XX_BASE /* 0x49000000 */
129#define L4_PER_34XX_VIRT 0xd9000000
130#define L4_PER_34XX_SIZE SZ_1M
131
132#define L4_EMU_34XX_PHYS L4_EMU_34XX_BASE /* 0x54000000 */
133#define L4_EMU_34XX_VIRT 0xe4000000
134#define L4_EMU_34XX_SIZE SZ_64M
135
136#define OMAP34XX_GPMC_PHYS OMAP34XX_GPMC_BASE /* 0x6E000000 */
137#define OMAP34XX_GPMC_VIRT 0xFE000000
138#define OMAP34XX_GPMC_SIZE SZ_1M
139
140#define OMAP343X_SMS_PHYS OMAP343X_SMS_BASE /* 0x6C000000 */
141#define OMAP343X_SMS_VIRT 0xFC000000
142#define OMAP343X_SMS_SIZE SZ_1M
143
144#define OMAP343X_SDRC_PHYS OMAP343X_SDRC_BASE /* 0x6D000000 */
145#define OMAP343X_SDRC_VIRT 0xFD000000
146#define OMAP343X_SDRC_SIZE SZ_1M
147
148
149#define IO_OFFSET 0x90000000
150#define IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */
151#define io_p2v(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */
152#define io_v2p(va) ((va) - IO_OFFSET)/* Works for L3 and L4 */
153
154/* DSP */
155#define DSP_MEM_34XX_PHYS OMAP34XX_DSP_MEM_BASE /* 0x58000000 */
156#define DSP_MEM_34XX_VIRT 0xe0000000
157#define DSP_MEM_34XX_SIZE 0x28000
158#define DSP_IPI_34XX_PHYS OMAP34XX_DSP_IPI_BASE /* 0x59000000 */
159#define DSP_IPI_34XX_VIRT 0xe1000000
160#define DSP_IPI_34XX_SIZE SZ_4K
161#define DSP_MMU_34XX_PHYS OMAP34XX_DSP_MMU_BASE /* 0x5a000000 */
162#define DSP_MMU_34XX_VIRT 0xe2000000
163#define DSP_MMU_34XX_SIZE SZ_4K
164
101#endif 165#endif
102 166
103#ifndef __ASSEMBLER__ 167#ifndef __ASSEMBLER__
diff --git a/include/asm-arm/arch-omap/mmc.h b/include/asm-arm/arch-omap/mmc.h
index b70e37b61242..c9588f49eb52 100644
--- a/include/asm-arm/arch-omap/mmc.h
+++ b/include/asm-arm/arch-omap/mmc.h
@@ -18,6 +18,8 @@
18#define OMAP_MMC_MAX_SLOTS 2 18#define OMAP_MMC_MAX_SLOTS 2
19 19
20struct omap_mmc_platform_data { 20struct omap_mmc_platform_data {
21 struct omap_mmc_conf conf;
22
21 unsigned enabled:1; 23 unsigned enabled:1;
22 /* number of slots on board */ 24 /* number of slots on board */
23 unsigned nr_slots:2; 25 unsigned nr_slots:2;
diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h
index b8fff50e6a87..ff9a5b5575fd 100644
--- a/include/asm-arm/arch-omap/mux.h
+++ b/include/asm-arm/arch-omap/mux.h
@@ -4,9 +4,10 @@
4 * Table of the Omap register configurations for the FUNC_MUX and 4 * Table of the Omap register configurations for the FUNC_MUX and
5 * PULL_DWN combinations. 5 * PULL_DWN combinations.
6 * 6 *
7 * Copyright (C) 2003 - 2005 Nokia Corporation 7 * Copyright (C) 2004 - 2008 Texas Instruments Inc.
8 * Copyright (C) 2003 - 2008 Nokia Corporation
8 * 9 *
9 * Written by Tony Lindgren <tony.lindgren@nokia.com> 10 * Written by Tony Lindgren
10 * 11 *
11 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by 13 * it under the terms of the GNU General Public License as published by
@@ -27,14 +28,6 @@
27 * - W8 = ball 28 * - W8 = ball
28 * - 1610 = 1510 or 1610, none if common for both 1510 and 1610 29 * - 1610 = 1510 or 1610, none if common for both 1510 and 1610
29 * - MMC2_DAT0 = function 30 * - MMC2_DAT0 = function
30 *
31 * Change log:
32 * Added entry for the I2C interface. (02Feb 2004)
33 * Copyright (C) 2004 Texas Instruments
34 *
35 * Added entry for the keypad and uwire CS1. (09Mar 2004)
36 * Copyright (C) 2004 Texas Instruments
37 *
38 */ 31 */
39 32
40#ifndef __ASM_ARCH_MUX_H 33#ifndef __ASM_ARCH_MUX_H
@@ -469,7 +462,12 @@ enum omap24xx_index {
469 AA8_242X_GPIO58, 462 AA8_242X_GPIO58,
470 Y20_24XX_GPIO60, 463 Y20_24XX_GPIO60,
471 W4__24XX_GPIO74, 464 W4__24XX_GPIO74,
465 N15_24XX_GPIO85,
472 M15_24XX_GPIO92, 466 M15_24XX_GPIO92,
467 P20_24XX_GPIO93,
468 P18_24XX_GPIO95,
469 M18_24XX_GPIO96,
470 L14_24XX_GPIO97,
473 J15_24XX_GPIO99, 471 J15_24XX_GPIO99,
474 V14_24XX_GPIO117, 472 V14_24XX_GPIO117,
475 P14_24XX_GPIO125, 473 P14_24XX_GPIO125,
@@ -494,8 +492,6 @@ enum omap24xx_index {
494 D3_242X_DMAREQ4, 492 D3_242X_DMAREQ4,
495 E3_242X_DMAREQ5, 493 E3_242X_DMAREQ5,
496 494
497 P20_24XX_TSC_IRQ,
498
499 /* UART3 */ 495 /* UART3 */
500 K15_24XX_UART3_TX, 496 K15_24XX_UART3_TX,
501 K14_24XX_UART3_RX, 497 K14_24XX_UART3_RX,
@@ -557,13 +553,57 @@ enum omap24xx_index {
557 B3__24XX_KBR5, 553 B3__24XX_KBR5,
558 AA4_24XX_KBC2, 554 AA4_24XX_KBC2,
559 B13_24XX_KBC6, 555 B13_24XX_KBC6,
556
557 /* 2430 USB */
558 AD9_2430_USB0_PUEN,
559 Y11_2430_USB0_VP,
560 AD7_2430_USB0_VM,
561 AE7_2430_USB0_RCV,
562 AD4_2430_USB0_TXEN,
563 AF9_2430_USB0_SE0,
564 AE6_2430_USB0_DAT,
565 AD24_2430_USB1_SE0,
566 AB24_2430_USB1_RCV,
567 Y25_2430_USB1_TXEN,
568 AA26_2430_USB1_DAT,
569
570 /* 2430 HS-USB */
571 AD9_2430_USB0HS_DATA3,
572 Y11_2430_USB0HS_DATA4,
573 AD7_2430_USB0HS_DATA5,
574 AE7_2430_USB0HS_DATA6,
575 AD4_2430_USB0HS_DATA2,
576 AF9_2430_USB0HS_DATA0,
577 AE6_2430_USB0HS_DATA1,
578 AE8_2430_USB0HS_CLK,
579 AD8_2430_USB0HS_DIR,
580 AE5_2430_USB0HS_STP,
581 AE9_2430_USB0HS_NXT,
582 AC7_2430_USB0HS_DATA7,
583
584 /* 2430 McBSP */
585 AC10_2430_MCBSP2_FSX,
586 AD16_2430_MCBSP2_CLX,
587 AE13_2430_MCBSP2_DX,
588 AD13_2430_MCBSP2_DR,
589 AC10_2430_MCBSP2_FSX_OFF,
590 AD16_2430_MCBSP2_CLX_OFF,
591 AE13_2430_MCBSP2_DX_OFF,
592 AD13_2430_MCBSP2_DR_OFF,
593
594};
595
596struct omap_mux_cfg {
597 struct pin_config *pins;
598 unsigned long size;
599 int (*cfg_reg)(const struct pin_config *cfg);
560}; 600};
561 601
562#ifdef CONFIG_OMAP_MUX 602#ifdef CONFIG_OMAP_MUX
563/* setup pin muxing in Linux */ 603/* setup pin muxing in Linux */
564extern int omap1_mux_init(void); 604extern int omap1_mux_init(void);
565extern int omap2_mux_init(void); 605extern int omap2_mux_init(void);
566extern int omap_mux_register(struct pin_config * pins, unsigned long size); 606extern int omap_mux_register(struct omap_mux_cfg *);
567extern int omap_cfg_reg(unsigned long reg_cfg); 607extern int omap_cfg_reg(unsigned long reg_cfg);
568#else 608#else
569/* boot loader does it all (no warnings from CONFIG_OMAP_MUX_WARNINGS) */ 609/* boot loader does it all (no warnings from CONFIG_OMAP_MUX_WARNINGS) */
diff --git a/include/asm-arm/arch-omap/omap24xx.h b/include/asm-arm/arch-omap/omap24xx.h
index 14c0f9496579..b9fcaae287c8 100644
--- a/include/asm-arm/arch-omap/omap24xx.h
+++ b/include/asm-arm/arch-omap/omap24xx.h
@@ -1,3 +1,28 @@
1/*
2 * include/asm-arm/arch-omap/omap24xx.h
3 *
4 * This file contains the processor specific definitions
5 * of the TI OMAP24XX.
6 *
7 * Copyright (C) 2007 Texas Instruments.
8 * Copyright (C) 2007 Nokia Corporation.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
1#ifndef __ASM_ARCH_OMAP24XX_H 26#ifndef __ASM_ARCH_OMAP24XX_H
2#define __ASM_ARCH_OMAP24XX_H 27#define __ASM_ARCH_OMAP24XX_H
3 28
@@ -13,33 +38,70 @@
13 38
14/* interrupt controller */ 39/* interrupt controller */
15#define OMAP24XX_IC_BASE (L4_24XX_BASE + 0xfe000) 40#define OMAP24XX_IC_BASE (L4_24XX_BASE + 0xfe000)
16#define VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
17#define OMAP24XX_IVA_INTC_BASE 0x40000000 41#define OMAP24XX_IVA_INTC_BASE 0x40000000
18#define IRQ_SIR_IRQ 0x0040 42#define IRQ_SIR_IRQ 0x0040
19 43
20#ifdef CONFIG_ARCH_OMAP2420 44#define OMAP2420_CTRL_BASE L4_24XX_BASE
21#define OMAP24XX_32KSYNCT_BASE (L4_24XX_BASE + 0x4000) 45#define OMAP2420_32KSYNCT_BASE (L4_24XX_BASE + 0x4000)
22#define OMAP24XX_PRCM_BASE (L4_24XX_BASE + 0x8000) 46#define OMAP2420_PRCM_BASE (L4_24XX_BASE + 0x8000)
23#define OMAP24XX_SDRC_BASE (L3_24XX_BASE + 0x9000) 47#define OMAP2420_CM_BASE (L4_24XX_BASE + 0x8000)
24#define OMAP242X_CONTROL_STATUS (L4_24XX_BASE + 0x2f8) 48#define OMAP2420_PRM_BASE OMAP2420_CM_BASE
25#endif 49#define OMAP2420_SDRC_BASE (L3_24XX_BASE + 0x9000)
50#define OMAP2420_SMS_BASE 0x68008000
26 51
27#ifdef CONFIG_ARCH_OMAP2430 52#define OMAP2430_32KSYNCT_BASE (L4_WK_243X_BASE + 0x20000)
28#define OMAP24XX_32KSYNCT_BASE (L4_WK_243X_BASE + 0x20000) 53#define OMAP2430_PRCM_BASE (L4_WK_243X_BASE + 0x6000)
29#define OMAP24XX_PRCM_BASE (L4_WK_243X_BASE + 0x6000) 54#define OMAP2430_CM_BASE (L4_WK_243X_BASE + 0x6000)
30#define OMAP24XX_SDRC_BASE (0x6D000000) 55#define OMAP2430_PRM_BASE OMAP2430_CM_BASE
31#define OMAP242X_CONTROL_STATUS (L4_24XX_BASE + 0x2f8) 56
57#define OMAP243X_SMS_BASE 0x6C000000
58#define OMAP243X_SDRC_BASE 0x6D000000
32#define OMAP243X_GPMC_BASE 0x6E000000 59#define OMAP243X_GPMC_BASE 0x6E000000
33#endif 60#define OMAP243X_SCM_BASE (L4_WK_243X_BASE + 0x2000)
61#define OMAP243X_CTRL_BASE OMAP243X_SCM_BASE
62#define OMAP243X_HS_BASE (L4_24XX_BASE + 0x000ac000)
34 63
35/* DSP SS */ 64/* DSP SS */
36#define OMAP24XX_DSP_BASE 0x58000000 65#define OMAP2420_DSP_BASE 0x58000000
37#define OMAP24XX_DSP_MEM_BASE (OMAP24XX_DSP_BASE + 0x0) 66#define OMAP2420_DSP_MEM_BASE (OMAP2420_DSP_BASE + 0x0)
38#define OMAP24XX_DSP_IPI_BASE (OMAP24XX_DSP_BASE + 0x1000000) 67#define OMAP2420_DSP_IPI_BASE (OMAP2420_DSP_BASE + 0x1000000)
39#define OMAP24XX_DSP_MMU_BASE (OMAP24XX_DSP_BASE + 0x2000000) 68#define OMAP2420_DSP_MMU_BASE (OMAP2420_DSP_BASE + 0x2000000)
69
70#define OMAP243X_DSP_BASE 0x5C000000
71#define OMAP243X_DSP_MEM_BASE (OMAP243X_DSP_BASE + 0x0)
72#define OMAP243X_DSP_MMU_BASE (OMAP243X_DSP_BASE + 0x1000000)
40 73
41/* Mailbox */ 74/* Mailbox */
42#define OMAP24XX_MAILBOX_BASE (L4_24XX_BASE + 0x94000) 75#define OMAP24XX_MAILBOX_BASE (L4_24XX_BASE + 0x94000)
43 76
77/* Camera */
78#define OMAP24XX_CAMERA_BASE (L4_24XX_BASE + 0x52000)
79
80/* Security */
81#define OMAP24XX_SEC_BASE (L4_24XX_BASE + 0xA0000)
82#define OMAP24XX_SEC_RNG_BASE (OMAP24XX_SEC_BASE + 0x0000)
83#define OMAP24XX_SEC_DES_BASE (OMAP24XX_SEC_BASE + 0x2000)
84#define OMAP24XX_SEC_SHA1MD5_BASE (OMAP24XX_SEC_BASE + 0x4000)
85#define OMAP24XX_SEC_AES_BASE (OMAP24XX_SEC_BASE + 0x6000)
86#define OMAP24XX_SEC_PKA_BASE (OMAP24XX_SEC_BASE + 0x8000)
87
88#if defined(CONFIG_ARCH_OMAP2420)
89
90#define OMAP2_32KSYNCT_BASE OMAP2420_32KSYNCT_BASE
91#define OMAP2_PRCM_BASE OMAP2420_PRCM_BASE
92#define OMAP2_CM_BASE OMAP2420_CM_BASE
93#define OMAP2_PRM_BASE OMAP2420_PRM_BASE
94#define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
95
96#elif defined(CONFIG_ARCH_OMAP2430)
97
98#define OMAP2_32KSYNCT_BASE OMAP2430_32KSYNCT_BASE
99#define OMAP2_PRCM_BASE OMAP2430_PRCM_BASE
100#define OMAP2_CM_BASE OMAP2430_CM_BASE
101#define OMAP2_PRM_BASE OMAP2430_PRM_BASE
102#define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
103
104#endif
105
44#endif /* __ASM_ARCH_OMAP24XX_H */ 106#endif /* __ASM_ARCH_OMAP24XX_H */
45 107
diff --git a/include/asm-arm/arch-omap/sdrc.h b/include/asm-arm/arch-omap/sdrc.h
new file mode 100644
index 000000000000..673b3965befc
--- /dev/null
+++ b/include/asm-arm/arch-omap/sdrc.h
@@ -0,0 +1,75 @@
1#ifndef ____ASM_ARCH_SDRC_H
2#define ____ASM_ARCH_SDRC_H
3
4/*
5 * OMAP2/3 SDRC/SMS register definitions
6 *
7 * Copyright (C) 2007 Texas Instruments, Inc.
8 * Copyright (C) 2007 Nokia Corporation
9 *
10 * Written by Paul Walmsley
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#include <asm/arch/io.h>
18
19/* SDRC register offsets - read/write with sdrc_{read,write}_reg() */
20
21#define SDRC_SYSCONFIG 0x010
22#define SDRC_DLLA_CTRL 0x060
23#define SDRC_DLLA_STATUS 0x064
24#define SDRC_DLLB_CTRL 0x068
25#define SDRC_DLLB_STATUS 0x06C
26#define SDRC_POWER 0x070
27#define SDRC_MR_0 0x084
28#define SDRC_RFR_CTRL_0 0x0a4
29
30/*
31 * These values represent the number of memory clock cycles between
32 * autorefresh initiation. They assume 1 refresh per 64 ms (JEDEC), 8192
33 * rows per device, and include a subtraction of a 50 cycle window in the
34 * event that the autorefresh command is delayed due to other SDRC activity.
35 * The '| 1' sets the ARE field to send one autorefresh when the autorefresh
36 * counter reaches 0.
37 *
38 * These represent optimal values for common parts, it won't work for all.
39 * As long as you scale down, most parameters are still work, they just
40 * become sub-optimal. The RFR value goes in the opposite direction. If you
41 * don't adjust it down as your clock period increases the refresh interval
42 * will not be met. Setting all parameters for complete worst case may work,
43 * but may cut memory performance by 2x. Due to errata the DLLs need to be
44 * unlocked and their value needs run time calibration. A dynamic call is
45 * need for that as no single right value exists acorss production samples.
46 *
47 * Only the FULL speed values are given. Current code is such that rate
48 * changes must be made at DPLLoutx2. The actual value adjustment for low
49 * frequency operation will be handled by omap_set_performance()
50 *
51 * By having the boot loader boot up in the fastest L4 speed available likely
52 * will result in something which you can switch between.
53 */
54#define SDRC_RFR_CTRL_165MHz (0x00044c00 | 1)
55#define SDRC_RFR_CTRL_133MHz (0x0003de00 | 1)
56#define SDRC_RFR_CTRL_100MHz (0x0002da01 | 1)
57#define SDRC_RFR_CTRL_110MHz (0x0002da01 | 1) /* Need to calc */
58#define SDRC_RFR_CTRL_BYPASS (0x00005000 | 1) /* Need to calc */
59
60
61/*
62 * SMS register access
63 */
64
65
66#define OMAP242X_SMS_REGADDR(reg) (void __iomem *)IO_ADDRESS(OMAP2420_SMS_BASE + reg)
67#define OMAP243X_SMS_REGADDR(reg) (void __iomem *)IO_ADDRESS(OMAP243X_SMS_BASE + reg)
68#define OMAP343X_SMS_REGADDR(reg) (void __iomem *)IO_ADDRESS(OMAP343X_SMS_BASE + reg)
69
70/* SMS register offsets - read/write with sms_{read,write}_reg() */
71
72#define SMS_SYSCONFIG 0x010
73/* REVISIT: fill in other SMS registers here */
74
75#endif
diff --git a/include/asm-arm/arch-omap/usb.h b/include/asm-arm/arch-omap/usb.h
index 99ae9eabaf71..2147d18aaeae 100644
--- a/include/asm-arm/arch-omap/usb.h
+++ b/include/asm-arm/arch-omap/usb.h
@@ -132,14 +132,11 @@
132# define CONF_USB_PWRDN_DP_R (1 << 1) 132# define CONF_USB_PWRDN_DP_R (1 << 1)
133 133
134/* OMAP2 */ 134/* OMAP2 */
135#define CONTROL_DEVCONF_REG __REG32(L4_24XX_BASE + 0x0274)
136# define USB_UNIDIR 0x0 135# define USB_UNIDIR 0x0
137# define USB_UNIDIR_TLL 0x1 136# define USB_UNIDIR_TLL 0x1
138# define USB_BIDIR 0x2 137# define USB_BIDIR 0x2
139# define USB_BIDIR_TLL 0x3 138# define USB_BIDIR_TLL 0x3
140# define USBT0WRMODEI(x) ((x) << 22) 139# define USBTXWRMODEI(port, x) ((x) << (22 - (port * 2)))
141# define USBT1WRMODEI(x) ((x) << 20)
142# define USBT2WRMODEI(x) ((x) << 18)
143# define USBT2TLL5PI (1 << 17) 140# define USBT2TLL5PI (1 << 17)
144# define USB0PUENACTLOI (1 << 16) 141# define USB0PUENACTLOI (1 << 16)
145# define USBSTANDBYCTRL (1 << 15) 142# define USBSTANDBYCTRL (1 << 15)
diff --git a/include/asm-arm/arch-orion/io.h b/include/asm-arm/arch-orion/io.h
deleted file mode 100644
index e0b8c39b9167..000000000000
--- a/include/asm-arm/arch-orion/io.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * include/asm-arm/arch-orion/io.h
3 *
4 * Tzachi Perelstein <tzachi@marvell.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ASM_ARM_ARCH_IO_H
12#define __ASM_ARM_ARCH_IO_H
13
14#include "orion.h"
15
16#define IO_SPACE_LIMIT 0xffffffff
17#define IO_SPACE_REMAP ORION_PCI_SYS_IO_BASE
18
19static inline void __iomem *__io(unsigned long addr)
20{
21 return (void __iomem *)addr;
22}
23
24#define __io(a) __io(a)
25#define __mem_pci(a) (a)
26
27#endif
diff --git a/include/asm-arm/arch-orion/irqs.h b/include/asm-arm/arch-orion/irqs.h
deleted file mode 100644
index eea65ca6076a..000000000000
--- a/include/asm-arm/arch-orion/irqs.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * include/asm-arm/arch-orion/irqs.h
3 *
4 * IRQ definitions for Orion SoC
5 *
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#ifndef __ASM_ARCH_IRQS_H__
14#define __ASM_ARCH_IRQS_H__
15
16#include "orion.h" /* need GPIO_MAX */
17
18/*
19 * Orion Main Interrupt Controller
20 */
21#define IRQ_ORION_BRIDGE 0
22#define IRQ_ORION_DOORBELL_H2C 1
23#define IRQ_ORION_DOORBELL_C2H 2
24#define IRQ_ORION_UART0 3
25#define IRQ_ORION_UART1 4
26#define IRQ_ORION_I2C 5
27#define IRQ_ORION_GPIO_0_7 6
28#define IRQ_ORION_GPIO_8_15 7
29#define IRQ_ORION_GPIO_16_23 8
30#define IRQ_ORION_GPIO_24_31 9
31#define IRQ_ORION_PCIE0_ERR 10
32#define IRQ_ORION_PCIE0_INT 11
33#define IRQ_ORION_USB1_CTRL 12
34#define IRQ_ORION_DEV_BUS_ERR 14
35#define IRQ_ORION_PCI_ERR 15
36#define IRQ_ORION_USB_BR_ERR 16
37#define IRQ_ORION_USB0_CTRL 17
38#define IRQ_ORION_ETH_RX 18
39#define IRQ_ORION_ETH_TX 19
40#define IRQ_ORION_ETH_MISC 20
41#define IRQ_ORION_ETH_SUM 21
42#define IRQ_ORION_ETH_ERR 22
43#define IRQ_ORION_IDMA_ERR 23
44#define IRQ_ORION_IDMA_0 24
45#define IRQ_ORION_IDMA_1 25
46#define IRQ_ORION_IDMA_2 26
47#define IRQ_ORION_IDMA_3 27
48#define IRQ_ORION_CESA 28
49#define IRQ_ORION_SATA 29
50#define IRQ_ORION_XOR0 30
51#define IRQ_ORION_XOR1 31
52
53/*
54 * Orion General Purpose Pins
55 */
56#define IRQ_ORION_GPIO_START 32
57#define NR_GPIO_IRQS GPIO_MAX
58
59#define NR_IRQS (IRQ_ORION_GPIO_START + NR_GPIO_IRQS)
60
61#endif /* __ASM_ARCH_IRQS_H__ */
diff --git a/include/asm-arm/arch-orion/orion.h b/include/asm-arm/arch-orion/orion.h
deleted file mode 100644
index 673a418a7419..000000000000
--- a/include/asm-arm/arch-orion/orion.h
+++ /dev/null
@@ -1,165 +0,0 @@
1/*
2 * include/asm-arm/arch-orion/orion.h
3 *
4 * Generic definitions of Orion SoC flavors:
5 * Orion-1, Orion-NAS, Orion-VoIP, and Orion-2.
6 *
7 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __ASM_ARCH_ORION_H__
15#define __ASM_ARCH_ORION_H__
16
17/*****************************************************************************
18 * Orion Address Map
19 *
20 * virt phys size
21 * fdd00000 f1000000 1M on-chip peripheral registers
22 * fde00000 f2000000 1M PCIe I/O space
23 * fdf00000 f2100000 1M PCI I/O space
24 * fe000000 f0000000 16M PCIe WA space (Orion-NAS only)
25 ****************************************************************************/
26#define ORION_REGS_PHYS_BASE 0xf1000000
27#define ORION_REGS_VIRT_BASE 0xfdd00000
28#define ORION_REGS_SIZE SZ_1M
29
30#define ORION_PCIE_IO_PHYS_BASE 0xf2000000
31#define ORION_PCIE_IO_VIRT_BASE 0xfde00000
32#define ORION_PCIE_IO_BUS_BASE 0x00000000
33#define ORION_PCIE_IO_SIZE SZ_1M
34
35#define ORION_PCI_IO_PHYS_BASE 0xf2100000
36#define ORION_PCI_IO_VIRT_BASE 0xfdf00000
37#define ORION_PCI_IO_BUS_BASE 0x00100000
38#define ORION_PCI_IO_SIZE SZ_1M
39
40/* Relevant only for Orion-NAS */
41#define ORION_PCIE_WA_PHYS_BASE 0xf0000000
42#define ORION_PCIE_WA_VIRT_BASE 0xfe000000
43#define ORION_PCIE_WA_SIZE SZ_16M
44
45#define ORION_PCIE_MEM_PHYS_BASE 0xe0000000
46#define ORION_PCIE_MEM_SIZE SZ_128M
47
48#define ORION_PCI_MEM_PHYS_BASE 0xe8000000
49#define ORION_PCI_MEM_SIZE SZ_128M
50
51/*******************************************************************************
52 * Supported Devices & Revisions
53 ******************************************************************************/
54/* Orion-1 (88F5181) */
55#define MV88F5181_DEV_ID 0x5181
56#define MV88F5181_REV_B1 3
57/* Orion-NAS (88F5182) */
58#define MV88F5182_DEV_ID 0x5182
59#define MV88F5182_REV_A2 2
60/* Orion-2 (88F5281) */
61#define MV88F5281_DEV_ID 0x5281
62#define MV88F5281_REV_D1 5
63#define MV88F5281_REV_D2 6
64
65/*******************************************************************************
66 * Orion Registers Map
67 ******************************************************************************/
68#define ORION_DDR_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x00000)
69#define ORION_DDR_REG(x) (ORION_DDR_VIRT_BASE | (x))
70
71#define ORION_DEV_BUS_PHYS_BASE (ORION_REGS_PHYS_BASE | 0x10000)
72#define ORION_DEV_BUS_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x10000)
73#define ORION_DEV_BUS_REG(x) (ORION_DEV_BUS_VIRT_BASE | (x))
74#define I2C_PHYS_BASE (ORION_DEV_BUS_PHYS_BASE | 0x1000)
75#define UART0_PHYS_BASE (ORION_DEV_BUS_PHYS_BASE | 0x2000)
76#define UART0_VIRT_BASE (ORION_DEV_BUS_VIRT_BASE | 0x2000)
77#define UART1_PHYS_BASE (ORION_DEV_BUS_PHYS_BASE | 0x2100)
78#define UART1_VIRT_BASE (ORION_DEV_BUS_VIRT_BASE | 0x2100)
79
80#define ORION_BRIDGE_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x20000)
81#define ORION_BRIDGE_REG(x) (ORION_BRIDGE_VIRT_BASE | (x))
82
83#define ORION_PCI_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x30000)
84#define ORION_PCI_REG(x) (ORION_PCI_VIRT_BASE | (x))
85
86#define ORION_PCIE_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x40000)
87#define ORION_PCIE_REG(x) (ORION_PCIE_VIRT_BASE | (x))
88
89#define ORION_USB0_PHYS_BASE (ORION_REGS_PHYS_BASE | 0x50000)
90#define ORION_USB0_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x50000)
91#define ORION_USB0_REG(x) (ORION_USB0_VIRT_BASE | (x))
92
93#define ORION_ETH_PHYS_BASE (ORION_REGS_PHYS_BASE | 0x70000)
94#define ORION_ETH_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x70000)
95#define ORION_ETH_REG(x) (ORION_ETH_VIRT_BASE | (x))
96
97#define ORION_SATA_PHYS_BASE (ORION_REGS_PHYS_BASE | 0x80000)
98#define ORION_SATA_VIRT_BASE (ORION_REGS_VIRT_BASE | 0x80000)
99#define ORION_SATA_REG(x) (ORION_SATA_VIRT_BASE | (x))
100
101#define ORION_USB1_PHYS_BASE (ORION_REGS_PHYS_BASE | 0xa0000)
102#define ORION_USB1_VIRT_BASE (ORION_REGS_VIRT_BASE | 0xa0000)
103#define ORION_USB1_REG(x) (ORION_USB1_VIRT_BASE | (x))
104
105/*******************************************************************************
106 * Device Bus Registers
107 ******************************************************************************/
108#define MPP_0_7_CTRL ORION_DEV_BUS_REG(0x000)
109#define MPP_8_15_CTRL ORION_DEV_BUS_REG(0x004)
110#define MPP_16_19_CTRL ORION_DEV_BUS_REG(0x050)
111#define MPP_DEV_CTRL ORION_DEV_BUS_REG(0x008)
112#define MPP_RESET_SAMPLE ORION_DEV_BUS_REG(0x010)
113#define GPIO_OUT ORION_DEV_BUS_REG(0x100)
114#define GPIO_IO_CONF ORION_DEV_BUS_REG(0x104)
115#define GPIO_BLINK_EN ORION_DEV_BUS_REG(0x108)
116#define GPIO_IN_POL ORION_DEV_BUS_REG(0x10c)
117#define GPIO_DATA_IN ORION_DEV_BUS_REG(0x110)
118#define GPIO_EDGE_CAUSE ORION_DEV_BUS_REG(0x114)
119#define GPIO_EDGE_MASK ORION_DEV_BUS_REG(0x118)
120#define GPIO_LEVEL_MASK ORION_DEV_BUS_REG(0x11c)
121#define DEV_BANK_0_PARAM ORION_DEV_BUS_REG(0x45c)
122#define DEV_BANK_1_PARAM ORION_DEV_BUS_REG(0x460)
123#define DEV_BANK_2_PARAM ORION_DEV_BUS_REG(0x464)
124#define DEV_BANK_BOOT_PARAM ORION_DEV_BUS_REG(0x46c)
125#define DEV_BUS_CTRL ORION_DEV_BUS_REG(0x4c0)
126#define DEV_BUS_INT_CAUSE ORION_DEV_BUS_REG(0x4d0)
127#define DEV_BUS_INT_MASK ORION_DEV_BUS_REG(0x4d4)
128#define GPIO_MAX 32
129
130/***************************************************************************
131 * Orion CPU Bridge Registers
132 **************************************************************************/
133#define CPU_CONF ORION_BRIDGE_REG(0x100)
134#define CPU_CTRL ORION_BRIDGE_REG(0x104)
135#define CPU_RESET_MASK ORION_BRIDGE_REG(0x108)
136#define CPU_SOFT_RESET ORION_BRIDGE_REG(0x10c)
137#define POWER_MNG_CTRL_REG ORION_BRIDGE_REG(0x11C)
138#define BRIDGE_CAUSE ORION_BRIDGE_REG(0x110)
139#define BRIDGE_MASK ORION_BRIDGE_REG(0x114)
140#define MAIN_IRQ_CAUSE ORION_BRIDGE_REG(0x200)
141#define MAIN_IRQ_MASK ORION_BRIDGE_REG(0x204)
142#define TIMER_CTRL ORION_BRIDGE_REG(0x300)
143#define TIMER_VAL(x) ORION_BRIDGE_REG(0x314 + ((x) * 8))
144#define TIMER_VAL_RELOAD(x) ORION_BRIDGE_REG(0x310 + ((x) * 8))
145
146#ifndef __ASSEMBLY__
147
148/*******************************************************************************
149 * Helpers to access Orion registers
150 ******************************************************************************/
151#include <asm/types.h>
152#include <asm/io.h>
153
154#define orion_read(r) __raw_readl(r)
155#define orion_write(r, val) __raw_writel(val, r)
156
157/*
158 * These are not preempt safe. Locks, if needed, must be taken care by caller.
159 */
160#define orion_setbits(r, mask) orion_write((r), orion_read(r) | (mask))
161#define orion_clrbits(r, mask) orion_write((r), orion_read(r) & ~(mask))
162
163#endif /* __ASSEMBLY__ */
164
165#endif /* __ASM_ARCH_ORION_H__ */
diff --git a/include/asm-arm/arch-orion/timex.h b/include/asm-arm/arch-orion/timex.h
deleted file mode 100644
index 26c2c91eecf0..000000000000
--- a/include/asm-arm/arch-orion/timex.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/*
2 * include/asm-arm/arch-orion/timex.h
3 *
4 * Tzachi Perelstein <tzachi@marvell.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#define ORION_TCLK 166666667
12#define CLOCK_TICK_RATE ORION_TCLK
diff --git a/include/asm-arm/arch-orion/debug-macro.S b/include/asm-arm/arch-orion5x/debug-macro.S
index 2746220f5d85..4f98f3ba2929 100644
--- a/include/asm-arm/arch-orion/debug-macro.S
+++ b/include/asm-arm/arch-orion5x/debug-macro.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/arch-orion/debug-macro.S 2 * include/asm-arm/arch-orion5x/debug-macro.S
3 * 3 *
4 * Debugging macro include header 4 * Debugging macro include header
5 * 5 *
@@ -8,13 +8,13 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9*/ 9*/
10 10
11#include <asm/arch/orion.h> 11#include <asm/arch/orion5x.h>
12 12
13 .macro addruart,rx 13 .macro addruart,rx
14 mrc p15, 0, \rx, c1, c0 14 mrc p15, 0, \rx, c1, c0
15 tst \rx, #1 @ MMU enabled? 15 tst \rx, #1 @ MMU enabled?
16 ldreq \rx, =ORION_REGS_PHYS_BASE 16 ldreq \rx, =ORION5X_REGS_PHYS_BASE
17 ldrne \rx, =ORION_REGS_VIRT_BASE 17 ldrne \rx, =ORION5X_REGS_VIRT_BASE
18 orr \rx, \rx, #0x00012000 18 orr \rx, \rx, #0x00012000
19 .endm 19 .endm
20 20
diff --git a/include/asm-arm/arch-orion/dma.h b/include/asm-arm/arch-orion5x/dma.h
index 40a8c178f10d..40a8c178f10d 100644
--- a/include/asm-arm/arch-orion/dma.h
+++ b/include/asm-arm/arch-orion5x/dma.h
diff --git a/include/asm-arm/arch-orion/entry-macro.S b/include/asm-arm/arch-orion5x/entry-macro.S
index cda096b2acfd..d8ef54c0ee9a 100644
--- a/include/asm-arm/arch-orion/entry-macro.S
+++ b/include/asm-arm/arch-orion5x/entry-macro.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-arm/arch-orion/entry-macro.S 2 * include/asm-arm/arch-orion5x/entry-macro.S
3 * 3 *
4 * Low-level IRQ helper macros for Orion platforms 4 * Low-level IRQ helper macros for Orion platforms
5 * 5 *
@@ -8,7 +8,7 @@
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10 10
11#include <asm/arch/orion.h> 11#include <asm/arch/orion5x.h>
12 12
13 .macro disable_fiq 13 .macro disable_fiq
14 .endm 14 .endm
diff --git a/include/asm-arm/arch-orion/gpio.h b/include/asm-arm/arch-orion5x/gpio.h
index d66284f9a14c..c85e498388b6 100644
--- a/include/asm-arm/arch-orion/gpio.h
+++ b/include/asm-arm/arch-orion5x/gpio.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-arm/arch-orion/gpio.h 2 * include/asm-arm/arch-orion5x/gpio.h
3 * 3 *
4 * This file is licensed under the terms of the GNU General Public 4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any 5 * License version 2. This program is licensed "as is" without any
@@ -12,17 +12,17 @@ extern int gpio_direction_input(unsigned pin);
12extern int gpio_direction_output(unsigned pin, int value); 12extern int gpio_direction_output(unsigned pin, int value);
13extern int gpio_get_value(unsigned pin); 13extern int gpio_get_value(unsigned pin);
14extern void gpio_set_value(unsigned pin, int value); 14extern void gpio_set_value(unsigned pin, int value);
15extern void orion_gpio_set_blink(unsigned pin, int blink); 15extern void orion5x_gpio_set_blink(unsigned pin, int blink);
16extern void gpio_display(void); /* debug */ 16extern void gpio_display(void); /* debug */
17 17
18static inline int gpio_to_irq(int pin) 18static inline int gpio_to_irq(int pin)
19{ 19{
20 return pin + IRQ_ORION_GPIO_START; 20 return pin + IRQ_ORION5X_GPIO_START;
21} 21}
22 22
23static inline int irq_to_gpio(int irq) 23static inline int irq_to_gpio(int irq)
24{ 24{
25 return irq - IRQ_ORION_GPIO_START; 25 return irq - IRQ_ORION5X_GPIO_START;
26} 26}
27 27
28#include <asm-generic/gpio.h> /* cansleep wrappers */ 28#include <asm-generic/gpio.h> /* cansleep wrappers */
diff --git a/include/asm-arm/arch-orion/hardware.h b/include/asm-arm/arch-orion5x/hardware.h
index 65da374de735..5d2d8e0b5630 100644
--- a/include/asm-arm/arch-orion/hardware.h
+++ b/include/asm-arm/arch-orion5x/hardware.h
@@ -1,21 +1,21 @@
1/* 1/*
2 * include/asm-arm/arch-orion/hardware.h 2 * include/asm-arm/arch-orion5x/hardware.h
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#ifndef __ASM_ARCH_HARDWARE_H__ 9#ifndef __ASM_ARCH_HARDWARE_H
10#define __ASM_ARCH_HARDWARE_H__ 10#define __ASM_ARCH_HARDWARE_H
11 11
12#include "orion.h" 12#include "orion5x.h"
13 13
14#define pcibios_assign_all_busses() 1 14#define pcibios_assign_all_busses() 1
15 15
16#define PCIBIOS_MIN_IO 0x00001000 16#define PCIBIOS_MIN_IO 0x00001000
17#define PCIBIOS_MIN_MEM 0x01000000 17#define PCIBIOS_MIN_MEM 0x01000000
18#define PCIMEM_BASE ORION_PCIE_MEM_PHYS_BASE 18#define PCIMEM_BASE ORION5X_PCIE_MEM_PHYS_BASE
19 19
20 20
21#endif 21#endif
diff --git a/include/asm-arm/arch-orion5x/io.h b/include/asm-arm/arch-orion5x/io.h
new file mode 100644
index 000000000000..5148ab7ad1f8
--- /dev/null
+++ b/include/asm-arm/arch-orion5x/io.h
@@ -0,0 +1,68 @@
1/*
2 * include/asm-arm/arch-orion5x/io.h
3 *
4 * Tzachi Perelstein <tzachi@marvell.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ASM_ARCH_IO_H
12#define __ASM_ARCH_IO_H
13
14#include "orion5x.h"
15
16#define IO_SPACE_LIMIT 0xffffffff
17#define IO_SPACE_REMAP ORION5X_PCI_SYS_IO_BASE
18
19static inline void __iomem *
20__arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
21{
22 void __iomem *retval;
23
24 if (mtype == MT_DEVICE && size && paddr >= ORION5X_REGS_PHYS_BASE &&
25 paddr + size <= ORION5X_REGS_PHYS_BASE + ORION5X_REGS_SIZE) {
26 retval = (void __iomem *)ORION5X_REGS_VIRT_BASE +
27 (paddr - ORION5X_REGS_PHYS_BASE);
28 } else {
29 retval = __arm_ioremap(paddr, size, mtype);
30 }
31
32 return retval;
33}
34
35static inline void
36__arch_iounmap(void __iomem *addr)
37{
38 if (addr < (void __iomem *)ORION5X_REGS_VIRT_BASE ||
39 addr >= (void __iomem *)(ORION5X_REGS_VIRT_BASE + ORION5X_REGS_SIZE))
40 __iounmap(addr);
41}
42
43static inline void __iomem *__io(unsigned long addr)
44{
45 return (void __iomem *)addr;
46}
47
48#define __arch_ioremap(p, s, m) __arch_ioremap(p, s, m)
49#define __arch_iounmap(a) __arch_iounmap(a)
50#define __io(a) __io(a)
51#define __mem_pci(a) (a)
52
53
54/*****************************************************************************
55 * Helpers to access Orion registers
56 ****************************************************************************/
57#define orion5x_read(r) __raw_readl(r)
58#define orion5x_write(r, val) __raw_writel(val, r)
59
60/*
61 * These are not preempt-safe. Locks, if needed, must be taken
62 * care of by the caller.
63 */
64#define orion5x_setbits(r, mask) orion5x_write((r), orion5x_read(r) | (mask))
65#define orion5x_clrbits(r, mask) orion5x_write((r), orion5x_read(r) & ~(mask))
66
67
68#endif
diff --git a/include/asm-arm/arch-orion5x/irqs.h b/include/asm-arm/arch-orion5x/irqs.h
new file mode 100644
index 000000000000..abdd61a4833a
--- /dev/null
+++ b/include/asm-arm/arch-orion5x/irqs.h
@@ -0,0 +1,62 @@
1/*
2 * include/asm-arm/arch-orion5x/irqs.h
3 *
4 * IRQ definitions for Orion SoC
5 *
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#ifndef __ASM_ARCH_IRQS_H
14#define __ASM_ARCH_IRQS_H
15
16#include "orion5x.h" /* need GPIO_MAX */
17
18/*
19 * Orion Main Interrupt Controller
20 */
21#define IRQ_ORION5X_BRIDGE 0
22#define IRQ_ORION5X_DOORBELL_H2C 1
23#define IRQ_ORION5X_DOORBELL_C2H 2
24#define IRQ_ORION5X_UART0 3
25#define IRQ_ORION5X_UART1 4
26#define IRQ_ORION5X_I2C 5
27#define IRQ_ORION5X_GPIO_0_7 6
28#define IRQ_ORION5X_GPIO_8_15 7
29#define IRQ_ORION5X_GPIO_16_23 8
30#define IRQ_ORION5X_GPIO_24_31 9
31#define IRQ_ORION5X_PCIE0_ERR 10
32#define IRQ_ORION5X_PCIE0_INT 11
33#define IRQ_ORION5X_USB1_CTRL 12
34#define IRQ_ORION5X_DEV_BUS_ERR 14
35#define IRQ_ORION5X_PCI_ERR 15
36#define IRQ_ORION5X_USB_BR_ERR 16
37#define IRQ_ORION5X_USB0_CTRL 17
38#define IRQ_ORION5X_ETH_RX 18
39#define IRQ_ORION5X_ETH_TX 19
40#define IRQ_ORION5X_ETH_MISC 20
41#define IRQ_ORION5X_ETH_SUM 21
42#define IRQ_ORION5X_ETH_ERR 22
43#define IRQ_ORION5X_IDMA_ERR 23
44#define IRQ_ORION5X_IDMA_0 24
45#define IRQ_ORION5X_IDMA_1 25
46#define IRQ_ORION5X_IDMA_2 26
47#define IRQ_ORION5X_IDMA_3 27
48#define IRQ_ORION5X_CESA 28
49#define IRQ_ORION5X_SATA 29
50#define IRQ_ORION5X_XOR0 30
51#define IRQ_ORION5X_XOR1 31
52
53/*
54 * Orion General Purpose Pins
55 */
56#define IRQ_ORION5X_GPIO_START 32
57#define NR_GPIO_IRQS GPIO_MAX
58
59#define NR_IRQS (IRQ_ORION5X_GPIO_START + NR_GPIO_IRQS)
60
61
62#endif
diff --git a/include/asm-arm/arch-orion/memory.h b/include/asm-arm/arch-orion5x/memory.h
index d954dba87ced..80053a7afc7a 100644
--- a/include/asm-arm/arch-orion/memory.h
+++ b/include/asm-arm/arch-orion5x/memory.h
@@ -1,15 +1,16 @@
1/* 1/*
2 * include/asm-arm/arch-orion/memory.h 2 * include/asm-arm/arch-orion5x/memory.h
3 * 3 *
4 * Marvell Orion memory definitions 4 * Marvell Orion memory definitions
5 */ 5 */
6 6
7#ifndef __ASM_ARCH_MMU_H 7#ifndef __ASM_ARCH_MEMORY_H
8#define __ASM_ARCH_MMU_H 8#define __ASM_ARCH_MEMORY_H
9 9
10#define PHYS_OFFSET UL(0x00000000) 10#define PHYS_OFFSET UL(0x00000000)
11 11
12#define __virt_to_bus(x) __virt_to_phys(x) 12#define __virt_to_bus(x) __virt_to_phys(x)
13#define __bus_to_virt(x) __phys_to_virt(x) 13#define __bus_to_virt(x) __phys_to_virt(x)
14 14
15
15#endif 16#endif
diff --git a/include/asm-arm/arch-orion5x/orion5x.h b/include/asm-arm/arch-orion5x/orion5x.h
new file mode 100644
index 000000000000..206ddd71e193
--- /dev/null
+++ b/include/asm-arm/arch-orion5x/orion5x.h
@@ -0,0 +1,159 @@
1/*
2 * include/asm-arm/arch-orion5x/orion5x.h
3 *
4 * Generic definitions of Orion SoC flavors:
5 * Orion-1, Orion-NAS, Orion-VoIP, and Orion-2.
6 *
7 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __ASM_ARCH_ORION5X_H
15#define __ASM_ARCH_ORION5X_H
16
17/*****************************************************************************
18 * Orion Address Maps
19 *
20 * phys
21 * e0000000 PCIe MEM space
22 * e8000000 PCI MEM space
23 * f0000000 PCIe WA space (Orion-1/Orion-NAS only)
24 * f1000000 on-chip peripheral registers
25 * f2000000 PCIe I/O space
26 * f2100000 PCI I/O space
27 * f4000000 device bus mappings (boot)
28 * fa000000 device bus mappings (cs0)
29 * fa800000 device bus mappings (cs2)
30 * fc000000 device bus mappings (cs0/cs1)
31 *
32 * virt phys size
33 * fdd00000 f1000000 1M on-chip peripheral registers
34 * fde00000 f2000000 1M PCIe I/O space
35 * fdf00000 f2100000 1M PCI I/O space
36 * fe000000 f0000000 16M PCIe WA space (Orion-1/Orion-NAS only)
37 ****************************************************************************/
38#define ORION5X_REGS_PHYS_BASE 0xf1000000
39#define ORION5X_REGS_VIRT_BASE 0xfdd00000
40#define ORION5X_REGS_SIZE SZ_1M
41
42#define ORION5X_PCIE_IO_PHYS_BASE 0xf2000000
43#define ORION5X_PCIE_IO_VIRT_BASE 0xfde00000
44#define ORION5X_PCIE_IO_BUS_BASE 0x00000000
45#define ORION5X_PCIE_IO_SIZE SZ_1M
46
47#define ORION5X_PCI_IO_PHYS_BASE 0xf2100000
48#define ORION5X_PCI_IO_VIRT_BASE 0xfdf00000
49#define ORION5X_PCI_IO_BUS_BASE 0x00100000
50#define ORION5X_PCI_IO_SIZE SZ_1M
51
52/* Relevant only for Orion-1/Orion-NAS */
53#define ORION5X_PCIE_WA_PHYS_BASE 0xf0000000
54#define ORION5X_PCIE_WA_VIRT_BASE 0xfe000000
55#define ORION5X_PCIE_WA_SIZE SZ_16M
56
57#define ORION5X_PCIE_MEM_PHYS_BASE 0xe0000000
58#define ORION5X_PCIE_MEM_SIZE SZ_128M
59
60#define ORION5X_PCI_MEM_PHYS_BASE 0xe8000000
61#define ORION5X_PCI_MEM_SIZE SZ_128M
62
63/*******************************************************************************
64 * Supported Devices & Revisions
65 ******************************************************************************/
66/* Orion-1 (88F5181) */
67#define MV88F5181_DEV_ID 0x5181
68#define MV88F5181_REV_B1 3
69/* Orion-NAS (88F5182) */
70#define MV88F5182_DEV_ID 0x5182
71#define MV88F5182_REV_A2 2
72/* Orion-2 (88F5281) */
73#define MV88F5281_DEV_ID 0x5281
74#define MV88F5281_REV_D1 5
75#define MV88F5281_REV_D2 6
76
77/*******************************************************************************
78 * Orion Registers Map
79 ******************************************************************************/
80#define ORION5X_DDR_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x00000)
81#define ORION5X_DDR_REG(x) (ORION5X_DDR_VIRT_BASE | (x))
82
83#define ORION5X_DEV_BUS_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x10000)
84#define ORION5X_DEV_BUS_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x10000)
85#define ORION5X_DEV_BUS_REG(x) (ORION5X_DEV_BUS_VIRT_BASE | (x))
86#define I2C_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x1000)
87#define UART0_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x2000)
88#define UART0_VIRT_BASE (ORION5X_DEV_BUS_VIRT_BASE | 0x2000)
89#define UART1_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x2100)
90#define UART1_VIRT_BASE (ORION5X_DEV_BUS_VIRT_BASE | 0x2100)
91
92#define ORION5X_BRIDGE_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x20000)
93#define ORION5X_BRIDGE_REG(x) (ORION5X_BRIDGE_VIRT_BASE | (x))
94#define TIMER_VIRT_BASE (ORION5X_BRIDGE_VIRT_BASE | 0x300)
95
96#define ORION5X_PCI_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x30000)
97#define ORION5X_PCI_REG(x) (ORION5X_PCI_VIRT_BASE | (x))
98
99#define ORION5X_PCIE_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x40000)
100#define ORION5X_PCIE_REG(x) (ORION5X_PCIE_VIRT_BASE | (x))
101
102#define ORION5X_USB0_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x50000)
103#define ORION5X_USB0_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x50000)
104#define ORION5X_USB0_REG(x) (ORION5X_USB0_VIRT_BASE | (x))
105
106#define ORION5X_ETH_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x70000)
107#define ORION5X_ETH_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x70000)
108#define ORION5X_ETH_REG(x) (ORION5X_ETH_VIRT_BASE | (x))
109
110#define ORION5X_SATA_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x80000)
111#define ORION5X_SATA_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x80000)
112#define ORION5X_SATA_REG(x) (ORION5X_SATA_VIRT_BASE | (x))
113
114#define ORION5X_USB1_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0xa0000)
115#define ORION5X_USB1_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0xa0000)
116#define ORION5X_USB1_REG(x) (ORION5X_USB1_VIRT_BASE | (x))
117
118/*******************************************************************************
119 * Device Bus Registers
120 ******************************************************************************/
121#define MPP_0_7_CTRL ORION5X_DEV_BUS_REG(0x000)
122#define MPP_8_15_CTRL ORION5X_DEV_BUS_REG(0x004)
123#define MPP_16_19_CTRL ORION5X_DEV_BUS_REG(0x050)
124#define MPP_DEV_CTRL ORION5X_DEV_BUS_REG(0x008)
125#define MPP_RESET_SAMPLE ORION5X_DEV_BUS_REG(0x010)
126#define GPIO_OUT ORION5X_DEV_BUS_REG(0x100)
127#define GPIO_IO_CONF ORION5X_DEV_BUS_REG(0x104)
128#define GPIO_BLINK_EN ORION5X_DEV_BUS_REG(0x108)
129#define GPIO_IN_POL ORION5X_DEV_BUS_REG(0x10c)
130#define GPIO_DATA_IN ORION5X_DEV_BUS_REG(0x110)
131#define GPIO_EDGE_CAUSE ORION5X_DEV_BUS_REG(0x114)
132#define GPIO_EDGE_MASK ORION5X_DEV_BUS_REG(0x118)
133#define GPIO_LEVEL_MASK ORION5X_DEV_BUS_REG(0x11c)
134#define DEV_BANK_0_PARAM ORION5X_DEV_BUS_REG(0x45c)
135#define DEV_BANK_1_PARAM ORION5X_DEV_BUS_REG(0x460)
136#define DEV_BANK_2_PARAM ORION5X_DEV_BUS_REG(0x464)
137#define DEV_BANK_BOOT_PARAM ORION5X_DEV_BUS_REG(0x46c)
138#define DEV_BUS_CTRL ORION5X_DEV_BUS_REG(0x4c0)
139#define DEV_BUS_INT_CAUSE ORION5X_DEV_BUS_REG(0x4d0)
140#define DEV_BUS_INT_MASK ORION5X_DEV_BUS_REG(0x4d4)
141#define GPIO_MAX 32
142
143/***************************************************************************
144 * Orion CPU Bridge Registers
145 **************************************************************************/
146#define CPU_CONF ORION5X_BRIDGE_REG(0x100)
147#define CPU_CTRL ORION5X_BRIDGE_REG(0x104)
148#define CPU_RESET_MASK ORION5X_BRIDGE_REG(0x108)
149#define CPU_SOFT_RESET ORION5X_BRIDGE_REG(0x10c)
150#define POWER_MNG_CTRL_REG ORION5X_BRIDGE_REG(0x11C)
151#define BRIDGE_CAUSE ORION5X_BRIDGE_REG(0x110)
152#define BRIDGE_MASK ORION5X_BRIDGE_REG(0x114)
153#define BRIDGE_INT_TIMER0 0x0002
154#define BRIDGE_INT_TIMER1 0x0004
155#define MAIN_IRQ_CAUSE ORION5X_BRIDGE_REG(0x200)
156#define MAIN_IRQ_MASK ORION5X_BRIDGE_REG(0x204)
157
158
159#endif
diff --git a/include/asm-arm/arch-orion/system.h b/include/asm-arm/arch-orion5x/system.h
index 17704c68f90e..3f1d1e2d38f8 100644
--- a/include/asm-arm/arch-orion/system.h
+++ b/include/asm-arm/arch-orion5x/system.h
@@ -1,10 +1,10 @@
1/* 1/*
2 * include/asm-arm/arch-orion/system.h 2 * include/asm-arm/arch-orion5x/system.h
3 * 3 *
4 * Tzachi Perelstein <tzachi@marvell.com> 4 * Tzachi Perelstein <tzachi@marvell.com>
5 * 5 *
6 * This file is licensed under the terms of the GNU General Public 6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any 7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10 10
@@ -12,7 +12,7 @@
12#define __ASM_ARCH_SYSTEM_H 12#define __ASM_ARCH_SYSTEM_H
13 13
14#include <asm/arch/hardware.h> 14#include <asm/arch/hardware.h>
15#include <asm/arch/orion.h> 15#include <asm/arch/orion5x.h>
16 16
17static inline void arch_idle(void) 17static inline void arch_idle(void)
18{ 18{
@@ -24,8 +24,9 @@ static inline void arch_reset(char mode)
24 /* 24 /*
25 * Enable and issue soft reset 25 * Enable and issue soft reset
26 */ 26 */
27 orion_setbits(CPU_RESET_MASK, (1 << 2)); 27 orion5x_setbits(CPU_RESET_MASK, (1 << 2));
28 orion_setbits(CPU_SOFT_RESET, 1); 28 orion5x_setbits(CPU_SOFT_RESET, 1);
29} 29}
30 30
31
31#endif 32#endif
diff --git a/include/asm-arm/arch-orion5x/timex.h b/include/asm-arm/arch-orion5x/timex.h
new file mode 100644
index 000000000000..31c568e28cc3
--- /dev/null
+++ b/include/asm-arm/arch-orion5x/timex.h
@@ -0,0 +1,13 @@
1/*
2 * include/asm-arm/arch-orion5x/timex.h
3 *
4 * Tzachi Perelstein <tzachi@marvell.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#define CLOCK_TICK_RATE (100 * HZ)
12
13#define ORION5X_TCLK 166666667
diff --git a/include/asm-arm/arch-orion/uncompress.h b/include/asm-arm/arch-orion5x/uncompress.h
index 59f44039909a..5c13d4fafb4e 100644
--- a/include/asm-arm/arch-orion/uncompress.h
+++ b/include/asm-arm/arch-orion5x/uncompress.h
@@ -1,14 +1,14 @@
1/* 1/*
2 * include/asm-arm/arch-orion/uncompress.h 2 * include/asm-arm/arch-orion5x/uncompress.h
3 * 3 *
4 * Tzachi Perelstein <tzachi@marvell.com> 4 * Tzachi Perelstein <tzachi@marvell.com>
5 * 5 *
6 * This file is licensed under the terms of the GNU General Public 6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any 7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10 10
11#include <asm/arch/orion.h> 11#include <asm/arch/orion5x.h>
12 12
13#define MV_UART_THR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x0)) 13#define MV_UART_THR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x0))
14#define MV_UART_LSR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x14)) 14#define MV_UART_LSR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x14))
diff --git a/include/asm-arm/arch-orion/vmalloc.h b/include/asm-arm/arch-orion5x/vmalloc.h
index 9d580278d2bc..2b3061e90dc1 100644
--- a/include/asm-arm/arch-orion/vmalloc.h
+++ b/include/asm-arm/arch-orion5x/vmalloc.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-arm/arch-orion/vmalloc.h 2 * include/asm-arm/arch-orion5x/vmalloc.h
3 */ 3 */
4 4
5#define VMALLOC_END 0xfd800000 5#define VMALLOC_END 0xfd800000
diff --git a/include/asm-arm/arch-pxa/camera.h b/include/asm-arm/arch-pxa/camera.h
new file mode 100644
index 000000000000..39516ced8b1f
--- /dev/null
+++ b/include/asm-arm/arch-pxa/camera.h
@@ -0,0 +1,48 @@
1/*
2 camera.h - PXA camera driver header file
3
4 Copyright (C) 2003, Intel Corporation
5 Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22#ifndef __ASM_ARCH_CAMERA_H_
23#define __ASM_ARCH_CAMERA_H_
24
25#define PXA_CAMERA_MASTER 1
26#define PXA_CAMERA_DATAWIDTH_4 2
27#define PXA_CAMERA_DATAWIDTH_5 4
28#define PXA_CAMERA_DATAWIDTH_8 8
29#define PXA_CAMERA_DATAWIDTH_9 0x10
30#define PXA_CAMERA_DATAWIDTH_10 0x20
31#define PXA_CAMERA_PCLK_EN 0x40
32#define PXA_CAMERA_MCLK_EN 0x80
33#define PXA_CAMERA_PCP 0x100
34#define PXA_CAMERA_HSP 0x200
35#define PXA_CAMERA_VSP 0x400
36
37struct pxacamera_platform_data {
38 int (*init)(struct device *);
39 int (*power)(struct device *, int);
40 int (*reset)(struct device *, int);
41
42 unsigned long flags;
43 unsigned long mclk_10khz;
44};
45
46extern void pxa_set_camera_info(struct pxacamera_platform_data *);
47
48#endif /* __ASM_ARCH_CAMERA_H_ */
diff --git a/include/asm-arm/arch-pxa/gumstix.h b/include/asm-arm/arch-pxa/gumstix.h
new file mode 100644
index 000000000000..6fa85c4f94f8
--- /dev/null
+++ b/include/asm-arm/arch-pxa/gumstix.h
@@ -0,0 +1,96 @@
1/*
2 * linux/include/asm-arm/arch-pxa/gumstix.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9
10/* BTRESET - Reset line to Bluetooth module, active low signal. */
11#define GPIO_GUMSTIX_BTRESET 7
12#define GPIO_GUMSTIX_BTRESET_MD (GPIO_GUMSTIX_BTRESET | GPIO_OUT)
13
14
15/*
16GPIOn - Input from MAX823 (or equiv), normalizing USB +5V into a clean
17interrupt signal for determining cable presence. On the original gumstix,
18this is GPIO81, and GPIO83 needs to be defined as well. On the gumstix F,
19this moves to GPIO17 and GPIO37. */
20
21/* GPIOx - Connects to USB D+ and used as a pull-up after GPIOn
22has detected a cable insertion; driven low otherwise. */
23
24#ifdef CONFIG_ARCH_GUMSTIX_ORIG
25
26#define GPIO_GUMSTIX_USB_GPIOn 81
27#define GPIO_GUMSTIX_USB_GPIOx 83
28
29#else
30
31#define GPIO_GUMSTIX_USB_GPIOn 35
32#define GPIO_GUMSTIX_USB_GPIOx 41
33
34#endif
35
36/* usb state change */
37#define GUMSTIX_USB_INTR_IRQ IRQ_GPIO(GPIO_GUMSTIX_USB_GPIOn)
38
39#define GPIO_GUMSTIX_USB_GPIOn_MD (GPIO_GUMSTIX_USB_GPIOn | GPIO_IN)
40#define GPIO_GUMSTIX_USB_GPIOx_CON_MD (GPIO_GUMSTIX_USB_GPIOx | GPIO_OUT)
41#define GPIO_GUMSTIX_USB_GPIOx_DIS_MD (GPIO_GUMSTIX_USB_GPIOx | GPIO_IN)
42
43/*
44 * SD/MMC definitions
45 */
46#define GUMSTIX_GPIO_nSD_WP 22 /* SD Write Protect */
47#define GUMSTIX_GPIO_nSD_DETECT 11 /* MMC/SD Card Detect */
48#define GUMSTIX_IRQ_GPIO_nSD_DETECT IRQ_GPIO(GUMSTIX_GPIO_nSD_DETECT)
49
50/*
51 * SMC Ethernet definitions
52 * ETH_RST provides a hardware reset line to the ethernet chip
53 * ETH is the IRQ line in from the ethernet chip to the PXA
54 */
55#define GPIO_GUMSTIX_ETH0_RST 80
56#define GPIO_GUMSTIX_ETH0_RST_MD (GPIO_GUMSTIX_ETH0_RST | GPIO_OUT)
57#define GPIO_GUMSTIX_ETH1_RST 52
58#define GPIO_GUMSTIX_ETH1_RST_MD (GPIO_GUMSTIX_ETH1_RST | GPIO_OUT)
59
60#define GPIO_GUMSTIX_ETH0 36
61#define GPIO_GUMSTIX_ETH0_MD (GPIO_GUMSTIX_ETH0 | GPIO_IN)
62#define GUMSTIX_ETH0_IRQ IRQ_GPIO(GPIO_GUMSTIX_ETH0)
63#define GPIO_GUMSTIX_ETH1 27
64#define GPIO_GUMSTIX_ETH1_MD (GPIO_GUMSTIX_ETH1 | GPIO_IN)
65#define GUMSTIX_ETH1_IRQ IRQ_GPIO(GPIO_GUMSTIX_ETH1)
66
67
68/* CF reset line */
69#define GPIO8_RESET 8
70
71/* CF slot 0 */
72#define GPIO4_nBVD1 4
73#define GPIO4_nSTSCHG GPIO4_nBVD1
74#define GPIO11_nCD 11
75#define GPIO26_PRDY_nBSY 26
76#define GUMSTIX_S0_nSTSCHG_IRQ IRQ_GPIO(GPIO4_nSTSCHG)
77#define GUMSTIX_S0_nCD_IRQ IRQ_GPIO(GPIO11_nCD)
78#define GUMSTIX_S0_PRDY_nBSY_IRQ IRQ_GPIO(GPIO26_PRDY_nBSY)
79
80/* CF slot 1 */
81#define GPIO18_nBVD1 18
82#define GPIO18_nSTSCHG GPIO18_nBVD1
83#define GPIO36_nCD 36
84#define GPIO27_PRDY_nBSY 27
85#define GUMSTIX_S1_nSTSCHG_IRQ IRQ_GPIO(GPIO18_nSTSCHG)
86#define GUMSTIX_S1_nCD_IRQ IRQ_GPIO(GPIO36_nCD)
87#define GUMSTIX_S1_PRDY_nBSY_IRQ IRQ_GPIO(GPIO27_PRDY_nBSY)
88
89/* CF GPIO line modes */
90#define GPIO4_nSTSCHG_MD (GPIO4_nSTSCHG | GPIO_IN)
91#define GPIO8_RESET_MD (GPIO8_RESET | GPIO_OUT)
92#define GPIO11_nCD_MD (GPIO11_nCD | GPIO_IN)
93#define GPIO18_nSTSCHG_MD (GPIO18_nSTSCHG | GPIO_IN)
94#define GPIO26_PRDY_nBSY_MD (GPIO26_PRDY_nBSY | GPIO_IN)
95#define GPIO27_PRDY_nBSY_MD (GPIO27_PRDY_nBSY | GPIO_IN)
96#define GPIO36_nCD_MD (GPIO36_nCD | GPIO_IN)
diff --git a/include/asm-arm/arch-pxa/irda.h b/include/asm-arm/arch-pxa/irda.h
index 748406f384c2..99f4f423a8e1 100644
--- a/include/asm-arm/arch-pxa/irda.h
+++ b/include/asm-arm/arch-pxa/irda.h
@@ -10,6 +10,8 @@
10struct pxaficp_platform_data { 10struct pxaficp_platform_data {
11 int transceiver_cap; 11 int transceiver_cap;
12 void (*transceiver_mode)(struct device *dev, int mode); 12 void (*transceiver_mode)(struct device *dev, int mode);
13 int (*startup)(struct device *dev);
14 void (*shutdown)(struct device *dev);
13}; 15};
14 16
15extern void pxa_set_ficp_info(struct pxaficp_platform_data *info); 17extern void pxa_set_ficp_info(struct pxaficp_platform_data *info);
diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h
index c562b972a4a6..50c77eacbd5e 100644
--- a/include/asm-arm/arch-pxa/irqs.h
+++ b/include/asm-arm/arch-pxa/irqs.h
@@ -181,7 +181,8 @@
181#elif defined(CONFIG_ARCH_LUBBOCK) || \ 181#elif defined(CONFIG_ARCH_LUBBOCK) || \
182 defined(CONFIG_MACH_LOGICPD_PXA270) || \ 182 defined(CONFIG_MACH_LOGICPD_PXA270) || \
183 defined(CONFIG_MACH_MAINSTONE) || \ 183 defined(CONFIG_MACH_MAINSTONE) || \
184 defined(CONFIG_MACH_PCM027) 184 defined(CONFIG_MACH_PCM027) || \
185 defined(CONFIG_MACH_MAGICIAN)
185#define NR_IRQS (IRQ_BOARD_END) 186#define NR_IRQS (IRQ_BOARD_END)
186#else 187#else
187#define NR_IRQS (IRQ_BOARD_START) 188#define NR_IRQS (IRQ_BOARD_START)
diff --git a/include/asm-arm/arch-pxa/magician.h b/include/asm-arm/arch-pxa/magician.h
index 337f51f06b3a..b34fd5683e2d 100644
--- a/include/asm-arm/arch-pxa/magician.h
+++ b/include/asm-arm/arch-pxa/magician.h
@@ -12,7 +12,8 @@
12#ifndef _MAGICIAN_H_ 12#ifndef _MAGICIAN_H_
13#define _MAGICIAN_H_ 13#define _MAGICIAN_H_
14 14
15#include <asm/arch/pxa-regs.h> 15#include <asm/arch/irqs.h>
16#include <asm/arch/pxa2xx-gpio.h>
16 17
17/* 18/*
18 * PXA GPIOs 19 * PXA GPIOs
@@ -34,6 +35,7 @@
34#define GPIO48_MAGICIAN_UNKNOWN 48 35#define GPIO48_MAGICIAN_UNKNOWN 48
35#define GPIO56_MAGICIAN_UNKNOWN 56 36#define GPIO56_MAGICIAN_UNKNOWN 56
36#define GPIO57_MAGICIAN_CAM_RESET 57 37#define GPIO57_MAGICIAN_CAM_RESET 57
38#define GPIO75_MAGICIAN_SAMSUNG_POWER 75
37#define GPIO83_MAGICIAN_nIR_EN 83 39#define GPIO83_MAGICIAN_nIR_EN 83
38#define GPIO86_MAGICIAN_GSM_RESET 86 40#define GPIO86_MAGICIAN_GSM_RESET 86
39#define GPIO87_MAGICIAN_GSM_SELECT 87 41#define GPIO87_MAGICIAN_GSM_SELECT 87
@@ -81,6 +83,7 @@
81#define GPIO48_MAGICIAN_UNKNOWN_MD (48 | GPIO_OUT) 83#define GPIO48_MAGICIAN_UNKNOWN_MD (48 | GPIO_OUT)
82#define GPIO56_MAGICIAN_UNKNOWN_MD (56 | GPIO_OUT) 84#define GPIO56_MAGICIAN_UNKNOWN_MD (56 | GPIO_OUT)
83#define GPIO57_MAGICIAN_CAM_RESET_MD (57 | GPIO_OUT) 85#define GPIO57_MAGICIAN_CAM_RESET_MD (57 | GPIO_OUT)
86#define GPIO75_MAGICIAN_SAMSUNG_POWER_MD (75 | GPIO_OUT)
84#define GPIO83_MAGICIAN_nIR_EN_MD (83 | GPIO_OUT) 87#define GPIO83_MAGICIAN_nIR_EN_MD (83 | GPIO_OUT)
85#define GPIO86_MAGICIAN_GSM_RESET_MD (86 | GPIO_OUT) 88#define GPIO86_MAGICIAN_GSM_RESET_MD (86 | GPIO_OUT)
86#define GPIO87_MAGICIAN_GSM_SELECT_MD (87 | GPIO_OUT) 89#define GPIO87_MAGICIAN_GSM_SELECT_MD (87 | GPIO_OUT)
@@ -108,4 +111,56 @@
108#define GPIO119_MAGICIAN_UNKNOWN_MD (119 | GPIO_OUT) 111#define GPIO119_MAGICIAN_UNKNOWN_MD (119 | GPIO_OUT)
109#define GPIO120_MAGICIAN_UNKNOWN_MD (120 | GPIO_OUT) 112#define GPIO120_MAGICIAN_UNKNOWN_MD (120 | GPIO_OUT)
110 113
114/*
115 * CPLD IRQs
116 */
117
118#define IRQ_MAGICIAN_SD (IRQ_BOARD_START + 0)
119#define IRQ_MAGICIAN_EP (IRQ_BOARD_START + 1)
120#define IRQ_MAGICIAN_BT (IRQ_BOARD_START + 2)
121#define IRQ_MAGICIAN_AC (IRQ_BOARD_START + 3)
122
123/*
124 * CPLD EGPIOs
125 */
126
127#define MAGICIAN_EGPIO_BASE 0x80 /* GPIO_BOARD_START */
128#define MAGICIAN_EGPIO(reg,bit) \
129 (MAGICIAN_EGPIO_BASE + 8*reg + bit)
130
131/* output */
132
133#define EGPIO_MAGICIAN_TOPPOLY_POWER MAGICIAN_EGPIO(0, 2)
134#define EGPIO_MAGICIAN_LED_POWER MAGICIAN_EGPIO(0, 5)
135#define EGPIO_MAGICIAN_GSM_RESET MAGICIAN_EGPIO(0, 6)
136#define EGPIO_MAGICIAN_LCD_POWER MAGICIAN_EGPIO(0, 7)
137#define EGPIO_MAGICIAN_SPK_POWER MAGICIAN_EGPIO(1, 0)
138#define EGPIO_MAGICIAN_EP_POWER MAGICIAN_EGPIO(1, 1)
139#define EGPIO_MAGICIAN_IN_SEL0 MAGICIAN_EGPIO(1, 2)
140#define EGPIO_MAGICIAN_IN_SEL1 MAGICIAN_EGPIO(1, 3)
141#define EGPIO_MAGICIAN_MIC_POWER MAGICIAN_EGPIO(1, 4)
142#define EGPIO_MAGICIAN_CODEC_RESET MAGICIAN_EGPIO(1, 5)
143#define EGPIO_MAGICIAN_CODEC_POWER MAGICIAN_EGPIO(1, 6)
144#define EGPIO_MAGICIAN_BL_POWER MAGICIAN_EGPIO(1, 7)
145#define EGPIO_MAGICIAN_SD_POWER MAGICIAN_EGPIO(2, 0)
146#define EGPIO_MAGICIAN_CARKIT_MIC MAGICIAN_EGPIO(2, 1)
147#define EGPIO_MAGICIAN_UNKNOWN_WAVEDEV_DLL MAGICIAN_EGPIO(2, 2)
148#define EGPIO_MAGICIAN_FLASH_VPP MAGICIAN_EGPIO(2, 3)
149#define EGPIO_MAGICIAN_BL_POWER2 MAGICIAN_EGPIO(2, 4)
150#define EGPIO_MAGICIAN_CHARGE_EN MAGICIAN_EGPIO(2, 5)
151#define EGPIO_MAGICIAN_GSM_POWER MAGICIAN_EGPIO(2, 7)
152
153/* input */
154
155#define EGPIO_MAGICIAN_CABLE_STATE_AC MAGICIAN_EGPIO(4, 0)
156#define EGPIO_MAGICIAN_CABLE_STATE_USB MAGICIAN_EGPIO(4, 1)
157
158#define EGPIO_MAGICIAN_BOARD_ID0 MAGICIAN_EGPIO(5, 0)
159#define EGPIO_MAGICIAN_BOARD_ID1 MAGICIAN_EGPIO(5, 1)
160#define EGPIO_MAGICIAN_BOARD_ID2 MAGICIAN_EGPIO(5, 2)
161#define EGPIO_MAGICIAN_LCD_SELECT MAGICIAN_EGPIO(5, 3)
162#define EGPIO_MAGICIAN_nSD_READONLY MAGICIAN_EGPIO(5, 4)
163
164#define EGPIO_MAGICIAN_EP_INSERT MAGICIAN_EGPIO(6, 1)
165
111#endif /* _MAGICIAN_H_ */ 166#endif /* _MAGICIAN_H_ */
diff --git a/include/asm-arm/arch-pxa/mfp-pxa25x.h b/include/asm-arm/arch-pxa/mfp-pxa25x.h
new file mode 100644
index 000000000000..0499323010ba
--- /dev/null
+++ b/include/asm-arm/arch-pxa/mfp-pxa25x.h
@@ -0,0 +1,161 @@
1#ifndef __ASM_ARCH_MFP_PXA25X_H
2#define __ASM_ARCH_MFP_PXA25X_H
3
4#include <asm/arch/mfp.h>
5#include <asm/arch/mfp-pxa2xx.h>
6
7/* GPIO */
8#define GPIO2_GPIO MFP_CFG_IN(GPIO2, AF0)
9#define GPIO3_GPIO MFP_CFG_IN(GPIO3, AF0)
10#define GPIO4_GPIO MFP_CFG_IN(GPIO4, AF0)
11#define GPIO5_GPIO MFP_CFG_IN(GPIO5, AF0)
12#define GPIO6_GPIO MFP_CFG_IN(GPIO6, AF0)
13#define GPIO7_GPIO MFP_CFG_IN(GPIO7, AF0)
14#define GPIO8_GPIO MFP_CFG_IN(GPIO8, AF0)
15
16#define GPIO1_RST MFP_CFG_IN(GPIO1, AF1)
17
18/* Crystal and Clock Signals */
19#define GPIO10_RTCCLK MFP_CFG_OUT(GPIO10, AF1, DRIVE_LOW)
20#define GPIO70_RTC_CLK MFP_CFG_OUT(GPIO70, AF1, DRIVE_LOW)
21#define GPIO7_48MHz MFP_CFG_OUT(GPIO7, AF1, DRIVE_LOW)
22#define GPIO11_3_6MHz MFP_CFG_OUT(GPIO11, AF1, DRIVE_LOW)
23#define GPIO71_3_6MHz MFP_CFG_OUT(GPIO71, AF1, DRIVE_LOW)
24#define GPIO12_32KHz MFP_CFG_OUT(GPIO12, AF1, DRIVE_LOW)
25#define GPIO72_32kHz MFP_CFG_OUT(GPIO72, AF1, DRIVE_LOW)
26
27/* SDRAM and Static Memory I/O Signals */
28#define GPIO15_nCS_1 MFP_CFG_OUT(GPIO15, AF2, DRIVE_HIGH)
29#define GPIO78_nCS_2 MFP_CFG_OUT(GPIO78, AF2, DRIVE_HIGH)
30#define GPIO79_nCS_3 MFP_CFG_OUT(GPIO79, AF2, DRIVE_HIGH)
31#define GPIO80_nCS_4 MFP_CFG_OUT(GPIO80, AF2, DRIVE_HIGH)
32#define GPIO33_nCS_5 MFP_CFG_OUT(GPIO33, AF2, DRIVE_HIGH)
33
34/* Miscellaneous I/O and DMA Signals */
35#define GPIO18_RDY MFP_CFG_IN(GPIO18, AF1)
36#define GPIO20_DREQ_0 MFP_CFG_IN(GPIO20, AF1)
37#define GPIO19_DREQ_1 MFP_CFG_IN(GPIO19, AF1)
38
39/* Alternate Bus Master Mode I/O Signals */
40#define GPIO13_MBGNT MFP_CFG_OUT(GPIO13, AF2, DRIVE_LOW)
41#define GPIO73_MBGNT MFP_CFG_OUT(GPIO73, AF1, DRIVE_LOW)
42#define GPIO14_MBREQ MFP_CFG_IN(GPIO14, AF1)
43#define GPIO66_MBREQ MFP_CFG_IN(GPIO66, AF1)
44
45/* PC CARD */
46#define GPIO52_nPCE_1 MFP_CFG_OUT(GPIO52, AF2, DRIVE_HIGH)
47#define GPIO53_nPCE_2 MFP_CFG_OUT(GPIO53, AF2, DRIVE_HIGH)
48#define GPIO55_nPREG MFP_CFG_OUT(GPIO55, AF2, DRIVE_HIGH)
49#define GPIO50_nPIOR MFP_CFG_OUT(GPIO50, AF2, DRIVE_HIGH)
50#define GPIO51_nPIOW MFP_CFG_OUT(GPIO51, AF2, DRIVE_HIGH)
51#define GPIO49_nPWE MFP_CFG_OUT(GPIO49, AF2, DRIVE_HIGH)
52#define GPIO48_nPOE MFP_CFG_OUT(GPIO48, AF2, DRIVE_HIGH)
53#define GPIO57_nIOIS16 MFP_CFG_IN(GPIO57, AF1)
54#define GPIO56_nPWAIT MFP_CFG_IN(GPIO56, AF1)
55#define GPIO54_nPSKTSEL MFP_CFG_OUT(GPIO54, AF2, DRIVE_HIGH)
56
57/* FFUART */
58#define GPIO34_FFUART_RXD MFP_CFG_IN(GPIO34, AF1)
59#define GPIO35_FFUART_CTS MFP_CFG_IN(GPIO35, AF1)
60#define GPIO36_FFUART_DCD MFP_CFG_IN(GPIO36, AF1)
61#define GPIO37_FFUART_DSR MFP_CFG_IN(GPIO37, AF1)
62#define GPIO38_FFUART_RI MFP_CFG_IN(GPIO38, AF1)
63#define GPIO39_FFUART_TXD MFP_CFG_OUT(GPIO39, AF2, DRIVE_HIGH)
64#define GPIO40_FFUART_DTR MFP_CFG_OUT(GPIO40, AF2, DRIVE_HIGH)
65#define GPIO41_FFUART_RTS MFP_CFG_OUT(GPIO41, AF2, DRIVE_HIGH)
66
67/* BTUART */
68#define GPIO42_BTUART_RXD MFP_CFG_IN(GPIO42, AF1)
69#define GPIO43_BTUART_TXD MFP_CFG_OUT(GPIO43, AF2, DRIVE_HIGH)
70#define GPIO44_BTUART_CTS MFP_CFG_IN(GPIO44, AF1)
71#define GPIO45_BTUART_RTS MFP_CFG_OUT(GPIO45, AF2, DRIVE_HIGH)
72
73/* STUART */
74#define GPIO46_STUART_RXD MFP_CFG_IN(GPIO46, AF2)
75#define GPIO47_STUART_TXD MFP_CFG_OUT(GPIO47, AF1, DRIVE_HIGH)
76
77/* HWUART */
78#define GPIO42_HWUART_RXD MFP_CFG_IN(GPIO42, AF3)
79#define GPIO43_HWUART_TXD MFP_CFG_OUT(GPIO43, AF3, DRIVE_HIGH)
80#define GPIO44_HWUART_CTS MFP_CFG_IN(GPIO44, AF3)
81#define GPIO45_HWUART_RTS MFP_CFG_OUT(GPIO45, AF3, DRIVE_HIGH)
82#define GPIO48_HWUART_TXD MFP_CFG_OUT(GPIO48, AF1, DRIVE_HIGH)
83#define GPIO49_HWUART_RXD MFP_CFG_IN(GPIO49, AF1)
84#define GPIO50_HWUART_CTS MFP_CFG_IN(GPIO50, AF1)
85#define GPIO51_HWUART_RTS MFP_CFG_OUT(GPIO51, AF1, DRIVE_HIGH)
86
87/* FICP */
88#define GPIO46_FICP_RXD MFP_CFG_IN(GPIO46, AF1)
89#define GPIO47_FICP_TXD MFP_CFG_OUT(GPIO47, AF2, DRIVE_HIGH)
90
91/* PWM 0/1 */
92#define GPIO16_PWM0_OUT MFP_CFG_OUT(GPIO16, AF2, DRIVE_LOW)
93#define GPIO17_PWM1_OUT MFP_CFG_OUT(GPIO17, AF2, DRIVE_LOW)
94
95/* AC97 */
96#define GPIO28_AC97_BITCLK MFP_CFG_IN(GPIO28, AF1)
97#define GPIO29_AC97_SDATA_IN_0 MFP_CFG_IN(GPIO29, AF1)
98#define GPIO30_AC97_SDATA_OUT MFP_CFG_OUT(GPIO30, AF2, DRIVE_LOW)
99#define GPIO31_AC97_SYNC MFP_CFG_OUT(GPIO31, AF2, DRIVE_LOW)
100#define GPIO32_AC97_SDATA_IN_1 MFP_CFG_IN(GPIO32, AF1)
101
102/* I2S */
103#define GPIO28_I2S_BITCLK_IN MFP_CFG_IN(GPIO28, AF2)
104#define GPIO28_I2S_BITCLK_OUT MFP_CFG_OUT(GPIO28, AF1, DRIVE_LOW)
105#define GPIO29_I2S_SDATA_IN MFP_CFG_IN(GPIO29, AF2)
106#define GPIO30_I2S_SDATA_OUT MFP_CFG_OUT(GPIO30, AF1, DRIVE_LOW)
107#define GPIO31_I2S_SYNC MFP_CFG_OUT(GPIO31, AF1, DRIVE_LOW)
108#define GPIO32_I2S_SYSCLK MFP_CFG_OUT(GPIO32, AF1, DRIVE_LOW)
109
110/* SSP 1 */
111#define GPIO23_SSP1_SCLK MFP_CFG_OUT(GPIO23, AF2, DRIVE_LOW)
112#define GPIO24_SSP1_SFRM MFP_CFG_OUT(GPIO24, AF2, DRIVE_LOW)
113#define GPIO25_SSP1_TXD MFP_CFG_OUT(GPIO25, AF2, DRIVE_LOW)
114#define GPIO26_SSP1_RXD MFP_CFG_IN(GPIO26, AF1)
115#define GPIO27_SSP1_EXTCLK MFP_CFG_IN(GPIO27, AF1)
116
117/* SSP 2 - NSSP */
118#define GPIO81_SSP2_CLK_OUT MFP_CFG_OUT(GPIO81, AF1, DRIVE_LOW)
119#define GPIO81_SSP2_CLK_IN MFP_CFG_IN(GPIO81, AF1)
120#define GPIO82_SSP2_FRM_OUT MFP_CFG_OUT(GPIO82, AF1, DRIVE_LOW)
121#define GPIO82_SSP2_FRM_IN MFP_CFG_IN(GPIO82, AF1)
122#define GPIO83_SSP2_TXD MFP_CFG_OUT(GPIO83, AF1, DRIVE_LOW)
123#define GPIO83_SSP2_RXD MFP_CFG_IN(GPIO83, AF2)
124#define GPIO84_SSP2_TXD MFP_CFG_OUT(GPIO84, AF1, DRIVE_LOW)
125#define GPIO84_SSP2_RXD MFP_CFG_IN(GPIO84, AF2)
126
127/* MMC */
128#define GPIO6_MMC_CLK MFP_CFG_OUT(GPIO6, AF1, DRIVE_LOW)
129#define GPIO8_MMC_CS0 MFP_CFG_OUT(GPIO8, AF1, DRIVE_LOW)
130#define GPIO9_MMC_CS1 MFP_CFG_OUT(GPIO9, AF1, DRIVE_LOW)
131#define GPIO34_MMC_CS0 MFP_CFG_OUT(GPIO34, AF2, DRIVE_LOW)
132#define GPIO39_MMC_CS1 MFP_CFG_OUT(GPIO39, AF1, DRIVE_LOW)
133#define GPIO53_MMC_CLK MFP_CFG_OUT(GPIO53, AF1, DRIVE_LOW)
134#define GPIO54_MMC_CLK MFP_CFG_OUT(GPIO54, AF1, DRIVE_LOW)
135#define GPIO69_MMC_CLK MFP_CFG_OUT(GPIO69, AF1, DRIVE_LOW)
136#define GPIO67_MMC_CS0 MFP_CFG_OUT(GPIO67, AF1, DRIVE_LOW)
137#define GPIO68_MMC_CS1 MFP_CFG_OUT(GPIO68, AF1, DRIVE_LOW)
138
139/* LCD */
140#define GPIO58_LCD_LDD_0 MFP_CFG_OUT(GPIO58, AF2, DRIVE_LOW)
141#define GPIO59_LCD_LDD_1 MFP_CFG_OUT(GPIO59, AF2, DRIVE_LOW)
142#define GPIO60_LCD_LDD_2 MFP_CFG_OUT(GPIO60, AF2, DRIVE_LOW)
143#define GPIO61_LCD_LDD_3 MFP_CFG_OUT(GPIO61, AF2, DRIVE_LOW)
144#define GPIO62_LCD_LDD_4 MFP_CFG_OUT(GPIO62, AF2, DRIVE_LOW)
145#define GPIO63_LCD_LDD_5 MFP_CFG_OUT(GPIO63, AF2, DRIVE_LOW)
146#define GPIO64_LCD_LDD_6 MFP_CFG_OUT(GPIO64, AF2, DRIVE_LOW)
147#define GPIO65_LCD_LDD_7 MFP_CFG_OUT(GPIO65, AF2, DRIVE_LOW)
148#define GPIO66_LCD_LDD_8 MFP_CFG_OUT(GPIO66, AF2, DRIVE_LOW)
149#define GPIO67_LCD_LDD_9 MFP_CFG_OUT(GPIO67, AF2, DRIVE_LOW)
150#define GPIO68_LCD_LDD_10 MFP_CFG_OUT(GPIO68, AF2, DRIVE_LOW)
151#define GPIO69_LCD_LDD_11 MFP_CFG_OUT(GPIO69, AF2, DRIVE_LOW)
152#define GPIO70_LCD_LDD_12 MFP_CFG_OUT(GPIO70, AF2, DRIVE_LOW)
153#define GPIO71_LCD_LDD_13 MFP_CFG_OUT(GPIO71, AF2, DRIVE_LOW)
154#define GPIO72_LCD_LDD_14 MFP_CFG_OUT(GPIO72, AF2, DRIVE_LOW)
155#define GPIO73_LCD_LDD_15 MFP_CFG_OUT(GPIO73, AF2, DRIVE_LOW)
156#define GPIO74_LCD_FCLK MFP_CFG_OUT(GPIO74, AF2, DRIVE_LOW)
157#define GPIO75_LCD_LCLK MFP_CFG_OUT(GPIO75, AF2, DRIVE_LOW)
158#define GPIO76_LCD_PCLK MFP_CFG_OUT(GPIO76, AF2, DRIVE_LOW)
159#define GPIO77_LCD_ACBIAS MFP_CFG_OUT(GPIO77, AF2, DRIVE_LOW)
160
161#endif /* __ASM_ARCH_MFP_PXA25X_H */
diff --git a/include/asm-arm/arch-pxa/mfp-pxa27x.h b/include/asm-arm/arch-pxa/mfp-pxa27x.h
new file mode 100644
index 000000000000..eb6eaa174f8d
--- /dev/null
+++ b/include/asm-arm/arch-pxa/mfp-pxa27x.h
@@ -0,0 +1,432 @@
1#ifndef __ASM_ARCH_MFP_PXA27X_H
2#define __ASM_ARCH_MFP_PXA27X_H
3
4/*
5 * NOTE: for those special-function bidirectional GPIOs, as described
6 * in the "PXA27x Developer's Manual" Section 24.4.2.1, only its input
7 * alternative is preserved, the direction is actually selected by the
8 * specific controller, and this should work in most cases.
9 */
10
11#include <asm/arch/mfp.h>
12#include <asm/arch/mfp-pxa2xx.h>
13
14/* GPIO */
15#define GPIO85_GPIO MFP_CFG_IN(GPIO85, AF0)
16#define GPIO86_GPIO MFP_CFG_IN(GPIO86, AF0)
17#define GPIO87_GPIO MFP_CFG_IN(GPIO87, AF0)
18#define GPIO88_GPIO MFP_CFG_IN(GPIO88, AF0)
19#define GPIO89_GPIO MFP_CFG_IN(GPIO89, AF0)
20#define GPIO90_GPIO MFP_CFG_IN(GPIO90, AF0)
21#define GPIO91_GPIO MFP_CFG_IN(GPIO91, AF0)
22#define GPIO92_GPIO MFP_CFG_IN(GPIO92, AF0)
23#define GPIO93_GPIO MFP_CFG_IN(GPIO93, AF0)
24#define GPIO94_GPIO MFP_CFG_IN(GPIO94, AF0)
25#define GPIO95_GPIO MFP_CFG_IN(GPIO95, AF0)
26#define GPIO96_GPIO MFP_CFG_IN(GPIO96, AF0)
27#define GPIO97_GPIO MFP_CFG_IN(GPIO97, AF0)
28#define GPIO98_GPIO MFP_CFG_IN(GPIO98, AF0)
29#define GPIO99_GPIO MFP_CFG_IN(GPIO99, AF0)
30#define GPIO100_GPIO MFP_CFG_IN(GPIO100, AF0)
31#define GPIO101_GPIO MFP_CFG_IN(GPIO101, AF0)
32#define GPIO102_GPIO MFP_CFG_IN(GPIO102, AF0)
33#define GPIO103_GPIO MFP_CFG_IN(GPIO103, AF0)
34#define GPIO104_GPIO MFP_CFG_IN(GPIO104, AF0)
35#define GPIO105_GPIO MFP_CFG_IN(GPIO105, AF0)
36#define GPIO106_GPIO MFP_CFG_IN(GPIO106, AF0)
37#define GPIO107_GPIO MFP_CFG_IN(GPIO107, AF0)
38#define GPIO108_GPIO MFP_CFG_IN(GPIO108, AF0)
39#define GPIO109_GPIO MFP_CFG_IN(GPIO109, AF0)
40#define GPIO110_GPIO MFP_CFG_IN(GPIO110, AF0)
41#define GPIO111_GPIO MFP_CFG_IN(GPIO111, AF0)
42#define GPIO112_GPIO MFP_CFG_IN(GPIO112, AF0)
43#define GPIO113_GPIO MFP_CFG_IN(GPIO113, AF0)
44#define GPIO114_GPIO MFP_CFG_IN(GPIO114, AF0)
45#define GPIO115_GPIO MFP_CFG_IN(GPIO115, AF0)
46#define GPIO116_GPIO MFP_CFG_IN(GPIO116, AF0)
47#define GPIO117_GPIO MFP_CFG_IN(GPIO117, AF0)
48#define GPIO118_GPIO MFP_CFG_IN(GPIO118, AF0)
49#define GPIO119_GPIO MFP_CFG_IN(GPIO119, AF0)
50#define GPIO120_GPIO MFP_CFG_IN(GPIO120, AF0)
51
52/* Crystal and Clock Signals */
53#define GPIO9_HZ_CLK MFP_CFG_OUT(GPIO9, AF1, DRIVE_LOW)
54#define GPIO10_HZ_CLK MFP_CFG_OUT(GPIO10, AF1, DRIVE_LOW)
55#define GPIO11_48_MHz MFP_CFG_OUT(GPIO11, AF3, DRIVE_LOW)
56#define GPIO12_48_MHz MFP_CFG_OUT(GPIO12, AF3, DRIVE_LOW)
57#define GPIO13_CLK_EXT MFP_CFG_IN(GPIO13, AF1)
58
59/* OS Timer Signals */
60#define GPIO11_EXT_SYNC_0 MFP_CFG_IN(GPIO11, AF1)
61#define GPIO12_EXT_SYNC_1 MFP_CFG_IN(GPIO12, AF1)
62#define GPIO9_CHOUT_0 MFP_CFG_OUT(GPIO9, AF3, DRIVE_LOW)
63#define GPIO10_CHOUT_1 MFP_CFG_OUT(GPIO10, AF3, DRIVE_LOW)
64#define GPIO11_CHOUT_0 MFP_CFG_OUT(GPIO11, AF1, DRIVE_LOW)
65#define GPIO12_CHOUT_1 MFP_CFG_OUT(GPIO12, AF1, DRIVE_LOW)
66
67/* SDRAM and Static Memory I/O Signals */
68#define GPIO20_nSDCS_2 MFP_CFG_OUT(GPIO20, AF1, DRIVE_HIGH)
69#define GPIO21_nSDCS_3 MFP_CFG_OUT(GPIO21, AF1, DRIVE_HIGH)
70#define GPIO15_nCS_1 MFP_CFG_OUT(GPIO15, AF2, DRIVE_HIGH)
71#define GPIO78_nCS_2 MFP_CFG_OUT(GPIO78, AF2, DRIVE_HIGH)
72#define GPIO79_nCS_3 MFP_CFG_OUT(GPIO79, AF2, DRIVE_HIGH)
73#define GPIO80_nCS_4 MFP_CFG_OUT(GPIO80, AF2, DRIVE_HIGH)
74#define GPIO33_nCS_5 MFP_CFG_OUT(GPIO33, AF2, DRIVE_HIGH)
75
76/* Miscellaneous I/O and DMA Signals */
77#define GPIO21_DVAL_0 MFP_CFG_OUT(GPIO21, AF2, DRIVE_HIGH)
78#define GPIO116_DVAL_0 MFP_CFG_OUT(GPIO116, AF1, DRIVE_HIGH)
79#define GPIO33_DVAL_1 MFP_CFG_OUT(GPIO33, AF1, DRIVE_HIGH)
80#define GPIO96_DVAL_1 MFP_CFG_OUT(GPIO96, AF2, DRIVE_HIGH)
81#define GPIO18_RDY MFP_CFG_IN(GPIO18, AF1)
82#define GPIO20_DREQ_0 MFP_CFG_IN(GPIO20, AF1)
83#define GPIO115_DREQ_0 MFP_CFG_IN(GPIO115, AF1)
84#define GPIO80_DREQ_1 MFP_CFG_IN(GPIO80, AF1)
85#define GPIO97_DREQ_1 MFP_CFG_IN(GPIO97, AF2)
86#define GPIO85_DREQ_2 MFP_CFG_IN(GPIO85, AF2)
87#define GPIO100_DREQ_2 MFP_CFG_IN(GPIO100, AF2)
88
89/* Alternate Bus Master Mode I/O Signals */
90#define GPIO20_MBREQ MFP_CFG_IN(GPIO20, AF2)
91#define GPIO80_MBREQ MFP_CFG_IN(GPIO80, AF2)
92#define GPIO96_MBREQ MFP_CFG_IN(GPIO96, AF2)
93#define GPIO115_MBREQ MFP_CFG_IN(GPIO115, AF3)
94#define GPIO21_MBGNT MFP_CFG_OUT(GPIO21, AF3, DRIVE_LOW)
95#define GPIO33_MBGNT MFP_CFG_OUT(GPIO33, AF3, DRIVE_LOW)
96#define GPIO97_MBGNT MFP_CFG_OUT(GPIO97, AF2, DRIVE_LOW)
97#define GPIO116_MBGNT MFP_CFG_OUT(GPIO116, AF3, DRIVE_LOW)
98
99/* PC CARD */
100#define GPIO15_nPCE_1 MFP_CFG_OUT(GPIO15, AF1, DRIVE_HIGH)
101#define GPIO85_nPCE_1 MFP_CFG_OUT(GPIO85, AF1, DRIVE_HIGH)
102#define GPIO86_nPCE_1 MFP_CFG_OUT(GPIO86, AF1, DRIVE_HIGH)
103#define GPIO102_nPCE_1 MFP_CFG_OUT(GPIO102, AF1, DRIVE_HIGH)
104#define GPIO54_nPCE_2 MFP_CFG_OUT(GPIO54, AF2, DRIVE_HIGH)
105#define GPIO78_nPCE_2 MFP_CFG_OUT(GPIO78, AF1, DRIVE_HIGH)
106#define GPIO87_nPCE_2 MFP_CFG_IN(GPIO87, AF1)
107#define GPIO55_nPREG MFP_CFG_OUT(GPIO55, AF2, DRIVE_HIGH)
108#define GPIO50_nPIOR MFP_CFG_OUT(GPIO50, AF2, DRIVE_HIGH)
109#define GPIO51_nPIOW MFP_CFG_OUT(GPIO51, AF2, DRIVE_HIGH)
110#define GPIO49_nPWE MFP_CFG_OUT(GPIO49, AF2, DRIVE_HIGH)
111#define GPIO48_nPOE MFP_CFG_OUT(GPIO48, AF2, DRIVE_HIGH)
112#define GPIO57_nIOIS16 MFP_CFG_IN(GPIO57, AF1)
113#define GPIO56_nPWAIT MFP_CFG_IN(GPIO56, AF1)
114#define GPIO79_PSKTSEL MFP_CFG_OUT(GPIO79, AF1, DRIVE_HIGH)
115
116/* I2C */
117#define GPIO117_I2C_SCL MFP_CFG_IN(GPIO117, AF1)
118#define GPIO118_I2C_SDA MFP_CFG_IN(GPIO118, AF1)
119
120/* FFUART */
121#define GPIO9_FFUART_CTS MFP_CFG_IN(GPIO9, AF3)
122#define GPIO26_FFUART_CTS MFP_CFG_IN(GPIO26, AF3)
123#define GPIO35_FFUART_CTS MFP_CFG_IN(GPIO35, AF1)
124#define GPIO100_FFUART_CTS MFP_CFG_IN(GPIO100, AF3)
125#define GPIO10_FFUART_DCD MFP_CFG_IN(GPIO10, AF1)
126#define GPIO36_FFUART_DCD MFP_CFG_IN(GPIO36, AF1)
127#define GPIO33_FFUART_DSR MFP_CFG_IN(GPIO33, AF2)
128#define GPIO37_FFUART_DSR MFP_CFG_IN(GPIO37, AF1)
129#define GPIO38_FFUART_RI MFP_CFG_IN(GPIO38, AF1)
130#define GPIO89_FFUART_RI MFP_CFG_IN(GPIO89, AF3)
131#define GPIO19_FFUART_RXD MFP_CFG_IN(GPIO19, AF3)
132#define GPIO33_FFUART_RXD MFP_CFG_IN(GPIO33, AF1)
133#define GPIO34_FFUART_RXD MFP_CFG_IN(GPIO34, AF1)
134#define GPIO41_FFUART_RXD MFP_CFG_IN(GPIO41, AF1)
135#define GPIO53_FFUART_RXD MFP_CFG_IN(GPIO53, AF1)
136#define GPIO85_FFUART_RXD MFP_CFG_IN(GPIO85, AF1)
137#define GPIO96_FFUART_RXD MFP_CFG_IN(GPIO96, AF3)
138#define GPIO102_FFUART_RXD MFP_CFG_IN(GPIO102, AF3)
139#define GPIO16_FFUART_TXD MFP_CFG_OUT(GPIO16, AF3, DRIVE_HIGH)
140#define GPIO37_FFUART_TXD MFP_CFG_OUT(GPIO37, AF3, DRIVE_HIGH)
141#define GPIO39_FFUART_TXD MFP_CFG_OUT(GPIO39, AF2, DRIVE_HIGH)
142#define GPIO83_FFUART_TXD MFP_CFG_OUT(GPIO83, AF2, DRIVE_HIGH)
143#define GPIO99_FFUART_TXD MFP_CFG_OUT(GPIO99, AF3, DRIVE_HIGH)
144#define GPIO27_FFUART_RTS MFP_CFG_OUT(GPIO27, AF3, DRIVE_HIGH)
145#define GPIO41_FFUART_RTS MFP_CFG_OUT(GPIO41, AF2, DRIVE_HIGH)
146#define GPIO83_FFUART_RTS MFP_CFG_OUT(GPIO83, AF3, DRIVE_HIGH)
147#define GPIO98_FFUART_RTS MFP_CFG_OUT(GPIO98, AF3, DRIVE_HIGH)
148#define GPIO40_FFUART_DTR MFP_CFG_OUT(GPIO40, AF2, DRIVE_HIGH)
149#define GPIO82_FFUART_DTR MFP_CFG_OUT(GPIO82, AF3, DRIVE_HIGH)
150
151/* BTUART */
152#define GPIO44_BTUART_CTS MFP_CFG_IN(GPIO44, AF1)
153#define GPIO42_BTUART_RXD MFP_CFG_IN(GPIO42, AF1)
154#define GPIO45_BTUART_RTS MFP_CFG_OUT(GPIO45, AF2, DRIVE_HIGH)
155#define GPIO43_BTUART_TXD MFP_CFG_OUT(GPIO43, AF2, DRIVE_HIGH)
156
157/* STUART */
158#define GPIO46_STUART_RXD MFP_CFG_IN(GPIO46, AF2)
159#define GPIO47_STUART_TXD MFP_CFG_OUT(GPIO47, AF1, DRIVE_HIGH)
160
161/* FICP */
162#define GPIO42_FICP_RXD MFP_CFG_IN(GPIO42, AF2)
163#define GPIO46_FICP_RXD MFP_CFG_IN(GPIO46, AF1)
164#define GPIO43_FICP_TXD MFP_CFG_OUT(GPIO43, AF1, DRIVE_HIGH)
165#define GPIO47_FICP_TXD MFP_CFG_OUT(GPIO47, AF2, DRIVE_HIGH)
166
167/* PWM 0/1/2/3 */
168#define GPIO11_PWM2_OUT MFP_CFG_OUT(GPIO11, AF2, DRIVE_LOW)
169#define GPIO12_PWM3_OUT MFP_CFG_OUT(GPIO12, AF2, DRIVE_LOW)
170#define GPIO16_PWM0_OUT MFP_CFG_OUT(GPIO16, AF2, DRIVE_LOW)
171#define GPIO17_PWM1_OUT MFP_CFG_OUT(GPIO17, AF2, DRIVE_LOW)
172#define GPIO38_PWM1_OUT MFP_CFG_OUT(GPIO38, AF3, DRIVE_LOW)
173#define GPIO46_PWM2_OUT MFP_CFG_OUT(GPIO46, AF2, DRIVE_LOW)
174#define GPIO47_PWM3_OUT MFP_CFG_OUT(GPIO47, AF3, DRIVE_LOW)
175#define GPIO79_PWM2_OUT MFP_CFG_OUT(GPIO79, AF3, DRIVE_LOW)
176#define GPIO80_PWM3_OUT MFP_CFG_OUT(GPIO80, AF3, DRIVE_LOW)
177#define GPIO115_PWM1_OUT MFP_CFG_OUT(GPIO115, AF3, DRIVE_LOW)
178
179/* AC97 */
180#define GPIO31_AC97_SYNC MFP_CFG_OUT(GPIO31, AF2, DRIVE_LOW)
181#define GPIO94_AC97_SYNC MFP_CFG_OUT(GPIO94, AF1, DRIVE_LOW)
182#define GPIO30_AC97_SDATA_OUT MFP_CFG_OUT(GPIO30, AF2, DRIVE_LOW)
183#define GPIO93_AC97_SDATA_OUT MFP_CFG_OUT(GPIO93, AF1, DRIVE_LOW)
184#define GPIO45_AC97_SYSCLK MFP_CFG_OUT(GPIO45, AF1, DRIVE_LOW)
185#define GPIO89_AC97_SYSCLK MFP_CFG_OUT(GPIO89, AF1, DRIVE_LOW)
186#define GPIO98_AC97_SYSCLK MFP_CFG_OUT(GPIO98, AF1, DRIVE_LOW)
187#define GPIO95_AC97_nRESET MFP_CFG_OUT(GPIO95, AF1, DRIVE_LOW)
188#define GPIO113_AC97_nRESET MFP_CFG_OUT(GPIO113, AF2, DRIVE_LOW)
189#define GPIO28_AC97_BITCLK MFP_CFG_IN(GPIO28, AF1)
190#define GPIO29_AC97_SDATA_IN_0 MFP_CFG_IN(GPIO29, AF1)
191#define GPIO116_AC97_SDATA_IN_0 MFP_CFG_IN(GPIO116, AF2)
192#define GPIO99_AC97_SDATA_IN_1 MFP_CFG_IN(GPIO99, AF2)
193
194/* I2S */
195#define GPIO28_I2S_BITCLK_IN MFP_CFG_IN(GPIO28, AF2)
196#define GPIO28_I2S_BITCLK_OUT MFP_CFG_OUT(GPIO28, AF1, DRIVE_LOW)
197#define GPIO29_I2S_SDATA_IN MFP_CFG_IN(GPIO29, AF2)
198#define GPIO30_I2S_SDATA_OUT MFP_CFG_OUT(GPIO30, AF1, DRIVE_LOW)
199#define GPIO31_I2S_SYNC MFP_CFG_OUT(GPIO31, AF1, DRIVE_LOW)
200#define GPIO113_I2S_SYSCLK MFP_CFG_OUT(GPIO113, AF1, DRIVE_LOW)
201
202/* SSP 1 */
203#define GPIO23_SSP1_SCLK MFP_CFG_OUT(GPIO23, AF2, DRIVE_LOW)
204#define GPIO29_SSP1_SCLK MFP_CFG_IN(GPIO29, AF3)
205#define GPIO27_SSP1_SYSCLK MFP_CFG_OUT(GPIO27, AF1, DRIVE_LOW)
206#define GPIO53_SSP1_SYSCLK MFP_CFG_OUT(GPIO53, AF3, DRIVE_LOW)
207#define GPIO24_SSP1_SFRM MFP_CFG_IN(GPIO24, AF2)
208#define GPIO28_SSP1_SFRM MFP_CFG_IN(GPIO28, AF3)
209#define GPIO25_SSP1_TXD MFP_CFG_OUT(GPIO25, AF2, DRIVE_LOW)
210#define GPIO57_SSP1_TXD MFP_CFG_OUT(GPIO57, AF3, DRIVE_LOW)
211#define GPIO26_SSP1_RXD MFP_CFG_IN(GPIO26, AF1)
212#define GPIO27_SSP1_SCLKEN MFP_CFG_IN(GPIO27, AF2)
213
214/* SSP 2 */
215#define GPIO19_SSP2_SCLK MFP_CFG_IN(GPIO19, AF1)
216#define GPIO22_SSP2_SCLK MFP_CFG_IN(GPIO22, AF3)
217#define GPIO29_SSP2_SCLK MFP_CFG_OUT(GPIO29, AF3, DRIVE_LOW)
218#define GPIO36_SSP2_SCLK MFP_CFG_IN(GPIO36, AF2)
219#define GPIO50_SSP2_SCLK MFP_CFG_IN(GPIO50, AF3)
220#define GPIO22_SSP2_SYSCLK MFP_CFG_OUT(GPIO22, AF2, DRIVE_LOW)
221#define GPIO14_SSP2_SFRM MFP_CFG_IN(GPIO14, AF2)
222#define GPIO37_SSP2_SFRM MFP_CFG_IN(GPIO37, AF2)
223#define GPIO87_SSP2_SFRM MFP_CFG_OUT(GPIO87, AF3, DRIVE_LOW)
224#define GPIO88_SSP2_SFRM MFP_CFG_IN(GPIO88, AF3)
225#define GPIO13_SSP2_TXD MFP_CFG_OUT(GPIO13, AF1, DRIVE_LOW)
226#define GPIO38_SSP2_TXD MFP_CFG_OUT(GPIO38, AF2, DRIVE_LOW)
227#define GPIO87_SSP2_TXD MFP_CFG_OUT(GPIO87, AF1, DRIVE_LOW)
228#define GPIO89_SSP2_TXD MFP_CFG_OUT(GPIO89, AF3, DRIVE_LOW)
229#define GPIO11_SSP2_RXD MFP_CFG_IN(GPIO11, AF2)
230#define GPIO29_SSP2_RXD MFP_CFG_OUT(GPIO29, AF1, DRIVE_LOW)
231#define GPIO40_SSP2_RXD MFP_CFG_IN(GPIO40, AF1)
232#define GPIO86_SSP2_RXD MFP_CFG_IN(GPIO86, AF1)
233#define GPIO88_SSP2_RXD MFP_CFG_IN(GPIO88, AF2)
234#define GPIO22_SSP2_EXTCLK MFP_CFG_IN(GPIO22, AF1)
235#define GPIO27_SSP2_EXTCLK MFP_CFG_IN(GPIO27, AF1)
236#define GPIO22_SSP2_SCLKEN MFP_CFG_IN(GPIO22, AF2)
237#define GPIO23_SSP2_SCLKEN MFP_CFG_IN(GPIO23, AF2)
238
239/* SSP 3 */
240#define GPIO34_SSP3_SCLK MFP_CFG_IN(GPIO34, AF3)
241#define GPIO40_SSP3_SCLK MFP_CFG_OUT(GPIO40, AF3, DRIVE_LOW)
242#define GPIO52_SSP3_SCLK MFP_CFG_IN(GPIO52, AF2)
243#define GPIO84_SSP3_SCLK MFP_CFG_IN(GPIO84, AF1)
244#define GPIO45_SSP3_SYSCLK MFP_CFG_OUT(GPIO45, AF3, DRIVE_LOW)
245#define GPIO35_SSP3_SFRM MFP_CFG_IN(GPIO35, AF3)
246#define GPIO39_SSP3_SFRM MFP_CFG_IN(GPIO39, AF3)
247#define GPIO83_SSP3_SFRM MFP_CFG_IN(GPIO83, AF1)
248#define GPIO35_SSP3_TXD MFP_CFG_OUT(GPIO35, AF3, DRIVE_LOW)
249#define GPIO38_SSP3_TXD MFP_CFG_OUT(GPIO38, AF1, DRIVE_LOW)
250#define GPIO81_SSP3_TXD MFP_CFG_OUT(GPIO81, AF1, DRIVE_LOW)
251#define GPIO41_SSP3_RXD MFP_CFG_IN(GPIO41, AF3)
252#define GPIO82_SSP3_RXD MFP_CFG_IN(GPIO82, AF1)
253#define GPIO89_SSP3_RXD MFP_CFG_IN(GPIO89, AF1)
254
255/* MMC */
256#define GPIO32_MMC_CLK MFP_CFG_OUT(GPIO32, AF2, DRIVE_LOW)
257#define GPIO92_MMC_DAT_0 MFP_CFG_IN(GPIO92, AF1)
258#define GPIO109_MMC_DAT_1 MFP_CFG_IN(GPIO109, AF1)
259#define GPIO110_MMC_DAT_2 MFP_CFG_IN(GPIO110, AF1)
260#define GPIO111_MMC_DAT_3 MFP_CFG_IN(GPIO111, AF1)
261#define GPIO112_MMC_CMD MFP_CFG_IN(GPIO112, AF1)
262
263/* LCD */
264#define GPIO58_LCD_LDD_0 MFP_CFG_OUT(GPIO58, AF2, DRIVE_LOW)
265#define GPIO59_LCD_LDD_1 MFP_CFG_OUT(GPIO59, AF2, DRIVE_LOW)
266#define GPIO60_LCD_LDD_2 MFP_CFG_OUT(GPIO60, AF2, DRIVE_LOW)
267#define GPIO61_LCD_LDD_3 MFP_CFG_OUT(GPIO61, AF2, DRIVE_LOW)
268#define GPIO62_LCD_LDD_4 MFP_CFG_OUT(GPIO62, AF2, DRIVE_LOW)
269#define GPIO63_LCD_LDD_5 MFP_CFG_OUT(GPIO63, AF2, DRIVE_LOW)
270#define GPIO64_LCD_LDD_6 MFP_CFG_OUT(GPIO64, AF2, DRIVE_LOW)
271#define GPIO65_LCD_LDD_7 MFP_CFG_OUT(GPIO65, AF2, DRIVE_LOW)
272#define GPIO66_LCD_LDD_8 MFP_CFG_OUT(GPIO66, AF2, DRIVE_LOW)
273#define GPIO67_LCD_LDD_9 MFP_CFG_OUT(GPIO67, AF2, DRIVE_LOW)
274#define GPIO68_LCD_LDD_10 MFP_CFG_OUT(GPIO68, AF2, DRIVE_LOW)
275#define GPIO69_LCD_LDD_11 MFP_CFG_OUT(GPIO69, AF2, DRIVE_LOW)
276#define GPIO70_LCD_LDD_12 MFP_CFG_OUT(GPIO70, AF2, DRIVE_LOW)
277#define GPIO71_LCD_LDD_13 MFP_CFG_OUT(GPIO71, AF2, DRIVE_LOW)
278#define GPIO72_LCD_LDD_14 MFP_CFG_OUT(GPIO72, AF2, DRIVE_LOW)
279#define GPIO73_LCD_LDD_15 MFP_CFG_OUT(GPIO73, AF2, DRIVE_LOW)
280#define GPIO86_LCD_LDD_16 MFP_CFG_OUT(GPIO86, AF2, DRIVE_LOW)
281#define GPIO87_LCD_LDD_17 MFP_CFG_OUT(GPIO87, AF2, DRIVE_LOW)
282#define GPIO74_LCD_FCLK MFP_CFG_OUT(GPIO74, AF2, DRIVE_LOW)
283#define GPIO75_LCD_LCLK MFP_CFG_OUT(GPIO75, AF2, DRIVE_LOW)
284#define GPIO76_LCD_PCLK MFP_CFG_OUT(GPIO76, AF2, DRIVE_LOW)
285#define GPIO77_LCD_BIAS MFP_CFG_OUT(GPIO77, AF2, DRIVE_LOW)
286#define GPIO14_LCD_VSYNC MFP_CFG_IN(GPIO14, AF1)
287#define GPIO19_LCD_CS MFP_CFG_OUT(GPIO19, AF2, DRIVE_LOW)
288
289/* Keypad */
290#define GPIO93_KP_DKIN_0 MFP_CFG_IN(GPIO93, AF1)
291#define GPIO94_KP_DKIN_1 MFP_CFG_IN(GPIO94, AF1)
292#define GPIO95_KP_DKIN_2 MFP_CFG_IN(GPIO95, AF1)
293#define GPIO96_KP_DKIN_3 MFP_CFG_IN(GPIO96, AF1)
294#define GPIO97_KP_DKIN_4 MFP_CFG_IN(GPIO97, AF1)
295#define GPIO98_KP_DKIN_5 MFP_CFG_IN(GPIO98, AF1)
296#define GPIO99_KP_DKIN_6 MFP_CFG_IN(GPIO99, AF1)
297#define GPIO13_KP_KDIN_7 MFP_CFG_IN(GPIO13, AF2)
298#define GPIO100_KP_MKIN_0 MFP_CFG_IN(GPIO100, AF1)
299#define GPIO101_KP_MKIN_1 MFP_CFG_IN(GPIO101, AF1)
300#define GPIO102_KP_MKIN_2 MFP_CFG_IN(GPIO102, AF1)
301#define GPIO34_KP_MKIN_3 MFP_CFG_IN(GPIO34, AF2)
302#define GPIO37_KP_MKIN_3 MFP_CFG_IN(GPIO37, AF3)
303#define GPIO97_KP_MKIN_3 MFP_CFG_IN(GPIO97, AF3)
304#define GPIO98_KP_MKIN_4 MFP_CFG_IN(GPIO98, AF3)
305#define GPIO38_KP_MKIN_4 MFP_CFG_IN(GPIO38, AF2)
306#define GPIO39_KP_MKIN_4 MFP_CFG_IN(GPIO39, AF1)
307#define GPIO16_KP_MKIN_5 MFP_CFG_IN(GPIO16, AF1)
308#define GPIO90_KP_MKIN_5 MFP_CFG_IN(GPIO90, AF1)
309#define GPIO99_KP_MKIN_5 MFP_CFG_IN(GPIO99, AF3)
310#define GPIO17_KP_MKIN_6 MFP_CFG_IN(GPIO17, AF1)
311#define GPIO91_KP_MKIN_6 MFP_CFG_IN(GPIO91, AF1)
312#define GPIO95_KP_MKIN_6 MFP_CFG_IN(GPIO95, AF3)
313#define GPIO13_KP_MKIN_7 MFP_CFG_IN(GPIO13, AF3)
314#define GPIO36_KP_MKIN_7 MFP_CFG_IN(GPIO36, AF3)
315#define GPIO103_KP_MKOUT_0 MFP_CFG_OUT(GPIO103, AF2, DRIVE_HIGH)
316#define GPIO104_KP_MKOUT_1 MFP_CFG_OUT(GPIO104, AF2, DRIVE_HIGH)
317#define GPIO105_KP_MKOUT_2 MFP_CFG_OUT(GPIO105, AF2, DRIVE_HIGH)
318#define GPIO106_KP_MKOUT_3 MFP_CFG_OUT(GPIO106, AF2, DRIVE_HIGH)
319#define GPIO107_KP_MKOUT_4 MFP_CFG_OUT(GPIO107, AF2, DRIVE_HIGH)
320#define GPIO108_KP_MKOUT_5 MFP_CFG_OUT(GPIO108, AF2, DRIVE_HIGH)
321#define GPIO35_KP_MKOUT_6 MFP_CFG_OUT(GPIO35, AF2, DRIVE_HIGH)
322#define GPIO22_KP_MKOUT_7 MFP_CFG_OUT(GPIO22, AF1, DRIVE_HIGH)
323#define GPIO40_KP_MKOUT_6 MFP_CFG_OUT(GPIO40, AF1, DRIVE_HIGH)
324#define GPIO41_KP_MKOUT_7 MFP_CFG_OUT(GPIO41, AF1, DRIVE_HIGH)
325#define GPIO96_KP_MKOUT_6 MFP_CFG_OUT(GPIO96, AF3, DRIVE_HIGH)
326
327/* USB P3 */
328#define GPIO10_USB_P3_5 MFP_CFG_IN(GPIO10, AF3)
329#define GPIO11_USB_P3_1 MFP_CFG_IN(GPIO11, AF3)
330#define GPIO30_USB_P3_2 MFP_CFG_OUT(GPIO30, AF3, DRIVE_LOW)
331#define GPIO31_USB_P3_6 MFP_CFG_OUT(GPIO31, AF3, DRIVE_LOW)
332#define GPIO56_USB_P3_4 MFP_CFG_OUT(GPIO56, AF1, DRIVE_LOW)
333#define GPIO86_USB_P3_5 MFP_CFG_IN(GPIO86, AF3)
334#define GPIO87_USB_P3_1 MFP_CFG_IN(GPIO87, AF3)
335#define GPIO90_USB_P3_5 MFP_CFG_IN(GPIO90, AF2)
336#define GPIO91_USB_P3_1 MFP_CFG_IN(GPIO91, AF2)
337#define GPIO113_USB_P3_3 MFP_CFG_IN(GPIO113, AF3)
338
339/* USB P2 */
340#define GPIO34_USB_P2_2 MFP_CFG_OUT(GPIO34, AF1, DRIVE_LOW)
341#define GPIO35_USB_P2_1 MFP_CFG_IN(GPIO35, AF2)
342#define GPIO36_USB_P2_4 MFP_CFG_OUT(GPIO36, AF1, DRIVE_LOW)
343#define GPIO37_USB_P2_8 MFP_CFG_OUT(GPIO37, AF1, DRIVE_LOW)
344#define GPIO38_USB_P2_3 MFP_CFG_IN(GPIO38, AF3)
345#define GPIO39_USB_P2_6 MFP_CFG_OUT(GPIO39, AF1, DRIVE_LOW)
346#define GPIO40_USB_P2_5 MFP_CFG_IN(GPIO40, AF3)
347#define GPIO41_USB_P2_7 MFP_CFG_IN(GPIO41, AF2)
348#define GPIO53_USB_P2_3 MFP_CFG_IN(GPIO53, AF2)
349
350/* USB Host Port 1/2 */
351#define GPIO88_USBH1_PWR MFP_CFG_IN(GPIO88, AF1)
352#define GPIO89_USBH1_PEN MFP_CFG_OUT(GPIO89, AF2, DRIVE_LOW)
353#define GPIO119_USBH2_PWR MFP_CFG_IN(GPIO119, AF1)
354#define GPIO120_USBH2_PEN MFP_CFG_OUT(GPIO120, AF2, DRIVE_LOW)
355
356/* QCI - default to Master Mode: CIF_FV/CIF_LV Direction In */
357#define GPIO115_CIF_DD_3 MFP_CFG_IN(GPIO115, AF2)
358#define GPIO116_CIF_DD_2 MFP_CFG_IN(GPIO116, AF1)
359#define GPIO12_CIF_DD_7 MFP_CFG_IN(GPIO12, AF2)
360#define GPIO17_CIF_DD_6 MFP_CFG_IN(GPIO17, AF2)
361#define GPIO23_CIF_MCLK MFP_CFG_OUT(GPIO23, AF1, DRIVE_LOW)
362#define GPIO24_CIF_FV MFP_CFG_IN(GPIO24, AF1)
363#define GPIO25_CIF_LV MFP_CFG_IN(GPIO25, AF1)
364#define GPIO26_CIF_PCLK MFP_CFG_IN(GPIO26, AF2)
365#define GPIO27_CIF_DD_0 MFP_CFG_IN(GPIO27, AF3)
366#define GPIO42_CIF_MCLK MFP_CFG_OUT(GPIO42, AF3, DRIVE_LOW)
367#define GPIO43_CIF_FV MFP_CFG_IN(GPIO43, AF3)
368#define GPIO44_CIF_LV MFP_CFG_IN(GPIO44, AF3)
369#define GPIO45_CIF_PCLK MFP_CFG_IN(GPIO45, AF3)
370#define GPIO47_CIF_DD_0 MFP_CFG_IN(GPIO47, AF1)
371#define GPIO48_CIF_DD_5 MFP_CFG_IN(GPIO48, AF1)
372#define GPIO50_CIF_DD_3 MFP_CFG_IN(GPIO50, AF1)
373#define GPIO51_CIF_DD_2 MFP_CFG_IN(GPIO51, AF1)
374#define GPIO52_CIF_DD_4 MFP_CFG_IN(GPIO52, AF1)
375#define GPIO53_CIF_MCLK MFP_CFG_OUT(GPIO53, AF2, DRIVE_LOW)
376#define GPIO54_CIF_PCLK MFP_CFG_IN(GPIO54, AF3)
377#define GPIO55_CIF_DD_1 MFP_CFG_IN(GPIO55, AF1)
378#define GPIO81_CIF_DD_0 MFP_CFG_IN(GPIO81, AF2)
379#define GPIO82_CIF_DD_5 MFP_CFG_IN(GPIO82, AF3)
380#define GPIO83_CIF_DD_4 MFP_CFG_IN(GPIO83, AF3)
381#define GPIO84_CIF_FV MFP_CFG_IN(GPIO84, AF3)
382#define GPIO85_CIF_LV MFP_CFG_IN(GPIO85, AF3)
383#define GPIO90_CIF_DD_4 MFP_CFG_IN(GPIO90, AF3)
384#define GPIO91_CIF_DD_5 MFP_CFG_IN(GPIO91, AF3)
385#define GPIO93_CIF_DD_6 MFP_CFG_IN(GPIO93, AF2)
386#define GPIO94_CIF_DD_5 MFP_CFG_IN(GPIO94, AF2)
387#define GPIO95_CIF_DD_4 MFP_CFG_IN(GPIO95, AF2)
388#define GPIO98_CIF_DD_0 MFP_CFG_IN(GPIO98, AF2)
389#define GPIO103_CIF_DD_3 MFP_CFG_IN(GPIO103, AF1)
390#define GPIO104_CIF_DD_2 MFP_CFG_IN(GPIO104, AF1)
391#define GPIO105_CIF_DD_1 MFP_CFG_IN(GPIO105, AF1)
392#define GPIO106_CIF_DD_9 MFP_CFG_IN(GPIO106, AF1)
393#define GPIO107_CIF_DD_8 MFP_CFG_IN(GPIO107, AF1)
394#define GPIO108_CIF_DD_7 MFP_CFG_IN(GPIO108, AF1)
395#define GPIO114_CIF_DD_1 MFP_CFG_IN(GPIO114, AF1)
396
397/* Universal Subscriber ID Interface */
398#define GPIO114_UVS0 MFP_CFG_OUT(GPIO114, AF2, DRIVE_LOW)
399#define GPIO115_nUVS1 MFP_CFG_OUT(GPIO115, AF2, DRIVE_LOW)
400#define GPIO116_nUVS2 MFP_CFG_OUT(GPIO116, AF2, DRIVE_LOW)
401#define GPIO14_UCLK MFP_CFG_OUT(GPIO14, AF3, DRIVE_LOW)
402#define GPIO91_UCLK MFP_CFG_OUT(GPIO91, AF2, DRIVE_LOW)
403#define GPIO19_nURST MFP_CFG_OUT(GPIO19, AF3, DRIVE_LOW)
404#define GPIO90_nURST MFP_CFG_OUT(GPIO90, AF2, DRIVE_LOW)
405#define GPIO116_UDET MFP_CFG_IN(GPIO116, AF3)
406#define GPIO114_UEN MFP_CFG_OUT(GPIO114, AF1, DRIVE_LOW)
407#define GPIO115_UEN MFP_CFG_OUT(GPIO115, AF1, DRIVE_LOW)
408
409/* Mobile Scalable Link (MSL) Interface */
410#define GPIO81_BB_OB_DAT_0 MFP_CFG_OUT(GPIO81, AF2, DRIVE_LOW)
411#define GPIO48_BB_OB_DAT_1 MFP_CFG_OUT(GPIO48, AF1, DRIVE_LOW)
412#define GPIO50_BB_OB_DAT_2 MFP_CFG_OUT(GPIO50, AF1, DRIVE_LOW)
413#define GPIO51_BB_OB_DAT_3 MFP_CFG_OUT(GPIO51, AF1, DRIVE_LOW)
414#define GPIO52_BB_OB_CLK MFP_CFG_OUT(GPIO52, AF1, DRIVE_LOW)
415#define GPIO53_BB_OB_STB MFP_CFG_OUT(GPIO53, AF1, DRIVE_LOW)
416#define GPIO54_BB_OB_WAIT MFP_CFG_IN(GPIO54, AF2)
417#define GPIO82_BB_IB_DAT_0 MFP_CFG_IN(GPIO82, AF2)
418#define GPIO55_BB_IB_DAT_1 MFP_CFG_IN(GPIO55, AF2)
419#define GPIO56_BB_IB_DAT_2 MFP_CFG_IN(GPIO56, AF2)
420#define GPIO57_BB_IB_DAT_3 MFP_CFG_IN(GPIO57, AF2)
421#define GPIO83_BB_IB_CLK MFP_CFG_IN(GPIO83, AF2)
422#define GPIO84_BB_IB_STB MFP_CFG_IN(GPIO84, AF2)
423#define GPIO85_BB_IB_WAIT MFP_CFG_OUT(GPIO85, AF2, DRIVE_LOW)
424
425/* Memory Stick Host Controller */
426#define GPIO92_MSBS MFP_CFG_OUT(GPIO92, AF2, DRIVE_LOW)
427#define GPIO109_MSSDIO MFP_CFG_IN(GPIO109, AF2)
428#define GPIO112_nMSINS MFP_CFG_IN(GPIO112, AF2)
429#define GPIO32_MSSCLK MFP_CFG_OUT(GPIO32, AF1, DRIVE_LOW)
430
431extern int keypad_set_wake(unsigned int on);
432#endif /* __ASM_ARCH_MFP_PXA27X_H */
diff --git a/include/asm-arm/arch-pxa/mfp-pxa2xx.h b/include/asm-arm/arch-pxa/mfp-pxa2xx.h
new file mode 100644
index 000000000000..db8d890d237c
--- /dev/null
+++ b/include/asm-arm/arch-pxa/mfp-pxa2xx.h
@@ -0,0 +1,132 @@
1#ifndef __ASM_ARCH_MFP_PXA2XX_H
2#define __ASM_ARCH_MFP_PXA2XX_H
3
4#include <asm/arch/mfp.h>
5
6/*
7 * the following MFP_xxx bit definitions in mfp.h are re-used for pxa2xx:
8 *
9 * MFP_PIN(x)
10 * MFP_AFx
11 * MFP_LPM_DRIVE_{LOW, HIGH}
12 * MFP_LPM_EDGE_x
13 *
14 * other MFP_x bit definitions will be ignored
15 *
16 * and adds the below two bits specifically for pxa2xx:
17 *
18 * bit 23 - Input/Output (PXA2xx specific)
19 * bit 24 - Wakeup Enable(PXA2xx specific)
20 */
21
22#define MFP_DIR_IN (0x0 << 23)
23#define MFP_DIR_OUT (0x1 << 23)
24#define MFP_DIR_MASK (0x1 << 23)
25#define MFP_DIR(x) (((x) >> 23) & 0x1)
26
27#define MFP_LPM_CAN_WAKEUP (0x1 << 24)
28#define WAKEUP_ON_EDGE_RISE (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_RISE)
29#define WAKEUP_ON_EDGE_FALL (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_FALL)
30#define WAKEUP_ON_EDGE_BOTH (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_BOTH)
31
32/* specifically for enabling wakeup on keypad GPIOs */
33#define WAKEUP_ON_LEVEL_HIGH (MFP_LPM_CAN_WAKEUP)
34
35#define MFP_CFG_IN(pin, af) \
36 ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DIR_MASK)) |\
37 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_DIR_IN))
38
39/* NOTE: pins configured as output _must_ provide a low power state,
40 * and this state should help to minimize the power dissipation.
41 */
42#define MFP_CFG_OUT(pin, af, state) \
43 ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DIR_MASK | MFP_LPM_STATE_MASK)) |\
44 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_DIR_OUT | MFP_LPM_##state))
45
46/* Common configurations for pxa25x and pxa27x
47 *
48 * Note: pins configured as GPIO are always initialized to input
49 * so not to cause any side effect
50 */
51#define GPIO0_GPIO MFP_CFG_IN(GPIO0, AF0)
52#define GPIO1_GPIO MFP_CFG_IN(GPIO1, AF0)
53#define GPIO9_GPIO MFP_CFG_IN(GPIO9, AF0)
54#define GPIO10_GPIO MFP_CFG_IN(GPIO10, AF0)
55#define GPIO11_GPIO MFP_CFG_IN(GPIO11, AF0)
56#define GPIO12_GPIO MFP_CFG_IN(GPIO12, AF0)
57#define GPIO13_GPIO MFP_CFG_IN(GPIO13, AF0)
58#define GPIO14_GPIO MFP_CFG_IN(GPIO14, AF0)
59#define GPIO15_GPIO MFP_CFG_IN(GPIO15, AF0)
60#define GPIO16_GPIO MFP_CFG_IN(GPIO16, AF0)
61#define GPIO17_GPIO MFP_CFG_IN(GPIO17, AF0)
62#define GPIO18_GPIO MFP_CFG_IN(GPIO18, AF0)
63#define GPIO19_GPIO MFP_CFG_IN(GPIO19, AF0)
64#define GPIO20_GPIO MFP_CFG_IN(GPIO20, AF0)
65#define GPIO21_GPIO MFP_CFG_IN(GPIO21, AF0)
66#define GPIO22_GPIO MFP_CFG_IN(GPIO22, AF0)
67#define GPIO23_GPIO MFP_CFG_IN(GPIO23, AF0)
68#define GPIO24_GPIO MFP_CFG_IN(GPIO24, AF0)
69#define GPIO25_GPIO MFP_CFG_IN(GPIO25, AF0)
70#define GPIO26_GPIO MFP_CFG_IN(GPIO26, AF0)
71#define GPIO27_GPIO MFP_CFG_IN(GPIO27, AF0)
72#define GPIO28_GPIO MFP_CFG_IN(GPIO28, AF0)
73#define GPIO29_GPIO MFP_CFG_IN(GPIO29, AF0)
74#define GPIO30_GPIO MFP_CFG_IN(GPIO30, AF0)
75#define GPIO31_GPIO MFP_CFG_IN(GPIO31, AF0)
76#define GPIO32_GPIO MFP_CFG_IN(GPIO32, AF0)
77#define GPIO33_GPIO MFP_CFG_IN(GPIO33, AF0)
78#define GPIO34_GPIO MFP_CFG_IN(GPIO34, AF0)
79#define GPIO35_GPIO MFP_CFG_IN(GPIO35, AF0)
80#define GPIO36_GPIO MFP_CFG_IN(GPIO36, AF0)
81#define GPIO37_GPIO MFP_CFG_IN(GPIO37, AF0)
82#define GPIO38_GPIO MFP_CFG_IN(GPIO38, AF0)
83#define GPIO39_GPIO MFP_CFG_IN(GPIO39, AF0)
84#define GPIO40_GPIO MFP_CFG_IN(GPIO40, AF0)
85#define GPIO41_GPIO MFP_CFG_IN(GPIO41, AF0)
86#define GPIO42_GPIO MFP_CFG_IN(GPIO42, AF0)
87#define GPIO43_GPIO MFP_CFG_IN(GPIO43, AF0)
88#define GPIO44_GPIO MFP_CFG_IN(GPIO44, AF0)
89#define GPIO45_GPIO MFP_CFG_IN(GPIO45, AF0)
90#define GPIO46_GPIO MFP_CFG_IN(GPIO46, AF0)
91#define GPIO47_GPIO MFP_CFG_IN(GPIO47, AF0)
92#define GPIO48_GPIO MFP_CFG_IN(GPIO48, AF0)
93#define GPIO49_GPIO MFP_CFG_IN(GPIO49, AF0)
94#define GPIO50_GPIO MFP_CFG_IN(GPIO50, AF0)
95#define GPIO51_GPIO MFP_CFG_IN(GPIO51, AF0)
96#define GPIO52_GPIO MFP_CFG_IN(GPIO52, AF0)
97#define GPIO53_GPIO MFP_CFG_IN(GPIO53, AF0)
98#define GPIO54_GPIO MFP_CFG_IN(GPIO54, AF0)
99#define GPIO55_GPIO MFP_CFG_IN(GPIO55, AF0)
100#define GPIO56_GPIO MFP_CFG_IN(GPIO56, AF0)
101#define GPIO57_GPIO MFP_CFG_IN(GPIO57, AF0)
102#define GPIO58_GPIO MFP_CFG_IN(GPIO58, AF0)
103#define GPIO59_GPIO MFP_CFG_IN(GPIO59, AF0)
104#define GPIO60_GPIO MFP_CFG_IN(GPIO60, AF0)
105#define GPIO61_GPIO MFP_CFG_IN(GPIO61, AF0)
106#define GPIO62_GPIO MFP_CFG_IN(GPIO62, AF0)
107#define GPIO63_GPIO MFP_CFG_IN(GPIO63, AF0)
108#define GPIO64_GPIO MFP_CFG_IN(GPIO64, AF0)
109#define GPIO65_GPIO MFP_CFG_IN(GPIO65, AF0)
110#define GPIO66_GPIO MFP_CFG_IN(GPIO66, AF0)
111#define GPIO67_GPIO MFP_CFG_IN(GPIO67, AF0)
112#define GPIO68_GPIO MFP_CFG_IN(GPIO68, AF0)
113#define GPIO69_GPIO MFP_CFG_IN(GPIO69, AF0)
114#define GPIO70_GPIO MFP_CFG_IN(GPIO70, AF0)
115#define GPIO71_GPIO MFP_CFG_IN(GPIO71, AF0)
116#define GPIO72_GPIO MFP_CFG_IN(GPIO72, AF0)
117#define GPIO73_GPIO MFP_CFG_IN(GPIO73, AF0)
118#define GPIO74_GPIO MFP_CFG_IN(GPIO74, AF0)
119#define GPIO75_GPIO MFP_CFG_IN(GPIO75, AF0)
120#define GPIO76_GPIO MFP_CFG_IN(GPIO76, AF0)
121#define GPIO77_GPIO MFP_CFG_IN(GPIO77, AF0)
122#define GPIO78_GPIO MFP_CFG_IN(GPIO78, AF0)
123#define GPIO79_GPIO MFP_CFG_IN(GPIO79, AF0)
124#define GPIO80_GPIO MFP_CFG_IN(GPIO80, AF0)
125#define GPIO81_GPIO MFP_CFG_IN(GPIO81, AF0)
126#define GPIO82_GPIO MFP_CFG_IN(GPIO82, AF0)
127#define GPIO83_GPIO MFP_CFG_IN(GPIO83, AF0)
128#define GPIO84_GPIO MFP_CFG_IN(GPIO84, AF0)
129
130extern void pxa2xx_mfp_config(unsigned long *mfp_cfgs, int num);
131extern int gpio_set_wake(unsigned int gpio, unsigned int on);
132#endif /* __ASM_ARCH_MFP_PXA2XX_H */
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index 2357a73340d4..a322012f16ac 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -1129,6 +1129,11 @@
1129#define ICPR __REG(0x40D00010) /* Interrupt Controller Pending Register */ 1129#define ICPR __REG(0x40D00010) /* Interrupt Controller Pending Register */
1130#define ICCR __REG(0x40D00014) /* Interrupt Controller Control Register */ 1130#define ICCR __REG(0x40D00014) /* Interrupt Controller Control Register */
1131 1131
1132#define ICIP2 __REG(0x40D0009C) /* Interrupt Controller IRQ Pending Register 2 */
1133#define ICMR2 __REG(0x40D000A0) /* Interrupt Controller Mask Register 2 */
1134#define ICLR2 __REG(0x40D000A4) /* Interrupt Controller Level Register 2 */
1135#define ICFP2 __REG(0x40D000A8) /* Interrupt Controller FIQ Pending Register 2 */
1136#define ICPR2 __REG(0x40D000AC) /* Interrupt Controller Pending Register 2 */
1132 1137
1133/* 1138/*
1134 * General Purpose I/O 1139 * General Purpose I/O
@@ -1200,12 +1205,6 @@
1200 1205
1201/* Interrupt Controller */ 1206/* Interrupt Controller */
1202 1207
1203#define ICIP2 __REG(0x40D0009C) /* Interrupt Controller IRQ Pending Register 2 */
1204#define ICMR2 __REG(0x40D000A0) /* Interrupt Controller Mask Register 2 */
1205#define ICLR2 __REG(0x40D000A4) /* Interrupt Controller Level Register 2 */
1206#define ICFP2 __REG(0x40D000A8) /* Interrupt Controller FIQ Pending Register 2 */
1207#define ICPR2 __REG(0x40D000AC) /* Interrupt Controller Pending Register 2 */
1208
1209#define _GPLR(x) __REG2(0x40E00000, ((x) & 0x60) >> 3) 1208#define _GPLR(x) __REG2(0x40E00000, ((x) & 0x60) >> 3)
1210#define _GPDR(x) __REG2(0x40E0000C, ((x) & 0x60) >> 3) 1209#define _GPDR(x) __REG2(0x40E0000C, ((x) & 0x60) >> 3)
1211#define _GPSR(x) __REG2(0x40E00018, ((x) & 0x60) >> 3) 1210#define _GPSR(x) __REG2(0x40E00018, ((x) & 0x60) >> 3)
@@ -1237,267 +1236,6 @@
1237 1236
1238#endif 1237#endif
1239 1238
1240
1241/* GPIO alternate function assignments */
1242
1243#define GPIO1_RST 1 /* reset */
1244#define GPIO6_MMCCLK 6 /* MMC Clock */
1245#define GPIO7_48MHz 7 /* 48 MHz clock output */
1246#define GPIO8_MMCCS0 8 /* MMC Chip Select 0 */
1247#define GPIO9_MMCCS1 9 /* MMC Chip Select 1 */
1248#define GPIO10_RTCCLK 10 /* real time clock (1 Hz) */
1249#define GPIO11_3_6MHz 11 /* 3.6 MHz oscillator out */
1250#define GPIO12_32KHz 12 /* 32 kHz out */
1251#define GPIO13_MBGNT 13 /* memory controller grant */
1252#define GPIO14_MBREQ 14 /* alternate bus master request */
1253#define GPIO15_nCS_1 15 /* chip select 1 */
1254#define GPIO16_PWM0 16 /* PWM0 output */
1255#define GPIO17_PWM1 17 /* PWM1 output */
1256#define GPIO18_RDY 18 /* Ext. Bus Ready */
1257#define GPIO19_DREQ1 19 /* External DMA Request */
1258#define GPIO20_DREQ0 20 /* External DMA Request */
1259#define GPIO23_SCLK 23 /* SSP clock */
1260#define GPIO24_SFRM 24 /* SSP Frame */
1261#define GPIO25_STXD 25 /* SSP transmit */
1262#define GPIO26_SRXD 26 /* SSP receive */
1263#define GPIO27_SEXTCLK 27 /* SSP ext_clk */
1264#define GPIO28_BITCLK 28 /* AC97/I2S bit_clk */
1265#define GPIO29_SDATA_IN 29 /* AC97 Sdata_in0 / I2S Sdata_in */
1266#define GPIO30_SDATA_OUT 30 /* AC97/I2S Sdata_out */
1267#define GPIO31_SYNC 31 /* AC97/I2S sync */
1268#define GPIO32_SDATA_IN1 32 /* AC97 Sdata_in1 */
1269#define GPIO32_SYSCLK 32 /* I2S System Clock */
1270#define GPIO32_MMCCLK 32 /* MMC Clock (PXA270) */
1271#define GPIO33_nCS_5 33 /* chip select 5 */
1272#define GPIO34_FFRXD 34 /* FFUART receive */
1273#define GPIO34_MMCCS0 34 /* MMC Chip Select 0 */
1274#define GPIO35_FFCTS 35 /* FFUART Clear to send */
1275#define GPIO36_FFDCD 36 /* FFUART Data carrier detect */
1276#define GPIO37_FFDSR 37 /* FFUART data set ready */
1277#define GPIO38_FFRI 38 /* FFUART Ring Indicator */
1278#define GPIO39_MMCCS1 39 /* MMC Chip Select 1 */
1279#define GPIO39_FFTXD 39 /* FFUART transmit data */
1280#define GPIO40_FFDTR 40 /* FFUART data terminal Ready */
1281#define GPIO41_FFRTS 41 /* FFUART request to send */
1282#define GPIO42_BTRXD 42 /* BTUART receive data */
1283#define GPIO42_HWRXD 42 /* HWUART receive data */
1284#define GPIO43_BTTXD 43 /* BTUART transmit data */
1285#define GPIO43_HWTXD 43 /* HWUART transmit data */
1286#define GPIO44_BTCTS 44 /* BTUART clear to send */
1287#define GPIO44_HWCTS 44 /* HWUART clear to send */
1288#define GPIO45_BTRTS 45 /* BTUART request to send */
1289#define GPIO45_HWRTS 45 /* HWUART request to send */
1290#define GPIO45_AC97_SYSCLK 45 /* AC97 System Clock */
1291#define GPIO46_ICPRXD 46 /* ICP receive data */
1292#define GPIO46_STRXD 46 /* STD_UART receive data */
1293#define GPIO47_ICPTXD 47 /* ICP transmit data */
1294#define GPIO47_STTXD 47 /* STD_UART transmit data */
1295#define GPIO48_nPOE 48 /* Output Enable for Card Space */
1296#define GPIO49_nPWE 49 /* Write Enable for Card Space */
1297#define GPIO50_nPIOR 50 /* I/O Read for Card Space */
1298#define GPIO51_nPIOW 51 /* I/O Write for Card Space */
1299#define GPIO52_nPCE_1 52 /* Card Enable for Card Space */
1300#define GPIO53_nPCE_2 53 /* Card Enable for Card Space */
1301#define GPIO53_MMCCLK 53 /* MMC Clock */
1302#define GPIO54_MMCCLK 54 /* MMC Clock */
1303#define GPIO54_pSKTSEL 54 /* Socket Select for Card Space */
1304#define GPIO54_nPCE_2 54 /* Card Enable for Card Space (PXA27x) */
1305#define GPIO55_nPREG 55 /* Card Address bit 26 */
1306#define GPIO56_nPWAIT 56 /* Wait signal for Card Space */
1307#define GPIO57_nIOIS16 57 /* Bus Width select for I/O Card Space */
1308#define GPIO58_LDD_0 58 /* LCD data pin 0 */
1309#define GPIO59_LDD_1 59 /* LCD data pin 1 */
1310#define GPIO60_LDD_2 60 /* LCD data pin 2 */
1311#define GPIO61_LDD_3 61 /* LCD data pin 3 */
1312#define GPIO62_LDD_4 62 /* LCD data pin 4 */
1313#define GPIO63_LDD_5 63 /* LCD data pin 5 */
1314#define GPIO64_LDD_6 64 /* LCD data pin 6 */
1315#define GPIO65_LDD_7 65 /* LCD data pin 7 */
1316#define GPIO66_LDD_8 66 /* LCD data pin 8 */
1317#define GPIO66_MBREQ 66 /* alternate bus master req */
1318#define GPIO67_LDD_9 67 /* LCD data pin 9 */
1319#define GPIO67_MMCCS0 67 /* MMC Chip Select 0 */
1320#define GPIO68_LDD_10 68 /* LCD data pin 10 */
1321#define GPIO68_MMCCS1 68 /* MMC Chip Select 1 */
1322#define GPIO69_LDD_11 69 /* LCD data pin 11 */
1323#define GPIO69_MMCCLK 69 /* MMC_CLK */
1324#define GPIO70_LDD_12 70 /* LCD data pin 12 */
1325#define GPIO70_RTCCLK 70 /* Real Time clock (1 Hz) */
1326#define GPIO71_LDD_13 71 /* LCD data pin 13 */
1327#define GPIO71_3_6MHz 71 /* 3.6 MHz Oscillator clock */
1328#define GPIO72_LDD_14 72 /* LCD data pin 14 */
1329#define GPIO72_32kHz 72 /* 32 kHz clock */
1330#define GPIO73_LDD_15 73 /* LCD data pin 15 */
1331#define GPIO73_MBGNT 73 /* Memory controller grant */
1332#define GPIO74_LCD_FCLK 74 /* LCD Frame clock */
1333#define GPIO75_LCD_LCLK 75 /* LCD line clock */
1334#define GPIO76_LCD_PCLK 76 /* LCD Pixel clock */
1335#define GPIO77_LCD_ACBIAS 77 /* LCD AC Bias */
1336#define GPIO78_nCS_2 78 /* chip select 2 */
1337#define GPIO79_nCS_3 79 /* chip select 3 */
1338#define GPIO80_nCS_4 80 /* chip select 4 */
1339#define GPIO81_NSCLK 81 /* NSSP clock */
1340#define GPIO82_NSFRM 82 /* NSSP Frame */
1341#define GPIO83_NSTXD 83 /* NSSP transmit */
1342#define GPIO84_NSRXD 84 /* NSSP receive */
1343#define GPIO85_nPCE_1 85 /* Card Enable for Card Space (PXA27x) */
1344#define GPIO92_MMCDAT0 92 /* MMC DAT0 (PXA27x) */
1345#define GPIO102_nPCE_1 102 /* PCMCIA (PXA27x) */
1346#define GPIO109_MMCDAT1 109 /* MMC DAT1 (PXA27x) */
1347#define GPIO110_MMCDAT2 110 /* MMC DAT2 (PXA27x) */
1348#define GPIO110_MMCCS0 110 /* MMC Chip Select 0 (PXA27x) */
1349#define GPIO111_MMCDAT3 111 /* MMC DAT3 (PXA27x) */
1350#define GPIO111_MMCCS1 111 /* MMC Chip Select 1 (PXA27x) */
1351#define GPIO112_MMCCMD 112 /* MMC CMD (PXA27x) */
1352#define GPIO113_I2S_SYSCLK 113 /* I2S System Clock (PXA27x) */
1353#define GPIO113_AC97_RESET_N 113 /* AC97 NRESET on (PXA27x) */
1354
1355/* GPIO alternate function mode & direction */
1356
1357#define GPIO_IN 0x000
1358#define GPIO_OUT 0x080
1359#define GPIO_ALT_FN_1_IN 0x100
1360#define GPIO_ALT_FN_1_OUT 0x180
1361#define GPIO_ALT_FN_2_IN 0x200
1362#define GPIO_ALT_FN_2_OUT 0x280
1363#define GPIO_ALT_FN_3_IN 0x300
1364#define GPIO_ALT_FN_3_OUT 0x380
1365#define GPIO_MD_MASK_NR 0x07f
1366#define GPIO_MD_MASK_DIR 0x080
1367#define GPIO_MD_MASK_FN 0x300
1368#define GPIO_DFLT_LOW 0x400
1369#define GPIO_DFLT_HIGH 0x800
1370
1371#define GPIO1_RTS_MD ( 1 | GPIO_ALT_FN_1_IN)
1372#define GPIO6_MMCCLK_MD ( 6 | GPIO_ALT_FN_1_OUT)
1373#define GPIO7_48MHz_MD ( 7 | GPIO_ALT_FN_1_OUT)
1374#define GPIO8_MMCCS0_MD ( 8 | GPIO_ALT_FN_1_OUT)
1375#define GPIO9_MMCCS1_MD ( 9 | GPIO_ALT_FN_1_OUT)
1376#define GPIO10_RTCCLK_MD (10 | GPIO_ALT_FN_1_OUT)
1377#define GPIO11_3_6MHz_MD (11 | GPIO_ALT_FN_1_OUT)
1378#define GPIO12_32KHz_MD (12 | GPIO_ALT_FN_1_OUT)
1379#define GPIO13_MBGNT_MD (13 | GPIO_ALT_FN_2_OUT)
1380#define GPIO14_MBREQ_MD (14 | GPIO_ALT_FN_1_IN)
1381#define GPIO15_nCS_1_MD (15 | GPIO_ALT_FN_2_OUT)
1382#define GPIO16_PWM0_MD (16 | GPIO_ALT_FN_2_OUT)
1383#define GPIO17_PWM1_MD (17 | GPIO_ALT_FN_2_OUT)
1384#define GPIO18_RDY_MD (18 | GPIO_ALT_FN_1_IN)
1385#define GPIO19_DREQ1_MD (19 | GPIO_ALT_FN_1_IN)
1386#define GPIO20_DREQ0_MD (20 | GPIO_ALT_FN_1_IN)
1387#define GPIO23_SCLK_MD (23 | GPIO_ALT_FN_2_OUT)
1388#define GPIO24_SFRM_MD (24 | GPIO_ALT_FN_2_OUT)
1389#define GPIO25_STXD_MD (25 | GPIO_ALT_FN_2_OUT)
1390#define GPIO26_SRXD_MD (26 | GPIO_ALT_FN_1_IN)
1391#define GPIO27_SEXTCLK_MD (27 | GPIO_ALT_FN_1_IN)
1392#define GPIO28_BITCLK_AC97_MD (28 | GPIO_ALT_FN_1_IN)
1393#define GPIO28_BITCLK_IN_I2S_MD (28 | GPIO_ALT_FN_2_IN)
1394#define GPIO28_BITCLK_OUT_I2S_MD (28 | GPIO_ALT_FN_1_OUT)
1395#define GPIO29_SDATA_IN_AC97_MD (29 | GPIO_ALT_FN_1_IN)
1396#define GPIO29_SDATA_IN_I2S_MD (29 | GPIO_ALT_FN_2_IN)
1397#define GPIO30_SDATA_OUT_AC97_MD (30 | GPIO_ALT_FN_2_OUT)
1398#define GPIO30_SDATA_OUT_I2S_MD (30 | GPIO_ALT_FN_1_OUT)
1399#define GPIO31_SYNC_I2S_MD (31 | GPIO_ALT_FN_1_OUT)
1400#define GPIO31_SYNC_AC97_MD (31 | GPIO_ALT_FN_2_OUT)
1401#define GPIO32_SDATA_IN1_AC97_MD (32 | GPIO_ALT_FN_1_IN)
1402#define GPIO32_SYSCLK_I2S_MD (32 | GPIO_ALT_FN_1_OUT)
1403#define GPIO32_MMCCLK_MD ( 32 | GPIO_ALT_FN_2_OUT)
1404#define GPIO33_nCS_5_MD (33 | GPIO_ALT_FN_2_OUT)
1405#define GPIO34_FFRXD_MD (34 | GPIO_ALT_FN_1_IN)
1406#define GPIO34_MMCCS0_MD (34 | GPIO_ALT_FN_2_OUT)
1407#define GPIO35_FFCTS_MD (35 | GPIO_ALT_FN_1_IN)
1408#define GPIO36_FFDCD_MD (36 | GPIO_ALT_FN_1_IN)
1409#define GPIO37_FFDSR_MD (37 | GPIO_ALT_FN_1_IN)
1410#define GPIO38_FFRI_MD (38 | GPIO_ALT_FN_1_IN)
1411#define GPIO39_MMCCS1_MD (39 | GPIO_ALT_FN_1_OUT)
1412#define GPIO39_FFTXD_MD (39 | GPIO_ALT_FN_2_OUT)
1413#define GPIO40_FFDTR_MD (40 | GPIO_ALT_FN_2_OUT)
1414#define GPIO41_FFRTS_MD (41 | GPIO_ALT_FN_2_OUT)
1415#define GPIO42_BTRXD_MD (42 | GPIO_ALT_FN_1_IN)
1416#define GPIO42_HWRXD_MD (42 | GPIO_ALT_FN_3_IN)
1417#define GPIO43_BTTXD_MD (43 | GPIO_ALT_FN_2_OUT)
1418#define GPIO43_HWTXD_MD (43 | GPIO_ALT_FN_3_OUT)
1419#define GPIO44_BTCTS_MD (44 | GPIO_ALT_FN_1_IN)
1420#define GPIO44_HWCTS_MD (44 | GPIO_ALT_FN_3_IN)
1421#define GPIO45_BTRTS_MD (45 | GPIO_ALT_FN_2_OUT)
1422#define GPIO45_HWRTS_MD (45 | GPIO_ALT_FN_3_OUT)
1423#define GPIO45_SYSCLK_AC97_MD (45 | GPIO_ALT_FN_1_OUT)
1424#define GPIO46_ICPRXD_MD (46 | GPIO_ALT_FN_1_IN)
1425#define GPIO46_STRXD_MD (46 | GPIO_ALT_FN_2_IN)
1426#define GPIO47_ICPTXD_MD (47 | GPIO_ALT_FN_2_OUT)
1427#define GPIO47_STTXD_MD (47 | GPIO_ALT_FN_1_OUT)
1428#define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT)
1429#define GPIO48_HWTXD_MD (48 | GPIO_ALT_FN_1_OUT)
1430#define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT)
1431#define GPIO49_HWRXD_MD (49 | GPIO_ALT_FN_1_IN)
1432#define GPIO49_nPWE_MD (49 | GPIO_ALT_FN_2_OUT)
1433#define GPIO50_nPIOR_MD (50 | GPIO_ALT_FN_2_OUT)
1434#define GPIO50_HWCTS_MD (50 | GPIO_ALT_FN_1_IN)
1435#define GPIO51_HWRTS_MD (51 | GPIO_ALT_FN_1_OUT)
1436#define GPIO51_nPIOW_MD (51 | GPIO_ALT_FN_2_OUT)
1437#define GPIO52_nPCE_1_MD (52 | GPIO_ALT_FN_2_OUT)
1438#define GPIO53_nPCE_2_MD (53 | GPIO_ALT_FN_2_OUT)
1439#define GPIO53_MMCCLK_MD (53 | GPIO_ALT_FN_1_OUT)
1440#define GPIO54_MMCCLK_MD (54 | GPIO_ALT_FN_1_OUT)
1441#define GPIO54_nPCE_2_MD (54 | GPIO_ALT_FN_2_OUT)
1442#define GPIO54_pSKTSEL_MD (54 | GPIO_ALT_FN_2_OUT)
1443#define GPIO55_nPREG_MD (55 | GPIO_ALT_FN_2_OUT)
1444#define GPIO56_nPWAIT_MD (56 | GPIO_ALT_FN_1_IN)
1445#define GPIO57_nIOIS16_MD (57 | GPIO_ALT_FN_1_IN)
1446#define GPIO58_LDD_0_MD (58 | GPIO_ALT_FN_2_OUT)
1447#define GPIO59_LDD_1_MD (59 | GPIO_ALT_FN_2_OUT)
1448#define GPIO60_LDD_2_MD (60 | GPIO_ALT_FN_2_OUT)
1449#define GPIO61_LDD_3_MD (61 | GPIO_ALT_FN_2_OUT)
1450#define GPIO62_LDD_4_MD (62 | GPIO_ALT_FN_2_OUT)
1451#define GPIO63_LDD_5_MD (63 | GPIO_ALT_FN_2_OUT)
1452#define GPIO64_LDD_6_MD (64 | GPIO_ALT_FN_2_OUT)
1453#define GPIO65_LDD_7_MD (65 | GPIO_ALT_FN_2_OUT)
1454#define GPIO66_LDD_8_MD (66 | GPIO_ALT_FN_2_OUT)
1455#define GPIO66_MBREQ_MD (66 | GPIO_ALT_FN_1_IN)
1456#define GPIO67_LDD_9_MD (67 | GPIO_ALT_FN_2_OUT)
1457#define GPIO67_MMCCS0_MD (67 | GPIO_ALT_FN_1_OUT)
1458#define GPIO68_LDD_10_MD (68 | GPIO_ALT_FN_2_OUT)
1459#define GPIO68_MMCCS1_MD (68 | GPIO_ALT_FN_1_OUT)
1460#define GPIO69_LDD_11_MD (69 | GPIO_ALT_FN_2_OUT)
1461#define GPIO69_MMCCLK_MD (69 | GPIO_ALT_FN_1_OUT)
1462#define GPIO70_LDD_12_MD (70 | GPIO_ALT_FN_2_OUT)
1463#define GPIO70_RTCCLK_MD (70 | GPIO_ALT_FN_1_OUT)
1464#define GPIO71_LDD_13_MD (71 | GPIO_ALT_FN_2_OUT)
1465#define GPIO71_3_6MHz_MD (71 | GPIO_ALT_FN_1_OUT)
1466#define GPIO72_LDD_14_MD (72 | GPIO_ALT_FN_2_OUT)
1467#define GPIO72_32kHz_MD (72 | GPIO_ALT_FN_1_OUT)
1468#define GPIO73_LDD_15_MD (73 | GPIO_ALT_FN_2_OUT)
1469#define GPIO73_MBGNT_MD (73 | GPIO_ALT_FN_1_OUT)
1470#define GPIO74_LCD_FCLK_MD (74 | GPIO_ALT_FN_2_OUT)
1471#define GPIO75_LCD_LCLK_MD (75 | GPIO_ALT_FN_2_OUT)
1472#define GPIO76_LCD_PCLK_MD (76 | GPIO_ALT_FN_2_OUT)
1473#define GPIO77_LCD_ACBIAS_MD (77 | GPIO_ALT_FN_2_OUT)
1474#define GPIO78_nCS_2_MD (78 | GPIO_ALT_FN_2_OUT)
1475#define GPIO79_nCS_3_MD (79 | GPIO_ALT_FN_2_OUT)
1476#define GPIO79_pSKTSEL_MD (79 | GPIO_ALT_FN_1_OUT)
1477#define GPIO80_nCS_4_MD (80 | GPIO_ALT_FN_2_OUT)
1478#define GPIO81_NSSP_CLK_OUT (81 | GPIO_ALT_FN_1_OUT)
1479#define GPIO81_NSSP_CLK_IN (81 | GPIO_ALT_FN_1_IN)
1480#define GPIO82_NSSP_FRM_OUT (82 | GPIO_ALT_FN_1_OUT)
1481#define GPIO82_NSSP_FRM_IN (82 | GPIO_ALT_FN_1_IN)
1482#define GPIO83_NSSP_TX (83 | GPIO_ALT_FN_1_OUT)
1483#define GPIO83_NSSP_RX (83 | GPIO_ALT_FN_2_IN)
1484#define GPIO84_NSSP_TX (84 | GPIO_ALT_FN_1_OUT)
1485#define GPIO84_NSSP_RX (84 | GPIO_ALT_FN_2_IN)
1486#define GPIO85_nPCE_1_MD (85 | GPIO_ALT_FN_1_OUT)
1487#define GPIO92_MMCDAT0_MD (92 | GPIO_ALT_FN_1_OUT)
1488#define GPIO102_nPCE_1_MD (102 | GPIO_ALT_FN_1_OUT)
1489#define GPIO104_pSKTSEL_MD (104 | GPIO_ALT_FN_1_OUT)
1490#define GPIO109_MMCDAT1_MD (109 | GPIO_ALT_FN_1_OUT)
1491#define GPIO110_MMCDAT2_MD (110 | GPIO_ALT_FN_1_OUT)
1492#define GPIO110_MMCCS0_MD (110 | GPIO_ALT_FN_1_OUT)
1493#define GPIO111_MMCDAT3_MD (111 | GPIO_ALT_FN_1_OUT)
1494#define GPIO110_MMCCS1_MD (111 | GPIO_ALT_FN_1_OUT)
1495#define GPIO112_MMCCMD_MD (112 | GPIO_ALT_FN_1_OUT)
1496#define GPIO113_I2S_SYSCLK_MD (113 | GPIO_ALT_FN_1_OUT)
1497#define GPIO113_AC97_RESET_N_MD (113 | GPIO_ALT_FN_2_OUT)
1498#define GPIO117_I2CSCL_MD (117 | GPIO_ALT_FN_1_IN)
1499#define GPIO118_I2CSDA_MD (118 | GPIO_ALT_FN_1_IN)
1500
1501/* 1239/*
1502 * Power Manager 1240 * Power Manager
1503 */ 1241 */
@@ -1866,62 +1604,6 @@
1866 1604
1867#ifdef CONFIG_PXA27x 1605#ifdef CONFIG_PXA27x
1868 1606
1869/*
1870 * Keypad
1871 */
1872#define KPC __REG(0x41500000) /* Keypad Interface Control register */
1873#define KPDK __REG(0x41500008) /* Keypad Interface Direct Key register */
1874#define KPREC __REG(0x41500010) /* Keypad Interface Rotary Encoder register */
1875#define KPMK __REG(0x41500018) /* Keypad Interface Matrix Key register */
1876#define KPAS __REG(0x41500020) /* Keypad Interface Automatic Scan register */
1877#define KPASMKP0 __REG(0x41500028) /* Keypad Interface Automatic Scan Multiple Key Presser register 0 */
1878#define KPASMKP1 __REG(0x41500030) /* Keypad Interface Automatic Scan Multiple Key Presser register 1 */
1879#define KPASMKP2 __REG(0x41500038) /* Keypad Interface Automatic Scan Multiple Key Presser register 2 */
1880#define KPASMKP3 __REG(0x41500040) /* Keypad Interface Automatic Scan Multiple Key Presser register 3 */
1881#define KPKDI __REG(0x41500048) /* Keypad Interface Key Debounce Interval register */
1882
1883#define KPC_AS (0x1 << 30) /* Automatic Scan bit */
1884#define KPC_ASACT (0x1 << 29) /* Automatic Scan on Activity */
1885#define KPC_MI (0x1 << 22) /* Matrix interrupt bit */
1886#define KPC_IMKP (0x1 << 21) /* Ignore Multiple Key Press */
1887#define KPC_MS7 (0x1 << 20) /* Matrix scan line 7 */
1888#define KPC_MS6 (0x1 << 19) /* Matrix scan line 6 */
1889#define KPC_MS5 (0x1 << 18) /* Matrix scan line 5 */
1890#define KPC_MS4 (0x1 << 17) /* Matrix scan line 4 */
1891#define KPC_MS3 (0x1 << 16) /* Matrix scan line 3 */
1892#define KPC_MS2 (0x1 << 15) /* Matrix scan line 2 */
1893#define KPC_MS1 (0x1 << 14) /* Matrix scan line 1 */
1894#define KPC_MS0 (0x1 << 13) /* Matrix scan line 0 */
1895#define KPC_MS_ALL (KPC_MS0 | KPC_MS1 | KPC_MS2 | KPC_MS3 | KPC_MS4 | KPC_MS5 | KPC_MS6 | KPC_MS7)
1896#define KPC_ME (0x1 << 12) /* Matrix Keypad Enable */
1897#define KPC_MIE (0x1 << 11) /* Matrix Interrupt Enable */
1898#define KPC_DK_DEB_SEL (0x1 << 9) /* Direct Keypad Debounce Select */
1899#define KPC_DI (0x1 << 5) /* Direct key interrupt bit */
1900#define KPC_RE_ZERO_DEB (0x1 << 4) /* Rotary Encoder Zero Debounce */
1901#define KPC_REE1 (0x1 << 3) /* Rotary Encoder1 Enable */
1902#define KPC_REE0 (0x1 << 2) /* Rotary Encoder0 Enable */
1903#define KPC_DE (0x1 << 1) /* Direct Keypad Enable */
1904#define KPC_DIE (0x1 << 0) /* Direct Keypad interrupt Enable */
1905
1906#define KPDK_DKP (0x1 << 31)
1907#define KPDK_DK7 (0x1 << 7)
1908#define KPDK_DK6 (0x1 << 6)
1909#define KPDK_DK5 (0x1 << 5)
1910#define KPDK_DK4 (0x1 << 4)
1911#define KPDK_DK3 (0x1 << 3)
1912#define KPDK_DK2 (0x1 << 2)
1913#define KPDK_DK1 (0x1 << 1)
1914#define KPDK_DK0 (0x1 << 0)
1915
1916#define KPREC_OF1 (0x1 << 31)
1917#define kPREC_UF1 (0x1 << 30)
1918#define KPREC_OF0 (0x1 << 15)
1919#define KPREC_UF0 (0x1 << 14)
1920
1921#define KPMK_MKP (0x1 << 31)
1922#define KPAS_SO (0x1 << 31)
1923#define KPASMKPx_SO (0x1 << 31)
1924
1925/* Camera Interface */ 1607/* Camera Interface */
1926#define CICR0 __REG(0x50000000) 1608#define CICR0 __REG(0x50000000)
1927#define CICR1 __REG(0x50000004) 1609#define CICR1 __REG(0x50000004)
@@ -1953,7 +1635,7 @@
1953#define CICR0_FOM (1 << 0) /* FIFO-overrun mask */ 1635#define CICR0_FOM (1 << 0) /* FIFO-overrun mask */
1954 1636
1955#define CICR1_TBIT (1 << 31) /* Transparency bit */ 1637#define CICR1_TBIT (1 << 31) /* Transparency bit */
1956#define CICR1_RGBT_CONV (0x3 << 30) /* RGBT conversion mask */ 1638#define CICR1_RGBT_CONV (0x3 << 29) /* RGBT conversion mask */
1957#define CICR1_PPL (0x7ff << 15) /* Pixels per line mask */ 1639#define CICR1_PPL (0x7ff << 15) /* Pixels per line mask */
1958#define CICR1_RGB_CONV (0x7 << 12) /* RGB conversion mask */ 1640#define CICR1_RGB_CONV (0x7 << 12) /* RGB conversion mask */
1959#define CICR1_RGB_F (1 << 11) /* RGB format */ 1641#define CICR1_RGB_F (1 << 11) /* RGB format */
diff --git a/include/asm-arm/arch-pxa/pxa27x_keypad.h b/include/asm-arm/arch-pxa/pxa27x_keypad.h
index 644f7609b523..d5a48a96dea7 100644
--- a/include/asm-arm/arch-pxa/pxa27x_keypad.h
+++ b/include/asm-arm/arch-pxa/pxa27x_keypad.h
@@ -53,4 +53,6 @@ struct pxa27x_keypad_platform_data {
53 53
54#define KEY(row, col, val) (((row) << 28) | ((col) << 24) | (val)) 54#define KEY(row, col, val) (((row) << 28) | ((col) << 24) | (val))
55 55
56extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info);
57
56#endif /* __ASM_ARCH_PXA27x_KEYPAD_H */ 58#endif /* __ASM_ARCH_PXA27x_KEYPAD_H */
diff --git a/include/asm-arm/arch-pxa/pxa2xx-gpio.h b/include/asm-arm/arch-pxa/pxa2xx-gpio.h
new file mode 100644
index 000000000000..763313c5e6be
--- /dev/null
+++ b/include/asm-arm/arch-pxa/pxa2xx-gpio.h
@@ -0,0 +1,357 @@
1#ifndef __ASM_ARCH_PXA2XX_GPIO_H
2#define __ASM_ARCH_PXA2XX_GPIO_H
3
4/* GPIO alternate function assignments */
5
6#define GPIO1_RST 1 /* reset */
7#define GPIO6_MMCCLK 6 /* MMC Clock */
8#define GPIO7_48MHz 7 /* 48 MHz clock output */
9#define GPIO8_MMCCS0 8 /* MMC Chip Select 0 */
10#define GPIO9_MMCCS1 9 /* MMC Chip Select 1 */
11#define GPIO10_RTCCLK 10 /* real time clock (1 Hz) */
12#define GPIO11_3_6MHz 11 /* 3.6 MHz oscillator out */
13#define GPIO12_32KHz 12 /* 32 kHz out */
14#define GPIO12_CIF_DD_7 12 /* Camera data pin 7 */
15#define GPIO13_MBGNT 13 /* memory controller grant */
16#define GPIO14_MBREQ 14 /* alternate bus master request */
17#define GPIO15_nCS_1 15 /* chip select 1 */
18#define GPIO16_PWM0 16 /* PWM0 output */
19#define GPIO17_PWM1 17 /* PWM1 output */
20#define GPIO17_CIF_DD_6 17 /* Camera data pin 6 */
21#define GPIO18_RDY 18 /* Ext. Bus Ready */
22#define GPIO19_DREQ1 19 /* External DMA Request */
23#define GPIO20_DREQ0 20 /* External DMA Request */
24#define GPIO23_SCLK 23 /* SSP clock */
25#define GPIO23_CIF_MCLK 23 /* Camera Master Clock */
26#define GPIO24_SFRM 24 /* SSP Frame */
27#define GPIO24_CIF_FV 24 /* Camera frame start signal */
28#define GPIO25_STXD 25 /* SSP transmit */
29#define GPIO25_CIF_LV 25 /* Camera line start signal */
30#define GPIO26_SRXD 26 /* SSP receive */
31#define GPIO26_CIF_PCLK 26 /* Camera Pixel Clock */
32#define GPIO27_SEXTCLK 27 /* SSP ext_clk */
33#define GPIO27_CIF_DD_0 27 /* Camera data pin 0 */
34#define GPIO28_BITCLK 28 /* AC97/I2S bit_clk */
35#define GPIO29_SDATA_IN 29 /* AC97 Sdata_in0 / I2S Sdata_in */
36#define GPIO30_SDATA_OUT 30 /* AC97/I2S Sdata_out */
37#define GPIO31_SYNC 31 /* AC97/I2S sync */
38#define GPIO32_SDATA_IN1 32 /* AC97 Sdata_in1 */
39#define GPIO32_SYSCLK 32 /* I2S System Clock */
40#define GPIO32_MMCCLK 32 /* MMC Clock (PXA270) */
41#define GPIO33_nCS_5 33 /* chip select 5 */
42#define GPIO34_FFRXD 34 /* FFUART receive */
43#define GPIO34_MMCCS0 34 /* MMC Chip Select 0 */
44#define GPIO35_FFCTS 35 /* FFUART Clear to send */
45#define GPIO36_FFDCD 36 /* FFUART Data carrier detect */
46#define GPIO37_FFDSR 37 /* FFUART data set ready */
47#define GPIO38_FFRI 38 /* FFUART Ring Indicator */
48#define GPIO39_MMCCS1 39 /* MMC Chip Select 1 */
49#define GPIO39_FFTXD 39 /* FFUART transmit data */
50#define GPIO40_FFDTR 40 /* FFUART data terminal Ready */
51#define GPIO41_FFRTS 41 /* FFUART request to send */
52#define GPIO42_BTRXD 42 /* BTUART receive data */
53#define GPIO42_HWRXD 42 /* HWUART receive data */
54#define GPIO42_CIF_MCLK 42 /* Camera Master Clock */
55#define GPIO43_BTTXD 43 /* BTUART transmit data */
56#define GPIO43_HWTXD 43 /* HWUART transmit data */
57#define GPIO43_CIF_FV 43 /* Camera frame start signal */
58#define GPIO44_BTCTS 44 /* BTUART clear to send */
59#define GPIO44_HWCTS 44 /* HWUART clear to send */
60#define GPIO44_CIF_LV 44 /* Camera line start signal */
61#define GPIO45_BTRTS 45 /* BTUART request to send */
62#define GPIO45_HWRTS 45 /* HWUART request to send */
63#define GPIO45_AC97_SYSCLK 45 /* AC97 System Clock */
64#define GPIO45_CIF_PCLK 45 /* Camera Pixel Clock */
65#define GPIO46_ICPRXD 46 /* ICP receive data */
66#define GPIO46_STRXD 46 /* STD_UART receive data */
67#define GPIO47_ICPTXD 47 /* ICP transmit data */
68#define GPIO47_STTXD 47 /* STD_UART transmit data */
69#define GPIO47_CIF_DD_0 47 /* Camera data pin 0 */
70#define GPIO48_nPOE 48 /* Output Enable for Card Space */
71#define GPIO48_CIF_DD_5 48 /* Camera data pin 5 */
72#define GPIO49_nPWE 49 /* Write Enable for Card Space */
73#define GPIO50_nPIOR 50 /* I/O Read for Card Space */
74#define GPIO50_CIF_DD_3 50 /* Camera data pin 3 */
75#define GPIO51_nPIOW 51 /* I/O Write for Card Space */
76#define GPIO51_CIF_DD_2 51 /* Camera data pin 2 */
77#define GPIO52_nPCE_1 52 /* Card Enable for Card Space */
78#define GPIO52_CIF_DD_4 52 /* Camera data pin 4 */
79#define GPIO53_nPCE_2 53 /* Card Enable for Card Space */
80#define GPIO53_MMCCLK 53 /* MMC Clock */
81#define GPIO53_CIF_MCLK 53 /* Camera Master Clock */
82#define GPIO54_MMCCLK 54 /* MMC Clock */
83#define GPIO54_pSKTSEL 54 /* Socket Select for Card Space */
84#define GPIO54_nPCE_2 54 /* Card Enable for Card Space (PXA27x) */
85#define GPIO54_CIF_PCLK 54 /* Camera Pixel Clock */
86#define GPIO55_nPREG 55 /* Card Address bit 26 */
87#define GPIO55_CIF_DD_1 55 /* Camera data pin 1 */
88#define GPIO56_nPWAIT 56 /* Wait signal for Card Space */
89#define GPIO57_nIOIS16 57 /* Bus Width select for I/O Card Space */
90#define GPIO58_LDD_0 58 /* LCD data pin 0 */
91#define GPIO59_LDD_1 59 /* LCD data pin 1 */
92#define GPIO60_LDD_2 60 /* LCD data pin 2 */
93#define GPIO61_LDD_3 61 /* LCD data pin 3 */
94#define GPIO62_LDD_4 62 /* LCD data pin 4 */
95#define GPIO63_LDD_5 63 /* LCD data pin 5 */
96#define GPIO64_LDD_6 64 /* LCD data pin 6 */
97#define GPIO65_LDD_7 65 /* LCD data pin 7 */
98#define GPIO66_LDD_8 66 /* LCD data pin 8 */
99#define GPIO66_MBREQ 66 /* alternate bus master req */
100#define GPIO67_LDD_9 67 /* LCD data pin 9 */
101#define GPIO67_MMCCS0 67 /* MMC Chip Select 0 */
102#define GPIO68_LDD_10 68 /* LCD data pin 10 */
103#define GPIO68_MMCCS1 68 /* MMC Chip Select 1 */
104#define GPIO69_LDD_11 69 /* LCD data pin 11 */
105#define GPIO69_MMCCLK 69 /* MMC_CLK */
106#define GPIO70_LDD_12 70 /* LCD data pin 12 */
107#define GPIO70_RTCCLK 70 /* Real Time clock (1 Hz) */
108#define GPIO71_LDD_13 71 /* LCD data pin 13 */
109#define GPIO71_3_6MHz 71 /* 3.6 MHz Oscillator clock */
110#define GPIO72_LDD_14 72 /* LCD data pin 14 */
111#define GPIO72_32kHz 72 /* 32 kHz clock */
112#define GPIO73_LDD_15 73 /* LCD data pin 15 */
113#define GPIO73_MBGNT 73 /* Memory controller grant */
114#define GPIO74_LCD_FCLK 74 /* LCD Frame clock */
115#define GPIO75_LCD_LCLK 75 /* LCD line clock */
116#define GPIO76_LCD_PCLK 76 /* LCD Pixel clock */
117#define GPIO77_LCD_ACBIAS 77 /* LCD AC Bias */
118#define GPIO78_nCS_2 78 /* chip select 2 */
119#define GPIO79_nCS_3 79 /* chip select 3 */
120#define GPIO80_nCS_4 80 /* chip select 4 */
121#define GPIO81_NSCLK 81 /* NSSP clock */
122#define GPIO81_CIF_DD_0 81 /* Camera data pin 0 */
123#define GPIO82_NSFRM 82 /* NSSP Frame */
124#define GPIO82_CIF_DD_5 82 /* Camera data pin 5 */
125#define GPIO83_NSTXD 83 /* NSSP transmit */
126#define GPIO83_CIF_DD_4 83 /* Camera data pin 4 */
127#define GPIO84_NSRXD 84 /* NSSP receive */
128#define GPIO84_CIF_FV 84 /* Camera frame start signal */
129#define GPIO85_nPCE_1 85 /* Card Enable for Card Space (PXA27x) */
130#define GPIO85_CIF_LV 85 /* Camera line start signal */
131#define GPIO90_CIF_DD_4 90 /* Camera data pin 4 */
132#define GPIO91_CIF_DD_5 91 /* Camera data pin 5 */
133#define GPIO92_MMCDAT0 92 /* MMC DAT0 (PXA27x) */
134#define GPIO93_CIF_DD_6 93 /* Camera data pin 6 */
135#define GPIO94_CIF_DD_5 94 /* Camera data pin 5 */
136#define GPIO95_CIF_DD_4 95 /* Camera data pin 4 */
137#define GPIO98_CIF_DD_0 98 /* Camera data pin 0 */
138#define GPIO102_nPCE_1 102 /* PCMCIA (PXA27x) */
139#define GPIO103_CIF_DD_3 103 /* Camera data pin 3 */
140#define GPIO104_CIF_DD_2 104 /* Camera data pin 2 */
141#define GPIO105_CIF_DD_1 105 /* Camera data pin 1 */
142#define GPIO106_CIF_DD_9 106 /* Camera data pin 9 */
143#define GPIO107_CIF_DD_8 107 /* Camera data pin 8 */
144#define GPIO108_CIF_DD_7 108 /* Camera data pin 7 */
145#define GPIO109_MMCDAT1 109 /* MMC DAT1 (PXA27x) */
146#define GPIO110_MMCDAT2 110 /* MMC DAT2 (PXA27x) */
147#define GPIO110_MMCCS0 110 /* MMC Chip Select 0 (PXA27x) */
148#define GPIO111_MMCDAT3 111 /* MMC DAT3 (PXA27x) */
149#define GPIO111_MMCCS1 111 /* MMC Chip Select 1 (PXA27x) */
150#define GPIO112_MMCCMD 112 /* MMC CMD (PXA27x) */
151#define GPIO113_I2S_SYSCLK 113 /* I2S System Clock (PXA27x) */
152#define GPIO113_AC97_RESET_N 113 /* AC97 NRESET on (PXA27x) */
153#define GPIO114_CIF_DD_1 114 /* Camera data pin 1 */
154#define GPIO115_CIF_DD_3 115 /* Camera data pin 3 */
155#define GPIO116_CIF_DD_2 116 /* Camera data pin 2 */
156
157/* GPIO alternate function mode & direction */
158
159#define GPIO_IN 0x000
160#define GPIO_OUT 0x080
161#define GPIO_ALT_FN_1_IN 0x100
162#define GPIO_ALT_FN_1_OUT 0x180
163#define GPIO_ALT_FN_2_IN 0x200
164#define GPIO_ALT_FN_2_OUT 0x280
165#define GPIO_ALT_FN_3_IN 0x300
166#define GPIO_ALT_FN_3_OUT 0x380
167#define GPIO_MD_MASK_NR 0x07f
168#define GPIO_MD_MASK_DIR 0x080
169#define GPIO_MD_MASK_FN 0x300
170#define GPIO_DFLT_LOW 0x400
171#define GPIO_DFLT_HIGH 0x800
172
173#define GPIO1_RTS_MD ( 1 | GPIO_ALT_FN_1_IN)
174#define GPIO6_MMCCLK_MD ( 6 | GPIO_ALT_FN_1_OUT)
175#define GPIO7_48MHz_MD ( 7 | GPIO_ALT_FN_1_OUT)
176#define GPIO8_MMCCS0_MD ( 8 | GPIO_ALT_FN_1_OUT)
177#define GPIO9_MMCCS1_MD ( 9 | GPIO_ALT_FN_1_OUT)
178#define GPIO10_RTCCLK_MD (10 | GPIO_ALT_FN_1_OUT)
179#define GPIO11_3_6MHz_MD (11 | GPIO_ALT_FN_1_OUT)
180#define GPIO12_32KHz_MD (12 | GPIO_ALT_FN_1_OUT)
181#define GPIO12_CIF_DD_7_MD (12 | GPIO_ALT_FN_2_IN)
182#define GPIO13_MBGNT_MD (13 | GPIO_ALT_FN_2_OUT)
183#define GPIO14_MBREQ_MD (14 | GPIO_ALT_FN_1_IN)
184#define GPIO15_nCS_1_MD (15 | GPIO_ALT_FN_2_OUT)
185#define GPIO16_PWM0_MD (16 | GPIO_ALT_FN_2_OUT)
186#define GPIO17_PWM1_MD (17 | GPIO_ALT_FN_2_OUT)
187#define GPIO17_CIF_DD_6_MD (17 | GPIO_ALT_FN_2_IN)
188#define GPIO18_RDY_MD (18 | GPIO_ALT_FN_1_IN)
189#define GPIO19_DREQ1_MD (19 | GPIO_ALT_FN_1_IN)
190#define GPIO20_DREQ0_MD (20 | GPIO_ALT_FN_1_IN)
191#define GPIO23_CIF_MCLK_MD (23 | GPIO_ALT_FN_1_OUT)
192#define GPIO23_SCLK_MD (23 | GPIO_ALT_FN_2_OUT)
193#define GPIO24_CIF_FV_MD (24 | GPIO_ALT_FN_1_OUT)
194#define GPIO24_SFRM_MD (24 | GPIO_ALT_FN_2_OUT)
195#define GPIO25_CIF_LV_MD (25 | GPIO_ALT_FN_1_OUT)
196#define GPIO25_STXD_MD (25 | GPIO_ALT_FN_2_OUT)
197#define GPIO26_SRXD_MD (26 | GPIO_ALT_FN_1_IN)
198#define GPIO26_CIF_PCLK_MD (26 | GPIO_ALT_FN_2_IN)
199#define GPIO27_SEXTCLK_MD (27 | GPIO_ALT_FN_1_IN)
200#define GPIO27_CIF_DD_0_MD (27 | GPIO_ALT_FN_3_IN)
201#define GPIO28_BITCLK_AC97_MD (28 | GPIO_ALT_FN_1_IN)
202#define GPIO28_BITCLK_IN_I2S_MD (28 | GPIO_ALT_FN_2_IN)
203#define GPIO28_BITCLK_OUT_I2S_MD (28 | GPIO_ALT_FN_1_OUT)
204#define GPIO29_SDATA_IN_AC97_MD (29 | GPIO_ALT_FN_1_IN)
205#define GPIO29_SDATA_IN_I2S_MD (29 | GPIO_ALT_FN_2_IN)
206#define GPIO30_SDATA_OUT_AC97_MD (30 | GPIO_ALT_FN_2_OUT)
207#define GPIO30_SDATA_OUT_I2S_MD (30 | GPIO_ALT_FN_1_OUT)
208#define GPIO31_SYNC_I2S_MD (31 | GPIO_ALT_FN_1_OUT)
209#define GPIO31_SYNC_AC97_MD (31 | GPIO_ALT_FN_2_OUT)
210#define GPIO32_SDATA_IN1_AC97_MD (32 | GPIO_ALT_FN_1_IN)
211#define GPIO32_SYSCLK_I2S_MD (32 | GPIO_ALT_FN_1_OUT)
212#define GPIO32_MMCCLK_MD (32 | GPIO_ALT_FN_2_OUT)
213#define GPIO33_nCS_5_MD (33 | GPIO_ALT_FN_2_OUT)
214#define GPIO34_FFRXD_MD (34 | GPIO_ALT_FN_1_IN)
215#define GPIO34_MMCCS0_MD (34 | GPIO_ALT_FN_2_OUT)
216#define GPIO35_FFCTS_MD (35 | GPIO_ALT_FN_1_IN)
217#define GPIO35_KP_MKOUT6_MD (35 | GPIO_ALT_FN_2_OUT)
218#define GPIO36_FFDCD_MD (36 | GPIO_ALT_FN_1_IN)
219#define GPIO37_FFDSR_MD (37 | GPIO_ALT_FN_1_IN)
220#define GPIO38_FFRI_MD (38 | GPIO_ALT_FN_1_IN)
221#define GPIO39_MMCCS1_MD (39 | GPIO_ALT_FN_1_OUT)
222#define GPIO39_FFTXD_MD (39 | GPIO_ALT_FN_2_OUT)
223#define GPIO40_FFDTR_MD (40 | GPIO_ALT_FN_2_OUT)
224#define GPIO41_FFRTS_MD (41 | GPIO_ALT_FN_2_OUT)
225#define GPIO41_KP_MKOUT7_MD (41 | GPIO_ALT_FN_1_OUT)
226#define GPIO42_BTRXD_MD (42 | GPIO_ALT_FN_1_IN)
227#define GPIO42_HWRXD_MD (42 | GPIO_ALT_FN_3_IN)
228#define GPIO42_CIF_MCLK_MD (42 | GPIO_ALT_FN_3_OUT)
229#define GPIO43_BTTXD_MD (43 | GPIO_ALT_FN_2_OUT)
230#define GPIO43_HWTXD_MD (43 | GPIO_ALT_FN_3_OUT)
231#define GPIO43_CIF_FV_MD (43 | GPIO_ALT_FN_3_OUT)
232#define GPIO44_BTCTS_MD (44 | GPIO_ALT_FN_1_IN)
233#define GPIO44_HWCTS_MD (44 | GPIO_ALT_FN_3_IN)
234#define GPIO44_CIF_LV_MD (44 | GPIO_ALT_FN_3_OUT)
235#define GPIO45_CIF_PCLK_MD (45 | GPIO_ALT_FN_3_IN)
236#define GPIO45_BTRTS_MD (45 | GPIO_ALT_FN_2_OUT)
237#define GPIO45_HWRTS_MD (45 | GPIO_ALT_FN_3_OUT)
238#define GPIO45_SYSCLK_AC97_MD (45 | GPIO_ALT_FN_1_OUT)
239#define GPIO46_ICPRXD_MD (46 | GPIO_ALT_FN_1_IN)
240#define GPIO46_STRXD_MD (46 | GPIO_ALT_FN_2_IN)
241#define GPIO47_CIF_DD_0_MD (47 | GPIO_ALT_FN_1_IN)
242#define GPIO47_ICPTXD_MD (47 | GPIO_ALT_FN_2_OUT)
243#define GPIO47_STTXD_MD (47 | GPIO_ALT_FN_1_OUT)
244#define GPIO48_CIF_DD_5_MD (48 | GPIO_ALT_FN_1_IN)
245#define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT)
246#define GPIO48_HWTXD_MD (48 | GPIO_ALT_FN_1_OUT)
247#define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT)
248#define GPIO49_HWRXD_MD (49 | GPIO_ALT_FN_1_IN)
249#define GPIO49_nPWE_MD (49 | GPIO_ALT_FN_2_OUT)
250#define GPIO50_CIF_DD_3_MD (50 | GPIO_ALT_FN_1_IN)
251#define GPIO50_nPIOR_MD (50 | GPIO_ALT_FN_2_OUT)
252#define GPIO50_HWCTS_MD (50 | GPIO_ALT_FN_1_IN)
253#define GPIO50_CIF_DD_3_MD (50 | GPIO_ALT_FN_1_IN)
254#define GPIO51_CIF_DD_2_MD (51 | GPIO_ALT_FN_1_IN)
255#define GPIO51_nPIOW_MD (51 | GPIO_ALT_FN_2_OUT)
256#define GPIO51_HWRTS_MD (51 | GPIO_ALT_FN_1_OUT)
257#define GPIO51_CIF_DD_2_MD (51 | GPIO_ALT_FN_1_IN)
258#define GPIO52_nPCE_1_MD (52 | GPIO_ALT_FN_2_OUT)
259#define GPIO52_CIF_DD_4_MD (52 | GPIO_ALT_FN_1_IN)
260#define GPIO53_nPCE_2_MD (53 | GPIO_ALT_FN_2_OUT)
261#define GPIO53_MMCCLK_MD (53 | GPIO_ALT_FN_1_OUT)
262#define GPIO53_CIF_MCLK_MD (53 | GPIO_ALT_FN_2_OUT)
263#define GPIO54_MMCCLK_MD (54 | GPIO_ALT_FN_1_OUT)
264#define GPIO54_nPCE_2_MD (54 | GPIO_ALT_FN_2_OUT)
265#define GPIO54_pSKTSEL_MD (54 | GPIO_ALT_FN_2_OUT)
266#define GPIO54_CIF_PCLK_MD (54 | GPIO_ALT_FN_3_IN)
267#define GPIO55_nPREG_MD (55 | GPIO_ALT_FN_2_OUT)
268#define GPIO55_CIF_DD_1_MD (55 | GPIO_ALT_FN_1_IN)
269#define GPIO56_nPWAIT_MD (56 | GPIO_ALT_FN_1_IN)
270#define GPIO57_nIOIS16_MD (57 | GPIO_ALT_FN_1_IN)
271#define GPIO58_LDD_0_MD (58 | GPIO_ALT_FN_2_OUT)
272#define GPIO59_LDD_1_MD (59 | GPIO_ALT_FN_2_OUT)
273#define GPIO60_LDD_2_MD (60 | GPIO_ALT_FN_2_OUT)
274#define GPIO61_LDD_3_MD (61 | GPIO_ALT_FN_2_OUT)
275#define GPIO62_LDD_4_MD (62 | GPIO_ALT_FN_2_OUT)
276#define GPIO63_LDD_5_MD (63 | GPIO_ALT_FN_2_OUT)
277#define GPIO64_LDD_6_MD (64 | GPIO_ALT_FN_2_OUT)
278#define GPIO65_LDD_7_MD (65 | GPIO_ALT_FN_2_OUT)
279#define GPIO66_LDD_8_MD (66 | GPIO_ALT_FN_2_OUT)
280#define GPIO66_MBREQ_MD (66 | GPIO_ALT_FN_1_IN)
281#define GPIO67_LDD_9_MD (67 | GPIO_ALT_FN_2_OUT)
282#define GPIO67_MMCCS0_MD (67 | GPIO_ALT_FN_1_OUT)
283#define GPIO68_LDD_10_MD (68 | GPIO_ALT_FN_2_OUT)
284#define GPIO68_MMCCS1_MD (68 | GPIO_ALT_FN_1_OUT)
285#define GPIO69_LDD_11_MD (69 | GPIO_ALT_FN_2_OUT)
286#define GPIO69_MMCCLK_MD (69 | GPIO_ALT_FN_1_OUT)
287#define GPIO70_LDD_12_MD (70 | GPIO_ALT_FN_2_OUT)
288#define GPIO70_RTCCLK_MD (70 | GPIO_ALT_FN_1_OUT)
289#define GPIO71_LDD_13_MD (71 | GPIO_ALT_FN_2_OUT)
290#define GPIO71_3_6MHz_MD (71 | GPIO_ALT_FN_1_OUT)
291#define GPIO72_LDD_14_MD (72 | GPIO_ALT_FN_2_OUT)
292#define GPIO72_32kHz_MD (72 | GPIO_ALT_FN_1_OUT)
293#define GPIO73_LDD_15_MD (73 | GPIO_ALT_FN_2_OUT)
294#define GPIO73_MBGNT_MD (73 | GPIO_ALT_FN_1_OUT)
295#define GPIO74_LCD_FCLK_MD (74 | GPIO_ALT_FN_2_OUT)
296#define GPIO75_LCD_LCLK_MD (75 | GPIO_ALT_FN_2_OUT)
297#define GPIO76_LCD_PCLK_MD (76 | GPIO_ALT_FN_2_OUT)
298#define GPIO77_LCD_ACBIAS_MD (77 | GPIO_ALT_FN_2_OUT)
299#define GPIO78_nCS_2_MD (78 | GPIO_ALT_FN_2_OUT)
300#define GPIO78_nPCE_2_MD (78 | GPIO_ALT_FN_1_OUT)
301#define GPIO79_nCS_3_MD (79 | GPIO_ALT_FN_2_OUT)
302#define GPIO79_pSKTSEL_MD (79 | GPIO_ALT_FN_1_OUT)
303#define GPIO80_nCS_4_MD (80 | GPIO_ALT_FN_2_OUT)
304#define GPIO81_NSSP_CLK_OUT (81 | GPIO_ALT_FN_1_OUT)
305#define GPIO81_NSSP_CLK_IN (81 | GPIO_ALT_FN_1_IN)
306#define GPIO81_CIF_DD_0_MD (81 | GPIO_ALT_FN_2_IN)
307#define GPIO82_NSSP_FRM_OUT (82 | GPIO_ALT_FN_1_OUT)
308#define GPIO82_NSSP_FRM_IN (82 | GPIO_ALT_FN_1_IN)
309#define GPIO82_CIF_DD_5_MD (82 | GPIO_ALT_FN_3_IN)
310#define GPIO83_NSSP_TX (83 | GPIO_ALT_FN_1_OUT)
311#define GPIO83_NSSP_RX (83 | GPIO_ALT_FN_2_IN)
312#define GPIO83_CIF_DD_4_MD (83 | GPIO_ALT_FN_3_IN)
313#define GPIO84_NSSP_TX (84 | GPIO_ALT_FN_1_OUT)
314#define GPIO84_NSSP_RX (84 | GPIO_ALT_FN_2_IN)
315#define GPIO84_CIF_FV_MD (84 | GPIO_ALT_FN_3_IN)
316#define GPIO85_nPCE_1_MD (85 | GPIO_ALT_FN_1_OUT)
317#define GPIO85_CIF_LV_MD (85 | GPIO_ALT_FN_3_IN)
318#define GPIO86_nPCE_1_MD (86 | GPIO_ALT_FN_1_OUT)
319#define GPIO90_CIF_DD_4_MD (90 | GPIO_ALT_FN_3_IN)
320#define GPIO91_CIF_DD_5_MD (91 | GPIO_ALT_FN_3_IN)
321#define GPIO92_MMCDAT0_MD (92 | GPIO_ALT_FN_1_OUT)
322#define GPIO93_CIF_DD_6_MD (93 | GPIO_ALT_FN_2_IN)
323#define GPIO94_CIF_DD_5_MD (94 | GPIO_ALT_FN_2_IN)
324#define GPIO95_CIF_DD_4_MD (95 | GPIO_ALT_FN_2_IN)
325#define GPIO95_KP_MKIN6_MD (95 | GPIO_ALT_FN_3_IN)
326#define GPIO96_KP_DKIN3_MD (96 | GPIO_ALT_FN_1_IN)
327#define GPIO97_KP_MKIN3_MD (97 | GPIO_ALT_FN_3_IN)
328#define GPIO98_CIF_DD_0_MD (98 | GPIO_ALT_FN_2_IN)
329#define GPIO100_KP_MKIN0_MD (100 | GPIO_ALT_FN_1_IN)
330#define GPIO101_KP_MKIN1_MD (101 | GPIO_ALT_FN_1_IN)
331#define GPIO102_nPCE_1_MD (102 | GPIO_ALT_FN_1_OUT)
332#define GPIO102_KP_MKIN2_MD (102 | GPIO_ALT_FN_1_IN)
333#define GPIO103_CIF_DD_3_MD (103 | GPIO_ALT_FN_1_IN)
334#define GPIO103_KP_MKOUT0_MD (103 | GPIO_ALT_FN_2_OUT)
335#define GPIO104_CIF_DD_2_MD (104 | GPIO_ALT_FN_1_IN)
336#define GPIO104_pSKTSEL_MD (104 | GPIO_ALT_FN_1_OUT)
337#define GPIO104_KP_MKOUT1_MD (104 | GPIO_ALT_FN_2_OUT)
338#define GPIO105_CIF_DD_1_MD (105 | GPIO_ALT_FN_1_IN)
339#define GPIO105_KP_MKOUT2_MD (105 | GPIO_ALT_FN_2_OUT)
340#define GPIO106_CIF_DD_9_MD (106 | GPIO_ALT_FN_1_IN)
341#define GPIO106_KP_MKOUT3_MD (106 | GPIO_ALT_FN_2_OUT)
342#define GPIO107_CIF_DD_8_MD (107 | GPIO_ALT_FN_1_IN)
343#define GPIO107_KP_MKOUT4_MD (107 | GPIO_ALT_FN_2_OUT)
344#define GPIO108_CIF_DD_7_MD (108 | GPIO_ALT_FN_1_IN)
345#define GPIO108_KP_MKOUT5_MD (108 | GPIO_ALT_FN_2_OUT)
346#define GPIO109_MMCDAT1_MD (109 | GPIO_ALT_FN_1_OUT)
347#define GPIO110_MMCDAT2_MD (110 | GPIO_ALT_FN_1_OUT)
348#define GPIO110_MMCCS0_MD (110 | GPIO_ALT_FN_1_OUT)
349#define GPIO111_MMCDAT3_MD (111 | GPIO_ALT_FN_1_OUT)
350#define GPIO110_MMCCS1_MD (111 | GPIO_ALT_FN_1_OUT)
351#define GPIO112_MMCCMD_MD (112 | GPIO_ALT_FN_1_OUT)
352#define GPIO113_I2S_SYSCLK_MD (113 | GPIO_ALT_FN_1_OUT)
353#define GPIO113_AC97_RESET_N_MD (113 | GPIO_ALT_FN_2_OUT)
354#define GPIO117_I2CSCL_MD (117 | GPIO_ALT_FN_1_IN)
355#define GPIO118_I2CSDA_MD (118 | GPIO_ALT_FN_1_IN)
356
357#endif /* __ASM_ARCH_PXA2XX_GPIO_H */
diff --git a/include/asm-arm/arch-pxa/pxa3xx-regs.h b/include/asm-arm/arch-pxa/pxa3xx-regs.h
index 8e1b3ead827f..fe9364c83a28 100644
--- a/include/asm-arm/arch-pxa/pxa3xx-regs.h
+++ b/include/asm-arm/arch-pxa/pxa3xx-regs.h
@@ -12,6 +12,15 @@
12 12
13#ifndef __ASM_ARCH_PXA3XX_REGS_H 13#ifndef __ASM_ARCH_PXA3XX_REGS_H
14#define __ASM_ARCH_PXA3XX_REGS_H 14#define __ASM_ARCH_PXA3XX_REGS_H
15
16/*
17 * Oscillator Configuration Register (OSCC)
18 */
19#define OSCC __REG(0x41350000) /* Oscillator Configuration Register */
20
21#define OSCC_PEN (1 << 11) /* 13MHz POUT */
22
23
15/* 24/*
16 * Service Power Management Unit (MPMU) 25 * Service Power Management Unit (MPMU)
17 */ 26 */
diff --git a/include/asm-arm/arch-pxa/tosa.h b/include/asm-arm/arch-pxa/tosa.h
index c05e4faf85a6..c5b6fde6907c 100644
--- a/include/asm-arm/arch-pxa/tosa.h
+++ b/include/asm-arm/arch-pxa/tosa.h
@@ -23,11 +23,12 @@
23/* 23/*
24 * SCOOP2 internal GPIOs 24 * SCOOP2 internal GPIOs
25 */ 25 */
26#define TOSA_SCOOP_GPIO_BASE NR_BUILTIN_GPIO
26#define TOSA_SCOOP_PXA_VCORE1 SCOOP_GPCR_PA11 27#define TOSA_SCOOP_PXA_VCORE1 SCOOP_GPCR_PA11
27#define TOSA_SCOOP_TC6393_REST_IN SCOOP_GPCR_PA12 28#define TOSA_SCOOP_TC6393_REST_IN SCOOP_GPCR_PA12
28#define TOSA_SCOOP_IR_POWERDWN SCOOP_GPCR_PA13 29#define TOSA_GPIO_IR_POWERDWN (TOSA_SCOOP_GPIO_BASE + 2)
29#define TOSA_SCOOP_SD_WP SCOOP_GPCR_PA14 30#define TOSA_GPIO_SD_WP (TOSA_SCOOP_GPIO_BASE + 3)
30#define TOSA_SCOOP_PWR_ON SCOOP_GPCR_PA15 31#define TOSA_GPIO_PWR_ON (TOSA_SCOOP_GPIO_BASE + 4)
31#define TOSA_SCOOP_AUD_PWR_ON SCOOP_GPCR_PA16 32#define TOSA_SCOOP_AUD_PWR_ON SCOOP_GPCR_PA16
32#define TOSA_SCOOP_BT_RESET SCOOP_GPCR_PA17 33#define TOSA_SCOOP_BT_RESET SCOOP_GPCR_PA17
33#define TOSA_SCOOP_BT_PWR_EN SCOOP_GPCR_PA18 34#define TOSA_SCOOP_BT_PWR_EN SCOOP_GPCR_PA18
@@ -35,7 +36,7 @@
35 36
36/* GPIO Direction 1 : output mode / 0:input mode */ 37/* GPIO Direction 1 : output mode / 0:input mode */
37#define TOSA_SCOOP_IO_DIR ( TOSA_SCOOP_PXA_VCORE1 | TOSA_SCOOP_TC6393_REST_IN | \ 38#define TOSA_SCOOP_IO_DIR ( TOSA_SCOOP_PXA_VCORE1 | TOSA_SCOOP_TC6393_REST_IN | \
38 TOSA_SCOOP_IR_POWERDWN | TOSA_SCOOP_PWR_ON | TOSA_SCOOP_AUD_PWR_ON |\ 39 TOSA_SCOOP_AUD_PWR_ON |\
39 TOSA_SCOOP_BT_RESET | TOSA_SCOOP_BT_PWR_EN ) 40 TOSA_SCOOP_BT_RESET | TOSA_SCOOP_BT_PWR_EN )
40/* GPIO out put level when init 1: Hi */ 41/* GPIO out put level when init 1: Hi */
41#define TOSA_SCOOP_IO_OUT ( TOSA_SCOOP_TC6393_REST_IN ) 42#define TOSA_SCOOP_IO_OUT ( TOSA_SCOOP_TC6393_REST_IN )
@@ -43,23 +44,21 @@
43/* 44/*
44 * SCOOP2 jacket GPIOs 45 * SCOOP2 jacket GPIOs
45 */ 46 */
46#define TOSA_SCOOP_JC_BT_LED SCOOP_GPCR_PA11 47#define TOSA_SCOOP_JC_GPIO_BASE (NR_BUILTIN_GPIO + 12)
47#define TOSA_SCOOP_JC_NOTE_LED SCOOP_GPCR_PA12 48#define TOSA_GPIO_BT_LED (TOSA_SCOOP_JC_GPIO_BASE + 0)
48#define TOSA_SCOOP_JC_CHRG_ERR_LED SCOOP_GPCR_PA13 49#define TOSA_GPIO_NOTE_LED (TOSA_SCOOP_JC_GPIO_BASE + 1)
49#define TOSA_SCOOP_JC_USB_PULLUP SCOOP_GPCR_PA14 50#define TOSA_GPIO_CHRG_ERR_LED (TOSA_SCOOP_JC_GPIO_BASE + 2)
51#define TOSA_GPIO_USB_PULLUP (TOSA_SCOOP_JC_GPIO_BASE + 3)
50#define TOSA_SCOOP_JC_TC6393_SUSPEND SCOOP_GPCR_PA15 52#define TOSA_SCOOP_JC_TC6393_SUSPEND SCOOP_GPCR_PA15
51#define TOSA_SCOOP_JC_TC3693_L3V_ON SCOOP_GPCR_PA16 53#define TOSA_SCOOP_JC_TC3693_L3V_ON SCOOP_GPCR_PA16
52#define TOSA_SCOOP_JC_WLAN_DETECT SCOOP_GPCR_PA17 54#define TOSA_SCOOP_JC_WLAN_DETECT SCOOP_GPCR_PA17
53#define TOSA_SCOOP_JC_WLAN_LED SCOOP_GPCR_PA18 55#define TOSA_GPIO_WLAN_LED (TOSA_SCOOP_JC_GPIO_BASE + 7)
54#define TOSA_SCOOP_JC_CARD_LIMIT_SEL SCOOP_GPCR_PA19 56#define TOSA_SCOOP_JC_CARD_LIMIT_SEL SCOOP_GPCR_PA19
55 57
56/* GPIO Direction 1 : output mode / 0:input mode */ 58/* GPIO Direction 1 : output mode / 0:input mode */
57#define TOSA_SCOOP_JC_IO_DIR ( TOSA_SCOOP_JC_BT_LED | TOSA_SCOOP_JC_NOTE_LED | \ 59#define TOSA_SCOOP_JC_IO_DIR ( \
58 TOSA_SCOOP_JC_CHRG_ERR_LED | TOSA_SCOOP_JC_USB_PULLUP | \
59 TOSA_SCOOP_JC_TC6393_SUSPEND | TOSA_SCOOP_JC_TC3693_L3V_ON | \ 60 TOSA_SCOOP_JC_TC6393_SUSPEND | TOSA_SCOOP_JC_TC3693_L3V_ON | \
60 TOSA_SCOOP_JC_WLAN_LED | TOSA_SCOOP_JC_CARD_LIMIT_SEL ) 61 TOSA_SCOOP_JC_CARD_LIMIT_SEL )
61/* GPIO out put level when init 1: Hi */
62#define TOSA_SCOOP_JC_IO_OUT ( 0 )
63 62
64/* 63/*
65 * Timing Generator 64 * Timing Generator
@@ -74,15 +73,6 @@
74#define TG_HPOSCTL 0x07 73#define TG_HPOSCTL 0x07
75 74
76/* 75/*
77 * LED
78 */
79#define TOSA_SCOOP_LED_BLUE TOSA_SCOOP_GPCR_PA11
80#define TOSA_SCOOP_LED_GREEN TOSA_SCOOP_GPCR_PA12
81#define TOSA_SCOOP_LED_ORANGE TOSA_SCOOP_GPCR_PA13
82#define TOSA_SCOOP_LED_WLAN TOSA_SCOOP_GPCR_PA18
83
84
85/*
86 * PXA GPIOs 76 * PXA GPIOs
87 */ 77 */
88#define TOSA_GPIO_POWERON (0) 78#define TOSA_GPIO_POWERON (0)
@@ -161,12 +151,8 @@
161 151
162#define TOSA_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO(TOSA_GPIO_MAIN_BAT_LOW) 152#define TOSA_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO(TOSA_GPIO_MAIN_BAT_LOW)
163 153
164extern struct platform_device tosascoop_jc_device;
165extern struct platform_device tosascoop_device;
166
167#define TOSA_KEY_SYNC KEY_102ND /* ??? */ 154#define TOSA_KEY_SYNC KEY_102ND /* ??? */
168 155
169
170#ifndef CONFIG_KEYBOARD_TOSA_USE_EXT_KEYCODES 156#ifndef CONFIG_KEYBOARD_TOSA_USE_EXT_KEYCODES
171#define TOSA_KEY_RECORD KEY_YEN 157#define TOSA_KEY_RECORD KEY_YEN
172#define TOSA_KEY_ADDRESSBOOK KEY_KATAKANA 158#define TOSA_KEY_ADDRESSBOOK KEY_KATAKANA
diff --git a/include/asm-arm/arch-pxa/zylonite.h b/include/asm-arm/arch-pxa/zylonite.h
index 5f717d64ea7d..4881b80f0f90 100644
--- a/include/asm-arm/arch-pxa/zylonite.h
+++ b/include/asm-arm/arch-pxa/zylonite.h
@@ -18,6 +18,8 @@ extern struct platform_mmc_slot zylonite_mmc_slot[];
18extern int gpio_backlight; 18extern int gpio_backlight;
19extern int gpio_eth_irq; 19extern int gpio_eth_irq;
20 20
21extern int wm9713_irq;
22
21extern int lcd_id; 23extern int lcd_id;
22extern int lcd_orientation; 24extern int lcd_orientation;
23 25
diff --git a/include/asm-arm/arch-realview/board-eb.h b/include/asm-arm/arch-realview/board-eb.h
index 3e437b7f425a..206f7a752882 100644
--- a/include/asm-arm/arch-realview/board-eb.h
+++ b/include/asm-arm/arch-realview/board-eb.h
@@ -26,6 +26,26 @@
26/* 26/*
27 * RealView EB + ARM11MPCore peripheral addresses 27 * RealView EB + ARM11MPCore peripheral addresses
28 */ 28 */
29#define REALVIEW_EB_UART0_BASE 0x10009000 /* UART 0 */
30#define REALVIEW_EB_UART1_BASE 0x1000A000 /* UART 1 */
31#define REALVIEW_EB_UART2_BASE 0x1000B000 /* UART 2 */
32#define REALVIEW_EB_UART3_BASE 0x1000C000 /* UART 3 */
33#define REALVIEW_EB_SSP_BASE 0x1000D000 /* Synchronous Serial Port */
34#define REALVIEW_EB_WATCHDOG_BASE 0x10010000 /* watchdog interface */
35#define REALVIEW_EB_TIMER0_1_BASE 0x10011000 /* Timer 0 and 1 */
36#define REALVIEW_EB_TIMER2_3_BASE 0x10012000 /* Timer 2 and 3 */
37#define REALVIEW_EB_GPIO0_BASE 0x10013000 /* GPIO port 0 */
38#define REALVIEW_EB_RTC_BASE 0x10017000 /* Real Time Clock */
39#define REALVIEW_EB_CLCD_BASE 0x10020000 /* CLCD */
40#define REALVIEW_EB_GIC_CPU_BASE 0x10040000 /* Generic interrupt controller CPU interface */
41#define REALVIEW_EB_GIC_DIST_BASE 0x10041000 /* Generic interrupt controller distributor */
42#define REALVIEW_EB_SMC_BASE 0x10080000 /* Static memory controller */
43
44#define REALVIEW_EB_FLASH_BASE 0x40000000
45#define REALVIEW_EB_FLASH_SIZE SZ_64M
46#define REALVIEW_EB_ETH_BASE 0x4E000000 /* Ethernet */
47#define REALVIEW_EB_USB_BASE 0x4F000000 /* USB */
48
29#ifdef CONFIG_REALVIEW_EB_ARM11MP_REVB 49#ifdef CONFIG_REALVIEW_EB_ARM11MP_REVB
30#define REALVIEW_EB11MP_SCU_BASE 0x10100000 /* SCU registers */ 50#define REALVIEW_EB11MP_SCU_BASE 0x10100000 /* SCU registers */
31#define REALVIEW_EB11MP_GIC_CPU_BASE 0x10100100 /* Generic interrupt controller CPU interface */ 51#define REALVIEW_EB11MP_GIC_CPU_BASE 0x10100100 /* Generic interrupt controller CPU interface */
diff --git a/include/asm-arm/arch-realview/board-pb1176.h b/include/asm-arm/arch-realview/board-pb1176.h
new file mode 100644
index 000000000000..48ce9c833705
--- /dev/null
+++ b/include/asm-arm/arch-realview/board-pb1176.h
@@ -0,0 +1,152 @@
1/*
2 * include/asm-arm/arch-realview/board-pb1176.h
3 *
4 * Copyright (C) 2008 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */
20
21#ifndef __ASM_ARCH_BOARD_PB1176_H
22#define __ASM_ARCH_BOARD_PB1176_H
23
24#include <asm/arch/platform.h>
25
26/*
27 * Peripheral addresses
28 */
29#define REALVIEW_PB1176_SCTL_BASE 0x10100000 /* System controller */
30#define REALVIEW_PB1176_SMC_BASE 0x10111000 /* SMC */
31#define REALVIEW_PB1176_DMC_BASE 0x10109000 /* DMC configuration */
32#define REALVIEW_PB1176_SDRAM67_BASE 0x70000000 /* SDRAM banks 6 and 7 */
33#define REALVIEW_PB1176_FLASH_BASE 0x30000000
34#define REALVIEW_PB1176_FLASH_SIZE SZ_64M
35
36#define REALVIEW_PB1176_TIMER0_1_BASE 0x10104000 /* Timer 0 and 1 */
37#define REALVIEW_PB1176_TIMER2_3_BASE 0x10105000 /* Timer 2 and 3 */
38#define REALVIEW_PB1176_TIMER4_5_BASE 0x10106000 /* Timer 4 and 5 */
39#define REALVIEW_PB1176_WATCHDOG_BASE 0x10107000 /* watchdog interface */
40#define REALVIEW_PB1176_RTC_BASE 0x10108000 /* Real Time Clock */
41#define REALVIEW_PB1176_GPIO0_BASE 0x1010A000 /* GPIO port 0 */
42#define REALVIEW_PB1176_SSP_BASE 0x1010B000 /* Synchronous Serial Port */
43#define REALVIEW_PB1176_UART0_BASE 0x1010C000 /* UART 0 */
44#define REALVIEW_PB1176_UART1_BASE 0x1010D000 /* UART 1 */
45#define REALVIEW_PB1176_UART2_BASE 0x1010E000 /* UART 2 */
46#define REALVIEW_PB1176_UART3_BASE 0x1010F000 /* UART 3 */
47#define REALVIEW_PB1176_CLCD_BASE 0x10112000 /* CLCD */
48#define REALVIEW_PB1176_ETH_BASE 0x3A000000 /* Ethernet */
49#define REALVIEW_PB1176_USB_BASE 0x3B000000 /* USB */
50
51/*
52 * PCI regions
53 */
54#define REALVIEW_PB1176_PCI_BASE 0x60000000 /* PCI self config */
55#define REALVIEW_PB1176_PCI_CFG_BASE 0x61000000 /* PCI config */
56#define REALVIEW_PB1176_PCI_IO_BASE0 0x62000000 /* PCI IO region */
57#define REALVIEW_PB1176_PCI_MEM_BASE0 0x63000000 /* Memory region 1 */
58#define REALVIEW_PB1176_PCI_MEM_BASE1 0x64000000 /* Memory region 2 */
59#define REALVIEW_PB1176_PCI_MEM_BASE2 0x68000000 /* Memory region 3 */
60
61#define REALVIEW_PB1176_PCI_BASE_SIZE 0x01000000 /* 16MB */
62#define REALVIEW_PB1176_PCI_CFG_BASE_SIZE 0x01000000 /* 16MB */
63#define REALVIEW_PB1176_PCI_IO_BASE0_SIZE 0x01000000 /* 16MB */
64#define REALVIEW_PB1176_PCI_MEM_BASE0_SIZE 0x01000000 /* 16MB */
65#define REALVIEW_PB1176_PCI_MEM_BASE1_SIZE 0x04000000 /* 64MB */
66#define REALVIEW_PB1176_PCI_MEM_BASE2_SIZE 0x08000000 /* 128MB */
67
68#define REALVIEW_DC1176_GIC_CPU_BASE 0x10120000 /* GIC CPU interface, on devchip */
69#define REALVIEW_DC1176_GIC_DIST_BASE 0x10121000 /* GIC distributor, on devchip */
70#define REALVIEW_PB1176_GIC_CPU_BASE 0x10040000 /* GIC CPU interface, on FPGA */
71#define REALVIEW_PB1176_GIC_DIST_BASE 0x10041000 /* GIC distributor, on FPGA */
72#define REALVIEW_PB1176_L220_BASE 0x10110000 /* L220 registers */
73
74/*
75 * Irqs
76 */
77#define IRQ_DC1176_GIC_START 32
78#define IRQ_PB1176_GIC_START 64
79
80/*
81 * ARM1176 DevChip interrupt sources (primary GIC)
82 */
83#define IRQ_DC1176_WATCHDOG (IRQ_DC1176_GIC_START + 0) /* Watchdog timer */
84#define IRQ_DC1176_SOFTINT (IRQ_DC1176_GIC_START + 1) /* Software interrupt */
85#define IRQ_DC1176_COMMRx (IRQ_DC1176_GIC_START + 2) /* Debug Comm Rx interrupt */
86#define IRQ_DC1176_COMMTx (IRQ_DC1176_GIC_START + 3) /* Debug Comm Tx interrupt */
87#define IRQ_DC1176_TIMER0 (IRQ_DC1176_GIC_START + 8) /* Timer 0 */
88#define IRQ_DC1176_TIMER1 (IRQ_DC1176_GIC_START + 9) /* Timer 1 */
89#define IRQ_DC1176_TIMER2 (IRQ_DC1176_GIC_START + 10) /* Timer 2 */
90#define IRQ_DC1176_APC (IRQ_DC1176_GIC_START + 11)
91#define IRQ_DC1176_IEC (IRQ_DC1176_GIC_START + 12)
92#define IRQ_DC1176_L2CC (IRQ_DC1176_GIC_START + 13)
93#define IRQ_DC1176_RTC (IRQ_DC1176_GIC_START + 14)
94#define IRQ_DC1176_CLCD (IRQ_DC1176_GIC_START + 15) /* CLCD controller */
95#define IRQ_DC1176_UART0 (IRQ_DC1176_GIC_START + 18) /* UART 0 on development chip */
96#define IRQ_DC1176_UART1 (IRQ_DC1176_GIC_START + 19) /* UART 1 on development chip */
97#define IRQ_DC1176_UART2 (IRQ_DC1176_GIC_START + 20) /* UART 2 on development chip */
98#define IRQ_DC1176_UART3 (IRQ_DC1176_GIC_START + 21) /* UART 3 on development chip */
99
100#define IRQ_DC1176_PB_IRQ2 (IRQ_DC1176_GIC_START + 30) /* tile GIC */
101#define IRQ_DC1176_PB_IRQ1 (IRQ_DC1176_GIC_START + 31) /* main GIC */
102
103/*
104 * RealView PB1176 interrupt sources (secondary GIC)
105 */
106#define IRQ_PB1176_MMCI0A (IRQ_PB1176_GIC_START + 1) /* Multimedia Card 0A */
107#define IRQ_PB1176_MMCI0B (IRQ_PB1176_GIC_START + 2) /* Multimedia Card 0A */
108#define IRQ_PB1176_KMI0 (IRQ_PB1176_GIC_START + 3) /* Keyboard/Mouse port 0 */
109#define IRQ_PB1176_KMI1 (IRQ_PB1176_GIC_START + 4) /* Keyboard/Mouse port 1 */
110#define IRQ_PB1176_SCI (IRQ_PB1176_GIC_START + 5)
111#define IRQ_PB1176_UART4 (IRQ_PB1176_GIC_START + 6) /* UART 4 on baseboard */
112#define IRQ_PB1176_CHARLCD (IRQ_PB1176_GIC_START + 7) /* Character LCD */
113#define IRQ_PB1176_GPIO1 (IRQ_PB1176_GIC_START + 8)
114#define IRQ_PB1176_GPIO2 (IRQ_PB1176_GIC_START + 9)
115#define IRQ_PB1176_ETH (IRQ_PB1176_GIC_START + 10) /* Ethernet controller */
116#define IRQ_PB1176_USB (IRQ_PB1176_GIC_START + 11) /* USB controller */
117
118#define IRQ_PB1176_PISMO (IRQ_PB1176_GIC_START + 16)
119
120#define IRQ_PB1176_AACI (IRQ_PB1176_GIC_START + 19) /* Audio Codec */
121
122#define IRQ_PB1176_TIMER0_1 (IRQ_PB1176_GIC_START + 22)
123#define IRQ_PB1176_TIMER2_3 (IRQ_PB1176_GIC_START + 23)
124#define IRQ_PB1176_DMAC (IRQ_PB1176_GIC_START + 24) /* DMA controller */
125#define IRQ_PB1176_RTC (IRQ_PB1176_GIC_START + 25) /* Real Time Clock */
126
127#define IRQ_PB1176_GPIO0 -1
128#define IRQ_PB1176_SSP -1
129#define IRQ_PB1176_SCTL -1
130
131#define NR_GIC_PB1176 2
132
133/*
134 * Only define NR_IRQS if less than NR_IRQS_PB1176
135 */
136#define NR_IRQS_PB1176 (IRQ_DC1176_GIC_START + 96)
137
138#if defined(CONFIG_MACH_REALVIEW_PB1176)
139
140#if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_PB1176)
141#undef NR_IRQS
142#define NR_IRQS NR_IRQS_PB1176
143#endif
144
145#if !defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_PB1176)
146#undef MAX_GIC_NR
147#define MAX_GIC_NR NR_GIC_PB1176
148#endif
149
150#endif /* CONFIG_MACH_REALVIEW_PB1176 */
151
152#endif /* __ASM_ARCH_BOARD_PB1176_H */
diff --git a/include/asm-arm/arch-realview/board-pb11mp.h b/include/asm-arm/arch-realview/board-pb11mp.h
new file mode 100644
index 000000000000..a1294d915fa8
--- /dev/null
+++ b/include/asm-arm/arch-realview/board-pb11mp.h
@@ -0,0 +1,186 @@
1/*
2 * include/asm-arm/arch-realview/board-pb11mp.h
3 *
4 * Copyright (C) 2008 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */
20
21#ifndef __ASM_ARCH_BOARD_PB11MP_H
22#define __ASM_ARCH_BOARD_PB11MP_H
23
24#include <asm/arch/platform.h>
25
26/*
27 * Peripheral addresses
28 */
29#define REALVIEW_PB11MP_UART0_BASE 0x10009000 /* UART 0 */
30#define REALVIEW_PB11MP_UART1_BASE 0x1000A000 /* UART 1 */
31#define REALVIEW_PB11MP_UART2_BASE 0x1000B000 /* UART 2 */
32#define REALVIEW_PB11MP_UART3_BASE 0x1000C000 /* UART 3 */
33#define REALVIEW_PB11MP_SSP_BASE 0x1000D000 /* Synchronous Serial Port */
34#define REALVIEW_PB11MP_WATCHDOG0_BASE 0x1000F000 /* Watchdog 0 */
35#define REALVIEW_PB11MP_WATCHDOG_BASE 0x10010000 /* watchdog interface */
36#define REALVIEW_PB11MP_TIMER0_1_BASE 0x10011000 /* Timer 0 and 1 */
37#define REALVIEW_PB11MP_TIMER2_3_BASE 0x10012000 /* Timer 2 and 3 */
38#define REALVIEW_PB11MP_GPIO0_BASE 0x10013000 /* GPIO port 0 */
39#define REALVIEW_PB11MP_RTC_BASE 0x10017000 /* Real Time Clock */
40#define REALVIEW_PB11MP_TIMER4_5_BASE 0x10018000 /* Timer 4/5 */
41#define REALVIEW_PB11MP_TIMER6_7_BASE 0x10019000 /* Timer 6/7 */
42#define REALVIEW_PB11MP_SCTL_BASE 0x1001A000 /* System Controller */
43#define REALVIEW_PB11MP_CLCD_BASE 0x10020000 /* CLCD */
44#define REALVIEW_PB11MP_ONB_SRAM_BASE 0x10060000 /* On-board SRAM */
45#define REALVIEW_PB11MP_DMC_BASE 0x100E0000 /* DMC configuration */
46#define REALVIEW_PB11MP_SMC_BASE 0x100E1000 /* SMC configuration */
47#define REALVIEW_PB11MP_CAN_BASE 0x100E2000 /* CAN bus */
48#define REALVIEW_PB11MP_CF_BASE 0x18000000 /* Compact flash */
49#define REALVIEW_PB11MP_CF_MEM_BASE 0x18003000 /* SMC for Compact flash */
50#define REALVIEW_PB11MP_GIC_CPU_BASE 0x1E000000 /* Generic interrupt controller CPU interface */
51#define REALVIEW_PB11MP_FLASH0_BASE 0x40000000
52#define REALVIEW_PB11MP_FLASH0_SIZE SZ_64M
53#define REALVIEW_PB11MP_FLASH1_BASE 0x44000000
54#define REALVIEW_PB11MP_FLASH1_SIZE SZ_64M
55#define REALVIEW_PB11MP_ETH_BASE 0x4E000000 /* Ethernet */
56#define REALVIEW_PB11MP_USB_BASE 0x4F000000 /* USB */
57#define REALVIEW_PB11MP_GIC_DIST_BASE 0x1E001000 /* Generic interrupt controller distributor */
58#define REALVIEW_PB11MP_LT_BASE 0xC0000000 /* Logic Tile expansion */
59#define REALVIEW_PB11MP_SDRAM6_BASE 0x70000000 /* SDRAM bank 6 256MB */
60#define REALVIEW_PB11MP_SDRAM7_BASE 0x80000000 /* SDRAM bank 7 256MB */
61
62#define REALVIEW_PB11MP_SYS_PLD_CTRL1 0x74
63
64/*
65 * PB11MPCore PCI regions
66 */
67#define REALVIEW_PB11MP_PCI_BASE 0x90040000 /* PCI-X Unit base */
68#define REALVIEW_PB11MP_PCI_IO_BASE 0x90050000 /* IO Region on AHB */
69#define REALVIEW_PB11MP_PCI_MEM_BASE 0xA0000000 /* MEM Region on AHB */
70
71#define REALVIEW_PB11MP_PCI_BASE_SIZE 0x10000 /* 16 Kb */
72#define REALVIEW_PB11MP_PCI_IO_SIZE 0x1000 /* 4 Kb */
73#define REALVIEW_PB11MP_PCI_MEM_SIZE 0x20000000 /* 512 MB */
74
75/*
76 * Testchip peripheral and fpga gic regions
77 */
78#define REALVIEW_TC11MP_SCU_BASE 0x1F000000 /* IRQ, Test chip */
79#define REALVIEW_TC11MP_GIC_CPU_BASE 0x1F000100 /* Test chip interrupt controller CPU interface */
80#define REALVIEW_TC11MP_TWD_BASE 0x1F000700
81#define REALVIEW_TC11MP_TWD_SIZE 0x00000100
82#define REALVIEW_TC11MP_GIC_DIST_BASE 0x1F001000 /* Test chip interrupt controller distributor */
83#define REALVIEW_TC11MP_L220_BASE 0x1F002000 /* L220 registers */
84
85/*
86 * Irqs
87 */
88#define IRQ_TC11MP_GIC_START 32
89#define IRQ_PB11MP_GIC_START 64
90
91/*
92 * ARM11MPCore test chip interrupt sources (primary GIC on the test chip)
93 */
94#define IRQ_TC11MP_AACI (IRQ_TC11MP_GIC_START + 0)
95#define IRQ_TC11MP_TIMER0_1 (IRQ_TC11MP_GIC_START + 1)
96#define IRQ_TC11MP_TIMER2_3 (IRQ_TC11MP_GIC_START + 2)
97#define IRQ_TC11MP_USB (IRQ_TC11MP_GIC_START + 3)
98#define IRQ_TC11MP_UART0 (IRQ_TC11MP_GIC_START + 4)
99#define IRQ_TC11MP_UART1 (IRQ_TC11MP_GIC_START + 5)
100#define IRQ_TC11MP_RTC (IRQ_TC11MP_GIC_START + 6)
101#define IRQ_TC11MP_KMI0 (IRQ_TC11MP_GIC_START + 7)
102#define IRQ_TC11MP_KMI1 (IRQ_TC11MP_GIC_START + 8)
103#define IRQ_TC11MP_ETH (IRQ_TC11MP_GIC_START + 9)
104#define IRQ_TC11MP_PB_IRQ1 (IRQ_TC11MP_GIC_START + 10) /* main GIC */
105#define IRQ_TC11MP_PB_IRQ2 (IRQ_TC11MP_GIC_START + 11) /* tile GIC */
106#define IRQ_TC11MP_PB_FIQ1 (IRQ_TC11MP_GIC_START + 12) /* main GIC */
107#define IRQ_TC11MP_PB_FIQ2 (IRQ_TC11MP_GIC_START + 13) /* tile GIC */
108#define IRQ_TC11MP_MMCI0A (IRQ_TC11MP_GIC_START + 14)
109#define IRQ_TC11MP_MMCI0B (IRQ_TC11MP_GIC_START + 15)
110
111#define IRQ_TC11MP_PMU_CPU0 (IRQ_TC11MP_GIC_START + 17)
112#define IRQ_TC11MP_PMU_CPU1 (IRQ_TC11MP_GIC_START + 18)
113#define IRQ_TC11MP_PMU_CPU2 (IRQ_TC11MP_GIC_START + 19)
114#define IRQ_TC11MP_PMU_CPU3 (IRQ_TC11MP_GIC_START + 20)
115#define IRQ_TC11MP_PMU_SCU0 (IRQ_TC11MP_GIC_START + 21)
116#define IRQ_TC11MP_PMU_SCU1 (IRQ_TC11MP_GIC_START + 22)
117#define IRQ_TC11MP_PMU_SCU2 (IRQ_TC11MP_GIC_START + 23)
118#define IRQ_TC11MP_PMU_SCU3 (IRQ_TC11MP_GIC_START + 24)
119#define IRQ_TC11MP_PMU_SCU4 (IRQ_TC11MP_GIC_START + 25)
120#define IRQ_TC11MP_PMU_SCU5 (IRQ_TC11MP_GIC_START + 26)
121#define IRQ_TC11MP_PMU_SCU6 (IRQ_TC11MP_GIC_START + 27)
122#define IRQ_TC11MP_PMU_SCU7 (IRQ_TC11MP_GIC_START + 28)
123
124#define IRQ_TC11MP_L220_EVENT (IRQ_TC11MP_GIC_START + 29)
125#define IRQ_TC11MP_L220_SLAVE (IRQ_TC11MP_GIC_START + 30)
126#define IRQ_TC11MP_L220_DECODE (IRQ_TC11MP_GIC_START + 31)
127
128/*
129 * RealView PB11MPCore GIC interrupt sources (secondary GIC on the board)
130 */
131#define IRQ_PB11MP_WATCHDOG (IRQ_PB11MP_GIC_START + 0) /* Watchdog timer */
132#define IRQ_PB11MP_SOFT (IRQ_PB11MP_GIC_START + 1) /* Software interrupt */
133#define IRQ_PB11MP_COMMRx (IRQ_PB11MP_GIC_START + 2) /* Debug Comm Rx interrupt */
134#define IRQ_PB11MP_COMMTx (IRQ_PB11MP_GIC_START + 3) /* Debug Comm Tx interrupt */
135#define IRQ_PB11MP_GPIO0 (IRQ_PB11MP_GIC_START + 6) /* GPIO 0 */
136#define IRQ_PB11MP_GPIO1 (IRQ_PB11MP_GIC_START + 7) /* GPIO 1 */
137#define IRQ_PB11MP_GPIO2 (IRQ_PB11MP_GIC_START + 8) /* GPIO 2 */
138 /* 9 reserved */
139#define IRQ_PB11MP_RTC_GIC1 (IRQ_PB11MP_GIC_START + 10) /* Real Time Clock */
140#define IRQ_PB11MP_SSP (IRQ_PB11MP_GIC_START + 11) /* Synchronous Serial Port */
141#define IRQ_PB11MP_UART0_GIC1 (IRQ_PB11MP_GIC_START + 12) /* UART 0 on development chip */
142#define IRQ_PB11MP_UART1_GIC1 (IRQ_PB11MP_GIC_START + 13) /* UART 1 on development chip */
143#define IRQ_PB11MP_UART2 (IRQ_PB11MP_GIC_START + 14) /* UART 2 on development chip */
144#define IRQ_PB11MP_UART3 (IRQ_PB11MP_GIC_START + 15) /* UART 3 on development chip */
145#define IRQ_PB11MP_SCI (IRQ_PB11MP_GIC_START + 16) /* Smart Card Interface */
146#define IRQ_PB11MP_MMCI0A_GIC1 (IRQ_PB11MP_GIC_START + 17) /* Multimedia Card 0A */
147#define IRQ_PB11MP_MMCI0B_GIC1 (IRQ_PB11MP_GIC_START + 18) /* Multimedia Card 0B */
148#define IRQ_PB11MP_AACI_GIC1 (IRQ_PB11MP_GIC_START + 19) /* Audio Codec */
149#define IRQ_PB11MP_KMI0_GIC1 (IRQ_PB11MP_GIC_START + 20) /* Keyboard/Mouse port 0 */
150#define IRQ_PB11MP_KMI1_GIC1 (IRQ_PB11MP_GIC_START + 21) /* Keyboard/Mouse port 1 */
151#define IRQ_PB11MP_CHARLCD (IRQ_PB11MP_GIC_START + 22) /* Character LCD */
152#define IRQ_PB11MP_CLCD (IRQ_PB11MP_GIC_START + 23) /* CLCD controller */
153#define IRQ_PB11MP_DMAC (IRQ_PB11MP_GIC_START + 24) /* DMA controller */
154#define IRQ_PB11MP_PWRFAIL (IRQ_PB11MP_GIC_START + 25) /* Power failure */
155#define IRQ_PB11MP_PISMO (IRQ_PB11MP_GIC_START + 26) /* PISMO interface */
156#define IRQ_PB11MP_DoC (IRQ_PB11MP_GIC_START + 27) /* Disk on Chip memory controller */
157#define IRQ_PB11MP_ETH_GIC1 (IRQ_PB11MP_GIC_START + 28) /* Ethernet controller */
158#define IRQ_PB11MP_USB_GIC1 (IRQ_PB11MP_GIC_START + 29) /* USB controller */
159#define IRQ_PB11MP_TSPEN (IRQ_PB11MP_GIC_START + 30) /* Touchscreen pen */
160#define IRQ_PB11MP_TSKPAD (IRQ_PB11MP_GIC_START + 31) /* Touchscreen keypad */
161
162#define IRQ_PB11MP_SMC -1
163#define IRQ_PB11MP_SCTL -1
164
165#define NR_GIC_PB11MP 2
166
167/*
168 * Only define NR_IRQS if less than NR_IRQS_PB11MP
169 */
170#define NR_IRQS_PB11MP (IRQ_TC11MP_GIC_START + 96)
171
172#if defined(CONFIG_MACH_REALVIEW_PB11MP)
173
174#if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_PB11MP)
175#undef NR_IRQS
176#define NR_IRQS NR_IRQS_PB11MP
177#endif
178
179#if !defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_PB11MP)
180#undef MAX_GIC_NR
181#define MAX_GIC_NR NR_GIC_PB11MP
182#endif
183
184#endif /* CONFIG_MACH_REALVIEW_PB11MP */
185
186#endif /* __ASM_ARCH_BOARD_PB11MP_H */
diff --git a/include/asm-arm/arch-realview/debug-macro.S b/include/asm-arm/arch-realview/debug-macro.S
index f17efc65518a..c8c860c3c26e 100644
--- a/include/asm-arm/arch-realview/debug-macro.S
+++ b/include/asm-arm/arch-realview/debug-macro.S
@@ -15,7 +15,7 @@
15 mrc p15, 0, \rx, c1, c0 15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled? 16 tst \rx, #1 @ MMU enabled?
17 moveq \rx, #0x10000000 17 moveq \rx, #0x10000000
18 movne \rx, #0xf1000000 @ virtual base 18 movne \rx, #0xf0000000 @ virtual base
19 orr \rx, \rx, #0x00009000 19 orr \rx, \rx, #0x00009000
20 .endm 20 .endm
21 21
diff --git a/include/asm-arm/arch-realview/hardware.h b/include/asm-arm/arch-realview/hardware.h
index bad8d7ce9bfe..1ee8313ceb6a 100644
--- a/include/asm-arm/arch-realview/hardware.h
+++ b/include/asm-arm/arch-realview/hardware.h
@@ -25,7 +25,7 @@
25#include <asm/sizes.h> 25#include <asm/sizes.h>
26 26
27/* macro to get at IO space when running virtually */ 27/* macro to get at IO space when running virtually */
28#define IO_ADDRESS(x) ((((x) & 0x0effffff) | (((x) >> 4) & 0x0f000000)) + 0xf0000000) 28#define IO_ADDRESS(x) (((x) & 0x0fffffff) + 0xf0000000)
29#define __io_address(n) __io(IO_ADDRESS(n)) 29#define __io_address(n) __io(IO_ADDRESS(n))
30 30
31#endif 31#endif
diff --git a/include/asm-arm/arch-realview/irqs.h b/include/asm-arm/arch-realview/irqs.h
index ad0c911002fc..ccbac59235c6 100644
--- a/include/asm-arm/arch-realview/irqs.h
+++ b/include/asm-arm/arch-realview/irqs.h
@@ -23,6 +23,8 @@
23#define __ASM_ARCH_IRQS_H 23#define __ASM_ARCH_IRQS_H
24 24
25#include <asm/arch/board-eb.h> 25#include <asm/arch/board-eb.h>
26#include <asm/arch/board-pb11mp.h>
27#include <asm/arch/board-pb1176.h>
26 28
27#define IRQ_LOCALTIMER 29 29#define IRQ_LOCALTIMER 29
28#define IRQ_LOCALWDOG 30 30#define IRQ_LOCALWDOG 30
diff --git a/include/asm-arm/arch-realview/platform.h b/include/asm-arm/arch-realview/platform.h
index 4fd351b5e4a2..424c0aaf46a0 100644
--- a/include/asm-arm/arch-realview/platform.h
+++ b/include/asm-arm/arch-realview/platform.h
@@ -32,9 +32,6 @@
32#define REALVIEW_SSRAM_BASE /* REALVIEW_SSMC_BASE ? */ 32#define REALVIEW_SSRAM_BASE /* REALVIEW_SSMC_BASE ? */
33#define REALVIEW_SSRAM_SIZE SZ_2M 33#define REALVIEW_SSRAM_SIZE SZ_2M
34 34
35#define REALVIEW_FLASH_BASE 0x40000000
36#define REALVIEW_FLASH_SIZE SZ_64M
37
38/* 35/*
39 * SDRAM 36 * SDRAM
40 */ 37 */
@@ -175,42 +172,20 @@
175#define REALVIEW_INTREG_CARDINSERT 0x03 /* Signal insertion of MMC card */ 172#define REALVIEW_INTREG_CARDINSERT 0x03 /* Signal insertion of MMC card */
176 173
177/* 174/*
178 * REALVIEW peripheral addresses 175 * RealView common peripheral addresses
179 */ 176 */
180#define REALVIEW_SCTL_BASE 0x10001000 /* System controller */ 177#define REALVIEW_SCTL_BASE 0x10001000 /* System controller */
181#define REALVIEW_I2C_BASE 0x10002000 /* I2C control */ 178#define REALVIEW_I2C_BASE 0x10002000 /* I2C control */
182 /* Reserved 0x10003000 */
183#define REALVIEW_AACI_BASE 0x10004000 /* Audio */ 179#define REALVIEW_AACI_BASE 0x10004000 /* Audio */
184#define REALVIEW_MMCI0_BASE 0x10005000 /* MMC interface */ 180#define REALVIEW_MMCI0_BASE 0x10005000 /* MMC interface */
185#define REALVIEW_KMI0_BASE 0x10006000 /* KMI interface */ 181#define REALVIEW_KMI0_BASE 0x10006000 /* KMI interface */
186#define REALVIEW_KMI1_BASE 0x10007000 /* KMI 2nd interface */ 182#define REALVIEW_KMI1_BASE 0x10007000 /* KMI 2nd interface */
187#define REALVIEW_CHAR_LCD_BASE 0x10008000 /* Character LCD */ 183#define REALVIEW_CHAR_LCD_BASE 0x10008000 /* Character LCD */
188#define REALVIEW_UART0_BASE 0x10009000 /* UART 0 */
189#define REALVIEW_UART1_BASE 0x1000A000 /* UART 1 */
190#define REALVIEW_UART2_BASE 0x1000B000 /* UART 2 */
191#define REALVIEW_UART3_BASE 0x1000C000 /* UART 3 */
192#define REALVIEW_SSP_BASE 0x1000D000 /* Synchronous Serial Port */
193#define REALVIEW_SCI_BASE 0x1000E000 /* Smart card controller */ 184#define REALVIEW_SCI_BASE 0x1000E000 /* Smart card controller */
194 /* Reserved 0x1000F000 */
195#define REALVIEW_WATCHDOG_BASE 0x10010000 /* watchdog interface */
196#define REALVIEW_TIMER0_1_BASE 0x10011000 /* Timer 0 and 1 */
197#define REALVIEW_TIMER2_3_BASE 0x10012000 /* Timer 2 and 3 */
198#define REALVIEW_GPIO0_BASE 0x10013000 /* GPIO port 0 */
199#define REALVIEW_GPIO1_BASE 0x10014000 /* GPIO port 1 */ 185#define REALVIEW_GPIO1_BASE 0x10014000 /* GPIO port 1 */
200#define REALVIEW_GPIO2_BASE 0x10015000 /* GPIO port 2 */ 186#define REALVIEW_GPIO2_BASE 0x10015000 /* GPIO port 2 */
201 /* Reserved 0x10016000 */
202#define REALVIEW_RTC_BASE 0x10017000 /* Real Time Clock */
203#define REALVIEW_DMC_BASE 0x10018000 /* DMC configuration */ 187#define REALVIEW_DMC_BASE 0x10018000 /* DMC configuration */
204#define REALVIEW_PCI_CORE_BASE 0x10019000 /* PCI configuration */
205 /* Reserved 0x1001A000 - 0x1001FFFF */
206#define REALVIEW_CLCD_BASE 0x10020000 /* CLCD */
207#define REALVIEW_DMAC_BASE 0x10030000 /* DMA controller */ 188#define REALVIEW_DMAC_BASE 0x10030000 /* DMA controller */
208#define REALVIEW_GIC_CPU_BASE 0x10040000 /* Generic interrupt controller CPU interface */
209#define REALVIEW_GIC_DIST_BASE 0x10041000 /* Generic interrupt controller distributor */
210#define REALVIEW_SMC_BASE 0x10080000 /* SMC */
211 /* Reserved 0x10090000 - 0x100EFFFF */
212
213#define REALVIEW_ETH_BASE 0x4E000000 /* Ethernet */
214 189
215/* PCI space */ 190/* PCI space */
216#define REALVIEW_PCI_BASE 0x41000000 /* PCI Interface */ 191#define REALVIEW_PCI_BASE 0x41000000 /* PCI Interface */
diff --git a/include/asm-arm/arch-realview/scu.h b/include/asm-arm/arch-realview/scu.h
index 08b3db883c36..d55802d645af 100644
--- a/include/asm-arm/arch-realview/scu.h
+++ b/include/asm-arm/arch-realview/scu.h
@@ -1,8 +1,13 @@
1#ifndef __ASMARM_ARCH_SCU_H 1#ifndef __ASMARM_ARCH_SCU_H
2#define __ASMARM_ARCH_SCU_H 2#define __ASMARM_ARCH_SCU_H
3 3
4#include <asm/arch/board-eb.h> 4/*
5 5 * SCU registers
6#define SCU_BASE REALVIEW_EB11MP_SCU_BASE 6 */
7#define SCU_CTRL 0x00
8#define SCU_CONFIG 0x04
9#define SCU_CPU_STATUS 0x08
10#define SCU_INVALIDATE 0x0c
11#define SCU_FPGA_REVISION 0x10
7 12
8#endif 13#endif
diff --git a/include/asm-arm/arch-realview/uncompress.h b/include/asm-arm/arch-realview/uncompress.h
index 3d5c2db07a26..4c905d7a13a1 100644
--- a/include/asm-arm/arch-realview/uncompress.h
+++ b/include/asm-arm/arch-realview/uncompress.h
@@ -18,28 +18,50 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20#include <asm/hardware.h> 20#include <asm/hardware.h>
21#include <asm/mach-types.h>
21 22
22#include <asm/arch/platform.h> 23#include <asm/arch/board-eb.h>
24#include <asm/arch/board-pb11mp.h>
25#include <asm/arch/board-pb1176.h>
23 26
24#define AMBA_UART_DR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x00)) 27#define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00))
25#define AMBA_UART_LCRH (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x2c)) 28#define AMBA_UART_LCRH(base) (*(volatile unsigned char *)((base) + 0x2c))
26#define AMBA_UART_CR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x30)) 29#define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30))
27#define AMBA_UART_FR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x18)) 30#define AMBA_UART_FR(base) (*(volatile unsigned char *)((base) + 0x18))
31
32/*
33 * Return the UART base address
34 */
35static inline unsigned long get_uart_base(void)
36{
37 if (machine_is_realview_eb())
38 return REALVIEW_EB_UART0_BASE;
39 else if (machine_is_realview_pb11mp())
40 return REALVIEW_PB11MP_UART0_BASE;
41 else if (machine_is_realview_pb1176())
42 return REALVIEW_PB1176_UART0_BASE;
43 else
44 return 0;
45}
28 46
29/* 47/*
30 * This does not append a newline 48 * This does not append a newline
31 */ 49 */
32static inline void putc(int c) 50static inline void putc(int c)
33{ 51{
34 while (AMBA_UART_FR & (1 << 5)) 52 unsigned long base = get_uart_base();
53
54 while (AMBA_UART_FR(base) & (1 << 5))
35 barrier(); 55 barrier();
36 56
37 AMBA_UART_DR = c; 57 AMBA_UART_DR(base) = c;
38} 58}
39 59
40static inline void flush(void) 60static inline void flush(void)
41{ 61{
42 while (AMBA_UART_FR & (1 << 3)) 62 unsigned long base = get_uart_base();
63
64 while (AMBA_UART_FR(base) & (1 << 3))
43 barrier(); 65 barrier();
44} 66}
45 67
diff --git a/include/asm-arm/arch-s3c2410/regs-clock.h b/include/asm-arm/arch-s3c2410/regs-clock.h
index dba9df9d8713..ecae9e7f5e45 100644
--- a/include/asm-arm/arch-s3c2410/regs-clock.h
+++ b/include/asm-arm/arch-s3c2410/regs-clock.h
@@ -137,7 +137,7 @@ s3c2410_get_pll(unsigned int pllval, unsigned int baseclk)
137 137
138#define S3C2412_CLKDIVN_PDIVN (1<<2) 138#define S3C2412_CLKDIVN_PDIVN (1<<2)
139#define S3C2412_CLKDIVN_HDIVN_MASK (3<<0) 139#define S3C2412_CLKDIVN_HDIVN_MASK (3<<0)
140#define S3C2421_CLKDIVN_ARMDIVN (1<<3) 140#define S3C2412_CLKDIVN_ARMDIVN (1<<3)
141#define S3C2412_CLKDIVN_DVSEN (1<<4) 141#define S3C2412_CLKDIVN_DVSEN (1<<4)
142#define S3C2412_CLKDIVN_HALFHCLK (1<<5) 142#define S3C2412_CLKDIVN_HALFHCLK (1<<5)
143#define S3C2412_CLKDIVN_USB48DIV (1<<6) 143#define S3C2412_CLKDIVN_USB48DIV (1<<6)
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h
index 0ad75d716ded..497dd06e2c99 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpio.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpio.h
@@ -529,11 +529,13 @@
529#define S3C2410_GPD14_INP (0x00 << 28) 529#define S3C2410_GPD14_INP (0x00 << 28)
530#define S3C2410_GPD14_OUTP (0x01 << 28) 530#define S3C2410_GPD14_OUTP (0x01 << 28)
531#define S3C2410_GPD14_VD22 (0x02 << 28) 531#define S3C2410_GPD14_VD22 (0x02 << 28)
532#define S3C2410_GPD14_nSS1 (0x03 << 28)
532 533
533#define S3C2410_GPD15 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 15) 534#define S3C2410_GPD15 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 15)
534#define S3C2410_GPD15_INP (0x00 << 30) 535#define S3C2410_GPD15_INP (0x00 << 30)
535#define S3C2410_GPD15_OUTP (0x01 << 30) 536#define S3C2410_GPD15_OUTP (0x01 << 30)
536#define S3C2410_GPD15_VD23 (0x02 << 30) 537#define S3C2410_GPD15_VD23 (0x02 << 30)
538#define S3C2410_GPD15_nSS0 (0x03 << 30)
537 539
538#define S3C2410_GPD_PUPDIS(x) (1<<(x)) 540#define S3C2410_GPD_PUPDIS(x) (1<<(x))
539 541
@@ -801,12 +803,14 @@
801#define S3C2410_GPG2_INP (0x00 << 4) 803#define S3C2410_GPG2_INP (0x00 << 4)
802#define S3C2410_GPG2_OUTP (0x01 << 4) 804#define S3C2410_GPG2_OUTP (0x01 << 4)
803#define S3C2410_GPG2_EINT10 (0x02 << 4) 805#define S3C2410_GPG2_EINT10 (0x02 << 4)
806#define S3C2410_GPG2_nSS0 (0x03 << 4)
804#define S3C2400_GPG2_CDCLK (0x02 << 4) 807#define S3C2400_GPG2_CDCLK (0x02 << 4)
805 808
806#define S3C2410_GPG3 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 3) 809#define S3C2410_GPG3 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 3)
807#define S3C2410_GPG3_INP (0x00 << 6) 810#define S3C2410_GPG3_INP (0x00 << 6)
808#define S3C2410_GPG3_OUTP (0x01 << 6) 811#define S3C2410_GPG3_OUTP (0x01 << 6)
809#define S3C2410_GPG3_EINT11 (0x02 << 6) 812#define S3C2410_GPG3_EINT11 (0x02 << 6)
813#define S3C2410_GPG3_nSS1 (0x03 << 6)
810#define S3C2400_GPG3_I2SSDO (0x02 << 6) 814#define S3C2400_GPG3_I2SSDO (0x02 << 6)
811#define S3C2400_GPG3_I2SSDI (0x03 << 6) 815#define S3C2400_GPG3_I2SSDI (0x03 << 6)
812 816
diff --git a/include/asm-arm/arch-s3c2410/regs-s3c2412-mem.h b/include/asm-arm/arch-s3c2410/regs-s3c2412-mem.h
new file mode 100644
index 000000000000..c8c793e78936
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-s3c2412-mem.h
@@ -0,0 +1,29 @@
1/* linux/include/asm-arm/arch-s3c2410/regs-s3c2412-mem.h
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * S3C2412 memory register definitions
12*/
13
14#ifndef __ASM_ARM_REGS_S3C2412_MEM
15#define __ASM_ARM_REGS_S3C2412_MEM
16
17#ifndef S3C2412_MEMREG
18#define S3C2412_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x))
19#endif
20
21#define S3C2412_BANKCFG S3C2412_MEMREG(0x00)
22#define S3C2412_BANKCON1 S3C2412_MEMREG(0x04)
23#define S3C2412_BANKCON2 S3C2412_MEMREG(0x08)
24#define S3C2412_BANKCON3 S3C2412_MEMREG(0x0C)
25
26#define S3C2412_REFRESH S3C2412_MEMREG(0x10)
27#define S3C2412_TIMEOUT S3C2412_MEMREG(0x14)
28
29#endif /* __ASM_ARM_REGS_S3C2412_MEM */
diff --git a/include/asm-arm/arch-s3c2410/system-reset.h b/include/asm-arm/arch-s3c2410/system-reset.h
new file mode 100644
index 000000000000..1615bce0c026
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/system-reset.h
@@ -0,0 +1,64 @@
1/* linux/include/asm-arm/arch-s3c2410/system-reset.h
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - System define for arch_reset() function
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <asm/hardware.h>
14#include <asm/io.h>
15
16#include <asm/plat-s3c/regs-watchdog.h>
17#include <asm/arch/regs-clock.h>
18
19#include <linux/clk.h>
20#include <linux/err.h>
21
22extern void (*s3c24xx_reset_hook)(void);
23
24static void
25arch_reset(char mode)
26{
27 struct clk *wdtclk;
28
29 if (mode == 's') {
30 cpu_reset(0);
31 }
32
33 if (s3c24xx_reset_hook)
34 s3c24xx_reset_hook();
35
36 printk("arch_reset: attempting watchdog reset\n");
37
38 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */
39
40 wdtclk = clk_get(NULL, "watchdog");
41 if (!IS_ERR(wdtclk)) {
42 clk_enable(wdtclk);
43 } else
44 printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__);
45
46 /* put initial values into count and data */
47 __raw_writel(0x80, S3C2410_WTCNT);
48 __raw_writel(0x80, S3C2410_WTDAT);
49
50 /* set the watchdog to go and reset... */
51 __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN |
52 S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON);
53
54 /* wait for reset to assert... */
55 mdelay(500);
56
57 printk(KERN_ERR "Watchdog reset failed to assert reset\n");
58
59 /* delay to allow the serial port to show the message */
60 mdelay(50);
61
62 /* we'll take a jump through zero as a poor second */
63 cpu_reset(0);
64}
diff --git a/include/asm-arm/arch-s3c2410/system.h b/include/asm-arm/arch-s3c2410/system.h
index 14de4e596f87..ad258085e53b 100644
--- a/include/asm-arm/arch-s3c2410/system.h
+++ b/include/asm-arm/arch-s3c2410/system.h
@@ -17,12 +17,8 @@
17#include <asm/arch/idle.h> 17#include <asm/arch/idle.h>
18#include <asm/arch/reset.h> 18#include <asm/arch/reset.h>
19 19
20#include <asm/plat-s3c/regs-watchdog.h>
21#include <asm/arch/regs-clock.h> 20#include <asm/arch/regs-clock.h>
22 21
23#include <linux/clk.h>
24#include <linux/err.h>
25
26void (*s3c24xx_idle)(void); 22void (*s3c24xx_idle)(void);
27void (*s3c24xx_reset_hook)(void); 23void (*s3c24xx_reset_hook)(void);
28 24
@@ -59,44 +55,4 @@ static void arch_idle(void)
59 s3c24xx_default_idle(); 55 s3c24xx_default_idle();
60} 56}
61 57
62static void 58#include <asm/arch/system-reset.h>
63arch_reset(char mode)
64{
65 struct clk *wdtclk;
66
67 if (mode == 's') {
68 cpu_reset(0);
69 }
70
71 if (s3c24xx_reset_hook)
72 s3c24xx_reset_hook();
73
74 printk("arch_reset: attempting watchdog reset\n");
75
76 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */
77
78 wdtclk = clk_get(NULL, "watchdog");
79 if (!IS_ERR(wdtclk)) {
80 clk_enable(wdtclk);
81 } else
82 printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__);
83
84 /* put initial values into count and data */
85 __raw_writel(0x80, S3C2410_WTCNT);
86 __raw_writel(0x80, S3C2410_WTDAT);
87
88 /* set the watchdog to go and reset... */
89 __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN |
90 S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON);
91
92 /* wait for reset to assert... */
93 mdelay(500);
94
95 printk(KERN_ERR "Watchdog reset failed to assert reset\n");
96
97 /* delay to allow the serial port to show the message */
98 mdelay(50);
99
100 /* we'll take a jump through zero as a poor second */
101 cpu_reset(0);
102}
diff --git a/include/asm-arm/arch-sa1100/gpio.h b/include/asm-arm/arch-sa1100/gpio.h
index e7a9d26e22a8..93d3395b102d 100644
--- a/include/asm-arm/arch-sa1100/gpio.h
+++ b/include/asm-arm/arch-sa1100/gpio.h
@@ -26,35 +26,28 @@
26 26
27#include <asm/hardware.h> 27#include <asm/hardware.h>
28#include <asm/irq.h> 28#include <asm/irq.h>
29 29#include <asm-generic/gpio.h>
30static inline int gpio_request(unsigned gpio, const char *label)
31{
32 return 0;
33}
34
35static inline void gpio_free(unsigned gpio)
36{
37 return;
38}
39
40extern int gpio_direction_input(unsigned gpio);
41extern int gpio_direction_output(unsigned gpio, int value);
42
43 30
44static inline int gpio_get_value(unsigned gpio) 31static inline int gpio_get_value(unsigned gpio)
45{ 32{
46 return GPLR & GPIO_GPIO(gpio); 33 if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
34 return GPLR & GPIO_GPIO(gpio);
35 else
36 return __gpio_get_value(gpio);
47} 37}
48 38
49static inline void gpio_set_value(unsigned gpio, int value) 39static inline void gpio_set_value(unsigned gpio, int value)
50{ 40{
51 if (value) 41 if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
52 GPSR = GPIO_GPIO(gpio); 42 if (value)
43 GPSR = GPIO_GPIO(gpio);
44 else
45 GPCR = GPIO_GPIO(gpio);
53 else 46 else
54 GPCR = GPIO_GPIO(gpio); 47 __gpio_set_value(gpio, value);
55} 48}
56 49
57#include <asm-generic/gpio.h> /* cansleep wrappers */ 50#define gpio_cansleep __gpio_cansleep
58 51
59static inline unsigned gpio_to_irq(unsigned gpio) 52static inline unsigned gpio_to_irq(unsigned gpio)
60{ 53{
diff --git a/include/asm-arm/cpu-multi32.h b/include/asm-arm/cpu-multi32.h
index 715e18a4add1..3479de9266e5 100644
--- a/include/asm-arm/cpu-multi32.h
+++ b/include/asm-arm/cpu-multi32.h
@@ -21,6 +21,10 @@ extern struct processor {
21 */ 21 */
22 void (*_data_abort)(unsigned long pc); 22 void (*_data_abort)(unsigned long pc);
23 /* 23 /*
24 * Retrieve prefetch fault address
25 */
26 unsigned long (*_prefetch_abort)(unsigned long lr);
27 /*
24 * Set up any processor specifics 28 * Set up any processor specifics
25 */ 29 */
26 void (*_proc_init)(void); 30 void (*_proc_init)(void);
diff --git a/include/asm-arm/glue.h b/include/asm-arm/glue.h
index 22274ce81375..a97a182ba287 100644
--- a/include/asm-arm/glue.h
+++ b/include/asm-arm/glue.h
@@ -40,83 +40,110 @@
40 * v6_early - ARMv6 generic early abort handler 40 * v6_early - ARMv6 generic early abort handler
41 * v7_early - ARMv7 generic early abort handler 41 * v7_early - ARMv7 generic early abort handler
42 */ 42 */
43#undef CPU_ABORT_HANDLER 43#undef CPU_DABORT_HANDLER
44#undef MULTI_ABORT 44#undef MULTI_DABORT
45 45
46#if defined(CONFIG_CPU_ARM610) 46#if defined(CONFIG_CPU_ARM610)
47# ifdef CPU_ABORT_HANDLER 47# ifdef CPU_DABORT_HANDLER
48# define MULTI_ABORT 1 48# define MULTI_DABORT 1
49# else 49# else
50# define CPU_ABORT_HANDLER cpu_arm6_data_abort 50# define CPU_DABORT_HANDLER cpu_arm6_data_abort
51# endif 51# endif
52#endif 52#endif
53 53
54#if defined(CONFIG_CPU_ARM710) 54#if defined(CONFIG_CPU_ARM710)
55# ifdef CPU_ABORT_HANDLER 55# ifdef CPU_DABORT_HANDLER
56# define MULTI_ABORT 1 56# define MULTI_DABORT 1
57# else 57# else
58# define CPU_ABORT_HANDLER cpu_arm7_data_abort 58# define CPU_DABORT_HANDLER cpu_arm7_data_abort
59# endif 59# endif
60#endif 60#endif
61 61
62#ifdef CONFIG_CPU_ABRT_LV4T 62#ifdef CONFIG_CPU_ABRT_LV4T
63# ifdef CPU_ABORT_HANDLER 63# ifdef CPU_DABORT_HANDLER
64# define MULTI_ABORT 1 64# define MULTI_DABORT 1
65# else 65# else
66# define CPU_ABORT_HANDLER v4t_late_abort 66# define CPU_DABORT_HANDLER v4t_late_abort
67# endif 67# endif
68#endif 68#endif
69 69
70#ifdef CONFIG_CPU_ABRT_EV4 70#ifdef CONFIG_CPU_ABRT_EV4
71# ifdef CPU_ABORT_HANDLER 71# ifdef CPU_DABORT_HANDLER
72# define MULTI_ABORT 1 72# define MULTI_DABORT 1
73# else 73# else
74# define CPU_ABORT_HANDLER v4_early_abort 74# define CPU_DABORT_HANDLER v4_early_abort
75# endif 75# endif
76#endif 76#endif
77 77
78#ifdef CONFIG_CPU_ABRT_EV4T 78#ifdef CONFIG_CPU_ABRT_EV4T
79# ifdef CPU_ABORT_HANDLER 79# ifdef CPU_DABORT_HANDLER
80# define MULTI_ABORT 1 80# define MULTI_DABORT 1
81# else 81# else
82# define CPU_ABORT_HANDLER v4t_early_abort 82# define CPU_DABORT_HANDLER v4t_early_abort
83# endif 83# endif
84#endif 84#endif
85 85
86#ifdef CONFIG_CPU_ABRT_EV5TJ 86#ifdef CONFIG_CPU_ABRT_EV5TJ
87# ifdef CPU_ABORT_HANDLER 87# ifdef CPU_DABORT_HANDLER
88# define MULTI_ABORT 1 88# define MULTI_DABORT 1
89# else 89# else
90# define CPU_ABORT_HANDLER v5tj_early_abort 90# define CPU_DABORT_HANDLER v5tj_early_abort
91# endif 91# endif
92#endif 92#endif
93 93
94#ifdef CONFIG_CPU_ABRT_EV5T 94#ifdef CONFIG_CPU_ABRT_EV5T
95# ifdef CPU_ABORT_HANDLER 95# ifdef CPU_DABORT_HANDLER
96# define MULTI_ABORT 1 96# define MULTI_DABORT 1
97# else 97# else
98# define CPU_ABORT_HANDLER v5t_early_abort 98# define CPU_DABORT_HANDLER v5t_early_abort
99# endif 99# endif
100#endif 100#endif
101 101
102#ifdef CONFIG_CPU_ABRT_EV6 102#ifdef CONFIG_CPU_ABRT_EV6
103# ifdef CPU_ABORT_HANDLER 103# ifdef CPU_DABORT_HANDLER
104# define MULTI_ABORT 1 104# define MULTI_DABORT 1
105# else 105# else
106# define CPU_ABORT_HANDLER v6_early_abort 106# define CPU_DABORT_HANDLER v6_early_abort
107# endif 107# endif
108#endif 108#endif
109 109
110#ifdef CONFIG_CPU_ABRT_EV7 110#ifdef CONFIG_CPU_ABRT_EV7
111# ifdef CPU_ABORT_HANDLER 111# ifdef CPU_DABORT_HANDLER
112# define MULTI_ABORT 1 112# define MULTI_DABORT 1
113# else 113# else
114# define CPU_ABORT_HANDLER v7_early_abort 114# define CPU_DABORT_HANDLER v7_early_abort
115# endif 115# endif
116#endif 116#endif
117 117
118#ifndef CPU_ABORT_HANDLER 118#ifndef CPU_DABORT_HANDLER
119#error Unknown data abort handler type 119#error Unknown data abort handler type
120#endif 120#endif
121 121
122/*
123 * Prefetch abort handler. If the CPU has an IFAR use that, otherwise
124 * use the address of the aborted instruction
125 */
126#undef CPU_PABORT_HANDLER
127#undef MULTI_PABORT
128
129#ifdef CONFIG_CPU_PABRT_IFAR
130# ifdef CPU_PABORT_HANDLER
131# define MULTI_PABORT 1
132# else
133# define CPU_PABORT_HANDLER(reg, insn) mrc p15, 0, reg, cr6, cr0, 2
134# endif
135#endif
136
137#ifdef CONFIG_CPU_PABRT_NOIFAR
138# ifdef CPU_PABORT_HANDLER
139# define MULTI_PABORT 1
140# else
141# define CPU_PABORT_HANDLER(reg, insn) mov reg, insn
142# endif
143#endif
144
145#ifndef CPU_PABORT_HANDLER
146#error Unknown prefetch abort handler type
147#endif
148
122#endif 149#endif
diff --git a/include/asm-arm/hardware/arm_scu.h b/include/asm-arm/hardware/arm_scu.h
deleted file mode 100644
index 7d28eb5a1758..000000000000
--- a/include/asm-arm/hardware/arm_scu.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef ASMARM_HARDWARE_ARM_SCU_H
2#define ASMARM_HARDWARE_ARM_SCU_H
3
4#include <asm/arch/scu.h>
5
6/*
7 * SCU registers
8 */
9#define SCU_CTRL 0x00
10#define SCU_CONFIG 0x04
11#define SCU_CPU_STATUS 0x08
12#define SCU_INVALIDATE 0x0c
13#define SCU_FPGA_REVISION 0x10
14
15#endif
diff --git a/include/asm-arm/hardware/iop3xx-adma.h b/include/asm-arm/hardware/iop3xx-adma.h
index 84d635b0a71a..a32b86ac62aa 100644
--- a/include/asm-arm/hardware/iop3xx-adma.h
+++ b/include/asm-arm/hardware/iop3xx-adma.h
@@ -260,7 +260,7 @@ static inline int iop_chan_memset_slot_count(size_t len, int *slots_per_op)
260static inline int iop3xx_aau_xor_slot_count(size_t len, int src_cnt, 260static inline int iop3xx_aau_xor_slot_count(size_t len, int src_cnt,
261 int *slots_per_op) 261 int *slots_per_op)
262{ 262{
263 const static int slot_count_table[] = { 0, 263 static const int slot_count_table[] = { 0,
264 1, 1, 1, 1, /* 01 - 04 */ 264 1, 1, 1, 1, /* 01 - 04 */
265 2, 2, 2, 2, /* 05 - 08 */ 265 2, 2, 2, 2, /* 05 - 08 */
266 4, 4, 4, 4, /* 09 - 12 */ 266 4, 4, 4, 4, /* 09 - 12 */
@@ -369,7 +369,7 @@ static inline u32 iop_desc_get_byte_count(struct iop_adma_desc_slot *desc,
369/* translate the src_idx to a descriptor word index */ 369/* translate the src_idx to a descriptor word index */
370static inline int __desc_idx(int src_idx) 370static inline int __desc_idx(int src_idx)
371{ 371{
372 const static int desc_idx_table[] = { 0, 0, 0, 0, 372 static const int desc_idx_table[] = { 0, 0, 0, 0,
373 0, 1, 2, 3, 373 0, 1, 2, 3,
374 5, 6, 7, 8, 374 5, 6, 7, 8,
375 9, 10, 11, 12, 375 9, 10, 11, 12,
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h
index ede377ec9147..18f6937f5010 100644
--- a/include/asm-arm/hardware/iop3xx.h
+++ b/include/asm-arm/hardware/iop3xx.h
@@ -29,6 +29,7 @@ extern void gpio_line_config(int line, int direction);
29extern int gpio_line_get(int line); 29extern int gpio_line_get(int line);
30extern void gpio_line_set(int line, int value); 30extern void gpio_line_set(int line, int value);
31extern int init_atu; 31extern int init_atu;
32extern int iop3xx_get_init_atu(void);
32#endif 33#endif
33 34
34 35
@@ -112,14 +113,6 @@ extern int init_atu;
112#define IOP3XX_INIT_ATU_DISABLE -1 113#define IOP3XX_INIT_ATU_DISABLE -1
113#define IOP3XX_INIT_ATU_ENABLE 1 114#define IOP3XX_INIT_ATU_ENABLE 1
114 115
115#ifdef CONFIG_IOP3XX_ATU
116#define iop3xx_get_init_atu(x) (init_atu == IOP3XX_INIT_ATU_DEFAULT ?\
117 IOP3XX_INIT_ATU_ENABLE : init_atu)
118#else
119#define iop3xx_get_init_atu(x) (init_atu == IOP3XX_INIT_ATU_DEFAULT ?\
120 IOP3XX_INIT_ATU_DISABLE : init_atu)
121#endif
122
123/* Messaging Unit */ 116/* Messaging Unit */
124#define IOP3XX_IMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0310) 117#define IOP3XX_IMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0310)
125#define IOP3XX_IMR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0314) 118#define IOP3XX_IMR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0314)
diff --git a/include/asm-arm/hardware/scoop.h b/include/asm-arm/hardware/scoop.h
index d37bf7443264..dfb8330599f9 100644
--- a/include/asm-arm/hardware/scoop.h
+++ b/include/asm-arm/hardware/scoop.h
@@ -40,6 +40,7 @@ struct scoop_config {
40 unsigned short io_dir; 40 unsigned short io_dir;
41 unsigned short suspend_clr; 41 unsigned short suspend_clr;
42 unsigned short suspend_set; 42 unsigned short suspend_set;
43 int gpio_base;
43}; 44};
44 45
45/* Structure for linking scoop devices to PCMCIA sockets */ 46/* Structure for linking scoop devices to PCMCIA sockets */
@@ -62,7 +63,7 @@ struct scoop_pcmcia_config {
62extern struct scoop_pcmcia_config *platform_scoop_config; 63extern struct scoop_pcmcia_config *platform_scoop_config;
63 64
64void reset_scoop(struct device *dev); 65void reset_scoop(struct device *dev);
65unsigned short set_scoop_gpio(struct device *dev, unsigned short bit); 66unsigned short __deprecated set_scoop_gpio(struct device *dev, unsigned short bit);
66unsigned short reset_scoop_gpio(struct device *dev, unsigned short bit); 67unsigned short __deprecated reset_scoop_gpio(struct device *dev, unsigned short bit);
67unsigned short read_scoop_reg(struct device *dev, unsigned short reg); 68unsigned short read_scoop_reg(struct device *dev, unsigned short reg);
68void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data); 69void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data);
diff --git a/include/asm-arm/hwcap.h b/include/asm-arm/hwcap.h
index 01a1391d3014..81f4c899a555 100644
--- a/include/asm-arm/hwcap.h
+++ b/include/asm-arm/hwcap.h
@@ -15,6 +15,7 @@
15#define HWCAP_JAVA 256 15#define HWCAP_JAVA 256
16#define HWCAP_IWMMXT 512 16#define HWCAP_IWMMXT 512
17#define HWCAP_CRUNCH 1024 17#define HWCAP_CRUNCH 1024
18#define HWCAP_THUMBEE 2048
18 19
19#if defined(__KERNEL__) && !defined(__ASSEMBLY__) 20#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
20/* 21/*
diff --git a/include/asm-arm/mach/pci.h b/include/asm-arm/mach/pci.h
index 24621c49a0c7..9d4f6b5ea419 100644
--- a/include/asm-arm/mach/pci.h
+++ b/include/asm-arm/mach/pci.h
@@ -55,6 +55,7 @@ void pci_common_init(struct hw_pci *);
55extern int iop3xx_pci_setup(int nr, struct pci_sys_data *); 55extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
56extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *); 56extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *);
57extern void iop3xx_pci_preinit(void); 57extern void iop3xx_pci_preinit(void);
58extern void iop3xx_pci_preinit_cond(void);
58 59
59extern int dc21285_setup(int nr, struct pci_sys_data *); 60extern int dc21285_setup(int nr, struct pci_sys_data *);
60extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *); 61extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *);
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
index d9bfb39adabf..9ba4d7136e6b 100644
--- a/include/asm-arm/memory.h
+++ b/include/asm-arm/memory.h
@@ -217,7 +217,10 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
217#ifndef CONFIG_DISCONTIGMEM 217#ifndef CONFIG_DISCONTIGMEM
218 218
219#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET 219#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET
220
221#ifndef CONFIG_SPARSEMEM
220#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr)) 222#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))
223#endif
221 224
222#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 225#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
223#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) 226#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
diff --git a/include/asm-arm/plat-orion/ehci-orion.h b/include/asm-arm/plat-orion/ehci-orion.h
new file mode 100644
index 000000000000..785705651e24
--- /dev/null
+++ b/include/asm-arm/plat-orion/ehci-orion.h
@@ -0,0 +1,19 @@
1/*
2 * include/asm-arm/plat-orion/ehci-orion.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_PLAT_ORION_EHCI_ORION_H
10#define __ASM_PLAT_ORION_EHCI_ORION_H
11
12#include <linux/mbus.h>
13
14struct orion_ehci_data {
15 struct mbus_dram_target_info *dram;
16};
17
18
19#endif
diff --git a/include/asm-arm/plat-orion/irq.h b/include/asm-arm/plat-orion/irq.h
new file mode 100644
index 000000000000..94aeed919d5b
--- /dev/null
+++ b/include/asm-arm/plat-orion/irq.h
@@ -0,0 +1,17 @@
1/*
2 * include/asm-arm/plat-orion/irq.h
3 *
4 * Marvell Orion SoC IRQ handling.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ASM_PLAT_ORION_IRQ_H
12#define __ASM_PLAT_ORION_IRQ_H
13
14void orion_irq_init(unsigned int irq_start, void __iomem *maskaddr);
15
16
17#endif
diff --git a/include/asm-arm/arch-orion/platform.h b/include/asm-arm/plat-orion/orion_nand.h
index 143c38e2fa0b..ffd3852a0dd7 100644
--- a/include/asm-arm/arch-orion/platform.h
+++ b/include/asm-arm/plat-orion/orion_nand.h
@@ -1,15 +1,13 @@
1/* 1/*
2 * asm-arm/arch-orion/platform.h 2 * include/asm-arm/plat-orion/orion_nand.h
3 *
4 * Tzachi Perelstein <tzachi@marvell.com>
5 * 3 *
6 * This file is licensed under the terms of the GNU General Public 4 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any 5 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 6 * warranty of any kind, whether express or implied.
9 */ 7 */
10 8
11#ifndef __ASM_ARCH_PLATFORM_H__ 9#ifndef __ASM_PLAT_ORION_ORION_NAND_H
12#define __ASM_ARCH_PLATFORM_H__ 10#define __ASM_PLAT_ORION_ORION_NAND_H
13 11
14/* 12/*
15 * Device bus NAND private data 13 * Device bus NAND private data
@@ -22,4 +20,5 @@ struct orion_nand_data {
22 u8 width; /* buswidth */ 20 u8 width; /* buswidth */
23}; 21};
24 22
23
25#endif 24#endif
diff --git a/include/asm-arm/plat-orion/pcie.h b/include/asm-arm/plat-orion/pcie.h
new file mode 100644
index 000000000000..6434ac685d21
--- /dev/null
+++ b/include/asm-arm/plat-orion/pcie.h
@@ -0,0 +1,31 @@
1/*
2 * include/asm-arm/plat-orion/pcie.h
3 *
4 * Marvell Orion SoC PCIe handling.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ASM_PLAT_ORION_PCIE_H
12#define __ASM_PLAT_ORION_PCIE_H
13
14u32 orion_pcie_dev_id(void __iomem *base);
15u32 orion_pcie_rev(void __iomem *base);
16int orion_pcie_link_up(void __iomem *base);
17int orion_pcie_get_local_bus_nr(void __iomem *base);
18void orion_pcie_set_local_bus_nr(void __iomem *base, int nr);
19void orion_pcie_setup(void __iomem *base,
20 struct mbus_dram_target_info *dram);
21int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus,
22 u32 devfn, int where, int size, u32 *val);
23int orion_pcie_rd_conf_tlp(void __iomem *base, struct pci_bus *bus,
24 u32 devfn, int where, int size, u32 *val);
25int orion_pcie_rd_conf_wa(void __iomem *wa_base, struct pci_bus *bus,
26 u32 devfn, int where, int size, u32 *val);
27int orion_pcie_wr_conf(void __iomem *base, struct pci_bus *bus,
28 u32 devfn, int where, int size, u32 val);
29
30
31#endif
diff --git a/include/asm-arm/plat-orion/time.h b/include/asm-arm/plat-orion/time.h
new file mode 100644
index 000000000000..0e85cc8f44d9
--- /dev/null
+++ b/include/asm-arm/plat-orion/time.h
@@ -0,0 +1,17 @@
1/*
2 * include/asm-arm/plat-orion/time.h
3 *
4 * Marvell Orion SoC time handling.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ASM_PLAT_ORION_TIME_H
12#define __ASM_PLAT_ORION_TIME_H
13
14void orion_time_init(unsigned int irq, unsigned int tclk);
15
16
17#endif
diff --git a/include/asm-arm/sparsemem.h b/include/asm-arm/sparsemem.h
new file mode 100644
index 000000000000..277158191a0d
--- /dev/null
+++ b/include/asm-arm/sparsemem.h
@@ -0,0 +1,10 @@
1#ifndef ASMARM_SPARSEMEM_H
2#define ASMARM_SPARSEMEM_H
3
4#include <asm/memory.h>
5
6#define MAX_PHYSADDR_BITS 32
7#define MAX_PHYSMEM_BITS 32
8#define SECTION_SIZE_BITS NODE_MEM_SIZE_BITS
9
10#endif
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
index 41784357a204..f5a664786311 100644
--- a/include/asm-arm/thread_info.h
+++ b/include/asm-arm/thread_info.h
@@ -62,6 +62,9 @@ struct thread_info {
62 struct crunch_state crunchstate; 62 struct crunch_state crunchstate;
63 union fp_state fpstate __attribute__((aligned(8))); 63 union fp_state fpstate __attribute__((aligned(8)));
64 union vfp_state vfpstate; 64 union vfp_state vfpstate;
65#ifdef CONFIG_ARM_THUMBEE
66 unsigned long thumbee_state; /* ThumbEE Handler Base register */
67#endif
65 struct restart_block restart_block; 68 struct restart_block restart_block;
66}; 69};
67 70
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index 88e868b7aae0..7c570082b1e0 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -376,9 +376,11 @@
376#define __NR_kexec_load (__NR_SYSCALL_BASE+347) 376#define __NR_kexec_load (__NR_SYSCALL_BASE+347)
377#define __NR_utimensat (__NR_SYSCALL_BASE+348) 377#define __NR_utimensat (__NR_SYSCALL_BASE+348)
378#define __NR_signalfd (__NR_SYSCALL_BASE+349) 378#define __NR_signalfd (__NR_SYSCALL_BASE+349)
379#define __NR_timerfd (__NR_SYSCALL_BASE+350) 379#define __NR_timerfd_create (__NR_SYSCALL_BASE+350)
380#define __NR_eventfd (__NR_SYSCALL_BASE+351) 380#define __NR_eventfd (__NR_SYSCALL_BASE+351)
381#define __NR_fallocate (__NR_SYSCALL_BASE+352) 381#define __NR_fallocate (__NR_SYSCALL_BASE+352)
382#define __NR_timerfd_settime (__NR_SYSCALL_BASE+353)
383#define __NR_timerfd_gettime (__NR_SYSCALL_BASE+354)
382 384
383/* 385/*
384 * The following SWIs are ARM private. 386 * The following SWIs are ARM private.
diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h
index 7597b0bd2f01..a4e2d28bfb58 100644
--- a/include/asm-avr32/arch-at32ap/board.h
+++ b/include/asm-avr32/arch-at32ap/board.h
@@ -38,9 +38,7 @@ struct platform_device *
38at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, 38at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data,
39 unsigned long fbmem_start, unsigned long fbmem_len); 39 unsigned long fbmem_start, unsigned long fbmem_len);
40 40
41struct usba_platform_data { 41struct usba_platform_data;
42 int vbus_pin;
43};
44struct platform_device * 42struct platform_device *
45at32_add_device_usba(unsigned int id, struct usba_platform_data *data); 43at32_add_device_usba(unsigned int id, struct usba_platform_data *data);
46 44
@@ -68,7 +66,10 @@ struct platform_device *at32_add_device_pwm(u32 mask);
68struct platform_device * 66struct platform_device *
69at32_add_device_ssc(unsigned int id, unsigned int flags); 67at32_add_device_ssc(unsigned int id, unsigned int flags);
70 68
71struct platform_device *at32_add_device_twi(unsigned int id); 69struct i2c_board_info;
70struct platform_device *at32_add_device_twi(unsigned int id,
71 struct i2c_board_info *b,
72 unsigned int n);
72struct platform_device *at32_add_device_mci(unsigned int id); 73struct platform_device *at32_add_device_mci(unsigned int id);
73struct platform_device *at32_add_device_ac97c(unsigned int id); 74struct platform_device *at32_add_device_ac97c(unsigned int id);
74struct platform_device *at32_add_device_abdac(unsigned int id); 75struct platform_device *at32_add_device_abdac(unsigned int id);
diff --git a/include/asm-avr32/arch-at32ap/pm.h b/include/asm-avr32/arch-at32ap/pm.h
new file mode 100644
index 000000000000..356e43064903
--- /dev/null
+++ b/include/asm-avr32/arch-at32ap/pm.h
@@ -0,0 +1,48 @@
1/*
2 * AVR32 AP Power Management.
3 *
4 * Copyright (C) 2008 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_AVR32_ARCH_PM_H
11#define __ASM_AVR32_ARCH_PM_H
12
13/* Possible arguments to the "sleep" instruction */
14#define CPU_SLEEP_IDLE 0
15#define CPU_SLEEP_FROZEN 1
16#define CPU_SLEEP_STANDBY 2
17#define CPU_SLEEP_STOP 3
18#define CPU_SLEEP_STATIC 5
19
20#ifndef __ASSEMBLY__
21extern void cpu_enter_idle(void);
22
23extern bool disable_idle_sleep;
24
25static inline void cpu_disable_idle_sleep(void)
26{
27 disable_idle_sleep = true;
28}
29
30static inline void cpu_enable_idle_sleep(void)
31{
32 disable_idle_sleep = false;
33}
34
35static inline void cpu_idle_sleep(void)
36{
37 /*
38 * If we're using the COUNT and COMPARE registers for
39 * timekeeping, we can't use the IDLE state.
40 */
41 if (disable_idle_sleep)
42 cpu_relax();
43 else
44 cpu_enter_idle();
45}
46#endif
47
48#endif /* __ASM_AVR32_ARCH_PM_H */
diff --git a/include/asm-avr32/arch-at32ap/time.h b/include/asm-avr32/arch-at32ap/time.h
deleted file mode 100644
index cc8a43418a4d..000000000000
--- a/include/asm-avr32/arch-at32ap/time.h
+++ /dev/null
@@ -1,112 +0,0 @@
1/*
2 * Copyright (C) 2007 Atmel Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef _ASM_AVR32_ARCH_AT32AP_TIME_H
10#define _ASM_AVR32_ARCH_AT32AP_TIME_H
11
12#include <linux/platform_device.h>
13
14extern struct irqaction timer_irqaction;
15extern struct platform_device at32_systc0_device;
16extern void local_timer_interrupt(int irq, void *dev_id);
17
18#define TIMER_BCR 0x000000c0
19#define TIMER_BCR_SYNC 0
20#define TIMER_BMR 0x000000c4
21#define TIMER_BMR_TC0XC0S 0
22#define TIMER_BMR_TC1XC1S 2
23#define TIMER_BMR_TC2XC2S 4
24#define TIMER_CCR 0x00000000
25#define TIMER_CCR_CLKDIS 1
26#define TIMER_CCR_CLKEN 0
27#define TIMER_CCR_SWTRG 2
28#define TIMER_CMR 0x00000004
29#define TIMER_CMR_ABETRG 10
30#define TIMER_CMR_ACPA 16
31#define TIMER_CMR_ACPC 18
32#define TIMER_CMR_AEEVT 20
33#define TIMER_CMR_ASWTRG 22
34#define TIMER_CMR_BCPB 24
35#define TIMER_CMR_BCPC 26
36#define TIMER_CMR_BEEVT 28
37#define TIMER_CMR_BSWTRG 30
38#define TIMER_CMR_BURST 4
39#define TIMER_CMR_CLKI 3
40#define TIMER_CMR_CPCDIS 7
41#define TIMER_CMR_CPCSTOP 6
42#define TIMER_CMR_CPCTRG 14
43#define TIMER_CMR_EEVT 10
44#define TIMER_CMR_EEVTEDG 8
45#define TIMER_CMR_ENETRG 12
46#define TIMER_CMR_ETRGEDG 8
47#define TIMER_CMR_LDBDIS 7
48#define TIMER_CMR_LDBSTOP 6
49#define TIMER_CMR_LDRA 16
50#define TIMER_CMR_LDRB 18
51#define TIMER_CMR_TCCLKS 0
52#define TIMER_CMR_WAVE 15
53#define TIMER_CMR_WAVSEL 13
54#define TIMER_CV 0x00000010
55#define TIMER_CV_CV 0
56#define TIMER_IDR 0x00000028
57#define TIMER_IDR_COVFS 0
58#define TIMER_IDR_CPAS 2
59#define TIMER_IDR_CPBS 3
60#define TIMER_IDR_CPCS 4
61#define TIMER_IDR_ETRGS 7
62#define TIMER_IDR_LDRAS 5
63#define TIMER_IDR_LDRBS 6
64#define TIMER_IDR_LOVRS 1
65#define TIMER_IER 0x00000024
66#define TIMER_IER_COVFS 0
67#define TIMER_IER_CPAS 2
68#define TIMER_IER_CPBS 3
69#define TIMER_IER_CPCS 4
70#define TIMER_IER_ETRGS 7
71#define TIMER_IER_LDRAS 5
72#define TIMER_IER_LDRBS 6
73#define TIMER_IER_LOVRS 1
74#define TIMER_IMR 0x0000002c
75#define TIMER_IMR_COVFS 0
76#define TIMER_IMR_CPAS 2
77#define TIMER_IMR_CPBS 3
78#define TIMER_IMR_CPCS 4
79#define TIMER_IMR_ETRGS 7
80#define TIMER_IMR_LDRAS 5
81#define TIMER_IMR_LDRBS 6
82#define TIMER_IMR_LOVRS 1
83#define TIMER_RA 0x00000014
84#define TIMER_RA_RA 0
85#define TIMER_RB 0x00000018
86#define TIMER_RB_RB 0
87#define TIMER_RC 0x0000001c
88#define TIMER_RC_RC 0
89#define TIMER_SR 0x00000020
90#define TIMER_SR_CLKSTA 16
91#define TIMER_SR_COVFS 0
92#define TIMER_SR_CPAS 2
93#define TIMER_SR_CPBS 3
94#define TIMER_SR_CPCS 4
95#define TIMER_SR_ETRGS 7
96#define TIMER_SR_LDRAS 5
97#define TIMER_SR_LDRBS 6
98#define TIMER_SR_LOVRS 1
99#define TIMER_SR_MTIOA 17
100#define TIMER_SR_MTIOB 18
101
102/* Bit manipulation macros */
103#define TIMER_BIT(name) (1 << TIMER_##name)
104#define TIMER_BF(name,value) ((value) << TIMER_##name)
105
106/* Register access macros */
107#define timer_read(port,instance,reg) \
108 __raw_readl(port + (0x40 * instance) + TIMER_##reg)
109#define timer_write(port,instance,reg,value) \
110 __raw_writel((value), port + (0x40 * instance) + TIMER_##reg)
111
112#endif /* _ASM_AVR32_ARCH_AT32AP_TIME_H */
diff --git a/include/asm-avr32/asm.h b/include/asm-avr32/asm.h
index 515c7618952b..a2c64f404b98 100644
--- a/include/asm-avr32/asm.h
+++ b/include/asm-avr32/asm.h
@@ -12,10 +12,10 @@
12#include <asm/asm-offsets.h> 12#include <asm/asm-offsets.h>
13#include <asm/thread_info.h> 13#include <asm/thread_info.h>
14 14
15#define mask_interrupts ssrf SR_GM_BIT 15#define mask_interrupts ssrf SYSREG_GM_OFFSET
16#define mask_exceptions ssrf SR_EM_BIT 16#define mask_exceptions ssrf SYSREG_EM_OFFSET
17#define unmask_interrupts csrf SR_GM_BIT 17#define unmask_interrupts csrf SYSREG_GM_OFFSET
18#define unmask_exceptions csrf SR_EM_BIT 18#define unmask_exceptions csrf SYSREG_EM_OFFSET
19 19
20#ifdef CONFIG_FRAME_POINTER 20#ifdef CONFIG_FRAME_POINTER
21 .macro save_fp 21 .macro save_fp
diff --git a/include/asm-avr32/intc.h b/include/asm-avr32/intc.h
deleted file mode 100644
index 1ac9ca75e8fd..000000000000
--- a/include/asm-avr32/intc.h
+++ /dev/null
@@ -1,128 +0,0 @@
1#ifndef __ASM_AVR32_INTC_H
2#define __ASM_AVR32_INTC_H
3
4#include <linux/sysdev.h>
5#include <linux/interrupt.h>
6
7struct irq_controller;
8struct irqaction;
9struct pt_regs;
10
11struct platform_device;
12
13/* Information about the internal interrupt controller */
14struct intc_device {
15 /* ioremapped address of configuration block */
16 void __iomem *regs;
17
18 /* the physical device */
19 struct platform_device *pdev;
20
21 /* Number of interrupt lines per group. */
22 unsigned int irqs_per_group;
23
24 /* The highest group ID + 1 */
25 unsigned int nr_groups;
26
27 /*
28 * Bitfield indicating which groups are actually in use. The
29 * size of the array is
30 * ceil(group_max / (8 * sizeof(unsigned int))).
31 */
32 unsigned int group_mask[];
33};
34
35struct irq_controller_class {
36 /*
37 * A short name identifying this kind of controller.
38 */
39 const char *typename;
40 /*
41 * Handle the IRQ. Must do any necessary acking and masking.
42 */
43 irqreturn_t (*handle)(int irq, void *dev_id, struct pt_regs *regs);
44 /*
45 * Register a new IRQ handler.
46 */
47 int (*setup)(struct irq_controller *ctrl, unsigned int irq,
48 struct irqaction *action);
49 /*
50 * Unregister a IRQ handler.
51 */
52 void (*free)(struct irq_controller *ctrl, unsigned int irq,
53 void *dev_id);
54 /*
55 * Mask the IRQ in the interrupt controller.
56 */
57 void (*mask)(struct irq_controller *ctrl, unsigned int irq);
58 /*
59 * Unmask the IRQ in the interrupt controller.
60 */
61 void (*unmask)(struct irq_controller *ctrl, unsigned int irq);
62 /*
63 * Set the type of the IRQ. See below for possible types.
64 * Return -EINVAL if a given type is not supported
65 */
66 int (*set_type)(struct irq_controller *ctrl, unsigned int irq,
67 unsigned int type);
68 /*
69 * Return the IRQ type currently set
70 */
71 unsigned int (*get_type)(struct irq_controller *ctrl, unsigned int irq);
72};
73
74struct irq_controller {
75 struct irq_controller_class *class;
76 unsigned int irq_group;
77 unsigned int first_irq;
78 unsigned int nr_irqs;
79 struct list_head list;
80};
81
82struct intc_group_desc {
83 struct irq_controller *ctrl;
84 irqreturn_t (*handle)(int, void *, struct pt_regs *);
85 unsigned long flags;
86 void *dev_id;
87 const char *devname;
88};
89
90/*
91 * The internal interrupt controller. Defined in board/part-specific
92 * devices.c.
93 * TODO: Should probably be defined per-cpu.
94 */
95extern struct intc_device intc;
96
97extern int request_internal_irq(unsigned int irq,
98 irqreturn_t (*handler)(int, void *, struct pt_regs *),
99 unsigned long irqflags,
100 const char *devname, void *dev_id);
101extern void free_internal_irq(unsigned int irq);
102
103/* Only used by time_init() */
104extern int setup_internal_irq(unsigned int irq, struct intc_group_desc *desc);
105
106/*
107 * Set interrupt priority for a given group. `group' can be found by
108 * using irq_to_group(irq). Priority can be from 0 (lowest) to 3
109 * (highest). Higher-priority interrupts will preempt lower-priority
110 * interrupts (unless interrupts are masked globally).
111 *
112 * This function does not check for conflicts within a group.
113 */
114extern int intc_set_priority(unsigned int group,
115 unsigned int priority);
116
117/*
118 * Returns a bitmask of pending interrupts in a group.
119 */
120extern unsigned long intc_get_pending(unsigned int group);
121
122/*
123 * Register a new external interrupt controller. Returns the first
124 * external IRQ number that is assigned to the new controller.
125 */
126extern int intc_register_controller(struct irq_controller *ctrl);
127
128#endif /* __ASM_AVR32_INTC_H */
diff --git a/include/asm-avr32/irq.h b/include/asm-avr32/irq.h
index 9315724c0596..c563b7720c1a 100644
--- a/include/asm-avr32/irq.h
+++ b/include/asm-avr32/irq.h
@@ -14,6 +14,11 @@
14#ifndef __ASSEMBLER__ 14#ifndef __ASSEMBLER__
15int nmi_enable(void); 15int nmi_enable(void);
16void nmi_disable(void); 16void nmi_disable(void);
17
18/*
19 * Returns a bitmask of pending interrupts in a group.
20 */
21extern unsigned long intc_get_pending(unsigned int group);
17#endif 22#endif
18 23
19#endif /* __ASM_AVR32_IOCTLS_H */ 24#endif /* __ASM_AVR32_IOCTLS_H */
diff --git a/include/asm-avr32/page.h b/include/asm-avr32/page.h
index 5582968feee8..cbbc5ca9728b 100644
--- a/include/asm-avr32/page.h
+++ b/include/asm-avr32/page.h
@@ -8,13 +8,11 @@
8#ifndef __ASM_AVR32_PAGE_H 8#ifndef __ASM_AVR32_PAGE_H
9#define __ASM_AVR32_PAGE_H 9#define __ASM_AVR32_PAGE_H
10 10
11#include <linux/const.h>
12
11/* PAGE_SHIFT determines the page size */ 13/* PAGE_SHIFT determines the page size */
12#define PAGE_SHIFT 12 14#define PAGE_SHIFT 12
13#ifdef __ASSEMBLY__ 15#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
14#define PAGE_SIZE (1 << PAGE_SHIFT)
15#else
16#define PAGE_SIZE (1UL << PAGE_SHIFT)
17#endif
18#define PAGE_MASK (~(PAGE_SIZE-1)) 16#define PAGE_MASK (~(PAGE_SIZE-1))
19#define PTE_MASK PAGE_MASK 17#define PTE_MASK PAGE_MASK
20 18
diff --git a/include/asm-avr32/serial.h b/include/asm-avr32/serial.h
new file mode 100644
index 000000000000..5ecaebc22b02
--- /dev/null
+++ b/include/asm-avr32/serial.h
@@ -0,0 +1,13 @@
1#ifndef _ASM_SERIAL_H
2#define _ASM_SERIAL_H
3
4/*
5 * This assumes you have a 1.8432 MHz clock for your UART.
6 *
7 * It'd be nice if someone built a serial card with a 24.576 MHz
8 * clock, since the 16550A is capable of handling a top speed of 1.5
9 * megabits/second; but this requires the faster clock.
10 */
11#define BASE_BAUD (1843200 / 16)
12
13#endif /* _ASM_SERIAL_H */
diff --git a/include/asm-avr32/xor.h b/include/asm-avr32/xor.h
new file mode 100644
index 000000000000..99c87aa0af4f
--- /dev/null
+++ b/include/asm-avr32/xor.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_XOR_H
2#define _ASM_XOR_H
3
4#include <asm-generic/xor.h>
5
6#endif
diff --git a/include/asm-blackfin/dma.h b/include/asm-blackfin/dma.h
index 5abaa2cee8db..16d493574ba8 100644
--- a/include/asm-blackfin/dma.h
+++ b/include/asm-blackfin/dma.h
@@ -33,7 +33,6 @@
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <asm/irq.h> 34#include <asm/irq.h>
35#include <asm/signal.h> 35#include <asm/signal.h>
36#include <asm/semaphore.h>
37 36
38#include <linux/kernel.h> 37#include <linux/kernel.h>
39#include <asm/mach/dma.h> 38#include <asm/mach/dma.h>
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h
index 30a67a9da11a..cb307f8a6b48 100644
--- a/include/asm-frv/system.h
+++ b/include/asm-frv/system.h
@@ -197,11 +197,6 @@ do { \
197 do { var = (value); barrier(); } while (0) 197 do { var = (value); barrier(); } while (0)
198#endif 198#endif
199 199
200#define HARD_RESET_NOW() \
201do { \
202 cli(); \
203} while(1)
204
205extern void die_if_kernel(const char *, ...) __attribute__((format(printf, 1, 2))); 200extern void die_if_kernel(const char *, ...) __attribute__((format(printf, 1, 2)));
206extern void free_initmem(void); 201extern void free_initmem(void);
207 202
diff --git a/include/asm-frv/topology.h b/include/asm-frv/topology.h
index abe7298742ac..942724352705 100644
--- a/include/asm-frv/topology.h
+++ b/include/asm-frv/topology.h
@@ -5,10 +5,8 @@
5 5
6#error NUMA not supported yet 6#error NUMA not supported yet
7 7
8#else /* !CONFIG_NUMA */ 8#endif /* CONFIG_NUMA */
9 9
10#include <asm-generic/topology.h> 10#include <asm-generic/topology.h>
11 11
12#endif /* CONFIG_NUMA */
13
14#endif /* _ASM_TOPOLOGY_H */ 12#endif /* _ASM_TOPOLOGY_H */
diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
index 342a2a0105c4..a6aea79bca4f 100644
--- a/include/asm-generic/topology.h
+++ b/include/asm-generic/topology.h
@@ -27,6 +27,8 @@
27#ifndef _ASM_GENERIC_TOPOLOGY_H 27#ifndef _ASM_GENERIC_TOPOLOGY_H
28#define _ASM_GENERIC_TOPOLOGY_H 28#define _ASM_GENERIC_TOPOLOGY_H
29 29
30#ifndef CONFIG_NUMA
31
30/* Other architectures wishing to use this simple topology API should fill 32/* Other architectures wishing to use this simple topology API should fill
31 in the below functions as appropriate in their own <asm/topology.h> file. */ 33 in the below functions as appropriate in their own <asm/topology.h> file. */
32#ifndef cpu_to_node 34#ifndef cpu_to_node
@@ -52,4 +54,16 @@
52 ) 54 )
53#endif 55#endif
54 56
57#endif /* CONFIG_NUMA */
58
59/* returns pointer to cpumask for specified node */
60#ifndef node_to_cpumask_ptr
61
62#define node_to_cpumask_ptr(v, node) \
63 cpumask_t _##v = node_to_cpumask(node), *v = &_##v
64
65#define node_to_cpumask_ptr_next(v, node) \
66 _##v = node_to_cpumask(node)
67#endif
68
55#endif /* _ASM_GENERIC_TOPOLOGY_H */ 69#endif /* _ASM_GENERIC_TOPOLOGY_H */
diff --git a/include/asm-ia64/sn/nodepda.h b/include/asm-ia64/sn/nodepda.h
index 6f6d69e39ff5..ee118b901de4 100644
--- a/include/asm-ia64/sn/nodepda.h
+++ b/include/asm-ia64/sn/nodepda.h
@@ -9,7 +9,6 @@
9#define _ASM_IA64_SN_NODEPDA_H 9#define _ASM_IA64_SN_NODEPDA_H
10 10
11 11
12#include <asm/semaphore.h>
13#include <asm/irq.h> 12#include <asm/irq.h>
14#include <asm/sn/arch.h> 13#include <asm/sn/arch.h>
15#include <asm/sn/intr.h> 14#include <asm/sn/intr.h>
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h
index 2d67b72b18d0..f2f72ef2a897 100644
--- a/include/asm-ia64/topology.h
+++ b/include/asm-ia64/topology.h
@@ -93,7 +93,7 @@ void build_cpu_to_node_map(void);
93 .cache_nice_tries = 2, \ 93 .cache_nice_tries = 2, \
94 .busy_idx = 3, \ 94 .busy_idx = 3, \
95 .idle_idx = 2, \ 95 .idle_idx = 2, \
96 .newidle_idx = 0, /* unused */ \ 96 .newidle_idx = 2, \
97 .wake_idx = 1, \ 97 .wake_idx = 1, \
98 .forkexec_idx = 1, \ 98 .forkexec_idx = 1, \
99 .flags = SD_LOAD_BALANCE \ 99 .flags = SD_LOAD_BALANCE \
@@ -116,6 +116,11 @@ void build_cpu_to_node_map(void);
116#define smt_capable() (smp_num_siblings > 1) 116#define smt_capable() (smp_num_siblings > 1)
117#endif 117#endif
118 118
119#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
120 CPU_MASK_ALL : \
121 node_to_cpumask(pcibus_to_node(bus)) \
122 )
123
119#include <asm-generic/topology.h> 124#include <asm-generic/topology.h>
120 125
121#endif /* _ASM_IA64_TOPOLOGY_H */ 126#endif /* _ASM_IA64_TOPOLOGY_H */
diff --git a/include/asm-powerpc/Kbuild b/include/asm-powerpc/Kbuild
index 5f640e542475..7381916dfcbb 100644
--- a/include/asm-powerpc/Kbuild
+++ b/include/asm-powerpc/Kbuild
@@ -1,5 +1,6 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3header-y += a.out.h
3header-y += auxvec.h 4header-y += auxvec.h
4header-y += ioctls.h 5header-y += ioctls.h
5header-y += mman.h 6header-y += mman.h
@@ -23,7 +24,6 @@ header-y += sigcontext.h
23header-y += statfs.h 24header-y += statfs.h
24header-y += ps3fb.h 25header-y += ps3fb.h
25 26
26unifdef-y += a.out.h
27unifdef-y += asm-compat.h 27unifdef-y += asm-compat.h
28unifdef-y += bootx.h 28unifdef-y += bootx.h
29unifdef-y += byteorder.h 29unifdef-y += byteorder.h
diff --git a/include/asm-powerpc/abs_addr.h b/include/asm-powerpc/abs_addr.h
index 4aa220718b19..98324c5a8286 100644
--- a/include/asm-powerpc/abs_addr.h
+++ b/include/asm-powerpc/abs_addr.h
@@ -12,10 +12,11 @@
12 * 2 of the License, or (at your option) any later version. 12 * 2 of the License, or (at your option) any later version.
13 */ 13 */
14 14
15#include <linux/lmb.h>
16
15#include <asm/types.h> 17#include <asm/types.h>
16#include <asm/page.h> 18#include <asm/page.h>
17#include <asm/prom.h> 19#include <asm/prom.h>
18#include <asm/lmb.h>
19#include <asm/firmware.h> 20#include <asm/firmware.h>
20 21
21struct mschunks_map { 22struct mschunks_map {
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h
index 220d9a781ab9..a99a74929475 100644
--- a/include/asm-powerpc/bitops.h
+++ b/include/asm-powerpc/bitops.h
@@ -312,24 +312,26 @@ static __inline__ int fls(unsigned int x)
312 asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); 312 asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x));
313 return 32 - lz; 313 return 32 - lz;
314} 314}
315
316/*
317 * 64-bit can do this using one cntlzd (count leading zeroes doubleword)
318 * instruction; for 32-bit we use the generic version, which does two
319 * 32-bit fls calls.
320 */
321#ifdef __powerpc64__
322static __inline__ int fls64(__u64 x)
323{
324 int lz;
325
326 asm ("cntlzd %0,%1" : "=r" (lz) : "r" (x));
327 return 64 - lz;
328}
329#else
315#include <asm-generic/bitops/fls64.h> 330#include <asm-generic/bitops/fls64.h>
331#endif /* __powerpc64__ */
316 332
317#include <asm-generic/bitops/hweight.h> 333#include <asm-generic/bitops/hweight.h>
318 334#include <asm-generic/bitops/find.h>
319#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
320unsigned long find_next_zero_bit(const unsigned long *addr,
321 unsigned long size, unsigned long offset);
322/**
323 * find_first_bit - find the first set bit in a memory region
324 * @addr: The address to start the search at
325 * @size: The maximum size to search
326 *
327 * Returns the bit-number of the first set bit, not the number of the byte
328 * containing a bit.
329 */
330#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
331unsigned long find_next_bit(const unsigned long *addr,
332 unsigned long size, unsigned long offset);
333 335
334/* Little-endian versions */ 336/* Little-endian versions */
335 337
diff --git a/include/asm-powerpc/cpm.h b/include/asm-powerpc/cpm.h
index 77e39dad9728..ede38ffe466a 100644
--- a/include/asm-powerpc/cpm.h
+++ b/include/asm-powerpc/cpm.h
@@ -4,6 +4,20 @@
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <linux/types.h> 5#include <linux/types.h>
6 6
7/* Opcodes common to CPM1 and CPM2
8*/
9#define CPM_CR_INIT_TRX ((ushort)0x0000)
10#define CPM_CR_INIT_RX ((ushort)0x0001)
11#define CPM_CR_INIT_TX ((ushort)0x0002)
12#define CPM_CR_HUNT_MODE ((ushort)0x0003)
13#define CPM_CR_STOP_TX ((ushort)0x0004)
14#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
15#define CPM_CR_RESTART_TX ((ushort)0x0006)
16#define CPM_CR_CLOSE_RX_BD ((ushort)0x0007)
17#define CPM_CR_SET_GADDR ((ushort)0x0008)
18#define CPM_CR_SET_TIMER ((ushort)0x0008)
19#define CPM_CR_STOP_IDMA ((ushort)0x000b)
20
7/* Buffer descriptors used by many of the CPM protocols. */ 21/* Buffer descriptors used by many of the CPM protocols. */
8typedef struct cpm_buf_desc { 22typedef struct cpm_buf_desc {
9 ushort cbd_sc; /* Status and Control */ 23 ushort cbd_sc; /* Status and Control */
diff --git a/include/asm-powerpc/cpm1.h b/include/asm-powerpc/cpm1.h
index b2ebd6ac6dae..3df439678006 100644
--- a/include/asm-powerpc/cpm1.h
+++ b/include/asm-powerpc/cpm1.h
@@ -28,19 +28,6 @@
28#define CPM_CR_CHAN ((ushort)0x00f0) 28#define CPM_CR_CHAN ((ushort)0x00f0)
29#define CPM_CR_FLG ((ushort)0x0001) 29#define CPM_CR_FLG ((ushort)0x0001)
30 30
31/* Some commands (there are more...later)
32*/
33#define CPM_CR_INIT_TRX ((ushort)0x0000)
34#define CPM_CR_INIT_RX ((ushort)0x0001)
35#define CPM_CR_INIT_TX ((ushort)0x0002)
36#define CPM_CR_HUNT_MODE ((ushort)0x0003)
37#define CPM_CR_STOP_TX ((ushort)0x0004)
38#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
39#define CPM_CR_RESTART_TX ((ushort)0x0006)
40#define CPM_CR_CLOSE_RX_BD ((ushort)0x0007)
41#define CPM_CR_SET_GADDR ((ushort)0x0008)
42#define CPM_CR_SET_TIMER CPM_CR_SET_GADDR
43
44/* Channel numbers. 31/* Channel numbers.
45*/ 32*/
46#define CPM_CR_CH_SCC1 ((ushort)0x0000) 33#define CPM_CR_CH_SCC1 ((ushort)0x0000)
diff --git a/include/asm-powerpc/cpm2.h b/include/asm-powerpc/cpm2.h
index b93a53eb55c1..4c85ed9cd43f 100644
--- a/include/asm-powerpc/cpm2.h
+++ b/include/asm-powerpc/cpm2.h
@@ -71,18 +71,9 @@
71 71
72#define CPM_CR_FCC_PAGE(x) (x + 0x04) 72#define CPM_CR_FCC_PAGE(x) (x + 0x04)
73 73
74/* Some opcodes (there are more...later) 74/* CPM2-specific opcodes (see cpm.h for common opcodes)
75*/ 75*/
76#define CPM_CR_INIT_TRX ((ushort)0x0000)
77#define CPM_CR_INIT_RX ((ushort)0x0001)
78#define CPM_CR_INIT_TX ((ushort)0x0002)
79#define CPM_CR_HUNT_MODE ((ushort)0x0003)
80#define CPM_CR_STOP_TX ((ushort)0x0004)
81#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
82#define CPM_CR_RESTART_TX ((ushort)0x0006)
83#define CPM_CR_SET_GADDR ((ushort)0x0008)
84#define CPM_CR_START_IDMA ((ushort)0x0009) 76#define CPM_CR_START_IDMA ((ushort)0x0009)
85#define CPM_CR_STOP_IDMA ((ushort)0x000b)
86 77
87#define mk_cr_cmd(PG, SBC, MCN, OP) \ 78#define mk_cr_cmd(PG, SBC, MCN, OP) \
88 ((PG << 26) | (SBC << 21) | (MCN << 6) | OP) 79 ((PG << 26) | (SBC << 21) | (MCN << 6) | OP)
diff --git a/include/asm-powerpc/cputhreads.h b/include/asm-powerpc/cputhreads.h
index 8485c28b5f47..fb11b0c459b8 100644
--- a/include/asm-powerpc/cputhreads.h
+++ b/include/asm-powerpc/cputhreads.h
@@ -35,7 +35,7 @@ static inline cpumask_t cpu_thread_mask_to_cores(cpumask_t threads)
35 35
36 res = CPU_MASK_NONE; 36 res = CPU_MASK_NONE;
37 for (i = 0; i < NR_CPUS; i += threads_per_core) { 37 for (i = 0; i < NR_CPUS; i += threads_per_core) {
38 cpus_shift_right(tmp, threads_core_mask, i); 38 cpus_shift_left(tmp, threads_core_mask, i);
39 if (cpus_intersects(threads, tmp)) 39 if (cpus_intersects(threads, tmp))
40 cpu_set(i, res); 40 cpu_set(i, res);
41 } 41 }
diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h
index be6c879e8760..f8398ce80372 100644
--- a/include/asm-powerpc/dcr-native.h
+++ b/include/asm-powerpc/dcr-native.h
@@ -82,6 +82,19 @@ static inline void __mtdcri(int base_addr, int base_data, int reg,
82 spin_unlock_irqrestore(&dcr_ind_lock, flags); 82 spin_unlock_irqrestore(&dcr_ind_lock, flags);
83} 83}
84 84
85static inline void __dcri_clrset(int base_addr, int base_data, int reg,
86 unsigned clr, unsigned set)
87{
88 unsigned long flags;
89 unsigned int val;
90
91 spin_lock_irqsave(&dcr_ind_lock, flags);
92 __mtdcr(base_addr, reg);
93 val = (__mfdcr(base_data) & ~clr) | set;
94 __mtdcr(base_data, val);
95 spin_unlock_irqrestore(&dcr_ind_lock, flags);
96}
97
85#define mfdcri(base, reg) __mfdcri(DCRN_ ## base ## _CONFIG_ADDR, \ 98#define mfdcri(base, reg) __mfdcri(DCRN_ ## base ## _CONFIG_ADDR, \
86 DCRN_ ## base ## _CONFIG_DATA, \ 99 DCRN_ ## base ## _CONFIG_DATA, \
87 reg) 100 reg)
@@ -90,6 +103,10 @@ static inline void __mtdcri(int base_addr, int base_data, int reg,
90 DCRN_ ## base ## _CONFIG_DATA, \ 103 DCRN_ ## base ## _CONFIG_DATA, \
91 reg, data) 104 reg, data)
92 105
106#define dcri_clrset(base, reg, clr, set) __dcri_clrset(DCRN_ ## base ## _CONFIG_ADDR, \
107 DCRN_ ## base ## _CONFIG_DATA, \
108 reg, clr, set)
109
93#endif /* __ASSEMBLY__ */ 110#endif /* __ASSEMBLY__ */
94#endif /* __KERNEL__ */ 111#endif /* __KERNEL__ */
95#endif /* _ASM_POWERPC_DCR_NATIVE_H */ 112#endif /* _ASM_POWERPC_DCR_NATIVE_H */
diff --git a/include/asm-powerpc/dcr-regs.h b/include/asm-powerpc/dcr-regs.h
index 9f1fb98fcdc6..29b0ecef980a 100644
--- a/include/asm-powerpc/dcr-regs.h
+++ b/include/asm-powerpc/dcr-regs.h
@@ -68,4 +68,82 @@
68#define SDR0_UART3 0x0123 68#define SDR0_UART3 0x0123
69#define SDR0_CUST0 0x4000 69#define SDR0_CUST0 0x4000
70 70
71/*
72 * All those DCR register addresses are offsets from the base address
73 * for the SRAM0 controller (e.g. 0x20 on 440GX). The base address is
74 * excluded here and configured in the device tree.
75 */
76#define DCRN_SRAM0_SB0CR 0x00
77#define DCRN_SRAM0_SB1CR 0x01
78#define DCRN_SRAM0_SB2CR 0x02
79#define DCRN_SRAM0_SB3CR 0x03
80#define SRAM_SBCR_BU_MASK 0x00000180
81#define SRAM_SBCR_BS_64KB 0x00000800
82#define SRAM_SBCR_BU_RO 0x00000080
83#define SRAM_SBCR_BU_RW 0x00000180
84#define DCRN_SRAM0_BEAR 0x04
85#define DCRN_SRAM0_BESR0 0x05
86#define DCRN_SRAM0_BESR1 0x06
87#define DCRN_SRAM0_PMEG 0x07
88#define DCRN_SRAM0_CID 0x08
89#define DCRN_SRAM0_REVID 0x09
90#define DCRN_SRAM0_DPC 0x0a
91#define SRAM_DPC_ENABLE 0x80000000
92
93/*
94 * All those DCR register addresses are offsets from the base address
95 * for the SRAM0 controller (e.g. 0x30 on 440GX). The base address is
96 * excluded here and configured in the device tree.
97 */
98#define DCRN_L2C0_CFG 0x00
99#define L2C_CFG_L2M 0x80000000
100#define L2C_CFG_ICU 0x40000000
101#define L2C_CFG_DCU 0x20000000
102#define L2C_CFG_DCW_MASK 0x1e000000
103#define L2C_CFG_TPC 0x01000000
104#define L2C_CFG_CPC 0x00800000
105#define L2C_CFG_FRAN 0x00200000
106#define L2C_CFG_SS_MASK 0x00180000
107#define L2C_CFG_SS_256 0x00000000
108#define L2C_CFG_CPIM 0x00040000
109#define L2C_CFG_TPIM 0x00020000
110#define L2C_CFG_LIM 0x00010000
111#define L2C_CFG_PMUX_MASK 0x00007000
112#define L2C_CFG_PMUX_SNP 0x00000000
113#define L2C_CFG_PMUX_IF 0x00001000
114#define L2C_CFG_PMUX_DF 0x00002000
115#define L2C_CFG_PMUX_DS 0x00003000
116#define L2C_CFG_PMIM 0x00000800
117#define L2C_CFG_TPEI 0x00000400
118#define L2C_CFG_CPEI 0x00000200
119#define L2C_CFG_NAM 0x00000100
120#define L2C_CFG_SMCM 0x00000080
121#define L2C_CFG_NBRM 0x00000040
122#define L2C_CFG_RDBW 0x00000008 /* only 460EX/GT */
123#define DCRN_L2C0_CMD 0x01
124#define L2C_CMD_CLR 0x80000000
125#define L2C_CMD_DIAG 0x40000000
126#define L2C_CMD_INV 0x20000000
127#define L2C_CMD_CCP 0x10000000
128#define L2C_CMD_CTE 0x08000000
129#define L2C_CMD_STRC 0x04000000
130#define L2C_CMD_STPC 0x02000000
131#define L2C_CMD_RPMC 0x01000000
132#define L2C_CMD_HCC 0x00800000
133#define DCRN_L2C0_ADDR 0x02
134#define DCRN_L2C0_DATA 0x03
135#define DCRN_L2C0_SR 0x04
136#define L2C_SR_CC 0x80000000
137#define L2C_SR_CPE 0x40000000
138#define L2C_SR_TPE 0x20000000
139#define L2C_SR_LRU 0x10000000
140#define L2C_SR_PCS 0x08000000
141#define DCRN_L2C0_REVID 0x05
142#define DCRN_L2C0_SNP0 0x06
143#define DCRN_L2C0_SNP1 0x07
144#define L2C_SNP_BA_MASK 0xffff0000
145#define L2C_SNP_SSR_MASK 0x0000f000
146#define L2C_SNP_SSR_32G 0x0000f000
147#define L2C_SNP_ESR 0x00000800
148
71#endif /* __DCR_REGS_H__ */ 149#endif /* __DCR_REGS_H__ */
diff --git a/include/asm-powerpc/exception.h b/include/asm-powerpc/exception.h
index 39abdb02fdef..329148b5acc6 100644
--- a/include/asm-powerpc/exception.h
+++ b/include/asm-powerpc/exception.h
@@ -228,18 +228,18 @@ label##_pSeries: \
228BEGIN_FW_FTR_SECTION; \ 228BEGIN_FW_FTR_SECTION; \
229 stb r11,PACAHARDIRQEN(r13); \ 229 stb r11,PACAHARDIRQEN(r13); \
230END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES); \ 230END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES); \
231 TRACE_DISABLE_INTS; \
231BEGIN_FW_FTR_SECTION; \ 232BEGIN_FW_FTR_SECTION; \
232 mfmsr r10; \ 233 mfmsr r10; \
233 ori r10,r10,MSR_EE; \ 234 ori r10,r10,MSR_EE; \
234 mtmsrd r10,1; \ 235 mtmsrd r10,1; \
235END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) 236END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
236
237#else 237#else
238#define DISABLE_INTS \ 238#define DISABLE_INTS \
239 li r11,0; \ 239 li r11,0; \
240 stb r11,PACASOFTIRQEN(r13); \ 240 stb r11,PACASOFTIRQEN(r13); \
241 stb r11,PACAHARDIRQEN(r13) 241 stb r11,PACAHARDIRQEN(r13); \
242 242 TRACE_DISABLE_INTS
243#endif /* CONFIG_PPC_ISERIES */ 243#endif /* CONFIG_PPC_ISERIES */
244 244
245#define ENABLE_INTS \ 245#define ENABLE_INTS \
diff --git a/include/asm-powerpc/fsl_lbc.h b/include/asm-powerpc/fsl_lbc.h
new file mode 100644
index 000000000000..303f5484c050
--- /dev/null
+++ b/include/asm-powerpc/fsl_lbc.h
@@ -0,0 +1,311 @@
1/* Freescale Local Bus Controller
2 *
3 * Copyright (c) 2006-2007 Freescale Semiconductor
4 *
5 * Authors: Nick Spence <nick.spence@freescale.com>,
6 * Scott Wood <scottwood@freescale.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef __ASM_FSL_LBC_H
24#define __ASM_FSL_LBC_H
25
26#include <linux/types.h>
27#include <linux/spinlock.h>
28#include <asm/io.h>
29
30struct fsl_lbc_bank {
31 __be32 br; /**< Base Register */
32#define BR_BA 0xFFFF8000
33#define BR_BA_SHIFT 15
34#define BR_PS 0x00001800
35#define BR_PS_SHIFT 11
36#define BR_PS_8 0x00000800 /* Port Size 8 bit */
37#define BR_PS_16 0x00001000 /* Port Size 16 bit */
38#define BR_PS_32 0x00001800 /* Port Size 32 bit */
39#define BR_DECC 0x00000600
40#define BR_DECC_SHIFT 9
41#define BR_DECC_OFF 0x00000000 /* HW ECC checking and generation off */
42#define BR_DECC_CHK 0x00000200 /* HW ECC checking on, generation off */
43#define BR_DECC_CHK_GEN 0x00000400 /* HW ECC checking and generation on */
44#define BR_WP 0x00000100
45#define BR_WP_SHIFT 8
46#define BR_MSEL 0x000000E0
47#define BR_MSEL_SHIFT 5
48#define BR_MS_GPCM 0x00000000 /* GPCM */
49#define BR_MS_FCM 0x00000020 /* FCM */
50#define BR_MS_SDRAM 0x00000060 /* SDRAM */
51#define BR_MS_UPMA 0x00000080 /* UPMA */
52#define BR_MS_UPMB 0x000000A0 /* UPMB */
53#define BR_MS_UPMC 0x000000C0 /* UPMC */
54#define BR_V 0x00000001
55#define BR_V_SHIFT 0
56#define BR_RES ~(BR_BA|BR_PS|BR_DECC|BR_WP|BR_MSEL|BR_V)
57
58 __be32 or; /**< Base Register */
59#define OR0 0x5004
60#define OR1 0x500C
61#define OR2 0x5014
62#define OR3 0x501C
63#define OR4 0x5024
64#define OR5 0x502C
65#define OR6 0x5034
66#define OR7 0x503C
67
68#define OR_FCM_AM 0xFFFF8000
69#define OR_FCM_AM_SHIFT 15
70#define OR_FCM_BCTLD 0x00001000
71#define OR_FCM_BCTLD_SHIFT 12
72#define OR_FCM_PGS 0x00000400
73#define OR_FCM_PGS_SHIFT 10
74#define OR_FCM_CSCT 0x00000200
75#define OR_FCM_CSCT_SHIFT 9
76#define OR_FCM_CST 0x00000100
77#define OR_FCM_CST_SHIFT 8
78#define OR_FCM_CHT 0x00000080
79#define OR_FCM_CHT_SHIFT 7
80#define OR_FCM_SCY 0x00000070
81#define OR_FCM_SCY_SHIFT 4
82#define OR_FCM_SCY_1 0x00000010
83#define OR_FCM_SCY_2 0x00000020
84#define OR_FCM_SCY_3 0x00000030
85#define OR_FCM_SCY_4 0x00000040
86#define OR_FCM_SCY_5 0x00000050
87#define OR_FCM_SCY_6 0x00000060
88#define OR_FCM_SCY_7 0x00000070
89#define OR_FCM_RST 0x00000008
90#define OR_FCM_RST_SHIFT 3
91#define OR_FCM_TRLX 0x00000004
92#define OR_FCM_TRLX_SHIFT 2
93#define OR_FCM_EHTR 0x00000002
94#define OR_FCM_EHTR_SHIFT 1
95};
96
97struct fsl_lbc_regs {
98 struct fsl_lbc_bank bank[8];
99 u8 res0[0x28];
100 __be32 mar; /**< UPM Address Register */
101 u8 res1[0x4];
102 __be32 mamr; /**< UPMA Mode Register */
103#define MxMR_OP_NO (0 << 28) /**< normal operation */
104#define MxMR_OP_WA (1 << 28) /**< write array */
105#define MxMR_OP_RA (2 << 28) /**< read array */
106#define MxMR_OP_RP (3 << 28) /**< run pattern */
107#define MxMR_MAD 0x3f /**< machine address */
108 __be32 mbmr; /**< UPMB Mode Register */
109 __be32 mcmr; /**< UPMC Mode Register */
110 u8 res2[0x8];
111 __be32 mrtpr; /**< Memory Refresh Timer Prescaler Register */
112 __be32 mdr; /**< UPM Data Register */
113 u8 res3[0x4];
114 __be32 lsor; /**< Special Operation Initiation Register */
115 __be32 lsdmr; /**< SDRAM Mode Register */
116 u8 res4[0x8];
117 __be32 lurt; /**< UPM Refresh Timer */
118 __be32 lsrt; /**< SDRAM Refresh Timer */
119 u8 res5[0x8];
120 __be32 ltesr; /**< Transfer Error Status Register */
121#define LTESR_BM 0x80000000
122#define LTESR_FCT 0x40000000
123#define LTESR_PAR 0x20000000
124#define LTESR_WP 0x04000000
125#define LTESR_ATMW 0x00800000
126#define LTESR_ATMR 0x00400000
127#define LTESR_CS 0x00080000
128#define LTESR_CC 0x00000001
129#define LTESR_NAND_MASK (LTESR_FCT | LTESR_PAR | LTESR_CC)
130 __be32 ltedr; /**< Transfer Error Disable Register */
131 __be32 lteir; /**< Transfer Error Interrupt Register */
132 __be32 lteatr; /**< Transfer Error Attributes Register */
133 __be32 ltear; /**< Transfer Error Address Register */
134 u8 res6[0xC];
135 __be32 lbcr; /**< Configuration Register */
136#define LBCR_LDIS 0x80000000
137#define LBCR_LDIS_SHIFT 31
138#define LBCR_BCTLC 0x00C00000
139#define LBCR_BCTLC_SHIFT 22
140#define LBCR_AHD 0x00200000
141#define LBCR_LPBSE 0x00020000
142#define LBCR_LPBSE_SHIFT 17
143#define LBCR_EPAR 0x00010000
144#define LBCR_EPAR_SHIFT 16
145#define LBCR_BMT 0x0000FF00
146#define LBCR_BMT_SHIFT 8
147#define LBCR_INIT 0x00040000
148 __be32 lcrr; /**< Clock Ratio Register */
149#define LCRR_DBYP 0x80000000
150#define LCRR_DBYP_SHIFT 31
151#define LCRR_BUFCMDC 0x30000000
152#define LCRR_BUFCMDC_SHIFT 28
153#define LCRR_ECL 0x03000000
154#define LCRR_ECL_SHIFT 24
155#define LCRR_EADC 0x00030000
156#define LCRR_EADC_SHIFT 16
157#define LCRR_CLKDIV 0x0000000F
158#define LCRR_CLKDIV_SHIFT 0
159 u8 res7[0x8];
160 __be32 fmr; /**< Flash Mode Register */
161#define FMR_CWTO 0x0000F000
162#define FMR_CWTO_SHIFT 12
163#define FMR_BOOT 0x00000800
164#define FMR_ECCM 0x00000100
165#define FMR_AL 0x00000030
166#define FMR_AL_SHIFT 4
167#define FMR_OP 0x00000003
168#define FMR_OP_SHIFT 0
169 __be32 fir; /**< Flash Instruction Register */
170#define FIR_OP0 0xF0000000
171#define FIR_OP0_SHIFT 28
172#define FIR_OP1 0x0F000000
173#define FIR_OP1_SHIFT 24
174#define FIR_OP2 0x00F00000
175#define FIR_OP2_SHIFT 20
176#define FIR_OP3 0x000F0000
177#define FIR_OP3_SHIFT 16
178#define FIR_OP4 0x0000F000
179#define FIR_OP4_SHIFT 12
180#define FIR_OP5 0x00000F00
181#define FIR_OP5_SHIFT 8
182#define FIR_OP6 0x000000F0
183#define FIR_OP6_SHIFT 4
184#define FIR_OP7 0x0000000F
185#define FIR_OP7_SHIFT 0
186#define FIR_OP_NOP 0x0 /* No operation and end of sequence */
187#define FIR_OP_CA 0x1 /* Issue current column address */
188#define FIR_OP_PA 0x2 /* Issue current block+page address */
189#define FIR_OP_UA 0x3 /* Issue user defined address */
190#define FIR_OP_CM0 0x4 /* Issue command from FCR[CMD0] */
191#define FIR_OP_CM1 0x5 /* Issue command from FCR[CMD1] */
192#define FIR_OP_CM2 0x6 /* Issue command from FCR[CMD2] */
193#define FIR_OP_CM3 0x7 /* Issue command from FCR[CMD3] */
194#define FIR_OP_WB 0x8 /* Write FBCR bytes from FCM buffer */
195#define FIR_OP_WS 0x9 /* Write 1 or 2 bytes from MDR[AS] */
196#define FIR_OP_RB 0xA /* Read FBCR bytes to FCM buffer */
197#define FIR_OP_RS 0xB /* Read 1 or 2 bytes to MDR[AS] */
198#define FIR_OP_CW0 0xC /* Wait then issue FCR[CMD0] */
199#define FIR_OP_CW1 0xD /* Wait then issue FCR[CMD1] */
200#define FIR_OP_RBW 0xE /* Wait then read FBCR bytes */
201#define FIR_OP_RSW 0xE /* Wait then read 1 or 2 bytes */
202 __be32 fcr; /**< Flash Command Register */
203#define FCR_CMD0 0xFF000000
204#define FCR_CMD0_SHIFT 24
205#define FCR_CMD1 0x00FF0000
206#define FCR_CMD1_SHIFT 16
207#define FCR_CMD2 0x0000FF00
208#define FCR_CMD2_SHIFT 8
209#define FCR_CMD3 0x000000FF
210#define FCR_CMD3_SHIFT 0
211 __be32 fbar; /**< Flash Block Address Register */
212#define FBAR_BLK 0x00FFFFFF
213 __be32 fpar; /**< Flash Page Address Register */
214#define FPAR_SP_PI 0x00007C00
215#define FPAR_SP_PI_SHIFT 10
216#define FPAR_SP_MS 0x00000200
217#define FPAR_SP_CI 0x000001FF
218#define FPAR_SP_CI_SHIFT 0
219#define FPAR_LP_PI 0x0003F000
220#define FPAR_LP_PI_SHIFT 12
221#define FPAR_LP_MS 0x00000800
222#define FPAR_LP_CI 0x000007FF
223#define FPAR_LP_CI_SHIFT 0
224 __be32 fbcr; /**< Flash Byte Count Register */
225#define FBCR_BC 0x00000FFF
226 u8 res11[0x8];
227 u8 res8[0xF00];
228};
229
230extern struct fsl_lbc_regs __iomem *fsl_lbc_regs;
231extern spinlock_t fsl_lbc_lock;
232
233/*
234 * FSL UPM routines
235 */
236struct fsl_upm {
237 __be32 __iomem *mxmr;
238 int width;
239};
240
241extern int fsl_lbc_find(phys_addr_t addr_base);
242extern int fsl_upm_find(phys_addr_t addr_base, struct fsl_upm *upm);
243
244/**
245 * fsl_upm_start_pattern - start UPM patterns execution
246 * @upm: pointer to the fsl_upm structure obtained via fsl_upm_find
247 * @pat_offset: UPM pattern offset for the command to be executed
248 *
249 * This routine programmes UPM so the next memory access that hits an UPM
250 * will trigger pattern execution, starting at pat_offset.
251 */
252static inline void fsl_upm_start_pattern(struct fsl_upm *upm, u8 pat_offset)
253{
254 clrsetbits_be32(upm->mxmr, MxMR_MAD, MxMR_OP_RP | pat_offset);
255}
256
257/**
258 * fsl_upm_end_pattern - end UPM patterns execution
259 * @upm: pointer to the fsl_upm structure obtained via fsl_upm_find
260 *
261 * This routine reverts UPM to normal operation mode.
262 */
263static inline void fsl_upm_end_pattern(struct fsl_upm *upm)
264{
265 clrbits32(upm->mxmr, MxMR_OP_RP);
266
267 while (in_be32(upm->mxmr) & MxMR_OP_RP)
268 cpu_relax();
269}
270
271/**
272 * fsl_upm_run_pattern - actually run an UPM pattern
273 * @upm: pointer to the fsl_upm structure obtained via fsl_upm_find
274 * @io_base: remapped pointer to where memory access should happen
275 * @mar: MAR register content during pattern execution
276 *
277 * This function triggers dummy write to the memory specified by the io_base,
278 * thus UPM pattern actually executed. Note that mar usage depends on the
279 * pre-programmed AMX bits in the UPM RAM.
280 */
281static inline int fsl_upm_run_pattern(struct fsl_upm *upm,
282 void __iomem *io_base, u32 mar)
283{
284 int ret = 0;
285 unsigned long flags;
286
287 spin_lock_irqsave(&fsl_lbc_lock, flags);
288
289 out_be32(&fsl_lbc_regs->mar, mar << (32 - upm->width));
290
291 switch (upm->width) {
292 case 8:
293 out_8(io_base, 0x0);
294 break;
295 case 16:
296 out_be16(io_base, 0x0);
297 break;
298 case 32:
299 out_be32(io_base, 0x0);
300 break;
301 default:
302 ret = -EINVAL;
303 break;
304 }
305
306 spin_unlock_irqrestore(&fsl_lbc_lock, flags);
307
308 return ret;
309}
310
311#endif /* __ASM_FSL_LBC_H */
diff --git a/include/asm-powerpc/gpio.h b/include/asm-powerpc/gpio.h
new file mode 100644
index 000000000000..77ad3a890f30
--- /dev/null
+++ b/include/asm-powerpc/gpio.h
@@ -0,0 +1,56 @@
1/*
2 * Generic GPIO API implementation for PowerPC.
3 *
4 * Copyright (c) 2007-2008 MontaVista Software, Inc.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13
14#ifndef __ASM_POWERPC_GPIO_H
15#define __ASM_POWERPC_GPIO_H
16
17#include <linux/errno.h>
18#include <asm-generic/gpio.h>
19
20#ifdef CONFIG_HAVE_GPIO_LIB
21
22/*
23 * We don't (yet) implement inlined/rapid versions for on-chip gpios.
24 * Just call gpiolib.
25 */
26static inline int gpio_get_value(unsigned int gpio)
27{
28 return __gpio_get_value(gpio);
29}
30
31static inline void gpio_set_value(unsigned int gpio, int value)
32{
33 __gpio_set_value(gpio, value);
34}
35
36static inline int gpio_cansleep(unsigned int gpio)
37{
38 return __gpio_cansleep(gpio);
39}
40
41/*
42 * Not implemented, yet.
43 */
44static inline int gpio_to_irq(unsigned int gpio)
45{
46 return -ENOSYS;
47}
48
49static inline int irq_to_gpio(unsigned int irq)
50{
51 return -EINVAL;
52}
53
54#endif /* CONFIG_HAVE_GPIO_LIB */
55
56#endif /* __ASM_POWERPC_GPIO_H */
diff --git a/include/asm-powerpc/hw_irq.h b/include/asm-powerpc/hw_irq.h
index a7b60bf639e0..ad8c9f7fd0e3 100644
--- a/include/asm-powerpc/hw_irq.h
+++ b/include/asm-powerpc/hw_irq.h
@@ -27,7 +27,7 @@ static inline unsigned long local_get_flags(void)
27 return flags; 27 return flags;
28} 28}
29 29
30static inline unsigned long local_irq_disable(void) 30static inline unsigned long raw_local_irq_disable(void)
31{ 31{
32 unsigned long flags, zero; 32 unsigned long flags, zero;
33 33
@@ -39,14 +39,15 @@ static inline unsigned long local_irq_disable(void)
39 return flags; 39 return flags;
40} 40}
41 41
42extern void local_irq_restore(unsigned long); 42extern void raw_local_irq_restore(unsigned long);
43extern void iseries_handle_interrupts(void); 43extern void iseries_handle_interrupts(void);
44 44
45#define local_irq_enable() local_irq_restore(1) 45#define raw_local_irq_enable() raw_local_irq_restore(1)
46#define local_save_flags(flags) ((flags) = local_get_flags()) 46#define raw_local_save_flags(flags) ((flags) = local_get_flags())
47#define local_irq_save(flags) ((flags) = local_irq_disable()) 47#define raw_local_irq_save(flags) ((flags) = raw_local_irq_disable())
48 48
49#define irqs_disabled() (local_get_flags() == 0) 49#define raw_irqs_disabled() (local_get_flags() == 0)
50#define raw_irqs_disabled_flags(flags) ((flags) == 0)
50 51
51#define __hard_irq_enable() __mtmsrd(mfmsr() | MSR_EE, 1) 52#define __hard_irq_enable() __mtmsrd(mfmsr() | MSR_EE, 1)
52#define __hard_irq_disable() __mtmsrd(mfmsr() & ~MSR_EE, 1) 53#define __hard_irq_disable() __mtmsrd(mfmsr() & ~MSR_EE, 1)
diff --git a/include/asm-powerpc/immap_qe.h b/include/asm-powerpc/immap_qe.h
index 82a452615097..7b6f411db3e6 100644
--- a/include/asm-powerpc/immap_qe.h
+++ b/include/asm-powerpc/immap_qe.h
@@ -20,6 +20,7 @@
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <asm/io.h>
23 24
24#define QE_IMMAP_SIZE (1024 * 1024) /* 1MB from 1MB+IMMR */ 25#define QE_IMMAP_SIZE (1024 * 1024) /* 1MB from 1MB+IMMR */
25 26
@@ -468,7 +469,7 @@ struct qe_immap {
468 u8 res18[0xC0000]; /* 0x140000 - 0x200000 */ 469 u8 res18[0xC0000]; /* 0x140000 - 0x200000 */
469} __attribute__ ((packed)); 470} __attribute__ ((packed));
470 471
471extern struct qe_immap *qe_immr; 472extern struct qe_immap __iomem *qe_immr;
472extern phys_addr_t get_qe_base(void); 473extern phys_addr_t get_qe_base(void);
473 474
474static inline unsigned long immrbar_virt_to_phys(void *address) 475static inline unsigned long immrbar_virt_to_phys(void *address)
diff --git a/include/asm-powerpc/irqflags.h b/include/asm-powerpc/irqflags.h
index 7970cbaeaa54..cc6fdba33660 100644
--- a/include/asm-powerpc/irqflags.h
+++ b/include/asm-powerpc/irqflags.h
@@ -2,30 +2,43 @@
2 * include/asm-powerpc/irqflags.h 2 * include/asm-powerpc/irqflags.h
3 * 3 *
4 * IRQ flags handling 4 * IRQ flags handling
5 *
6 * This file gets included from lowlevel asm headers too, to provide
7 * wrapped versions of the local_irq_*() APIs, based on the
8 * raw_local_irq_*() macros from the lowlevel headers.
9 */ 5 */
10#ifndef _ASM_IRQFLAGS_H 6#ifndef _ASM_IRQFLAGS_H
11#define _ASM_IRQFLAGS_H 7#define _ASM_IRQFLAGS_H
12 8
9#ifndef __ASSEMBLY__
13/* 10/*
14 * Get definitions for raw_local_save_flags(x), etc. 11 * Get definitions for raw_local_save_flags(x), etc.
15 */ 12 */
16#include <asm-powerpc/hw_irq.h> 13#include <asm-powerpc/hw_irq.h>
17 14
15#else
16#ifdef CONFIG_TRACE_IRQFLAGS
18/* 17/*
19 * Do the CPU's IRQ-state tracing from assembly code. We call a 18 * Most of the CPU's IRQ-state tracing is done from assembly code; we
20 * C function, so save all the C-clobbered registers: 19 * have to call a C function so call a wrapper that saves all the
20 * C-clobbered registers.
21 */ 21 */
22#ifdef CONFIG_TRACE_IRQFLAGS 22#define TRACE_ENABLE_INTS bl .trace_hardirqs_on
23 23#define TRACE_DISABLE_INTS bl .trace_hardirqs_off
24#error No support on PowerPC yet for CONFIG_TRACE_IRQFLAGS 24#define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \
25 25 cmpdi en, 0; \
26 bne 95f; \
27 stb en,PACASOFTIRQEN(r13); \
28 bl .trace_hardirqs_off; \
29 b skip; \
3095: bl .trace_hardirqs_on; \
31 li en,1;
32#define TRACE_AND_RESTORE_IRQ(en) \
33 TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f); \
3496: stb en,PACASOFTIRQEN(r13)
26#else 35#else
27# define TRACE_IRQS_ON 36#define TRACE_ENABLE_INTS
28# define TRACE_IRQS_OFF 37#define TRACE_DISABLE_INTS
38#define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip)
39#define TRACE_AND_RESTORE_IRQ(en) \
40 stb en,PACASOFTIRQEN(r13)
41#endif
29#endif 42#endif
30 43
31#endif 44#endif
diff --git a/include/asm-powerpc/iseries/alpaca.h b/include/asm-powerpc/iseries/alpaca.h
new file mode 100644
index 000000000000..c0cce6727a69
--- /dev/null
+++ b/include/asm-powerpc/iseries/alpaca.h
@@ -0,0 +1,31 @@
1/*
2 * Copyright © 2008 Stephen Rothwell IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef _ASM_POWERPC_ISERIES_ALPACA_H
19#define _ASM_POWERPC_ISERIES_ALPACA_H
20
21/*
22 * This is the part of the paca that the iSeries hypervisor
23 * needs to be statically initialised. Immediately after boot
24 * we switch to the normal Linux paca.
25 */
26struct alpaca {
27 struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */
28 const void *reg_save_ptr; /* Pointer to LpRegSave for PLIC */
29};
30
31#endif /* _ASM_POWERPC_ISERIES_ALPACA_H */
diff --git a/include/asm-powerpc/iseries/it_lp_reg_save.h b/include/asm-powerpc/iseries/it_lp_reg_save.h
deleted file mode 100644
index 5403b756f654..000000000000
--- a/include/asm-powerpc/iseries/it_lp_reg_save.h
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H
19#define _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H
20
21/*
22 * This control block contains the data that is shared between PLIC
23 * and the OS
24 */
25
26struct ItLpRegSave {
27 u32 xDesc; // Eye catcher "LpRS" ebcdic 000-003
28 u16 xSize; // Size of this class 004-005
29 u8 xInUse; // Area is live 006-007
30 u8 xRsvd1[9]; // Reserved 007-00F
31
32 u8 xFixedRegSave[352]; // Fixed Register Save Area 010-16F
33 u32 xCTRL; // Control Register 170-173
34 u32 xDEC; // Decrementer 174-177
35 u32 xFPSCR; // FP Status and Control Reg 178-17B
36 u32 xPVR; // Processor Version Number 17C-17F
37
38 u64 xMMCR0; // Monitor Mode Control Reg 0 180-187
39 u32 xPMC1; // Perf Monitor Counter 1 188-18B
40 u32 xPMC2; // Perf Monitor Counter 2 18C-18F
41 u32 xPMC3; // Perf Monitor Counter 3 190-193
42 u32 xPMC4; // Perf Monitor Counter 4 194-197
43 u32 xPIR; // Processor ID Reg 198-19B
44
45 u32 xMMCR1; // Monitor Mode Control Reg 1 19C-19F
46 u32 xMMCRA; // Monitor Mode Control Reg A 1A0-1A3
47 u32 xPMC5; // Perf Monitor Counter 5 1A4-1A7
48 u32 xPMC6; // Perf Monitor Counter 6 1A8-1AB
49 u32 xPMC7; // Perf Monitor Counter 7 1AC-1AF
50 u32 xPMC8; // Perf Monitor Counter 8 1B0-1B3
51 u32 xTSC; // Thread Switch Control 1B4-1B7
52 u32 xTST; // Thread Switch Timeout 1B8-1BB
53 u32 xRsvd; // Reserved 1BC-1BF
54
55 u64 xACCR; // Address Compare Control Reg 1C0-1C7
56 u64 xIMR; // Instruction Match Register 1C8-1CF
57 u64 xSDR1; // Storage Description Reg 1 1D0-1D7
58 u64 xSPRG0; // Special Purpose Reg General0 1D8-1DF
59 u64 xSPRG1; // Special Purpose Reg General1 1E0-1E7
60 u64 xSPRG2; // Special Purpose Reg General2 1E8-1EF
61 u64 xSPRG3; // Special Purpose Reg General3 1F0-1F7
62 u64 xTB; // Time Base Register 1F8-1FF
63
64 u64 xFPR[32]; // Floating Point Registers 200-2FF
65
66 u64 xMSR; // Machine State Register 300-307
67 u64 xNIA; // Next Instruction Address 308-30F
68
69 u64 xDABR; // Data Address Breakpoint Reg 310-317
70 u64 xIABR; // Inst Address Breakpoint Reg 318-31F
71
72 u64 xHID0; // HW Implementation Dependent0 320-327
73
74 u64 xHID4; // HW Implementation Dependent4 328-32F
75 u64 xSCOMd; // SCON Data Reg (SPRG4) 330-337
76 u64 xSCOMc; // SCON Command Reg (SPRG5) 338-33F
77 u64 xSDAR; // Sample Data Address Register 340-347
78 u64 xSIAR; // Sample Inst Address Register 348-34F
79
80 u8 xRsvd3[176]; // Reserved 350-3FF
81};
82
83extern struct ItLpRegSave iseries_reg_save[];
84
85#endif /* _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H */
diff --git a/include/asm-powerpc/lmb.h b/include/asm-powerpc/lmb.h
index 5d1dc48a0bb8..6f5fdf0a19ae 100644
--- a/include/asm-powerpc/lmb.h
+++ b/include/asm-powerpc/lmb.h
@@ -1,81 +1,15 @@
1#ifndef _ASM_POWERPC_LMB_H 1#ifndef _ASM_POWERPC_LMB_H
2#define _ASM_POWERPC_LMB_H 2#define _ASM_POWERPC_LMB_H
3#ifdef __KERNEL__
4 3
5/* 4#include <asm/udbg.h>
6 * Definitions for talking to the Open Firmware PROM on
7 * Power Macintosh computers.
8 *
9 * Copyright (C) 2001 Peter Bergner, IBM Corp.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
15 */
16 5
17#include <linux/init.h> 6#define LMB_DBG(fmt...) udbg_printf(fmt)
18#include <asm/prom.h>
19 7
20#define MAX_LMB_REGIONS 128 8#ifdef CONFIG_PPC32
9extern phys_addr_t lowmem_end_addr;
10#define LMB_REAL_LIMIT lowmem_end_addr
11#else
12#define LMB_REAL_LIMIT 0
13#endif
21 14
22struct lmb_property {
23 unsigned long base;
24 unsigned long size;
25};
26
27struct lmb_region {
28 unsigned long cnt;
29 unsigned long size;
30 struct lmb_property region[MAX_LMB_REGIONS+1];
31};
32
33struct lmb {
34 unsigned long debug;
35 unsigned long rmo_size;
36 struct lmb_region memory;
37 struct lmb_region reserved;
38};
39
40extern struct lmb lmb;
41
42extern void __init lmb_init(void);
43extern void __init lmb_analyze(void);
44extern long __init lmb_add(unsigned long base, unsigned long size);
45extern long __init lmb_reserve(unsigned long base, unsigned long size);
46extern unsigned long __init lmb_alloc(unsigned long size, unsigned long align);
47extern unsigned long __init lmb_alloc_base(unsigned long size,
48 unsigned long align, unsigned long max_addr);
49extern unsigned long __init __lmb_alloc_base(unsigned long size,
50 unsigned long align, unsigned long max_addr);
51extern unsigned long __init lmb_phys_mem_size(void);
52extern unsigned long __init lmb_end_of_DRAM(void);
53extern void __init lmb_enforce_memory_limit(unsigned long memory_limit);
54extern int __init lmb_is_reserved(unsigned long addr);
55
56extern void lmb_dump_all(void);
57
58static inline unsigned long
59lmb_size_bytes(struct lmb_region *type, unsigned long region_nr)
60{
61 return type->region[region_nr].size;
62}
63static inline unsigned long
64lmb_size_pages(struct lmb_region *type, unsigned long region_nr)
65{
66 return lmb_size_bytes(type, region_nr) >> PAGE_SHIFT;
67}
68static inline unsigned long
69lmb_start_pfn(struct lmb_region *type, unsigned long region_nr)
70{
71 return type->region[region_nr].base >> PAGE_SHIFT;
72}
73static inline unsigned long
74lmb_end_pfn(struct lmb_region *type, unsigned long region_nr)
75{
76 return lmb_start_pfn(type, region_nr) +
77 lmb_size_pages(type, region_nr);
78}
79
80#endif /* __KERNEL__ */
81#endif /* _ASM_POWERPC_LMB_H */ 15#endif /* _ASM_POWERPC_LMB_H */
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 0872ec228c1e..54ed64df95b8 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -68,6 +68,8 @@ struct machdep_calls {
68 unsigned long vflags, 68 unsigned long vflags,
69 int psize, int ssize); 69 int psize, int ssize);
70 long (*hpte_remove)(unsigned long hpte_group); 70 long (*hpte_remove)(unsigned long hpte_group);
71 void (*hpte_removebolted)(unsigned long ea,
72 int psize, int ssize);
71 void (*flush_hash_range)(unsigned long number, int local); 73 void (*flush_hash_range)(unsigned long number, int local);
72 74
73 /* special for kexec, to be called in real mode, linar mapping is 75 /* special for kexec, to be called in real mode, linar mapping is
@@ -196,9 +198,6 @@ struct machdep_calls {
196 May be NULL. */ 198 May be NULL. */
197 void (*init)(void); 199 void (*init)(void);
198 200
199 void (*setup_io_mappings)(void);
200
201 void (*early_serial_map)(void);
202 void (*kgdb_map_scc)(void); 201 void (*kgdb_map_scc)(void);
203 202
204 /* 203 /*
diff --git a/include/asm-powerpc/macio.h b/include/asm-powerpc/macio.h
index 3a6cb1a513b7..079c06eae446 100644
--- a/include/asm-powerpc/macio.h
+++ b/include/asm-powerpc/macio.h
@@ -2,7 +2,7 @@
2#define __MACIO_ASIC_H__ 2#define __MACIO_ASIC_H__
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <asm/of_device.h> 5#include <linux/of_device.h>
6 6
7extern struct bus_type macio_bus_type; 7extern struct bus_type macio_bus_type;
8 8
diff --git a/include/asm-powerpc/mmu-40x.h b/include/asm-powerpc/mmu-40x.h
index 7d37f77043ac..3d108676584c 100644
--- a/include/asm-powerpc/mmu-40x.h
+++ b/include/asm-powerpc/mmu-40x.h
@@ -53,8 +53,6 @@
53 53
54#ifndef __ASSEMBLY__ 54#ifndef __ASSEMBLY__
55 55
56typedef unsigned long phys_addr_t;
57
58typedef struct { 56typedef struct {
59 unsigned long id; 57 unsigned long id;
60 unsigned long vdso_base; 58 unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-44x.h b/include/asm-powerpc/mmu-44x.h
index 62772ae839ca..c8b02d97f753 100644
--- a/include/asm-powerpc/mmu-44x.h
+++ b/include/asm-powerpc/mmu-44x.h
@@ -53,8 +53,6 @@
53 53
54#ifndef __ASSEMBLY__ 54#ifndef __ASSEMBLY__
55 55
56typedef unsigned long long phys_addr_t;
57
58typedef struct { 56typedef struct {
59 unsigned long id; 57 unsigned long id;
60 unsigned long vdso_base; 58 unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-8xx.h b/include/asm-powerpc/mmu-8xx.h
index 952bd8899f2f..9db877eb88db 100644
--- a/include/asm-powerpc/mmu-8xx.h
+++ b/include/asm-powerpc/mmu-8xx.h
@@ -136,8 +136,6 @@
136#define SPRN_M_TW 799 136#define SPRN_M_TW 799
137 137
138#ifndef __ASSEMBLY__ 138#ifndef __ASSEMBLY__
139typedef unsigned long phys_addr_t;
140
141typedef struct { 139typedef struct {
142 unsigned long id; 140 unsigned long id;
143 unsigned long vdso_base; 141 unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-fsl-booke.h b/include/asm-powerpc/mmu-fsl-booke.h
index 37580004cd7a..925d93cf64d8 100644
--- a/include/asm-powerpc/mmu-fsl-booke.h
+++ b/include/asm-powerpc/mmu-fsl-booke.h
@@ -73,12 +73,6 @@
73 73
74#ifndef __ASSEMBLY__ 74#ifndef __ASSEMBLY__
75 75
76#ifndef CONFIG_PHYS_64BIT
77typedef unsigned long phys_addr_t;
78#else
79typedef unsigned long long phys_addr_t;
80#endif
81
82typedef struct { 76typedef struct {
83 unsigned long id; 77 unsigned long id;
84 unsigned long vdso_base; 78 unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-hash32.h b/include/asm-powerpc/mmu-hash32.h
index 4bd735be3833..6e21ca618ec3 100644
--- a/include/asm-powerpc/mmu-hash32.h
+++ b/include/asm-powerpc/mmu-hash32.h
@@ -84,8 +84,6 @@ typedef struct {
84 unsigned long vdso_base; 84 unsigned long vdso_base;
85} mm_context_t; 85} mm_context_t;
86 86
87typedef unsigned long phys_addr_t;
88
89#endif /* !__ASSEMBLY__ */ 87#endif /* !__ASSEMBLY__ */
90 88
91#endif /* _ASM_POWERPC_MMU_HASH32_H_ */ 89#endif /* _ASM_POWERPC_MMU_HASH32_H_ */
diff --git a/include/asm-powerpc/mmu-hash64.h b/include/asm-powerpc/mmu-hash64.h
index 2864fa3989ea..0dff76776044 100644
--- a/include/asm-powerpc/mmu-hash64.h
+++ b/include/asm-powerpc/mmu-hash64.h
@@ -469,9 +469,6 @@ static inline unsigned long get_vsid(unsigned long context, unsigned long ea,
469 VSID_MODULUS_256M) 469 VSID_MODULUS_256M)
470#define KERNEL_VSID(ea) VSID_SCRAMBLE(GET_ESID(ea)) 470#define KERNEL_VSID(ea) VSID_SCRAMBLE(GET_ESID(ea))
471 471
472/* Physical address used by some IO functions */
473typedef unsigned long phys_addr_t;
474
475#endif /* __ASSEMBLY__ */ 472#endif /* __ASSEMBLY__ */
476 473
477#endif /* _ASM_POWERPC_MMU_HASH64_H_ */ 474#endif /* _ASM_POWERPC_MMU_HASH64_H_ */
diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h
index 748b35ab37b5..eb61b9c1edfd 100644
--- a/include/asm-powerpc/paca.h
+++ b/include/asm-powerpc/paca.h
@@ -42,10 +42,7 @@ struct task_struct;
42 * Defines the layout of the paca. 42 * Defines the layout of the paca.
43 * 43 *
44 * This structure is not directly accessed by firmware or the service 44 * This structure is not directly accessed by firmware or the service
45 * processor except for the first two pointers that point to the 45 * processor.
46 * lppaca area and the ItLpRegSave area for this CPU. The lppaca
47 * object is currently contained within the PACA but it doesn't need
48 * to be.
49 */ 46 */
50struct paca_struct { 47struct paca_struct {
51 /* 48 /*
@@ -55,14 +52,7 @@ struct paca_struct {
55 * avoid cacheline bouncing. 52 * avoid cacheline bouncing.
56 */ 53 */
57 54
58 /*
59 * MAGIC: These first two pointers can't be moved - they're
60 * accessed by the firmware
61 */
62 struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */ 55 struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */
63#ifdef CONFIG_PPC_ISERIES
64 void *reg_save_ptr; /* Pointer to LpRegSave for PLIC */
65#endif /* CONFIG_PPC_ISERIES */
66 56
67 /* 57 /*
68 * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c 58 * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c
diff --git a/include/asm-powerpc/page.h b/include/asm-powerpc/page.h
index df47bbb6ea13..6c850609b847 100644
--- a/include/asm-powerpc/page.h
+++ b/include/asm-powerpc/page.h
@@ -53,6 +53,7 @@
53 53
54#define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START) 54#define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START)
55#define KERNELBASE (PAGE_OFFSET + PHYSICAL_START) 55#define KERNELBASE (PAGE_OFFSET + PHYSICAL_START)
56#define LOAD_OFFSET PAGE_OFFSET
56 57
57#ifdef CONFIG_FLATMEM 58#ifdef CONFIG_FLATMEM
58#define pfn_valid(pfn) ((pfn) < max_mapnr) 59#define pfn_valid(pfn) ((pfn) < max_mapnr)
diff --git a/include/asm-powerpc/page_32.h b/include/asm-powerpc/page_32.h
index 65ea19eec956..51f8134b5939 100644
--- a/include/asm-powerpc/page_32.h
+++ b/include/asm-powerpc/page_32.h
@@ -3,8 +3,6 @@
3 3
4#define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32 4#define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32
5 5
6#define PPC_MEMSTART 0
7
8#ifdef CONFIG_NOT_COHERENT_CACHE 6#ifdef CONFIG_NOT_COHERENT_CACHE
9#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES 7#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
10#endif 8#endif
diff --git a/include/asm-powerpc/pasemi_dma.h b/include/asm-powerpc/pasemi_dma.h
index b4526ff3a50d..19fd7933e2d9 100644
--- a/include/asm-powerpc/pasemi_dma.h
+++ b/include/asm-powerpc/pasemi_dma.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2006 PA Semi, Inc 2 * Copyright (C) 2006-2008 PA Semi, Inc
3 * 3 *
4 * Hardware register layout and descriptor formats for the on-board 4 * Hardware register layout and descriptor formats for the on-board
5 * DMA engine on PA Semi PWRficient. Used by ethernet, function and security 5 * DMA engine on PA Semi PWRficient. Used by ethernet, function and security
@@ -40,6 +40,11 @@ enum {
40 PAS_DMA_COM_TXSTA = 0x104, /* Transmit Status Register */ 40 PAS_DMA_COM_TXSTA = 0x104, /* Transmit Status Register */
41 PAS_DMA_COM_RXCMD = 0x108, /* Receive Command Register */ 41 PAS_DMA_COM_RXCMD = 0x108, /* Receive Command Register */
42 PAS_DMA_COM_RXSTA = 0x10c, /* Receive Status Register */ 42 PAS_DMA_COM_RXSTA = 0x10c, /* Receive Status Register */
43 PAS_DMA_COM_CFG = 0x114, /* Common config reg */
44 PAS_DMA_TXF_SFLG0 = 0x140, /* Set flags */
45 PAS_DMA_TXF_SFLG1 = 0x144, /* Set flags */
46 PAS_DMA_TXF_CFLG0 = 0x148, /* Set flags */
47 PAS_DMA_TXF_CFLG1 = 0x14c, /* Set flags */
43}; 48};
44 49
45 50
@@ -123,11 +128,16 @@ enum {
123#define PAS_DMA_TXCHAN_TCMDSTA_DA 0x00000100 128#define PAS_DMA_TXCHAN_TCMDSTA_DA 0x00000100
124#define PAS_DMA_TXCHAN_CFG(c) (0x304+(c)*_PAS_DMA_TXCHAN_STRIDE) 129#define PAS_DMA_TXCHAN_CFG(c) (0x304+(c)*_PAS_DMA_TXCHAN_STRIDE)
125#define PAS_DMA_TXCHAN_CFG_TY_IFACE 0x00000000 /* Type = interface */ 130#define PAS_DMA_TXCHAN_CFG_TY_IFACE 0x00000000 /* Type = interface */
131#define PAS_DMA_TXCHAN_CFG_TY_COPY 0x00000001 /* Type = copy only */
132#define PAS_DMA_TXCHAN_CFG_TY_FUNC 0x00000002 /* Type = function */
133#define PAS_DMA_TXCHAN_CFG_TY_XOR 0x00000003 /* Type = xor only */
126#define PAS_DMA_TXCHAN_CFG_TATTR_M 0x0000003c 134#define PAS_DMA_TXCHAN_CFG_TATTR_M 0x0000003c
127#define PAS_DMA_TXCHAN_CFG_TATTR_S 2 135#define PAS_DMA_TXCHAN_CFG_TATTR_S 2
128#define PAS_DMA_TXCHAN_CFG_TATTR(x) (((x) << PAS_DMA_TXCHAN_CFG_TATTR_S) & \ 136#define PAS_DMA_TXCHAN_CFG_TATTR(x) (((x) << PAS_DMA_TXCHAN_CFG_TATTR_S) & \
129 PAS_DMA_TXCHAN_CFG_TATTR_M) 137 PAS_DMA_TXCHAN_CFG_TATTR_M)
130#define PAS_DMA_TXCHAN_CFG_WT_M 0x000001c0 138#define PAS_DMA_TXCHAN_CFG_LPDQ 0x00000800
139#define PAS_DMA_TXCHAN_CFG_LPSQ 0x00000400
140#define PAS_DMA_TXCHAN_CFG_WT_M 0x000003c0
131#define PAS_DMA_TXCHAN_CFG_WT_S 6 141#define PAS_DMA_TXCHAN_CFG_WT_S 6
132#define PAS_DMA_TXCHAN_CFG_WT(x) (((x) << PAS_DMA_TXCHAN_CFG_WT_S) & \ 142#define PAS_DMA_TXCHAN_CFG_WT(x) (((x) << PAS_DMA_TXCHAN_CFG_WT_S) & \
133 PAS_DMA_TXCHAN_CFG_WT_M) 143 PAS_DMA_TXCHAN_CFG_WT_M)
@@ -394,11 +404,62 @@ enum {
394 XCT_COPY_LLEN_M) 404 XCT_COPY_LLEN_M)
395#define XCT_COPY_SE 0x0000000000000001ull 405#define XCT_COPY_SE 0x0000000000000001ull
396 406
407/* Function descriptor fields */
408#define XCT_FUN_T 0x8000000000000000ull
409#define XCT_FUN_ST 0x4000000000000000ull
410#define XCT_FUN_RR_M 0x3000000000000000ull
411#define XCT_FUN_RR_NORES 0x0000000000000000ull
412#define XCT_FUN_RR_8BRES 0x1000000000000000ull
413#define XCT_FUN_RR_24BRES 0x2000000000000000ull
414#define XCT_FUN_RR_40BRES 0x3000000000000000ull
415#define XCT_FUN_I 0x0800000000000000ull
416#define XCT_FUN_O 0x0400000000000000ull
417#define XCT_FUN_E 0x0200000000000000ull
418#define XCT_FUN_FUN_M 0x01c0000000000000ull
419#define XCT_FUN_FUN_S 54
420#define XCT_FUN_FUN(x) ((((long)(x)) << XCT_FUN_FUN_S) & XCT_FUN_FUN_M)
421#define XCT_FUN_CRM_M 0x0038000000000000ull
422#define XCT_FUN_CRM_NOP 0x0000000000000000ull
423#define XCT_FUN_CRM_SIG 0x0008000000000000ull
424#define XCT_FUN_LLEN_M 0x0007ffff00000000ull
425#define XCT_FUN_LLEN_S 32
426#define XCT_FUN_LLEN(x) ((((long)(x)) << XCT_FUN_LLEN_S) & XCT_FUN_LLEN_M)
427#define XCT_FUN_SHL_M 0x00000000f8000000ull
428#define XCT_FUN_SHL_S 27
429#define XCT_FUN_SHL(x) ((((long)(x)) << XCT_FUN_SHL_S) & XCT_FUN_SHL_M)
430#define XCT_FUN_CHL_M 0x0000000007c00000ull
431#define XCT_FUN_HSZ_M 0x00000000003c0000ull
432#define XCT_FUN_ALG_M 0x0000000000038000ull
433#define XCT_FUN_HP 0x0000000000004000ull
434#define XCT_FUN_BCM_M 0x0000000000003800ull
435#define XCT_FUN_BCP_M 0x0000000000000600ull
436#define XCT_FUN_SIG_M 0x00000000000001f0ull
437#define XCT_FUN_SIG_TCP4 0x0000000000000140ull
438#define XCT_FUN_SIG_TCP6 0x0000000000000150ull
439#define XCT_FUN_SIG_UDP4 0x0000000000000160ull
440#define XCT_FUN_SIG_UDP6 0x0000000000000170ull
441#define XCT_FUN_A 0x0000000000000008ull
442#define XCT_FUN_C 0x0000000000000004ull
443#define XCT_FUN_AL2 0x0000000000000002ull
444#define XCT_FUN_SE 0x0000000000000001ull
445
446/* Function descriptor 8byte result fields */
447#define XCT_FUNRES_8B_CS_M 0x0000ffff00000000ull
448#define XCT_FUNRES_8B_CS_S 32
449#define XCT_FUNRES_8B_CRC_M 0x00000000ffffffffull
450#define XCT_FUNRES_8B_CRC_S 0
451
397/* Control descriptor fields */ 452/* Control descriptor fields */
398#define CTRL_CMD_T 0x8000000000000000ull 453#define CTRL_CMD_T 0x8000000000000000ull
399#define CTRL_CMD_META_EVT 0x2000000000000000ull 454#define CTRL_CMD_META_EVT 0x2000000000000000ull
400#define CTRL_CMD_O 0x0400000000000000ull 455#define CTRL_CMD_O 0x0400000000000000ull
401#define CTRL_CMD_REG_M 0x000000000000000full 456#define CTRL_CMD_ETYPE_M 0x0038000000000000ull
457#define CTRL_CMD_ETYPE_EXT 0x0000000000000000ull
458#define CTRL_CMD_ETYPE_WSET 0x0020000000000000ull
459#define CTRL_CMD_ETYPE_WCLR 0x0028000000000000ull
460#define CTRL_CMD_ETYPE_SET 0x0030000000000000ull
461#define CTRL_CMD_ETYPE_CLR 0x0038000000000000ull
462#define CTRL_CMD_REG_M 0x000000000000007full
402#define CTRL_CMD_REG_S 0 463#define CTRL_CMD_REG_S 0
403#define CTRL_CMD_REG(x) ((((long)(x)) << CTRL_CMD_REG_S) & \ 464#define CTRL_CMD_REG(x) ((((long)(x)) << CTRL_CMD_REG_S) & \
404 CTRL_CMD_REG_M) 465 CTRL_CMD_REG_M)
@@ -461,6 +522,16 @@ extern void *pasemi_dma_alloc_buf(struct pasemi_dmachan *chan, int size,
461extern void pasemi_dma_free_buf(struct pasemi_dmachan *chan, int size, 522extern void pasemi_dma_free_buf(struct pasemi_dmachan *chan, int size,
462 dma_addr_t *handle); 523 dma_addr_t *handle);
463 524
525/* Routines to allocate flags (events) for channel syncronization */
526extern int pasemi_dma_alloc_flag(void);
527extern void pasemi_dma_free_flag(int flag);
528extern void pasemi_dma_set_flag(int flag);
529extern void pasemi_dma_clear_flag(int flag);
530
531/* Routines to allocate function engines */
532extern int pasemi_dma_alloc_fun(void);
533extern void pasemi_dma_free_fun(int fun);
534
464/* Initialize the library, must be called before any other functions */ 535/* Initialize the library, must be called before any other functions */
465extern int pasemi_dma_init(void); 536extern int pasemi_dma_init(void);
466 537
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index e5802c62f428..b95d033ae6e6 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -117,7 +117,7 @@ struct pci_controller {
117 117
118#ifndef CONFIG_PPC64 118#ifndef CONFIG_PPC64
119 119
120static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) 120static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
121{ 121{
122 return bus->sysdata; 122 return bus->sysdata;
123} 123}
@@ -235,7 +235,7 @@ extern void pcibios_fixup_new_pci_devices(struct pci_bus *bus);
235 235
236extern int pcibios_remove_root_bus(struct pci_controller *phb); 236extern int pcibios_remove_root_bus(struct pci_controller *phb);
237 237
238static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) 238static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
239{ 239{
240 struct device_node *busdn = bus->sysdata; 240 struct device_node *busdn = bus->sysdata;
241 241
diff --git a/include/asm-powerpc/pgtable-ppc32.h b/include/asm-powerpc/pgtable-ppc32.h
index 2c79f550272b..daea7692d070 100644
--- a/include/asm-powerpc/pgtable-ppc32.h
+++ b/include/asm-powerpc/pgtable-ppc32.h
@@ -98,9 +98,6 @@ extern int icache_44x_need_flush;
98#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 98#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
99#define FIRST_USER_ADDRESS 0 99#define FIRST_USER_ADDRESS 0
100 100
101#define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
102#define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
103
104#define pte_ERROR(e) \ 101#define pte_ERROR(e) \
105 printk("%s:%d: bad pte %llx.\n", __FILE__, __LINE__, \ 102 printk("%s:%d: bad pte %llx.\n", __FILE__, __LINE__, \
106 (unsigned long long)pte_val(e)) 103 (unsigned long long)pte_val(e))
@@ -420,7 +417,8 @@ extern int icache_44x_need_flush;
420#define _PAGE_IO (_PAGE_KERNEL | _PAGE_NO_CACHE | _PAGE_GUARDED) 417#define _PAGE_IO (_PAGE_KERNEL | _PAGE_NO_CACHE | _PAGE_GUARDED)
421#define _PAGE_RAM (_PAGE_KERNEL | _PAGE_HWEXEC) 418#define _PAGE_RAM (_PAGE_KERNEL | _PAGE_HWEXEC)
422 419
423#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH) 420#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH) ||\
421 defined(CONFIG_KPROBES)
424/* We want the debuggers to be able to set breakpoints anywhere, so 422/* We want the debuggers to be able to set breakpoints anywhere, so
425 * don't write protect the kernel text */ 423 * don't write protect the kernel text */
426#define _PAGE_RAM_TEXT _PAGE_RAM 424#define _PAGE_RAM_TEXT _PAGE_RAM
@@ -692,7 +690,7 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
692#define pmd_page_vaddr(pmd) \ 690#define pmd_page_vaddr(pmd) \
693 ((unsigned long) (pmd_val(pmd) & PAGE_MASK)) 691 ((unsigned long) (pmd_val(pmd) & PAGE_MASK))
694#define pmd_page(pmd) \ 692#define pmd_page(pmd) \
695 (mem_map + (__pa(pmd_val(pmd)) >> PAGE_SHIFT)) 693 pfn_to_page((__pa(pmd_val(pmd)) >> PAGE_SHIFT))
696#endif 694#endif
697 695
698/* to find an entry in a kernel page-table-directory */ 696/* to find an entry in a kernel page-table-directory */
diff --git a/include/asm-powerpc/phyp_dump.h b/include/asm-powerpc/phyp_dump.h
new file mode 100644
index 000000000000..fa74c6c3e106
--- /dev/null
+++ b/include/asm-powerpc/phyp_dump.h
@@ -0,0 +1,47 @@
1/*
2 * Hypervisor-assisted dump
3 *
4 * Linas Vepstas, Manish Ahuja 2008
5 * Copyright 2008 IBM Corp.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#ifndef _PPC64_PHYP_DUMP_H
14#define _PPC64_PHYP_DUMP_H
15
16#ifdef CONFIG_PHYP_DUMP
17
18/* The RMR region will be saved for later dumping
19 * whenever the kernel crashes. Set this to 256MB. */
20#define PHYP_DUMP_RMR_START 0x0
21#define PHYP_DUMP_RMR_END (1UL<<28)
22
23struct phyp_dump {
24 /* Memory that is reserved during very early boot. */
25 unsigned long init_reserve_start;
26 unsigned long init_reserve_size;
27 /* cmd line options during boot */
28 unsigned long reserve_bootvar;
29 unsigned long phyp_dump_at_boot;
30 /* Check status during boot if dump supported, active & present*/
31 unsigned long phyp_dump_configured;
32 unsigned long phyp_dump_is_active;
33 /* store cpu & hpte size */
34 unsigned long cpu_state_size;
35 unsigned long hpte_region_size;
36 /* previous scratch area values */
37 unsigned long reserved_scratch_addr;
38 unsigned long reserved_scratch_size;
39};
40
41extern struct phyp_dump *phyp_dump_info;
42
43int early_init_dt_scan_phyp_dump(unsigned long node,
44 const char *uname, int depth, void *data);
45
46#endif /* CONFIG_PHYP_DUMP */
47#endif /* _PPC64_PHYP_DUMP_H */
diff --git a/include/asm-powerpc/pmi.h b/include/asm-powerpc/pmi.h
index 2259d4ce3846..e1dc090748df 100644
--- a/include/asm-powerpc/pmi.h
+++ b/include/asm-powerpc/pmi.h
@@ -29,8 +29,6 @@
29 29
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31 31
32#include <asm/of_device.h>
33
34#define PMI_TYPE_FREQ_CHANGE 0x01 32#define PMI_TYPE_FREQ_CHANGE 0x01
35#define PMI_READ_TYPE 0 33#define PMI_READ_TYPE 0
36#define PMI_READ_DATA0 1 34#define PMI_READ_DATA0 1
diff --git a/include/asm-powerpc/ppc4xx.h b/include/asm-powerpc/ppc4xx.h
new file mode 100644
index 000000000000..033039a80c42
--- /dev/null
+++ b/include/asm-powerpc/ppc4xx.h
@@ -0,0 +1,18 @@
1/*
2 * PPC4xx Prototypes and definitions
3 *
4 * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
5 *
6 * This is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 */
12
13#ifndef __ASM_POWERPC_PPC4xx_H__
14#define __ASM_POWERPC_PPC4xx_H__
15
16extern void ppc4xx_reset_system(char *cmd);
17
18#endif /* __ASM_POWERPC_PPC4xx_H__ */
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h
index 2b693673eff4..9e8ed6824e15 100644
--- a/include/asm-powerpc/ps3.h
+++ b/include/asm-powerpc/ps3.h
@@ -434,8 +434,11 @@ struct ps3_sys_manager_ops {
434}; 434};
435 435
436void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops); 436void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops);
437void ps3_sys_manager_power_off(void); 437void __noreturn ps3_sys_manager_power_off(void);
438void ps3_sys_manager_restart(void); 438void __noreturn ps3_sys_manager_restart(void);
439void __noreturn ps3_sys_manager_halt(void);
440int ps3_sys_manager_get_wol(void);
441void ps3_sys_manager_set_wol(int state);
439 442
440struct ps3_prealloc { 443struct ps3_prealloc {
441 const char *name; 444 const char *name;
diff --git a/include/asm-powerpc/ptrace.h b/include/asm-powerpc/ptrace.h
index 891d68932f39..39023dde1cc4 100644
--- a/include/asm-powerpc/ptrace.h
+++ b/include/asm-powerpc/ptrace.h
@@ -58,6 +58,11 @@ struct pt_regs {
58#define __ARCH_WANT_COMPAT_SYS_PTRACE 58#define __ARCH_WANT_COMPAT_SYS_PTRACE
59 59
60#define STACK_FRAME_OVERHEAD 112 /* size of minimum stack frame */ 60#define STACK_FRAME_OVERHEAD 112 /* size of minimum stack frame */
61#define STACK_FRAME_LR_SAVE 2 /* Location of LR in stack frame */
62#define STACK_FRAME_REGS_MARKER ASM_CONST(0x7265677368657265)
63#define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + \
64 STACK_FRAME_OVERHEAD + 288)
65#define STACK_FRAME_MARKER 12
61 66
62/* Size of dummy stack frame allocated when calling signal handler. */ 67/* Size of dummy stack frame allocated when calling signal handler. */
63#define __SIGNAL_FRAMESIZE 128 68#define __SIGNAL_FRAMESIZE 128
@@ -66,6 +71,10 @@ struct pt_regs {
66#else /* __powerpc64__ */ 71#else /* __powerpc64__ */
67 72
68#define STACK_FRAME_OVERHEAD 16 /* size of minimum stack frame */ 73#define STACK_FRAME_OVERHEAD 16 /* size of minimum stack frame */
74#define STACK_FRAME_LR_SAVE 1 /* Location of LR in stack frame */
75#define STACK_FRAME_REGS_MARKER ASM_CONST(0x72656773)
76#define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD)
77#define STACK_FRAME_MARKER 2
69 78
70/* Size of stack frame allocated when calling signal handler. */ 79/* Size of stack frame allocated when calling signal handler. */
71#define __SIGNAL_FRAMESIZE 64 80#define __SIGNAL_FRAMESIZE 64
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h
index 430dc77b35fc..c3be6e2e1490 100644
--- a/include/asm-powerpc/qe.h
+++ b/include/asm-powerpc/qe.h
@@ -85,6 +85,7 @@ extern int par_io_data_set(u8 port, u8 pin, u8 val);
85/* QE internal API */ 85/* QE internal API */
86int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input); 86int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);
87enum qe_clock qe_clock_source(const char *source); 87enum qe_clock qe_clock_source(const char *source);
88unsigned int qe_get_brg_clk(void);
88int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier); 89int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier);
89int qe_get_snum(void); 90int qe_get_snum(void);
90void qe_put_snum(u8 snum); 91void qe_put_snum(u8 snum);
@@ -92,7 +93,16 @@ unsigned long qe_muram_alloc(int size, int align);
92int qe_muram_free(unsigned long offset); 93int qe_muram_free(unsigned long offset);
93unsigned long qe_muram_alloc_fixed(unsigned long offset, int size); 94unsigned long qe_muram_alloc_fixed(unsigned long offset, int size);
94void qe_muram_dump(void); 95void qe_muram_dump(void);
95void *qe_muram_addr(unsigned long offset); 96
97static inline void __iomem *qe_muram_addr(unsigned long offset)
98{
99 return (void __iomem *)&qe_immr->muram[offset];
100}
101
102static inline unsigned long qe_muram_offset(void __iomem *addr)
103{
104 return addr - (void __iomem *)qe_immr->muram;
105}
96 106
97/* Structure that defines QE firmware binary files. 107/* Structure that defines QE firmware binary files.
98 * 108 *
diff --git a/include/asm-powerpc/rwsem.h b/include/asm-powerpc/rwsem.h
index cefc14728cc5..a6cc93b78b98 100644
--- a/include/asm-powerpc/rwsem.h
+++ b/include/asm-powerpc/rwsem.h
@@ -32,11 +32,20 @@ struct rw_semaphore {
32#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) 32#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
33 spinlock_t wait_lock; 33 spinlock_t wait_lock;
34 struct list_head wait_list; 34 struct list_head wait_list;
35#ifdef CONFIG_DEBUG_LOCK_ALLOC
36 struct lockdep_map dep_map;
37#endif
35}; 38};
36 39
40#ifdef CONFIG_DEBUG_LOCK_ALLOC
41# define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname }
42#else
43# define __RWSEM_DEP_MAP_INIT(lockname)
44#endif
45
37#define __RWSEM_INITIALIZER(name) \ 46#define __RWSEM_INITIALIZER(name) \
38 { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ 47 { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \
39 LIST_HEAD_INIT((name).wait_list) } 48 LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) }
40 49
41#define DECLARE_RWSEM(name) \ 50#define DECLARE_RWSEM(name) \
42 struct rw_semaphore name = __RWSEM_INITIALIZER(name) 51 struct rw_semaphore name = __RWSEM_INITIALIZER(name)
@@ -46,12 +55,15 @@ extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
46extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem); 55extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem);
47extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem); 56extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
48 57
49static inline void init_rwsem(struct rw_semaphore *sem) 58extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
50{ 59 struct lock_class_key *key);
51 sem->count = RWSEM_UNLOCKED_VALUE; 60
52 spin_lock_init(&sem->wait_lock); 61#define init_rwsem(sem) \
53 INIT_LIST_HEAD(&sem->wait_list); 62 do { \
54} 63 static struct lock_class_key __key; \
64 \
65 __init_rwsem((sem), #sem, &__key); \
66 } while (0)
55 67
56/* 68/*
57 * lock for reading 69 * lock for reading
@@ -78,7 +90,7 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
78/* 90/*
79 * lock for writing 91 * lock for writing
80 */ 92 */
81static inline void __down_write(struct rw_semaphore *sem) 93static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
82{ 94{
83 int tmp; 95 int tmp;
84 96
@@ -88,6 +100,11 @@ static inline void __down_write(struct rw_semaphore *sem)
88 rwsem_down_write_failed(sem); 100 rwsem_down_write_failed(sem);
89} 101}
90 102
103static inline void __down_write(struct rw_semaphore *sem)
104{
105 __down_write_nested(sem, 0);
106}
107
91static inline int __down_write_trylock(struct rw_semaphore *sem) 108static inline int __down_write_trylock(struct rw_semaphore *sem)
92{ 109{
93 int tmp; 110 int tmp;
diff --git a/include/asm-powerpc/sparsemem.h b/include/asm-powerpc/sparsemem.h
index e8b493d52b4f..9aea8e9f0bd1 100644
--- a/include/asm-powerpc/sparsemem.h
+++ b/include/asm-powerpc/sparsemem.h
@@ -15,6 +15,7 @@
15 15
16#ifdef CONFIG_MEMORY_HOTPLUG 16#ifdef CONFIG_MEMORY_HOTPLUG
17extern void create_section_mapping(unsigned long start, unsigned long end); 17extern void create_section_mapping(unsigned long start, unsigned long end);
18extern int remove_section_mapping(unsigned long start, unsigned long end);
18#ifdef CONFIG_NUMA 19#ifdef CONFIG_NUMA
19extern int hot_add_scn_to_nid(unsigned long scn_addr); 20extern int hot_add_scn_to_nid(unsigned long scn_addr);
20#else 21#else
diff --git a/include/asm-powerpc/spinlock.h b/include/asm-powerpc/spinlock.h
index cc4cfceac67c..258c93993190 100644
--- a/include/asm-powerpc/spinlock.h
+++ b/include/asm-powerpc/spinlock.h
@@ -19,6 +19,7 @@
19 * 19 *
20 * (the type definitions are in asm/spinlock_types.h) 20 * (the type definitions are in asm/spinlock_types.h)
21 */ 21 */
22#include <linux/irqflags.h>
22#ifdef CONFIG_PPC64 23#ifdef CONFIG_PPC64
23#include <asm/paca.h> 24#include <asm/paca.h>
24#include <asm/hvcall.h> 25#include <asm/hvcall.h>
diff --git a/include/asm-powerpc/string.h b/include/asm-powerpc/string.h
index aa40f92c298d..e40010abcaf1 100644
--- a/include/asm-powerpc/string.h
+++ b/include/asm-powerpc/string.h
@@ -7,6 +7,7 @@
7#define __HAVE_ARCH_STRNCPY 7#define __HAVE_ARCH_STRNCPY
8#define __HAVE_ARCH_STRLEN 8#define __HAVE_ARCH_STRLEN
9#define __HAVE_ARCH_STRCMP 9#define __HAVE_ARCH_STRCMP
10#define __HAVE_ARCH_STRNCMP
10#define __HAVE_ARCH_STRCAT 11#define __HAVE_ARCH_STRCAT
11#define __HAVE_ARCH_MEMSET 12#define __HAVE_ARCH_MEMSET
12#define __HAVE_ARCH_MEMCPY 13#define __HAVE_ARCH_MEMCPY
@@ -18,6 +19,7 @@ extern char * strcpy(char *,const char *);
18extern char * strncpy(char *,const char *, __kernel_size_t); 19extern char * strncpy(char *,const char *, __kernel_size_t);
19extern __kernel_size_t strlen(const char *); 20extern __kernel_size_t strlen(const char *);
20extern int strcmp(const char *,const char *); 21extern int strcmp(const char *,const char *);
22extern int strncmp(const char *, const char *, __kernel_size_t);
21extern char * strcat(char *, const char *); 23extern char * strcat(char *, const char *);
22extern void * memset(void *,int,__kernel_size_t); 24extern void * memset(void *,int,__kernel_size_t);
23extern void * memcpy(void *,const void *,__kernel_size_t); 25extern void * memcpy(void *,const void *,__kernel_size_t);
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index 29552ff182aa..fab1674b31b6 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -5,6 +5,7 @@
5#define _ASM_POWERPC_SYSTEM_H 5#define _ASM_POWERPC_SYSTEM_H
6 6
7#include <linux/kernel.h> 7#include <linux/kernel.h>
8#include <linux/irqflags.h>
8 9
9#include <asm/hw_irq.h> 10#include <asm/hw_irq.h>
10 11
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h
index ca23b681ad05..100c6fbfc587 100644
--- a/include/asm-powerpc/topology.h
+++ b/include/asm-powerpc/topology.h
@@ -96,11 +96,10 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev,
96{ 96{
97} 97}
98 98
99#endif /* CONFIG_NUMA */
99 100
100#include <asm-generic/topology.h> 101#include <asm-generic/topology.h>
101 102
102#endif /* CONFIG_NUMA */
103
104#ifdef CONFIG_SMP 103#ifdef CONFIG_SMP
105#include <asm/cputable.h> 104#include <asm/cputable.h>
106#define smt_capable() (cpu_has_feature(CPU_FTR_SMT)) 105#define smt_capable() (cpu_has_feature(CPU_FTR_SMT))
diff --git a/include/asm-powerpc/types.h b/include/asm-powerpc/types.h
index 903fd1932436..c243a6ac60e5 100644
--- a/include/asm-powerpc/types.h
+++ b/include/asm-powerpc/types.h
@@ -84,6 +84,13 @@ typedef unsigned long long u64;
84 84
85typedef __vector128 vector128; 85typedef __vector128 vector128;
86 86
87/* Physical address used by some IO functions */
88#if defined(CONFIG_PPC64) || defined(CONFIG_PHYS_64BIT)
89typedef u64 phys_addr_t;
90#else
91typedef u32 phys_addr_t;
92#endif
93
87#ifdef __powerpc64__ 94#ifdef __powerpc64__
88typedef u64 dma_addr_t; 95typedef u64 dma_addr_t;
89#else 96#else
diff --git a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h
index 1379a4f76de3..3909a2eec286 100644
--- a/include/asm-ppc/ocp.h
+++ b/include/asm-ppc/ocp.h
@@ -31,7 +31,6 @@
31 31
32#include <asm/mmu.h> 32#include <asm/mmu.h>
33#include <asm/ocp_ids.h> 33#include <asm/ocp_ids.h>
34#include <asm/semaphore.h>
35 34
36#ifdef CONFIG_PPC_OCP 35#ifdef CONFIG_PPC_OCP
37 36
diff --git a/include/asm-sh/bugs.h b/include/asm-sh/bugs.h
index cfda7d5bf026..121b2ecddfc3 100644
--- a/include/asm-sh/bugs.h
+++ b/include/asm-sh/bugs.h
@@ -25,7 +25,7 @@ static void __init check_bugs(void)
25 case CPU_SH7619: 25 case CPU_SH7619:
26 *p++ = '2'; 26 *p++ = '2';
27 break; 27 break;
28 case CPU_SH7203 ... CPU_SH7263: 28 case CPU_SH7203 ... CPU_MXG:
29 *p++ = '2'; 29 *p++ = '2';
30 *p++ = 'a'; 30 *p++ = 'a';
31 break; 31 break;
diff --git a/include/asm-sh/cpu-sh4/freq.h b/include/asm-sh/cpu-sh4/freq.h
index ec028c649215..da46e67ae26d 100644
--- a/include/asm-sh/cpu-sh4/freq.h
+++ b/include/asm-sh/cpu-sh4/freq.h
@@ -10,14 +10,14 @@
10#ifndef __ASM_CPU_SH4_FREQ_H 10#ifndef __ASM_CPU_SH4_FREQ_H
11#define __ASM_CPU_SH4_FREQ_H 11#define __ASM_CPU_SH4_FREQ_H
12 12
13#if defined(CONFIG_CPU_SUBTYPE_SH7722) || defined(CONFIG_CPU_SUBTYPE_SH7366) 13#if defined(CONFIG_CPU_SUBTYPE_SH7722) || \
14 defined(CONFIG_CPU_SUBTYPE_SH7723) || \
15 defined(CONFIG_CPU_SUBTYPE_SH7366)
14#define FRQCR 0xa4150000 16#define FRQCR 0xa4150000
15#define VCLKCR 0xa4150004 17#define VCLKCR 0xa4150004
16#define SCLKACR 0xa4150008 18#define SCLKACR 0xa4150008
17#define SCLKBCR 0xa415000c 19#define SCLKBCR 0xa415000c
18#if defined(CONFIG_CPU_SUBTYPE_SH7722)
19#define IrDACLKCR 0xa4150010 20#define IrDACLKCR 0xa4150010
20#endif
21#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ 21#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
22 defined(CONFIG_CPU_SUBTYPE_SH7780) 22 defined(CONFIG_CPU_SUBTYPE_SH7780)
23#define FRQCR 0xffc80000 23#define FRQCR 0xffc80000
diff --git a/include/asm-sh/cpu-sh4/rtc.h b/include/asm-sh/cpu-sh4/rtc.h
index f3d0f53275e4..25b1e6adfe8c 100644
--- a/include/asm-sh/cpu-sh4/rtc.h
+++ b/include/asm-sh/cpu-sh4/rtc.h
@@ -1,7 +1,12 @@
1#ifndef __ASM_SH_CPU_SH4_RTC_H 1#ifndef __ASM_SH_CPU_SH4_RTC_H
2#define __ASM_SH_CPU_SH4_RTC_H 2#define __ASM_SH_CPU_SH4_RTC_H
3 3
4#ifdef CONFIG_CPU_SUBTYPE_SH7723
5#define rtc_reg_size sizeof(u16)
6#else
4#define rtc_reg_size sizeof(u32) 7#define rtc_reg_size sizeof(u32)
8#endif
9
5#define RTC_BIT_INVERTED 0x40 /* bug on SH7750, SH7750S */ 10#define RTC_BIT_INVERTED 0x40 /* bug on SH7750, SH7750S */
6#define RTC_DEF_CAPABILITIES RTC_CAP_4_DIGIT_YEAR 11#define RTC_DEF_CAPABILITIES RTC_CAP_4_DIGIT_YEAR
7 12
diff --git a/include/asm-sh/migor.h b/include/asm-sh/migor.h
new file mode 100644
index 000000000000..2329363afdc3
--- /dev/null
+++ b/include/asm-sh/migor.h
@@ -0,0 +1,58 @@
1#ifndef __ASM_SH_MIGOR_H
2#define __ASM_SH_MIGOR_H
3
4/*
5 * linux/include/asm-sh/migor.h
6 *
7 * Copyright (C) 2008 Renesas Solutions
8 *
9 * Portions Copyright (C) 2007 Nobuhiro Iwamatsu
10 *
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file "COPYING" in the main directory of this archive
13 * for more details.
14 *
15 */
16#include <asm/addrspace.h>
17
18/* GPIO */
19#define MSTPCR0 0xa4150030
20#define MSTPCR1 0xa4150034
21#define MSTPCR2 0xa4150038
22
23#define PORT_PACR 0xa4050100
24#define PORT_PDCR 0xa4050106
25#define PORT_PECR 0xa4050108
26#define PORT_PHCR 0xa405010e
27#define PORT_PJCR 0xa4050110
28#define PORT_PKCR 0xa4050112
29#define PORT_PLCR 0xa4050114
30#define PORT_PMCR 0xa4050116
31#define PORT_PRCR 0xa405011c
32#define PORT_PWCR 0xa4050146
33#define PORT_PXCR 0xa4050148
34#define PORT_PYCR 0xa405014a
35#define PORT_PZCR 0xa405014c
36#define PORT_PADR 0xa4050120
37#define PORT_PWDR 0xa4050166
38
39#define PORT_HIZCRA 0xa4050158
40#define PORT_HIZCRC 0xa405015c
41
42#define PORT_MSELCRB 0xa4050182
43
44#define MSTPCR1 0xa4150034
45#define MSTPCR2 0xa4150038
46
47#define PORT_PSELA 0xa405014e
48#define PORT_PSELB 0xa4050150
49#define PORT_PSELC 0xa4050152
50#define PORT_PSELD 0xa4050154
51
52#define PORT_HIZCRA 0xa4050158
53#define PORT_HIZCRB 0xa405015a
54#define PORT_HIZCRC 0xa405015c
55
56#define BSC_CS6ABCR 0xfec1001c
57
58#endif /* __ASM_SH_MIGOR_H */
diff --git a/include/asm-sh/mpc1211/pci.h b/include/asm-sh/mpc1211/pci.h
index 5d3712c3a701..d9162c5ed76a 100644
--- a/include/asm-sh/mpc1211/pci.h
+++ b/include/asm-sh/mpc1211/pci.h
@@ -24,8 +24,6 @@
24#define PCI_PROBE_BIOS 1 24#define PCI_PROBE_BIOS 1
25#define PCI_PROBE_CONF1 2 25#define PCI_PROBE_CONF1 2
26#define PCI_PROBE_CONF2 4 26#define PCI_PROBE_CONF2 4
27#define PCI_NO_SORT 0x100
28#define PCI_BIOS_SORT 0x200
29#define PCI_NO_CHECKS 0x400 27#define PCI_NO_CHECKS 0x400
30#define PCI_ASSIGN_ROMS 0x1000 28#define PCI_ASSIGN_ROMS 0x1000
31#define PCI_BIOS_IRQ_SCAN 0x2000 29#define PCI_BIOS_IRQ_SCAN 0x2000
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index ec707b98e5b9..b7c7ce80f03e 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -16,7 +16,7 @@ enum cpu_type {
16 CPU_SH7619, 16 CPU_SH7619,
17 17
18 /* SH-2A types */ 18 /* SH-2A types */
19 CPU_SH7203, CPU_SH7206, CPU_SH7263, 19 CPU_SH7203, CPU_SH7206, CPU_SH7263, CPU_MXG,
20 20
21 /* SH-3 types */ 21 /* SH-3 types */
22 CPU_SH7705, CPU_SH7706, CPU_SH7707, 22 CPU_SH7705, CPU_SH7706, CPU_SH7707,
@@ -29,7 +29,8 @@ enum cpu_type {
29 CPU_SH7760, CPU_SH4_202, CPU_SH4_501, 29 CPU_SH7760, CPU_SH4_202, CPU_SH4_501,
30 30
31 /* SH-4A types */ 31 /* SH-4A types */
32 CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SHX3, 32 CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785,
33 CPU_SH7723, CPU_SHX3,
33 34
34 /* SH4AL-DSP types */ 35 /* SH4AL-DSP types */
35 CPU_SH7343, CPU_SH7722, CPU_SH7366, 36 CPU_SH7343, CPU_SH7722, CPU_SH7366,
diff --git a/include/asm-sh/r7780rp.h b/include/asm-sh/r7780rp.h
index 1770460a4616..a33838f23a6d 100644
--- a/include/asm-sh/r7780rp.h
+++ b/include/asm-sh/r7780rp.h
@@ -55,11 +55,11 @@
55#define PA_SCSPTR1 (PA_BCR+0x0524) /* SCIF1 Serial Port control */ 55#define PA_SCSPTR1 (PA_BCR+0x0524) /* SCIF1 Serial Port control */
56#define PA_SCLSR1 (PA_BCR+0x0528) /* SCIF1 Line Status control */ 56#define PA_SCLSR1 (PA_BCR+0x0528) /* SCIF1 Line Status control */
57#define PA_SCRER1 (PA_BCR+0x052c) /* SCIF1 Serial Error control */ 57#define PA_SCRER1 (PA_BCR+0x052c) /* SCIF1 Serial Error control */
58#define PA_ICCR (PA_BCR+0x0600) /* Serial control */ 58#define PA_SMCR (PA_BCR+0x0600) /* 2-wire Serial control */
59#define PA_SAR (PA_BCR+0x0602) /* Serial Slave control */ 59#define PA_SMSMADR (PA_BCR+0x0602) /* 2-wire Serial Slave control */
60#define PA_MDR (PA_BCR+0x0604) /* Serial Mode control */ 60#define PA_SMMR (PA_BCR+0x0604) /* 2-wire Serial Mode control */
61#define PA_ADR1 (PA_BCR+0x0606) /* Serial Address1 control */ 61#define PA_SMSADR1 (PA_BCR+0x0606) /* 2-wire Serial Address1 control */
62#define PA_DAR1 (PA_BCR+0x0646) /* Serial Data1 control */ 62#define PA_SMTRDR1 (PA_BCR+0x0646) /* 2-wire Serial Data1 control */
63#define PA_VERREG (PA_BCR+0x0700) /* FPGA Version Register */ 63#define PA_VERREG (PA_BCR+0x0700) /* FPGA Version Register */
64#define PA_POFF (PA_BCR+0x0800) /* System Power Off control */ 64#define PA_POFF (PA_BCR+0x0800) /* System Power Off control */
65#define PA_PMR (PA_BCR+0x0900) /* */ 65#define PA_PMR (PA_BCR+0x0900) /* */
@@ -107,11 +107,11 @@
107#define PA_SCFCR (PA_BCR+0x040c) /* SCIF FIFO control */ 107#define PA_SCFCR (PA_BCR+0x040c) /* SCIF FIFO control */
108#define PA_SCFDR (PA_BCR+0x040e) /* SCIF FIFO data control */ 108#define PA_SCFDR (PA_BCR+0x040e) /* SCIF FIFO data control */
109#define PA_SCLSR (PA_BCR+0x0412) /* SCIF Line Status control */ 109#define PA_SCLSR (PA_BCR+0x0412) /* SCIF Line Status control */
110#define PA_ICCR (PA_BCR+0x0500) /* Serial control */ 110#define PA_SMCR (PA_BCR+0x0500) /* 2-wire Serial control */
111#define PA_SAR (PA_BCR+0x0502) /* Serial Slave control */ 111#define PA_SMSMADR (PA_BCR+0x0502) /* 2-wire Serial Slave control */
112#define PA_MDR (PA_BCR+0x0504) /* Serial Mode control */ 112#define PA_SMMR (PA_BCR+0x0504) /* 2-wire Serial Mode control */
113#define PA_ADR1 (PA_BCR+0x0506) /* Serial Address1 control */ 113#define PA_SMSADR1 (PA_BCR+0x0506) /* 2-wire Serial Address1 control */
114#define PA_DAR1 (PA_BCR+0x0546) /* Serial Data1 control */ 114#define PA_SMTRDR1 (PA_BCR+0x0546) /* 2-wire Serial Data1 control */
115#define PA_VERREG (PA_BCR+0x0600) /* FPGA Version Register */ 115#define PA_VERREG (PA_BCR+0x0600) /* FPGA Version Register */
116 116
117#define PA_AX88796L 0xa5800400 /* AX88796L Area */ 117#define PA_AX88796L 0xa5800400 /* AX88796L Area */
@@ -190,6 +190,8 @@
190#define IRQ_TP (HL_FPGA_IRQ_BASE + 12) 190#define IRQ_TP (HL_FPGA_IRQ_BASE + 12)
191#define IRQ_RTC (HL_FPGA_IRQ_BASE + 13) 191#define IRQ_RTC (HL_FPGA_IRQ_BASE + 13)
192#define IRQ_TH_ALERT (HL_FPGA_IRQ_BASE + 14) 192#define IRQ_TH_ALERT (HL_FPGA_IRQ_BASE + 14)
193#define IRQ_SCIF0 (HL_FPGA_IRQ_BASE + 15)
194#define IRQ_SCIF1 (HL_FPGA_IRQ_BASE + 16)
193 195
194unsigned char *highlander_init_irq_r7780mp(void); 196unsigned char *highlander_init_irq_r7780mp(void);
195unsigned char *highlander_init_irq_r7780rp(void); 197unsigned char *highlander_init_irq_r7780rp(void);
diff --git a/include/asm-sh/se7721.h b/include/asm-sh/se7721.h
new file mode 100644
index 000000000000..b957f6041193
--- /dev/null
+++ b/include/asm-sh/se7721.h
@@ -0,0 +1,70 @@
1/*
2 * Copyright (C) 2008 Renesas Solutions Corp.
3 *
4 * Hitachi UL SolutionEngine 7721 Support.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 */
11
12#ifndef __ASM_SH_SE7721_H
13#define __ASM_SH_SE7721_H
14#include <asm/addrspace.h>
15
16/* Box specific addresses. */
17#define SE_AREA0_WIDTH 2 /* Area0: 32bit */
18#define PA_ROM 0xa0000000 /* EPROM */
19#define PA_ROM_SIZE 0x00200000 /* EPROM size 2M byte */
20#define PA_FROM 0xa1000000 /* Flash-ROM */
21#define PA_FROM_SIZE 0x01000000 /* Flash-ROM size 16M byte */
22#define PA_EXT1 0xa4000000
23#define PA_EXT1_SIZE 0x04000000
24#define PA_SDRAM 0xaC000000 /* SDRAM(Area3) 64MB */
25#define PA_SDRAM_SIZE 0x04000000
26
27#define PA_EXT4 0xb0000000
28#define PA_EXT4_SIZE 0x04000000
29
30#define PA_PERIPHERAL 0xB8000000
31
32#define PA_PCIC PA_PERIPHERAL
33#define PA_MRSHPC (PA_PERIPHERAL + 0x003fffe0)
34#define PA_MRSHPC_MW1 (PA_PERIPHERAL + 0x00400000)
35#define PA_MRSHPC_MW2 (PA_PERIPHERAL + 0x00500000)
36#define PA_MRSHPC_IO (PA_PERIPHERAL + 0x00600000)
37#define MRSHPC_OPTION (PA_MRSHPC + 6)
38#define MRSHPC_CSR (PA_MRSHPC + 8)
39#define MRSHPC_ISR (PA_MRSHPC + 10)
40#define MRSHPC_ICR (PA_MRSHPC + 12)
41#define MRSHPC_CPWCR (PA_MRSHPC + 14)
42#define MRSHPC_MW0CR1 (PA_MRSHPC + 16)
43#define MRSHPC_MW1CR1 (PA_MRSHPC + 18)
44#define MRSHPC_IOWCR1 (PA_MRSHPC + 20)
45#define MRSHPC_MW0CR2 (PA_MRSHPC + 22)
46#define MRSHPC_MW1CR2 (PA_MRSHPC + 24)
47#define MRSHPC_IOWCR2 (PA_MRSHPC + 26)
48#define MRSHPC_CDCR (PA_MRSHPC + 28)
49#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
50
51#define PA_LED 0xB6800000 /* 8bit LED */
52#define PA_FPGA 0xB7000000 /* FPGA base address */
53
54#define MRSHPC_IRQ0 10
55
56#define FPGA_ILSR1 (PA_FPGA + 0x02)
57#define FPGA_ILSR2 (PA_FPGA + 0x03)
58#define FPGA_ILSR3 (PA_FPGA + 0x04)
59#define FPGA_ILSR4 (PA_FPGA + 0x05)
60#define FPGA_ILSR5 (PA_FPGA + 0x06)
61#define FPGA_ILSR6 (PA_FPGA + 0x07)
62#define FPGA_ILSR7 (PA_FPGA + 0x08)
63#define FPGA_ILSR8 (PA_FPGA + 0x09)
64
65void init_se7721_IRQ(void);
66
67#define __IO_PREFIX se7721
68#include <asm/io_generic.h>
69
70#endif /* __ASM_SH_SE7721_H */
diff --git a/include/asm-sh/se7722.h b/include/asm-sh/se7722.h
index e0e89fcb8388..3690fe5857a4 100644
--- a/include/asm-sh/se7722.h
+++ b/include/asm-sh/se7722.h
@@ -77,6 +77,8 @@
77#define PORT_PSELA 0xA405014EUL 77#define PORT_PSELA 0xA405014EUL
78#define PORT_PYCR 0xA405014AUL 78#define PORT_PYCR 0xA405014AUL
79#define PORT_PZCR 0xA405014CUL 79#define PORT_PZCR 0xA405014CUL
80#define PORT_HIZCRA 0xA4050158UL
81#define PORT_HIZCRC 0xA405015CUL
80 82
81/* IRQ */ 83/* IRQ */
82#define IRQ0_IRQ 32 84#define IRQ0_IRQ 32
diff --git a/include/asm-sh/sh_keysc.h b/include/asm-sh/sh_keysc.h
new file mode 100644
index 000000000000..b5a4dd5a9729
--- /dev/null
+++ b/include/asm-sh/sh_keysc.h
@@ -0,0 +1,13 @@
1#ifndef __ASM_KEYSC_H__
2#define __ASM_KEYSC_H__
3
4#define SH_KEYSC_MAXKEYS 30
5
6struct sh_keysc_info {
7 enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3 } mode;
8 int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */
9 int delay;
10 int keycodes[SH_KEYSC_MAXKEYS];
11};
12
13#endif /* __ASM_KEYSC_H__ */
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index 5145aa2a0ce9..e65b6b822cb3 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -146,6 +146,8 @@ extern unsigned int instruction_size(unsigned int insn);
146 146
147extern unsigned long cached_to_uncached; 147extern unsigned long cached_to_uncached;
148 148
149extern struct dentry *sh_debugfs_root;
150
149/* XXX 151/* XXX
150 * disable hlt during certain critical i/o operations 152 * disable hlt during certain critical i/o operations
151 */ 153 */
diff --git a/include/asm-sh/topology.h b/include/asm-sh/topology.h
index f402a3b1cfa4..34cdb28e8f44 100644
--- a/include/asm-sh/topology.h
+++ b/include/asm-sh/topology.h
@@ -16,7 +16,7 @@
16 .cache_nice_tries = 2, \ 16 .cache_nice_tries = 2, \
17 .busy_idx = 3, \ 17 .busy_idx = 3, \
18 .idle_idx = 2, \ 18 .idle_idx = 2, \
19 .newidle_idx = 0, \ 19 .newidle_idx = 2, \
20 .wake_idx = 1, \ 20 .wake_idx = 1, \
21 .forkexec_idx = 1, \ 21 .forkexec_idx = 1, \
22 .flags = SD_LOAD_BALANCE \ 22 .flags = SD_LOAD_BALANCE \
diff --git a/include/asm-sh/uaccess_32.h b/include/asm-sh/uaccess_32.h
index c0318b608893..1e41fda74bd3 100644
--- a/include/asm-sh/uaccess_32.h
+++ b/include/asm-sh/uaccess_32.h
@@ -55,13 +55,10 @@ static inline void set_fs(mm_segment_t s)
55 * If we don't have an MMU (or if its disabled) the only thing we really have 55 * If we don't have an MMU (or if its disabled) the only thing we really have
56 * to look out for is if the address resides somewhere outside of what 56 * to look out for is if the address resides somewhere outside of what
57 * available RAM we have. 57 * available RAM we have.
58 *
59 * TODO: This check could probably also stand to be restricted somewhat more..
60 * though it still does the Right Thing(tm) for the time being.
61 */ 58 */
62static inline int __access_ok(unsigned long addr, unsigned long size) 59static inline int __access_ok(unsigned long addr, unsigned long size)
63{ 60{
64 return ((addr >= memory_start) && ((addr + size) < memory_end)); 61 return 1;
65} 62}
66#else /* CONFIG_MMU */ 63#else /* CONFIG_MMU */
67#define __addr_ok(addr) \ 64#define __addr_ok(addr) \
diff --git a/include/asm-sparc/Kbuild b/include/asm-sparc/Kbuild
index c6a55cf0d337..671223718f0a 100644
--- a/include/asm-sparc/Kbuild
+++ b/include/asm-sparc/Kbuild
@@ -5,7 +5,6 @@ header-y += asi.h
5header-y += bpp.h 5header-y += bpp.h
6header-y += jsflash.h 6header-y += jsflash.h
7header-y += openpromio.h 7header-y += openpromio.h
8header-y += pconf.h
9header-y += reg.h 8header-y += reg.h
10header-y += traps.h 9header-y += traps.h
11header-y += vfc_ioctls.h 10header-y += vfc_ioctls.h
diff --git a/include/asm-sparc/a.out-core.h b/include/asm-sparc/a.out-core.h
deleted file mode 100644
index e8fd338ed0b2..000000000000
--- a/include/asm-sparc/a.out-core.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/* a.out coredump register dumper
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12#ifndef _ASM_A_OUT_CORE_H
13#define _ASM_A_OUT_CORE_H
14
15#ifdef __KERNEL__
16
17#include <linux/user.h>
18
19/*
20 * fill in the user structure for an a.out core dump
21 */
22static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
23{
24 unsigned long first_stack_page;
25
26 dump->magic = SUNOS_CORE_MAGIC;
27 dump->len = sizeof(struct user);
28 dump->regs.psr = regs->psr;
29 dump->regs.pc = regs->pc;
30 dump->regs.npc = regs->npc;
31 dump->regs.y = regs->y;
32 /* fuck me plenty */
33 memcpy(&dump->regs.regs[0], &regs->u_regs[1], (sizeof(unsigned long) * 15));
34 dump->uexec = current->thread.core_exec;
35 dump->u_tsize = (((unsigned long) current->mm->end_code) -
36 ((unsigned long) current->mm->start_code)) & ~(PAGE_SIZE - 1);
37 dump->u_dsize = ((unsigned long) (current->mm->brk + (PAGE_SIZE-1)));
38 dump->u_dsize -= dump->u_tsize;
39 dump->u_dsize &= ~(PAGE_SIZE - 1);
40 first_stack_page = (regs->u_regs[UREG_FP] & ~(PAGE_SIZE - 1));
41 dump->u_ssize = (TASK_SIZE - first_stack_page) & ~(PAGE_SIZE - 1);
42 memcpy(&dump->fpu.fpstatus.fregs.regs[0], &current->thread.float_regs[0], (sizeof(unsigned long) * 32));
43 dump->fpu.fpstatus.fsr = current->thread.fsr;
44 dump->fpu.fpstatus.flags = dump->fpu.fpstatus.extra = 0;
45 dump->fpu.fpstatus.fpq_count = current->thread.fpqdepth;
46 memcpy(&dump->fpu.fpstatus.fpq[0], &current->thread.fpqueue[0],
47 ((sizeof(unsigned long) * 2) * 16));
48 dump->sigcode = 0;
49}
50
51#endif /* __KERNEL__ */
52#endif /* _ASM_A_OUT_CORE_H */
diff --git a/include/asm-sparc/a.out.h b/include/asm-sparc/a.out.h
deleted file mode 100644
index 2f1c3748a068..000000000000
--- a/include/asm-sparc/a.out.h
+++ /dev/null
@@ -1,97 +0,0 @@
1#ifndef __SPARC_A_OUT_H__
2#define __SPARC_A_OUT_H__
3
4#define SPARC_PGSIZE 0x2000 /* Thanks to the sun4 architecture... */
5#define SEGMENT_SIZE SPARC_PGSIZE /* whee... */
6
7#ifndef __ASSEMBLY__
8
9struct exec {
10 unsigned char a_dynamic:1; /* A __DYNAMIC is in this image */
11 unsigned char a_toolversion:7;
12 unsigned char a_machtype;
13 unsigned short a_info;
14 unsigned int a_text; /* length of text, in bytes */
15 unsigned int a_data; /* length of data, in bytes */
16 unsigned int a_bss; /* length of bss, in bytes */
17 unsigned int a_syms; /* length of symbol table, in bytes */
18 unsigned int a_entry; /* where program begins */
19 unsigned int a_trsize;
20 unsigned int a_drsize;
21};
22
23#endif /* !__ASSEMBLY__ */
24
25/* Where in the file does the text information begin? */
26#define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? 0 : sizeof (struct exec))
27
28/* Where do the Symbols start? */
29#define N_SYMOFF(x) (N_TXTOFF(x) + (x).a_text + \
30 (x).a_data + (x).a_trsize + \
31 (x).a_drsize)
32
33/* Where does text segment go in memory after being loaded? */
34#define N_TXTADDR(x) (unsigned long)(((N_MAGIC(x) == ZMAGIC) && \
35 ((x).a_entry < SPARC_PGSIZE)) ? \
36 0 : SPARC_PGSIZE)
37
38/* And same for the data segment.. */
39#define N_DATADDR(x) (N_MAGIC(x)==OMAGIC ? \
40 (N_TXTADDR(x) + (x).a_text) \
41 : (unsigned long) (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
42
43#define N_TRSIZE(a) ((a).a_trsize)
44#define N_DRSIZE(a) ((a).a_drsize)
45#define N_SYMSIZE(a) ((a).a_syms)
46
47#ifndef __ASSEMBLY__
48
49/*
50 * Sparc relocation types
51 */
52enum reloc_type
53{
54 RELOC_8,
55 RELOC_16,
56 RELOC_32, /* simplest relocs */
57 RELOC_DISP8,
58 RELOC_DISP16,
59 RELOC_DISP32, /* Disp's (pc-rel) */
60 RELOC_WDISP30,
61 RELOC_WDISP22, /* SR word disp's */
62 RELOC_HI22,
63 RELOC_22, /* SR 22-bit relocs */
64 RELOC_13,
65 RELOC_LO10, /* SR 13&10-bit relocs */
66 RELOC_SFA_BASE,
67 RELOC_SFA_OFF13, /* SR S.F.A. relocs */
68 RELOC_BASE10,
69 RELOC_BASE13,
70 RELOC_BASE22, /* base_relative pic */
71 RELOC_PC10,
72 RELOC_PC22, /* special pc-rel pic */
73 RELOC_JMP_TBL, /* jmp_tbl_rel in pic */
74 RELOC_SEGOFF16, /* ShLib offset-in-seg */
75 RELOC_GLOB_DAT,
76 RELOC_JMP_SLOT,
77 RELOC_RELATIVE /* rtld relocs */
78};
79
80/*
81 * Format of a relocation datum.
82 */
83struct relocation_info /* used when header.a_machtype == M_SPARC */
84{
85 unsigned int r_address; /* relocation addr */
86 unsigned int r_index:24; /* segment index or symbol index */
87 unsigned int r_extern:1; /* if F, r_index==SEG#; if T, SYM idx */
88 unsigned int r_pad:2; /* <unused> */
89 enum reloc_type r_type:5; /* type of relocation to perform */
90 int r_addend; /* addend for relocation value */
91};
92
93#define N_RELOCATION_INFO_DECLARED 1
94
95#endif /* !(__ASSEMBLY__) */
96
97#endif /* __SPARC_A_OUT_H__ */
diff --git a/include/asm-sparc/floppy.h b/include/asm-sparc/floppy.h
index dbe7a586be5b..d3978e068e2b 100644
--- a/include/asm-sparc/floppy.h
+++ b/include/asm-sparc/floppy.h
@@ -280,7 +280,7 @@ static inline void sun_fd_enable_dma(void)
280 280
281/* Our low-level entry point in arch/sparc/kernel/entry.S */ 281/* Our low-level entry point in arch/sparc/kernel/entry.S */
282extern int sparc_floppy_request_irq(int irq, unsigned long flags, 282extern int sparc_floppy_request_irq(int irq, unsigned long flags,
283 irqreturn_t (*irq_handler)(int irq, void *)); 283 irq_handler_t irq_handler);
284 284
285static int sun_fd_request_irq(void) 285static int sun_fd_request_irq(void)
286{ 286{
diff --git a/include/asm-sparc/head.h b/include/asm-sparc/head.h
index 1a03c28da92d..fcdba5116339 100644
--- a/include/asm-sparc/head.h
+++ b/include/asm-sparc/head.h
@@ -46,45 +46,12 @@
46 b linux_sparc_syscall; \ 46 b linux_sparc_syscall; \
47 rd %psr, %l0; 47 rd %psr, %l0;
48 48
49/* Software trap for SunOS4.1.x system calls. */
50#define SUNOS_SYSCALL_TRAP \
51 rd %psr, %l0; \
52 sethi %hi(sunos_sys_table), %l7; \
53 b linux_sparc_syscall; \
54 or %l7, %lo(sunos_sys_table), %l7;
55
56#define SUNOS_NO_SYSCALL_TRAP \
57 b sunos_syscall; \
58 rd %psr, %l0; \
59 nop; \
60 nop;
61
62/* Software trap for Slowaris system calls. */
63#define SOLARIS_SYSCALL_TRAP \
64 b solaris_syscall; \
65 rd %psr, %l0; \
66 nop; \
67 nop;
68
69#define INDIRECT_SOLARIS_SYSCALL(x) \
70 mov x, %g1; \
71 b solaris_syscall; \
72 rd %psr, %l0; \
73 nop;
74
75#define BREAKPOINT_TRAP \ 49#define BREAKPOINT_TRAP \
76 b breakpoint_trap; \ 50 b breakpoint_trap; \
77 rd %psr,%l0; \ 51 rd %psr,%l0; \
78 nop; \ 52 nop; \
79 nop; 53 nop;
80 54
81/* Software trap for Sparc-netbsd system calls. */
82#define NETBSD_SYSCALL_TRAP \
83 sethi %hi(sys_call_table), %l7; \
84 or %l7, %lo(sys_call_table), %l7; \
85 b bsd_syscall; \
86 rd %psr, %l0;
87
88/* The Get Condition Codes software trap for userland. */ 55/* The Get Condition Codes software trap for userland. */
89#define GETCC_TRAP \ 56#define GETCC_TRAP \
90 b getcc_trap_handler; mov %psr, %l0; nop; nop; 57 b getcc_trap_handler; mov %psr, %l0; nop; nop;
diff --git a/include/asm-sparc/ioctls.h b/include/asm-sparc/ioctls.h
index 058c2064f706..3f4d0087b6a3 100644
--- a/include/asm-sparc/ioctls.h
+++ b/include/asm-sparc/ioctls.h
@@ -43,8 +43,6 @@
43#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */ 43#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */
44#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */ 44#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */
45#define TIOCCONS _IO('t', 36) 45#define TIOCCONS _IO('t', 36)
46#define __TIOCSSIZE _IOW('t', 37, struct sunos_ttysize) /* SunOS Specific */
47#define __TIOCGSIZE _IOR('t', 38, struct sunos_ttysize) /* SunOS Specific */
48#define TIOCGSOFTCAR _IOR('t', 100, int) 46#define TIOCGSOFTCAR _IOR('t', 100, int)
49#define TIOCSSOFTCAR _IOW('t', 101, int) 47#define TIOCSSOFTCAR _IOW('t', 101, int)
50#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */ 48#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */
diff --git a/include/asm-sparc/mman.h b/include/asm-sparc/mman.h
index b7dc40bc68f4..e18be984c01d 100644
--- a/include/asm-sparc/mman.h
+++ b/include/asm-sparc/mman.h
@@ -22,19 +22,6 @@
22#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ 22#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
23#define MAP_NONBLOCK 0x10000 /* do not block on IO */ 23#define MAP_NONBLOCK 0x10000 /* do not block on IO */
24 24
25/* XXX Need to add flags to SunOS's mctl, mlockall, and madvise system
26 * XXX calls.
27 */
28
29/* SunOS sys_mctl() stuff... */
30#define MC_SYNC 1 /* Sync pages in memory with storage (usu. a file) */
31#define MC_LOCK 2 /* Lock pages into core ram, do not allow swapping of them */
32#define MC_UNLOCK 3 /* Unlock pages locked via previous mctl() with MC_LOCK arg */
33#define MC_LOCKAS 5 /* Lock an entire address space of the calling process */
34#define MC_UNLOCKAS 6 /* Unlock entire address space of calling process */
35
36#define MADV_FREE 0x5 /* (Solaris) contents can be freed */
37
38#ifdef __KERNEL__ 25#ifdef __KERNEL__
39#ifndef __ASSEMBLY__ 26#ifndef __ASSEMBLY__
40#define arch_mmap_check sparc_mmap_check 27#define arch_mmap_check sparc_mmap_check
diff --git a/include/asm-sparc/namei.h b/include/asm-sparc/namei.h
index f2461e8a11ac..618344d89cc4 100644
--- a/include/asm-sparc/namei.h
+++ b/include/asm-sparc/namei.h
@@ -8,19 +8,6 @@
8#ifndef __SPARC_NAMEI_H 8#ifndef __SPARC_NAMEI_H
9#define __SPARC_NAMEI_H 9#define __SPARC_NAMEI_H
10 10
11#define SPARC_BSD_EMUL "/usr/gnemul/sunos/" 11#define __emul_prefix() NULL
12#define SPARC_SOL_EMUL "/usr/gnemul/solaris/"
13
14static inline char * __emul_prefix(void)
15{
16 switch (current->personality) {
17 case PER_SUNOS:
18 return SPARC_BSD_EMUL;
19 case PER_SVR4:
20 return SPARC_SOL_EMUL;
21 default:
22 return NULL;
23 }
24}
25 12
26#endif /* __SPARC_NAMEI_H */ 13#endif /* __SPARC_NAMEI_H */
diff --git a/include/asm-sparc/pconf.h b/include/asm-sparc/pconf.h
deleted file mode 100644
index d73c1f1c49dc..000000000000
--- a/include/asm-sparc/pconf.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/* $Id: pconf.h,v 1.3 1996/04/25 06:13:25 davem Exp $
2 * pconf.h: pathconf() and fpathconf() defines for SunOS
3 * system call compatibility.
4 *
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
6 */
7
8#ifndef _SPARC_PCONF_H
9#define _SPARC_PCONF_H
10
11#include <linux/fs.h>
12#include <linux/limits.h>
13
14#define _PCONF_LINK 1 /* Max number of links to an object */
15#define _PCONF_CANON 2 /* TTY input buffer line size */
16#define _PCONF_INPUT 3 /* Biggest packet a tty can imbibe at once */
17#define _PCONF_NAME 4 /* Filename length max */
18#define _PCONF_PATH 5 /* Max size of a pathname */
19#define _PCONF_PIPE 6 /* Buffer size for a pipe */
20#define _PCONF_CHRESTRICT 7 /* Can only root chown files? */
21#define _PCONF_NOTRUNC 8 /* Are pathnames truncated if too big? */
22#define _PCONF_VDISABLE 9 /* Magic char to disable special tty chars */
23#define _PCONF_MAXPCONF 9
24
25#endif /* !(_SPARC_PCONF_H) */
diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h
index 40b1e41fdea7..e3006979709b 100644
--- a/include/asm-sparc/processor.h
+++ b/include/asm-sparc/processor.h
@@ -13,8 +13,6 @@
13 */ 13 */
14#define current_text_addr() ({ void *pc; __asm__("sethi %%hi(1f), %0; or %0, %%lo(1f), %0;\n1:" : "=r" (pc)); pc; }) 14#define current_text_addr() ({ void *pc; __asm__("sethi %%hi(1f), %0; or %0, %%lo(1f), %0;\n1:" : "=r" (pc)); pc; })
15 15
16#include <linux/a.out.h>
17
18#include <asm/psr.h> 16#include <asm/psr.h>
19#include <asm/ptrace.h> 17#include <asm/ptrace.h>
20#include <asm/head.h> 18#include <asm/head.h>
@@ -67,7 +65,6 @@ struct thread_struct {
67 struct fpq fpqueue[16]; 65 struct fpq fpqueue[16];
68 unsigned long flags; 66 unsigned long flags;
69 mm_segment_t current_ds; 67 mm_segment_t current_ds;
70 struct exec core_exec; /* just what it says. */
71 int new_signal; 68 int new_signal;
72}; 69};
73 70
diff --git a/include/asm-sparc/socket.h b/include/asm-sparc/socket.h
index 2e2bd0b7c8e3..a00e15df227c 100644
--- a/include/asm-sparc/socket.h
+++ b/include/asm-sparc/socket.h
@@ -24,9 +24,6 @@
24#define SO_SNDTIMEO 0x4000 24#define SO_SNDTIMEO 0x4000
25#define SO_ACCEPTCONN 0x8000 25#define SO_ACCEPTCONN 0x8000
26 26
27/* wha!??? */
28#define SO_DONTLINGER (~SO_LINGER) /* Older SunOS compat. hack */
29
30#define SO_SNDBUF 0x1001 27#define SO_SNDBUF 0x1001
31#define SO_RCVBUF 0x1002 28#define SO_RCVBUF 0x1002
32#define SO_SNDBUFFORCE 0x100a 29#define SO_SNDBUFFORCE 0x100a
diff --git a/include/asm-sparc/solerrno.h b/include/asm-sparc/solerrno.h
deleted file mode 100644
index 8abce7e4639f..000000000000
--- a/include/asm-sparc/solerrno.h
+++ /dev/null
@@ -1,132 +0,0 @@
1/* $Id: solerrno.h,v 1.5 1996/04/25 06:13:32 davem Exp $
2 * solerrno.h: Solaris error return codes for compatibility.
3 *
4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
5 */
6
7#ifndef _SPARC_SOLERRNO_H
8#define _SPARC_SOLERRNO_H
9
10#define SOL_EPERM 1 /* Required superuser access perms */
11#define SOL_ENOENT 2 /* File or directory does not exist */
12#define SOL_ESRCH 3 /* Process did not exist */
13#define SOL_EINTR 4 /* System call was interrupted */
14#define SOL_EIO 5 /* An i/o error occurred */
15#define SOL_ENXIO 6 /* Device or Address does not exist */
16#define SOL_E2BIG 7 /* Too many arguments were given */
17#define SOL_ENOEXEC 8 /* Header of executable was munged */
18#define SOL_EBADF 9 /* Bogus file number */
19#define SOL_ECHILD 10 /* No children of process exist */
20#define SOL_EAGAIN 11 /* beep beep, "try again later" */
21#define SOL_ENOMEM 12 /* No memory available */
22#define SOL_EACCES 13 /* Access not allowed */
23#define SOL_EFAULT 14 /* Address passed was invalid */
24#define SOL_ENOTBLK 15 /* blkdev op on non-block device */
25#define SOL_EBUSY 16 /* Mounted device was busy */
26#define SOL_EEXIST 17 /* File specified already exists */
27#define SOL_EXDEV 18 /* Link request across diff devices */
28#define SOL_ENODEV 19 /* Device does not exist on system */
29#define SOL_ENOTDIR 20 /* Dir operation on non-directory */
30#define SOL_EISDIR 21 /* File was of directory type */
31#define SOL_EINVAL 22 /* Argument passed was invalid */
32#define SOL_ENFILE 23 /* No more room in file table */
33#define SOL_EMFILE 24 /* Proc has too many files open */
34#define SOL_ENOTTY 25 /* Ioctl was invalid for req device */
35#define SOL_ETXTBSY 26 /* Text file in busy state */
36#define SOL_EFBIG 27 /* Too big of a file for operation */
37#define SOL_ENOSPC 28 /* Disk is full */
38#define SOL_ESPIPE 29 /* Seek attempted on non-seeking dev*/
39#define SOL_EROFS 30 /* Write attempted on read-only fs */
40#define SOL_EMLINK 31 /* Too many links in file search */
41#define SOL_EPIPE 32 /* Call a plumber */
42#define SOL_EDOM 33 /* Argument was out of fct domain */
43#define SOL_ERANGE 34 /* Could not represent math result */
44#define SOL_ENOMSG 35 /* Message of req type doesn't exist */
45#define SOL_EIDRM 36 /* Identifier has been removed */
46#define SOL_ECHRNG 37 /* Req channel number out of range */
47#define SOL_EL2NSYNC 38 /* Could not sync at run level 2 */
48#define SOL_EL3HLT 39 /* Halted at run level 3 */
49#define SOL_EL3RST 40 /* Reset at run level 3 */
50#define SOL_ELNRNG 41 /* Out of range link number */
51#define SOL_EUNATCH 42 /* Driver for protocol not attached */
52#define SOL_ENOCSI 43 /* CSI structure not around */
53#define SOL_EL2HLT 44 /* Halted at run level 2 */
54#define SOL_EDEADLK 45 /* Deadlock condition detected */
55#define SOL_ENOLCK 46 /* Record locks unavailable */
56#define SOL_ECANCELED 47 /* Cancellation of oper. happened */
57#define SOL_ENOTSUP 48 /* Attempt of unsupported operation */
58#define SOL_EDQUOT 49 /* Users disk quota exceeded */
59#define SOL_EBADE 50 /* Invalid exchange */
60#define SOL_EBADR 51 /* Request descriptor was invalid */
61#define SOL_EXFULL 52 /* Full exchange */
62#define SOL_ENOANO 53 /* ano does not exist */
63#define SOL_EBADRQC 54 /* Req code was invalid */
64#define SOL_EBADSLT 55 /* Bad slot number */
65#define SOL_EDEADLOCK 56 /* Deadlock in fs error */
66#define SOL_EBFONT 57 /* Font file format invalid */
67/* YOW, I LOVE SYSV STREAMS!!!! */
68#define SOL_ENOSTR 60 /* Stream-op on non-stream dev */
69#define SOL_ENODATA 61 /* No data avail at this time */
70#define SOL_ETIME 62 /* Expiration of time occurred */
71#define SOL_ENOSR 63 /* Streams resources exhausted */
72#define SOL_ENONET 64 /* No network connected */
73#define SOL_ENOPKG 65 /* Non-installed package */
74#define SOL_EREMOTE 66 /* Object was on remote machine */
75#define SOL_ENOLINK 67 /* Cut link */
76#define SOL_EADV 68 /* Error in advertise */
77#define SOL_ESRMNT 69 /* Some magic srmount problem */
78#define SOL_ECOMM 70 /* During send, comm error occurred */
79#define SOL_EPROTO 71 /* Protocol botch */
80#define SOL_EMULTIHOP 74 /* Multihop attempted */
81#define SOL_EBADMSG 77 /* Message was unreadable */
82#define SOL_ENAMETOOLONG 78 /* Too long of a path name */
83#define SOL_EOVERFLOW 79 /* Data type too small for datum */
84#define SOL_ENOTUNIQ 80 /* Logical name was not unique */
85#define SOL_EBADFD 81 /* Op cannot be performed on fd */
86#define SOL_EREMCHG 82 /* Remote address is now different */
87#define SOL_ELIBACC 83 /* Shared lib could not be accessed */
88#define SOL_ELIBBAD 84 /* ShLib is corrupted in some way */
89#define SOL_ELIBSCN 85 /* A.out ShLib problems */
90#define SOL_ELIBMAX 86 /* Exceeded ShLib linkage limit */
91#define SOL_ELIBEXEC 87 /* Execution of ShLib attempted */
92#define SOL_EILSEQ 88 /* Bad byte sequence found */
93#define SOL_ENOSYS 89 /* Invalid filesystem operation */
94#define SOL_ELOOP 90 /* Detected loop in symbolic links */
95#define SOL_ERESTART 91 /* System call is restartable */
96#define SOL_ESTRPIPE 92 /* Do not sleep in head of stream */
97#define SOL_ENOTEMPTY 93 /* Rmdir of non-empty directory */
98#define SOL_EUSERS 94 /* Over abundance of users for ufs */
99#define SOL_ENOTSOCK 95 /* Sock-op on non-sock */
100#define SOL_EDESTADDRREQ 96 /* No dest addr given, but needed */
101#define SOL_EMSGSIZE 97 /* Msg too big */
102#define SOL_EPROTOTYPE 98 /* Bad socket protocol */
103#define SOL_ENOPROTOOPT 99 /* Unavailable protocol */
104#define SOL_EPROTONOSUPPORT 120 /* Unsupported protocol */
105#define SOL_ESOCKTNOSUPPORT 121 /* Unsupported socket type */
106#define SOL_EOPNOTSUPP 122 /* Unsupported sock-op */
107#define SOL_EPFNOSUPPORT 123 /* Unsupported protocol family */
108#define SOL_EAFNOSUPPORT 124 /* Unsup addr family for protocol */
109#define SOL_EADDRINUSE 125 /* Req addr is already in use */
110#define SOL_EADDRNOTAVAIL 126 /* Req addr not available right now */
111#define SOL_ENETDOWN 127 /* Your subnet is on fire */
112#define SOL_ENETUNREACH 128 /* Someone playing with gateway and */
113 /* did not tell you he was going to */
114#define SOL_ENETRESET 129 /* Buy less-buggy ethernet cards */
115#define SOL_ECONNABORTED 130 /* Aborted connection due to sw */
116#define SOL_ECONNRESET 131 /* Your peers reset your connection */
117#define SOL_ENOBUFS 132 /* No buffer space available */
118#define SOL_EISCONN 133 /* Connect on already connected */
119 /* socket attempted */
120#define SOL_ENOTCONN 134 /* Comm on non-connected socket */
121#define SOL_ESHUTDOWN 143 /* Op attempted after sock-shutdown */
122#define SOL_ETOOMANYREFS 144 /* Reference limit exceeded */
123#define SOL_ETIMEDOUT 145 /* Timed out connection */
124#define SOL_ECONNREFUSED 146 /* Connection refused by remote host*/
125#define SOL_EHOSTDOWN 147 /* Remote host is up in flames */
126#define SOL_EHOSTUNREACH 148 /* Make a left at Easton Ave..... */
127#define SOL_EWOULDBLOCK EAGAIN /* Just an alias */
128#define SOL_EALREADY 149 /* Operation is already occurring */
129#define SOL_EINPROGRESS 150 /* Operation is happening now */
130#define SOL_ESTALE 151 /* Fungus growth on NFS file handle */
131
132#endif /* !(_SPARC_SOLERRNO_H) */
diff --git a/include/asm-sparc/svr4.h b/include/asm-sparc/svr4.h
deleted file mode 100644
index da1f1c980e2d..000000000000
--- a/include/asm-sparc/svr4.h
+++ /dev/null
@@ -1,119 +0,0 @@
1/* Solaris/SPARC constants and definitions --
2 * (C) 1996 Miguel de Icaza
3 *
4 * This file is not meant to be included by user level applications
5 * but the solaris syscall emulator
6 */
7
8#ifndef _SPARC_SVR4_H
9#define _SPARC_SVR4_H
10
11/* Signals as used by svr4 */
12typedef struct { /* signal set type */
13 ulong sigbits[4];
14} svr4_sigset_t;
15
16/* Values for siginfo.code */
17#define SVR4_SINOINFO 32767
18/* Siginfo, sucker expects bunch of information on those parameters */
19typedef union {
20 char total_size [128];
21 struct {
22 int signo;
23 int code;
24 int error;
25 union {
26 } data;
27 } siginfo;
28} svr4_siginfo_t;
29
30/* Context definition */
31
32/* Location of the user stored registers into a greg_t */
33enum {
34 SVR4_PSR, SVR4_PC, SVR4_NPC, SVR4_Y,
35 SVR4_G1, SVR4_G2, SVR4_G3, SVR4_G4,
36 SVR4_G5, SVR4_G6, SVR4_G7, SVR4_O0,
37 SVR4_O1, SVR4_O2, SVR4_O3, SVR4_O4,
38 SVR4_O5, SVR4_O6, SVR4_O7
39};
40
41/* sizeof (regs) / sizeof (greg_t), defined in the ABI */
42#define SVR4_NREGS 19
43#define SVR4_MAXWIN 31
44
45typedef struct {
46 uint rwin_lo[8];
47 uint rwin_in[8];
48} svr4_rwindow_t;
49
50typedef struct {
51 int count;
52 int __user *winptr [SVR4_MAXWIN]; /* pointer to the windows */
53 svr4_rwindow_t win[SVR4_MAXWIN]; /* the windows */
54} svr4_gwindows_t;
55
56typedef int svr4_gregset_t[SVR4_NREGS];
57
58typedef struct {
59 double fpu_regs[32];
60 void *fp_q;
61 unsigned fp_fsr;
62 u_char fp_nqel;
63 u_char fp_nqsize;
64 u_char inuse; /* if fpu is in use */
65} svr4_fregset_t;
66
67typedef struct {
68 uint id; /* if this holds "xrs" string => ptr is valid */
69 caddr_t ptr;
70} svr4_xrs_t;
71
72/* Machine dependent context */
73typedef struct {
74 svr4_gregset_t greg; /* registers 0..19 (see top) */
75 svr4_gwindows_t __user *gwin; /* may point to register windows */
76 svr4_fregset_t freg; /* floating point registers */
77 svr4_xrs_t xrs; /* mhm? */
78 long pad[19];
79} svr4_mcontext_t;
80
81/* flags for stack_t.flags */
82enum svr4_stack_flags {
83 SVR4_SS_ONSTACK,
84 SVR4_SS_DISABLE,
85};
86
87/* signal stack exection place, unsupported */
88typedef struct svr4_stack_t {
89 char __user *sp;
90 int size;
91 int flags;
92} svr4_stack_t;
93
94/* Context used by getcontext and setcontext */
95typedef struct svr4_ucontext_t {
96 u_long flags; /* context flags, indicate what is loaded */
97 struct svr4_ucontext *link;
98 svr4_sigset_t sigmask;
99 svr4_stack_t stack;
100 svr4_mcontext_t mcontext;
101 long pad[23];
102} svr4_ucontext_t;
103
104/* windows hold the windows as they were at signal time,
105 * ucontext->mcontext holds a pointer to them.
106 * addresses for uc and si are passed as parameters to svr4 signal
107 * handler
108 */
109
110/* This is the signal frame that is passed to the signal handler */
111typedef struct {
112 svr4_gwindows_t gw; /* windows */
113 svr4_ucontext_t uc; /* machine context */
114 svr4_siginfo_t si; /* siginfo */
115} svr4_signal_frame_t;
116
117#define SVR4_SF_ALIGNED (((sizeof (svr4_signal_frame_t) + 7) & (~7)))
118
119#endif /* include control */
diff --git a/include/asm-sparc/termios.h b/include/asm-sparc/termios.h
index 4333232abb9f..733d40504e1e 100644
--- a/include/asm-sparc/termios.h
+++ b/include/asm-sparc/termios.h
@@ -33,11 +33,6 @@ struct ltchars {
33}; 33};
34#endif /* __KERNEL__ */ 34#endif /* __KERNEL__ */
35 35
36struct sunos_ttysize {
37 int st_lines; /* Lines on the terminal */
38 int st_columns; /* Columns on the terminal */
39};
40
41struct winsize { 36struct winsize {
42 unsigned short ws_row; 37 unsigned short ws_row;
43 unsigned short ws_col; 38 unsigned short ws_col;
diff --git a/include/asm-sparc/user.h b/include/asm-sparc/user.h
index b5f1abf733d5..3400ea87f148 100644
--- a/include/asm-sparc/user.h
+++ b/include/asm-sparc/user.h
@@ -1,60 +1,6 @@
1/* $Id: user.h,v 1.5 1998/02/23 01:49:22 rth Exp $
2 * asm-sparc/user.h: Core file definitions for the Sparc.
3 *
4 * Keep in sync with reg.h. Actually, we could get rid of this
5 * one, since we won't a.out core dump that much anyways - miguel.
6 * Copyright (C) 1995 (davem@caip.rutgers.edu)
7 */
8#ifndef _SPARC_USER_H 1#ifndef _SPARC_USER_H
9#define _SPARC_USER_H 2#define _SPARC_USER_H
10 3
11#include <asm/a.out.h> 4/* Nothing to define. */
12struct sunos_regs {
13 unsigned long psr, pc, npc, y;
14 unsigned long regs[15];
15};
16
17struct sunos_fpqueue {
18 unsigned long *addr;
19 unsigned long inst;
20};
21
22struct sunos_fp {
23 union {
24 unsigned long regs[32];
25 double reg_dbls[16];
26 } fregs;
27 unsigned long fsr;
28 unsigned long flags;
29 unsigned long extra;
30 unsigned long fpq_count;
31 struct sunos_fpqueue fpq[16];
32};
33
34struct sunos_fpu {
35 struct sunos_fp fpstatus;
36};
37
38/* The SunOS core file header layout. */
39struct user {
40 unsigned long magic;
41 unsigned long len;
42 struct sunos_regs regs;
43 struct exec uexec;
44 int signal;
45 size_t u_tsize; /* all of these in bytes! */
46 size_t u_dsize;
47 size_t u_ssize;
48 char u_comm[17];
49 struct sunos_fpu fpu;
50 unsigned long sigcode; /* Special sigcontext subcode, if any */
51};
52
53#define NBPG 0x2000
54#define UPAGES 1
55#define HOST_TEXT_START_ADDR (u.start_code)
56#define HOST_DATA_START_ADDR (u.uexec.a_data)
57#define HOST_STACK_END_ADDR (- u.u_ssize * NBPG)
58#define SUNOS_CORE_MAGIC 0x080456
59 5
60#endif /* !(_SPARC_USER_H) */ 6#endif /* !(_SPARC_USER_H) */
diff --git a/include/asm-sparc64/Kbuild b/include/asm-sparc64/Kbuild
index a90dc82129d1..dce1cf9a9313 100644
--- a/include/asm-sparc64/Kbuild
+++ b/include/asm-sparc64/Kbuild
@@ -12,7 +12,6 @@ header-y += display7seg.h
12header-y += envctrl.h 12header-y += envctrl.h
13header-y += openprom.h 13header-y += openprom.h
14header-y += openpromio.h 14header-y += openpromio.h
15header-y += pconf.h
16header-y += psrcompat.h 15header-y += psrcompat.h
17header-y += pstate.h 16header-y += pstate.h
18header-y += reg.h 17header-y += reg.h
diff --git a/include/asm-sparc64/a.out-core.h b/include/asm-sparc64/a.out-core.h
deleted file mode 100644
index 3499b3c425ca..000000000000
--- a/include/asm-sparc64/a.out-core.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* a.out coredump register dumper
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12#ifndef _ASM_A_OUT_CORE_H
13#define _ASM_A_OUT_CORE_H
14
15#ifdef __KERNEL__
16
17#include <linux/user.h>
18
19/*
20 * fill in the user structure for an a.out core dump
21 */
22static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
23{
24 /* Only should be used for SunOS and ancient a.out
25 * SparcLinux binaries... Not worth implementing.
26 */
27 memset(dump, 0, sizeof(struct user));
28}
29
30#endif /* __KERNEL__ */
31#endif /* _ASM_A_OUT_CORE_H */
diff --git a/include/asm-sparc64/a.out.h b/include/asm-sparc64/a.out.h
deleted file mode 100644
index 44208c2a188e..000000000000
--- a/include/asm-sparc64/a.out.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-sparc/a.out.h>
diff --git a/include/asm-sparc64/ioctls.h b/include/asm-sparc64/ioctls.h
index 083c9a0f37de..c1be40647c99 100644
--- a/include/asm-sparc64/ioctls.h
+++ b/include/asm-sparc64/ioctls.h
@@ -44,8 +44,6 @@
44#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */ 44#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */
45#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */ 45#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */
46#define TIOCCONS _IO('t', 36) 46#define TIOCCONS _IO('t', 36)
47#define __TIOCSSIZE _IOW('t', 37, struct sunos_ttysize) /* SunOS Specific */
48#define __TIOCGSIZE _IOR('t', 38, struct sunos_ttysize) /* SunOS Specific */
49#define TIOCGSOFTCAR _IOR('t', 100, int) 47#define TIOCGSOFTCAR _IOR('t', 100, int)
50#define TIOCSSOFTCAR _IOW('t', 101, int) 48#define TIOCSSOFTCAR _IOW('t', 101, int)
51#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */ 49#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */
diff --git a/include/asm-sparc64/lmb.h b/include/asm-sparc64/lmb.h
new file mode 100644
index 000000000000..6a352cbcf520
--- /dev/null
+++ b/include/asm-sparc64/lmb.h
@@ -0,0 +1,10 @@
1#ifndef _SPARC64_LMB_H
2#define _SPARC64_LMB_H
3
4#include <asm/oplib.h>
5
6#define LMB_DBG(fmt...) prom_printf(fmt)
7
8#define LMB_REAL_LIMIT 0
9
10#endif /* !(_SPARC64_LMB_H) */
diff --git a/include/asm-sparc64/mman.h b/include/asm-sparc64/mman.h
index 8cc1860be630..e584563b56eb 100644
--- a/include/asm-sparc64/mman.h
+++ b/include/asm-sparc64/mman.h
@@ -22,19 +22,6 @@
22#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ 22#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
23#define MAP_NONBLOCK 0x10000 /* do not block on IO */ 23#define MAP_NONBLOCK 0x10000 /* do not block on IO */
24 24
25/* XXX Need to add flags to SunOS's mctl, mlockall, and madvise system
26 * XXX calls.
27 */
28
29/* SunOS sys_mctl() stuff... */
30#define MC_SYNC 1 /* Sync pages in memory with storage (usu. a file) */
31#define MC_LOCK 2 /* Lock pages into core ram, do not allow swapping of them */
32#define MC_UNLOCK 3 /* Unlock pages locked via previous mctl() with MC_LOCK arg */
33#define MC_LOCKAS 5 /* Lock an entire address space of the calling process */
34#define MC_UNLOCKAS 6 /* Unlock entire address space of calling process */
35
36#define MADV_FREE 0x5 /* (Solaris) contents can be freed */
37
38#ifdef __KERNEL__ 25#ifdef __KERNEL__
39#ifndef __ASSEMBLY__ 26#ifndef __ASSEMBLY__
40#define arch_mmap_check sparc64_mmap_check 27#define arch_mmap_check sparc64_mmap_check
diff --git a/include/asm-sparc64/namei.h b/include/asm-sparc64/namei.h
index ccda19e28695..275161f21213 100644
--- a/include/asm-sparc64/namei.h
+++ b/include/asm-sparc64/namei.h
@@ -8,19 +8,6 @@
8#ifndef __SPARC64_NAMEI_H 8#ifndef __SPARC64_NAMEI_H
9#define __SPARC64_NAMEI_H 9#define __SPARC64_NAMEI_H
10 10
11#define SPARC_BSD_EMUL "/usr/gnemul/sunos/" 11#define __emul_prefix() NULL
12#define SPARC_SOL_EMUL "/usr/gnemul/solaris/"
13
14static inline char * __emul_prefix(void)
15{
16 switch (current->personality) {
17 case PER_SUNOS:
18 return SPARC_BSD_EMUL;
19 case PER_SVR4:
20 return SPARC_SOL_EMUL;
21 default:
22 return NULL;
23 }
24}
25 12
26#endif /* __SPARC64_NAMEI_H */ 13#endif /* __SPARC64_NAMEI_H */
diff --git a/include/asm-sparc64/pconf.h b/include/asm-sparc64/pconf.h
deleted file mode 100644
index aad106a70908..000000000000
--- a/include/asm-sparc64/pconf.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/* $Id: pconf.h,v 1.1 1996/12/02 00:09:10 davem Exp $
2 * pconf.h: pathconf() and fpathconf() defines for SunOS
3 * system call compatibility.
4 *
5 * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu)
6 */
7
8#ifndef _SPARC64_PCONF_H
9#define _SPARC64_PCONF_H
10
11#include <linux/fs.h>
12#include <linux/limits.h>
13
14#define _PCONF_LINK 1 /* Max number of links to an object */
15#define _PCONF_CANON 2 /* TTY input buffer line size */
16#define _PCONF_INPUT 3 /* Biggest packet a tty can imbibe at once */
17#define _PCONF_NAME 4 /* Filename length max */
18#define _PCONF_PATH 5 /* Max size of a pathname */
19#define _PCONF_PIPE 6 /* Buffer size for a pipe */
20#define _PCONF_CHRESTRICT 7 /* Can only root chown files? */
21#define _PCONF_NOTRUNC 8 /* Are pathnames truncated if too big? */
22#define _PCONF_VDISABLE 9 /* Magic char to disable special tty chars */
23#define _PCONF_MAXPCONF 9
24
25#endif /* !(_SPARC64_PCONF_H) */
diff --git a/include/asm-sparc64/socket.h b/include/asm-sparc64/socket.h
index 44a625af6e31..8cf071fae3eb 100644
--- a/include/asm-sparc64/socket.h
+++ b/include/asm-sparc64/socket.h
@@ -24,9 +24,6 @@
24#define SO_SNDTIMEO 0x4000 24#define SO_SNDTIMEO 0x4000
25#define SO_ACCEPTCONN 0x8000 25#define SO_ACCEPTCONN 0x8000
26 26
27/* wha!??? */
28#define SO_DONTLINGER (~SO_LINGER) /* Older SunOS compat. hack */
29
30#define SO_SNDBUF 0x1001 27#define SO_SNDBUF 0x1001
31#define SO_RCVBUF 0x1002 28#define SO_RCVBUF 0x1002
32#define SO_SNDBUFFORCE 0x100a 29#define SO_SNDBUFFORCE 0x100a
diff --git a/include/asm-sparc64/solerrno.h b/include/asm-sparc64/solerrno.h
deleted file mode 100644
index a2ea6fcf3446..000000000000
--- a/include/asm-sparc64/solerrno.h
+++ /dev/null
@@ -1,132 +0,0 @@
1/* $Id: solerrno.h,v 1.1 1996/12/26 14:22:40 davem Exp $
2 * solerrno.h: Solaris error return codes for compatibility.
3 *
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5 */
6
7#ifndef _SPARC64_SOLERRNO_H
8#define _SPARC64_SOLERRNO_H
9
10#define SOL_EPERM 1 /* Required superuser access perms */
11#define SOL_ENOENT 2 /* File or directory does not exist */
12#define SOL_ESRCH 3 /* Process did not exist */
13#define SOL_EINTR 4 /* System call was interrupted */
14#define SOL_EIO 5 /* An i/o error occurred */
15#define SOL_ENXIO 6 /* Device or Address does not exist */
16#define SOL_E2BIG 7 /* Too many arguments were given */
17#define SOL_ENOEXEC 8 /* Header of executable was munged */
18#define SOL_EBADF 9 /* Bogus file number */
19#define SOL_ECHILD 10 /* No children of process exist */
20#define SOL_EAGAIN 11 /* beep beep, "try again later" */
21#define SOL_ENOMEM 12 /* No memory available */
22#define SOL_EACCES 13 /* Access not allowed */
23#define SOL_EFAULT 14 /* Address passed was invalid */
24#define SOL_ENOTBLK 15 /* blkdev op on non-block device */
25#define SOL_EBUSY 16 /* Mounted device was busy */
26#define SOL_EEXIST 17 /* File specified already exists */
27#define SOL_EXDEV 18 /* Link request across diff devices */
28#define SOL_ENODEV 19 /* Device does not exist on system */
29#define SOL_ENOTDIR 20 /* Dir operation on non-directory */
30#define SOL_EISDIR 21 /* File was of directory type */
31#define SOL_EINVAL 22 /* Argument passed was invalid */
32#define SOL_ENFILE 23 /* No more room in file table */
33#define SOL_EMFILE 24 /* Proc has too many files open */
34#define SOL_ENOTTY 25 /* Ioctl was invalid for req device */
35#define SOL_ETXTBSY 26 /* Text file in busy state */
36#define SOL_EFBIG 27 /* Too big of a file for operation */
37#define SOL_ENOSPC 28 /* Disk is full */
38#define SOL_ESPIPE 29 /* Seek attempted on non-seeking dev*/
39#define SOL_EROFS 30 /* Write attempted on read-only fs */
40#define SOL_EMLINK 31 /* Too many links in file search */
41#define SOL_EPIPE 32 /* Call a plumber */
42#define SOL_EDOM 33 /* Argument was out of fct domain */
43#define SOL_ERANGE 34 /* Could not represent math result */
44#define SOL_ENOMSG 35 /* Message of req type doesn't exist */
45#define SOL_EIDRM 36 /* Identifier has been removed */
46#define SOL_ECHRNG 37 /* Req channel number out of range */
47#define SOL_EL2NSYNC 38 /* Could not sync at run level 2 */
48#define SOL_EL3HLT 39 /* Halted at run level 3 */
49#define SOL_EL3RST 40 /* Reset at run level 3 */
50#define SOL_ELNRNG 41 /* Out of range link number */
51#define SOL_EUNATCH 42 /* Driver for protocol not attached */
52#define SOL_ENOCSI 43 /* CSI structure not around */
53#define SOL_EL2HLT 44 /* Halted at run level 2 */
54#define SOL_EDEADLK 45 /* Deadlock condition detected */
55#define SOL_ENOLCK 46 /* Record locks unavailable */
56#define SOL_ECANCELED 47 /* Cancellation of oper. happened */
57#define SOL_ENOTSUP 48 /* Attempt of unsupported operation */
58#define SOL_EDQUOT 49 /* Users disk quota exceeded */
59#define SOL_EBADE 50 /* Invalid exchange */
60#define SOL_EBADR 51 /* Request descriptor was invalid */
61#define SOL_EXFULL 52 /* Full exchange */
62#define SOL_ENOANO 53 /* ano does not exist */
63#define SOL_EBADRQC 54 /* Req code was invalid */
64#define SOL_EBADSLT 55 /* Bad slot number */
65#define SOL_EDEADLOCK 56 /* Deadlock in fs error */
66#define SOL_EBFONT 57 /* Font file format invalid */
67/* YOW, I LOVE SYSV STREAMS!!!! */
68#define SOL_ENOSTR 60 /* Stream-op on non-stream dev */
69#define SOL_ENODATA 61 /* No data avail at this time */
70#define SOL_ETIME 62 /* Expiration of time occurred */
71#define SOL_ENOSR 63 /* Streams resources exhausted */
72#define SOL_ENONET 64 /* No network connected */
73#define SOL_ENOPKG 65 /* Non-installed package */
74#define SOL_EREMOTE 66 /* Object was on remote machine */
75#define SOL_ENOLINK 67 /* Cut link */
76#define SOL_EADV 68 /* Error in advertise */
77#define SOL_ESRMNT 69 /* Some magic srmount problem */
78#define SOL_ECOMM 70 /* During send, comm error occurred */
79#define SOL_EPROTO 71 /* Protocol botch */
80#define SOL_EMULTIHOP 74 /* Multihop attempted */
81#define SOL_EBADMSG 77 /* Message was unreadable */
82#define SOL_ENAMETOOLONG 78 /* Too long of a path name */
83#define SOL_EOVERFLOW 79 /* Data type too small for datum */
84#define SOL_ENOTUNIQ 80 /* Logical name was not unique */
85#define SOL_EBADFD 81 /* Op cannot be performed on fd */
86#define SOL_EREMCHG 82 /* Remote address is now different */
87#define SOL_ELIBACC 83 /* Shared lib could not be accessed */
88#define SOL_ELIBBAD 84 /* ShLib is corrupted in some way */
89#define SOL_ELIBSCN 85 /* A.out ShLib problems */
90#define SOL_ELIBMAX 86 /* Exceeded ShLib linkage limit */
91#define SOL_ELIBEXEC 87 /* Execution of ShLib attempted */
92#define SOL_EILSEQ 88 /* Bad byte sequence found */
93#define SOL_ENOSYS 89 /* Invalid filesystem operation */
94#define SOL_ELOOP 90 /* Detected loop in symbolic links */
95#define SOL_ERESTART 91 /* System call is restartable */
96#define SOL_ESTRPIPE 92 /* Do not sleep in head of stream */
97#define SOL_ENOTEMPTY 93 /* Rmdir of non-empty directory */
98#define SOL_EUSERS 94 /* Over abundance of users for ufs */
99#define SOL_ENOTSOCK 95 /* Sock-op on non-sock */
100#define SOL_EDESTADDRREQ 96 /* No dest addr given, but needed */
101#define SOL_EMSGSIZE 97 /* Msg too big */
102#define SOL_EPROTOTYPE 98 /* Bad socket protocol */
103#define SOL_ENOPROTOOPT 99 /* Unavailable protocol */
104#define SOL_EPROTONOSUPPORT 120 /* Unsupported protocol */
105#define SOL_ESOCKTNOSUPPORT 121 /* Unsupported socket type */
106#define SOL_EOPNOTSUPP 122 /* Unsupported sock-op */
107#define SOL_EPFNOSUPPORT 123 /* Unsupported protocol family */
108#define SOL_EAFNOSUPPORT 124 /* Unsup addr family for protocol */
109#define SOL_EADDRINUSE 125 /* Req addr is already in use */
110#define SOL_EADDRNOTAVAIL 126 /* Req addr not available right now */
111#define SOL_ENETDOWN 127 /* Your subnet is on fire */
112#define SOL_ENETUNREACH 128 /* Someone playing with gateway and */
113 /* did not tell you he was going to */
114#define SOL_ENETRESET 129 /* Buy less-buggy ethernet cards */
115#define SOL_ECONNABORTED 130 /* Aborted connection due to sw */
116#define SOL_ECONNRESET 131 /* Your peers reset your connection */
117#define SOL_ENOBUFS 132 /* No buffer space available */
118#define SOL_EISCONN 133 /* Connect on already connected */
119 /* socket attempted */
120#define SOL_ENOTCONN 134 /* Comm on non-connected socket */
121#define SOL_ESHUTDOWN 143 /* Op attempted after sock-shutdown */
122#define SOL_ETOOMANYREFS 144 /* Reference limit exceeded */
123#define SOL_ETIMEDOUT 145 /* Timed out connection */
124#define SOL_ECONNREFUSED 146 /* Connection refused by remote host*/
125#define SOL_EHOSTDOWN 147 /* Remote host is up in flames */
126#define SOL_EHOSTUNREACH 148 /* Make a left at Easton Ave..... */
127#define SOL_EWOULDBLOCK EAGAIN /* Just an alias */
128#define SOL_EALREADY 149 /* Operation is already occurring */
129#define SOL_EINPROGRESS 150 /* Operation is happening now */
130#define SOL_ESTALE 151 /* Fungus growth on NFS file handle */
131
132#endif /* !(_SPARC64_SOLERRNO_H) */
diff --git a/include/asm-sparc64/svr4.h b/include/asm-sparc64/svr4.h
deleted file mode 100644
index c96d5f116e1c..000000000000
--- a/include/asm-sparc64/svr4.h
+++ /dev/null
@@ -1,120 +0,0 @@
1/* Solaris/SPARC constants and definitions --
2 * (C) 1996 Miguel de Icaza
3 *
4 * This file is not meant to be included by user level applications
5 * but the solaris syscall emulator
6 */
7
8#ifndef _SPARC64_SVR4_H
9#define _SPARC64_SVR4_H
10
11/* Signals as used by svr4 */
12typedef struct { /* signal set type */
13 uint sigbits[4];
14} svr4_sigset_t;
15
16/* Values for siginfo.code */
17#define SVR4_SINOINFO 32767
18/* Siginfo, sucker expects bunch of information on those parameters */
19typedef union {
20 char total_size [128];
21 struct {
22 int signo;
23 int code;
24 int error;
25 union {
26 } data;
27 } siginfo;
28} svr4_siginfo_t;
29
30/* Context definition */
31
32/* Location of the user stored registers into a greg_t */
33enum {
34 SVR4_PSR, SVR4_PC, SVR4_NPC, SVR4_Y,
35 SVR4_G1, SVR4_G2, SVR4_G3, SVR4_G4,
36 SVR4_G5, SVR4_G6, SVR4_G7, SVR4_O0,
37 SVR4_O1, SVR4_O2, SVR4_O3, SVR4_O4,
38 SVR4_O5, SVR4_O6, SVR4_O7
39};
40
41/* sizeof (regs) / sizeof (greg_t), defined in the ABI */
42#define SVR4_NREGS 19
43#define SVR4_MAXWIN 31
44
45typedef struct {
46 u32 rwin_lo[8];
47 u32 rwin_in[8];
48} svr4_rwindow_t;
49
50typedef struct {
51 int count;
52 u32 winptr [SVR4_MAXWIN]; /* pointer to the windows */
53
54 svr4_rwindow_t win[SVR4_MAXWIN]; /* the windows */
55} svr4_gwindows_t;
56
57typedef int svr4_gregset_t[SVR4_NREGS];
58
59typedef struct {
60 u64 fpu_regs[32];
61 u32 fp_q;
62 u32 fp_fsr;
63 u_char fp_nqel;
64 u_char fp_nqsize;
65 u_char inuse; /* if fpu is in use */
66} svr4_fregset_t;
67
68typedef struct {
69 u32 id; /* if this holds "xrs" string => ptr is valid */
70 u32 ptr;
71} svr4_xrs_t;
72
73/* Machine dependent context */
74typedef struct {
75 svr4_gregset_t greg; /* registers 0..19 (see top) */
76 u32 gwin; /* may point to register windows */
77 svr4_fregset_t freg; /* floating point registers */
78 svr4_xrs_t xrs; /* mhm? */
79 int pad[19];
80} svr4_mcontext_t;
81
82/* flags for stack_t.flags */
83enum svr4_stack_flags {
84 SVR4_SS_ONSTACK,
85 SVR4_SS_DISABLE,
86};
87
88/* signal stack execution place, unsupported */
89typedef struct svr4_stack_t {
90 u32 sp;
91 int size;
92 int flags;
93} svr4_stack_t;
94
95/* Context used by getcontext and setcontext */
96typedef struct svr4_ucontext_t {
97 u32 flags; /* context flags, indicate what is loaded */
98 u32 link;
99 svr4_sigset_t sigmask;
100 svr4_stack_t stack;
101 svr4_mcontext_t mcontext;
102 int pad[23];
103} svr4_ucontext_t;
104
105/* windows hold the windows as they were at signal time,
106 * ucontext->mcontext holds a pointer to them.
107 * addresses for uc and si are passed as parameters to svr4 signal
108 * handler
109 */
110
111/* This is the signal frame that is passed to the signal handler */
112typedef struct {
113 svr4_gwindows_t gw; /* windows */
114 svr4_ucontext_t uc; /* machine context */
115 svr4_siginfo_t si; /* siginfo */
116} svr4_signal_frame_t;
117
118#define SVR4_SF_ALIGNED (((sizeof (svr4_signal_frame_t) + 7) & (~7)))
119
120#endif /* include control */
diff --git a/include/asm-sparc64/termios.h b/include/asm-sparc64/termios.h
index ef527211f8a8..cacbea171ad7 100644
--- a/include/asm-sparc64/termios.h
+++ b/include/asm-sparc64/termios.h
@@ -33,11 +33,6 @@ struct ltchars {
33}; 33};
34#endif /* __KERNEL__ */ 34#endif /* __KERNEL__ */
35 35
36struct sunos_ttysize {
37 int st_lines; /* Lines on the terminal */
38 int st_columns; /* Columns on the terminal */
39};
40
41struct winsize { 36struct winsize {
42 unsigned short ws_row; 37 unsigned short ws_row;
43 unsigned short ws_col; 38 unsigned short ws_col;
diff --git a/include/asm-sparc64/ttable.h b/include/asm-sparc64/ttable.h
index bbb9c8f13d61..7208a777750e 100644
--- a/include/asm-sparc64/ttable.h
+++ b/include/asm-sparc64/ttable.h
@@ -99,14 +99,6 @@
99 or %l7, %lo(systbl), %l7; \ 99 or %l7, %lo(systbl), %l7; \
100 nop; nop; 100 nop; nop;
101 101
102#define INDIRECT_SOLARIS_SYSCALL(num) \
103 sethi %hi(109f), %g7; \
104 ba,pt %xcc, etrap; \
105109: or %g7, %lo(109b), %g7; \
106 ba,pt %xcc, tl0_solaris + 0xc; \
107 mov num, %g1; \
108 nop;nop;nop;
109
110#define TRAP_UTRAP(handler,lvl) \ 102#define TRAP_UTRAP(handler,lvl) \
111 mov handler, %g3; \ 103 mov handler, %g3; \
112 ba,pt %xcc, utrap_trap; \ 104 ba,pt %xcc, utrap_trap; \
@@ -117,11 +109,6 @@
117 nop; \ 109 nop; \
118 nop; 110 nop;
119 111
120#ifdef CONFIG_SUNOS_EMUL
121#define SUNOS_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sunos_sys_table)
122#else
123#define SUNOS_SYSCALL_TRAP TRAP(sunos_syscall)
124#endif
125#ifdef CONFIG_COMPAT 112#ifdef CONFIG_COMPAT
126#define LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sys_call_table32) 113#define LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sys_call_table32)
127#else 114#else
@@ -130,11 +117,6 @@
130#define LINUX_64BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table64) 117#define LINUX_64BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table64)
131#define GETCC_TRAP TRAP(getcc) 118#define GETCC_TRAP TRAP(getcc)
132#define SETCC_TRAP TRAP(setcc) 119#define SETCC_TRAP TRAP(setcc)
133#ifdef CONFIG_SOLARIS_EMUL
134#define SOLARIS_SYSCALL_TRAP TRAP(solaris_sparc_syscall)
135#else
136#define SOLARIS_SYSCALL_TRAP TRAP(solaris_syscall)
137#endif
138#define BREAKPOINT_TRAP TRAP(breakpoint_trap) 120#define BREAKPOINT_TRAP TRAP(breakpoint_trap)
139 121
140#ifdef CONFIG_TRACE_IRQFLAGS 122#ifdef CONFIG_TRACE_IRQFLAGS
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index 77559da0ea3f..13be4453a1f0 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -338,16 +338,6 @@
338#define NR_SYSCALLS 317 338#define NR_SYSCALLS 317
339 339
340#ifdef __KERNEL__ 340#ifdef __KERNEL__
341/* sysconf options, for SunOS compatibility */
342#define _SC_ARG_MAX 1
343#define _SC_CHILD_MAX 2
344#define _SC_CLK_TCK 3
345#define _SC_NGROUPS_MAX 4
346#define _SC_OPEN_MAX 5
347#define _SC_JOB_CONTROL 6
348#define _SC_SAVED_IDS 7
349#define _SC_VERSION 8
350
351#define __ARCH_WANT_IPC_PARSE_VERSION 341#define __ARCH_WANT_IPC_PARSE_VERSION
352#define __ARCH_WANT_OLD_READDIR 342#define __ARCH_WANT_OLD_READDIR
353#define __ARCH_WANT_STAT64 343#define __ARCH_WANT_STAT64
diff --git a/include/asm-sparc64/user.h b/include/asm-sparc64/user.h
index 02b138943837..29fc6e906c29 100644
--- a/include/asm-sparc64/user.h
+++ b/include/asm-sparc64/user.h
@@ -1,60 +1 @@
1/* $Id: user.h,v 1.1 1996/12/26 14:22:44 davem Exp $ #include <asm-sparc/user.h>
2 * asm-sparc64/user.h: Core file definitions for the Sparc.
3 *
4 * Keep in sync with reg.h. Actually, we could get rid of this
5 * one, since we won't a.out core dump that much anyways - miguel.
6 * Copyright (C) 1995 (davem@caip.rutgers.edu)
7 */
8#ifndef _SPARC64_USER_H
9#define _SPARC64_USER_H
10
11#include <linux/a.out.h>
12struct sunos_regs {
13 unsigned int psr, pc, npc, y;
14 unsigned int regs[15];
15};
16
17struct sunos_fpqueue {
18 unsigned int *addr;
19 unsigned int inst;
20};
21
22struct sunos_fp {
23 union {
24 unsigned int regs[32];
25 double reg_dbls[16];
26 } fregs;
27 unsigned int fsr;
28 unsigned int flags;
29 unsigned int extra;
30 unsigned int fpq_count;
31 struct sunos_fpqueue fpq[16];
32};
33
34struct sunos_fpu {
35 struct sunos_fp fpstatus;
36};
37
38/* The SunOS core file header layout. */
39struct user {
40 unsigned int magic;
41 unsigned int len;
42 struct sunos_regs regs;
43 struct exec uexec;
44 int signal;
45 size_t u_tsize; /* all of these in bytes! */
46 size_t u_dsize;
47 size_t u_ssize;
48 char u_comm[17];
49 struct sunos_fpu fpu;
50 unsigned int sigcode; /* Special sigcontext subcode, if any */
51};
52
53#define NBPG PAGE_SIZE /* XXX 4096 maybe? */
54#define UPAGES 1
55#define HOST_TEXT_START_ADDR (u.start_code)
56#define HOST_DATA_START_ADDR (u.start_data)
57#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
58#define SUNOS_CORE_MAGIC 0x080456
59
60#endif /* !(_SPARC64_USER_H) */
diff --git a/include/asm-x86/boot.h b/include/asm-x86/boot.h
index ed8affbf96cb..2faed7ecb092 100644
--- a/include/asm-x86/boot.h
+++ b/include/asm-x86/boot.h
@@ -17,4 +17,12 @@
17 + (CONFIG_PHYSICAL_ALIGN - 1)) \ 17 + (CONFIG_PHYSICAL_ALIGN - 1)) \
18 & ~(CONFIG_PHYSICAL_ALIGN - 1)) 18 & ~(CONFIG_PHYSICAL_ALIGN - 1))
19 19
20#ifdef CONFIG_X86_64
21#define BOOT_HEAP_SIZE 0x7000
22#define BOOT_STACK_SIZE 0x4000
23#else
24#define BOOT_HEAP_SIZE 0x4000
25#define BOOT_STACK_SIZE 0x1000
26#endif
27
20#endif /* _ASM_BOOT_H */ 28#endif /* _ASM_BOOT_H */
diff --git a/include/asm-x86/dma-mapping.h b/include/asm-x86/dma-mapping.h
index 58f790f4df52..a1a4dc7fe6ec 100644
--- a/include/asm-x86/dma-mapping.h
+++ b/include/asm-x86/dma-mapping.h
@@ -1,5 +1,237 @@
1#ifndef _ASM_DMA_MAPPING_H_
2#define _ASM_DMA_MAPPING_H_
3
4/*
5 * IOMMU interface. See Documentation/DMA-mapping.txt and DMA-API.txt for
6 * documentation.
7 */
8
9#include <linux/scatterlist.h>
10#include <asm/io.h>
11#include <asm/swiotlb.h>
12
13extern dma_addr_t bad_dma_address;
14extern int iommu_merge;
15extern struct device fallback_dev;
16extern int panic_on_overflow;
17extern int forbid_dac;
18extern int force_iommu;
19
20struct dma_mapping_ops {
21 int (*mapping_error)(dma_addr_t dma_addr);
22 void* (*alloc_coherent)(struct device *dev, size_t size,
23 dma_addr_t *dma_handle, gfp_t gfp);
24 void (*free_coherent)(struct device *dev, size_t size,
25 void *vaddr, dma_addr_t dma_handle);
26 dma_addr_t (*map_single)(struct device *hwdev, phys_addr_t ptr,
27 size_t size, int direction);
28 /* like map_single, but doesn't check the device mask */
29 dma_addr_t (*map_simple)(struct device *hwdev, phys_addr_t ptr,
30 size_t size, int direction);
31 void (*unmap_single)(struct device *dev, dma_addr_t addr,
32 size_t size, int direction);
33 void (*sync_single_for_cpu)(struct device *hwdev,
34 dma_addr_t dma_handle, size_t size,
35 int direction);
36 void (*sync_single_for_device)(struct device *hwdev,
37 dma_addr_t dma_handle, size_t size,
38 int direction);
39 void (*sync_single_range_for_cpu)(struct device *hwdev,
40 dma_addr_t dma_handle, unsigned long offset,
41 size_t size, int direction);
42 void (*sync_single_range_for_device)(struct device *hwdev,
43 dma_addr_t dma_handle, unsigned long offset,
44 size_t size, int direction);
45 void (*sync_sg_for_cpu)(struct device *hwdev,
46 struct scatterlist *sg, int nelems,
47 int direction);
48 void (*sync_sg_for_device)(struct device *hwdev,
49 struct scatterlist *sg, int nelems,
50 int direction);
51 int (*map_sg)(struct device *hwdev, struct scatterlist *sg,
52 int nents, int direction);
53 void (*unmap_sg)(struct device *hwdev,
54 struct scatterlist *sg, int nents,
55 int direction);
56 int (*dma_supported)(struct device *hwdev, u64 mask);
57 int is_phys;
58};
59
60extern const struct dma_mapping_ops *dma_ops;
61
62static inline int dma_mapping_error(dma_addr_t dma_addr)
63{
64 if (dma_ops->mapping_error)
65 return dma_ops->mapping_error(dma_addr);
66
67 return (dma_addr == bad_dma_address);
68}
69
70#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
71#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
72
73void *dma_alloc_coherent(struct device *dev, size_t size,
74 dma_addr_t *dma_handle, gfp_t flag);
75
76void dma_free_coherent(struct device *dev, size_t size,
77 void *vaddr, dma_addr_t dma_handle);
78
79
80extern int dma_supported(struct device *hwdev, u64 mask);
81extern int dma_set_mask(struct device *dev, u64 mask);
82
83static inline dma_addr_t
84dma_map_single(struct device *hwdev, void *ptr, size_t size,
85 int direction)
86{
87 BUG_ON(!valid_dma_direction(direction));
88 return dma_ops->map_single(hwdev, virt_to_phys(ptr), size, direction);
89}
90
91static inline void
92dma_unmap_single(struct device *dev, dma_addr_t addr, size_t size,
93 int direction)
94{
95 BUG_ON(!valid_dma_direction(direction));
96 if (dma_ops->unmap_single)
97 dma_ops->unmap_single(dev, addr, size, direction);
98}
99
100static inline int
101dma_map_sg(struct device *hwdev, struct scatterlist *sg,
102 int nents, int direction)
103{
104 BUG_ON(!valid_dma_direction(direction));
105 return dma_ops->map_sg(hwdev, sg, nents, direction);
106}
107
108static inline void
109dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
110 int direction)
111{
112 BUG_ON(!valid_dma_direction(direction));
113 if (dma_ops->unmap_sg)
114 dma_ops->unmap_sg(hwdev, sg, nents, direction);
115}
116
117static inline void
118dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
119 size_t size, int direction)
120{
121 BUG_ON(!valid_dma_direction(direction));
122 if (dma_ops->sync_single_for_cpu)
123 dma_ops->sync_single_for_cpu(hwdev, dma_handle, size,
124 direction);
125 flush_write_buffers();
126}
127
128static inline void
129dma_sync_single_for_device(struct device *hwdev, dma_addr_t dma_handle,
130 size_t size, int direction)
131{
132 BUG_ON(!valid_dma_direction(direction));
133 if (dma_ops->sync_single_for_device)
134 dma_ops->sync_single_for_device(hwdev, dma_handle, size,
135 direction);
136 flush_write_buffers();
137}
138
139static inline void
140dma_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
141 unsigned long offset, size_t size, int direction)
142{
143 BUG_ON(!valid_dma_direction(direction));
144 if (dma_ops->sync_single_range_for_cpu)
145 dma_ops->sync_single_range_for_cpu(hwdev, dma_handle, offset,
146 size, direction);
147
148 flush_write_buffers();
149}
150
151static inline void
152dma_sync_single_range_for_device(struct device *hwdev, dma_addr_t dma_handle,
153 unsigned long offset, size_t size,
154 int direction)
155{
156 BUG_ON(!valid_dma_direction(direction));
157 if (dma_ops->sync_single_range_for_device)
158 dma_ops->sync_single_range_for_device(hwdev, dma_handle,
159 offset, size, direction);
160
161 flush_write_buffers();
162}
163
164static inline void
165dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
166 int nelems, int direction)
167{
168 BUG_ON(!valid_dma_direction(direction));
169 if (dma_ops->sync_sg_for_cpu)
170 dma_ops->sync_sg_for_cpu(hwdev, sg, nelems, direction);
171 flush_write_buffers();
172}
173
174static inline void
175dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
176 int nelems, int direction)
177{
178 BUG_ON(!valid_dma_direction(direction));
179 if (dma_ops->sync_sg_for_device)
180 dma_ops->sync_sg_for_device(hwdev, sg, nelems, direction);
181
182 flush_write_buffers();
183}
184
185static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
186 size_t offset, size_t size,
187 int direction)
188{
189 BUG_ON(!valid_dma_direction(direction));
190 return dma_ops->map_single(dev, page_to_phys(page)+offset,
191 size, direction);
192}
193
194static inline void dma_unmap_page(struct device *dev, dma_addr_t addr,
195 size_t size, int direction)
196{
197 dma_unmap_single(dev, addr, size, direction);
198}
199
200static inline void
201dma_cache_sync(struct device *dev, void *vaddr, size_t size,
202 enum dma_data_direction dir)
203{
204 flush_write_buffers();
205}
206
207static inline int dma_get_cache_alignment(void)
208{
209 /* no easy way to get cache size on all x86, so return the
210 * maximum possible, to be safe */
211 return boot_cpu_data.x86_clflush_size;
212}
213
214#define dma_is_consistent(d, h) (1)
215
1#ifdef CONFIG_X86_32 216#ifdef CONFIG_X86_32
2# include "dma-mapping_32.h" 217# define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
3#else 218struct dma_coherent_mem {
4# include "dma-mapping_64.h" 219 void *virt_base;
220 u32 device_base;
221 int size;
222 int flags;
223 unsigned long *bitmap;
224};
225
226extern int
227dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
228 dma_addr_t device_addr, size_t size, int flags);
229
230extern void
231dma_release_declared_memory(struct device *dev);
232
233extern void *
234dma_mark_declared_memory_occupied(struct device *dev,
235 dma_addr_t device_addr, size_t size);
236#endif /* CONFIG_X86_32 */
5#endif 237#endif
diff --git a/include/asm-x86/dma-mapping_32.h b/include/asm-x86/dma-mapping_32.h
deleted file mode 100644
index 55f01bd9e556..000000000000
--- a/include/asm-x86/dma-mapping_32.h
+++ /dev/null
@@ -1,187 +0,0 @@
1#ifndef _ASM_I386_DMA_MAPPING_H
2#define _ASM_I386_DMA_MAPPING_H
3
4#include <linux/mm.h>
5#include <linux/scatterlist.h>
6
7#include <asm/cache.h>
8#include <asm/io.h>
9#include <asm/bug.h>
10
11#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
12#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
13
14void *dma_alloc_coherent(struct device *dev, size_t size,
15 dma_addr_t *dma_handle, gfp_t flag);
16
17void dma_free_coherent(struct device *dev, size_t size,
18 void *vaddr, dma_addr_t dma_handle);
19
20static inline dma_addr_t
21dma_map_single(struct device *dev, void *ptr, size_t size,
22 enum dma_data_direction direction)
23{
24 BUG_ON(!valid_dma_direction(direction));
25 WARN_ON(size == 0);
26 flush_write_buffers();
27 return virt_to_phys(ptr);
28}
29
30static inline void
31dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
32 enum dma_data_direction direction)
33{
34 BUG_ON(!valid_dma_direction(direction));
35}
36
37static inline int
38dma_map_sg(struct device *dev, struct scatterlist *sglist, int nents,
39 enum dma_data_direction direction)
40{
41 struct scatterlist *sg;
42 int i;
43
44 BUG_ON(!valid_dma_direction(direction));
45 WARN_ON(nents == 0 || sglist[0].length == 0);
46
47 for_each_sg(sglist, sg, nents, i) {
48 BUG_ON(!sg_page(sg));
49
50 sg->dma_address = sg_phys(sg);
51 }
52
53 flush_write_buffers();
54 return nents;
55}
56
57static inline dma_addr_t
58dma_map_page(struct device *dev, struct page *page, unsigned long offset,
59 size_t size, enum dma_data_direction direction)
60{
61 BUG_ON(!valid_dma_direction(direction));
62 return page_to_phys(page) + offset;
63}
64
65static inline void
66dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
67 enum dma_data_direction direction)
68{
69 BUG_ON(!valid_dma_direction(direction));
70}
71
72
73static inline void
74dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
75 enum dma_data_direction direction)
76{
77 BUG_ON(!valid_dma_direction(direction));
78}
79
80static inline void
81dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
82 enum dma_data_direction direction)
83{
84}
85
86static inline void
87dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
88 enum dma_data_direction direction)
89{
90 flush_write_buffers();
91}
92
93static inline void
94dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle,
95 unsigned long offset, size_t size,
96 enum dma_data_direction direction)
97{
98}
99
100static inline void
101dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
102 unsigned long offset, size_t size,
103 enum dma_data_direction direction)
104{
105 flush_write_buffers();
106}
107
108static inline void
109dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
110 enum dma_data_direction direction)
111{
112}
113
114static inline void
115dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
116 enum dma_data_direction direction)
117{
118 flush_write_buffers();
119}
120
121static inline int
122dma_mapping_error(dma_addr_t dma_addr)
123{
124 return 0;
125}
126
127extern int forbid_dac;
128
129static inline int
130dma_supported(struct device *dev, u64 mask)
131{
132 /*
133 * we fall back to GFP_DMA when the mask isn't all 1s,
134 * so we can't guarantee allocations that must be
135 * within a tighter range than GFP_DMA..
136 */
137 if(mask < 0x00ffffff)
138 return 0;
139
140 /* Work around chipset bugs */
141 if (forbid_dac > 0 && mask > 0xffffffffULL)
142 return 0;
143
144 return 1;
145}
146
147static inline int
148dma_set_mask(struct device *dev, u64 mask)
149{
150 if(!dev->dma_mask || !dma_supported(dev, mask))
151 return -EIO;
152
153 *dev->dma_mask = mask;
154
155 return 0;
156}
157
158static inline int
159dma_get_cache_alignment(void)
160{
161 /* no easy way to get cache size on all x86, so return the
162 * maximum possible, to be safe */
163 return (1 << INTERNODE_CACHE_SHIFT);
164}
165
166#define dma_is_consistent(d, h) (1)
167
168static inline void
169dma_cache_sync(struct device *dev, void *vaddr, size_t size,
170 enum dma_data_direction direction)
171{
172 flush_write_buffers();
173}
174
175#define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
176extern int
177dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
178 dma_addr_t device_addr, size_t size, int flags);
179
180extern void
181dma_release_declared_memory(struct device *dev);
182
183extern void *
184dma_mark_declared_memory_occupied(struct device *dev,
185 dma_addr_t device_addr, size_t size);
186
187#endif
diff --git a/include/asm-x86/dma-mapping_64.h b/include/asm-x86/dma-mapping_64.h
deleted file mode 100644
index ecd0f6125ba3..000000000000
--- a/include/asm-x86/dma-mapping_64.h
+++ /dev/null
@@ -1,202 +0,0 @@
1#ifndef _X8664_DMA_MAPPING_H
2#define _X8664_DMA_MAPPING_H 1
3
4/*
5 * IOMMU interface. See Documentation/DMA-mapping.txt and DMA-API.txt for
6 * documentation.
7 */
8
9#include <linux/scatterlist.h>
10#include <asm/io.h>
11#include <asm/swiotlb.h>
12
13struct dma_mapping_ops {
14 int (*mapping_error)(dma_addr_t dma_addr);
15 void* (*alloc_coherent)(struct device *dev, size_t size,
16 dma_addr_t *dma_handle, gfp_t gfp);
17 void (*free_coherent)(struct device *dev, size_t size,
18 void *vaddr, dma_addr_t dma_handle);
19 dma_addr_t (*map_single)(struct device *hwdev, void *ptr,
20 size_t size, int direction);
21 /* like map_single, but doesn't check the device mask */
22 dma_addr_t (*map_simple)(struct device *hwdev, char *ptr,
23 size_t size, int direction);
24 void (*unmap_single)(struct device *dev, dma_addr_t addr,
25 size_t size, int direction);
26 void (*sync_single_for_cpu)(struct device *hwdev,
27 dma_addr_t dma_handle, size_t size,
28 int direction);
29 void (*sync_single_for_device)(struct device *hwdev,
30 dma_addr_t dma_handle, size_t size,
31 int direction);
32 void (*sync_single_range_for_cpu)(struct device *hwdev,
33 dma_addr_t dma_handle, unsigned long offset,
34 size_t size, int direction);
35 void (*sync_single_range_for_device)(struct device *hwdev,
36 dma_addr_t dma_handle, unsigned long offset,
37 size_t size, int direction);
38 void (*sync_sg_for_cpu)(struct device *hwdev,
39 struct scatterlist *sg, int nelems,
40 int direction);
41 void (*sync_sg_for_device)(struct device *hwdev,
42 struct scatterlist *sg, int nelems,
43 int direction);
44 int (*map_sg)(struct device *hwdev, struct scatterlist *sg,
45 int nents, int direction);
46 void (*unmap_sg)(struct device *hwdev,
47 struct scatterlist *sg, int nents,
48 int direction);
49 int (*dma_supported)(struct device *hwdev, u64 mask);
50 int is_phys;
51};
52
53extern dma_addr_t bad_dma_address;
54extern const struct dma_mapping_ops* dma_ops;
55extern int iommu_merge;
56
57static inline int dma_mapping_error(dma_addr_t dma_addr)
58{
59 if (dma_ops->mapping_error)
60 return dma_ops->mapping_error(dma_addr);
61
62 return (dma_addr == bad_dma_address);
63}
64
65#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
66#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
67
68#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
69#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
70
71extern void *dma_alloc_coherent(struct device *dev, size_t size,
72 dma_addr_t *dma_handle, gfp_t gfp);
73extern void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
74 dma_addr_t dma_handle);
75
76static inline dma_addr_t
77dma_map_single(struct device *hwdev, void *ptr, size_t size,
78 int direction)
79{
80 BUG_ON(!valid_dma_direction(direction));
81 return dma_ops->map_single(hwdev, ptr, size, direction);
82}
83
84static inline void
85dma_unmap_single(struct device *dev, dma_addr_t addr,size_t size,
86 int direction)
87{
88 BUG_ON(!valid_dma_direction(direction));
89 dma_ops->unmap_single(dev, addr, size, direction);
90}
91
92#define dma_map_page(dev,page,offset,size,dir) \
93 dma_map_single((dev), page_address(page)+(offset), (size), (dir))
94
95#define dma_unmap_page dma_unmap_single
96
97static inline void
98dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
99 size_t size, int direction)
100{
101 BUG_ON(!valid_dma_direction(direction));
102 if (dma_ops->sync_single_for_cpu)
103 dma_ops->sync_single_for_cpu(hwdev, dma_handle, size,
104 direction);
105 flush_write_buffers();
106}
107
108static inline void
109dma_sync_single_for_device(struct device *hwdev, dma_addr_t dma_handle,
110 size_t size, int direction)
111{
112 BUG_ON(!valid_dma_direction(direction));
113 if (dma_ops->sync_single_for_device)
114 dma_ops->sync_single_for_device(hwdev, dma_handle, size,
115 direction);
116 flush_write_buffers();
117}
118
119static inline void
120dma_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
121 unsigned long offset, size_t size, int direction)
122{
123 BUG_ON(!valid_dma_direction(direction));
124 if (dma_ops->sync_single_range_for_cpu) {
125 dma_ops->sync_single_range_for_cpu(hwdev, dma_handle, offset, size, direction);
126 }
127
128 flush_write_buffers();
129}
130
131static inline void
132dma_sync_single_range_for_device(struct device *hwdev, dma_addr_t dma_handle,
133 unsigned long offset, size_t size, int direction)
134{
135 BUG_ON(!valid_dma_direction(direction));
136 if (dma_ops->sync_single_range_for_device)
137 dma_ops->sync_single_range_for_device(hwdev, dma_handle,
138 offset, size, direction);
139
140 flush_write_buffers();
141}
142
143static inline void
144dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
145 int nelems, int direction)
146{
147 BUG_ON(!valid_dma_direction(direction));
148 if (dma_ops->sync_sg_for_cpu)
149 dma_ops->sync_sg_for_cpu(hwdev, sg, nelems, direction);
150 flush_write_buffers();
151}
152
153static inline void
154dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
155 int nelems, int direction)
156{
157 BUG_ON(!valid_dma_direction(direction));
158 if (dma_ops->sync_sg_for_device) {
159 dma_ops->sync_sg_for_device(hwdev, sg, nelems, direction);
160 }
161
162 flush_write_buffers();
163}
164
165static inline int
166dma_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, int direction)
167{
168 BUG_ON(!valid_dma_direction(direction));
169 return dma_ops->map_sg(hwdev, sg, nents, direction);
170}
171
172static inline void
173dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
174 int direction)
175{
176 BUG_ON(!valid_dma_direction(direction));
177 dma_ops->unmap_sg(hwdev, sg, nents, direction);
178}
179
180extern int dma_supported(struct device *hwdev, u64 mask);
181
182/* same for gart, swiotlb, and nommu */
183static inline int dma_get_cache_alignment(void)
184{
185 return boot_cpu_data.x86_clflush_size;
186}
187
188#define dma_is_consistent(d, h) 1
189
190extern int dma_set_mask(struct device *dev, u64 mask);
191
192static inline void
193dma_cache_sync(struct device *dev, void *vaddr, size_t size,
194 enum dma_data_direction dir)
195{
196 flush_write_buffers();
197}
198
199extern struct device fallback_dev;
200extern int panic_on_overflow;
201
202#endif /* _X8664_DMA_MAPPING_H */
diff --git a/include/asm-x86/e820_32.h b/include/asm-x86/e820_32.h
index 43b1a8bd4b34..a9f7c6ec32bf 100644
--- a/include/asm-x86/e820_32.h
+++ b/include/asm-x86/e820_32.h
@@ -24,7 +24,7 @@ extern void update_e820(void);
24extern int e820_all_mapped(unsigned long start, unsigned long end, 24extern int e820_all_mapped(unsigned long start, unsigned long end,
25 unsigned type); 25 unsigned type);
26extern int e820_any_mapped(u64 start, u64 end, unsigned type); 26extern int e820_any_mapped(u64 start, u64 end, unsigned type);
27extern void find_max_pfn(void); 27extern void propagate_e820_map(void);
28extern void register_bootmem_low_pages(unsigned long max_low_pfn); 28extern void register_bootmem_low_pages(unsigned long max_low_pfn);
29extern void add_memory_region(unsigned long long start, 29extern void add_memory_region(unsigned long long start,
30 unsigned long long size, int type); 30 unsigned long long size, int type);
diff --git a/include/asm-x86/genapic_32.h b/include/asm-x86/genapic_32.h
index f1b96932746b..b02ea6e17de8 100644
--- a/include/asm-x86/genapic_32.h
+++ b/include/asm-x86/genapic_32.h
@@ -117,6 +117,7 @@ extern struct genapic *genapic;
117enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC}; 117enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC};
118#define get_uv_system_type() UV_NONE 118#define get_uv_system_type() UV_NONE
119#define is_uv_system() 0 119#define is_uv_system() 0
120#define uv_wakeup_secondary(a, b) 1
120 121
121 122
122#endif 123#endif
diff --git a/include/asm-x86/i387.h b/include/asm-x86/i387.h
index 54522b814f1c..da2adb45f6e3 100644
--- a/include/asm-x86/i387.h
+++ b/include/asm-x86/i387.h
@@ -21,8 +21,9 @@
21 21
22extern void fpu_init(void); 22extern void fpu_init(void);
23extern void mxcsr_feature_mask_init(void); 23extern void mxcsr_feature_mask_init(void);
24extern void init_fpu(struct task_struct *child); 24extern int init_fpu(struct task_struct *child);
25extern asmlinkage void math_state_restore(void); 25extern asmlinkage void math_state_restore(void);
26extern void init_thread_xstate(void);
26 27
27extern user_regset_active_fn fpregs_active, xfpregs_active; 28extern user_regset_active_fn fpregs_active, xfpregs_active;
28extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get; 29extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get;
@@ -117,24 +118,22 @@ static inline void __save_init_fpu(struct task_struct *tsk)
117 /* Using "fxsaveq %0" would be the ideal choice, but is only supported 118 /* Using "fxsaveq %0" would be the ideal choice, but is only supported
118 starting with gas 2.16. */ 119 starting with gas 2.16. */
119 __asm__ __volatile__("fxsaveq %0" 120 __asm__ __volatile__("fxsaveq %0"
120 : "=m" (tsk->thread.i387.fxsave)); 121 : "=m" (tsk->thread.xstate->fxsave));
121#elif 0 122#elif 0
122 /* Using, as a workaround, the properly prefixed form below isn't 123 /* Using, as a workaround, the properly prefixed form below isn't
123 accepted by any binutils version so far released, complaining that 124 accepted by any binutils version so far released, complaining that
124 the same type of prefix is used twice if an extended register is 125 the same type of prefix is used twice if an extended register is
125 needed for addressing (fix submitted to mainline 2005-11-21). */ 126 needed for addressing (fix submitted to mainline 2005-11-21). */
126 __asm__ __volatile__("rex64/fxsave %0" 127 __asm__ __volatile__("rex64/fxsave %0"
127 : "=m" (tsk->thread.i387.fxsave)); 128 : "=m" (tsk->thread.xstate->fxsave));
128#else 129#else
129 /* This, however, we can work around by forcing the compiler to select 130 /* This, however, we can work around by forcing the compiler to select
130 an addressing mode that doesn't require extended registers. */ 131 an addressing mode that doesn't require extended registers. */
131 __asm__ __volatile__("rex64/fxsave %P2(%1)" 132 __asm__ __volatile__("rex64/fxsave (%1)"
132 : "=m" (tsk->thread.i387.fxsave) 133 : "=m" (tsk->thread.xstate->fxsave)
133 : "cdaSDb" (tsk), 134 : "cdaSDb" (&tsk->thread.xstate->fxsave));
134 "i" (offsetof(__typeof__(*tsk),
135 thread.i387.fxsave)));
136#endif 135#endif
137 clear_fpu_state(&tsk->thread.i387.fxsave); 136 clear_fpu_state(&tsk->thread.xstate->fxsave);
138 task_thread_info(tsk)->status &= ~TS_USEDFPU; 137 task_thread_info(tsk)->status &= ~TS_USEDFPU;
139} 138}
140 139
@@ -148,7 +147,7 @@ static inline int save_i387(struct _fpstate __user *buf)
148 int err = 0; 147 int err = 0;
149 148
150 BUILD_BUG_ON(sizeof(struct user_i387_struct) != 149 BUILD_BUG_ON(sizeof(struct user_i387_struct) !=
151 sizeof(tsk->thread.i387.fxsave)); 150 sizeof(tsk->thread.xstate->fxsave));
152 151
153 if ((unsigned long)buf % 16) 152 if ((unsigned long)buf % 16)
154 printk("save_i387: bad fpstate %p\n", buf); 153 printk("save_i387: bad fpstate %p\n", buf);
@@ -164,7 +163,7 @@ static inline int save_i387(struct _fpstate __user *buf)
164 task_thread_info(tsk)->status &= ~TS_USEDFPU; 163 task_thread_info(tsk)->status &= ~TS_USEDFPU;
165 stts(); 164 stts();
166 } else { 165 } else {
167 if (__copy_to_user(buf, &tsk->thread.i387.fxsave, 166 if (__copy_to_user(buf, &tsk->thread.xstate->fxsave,
168 sizeof(struct i387_fxsave_struct))) 167 sizeof(struct i387_fxsave_struct)))
169 return -1; 168 return -1;
170 } 169 }
@@ -201,7 +200,7 @@ static inline void restore_fpu(struct task_struct *tsk)
201 "nop ; frstor %1", 200 "nop ; frstor %1",
202 "fxrstor %1", 201 "fxrstor %1",
203 X86_FEATURE_FXSR, 202 X86_FEATURE_FXSR,
204 "m" ((tsk)->thread.i387.fxsave)); 203 "m" (tsk->thread.xstate->fxsave));
205} 204}
206 205
207/* We need a safe address that is cheap to find and that is already 206/* We need a safe address that is cheap to find and that is already
@@ -225,8 +224,8 @@ static inline void __save_init_fpu(struct task_struct *tsk)
225 "fxsave %[fx]\n" 224 "fxsave %[fx]\n"
226 "bt $7,%[fsw] ; jnc 1f ; fnclex\n1:", 225 "bt $7,%[fsw] ; jnc 1f ; fnclex\n1:",
227 X86_FEATURE_FXSR, 226 X86_FEATURE_FXSR,
228 [fx] "m" (tsk->thread.i387.fxsave), 227 [fx] "m" (tsk->thread.xstate->fxsave),
229 [fsw] "m" (tsk->thread.i387.fxsave.swd) : "memory"); 228 [fsw] "m" (tsk->thread.xstate->fxsave.swd) : "memory");
230 /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception 229 /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
231 is pending. Clear the x87 state here by setting it to fixed 230 is pending. Clear the x87 state here by setting it to fixed
232 values. safe_address is a random variable that should be in L1 */ 231 values. safe_address is a random variable that should be in L1 */
@@ -327,25 +326,25 @@ static inline void clear_fpu(struct task_struct *tsk)
327static inline unsigned short get_fpu_cwd(struct task_struct *tsk) 326static inline unsigned short get_fpu_cwd(struct task_struct *tsk)
328{ 327{
329 if (cpu_has_fxsr) { 328 if (cpu_has_fxsr) {
330 return tsk->thread.i387.fxsave.cwd; 329 return tsk->thread.xstate->fxsave.cwd;
331 } else { 330 } else {
332 return (unsigned short)tsk->thread.i387.fsave.cwd; 331 return (unsigned short)tsk->thread.xstate->fsave.cwd;
333 } 332 }
334} 333}
335 334
336static inline unsigned short get_fpu_swd(struct task_struct *tsk) 335static inline unsigned short get_fpu_swd(struct task_struct *tsk)
337{ 336{
338 if (cpu_has_fxsr) { 337 if (cpu_has_fxsr) {
339 return tsk->thread.i387.fxsave.swd; 338 return tsk->thread.xstate->fxsave.swd;
340 } else { 339 } else {
341 return (unsigned short)tsk->thread.i387.fsave.swd; 340 return (unsigned short)tsk->thread.xstate->fsave.swd;
342 } 341 }
343} 342}
344 343
345static inline unsigned short get_fpu_mxcsr(struct task_struct *tsk) 344static inline unsigned short get_fpu_mxcsr(struct task_struct *tsk)
346{ 345{
347 if (cpu_has_xmm) { 346 if (cpu_has_xmm) {
348 return tsk->thread.i387.fxsave.mxcsr; 347 return tsk->thread.xstate->fxsave.mxcsr;
349 } else { 348 } else {
350 return MXCSR_DEFAULT; 349 return MXCSR_DEFAULT;
351 } 350 }
diff --git a/include/asm-x86/numa_64.h b/include/asm-x86/numa_64.h
index 32c22ae0709f..22e87c9f6a80 100644
--- a/include/asm-x86/numa_64.h
+++ b/include/asm-x86/numa_64.h
@@ -9,7 +9,8 @@ struct bootnode {
9 u64 end; 9 u64 end;
10}; 10};
11 11
12extern int compute_hash_shift(struct bootnode *nodes, int numnodes); 12extern int compute_hash_shift(struct bootnode *nodes, int numblks,
13 int *nodeids);
13 14
14#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) 15#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
15 16
diff --git a/include/asm-x86/pci_64.h b/include/asm-x86/pci_64.h
index df867e5d80b1..f330234ffa5c 100644
--- a/include/asm-x86/pci_64.h
+++ b/include/asm-x86/pci_64.h
@@ -22,6 +22,7 @@ extern int (*pci_config_read)(int seg, int bus, int dev, int fn,
22extern int (*pci_config_write)(int seg, int bus, int dev, int fn, 22extern int (*pci_config_write)(int seg, int bus, int dev, int fn,
23 int reg, int len, u32 value); 23 int reg, int len, u32 value);
24 24
25extern void dma32_reserve_bootmem(void);
25extern void pci_iommu_alloc(void); 26extern void pci_iommu_alloc(void);
26 27
27/* The PCI address space does equal the physical memory 28/* The PCI address space does equal the physical memory
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
index 6e26c7c717a2..e6bf92ddeb21 100644
--- a/include/asm-x86/processor.h
+++ b/include/asm-x86/processor.h
@@ -354,7 +354,7 @@ struct i387_soft_struct {
354 u32 entry_eip; 354 u32 entry_eip;
355}; 355};
356 356
357union i387_union { 357union thread_xstate {
358 struct i387_fsave_struct fsave; 358 struct i387_fsave_struct fsave;
359 struct i387_fxsave_struct fxsave; 359 struct i387_fxsave_struct fxsave;
360 struct i387_soft_struct soft; 360 struct i387_soft_struct soft;
@@ -365,6 +365,9 @@ DECLARE_PER_CPU(struct orig_ist, orig_ist);
365#endif 365#endif
366 366
367extern void print_cpu_info(struct cpuinfo_x86 *); 367extern void print_cpu_info(struct cpuinfo_x86 *);
368extern unsigned int xstate_size;
369extern void free_thread_xstate(struct task_struct *);
370extern struct kmem_cache *task_xstate_cachep;
368extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); 371extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c);
369extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); 372extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
370extern unsigned short num_cache_leaves; 373extern unsigned short num_cache_leaves;
@@ -397,8 +400,8 @@ struct thread_struct {
397 unsigned long cr2; 400 unsigned long cr2;
398 unsigned long trap_no; 401 unsigned long trap_no;
399 unsigned long error_code; 402 unsigned long error_code;
400 /* Floating point info: */ 403 /* floating point and extended processor state */
401 union i387_union i387 __attribute__((aligned(16)));; 404 union thread_xstate *xstate;
402#ifdef CONFIG_X86_32 405#ifdef CONFIG_X86_32
403 /* Virtual 86 mode info */ 406 /* Virtual 86 mode info */
404 struct vm86_struct __user *vm86_info; 407 struct vm86_struct __user *vm86_info;
@@ -918,4 +921,11 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
918 921
919#define KSTK_EIP(task) (task_pt_regs(task)->ip) 922#define KSTK_EIP(task) (task_pt_regs(task)->ip)
920 923
924/* Get/set a process' ability to use the timestamp counter instruction */
925#define GET_TSC_CTL(adr) get_tsc_mode((adr))
926#define SET_TSC_CTL(val) set_tsc_mode((val))
927
928extern int get_tsc_mode(unsigned long adr);
929extern int set_tsc_mode(unsigned int val);
930
921#endif 931#endif
diff --git a/include/asm-x86/scatterlist.h b/include/asm-x86/scatterlist.h
index d13c197866d6..c0432061f81a 100644
--- a/include/asm-x86/scatterlist.h
+++ b/include/asm-x86/scatterlist.h
@@ -11,9 +11,7 @@ struct scatterlist {
11 unsigned int offset; 11 unsigned int offset;
12 unsigned int length; 12 unsigned int length;
13 dma_addr_t dma_address; 13 dma_addr_t dma_address;
14#ifdef CONFIG_X86_64
15 unsigned int dma_length; 14 unsigned int dma_length;
16#endif
17}; 15};
18 16
19#define ARCH_HAS_SG_CHAIN 17#define ARCH_HAS_SG_CHAIN
diff --git a/include/asm-x86/thread_info.h b/include/asm-x86/thread_info.h
index d5fd12f2abdb..77244f17993f 100644
--- a/include/asm-x86/thread_info.h
+++ b/include/asm-x86/thread_info.h
@@ -1,5 +1,14 @@
1#ifndef _ASM_X86_THREAD_INFO_H
1#ifdef CONFIG_X86_32 2#ifdef CONFIG_X86_32
2# include "thread_info_32.h" 3# include "thread_info_32.h"
3#else 4#else
4# include "thread_info_64.h" 5# include "thread_info_64.h"
5#endif 6#endif
7
8#ifndef __ASSEMBLY__
9extern void arch_task_cache_init(void);
10extern void free_thread_info(struct thread_info *ti);
11extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
12#define arch_task_cache_init arch_task_cache_init
13#endif
14#endif /* _ASM_X86_THREAD_INFO_H */
diff --git a/include/asm-x86/thread_info_32.h b/include/asm-x86/thread_info_32.h
index 4e053fa561a9..531859962096 100644
--- a/include/asm-x86/thread_info_32.h
+++ b/include/asm-x86/thread_info_32.h
@@ -102,8 +102,6 @@ static inline struct thread_info *current_thread_info(void)
102 __get_free_pages(GFP_KERNEL, get_order(THREAD_SIZE))) 102 __get_free_pages(GFP_KERNEL, get_order(THREAD_SIZE)))
103#endif 103#endif
104 104
105#define free_thread_info(info) free_pages((unsigned long)(info), get_order(THREAD_SIZE))
106
107#else /* !__ASSEMBLY__ */ 105#else /* !__ASSEMBLY__ */
108 106
109/* how to get the thread information struct from ASM */ 107/* how to get the thread information struct from ASM */
diff --git a/include/asm-x86/thread_info_64.h b/include/asm-x86/thread_info_64.h
index 1e5c6f6152cd..ed664e874dec 100644
--- a/include/asm-x86/thread_info_64.h
+++ b/include/asm-x86/thread_info_64.h
@@ -85,8 +85,6 @@ static inline struct thread_info *stack_thread_info(void)
85#define alloc_thread_info(tsk) \ 85#define alloc_thread_info(tsk) \
86 ((struct thread_info *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER)) 86 ((struct thread_info *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER))
87 87
88#define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER)
89
90#else /* !__ASSEMBLY__ */ 88#else /* !__ASSEMBLY__ */
91 89
92/* how to get the thread information struct from ASM */ 90/* how to get the thread information struct from ASM */
@@ -126,6 +124,7 @@ static inline struct thread_info *stack_thread_info(void)
126#define TIF_DEBUGCTLMSR 25 /* uses thread_struct.debugctlmsr */ 124#define TIF_DEBUGCTLMSR 25 /* uses thread_struct.debugctlmsr */
127#define TIF_DS_AREA_MSR 26 /* uses thread_struct.ds_area_msr */ 125#define TIF_DS_AREA_MSR 26 /* uses thread_struct.ds_area_msr */
128#define TIF_BTS_TRACE_TS 27 /* record scheduling event timestamps */ 126#define TIF_BTS_TRACE_TS 27 /* record scheduling event timestamps */
127#define TIF_NOTSC 28 /* TSC is not accessible in userland */
129 128
130#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 129#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
131#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 130#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
@@ -147,6 +146,7 @@ static inline struct thread_info *stack_thread_info(void)
147#define _TIF_DEBUGCTLMSR (1 << TIF_DEBUGCTLMSR) 146#define _TIF_DEBUGCTLMSR (1 << TIF_DEBUGCTLMSR)
148#define _TIF_DS_AREA_MSR (1 << TIF_DS_AREA_MSR) 147#define _TIF_DS_AREA_MSR (1 << TIF_DS_AREA_MSR)
149#define _TIF_BTS_TRACE_TS (1 << TIF_BTS_TRACE_TS) 148#define _TIF_BTS_TRACE_TS (1 << TIF_BTS_TRACE_TS)
149#define _TIF_NOTSC (1 << TIF_NOTSC)
150 150
151/* work to do on interrupt/exception return */ 151/* work to do on interrupt/exception return */
152#define _TIF_WORK_MASK \ 152#define _TIF_WORK_MASK \
@@ -160,7 +160,7 @@ static inline struct thread_info *stack_thread_info(void)
160 160
161/* flags to check in __switch_to() */ 161/* flags to check in __switch_to() */
162#define _TIF_WORK_CTXSW \ 162#define _TIF_WORK_CTXSW \
163 (_TIF_IO_BITMAP|_TIF_DEBUGCTLMSR|_TIF_DS_AREA_MSR|_TIF_BTS_TRACE_TS) 163 (_TIF_IO_BITMAP|_TIF_DEBUGCTLMSR|_TIF_DS_AREA_MSR|_TIF_BTS_TRACE_TS|_TIF_NOTSC)
164#define _TIF_WORK_CTXSW_PREV _TIF_WORK_CTXSW 164#define _TIF_WORK_CTXSW_PREV _TIF_WORK_CTXSW
165#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW|_TIF_DEBUG) 165#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW|_TIF_DEBUG)
166 166
diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h
index 81a29eb08ac4..22073268b481 100644
--- a/include/asm-x86/topology.h
+++ b/include/asm-x86/topology.h
@@ -88,6 +88,17 @@ static inline int cpu_to_node(int cpu)
88#endif 88#endif
89 return per_cpu(x86_cpu_to_node_map, cpu); 89 return per_cpu(x86_cpu_to_node_map, cpu);
90} 90}
91
92#ifdef CONFIG_NUMA
93
94/* Returns a pointer to the cpumask of CPUs on Node 'node'. */
95#define node_to_cpumask_ptr(v, node) \
96 cpumask_t *v = &(node_to_cpumask_map[node])
97
98#define node_to_cpumask_ptr_next(v, node) \
99 v = &(node_to_cpumask_map[node])
100#endif
101
91#endif /* CONFIG_X86_64 */ 102#endif /* CONFIG_X86_64 */
92 103
93/* 104/*
@@ -136,17 +147,13 @@ extern unsigned long node_remap_size[];
136 147
137# define SD_CACHE_NICE_TRIES 2 148# define SD_CACHE_NICE_TRIES 2
138# define SD_IDLE_IDX 2 149# define SD_IDLE_IDX 2
139# define SD_NEWIDLE_IDX 0 150# define SD_NEWIDLE_IDX 2
140# define SD_FORKEXEC_IDX 1 151# define SD_FORKEXEC_IDX 1
141 152
142#endif 153#endif
143 154
144/* sched_domains SD_NODE_INIT for NUMAQ machines */ 155/* sched_domains SD_NODE_INIT for NUMAQ machines */
145#define SD_NODE_INIT (struct sched_domain) { \ 156#define SD_NODE_INIT (struct sched_domain) { \
146 .span = CPU_MASK_NONE, \
147 .parent = NULL, \
148 .child = NULL, \
149 .groups = NULL, \
150 .min_interval = 8, \ 157 .min_interval = 8, \
151 .max_interval = 32, \ 158 .max_interval = 32, \
152 .busy_factor = 32, \ 159 .busy_factor = 32, \
@@ -164,7 +171,6 @@ extern unsigned long node_remap_size[];
164 | SD_WAKE_BALANCE, \ 171 | SD_WAKE_BALANCE, \
165 .last_balance = jiffies, \ 172 .last_balance = jiffies, \
166 .balance_interval = 1, \ 173 .balance_interval = 1, \
167 .nr_balance_failed = 0, \
168} 174}
169 175
170#ifdef CONFIG_X86_64_ACPI_NUMA 176#ifdef CONFIG_X86_64_ACPI_NUMA
@@ -174,10 +180,10 @@ extern int __node_distance(int, int);
174 180
175#else /* CONFIG_NUMA */ 181#else /* CONFIG_NUMA */
176 182
177#include <asm-generic/topology.h>
178
179#endif 183#endif
180 184
185#include <asm-generic/topology.h>
186
181extern cpumask_t cpu_coregroup_map(int cpu); 187extern cpumask_t cpu_coregroup_map(int cpu);
182 188
183#ifdef ENABLE_TOPO_DEFINES 189#ifdef ENABLE_TOPO_DEFINES
diff --git a/include/asm-x86/tsc.h b/include/asm-x86/tsc.h
index d2d8eb5b55f5..0434bd8349a7 100644
--- a/include/asm-x86/tsc.h
+++ b/include/asm-x86/tsc.h
@@ -18,6 +18,7 @@ extern unsigned int cpu_khz;
18extern unsigned int tsc_khz; 18extern unsigned int tsc_khz;
19 19
20extern void disable_TSC(void); 20extern void disable_TSC(void);
21extern void enable_TSC(void);
21 22
22static inline cycles_t get_cycles(void) 23static inline cycles_t get_cycles(void)
23{ 24{
diff --git a/include/crypto/aes.h b/include/crypto/aes.h
index d480b76715a8..40008d67ee3d 100644
--- a/include/crypto/aes.h
+++ b/include/crypto/aes.h
@@ -14,11 +14,13 @@
14#define AES_KEYSIZE_192 24 14#define AES_KEYSIZE_192 24
15#define AES_KEYSIZE_256 32 15#define AES_KEYSIZE_256 32
16#define AES_BLOCK_SIZE 16 16#define AES_BLOCK_SIZE 16
17#define AES_MAX_KEYLENGTH (15 * 16)
18#define AES_MAX_KEYLENGTH_U32 (AES_MAX_KEYLENGTH / sizeof(u32))
17 19
18struct crypto_aes_ctx { 20struct crypto_aes_ctx {
19 u32 key_length; 21 u32 key_length;
20 u32 key_enc[60]; 22 u32 key_enc[AES_MAX_KEYLENGTH_U32];
21 u32 key_dec[60]; 23 u32 key_dec[AES_MAX_KEYLENGTH_U32];
22}; 24};
23 25
24extern u32 crypto_ft_tab[4][256]; 26extern u32 crypto_ft_tab[4][256];
@@ -28,4 +30,6 @@ extern u32 crypto_il_tab[4][256];
28 30
29int crypto_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, 31int crypto_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
30 unsigned int key_len); 32 unsigned int key_len);
33int crypto_aes_expand_key(struct crypto_aes_ctx *ctx, const u8 *in_key,
34 unsigned int key_len);
31#endif 35#endif
diff --git a/include/keys/rxrpc-type.h b/include/keys/rxrpc-type.h
index 4ea429b18750..7609365577f1 100644
--- a/include/keys/rxrpc-type.h
+++ b/include/keys/rxrpc-type.h
@@ -21,4 +21,4 @@ extern struct key_type key_type_rxrpc;
21 21
22extern struct key *rxrpc_get_null_key(const char *); 22extern struct key *rxrpc_get_null_key(const char *);
23 23
24#endif /* _KEYS_USER_TYPE_H */ 24#endif /* _KEYS_RXRPC_TYPE_H */
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 376fc972efed..cbb5ccb27de3 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -150,6 +150,7 @@ header-y += tiocl.h
150header-y += tipc.h 150header-y += tipc.h
151header-y += tipc_config.h 151header-y += tipc_config.h
152header-y += toshiba.h 152header-y += toshiba.h
153header-y += udf_fs_i.h
153header-y += ultrasound.h 154header-y += ultrasound.h
154header-y += un.h 155header-y += un.h
155header-y += utime.h 156header-y += utime.h
@@ -210,7 +211,9 @@ unifdef-y += hdlcdrv.h
210unifdef-y += hdlc.h 211unifdef-y += hdlc.h
211unifdef-y += hdreg.h 212unifdef-y += hdreg.h
212unifdef-y += hdsmart.h 213unifdef-y += hdsmart.h
214unifdef-y += hid.h
213unifdef-y += hiddev.h 215unifdef-y += hiddev.h
216unifdef-y += hidraw.h
214unifdef-y += hpet.h 217unifdef-y += hpet.h
215unifdef-y += i2c.h 218unifdef-y += i2c.h
216unifdef-y += i2c-dev.h 219unifdef-y += i2c-dev.h
@@ -334,7 +337,6 @@ unifdef-y += time.h
334unifdef-y += timex.h 337unifdef-y += timex.h
335unifdef-y += tty.h 338unifdef-y += tty.h
336unifdef-y += types.h 339unifdef-y += types.h
337unifdef-y += udf_fs_i.h
338unifdef-y += udp.h 340unifdef-y += udp.h
339unifdef-y += uinput.h 341unifdef-y += uinput.h
340unifdef-y += uio.h 342unifdef-y += uio.h
diff --git a/include/linux/aer.h b/include/linux/aer.h
index bcf236d825e8..f2518141de88 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -13,7 +13,6 @@ extern int pci_enable_pcie_error_reporting(struct pci_dev *dev);
13extern int pci_find_aer_capability(struct pci_dev *dev); 13extern int pci_find_aer_capability(struct pci_dev *dev);
14extern int pci_disable_pcie_error_reporting(struct pci_dev *dev); 14extern int pci_disable_pcie_error_reporting(struct pci_dev *dev);
15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); 15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
16extern int pci_cleanup_aer_correct_error_status(struct pci_dev *dev);
17#else 16#else
18static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev) 17static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
19{ 18{
@@ -31,10 +30,6 @@ static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
31{ 30{
32 return -EINVAL; 31 return -EINVAL;
33} 32}
34static inline int pci_cleanup_aer_correct_error_status(struct pci_dev *dev)
35{
36 return -EINVAL;
37}
38#endif 33#endif
39 34
40#endif //_AER_H_ 35#endif //_AER_H_
diff --git a/include/linux/ata_platform.h b/include/linux/ata_platform.h
index b856a2a590d9..9a26c83a2c9e 100644
--- a/include/linux/ata_platform.h
+++ b/include/linux/ata_platform.h
@@ -27,7 +27,10 @@ extern int __devexit __pata_platform_remove(struct device *dev);
27/* 27/*
28 * Marvell SATA private data 28 * Marvell SATA private data
29 */ 29 */
30struct mbus_dram_target_info;
31
30struct mv_sata_platform_data { 32struct mv_sata_platform_data {
33 struct mbus_dram_target_info *dram;
31 int n_ports; /* number of sata ports */ 34 int n_ports; /* number of sata ports */
32}; 35};
33 36
diff --git a/include/linux/atmel_tc.h b/include/linux/atmel_tc.h
new file mode 100644
index 000000000000..53ba65e30caa
--- /dev/null
+++ b/include/linux/atmel_tc.h
@@ -0,0 +1,252 @@
1/*
2 * Timer/Counter Unit (TC) registers.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9
10#ifndef ATMEL_TC_H
11#define ATMEL_TC_H
12
13#include <linux/compiler.h>
14#include <linux/list.h>
15
16/*
17 * Many 32-bit Atmel SOCs include one or more TC blocks, each of which holds
18 * three general-purpose 16-bit timers. These timers share one register bank.
19 * Depending on the SOC, each timer may have its own clock and IRQ, or those
20 * may be shared by the whole TC block.
21 *
22 * These TC blocks may have up to nine external pins: TCLK0..2 signals for
23 * clocks or clock gates, and per-timer TIOA and TIOB signals used for PWM
24 * or triggering. Those pins need to be set up for use with the TC block,
25 * else they will be used as GPIOs or for a different controller.
26 *
27 * Although we expect each TC block to have a platform_device node, those
28 * nodes are not what drivers bind to. Instead, they ask for a specific
29 * TC block, by number ... which is a common approach on systems with many
30 * timers. Then they use clk_get() and platform_get_irq() to get clock and
31 * IRQ resources.
32 */
33
34struct clk;
35
36/**
37 * struct atmel_tc - information about a Timer/Counter Block
38 * @pdev: physical device
39 * @iomem: resource associated with the I/O register
40 * @regs: mapping through which the I/O registers can be accessed
41 * @irq: irq for each of the three channels
42 * @clk: internal clock source for each of the three channels
43 * @node: list node, for tclib internal use
44 *
45 * On some platforms, each TC channel has its own clocks and IRQs,
46 * while on others, all TC channels share the same clock and IRQ.
47 * Drivers should clk_enable() all the clocks they need even though
48 * all the entries in @clk may point to the same physical clock.
49 * Likewise, drivers should request irqs independently for each
50 * channel, but they must use IRQF_SHARED in case some of the entries
51 * in @irq are actually the same IRQ.
52 */
53struct atmel_tc {
54 struct platform_device *pdev;
55 struct resource *iomem;
56 void __iomem *regs;
57 int irq[3];
58 struct clk *clk[3];
59 struct list_head node;
60};
61
62extern struct atmel_tc *atmel_tc_alloc(unsigned block, const char *name);
63extern void atmel_tc_free(struct atmel_tc *tc);
64
65/* platform-specific ATMEL_TC_TIMER_CLOCKx divisors (0 means 32KiHz) */
66extern const u8 atmel_tc_divisors[5];
67
68
69/*
70 * Two registers have block-wide controls. These are: configuring the three
71 * "external" clocks (or event sources) used by the timer channels; and
72 * synchronizing the timers by resetting them all at once.
73 *
74 * "External" can mean "external to chip" using the TCLK0, TCLK1, or TCLK2
75 * signals. Or, it can mean "external to timer", using the TIOA output from
76 * one of the other two timers that's being run in waveform mode.
77 */
78
79#define ATMEL_TC_BCR 0xc0 /* TC Block Control Register */
80#define ATMEL_TC_SYNC (1 << 0) /* synchronize timers */
81
82#define ATMEL_TC_BMR 0xc4 /* TC Block Mode Register */
83#define ATMEL_TC_TC0XC0S (3 << 0) /* external clock 0 source */
84#define ATMEL_TC_TC0XC0S_TCLK0 (0 << 0)
85#define ATMEL_TC_TC0XC0S_NONE (1 << 0)
86#define ATMEL_TC_TC0XC0S_TIOA1 (2 << 0)
87#define ATMEL_TC_TC0XC0S_TIOA2 (3 << 0)
88#define ATMEL_TC_TC1XC1S (3 << 2) /* external clock 1 source */
89#define ATMEL_TC_TC1XC1S_TCLK1 (0 << 2)
90#define ATMEL_TC_TC1XC1S_NONE (1 << 2)
91#define ATMEL_TC_TC1XC1S_TIOA0 (2 << 2)
92#define ATMEL_TC_TC1XC1S_TIOA2 (3 << 2)
93#define ATMEL_TC_TC2XC2S (3 << 4) /* external clock 2 source */
94#define ATMEL_TC_TC2XC2S_TCLK2 (0 << 4)
95#define ATMEL_TC_TC2XC2S_NONE (1 << 4)
96#define ATMEL_TC_TC2XC2S_TIOA0 (2 << 4)
97#define ATMEL_TC_TC2XC2S_TIOA1 (3 << 4)
98
99
100/*
101 * Each TC block has three "channels", each with one counter and controls.
102 *
103 * Note that the semantics of ATMEL_TC_TIMER_CLOCKx (input clock selection
104 * when it's not "external") is silicon-specific. AT91 platforms use one
105 * set of definitions; AVR32 platforms use a different set. Don't hard-wire
106 * such knowledge into your code, use the global "atmel_tc_divisors" ...
107 * where index N is the divisor for clock N+1, else zero to indicate it uses
108 * the 32 KiHz clock.
109 *
110 * The timers can be chained in various ways, and operated in "waveform"
111 * generation mode (including PWM) or "capture" mode (to time events). In
112 * both modes, behavior can be configured in many ways.
113 *
114 * Each timer has two I/O pins, TIOA and TIOB. Waveform mode uses TIOA as a
115 * PWM output, and TIOB as either another PWM or as a trigger. Capture mode
116 * uses them only as inputs.
117 */
118#define ATMEL_TC_CHAN(idx) ((idx)*0x40)
119#define ATMEL_TC_REG(idx, reg) (ATMEL_TC_CHAN(idx) + ATMEL_TC_ ## reg)
120
121#define ATMEL_TC_CCR 0x00 /* Channel Control Register */
122#define ATMEL_TC_CLKEN (1 << 0) /* clock enable */
123#define ATMEL_TC_CLKDIS (1 << 1) /* clock disable */
124#define ATMEL_TC_SWTRG (1 << 2) /* software trigger */
125
126#define ATMEL_TC_CMR 0x04 /* Channel Mode Register */
127
128/* Both modes share some CMR bits */
129#define ATMEL_TC_TCCLKS (7 << 0) /* clock source */
130#define ATMEL_TC_TIMER_CLOCK1 (0 << 0)
131#define ATMEL_TC_TIMER_CLOCK2 (1 << 0)
132#define ATMEL_TC_TIMER_CLOCK3 (2 << 0)
133#define ATMEL_TC_TIMER_CLOCK4 (3 << 0)
134#define ATMEL_TC_TIMER_CLOCK5 (4 << 0)
135#define ATMEL_TC_XC0 (5 << 0)
136#define ATMEL_TC_XC1 (6 << 0)
137#define ATMEL_TC_XC2 (7 << 0)
138#define ATMEL_TC_CLKI (1 << 3) /* clock invert */
139#define ATMEL_TC_BURST (3 << 4) /* clock gating */
140#define ATMEL_TC_GATE_NONE (0 << 4)
141#define ATMEL_TC_GATE_XC0 (1 << 4)
142#define ATMEL_TC_GATE_XC1 (2 << 4)
143#define ATMEL_TC_GATE_XC2 (3 << 4)
144#define ATMEL_TC_WAVE (1 << 15) /* true = Waveform mode */
145
146/* CAPTURE mode CMR bits */
147#define ATMEL_TC_LDBSTOP (1 << 6) /* counter stops on RB load */
148#define ATMEL_TC_LDBDIS (1 << 7) /* counter disable on RB load */
149#define ATMEL_TC_ETRGEDG (3 << 8) /* external trigger edge */
150#define ATMEL_TC_ETRGEDG_NONE (0 << 8)
151#define ATMEL_TC_ETRGEDG_RISING (1 << 8)
152#define ATMEL_TC_ETRGEDG_FALLING (2 << 8)
153#define ATMEL_TC_ETRGEDG_BOTH (3 << 8)
154#define ATMEL_TC_ABETRG (1 << 10) /* external trigger is TIOA? */
155#define ATMEL_TC_CPCTRG (1 << 14) /* RC compare trigger enable */
156#define ATMEL_TC_LDRA (3 << 16) /* RA loading edge (of TIOA) */
157#define ATMEL_TC_LDRA_NONE (0 << 16)
158#define ATMEL_TC_LDRA_RISING (1 << 16)
159#define ATMEL_TC_LDRA_FALLING (2 << 16)
160#define ATMEL_TC_LDRA_BOTH (3 << 16)
161#define ATMEL_TC_LDRB (3 << 18) /* RB loading edge (of TIOA) */
162#define ATMEL_TC_LDRB_NONE (0 << 18)
163#define ATMEL_TC_LDRB_RISING (1 << 18)
164#define ATMEL_TC_LDRB_FALLING (2 << 18)
165#define ATMEL_TC_LDRB_BOTH (3 << 18)
166
167/* WAVEFORM mode CMR bits */
168#define ATMEL_TC_CPCSTOP (1 << 6) /* RC compare stops counter */
169#define ATMEL_TC_CPCDIS (1 << 7) /* RC compare disables counter */
170#define ATMEL_TC_EEVTEDG (3 << 8) /* external event edge */
171#define ATMEL_TC_EEVTEDG_NONE (0 << 8)
172#define ATMEL_TC_EEVTEDG_RISING (1 << 8)
173#define ATMEL_TC_EEVTEDG_FALLING (2 << 8)
174#define ATMEL_TC_EEVTEDG_BOTH (3 << 8)
175#define ATMEL_TC_EEVT (3 << 10) /* external event source */
176#define ATMEL_TC_EEVT_TIOB (0 << 10)
177#define ATMEL_TC_EEVT_XC0 (1 << 10)
178#define ATMEL_TC_EEVT_XC1 (2 << 10)
179#define ATMEL_TC_EEVT_XC2 (3 << 10)
180#define ATMEL_TC_ENETRG (1 << 12) /* external event is trigger */
181#define ATMEL_TC_WAVESEL (3 << 13) /* waveform type */
182#define ATMEL_TC_WAVESEL_UP (0 << 13)
183#define ATMEL_TC_WAVESEL_UPDOWN (1 << 13)
184#define ATMEL_TC_WAVESEL_UP_AUTO (2 << 13)
185#define ATMEL_TC_WAVESEL_UPDOWN_AUTO (3 << 13)
186#define ATMEL_TC_ACPA (3 << 16) /* RA compare changes TIOA */
187#define ATMEL_TC_ACPA_NONE (0 << 16)
188#define ATMEL_TC_ACPA_SET (1 << 16)
189#define ATMEL_TC_ACPA_CLEAR (2 << 16)
190#define ATMEL_TC_ACPA_TOGGLE (3 << 16)
191#define ATMEL_TC_ACPC (3 << 18) /* RC compare changes TIOA */
192#define ATMEL_TC_ACPC_NONE (0 << 18)
193#define ATMEL_TC_ACPC_SET (1 << 18)
194#define ATMEL_TC_ACPC_CLEAR (2 << 18)
195#define ATMEL_TC_ACPC_TOGGLE (3 << 18)
196#define ATMEL_TC_AEEVT (3 << 20) /* external event changes TIOA */
197#define ATMEL_TC_AEEVT_NONE (0 << 20)
198#define ATMEL_TC_AEEVT_SET (1 << 20)
199#define ATMEL_TC_AEEVT_CLEAR (2 << 20)
200#define ATMEL_TC_AEEVT_TOGGLE (3 << 20)
201#define ATMEL_TC_ASWTRG (3 << 22) /* software trigger changes TIOA */
202#define ATMEL_TC_ASWTRG_NONE (0 << 22)
203#define ATMEL_TC_ASWTRG_SET (1 << 22)
204#define ATMEL_TC_ASWTRG_CLEAR (2 << 22)
205#define ATMEL_TC_ASWTRG_TOGGLE (3 << 22)
206#define ATMEL_TC_BCPB (3 << 24) /* RB compare changes TIOB */
207#define ATMEL_TC_BCPB_NONE (0 << 24)
208#define ATMEL_TC_BCPB_SET (1 << 24)
209#define ATMEL_TC_BCPB_CLEAR (2 << 24)
210#define ATMEL_TC_BCPB_TOGGLE (3 << 24)
211#define ATMEL_TC_BCPC (3 << 26) /* RC compare changes TIOB */
212#define ATMEL_TC_BCPC_NONE (0 << 26)
213#define ATMEL_TC_BCPC_SET (1 << 26)
214#define ATMEL_TC_BCPC_CLEAR (2 << 26)
215#define ATMEL_TC_BCPC_TOGGLE (3 << 26)
216#define ATMEL_TC_BEEVT (3 << 28) /* external event changes TIOB */
217#define ATMEL_TC_BEEVT_NONE (0 << 28)
218#define ATMEL_TC_BEEVT_SET (1 << 28)
219#define ATMEL_TC_BEEVT_CLEAR (2 << 28)
220#define ATMEL_TC_BEEVT_TOGGLE (3 << 28)
221#define ATMEL_TC_BSWTRG (3 << 30) /* software trigger changes TIOB */
222#define ATMEL_TC_BSWTRG_NONE (0 << 30)
223#define ATMEL_TC_BSWTRG_SET (1 << 30)
224#define ATMEL_TC_BSWTRG_CLEAR (2 << 30)
225#define ATMEL_TC_BSWTRG_TOGGLE (3 << 30)
226
227#define ATMEL_TC_CV 0x10 /* counter Value */
228#define ATMEL_TC_RA 0x14 /* register A */
229#define ATMEL_TC_RB 0x18 /* register B */
230#define ATMEL_TC_RC 0x1c /* register C */
231
232#define ATMEL_TC_SR 0x20 /* status (read-only) */
233/* Status-only flags */
234#define ATMEL_TC_CLKSTA (1 << 16) /* clock enabled */
235#define ATMEL_TC_MTIOA (1 << 17) /* TIOA mirror */
236#define ATMEL_TC_MTIOB (1 << 18) /* TIOB mirror */
237
238#define ATMEL_TC_IER 0x24 /* interrupt enable (write-only) */
239#define ATMEL_TC_IDR 0x28 /* interrupt disable (write-only) */
240#define ATMEL_TC_IMR 0x2c /* interrupt mask (read-only) */
241
242/* Status and IRQ flags */
243#define ATMEL_TC_COVFS (1 << 0) /* counter overflow */
244#define ATMEL_TC_LOVRS (1 << 1) /* load overrun */
245#define ATMEL_TC_CPAS (1 << 2) /* RA compare */
246#define ATMEL_TC_CPBS (1 << 3) /* RB compare */
247#define ATMEL_TC_CPCS (1 << 4) /* RC compare */
248#define ATMEL_TC_LDRAS (1 << 5) /* RA loading */
249#define ATMEL_TC_LDRBS (1 << 6) /* RB loading */
250#define ATMEL_TC_ETRGS (1 << 7) /* external trigger */
251
252#endif
diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h
index 574b201b99d8..794ad74b1d61 100644
--- a/include/linux/attribute_container.h
+++ b/include/linux/attribute_container.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * class_container.h - a generic container for all classes 2 * attribute_container.h - a generic container for all classes
3 * 3 *
4 * Copyright (c) 2005 - James Bottomley <James.Bottomley@steeleye.com> 4 * Copyright (c) 2005 - James Bottomley <James.Bottomley@steeleye.com>
5 * 5 *
@@ -18,7 +18,7 @@ struct attribute_container {
18 struct klist containers; 18 struct klist containers;
19 struct class *class; 19 struct class *class;
20 struct attribute_group *grp; 20 struct attribute_group *grp;
21 struct class_device_attribute **attrs; 21 struct device_attribute **attrs;
22 int (*match)(struct attribute_container *, struct device *); 22 int (*match)(struct attribute_container *, struct device *);
23#define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01 23#define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01
24 unsigned long flags; 24 unsigned long flags;
@@ -41,31 +41,31 @@ int __must_check attribute_container_unregister(struct attribute_container *cont
41void attribute_container_create_device(struct device *dev, 41void attribute_container_create_device(struct device *dev,
42 int (*fn)(struct attribute_container *, 42 int (*fn)(struct attribute_container *,
43 struct device *, 43 struct device *,
44 struct class_device *)); 44 struct device *));
45void attribute_container_add_device(struct device *dev, 45void attribute_container_add_device(struct device *dev,
46 int (*fn)(struct attribute_container *, 46 int (*fn)(struct attribute_container *,
47 struct device *, 47 struct device *,
48 struct class_device *)); 48 struct device *));
49void attribute_container_remove_device(struct device *dev, 49void attribute_container_remove_device(struct device *dev,
50 void (*fn)(struct attribute_container *, 50 void (*fn)(struct attribute_container *,
51 struct device *, 51 struct device *,
52 struct class_device *)); 52 struct device *));
53void attribute_container_device_trigger(struct device *dev, 53void attribute_container_device_trigger(struct device *dev,
54 int (*fn)(struct attribute_container *, 54 int (*fn)(struct attribute_container *,
55 struct device *, 55 struct device *,
56 struct class_device *)); 56 struct device *));
57void attribute_container_trigger(struct device *dev, 57void attribute_container_trigger(struct device *dev,
58 int (*fn)(struct attribute_container *, 58 int (*fn)(struct attribute_container *,
59 struct device *)); 59 struct device *));
60int attribute_container_add_attrs(struct class_device *classdev); 60int attribute_container_add_attrs(struct device *classdev);
61int attribute_container_add_class_device(struct class_device *classdev); 61int attribute_container_add_class_device(struct device *classdev);
62int attribute_container_add_class_device_adapter(struct attribute_container *cont, 62int attribute_container_add_class_device_adapter(struct attribute_container *cont,
63 struct device *dev, 63 struct device *dev,
64 struct class_device *classdev); 64 struct device *classdev);
65void attribute_container_remove_attrs(struct class_device *classdev); 65void attribute_container_remove_attrs(struct device *classdev);
66void attribute_container_class_device_del(struct class_device *classdev); 66void attribute_container_class_device_del(struct device *classdev);
67struct attribute_container *attribute_container_classdev_to_container(struct class_device *); 67struct attribute_container *attribute_container_classdev_to_container(struct device *);
68struct class_device *attribute_container_find_class_device(struct attribute_container *, struct device *); 68struct device *attribute_container_find_class_device(struct attribute_container *, struct device *);
69struct class_device_attribute **attribute_container_classdev_to_attrs(const struct class_device *classdev); 69struct device_attribute **attribute_container_classdev_to_attrs(const struct device *classdev);
70 70
71#endif 71#endif
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 4c59bdccd3ee..d259690863fb 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -327,6 +327,8 @@ extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
327extern void bio_set_pages_dirty(struct bio *bio); 327extern void bio_set_pages_dirty(struct bio *bio);
328extern void bio_check_pages_dirty(struct bio *bio); 328extern void bio_check_pages_dirty(struct bio *bio);
329extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); 329extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
330extern struct bio *bio_copy_user_iov(struct request_queue *, struct sg_iovec *,
331 int, int);
330extern int bio_uncopy_user(struct bio *); 332extern int bio_uncopy_user(struct bio *);
331void zero_fill_bio(struct bio *bio); 333void zero_fill_bio(struct bio *bio);
332 334
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index acad1105d942..1dbe074f1c64 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -108,6 +108,7 @@ extern int __bitmap_weight(const unsigned long *bitmap, int bits);
108 108
109extern int bitmap_scnprintf(char *buf, unsigned int len, 109extern int bitmap_scnprintf(char *buf, unsigned int len,
110 const unsigned long *src, int nbits); 110 const unsigned long *src, int nbits);
111extern int bitmap_scnprintf_len(unsigned int len);
111extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, 112extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user,
112 unsigned long *dst, int nbits); 113 unsigned long *dst, int nbits);
113extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen, 114extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 6f79d40dd3c0..c5065e3d2ca9 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -112,6 +112,7 @@ enum rq_flag_bits {
112 __REQ_RW_SYNC, /* request is sync (O_DIRECT) */ 112 __REQ_RW_SYNC, /* request is sync (O_DIRECT) */
113 __REQ_ALLOCED, /* request came from our alloc pool */ 113 __REQ_ALLOCED, /* request came from our alloc pool */
114 __REQ_RW_META, /* metadata io request */ 114 __REQ_RW_META, /* metadata io request */
115 __REQ_COPY_USER, /* contains copies of user pages */
115 __REQ_NR_BITS, /* stops here */ 116 __REQ_NR_BITS, /* stops here */
116}; 117};
117 118
@@ -133,6 +134,7 @@ enum rq_flag_bits {
133#define REQ_RW_SYNC (1 << __REQ_RW_SYNC) 134#define REQ_RW_SYNC (1 << __REQ_RW_SYNC)
134#define REQ_ALLOCED (1 << __REQ_ALLOCED) 135#define REQ_ALLOCED (1 << __REQ_ALLOCED)
135#define REQ_RW_META (1 << __REQ_RW_META) 136#define REQ_RW_META (1 << __REQ_RW_META)
137#define REQ_COPY_USER (1 << __REQ_COPY_USER)
136 138
137#define BLK_MAX_CDB 16 139#define BLK_MAX_CDB 16
138 140
@@ -533,8 +535,13 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn;
533 * BLK_BOUNCE_ANY : don't bounce anything 535 * BLK_BOUNCE_ANY : don't bounce anything
534 * BLK_BOUNCE_ISA : bounce pages above ISA DMA boundary 536 * BLK_BOUNCE_ISA : bounce pages above ISA DMA boundary
535 */ 537 */
538
539#if BITS_PER_LONG == 32
536#define BLK_BOUNCE_HIGH ((u64)blk_max_low_pfn << PAGE_SHIFT) 540#define BLK_BOUNCE_HIGH ((u64)blk_max_low_pfn << PAGE_SHIFT)
537#define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT) 541#else
542#define BLK_BOUNCE_HIGH -1ULL
543#endif
544#define BLK_BOUNCE_ANY (-1ULL)
538#define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD) 545#define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD)
539 546
540/* 547/*
diff --git a/include/linux/bsg.h b/include/linux/bsg.h
index 60e377b520f8..e8406c55c6d3 100644
--- a/include/linux/bsg.h
+++ b/include/linux/bsg.h
@@ -55,7 +55,7 @@ struct sg_io_v4 {
55 55
56#if defined(CONFIG_BLK_DEV_BSG) 56#if defined(CONFIG_BLK_DEV_BSG)
57struct bsg_class_device { 57struct bsg_class_device {
58 struct class_device *class_dev; 58 struct device *class_dev;
59 struct device *dev; 59 struct device *dev;
60 int minor; 60 int minor;
61 struct request_queue *queue; 61 struct request_queue *queue;
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h
index a5cd2047624e..5db265ea60f6 100644
--- a/include/linux/cdrom.h
+++ b/include/linux/cdrom.h
@@ -910,6 +910,7 @@ struct mode_page_header {
910#ifdef __KERNEL__ 910#ifdef __KERNEL__
911#include <linux/fs.h> /* not really needed, later.. */ 911#include <linux/fs.h> /* not really needed, later.. */
912#include <linux/device.h> 912#include <linux/device.h>
913#include <linux/list.h>
913 914
914struct packet_command 915struct packet_command
915{ 916{
@@ -934,7 +935,7 @@ struct packet_command
934/* Uniform cdrom data structures for cdrom.c */ 935/* Uniform cdrom data structures for cdrom.c */
935struct cdrom_device_info { 936struct cdrom_device_info {
936 struct cdrom_device_ops *ops; /* link to device_ops */ 937 struct cdrom_device_ops *ops; /* link to device_ops */
937 struct cdrom_device_info *next; /* next device_info for this major */ 938 struct list_head list; /* linked list of all device_info */
938 struct gendisk *disk; /* matching block layer disk */ 939 struct gendisk *disk; /* matching block layer disk */
939 void *handle; /* driver-dependent data */ 940 void *handle; /* driver-dependent data */
940/* specifications */ 941/* specifications */
@@ -994,7 +995,7 @@ extern int cdrom_ioctl(struct file *file, struct cdrom_device_info *cdi,
994extern int cdrom_media_changed(struct cdrom_device_info *); 995extern int cdrom_media_changed(struct cdrom_device_info *);
995 996
996extern int register_cdrom(struct cdrom_device_info *cdi); 997extern int register_cdrom(struct cdrom_device_info *cdi);
997extern int unregister_cdrom(struct cdrom_device_info *cdi); 998extern void unregister_cdrom(struct cdrom_device_info *cdi);
998 999
999typedef struct { 1000typedef struct {
1000 int data; 1001 int data;
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 0be8d65bc3c8..f212fa98283e 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -23,7 +23,6 @@
23#include <linux/node.h> 23#include <linux/node.h>
24#include <linux/compiler.h> 24#include <linux/compiler.h>
25#include <linux/cpumask.h> 25#include <linux/cpumask.h>
26#include <asm/semaphore.h>
27#include <linux/mutex.h> 26#include <linux/mutex.h>
28 27
29struct cpu { 28struct cpu {
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 7047f58306a7..259c8051155d 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -222,8 +222,13 @@ int __next_cpu(int n, const cpumask_t *srcp);
222#define next_cpu(n, src) ({ (void)(src); 1; }) 222#define next_cpu(n, src) ({ (void)(src); 1; })
223#endif 223#endif
224 224
225#ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP
226extern cpumask_t *cpumask_of_cpu_map;
227#define cpumask_of_cpu(cpu) (cpumask_of_cpu_map[cpu])
228
229#else
225#define cpumask_of_cpu(cpu) \ 230#define cpumask_of_cpu(cpu) \
226({ \ 231(*({ \
227 typeof(_unused_cpumask_arg_) m; \ 232 typeof(_unused_cpumask_arg_) m; \
228 if (sizeof(m) == sizeof(unsigned long)) { \ 233 if (sizeof(m) == sizeof(unsigned long)) { \
229 m.bits[0] = 1UL<<(cpu); \ 234 m.bits[0] = 1UL<<(cpu); \
@@ -231,8 +236,9 @@ int __next_cpu(int n, const cpumask_t *srcp);
231 cpus_clear(m); \ 236 cpus_clear(m); \
232 cpu_set((cpu), m); \ 237 cpu_set((cpu), m); \
233 } \ 238 } \
234 m; \ 239 &m; \
235}) 240}))
241#endif
236 242
237#define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) 243#define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS)
238 244
@@ -243,6 +249,8 @@ int __next_cpu(int n, const cpumask_t *srcp);
243 [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ 249 [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
244} } 250} }
245 251
252#define CPU_MASK_ALL_PTR (&CPU_MASK_ALL)
253
246#else 254#else
247 255
248#define CPU_MASK_ALL \ 256#define CPU_MASK_ALL \
@@ -251,6 +259,10 @@ int __next_cpu(int n, const cpumask_t *srcp);
251 [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ 259 [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
252} } 260} }
253 261
262/* cpu_mask_all is in init/main.c */
263extern cpumask_t cpu_mask_all;
264#define CPU_MASK_ALL_PTR (&cpu_mask_all)
265
254#endif 266#endif
255 267
256#define CPU_MASK_NONE \ 268#define CPU_MASK_NONE \
@@ -273,6 +285,13 @@ static inline int __cpumask_scnprintf(char *buf, int len,
273 return bitmap_scnprintf(buf, len, srcp->bits, nbits); 285 return bitmap_scnprintf(buf, len, srcp->bits, nbits);
274} 286}
275 287
288#define cpumask_scnprintf_len(len) \
289 __cpumask_scnprintf_len((len))
290static inline int __cpumask_scnprintf_len(int len)
291{
292 return bitmap_scnprintf_len(len);
293}
294
276#define cpumask_parse_user(ubuf, ulen, dst) \ 295#define cpumask_parse_user(ubuf, ulen, dst) \
277 __cpumask_parse_user((ubuf), (ulen), &(dst), NR_CPUS) 296 __cpumask_parse_user((ubuf), (ulen), &(dst), NR_CPUS)
278static inline int __cpumask_parse_user(const char __user *buf, int len, 297static inline int __cpumask_parse_user(const char __user *buf, int len,
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 0a26be353cb3..726761e24003 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -20,8 +20,8 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */
20extern int cpuset_init_early(void); 20extern int cpuset_init_early(void);
21extern int cpuset_init(void); 21extern int cpuset_init(void);
22extern void cpuset_init_smp(void); 22extern void cpuset_init_smp(void);
23extern cpumask_t cpuset_cpus_allowed(struct task_struct *p); 23extern void cpuset_cpus_allowed(struct task_struct *p, cpumask_t *mask);
24extern cpumask_t cpuset_cpus_allowed_locked(struct task_struct *p); 24extern void cpuset_cpus_allowed_locked(struct task_struct *p, cpumask_t *mask);
25extern nodemask_t cpuset_mems_allowed(struct task_struct *p); 25extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
26#define cpuset_current_mems_allowed (current->mems_allowed) 26#define cpuset_current_mems_allowed (current->mems_allowed)
27void cpuset_init_current_mems_allowed(void); 27void cpuset_init_current_mems_allowed(void);
@@ -84,13 +84,14 @@ static inline int cpuset_init_early(void) { return 0; }
84static inline int cpuset_init(void) { return 0; } 84static inline int cpuset_init(void) { return 0; }
85static inline void cpuset_init_smp(void) {} 85static inline void cpuset_init_smp(void) {}
86 86
87static inline cpumask_t cpuset_cpus_allowed(struct task_struct *p) 87static inline void cpuset_cpus_allowed(struct task_struct *p, cpumask_t *mask)
88{ 88{
89 return cpu_possible_map; 89 *mask = cpu_possible_map;
90} 90}
91static inline cpumask_t cpuset_cpus_allowed_locked(struct task_struct *p) 91static inline void cpuset_cpus_allowed_locked(struct task_struct *p,
92 cpumask_t *mask)
92{ 93{
93 return cpu_possible_map; 94 *mask = cpu_possible_map;
94} 95}
95 96
96static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) 97static inline nodemask_t cpuset_mems_allowed(struct task_struct *p)
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 5e02d1b46370..425824bd49f3 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -317,14 +317,7 @@ int crypto_unregister_alg(struct crypto_alg *alg);
317/* 317/*
318 * Algorithm query interface. 318 * Algorithm query interface.
319 */ 319 */
320#ifdef CONFIG_CRYPTO
321int crypto_has_alg(const char *name, u32 type, u32 mask); 320int crypto_has_alg(const char *name, u32 type, u32 mask);
322#else
323static inline int crypto_has_alg(const char *name, u32 type, u32 mask)
324{
325 return 0;
326}
327#endif
328 321
329/* 322/*
330 * Transforms: user-instantiated objects which encapsulate algorithms 323 * Transforms: user-instantiated objects which encapsulate algorithms
diff --git a/include/linux/device.h b/include/linux/device.h
index 2258d89bf523..1a060265acea 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -20,7 +20,7 @@
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/pm.h> 22#include <linux/pm.h>
23#include <asm/semaphore.h> 23#include <linux/semaphore.h>
24#include <asm/atomic.h> 24#include <asm/atomic.h>
25#include <asm/device.h> 25#include <asm/device.h>
26 26
@@ -429,7 +429,6 @@ struct device {
429 struct kobject kobj; 429 struct kobject kobj;
430 char bus_id[BUS_ID_SIZE]; /* position on parent bus */ 430 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
431 struct device_type *type; 431 struct device_type *type;
432 unsigned is_registered:1;
433 unsigned uevent_suppress:1; 432 unsigned uevent_suppress:1;
434 433
435 struct semaphore sem; /* semaphore to synchronize calls to 434 struct semaphore sem; /* semaphore to synchronize calls to
@@ -475,6 +474,9 @@ struct device {
475 void (*release)(struct device *dev); 474 void (*release)(struct device *dev);
476}; 475};
477 476
477/* Get the wakeup routines, which depend on struct device */
478#include <linux/pm_wakeup.h>
479
478#ifdef CONFIG_NUMA 480#ifdef CONFIG_NUMA
479static inline int dev_to_node(struct device *dev) 481static inline int dev_to_node(struct device *dev)
480{ 482{
@@ -506,7 +508,7 @@ static inline void dev_set_drvdata(struct device *dev, void *data)
506 508
507static inline int device_is_registered(struct device *dev) 509static inline int device_is_registered(struct device *dev)
508{ 510{
509 return dev->is_registered; 511 return dev->kobj.state_in_sysfs;
510} 512}
511 513
512void driver_init(void); 514void driver_init(void);
@@ -543,20 +545,6 @@ extern struct device *device_create(struct class *cls, struct device *parent,
543 dev_t devt, const char *fmt, ...) 545 dev_t devt, const char *fmt, ...)
544 __attribute__((format(printf, 4, 5))); 546 __attribute__((format(printf, 4, 5)));
545extern void device_destroy(struct class *cls, dev_t devt); 547extern void device_destroy(struct class *cls, dev_t devt);
546#ifdef CONFIG_PM_SLEEP
547extern void destroy_suspended_device(struct class *cls, dev_t devt);
548extern void device_pm_schedule_removal(struct device *);
549#else /* !CONFIG_PM_SLEEP */
550static inline void destroy_suspended_device(struct class *cls, dev_t devt)
551{
552 device_destroy(cls, devt);
553}
554
555static inline void device_pm_schedule_removal(struct device *dev)
556{
557 device_unregister(dev);
558}
559#endif /* !CONFIG_PM_SLEEP */
560 548
561/* 549/*
562 * Platform "fixup" functions - allow the platform to have their say 550 * Platform "fixup" functions - allow the platform to have their say
@@ -608,21 +596,16 @@ extern const char *dev_driver_string(struct device *dev);
608#define dev_dbg(dev, format, arg...) \ 596#define dev_dbg(dev, format, arg...) \
609 dev_printk(KERN_DEBUG , dev , format , ## arg) 597 dev_printk(KERN_DEBUG , dev , format , ## arg)
610#else 598#else
611static inline int __attribute__ ((format (printf, 2, 3))) 599#define dev_dbg(dev, format, arg...) \
612dev_dbg(struct device *dev, const char *fmt, ...) 600 ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
613{
614 return 0;
615}
616#endif 601#endif
617 602
618#ifdef VERBOSE_DEBUG 603#ifdef VERBOSE_DEBUG
619#define dev_vdbg dev_dbg 604#define dev_vdbg dev_dbg
620#else 605#else
621static inline int __attribute__ ((format (printf, 2, 3))) 606
622dev_vdbg(struct device *dev, const char *fmt, ...) 607#define dev_vdbg(dev, format, arg...) \
623{ 608 ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
624 return 0;
625}
626#endif 609#endif
627 610
628/* Create alias, so I can be autoloaded. */ 611/* Create alias, so I can be autoloaded. */
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index b4d84ed6187d..d08a5c5eb928 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -404,7 +404,7 @@ static inline enum dma_status dma_async_is_tx_complete(struct dma_chan *chan,
404 * @last_used: last cookie value handed out 404 * @last_used: last cookie value handed out
405 * 405 *
406 * dma_async_is_complete() is used in dma_async_memcpy_complete() 406 * dma_async_is_complete() is used in dma_async_memcpy_complete()
407 * the test logic is seperated for lightweight testing of multiple cookies 407 * the test logic is separated for lightweight testing of multiple cookies
408 */ 408 */
409static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie, 409static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
410 dma_cookie_t last_complete, dma_cookie_t last_used) 410 dma_cookie_t last_complete, dma_cookie_t last_used)
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 14813b595802..a5f359a7ad0e 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -18,6 +18,7 @@
18#include <linux/proc_fs.h> 18#include <linux/proc_fs.h>
19#include <linux/rtc.h> 19#include <linux/rtc.h>
20#include <linux/ioport.h> 20#include <linux/ioport.h>
21#include <linux/pfn.h>
21 22
22#include <asm/page.h> 23#include <asm/page.h>
23#include <asm/system.h> 24#include <asm/system.h>
@@ -394,4 +395,10 @@ struct efi_generic_dev_path {
394 u16 length; 395 u16 length;
395} __attribute ((packed)); 396} __attribute ((packed));
396 397
398static inline void memrange_efi_to_native(u64 *addr, u64 *npages)
399{
400 *npages = PFN_UP(*addr + (*npages<<EFI_PAGE_SHIFT)) - PFN_DOWN(*addr);
401 *addr &= PAGE_MASK;
402}
403
397#endif /* _LINUX_EFI_H */ 404#endif /* _LINUX_EFI_H */
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h
index a5978f18ca40..4332442b1b57 100644
--- a/include/linux/enclosure.h
+++ b/include/linux/enclosure.h
@@ -82,7 +82,8 @@ struct enclosure_component_callbacks {
82 82
83struct enclosure_component { 83struct enclosure_component {
84 void *scratch; 84 void *scratch;
85 struct class_device cdev; 85 struct device cdev;
86 struct device *dev;
86 enum enclosure_component_type type; 87 enum enclosure_component_type type;
87 int number; 88 int number;
88 int fault; 89 int fault;
@@ -94,20 +95,20 @@ struct enclosure_component {
94struct enclosure_device { 95struct enclosure_device {
95 void *scratch; 96 void *scratch;
96 struct list_head node; 97 struct list_head node;
97 struct class_device cdev; 98 struct device edev;
98 struct enclosure_component_callbacks *cb; 99 struct enclosure_component_callbacks *cb;
99 int components; 100 int components;
100 struct enclosure_component component[0]; 101 struct enclosure_component component[0];
101}; 102};
102 103
103static inline struct enclosure_device * 104static inline struct enclosure_device *
104to_enclosure_device(struct class_device *dev) 105to_enclosure_device(struct device *dev)
105{ 106{
106 return container_of(dev, struct enclosure_device, cdev); 107 return container_of(dev, struct enclosure_device, edev);
107} 108}
108 109
109static inline struct enclosure_component * 110static inline struct enclosure_component *
110to_enclosure_component(struct class_device *dev) 111to_enclosure_component(struct device *dev)
111{ 112{
112 return container_of(dev, struct enclosure_component, cdev); 113 return container_of(dev, struct enclosure_component, cdev);
113} 114}
diff --git a/include/linux/file.h b/include/linux/file.h
index 7239baac81a9..653477021e4c 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -61,6 +61,7 @@ extern struct kmem_cache *filp_cachep;
61 61
62extern void __fput(struct file *); 62extern void __fput(struct file *);
63extern void fput(struct file *); 63extern void fput(struct file *);
64extern void drop_file_write_access(struct file *file);
64 65
65struct file_operations; 66struct file_operations;
66struct vfsmount; 67struct vfsmount;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b84b848431f2..0c609e71c379 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -287,9 +287,9 @@ extern int dir_notify_enable;
287#include <linux/pid.h> 287#include <linux/pid.h>
288#include <linux/mutex.h> 288#include <linux/mutex.h>
289#include <linux/capability.h> 289#include <linux/capability.h>
290#include <linux/semaphore.h>
290 291
291#include <asm/atomic.h> 292#include <asm/atomic.h>
292#include <asm/semaphore.h>
293#include <asm/byteorder.h> 293#include <asm/byteorder.h>
294 294
295struct export_operations; 295struct export_operations;
@@ -776,6 +776,9 @@ static inline int ra_has_index(struct file_ra_state *ra, pgoff_t index)
776 index < ra->start + ra->size); 776 index < ra->start + ra->size);
777} 777}
778 778
779#define FILE_MNT_WRITE_TAKEN 1
780#define FILE_MNT_WRITE_RELEASED 2
781
779struct file { 782struct file {
780 /* 783 /*
781 * fu_list becomes invalid after file_free is called and queued via 784 * fu_list becomes invalid after file_free is called and queued via
@@ -810,6 +813,9 @@ struct file {
810 spinlock_t f_ep_lock; 813 spinlock_t f_ep_lock;
811#endif /* #ifdef CONFIG_EPOLL */ 814#endif /* #ifdef CONFIG_EPOLL */
812 struct address_space *f_mapping; 815 struct address_space *f_mapping;
816#ifdef CONFIG_DEBUG_WRITECOUNT
817 unsigned long f_mnt_write_state;
818#endif
813}; 819};
814extern spinlock_t files_lock; 820extern spinlock_t files_lock;
815#define file_list_lock() spin_lock(&files_lock); 821#define file_list_lock() spin_lock(&files_lock);
@@ -818,6 +824,49 @@ extern spinlock_t files_lock;
818#define get_file(x) atomic_inc(&(x)->f_count) 824#define get_file(x) atomic_inc(&(x)->f_count)
819#define file_count(x) atomic_read(&(x)->f_count) 825#define file_count(x) atomic_read(&(x)->f_count)
820 826
827#ifdef CONFIG_DEBUG_WRITECOUNT
828static inline void file_take_write(struct file *f)
829{
830 WARN_ON(f->f_mnt_write_state != 0);
831 f->f_mnt_write_state = FILE_MNT_WRITE_TAKEN;
832}
833static inline void file_release_write(struct file *f)
834{
835 f->f_mnt_write_state |= FILE_MNT_WRITE_RELEASED;
836}
837static inline void file_reset_write(struct file *f)
838{
839 f->f_mnt_write_state = 0;
840}
841static inline void file_check_state(struct file *f)
842{
843 /*
844 * At this point, either both or neither of these bits
845 * should be set.
846 */
847 WARN_ON(f->f_mnt_write_state == FILE_MNT_WRITE_TAKEN);
848 WARN_ON(f->f_mnt_write_state == FILE_MNT_WRITE_RELEASED);
849}
850static inline int file_check_writeable(struct file *f)
851{
852 if (f->f_mnt_write_state == FILE_MNT_WRITE_TAKEN)
853 return 0;
854 printk(KERN_WARNING "writeable file with no "
855 "mnt_want_write()\n");
856 WARN_ON(1);
857 return -EINVAL;
858}
859#else /* !CONFIG_DEBUG_WRITECOUNT */
860static inline void file_take_write(struct file *filp) {}
861static inline void file_release_write(struct file *filp) {}
862static inline void file_reset_write(struct file *filp) {}
863static inline void file_check_state(struct file *filp) {}
864static inline int file_check_writeable(struct file *filp)
865{
866 return 0;
867}
868#endif /* CONFIG_DEBUG_WRITECOUNT */
869
821#define MAX_NON_LFS ((1UL<<31) - 1) 870#define MAX_NON_LFS ((1UL<<31) - 1)
822 871
823/* Page cache limit. The filesystems should put that into their s_maxbytes 872/* Page cache limit. The filesystems should put that into their s_maxbytes
@@ -1735,7 +1784,8 @@ extern struct file *create_read_pipe(struct file *f);
1735extern struct file *create_write_pipe(void); 1784extern struct file *create_write_pipe(void);
1736extern void free_write_pipe(struct file *); 1785extern void free_write_pipe(struct file *);
1737 1786
1738extern int open_namei(int dfd, const char *, int, int, struct nameidata *); 1787extern struct file *do_filp_open(int dfd, const char *pathname,
1788 int open_flag, int mode);
1739extern int may_open(struct nameidata *, int, int); 1789extern int may_open(struct nameidata *, int, int);
1740 1790
1741extern int kernel_read(struct file *, unsigned long, char *, unsigned long); 1791extern int kernel_read(struct file *, unsigned long, char *, unsigned long);
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 74ff57596eb1..d951ec411241 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -284,6 +284,7 @@ struct hid_item {
284#define HID_QUIRK_2WHEEL_MOUSE_HACK_B8 0x02000000 284#define HID_QUIRK_2WHEEL_MOUSE_HACK_B8 0x02000000
285#define HID_QUIRK_HWHEEL_WHEEL_INVERT 0x04000000 285#define HID_QUIRK_HWHEEL_WHEEL_INVERT 0x04000000
286#define HID_QUIRK_MICROSOFT_KEYS 0x08000000 286#define HID_QUIRK_MICROSOFT_KEYS 0x08000000
287#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
287 288
288/* 289/*
289 * Separate quirks for runtime report descriptor fixup 290 * Separate quirks for runtime report descriptor fixup
@@ -296,6 +297,8 @@ struct hid_item {
296#define HID_QUIRK_RDESC_MACBOOK_JIS 0x00000010 297#define HID_QUIRK_RDESC_MACBOOK_JIS 0x00000010
297#define HID_QUIRK_RDESC_BUTTON_CONSUMER 0x00000020 298#define HID_QUIRK_RDESC_BUTTON_CONSUMER 0x00000020
298#define HID_QUIRK_RDESC_SAMSUNG_REMOTE 0x00000040 299#define HID_QUIRK_RDESC_SAMSUNG_REMOTE 0x00000040
300#define HID_QUIRK_RDESC_MICROSOFT_RECV_1028 0x00000080
301#define HID_QUIRK_RDESC_SUNPLUS_WDESKTOP 0x00000100
299 302
300/* 303/*
301 * This is the global environment of the parser. This information is 304 * This is the global environment of the parser. This information is
@@ -320,7 +323,7 @@ struct hid_global {
320 * This is the local environment. It is persistent up the next main-item. 323 * This is the local environment. It is persistent up the next main-item.
321 */ 324 */
322 325
323#define HID_MAX_USAGES 8192 326#define HID_MAX_USAGES 12288
324#define HID_DEFAULT_NUM_COLLECTIONS 16 327#define HID_DEFAULT_NUM_COLLECTIONS 16
325 328
326struct hid_local { 329struct hid_local {
@@ -421,6 +424,7 @@ struct hid_control_fifo {
421#define HID_RESET_PENDING 4 424#define HID_RESET_PENDING 4
422#define HID_SUSPENDED 5 425#define HID_SUSPENDED 5
423#define HID_CLEAR_HALT 6 426#define HID_CLEAR_HALT 6
427#define HID_DISCONNECTED 7
424 428
425struct hid_input { 429struct hid_input {
426 struct list_head list; 430 struct list_head list;
@@ -452,8 +456,6 @@ struct hid_device { /* device report descriptor */
452 void *hidraw; 456 void *hidraw;
453 int minor; /* Hiddev minor number */ 457 int minor; /* Hiddev minor number */
454 458
455 wait_queue_head_t wait; /* For sleeping */
456
457 int open; /* is the device open by anyone? */ 459 int open; /* is the device open by anyone? */
458 char name[128]; /* Device name */ 460 char name[128]; /* Device name */
459 char phys[64]; /* Device physical location */ 461 char phys[64]; /* Device physical location */
@@ -530,14 +532,12 @@ int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int
530int hidinput_mapping_quirks(struct hid_usage *, struct input_dev *, unsigned long **, int *); 532int hidinput_mapping_quirks(struct hid_usage *, struct input_dev *, unsigned long **, int *);
531int hidinput_event_quirks(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); 533int hidinput_event_quirks(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
532int hidinput_apple_event(struct hid_device *, struct input_dev *, struct hid_usage *, __s32); 534int hidinput_apple_event(struct hid_device *, struct input_dev *, struct hid_usage *, __s32);
533void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt);
534void hid_output_report(struct hid_report *report, __u8 *data); 535void hid_output_report(struct hid_report *report, __u8 *data);
535void hid_free_device(struct hid_device *device); 536void hid_free_device(struct hid_device *device);
536struct hid_device *hid_parse_report(__u8 *start, unsigned size); 537struct hid_device *hid_parse_report(__u8 *start, unsigned size);
537 538
538/* HID quirks API */ 539/* HID quirks API */
539u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); 540u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct);
540int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, const u32 quirks);
541int usbhid_quirks_init(char **quirks_param); 541int usbhid_quirks_init(char **quirks_param);
542void usbhid_quirks_exit(void); 542void usbhid_quirks_exit(void);
543void usbhid_fixup_report_descriptor(const u16, const u16, char *, unsigned, char **); 543void usbhid_fixup_report_descriptor(const u16, const u16, char *, unsigned, char **);
@@ -546,6 +546,7 @@ void usbhid_fixup_report_descriptor(const u16, const u16, char *, unsigned, char
546int hid_ff_init(struct hid_device *hid); 546int hid_ff_init(struct hid_device *hid);
547 547
548int hid_lgff_init(struct hid_device *hid); 548int hid_lgff_init(struct hid_device *hid);
549int hid_lg2ff_init(struct hid_device *hid);
549int hid_plff_init(struct hid_device *hid); 550int hid_plff_init(struct hid_device *hid);
550int hid_tmff_init(struct hid_device *hid); 551int hid_tmff_init(struct hid_device *hid);
551int hid_zpff_init(struct hid_device *hid); 552int hid_zpff_init(struct hid_device *hid);
@@ -566,7 +567,11 @@ static inline int hid_ff_init(struct hid_device *hid) { return -1; }
566#define dbg_hid_line(format, arg...) if (hid_debug) \ 567#define dbg_hid_line(format, arg...) if (hid_debug) \
567 printk(format, ## arg) 568 printk(format, ## arg)
568#else 569#else
569#define dbg_hid(format, arg...) do {} while (0) 570static inline int __attribute__((format(printf, 1, 2)))
571dbg_hid(const char *fmt, ...)
572{
573 return 0;
574}
570#define dbg_hid_line dbg_hid 575#define dbg_hid_line dbg_hid
571#endif 576#endif
572 577
diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h
index 0536f299f7ff..dbb5c8c374f0 100644
--- a/include/linux/hidraw.h
+++ b/include/linux/hidraw.h
@@ -16,6 +16,7 @@
16 */ 16 */
17 17
18#include <linux/hid.h> 18#include <linux/hid.h>
19#include <linux/types.h>
19 20
20struct hidraw_report_descriptor { 21struct hidraw_report_descriptor {
21 __u32 size; 22 __u32 size;
diff --git a/include/linux/hil_mlc.h b/include/linux/hil_mlc.h
index 8df29ca48a13..394a8405dd74 100644
--- a/include/linux/hil_mlc.h
+++ b/include/linux/hil_mlc.h
@@ -34,7 +34,7 @@
34#include <linux/hil.h> 34#include <linux/hil.h>
35#include <linux/time.h> 35#include <linux/time.h>
36#include <linux/interrupt.h> 36#include <linux/interrupt.h>
37#include <asm/semaphore.h> 37#include <linux/semaphore.h>
38#include <linux/serio.h> 38#include <linux/serio.h>
39#include <linux/list.h> 39#include <linux/list.h>
40 40
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h
index 42131820bb89..85d11916e9ea 100644
--- a/include/linux/hw_random.h
+++ b/include/linux/hw_random.h
@@ -44,15 +44,7 @@ struct hwrng {
44/** Register a new Hardware Random Number Generator driver. */ 44/** Register a new Hardware Random Number Generator driver. */
45extern int hwrng_register(struct hwrng *rng); 45extern int hwrng_register(struct hwrng *rng);
46/** Unregister a Hardware Random Number Generator driver. */ 46/** Unregister a Hardware Random Number Generator driver. */
47extern void __hwrng_unregister(struct hwrng *rng, bool suspended); 47extern void hwrng_unregister(struct hwrng *rng);
48static inline void hwrng_unregister(struct hwrng *rng)
49{
50 __hwrng_unregister(rng, false);
51}
52static inline void hwrng_unregister_suspended(struct hwrng *rng)
53{
54 __hwrng_unregister(rng, true);
55}
56 48
57#endif /* __KERNEL__ */ 49#endif /* __KERNEL__ */
58#endif /* LINUX_HWRANDOM_H_ */ 50#endif /* LINUX_HWRANDOM_H_ */
diff --git a/include/linux/i2c/tps65010.h b/include/linux/i2c/tps65010.h
index 7021635ed6a0..918c5354d9b8 100644
--- a/include/linux/i2c/tps65010.h
+++ b/include/linux/i2c/tps65010.h
@@ -152,5 +152,35 @@ extern int tps65010_config_vregs1(unsigned value);
152 */ 152 */
153extern int tps65013_set_low_pwr(unsigned mode); 153extern int tps65013_set_low_pwr(unsigned mode);
154 154
155
156struct i2c_client;
157
158/**
159 * struct tps65010_board - packages GPIO and LED lines
160 * @base: the GPIO number to assign to GPIO-1
161 * @outmask: bit (N-1) is set to allow GPIO-N to be used as an
162 * (open drain) output
163 * @setup: optional callback issued once the GPIOs are valid
164 * @teardown: optional callback issued before the GPIOs are invalidated
165 * @context: optional parameter passed to setup() and teardown()
166 *
167 * Board data may be used to package the GPIO (and LED) lines for use
168 * in by the generic GPIO and LED frameworks. The first four GPIOs
169 * starting at gpio_base are GPIO1..GPIO4. The next two are LED1/nPG
170 * and LED2 (with hardware blinking capability, not currently exposed).
171 *
172 * The @setup callback may be used with the kind of board-specific glue
173 * which hands the (now-valid) GPIOs to other drivers, or which puts
174 * devices in their initial states using these GPIOs.
175 */
176struct tps65010_board {
177 int base;
178 unsigned outmask;
179
180 int (*setup)(struct i2c_client *client, void *context);
181 int (*teardown)(struct i2c_client *client, void *context);
182 void *context;
183};
184
155#endif /* __LINUX_I2C_TPS65010_H */ 185#endif /* __LINUX_I2C_TPS65010_H */
156 186
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 7da5b98d90e6..e92170dda245 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -33,9 +33,9 @@
33#include <linux/mempool.h> 33#include <linux/mempool.h>
34#include <linux/mutex.h> 34#include <linux/mutex.h>
35#include <linux/scatterlist.h> 35#include <linux/scatterlist.h>
36#include <linux/semaphore.h> /* Needed for MUTEX init macros */
36 37
37#include <asm/io.h> 38#include <asm/io.h>
38#include <asm/semaphore.h> /* Needed for MUTEX init macros */
39 39
40/* message queue empty */ 40/* message queue empty */
41#define I2O_QUEUE_EMPTY 0xffffffff 41#define I2O_QUEUE_EMPTY 0xffffffff
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 6c39482fd1a1..5f3e82ae901a 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -23,7 +23,6 @@
23#include <asm/byteorder.h> 23#include <asm/byteorder.h>
24#include <asm/system.h> 24#include <asm/system.h>
25#include <asm/io.h> 25#include <asm/io.h>
26#include <asm/semaphore.h>
27#include <asm/mutex.h> 26#include <asm/mutex.h>
28 27
29#if defined(CONFIG_CRIS) || defined(CONFIG_FRV) 28#if defined(CONFIG_CRIS) || defined(CONFIG_FRV)
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 40743e032845..6fb7f1788570 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -24,7 +24,6 @@
24#include <linux/if_ether.h> 24#include <linux/if_ether.h>
25#include <linux/if.h> 25#include <linux/if.h>
26#include <linux/netdevice.h> 26#include <linux/netdevice.h>
27#include <asm/semaphore.h>
28#include <linux/ppp_channel.h> 27#include <linux/ppp_channel.h>
29#endif /* __KERNEL__ */ 28#endif /* __KERNEL__ */
30#include <linux/if_pppol2tp.h> 29#include <linux/if_pppol2tp.h>
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 1f74e1d7415f..37a6f5bc4a92 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -151,6 +151,9 @@ extern struct group_info init_groups;
151 .cpus_allowed = CPU_MASK_ALL, \ 151 .cpus_allowed = CPU_MASK_ALL, \
152 .mm = NULL, \ 152 .mm = NULL, \
153 .active_mm = &init_mm, \ 153 .active_mm = &init_mm, \
154 .se = { \
155 .group_node = LIST_HEAD_INIT(tsk.se.group_node), \
156 }, \
154 .rt = { \ 157 .rt = { \
155 .run_list = LIST_HEAD_INIT(tsk.rt.run_list), \ 158 .run_list = LIST_HEAD_INIT(tsk.rt.run_list), \
156 .time_slice = HZ, \ 159 .time_slice = HZ, \
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 605d237364d2..d5d40a9f7929 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -44,7 +44,9 @@ struct resource_list {
44#define IORESOURCE_CACHEABLE 0x00004000 44#define IORESOURCE_CACHEABLE 0x00004000
45#define IORESOURCE_RANGELENGTH 0x00008000 45#define IORESOURCE_RANGELENGTH 0x00008000
46#define IORESOURCE_SHADOWABLE 0x00010000 46#define IORESOURCE_SHADOWABLE 0x00010000
47#define IORESOURCE_BUS_HAS_VGA 0x00080000 47
48#define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */
49#define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */
48 50
49#define IORESOURCE_DISABLED 0x10000000 51#define IORESOURCE_DISABLED 0x10000000
50#define IORESOURCE_UNSET 0x20000000 52#define IORESOURCE_UNSET 0x20000000
@@ -110,6 +112,7 @@ extern int allocate_resource(struct resource *root, struct resource *new,
110 void *alignf_data); 112 void *alignf_data);
111int adjust_resource(struct resource *res, resource_size_t start, 113int adjust_resource(struct resource *res, resource_size_t start,
112 resource_size_t size); 114 resource_size_t size);
115resource_size_t resource_alignment(struct resource *res);
113 116
114/* Convenience shorthand with allocation */ 117/* Convenience shorthand with allocation */
115#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) 118#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name))
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h
index 412e025bc5c7..e600c4e9b8c5 100644
--- a/include/linux/irqflags.h
+++ b/include/linux/irqflags.h
@@ -84,10 +84,10 @@
84 84
85#define irqs_disabled() \ 85#define irqs_disabled() \
86({ \ 86({ \
87 unsigned long flags; \ 87 unsigned long _flags; \
88 \ 88 \
89 raw_local_save_flags(flags); \ 89 raw_local_save_flags(_flags); \
90 raw_irqs_disabled_flags(flags); \ 90 raw_irqs_disabled_flags(_flags); \
91}) 91})
92 92
93#define irqs_disabled_flags(flags) raw_irqs_disabled_flags(flags) 93#define irqs_disabled_flags(flags) raw_irqs_disabled_flags(flags)
diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h
new file mode 100644
index 000000000000..6092487e2950
--- /dev/null
+++ b/include/linux/iscsi_ibft.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright 2007 Red Hat, Inc.
3 * by Peter Jones <pjones@redhat.com>
4 * Copyright 2007 IBM, Inc.
5 * by Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
6 * Copyright 2008
7 * by Konrad Rzeszutek <ketuzsezr@darnok.org>
8 *
9 * This code exposes the iSCSI Boot Format Table to userland via sysfs.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License v2.0 as published by
13 * the Free Software Foundation
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 */
20
21#ifndef ISCSI_IBFT_H
22#define ISCSI_IBFT_H
23
24struct ibft_table_header {
25 char signature[4];
26 u32 length;
27 u8 revision;
28 u8 checksum;
29 char oem_id[6];
30 char oem_table_id[8];
31 char reserved[24];
32} __attribute__((__packed__));
33
34/*
35 * Logical location of iSCSI Boot Format Table.
36 * If the value is NULL there is no iBFT on the machine.
37 */
38extern struct ibft_table_header *ibft_addr;
39
40/*
41 * Routine used to find and reserve the iSCSI Boot Format Table. The
42 * mapped address is set in the ibft_addr variable.
43 */
44#ifdef CONFIG_ISCSI_IBFT_FIND
45extern void __init reserve_ibft_region(void);
46#else
47static inline void reserve_ibft_region(void) { }
48#endif
49
50#endif /* ISCSI_IBFT_H */
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 423f58272188..07a9b52a2654 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -32,8 +32,6 @@
32#include <linux/timer.h> 32#include <linux/timer.h>
33#include <linux/lockdep.h> 33#include <linux/lockdep.h>
34 34
35#include <asm/semaphore.h>
36
37#define journal_oom_retry 1 35#define journal_oom_retry 1
38 36
39/* 37/*
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 2cbf6fdb1799..05e2b307161a 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -30,8 +30,6 @@
30#include <linux/bit_spinlock.h> 30#include <linux/bit_spinlock.h>
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/timer.h> 32#include <linux/timer.h>
33
34#include <asm/semaphore.h>
35#endif 33#endif
36 34
37#define journal_oom_retry 1 35#define journal_oom_retry 1
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index e0b5b684d83f..33ef710dac24 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -36,7 +36,7 @@
36#elif HZ >= 6144 && HZ < 12288 36#elif HZ >= 6144 && HZ < 12288
37# define SHIFT_HZ 13 37# define SHIFT_HZ 13
38#else 38#else
39# error You lose. 39# error Invalid value of HZ.
40#endif 40#endif
41 41
42/* LATCH is used in the interval timer and ftape setup. */ 42/* LATCH is used in the interval timer and ftape setup. */
@@ -135,6 +135,22 @@ static inline u64 get_jiffies_64(void)
135#define time_before_eq64(a,b) time_after_eq64(b,a) 135#define time_before_eq64(a,b) time_after_eq64(b,a)
136 136
137/* 137/*
138 * These four macros compare jiffies and 'a' for convenience.
139 */
140
141/* time_is_before_jiffies(a) return true if a is before jiffies */
142#define time_is_before_jiffies(a) time_after(jiffies, a)
143
144/* time_is_after_jiffies(a) return true if a is after jiffies */
145#define time_is_after_jiffies(a) time_before(jiffies, a)
146
147/* time_is_before_eq_jiffies(a) return true if a is before or equal to jiffies*/
148#define time_is_before_eq_jiffies(a) time_after_eq(jiffies, a)
149
150/* time_is_after_eq_jiffies(a) return true if a is after or equal to jiffies*/
151#define time_is_after_eq_jiffies(a) time_before_eq(jiffies, a)
152
153/*
138 * Have the 32 bit jiffies value wrap 5 minutes after boot 154 * Have the 32 bit jiffies value wrap 5 minutes after boot
139 * so jiffies wrap bugs show up earlier. 155 * so jiffies wrap bugs show up earlier.
140 */ 156 */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 2df44e773270..cd6d02cf854d 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -293,10 +293,8 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
293#define pr_debug(fmt, arg...) \ 293#define pr_debug(fmt, arg...) \
294 printk(KERN_DEBUG fmt, ##arg) 294 printk(KERN_DEBUG fmt, ##arg)
295#else 295#else
296static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...) 296#define pr_debug(fmt, arg...) \
297{ 297 ({ if (0) printk(KERN_DEBUG fmt, ##arg); 0; })
298 return 0;
299}
300#endif 298#endif
301 299
302/* 300/*
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h
index 8c4350a9ed87..a53e932f80fb 100644
--- a/include/linux/kernelcapi.h
+++ b/include/linux/kernelcapi.h
@@ -48,7 +48,6 @@ typedef struct kcapi_carddef {
48#include <linux/list.h> 48#include <linux/list.h>
49#include <linux/skbuff.h> 49#include <linux/skbuff.h>
50#include <linux/workqueue.h> 50#include <linux/workqueue.h>
51#include <asm/semaphore.h>
52 51
53#define KCI_CONTRUP 0 /* arg: struct capi_profile */ 52#define KCI_CONTRUP 0 /* arg: struct capi_profile */
54#define KCI_CONTRDOWN 1 /* arg: NULL */ 53#define KCI_CONTRDOWN 1 /* arg: NULL */
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 2cd7fa73d1af..ce5983225be4 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -327,4 +327,10 @@ extern void ktime_get_ts(struct timespec *ts);
327/* Get the real (wall-) time in timespec format: */ 327/* Get the real (wall-) time in timespec format: */
328#define ktime_get_real_ts(ts) getnstimeofday(ts) 328#define ktime_get_real_ts(ts) getnstimeofday(ts)
329 329
330static inline ktime_t ns_to_ktime(u64 ns)
331{
332 static const ktime_t ktime_zero = { .tv64 = 0 };
333 return ktime_add_ns(ktime_zero, ns);
334}
335
330#endif 336#endif
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 0201f6f51cea..b07e3d400bd6 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -59,15 +59,7 @@ struct led_classdev {
59 59
60extern int led_classdev_register(struct device *parent, 60extern int led_classdev_register(struct device *parent,
61 struct led_classdev *led_cdev); 61 struct led_classdev *led_cdev);
62extern void __led_classdev_unregister(struct led_classdev *led_cdev, bool sus); 62extern void led_classdev_unregister(struct led_classdev *lcd);
63static inline void led_classdev_unregister(struct led_classdev *lcd)
64{
65 __led_classdev_unregister(lcd, false);
66}
67static inline void led_classdev_unregister_suspended(struct led_classdev *lcd)
68{
69 __led_classdev_unregister(lcd, true);
70}
71extern void led_classdev_suspend(struct led_classdev *led_cdev); 63extern void led_classdev_suspend(struct led_classdev *led_cdev);
72extern void led_classdev_resume(struct led_classdev *led_cdev); 64extern void led_classdev_resume(struct led_classdev *led_cdev);
73 65
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 165734a2dd47..07ed56f7a767 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -443,7 +443,7 @@ enum link_pm {
443 MAX_PERFORMANCE, 443 MAX_PERFORMANCE,
444 MEDIUM_POWER, 444 MEDIUM_POWER,
445}; 445};
446extern struct class_device_attribute class_device_attr_link_power_management_policy; 446extern struct device_attribute dev_attr_link_power_management_policy;
447 447
448#ifdef CONFIG_ATA_SFF 448#ifdef CONFIG_ATA_SFF
449struct ata_ioports { 449struct ata_ioports {
diff --git a/include/linux/list.h b/include/linux/list.h
index 75ce2cb4ff6e..dac16f99c701 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -631,31 +631,14 @@ static inline void list_splice_init_rcu(struct list_head *list,
631 * as long as the traversal is guarded by rcu_read_lock(). 631 * as long as the traversal is guarded by rcu_read_lock().
632 */ 632 */
633#define list_for_each_rcu(pos, head) \ 633#define list_for_each_rcu(pos, head) \
634 for (pos = (head)->next; \ 634 for (pos = rcu_dereference((head)->next); \
635 prefetch(rcu_dereference(pos)->next), pos != (head); \ 635 prefetch(pos->next), pos != (head); \
636 pos = pos->next) 636 pos = rcu_dereference(pos->next))
637 637
638#define __list_for_each_rcu(pos, head) \ 638#define __list_for_each_rcu(pos, head) \
639 for (pos = (head)->next; \ 639 for (pos = rcu_dereference((head)->next); \
640 rcu_dereference(pos) != (head); \ 640 pos != (head); \
641 pos = pos->next) 641 pos = rcu_dereference(pos->next))
642
643/**
644 * list_for_each_safe_rcu
645 * @pos: the &struct list_head to use as a loop cursor.
646 * @n: another &struct list_head to use as temporary storage
647 * @head: the head for your list.
648 *
649 * Iterate over an rcu-protected list, safe against removal of list entry.
650 *
651 * This list-traversal primitive may safely run concurrently with
652 * the _rcu list-mutation primitives such as list_add_rcu()
653 * as long as the traversal is guarded by rcu_read_lock().
654 */
655#define list_for_each_safe_rcu(pos, n, head) \
656 for (pos = (head)->next; \
657 n = rcu_dereference(pos)->next, pos != (head); \
658 pos = n)
659 642
660/** 643/**
661 * list_for_each_entry_rcu - iterate over rcu list of given type 644 * list_for_each_entry_rcu - iterate over rcu list of given type
@@ -668,10 +651,9 @@ static inline void list_splice_init_rcu(struct list_head *list,
668 * as long as the traversal is guarded by rcu_read_lock(). 651 * as long as the traversal is guarded by rcu_read_lock().
669 */ 652 */
670#define list_for_each_entry_rcu(pos, head, member) \ 653#define list_for_each_entry_rcu(pos, head, member) \
671 for (pos = list_entry((head)->next, typeof(*pos), member); \ 654 for (pos = list_entry(rcu_dereference((head)->next), typeof(*pos), member); \
672 prefetch(rcu_dereference(pos)->member.next), \ 655 prefetch(pos->member.next), &pos->member != (head); \
673 &pos->member != (head); \ 656 pos = list_entry(rcu_dereference(pos->member.next), typeof(*pos), member))
674 pos = list_entry(pos->member.next, typeof(*pos), member))
675 657
676 658
677/** 659/**
@@ -686,9 +668,9 @@ static inline void list_splice_init_rcu(struct list_head *list,
686 * as long as the traversal is guarded by rcu_read_lock(). 668 * as long as the traversal is guarded by rcu_read_lock().
687 */ 669 */
688#define list_for_each_continue_rcu(pos, head) \ 670#define list_for_each_continue_rcu(pos, head) \
689 for ((pos) = (pos)->next; \ 671 for ((pos) = rcu_dereference((pos)->next); \
690 prefetch(rcu_dereference((pos))->next), (pos) != (head); \ 672 prefetch((pos)->next), (pos) != (head); \
691 (pos) = (pos)->next) 673 (pos) = rcu_dereference((pos)->next))
692 674
693/* 675/*
694 * Double linked lists with a single pointer list head. 676 * Double linked lists with a single pointer list head.
@@ -986,10 +968,10 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
986 * as long as the traversal is guarded by rcu_read_lock(). 968 * as long as the traversal is guarded by rcu_read_lock().
987 */ 969 */
988#define hlist_for_each_entry_rcu(tpos, pos, head, member) \ 970#define hlist_for_each_entry_rcu(tpos, pos, head, member) \
989 for (pos = (head)->first; \ 971 for (pos = rcu_dereference((head)->first); \
990 rcu_dereference(pos) && ({ prefetch(pos->next); 1;}) && \ 972 pos && ({ prefetch(pos->next); 1;}) && \
991 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ 973 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
992 pos = pos->next) 974 pos = rcu_dereference(pos->next))
993 975
994#else 976#else
995#warning "don't include kernel headers in userspace" 977#warning "don't include kernel headers in userspace"
diff --git a/include/linux/lmb.h b/include/linux/lmb.h
new file mode 100644
index 000000000000..271153d27fba
--- /dev/null
+++ b/include/linux/lmb.h
@@ -0,0 +1,85 @@
1#ifndef _LINUX_LMB_H
2#define _LINUX_LMB_H
3#ifdef __KERNEL__
4
5/*
6 * Logical memory blocks.
7 *
8 * Copyright (C) 2001 Peter Bergner, IBM Corp.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <linux/init.h>
17#include <linux/mm.h>
18
19#define MAX_LMB_REGIONS 128
20
21struct lmb_property {
22 u64 base;
23 u64 size;
24};
25
26struct lmb_region {
27 unsigned long cnt;
28 u64 size;
29 struct lmb_property region[MAX_LMB_REGIONS+1];
30};
31
32struct lmb {
33 unsigned long debug;
34 u64 rmo_size;
35 struct lmb_region memory;
36 struct lmb_region reserved;
37};
38
39extern struct lmb lmb;
40
41extern void __init lmb_init(void);
42extern void __init lmb_analyze(void);
43extern long __init lmb_add(u64 base, u64 size);
44extern long __init lmb_reserve(u64 base, u64 size);
45extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid,
46 u64 (*nid_range)(u64, u64, int *));
47extern u64 __init lmb_alloc(u64 size, u64 align);
48extern u64 __init lmb_alloc_base(u64 size,
49 u64, u64 max_addr);
50extern u64 __init __lmb_alloc_base(u64 size,
51 u64 align, u64 max_addr);
52extern u64 __init lmb_phys_mem_size(void);
53extern u64 __init lmb_end_of_DRAM(void);
54extern void __init lmb_enforce_memory_limit(u64 memory_limit);
55extern int __init lmb_is_reserved(u64 addr);
56
57extern void lmb_dump_all(void);
58
59static inline u64
60lmb_size_bytes(struct lmb_region *type, unsigned long region_nr)
61{
62 return type->region[region_nr].size;
63}
64static inline u64
65lmb_size_pages(struct lmb_region *type, unsigned long region_nr)
66{
67 return lmb_size_bytes(type, region_nr) >> PAGE_SHIFT;
68}
69static inline u64
70lmb_start_pfn(struct lmb_region *type, unsigned long region_nr)
71{
72 return type->region[region_nr].base >> PAGE_SHIFT;
73}
74static inline u64
75lmb_end_pfn(struct lmb_region *type, unsigned long region_nr)
76{
77 return lmb_start_pfn(type, region_nr) +
78 lmb_size_pages(type, region_nr);
79}
80
81#include <asm/lmb.h>
82
83#endif /* __KERNEL__ */
84
85#endif /* _LINUX_LMB_H */
diff --git a/include/linux/mbus.h b/include/linux/mbus.h
new file mode 100644
index 000000000000..c11ff2932549
--- /dev/null
+++ b/include/linux/mbus.h
@@ -0,0 +1,36 @@
1/*
2 * Marvell MBUS common definitions.
3 *
4 * Copyright (C) 2008 Marvell Semiconductor
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __LINUX_MBUS_H
12#define __LINUX_MBUS_H
13
14struct mbus_dram_target_info
15{
16 /*
17 * The 4-bit MBUS target ID of the DRAM controller.
18 */
19 u8 mbus_dram_target_id;
20
21 /*
22 * The base address, size, and MBUS attribute ID for each
23 * of the possible DRAM chip selects. Peripherals are
24 * required to support at least 4 decode windows.
25 */
26 int num_cs;
27 struct mbus_dram_window {
28 u8 cs_index;
29 u8 mbus_attr;
30 u32 base;
31 u32 size;
32 } cs[4];
33};
34
35
36#endif
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 33f0ff0cf634..f80e0e331cb7 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -18,8 +18,7 @@
18#include <linux/sysdev.h> 18#include <linux/sysdev.h>
19#include <linux/node.h> 19#include <linux/node.h>
20#include <linux/compiler.h> 20#include <linux/compiler.h>
21 21#include <linux/mutex.h>
22#include <asm/semaphore.h>
23 22
24struct memory_block { 23struct memory_block {
25 unsigned long phys_index; 24 unsigned long phys_index;
@@ -30,7 +29,7 @@ struct memory_block {
30 * created long after the critical areas during 29 * created long after the critical areas during
31 * initialization. 30 * initialization.
32 */ 31 */
33 struct semaphore state_sem; 32 struct mutex state_mutex;
34 int phys_device; /* to which fru does this belong? */ 33 int phys_device; /* to which fru does this belong? */
35 void *hw; /* optional pointer to fw/hw data */ 34 void *hw; /* optional pointer to fw/hw data */
36 int (*phys_callback)(struct memory_block *); 35 int (*phys_callback)(struct memory_block *);
diff --git a/include/linux/memstick.h b/include/linux/memstick.h
index 3e686ec6a967..37a5cdb03918 100644
--- a/include/linux/memstick.h
+++ b/include/linux/memstick.h
@@ -276,7 +276,7 @@ struct memstick_host {
276#define MEMSTICK_CAP_PAR8 4 276#define MEMSTICK_CAP_PAR8 4
277 277
278 struct work_struct media_checker; 278 struct work_struct media_checker;
279 struct class_device cdev; 279 struct device dev;
280 280
281 struct memstick_dev *card; 281 struct memstick_dev *card;
282 unsigned int retries; 282 unsigned int retries;
diff --git a/include/linux/mfd/htc-egpio.h b/include/linux/mfd/htc-egpio.h
new file mode 100644
index 000000000000..b4201c971367
--- /dev/null
+++ b/include/linux/mfd/htc-egpio.h
@@ -0,0 +1,57 @@
1/*
2 * HTC simple EGPIO irq and gpio extender
3 */
4
5#ifndef __HTC_EGPIO_H__
6#define __HTC_EGPIO_H__
7
8#include <linux/gpio.h>
9
10/* Descriptive values for all-in or all-out htc_egpio_chip descriptors. */
11#define HTC_EGPIO_OUTPUT (~0)
12#define HTC_EGPIO_INPUT 0
13
14/**
15 * struct htc_egpio_chip - descriptor to create gpio_chip for register range
16 * @reg_start: index of first register
17 * @gpio_base: gpio number of first pin in this register range
18 * @num_gpios: number of gpios in this register range, max BITS_PER_LONG
19 * (number of registers = DIV_ROUND_UP(num_gpios, reg_width))
20 * @direction: bitfield, '0' = input, '1' = output,
21 */
22struct htc_egpio_chip {
23 int reg_start;
24 int gpio_base;
25 int num_gpios;
26 unsigned long direction;
27 unsigned long initial_values;
28};
29
30/**
31 * struct htc_egpio_platform_data - description provided by the arch
32 * @irq_base: beginning of available IRQs (eg, IRQ_BOARD_START)
33 * @num_irqs: number of irqs
34 * @reg_width: number of bits per register, either 8 or 16 bit
35 * @bus_width: alignment of the registers, either 16 or 32 bit
36 * @invert_acks: set if chip requires writing '0' to ack an irq, instead of '1'
37 * @ack_register: location of the irq/ack register
38 * @chip: pointer to array of htc_egpio_chip descriptors
39 * @num_chips: number of egpio chip descriptors
40 */
41struct htc_egpio_platform_data {
42 int bus_width;
43 int reg_width;
44
45 int irq_base;
46 int num_irqs;
47 int invert_acks;
48 int ack_register;
49
50 struct htc_egpio_chip *chip;
51 int num_chips;
52};
53
54/* Determine the wakeup irq, to be called during early resume */
55extern int htc_egpio_get_wakeup_irq(struct device *dev);
56
57#endif
diff --git a/include/linux/mfd/htc-pasic3.h b/include/linux/mfd/htc-pasic3.h
new file mode 100644
index 000000000000..b4294f12c4f8
--- /dev/null
+++ b/include/linux/mfd/htc-pasic3.h
@@ -0,0 +1,55 @@
1/*
2 * HTC PASIC3 driver - LEDs and DS1WM
3 *
4 * Copyright (c) 2007 Philipp Zabel <philipp.zabel@gmail.com>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive for
8 * more details.
9 *
10 */
11
12#ifndef __PASIC3_H
13#define __PASIC3_H
14
15#include <linux/platform_device.h>
16#include <linux/leds.h>
17
18extern void pasic3_write_register(struct device *dev, u32 reg, u8 val);
19extern u8 pasic3_read_register(struct device *dev, u32 reg);
20
21/*
22 * mask for registers 0x20,0x21,0x22
23 */
24#define PASIC3_MASK_LED0 0x04
25#define PASIC3_MASK_LED1 0x08
26#define PASIC3_MASK_LED2 0x40
27
28/*
29 * bits in register 0x06
30 */
31#define PASIC3_BIT2_LED0 0x08
32#define PASIC3_BIT2_LED1 0x10
33#define PASIC3_BIT2_LED2 0x20
34
35struct pasic3_led {
36 struct led_classdev led;
37 unsigned int hw_num;
38 unsigned int bit2;
39 unsigned int mask;
40 struct pasic3_leds_machinfo *pdata;
41};
42
43struct pasic3_leds_machinfo {
44 unsigned int num_leds;
45 unsigned int power_gpio;
46 struct pasic3_led *leds;
47};
48
49struct pasic3_platform_data {
50 struct pasic3_leds_machinfo *led_pdata;
51 unsigned int bus_shift;
52 unsigned int clock_rate;
53};
54
55#endif
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 24b30b9b4f8a..26433ec520b3 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -43,15 +43,7 @@ struct miscdevice {
43}; 43};
44 44
45extern int misc_register(struct miscdevice * misc); 45extern int misc_register(struct miscdevice * misc);
46extern int __misc_deregister(struct miscdevice *misc, bool suspended); 46extern int misc_deregister(struct miscdevice *misc);
47static inline int misc_deregister(struct miscdevice *misc)
48{
49 return __misc_deregister(misc, false);
50}
51static inline int misc_deregister_suspended(struct miscdevice *misc)
52{
53 return __misc_deregister(misc, true);
54}
55 47
56#define MODULE_ALIAS_MISCDEV(minor) \ 48#define MODULE_ALIAS_MISCDEV(minor) \
57 MODULE_ALIAS("char-major-" __stringify(MISC_MAJOR) \ 49 MODULE_ALIAS("char-major-" __stringify(MISC_MAJOR) \
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 8d8d1977736e..9f274a687c7e 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -699,7 +699,6 @@ extern char numa_zonelist_order[];
699extern struct pglist_data contig_page_data; 699extern struct pglist_data contig_page_data;
700#define NODE_DATA(nid) (&contig_page_data) 700#define NODE_DATA(nid) (&contig_page_data)
701#define NODE_MEM_MAP(nid) mem_map 701#define NODE_MEM_MAP(nid) mem_map
702#define MAX_NODES_SHIFT 1
703 702
704#else /* CONFIG_NEED_MULTIPLE_NODES */ 703#else /* CONFIG_NEED_MULTIPLE_NODES */
705 704
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 5ee2df217cdf..d6600e3f7e45 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -14,6 +14,7 @@
14 14
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/nodemask.h>
17#include <linux/spinlock.h> 18#include <linux/spinlock.h>
18#include <asm/atomic.h> 19#include <asm/atomic.h>
19 20
@@ -28,8 +29,10 @@ struct mnt_namespace;
28#define MNT_NOATIME 0x08 29#define MNT_NOATIME 0x08
29#define MNT_NODIRATIME 0x10 30#define MNT_NODIRATIME 0x10
30#define MNT_RELATIME 0x20 31#define MNT_RELATIME 0x20
32#define MNT_READONLY 0x40 /* does the user want this to be r/o? */
31 33
32#define MNT_SHRINKABLE 0x100 34#define MNT_SHRINKABLE 0x100
35#define MNT_IMBALANCED_WRITE_COUNT 0x200 /* just for debugging */
33 36
34#define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */ 37#define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */
35#define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */ 38#define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */
@@ -62,6 +65,11 @@ struct vfsmount {
62 int mnt_expiry_mark; /* true if marked for expiry */ 65 int mnt_expiry_mark; /* true if marked for expiry */
63 int mnt_pinned; 66 int mnt_pinned;
64 int mnt_ghosts; 67 int mnt_ghosts;
68 /*
69 * This value is not stable unless all of the mnt_writers[] spinlocks
70 * are held, and all mnt_writer[]s on this mount have 0 as their ->count
71 */
72 atomic_t __mnt_writers;
65}; 73};
66 74
67static inline struct vfsmount *mntget(struct vfsmount *mnt) 75static inline struct vfsmount *mntget(struct vfsmount *mnt)
@@ -71,9 +79,12 @@ static inline struct vfsmount *mntget(struct vfsmount *mnt)
71 return mnt; 79 return mnt;
72} 80}
73 81
82extern int mnt_want_write(struct vfsmount *mnt);
83extern void mnt_drop_write(struct vfsmount *mnt);
74extern void mntput_no_expire(struct vfsmount *mnt); 84extern void mntput_no_expire(struct vfsmount *mnt);
75extern void mnt_pin(struct vfsmount *mnt); 85extern void mnt_pin(struct vfsmount *mnt);
76extern void mnt_unpin(struct vfsmount *mnt); 86extern void mnt_unpin(struct vfsmount *mnt);
87extern int __mnt_is_readonly(struct vfsmount *mnt);
77 88
78static inline void mntput(struct vfsmount *mnt) 89static inline void mntput(struct vfsmount *mnt)
79{ 90{
diff --git a/include/linux/of.h b/include/linux/of.h
index 6981016dcc25..59a61bdc98b6 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -62,6 +62,7 @@ extern struct property *of_find_property(const struct device_node *np,
62 int *lenp); 62 int *lenp);
63extern int of_device_is_compatible(const struct device_node *device, 63extern int of_device_is_compatible(const struct device_node *device,
64 const char *); 64 const char *);
65extern int of_device_is_available(const struct device_node *device);
65extern const void *of_get_property(const struct device_node *node, 66extern const void *of_get_property(const struct device_node *node,
66 const char *name, 67 const char *name,
67 int *lenp); 68 int *lenp);
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
new file mode 100644
index 000000000000..2ee97e9877a7
--- /dev/null
+++ b/include/linux/of_gpio.h
@@ -0,0 +1,69 @@
1/*
2 * OF helpers for the GPIO API
3 *
4 * Copyright (c) 2007-2008 MontaVista Software, Inc.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13
14#ifndef __LINUX_OF_GPIO_H
15#define __LINUX_OF_GPIO_H
16
17#include <linux/errno.h>
18#include <asm/gpio.h>
19
20#ifdef CONFIG_OF_GPIO
21
22/*
23 * Generic OF GPIO chip
24 */
25struct of_gpio_chip {
26 struct gpio_chip gc;
27 int gpio_cells;
28 int (*xlate)(struct of_gpio_chip *of_gc, struct device_node *np,
29 const void *gpio_spec);
30};
31
32static inline struct of_gpio_chip *to_of_gpio_chip(struct gpio_chip *gc)
33{
34 return container_of(gc, struct of_gpio_chip, gc);
35}
36
37/*
38 * OF GPIO chip for memory mapped banks
39 */
40struct of_mm_gpio_chip {
41 struct of_gpio_chip of_gc;
42 void (*save_regs)(struct of_mm_gpio_chip *mm_gc);
43 void __iomem *regs;
44};
45
46static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc)
47{
48 struct of_gpio_chip *of_gc = to_of_gpio_chip(gc);
49
50 return container_of(of_gc, struct of_mm_gpio_chip, of_gc);
51}
52
53extern int of_get_gpio(struct device_node *np, int index);
54extern int of_mm_gpiochip_add(struct device_node *np,
55 struct of_mm_gpio_chip *mm_gc);
56extern int of_gpio_simple_xlate(struct of_gpio_chip *of_gc,
57 struct device_node *np,
58 const void *gpio_spec);
59#else
60
61/* Drivers may not strictly depend on the GPIO support, so let them link. */
62static inline int of_get_gpio(struct device_node *np, int index)
63{
64 return -ENOSYS;
65}
66
67#endif /* CONFIG_OF_GPIO */
68
69#endif /* __LINUX_OF_GPIO_H */
diff --git a/include/linux/of_i2c.h b/include/linux/of_i2c.h
new file mode 100644
index 000000000000..2e5a96732042
--- /dev/null
+++ b/include/linux/of_i2c.h
@@ -0,0 +1,24 @@
1/*
2 * Generic I2C API implementation for PowerPC.
3 *
4 * Copyright (c) 2008 Jochen Friedrich <jochen@scram.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __LINUX_OF_I2C_H
13#define __LINUX_OF_I2C_H
14
15#include <linux/i2c.h>
16
17#ifdef CONFIG_OF_I2C
18
19void of_register_i2c_devices(struct i2c_adapter *adap,
20 struct device_node *adap_node);
21
22#endif /* CONFIG_OF_I2C */
23
24#endif /* __LINUX_OF_I2C_H */
diff --git a/include/linux/parport.h b/include/linux/parport.h
index d1ad546c8c9e..dcb9e01a69ca 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -101,9 +101,9 @@ typedef enum {
101#include <linux/spinlock.h> 101#include <linux/spinlock.h>
102#include <linux/wait.h> 102#include <linux/wait.h>
103#include <linux/irqreturn.h> 103#include <linux/irqreturn.h>
104#include <linux/semaphore.h>
104#include <asm/system.h> 105#include <asm/system.h>
105#include <asm/ptrace.h> 106#include <asm/ptrace.h>
106#include <asm/semaphore.h>
107 107
108/* Define this later. */ 108/* Define this later. */
109struct parport; 109struct parport;
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
new file mode 100644
index 000000000000..a1a1e618e996
--- /dev/null
+++ b/include/linux/pci-aspm.h
@@ -0,0 +1,56 @@
1/*
2 * aspm.h
3 *
4 * PCI Express ASPM defines and function prototypes
5 *
6 * Copyright (C) 2007 Intel Corp.
7 * Zhang Yanmin (yanmin.zhang@intel.com)
8 * Shaohua Li (shaohua.li@intel.com)
9 *
10 * For more information, please consult the following manuals (look at
11 * http://www.pcisig.com/ for how to get them):
12 *
13 * PCI Express Specification
14 */
15
16#ifndef LINUX_ASPM_H
17#define LINUX_ASPM_H
18
19#include <linux/pci.h>
20
21#define PCIE_LINK_STATE_L0S 1
22#define PCIE_LINK_STATE_L1 2
23#define PCIE_LINK_STATE_CLKPM 4
24
25#ifdef CONFIG_PCIEASPM
26extern void pcie_aspm_init_link_state(struct pci_dev *pdev);
27extern void pcie_aspm_exit_link_state(struct pci_dev *pdev);
28extern void pcie_aspm_pm_state_change(struct pci_dev *pdev);
29extern void pci_disable_link_state(struct pci_dev *pdev, int state);
30#else
31static inline void pcie_aspm_init_link_state(struct pci_dev *pdev)
32{
33}
34static inline void pcie_aspm_exit_link_state(struct pci_dev *pdev)
35{
36}
37static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev)
38{
39}
40static inline void pci_disable_link_state(struct pci_dev *pdev, int state)
41{
42}
43#endif
44
45#ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */
46extern void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev);
47extern void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev);
48#else
49static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev)
50{
51}
52static inline void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev)
53{
54}
55#endif
56#endif /* LINUX_ASPM_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index ea760e519c46..292491324b01 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -20,6 +20,8 @@
20/* Include the pci register defines */ 20/* Include the pci register defines */
21#include <linux/pci_regs.h> 21#include <linux/pci_regs.h>
22 22
23struct pci_vpd;
24
23/* 25/*
24 * The PCI interface treats multi-function devices as independent 26 * The PCI interface treats multi-function devices as independent
25 * devices. The slot/function address of each device is encoded 27 * devices. The slot/function address of each device is encoded
@@ -128,11 +130,11 @@ struct pci_cap_saved_state {
128 u32 data[0]; 130 u32 data[0];
129}; 131};
130 132
133struct pcie_link_state;
131/* 134/*
132 * The pci_dev structure is used to describe PCI devices. 135 * The pci_dev structure is used to describe PCI devices.
133 */ 136 */
134struct pci_dev { 137struct pci_dev {
135 struct list_head global_list; /* node in list of all PCI devices */
136 struct list_head bus_list; /* node in per-bus list */ 138 struct list_head bus_list; /* node in per-bus list */
137 struct pci_bus *bus; /* bus this device is on */ 139 struct pci_bus *bus; /* bus this device is on */
138 struct pci_bus *subordinate; /* bus this device bridges to */ 140 struct pci_bus *subordinate; /* bus this device bridges to */
@@ -165,6 +167,10 @@ struct pci_dev {
165 this is D0-D3, D0 being fully functional, 167 this is D0-D3, D0 being fully functional,
166 and D3 being off. */ 168 and D3 being off. */
167 169
170#ifdef CONFIG_PCIEASPM
171 struct pcie_link_state *link_state; /* ASPM link state. */
172#endif
173
168 pci_channel_state_t error_state; /* current connectivity state */ 174 pci_channel_state_t error_state; /* current connectivity state */
169 struct device dev; /* Generic device interface */ 175 struct device dev; /* Generic device interface */
170 176
@@ -181,6 +187,7 @@ struct pci_dev {
181 unsigned int transparent:1; /* Transparent PCI bridge */ 187 unsigned int transparent:1; /* Transparent PCI bridge */
182 unsigned int multifunction:1;/* Part of multi-function device */ 188 unsigned int multifunction:1;/* Part of multi-function device */
183 /* keep track of device state */ 189 /* keep track of device state */
190 unsigned int is_added:1;
184 unsigned int is_busmaster:1; /* device is busmaster */ 191 unsigned int is_busmaster:1; /* device is busmaster */
185 unsigned int no_msi:1; /* device may not use msi */ 192 unsigned int no_msi:1; /* device may not use msi */
186 unsigned int no_d1d2:1; /* only allow d0 or d3 */ 193 unsigned int no_d1d2:1; /* only allow d0 or d3 */
@@ -201,11 +208,11 @@ struct pci_dev {
201#ifdef CONFIG_PCI_MSI 208#ifdef CONFIG_PCI_MSI
202 struct list_head msi_list; 209 struct list_head msi_list;
203#endif 210#endif
211 struct pci_vpd *vpd;
204}; 212};
205 213
206extern struct pci_dev *alloc_pci_dev(void); 214extern struct pci_dev *alloc_pci_dev(void);
207 215
208#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list)
209#define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list) 216#define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list)
210#define to_pci_dev(n) container_of(n, struct pci_dev, dev) 217#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
211#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) 218#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
@@ -449,7 +456,6 @@ extern struct bus_type pci_bus_type;
449/* Do NOT directly access these two variables, unless you are arch specific pci 456/* Do NOT directly access these two variables, unless you are arch specific pci
450 * code, or pci core code. */ 457 * code, or pci core code. */
451extern struct list_head pci_root_buses; /* list of all known PCI buses */ 458extern struct list_head pci_root_buses; /* list of all known PCI buses */
452extern struct list_head pci_devices; /* list of all devices */
453/* Some device drivers need know if pci is initiated */ 459/* Some device drivers need know if pci is initiated */
454extern int no_pci_devices(void); 460extern int no_pci_devices(void);
455 461
@@ -517,17 +523,13 @@ struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
517 523
518struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, 524struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
519 struct pci_dev *from); 525 struct pci_dev *from);
520struct pci_dev *pci_get_device_reverse(unsigned int vendor, unsigned int device,
521 struct pci_dev *from);
522
523struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, 526struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
524 unsigned int ss_vendor, unsigned int ss_device, 527 unsigned int ss_vendor, unsigned int ss_device,
525 struct pci_dev *from); 528 const struct pci_dev *from);
526struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); 529struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn);
527struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); 530struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn);
528struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); 531struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from);
529int pci_dev_present(const struct pci_device_id *ids); 532int pci_dev_present(const struct pci_device_id *ids);
530const struct pci_device_id *pci_find_present(const struct pci_device_id *ids);
531 533
532int pci_bus_read_config_byte(struct pci_bus *bus, unsigned int devfn, 534int pci_bus_read_config_byte(struct pci_bus *bus, unsigned int devfn,
533 int where, u8 *val); 535 int where, u8 *val);
@@ -601,7 +603,6 @@ int pcie_get_readrq(struct pci_dev *dev);
601int pcie_set_readrq(struct pci_dev *dev, int rq); 603int pcie_set_readrq(struct pci_dev *dev, int rq);
602void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); 604void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
603int __must_check pci_assign_resource(struct pci_dev *dev, int i); 605int __must_check pci_assign_resource(struct pci_dev *dev, int i);
604int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i);
605int pci_select_bars(struct pci_dev *dev, unsigned long flags); 606int pci_select_bars(struct pci_dev *dev, unsigned long flags);
606 607
607/* ROM control related routines */ 608/* ROM control related routines */
@@ -626,6 +627,7 @@ int pci_claim_resource(struct pci_dev *, int);
626void pci_assign_unassigned_resources(void); 627void pci_assign_unassigned_resources(void);
627void pdev_enable_device(struct pci_dev *); 628void pdev_enable_device(struct pci_dev *);
628void pdev_sort_resources(struct pci_dev *, struct resource_list *); 629void pdev_sort_resources(struct pci_dev *, struct resource_list *);
630int pci_enable_resources(struct pci_dev *, int mask);
629void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), 631void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
630 int (*)(struct pci_dev *, u8, u8)); 632 int (*)(struct pci_dev *, u8, u8));
631#define HAVE_PCI_REQ_REGIONS 2 633#define HAVE_PCI_REQ_REGIONS 2
@@ -793,18 +795,11 @@ static inline struct pci_dev *pci_get_device(unsigned int vendor,
793 return NULL; 795 return NULL;
794} 796}
795 797
796static inline struct pci_dev *pci_get_device_reverse(unsigned int vendor,
797 unsigned int device,
798 struct pci_dev *from)
799{
800 return NULL;
801}
802
803static inline struct pci_dev *pci_get_subsys(unsigned int vendor, 798static inline struct pci_dev *pci_get_subsys(unsigned int vendor,
804 unsigned int device, 799 unsigned int device,
805 unsigned int ss_vendor, 800 unsigned int ss_vendor,
806 unsigned int ss_device, 801 unsigned int ss_device,
807 struct pci_dev *from) 802 const struct pci_dev *from)
808{ 803{
809 return NULL; 804 return NULL;
810} 805}
@@ -817,7 +812,6 @@ static inline struct pci_dev *pci_get_class(unsigned int class,
817 812
818#define pci_dev_present(ids) (0) 813#define pci_dev_present(ids) (0)
819#define no_pci_devices() (1) 814#define no_pci_devices() (1)
820#define pci_find_present(ids) (NULL)
821#define pci_dev_put(dev) do { } while (0) 815#define pci_dev_put(dev) do { } while (0)
822 816
823static inline void pci_set_master(struct pci_dev *dev) 817static inline void pci_set_master(struct pci_dev *dev)
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index c1914a8b94a9..c0c1223c9194 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -395,9 +395,17 @@
395#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */ 395#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */
396#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ 396#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */
397#define PCI_EXP_LNKCAP 12 /* Link Capabilities */ 397#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
398#define PCI_EXP_LNKCAP_ASPMS 0xc00 /* ASPM Support */
399#define PCI_EXP_LNKCAP_L0SEL 0x7000 /* L0s Exit Latency */
400#define PCI_EXP_LNKCAP_L1EL 0x38000 /* L1 Exit Latency */
401#define PCI_EXP_LNKCAP_CLKPM 0x40000 /* L1 Clock Power Management */
398#define PCI_EXP_LNKCTL 16 /* Link Control */ 402#define PCI_EXP_LNKCTL 16 /* Link Control */
403#define PCI_EXP_LNKCTL_RL 0x20 /* Retrain Link */
404#define PCI_EXP_LNKCTL_CCC 0x40 /* Common Clock COnfiguration */
399#define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */ 405#define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */
400#define PCI_EXP_LNKSTA 18 /* Link Status */ 406#define PCI_EXP_LNKSTA 18 /* Link Status */
407#define PCI_EXP_LNKSTA_LT 0x800 /* Link Training */
408#define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */
401#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ 409#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
402#define PCI_EXP_SLTCTL 24 /* Slot Control */ 410#define PCI_EXP_SLTCTL 24 /* Slot Control */
403#define PCI_EXP_SLTSTA 26 /* Slot Status */ 411#define PCI_EXP_SLTSTA 26 /* Slot Status */
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 015b735811b4..1de72cbbe0d1 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -183,8 +183,9 @@ typedef struct pm_message {
183struct dev_pm_info { 183struct dev_pm_info {
184 pm_message_t power_state; 184 pm_message_t power_state;
185 unsigned can_wakeup:1; 185 unsigned can_wakeup:1;
186#ifdef CONFIG_PM_SLEEP
187 unsigned should_wakeup:1; 186 unsigned should_wakeup:1;
187 bool sleeping:1; /* Owned by the PM core */
188#ifdef CONFIG_PM_SLEEP
188 struct list_head entry; 189 struct list_head entry;
189#endif 190#endif
190}; 191};
@@ -197,11 +198,6 @@ extern void device_resume(void);
197extern int device_suspend(pm_message_t state); 198extern int device_suspend(pm_message_t state);
198extern int device_prepare_suspend(pm_message_t state); 199extern int device_prepare_suspend(pm_message_t state);
199 200
200#define device_set_wakeup_enable(dev,val) \
201 ((dev)->power.should_wakeup = !!(val))
202#define device_may_wakeup(dev) \
203 (device_can_wakeup(dev) && (dev)->power.should_wakeup)
204
205extern void __suspend_report_result(const char *function, void *fn, int ret); 201extern void __suspend_report_result(const char *function, void *fn, int ret);
206 202
207#define suspend_report_result(fn, ret) \ 203#define suspend_report_result(fn, ret) \
@@ -209,20 +205,6 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
209 __suspend_report_result(__FUNCTION__, fn, ret); \ 205 __suspend_report_result(__FUNCTION__, fn, ret); \
210 } while (0) 206 } while (0)
211 207
212/*
213 * Platform hook to activate device wakeup capability, if that's not already
214 * handled by enable_irq_wake() etc.
215 * Returns zero on success, else negative errno
216 */
217extern int (*platform_enable_wakeup)(struct device *dev, int is_on);
218
219static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
220{
221 if (platform_enable_wakeup)
222 return (*platform_enable_wakeup)(dev, is_on);
223 return 0;
224}
225
226#else /* !CONFIG_PM_SLEEP */ 208#else /* !CONFIG_PM_SLEEP */
227 209
228static inline int device_suspend(pm_message_t state) 210static inline int device_suspend(pm_message_t state)
@@ -230,29 +212,10 @@ static inline int device_suspend(pm_message_t state)
230 return 0; 212 return 0;
231} 213}
232 214
233#define device_set_wakeup_enable(dev,val) do{}while(0) 215#define suspend_report_result(fn, ret) do {} while (0)
234#define device_may_wakeup(dev) (0)
235
236#define suspend_report_result(fn, ret) do { } while (0)
237
238static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
239{
240 return 0;
241}
242 216
243#endif /* !CONFIG_PM_SLEEP */ 217#endif /* !CONFIG_PM_SLEEP */
244 218
245/* changes to device_may_wakeup take effect on the next pm state change.
246 * by default, devices should wakeup if they can.
247 */
248#define device_can_wakeup(dev) \
249 ((dev)->power.can_wakeup)
250#define device_init_wakeup(dev,val) \
251 do { \
252 device_can_wakeup(dev) = !!(val); \
253 device_set_wakeup_enable(dev,val); \
254 } while(0)
255
256/* 219/*
257 * Global Power Management flags 220 * Global Power Management flags
258 * Used to keep APM and ACPI from both being active 221 * Used to keep APM and ACPI from both being active
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
new file mode 100644
index 000000000000..f0d0b2cb8d20
--- /dev/null
+++ b/include/linux/pm_wakeup.h
@@ -0,0 +1,90 @@
1/*
2 * pm_wakeup.h - Power management wakeup interface
3 *
4 * Copyright (C) 2008 Alan Stern
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef _LINUX_PM_WAKEUP_H
22#define _LINUX_PM_WAKEUP_H
23
24#ifndef _DEVICE_H_
25# error "please don't include this file directly"
26#endif
27
28#ifdef CONFIG_PM
29
30/* changes to device_may_wakeup take effect on the next pm state change.
31 * by default, devices should wakeup if they can.
32 */
33static inline void device_init_wakeup(struct device *dev, int val)
34{
35 dev->power.can_wakeup = dev->power.should_wakeup = !!val;
36}
37
38static inline int device_can_wakeup(struct device *dev)
39{
40 return dev->power.can_wakeup;
41}
42
43static inline void device_set_wakeup_enable(struct device *dev, int val)
44{
45 dev->power.should_wakeup = !!val;
46}
47
48static inline int device_may_wakeup(struct device *dev)
49{
50 return dev->power.can_wakeup & dev->power.should_wakeup;
51}
52
53/*
54 * Platform hook to activate device wakeup capability, if that's not already
55 * handled by enable_irq_wake() etc.
56 * Returns zero on success, else negative errno
57 */
58extern int (*platform_enable_wakeup)(struct device *dev, int is_on);
59
60static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
61{
62 if (platform_enable_wakeup)
63 return (*platform_enable_wakeup)(dev, is_on);
64 return 0;
65}
66
67#else /* !CONFIG_PM */
68
69/* For some reason the next two routines work even without CONFIG_PM */
70static inline void device_init_wakeup(struct device *dev, int val)
71{
72 dev->power.can_wakeup = !!val;
73}
74
75static inline int device_can_wakeup(struct device *dev)
76{
77 return dev->power.can_wakeup;
78}
79
80#define device_set_wakeup_enable(dev, val) do {} while (0)
81#define device_may_wakeup(dev) 0
82
83static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
84{
85 return 0;
86}
87
88#endif /* !CONFIG_PM */
89
90#endif /* _LINUX_PM_WAKEUP_H */
diff --git a/include/linux/prctl.h b/include/linux/prctl.h
index 3800639775ae..5c80b1939636 100644
--- a/include/linux/prctl.h
+++ b/include/linux/prctl.h
@@ -67,4 +67,10 @@
67#define PR_CAPBSET_READ 23 67#define PR_CAPBSET_READ 23
68#define PR_CAPBSET_DROP 24 68#define PR_CAPBSET_DROP 24
69 69
70/* Get/set the process' ability to use the timestamp counter instruction */
71#define PR_GET_TSC 25
72#define PR_SET_TSC 26
73# define PR_TSC_ENABLE 1 /* allow the use of the timestamp counter */
74# define PR_TSC_SIGSEGV 2 /* throw a SIGSEGV instead of reading the TSC */
75
70#endif /* _LINUX_PRCTL_H */ 76#endif /* _LINUX_PRCTL_H */
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h
index fbaeda79b2e9..8ab630b67fcc 100644
--- a/include/linux/raid/md.h
+++ b/include/linux/raid/md.h
@@ -19,7 +19,6 @@
19#define _MD_H 19#define _MD_H
20 20
21#include <linux/blkdev.h> 21#include <linux/blkdev.h>
22#include <asm/semaphore.h>
23#include <linux/major.h> 22#include <linux/major.h>
24#include <linux/ioctl.h> 23#include <linux/ioctl.h>
25#include <linux/types.h> 24#include <linux/types.h>
diff --git a/include/linux/raid_class.h b/include/linux/raid_class.h
index d22ad392242a..6b537f1ac96c 100644
--- a/include/linux/raid_class.h
+++ b/include/linux/raid_class.h
@@ -53,20 +53,20 @@ struct raid_data {
53#define DEFINE_RAID_ATTRIBUTE(type, attr) \ 53#define DEFINE_RAID_ATTRIBUTE(type, attr) \
54static inline void \ 54static inline void \
55raid_set_##attr(struct raid_template *r, struct device *dev, type value) { \ 55raid_set_##attr(struct raid_template *r, struct device *dev, type value) { \
56 struct class_device *cdev = \ 56 struct device *device = \
57 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\ 57 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
58 struct raid_data *rd; \ 58 struct raid_data *rd; \
59 BUG_ON(!cdev); \ 59 BUG_ON(!device); \
60 rd = class_get_devdata(cdev); \ 60 rd = dev_get_drvdata(device); \
61 rd->attr = value; \ 61 rd->attr = value; \
62} \ 62} \
63static inline type \ 63static inline type \
64raid_get_##attr(struct raid_template *r, struct device *dev) { \ 64raid_get_##attr(struct raid_template *r, struct device *dev) { \
65 struct class_device *cdev = \ 65 struct device *device = \
66 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\ 66 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
67 struct raid_data *rd; \ 67 struct raid_data *rd; \
68 BUG_ON(!cdev); \ 68 BUG_ON(!device); \
69 rd = class_get_devdata(cdev); \ 69 rd = dev_get_drvdata(device); \
70 return rd->attr; \ 70 return rd->attr; \
71} 71}
72 72
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6a1e7afb099b..311380e5fe89 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -61,7 +61,6 @@ struct sched_param {
61#include <linux/mm_types.h> 61#include <linux/mm_types.h>
62 62
63#include <asm/system.h> 63#include <asm/system.h>
64#include <asm/semaphore.h>
65#include <asm/page.h> 64#include <asm/page.h>
66#include <asm/ptrace.h> 65#include <asm/ptrace.h>
67#include <asm/cputime.h> 66#include <asm/cputime.h>
@@ -704,6 +703,7 @@ enum cpu_idle_type {
704#define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ 703#define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */
705#define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */ 704#define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */
706#define SD_SERIALIZE 1024 /* Only a single load balancing instance */ 705#define SD_SERIALIZE 1024 /* Only a single load balancing instance */
706#define SD_WAKE_IDLE_FAR 2048 /* Gain latency sacrificing cache hit */
707 707
708#define BALANCE_FOR_MC_POWER \ 708#define BALANCE_FOR_MC_POWER \
709 (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0) 709 (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0)
@@ -733,12 +733,31 @@ struct sched_group {
733 u32 reciprocal_cpu_power; 733 u32 reciprocal_cpu_power;
734}; 734};
735 735
736enum sched_domain_level {
737 SD_LV_NONE = 0,
738 SD_LV_SIBLING,
739 SD_LV_MC,
740 SD_LV_CPU,
741 SD_LV_NODE,
742 SD_LV_ALLNODES,
743 SD_LV_MAX
744};
745
746struct sched_domain_attr {
747 int relax_domain_level;
748};
749
750#define SD_ATTR_INIT (struct sched_domain_attr) { \
751 .relax_domain_level = -1, \
752}
753
736struct sched_domain { 754struct sched_domain {
737 /* These fields must be setup */ 755 /* These fields must be setup */
738 struct sched_domain *parent; /* top domain must be null terminated */ 756 struct sched_domain *parent; /* top domain must be null terminated */
739 struct sched_domain *child; /* bottom domain must be null terminated */ 757 struct sched_domain *child; /* bottom domain must be null terminated */
740 struct sched_group *groups; /* the balancing groups of the domain */ 758 struct sched_group *groups; /* the balancing groups of the domain */
741 cpumask_t span; /* span of all CPUs in this domain */ 759 cpumask_t span; /* span of all CPUs in this domain */
760 int first_cpu; /* cache of the first cpu in this domain */
742 unsigned long min_interval; /* Minimum balance interval ms */ 761 unsigned long min_interval; /* Minimum balance interval ms */
743 unsigned long max_interval; /* Maximum balance interval ms */ 762 unsigned long max_interval; /* Maximum balance interval ms */
744 unsigned int busy_factor; /* less balancing by factor if busy */ 763 unsigned int busy_factor; /* less balancing by factor if busy */
@@ -750,6 +769,7 @@ struct sched_domain {
750 unsigned int wake_idx; 769 unsigned int wake_idx;
751 unsigned int forkexec_idx; 770 unsigned int forkexec_idx;
752 int flags; /* See SD_* */ 771 int flags; /* See SD_* */
772 enum sched_domain_level level;
753 773
754 /* Runtime fields. */ 774 /* Runtime fields. */
755 unsigned long last_balance; /* init to jiffies. units in jiffies */ 775 unsigned long last_balance; /* init to jiffies. units in jiffies */
@@ -789,7 +809,8 @@ struct sched_domain {
789#endif 809#endif
790}; 810};
791 811
792extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new); 812extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new,
813 struct sched_domain_attr *dattr_new);
793extern int arch_reinit_sched_domains(void); 814extern int arch_reinit_sched_domains(void);
794 815
795#endif /* CONFIG_SMP */ 816#endif /* CONFIG_SMP */
@@ -889,7 +910,8 @@ struct sched_class {
889 void (*set_curr_task) (struct rq *rq); 910 void (*set_curr_task) (struct rq *rq);
890 void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); 911 void (*task_tick) (struct rq *rq, struct task_struct *p, int queued);
891 void (*task_new) (struct rq *rq, struct task_struct *p); 912 void (*task_new) (struct rq *rq, struct task_struct *p);
892 void (*set_cpus_allowed)(struct task_struct *p, cpumask_t *newmask); 913 void (*set_cpus_allowed)(struct task_struct *p,
914 const cpumask_t *newmask);
893 915
894 void (*join_domain)(struct rq *rq); 916 void (*join_domain)(struct rq *rq);
895 void (*leave_domain)(struct rq *rq); 917 void (*leave_domain)(struct rq *rq);
@@ -923,6 +945,7 @@ struct load_weight {
923struct sched_entity { 945struct sched_entity {
924 struct load_weight load; /* for load-balancing */ 946 struct load_weight load; /* for load-balancing */
925 struct rb_node run_node; 947 struct rb_node run_node;
948 struct list_head group_node;
926 unsigned int on_rq; 949 unsigned int on_rq;
927 950
928 u64 exec_start; 951 u64 exec_start;
@@ -982,6 +1005,7 @@ struct sched_rt_entity {
982 unsigned long timeout; 1005 unsigned long timeout;
983 int nr_cpus_allowed; 1006 int nr_cpus_allowed;
984 1007
1008 struct sched_rt_entity *back;
985#ifdef CONFIG_RT_GROUP_SCHED 1009#ifdef CONFIG_RT_GROUP_SCHED
986 struct sched_rt_entity *parent; 1010 struct sched_rt_entity *parent;
987 /* rq on which this entity is (to be) queued: */ 1011 /* rq on which this entity is (to be) queued: */
@@ -1502,15 +1526,21 @@ static inline void put_task_struct(struct task_struct *t)
1502#define used_math() tsk_used_math(current) 1526#define used_math() tsk_used_math(current)
1503 1527
1504#ifdef CONFIG_SMP 1528#ifdef CONFIG_SMP
1505extern int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask); 1529extern int set_cpus_allowed_ptr(struct task_struct *p,
1530 const cpumask_t *new_mask);
1506#else 1531#else
1507static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) 1532static inline int set_cpus_allowed_ptr(struct task_struct *p,
1533 const cpumask_t *new_mask)
1508{ 1534{
1509 if (!cpu_isset(0, new_mask)) 1535 if (!cpu_isset(0, *new_mask))
1510 return -EINVAL; 1536 return -EINVAL;
1511 return 0; 1537 return 0;
1512} 1538}
1513#endif 1539#endif
1540static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
1541{
1542 return set_cpus_allowed_ptr(p, &new_mask);
1543}
1514 1544
1515extern unsigned long long sched_clock(void); 1545extern unsigned long long sched_clock(void);
1516 1546
@@ -1551,7 +1581,6 @@ static inline void wake_up_idle_cpu(int cpu) { }
1551extern unsigned int sysctl_sched_latency; 1581extern unsigned int sysctl_sched_latency;
1552extern unsigned int sysctl_sched_min_granularity; 1582extern unsigned int sysctl_sched_min_granularity;
1553extern unsigned int sysctl_sched_wakeup_granularity; 1583extern unsigned int sysctl_sched_wakeup_granularity;
1554extern unsigned int sysctl_sched_batch_wakeup_granularity;
1555extern unsigned int sysctl_sched_child_runs_first; 1584extern unsigned int sysctl_sched_child_runs_first;
1556extern unsigned int sysctl_sched_features; 1585extern unsigned int sysctl_sched_features;
1557extern unsigned int sysctl_sched_migration_cost; 1586extern unsigned int sysctl_sched_migration_cost;
@@ -1564,6 +1593,10 @@ int sched_nr_latency_handler(struct ctl_table *table, int write,
1564extern unsigned int sysctl_sched_rt_period; 1593extern unsigned int sysctl_sched_rt_period;
1565extern int sysctl_sched_rt_runtime; 1594extern int sysctl_sched_rt_runtime;
1566 1595
1596int sched_rt_handler(struct ctl_table *table, int write,
1597 struct file *filp, void __user *buffer, size_t *lenp,
1598 loff_t *ppos);
1599
1567extern unsigned int sysctl_sched_compat_yield; 1600extern unsigned int sysctl_sched_compat_yield;
1568 1601
1569#ifdef CONFIG_RT_MUTEXES 1602#ifdef CONFIG_RT_MUTEXES
@@ -2031,7 +2064,7 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm)
2031} 2064}
2032#endif 2065#endif
2033 2066
2034extern long sched_setaffinity(pid_t pid, cpumask_t new_mask); 2067extern long sched_setaffinity(pid_t pid, const cpumask_t *new_mask);
2035extern long sched_getaffinity(pid_t pid, cpumask_t *mask); 2068extern long sched_getaffinity(pid_t pid, cpumask_t *mask);
2036 2069
2037extern int sched_mc_power_savings, sched_smt_power_savings; 2070extern int sched_mc_power_savings, sched_smt_power_savings;
@@ -2041,8 +2074,11 @@ extern void normalize_rt_tasks(void);
2041#ifdef CONFIG_GROUP_SCHED 2074#ifdef CONFIG_GROUP_SCHED
2042 2075
2043extern struct task_group init_task_group; 2076extern struct task_group init_task_group;
2077#ifdef CONFIG_USER_SCHED
2078extern struct task_group root_task_group;
2079#endif
2044 2080
2045extern struct task_group *sched_create_group(void); 2081extern struct task_group *sched_create_group(struct task_group *parent);
2046extern void sched_destroy_group(struct task_group *tg); 2082extern void sched_destroy_group(struct task_group *tg);
2047extern void sched_move_task(struct task_struct *tsk); 2083extern void sched_move_task(struct task_struct *tsk);
2048#ifdef CONFIG_FAIR_GROUP_SCHED 2084#ifdef CONFIG_FAIR_GROUP_SCHED
@@ -2053,6 +2089,9 @@ extern unsigned long sched_group_shares(struct task_group *tg);
2053extern int sched_group_set_rt_runtime(struct task_group *tg, 2089extern int sched_group_set_rt_runtime(struct task_group *tg,
2054 long rt_runtime_us); 2090 long rt_runtime_us);
2055extern long sched_group_rt_runtime(struct task_group *tg); 2091extern long sched_group_rt_runtime(struct task_group *tg);
2092extern int sched_group_set_rt_period(struct task_group *tg,
2093 long rt_period_us);
2094extern long sched_group_rt_period(struct task_group *tg);
2056#endif 2095#endif
2057#endif 2096#endif
2058 2097
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 11fd9f2c4093..299ec4b31412 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -242,6 +242,7 @@ typedef unsigned char *sk_buff_data_t;
242 * @queue_mapping: Queue mapping for multiqueue devices 242 * @queue_mapping: Queue mapping for multiqueue devices
243 * @tc_index: Traffic control index 243 * @tc_index: Traffic control index
244 * @tc_verd: traffic control verdict 244 * @tc_verd: traffic control verdict
245 * @ndisc_nodetype: router type (from link layer)
245 * @dma_cookie: a cookie to one of several possible DMA operations 246 * @dma_cookie: a cookie to one of several possible DMA operations
246 * done by skb DMA functions 247 * done by skb DMA functions
247 * @secmark: security marking 248 * @secmark: security marking
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 4c2577bd1c85..8df6d1382ac8 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -60,7 +60,6 @@ struct getcpu_cache;
60#include <linux/capability.h> 60#include <linux/capability.h>
61#include <linux/list.h> 61#include <linux/list.h>
62#include <linux/sem.h> 62#include <linux/sem.h>
63#include <asm/semaphore.h>
64#include <asm/siginfo.h> 63#include <asm/siginfo.h>
65#include <asm/signal.h> 64#include <asm/signal.h>
66#include <linux/quota.h> 65#include <linux/quota.h>
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index f752e73bf977..f2767bc6b735 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -45,12 +45,16 @@ struct sysdev_class_attribute {
45 ssize_t (*store)(struct sysdev_class *, const char *, size_t); 45 ssize_t (*store)(struct sysdev_class *, const char *, size_t);
46}; 46};
47 47
48#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ 48#define _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \
49struct sysdev_class_attribute attr_##_name = { \ 49{ \
50 .attr = {.name = __stringify(_name), .mode = _mode }, \ 50 .attr = {.name = __stringify(_name), .mode = _mode }, \
51 .show = _show, \ 51 .show = _show, \
52 .store = _store, \ 52 .store = _store, \
53}; 53}
54
55#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \
56 struct sysdev_class_attribute attr_##_name = \
57 _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store)
54 58
55 59
56extern int sysdev_class_register(struct sysdev_class *); 60extern int sysdev_class_register(struct sysdev_class *);
@@ -100,15 +104,16 @@ struct sysdev_attribute {
100}; 104};
101 105
102 106
103#define _SYSDEV_ATTR(_name,_mode,_show,_store) \ 107#define _SYSDEV_ATTR(_name, _mode, _show, _store) \
104{ \ 108{ \
105 .attr = { .name = __stringify(_name), .mode = _mode }, \ 109 .attr = { .name = __stringify(_name), .mode = _mode }, \
106 .show = _show, \ 110 .show = _show, \
107 .store = _store, \ 111 .store = _store, \
108} 112}
109 113
110#define SYSDEV_ATTR(_name,_mode,_show,_store) \ 114#define SYSDEV_ATTR(_name, _mode, _show, _store) \
111struct sysdev_attribute attr_##_name = _SYSDEV_ATTR(_name,_mode,_show,_store); 115 struct sysdev_attribute attr_##_name = \
116 _SYSDEV_ATTR(_name, _mode, _show, _store);
112 117
113extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *); 118extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
114extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *); 119extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 802710438a9e..03378e3515b3 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -131,7 +131,6 @@ static inline int sysfs_create_dir(struct kobject *kobj)
131 131
132static inline void sysfs_remove_dir(struct kobject *kobj) 132static inline void sysfs_remove_dir(struct kobject *kobj)
133{ 133{
134 ;
135} 134}
136 135
137static inline int sysfs_rename_dir(struct kobject *kobj, const char *new_name) 136static inline int sysfs_rename_dir(struct kobject *kobj, const char *new_name)
@@ -160,7 +159,6 @@ static inline int sysfs_chmod_file(struct kobject *kobj,
160static inline void sysfs_remove_file(struct kobject *kobj, 159static inline void sysfs_remove_file(struct kobject *kobj,
161 const struct attribute *attr) 160 const struct attribute *attr)
162{ 161{
163 ;
164} 162}
165 163
166static inline int sysfs_create_bin_file(struct kobject *kobj, 164static inline int sysfs_create_bin_file(struct kobject *kobj,
@@ -169,10 +167,9 @@ static inline int sysfs_create_bin_file(struct kobject *kobj,
169 return 0; 167 return 0;
170} 168}
171 169
172static inline int sysfs_remove_bin_file(struct kobject *kobj, 170static inline void sysfs_remove_bin_file(struct kobject *kobj,
173 struct bin_attribute *attr) 171 struct bin_attribute *attr)
174{ 172{
175 return 0;
176} 173}
177 174
178static inline int sysfs_create_link(struct kobject *kobj, 175static inline int sysfs_create_link(struct kobject *kobj,
@@ -183,7 +180,6 @@ static inline int sysfs_create_link(struct kobject *kobj,
183 180
184static inline void sysfs_remove_link(struct kobject *kobj, const char *name) 181static inline void sysfs_remove_link(struct kobject *kobj, const char *name)
185{ 182{
186 ;
187} 183}
188 184
189static inline int sysfs_create_group(struct kobject *kobj, 185static inline int sysfs_create_group(struct kobject *kobj,
@@ -195,7 +191,6 @@ static inline int sysfs_create_group(struct kobject *kobj,
195static inline void sysfs_remove_group(struct kobject *kobj, 191static inline void sysfs_remove_group(struct kobject *kobj,
196 const struct attribute_group *grp) 192 const struct attribute_group *grp)
197{ 193{
198 ;
199} 194}
200 195
201static inline int sysfs_add_file_to_group(struct kobject *kobj, 196static inline int sysfs_add_file_to_group(struct kobject *kobj,
diff --git a/include/linux/topology.h b/include/linux/topology.h
index bd14f8b30f09..4bb7074a2c3a 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -38,16 +38,15 @@
38#endif 38#endif
39 39
40#ifndef nr_cpus_node 40#ifndef nr_cpus_node
41#define nr_cpus_node(node) \ 41#define nr_cpus_node(node) \
42 ({ \ 42 ({ \
43 cpumask_t __tmp__; \ 43 node_to_cpumask_ptr(__tmp__, node); \
44 __tmp__ = node_to_cpumask(node); \ 44 cpus_weight(*__tmp__); \
45 cpus_weight(__tmp__); \
46 }) 45 })
47#endif 46#endif
48 47
49#define for_each_node_with_cpus(node) \ 48#define for_each_node_with_cpus(node) \
50 for_each_online_node(node) \ 49 for_each_online_node(node) \
51 if (nr_cpus_node(node)) 50 if (nr_cpus_node(node))
52 51
53void arch_update_cpu_topology(void); 52void arch_update_cpu_topology(void);
@@ -80,7 +79,9 @@ void arch_update_cpu_topology(void);
80 * by defining their own arch-specific initializer in include/asm/topology.h. 79 * by defining their own arch-specific initializer in include/asm/topology.h.
81 * A definition there will automagically override these default initializers 80 * A definition there will automagically override these default initializers
82 * and allow arch-specific performance tuning of sched_domains. 81 * and allow arch-specific performance tuning of sched_domains.
82 * (Only non-zero and non-null fields need be specified.)
83 */ 83 */
84
84#ifdef CONFIG_SCHED_SMT 85#ifdef CONFIG_SCHED_SMT
85/* MCD - Do we really need this? It is always on if CONFIG_SCHED_SMT is, 86/* MCD - Do we really need this? It is always on if CONFIG_SCHED_SMT is,
86 * so can't we drop this in favor of CONFIG_SCHED_SMT? 87 * so can't we drop this in favor of CONFIG_SCHED_SMT?
@@ -89,20 +90,10 @@ void arch_update_cpu_topology(void);
89/* Common values for SMT siblings */ 90/* Common values for SMT siblings */
90#ifndef SD_SIBLING_INIT 91#ifndef SD_SIBLING_INIT
91#define SD_SIBLING_INIT (struct sched_domain) { \ 92#define SD_SIBLING_INIT (struct sched_domain) { \
92 .span = CPU_MASK_NONE, \
93 .parent = NULL, \
94 .child = NULL, \
95 .groups = NULL, \
96 .min_interval = 1, \ 93 .min_interval = 1, \
97 .max_interval = 2, \ 94 .max_interval = 2, \
98 .busy_factor = 64, \ 95 .busy_factor = 64, \
99 .imbalance_pct = 110, \ 96 .imbalance_pct = 110, \
100 .cache_nice_tries = 0, \
101 .busy_idx = 0, \
102 .idle_idx = 0, \
103 .newidle_idx = 0, \
104 .wake_idx = 0, \
105 .forkexec_idx = 0, \
106 .flags = SD_LOAD_BALANCE \ 97 .flags = SD_LOAD_BALANCE \
107 | SD_BALANCE_NEWIDLE \ 98 | SD_BALANCE_NEWIDLE \
108 | SD_BALANCE_FORK \ 99 | SD_BALANCE_FORK \
@@ -112,7 +103,6 @@ void arch_update_cpu_topology(void);
112 | SD_SHARE_CPUPOWER, \ 103 | SD_SHARE_CPUPOWER, \
113 .last_balance = jiffies, \ 104 .last_balance = jiffies, \
114 .balance_interval = 1, \ 105 .balance_interval = 1, \
115 .nr_balance_failed = 0, \
116} 106}
117#endif 107#endif
118#endif /* CONFIG_SCHED_SMT */ 108#endif /* CONFIG_SCHED_SMT */
@@ -121,18 +111,12 @@ void arch_update_cpu_topology(void);
121/* Common values for MC siblings. for now mostly derived from SD_CPU_INIT */ 111/* Common values for MC siblings. for now mostly derived from SD_CPU_INIT */
122#ifndef SD_MC_INIT 112#ifndef SD_MC_INIT
123#define SD_MC_INIT (struct sched_domain) { \ 113#define SD_MC_INIT (struct sched_domain) { \
124 .span = CPU_MASK_NONE, \
125 .parent = NULL, \
126 .child = NULL, \
127 .groups = NULL, \
128 .min_interval = 1, \ 114 .min_interval = 1, \
129 .max_interval = 4, \ 115 .max_interval = 4, \
130 .busy_factor = 64, \ 116 .busy_factor = 64, \
131 .imbalance_pct = 125, \ 117 .imbalance_pct = 125, \
132 .cache_nice_tries = 1, \ 118 .cache_nice_tries = 1, \
133 .busy_idx = 2, \ 119 .busy_idx = 2, \
134 .idle_idx = 0, \
135 .newidle_idx = 0, \
136 .wake_idx = 1, \ 120 .wake_idx = 1, \
137 .forkexec_idx = 1, \ 121 .forkexec_idx = 1, \
138 .flags = SD_LOAD_BALANCE \ 122 .flags = SD_LOAD_BALANCE \
@@ -144,7 +128,6 @@ void arch_update_cpu_topology(void);
144 | BALANCE_FOR_MC_POWER, \ 128 | BALANCE_FOR_MC_POWER, \
145 .last_balance = jiffies, \ 129 .last_balance = jiffies, \
146 .balance_interval = 1, \ 130 .balance_interval = 1, \
147 .nr_balance_failed = 0, \
148} 131}
149#endif 132#endif
150#endif /* CONFIG_SCHED_MC */ 133#endif /* CONFIG_SCHED_MC */
@@ -152,10 +135,6 @@ void arch_update_cpu_topology(void);
152/* Common values for CPUs */ 135/* Common values for CPUs */
153#ifndef SD_CPU_INIT 136#ifndef SD_CPU_INIT
154#define SD_CPU_INIT (struct sched_domain) { \ 137#define SD_CPU_INIT (struct sched_domain) { \
155 .span = CPU_MASK_NONE, \
156 .parent = NULL, \
157 .child = NULL, \
158 .groups = NULL, \
159 .min_interval = 1, \ 138 .min_interval = 1, \
160 .max_interval = 4, \ 139 .max_interval = 4, \
161 .busy_factor = 64, \ 140 .busy_factor = 64, \
@@ -174,16 +153,11 @@ void arch_update_cpu_topology(void);
174 | BALANCE_FOR_PKG_POWER,\ 153 | BALANCE_FOR_PKG_POWER,\
175 .last_balance = jiffies, \ 154 .last_balance = jiffies, \
176 .balance_interval = 1, \ 155 .balance_interval = 1, \
177 .nr_balance_failed = 0, \
178} 156}
179#endif 157#endif
180 158
181/* sched_domains SD_ALLNODES_INIT for NUMA machines */ 159/* sched_domains SD_ALLNODES_INIT for NUMA machines */
182#define SD_ALLNODES_INIT (struct sched_domain) { \ 160#define SD_ALLNODES_INIT (struct sched_domain) { \
183 .span = CPU_MASK_NONE, \
184 .parent = NULL, \
185 .child = NULL, \
186 .groups = NULL, \
187 .min_interval = 64, \ 161 .min_interval = 64, \
188 .max_interval = 64*num_online_cpus(), \ 162 .max_interval = 64*num_online_cpus(), \
189 .busy_factor = 128, \ 163 .busy_factor = 128, \
@@ -191,14 +165,10 @@ void arch_update_cpu_topology(void);
191 .cache_nice_tries = 1, \ 165 .cache_nice_tries = 1, \
192 .busy_idx = 3, \ 166 .busy_idx = 3, \
193 .idle_idx = 3, \ 167 .idle_idx = 3, \
194 .newidle_idx = 0, /* unused */ \
195 .wake_idx = 0, /* unused */ \
196 .forkexec_idx = 0, /* unused */ \
197 .flags = SD_LOAD_BALANCE \ 168 .flags = SD_LOAD_BALANCE \
198 | SD_SERIALIZE, \ 169 | SD_SERIALIZE, \
199 .last_balance = jiffies, \ 170 .last_balance = jiffies, \
200 .balance_interval = 64, \ 171 .balance_interval = 64, \
201 .nr_balance_failed = 0, \
202} 172}
203 173
204#ifdef CONFIG_NUMA 174#ifdef CONFIG_NUMA
diff --git a/include/linux/transport_class.h b/include/linux/transport_class.h
index 6696cf79c4f7..eaec1ea9558e 100644
--- a/include/linux/transport_class.h
+++ b/include/linux/transport_class.h
@@ -17,11 +17,11 @@ struct transport_container;
17struct transport_class { 17struct transport_class {
18 struct class class; 18 struct class class;
19 int (*setup)(struct transport_container *, struct device *, 19 int (*setup)(struct transport_container *, struct device *,
20 struct class_device *); 20 struct device *);
21 int (*configure)(struct transport_container *, struct device *, 21 int (*configure)(struct transport_container *, struct device *,
22 struct class_device *); 22 struct device *);
23 int (*remove)(struct transport_container *, struct device *, 23 int (*remove)(struct transport_container *, struct device *,
24 struct class_device *); 24 struct device *);
25}; 25};
26 26
27#define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg) \ 27#define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg) \
diff --git a/include/linux/udf_fs.h b/include/linux/udf_fs.h
deleted file mode 100644
index aa88654eb76b..000000000000
--- a/include/linux/udf_fs.h
+++ /dev/null
@@ -1,51 +0,0 @@
1/*
2 * udf_fs.h
3 *
4 * PURPOSE
5 * Included by fs/filesystems.c
6 *
7 * DESCRIPTION
8 * OSTA-UDF(tm) = Optical Storage Technology Association
9 * Universal Disk Format.
10 *
11 * This code is based on version 2.50 of the UDF specification,
12 * and revision 3 of the ECMA 167 standard [equivalent to ISO 13346].
13 * http://www.osta.org/ * http://www.ecma.ch/
14 * http://www.iso.org/
15 *
16 * COPYRIGHT
17 * This file is distributed under the terms of the GNU General Public
18 * License (GPL). Copies of the GPL can be obtained from:
19 * ftp://prep.ai.mit.edu/pub/gnu/GPL
20 * Each contributing author retains all rights to their own work.
21 *
22 * (C) 1999-2004 Ben Fennema
23 * (C) 1999-2000 Stelias Computing Inc
24 *
25 * HISTORY
26 *
27 */
28
29#ifndef _UDF_FS_H
30#define _UDF_FS_H 1
31
32#define UDF_PREALLOCATE
33#define UDF_DEFAULT_PREALLOC_BLOCKS 8
34
35#undef UDFFS_DEBUG
36
37#ifdef UDFFS_DEBUG
38#define udf_debug(f, a...) \
39 do { \
40 printk (KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \
41 __FILE__, __LINE__, __FUNCTION__); \
42 printk (f, ##a); \
43 } while (0)
44#else
45#define udf_debug(f, a...) /**/
46#endif
47
48#define udf_info(f, a...) \
49 printk (KERN_INFO "UDF-fs INFO " f, ##a);
50
51#endif /* _UDF_FS_H */
diff --git a/include/linux/udf_fs_i.h b/include/linux/udf_fs_i.h
index ffaf05679ffb..3536965913b0 100644
--- a/include/linux/udf_fs_i.h
+++ b/include/linux/udf_fs_i.h
@@ -9,41 +9,10 @@
9 * ftp://prep.ai.mit.edu/pub/gnu/GPL 9 * ftp://prep.ai.mit.edu/pub/gnu/GPL
10 * Each contributing author retains all rights to their own work. 10 * Each contributing author retains all rights to their own work.
11 */ 11 */
12
13#ifndef _UDF_FS_I_H 12#ifndef _UDF_FS_I_H
14#define _UDF_FS_I_H 1 13#define _UDF_FS_I_H 1
15 14
16#ifdef __KERNEL__
17
18struct udf_inode_info
19{
20 struct timespec i_crtime;
21 /* Physical address of inode */
22 kernel_lb_addr i_location;
23 __u64 i_unique;
24 __u32 i_lenEAttr;
25 __u32 i_lenAlloc;
26 __u64 i_lenExtents;
27 __u32 i_next_alloc_block;
28 __u32 i_next_alloc_goal;
29 unsigned i_alloc_type : 3;
30 unsigned i_efe : 1;
31 unsigned i_use : 1;
32 unsigned i_strat4096 : 1;
33 unsigned reserved : 26;
34 union
35 {
36 short_ad *i_sad;
37 long_ad *i_lad;
38 __u8 *i_data;
39 } i_ext;
40 struct inode vfs_inode;
41};
42
43#endif
44
45/* exported IOCTLs, we have 'l', 0x40-0x7f */ 15/* exported IOCTLs, we have 'l', 0x40-0x7f */
46
47#define UDF_GETEASIZE _IOR('l', 0x40, int) 16#define UDF_GETEASIZE _IOR('l', 0x40, int)
48#define UDF_GETEABLOCK _IOR('l', 0x41, void *) 17#define UDF_GETEABLOCK _IOR('l', 0x41, void *)
49#define UDF_GETVOLIDENT _IOR('l', 0x42, void *) 18#define UDF_GETVOLIDENT _IOR('l', 0x42, void *)
diff --git a/include/linux/udf_fs_sb.h b/include/linux/udf_fs_sb.h
deleted file mode 100644
index 9bc47352b6b4..000000000000
--- a/include/linux/udf_fs_sb.h
+++ /dev/null
@@ -1,117 +0,0 @@
1/*
2 * udf_fs_sb.h
3 *
4 * This include file is for the Linux kernel/module.
5 *
6 * COPYRIGHT
7 * This file is distributed under the terms of the GNU General Public
8 * License (GPL). Copies of the GPL can be obtained from:
9 * ftp://prep.ai.mit.edu/pub/gnu/GPL
10 * Each contributing author retains all rights to their own work.
11 */
12
13#ifndef _UDF_FS_SB_H
14#define _UDF_FS_SB_H 1
15
16#include <linux/mutex.h>
17
18#pragma pack(1)
19
20#define UDF_MAX_BLOCK_LOADED 8
21
22#define UDF_TYPE1_MAP15 0x1511U
23#define UDF_VIRTUAL_MAP15 0x1512U
24#define UDF_VIRTUAL_MAP20 0x2012U
25#define UDF_SPARABLE_MAP15 0x1522U
26
27struct udf_sparing_data
28{
29 __u16 s_packet_len;
30 struct buffer_head *s_spar_map[4];
31};
32
33struct udf_virtual_data
34{
35 __u32 s_num_entries;
36 __u16 s_start_offset;
37};
38
39struct udf_bitmap
40{
41 __u32 s_extLength;
42 __u32 s_extPosition;
43 __u16 s_nr_groups;
44 struct buffer_head **s_block_bitmap;
45};
46
47struct udf_part_map
48{
49 union
50 {
51 struct udf_bitmap *s_bitmap;
52 struct inode *s_table;
53 } s_uspace;
54 union
55 {
56 struct udf_bitmap *s_bitmap;
57 struct inode *s_table;
58 } s_fspace;
59 __u32 s_partition_root;
60 __u32 s_partition_len;
61 __u16 s_partition_type;
62 __u16 s_partition_num;
63 union
64 {
65 struct udf_sparing_data s_sparing;
66 struct udf_virtual_data s_virtual;
67 } s_type_specific;
68 __u32 (*s_partition_func)(struct super_block *, __u32, __u16, __u32);
69 __u16 s_volumeseqnum;
70 __u16 s_partition_flags;
71};
72
73#pragma pack()
74
75struct udf_sb_info
76{
77 struct udf_part_map *s_partmaps;
78 __u8 s_volume_ident[32];
79
80 /* Overall info */
81 __u16 s_partitions;
82 __u16 s_partition;
83
84 /* Sector headers */
85 __s32 s_session;
86 __u32 s_anchor[4];
87 __u32 s_last_block;
88
89 struct buffer_head *s_lvid_bh;
90
91 /* Default permissions */
92 mode_t s_umask;
93 gid_t s_gid;
94 uid_t s_uid;
95
96 /* Root Info */
97 struct timespec s_record_time;
98
99 /* Fileset Info */
100 __u16 s_serial_number;
101
102 /* highest UDF revision we have recorded to this media */
103 __u16 s_udfrev;
104
105 /* Miscellaneous flags */
106 __u32 s_flags;
107
108 /* Encoding info */
109 struct nls_table *s_nls_map;
110
111 /* VAT inode */
112 struct inode *s_vat_inode;
113
114 struct mutex s_alloc_mutex;
115};
116
117#endif /* _UDF_FS_SB_H */
diff --git a/include/linux/usb/atmel_usba_udc.h b/include/linux/usb/atmel_usba_udc.h
new file mode 100644
index 000000000000..6311fa2d9f82
--- /dev/null
+++ b/include/linux/usb/atmel_usba_udc.h
@@ -0,0 +1,22 @@
1/*
2 * Platform data definitions for Atmel USBA gadget driver.
3 */
4#ifndef __LINUX_USB_USBA_H
5#define __LINUX_USB_USBA_H
6
7struct usba_ep_data {
8 char *name;
9 int index;
10 int fifo_size;
11 int nr_banks;
12 int can_dma;
13 int can_isoc;
14};
15
16struct usba_platform_data {
17 int vbus_pin;
18 int num_ep;
19 struct usba_ep_data ep[0];
20};
21
22#endif /* __LINUX_USB_USBA_H */
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 95bf4bac44cb..2dcbecce3f61 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1051,7 +1051,7 @@ struct ib_device {
1051 struct ib_dma_mapping_ops *dma_ops; 1051 struct ib_dma_mapping_ops *dma_ops;
1052 1052
1053 struct module *owner; 1053 struct module *owner;
1054 struct class_device class_dev; 1054 struct device dev;
1055 struct kobject *ports_parent; 1055 struct kobject *ports_parent;
1056 struct list_head port_list; 1056 struct list_head port_list;
1057 1057
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 98724ba65a79..e78d3b62d8ec 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -32,7 +32,6 @@
32#include <scsi/sas.h> 32#include <scsi/sas.h>
33#include <linux/libata.h> 33#include <linux/libata.h>
34#include <linux/list.h> 34#include <linux/list.h>
35#include <asm/semaphore.h>
36#include <scsi/scsi_device.h> 35#include <scsi/scsi_device.h>
37#include <scsi/scsi_cmnd.h> 36#include <scsi/scsi_cmnd.h>
38#include <scsi/scsi_transport_sas.h> 37#include <scsi/scsi_transport_sas.h>
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index ab7acbe80960..b8b19e2f57bb 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -156,8 +156,8 @@ struct scsi_device {
156 156
157 int timeout; 157 int timeout;
158 158
159 struct device sdev_gendev; 159 struct device sdev_gendev,
160 struct class_device sdev_classdev; 160 sdev_dev;
161 161
162 struct execute_work ew; /* used to get process context on put */ 162 struct execute_work ew; /* used to get process context on put */
163 163
@@ -167,9 +167,9 @@ struct scsi_device {
167#define to_scsi_device(d) \ 167#define to_scsi_device(d) \
168 container_of(d, struct scsi_device, sdev_gendev) 168 container_of(d, struct scsi_device, sdev_gendev)
169#define class_to_sdev(d) \ 169#define class_to_sdev(d) \
170 container_of(d, struct scsi_device, sdev_classdev) 170 container_of(d, struct scsi_device, sdev_dev)
171#define transport_class_to_sdev(class_dev) \ 171#define transport_class_to_sdev(class_dev) \
172 to_scsi_device(class_dev->dev) 172 to_scsi_device(class_dev->parent)
173 173
174#define sdev_printk(prefix, sdev, fmt, a...) \ 174#define sdev_printk(prefix, sdev, fmt, a...) \
175 dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a) 175 dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a)
@@ -220,7 +220,7 @@ static inline struct scsi_target *scsi_target(struct scsi_device *sdev)
220 return to_scsi_target(sdev->sdev_gendev.parent); 220 return to_scsi_target(sdev->sdev_gendev.parent);
221} 221}
222#define transport_class_to_starget(class_dev) \ 222#define transport_class_to_starget(class_dev) \
223 to_scsi_target(class_dev->dev) 223 to_scsi_target(class_dev->parent)
224 224
225#define starget_printk(prefix, starget, fmt, a...) \ 225#define starget_printk(prefix, starget, fmt, a...) \
226 dev_printk(prefix, &(starget)->dev, fmt, ##a) 226 dev_printk(prefix, &(starget)->dev, fmt, ##a)
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 49132862bfaa..d967d6dc7a28 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -470,7 +470,7 @@ struct scsi_host_template {
470 /* 470 /*
471 * Pointer to the sysfs class properties for this host, NULL terminated. 471 * Pointer to the sysfs class properties for this host, NULL terminated.
472 */ 472 */
473 struct class_device_attribute **shost_attrs; 473 struct device_attribute **shost_attrs;
474 474
475 /* 475 /*
476 * Pointer to the SCSI device properties for this host, NULL terminated. 476 * Pointer to the SCSI device properties for this host, NULL terminated.
@@ -655,8 +655,7 @@ struct Scsi_Host {
655 enum scsi_host_state shost_state; 655 enum scsi_host_state shost_state;
656 656
657 /* ldm bits */ 657 /* ldm bits */
658 struct device shost_gendev; 658 struct device shost_gendev, shost_dev;
659 struct class_device shost_classdev;
660 659
661 /* 660 /*
662 * List of hosts per template. 661 * List of hosts per template.
@@ -683,7 +682,7 @@ struct Scsi_Host {
683}; 682};
684 683
685#define class_to_shost(d) \ 684#define class_to_shost(d) \
686 container_of(d, struct Scsi_Host, shost_classdev) 685 container_of(d, struct Scsi_Host, shost_dev)
687 686
688#define shost_printk(prefix, shost, fmt, a...) \ 687#define shost_printk(prefix, shost, fmt, a...) \
689 dev_printk(prefix, &(shost)->shost_gendev, fmt, ##a) 688 dev_printk(prefix, &(shost)->shost_gendev, fmt, ##a)
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h
index 0dfef752f0e2..490bd13a634c 100644
--- a/include/scsi/scsi_transport.h
+++ b/include/scsi/scsi_transport.h
@@ -80,7 +80,7 @@ struct scsi_transport_template {
80}; 80};
81 81
82#define transport_class_to_shost(tc) \ 82#define transport_class_to_shost(tc) \
83 dev_to_shost((tc)->dev) 83 dev_to_shost((tc)->parent)
84 84
85 85
86/* Private area maintenance. The driver requested allocations come 86/* Private area maintenance. The driver requested allocations come
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 4769efd4db24..06f72bab9df0 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -163,8 +163,8 @@ enum fc_tgtid_binding_type {
163 163
164 164
165/* Macro for use in defining Virtual Port attributes */ 165/* Macro for use in defining Virtual Port attributes */
166#define FC_VPORT_ATTR(_name,_mode,_show,_store) \ 166#define FC_VPORT_ATTR(_name,_mode,_show,_store) \
167struct class_device_attribute class_device_attr_vport_##_name = \ 167struct device_attribute dev_attr_vport_##_name = \
168 __ATTR(_name,_mode,_show,_store) 168 __ATTR(_name,_mode,_show,_store)
169 169
170 170
@@ -234,8 +234,8 @@ struct fc_vport {
234 234
235#define dev_to_vport(d) \ 235#define dev_to_vport(d) \
236 container_of(d, struct fc_vport, dev) 236 container_of(d, struct fc_vport, dev)
237#define transport_class_to_vport(classdev) \ 237#define transport_class_to_vport(dev) \
238 dev_to_vport(classdev->dev) 238 dev_to_vport(dev->parent)
239#define vport_to_shost(v) \ 239#define vport_to_shost(v) \
240 (v->shost) 240 (v->shost)
241#define vport_to_shost_channel(v) \ 241#define vport_to_shost_channel(v) \
@@ -271,7 +271,7 @@ struct fc_rport_identifiers {
271 271
272/* Macro for use in defining Remote Port attributes */ 272/* Macro for use in defining Remote Port attributes */
273#define FC_RPORT_ATTR(_name,_mode,_show,_store) \ 273#define FC_RPORT_ATTR(_name,_mode,_show,_store) \
274struct class_device_attribute class_device_attr_rport_##_name = \ 274struct device_attribute dev_attr_rport_##_name = \
275 __ATTR(_name,_mode,_show,_store) 275 __ATTR(_name,_mode,_show,_store)
276 276
277 277
@@ -341,8 +341,8 @@ struct fc_rport { /* aka fc_starget_attrs */
341 341
342#define dev_to_rport(d) \ 342#define dev_to_rport(d) \
343 container_of(d, struct fc_rport, dev) 343 container_of(d, struct fc_rport, dev)
344#define transport_class_to_rport(classdev) \ 344#define transport_class_to_rport(dev) \
345 dev_to_rport(classdev->dev) 345 dev_to_rport(dev->parent)
346#define rport_to_shost(r) \ 346#define rport_to_shost(r) \
347 dev_to_shost(r->dev.parent) 347 dev_to_shost(r->dev.parent)
348 348
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 09125fa95b93..61ad3594aad6 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -80,8 +80,8 @@ struct sas_phy {
80 80
81#define dev_to_phy(d) \ 81#define dev_to_phy(d) \
82 container_of((d), struct sas_phy, dev) 82 container_of((d), struct sas_phy, dev)
83#define transport_class_to_phy(cdev) \ 83#define transport_class_to_phy(dev) \
84 dev_to_phy((cdev)->dev) 84 dev_to_phy((dev)->parent)
85#define phy_to_shost(phy) \ 85#define phy_to_shost(phy) \
86 dev_to_shost((phy)->dev.parent) 86 dev_to_shost((phy)->dev.parent)
87 87
@@ -96,8 +96,8 @@ struct sas_rphy {
96 96
97#define dev_to_rphy(d) \ 97#define dev_to_rphy(d) \
98 container_of((d), struct sas_rphy, dev) 98 container_of((d), struct sas_rphy, dev)
99#define transport_class_to_rphy(cdev) \ 99#define transport_class_to_rphy(dev) \
100 dev_to_rphy((cdev)->dev) 100 dev_to_rphy((dev)->parent)
101#define rphy_to_shost(rphy) \ 101#define rphy_to_shost(rphy) \
102 dev_to_shost((rphy)->dev.parent) 102 dev_to_shost((rphy)->dev.parent)
103#define target_to_rphy(targ) \ 103#define target_to_rphy(targ) \
@@ -152,8 +152,8 @@ struct sas_port {
152 152
153#define dev_to_sas_port(d) \ 153#define dev_to_sas_port(d) \
154 container_of((d), struct sas_port, dev) 154 container_of((d), struct sas_port, dev)
155#define transport_class_to_sas_port(cdev) \ 155#define transport_class_to_sas_port(dev) \
156 dev_to_sas_port((cdev)->dev) 156 dev_to_sas_port((dev)->parent)
157 157
158struct sas_phy_linkrates { 158struct sas_phy_linkrates {
159 enum sas_linkrate maximum_linkrate; 159 enum sas_linkrate maximum_linkrate;
diff --git a/include/scsi/sd.h b/include/scsi/sd.h
index 8ea9f7358ac1..4f032d48cb6e 100644
--- a/include/scsi/sd.h
+++ b/include/scsi/sd.h
@@ -34,7 +34,7 @@
34struct scsi_disk { 34struct scsi_disk {
35 struct scsi_driver *driver; /* always &sd_template */ 35 struct scsi_driver *driver; /* always &sd_template */
36 struct scsi_device *device; 36 struct scsi_device *device;
37 struct class_device cdev; 37 struct device dev;
38 struct gendisk *disk; 38 struct gendisk *disk;
39 unsigned int openers; /* protected by BKL for now, yuck */ 39 unsigned int openers; /* protected by BKL for now, yuck */
40 sector_t capacity; /* size in 512-byte sectors */ 40 sector_t capacity; /* size in 512-byte sectors */
@@ -46,7 +46,7 @@ struct scsi_disk {
46 unsigned RCD : 1; /* state of disk RCD bit, unused */ 46 unsigned RCD : 1; /* state of disk RCD bit, unused */
47 unsigned DPOFUA : 1; /* state of disk DPOFUA bit */ 47 unsigned DPOFUA : 1; /* state of disk DPOFUA bit */
48}; 48};
49#define to_scsi_disk(obj) container_of(obj,struct scsi_disk,cdev) 49#define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev)
50 50
51#define sd_printk(prefix, sdsk, fmt, a...) \ 51#define sd_printk(prefix, sdsk, fmt, a...) \
52 (sdsk)->disk ? \ 52 (sdsk)->disk ? \