aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-14 18:37:29 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-14 18:37:29 -0400
commit1e91adf7cb0bea07c1e2548754ca5004e8da8544 (patch)
tree0fb2566bd25adc2a6c7123d00e3c80f63aeedaa5
parentd40ce1708000fcf19c597e88c9074f442a557113 (diff)
parentddffeb8c4d0331609ef2581d84de4d763607bd37 (diff)
Merge 3.7-rc1 usb-linus
Sync up to a known-good point in Linus's tree to build on. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--.gitignore14
-rw-r--r--Documentation/crypto/asymmetric-keys.txt312
-rw-r--r--Documentation/kernel-parameters.txt6
-rw-r--r--Documentation/security/keys.txt50
-rw-r--r--Makefile10
-rw-r--r--arch/Kconfig19
-rw-r--r--arch/alpha/Kconfig2
-rw-r--r--arch/alpha/include/asm/module.h10
-rw-r--r--arch/arm/Kconfig463
-rw-r--r--arch/arm/common/Kconfig4
-rw-r--r--arch/arm/include/asm/Kbuild2
-rw-r--r--arch/arm/include/asm/hwcap.h27
-rw-r--r--arch/arm/include/asm/module.h8
-rw-r--r--arch/arm/include/asm/ptrace.h127
-rw-r--r--arch/arm/include/asm/setup.h172
-rw-r--r--arch/arm/include/asm/signal.h127
-rw-r--r--arch/arm/include/asm/swab.h37
-rw-r--r--arch/arm/include/asm/unistd.h440
-rw-r--r--arch/arm/include/uapi/asm/Kbuild16
-rw-r--r--arch/arm/include/uapi/asm/a.out.h (renamed from arch/arm/include/asm/a.out.h)0
-rw-r--r--arch/arm/include/uapi/asm/byteorder.h (renamed from arch/arm/include/asm/byteorder.h)0
-rw-r--r--arch/arm/include/uapi/asm/fcntl.h (renamed from arch/arm/include/asm/fcntl.h)0
-rw-r--r--arch/arm/include/uapi/asm/hwcap.h29
-rw-r--r--arch/arm/include/uapi/asm/ioctls.h (renamed from arch/arm/include/asm/ioctls.h)0
-rw-r--r--arch/arm/include/uapi/asm/kvm_para.h (renamed from arch/arm/include/asm/kvm_para.h)0
-rw-r--r--arch/arm/include/uapi/asm/mman.h (renamed from arch/arm/include/asm/mman.h)0
-rw-r--r--arch/arm/include/uapi/asm/posix_types.h (renamed from arch/arm/include/asm/posix_types.h)0
-rw-r--r--arch/arm/include/uapi/asm/ptrace.h138
-rw-r--r--arch/arm/include/uapi/asm/setup.h187
-rw-r--r--arch/arm/include/uapi/asm/sigcontext.h (renamed from arch/arm/include/asm/sigcontext.h)0
-rw-r--r--arch/arm/include/uapi/asm/signal.h127
-rw-r--r--arch/arm/include/uapi/asm/stat.h (renamed from arch/arm/include/asm/stat.h)0
-rw-r--r--arch/arm/include/uapi/asm/statfs.h (renamed from arch/arm/include/asm/statfs.h)0
-rw-r--r--arch/arm/include/uapi/asm/swab.h53
-rw-r--r--arch/arm/include/uapi/asm/unistd.h450
-rw-r--r--arch/arm/mach-at91/Kconfig26
-rw-r--r--arch/arm/mach-clps711x/Kconfig4
-rw-r--r--arch/arm/mach-davinci/Kconfig16
-rw-r--r--arch/arm/mach-exynos/Kconfig181
-rw-r--r--arch/arm/mach-footbridge/Kconfig2
-rw-r--r--arch/arm/mach-h720x/Kconfig2
-rw-r--r--arch/arm/mach-imx/Kconfig120
-rw-r--r--arch/arm/mach-ixp4xx/Kconfig2
-rw-r--r--arch/arm/mach-mmp/Kconfig6
-rw-r--r--arch/arm/mach-msm/Kconfig28
-rw-r--r--arch/arm/mach-nomadik/Kconfig4
-rw-r--r--arch/arm/mach-omap1/Kconfig8
-rw-r--r--arch/arm/mach-omap2/Kconfig68
-rw-r--r--arch/arm/mach-prima2/Kconfig2
-rw-r--r--arch/arm/mach-pxa/Kconfig120
-rw-r--r--arch/arm/mach-realview/Kconfig12
-rw-r--r--arch/arm/mach-s3c2412/Kconfig2
-rw-r--r--arch/arm/mach-s3c2440/Kconfig2
-rw-r--r--arch/arm/mach-s3c24xx/Kconfig82
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig96
-rw-r--r--arch/arm/mach-s5p64x0/Kconfig28
-rw-r--r--arch/arm/mach-s5pc100/Kconfig12
-rw-r--r--arch/arm/mach-s5pv210/Kconfig50
-rw-r--r--arch/arm/mach-sa1100/Kconfig12
-rw-r--r--arch/arm/mach-shmobile/Kconfig42
-rw-r--r--arch/arm/mach-tegra/Kconfig32
-rw-r--r--arch/arm/mach-u300/Kconfig2
-rw-r--r--arch/arm/mach-ux500/Kconfig16
-rw-r--r--arch/arm/mach-versatile/Kconfig4
-rw-r--r--arch/arm/mm/Kconfig106
-rw-r--r--arch/arm/plat-mxc/Kconfig4
-rw-r--r--arch/arm/plat-mxc/devices/Kconfig2
-rw-r--r--arch/arm/plat-nomadik/Kconfig2
-rw-r--r--arch/arm/plat-omap/Kconfig10
-rw-r--r--arch/arm/plat-s3c24xx/Kconfig2
-rw-r--r--arch/arm/plat-samsung/Kconfig14
-rw-r--r--arch/arm/plat-spear/Kconfig4
-rw-r--r--arch/avr32/Kconfig2
-rw-r--r--arch/avr32/include/asm/module.h6
-rw-r--r--arch/blackfin/Kconfig2
-rw-r--r--arch/blackfin/include/asm/module.h4
-rw-r--r--arch/c6x/Kconfig1
-rw-r--r--arch/c6x/include/asm/module.h12
-rw-r--r--arch/cris/Kconfig1
-rw-r--r--arch/cris/include/asm/Kbuild1
-rw-r--r--arch/cris/include/asm/module.h9
-rw-r--r--arch/frv/include/asm/module.h8
-rw-r--r--arch/h8300/Kconfig1
-rw-r--r--arch/h8300/include/asm/Kbuild1
-rw-r--r--arch/h8300/include/asm/module.h11
-rw-r--r--arch/hexagon/Kconfig1
-rw-r--r--arch/ia64/Kconfig2
-rw-r--r--arch/ia64/include/asm/module.h6
-rw-r--r--arch/m32r/Kconfig1
-rw-r--r--arch/m32r/include/asm/Kbuild1
-rw-r--r--arch/m32r/include/asm/module.h10
-rw-r--r--arch/m32r/kernel/module.c15
-rw-r--r--arch/m68k/Kconfig3
-rw-r--r--arch/m68k/include/asm/module.h6
-rw-r--r--arch/microblaze/Kconfig1
-rw-r--r--arch/mips/Kconfig17
-rw-r--r--arch/mips/alchemy/Kconfig50
-rw-r--r--arch/mips/alchemy/Platform22
-rw-r--r--arch/mips/alchemy/devboards/Makefile7
-rw-r--r--arch/mips/alchemy/devboards/db1000.c120
-rw-r--r--arch/mips/alchemy/devboards/db1200.c37
-rw-r--r--arch/mips/alchemy/devboards/db1235.c94
-rw-r--r--arch/mips/alchemy/devboards/db1300.c12
-rw-r--r--arch/mips/alchemy/devboards/db1550.c192
-rw-r--r--arch/mips/alchemy/devboards/pb1100.c167
-rw-r--r--arch/mips/alchemy/devboards/pb1500.c198
-rw-r--r--arch/mips/alchemy/devboards/pb1550.c244
-rw-r--r--arch/mips/alchemy/devboards/platform.c9
-rw-r--r--arch/mips/boot/compressed/uart-alchemy.c4
-rw-r--r--arch/mips/configs/db1200_defconfig170
-rw-r--r--arch/mips/configs/db1235_defconfig434
-rw-r--r--arch/mips/configs/db1300_defconfig391
-rw-r--r--arch/mips/configs/db1550_defconfig285
-rw-r--r--arch/mips/configs/pb1100_defconfig124
-rw-r--r--arch/mips/configs/pb1500_defconfig141
-rw-r--r--arch/mips/configs/pb1550_defconfig145
-rw-r--r--arch/mips/include/asm/Kbuild5
-rw-r--r--arch/mips/include/asm/atomic.h64
-rw-r--r--arch/mips/include/asm/cpu-features.h8
-rw-r--r--arch/mips/include/asm/cpu.h4
-rw-r--r--arch/mips/include/asm/errno.h120
-rw-r--r--arch/mips/include/asm/kspd.h4
-rw-r--r--arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h2
-rw-r--r--arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-db1x00/bcsr.h2
-rw-r--r--arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-powertv/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-rm/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-sibyte/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-tx49xx/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-yosemite/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mipsregs.h3
-rw-r--r--arch/mips/include/asm/module.h10
-rw-r--r--arch/mips/include/asm/pgtable-64.h1
-rw-r--r--arch/mips/include/asm/pmc-sierra/msp71xx/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/ptrace.h107
-rw-r--r--arch/mips/include/asm/setup.h5
-rw-r--r--arch/mips/include/asm/sigcontext.h66
-rw-r--r--arch/mips/include/asm/siginfo.h104
-rw-r--r--arch/mips/include/asm/signal.h115
-rw-r--r--arch/mips/include/asm/socket.h83
-rw-r--r--arch/mips/include/asm/termios.h73
-rw-r--r--arch/mips/include/asm/types.h16
-rw-r--r--arch/mips/include/asm/unistd.h1022
-rw-r--r--arch/mips/include/uapi/asm/Kbuild34
-rw-r--r--arch/mips/include/uapi/asm/auxvec.h (renamed from arch/mips/include/asm/auxvec.h)0
-rw-r--r--arch/mips/include/uapi/asm/bitsperlong.h (renamed from arch/mips/include/asm/bitsperlong.h)0
-rw-r--r--arch/mips/include/uapi/asm/byteorder.h (renamed from arch/mips/include/asm/byteorder.h)0
-rw-r--r--arch/mips/include/uapi/asm/cachectl.h (renamed from arch/mips/include/asm/cachectl.h)0
-rw-r--r--arch/mips/include/uapi/asm/errno.h129
-rw-r--r--arch/mips/include/uapi/asm/fcntl.h (renamed from arch/mips/include/asm/fcntl.h)0
-rw-r--r--arch/mips/include/uapi/asm/ioctl.h (renamed from arch/mips/include/asm/ioctl.h)0
-rw-r--r--arch/mips/include/uapi/asm/ioctls.h (renamed from arch/mips/include/asm/ioctls.h)0
-rw-r--r--arch/mips/include/uapi/asm/ipcbuf.h (renamed from arch/mips/include/asm/ipcbuf.h)0
-rw-r--r--arch/mips/include/uapi/asm/kvm_para.h (renamed from arch/mips/include/asm/kvm_para.h)0
-rw-r--r--arch/mips/include/uapi/asm/mman.h (renamed from arch/mips/include/asm/mman.h)0
-rw-r--r--arch/mips/include/uapi/asm/msgbuf.h (renamed from arch/mips/include/asm/msgbuf.h)0
-rw-r--r--arch/mips/include/uapi/asm/param.h (renamed from arch/mips/include/asm/param.h)0
-rw-r--r--arch/mips/include/uapi/asm/poll.h (renamed from arch/mips/include/asm/poll.h)0
-rw-r--r--arch/mips/include/uapi/asm/posix_types.h (renamed from arch/mips/include/asm/posix_types.h)0
-rw-r--r--arch/mips/include/uapi/asm/ptrace.h116
-rw-r--r--arch/mips/include/uapi/asm/resource.h (renamed from arch/mips/include/asm/resource.h)0
-rw-r--r--arch/mips/include/uapi/asm/sembuf.h (renamed from arch/mips/include/asm/sembuf.h)0
-rw-r--r--arch/mips/include/uapi/asm/setup.h7
-rw-r--r--arch/mips/include/uapi/asm/sgidefs.h (renamed from arch/mips/include/asm/sgidefs.h)0
-rw-r--r--arch/mips/include/uapi/asm/shmbuf.h (renamed from arch/mips/include/asm/shmbuf.h)0
-rw-r--r--arch/mips/include/uapi/asm/sigcontext.h78
-rw-r--r--arch/mips/include/uapi/asm/siginfo.h114
-rw-r--r--arch/mips/include/uapi/asm/signal.h123
-rw-r--r--arch/mips/include/uapi/asm/socket.h93
-rw-r--r--arch/mips/include/uapi/asm/sockios.h (renamed from arch/mips/include/asm/sockios.h)0
-rw-r--r--arch/mips/include/uapi/asm/stat.h (renamed from arch/mips/include/asm/stat.h)0
-rw-r--r--arch/mips/include/uapi/asm/statfs.h (renamed from arch/mips/include/asm/statfs.h)0
-rw-r--r--arch/mips/include/uapi/asm/swab.h (renamed from arch/mips/include/asm/swab.h)0
-rw-r--r--arch/mips/include/uapi/asm/sysmips.h (renamed from arch/mips/include/asm/sysmips.h)0
-rw-r--r--arch/mips/include/uapi/asm/termbits.h (renamed from arch/mips/include/asm/termbits.h)0
-rw-r--r--arch/mips/include/uapi/asm/termios.h80
-rw-r--r--arch/mips/include/uapi/asm/types.h27
-rw-r--r--arch/mips/include/uapi/asm/unistd.h1035
-rw-r--r--arch/mips/kernel/Makefile2
-rw-r--r--arch/mips/kernel/asm-offsets.c10
-rw-r--r--arch/mips/kernel/cpu-probe.c11
-rw-r--r--arch/mips/kernel/kspd.c423
-rw-r--r--arch/mips/kernel/module-rela.c145
-rw-r--r--arch/mips/kernel/module.c121
-rw-r--r--arch/mips/kernel/perf_event_mipsxx.c262
-rw-r--r--arch/mips/kernel/proc.c19
-rw-r--r--arch/mips/kernel/vmlinux.lds.S21
-rw-r--r--arch/mips/kernel/vpe.c24
-rw-r--r--arch/mips/mm/init.c17
-rw-r--r--arch/mips/mm/pgtable-64.c20
-rw-r--r--arch/mips/mm/tlbex.c23
-rw-r--r--arch/mips/pci/fixup-malta.c3
-rw-r--r--arch/mips/sni/a20r.c27
-rw-r--r--arch/mn10300/Kconfig1
-rw-r--r--arch/mn10300/include/asm/module.h7
-rw-r--r--arch/openrisc/Kconfig1
-rw-r--r--arch/parisc/Kconfig2
-rw-r--r--arch/parisc/include/asm/module.h16
-rw-r--r--arch/powerpc/Kconfig2
-rw-r--r--arch/powerpc/include/asm/module.h7
-rw-r--r--arch/s390/Kconfig2
-rw-r--r--arch/s390/include/asm/module.h18
-rw-r--r--arch/score/Kconfig2
-rw-r--r--arch/score/include/asm/module.h6
-rw-r--r--arch/score/kernel/module.c10
-rw-r--r--arch/sh/Kconfig2
-rw-r--r--arch/sh/include/asm/module.h14
-rw-r--r--arch/sparc/Kconfig1
-rw-r--r--arch/sparc/include/asm/Kbuild1
-rw-r--r--arch/sparc/include/asm/module.h24
-rw-r--r--arch/tile/Kconfig1
-rw-r--r--arch/unicore32/Kconfig1
-rw-r--r--arch/x86/Kconfig2
-rw-r--r--arch/x86/boot/Makefile3
-rw-r--r--arch/x86/um/Kconfig2
-rw-r--r--arch/xtensa/include/asm/module.h9
-rw-r--r--crypto/Kconfig1
-rw-r--r--crypto/Makefile1
-rw-r--r--crypto/asymmetric_keys/.gitignore1
-rw-r--r--crypto/asymmetric_keys/Kconfig38
-rw-r--r--crypto/asymmetric_keys/Makefile27
-rw-r--r--crypto/asymmetric_keys/asymmetric_keys.h15
-rw-r--r--crypto/asymmetric_keys/asymmetric_type.c274
-rw-r--r--crypto/asymmetric_keys/public_key.c108
-rw-r--r--crypto/asymmetric_keys/public_key.h30
-rw-r--r--crypto/asymmetric_keys/rsa.c277
-rw-r--r--crypto/asymmetric_keys/signature.c49
-rw-r--r--crypto/asymmetric_keys/x509.asn160
-rw-r--r--crypto/asymmetric_keys/x509_cert_parser.c496
-rw-r--r--crypto/asymmetric_keys/x509_parser.h36
-rw-r--r--crypto/asymmetric_keys/x509_public_key.c239
-rw-r--r--crypto/asymmetric_keys/x509_rsakey.asn14
-rw-r--r--fs/cifs/cifs_spnego.c6
-rw-r--r--fs/cifs/cifsacl.c8
-rw-r--r--include/asm-generic/bitops/count_zeros.h57
-rw-r--r--include/asm-generic/module.h40
-rw-r--r--include/asm-generic/vmlinux.lds.h9
-rw-r--r--include/crypto/public_key.h108
-rw-r--r--include/keys/asymmetric-parser.h37
-rw-r--r--include/keys/asymmetric-subtype.h55
-rw-r--r--include/keys/asymmetric-type.h25
-rw-r--r--include/keys/user-type.h6
-rw-r--r--include/linux/asn1.h67
-rw-r--r--include/linux/asn1_ber_bytecode.h87
-rw-r--r--include/linux/asn1_decoder.h24
-rw-r--r--include/linux/key-type.h35
-rw-r--r--include/linux/module.h8
-rw-r--r--include/linux/moduleloader.h36
-rw-r--r--include/linux/mpi.h1
-rw-r--r--include/linux/oid_registry.h92
-rw-r--r--init/Kconfig68
-rw-r--r--kernel/Makefile77
-rw-r--r--kernel/modsign_pubkey.c113
-rw-r--r--kernel/module-internal.h15
-rw-r--r--kernel/module.c157
-rw-r--r--kernel/module_signing.c243
-rw-r--r--lib/.gitignore2
-rw-r--r--lib/Kconfig5
-rw-r--r--lib/Makefile18
-rw-r--r--lib/asn1_decoder.c487
-rwxr-xr-xlib/build_OID_registry209
-rw-r--r--lib/mpi/Makefile1
-rw-r--r--lib/mpi/longlong.h138
-rw-r--r--lib/mpi/mpi-bit.c2
-rw-r--r--lib/mpi/mpi-cmp.c70
-rw-r--r--lib/mpi/mpi-pow.c4
-rw-r--r--lib/mpi/mpicoder.c55
-rw-r--r--lib/oid_registry.c170
-rw-r--r--net/ceph/crypto.c9
-rw-r--r--net/dns_resolver/dns_key.c6
-rw-r--r--net/rxrpc/ar-key.c40
-rw-r--r--scripts/.gitignore1
-rw-r--r--scripts/Makefile2
-rw-r--r--scripts/Makefile.build11
-rw-r--r--scripts/Makefile.modpost77
-rw-r--r--scripts/asn1_compiler.c1545
-rw-r--r--scripts/sign-file115
-rwxr-xr-xscripts/x509keyid268
-rw-r--r--security/keys/encrypted-keys/encrypted.c16
-rw-r--r--security/keys/key.c114
-rw-r--r--security/keys/keyctl.c18
-rw-r--r--security/keys/keyring.c6
-rw-r--r--security/keys/request_key_auth.c8
-rw-r--r--security/keys/trusted.c16
-rw-r--r--security/keys/user_defined.c14
-rw-r--r--tools/perf/Makefile4
-rw-r--r--tools/perf/perf.h2
-rw-r--r--tools/perf/util/evsel.c2
-rw-r--r--tools/perf/util/evsel.h2
-rw-r--r--tools/perf/util/header.h2
-rw-r--r--tools/perf/util/include/asm/byteorder.h2
-rw-r--r--tools/perf/util/include/linux/const.h2
-rw-r--r--tools/perf/util/parse-events.h2
-rw-r--r--tools/perf/util/pmu.h2
-rw-r--r--tools/perf/util/session.h2
306 files changed, 11509 insertions, 6823 deletions
diff --git a/.gitignore b/.gitignore
index 57af07cf7e68..0f2f40f71915 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,10 @@
14*.o.* 14*.o.*
15*.a 15*.a
16*.s 16*.s
17*.ko.unsigned
18*.ko.stripped
19*.ko.stripped.dig
20*.ko.stripped.sig
17*.ko 21*.ko
18*.so 22*.so
19*.so.dbg 23*.so.dbg
@@ -84,3 +88,13 @@ GTAGS
84*.orig 88*.orig
85*~ 89*~
86\#*# 90\#*#
91
92#
93# Leavings from module signing
94#
95extra_certificates
96signing_key.priv
97signing_key.x509
98signing_key.x509.keyid
99signing_key.x509.signer
100x509.genkey
diff --git a/Documentation/crypto/asymmetric-keys.txt b/Documentation/crypto/asymmetric-keys.txt
new file mode 100644
index 000000000000..b7675904a747
--- /dev/null
+++ b/Documentation/crypto/asymmetric-keys.txt
@@ -0,0 +1,312 @@
1 =============================================
2 ASYMMETRIC / PUBLIC-KEY CRYPTOGRAPHY KEY TYPE
3 =============================================
4
5Contents:
6
7 - Overview.
8 - Key identification.
9 - Accessing asymmetric keys.
10 - Signature verification.
11 - Asymmetric key subtypes.
12 - Instantiation data parsers.
13
14
15========
16OVERVIEW
17========
18
19The "asymmetric" key type is designed to be a container for the keys used in
20public-key cryptography, without imposing any particular restrictions on the
21form or mechanism of the cryptography or form of the key.
22
23The asymmetric key is given a subtype that defines what sort of data is
24associated with the key and provides operations to describe and destroy it.
25However, no requirement is made that the key data actually be stored in the
26key.
27
28A completely in-kernel key retention and operation subtype can be defined, but
29it would also be possible to provide access to cryptographic hardware (such as
30a TPM) that might be used to both retain the relevant key and perform
31operations using that key. In such a case, the asymmetric key would then
32merely be an interface to the TPM driver.
33
34Also provided is the concept of a data parser. Data parsers are responsible
35for extracting information from the blobs of data passed to the instantiation
36function. The first data parser that recognises the blob gets to set the
37subtype of the key and define the operations that can be done on that key.
38
39A data parser may interpret the data blob as containing the bits representing a
40key, or it may interpret it as a reference to a key held somewhere else in the
41system (for example, a TPM).
42
43
44==================
45KEY IDENTIFICATION
46==================
47
48If a key is added with an empty name, the instantiation data parsers are given
49the opportunity to pre-parse a key and to determine the description the key
50should be given from the content of the key.
51
52This can then be used to refer to the key, either by complete match or by
53partial match. The key type may also use other criteria to refer to a key.
54
55The asymmetric key type's match function can then perform a wider range of
56comparisons than just the straightforward comparison of the description with
57the criterion string:
58
59 (1) If the criterion string is of the form "id:<hexdigits>" then the match
60 function will examine a key's fingerprint to see if the hex digits given
61 after the "id:" match the tail. For instance:
62
63 keyctl search @s asymmetric id:5acc2142
64
65 will match a key with fingerprint:
66
67 1A00 2040 7601 7889 DE11 882C 3823 04AD 5ACC 2142
68
69 (2) If the criterion string is of the form "<subtype>:<hexdigits>" then the
70 match will match the ID as in (1), but with the added restriction that
71 only keys of the specified subtype (e.g. tpm) will be matched. For
72 instance:
73
74 keyctl search @s asymmetric tpm:5acc2142
75
76Looking in /proc/keys, the last 8 hex digits of the key fingerprint are
77displayed, along with the subtype:
78
79 1a39e171 I----- 1 perm 3f010000 0 0 asymmetri modsign.0: DSA 5acc2142 []
80
81
82=========================
83ACCESSING ASYMMETRIC KEYS
84=========================
85
86For general access to asymmetric keys from within the kernel, the following
87inclusion is required:
88
89 #include <crypto/public_key.h>
90
91This gives access to functions for dealing with asymmetric / public keys.
92Three enums are defined there for representing public-key cryptography
93algorithms:
94
95 enum pkey_algo
96
97digest algorithms used by those:
98
99 enum pkey_hash_algo
100
101and key identifier representations:
102
103 enum pkey_id_type
104
105Note that the key type representation types are required because key
106identifiers from different standards aren't necessarily compatible. For
107instance, PGP generates key identifiers by hashing the key data plus some
108PGP-specific metadata, whereas X.509 has arbitrary certificate identifiers.
109
110The operations defined upon a key are:
111
112 (1) Signature verification.
113
114Other operations are possible (such as encryption) with the same key data
115required for verification, but not currently supported, and others
116(eg. decryption and signature generation) require extra key data.
117
118
119SIGNATURE VERIFICATION
120----------------------
121
122An operation is provided to perform cryptographic signature verification, using
123an asymmetric key to provide or to provide access to the public key.
124
125 int verify_signature(const struct key *key,
126 const struct public_key_signature *sig);
127
128The caller must have already obtained the key from some source and can then use
129it to check the signature. The caller must have parsed the signature and
130transferred the relevant bits to the structure pointed to by sig.
131
132 struct public_key_signature {
133 u8 *digest;
134 u8 digest_size;
135 enum pkey_hash_algo pkey_hash_algo : 8;
136 u8 nr_mpi;
137 union {
138 MPI mpi[2];
139 ...
140 };
141 };
142
143The algorithm used must be noted in sig->pkey_hash_algo, and all the MPIs that
144make up the actual signature must be stored in sig->mpi[] and the count of MPIs
145placed in sig->nr_mpi.
146
147In addition, the data must have been digested by the caller and the resulting
148hash must be pointed to by sig->digest and the size of the hash be placed in
149sig->digest_size.
150
151The function will return 0 upon success or -EKEYREJECTED if the signature
152doesn't match.
153
154The function may also return -ENOTSUPP if an unsupported public-key algorithm
155or public-key/hash algorithm combination is specified or the key doesn't
156support the operation; -EBADMSG or -ERANGE if some of the parameters have weird
157data; or -ENOMEM if an allocation can't be performed. -EINVAL can be returned
158if the key argument is the wrong type or is incompletely set up.
159
160
161=======================
162ASYMMETRIC KEY SUBTYPES
163=======================
164
165Asymmetric keys have a subtype that defines the set of operations that can be
166performed on that key and that determines what data is attached as the key
167payload. The payload format is entirely at the whim of the subtype.
168
169The subtype is selected by the key data parser and the parser must initialise
170the data required for it. The asymmetric key retains a reference on the
171subtype module.
172
173The subtype definition structure can be found in:
174
175 #include <keys/asymmetric-subtype.h>
176
177and looks like the following:
178
179 struct asymmetric_key_subtype {
180 struct module *owner;
181 const char *name;
182
183 void (*describe)(const struct key *key, struct seq_file *m);
184 void (*destroy)(void *payload);
185 int (*verify_signature)(const struct key *key,
186 const struct public_key_signature *sig);
187 };
188
189Asymmetric keys point to this with their type_data[0] member.
190
191The owner and name fields should be set to the owning module and the name of
192the subtype. Currently, the name is only used for print statements.
193
194There are a number of operations defined by the subtype:
195
196 (1) describe().
197
198 Mandatory. This allows the subtype to display something in /proc/keys
199 against the key. For instance the name of the public key algorithm type
200 could be displayed. The key type will display the tail of the key
201 identity string after this.
202
203 (2) destroy().
204
205 Mandatory. This should free the memory associated with the key. The
206 asymmetric key will look after freeing the fingerprint and releasing the
207 reference on the subtype module.
208
209 (3) verify_signature().
210
211 Optional. These are the entry points for the key usage operations.
212 Currently there is only the one defined. If not set, the caller will be
213 given -ENOTSUPP. The subtype may do anything it likes to implement an
214 operation, including offloading to hardware.
215
216
217==========================
218INSTANTIATION DATA PARSERS
219==========================
220
221The asymmetric key type doesn't generally want to store or to deal with a raw
222blob of data that holds the key data. It would have to parse it and error
223check it each time it wanted to use it. Further, the contents of the blob may
224have various checks that can be performed on it (eg. self-signatures, validity
225dates) and may contain useful data about the key (identifiers, capabilities).
226
227Also, the blob may represent a pointer to some hardware containing the key
228rather than the key itself.
229
230Examples of blob formats for which parsers could be implemented include:
231
232 - OpenPGP packet stream [RFC 4880].
233 - X.509 ASN.1 stream.
234 - Pointer to TPM key.
235 - Pointer to UEFI key.
236
237During key instantiation each parser in the list is tried until one doesn't
238return -EBADMSG.
239
240The parser definition structure can be found in:
241
242 #include <keys/asymmetric-parser.h>
243
244and looks like the following:
245
246 struct asymmetric_key_parser {
247 struct module *owner;
248 const char *name;
249
250 int (*parse)(struct key_preparsed_payload *prep);
251 };
252
253The owner and name fields should be set to the owning module and the name of
254the parser.
255
256There is currently only a single operation defined by the parser, and it is
257mandatory:
258
259 (1) parse().
260
261 This is called to preparse the key from the key creation and update paths.
262 In particular, it is called during the key creation _before_ a key is
263 allocated, and as such, is permitted to provide the key's description in
264 the case that the caller declines to do so.
265
266 The caller passes a pointer to the following struct with all of the fields
267 cleared, except for data, datalen and quotalen [see
268 Documentation/security/keys.txt].
269
270 struct key_preparsed_payload {
271 char *description;
272 void *type_data[2];
273 void *payload;
274 const void *data;
275 size_t datalen;
276 size_t quotalen;
277 };
278
279 The instantiation data is in a blob pointed to by data and is datalen in
280 size. The parse() function is not permitted to change these two values at
281 all, and shouldn't change any of the other values _unless_ they are
282 recognise the blob format and will not return -EBADMSG to indicate it is
283 not theirs.
284
285 If the parser is happy with the blob, it should propose a description for
286 the key and attach it to ->description, ->type_data[0] should be set to
287 point to the subtype to be used, ->payload should be set to point to the
288 initialised data for that subtype, ->type_data[1] should point to a hex
289 fingerprint and quotalen should be updated to indicate how much quota this
290 key should account for.
291
292 When clearing up, the data attached to ->type_data[1] and ->description
293 will be kfree()'d and the data attached to ->payload will be passed to the
294 subtype's ->destroy() method to be disposed of. A module reference for
295 the subtype pointed to by ->type_data[0] will be put.
296
297
298 If the data format is not recognised, -EBADMSG should be returned. If it
299 is recognised, but the key cannot for some reason be set up, some other
300 negative error code should be returned. On success, 0 should be returned.
301
302 The key's fingerprint string may be partially matched upon. For a
303 public-key algorithm such as RSA and DSA this will likely be a printable
304 hex version of the key's fingerprint.
305
306Functions are provided to register and unregister parsers:
307
308 int register_asymmetric_key_parser(struct asymmetric_key_parser *parser);
309 void unregister_asymmetric_key_parser(struct asymmetric_key_parser *subtype);
310
311Parsers may not have the same name. The names are otherwise only used for
312displaying in debugging messages.
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index e2ed3360b708..9776f068306b 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1593,6 +1593,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1593 log everything. Information is printed at KERN_DEBUG 1593 log everything. Information is printed at KERN_DEBUG
1594 so loglevel=8 may also need to be specified. 1594 so loglevel=8 may also need to be specified.
1595 1595
1596 module.sig_enforce
1597 [KNL] When CONFIG_MODULE_SIG is set, this means that
1598 modules without (valid) signatures will fail to load.
1599 Note that if CONFIG_MODULE_SIG_ENFORCE is set, that
1600 is always true, so this option does nothing.
1601
1596 mousedev.tap_time= 1602 mousedev.tap_time=
1597 [MOUSE] Maximum time between finger touching and 1603 [MOUSE] Maximum time between finger touching and
1598 leaving touchpad surface for touch to be considered 1604 leaving touchpad surface for touch to be considered
diff --git a/Documentation/security/keys.txt b/Documentation/security/keys.txt
index aa0dbd74b71b..7d9ca92022d8 100644
--- a/Documentation/security/keys.txt
+++ b/Documentation/security/keys.txt
@@ -412,6 +412,10 @@ The main syscalls are:
412 to the keyring. In this case, an error will be generated if the process 412 to the keyring. In this case, an error will be generated if the process
413 does not have permission to write to the keyring. 413 does not have permission to write to the keyring.
414 414
415 If the key type supports it, if the description is NULL or an empty
416 string, the key type will try and generate a description from the content
417 of the payload.
418
415 The payload is optional, and the pointer can be NULL if not required by 419 The payload is optional, and the pointer can be NULL if not required by
416 the type. The payload is plen in size, and plen can be zero for an empty 420 the type. The payload is plen in size, and plen can be zero for an empty
417 payload. 421 payload.
@@ -1114,12 +1118,53 @@ The structure has a number of fields, some of which are mandatory:
1114 it should return 0. 1118 it should return 0.
1115 1119
1116 1120
1117 (*) int (*instantiate)(struct key *key, const void *data, size_t datalen); 1121 (*) int (*preparse)(struct key_preparsed_payload *prep);
1122
1123 This optional method permits the key type to attempt to parse payload
1124 before a key is created (add key) or the key semaphore is taken (update or
1125 instantiate key). The structure pointed to by prep looks like:
1126
1127 struct key_preparsed_payload {
1128 char *description;
1129 void *type_data[2];
1130 void *payload;
1131 const void *data;
1132 size_t datalen;
1133 size_t quotalen;
1134 };
1135
1136 Before calling the method, the caller will fill in data and datalen with
1137 the payload blob parameters; quotalen will be filled in with the default
1138 quota size from the key type and the rest will be cleared.
1139
1140 If a description can be proposed from the payload contents, that should be
1141 attached as a string to the description field. This will be used for the
1142 key description if the caller of add_key() passes NULL or "".
1143
1144 The method can attach anything it likes to type_data[] and payload. These
1145 are merely passed along to the instantiate() or update() operations.
1146
1147 The method should return 0 if success ful or a negative error code
1148 otherwise.
1149
1150
1151 (*) void (*free_preparse)(struct key_preparsed_payload *prep);
1152
1153 This method is only required if the preparse() method is provided,
1154 otherwise it is unused. It cleans up anything attached to the
1155 description, type_data and payload fields of the key_preparsed_payload
1156 struct as filled in by the preparse() method.
1157
1158
1159 (*) int (*instantiate)(struct key *key, struct key_preparsed_payload *prep);
1118 1160
1119 This method is called to attach a payload to a key during construction. 1161 This method is called to attach a payload to a key during construction.
1120 The payload attached need not bear any relation to the data passed to this 1162 The payload attached need not bear any relation to the data passed to this
1121 function. 1163 function.
1122 1164
1165 The prep->data and prep->datalen fields will define the original payload
1166 blob. If preparse() was supplied then other fields may be filled in also.
1167
1123 If the amount of data attached to the key differs from the size in 1168 If the amount of data attached to the key differs from the size in
1124 keytype->def_datalen, then key_payload_reserve() should be called. 1169 keytype->def_datalen, then key_payload_reserve() should be called.
1125 1170
@@ -1135,6 +1180,9 @@ The structure has a number of fields, some of which are mandatory:
1135 If this type of key can be updated, then this method should be provided. 1180 If this type of key can be updated, then this method should be provided.
1136 It is called to update a key's payload from the blob of data provided. 1181 It is called to update a key's payload from the blob of data provided.
1137 1182
1183 The prep->data and prep->datalen fields will define the original payload
1184 blob. If preparse() was supplied then other fields may be filled in also.
1185
1138 key_payload_reserve() should be called if the data length might change 1186 key_payload_reserve() should be called if the data length might change
1139 before any changes are actually made. Note that if this succeeds, the type 1187 before any changes are actually made. Note that if this succeeds, the type
1140 is committed to changing the key because it's already been altered, so all 1188 is committed to changing the key because it's already been altered, so all
diff --git a/Makefile b/Makefile
index 5d8e7f258388..5be2ee8c90e4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 3 1VERSION = 3
2PATCHLEVEL = 6 2PATCHLEVEL = 7
3SUBLEVEL = 0 3SUBLEVEL = 0
4EXTRAVERSION = 4EXTRAVERSION = -rc1
5NAME = Terrified Chipmunk 5NAME = Terrified Chipmunk
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
@@ -997,7 +997,10 @@ CLEAN_DIRS += $(MODVERDIR)
997MRPROPER_DIRS += include/config usr/include include/generated \ 997MRPROPER_DIRS += include/config usr/include include/generated \
998 arch/*/include/generated 998 arch/*/include/generated
999MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \ 999MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \
1000 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS 1000 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
1001 signing_key.priv signing_key.x509 x509.genkey \
1002 extra_certificates signing_key.x509.keyid \
1003 signing_key.x509.signer
1001 1004
1002# clean - Delete most, but leave enough to build external modules 1005# clean - Delete most, but leave enough to build external modules
1003# 1006#
@@ -1241,6 +1244,7 @@ clean: $(clean-dirs)
1241 $(call cmd,rmfiles) 1244 $(call cmd,rmfiles)
1242 @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ 1245 @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
1243 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ 1246 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
1247 -o -name '*.ko.*' \
1244 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ 1248 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
1245 -o -name '*.symtypes' -o -name 'modules.order' \ 1249 -o -name '*.symtypes' -o -name 'modules.order' \
1246 -o -name modules.builtin -o -name '.tmp_*.o.*' \ 1250 -o -name modules.builtin -o -name '.tmp_*.o.*' \
diff --git a/arch/Kconfig b/arch/Kconfig
index a79a1ad8bb96..366ec06a5185 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -322,4 +322,23 @@ config HAVE_IRQ_TIME_ACCOUNTING
322config HAVE_ARCH_TRANSPARENT_HUGEPAGE 322config HAVE_ARCH_TRANSPARENT_HUGEPAGE
323 bool 323 bool
324 324
325config HAVE_MOD_ARCH_SPECIFIC
326 bool
327 help
328 The arch uses struct mod_arch_specific to store data. Many arches
329 just need a simple module loader without arch specific data - those
330 should not enable this.
331
332config MODULES_USE_ELF_RELA
333 bool
334 help
335 Modules only use ELF RELA relocations. Modules with ELF REL
336 relocations will give an error.
337
338config MODULES_USE_ELF_REL
339 bool
340 help
341 Modules only use ELF REL relocations. Modules with ELF RELA
342 relocations will give an error.
343
325source "kernel/gcov/Kconfig" 344source "kernel/gcov/Kconfig"
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 7a08cfb80ee8..5dd7f5db24d4 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -22,6 +22,8 @@ config ALPHA
22 select GENERIC_STRNLEN_USER 22 select GENERIC_STRNLEN_USER
23 select GENERIC_KERNEL_THREAD 23 select GENERIC_KERNEL_THREAD
24 select GENERIC_KERNEL_EXECVE 24 select GENERIC_KERNEL_EXECVE
25 select HAVE_MOD_ARCH_SPECIFIC
26 select MODULES_USE_ELF_RELA
25 help 27 help
26 The Alpha is a 64-bit general-purpose processor designed and 28 The Alpha is a 64-bit general-purpose processor designed and
27 marketed by the Digital Equipment Corporation of blessed memory, 29 marketed by the Digital Equipment Corporation of blessed memory,
diff --git a/arch/alpha/include/asm/module.h b/arch/alpha/include/asm/module.h
index 7b63743c534a..9cd13b55155f 100644
--- a/arch/alpha/include/asm/module.h
+++ b/arch/alpha/include/asm/module.h
@@ -1,19 +1,13 @@
1#ifndef _ALPHA_MODULE_H 1#ifndef _ALPHA_MODULE_H
2#define _ALPHA_MODULE_H 2#define _ALPHA_MODULE_H
3 3
4#include <asm-generic/module.h>
5
4struct mod_arch_specific 6struct mod_arch_specific
5{ 7{
6 unsigned int gotsecindex; 8 unsigned int gotsecindex;
7}; 9};
8 10
9#define Elf_Sym Elf64_Sym
10#define Elf_Shdr Elf64_Shdr
11#define Elf_Ehdr Elf64_Ehdr
12#define Elf_Phdr Elf64_Phdr
13#define Elf_Dyn Elf64_Dyn
14#define Elf_Rel Elf64_Rel
15#define Elf_Rela Elf64_Rela
16
17#define ARCH_SHF_SMALL SHF_ALPHA_GPREL 11#define ARCH_SHF_SMALL SHF_ALPHA_GPREL
18 12
19#ifdef MODULE 13#ifdef MODULE
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 431c3753145a..73067efd4845 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1,59 +1,60 @@
1config ARM 1config ARM
2 bool 2 bool
3 default y 3 default y
4 select ARCH_BINFMT_ELF_RANDOMIZE_PIE
5 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
4 select ARCH_HAVE_CUSTOM_GPIO_H 6 select ARCH_HAVE_CUSTOM_GPIO_H
5 select HAVE_AOUT 7 select ARCH_WANT_IPC_PARSE_VERSION
6 select HAVE_DMA_API_DEBUG 8 select CPU_PM if (SUSPEND || CPU_IDLE)
7 select HAVE_IDE if PCI || ISA || PCMCIA 9 select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
8 select HAVE_DMA_ATTRS
9 select HAVE_DMA_CONTIGUOUS if MMU
10 select HAVE_MEMBLOCK
11 select RTC_LIB
12 select SYS_SUPPORTS_APM_EMULATION
13 select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI) 10 select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)
14 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 11 select GENERIC_CLOCKEVENTS_BROADCAST if SMP
15 select HAVE_OPROFILE if (HAVE_PERF_EVENTS) 12 select GENERIC_IRQ_PROBE
13 select GENERIC_IRQ_SHOW
14 select GENERIC_KERNEL_THREAD
15 select GENERIC_KERNEL_EXECVE
16 select GENERIC_PCI_IOMAP
17 select GENERIC_SMP_IDLE_THREAD
18 select GENERIC_STRNCPY_FROM_USER
19 select GENERIC_STRNLEN_USER
20 select HARDIRQS_SW_RESEND
21 select HAVE_AOUT
16 select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL 22 select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
17 select HAVE_ARCH_KGDB 23 select HAVE_ARCH_KGDB
18 select HAVE_ARCH_TRACEHOOK 24 select HAVE_ARCH_TRACEHOOK
19 select HAVE_SYSCALL_TRACEPOINTS 25 select HAVE_BPF_JIT
20 select HAVE_KPROBES if !XIP_KERNEL 26 select HAVE_C_RECORDMCOUNT
21 select HAVE_KRETPROBES if (HAVE_KPROBES) 27 select HAVE_DEBUG_KMEMLEAK
22 select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) 28 select HAVE_DMA_API_DEBUG
23 select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL) 29 select HAVE_DMA_ATTRS
30 select HAVE_DMA_CONTIGUOUS if MMU
24 select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) 31 select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL)
32 select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
25 select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL) 33 select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
26 select ARCH_BINFMT_ELF_RANDOMIZE_PIE 34 select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
27 select HAVE_GENERIC_DMA_COHERENT 35 select HAVE_GENERIC_DMA_COHERENT
28 select HAVE_DEBUG_KMEMLEAK 36 select HAVE_GENERIC_HARDIRQS
37 select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
38 select HAVE_IDE if PCI || ISA || PCMCIA
39 select HAVE_IRQ_WORK
29 select HAVE_KERNEL_GZIP 40 select HAVE_KERNEL_GZIP
30 select HAVE_KERNEL_LZO
31 select HAVE_KERNEL_LZMA 41 select HAVE_KERNEL_LZMA
42 select HAVE_KERNEL_LZO
32 select HAVE_KERNEL_XZ 43 select HAVE_KERNEL_XZ
33 select HAVE_IRQ_WORK 44 select HAVE_KPROBES if !XIP_KERNEL
45 select HAVE_KRETPROBES if (HAVE_KPROBES)
46 select HAVE_MEMBLOCK
47 select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
34 select HAVE_PERF_EVENTS 48 select HAVE_PERF_EVENTS
35 select PERF_USE_VMALLOC
36 select HAVE_REGS_AND_STACK_ACCESS_API 49 select HAVE_REGS_AND_STACK_ACCESS_API
37 select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)) 50 select HAVE_SYSCALL_TRACEPOINTS
38 select HAVE_C_RECORDMCOUNT
39 select HAVE_GENERIC_HARDIRQS
40 select HARDIRQS_SW_RESEND
41 select GENERIC_IRQ_PROBE
42 select GENERIC_IRQ_SHOW
43 select HAVE_UID16 51 select HAVE_UID16
44 select ARCH_WANT_IPC_PARSE_VERSION
45 select HARDIRQS_SW_RESEND
46 select CPU_PM if (SUSPEND || CPU_IDLE)
47 select GENERIC_PCI_IOMAP
48 select HAVE_BPF_JIT
49 select GENERIC_SMP_IDLE_THREAD
50 select KTIME_SCALAR 52 select KTIME_SCALAR
51 select GENERIC_CLOCKEVENTS_BROADCAST if SMP 53 select PERF_USE_VMALLOC
52 select GENERIC_STRNCPY_FROM_USER 54 select RTC_LIB
53 select GENERIC_STRNLEN_USER 55 select SYS_SUPPORTS_APM_EMULATION
54 select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN 56 select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND
55 select GENERIC_KERNEL_THREAD 57 select MODULES_USE_ELF_REL
56 select GENERIC_KERNEL_EXECVE
57 help 58 help
58 The ARM series is a line of low-power-consumption RISC chip designs 59 The ARM series is a line of low-power-consumption RISC chip designs
59 licensed by ARM Ltd and targeted at embedded applications and 60 licensed by ARM Ltd and targeted at embedded applications and
@@ -69,9 +70,9 @@ config NEED_SG_DMA_LENGTH
69 bool 70 bool
70 71
71config ARM_DMA_USE_IOMMU 72config ARM_DMA_USE_IOMMU
72 select NEED_SG_DMA_LENGTH
73 select ARM_HAS_SG_CHAIN
74 bool 73 bool
74 select ARM_HAS_SG_CHAIN
75 select NEED_SG_DMA_LENGTH
75 76
76config HAVE_PWM 77config HAVE_PWM
77 bool 78 bool
@@ -263,69 +264,69 @@ choice
263 264
264config ARCH_MULTIPLATFORM 265config ARCH_MULTIPLATFORM
265 bool "Allow multiple platforms to be selected" 266 bool "Allow multiple platforms to be selected"
267 depends on MMU
266 select ARM_PATCH_PHYS_VIRT 268 select ARM_PATCH_PHYS_VIRT
267 select AUTO_ZRELADDR 269 select AUTO_ZRELADDR
268 select COMMON_CLK 270 select COMMON_CLK
269 select MULTI_IRQ_HANDLER 271 select MULTI_IRQ_HANDLER
270 select SPARSE_IRQ 272 select SPARSE_IRQ
271 select USE_OF 273 select USE_OF
272 depends on MMU
273 274
274config ARCH_INTEGRATOR 275config ARCH_INTEGRATOR
275 bool "ARM Ltd. Integrator family" 276 bool "ARM Ltd. Integrator family"
276 select ARM_AMBA
277 select ARCH_HAS_CPUFREQ 277 select ARCH_HAS_CPUFREQ
278 select ARM_AMBA
278 select COMMON_CLK 279 select COMMON_CLK
279 select COMMON_CLK_VERSATILE 280 select COMMON_CLK_VERSATILE
281 select GENERIC_CLOCKEVENTS
280 select HAVE_TCM 282 select HAVE_TCM
281 select ICST 283 select ICST
282 select GENERIC_CLOCKEVENTS 284 select MULTI_IRQ_HANDLER
285 select NEED_MACH_MEMORY_H
283 select PLAT_VERSATILE 286 select PLAT_VERSATILE
284 select PLAT_VERSATILE_FPGA_IRQ 287 select PLAT_VERSATILE_FPGA_IRQ
285 select NEED_MACH_MEMORY_H
286 select SPARSE_IRQ 288 select SPARSE_IRQ
287 select MULTI_IRQ_HANDLER
288 help 289 help
289 Support for ARM's Integrator platform. 290 Support for ARM's Integrator platform.
290 291
291config ARCH_REALVIEW 292config ARCH_REALVIEW
292 bool "ARM Ltd. RealView family" 293 bool "ARM Ltd. RealView family"
294 select ARCH_WANT_OPTIONAL_GPIOLIB
293 select ARM_AMBA 295 select ARM_AMBA
296 select ARM_TIMER_SP804
294 select COMMON_CLK 297 select COMMON_CLK
295 select COMMON_CLK_VERSATILE 298 select COMMON_CLK_VERSATILE
296 select ICST
297 select GENERIC_CLOCKEVENTS 299 select GENERIC_CLOCKEVENTS
298 select ARCH_WANT_OPTIONAL_GPIOLIB
299 select PLAT_VERSATILE
300 select PLAT_VERSATILE_CLCD
301 select ARM_TIMER_SP804
302 select GPIO_PL061 if GPIOLIB 300 select GPIO_PL061 if GPIOLIB
301 select ICST
303 select NEED_MACH_MEMORY_H 302 select NEED_MACH_MEMORY_H
303 select PLAT_VERSATILE
304 select PLAT_VERSATILE_CLCD
304 help 305 help
305 This enables support for ARM Ltd RealView boards. 306 This enables support for ARM Ltd RealView boards.
306 307
307config ARCH_VERSATILE 308config ARCH_VERSATILE
308 bool "ARM Ltd. Versatile family" 309 bool "ARM Ltd. Versatile family"
310 select ARCH_WANT_OPTIONAL_GPIOLIB
309 select ARM_AMBA 311 select ARM_AMBA
312 select ARM_TIMER_SP804
310 select ARM_VIC 313 select ARM_VIC
311 select CLKDEV_LOOKUP 314 select CLKDEV_LOOKUP
315 select GENERIC_CLOCKEVENTS
312 select HAVE_MACH_CLKDEV 316 select HAVE_MACH_CLKDEV
313 select ICST 317 select ICST
314 select GENERIC_CLOCKEVENTS
315 select ARCH_WANT_OPTIONAL_GPIOLIB
316 select PLAT_VERSATILE 318 select PLAT_VERSATILE
317 select PLAT_VERSATILE_CLOCK
318 select PLAT_VERSATILE_CLCD 319 select PLAT_VERSATILE_CLCD
320 select PLAT_VERSATILE_CLOCK
319 select PLAT_VERSATILE_FPGA_IRQ 321 select PLAT_VERSATILE_FPGA_IRQ
320 select ARM_TIMER_SP804
321 help 322 help
322 This enables support for ARM Ltd Versatile board. 323 This enables support for ARM Ltd Versatile board.
323 324
324config ARCH_AT91 325config ARCH_AT91
325 bool "Atmel AT91" 326 bool "Atmel AT91"
326 select ARCH_REQUIRE_GPIOLIB 327 select ARCH_REQUIRE_GPIOLIB
327 select HAVE_CLK
328 select CLKDEV_LOOKUP 328 select CLKDEV_LOOKUP
329 select HAVE_CLK
329 select IRQ_DOMAIN 330 select IRQ_DOMAIN
330 select NEED_MACH_GPIO_H 331 select NEED_MACH_GPIO_H
331 select NEED_MACH_IO_H if PCCARD 332 select NEED_MACH_IO_H if PCCARD
@@ -350,43 +351,43 @@ config ARCH_BCM2835
350 This enables support for the Broadcom BCM2835 SoC. This SoC is 351 This enables support for the Broadcom BCM2835 SoC. This SoC is
351 use in the Raspberry Pi, and Roku 2 devices. 352 use in the Raspberry Pi, and Roku 2 devices.
352 353
353config ARCH_CLPS711X
354 bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
355 select CPU_ARM720T
356 select ARCH_USES_GETTIMEOFFSET
357 select COMMON_CLK
358 select CLKDEV_LOOKUP
359 select NEED_MACH_MEMORY_H
360 help
361 Support for Cirrus Logic 711x/721x/731x based boards.
362
363config ARCH_CNS3XXX 354config ARCH_CNS3XXX
364 bool "Cavium Networks CNS3XXX family" 355 bool "Cavium Networks CNS3XXX family"
356 select ARM_GIC
365 select CPU_V6K 357 select CPU_V6K
366 select GENERIC_CLOCKEVENTS 358 select GENERIC_CLOCKEVENTS
367 select ARM_GIC
368 select MIGHT_HAVE_CACHE_L2X0 359 select MIGHT_HAVE_CACHE_L2X0
369 select MIGHT_HAVE_PCI 360 select MIGHT_HAVE_PCI
370 select PCI_DOMAINS if PCI 361 select PCI_DOMAINS if PCI
371 help 362 help
372 Support for Cavium Networks CNS3XXX platform. 363 Support for Cavium Networks CNS3XXX platform.
373 364
365config ARCH_CLPS711X
366 bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
367 select ARCH_USES_GETTIMEOFFSET
368 select CLKDEV_LOOKUP
369 select COMMON_CLK
370 select CPU_ARM720T
371 select NEED_MACH_MEMORY_H
372 help
373 Support for Cirrus Logic 711x/721x/731x based boards.
374
374config ARCH_GEMINI 375config ARCH_GEMINI
375 bool "Cortina Systems Gemini" 376 bool "Cortina Systems Gemini"
376 select CPU_FA526
377 select ARCH_REQUIRE_GPIOLIB 377 select ARCH_REQUIRE_GPIOLIB
378 select ARCH_USES_GETTIMEOFFSET 378 select ARCH_USES_GETTIMEOFFSET
379 select CPU_FA526
379 help 380 help
380 Support for the Cortina Systems Gemini family SoCs 381 Support for the Cortina Systems Gemini family SoCs
381 382
382config ARCH_SIRF 383config ARCH_SIRF
383 bool "CSR SiRF" 384 bool "CSR SiRF"
384 select NO_IOPORT
385 select ARCH_REQUIRE_GPIOLIB 385 select ARCH_REQUIRE_GPIOLIB
386 select GENERIC_CLOCKEVENTS
387 select COMMON_CLK 386 select COMMON_CLK
387 select GENERIC_CLOCKEVENTS
388 select GENERIC_IRQ_CHIP 388 select GENERIC_IRQ_CHIP
389 select MIGHT_HAVE_CACHE_L2X0 389 select MIGHT_HAVE_CACHE_L2X0
390 select NO_IOPORT
390 select PINCTRL 391 select PINCTRL
391 select PINCTRL_SIRF 392 select PINCTRL_SIRF
392 select USE_OF 393 select USE_OF
@@ -395,12 +396,12 @@ config ARCH_SIRF
395 396
396config ARCH_EBSA110 397config ARCH_EBSA110
397 bool "EBSA-110" 398 bool "EBSA-110"
399 select ARCH_USES_GETTIMEOFFSET
398 select CPU_SA110 400 select CPU_SA110
399 select ISA 401 select ISA
400 select NO_IOPORT
401 select ARCH_USES_GETTIMEOFFSET
402 select NEED_MACH_IO_H 402 select NEED_MACH_IO_H
403 select NEED_MACH_MEMORY_H 403 select NEED_MACH_MEMORY_H
404 select NO_IOPORT
404 help 405 help
405 This is an evaluation board for the StrongARM processor available 406 This is an evaluation board for the StrongARM processor available
406 from Digital. It has limited hardware on-board, including an 407 from Digital. It has limited hardware on-board, including an
@@ -409,13 +410,13 @@ config ARCH_EBSA110
409 410
410config ARCH_EP93XX 411config ARCH_EP93XX
411 bool "EP93xx-based" 412 bool "EP93xx-based"
412 select CPU_ARM920T 413 select ARCH_HAS_HOLES_MEMORYMODEL
414 select ARCH_REQUIRE_GPIOLIB
415 select ARCH_USES_GETTIMEOFFSET
413 select ARM_AMBA 416 select ARM_AMBA
414 select ARM_VIC 417 select ARM_VIC
415 select CLKDEV_LOOKUP 418 select CLKDEV_LOOKUP
416 select ARCH_REQUIRE_GPIOLIB 419 select CPU_ARM920T
417 select ARCH_HAS_HOLES_MEMORYMODEL
418 select ARCH_USES_GETTIMEOFFSET
419 select NEED_MACH_MEMORY_H 420 select NEED_MACH_MEMORY_H
420 help 421 help
421 This enables support for the Cirrus EP93xx series of CPUs. 422 This enables support for the Cirrus EP93xx series of CPUs.
@@ -434,10 +435,10 @@ config ARCH_FOOTBRIDGE
434 435
435config ARCH_MXC 436config ARCH_MXC
436 bool "Freescale MXC/iMX-based" 437 bool "Freescale MXC/iMX-based"
437 select GENERIC_CLOCKEVENTS
438 select ARCH_REQUIRE_GPIOLIB 438 select ARCH_REQUIRE_GPIOLIB
439 select CLKDEV_LOOKUP 439 select CLKDEV_LOOKUP
440 select CLKSRC_MMIO 440 select CLKSRC_MMIO
441 select GENERIC_CLOCKEVENTS
441 select GENERIC_IRQ_CHIP 442 select GENERIC_IRQ_CHIP
442 select MULTI_IRQ_HANDLER 443 select MULTI_IRQ_HANDLER
443 select SPARSE_IRQ 444 select SPARSE_IRQ
@@ -447,11 +448,11 @@ config ARCH_MXC
447 448
448config ARCH_MXS 449config ARCH_MXS
449 bool "Freescale MXS-based" 450 bool "Freescale MXS-based"
450 select GENERIC_CLOCKEVENTS
451 select ARCH_REQUIRE_GPIOLIB 451 select ARCH_REQUIRE_GPIOLIB
452 select CLKDEV_LOOKUP 452 select CLKDEV_LOOKUP
453 select CLKSRC_MMIO 453 select CLKSRC_MMIO
454 select COMMON_CLK 454 select COMMON_CLK
455 select GENERIC_CLOCKEVENTS
455 select HAVE_CLK_PREPARE 456 select HAVE_CLK_PREPARE
456 select MULTI_IRQ_HANDLER 457 select MULTI_IRQ_HANDLER
457 select PINCTRL 458 select PINCTRL
@@ -462,43 +463,43 @@ config ARCH_MXS
462 463
463config ARCH_NETX 464config ARCH_NETX
464 bool "Hilscher NetX based" 465 bool "Hilscher NetX based"
466 select ARM_VIC
465 select CLKSRC_MMIO 467 select CLKSRC_MMIO
466 select CPU_ARM926T 468 select CPU_ARM926T
467 select ARM_VIC
468 select GENERIC_CLOCKEVENTS 469 select GENERIC_CLOCKEVENTS
469 help 470 help
470 This enables support for systems based on the Hilscher NetX Soc 471 This enables support for systems based on the Hilscher NetX Soc
471 472
472config ARCH_H720X 473config ARCH_H720X
473 bool "Hynix HMS720x-based" 474 bool "Hynix HMS720x-based"
475 select ARCH_USES_GETTIMEOFFSET
474 select CPU_ARM720T 476 select CPU_ARM720T
475 select ISA_DMA_API 477 select ISA_DMA_API
476 select ARCH_USES_GETTIMEOFFSET
477 help 478 help
478 This enables support for systems based on the Hynix HMS720x 479 This enables support for systems based on the Hynix HMS720x
479 480
480config ARCH_IOP13XX 481config ARCH_IOP13XX
481 bool "IOP13xx-based" 482 bool "IOP13xx-based"
482 depends on MMU 483 depends on MMU
483 select CPU_XSC3
484 select PLAT_IOP
485 select PCI
486 select ARCH_SUPPORTS_MSI 484 select ARCH_SUPPORTS_MSI
487 select VMSPLIT_1G 485 select CPU_XSC3
488 select NEED_MACH_MEMORY_H 486 select NEED_MACH_MEMORY_H
489 select NEED_RET_TO_USER 487 select NEED_RET_TO_USER
488 select PCI
489 select PLAT_IOP
490 select VMSPLIT_1G
490 help 491 help
491 Support for Intel's IOP13XX (XScale) family of processors. 492 Support for Intel's IOP13XX (XScale) family of processors.
492 493
493config ARCH_IOP32X 494config ARCH_IOP32X
494 bool "IOP32x-based" 495 bool "IOP32x-based"
495 depends on MMU 496 depends on MMU
497 select ARCH_REQUIRE_GPIOLIB
496 select CPU_XSCALE 498 select CPU_XSCALE
497 select NEED_MACH_GPIO_H 499 select NEED_MACH_GPIO_H
498 select NEED_RET_TO_USER 500 select NEED_RET_TO_USER
499 select PLAT_IOP
500 select PCI 501 select PCI
501 select ARCH_REQUIRE_GPIOLIB 502 select PLAT_IOP
502 help 503 help
503 Support for Intel's 80219 and IOP32X (XScale) family of 504 Support for Intel's 80219 and IOP32X (XScale) family of
504 processors. 505 processors.
@@ -506,12 +507,12 @@ config ARCH_IOP32X
506config ARCH_IOP33X 507config ARCH_IOP33X
507 bool "IOP33x-based" 508 bool "IOP33x-based"
508 depends on MMU 509 depends on MMU
510 select ARCH_REQUIRE_GPIOLIB
509 select CPU_XSCALE 511 select CPU_XSCALE
510 select NEED_MACH_GPIO_H 512 select NEED_MACH_GPIO_H
511 select NEED_RET_TO_USER 513 select NEED_RET_TO_USER
512 select PLAT_IOP
513 select PCI 514 select PCI
514 select ARCH_REQUIRE_GPIOLIB 515 select PLAT_IOP
515 help 516 help
516 Support for Intel's IOP33X (XScale) family of processors. 517 Support for Intel's IOP33X (XScale) family of processors.
517 518
@@ -519,20 +520,20 @@ config ARCH_IXP4XX
519 bool "IXP4xx-based" 520 bool "IXP4xx-based"
520 depends on MMU 521 depends on MMU
521 select ARCH_HAS_DMA_SET_COHERENT_MASK 522 select ARCH_HAS_DMA_SET_COHERENT_MASK
523 select ARCH_REQUIRE_GPIOLIB
522 select CLKSRC_MMIO 524 select CLKSRC_MMIO
523 select CPU_XSCALE 525 select CPU_XSCALE
524 select ARCH_REQUIRE_GPIOLIB 526 select DMABOUNCE if PCI
525 select GENERIC_CLOCKEVENTS 527 select GENERIC_CLOCKEVENTS
526 select MIGHT_HAVE_PCI 528 select MIGHT_HAVE_PCI
527 select NEED_MACH_IO_H 529 select NEED_MACH_IO_H
528 select DMABOUNCE if PCI
529 help 530 help
530 Support for Intel's IXP4XX (XScale) family of processors. 531 Support for Intel's IXP4XX (XScale) family of processors.
531 532
532config ARCH_DOVE 533config ARCH_DOVE
533 bool "Marvell Dove" 534 bool "Marvell Dove"
534 select CPU_V7
535 select ARCH_REQUIRE_GPIOLIB 535 select ARCH_REQUIRE_GPIOLIB
536 select CPU_V7
536 select GENERIC_CLOCKEVENTS 537 select GENERIC_CLOCKEVENTS
537 select MIGHT_HAVE_PCI 538 select MIGHT_HAVE_PCI
538 select PLAT_ORION_LEGACY 539 select PLAT_ORION_LEGACY
@@ -542,36 +543,21 @@ config ARCH_DOVE
542 543
543config ARCH_KIRKWOOD 544config ARCH_KIRKWOOD
544 bool "Marvell Kirkwood" 545 bool "Marvell Kirkwood"
545 select CPU_FEROCEON
546 select PCI
547 select ARCH_REQUIRE_GPIOLIB 546 select ARCH_REQUIRE_GPIOLIB
547 select CPU_FEROCEON
548 select GENERIC_CLOCKEVENTS 548 select GENERIC_CLOCKEVENTS
549 select PCI
549 select PLAT_ORION_LEGACY 550 select PLAT_ORION_LEGACY
550 help 551 help
551 Support for the following Marvell Kirkwood series SoCs: 552 Support for the following Marvell Kirkwood series SoCs:
552 88F6180, 88F6192 and 88F6281. 553 88F6180, 88F6192 and 88F6281.
553 554
554config ARCH_LPC32XX
555 bool "NXP LPC32XX"
556 select CLKSRC_MMIO
557 select CPU_ARM926T
558 select ARCH_REQUIRE_GPIOLIB
559 select HAVE_IDE
560 select ARM_AMBA
561 select USB_ARCH_HAS_OHCI
562 select CLKDEV_LOOKUP
563 select GENERIC_CLOCKEVENTS
564 select USE_OF
565 select HAVE_PWM
566 help
567 Support for the NXP LPC32XX family of processors
568
569config ARCH_MV78XX0 555config ARCH_MV78XX0
570 bool "Marvell MV78xx0" 556 bool "Marvell MV78xx0"
571 select CPU_FEROCEON
572 select PCI
573 select ARCH_REQUIRE_GPIOLIB 557 select ARCH_REQUIRE_GPIOLIB
558 select CPU_FEROCEON
574 select GENERIC_CLOCKEVENTS 559 select GENERIC_CLOCKEVENTS
560 select PCI
575 select PLAT_ORION_LEGACY 561 select PLAT_ORION_LEGACY
576 help 562 help
577 Support for the following Marvell MV78xx0 series SoCs: 563 Support for the following Marvell MV78xx0 series SoCs:
@@ -580,10 +566,10 @@ config ARCH_MV78XX0
580config ARCH_ORION5X 566config ARCH_ORION5X
581 bool "Marvell Orion" 567 bool "Marvell Orion"
582 depends on MMU 568 depends on MMU
583 select CPU_FEROCEON
584 select PCI
585 select ARCH_REQUIRE_GPIOLIB 569 select ARCH_REQUIRE_GPIOLIB
570 select CPU_FEROCEON
586 select GENERIC_CLOCKEVENTS 571 select GENERIC_CLOCKEVENTS
572 select PCI
587 select PLAT_ORION_LEGACY 573 select PLAT_ORION_LEGACY
588 help 574 help
589 Support for the following Marvell Orion 5x series SoCs: 575 Support for the following Marvell Orion 5x series SoCs:
@@ -595,33 +581,33 @@ config ARCH_MMP
595 depends on MMU 581 depends on MMU
596 select ARCH_REQUIRE_GPIOLIB 582 select ARCH_REQUIRE_GPIOLIB
597 select CLKDEV_LOOKUP 583 select CLKDEV_LOOKUP
584 select GENERIC_ALLOCATOR
598 select GENERIC_CLOCKEVENTS 585 select GENERIC_CLOCKEVENTS
599 select GPIO_PXA 586 select GPIO_PXA
600 select IRQ_DOMAIN 587 select IRQ_DOMAIN
588 select NEED_MACH_GPIO_H
601 select PLAT_PXA 589 select PLAT_PXA
602 select SPARSE_IRQ 590 select SPARSE_IRQ
603 select GENERIC_ALLOCATOR
604 select NEED_MACH_GPIO_H
605 help 591 help
606 Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line. 592 Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.
607 593
608config ARCH_KS8695 594config ARCH_KS8695
609 bool "Micrel/Kendin KS8695" 595 bool "Micrel/Kendin KS8695"
610 select CPU_ARM922T
611 select ARCH_REQUIRE_GPIOLIB 596 select ARCH_REQUIRE_GPIOLIB
612 select NEED_MACH_MEMORY_H
613 select CLKSRC_MMIO 597 select CLKSRC_MMIO
598 select CPU_ARM922T
614 select GENERIC_CLOCKEVENTS 599 select GENERIC_CLOCKEVENTS
600 select NEED_MACH_MEMORY_H
615 help 601 help
616 Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based 602 Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
617 System-on-Chip devices. 603 System-on-Chip devices.
618 604
619config ARCH_W90X900 605config ARCH_W90X900
620 bool "Nuvoton W90X900 CPU" 606 bool "Nuvoton W90X900 CPU"
621 select CPU_ARM926T
622 select ARCH_REQUIRE_GPIOLIB 607 select ARCH_REQUIRE_GPIOLIB
623 select CLKDEV_LOOKUP 608 select CLKDEV_LOOKUP
624 select CLKSRC_MMIO 609 select CLKSRC_MMIO
610 select CPU_ARM926T
625 select GENERIC_CLOCKEVENTS 611 select GENERIC_CLOCKEVENTS
626 help 612 help
627 Support for Nuvoton (Winbond logic dept.) ARM9 processor, 613 Support for Nuvoton (Winbond logic dept.) ARM9 processor,
@@ -632,18 +618,33 @@ config ARCH_W90X900
632 <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ 618 <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/
633 ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller> 619 ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller>
634 620
621config ARCH_LPC32XX
622 bool "NXP LPC32XX"
623 select ARCH_REQUIRE_GPIOLIB
624 select ARM_AMBA
625 select CLKDEV_LOOKUP
626 select CLKSRC_MMIO
627 select CPU_ARM926T
628 select GENERIC_CLOCKEVENTS
629 select HAVE_IDE
630 select HAVE_PWM
631 select USB_ARCH_HAS_OHCI
632 select USE_OF
633 help
634 Support for the NXP LPC32XX family of processors
635
635config ARCH_TEGRA 636config ARCH_TEGRA
636 bool "NVIDIA Tegra" 637 bool "NVIDIA Tegra"
638 select ARCH_HAS_CPUFREQ
637 select CLKDEV_LOOKUP 639 select CLKDEV_LOOKUP
638 select CLKSRC_MMIO 640 select CLKSRC_MMIO
641 select COMMON_CLK
639 select GENERIC_CLOCKEVENTS 642 select GENERIC_CLOCKEVENTS
640 select GENERIC_GPIO 643 select GENERIC_GPIO
641 select HAVE_CLK 644 select HAVE_CLK
642 select HAVE_SMP 645 select HAVE_SMP
643 select MIGHT_HAVE_CACHE_L2X0 646 select MIGHT_HAVE_CACHE_L2X0
644 select ARCH_HAS_CPUFREQ
645 select USE_OF 647 select USE_OF
646 select COMMON_CLK
647 help 648 help
648 This enables support for NVIDIA Tegra based systems (Tegra APX, 649 This enables support for NVIDIA Tegra based systems (Tegra APX,
649 Tegra 6xx and Tegra 2 series). 650 Tegra 6xx and Tegra 2 series).
@@ -651,29 +652,29 @@ config ARCH_TEGRA
651config ARCH_PXA 652config ARCH_PXA
652 bool "PXA2xx/PXA3xx-based" 653 bool "PXA2xx/PXA3xx-based"
653 depends on MMU 654 depends on MMU
654 select ARCH_MTD_XIP
655 select ARCH_HAS_CPUFREQ 655 select ARCH_HAS_CPUFREQ
656 select ARCH_MTD_XIP
657 select ARCH_REQUIRE_GPIOLIB
658 select ARM_CPU_SUSPEND if PM
659 select AUTO_ZRELADDR
656 select CLKDEV_LOOKUP 660 select CLKDEV_LOOKUP
657 select CLKSRC_MMIO 661 select CLKSRC_MMIO
658 select ARCH_REQUIRE_GPIOLIB
659 select GENERIC_CLOCKEVENTS 662 select GENERIC_CLOCKEVENTS
660 select GPIO_PXA 663 select GPIO_PXA
661 select PLAT_PXA
662 select SPARSE_IRQ
663 select AUTO_ZRELADDR
664 select MULTI_IRQ_HANDLER
665 select ARM_CPU_SUSPEND if PM
666 select HAVE_IDE 664 select HAVE_IDE
665 select MULTI_IRQ_HANDLER
667 select NEED_MACH_GPIO_H 666 select NEED_MACH_GPIO_H
667 select PLAT_PXA
668 select SPARSE_IRQ
668 help 669 help
669 Support for Intel/Marvell's PXA2xx/PXA3xx processor line. 670 Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
670 671
671config ARCH_MSM 672config ARCH_MSM
672 bool "Qualcomm MSM" 673 bool "Qualcomm MSM"
673 select HAVE_CLK
674 select GENERIC_CLOCKEVENTS
675 select ARCH_REQUIRE_GPIOLIB 674 select ARCH_REQUIRE_GPIOLIB
676 select CLKDEV_LOOKUP 675 select CLKDEV_LOOKUP
676 select GENERIC_CLOCKEVENTS
677 select HAVE_CLK
677 help 678 help
678 Support for Qualcomm MSM/QSD based systems. This runs on the 679 Support for Qualcomm MSM/QSD based systems. This runs on the
679 apps processor of the MSM/QSD and depends on a shared memory 680 apps processor of the MSM/QSD and depends on a shared memory
@@ -683,50 +684,50 @@ config ARCH_MSM
683 684
684config ARCH_SHMOBILE 685config ARCH_SHMOBILE
685 bool "Renesas SH-Mobile / R-Mobile" 686 bool "Renesas SH-Mobile / R-Mobile"
686 select HAVE_CLK
687 select CLKDEV_LOOKUP 687 select CLKDEV_LOOKUP
688 select GENERIC_CLOCKEVENTS
689 select HAVE_CLK
688 select HAVE_MACH_CLKDEV 690 select HAVE_MACH_CLKDEV
689 select HAVE_SMP 691 select HAVE_SMP
690 select GENERIC_CLOCKEVENTS
691 select MIGHT_HAVE_CACHE_L2X0 692 select MIGHT_HAVE_CACHE_L2X0
692 select NO_IOPORT
693 select SPARSE_IRQ
694 select MULTI_IRQ_HANDLER 693 select MULTI_IRQ_HANDLER
695 select PM_GENERIC_DOMAINS if PM
696 select NEED_MACH_MEMORY_H 694 select NEED_MACH_MEMORY_H
695 select NO_IOPORT
696 select PM_GENERIC_DOMAINS if PM
697 select SPARSE_IRQ
697 help 698 help
698 Support for Renesas's SH-Mobile and R-Mobile ARM platforms. 699 Support for Renesas's SH-Mobile and R-Mobile ARM platforms.
699 700
700config ARCH_RPC 701config ARCH_RPC
701 bool "RiscPC" 702 bool "RiscPC"
702 select ARCH_ACORN 703 select ARCH_ACORN
703 select FIQ
704 select ARCH_MAY_HAVE_PC_FDC 704 select ARCH_MAY_HAVE_PC_FDC
705 select HAVE_PATA_PLATFORM
706 select ISA_DMA_API
707 select NO_IOPORT
708 select ARCH_SPARSEMEM_ENABLE 705 select ARCH_SPARSEMEM_ENABLE
709 select ARCH_USES_GETTIMEOFFSET 706 select ARCH_USES_GETTIMEOFFSET
707 select FIQ
710 select HAVE_IDE 708 select HAVE_IDE
709 select HAVE_PATA_PLATFORM
710 select ISA_DMA_API
711 select NEED_MACH_IO_H 711 select NEED_MACH_IO_H
712 select NEED_MACH_MEMORY_H 712 select NEED_MACH_MEMORY_H
713 select NO_IOPORT
713 help 714 help
714 On the Acorn Risc-PC, Linux can support the internal IDE disk and 715 On the Acorn Risc-PC, Linux can support the internal IDE disk and
715 CD-ROM interface, serial and parallel port, and the floppy drive. 716 CD-ROM interface, serial and parallel port, and the floppy drive.
716 717
717config ARCH_SA1100 718config ARCH_SA1100
718 bool "SA1100-based" 719 bool "SA1100-based"
719 select CLKSRC_MMIO
720 select CPU_SA1100
721 select ISA
722 select ARCH_SPARSEMEM_ENABLE
723 select ARCH_MTD_XIP
724 select ARCH_HAS_CPUFREQ 720 select ARCH_HAS_CPUFREQ
721 select ARCH_MTD_XIP
722 select ARCH_REQUIRE_GPIOLIB
723 select ARCH_SPARSEMEM_ENABLE
724 select CLKDEV_LOOKUP
725 select CLKSRC_MMIO
725 select CPU_FREQ 726 select CPU_FREQ
727 select CPU_SA1100
726 select GENERIC_CLOCKEVENTS 728 select GENERIC_CLOCKEVENTS
727 select CLKDEV_LOOKUP
728 select ARCH_REQUIRE_GPIOLIB
729 select HAVE_IDE 729 select HAVE_IDE
730 select ISA
730 select NEED_MACH_GPIO_H 731 select NEED_MACH_GPIO_H
731 select NEED_MACH_MEMORY_H 732 select NEED_MACH_MEMORY_H
732 select SPARSE_IRQ 733 select SPARSE_IRQ
@@ -735,14 +736,14 @@ config ARCH_SA1100
735 736
736config ARCH_S3C24XX 737config ARCH_S3C24XX
737 bool "Samsung S3C24XX SoCs" 738 bool "Samsung S3C24XX SoCs"
738 select GENERIC_GPIO
739 select ARCH_HAS_CPUFREQ 739 select ARCH_HAS_CPUFREQ
740 select HAVE_CLK
741 select CLKDEV_LOOKUP
742 select ARCH_USES_GETTIMEOFFSET 740 select ARCH_USES_GETTIMEOFFSET
741 select CLKDEV_LOOKUP
742 select GENERIC_GPIO
743 select HAVE_CLK
743 select HAVE_S3C2410_I2C if I2C 744 select HAVE_S3C2410_I2C if I2C
744 select HAVE_S3C_RTC if RTC_CLASS
745 select HAVE_S3C2410_WATCHDOG if WATCHDOG 745 select HAVE_S3C2410_WATCHDOG if WATCHDOG
746 select HAVE_S3C_RTC if RTC_CLASS
746 select NEED_MACH_GPIO_H 747 select NEED_MACH_GPIO_H
747 select NEED_MACH_IO_H 748 select NEED_MACH_IO_H
748 help 749 help
@@ -753,38 +754,38 @@ config ARCH_S3C24XX
753 754
754config ARCH_S3C64XX 755config ARCH_S3C64XX
755 bool "Samsung S3C64XX" 756 bool "Samsung S3C64XX"
756 select PLAT_SAMSUNG 757 select ARCH_HAS_CPUFREQ
757 select CPU_V6 758 select ARCH_REQUIRE_GPIOLIB
759 select ARCH_USES_GETTIMEOFFSET
758 select ARM_VIC 760 select ARM_VIC
761 select CLKDEV_LOOKUP
762 select CPU_V6
759 select HAVE_CLK 763 select HAVE_CLK
764 select HAVE_S3C2410_I2C if I2C
765 select HAVE_S3C2410_WATCHDOG if WATCHDOG
760 select HAVE_TCM 766 select HAVE_TCM
761 select CLKDEV_LOOKUP 767 select NEED_MACH_GPIO_H
762 select NO_IOPORT 768 select NO_IOPORT
763 select ARCH_USES_GETTIMEOFFSET 769 select PLAT_SAMSUNG
764 select ARCH_HAS_CPUFREQ 770 select S3C_DEV_NAND
765 select ARCH_REQUIRE_GPIOLIB 771 select S3C_GPIO_TRACK
766 select SAMSUNG_CLKSRC 772 select SAMSUNG_CLKSRC
773 select SAMSUNG_GPIOLIB_4BIT
767 select SAMSUNG_IRQ_VIC_TIMER 774 select SAMSUNG_IRQ_VIC_TIMER
768 select S3C_GPIO_TRACK
769 select S3C_DEV_NAND
770 select USB_ARCH_HAS_OHCI 775 select USB_ARCH_HAS_OHCI
771 select SAMSUNG_GPIOLIB_4BIT
772 select HAVE_S3C2410_I2C if I2C
773 select HAVE_S3C2410_WATCHDOG if WATCHDOG
774 select NEED_MACH_GPIO_H
775 help 776 help
776 Samsung S3C64XX series based systems 777 Samsung S3C64XX series based systems
777 778
778config ARCH_S5P64X0 779config ARCH_S5P64X0
779 bool "Samsung S5P6440 S5P6450" 780 bool "Samsung S5P6440 S5P6450"
780 select CPU_V6
781 select GENERIC_GPIO
782 select HAVE_CLK
783 select CLKDEV_LOOKUP 781 select CLKDEV_LOOKUP
784 select CLKSRC_MMIO 782 select CLKSRC_MMIO
785 select HAVE_S3C2410_WATCHDOG if WATCHDOG 783 select CPU_V6
786 select GENERIC_CLOCKEVENTS 784 select GENERIC_CLOCKEVENTS
785 select GENERIC_GPIO
786 select HAVE_CLK
787 select HAVE_S3C2410_I2C if I2C 787 select HAVE_S3C2410_I2C if I2C
788 select HAVE_S3C2410_WATCHDOG if WATCHDOG
788 select HAVE_S3C_RTC if RTC_CLASS 789 select HAVE_S3C_RTC if RTC_CLASS
789 select NEED_MACH_GPIO_H 790 select NEED_MACH_GPIO_H
790 help 791 help
@@ -793,50 +794,50 @@ config ARCH_S5P64X0
793 794
794config ARCH_S5PC100 795config ARCH_S5PC100
795 bool "Samsung S5PC100" 796 bool "Samsung S5PC100"
796 select GENERIC_GPIO 797 select ARCH_USES_GETTIMEOFFSET
797 select HAVE_CLK
798 select CLKDEV_LOOKUP 798 select CLKDEV_LOOKUP
799 select CPU_V7 799 select CPU_V7
800 select ARCH_USES_GETTIMEOFFSET 800 select GENERIC_GPIO
801 select HAVE_CLK
801 select HAVE_S3C2410_I2C if I2C 802 select HAVE_S3C2410_I2C if I2C
802 select HAVE_S3C_RTC if RTC_CLASS
803 select HAVE_S3C2410_WATCHDOG if WATCHDOG 803 select HAVE_S3C2410_WATCHDOG if WATCHDOG
804 select HAVE_S3C_RTC if RTC_CLASS
804 select NEED_MACH_GPIO_H 805 select NEED_MACH_GPIO_H
805 help 806 help
806 Samsung S5PC100 series based systems 807 Samsung S5PC100 series based systems
807 808
808config ARCH_S5PV210 809config ARCH_S5PV210
809 bool "Samsung S5PV210/S5PC110" 810 bool "Samsung S5PV210/S5PC110"
810 select CPU_V7 811 select ARCH_HAS_CPUFREQ
811 select ARCH_SPARSEMEM_ENABLE
812 select ARCH_HAS_HOLES_MEMORYMODEL 812 select ARCH_HAS_HOLES_MEMORYMODEL
813 select GENERIC_GPIO 813 select ARCH_SPARSEMEM_ENABLE
814 select HAVE_CLK
815 select CLKDEV_LOOKUP 814 select CLKDEV_LOOKUP
816 select CLKSRC_MMIO 815 select CLKSRC_MMIO
817 select ARCH_HAS_CPUFREQ 816 select CPU_V7
818 select GENERIC_CLOCKEVENTS 817 select GENERIC_CLOCKEVENTS
818 select GENERIC_GPIO
819 select HAVE_CLK
819 select HAVE_S3C2410_I2C if I2C 820 select HAVE_S3C2410_I2C if I2C
820 select HAVE_S3C_RTC if RTC_CLASS
821 select HAVE_S3C2410_WATCHDOG if WATCHDOG 821 select HAVE_S3C2410_WATCHDOG if WATCHDOG
822 select HAVE_S3C_RTC if RTC_CLASS
822 select NEED_MACH_GPIO_H 823 select NEED_MACH_GPIO_H
823 select NEED_MACH_MEMORY_H 824 select NEED_MACH_MEMORY_H
824 help 825 help
825 Samsung S5PV210/S5PC110 series based systems 826 Samsung S5PV210/S5PC110 series based systems
826 827
827config ARCH_EXYNOS 828config ARCH_EXYNOS
828 bool "SAMSUNG EXYNOS" 829 bool "Samsung EXYNOS"
829 select CPU_V7 830 select ARCH_HAS_CPUFREQ
830 select ARCH_SPARSEMEM_ENABLE
831 select ARCH_HAS_HOLES_MEMORYMODEL 831 select ARCH_HAS_HOLES_MEMORYMODEL
832 select GENERIC_GPIO 832 select ARCH_SPARSEMEM_ENABLE
833 select HAVE_CLK
834 select CLKDEV_LOOKUP 833 select CLKDEV_LOOKUP
835 select ARCH_HAS_CPUFREQ 834 select CPU_V7
836 select GENERIC_CLOCKEVENTS 835 select GENERIC_CLOCKEVENTS
837 select HAVE_S3C_RTC if RTC_CLASS 836 select GENERIC_GPIO
837 select HAVE_CLK
838 select HAVE_S3C2410_I2C if I2C 838 select HAVE_S3C2410_I2C if I2C
839 select HAVE_S3C2410_WATCHDOG if WATCHDOG 839 select HAVE_S3C2410_WATCHDOG if WATCHDOG
840 select HAVE_S3C_RTC if RTC_CLASS
840 select NEED_MACH_GPIO_H 841 select NEED_MACH_GPIO_H
841 select NEED_MACH_MEMORY_H 842 select NEED_MACH_MEMORY_H
842 help 843 help
@@ -844,13 +845,13 @@ config ARCH_EXYNOS
844 845
845config ARCH_SHARK 846config ARCH_SHARK
846 bool "Shark" 847 bool "Shark"
848 select ARCH_USES_GETTIMEOFFSET
847 select CPU_SA110 849 select CPU_SA110
848 select ISA 850 select ISA
849 select ISA_DMA 851 select ISA_DMA
850 select ZONE_DMA
851 select PCI
852 select ARCH_USES_GETTIMEOFFSET
853 select NEED_MACH_MEMORY_H 852 select NEED_MACH_MEMORY_H
853 select PCI
854 select ZONE_DMA
854 help 855 help
855 Support for the StrongARM based Digital DNARD machine, also known 856 Support for the StrongARM based Digital DNARD machine, also known
856 as "Shark" (<http://www.shark-linux.de/shark.html>). 857 as "Shark" (<http://www.shark-linux.de/shark.html>).
@@ -858,17 +859,17 @@ config ARCH_SHARK
858config ARCH_U300 859config ARCH_U300
859 bool "ST-Ericsson U300 Series" 860 bool "ST-Ericsson U300 Series"
860 depends on MMU 861 depends on MMU
861 select CLKSRC_MMIO 862 select ARCH_REQUIRE_GPIOLIB
862 select CPU_ARM926T
863 select HAVE_TCM
864 select ARM_AMBA 863 select ARM_AMBA
865 select ARM_PATCH_PHYS_VIRT 864 select ARM_PATCH_PHYS_VIRT
866 select ARM_VIC 865 select ARM_VIC
867 select GENERIC_CLOCKEVENTS
868 select CLKDEV_LOOKUP 866 select CLKDEV_LOOKUP
867 select CLKSRC_MMIO
869 select COMMON_CLK 868 select COMMON_CLK
869 select CPU_ARM926T
870 select GENERIC_CLOCKEVENTS
870 select GENERIC_GPIO 871 select GENERIC_GPIO
871 select ARCH_REQUIRE_GPIOLIB 872 select HAVE_TCM
872 select SPARSE_IRQ 873 select SPARSE_IRQ
873 help 874 help
874 Support for ST-Ericsson U300 series mobile platforms. 875 Support for ST-Ericsson U300 series mobile platforms.
@@ -876,12 +877,12 @@ config ARCH_U300
876config ARCH_U8500 877config ARCH_U8500
877 bool "ST-Ericsson U8500 Series" 878 bool "ST-Ericsson U8500 Series"
878 depends on MMU 879 depends on MMU
879 select CPU_V7 880 select ARCH_HAS_CPUFREQ
881 select ARCH_REQUIRE_GPIOLIB
880 select ARM_AMBA 882 select ARM_AMBA
881 select GENERIC_CLOCKEVENTS
882 select CLKDEV_LOOKUP 883 select CLKDEV_LOOKUP
883 select ARCH_REQUIRE_GPIOLIB 884 select CPU_V7
884 select ARCH_HAS_CPUFREQ 885 select GENERIC_CLOCKEVENTS
885 select HAVE_SMP 886 select HAVE_SMP
886 select MIGHT_HAVE_CACHE_L2X0 887 select MIGHT_HAVE_CACHE_L2X0
887 help 888 help
@@ -889,78 +890,78 @@ config ARCH_U8500
889 890
890config ARCH_NOMADIK 891config ARCH_NOMADIK
891 bool "STMicroelectronics Nomadik" 892 bool "STMicroelectronics Nomadik"
893 select ARCH_REQUIRE_GPIOLIB
892 select ARM_AMBA 894 select ARM_AMBA
893 select ARM_VIC 895 select ARM_VIC
894 select CPU_ARM926T
895 select COMMON_CLK 896 select COMMON_CLK
897 select CPU_ARM926T
896 select GENERIC_CLOCKEVENTS 898 select GENERIC_CLOCKEVENTS
899 select MIGHT_HAVE_CACHE_L2X0
897 select PINCTRL 900 select PINCTRL
898 select PINCTRL_STN8815 901 select PINCTRL_STN8815
899 select MIGHT_HAVE_CACHE_L2X0
900 select ARCH_REQUIRE_GPIOLIB
901 help 902 help
902 Support for the Nomadik platform by ST-Ericsson 903 Support for the Nomadik platform by ST-Ericsson
903 904
905config PLAT_SPEAR
906 bool "ST SPEAr"
907 select ARCH_REQUIRE_GPIOLIB
908 select ARM_AMBA
909 select CLKDEV_LOOKUP
910 select CLKSRC_MMIO
911 select COMMON_CLK
912 select GENERIC_CLOCKEVENTS
913 select HAVE_CLK
914 help
915 Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
916
904config ARCH_DAVINCI 917config ARCH_DAVINCI
905 bool "TI DaVinci" 918 bool "TI DaVinci"
906 select GENERIC_CLOCKEVENTS 919 select ARCH_HAS_HOLES_MEMORYMODEL
907 select ARCH_REQUIRE_GPIOLIB 920 select ARCH_REQUIRE_GPIOLIB
908 select ZONE_DMA
909 select HAVE_IDE
910 select CLKDEV_LOOKUP 921 select CLKDEV_LOOKUP
911 select GENERIC_ALLOCATOR 922 select GENERIC_ALLOCATOR
923 select GENERIC_CLOCKEVENTS
912 select GENERIC_IRQ_CHIP 924 select GENERIC_IRQ_CHIP
913 select ARCH_HAS_HOLES_MEMORYMODEL 925 select HAVE_IDE
914 select NEED_MACH_GPIO_H 926 select NEED_MACH_GPIO_H
927 select ZONE_DMA
915 help 928 help
916 Support for TI's DaVinci platform. 929 Support for TI's DaVinci platform.
917 930
918config ARCH_OMAP 931config ARCH_OMAP
919 bool "TI OMAP" 932 bool "TI OMAP"
920 depends on MMU 933 depends on MMU
921 select HAVE_CLK
922 select ARCH_REQUIRE_GPIOLIB
923 select ARCH_HAS_CPUFREQ 934 select ARCH_HAS_CPUFREQ
924 select CLKSRC_MMIO
925 select GENERIC_CLOCKEVENTS
926 select ARCH_HAS_HOLES_MEMORYMODEL 935 select ARCH_HAS_HOLES_MEMORYMODEL
927 select NEED_MACH_GPIO_H
928 help
929 Support for TI's OMAP platform (OMAP1/2/3/4).
930
931config PLAT_SPEAR
932 bool "ST SPEAr"
933 select ARM_AMBA
934 select ARCH_REQUIRE_GPIOLIB 936 select ARCH_REQUIRE_GPIOLIB
935 select CLKDEV_LOOKUP
936 select COMMON_CLK
937 select CLKSRC_MMIO 937 select CLKSRC_MMIO
938 select GENERIC_CLOCKEVENTS 938 select GENERIC_CLOCKEVENTS
939 select HAVE_CLK 939 select HAVE_CLK
940 select NEED_MACH_GPIO_H
940 help 941 help
941 Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx). 942 Support for TI's OMAP platform (OMAP1/2/3/4).
942 943
943config ARCH_VT8500 944config ARCH_VT8500
944 bool "VIA/WonderMedia 85xx" 945 bool "VIA/WonderMedia 85xx"
945 select CPU_ARM926T
946 select GENERIC_GPIO
947 select ARCH_HAS_CPUFREQ 946 select ARCH_HAS_CPUFREQ
948 select GENERIC_CLOCKEVENTS
949 select ARCH_REQUIRE_GPIOLIB 947 select ARCH_REQUIRE_GPIOLIB
950 select USE_OF 948 select CLKDEV_LOOKUP
951 select COMMON_CLK 949 select COMMON_CLK
950 select CPU_ARM926T
951 select GENERIC_CLOCKEVENTS
952 select GENERIC_GPIO
952 select HAVE_CLK 953 select HAVE_CLK
953 select CLKDEV_LOOKUP 954 select USE_OF
954 help 955 help
955 Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip. 956 Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
956 957
957config ARCH_ZYNQ 958config ARCH_ZYNQ
958 bool "Xilinx Zynq ARM Cortex A9 Platform" 959 bool "Xilinx Zynq ARM Cortex A9 Platform"
960 select ARM_AMBA
961 select ARM_GIC
962 select CLKDEV_LOOKUP
959 select CPU_V7 963 select CPU_V7
960 select GENERIC_CLOCKEVENTS 964 select GENERIC_CLOCKEVENTS
961 select CLKDEV_LOOKUP
962 select ARM_GIC
963 select ARM_AMBA
964 select ICST 965 select ICST
965 select MIGHT_HAVE_CACHE_L2X0 966 select MIGHT_HAVE_CACHE_L2X0
966 select USE_OF 967 select USE_OF
@@ -975,33 +976,33 @@ comment "CPU Core family selection"
975 976
976config ARCH_MULTI_V4 977config ARCH_MULTI_V4
977 bool "ARMv4 based platforms (FA526, StrongARM)" 978 bool "ARMv4 based platforms (FA526, StrongARM)"
978 select ARCH_MULTI_V4_V5
979 depends on !ARCH_MULTI_V6_V7 979 depends on !ARCH_MULTI_V6_V7
980 select ARCH_MULTI_V4_V5
980 981
981config ARCH_MULTI_V4T 982config ARCH_MULTI_V4T
982 bool "ARMv4T based platforms (ARM720T, ARM920T, ...)" 983 bool "ARMv4T based platforms (ARM720T, ARM920T, ...)"
983 select ARCH_MULTI_V4_V5
984 depends on !ARCH_MULTI_V6_V7 984 depends on !ARCH_MULTI_V6_V7
985 select ARCH_MULTI_V4_V5
985 986
986config ARCH_MULTI_V5 987config ARCH_MULTI_V5
987 bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)" 988 bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)"
988 select ARCH_MULTI_V4_V5
989 depends on !ARCH_MULTI_V6_V7 989 depends on !ARCH_MULTI_V6_V7
990 select ARCH_MULTI_V4_V5
990 991
991config ARCH_MULTI_V4_V5 992config ARCH_MULTI_V4_V5
992 bool 993 bool
993 994
994config ARCH_MULTI_V6 995config ARCH_MULTI_V6
995 bool "ARMv6 based platforms (ARM11, Scorpion, ...)" 996 bool "ARMv6 based platforms (ARM11, Scorpion, ...)"
996 select CPU_V6
997 select ARCH_MULTI_V6_V7 997 select ARCH_MULTI_V6_V7
998 select CPU_V6
998 999
999config ARCH_MULTI_V7 1000config ARCH_MULTI_V7
1000 bool "ARMv7 based platforms (Cortex-A, PJ4, Krait)" 1001 bool "ARMv7 based platforms (Cortex-A, PJ4, Krait)"
1001 select CPU_V7
1002 select ARCH_VEXPRESS
1003 default y 1002 default y
1004 select ARCH_MULTI_V6_V7 1003 select ARCH_MULTI_V6_V7
1004 select ARCH_VEXPRESS
1005 select CPU_V7
1005 1006
1006config ARCH_MULTI_V6_V7 1007config ARCH_MULTI_V6_V7
1007 bool 1008 bool
@@ -1138,9 +1139,9 @@ config PLAT_IOP
1138config PLAT_ORION 1139config PLAT_ORION
1139 bool 1140 bool
1140 select CLKSRC_MMIO 1141 select CLKSRC_MMIO
1142 select COMMON_CLK
1141 select GENERIC_IRQ_CHIP 1143 select GENERIC_IRQ_CHIP
1142 select IRQ_DOMAIN 1144 select IRQ_DOMAIN
1143 select COMMON_CLK
1144 1145
1145config PLAT_ORION_LEGACY 1146config PLAT_ORION_LEGACY
1146 bool 1147 bool
@@ -1498,8 +1499,8 @@ config SMP
1498 depends on GENERIC_CLOCKEVENTS 1499 depends on GENERIC_CLOCKEVENTS
1499 depends on HAVE_SMP 1500 depends on HAVE_SMP
1500 depends on MMU 1501 depends on MMU
1501 select USE_GENERIC_SMP_HELPERS
1502 select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP 1502 select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP
1503 select USE_GENERIC_SMP_HELPERS
1503 help 1504 help
1504 This enables support for systems with more than one CPU. If you have 1505 This enables support for systems with more than one CPU. If you have
1505 a system with only one CPU, like most personal computers, say N. If 1506 a system with only one CPU, like most personal computers, say N. If
@@ -1858,9 +1859,9 @@ menu "Boot options"
1858 1859
1859config USE_OF 1860config USE_OF
1860 bool "Flattened Device Tree support" 1861 bool "Flattened Device Tree support"
1862 select IRQ_DOMAIN
1861 select OF 1863 select OF
1862 select OF_EARLY_FLATTREE 1864 select OF_EARLY_FLATTREE
1863 select IRQ_DOMAIN
1864 help 1865 help
1865 Include support for flattened device tree machine descriptions. 1866 Include support for flattened device tree machine descriptions.
1866 1867
@@ -2142,8 +2143,8 @@ config CPU_FREQ_PXA
2142 bool 2143 bool
2143 depends on CPU_FREQ && ARCH_PXA && PXA25x 2144 depends on CPU_FREQ && ARCH_PXA && PXA25x
2144 default y 2145 default y
2145 select CPU_FREQ_TABLE
2146 select CPU_FREQ_DEFAULT_GOV_USERSPACE 2146 select CPU_FREQ_DEFAULT_GOV_USERSPACE
2147 select CPU_FREQ_TABLE
2147 2148
2148config CPU_FREQ_S3C 2149config CPU_FREQ_S3C
2149 bool 2150 bool
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig
index 283fa1d804f4..45ceeb0e93e0 100644
--- a/arch/arm/common/Kconfig
+++ b/arch/arm/common/Kconfig
@@ -1,15 +1,15 @@
1config ARM_GIC 1config ARM_GIC
2 bool
2 select IRQ_DOMAIN 3 select IRQ_DOMAIN
3 select MULTI_IRQ_HANDLER 4 select MULTI_IRQ_HANDLER
4 bool
5 5
6config GIC_NON_BANKED 6config GIC_NON_BANKED
7 bool 7 bool
8 8
9config ARM_VIC 9config ARM_VIC
10 bool
10 select IRQ_DOMAIN 11 select IRQ_DOMAIN
11 select MULTI_IRQ_HANDLER 12 select MULTI_IRQ_HANDLER
12 bool
13 13
14config ARM_VIC_NR 14config ARM_VIC_NR
15 int 15 int
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild
index 8a7196ca5106..f70ae175a3d6 100644
--- a/arch/arm/include/asm/Kbuild
+++ b/arch/arm/include/asm/Kbuild
@@ -1,6 +1,4 @@
1include include/asm-generic/Kbuild.asm
2 1
3header-y += hwcap.h
4 2
5generic-y += auxvec.h 3generic-y += auxvec.h
6generic-y += bitsperlong.h 4generic-y += bitsperlong.h
diff --git a/arch/arm/include/asm/hwcap.h b/arch/arm/include/asm/hwcap.h
index 917626128a1d..6ff56eca3f1f 100644
--- a/arch/arm/include/asm/hwcap.h
+++ b/arch/arm/include/asm/hwcap.h
@@ -1,31 +1,8 @@
1#ifndef __ASMARM_HWCAP_H 1#ifndef __ASMARM_HWCAP_H
2#define __ASMARM_HWCAP_H 2#define __ASMARM_HWCAP_H
3 3
4/* 4#include <uapi/asm/hwcap.h>
5 * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
6 */
7#define HWCAP_SWP (1 << 0)
8#define HWCAP_HALF (1 << 1)
9#define HWCAP_THUMB (1 << 2)
10#define HWCAP_26BIT (1 << 3) /* Play it safe */
11#define HWCAP_FAST_MULT (1 << 4)
12#define HWCAP_FPA (1 << 5)
13#define HWCAP_VFP (1 << 6)
14#define HWCAP_EDSP (1 << 7)
15#define HWCAP_JAVA (1 << 8)
16#define HWCAP_IWMMXT (1 << 9)
17#define HWCAP_CRUNCH (1 << 10)
18#define HWCAP_THUMBEE (1 << 11)
19#define HWCAP_NEON (1 << 12)
20#define HWCAP_VFPv3 (1 << 13)
21#define HWCAP_VFPv3D16 (1 << 14)
22#define HWCAP_TLS (1 << 15)
23#define HWCAP_VFPv4 (1 << 16)
24#define HWCAP_IDIVA (1 << 17)
25#define HWCAP_IDIVT (1 << 18)
26#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
27 5
28#if defined(__KERNEL__)
29#if !defined(__ASSEMBLY__) 6#if !defined(__ASSEMBLY__)
30/* 7/*
31 * This yields a mask that user programs can use to figure out what 8 * This yields a mask that user programs can use to figure out what
@@ -35,5 +12,3 @@
35extern unsigned int elf_hwcap; 12extern unsigned int elf_hwcap;
36#endif 13#endif
37#endif 14#endif
38
39#endif
diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index 6c6809f982f1..0d3a28dbc8e5 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -1,9 +1,7 @@
1#ifndef _ASM_ARM_MODULE_H 1#ifndef _ASM_ARM_MODULE_H
2#define _ASM_ARM_MODULE_H 2#define _ASM_ARM_MODULE_H
3 3
4#define Elf_Shdr Elf32_Shdr 4#include <asm-generic/module.h>
5#define Elf_Sym Elf32_Sym
6#define Elf_Ehdr Elf32_Ehdr
7 5
8struct unwind_table; 6struct unwind_table;
9 7
@@ -16,13 +14,11 @@ enum {
16 ARM_SEC_DEVEXIT, 14 ARM_SEC_DEVEXIT,
17 ARM_SEC_MAX, 15 ARM_SEC_MAX,
18}; 16};
19#endif
20 17
21struct mod_arch_specific { 18struct mod_arch_specific {
22#ifdef CONFIG_ARM_UNWIND
23 struct unwind_table *unwind[ARM_SEC_MAX]; 19 struct unwind_table *unwind[ARM_SEC_MAX];
24#endif
25}; 20};
21#endif
26 22
27/* 23/*
28 * Add the ARM architecture version to the version magic string 24 * Add the ARM architecture version to the version magic string
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
index 142d6ae41231..3d52ee1bfb31 100644
--- a/arch/arm/include/asm/ptrace.h
+++ b/arch/arm/include/asm/ptrace.h
@@ -10,133 +10,12 @@
10#ifndef __ASM_ARM_PTRACE_H 10#ifndef __ASM_ARM_PTRACE_H
11#define __ASM_ARM_PTRACE_H 11#define __ASM_ARM_PTRACE_H
12 12
13#include <asm/hwcap.h> 13#include <uapi/asm/ptrace.h>
14
15#define PTRACE_GETREGS 12
16#define PTRACE_SETREGS 13
17#define PTRACE_GETFPREGS 14
18#define PTRACE_SETFPREGS 15
19/* PTRACE_ATTACH is 16 */
20/* PTRACE_DETACH is 17 */
21#define PTRACE_GETWMMXREGS 18
22#define PTRACE_SETWMMXREGS 19
23/* 20 is unused */
24#define PTRACE_OLDSETOPTIONS 21
25#define PTRACE_GET_THREAD_AREA 22
26#define PTRACE_SET_SYSCALL 23
27/* PTRACE_SYSCALL is 24 */
28#define PTRACE_GETCRUNCHREGS 25
29#define PTRACE_SETCRUNCHREGS 26
30#define PTRACE_GETVFPREGS 27
31#define PTRACE_SETVFPREGS 28
32#define PTRACE_GETHBPREGS 29
33#define PTRACE_SETHBPREGS 30
34
35/*
36 * PSR bits
37 */
38#define USR26_MODE 0x00000000
39#define FIQ26_MODE 0x00000001
40#define IRQ26_MODE 0x00000002
41#define SVC26_MODE 0x00000003
42#define USR_MODE 0x00000010
43#define FIQ_MODE 0x00000011
44#define IRQ_MODE 0x00000012
45#define SVC_MODE 0x00000013
46#define ABT_MODE 0x00000017
47#define HYP_MODE 0x0000001a
48#define UND_MODE 0x0000001b
49#define SYSTEM_MODE 0x0000001f
50#define MODE32_BIT 0x00000010
51#define MODE_MASK 0x0000001f
52#define PSR_T_BIT 0x00000020
53#define PSR_F_BIT 0x00000040
54#define PSR_I_BIT 0x00000080
55#define PSR_A_BIT 0x00000100
56#define PSR_E_BIT 0x00000200
57#define PSR_J_BIT 0x01000000
58#define PSR_Q_BIT 0x08000000
59#define PSR_V_BIT 0x10000000
60#define PSR_C_BIT 0x20000000
61#define PSR_Z_BIT 0x40000000
62#define PSR_N_BIT 0x80000000
63
64/*
65 * Groups of PSR bits
66 */
67#define PSR_f 0xff000000 /* Flags */
68#define PSR_s 0x00ff0000 /* Status */
69#define PSR_x 0x0000ff00 /* Extension */
70#define PSR_c 0x000000ff /* Control */
71
72/*
73 * ARMv7 groups of PSR bits
74 */
75#define APSR_MASK 0xf80f0000 /* N, Z, C, V, Q and GE flags */
76#define PSR_ISET_MASK 0x01000010 /* ISA state (J, T) mask */
77#define PSR_IT_MASK 0x0600fc00 /* If-Then execution state mask */
78#define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */
79
80/*
81 * Default endianness state
82 */
83#ifdef CONFIG_CPU_ENDIAN_BE8
84#define PSR_ENDSTATE PSR_E_BIT
85#else
86#define PSR_ENDSTATE 0
87#endif
88
89/*
90 * These are 'magic' values for PTRACE_PEEKUSR that return info about where a
91 * process is located in memory.
92 */
93#define PT_TEXT_ADDR 0x10000
94#define PT_DATA_ADDR 0x10004
95#define PT_TEXT_END_ADDR 0x10008
96 14
97#ifndef __ASSEMBLY__ 15#ifndef __ASSEMBLY__
98
99/*
100 * This struct defines the way the registers are stored on the
101 * stack during a system call. Note that sizeof(struct pt_regs)
102 * has to be a multiple of 8.
103 */
104#ifndef __KERNEL__
105struct pt_regs {
106 long uregs[18];
107};
108#else /* __KERNEL__ */
109struct pt_regs { 16struct pt_regs {
110 unsigned long uregs[18]; 17 unsigned long uregs[18];
111}; 18};
112#endif /* __KERNEL__ */
113
114#define ARM_cpsr uregs[16]
115#define ARM_pc uregs[15]
116#define ARM_lr uregs[14]
117#define ARM_sp uregs[13]
118#define ARM_ip uregs[12]
119#define ARM_fp uregs[11]
120#define ARM_r10 uregs[10]
121#define ARM_r9 uregs[9]
122#define ARM_r8 uregs[8]
123#define ARM_r7 uregs[7]
124#define ARM_r6 uregs[6]
125#define ARM_r5 uregs[5]
126#define ARM_r4 uregs[4]
127#define ARM_r3 uregs[3]
128#define ARM_r2 uregs[2]
129#define ARM_r1 uregs[1]
130#define ARM_r0 uregs[0]
131#define ARM_ORIG_r0 uregs[17]
132
133/*
134 * The size of the user-visible VFP state as seen by PTRACE_GET/SETVFPREGS
135 * and core dumps.
136 */
137#define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ )
138
139#ifdef __KERNEL__
140 19
141#define user_mode(regs) \ 20#define user_mode(regs) \
142 (((regs)->ARM_cpsr & 0xf) == 0) 21 (((regs)->ARM_cpsr & 0xf) == 0)
@@ -260,9 +139,5 @@ static inline unsigned long user_stack_pointer(struct pt_regs *regs)
260 (struct pt_regs *)((sp | (THREAD_SIZE - 1)) - 7) - 1; \ 139 (struct pt_regs *)((sp | (THREAD_SIZE - 1)) - 7) - 1; \
261}) 140})
262 141
263#endif /* __KERNEL__ */
264
265#endif /* __ASSEMBLY__ */ 142#endif /* __ASSEMBLY__ */
266
267#endif 143#endif
268
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index 24d284a1bfc7..c50f05609501 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -14,176 +14,8 @@
14#ifndef __ASMARM_SETUP_H 14#ifndef __ASMARM_SETUP_H
15#define __ASMARM_SETUP_H 15#define __ASMARM_SETUP_H
16 16
17#include <linux/types.h> 17#include <uapi/asm/setup.h>
18 18
19#define COMMAND_LINE_SIZE 1024
20
21/* The list ends with an ATAG_NONE node. */
22#define ATAG_NONE 0x00000000
23
24struct tag_header {
25 __u32 size;
26 __u32 tag;
27};
28
29/* The list must start with an ATAG_CORE node */
30#define ATAG_CORE 0x54410001
31
32struct tag_core {
33 __u32 flags; /* bit 0 = read-only */
34 __u32 pagesize;
35 __u32 rootdev;
36};
37
38/* it is allowed to have multiple ATAG_MEM nodes */
39#define ATAG_MEM 0x54410002
40
41struct tag_mem32 {
42 __u32 size;
43 __u32 start; /* physical start address */
44};
45
46/* VGA text type displays */
47#define ATAG_VIDEOTEXT 0x54410003
48
49struct tag_videotext {
50 __u8 x;
51 __u8 y;
52 __u16 video_page;
53 __u8 video_mode;
54 __u8 video_cols;
55 __u16 video_ega_bx;
56 __u8 video_lines;
57 __u8 video_isvga;
58 __u16 video_points;
59};
60
61/* describes how the ramdisk will be used in kernel */
62#define ATAG_RAMDISK 0x54410004
63
64struct tag_ramdisk {
65 __u32 flags; /* bit 0 = load, bit 1 = prompt */
66 __u32 size; /* decompressed ramdisk size in _kilo_ bytes */
67 __u32 start; /* starting block of floppy-based RAM disk image */
68};
69
70/* describes where the compressed ramdisk image lives (virtual address) */
71/*
72 * this one accidentally used virtual addresses - as such,
73 * it's deprecated.
74 */
75#define ATAG_INITRD 0x54410005
76
77/* describes where the compressed ramdisk image lives (physical address) */
78#define ATAG_INITRD2 0x54420005
79
80struct tag_initrd {
81 __u32 start; /* physical start address */
82 __u32 size; /* size of compressed ramdisk image in bytes */
83};
84
85/* board serial number. "64 bits should be enough for everybody" */
86#define ATAG_SERIAL 0x54410006
87
88struct tag_serialnr {
89 __u32 low;
90 __u32 high;
91};
92
93/* board revision */
94#define ATAG_REVISION 0x54410007
95
96struct tag_revision {
97 __u32 rev;
98};
99
100/* initial values for vesafb-type framebuffers. see struct screen_info
101 * in include/linux/tty.h
102 */
103#define ATAG_VIDEOLFB 0x54410008
104
105struct tag_videolfb {
106 __u16 lfb_width;
107 __u16 lfb_height;
108 __u16 lfb_depth;
109 __u16 lfb_linelength;
110 __u32 lfb_base;
111 __u32 lfb_size;
112 __u8 red_size;
113 __u8 red_pos;
114 __u8 green_size;
115 __u8 green_pos;
116 __u8 blue_size;
117 __u8 blue_pos;
118 __u8 rsvd_size;
119 __u8 rsvd_pos;
120};
121
122/* command line: \0 terminated string */
123#define ATAG_CMDLINE 0x54410009
124
125struct tag_cmdline {
126 char cmdline[1]; /* this is the minimum size */
127};
128
129/* acorn RiscPC specific information */
130#define ATAG_ACORN 0x41000101
131
132struct tag_acorn {
133 __u32 memc_control_reg;
134 __u32 vram_pages;
135 __u8 sounddefault;
136 __u8 adfsdrives;
137};
138
139/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
140#define ATAG_MEMCLK 0x41000402
141
142struct tag_memclk {
143 __u32 fmemclk;
144};
145
146struct tag {
147 struct tag_header hdr;
148 union {
149 struct tag_core core;
150 struct tag_mem32 mem;
151 struct tag_videotext videotext;
152 struct tag_ramdisk ramdisk;
153 struct tag_initrd initrd;
154 struct tag_serialnr serialnr;
155 struct tag_revision revision;
156 struct tag_videolfb videolfb;
157 struct tag_cmdline cmdline;
158
159 /*
160 * Acorn specific
161 */
162 struct tag_acorn acorn;
163
164 /*
165 * DC21285 specific
166 */
167 struct tag_memclk memclk;
168 } u;
169};
170
171struct tagtable {
172 __u32 tag;
173 int (*parse)(const struct tag *);
174};
175
176#define tag_member_present(tag,member) \
177 ((unsigned long)(&((struct tag *)0L)->member + 1) \
178 <= (tag)->hdr.size * 4)
179
180#define tag_next(t) ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
181#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
182
183#define for_each_tag(t,base) \
184 for (t = base; t->hdr.size; t = tag_next(t))
185
186#ifdef __KERNEL__
187 19
188#define __tag __used __attribute__((__section__(".taglist.init"))) 20#define __tag __used __attribute__((__section__(".taglist.init")))
189#define __tagtable(tag, fn) \ 21#define __tagtable(tag, fn) \
@@ -221,6 +53,4 @@ extern int arm_add_memory(phys_addr_t start, phys_addr_t size);
221extern void early_print(const char *str, ...); 53extern void early_print(const char *str, ...);
222extern void dump_machine_table(void); 54extern void dump_machine_table(void);
223 55
224#endif /* __KERNEL__ */
225
226#endif 56#endif
diff --git a/arch/arm/include/asm/signal.h b/arch/arm/include/asm/signal.h
index 43ba0fb1c8ad..5a7963dbd3fb 100644
--- a/arch/arm/include/asm/signal.h
+++ b/arch/arm/include/asm/signal.h
@@ -1,12 +1,8 @@
1#ifndef _ASMARM_SIGNAL_H 1#ifndef _ASMARM_SIGNAL_H
2#define _ASMARM_SIGNAL_H 2#define _ASMARM_SIGNAL_H
3 3
4#include <linux/types.h> 4#include <uapi/asm/signal.h>
5 5
6/* Avoid too many header ordering problems. */
7struct siginfo;
8
9#ifdef __KERNEL__
10/* Most things should be clean enough to redefine this at will, if care 6/* Most things should be clean enough to redefine this at will, if care
11 is taken to make libc match. */ 7 is taken to make libc match. */
12 8
@@ -20,100 +16,6 @@ typedef struct {
20 unsigned long sig[_NSIG_WORDS]; 16 unsigned long sig[_NSIG_WORDS];
21} sigset_t; 17} sigset_t;
22 18
23#else
24/* Here we must cater to libcs that poke about in kernel headers. */
25
26#define NSIG 32
27typedef unsigned long sigset_t;
28
29#endif /* __KERNEL__ */
30
31#define SIGHUP 1
32#define SIGINT 2
33#define SIGQUIT 3
34#define SIGILL 4
35#define SIGTRAP 5
36#define SIGABRT 6
37#define SIGIOT 6
38#define SIGBUS 7
39#define SIGFPE 8
40#define SIGKILL 9
41#define SIGUSR1 10
42#define SIGSEGV 11
43#define SIGUSR2 12
44#define SIGPIPE 13
45#define SIGALRM 14
46#define SIGTERM 15
47#define SIGSTKFLT 16
48#define SIGCHLD 17
49#define SIGCONT 18
50#define SIGSTOP 19
51#define SIGTSTP 20
52#define SIGTTIN 21
53#define SIGTTOU 22
54#define SIGURG 23
55#define SIGXCPU 24
56#define SIGXFSZ 25
57#define SIGVTALRM 26
58#define SIGPROF 27
59#define SIGWINCH 28
60#define SIGIO 29
61#define SIGPOLL SIGIO
62/*
63#define SIGLOST 29
64*/
65#define SIGPWR 30
66#define SIGSYS 31
67#define SIGUNUSED 31
68
69/* These should not be considered constants from userland. */
70#define SIGRTMIN 32
71#define SIGRTMAX _NSIG
72
73#define SIGSWI 32
74
75/*
76 * SA_FLAGS values:
77 *
78 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
79 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
80 * SA_SIGINFO deliver the signal with SIGINFO structs
81 * SA_THIRTYTWO delivers the signal in 32-bit mode, even if the task
82 * is running in 26-bit.
83 * SA_ONSTACK allows alternate signal stacks (see sigaltstack(2)).
84 * SA_RESTART flag to get restarting signals (which were the default long ago)
85 * SA_NODEFER prevents the current signal from being masked in the handler.
86 * SA_RESETHAND clears the handler when the signal is delivered.
87 *
88 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
89 * Unix names RESETHAND and NODEFER respectively.
90 */
91#define SA_NOCLDSTOP 0x00000001
92#define SA_NOCLDWAIT 0x00000002
93#define SA_SIGINFO 0x00000004
94#define SA_THIRTYTWO 0x02000000
95#define SA_RESTORER 0x04000000
96#define SA_ONSTACK 0x08000000
97#define SA_RESTART 0x10000000
98#define SA_NODEFER 0x40000000
99#define SA_RESETHAND 0x80000000
100
101#define SA_NOMASK SA_NODEFER
102#define SA_ONESHOT SA_RESETHAND
103
104
105/*
106 * sigaltstack controls
107 */
108#define SS_ONSTACK 1
109#define SS_DISABLE 2
110
111#define MINSIGSTKSZ 2048
112#define SIGSTKSZ 8192
113
114#include <asm-generic/signal-defs.h>
115
116#ifdef __KERNEL__
117struct old_sigaction { 19struct old_sigaction {
118 __sighandler_t sa_handler; 20 __sighandler_t sa_handler;
119 old_sigset_t sa_mask; 21 old_sigset_t sa_mask;
@@ -132,33 +34,6 @@ struct k_sigaction {
132 struct sigaction sa; 34 struct sigaction sa;
133}; 35};
134 36
135#else
136/* Here we must cater to libcs that poke about in kernel headers. */
137
138struct sigaction {
139 union {
140 __sighandler_t _sa_handler;
141 void (*_sa_sigaction)(int, struct siginfo *, void *);
142 } _u;
143 sigset_t sa_mask;
144 unsigned long sa_flags;
145 void (*sa_restorer)(void);
146};
147
148#define sa_handler _u._sa_handler
149#define sa_sigaction _u._sa_sigaction
150
151#endif /* __KERNEL__ */
152
153typedef struct sigaltstack {
154 void __user *ss_sp;
155 int ss_flags;
156 size_t ss_size;
157} stack_t;
158
159#ifdef __KERNEL__
160#include <asm/sigcontext.h> 37#include <asm/sigcontext.h>
161#define ptrace_signal_deliver(regs, cookie) do { } while (0) 38#define ptrace_signal_deliver(regs, cookie) do { } while (0)
162#endif 39#endif
163
164#endif
diff --git a/arch/arm/include/asm/swab.h b/arch/arm/include/asm/swab.h
index b859d82e30ca..537fc9b91889 100644
--- a/arch/arm/include/asm/swab.h
+++ b/arch/arm/include/asm/swab.h
@@ -15,14 +15,8 @@
15#ifndef __ASM_ARM_SWAB_H 15#ifndef __ASM_ARM_SWAB_H
16#define __ASM_ARM_SWAB_H 16#define __ASM_ARM_SWAB_H
17 17
18#include <linux/compiler.h> 18#include <uapi/asm/swab.h>
19#include <linux/types.h>
20 19
21#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
22# define __SWAB_64_THRU_32__
23#endif
24
25#if defined(__KERNEL__)
26#if __LINUX_ARM_ARCH__ >= 6 20#if __LINUX_ARM_ARCH__ >= 6
27 21
28static inline __attribute_const__ __u32 __arch_swahb32(__u32 x) 22static inline __attribute_const__ __u32 __arch_swahb32(__u32 x)
@@ -42,32 +36,3 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
42 36
43#endif 37#endif
44#endif 38#endif
45
46#if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6
47static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
48{
49 __u32 t;
50
51#ifndef __thumb__
52 if (!__builtin_constant_p(x)) {
53 /*
54 * The compiler needs a bit of a hint here to always do the
55 * right thing and not screw it up to different degrees
56 * depending on the gcc version.
57 */
58 asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
59 } else
60#endif
61 t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
62
63 x = (x << 24) | (x >> 8); /* mov r0,r0,ror #8 */
64 t &= ~0x00FF0000; /* bic r1,r1,#0x00FF0000 */
65 x ^= (t >> 8); /* eor r0,r0,r1,lsr #8 */
66
67 return x;
68}
69#define __arch_swab32 __arch_swab32
70
71#endif
72
73#endif
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
index 91819ad54424..8f60b6e6bd41 100644
--- a/arch/arm/include/asm/unistd.h
+++ b/arch/arm/include/asm/unistd.h
@@ -13,447 +13,10 @@
13#ifndef __ASM_ARM_UNISTD_H 13#ifndef __ASM_ARM_UNISTD_H
14#define __ASM_ARM_UNISTD_H 14#define __ASM_ARM_UNISTD_H
15 15
16#define __NR_OABI_SYSCALL_BASE 0x900000 16#include <uapi/asm/unistd.h>
17 17
18#if defined(__thumb__) || defined(__ARM_EABI__)
19#define __NR_SYSCALL_BASE 0
20#else
21#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE
22#endif
23
24/*
25 * This file contains the system call numbers.
26 */
27
28#define __NR_restart_syscall (__NR_SYSCALL_BASE+ 0)
29#define __NR_exit (__NR_SYSCALL_BASE+ 1)
30#define __NR_fork (__NR_SYSCALL_BASE+ 2)
31#define __NR_read (__NR_SYSCALL_BASE+ 3)
32#define __NR_write (__NR_SYSCALL_BASE+ 4)
33#define __NR_open (__NR_SYSCALL_BASE+ 5)
34#define __NR_close (__NR_SYSCALL_BASE+ 6)
35 /* 7 was sys_waitpid */
36#define __NR_creat (__NR_SYSCALL_BASE+ 8)
37#define __NR_link (__NR_SYSCALL_BASE+ 9)
38#define __NR_unlink (__NR_SYSCALL_BASE+ 10)
39#define __NR_execve (__NR_SYSCALL_BASE+ 11)
40#define __NR_chdir (__NR_SYSCALL_BASE+ 12)
41#define __NR_time (__NR_SYSCALL_BASE+ 13)
42#define __NR_mknod (__NR_SYSCALL_BASE+ 14)
43#define __NR_chmod (__NR_SYSCALL_BASE+ 15)
44#define __NR_lchown (__NR_SYSCALL_BASE+ 16)
45 /* 17 was sys_break */
46 /* 18 was sys_stat */
47#define __NR_lseek (__NR_SYSCALL_BASE+ 19)
48#define __NR_getpid (__NR_SYSCALL_BASE+ 20)
49#define __NR_mount (__NR_SYSCALL_BASE+ 21)
50#define __NR_umount (__NR_SYSCALL_BASE+ 22)
51#define __NR_setuid (__NR_SYSCALL_BASE+ 23)
52#define __NR_getuid (__NR_SYSCALL_BASE+ 24)
53#define __NR_stime (__NR_SYSCALL_BASE+ 25)
54#define __NR_ptrace (__NR_SYSCALL_BASE+ 26)
55#define __NR_alarm (__NR_SYSCALL_BASE+ 27)
56 /* 28 was sys_fstat */
57#define __NR_pause (__NR_SYSCALL_BASE+ 29)
58#define __NR_utime (__NR_SYSCALL_BASE+ 30)
59 /* 31 was sys_stty */
60 /* 32 was sys_gtty */
61#define __NR_access (__NR_SYSCALL_BASE+ 33)
62#define __NR_nice (__NR_SYSCALL_BASE+ 34)
63 /* 35 was sys_ftime */
64#define __NR_sync (__NR_SYSCALL_BASE+ 36)
65#define __NR_kill (__NR_SYSCALL_BASE+ 37)
66#define __NR_rename (__NR_SYSCALL_BASE+ 38)
67#define __NR_mkdir (__NR_SYSCALL_BASE+ 39)
68#define __NR_rmdir (__NR_SYSCALL_BASE+ 40)
69#define __NR_dup (__NR_SYSCALL_BASE+ 41)
70#define __NR_pipe (__NR_SYSCALL_BASE+ 42)
71#define __NR_times (__NR_SYSCALL_BASE+ 43)
72 /* 44 was sys_prof */
73#define __NR_brk (__NR_SYSCALL_BASE+ 45)
74#define __NR_setgid (__NR_SYSCALL_BASE+ 46)
75#define __NR_getgid (__NR_SYSCALL_BASE+ 47)
76 /* 48 was sys_signal */
77#define __NR_geteuid (__NR_SYSCALL_BASE+ 49)
78#define __NR_getegid (__NR_SYSCALL_BASE+ 50)
79#define __NR_acct (__NR_SYSCALL_BASE+ 51)
80#define __NR_umount2 (__NR_SYSCALL_BASE+ 52)
81 /* 53 was sys_lock */
82#define __NR_ioctl (__NR_SYSCALL_BASE+ 54)
83#define __NR_fcntl (__NR_SYSCALL_BASE+ 55)
84 /* 56 was sys_mpx */
85#define __NR_setpgid (__NR_SYSCALL_BASE+ 57)
86 /* 58 was sys_ulimit */
87 /* 59 was sys_olduname */
88#define __NR_umask (__NR_SYSCALL_BASE+ 60)
89#define __NR_chroot (__NR_SYSCALL_BASE+ 61)
90#define __NR_ustat (__NR_SYSCALL_BASE+ 62)
91#define __NR_dup2 (__NR_SYSCALL_BASE+ 63)
92#define __NR_getppid (__NR_SYSCALL_BASE+ 64)
93#define __NR_getpgrp (__NR_SYSCALL_BASE+ 65)
94#define __NR_setsid (__NR_SYSCALL_BASE+ 66)
95#define __NR_sigaction (__NR_SYSCALL_BASE+ 67)
96 /* 68 was sys_sgetmask */
97 /* 69 was sys_ssetmask */
98#define __NR_setreuid (__NR_SYSCALL_BASE+ 70)
99#define __NR_setregid (__NR_SYSCALL_BASE+ 71)
100#define __NR_sigsuspend (__NR_SYSCALL_BASE+ 72)
101#define __NR_sigpending (__NR_SYSCALL_BASE+ 73)
102#define __NR_sethostname (__NR_SYSCALL_BASE+ 74)
103#define __NR_setrlimit (__NR_SYSCALL_BASE+ 75)
104#define __NR_getrlimit (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */
105#define __NR_getrusage (__NR_SYSCALL_BASE+ 77)
106#define __NR_gettimeofday (__NR_SYSCALL_BASE+ 78)
107#define __NR_settimeofday (__NR_SYSCALL_BASE+ 79)
108#define __NR_getgroups (__NR_SYSCALL_BASE+ 80)
109#define __NR_setgroups (__NR_SYSCALL_BASE+ 81)
110#define __NR_select (__NR_SYSCALL_BASE+ 82)
111#define __NR_symlink (__NR_SYSCALL_BASE+ 83)
112 /* 84 was sys_lstat */
113#define __NR_readlink (__NR_SYSCALL_BASE+ 85)
114#define __NR_uselib (__NR_SYSCALL_BASE+ 86)
115#define __NR_swapon (__NR_SYSCALL_BASE+ 87)
116#define __NR_reboot (__NR_SYSCALL_BASE+ 88)
117#define __NR_readdir (__NR_SYSCALL_BASE+ 89)
118#define __NR_mmap (__NR_SYSCALL_BASE+ 90)
119#define __NR_munmap (__NR_SYSCALL_BASE+ 91)
120#define __NR_truncate (__NR_SYSCALL_BASE+ 92)
121#define __NR_ftruncate (__NR_SYSCALL_BASE+ 93)
122#define __NR_fchmod (__NR_SYSCALL_BASE+ 94)
123#define __NR_fchown (__NR_SYSCALL_BASE+ 95)
124#define __NR_getpriority (__NR_SYSCALL_BASE+ 96)
125#define __NR_setpriority (__NR_SYSCALL_BASE+ 97)
126 /* 98 was sys_profil */
127#define __NR_statfs (__NR_SYSCALL_BASE+ 99)
128#define __NR_fstatfs (__NR_SYSCALL_BASE+100)
129 /* 101 was sys_ioperm */
130#define __NR_socketcall (__NR_SYSCALL_BASE+102)
131#define __NR_syslog (__NR_SYSCALL_BASE+103)
132#define __NR_setitimer (__NR_SYSCALL_BASE+104)
133#define __NR_getitimer (__NR_SYSCALL_BASE+105)
134#define __NR_stat (__NR_SYSCALL_BASE+106)
135#define __NR_lstat (__NR_SYSCALL_BASE+107)
136#define __NR_fstat (__NR_SYSCALL_BASE+108)
137 /* 109 was sys_uname */
138 /* 110 was sys_iopl */
139#define __NR_vhangup (__NR_SYSCALL_BASE+111)
140 /* 112 was sys_idle */
141#define __NR_syscall (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */
142#define __NR_wait4 (__NR_SYSCALL_BASE+114)
143#define __NR_swapoff (__NR_SYSCALL_BASE+115)
144#define __NR_sysinfo (__NR_SYSCALL_BASE+116)
145#define __NR_ipc (__NR_SYSCALL_BASE+117)
146#define __NR_fsync (__NR_SYSCALL_BASE+118)
147#define __NR_sigreturn (__NR_SYSCALL_BASE+119)
148#define __NR_clone (__NR_SYSCALL_BASE+120)
149#define __NR_setdomainname (__NR_SYSCALL_BASE+121)
150#define __NR_uname (__NR_SYSCALL_BASE+122)
151 /* 123 was sys_modify_ldt */
152#define __NR_adjtimex (__NR_SYSCALL_BASE+124)
153#define __NR_mprotect (__NR_SYSCALL_BASE+125)
154#define __NR_sigprocmask (__NR_SYSCALL_BASE+126)
155 /* 127 was sys_create_module */
156#define __NR_init_module (__NR_SYSCALL_BASE+128)
157#define __NR_delete_module (__NR_SYSCALL_BASE+129)
158 /* 130 was sys_get_kernel_syms */
159#define __NR_quotactl (__NR_SYSCALL_BASE+131)
160#define __NR_getpgid (__NR_SYSCALL_BASE+132)
161#define __NR_fchdir (__NR_SYSCALL_BASE+133)
162#define __NR_bdflush (__NR_SYSCALL_BASE+134)
163#define __NR_sysfs (__NR_SYSCALL_BASE+135)
164#define __NR_personality (__NR_SYSCALL_BASE+136)
165 /* 137 was sys_afs_syscall */
166#define __NR_setfsuid (__NR_SYSCALL_BASE+138)
167#define __NR_setfsgid (__NR_SYSCALL_BASE+139)
168#define __NR__llseek (__NR_SYSCALL_BASE+140)
169#define __NR_getdents (__NR_SYSCALL_BASE+141)
170#define __NR__newselect (__NR_SYSCALL_BASE+142)
171#define __NR_flock (__NR_SYSCALL_BASE+143)
172#define __NR_msync (__NR_SYSCALL_BASE+144)
173#define __NR_readv (__NR_SYSCALL_BASE+145)
174#define __NR_writev (__NR_SYSCALL_BASE+146)
175#define __NR_getsid (__NR_SYSCALL_BASE+147)
176#define __NR_fdatasync (__NR_SYSCALL_BASE+148)
177#define __NR__sysctl (__NR_SYSCALL_BASE+149)
178#define __NR_mlock (__NR_SYSCALL_BASE+150)
179#define __NR_munlock (__NR_SYSCALL_BASE+151)
180#define __NR_mlockall (__NR_SYSCALL_BASE+152)
181#define __NR_munlockall (__NR_SYSCALL_BASE+153)
182#define __NR_sched_setparam (__NR_SYSCALL_BASE+154)
183#define __NR_sched_getparam (__NR_SYSCALL_BASE+155)
184#define __NR_sched_setscheduler (__NR_SYSCALL_BASE+156)
185#define __NR_sched_getscheduler (__NR_SYSCALL_BASE+157)
186#define __NR_sched_yield (__NR_SYSCALL_BASE+158)
187#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE+159)
188#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE+160)
189#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE+161)
190#define __NR_nanosleep (__NR_SYSCALL_BASE+162)
191#define __NR_mremap (__NR_SYSCALL_BASE+163)
192#define __NR_setresuid (__NR_SYSCALL_BASE+164)
193#define __NR_getresuid (__NR_SYSCALL_BASE+165)
194 /* 166 was sys_vm86 */
195 /* 167 was sys_query_module */
196#define __NR_poll (__NR_SYSCALL_BASE+168)
197#define __NR_nfsservctl (__NR_SYSCALL_BASE+169)
198#define __NR_setresgid (__NR_SYSCALL_BASE+170)
199#define __NR_getresgid (__NR_SYSCALL_BASE+171)
200#define __NR_prctl (__NR_SYSCALL_BASE+172)
201#define __NR_rt_sigreturn (__NR_SYSCALL_BASE+173)
202#define __NR_rt_sigaction (__NR_SYSCALL_BASE+174)
203#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE+175)
204#define __NR_rt_sigpending (__NR_SYSCALL_BASE+176)
205#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE+177)
206#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE+178)
207#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)
208#define __NR_pread64 (__NR_SYSCALL_BASE+180)
209#define __NR_pwrite64 (__NR_SYSCALL_BASE+181)
210#define __NR_chown (__NR_SYSCALL_BASE+182)
211#define __NR_getcwd (__NR_SYSCALL_BASE+183)
212#define __NR_capget (__NR_SYSCALL_BASE+184)
213#define __NR_capset (__NR_SYSCALL_BASE+185)
214#define __NR_sigaltstack (__NR_SYSCALL_BASE+186)
215#define __NR_sendfile (__NR_SYSCALL_BASE+187)
216 /* 188 reserved */
217 /* 189 reserved */
218#define __NR_vfork (__NR_SYSCALL_BASE+190)
219#define __NR_ugetrlimit (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */
220#define __NR_mmap2 (__NR_SYSCALL_BASE+192)
221#define __NR_truncate64 (__NR_SYSCALL_BASE+193)
222#define __NR_ftruncate64 (__NR_SYSCALL_BASE+194)
223#define __NR_stat64 (__NR_SYSCALL_BASE+195)
224#define __NR_lstat64 (__NR_SYSCALL_BASE+196)
225#define __NR_fstat64 (__NR_SYSCALL_BASE+197)
226#define __NR_lchown32 (__NR_SYSCALL_BASE+198)
227#define __NR_getuid32 (__NR_SYSCALL_BASE+199)
228#define __NR_getgid32 (__NR_SYSCALL_BASE+200)
229#define __NR_geteuid32 (__NR_SYSCALL_BASE+201)
230#define __NR_getegid32 (__NR_SYSCALL_BASE+202)
231#define __NR_setreuid32 (__NR_SYSCALL_BASE+203)
232#define __NR_setregid32 (__NR_SYSCALL_BASE+204)
233#define __NR_getgroups32 (__NR_SYSCALL_BASE+205)
234#define __NR_setgroups32 (__NR_SYSCALL_BASE+206)
235#define __NR_fchown32 (__NR_SYSCALL_BASE+207)
236#define __NR_setresuid32 (__NR_SYSCALL_BASE+208)
237#define __NR_getresuid32 (__NR_SYSCALL_BASE+209)
238#define __NR_setresgid32 (__NR_SYSCALL_BASE+210)
239#define __NR_getresgid32 (__NR_SYSCALL_BASE+211)
240#define __NR_chown32 (__NR_SYSCALL_BASE+212)
241#define __NR_setuid32 (__NR_SYSCALL_BASE+213)
242#define __NR_setgid32 (__NR_SYSCALL_BASE+214)
243#define __NR_setfsuid32 (__NR_SYSCALL_BASE+215)
244#define __NR_setfsgid32 (__NR_SYSCALL_BASE+216)
245#define __NR_getdents64 (__NR_SYSCALL_BASE+217)
246#define __NR_pivot_root (__NR_SYSCALL_BASE+218)
247#define __NR_mincore (__NR_SYSCALL_BASE+219)
248#define __NR_madvise (__NR_SYSCALL_BASE+220)
249#define __NR_fcntl64 (__NR_SYSCALL_BASE+221)
250 /* 222 for tux */
251 /* 223 is unused */
252#define __NR_gettid (__NR_SYSCALL_BASE+224)
253#define __NR_readahead (__NR_SYSCALL_BASE+225)
254#define __NR_setxattr (__NR_SYSCALL_BASE+226)
255#define __NR_lsetxattr (__NR_SYSCALL_BASE+227)
256#define __NR_fsetxattr (__NR_SYSCALL_BASE+228)
257#define __NR_getxattr (__NR_SYSCALL_BASE+229)
258#define __NR_lgetxattr (__NR_SYSCALL_BASE+230)
259#define __NR_fgetxattr (__NR_SYSCALL_BASE+231)
260#define __NR_listxattr (__NR_SYSCALL_BASE+232)
261#define __NR_llistxattr (__NR_SYSCALL_BASE+233)
262#define __NR_flistxattr (__NR_SYSCALL_BASE+234)
263#define __NR_removexattr (__NR_SYSCALL_BASE+235)
264#define __NR_lremovexattr (__NR_SYSCALL_BASE+236)
265#define __NR_fremovexattr (__NR_SYSCALL_BASE+237)
266#define __NR_tkill (__NR_SYSCALL_BASE+238)
267#define __NR_sendfile64 (__NR_SYSCALL_BASE+239)
268#define __NR_futex (__NR_SYSCALL_BASE+240)
269#define __NR_sched_setaffinity (__NR_SYSCALL_BASE+241)
270#define __NR_sched_getaffinity (__NR_SYSCALL_BASE+242)
271#define __NR_io_setup (__NR_SYSCALL_BASE+243)
272#define __NR_io_destroy (__NR_SYSCALL_BASE+244)
273#define __NR_io_getevents (__NR_SYSCALL_BASE+245)
274#define __NR_io_submit (__NR_SYSCALL_BASE+246)
275#define __NR_io_cancel (__NR_SYSCALL_BASE+247)
276#define __NR_exit_group (__NR_SYSCALL_BASE+248)
277#define __NR_lookup_dcookie (__NR_SYSCALL_BASE+249)
278#define __NR_epoll_create (__NR_SYSCALL_BASE+250)
279#define __NR_epoll_ctl (__NR_SYSCALL_BASE+251)
280#define __NR_epoll_wait (__NR_SYSCALL_BASE+252)
281#define __NR_remap_file_pages (__NR_SYSCALL_BASE+253)
282 /* 254 for set_thread_area */
283 /* 255 for get_thread_area */
284#define __NR_set_tid_address (__NR_SYSCALL_BASE+256)
285#define __NR_timer_create (__NR_SYSCALL_BASE+257)
286#define __NR_timer_settime (__NR_SYSCALL_BASE+258)
287#define __NR_timer_gettime (__NR_SYSCALL_BASE+259)
288#define __NR_timer_getoverrun (__NR_SYSCALL_BASE+260)
289#define __NR_timer_delete (__NR_SYSCALL_BASE+261)
290#define __NR_clock_settime (__NR_SYSCALL_BASE+262)
291#define __NR_clock_gettime (__NR_SYSCALL_BASE+263)
292#define __NR_clock_getres (__NR_SYSCALL_BASE+264)
293#define __NR_clock_nanosleep (__NR_SYSCALL_BASE+265)
294#define __NR_statfs64 (__NR_SYSCALL_BASE+266)
295#define __NR_fstatfs64 (__NR_SYSCALL_BASE+267)
296#define __NR_tgkill (__NR_SYSCALL_BASE+268)
297#define __NR_utimes (__NR_SYSCALL_BASE+269)
298#define __NR_arm_fadvise64_64 (__NR_SYSCALL_BASE+270)
299#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE+271)
300#define __NR_pciconfig_read (__NR_SYSCALL_BASE+272)
301#define __NR_pciconfig_write (__NR_SYSCALL_BASE+273)
302#define __NR_mq_open (__NR_SYSCALL_BASE+274)
303#define __NR_mq_unlink (__NR_SYSCALL_BASE+275)
304#define __NR_mq_timedsend (__NR_SYSCALL_BASE+276)
305#define __NR_mq_timedreceive (__NR_SYSCALL_BASE+277)
306#define __NR_mq_notify (__NR_SYSCALL_BASE+278)
307#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279)
308#define __NR_waitid (__NR_SYSCALL_BASE+280)
309#define __NR_socket (__NR_SYSCALL_BASE+281)
310#define __NR_bind (__NR_SYSCALL_BASE+282)
311#define __NR_connect (__NR_SYSCALL_BASE+283)
312#define __NR_listen (__NR_SYSCALL_BASE+284)
313#define __NR_accept (__NR_SYSCALL_BASE+285)
314#define __NR_getsockname (__NR_SYSCALL_BASE+286)
315#define __NR_getpeername (__NR_SYSCALL_BASE+287)
316#define __NR_socketpair (__NR_SYSCALL_BASE+288)
317#define __NR_send (__NR_SYSCALL_BASE+289)
318#define __NR_sendto (__NR_SYSCALL_BASE+290)
319#define __NR_recv (__NR_SYSCALL_BASE+291)
320#define __NR_recvfrom (__NR_SYSCALL_BASE+292)
321#define __NR_shutdown (__NR_SYSCALL_BASE+293)
322#define __NR_setsockopt (__NR_SYSCALL_BASE+294)
323#define __NR_getsockopt (__NR_SYSCALL_BASE+295)
324#define __NR_sendmsg (__NR_SYSCALL_BASE+296)
325#define __NR_recvmsg (__NR_SYSCALL_BASE+297)
326#define __NR_semop (__NR_SYSCALL_BASE+298)
327#define __NR_semget (__NR_SYSCALL_BASE+299)
328#define __NR_semctl (__NR_SYSCALL_BASE+300)
329#define __NR_msgsnd (__NR_SYSCALL_BASE+301)
330#define __NR_msgrcv (__NR_SYSCALL_BASE+302)
331#define __NR_msgget (__NR_SYSCALL_BASE+303)
332#define __NR_msgctl (__NR_SYSCALL_BASE+304)
333#define __NR_shmat (__NR_SYSCALL_BASE+305)
334#define __NR_shmdt (__NR_SYSCALL_BASE+306)
335#define __NR_shmget (__NR_SYSCALL_BASE+307)
336#define __NR_shmctl (__NR_SYSCALL_BASE+308)
337#define __NR_add_key (__NR_SYSCALL_BASE+309)
338#define __NR_request_key (__NR_SYSCALL_BASE+310)
339#define __NR_keyctl (__NR_SYSCALL_BASE+311)
340#define __NR_semtimedop (__NR_SYSCALL_BASE+312)
341#define __NR_vserver (__NR_SYSCALL_BASE+313)
342#define __NR_ioprio_set (__NR_SYSCALL_BASE+314)
343#define __NR_ioprio_get (__NR_SYSCALL_BASE+315)
344#define __NR_inotify_init (__NR_SYSCALL_BASE+316)
345#define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317)
346#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318)
347#define __NR_mbind (__NR_SYSCALL_BASE+319)
348#define __NR_get_mempolicy (__NR_SYSCALL_BASE+320)
349#define __NR_set_mempolicy (__NR_SYSCALL_BASE+321)
350#define __NR_openat (__NR_SYSCALL_BASE+322)
351#define __NR_mkdirat (__NR_SYSCALL_BASE+323)
352#define __NR_mknodat (__NR_SYSCALL_BASE+324)
353#define __NR_fchownat (__NR_SYSCALL_BASE+325)
354#define __NR_futimesat (__NR_SYSCALL_BASE+326)
355#define __NR_fstatat64 (__NR_SYSCALL_BASE+327)
356#define __NR_unlinkat (__NR_SYSCALL_BASE+328)
357#define __NR_renameat (__NR_SYSCALL_BASE+329)
358#define __NR_linkat (__NR_SYSCALL_BASE+330)
359#define __NR_symlinkat (__NR_SYSCALL_BASE+331)
360#define __NR_readlinkat (__NR_SYSCALL_BASE+332)
361#define __NR_fchmodat (__NR_SYSCALL_BASE+333)
362#define __NR_faccessat (__NR_SYSCALL_BASE+334)
363#define __NR_pselect6 (__NR_SYSCALL_BASE+335)
364#define __NR_ppoll (__NR_SYSCALL_BASE+336)
365#define __NR_unshare (__NR_SYSCALL_BASE+337)
366#define __NR_set_robust_list (__NR_SYSCALL_BASE+338)
367#define __NR_get_robust_list (__NR_SYSCALL_BASE+339)
368#define __NR_splice (__NR_SYSCALL_BASE+340)
369#define __NR_arm_sync_file_range (__NR_SYSCALL_BASE+341)
370#define __NR_sync_file_range2 __NR_arm_sync_file_range
371#define __NR_tee (__NR_SYSCALL_BASE+342)
372#define __NR_vmsplice (__NR_SYSCALL_BASE+343)
373#define __NR_move_pages (__NR_SYSCALL_BASE+344)
374#define __NR_getcpu (__NR_SYSCALL_BASE+345)
375#define __NR_epoll_pwait (__NR_SYSCALL_BASE+346)
376#define __NR_kexec_load (__NR_SYSCALL_BASE+347)
377#define __NR_utimensat (__NR_SYSCALL_BASE+348)
378#define __NR_signalfd (__NR_SYSCALL_BASE+349)
379#define __NR_timerfd_create (__NR_SYSCALL_BASE+350)
380#define __NR_eventfd (__NR_SYSCALL_BASE+351)
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)
384#define __NR_signalfd4 (__NR_SYSCALL_BASE+355)
385#define __NR_eventfd2 (__NR_SYSCALL_BASE+356)
386#define __NR_epoll_create1 (__NR_SYSCALL_BASE+357)
387#define __NR_dup3 (__NR_SYSCALL_BASE+358)
388#define __NR_pipe2 (__NR_SYSCALL_BASE+359)
389#define __NR_inotify_init1 (__NR_SYSCALL_BASE+360)
390#define __NR_preadv (__NR_SYSCALL_BASE+361)
391#define __NR_pwritev (__NR_SYSCALL_BASE+362)
392#define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE+363)
393#define __NR_perf_event_open (__NR_SYSCALL_BASE+364)
394#define __NR_recvmmsg (__NR_SYSCALL_BASE+365)
395#define __NR_accept4 (__NR_SYSCALL_BASE+366)
396#define __NR_fanotify_init (__NR_SYSCALL_BASE+367)
397#define __NR_fanotify_mark (__NR_SYSCALL_BASE+368)
398#define __NR_prlimit64 (__NR_SYSCALL_BASE+369)
399#define __NR_name_to_handle_at (__NR_SYSCALL_BASE+370)
400#define __NR_open_by_handle_at (__NR_SYSCALL_BASE+371)
401#define __NR_clock_adjtime (__NR_SYSCALL_BASE+372)
402#define __NR_syncfs (__NR_SYSCALL_BASE+373)
403#define __NR_sendmmsg (__NR_SYSCALL_BASE+374)
404#define __NR_setns (__NR_SYSCALL_BASE+375)
405#define __NR_process_vm_readv (__NR_SYSCALL_BASE+376)
406#define __NR_process_vm_writev (__NR_SYSCALL_BASE+377)
407 /* 378 for kcmp */
408
409/*
410 * This may need to be greater than __NR_last_syscall+1 in order to
411 * account for the padding in the syscall table
412 */
413#ifdef __KERNEL__
414#define __NR_syscalls (380) 18#define __NR_syscalls (380)
415#endif /* __KERNEL__ */
416
417/*
418 * The following SWIs are ARM private.
419 */
420#define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
421#define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
422#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
423#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
424#define __ARM_NR_usr32 (__ARM_NR_BASE+4)
425#define __ARM_NR_set_tls (__ARM_NR_BASE+5)
426
427/*
428 * *NOTE*: This is a ghost syscall private to the kernel. Only the
429 * __kuser_cmpxchg code in entry-armv.S should be aware of its
430 * existence. Don't ever use this from user code.
431 */
432#ifdef __KERNEL__
433#define __ARM_NR_cmpxchg (__ARM_NR_BASE+0x00fff0) 19#define __ARM_NR_cmpxchg (__ARM_NR_BASE+0x00fff0)
434#endif
435
436/*
437 * The following syscalls are obsolete and no longer available for EABI.
438 */
439#if !defined(__KERNEL__)
440#if defined(__ARM_EABI__)
441#undef __NR_time
442#undef __NR_umount
443#undef __NR_stime
444#undef __NR_alarm
445#undef __NR_utime
446#undef __NR_getrlimit
447#undef __NR_select
448#undef __NR_readdir
449#undef __NR_mmap
450#undef __NR_socketcall
451#undef __NR_syscall
452#undef __NR_ipc
453#endif
454#endif
455
456#ifdef __KERNEL__
457 20
458#define __ARCH_WANT_STAT64 21#define __ARCH_WANT_STAT64
459#define __ARCH_WANT_SYS_GETHOSTNAME 22#define __ARCH_WANT_SYS_GETHOSTNAME
@@ -495,5 +58,4 @@
495#define __IGNORE_migrate_pages 58#define __IGNORE_migrate_pages
496#define __IGNORE_kcmp 59#define __IGNORE_kcmp
497 60
498#endif /* __KERNEL__ */
499#endif /* __ASM_ARM_UNISTD_H */ 61#endif /* __ASM_ARM_UNISTD_H */
diff --git a/arch/arm/include/uapi/asm/Kbuild b/arch/arm/include/uapi/asm/Kbuild
index baebb3da1d44..47bcb2d254af 100644
--- a/arch/arm/include/uapi/asm/Kbuild
+++ b/arch/arm/include/uapi/asm/Kbuild
@@ -1,3 +1,19 @@
1# UAPI Header export list 1# UAPI Header export list
2include include/uapi/asm-generic/Kbuild.asm 2include include/uapi/asm-generic/Kbuild.asm
3 3
4header-y += a.out.h
5header-y += byteorder.h
6header-y += fcntl.h
7header-y += hwcap.h
8header-y += ioctls.h
9header-y += kvm_para.h
10header-y += mman.h
11header-y += posix_types.h
12header-y += ptrace.h
13header-y += setup.h
14header-y += sigcontext.h
15header-y += signal.h
16header-y += stat.h
17header-y += statfs.h
18header-y += swab.h
19header-y += unistd.h
diff --git a/arch/arm/include/asm/a.out.h b/arch/arm/include/uapi/asm/a.out.h
index 083894b2e3bc..083894b2e3bc 100644
--- a/arch/arm/include/asm/a.out.h
+++ b/arch/arm/include/uapi/asm/a.out.h
diff --git a/arch/arm/include/asm/byteorder.h b/arch/arm/include/uapi/asm/byteorder.h
index 77379748b171..77379748b171 100644
--- a/arch/arm/include/asm/byteorder.h
+++ b/arch/arm/include/uapi/asm/byteorder.h
diff --git a/arch/arm/include/asm/fcntl.h b/arch/arm/include/uapi/asm/fcntl.h
index a80b6607b2ef..a80b6607b2ef 100644
--- a/arch/arm/include/asm/fcntl.h
+++ b/arch/arm/include/uapi/asm/fcntl.h
diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h
new file mode 100644
index 000000000000..f254f6503cce
--- /dev/null
+++ b/arch/arm/include/uapi/asm/hwcap.h
@@ -0,0 +1,29 @@
1#ifndef _UAPI__ASMARM_HWCAP_H
2#define _UAPI__ASMARM_HWCAP_H
3
4/*
5 * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
6 */
7#define HWCAP_SWP (1 << 0)
8#define HWCAP_HALF (1 << 1)
9#define HWCAP_THUMB (1 << 2)
10#define HWCAP_26BIT (1 << 3) /* Play it safe */
11#define HWCAP_FAST_MULT (1 << 4)
12#define HWCAP_FPA (1 << 5)
13#define HWCAP_VFP (1 << 6)
14#define HWCAP_EDSP (1 << 7)
15#define HWCAP_JAVA (1 << 8)
16#define HWCAP_IWMMXT (1 << 9)
17#define HWCAP_CRUNCH (1 << 10)
18#define HWCAP_THUMBEE (1 << 11)
19#define HWCAP_NEON (1 << 12)
20#define HWCAP_VFPv3 (1 << 13)
21#define HWCAP_VFPv3D16 (1 << 14)
22#define HWCAP_TLS (1 << 15)
23#define HWCAP_VFPv4 (1 << 16)
24#define HWCAP_IDIVA (1 << 17)
25#define HWCAP_IDIVT (1 << 18)
26#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
27
28
29#endif /* _UAPI__ASMARM_HWCAP_H */
diff --git a/arch/arm/include/asm/ioctls.h b/arch/arm/include/uapi/asm/ioctls.h
index 9c9629816128..9c9629816128 100644
--- a/arch/arm/include/asm/ioctls.h
+++ b/arch/arm/include/uapi/asm/ioctls.h
diff --git a/arch/arm/include/asm/kvm_para.h b/arch/arm/include/uapi/asm/kvm_para.h
index 14fab8f0b957..14fab8f0b957 100644
--- a/arch/arm/include/asm/kvm_para.h
+++ b/arch/arm/include/uapi/asm/kvm_para.h
diff --git a/arch/arm/include/asm/mman.h b/arch/arm/include/uapi/asm/mman.h
index 41f99c573b93..41f99c573b93 100644
--- a/arch/arm/include/asm/mman.h
+++ b/arch/arm/include/uapi/asm/mman.h
diff --git a/arch/arm/include/asm/posix_types.h b/arch/arm/include/uapi/asm/posix_types.h
index d2de9cbbcd9b..d2de9cbbcd9b 100644
--- a/arch/arm/include/asm/posix_types.h
+++ b/arch/arm/include/uapi/asm/posix_types.h
diff --git a/arch/arm/include/uapi/asm/ptrace.h b/arch/arm/include/uapi/asm/ptrace.h
new file mode 100644
index 000000000000..96ee0929790f
--- /dev/null
+++ b/arch/arm/include/uapi/asm/ptrace.h
@@ -0,0 +1,138 @@
1/*
2 * arch/arm/include/asm/ptrace.h
3 *
4 * Copyright (C) 1996-2003 Russell King
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 _UAPI__ASM_ARM_PTRACE_H
11#define _UAPI__ASM_ARM_PTRACE_H
12
13#include <asm/hwcap.h>
14
15#define PTRACE_GETREGS 12
16#define PTRACE_SETREGS 13
17#define PTRACE_GETFPREGS 14
18#define PTRACE_SETFPREGS 15
19/* PTRACE_ATTACH is 16 */
20/* PTRACE_DETACH is 17 */
21#define PTRACE_GETWMMXREGS 18
22#define PTRACE_SETWMMXREGS 19
23/* 20 is unused */
24#define PTRACE_OLDSETOPTIONS 21
25#define PTRACE_GET_THREAD_AREA 22
26#define PTRACE_SET_SYSCALL 23
27/* PTRACE_SYSCALL is 24 */
28#define PTRACE_GETCRUNCHREGS 25
29#define PTRACE_SETCRUNCHREGS 26
30#define PTRACE_GETVFPREGS 27
31#define PTRACE_SETVFPREGS 28
32#define PTRACE_GETHBPREGS 29
33#define PTRACE_SETHBPREGS 30
34
35/*
36 * PSR bits
37 */
38#define USR26_MODE 0x00000000
39#define FIQ26_MODE 0x00000001
40#define IRQ26_MODE 0x00000002
41#define SVC26_MODE 0x00000003
42#define USR_MODE 0x00000010
43#define FIQ_MODE 0x00000011
44#define IRQ_MODE 0x00000012
45#define SVC_MODE 0x00000013
46#define ABT_MODE 0x00000017
47#define HYP_MODE 0x0000001a
48#define UND_MODE 0x0000001b
49#define SYSTEM_MODE 0x0000001f
50#define MODE32_BIT 0x00000010
51#define MODE_MASK 0x0000001f
52#define PSR_T_BIT 0x00000020
53#define PSR_F_BIT 0x00000040
54#define PSR_I_BIT 0x00000080
55#define PSR_A_BIT 0x00000100
56#define PSR_E_BIT 0x00000200
57#define PSR_J_BIT 0x01000000
58#define PSR_Q_BIT 0x08000000
59#define PSR_V_BIT 0x10000000
60#define PSR_C_BIT 0x20000000
61#define PSR_Z_BIT 0x40000000
62#define PSR_N_BIT 0x80000000
63
64/*
65 * Groups of PSR bits
66 */
67#define PSR_f 0xff000000 /* Flags */
68#define PSR_s 0x00ff0000 /* Status */
69#define PSR_x 0x0000ff00 /* Extension */
70#define PSR_c 0x000000ff /* Control */
71
72/*
73 * ARMv7 groups of PSR bits
74 */
75#define APSR_MASK 0xf80f0000 /* N, Z, C, V, Q and GE flags */
76#define PSR_ISET_MASK 0x01000010 /* ISA state (J, T) mask */
77#define PSR_IT_MASK 0x0600fc00 /* If-Then execution state mask */
78#define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */
79
80/*
81 * Default endianness state
82 */
83#ifdef CONFIG_CPU_ENDIAN_BE8
84#define PSR_ENDSTATE PSR_E_BIT
85#else
86#define PSR_ENDSTATE 0
87#endif
88
89/*
90 * These are 'magic' values for PTRACE_PEEKUSR that return info about where a
91 * process is located in memory.
92 */
93#define PT_TEXT_ADDR 0x10000
94#define PT_DATA_ADDR 0x10004
95#define PT_TEXT_END_ADDR 0x10008
96
97#ifndef __ASSEMBLY__
98
99/*
100 * This struct defines the way the registers are stored on the
101 * stack during a system call. Note that sizeof(struct pt_regs)
102 * has to be a multiple of 8.
103 */
104#ifndef __KERNEL__
105struct pt_regs {
106 long uregs[18];
107};
108#endif /* __KERNEL__ */
109
110#define ARM_cpsr uregs[16]
111#define ARM_pc uregs[15]
112#define ARM_lr uregs[14]
113#define ARM_sp uregs[13]
114#define ARM_ip uregs[12]
115#define ARM_fp uregs[11]
116#define ARM_r10 uregs[10]
117#define ARM_r9 uregs[9]
118#define ARM_r8 uregs[8]
119#define ARM_r7 uregs[7]
120#define ARM_r6 uregs[6]
121#define ARM_r5 uregs[5]
122#define ARM_r4 uregs[4]
123#define ARM_r3 uregs[3]
124#define ARM_r2 uregs[2]
125#define ARM_r1 uregs[1]
126#define ARM_r0 uregs[0]
127#define ARM_ORIG_r0 uregs[17]
128
129/*
130 * The size of the user-visible VFP state as seen by PTRACE_GET/SETVFPREGS
131 * and core dumps.
132 */
133#define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ )
134
135
136#endif /* __ASSEMBLY__ */
137
138#endif /* _UAPI__ASM_ARM_PTRACE_H */
diff --git a/arch/arm/include/uapi/asm/setup.h b/arch/arm/include/uapi/asm/setup.h
new file mode 100644
index 000000000000..979ff4016404
--- /dev/null
+++ b/arch/arm/include/uapi/asm/setup.h
@@ -0,0 +1,187 @@
1/*
2 * linux/include/asm/setup.h
3 *
4 * Copyright (C) 1997-1999 Russell King
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 * Structure passed to kernel to tell it about the
11 * hardware it's running on. See Documentation/arm/Setup
12 * for more info.
13 */
14#ifndef _UAPI__ASMARM_SETUP_H
15#define _UAPI__ASMARM_SETUP_H
16
17#include <linux/types.h>
18
19#define COMMAND_LINE_SIZE 1024
20
21/* The list ends with an ATAG_NONE node. */
22#define ATAG_NONE 0x00000000
23
24struct tag_header {
25 __u32 size;
26 __u32 tag;
27};
28
29/* The list must start with an ATAG_CORE node */
30#define ATAG_CORE 0x54410001
31
32struct tag_core {
33 __u32 flags; /* bit 0 = read-only */
34 __u32 pagesize;
35 __u32 rootdev;
36};
37
38/* it is allowed to have multiple ATAG_MEM nodes */
39#define ATAG_MEM 0x54410002
40
41struct tag_mem32 {
42 __u32 size;
43 __u32 start; /* physical start address */
44};
45
46/* VGA text type displays */
47#define ATAG_VIDEOTEXT 0x54410003
48
49struct tag_videotext {
50 __u8 x;
51 __u8 y;
52 __u16 video_page;
53 __u8 video_mode;
54 __u8 video_cols;
55 __u16 video_ega_bx;
56 __u8 video_lines;
57 __u8 video_isvga;
58 __u16 video_points;
59};
60
61/* describes how the ramdisk will be used in kernel */
62#define ATAG_RAMDISK 0x54410004
63
64struct tag_ramdisk {
65 __u32 flags; /* bit 0 = load, bit 1 = prompt */
66 __u32 size; /* decompressed ramdisk size in _kilo_ bytes */
67 __u32 start; /* starting block of floppy-based RAM disk image */
68};
69
70/* describes where the compressed ramdisk image lives (virtual address) */
71/*
72 * this one accidentally used virtual addresses - as such,
73 * it's deprecated.
74 */
75#define ATAG_INITRD 0x54410005
76
77/* describes where the compressed ramdisk image lives (physical address) */
78#define ATAG_INITRD2 0x54420005
79
80struct tag_initrd {
81 __u32 start; /* physical start address */
82 __u32 size; /* size of compressed ramdisk image in bytes */
83};
84
85/* board serial number. "64 bits should be enough for everybody" */
86#define ATAG_SERIAL 0x54410006
87
88struct tag_serialnr {
89 __u32 low;
90 __u32 high;
91};
92
93/* board revision */
94#define ATAG_REVISION 0x54410007
95
96struct tag_revision {
97 __u32 rev;
98};
99
100/* initial values for vesafb-type framebuffers. see struct screen_info
101 * in include/linux/tty.h
102 */
103#define ATAG_VIDEOLFB 0x54410008
104
105struct tag_videolfb {
106 __u16 lfb_width;
107 __u16 lfb_height;
108 __u16 lfb_depth;
109 __u16 lfb_linelength;
110 __u32 lfb_base;
111 __u32 lfb_size;
112 __u8 red_size;
113 __u8 red_pos;
114 __u8 green_size;
115 __u8 green_pos;
116 __u8 blue_size;
117 __u8 blue_pos;
118 __u8 rsvd_size;
119 __u8 rsvd_pos;
120};
121
122/* command line: \0 terminated string */
123#define ATAG_CMDLINE 0x54410009
124
125struct tag_cmdline {
126 char cmdline[1]; /* this is the minimum size */
127};
128
129/* acorn RiscPC specific information */
130#define ATAG_ACORN 0x41000101
131
132struct tag_acorn {
133 __u32 memc_control_reg;
134 __u32 vram_pages;
135 __u8 sounddefault;
136 __u8 adfsdrives;
137};
138
139/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
140#define ATAG_MEMCLK 0x41000402
141
142struct tag_memclk {
143 __u32 fmemclk;
144};
145
146struct tag {
147 struct tag_header hdr;
148 union {
149 struct tag_core core;
150 struct tag_mem32 mem;
151 struct tag_videotext videotext;
152 struct tag_ramdisk ramdisk;
153 struct tag_initrd initrd;
154 struct tag_serialnr serialnr;
155 struct tag_revision revision;
156 struct tag_videolfb videolfb;
157 struct tag_cmdline cmdline;
158
159 /*
160 * Acorn specific
161 */
162 struct tag_acorn acorn;
163
164 /*
165 * DC21285 specific
166 */
167 struct tag_memclk memclk;
168 } u;
169};
170
171struct tagtable {
172 __u32 tag;
173 int (*parse)(const struct tag *);
174};
175
176#define tag_member_present(tag,member) \
177 ((unsigned long)(&((struct tag *)0L)->member + 1) \
178 <= (tag)->hdr.size * 4)
179
180#define tag_next(t) ((struct tag *)((__u32 *)(t) + (t)->hdr.size))
181#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
182
183#define for_each_tag(t,base) \
184 for (t = base; t->hdr.size; t = tag_next(t))
185
186
187#endif /* _UAPI__ASMARM_SETUP_H */
diff --git a/arch/arm/include/asm/sigcontext.h b/arch/arm/include/uapi/asm/sigcontext.h
index fc0b80b6a6fc..fc0b80b6a6fc 100644
--- a/arch/arm/include/asm/sigcontext.h
+++ b/arch/arm/include/uapi/asm/sigcontext.h
diff --git a/arch/arm/include/uapi/asm/signal.h b/arch/arm/include/uapi/asm/signal.h
new file mode 100644
index 000000000000..921c57fdc52e
--- /dev/null
+++ b/arch/arm/include/uapi/asm/signal.h
@@ -0,0 +1,127 @@
1#ifndef _UAPI_ASMARM_SIGNAL_H
2#define _UAPI_ASMARM_SIGNAL_H
3
4#include <linux/types.h>
5
6/* Avoid too many header ordering problems. */
7struct siginfo;
8
9#ifndef __KERNEL__
10/* Here we must cater to libcs that poke about in kernel headers. */
11
12#define NSIG 32
13typedef unsigned long sigset_t;
14
15#endif /* __KERNEL__ */
16
17#define SIGHUP 1
18#define SIGINT 2
19#define SIGQUIT 3
20#define SIGILL 4
21#define SIGTRAP 5
22#define SIGABRT 6
23#define SIGIOT 6
24#define SIGBUS 7
25#define SIGFPE 8
26#define SIGKILL 9
27#define SIGUSR1 10
28#define SIGSEGV 11
29#define SIGUSR2 12
30#define SIGPIPE 13
31#define SIGALRM 14
32#define SIGTERM 15
33#define SIGSTKFLT 16
34#define SIGCHLD 17
35#define SIGCONT 18
36#define SIGSTOP 19
37#define SIGTSTP 20
38#define SIGTTIN 21
39#define SIGTTOU 22
40#define SIGURG 23
41#define SIGXCPU 24
42#define SIGXFSZ 25
43#define SIGVTALRM 26
44#define SIGPROF 27
45#define SIGWINCH 28
46#define SIGIO 29
47#define SIGPOLL SIGIO
48/*
49#define SIGLOST 29
50*/
51#define SIGPWR 30
52#define SIGSYS 31
53#define SIGUNUSED 31
54
55/* These should not be considered constants from userland. */
56#define SIGRTMIN 32
57#define SIGRTMAX _NSIG
58
59#define SIGSWI 32
60
61/*
62 * SA_FLAGS values:
63 *
64 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
65 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
66 * SA_SIGINFO deliver the signal with SIGINFO structs
67 * SA_THIRTYTWO delivers the signal in 32-bit mode, even if the task
68 * is running in 26-bit.
69 * SA_ONSTACK allows alternate signal stacks (see sigaltstack(2)).
70 * SA_RESTART flag to get restarting signals (which were the default long ago)
71 * SA_NODEFER prevents the current signal from being masked in the handler.
72 * SA_RESETHAND clears the handler when the signal is delivered.
73 *
74 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
75 * Unix names RESETHAND and NODEFER respectively.
76 */
77#define SA_NOCLDSTOP 0x00000001
78#define SA_NOCLDWAIT 0x00000002
79#define SA_SIGINFO 0x00000004
80#define SA_THIRTYTWO 0x02000000
81#define SA_RESTORER 0x04000000
82#define SA_ONSTACK 0x08000000
83#define SA_RESTART 0x10000000
84#define SA_NODEFER 0x40000000
85#define SA_RESETHAND 0x80000000
86
87#define SA_NOMASK SA_NODEFER
88#define SA_ONESHOT SA_RESETHAND
89
90
91/*
92 * sigaltstack controls
93 */
94#define SS_ONSTACK 1
95#define SS_DISABLE 2
96
97#define MINSIGSTKSZ 2048
98#define SIGSTKSZ 8192
99
100#include <asm-generic/signal-defs.h>
101
102#ifndef __KERNEL__
103/* Here we must cater to libcs that poke about in kernel headers. */
104
105struct sigaction {
106 union {
107 __sighandler_t _sa_handler;
108 void (*_sa_sigaction)(int, struct siginfo *, void *);
109 } _u;
110 sigset_t sa_mask;
111 unsigned long sa_flags;
112 void (*sa_restorer)(void);
113};
114
115#define sa_handler _u._sa_handler
116#define sa_sigaction _u._sa_sigaction
117
118#endif /* __KERNEL__ */
119
120typedef struct sigaltstack {
121 void __user *ss_sp;
122 int ss_flags;
123 size_t ss_size;
124} stack_t;
125
126
127#endif /* _UAPI_ASMARM_SIGNAL_H */
diff --git a/arch/arm/include/asm/stat.h b/arch/arm/include/uapi/asm/stat.h
index 42c0c13999d5..42c0c13999d5 100644
--- a/arch/arm/include/asm/stat.h
+++ b/arch/arm/include/uapi/asm/stat.h
diff --git a/arch/arm/include/asm/statfs.h b/arch/arm/include/uapi/asm/statfs.h
index 079447c05ba7..079447c05ba7 100644
--- a/arch/arm/include/asm/statfs.h
+++ b/arch/arm/include/uapi/asm/statfs.h
diff --git a/arch/arm/include/uapi/asm/swab.h b/arch/arm/include/uapi/asm/swab.h
new file mode 100644
index 000000000000..6fcb32a5c453
--- /dev/null
+++ b/arch/arm/include/uapi/asm/swab.h
@@ -0,0 +1,53 @@
1/*
2 * arch/arm/include/asm/byteorder.h
3 *
4 * ARM Endian-ness. In little endian mode, the data bus is connected such
5 * that byte accesses appear as:
6 * 0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
7 * and word accesses (data or instruction) appear as:
8 * d0...d31
9 *
10 * When in big endian mode, byte accesses appear as:
11 * 0 = d24...d31, 1 = d16...d23, 2 = d8...d15, 3 = d0...d7
12 * and word accesses (data or instruction) appear as:
13 * d0...d31
14 */
15#ifndef _UAPI__ASM_ARM_SWAB_H
16#define _UAPI__ASM_ARM_SWAB_H
17
18#include <linux/compiler.h>
19#include <linux/types.h>
20
21#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
22# define __SWAB_64_THRU_32__
23#endif
24
25
26#if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6
27static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
28{
29 __u32 t;
30
31#ifndef __thumb__
32 if (!__builtin_constant_p(x)) {
33 /*
34 * The compiler needs a bit of a hint here to always do the
35 * right thing and not screw it up to different degrees
36 * depending on the gcc version.
37 */
38 asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
39 } else
40#endif
41 t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
42
43 x = (x << 24) | (x >> 8); /* mov r0,r0,ror #8 */
44 t &= ~0x00FF0000; /* bic r1,r1,#0x00FF0000 */
45 x ^= (t >> 8); /* eor r0,r0,r1,lsr #8 */
46
47 return x;
48}
49#define __arch_swab32 __arch_swab32
50
51#endif
52
53#endif /* _UAPI__ASM_ARM_SWAB_H */
diff --git a/arch/arm/include/uapi/asm/unistd.h b/arch/arm/include/uapi/asm/unistd.h
new file mode 100644
index 000000000000..ac03bdb4ae44
--- /dev/null
+++ b/arch/arm/include/uapi/asm/unistd.h
@@ -0,0 +1,450 @@
1/*
2 * arch/arm/include/asm/unistd.h
3 *
4 * Copyright (C) 2001-2005 Russell King
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 * Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
11 * no matter what the change is. Thanks!
12 */
13#ifndef _UAPI__ASM_ARM_UNISTD_H
14#define _UAPI__ASM_ARM_UNISTD_H
15
16#define __NR_OABI_SYSCALL_BASE 0x900000
17
18#if defined(__thumb__) || defined(__ARM_EABI__)
19#define __NR_SYSCALL_BASE 0
20#else
21#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE
22#endif
23
24/*
25 * This file contains the system call numbers.
26 */
27
28#define __NR_restart_syscall (__NR_SYSCALL_BASE+ 0)
29#define __NR_exit (__NR_SYSCALL_BASE+ 1)
30#define __NR_fork (__NR_SYSCALL_BASE+ 2)
31#define __NR_read (__NR_SYSCALL_BASE+ 3)
32#define __NR_write (__NR_SYSCALL_BASE+ 4)
33#define __NR_open (__NR_SYSCALL_BASE+ 5)
34#define __NR_close (__NR_SYSCALL_BASE+ 6)
35 /* 7 was sys_waitpid */
36#define __NR_creat (__NR_SYSCALL_BASE+ 8)
37#define __NR_link (__NR_SYSCALL_BASE+ 9)
38#define __NR_unlink (__NR_SYSCALL_BASE+ 10)
39#define __NR_execve (__NR_SYSCALL_BASE+ 11)
40#define __NR_chdir (__NR_SYSCALL_BASE+ 12)
41#define __NR_time (__NR_SYSCALL_BASE+ 13)
42#define __NR_mknod (__NR_SYSCALL_BASE+ 14)
43#define __NR_chmod (__NR_SYSCALL_BASE+ 15)
44#define __NR_lchown (__NR_SYSCALL_BASE+ 16)
45 /* 17 was sys_break */
46 /* 18 was sys_stat */
47#define __NR_lseek (__NR_SYSCALL_BASE+ 19)
48#define __NR_getpid (__NR_SYSCALL_BASE+ 20)
49#define __NR_mount (__NR_SYSCALL_BASE+ 21)
50#define __NR_umount (__NR_SYSCALL_BASE+ 22)
51#define __NR_setuid (__NR_SYSCALL_BASE+ 23)
52#define __NR_getuid (__NR_SYSCALL_BASE+ 24)
53#define __NR_stime (__NR_SYSCALL_BASE+ 25)
54#define __NR_ptrace (__NR_SYSCALL_BASE+ 26)
55#define __NR_alarm (__NR_SYSCALL_BASE+ 27)
56 /* 28 was sys_fstat */
57#define __NR_pause (__NR_SYSCALL_BASE+ 29)
58#define __NR_utime (__NR_SYSCALL_BASE+ 30)
59 /* 31 was sys_stty */
60 /* 32 was sys_gtty */
61#define __NR_access (__NR_SYSCALL_BASE+ 33)
62#define __NR_nice (__NR_SYSCALL_BASE+ 34)
63 /* 35 was sys_ftime */
64#define __NR_sync (__NR_SYSCALL_BASE+ 36)
65#define __NR_kill (__NR_SYSCALL_BASE+ 37)
66#define __NR_rename (__NR_SYSCALL_BASE+ 38)
67#define __NR_mkdir (__NR_SYSCALL_BASE+ 39)
68#define __NR_rmdir (__NR_SYSCALL_BASE+ 40)
69#define __NR_dup (__NR_SYSCALL_BASE+ 41)
70#define __NR_pipe (__NR_SYSCALL_BASE+ 42)
71#define __NR_times (__NR_SYSCALL_BASE+ 43)
72 /* 44 was sys_prof */
73#define __NR_brk (__NR_SYSCALL_BASE+ 45)
74#define __NR_setgid (__NR_SYSCALL_BASE+ 46)
75#define __NR_getgid (__NR_SYSCALL_BASE+ 47)
76 /* 48 was sys_signal */
77#define __NR_geteuid (__NR_SYSCALL_BASE+ 49)
78#define __NR_getegid (__NR_SYSCALL_BASE+ 50)
79#define __NR_acct (__NR_SYSCALL_BASE+ 51)
80#define __NR_umount2 (__NR_SYSCALL_BASE+ 52)
81 /* 53 was sys_lock */
82#define __NR_ioctl (__NR_SYSCALL_BASE+ 54)
83#define __NR_fcntl (__NR_SYSCALL_BASE+ 55)
84 /* 56 was sys_mpx */
85#define __NR_setpgid (__NR_SYSCALL_BASE+ 57)
86 /* 58 was sys_ulimit */
87 /* 59 was sys_olduname */
88#define __NR_umask (__NR_SYSCALL_BASE+ 60)
89#define __NR_chroot (__NR_SYSCALL_BASE+ 61)
90#define __NR_ustat (__NR_SYSCALL_BASE+ 62)
91#define __NR_dup2 (__NR_SYSCALL_BASE+ 63)
92#define __NR_getppid (__NR_SYSCALL_BASE+ 64)
93#define __NR_getpgrp (__NR_SYSCALL_BASE+ 65)
94#define __NR_setsid (__NR_SYSCALL_BASE+ 66)
95#define __NR_sigaction (__NR_SYSCALL_BASE+ 67)
96 /* 68 was sys_sgetmask */
97 /* 69 was sys_ssetmask */
98#define __NR_setreuid (__NR_SYSCALL_BASE+ 70)
99#define __NR_setregid (__NR_SYSCALL_BASE+ 71)
100#define __NR_sigsuspend (__NR_SYSCALL_BASE+ 72)
101#define __NR_sigpending (__NR_SYSCALL_BASE+ 73)
102#define __NR_sethostname (__NR_SYSCALL_BASE+ 74)
103#define __NR_setrlimit (__NR_SYSCALL_BASE+ 75)
104#define __NR_getrlimit (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */
105#define __NR_getrusage (__NR_SYSCALL_BASE+ 77)
106#define __NR_gettimeofday (__NR_SYSCALL_BASE+ 78)
107#define __NR_settimeofday (__NR_SYSCALL_BASE+ 79)
108#define __NR_getgroups (__NR_SYSCALL_BASE+ 80)
109#define __NR_setgroups (__NR_SYSCALL_BASE+ 81)
110#define __NR_select (__NR_SYSCALL_BASE+ 82)
111#define __NR_symlink (__NR_SYSCALL_BASE+ 83)
112 /* 84 was sys_lstat */
113#define __NR_readlink (__NR_SYSCALL_BASE+ 85)
114#define __NR_uselib (__NR_SYSCALL_BASE+ 86)
115#define __NR_swapon (__NR_SYSCALL_BASE+ 87)
116#define __NR_reboot (__NR_SYSCALL_BASE+ 88)
117#define __NR_readdir (__NR_SYSCALL_BASE+ 89)
118#define __NR_mmap (__NR_SYSCALL_BASE+ 90)
119#define __NR_munmap (__NR_SYSCALL_BASE+ 91)
120#define __NR_truncate (__NR_SYSCALL_BASE+ 92)
121#define __NR_ftruncate (__NR_SYSCALL_BASE+ 93)
122#define __NR_fchmod (__NR_SYSCALL_BASE+ 94)
123#define __NR_fchown (__NR_SYSCALL_BASE+ 95)
124#define __NR_getpriority (__NR_SYSCALL_BASE+ 96)
125#define __NR_setpriority (__NR_SYSCALL_BASE+ 97)
126 /* 98 was sys_profil */
127#define __NR_statfs (__NR_SYSCALL_BASE+ 99)
128#define __NR_fstatfs (__NR_SYSCALL_BASE+100)
129 /* 101 was sys_ioperm */
130#define __NR_socketcall (__NR_SYSCALL_BASE+102)
131#define __NR_syslog (__NR_SYSCALL_BASE+103)
132#define __NR_setitimer (__NR_SYSCALL_BASE+104)
133#define __NR_getitimer (__NR_SYSCALL_BASE+105)
134#define __NR_stat (__NR_SYSCALL_BASE+106)
135#define __NR_lstat (__NR_SYSCALL_BASE+107)
136#define __NR_fstat (__NR_SYSCALL_BASE+108)
137 /* 109 was sys_uname */
138 /* 110 was sys_iopl */
139#define __NR_vhangup (__NR_SYSCALL_BASE+111)
140 /* 112 was sys_idle */
141#define __NR_syscall (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */
142#define __NR_wait4 (__NR_SYSCALL_BASE+114)
143#define __NR_swapoff (__NR_SYSCALL_BASE+115)
144#define __NR_sysinfo (__NR_SYSCALL_BASE+116)
145#define __NR_ipc (__NR_SYSCALL_BASE+117)
146#define __NR_fsync (__NR_SYSCALL_BASE+118)
147#define __NR_sigreturn (__NR_SYSCALL_BASE+119)
148#define __NR_clone (__NR_SYSCALL_BASE+120)
149#define __NR_setdomainname (__NR_SYSCALL_BASE+121)
150#define __NR_uname (__NR_SYSCALL_BASE+122)
151 /* 123 was sys_modify_ldt */
152#define __NR_adjtimex (__NR_SYSCALL_BASE+124)
153#define __NR_mprotect (__NR_SYSCALL_BASE+125)
154#define __NR_sigprocmask (__NR_SYSCALL_BASE+126)
155 /* 127 was sys_create_module */
156#define __NR_init_module (__NR_SYSCALL_BASE+128)
157#define __NR_delete_module (__NR_SYSCALL_BASE+129)
158 /* 130 was sys_get_kernel_syms */
159#define __NR_quotactl (__NR_SYSCALL_BASE+131)
160#define __NR_getpgid (__NR_SYSCALL_BASE+132)
161#define __NR_fchdir (__NR_SYSCALL_BASE+133)
162#define __NR_bdflush (__NR_SYSCALL_BASE+134)
163#define __NR_sysfs (__NR_SYSCALL_BASE+135)
164#define __NR_personality (__NR_SYSCALL_BASE+136)
165 /* 137 was sys_afs_syscall */
166#define __NR_setfsuid (__NR_SYSCALL_BASE+138)
167#define __NR_setfsgid (__NR_SYSCALL_BASE+139)
168#define __NR__llseek (__NR_SYSCALL_BASE+140)
169#define __NR_getdents (__NR_SYSCALL_BASE+141)
170#define __NR__newselect (__NR_SYSCALL_BASE+142)
171#define __NR_flock (__NR_SYSCALL_BASE+143)
172#define __NR_msync (__NR_SYSCALL_BASE+144)
173#define __NR_readv (__NR_SYSCALL_BASE+145)
174#define __NR_writev (__NR_SYSCALL_BASE+146)
175#define __NR_getsid (__NR_SYSCALL_BASE+147)
176#define __NR_fdatasync (__NR_SYSCALL_BASE+148)
177#define __NR__sysctl (__NR_SYSCALL_BASE+149)
178#define __NR_mlock (__NR_SYSCALL_BASE+150)
179#define __NR_munlock (__NR_SYSCALL_BASE+151)
180#define __NR_mlockall (__NR_SYSCALL_BASE+152)
181#define __NR_munlockall (__NR_SYSCALL_BASE+153)
182#define __NR_sched_setparam (__NR_SYSCALL_BASE+154)
183#define __NR_sched_getparam (__NR_SYSCALL_BASE+155)
184#define __NR_sched_setscheduler (__NR_SYSCALL_BASE+156)
185#define __NR_sched_getscheduler (__NR_SYSCALL_BASE+157)
186#define __NR_sched_yield (__NR_SYSCALL_BASE+158)
187#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE+159)
188#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE+160)
189#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE+161)
190#define __NR_nanosleep (__NR_SYSCALL_BASE+162)
191#define __NR_mremap (__NR_SYSCALL_BASE+163)
192#define __NR_setresuid (__NR_SYSCALL_BASE+164)
193#define __NR_getresuid (__NR_SYSCALL_BASE+165)
194 /* 166 was sys_vm86 */
195 /* 167 was sys_query_module */
196#define __NR_poll (__NR_SYSCALL_BASE+168)
197#define __NR_nfsservctl (__NR_SYSCALL_BASE+169)
198#define __NR_setresgid (__NR_SYSCALL_BASE+170)
199#define __NR_getresgid (__NR_SYSCALL_BASE+171)
200#define __NR_prctl (__NR_SYSCALL_BASE+172)
201#define __NR_rt_sigreturn (__NR_SYSCALL_BASE+173)
202#define __NR_rt_sigaction (__NR_SYSCALL_BASE+174)
203#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE+175)
204#define __NR_rt_sigpending (__NR_SYSCALL_BASE+176)
205#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE+177)
206#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE+178)
207#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)
208#define __NR_pread64 (__NR_SYSCALL_BASE+180)
209#define __NR_pwrite64 (__NR_SYSCALL_BASE+181)
210#define __NR_chown (__NR_SYSCALL_BASE+182)
211#define __NR_getcwd (__NR_SYSCALL_BASE+183)
212#define __NR_capget (__NR_SYSCALL_BASE+184)
213#define __NR_capset (__NR_SYSCALL_BASE+185)
214#define __NR_sigaltstack (__NR_SYSCALL_BASE+186)
215#define __NR_sendfile (__NR_SYSCALL_BASE+187)
216 /* 188 reserved */
217 /* 189 reserved */
218#define __NR_vfork (__NR_SYSCALL_BASE+190)
219#define __NR_ugetrlimit (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */
220#define __NR_mmap2 (__NR_SYSCALL_BASE+192)
221#define __NR_truncate64 (__NR_SYSCALL_BASE+193)
222#define __NR_ftruncate64 (__NR_SYSCALL_BASE+194)
223#define __NR_stat64 (__NR_SYSCALL_BASE+195)
224#define __NR_lstat64 (__NR_SYSCALL_BASE+196)
225#define __NR_fstat64 (__NR_SYSCALL_BASE+197)
226#define __NR_lchown32 (__NR_SYSCALL_BASE+198)
227#define __NR_getuid32 (__NR_SYSCALL_BASE+199)
228#define __NR_getgid32 (__NR_SYSCALL_BASE+200)
229#define __NR_geteuid32 (__NR_SYSCALL_BASE+201)
230#define __NR_getegid32 (__NR_SYSCALL_BASE+202)
231#define __NR_setreuid32 (__NR_SYSCALL_BASE+203)
232#define __NR_setregid32 (__NR_SYSCALL_BASE+204)
233#define __NR_getgroups32 (__NR_SYSCALL_BASE+205)
234#define __NR_setgroups32 (__NR_SYSCALL_BASE+206)
235#define __NR_fchown32 (__NR_SYSCALL_BASE+207)
236#define __NR_setresuid32 (__NR_SYSCALL_BASE+208)
237#define __NR_getresuid32 (__NR_SYSCALL_BASE+209)
238#define __NR_setresgid32 (__NR_SYSCALL_BASE+210)
239#define __NR_getresgid32 (__NR_SYSCALL_BASE+211)
240#define __NR_chown32 (__NR_SYSCALL_BASE+212)
241#define __NR_setuid32 (__NR_SYSCALL_BASE+213)
242#define __NR_setgid32 (__NR_SYSCALL_BASE+214)
243#define __NR_setfsuid32 (__NR_SYSCALL_BASE+215)
244#define __NR_setfsgid32 (__NR_SYSCALL_BASE+216)
245#define __NR_getdents64 (__NR_SYSCALL_BASE+217)
246#define __NR_pivot_root (__NR_SYSCALL_BASE+218)
247#define __NR_mincore (__NR_SYSCALL_BASE+219)
248#define __NR_madvise (__NR_SYSCALL_BASE+220)
249#define __NR_fcntl64 (__NR_SYSCALL_BASE+221)
250 /* 222 for tux */
251 /* 223 is unused */
252#define __NR_gettid (__NR_SYSCALL_BASE+224)
253#define __NR_readahead (__NR_SYSCALL_BASE+225)
254#define __NR_setxattr (__NR_SYSCALL_BASE+226)
255#define __NR_lsetxattr (__NR_SYSCALL_BASE+227)
256#define __NR_fsetxattr (__NR_SYSCALL_BASE+228)
257#define __NR_getxattr (__NR_SYSCALL_BASE+229)
258#define __NR_lgetxattr (__NR_SYSCALL_BASE+230)
259#define __NR_fgetxattr (__NR_SYSCALL_BASE+231)
260#define __NR_listxattr (__NR_SYSCALL_BASE+232)
261#define __NR_llistxattr (__NR_SYSCALL_BASE+233)
262#define __NR_flistxattr (__NR_SYSCALL_BASE+234)
263#define __NR_removexattr (__NR_SYSCALL_BASE+235)
264#define __NR_lremovexattr (__NR_SYSCALL_BASE+236)
265#define __NR_fremovexattr (__NR_SYSCALL_BASE+237)
266#define __NR_tkill (__NR_SYSCALL_BASE+238)
267#define __NR_sendfile64 (__NR_SYSCALL_BASE+239)
268#define __NR_futex (__NR_SYSCALL_BASE+240)
269#define __NR_sched_setaffinity (__NR_SYSCALL_BASE+241)
270#define __NR_sched_getaffinity (__NR_SYSCALL_BASE+242)
271#define __NR_io_setup (__NR_SYSCALL_BASE+243)
272#define __NR_io_destroy (__NR_SYSCALL_BASE+244)
273#define __NR_io_getevents (__NR_SYSCALL_BASE+245)
274#define __NR_io_submit (__NR_SYSCALL_BASE+246)
275#define __NR_io_cancel (__NR_SYSCALL_BASE+247)
276#define __NR_exit_group (__NR_SYSCALL_BASE+248)
277#define __NR_lookup_dcookie (__NR_SYSCALL_BASE+249)
278#define __NR_epoll_create (__NR_SYSCALL_BASE+250)
279#define __NR_epoll_ctl (__NR_SYSCALL_BASE+251)
280#define __NR_epoll_wait (__NR_SYSCALL_BASE+252)
281#define __NR_remap_file_pages (__NR_SYSCALL_BASE+253)
282 /* 254 for set_thread_area */
283 /* 255 for get_thread_area */
284#define __NR_set_tid_address (__NR_SYSCALL_BASE+256)
285#define __NR_timer_create (__NR_SYSCALL_BASE+257)
286#define __NR_timer_settime (__NR_SYSCALL_BASE+258)
287#define __NR_timer_gettime (__NR_SYSCALL_BASE+259)
288#define __NR_timer_getoverrun (__NR_SYSCALL_BASE+260)
289#define __NR_timer_delete (__NR_SYSCALL_BASE+261)
290#define __NR_clock_settime (__NR_SYSCALL_BASE+262)
291#define __NR_clock_gettime (__NR_SYSCALL_BASE+263)
292#define __NR_clock_getres (__NR_SYSCALL_BASE+264)
293#define __NR_clock_nanosleep (__NR_SYSCALL_BASE+265)
294#define __NR_statfs64 (__NR_SYSCALL_BASE+266)
295#define __NR_fstatfs64 (__NR_SYSCALL_BASE+267)
296#define __NR_tgkill (__NR_SYSCALL_BASE+268)
297#define __NR_utimes (__NR_SYSCALL_BASE+269)
298#define __NR_arm_fadvise64_64 (__NR_SYSCALL_BASE+270)
299#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE+271)
300#define __NR_pciconfig_read (__NR_SYSCALL_BASE+272)
301#define __NR_pciconfig_write (__NR_SYSCALL_BASE+273)
302#define __NR_mq_open (__NR_SYSCALL_BASE+274)
303#define __NR_mq_unlink (__NR_SYSCALL_BASE+275)
304#define __NR_mq_timedsend (__NR_SYSCALL_BASE+276)
305#define __NR_mq_timedreceive (__NR_SYSCALL_BASE+277)
306#define __NR_mq_notify (__NR_SYSCALL_BASE+278)
307#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279)
308#define __NR_waitid (__NR_SYSCALL_BASE+280)
309#define __NR_socket (__NR_SYSCALL_BASE+281)
310#define __NR_bind (__NR_SYSCALL_BASE+282)
311#define __NR_connect (__NR_SYSCALL_BASE+283)
312#define __NR_listen (__NR_SYSCALL_BASE+284)
313#define __NR_accept (__NR_SYSCALL_BASE+285)
314#define __NR_getsockname (__NR_SYSCALL_BASE+286)
315#define __NR_getpeername (__NR_SYSCALL_BASE+287)
316#define __NR_socketpair (__NR_SYSCALL_BASE+288)
317#define __NR_send (__NR_SYSCALL_BASE+289)
318#define __NR_sendto (__NR_SYSCALL_BASE+290)
319#define __NR_recv (__NR_SYSCALL_BASE+291)
320#define __NR_recvfrom (__NR_SYSCALL_BASE+292)
321#define __NR_shutdown (__NR_SYSCALL_BASE+293)
322#define __NR_setsockopt (__NR_SYSCALL_BASE+294)
323#define __NR_getsockopt (__NR_SYSCALL_BASE+295)
324#define __NR_sendmsg (__NR_SYSCALL_BASE+296)
325#define __NR_recvmsg (__NR_SYSCALL_BASE+297)
326#define __NR_semop (__NR_SYSCALL_BASE+298)
327#define __NR_semget (__NR_SYSCALL_BASE+299)
328#define __NR_semctl (__NR_SYSCALL_BASE+300)
329#define __NR_msgsnd (__NR_SYSCALL_BASE+301)
330#define __NR_msgrcv (__NR_SYSCALL_BASE+302)
331#define __NR_msgget (__NR_SYSCALL_BASE+303)
332#define __NR_msgctl (__NR_SYSCALL_BASE+304)
333#define __NR_shmat (__NR_SYSCALL_BASE+305)
334#define __NR_shmdt (__NR_SYSCALL_BASE+306)
335#define __NR_shmget (__NR_SYSCALL_BASE+307)
336#define __NR_shmctl (__NR_SYSCALL_BASE+308)
337#define __NR_add_key (__NR_SYSCALL_BASE+309)
338#define __NR_request_key (__NR_SYSCALL_BASE+310)
339#define __NR_keyctl (__NR_SYSCALL_BASE+311)
340#define __NR_semtimedop (__NR_SYSCALL_BASE+312)
341#define __NR_vserver (__NR_SYSCALL_BASE+313)
342#define __NR_ioprio_set (__NR_SYSCALL_BASE+314)
343#define __NR_ioprio_get (__NR_SYSCALL_BASE+315)
344#define __NR_inotify_init (__NR_SYSCALL_BASE+316)
345#define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317)
346#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318)
347#define __NR_mbind (__NR_SYSCALL_BASE+319)
348#define __NR_get_mempolicy (__NR_SYSCALL_BASE+320)
349#define __NR_set_mempolicy (__NR_SYSCALL_BASE+321)
350#define __NR_openat (__NR_SYSCALL_BASE+322)
351#define __NR_mkdirat (__NR_SYSCALL_BASE+323)
352#define __NR_mknodat (__NR_SYSCALL_BASE+324)
353#define __NR_fchownat (__NR_SYSCALL_BASE+325)
354#define __NR_futimesat (__NR_SYSCALL_BASE+326)
355#define __NR_fstatat64 (__NR_SYSCALL_BASE+327)
356#define __NR_unlinkat (__NR_SYSCALL_BASE+328)
357#define __NR_renameat (__NR_SYSCALL_BASE+329)
358#define __NR_linkat (__NR_SYSCALL_BASE+330)
359#define __NR_symlinkat (__NR_SYSCALL_BASE+331)
360#define __NR_readlinkat (__NR_SYSCALL_BASE+332)
361#define __NR_fchmodat (__NR_SYSCALL_BASE+333)
362#define __NR_faccessat (__NR_SYSCALL_BASE+334)
363#define __NR_pselect6 (__NR_SYSCALL_BASE+335)
364#define __NR_ppoll (__NR_SYSCALL_BASE+336)
365#define __NR_unshare (__NR_SYSCALL_BASE+337)
366#define __NR_set_robust_list (__NR_SYSCALL_BASE+338)
367#define __NR_get_robust_list (__NR_SYSCALL_BASE+339)
368#define __NR_splice (__NR_SYSCALL_BASE+340)
369#define __NR_arm_sync_file_range (__NR_SYSCALL_BASE+341)
370#define __NR_sync_file_range2 __NR_arm_sync_file_range
371#define __NR_tee (__NR_SYSCALL_BASE+342)
372#define __NR_vmsplice (__NR_SYSCALL_BASE+343)
373#define __NR_move_pages (__NR_SYSCALL_BASE+344)
374#define __NR_getcpu (__NR_SYSCALL_BASE+345)
375#define __NR_epoll_pwait (__NR_SYSCALL_BASE+346)
376#define __NR_kexec_load (__NR_SYSCALL_BASE+347)
377#define __NR_utimensat (__NR_SYSCALL_BASE+348)
378#define __NR_signalfd (__NR_SYSCALL_BASE+349)
379#define __NR_timerfd_create (__NR_SYSCALL_BASE+350)
380#define __NR_eventfd (__NR_SYSCALL_BASE+351)
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)
384#define __NR_signalfd4 (__NR_SYSCALL_BASE+355)
385#define __NR_eventfd2 (__NR_SYSCALL_BASE+356)
386#define __NR_epoll_create1 (__NR_SYSCALL_BASE+357)
387#define __NR_dup3 (__NR_SYSCALL_BASE+358)
388#define __NR_pipe2 (__NR_SYSCALL_BASE+359)
389#define __NR_inotify_init1 (__NR_SYSCALL_BASE+360)
390#define __NR_preadv (__NR_SYSCALL_BASE+361)
391#define __NR_pwritev (__NR_SYSCALL_BASE+362)
392#define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE+363)
393#define __NR_perf_event_open (__NR_SYSCALL_BASE+364)
394#define __NR_recvmmsg (__NR_SYSCALL_BASE+365)
395#define __NR_accept4 (__NR_SYSCALL_BASE+366)
396#define __NR_fanotify_init (__NR_SYSCALL_BASE+367)
397#define __NR_fanotify_mark (__NR_SYSCALL_BASE+368)
398#define __NR_prlimit64 (__NR_SYSCALL_BASE+369)
399#define __NR_name_to_handle_at (__NR_SYSCALL_BASE+370)
400#define __NR_open_by_handle_at (__NR_SYSCALL_BASE+371)
401#define __NR_clock_adjtime (__NR_SYSCALL_BASE+372)
402#define __NR_syncfs (__NR_SYSCALL_BASE+373)
403#define __NR_sendmmsg (__NR_SYSCALL_BASE+374)
404#define __NR_setns (__NR_SYSCALL_BASE+375)
405#define __NR_process_vm_readv (__NR_SYSCALL_BASE+376)
406#define __NR_process_vm_writev (__NR_SYSCALL_BASE+377)
407 /* 378 for kcmp */
408
409/*
410 * This may need to be greater than __NR_last_syscall+1 in order to
411 * account for the padding in the syscall table
412 */
413
414/*
415 * The following SWIs are ARM private.
416 */
417#define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
418#define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
419#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
420#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
421#define __ARM_NR_usr32 (__ARM_NR_BASE+4)
422#define __ARM_NR_set_tls (__ARM_NR_BASE+5)
423
424/*
425 * *NOTE*: This is a ghost syscall private to the kernel. Only the
426 * __kuser_cmpxchg code in entry-armv.S should be aware of its
427 * existence. Don't ever use this from user code.
428 */
429
430/*
431 * The following syscalls are obsolete and no longer available for EABI.
432 */
433#if !defined(__KERNEL__)
434#if defined(__ARM_EABI__)
435#undef __NR_time
436#undef __NR_umount
437#undef __NR_stime
438#undef __NR_alarm
439#undef __NR_utime
440#undef __NR_getrlimit
441#undef __NR_select
442#undef __NR_readdir
443#undef __NR_mmap
444#undef __NR_socketcall
445#undef __NR_syscall
446#undef __NR_ipc
447#endif
448#endif
449
450#endif /* _UAPI__ASM_ARM_UNISTD_H */
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index c8050b14e615..b14207101938 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -19,8 +19,8 @@ config AT91_SAM9G45_RESET
19 19
20config SOC_AT91SAM9 20config SOC_AT91SAM9
21 bool 21 bool
22 select GENERIC_CLOCKEVENTS
23 select CPU_ARM926T 22 select CPU_ARM926T
23 select GENERIC_CLOCKEVENTS
24 24
25menu "Atmel AT91 System-on-Chip" 25menu "Atmel AT91 System-on-Chip"
26 26
@@ -28,66 +28,66 @@ comment "Atmel AT91 Processor"
28 28
29config SOC_AT91SAM9 29config SOC_AT91SAM9
30 bool 30 bool
31 select AT91_SAM9_SMC
32 select AT91_SAM9_TIME
31 select CPU_ARM926T 33 select CPU_ARM926T
32 select MULTI_IRQ_HANDLER 34 select MULTI_IRQ_HANDLER
33 select SPARSE_IRQ 35 select SPARSE_IRQ
34 select AT91_SAM9_TIME
35 select AT91_SAM9_SMC
36 36
37config SOC_AT91RM9200 37config SOC_AT91RM9200
38 bool "AT91RM9200" 38 bool "AT91RM9200"
39 select CPU_ARM920T 39 select CPU_ARM920T
40 select MULTI_IRQ_HANDLER
41 select SPARSE_IRQ
42 select GENERIC_CLOCKEVENTS 40 select GENERIC_CLOCKEVENTS
43 select HAVE_AT91_DBGU0 41 select HAVE_AT91_DBGU0
42 select MULTI_IRQ_HANDLER
43 select SPARSE_IRQ
44 44
45config SOC_AT91SAM9260 45config SOC_AT91SAM9260
46 bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20" 46 bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
47 select SOC_AT91SAM9
48 select HAVE_AT91_DBGU0 47 select HAVE_AT91_DBGU0
49 select HAVE_NET_MACB 48 select HAVE_NET_MACB
49 select SOC_AT91SAM9
50 help 50 help
51 Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE 51 Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
52 or AT91SAM9G20 SoC. 52 or AT91SAM9G20 SoC.
53 53
54config SOC_AT91SAM9261 54config SOC_AT91SAM9261
55 bool "AT91SAM9261 or AT91SAM9G10" 55 bool "AT91SAM9261 or AT91SAM9G10"
56 select SOC_AT91SAM9
57 select HAVE_AT91_DBGU0 56 select HAVE_AT91_DBGU0
58 select HAVE_FB_ATMEL 57 select HAVE_FB_ATMEL
58 select SOC_AT91SAM9
59 help 59 help
60 Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC. 60 Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
61 61
62config SOC_AT91SAM9263 62config SOC_AT91SAM9263
63 bool "AT91SAM9263" 63 bool "AT91SAM9263"
64 select SOC_AT91SAM9
65 select HAVE_AT91_DBGU1 64 select HAVE_AT91_DBGU1
66 select HAVE_FB_ATMEL 65 select HAVE_FB_ATMEL
67 select HAVE_NET_MACB 66 select HAVE_NET_MACB
67 select SOC_AT91SAM9
68 68
69config SOC_AT91SAM9RL 69config SOC_AT91SAM9RL
70 bool "AT91SAM9RL" 70 bool "AT91SAM9RL"
71 select SOC_AT91SAM9
72 select HAVE_AT91_DBGU0 71 select HAVE_AT91_DBGU0
73 select HAVE_FB_ATMEL 72 select HAVE_FB_ATMEL
73 select SOC_AT91SAM9
74 74
75config SOC_AT91SAM9G45 75config SOC_AT91SAM9G45
76 bool "AT91SAM9G45 or AT91SAM9M10 families" 76 bool "AT91SAM9G45 or AT91SAM9M10 families"
77 select SOC_AT91SAM9
78 select HAVE_AT91_DBGU1 77 select HAVE_AT91_DBGU1
79 select HAVE_FB_ATMEL 78 select HAVE_FB_ATMEL
80 select HAVE_NET_MACB 79 select HAVE_NET_MACB
80 select SOC_AT91SAM9
81 help 81 help
82 Select this if you are using one of Atmel's AT91SAM9G45 family SoC. 82 Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
83 This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11. 83 This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
84 84
85config SOC_AT91SAM9X5 85config SOC_AT91SAM9X5
86 bool "AT91SAM9x5 family" 86 bool "AT91SAM9x5 family"
87 select SOC_AT91SAM9
88 select HAVE_AT91_DBGU0 87 select HAVE_AT91_DBGU0
89 select HAVE_FB_ATMEL 88 select HAVE_FB_ATMEL
90 select HAVE_NET_MACB 89 select HAVE_NET_MACB
90 select SOC_AT91SAM9
91 help 91 help
92 Select this if you are using one of Atmel's AT91SAM9x5 family SoC. 92 Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
93 This means that your SAM9 name finishes with a '5' (except if it is 93 This means that your SAM9 name finishes with a '5' (except if it is
@@ -97,9 +97,9 @@ config SOC_AT91SAM9X5
97 97
98config SOC_AT91SAM9N12 98config SOC_AT91SAM9N12
99 bool "AT91SAM9N12 family" 99 bool "AT91SAM9N12 family"
100 select SOC_AT91SAM9
101 select HAVE_AT91_DBGU0 100 select HAVE_AT91_DBGU0
102 select HAVE_FB_ATMEL 101 select HAVE_FB_ATMEL
102 select SOC_AT91SAM9
103 help 103 help
104 Select this if you are using Atmel's AT91SAM9N12 SoC. 104 Select this if you are using Atmel's AT91SAM9N12 SoC.
105 105
@@ -144,9 +144,9 @@ config ARCH_AT91SAM9G45
144config ARCH_AT91X40 144config ARCH_AT91X40
145 bool "AT91x40" 145 bool "AT91x40"
146 depends on !MMU 146 depends on !MMU
147 select ARCH_USES_GETTIMEOFFSET
147 select MULTI_IRQ_HANDLER 148 select MULTI_IRQ_HANDLER
148 select SPARSE_IRQ 149 select SPARSE_IRQ
149 select ARCH_USES_GETTIMEOFFSET
150 150
151endchoice 151endchoice
152 152
diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig
index e6135363765a..263242da2cb8 100644
--- a/arch/arm/mach-clps711x/Kconfig
+++ b/arch/arm/mach-clps711x/Kconfig
@@ -23,9 +23,9 @@ config ARCH_CLEP7312
23 23
24config ARCH_EDB7211 24config ARCH_EDB7211
25 bool "EDB7211" 25 bool "EDB7211"
26 select ISA
27 select ARCH_SPARSEMEM_ENABLE
28 select ARCH_SELECT_MEMORY_MODEL 26 select ARCH_SELECT_MEMORY_MODEL
27 select ARCH_SPARSEMEM_ENABLE
28 select ISA
29 help 29 help
30 Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211 30 Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211
31 evaluation board. 31 evaluation board.
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 026b4b277ae5..f8eecb959413 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -4,12 +4,12 @@ config AINTC
4 bool 4 bool
5 5
6config CP_INTC 6config CP_INTC
7 select IRQ_DOMAIN
8 bool 7 bool
8 select IRQ_DOMAIN
9 9
10config ARCH_DAVINCI_DMx 10config ARCH_DAVINCI_DMx
11 select CPU_ARM926T
12 bool 11 bool
12 select CPU_ARM926T
13 13
14menu "TI DaVinci Implementations" 14menu "TI DaVinci Implementations"
15 15
@@ -32,19 +32,19 @@ config ARCH_DAVINCI_DM646x
32 32
33config ARCH_DAVINCI_DA830 33config ARCH_DAVINCI_DA830
34 bool "DA830/OMAP-L137/AM17x based system" 34 bool "DA830/OMAP-L137/AM17x based system"
35 select CP_INTC
36 select ARCH_DAVINCI_DA8XX 35 select ARCH_DAVINCI_DA8XX
37 select CPU_DCACHE_WRITETHROUGH # needed on silicon revs 1.0, 1.1 36 select CPU_DCACHE_WRITETHROUGH # needed on silicon revs 1.0, 1.1
37 select CP_INTC
38 38
39config ARCH_DAVINCI_DA850 39config ARCH_DAVINCI_DA850
40 bool "DA850/OMAP-L138/AM18x based system" 40 bool "DA850/OMAP-L138/AM18x based system"
41 select CP_INTC
42 select ARCH_DAVINCI_DA8XX 41 select ARCH_DAVINCI_DA8XX
43 select ARCH_HAS_CPUFREQ 42 select ARCH_HAS_CPUFREQ
43 select CP_INTC
44 44
45config ARCH_DAVINCI_DA8XX 45config ARCH_DAVINCI_DA8XX
46 select CPU_ARM926T
47 bool 46 bool
47 select CPU_ARM926T
48 48
49config ARCH_DAVINCI_DM365 49config ARCH_DAVINCI_DM365
50 bool "DaVinci 365 based system" 50 bool "DaVinci 365 based system"
@@ -52,9 +52,9 @@ config ARCH_DAVINCI_DM365
52 select ARCH_DAVINCI_DMx 52 select ARCH_DAVINCI_DMx
53 53
54config ARCH_DAVINCI_TNETV107X 54config ARCH_DAVINCI_TNETV107X
55 bool "TNETV107X based system"
55 select CPU_V6 56 select CPU_V6
56 select CP_INTC 57 select CP_INTC
57 bool "TNETV107X based system"
58 58
59comment "DaVinci Board Type" 59comment "DaVinci Board Type"
60 60
@@ -103,9 +103,9 @@ config MACH_DAVINCI_DM6467_EVM
103 bool "TI DM6467 EVM" 103 bool "TI DM6467 EVM"
104 default ARCH_DAVINCI_DM646x 104 default ARCH_DAVINCI_DM646x
105 depends on ARCH_DAVINCI_DM646x 105 depends on ARCH_DAVINCI_DM646x
106 select MACH_DAVINCI_DM6467TEVM
107 select EEPROM_AT24 106 select EEPROM_AT24
108 select I2C 107 select I2C
108 select MACH_DAVINCI_DM6467TEVM
109 help 109 help
110 Configure this option to specify the whether the board used 110 Configure this option to specify the whether the board used
111 for development is a DM6467 EVM 111 for development is a DM6467 EVM
@@ -127,8 +127,8 @@ config MACH_DAVINCI_DA830_EVM
127 bool "TI DA830/OMAP-L137/AM17x Reference Platform" 127 bool "TI DA830/OMAP-L137/AM17x Reference Platform"
128 default ARCH_DAVINCI_DA830 128 default ARCH_DAVINCI_DA830
129 depends on ARCH_DAVINCI_DA830 129 depends on ARCH_DAVINCI_DA830
130 select GPIO_PCF857X
131 select EEPROM_AT24 130 select EEPROM_AT24
131 select GPIO_PCF857X
132 select I2C 132 select I2C
133 help 133 help
134 Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module. 134 Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module.
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 4372075c551f..da55107033dd 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -31,11 +31,11 @@ config CPU_EXYNOS4210
31 bool "SAMSUNG EXYNOS4210" 31 bool "SAMSUNG EXYNOS4210"
32 default y 32 default y
33 depends on ARCH_EXYNOS4 33 depends on ARCH_EXYNOS4
34 select SAMSUNG_DMADEV
35 select ARM_CPU_SUSPEND if PM 34 select ARM_CPU_SUSPEND if PM
35 select PM_GENERIC_DOMAINS
36 select S5P_PM if PM 36 select S5P_PM if PM
37 select S5P_SLEEP if PM 37 select S5P_SLEEP if PM
38 select PM_GENERIC_DOMAINS 38 select SAMSUNG_DMADEV
39 help 39 help
40 Enable EXYNOS4210 CPU support 40 Enable EXYNOS4210 CPU support
41 41
@@ -43,9 +43,9 @@ config SOC_EXYNOS4212
43 bool "SAMSUNG EXYNOS4212" 43 bool "SAMSUNG EXYNOS4212"
44 default y 44 default y
45 depends on ARCH_EXYNOS4 45 depends on ARCH_EXYNOS4
46 select SAMSUNG_DMADEV
47 select S5P_PM if PM 46 select S5P_PM if PM
48 select S5P_SLEEP if PM 47 select S5P_SLEEP if PM
48 select SAMSUNG_DMADEV
49 help 49 help
50 Enable EXYNOS4212 SoC support 50 Enable EXYNOS4212 SoC support
51 51
@@ -61,9 +61,9 @@ config SOC_EXYNOS5250
61 bool "SAMSUNG EXYNOS5250" 61 bool "SAMSUNG EXYNOS5250"
62 default y 62 default y
63 depends on ARCH_EXYNOS5 63 depends on ARCH_EXYNOS5
64 select SAMSUNG_DMADEV
65 select S5P_PM if PM 64 select S5P_PM if PM
66 select S5P_SLEEP if PM 65 select S5P_SLEEP if PM
66 select SAMSUNG_DMADEV
67 help 67 help
68 Enable EXYNOS5250 SoC support 68 Enable EXYNOS5250 SoC support
69 69
@@ -189,71 +189,71 @@ config MACH_SMDKC210
189config MACH_SMDKV310 189config MACH_SMDKV310
190 bool "SMDKV310" 190 bool "SMDKV310"
191 select CPU_EXYNOS4210 191 select CPU_EXYNOS4210
192 select S5P_DEV_FIMD0 192 select EXYNOS4_DEV_AHCI
193 select EXYNOS4_DEV_USB_OHCI
194 select EXYNOS4_SETUP_FIMD0
195 select EXYNOS4_SETUP_I2C1
196 select EXYNOS4_SETUP_KEYPAD
197 select EXYNOS4_SETUP_SDHCI
198 select EXYNOS4_SETUP_USB_PHY
199 select EXYNOS_DEV_DMA
200 select EXYNOS_DEV_DRM
201 select EXYNOS_DEV_SYSMMU
202 select S3C24XX_PWM
203 select S3C_DEV_HSMMC
204 select S3C_DEV_HSMMC1
205 select S3C_DEV_HSMMC2
206 select S3C_DEV_HSMMC3
207 select S3C_DEV_I2C1
193 select S3C_DEV_RTC 208 select S3C_DEV_RTC
209 select S3C_DEV_USB_HSOTG
194 select S3C_DEV_WDT 210 select S3C_DEV_WDT
195 select S3C_DEV_I2C1
196 select S5P_DEV_FIMC0 211 select S5P_DEV_FIMC0
197 select S5P_DEV_FIMC1 212 select S5P_DEV_FIMC1
198 select S5P_DEV_FIMC2 213 select S5P_DEV_FIMC2
199 select S5P_DEV_FIMC3 214 select S5P_DEV_FIMC3
215 select S5P_DEV_FIMD0
200 select S5P_DEV_G2D 216 select S5P_DEV_G2D
201 select S5P_DEV_I2C_HDMIPHY 217 select S5P_DEV_I2C_HDMIPHY
202 select S5P_DEV_JPEG 218 select S5P_DEV_JPEG
203 select S5P_DEV_MFC 219 select S5P_DEV_MFC
204 select S5P_DEV_TV 220 select S5P_DEV_TV
205 select S5P_DEV_USB_EHCI 221 select S5P_DEV_USB_EHCI
206 select S3C_DEV_HSMMC
207 select S3C_DEV_HSMMC1
208 select S3C_DEV_HSMMC2
209 select S3C_DEV_HSMMC3
210 select S3C_DEV_USB_HSOTG
211 select SAMSUNG_DEV_BACKLIGHT 222 select SAMSUNG_DEV_BACKLIGHT
212 select EXYNOS_DEV_DRM
213 select EXYNOS_DEV_SYSMMU
214 select EXYNOS4_DEV_AHCI
215 select SAMSUNG_DEV_KEYPAD 223 select SAMSUNG_DEV_KEYPAD
216 select EXYNOS_DEV_DMA
217 select SAMSUNG_DEV_PWM 224 select SAMSUNG_DEV_PWM
218 select EXYNOS4_DEV_USB_OHCI
219 select EXYNOS4_SETUP_FIMD0
220 select EXYNOS4_SETUP_I2C1
221 select EXYNOS4_SETUP_KEYPAD
222 select EXYNOS4_SETUP_SDHCI
223 select EXYNOS4_SETUP_USB_PHY
224 select S3C24XX_PWM
225 help 225 help
226 Machine support for Samsung SMDKV310 226 Machine support for Samsung SMDKV310
227 227
228config MACH_ARMLEX4210 228config MACH_ARMLEX4210
229 bool "ARMLEX4210" 229 bool "ARMLEX4210"
230 select CPU_EXYNOS4210 230 select CPU_EXYNOS4210
231 select S3C_DEV_RTC 231 select EXYNOS4_DEV_AHCI
232 select S3C_DEV_WDT 232 select EXYNOS4_SETUP_SDHCI
233 select EXYNOS_DEV_DMA
233 select S3C_DEV_HSMMC 234 select S3C_DEV_HSMMC
234 select S3C_DEV_HSMMC2 235 select S3C_DEV_HSMMC2
235 select S3C_DEV_HSMMC3 236 select S3C_DEV_HSMMC3
236 select EXYNOS4_DEV_AHCI 237 select S3C_DEV_RTC
237 select EXYNOS_DEV_DMA 238 select S3C_DEV_WDT
238 select EXYNOS4_SETUP_SDHCI
239 help 239 help
240 Machine support for Samsung ARMLEX4210 based on EXYNOS4210 240 Machine support for Samsung ARMLEX4210 based on EXYNOS4210
241 241
242config MACH_UNIVERSAL_C210 242config MACH_UNIVERSAL_C210
243 bool "Mobile UNIVERSAL_C210 Board" 243 bool "Mobile UNIVERSAL_C210 Board"
244 select CPU_EXYNOS4210
245 select S5P_HRT
246 select CLKSRC_MMIO 244 select CLKSRC_MMIO
245 select CPU_EXYNOS4210
246 select EXYNOS4_SETUP_FIMC
247 select EXYNOS4_SETUP_FIMD0
248 select EXYNOS4_SETUP_I2C1
249 select EXYNOS4_SETUP_I2C3
250 select EXYNOS4_SETUP_I2C5
251 select EXYNOS4_SETUP_SDHCI
252 select EXYNOS4_SETUP_USB_PHY
253 select EXYNOS_DEV_DMA
254 select EXYNOS_DEV_DRM
255 select EXYNOS_DEV_SYSMMU
247 select HAVE_SCHED_CLOCK 256 select HAVE_SCHED_CLOCK
248 select S5P_GPIO_INT
249 select S5P_DEV_FIMC0
250 select S5P_DEV_FIMC1
251 select S5P_DEV_FIMC2
252 select S5P_DEV_FIMC3
253 select S5P_DEV_G2D
254 select S5P_DEV_CSIS0
255 select S5P_DEV_JPEG
256 select S5P_DEV_FIMD0
257 select S3C_DEV_HSMMC 257 select S3C_DEV_HSMMC
258 select S3C_DEV_HSMMC2 258 select S3C_DEV_HSMMC2
259 select S3C_DEV_HSMMC3 259 select S3C_DEV_HSMMC3
@@ -261,21 +261,21 @@ config MACH_UNIVERSAL_C210
261 select S3C_DEV_I2C3 261 select S3C_DEV_I2C3
262 select S3C_DEV_I2C5 262 select S3C_DEV_I2C5
263 select S3C_DEV_USB_HSOTG 263 select S3C_DEV_USB_HSOTG
264 select S5P_DEV_CSIS0
265 select S5P_DEV_FIMC0
266 select S5P_DEV_FIMC1
267 select S5P_DEV_FIMC2
268 select S5P_DEV_FIMC3
269 select S5P_DEV_FIMD0
270 select S5P_DEV_G2D
264 select S5P_DEV_I2C_HDMIPHY 271 select S5P_DEV_I2C_HDMIPHY
272 select S5P_DEV_JPEG
265 select S5P_DEV_MFC 273 select S5P_DEV_MFC
266 select S5P_DEV_ONENAND 274 select S5P_DEV_ONENAND
267 select S5P_DEV_TV 275 select S5P_DEV_TV
268 select EXYNOS_DEV_SYSMMU 276 select S5P_GPIO_INT
269 select EXYNOS_DEV_DMA 277 select S5P_HRT
270 select EXYNOS_DEV_DRM
271 select EXYNOS4_SETUP_FIMD0
272 select EXYNOS4_SETUP_I2C1
273 select EXYNOS4_SETUP_I2C3
274 select EXYNOS4_SETUP_I2C5
275 select EXYNOS4_SETUP_SDHCI
276 select EXYNOS4_SETUP_FIMC
277 select S5P_SETUP_MIPIPHY 278 select S5P_SETUP_MIPIPHY
278 select EXYNOS4_SETUP_USB_PHY
279 help 279 help
280 Machine support for Samsung Mobile Universal S5PC210 Reference 280 Machine support for Samsung Mobile Universal S5PC210 Reference
281 Board. 281 Board.
@@ -283,10 +283,16 @@ config MACH_UNIVERSAL_C210
283config MACH_NURI 283config MACH_NURI
284 bool "Mobile NURI Board" 284 bool "Mobile NURI Board"
285 select CPU_EXYNOS4210 285 select CPU_EXYNOS4210
286 select S5P_GPIO_INT 286 select EXYNOS4_SETUP_FIMC
287 select S3C_DEV_WDT 287 select EXYNOS4_SETUP_FIMD0
288 select S3C_DEV_RTC 288 select EXYNOS4_SETUP_I2C1
289 select S5P_DEV_FIMD0 289 select EXYNOS4_SETUP_I2C3
290 select EXYNOS4_SETUP_I2C5
291 select EXYNOS4_SETUP_I2C6
292 select EXYNOS4_SETUP_SDHCI
293 select EXYNOS4_SETUP_USB_PHY
294 select EXYNOS_DEV_DMA
295 select EXYNOS_DEV_DRM
290 select S3C_DEV_HSMMC 296 select S3C_DEV_HSMMC
291 select S3C_DEV_HSMMC2 297 select S3C_DEV_HSMMC2
292 select S3C_DEV_HSMMC3 298 select S3C_DEV_HSMMC3
@@ -294,41 +300,42 @@ config MACH_NURI
294 select S3C_DEV_I2C3 300 select S3C_DEV_I2C3
295 select S3C_DEV_I2C5 301 select S3C_DEV_I2C5
296 select S3C_DEV_I2C6 302 select S3C_DEV_I2C6
303 select S3C_DEV_RTC
297 select S3C_DEV_USB_HSOTG 304 select S3C_DEV_USB_HSOTG
305 select S3C_DEV_WDT
298 select S5P_DEV_CSIS0 306 select S5P_DEV_CSIS0
299 select S5P_DEV_JPEG
300 select S5P_DEV_FIMC0 307 select S5P_DEV_FIMC0
301 select S5P_DEV_FIMC1 308 select S5P_DEV_FIMC1
302 select S5P_DEV_FIMC2 309 select S5P_DEV_FIMC2
303 select S5P_DEV_FIMC3 310 select S5P_DEV_FIMC3
311 select S5P_DEV_FIMD0
304 select S5P_DEV_G2D 312 select S5P_DEV_G2D
313 select S5P_DEV_JPEG
305 select S5P_DEV_MFC 314 select S5P_DEV_MFC
306 select S5P_DEV_USB_EHCI 315 select S5P_DEV_USB_EHCI
316 select S5P_GPIO_INT
307 select S5P_SETUP_MIPIPHY 317 select S5P_SETUP_MIPIPHY
308 select EXYNOS_DEV_DMA
309 select EXYNOS_DEV_DRM
310 select EXYNOS4_SETUP_FIMC
311 select EXYNOS4_SETUP_FIMD0
312 select EXYNOS4_SETUP_I2C1
313 select EXYNOS4_SETUP_I2C3
314 select EXYNOS4_SETUP_I2C5
315 select EXYNOS4_SETUP_I2C6
316 select EXYNOS4_SETUP_SDHCI
317 select EXYNOS4_SETUP_USB_PHY
318 select S5P_SETUP_MIPIPHY
319 select SAMSUNG_DEV_PWM
320 select SAMSUNG_DEV_ADC 318 select SAMSUNG_DEV_ADC
319 select SAMSUNG_DEV_PWM
321 help 320 help
322 Machine support for Samsung Mobile NURI Board. 321 Machine support for Samsung Mobile NURI Board.
323 322
324config MACH_ORIGEN 323config MACH_ORIGEN
325 bool "ORIGEN" 324 bool "ORIGEN"
326 select CPU_EXYNOS4210 325 select CPU_EXYNOS4210
327 select S3C_DEV_RTC 326 select EXYNOS4_DEV_USB_OHCI
328 select S3C_DEV_WDT 327 select EXYNOS4_SETUP_FIMD0
328 select EXYNOS4_SETUP_SDHCI
329 select EXYNOS4_SETUP_USB_PHY
330 select EXYNOS_DEV_DMA
331 select EXYNOS_DEV_DRM
332 select EXYNOS_DEV_SYSMMU
333 select S3C24XX_PWM
329 select S3C_DEV_HSMMC 334 select S3C_DEV_HSMMC
330 select S3C_DEV_HSMMC2 335 select S3C_DEV_HSMMC2
336 select S3C_DEV_RTC
331 select S3C_DEV_USB_HSOTG 337 select S3C_DEV_USB_HSOTG
338 select S3C_DEV_WDT
332 select S5P_DEV_FIMC0 339 select S5P_DEV_FIMC0
333 select S5P_DEV_FIMC1 340 select S5P_DEV_FIMC1
334 select S5P_DEV_FIMC2 341 select S5P_DEV_FIMC2
@@ -342,14 +349,6 @@ config MACH_ORIGEN
342 select S5P_DEV_USB_EHCI 349 select S5P_DEV_USB_EHCI
343 select SAMSUNG_DEV_BACKLIGHT 350 select SAMSUNG_DEV_BACKLIGHT
344 select SAMSUNG_DEV_PWM 351 select SAMSUNG_DEV_PWM
345 select EXYNOS_DEV_DRM
346 select EXYNOS_DEV_SYSMMU
347 select EXYNOS_DEV_DMA
348 select EXYNOS4_DEV_USB_OHCI
349 select EXYNOS4_SETUP_FIMD0
350 select EXYNOS4_SETUP_SDHCI
351 select EXYNOS4_SETUP_USB_PHY
352 select S3C24XX_PWM
353 help 352 help
354 Machine support for ORIGEN based on Samsung EXYNOS4210 353 Machine support for ORIGEN based on Samsung EXYNOS4210
355 354
@@ -357,7 +356,17 @@ comment "EXYNOS4212 Boards"
357 356
358config MACH_SMDK4212 357config MACH_SMDK4212
359 bool "SMDK4212" 358 bool "SMDK4212"
360 select SOC_EXYNOS4212 359 select EXYNOS4_SETUP_FIMD0
360 select EXYNOS4_SETUP_I2C1
361 select EXYNOS4_SETUP_I2C3
362 select EXYNOS4_SETUP_I2C7
363 select EXYNOS4_SETUP_KEYPAD
364 select EXYNOS4_SETUP_SDHCI
365 select EXYNOS4_SETUP_USB_PHY
366 select EXYNOS_DEV_DMA
367 select EXYNOS_DEV_DRM
368 select EXYNOS_DEV_SYSMMU
369 select S3C24XX_PWM
361 select S3C_DEV_HSMMC2 370 select S3C_DEV_HSMMC2
362 select S3C_DEV_HSMMC3 371 select S3C_DEV_HSMMC3
363 select S3C_DEV_I2C1 372 select S3C_DEV_I2C1
@@ -375,17 +384,7 @@ config MACH_SMDK4212
375 select SAMSUNG_DEV_BACKLIGHT 384 select SAMSUNG_DEV_BACKLIGHT
376 select SAMSUNG_DEV_KEYPAD 385 select SAMSUNG_DEV_KEYPAD
377 select SAMSUNG_DEV_PWM 386 select SAMSUNG_DEV_PWM
378 select EXYNOS_DEV_SYSMMU 387 select SOC_EXYNOS4212
379 select EXYNOS_DEV_DMA
380 select EXYNOS_DEV_DRM
381 select EXYNOS4_SETUP_FIMD0
382 select EXYNOS4_SETUP_I2C1
383 select EXYNOS4_SETUP_I2C3
384 select EXYNOS4_SETUP_I2C7
385 select EXYNOS4_SETUP_KEYPAD
386 select EXYNOS4_SETUP_SDHCI
387 select EXYNOS4_SETUP_USB_PHY
388 select S3C24XX_PWM
389 help 388 help
390 Machine support for Samsung SMDK4212 389 Machine support for Samsung SMDK4212
391 390
@@ -393,8 +392,8 @@ comment "EXYNOS4412 Boards"
393 392
394config MACH_SMDK4412 393config MACH_SMDK4412
395 bool "SMDK4412" 394 bool "SMDK4412"
396 select SOC_EXYNOS4412
397 select MACH_SMDK4212 395 select MACH_SMDK4212
396 select SOC_EXYNOS4412
398 help 397 help
399 Machine support for Samsung SMDK4412 398 Machine support for Samsung SMDK4412
400endif 399endif
@@ -404,12 +403,12 @@ comment "Flattened Device Tree based board for EXYNOS SoCs"
404config MACH_EXYNOS4_DT 403config MACH_EXYNOS4_DT
405 bool "Samsung Exynos4 Machine using device tree" 404 bool "Samsung Exynos4 Machine using device tree"
406 depends on ARCH_EXYNOS4 405 depends on ARCH_EXYNOS4
407 select CPU_EXYNOS4210
408 select USE_OF
409 select ARM_AMBA 406 select ARM_AMBA
407 select CPU_EXYNOS4210
410 select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD 408 select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD
411 select PINCTRL 409 select PINCTRL
412 select PINCTRL_EXYNOS4 410 select PINCTRL_EXYNOS4
411 select USE_OF
413 help 412 help
414 Machine support for Samsung Exynos4 machine with device tree enabled. 413 Machine support for Samsung Exynos4 machine with device tree enabled.
415 Select this if a fdt blob is available for the Exynos4 SoC based board. 414 Select this if a fdt blob is available for the Exynos4 SoC based board.
@@ -419,9 +418,9 @@ config MACH_EXYNOS4_DT
419config MACH_EXYNOS5_DT 418config MACH_EXYNOS5_DT
420 bool "SAMSUNG EXYNOS5 Machine using device tree" 419 bool "SAMSUNG EXYNOS5 Machine using device tree"
421 depends on ARCH_EXYNOS5 420 depends on ARCH_EXYNOS5
421 select ARM_AMBA
422 select SOC_EXYNOS5250 422 select SOC_EXYNOS5250
423 select USE_OF 423 select USE_OF
424 select ARM_AMBA
425 help 424 help
426 Machine support for Samsung EXYNOS5 machine with device tree enabled. 425 Machine support for Samsung EXYNOS5 machine with device tree enabled.
427 Select this if a fdt blob is available for the EXYNOS5 SoC based board. 426 Select this if a fdt blob is available for the EXYNOS5 SoC based board.
diff --git a/arch/arm/mach-footbridge/Kconfig b/arch/arm/mach-footbridge/Kconfig
index f643ef819da6..abda5a18a664 100644
--- a/arch/arm/mach-footbridge/Kconfig
+++ b/arch/arm/mach-footbridge/Kconfig
@@ -91,7 +91,7 @@ config FOOTBRIDGE_ADDIN
91 91
92# EBSA285 board in either host or addin mode 92# EBSA285 board in either host or addin mode
93config ARCH_EBSA285 93config ARCH_EBSA285
94 select ARCH_MAY_HAVE_PC_FDC
95 bool 94 bool
95 select ARCH_MAY_HAVE_PC_FDC
96 96
97endif 97endif
diff --git a/arch/arm/mach-h720x/Kconfig b/arch/arm/mach-h720x/Kconfig
index abf356c02343..6bb755bcb6f5 100644
--- a/arch/arm/mach-h720x/Kconfig
+++ b/arch/arm/mach-h720x/Kconfig
@@ -12,9 +12,9 @@ config ARCH_H7201
12 12
13config ARCH_H7202 13config ARCH_H7202
14 bool "hms30c7202" 14 bool "hms30c7202"
15 depends on ARCH_H720X
15 select CPU_H7202 16 select CPU_H7202
16 select ZONE_DMA 17 select ZONE_DMA
17 depends on ARCH_H720X
18 help 18 help
19 Say Y here if you are using the Hynix HMS30C7202 Reference Board 19 Say Y here if you are using the Hynix HMS30C7202 Reference Board
20 20
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 32197c117afe..8d276584650e 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -41,68 +41,68 @@ config SOC_IMX1
41 41
42config SOC_IMX21 42config SOC_IMX21
43 bool 43 bool
44 select MACH_MX21
45 select CPU_ARM926T
46 select COMMON_CLK 44 select COMMON_CLK
45 select CPU_ARM926T
47 select IMX_HAVE_IOMUX_V1 46 select IMX_HAVE_IOMUX_V1
47 select MACH_MX21
48 select MXC_AVIC 48 select MXC_AVIC
49 49
50config SOC_IMX25 50config SOC_IMX25
51 bool 51 bool
52 select ARCH_MX25 52 select ARCH_MX25
53 select ARCH_MXC_IOMUX_V3
53 select COMMON_CLK 54 select COMMON_CLK
54 select CPU_ARM926T 55 select CPU_ARM926T
55 select HAVE_CAN_FLEXCAN if CAN 56 select HAVE_CAN_FLEXCAN if CAN
56 select ARCH_MXC_IOMUX_V3
57 select MXC_AVIC 57 select MXC_AVIC
58 58
59config SOC_IMX27 59config SOC_IMX27
60 bool 60 bool
61 select MACH_MX27
62 select CPU_ARM926T
63 select COMMON_CLK 61 select COMMON_CLK
62 select CPU_ARM926T
64 select IMX_HAVE_IOMUX_V1 63 select IMX_HAVE_IOMUX_V1
64 select MACH_MX27
65 select MXC_AVIC 65 select MXC_AVIC
66 66
67config SOC_IMX31 67config SOC_IMX31
68 bool 68 bool
69 select COMMON_CLK
69 select CPU_V6 70 select CPU_V6
70 select IMX_HAVE_PLATFORM_MXC_RNGA 71 select IMX_HAVE_PLATFORM_MXC_RNGA
71 select MXC_AVIC 72 select MXC_AVIC
72 select COMMON_CLK
73 select SMP_ON_UP if SMP 73 select SMP_ON_UP if SMP
74 74
75config SOC_IMX35 75config SOC_IMX35
76 bool 76 bool
77 select CPU_V6K
78 select ARCH_MXC_IOMUX_V3 77 select ARCH_MXC_IOMUX_V3
79 select COMMON_CLK 78 select COMMON_CLK
79 select CPU_V6K
80 select HAVE_CAN_FLEXCAN if CAN
80 select HAVE_EPIT 81 select HAVE_EPIT
81 select MXC_AVIC 82 select MXC_AVIC
82 select SMP_ON_UP if SMP 83 select SMP_ON_UP if SMP
83 select HAVE_CAN_FLEXCAN if CAN
84 84
85config SOC_IMX5 85config SOC_IMX5
86 select CPU_V7 86 bool
87 select MXC_TZIC
88 select COMMON_CLK
89 select ARCH_MXC_IOMUX_V3
90 select ARCH_HAS_CPUFREQ 87 select ARCH_HAS_CPUFREQ
91 select ARCH_MX5 88 select ARCH_MX5
92 bool 89 select ARCH_MXC_IOMUX_V3
90 select COMMON_CLK
91 select CPU_V7
92 select MXC_TZIC
93 93
94config SOC_IMX50 94config SOC_IMX50
95 bool 95 bool
96 select SOC_IMX5
97 select ARCH_MX50 96 select ARCH_MX50
97 select SOC_IMX5
98 98
99config SOC_IMX51 99config SOC_IMX51
100 bool 100 bool
101 select SOC_IMX5
102 select ARCH_MX5 101 select ARCH_MX5
103 select ARCH_MX51 102 select ARCH_MX51
104 select PINCTRL 103 select PINCTRL
105 select PINCTRL_IMX51 104 select PINCTRL_IMX51
105 select SOC_IMX5
106 106
107if ARCH_IMX_V4_V5 107if ARCH_IMX_V4_V5
108 108
@@ -112,10 +112,10 @@ config MACH_MXLADS
112 112
113config ARCH_MX1ADS 113config ARCH_MX1ADS
114 bool "MX1ADS platform" 114 bool "MX1ADS platform"
115 select MACH_MXLADS
116 select SOC_IMX1
117 select IMX_HAVE_PLATFORM_IMX_I2C 115 select IMX_HAVE_PLATFORM_IMX_I2C
118 select IMX_HAVE_PLATFORM_IMX_UART 116 select IMX_HAVE_PLATFORM_IMX_UART
117 select MACH_MXLADS
118 select SOC_IMX1
119 help 119 help
120 Say Y here if you are using Motorola MX1ADS/MXLADS boards 120 Say Y here if you are using Motorola MX1ADS/MXLADS boards
121 121
@@ -127,9 +127,9 @@ config MACH_SCB9328
127 127
128config MACH_APF9328 128config MACH_APF9328
129 bool "APF9328" 129 bool "APF9328"
130 select SOC_IMX1
131 select IMX_HAVE_PLATFORM_IMX_I2C 130 select IMX_HAVE_PLATFORM_IMX_I2C
132 select IMX_HAVE_PLATFORM_IMX_UART 131 select IMX_HAVE_PLATFORM_IMX_UART
132 select SOC_IMX1
133 help 133 help
134 Say Yes here if you are using the Armadeus APF9328 development board 134 Say Yes here if you are using the Armadeus APF9328 development board
135 135
@@ -137,11 +137,11 @@ comment "MX21 platforms:"
137 137
138config MACH_MX21ADS 138config MACH_MX21ADS
139 bool "MX21ADS platform" 139 bool "MX21ADS platform"
140 select SOC_IMX21
141 select IMX_HAVE_PLATFORM_IMX_FB 140 select IMX_HAVE_PLATFORM_IMX_FB
142 select IMX_HAVE_PLATFORM_IMX_UART 141 select IMX_HAVE_PLATFORM_IMX_UART
143 select IMX_HAVE_PLATFORM_MXC_MMC 142 select IMX_HAVE_PLATFORM_MXC_MMC
144 select IMX_HAVE_PLATFORM_MXC_NAND 143 select IMX_HAVE_PLATFORM_MXC_NAND
144 select SOC_IMX21
145 help 145 help
146 Include support for MX21ADS platform. This includes specific 146 Include support for MX21ADS platform. This includes specific
147 configurations for the board and its peripherals. 147 configurations for the board and its peripherals.
@@ -150,22 +150,21 @@ comment "MX25 platforms:"
150 150
151config MACH_MX25_3DS 151config MACH_MX25_3DS
152 bool "Support MX25PDK (3DS) Platform" 152 bool "Support MX25PDK (3DS) Platform"
153 select SOC_IMX25
154 select IMX_HAVE_PLATFORM_FLEXCAN 153 select IMX_HAVE_PLATFORM_FLEXCAN
155 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 154 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
156 select IMX_HAVE_PLATFORM_IMX2_WDT 155 select IMX_HAVE_PLATFORM_IMX2_WDT
157 select IMX_HAVE_PLATFORM_IMXDI_RTC 156 select IMX_HAVE_PLATFORM_IMXDI_RTC
158 select IMX_HAVE_PLATFORM_IMX_I2C
159 select IMX_HAVE_PLATFORM_IMX_FB 157 select IMX_HAVE_PLATFORM_IMX_FB
158 select IMX_HAVE_PLATFORM_IMX_I2C
160 select IMX_HAVE_PLATFORM_IMX_KEYPAD 159 select IMX_HAVE_PLATFORM_IMX_KEYPAD
161 select IMX_HAVE_PLATFORM_IMX_UART 160 select IMX_HAVE_PLATFORM_IMX_UART
162 select IMX_HAVE_PLATFORM_MXC_EHCI 161 select IMX_HAVE_PLATFORM_MXC_EHCI
163 select IMX_HAVE_PLATFORM_MXC_NAND 162 select IMX_HAVE_PLATFORM_MXC_NAND
164 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 163 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
164 select SOC_IMX25
165 165
166config MACH_EUKREA_CPUIMX25SD 166config MACH_EUKREA_CPUIMX25SD
167 bool "Support Eukrea CPUIMX25 Platform" 167 bool "Support Eukrea CPUIMX25 Platform"
168 select SOC_IMX25
169 select IMX_HAVE_PLATFORM_FLEXCAN 168 select IMX_HAVE_PLATFORM_FLEXCAN
170 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 169 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
171 select IMX_HAVE_PLATFORM_IMX2_WDT 170 select IMX_HAVE_PLATFORM_IMX2_WDT
@@ -177,6 +176,7 @@ config MACH_EUKREA_CPUIMX25SD
177 select IMX_HAVE_PLATFORM_MXC_NAND 176 select IMX_HAVE_PLATFORM_MXC_NAND
178 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 177 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
179 select MXC_ULPI if USB_ULPI 178 select MXC_ULPI if USB_ULPI
179 select SOC_IMX25
180 180
181choice 181choice
182 prompt "Baseboard" 182 prompt "Baseboard"
@@ -199,20 +199,19 @@ comment "MX27 platforms:"
199 199
200config MACH_MX27ADS 200config MACH_MX27ADS
201 bool "MX27ADS platform" 201 bool "MX27ADS platform"
202 select SOC_IMX27
203 select IMX_HAVE_PLATFORM_IMX_FB 202 select IMX_HAVE_PLATFORM_IMX_FB
204 select IMX_HAVE_PLATFORM_IMX_I2C 203 select IMX_HAVE_PLATFORM_IMX_I2C
205 select IMX_HAVE_PLATFORM_IMX_UART 204 select IMX_HAVE_PLATFORM_IMX_UART
206 select IMX_HAVE_PLATFORM_MXC_MMC 205 select IMX_HAVE_PLATFORM_MXC_MMC
207 select IMX_HAVE_PLATFORM_MXC_NAND 206 select IMX_HAVE_PLATFORM_MXC_NAND
208 select IMX_HAVE_PLATFORM_MXC_W1 207 select IMX_HAVE_PLATFORM_MXC_W1
208 select SOC_IMX27
209 help 209 help
210 Include support for MX27ADS platform. This includes specific 210 Include support for MX27ADS platform. This includes specific
211 configurations for the board and its peripherals. 211 configurations for the board and its peripherals.
212 212
213config MACH_PCM038 213config MACH_PCM038
214 bool "Phytec phyCORE-i.MX27 CPU module (pcm038)" 214 bool "Phytec phyCORE-i.MX27 CPU module (pcm038)"
215 select SOC_IMX27
216 select IMX_HAVE_PLATFORM_IMX2_WDT 215 select IMX_HAVE_PLATFORM_IMX2_WDT
217 select IMX_HAVE_PLATFORM_IMX_I2C 216 select IMX_HAVE_PLATFORM_IMX_I2C
218 select IMX_HAVE_PLATFORM_IMX_UART 217 select IMX_HAVE_PLATFORM_IMX_UART
@@ -221,6 +220,7 @@ config MACH_PCM038
221 select IMX_HAVE_PLATFORM_MXC_W1 220 select IMX_HAVE_PLATFORM_MXC_W1
222 select IMX_HAVE_PLATFORM_SPI_IMX 221 select IMX_HAVE_PLATFORM_SPI_IMX
223 select MXC_ULPI if USB_ULPI 222 select MXC_ULPI if USB_ULPI
223 select SOC_IMX27
224 help 224 help
225 Include support for phyCORE-i.MX27 (aka pcm038) platform. This 225 Include support for phyCORE-i.MX27 (aka pcm038) platform. This
226 includes specific configurations for the module and its peripherals. 226 includes specific configurations for the module and its peripherals.
@@ -242,7 +242,6 @@ endchoice
242 242
243config MACH_CPUIMX27 243config MACH_CPUIMX27
244 bool "Eukrea CPUIMX27 module" 244 bool "Eukrea CPUIMX27 module"
245 select SOC_IMX27
246 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 245 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
247 select IMX_HAVE_PLATFORM_IMX2_WDT 246 select IMX_HAVE_PLATFORM_IMX2_WDT
248 select IMX_HAVE_PLATFORM_IMX_I2C 247 select IMX_HAVE_PLATFORM_IMX_I2C
@@ -251,6 +250,7 @@ config MACH_CPUIMX27
251 select IMX_HAVE_PLATFORM_MXC_NAND 250 select IMX_HAVE_PLATFORM_MXC_NAND
252 select IMX_HAVE_PLATFORM_MXC_W1 251 select IMX_HAVE_PLATFORM_MXC_W1
253 select MXC_ULPI if USB_ULPI 252 select MXC_ULPI if USB_ULPI
253 select SOC_IMX27
254 help 254 help
255 Include support for Eukrea CPUIMX27 platform. This includes 255 Include support for Eukrea CPUIMX27 platform. This includes
256 specific configurations for the module and its peripherals. 256 specific configurations for the module and its peripherals.
@@ -292,7 +292,6 @@ endchoice
292 292
293config MACH_MX27_3DS 293config MACH_MX27_3DS
294 bool "MX27PDK platform" 294 bool "MX27PDK platform"
295 select SOC_IMX27
296 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 295 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
297 select IMX_HAVE_PLATFORM_IMX2_WDT 296 select IMX_HAVE_PLATFORM_IMX2_WDT
298 select IMX_HAVE_PLATFORM_IMX_FB 297 select IMX_HAVE_PLATFORM_IMX_FB
@@ -306,13 +305,13 @@ config MACH_MX27_3DS
306 select IMX_HAVE_PLATFORM_SPI_IMX 305 select IMX_HAVE_PLATFORM_SPI_IMX
307 select MXC_DEBUG_BOARD 306 select MXC_DEBUG_BOARD
308 select MXC_ULPI if USB_ULPI 307 select MXC_ULPI if USB_ULPI
308 select SOC_IMX27
309 help 309 help
310 Include support for MX27PDK platform. This includes specific 310 Include support for MX27PDK platform. This includes specific
311 configurations for the board and its peripherals. 311 configurations for the board and its peripherals.
312 312
313config MACH_IMX27_VISSTRIM_M10 313config MACH_IMX27_VISSTRIM_M10
314 bool "Vista Silicon i.MX27 Visstrim_m10" 314 bool "Vista Silicon i.MX27 Visstrim_m10"
315 select SOC_IMX27
316 select IMX_HAVE_PLATFORM_GPIO_KEYS 315 select IMX_HAVE_PLATFORM_GPIO_KEYS
317 select IMX_HAVE_PLATFORM_IMX_I2C 316 select IMX_HAVE_PLATFORM_IMX_I2C
318 select IMX_HAVE_PLATFORM_IMX_SSI 317 select IMX_HAVE_PLATFORM_IMX_SSI
@@ -321,6 +320,7 @@ config MACH_IMX27_VISSTRIM_M10
321 select IMX_HAVE_PLATFORM_MXC_EHCI 320 select IMX_HAVE_PLATFORM_MXC_EHCI
322 select IMX_HAVE_PLATFORM_MXC_MMC 321 select IMX_HAVE_PLATFORM_MXC_MMC
323 select LEDS_GPIO_REGISTER 322 select LEDS_GPIO_REGISTER
323 select SOC_IMX27
324 help 324 help
325 Include support for Visstrim_m10 platform and its different variants. 325 Include support for Visstrim_m10 platform and its different variants.
326 This includes specific configurations for the board and its 326 This includes specific configurations for the board and its
@@ -328,16 +328,15 @@ config MACH_IMX27_VISSTRIM_M10
328 328
329config MACH_IMX27LITE 329config MACH_IMX27LITE
330 bool "LogicPD MX27 LITEKIT platform" 330 bool "LogicPD MX27 LITEKIT platform"
331 select SOC_IMX27
332 select IMX_HAVE_PLATFORM_IMX_UART
333 select IMX_HAVE_PLATFORM_IMX_SSI 331 select IMX_HAVE_PLATFORM_IMX_SSI
332 select IMX_HAVE_PLATFORM_IMX_UART
333 select SOC_IMX27
334 help 334 help
335 Include support for MX27 LITEKIT platform. This includes specific 335 Include support for MX27 LITEKIT platform. This includes specific
336 configurations for the board and its peripherals. 336 configurations for the board and its peripherals.
337 337
338config MACH_PCA100 338config MACH_PCA100
339 bool "Phytec phyCARD-s (pca100)" 339 bool "Phytec phyCARD-s (pca100)"
340 select SOC_IMX27
341 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 340 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
342 select IMX_HAVE_PLATFORM_IMX2_WDT 341 select IMX_HAVE_PLATFORM_IMX2_WDT
343 select IMX_HAVE_PLATFORM_IMX_FB 342 select IMX_HAVE_PLATFORM_IMX_FB
@@ -350,27 +349,28 @@ config MACH_PCA100
350 select IMX_HAVE_PLATFORM_MXC_W1 349 select IMX_HAVE_PLATFORM_MXC_W1
351 select IMX_HAVE_PLATFORM_SPI_IMX 350 select IMX_HAVE_PLATFORM_SPI_IMX
352 select MXC_ULPI if USB_ULPI 351 select MXC_ULPI if USB_ULPI
352 select SOC_IMX27
353 help 353 help
354 Include support for phyCARD-s (aka pca100) platform. This 354 Include support for phyCARD-s (aka pca100) platform. This
355 includes specific configurations for the module and its peripherals. 355 includes specific configurations for the module and its peripherals.
356 356
357config MACH_MXT_TD60 357config MACH_MXT_TD60
358 bool "Maxtrack i-MXT TD60" 358 bool "Maxtrack i-MXT TD60"
359 select SOC_IMX27
360 select IMX_HAVE_PLATFORM_IMX_FB 359 select IMX_HAVE_PLATFORM_IMX_FB
361 select IMX_HAVE_PLATFORM_IMX_I2C 360 select IMX_HAVE_PLATFORM_IMX_I2C
362 select IMX_HAVE_PLATFORM_IMX_UART 361 select IMX_HAVE_PLATFORM_IMX_UART
363 select IMX_HAVE_PLATFORM_MXC_MMC 362 select IMX_HAVE_PLATFORM_MXC_MMC
364 select IMX_HAVE_PLATFORM_MXC_NAND 363 select IMX_HAVE_PLATFORM_MXC_NAND
364 select SOC_IMX27
365 help 365 help
366 Include support for i-MXT (aka td60) platform. This 366 Include support for i-MXT (aka td60) platform. This
367 includes specific configurations for the module and its peripherals. 367 includes specific configurations for the module and its peripherals.
368 368
369config MACH_IMX27IPCAM 369config MACH_IMX27IPCAM
370 bool "IMX27 IPCAM platform" 370 bool "IMX27 IPCAM platform"
371 select SOC_IMX27
372 select IMX_HAVE_PLATFORM_IMX2_WDT 371 select IMX_HAVE_PLATFORM_IMX2_WDT
373 select IMX_HAVE_PLATFORM_IMX_UART 372 select IMX_HAVE_PLATFORM_IMX_UART
373 select SOC_IMX27
374 help 374 help
375 Include support for IMX27 IPCAM platform. This includes specific 375 Include support for IMX27 IPCAM platform. This includes specific
376 configurations for the board and its peripherals. 376 configurations for the board and its peripherals.
@@ -390,11 +390,11 @@ comment "MX31 platforms:"
390 390
391config MACH_MX31ADS 391config MACH_MX31ADS
392 bool "Support MX31ADS platforms" 392 bool "Support MX31ADS platforms"
393 select SOC_IMX31 393 default y
394 select IMX_HAVE_PLATFORM_IMX_I2C 394 select IMX_HAVE_PLATFORM_IMX_I2C
395 select IMX_HAVE_PLATFORM_IMX_SSI 395 select IMX_HAVE_PLATFORM_IMX_SSI
396 select IMX_HAVE_PLATFORM_IMX_UART 396 select IMX_HAVE_PLATFORM_IMX_UART
397 default y 397 select SOC_IMX31
398 help 398 help
399 Include support for MX31ADS platform. This includes specific 399 Include support for MX31ADS platform. This includes specific
400 configurations for the board and its peripherals. 400 configurations for the board and its peripherals.
@@ -412,21 +412,19 @@ config MACH_MX31ADS_WM1133_EV1
412 412
413config MACH_MX31LILLY 413config MACH_MX31LILLY
414 bool "Support MX31 LILLY-1131 platforms (INCO startec)" 414 bool "Support MX31 LILLY-1131 platforms (INCO startec)"
415 select SOC_IMX31
416 select IMX_HAVE_PLATFORM_IMX_UART 415 select IMX_HAVE_PLATFORM_IMX_UART
417 select IMX_HAVE_PLATFORM_IPU_CORE 416 select IMX_HAVE_PLATFORM_IPU_CORE
418 select IMX_HAVE_PLATFORM_MXC_EHCI 417 select IMX_HAVE_PLATFORM_MXC_EHCI
419 select IMX_HAVE_PLATFORM_MXC_MMC 418 select IMX_HAVE_PLATFORM_MXC_MMC
420 select IMX_HAVE_PLATFORM_SPI_IMX 419 select IMX_HAVE_PLATFORM_SPI_IMX
421 select MXC_ULPI if USB_ULPI 420 select MXC_ULPI if USB_ULPI
421 select SOC_IMX31
422 help 422 help
423 Include support for mx31 based LILLY1131 modules. This includes 423 Include support for mx31 based LILLY1131 modules. This includes
424 specific configurations for the board and its peripherals. 424 specific configurations for the board and its peripherals.
425 425
426config MACH_MX31LITE 426config MACH_MX31LITE
427 bool "Support MX31 LITEKIT (LogicPD)" 427 bool "Support MX31 LITEKIT (LogicPD)"
428 select SOC_IMX31
429 select MXC_ULPI if USB_ULPI
430 select IMX_HAVE_PLATFORM_IMX2_WDT 428 select IMX_HAVE_PLATFORM_IMX2_WDT
431 select IMX_HAVE_PLATFORM_IMX_UART 429 select IMX_HAVE_PLATFORM_IMX_UART
432 select IMX_HAVE_PLATFORM_MXC_EHCI 430 select IMX_HAVE_PLATFORM_MXC_EHCI
@@ -435,13 +433,14 @@ config MACH_MX31LITE
435 select IMX_HAVE_PLATFORM_MXC_RTC 433 select IMX_HAVE_PLATFORM_MXC_RTC
436 select IMX_HAVE_PLATFORM_SPI_IMX 434 select IMX_HAVE_PLATFORM_SPI_IMX
437 select LEDS_GPIO_REGISTER 435 select LEDS_GPIO_REGISTER
436 select MXC_ULPI if USB_ULPI
437 select SOC_IMX31
438 help 438 help
439 Include support for MX31 LITEKIT platform. This includes specific 439 Include support for MX31 LITEKIT platform. This includes specific
440 configurations for the board and its peripherals. 440 configurations for the board and its peripherals.
441 441
442config MACH_PCM037 442config MACH_PCM037
443 bool "Support Phytec pcm037 (i.MX31) platforms" 443 bool "Support Phytec pcm037 (i.MX31) platforms"
444 select SOC_IMX31
445 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 444 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
446 select IMX_HAVE_PLATFORM_IMX2_WDT 445 select IMX_HAVE_PLATFORM_IMX2_WDT
447 select IMX_HAVE_PLATFORM_IMX_I2C 446 select IMX_HAVE_PLATFORM_IMX_I2C
@@ -452,6 +451,7 @@ config MACH_PCM037
452 select IMX_HAVE_PLATFORM_MXC_NAND 451 select IMX_HAVE_PLATFORM_MXC_NAND
453 select IMX_HAVE_PLATFORM_MXC_W1 452 select IMX_HAVE_PLATFORM_MXC_W1
454 select MXC_ULPI if USB_ULPI 453 select MXC_ULPI if USB_ULPI
454 select SOC_IMX31
455 help 455 help
456 Include support for Phytec pcm037 platform. This includes 456 Include support for Phytec pcm037 platform. This includes
457 specific configurations for the board and its peripherals. 457 specific configurations for the board and its peripherals.
@@ -468,8 +468,6 @@ config MACH_PCM037_EET
468 468
469config MACH_MX31_3DS 469config MACH_MX31_3DS
470 bool "Support MX31PDK (3DS)" 470 bool "Support MX31PDK (3DS)"
471 select SOC_IMX31
472 select MXC_DEBUG_BOARD
473 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 471 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
474 select IMX_HAVE_PLATFORM_IMX2_WDT 472 select IMX_HAVE_PLATFORM_IMX2_WDT
475 select IMX_HAVE_PLATFORM_IMX_I2C 473 select IMX_HAVE_PLATFORM_IMX_I2C
@@ -481,7 +479,9 @@ config MACH_MX31_3DS
481 select IMX_HAVE_PLATFORM_MXC_MMC 479 select IMX_HAVE_PLATFORM_MXC_MMC
482 select IMX_HAVE_PLATFORM_MXC_NAND 480 select IMX_HAVE_PLATFORM_MXC_NAND
483 select IMX_HAVE_PLATFORM_SPI_IMX 481 select IMX_HAVE_PLATFORM_SPI_IMX
482 select MXC_DEBUG_BOARD
484 select MXC_ULPI if USB_ULPI 483 select MXC_ULPI if USB_ULPI
484 select SOC_IMX31
485 help 485 help
486 Include support for MX31PDK (3DS) platform. This includes specific 486 Include support for MX31PDK (3DS) platform. This includes specific
487 configurations for the board and its peripherals. 487 configurations for the board and its peripherals.
@@ -497,7 +497,6 @@ config MACH_MX31_3DS_MXC_NAND_USE_BBT
497 497
498config MACH_MX31MOBOARD 498config MACH_MX31MOBOARD
499 bool "Support mx31moboard platforms (EPFL Mobots group)" 499 bool "Support mx31moboard platforms (EPFL Mobots group)"
500 select SOC_IMX31
501 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 500 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
502 select IMX_HAVE_PLATFORM_IMX2_WDT 501 select IMX_HAVE_PLATFORM_IMX2_WDT
503 select IMX_HAVE_PLATFORM_IMX_I2C 502 select IMX_HAVE_PLATFORM_IMX_I2C
@@ -509,22 +508,22 @@ config MACH_MX31MOBOARD
509 select IMX_HAVE_PLATFORM_SPI_IMX 508 select IMX_HAVE_PLATFORM_SPI_IMX
510 select LEDS_GPIO_REGISTER 509 select LEDS_GPIO_REGISTER
511 select MXC_ULPI if USB_ULPI 510 select MXC_ULPI if USB_ULPI
511 select SOC_IMX31
512 help 512 help
513 Include support for mx31moboard platform. This includes specific 513 Include support for mx31moboard platform. This includes specific
514 configurations for the board and its peripherals. 514 configurations for the board and its peripherals.
515 515
516config MACH_QONG 516config MACH_QONG
517 bool "Support Dave/DENX QongEVB-LITE platform" 517 bool "Support Dave/DENX QongEVB-LITE platform"
518 select SOC_IMX31
519 select IMX_HAVE_PLATFORM_IMX_UART
520 select IMX_HAVE_PLATFORM_IMX2_WDT 518 select IMX_HAVE_PLATFORM_IMX2_WDT
519 select IMX_HAVE_PLATFORM_IMX_UART
520 select SOC_IMX31
521 help 521 help
522 Include support for Dave/DENX QongEVB-LITE platform. This includes 522 Include support for Dave/DENX QongEVB-LITE platform. This includes
523 specific configurations for the board and its peripherals. 523 specific configurations for the board and its peripherals.
524 524
525config MACH_ARMADILLO5X0 525config MACH_ARMADILLO5X0
526 bool "Support Atmark Armadillo-500 Development Base Board" 526 bool "Support Atmark Armadillo-500 Development Base Board"
527 select SOC_IMX31
528 select IMX_HAVE_PLATFORM_GPIO_KEYS 527 select IMX_HAVE_PLATFORM_GPIO_KEYS
529 select IMX_HAVE_PLATFORM_IMX_I2C 528 select IMX_HAVE_PLATFORM_IMX_I2C
530 select IMX_HAVE_PLATFORM_IMX_UART 529 select IMX_HAVE_PLATFORM_IMX_UART
@@ -533,23 +532,24 @@ config MACH_ARMADILLO5X0
533 select IMX_HAVE_PLATFORM_MXC_MMC 532 select IMX_HAVE_PLATFORM_MXC_MMC
534 select IMX_HAVE_PLATFORM_MXC_NAND 533 select IMX_HAVE_PLATFORM_MXC_NAND
535 select MXC_ULPI if USB_ULPI 534 select MXC_ULPI if USB_ULPI
535 select SOC_IMX31
536 help 536 help
537 Include support for Atmark Armadillo-500 platform. This includes 537 Include support for Atmark Armadillo-500 platform. This includes
538 specific configurations for the board and its peripherals. 538 specific configurations for the board and its peripherals.
539 539
540config MACH_KZM_ARM11_01 540config MACH_KZM_ARM11_01
541 bool "Support KZM-ARM11-01(Kyoto Microcomputer)" 541 bool "Support KZM-ARM11-01(Kyoto Microcomputer)"
542 select SOC_IMX31
543 select IMX_HAVE_PLATFORM_IMX_UART 542 select IMX_HAVE_PLATFORM_IMX_UART
543 select SOC_IMX31
544 help 544 help
545 Include support for KZM-ARM11-01. This includes specific 545 Include support for KZM-ARM11-01. This includes specific
546 configurations for the board and its peripherals. 546 configurations for the board and its peripherals.
547 547
548config MACH_BUG 548config MACH_BUG
549 bool "Support Buglabs BUGBase platform" 549 bool "Support Buglabs BUGBase platform"
550 select SOC_IMX31
551 select IMX_HAVE_PLATFORM_IMX_UART
552 default y 550 default y
551 select IMX_HAVE_PLATFORM_IMX_UART
552 select SOC_IMX31
553 help 553 help
554 Include support for BUGBase 1.3 platform. This includes specific 554 Include support for BUGBase 1.3 platform. This includes specific
555 configurations for the board and its peripherals. 555 configurations for the board and its peripherals.
@@ -565,7 +565,6 @@ comment "MX35 platforms:"
565 565
566config MACH_PCM043 566config MACH_PCM043
567 bool "Support Phytec pcm043 (i.MX35) platforms" 567 bool "Support Phytec pcm043 (i.MX35) platforms"
568 select SOC_IMX35
569 select IMX_HAVE_PLATFORM_FLEXCAN 568 select IMX_HAVE_PLATFORM_FLEXCAN
570 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 569 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
571 select IMX_HAVE_PLATFORM_IMX2_WDT 570 select IMX_HAVE_PLATFORM_IMX2_WDT
@@ -577,14 +576,13 @@ config MACH_PCM043
577 select IMX_HAVE_PLATFORM_MXC_NAND 576 select IMX_HAVE_PLATFORM_MXC_NAND
578 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 577 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
579 select MXC_ULPI if USB_ULPI 578 select MXC_ULPI if USB_ULPI
579 select SOC_IMX35
580 help 580 help
581 Include support for Phytec pcm043 platform. This includes 581 Include support for Phytec pcm043 platform. This includes
582 specific configurations for the board and its peripherals. 582 specific configurations for the board and its peripherals.
583 583
584config MACH_MX35_3DS 584config MACH_MX35_3DS
585 bool "Support MX35PDK platform" 585 bool "Support MX35PDK platform"
586 select SOC_IMX35
587 select MXC_DEBUG_BOARD
588 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 586 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
589 select IMX_HAVE_PLATFORM_IMX2_WDT 587 select IMX_HAVE_PLATFORM_IMX2_WDT
590 select IMX_HAVE_PLATFORM_IMX_FB 588 select IMX_HAVE_PLATFORM_IMX_FB
@@ -595,13 +593,14 @@ config MACH_MX35_3DS
595 select IMX_HAVE_PLATFORM_MXC_NAND 593 select IMX_HAVE_PLATFORM_MXC_NAND
596 select IMX_HAVE_PLATFORM_MXC_RTC 594 select IMX_HAVE_PLATFORM_MXC_RTC
597 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 595 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
596 select MXC_DEBUG_BOARD
597 select SOC_IMX35
598 help 598 help
599 Include support for MX35PDK platform. This includes specific 599 Include support for MX35PDK platform. This includes specific
600 configurations for the board and its peripherals. 600 configurations for the board and its peripherals.
601 601
602config MACH_EUKREA_CPUIMX35SD 602config MACH_EUKREA_CPUIMX35SD
603 bool "Support Eukrea CPUIMX35 Platform" 603 bool "Support Eukrea CPUIMX35 Platform"
604 select SOC_IMX35
605 select IMX_HAVE_PLATFORM_FLEXCAN 604 select IMX_HAVE_PLATFORM_FLEXCAN
606 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 605 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
607 select IMX_HAVE_PLATFORM_IMX2_WDT 606 select IMX_HAVE_PLATFORM_IMX2_WDT
@@ -611,6 +610,7 @@ config MACH_EUKREA_CPUIMX35SD
611 select IMX_HAVE_PLATFORM_MXC_NAND 610 select IMX_HAVE_PLATFORM_MXC_NAND
612 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 611 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
613 select MXC_ULPI if USB_ULPI 612 select MXC_ULPI if USB_ULPI
613 select SOC_IMX35
614 help 614 help
615 Include support for Eukrea CPUIMX35 platform. This includes 615 Include support for Eukrea CPUIMX35 platform. This includes
616 specific configurations for the board and its peripherals. 616 specific configurations for the board and its peripherals.
@@ -635,16 +635,16 @@ endchoice
635 635
636config MACH_VPR200 636config MACH_VPR200
637 bool "Support VPR200 platform" 637 bool "Support VPR200 platform"
638 select SOC_IMX35
639 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 638 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
640 select IMX_HAVE_PLATFORM_GPIO_KEYS 639 select IMX_HAVE_PLATFORM_GPIO_KEYS
641 select IMX_HAVE_PLATFORM_IMX2_WDT 640 select IMX_HAVE_PLATFORM_IMX2_WDT
642 select IMX_HAVE_PLATFORM_IMX_UART
643 select IMX_HAVE_PLATFORM_IMX_I2C 641 select IMX_HAVE_PLATFORM_IMX_I2C
642 select IMX_HAVE_PLATFORM_IMX_UART
644 select IMX_HAVE_PLATFORM_IPU_CORE 643 select IMX_HAVE_PLATFORM_IPU_CORE
645 select IMX_HAVE_PLATFORM_MXC_EHCI 644 select IMX_HAVE_PLATFORM_MXC_EHCI
646 select IMX_HAVE_PLATFORM_MXC_NAND 645 select IMX_HAVE_PLATFORM_MXC_NAND
647 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 646 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
647 select SOC_IMX35
648 help 648 help
649 Include support for VPR200 platform. This includes specific 649 Include support for VPR200 platform. This includes specific
650 configurations for the board and its peripherals. 650 configurations for the board and its peripherals.
@@ -654,11 +654,11 @@ comment "i.MX5 platforms:"
654config MACH_MX50_RDP 654config MACH_MX50_RDP
655 bool "Support MX50 reference design platform" 655 bool "Support MX50 reference design platform"
656 depends on BROKEN 656 depends on BROKEN
657 select SOC_IMX50
658 select IMX_HAVE_PLATFORM_IMX_I2C 657 select IMX_HAVE_PLATFORM_IMX_I2C
659 select IMX_HAVE_PLATFORM_IMX_UART 658 select IMX_HAVE_PLATFORM_IMX_UART
660 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 659 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
661 select IMX_HAVE_PLATFORM_SPI_IMX 660 select IMX_HAVE_PLATFORM_SPI_IMX
661 select SOC_IMX50
662 help 662 help
663 Include support for MX50 reference design platform (RDP) board. This 663 Include support for MX50 reference design platform (RDP) board. This
664 includes specific configurations for the board and its peripherals. 664 includes specific configurations for the board and its peripherals.
@@ -667,15 +667,14 @@ comment "i.MX51 machines:"
667 667
668config MACH_IMX51_DT 668config MACH_IMX51_DT
669 bool "Support i.MX51 platforms from device tree" 669 bool "Support i.MX51 platforms from device tree"
670 select SOC_IMX51
671 select MACH_MX51_BABBAGE 670 select MACH_MX51_BABBAGE
671 select SOC_IMX51
672 help 672 help
673 Include support for Freescale i.MX51 based platforms 673 Include support for Freescale i.MX51 based platforms
674 using the device tree for discovery 674 using the device tree for discovery
675 675
676config MACH_MX51_BABBAGE 676config MACH_MX51_BABBAGE
677 bool "Support MX51 BABBAGE platforms" 677 bool "Support MX51 BABBAGE platforms"
678 select SOC_IMX51
679 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 678 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
680 select IMX_HAVE_PLATFORM_IMX2_WDT 679 select IMX_HAVE_PLATFORM_IMX2_WDT
681 select IMX_HAVE_PLATFORM_IMX_I2C 680 select IMX_HAVE_PLATFORM_IMX_I2C
@@ -683,6 +682,7 @@ config MACH_MX51_BABBAGE
683 select IMX_HAVE_PLATFORM_MXC_EHCI 682 select IMX_HAVE_PLATFORM_MXC_EHCI
684 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 683 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
685 select IMX_HAVE_PLATFORM_SPI_IMX 684 select IMX_HAVE_PLATFORM_SPI_IMX
685 select SOC_IMX51
686 help 686 help
687 Include support for MX51 Babbage platform, also known as MX51EVK in 687 Include support for MX51 Babbage platform, also known as MX51EVK in
688 u-boot. This includes specific configurations for the board and its 688 u-boot. This includes specific configurations for the board and its
@@ -690,27 +690,27 @@ config MACH_MX51_BABBAGE
690 690
691config MACH_MX51_3DS 691config MACH_MX51_3DS
692 bool "Support MX51PDK (3DS)" 692 bool "Support MX51PDK (3DS)"
693 select SOC_IMX51
694 select IMX_HAVE_PLATFORM_IMX2_WDT 693 select IMX_HAVE_PLATFORM_IMX2_WDT
695 select IMX_HAVE_PLATFORM_IMX_KEYPAD 694 select IMX_HAVE_PLATFORM_IMX_KEYPAD
696 select IMX_HAVE_PLATFORM_IMX_UART 695 select IMX_HAVE_PLATFORM_IMX_UART
697 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 696 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
698 select IMX_HAVE_PLATFORM_SPI_IMX 697 select IMX_HAVE_PLATFORM_SPI_IMX
699 select MXC_DEBUG_BOARD 698 select MXC_DEBUG_BOARD
699 select SOC_IMX51
700 help 700 help
701 Include support for MX51PDK (3DS) platform. This includes specific 701 Include support for MX51PDK (3DS) platform. This includes specific
702 configurations for the board and its peripherals. 702 configurations for the board and its peripherals.
703 703
704config MACH_EUKREA_CPUIMX51SD 704config MACH_EUKREA_CPUIMX51SD
705 bool "Support Eukrea CPUIMX51SD module" 705 bool "Support Eukrea CPUIMX51SD module"
706 select SOC_IMX51
707 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 706 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
707 select IMX_HAVE_PLATFORM_IMX2_WDT
708 select IMX_HAVE_PLATFORM_IMX_I2C 708 select IMX_HAVE_PLATFORM_IMX_I2C
709 select IMX_HAVE_PLATFORM_IMX_UART 709 select IMX_HAVE_PLATFORM_IMX_UART
710 select IMX_HAVE_PLATFORM_IMX2_WDT
711 select IMX_HAVE_PLATFORM_MXC_EHCI 710 select IMX_HAVE_PLATFORM_MXC_EHCI
712 select IMX_HAVE_PLATFORM_MXC_NAND 711 select IMX_HAVE_PLATFORM_MXC_NAND
713 select IMX_HAVE_PLATFORM_SPI_IMX 712 select IMX_HAVE_PLATFORM_SPI_IMX
713 select SOC_IMX51
714 help 714 help
715 Include support for Eukrea CPUIMX51SD platform. This includes 715 Include support for Eukrea CPUIMX51SD platform. This includes
716 specific configurations for the module and its peripherals. 716 specific configurations for the module and its peripherals.
@@ -736,12 +736,12 @@ comment "Device tree only"
736 736
737config SOC_IMX53 737config SOC_IMX53
738 bool "i.MX53 support" 738 bool "i.MX53 support"
739 select SOC_IMX5
740 select ARCH_MX5 739 select ARCH_MX5
741 select ARCH_MX53 740 select ARCH_MX53
742 select HAVE_CAN_FLEXCAN if CAN 741 select HAVE_CAN_FLEXCAN if CAN
743 select PINCTRL 742 select PINCTRL
744 select PINCTRL_IMX53 743 select PINCTRL_IMX53
744 select SOC_IMX5
745 745
746 help 746 help
747 This enables support for Freescale i.MX53 processor. 747 This enables support for Freescale i.MX53 processor.
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig
index fd5e7b6881bf..73a2d905af8a 100644
--- a/arch/arm/mach-ixp4xx/Kconfig
+++ b/arch/arm/mach-ixp4xx/Kconfig
@@ -234,8 +234,8 @@ config IXP4XX_QMGR
234 234
235config IXP4XX_NPE 235config IXP4XX_NPE
236 tristate "IXP4xx Network Processor Engine support" 236 tristate "IXP4xx Network Processor Engine support"
237 select HOTPLUG
238 select FW_LOADER 237 select FW_LOADER
238 select HOTPLUG
239 help 239 help
240 This driver supports IXP4xx built-in network coprocessors 240 This driver supports IXP4xx built-in network coprocessors
241 and is automatically selected by Ethernet and HSS drivers. 241 and is automatically selected by Ethernet and HSS drivers.
diff --git a/arch/arm/mach-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig
index d697d07a1bf0..178d4daa5e1d 100644
--- a/arch/arm/mach-mmp/Kconfig
+++ b/arch/arm/mach-mmp/Kconfig
@@ -107,22 +107,22 @@ endmenu
107 107
108config CPU_PXA168 108config CPU_PXA168
109 bool 109 bool
110 select CPU_MOHAWK
111 select COMMON_CLK 110 select COMMON_CLK
111 select CPU_MOHAWK
112 help 112 help
113 Select code specific to PXA168 113 Select code specific to PXA168
114 114
115config CPU_PXA910 115config CPU_PXA910
116 bool 116 bool
117 select CPU_MOHAWK
118 select COMMON_CLK 117 select COMMON_CLK
118 select CPU_MOHAWK
119 help 119 help
120 Select code specific to PXA910 120 Select code specific to PXA910
121 121
122config CPU_MMP2 122config CPU_MMP2
123 bool 123 bool
124 select CPU_PJ4
125 select COMMON_CLK 124 select COMMON_CLK
125 select CPU_PJ4
126 help 126 help
127 Select code specific to MMP2. MMP2 is ARMv7 compatible. 127 Select code specific to MMP2. MMP2 is ARMv7 compatible.
128 128
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 7902de151cc5..b61908594b47 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -10,35 +10,35 @@ choice
10 10
11config ARCH_MSM7X00A 11config ARCH_MSM7X00A
12 bool "MSM7x00A / MSM7x01A" 12 bool "MSM7x00A / MSM7x01A"
13 select MACH_TROUT if !MACH_HALIBUT
14 select ARCH_MSM_ARM11 13 select ARCH_MSM_ARM11
15 select MSM_SMD
16 select MSM_SMD_PKG3
17 select CPU_V6 14 select CPU_V6
18 select GPIO_MSM_V1 15 select GPIO_MSM_V1
16 select MACH_TROUT if !MACH_HALIBUT
19 select MSM_PROC_COMM 17 select MSM_PROC_COMM
18 select MSM_SMD
19 select MSM_SMD_PKG3
20 20
21config ARCH_MSM7X30 21config ARCH_MSM7X30
22 bool "MSM7x30" 22 bool "MSM7x30"
23 select MACH_MSM7X30_SURF # if !
24 select ARCH_MSM_SCORPION 23 select ARCH_MSM_SCORPION
25 select MSM_SMD
26 select MSM_VIC
27 select CPU_V7 24 select CPU_V7
28 select MSM_GPIOMUX
29 select GPIO_MSM_V1 25 select GPIO_MSM_V1
26 select MACH_MSM7X30_SURF # if !
27 select MSM_GPIOMUX
30 select MSM_PROC_COMM 28 select MSM_PROC_COMM
29 select MSM_SMD
30 select MSM_VIC
31 31
32config ARCH_QSD8X50 32config ARCH_QSD8X50
33 bool "QSD8X50" 33 bool "QSD8X50"
34 select MACH_QSD8X50_SURF if !MACH_QSD8X50A_ST1_5
35 select ARCH_MSM_SCORPION 34 select ARCH_MSM_SCORPION
36 select MSM_SMD
37 select MSM_VIC
38 select CPU_V7 35 select CPU_V7
39 select MSM_GPIOMUX
40 select GPIO_MSM_V1 36 select GPIO_MSM_V1
37 select MACH_QSD8X50_SURF if !MACH_QSD8X50A_ST1_5
38 select MSM_GPIOMUX
41 select MSM_PROC_COMM 39 select MSM_PROC_COMM
40 select MSM_SMD
41 select MSM_VIC
42 42
43endchoice 43endchoice
44 44
@@ -47,10 +47,10 @@ config ARCH_MSM8X60
47 select ARCH_MSM_SCORPIONMP 47 select ARCH_MSM_SCORPIONMP
48 select ARM_GIC 48 select ARM_GIC
49 select CPU_V7 49 select CPU_V7
50 select MSM_V2_TLMM
51 select GPIO_MSM_V2 50 select GPIO_MSM_V2
52 select MSM_GPIOMUX 51 select MSM_GPIOMUX
53 select MSM_SCM if SMP 52 select MSM_SCM if SMP
53 select MSM_V2_TLMM
54 select USE_OF 54 select USE_OF
55 55
56config ARCH_MSM8960 56config ARCH_MSM8960
@@ -58,9 +58,9 @@ config ARCH_MSM8960
58 select ARCH_MSM_SCORPIONMP 58 select ARCH_MSM_SCORPIONMP
59 select ARM_GIC 59 select ARM_GIC
60 select CPU_V7 60 select CPU_V7
61 select MSM_V2_TLMM
62 select MSM_GPIOMUX 61 select MSM_GPIOMUX
63 select MSM_SCM if SMP 62 select MSM_SCM if SMP
63 select MSM_V2_TLMM
64 select USE_OF 64 select USE_OF
65 65
66config MSM_HAS_DEBUG_UART_HS 66config MSM_HAS_DEBUG_UART_HS
@@ -110,8 +110,8 @@ config MACH_QSD8X50_SURF
110 110
111config MACH_QSD8X50A_ST1_5 111config MACH_QSD8X50A_ST1_5
112 depends on ARCH_QSD8X50 112 depends on ARCH_QSD8X50
113 select MSM_SOC_REV_A
114 bool "QSD8x50A ST1.5" 113 bool "QSD8x50A ST1.5"
114 select MSM_SOC_REV_A
115 help 115 help
116 Support for the Qualcomm ST1.5. 116 Support for the Qualcomm ST1.5.
117 117
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig
index 365879b47c0e..c744946ef022 100644
--- a/arch/arm/mach-nomadik/Kconfig
+++ b/arch/arm/mach-nomadik/Kconfig
@@ -4,8 +4,8 @@ menu "Nomadik boards"
4 4
5config MACH_NOMADIK_8815NHK 5config MACH_NOMADIK_8815NHK
6 bool "ST 8815 Nomadik Hardware Kit (evaluation board)" 6 bool "ST 8815 Nomadik Hardware Kit (evaluation board)"
7 select NOMADIK_8815
8 select HAS_MTU 7 select HAS_MTU
8 select NOMADIK_8815
9 9
10endmenu 10endmenu
11 11
@@ -16,7 +16,7 @@ config I2C_BITBANG_8815NHK
16 tristate "Driver for bit-bang busses found on the 8815 NHK" 16 tristate "Driver for bit-bang busses found on the 8815 NHK"
17 depends on I2C && MACH_NOMADIK_8815NHK 17 depends on I2C && MACH_NOMADIK_8815NHK
18 depends on PINCTRL_NOMADIK 18 depends on PINCTRL_NOMADIK
19 select I2C_ALGOBIT
20 default y 19 default y
20 select I2C_ALGOBIT
21 21
22endif 22endif
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index cba3f7191cfc..903da8eb886c 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -8,15 +8,15 @@ comment "OMAP Core Type"
8config ARCH_OMAP730 8config ARCH_OMAP730
9 depends on ARCH_OMAP1 9 depends on ARCH_OMAP1
10 bool "OMAP730 Based System" 10 bool "OMAP730 Based System"
11 select ARCH_OMAP_OTG
11 select CPU_ARM926T 12 select CPU_ARM926T
12 select OMAP_MPU_TIMER 13 select OMAP_MPU_TIMER
13 select ARCH_OMAP_OTG
14 14
15config ARCH_OMAP850 15config ARCH_OMAP850
16 depends on ARCH_OMAP1 16 depends on ARCH_OMAP1
17 bool "OMAP850 Based System" 17 bool "OMAP850 Based System"
18 select CPU_ARM926T
19 select ARCH_OMAP_OTG 18 select ARCH_OMAP_OTG
19 select CPU_ARM926T
20 20
21config ARCH_OMAP15XX 21config ARCH_OMAP15XX
22 depends on ARCH_OMAP1 22 depends on ARCH_OMAP1
@@ -28,8 +28,8 @@ config ARCH_OMAP15XX
28config ARCH_OMAP16XX 28config ARCH_OMAP16XX
29 depends on ARCH_OMAP1 29 depends on ARCH_OMAP1
30 bool "OMAP16xx Based System" 30 bool "OMAP16xx Based System"
31 select CPU_ARM926T
32 select ARCH_OMAP_OTG 31 select ARCH_OMAP_OTG
32 select CPU_ARM926T
33 33
34comment "OMAP Board Type" 34comment "OMAP Board Type"
35 depends on ARCH_OMAP1 35 depends on ARCH_OMAP1
@@ -132,8 +132,8 @@ config MACH_OMAP_PALMTT
132 132
133config MACH_SX1 133config MACH_SX1
134 bool "Siemens SX1" 134 bool "Siemens SX1"
135 select I2C
136 depends on ARCH_OMAP1 && ARCH_OMAP15XX 135 depends on ARCH_OMAP1 && ARCH_OMAP15XX
136 select I2C
137 help 137 help
138 Support for the Siemens SX1 phone. To boot the kernel, 138 Support for the Siemens SX1 phone. To boot the kernel,
139 you'll need a SX1 compatible bootloader; check out 139 you'll need a SX1 compatible bootloader; check out
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index a6219eaf1f68..2a1a898c7f90 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -6,19 +6,19 @@ config ARCH_OMAP2PLUS_TYPICAL
6 bool "Typical OMAP configuration" 6 bool "Typical OMAP configuration"
7 default y 7 default y
8 select AEABI 8 select AEABI
9 select REGULATOR 9 select HIGHMEM
10 select PM_RUNTIME
11 select VFP
12 select NEON if ARCH_OMAP3 || ARCH_OMAP4 || SOC_OMAP5
13 select SERIAL_OMAP
14 select SERIAL_OMAP_CONSOLE
15 select I2C 10 select I2C
16 select I2C_OMAP 11 select I2C_OMAP
17 select MENELAUS if ARCH_OMAP2 12 select MENELAUS if ARCH_OMAP2
13 select NEON if ARCH_OMAP3 || ARCH_OMAP4 || SOC_OMAP5
14 select PINCTRL
15 select PM_RUNTIME
16 select REGULATOR
17 select SERIAL_OMAP
18 select SERIAL_OMAP_CONSOLE
18 select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4 19 select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
19 select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4 20 select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4
20 select HIGHMEM 21 select VFP
21 select PINCTRL
22 help 22 help
23 Compile a kernel suitable for booting most boards 23 Compile a kernel suitable for booting most boards
24 24
@@ -40,44 +40,44 @@ config ARCH_OMAP3
40 bool "TI OMAP3" 40 bool "TI OMAP3"
41 depends on ARCH_OMAP2PLUS 41 depends on ARCH_OMAP2PLUS
42 default y 42 default y
43 select CPU_V7
44 select USB_ARCH_HAS_EHCI if USB_SUPPORT
45 select ARCH_HAS_OPP 43 select ARCH_HAS_OPP
46 select PM_RUNTIME if CPU_IDLE
47 select PM_OPP if PM
48 select ARM_CPU_SUSPEND if PM 44 select ARM_CPU_SUSPEND if PM
45 select CPU_V7
49 select MULTI_IRQ_HANDLER 46 select MULTI_IRQ_HANDLER
50 select SOC_HAS_OMAP2_SDRC
51 select OMAP_INTERCONNECT 47 select OMAP_INTERCONNECT
48 select PM_OPP if PM
49 select PM_RUNTIME if CPU_IDLE
50 select SOC_HAS_OMAP2_SDRC
51 select USB_ARCH_HAS_EHCI if USB_SUPPORT
52 52
53config ARCH_OMAP4 53config ARCH_OMAP4
54 bool "TI OMAP4" 54 bool "TI OMAP4"
55 default y 55 default y
56 depends on ARCH_OMAP2PLUS 56 depends on ARCH_OMAP2PLUS
57 select ARCH_HAS_OPP
58 select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
59 select ARM_CPU_SUSPEND if PM
60 select ARM_ERRATA_720789
61 select ARM_GIC
57 select CACHE_L2X0 62 select CACHE_L2X0
58 select CPU_V7 63 select CPU_V7
59 select ARM_GIC
60 select HAVE_SMP 64 select HAVE_SMP
61 select LOCAL_TIMERS if SMP 65 select LOCAL_TIMERS if SMP
66 select OMAP_INTERCONNECT
62 select PL310_ERRATA_588369 67 select PL310_ERRATA_588369
63 select PL310_ERRATA_727915 68 select PL310_ERRATA_727915
64 select ARM_ERRATA_720789
65 select ARCH_HAS_OPP
66 select PM_RUNTIME if CPU_IDLE
67 select PM_OPP if PM 69 select PM_OPP if PM
70 select PM_RUNTIME if CPU_IDLE
68 select USB_ARCH_HAS_EHCI if USB_SUPPORT 71 select USB_ARCH_HAS_EHCI if USB_SUPPORT
69 select ARM_CPU_SUSPEND if PM
70 select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
71 select OMAP_INTERCONNECT
72 72
73config SOC_OMAP5 73config SOC_OMAP5
74 bool "TI OMAP5" 74 bool "TI OMAP5"
75 select CPU_V7 75 select ARM_ARCH_TIMER
76 select ARM_CPU_SUSPEND if PM
76 select ARM_GIC 77 select ARM_GIC
78 select CPU_V7
77 select HAVE_SMP 79 select HAVE_SMP
78 select ARM_CPU_SUSPEND if PM
79 select SOC_HAS_REALTIME_COUNTER 80 select SOC_HAS_REALTIME_COUNTER
80 select ARM_ARCH_TIMER
81 81
82comment "OMAP Core Type" 82comment "OMAP Core Type"
83 depends on ARCH_OMAP2 83 depends on ARCH_OMAP2
@@ -109,8 +109,8 @@ config SOC_TI81XX
109config SOC_AM33XX 109config SOC_AM33XX
110 bool "AM33XX support" 110 bool "AM33XX support"
111 default y 111 default y
112 select CPU_V7
113 select ARM_CPU_SUSPEND if PM 112 select ARM_CPU_SUSPEND if PM
113 select CPU_V7
114 select MULTI_IRQ_HANDLER 114 select MULTI_IRQ_HANDLER
115 115
116config OMAP_PACKAGE_ZAF 116config OMAP_PACKAGE_ZAF
@@ -157,8 +157,8 @@ config MACH_OMAP_H4
157 bool "OMAP 2420 H4 board" 157 bool "OMAP 2420 H4 board"
158 depends on SOC_OMAP2420 158 depends on SOC_OMAP2420
159 default y 159 default y
160 select OMAP_PACKAGE_ZAF
161 select OMAP_DEBUG_DEVICES 160 select OMAP_DEBUG_DEVICES
161 select OMAP_PACKAGE_ZAF
162 162
163config MACH_OMAP_APOLLON 163config MACH_OMAP_APOLLON
164 bool "OMAP 2420 Apollon board" 164 bool "OMAP 2420 Apollon board"
@@ -193,8 +193,8 @@ config MACH_OMAP_LDP
193config MACH_OMAP3530_LV_SOM 193config MACH_OMAP3530_LV_SOM
194 bool "OMAP3 Logic 3530 LV SOM board" 194 bool "OMAP3 Logic 3530 LV SOM board"
195 depends on ARCH_OMAP3 195 depends on ARCH_OMAP3
196 select OMAP_PACKAGE_CBB
197 default y 196 default y
197 select OMAP_PACKAGE_CBB
198 help 198 help
199 Support for the LogicPD OMAP3530 SOM Development kit 199 Support for the LogicPD OMAP3530 SOM Development kit
200 for full description please see the products webpage at 200 for full description please see the products webpage at
@@ -203,8 +203,8 @@ config MACH_OMAP3530_LV_SOM
203config MACH_OMAP3_TORPEDO 203config MACH_OMAP3_TORPEDO
204 bool "OMAP3 Logic 35x Torpedo board" 204 bool "OMAP3 Logic 35x Torpedo board"
205 depends on ARCH_OMAP3 205 depends on ARCH_OMAP3
206 select OMAP_PACKAGE_CBB
207 default y 206 default y
207 select OMAP_PACKAGE_CBB
208 help 208 help
209 Support for the LogicPD OMAP35x Torpedo Development kit 209 Support for the LogicPD OMAP35x Torpedo Development kit
210 for full description please see the products webpage at 210 for full description please see the products webpage at
@@ -265,17 +265,17 @@ config MACH_NOKIA_N8X0
265 bool "Nokia N800/N810" 265 bool "Nokia N800/N810"
266 depends on SOC_OMAP2420 266 depends on SOC_OMAP2420
267 default y 267 default y
268 select OMAP_PACKAGE_ZAC
269 select MACH_NOKIA_N800 268 select MACH_NOKIA_N800
270 select MACH_NOKIA_N810 269 select MACH_NOKIA_N810
271 select MACH_NOKIA_N810_WIMAX 270 select MACH_NOKIA_N810_WIMAX
271 select OMAP_PACKAGE_ZAC
272 272
273config MACH_NOKIA_RM680 273config MACH_NOKIA_RM680
274 bool "Nokia RM-680/696 board" 274 bool "Nokia RM-680/696 board"
275 depends on ARCH_OMAP3 275 depends on ARCH_OMAP3
276 default y 276 default y
277 select OMAP_PACKAGE_CBB
278 select MACH_NOKIA_RM696 277 select MACH_NOKIA_RM696
278 select OMAP_PACKAGE_CBB
279 279
280config MACH_NOKIA_RX51 280config MACH_NOKIA_RX51
281 bool "Nokia RX-51 board" 281 bool "Nokia RX-51 board"
@@ -288,20 +288,20 @@ config MACH_OMAP_ZOOM2
288 depends on ARCH_OMAP3 288 depends on ARCH_OMAP3
289 default y 289 default y
290 select OMAP_PACKAGE_CBB 290 select OMAP_PACKAGE_CBB
291 select REGULATOR_FIXED_VOLTAGE if REGULATOR
291 select SERIAL_8250 292 select SERIAL_8250
292 select SERIAL_CORE_CONSOLE
293 select SERIAL_8250_CONSOLE 293 select SERIAL_8250_CONSOLE
294 select REGULATOR_FIXED_VOLTAGE if REGULATOR 294 select SERIAL_CORE_CONSOLE
295 295
296config MACH_OMAP_ZOOM3 296config MACH_OMAP_ZOOM3
297 bool "OMAP3630 Zoom3 board" 297 bool "OMAP3630 Zoom3 board"
298 depends on ARCH_OMAP3 298 depends on ARCH_OMAP3
299 default y 299 default y
300 select OMAP_PACKAGE_CBP 300 select OMAP_PACKAGE_CBP
301 select REGULATOR_FIXED_VOLTAGE if REGULATOR
301 select SERIAL_8250 302 select SERIAL_8250
302 select SERIAL_CORE_CONSOLE
303 select SERIAL_8250_CONSOLE 303 select SERIAL_8250_CONSOLE
304 select REGULATOR_FIXED_VOLTAGE if REGULATOR 304 select SERIAL_CORE_CONSOLE
305 305
306config MACH_CM_T35 306config MACH_CM_T35
307 bool "CompuLab CM-T35/CM-T3730 modules" 307 bool "CompuLab CM-T35/CM-T3730 modules"
@@ -329,8 +329,8 @@ config MACH_IGEP0030
329 bool "IGEP OMAP3 module" 329 bool "IGEP OMAP3 module"
330 depends on ARCH_OMAP3 330 depends on ARCH_OMAP3
331 default y 331 default y
332 select OMAP_PACKAGE_CBB
333 select MACH_IGEP0020 332 select MACH_IGEP0020
333 select OMAP_PACKAGE_CBB
334 334
335config MACH_SBC3530 335config MACH_SBC3530
336 bool "OMAP3 SBC STALKER board" 336 bool "OMAP3 SBC STALKER board"
diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
index 41fc85327673..558ccfb8d458 100644
--- a/arch/arm/mach-prima2/Kconfig
+++ b/arch/arm/mach-prima2/Kconfig
@@ -6,8 +6,8 @@ config ARCH_PRIMA2
6 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform" 6 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
7 default y 7 default y
8 select CPU_V7 8 select CPU_V7
9 select ZONE_DMA
10 select SIRF_IRQ 9 select SIRF_IRQ
10 select ZONE_DMA
11 help 11 help
12 Support for CSR SiRFSoC ARM Cortex A9 Platform 12 Support for CSR SiRFSoC ARM Cortex A9 Platform
13 13
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 8e6288de69b9..11aa7399dc09 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -27,10 +27,10 @@ comment "Intel/Marvell Dev Platforms (sorted by hardware release time)"
27 27
28config MACH_PXA3XX_DT 28config MACH_PXA3XX_DT
29 bool "Support PXA3xx platforms from device tree" 29 bool "Support PXA3xx platforms from device tree"
30 select PXA3xx
31 select CPU_PXA300 30 select CPU_PXA300
32 select POWER_SUPPLY
33 select HAVE_PWM 31 select HAVE_PWM
32 select POWER_SUPPLY
33 select PXA3xx
34 select USE_OF 34 select USE_OF
35 help 35 help
36 Include support for Marvell PXA3xx based platforms using 36 Include support for Marvell PXA3xx based platforms using
@@ -44,13 +44,13 @@ config ARCH_LUBBOCK
44 44
45config MACH_MAINSTONE 45config MACH_MAINSTONE
46 bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)" 46 bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)"
47 select PXA27x
48 select HAVE_PWM 47 select HAVE_PWM
48 select PXA27x
49 49
50config MACH_ZYLONITE 50config MACH_ZYLONITE
51 bool 51 bool
52 select PXA3xx
53 select HAVE_PWM 52 select HAVE_PWM
53 select PXA3xx
54 54
55config MACH_ZYLONITE300 55config MACH_ZYLONITE300
56 bool "PXA3xx Development Platform (aka Zylonite) PXA300/310" 56 bool "PXA3xx Development Platform (aka Zylonite) PXA300/310"
@@ -65,19 +65,19 @@ config MACH_ZYLONITE320
65 65
66config MACH_LITTLETON 66config MACH_LITTLETON
67 bool "PXA3xx Form Factor Platform (aka Littleton)" 67 bool "PXA3xx Form Factor Platform (aka Littleton)"
68 select PXA3xx
69 select CPU_PXA300 68 select CPU_PXA300
70 select CPU_PXA310 69 select CPU_PXA310
70 select PXA3xx
71 71
72config MACH_TAVOREVB 72config MACH_TAVOREVB
73 bool "PXA930 Evaluation Board (aka TavorEVB)" 73 bool "PXA930 Evaluation Board (aka TavorEVB)"
74 select PXA3xx
75 select CPU_PXA930 74 select CPU_PXA930
75 select PXA3xx
76 76
77config MACH_SAAR 77config MACH_SAAR
78 bool "PXA930 Handheld Platform (aka SAAR)" 78 bool "PXA930 Handheld Platform (aka SAAR)"
79 select PXA3xx
80 select CPU_PXA930 79 select CPU_PXA930
80 select PXA3xx
81 81
82comment "Third Party Dev Platforms (sorted by vendor name)" 82comment "Third Party Dev Platforms (sorted by vendor name)"
83 83
@@ -87,29 +87,29 @@ config ARCH_PXA_IDP
87 87
88config ARCH_VIPER 88config ARCH_VIPER
89 bool "Arcom/Eurotech VIPER SBC" 89 bool "Arcom/Eurotech VIPER SBC"
90 select PXA25x 90 select ARCOM_PCMCIA
91 select ISA
92 select I2C_GPIO
93 select HAVE_PWM 91 select HAVE_PWM
92 select I2C_GPIO
93 select ISA
94 select PXA25x
94 select PXA_HAVE_ISA_IRQS 95 select PXA_HAVE_ISA_IRQS
95 select ARCOM_PCMCIA
96 96
97config MACH_ARCOM_ZEUS 97config MACH_ARCOM_ZEUS
98 bool "Arcom/Eurotech ZEUS SBC" 98 bool "Arcom/Eurotech ZEUS SBC"
99 select PXA27x 99 select ARCOM_PCMCIA
100 select ISA 100 select ISA
101 select PXA27x
101 select PXA_HAVE_ISA_IRQS 102 select PXA_HAVE_ISA_IRQS
102 select ARCOM_PCMCIA
103 103
104config MACH_BALLOON3 104config MACH_BALLOON3
105 bool "Balloon 3 board" 105 bool "Balloon 3 board"
106 select PXA27x
107 select IWMMXT 106 select IWMMXT
107 select PXA27x
108 108
109config MACH_CSB726 109config MACH_CSB726
110 bool "Enable Cogent CSB726 System On a Module" 110 bool "Enable Cogent CSB726 System On a Module"
111 select PXA27x
112 select IWMMXT 111 select IWMMXT
112 select PXA27x
113 help 113 help
114 Say Y here if you intend to run this kernel on a Cogent 114 Say Y here if you intend to run this kernel on a Cogent
115 CSB726 System On Module. 115 CSB726 System On Module.
@@ -121,11 +121,11 @@ config CSB726_CSB701
121config MACH_ARMCORE 121config MACH_ARMCORE
122 bool "CompuLab CM-X255/CM-X270 modules" 122 bool "CompuLab CM-X255/CM-X270 modules"
123 select ARCH_HAS_DMA_SET_COHERENT_MASK if PCI 123 select ARCH_HAS_DMA_SET_COHERENT_MASK if PCI
124 select PXA27x
125 select IWMMXT 124 select IWMMXT
126 select PXA25x
127 select MIGHT_HAVE_PCI 125 select MIGHT_HAVE_PCI
128 select NEED_MACH_IO_H if PCI 126 select NEED_MACH_IO_H if PCI
127 select PXA25x
128 select PXA27x
129 129
130config MACH_EM_X270 130config MACH_EM_X270
131 bool "CompuLab EM-x270 platform" 131 bool "CompuLab EM-x270 platform"
@@ -137,10 +137,10 @@ config MACH_EXEDA
137 137
138config MACH_CM_X300 138config MACH_CM_X300
139 bool "CompuLab CM-X300 modules" 139 bool "CompuLab CM-X300 modules"
140 select PXA3xx
141 select CPU_PXA300 140 select CPU_PXA300
142 select CPU_PXA310 141 select CPU_PXA310
143 select HAVE_PWM 142 select HAVE_PWM
143 select PXA3xx
144 144
145config MACH_CAPC7117 145config MACH_CAPC7117
146 bool "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM" 146 bool "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM"
@@ -168,22 +168,22 @@ endchoice
168 168
169config MACH_INTELMOTE2 169config MACH_INTELMOTE2
170 bool "Intel Mote 2 Platform" 170 bool "Intel Mote 2 Platform"
171 select PXA27x
172 select IWMMXT 171 select IWMMXT
172 select PXA27x
173 173
174config MACH_STARGATE2 174config MACH_STARGATE2
175 bool "Intel Stargate 2 Platform" 175 bool "Intel Stargate 2 Platform"
176 select PXA27x
177 select IWMMXT 176 select IWMMXT
177 select PXA27x
178 178
179config MACH_XCEP 179config MACH_XCEP
180 bool "Iskratel Electronics XCEP" 180 bool "Iskratel Electronics XCEP"
181 select PXA25x
182 select MTD 181 select MTD
183 select MTD_PHYSMAP
184 select MTD_CFI_INTELEXT
185 select MTD_CFI 182 select MTD_CFI
183 select MTD_CFI_INTELEXT
186 select MTD_CHAR 184 select MTD_CHAR
185 select MTD_PHYSMAP
186 select PXA25x
187 select SMC91X 187 select SMC91X
188 help 188 help
189 PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash. 189 PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash.
@@ -195,14 +195,14 @@ config TRIZEPS_PXA
195config MACH_TRIZEPS4 195config MACH_TRIZEPS4
196 bool "Keith und Koep Trizeps4 DIMM-Module" 196 bool "Keith und Koep Trizeps4 DIMM-Module"
197 depends on TRIZEPS_PXA 197 depends on TRIZEPS_PXA
198 select TRIZEPS_PCMCIA
199 select PXA27x 198 select PXA27x
199 select TRIZEPS_PCMCIA
200 200
201config MACH_TRIZEPS4WL 201config MACH_TRIZEPS4WL
202 bool "Keith und Koep Trizeps4-WL DIMM-Module" 202 bool "Keith und Koep Trizeps4-WL DIMM-Module"
203 depends on TRIZEPS_PXA 203 depends on TRIZEPS_PXA
204 select TRIZEPS_PCMCIA
205 select PXA27x 204 select PXA27x
205 select TRIZEPS_PCMCIA
206 206
207choice 207choice
208 prompt "Select base board for Trizeps module" 208 prompt "Select base board for Trizeps module"
@@ -231,18 +231,18 @@ config TRIZEPS_PCMCIA
231 231
232config MACH_LOGICPD_PXA270 232config MACH_LOGICPD_PXA270
233 bool "LogicPD PXA270 Card Engine Development Platform" 233 bool "LogicPD PXA270 Card Engine Development Platform"
234 select PXA27x
235 select HAVE_PWM 234 select HAVE_PWM
235 select PXA27x
236 236
237config MACH_PCM027 237config MACH_PCM027
238 bool "Phytec phyCORE-PXA270 CPU module (PCM-027)" 238 bool "Phytec phyCORE-PXA270 CPU module (PCM-027)"
239 select PXA27x
240 select IWMMXT 239 select IWMMXT
240 select PXA27x
241 241
242config MACH_PCM990_BASEBOARD 242config MACH_PCM990_BASEBOARD
243 bool "PHYTEC PCM-990 development board" 243 bool "PHYTEC PCM-990 development board"
244 select HAVE_PWM
245 depends on MACH_PCM027 244 depends on MACH_PCM027
245 select HAVE_PWM
246 246
247choice 247choice
248 prompt "display on pcm990" 248 prompt "display on pcm990"
@@ -266,19 +266,19 @@ config MACH_COLIBRI
266config MACH_COLIBRI_PXA270_INCOME 266config MACH_COLIBRI_PXA270_INCOME
267 bool "Income s.r.o. PXA270 SBC" 267 bool "Income s.r.o. PXA270 SBC"
268 depends on MACH_COLIBRI 268 depends on MACH_COLIBRI
269 select PXA27x
270 select HAVE_PWM 269 select HAVE_PWM
270 select PXA27x
271 271
272config MACH_COLIBRI300 272config MACH_COLIBRI300
273 bool "Toradex Colibri PXA300/310" 273 bool "Toradex Colibri PXA300/310"
274 select PXA3xx
275 select CPU_PXA300 274 select CPU_PXA300
276 select CPU_PXA310 275 select CPU_PXA310
276 select PXA3xx
277 277
278config MACH_COLIBRI320 278config MACH_COLIBRI320
279 bool "Toradex Colibri PXA320" 279 bool "Toradex Colibri PXA320"
280 select PXA3xx
281 select CPU_PXA320 280 select CPU_PXA320
281 select PXA3xx
282 282
283config MACH_COLIBRI_EVALBOARD 283config MACH_COLIBRI_EVALBOARD
284 bool "Toradex Colibri Evaluation Carrier Board support" 284 bool "Toradex Colibri Evaluation Carrier Board support"
@@ -286,8 +286,8 @@ config MACH_COLIBRI_EVALBOARD
286 286
287config MACH_VPAC270 287config MACH_VPAC270
288 bool "Voipac PXA270" 288 bool "Voipac PXA270"
289 select PXA27x
290 select HAVE_PATA_PLATFORM 289 select HAVE_PATA_PLATFORM
290 select PXA27x
291 help 291 help
292 PXA270 based Single Board Computer. 292 PXA270 based Single Board Computer.
293 293
@@ -295,9 +295,9 @@ comment "End-user Products (sorted by vendor name)"
295 295
296config MACH_H4700 296config MACH_H4700
297 bool "HP iPAQ hx4700" 297 bool "HP iPAQ hx4700"
298 select PXA27x
299 select IWMMXT
300 select HAVE_PWM 298 select HAVE_PWM
299 select IWMMXT
300 select PXA27x
301 301
302config MACH_H5000 302config MACH_H5000
303 bool "HP iPAQ h5000" 303 bool "HP iPAQ h5000"
@@ -309,16 +309,16 @@ config MACH_HIMALAYA
309 309
310config MACH_MAGICIAN 310config MACH_MAGICIAN
311 bool "Enable HTC Magician Support" 311 bool "Enable HTC Magician Support"
312 select PXA27x
313 select IWMMXT
314 select HAVE_PWM 312 select HAVE_PWM
313 select IWMMXT
314 select PXA27x
315 315
316config MACH_MIOA701 316config MACH_MIOA701
317 bool "Mitac Mio A701 Support" 317 bool "Mitac Mio A701 Support"
318 select PXA27x
319 select IWMMXT
320 select HAVE_PWM
321 select GPIO_SYSFS 318 select GPIO_SYSFS
319 select HAVE_PWM
320 select IWMMXT
321 select PXA27x
322 help 322 help
323 Say Y here if you intend to run this kernel on a 323 Say Y here if you intend to run this kernel on a
324 MIO A701. Currently there is only basic support 324 MIO A701. Currently there is only basic support
@@ -326,9 +326,9 @@ config MACH_MIOA701
326 326
327config PXA_EZX 327config PXA_EZX
328 bool "Motorola EZX Platform" 328 bool "Motorola EZX Platform"
329 select PXA27x
330 select IWMMXT
331 select HAVE_PWM 329 select HAVE_PWM
330 select IWMMXT
331 select PXA27x
332 332
333config MACH_EZX_A780 333config MACH_EZX_A780
334 bool "Motorola EZX A780" 334 bool "Motorola EZX A780"
@@ -393,9 +393,9 @@ config MACH_PALMT5
393 bool "Palm Tungsten|T5" 393 bool "Palm Tungsten|T5"
394 default y 394 default y
395 depends on ARCH_PXA_PALM 395 depends on ARCH_PXA_PALM
396 select PXA27x
397 select IWMMXT 396 select IWMMXT
398 select MACH_PALM27X 397 select MACH_PALM27X
398 select PXA27x
399 help 399 help
400 Say Y here if you intend to run this kernel on a Palm Tungsten|T5 400 Say Y here if you intend to run this kernel on a Palm Tungsten|T5
401 handheld computer. 401 handheld computer.
@@ -404,9 +404,9 @@ config MACH_PALMTX
404 bool "Palm T|X" 404 bool "Palm T|X"
405 default y 405 default y
406 depends on ARCH_PXA_PALM 406 depends on ARCH_PXA_PALM
407 select PXA27x
408 select IWMMXT 407 select IWMMXT
409 select MACH_PALM27X 408 select MACH_PALM27X
409 select PXA27x
410 help 410 help
411 Say Y here if you intend to run this kernel on a Palm T|X 411 Say Y here if you intend to run this kernel on a Palm T|X
412 handheld computer. 412 handheld computer.
@@ -415,9 +415,9 @@ config MACH_PALMZ72
415 bool "Palm Zire 72" 415 bool "Palm Zire 72"
416 default y 416 default y
417 depends on ARCH_PXA_PALM 417 depends on ARCH_PXA_PALM
418 select PXA27x
419 select IWMMXT 418 select IWMMXT
420 select MACH_PALM27X 419 select MACH_PALM27X
420 select PXA27x
421 help 421 help
422 Say Y here if you intend to run this kernel on Palm Zire 72 422 Say Y here if you intend to run this kernel on Palm Zire 72
423 handheld computer. 423 handheld computer.
@@ -426,9 +426,9 @@ config MACH_PALMLD
426 bool "Palm LifeDrive" 426 bool "Palm LifeDrive"
427 default y 427 default y
428 depends on ARCH_PXA_PALM 428 depends on ARCH_PXA_PALM
429 select PXA27x
430 select IWMMXT 429 select IWMMXT
431 select MACH_PALM27X 430 select MACH_PALM27X
431 select PXA27x
432 help 432 help
433 Say Y here if you intend to run this kernel on a Palm LifeDrive 433 Say Y here if you intend to run this kernel on a Palm LifeDrive
434 handheld computer. 434 handheld computer.
@@ -441,10 +441,10 @@ config MACH_CENTRO
441 bool "Palm Centro 685 (GSM)" 441 bool "Palm Centro 685 (GSM)"
442 default y 442 default y
443 depends on ARCH_PXA_PALM 443 depends on ARCH_PXA_PALM
444 select MACH_PALM27X
445 select PXA27x
446 select IWMMXT 444 select IWMMXT
445 select MACH_PALM27X
447 select PALM_TREO 446 select PALM_TREO
447 select PXA27x
448 help 448 help
449 Say Y here if you intend to run this kernel on Palm Centro 685 (GSM) 449 Say Y here if you intend to run this kernel on Palm Centro 685 (GSM)
450 smartphone. 450 smartphone.
@@ -453,37 +453,37 @@ config MACH_TREO680
453 bool "Palm Treo 680" 453 bool "Palm Treo 680"
454 default y 454 default y
455 depends on ARCH_PXA_PALM 455 depends on ARCH_PXA_PALM
456 select MACH_PALM27X
457 select PXA27x
458 select IWMMXT 456 select IWMMXT
457 select MACH_PALM27X
459 select PALM_TREO 458 select PALM_TREO
459 select PXA27x
460 help 460 help
461 Say Y here if you intend to run this kernel on Palm Treo 680 461 Say Y here if you intend to run this kernel on Palm Treo 680
462 smartphone. 462 smartphone.
463 463
464config MACH_RAUMFELD_RC 464config MACH_RAUMFELD_RC
465 bool "Raumfeld Controller" 465 bool "Raumfeld Controller"
466 select PXA3xx
467 select CPU_PXA300 466 select CPU_PXA300
468 select POWER_SUPPLY
469 select HAVE_PWM 467 select HAVE_PWM
468 select POWER_SUPPLY
469 select PXA3xx
470 470
471config MACH_RAUMFELD_CONNECTOR 471config MACH_RAUMFELD_CONNECTOR
472 bool "Raumfeld Connector" 472 bool "Raumfeld Connector"
473 select CPU_PXA300
473 select POWER_SUPPLY 474 select POWER_SUPPLY
474 select PXA3xx 475 select PXA3xx
475 select CPU_PXA300
476 476
477config MACH_RAUMFELD_SPEAKER 477config MACH_RAUMFELD_SPEAKER
478 bool "Raumfeld Speaker" 478 bool "Raumfeld Speaker"
479 select CPU_PXA300
479 select POWER_SUPPLY 480 select POWER_SUPPLY
480 select PXA3xx 481 select PXA3xx
481 select CPU_PXA300
482 482
483config PXA_SHARPSL 483config PXA_SHARPSL
484 bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models" 484 bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models"
485 select SHARP_SCOOP
486 select SHARP_PARAM 485 select SHARP_PARAM
486 select SHARP_SCOOP
487 help 487 help
488 Say Y here if you intend to run this kernel on a 488 Say Y here if you intend to run this kernel on a
489 Sharp Zaurus SL-5600 (Poodle), SL-C700 (Corgi), 489 Sharp Zaurus SL-5600 (Poodle), SL-C700 (Corgi),
@@ -526,11 +526,11 @@ config MACH_HUSKY
526config MACH_AKITA 526config MACH_AKITA
527 bool "Enable Sharp SL-1000 (Akita) Support" 527 bool "Enable Sharp SL-1000 (Akita) Support"
528 depends on PXA_SHARPSL 528 depends on PXA_SHARPSL
529 select PXA27x
530 select PXA_SHARP_Cxx00
531 select MACH_SPITZ
532 select I2C 529 select I2C
533 select I2C_PXA 530 select I2C_PXA
531 select MACH_SPITZ
532 select PXA27x
533 select PXA_SHARP_Cxx00
534 534
535config MACH_SPITZ 535config MACH_SPITZ
536 bool "Enable Sharp Zaurus SL-3000 (Spitz) Support" 536 bool "Enable Sharp Zaurus SL-3000 (Spitz) Support"
@@ -575,8 +575,8 @@ config MACH_ICONTROL
575 575
576config ARCH_PXA_ESERIES 576config ARCH_PXA_ESERIES
577 bool "PXA based Toshiba e-series PDAs" 577 bool "PXA based Toshiba e-series PDAs"
578 select PXA25x
579 select FB_W100 578 select FB_W100
579 select PXA25x
580 580
581config MACH_E330 581config MACH_E330
582 bool "Toshiba e330" 582 bool "Toshiba e330"
@@ -628,8 +628,8 @@ config MACH_E800
628 628
629config MACH_ZIPIT2 629config MACH_ZIPIT2
630 bool "Zipit Z2 Handheld" 630 bool "Zipit Z2 Handheld"
631 select PXA27x
632 select HAVE_PWM 631 select HAVE_PWM
632 select PXA27x
633endif 633endif
634endmenu 634endmenu
635 635
@@ -720,9 +720,9 @@ config SHARPSL_PM
720config SHARPSL_PM_MAX1111 720config SHARPSL_PM_MAX1111
721 bool 721 bool
722 select HWMON 722 select HWMON
723 select SENSORS_MAX1111
723 select SPI 724 select SPI
724 select SPI_MASTER 725 select SPI_MASTER
725 select SENSORS_MAX1111
726 726
727config PXA_HAVE_ISA_IRQS 727config PXA_HAVE_ISA_IRQS
728 bool 728 bool
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig
index c593be428b8f..14c1d47e1abf 100644
--- a/arch/arm/mach-realview/Kconfig
+++ b/arch/arm/mach-realview/Kconfig
@@ -21,8 +21,8 @@ config REALVIEW_EB_A9MP
21config REALVIEW_EB_ARM11MP 21config REALVIEW_EB_ARM11MP
22 bool "Support ARM11MPCore Tile" 22 bool "Support ARM11MPCore Tile"
23 depends on MACH_REALVIEW_EB 23 depends on MACH_REALVIEW_EB
24 select CPU_V6K
25 select ARCH_HAS_BARRIERS if SMP 24 select ARCH_HAS_BARRIERS if SMP
25 select CPU_V6K
26 select HAVE_SMP 26 select HAVE_SMP
27 select MIGHT_HAVE_CACHE_L2X0 27 select MIGHT_HAVE_CACHE_L2X0
28 help 28 help
@@ -40,12 +40,12 @@ config REALVIEW_EB_ARM11MP_REVB
40 40
41config MACH_REALVIEW_PB11MP 41config MACH_REALVIEW_PB11MP
42 bool "Support RealView(R) Platform Baseboard for ARM11MPCore" 42 bool "Support RealView(R) Platform Baseboard for ARM11MPCore"
43 select CPU_V6K 43 select ARCH_HAS_BARRIERS if SMP
44 select ARM_GIC 44 select ARM_GIC
45 select CPU_V6K
45 select HAVE_PATA_PLATFORM 46 select HAVE_PATA_PLATFORM
46 select HAVE_SMP 47 select HAVE_SMP
47 select MIGHT_HAVE_CACHE_L2X0 48 select MIGHT_HAVE_CACHE_L2X0
48 select ARCH_HAS_BARRIERS if SMP
49 help 49 help
50 Include support for the ARM(R) RealView(R) Platform Baseboard for 50 Include support for the ARM(R) RealView(R) Platform Baseboard for
51 the ARM11MPCore. This platform has an on-board ARM11MPCore and has 51 the ARM11MPCore. This platform has an on-board ARM11MPCore and has
@@ -54,8 +54,8 @@ config MACH_REALVIEW_PB11MP
54# ARMv6 CPU without K extensions, but does have the new exclusive ops 54# ARMv6 CPU without K extensions, but does have the new exclusive ops
55config MACH_REALVIEW_PB1176 55config MACH_REALVIEW_PB1176
56 bool "Support RealView(R) Platform Baseboard for ARM1176JZF-S" 56 bool "Support RealView(R) Platform Baseboard for ARM1176JZF-S"
57 select CPU_V6
58 select ARM_GIC 57 select ARM_GIC
58 select CPU_V6
59 select HAVE_TCM 59 select HAVE_TCM
60 select MIGHT_HAVE_CACHE_L2X0 60 select MIGHT_HAVE_CACHE_L2X0
61 help 61 help
@@ -73,8 +73,8 @@ config REALVIEW_PB1176_SECURE_FLASH
73 73
74config MACH_REALVIEW_PBA8 74config MACH_REALVIEW_PBA8
75 bool "Support RealView(R) Platform Baseboard for Cortex(tm)-A8 platform" 75 bool "Support RealView(R) Platform Baseboard for Cortex(tm)-A8 platform"
76 select CPU_V7
77 select ARM_GIC 76 select ARM_GIC
77 select CPU_V7
78 select HAVE_PATA_PLATFORM 78 select HAVE_PATA_PLATFORM
79 help 79 help
80 Include support for the ARM(R) RealView Platform Baseboard for 80 Include support for the ARM(R) RealView Platform Baseboard for
@@ -83,11 +83,11 @@ config MACH_REALVIEW_PBA8
83 83
84config MACH_REALVIEW_PBX 84config MACH_REALVIEW_PBX
85 bool "Support RealView(R) Platform Baseboard Explore" 85 bool "Support RealView(R) Platform Baseboard Explore"
86 select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET
86 select ARM_GIC 87 select ARM_GIC
87 select HAVE_PATA_PLATFORM 88 select HAVE_PATA_PLATFORM
88 select HAVE_SMP 89 select HAVE_SMP
89 select MIGHT_HAVE_CACHE_L2X0 90 select MIGHT_HAVE_CACHE_L2X0
90 select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET
91 select ZONE_DMA if SPARSEMEM 91 select ZONE_DMA if SPARSEMEM
92 help 92 help
93 Include support for the ARM(R) RealView(R) Platform Baseboard 93 Include support for the ARM(R) RealView(R) Platform Baseboard
diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig
index c5256f4e90bb..495f6928cbaa 100644
--- a/arch/arm/mach-s3c2412/Kconfig
+++ b/arch/arm/mach-s3c2412/Kconfig
@@ -7,7 +7,7 @@
7config S3C2412_CPUFREQ 7config S3C2412_CPUFREQ
8 bool 8 bool
9 depends on CPU_FREQ_S3C24XX && CPU_S3C2412 9 depends on CPU_FREQ_S3C24XX && CPU_S3C2412
10 select S3C2412_IOTIMING
11 default y 10 default y
11 select S3C2412_IOTIMING
12 help 12 help
13 CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs. 13 CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs.
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index ece7a10fe3c6..a4d7fd27bec5 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -5,8 +5,8 @@
5config S3C2440_CPUFREQ 5config S3C2440_CPUFREQ
6 bool "S3C2440/S3C2442 CPU Frequency scaling support" 6 bool "S3C2440/S3C2442 CPU Frequency scaling support"
7 depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442) 7 depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442)
8 select S3C2410_CPUFREQ_UTILS
9 default y 8 default y
9 select S3C2410_CPUFREQ_UTILS
10 help 10 help
11 CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs. 11 CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs.
12 12
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
index d56b0f7f2b20..2b6cb5f29c2d 100644
--- a/arch/arm/mach-s3c24xx/Kconfig
+++ b/arch/arm/mach-s3c24xx/Kconfig
@@ -17,10 +17,10 @@ config CPU_S3C2410
17 bool "SAMSUNG S3C2410" 17 bool "SAMSUNG S3C2410"
18 default y 18 default y
19 select CPU_ARM920T 19 select CPU_ARM920T
20 select S3C2410_CLOCK
21 select CPU_LLSERIAL_S3C2410 20 select CPU_LLSERIAL_S3C2410
22 select S3C2410_PM if PM 21 select S3C2410_CLOCK
23 select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX 22 select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX
23 select S3C2410_PM if PM
24 help 24 help
25 Support for S3C2410 and S3C2410A family from the S3C24XX line 25 Support for S3C2410 and S3C2410A family from the S3C24XX line
26 of Samsung Mobile CPUs. 26 of Samsung Mobile CPUs.
@@ -30,8 +30,8 @@ config CPU_S3C2412
30 depends on ARCH_S3C24XX 30 depends on ARCH_S3C24XX
31 select CPU_ARM926T 31 select CPU_ARM926T
32 select CPU_LLSERIAL_S3C2440 32 select CPU_LLSERIAL_S3C2440
33 select S3C2412_PM if PM
34 select S3C2412_DMA if S3C24XX_DMA 33 select S3C2412_DMA if S3C24XX_DMA
34 select S3C2412_PM if PM
35 help 35 help
36 Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line 36 Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
37 37
@@ -40,10 +40,10 @@ config CPU_S3C2416
40 depends on ARCH_S3C24XX 40 depends on ARCH_S3C24XX
41 select CPU_ARM926T 41 select CPU_ARM926T
42 select CPU_LLSERIAL_S3C2440 42 select CPU_LLSERIAL_S3C2440
43 select SAMSUNG_CLKSRC 43 select S3C2416_PM if PM
44 select S3C2443_COMMON 44 select S3C2443_COMMON
45 select S3C2443_DMA if S3C24XX_DMA 45 select S3C2443_DMA if S3C24XX_DMA
46 select S3C2416_PM if PM 46 select SAMSUNG_CLKSRC
47 help 47 help
48 Support for the S3C2416 SoC from the S3C24XX line 48 Support for the S3C2416 SoC from the S3C24XX line
49 49
@@ -75,9 +75,9 @@ config CPU_S3C2443
75 depends on ARCH_S3C24XX 75 depends on ARCH_S3C24XX
76 select CPU_ARM920T 76 select CPU_ARM920T
77 select CPU_LLSERIAL_S3C2440 77 select CPU_LLSERIAL_S3C2440
78 select SAMSUNG_CLKSRC
79 select S3C2443_COMMON 78 select S3C2443_COMMON
80 select S3C2443_DMA if S3C24XX_DMA 79 select S3C2443_DMA if S3C24XX_DMA
80 select SAMSUNG_CLKSRC
81 help 81 help
82 Support for the S3C2443 SoC from the S3C24XX line 82 Support for the S3C2443 SoC from the S3C24XX line
83 83
@@ -156,16 +156,16 @@ config MACH_AML_M5900
156 156
157config ARCH_BAST 157config ARCH_BAST
158 bool "Simtec Electronics BAST (EB2410ITX)" 158 bool "Simtec Electronics BAST (EB2410ITX)"
159 select ISA
160 select MACH_BAST_IDE
159 select S3C2410_IOTIMING if S3C2410_CPUFREQ 161 select S3C2410_IOTIMING if S3C2410_CPUFREQ
160 select S3C24XX_SIMTEC_PM if PM 162 select S3C24XX_DCLK
161 select S3C24XX_SIMTEC_NOR 163 select S3C24XX_SIMTEC_NOR
164 select S3C24XX_SIMTEC_PM if PM
162 select S3C24XX_SIMTEC_USB 165 select S3C24XX_SIMTEC_USB
163 select MACH_BAST_IDE
164 select S3C24XX_DCLK
165 select ISA
166 select S3C_DEV_HWMON 166 select S3C_DEV_HWMON
167 select S3C_DEV_USB_HOST
168 select S3C_DEV_NAND 167 select S3C_DEV_NAND
168 select S3C_DEV_USB_HOST
169 help 169 help
170 Say Y here if you are using the Simtec Electronics EB2410ITX 170 Say Y here if you are using the Simtec Electronics EB2410ITX
171 development board (also known as BAST) 171 development board (also known as BAST)
@@ -181,9 +181,9 @@ config BAST_PC104_IRQ
181config ARCH_H1940 181config ARCH_H1940
182 bool "IPAQ H1940" 182 bool "IPAQ H1940"
183 select PM_H1940 if PM 183 select PM_H1940 if PM
184 select S3C_DEV_USB_HOST
185 select S3C_DEV_NAND
186 select S3C24XX_SETUP_TS 184 select S3C24XX_SETUP_TS
185 select S3C_DEV_NAND
186 select S3C_DEV_USB_HOST
187 help 187 help
188 Say Y here if you are using the HP IPAQ H1940 188 Say Y here if you are using the HP IPAQ H1940
189 189
@@ -203,23 +203,23 @@ config PM_H1940
203config MACH_N30 203config MACH_N30
204 bool "Acer N30 family" 204 bool "Acer N30 family"
205 select MACH_N35 205 select MACH_N35
206 select S3C_DEV_USB_HOST
207 select S3C_DEV_NAND 206 select S3C_DEV_NAND
207 select S3C_DEV_USB_HOST
208 help 208 help
209 Say Y here if you want suppt for the Acer N30, Acer N35, 209 Say Y here if you want suppt for the Acer N30, Acer N35,
210 Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs. 210 Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs.
211 211
212config MACH_OTOM 212config MACH_OTOM
213 bool "NexVision OTOM Board" 213 bool "NexVision OTOM Board"
214 select S3C_DEV_USB_HOST
215 select S3C_DEV_NAND 214 select S3C_DEV_NAND
215 select S3C_DEV_USB_HOST
216 help 216 help
217 Say Y here if you are using the Nex Vision OTOM board 217 Say Y here if you are using the Nex Vision OTOM board
218 218
219config MACH_QT2410 219config MACH_QT2410
220 bool "QT2410" 220 bool "QT2410"
221 select S3C_DEV_USB_HOST
222 select S3C_DEV_NAND 221 select S3C_DEV_NAND
222 select S3C_DEV_USB_HOST
223 help 223 help
224 Say Y here if you are using the Armzone QT2410 224 Say Y here if you are using the Armzone QT2410
225 225
@@ -239,12 +239,12 @@ config MACH_TCT_HAMMER
239 239
240config MACH_VR1000 240config MACH_VR1000
241 bool "Thorcom VR1000" 241 bool "Thorcom VR1000"
242 select S3C24XX_SIMTEC_PM if PM 242 select MACH_BAST_IDE
243 select S3C24XX_DCLK 243 select S3C24XX_DCLK
244 select S3C24XX_SIMTEC_NOR 244 select S3C24XX_SIMTEC_NOR
245 select MACH_BAST_IDE 245 select S3C24XX_SIMTEC_PM if PM
246 select S3C_DEV_USB_HOST
247 select S3C24XX_SIMTEC_USB 246 select S3C24XX_SIMTEC_USB
247 select S3C_DEV_USB_HOST
248 help 248 help
249 Say Y here if you are using the Thorcom VR1000 board. 249 Say Y here if you are using the Thorcom VR1000 board.
250 250
@@ -285,8 +285,8 @@ comment "S3C2412 Boards"
285 285
286config MACH_JIVE 286config MACH_JIVE
287 bool "Logitech Jive" 287 bool "Logitech Jive"
288 select S3C_DEV_USB_HOST
289 select S3C_DEV_NAND 288 select S3C_DEV_NAND
289 select S3C_DEV_USB_HOST
290 help 290 help
291 Say Y here if you are using the Logitech Jive. 291 Say Y here if you are using the Logitech Jive.
292 292
@@ -314,15 +314,15 @@ config MACH_SMDK2413
314 bool "SMDK2413" 314 bool "SMDK2413"
315 select MACH_S3C2413 315 select MACH_S3C2413
316 select S3C24XX_SMDK 316 select S3C24XX_SMDK
317 select S3C_DEV_USB_HOST
318 select S3C_DEV_NAND 317 select S3C_DEV_NAND
318 select S3C_DEV_USB_HOST
319 help 319 help
320 Say Y here if you are using an SMDK2413 320 Say Y here if you are using an SMDK2413
321 321
322config MACH_VSTMS 322config MACH_VSTMS
323 bool "VMSTMS" 323 bool "VMSTMS"
324 select S3C_DEV_USB_HOST
325 select S3C_DEV_NAND 324 select S3C_DEV_NAND
325 select S3C_DEV_USB_HOST
326 help 326 help
327 Say Y here if you are using an VSTMS board 327 Say Y here if you are using an VSTMS board
328 328
@@ -351,13 +351,13 @@ comment "S3C2416 Boards"
351 351
352config MACH_SMDK2416 352config MACH_SMDK2416
353 bool "SMDK2416" 353 bool "SMDK2416"
354 select S3C2416_SETUP_SDHCI
354 select S3C24XX_SMDK 355 select S3C24XX_SMDK
355 select S3C_DEV_FB 356 select S3C_DEV_FB
356 select S3C_DEV_HSMMC 357 select S3C_DEV_HSMMC
357 select S3C_DEV_HSMMC1 358 select S3C_DEV_HSMMC1
358 select S3C_DEV_NAND 359 select S3C_DEV_NAND
359 select S3C_DEV_USB_HOST 360 select S3C_DEV_USB_HOST
360 select S3C2416_SETUP_SDHCI
361 help 361 help
362 Say Y here if you are using an SMDK2416 362 Say Y here if you are using an SMDK2416
363 363
@@ -379,11 +379,11 @@ comment "S3C2440 Boards"
379 379
380config MACH_ANUBIS 380config MACH_ANUBIS
381 bool "Simtec Electronics ANUBIS" 381 bool "Simtec Electronics ANUBIS"
382 select S3C24XX_DCLK
383 select S3C24XX_SIMTEC_PM if PM
384 select HAVE_PATA_PLATFORM 382 select HAVE_PATA_PLATFORM
385 select S3C24XX_GPIO_EXTRA64
386 select S3C2440_XTAL_12000000 383 select S3C2440_XTAL_12000000
384 select S3C24XX_DCLK
385 select S3C24XX_GPIO_EXTRA64
386 select S3C24XX_SIMTEC_PM if PM
387 select S3C_DEV_USB_HOST 387 select S3C_DEV_USB_HOST
388 help 388 help
389 Say Y here if you are using the Simtec Electronics ANUBIS 389 Say Y here if you are using the Simtec Electronics ANUBIS
@@ -391,18 +391,18 @@ config MACH_ANUBIS
391 391
392config MACH_AT2440EVB 392config MACH_AT2440EVB
393 bool "Avantech AT2440EVB development board" 393 bool "Avantech AT2440EVB development board"
394 select S3C_DEV_USB_HOST
395 select S3C_DEV_NAND 394 select S3C_DEV_NAND
395 select S3C_DEV_USB_HOST
396 help 396 help
397 Say Y here if you are using the AT2440EVB development board 397 Say Y here if you are using the AT2440EVB development board
398 398
399config MACH_MINI2440 399config MACH_MINI2440
400 bool "MINI2440 development board" 400 bool "MINI2440 development board"
401 select EEPROM_AT24 401 select EEPROM_AT24
402 select NEW_LEDS
403 select LEDS_CLASS 402 select LEDS_CLASS
404 select LEDS_TRIGGER 403 select LEDS_TRIGGER
405 select LEDS_TRIGGER_BACKLIGHT 404 select LEDS_TRIGGER_BACKLIGHT
405 select NEW_LEDS
406 select S3C_DEV_NAND 406 select S3C_DEV_NAND
407 select S3C_DEV_USB_HOST 407 select S3C_DEV_USB_HOST
408 help 408 help
@@ -412,20 +412,20 @@ config MACH_MINI2440
412config MACH_NEXCODER_2440 412config MACH_NEXCODER_2440
413 bool "NexVision NEXCODER 2440 Light Board" 413 bool "NexVision NEXCODER 2440 Light Board"
414 select S3C2440_XTAL_12000000 414 select S3C2440_XTAL_12000000
415 select S3C_DEV_USB_HOST
416 select S3C_DEV_NAND 415 select S3C_DEV_NAND
416 select S3C_DEV_USB_HOST
417 help 417 help
418 Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board 418 Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board
419 419
420config MACH_OSIRIS 420config MACH_OSIRIS
421 bool "Simtec IM2440D20 (OSIRIS) module" 421 bool "Simtec IM2440D20 (OSIRIS) module"
422 select S3C2410_IOTIMING if S3C2440_CPUFREQ
423 select S3C2440_XTAL_12000000
422 select S3C24XX_DCLK 424 select S3C24XX_DCLK
423 select S3C24XX_SIMTEC_PM if PM
424 select S3C24XX_GPIO_EXTRA128 425 select S3C24XX_GPIO_EXTRA128
425 select S3C2440_XTAL_12000000 426 select S3C24XX_SIMTEC_PM if PM
426 select S3C2410_IOTIMING if S3C2440_CPUFREQ
427 select S3C_DEV_USB_HOST
428 select S3C_DEV_NAND 427 select S3C_DEV_NAND
428 select S3C_DEV_USB_HOST
429 help 429 help
430 Say Y here if you are using the Simtec IM2440D20 module, also 430 Say Y here if you are using the Simtec IM2440D20 module, also
431 known as the Osiris. 431 known as the Osiris.
@@ -445,8 +445,8 @@ config MACH_OSIRIS_DVS
445 445
446config MACH_RX3715 446config MACH_RX3715
447 bool "HP iPAQ rx3715" 447 bool "HP iPAQ rx3715"
448 select S3C2440_XTAL_16934400
449 select PM_H1940 if PM 448 select PM_H1940 if PM
449 select S3C2440_XTAL_16934400
450 select S3C_DEV_NAND 450 select S3C_DEV_NAND
451 help 451 help
452 Say Y here if you are using the HP iPAQ rx3715. 452 Say Y here if you are using the HP iPAQ rx3715.
@@ -455,8 +455,8 @@ config ARCH_S3C2440
455 bool "SMDK2440" 455 bool "SMDK2440"
456 select S3C2440_XTAL_16934400 456 select S3C2440_XTAL_16934400
457 select S3C24XX_SMDK 457 select S3C24XX_SMDK
458 select S3C_DEV_USB_HOST
459 select S3C_DEV_NAND 458 select S3C_DEV_NAND
459 select S3C_DEV_USB_HOST
460 help 460 help
461 Say Y here if you are using the SMDK2440. 461 Say Y here if you are using the SMDK2440.
462 462
@@ -478,11 +478,11 @@ comment "S3C2442 Boards"
478 478
479config MACH_NEO1973_GTA02 479config MACH_NEO1973_GTA02
480 bool "Openmoko GTA02 / Freerunner phone" 480 bool "Openmoko GTA02 / Freerunner phone"
481 select I2C
482 select MACH_NEO1973
481 select MFD_PCF50633 483 select MFD_PCF50633
482 select PCF50633_GPIO 484 select PCF50633_GPIO
483 select I2C
484 select POWER_SUPPLY 485 select POWER_SUPPLY
485 select MACH_NEO1973
486 select S3C24XX_PWM 486 select S3C24XX_PWM
487 select S3C_DEV_USB_HOST 487 select S3C_DEV_USB_HOST
488 help 488 help
@@ -490,13 +490,13 @@ config MACH_NEO1973_GTA02
490 490
491config MACH_RX1950 491config MACH_RX1950
492 bool "HP iPAQ rx1950" 492 bool "HP iPAQ rx1950"
493 select S3C24XX_DCLK
494 select PM_H1940 if PM
495 select I2C 493 select I2C
496 select S3C24XX_PWM 494 select PM_H1940 if PM
497 select S3C_DEV_NAND
498 select S3C2410_IOTIMING if S3C2440_CPUFREQ 495 select S3C2410_IOTIMING if S3C2440_CPUFREQ
499 select S3C2440_XTAL_16934400 496 select S3C2440_XTAL_16934400
497 select S3C24XX_DCLK
498 select S3C24XX_PWM
499 select S3C_DEV_NAND
500 help 500 help
501 Say Y here if you're using HP iPAQ rx1950 501 Say Y here if you're using HP iPAQ rx1950
502 502
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 06ca1cd4cae2..63e7ae3ee9e6 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -7,9 +7,9 @@
7config PLAT_S3C64XX 7config PLAT_S3C64XX
8 bool 8 bool
9 depends on ARCH_S3C64XX 9 depends on ARCH_S3C64XX
10 select SAMSUNG_WAKEMASK
11 select PM_GENERIC_DOMAINS
12 default y 10 default y
11 select PM_GENERIC_DOMAINS
12 select SAMSUNG_WAKEMASK
13 help 13 help
14 Base platform code for any Samsung S3C64XX device 14 Base platform code for any Samsung S3C64XX device
15 15
@@ -31,8 +31,8 @@ config S3C64XX_DMA
31 select S3C_DMA 31 select S3C_DMA
32 32
33config S3C64XX_SETUP_SDHCI 33config S3C64XX_SETUP_SDHCI
34 select S3C64XX_SETUP_SDHCI_GPIO
35 bool 34 bool
35 select S3C64XX_SETUP_SDHCI_GPIO
36 help 36 help
37 Internal configuration for default SDHCI setup for S3C6400 and 37 Internal configuration for default SDHCI setup for S3C6400 and
38 S3C6410 SoCs. 38 S3C6410 SoCs.
@@ -93,9 +93,9 @@ config S3C64XX_SETUP_USB_PHY
93config MACH_SMDK6400 93config MACH_SMDK6400
94 bool "SMDK6400" 94 bool "SMDK6400"
95 select CPU_S3C6400 95 select CPU_S3C6400
96 select S3C64XX_SETUP_SDHCI
96 select S3C_DEV_HSMMC 97 select S3C_DEV_HSMMC
97 select S3C_DEV_NAND 98 select S3C_DEV_NAND
98 select S3C64XX_SETUP_SDHCI
99 help 99 help
100 Machine support for the Samsung SMDK6400 100 Machine support for the Samsung SMDK6400
101 101
@@ -104,21 +104,21 @@ config MACH_SMDK6400
104config MACH_ANW6410 104config MACH_ANW6410
105 bool "A&W6410" 105 bool "A&W6410"
106 select CPU_S3C6410 106 select CPU_S3C6410
107 select S3C_DEV_FB
108 select S3C64XX_SETUP_FB_24BPP 107 select S3C64XX_SETUP_FB_24BPP
108 select S3C_DEV_FB
109 help 109 help
110 Machine support for the A&W6410 110 Machine support for the A&W6410
111 111
112config MACH_MINI6410 112config MACH_MINI6410
113 bool "MINI6410" 113 bool "MINI6410"
114 select CPU_S3C6410 114 select CPU_S3C6410
115 select S3C64XX_SETUP_FB_24BPP
116 select S3C64XX_SETUP_SDHCI
117 select S3C_DEV_FB
115 select S3C_DEV_HSMMC 118 select S3C_DEV_HSMMC
116 select S3C_DEV_HSMMC1 119 select S3C_DEV_HSMMC1
117 select S3C64XX_SETUP_SDHCI
118 select S3C_DEV_USB_HOST
119 select S3C_DEV_NAND 120 select S3C_DEV_NAND
120 select S3C_DEV_FB 121 select S3C_DEV_USB_HOST
121 select S3C64XX_SETUP_FB_24BPP
122 select SAMSUNG_DEV_ADC 122 select SAMSUNG_DEV_ADC
123 select SAMSUNG_DEV_TS 123 select SAMSUNG_DEV_TS
124 help 124 help
@@ -127,42 +127,42 @@ config MACH_MINI6410
127config MACH_REAL6410 127config MACH_REAL6410
128 bool "REAL6410" 128 bool "REAL6410"
129 select CPU_S3C6410 129 select CPU_S3C6410
130 select S3C_DEV_HSMMC 130 select S3C64XX_SETUP_FB_24BPP
131 select S3C_DEV_HSMMC1
132 select S3C64XX_SETUP_SDHCI 131 select S3C64XX_SETUP_SDHCI
133 select S3C_DEV_FB 132 select S3C_DEV_FB
134 select S3C64XX_SETUP_FB_24BPP 133 select S3C_DEV_HSMMC
134 select S3C_DEV_HSMMC1
135 select S3C_DEV_NAND 135 select S3C_DEV_NAND
136 select S3C_DEV_USB_HOST
136 select SAMSUNG_DEV_ADC 137 select SAMSUNG_DEV_ADC
137 select SAMSUNG_DEV_TS 138 select SAMSUNG_DEV_TS
138 select S3C_DEV_USB_HOST
139 help 139 help
140 Machine support for the CoreWind REAL6410 140 Machine support for the CoreWind REAL6410
141 141
142config MACH_SMDK6410 142config MACH_SMDK6410
143 bool "SMDK6410" 143 bool "SMDK6410"
144 select CPU_S3C6410 144 select CPU_S3C6410
145 select SAMSUNG_DEV_ADC 145 select HAVE_S3C2410_WATCHDOG if WATCHDOG
146 select S3C64XX_SETUP_FB_24BPP
147 select S3C64XX_SETUP_I2C1
148 select S3C64XX_SETUP_IDE
149 select S3C64XX_SETUP_KEYPAD
150 select S3C64XX_SETUP_SDHCI
151 select S3C64XX_SETUP_USB_PHY
152 select S3C_DEV_FB
146 select S3C_DEV_HSMMC 153 select S3C_DEV_HSMMC
147 select S3C_DEV_HSMMC1 154 select S3C_DEV_HSMMC1
148 select S3C_DEV_I2C1 155 select S3C_DEV_I2C1
149 select SAMSUNG_DEV_IDE
150 select S3C_DEV_FB
151 select S3C_DEV_RTC 156 select S3C_DEV_RTC
152 select SAMSUNG_DEV_TS
153 select S3C_DEV_USB_HOST 157 select S3C_DEV_USB_HOST
154 select S3C_DEV_USB_HSOTG 158 select S3C_DEV_USB_HSOTG
155 select S3C_DEV_WDT 159 select S3C_DEV_WDT
160 select SAMSUNG_DEV_ADC
156 select SAMSUNG_DEV_BACKLIGHT 161 select SAMSUNG_DEV_BACKLIGHT
162 select SAMSUNG_DEV_IDE
157 select SAMSUNG_DEV_KEYPAD 163 select SAMSUNG_DEV_KEYPAD
158 select SAMSUNG_DEV_PWM 164 select SAMSUNG_DEV_PWM
159 select HAVE_S3C2410_WATCHDOG if WATCHDOG 165 select SAMSUNG_DEV_TS
160 select S3C64XX_SETUP_SDHCI
161 select S3C64XX_SETUP_I2C1
162 select S3C64XX_SETUP_IDE
163 select S3C64XX_SETUP_FB_24BPP
164 select S3C64XX_SETUP_KEYPAD
165 select S3C64XX_SETUP_USB_PHY
166 help 166 help
167 Machine support for the Samsung SMDK6410 167 Machine support for the Samsung SMDK6410
168 168
@@ -198,13 +198,13 @@ endchoice
198config SMDK6410_WM1190_EV1 198config SMDK6410_WM1190_EV1
199 bool "Support Wolfson Microelectronics 1190-EV1 PMIC card" 199 bool "Support Wolfson Microelectronics 1190-EV1 PMIC card"
200 depends on MACH_SMDK6410 200 depends on MACH_SMDK6410
201 select REGULATOR
202 select REGULATOR_WM8350
203 select SAMSUNG_GPIO_EXTRA64
204 select MFD_WM8350_I2C
205 select MFD_WM8350_CONFIG_MODE_0 201 select MFD_WM8350_CONFIG_MODE_0
206 select MFD_WM8350_CONFIG_MODE_3 202 select MFD_WM8350_CONFIG_MODE_3
203 select MFD_WM8350_I2C
207 select MFD_WM8352_CONFIG_MODE_0 204 select MFD_WM8352_CONFIG_MODE_0
205 select REGULATOR
206 select REGULATOR_WM8350
207 select SAMSUNG_GPIO_EXTRA64
208 help 208 help
209 The Wolfson Microelectronics 1190-EV1 is a WM835x based PMIC 209 The Wolfson Microelectronics 1190-EV1 is a WM835x based PMIC
210 and audio daughtercard for the Samsung SMDK6410 reference 210 and audio daughtercard for the Samsung SMDK6410 reference
@@ -216,11 +216,11 @@ config SMDK6410_WM1190_EV1
216config SMDK6410_WM1192_EV1 216config SMDK6410_WM1192_EV1
217 bool "Support Wolfson Microelectronics 1192-EV1 PMIC card" 217 bool "Support Wolfson Microelectronics 1192-EV1 PMIC card"
218 depends on MACH_SMDK6410 218 depends on MACH_SMDK6410
219 select MFD_WM831X
220 select MFD_WM831X_I2C
219 select REGULATOR 221 select REGULATOR
220 select REGULATOR_WM831X 222 select REGULATOR_WM831X
221 select SAMSUNG_GPIO_EXTRA64 223 select SAMSUNG_GPIO_EXTRA64
222 select MFD_WM831X
223 select MFD_WM831X_I2C
224 help 224 help
225 The Wolfson Microelectronics 1192-EV1 is a WM831x based PMIC 225 The Wolfson Microelectronics 1192-EV1 is a WM831x based PMIC
226 daughtercard for the Samsung SMDK6410 reference platform. 226 daughtercard for the Samsung SMDK6410 reference platform.
@@ -232,19 +232,19 @@ config SMDK6410_WM1192_EV1
232config MACH_NCP 232config MACH_NCP
233 bool "NCP" 233 bool "NCP"
234 select CPU_S3C6410 234 select CPU_S3C6410
235 select S3C_DEV_I2C1
236 select S3C_DEV_HSMMC1
237 select S3C64XX_SETUP_I2C1 235 select S3C64XX_SETUP_I2C1
236 select S3C_DEV_HSMMC1
237 select S3C_DEV_I2C1
238 help 238 help
239 Machine support for the Samsung NCP 239 Machine support for the Samsung NCP
240 240
241config MACH_HMT 241config MACH_HMT
242 bool "Airgoo HMT" 242 bool "Airgoo HMT"
243 select CPU_S3C6410 243 select CPU_S3C6410
244 select S3C64XX_SETUP_FB_24BPP
244 select S3C_DEV_FB 245 select S3C_DEV_FB
245 select S3C_DEV_NAND 246 select S3C_DEV_NAND
246 select S3C_DEV_USB_HOST 247 select S3C_DEV_USB_HOST
247 select S3C64XX_SETUP_FB_24BPP
248 select SAMSUNG_DEV_PWM 248 select SAMSUNG_DEV_PWM
249 help 249 help
250 Machine support for the Airgoo HMT 250 Machine support for the Airgoo HMT
@@ -252,17 +252,17 @@ config MACH_HMT
252config MACH_SMARTQ 252config MACH_SMARTQ
253 bool 253 bool
254 select CPU_S3C6410 254 select CPU_S3C6410
255 select S3C64XX_SETUP_FB_24BPP
256 select S3C64XX_SETUP_SDHCI
257 select S3C64XX_SETUP_USB_PHY
258 select S3C_DEV_FB
255 select S3C_DEV_HSMMC 259 select S3C_DEV_HSMMC
256 select S3C_DEV_HSMMC1 260 select S3C_DEV_HSMMC1
257 select S3C_DEV_HSMMC2 261 select S3C_DEV_HSMMC2
258 select S3C_DEV_FB
259 select S3C_DEV_HWMON 262 select S3C_DEV_HWMON
260 select S3C_DEV_RTC 263 select S3C_DEV_RTC
261 select S3C_DEV_USB_HSOTG
262 select S3C_DEV_USB_HOST 264 select S3C_DEV_USB_HOST
263 select S3C64XX_SETUP_SDHCI 265 select S3C_DEV_USB_HSOTG
264 select S3C64XX_SETUP_FB_24BPP
265 select S3C64XX_SETUP_USB_PHY
266 select SAMSUNG_DEV_ADC 266 select SAMSUNG_DEV_ADC
267 select SAMSUNG_DEV_PWM 267 select SAMSUNG_DEV_PWM
268 select SAMSUNG_DEV_TS 268 select SAMSUNG_DEV_TS
@@ -284,26 +284,26 @@ config MACH_SMARTQ7
284config MACH_WLF_CRAGG_6410 284config MACH_WLF_CRAGG_6410
285 bool "Wolfson Cragganmore 6410" 285 bool "Wolfson Cragganmore 6410"
286 select CPU_S3C6410 286 select CPU_S3C6410
287 select S3C64XX_SETUP_SDHCI 287 select I2C
288 select LEDS_GPIO_REGISTER
289 select S3C64XX_DEV_SPI0
290 select S3C64XX_SETUP_FB_24BPP
288 select S3C64XX_SETUP_I2C1 291 select S3C64XX_SETUP_I2C1
289 select S3C64XX_SETUP_IDE 292 select S3C64XX_SETUP_IDE
290 select S3C64XX_SETUP_FB_24BPP
291 select S3C64XX_SETUP_KEYPAD 293 select S3C64XX_SETUP_KEYPAD
294 select S3C64XX_SETUP_SDHCI
292 select S3C64XX_SETUP_SPI 295 select S3C64XX_SETUP_SPI
293 select S3C64XX_SETUP_USB_PHY 296 select S3C64XX_SETUP_USB_PHY
294 select SAMSUNG_DEV_ADC
295 select SAMSUNG_DEV_KEYPAD
296 select S3C_DEV_USB_HOST
297 select S3C_DEV_USB_HSOTG
298 select S3C_DEV_HSMMC 297 select S3C_DEV_HSMMC
299 select S3C_DEV_HSMMC1 298 select S3C_DEV_HSMMC1
300 select S3C_DEV_HSMMC2 299 select S3C_DEV_HSMMC2
301 select S3C_DEV_I2C1 300 select S3C_DEV_I2C1
302 select S3C_DEV_WDT
303 select S3C_DEV_RTC 301 select S3C_DEV_RTC
304 select S3C64XX_DEV_SPI0 302 select S3C_DEV_USB_HOST
303 select S3C_DEV_USB_HSOTG
304 select S3C_DEV_WDT
305 select SAMSUNG_DEV_ADC
306 select SAMSUNG_DEV_KEYPAD
305 select SAMSUNG_GPIO_EXTRA128 307 select SAMSUNG_GPIO_EXTRA128
306 select I2C
307 select LEDS_GPIO_REGISTER
308 help 308 help
309 Machine support for the Wolfson Cragganmore S3C6410 variant. 309 Machine support for the Wolfson Cragganmore S3C6410 variant.
diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index c87f6108eeb1..e8742cb7ddd9 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -9,18 +9,18 @@ if ARCH_S5P64X0
9 9
10config CPU_S5P6440 10config CPU_S5P6440
11 bool 11 bool
12 select SAMSUNG_DMADEV
13 select S5P_HRT 12 select S5P_HRT
14 select S5P_SLEEP if PM 13 select S5P_SLEEP if PM
14 select SAMSUNG_DMADEV
15 select SAMSUNG_WAKEMASK if PM 15 select SAMSUNG_WAKEMASK if PM
16 help 16 help
17 Enable S5P6440 CPU support 17 Enable S5P6440 CPU support
18 18
19config CPU_S5P6450 19config CPU_S5P6450
20 bool 20 bool
21 select SAMSUNG_DMADEV
22 select S5P_HRT 21 select S5P_HRT
23 select S5P_SLEEP if PM 22 select S5P_SLEEP if PM
23 select SAMSUNG_DMADEV
24 select SAMSUNG_WAKEMASK if PM 24 select SAMSUNG_WAKEMASK if PM
25 help 25 help
26 Enable S5P6450 CPU support 26 Enable S5P6450 CPU support
@@ -52,19 +52,19 @@ config MACH_SMDK6440
52 bool "SMDK6440" 52 bool "SMDK6440"
53 select CPU_S5P6440 53 select CPU_S5P6440
54 select S3C_DEV_FB 54 select S3C_DEV_FB
55 select S3C_DEV_I2C1
56 select S3C_DEV_RTC
57 select S3C_DEV_WDT
58 select S3C_DEV_HSMMC 55 select S3C_DEV_HSMMC
59 select S3C_DEV_HSMMC1 56 select S3C_DEV_HSMMC1
60 select S3C_DEV_HSMMC2 57 select S3C_DEV_HSMMC2
58 select S3C_DEV_I2C1
59 select S3C_DEV_RTC
60 select S3C_DEV_WDT
61 select S5P64X0_SETUP_FB_24BPP
62 select S5P64X0_SETUP_I2C1
63 select S5P64X0_SETUP_SDHCI_GPIO
61 select SAMSUNG_DEV_ADC 64 select SAMSUNG_DEV_ADC
62 select SAMSUNG_DEV_BACKLIGHT 65 select SAMSUNG_DEV_BACKLIGHT
63 select SAMSUNG_DEV_PWM 66 select SAMSUNG_DEV_PWM
64 select SAMSUNG_DEV_TS 67 select SAMSUNG_DEV_TS
65 select S5P64X0_SETUP_FB_24BPP
66 select S5P64X0_SETUP_I2C1
67 select S5P64X0_SETUP_SDHCI_GPIO
68 help 68 help
69 Machine support for the Samsung SMDK6440 69 Machine support for the Samsung SMDK6440
70 70
@@ -72,19 +72,19 @@ config MACH_SMDK6450
72 bool "SMDK6450" 72 bool "SMDK6450"
73 select CPU_S5P6450 73 select CPU_S5P6450
74 select S3C_DEV_FB 74 select S3C_DEV_FB
75 select S3C_DEV_I2C1
76 select S3C_DEV_RTC
77 select S3C_DEV_WDT
78 select S3C_DEV_HSMMC 75 select S3C_DEV_HSMMC
79 select S3C_DEV_HSMMC1 76 select S3C_DEV_HSMMC1
80 select S3C_DEV_HSMMC2 77 select S3C_DEV_HSMMC2
78 select S3C_DEV_I2C1
79 select S3C_DEV_RTC
80 select S3C_DEV_WDT
81 select S5P64X0_SETUP_FB_24BPP
82 select S5P64X0_SETUP_I2C1
83 select S5P64X0_SETUP_SDHCI_GPIO
81 select SAMSUNG_DEV_ADC 84 select SAMSUNG_DEV_ADC
82 select SAMSUNG_DEV_BACKLIGHT 85 select SAMSUNG_DEV_BACKLIGHT
83 select SAMSUNG_DEV_PWM 86 select SAMSUNG_DEV_PWM
84 select SAMSUNG_DEV_TS 87 select SAMSUNG_DEV_TS
85 select S5P64X0_SETUP_FB_24BPP
86 select S5P64X0_SETUP_I2C1
87 select S5P64X0_SETUP_SDHCI_GPIO
88 help 88 help
89 Machine support for the Samsung SMDK6450 89 Machine support for the Samsung SMDK6450
90 90
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index 75a26eaf2633..15170be97a74 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -60,12 +60,6 @@ config MACH_SMDKC100
60 select S3C_DEV_I2C1 60 select S3C_DEV_I2C1
61 select S3C_DEV_RTC 61 select S3C_DEV_RTC
62 select S3C_DEV_WDT 62 select S3C_DEV_WDT
63 select SAMSUNG_DEV_ADC
64 select SAMSUNG_DEV_BACKLIGHT
65 select SAMSUNG_DEV_IDE
66 select SAMSUNG_DEV_KEYPAD
67 select SAMSUNG_DEV_PWM
68 select SAMSUNG_DEV_TS
69 select S5PC100_SETUP_FB_24BPP 63 select S5PC100_SETUP_FB_24BPP
70 select S5PC100_SETUP_I2C1 64 select S5PC100_SETUP_I2C1
71 select S5PC100_SETUP_IDE 65 select S5PC100_SETUP_IDE
@@ -74,6 +68,12 @@ config MACH_SMDKC100
74 select S5P_DEV_FIMC0 68 select S5P_DEV_FIMC0
75 select S5P_DEV_FIMC1 69 select S5P_DEV_FIMC1
76 select S5P_DEV_FIMC2 70 select S5P_DEV_FIMC2
71 select SAMSUNG_DEV_ADC
72 select SAMSUNG_DEV_BACKLIGHT
73 select SAMSUNG_DEV_IDE
74 select SAMSUNG_DEV_KEYPAD
75 select SAMSUNG_DEV_PWM
76 select SAMSUNG_DEV_TS
77 help 77 help
78 Machine support for the Samsung SMDKC100 78 Machine support for the Samsung SMDKC100
79 79
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 77185c38188b..92ad72f0ef98 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -11,11 +11,11 @@ if ARCH_S5PV210
11 11
12config CPU_S5PV210 12config CPU_S5PV210
13 bool 13 bool
14 select SAMSUNG_DMADEV
15 select S5P_EXT_INT 14 select S5P_EXT_INT
16 select S5P_HRT 15 select S5P_HRT
17 select S5P_PM if PM 16 select S5P_PM if PM
18 select S5P_SLEEP if PM 17 select S5P_SLEEP if PM
18 select SAMSUNG_DMADEV
19 help 19 help
20 Enable S5PV210 CPU support 20 Enable S5PV210 CPU support
21 21
@@ -76,44 +76,44 @@ config MACH_AQUILA
76 bool "Aquila" 76 bool "Aquila"
77 select CPU_S5PV210 77 select CPU_S5PV210
78 select S3C_DEV_FB 78 select S3C_DEV_FB
79 select S5P_DEV_FIMC0
80 select S5P_DEV_FIMC1
81 select S5P_DEV_FIMC2
82 select S3C_DEV_HSMMC 79 select S3C_DEV_HSMMC
83 select S3C_DEV_HSMMC1 80 select S3C_DEV_HSMMC1
84 select S3C_DEV_HSMMC2 81 select S3C_DEV_HSMMC2
85 select S5P_DEV_ONENAND
86 select S5PV210_SETUP_FB_24BPP 82 select S5PV210_SETUP_FB_24BPP
87 select S5PV210_SETUP_SDHCI 83 select S5PV210_SETUP_SDHCI
88 select S5PV210_SETUP_USB_PHY 84 select S5PV210_SETUP_USB_PHY
85 select S5P_DEV_FIMC0
86 select S5P_DEV_FIMC1
87 select S5P_DEV_FIMC2
88 select S5P_DEV_ONENAND
89 help 89 help
90 Machine support for the Samsung Aquila target based on S5PC110 SoC 90 Machine support for the Samsung Aquila target based on S5PC110 SoC
91 91
92config MACH_GONI 92config MACH_GONI
93 bool "GONI" 93 bool "GONI"
94 select CPU_S5PV210 94 select CPU_S5PV210
95 select S5P_GPIO_INT
96 select S3C_DEV_FB 95 select S3C_DEV_FB
97 select S5P_DEV_FIMC0
98 select S5P_DEV_FIMC1
99 select S5P_DEV_FIMC2
100 select S3C_DEV_HSMMC 96 select S3C_DEV_HSMMC
101 select S3C_DEV_HSMMC1 97 select S3C_DEV_HSMMC1
102 select S3C_DEV_HSMMC2 98 select S3C_DEV_HSMMC2
103 select S3C_DEV_I2C1 99 select S3C_DEV_I2C1
104 select S3C_DEV_I2C2 100 select S3C_DEV_I2C2
105 select S5P_DEV_MFC
106 select S3C_DEV_USB_HSOTG 101 select S3C_DEV_USB_HSOTG
107 select S5P_DEV_ONENAND
108 select SAMSUNG_DEV_KEYPAD
109 select S5P_DEV_TV
110 select S5PV210_SETUP_FB_24BPP 102 select S5PV210_SETUP_FB_24BPP
103 select S5PV210_SETUP_FIMC
111 select S5PV210_SETUP_I2C1 104 select S5PV210_SETUP_I2C1
112 select S5PV210_SETUP_I2C2 105 select S5PV210_SETUP_I2C2
113 select S5PV210_SETUP_KEYPAD 106 select S5PV210_SETUP_KEYPAD
114 select S5PV210_SETUP_SDHCI 107 select S5PV210_SETUP_SDHCI
115 select S5PV210_SETUP_FIMC
116 select S5PV210_SETUP_USB_PHY 108 select S5PV210_SETUP_USB_PHY
109 select S5P_DEV_FIMC0
110 select S5P_DEV_FIMC1
111 select S5P_DEV_FIMC2
112 select S5P_DEV_MFC
113 select S5P_DEV_ONENAND
114 select S5P_DEV_TV
115 select S5P_GPIO_INT
116 select SAMSUNG_DEV_KEYPAD
117 help 117 help
118 Machine support for Samsung GONI board 118 Machine support for Samsung GONI board
119 S5PC110(MCP) is one of package option of S5PV210 119 S5PC110(MCP) is one of package option of S5PV210
@@ -125,14 +125,14 @@ config MACH_SMDKC110
125 select S3C_DEV_I2C2 125 select S3C_DEV_I2C2
126 select S3C_DEV_RTC 126 select S3C_DEV_RTC
127 select S3C_DEV_WDT 127 select S3C_DEV_WDT
128 select S5PV210_SETUP_I2C1
129 select S5PV210_SETUP_I2C2
130 select S5PV210_SETUP_IDE
128 select S5P_DEV_FIMC0 131 select S5P_DEV_FIMC0
129 select S5P_DEV_FIMC1 132 select S5P_DEV_FIMC1
130 select S5P_DEV_FIMC2 133 select S5P_DEV_FIMC2
131 select S5P_DEV_MFC 134 select S5P_DEV_MFC
132 select SAMSUNG_DEV_IDE 135 select SAMSUNG_DEV_IDE
133 select S5PV210_SETUP_I2C1
134 select S5PV210_SETUP_I2C2
135 select S5PV210_SETUP_IDE
136 help 136 help
137 Machine support for Samsung SMDKC110 137 Machine support for Samsung SMDKC110
138 S5PC110(MCP) is one of package option of S5PV210 138 S5PC110(MCP) is one of package option of S5PV210
@@ -154,6 +154,13 @@ config MACH_SMDKV210
154 select S3C_DEV_RTC 154 select S3C_DEV_RTC
155 select S3C_DEV_USB_HSOTG 155 select S3C_DEV_USB_HSOTG
156 select S3C_DEV_WDT 156 select S3C_DEV_WDT
157 select S5PV210_SETUP_FB_24BPP
158 select S5PV210_SETUP_I2C1
159 select S5PV210_SETUP_I2C2
160 select S5PV210_SETUP_IDE
161 select S5PV210_SETUP_KEYPAD
162 select S5PV210_SETUP_SDHCI
163 select S5PV210_SETUP_USB_PHY
157 select S5P_DEV_FIMC0 164 select S5P_DEV_FIMC0
158 select S5P_DEV_FIMC1 165 select S5P_DEV_FIMC1
159 select S5P_DEV_FIMC2 166 select S5P_DEV_FIMC2
@@ -165,20 +172,13 @@ config MACH_SMDKV210
165 select SAMSUNG_DEV_KEYPAD 172 select SAMSUNG_DEV_KEYPAD
166 select SAMSUNG_DEV_PWM 173 select SAMSUNG_DEV_PWM
167 select SAMSUNG_DEV_TS 174 select SAMSUNG_DEV_TS
168 select S5PV210_SETUP_FB_24BPP
169 select S5PV210_SETUP_I2C1
170 select S5PV210_SETUP_I2C2
171 select S5PV210_SETUP_IDE
172 select S5PV210_SETUP_KEYPAD
173 select S5PV210_SETUP_SDHCI
174 select S5PV210_SETUP_USB_PHY
175 help 175 help
176 Machine support for Samsung SMDKV210 176 Machine support for Samsung SMDKV210
177 177
178config MACH_TORBRECK 178config MACH_TORBRECK
179 bool "Torbreck" 179 bool "Torbreck"
180 select CPU_S5PV210
181 select ARCH_SPARSEMEM_ENABLE 180 select ARCH_SPARSEMEM_ENABLE
181 select CPU_S5PV210
182 select S3C_DEV_HSMMC 182 select S3C_DEV_HSMMC
183 select S3C_DEV_HSMMC1 183 select S3C_DEV_HSMMC1
184 select S3C_DEV_HSMMC2 184 select S3C_DEV_HSMMC2
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index 42625e4d949a..ca14dbdcfb22 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -49,15 +49,15 @@ config SA1100_COLLIE
49 bool "Sharp Zaurus SL5500" 49 bool "Sharp Zaurus SL5500"
50 # FIXME: select CPU_FREQ_SA11x0 50 # FIXME: select CPU_FREQ_SA11x0
51 select SHARP_LOCOMO 51 select SHARP_LOCOMO
52 select SHARP_SCOOP
53 select SHARP_PARAM 52 select SHARP_PARAM
53 select SHARP_SCOOP
54 help 54 help
55 Say Y here to support the Sharp Zaurus SL5500 PDAs. 55 Say Y here to support the Sharp Zaurus SL5500 PDAs.
56 56
57config SA1100_H3100 57config SA1100_H3100
58 bool "Compaq iPAQ H3100" 58 bool "Compaq iPAQ H3100"
59 select HTC_EGPIO
60 select CPU_FREQ_SA1110 59 select CPU_FREQ_SA1110
60 select HTC_EGPIO
61 help 61 help
62 Say Y here if you intend to run this kernel on the Compaq iPAQ 62 Say Y here if you intend to run this kernel on the Compaq iPAQ
63 H3100 handheld computer. Information about this machine and the 63 H3100 handheld computer. Information about this machine and the
@@ -67,8 +67,8 @@ config SA1100_H3100
67 67
68config SA1100_H3600 68config SA1100_H3600
69 bool "Compaq iPAQ H3600/H3700" 69 bool "Compaq iPAQ H3600/H3700"
70 select HTC_EGPIO
71 select CPU_FREQ_SA1110 70 select CPU_FREQ_SA1110
71 select HTC_EGPIO
72 help 72 help
73 Say Y here if you intend to run this kernel on the Compaq iPAQ 73 Say Y here if you intend to run this kernel on the Compaq iPAQ
74 H3600 handheld computer. Information about this machine and the 74 H3600 handheld computer. Information about this machine and the
@@ -78,16 +78,16 @@ config SA1100_H3600
78 78
79config SA1100_BADGE4 79config SA1100_BADGE4
80 bool "HP Labs BadgePAD 4" 80 bool "HP Labs BadgePAD 4"
81 select SA1111
82 select CPU_FREQ_SA1100 81 select CPU_FREQ_SA1100
82 select SA1111
83 help 83 help
84 Say Y here if you want to build a kernel for the HP Laboratories 84 Say Y here if you want to build a kernel for the HP Laboratories
85 BadgePAD 4. 85 BadgePAD 4.
86 86
87config SA1100_JORNADA720 87config SA1100_JORNADA720
88 bool "HP Jornada 720" 88 bool "HP Jornada 720"
89 select SA1111
90 # FIXME: select CPU_FREQ_SA11x0 89 # FIXME: select CPU_FREQ_SA11x0
90 select SA1111
91 help 91 help
92 Say Y here if you want to build a kernel for the HP Jornada 720 92 Say Y here if you want to build a kernel for the HP Jornada 720
93 handheld computer. See 93 handheld computer. See
@@ -95,8 +95,8 @@ config SA1100_JORNADA720
95 95
96config SA1100_JORNADA720_SSP 96config SA1100_JORNADA720_SSP
97 bool "HP Jornada 720 Extended SSP driver" 97 bool "HP Jornada 720 Extended SSP driver"
98 select SA1100_SSP
99 depends on SA1100_JORNADA720 98 depends on SA1100_JORNADA720
99 select SA1100_SSP
100 help 100 help
101 Say Y here if you have a HP Jornada 7xx handheld computer and you 101 Say Y here if you have a HP Jornada 7xx handheld computer and you
102 want to access devices connected to the MCU. Those include the 102 want to access devices connected to the MCU. Those include the
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 4cacc2d22fbe..8ae100cc655c 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -4,49 +4,49 @@ comment "SH-Mobile System Type"
4 4
5config ARCH_SH7367 5config ARCH_SH7367
6 bool "SH-Mobile G3 (SH7367)" 6 bool "SH-Mobile G3 (SH7367)"
7 select ARCH_WANT_OPTIONAL_GPIOLIB
7 select CPU_V6 8 select CPU_V6
8 select SH_CLK_CPG 9 select SH_CLK_CPG
9 select ARCH_WANT_OPTIONAL_GPIOLIB
10 10
11config ARCH_SH7377 11config ARCH_SH7377
12 bool "SH-Mobile G4 (SH7377)" 12 bool "SH-Mobile G4 (SH7377)"
13 select ARCH_WANT_OPTIONAL_GPIOLIB
13 select CPU_V7 14 select CPU_V7
14 select SH_CLK_CPG 15 select SH_CLK_CPG
15 select ARCH_WANT_OPTIONAL_GPIOLIB
16 16
17config ARCH_SH7372 17config ARCH_SH7372
18 bool "SH-Mobile AP4 (SH7372)" 18 bool "SH-Mobile AP4 (SH7372)"
19 select CPU_V7
20 select SH_CLK_CPG
21 select ARCH_WANT_OPTIONAL_GPIOLIB 19 select ARCH_WANT_OPTIONAL_GPIOLIB
22 select ARM_CPU_SUSPEND if PM || CPU_IDLE 20 select ARM_CPU_SUSPEND if PM || CPU_IDLE
21 select CPU_V7
22 select SH_CLK_CPG
23 23
24config ARCH_SH73A0 24config ARCH_SH73A0
25 bool "SH-Mobile AG5 (R8A73A00)" 25 bool "SH-Mobile AG5 (R8A73A00)"
26 select CPU_V7
27 select SH_CLK_CPG
28 select ARCH_WANT_OPTIONAL_GPIOLIB 26 select ARCH_WANT_OPTIONAL_GPIOLIB
29 select ARM_GIC 27 select ARM_GIC
28 select CPU_V7
30 select I2C 29 select I2C
30 select SH_CLK_CPG
31 31
32config ARCH_R8A7740 32config ARCH_R8A7740
33 bool "R-Mobile A1 (R8A77400)" 33 bool "R-Mobile A1 (R8A77400)"
34 select ARCH_WANT_OPTIONAL_GPIOLIB
34 select CPU_V7 35 select CPU_V7
35 select SH_CLK_CPG 36 select SH_CLK_CPG
36 select ARCH_WANT_OPTIONAL_GPIOLIB
37 37
38config ARCH_R8A7779 38config ARCH_R8A7779
39 bool "R-Car H1 (R8A77790)" 39 bool "R-Car H1 (R8A77790)"
40 select ARCH_WANT_OPTIONAL_GPIOLIB
41 select ARM_GIC
40 select CPU_V7 42 select CPU_V7
41 select SH_CLK_CPG 43 select SH_CLK_CPG
42 select ARM_GIC
43 select ARCH_WANT_OPTIONAL_GPIOLIB
44 44
45config ARCH_EMEV2 45config ARCH_EMEV2
46 bool "Emma Mobile EV2" 46 bool "Emma Mobile EV2"
47 select CPU_V7
48 select ARM_GIC
49 select ARCH_WANT_OPTIONAL_GPIOLIB 47 select ARCH_WANT_OPTIONAL_GPIOLIB
48 select ARM_GIC
49 select CPU_V7
50 50
51comment "SH-Mobile Board Type" 51comment "SH-Mobile Board Type"
52 52
@@ -65,9 +65,9 @@ config MACH_AP4EVB
65 bool "AP4EVB board" 65 bool "AP4EVB board"
66 depends on ARCH_SH7372 66 depends on ARCH_SH7372
67 select ARCH_REQUIRE_GPIOLIB 67 select ARCH_REQUIRE_GPIOLIB
68 select REGULATOR_FIXED_VOLTAGE if REGULATOR
68 select SH_LCD_MIPI_DSI 69 select SH_LCD_MIPI_DSI
69 select SND_SOC_AK4642 if SND_SIMPLE_CARD 70 select SND_SOC_AK4642 if SND_SIMPLE_CARD
70 select REGULATOR_FIXED_VOLTAGE if REGULATOR
71 71
72choice 72choice
73 prompt "AP4EVB LCD panel selection" 73 prompt "AP4EVB LCD panel selection"
@@ -84,37 +84,37 @@ endchoice
84 84
85config MACH_AG5EVM 85config MACH_AG5EVM
86 bool "AG5EVM board" 86 bool "AG5EVM board"
87 depends on ARCH_SH73A0
87 select ARCH_REQUIRE_GPIOLIB 88 select ARCH_REQUIRE_GPIOLIB
88 select SH_LCD_MIPI_DSI
89 select REGULATOR_FIXED_VOLTAGE if REGULATOR 89 select REGULATOR_FIXED_VOLTAGE if REGULATOR
90 depends on ARCH_SH73A0 90 select SH_LCD_MIPI_DSI
91 91
92config MACH_MACKEREL 92config MACH_MACKEREL
93 bool "mackerel board" 93 bool "mackerel board"
94 depends on ARCH_SH7372 94 depends on ARCH_SH7372
95 select ARCH_REQUIRE_GPIOLIB 95 select ARCH_REQUIRE_GPIOLIB
96 select SND_SOC_AK4642 if SND_SIMPLE_CARD
97 select REGULATOR_FIXED_VOLTAGE if REGULATOR 96 select REGULATOR_FIXED_VOLTAGE if REGULATOR
97 select SND_SOC_AK4642 if SND_SIMPLE_CARD
98 98
99config MACH_KOTA2 99config MACH_KOTA2
100 bool "KOTA2 board" 100 bool "KOTA2 board"
101 depends on ARCH_SH73A0
101 select ARCH_REQUIRE_GPIOLIB 102 select ARCH_REQUIRE_GPIOLIB
102 select REGULATOR_FIXED_VOLTAGE if REGULATOR 103 select REGULATOR_FIXED_VOLTAGE if REGULATOR
103 depends on ARCH_SH73A0
104 104
105config MACH_BONITO 105config MACH_BONITO
106 bool "bonito board" 106 bool "bonito board"
107 depends on ARCH_R8A7740
107 select ARCH_REQUIRE_GPIOLIB 108 select ARCH_REQUIRE_GPIOLIB
108 select REGULATOR_FIXED_VOLTAGE if REGULATOR 109 select REGULATOR_FIXED_VOLTAGE if REGULATOR
109 depends on ARCH_R8A7740
110 110
111config MACH_ARMADILLO800EVA 111config MACH_ARMADILLO800EVA
112 bool "Armadillo-800 EVA board" 112 bool "Armadillo-800 EVA board"
113 depends on ARCH_R8A7740 113 depends on ARCH_R8A7740
114 select ARCH_REQUIRE_GPIOLIB 114 select ARCH_REQUIRE_GPIOLIB
115 select USE_OF
116 select REGULATOR_FIXED_VOLTAGE if REGULATOR 115 select REGULATOR_FIXED_VOLTAGE if REGULATOR
117 select SND_SOC_WM8978 if SND_SIMPLE_CARD 116 select SND_SOC_WM8978 if SND_SIMPLE_CARD
117 select USE_OF
118 118
119config MACH_MARZEN 119config MACH_MARZEN
120 bool "MARZEN board" 120 bool "MARZEN board"
@@ -125,16 +125,16 @@ config MACH_MARZEN
125config MACH_KZM9D 125config MACH_KZM9D
126 bool "KZM9D board" 126 bool "KZM9D board"
127 depends on ARCH_EMEV2 127 depends on ARCH_EMEV2
128 select USE_OF
129 select REGULATOR_FIXED_VOLTAGE if REGULATOR 128 select REGULATOR_FIXED_VOLTAGE if REGULATOR
129 select USE_OF
130 130
131config MACH_KZM9G 131config MACH_KZM9G
132 bool "KZM-A9-GT board" 132 bool "KZM-A9-GT board"
133 depends on ARCH_SH73A0 133 depends on ARCH_SH73A0
134 select ARCH_REQUIRE_GPIOLIB 134 select ARCH_REQUIRE_GPIOLIB
135 select USE_OF
136 select SND_SOC_AK4642 if SND_SIMPLE_CARD
137 select REGULATOR_FIXED_VOLTAGE if REGULATOR 135 select REGULATOR_FIXED_VOLTAGE if REGULATOR
136 select SND_SOC_AK4642 if SND_SIMPLE_CARD
137 select USE_OF
138 138
139comment "SH-Mobile System Configuration" 139comment "SH-Mobile System Configuration"
140 140
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 11680c532b38..9ff6f6ea3617 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -4,42 +4,42 @@ comment "NVIDIA Tegra options"
4 4
5config ARCH_TEGRA_2x_SOC 5config ARCH_TEGRA_2x_SOC
6 bool "Enable support for Tegra20 family" 6 bool "Enable support for Tegra20 family"
7 select CPU_V7
8 select ARM_GIC
9 select ARCH_REQUIRE_GPIOLIB 7 select ARCH_REQUIRE_GPIOLIB
10 select PINCTRL
11 select PINCTRL_TEGRA20
12 select USB_ARCH_HAS_EHCI if USB_SUPPORT
13 select USB_ULPI if USB
14 select USB_ULPI_VIEWPORT if USB_SUPPORT
15 select ARM_ERRATA_720789 8 select ARM_ERRATA_720789
16 select ARM_ERRATA_742230 9 select ARM_ERRATA_742230
17 select ARM_ERRATA_751472 10 select ARM_ERRATA_751472
18 select ARM_ERRATA_754327 11 select ARM_ERRATA_754327
19 select ARM_ERRATA_764369 if SMP 12 select ARM_ERRATA_764369 if SMP
13 select ARM_GIC
14 select CPU_FREQ_TABLE if CPU_FREQ
15 select CPU_V7
16 select PINCTRL
17 select PINCTRL_TEGRA20
20 select PL310_ERRATA_727915 if CACHE_L2X0 18 select PL310_ERRATA_727915 if CACHE_L2X0
21 select PL310_ERRATA_769419 if CACHE_L2X0 19 select PL310_ERRATA_769419 if CACHE_L2X0
22 select CPU_FREQ_TABLE if CPU_FREQ 20 select USB_ARCH_HAS_EHCI if USB_SUPPORT
21 select USB_ULPI if USB
22 select USB_ULPI_VIEWPORT if USB_SUPPORT
23 help 23 help
24 Support for NVIDIA Tegra AP20 and T20 processors, based on the 24 Support for NVIDIA Tegra AP20 and T20 processors, based on the
25 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller 25 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
26 26
27config ARCH_TEGRA_3x_SOC 27config ARCH_TEGRA_3x_SOC
28 bool "Enable support for Tegra30 family" 28 bool "Enable support for Tegra30 family"
29 select CPU_V7
30 select ARM_GIC
31 select ARCH_REQUIRE_GPIOLIB 29 select ARCH_REQUIRE_GPIOLIB
32 select PINCTRL
33 select PINCTRL_TEGRA30
34 select USB_ARCH_HAS_EHCI if USB_SUPPORT
35 select USB_ULPI if USB
36 select USB_ULPI_VIEWPORT if USB_SUPPORT
37 select ARM_ERRATA_743622 30 select ARM_ERRATA_743622
38 select ARM_ERRATA_751472 31 select ARM_ERRATA_751472
39 select ARM_ERRATA_754322 32 select ARM_ERRATA_754322
40 select ARM_ERRATA_764369 if SMP 33 select ARM_ERRATA_764369 if SMP
41 select PL310_ERRATA_769419 if CACHE_L2X0 34 select ARM_GIC
42 select CPU_FREQ_TABLE if CPU_FREQ 35 select CPU_FREQ_TABLE if CPU_FREQ
36 select CPU_V7
37 select PINCTRL
38 select PINCTRL_TEGRA30
39 select PL310_ERRATA_769419 if CACHE_L2X0
40 select USB_ARCH_HAS_EHCI if USB_SUPPORT
41 select USB_ULPI if USB
42 select USB_ULPI_VIEWPORT if USB_SUPPORT
43 help 43 help
44 Support for NVIDIA Tegra T30 processor family, based on the 44 Support for NVIDIA Tegra T30 processor family, based on the
45 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller 45 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
diff --git a/arch/arm/mach-u300/Kconfig b/arch/arm/mach-u300/Kconfig
index f7e12ede008c..1f597647d431 100644
--- a/arch/arm/mach-u300/Kconfig
+++ b/arch/arm/mach-u300/Kconfig
@@ -7,8 +7,8 @@ comment "ST-Ericsson Mobile Platform Products"
7config MACH_U300 7config MACH_U300
8 bool "U300" 8 bool "U300"
9 select PINCTRL 9 select PINCTRL
10 select PINCTRL_U300
11 select PINCTRL_COH901 10 select PINCTRL_COH901
11 select PINCTRL_U300
12 12
13comment "ST-Ericsson U300/U335 Feature Selections" 13comment "ST-Ericsson U300/U335 Feature Selections"
14 14
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index 5848206ee9b9..e8c3f0d70ca6 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -3,33 +3,33 @@ if ARCH_U8500
3config UX500_SOC_COMMON 3config UX500_SOC_COMMON
4 bool 4 bool
5 default y 5 default y
6 select ARM_GIC
7 select HAS_MTU
8 select PL310_ERRATA_753970 if CACHE_PL310
9 select ARM_ERRATA_754322 6 select ARM_ERRATA_754322
10 select ARM_ERRATA_764369 if SMP 7 select ARM_ERRATA_764369 if SMP
8 select ARM_GIC
11 select CACHE_L2X0 9 select CACHE_L2X0
10 select COMMON_CLK
11 select HAS_MTU
12 select PINCTRL 12 select PINCTRL
13 select PINCTRL_NOMADIK 13 select PINCTRL_NOMADIK
14 select COMMON_CLK 14 select PL310_ERRATA_753970 if CACHE_PL310
15 15
16config UX500_SOC_DB8500 16config UX500_SOC_DB8500
17 bool 17 bool
18 select CPU_FREQ_TABLE if CPU_FREQ
18 select MFD_DB8500_PRCMU 19 select MFD_DB8500_PRCMU
20 select PINCTRL_DB8500
19 select REGULATOR 21 select REGULATOR
20 select REGULATOR_DB8500_PRCMU 22 select REGULATOR_DB8500_PRCMU
21 select CPU_FREQ_TABLE if CPU_FREQ
22 select PINCTRL_DB8500
23 23
24menu "Ux500 target platform (boards)" 24menu "Ux500 target platform (boards)"
25 25
26config MACH_MOP500 26config MACH_MOP500
27 bool "U8500 Development platform, MOP500 versions" 27 bool "U8500 Development platform, MOP500 versions"
28 select UX500_SOC_DB8500
29 select I2C 28 select I2C
30 select I2C_NOMADIK 29 select I2C_NOMADIK
31 select SOC_BUS
32 select REGULATOR_FIXED_VOLTAGE 30 select REGULATOR_FIXED_VOLTAGE
31 select SOC_BUS
32 select UX500_SOC_DB8500
33 help 33 help
34 Include support for the MOP500 development platform. 34 Include support for the MOP500 development platform.
35 35
diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
index c1f38f6625b2..63d8e9f81b99 100644
--- a/arch/arm/mach-versatile/Kconfig
+++ b/arch/arm/mach-versatile/Kconfig
@@ -3,9 +3,9 @@ menu "Versatile platform type"
3 3
4config ARCH_VERSATILE_PB 4config ARCH_VERSATILE_PB
5 bool "Support Versatile Platform Baseboard for ARM926EJ-S" 5 bool "Support Versatile Platform Baseboard for ARM926EJ-S"
6 default y
6 select CPU_ARM926T 7 select CPU_ARM926T
7 select MIGHT_HAVE_PCI 8 select MIGHT_HAVE_PCI
8 default y
9 help 9 help
10 Include support for the ARM(R) Versatile Platform Baseboard 10 Include support for the ARM(R) Versatile Platform Baseboard
11 for the ARM926EJ-S. 11 for the ARM926EJ-S.
@@ -19,8 +19,8 @@ config MACH_VERSATILE_AB
19 19
20config MACH_VERSATILE_DT 20config MACH_VERSATILE_DT
21 bool "Support Versatile platform from device tree" 21 bool "Support Versatile platform from device tree"
22 select USE_OF
23 select CPU_ARM926T 22 select CPU_ARM926T
23 select USE_OF
24 help 24 help
25 Include support for the ARM(R) Versatile/PB platform, 25 Include support for the ARM(R) Versatile/PB platform,
26 using the device tree for discovery 26 using the device tree for discovery
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index c9a4963b5c3d..94186b6c685f 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -10,8 +10,8 @@ config CPU_ARM7TDMI
10 depends on !MMU 10 depends on !MMU
11 select CPU_32v4T 11 select CPU_32v4T
12 select CPU_ABRT_LV4T 12 select CPU_ABRT_LV4T
13 select CPU_PABRT_LEGACY
14 select CPU_CACHE_V4 13 select CPU_CACHE_V4
14 select CPU_PABRT_LEGACY
15 help 15 help
16 A 32-bit RISC microprocessor based on the ARM7 processor core 16 A 32-bit RISC microprocessor based on the ARM7 processor core
17 which has no memory control unit and cache. 17 which has no memory control unit and cache.
@@ -24,11 +24,11 @@ config CPU_ARM720T
24 bool "Support ARM720T processor" if ARCH_INTEGRATOR 24 bool "Support ARM720T processor" if ARCH_INTEGRATOR
25 select CPU_32v4T 25 select CPU_32v4T
26 select CPU_ABRT_LV4T 26 select CPU_ABRT_LV4T
27 select CPU_PABRT_LEGACY
28 select CPU_CACHE_V4 27 select CPU_CACHE_V4
29 select CPU_CACHE_VIVT 28 select CPU_CACHE_VIVT
30 select CPU_CP15_MMU
31 select CPU_COPY_V4WT if MMU 29 select CPU_COPY_V4WT if MMU
30 select CPU_CP15_MMU
31 select CPU_PABRT_LEGACY
32 select CPU_TLB_V4WT if MMU 32 select CPU_TLB_V4WT if MMU
33 help 33 help
34 A 32-bit RISC processor with 8kByte Cache, Write Buffer and 34 A 32-bit RISC processor with 8kByte Cache, Write Buffer and
@@ -43,9 +43,9 @@ config CPU_ARM740T
43 depends on !MMU 43 depends on !MMU
44 select CPU_32v4T 44 select CPU_32v4T
45 select CPU_ABRT_LV4T 45 select CPU_ABRT_LV4T
46 select CPU_PABRT_LEGACY
47 select CPU_CACHE_V3 # although the core is v4t 46 select CPU_CACHE_V3 # although the core is v4t
48 select CPU_CP15_MPU 47 select CPU_CP15_MPU
48 select CPU_PABRT_LEGACY
49 help 49 help
50 A 32-bit RISC processor with 8KB cache or 4KB variants, 50 A 32-bit RISC processor with 8KB cache or 4KB variants,
51 write buffer and MPU(Protection Unit) built around 51 write buffer and MPU(Protection Unit) built around
@@ -60,8 +60,8 @@ config CPU_ARM9TDMI
60 depends on !MMU 60 depends on !MMU
61 select CPU_32v4T 61 select CPU_32v4T
62 select CPU_ABRT_NOMMU 62 select CPU_ABRT_NOMMU
63 select CPU_PABRT_LEGACY
64 select CPU_CACHE_V4 63 select CPU_CACHE_V4
64 select CPU_PABRT_LEGACY
65 help 65 help
66 A 32-bit RISC microprocessor based on the ARM9 processor core 66 A 32-bit RISC microprocessor based on the ARM9 processor core
67 which has no memory control unit and cache. 67 which has no memory control unit and cache.
@@ -74,11 +74,11 @@ config CPU_ARM920T
74 bool "Support ARM920T processor" if ARCH_INTEGRATOR 74 bool "Support ARM920T processor" if ARCH_INTEGRATOR
75 select CPU_32v4T 75 select CPU_32v4T
76 select CPU_ABRT_EV4T 76 select CPU_ABRT_EV4T
77 select CPU_PABRT_LEGACY
78 select CPU_CACHE_V4WT 77 select CPU_CACHE_V4WT
79 select CPU_CACHE_VIVT 78 select CPU_CACHE_VIVT
80 select CPU_CP15_MMU
81 select CPU_COPY_V4WB if MMU 79 select CPU_COPY_V4WB if MMU
80 select CPU_CP15_MMU
81 select CPU_PABRT_LEGACY
82 select CPU_TLB_V4WBI if MMU 82 select CPU_TLB_V4WBI if MMU
83 help 83 help
84 The ARM920T is licensed to be produced by numerous vendors, 84 The ARM920T is licensed to be produced by numerous vendors,
@@ -92,11 +92,11 @@ config CPU_ARM922T
92 bool "Support ARM922T processor" if ARCH_INTEGRATOR 92 bool "Support ARM922T processor" if ARCH_INTEGRATOR
93 select CPU_32v4T 93 select CPU_32v4T
94 select CPU_ABRT_EV4T 94 select CPU_ABRT_EV4T
95 select CPU_PABRT_LEGACY
96 select CPU_CACHE_V4WT 95 select CPU_CACHE_V4WT
97 select CPU_CACHE_VIVT 96 select CPU_CACHE_VIVT
98 select CPU_CP15_MMU
99 select CPU_COPY_V4WB if MMU 97 select CPU_COPY_V4WB if MMU
98 select CPU_CP15_MMU
99 select CPU_PABRT_LEGACY
100 select CPU_TLB_V4WBI if MMU 100 select CPU_TLB_V4WBI if MMU
101 help 101 help
102 The ARM922T is a version of the ARM920T, but with smaller 102 The ARM922T is a version of the ARM920T, but with smaller
@@ -111,11 +111,11 @@ config CPU_ARM925T
111 bool "Support ARM925T processor" if ARCH_OMAP1 111 bool "Support ARM925T processor" if ARCH_OMAP1
112 select CPU_32v4T 112 select CPU_32v4T
113 select CPU_ABRT_EV4T 113 select CPU_ABRT_EV4T
114 select CPU_PABRT_LEGACY
115 select CPU_CACHE_V4WT 114 select CPU_CACHE_V4WT
116 select CPU_CACHE_VIVT 115 select CPU_CACHE_VIVT
117 select CPU_CP15_MMU
118 select CPU_COPY_V4WB if MMU 116 select CPU_COPY_V4WB if MMU
117 select CPU_CP15_MMU
118 select CPU_PABRT_LEGACY
119 select CPU_TLB_V4WBI if MMU 119 select CPU_TLB_V4WBI if MMU
120 help 120 help
121 The ARM925T is a mix between the ARM920T and ARM926T, but with 121 The ARM925T is a mix between the ARM920T and ARM926T, but with
@@ -130,10 +130,10 @@ config CPU_ARM926T
130 bool "Support ARM926T processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB 130 bool "Support ARM926T processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB
131 select CPU_32v5 131 select CPU_32v5
132 select CPU_ABRT_EV5TJ 132 select CPU_ABRT_EV5TJ
133 select CPU_PABRT_LEGACY
134 select CPU_CACHE_VIVT 133 select CPU_CACHE_VIVT
135 select CPU_CP15_MMU
136 select CPU_COPY_V4WB if MMU 134 select CPU_COPY_V4WB if MMU
135 select CPU_CP15_MMU
136 select CPU_PABRT_LEGACY
137 select CPU_TLB_V4WBI if MMU 137 select CPU_TLB_V4WBI if MMU
138 help 138 help
139 This is a variant of the ARM920. It has slightly different 139 This is a variant of the ARM920. It has slightly different
@@ -148,11 +148,11 @@ config CPU_FA526
148 bool 148 bool
149 select CPU_32v4 149 select CPU_32v4
150 select CPU_ABRT_EV4 150 select CPU_ABRT_EV4
151 select CPU_PABRT_LEGACY
152 select CPU_CACHE_VIVT
153 select CPU_CP15_MMU
154 select CPU_CACHE_FA 151 select CPU_CACHE_FA
152 select CPU_CACHE_VIVT
155 select CPU_COPY_FA if MMU 153 select CPU_COPY_FA if MMU
154 select CPU_CP15_MMU
155 select CPU_PABRT_LEGACY
156 select CPU_TLB_FA if MMU 156 select CPU_TLB_FA if MMU
157 help 157 help
158 The FA526 is a version of the ARMv4 compatible processor with 158 The FA526 is a version of the ARMv4 compatible processor with
@@ -167,9 +167,9 @@ config CPU_ARM940T
167 depends on !MMU 167 depends on !MMU
168 select CPU_32v4T 168 select CPU_32v4T
169 select CPU_ABRT_NOMMU 169 select CPU_ABRT_NOMMU
170 select CPU_PABRT_LEGACY
171 select CPU_CACHE_VIVT 170 select CPU_CACHE_VIVT
172 select CPU_CP15_MPU 171 select CPU_CP15_MPU
172 select CPU_PABRT_LEGACY
173 help 173 help
174 ARM940T is a member of the ARM9TDMI family of general- 174 ARM940T is a member of the ARM9TDMI family of general-
175 purpose microprocessors with MPU and separate 4KB 175 purpose microprocessors with MPU and separate 4KB
@@ -185,9 +185,9 @@ config CPU_ARM946E
185 depends on !MMU 185 depends on !MMU
186 select CPU_32v5 186 select CPU_32v5
187 select CPU_ABRT_NOMMU 187 select CPU_ABRT_NOMMU
188 select CPU_PABRT_LEGACY
189 select CPU_CACHE_VIVT 188 select CPU_CACHE_VIVT
190 select CPU_CP15_MPU 189 select CPU_CP15_MPU
190 select CPU_PABRT_LEGACY
191 help 191 help
192 ARM946E-S is a member of the ARM9E-S family of high- 192 ARM946E-S is a member of the ARM9E-S family of high-
193 performance, 32-bit system-on-chip processor solutions. 193 performance, 32-bit system-on-chip processor solutions.
@@ -201,11 +201,11 @@ config CPU_ARM1020
201 bool "Support ARM1020T (rev 0) processor" if ARCH_INTEGRATOR 201 bool "Support ARM1020T (rev 0) processor" if ARCH_INTEGRATOR
202 select CPU_32v5 202 select CPU_32v5
203 select CPU_ABRT_EV4T 203 select CPU_ABRT_EV4T
204 select CPU_PABRT_LEGACY
205 select CPU_CACHE_V4WT 204 select CPU_CACHE_V4WT
206 select CPU_CACHE_VIVT 205 select CPU_CACHE_VIVT
207 select CPU_CP15_MMU
208 select CPU_COPY_V4WB if MMU 206 select CPU_COPY_V4WB if MMU
207 select CPU_CP15_MMU
208 select CPU_PABRT_LEGACY
209 select CPU_TLB_V4WBI if MMU 209 select CPU_TLB_V4WBI if MMU
210 help 210 help
211 The ARM1020 is the 32K cached version of the ARM10 processor, 211 The ARM1020 is the 32K cached version of the ARM10 processor,
@@ -217,25 +217,25 @@ config CPU_ARM1020
217# ARM1020E - needs validating 217# ARM1020E - needs validating
218config CPU_ARM1020E 218config CPU_ARM1020E
219 bool "Support ARM1020E processor" if ARCH_INTEGRATOR 219 bool "Support ARM1020E processor" if ARCH_INTEGRATOR
220 depends on n
220 select CPU_32v5 221 select CPU_32v5
221 select CPU_ABRT_EV4T 222 select CPU_ABRT_EV4T
222 select CPU_PABRT_LEGACY
223 select CPU_CACHE_V4WT 223 select CPU_CACHE_V4WT
224 select CPU_CACHE_VIVT 224 select CPU_CACHE_VIVT
225 select CPU_CP15_MMU
226 select CPU_COPY_V4WB if MMU 225 select CPU_COPY_V4WB if MMU
226 select CPU_CP15_MMU
227 select CPU_PABRT_LEGACY
227 select CPU_TLB_V4WBI if MMU 228 select CPU_TLB_V4WBI if MMU
228 depends on n
229 229
230# ARM1022E 230# ARM1022E
231config CPU_ARM1022 231config CPU_ARM1022
232 bool "Support ARM1022E processor" if ARCH_INTEGRATOR 232 bool "Support ARM1022E processor" if ARCH_INTEGRATOR
233 select CPU_32v5 233 select CPU_32v5
234 select CPU_ABRT_EV4T 234 select CPU_ABRT_EV4T
235 select CPU_PABRT_LEGACY
236 select CPU_CACHE_VIVT 235 select CPU_CACHE_VIVT
237 select CPU_CP15_MMU
238 select CPU_COPY_V4WB if MMU # can probably do better 236 select CPU_COPY_V4WB if MMU # can probably do better
237 select CPU_CP15_MMU
238 select CPU_PABRT_LEGACY
239 select CPU_TLB_V4WBI if MMU 239 select CPU_TLB_V4WBI if MMU
240 help 240 help
241 The ARM1022E is an implementation of the ARMv5TE architecture 241 The ARM1022E is an implementation of the ARMv5TE architecture
@@ -250,10 +250,10 @@ config CPU_ARM1026
250 bool "Support ARM1026EJ-S processor" if ARCH_INTEGRATOR 250 bool "Support ARM1026EJ-S processor" if ARCH_INTEGRATOR
251 select CPU_32v5 251 select CPU_32v5
252 select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10 252 select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10
253 select CPU_PABRT_LEGACY
254 select CPU_CACHE_VIVT 253 select CPU_CACHE_VIVT
255 select CPU_CP15_MMU
256 select CPU_COPY_V4WB if MMU # can probably do better 254 select CPU_COPY_V4WB if MMU # can probably do better
255 select CPU_CP15_MMU
256 select CPU_PABRT_LEGACY
257 select CPU_TLB_V4WBI if MMU 257 select CPU_TLB_V4WBI if MMU
258 help 258 help
259 The ARM1026EJ-S is an implementation of the ARMv5TEJ architecture 259 The ARM1026EJ-S is an implementation of the ARMv5TEJ architecture
@@ -268,11 +268,11 @@ config CPU_SA110
268 select CPU_32v3 if ARCH_RPC 268 select CPU_32v3 if ARCH_RPC
269 select CPU_32v4 if !ARCH_RPC 269 select CPU_32v4 if !ARCH_RPC
270 select CPU_ABRT_EV4 270 select CPU_ABRT_EV4
271 select CPU_PABRT_LEGACY
272 select CPU_CACHE_V4WB 271 select CPU_CACHE_V4WB
273 select CPU_CACHE_VIVT 272 select CPU_CACHE_VIVT
274 select CPU_CP15_MMU
275 select CPU_COPY_V4WB if MMU 273 select CPU_COPY_V4WB if MMU
274 select CPU_CP15_MMU
275 select CPU_PABRT_LEGACY
276 select CPU_TLB_V4WB if MMU 276 select CPU_TLB_V4WB if MMU
277 help 277 help
278 The Intel StrongARM(R) SA-110 is a 32-bit microprocessor and 278 The Intel StrongARM(R) SA-110 is a 32-bit microprocessor and
@@ -288,10 +288,10 @@ config CPU_SA1100
288 bool 288 bool
289 select CPU_32v4 289 select CPU_32v4
290 select CPU_ABRT_EV4 290 select CPU_ABRT_EV4
291 select CPU_PABRT_LEGACY
292 select CPU_CACHE_V4WB 291 select CPU_CACHE_V4WB
293 select CPU_CACHE_VIVT 292 select CPU_CACHE_VIVT
294 select CPU_CP15_MMU 293 select CPU_CP15_MMU
294 select CPU_PABRT_LEGACY
295 select CPU_TLB_V4WB if MMU 295 select CPU_TLB_V4WB if MMU
296 296
297# XScale 297# XScale
@@ -299,9 +299,9 @@ config CPU_XSCALE
299 bool 299 bool
300 select CPU_32v5 300 select CPU_32v5
301 select CPU_ABRT_EV5T 301 select CPU_ABRT_EV5T
302 select CPU_PABRT_LEGACY
303 select CPU_CACHE_VIVT 302 select CPU_CACHE_VIVT
304 select CPU_CP15_MMU 303 select CPU_CP15_MMU
304 select CPU_PABRT_LEGACY
305 select CPU_TLB_V4WBI if MMU 305 select CPU_TLB_V4WBI if MMU
306 306
307# XScale Core Version 3 307# XScale Core Version 3
@@ -309,9 +309,9 @@ config CPU_XSC3
309 bool 309 bool
310 select CPU_32v5 310 select CPU_32v5
311 select CPU_ABRT_EV5T 311 select CPU_ABRT_EV5T
312 select CPU_PABRT_LEGACY
313 select CPU_CACHE_VIVT 312 select CPU_CACHE_VIVT
314 select CPU_CP15_MMU 313 select CPU_CP15_MMU
314 select CPU_PABRT_LEGACY
315 select CPU_TLB_V4WBI if MMU 315 select CPU_TLB_V4WBI if MMU
316 select IO_36 316 select IO_36
317 317
@@ -320,21 +320,21 @@ config CPU_MOHAWK
320 bool 320 bool
321 select CPU_32v5 321 select CPU_32v5
322 select CPU_ABRT_EV5T 322 select CPU_ABRT_EV5T
323 select CPU_PABRT_LEGACY
324 select CPU_CACHE_VIVT 323 select CPU_CACHE_VIVT
324 select CPU_COPY_V4WB if MMU
325 select CPU_CP15_MMU 325 select CPU_CP15_MMU
326 select CPU_PABRT_LEGACY
326 select CPU_TLB_V4WBI if MMU 327 select CPU_TLB_V4WBI if MMU
327 select CPU_COPY_V4WB if MMU
328 328
329# Feroceon 329# Feroceon
330config CPU_FEROCEON 330config CPU_FEROCEON
331 bool 331 bool
332 select CPU_32v5 332 select CPU_32v5
333 select CPU_ABRT_EV5T 333 select CPU_ABRT_EV5T
334 select CPU_PABRT_LEGACY
335 select CPU_CACHE_VIVT 334 select CPU_CACHE_VIVT
336 select CPU_CP15_MMU
337 select CPU_COPY_FEROCEON if MMU 335 select CPU_COPY_FEROCEON if MMU
336 select CPU_CP15_MMU
337 select CPU_PABRT_LEGACY
338 select CPU_TLB_FEROCEON if MMU 338 select CPU_TLB_FEROCEON if MMU
339 339
340config CPU_FEROCEON_OLD_ID 340config CPU_FEROCEON_OLD_ID
@@ -349,20 +349,20 @@ config CPU_FEROCEON_OLD_ID
349# Marvell PJ4 349# Marvell PJ4
350config CPU_PJ4 350config CPU_PJ4
351 bool 351 bool
352 select CPU_V7
353 select ARM_THUMBEE 352 select ARM_THUMBEE
353 select CPU_V7
354 354
355# ARMv6 355# ARMv6
356config CPU_V6 356config CPU_V6
357 bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX 357 bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
358 select CPU_32v6 358 select CPU_32v6
359 select CPU_ABRT_EV6 359 select CPU_ABRT_EV6
360 select CPU_PABRT_V6
361 select CPU_CACHE_V6 360 select CPU_CACHE_V6
362 select CPU_CACHE_VIPT 361 select CPU_CACHE_VIPT
362 select CPU_COPY_V6 if MMU
363 select CPU_CP15_MMU 363 select CPU_CP15_MMU
364 select CPU_HAS_ASID if MMU 364 select CPU_HAS_ASID if MMU
365 select CPU_COPY_V6 if MMU 365 select CPU_PABRT_V6
366 select CPU_TLB_V6 if MMU 366 select CPU_TLB_V6 if MMU
367 367
368# ARMv6k 368# ARMv6k
@@ -371,12 +371,12 @@ config CPU_V6K
371 select CPU_32v6 371 select CPU_32v6
372 select CPU_32v6K 372 select CPU_32v6K
373 select CPU_ABRT_EV6 373 select CPU_ABRT_EV6
374 select CPU_PABRT_V6
375 select CPU_CACHE_V6 374 select CPU_CACHE_V6
376 select CPU_CACHE_VIPT 375 select CPU_CACHE_VIPT
376 select CPU_COPY_V6 if MMU
377 select CPU_CP15_MMU 377 select CPU_CP15_MMU
378 select CPU_HAS_ASID if MMU 378 select CPU_HAS_ASID if MMU
379 select CPU_COPY_V6 if MMU 379 select CPU_PABRT_V6
380 select CPU_TLB_V6 if MMU 380 select CPU_TLB_V6 if MMU
381 381
382# ARMv7 382# ARMv7
@@ -385,44 +385,44 @@ config CPU_V7
385 select CPU_32v6K 385 select CPU_32v6K
386 select CPU_32v7 386 select CPU_32v7
387 select CPU_ABRT_EV7 387 select CPU_ABRT_EV7
388 select CPU_PABRT_V7
389 select CPU_CACHE_V7 388 select CPU_CACHE_V7
390 select CPU_CACHE_VIPT 389 select CPU_CACHE_VIPT
390 select CPU_COPY_V6 if MMU
391 select CPU_CP15_MMU 391 select CPU_CP15_MMU
392 select CPU_HAS_ASID if MMU 392 select CPU_HAS_ASID if MMU
393 select CPU_COPY_V6 if MMU 393 select CPU_PABRT_V7
394 select CPU_TLB_V7 if MMU 394 select CPU_TLB_V7 if MMU
395 395
396# Figure out what processor architecture version we should be using. 396# Figure out what processor architecture version we should be using.
397# This defines the compiler instruction set which depends on the machine type. 397# This defines the compiler instruction set which depends on the machine type.
398config CPU_32v3 398config CPU_32v3
399 bool 399 bool
400 select TLS_REG_EMUL if SMP || !MMU
401 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
402 select CPU_USE_DOMAINS if MMU 400 select CPU_USE_DOMAINS if MMU
401 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
402 select TLS_REG_EMUL if SMP || !MMU
403 403
404config CPU_32v4 404config CPU_32v4
405 bool 405 bool
406 select TLS_REG_EMUL if SMP || !MMU
407 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
408 select CPU_USE_DOMAINS if MMU 406 select CPU_USE_DOMAINS if MMU
407 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
408 select TLS_REG_EMUL if SMP || !MMU
409 409
410config CPU_32v4T 410config CPU_32v4T
411 bool 411 bool
412 select TLS_REG_EMUL if SMP || !MMU
413 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
414 select CPU_USE_DOMAINS if MMU 412 select CPU_USE_DOMAINS if MMU
413 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
414 select TLS_REG_EMUL if SMP || !MMU
415 415
416config CPU_32v5 416config CPU_32v5
417 bool 417 bool
418 select TLS_REG_EMUL if SMP || !MMU
419 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
420 select CPU_USE_DOMAINS if MMU 418 select CPU_USE_DOMAINS if MMU
419 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
420 select TLS_REG_EMUL if SMP || !MMU
421 421
422config CPU_32v6 422config CPU_32v6
423 bool 423 bool
424 select TLS_REG_EMUL if !CPU_32v6K && !MMU
425 select CPU_USE_DOMAINS if CPU_V6 && MMU 424 select CPU_USE_DOMAINS if CPU_V6 && MMU
425 select TLS_REG_EMUL if !CPU_32v6K && !MMU
426 426
427config CPU_32v6K 427config CPU_32v6K
428 bool 428 bool
@@ -644,8 +644,8 @@ config ARM_VIRT_EXT
644config SWP_EMULATE 644config SWP_EMULATE
645 bool "Emulate SWP/SWPB instructions" 645 bool "Emulate SWP/SWPB instructions"
646 depends on !CPU_USE_DOMAINS && CPU_V7 646 depends on !CPU_USE_DOMAINS && CPU_V7
647 select HAVE_PROC_CPU if PROC_FS
648 default y if SMP 647 default y if SMP
648 select HAVE_PROC_CPU if PROC_FS
649 help 649 help
650 ARMv6 architecture deprecates use of the SWP/SWPB instructions. 650 ARMv6 architecture deprecates use of the SWP/SWPB instructions.
651 ARMv7 multiprocessing extensions introduce the ability to disable 651 ARMv7 multiprocessing extensions introduce the ability to disable
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index baf9064c0844..88e1e2e7a20d 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -10,16 +10,16 @@ choice
10 10
11config ARCH_IMX_V4_V5 11config ARCH_IMX_V4_V5
12 bool "i.MX1, i.MX21, i.MX25, i.MX27" 12 bool "i.MX1, i.MX21, i.MX25, i.MX27"
13 select AUTO_ZRELADDR if !ZBOOT_ROM
14 select ARM_PATCH_PHYS_VIRT 13 select ARM_PATCH_PHYS_VIRT
14 select AUTO_ZRELADDR if !ZBOOT_ROM
15 help 15 help
16 This enables support for systems based on the Freescale i.MX ARMv4 16 This enables support for systems based on the Freescale i.MX ARMv4
17 and ARMv5 SoCs 17 and ARMv5 SoCs
18 18
19config ARCH_IMX_V6_V7 19config ARCH_IMX_V6_V7
20 bool "i.MX3, i.MX5, i.MX6" 20 bool "i.MX3, i.MX5, i.MX6"
21 select AUTO_ZRELADDR if !ZBOOT_ROM
22 select ARM_PATCH_PHYS_VIRT 21 select ARM_PATCH_PHYS_VIRT
22 select AUTO_ZRELADDR if !ZBOOT_ROM
23 select MIGHT_HAVE_CACHE_L2X0 23 select MIGHT_HAVE_CACHE_L2X0
24 help 24 help
25 This enables support for systems based on the Freescale i.MX3, i.MX5 25 This enables support for systems based on the Freescale i.MX3, i.MX5
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
index 6b46cee2f9cd..a35d9841f494 100644
--- a/arch/arm/plat-mxc/devices/Kconfig
+++ b/arch/arm/plat-mxc/devices/Kconfig
@@ -3,8 +3,8 @@ config IMX_HAVE_PLATFORM_FEC
3 default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX50 || SOC_IMX51 || SOC_IMX53 3 default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX50 || SOC_IMX51 || SOC_IMX53
4 4
5config IMX_HAVE_PLATFORM_FLEXCAN 5config IMX_HAVE_PLATFORM_FLEXCAN
6 select HAVE_CAN_FLEXCAN if CAN
7 bool 6 bool
7 select HAVE_CAN_FLEXCAN if CAN
8 8
9config IMX_HAVE_PLATFORM_FSL_USB2_UDC 9config IMX_HAVE_PLATFORM_FSL_USB2_UDC
10 bool 10 bool
diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig
index 4c48c8b60b54..19f55cae5d73 100644
--- a/arch/arm/plat-nomadik/Kconfig
+++ b/arch/arm/plat-nomadik/Kconfig
@@ -5,8 +5,8 @@
5config PLAT_NOMADIK 5config PLAT_NOMADIK
6 bool 6 bool
7 depends on ARCH_NOMADIK || ARCH_U8500 7 depends on ARCH_NOMADIK || ARCH_U8500
8 select CLKSRC_MMIO
9 default y 8 default y
9 select CLKSRC_MMIO
10 help 10 help
11 Common platform code for Nomadik and other ST-Ericsson 11 Common platform code for Nomadik and other ST-Ericsson
12 platforms. 12 platforms.
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index c9d1c3603bbf..7cd56ed5cd94 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -14,10 +14,10 @@ config ARCH_OMAP1
14 select CLKDEV_LOOKUP 14 select CLKDEV_LOOKUP
15 select CLKSRC_MMIO 15 select CLKSRC_MMIO
16 select GENERIC_IRQ_CHIP 16 select GENERIC_IRQ_CHIP
17 select IRQ_DOMAIN
18 select HAVE_IDE 17 select HAVE_IDE
19 select NEED_MACH_MEMORY_H 18 select IRQ_DOMAIN
20 select NEED_MACH_IO_H if PCCARD 19 select NEED_MACH_IO_H if PCCARD
20 select NEED_MACH_MEMORY_H
21 help 21 help
22 "Systems based on omap7xx, omap15xx or omap16xx" 22 "Systems based on omap7xx, omap15xx or omap16xx"
23 23
@@ -25,10 +25,10 @@ config ARCH_OMAP2PLUS
25 bool "TI OMAP2/3/4" 25 bool "TI OMAP2/3/4"
26 select CLKDEV_LOOKUP 26 select CLKDEV_LOOKUP
27 select GENERIC_IRQ_CHIP 27 select GENERIC_IRQ_CHIP
28 select SPARSE_IRQ
29 select OMAP_DM_TIMER 28 select OMAP_DM_TIMER
30 select USE_OF
31 select PROC_DEVICETREE if PROC_FS 29 select PROC_DEVICETREE if PROC_FS
30 select SPARSE_IRQ
31 select USE_OF
32 help 32 help
33 "Systems based on OMAP2, OMAP3, OMAP4 or OMAP5" 33 "Systems based on OMAP2, OMAP3, OMAP4 or OMAP5"
34 34
@@ -43,8 +43,8 @@ config OMAP_DEBUG_DEVICES
43 43
44config OMAP_DEBUG_LEDS 44config OMAP_DEBUG_LEDS
45 def_bool y if NEW_LEDS 45 def_bool y if NEW_LEDS
46 select LEDS_CLASS
47 depends on OMAP_DEBUG_DEVICES 46 depends on OMAP_DEBUG_DEVICES
47 select LEDS_CLASS
48 48
49config POWER_AVS_OMAP 49config POWER_AVS_OMAP
50 bool "AVS(Adaptive Voltage Scaling) support for OMAP IP versions 1&2" 50 bool "AVS(Adaptive Voltage Scaling) support for OMAP IP versions 1&2"
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index 21bf6adb9198..eef3b6a2f8a8 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -6,8 +6,8 @@ config PLAT_S3C24XX
6 bool 6 bool
7 depends on ARCH_S3C24XX 7 depends on ARCH_S3C24XX
8 default y 8 default y
9 select NO_IOPORT
10 select ARCH_REQUIRE_GPIOLIB 9 select ARCH_REQUIRE_GPIOLIB
10 select NO_IOPORT
11 select S3C_DEV_NAND 11 select S3C_DEV_NAND
12 help 12 help
13 Base platform code for any Samsung S3C24XX device 13 Base platform code for any Samsung S3C24XX device
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 9c3b90c3538e..59401e1cc530 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -7,9 +7,9 @@
7config PLAT_SAMSUNG 7config PLAT_SAMSUNG
8 bool 8 bool
9 depends on PLAT_S3C24XX || ARCH_S3C64XX || PLAT_S5P 9 depends on PLAT_S3C24XX || ARCH_S3C64XX || PLAT_S5P
10 select NO_IOPORT
11 select GENERIC_IRQ_CHIP
12 default y 10 default y
11 select GENERIC_IRQ_CHIP
12 select NO_IOPORT
13 help 13 help
14 Base platform code for all Samsung SoC based systems 14 Base platform code for all Samsung SoC based systems
15 15
@@ -17,16 +17,16 @@ config PLAT_S5P
17 bool 17 bool
18 depends on (ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_EXYNOS) 18 depends on (ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_EXYNOS)
19 default y 19 default y
20 select ARM_VIC if !ARCH_EXYNOS 20 select ARCH_REQUIRE_GPIOLIB
21 select ARM_GIC if ARCH_EXYNOS 21 select ARM_GIC if ARCH_EXYNOS
22 select ARM_VIC if !ARCH_EXYNOS
22 select GIC_NON_BANKED if ARCH_EXYNOS4 23 select GIC_NON_BANKED if ARCH_EXYNOS4
23 select NO_IOPORT 24 select NO_IOPORT
24 select ARCH_REQUIRE_GPIOLIB 25 select PLAT_SAMSUNG
25 select S3C_GPIO_TRACK 26 select S3C_GPIO_TRACK
26 select S5P_GPIO_DRVSTR 27 select S5P_GPIO_DRVSTR
27 select SAMSUNG_GPIOLIB_4BIT
28 select PLAT_SAMSUNG
29 select SAMSUNG_CLKSRC 28 select SAMSUNG_CLKSRC
29 select SAMSUNG_GPIOLIB_4BIT
30 select SAMSUNG_IRQ_VIC_TIMER 30 select SAMSUNG_IRQ_VIC_TIMER
31 help 31 help
32 Base platform code for Samsung's S5P series SoC. 32 Base platform code for Samsung's S5P series SoC.
@@ -423,10 +423,10 @@ config S3C_DMA
423 423
424config SAMSUNG_DMADEV 424config SAMSUNG_DMADEV
425 bool 425 bool
426 select ARM_AMBA
426 select DMADEVICES 427 select DMADEVICES
427 select PL330_DMA if (ARCH_EXYNOS5 || ARCH_EXYNOS4 || CPU_S5PV210 || CPU_S5PC100 || \ 428 select PL330_DMA if (ARCH_EXYNOS5 || ARCH_EXYNOS4 || CPU_S5PV210 || CPU_S5PC100 || \
428 CPU_S5P6450 || CPU_S5P6440) 429 CPU_S5P6450 || CPU_S5P6440)
429 select ARM_AMBA
430 help 430 help
431 Use DMA device engine for PL330 DMAC. 431 Use DMA device engine for PL330 DMAC.
432 432
diff --git a/arch/arm/plat-spear/Kconfig b/arch/arm/plat-spear/Kconfig
index 4404f82d5979..f8db7b2deb36 100644
--- a/arch/arm/plat-spear/Kconfig
+++ b/arch/arm/plat-spear/Kconfig
@@ -12,10 +12,10 @@ config ARCH_SPEAR13XX
12 bool "ST SPEAr13xx with Device Tree" 12 bool "ST SPEAr13xx with Device Tree"
13 select ARM_GIC 13 select ARM_GIC
14 select CPU_V7 14 select CPU_V7
15 select USE_OF
16 select HAVE_SMP 15 select HAVE_SMP
17 select MIGHT_HAVE_CACHE_L2X0 16 select MIGHT_HAVE_CACHE_L2X0
18 select PINCTRL 17 select PINCTRL
18 select USE_OF
19 help 19 help
20 Supports for ARM's SPEAR13XX family 20 Supports for ARM's SPEAR13XX family
21 21
@@ -23,8 +23,8 @@ config ARCH_SPEAR3XX
23 bool "ST SPEAr3xx with Device Tree" 23 bool "ST SPEAr3xx with Device Tree"
24 select ARM_VIC 24 select ARM_VIC
25 select CPU_ARM926T 25 select CPU_ARM926T
26 select USE_OF
27 select PINCTRL 26 select PINCTRL
27 select USE_OF
28 help 28 help
29 Supports for ARM's SPEAR3XX family 29 Supports for ARM's SPEAR3XX family
30 30
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 5ade51c8a87f..06e73bf665e9 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -15,6 +15,8 @@ config AVR32
15 select ARCH_WANT_IPC_PARSE_VERSION 15 select ARCH_WANT_IPC_PARSE_VERSION
16 select ARCH_HAVE_NMI_SAFE_CMPXCHG 16 select ARCH_HAVE_NMI_SAFE_CMPXCHG
17 select GENERIC_CLOCKEVENTS 17 select GENERIC_CLOCKEVENTS
18 select HAVE_MOD_ARCH_SPECIFIC
19 select MODULES_USE_ELF_RELA
18 help 20 help
19 AVR32 is a high-performance 32-bit RISC microprocessor core, 21 AVR32 is a high-performance 32-bit RISC microprocessor core,
20 designed for cost-sensitive embedded applications, with particular 22 designed for cost-sensitive embedded applications, with particular
diff --git a/arch/avr32/include/asm/module.h b/arch/avr32/include/asm/module.h
index 451444538a1b..3f083d385a64 100644
--- a/arch/avr32/include/asm/module.h
+++ b/arch/avr32/include/asm/module.h
@@ -1,6 +1,8 @@
1#ifndef __ASM_AVR32_MODULE_H 1#ifndef __ASM_AVR32_MODULE_H
2#define __ASM_AVR32_MODULE_H 2#define __ASM_AVR32_MODULE_H
3 3
4#include <asm-generic/module.h>
5
4struct mod_arch_syminfo { 6struct mod_arch_syminfo {
5 unsigned long got_offset; 7 unsigned long got_offset;
6 int got_initialized; 8 int got_initialized;
@@ -17,10 +19,6 @@ struct mod_arch_specific {
17 struct mod_arch_syminfo *syminfo; 19 struct mod_arch_syminfo *syminfo;
18}; 20};
19 21
20#define Elf_Shdr Elf32_Shdr
21#define Elf_Sym Elf32_Sym
22#define Elf_Ehdr Elf32_Ehdr
23
24#define MODULE_PROC_FAMILY "AVR32v1" 22#define MODULE_PROC_FAMILY "AVR32v1"
25 23
26#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY 24#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index ccd9193932b2..b6f3ad5441c5 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -43,6 +43,8 @@ config BLACKFIN
43 select HAVE_NMI_WATCHDOG if NMI_WATCHDOG 43 select HAVE_NMI_WATCHDOG if NMI_WATCHDOG
44 select GENERIC_SMP_IDLE_THREAD 44 select GENERIC_SMP_IDLE_THREAD
45 select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS 45 select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS
46 select HAVE_MOD_ARCH_SPECIFIC
47 select MODULES_USE_ELF_RELA
46 48
47config GENERIC_CSUM 49config GENERIC_CSUM
48 def_bool y 50 def_bool y
diff --git a/arch/blackfin/include/asm/module.h b/arch/blackfin/include/asm/module.h
index ed5689b82c9f..231a149b3f77 100644
--- a/arch/blackfin/include/asm/module.h
+++ b/arch/blackfin/include/asm/module.h
@@ -7,9 +7,7 @@
7#ifndef _ASM_BFIN_MODULE_H 7#ifndef _ASM_BFIN_MODULE_H
8#define _ASM_BFIN_MODULE_H 8#define _ASM_BFIN_MODULE_H
9 9
10#define Elf_Shdr Elf32_Shdr 10#include <asm-generic/module.h>
11#define Elf_Sym Elf32_Sym
12#define Elf_Ehdr Elf32_Ehdr
13 11
14struct mod_arch_specific { 12struct mod_arch_specific {
15 Elf_Shdr *text_l1; 13 Elf_Shdr *text_l1;
diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig
index 45268b50c0c8..aee1b569ee6e 100644
--- a/arch/c6x/Kconfig
+++ b/arch/c6x/Kconfig
@@ -18,6 +18,7 @@ config C6X
18 select OF_EARLY_FLATTREE 18 select OF_EARLY_FLATTREE
19 select GENERIC_CLOCKEVENTS 19 select GENERIC_CLOCKEVENTS
20 select GENERIC_KERNEL_THREAD 20 select GENERIC_KERNEL_THREAD
21 select MODULES_USE_ELF_RELA
21 22
22config MMU 23config MMU
23 def_bool n 24 def_bool n
diff --git a/arch/c6x/include/asm/module.h b/arch/c6x/include/asm/module.h
index a453f9744f42..5c7269c7ef73 100644
--- a/arch/c6x/include/asm/module.h
+++ b/arch/c6x/include/asm/module.h
@@ -13,17 +13,7 @@
13#ifndef _ASM_C6X_MODULE_H 13#ifndef _ASM_C6X_MODULE_H
14#define _ASM_C6X_MODULE_H 14#define _ASM_C6X_MODULE_H
15 15
16#define Elf_Shdr Elf32_Shdr 16#include <asm-generic/module.h>
17#define Elf_Sym Elf32_Sym
18#define Elf_Ehdr Elf32_Ehdr
19#define Elf_Addr Elf32_Addr
20#define Elf_Word Elf32_Word
21
22/*
23 * This file contains the C6x architecture specific module code.
24 */
25struct mod_arch_specific {
26};
27 17
28struct loaded_sections { 18struct loaded_sections {
29 unsigned int new_vaddr; 19 unsigned int new_vaddr;
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index a118163b04ee..a67244473a39 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -48,6 +48,7 @@ config CRIS
48 select GENERIC_IOMAP 48 select GENERIC_IOMAP
49 select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32 49 select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32
50 select GENERIC_CMOS_UPDATE 50 select GENERIC_CMOS_UPDATE
51 select MODULES_USE_ELF_RELA
51 52
52config HZ 53config HZ
53 int 54 int
diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild
index ff1bf7fcae8e..6d43a951b5ec 100644
--- a/arch/cris/include/asm/Kbuild
+++ b/arch/cris/include/asm/Kbuild
@@ -10,3 +10,4 @@ header-y += sync_serial.h
10 10
11generic-y += clkdev.h 11generic-y += clkdev.h
12generic-y += exec.h 12generic-y += exec.h
13generic-y += module.h
diff --git a/arch/cris/include/asm/module.h b/arch/cris/include/asm/module.h
deleted file mode 100644
index 7ee72311bd78..000000000000
--- a/arch/cris/include/asm/module.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ASM_CRIS_MODULE_H
2#define _ASM_CRIS_MODULE_H
3/* cris is simple */
4struct mod_arch_specific { };
5
6#define Elf_Shdr Elf32_Shdr
7#define Elf_Sym Elf32_Sym
8#define Elf_Ehdr Elf32_Ehdr
9#endif /* _ASM_CRIS_MODULE_H */
diff --git a/arch/frv/include/asm/module.h b/arch/frv/include/asm/module.h
index 3d5c6360289a..a8848f09a217 100644
--- a/arch/frv/include/asm/module.h
+++ b/arch/frv/include/asm/module.h
@@ -11,13 +11,7 @@
11#ifndef _ASM_MODULE_H 11#ifndef _ASM_MODULE_H
12#define _ASM_MODULE_H 12#define _ASM_MODULE_H
13 13
14struct mod_arch_specific 14#include <asm-generic/module.h>
15{
16};
17
18#define Elf_Shdr Elf32_Shdr
19#define Elf_Sym Elf32_Sym
20#define Elf_Ehdr Elf32_Ehdr
21 15
22/* 16/*
23 * Include the architecture version. 17 * Include the architecture version.
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 90462eb23d02..98fabd10e95f 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -7,6 +7,7 @@ config H8300
7 select ARCH_WANT_IPC_PARSE_VERSION 7 select ARCH_WANT_IPC_PARSE_VERSION
8 select GENERIC_IRQ_SHOW 8 select GENERIC_IRQ_SHOW
9 select GENERIC_CPU_DEVICES 9 select GENERIC_CPU_DEVICES
10 select MODULES_USE_ELF_RELA
10 11
11config SYMBOL_PREFIX 12config SYMBOL_PREFIX
12 string 13 string
diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild
index fccd81eddff1..50bbf387b2f8 100644
--- a/arch/h8300/include/asm/Kbuild
+++ b/arch/h8300/include/asm/Kbuild
@@ -2,3 +2,4 @@ include include/asm-generic/Kbuild.asm
2 2
3generic-y += clkdev.h 3generic-y += clkdev.h
4generic-y += exec.h 4generic-y += exec.h
5generic-y += module.h
diff --git a/arch/h8300/include/asm/module.h b/arch/h8300/include/asm/module.h
deleted file mode 100644
index 8e46724b7c09..000000000000
--- a/arch/h8300/include/asm/module.h
+++ /dev/null
@@ -1,11 +0,0 @@
1#ifndef _ASM_H8300_MODULE_H
2#define _ASM_H8300_MODULE_H
3/*
4 * This file contains the H8/300 architecture specific module code.
5 */
6struct mod_arch_specific { };
7#define Elf_Shdr Elf32_Shdr
8#define Elf_Sym Elf32_Sym
9#define Elf_Ehdr Elf32_Ehdr
10
11#endif /* _ASM_H8/300_MODULE_H */
diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig
index b2fdfb700f50..0744f7d7b1fd 100644
--- a/arch/hexagon/Kconfig
+++ b/arch/hexagon/Kconfig
@@ -30,6 +30,7 @@ config HEXAGON
30 select KTIME_SCALAR 30 select KTIME_SCALAR
31 select GENERIC_CLOCKEVENTS 31 select GENERIC_CLOCKEVENTS
32 select GENERIC_CLOCKEVENTS_BROADCAST 32 select GENERIC_CLOCKEVENTS_BROADCAST
33 select MODULES_USE_ELF_RELA
33 ---help--- 34 ---help---
34 Qualcomm Hexagon is a processor architecture designed for high 35 Qualcomm Hexagon is a processor architecture designed for high
35 performance and low power across a wide variety of applications. 36 performance and low power across a wide variety of applications.
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 4c10e607c908..3279646120e3 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -40,6 +40,8 @@ config IA64
40 select ARCH_THREAD_INFO_ALLOCATOR 40 select ARCH_THREAD_INFO_ALLOCATOR
41 select ARCH_CLOCKSOURCE_DATA 41 select ARCH_CLOCKSOURCE_DATA
42 select GENERIC_TIME_VSYSCALL_OLD 42 select GENERIC_TIME_VSYSCALL_OLD
43 select HAVE_MOD_ARCH_SPECIFIC
44 select MODULES_USE_ELF_RELA
43 default y 45 default y
44 help 46 help
45 The Itanium Processor Family is Intel's 64-bit successor to 47 The Itanium Processor Family is Intel's 64-bit successor to
diff --git a/arch/ia64/include/asm/module.h b/arch/ia64/include/asm/module.h
index 908eaef42a08..dfba22a872c3 100644
--- a/arch/ia64/include/asm/module.h
+++ b/arch/ia64/include/asm/module.h
@@ -1,6 +1,8 @@
1#ifndef _ASM_IA64_MODULE_H 1#ifndef _ASM_IA64_MODULE_H
2#define _ASM_IA64_MODULE_H 2#define _ASM_IA64_MODULE_H
3 3
4#include <asm-generic/module.h>
5
4/* 6/*
5 * IA-64-specific support for kernel module loader. 7 * IA-64-specific support for kernel module loader.
6 * 8 *
@@ -29,10 +31,6 @@ struct mod_arch_specific {
29 unsigned int next_got_entry; /* index of next available got entry */ 31 unsigned int next_got_entry; /* index of next available got entry */
30}; 32};
31 33
32#define Elf_Shdr Elf64_Shdr
33#define Elf_Sym Elf64_Sym
34#define Elf_Ehdr Elf64_Ehdr
35
36#define MODULE_PROC_FAMILY "ia64" 34#define MODULE_PROC_FAMILY "ia64"
37#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY \ 35#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY \
38 "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__) 36 "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__)
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index e875fc3ce9cb..f807721e19a5 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -14,6 +14,7 @@ config M32R
14 select GENERIC_IRQ_SHOW 14 select GENERIC_IRQ_SHOW
15 select GENERIC_ATOMIC64 15 select GENERIC_ATOMIC64
16 select ARCH_USES_GETTIMEOFFSET 16 select ARCH_USES_GETTIMEOFFSET
17 select MODULES_USE_ELF_RELA
17 18
18config SBUS 19config SBUS
19 bool 20 bool
diff --git a/arch/m32r/include/asm/Kbuild b/arch/m32r/include/asm/Kbuild
index fccd81eddff1..50bbf387b2f8 100644
--- a/arch/m32r/include/asm/Kbuild
+++ b/arch/m32r/include/asm/Kbuild
@@ -2,3 +2,4 @@ include include/asm-generic/Kbuild.asm
2 2
3generic-y += clkdev.h 3generic-y += clkdev.h
4generic-y += exec.h 4generic-y += exec.h
5generic-y += module.h
diff --git a/arch/m32r/include/asm/module.h b/arch/m32r/include/asm/module.h
deleted file mode 100644
index eb73ee011215..000000000000
--- a/arch/m32r/include/asm/module.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef _ASM_M32R_MODULE_H
2#define _ASM_M32R_MODULE_H
3
4struct mod_arch_specific { };
5
6#define Elf_Shdr Elf32_Shdr
7#define Elf_Sym Elf32_Sym
8#define Elf_Ehdr Elf32_Ehdr
9
10#endif /* _ASM_M32R_MODULE_H */
diff --git a/arch/m32r/kernel/module.c b/arch/m32r/kernel/module.c
index 3071fe83ffc8..38233b6596b6 100644
--- a/arch/m32r/kernel/module.c
+++ b/arch/m32r/kernel/module.c
@@ -201,18 +201,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
201 } 201 }
202 return 0; 202 return 0;
203} 203}
204
205int apply_relocate(Elf32_Shdr *sechdrs,
206 const char *strtab,
207 unsigned int symindex,
208 unsigned int relsec,
209 struct module *me)
210{
211#if 0
212 printk(KERN_ERR "module %s: REL RELOCATION unsupported\n",
213 me->name);
214 return -ENOEXEC;
215#endif
216 return 0;
217
218}
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 76fd6e2f71da..e7c161433eae 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -16,6 +16,9 @@ config M68K
16 select ARCH_WANT_IPC_PARSE_VERSION 16 select ARCH_WANT_IPC_PARSE_VERSION
17 select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE 17 select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE
18 select GENERIC_KERNEL_THREAD 18 select GENERIC_KERNEL_THREAD
19 select HAVE_MOD_ARCH_SPECIFIC
20 select MODULES_USE_ELF_REL
21 select MODULES_USE_ELF_RELA
19 22
20config RWSEM_GENERIC_SPINLOCK 23config RWSEM_GENERIC_SPINLOCK
21 bool 24 bool
diff --git a/arch/m68k/include/asm/module.h b/arch/m68k/include/asm/module.h
index edffe66b7f49..8b58fce843dd 100644
--- a/arch/m68k/include/asm/module.h
+++ b/arch/m68k/include/asm/module.h
@@ -1,6 +1,8 @@
1#ifndef _ASM_M68K_MODULE_H 1#ifndef _ASM_M68K_MODULE_H
2#define _ASM_M68K_MODULE_H 2#define _ASM_M68K_MODULE_H
3 3
4#include <asm-generic/module.h>
5
4enum m68k_fixup_type { 6enum m68k_fixup_type {
5 m68k_fixup_memoffset, 7 m68k_fixup_memoffset,
6 m68k_fixup_vnode_shift, 8 m68k_fixup_vnode_shift,
@@ -36,8 +38,4 @@ struct module;
36extern void module_fixup(struct module *mod, struct m68k_fixup_info *start, 38extern void module_fixup(struct module *mod, struct m68k_fixup_info *start,
37 struct m68k_fixup_info *end); 39 struct m68k_fixup_info *end);
38 40
39#define Elf_Shdr Elf32_Shdr
40#define Elf_Sym Elf32_Sym
41#define Elf_Ehdr Elf32_Ehdr
42
43#endif /* _ASM_M68K_MODULE_H */ 41#endif /* _ASM_M68K_MODULE_H */
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 53fd94ab60f0..4cba7439f9de 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -25,6 +25,7 @@ config MICROBLAZE
25 select GENERIC_CPU_DEVICES 25 select GENERIC_CPU_DEVICES
26 select GENERIC_ATOMIC64 26 select GENERIC_ATOMIC64
27 select GENERIC_CLOCKEVENTS 27 select GENERIC_CLOCKEVENTS
28 select MODULES_USE_ELF_RELA
28 29
29config SWAP 30config SWAP
30 def_bool n 31 def_bool n
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 35453eaeffb5..dba9390d37cf 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -37,6 +37,9 @@ config MIPS
37 select BUILDTIME_EXTABLE_SORT 37 select BUILDTIME_EXTABLE_SORT
38 select GENERIC_CLOCKEVENTS 38 select GENERIC_CLOCKEVENTS
39 select GENERIC_CMOS_UPDATE 39 select GENERIC_CMOS_UPDATE
40 select HAVE_MOD_ARCH_SPECIFIC
41 select MODULES_USE_ELF_REL
42 select MODULES_USE_ELF_RELA if 64BIT
40 43
41menu "Machine selection" 44menu "Machine selection"
42 45
@@ -1928,6 +1931,7 @@ config MIPS_MT_SMP
1928 select SYS_SUPPORTS_SCHED_SMT if SMP 1931 select SYS_SUPPORTS_SCHED_SMT if SMP
1929 select SYS_SUPPORTS_SMP 1932 select SYS_SUPPORTS_SMP
1930 select SMP_UP 1933 select SMP_UP
1934 select MIPS_PERF_SHARED_TC_COUNTERS
1931 help 1935 help
1932 This is a kernel model which is known a VSMP but lately has been 1936 This is a kernel model which is known a VSMP but lately has been
1933 marketesed into SMVP. 1937 marketesed into SMVP.
@@ -2038,16 +2042,6 @@ config MIPS_VPE_APSP_API
2038 depends on MIPS_VPE_LOADER 2042 depends on MIPS_VPE_LOADER
2039 help 2043 help
2040 2044
2041config MIPS_APSP_KSPD
2042 bool "Enable KSPD"
2043 depends on MIPS_VPE_APSP_API
2044 default y
2045 help
2046 KSPD is a kernel daemon that accepts syscall requests from the SP
2047 side, actions them and returns the results. It also handles the
2048 "exit" syscall notifying other kernel modules the SP program is
2049 exiting. You probably want to say yes here.
2050
2051config MIPS_CMP 2045config MIPS_CMP
2052 bool "MIPS CMP framework support" 2046 bool "MIPS CMP framework support"
2053 depends on SYS_SUPPORTS_MIPS_CMP 2047 depends on SYS_SUPPORTS_MIPS_CMP
@@ -2277,6 +2271,9 @@ config NR_CPUS
2277 performance should round up your number of processors to the next 2271 performance should round up your number of processors to the next
2278 power of two. 2272 power of two.
2279 2273
2274config MIPS_PERF_SHARED_TC_COUNTERS
2275 bool
2276
2280# 2277#
2281# Timer Interrupt Frequency Configuration 2278# Timer Interrupt Frequency Configuration
2282# 2279#
diff --git a/arch/mips/alchemy/Kconfig b/arch/mips/alchemy/Kconfig
index 0faaab24376e..c8862bdc2ff2 100644
--- a/arch/mips/alchemy/Kconfig
+++ b/arch/mips/alchemy/Kconfig
@@ -27,7 +27,7 @@ config MIPS_MTX1
27 select SYS_HAS_EARLY_PRINTK 27 select SYS_HAS_EARLY_PRINTK
28 28
29config MIPS_DB1000 29config MIPS_DB1000
30 bool "Alchemy DB1000/DB1500/DB1100 boards" 30 bool "Alchemy DB1000/DB1500/DB1100 PB1500/1100 boards"
31 select ALCHEMY_GPIOINT_AU1000 31 select ALCHEMY_GPIOINT_AU1000
32 select DMA_NONCOHERENT 32 select DMA_NONCOHERENT
33 select HW_HAS_PCI 33 select HW_HAS_PCI
@@ -36,57 +36,15 @@ config MIPS_DB1000
36 select SYS_SUPPORTS_LITTLE_ENDIAN 36 select SYS_SUPPORTS_LITTLE_ENDIAN
37 select SYS_HAS_EARLY_PRINTK 37 select SYS_HAS_EARLY_PRINTK
38 38
39config MIPS_DB1200 39config MIPS_DB1235
40 bool "Alchemy DB1200/PB1200 board" 40 bool "Alchemy DB1200/PB1200/DB1300/DB1550/PB1550 boards"
41 select ALCHEMY_GPIOINT_AU1000 41 select ARCH_REQUIRE_GPIOLIB
42 select DMA_COHERENT
43 select MIPS_DISABLE_OBSOLETE_IDE
44 select SYS_SUPPORTS_LITTLE_ENDIAN
45 select SYS_HAS_EARLY_PRINTK
46
47config MIPS_DB1300
48 bool "NetLogic DB1300 board"
49 select ALCHEMY_GPIOINT_AU1300
50 select DMA_COHERENT
51 select MIPS_DISABLE_OBSOLETE_IDE
52 select SYS_SUPPORTS_LITTLE_ENDIAN
53 select SYS_HAS_EARLY_PRINTK
54
55config MIPS_DB1550
56 bool "Alchemy DB1550 board"
57 select ALCHEMY_GPIOINT_AU1000
58 select HW_HAS_PCI 42 select HW_HAS_PCI
59 select DMA_COHERENT 43 select DMA_COHERENT
60 select MIPS_DISABLE_OBSOLETE_IDE 44 select MIPS_DISABLE_OBSOLETE_IDE
61 select SYS_SUPPORTS_LITTLE_ENDIAN 45 select SYS_SUPPORTS_LITTLE_ENDIAN
62 select SYS_HAS_EARLY_PRINTK 46 select SYS_HAS_EARLY_PRINTK
63 47
64config MIPS_PB1100
65 bool "Alchemy PB1100 board"
66 select ALCHEMY_GPIOINT_AU1000
67 select DMA_NONCOHERENT
68 select HW_HAS_PCI
69 select SWAP_IO_SPACE
70 select SYS_SUPPORTS_LITTLE_ENDIAN
71 select SYS_HAS_EARLY_PRINTK
72
73config MIPS_PB1500
74 bool "Alchemy PB1500 board"
75 select ALCHEMY_GPIOINT_AU1000
76 select DMA_NONCOHERENT
77 select HW_HAS_PCI
78 select SYS_SUPPORTS_LITTLE_ENDIAN
79 select SYS_HAS_EARLY_PRINTK
80
81config MIPS_PB1550
82 bool "Alchemy PB1550 board"
83 select ALCHEMY_GPIOINT_AU1000
84 select DMA_NONCOHERENT
85 select HW_HAS_PCI
86 select MIPS_DISABLE_OBSOLETE_IDE
87 select SYS_SUPPORTS_LITTLE_ENDIAN
88 select SYS_HAS_EARLY_PRINTK
89
90config MIPS_XXS1500 48config MIPS_XXS1500
91 bool "MyCable XXS1500 board" 49 bool "MyCable XXS1500 board"
92 select DMA_NONCOHERENT 50 select DMA_NONCOHERENT
diff --git a/arch/mips/alchemy/Platform b/arch/mips/alchemy/Platform
index 7956274de15f..942c5800a684 100644
--- a/arch/mips/alchemy/Platform
+++ b/arch/mips/alchemy/Platform
@@ -30,25 +30,11 @@ cflags-$(CONFIG_MIPS_DB1000) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
30load-$(CONFIG_MIPS_DB1000) += 0xffffffff80100000 30load-$(CONFIG_MIPS_DB1000) += 0xffffffff80100000
31 31
32# 32#
33# AMD Alchemy Db1550 eval board 33# AMD Alchemy Db1200/Pb1200/Db1550/Db1300 eval boards
34# 34#
35platform-$(CONFIG_MIPS_DB1550) += alchemy/devboards/ 35platform-$(CONFIG_MIPS_DB1235) += alchemy/devboards/
36cflags-$(CONFIG_MIPS_DB1550) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 36cflags-$(CONFIG_MIPS_DB1235) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
37load-$(CONFIG_MIPS_DB1550) += 0xffffffff80100000 37load-$(CONFIG_MIPS_DB1235) += 0xffffffff80100000
38
39#
40# AMD Alchemy Db1200/Pb1200 eval boards
41#
42platform-$(CONFIG_MIPS_DB1200) += alchemy/devboards/
43cflags-$(CONFIG_MIPS_DB1200) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
44load-$(CONFIG_MIPS_DB1200) += 0xffffffff80100000
45
46#
47# NetLogic DBAu1300 development platform
48#
49platform-$(CONFIG_MIPS_DB1300) += alchemy/devboards/
50cflags-$(CONFIG_MIPS_DB1300) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
51load-$(CONFIG_MIPS_DB1300) += 0xffffffff80100000
52 38
53# 39#
54# 4G-Systems MTX-1 "MeshCube" wireless router 40# 4G-Systems MTX-1 "MeshCube" wireless router
diff --git a/arch/mips/alchemy/devboards/Makefile b/arch/mips/alchemy/devboards/Makefile
index c9e747dd9fc2..15bf7306648b 100644
--- a/arch/mips/alchemy/devboards/Makefile
+++ b/arch/mips/alchemy/devboards/Makefile
@@ -4,10 +4,5 @@
4 4
5obj-y += bcsr.o platform.o 5obj-y += bcsr.o platform.o
6obj-$(CONFIG_PM) += pm.o 6obj-$(CONFIG_PM) += pm.o
7obj-$(CONFIG_MIPS_PB1100) += pb1100.o
8obj-$(CONFIG_MIPS_PB1500) += pb1500.o
9obj-$(CONFIG_MIPS_PB1550) += pb1550.o
10obj-$(CONFIG_MIPS_DB1000) += db1000.o 7obj-$(CONFIG_MIPS_DB1000) += db1000.o
11obj-$(CONFIG_MIPS_DB1200) += db1200.o 8obj-$(CONFIG_MIPS_DB1235) += db1235.o db1200.o db1300.o db1550.o
12obj-$(CONFIG_MIPS_DB1300) += db1300.o
13obj-$(CONFIG_MIPS_DB1550) += db1550.o
diff --git a/arch/mips/alchemy/devboards/db1000.c b/arch/mips/alchemy/devboards/db1000.c
index 1b81dbf6b804..8187845650f7 100644
--- a/arch/mips/alchemy/devboards/db1000.c
+++ b/arch/mips/alchemy/devboards/db1000.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * DBAu1000/1500/1100 board support 2 * DBAu1000/1500/1100 PBAu1100/1500 board support
3 * 3 *
4 * Copyright 2000, 2008 MontaVista Software Inc. 4 * Copyright 2000, 2008 MontaVista Software Inc.
5 * Author: MontaVista Software, Inc. <source@mvista.com> 5 * Author: MontaVista Software, Inc. <source@mvista.com>
@@ -52,6 +52,11 @@ static const char *board_type_str(void)
52 return "DB1500"; 52 return "DB1500";
53 case BCSR_WHOAMI_DB1100: 53 case BCSR_WHOAMI_DB1100:
54 return "DB1100"; 54 return "DB1100";
55 case BCSR_WHOAMI_PB1500:
56 case BCSR_WHOAMI_PB1500R2:
57 return "PB1500";
58 case BCSR_WHOAMI_PB1100:
59 return "PB1100";
55 default: 60 default:
56 return "(unknown)"; 61 return "(unknown)";
57 } 62 }
@@ -111,7 +116,9 @@ static struct platform_device db1500_pci_host_dev = {
111 116
112static int __init db1500_pci_init(void) 117static int __init db1500_pci_init(void)
113{ 118{
114 if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1500) 119 int id = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
120 if ((id == BCSR_WHOAMI_DB1500) || (id == BCSR_WHOAMI_PB1500) ||
121 (id == BCSR_WHOAMI_PB1500R2))
115 return platform_device_register(&db1500_pci_host_dev); 122 return platform_device_register(&db1500_pci_host_dev);
116 return 0; 123 return 0;
117} 124}
@@ -199,27 +206,37 @@ static irqreturn_t db1100_mmc_cd(int irq, void *ptr)
199 206
200static int db1100_mmc_cd_setup(void *mmc_host, int en) 207static int db1100_mmc_cd_setup(void *mmc_host, int en)
201{ 208{
202 int ret = 0; 209 int ret = 0, irq;
210
211 if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
212 irq = AU1100_GPIO19_INT;
213 else
214 irq = AU1100_GPIO14_INT; /* PB1100 SD0 CD# */
203 215
204 if (en) { 216 if (en) {
205 irq_set_irq_type(AU1100_GPIO19_INT, IRQ_TYPE_EDGE_BOTH); 217 irq_set_irq_type(irq, IRQ_TYPE_EDGE_BOTH);
206 ret = request_irq(AU1100_GPIO19_INT, db1100_mmc_cd, 0, 218 ret = request_irq(irq, db1100_mmc_cd, 0,
207 "sd0_cd", mmc_host); 219 "sd0_cd", mmc_host);
208 } else 220 } else
209 free_irq(AU1100_GPIO19_INT, mmc_host); 221 free_irq(irq, mmc_host);
210 return ret; 222 return ret;
211} 223}
212 224
213static int db1100_mmc1_cd_setup(void *mmc_host, int en) 225static int db1100_mmc1_cd_setup(void *mmc_host, int en)
214{ 226{
215 int ret = 0; 227 int ret = 0, irq;
228
229 if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
230 irq = AU1100_GPIO20_INT;
231 else
232 irq = AU1100_GPIO15_INT; /* PB1100 SD1 CD# */
216 233
217 if (en) { 234 if (en) {
218 irq_set_irq_type(AU1100_GPIO20_INT, IRQ_TYPE_EDGE_BOTH); 235 irq_set_irq_type(irq, IRQ_TYPE_EDGE_BOTH);
219 ret = request_irq(AU1100_GPIO20_INT, db1100_mmc_cd, 0, 236 ret = request_irq(irq, db1100_mmc_cd, 0,
220 "sd1_cd", mmc_host); 237 "sd1_cd", mmc_host);
221 } else 238 } else
222 free_irq(AU1100_GPIO20_INT, mmc_host); 239 free_irq(irq, mmc_host);
223 return ret; 240 return ret;
224} 241}
225 242
@@ -236,11 +253,18 @@ static int db1100_mmc_card_inserted(void *mmc_host)
236 253
237static void db1100_mmc_set_power(void *mmc_host, int state) 254static void db1100_mmc_set_power(void *mmc_host, int state)
238{ 255{
256 int bit;
257
258 if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
259 bit = BCSR_BOARD_SD0PWR;
260 else
261 bit = BCSR_BOARD_PB1100_SD0PWR;
262
239 if (state) { 263 if (state) {
240 bcsr_mod(BCSR_BOARD, 0, BCSR_BOARD_SD0PWR); 264 bcsr_mod(BCSR_BOARD, 0, bit);
241 msleep(400); /* stabilization time */ 265 msleep(400); /* stabilization time */
242 } else 266 } else
243 bcsr_mod(BCSR_BOARD, BCSR_BOARD_SD0PWR, 0); 267 bcsr_mod(BCSR_BOARD, bit, 0);
244} 268}
245 269
246static void db1100_mmcled_set(struct led_classdev *led, enum led_brightness b) 270static void db1100_mmcled_set(struct led_classdev *led, enum led_brightness b)
@@ -267,11 +291,18 @@ static int db1100_mmc1_card_inserted(void *mmc_host)
267 291
268static void db1100_mmc1_set_power(void *mmc_host, int state) 292static void db1100_mmc1_set_power(void *mmc_host, int state)
269{ 293{
294 int bit;
295
296 if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
297 bit = BCSR_BOARD_SD1PWR;
298 else
299 bit = BCSR_BOARD_PB1100_SD1PWR;
300
270 if (state) { 301 if (state) {
271 bcsr_mod(BCSR_BOARD, 0, BCSR_BOARD_SD1PWR); 302 bcsr_mod(BCSR_BOARD, 0, bit);
272 msleep(400); /* stabilization time */ 303 msleep(400); /* stabilization time */
273 } else 304 } else
274 bcsr_mod(BCSR_BOARD, BCSR_BOARD_SD1PWR, 0); 305 bcsr_mod(BCSR_BOARD, bit, 0);
275} 306}
276 307
277static void db1100_mmc1led_set(struct led_classdev *led, enum led_brightness b) 308static void db1100_mmc1led_set(struct led_classdev *led, enum led_brightness b)
@@ -480,13 +511,12 @@ static struct platform_device *db1100_devs[] = {
480 &db1100_mmc0_dev, 511 &db1100_mmc0_dev,
481 &db1100_mmc1_dev, 512 &db1100_mmc1_dev,
482 &db1000_irda_dev, 513 &db1000_irda_dev,
483 &db1100_spi_dev,
484}; 514};
485 515
486static int __init db1000_dev_init(void) 516static int __init db1000_dev_init(void)
487{ 517{
488 int board = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)); 518 int board = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
489 int c0, c1, d0, d1, s0, s1; 519 int c0, c1, d0, d1, s0, s1, flashsize = 32, twosocks = 1;
490 unsigned long pfc; 520 unsigned long pfc;
491 521
492 if (board == BCSR_WHOAMI_DB1500) { 522 if (board == BCSR_WHOAMI_DB1500) {
@@ -522,6 +552,7 @@ static int __init db1000_dev_init(void)
522 ARRAY_SIZE(db1100_spi_info)); 552 ARRAY_SIZE(db1100_spi_info));
523 553
524 platform_add_devices(db1100_devs, ARRAY_SIZE(db1100_devs)); 554 platform_add_devices(db1100_devs, ARRAY_SIZE(db1100_devs));
555 platform_device_register(&db1100_spi_dev);
525 } else if (board == BCSR_WHOAMI_DB1000) { 556 } else if (board == BCSR_WHOAMI_DB1000) {
526 c0 = AU1000_GPIO2_INT; 557 c0 = AU1000_GPIO2_INT;
527 c1 = AU1000_GPIO5_INT; 558 c1 = AU1000_GPIO5_INT;
@@ -530,15 +561,42 @@ static int __init db1000_dev_init(void)
530 s0 = AU1000_GPIO1_INT; 561 s0 = AU1000_GPIO1_INT;
531 s1 = AU1000_GPIO4_INT; 562 s1 = AU1000_GPIO4_INT;
532 platform_add_devices(db1000_devs, ARRAY_SIZE(db1000_devs)); 563 platform_add_devices(db1000_devs, ARRAY_SIZE(db1000_devs));
564 } else if ((board == BCSR_WHOAMI_PB1500) ||
565 (board == BCSR_WHOAMI_PB1500R2)) {
566 c0 = AU1500_GPIO203_INT;
567 d0 = AU1500_GPIO201_INT;
568 s0 = AU1500_GPIO202_INT;
569 twosocks = 0;
570 flashsize = 64;
571 /* RTC and daughtercard irqs */
572 irq_set_irq_type(AU1500_GPIO204_INT, IRQ_TYPE_LEVEL_LOW);
573 irq_set_irq_type(AU1500_GPIO205_INT, IRQ_TYPE_LEVEL_LOW);
574 /* EPSON S1D13806 0x1b000000
575 * SRAM 1MB/2MB 0x1a000000
576 * DS1693 RTC 0x0c000000
577 */
578 } else if (board == BCSR_WHOAMI_PB1100) {
579 c0 = AU1100_GPIO11_INT;
580 d0 = AU1100_GPIO9_INT;
581 s0 = AU1100_GPIO10_INT;
582 twosocks = 0;
583 flashsize = 64;
584 /* pendown, rtc, daughtercard irqs */
585 irq_set_irq_type(AU1100_GPIO8_INT, IRQ_TYPE_LEVEL_LOW);
586 irq_set_irq_type(AU1100_GPIO12_INT, IRQ_TYPE_LEVEL_LOW);
587 irq_set_irq_type(AU1100_GPIO13_INT, IRQ_TYPE_LEVEL_LOW);
588 /* EPSON S1D13806 0x1b000000
589 * SRAM 1MB/2MB 0x1a000000
590 * DiskOnChip 0x0d000000
591 * DS1693 RTC 0x0c000000
592 */
593 platform_add_devices(db1100_devs, ARRAY_SIZE(db1100_devs));
533 } else 594 } else
534 return 0; /* unknown board, no further dev setup to do */ 595 return 0; /* unknown board, no further dev setup to do */
535 596
536 irq_set_irq_type(d0, IRQ_TYPE_EDGE_BOTH); 597 irq_set_irq_type(d0, IRQ_TYPE_EDGE_BOTH);
537 irq_set_irq_type(d1, IRQ_TYPE_EDGE_BOTH);
538 irq_set_irq_type(c0, IRQ_TYPE_LEVEL_LOW); 598 irq_set_irq_type(c0, IRQ_TYPE_LEVEL_LOW);
539 irq_set_irq_type(c1, IRQ_TYPE_LEVEL_LOW);
540 irq_set_irq_type(s0, IRQ_TYPE_LEVEL_LOW); 599 irq_set_irq_type(s0, IRQ_TYPE_LEVEL_LOW);
541 irq_set_irq_type(s1, IRQ_TYPE_LEVEL_LOW);
542 600
543 db1x_register_pcmcia_socket( 601 db1x_register_pcmcia_socket(
544 AU1000_PCMCIA_ATTR_PHYS_ADDR, 602 AU1000_PCMCIA_ATTR_PHYS_ADDR,
@@ -549,17 +607,23 @@ static int __init db1000_dev_init(void)
549 AU1000_PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1, 607 AU1000_PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1,
550 c0, d0, /*s0*/0, 0, 0); 608 c0, d0, /*s0*/0, 0, 0);
551 609
552 db1x_register_pcmcia_socket( 610 if (twosocks) {
553 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004000000, 611 irq_set_irq_type(d1, IRQ_TYPE_EDGE_BOTH);
554 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1, 612 irq_set_irq_type(c1, IRQ_TYPE_LEVEL_LOW);
555 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x004000000, 613 irq_set_irq_type(s1, IRQ_TYPE_LEVEL_LOW);
556 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x004400000 - 1, 614
557 AU1000_PCMCIA_IO_PHYS_ADDR + 0x004000000, 615 db1x_register_pcmcia_socket(
558 AU1000_PCMCIA_IO_PHYS_ADDR + 0x004010000 - 1, 616 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004000000,
559 c1, d1, /*s1*/0, 0, 1); 617 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1,
618 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x004000000,
619 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x004400000 - 1,
620 AU1000_PCMCIA_IO_PHYS_ADDR + 0x004000000,
621 AU1000_PCMCIA_IO_PHYS_ADDR + 0x004010000 - 1,
622 c1, d1, /*s1*/0, 0, 1);
623 }
560 624
561 platform_add_devices(db1x00_devs, ARRAY_SIZE(db1x00_devs)); 625 platform_add_devices(db1x00_devs, ARRAY_SIZE(db1x00_devs));
562 db1x_register_norflash(32 << 20, 4 /* 32bit */, F_SWAPPED); 626 db1x_register_norflash(flashsize << 20, 4 /* 32bit */, F_SWAPPED);
563 return 0; 627 return 0;
564} 628}
565device_initcall(db1000_dev_init); 629device_initcall(db1000_dev_init);
diff --git a/arch/mips/alchemy/devboards/db1200.c b/arch/mips/alchemy/devboards/db1200.c
index bf2248474fa8..299b7d202bea 100644
--- a/arch/mips/alchemy/devboards/db1200.c
+++ b/arch/mips/alchemy/devboards/db1200.c
@@ -45,25 +45,9 @@
45 45
46#include "platform.h" 46#include "platform.h"
47 47
48static const char *board_type_str(void) 48const char *get_system_type(void);
49{
50 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
51 case BCSR_WHOAMI_PB1200_DDR1:
52 case BCSR_WHOAMI_PB1200_DDR2:
53 return "PB1200";
54 case BCSR_WHOAMI_DB1200:
55 return "DB1200";
56 default:
57 return "(unknown)";
58 }
59}
60 49
61const char *get_system_type(void) 50static int __init db1200_detect_board(void)
62{
63 return board_type_str();
64}
65
66static int __init detect_board(void)
67{ 51{
68 int bid; 52 int bid;
69 53
@@ -96,19 +80,17 @@ static int __init detect_board(void)
96 return 1; /* it's neither */ 80 return 1; /* it's neither */
97} 81}
98 82
99void __init board_setup(void) 83int __init db1200_board_setup(void)
100{ 84{
101 unsigned long freq0, clksrc, div, pfc; 85 unsigned long freq0, clksrc, div, pfc;
102 unsigned short whoami; 86 unsigned short whoami;
103 87
104 if (detect_board()) { 88 if (db1200_detect_board())
105 printk(KERN_ERR "NOT running on a DB1200/PB1200 board!\n"); 89 return -ENODEV;
106 return;
107 }
108 90
109 whoami = bcsr_read(BCSR_WHOAMI); 91 whoami = bcsr_read(BCSR_WHOAMI);
110 printk(KERN_INFO "Alchemy/AMD/RMI %s Board, CPLD Rev %d" 92 printk(KERN_INFO "Alchemy/AMD/RMI %s Board, CPLD Rev %d"
111 " Board-ID %d Daughtercard ID %d\n", board_type_str(), 93 " Board-ID %d Daughtercard ID %d\n", get_system_type(),
112 (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf); 94 (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf);
113 95
114 /* SMBus/SPI on PSC0, Audio on PSC1 */ 96 /* SMBus/SPI on PSC0, Audio on PSC1 */
@@ -138,6 +120,8 @@ void __init board_setup(void)
138 clksrc = SYS_CS_MUX_FQ0 << SYS_CS_ME0_BIT; 120 clksrc = SYS_CS_MUX_FQ0 << SYS_CS_ME0_BIT;
139 __raw_writel(clksrc, (void __iomem *)SYS_CLKSRC); 121 __raw_writel(clksrc, (void __iomem *)SYS_CLKSRC);
140 wmb(); 122 wmb();
123
124 return 0;
141} 125}
142 126
143/******************************************************************************/ 127/******************************************************************************/
@@ -796,7 +780,7 @@ static int __init pb1200_res_fixup(void)
796 return 0; 780 return 0;
797} 781}
798 782
799static int __init db1200_dev_init(void) 783int __init db1200_dev_setup(void)
800{ 784{
801 unsigned long pfc; 785 unsigned long pfc;
802 unsigned short sw; 786 unsigned short sw;
@@ -846,7 +830,7 @@ static int __init db1200_dev_init(void)
846 gpio_request(215, "otg-vbus"); 830 gpio_request(215, "otg-vbus");
847 gpio_direction_output(215, 1); 831 gpio_direction_output(215, 1);
848 832
849 printk(KERN_INFO "%s device configuration:\n", board_type_str()); 833 printk(KERN_INFO "%s device configuration:\n", get_system_type());
850 834
851 sw = bcsr_read(BCSR_SWITCHES); 835 sw = bcsr_read(BCSR_SWITCHES);
852 if (sw & BCSR_SWITCHES_DIP_8) { 836 if (sw & BCSR_SWITCHES_DIP_8) {
@@ -922,4 +906,3 @@ static int __init db1200_dev_init(void)
922 906
923 return 0; 907 return 0;
924} 908}
925device_initcall(db1200_dev_init);
diff --git a/arch/mips/alchemy/devboards/db1235.c b/arch/mips/alchemy/devboards/db1235.c
new file mode 100644
index 000000000000..c76a90f78664
--- /dev/null
+++ b/arch/mips/alchemy/devboards/db1235.c
@@ -0,0 +1,94 @@
1/*
2 * DB1200/PB1200 / DB1550 / DB1300 board support.
3 *
4 * These 4 boards can reliably be supported in a single kernel image.
5 */
6
7#include <asm/mach-au1x00/au1000.h>
8#include <asm/mach-db1x00/bcsr.h>
9
10int __init db1200_board_setup(void);
11int __init db1200_dev_setup(void);
12int __init db1300_board_setup(void);
13int __init db1300_dev_setup(void);
14int __init db1550_board_setup(void);
15int __init db1550_dev_setup(void);
16int __init db1550_pci_setup(int);
17
18static const char *board_type_str(void)
19{
20 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
21 case BCSR_WHOAMI_PB1200_DDR1:
22 case BCSR_WHOAMI_PB1200_DDR2:
23 return "PB1200";
24 case BCSR_WHOAMI_DB1200:
25 return "DB1200";
26 case BCSR_WHOAMI_DB1300:
27 return "DB1300";
28 case BCSR_WHOAMI_DB1550:
29 return "DB1550";
30 case BCSR_WHOAMI_PB1550_SDR:
31 case BCSR_WHOAMI_PB1550_DDR:
32 return "PB1550";
33 default:
34 return "(unknown)";
35 }
36}
37
38const char *get_system_type(void)
39{
40 return board_type_str();
41}
42
43void __init board_setup(void)
44{
45 int ret;
46
47 switch (alchemy_get_cputype()) {
48 case ALCHEMY_CPU_AU1550:
49 ret = db1550_board_setup();
50 break;
51 case ALCHEMY_CPU_AU1200:
52 ret = db1200_board_setup();
53 break;
54 case ALCHEMY_CPU_AU1300:
55 ret = db1300_board_setup();
56 break;
57 default:
58 pr_err("unsupported CPU on board\n");
59 ret = -ENODEV;
60 }
61 if (ret)
62 panic("cannot initialize board support\n");
63}
64
65int __init db1235_arch_init(void)
66{
67 int id = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
68 if (id == BCSR_WHOAMI_DB1550)
69 return db1550_pci_setup(0);
70 else if ((id == BCSR_WHOAMI_PB1550_SDR) ||
71 (id == BCSR_WHOAMI_PB1550_DDR))
72 return db1550_pci_setup(1);
73
74 return 0;
75}
76arch_initcall(db1235_arch_init);
77
78int __init db1235_dev_init(void)
79{
80 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
81 case BCSR_WHOAMI_PB1200_DDR1:
82 case BCSR_WHOAMI_PB1200_DDR2:
83 case BCSR_WHOAMI_DB1200:
84 return db1200_dev_setup();
85 case BCSR_WHOAMI_DB1300:
86 return db1300_dev_setup();
87 case BCSR_WHOAMI_DB1550:
88 case BCSR_WHOAMI_PB1550_SDR:
89 case BCSR_WHOAMI_PB1550_DDR:
90 return db1550_dev_setup();
91 }
92 return 0;
93}
94device_initcall(db1235_dev_init);
diff --git a/arch/mips/alchemy/devboards/db1300.c b/arch/mips/alchemy/devboards/db1300.c
index c56e0246694e..cdf37cbd3d1f 100644
--- a/arch/mips/alchemy/devboards/db1300.c
+++ b/arch/mips/alchemy/devboards/db1300.c
@@ -110,11 +110,6 @@ static void __init db1300_gpio_config(void)
110 au1300_set_dbdma_gpio(1, AU1300_PIN_FG3AUX); 110 au1300_set_dbdma_gpio(1, AU1300_PIN_FG3AUX);
111} 111}
112 112
113char *get_system_type(void)
114{
115 return "DB1300";
116}
117
118/**********************************************************************/ 113/**********************************************************************/
119 114
120static void au1300_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, 115static void au1300_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
@@ -701,7 +696,7 @@ static struct platform_device *db1300_dev[] __initdata = {
701 &db1300_sndi2s_dev, 696 &db1300_sndi2s_dev,
702}; 697};
703 698
704static int __init db1300_device_init(void) 699int __init db1300_dev_setup(void)
705{ 700{
706 int swapped, cpldirq; 701 int swapped, cpldirq;
707 702
@@ -758,10 +753,9 @@ static int __init db1300_device_init(void)
758 753
759 return platform_add_devices(db1300_dev, ARRAY_SIZE(db1300_dev)); 754 return platform_add_devices(db1300_dev, ARRAY_SIZE(db1300_dev));
760} 755}
761device_initcall(db1300_device_init);
762 756
763 757
764void __init board_setup(void) 758int __init db1300_board_setup(void)
765{ 759{
766 unsigned short whoami; 760 unsigned short whoami;
767 761
@@ -779,4 +773,6 @@ void __init board_setup(void)
779 alchemy_uart_enable(AU1300_UART0_PHYS_ADDR); 773 alchemy_uart_enable(AU1300_UART0_PHYS_ADDR);
780 alchemy_uart_enable(AU1300_UART1_PHYS_ADDR); 774 alchemy_uart_enable(AU1300_UART1_PHYS_ADDR);
781 alchemy_uart_enable(AU1300_UART3_PHYS_ADDR); 775 alchemy_uart_enable(AU1300_UART3_PHYS_ADDR);
776
777 return 0;
782} 778}
diff --git a/arch/mips/alchemy/devboards/db1550.c b/arch/mips/alchemy/devboards/db1550.c
index 9eb79062f46e..5a9ae6095428 100644
--- a/arch/mips/alchemy/devboards/db1550.c
+++ b/arch/mips/alchemy/devboards/db1550.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Alchemy Db1550 board support 2 * Alchemy Db1550/Pb1550 board support
3 * 3 *
4 * (c) 2011 Manuel Lauss <manuel.lauss@googlemail.com> 4 * (c) 2011 Manuel Lauss <manuel.lauss@googlemail.com>
5 */ 5 */
@@ -17,34 +17,29 @@
17#include <linux/pm.h> 17#include <linux/pm.h>
18#include <linux/spi/spi.h> 18#include <linux/spi/spi.h>
19#include <linux/spi/flash.h> 19#include <linux/spi/flash.h>
20#include <asm/bootinfo.h>
20#include <asm/mach-au1x00/au1000.h> 21#include <asm/mach-au1x00/au1000.h>
21#include <asm/mach-au1x00/au1xxx_eth.h> 22#include <asm/mach-au1x00/au1xxx_eth.h>
22#include <asm/mach-au1x00/au1xxx_dbdma.h> 23#include <asm/mach-au1x00/au1xxx_dbdma.h>
23#include <asm/mach-au1x00/au1xxx_psc.h> 24#include <asm/mach-au1x00/au1xxx_psc.h>
24#include <asm/mach-au1x00/au1550_spi.h> 25#include <asm/mach-au1x00/au1550_spi.h>
26#include <asm/mach-au1x00/au1550nd.h>
25#include <asm/mach-db1x00/bcsr.h> 27#include <asm/mach-db1x00/bcsr.h>
26#include <prom.h> 28#include <prom.h>
27#include "platform.h" 29#include "platform.h"
28 30
29
30const char *get_system_type(void)
31{
32 return "DB1550";
33}
34
35static void __init db1550_hw_setup(void) 31static void __init db1550_hw_setup(void)
36{ 32{
37 void __iomem *base; 33 void __iomem *base;
38 34
39 alchemy_gpio_direction_output(203, 0); /* red led on */
40
41 /* complete SPI setup: link psc0_intclk to a 48MHz source, 35 /* complete SPI setup: link psc0_intclk to a 48MHz source,
42 * and assign GPIO16 to PSC0_SYNC1 (SPI cs# line) 36 * and assign GPIO16 to PSC0_SYNC1 (SPI cs# line) as well as PSC1_SYNC
37 * for AC97 on PB1550.
43 */ 38 */
44 base = (void __iomem *)SYS_CLKSRC; 39 base = (void __iomem *)SYS_CLKSRC;
45 __raw_writel(__raw_readl(base) | 0x000001e0, base); 40 __raw_writel(__raw_readl(base) | 0x000001e0, base);
46 base = (void __iomem *)SYS_PINFUNC; 41 base = (void __iomem *)SYS_PINFUNC;
47 __raw_writel(__raw_readl(base) | 1, base); 42 __raw_writel(__raw_readl(base) | 1 | SYS_PF_PSC1_S1, base);
48 wmb(); 43 wmb();
49 44
50 /* reset the AC97 codec now, the reset time in the psc-ac97 driver 45 /* reset the AC97 codec now, the reset time in the psc-ac97 driver
@@ -57,23 +52,27 @@ static void __init db1550_hw_setup(void)
57 wmb(); 52 wmb();
58 __raw_writel(PSC_AC97RST_RST, base + PSC_AC97RST_OFFSET); 53 __raw_writel(PSC_AC97RST_RST, base + PSC_AC97RST_OFFSET);
59 wmb(); 54 wmb();
60
61 alchemy_gpio_direction_output(202, 0); /* green led on */
62} 55}
63 56
64void __init board_setup(void) 57int __init db1550_board_setup(void)
65{ 58{
66 unsigned short whoami; 59 unsigned short whoami;
67 60
68 bcsr_init(DB1550_BCSR_PHYS_ADDR, 61 bcsr_init(DB1550_BCSR_PHYS_ADDR,
69 DB1550_BCSR_PHYS_ADDR + DB1550_BCSR_HEXLED_OFS); 62 DB1550_BCSR_PHYS_ADDR + DB1550_BCSR_HEXLED_OFS);
70 63
71 whoami = bcsr_read(BCSR_WHOAMI); 64 whoami = bcsr_read(BCSR_WHOAMI); /* PB1550 hexled offset differs */
72 printk(KERN_INFO "Alchemy/AMD DB1550 Board, CPLD Rev %d" 65 if ((BCSR_WHOAMI_BOARD(whoami) == BCSR_WHOAMI_PB1550_SDR) ||
73 " Board-ID %d Daughtercard ID %d\n", 66 (BCSR_WHOAMI_BOARD(whoami) == BCSR_WHOAMI_PB1550_DDR))
67 bcsr_init(PB1550_BCSR_PHYS_ADDR,
68 PB1550_BCSR_PHYS_ADDR + PB1550_BCSR_HEXLED_OFS);
69
70 pr_info("Alchemy/AMD %s Board, CPLD Rev %d Board-ID %d " \
71 "Daughtercard ID %d\n", get_system_type(),
74 (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf); 72 (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf);
75 73
76 db1550_hw_setup(); 74 db1550_hw_setup();
75 return 0;
77} 76}
78 77
79/*****************************************************************************/ 78/*****************************************************************************/
@@ -194,6 +193,39 @@ static struct platform_device db1550_nand_dev = {
194 } 193 }
195}; 194};
196 195
196static struct au1550nd_platdata pb1550_nand_pd = {
197 .parts = db1550_nand_parts,
198 .num_parts = ARRAY_SIZE(db1550_nand_parts),
199 .devwidth = 0, /* x8 NAND default, needs fixing up */
200};
201
202static struct platform_device pb1550_nand_dev = {
203 .name = "au1550-nand",
204 .id = -1,
205 .resource = db1550_nand_res,
206 .num_resources = ARRAY_SIZE(db1550_nand_res),
207 .dev = {
208 .platform_data = &pb1550_nand_pd,
209 },
210};
211
212static void __init pb1550_nand_setup(void)
213{
214 int boot_swapboot = (au_readl(MEM_STSTAT) & (0x7 << 1)) |
215 ((bcsr_read(BCSR_STATUS) >> 6) & 0x1);
216
217 gpio_direction_input(206); /* de-assert NAND CS# */
218 switch (boot_swapboot) {
219 case 0: case 2: case 8: case 0xC: case 0xD:
220 /* x16 NAND Flash */
221 pb1550_nand_pd.devwidth = 1;
222 /* fallthrough */
223 case 1: case 3: case 9: case 0xE: case 0xF:
224 /* x8 NAND, already set up */
225 platform_device_register(&pb1550_nand_dev);
226 }
227}
228
197/**********************************************************************/ 229/**********************************************************************/
198 230
199static struct resource au1550_psc0_res[] = { 231static struct resource au1550_psc0_res[] = {
@@ -394,6 +426,29 @@ static int db1550_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin)
394 return -1; 426 return -1;
395} 427}
396 428
429static int pb1550_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin)
430{
431 if ((slot < 12) || (slot > 13) || pin == 0)
432 return -1;
433 if (slot == 12) {
434 switch (pin) {
435 case 1: return AU1500_PCI_INTB;
436 case 2: return AU1500_PCI_INTC;
437 case 3: return AU1500_PCI_INTD;
438 case 4: return AU1500_PCI_INTA;
439 }
440 }
441 if (slot == 13) {
442 switch (pin) {
443 case 1: return AU1500_PCI_INTA;
444 case 2: return AU1500_PCI_INTB;
445 case 3: return AU1500_PCI_INTC;
446 case 4: return AU1500_PCI_INTD;
447 }
448 }
449 return -1;
450}
451
397static struct resource alchemy_pci_host_res[] = { 452static struct resource alchemy_pci_host_res[] = {
398 [0] = { 453 [0] = {
399 .start = AU1500_PCI_PHYS_ADDR, 454 .start = AU1500_PCI_PHYS_ADDR,
@@ -417,7 +472,6 @@ static struct platform_device db1550_pci_host_dev = {
417/**********************************************************************/ 472/**********************************************************************/
418 473
419static struct platform_device *db1550_devs[] __initdata = { 474static struct platform_device *db1550_devs[] __initdata = {
420 &db1550_nand_dev,
421 &db1550_i2c_dev, 475 &db1550_i2c_dev,
422 &db1550_ac97_dev, 476 &db1550_ac97_dev,
423 &db1550_spi_dev, 477 &db1550_spi_dev,
@@ -430,15 +484,16 @@ static struct platform_device *db1550_devs[] __initdata = {
430}; 484};
431 485
432/* must be arch_initcall; MIPS PCI scans busses in a subsys_initcall */ 486/* must be arch_initcall; MIPS PCI scans busses in a subsys_initcall */
433static int __init db1550_pci_init(void) 487int __init db1550_pci_setup(int id)
434{ 488{
489 if (id)
490 db1550_pci_pd.board_map_irq = pb1550_map_pci_irq;
435 return platform_device_register(&db1550_pci_host_dev); 491 return platform_device_register(&db1550_pci_host_dev);
436} 492}
437arch_initcall(db1550_pci_init);
438 493
439static int __init db1550_dev_init(void) 494static void __init db1550_devices(void)
440{ 495{
441 int swapped; 496 alchemy_gpio_direction_output(203, 0); /* red led on */
442 497
443 irq_set_irq_type(AU1550_GPIO0_INT, IRQ_TYPE_EDGE_BOTH); /* CD0# */ 498 irq_set_irq_type(AU1550_GPIO0_INT, IRQ_TYPE_EDGE_BOTH); /* CD0# */
444 irq_set_irq_type(AU1550_GPIO1_INT, IRQ_TYPE_EDGE_BOTH); /* CD1# */ 499 irq_set_irq_type(AU1550_GPIO1_INT, IRQ_TYPE_EDGE_BOTH); /* CD1# */
@@ -447,6 +502,75 @@ static int __init db1550_dev_init(void)
447 irq_set_irq_type(AU1550_GPIO21_INT, IRQ_TYPE_LEVEL_LOW); /* STSCHG0# */ 502 irq_set_irq_type(AU1550_GPIO21_INT, IRQ_TYPE_LEVEL_LOW); /* STSCHG0# */
448 irq_set_irq_type(AU1550_GPIO22_INT, IRQ_TYPE_LEVEL_LOW); /* STSCHG1# */ 503 irq_set_irq_type(AU1550_GPIO22_INT, IRQ_TYPE_LEVEL_LOW); /* STSCHG1# */
449 504
505 db1x_register_pcmcia_socket(
506 AU1000_PCMCIA_ATTR_PHYS_ADDR,
507 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
508 AU1000_PCMCIA_MEM_PHYS_ADDR,
509 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
510 AU1000_PCMCIA_IO_PHYS_ADDR,
511 AU1000_PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1,
512 AU1550_GPIO3_INT, AU1550_GPIO0_INT,
513 /*AU1550_GPIO21_INT*/0, 0, 0);
514
515 db1x_register_pcmcia_socket(
516 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004000000,
517 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1,
518 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x004000000,
519 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x004400000 - 1,
520 AU1000_PCMCIA_IO_PHYS_ADDR + 0x004000000,
521 AU1000_PCMCIA_IO_PHYS_ADDR + 0x004010000 - 1,
522 AU1550_GPIO5_INT, AU1550_GPIO1_INT,
523 /*AU1550_GPIO22_INT*/0, 0, 1);
524
525 platform_device_register(&db1550_nand_dev);
526
527 alchemy_gpio_direction_output(202, 0); /* green led on */
528}
529
530static void __init pb1550_devices(void)
531{
532 irq_set_irq_type(AU1550_GPIO0_INT, IRQ_TYPE_LEVEL_LOW);
533 irq_set_irq_type(AU1550_GPIO1_INT, IRQ_TYPE_LEVEL_LOW);
534 irq_set_irq_type(AU1550_GPIO201_205_INT, IRQ_TYPE_LEVEL_HIGH);
535
536 /* enable both PCMCIA card irqs in the shared line */
537 alchemy_gpio2_enable_int(201); /* socket 0 card irq */
538 alchemy_gpio2_enable_int(202); /* socket 1 card irq */
539
540 /* Pb1550, like all others, also has statuschange irqs; however they're
541 * wired up on one of the Au1550's shared GPIO201_205 line, which also
542 * services the PCMCIA card interrupts. So we ignore statuschange and
543 * use the GPIO201_205 exclusively for card interrupts, since a) pcmcia
544 * drivers are used to shared irqs and b) statuschange isn't really use-
545 * ful anyway.
546 */
547 db1x_register_pcmcia_socket(
548 AU1000_PCMCIA_ATTR_PHYS_ADDR,
549 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
550 AU1000_PCMCIA_MEM_PHYS_ADDR,
551 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
552 AU1000_PCMCIA_IO_PHYS_ADDR,
553 AU1000_PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1,
554 AU1550_GPIO201_205_INT, AU1550_GPIO0_INT, 0, 0, 0);
555
556 db1x_register_pcmcia_socket(
557 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x008000000,
558 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x008400000 - 1,
559 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x008000000,
560 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x008400000 - 1,
561 AU1000_PCMCIA_IO_PHYS_ADDR + 0x008000000,
562 AU1000_PCMCIA_IO_PHYS_ADDR + 0x008010000 - 1,
563 AU1550_GPIO201_205_INT, AU1550_GPIO1_INT, 0, 0, 1);
564
565 pb1550_nand_setup();
566}
567
568int __init db1550_dev_setup(void)
569{
570 int swapped, id;
571
572 id = (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) != BCSR_WHOAMI_DB1550);
573
450 i2c_register_board_info(0, db1550_i2c_devs, 574 i2c_register_board_info(0, db1550_i2c_devs,
451 ARRAY_SIZE(db1550_i2c_devs)); 575 ARRAY_SIZE(db1550_i2c_devs));
452 spi_register_board_info(db1550_spi_devs, 576 spi_register_board_info(db1550_spi_devs,
@@ -467,29 +591,11 @@ static int __init db1550_dev_init(void)
467 (void __iomem *)KSEG1ADDR(AU1550_PSC2_PHYS_ADDR) + PSC_SEL_OFFSET); 591 (void __iomem *)KSEG1ADDR(AU1550_PSC2_PHYS_ADDR) + PSC_SEL_OFFSET);
468 wmb(); 592 wmb();
469 593
470 db1x_register_pcmcia_socket( 594 id ? pb1550_devices() : db1550_devices();
471 AU1000_PCMCIA_ATTR_PHYS_ADDR,
472 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
473 AU1000_PCMCIA_MEM_PHYS_ADDR,
474 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
475 AU1000_PCMCIA_IO_PHYS_ADDR,
476 AU1000_PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1,
477 AU1550_GPIO3_INT, AU1550_GPIO0_INT,
478 /*AU1550_GPIO21_INT*/0, 0, 0);
479
480 db1x_register_pcmcia_socket(
481 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004000000,
482 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1,
483 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x004000000,
484 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x004400000 - 1,
485 AU1000_PCMCIA_IO_PHYS_ADDR + 0x004000000,
486 AU1000_PCMCIA_IO_PHYS_ADDR + 0x004010000 - 1,
487 AU1550_GPIO5_INT, AU1550_GPIO1_INT,
488 /*AU1550_GPIO22_INT*/0, 0, 1);
489 595
490 swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT; 596 swapped = bcsr_read(BCSR_STATUS) &
597 (id ? BCSR_STATUS_PB1550_SWAPBOOT : BCSR_STATUS_DB1000_SWAPBOOT);
491 db1x_register_norflash(128 << 20, 4, swapped); 598 db1x_register_norflash(128 << 20, 4, swapped);
492 599
493 return platform_add_devices(db1550_devs, ARRAY_SIZE(db1550_devs)); 600 return platform_add_devices(db1550_devs, ARRAY_SIZE(db1550_devs));
494} 601}
495device_initcall(db1550_dev_init);
diff --git a/arch/mips/alchemy/devboards/pb1100.c b/arch/mips/alchemy/devboards/pb1100.c
deleted file mode 100644
index 78c77a44a317..000000000000
--- a/arch/mips/alchemy/devboards/pb1100.c
+++ /dev/null
@@ -1,167 +0,0 @@
1/*
2 * Pb1100 board platform device registration
3 *
4 * Copyright (C) 2009 Manuel Lauss
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/delay.h>
22#include <linux/gpio.h>
23#include <linux/init.h>
24#include <linux/interrupt.h>
25#include <linux/dma-mapping.h>
26#include <linux/platform_device.h>
27#include <asm/mach-au1x00/au1000.h>
28#include <asm/mach-db1x00/bcsr.h>
29#include <prom.h>
30#include "platform.h"
31
32const char *get_system_type(void)
33{
34 return "PB1100";
35}
36
37void __init board_setup(void)
38{
39 volatile void __iomem *base = (volatile void __iomem *)0xac000000UL;
40
41 bcsr_init(DB1000_BCSR_PHYS_ADDR,
42 DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS);
43
44 /* Set AUX clock to 12 MHz * 8 = 96 MHz */
45 au_writel(8, SYS_AUXPLL);
46 alchemy_gpio1_input_enable();
47 udelay(100);
48
49#if IS_ENABLED(CONFIG_USB_OHCI_HCD)
50 {
51 u32 pin_func, sys_freqctrl, sys_clksrc;
52
53 /* Configure pins GPIO[14:9] as GPIO */
54 pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_UR3;
55
56 /* Zero and disable FREQ2 */
57 sys_freqctrl = au_readl(SYS_FREQCTRL0);
58 sys_freqctrl &= ~0xFFF00000;
59 au_writel(sys_freqctrl, SYS_FREQCTRL0);
60
61 /* Zero and disable USBH/USBD/IrDA clock */
62 sys_clksrc = au_readl(SYS_CLKSRC);
63 sys_clksrc &= ~(SYS_CS_CIR | SYS_CS_DIR | SYS_CS_MIR_MASK);
64 au_writel(sys_clksrc, SYS_CLKSRC);
65
66 sys_freqctrl = au_readl(SYS_FREQCTRL0);
67 sys_freqctrl &= ~0xFFF00000;
68
69 sys_clksrc = au_readl(SYS_CLKSRC);
70 sys_clksrc &= ~(SYS_CS_CIR | SYS_CS_DIR | SYS_CS_MIR_MASK);
71
72 /* FREQ2 = aux / 2 = 48 MHz */
73 sys_freqctrl |= (0 << SYS_FC_FRDIV2_BIT) |
74 SYS_FC_FE2 | SYS_FC_FS2;
75 au_writel(sys_freqctrl, SYS_FREQCTRL0);
76
77 /*
78 * Route 48 MHz FREQ2 into USBH/USBD/IrDA
79 */
80 sys_clksrc |= SYS_CS_MUX_FQ2 << SYS_CS_MIR_BIT;
81 au_writel(sys_clksrc, SYS_CLKSRC);
82
83 /* Setup the static bus controller */
84 au_writel(0x00000002, MEM_STCFG3); /* type = PCMCIA */
85 au_writel(0x280E3D07, MEM_STTIME3); /* 250ns cycle time */
86 au_writel(0x10000000, MEM_STADDR3); /* any PCMCIA select */
87
88 /*
89 * Get USB Functionality pin state (device vs host drive pins).
90 */
91 pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_USB;
92 /* 2nd USB port is USB host. */
93 pin_func |= SYS_PF_USB;
94 au_writel(pin_func, SYS_PINFUNC);
95 }
96#endif /* IS_ENABLED(CONFIG_USB_OHCI_HCD) */
97
98 /* Enable sys bus clock divider when IDLE state or no bus activity. */
99 au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL);
100
101 /* Enable the RTC if not already enabled. */
102 if (!(readb(base + 0x28) & 0x20)) {
103 writeb(readb(base + 0x28) | 0x20, base + 0x28);
104 au_sync();
105 }
106 /* Put the clock in BCD mode. */
107 if (readb(base + 0x2C) & 0x4) { /* reg B */
108 writeb(readb(base + 0x2c) & ~0x4, base + 0x2c);
109 au_sync();
110 }
111}
112
113/******************************************************************************/
114
115static struct resource au1100_lcd_resources[] = {
116 [0] = {
117 .start = AU1100_LCD_PHYS_ADDR,
118 .end = AU1100_LCD_PHYS_ADDR + 0x800 - 1,
119 .flags = IORESOURCE_MEM,
120 },
121 [1] = {
122 .start = AU1100_LCD_INT,
123 .end = AU1100_LCD_INT,
124 .flags = IORESOURCE_IRQ,
125 }
126};
127
128static u64 au1100_lcd_dmamask = DMA_BIT_MASK(32);
129
130static struct platform_device au1100_lcd_device = {
131 .name = "au1100-lcd",
132 .id = 0,
133 .dev = {
134 .dma_mask = &au1100_lcd_dmamask,
135 .coherent_dma_mask = DMA_BIT_MASK(32),
136 },
137 .num_resources = ARRAY_SIZE(au1100_lcd_resources),
138 .resource = au1100_lcd_resources,
139};
140
141static int __init pb1100_dev_init(void)
142{
143 int swapped;
144
145 irq_set_irq_type(AU1100_GPIO9_INT, IRQF_TRIGGER_LOW); /* PCCD# */
146 irq_set_irq_type(AU1100_GPIO10_INT, IRQF_TRIGGER_LOW); /* PCSTSCHG# */
147 irq_set_irq_type(AU1100_GPIO11_INT, IRQF_TRIGGER_LOW); /* PCCard# */
148 irq_set_irq_type(AU1100_GPIO13_INT, IRQF_TRIGGER_LOW); /* DC_IRQ# */
149
150 /* PCMCIA. single socket, identical to Pb1500 */
151 db1x_register_pcmcia_socket(
152 AU1000_PCMCIA_ATTR_PHYS_ADDR,
153 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
154 AU1000_PCMCIA_MEM_PHYS_ADDR,
155 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
156 AU1000_PCMCIA_IO_PHYS_ADDR,
157 AU1000_PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1,
158 AU1100_GPIO11_INT, AU1100_GPIO9_INT, /* card / insert */
159 /*AU1100_GPIO10_INT*/0, 0, 0); /* stschg / eject / id */
160
161 swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT;
162 db1x_register_norflash(64 * 1024 * 1024, 4, swapped);
163 platform_device_register(&au1100_lcd_device);
164
165 return 0;
166}
167device_initcall(pb1100_dev_init);
diff --git a/arch/mips/alchemy/devboards/pb1500.c b/arch/mips/alchemy/devboards/pb1500.c
deleted file mode 100644
index 232fee942000..000000000000
--- a/arch/mips/alchemy/devboards/pb1500.c
+++ /dev/null
@@ -1,198 +0,0 @@
1/*
2 * Pb1500 board support.
3 *
4 * Copyright (C) 2009 Manuel Lauss
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/delay.h>
22#include <linux/dma-mapping.h>
23#include <linux/gpio.h>
24#include <linux/init.h>
25#include <linux/interrupt.h>
26#include <linux/platform_device.h>
27#include <asm/mach-au1x00/au1000.h>
28#include <asm/mach-db1x00/bcsr.h>
29#include <prom.h>
30#include "platform.h"
31
32const char *get_system_type(void)
33{
34 return "PB1500";
35}
36
37void __init board_setup(void)
38{
39 u32 pin_func;
40 u32 sys_freqctrl, sys_clksrc;
41
42 bcsr_init(DB1000_BCSR_PHYS_ADDR,
43 DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS);
44
45 sys_clksrc = sys_freqctrl = pin_func = 0;
46 /* Set AUX clock to 12 MHz * 8 = 96 MHz */
47 au_writel(8, SYS_AUXPLL);
48 alchemy_gpio1_input_enable();
49 udelay(100);
50
51 /* GPIO201 is input for PCMCIA card detect */
52 /* GPIO203 is input for PCMCIA interrupt request */
53 alchemy_gpio_direction_input(201);
54 alchemy_gpio_direction_input(203);
55
56#if IS_ENABLED(CONFIG_USB_OHCI_HCD)
57
58 /* Zero and disable FREQ2 */
59 sys_freqctrl = au_readl(SYS_FREQCTRL0);
60 sys_freqctrl &= ~0xFFF00000;
61 au_writel(sys_freqctrl, SYS_FREQCTRL0);
62
63 /* zero and disable USBH/USBD clocks */
64 sys_clksrc = au_readl(SYS_CLKSRC);
65 sys_clksrc &= ~(SYS_CS_CUD | SYS_CS_DUD | SYS_CS_MUD_MASK |
66 SYS_CS_CUH | SYS_CS_DUH | SYS_CS_MUH_MASK);
67 au_writel(sys_clksrc, SYS_CLKSRC);
68
69 sys_freqctrl = au_readl(SYS_FREQCTRL0);
70 sys_freqctrl &= ~0xFFF00000;
71
72 sys_clksrc = au_readl(SYS_CLKSRC);
73 sys_clksrc &= ~(SYS_CS_CUD | SYS_CS_DUD | SYS_CS_MUD_MASK |
74 SYS_CS_CUH | SYS_CS_DUH | SYS_CS_MUH_MASK);
75
76 /* FREQ2 = aux/2 = 48 MHz */
77 sys_freqctrl |= (0 << SYS_FC_FRDIV2_BIT) | SYS_FC_FE2 | SYS_FC_FS2;
78 au_writel(sys_freqctrl, SYS_FREQCTRL0);
79
80 /*
81 * Route 48MHz FREQ2 into USB Host and/or Device
82 */
83 sys_clksrc |= SYS_CS_MUX_FQ2 << SYS_CS_MUH_BIT;
84 au_writel(sys_clksrc, SYS_CLKSRC);
85
86 pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_USB;
87 /* 2nd USB port is USB host */
88 pin_func |= SYS_PF_USB;
89 au_writel(pin_func, SYS_PINFUNC);
90#endif /* IS_ENABLED(CONFIG_USB_OHCI_HCD) */
91
92#ifdef CONFIG_PCI
93 {
94 void __iomem *base =
95 (void __iomem *)KSEG1ADDR(AU1500_PCI_PHYS_ADDR);
96 /* Setup PCI bus controller */
97 __raw_writel(0x00003fff, base + PCI_REG_CMEM);
98 __raw_writel(0xf0000000, base + PCI_REG_MWMASK_DEV);
99 __raw_writel(0, base + PCI_REG_MWBASE_REV_CCL);
100 __raw_writel(0x02a00356, base + PCI_REG_STATCMD);
101 __raw_writel(0x00003c04, base + PCI_REG_PARAM);
102 __raw_writel(0x00000008, base + PCI_REG_MBAR);
103 wmb();
104 }
105#endif
106
107 /* Enable sys bus clock divider when IDLE state or no bus activity. */
108 au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL);
109
110 /* Enable the RTC if not already enabled */
111 if (!(au_readl(0xac000028) & 0x20)) {
112 printk(KERN_INFO "enabling clock ...\n");
113 au_writel((au_readl(0xac000028) | 0x20), 0xac000028);
114 }
115 /* Put the clock in BCD mode */
116 if (au_readl(0xac00002c) & 0x4) { /* reg B */
117 au_writel(au_readl(0xac00002c) & ~0x4, 0xac00002c);
118 au_sync();
119 }
120}
121
122/******************************************************************************/
123
124static int pb1500_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin)
125{
126 if ((slot < 12) || (slot > 13) || pin == 0)
127 return -1;
128 if (slot == 12)
129 return (pin == 1) ? AU1500_PCI_INTA : 0xff;
130 if (slot == 13) {
131 switch (pin) {
132 case 1: return AU1500_PCI_INTA;
133 case 2: return AU1500_PCI_INTB;
134 case 3: return AU1500_PCI_INTC;
135 case 4: return AU1500_PCI_INTD;
136 }
137 }
138 return -1;
139}
140
141static struct resource alchemy_pci_host_res[] = {
142 [0] = {
143 .start = AU1500_PCI_PHYS_ADDR,
144 .end = AU1500_PCI_PHYS_ADDR + 0xfff,
145 .flags = IORESOURCE_MEM,
146 },
147};
148
149static struct alchemy_pci_platdata pb1500_pci_pd = {
150 .board_map_irq = pb1500_map_pci_irq,
151 .pci_cfg_set = PCI_CONFIG_AEN | PCI_CONFIG_R2H | PCI_CONFIG_R1H |
152 PCI_CONFIG_CH |
153#if defined(__MIPSEB__)
154 PCI_CONFIG_SIC_HWA_DAT | PCI_CONFIG_SM,
155#else
156 0,
157#endif
158};
159
160static struct platform_device pb1500_pci_host = {
161 .dev.platform_data = &pb1500_pci_pd,
162 .name = "alchemy-pci",
163 .id = 0,
164 .num_resources = ARRAY_SIZE(alchemy_pci_host_res),
165 .resource = alchemy_pci_host_res,
166};
167
168static int __init pb1500_dev_init(void)
169{
170 int swapped;
171
172 irq_set_irq_type(AU1500_GPIO9_INT, IRQF_TRIGGER_LOW); /* CD0# */
173 irq_set_irq_type(AU1500_GPIO10_INT, IRQF_TRIGGER_LOW); /* CARD0 */
174 irq_set_irq_type(AU1500_GPIO11_INT, IRQF_TRIGGER_LOW); /* STSCHG0# */
175 irq_set_irq_type(AU1500_GPIO204_INT, IRQF_TRIGGER_HIGH);
176 irq_set_irq_type(AU1500_GPIO201_INT, IRQF_TRIGGER_LOW);
177 irq_set_irq_type(AU1500_GPIO202_INT, IRQF_TRIGGER_LOW);
178 irq_set_irq_type(AU1500_GPIO203_INT, IRQF_TRIGGER_LOW);
179 irq_set_irq_type(AU1500_GPIO205_INT, IRQF_TRIGGER_LOW);
180
181 /* PCMCIA. single socket, identical to Pb1100 */
182 db1x_register_pcmcia_socket(
183 AU1000_PCMCIA_ATTR_PHYS_ADDR,
184 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
185 AU1000_PCMCIA_MEM_PHYS_ADDR,
186 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
187 AU1000_PCMCIA_IO_PHYS_ADDR,
188 AU1000_PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1,
189 AU1500_GPIO11_INT, AU1500_GPIO9_INT, /* card / insert */
190 /*AU1500_GPIO10_INT*/0, 0, 0); /* stschg / eject / id */
191
192 swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT;
193 db1x_register_norflash(64 * 1024 * 1024, 4, swapped);
194 platform_device_register(&pb1500_pci_host);
195
196 return 0;
197}
198arch_initcall(pb1500_dev_init);
diff --git a/arch/mips/alchemy/devboards/pb1550.c b/arch/mips/alchemy/devboards/pb1550.c
deleted file mode 100644
index b37e7de8d920..000000000000
--- a/arch/mips/alchemy/devboards/pb1550.c
+++ /dev/null
@@ -1,244 +0,0 @@
1/*
2 * Pb1550 board support.
3 *
4 * Copyright (C) 2009-2011 Manuel Lauss
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/dma-mapping.h>
22#include <linux/init.h>
23#include <linux/interrupt.h>
24#include <linux/platform_device.h>
25#include <asm/mach-au1x00/au1000.h>
26#include <asm/mach-au1x00/au1xxx_dbdma.h>
27#include <asm/mach-au1x00/au1550nd.h>
28#include <asm/mach-au1x00/gpio.h>
29#include <asm/mach-db1x00/bcsr.h>
30#include "platform.h"
31
32const char *get_system_type(void)
33{
34 return "PB1550";
35}
36
37void __init board_setup(void)
38{
39 u32 pin_func;
40
41 bcsr_init(PB1550_BCSR_PHYS_ADDR,
42 PB1550_BCSR_PHYS_ADDR + PB1550_BCSR_HEXLED_OFS);
43
44 alchemy_gpio2_enable();
45
46 /*
47 * Enable PSC1 SYNC for AC'97. Normaly done in audio driver,
48 * but it is board specific code, so put it here.
49 */
50 pin_func = au_readl(SYS_PINFUNC);
51 au_sync();
52 pin_func |= SYS_PF_MUST_BE_SET | SYS_PF_PSC1_S1;
53 au_writel(pin_func, SYS_PINFUNC);
54
55 bcsr_write(BCSR_PCMCIA, 0); /* turn off PCMCIA power */
56
57 printk(KERN_INFO "AMD Alchemy Pb1550 Board\n");
58}
59
60/******************************************************************************/
61
62static int pb1550_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin)
63{
64 if ((slot < 12) || (slot > 13) || pin == 0)
65 return -1;
66 if (slot == 12) {
67 switch (pin) {
68 case 1: return AU1500_PCI_INTB;
69 case 2: return AU1500_PCI_INTC;
70 case 3: return AU1500_PCI_INTD;
71 case 4: return AU1500_PCI_INTA;
72 }
73 }
74 if (slot == 13) {
75 switch (pin) {
76 case 1: return AU1500_PCI_INTA;
77 case 2: return AU1500_PCI_INTB;
78 case 3: return AU1500_PCI_INTC;
79 case 4: return AU1500_PCI_INTD;
80 }
81 }
82 return -1;
83}
84
85static struct resource alchemy_pci_host_res[] = {
86 [0] = {
87 .start = AU1500_PCI_PHYS_ADDR,
88 .end = AU1500_PCI_PHYS_ADDR + 0xfff,
89 .flags = IORESOURCE_MEM,
90 },
91};
92
93static struct alchemy_pci_platdata pb1550_pci_pd = {
94 .board_map_irq = pb1550_map_pci_irq,
95};
96
97static struct platform_device pb1550_pci_host = {
98 .dev.platform_data = &pb1550_pci_pd,
99 .name = "alchemy-pci",
100 .id = 0,
101 .num_resources = ARRAY_SIZE(alchemy_pci_host_res),
102 .resource = alchemy_pci_host_res,
103};
104
105static struct resource au1550_psc2_res[] = {
106 [0] = {
107 .start = AU1550_PSC2_PHYS_ADDR,
108 .end = AU1550_PSC2_PHYS_ADDR + 0xfff,
109 .flags = IORESOURCE_MEM,
110 },
111 [1] = {
112 .start = AU1550_PSC2_INT,
113 .end = AU1550_PSC2_INT,
114 .flags = IORESOURCE_IRQ,
115 },
116 [2] = {
117 .start = AU1550_DSCR_CMD0_PSC2_TX,
118 .end = AU1550_DSCR_CMD0_PSC2_TX,
119 .flags = IORESOURCE_DMA,
120 },
121 [3] = {
122 .start = AU1550_DSCR_CMD0_PSC2_RX,
123 .end = AU1550_DSCR_CMD0_PSC2_RX,
124 .flags = IORESOURCE_DMA,
125 },
126};
127
128static struct platform_device pb1550_i2c_dev = {
129 .name = "au1xpsc_smbus",
130 .id = 0, /* bus number */
131 .num_resources = ARRAY_SIZE(au1550_psc2_res),
132 .resource = au1550_psc2_res,
133};
134
135static struct mtd_partition pb1550_nand_parts[] = {
136 [0] = {
137 .name = "NAND FS 0",
138 .offset = 0,
139 .size = 8 * 1024 * 1024,
140 },
141 [1] = {
142 .name = "NAND FS 1",
143 .offset = MTDPART_OFS_APPEND,
144 .size = MTDPART_SIZ_FULL,
145 },
146};
147
148static struct au1550nd_platdata pb1550_nand_pd = {
149 .parts = pb1550_nand_parts,
150 .num_parts = ARRAY_SIZE(pb1550_nand_parts),
151 .devwidth = 0, /* x8 NAND default, needs fixing up */
152};
153
154static struct resource pb1550_nand_res[] = {
155 [0] = {
156 .start = 0x20000000,
157 .end = 0x20000fff,
158 .flags = IORESOURCE_MEM,
159 },
160};
161
162static struct platform_device pb1550_nand_dev = {
163 .name = "au1550-nand",
164 .id = -1,
165 .resource = pb1550_nand_res,
166 .num_resources = ARRAY_SIZE(pb1550_nand_res),
167 .dev = {
168 .platform_data = &pb1550_nand_pd,
169 },
170};
171
172static void __init pb1550_nand_setup(void)
173{
174 int boot_swapboot = (au_readl(MEM_STSTAT) & (0x7 << 1)) |
175 ((bcsr_read(BCSR_STATUS) >> 6) & 0x1);
176
177 switch (boot_swapboot) {
178 case 0:
179 case 2:
180 case 8:
181 case 0xC:
182 case 0xD:
183 /* x16 NAND Flash */
184 pb1550_nand_pd.devwidth = 1;
185 /* fallthrough */
186 case 1:
187 case 9:
188 case 3:
189 case 0xE:
190 case 0xF:
191 /* x8 NAND, already set up */
192 platform_device_register(&pb1550_nand_dev);
193 }
194}
195
196static int __init pb1550_dev_init(void)
197{
198 int swapped;
199
200 irq_set_irq_type(AU1550_GPIO0_INT, IRQF_TRIGGER_LOW);
201 irq_set_irq_type(AU1550_GPIO1_INT, IRQF_TRIGGER_LOW);
202 irq_set_irq_type(AU1550_GPIO201_205_INT, IRQF_TRIGGER_HIGH);
203
204 /* enable both PCMCIA card irqs in the shared line */
205 alchemy_gpio2_enable_int(201);
206 alchemy_gpio2_enable_int(202);
207
208 /* Pb1550, like all others, also has statuschange irqs; however they're
209 * wired up on one of the Au1550's shared GPIO201_205 line, which also
210 * services the PCMCIA card interrupts. So we ignore statuschange and
211 * use the GPIO201_205 exclusively for card interrupts, since a) pcmcia
212 * drivers are used to shared irqs and b) statuschange isn't really use-
213 * ful anyway.
214 */
215 db1x_register_pcmcia_socket(
216 AU1000_PCMCIA_ATTR_PHYS_ADDR,
217 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
218 AU1000_PCMCIA_MEM_PHYS_ADDR,
219 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
220 AU1000_PCMCIA_IO_PHYS_ADDR,
221 AU1000_PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1,
222 AU1550_GPIO201_205_INT, AU1550_GPIO0_INT, 0, 0, 0);
223
224 db1x_register_pcmcia_socket(
225 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x008000000,
226 AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x008400000 - 1,
227 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x008000000,
228 AU1000_PCMCIA_MEM_PHYS_ADDR + 0x008400000 - 1,
229 AU1000_PCMCIA_IO_PHYS_ADDR + 0x008000000,
230 AU1000_PCMCIA_IO_PHYS_ADDR + 0x008010000 - 1,
231 AU1550_GPIO201_205_INT, AU1550_GPIO1_INT, 0, 0, 1);
232
233 /* NAND setup */
234 gpio_direction_input(206); /* GPIO206 high */
235 pb1550_nand_setup();
236
237 swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_PB1550_SWAPBOOT;
238 db1x_register_norflash(128 * 1024 * 1024, 4, swapped);
239 platform_device_register(&pb1550_pci_host);
240 platform_device_register(&pb1550_i2c_dev);
241
242 return 0;
243}
244arch_initcall(pb1550_dev_init);
diff --git a/arch/mips/alchemy/devboards/platform.c b/arch/mips/alchemy/devboards/platform.c
index f39042e99d0d..8df86eb94972 100644
--- a/arch/mips/alchemy/devboards/platform.c
+++ b/arch/mips/alchemy/devboards/platform.c
@@ -36,11 +36,10 @@ void __init prom_init(void)
36 36
37void prom_putchar(unsigned char c) 37void prom_putchar(unsigned char c)
38{ 38{
39#ifdef CONFIG_MIPS_DB1300 39 if (alchemy_get_cputype() == ALCHEMY_CPU_AU1300)
40 alchemy_uart_putchar(AU1300_UART2_PHYS_ADDR, c); 40 alchemy_uart_putchar(AU1300_UART2_PHYS_ADDR, c);
41#else 41 else
42 alchemy_uart_putchar(AU1000_UART0_PHYS_ADDR, c); 42 alchemy_uart_putchar(AU1000_UART0_PHYS_ADDR, c);
43#endif
44} 43}
45 44
46 45
diff --git a/arch/mips/boot/compressed/uart-alchemy.c b/arch/mips/boot/compressed/uart-alchemy.c
index 3112df8f90db..4bee55b93f6a 100644
--- a/arch/mips/boot/compressed/uart-alchemy.c
+++ b/arch/mips/boot/compressed/uart-alchemy.c
@@ -2,9 +2,5 @@
2 2
3void putc(char c) 3void putc(char c)
4{ 4{
5#ifdef CONFIG_MIPS_DB1300
6 alchemy_uart_putchar(AU1300_UART2_PHYS_ADDR, c);
7#else
8 alchemy_uart_putchar(AU1000_UART0_PHYS_ADDR, c); 5 alchemy_uart_putchar(AU1000_UART0_PHYS_ADDR, c);
9#endif
10} 6}
diff --git a/arch/mips/configs/db1200_defconfig b/arch/mips/configs/db1200_defconfig
deleted file mode 100644
index 1f69249b839a..000000000000
--- a/arch/mips/configs/db1200_defconfig
+++ /dev/null
@@ -1,170 +0,0 @@
1CONFIG_MIPS_ALCHEMY=y
2CONFIG_MIPS_DB1200=y
3CONFIG_KSM=y
4CONFIG_NO_HZ=y
5CONFIG_HIGH_RES_TIMERS=y
6CONFIG_HZ_100=y
7# CONFIG_SECCOMP is not set
8CONFIG_EXPERIMENTAL=y
9CONFIG_LOCALVERSION="-db1200"
10CONFIG_KERNEL_LZMA=y
11CONFIG_SYSVIPC=y
12CONFIG_POSIX_MQUEUE=y
13CONFIG_TINY_RCU=y
14CONFIG_LOG_BUF_SHIFT=14
15CONFIG_EXPERT=y
16# CONFIG_SYSCTL_SYSCALL is not set
17# CONFIG_KALLSYMS is not set
18# CONFIG_PCSPKR_PLATFORM is not set
19# CONFIG_VM_EVENT_COUNTERS is not set
20# CONFIG_COMPAT_BRK is not set
21CONFIG_SLAB=y
22CONFIG_MODULES=y
23CONFIG_MODULE_UNLOAD=y
24# CONFIG_LBDAF is not set
25# CONFIG_BLK_DEV_BSG is not set
26# CONFIG_IOSCHED_DEADLINE is not set
27# CONFIG_IOSCHED_CFQ is not set
28CONFIG_PCCARD=y
29CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
30CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
31CONFIG_BINFMT_MISC=y
32CONFIG_NET=y
33CONFIG_PACKET=y
34CONFIG_UNIX=y
35CONFIG_INET=y
36CONFIG_IP_MULTICAST=y
37CONFIG_IP_PNP=y
38# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
39# CONFIG_INET_XFRM_MODE_TUNNEL is not set
40# CONFIG_INET_XFRM_MODE_BEET is not set
41# CONFIG_INET_DIAG is not set
42# CONFIG_IPV6 is not set
43# CONFIG_WIRELESS is not set
44CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
45CONFIG_MTD=y
46CONFIG_MTD_PARTITIONS=y
47CONFIG_MTD_CMDLINE_PARTS=y
48CONFIG_MTD_CHAR=y
49CONFIG_MTD_BLOCK=y
50CONFIG_MTD_CFI=y
51CONFIG_MTD_CFI_AMDSTD=y
52CONFIG_MTD_PHYSMAP=y
53CONFIG_MTD_NAND=y
54CONFIG_MTD_NAND_PLATFORM=y
55CONFIG_BLK_DEV_LOOP=y
56CONFIG_BLK_DEV_UB=y
57# CONFIG_MISC_DEVICES is not set
58CONFIG_IDE=y
59CONFIG_BLK_DEV_IDECS=y
60CONFIG_BLK_DEV_IDECD=y
61CONFIG_IDE_TASK_IOCTL=y
62# CONFIG_IDE_PROC_FS is not set
63CONFIG_BLK_DEV_IDE_AU1XXX=y
64CONFIG_NETDEVICES=y
65CONFIG_NET_ETHERNET=y
66CONFIG_SMC91X=y
67# CONFIG_NETDEV_1000 is not set
68# CONFIG_NETDEV_10000 is not set
69# CONFIG_WLAN is not set
70# CONFIG_INPUT_MOUSEDEV is not set
71CONFIG_INPUT_EVDEV=y
72# CONFIG_INPUT_KEYBOARD is not set
73# CONFIG_INPUT_MOUSE is not set
74# CONFIG_SERIO is not set
75CONFIG_VT_HW_CONSOLE_BINDING=y
76CONFIG_SERIAL_8250=y
77CONFIG_SERIAL_8250_CONSOLE=y
78CONFIG_SERIAL_8250_NR_UARTS=2
79CONFIG_SERIAL_8250_RUNTIME_UARTS=2
80# CONFIG_LEGACY_PTYS is not set
81# CONFIG_HW_RANDOM is not set
82CONFIG_I2C=y
83# CONFIG_I2C_COMPAT is not set
84CONFIG_I2C_CHARDEV=y
85# CONFIG_I2C_HELPER_AUTO is not set
86CONFIG_I2C_AU1550=y
87CONFIG_SPI=y
88CONFIG_SPI_AU1550=y
89CONFIG_GPIOLIB=y
90CONFIG_GPIO_SYSFS=y
91CONFIG_SENSORS_ADM1025=y
92CONFIG_SENSORS_LM70=y
93CONFIG_FB=y
94CONFIG_FB_AU1200=y
95# CONFIG_VGA_CONSOLE is not set
96CONFIG_FRAMEBUFFER_CONSOLE=y
97CONFIG_FONTS=y
98CONFIG_FONT_8x16=y
99CONFIG_SOUND=y
100CONFIG_SND=y
101CONFIG_SND_DYNAMIC_MINORS=y
102# CONFIG_SND_SUPPORT_OLD_API is not set
103# CONFIG_SND_VERBOSE_PROCFS is not set
104# CONFIG_SND_DRIVERS is not set
105# CONFIG_SND_SPI is not set
106# CONFIG_SND_MIPS is not set
107# CONFIG_SND_USB is not set
108# CONFIG_SND_PCMCIA is not set
109CONFIG_SND_SOC=y
110CONFIG_SND_SOC_AU1XPSC=y
111CONFIG_SND_SOC_DB1200=y
112CONFIG_HIDRAW=y
113CONFIG_USB_HIDDEV=y
114CONFIG_USB=y
115CONFIG_USB_DEBUG=y
116CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
117# CONFIG_USB_DEVICE_CLASS is not set
118CONFIG_USB_DYNAMIC_MINORS=y
119CONFIG_USB_EHCI_HCD=y
120CONFIG_USB_EHCI_ROOT_HUB_TT=y
121CONFIG_USB_OHCI_HCD=y
122CONFIG_MMC=y
123# CONFIG_MMC_BLOCK_BOUNCE is not set
124CONFIG_MMC_AU1X=y
125CONFIG_NEW_LEDS=y
126CONFIG_LEDS_CLASS=y
127CONFIG_LEDS_TRIGGERS=y
128CONFIG_RTC_CLASS=y
129CONFIG_RTC_DRV_AU1XXX=y
130CONFIG_EXT2_FS=y
131CONFIG_ISO9660_FS=y
132CONFIG_JOLIET=y
133CONFIG_ZISOFS=y
134CONFIG_UDF_FS=y
135CONFIG_VFAT_FS=y
136# CONFIG_PROC_PAGE_MONITOR is not set
137CONFIG_TMPFS=y
138CONFIG_JFFS2_FS=y
139CONFIG_JFFS2_SUMMARY=y
140CONFIG_JFFS2_COMPRESSION_OPTIONS=y
141CONFIG_JFFS2_LZO=y
142CONFIG_JFFS2_RUBIN=y
143CONFIG_SQUASHFS=y
144CONFIG_NFS_FS=y
145CONFIG_NFS_V3=y
146CONFIG_ROOT_NFS=y
147CONFIG_PARTITION_ADVANCED=y
148CONFIG_EFI_PARTITION=y
149CONFIG_NLS_CODEPAGE_437=y
150CONFIG_NLS_CODEPAGE_850=y
151CONFIG_NLS_CODEPAGE_852=y
152CONFIG_NLS_CODEPAGE_1250=y
153CONFIG_NLS_ASCII=y
154CONFIG_NLS_ISO8859_1=y
155CONFIG_NLS_ISO8859_2=y
156CONFIG_NLS_ISO8859_15=y
157CONFIG_NLS_UTF8=y
158# CONFIG_ENABLE_WARN_DEPRECATED is not set
159# CONFIG_ENABLE_MUST_CHECK is not set
160CONFIG_MAGIC_SYSRQ=y
161CONFIG_STRIP_ASM_SYMS=y
162CONFIG_DEBUG_KERNEL=y
163# CONFIG_SCHED_DEBUG is not set
164# CONFIG_FTRACE is not set
165CONFIG_CMDLINE_BOOL=y
166CONFIG_CMDLINE="console=ttyS0,115200"
167CONFIG_DEBUG_ZBOOT=y
168CONFIG_KEYS=y
169CONFIG_KEYS_DEBUG_PROC_KEYS=y
170CONFIG_SECURITYFS=y
diff --git a/arch/mips/configs/db1235_defconfig b/arch/mips/configs/db1235_defconfig
new file mode 100644
index 000000000000..c48998ffd198
--- /dev/null
+++ b/arch/mips/configs/db1235_defconfig
@@ -0,0 +1,434 @@
1CONFIG_MIPS_ALCHEMY=y
2CONFIG_MIPS_DB1235=y
3CONFIG_COMPACTION=y
4CONFIG_KSM=y
5CONFIG_HZ_100=y
6CONFIG_EXPERIMENTAL=y
7CONFIG_LOCALVERSION="-db1235"
8CONFIG_KERNEL_LZMA=y
9CONFIG_DEFAULT_HOSTNAME="db1235"
10CONFIG_SYSVIPC=y
11CONFIG_POSIX_MQUEUE=y
12CONFIG_BSD_PROCESS_ACCT=y
13CONFIG_BSD_PROCESS_ACCT_V3=y
14CONFIG_FHANDLE=y
15CONFIG_TASKSTATS=y
16CONFIG_TASK_DELAY_ACCT=y
17CONFIG_AUDIT=y
18CONFIG_AUDIT_LOGINUID_IMMUTABLE=y
19CONFIG_NO_HZ=y
20CONFIG_HIGH_RES_TIMERS=y
21CONFIG_LOG_BUF_SHIFT=16
22CONFIG_NAMESPACES=y
23CONFIG_EMBEDDED=y
24CONFIG_SLAB=y
25CONFIG_JUMP_LABEL=y
26CONFIG_PARTITION_ADVANCED=y
27CONFIG_LDM_PARTITION=y
28CONFIG_EFI_PARTITION=y
29CONFIG_PCI=y
30CONFIG_PCCARD=y
31CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
32CONFIG_PM_RUNTIME=y
33CONFIG_NET=y
34CONFIG_PACKET=y
35CONFIG_UNIX=y
36CONFIG_UNIX_DIAG=y
37CONFIG_XFRM_USER=y
38CONFIG_INET=y
39CONFIG_IP_MULTICAST=y
40CONFIG_IP_ADVANCED_ROUTER=y
41CONFIG_IP_MULTIPLE_TABLES=y
42CONFIG_IP_ROUTE_MULTIPATH=y
43CONFIG_IP_ROUTE_VERBOSE=y
44CONFIG_IP_PNP=y
45CONFIG_IP_PNP_DHCP=y
46CONFIG_IP_PNP_BOOTP=y
47CONFIG_IP_PNP_RARP=y
48CONFIG_NET_IPIP=y
49CONFIG_NET_IPGRE_DEMUX=y
50CONFIG_NET_IPGRE=y
51CONFIG_NET_IPGRE_BROADCAST=y
52CONFIG_IP_MROUTE=y
53CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
54CONFIG_IP_PIMSM_V1=y
55CONFIG_IP_PIMSM_V2=y
56CONFIG_ARPD=y
57CONFIG_SYN_COOKIES=y
58CONFIG_NET_IPVTI=y
59CONFIG_INET_AH=y
60CONFIG_INET_ESP=y
61CONFIG_INET_IPCOMP=y
62CONFIG_INET_UDP_DIAG=y
63CONFIG_TCP_CONG_ADVANCED=y
64CONFIG_TCP_CONG_HSTCP=y
65CONFIG_TCP_CONG_HYBLA=y
66CONFIG_TCP_CONG_SCALABLE=y
67CONFIG_TCP_CONG_LP=y
68CONFIG_TCP_CONG_VENO=y
69CONFIG_TCP_CONG_YEAH=y
70CONFIG_TCP_CONG_ILLINOIS=y
71CONFIG_DEFAULT_HYBLA=y
72CONFIG_TCP_MD5SIG=y
73CONFIG_IPV6_PRIVACY=y
74CONFIG_IPV6_ROUTER_PREF=y
75CONFIG_IPV6_ROUTE_INFO=y
76CONFIG_IPV6_OPTIMISTIC_DAD=y
77CONFIG_INET6_AH=y
78CONFIG_INET6_ESP=y
79CONFIG_INET6_IPCOMP=y
80CONFIG_IPV6_MIP6=y
81CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=y
82CONFIG_IPV6_SIT_6RD=y
83CONFIG_IPV6_TUNNEL=y
84CONFIG_IPV6_MULTIPLE_TABLES=y
85CONFIG_IPV6_SUBTREES=y
86CONFIG_IPV6_MROUTE=y
87CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
88CONFIG_IPV6_PIMSM_V2=y
89CONFIG_NETFILTER=y
90CONFIG_NF_CONNTRACK=y
91CONFIG_NF_CONNTRACK_EVENTS=y
92CONFIG_NF_CONNTRACK_TIMEOUT=y
93CONFIG_NF_CONNTRACK_TIMESTAMP=y
94CONFIG_NF_CT_PROTO_DCCP=y
95CONFIG_NF_CT_PROTO_SCTP=y
96CONFIG_NF_CT_PROTO_UDPLITE=y
97CONFIG_NF_CONNTRACK_AMANDA=y
98CONFIG_NF_CONNTRACK_FTP=y
99CONFIG_NF_CONNTRACK_H323=y
100CONFIG_NF_CONNTRACK_IRC=y
101CONFIG_NF_CONNTRACK_NETBIOS_NS=y
102CONFIG_NF_CONNTRACK_SNMP=y
103CONFIG_NF_CONNTRACK_PPTP=y
104CONFIG_NF_CONNTRACK_SANE=y
105CONFIG_NF_CONNTRACK_SIP=y
106CONFIG_NF_CONNTRACK_TFTP=y
107CONFIG_NF_CT_NETLINK=y
108CONFIG_NF_CT_NETLINK_TIMEOUT=y
109CONFIG_NF_CT_NETLINK_HELPER=y
110CONFIG_NETFILTER_NETLINK_QUEUE_CT=y
111CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
112CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
113CONFIG_NETFILTER_XT_TARGET_HMARK=y
114CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
115CONFIG_NETFILTER_XT_TARGET_LED=y
116CONFIG_NETFILTER_XT_TARGET_LOG=y
117CONFIG_NETFILTER_XT_TARGET_MARK=y
118CONFIG_NETFILTER_XT_TARGET_NFLOG=y
119CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
120CONFIG_NETFILTER_XT_TARGET_TEE=y
121CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
122CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y
123CONFIG_NETFILTER_XT_MATCH_CLUSTER=y
124CONFIG_NETFILTER_XT_MATCH_COMMENT=y
125CONFIG_NETFILTER_XT_MATCH_CONNBYTES=y
126CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=y
127CONFIG_NETFILTER_XT_MATCH_CONNMARK=y
128CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
129CONFIG_NETFILTER_XT_MATCH_CPU=y
130CONFIG_NETFILTER_XT_MATCH_DCCP=y
131CONFIG_NETFILTER_XT_MATCH_DEVGROUP=y
132CONFIG_NETFILTER_XT_MATCH_DSCP=y
133CONFIG_NETFILTER_XT_MATCH_ESP=y
134CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y
135CONFIG_NETFILTER_XT_MATCH_HELPER=y
136CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
137CONFIG_NETFILTER_XT_MATCH_LENGTH=y
138CONFIG_NETFILTER_XT_MATCH_LIMIT=y
139CONFIG_NETFILTER_XT_MATCH_MAC=y
140CONFIG_NETFILTER_XT_MATCH_MARK=y
141CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
142CONFIG_NETFILTER_XT_MATCH_NFACCT=y
143CONFIG_NETFILTER_XT_MATCH_OSF=y
144CONFIG_NETFILTER_XT_MATCH_OWNER=y
145CONFIG_NETFILTER_XT_MATCH_POLICY=y
146CONFIG_NETFILTER_XT_MATCH_PHYSDEV=y
147CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y
148CONFIG_NETFILTER_XT_MATCH_QUOTA=y
149CONFIG_NETFILTER_XT_MATCH_RATEEST=y
150CONFIG_NETFILTER_XT_MATCH_REALM=y
151CONFIG_NETFILTER_XT_MATCH_RECENT=y
152CONFIG_NETFILTER_XT_MATCH_SCTP=y
153CONFIG_NETFILTER_XT_MATCH_STATE=y
154CONFIG_NETFILTER_XT_MATCH_STATISTIC=y
155CONFIG_NETFILTER_XT_MATCH_STRING=y
156CONFIG_NETFILTER_XT_MATCH_TCPMSS=y
157CONFIG_NETFILTER_XT_MATCH_TIME=y
158CONFIG_NETFILTER_XT_MATCH_U32=y
159CONFIG_NF_CONNTRACK_IPV4=y
160CONFIG_IP_NF_IPTABLES=y
161CONFIG_IP_NF_MATCH_AH=y
162CONFIG_IP_NF_MATCH_ECN=y
163CONFIG_IP_NF_MATCH_RPFILTER=y
164CONFIG_IP_NF_MATCH_TTL=y
165CONFIG_IP_NF_FILTER=y
166CONFIG_IP_NF_TARGET_REJECT=y
167CONFIG_IP_NF_TARGET_ULOG=y
168CONFIG_NF_NAT=y
169CONFIG_IP_NF_TARGET_MASQUERADE=y
170CONFIG_IP_NF_TARGET_NETMAP=y
171CONFIG_IP_NF_TARGET_REDIRECT=y
172CONFIG_IP_NF_MANGLE=y
173CONFIG_IP_NF_TARGET_CLUSTERIP=y
174CONFIG_IP_NF_TARGET_ECN=y
175CONFIG_IP_NF_TARGET_TTL=y
176CONFIG_IP_NF_RAW=y
177CONFIG_IP_NF_ARPTABLES=y
178CONFIG_IP_NF_ARPFILTER=y
179CONFIG_IP_NF_ARP_MANGLE=y
180CONFIG_NF_CONNTRACK_IPV6=y
181CONFIG_IP6_NF_IPTABLES=y
182CONFIG_IP6_NF_MATCH_AH=y
183CONFIG_IP6_NF_MATCH_EUI64=y
184CONFIG_IP6_NF_MATCH_FRAG=y
185CONFIG_IP6_NF_MATCH_OPTS=y
186CONFIG_IP6_NF_MATCH_HL=y
187CONFIG_IP6_NF_MATCH_IPV6HEADER=y
188CONFIG_IP6_NF_MATCH_MH=y
189CONFIG_IP6_NF_MATCH_RPFILTER=y
190CONFIG_IP6_NF_MATCH_RT=y
191CONFIG_IP6_NF_TARGET_HL=y
192CONFIG_IP6_NF_FILTER=y
193CONFIG_IP6_NF_TARGET_REJECT=y
194CONFIG_IP6_NF_MANGLE=y
195CONFIG_IP6_NF_RAW=y
196CONFIG_BRIDGE_NF_EBTABLES=y
197CONFIG_BRIDGE_EBT_BROUTE=y
198CONFIG_BRIDGE_EBT_T_FILTER=y
199CONFIG_BRIDGE_EBT_T_NAT=y
200CONFIG_BRIDGE_EBT_802_3=y
201CONFIG_BRIDGE_EBT_AMONG=y
202CONFIG_BRIDGE_EBT_ARP=y
203CONFIG_BRIDGE_EBT_IP=y
204CONFIG_BRIDGE_EBT_IP6=y
205CONFIG_BRIDGE_EBT_LIMIT=y
206CONFIG_BRIDGE_EBT_MARK=y
207CONFIG_BRIDGE_EBT_PKTTYPE=y
208CONFIG_BRIDGE_EBT_STP=y
209CONFIG_BRIDGE_EBT_VLAN=y
210CONFIG_BRIDGE_EBT_ARPREPLY=y
211CONFIG_BRIDGE_EBT_DNAT=y
212CONFIG_BRIDGE_EBT_MARK_T=y
213CONFIG_BRIDGE_EBT_REDIRECT=y
214CONFIG_BRIDGE_EBT_SNAT=y
215CONFIG_BRIDGE_EBT_LOG=y
216CONFIG_BRIDGE_EBT_NFLOG=y
217CONFIG_L2TP=y
218CONFIG_L2TP_V3=y
219CONFIG_L2TP_IP=y
220CONFIG_L2TP_ETH=y
221CONFIG_BRIDGE=y
222CONFIG_VLAN_8021Q=y
223CONFIG_VLAN_8021Q_GVRP=y
224CONFIG_LLC2=y
225CONFIG_NET_SCHED=y
226CONFIG_NET_SCH_CBQ=y
227CONFIG_NET_SCH_HTB=y
228CONFIG_NET_SCH_HFSC=y
229CONFIG_NET_SCH_PRIO=y
230CONFIG_NET_SCH_MULTIQ=y
231CONFIG_NET_SCH_RED=y
232CONFIG_NET_SCH_SFB=y
233CONFIG_NET_SCH_SFQ=y
234CONFIG_NET_SCH_TEQL=y
235CONFIG_NET_SCH_TBF=y
236CONFIG_NET_SCH_GRED=y
237CONFIG_NET_SCH_DSMARK=y
238CONFIG_NET_SCH_NETEM=y
239CONFIG_NET_SCH_DRR=y
240CONFIG_NET_SCH_MQPRIO=y
241CONFIG_NET_SCH_CHOKE=y
242CONFIG_NET_SCH_QFQ=y
243CONFIG_NET_SCH_CODEL=y
244CONFIG_NET_SCH_FQ_CODEL=y
245CONFIG_NET_SCH_INGRESS=y
246CONFIG_NET_SCH_PLUG=y
247CONFIG_NET_CLS_BASIC=y
248CONFIG_NET_CLS_TCINDEX=y
249CONFIG_NET_CLS_ROUTE4=y
250CONFIG_NET_CLS_FW=y
251CONFIG_NET_CLS_U32=y
252CONFIG_CLS_U32_PERF=y
253CONFIG_CLS_U32_MARK=y
254CONFIG_NET_CLS_RSVP=y
255CONFIG_NET_CLS_RSVP6=y
256CONFIG_NET_CLS_FLOW=y
257CONFIG_NET_EMATCH=y
258CONFIG_NET_EMATCH_CMP=y
259CONFIG_NET_EMATCH_NBYTE=y
260CONFIG_NET_EMATCH_U32=y
261CONFIG_NET_EMATCH_META=y
262CONFIG_NET_EMATCH_TEXT=y
263CONFIG_NET_CLS_ACT=y
264CONFIG_NET_ACT_POLICE=y
265CONFIG_NET_ACT_GACT=y
266CONFIG_GACT_PROB=y
267CONFIG_NET_ACT_MIRRED=y
268CONFIG_NET_ACT_NAT=y
269CONFIG_NET_ACT_PEDIT=y
270CONFIG_NET_ACT_SIMP=y
271CONFIG_NET_ACT_SKBEDIT=y
272CONFIG_NET_ACT_CSUM=y
273CONFIG_NET_CLS_IND=y
274CONFIG_BT=y
275CONFIG_BT_RFCOMM=y
276CONFIG_BT_RFCOMM_TTY=y
277CONFIG_BT_BNEP=y
278CONFIG_BT_BNEP_MC_FILTER=y
279CONFIG_BT_BNEP_PROTO_FILTER=y
280CONFIG_BT_HIDP=y
281CONFIG_BT_HCIBTUSB=y
282CONFIG_CFG80211=y
283CONFIG_CFG80211_CERTIFICATION_ONUS=y
284CONFIG_CFG80211_WEXT=y
285CONFIG_MAC80211=y
286CONFIG_MAC80211_LEDS=y
287CONFIG_RFKILL=y
288CONFIG_RFKILL_INPUT=y
289CONFIG_DEVTMPFS=y
290CONFIG_DEVTMPFS_MOUNT=y
291CONFIG_MTD=y
292CONFIG_MTD_CHAR=y
293CONFIG_MTD_BLOCK=y
294CONFIG_MTD_CFI=y
295CONFIG_MTD_CFI_AMDSTD=y
296CONFIG_MTD_PHYSMAP=y
297CONFIG_MTD_M25P80=y
298CONFIG_MTD_NAND=y
299CONFIG_MTD_NAND_PLATFORM=y
300CONFIG_EEPROM_AT24=y
301CONFIG_EEPROM_AT25=y
302CONFIG_IDE=y
303CONFIG_BLK_DEV_IDE_AU1XXX=y
304CONFIG_BLK_DEV_SD=y
305CONFIG_CHR_DEV_SG=y
306CONFIG_SCSI_MULTI_LUN=y
307CONFIG_ATA=y
308CONFIG_PATA_HPT37X=y
309CONFIG_PATA_PCMCIA=y
310CONFIG_PATA_PLATFORM=y
311CONFIG_NETDEVICES=y
312CONFIG_MIPS_AU1X00_ENET=y
313CONFIG_SMC91X=y
314CONFIG_SMSC911X=y
315CONFIG_AMD_PHY=y
316CONFIG_SMSC_PHY=y
317CONFIG_RT2X00=y
318CONFIG_RT73USB=y
319CONFIG_INPUT_EVDEV=y
320CONFIG_INPUT_TOUCHSCREEN=y
321CONFIG_TOUCHSCREEN_WM97XX=y
322CONFIG_INPUT_MISC=y
323CONFIG_INPUT_UINPUT=y
324CONFIG_SERIAL_8250=y
325CONFIG_SERIAL_8250_CONSOLE=y
326CONFIG_TTY_PRINTK=y
327CONFIG_I2C=y
328CONFIG_I2C_CHARDEV=y
329CONFIG_I2C_AU1550=y
330CONFIG_SPI=y
331CONFIG_SPI_AU1550=y
332CONFIG_GPIO_SYSFS=y
333CONFIG_SENSORS_ADM1025=y
334CONFIG_SENSORS_LM70=y
335CONFIG_SOUND=y
336CONFIG_SND=y
337CONFIG_SND_HRTIMER=y
338CONFIG_SND_DYNAMIC_MINORS=y
339CONFIG_SND_SOC=y
340CONFIG_SND_SOC_AU1XPSC=y
341CONFIG_SND_SOC_DB1200=y
342CONFIG_HIDRAW=y
343CONFIG_UHID=y
344CONFIG_USB_HIDDEV=y
345CONFIG_USB=y
346CONFIG_USB_DYNAMIC_MINORS=y
347CONFIG_USB_SUSPEND=y
348CONFIG_USB_EHCI_HCD=y
349CONFIG_USB_EHCI_ROOT_HUB_TT=y
350CONFIG_USB_OHCI_HCD=y
351CONFIG_USB_STORAGE=y
352CONFIG_MMC=y
353CONFIG_MMC_CLKGATE=y
354CONFIG_MMC_AU1X=y
355CONFIG_NEW_LEDS=y
356CONFIG_LEDS_CLASS=y
357CONFIG_RTC_CLASS=y
358CONFIG_RTC_DRV_AU1XXX=y
359CONFIG_EXT4_FS=y
360CONFIG_EXT4_FS_POSIX_ACL=y
361CONFIG_EXT4_FS_SECURITY=y
362CONFIG_XFS_FS=y
363CONFIG_XFS_POSIX_ACL=y
364CONFIG_VFAT_FS=y
365CONFIG_TMPFS=y
366CONFIG_TMPFS_POSIX_ACL=y
367CONFIG_CONFIGFS_FS=y
368CONFIG_JFFS2_FS=y
369CONFIG_JFFS2_SUMMARY=y
370CONFIG_JFFS2_FS_XATTR=y
371CONFIG_JFFS2_COMPRESSION_OPTIONS=y
372CONFIG_JFFS2_LZO=y
373CONFIG_JFFS2_CMODE_FAVOURLZO=y
374CONFIG_SQUASHFS=y
375CONFIG_SQUASHFS_LZO=y
376CONFIG_SQUASHFS_XZ=y
377CONFIG_NFS_FS=y
378CONFIG_NFS_V3_ACL=y
379CONFIG_NFS_V4=y
380CONFIG_NFS_V4_1=y
381CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"
382CONFIG_ROOT_NFS=y
383CONFIG_NFSD=y
384CONFIG_NFSD_V3_ACL=y
385CONFIG_NFSD_V4=y
386CONFIG_NLS_CODEPAGE_437=y
387CONFIG_NLS_CODEPAGE_850=y
388CONFIG_NLS_CODEPAGE_852=y
389CONFIG_NLS_CODEPAGE_1250=y
390CONFIG_NLS_ASCII=y
391CONFIG_NLS_ISO8859_1=y
392CONFIG_NLS_ISO8859_2=y
393CONFIG_NLS_ISO8859_15=y
394CONFIG_NLS_UTF8=y
395CONFIG_MAGIC_SYSRQ=y
396CONFIG_STRIP_ASM_SYMS=y
397CONFIG_SECURITYFS=y
398CONFIG_CRYPTO_USER=y
399CONFIG_CRYPTO_NULL=y
400CONFIG_CRYPTO_CRYPTD=y
401CONFIG_CRYPTO_CCM=y
402CONFIG_CRYPTO_GCM=y
403CONFIG_CRYPTO_CTS=y
404CONFIG_CRYPTO_LRW=y
405CONFIG_CRYPTO_PCBC=y
406CONFIG_CRYPTO_XTS=y
407CONFIG_CRYPTO_XCBC=y
408CONFIG_CRYPTO_VMAC=y
409CONFIG_CRYPTO_MD4=y
410CONFIG_CRYPTO_MICHAEL_MIC=y
411CONFIG_CRYPTO_RMD128=y
412CONFIG_CRYPTO_RMD160=y
413CONFIG_CRYPTO_RMD256=y
414CONFIG_CRYPTO_RMD320=y
415CONFIG_CRYPTO_SHA256=y
416CONFIG_CRYPTO_SHA512=y
417CONFIG_CRYPTO_TGR192=y
418CONFIG_CRYPTO_WP512=y
419CONFIG_CRYPTO_ANUBIS=y
420CONFIG_CRYPTO_BLOWFISH=y
421CONFIG_CRYPTO_CAMELLIA=y
422CONFIG_CRYPTO_CAST5=y
423CONFIG_CRYPTO_CAST6=y
424CONFIG_CRYPTO_FCRYPT=y
425CONFIG_CRYPTO_KHAZAD=y
426CONFIG_CRYPTO_SALSA20=y
427CONFIG_CRYPTO_SEED=y
428CONFIG_CRYPTO_SERPENT=y
429CONFIG_CRYPTO_TEA=y
430CONFIG_CRYPTO_TWOFISH=y
431CONFIG_CRYPTO_ZLIB=y
432CONFIG_CRYPTO_LZO=y
433CONFIG_CRYPTO_USER_API_HASH=y
434CONFIG_CRYPTO_USER_API_SKCIPHER=y
diff --git a/arch/mips/configs/db1300_defconfig b/arch/mips/configs/db1300_defconfig
deleted file mode 100644
index 3590ab5d9791..000000000000
--- a/arch/mips/configs/db1300_defconfig
+++ /dev/null
@@ -1,391 +0,0 @@
1CONFIG_MIPS=y
2CONFIG_MIPS_ALCHEMY=y
3CONFIG_ALCHEMY_GPIOINT_AU1300=y
4CONFIG_MIPS_DB1300=y
5CONFIG_SOC_AU1300=y
6CONFIG_RWSEM_GENERIC_SPINLOCK=y
7CONFIG_ARCH_SUPPORTS_OPROFILE=y
8CONFIG_GENERIC_HWEIGHT=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_CMOS_UPDATE=y
12CONFIG_SCHED_OMIT_FRAME_POINTER=y
13CONFIG_CEVT_R4K_LIB=y
14CONFIG_CSRC_R4K_LIB=y
15CONFIG_DMA_COHERENT=y
16CONFIG_SYS_HAS_EARLY_PRINTK=y
17CONFIG_MIPS_DISABLE_OBSOLETE_IDE=y
18CONFIG_GENERIC_GPIO=y
19CONFIG_CPU_LITTLE_ENDIAN=y
20CONFIG_SYS_SUPPORTS_APM_EMULATION=y
21CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
22CONFIG_IRQ_CPU=y
23CONFIG_MIPS_L1_CACHE_SHIFT=5
24CONFIG_CPU_MIPS32_R1=y
25CONFIG_SYS_SUPPORTS_ZBOOT=y
26CONFIG_SYS_HAS_CPU_MIPS32_R1=y
27CONFIG_CPU_MIPS32=y
28CONFIG_CPU_MIPSR1=y
29CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
30CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
31CONFIG_HARDWARE_WATCHPOINTS=y
32CONFIG_32BIT=y
33CONFIG_PAGE_SIZE_4KB=y
34CONFIG_FORCE_MAX_ZONEORDER=11
35CONFIG_CPU_HAS_PREFETCH=y
36CONFIG_MIPS_MT_DISABLED=y
37CONFIG_64BIT_PHYS_ADDR=y
38CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
39CONFIG_CPU_HAS_SYNC=y
40CONFIG_CPU_SUPPORTS_HIGHMEM=y
41CONFIG_ARCH_FLATMEM_ENABLE=y
42CONFIG_ARCH_POPULATES_NODE_MAP=y
43CONFIG_SELECT_MEMORY_MODEL=y
44CONFIG_FLATMEM_MANUAL=y
45CONFIG_FLATMEM=y
46CONFIG_FLAT_NODE_MEM_MAP=y
47CONFIG_PAGEFLAGS_EXTENDED=y
48CONFIG_SPLIT_PTLOCK_CPUS=4
49CONFIG_COMPACTION=y
50CONFIG_MIGRATION=y
51CONFIG_PHYS_ADDR_T_64BIT=y
52CONFIG_ZONE_DMA_FLAG=0
53CONFIG_VIRT_TO_BUS=y
54CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
55CONFIG_NEED_PER_CPU_KM=y
56CONFIG_TICK_ONESHOT=y
57CONFIG_NO_HZ=y
58CONFIG_HIGH_RES_TIMERS=y
59CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
60CONFIG_HZ_100=y
61CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
62CONFIG_HZ=100
63CONFIG_PREEMPT_NONE=y
64CONFIG_LOCKDEP_SUPPORT=y
65CONFIG_STACKTRACE_SUPPORT=y
66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
68CONFIG_HAVE_IRQ_WORK=y
69CONFIG_EXPERIMENTAL=y
70CONFIG_BROKEN_ON_SMP=y
71CONFIG_INIT_ENV_ARG_LIMIT=32
72CONFIG_CROSS_COMPILE=""
73CONFIG_LOCALVERSION="-db1300"
74CONFIG_LOCALVERSION_AUTO=y
75CONFIG_HAVE_KERNEL_GZIP=y
76CONFIG_HAVE_KERNEL_BZIP2=y
77CONFIG_HAVE_KERNEL_LZMA=y
78CONFIG_HAVE_KERNEL_LZO=y
79CONFIG_KERNEL_LZMA=y
80CONFIG_SWAP=y
81CONFIG_SYSVIPC=y
82CONFIG_SYSVIPC_SYSCTL=y
83CONFIG_POSIX_MQUEUE=y
84CONFIG_POSIX_MQUEUE_SYSCTL=y
85CONFIG_FHANDLE=y
86CONFIG_HAVE_GENERIC_HARDIRQS=y
87CONFIG_GENERIC_HARDIRQS=y
88CONFIG_GENERIC_IRQ_PROBE=y
89CONFIG_GENERIC_IRQ_SHOW=y
90CONFIG_TINY_RCU=y
91CONFIG_LOG_BUF_SHIFT=19
92CONFIG_NAMESPACES=y
93CONFIG_UTS_NS=y
94CONFIG_IPC_NS=y
95CONFIG_USER_NS=y
96CONFIG_PID_NS=y
97CONFIG_NET_NS=y
98CONFIG_SYSCTL=y
99CONFIG_ANON_INODES=y
100CONFIG_EXPERT=y
101CONFIG_SYSCTL_SYSCALL=y
102CONFIG_KALLSYMS=y
103CONFIG_KALLSYMS_ALL=y
104CONFIG_HOTPLUG=y
105CONFIG_PRINTK=y
106CONFIG_BUG=y
107CONFIG_ELF_CORE=y
108CONFIG_BASE_FULL=y
109CONFIG_FUTEX=y
110CONFIG_EPOLL=y
111CONFIG_SIGNALFD=y
112CONFIG_TIMERFD=y
113CONFIG_EVENTFD=y
114CONFIG_SHMEM=y
115CONFIG_AIO=y
116CONFIG_EMBEDDED=y
117CONFIG_HAVE_PERF_EVENTS=y
118CONFIG_PERF_USE_VMALLOC=y
119CONFIG_SLAB=y
120CONFIG_HAVE_OPROFILE=y
121CONFIG_HAVE_KPROBES=y
122CONFIG_HAVE_KRETPROBES=y
123CONFIG_HAVE_DMA_ATTRS=y
124CONFIG_HAVE_DMA_API_DEBUG=y
125CONFIG_HAVE_ARCH_JUMP_LABEL=y
126CONFIG_HAVE_GENERIC_DMA_COHERENT=y
127CONFIG_SLABINFO=y
128CONFIG_RT_MUTEXES=y
129CONFIG_BASE_SMALL=0
130CONFIG_BLOCK=y
131CONFIG_LBDAF=y
132CONFIG_BLK_DEV_BSG=y
133CONFIG_IOSCHED_NOOP=y
134CONFIG_DEFAULT_NOOP=y
135CONFIG_DEFAULT_IOSCHED="noop"
136# CONFIG_UNINLINE_SPIN_UNLOCK is not set
137CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
138CONFIG_INLINE_READ_UNLOCK=y
139CONFIG_INLINE_READ_UNLOCK_IRQ=y
140CONFIG_INLINE_WRITE_UNLOCK=y
141CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
142CONFIG_MMU=y
143CONFIG_PCCARD=y
144CONFIG_PCMCIA=y
145CONFIG_PCMCIA_LOAD_CIS=y
146CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
147CONFIG_BINFMT_ELF=y
148CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
149CONFIG_TRAD_SIGNALS=y
150CONFIG_ARCH_HIBERNATION_POSSIBLE=y
151CONFIG_ARCH_SUSPEND_POSSIBLE=y
152CONFIG_NET=y
153CONFIG_PACKET=y
154CONFIG_UNIX=y
155CONFIG_XFRM=y
156CONFIG_INET=y
157CONFIG_IP_MULTICAST=y
158CONFIG_IP_PNP=y
159CONFIG_IP_PNP_DHCP=y
160CONFIG_IP_PNP_BOOTP=y
161CONFIG_IP_PNP_RARP=y
162CONFIG_INET_TUNNEL=y
163CONFIG_TCP_CONG_CUBIC=y
164CONFIG_DEFAULT_TCP_CONG="cubic"
165CONFIG_IPV6=y
166CONFIG_INET6_XFRM_MODE_TRANSPORT=y
167CONFIG_INET6_XFRM_MODE_TUNNEL=y
168CONFIG_INET6_XFRM_MODE_BEET=y
169CONFIG_IPV6_SIT=y
170CONFIG_IPV6_NDISC_NODETYPE=y
171CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
172CONFIG_STANDALONE=y
173CONFIG_PREVENT_FIRMWARE_BUILD=y
174CONFIG_FW_LOADER=y
175CONFIG_FIRMWARE_IN_KERNEL=y
176CONFIG_EXTRA_FIRMWARE=""
177CONFIG_MTD=y
178CONFIG_MTD_CMDLINE_PARTS=y
179CONFIG_MTD_CHAR=y
180CONFIG_MTD_BLKDEVS=y
181CONFIG_MTD_BLOCK=y
182CONFIG_MTD_CFI=y
183CONFIG_MTD_GEN_PROBE=y
184CONFIG_MTD_MAP_BANK_WIDTH_1=y
185CONFIG_MTD_MAP_BANK_WIDTH_2=y
186CONFIG_MTD_MAP_BANK_WIDTH_4=y
187CONFIG_MTD_CFI_I1=y
188CONFIG_MTD_CFI_I2=y
189CONFIG_MTD_CFI_AMDSTD=y
190CONFIG_MTD_CFI_UTIL=y
191CONFIG_MTD_PHYSMAP=y
192CONFIG_MTD_NAND_ECC=y
193CONFIG_MTD_NAND=y
194CONFIG_MTD_NAND_IDS=y
195CONFIG_MTD_NAND_PLATFORM=y
196CONFIG_BLK_DEV=y
197CONFIG_BLK_DEV_LOOP=y
198CONFIG_BLK_DEV_UB=y
199CONFIG_HAVE_IDE=y
200CONFIG_IDE=y
201CONFIG_IDE_GD=y
202CONFIG_IDE_GD_ATA=y
203CONFIG_BLK_DEV_IDECS=y
204CONFIG_IDE_TASK_IOCTL=y
205CONFIG_IDE_PROC_FS=y
206CONFIG_BLK_DEV_PLATFORM=y
207CONFIG_SCSI_MOD=y
208CONFIG_NETDEVICES=y
209CONFIG_MII=y
210CONFIG_PHYLIB=y
211CONFIG_SMSC_PHY=y
212CONFIG_NET_ETHERNET=y
213CONFIG_SMSC911X=y
214CONFIG_INPUT=y
215CONFIG_INPUT_EVDEV=y
216CONFIG_INPUT_KEYBOARD=y
217CONFIG_KEYBOARD_GPIO=y
218CONFIG_INPUT_TOUCHSCREEN=y
219CONFIG_TOUCHSCREEN_WM97XX=y
220CONFIG_TOUCHSCREEN_WM9712=y
221CONFIG_TOUCHSCREEN_WM9713=y
222CONFIG_INPUT_MISC=y
223CONFIG_INPUT_UINPUT=y
224CONFIG_VT=y
225CONFIG_CONSOLE_TRANSLATIONS=y
226CONFIG_VT_CONSOLE=y
227CONFIG_HW_CONSOLE=y
228CONFIG_VT_HW_CONSOLE_BINDING=y
229CONFIG_UNIX98_PTYS=y
230CONFIG_SERIAL_8250=y
231CONFIG_SERIAL_8250_CONSOLE=y
232CONFIG_SERIAL_8250_NR_UARTS=4
233CONFIG_SERIAL_8250_RUNTIME_UARTS=4
234CONFIG_SERIAL_CORE=y
235CONFIG_SERIAL_CORE_CONSOLE=y
236CONFIG_I2C=y
237CONFIG_I2C_BOARDINFO=y
238CONFIG_I2C_CHARDEV=y
239CONFIG_I2C_SMBUS=y
240CONFIG_I2C_AU1550=y
241CONFIG_SPI=y
242CONFIG_SPI_MASTER=y
243CONFIG_SPI_AU1550=y
244CONFIG_SPI_BITBANG=y
245CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
246CONFIG_HWMON=y
247CONFIG_HWMON_VID=y
248CONFIG_SENSORS_ADM1025=y
249CONFIG_FB=y
250CONFIG_FB_AU1200=y
251CONFIG_DUMMY_CONSOLE=y
252CONFIG_FRAMEBUFFER_CONSOLE=y
253CONFIG_FONTS=y
254CONFIG_FONT_ACORN_8x8=y
255CONFIG_LOGO=y
256CONFIG_LOGO_LINUX_CLUT224=y
257CONFIG_SOUND=y
258CONFIG_SND=y
259CONFIG_SND_TIMER=y
260CONFIG_SND_PCM=y
261CONFIG_SND_JACK=y
262CONFIG_SND_HRTIMER=y
263CONFIG_SND_DYNAMIC_MINORS=y
264CONFIG_SND_VERBOSE_PROCFS=y
265CONFIG_SND_VERBOSE_PRINTK=y
266CONFIG_SND_VMASTER=y
267CONFIG_SND_AC97_CODEC=y
268CONFIG_SND_SOC=y
269CONFIG_SND_SOC_CACHE_LZO=y
270CONFIG_SND_SOC_AC97_BUS=y
271CONFIG_SND_SOC_AU1XPSC=y
272CONFIG_SND_SOC_AU1XPSC_I2S=y
273CONFIG_SND_SOC_AU1XPSC_AC97=y
274CONFIG_SND_SOC_DB1300=y
275CONFIG_SND_SOC_I2C_AND_SPI=y
276CONFIG_SND_SOC_WM8731=y
277CONFIG_SND_SOC_WM9712=y
278CONFIG_AC97_BUS=y
279CONFIG_HID_SUPPORT=y
280CONFIG_HID=y
281CONFIG_HIDRAW=y
282CONFIG_USB_HID=y
283CONFIG_USB_HIDDEV=y
284CONFIG_USB_SUPPORT=y
285CONFIG_USB_ARCH_HAS_HCD=y
286CONFIG_USB_ARCH_HAS_OHCI=y
287CONFIG_USB_ARCH_HAS_EHCI=y
288CONFIG_USB=y
289CONFIG_USB_DYNAMIC_MINORS=y
290CONFIG_USB_EHCI_HCD=y
291CONFIG_USB_EHCI_ROOT_HUB_TT=y
292CONFIG_USB_EHCI_TT_NEWSCHED=y
293CONFIG_USB_OHCI_HCD=y
294CONFIG_USB_OHCI_LITTLE_ENDIAN=y
295CONFIG_RTC_LIB=y
296CONFIG_RTC_CLASS=y
297CONFIG_RTC_HCTOSYS=y
298CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
299CONFIG_RTC_INTF_SYSFS=y
300CONFIG_RTC_INTF_PROC=y
301CONFIG_RTC_INTF_DEV=y
302CONFIG_RTC_INTF_DEV_UIE_EMUL=y
303CONFIG_RTC_DRV_AU1XXX=y
304CONFIG_EXT2_FS=y
305CONFIG_FS_POSIX_ACL=y
306CONFIG_EXPORTFS=y
307CONFIG_FILE_LOCKING=y
308CONFIG_FSNOTIFY=y
309CONFIG_DNOTIFY=y
310CONFIG_INOTIFY_USER=y
311CONFIG_GENERIC_ACL=y
312CONFIG_FAT_FS=y
313CONFIG_VFAT_FS=y
314CONFIG_FAT_DEFAULT_CODEPAGE=437
315CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
316CONFIG_PROC_FS=y
317CONFIG_PROC_SYSCTL=y
318CONFIG_PROC_PAGE_MONITOR=y
319CONFIG_SYSFS=y
320CONFIG_TMPFS=y
321CONFIG_TMPFS_POSIX_ACL=y
322CONFIG_TMPFS_XATTR=y
323CONFIG_MISC_FILESYSTEMS=y
324CONFIG_JFFS2_FS=y
325CONFIG_JFFS2_FS_DEBUG=0
326CONFIG_JFFS2_FS_WRITEBUFFER=y
327CONFIG_JFFS2_SUMMARY=y
328CONFIG_JFFS2_FS_XATTR=y
329CONFIG_JFFS2_FS_POSIX_ACL=y
330CONFIG_JFFS2_FS_SECURITY=y
331CONFIG_JFFS2_COMPRESSION_OPTIONS=y
332CONFIG_JFFS2_ZLIB=y
333CONFIG_JFFS2_LZO=y
334CONFIG_JFFS2_RTIME=y
335CONFIG_JFFS2_RUBIN=y
336CONFIG_JFFS2_CMODE_PRIORITY=y
337CONFIG_SQUASHFS=y
338CONFIG_SQUASHFS_XZ=y
339CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
340CONFIG_NETWORK_FILESYSTEMS=y
341CONFIG_NFS_FS=y
342CONFIG_NFS_V3=y
343CONFIG_ROOT_NFS=y
344CONFIG_LOCKD=y
345CONFIG_LOCKD_V4=y
346CONFIG_NFS_COMMON=y
347CONFIG_SUNRPC=y
348CONFIG_MSDOS_PARTITION=y
349CONFIG_NLS=y
350CONFIG_NLS_DEFAULT="iso8859-1"
351CONFIG_NLS_CODEPAGE_437=y
352CONFIG_NLS_CODEPAGE_850=y
353CONFIG_NLS_ASCII=y
354CONFIG_NLS_ISO8859_1=y
355CONFIG_NLS_ISO8859_15=y
356CONFIG_NLS_UTF8=y
357CONFIG_TRACE_IRQFLAGS_SUPPORT=y
358CONFIG_PRINTK_TIME=y
359CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
360CONFIG_ENABLE_WARN_DEPRECATED=y
361CONFIG_ENABLE_MUST_CHECK=y
362CONFIG_FRAME_WARN=1024
363CONFIG_MAGIC_SYSRQ=y
364CONFIG_STRIP_ASM_SYMS=y
365CONFIG_HAVE_FUNCTION_TRACER=y
366CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
367CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
368CONFIG_HAVE_DYNAMIC_FTRACE=y
369CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
370CONFIG_HAVE_C_RECORDMCOUNT=y
371CONFIG_TRACING_SUPPORT=y
372CONFIG_HAVE_ARCH_KGDB=y
373CONFIG_EARLY_PRINTK=y
374CONFIG_CMDLINE_BOOL=y
375CONFIG_CMDLINE="video=au1200fb:panel:bs console=tty console=ttyS2,115200"
376CONFIG_DEBUG_ZBOOT=y
377CONFIG_DEFAULT_SECURITY_DAC=y
378CONFIG_DEFAULT_SECURITY=""
379CONFIG_CRYPTO=y
380CONFIG_BITREVERSE=y
381CONFIG_CRC32=y
382CONFIG_ZLIB_INFLATE=y
383CONFIG_ZLIB_DEFLATE=y
384CONFIG_LZO_COMPRESS=y
385CONFIG_LZO_DECOMPRESS=y
386CONFIG_XZ_DEC=y
387CONFIG_HAS_IOMEM=y
388CONFIG_HAS_IOPORT=y
389CONFIG_HAS_DMA=y
390CONFIG_NLATTR=y
391CONFIG_GENERIC_ATOMIC64=y
diff --git a/arch/mips/configs/db1550_defconfig b/arch/mips/configs/db1550_defconfig
deleted file mode 100644
index 36cda27725e7..000000000000
--- a/arch/mips/configs/db1550_defconfig
+++ /dev/null
@@ -1,285 +0,0 @@
1CONFIG_MIPS=y
2CONFIG_MIPS_ALCHEMY=y
3CONFIG_MIPS_DB1550=y
4CONFIG_SCHED_OMIT_FRAME_POINTER=y
5CONFIG_GENERIC_GPIO=y
6CONFIG_TICK_ONESHOT=y
7CONFIG_NO_HZ=y
8CONFIG_HIGH_RES_TIMERS=y
9CONFIG_HZ_100=y
10CONFIG_HZ=100
11CONFIG_EXPERIMENTAL=y
12CONFIG_BROKEN_ON_SMP=y
13CONFIG_INIT_ENV_ARG_LIMIT=32
14CONFIG_LOCALVERSION="-db1550"
15CONFIG_LOCALVERSION_AUTO=y
16CONFIG_KERNEL_LZMA=y
17CONFIG_DEFAULT_HOSTNAME="db1550"
18CONFIG_SWAP=y
19CONFIG_SYSVIPC=y
20CONFIG_SYSVIPC_SYSCTL=y
21CONFIG_POSIX_MQUEUE=y
22CONFIG_POSIX_MQUEUE_SYSCTL=y
23CONFIG_FHANDLE=y
24CONFIG_AUDIT=y
25CONFIG_TINY_RCU=y
26CONFIG_LOG_BUF_SHIFT=18
27CONFIG_NAMESPACES=y
28CONFIG_UTS_NS=y
29CONFIG_IPC_NS=y
30CONFIG_USER_NS=y
31CONFIG_PID_NS=y
32CONFIG_NET_NS=y
33CONFIG_EXPERT=y
34CONFIG_HOTPLUG=y
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_ELF_CORE=y
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41CONFIG_SIGNALFD=y
42CONFIG_TIMERFD=y
43CONFIG_EVENTFD=y
44CONFIG_SHMEM=y
45CONFIG_AIO=y
46CONFIG_EMBEDDED=y
47CONFIG_PCI_QUIRKS=y
48CONFIG_SLAB=y
49CONFIG_BLOCK=y
50CONFIG_LBDAF=y
51CONFIG_BLK_DEV_BSG=y
52CONFIG_BLK_DEV_BSGLIB=y
53CONFIG_IOSCHED_NOOP=y
54CONFIG_DEFAULT_NOOP=y
55CONFIG_DEFAULT_IOSCHED="noop"
56CONFIG_PCI=y
57CONFIG_PCCARD=y
58CONFIG_PCMCIA=y
59CONFIG_PCMCIA_LOAD_CIS=y
60CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
61CONFIG_BINFMT_ELF=y
62CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
63CONFIG_BINFMT_MISC=y
64CONFIG_SUSPEND=y
65CONFIG_SUSPEND_FREEZER=y
66CONFIG_PM_SLEEP=y
67CONFIG_PM_RUNTIME=y
68CONFIG_PM=y
69CONFIG_NET=y
70CONFIG_PACKET=y
71CONFIG_UNIX=y
72CONFIG_XFRM=y
73CONFIG_INET=y
74CONFIG_IP_MULTICAST=y
75CONFIG_IP_PNP=y
76CONFIG_IP_PNP_DHCP=y
77CONFIG_IP_PNP_BOOTP=y
78CONFIG_IP_PNP_RARP=y
79CONFIG_INET_TUNNEL=y
80CONFIG_INET_LRO=y
81CONFIG_TCP_CONG_CUBIC=y
82CONFIG_DEFAULT_TCP_CONG="cubic"
83CONFIG_IPV6=y
84CONFIG_INET6_XFRM_MODE_TRANSPORT=y
85CONFIG_INET6_XFRM_MODE_TUNNEL=y
86CONFIG_INET6_XFRM_MODE_BEET=y
87CONFIG_IPV6_SIT=y
88CONFIG_IPV6_NDISC_NODETYPE=y
89CONFIG_DNS_RESOLVER=y
90CONFIG_UEVENT_HELPER_PATH=""
91CONFIG_STANDALONE=y
92CONFIG_PREVENT_FIRMWARE_BUILD=y
93CONFIG_FW_LOADER=y
94CONFIG_FIRMWARE_IN_KERNEL=y
95CONFIG_MTD=y
96CONFIG_MTD_CHAR=y
97CONFIG_MTD_BLKDEVS=y
98CONFIG_MTD_BLOCK=y
99CONFIG_MTD_CFI=y
100CONFIG_MTD_GEN_PROBE=y
101CONFIG_MTD_MAP_BANK_WIDTH_1=y
102CONFIG_MTD_MAP_BANK_WIDTH_2=y
103CONFIG_MTD_MAP_BANK_WIDTH_4=y
104CONFIG_MTD_CFI_I1=y
105CONFIG_MTD_CFI_I2=y
106CONFIG_MTD_CFI_AMDSTD=y
107CONFIG_MTD_CFI_UTIL=y
108CONFIG_MTD_PHYSMAP=y
109CONFIG_MTD_M25P80=y
110CONFIG_MTD_NAND_ECC=y
111CONFIG_MTD_NAND=y
112CONFIG_MTD_NAND_IDS=y
113CONFIG_MTD_NAND_PLATFORM=y
114CONFIG_MISC_DEVICES=y
115CONFIG_EEPROM_AT24=y
116CONFIG_SCSI_MOD=y
117CONFIG_SCSI=y
118CONFIG_SCSI_DMA=y
119CONFIG_BLK_DEV_SD=y
120CONFIG_CHR_DEV_SG=y
121CONFIG_SCSI_MULTI_LUN=y
122CONFIG_SCSI_SCAN_ASYNC=y
123CONFIG_ATA=y
124CONFIG_ATA_SFF=y
125CONFIG_ATA_BMDMA=y
126CONFIG_PATA_HPT37X=y
127CONFIG_PATA_PCMCIA=y
128CONFIG_MD=y
129CONFIG_BLK_DEV_DM=y
130CONFIG_NETDEVICES=y
131CONFIG_MII=y
132CONFIG_PHYLIB=y
133CONFIG_NET_ETHERNET=y
134CONFIG_MIPS_AU1X00_ENET=y
135CONFIG_NET_PCMCIA=y
136CONFIG_PCMCIA_3C589=y
137CONFIG_PCMCIA_PCNET=y
138CONFIG_INPUT=y
139CONFIG_INPUT_EVDEV=y
140CONFIG_VT=y
141CONFIG_CONSOLE_TRANSLATIONS=y
142CONFIG_VT_CONSOLE=y
143CONFIG_HW_CONSOLE=y
144CONFIG_UNIX98_PTYS=y
145CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
146CONFIG_DEVKMEM=y
147CONFIG_SERIAL_8250=y
148CONFIG_SERIAL_8250_CONSOLE=y
149CONFIG_SERIAL_8250_NR_UARTS=4
150CONFIG_SERIAL_8250_RUNTIME_UARTS=4
151CONFIG_SERIAL_CORE=y
152CONFIG_SERIAL_CORE_CONSOLE=y
153CONFIG_DEVPORT=y
154CONFIG_I2C=y
155CONFIG_I2C_BOARDINFO=y
156CONFIG_I2C_CHARDEV=y
157CONFIG_I2C_AU1550=y
158CONFIG_SPI=y
159CONFIG_SPI_MASTER=y
160CONFIG_SPI_AU1550=y
161CONFIG_SPI_BITBANG=y
162CONFIG_HWMON=y
163CONFIG_SENSORS_ADM1025=y
164CONFIG_SENSORS_LM70=y
165CONFIG_DUMMY_CONSOLE=y
166CONFIG_SOUND=y
167CONFIG_SND=y
168CONFIG_SND_TIMER=y
169CONFIG_SND_PCM=y
170CONFIG_SND_JACK=y
171CONFIG_SND_VMASTER=y
172CONFIG_SND_AC97_CODEC=y
173CONFIG_SND_SOC=y
174CONFIG_SND_SOC_AC97_BUS=y
175CONFIG_SND_SOC_AU1XPSC=y
176CONFIG_SND_SOC_AU1XPSC_I2S=y
177CONFIG_SND_SOC_AU1XPSC_AC97=y
178CONFIG_SND_SOC_DB1200=y
179CONFIG_SND_SOC_I2C_AND_SPI=y
180CONFIG_SND_SOC_AC97_CODEC=y
181CONFIG_SND_SOC_WM8731=y
182CONFIG_SND_SOC_WM9712=y
183CONFIG_AC97_BUS=y
184CONFIG_USB=y
185CONFIG_USB_DYNAMIC_MINORS=y
186CONFIG_USB_EHCI_HCD=y
187CONFIG_USB_EHCI_ROOT_HUB_TT=y
188CONFIG_USB_EHCI_TT_NEWSCHED=y
189CONFIG_USB_OHCI_HCD=y
190CONFIG_USB_OHCI_LITTLE_ENDIAN=y
191CONFIG_USB_UHCI_HCD=y
192CONFIG_USB_STORAGE=y
193CONFIG_RTC_LIB=y
194CONFIG_RTC_CLASS=y
195CONFIG_RTC_HCTOSYS=y
196CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
197CONFIG_RTC_INTF_SYSFS=y
198CONFIG_RTC_INTF_PROC=y
199CONFIG_RTC_INTF_DEV=y
200CONFIG_RTC_DRV_AU1XXX=y
201CONFIG_EXT4_FS=y
202CONFIG_EXT4_USE_FOR_EXT23=y
203CONFIG_EXT4_FS_XATTR=y
204CONFIG_EXT4_FS_POSIX_ACL=y
205CONFIG_EXT4_FS_SECURITY=y
206CONFIG_JBD2=y
207CONFIG_FS_MBCACHE=y
208CONFIG_FS_POSIX_ACL=y
209CONFIG_EXPORTFS=y
210CONFIG_FILE_LOCKING=y
211CONFIG_FSNOTIFY=y
212CONFIG_DNOTIFY=y
213CONFIG_INOTIFY_USER=y
214CONFIG_PROC_FS=y
215CONFIG_PROC_SYSCTL=y
216CONFIG_SYSFS=y
217CONFIG_TMPFS=y
218CONFIG_CONFIGFS_FS=y
219CONFIG_MISC_FILESYSTEMS=y
220CONFIG_JFFS2_FS=y
221CONFIG_JFFS2_FS_DEBUG=0
222CONFIG_JFFS2_FS_WRITEBUFFER=y
223CONFIG_JFFS2_SUMMARY=y
224CONFIG_JFFS2_FS_XATTR=y
225CONFIG_JFFS2_COMPRESSION_OPTIONS=y
226CONFIG_JFFS2_ZLIB=y
227CONFIG_JFFS2_LZO=y
228CONFIG_JFFS2_RTIME=y
229CONFIG_JFFS2_RUBIN=y
230CONFIG_JFFS2_CMODE_PRIORITY=y
231CONFIG_SQUASHFS=y
232CONFIG_SQUASHFS_ZLIB=y
233CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
234CONFIG_NETWORK_FILESYSTEMS=y
235CONFIG_NFS_FS=y
236CONFIG_NFS_V3=y
237CONFIG_NFS_V3_ACL=y
238CONFIG_NFS_V4=y
239CONFIG_NFS_V4_1=y
240CONFIG_PNFS_FILE_LAYOUT=y
241CONFIG_PNFS_BLOCK=y
242CONFIG_ROOT_NFS=y
243CONFIG_NFS_USE_KERNEL_DNS=y
244CONFIG_NFS_USE_NEW_IDMAPPER=y
245CONFIG_NFSD=y
246CONFIG_NFSD_V2_ACL=y
247CONFIG_NFSD_V3=y
248CONFIG_NFSD_V3_ACL=y
249CONFIG_NFSD_V4=y
250CONFIG_LOCKD=y
251CONFIG_LOCKD_V4=y
252CONFIG_NFS_ACL_SUPPORT=y
253CONFIG_NFS_COMMON=y
254CONFIG_SUNRPC=y
255CONFIG_SUNRPC_GSS=y
256CONFIG_SUNRPC_BACKCHANNEL=y
257CONFIG_MSDOS_PARTITION=y
258CONFIG_NLS=y
259CONFIG_NLS_DEFAULT="iso8859-1"
260CONFIG_NLS_CODEPAGE_437=y
261CONFIG_NLS_CODEPAGE_850=y
262CONFIG_NLS_CODEPAGE_852=y
263CONFIG_NLS_CODEPAGE_1250=y
264CONFIG_NLS_ASCII=y
265CONFIG_NLS_ISO8859_1=y
266CONFIG_NLS_ISO8859_15=y
267CONFIG_NLS_UTF8=y
268CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
269CONFIG_FRAME_WARN=1024
270CONFIG_CMDLINE_BOOL=y
271CONFIG_CMDLINE="noirqdebug console=ttyS0,115200 root=/dev/sda1 rootfstype=ext4"
272CONFIG_KEYS=y
273CONFIG_SECURITYFS=y
274CONFIG_DEFAULT_SECURITY_DAC=y
275CONFIG_BITREVERSE=y
276CONFIG_CRC16=y
277CONFIG_CRC_ITU_T=y
278CONFIG_CRC32=y
279CONFIG_AUDIT_GENERIC=y
280CONFIG_ZLIB_INFLATE=y
281CONFIG_ZLIB_DEFLATE=y
282CONFIG_LZO_COMPRESS=y
283CONFIG_LZO_DECOMPRESS=y
284CONFIG_BCH=y
285CONFIG_NLATTR=y
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig
deleted file mode 100644
index 75eb1b1f316c..000000000000
--- a/arch/mips/configs/pb1100_defconfig
+++ /dev/null
@@ -1,124 +0,0 @@
1CONFIG_MIPS_ALCHEMY=y
2CONFIG_MIPS_PB1100=y
3CONFIG_NO_HZ=y
4CONFIG_HIGH_RES_TIMERS=y
5CONFIG_HZ_100=y
6# CONFIG_SECCOMP is not set
7CONFIG_EXPERIMENTAL=y
8CONFIG_LOCALVERSION="-pb1100"
9CONFIG_KERNEL_LZMA=y
10CONFIG_SYSVIPC=y
11CONFIG_POSIX_MQUEUE=y
12CONFIG_TINY_RCU=y
13CONFIG_LOG_BUF_SHIFT=14
14CONFIG_EXPERT=y
15# CONFIG_SYSCTL_SYSCALL is not set
16# CONFIG_KALLSYMS is not set
17# CONFIG_PCSPKR_PLATFORM is not set
18# CONFIG_VM_EVENT_COUNTERS is not set
19# CONFIG_COMPAT_BRK is not set
20CONFIG_SLAB=y
21CONFIG_MODULES=y
22CONFIG_MODULE_UNLOAD=y
23# CONFIG_LBDAF is not set
24# CONFIG_BLK_DEV_BSG is not set
25# CONFIG_IOSCHED_DEADLINE is not set
26# CONFIG_IOSCHED_CFQ is not set
27CONFIG_PCCARD=y
28CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
29CONFIG_PM=y
30CONFIG_PM_RUNTIME=y
31CONFIG_NET=y
32CONFIG_PACKET=y
33CONFIG_UNIX=y
34CONFIG_INET=y
35CONFIG_IP_MULTICAST=y
36CONFIG_IP_PNP=y
37CONFIG_IP_PNP_DHCP=y
38CONFIG_IP_PNP_BOOTP=y
39CONFIG_IP_PNP_RARP=y
40# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
41# CONFIG_INET_XFRM_MODE_TUNNEL is not set
42# CONFIG_INET_XFRM_MODE_BEET is not set
43# CONFIG_INET_DIAG is not set
44# CONFIG_IPV6 is not set
45# CONFIG_WIRELESS is not set
46CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
47CONFIG_MTD=y
48CONFIG_MTD_PARTITIONS=y
49CONFIG_MTD_CHAR=y
50CONFIG_MTD_BLOCK=y
51CONFIG_MTD_CFI=y
52CONFIG_MTD_CFI_AMDSTD=y
53CONFIG_MTD_PHYSMAP=y
54CONFIG_BLK_DEV_LOOP=y
55CONFIG_BLK_DEV_UB=y
56# CONFIG_MISC_DEVICES is not set
57CONFIG_IDE=y
58CONFIG_BLK_DEV_IDECS=y
59CONFIG_IDE_TASK_IOCTL=y
60# CONFIG_IDE_PROC_FS is not set
61CONFIG_NETDEVICES=y
62CONFIG_MARVELL_PHY=y
63CONFIG_DAVICOM_PHY=y
64CONFIG_QSEMI_PHY=y
65CONFIG_LXT_PHY=y
66CONFIG_CICADA_PHY=y
67CONFIG_VITESSE_PHY=y
68CONFIG_SMSC_PHY=y
69CONFIG_BROADCOM_PHY=y
70CONFIG_ICPLUS_PHY=y
71CONFIG_REALTEK_PHY=y
72CONFIG_NATIONAL_PHY=y
73CONFIG_STE10XP=y
74CONFIG_LSI_ET1011C_PHY=y
75CONFIG_NET_ETHERNET=y
76CONFIG_MII=y
77CONFIG_MIPS_AU1X00_ENET=y
78# CONFIG_NETDEV_1000 is not set
79# CONFIG_NETDEV_10000 is not set
80# CONFIG_WLAN is not set
81# CONFIG_INPUT_MOUSEDEV is not set
82CONFIG_INPUT_EVDEV=y
83# CONFIG_INPUT_KEYBOARD is not set
84# CONFIG_INPUT_MOUSE is not set
85# CONFIG_SERIO is not set
86CONFIG_VT_HW_CONSOLE_BINDING=y
87CONFIG_SERIAL_8250=y
88CONFIG_SERIAL_8250_CONSOLE=y
89# CONFIG_LEGACY_PTYS is not set
90# CONFIG_HW_RANDOM is not set
91# CONFIG_HWMON is not set
92# CONFIG_VGA_CONSOLE is not set
93CONFIG_HIDRAW=y
94CONFIG_USB_HIDDEV=y
95CONFIG_USB=y
96# CONFIG_USB_DEVICE_CLASS is not set
97CONFIG_USB_DYNAMIC_MINORS=y
98CONFIG_USB_SUSPEND=y
99CONFIG_USB_OHCI_HCD=y
100CONFIG_RTC_CLASS=y
101CONFIG_RTC_DRV_AU1XXX=y
102CONFIG_EXT2_FS=y
103# CONFIG_PROC_PAGE_MONITOR is not set
104CONFIG_TMPFS=y
105CONFIG_JFFS2_FS=y
106CONFIG_JFFS2_SUMMARY=y
107CONFIG_JFFS2_FS_XATTR=y
108# CONFIG_JFFS2_FS_POSIX_ACL is not set
109# CONFIG_JFFS2_FS_SECURITY is not set
110CONFIG_JFFS2_COMPRESSION_OPTIONS=y
111CONFIG_JFFS2_LZO=y
112CONFIG_JFFS2_RUBIN=y
113CONFIG_SQUASHFS=y
114CONFIG_NFS_FS=y
115CONFIG_NFS_V3=y
116CONFIG_ROOT_NFS=y
117CONFIG_STRIP_ASM_SYMS=y
118CONFIG_DEBUG_KERNEL=y
119# CONFIG_SCHED_DEBUG is not set
120# CONFIG_FTRACE is not set
121CONFIG_DEBUG_ZBOOT=y
122CONFIG_KEYS=y
123CONFIG_KEYS_DEBUG_PROC_KEYS=y
124CONFIG_SECURITYFS=y
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig
deleted file mode 100644
index fa00487146f8..000000000000
--- a/arch/mips/configs/pb1500_defconfig
+++ /dev/null
@@ -1,141 +0,0 @@
1CONFIG_MIPS_ALCHEMY=y
2CONFIG_MIPS_PB1500=y
3CONFIG_NO_HZ=y
4CONFIG_HIGH_RES_TIMERS=y
5CONFIG_HZ_100=y
6# CONFIG_SECCOMP is not set
7CONFIG_EXPERIMENTAL=y
8CONFIG_LOCALVERSION="-pb1500"
9CONFIG_KERNEL_LZMA=y
10CONFIG_SYSVIPC=y
11CONFIG_POSIX_MQUEUE=y
12CONFIG_TINY_RCU=y
13CONFIG_LOG_BUF_SHIFT=14
14CONFIG_EXPERT=y
15# CONFIG_SYSCTL_SYSCALL is not set
16# CONFIG_KALLSYMS is not set
17# CONFIG_PCSPKR_PLATFORM is not set
18# CONFIG_VM_EVENT_COUNTERS is not set
19# CONFIG_COMPAT_BRK is not set
20CONFIG_SLAB=y
21CONFIG_MODULES=y
22CONFIG_MODULE_UNLOAD=y
23# CONFIG_IOSCHED_DEADLINE is not set
24# CONFIG_IOSCHED_CFQ is not set
25CONFIG_PCI=y
26CONFIG_PCCARD=y
27# CONFIG_CARDBUS is not set
28CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
29CONFIG_PM=y
30CONFIG_PM_RUNTIME=y
31CONFIG_NET=y
32CONFIG_PACKET=y
33CONFIG_UNIX=y
34CONFIG_INET=y
35CONFIG_IP_MULTICAST=y
36CONFIG_IP_PNP=y
37CONFIG_IP_PNP_DHCP=y
38CONFIG_IP_PNP_BOOTP=y
39CONFIG_IP_PNP_RARP=y
40# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
41# CONFIG_INET_XFRM_MODE_TUNNEL is not set
42# CONFIG_INET_XFRM_MODE_BEET is not set
43# CONFIG_INET_DIAG is not set
44# CONFIG_IPV6 is not set
45# CONFIG_WIRELESS is not set
46CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
47CONFIG_MTD=y
48CONFIG_MTD_PARTITIONS=y
49CONFIG_MTD_CHAR=y
50CONFIG_MTD_BLOCK=y
51CONFIG_MTD_CFI=y
52CONFIG_MTD_CFI_AMDSTD=y
53CONFIG_MTD_PHYSMAP=y
54CONFIG_BLK_DEV_LOOP=y
55CONFIG_BLK_DEV_UB=y
56# CONFIG_MISC_DEVICES is not set
57CONFIG_IDE=y
58CONFIG_BLK_DEV_IDECS=y
59CONFIG_BLK_DEV_IDECD=y
60CONFIG_IDE_TASK_IOCTL=y
61# CONFIG_IDEPCI_PCIBUS_ORDER is not set
62CONFIG_BLK_DEV_HPT366=y
63CONFIG_NETDEVICES=y
64CONFIG_MARVELL_PHY=y
65CONFIG_DAVICOM_PHY=y
66CONFIG_QSEMI_PHY=y
67CONFIG_LXT_PHY=y
68CONFIG_CICADA_PHY=y
69CONFIG_VITESSE_PHY=y
70CONFIG_SMSC_PHY=y
71CONFIG_BROADCOM_PHY=y
72CONFIG_ICPLUS_PHY=y
73CONFIG_REALTEK_PHY=y
74CONFIG_NATIONAL_PHY=y
75CONFIG_STE10XP=y
76CONFIG_LSI_ET1011C_PHY=y
77CONFIG_NET_ETHERNET=y
78CONFIG_MII=y
79CONFIG_MIPS_AU1X00_ENET=y
80# CONFIG_NETDEV_1000 is not set
81# CONFIG_NETDEV_10000 is not set
82# CONFIG_WLAN is not set
83# CONFIG_INPUT_MOUSEDEV is not set
84CONFIG_INPUT_EVDEV=y
85# CONFIG_INPUT_KEYBOARD is not set
86# CONFIG_INPUT_MOUSE is not set
87# CONFIG_SERIO is not set
88CONFIG_VT_HW_CONSOLE_BINDING=y
89CONFIG_SERIAL_8250=y
90CONFIG_SERIAL_8250_CONSOLE=y
91# CONFIG_SERIAL_8250_PCI is not set
92# CONFIG_LEGACY_PTYS is not set
93# CONFIG_HW_RANDOM is not set
94# CONFIG_HWMON is not set
95# CONFIG_VGA_ARB is not set
96CONFIG_FB=y
97CONFIG_FIRMWARE_EDID=y
98CONFIG_FB_MODE_HELPERS=y
99CONFIG_FB_TILEBLITTING=y
100CONFIG_FB_S1D13XXX=y
101CONFIG_USB_HIDDEV=y
102CONFIG_USB=y
103# CONFIG_USB_DEVICE_CLASS is not set
104CONFIG_USB_DYNAMIC_MINORS=y
105CONFIG_USB_OTG_WHITELIST=y
106CONFIG_USB_OHCI_HCD=y
107CONFIG_RTC_CLASS=y
108CONFIG_RTC_DRV_AU1XXX=y
109CONFIG_EXT2_FS=y
110CONFIG_ISO9660_FS=y
111CONFIG_JOLIET=y
112CONFIG_ZISOFS=y
113CONFIG_UDF_FS=y
114CONFIG_VFAT_FS=y
115# CONFIG_PROC_PAGE_MONITOR is not set
116CONFIG_TMPFS=y
117CONFIG_JFFS2_FS=y
118CONFIG_JFFS2_SUMMARY=y
119CONFIG_JFFS2_COMPRESSION_OPTIONS=y
120CONFIG_JFFS2_LZO=y
121CONFIG_JFFS2_RUBIN=y
122CONFIG_SQUASHFS=y
123CONFIG_NFS_FS=y
124CONFIG_NFS_V3=y
125CONFIG_ROOT_NFS=y
126CONFIG_NLS_CODEPAGE_437=y
127CONFIG_NLS_CODEPAGE_850=y
128CONFIG_NLS_CODEPAGE_852=y
129CONFIG_NLS_CODEPAGE_1250=y
130CONFIG_NLS_ASCII=y
131CONFIG_NLS_ISO8859_1=y
132CONFIG_NLS_ISO8859_15=y
133CONFIG_NLS_UTF8=y
134CONFIG_STRIP_ASM_SYMS=y
135CONFIG_DEBUG_KERNEL=y
136# CONFIG_SCHED_DEBUG is not set
137# CONFIG_FTRACE is not set
138CONFIG_DEBUG_ZBOOT=y
139CONFIG_KEYS=y
140CONFIG_KEYS_DEBUG_PROC_KEYS=y
141CONFIG_SECURITYFS=y
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig
deleted file mode 100644
index e83d6497e8b4..000000000000
--- a/arch/mips/configs/pb1550_defconfig
+++ /dev/null
@@ -1,145 +0,0 @@
1CONFIG_MIPS_ALCHEMY=y
2CONFIG_MIPS_PB1550=y
3CONFIG_NO_HZ=y
4CONFIG_HIGH_RES_TIMERS=y
5CONFIG_HZ_100=y
6# CONFIG_SECCOMP is not set
7CONFIG_EXPERIMENTAL=y
8CONFIG_LOCALVERSION="-pb1550"
9CONFIG_KERNEL_LZMA=y
10CONFIG_SYSVIPC=y
11CONFIG_POSIX_MQUEUE=y
12CONFIG_TINY_RCU=y
13CONFIG_LOG_BUF_SHIFT=14
14CONFIG_EXPERT=y
15# CONFIG_SYSCTL_SYSCALL is not set
16# CONFIG_KALLSYMS is not set
17# CONFIG_PCSPKR_PLATFORM is not set
18# CONFIG_VM_EVENT_COUNTERS is not set
19# CONFIG_COMPAT_BRK is not set
20CONFIG_SLAB=y
21CONFIG_MODULES=y
22CONFIG_MODULE_UNLOAD=y
23# CONFIG_IOSCHED_DEADLINE is not set
24# CONFIG_IOSCHED_CFQ is not set
25CONFIG_PCI=y
26CONFIG_PCCARD=y
27# CONFIG_CARDBUS is not set
28CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
29CONFIG_PM=y
30CONFIG_PM_RUNTIME=y
31CONFIG_NET=y
32CONFIG_PACKET=y
33CONFIG_UNIX=y
34CONFIG_INET=y
35CONFIG_IP_MULTICAST=y
36CONFIG_IP_PNP=y
37CONFIG_IP_PNP_DHCP=y
38CONFIG_IP_PNP_BOOTP=y
39CONFIG_IP_PNP_RARP=y
40# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
41# CONFIG_INET_XFRM_MODE_TUNNEL is not set
42# CONFIG_INET_XFRM_MODE_BEET is not set
43# CONFIG_INET_DIAG is not set
44# CONFIG_IPV6 is not set
45CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
46CONFIG_MTD=y
47CONFIG_MTD_PARTITIONS=y
48CONFIG_MTD_CHAR=y
49CONFIG_MTD_BLOCK=y
50CONFIG_MTD_CFI=y
51CONFIG_MTD_CFI_AMDSTD=y
52CONFIG_MTD_PHYSMAP=y
53CONFIG_MTD_NAND=y
54CONFIG_MTD_NAND_AU1550=y
55CONFIG_BLK_DEV_LOOP=y
56CONFIG_BLK_DEV_UB=y
57# CONFIG_MISC_DEVICES is not set
58CONFIG_IDE=y
59CONFIG_BLK_DEV_IDECS=y
60CONFIG_BLK_DEV_IDECD=y
61# CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS is not set
62# CONFIG_IDEPCI_PCIBUS_ORDER is not set
63CONFIG_BLK_DEV_HPT366=y
64CONFIG_NETDEVICES=y
65CONFIG_MARVELL_PHY=y
66CONFIG_DAVICOM_PHY=y
67CONFIG_QSEMI_PHY=y
68CONFIG_LXT_PHY=y
69CONFIG_CICADA_PHY=y
70CONFIG_VITESSE_PHY=y
71CONFIG_SMSC_PHY=y
72CONFIG_BROADCOM_PHY=y
73CONFIG_ICPLUS_PHY=y
74CONFIG_REALTEK_PHY=y
75CONFIG_NATIONAL_PHY=y
76CONFIG_STE10XP=y
77CONFIG_LSI_ET1011C_PHY=y
78CONFIG_NET_ETHERNET=y
79CONFIG_MII=y
80CONFIG_MIPS_AU1X00_ENET=y
81# CONFIG_NETDEV_1000 is not set
82# CONFIG_NETDEV_10000 is not set
83# CONFIG_WLAN is not set
84# CONFIG_INPUT_MOUSEDEV is not set
85CONFIG_INPUT_EVDEV=y
86# CONFIG_INPUT_KEYBOARD is not set
87# CONFIG_INPUT_MOUSE is not set
88# CONFIG_SERIO is not set
89CONFIG_VT_HW_CONSOLE_BINDING=y
90CONFIG_SERIAL_8250=y
91CONFIG_SERIAL_8250_CONSOLE=y
92# CONFIG_SERIAL_8250_PCI is not set
93# CONFIG_LEGACY_PTYS is not set
94# CONFIG_HW_RANDOM is not set
95CONFIG_I2C=y
96# CONFIG_I2C_COMPAT is not set
97CONFIG_I2C_CHARDEV=y
98# CONFIG_I2C_HELPER_AUTO is not set
99CONFIG_I2C_AU1550=y
100# CONFIG_HWMON is not set
101# CONFIG_VGA_ARB is not set
102CONFIG_HIDRAW=y
103CONFIG_USB_HIDDEV=y
104CONFIG_USB=y
105CONFIG_USB_DEVICEFS=y
106CONFIG_USB_DYNAMIC_MINORS=y
107CONFIG_USB_SUSPEND=y
108CONFIG_USB_EHCI_HCD=y
109CONFIG_USB_EHCI_ROOT_HUB_TT=y
110CONFIG_USB_OHCI_HCD=y
111CONFIG_RTC_CLASS=y
112CONFIG_RTC_DRV_AU1XXX=y
113CONFIG_EXT2_FS=y
114CONFIG_ISO9660_FS=y
115CONFIG_JOLIET=y
116CONFIG_ZISOFS=y
117CONFIG_UDF_FS=y
118CONFIG_VFAT_FS=y
119# CONFIG_PROC_PAGE_MONITOR is not set
120CONFIG_TMPFS=y
121CONFIG_JFFS2_FS=y
122CONFIG_JFFS2_SUMMARY=y
123CONFIG_JFFS2_COMPRESSION_OPTIONS=y
124CONFIG_JFFS2_LZO=y
125CONFIG_JFFS2_RUBIN=y
126CONFIG_SQUASHFS=y
127CONFIG_NFS_FS=y
128CONFIG_NFS_V3=y
129CONFIG_ROOT_NFS=y
130CONFIG_NLS_CODEPAGE_437=y
131CONFIG_NLS_CODEPAGE_850=y
132CONFIG_NLS_CODEPAGE_852=y
133CONFIG_NLS_CODEPAGE_1250=y
134CONFIG_NLS_ASCII=y
135CONFIG_NLS_ISO8859_1=y
136CONFIG_NLS_ISO8859_15=y
137CONFIG_NLS_UTF8=y
138CONFIG_STRIP_ASM_SYMS=y
139CONFIG_DEBUG_KERNEL=y
140# CONFIG_SCHED_DEBUG is not set
141# CONFIG_FTRACE is not set
142CONFIG_DEBUG_ZBOOT=y
143CONFIG_KEYS=y
144CONFIG_KEYS_DEBUG_PROC_KEYS=y
145CONFIG_SECURITYFS=y
diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild
index f53f9ca73996..e69de29bb2d1 100644
--- a/arch/mips/include/asm/Kbuild
+++ b/arch/mips/include/asm/Kbuild
@@ -1,5 +0,0 @@
1include include/asm-generic/Kbuild.asm
2
3header-y += cachectl.h
4header-y += sgidefs.h
5header-y += sysmips.h
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h
index 3f4c5cb6433e..01cc6ba64831 100644
--- a/arch/mips/include/asm/atomic.h
+++ b/arch/mips/include/asm/atomic.h
@@ -59,8 +59,8 @@ static __inline__ void atomic_add(int i, atomic_t * v)
59 " sc %0, %1 \n" 59 " sc %0, %1 \n"
60 " beqzl %0, 1b \n" 60 " beqzl %0, 1b \n"
61 " .set mips0 \n" 61 " .set mips0 \n"
62 : "=&r" (temp), "=m" (v->counter) 62 : "=&r" (temp), "+m" (v->counter)
63 : "Ir" (i), "m" (v->counter)); 63 : "Ir" (i));
64 } else if (kernel_uses_llsc) { 64 } else if (kernel_uses_llsc) {
65 int temp; 65 int temp;
66 66
@@ -71,8 +71,8 @@ static __inline__ void atomic_add(int i, atomic_t * v)
71 " addu %0, %2 \n" 71 " addu %0, %2 \n"
72 " sc %0, %1 \n" 72 " sc %0, %1 \n"
73 " .set mips0 \n" 73 " .set mips0 \n"
74 : "=&r" (temp), "=m" (v->counter) 74 : "=&r" (temp), "+m" (v->counter)
75 : "Ir" (i), "m" (v->counter)); 75 : "Ir" (i));
76 } while (unlikely(!temp)); 76 } while (unlikely(!temp));
77 } else { 77 } else {
78 unsigned long flags; 78 unsigned long flags;
@@ -102,8 +102,8 @@ static __inline__ void atomic_sub(int i, atomic_t * v)
102 " sc %0, %1 \n" 102 " sc %0, %1 \n"
103 " beqzl %0, 1b \n" 103 " beqzl %0, 1b \n"
104 " .set mips0 \n" 104 " .set mips0 \n"
105 : "=&r" (temp), "=m" (v->counter) 105 : "=&r" (temp), "+m" (v->counter)
106 : "Ir" (i), "m" (v->counter)); 106 : "Ir" (i));
107 } else if (kernel_uses_llsc) { 107 } else if (kernel_uses_llsc) {
108 int temp; 108 int temp;
109 109
@@ -114,8 +114,8 @@ static __inline__ void atomic_sub(int i, atomic_t * v)
114 " subu %0, %2 \n" 114 " subu %0, %2 \n"
115 " sc %0, %1 \n" 115 " sc %0, %1 \n"
116 " .set mips0 \n" 116 " .set mips0 \n"
117 : "=&r" (temp), "=m" (v->counter) 117 : "=&r" (temp), "+m" (v->counter)
118 : "Ir" (i), "m" (v->counter)); 118 : "Ir" (i));
119 } while (unlikely(!temp)); 119 } while (unlikely(!temp));
120 } else { 120 } else {
121 unsigned long flags; 121 unsigned long flags;
@@ -146,9 +146,8 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
146 " beqzl %0, 1b \n" 146 " beqzl %0, 1b \n"
147 " addu %0, %1, %3 \n" 147 " addu %0, %1, %3 \n"
148 " .set mips0 \n" 148 " .set mips0 \n"
149 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 149 : "=&r" (result), "=&r" (temp), "+m" (v->counter)
150 : "Ir" (i), "m" (v->counter) 150 : "Ir" (i));
151 : "memory");
152 } else if (kernel_uses_llsc) { 151 } else if (kernel_uses_llsc) {
153 int temp; 152 int temp;
154 153
@@ -159,9 +158,8 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
159 " addu %0, %1, %3 \n" 158 " addu %0, %1, %3 \n"
160 " sc %0, %2 \n" 159 " sc %0, %2 \n"
161 " .set mips0 \n" 160 " .set mips0 \n"
162 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 161 : "=&r" (result), "=&r" (temp), "+m" (v->counter)
163 : "Ir" (i), "m" (v->counter) 162 : "Ir" (i));
164 : "memory");
165 } while (unlikely(!result)); 163 } while (unlikely(!result));
166 164
167 result = temp + i; 165 result = temp + i;
@@ -212,9 +210,8 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
212 " subu %0, %1, %3 \n" 210 " subu %0, %1, %3 \n"
213 " sc %0, %2 \n" 211 " sc %0, %2 \n"
214 " .set mips0 \n" 212 " .set mips0 \n"
215 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 213 : "=&r" (result), "=&r" (temp), "+m" (v->counter)
216 : "Ir" (i), "m" (v->counter) 214 : "Ir" (i));
217 : "memory");
218 } while (unlikely(!result)); 215 } while (unlikely(!result));
219 216
220 result = temp - i; 217 result = temp - i;
@@ -262,7 +259,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
262 " .set reorder \n" 259 " .set reorder \n"
263 "1: \n" 260 "1: \n"
264 " .set mips0 \n" 261 " .set mips0 \n"
265 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 262 : "=&r" (result), "=&r" (temp), "+m" (v->counter)
266 : "Ir" (i), "m" (v->counter) 263 : "Ir" (i), "m" (v->counter)
267 : "memory"); 264 : "memory");
268 } else if (kernel_uses_llsc) { 265 } else if (kernel_uses_llsc) {
@@ -280,9 +277,8 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
280 " .set reorder \n" 277 " .set reorder \n"
281 "1: \n" 278 "1: \n"
282 " .set mips0 \n" 279 " .set mips0 \n"
283 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 280 : "=&r" (result), "=&r" (temp), "+m" (v->counter)
284 : "Ir" (i), "m" (v->counter) 281 : "Ir" (i));
285 : "memory");
286 } else { 282 } else {
287 unsigned long flags; 283 unsigned long flags;
288 284
@@ -430,8 +426,8 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
430 " scd %0, %1 \n" 426 " scd %0, %1 \n"
431 " beqzl %0, 1b \n" 427 " beqzl %0, 1b \n"
432 " .set mips0 \n" 428 " .set mips0 \n"
433 : "=&r" (temp), "=m" (v->counter) 429 : "=&r" (temp), "+m" (v->counter)
434 : "Ir" (i), "m" (v->counter)); 430 : "Ir" (i));
435 } else if (kernel_uses_llsc) { 431 } else if (kernel_uses_llsc) {
436 long temp; 432 long temp;
437 433
@@ -442,8 +438,8 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
442 " daddu %0, %2 \n" 438 " daddu %0, %2 \n"
443 " scd %0, %1 \n" 439 " scd %0, %1 \n"
444 " .set mips0 \n" 440 " .set mips0 \n"
445 : "=&r" (temp), "=m" (v->counter) 441 : "=&r" (temp), "+m" (v->counter)
446 : "Ir" (i), "m" (v->counter)); 442 : "Ir" (i));
447 } while (unlikely(!temp)); 443 } while (unlikely(!temp));
448 } else { 444 } else {
449 unsigned long flags; 445 unsigned long flags;
@@ -473,8 +469,8 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
473 " scd %0, %1 \n" 469 " scd %0, %1 \n"
474 " beqzl %0, 1b \n" 470 " beqzl %0, 1b \n"
475 " .set mips0 \n" 471 " .set mips0 \n"
476 : "=&r" (temp), "=m" (v->counter) 472 : "=&r" (temp), "+m" (v->counter)
477 : "Ir" (i), "m" (v->counter)); 473 : "Ir" (i));
478 } else if (kernel_uses_llsc) { 474 } else if (kernel_uses_llsc) {
479 long temp; 475 long temp;
480 476
@@ -485,8 +481,8 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
485 " dsubu %0, %2 \n" 481 " dsubu %0, %2 \n"
486 " scd %0, %1 \n" 482 " scd %0, %1 \n"
487 " .set mips0 \n" 483 " .set mips0 \n"
488 : "=&r" (temp), "=m" (v->counter) 484 : "=&r" (temp), "+m" (v->counter)
489 : "Ir" (i), "m" (v->counter)); 485 : "Ir" (i));
490 } while (unlikely(!temp)); 486 } while (unlikely(!temp));
491 } else { 487 } else {
492 unsigned long flags; 488 unsigned long flags;
@@ -517,9 +513,8 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
517 " beqzl %0, 1b \n" 513 " beqzl %0, 1b \n"
518 " daddu %0, %1, %3 \n" 514 " daddu %0, %1, %3 \n"
519 " .set mips0 \n" 515 " .set mips0 \n"
520 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 516 : "=&r" (result), "=&r" (temp), "+m" (v->counter)
521 : "Ir" (i), "m" (v->counter) 517 : "Ir" (i));
522 : "memory");
523 } else if (kernel_uses_llsc) { 518 } else if (kernel_uses_llsc) {
524 long temp; 519 long temp;
525 520
@@ -649,9 +644,8 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
649 " .set reorder \n" 644 " .set reorder \n"
650 "1: \n" 645 "1: \n"
651 " .set mips0 \n" 646 " .set mips0 \n"
652 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 647 : "=&r" (result), "=&r" (temp), "+m" (v->counter)
653 : "Ir" (i), "m" (v->counter) 648 : "Ir" (i));
654 : "memory");
655 } else { 649 } else {
656 unsigned long flags; 650 unsigned long flags;
657 651
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
index 63002a240c73..c507b931b484 100644
--- a/arch/mips/include/asm/cpu-features.h
+++ b/arch/mips/include/asm/cpu-features.h
@@ -171,6 +171,10 @@
171#define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP) 171#define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP)
172#endif 172#endif
173 173
174#ifndef cpu_has_dsp2
175#define cpu_has_dsp2 (cpu_data[0].ases & MIPS_ASE_DSP2P)
176#endif
177
174#ifndef cpu_has_mipsmt 178#ifndef cpu_has_mipsmt
175#define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT) 179#define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT)
176#endif 180#endif
@@ -252,4 +256,8 @@
252#define cpu_hwrena_impl_bits 0 256#define cpu_hwrena_impl_bits 0
253#endif 257#endif
254 258
259#ifndef cpu_has_perf_cntr_intr_bit
260#define cpu_has_perf_cntr_intr_bit (cpu_data[0].options & MIPS_CPU_PCI)
261#endif
262
255#endif /* __ASM_CPU_FEATURES_H */ 263#endif /* __ASM_CPU_FEATURES_H */
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index 554e2d29965d..52c4e914f95a 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -320,7 +320,8 @@ enum cpu_type_enum {
320#define MIPS_CPU_VINT 0x00080000 /* CPU supports MIPSR2 vectored interrupts */ 320#define MIPS_CPU_VINT 0x00080000 /* CPU supports MIPSR2 vectored interrupts */
321#define MIPS_CPU_VEIC 0x00100000 /* CPU supports MIPSR2 external interrupt controller mode */ 321#define MIPS_CPU_VEIC 0x00100000 /* CPU supports MIPSR2 external interrupt controller mode */
322#define MIPS_CPU_ULRI 0x00200000 /* CPU has ULRI feature */ 322#define MIPS_CPU_ULRI 0x00200000 /* CPU has ULRI feature */
323#define MIPS_CPU_RIXI 0x00400000 /* CPU has TLB Read/eXec Inhibit */ 323#define MIPS_CPU_PCI 0x00400000 /* CPU has Perf Ctr Int indicator */
324#define MIPS_CPU_RIXI 0x00800000 /* CPU has TLB Read/eXec Inhibit */
324 325
325/* 326/*
326 * CPU ASE encodings 327 * CPU ASE encodings
@@ -331,6 +332,7 @@ enum cpu_type_enum {
331#define MIPS_ASE_SMARTMIPS 0x00000008 /* SmartMIPS */ 332#define MIPS_ASE_SMARTMIPS 0x00000008 /* SmartMIPS */
332#define MIPS_ASE_DSP 0x00000010 /* Signal Processing ASE */ 333#define MIPS_ASE_DSP 0x00000010 /* Signal Processing ASE */
333#define MIPS_ASE_MIPSMT 0x00000020 /* CPU supports MIPS MT */ 334#define MIPS_ASE_MIPSMT 0x00000020 /* CPU supports MIPS MT */
335#define MIPS_ASE_DSP2P 0x00000040 /* Signal Processing ASE Rev 2 */
334 336
335 337
336#endif /* _ASM_CPU_H */ 338#endif /* _ASM_CPU_H */
diff --git a/arch/mips/include/asm/errno.h b/arch/mips/include/asm/errno.h
index 6dcd3583ed04..21d91cdfe3c9 100644
--- a/arch/mips/include/asm/errno.h
+++ b/arch/mips/include/asm/errno.h
@@ -8,128 +8,10 @@
8#ifndef _ASM_ERRNO_H 8#ifndef _ASM_ERRNO_H
9#define _ASM_ERRNO_H 9#define _ASM_ERRNO_H
10 10
11/* 11#include <uapi/asm/errno.h>
12 * These error numbers are intended to be MIPS ABI compatible
13 */
14
15#include <asm-generic/errno-base.h>
16
17#define ENOMSG 35 /* No message of desired type */
18#define EIDRM 36 /* Identifier removed */
19#define ECHRNG 37 /* Channel number out of range */
20#define EL2NSYNC 38 /* Level 2 not synchronized */
21#define EL3HLT 39 /* Level 3 halted */
22#define EL3RST 40 /* Level 3 reset */
23#define ELNRNG 41 /* Link number out of range */
24#define EUNATCH 42 /* Protocol driver not attached */
25#define ENOCSI 43 /* No CSI structure available */
26#define EL2HLT 44 /* Level 2 halted */
27#define EDEADLK 45 /* Resource deadlock would occur */
28#define ENOLCK 46 /* No record locks available */
29#define EBADE 50 /* Invalid exchange */
30#define EBADR 51 /* Invalid request descriptor */
31#define EXFULL 52 /* Exchange full */
32#define ENOANO 53 /* No anode */
33#define EBADRQC 54 /* Invalid request code */
34#define EBADSLT 55 /* Invalid slot */
35#define EDEADLOCK 56 /* File locking deadlock error */
36#define EBFONT 59 /* Bad font file format */
37#define ENOSTR 60 /* Device not a stream */
38#define ENODATA 61 /* No data available */
39#define ETIME 62 /* Timer expired */
40#define ENOSR 63 /* Out of streams resources */
41#define ENONET 64 /* Machine is not on the network */
42#define ENOPKG 65 /* Package not installed */
43#define EREMOTE 66 /* Object is remote */
44#define ENOLINK 67 /* Link has been severed */
45#define EADV 68 /* Advertise error */
46#define ESRMNT 69 /* Srmount error */
47#define ECOMM 70 /* Communication error on send */
48#define EPROTO 71 /* Protocol error */
49#define EDOTDOT 73 /* RFS specific error */
50#define EMULTIHOP 74 /* Multihop attempted */
51#define EBADMSG 77 /* Not a data message */
52#define ENAMETOOLONG 78 /* File name too long */
53#define EOVERFLOW 79 /* Value too large for defined data type */
54#define ENOTUNIQ 80 /* Name not unique on network */
55#define EBADFD 81 /* File descriptor in bad state */
56#define EREMCHG 82 /* Remote address changed */
57#define ELIBACC 83 /* Can not access a needed shared library */
58#define ELIBBAD 84 /* Accessing a corrupted shared library */
59#define ELIBSCN 85 /* .lib section in a.out corrupted */
60#define ELIBMAX 86 /* Attempting to link in too many shared libraries */
61#define ELIBEXEC 87 /* Cannot exec a shared library directly */
62#define EILSEQ 88 /* Illegal byte sequence */
63#define ENOSYS 89 /* Function not implemented */
64#define ELOOP 90 /* Too many symbolic links encountered */
65#define ERESTART 91 /* Interrupted system call should be restarted */
66#define ESTRPIPE 92 /* Streams pipe error */
67#define ENOTEMPTY 93 /* Directory not empty */
68#define EUSERS 94 /* Too many users */
69#define ENOTSOCK 95 /* Socket operation on non-socket */
70#define EDESTADDRREQ 96 /* Destination address required */
71#define EMSGSIZE 97 /* Message too long */
72#define EPROTOTYPE 98 /* Protocol wrong type for socket */
73#define ENOPROTOOPT 99 /* Protocol not available */
74#define EPROTONOSUPPORT 120 /* Protocol not supported */
75#define ESOCKTNOSUPPORT 121 /* Socket type not supported */
76#define EOPNOTSUPP 122 /* Operation not supported on transport endpoint */
77#define EPFNOSUPPORT 123 /* Protocol family not supported */
78#define EAFNOSUPPORT 124 /* Address family not supported by protocol */
79#define EADDRINUSE 125 /* Address already in use */
80#define EADDRNOTAVAIL 126 /* Cannot assign requested address */
81#define ENETDOWN 127 /* Network is down */
82#define ENETUNREACH 128 /* Network is unreachable */
83#define ENETRESET 129 /* Network dropped connection because of reset */
84#define ECONNABORTED 130 /* Software caused connection abort */
85#define ECONNRESET 131 /* Connection reset by peer */
86#define ENOBUFS 132 /* No buffer space available */
87#define EISCONN 133 /* Transport endpoint is already connected */
88#define ENOTCONN 134 /* Transport endpoint is not connected */
89#define EUCLEAN 135 /* Structure needs cleaning */
90#define ENOTNAM 137 /* Not a XENIX named type file */
91#define ENAVAIL 138 /* No XENIX semaphores available */
92#define EISNAM 139 /* Is a named type file */
93#define EREMOTEIO 140 /* Remote I/O error */
94#define EINIT 141 /* Reserved */
95#define EREMDEV 142 /* Error 142 */
96#define ESHUTDOWN 143 /* Cannot send after transport endpoint shutdown */
97#define ETOOMANYREFS 144 /* Too many references: cannot splice */
98#define ETIMEDOUT 145 /* Connection timed out */
99#define ECONNREFUSED 146 /* Connection refused */
100#define EHOSTDOWN 147 /* Host is down */
101#define EHOSTUNREACH 148 /* No route to host */
102#define EWOULDBLOCK EAGAIN /* Operation would block */
103#define EALREADY 149 /* Operation already in progress */
104#define EINPROGRESS 150 /* Operation now in progress */
105#define ESTALE 151 /* Stale NFS file handle */
106#define ECANCELED 158 /* AIO operation canceled */
107
108/*
109 * These error are Linux extensions.
110 */
111#define ENOMEDIUM 159 /* No medium found */
112#define EMEDIUMTYPE 160 /* Wrong medium type */
113#define ENOKEY 161 /* Required key not available */
114#define EKEYEXPIRED 162 /* Key has expired */
115#define EKEYREVOKED 163 /* Key has been revoked */
116#define EKEYREJECTED 164 /* Key was rejected by service */
117
118/* for robust mutexes */
119#define EOWNERDEAD 165 /* Owner died */
120#define ENOTRECOVERABLE 166 /* State not recoverable */
121
122#define ERFKILL 167 /* Operation not possible due to RF-kill */
123 12
124#define EHWPOISON 168 /* Memory page has hardware error */
125
126#define EDQUOT 1133 /* Quota exceeded */
127
128#ifdef __KERNEL__
129 13
130/* The biggest error number defined here or in <linux/errno.h>. */ 14/* The biggest error number defined here or in <linux/errno.h>. */
131#define EMAXERRNO 1133 15#define EMAXERRNO 1133
132 16
133#endif /* __KERNEL__ */
134
135#endif /* _ASM_ERRNO_H */ 17#endif /* _ASM_ERRNO_H */
diff --git a/arch/mips/include/asm/kspd.h b/arch/mips/include/asm/kspd.h
index 4e9e724c8935..ec6832950ace 100644
--- a/arch/mips/include/asm/kspd.h
+++ b/arch/mips/include/asm/kspd.h
@@ -25,12 +25,8 @@ struct kspd_notifications {
25 struct list_head list; 25 struct list_head list;
26}; 26};
27 27
28#ifdef CONFIG_MIPS_APSP_KSPD
29extern void kspd_notify(struct kspd_notifications *notify);
30#else
31static inline void kspd_notify(struct kspd_notifications *notify) 28static inline void kspd_notify(struct kspd_notifications *notify)
32{ 29{
33} 30}
34#endif
35 31
36#endif 32#endif
diff --git a/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h
index 6ddae926bf79..ea4b66dccf6e 100644
--- a/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h
@@ -42,6 +42,8 @@
42#define cpu_has_mips64r1 0 42#define cpu_has_mips64r1 0
43#define cpu_has_mips64r2 0 43#define cpu_has_mips64r2 0
44 44
45#define cpu_has_dsp 0
46#define cpu_has_dsp2 0
45#define cpu_has_mipsmt 0 47#define cpu_has_mipsmt 0
46 48
47#define cpu_has_64bits 0 49#define cpu_has_64bits 0
diff --git a/arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h b/arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h
index 3f741af37d47..09f45e6afade 100644
--- a/arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-au1x00/cpu-feature-overrides.h
@@ -37,6 +37,7 @@
37#define cpu_has_mips64r1 0 37#define cpu_has_mips64r1 0
38#define cpu_has_mips64r2 0 38#define cpu_has_mips64r2 0
39#define cpu_has_dsp 0 39#define cpu_has_dsp 0
40#define cpu_has_dsp2 0
40#define cpu_has_mipsmt 0 41#define cpu_has_mipsmt 0
41#define cpu_has_userlocal 0 42#define cpu_has_userlocal 0
42#define cpu_has_nofpuex 0 43#define cpu_has_nofpuex 0
diff --git a/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h b/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
index f453c01d0672..e9c408e8ff4c 100644
--- a/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
@@ -37,6 +37,7 @@
37#define cpu_has_mips64r2 0 37#define cpu_has_mips64r2 0
38 38
39#define cpu_has_dsp 0 39#define cpu_has_dsp 0
40#define cpu_has_dsp2 0
40#define cpu_has_mipsmt 0 41#define cpu_has_mipsmt 0
41#define cpu_has_userlocal 0 42#define cpu_has_userlocal 0
42 43
diff --git a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
index 375ad0c815fe..94ed063eec92 100644
--- a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
@@ -53,6 +53,7 @@
53#define cpu_has_mips64r2 1 53#define cpu_has_mips64r2 1
54#define cpu_has_mips_r2_exec_hazard 0 54#define cpu_has_mips_r2_exec_hazard 0
55#define cpu_has_dsp 0 55#define cpu_has_dsp 0
56#define cpu_has_dsp2 0
56#define cpu_has_mipsmt 0 57#define cpu_has_mipsmt 0
57#define cpu_has_vint 0 58#define cpu_has_vint 0
58#define cpu_has_veic 0 59#define cpu_has_veic 0
diff --git a/arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h b/arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h
index b3314cf53194..babc8374e378 100644
--- a/arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h
@@ -45,6 +45,7 @@
45#define cpu_has_ic_fills_f_dc 0 45#define cpu_has_ic_fills_f_dc 0
46#define cpu_icache_snoops_remote_store 0 46#define cpu_icache_snoops_remote_store 0
47#define cpu_has_dsp 0 47#define cpu_has_dsp 0
48#define cpu_has_dsp2 0
48#define cpu_has_mipsmt 0 49#define cpu_has_mipsmt 0
49#define cpu_has_userlocal 0 50#define cpu_has_userlocal 0
50 51
diff --git a/arch/mips/include/asm/mach-db1x00/bcsr.h b/arch/mips/include/asm/mach-db1x00/bcsr.h
index bb9fc23d853a..16f1cf5982b9 100644
--- a/arch/mips/include/asm/mach-db1x00/bcsr.h
+++ b/arch/mips/include/asm/mach-db1x00/bcsr.h
@@ -162,6 +162,8 @@ enum bcsr_whoami_boards {
162#define BCSR_BOARD_PCIEXTARB 0x0200 162#define BCSR_BOARD_PCIEXTARB 0x0200
163#define BCSR_BOARD_GPIO200RST 0x0400 163#define BCSR_BOARD_GPIO200RST 0x0400
164#define BCSR_BOARD_PCICLKOUT 0x0800 164#define BCSR_BOARD_PCICLKOUT 0x0800
165#define BCSR_BOARD_PB1100_SD0PWR 0x0400
166#define BCSR_BOARD_PB1100_SD1PWR 0x0800
165#define BCSR_BOARD_PCICFG 0x1000 167#define BCSR_BOARD_PCICFG 0x1000
166#define BCSR_BOARD_SPISEL 0x2000 /* PB/DB1550 */ 168#define BCSR_BOARD_SPISEL 0x2000 /* PB/DB1550 */
167#define BCSR_BOARD_SD0WP 0x4000 /* DB1100 */ 169#define BCSR_BOARD_SD0WP 0x4000 /* DB1100 */
diff --git a/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h
index 9c8735158da1..f4caacd25552 100644
--- a/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h
@@ -30,6 +30,7 @@
30#define cpu_has_ic_fills_f_dc 0 30#define cpu_has_ic_fills_f_dc 0
31 31
32#define cpu_has_dsp 0 32#define cpu_has_dsp 0
33#define cpu_has_dsp2 0
33#define cpu_has_mipsmt 0 34#define cpu_has_mipsmt 0
34#define cpu_has_userlocal 0 35#define cpu_has_userlocal 0
35 36
diff --git a/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h
index 7d3112b148d9..1d2b6ff60d33 100644
--- a/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h
@@ -26,6 +26,7 @@
26#define cpu_has_dc_aliases 0 26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0 27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0 28#define cpu_has_dsp 0
29#define cpu_has_dsp2 0
29#define cpu_icache_snoops_remote_store 1 30#define cpu_icache_snoops_remote_store 1
30#define cpu_has_mipsmt 0 31#define cpu_has_mipsmt 0
31#define cpu_has_userlocal 0 32#define cpu_has_userlocal 0
diff --git a/arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h
index 9a53b326f848..50d344ca60a8 100644
--- a/arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h
@@ -27,6 +27,7 @@
27#define cpu_has_dc_aliases 0 /* see probe_pcache() */ 27#define cpu_has_dc_aliases 0 /* see probe_pcache() */
28#define cpu_has_ic_fills_f_dc 0 28#define cpu_has_ic_fills_f_dc 0
29#define cpu_has_dsp 0 29#define cpu_has_dsp 0
30#define cpu_has_dsp2 0
30#define cpu_icache_snoops_remote_store 1 31#define cpu_icache_snoops_remote_store 1
31#define cpu_has_mipsmt 0 32#define cpu_has_mipsmt 0
32#define cpu_has_userlocal 0 33#define cpu_has_userlocal 0
diff --git a/arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h
index 6782fccebe8d..2e1ec6cfedd5 100644
--- a/arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h
@@ -37,6 +37,7 @@
37#define cpu_has_vtag_icache 0 37#define cpu_has_vtag_icache 0
38#define cpu_has_ic_fills_f_dc 0 38#define cpu_has_ic_fills_f_dc 0
39#define cpu_has_dsp 0 39#define cpu_has_dsp 0
40#define cpu_has_dsp2 0
40#define cpu_has_4k_cache 1 41#define cpu_has_4k_cache 1
41#define cpu_has_mipsmt 0 42#define cpu_has_mipsmt 0
42#define cpu_has_userlocal 0 43#define cpu_has_userlocal 0
diff --git a/arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h b/arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
index d12e5c6477b9..a225baaa215d 100644
--- a/arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-jz4740/cpu-feature-overrides.h
@@ -38,6 +38,7 @@
38#define cpu_has_mips64r1 0 38#define cpu_has_mips64r1 0
39#define cpu_has_mips64r2 0 39#define cpu_has_mips64r2 0
40#define cpu_has_dsp 0 40#define cpu_has_dsp 0
41#define cpu_has_dsp2 0
41#define cpu_has_mipsmt 0 42#define cpu_has_mipsmt 0
42#define cpu_has_userlocal 0 43#define cpu_has_userlocal 0
43#define cpu_has_nofpuex 0 44#define cpu_has_nofpuex 0
diff --git a/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
index 675bd8641d5a..1a05d854e34c 100644
--- a/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
@@ -32,6 +32,7 @@
32#define cpu_has_dc_aliases (PAGE_SIZE < 0x4000) 32#define cpu_has_dc_aliases (PAGE_SIZE < 0x4000)
33#define cpu_has_divec 0 33#define cpu_has_divec 0
34#define cpu_has_dsp 0 34#define cpu_has_dsp 0
35#define cpu_has_dsp2 0
35#define cpu_has_ejtag 0 36#define cpu_has_ejtag 0
36#define cpu_has_fpu 1 37#define cpu_has_fpu 1
37#define cpu_has_ic_fills_f_dc 0 38#define cpu_has_ic_fills_f_dc 0
diff --git a/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h b/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h
index 966db4be377c..091deb1700e5 100644
--- a/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h
@@ -26,6 +26,7 @@
26#define cpu_has_vtag_icache 0 26#define cpu_has_vtag_icache 0
27#define cpu_has_ic_fills_f_dc 1 27#define cpu_has_ic_fills_f_dc 1
28#define cpu_has_dsp 0 28#define cpu_has_dsp 0
29#define cpu_has_dsp2 0
29#define cpu_has_mipsmt 0 30#define cpu_has_mipsmt 0
30#define cpu_icache_snoops_remote_store 1 31#define cpu_icache_snoops_remote_store 1
31 32
diff --git a/arch/mips/include/asm/mach-powertv/cpu-feature-overrides.h b/arch/mips/include/asm/mach-powertv/cpu-feature-overrides.h
index f751e3ec56fb..58c76ec32a19 100644
--- a/arch/mips/include/asm/mach-powertv/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-powertv/cpu-feature-overrides.h
@@ -45,6 +45,7 @@
45#define cpu_has_mips64r1 0 45#define cpu_has_mips64r1 0
46#define cpu_has_mips64r2 0 46#define cpu_has_mips64r2 0
47#define cpu_has_dsp 0 47#define cpu_has_dsp 0
48#define cpu_has_dsp2 0
48#define cpu_has_mipsmt 0 49#define cpu_has_mipsmt 0
49#define cpu_has_userlocal 0 50#define cpu_has_userlocal 0
50#define cpu_has_nofpuex 0 51#define cpu_has_nofpuex 0
diff --git a/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h b/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h
index c3e4d3a4c95d..b15307597ee3 100644
--- a/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h
@@ -60,6 +60,7 @@
60#define cpu_has_mips64r2 0 60#define cpu_has_mips64r2 0
61 61
62#define cpu_has_dsp 0 62#define cpu_has_dsp 0
63#define cpu_has_dsp2 0
63#define cpu_has_mipsmt 0 64#define cpu_has_mipsmt 0
64 65
65/* #define cpu_has_nofpuex ? */ 66/* #define cpu_has_nofpuex ? */
diff --git a/arch/mips/include/asm/mach-rm/cpu-feature-overrides.h b/arch/mips/include/asm/mach-rm/cpu-feature-overrides.h
index ccf543363537..f095c529c48c 100644
--- a/arch/mips/include/asm/mach-rm/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-rm/cpu-feature-overrides.h
@@ -30,6 +30,7 @@
30#define cpu_has_dc_aliases (PAGE_SIZE < 0x4000) 30#define cpu_has_dc_aliases (PAGE_SIZE < 0x4000)
31#define cpu_has_ic_fills_f_dc 0 31#define cpu_has_ic_fills_f_dc 0
32#define cpu_has_dsp 0 32#define cpu_has_dsp 0
33#define cpu_has_dsp2 0
33#define cpu_has_nofpuex 0 34#define cpu_has_nofpuex 0
34#define cpu_has_64bits 1 35#define cpu_has_64bits 1
35#define cpu_has_mipsmt 0 36#define cpu_has_mipsmt 0
diff --git a/arch/mips/include/asm/mach-sibyte/cpu-feature-overrides.h b/arch/mips/include/asm/mach-sibyte/cpu-feature-overrides.h
index 1c1f92415b9a..92927b62b5a0 100644
--- a/arch/mips/include/asm/mach-sibyte/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-sibyte/cpu-feature-overrides.h
@@ -26,6 +26,7 @@
26#define cpu_has_dc_aliases 0 26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0 27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0 28#define cpu_has_dsp 0
29#define cpu_has_dsp2 0
29#define cpu_has_mipsmt 0 30#define cpu_has_mipsmt 0
30#define cpu_has_userlocal 0 31#define cpu_has_userlocal 0
31#define cpu_icache_snoops_remote_store 0 32#define cpu_icache_snoops_remote_store 0
diff --git a/arch/mips/include/asm/mach-tx49xx/cpu-feature-overrides.h b/arch/mips/include/asm/mach-tx49xx/cpu-feature-overrides.h
index 275eaf92c748..7f5144c6ce2d 100644
--- a/arch/mips/include/asm/mach-tx49xx/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-tx49xx/cpu-feature-overrides.h
@@ -12,6 +12,7 @@
12#define cpu_has_vtag_icache 0 12#define cpu_has_vtag_icache 0
13#define cpu_has_ic_fills_f_dc 0 13#define cpu_has_ic_fills_f_dc 0
14#define cpu_has_dsp 0 14#define cpu_has_dsp 0
15#define cpu_has_dsp2 0
15#define cpu_has_mipsmt 0 16#define cpu_has_mipsmt 0
16#define cpu_has_userlocal 0 17#define cpu_has_userlocal 0
17 18
diff --git a/arch/mips/include/asm/mach-yosemite/cpu-feature-overrides.h b/arch/mips/include/asm/mach-yosemite/cpu-feature-overrides.h
index 470e5e9e10d6..56bdd3298600 100644
--- a/arch/mips/include/asm/mach-yosemite/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-yosemite/cpu-feature-overrides.h
@@ -26,6 +26,7 @@
26#define cpu_has_dc_aliases 0 26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0 27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0 28#define cpu_has_dsp 0
29#define cpu_has_dsp2 0
29#define cpu_has_mipsmt 0 30#define cpu_has_mipsmt 0
30#define cpu_has_userlocal 0 31#define cpu_has_userlocal 0
31#define cpu_icache_snoops_remote_store 0 32#define cpu_icache_snoops_remote_store 0
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 528fda1e957c..eb742895dcbe 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -458,6 +458,8 @@
458#define CAUSEF_IP7 (_ULCAST_(1) << 15) 458#define CAUSEF_IP7 (_ULCAST_(1) << 15)
459#define CAUSEB_IV 23 459#define CAUSEB_IV 23
460#define CAUSEF_IV (_ULCAST_(1) << 23) 460#define CAUSEF_IV (_ULCAST_(1) << 23)
461#define CAUSEB_PCI 26
462#define CAUSEF_PCI (_ULCAST_(1) << 26)
461#define CAUSEB_CE 28 463#define CAUSEB_CE 28
462#define CAUSEF_CE (_ULCAST_(3) << 28) 464#define CAUSEF_CE (_ULCAST_(3) << 28)
463#define CAUSEB_TI 30 465#define CAUSEB_TI 30
@@ -590,6 +592,7 @@
590#define MIPS_CONF3_VEIC (_ULCAST_(1) << 6) 592#define MIPS_CONF3_VEIC (_ULCAST_(1) << 6)
591#define MIPS_CONF3_LPA (_ULCAST_(1) << 7) 593#define MIPS_CONF3_LPA (_ULCAST_(1) << 7)
592#define MIPS_CONF3_DSP (_ULCAST_(1) << 10) 594#define MIPS_CONF3_DSP (_ULCAST_(1) << 10)
595#define MIPS_CONF3_DSP2P (_ULCAST_(1) << 11)
593#define MIPS_CONF3_RXI (_ULCAST_(1) << 12) 596#define MIPS_CONF3_RXI (_ULCAST_(1) << 12)
594#define MIPS_CONF3_ULRI (_ULCAST_(1) << 13) 597#define MIPS_CONF3_ULRI (_ULCAST_(1) << 13)
595 598
diff --git a/arch/mips/include/asm/module.h b/arch/mips/include/asm/module.h
index dca8bce8c7ab..26137da1c713 100644
--- a/arch/mips/include/asm/module.h
+++ b/arch/mips/include/asm/module.h
@@ -35,11 +35,14 @@ typedef struct {
35} Elf64_Mips_Rela; 35} Elf64_Mips_Rela;
36 36
37#ifdef CONFIG_32BIT 37#ifdef CONFIG_32BIT
38
39#define Elf_Shdr Elf32_Shdr 38#define Elf_Shdr Elf32_Shdr
40#define Elf_Sym Elf32_Sym 39#define Elf_Sym Elf32_Sym
41#define Elf_Ehdr Elf32_Ehdr 40#define Elf_Ehdr Elf32_Ehdr
42#define Elf_Addr Elf32_Addr 41#define Elf_Addr Elf32_Addr
42#define Elf_Rel Elf32_Rel
43#define Elf_Rela Elf32_Rela
44#define ELF_R_TYPE(X) ELF32_R_TYPE(X)
45#define ELF_R_SYM(X) ELF32_R_SYM(X)
43 46
44#define Elf_Mips_Rel Elf32_Rel 47#define Elf_Mips_Rel Elf32_Rel
45#define Elf_Mips_Rela Elf32_Rela 48#define Elf_Mips_Rela Elf32_Rela
@@ -50,11 +53,14 @@ typedef struct {
50#endif 53#endif
51 54
52#ifdef CONFIG_64BIT 55#ifdef CONFIG_64BIT
53
54#define Elf_Shdr Elf64_Shdr 56#define Elf_Shdr Elf64_Shdr
55#define Elf_Sym Elf64_Sym 57#define Elf_Sym Elf64_Sym
56#define Elf_Ehdr Elf64_Ehdr 58#define Elf_Ehdr Elf64_Ehdr
57#define Elf_Addr Elf64_Addr 59#define Elf_Addr Elf64_Addr
60#define Elf_Rel Elf64_Rel
61#define Elf_Rela Elf64_Rela
62#define ELF_R_TYPE(X) ELF64_R_TYPE(X)
63#define ELF_R_SYM(X) ELF64_R_SYM(X)
58 64
59#define Elf_Mips_Rel Elf64_Mips_Rel 65#define Elf_Mips_Rel Elf64_Mips_Rel
60#define Elf_Mips_Rela Elf64_Mips_Rela 66#define Elf_Mips_Rela Elf64_Mips_Rela
diff --git a/arch/mips/include/asm/pgtable-64.h b/arch/mips/include/asm/pgtable-64.h
index 55908fd56b1f..c26e18250079 100644
--- a/arch/mips/include/asm/pgtable-64.h
+++ b/arch/mips/include/asm/pgtable-64.h
@@ -162,7 +162,6 @@ typedef struct { unsigned long pmd; } pmd_t;
162 162
163 163
164extern pmd_t invalid_pmd_table[PTRS_PER_PMD]; 164extern pmd_t invalid_pmd_table[PTRS_PER_PMD];
165extern pmd_t empty_bad_pmd_table[PTRS_PER_PMD];
166#endif 165#endif
167 166
168/* 167/*
diff --git a/arch/mips/include/asm/pmc-sierra/msp71xx/cpu-feature-overrides.h b/arch/mips/include/asm/pmc-sierra/msp71xx/cpu-feature-overrides.h
index a80801b094bd..016fa9446ba9 100644
--- a/arch/mips/include/asm/pmc-sierra/msp71xx/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/pmc-sierra/msp71xx/cpu-feature-overrides.h
@@ -10,6 +10,7 @@
10 10
11#define cpu_has_mips16 1 11#define cpu_has_mips16 1
12#define cpu_has_dsp 1 12#define cpu_has_dsp 1
13/* #define cpu_has_dsp2 ??? - do runtime detection */
13#define cpu_has_mipsmt 1 14#define cpu_has_mipsmt 1
14#define cpu_has_fpu 0 15#define cpu_has_fpu 0
15 16
diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h
index 4b7f5252d2fd..4f5da948a777 100644
--- a/arch/mips/include/asm/ptrace.h
+++ b/arch/mips/include/asm/ptrace.h
@@ -9,115 +9,12 @@
9#ifndef _ASM_PTRACE_H 9#ifndef _ASM_PTRACE_H
10#define _ASM_PTRACE_H 10#define _ASM_PTRACE_H
11 11
12/* 0 - 31 are integer registers, 32 - 63 are fp registers. */
13#define FPR_BASE 32
14#define PC 64
15#define CAUSE 65
16#define BADVADDR 66
17#define MMHI 67
18#define MMLO 68
19#define FPC_CSR 69
20#define FPC_EIR 70
21#define DSP_BASE 71 /* 3 more hi / lo register pairs */
22#define DSP_CONTROL 77
23#define ACX 78
24
25/*
26 * This struct defines the way the registers are stored on the stack during a
27 * system call/exception. As usual the registers k0/k1 aren't being saved.
28 */
29struct pt_regs {
30#ifdef CONFIG_32BIT
31 /* Pad bytes for argument save space on the stack. */
32 unsigned long pad0[6];
33#endif
34
35 /* Saved main processor registers. */
36 unsigned long regs[32];
37
38 /* Saved special registers. */
39 unsigned long cp0_status;
40 unsigned long hi;
41 unsigned long lo;
42#ifdef CONFIG_CPU_HAS_SMARTMIPS
43 unsigned long acx;
44#endif
45 unsigned long cp0_badvaddr;
46 unsigned long cp0_cause;
47 unsigned long cp0_epc;
48#ifdef CONFIG_MIPS_MT_SMTC
49 unsigned long cp0_tcstatus;
50#endif /* CONFIG_MIPS_MT_SMTC */
51#ifdef CONFIG_CPU_CAVIUM_OCTEON
52 unsigned long long mpl[3]; /* MTM{0,1,2} */
53 unsigned long long mtp[3]; /* MTP{0,1,2} */
54#endif
55} __attribute__ ((aligned (8)));
56
57/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
58#define PTRACE_GETREGS 12
59#define PTRACE_SETREGS 13
60#define PTRACE_GETFPREGS 14
61#define PTRACE_SETFPREGS 15
62/* #define PTRACE_GETFPXREGS 18 */
63/* #define PTRACE_SETFPXREGS 19 */
64
65#define PTRACE_OLDSETOPTIONS 21
66
67#define PTRACE_GET_THREAD_AREA 25
68#define PTRACE_SET_THREAD_AREA 26
69
70/* Calls to trace a 64bit program from a 32bit program. */
71#define PTRACE_PEEKTEXT_3264 0xc0
72#define PTRACE_PEEKDATA_3264 0xc1
73#define PTRACE_POKETEXT_3264 0xc2
74#define PTRACE_POKEDATA_3264 0xc3
75#define PTRACE_GET_THREAD_AREA_3264 0xc4
76
77/* Read and write watchpoint registers. */
78enum pt_watch_style {
79 pt_watch_style_mips32,
80 pt_watch_style_mips64
81};
82struct mips32_watch_regs {
83 unsigned int watchlo[8];
84 /* Lower 16 bits of watchhi. */
85 unsigned short watchhi[8];
86 /* Valid mask and I R W bits.
87 * bit 0 -- 1 if W bit is usable.
88 * bit 1 -- 1 if R bit is usable.
89 * bit 2 -- 1 if I bit is usable.
90 * bits 3 - 11 -- Valid watchhi mask bits.
91 */
92 unsigned short watch_masks[8];
93 /* The number of valid watch register pairs. */
94 unsigned int num_valid;
95} __attribute__((aligned(8)));
96
97struct mips64_watch_regs {
98 unsigned long long watchlo[8];
99 unsigned short watchhi[8];
100 unsigned short watch_masks[8];
101 unsigned int num_valid;
102} __attribute__((aligned(8)));
103
104struct pt_watch_regs {
105 enum pt_watch_style style;
106 union {
107 struct mips32_watch_regs mips32;
108 struct mips64_watch_regs mips64;
109 };
110};
111
112#define PTRACE_GET_WATCH_REGS 0xd0
113#define PTRACE_SET_WATCH_REGS 0xd1
114
115#ifdef __KERNEL__
116 12
117#include <linux/compiler.h> 13#include <linux/compiler.h>
118#include <linux/linkage.h> 14#include <linux/linkage.h>
119#include <linux/types.h> 15#include <linux/types.h>
120#include <asm/isadep.h> 16#include <asm/isadep.h>
17#include <uapi/asm/ptrace.h>
121 18
122struct task_struct; 19struct task_struct;
123 20
@@ -164,6 +61,4 @@ static inline void die_if_kernel(const char *str, struct pt_regs *regs)
164 die(str, regs); 61 die(str, regs);
165} 62}
166 63
167#endif
168
169#endif /* _ASM_PTRACE_H */ 64#endif /* _ASM_PTRACE_H */
diff --git a/arch/mips/include/asm/setup.h b/arch/mips/include/asm/setup.h
index 2560b6b6a7d8..e26589ef36ee 100644
--- a/arch/mips/include/asm/setup.h
+++ b/arch/mips/include/asm/setup.h
@@ -1,9 +1,8 @@
1#ifndef _MIPS_SETUP_H 1#ifndef _MIPS_SETUP_H
2#define _MIPS_SETUP_H 2#define _MIPS_SETUP_H
3 3
4#define COMMAND_LINE_SIZE 4096 4#include <uapi/asm/setup.h>
5 5
6#ifdef __KERNEL__
7extern void setup_early_printk(void); 6extern void setup_early_printk(void);
8 7
9extern void set_handler(unsigned long offset, void *addr, unsigned long len); 8extern void set_handler(unsigned long offset, void *addr, unsigned long len);
@@ -17,6 +16,4 @@ extern unsigned long ebase;
17extern void per_cpu_trap_init(bool); 16extern void per_cpu_trap_init(bool);
18extern void cpu_cache_init(void); 17extern void cpu_cache_init(void);
19 18
20#endif /* __KERNEL__ */
21
22#endif /* __SETUP_H */ 19#endif /* __SETUP_H */
diff --git a/arch/mips/include/asm/sigcontext.h b/arch/mips/include/asm/sigcontext.h
index 9e89cf99d4e4..eeeb0f48c767 100644
--- a/arch/mips/include/asm/sigcontext.h
+++ b/arch/mips/include/asm/sigcontext.h
@@ -9,71 +9,10 @@
9#ifndef _ASM_SIGCONTEXT_H 9#ifndef _ASM_SIGCONTEXT_H
10#define _ASM_SIGCONTEXT_H 10#define _ASM_SIGCONTEXT_H
11 11
12#include <linux/types.h> 12#include <uapi/asm/sigcontext.h>
13#include <asm/sgidefs.h>
14
15#if _MIPS_SIM == _MIPS_SIM_ABI32
16
17/*
18 * Keep this struct definition in sync with the sigcontext fragment
19 * in arch/mips/tools/offset.c
20 */
21struct sigcontext {
22 unsigned int sc_regmask; /* Unused */
23 unsigned int sc_status; /* Unused */
24 unsigned long long sc_pc;
25 unsigned long long sc_regs[32];
26 unsigned long long sc_fpregs[32];
27 unsigned int sc_acx; /* Was sc_ownedfp */
28 unsigned int sc_fpc_csr;
29 unsigned int sc_fpc_eir; /* Unused */
30 unsigned int sc_used_math;
31 unsigned int sc_dsp; /* dsp status, was sc_ssflags */
32 unsigned long long sc_mdhi;
33 unsigned long long sc_mdlo;
34 unsigned long sc_hi1; /* Was sc_cause */
35 unsigned long sc_lo1; /* Was sc_badvaddr */
36 unsigned long sc_hi2; /* Was sc_sigset[4] */
37 unsigned long sc_lo2;
38 unsigned long sc_hi3;
39 unsigned long sc_lo3;
40};
41
42#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
43 13
44#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 14#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
45 15
46#include <linux/posix_types.h>
47/*
48 * Keep this struct definition in sync with the sigcontext fragment
49 * in arch/mips/tools/offset.c
50 *
51 * Warning: this structure illdefined with sc_badvaddr being just an unsigned
52 * int so it was changed to unsigned long in 2.6.0-test1. This may break
53 * binary compatibility - no prisoners.
54 * DSP ASE in 2.6.12-rc4. Turn sc_mdhi and sc_mdlo into an array of four
55 * entries, add sc_dsp and sc_reserved for padding. No prisoners.
56 */
57struct sigcontext {
58 __u64 sc_regs[32];
59 __u64 sc_fpregs[32];
60 __u64 sc_mdhi;
61 __u64 sc_hi1;
62 __u64 sc_hi2;
63 __u64 sc_hi3;
64 __u64 sc_mdlo;
65 __u64 sc_lo1;
66 __u64 sc_lo2;
67 __u64 sc_lo3;
68 __u64 sc_pc;
69 __u32 sc_fpc_csr;
70 __u32 sc_used_math;
71 __u32 sc_dsp;
72 __u32 sc_reserved;
73};
74
75#ifdef __KERNEL__
76
77struct sigcontext32 { 16struct sigcontext32 {
78 __u32 sc_regmask; /* Unused */ 17 __u32 sc_regmask; /* Unused */
79 __u32 sc_status; /* Unused */ 18 __u32 sc_status; /* Unused */
@@ -94,8 +33,5 @@ struct sigcontext32 {
94 __u32 sc_hi3; 33 __u32 sc_hi3;
95 __u32 sc_lo3; 34 __u32 sc_lo3;
96}; 35};
97#endif /* __KERNEL__ */
98
99#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */ 36#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
100
101#endif /* _ASM_SIGCONTEXT_H */ 37#endif /* _ASM_SIGCONTEXT_H */
diff --git a/arch/mips/include/asm/siginfo.h b/arch/mips/include/asm/siginfo.h
index 20ebeb875ee6..dd9a762646fc 100644
--- a/arch/mips/include/asm/siginfo.h
+++ b/arch/mips/include/asm/siginfo.h
@@ -9,108 +9,8 @@
9#ifndef _ASM_SIGINFO_H 9#ifndef _ASM_SIGINFO_H
10#define _ASM_SIGINFO_H 10#define _ASM_SIGINFO_H
11 11
12#include <uapi/asm/siginfo.h>
12 13
13#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
14#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
15
16#define HAVE_ARCH_SIGINFO_T
17
18/*
19 * We duplicate the generic versions - <asm-generic/siginfo.h> is just borked
20 * by design ...
21 */
22#define HAVE_ARCH_COPY_SIGINFO
23struct siginfo;
24
25/*
26 * Careful to keep union _sifields from shifting ...
27 */
28#ifdef CONFIG_32BIT
29#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
30#endif
31#ifdef CONFIG_64BIT
32#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
33#endif
34
35#include <asm-generic/siginfo.h>
36
37typedef struct siginfo {
38 int si_signo;
39 int si_code;
40 int si_errno;
41 int __pad0[SI_MAX_SIZE / sizeof(int) - SI_PAD_SIZE - 3];
42
43 union {
44 int _pad[SI_PAD_SIZE];
45
46 /* kill() */
47 struct {
48 pid_t _pid; /* sender's pid */
49 __ARCH_SI_UID_T _uid; /* sender's uid */
50 } _kill;
51
52 /* POSIX.1b timers */
53 struct {
54 timer_t _tid; /* timer id */
55 int _overrun; /* overrun count */
56 char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
57 sigval_t _sigval; /* same as below */
58 int _sys_private; /* not to be passed to user */
59 } _timer;
60
61 /* POSIX.1b signals */
62 struct {
63 pid_t _pid; /* sender's pid */
64 __ARCH_SI_UID_T _uid; /* sender's uid */
65 sigval_t _sigval;
66 } _rt;
67
68 /* SIGCHLD */
69 struct {
70 pid_t _pid; /* which child */
71 __ARCH_SI_UID_T _uid; /* sender's uid */
72 int _status; /* exit code */
73 clock_t _utime;
74 clock_t _stime;
75 } _sigchld;
76
77 /* IRIX SIGCHLD */
78 struct {
79 pid_t _pid; /* which child */
80 clock_t _utime;
81 int _status; /* exit code */
82 clock_t _stime;
83 } _irix_sigchld;
84
85 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
86 struct {
87 void __user *_addr; /* faulting insn/memory ref. */
88#ifdef __ARCH_SI_TRAPNO
89 int _trapno; /* TRAP # which caused the signal */
90#endif
91 short _addr_lsb;
92 } _sigfault;
93
94 /* SIGPOLL, SIGXFSZ (To do ...) */
95 struct {
96 __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
97 int _fd;
98 } _sigpoll;
99 } _sifields;
100} siginfo_t;
101
102/*
103 * si_code values
104 * Again these have been chosen to be IRIX compatible.
105 */
106#undef SI_ASYNCIO
107#undef SI_TIMER
108#undef SI_MESGQ
109#define SI_ASYNCIO -2 /* sent by AIO completion */
110#define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */
111#define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */
112
113#ifdef __KERNEL__
114 14
115/* 15/*
116 * Duplicated here because of <asm-generic/siginfo.h> braindamage ... 16 * Duplicated here because of <asm-generic/siginfo.h> braindamage ...
@@ -126,6 +26,4 @@ static inline void copy_siginfo(struct siginfo *to, struct siginfo *from)
126 memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld)); 26 memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld));
127} 27}
128 28
129#endif
130
131#endif /* _ASM_SIGINFO_H */ 29#endif /* _ASM_SIGINFO_H */
diff --git a/arch/mips/include/asm/signal.h b/arch/mips/include/asm/signal.h
index c783f364938c..880240dff8b7 100644
--- a/arch/mips/include/asm/signal.h
+++ b/arch/mips/include/asm/signal.h
@@ -9,93 +9,8 @@
9#ifndef _ASM_SIGNAL_H 9#ifndef _ASM_SIGNAL_H
10#define _ASM_SIGNAL_H 10#define _ASM_SIGNAL_H
11 11
12#include <linux/types.h> 12#include <uapi/asm/signal.h>
13 13
14#define _NSIG 128
15#define _NSIG_BPW (sizeof(unsigned long) * 8)
16#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
17
18typedef struct {
19 unsigned long sig[_NSIG_WORDS];
20} sigset_t;
21
22typedef unsigned long old_sigset_t; /* at least 32 bits */
23
24#define SIGHUP 1 /* Hangup (POSIX). */
25#define SIGINT 2 /* Interrupt (ANSI). */
26#define SIGQUIT 3 /* Quit (POSIX). */
27#define SIGILL 4 /* Illegal instruction (ANSI). */
28#define SIGTRAP 5 /* Trace trap (POSIX). */
29#define SIGIOT 6 /* IOT trap (4.2 BSD). */
30#define SIGABRT SIGIOT /* Abort (ANSI). */
31#define SIGEMT 7
32#define SIGFPE 8 /* Floating-point exception (ANSI). */
33#define SIGKILL 9 /* Kill, unblockable (POSIX). */
34#define SIGBUS 10 /* BUS error (4.2 BSD). */
35#define SIGSEGV 11 /* Segmentation violation (ANSI). */
36#define SIGSYS 12
37#define SIGPIPE 13 /* Broken pipe (POSIX). */
38#define SIGALRM 14 /* Alarm clock (POSIX). */
39#define SIGTERM 15 /* Termination (ANSI). */
40#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */
41#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */
42#define SIGCHLD 18 /* Child status has changed (POSIX). */
43#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
44#define SIGPWR 19 /* Power failure restart (System V). */
45#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */
46#define SIGURG 21 /* Urgent condition on socket (4.2 BSD). */
47#define SIGIO 22 /* I/O now possible (4.2 BSD). */
48#define SIGPOLL SIGIO /* Pollable event occurred (System V). */
49#define SIGSTOP 23 /* Stop, unblockable (POSIX). */
50#define SIGTSTP 24 /* Keyboard stop (POSIX). */
51#define SIGCONT 25 /* Continue (POSIX). */
52#define SIGTTIN 26 /* Background read from tty (POSIX). */
53#define SIGTTOU 27 /* Background write to tty (POSIX). */
54#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */
55#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */
56#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */
57#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */
58
59/* These should not be considered constants from userland. */
60#define SIGRTMIN 32
61#define SIGRTMAX _NSIG
62
63/*
64 * SA_FLAGS values:
65 *
66 * SA_ONSTACK indicates that a registered stack_t will be used.
67 * SA_RESTART flag to get restarting signals (which were the default long ago)
68 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
69 * SA_RESETHAND clears the handler when the signal is delivered.
70 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
71 * SA_NODEFER prevents the current signal from being masked in the handler.
72 *
73 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
74 * Unix names RESETHAND and NODEFER respectively.
75 */
76#define SA_ONSTACK 0x08000000
77#define SA_RESETHAND 0x80000000
78#define SA_RESTART 0x10000000
79#define SA_SIGINFO 0x00000008
80#define SA_NODEFER 0x40000000
81#define SA_NOCLDWAIT 0x00010000
82#define SA_NOCLDSTOP 0x00000001
83
84#define SA_NOMASK SA_NODEFER
85#define SA_ONESHOT SA_RESETHAND
86
87#define SA_RESTORER 0x04000000 /* Only for o32 */
88
89/*
90 * sigaltstack controls
91 */
92#define SS_ONSTACK 1
93#define SS_DISABLE 2
94
95#define MINSIGSTKSZ 2048
96#define SIGSTKSZ 8192
97
98#ifdef __KERNEL__
99 14
100#ifdef CONFIG_TRAD_SIGNALS 15#ifdef CONFIG_TRAD_SIGNALS
101#define sig_uses_siginfo(ka) ((ka)->sa.sa_flags & SA_SIGINFO) 16#define sig_uses_siginfo(ka) ((ka)->sa.sa_flags & SA_SIGINFO)
@@ -103,37 +18,9 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */
103#define sig_uses_siginfo(ka) (1) 18#define sig_uses_siginfo(ka) (1)
104#endif 19#endif
105 20
106#endif /* __KERNEL__ */
107
108#define SIG_BLOCK 1 /* for blocking signals */
109#define SIG_UNBLOCK 2 /* for unblocking signals */
110#define SIG_SETMASK 3 /* for setting the signal mask */
111
112#include <asm-generic/signal-defs.h>
113
114struct sigaction {
115 unsigned int sa_flags;
116 __sighandler_t sa_handler;
117 sigset_t sa_mask;
118};
119
120struct k_sigaction {
121 struct sigaction sa;
122};
123
124/* IRIX compatible stack_t */
125typedef struct sigaltstack {
126 void __user *ss_sp;
127 size_t ss_size;
128 int ss_flags;
129} stack_t;
130
131#ifdef __KERNEL__
132#include <asm/sigcontext.h> 21#include <asm/sigcontext.h>
133#include <asm/siginfo.h> 22#include <asm/siginfo.h>
134 23
135#define ptrace_signal_deliver(regs, cookie) do { } while (0) 24#define ptrace_signal_deliver(regs, cookie) do { } while (0)
136 25
137#endif /* __KERNEL__ */
138
139#endif /* _ASM_SIGNAL_H */ 26#endif /* _ASM_SIGNAL_H */
diff --git a/arch/mips/include/asm/socket.h b/arch/mips/include/asm/socket.h
index a2ed6fdad4e0..4724a563c5bf 100644
--- a/arch/mips/include/asm/socket.h
+++ b/arch/mips/include/asm/socket.h
@@ -9,87 +9,8 @@
9#ifndef _ASM_SOCKET_H 9#ifndef _ASM_SOCKET_H
10#define _ASM_SOCKET_H 10#define _ASM_SOCKET_H
11 11
12#include <asm/sockios.h> 12#include <uapi/asm/socket.h>
13 13
14/*
15 * For setsockopt(2)
16 *
17 * This defines are ABI conformant as far as Linux supports these ...
18 */
19#define SOL_SOCKET 0xffff
20
21#define SO_DEBUG 0x0001 /* Record debugging information. */
22#define SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. */
23#define SO_KEEPALIVE 0x0008 /* Keep connections alive and send
24 SIGPIPE when they die. */
25#define SO_DONTROUTE 0x0010 /* Don't do local routing. */
26#define SO_BROADCAST 0x0020 /* Allow transmission of
27 broadcast messages. */
28#define SO_LINGER 0x0080 /* Block on close of a reliable
29 socket to transmit pending data. */
30#define SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. */
31#if 0
32To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
33#endif
34
35#define SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */
36#define SO_STYLE SO_TYPE /* Synonym */
37#define SO_ERROR 0x1007 /* get error status and clear */
38#define SO_SNDBUF 0x1001 /* Send buffer size. */
39#define SO_RCVBUF 0x1002 /* Receive buffer. */
40#define SO_SNDLOWAT 0x1003 /* send low-water mark */
41#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
42#define SO_SNDTIMEO 0x1005 /* send timeout */
43#define SO_RCVTIMEO 0x1006 /* receive timeout */
44#define SO_ACCEPTCONN 0x1009
45#define SO_PROTOCOL 0x1028 /* protocol type */
46#define SO_DOMAIN 0x1029 /* domain/socket family */
47
48/* linux-specific, might as well be the same as on i386 */
49#define SO_NO_CHECK 11
50#define SO_PRIORITY 12
51#define SO_BSDCOMPAT 14
52
53#define SO_PASSCRED 17
54#define SO_PEERCRED 18
55
56/* Security levels - as per NRL IPv6 - don't actually do anything */
57#define SO_SECURITY_AUTHENTICATION 22
58#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
59#define SO_SECURITY_ENCRYPTION_NETWORK 24
60
61#define SO_BINDTODEVICE 25
62
63/* Socket filtering */
64#define SO_ATTACH_FILTER 26
65#define SO_DETACH_FILTER 27
66
67#define SO_PEERNAME 28
68#define SO_TIMESTAMP 29
69#define SCM_TIMESTAMP SO_TIMESTAMP
70
71#define SO_PEERSEC 30
72#define SO_SNDBUFFORCE 31
73#define SO_RCVBUFFORCE 33
74#define SO_PASSSEC 34
75#define SO_TIMESTAMPNS 35
76#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
77
78#define SO_MARK 36
79
80#define SO_TIMESTAMPING 37
81#define SCM_TIMESTAMPING SO_TIMESTAMPING
82
83#define SO_RXQ_OVFL 40
84
85#define SO_WIFI_STATUS 41
86#define SCM_WIFI_STATUS SO_WIFI_STATUS
87#define SO_PEEK_OFF 42
88
89/* Instruct lower device to use last 4-bytes of skb data as FCS */
90#define SO_NOFCS 43
91
92#ifdef __KERNEL__
93 14
94/** sock_type - Socket types 15/** sock_type - Socket types
95 * 16 *
@@ -126,6 +47,4 @@ enum sock_type {
126 47
127#define ARCH_HAS_SOCKET_TYPES 1 48#define ARCH_HAS_SOCKET_TYPES 1
128 49
129#endif /* __KERNEL__ */
130
131#endif /* _ASM_SOCKET_H */ 50#endif /* _ASM_SOCKET_H */
diff --git a/arch/mips/include/asm/termios.h b/arch/mips/include/asm/termios.h
index abdd87aaf609..6245b68a69a8 100644
--- a/arch/mips/include/asm/termios.h
+++ b/arch/mips/include/asm/termios.h
@@ -9,58 +9,8 @@
9#ifndef _ASM_TERMIOS_H 9#ifndef _ASM_TERMIOS_H
10#define _ASM_TERMIOS_H 10#define _ASM_TERMIOS_H
11 11
12#include <linux/errno.h>
13#include <asm/termbits.h>
14#include <asm/ioctls.h>
15
16struct sgttyb {
17 char sg_ispeed;
18 char sg_ospeed;
19 char sg_erase;
20 char sg_kill;
21 int sg_flags; /* SGI special - int, not short */
22};
23
24struct tchars {
25 char t_intrc;
26 char t_quitc;
27 char t_startc;
28 char t_stopc;
29 char t_eofc;
30 char t_brkc;
31};
32
33struct ltchars {
34 char t_suspc; /* stop process signal */
35 char t_dsuspc; /* delayed stop process signal */
36 char t_rprntc; /* reprint line */
37 char t_flushc; /* flush output (toggles) */
38 char t_werasc; /* word erase */
39 char t_lnextc; /* literal next character */
40};
41
42/* TIOCGSIZE, TIOCSSIZE not defined yet. Only needed for SunOS source
43 compatibility anyway ... */
44
45struct winsize {
46 unsigned short ws_row;
47 unsigned short ws_col;
48 unsigned short ws_xpixel;
49 unsigned short ws_ypixel;
50};
51
52#define NCC 8
53struct termio {
54 unsigned short c_iflag; /* input mode flags */
55 unsigned short c_oflag; /* output mode flags */
56 unsigned short c_cflag; /* control mode flags */
57 unsigned short c_lflag; /* local mode flags */
58 char c_line; /* line discipline */
59 unsigned char c_cc[NCCS]; /* control characters */
60};
61
62#ifdef __KERNEL__
63#include <asm/uaccess.h> 12#include <asm/uaccess.h>
13#include <uapi/asm/termios.h>
64 14
65/* 15/*
66 * intr=^C quit=^\ erase=del kill=^U 16 * intr=^C quit=^\ erase=del kill=^U
@@ -70,25 +20,6 @@ struct termio {
70 * eof=^D eol=\0 20 * eof=^D eol=\0
71 */ 21 */
72#define INIT_C_CC "\003\034\177\025\1\0\0\0\021\023\032\0\022\017\027\026\004\0" 22#define INIT_C_CC "\003\034\177\025\1\0\0\0\021\023\032\0\022\017\027\026\004\0"
73#endif
74
75/* modem lines */
76#define TIOCM_LE 0x001 /* line enable */
77#define TIOCM_DTR 0x002 /* data terminal ready */
78#define TIOCM_RTS 0x004 /* request to send */
79#define TIOCM_ST 0x010 /* secondary transmit */
80#define TIOCM_SR 0x020 /* secondary receive */
81#define TIOCM_CTS 0x040 /* clear to send */
82#define TIOCM_CAR 0x100 /* carrier detect */
83#define TIOCM_CD TIOCM_CAR
84#define TIOCM_RNG 0x200 /* ring */
85#define TIOCM_RI TIOCM_RNG
86#define TIOCM_DSR 0x400 /* data set ready */
87#define TIOCM_OUT1 0x2000
88#define TIOCM_OUT2 0x4000
89#define TIOCM_LOOP 0x8000
90
91#ifdef __KERNEL__
92 23
93#include <linux/string.h> 24#include <linux/string.h>
94 25
@@ -171,6 +102,4 @@ static inline int kernel_termios_to_user_termios_1(struct termios __user *u,
171 return copy_to_user(u, k, sizeof(struct termios)) ? -EFAULT : 0; 102 return copy_to_user(u, k, sizeof(struct termios)) ? -EFAULT : 0;
172} 103}
173 104
174#endif /* defined(__KERNEL__) */
175
176#endif /* _ASM_TERMIOS_H */ 105#endif /* _ASM_TERMIOS_H */
diff --git a/arch/mips/include/asm/types.h b/arch/mips/include/asm/types.h
index 1228b25b290a..a845aafedee4 100644
--- a/arch/mips/include/asm/types.h
+++ b/arch/mips/include/asm/types.h
@@ -11,24 +11,12 @@
11#ifndef _ASM_TYPES_H 11#ifndef _ASM_TYPES_H
12#define _ASM_TYPES_H 12#define _ASM_TYPES_H
13 13
14/*
15 * We don't use int-l64.h for the kernel anymore but still use it for
16 * userspace to avoid code changes.
17 */
18#ifdef __KERNEL__
19# include <asm-generic/int-ll64.h> 14# include <asm-generic/int-ll64.h>
20#else 15#include <uapi/asm/types.h>
21# if _MIPS_SZLONG == 64
22# include <asm-generic/int-l64.h>
23# else
24# include <asm-generic/int-ll64.h>
25# endif
26#endif
27 16
28/* 17/*
29 * These aren't exported outside the kernel to avoid name space clashes 18 * These aren't exported outside the kernel to avoid name space clashes
30 */ 19 */
31#ifdef __KERNEL__
32#ifndef __ASSEMBLY__ 20#ifndef __ASSEMBLY__
33 21
34/* 22/*
@@ -42,6 +30,4 @@ typedef unsigned long phys_t;
42 30
43#endif /* __ASSEMBLY__ */ 31#endif /* __ASSEMBLY__ */
44 32
45#endif /* __KERNEL__ */
46
47#endif /* _ASM_TYPES_H */ 33#endif /* _ASM_TYPES_H */
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h
index 161fc4d976e4..9e47cc11aa26 100644
--- a/arch/mips/include/asm/unistd.h
+++ b/arch/mips/include/asm/unistd.h
@@ -12,1027 +12,8 @@
12#ifndef _ASM_UNISTD_H 12#ifndef _ASM_UNISTD_H
13#define _ASM_UNISTD_H 13#define _ASM_UNISTD_H
14 14
15#include <asm/sgidefs.h> 15#include <uapi/asm/unistd.h>
16 16
17#if _MIPS_SIM == _MIPS_SIM_ABI32
18
19/*
20 * Linux o32 style syscalls are in the range from 4000 to 4999.
21 */
22#define __NR_Linux 4000
23#define __NR_syscall (__NR_Linux + 0)
24#define __NR_exit (__NR_Linux + 1)
25#define __NR_fork (__NR_Linux + 2)
26#define __NR_read (__NR_Linux + 3)
27#define __NR_write (__NR_Linux + 4)
28#define __NR_open (__NR_Linux + 5)
29#define __NR_close (__NR_Linux + 6)
30#define __NR_waitpid (__NR_Linux + 7)
31#define __NR_creat (__NR_Linux + 8)
32#define __NR_link (__NR_Linux + 9)
33#define __NR_unlink (__NR_Linux + 10)
34#define __NR_execve (__NR_Linux + 11)
35#define __NR_chdir (__NR_Linux + 12)
36#define __NR_time (__NR_Linux + 13)
37#define __NR_mknod (__NR_Linux + 14)
38#define __NR_chmod (__NR_Linux + 15)
39#define __NR_lchown (__NR_Linux + 16)
40#define __NR_break (__NR_Linux + 17)
41#define __NR_unused18 (__NR_Linux + 18)
42#define __NR_lseek (__NR_Linux + 19)
43#define __NR_getpid (__NR_Linux + 20)
44#define __NR_mount (__NR_Linux + 21)
45#define __NR_umount (__NR_Linux + 22)
46#define __NR_setuid (__NR_Linux + 23)
47#define __NR_getuid (__NR_Linux + 24)
48#define __NR_stime (__NR_Linux + 25)
49#define __NR_ptrace (__NR_Linux + 26)
50#define __NR_alarm (__NR_Linux + 27)
51#define __NR_unused28 (__NR_Linux + 28)
52#define __NR_pause (__NR_Linux + 29)
53#define __NR_utime (__NR_Linux + 30)
54#define __NR_stty (__NR_Linux + 31)
55#define __NR_gtty (__NR_Linux + 32)
56#define __NR_access (__NR_Linux + 33)
57#define __NR_nice (__NR_Linux + 34)
58#define __NR_ftime (__NR_Linux + 35)
59#define __NR_sync (__NR_Linux + 36)
60#define __NR_kill (__NR_Linux + 37)
61#define __NR_rename (__NR_Linux + 38)
62#define __NR_mkdir (__NR_Linux + 39)
63#define __NR_rmdir (__NR_Linux + 40)
64#define __NR_dup (__NR_Linux + 41)
65#define __NR_pipe (__NR_Linux + 42)
66#define __NR_times (__NR_Linux + 43)
67#define __NR_prof (__NR_Linux + 44)
68#define __NR_brk (__NR_Linux + 45)
69#define __NR_setgid (__NR_Linux + 46)
70#define __NR_getgid (__NR_Linux + 47)
71#define __NR_signal (__NR_Linux + 48)
72#define __NR_geteuid (__NR_Linux + 49)
73#define __NR_getegid (__NR_Linux + 50)
74#define __NR_acct (__NR_Linux + 51)
75#define __NR_umount2 (__NR_Linux + 52)
76#define __NR_lock (__NR_Linux + 53)
77#define __NR_ioctl (__NR_Linux + 54)
78#define __NR_fcntl (__NR_Linux + 55)
79#define __NR_mpx (__NR_Linux + 56)
80#define __NR_setpgid (__NR_Linux + 57)
81#define __NR_ulimit (__NR_Linux + 58)
82#define __NR_unused59 (__NR_Linux + 59)
83#define __NR_umask (__NR_Linux + 60)
84#define __NR_chroot (__NR_Linux + 61)
85#define __NR_ustat (__NR_Linux + 62)
86#define __NR_dup2 (__NR_Linux + 63)
87#define __NR_getppid (__NR_Linux + 64)
88#define __NR_getpgrp (__NR_Linux + 65)
89#define __NR_setsid (__NR_Linux + 66)
90#define __NR_sigaction (__NR_Linux + 67)
91#define __NR_sgetmask (__NR_Linux + 68)
92#define __NR_ssetmask (__NR_Linux + 69)
93#define __NR_setreuid (__NR_Linux + 70)
94#define __NR_setregid (__NR_Linux + 71)
95#define __NR_sigsuspend (__NR_Linux + 72)
96#define __NR_sigpending (__NR_Linux + 73)
97#define __NR_sethostname (__NR_Linux + 74)
98#define __NR_setrlimit (__NR_Linux + 75)
99#define __NR_getrlimit (__NR_Linux + 76)
100#define __NR_getrusage (__NR_Linux + 77)
101#define __NR_gettimeofday (__NR_Linux + 78)
102#define __NR_settimeofday (__NR_Linux + 79)
103#define __NR_getgroups (__NR_Linux + 80)
104#define __NR_setgroups (__NR_Linux + 81)
105#define __NR_reserved82 (__NR_Linux + 82)
106#define __NR_symlink (__NR_Linux + 83)
107#define __NR_unused84 (__NR_Linux + 84)
108#define __NR_readlink (__NR_Linux + 85)
109#define __NR_uselib (__NR_Linux + 86)
110#define __NR_swapon (__NR_Linux + 87)
111#define __NR_reboot (__NR_Linux + 88)
112#define __NR_readdir (__NR_Linux + 89)
113#define __NR_mmap (__NR_Linux + 90)
114#define __NR_munmap (__NR_Linux + 91)
115#define __NR_truncate (__NR_Linux + 92)
116#define __NR_ftruncate (__NR_Linux + 93)
117#define __NR_fchmod (__NR_Linux + 94)
118#define __NR_fchown (__NR_Linux + 95)
119#define __NR_getpriority (__NR_Linux + 96)
120#define __NR_setpriority (__NR_Linux + 97)
121#define __NR_profil (__NR_Linux + 98)
122#define __NR_statfs (__NR_Linux + 99)
123#define __NR_fstatfs (__NR_Linux + 100)
124#define __NR_ioperm (__NR_Linux + 101)
125#define __NR_socketcall (__NR_Linux + 102)
126#define __NR_syslog (__NR_Linux + 103)
127#define __NR_setitimer (__NR_Linux + 104)
128#define __NR_getitimer (__NR_Linux + 105)
129#define __NR_stat (__NR_Linux + 106)
130#define __NR_lstat (__NR_Linux + 107)
131#define __NR_fstat (__NR_Linux + 108)
132#define __NR_unused109 (__NR_Linux + 109)
133#define __NR_iopl (__NR_Linux + 110)
134#define __NR_vhangup (__NR_Linux + 111)
135#define __NR_idle (__NR_Linux + 112)
136#define __NR_vm86 (__NR_Linux + 113)
137#define __NR_wait4 (__NR_Linux + 114)
138#define __NR_swapoff (__NR_Linux + 115)
139#define __NR_sysinfo (__NR_Linux + 116)
140#define __NR_ipc (__NR_Linux + 117)
141#define __NR_fsync (__NR_Linux + 118)
142#define __NR_sigreturn (__NR_Linux + 119)
143#define __NR_clone (__NR_Linux + 120)
144#define __NR_setdomainname (__NR_Linux + 121)
145#define __NR_uname (__NR_Linux + 122)
146#define __NR_modify_ldt (__NR_Linux + 123)
147#define __NR_adjtimex (__NR_Linux + 124)
148#define __NR_mprotect (__NR_Linux + 125)
149#define __NR_sigprocmask (__NR_Linux + 126)
150#define __NR_create_module (__NR_Linux + 127)
151#define __NR_init_module (__NR_Linux + 128)
152#define __NR_delete_module (__NR_Linux + 129)
153#define __NR_get_kernel_syms (__NR_Linux + 130)
154#define __NR_quotactl (__NR_Linux + 131)
155#define __NR_getpgid (__NR_Linux + 132)
156#define __NR_fchdir (__NR_Linux + 133)
157#define __NR_bdflush (__NR_Linux + 134)
158#define __NR_sysfs (__NR_Linux + 135)
159#define __NR_personality (__NR_Linux + 136)
160#define __NR_afs_syscall (__NR_Linux + 137) /* Syscall for Andrew File System */
161#define __NR_setfsuid (__NR_Linux + 138)
162#define __NR_setfsgid (__NR_Linux + 139)
163#define __NR__llseek (__NR_Linux + 140)
164#define __NR_getdents (__NR_Linux + 141)
165#define __NR__newselect (__NR_Linux + 142)
166#define __NR_flock (__NR_Linux + 143)
167#define __NR_msync (__NR_Linux + 144)
168#define __NR_readv (__NR_Linux + 145)
169#define __NR_writev (__NR_Linux + 146)
170#define __NR_cacheflush (__NR_Linux + 147)
171#define __NR_cachectl (__NR_Linux + 148)
172#define __NR_sysmips (__NR_Linux + 149)
173#define __NR_unused150 (__NR_Linux + 150)
174#define __NR_getsid (__NR_Linux + 151)
175#define __NR_fdatasync (__NR_Linux + 152)
176#define __NR__sysctl (__NR_Linux + 153)
177#define __NR_mlock (__NR_Linux + 154)
178#define __NR_munlock (__NR_Linux + 155)
179#define __NR_mlockall (__NR_Linux + 156)
180#define __NR_munlockall (__NR_Linux + 157)
181#define __NR_sched_setparam (__NR_Linux + 158)
182#define __NR_sched_getparam (__NR_Linux + 159)
183#define __NR_sched_setscheduler (__NR_Linux + 160)
184#define __NR_sched_getscheduler (__NR_Linux + 161)
185#define __NR_sched_yield (__NR_Linux + 162)
186#define __NR_sched_get_priority_max (__NR_Linux + 163)
187#define __NR_sched_get_priority_min (__NR_Linux + 164)
188#define __NR_sched_rr_get_interval (__NR_Linux + 165)
189#define __NR_nanosleep (__NR_Linux + 166)
190#define __NR_mremap (__NR_Linux + 167)
191#define __NR_accept (__NR_Linux + 168)
192#define __NR_bind (__NR_Linux + 169)
193#define __NR_connect (__NR_Linux + 170)
194#define __NR_getpeername (__NR_Linux + 171)
195#define __NR_getsockname (__NR_Linux + 172)
196#define __NR_getsockopt (__NR_Linux + 173)
197#define __NR_listen (__NR_Linux + 174)
198#define __NR_recv (__NR_Linux + 175)
199#define __NR_recvfrom (__NR_Linux + 176)
200#define __NR_recvmsg (__NR_Linux + 177)
201#define __NR_send (__NR_Linux + 178)
202#define __NR_sendmsg (__NR_Linux + 179)
203#define __NR_sendto (__NR_Linux + 180)
204#define __NR_setsockopt (__NR_Linux + 181)
205#define __NR_shutdown (__NR_Linux + 182)
206#define __NR_socket (__NR_Linux + 183)
207#define __NR_socketpair (__NR_Linux + 184)
208#define __NR_setresuid (__NR_Linux + 185)
209#define __NR_getresuid (__NR_Linux + 186)
210#define __NR_query_module (__NR_Linux + 187)
211#define __NR_poll (__NR_Linux + 188)
212#define __NR_nfsservctl (__NR_Linux + 189)
213#define __NR_setresgid (__NR_Linux + 190)
214#define __NR_getresgid (__NR_Linux + 191)
215#define __NR_prctl (__NR_Linux + 192)
216#define __NR_rt_sigreturn (__NR_Linux + 193)
217#define __NR_rt_sigaction (__NR_Linux + 194)
218#define __NR_rt_sigprocmask (__NR_Linux + 195)
219#define __NR_rt_sigpending (__NR_Linux + 196)
220#define __NR_rt_sigtimedwait (__NR_Linux + 197)
221#define __NR_rt_sigqueueinfo (__NR_Linux + 198)
222#define __NR_rt_sigsuspend (__NR_Linux + 199)
223#define __NR_pread64 (__NR_Linux + 200)
224#define __NR_pwrite64 (__NR_Linux + 201)
225#define __NR_chown (__NR_Linux + 202)
226#define __NR_getcwd (__NR_Linux + 203)
227#define __NR_capget (__NR_Linux + 204)
228#define __NR_capset (__NR_Linux + 205)
229#define __NR_sigaltstack (__NR_Linux + 206)
230#define __NR_sendfile (__NR_Linux + 207)
231#define __NR_getpmsg (__NR_Linux + 208)
232#define __NR_putpmsg (__NR_Linux + 209)
233#define __NR_mmap2 (__NR_Linux + 210)
234#define __NR_truncate64 (__NR_Linux + 211)
235#define __NR_ftruncate64 (__NR_Linux + 212)
236#define __NR_stat64 (__NR_Linux + 213)
237#define __NR_lstat64 (__NR_Linux + 214)
238#define __NR_fstat64 (__NR_Linux + 215)
239#define __NR_pivot_root (__NR_Linux + 216)
240#define __NR_mincore (__NR_Linux + 217)
241#define __NR_madvise (__NR_Linux + 218)
242#define __NR_getdents64 (__NR_Linux + 219)
243#define __NR_fcntl64 (__NR_Linux + 220)
244#define __NR_reserved221 (__NR_Linux + 221)
245#define __NR_gettid (__NR_Linux + 222)
246#define __NR_readahead (__NR_Linux + 223)
247#define __NR_setxattr (__NR_Linux + 224)
248#define __NR_lsetxattr (__NR_Linux + 225)
249#define __NR_fsetxattr (__NR_Linux + 226)
250#define __NR_getxattr (__NR_Linux + 227)
251#define __NR_lgetxattr (__NR_Linux + 228)
252#define __NR_fgetxattr (__NR_Linux + 229)
253#define __NR_listxattr (__NR_Linux + 230)
254#define __NR_llistxattr (__NR_Linux + 231)
255#define __NR_flistxattr (__NR_Linux + 232)
256#define __NR_removexattr (__NR_Linux + 233)
257#define __NR_lremovexattr (__NR_Linux + 234)
258#define __NR_fremovexattr (__NR_Linux + 235)
259#define __NR_tkill (__NR_Linux + 236)
260#define __NR_sendfile64 (__NR_Linux + 237)
261#define __NR_futex (__NR_Linux + 238)
262#define __NR_sched_setaffinity (__NR_Linux + 239)
263#define __NR_sched_getaffinity (__NR_Linux + 240)
264#define __NR_io_setup (__NR_Linux + 241)
265#define __NR_io_destroy (__NR_Linux + 242)
266#define __NR_io_getevents (__NR_Linux + 243)
267#define __NR_io_submit (__NR_Linux + 244)
268#define __NR_io_cancel (__NR_Linux + 245)
269#define __NR_exit_group (__NR_Linux + 246)
270#define __NR_lookup_dcookie (__NR_Linux + 247)
271#define __NR_epoll_create (__NR_Linux + 248)
272#define __NR_epoll_ctl (__NR_Linux + 249)
273#define __NR_epoll_wait (__NR_Linux + 250)
274#define __NR_remap_file_pages (__NR_Linux + 251)
275#define __NR_set_tid_address (__NR_Linux + 252)
276#define __NR_restart_syscall (__NR_Linux + 253)
277#define __NR_fadvise64 (__NR_Linux + 254)
278#define __NR_statfs64 (__NR_Linux + 255)
279#define __NR_fstatfs64 (__NR_Linux + 256)
280#define __NR_timer_create (__NR_Linux + 257)
281#define __NR_timer_settime (__NR_Linux + 258)
282#define __NR_timer_gettime (__NR_Linux + 259)
283#define __NR_timer_getoverrun (__NR_Linux + 260)
284#define __NR_timer_delete (__NR_Linux + 261)
285#define __NR_clock_settime (__NR_Linux + 262)
286#define __NR_clock_gettime (__NR_Linux + 263)
287#define __NR_clock_getres (__NR_Linux + 264)
288#define __NR_clock_nanosleep (__NR_Linux + 265)
289#define __NR_tgkill (__NR_Linux + 266)
290#define __NR_utimes (__NR_Linux + 267)
291#define __NR_mbind (__NR_Linux + 268)
292#define __NR_get_mempolicy (__NR_Linux + 269)
293#define __NR_set_mempolicy (__NR_Linux + 270)
294#define __NR_mq_open (__NR_Linux + 271)
295#define __NR_mq_unlink (__NR_Linux + 272)
296#define __NR_mq_timedsend (__NR_Linux + 273)
297#define __NR_mq_timedreceive (__NR_Linux + 274)
298#define __NR_mq_notify (__NR_Linux + 275)
299#define __NR_mq_getsetattr (__NR_Linux + 276)
300#define __NR_vserver (__NR_Linux + 277)
301#define __NR_waitid (__NR_Linux + 278)
302/* #define __NR_sys_setaltroot (__NR_Linux + 279) */
303#define __NR_add_key (__NR_Linux + 280)
304#define __NR_request_key (__NR_Linux + 281)
305#define __NR_keyctl (__NR_Linux + 282)
306#define __NR_set_thread_area (__NR_Linux + 283)
307#define __NR_inotify_init (__NR_Linux + 284)
308#define __NR_inotify_add_watch (__NR_Linux + 285)
309#define __NR_inotify_rm_watch (__NR_Linux + 286)
310#define __NR_migrate_pages (__NR_Linux + 287)
311#define __NR_openat (__NR_Linux + 288)
312#define __NR_mkdirat (__NR_Linux + 289)
313#define __NR_mknodat (__NR_Linux + 290)
314#define __NR_fchownat (__NR_Linux + 291)
315#define __NR_futimesat (__NR_Linux + 292)
316#define __NR_fstatat64 (__NR_Linux + 293)
317#define __NR_unlinkat (__NR_Linux + 294)
318#define __NR_renameat (__NR_Linux + 295)
319#define __NR_linkat (__NR_Linux + 296)
320#define __NR_symlinkat (__NR_Linux + 297)
321#define __NR_readlinkat (__NR_Linux + 298)
322#define __NR_fchmodat (__NR_Linux + 299)
323#define __NR_faccessat (__NR_Linux + 300)
324#define __NR_pselect6 (__NR_Linux + 301)
325#define __NR_ppoll (__NR_Linux + 302)
326#define __NR_unshare (__NR_Linux + 303)
327#define __NR_splice (__NR_Linux + 304)
328#define __NR_sync_file_range (__NR_Linux + 305)
329#define __NR_tee (__NR_Linux + 306)
330#define __NR_vmsplice (__NR_Linux + 307)
331#define __NR_move_pages (__NR_Linux + 308)
332#define __NR_set_robust_list (__NR_Linux + 309)
333#define __NR_get_robust_list (__NR_Linux + 310)
334#define __NR_kexec_load (__NR_Linux + 311)
335#define __NR_getcpu (__NR_Linux + 312)
336#define __NR_epoll_pwait (__NR_Linux + 313)
337#define __NR_ioprio_set (__NR_Linux + 314)
338#define __NR_ioprio_get (__NR_Linux + 315)
339#define __NR_utimensat (__NR_Linux + 316)
340#define __NR_signalfd (__NR_Linux + 317)
341#define __NR_timerfd (__NR_Linux + 318)
342#define __NR_eventfd (__NR_Linux + 319)
343#define __NR_fallocate (__NR_Linux + 320)
344#define __NR_timerfd_create (__NR_Linux + 321)
345#define __NR_timerfd_gettime (__NR_Linux + 322)
346#define __NR_timerfd_settime (__NR_Linux + 323)
347#define __NR_signalfd4 (__NR_Linux + 324)
348#define __NR_eventfd2 (__NR_Linux + 325)
349#define __NR_epoll_create1 (__NR_Linux + 326)
350#define __NR_dup3 (__NR_Linux + 327)
351#define __NR_pipe2 (__NR_Linux + 328)
352#define __NR_inotify_init1 (__NR_Linux + 329)
353#define __NR_preadv (__NR_Linux + 330)
354#define __NR_pwritev (__NR_Linux + 331)
355#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332)
356#define __NR_perf_event_open (__NR_Linux + 333)
357#define __NR_accept4 (__NR_Linux + 334)
358#define __NR_recvmmsg (__NR_Linux + 335)
359#define __NR_fanotify_init (__NR_Linux + 336)
360#define __NR_fanotify_mark (__NR_Linux + 337)
361#define __NR_prlimit64 (__NR_Linux + 338)
362#define __NR_name_to_handle_at (__NR_Linux + 339)
363#define __NR_open_by_handle_at (__NR_Linux + 340)
364#define __NR_clock_adjtime (__NR_Linux + 341)
365#define __NR_syncfs (__NR_Linux + 342)
366#define __NR_sendmmsg (__NR_Linux + 343)
367#define __NR_setns (__NR_Linux + 344)
368#define __NR_process_vm_readv (__NR_Linux + 345)
369#define __NR_process_vm_writev (__NR_Linux + 346)
370#define __NR_kcmp (__NR_Linux + 347)
371
372/*
373 * Offset of the last Linux o32 flavoured syscall
374 */
375#define __NR_Linux_syscalls 347
376
377#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
378
379#define __NR_O32_Linux 4000
380#define __NR_O32_Linux_syscalls 347
381
382#if _MIPS_SIM == _MIPS_SIM_ABI64
383
384/*
385 * Linux 64-bit syscalls are in the range from 5000 to 5999.
386 */
387#define __NR_Linux 5000
388#define __NR_read (__NR_Linux + 0)
389#define __NR_write (__NR_Linux + 1)
390#define __NR_open (__NR_Linux + 2)
391#define __NR_close (__NR_Linux + 3)
392#define __NR_stat (__NR_Linux + 4)
393#define __NR_fstat (__NR_Linux + 5)
394#define __NR_lstat (__NR_Linux + 6)
395#define __NR_poll (__NR_Linux + 7)
396#define __NR_lseek (__NR_Linux + 8)
397#define __NR_mmap (__NR_Linux + 9)
398#define __NR_mprotect (__NR_Linux + 10)
399#define __NR_munmap (__NR_Linux + 11)
400#define __NR_brk (__NR_Linux + 12)
401#define __NR_rt_sigaction (__NR_Linux + 13)
402#define __NR_rt_sigprocmask (__NR_Linux + 14)
403#define __NR_ioctl (__NR_Linux + 15)
404#define __NR_pread64 (__NR_Linux + 16)
405#define __NR_pwrite64 (__NR_Linux + 17)
406#define __NR_readv (__NR_Linux + 18)
407#define __NR_writev (__NR_Linux + 19)
408#define __NR_access (__NR_Linux + 20)
409#define __NR_pipe (__NR_Linux + 21)
410#define __NR__newselect (__NR_Linux + 22)
411#define __NR_sched_yield (__NR_Linux + 23)
412#define __NR_mremap (__NR_Linux + 24)
413#define __NR_msync (__NR_Linux + 25)
414#define __NR_mincore (__NR_Linux + 26)
415#define __NR_madvise (__NR_Linux + 27)
416#define __NR_shmget (__NR_Linux + 28)
417#define __NR_shmat (__NR_Linux + 29)
418#define __NR_shmctl (__NR_Linux + 30)
419#define __NR_dup (__NR_Linux + 31)
420#define __NR_dup2 (__NR_Linux + 32)
421#define __NR_pause (__NR_Linux + 33)
422#define __NR_nanosleep (__NR_Linux + 34)
423#define __NR_getitimer (__NR_Linux + 35)
424#define __NR_setitimer (__NR_Linux + 36)
425#define __NR_alarm (__NR_Linux + 37)
426#define __NR_getpid (__NR_Linux + 38)
427#define __NR_sendfile (__NR_Linux + 39)
428#define __NR_socket (__NR_Linux + 40)
429#define __NR_connect (__NR_Linux + 41)
430#define __NR_accept (__NR_Linux + 42)
431#define __NR_sendto (__NR_Linux + 43)
432#define __NR_recvfrom (__NR_Linux + 44)
433#define __NR_sendmsg (__NR_Linux + 45)
434#define __NR_recvmsg (__NR_Linux + 46)
435#define __NR_shutdown (__NR_Linux + 47)
436#define __NR_bind (__NR_Linux + 48)
437#define __NR_listen (__NR_Linux + 49)
438#define __NR_getsockname (__NR_Linux + 50)
439#define __NR_getpeername (__NR_Linux + 51)
440#define __NR_socketpair (__NR_Linux + 52)
441#define __NR_setsockopt (__NR_Linux + 53)
442#define __NR_getsockopt (__NR_Linux + 54)
443#define __NR_clone (__NR_Linux + 55)
444#define __NR_fork (__NR_Linux + 56)
445#define __NR_execve (__NR_Linux + 57)
446#define __NR_exit (__NR_Linux + 58)
447#define __NR_wait4 (__NR_Linux + 59)
448#define __NR_kill (__NR_Linux + 60)
449#define __NR_uname (__NR_Linux + 61)
450#define __NR_semget (__NR_Linux + 62)
451#define __NR_semop (__NR_Linux + 63)
452#define __NR_semctl (__NR_Linux + 64)
453#define __NR_shmdt (__NR_Linux + 65)
454#define __NR_msgget (__NR_Linux + 66)
455#define __NR_msgsnd (__NR_Linux + 67)
456#define __NR_msgrcv (__NR_Linux + 68)
457#define __NR_msgctl (__NR_Linux + 69)
458#define __NR_fcntl (__NR_Linux + 70)
459#define __NR_flock (__NR_Linux + 71)
460#define __NR_fsync (__NR_Linux + 72)
461#define __NR_fdatasync (__NR_Linux + 73)
462#define __NR_truncate (__NR_Linux + 74)
463#define __NR_ftruncate (__NR_Linux + 75)
464#define __NR_getdents (__NR_Linux + 76)
465#define __NR_getcwd (__NR_Linux + 77)
466#define __NR_chdir (__NR_Linux + 78)
467#define __NR_fchdir (__NR_Linux + 79)
468#define __NR_rename (__NR_Linux + 80)
469#define __NR_mkdir (__NR_Linux + 81)
470#define __NR_rmdir (__NR_Linux + 82)
471#define __NR_creat (__NR_Linux + 83)
472#define __NR_link (__NR_Linux + 84)
473#define __NR_unlink (__NR_Linux + 85)
474#define __NR_symlink (__NR_Linux + 86)
475#define __NR_readlink (__NR_Linux + 87)
476#define __NR_chmod (__NR_Linux + 88)
477#define __NR_fchmod (__NR_Linux + 89)
478#define __NR_chown (__NR_Linux + 90)
479#define __NR_fchown (__NR_Linux + 91)
480#define __NR_lchown (__NR_Linux + 92)
481#define __NR_umask (__NR_Linux + 93)
482#define __NR_gettimeofday (__NR_Linux + 94)
483#define __NR_getrlimit (__NR_Linux + 95)
484#define __NR_getrusage (__NR_Linux + 96)
485#define __NR_sysinfo (__NR_Linux + 97)
486#define __NR_times (__NR_Linux + 98)
487#define __NR_ptrace (__NR_Linux + 99)
488#define __NR_getuid (__NR_Linux + 100)
489#define __NR_syslog (__NR_Linux + 101)
490#define __NR_getgid (__NR_Linux + 102)
491#define __NR_setuid (__NR_Linux + 103)
492#define __NR_setgid (__NR_Linux + 104)
493#define __NR_geteuid (__NR_Linux + 105)
494#define __NR_getegid (__NR_Linux + 106)
495#define __NR_setpgid (__NR_Linux + 107)
496#define __NR_getppid (__NR_Linux + 108)
497#define __NR_getpgrp (__NR_Linux + 109)
498#define __NR_setsid (__NR_Linux + 110)
499#define __NR_setreuid (__NR_Linux + 111)
500#define __NR_setregid (__NR_Linux + 112)
501#define __NR_getgroups (__NR_Linux + 113)
502#define __NR_setgroups (__NR_Linux + 114)
503#define __NR_setresuid (__NR_Linux + 115)
504#define __NR_getresuid (__NR_Linux + 116)
505#define __NR_setresgid (__NR_Linux + 117)
506#define __NR_getresgid (__NR_Linux + 118)
507#define __NR_getpgid (__NR_Linux + 119)
508#define __NR_setfsuid (__NR_Linux + 120)
509#define __NR_setfsgid (__NR_Linux + 121)
510#define __NR_getsid (__NR_Linux + 122)
511#define __NR_capget (__NR_Linux + 123)
512#define __NR_capset (__NR_Linux + 124)
513#define __NR_rt_sigpending (__NR_Linux + 125)
514#define __NR_rt_sigtimedwait (__NR_Linux + 126)
515#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
516#define __NR_rt_sigsuspend (__NR_Linux + 128)
517#define __NR_sigaltstack (__NR_Linux + 129)
518#define __NR_utime (__NR_Linux + 130)
519#define __NR_mknod (__NR_Linux + 131)
520#define __NR_personality (__NR_Linux + 132)
521#define __NR_ustat (__NR_Linux + 133)
522#define __NR_statfs (__NR_Linux + 134)
523#define __NR_fstatfs (__NR_Linux + 135)
524#define __NR_sysfs (__NR_Linux + 136)
525#define __NR_getpriority (__NR_Linux + 137)
526#define __NR_setpriority (__NR_Linux + 138)
527#define __NR_sched_setparam (__NR_Linux + 139)
528#define __NR_sched_getparam (__NR_Linux + 140)
529#define __NR_sched_setscheduler (__NR_Linux + 141)
530#define __NR_sched_getscheduler (__NR_Linux + 142)
531#define __NR_sched_get_priority_max (__NR_Linux + 143)
532#define __NR_sched_get_priority_min (__NR_Linux + 144)
533#define __NR_sched_rr_get_interval (__NR_Linux + 145)
534#define __NR_mlock (__NR_Linux + 146)
535#define __NR_munlock (__NR_Linux + 147)
536#define __NR_mlockall (__NR_Linux + 148)
537#define __NR_munlockall (__NR_Linux + 149)
538#define __NR_vhangup (__NR_Linux + 150)
539#define __NR_pivot_root (__NR_Linux + 151)
540#define __NR__sysctl (__NR_Linux + 152)
541#define __NR_prctl (__NR_Linux + 153)
542#define __NR_adjtimex (__NR_Linux + 154)
543#define __NR_setrlimit (__NR_Linux + 155)
544#define __NR_chroot (__NR_Linux + 156)
545#define __NR_sync (__NR_Linux + 157)
546#define __NR_acct (__NR_Linux + 158)
547#define __NR_settimeofday (__NR_Linux + 159)
548#define __NR_mount (__NR_Linux + 160)
549#define __NR_umount2 (__NR_Linux + 161)
550#define __NR_swapon (__NR_Linux + 162)
551#define __NR_swapoff (__NR_Linux + 163)
552#define __NR_reboot (__NR_Linux + 164)
553#define __NR_sethostname (__NR_Linux + 165)
554#define __NR_setdomainname (__NR_Linux + 166)
555#define __NR_create_module (__NR_Linux + 167)
556#define __NR_init_module (__NR_Linux + 168)
557#define __NR_delete_module (__NR_Linux + 169)
558#define __NR_get_kernel_syms (__NR_Linux + 170)
559#define __NR_query_module (__NR_Linux + 171)
560#define __NR_quotactl (__NR_Linux + 172)
561#define __NR_nfsservctl (__NR_Linux + 173)
562#define __NR_getpmsg (__NR_Linux + 174)
563#define __NR_putpmsg (__NR_Linux + 175)
564#define __NR_afs_syscall (__NR_Linux + 176)
565#define __NR_reserved177 (__NR_Linux + 177)
566#define __NR_gettid (__NR_Linux + 178)
567#define __NR_readahead (__NR_Linux + 179)
568#define __NR_setxattr (__NR_Linux + 180)
569#define __NR_lsetxattr (__NR_Linux + 181)
570#define __NR_fsetxattr (__NR_Linux + 182)
571#define __NR_getxattr (__NR_Linux + 183)
572#define __NR_lgetxattr (__NR_Linux + 184)
573#define __NR_fgetxattr (__NR_Linux + 185)
574#define __NR_listxattr (__NR_Linux + 186)
575#define __NR_llistxattr (__NR_Linux + 187)
576#define __NR_flistxattr (__NR_Linux + 188)
577#define __NR_removexattr (__NR_Linux + 189)
578#define __NR_lremovexattr (__NR_Linux + 190)
579#define __NR_fremovexattr (__NR_Linux + 191)
580#define __NR_tkill (__NR_Linux + 192)
581#define __NR_reserved193 (__NR_Linux + 193)
582#define __NR_futex (__NR_Linux + 194)
583#define __NR_sched_setaffinity (__NR_Linux + 195)
584#define __NR_sched_getaffinity (__NR_Linux + 196)
585#define __NR_cacheflush (__NR_Linux + 197)
586#define __NR_cachectl (__NR_Linux + 198)
587#define __NR_sysmips (__NR_Linux + 199)
588#define __NR_io_setup (__NR_Linux + 200)
589#define __NR_io_destroy (__NR_Linux + 201)
590#define __NR_io_getevents (__NR_Linux + 202)
591#define __NR_io_submit (__NR_Linux + 203)
592#define __NR_io_cancel (__NR_Linux + 204)
593#define __NR_exit_group (__NR_Linux + 205)
594#define __NR_lookup_dcookie (__NR_Linux + 206)
595#define __NR_epoll_create (__NR_Linux + 207)
596#define __NR_epoll_ctl (__NR_Linux + 208)
597#define __NR_epoll_wait (__NR_Linux + 209)
598#define __NR_remap_file_pages (__NR_Linux + 210)
599#define __NR_rt_sigreturn (__NR_Linux + 211)
600#define __NR_set_tid_address (__NR_Linux + 212)
601#define __NR_restart_syscall (__NR_Linux + 213)
602#define __NR_semtimedop (__NR_Linux + 214)
603#define __NR_fadvise64 (__NR_Linux + 215)
604#define __NR_timer_create (__NR_Linux + 216)
605#define __NR_timer_settime (__NR_Linux + 217)
606#define __NR_timer_gettime (__NR_Linux + 218)
607#define __NR_timer_getoverrun (__NR_Linux + 219)
608#define __NR_timer_delete (__NR_Linux + 220)
609#define __NR_clock_settime (__NR_Linux + 221)
610#define __NR_clock_gettime (__NR_Linux + 222)
611#define __NR_clock_getres (__NR_Linux + 223)
612#define __NR_clock_nanosleep (__NR_Linux + 224)
613#define __NR_tgkill (__NR_Linux + 225)
614#define __NR_utimes (__NR_Linux + 226)
615#define __NR_mbind (__NR_Linux + 227)
616#define __NR_get_mempolicy (__NR_Linux + 228)
617#define __NR_set_mempolicy (__NR_Linux + 229)
618#define __NR_mq_open (__NR_Linux + 230)
619#define __NR_mq_unlink (__NR_Linux + 231)
620#define __NR_mq_timedsend (__NR_Linux + 232)
621#define __NR_mq_timedreceive (__NR_Linux + 233)
622#define __NR_mq_notify (__NR_Linux + 234)
623#define __NR_mq_getsetattr (__NR_Linux + 235)
624#define __NR_vserver (__NR_Linux + 236)
625#define __NR_waitid (__NR_Linux + 237)
626/* #define __NR_sys_setaltroot (__NR_Linux + 238) */
627#define __NR_add_key (__NR_Linux + 239)
628#define __NR_request_key (__NR_Linux + 240)
629#define __NR_keyctl (__NR_Linux + 241)
630#define __NR_set_thread_area (__NR_Linux + 242)
631#define __NR_inotify_init (__NR_Linux + 243)
632#define __NR_inotify_add_watch (__NR_Linux + 244)
633#define __NR_inotify_rm_watch (__NR_Linux + 245)
634#define __NR_migrate_pages (__NR_Linux + 246)
635#define __NR_openat (__NR_Linux + 247)
636#define __NR_mkdirat (__NR_Linux + 248)
637#define __NR_mknodat (__NR_Linux + 249)
638#define __NR_fchownat (__NR_Linux + 250)
639#define __NR_futimesat (__NR_Linux + 251)
640#define __NR_newfstatat (__NR_Linux + 252)
641#define __NR_unlinkat (__NR_Linux + 253)
642#define __NR_renameat (__NR_Linux + 254)
643#define __NR_linkat (__NR_Linux + 255)
644#define __NR_symlinkat (__NR_Linux + 256)
645#define __NR_readlinkat (__NR_Linux + 257)
646#define __NR_fchmodat (__NR_Linux + 258)
647#define __NR_faccessat (__NR_Linux + 259)
648#define __NR_pselect6 (__NR_Linux + 260)
649#define __NR_ppoll (__NR_Linux + 261)
650#define __NR_unshare (__NR_Linux + 262)
651#define __NR_splice (__NR_Linux + 263)
652#define __NR_sync_file_range (__NR_Linux + 264)
653#define __NR_tee (__NR_Linux + 265)
654#define __NR_vmsplice (__NR_Linux + 266)
655#define __NR_move_pages (__NR_Linux + 267)
656#define __NR_set_robust_list (__NR_Linux + 268)
657#define __NR_get_robust_list (__NR_Linux + 269)
658#define __NR_kexec_load (__NR_Linux + 270)
659#define __NR_getcpu (__NR_Linux + 271)
660#define __NR_epoll_pwait (__NR_Linux + 272)
661#define __NR_ioprio_set (__NR_Linux + 273)
662#define __NR_ioprio_get (__NR_Linux + 274)
663#define __NR_utimensat (__NR_Linux + 275)
664#define __NR_signalfd (__NR_Linux + 276)
665#define __NR_timerfd (__NR_Linux + 277)
666#define __NR_eventfd (__NR_Linux + 278)
667#define __NR_fallocate (__NR_Linux + 279)
668#define __NR_timerfd_create (__NR_Linux + 280)
669#define __NR_timerfd_gettime (__NR_Linux + 281)
670#define __NR_timerfd_settime (__NR_Linux + 282)
671#define __NR_signalfd4 (__NR_Linux + 283)
672#define __NR_eventfd2 (__NR_Linux + 284)
673#define __NR_epoll_create1 (__NR_Linux + 285)
674#define __NR_dup3 (__NR_Linux + 286)
675#define __NR_pipe2 (__NR_Linux + 287)
676#define __NR_inotify_init1 (__NR_Linux + 288)
677#define __NR_preadv (__NR_Linux + 289)
678#define __NR_pwritev (__NR_Linux + 290)
679#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
680#define __NR_perf_event_open (__NR_Linux + 292)
681#define __NR_accept4 (__NR_Linux + 293)
682#define __NR_recvmmsg (__NR_Linux + 294)
683#define __NR_fanotify_init (__NR_Linux + 295)
684#define __NR_fanotify_mark (__NR_Linux + 296)
685#define __NR_prlimit64 (__NR_Linux + 297)
686#define __NR_name_to_handle_at (__NR_Linux + 298)
687#define __NR_open_by_handle_at (__NR_Linux + 299)
688#define __NR_clock_adjtime (__NR_Linux + 300)
689#define __NR_syncfs (__NR_Linux + 301)
690#define __NR_sendmmsg (__NR_Linux + 302)
691#define __NR_setns (__NR_Linux + 303)
692#define __NR_process_vm_readv (__NR_Linux + 304)
693#define __NR_process_vm_writev (__NR_Linux + 305)
694#define __NR_kcmp (__NR_Linux + 306)
695
696/*
697 * Offset of the last Linux 64-bit flavoured syscall
698 */
699#define __NR_Linux_syscalls 306
700
701#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
702
703#define __NR_64_Linux 5000
704#define __NR_64_Linux_syscalls 306
705
706#if _MIPS_SIM == _MIPS_SIM_NABI32
707
708/*
709 * Linux N32 syscalls are in the range from 6000 to 6999.
710 */
711#define __NR_Linux 6000
712#define __NR_read (__NR_Linux + 0)
713#define __NR_write (__NR_Linux + 1)
714#define __NR_open (__NR_Linux + 2)
715#define __NR_close (__NR_Linux + 3)
716#define __NR_stat (__NR_Linux + 4)
717#define __NR_fstat (__NR_Linux + 5)
718#define __NR_lstat (__NR_Linux + 6)
719#define __NR_poll (__NR_Linux + 7)
720#define __NR_lseek (__NR_Linux + 8)
721#define __NR_mmap (__NR_Linux + 9)
722#define __NR_mprotect (__NR_Linux + 10)
723#define __NR_munmap (__NR_Linux + 11)
724#define __NR_brk (__NR_Linux + 12)
725#define __NR_rt_sigaction (__NR_Linux + 13)
726#define __NR_rt_sigprocmask (__NR_Linux + 14)
727#define __NR_ioctl (__NR_Linux + 15)
728#define __NR_pread64 (__NR_Linux + 16)
729#define __NR_pwrite64 (__NR_Linux + 17)
730#define __NR_readv (__NR_Linux + 18)
731#define __NR_writev (__NR_Linux + 19)
732#define __NR_access (__NR_Linux + 20)
733#define __NR_pipe (__NR_Linux + 21)
734#define __NR__newselect (__NR_Linux + 22)
735#define __NR_sched_yield (__NR_Linux + 23)
736#define __NR_mremap (__NR_Linux + 24)
737#define __NR_msync (__NR_Linux + 25)
738#define __NR_mincore (__NR_Linux + 26)
739#define __NR_madvise (__NR_Linux + 27)
740#define __NR_shmget (__NR_Linux + 28)
741#define __NR_shmat (__NR_Linux + 29)
742#define __NR_shmctl (__NR_Linux + 30)
743#define __NR_dup (__NR_Linux + 31)
744#define __NR_dup2 (__NR_Linux + 32)
745#define __NR_pause (__NR_Linux + 33)
746#define __NR_nanosleep (__NR_Linux + 34)
747#define __NR_getitimer (__NR_Linux + 35)
748#define __NR_setitimer (__NR_Linux + 36)
749#define __NR_alarm (__NR_Linux + 37)
750#define __NR_getpid (__NR_Linux + 38)
751#define __NR_sendfile (__NR_Linux + 39)
752#define __NR_socket (__NR_Linux + 40)
753#define __NR_connect (__NR_Linux + 41)
754#define __NR_accept (__NR_Linux + 42)
755#define __NR_sendto (__NR_Linux + 43)
756#define __NR_recvfrom (__NR_Linux + 44)
757#define __NR_sendmsg (__NR_Linux + 45)
758#define __NR_recvmsg (__NR_Linux + 46)
759#define __NR_shutdown (__NR_Linux + 47)
760#define __NR_bind (__NR_Linux + 48)
761#define __NR_listen (__NR_Linux + 49)
762#define __NR_getsockname (__NR_Linux + 50)
763#define __NR_getpeername (__NR_Linux + 51)
764#define __NR_socketpair (__NR_Linux + 52)
765#define __NR_setsockopt (__NR_Linux + 53)
766#define __NR_getsockopt (__NR_Linux + 54)
767#define __NR_clone (__NR_Linux + 55)
768#define __NR_fork (__NR_Linux + 56)
769#define __NR_execve (__NR_Linux + 57)
770#define __NR_exit (__NR_Linux + 58)
771#define __NR_wait4 (__NR_Linux + 59)
772#define __NR_kill (__NR_Linux + 60)
773#define __NR_uname (__NR_Linux + 61)
774#define __NR_semget (__NR_Linux + 62)
775#define __NR_semop (__NR_Linux + 63)
776#define __NR_semctl (__NR_Linux + 64)
777#define __NR_shmdt (__NR_Linux + 65)
778#define __NR_msgget (__NR_Linux + 66)
779#define __NR_msgsnd (__NR_Linux + 67)
780#define __NR_msgrcv (__NR_Linux + 68)
781#define __NR_msgctl (__NR_Linux + 69)
782#define __NR_fcntl (__NR_Linux + 70)
783#define __NR_flock (__NR_Linux + 71)
784#define __NR_fsync (__NR_Linux + 72)
785#define __NR_fdatasync (__NR_Linux + 73)
786#define __NR_truncate (__NR_Linux + 74)
787#define __NR_ftruncate (__NR_Linux + 75)
788#define __NR_getdents (__NR_Linux + 76)
789#define __NR_getcwd (__NR_Linux + 77)
790#define __NR_chdir (__NR_Linux + 78)
791#define __NR_fchdir (__NR_Linux + 79)
792#define __NR_rename (__NR_Linux + 80)
793#define __NR_mkdir (__NR_Linux + 81)
794#define __NR_rmdir (__NR_Linux + 82)
795#define __NR_creat (__NR_Linux + 83)
796#define __NR_link (__NR_Linux + 84)
797#define __NR_unlink (__NR_Linux + 85)
798#define __NR_symlink (__NR_Linux + 86)
799#define __NR_readlink (__NR_Linux + 87)
800#define __NR_chmod (__NR_Linux + 88)
801#define __NR_fchmod (__NR_Linux + 89)
802#define __NR_chown (__NR_Linux + 90)
803#define __NR_fchown (__NR_Linux + 91)
804#define __NR_lchown (__NR_Linux + 92)
805#define __NR_umask (__NR_Linux + 93)
806#define __NR_gettimeofday (__NR_Linux + 94)
807#define __NR_getrlimit (__NR_Linux + 95)
808#define __NR_getrusage (__NR_Linux + 96)
809#define __NR_sysinfo (__NR_Linux + 97)
810#define __NR_times (__NR_Linux + 98)
811#define __NR_ptrace (__NR_Linux + 99)
812#define __NR_getuid (__NR_Linux + 100)
813#define __NR_syslog (__NR_Linux + 101)
814#define __NR_getgid (__NR_Linux + 102)
815#define __NR_setuid (__NR_Linux + 103)
816#define __NR_setgid (__NR_Linux + 104)
817#define __NR_geteuid (__NR_Linux + 105)
818#define __NR_getegid (__NR_Linux + 106)
819#define __NR_setpgid (__NR_Linux + 107)
820#define __NR_getppid (__NR_Linux + 108)
821#define __NR_getpgrp (__NR_Linux + 109)
822#define __NR_setsid (__NR_Linux + 110)
823#define __NR_setreuid (__NR_Linux + 111)
824#define __NR_setregid (__NR_Linux + 112)
825#define __NR_getgroups (__NR_Linux + 113)
826#define __NR_setgroups (__NR_Linux + 114)
827#define __NR_setresuid (__NR_Linux + 115)
828#define __NR_getresuid (__NR_Linux + 116)
829#define __NR_setresgid (__NR_Linux + 117)
830#define __NR_getresgid (__NR_Linux + 118)
831#define __NR_getpgid (__NR_Linux + 119)
832#define __NR_setfsuid (__NR_Linux + 120)
833#define __NR_setfsgid (__NR_Linux + 121)
834#define __NR_getsid (__NR_Linux + 122)
835#define __NR_capget (__NR_Linux + 123)
836#define __NR_capset (__NR_Linux + 124)
837#define __NR_rt_sigpending (__NR_Linux + 125)
838#define __NR_rt_sigtimedwait (__NR_Linux + 126)
839#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
840#define __NR_rt_sigsuspend (__NR_Linux + 128)
841#define __NR_sigaltstack (__NR_Linux + 129)
842#define __NR_utime (__NR_Linux + 130)
843#define __NR_mknod (__NR_Linux + 131)
844#define __NR_personality (__NR_Linux + 132)
845#define __NR_ustat (__NR_Linux + 133)
846#define __NR_statfs (__NR_Linux + 134)
847#define __NR_fstatfs (__NR_Linux + 135)
848#define __NR_sysfs (__NR_Linux + 136)
849#define __NR_getpriority (__NR_Linux + 137)
850#define __NR_setpriority (__NR_Linux + 138)
851#define __NR_sched_setparam (__NR_Linux + 139)
852#define __NR_sched_getparam (__NR_Linux + 140)
853#define __NR_sched_setscheduler (__NR_Linux + 141)
854#define __NR_sched_getscheduler (__NR_Linux + 142)
855#define __NR_sched_get_priority_max (__NR_Linux + 143)
856#define __NR_sched_get_priority_min (__NR_Linux + 144)
857#define __NR_sched_rr_get_interval (__NR_Linux + 145)
858#define __NR_mlock (__NR_Linux + 146)
859#define __NR_munlock (__NR_Linux + 147)
860#define __NR_mlockall (__NR_Linux + 148)
861#define __NR_munlockall (__NR_Linux + 149)
862#define __NR_vhangup (__NR_Linux + 150)
863#define __NR_pivot_root (__NR_Linux + 151)
864#define __NR__sysctl (__NR_Linux + 152)
865#define __NR_prctl (__NR_Linux + 153)
866#define __NR_adjtimex (__NR_Linux + 154)
867#define __NR_setrlimit (__NR_Linux + 155)
868#define __NR_chroot (__NR_Linux + 156)
869#define __NR_sync (__NR_Linux + 157)
870#define __NR_acct (__NR_Linux + 158)
871#define __NR_settimeofday (__NR_Linux + 159)
872#define __NR_mount (__NR_Linux + 160)
873#define __NR_umount2 (__NR_Linux + 161)
874#define __NR_swapon (__NR_Linux + 162)
875#define __NR_swapoff (__NR_Linux + 163)
876#define __NR_reboot (__NR_Linux + 164)
877#define __NR_sethostname (__NR_Linux + 165)
878#define __NR_setdomainname (__NR_Linux + 166)
879#define __NR_create_module (__NR_Linux + 167)
880#define __NR_init_module (__NR_Linux + 168)
881#define __NR_delete_module (__NR_Linux + 169)
882#define __NR_get_kernel_syms (__NR_Linux + 170)
883#define __NR_query_module (__NR_Linux + 171)
884#define __NR_quotactl (__NR_Linux + 172)
885#define __NR_nfsservctl (__NR_Linux + 173)
886#define __NR_getpmsg (__NR_Linux + 174)
887#define __NR_putpmsg (__NR_Linux + 175)
888#define __NR_afs_syscall (__NR_Linux + 176)
889#define __NR_reserved177 (__NR_Linux + 177)
890#define __NR_gettid (__NR_Linux + 178)
891#define __NR_readahead (__NR_Linux + 179)
892#define __NR_setxattr (__NR_Linux + 180)
893#define __NR_lsetxattr (__NR_Linux + 181)
894#define __NR_fsetxattr (__NR_Linux + 182)
895#define __NR_getxattr (__NR_Linux + 183)
896#define __NR_lgetxattr (__NR_Linux + 184)
897#define __NR_fgetxattr (__NR_Linux + 185)
898#define __NR_listxattr (__NR_Linux + 186)
899#define __NR_llistxattr (__NR_Linux + 187)
900#define __NR_flistxattr (__NR_Linux + 188)
901#define __NR_removexattr (__NR_Linux + 189)
902#define __NR_lremovexattr (__NR_Linux + 190)
903#define __NR_fremovexattr (__NR_Linux + 191)
904#define __NR_tkill (__NR_Linux + 192)
905#define __NR_reserved193 (__NR_Linux + 193)
906#define __NR_futex (__NR_Linux + 194)
907#define __NR_sched_setaffinity (__NR_Linux + 195)
908#define __NR_sched_getaffinity (__NR_Linux + 196)
909#define __NR_cacheflush (__NR_Linux + 197)
910#define __NR_cachectl (__NR_Linux + 198)
911#define __NR_sysmips (__NR_Linux + 199)
912#define __NR_io_setup (__NR_Linux + 200)
913#define __NR_io_destroy (__NR_Linux + 201)
914#define __NR_io_getevents (__NR_Linux + 202)
915#define __NR_io_submit (__NR_Linux + 203)
916#define __NR_io_cancel (__NR_Linux + 204)
917#define __NR_exit_group (__NR_Linux + 205)
918#define __NR_lookup_dcookie (__NR_Linux + 206)
919#define __NR_epoll_create (__NR_Linux + 207)
920#define __NR_epoll_ctl (__NR_Linux + 208)
921#define __NR_epoll_wait (__NR_Linux + 209)
922#define __NR_remap_file_pages (__NR_Linux + 210)
923#define __NR_rt_sigreturn (__NR_Linux + 211)
924#define __NR_fcntl64 (__NR_Linux + 212)
925#define __NR_set_tid_address (__NR_Linux + 213)
926#define __NR_restart_syscall (__NR_Linux + 214)
927#define __NR_semtimedop (__NR_Linux + 215)
928#define __NR_fadvise64 (__NR_Linux + 216)
929#define __NR_statfs64 (__NR_Linux + 217)
930#define __NR_fstatfs64 (__NR_Linux + 218)
931#define __NR_sendfile64 (__NR_Linux + 219)
932#define __NR_timer_create (__NR_Linux + 220)
933#define __NR_timer_settime (__NR_Linux + 221)
934#define __NR_timer_gettime (__NR_Linux + 222)
935#define __NR_timer_getoverrun (__NR_Linux + 223)
936#define __NR_timer_delete (__NR_Linux + 224)
937#define __NR_clock_settime (__NR_Linux + 225)
938#define __NR_clock_gettime (__NR_Linux + 226)
939#define __NR_clock_getres (__NR_Linux + 227)
940#define __NR_clock_nanosleep (__NR_Linux + 228)
941#define __NR_tgkill (__NR_Linux + 229)
942#define __NR_utimes (__NR_Linux + 230)
943#define __NR_mbind (__NR_Linux + 231)
944#define __NR_get_mempolicy (__NR_Linux + 232)
945#define __NR_set_mempolicy (__NR_Linux + 233)
946#define __NR_mq_open (__NR_Linux + 234)
947#define __NR_mq_unlink (__NR_Linux + 235)
948#define __NR_mq_timedsend (__NR_Linux + 236)
949#define __NR_mq_timedreceive (__NR_Linux + 237)
950#define __NR_mq_notify (__NR_Linux + 238)
951#define __NR_mq_getsetattr (__NR_Linux + 239)
952#define __NR_vserver (__NR_Linux + 240)
953#define __NR_waitid (__NR_Linux + 241)
954/* #define __NR_sys_setaltroot (__NR_Linux + 242) */
955#define __NR_add_key (__NR_Linux + 243)
956#define __NR_request_key (__NR_Linux + 244)
957#define __NR_keyctl (__NR_Linux + 245)
958#define __NR_set_thread_area (__NR_Linux + 246)
959#define __NR_inotify_init (__NR_Linux + 247)
960#define __NR_inotify_add_watch (__NR_Linux + 248)
961#define __NR_inotify_rm_watch (__NR_Linux + 249)
962#define __NR_migrate_pages (__NR_Linux + 250)
963#define __NR_openat (__NR_Linux + 251)
964#define __NR_mkdirat (__NR_Linux + 252)
965#define __NR_mknodat (__NR_Linux + 253)
966#define __NR_fchownat (__NR_Linux + 254)
967#define __NR_futimesat (__NR_Linux + 255)
968#define __NR_newfstatat (__NR_Linux + 256)
969#define __NR_unlinkat (__NR_Linux + 257)
970#define __NR_renameat (__NR_Linux + 258)
971#define __NR_linkat (__NR_Linux + 259)
972#define __NR_symlinkat (__NR_Linux + 260)
973#define __NR_readlinkat (__NR_Linux + 261)
974#define __NR_fchmodat (__NR_Linux + 262)
975#define __NR_faccessat (__NR_Linux + 263)
976#define __NR_pselect6 (__NR_Linux + 264)
977#define __NR_ppoll (__NR_Linux + 265)
978#define __NR_unshare (__NR_Linux + 266)
979#define __NR_splice (__NR_Linux + 267)
980#define __NR_sync_file_range (__NR_Linux + 268)
981#define __NR_tee (__NR_Linux + 269)
982#define __NR_vmsplice (__NR_Linux + 270)
983#define __NR_move_pages (__NR_Linux + 271)
984#define __NR_set_robust_list (__NR_Linux + 272)
985#define __NR_get_robust_list (__NR_Linux + 273)
986#define __NR_kexec_load (__NR_Linux + 274)
987#define __NR_getcpu (__NR_Linux + 275)
988#define __NR_epoll_pwait (__NR_Linux + 276)
989#define __NR_ioprio_set (__NR_Linux + 277)
990#define __NR_ioprio_get (__NR_Linux + 278)
991#define __NR_utimensat (__NR_Linux + 279)
992#define __NR_signalfd (__NR_Linux + 280)
993#define __NR_timerfd (__NR_Linux + 281)
994#define __NR_eventfd (__NR_Linux + 282)
995#define __NR_fallocate (__NR_Linux + 283)
996#define __NR_timerfd_create (__NR_Linux + 284)
997#define __NR_timerfd_gettime (__NR_Linux + 285)
998#define __NR_timerfd_settime (__NR_Linux + 286)
999#define __NR_signalfd4 (__NR_Linux + 287)
1000#define __NR_eventfd2 (__NR_Linux + 288)
1001#define __NR_epoll_create1 (__NR_Linux + 289)
1002#define __NR_dup3 (__NR_Linux + 290)
1003#define __NR_pipe2 (__NR_Linux + 291)
1004#define __NR_inotify_init1 (__NR_Linux + 292)
1005#define __NR_preadv (__NR_Linux + 293)
1006#define __NR_pwritev (__NR_Linux + 294)
1007#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
1008#define __NR_perf_event_open (__NR_Linux + 296)
1009#define __NR_accept4 (__NR_Linux + 297)
1010#define __NR_recvmmsg (__NR_Linux + 298)
1011#define __NR_getdents64 (__NR_Linux + 299)
1012#define __NR_fanotify_init (__NR_Linux + 300)
1013#define __NR_fanotify_mark (__NR_Linux + 301)
1014#define __NR_prlimit64 (__NR_Linux + 302)
1015#define __NR_name_to_handle_at (__NR_Linux + 303)
1016#define __NR_open_by_handle_at (__NR_Linux + 304)
1017#define __NR_clock_adjtime (__NR_Linux + 305)
1018#define __NR_syncfs (__NR_Linux + 306)
1019#define __NR_sendmmsg (__NR_Linux + 307)
1020#define __NR_setns (__NR_Linux + 308)
1021#define __NR_process_vm_readv (__NR_Linux + 309)
1022#define __NR_process_vm_writev (__NR_Linux + 310)
1023#define __NR_kcmp (__NR_Linux + 311)
1024
1025/*
1026 * Offset of the last N32 flavoured syscall
1027 */
1028#define __NR_Linux_syscalls 311
1029
1030#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
1031
1032#define __NR_N32_Linux 6000
1033#define __NR_N32_Linux_syscalls 311
1034
1035#ifdef __KERNEL__
1036 17
1037#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
1038 19
@@ -1089,5 +70,4 @@
1089 */ 70 */
1090#define cond_syscall(x) asm(".weak\t" #x "\n" #x "\t=\tsys_ni_syscall") 71#define cond_syscall(x) asm(".weak\t" #x "\n" #x "\t=\tsys_ni_syscall")
1091 72
1092#endif /* __KERNEL__ */
1093#endif /* _ASM_UNISTD_H */ 73#endif /* _ASM_UNISTD_H */
diff --git a/arch/mips/include/uapi/asm/Kbuild b/arch/mips/include/uapi/asm/Kbuild
index baebb3da1d44..a1a0452ac185 100644
--- a/arch/mips/include/uapi/asm/Kbuild
+++ b/arch/mips/include/uapi/asm/Kbuild
@@ -1,3 +1,37 @@
1# UAPI Header export list 1# UAPI Header export list
2include include/uapi/asm-generic/Kbuild.asm 2include include/uapi/asm-generic/Kbuild.asm
3 3
4header-y += auxvec.h
5header-y += bitsperlong.h
6header-y += byteorder.h
7header-y += cachectl.h
8header-y += errno.h
9header-y += fcntl.h
10header-y += ioctl.h
11header-y += ioctls.h
12header-y += ipcbuf.h
13header-y += kvm_para.h
14header-y += mman.h
15header-y += msgbuf.h
16header-y += param.h
17header-y += poll.h
18header-y += posix_types.h
19header-y += ptrace.h
20header-y += resource.h
21header-y += sembuf.h
22header-y += setup.h
23header-y += sgidefs.h
24header-y += shmbuf.h
25header-y += sigcontext.h
26header-y += siginfo.h
27header-y += signal.h
28header-y += socket.h
29header-y += sockios.h
30header-y += stat.h
31header-y += statfs.h
32header-y += swab.h
33header-y += sysmips.h
34header-y += termbits.h
35header-y += termios.h
36header-y += types.h
37header-y += unistd.h
diff --git a/arch/mips/include/asm/auxvec.h b/arch/mips/include/uapi/asm/auxvec.h
index 7cf7f2d21943..7cf7f2d21943 100644
--- a/arch/mips/include/asm/auxvec.h
+++ b/arch/mips/include/uapi/asm/auxvec.h
diff --git a/arch/mips/include/asm/bitsperlong.h b/arch/mips/include/uapi/asm/bitsperlong.h
index 3e4c10a8e787..3e4c10a8e787 100644
--- a/arch/mips/include/asm/bitsperlong.h
+++ b/arch/mips/include/uapi/asm/bitsperlong.h
diff --git a/arch/mips/include/asm/byteorder.h b/arch/mips/include/uapi/asm/byteorder.h
index 9579051ff1c7..9579051ff1c7 100644
--- a/arch/mips/include/asm/byteorder.h
+++ b/arch/mips/include/uapi/asm/byteorder.h
diff --git a/arch/mips/include/asm/cachectl.h b/arch/mips/include/uapi/asm/cachectl.h
index f3ce721861d3..f3ce721861d3 100644
--- a/arch/mips/include/asm/cachectl.h
+++ b/arch/mips/include/uapi/asm/cachectl.h
diff --git a/arch/mips/include/uapi/asm/errno.h b/arch/mips/include/uapi/asm/errno.h
new file mode 100644
index 000000000000..bd67b15042ec
--- /dev/null
+++ b/arch/mips/include/uapi/asm/errno.h
@@ -0,0 +1,129 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1995, 1999, 2001, 2002 by Ralf Baechle
7 */
8#ifndef _UAPI_ASM_ERRNO_H
9#define _UAPI_ASM_ERRNO_H
10
11/*
12 * These error numbers are intended to be MIPS ABI compatible
13 */
14
15#include <asm-generic/errno-base.h>
16
17#define ENOMSG 35 /* No message of desired type */
18#define EIDRM 36 /* Identifier removed */
19#define ECHRNG 37 /* Channel number out of range */
20#define EL2NSYNC 38 /* Level 2 not synchronized */
21#define EL3HLT 39 /* Level 3 halted */
22#define EL3RST 40 /* Level 3 reset */
23#define ELNRNG 41 /* Link number out of range */
24#define EUNATCH 42 /* Protocol driver not attached */
25#define ENOCSI 43 /* No CSI structure available */
26#define EL2HLT 44 /* Level 2 halted */
27#define EDEADLK 45 /* Resource deadlock would occur */
28#define ENOLCK 46 /* No record locks available */
29#define EBADE 50 /* Invalid exchange */
30#define EBADR 51 /* Invalid request descriptor */
31#define EXFULL 52 /* Exchange full */
32#define ENOANO 53 /* No anode */
33#define EBADRQC 54 /* Invalid request code */
34#define EBADSLT 55 /* Invalid slot */
35#define EDEADLOCK 56 /* File locking deadlock error */
36#define EBFONT 59 /* Bad font file format */
37#define ENOSTR 60 /* Device not a stream */
38#define ENODATA 61 /* No data available */
39#define ETIME 62 /* Timer expired */
40#define ENOSR 63 /* Out of streams resources */
41#define ENONET 64 /* Machine is not on the network */
42#define ENOPKG 65 /* Package not installed */
43#define EREMOTE 66 /* Object is remote */
44#define ENOLINK 67 /* Link has been severed */
45#define EADV 68 /* Advertise error */
46#define ESRMNT 69 /* Srmount error */
47#define ECOMM 70 /* Communication error on send */
48#define EPROTO 71 /* Protocol error */
49#define EDOTDOT 73 /* RFS specific error */
50#define EMULTIHOP 74 /* Multihop attempted */
51#define EBADMSG 77 /* Not a data message */
52#define ENAMETOOLONG 78 /* File name too long */
53#define EOVERFLOW 79 /* Value too large for defined data type */
54#define ENOTUNIQ 80 /* Name not unique on network */
55#define EBADFD 81 /* File descriptor in bad state */
56#define EREMCHG 82 /* Remote address changed */
57#define ELIBACC 83 /* Can not access a needed shared library */
58#define ELIBBAD 84 /* Accessing a corrupted shared library */
59#define ELIBSCN 85 /* .lib section in a.out corrupted */
60#define ELIBMAX 86 /* Attempting to link in too many shared libraries */
61#define ELIBEXEC 87 /* Cannot exec a shared library directly */
62#define EILSEQ 88 /* Illegal byte sequence */
63#define ENOSYS 89 /* Function not implemented */
64#define ELOOP 90 /* Too many symbolic links encountered */
65#define ERESTART 91 /* Interrupted system call should be restarted */
66#define ESTRPIPE 92 /* Streams pipe error */
67#define ENOTEMPTY 93 /* Directory not empty */
68#define EUSERS 94 /* Too many users */
69#define ENOTSOCK 95 /* Socket operation on non-socket */
70#define EDESTADDRREQ 96 /* Destination address required */
71#define EMSGSIZE 97 /* Message too long */
72#define EPROTOTYPE 98 /* Protocol wrong type for socket */
73#define ENOPROTOOPT 99 /* Protocol not available */
74#define EPROTONOSUPPORT 120 /* Protocol not supported */
75#define ESOCKTNOSUPPORT 121 /* Socket type not supported */
76#define EOPNOTSUPP 122 /* Operation not supported on transport endpoint */
77#define EPFNOSUPPORT 123 /* Protocol family not supported */
78#define EAFNOSUPPORT 124 /* Address family not supported by protocol */
79#define EADDRINUSE 125 /* Address already in use */
80#define EADDRNOTAVAIL 126 /* Cannot assign requested address */
81#define ENETDOWN 127 /* Network is down */
82#define ENETUNREACH 128 /* Network is unreachable */
83#define ENETRESET 129 /* Network dropped connection because of reset */
84#define ECONNABORTED 130 /* Software caused connection abort */
85#define ECONNRESET 131 /* Connection reset by peer */
86#define ENOBUFS 132 /* No buffer space available */
87#define EISCONN 133 /* Transport endpoint is already connected */
88#define ENOTCONN 134 /* Transport endpoint is not connected */
89#define EUCLEAN 135 /* Structure needs cleaning */
90#define ENOTNAM 137 /* Not a XENIX named type file */
91#define ENAVAIL 138 /* No XENIX semaphores available */
92#define EISNAM 139 /* Is a named type file */
93#define EREMOTEIO 140 /* Remote I/O error */
94#define EINIT 141 /* Reserved */
95#define EREMDEV 142 /* Error 142 */
96#define ESHUTDOWN 143 /* Cannot send after transport endpoint shutdown */
97#define ETOOMANYREFS 144 /* Too many references: cannot splice */
98#define ETIMEDOUT 145 /* Connection timed out */
99#define ECONNREFUSED 146 /* Connection refused */
100#define EHOSTDOWN 147 /* Host is down */
101#define EHOSTUNREACH 148 /* No route to host */
102#define EWOULDBLOCK EAGAIN /* Operation would block */
103#define EALREADY 149 /* Operation already in progress */
104#define EINPROGRESS 150 /* Operation now in progress */
105#define ESTALE 151 /* Stale NFS file handle */
106#define ECANCELED 158 /* AIO operation canceled */
107
108/*
109 * These error are Linux extensions.
110 */
111#define ENOMEDIUM 159 /* No medium found */
112#define EMEDIUMTYPE 160 /* Wrong medium type */
113#define ENOKEY 161 /* Required key not available */
114#define EKEYEXPIRED 162 /* Key has expired */
115#define EKEYREVOKED 163 /* Key has been revoked */
116#define EKEYREJECTED 164 /* Key was rejected by service */
117
118/* for robust mutexes */
119#define EOWNERDEAD 165 /* Owner died */
120#define ENOTRECOVERABLE 166 /* State not recoverable */
121
122#define ERFKILL 167 /* Operation not possible due to RF-kill */
123
124#define EHWPOISON 168 /* Memory page has hardware error */
125
126#define EDQUOT 1133 /* Quota exceeded */
127
128
129#endif /* _UAPI_ASM_ERRNO_H */
diff --git a/arch/mips/include/asm/fcntl.h b/arch/mips/include/uapi/asm/fcntl.h
index 75eddedcfc3e..75eddedcfc3e 100644
--- a/arch/mips/include/asm/fcntl.h
+++ b/arch/mips/include/uapi/asm/fcntl.h
diff --git a/arch/mips/include/asm/ioctl.h b/arch/mips/include/uapi/asm/ioctl.h
index c515a1a4c47c..c515a1a4c47c 100644
--- a/arch/mips/include/asm/ioctl.h
+++ b/arch/mips/include/uapi/asm/ioctl.h
diff --git a/arch/mips/include/asm/ioctls.h b/arch/mips/include/uapi/asm/ioctls.h
index 92403c3d6007..92403c3d6007 100644
--- a/arch/mips/include/asm/ioctls.h
+++ b/arch/mips/include/uapi/asm/ioctls.h
diff --git a/arch/mips/include/asm/ipcbuf.h b/arch/mips/include/uapi/asm/ipcbuf.h
index 84c7e51cb6d0..84c7e51cb6d0 100644
--- a/arch/mips/include/asm/ipcbuf.h
+++ b/arch/mips/include/uapi/asm/ipcbuf.h
diff --git a/arch/mips/include/asm/kvm_para.h b/arch/mips/include/uapi/asm/kvm_para.h
index 14fab8f0b957..14fab8f0b957 100644
--- a/arch/mips/include/asm/kvm_para.h
+++ b/arch/mips/include/uapi/asm/kvm_para.h
diff --git a/arch/mips/include/asm/mman.h b/arch/mips/include/uapi/asm/mman.h
index 46d3da0d4b92..46d3da0d4b92 100644
--- a/arch/mips/include/asm/mman.h
+++ b/arch/mips/include/uapi/asm/mman.h
diff --git a/arch/mips/include/asm/msgbuf.h b/arch/mips/include/uapi/asm/msgbuf.h
index 0d6c7f14de31..0d6c7f14de31 100644
--- a/arch/mips/include/asm/msgbuf.h
+++ b/arch/mips/include/uapi/asm/msgbuf.h
diff --git a/arch/mips/include/asm/param.h b/arch/mips/include/uapi/asm/param.h
index da3920fce9ad..da3920fce9ad 100644
--- a/arch/mips/include/asm/param.h
+++ b/arch/mips/include/uapi/asm/param.h
diff --git a/arch/mips/include/asm/poll.h b/arch/mips/include/uapi/asm/poll.h
index 47b952080431..47b952080431 100644
--- a/arch/mips/include/asm/poll.h
+++ b/arch/mips/include/uapi/asm/poll.h
diff --git a/arch/mips/include/asm/posix_types.h b/arch/mips/include/uapi/asm/posix_types.h
index fa03ec3fbf89..fa03ec3fbf89 100644
--- a/arch/mips/include/asm/posix_types.h
+++ b/arch/mips/include/uapi/asm/posix_types.h
diff --git a/arch/mips/include/uapi/asm/ptrace.h b/arch/mips/include/uapi/asm/ptrace.h
new file mode 100644
index 000000000000..1bc1f52f40d7
--- /dev/null
+++ b/arch/mips/include/uapi/asm/ptrace.h
@@ -0,0 +1,116 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 */
9#ifndef _UAPI_ASM_PTRACE_H
10#define _UAPI_ASM_PTRACE_H
11
12/* 0 - 31 are integer registers, 32 - 63 are fp registers. */
13#define FPR_BASE 32
14#define PC 64
15#define CAUSE 65
16#define BADVADDR 66
17#define MMHI 67
18#define MMLO 68
19#define FPC_CSR 69
20#define FPC_EIR 70
21#define DSP_BASE 71 /* 3 more hi / lo register pairs */
22#define DSP_CONTROL 77
23#define ACX 78
24
25/*
26 * This struct defines the way the registers are stored on the stack during a
27 * system call/exception. As usual the registers k0/k1 aren't being saved.
28 */
29struct pt_regs {
30#ifdef CONFIG_32BIT
31 /* Pad bytes for argument save space on the stack. */
32 unsigned long pad0[6];
33#endif
34
35 /* Saved main processor registers. */
36 unsigned long regs[32];
37
38 /* Saved special registers. */
39 unsigned long cp0_status;
40 unsigned long hi;
41 unsigned long lo;
42#ifdef CONFIG_CPU_HAS_SMARTMIPS
43 unsigned long acx;
44#endif
45 unsigned long cp0_badvaddr;
46 unsigned long cp0_cause;
47 unsigned long cp0_epc;
48#ifdef CONFIG_MIPS_MT_SMTC
49 unsigned long cp0_tcstatus;
50#endif /* CONFIG_MIPS_MT_SMTC */
51#ifdef CONFIG_CPU_CAVIUM_OCTEON
52 unsigned long long mpl[3]; /* MTM{0,1,2} */
53 unsigned long long mtp[3]; /* MTP{0,1,2} */
54#endif
55} __attribute__ ((aligned (8)));
56
57/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
58#define PTRACE_GETREGS 12
59#define PTRACE_SETREGS 13
60#define PTRACE_GETFPREGS 14
61#define PTRACE_SETFPREGS 15
62/* #define PTRACE_GETFPXREGS 18 */
63/* #define PTRACE_SETFPXREGS 19 */
64
65#define PTRACE_OLDSETOPTIONS 21
66
67#define PTRACE_GET_THREAD_AREA 25
68#define PTRACE_SET_THREAD_AREA 26
69
70/* Calls to trace a 64bit program from a 32bit program. */
71#define PTRACE_PEEKTEXT_3264 0xc0
72#define PTRACE_PEEKDATA_3264 0xc1
73#define PTRACE_POKETEXT_3264 0xc2
74#define PTRACE_POKEDATA_3264 0xc3
75#define PTRACE_GET_THREAD_AREA_3264 0xc4
76
77/* Read and write watchpoint registers. */
78enum pt_watch_style {
79 pt_watch_style_mips32,
80 pt_watch_style_mips64
81};
82struct mips32_watch_regs {
83 unsigned int watchlo[8];
84 /* Lower 16 bits of watchhi. */
85 unsigned short watchhi[8];
86 /* Valid mask and I R W bits.
87 * bit 0 -- 1 if W bit is usable.
88 * bit 1 -- 1 if R bit is usable.
89 * bit 2 -- 1 if I bit is usable.
90 * bits 3 - 11 -- Valid watchhi mask bits.
91 */
92 unsigned short watch_masks[8];
93 /* The number of valid watch register pairs. */
94 unsigned int num_valid;
95} __attribute__((aligned(8)));
96
97struct mips64_watch_regs {
98 unsigned long long watchlo[8];
99 unsigned short watchhi[8];
100 unsigned short watch_masks[8];
101 unsigned int num_valid;
102} __attribute__((aligned(8)));
103
104struct pt_watch_regs {
105 enum pt_watch_style style;
106 union {
107 struct mips32_watch_regs mips32;
108 struct mips64_watch_regs mips64;
109 };
110};
111
112#define PTRACE_GET_WATCH_REGS 0xd0
113#define PTRACE_SET_WATCH_REGS 0xd1
114
115
116#endif /* _UAPI_ASM_PTRACE_H */
diff --git a/arch/mips/include/asm/resource.h b/arch/mips/include/uapi/asm/resource.h
index 87cb3085269c..87cb3085269c 100644
--- a/arch/mips/include/asm/resource.h
+++ b/arch/mips/include/uapi/asm/resource.h
diff --git a/arch/mips/include/asm/sembuf.h b/arch/mips/include/uapi/asm/sembuf.h
index 7281a4decaa0..7281a4decaa0 100644
--- a/arch/mips/include/asm/sembuf.h
+++ b/arch/mips/include/uapi/asm/sembuf.h
diff --git a/arch/mips/include/uapi/asm/setup.h b/arch/mips/include/uapi/asm/setup.h
new file mode 100644
index 000000000000..93f237bb1353
--- /dev/null
+++ b/arch/mips/include/uapi/asm/setup.h
@@ -0,0 +1,7 @@
1#ifndef _UAPI_MIPS_SETUP_H
2#define _UAPI_MIPS_SETUP_H
3
4#define COMMAND_LINE_SIZE 4096
5
6
7#endif /* _UAPI_MIPS_SETUP_H */
diff --git a/arch/mips/include/asm/sgidefs.h b/arch/mips/include/uapi/asm/sgidefs.h
index 876442fcfb32..876442fcfb32 100644
--- a/arch/mips/include/asm/sgidefs.h
+++ b/arch/mips/include/uapi/asm/sgidefs.h
diff --git a/arch/mips/include/asm/shmbuf.h b/arch/mips/include/uapi/asm/shmbuf.h
index f994438277bf..f994438277bf 100644
--- a/arch/mips/include/asm/shmbuf.h
+++ b/arch/mips/include/uapi/asm/shmbuf.h
diff --git a/arch/mips/include/uapi/asm/sigcontext.h b/arch/mips/include/uapi/asm/sigcontext.h
new file mode 100644
index 000000000000..6c9906f59c6e
--- /dev/null
+++ b/arch/mips/include/uapi/asm/sigcontext.h
@@ -0,0 +1,78 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1996, 1997, 1999 by Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 */
9#ifndef _UAPI_ASM_SIGCONTEXT_H
10#define _UAPI_ASM_SIGCONTEXT_H
11
12#include <linux/types.h>
13#include <asm/sgidefs.h>
14
15#if _MIPS_SIM == _MIPS_SIM_ABI32
16
17/*
18 * Keep this struct definition in sync with the sigcontext fragment
19 * in arch/mips/tools/offset.c
20 */
21struct sigcontext {
22 unsigned int sc_regmask; /* Unused */
23 unsigned int sc_status; /* Unused */
24 unsigned long long sc_pc;
25 unsigned long long sc_regs[32];
26 unsigned long long sc_fpregs[32];
27 unsigned int sc_acx; /* Was sc_ownedfp */
28 unsigned int sc_fpc_csr;
29 unsigned int sc_fpc_eir; /* Unused */
30 unsigned int sc_used_math;
31 unsigned int sc_dsp; /* dsp status, was sc_ssflags */
32 unsigned long long sc_mdhi;
33 unsigned long long sc_mdlo;
34 unsigned long sc_hi1; /* Was sc_cause */
35 unsigned long sc_lo1; /* Was sc_badvaddr */
36 unsigned long sc_hi2; /* Was sc_sigset[4] */
37 unsigned long sc_lo2;
38 unsigned long sc_hi3;
39 unsigned long sc_lo3;
40};
41
42#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
43
44#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
45
46#include <linux/posix_types.h>
47/*
48 * Keep this struct definition in sync with the sigcontext fragment
49 * in arch/mips/tools/offset.c
50 *
51 * Warning: this structure illdefined with sc_badvaddr being just an unsigned
52 * int so it was changed to unsigned long in 2.6.0-test1. This may break
53 * binary compatibility - no prisoners.
54 * DSP ASE in 2.6.12-rc4. Turn sc_mdhi and sc_mdlo into an array of four
55 * entries, add sc_dsp and sc_reserved for padding. No prisoners.
56 */
57struct sigcontext {
58 __u64 sc_regs[32];
59 __u64 sc_fpregs[32];
60 __u64 sc_mdhi;
61 __u64 sc_hi1;
62 __u64 sc_hi2;
63 __u64 sc_hi3;
64 __u64 sc_mdlo;
65 __u64 sc_lo1;
66 __u64 sc_lo2;
67 __u64 sc_lo3;
68 __u64 sc_pc;
69 __u32 sc_fpc_csr;
70 __u32 sc_used_math;
71 __u32 sc_dsp;
72 __u32 sc_reserved;
73};
74
75
76#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
77
78#endif /* _UAPI_ASM_SIGCONTEXT_H */
diff --git a/arch/mips/include/uapi/asm/siginfo.h b/arch/mips/include/uapi/asm/siginfo.h
new file mode 100644
index 000000000000..73446508d846
--- /dev/null
+++ b/arch/mips/include/uapi/asm/siginfo.h
@@ -0,0 +1,114 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1998, 1999, 2001, 2003 Ralf Baechle
7 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
8 */
9#ifndef _UAPI_ASM_SIGINFO_H
10#define _UAPI_ASM_SIGINFO_H
11
12
13#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
14#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
15
16#define HAVE_ARCH_SIGINFO_T
17
18/*
19 * We duplicate the generic versions - <asm-generic/siginfo.h> is just borked
20 * by design ...
21 */
22#define HAVE_ARCH_COPY_SIGINFO
23struct siginfo;
24
25/*
26 * Careful to keep union _sifields from shifting ...
27 */
28#ifdef CONFIG_32BIT
29#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
30#endif
31#ifdef CONFIG_64BIT
32#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
33#endif
34
35#include <asm-generic/siginfo.h>
36
37typedef struct siginfo {
38 int si_signo;
39 int si_code;
40 int si_errno;
41 int __pad0[SI_MAX_SIZE / sizeof(int) - SI_PAD_SIZE - 3];
42
43 union {
44 int _pad[SI_PAD_SIZE];
45
46 /* kill() */
47 struct {
48 pid_t _pid; /* sender's pid */
49 __ARCH_SI_UID_T _uid; /* sender's uid */
50 } _kill;
51
52 /* POSIX.1b timers */
53 struct {
54 timer_t _tid; /* timer id */
55 int _overrun; /* overrun count */
56 char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
57 sigval_t _sigval; /* same as below */
58 int _sys_private; /* not to be passed to user */
59 } _timer;
60
61 /* POSIX.1b signals */
62 struct {
63 pid_t _pid; /* sender's pid */
64 __ARCH_SI_UID_T _uid; /* sender's uid */
65 sigval_t _sigval;
66 } _rt;
67
68 /* SIGCHLD */
69 struct {
70 pid_t _pid; /* which child */
71 __ARCH_SI_UID_T _uid; /* sender's uid */
72 int _status; /* exit code */
73 clock_t _utime;
74 clock_t _stime;
75 } _sigchld;
76
77 /* IRIX SIGCHLD */
78 struct {
79 pid_t _pid; /* which child */
80 clock_t _utime;
81 int _status; /* exit code */
82 clock_t _stime;
83 } _irix_sigchld;
84
85 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
86 struct {
87 void __user *_addr; /* faulting insn/memory ref. */
88#ifdef __ARCH_SI_TRAPNO
89 int _trapno; /* TRAP # which caused the signal */
90#endif
91 short _addr_lsb;
92 } _sigfault;
93
94 /* SIGPOLL, SIGXFSZ (To do ...) */
95 struct {
96 __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
97 int _fd;
98 } _sigpoll;
99 } _sifields;
100} siginfo_t;
101
102/*
103 * si_code values
104 * Again these have been chosen to be IRIX compatible.
105 */
106#undef SI_ASYNCIO
107#undef SI_TIMER
108#undef SI_MESGQ
109#define SI_ASYNCIO -2 /* sent by AIO completion */
110#define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */
111#define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */
112
113
114#endif /* _UAPI_ASM_SIGINFO_H */
diff --git a/arch/mips/include/uapi/asm/signal.h b/arch/mips/include/uapi/asm/signal.h
new file mode 100644
index 000000000000..3f1237c6c80e
--- /dev/null
+++ b/arch/mips/include/uapi/asm/signal.h
@@ -0,0 +1,123 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1995, 96, 97, 98, 99, 2003 by Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 */
9#ifndef _UAPI_ASM_SIGNAL_H
10#define _UAPI_ASM_SIGNAL_H
11
12#include <linux/types.h>
13
14#define _NSIG 128
15#define _NSIG_BPW (sizeof(unsigned long) * 8)
16#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
17
18typedef struct {
19 unsigned long sig[_NSIG_WORDS];
20} sigset_t;
21
22typedef unsigned long old_sigset_t; /* at least 32 bits */
23
24#define SIGHUP 1 /* Hangup (POSIX). */
25#define SIGINT 2 /* Interrupt (ANSI). */
26#define SIGQUIT 3 /* Quit (POSIX). */
27#define SIGILL 4 /* Illegal instruction (ANSI). */
28#define SIGTRAP 5 /* Trace trap (POSIX). */
29#define SIGIOT 6 /* IOT trap (4.2 BSD). */
30#define SIGABRT SIGIOT /* Abort (ANSI). */
31#define SIGEMT 7
32#define SIGFPE 8 /* Floating-point exception (ANSI). */
33#define SIGKILL 9 /* Kill, unblockable (POSIX). */
34#define SIGBUS 10 /* BUS error (4.2 BSD). */
35#define SIGSEGV 11 /* Segmentation violation (ANSI). */
36#define SIGSYS 12
37#define SIGPIPE 13 /* Broken pipe (POSIX). */
38#define SIGALRM 14 /* Alarm clock (POSIX). */
39#define SIGTERM 15 /* Termination (ANSI). */
40#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */
41#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */
42#define SIGCHLD 18 /* Child status has changed (POSIX). */
43#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
44#define SIGPWR 19 /* Power failure restart (System V). */
45#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */
46#define SIGURG 21 /* Urgent condition on socket (4.2 BSD). */
47#define SIGIO 22 /* I/O now possible (4.2 BSD). */
48#define SIGPOLL SIGIO /* Pollable event occurred (System V). */
49#define SIGSTOP 23 /* Stop, unblockable (POSIX). */
50#define SIGTSTP 24 /* Keyboard stop (POSIX). */
51#define SIGCONT 25 /* Continue (POSIX). */
52#define SIGTTIN 26 /* Background read from tty (POSIX). */
53#define SIGTTOU 27 /* Background write to tty (POSIX). */
54#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */
55#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */
56#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */
57#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */
58
59/* These should not be considered constants from userland. */
60#define SIGRTMIN 32
61#define SIGRTMAX _NSIG
62
63/*
64 * SA_FLAGS values:
65 *
66 * SA_ONSTACK indicates that a registered stack_t will be used.
67 * SA_RESTART flag to get restarting signals (which were the default long ago)
68 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
69 * SA_RESETHAND clears the handler when the signal is delivered.
70 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
71 * SA_NODEFER prevents the current signal from being masked in the handler.
72 *
73 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
74 * Unix names RESETHAND and NODEFER respectively.
75 */
76#define SA_ONSTACK 0x08000000
77#define SA_RESETHAND 0x80000000
78#define SA_RESTART 0x10000000
79#define SA_SIGINFO 0x00000008
80#define SA_NODEFER 0x40000000
81#define SA_NOCLDWAIT 0x00010000
82#define SA_NOCLDSTOP 0x00000001
83
84#define SA_NOMASK SA_NODEFER
85#define SA_ONESHOT SA_RESETHAND
86
87#define SA_RESTORER 0x04000000 /* Only for o32 */
88
89/*
90 * sigaltstack controls
91 */
92#define SS_ONSTACK 1
93#define SS_DISABLE 2
94
95#define MINSIGSTKSZ 2048
96#define SIGSTKSZ 8192
97
98
99#define SIG_BLOCK 1 /* for blocking signals */
100#define SIG_UNBLOCK 2 /* for unblocking signals */
101#define SIG_SETMASK 3 /* for setting the signal mask */
102
103#include <asm-generic/signal-defs.h>
104
105struct sigaction {
106 unsigned int sa_flags;
107 __sighandler_t sa_handler;
108 sigset_t sa_mask;
109};
110
111struct k_sigaction {
112 struct sigaction sa;
113};
114
115/* IRIX compatible stack_t */
116typedef struct sigaltstack {
117 void __user *ss_sp;
118 size_t ss_size;
119 int ss_flags;
120} stack_t;
121
122
123#endif /* _UAPI_ASM_SIGNAL_H */
diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h
new file mode 100644
index 000000000000..c5ed59549cb8
--- /dev/null
+++ b/arch/mips/include/uapi/asm/socket.h
@@ -0,0 +1,93 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1997, 1999, 2000, 2001 Ralf Baechle
7 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
8 */
9#ifndef _UAPI_ASM_SOCKET_H
10#define _UAPI_ASM_SOCKET_H
11
12#include <asm/sockios.h>
13
14/*
15 * For setsockopt(2)
16 *
17 * This defines are ABI conformant as far as Linux supports these ...
18 */
19#define SOL_SOCKET 0xffff
20
21#define SO_DEBUG 0x0001 /* Record debugging information. */
22#define SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. */
23#define SO_KEEPALIVE 0x0008 /* Keep connections alive and send
24 SIGPIPE when they die. */
25#define SO_DONTROUTE 0x0010 /* Don't do local routing. */
26#define SO_BROADCAST 0x0020 /* Allow transmission of
27 broadcast messages. */
28#define SO_LINGER 0x0080 /* Block on close of a reliable
29 socket to transmit pending data. */
30#define SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. */
31#if 0
32To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
33#endif
34
35#define SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */
36#define SO_STYLE SO_TYPE /* Synonym */
37#define SO_ERROR 0x1007 /* get error status and clear */
38#define SO_SNDBUF 0x1001 /* Send buffer size. */
39#define SO_RCVBUF 0x1002 /* Receive buffer. */
40#define SO_SNDLOWAT 0x1003 /* send low-water mark */
41#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
42#define SO_SNDTIMEO 0x1005 /* send timeout */
43#define SO_RCVTIMEO 0x1006 /* receive timeout */
44#define SO_ACCEPTCONN 0x1009
45#define SO_PROTOCOL 0x1028 /* protocol type */
46#define SO_DOMAIN 0x1029 /* domain/socket family */
47
48/* linux-specific, might as well be the same as on i386 */
49#define SO_NO_CHECK 11
50#define SO_PRIORITY 12
51#define SO_BSDCOMPAT 14
52
53#define SO_PASSCRED 17
54#define SO_PEERCRED 18
55
56/* Security levels - as per NRL IPv6 - don't actually do anything */
57#define SO_SECURITY_AUTHENTICATION 22
58#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
59#define SO_SECURITY_ENCRYPTION_NETWORK 24
60
61#define SO_BINDTODEVICE 25
62
63/* Socket filtering */
64#define SO_ATTACH_FILTER 26
65#define SO_DETACH_FILTER 27
66
67#define SO_PEERNAME 28
68#define SO_TIMESTAMP 29
69#define SCM_TIMESTAMP SO_TIMESTAMP
70
71#define SO_PEERSEC 30
72#define SO_SNDBUFFORCE 31
73#define SO_RCVBUFFORCE 33
74#define SO_PASSSEC 34
75#define SO_TIMESTAMPNS 35
76#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
77
78#define SO_MARK 36
79
80#define SO_TIMESTAMPING 37
81#define SCM_TIMESTAMPING SO_TIMESTAMPING
82
83#define SO_RXQ_OVFL 40
84
85#define SO_WIFI_STATUS 41
86#define SCM_WIFI_STATUS SO_WIFI_STATUS
87#define SO_PEEK_OFF 42
88
89/* Instruct lower device to use last 4-bytes of skb data as FCS */
90#define SO_NOFCS 43
91
92
93#endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/mips/include/asm/sockios.h b/arch/mips/include/uapi/asm/sockios.h
index ed1a5f78d22f..ed1a5f78d22f 100644
--- a/arch/mips/include/asm/sockios.h
+++ b/arch/mips/include/uapi/asm/sockios.h
diff --git a/arch/mips/include/asm/stat.h b/arch/mips/include/uapi/asm/stat.h
index fe9a4c3ec5a1..fe9a4c3ec5a1 100644
--- a/arch/mips/include/asm/stat.h
+++ b/arch/mips/include/uapi/asm/stat.h
diff --git a/arch/mips/include/asm/statfs.h b/arch/mips/include/uapi/asm/statfs.h
index 0f805c7a42a5..0f805c7a42a5 100644
--- a/arch/mips/include/asm/statfs.h
+++ b/arch/mips/include/uapi/asm/statfs.h
diff --git a/arch/mips/include/asm/swab.h b/arch/mips/include/uapi/asm/swab.h
index 97c2f81b4b43..97c2f81b4b43 100644
--- a/arch/mips/include/asm/swab.h
+++ b/arch/mips/include/uapi/asm/swab.h
diff --git a/arch/mips/include/asm/sysmips.h b/arch/mips/include/uapi/asm/sysmips.h
index 4f47b7d6a5f7..4f47b7d6a5f7 100644
--- a/arch/mips/include/asm/sysmips.h
+++ b/arch/mips/include/uapi/asm/sysmips.h
diff --git a/arch/mips/include/asm/termbits.h b/arch/mips/include/uapi/asm/termbits.h
index 76630b396fac..76630b396fac 100644
--- a/arch/mips/include/asm/termbits.h
+++ b/arch/mips/include/uapi/asm/termbits.h
diff --git a/arch/mips/include/uapi/asm/termios.h b/arch/mips/include/uapi/asm/termios.h
new file mode 100644
index 000000000000..574fbdfb7202
--- /dev/null
+++ b/arch/mips/include/uapi/asm/termios.h
@@ -0,0 +1,80 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1995, 1996, 2000, 2001 by Ralf Baechle
7 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
8 */
9#ifndef _UAPI_ASM_TERMIOS_H
10#define _UAPI_ASM_TERMIOS_H
11
12#include <linux/errno.h>
13#include <asm/termbits.h>
14#include <asm/ioctls.h>
15
16struct sgttyb {
17 char sg_ispeed;
18 char sg_ospeed;
19 char sg_erase;
20 char sg_kill;
21 int sg_flags; /* SGI special - int, not short */
22};
23
24struct tchars {
25 char t_intrc;
26 char t_quitc;
27 char t_startc;
28 char t_stopc;
29 char t_eofc;
30 char t_brkc;
31};
32
33struct ltchars {
34 char t_suspc; /* stop process signal */
35 char t_dsuspc; /* delayed stop process signal */
36 char t_rprntc; /* reprint line */
37 char t_flushc; /* flush output (toggles) */
38 char t_werasc; /* word erase */
39 char t_lnextc; /* literal next character */
40};
41
42/* TIOCGSIZE, TIOCSSIZE not defined yet. Only needed for SunOS source
43 compatibility anyway ... */
44
45struct winsize {
46 unsigned short ws_row;
47 unsigned short ws_col;
48 unsigned short ws_xpixel;
49 unsigned short ws_ypixel;
50};
51
52#define NCC 8
53struct termio {
54 unsigned short c_iflag; /* input mode flags */
55 unsigned short c_oflag; /* output mode flags */
56 unsigned short c_cflag; /* control mode flags */
57 unsigned short c_lflag; /* local mode flags */
58 char c_line; /* line discipline */
59 unsigned char c_cc[NCCS]; /* control characters */
60};
61
62
63/* modem lines */
64#define TIOCM_LE 0x001 /* line enable */
65#define TIOCM_DTR 0x002 /* data terminal ready */
66#define TIOCM_RTS 0x004 /* request to send */
67#define TIOCM_ST 0x010 /* secondary transmit */
68#define TIOCM_SR 0x020 /* secondary receive */
69#define TIOCM_CTS 0x040 /* clear to send */
70#define TIOCM_CAR 0x100 /* carrier detect */
71#define TIOCM_CD TIOCM_CAR
72#define TIOCM_RNG 0x200 /* ring */
73#define TIOCM_RI TIOCM_RNG
74#define TIOCM_DSR 0x400 /* data set ready */
75#define TIOCM_OUT1 0x2000
76#define TIOCM_OUT2 0x4000
77#define TIOCM_LOOP 0x8000
78
79
80#endif /* _UAPI_ASM_TERMIOS_H */
diff --git a/arch/mips/include/uapi/asm/types.h b/arch/mips/include/uapi/asm/types.h
new file mode 100644
index 000000000000..7ac9d0baad84
--- /dev/null
+++ b/arch/mips/include/uapi/asm/types.h
@@ -0,0 +1,27 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
7 * Copyright (C) 2008 Wind River Systems,
8 * written by Ralf Baechle
9 * Copyright (C) 1999 Silicon Graphics, Inc.
10 */
11#ifndef _UAPI_ASM_TYPES_H
12#define _UAPI_ASM_TYPES_H
13
14/*
15 * We don't use int-l64.h for the kernel anymore but still use it for
16 * userspace to avoid code changes.
17 */
18#ifndef __KERNEL__
19# if _MIPS_SZLONG == 64
20# include <asm-generic/int-l64.h>
21# else
22# include <asm-generic/int-ll64.h>
23# endif
24#endif
25
26
27#endif /* _UAPI_ASM_TYPES_H */
diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h
new file mode 100644
index 000000000000..cc98a9dcb01b
--- /dev/null
+++ b/arch/mips/include/uapi/asm/unistd.h
@@ -0,0 +1,1035 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 *
9 * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
10 * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
11 */
12#ifndef _UAPI_ASM_UNISTD_H
13#define _UAPI_ASM_UNISTD_H
14
15#include <asm/sgidefs.h>
16
17#if _MIPS_SIM == _MIPS_SIM_ABI32
18
19/*
20 * Linux o32 style syscalls are in the range from 4000 to 4999.
21 */
22#define __NR_Linux 4000
23#define __NR_syscall (__NR_Linux + 0)
24#define __NR_exit (__NR_Linux + 1)
25#define __NR_fork (__NR_Linux + 2)
26#define __NR_read (__NR_Linux + 3)
27#define __NR_write (__NR_Linux + 4)
28#define __NR_open (__NR_Linux + 5)
29#define __NR_close (__NR_Linux + 6)
30#define __NR_waitpid (__NR_Linux + 7)
31#define __NR_creat (__NR_Linux + 8)
32#define __NR_link (__NR_Linux + 9)
33#define __NR_unlink (__NR_Linux + 10)
34#define __NR_execve (__NR_Linux + 11)
35#define __NR_chdir (__NR_Linux + 12)
36#define __NR_time (__NR_Linux + 13)
37#define __NR_mknod (__NR_Linux + 14)
38#define __NR_chmod (__NR_Linux + 15)
39#define __NR_lchown (__NR_Linux + 16)
40#define __NR_break (__NR_Linux + 17)
41#define __NR_unused18 (__NR_Linux + 18)
42#define __NR_lseek (__NR_Linux + 19)
43#define __NR_getpid (__NR_Linux + 20)
44#define __NR_mount (__NR_Linux + 21)
45#define __NR_umount (__NR_Linux + 22)
46#define __NR_setuid (__NR_Linux + 23)
47#define __NR_getuid (__NR_Linux + 24)
48#define __NR_stime (__NR_Linux + 25)
49#define __NR_ptrace (__NR_Linux + 26)
50#define __NR_alarm (__NR_Linux + 27)
51#define __NR_unused28 (__NR_Linux + 28)
52#define __NR_pause (__NR_Linux + 29)
53#define __NR_utime (__NR_Linux + 30)
54#define __NR_stty (__NR_Linux + 31)
55#define __NR_gtty (__NR_Linux + 32)
56#define __NR_access (__NR_Linux + 33)
57#define __NR_nice (__NR_Linux + 34)
58#define __NR_ftime (__NR_Linux + 35)
59#define __NR_sync (__NR_Linux + 36)
60#define __NR_kill (__NR_Linux + 37)
61#define __NR_rename (__NR_Linux + 38)
62#define __NR_mkdir (__NR_Linux + 39)
63#define __NR_rmdir (__NR_Linux + 40)
64#define __NR_dup (__NR_Linux + 41)
65#define __NR_pipe (__NR_Linux + 42)
66#define __NR_times (__NR_Linux + 43)
67#define __NR_prof (__NR_Linux + 44)
68#define __NR_brk (__NR_Linux + 45)
69#define __NR_setgid (__NR_Linux + 46)
70#define __NR_getgid (__NR_Linux + 47)
71#define __NR_signal (__NR_Linux + 48)
72#define __NR_geteuid (__NR_Linux + 49)
73#define __NR_getegid (__NR_Linux + 50)
74#define __NR_acct (__NR_Linux + 51)
75#define __NR_umount2 (__NR_Linux + 52)
76#define __NR_lock (__NR_Linux + 53)
77#define __NR_ioctl (__NR_Linux + 54)
78#define __NR_fcntl (__NR_Linux + 55)
79#define __NR_mpx (__NR_Linux + 56)
80#define __NR_setpgid (__NR_Linux + 57)
81#define __NR_ulimit (__NR_Linux + 58)
82#define __NR_unused59 (__NR_Linux + 59)
83#define __NR_umask (__NR_Linux + 60)
84#define __NR_chroot (__NR_Linux + 61)
85#define __NR_ustat (__NR_Linux + 62)
86#define __NR_dup2 (__NR_Linux + 63)
87#define __NR_getppid (__NR_Linux + 64)
88#define __NR_getpgrp (__NR_Linux + 65)
89#define __NR_setsid (__NR_Linux + 66)
90#define __NR_sigaction (__NR_Linux + 67)
91#define __NR_sgetmask (__NR_Linux + 68)
92#define __NR_ssetmask (__NR_Linux + 69)
93#define __NR_setreuid (__NR_Linux + 70)
94#define __NR_setregid (__NR_Linux + 71)
95#define __NR_sigsuspend (__NR_Linux + 72)
96#define __NR_sigpending (__NR_Linux + 73)
97#define __NR_sethostname (__NR_Linux + 74)
98#define __NR_setrlimit (__NR_Linux + 75)
99#define __NR_getrlimit (__NR_Linux + 76)
100#define __NR_getrusage (__NR_Linux + 77)
101#define __NR_gettimeofday (__NR_Linux + 78)
102#define __NR_settimeofday (__NR_Linux + 79)
103#define __NR_getgroups (__NR_Linux + 80)
104#define __NR_setgroups (__NR_Linux + 81)
105#define __NR_reserved82 (__NR_Linux + 82)
106#define __NR_symlink (__NR_Linux + 83)
107#define __NR_unused84 (__NR_Linux + 84)
108#define __NR_readlink (__NR_Linux + 85)
109#define __NR_uselib (__NR_Linux + 86)
110#define __NR_swapon (__NR_Linux + 87)
111#define __NR_reboot (__NR_Linux + 88)
112#define __NR_readdir (__NR_Linux + 89)
113#define __NR_mmap (__NR_Linux + 90)
114#define __NR_munmap (__NR_Linux + 91)
115#define __NR_truncate (__NR_Linux + 92)
116#define __NR_ftruncate (__NR_Linux + 93)
117#define __NR_fchmod (__NR_Linux + 94)
118#define __NR_fchown (__NR_Linux + 95)
119#define __NR_getpriority (__NR_Linux + 96)
120#define __NR_setpriority (__NR_Linux + 97)
121#define __NR_profil (__NR_Linux + 98)
122#define __NR_statfs (__NR_Linux + 99)
123#define __NR_fstatfs (__NR_Linux + 100)
124#define __NR_ioperm (__NR_Linux + 101)
125#define __NR_socketcall (__NR_Linux + 102)
126#define __NR_syslog (__NR_Linux + 103)
127#define __NR_setitimer (__NR_Linux + 104)
128#define __NR_getitimer (__NR_Linux + 105)
129#define __NR_stat (__NR_Linux + 106)
130#define __NR_lstat (__NR_Linux + 107)
131#define __NR_fstat (__NR_Linux + 108)
132#define __NR_unused109 (__NR_Linux + 109)
133#define __NR_iopl (__NR_Linux + 110)
134#define __NR_vhangup (__NR_Linux + 111)
135#define __NR_idle (__NR_Linux + 112)
136#define __NR_vm86 (__NR_Linux + 113)
137#define __NR_wait4 (__NR_Linux + 114)
138#define __NR_swapoff (__NR_Linux + 115)
139#define __NR_sysinfo (__NR_Linux + 116)
140#define __NR_ipc (__NR_Linux + 117)
141#define __NR_fsync (__NR_Linux + 118)
142#define __NR_sigreturn (__NR_Linux + 119)
143#define __NR_clone (__NR_Linux + 120)
144#define __NR_setdomainname (__NR_Linux + 121)
145#define __NR_uname (__NR_Linux + 122)
146#define __NR_modify_ldt (__NR_Linux + 123)
147#define __NR_adjtimex (__NR_Linux + 124)
148#define __NR_mprotect (__NR_Linux + 125)
149#define __NR_sigprocmask (__NR_Linux + 126)
150#define __NR_create_module (__NR_Linux + 127)
151#define __NR_init_module (__NR_Linux + 128)
152#define __NR_delete_module (__NR_Linux + 129)
153#define __NR_get_kernel_syms (__NR_Linux + 130)
154#define __NR_quotactl (__NR_Linux + 131)
155#define __NR_getpgid (__NR_Linux + 132)
156#define __NR_fchdir (__NR_Linux + 133)
157#define __NR_bdflush (__NR_Linux + 134)
158#define __NR_sysfs (__NR_Linux + 135)
159#define __NR_personality (__NR_Linux + 136)
160#define __NR_afs_syscall (__NR_Linux + 137) /* Syscall for Andrew File System */
161#define __NR_setfsuid (__NR_Linux + 138)
162#define __NR_setfsgid (__NR_Linux + 139)
163#define __NR__llseek (__NR_Linux + 140)
164#define __NR_getdents (__NR_Linux + 141)
165#define __NR__newselect (__NR_Linux + 142)
166#define __NR_flock (__NR_Linux + 143)
167#define __NR_msync (__NR_Linux + 144)
168#define __NR_readv (__NR_Linux + 145)
169#define __NR_writev (__NR_Linux + 146)
170#define __NR_cacheflush (__NR_Linux + 147)
171#define __NR_cachectl (__NR_Linux + 148)
172#define __NR_sysmips (__NR_Linux + 149)
173#define __NR_unused150 (__NR_Linux + 150)
174#define __NR_getsid (__NR_Linux + 151)
175#define __NR_fdatasync (__NR_Linux + 152)
176#define __NR__sysctl (__NR_Linux + 153)
177#define __NR_mlock (__NR_Linux + 154)
178#define __NR_munlock (__NR_Linux + 155)
179#define __NR_mlockall (__NR_Linux + 156)
180#define __NR_munlockall (__NR_Linux + 157)
181#define __NR_sched_setparam (__NR_Linux + 158)
182#define __NR_sched_getparam (__NR_Linux + 159)
183#define __NR_sched_setscheduler (__NR_Linux + 160)
184#define __NR_sched_getscheduler (__NR_Linux + 161)
185#define __NR_sched_yield (__NR_Linux + 162)
186#define __NR_sched_get_priority_max (__NR_Linux + 163)
187#define __NR_sched_get_priority_min (__NR_Linux + 164)
188#define __NR_sched_rr_get_interval (__NR_Linux + 165)
189#define __NR_nanosleep (__NR_Linux + 166)
190#define __NR_mremap (__NR_Linux + 167)
191#define __NR_accept (__NR_Linux + 168)
192#define __NR_bind (__NR_Linux + 169)
193#define __NR_connect (__NR_Linux + 170)
194#define __NR_getpeername (__NR_Linux + 171)
195#define __NR_getsockname (__NR_Linux + 172)
196#define __NR_getsockopt (__NR_Linux + 173)
197#define __NR_listen (__NR_Linux + 174)
198#define __NR_recv (__NR_Linux + 175)
199#define __NR_recvfrom (__NR_Linux + 176)
200#define __NR_recvmsg (__NR_Linux + 177)
201#define __NR_send (__NR_Linux + 178)
202#define __NR_sendmsg (__NR_Linux + 179)
203#define __NR_sendto (__NR_Linux + 180)
204#define __NR_setsockopt (__NR_Linux + 181)
205#define __NR_shutdown (__NR_Linux + 182)
206#define __NR_socket (__NR_Linux + 183)
207#define __NR_socketpair (__NR_Linux + 184)
208#define __NR_setresuid (__NR_Linux + 185)
209#define __NR_getresuid (__NR_Linux + 186)
210#define __NR_query_module (__NR_Linux + 187)
211#define __NR_poll (__NR_Linux + 188)
212#define __NR_nfsservctl (__NR_Linux + 189)
213#define __NR_setresgid (__NR_Linux + 190)
214#define __NR_getresgid (__NR_Linux + 191)
215#define __NR_prctl (__NR_Linux + 192)
216#define __NR_rt_sigreturn (__NR_Linux + 193)
217#define __NR_rt_sigaction (__NR_Linux + 194)
218#define __NR_rt_sigprocmask (__NR_Linux + 195)
219#define __NR_rt_sigpending (__NR_Linux + 196)
220#define __NR_rt_sigtimedwait (__NR_Linux + 197)
221#define __NR_rt_sigqueueinfo (__NR_Linux + 198)
222#define __NR_rt_sigsuspend (__NR_Linux + 199)
223#define __NR_pread64 (__NR_Linux + 200)
224#define __NR_pwrite64 (__NR_Linux + 201)
225#define __NR_chown (__NR_Linux + 202)
226#define __NR_getcwd (__NR_Linux + 203)
227#define __NR_capget (__NR_Linux + 204)
228#define __NR_capset (__NR_Linux + 205)
229#define __NR_sigaltstack (__NR_Linux + 206)
230#define __NR_sendfile (__NR_Linux + 207)
231#define __NR_getpmsg (__NR_Linux + 208)
232#define __NR_putpmsg (__NR_Linux + 209)
233#define __NR_mmap2 (__NR_Linux + 210)
234#define __NR_truncate64 (__NR_Linux + 211)
235#define __NR_ftruncate64 (__NR_Linux + 212)
236#define __NR_stat64 (__NR_Linux + 213)
237#define __NR_lstat64 (__NR_Linux + 214)
238#define __NR_fstat64 (__NR_Linux + 215)
239#define __NR_pivot_root (__NR_Linux + 216)
240#define __NR_mincore (__NR_Linux + 217)
241#define __NR_madvise (__NR_Linux + 218)
242#define __NR_getdents64 (__NR_Linux + 219)
243#define __NR_fcntl64 (__NR_Linux + 220)
244#define __NR_reserved221 (__NR_Linux + 221)
245#define __NR_gettid (__NR_Linux + 222)
246#define __NR_readahead (__NR_Linux + 223)
247#define __NR_setxattr (__NR_Linux + 224)
248#define __NR_lsetxattr (__NR_Linux + 225)
249#define __NR_fsetxattr (__NR_Linux + 226)
250#define __NR_getxattr (__NR_Linux + 227)
251#define __NR_lgetxattr (__NR_Linux + 228)
252#define __NR_fgetxattr (__NR_Linux + 229)
253#define __NR_listxattr (__NR_Linux + 230)
254#define __NR_llistxattr (__NR_Linux + 231)
255#define __NR_flistxattr (__NR_Linux + 232)
256#define __NR_removexattr (__NR_Linux + 233)
257#define __NR_lremovexattr (__NR_Linux + 234)
258#define __NR_fremovexattr (__NR_Linux + 235)
259#define __NR_tkill (__NR_Linux + 236)
260#define __NR_sendfile64 (__NR_Linux + 237)
261#define __NR_futex (__NR_Linux + 238)
262#define __NR_sched_setaffinity (__NR_Linux + 239)
263#define __NR_sched_getaffinity (__NR_Linux + 240)
264#define __NR_io_setup (__NR_Linux + 241)
265#define __NR_io_destroy (__NR_Linux + 242)
266#define __NR_io_getevents (__NR_Linux + 243)
267#define __NR_io_submit (__NR_Linux + 244)
268#define __NR_io_cancel (__NR_Linux + 245)
269#define __NR_exit_group (__NR_Linux + 246)
270#define __NR_lookup_dcookie (__NR_Linux + 247)
271#define __NR_epoll_create (__NR_Linux + 248)
272#define __NR_epoll_ctl (__NR_Linux + 249)
273#define __NR_epoll_wait (__NR_Linux + 250)
274#define __NR_remap_file_pages (__NR_Linux + 251)
275#define __NR_set_tid_address (__NR_Linux + 252)
276#define __NR_restart_syscall (__NR_Linux + 253)
277#define __NR_fadvise64 (__NR_Linux + 254)
278#define __NR_statfs64 (__NR_Linux + 255)
279#define __NR_fstatfs64 (__NR_Linux + 256)
280#define __NR_timer_create (__NR_Linux + 257)
281#define __NR_timer_settime (__NR_Linux + 258)
282#define __NR_timer_gettime (__NR_Linux + 259)
283#define __NR_timer_getoverrun (__NR_Linux + 260)
284#define __NR_timer_delete (__NR_Linux + 261)
285#define __NR_clock_settime (__NR_Linux + 262)
286#define __NR_clock_gettime (__NR_Linux + 263)
287#define __NR_clock_getres (__NR_Linux + 264)
288#define __NR_clock_nanosleep (__NR_Linux + 265)
289#define __NR_tgkill (__NR_Linux + 266)
290#define __NR_utimes (__NR_Linux + 267)
291#define __NR_mbind (__NR_Linux + 268)
292#define __NR_get_mempolicy (__NR_Linux + 269)
293#define __NR_set_mempolicy (__NR_Linux + 270)
294#define __NR_mq_open (__NR_Linux + 271)
295#define __NR_mq_unlink (__NR_Linux + 272)
296#define __NR_mq_timedsend (__NR_Linux + 273)
297#define __NR_mq_timedreceive (__NR_Linux + 274)
298#define __NR_mq_notify (__NR_Linux + 275)
299#define __NR_mq_getsetattr (__NR_Linux + 276)
300#define __NR_vserver (__NR_Linux + 277)
301#define __NR_waitid (__NR_Linux + 278)
302/* #define __NR_sys_setaltroot (__NR_Linux + 279) */
303#define __NR_add_key (__NR_Linux + 280)
304#define __NR_request_key (__NR_Linux + 281)
305#define __NR_keyctl (__NR_Linux + 282)
306#define __NR_set_thread_area (__NR_Linux + 283)
307#define __NR_inotify_init (__NR_Linux + 284)
308#define __NR_inotify_add_watch (__NR_Linux + 285)
309#define __NR_inotify_rm_watch (__NR_Linux + 286)
310#define __NR_migrate_pages (__NR_Linux + 287)
311#define __NR_openat (__NR_Linux + 288)
312#define __NR_mkdirat (__NR_Linux + 289)
313#define __NR_mknodat (__NR_Linux + 290)
314#define __NR_fchownat (__NR_Linux + 291)
315#define __NR_futimesat (__NR_Linux + 292)
316#define __NR_fstatat64 (__NR_Linux + 293)
317#define __NR_unlinkat (__NR_Linux + 294)
318#define __NR_renameat (__NR_Linux + 295)
319#define __NR_linkat (__NR_Linux + 296)
320#define __NR_symlinkat (__NR_Linux + 297)
321#define __NR_readlinkat (__NR_Linux + 298)
322#define __NR_fchmodat (__NR_Linux + 299)
323#define __NR_faccessat (__NR_Linux + 300)
324#define __NR_pselect6 (__NR_Linux + 301)
325#define __NR_ppoll (__NR_Linux + 302)
326#define __NR_unshare (__NR_Linux + 303)
327#define __NR_splice (__NR_Linux + 304)
328#define __NR_sync_file_range (__NR_Linux + 305)
329#define __NR_tee (__NR_Linux + 306)
330#define __NR_vmsplice (__NR_Linux + 307)
331#define __NR_move_pages (__NR_Linux + 308)
332#define __NR_set_robust_list (__NR_Linux + 309)
333#define __NR_get_robust_list (__NR_Linux + 310)
334#define __NR_kexec_load (__NR_Linux + 311)
335#define __NR_getcpu (__NR_Linux + 312)
336#define __NR_epoll_pwait (__NR_Linux + 313)
337#define __NR_ioprio_set (__NR_Linux + 314)
338#define __NR_ioprio_get (__NR_Linux + 315)
339#define __NR_utimensat (__NR_Linux + 316)
340#define __NR_signalfd (__NR_Linux + 317)
341#define __NR_timerfd (__NR_Linux + 318)
342#define __NR_eventfd (__NR_Linux + 319)
343#define __NR_fallocate (__NR_Linux + 320)
344#define __NR_timerfd_create (__NR_Linux + 321)
345#define __NR_timerfd_gettime (__NR_Linux + 322)
346#define __NR_timerfd_settime (__NR_Linux + 323)
347#define __NR_signalfd4 (__NR_Linux + 324)
348#define __NR_eventfd2 (__NR_Linux + 325)
349#define __NR_epoll_create1 (__NR_Linux + 326)
350#define __NR_dup3 (__NR_Linux + 327)
351#define __NR_pipe2 (__NR_Linux + 328)
352#define __NR_inotify_init1 (__NR_Linux + 329)
353#define __NR_preadv (__NR_Linux + 330)
354#define __NR_pwritev (__NR_Linux + 331)
355#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332)
356#define __NR_perf_event_open (__NR_Linux + 333)
357#define __NR_accept4 (__NR_Linux + 334)
358#define __NR_recvmmsg (__NR_Linux + 335)
359#define __NR_fanotify_init (__NR_Linux + 336)
360#define __NR_fanotify_mark (__NR_Linux + 337)
361#define __NR_prlimit64 (__NR_Linux + 338)
362#define __NR_name_to_handle_at (__NR_Linux + 339)
363#define __NR_open_by_handle_at (__NR_Linux + 340)
364#define __NR_clock_adjtime (__NR_Linux + 341)
365#define __NR_syncfs (__NR_Linux + 342)
366#define __NR_sendmmsg (__NR_Linux + 343)
367#define __NR_setns (__NR_Linux + 344)
368#define __NR_process_vm_readv (__NR_Linux + 345)
369#define __NR_process_vm_writev (__NR_Linux + 346)
370#define __NR_kcmp (__NR_Linux + 347)
371
372/*
373 * Offset of the last Linux o32 flavoured syscall
374 */
375#define __NR_Linux_syscalls 347
376
377#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
378
379#define __NR_O32_Linux 4000
380#define __NR_O32_Linux_syscalls 347
381
382#if _MIPS_SIM == _MIPS_SIM_ABI64
383
384/*
385 * Linux 64-bit syscalls are in the range from 5000 to 5999.
386 */
387#define __NR_Linux 5000
388#define __NR_read (__NR_Linux + 0)
389#define __NR_write (__NR_Linux + 1)
390#define __NR_open (__NR_Linux + 2)
391#define __NR_close (__NR_Linux + 3)
392#define __NR_stat (__NR_Linux + 4)
393#define __NR_fstat (__NR_Linux + 5)
394#define __NR_lstat (__NR_Linux + 6)
395#define __NR_poll (__NR_Linux + 7)
396#define __NR_lseek (__NR_Linux + 8)
397#define __NR_mmap (__NR_Linux + 9)
398#define __NR_mprotect (__NR_Linux + 10)
399#define __NR_munmap (__NR_Linux + 11)
400#define __NR_brk (__NR_Linux + 12)
401#define __NR_rt_sigaction (__NR_Linux + 13)
402#define __NR_rt_sigprocmask (__NR_Linux + 14)
403#define __NR_ioctl (__NR_Linux + 15)
404#define __NR_pread64 (__NR_Linux + 16)
405#define __NR_pwrite64 (__NR_Linux + 17)
406#define __NR_readv (__NR_Linux + 18)
407#define __NR_writev (__NR_Linux + 19)
408#define __NR_access (__NR_Linux + 20)
409#define __NR_pipe (__NR_Linux + 21)
410#define __NR__newselect (__NR_Linux + 22)
411#define __NR_sched_yield (__NR_Linux + 23)
412#define __NR_mremap (__NR_Linux + 24)
413#define __NR_msync (__NR_Linux + 25)
414#define __NR_mincore (__NR_Linux + 26)
415#define __NR_madvise (__NR_Linux + 27)
416#define __NR_shmget (__NR_Linux + 28)
417#define __NR_shmat (__NR_Linux + 29)
418#define __NR_shmctl (__NR_Linux + 30)
419#define __NR_dup (__NR_Linux + 31)
420#define __NR_dup2 (__NR_Linux + 32)
421#define __NR_pause (__NR_Linux + 33)
422#define __NR_nanosleep (__NR_Linux + 34)
423#define __NR_getitimer (__NR_Linux + 35)
424#define __NR_setitimer (__NR_Linux + 36)
425#define __NR_alarm (__NR_Linux + 37)
426#define __NR_getpid (__NR_Linux + 38)
427#define __NR_sendfile (__NR_Linux + 39)
428#define __NR_socket (__NR_Linux + 40)
429#define __NR_connect (__NR_Linux + 41)
430#define __NR_accept (__NR_Linux + 42)
431#define __NR_sendto (__NR_Linux + 43)
432#define __NR_recvfrom (__NR_Linux + 44)
433#define __NR_sendmsg (__NR_Linux + 45)
434#define __NR_recvmsg (__NR_Linux + 46)
435#define __NR_shutdown (__NR_Linux + 47)
436#define __NR_bind (__NR_Linux + 48)
437#define __NR_listen (__NR_Linux + 49)
438#define __NR_getsockname (__NR_Linux + 50)
439#define __NR_getpeername (__NR_Linux + 51)
440#define __NR_socketpair (__NR_Linux + 52)
441#define __NR_setsockopt (__NR_Linux + 53)
442#define __NR_getsockopt (__NR_Linux + 54)
443#define __NR_clone (__NR_Linux + 55)
444#define __NR_fork (__NR_Linux + 56)
445#define __NR_execve (__NR_Linux + 57)
446#define __NR_exit (__NR_Linux + 58)
447#define __NR_wait4 (__NR_Linux + 59)
448#define __NR_kill (__NR_Linux + 60)
449#define __NR_uname (__NR_Linux + 61)
450#define __NR_semget (__NR_Linux + 62)
451#define __NR_semop (__NR_Linux + 63)
452#define __NR_semctl (__NR_Linux + 64)
453#define __NR_shmdt (__NR_Linux + 65)
454#define __NR_msgget (__NR_Linux + 66)
455#define __NR_msgsnd (__NR_Linux + 67)
456#define __NR_msgrcv (__NR_Linux + 68)
457#define __NR_msgctl (__NR_Linux + 69)
458#define __NR_fcntl (__NR_Linux + 70)
459#define __NR_flock (__NR_Linux + 71)
460#define __NR_fsync (__NR_Linux + 72)
461#define __NR_fdatasync (__NR_Linux + 73)
462#define __NR_truncate (__NR_Linux + 74)
463#define __NR_ftruncate (__NR_Linux + 75)
464#define __NR_getdents (__NR_Linux + 76)
465#define __NR_getcwd (__NR_Linux + 77)
466#define __NR_chdir (__NR_Linux + 78)
467#define __NR_fchdir (__NR_Linux + 79)
468#define __NR_rename (__NR_Linux + 80)
469#define __NR_mkdir (__NR_Linux + 81)
470#define __NR_rmdir (__NR_Linux + 82)
471#define __NR_creat (__NR_Linux + 83)
472#define __NR_link (__NR_Linux + 84)
473#define __NR_unlink (__NR_Linux + 85)
474#define __NR_symlink (__NR_Linux + 86)
475#define __NR_readlink (__NR_Linux + 87)
476#define __NR_chmod (__NR_Linux + 88)
477#define __NR_fchmod (__NR_Linux + 89)
478#define __NR_chown (__NR_Linux + 90)
479#define __NR_fchown (__NR_Linux + 91)
480#define __NR_lchown (__NR_Linux + 92)
481#define __NR_umask (__NR_Linux + 93)
482#define __NR_gettimeofday (__NR_Linux + 94)
483#define __NR_getrlimit (__NR_Linux + 95)
484#define __NR_getrusage (__NR_Linux + 96)
485#define __NR_sysinfo (__NR_Linux + 97)
486#define __NR_times (__NR_Linux + 98)
487#define __NR_ptrace (__NR_Linux + 99)
488#define __NR_getuid (__NR_Linux + 100)
489#define __NR_syslog (__NR_Linux + 101)
490#define __NR_getgid (__NR_Linux + 102)
491#define __NR_setuid (__NR_Linux + 103)
492#define __NR_setgid (__NR_Linux + 104)
493#define __NR_geteuid (__NR_Linux + 105)
494#define __NR_getegid (__NR_Linux + 106)
495#define __NR_setpgid (__NR_Linux + 107)
496#define __NR_getppid (__NR_Linux + 108)
497#define __NR_getpgrp (__NR_Linux + 109)
498#define __NR_setsid (__NR_Linux + 110)
499#define __NR_setreuid (__NR_Linux + 111)
500#define __NR_setregid (__NR_Linux + 112)
501#define __NR_getgroups (__NR_Linux + 113)
502#define __NR_setgroups (__NR_Linux + 114)
503#define __NR_setresuid (__NR_Linux + 115)
504#define __NR_getresuid (__NR_Linux + 116)
505#define __NR_setresgid (__NR_Linux + 117)
506#define __NR_getresgid (__NR_Linux + 118)
507#define __NR_getpgid (__NR_Linux + 119)
508#define __NR_setfsuid (__NR_Linux + 120)
509#define __NR_setfsgid (__NR_Linux + 121)
510#define __NR_getsid (__NR_Linux + 122)
511#define __NR_capget (__NR_Linux + 123)
512#define __NR_capset (__NR_Linux + 124)
513#define __NR_rt_sigpending (__NR_Linux + 125)
514#define __NR_rt_sigtimedwait (__NR_Linux + 126)
515#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
516#define __NR_rt_sigsuspend (__NR_Linux + 128)
517#define __NR_sigaltstack (__NR_Linux + 129)
518#define __NR_utime (__NR_Linux + 130)
519#define __NR_mknod (__NR_Linux + 131)
520#define __NR_personality (__NR_Linux + 132)
521#define __NR_ustat (__NR_Linux + 133)
522#define __NR_statfs (__NR_Linux + 134)
523#define __NR_fstatfs (__NR_Linux + 135)
524#define __NR_sysfs (__NR_Linux + 136)
525#define __NR_getpriority (__NR_Linux + 137)
526#define __NR_setpriority (__NR_Linux + 138)
527#define __NR_sched_setparam (__NR_Linux + 139)
528#define __NR_sched_getparam (__NR_Linux + 140)
529#define __NR_sched_setscheduler (__NR_Linux + 141)
530#define __NR_sched_getscheduler (__NR_Linux + 142)
531#define __NR_sched_get_priority_max (__NR_Linux + 143)
532#define __NR_sched_get_priority_min (__NR_Linux + 144)
533#define __NR_sched_rr_get_interval (__NR_Linux + 145)
534#define __NR_mlock (__NR_Linux + 146)
535#define __NR_munlock (__NR_Linux + 147)
536#define __NR_mlockall (__NR_Linux + 148)
537#define __NR_munlockall (__NR_Linux + 149)
538#define __NR_vhangup (__NR_Linux + 150)
539#define __NR_pivot_root (__NR_Linux + 151)
540#define __NR__sysctl (__NR_Linux + 152)
541#define __NR_prctl (__NR_Linux + 153)
542#define __NR_adjtimex (__NR_Linux + 154)
543#define __NR_setrlimit (__NR_Linux + 155)
544#define __NR_chroot (__NR_Linux + 156)
545#define __NR_sync (__NR_Linux + 157)
546#define __NR_acct (__NR_Linux + 158)
547#define __NR_settimeofday (__NR_Linux + 159)
548#define __NR_mount (__NR_Linux + 160)
549#define __NR_umount2 (__NR_Linux + 161)
550#define __NR_swapon (__NR_Linux + 162)
551#define __NR_swapoff (__NR_Linux + 163)
552#define __NR_reboot (__NR_Linux + 164)
553#define __NR_sethostname (__NR_Linux + 165)
554#define __NR_setdomainname (__NR_Linux + 166)
555#define __NR_create_module (__NR_Linux + 167)
556#define __NR_init_module (__NR_Linux + 168)
557#define __NR_delete_module (__NR_Linux + 169)
558#define __NR_get_kernel_syms (__NR_Linux + 170)
559#define __NR_query_module (__NR_Linux + 171)
560#define __NR_quotactl (__NR_Linux + 172)
561#define __NR_nfsservctl (__NR_Linux + 173)
562#define __NR_getpmsg (__NR_Linux + 174)
563#define __NR_putpmsg (__NR_Linux + 175)
564#define __NR_afs_syscall (__NR_Linux + 176)
565#define __NR_reserved177 (__NR_Linux + 177)
566#define __NR_gettid (__NR_Linux + 178)
567#define __NR_readahead (__NR_Linux + 179)
568#define __NR_setxattr (__NR_Linux + 180)
569#define __NR_lsetxattr (__NR_Linux + 181)
570#define __NR_fsetxattr (__NR_Linux + 182)
571#define __NR_getxattr (__NR_Linux + 183)
572#define __NR_lgetxattr (__NR_Linux + 184)
573#define __NR_fgetxattr (__NR_Linux + 185)
574#define __NR_listxattr (__NR_Linux + 186)
575#define __NR_llistxattr (__NR_Linux + 187)
576#define __NR_flistxattr (__NR_Linux + 188)
577#define __NR_removexattr (__NR_Linux + 189)
578#define __NR_lremovexattr (__NR_Linux + 190)
579#define __NR_fremovexattr (__NR_Linux + 191)
580#define __NR_tkill (__NR_Linux + 192)
581#define __NR_reserved193 (__NR_Linux + 193)
582#define __NR_futex (__NR_Linux + 194)
583#define __NR_sched_setaffinity (__NR_Linux + 195)
584#define __NR_sched_getaffinity (__NR_Linux + 196)
585#define __NR_cacheflush (__NR_Linux + 197)
586#define __NR_cachectl (__NR_Linux + 198)
587#define __NR_sysmips (__NR_Linux + 199)
588#define __NR_io_setup (__NR_Linux + 200)
589#define __NR_io_destroy (__NR_Linux + 201)
590#define __NR_io_getevents (__NR_Linux + 202)
591#define __NR_io_submit (__NR_Linux + 203)
592#define __NR_io_cancel (__NR_Linux + 204)
593#define __NR_exit_group (__NR_Linux + 205)
594#define __NR_lookup_dcookie (__NR_Linux + 206)
595#define __NR_epoll_create (__NR_Linux + 207)
596#define __NR_epoll_ctl (__NR_Linux + 208)
597#define __NR_epoll_wait (__NR_Linux + 209)
598#define __NR_remap_file_pages (__NR_Linux + 210)
599#define __NR_rt_sigreturn (__NR_Linux + 211)
600#define __NR_set_tid_address (__NR_Linux + 212)
601#define __NR_restart_syscall (__NR_Linux + 213)
602#define __NR_semtimedop (__NR_Linux + 214)
603#define __NR_fadvise64 (__NR_Linux + 215)
604#define __NR_timer_create (__NR_Linux + 216)
605#define __NR_timer_settime (__NR_Linux + 217)
606#define __NR_timer_gettime (__NR_Linux + 218)
607#define __NR_timer_getoverrun (__NR_Linux + 219)
608#define __NR_timer_delete (__NR_Linux + 220)
609#define __NR_clock_settime (__NR_Linux + 221)
610#define __NR_clock_gettime (__NR_Linux + 222)
611#define __NR_clock_getres (__NR_Linux + 223)
612#define __NR_clock_nanosleep (__NR_Linux + 224)
613#define __NR_tgkill (__NR_Linux + 225)
614#define __NR_utimes (__NR_Linux + 226)
615#define __NR_mbind (__NR_Linux + 227)
616#define __NR_get_mempolicy (__NR_Linux + 228)
617#define __NR_set_mempolicy (__NR_Linux + 229)
618#define __NR_mq_open (__NR_Linux + 230)
619#define __NR_mq_unlink (__NR_Linux + 231)
620#define __NR_mq_timedsend (__NR_Linux + 232)
621#define __NR_mq_timedreceive (__NR_Linux + 233)
622#define __NR_mq_notify (__NR_Linux + 234)
623#define __NR_mq_getsetattr (__NR_Linux + 235)
624#define __NR_vserver (__NR_Linux + 236)
625#define __NR_waitid (__NR_Linux + 237)
626/* #define __NR_sys_setaltroot (__NR_Linux + 238) */
627#define __NR_add_key (__NR_Linux + 239)
628#define __NR_request_key (__NR_Linux + 240)
629#define __NR_keyctl (__NR_Linux + 241)
630#define __NR_set_thread_area (__NR_Linux + 242)
631#define __NR_inotify_init (__NR_Linux + 243)
632#define __NR_inotify_add_watch (__NR_Linux + 244)
633#define __NR_inotify_rm_watch (__NR_Linux + 245)
634#define __NR_migrate_pages (__NR_Linux + 246)
635#define __NR_openat (__NR_Linux + 247)
636#define __NR_mkdirat (__NR_Linux + 248)
637#define __NR_mknodat (__NR_Linux + 249)
638#define __NR_fchownat (__NR_Linux + 250)
639#define __NR_futimesat (__NR_Linux + 251)
640#define __NR_newfstatat (__NR_Linux + 252)
641#define __NR_unlinkat (__NR_Linux + 253)
642#define __NR_renameat (__NR_Linux + 254)
643#define __NR_linkat (__NR_Linux + 255)
644#define __NR_symlinkat (__NR_Linux + 256)
645#define __NR_readlinkat (__NR_Linux + 257)
646#define __NR_fchmodat (__NR_Linux + 258)
647#define __NR_faccessat (__NR_Linux + 259)
648#define __NR_pselect6 (__NR_Linux + 260)
649#define __NR_ppoll (__NR_Linux + 261)
650#define __NR_unshare (__NR_Linux + 262)
651#define __NR_splice (__NR_Linux + 263)
652#define __NR_sync_file_range (__NR_Linux + 264)
653#define __NR_tee (__NR_Linux + 265)
654#define __NR_vmsplice (__NR_Linux + 266)
655#define __NR_move_pages (__NR_Linux + 267)
656#define __NR_set_robust_list (__NR_Linux + 268)
657#define __NR_get_robust_list (__NR_Linux + 269)
658#define __NR_kexec_load (__NR_Linux + 270)
659#define __NR_getcpu (__NR_Linux + 271)
660#define __NR_epoll_pwait (__NR_Linux + 272)
661#define __NR_ioprio_set (__NR_Linux + 273)
662#define __NR_ioprio_get (__NR_Linux + 274)
663#define __NR_utimensat (__NR_Linux + 275)
664#define __NR_signalfd (__NR_Linux + 276)
665#define __NR_timerfd (__NR_Linux + 277)
666#define __NR_eventfd (__NR_Linux + 278)
667#define __NR_fallocate (__NR_Linux + 279)
668#define __NR_timerfd_create (__NR_Linux + 280)
669#define __NR_timerfd_gettime (__NR_Linux + 281)
670#define __NR_timerfd_settime (__NR_Linux + 282)
671#define __NR_signalfd4 (__NR_Linux + 283)
672#define __NR_eventfd2 (__NR_Linux + 284)
673#define __NR_epoll_create1 (__NR_Linux + 285)
674#define __NR_dup3 (__NR_Linux + 286)
675#define __NR_pipe2 (__NR_Linux + 287)
676#define __NR_inotify_init1 (__NR_Linux + 288)
677#define __NR_preadv (__NR_Linux + 289)
678#define __NR_pwritev (__NR_Linux + 290)
679#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
680#define __NR_perf_event_open (__NR_Linux + 292)
681#define __NR_accept4 (__NR_Linux + 293)
682#define __NR_recvmmsg (__NR_Linux + 294)
683#define __NR_fanotify_init (__NR_Linux + 295)
684#define __NR_fanotify_mark (__NR_Linux + 296)
685#define __NR_prlimit64 (__NR_Linux + 297)
686#define __NR_name_to_handle_at (__NR_Linux + 298)
687#define __NR_open_by_handle_at (__NR_Linux + 299)
688#define __NR_clock_adjtime (__NR_Linux + 300)
689#define __NR_syncfs (__NR_Linux + 301)
690#define __NR_sendmmsg (__NR_Linux + 302)
691#define __NR_setns (__NR_Linux + 303)
692#define __NR_process_vm_readv (__NR_Linux + 304)
693#define __NR_process_vm_writev (__NR_Linux + 305)
694#define __NR_kcmp (__NR_Linux + 306)
695
696/*
697 * Offset of the last Linux 64-bit flavoured syscall
698 */
699#define __NR_Linux_syscalls 306
700
701#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
702
703#define __NR_64_Linux 5000
704#define __NR_64_Linux_syscalls 306
705
706#if _MIPS_SIM == _MIPS_SIM_NABI32
707
708/*
709 * Linux N32 syscalls are in the range from 6000 to 6999.
710 */
711#define __NR_Linux 6000
712#define __NR_read (__NR_Linux + 0)
713#define __NR_write (__NR_Linux + 1)
714#define __NR_open (__NR_Linux + 2)
715#define __NR_close (__NR_Linux + 3)
716#define __NR_stat (__NR_Linux + 4)
717#define __NR_fstat (__NR_Linux + 5)
718#define __NR_lstat (__NR_Linux + 6)
719#define __NR_poll (__NR_Linux + 7)
720#define __NR_lseek (__NR_Linux + 8)
721#define __NR_mmap (__NR_Linux + 9)
722#define __NR_mprotect (__NR_Linux + 10)
723#define __NR_munmap (__NR_Linux + 11)
724#define __NR_brk (__NR_Linux + 12)
725#define __NR_rt_sigaction (__NR_Linux + 13)
726#define __NR_rt_sigprocmask (__NR_Linux + 14)
727#define __NR_ioctl (__NR_Linux + 15)
728#define __NR_pread64 (__NR_Linux + 16)
729#define __NR_pwrite64 (__NR_Linux + 17)
730#define __NR_readv (__NR_Linux + 18)
731#define __NR_writev (__NR_Linux + 19)
732#define __NR_access (__NR_Linux + 20)
733#define __NR_pipe (__NR_Linux + 21)
734#define __NR__newselect (__NR_Linux + 22)
735#define __NR_sched_yield (__NR_Linux + 23)
736#define __NR_mremap (__NR_Linux + 24)
737#define __NR_msync (__NR_Linux + 25)
738#define __NR_mincore (__NR_Linux + 26)
739#define __NR_madvise (__NR_Linux + 27)
740#define __NR_shmget (__NR_Linux + 28)
741#define __NR_shmat (__NR_Linux + 29)
742#define __NR_shmctl (__NR_Linux + 30)
743#define __NR_dup (__NR_Linux + 31)
744#define __NR_dup2 (__NR_Linux + 32)
745#define __NR_pause (__NR_Linux + 33)
746#define __NR_nanosleep (__NR_Linux + 34)
747#define __NR_getitimer (__NR_Linux + 35)
748#define __NR_setitimer (__NR_Linux + 36)
749#define __NR_alarm (__NR_Linux + 37)
750#define __NR_getpid (__NR_Linux + 38)
751#define __NR_sendfile (__NR_Linux + 39)
752#define __NR_socket (__NR_Linux + 40)
753#define __NR_connect (__NR_Linux + 41)
754#define __NR_accept (__NR_Linux + 42)
755#define __NR_sendto (__NR_Linux + 43)
756#define __NR_recvfrom (__NR_Linux + 44)
757#define __NR_sendmsg (__NR_Linux + 45)
758#define __NR_recvmsg (__NR_Linux + 46)
759#define __NR_shutdown (__NR_Linux + 47)
760#define __NR_bind (__NR_Linux + 48)
761#define __NR_listen (__NR_Linux + 49)
762#define __NR_getsockname (__NR_Linux + 50)
763#define __NR_getpeername (__NR_Linux + 51)
764#define __NR_socketpair (__NR_Linux + 52)
765#define __NR_setsockopt (__NR_Linux + 53)
766#define __NR_getsockopt (__NR_Linux + 54)
767#define __NR_clone (__NR_Linux + 55)
768#define __NR_fork (__NR_Linux + 56)
769#define __NR_execve (__NR_Linux + 57)
770#define __NR_exit (__NR_Linux + 58)
771#define __NR_wait4 (__NR_Linux + 59)
772#define __NR_kill (__NR_Linux + 60)
773#define __NR_uname (__NR_Linux + 61)
774#define __NR_semget (__NR_Linux + 62)
775#define __NR_semop (__NR_Linux + 63)
776#define __NR_semctl (__NR_Linux + 64)
777#define __NR_shmdt (__NR_Linux + 65)
778#define __NR_msgget (__NR_Linux + 66)
779#define __NR_msgsnd (__NR_Linux + 67)
780#define __NR_msgrcv (__NR_Linux + 68)
781#define __NR_msgctl (__NR_Linux + 69)
782#define __NR_fcntl (__NR_Linux + 70)
783#define __NR_flock (__NR_Linux + 71)
784#define __NR_fsync (__NR_Linux + 72)
785#define __NR_fdatasync (__NR_Linux + 73)
786#define __NR_truncate (__NR_Linux + 74)
787#define __NR_ftruncate (__NR_Linux + 75)
788#define __NR_getdents (__NR_Linux + 76)
789#define __NR_getcwd (__NR_Linux + 77)
790#define __NR_chdir (__NR_Linux + 78)
791#define __NR_fchdir (__NR_Linux + 79)
792#define __NR_rename (__NR_Linux + 80)
793#define __NR_mkdir (__NR_Linux + 81)
794#define __NR_rmdir (__NR_Linux + 82)
795#define __NR_creat (__NR_Linux + 83)
796#define __NR_link (__NR_Linux + 84)
797#define __NR_unlink (__NR_Linux + 85)
798#define __NR_symlink (__NR_Linux + 86)
799#define __NR_readlink (__NR_Linux + 87)
800#define __NR_chmod (__NR_Linux + 88)
801#define __NR_fchmod (__NR_Linux + 89)
802#define __NR_chown (__NR_Linux + 90)
803#define __NR_fchown (__NR_Linux + 91)
804#define __NR_lchown (__NR_Linux + 92)
805#define __NR_umask (__NR_Linux + 93)
806#define __NR_gettimeofday (__NR_Linux + 94)
807#define __NR_getrlimit (__NR_Linux + 95)
808#define __NR_getrusage (__NR_Linux + 96)
809#define __NR_sysinfo (__NR_Linux + 97)
810#define __NR_times (__NR_Linux + 98)
811#define __NR_ptrace (__NR_Linux + 99)
812#define __NR_getuid (__NR_Linux + 100)
813#define __NR_syslog (__NR_Linux + 101)
814#define __NR_getgid (__NR_Linux + 102)
815#define __NR_setuid (__NR_Linux + 103)
816#define __NR_setgid (__NR_Linux + 104)
817#define __NR_geteuid (__NR_Linux + 105)
818#define __NR_getegid (__NR_Linux + 106)
819#define __NR_setpgid (__NR_Linux + 107)
820#define __NR_getppid (__NR_Linux + 108)
821#define __NR_getpgrp (__NR_Linux + 109)
822#define __NR_setsid (__NR_Linux + 110)
823#define __NR_setreuid (__NR_Linux + 111)
824#define __NR_setregid (__NR_Linux + 112)
825#define __NR_getgroups (__NR_Linux + 113)
826#define __NR_setgroups (__NR_Linux + 114)
827#define __NR_setresuid (__NR_Linux + 115)
828#define __NR_getresuid (__NR_Linux + 116)
829#define __NR_setresgid (__NR_Linux + 117)
830#define __NR_getresgid (__NR_Linux + 118)
831#define __NR_getpgid (__NR_Linux + 119)
832#define __NR_setfsuid (__NR_Linux + 120)
833#define __NR_setfsgid (__NR_Linux + 121)
834#define __NR_getsid (__NR_Linux + 122)
835#define __NR_capget (__NR_Linux + 123)
836#define __NR_capset (__NR_Linux + 124)
837#define __NR_rt_sigpending (__NR_Linux + 125)
838#define __NR_rt_sigtimedwait (__NR_Linux + 126)
839#define __NR_rt_sigqueueinfo (__NR_Linux + 127)
840#define __NR_rt_sigsuspend (__NR_Linux + 128)
841#define __NR_sigaltstack (__NR_Linux + 129)
842#define __NR_utime (__NR_Linux + 130)
843#define __NR_mknod (__NR_Linux + 131)
844#define __NR_personality (__NR_Linux + 132)
845#define __NR_ustat (__NR_Linux + 133)
846#define __NR_statfs (__NR_Linux + 134)
847#define __NR_fstatfs (__NR_Linux + 135)
848#define __NR_sysfs (__NR_Linux + 136)
849#define __NR_getpriority (__NR_Linux + 137)
850#define __NR_setpriority (__NR_Linux + 138)
851#define __NR_sched_setparam (__NR_Linux + 139)
852#define __NR_sched_getparam (__NR_Linux + 140)
853#define __NR_sched_setscheduler (__NR_Linux + 141)
854#define __NR_sched_getscheduler (__NR_Linux + 142)
855#define __NR_sched_get_priority_max (__NR_Linux + 143)
856#define __NR_sched_get_priority_min (__NR_Linux + 144)
857#define __NR_sched_rr_get_interval (__NR_Linux + 145)
858#define __NR_mlock (__NR_Linux + 146)
859#define __NR_munlock (__NR_Linux + 147)
860#define __NR_mlockall (__NR_Linux + 148)
861#define __NR_munlockall (__NR_Linux + 149)
862#define __NR_vhangup (__NR_Linux + 150)
863#define __NR_pivot_root (__NR_Linux + 151)
864#define __NR__sysctl (__NR_Linux + 152)
865#define __NR_prctl (__NR_Linux + 153)
866#define __NR_adjtimex (__NR_Linux + 154)
867#define __NR_setrlimit (__NR_Linux + 155)
868#define __NR_chroot (__NR_Linux + 156)
869#define __NR_sync (__NR_Linux + 157)
870#define __NR_acct (__NR_Linux + 158)
871#define __NR_settimeofday (__NR_Linux + 159)
872#define __NR_mount (__NR_Linux + 160)
873#define __NR_umount2 (__NR_Linux + 161)
874#define __NR_swapon (__NR_Linux + 162)
875#define __NR_swapoff (__NR_Linux + 163)
876#define __NR_reboot (__NR_Linux + 164)
877#define __NR_sethostname (__NR_Linux + 165)
878#define __NR_setdomainname (__NR_Linux + 166)
879#define __NR_create_module (__NR_Linux + 167)
880#define __NR_init_module (__NR_Linux + 168)
881#define __NR_delete_module (__NR_Linux + 169)
882#define __NR_get_kernel_syms (__NR_Linux + 170)
883#define __NR_query_module (__NR_Linux + 171)
884#define __NR_quotactl (__NR_Linux + 172)
885#define __NR_nfsservctl (__NR_Linux + 173)
886#define __NR_getpmsg (__NR_Linux + 174)
887#define __NR_putpmsg (__NR_Linux + 175)
888#define __NR_afs_syscall (__NR_Linux + 176)
889#define __NR_reserved177 (__NR_Linux + 177)
890#define __NR_gettid (__NR_Linux + 178)
891#define __NR_readahead (__NR_Linux + 179)
892#define __NR_setxattr (__NR_Linux + 180)
893#define __NR_lsetxattr (__NR_Linux + 181)
894#define __NR_fsetxattr (__NR_Linux + 182)
895#define __NR_getxattr (__NR_Linux + 183)
896#define __NR_lgetxattr (__NR_Linux + 184)
897#define __NR_fgetxattr (__NR_Linux + 185)
898#define __NR_listxattr (__NR_Linux + 186)
899#define __NR_llistxattr (__NR_Linux + 187)
900#define __NR_flistxattr (__NR_Linux + 188)
901#define __NR_removexattr (__NR_Linux + 189)
902#define __NR_lremovexattr (__NR_Linux + 190)
903#define __NR_fremovexattr (__NR_Linux + 191)
904#define __NR_tkill (__NR_Linux + 192)
905#define __NR_reserved193 (__NR_Linux + 193)
906#define __NR_futex (__NR_Linux + 194)
907#define __NR_sched_setaffinity (__NR_Linux + 195)
908#define __NR_sched_getaffinity (__NR_Linux + 196)
909#define __NR_cacheflush (__NR_Linux + 197)
910#define __NR_cachectl (__NR_Linux + 198)
911#define __NR_sysmips (__NR_Linux + 199)
912#define __NR_io_setup (__NR_Linux + 200)
913#define __NR_io_destroy (__NR_Linux + 201)
914#define __NR_io_getevents (__NR_Linux + 202)
915#define __NR_io_submit (__NR_Linux + 203)
916#define __NR_io_cancel (__NR_Linux + 204)
917#define __NR_exit_group (__NR_Linux + 205)
918#define __NR_lookup_dcookie (__NR_Linux + 206)
919#define __NR_epoll_create (__NR_Linux + 207)
920#define __NR_epoll_ctl (__NR_Linux + 208)
921#define __NR_epoll_wait (__NR_Linux + 209)
922#define __NR_remap_file_pages (__NR_Linux + 210)
923#define __NR_rt_sigreturn (__NR_Linux + 211)
924#define __NR_fcntl64 (__NR_Linux + 212)
925#define __NR_set_tid_address (__NR_Linux + 213)
926#define __NR_restart_syscall (__NR_Linux + 214)
927#define __NR_semtimedop (__NR_Linux + 215)
928#define __NR_fadvise64 (__NR_Linux + 216)
929#define __NR_statfs64 (__NR_Linux + 217)
930#define __NR_fstatfs64 (__NR_Linux + 218)
931#define __NR_sendfile64 (__NR_Linux + 219)
932#define __NR_timer_create (__NR_Linux + 220)
933#define __NR_timer_settime (__NR_Linux + 221)
934#define __NR_timer_gettime (__NR_Linux + 222)
935#define __NR_timer_getoverrun (__NR_Linux + 223)
936#define __NR_timer_delete (__NR_Linux + 224)
937#define __NR_clock_settime (__NR_Linux + 225)
938#define __NR_clock_gettime (__NR_Linux + 226)
939#define __NR_clock_getres (__NR_Linux + 227)
940#define __NR_clock_nanosleep (__NR_Linux + 228)
941#define __NR_tgkill (__NR_Linux + 229)
942#define __NR_utimes (__NR_Linux + 230)
943#define __NR_mbind (__NR_Linux + 231)
944#define __NR_get_mempolicy (__NR_Linux + 232)
945#define __NR_set_mempolicy (__NR_Linux + 233)
946#define __NR_mq_open (__NR_Linux + 234)
947#define __NR_mq_unlink (__NR_Linux + 235)
948#define __NR_mq_timedsend (__NR_Linux + 236)
949#define __NR_mq_timedreceive (__NR_Linux + 237)
950#define __NR_mq_notify (__NR_Linux + 238)
951#define __NR_mq_getsetattr (__NR_Linux + 239)
952#define __NR_vserver (__NR_Linux + 240)
953#define __NR_waitid (__NR_Linux + 241)
954/* #define __NR_sys_setaltroot (__NR_Linux + 242) */
955#define __NR_add_key (__NR_Linux + 243)
956#define __NR_request_key (__NR_Linux + 244)
957#define __NR_keyctl (__NR_Linux + 245)
958#define __NR_set_thread_area (__NR_Linux + 246)
959#define __NR_inotify_init (__NR_Linux + 247)
960#define __NR_inotify_add_watch (__NR_Linux + 248)
961#define __NR_inotify_rm_watch (__NR_Linux + 249)
962#define __NR_migrate_pages (__NR_Linux + 250)
963#define __NR_openat (__NR_Linux + 251)
964#define __NR_mkdirat (__NR_Linux + 252)
965#define __NR_mknodat (__NR_Linux + 253)
966#define __NR_fchownat (__NR_Linux + 254)
967#define __NR_futimesat (__NR_Linux + 255)
968#define __NR_newfstatat (__NR_Linux + 256)
969#define __NR_unlinkat (__NR_Linux + 257)
970#define __NR_renameat (__NR_Linux + 258)
971#define __NR_linkat (__NR_Linux + 259)
972#define __NR_symlinkat (__NR_Linux + 260)
973#define __NR_readlinkat (__NR_Linux + 261)
974#define __NR_fchmodat (__NR_Linux + 262)
975#define __NR_faccessat (__NR_Linux + 263)
976#define __NR_pselect6 (__NR_Linux + 264)
977#define __NR_ppoll (__NR_Linux + 265)
978#define __NR_unshare (__NR_Linux + 266)
979#define __NR_splice (__NR_Linux + 267)
980#define __NR_sync_file_range (__NR_Linux + 268)
981#define __NR_tee (__NR_Linux + 269)
982#define __NR_vmsplice (__NR_Linux + 270)
983#define __NR_move_pages (__NR_Linux + 271)
984#define __NR_set_robust_list (__NR_Linux + 272)
985#define __NR_get_robust_list (__NR_Linux + 273)
986#define __NR_kexec_load (__NR_Linux + 274)
987#define __NR_getcpu (__NR_Linux + 275)
988#define __NR_epoll_pwait (__NR_Linux + 276)
989#define __NR_ioprio_set (__NR_Linux + 277)
990#define __NR_ioprio_get (__NR_Linux + 278)
991#define __NR_utimensat (__NR_Linux + 279)
992#define __NR_signalfd (__NR_Linux + 280)
993#define __NR_timerfd (__NR_Linux + 281)
994#define __NR_eventfd (__NR_Linux + 282)
995#define __NR_fallocate (__NR_Linux + 283)
996#define __NR_timerfd_create (__NR_Linux + 284)
997#define __NR_timerfd_gettime (__NR_Linux + 285)
998#define __NR_timerfd_settime (__NR_Linux + 286)
999#define __NR_signalfd4 (__NR_Linux + 287)
1000#define __NR_eventfd2 (__NR_Linux + 288)
1001#define __NR_epoll_create1 (__NR_Linux + 289)
1002#define __NR_dup3 (__NR_Linux + 290)
1003#define __NR_pipe2 (__NR_Linux + 291)
1004#define __NR_inotify_init1 (__NR_Linux + 292)
1005#define __NR_preadv (__NR_Linux + 293)
1006#define __NR_pwritev (__NR_Linux + 294)
1007#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
1008#define __NR_perf_event_open (__NR_Linux + 296)
1009#define __NR_accept4 (__NR_Linux + 297)
1010#define __NR_recvmmsg (__NR_Linux + 298)
1011#define __NR_getdents64 (__NR_Linux + 299)
1012#define __NR_fanotify_init (__NR_Linux + 300)
1013#define __NR_fanotify_mark (__NR_Linux + 301)
1014#define __NR_prlimit64 (__NR_Linux + 302)
1015#define __NR_name_to_handle_at (__NR_Linux + 303)
1016#define __NR_open_by_handle_at (__NR_Linux + 304)
1017#define __NR_clock_adjtime (__NR_Linux + 305)
1018#define __NR_syncfs (__NR_Linux + 306)
1019#define __NR_sendmmsg (__NR_Linux + 307)
1020#define __NR_setns (__NR_Linux + 308)
1021#define __NR_process_vm_readv (__NR_Linux + 309)
1022#define __NR_process_vm_writev (__NR_Linux + 310)
1023#define __NR_kcmp (__NR_Linux + 311)
1024
1025/*
1026 * Offset of the last N32 flavoured syscall
1027 */
1028#define __NR_Linux_syscalls 311
1029
1030#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
1031
1032#define __NR_N32_Linux 6000
1033#define __NR_N32_Linux_syscalls 311
1034
1035#endif /* _UAPI_ASM_UNISTD_H */
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index d6c2a7476bac..8b28bc4e14ea 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -31,6 +31,7 @@ obj-$(CONFIG_SYNC_R4K) += sync-r4k.o
31 31
32obj-$(CONFIG_STACKTRACE) += stacktrace.o 32obj-$(CONFIG_STACKTRACE) += stacktrace.o
33obj-$(CONFIG_MODULES) += mips_ksyms.o module.o 33obj-$(CONFIG_MODULES) += mips_ksyms.o module.o
34obj-$(CONFIG_MODULES_USE_ELF_RELA) += module-rela.o
34 35
35obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o 36obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o
36 37
@@ -53,7 +54,6 @@ obj-$(CONFIG_CPU_MIPSR2) += spram.o
53 54
54obj-$(CONFIG_MIPS_VPE_LOADER) += vpe.o 55obj-$(CONFIG_MIPS_VPE_LOADER) += vpe.o
55obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o 56obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o
56obj-$(CONFIG_MIPS_APSP_KSPD) += kspd.o
57 57
58obj-$(CONFIG_I8259) += i8259.o 58obj-$(CONFIG_I8259) += i8259.o
59obj-$(CONFIG_IRQ_CPU) += irq_cpu.o 59obj-$(CONFIG_IRQ_CPU) += irq_cpu.o
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index 6b30fb2caa67..0c4bce4882a6 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -12,7 +12,6 @@
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/interrupt.h>
16#include <linux/kbuild.h> 15#include <linux/kbuild.h>
17#include <linux/suspend.h> 16#include <linux/suspend.h>
18#include <asm/ptrace.h> 17#include <asm/ptrace.h>
@@ -292,15 +291,6 @@ void output_signal_defined(void)
292 BLANK(); 291 BLANK();
293} 292}
294 293
295void output_irq_cpustat_t_defines(void)
296{
297 COMMENT("Linux irq_cpustat_t offsets.");
298 DEFINE(IC_SOFTIRQ_PENDING,
299 offsetof(irq_cpustat_t, __softirq_pending));
300 DEFINE(IC_IRQ_CPUSTAT_T, sizeof(irq_cpustat_t));
301 BLANK();
302}
303
304#ifdef CONFIG_CPU_CAVIUM_OCTEON 294#ifdef CONFIG_CPU_CAVIUM_OCTEON
305void output_octeon_cop2_state_defines(void) 295void output_octeon_cop2_state_defines(void)
306{ 296{
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index bc58bd10a607..b1fb7af3c350 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -142,7 +142,7 @@ int __cpuinitdata mips_dsp_disabled;
142 142
143static int __init dsp_disable(char *s) 143static int __init dsp_disable(char *s)
144{ 144{
145 cpu_data[0].ases &= ~MIPS_ASE_DSP; 145 cpu_data[0].ases &= ~(MIPS_ASE_DSP | MIPS_ASE_DSP2P);
146 mips_dsp_disabled = 1; 146 mips_dsp_disabled = 1;
147 147
148 return 1; 148 return 1;
@@ -429,6 +429,8 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c)
429 c->options |= MIPS_CPU_RIXI; 429 c->options |= MIPS_CPU_RIXI;
430 if (config3 & MIPS_CONF3_DSP) 430 if (config3 & MIPS_CONF3_DSP)
431 c->ases |= MIPS_ASE_DSP; 431 c->ases |= MIPS_ASE_DSP;
432 if (config3 & MIPS_CONF3_DSP2P)
433 c->ases |= MIPS_ASE_DSP2P;
432 if (config3 & MIPS_CONF3_VINT) 434 if (config3 & MIPS_CONF3_VINT)
433 c->options |= MIPS_CPU_VINT; 435 c->options |= MIPS_CPU_VINT;
434 if (config3 & MIPS_CONF3_VEIC) 436 if (config3 & MIPS_CONF3_VEIC)
@@ -1180,7 +1182,7 @@ __cpuinit void cpu_probe(void)
1180 c->options &= ~MIPS_CPU_FPU; 1182 c->options &= ~MIPS_CPU_FPU;
1181 1183
1182 if (mips_dsp_disabled) 1184 if (mips_dsp_disabled)
1183 c->ases &= ~MIPS_ASE_DSP; 1185 c->ases &= ~(MIPS_ASE_DSP | MIPS_ASE_DSP2P);
1184 1186
1185 if (c->options & MIPS_CPU_FPU) { 1187 if (c->options & MIPS_CPU_FPU) {
1186 c->fpu_id = cpu_get_fpu_id(); 1188 c->fpu_id = cpu_get_fpu_id();
@@ -1194,8 +1196,11 @@ __cpuinit void cpu_probe(void)
1194 } 1196 }
1195 } 1197 }
1196 1198
1197 if (cpu_has_mips_r2) 1199 if (cpu_has_mips_r2) {
1198 c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1; 1200 c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1;
1201 /* R2 has Performance Counter Interrupt indicator */
1202 c->options |= MIPS_CPU_PCI;
1203 }
1199 else 1204 else
1200 c->srsets = 1; 1205 c->srsets = 1;
1201 1206
diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c
deleted file mode 100644
index b77f56bbb477..000000000000
--- a/arch/mips/kernel/kspd.c
+++ /dev/null
@@ -1,423 +0,0 @@
1/*
2 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3 *
4 * This program is free software; you can distribute it and/or modify it
5 * under the terms of the GNU General Public License (Version 2) as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 *
17 */
18#include <linux/kernel.h>
19#include <linux/module.h>
20#include <linux/sched.h>
21#include <linux/unistd.h>
22#include <linux/file.h>
23#include <linux/fdtable.h>
24#include <linux/fs.h>
25#include <linux/syscalls.h>
26#include <linux/workqueue.h>
27#include <linux/errno.h>
28#include <linux/list.h>
29
30#include <asm/vpe.h>
31#include <asm/rtlx.h>
32#include <asm/kspd.h>
33
34static struct workqueue_struct *workqueue;
35static struct work_struct work;
36
37extern unsigned long cpu_khz;
38
39struct mtsp_syscall {
40 int cmd;
41 unsigned char abi;
42 unsigned char size;
43};
44
45struct mtsp_syscall_ret {
46 int retval;
47 int errno;
48};
49
50struct mtsp_syscall_generic {
51 int arg0;
52 int arg1;
53 int arg2;
54 int arg3;
55 int arg4;
56 int arg5;
57 int arg6;
58};
59
60static struct list_head kspd_notifylist;
61static int sp_stopping;
62
63/* these should match with those in the SDE kit */
64#define MTSP_SYSCALL_BASE 0
65#define MTSP_SYSCALL_EXIT (MTSP_SYSCALL_BASE + 0)
66#define MTSP_SYSCALL_OPEN (MTSP_SYSCALL_BASE + 1)
67#define MTSP_SYSCALL_READ (MTSP_SYSCALL_BASE + 2)
68#define MTSP_SYSCALL_WRITE (MTSP_SYSCALL_BASE + 3)
69#define MTSP_SYSCALL_CLOSE (MTSP_SYSCALL_BASE + 4)
70#define MTSP_SYSCALL_LSEEK32 (MTSP_SYSCALL_BASE + 5)
71#define MTSP_SYSCALL_ISATTY (MTSP_SYSCALL_BASE + 6)
72#define MTSP_SYSCALL_GETTIME (MTSP_SYSCALL_BASE + 7)
73#define MTSP_SYSCALL_PIPEFREQ (MTSP_SYSCALL_BASE + 8)
74#define MTSP_SYSCALL_GETTOD (MTSP_SYSCALL_BASE + 9)
75#define MTSP_SYSCALL_IOCTL (MTSP_SYSCALL_BASE + 10)
76
77#define MTSP_O_RDONLY 0x0000
78#define MTSP_O_WRONLY 0x0001
79#define MTSP_O_RDWR 0x0002
80#define MTSP_O_NONBLOCK 0x0004
81#define MTSP_O_APPEND 0x0008
82#define MTSP_O_SHLOCK 0x0010
83#define MTSP_O_EXLOCK 0x0020
84#define MTSP_O_ASYNC 0x0040
85/* XXX: check which of these is actually O_SYNC vs O_DSYNC */
86#define MTSP_O_FSYNC O_SYNC
87#define MTSP_O_NOFOLLOW 0x0100
88#define MTSP_O_SYNC 0x0080
89#define MTSP_O_CREAT 0x0200
90#define MTSP_O_TRUNC 0x0400
91#define MTSP_O_EXCL 0x0800
92#define MTSP_O_BINARY 0x8000
93
94extern int tclimit;
95
96struct apsp_table {
97 int sp;
98 int ap;
99};
100
101/* we might want to do the mode flags too */
102struct apsp_table open_flags_table[] = {
103 { MTSP_O_RDWR, O_RDWR },
104 { MTSP_O_WRONLY, O_WRONLY },
105 { MTSP_O_CREAT, O_CREAT },
106 { MTSP_O_TRUNC, O_TRUNC },
107 { MTSP_O_NONBLOCK, O_NONBLOCK },
108 { MTSP_O_APPEND, O_APPEND },
109 { MTSP_O_NOFOLLOW, O_NOFOLLOW }
110};
111
112struct apsp_table syscall_command_table[] = {
113 { MTSP_SYSCALL_OPEN, __NR_open },
114 { MTSP_SYSCALL_CLOSE, __NR_close },
115 { MTSP_SYSCALL_READ, __NR_read },
116 { MTSP_SYSCALL_WRITE, __NR_write },
117 { MTSP_SYSCALL_LSEEK32, __NR_lseek },
118 { MTSP_SYSCALL_IOCTL, __NR_ioctl }
119};
120
121static int sp_syscall(int num, int arg0, int arg1, int arg2, int arg3)
122{
123 register long int _num __asm__("$2") = num;
124 register long int _arg0 __asm__("$4") = arg0;
125 register long int _arg1 __asm__("$5") = arg1;
126 register long int _arg2 __asm__("$6") = arg2;
127 register long int _arg3 __asm__("$7") = arg3;
128
129 mm_segment_t old_fs;
130
131 old_fs = get_fs();
132 set_fs(KERNEL_DS);
133
134 __asm__ __volatile__ (
135 " syscall \n"
136 : "=r" (_num), "=r" (_arg3)
137 : "r" (_num), "r" (_arg0), "r" (_arg1), "r" (_arg2), "r" (_arg3));
138
139 set_fs(old_fs);
140
141 /* $a3 is error flag */
142 if (_arg3)
143 return -_num;
144
145 return _num;
146}
147
148static int translate_syscall_command(int cmd)
149{
150 int i;
151 int ret = -1;
152
153 for (i = 0; i < ARRAY_SIZE(syscall_command_table); i++) {
154 if ((cmd == syscall_command_table[i].sp))
155 return syscall_command_table[i].ap;
156 }
157
158 return ret;
159}
160
161static unsigned int translate_open_flags(int flags)
162{
163 int i;
164 unsigned int ret = 0;
165
166 for (i = 0; i < ARRAY_SIZE(open_flags_table); i++) {
167 if( (flags & open_flags_table[i].sp) ) {
168 ret |= open_flags_table[i].ap;
169 }
170 }
171
172 return ret;
173}
174
175
176static int sp_setfsuidgid(uid_t uid, gid_t gid)
177{
178 struct cred *new;
179
180 new = prepare_creds();
181 if (!new)
182 return -ENOMEM;
183
184 new->fsuid = uid;
185 new->fsgid = gid;
186
187 commit_creds(new);
188
189 return 0;
190}
191
192/*
193 * Expects a request to be on the sysio channel. Reads it. Decides whether
194 * its a linux syscall and runs it, or whatever. Puts the return code back
195 * into the request and sends the whole thing back.
196 */
197void sp_work_handle_request(void)
198{
199 struct mtsp_syscall sc;
200 struct mtsp_syscall_generic generic;
201 struct mtsp_syscall_ret ret;
202 struct kspd_notifications *n;
203 unsigned long written;
204 mm_segment_t old_fs;
205 struct timeval tv;
206 struct timezone tz;
207 int err, cmd;
208
209 char *vcwd;
210 int size;
211
212 ret.retval = -1;
213
214 old_fs = get_fs();
215 set_fs(KERNEL_DS);
216
217 if (!rtlx_read(RTLX_CHANNEL_SYSIO, &sc, sizeof(struct mtsp_syscall))) {
218 set_fs(old_fs);
219 printk(KERN_ERR "Expected request but nothing to read\n");
220 return;
221 }
222
223 size = sc.size;
224
225 if (size) {
226 if (!rtlx_read(RTLX_CHANNEL_SYSIO, &generic, size)) {
227 set_fs(old_fs);
228 printk(KERN_ERR "Expected request but nothing to read\n");
229 return;
230 }
231 }
232
233 /* Run the syscall at the privilege of the user who loaded the
234 SP program */
235
236 if (vpe_getuid(tclimit)) {
237 err = sp_setfsuidgid(vpe_getuid(tclimit), vpe_getgid(tclimit));
238 if (!err)
239 pr_err("Change of creds failed\n");
240 }
241
242 switch (sc.cmd) {
243 /* needs the flags argument translating from SDE kit to
244 linux */
245 case MTSP_SYSCALL_PIPEFREQ:
246 ret.retval = cpu_khz * 1000;
247 ret.errno = 0;
248 break;
249
250 case MTSP_SYSCALL_GETTOD:
251 memset(&tz, 0, sizeof(tz));
252 if ((ret.retval = sp_syscall(__NR_gettimeofday, (int)&tv,
253 (int)&tz, 0, 0)) == 0)
254 ret.retval = tv.tv_sec;
255 break;
256
257 case MTSP_SYSCALL_EXIT:
258 list_for_each_entry(n, &kspd_notifylist, list)
259 n->kspd_sp_exit(tclimit);
260 sp_stopping = 1;
261
262 printk(KERN_DEBUG "KSPD got exit syscall from SP exitcode %d\n",
263 generic.arg0);
264 break;
265
266 case MTSP_SYSCALL_OPEN:
267 generic.arg1 = translate_open_flags(generic.arg1);
268
269 vcwd = vpe_getcwd(tclimit);
270
271 /* change to cwd of the process that loaded the SP program */
272 old_fs = get_fs();
273 set_fs(KERNEL_DS);
274 sys_chdir(vcwd);
275 set_fs(old_fs);
276
277 sc.cmd = __NR_open;
278
279 /* fall through */
280
281 default:
282 if ((sc.cmd >= __NR_Linux) &&
283 (sc.cmd <= (__NR_Linux + __NR_Linux_syscalls)) )
284 cmd = sc.cmd;
285 else
286 cmd = translate_syscall_command(sc.cmd);
287
288 if (cmd >= 0) {
289 ret.retval = sp_syscall(cmd, generic.arg0, generic.arg1,
290 generic.arg2, generic.arg3);
291 } else
292 printk(KERN_WARNING
293 "KSPD: Unknown SP syscall number %d\n", sc.cmd);
294 break;
295 } /* switch */
296
297 if (vpe_getuid(tclimit)) {
298 err = sp_setfsuidgid(0, 0);
299 if (!err)
300 pr_err("restoring old creds failed\n");
301 }
302
303 old_fs = get_fs();
304 set_fs(KERNEL_DS);
305 written = rtlx_write(RTLX_CHANNEL_SYSIO, &ret, sizeof(ret));
306 set_fs(old_fs);
307 if (written < sizeof(ret))
308 printk("KSPD: sp_work_handle_request failed to send to SP\n");
309}
310
311static void sp_cleanup(void)
312{
313 struct files_struct *files = current->files;
314 int i, j;
315 struct fdtable *fdt;
316
317 j = 0;
318
319 /*
320 * It is safe to dereference the fd table without RCU or
321 * ->file_lock
322 */
323 fdt = files_fdtable(files);
324 for (;;) {
325 unsigned long set;
326 i = j * BITS_PER_LONG;
327 if (i >= fdt->max_fds)
328 break;
329 set = fdt->open_fds[j++];
330 while (set) {
331 if (set & 1) {
332 struct file * file = xchg(&fdt->fd[i], NULL);
333 if (file)
334 filp_close(file, files);
335 }
336 i++;
337 set >>= 1;
338 }
339 }
340
341 /* Put daemon cwd back to root to avoid umount problems */
342 sys_chdir("/");
343}
344
345static int channel_open;
346
347/* the work handler */
348static void sp_work(struct work_struct *unused)
349{
350 if (!channel_open) {
351 if( rtlx_open(RTLX_CHANNEL_SYSIO, 1) != 0) {
352 printk("KSPD: unable to open sp channel\n");
353 sp_stopping = 1;
354 } else {
355 channel_open++;
356 printk(KERN_DEBUG "KSPD: SP channel opened\n");
357 }
358 } else {
359 /* wait for some data, allow it to sleep */
360 rtlx_read_poll(RTLX_CHANNEL_SYSIO, 1);
361
362 /* Check we haven't been woken because we are stopping */
363 if (!sp_stopping)
364 sp_work_handle_request();
365 }
366
367 if (!sp_stopping)
368 queue_work(workqueue, &work);
369 else
370 sp_cleanup();
371}
372
373static void startwork(int vpe)
374{
375 sp_stopping = channel_open = 0;
376
377 if (workqueue == NULL) {
378 if ((workqueue = create_singlethread_workqueue("kspd")) == NULL) {
379 printk(KERN_ERR "unable to start kspd\n");
380 return;
381 }
382
383 INIT_WORK(&work, sp_work);
384 }
385
386 queue_work(workqueue, &work);
387}
388
389static void stopwork(int vpe)
390{
391 sp_stopping = 1;
392
393 printk(KERN_DEBUG "KSPD: SP stopping\n");
394}
395
396void kspd_notify(struct kspd_notifications *notify)
397{
398 list_add(&notify->list, &kspd_notifylist);
399}
400
401static struct vpe_notifications notify;
402static int kspd_module_init(void)
403{
404 INIT_LIST_HEAD(&kspd_notifylist);
405
406 notify.start = startwork;
407 notify.stop = stopwork;
408 vpe_notify(tclimit, &notify);
409
410 return 0;
411}
412
413static void kspd_module_exit(void)
414{
415
416}
417
418module_init(kspd_module_init);
419module_exit(kspd_module_exit);
420
421MODULE_DESCRIPTION("MIPS KSPD");
422MODULE_AUTHOR("Elizabeth Oldham, MIPS Technologies, Inc.");
423MODULE_LICENSE("GPL");
diff --git a/arch/mips/kernel/module-rela.c b/arch/mips/kernel/module-rela.c
new file mode 100644
index 000000000000..61d60028b888
--- /dev/null
+++ b/arch/mips/kernel/module-rela.c
@@ -0,0 +1,145 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 *
16 * Copyright (C) 2001 Rusty Russell.
17 * Copyright (C) 2003, 2004 Ralf Baechle (ralf@linux-mips.org)
18 * Copyright (C) 2005 Thiemo Seufer
19 */
20
21#include <linux/elf.h>
22#include <linux/err.h>
23#include <linux/errno.h>
24#include <linux/moduleloader.h>
25
26extern int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v);
27
28static int apply_r_mips_32_rela(struct module *me, u32 *location, Elf_Addr v)
29{
30 *location = v;
31
32 return 0;
33}
34
35static int apply_r_mips_26_rela(struct module *me, u32 *location, Elf_Addr v)
36{
37 if (v % 4) {
38 pr_err("module %s: dangerous R_MIPS_26 RELArelocation\n",
39 me->name);
40 return -ENOEXEC;
41 }
42
43 if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
44 printk(KERN_ERR
45 "module %s: relocation overflow\n",
46 me->name);
47 return -ENOEXEC;
48 }
49
50 *location = (*location & ~0x03ffffff) | ((v >> 2) & 0x03ffffff);
51
52 return 0;
53}
54
55static int apply_r_mips_hi16_rela(struct module *me, u32 *location, Elf_Addr v)
56{
57 *location = (*location & 0xffff0000) |
58 ((((long long) v + 0x8000LL) >> 16) & 0xffff);
59
60 return 0;
61}
62
63static int apply_r_mips_lo16_rela(struct module *me, u32 *location, Elf_Addr v)
64{
65 *location = (*location & 0xffff0000) | (v & 0xffff);
66
67 return 0;
68}
69
70static int apply_r_mips_64_rela(struct module *me, u32 *location, Elf_Addr v)
71{
72 *(Elf_Addr *)location = v;
73
74 return 0;
75}
76
77static int apply_r_mips_higher_rela(struct module *me, u32 *location,
78 Elf_Addr v)
79{
80 *location = (*location & 0xffff0000) |
81 ((((long long) v + 0x80008000LL) >> 32) & 0xffff);
82
83 return 0;
84}
85
86static int apply_r_mips_highest_rela(struct module *me, u32 *location,
87 Elf_Addr v)
88{
89 *location = (*location & 0xffff0000) |
90 ((((long long) v + 0x800080008000LL) >> 48) & 0xffff);
91
92 return 0;
93}
94
95static int (*reloc_handlers_rela[]) (struct module *me, u32 *location,
96 Elf_Addr v) = {
97 [R_MIPS_NONE] = apply_r_mips_none,
98 [R_MIPS_32] = apply_r_mips_32_rela,
99 [R_MIPS_26] = apply_r_mips_26_rela,
100 [R_MIPS_HI16] = apply_r_mips_hi16_rela,
101 [R_MIPS_LO16] = apply_r_mips_lo16_rela,
102 [R_MIPS_64] = apply_r_mips_64_rela,
103 [R_MIPS_HIGHER] = apply_r_mips_higher_rela,
104 [R_MIPS_HIGHEST] = apply_r_mips_highest_rela
105};
106
107int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
108 unsigned int symindex, unsigned int relsec,
109 struct module *me)
110{
111 Elf_Mips_Rela *rel = (void *) sechdrs[relsec].sh_addr;
112 Elf_Sym *sym;
113 u32 *location;
114 unsigned int i;
115 Elf_Addr v;
116 int res;
117
118 pr_debug("Applying relocate section %u to %u\n", relsec,
119 sechdrs[relsec].sh_info);
120
121 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
122 /* This is where to make the change */
123 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
124 + rel[i].r_offset;
125 /* This is the symbol it is referring to */
126 sym = (Elf_Sym *)sechdrs[symindex].sh_addr
127 + ELF_MIPS_R_SYM(rel[i]);
128 if (IS_ERR_VALUE(sym->st_value)) {
129 /* Ignore unresolved weak symbol */
130 if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
131 continue;
132 printk(KERN_WARNING "%s: Unknown symbol %s\n",
133 me->name, strtab + sym->st_name);
134 return -ENOENT;
135 }
136
137 v = sym->st_value + rel[i].r_addend;
138
139 res = reloc_handlers_rela[ELF_MIPS_R_TYPE(rel[i])](me, location, v);
140 if (res)
141 return res;
142 }
143
144 return 0;
145}
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c
index 4f8c3cba8c0c..07ff5812ffaf 100644
--- a/arch/mips/kernel/module.c
+++ b/arch/mips/kernel/module.c
@@ -51,7 +51,7 @@ void *module_alloc(unsigned long size)
51} 51}
52#endif 52#endif
53 53
54static int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v) 54int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v)
55{ 55{
56 return 0; 56 return 0;
57} 57}
@@ -63,13 +63,6 @@ static int apply_r_mips_32_rel(struct module *me, u32 *location, Elf_Addr v)
63 return 0; 63 return 0;
64} 64}
65 65
66static int apply_r_mips_32_rela(struct module *me, u32 *location, Elf_Addr v)
67{
68 *location = v;
69
70 return 0;
71}
72
73static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v) 66static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v)
74{ 67{
75 if (v % 4) { 68 if (v % 4) {
@@ -91,26 +84,6 @@ static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v)
91 return 0; 84 return 0;
92} 85}
93 86
94static int apply_r_mips_26_rela(struct module *me, u32 *location, Elf_Addr v)
95{
96 if (v % 4) {
97 pr_err("module %s: dangerous R_MIPS_26 RELArelocation\n",
98 me->name);
99 return -ENOEXEC;
100 }
101
102 if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
103 printk(KERN_ERR
104 "module %s: relocation overflow\n",
105 me->name);
106 return -ENOEXEC;
107 }
108
109 *location = (*location & ~0x03ffffff) | ((v >> 2) & 0x03ffffff);
110
111 return 0;
112}
113
114static int apply_r_mips_hi16_rel(struct module *me, u32 *location, Elf_Addr v) 87static int apply_r_mips_hi16_rel(struct module *me, u32 *location, Elf_Addr v)
115{ 88{
116 struct mips_hi16 *n; 89 struct mips_hi16 *n;
@@ -132,14 +105,6 @@ static int apply_r_mips_hi16_rel(struct module *me, u32 *location, Elf_Addr v)
132 return 0; 105 return 0;
133} 106}
134 107
135static int apply_r_mips_hi16_rela(struct module *me, u32 *location, Elf_Addr v)
136{
137 *location = (*location & 0xffff0000) |
138 ((((long long) v + 0x8000LL) >> 16) & 0xffff);
139
140 return 0;
141}
142
143static void free_relocation_chain(struct mips_hi16 *l) 108static void free_relocation_chain(struct mips_hi16 *l)
144{ 109{
145 struct mips_hi16 *next; 110 struct mips_hi16 *next;
@@ -217,38 +182,6 @@ out_danger:
217 return -ENOEXEC; 182 return -ENOEXEC;
218} 183}
219 184
220static int apply_r_mips_lo16_rela(struct module *me, u32 *location, Elf_Addr v)
221{
222 *location = (*location & 0xffff0000) | (v & 0xffff);
223
224 return 0;
225}
226
227static int apply_r_mips_64_rela(struct module *me, u32 *location, Elf_Addr v)
228{
229 *(Elf_Addr *)location = v;
230
231 return 0;
232}
233
234static int apply_r_mips_higher_rela(struct module *me, u32 *location,
235 Elf_Addr v)
236{
237 *location = (*location & 0xffff0000) |
238 ((((long long) v + 0x80008000LL) >> 32) & 0xffff);
239
240 return 0;
241}
242
243static int apply_r_mips_highest_rela(struct module *me, u32 *location,
244 Elf_Addr v)
245{
246 *location = (*location & 0xffff0000) |
247 ((((long long) v + 0x800080008000LL) >> 48) & 0xffff);
248
249 return 0;
250}
251
252static int (*reloc_handlers_rel[]) (struct module *me, u32 *location, 185static int (*reloc_handlers_rel[]) (struct module *me, u32 *location,
253 Elf_Addr v) = { 186 Elf_Addr v) = {
254 [R_MIPS_NONE] = apply_r_mips_none, 187 [R_MIPS_NONE] = apply_r_mips_none,
@@ -258,18 +191,6 @@ static int (*reloc_handlers_rel[]) (struct module *me, u32 *location,
258 [R_MIPS_LO16] = apply_r_mips_lo16_rel 191 [R_MIPS_LO16] = apply_r_mips_lo16_rel
259}; 192};
260 193
261static int (*reloc_handlers_rela[]) (struct module *me, u32 *location,
262 Elf_Addr v) = {
263 [R_MIPS_NONE] = apply_r_mips_none,
264 [R_MIPS_32] = apply_r_mips_32_rela,
265 [R_MIPS_26] = apply_r_mips_26_rela,
266 [R_MIPS_HI16] = apply_r_mips_hi16_rela,
267 [R_MIPS_LO16] = apply_r_mips_lo16_rela,
268 [R_MIPS_64] = apply_r_mips_64_rela,
269 [R_MIPS_HIGHER] = apply_r_mips_higher_rela,
270 [R_MIPS_HIGHEST] = apply_r_mips_highest_rela
271};
272
273int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, 194int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
274 unsigned int symindex, unsigned int relsec, 195 unsigned int symindex, unsigned int relsec,
275 struct module *me) 196 struct module *me)
@@ -324,46 +245,6 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
324 return 0; 245 return 0;
325} 246}
326 247
327int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
328 unsigned int symindex, unsigned int relsec,
329 struct module *me)
330{
331 Elf_Mips_Rela *rel = (void *) sechdrs[relsec].sh_addr;
332 Elf_Sym *sym;
333 u32 *location;
334 unsigned int i;
335 Elf_Addr v;
336 int res;
337
338 pr_debug("Applying relocate section %u to %u\n", relsec,
339 sechdrs[relsec].sh_info);
340
341 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
342 /* This is where to make the change */
343 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
344 + rel[i].r_offset;
345 /* This is the symbol it is referring to */
346 sym = (Elf_Sym *)sechdrs[symindex].sh_addr
347 + ELF_MIPS_R_SYM(rel[i]);
348 if (IS_ERR_VALUE(sym->st_value)) {
349 /* Ignore unresolved weak symbol */
350 if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
351 continue;
352 printk(KERN_WARNING "%s: Unknown symbol %s\n",
353 me->name, strtab + sym->st_name);
354 return -ENOENT;
355 }
356
357 v = sym->st_value + rel[i].r_addend;
358
359 res = reloc_handlers_rela[ELF_MIPS_R_TYPE(rel[i])](me, location, v);
360 if (res)
361 return res;
362 }
363
364 return 0;
365}
366
367/* Given an address, look for it in the module exception tables. */ 248/* Given an address, look for it in the module exception tables. */
368const struct exception_table_entry *search_module_dbetables(unsigned long addr) 249const struct exception_table_entry *search_module_dbetables(unsigned long addr)
369{ 250{
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
index 2f28d3b55687..a9b995dcf691 100644
--- a/arch/mips/kernel/perf_event_mipsxx.c
+++ b/arch/mips/kernel/perf_event_mipsxx.c
@@ -28,6 +28,8 @@
28#include <asm/time.h> /* For perf_irq */ 28#include <asm/time.h> /* For perf_irq */
29 29
30#define MIPS_MAX_HWEVENTS 4 30#define MIPS_MAX_HWEVENTS 4
31#define MIPS_TCS_PER_COUNTER 2
32#define MIPS_CPUID_TO_COUNTER_MASK (MIPS_TCS_PER_COUNTER - 1)
31 33
32struct cpu_hw_events { 34struct cpu_hw_events {
33 /* Array of events on this cpu. */ 35 /* Array of events on this cpu. */
@@ -78,7 +80,6 @@ struct mips_perf_event {
78static struct mips_perf_event raw_event; 80static struct mips_perf_event raw_event;
79static DEFINE_MUTEX(raw_event_mutex); 81static DEFINE_MUTEX(raw_event_mutex);
80 82
81#define UNSUPPORTED_PERF_EVENT_ID 0xffffffff
82#define C(x) PERF_COUNT_HW_CACHE_##x 83#define C(x) PERF_COUNT_HW_CACHE_##x
83 84
84struct mips_pmu { 85struct mips_pmu {
@@ -109,13 +110,20 @@ static struct mips_pmu mipspmu;
109#define M_PERFCTL_INTERRUPT_ENABLE (1 << 4) 110#define M_PERFCTL_INTERRUPT_ENABLE (1 << 4)
110#define M_PERFCTL_EVENT(event) (((event) & 0x3ff) << 5) 111#define M_PERFCTL_EVENT(event) (((event) & 0x3ff) << 5)
111#define M_PERFCTL_VPEID(vpe) ((vpe) << 16) 112#define M_PERFCTL_VPEID(vpe) ((vpe) << 16)
113
114#ifdef CONFIG_CPU_BMIPS5000
115#define M_PERFCTL_MT_EN(filter) 0
116#else /* !CONFIG_CPU_BMIPS5000 */
112#define M_PERFCTL_MT_EN(filter) ((filter) << 20) 117#define M_PERFCTL_MT_EN(filter) ((filter) << 20)
118#endif /* CONFIG_CPU_BMIPS5000 */
119
113#define M_TC_EN_ALL M_PERFCTL_MT_EN(0) 120#define M_TC_EN_ALL M_PERFCTL_MT_EN(0)
114#define M_TC_EN_VPE M_PERFCTL_MT_EN(1) 121#define M_TC_EN_VPE M_PERFCTL_MT_EN(1)
115#define M_TC_EN_TC M_PERFCTL_MT_EN(2) 122#define M_TC_EN_TC M_PERFCTL_MT_EN(2)
116#define M_PERFCTL_TCID(tcid) ((tcid) << 22) 123#define M_PERFCTL_TCID(tcid) ((tcid) << 22)
117#define M_PERFCTL_WIDE (1 << 30) 124#define M_PERFCTL_WIDE (1 << 30)
118#define M_PERFCTL_MORE (1 << 31) 125#define M_PERFCTL_MORE (1 << 31)
126#define M_PERFCTL_TC (1 << 30)
119 127
120#define M_PERFCTL_COUNT_EVENT_WHENEVER (M_PERFCTL_EXL | \ 128#define M_PERFCTL_COUNT_EVENT_WHENEVER (M_PERFCTL_EXL | \
121 M_PERFCTL_KERNEL | \ 129 M_PERFCTL_KERNEL | \
@@ -131,21 +139,21 @@ static struct mips_pmu mipspmu;
131#define M_PERFCTL_EVENT_MASK 0xfe0 139#define M_PERFCTL_EVENT_MASK 0xfe0
132 140
133 141
134#ifdef CONFIG_MIPS_MT_SMP 142#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
135static int cpu_has_mipsmt_pertccounters; 143static int cpu_has_mipsmt_pertccounters;
136 144
137static DEFINE_RWLOCK(pmuint_rwlock); 145static DEFINE_RWLOCK(pmuint_rwlock);
138 146
147#if defined(CONFIG_CPU_BMIPS5000)
148#define vpe_id() (cpu_has_mipsmt_pertccounters ? \
149 0 : (smp_processor_id() & MIPS_CPUID_TO_COUNTER_MASK))
150#else
139/* 151/*
140 * FIXME: For VSMP, vpe_id() is redefined for Perf-events, because 152 * FIXME: For VSMP, vpe_id() is redefined for Perf-events, because
141 * cpu_data[cpuid].vpe_id reports 0 for _both_ CPUs. 153 * cpu_data[cpuid].vpe_id reports 0 for _both_ CPUs.
142 */ 154 */
143#if defined(CONFIG_HW_PERF_EVENTS)
144#define vpe_id() (cpu_has_mipsmt_pertccounters ? \
145 0 : smp_processor_id())
146#else
147#define vpe_id() (cpu_has_mipsmt_pertccounters ? \ 155#define vpe_id() (cpu_has_mipsmt_pertccounters ? \
148 0 : cpu_data[smp_processor_id()].vpe_id) 156 0 : smp_processor_id())
149#endif 157#endif
150 158
151/* Copied from op_model_mipsxx.c */ 159/* Copied from op_model_mipsxx.c */
@@ -162,10 +170,10 @@ static unsigned int counters_total_to_per_cpu(unsigned int counters)
162 return counters >> vpe_shift(); 170 return counters >> vpe_shift();
163} 171}
164 172
165#else /* !CONFIG_MIPS_MT_SMP */ 173#else /* !CONFIG_MIPS_PERF_SHARED_TC_COUNTERS */
166#define vpe_id() 0 174#define vpe_id() 0
167 175
168#endif /* CONFIG_MIPS_MT_SMP */ 176#endif /* CONFIG_MIPS_PERF_SHARED_TC_COUNTERS */
169 177
170static void resume_local_counters(void); 178static void resume_local_counters(void);
171static void pause_local_counters(void); 179static void pause_local_counters(void);
@@ -340,6 +348,11 @@ static void mipsxx_pmu_enable_event(struct hw_perf_event *evt, int idx)
340 (evt->config_base & M_PERFCTL_CONFIG_MASK) | 348 (evt->config_base & M_PERFCTL_CONFIG_MASK) |
341 /* Make sure interrupt enabled. */ 349 /* Make sure interrupt enabled. */
342 M_PERFCTL_INTERRUPT_ENABLE; 350 M_PERFCTL_INTERRUPT_ENABLE;
351 if (IS_ENABLED(CONFIG_CPU_BMIPS5000))
352 /* enable the counter for the calling thread */
353 cpuc->saved_ctrl[idx] |=
354 (1 << (12 + vpe_id())) | M_PERFCTL_TC;
355
343 /* 356 /*
344 * We do not actually let the counter run. Leave it until start(). 357 * We do not actually let the counter run. Leave it until start().
345 */ 358 */
@@ -509,7 +522,7 @@ static void mipspmu_read(struct perf_event *event)
509 522
510static void mipspmu_enable(struct pmu *pmu) 523static void mipspmu_enable(struct pmu *pmu)
511{ 524{
512#ifdef CONFIG_MIPS_MT_SMP 525#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
513 write_unlock(&pmuint_rwlock); 526 write_unlock(&pmuint_rwlock);
514#endif 527#endif
515 resume_local_counters(); 528 resume_local_counters();
@@ -529,7 +542,7 @@ static void mipspmu_enable(struct pmu *pmu)
529static void mipspmu_disable(struct pmu *pmu) 542static void mipspmu_disable(struct pmu *pmu)
530{ 543{
531 pause_local_counters(); 544 pause_local_counters();
532#ifdef CONFIG_MIPS_MT_SMP 545#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
533 write_lock(&pmuint_rwlock); 546 write_lock(&pmuint_rwlock);
534#endif 547#endif
535} 548}
@@ -664,13 +677,10 @@ static unsigned int mipspmu_perf_event_encode(const struct mips_perf_event *pev)
664 677
665static const struct mips_perf_event *mipspmu_map_general_event(int idx) 678static const struct mips_perf_event *mipspmu_map_general_event(int idx)
666{ 679{
667 const struct mips_perf_event *pev;
668
669 pev = ((*mipspmu.general_event_map)[idx].event_id ==
670 UNSUPPORTED_PERF_EVENT_ID ? ERR_PTR(-EOPNOTSUPP) :
671 &(*mipspmu.general_event_map)[idx]);
672 680
673 return pev; 681 if ((*mipspmu.general_event_map)[idx].cntr_mask == 0)
682 return ERR_PTR(-EOPNOTSUPP);
683 return &(*mipspmu.general_event_map)[idx];
674} 684}
675 685
676static const struct mips_perf_event *mipspmu_map_cache_event(u64 config) 686static const struct mips_perf_event *mipspmu_map_cache_event(u64 config)
@@ -695,7 +705,7 @@ static const struct mips_perf_event *mipspmu_map_cache_event(u64 config)
695 [cache_op] 705 [cache_op]
696 [cache_result]); 706 [cache_result]);
697 707
698 if (pev->event_id == UNSUPPORTED_PERF_EVENT_ID) 708 if (pev->cntr_mask == 0)
699 return ERR_PTR(-EOPNOTSUPP); 709 return ERR_PTR(-EOPNOTSUPP);
700 710
701 return pev; 711 return pev;
@@ -800,11 +810,8 @@ static const struct mips_perf_event mipsxxcore_event_map
800 [PERF_COUNT_HW_MAX] = { 810 [PERF_COUNT_HW_MAX] = {
801 [PERF_COUNT_HW_CPU_CYCLES] = { 0x00, CNTR_EVEN | CNTR_ODD, P }, 811 [PERF_COUNT_HW_CPU_CYCLES] = { 0x00, CNTR_EVEN | CNTR_ODD, P },
802 [PERF_COUNT_HW_INSTRUCTIONS] = { 0x01, CNTR_EVEN | CNTR_ODD, T }, 812 [PERF_COUNT_HW_INSTRUCTIONS] = { 0x01, CNTR_EVEN | CNTR_ODD, T },
803 [PERF_COUNT_HW_CACHE_REFERENCES] = { UNSUPPORTED_PERF_EVENT_ID },
804 [PERF_COUNT_HW_CACHE_MISSES] = { UNSUPPORTED_PERF_EVENT_ID },
805 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = { 0x02, CNTR_EVEN, T }, 813 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = { 0x02, CNTR_EVEN, T },
806 [PERF_COUNT_HW_BRANCH_MISSES] = { 0x02, CNTR_ODD, T }, 814 [PERF_COUNT_HW_BRANCH_MISSES] = { 0x02, CNTR_ODD, T },
807 [PERF_COUNT_HW_BUS_CYCLES] = { UNSUPPORTED_PERF_EVENT_ID },
808}; 815};
809 816
810/* 74K core has different branch event code. */ 817/* 74K core has different branch event code. */
@@ -812,11 +819,8 @@ static const struct mips_perf_event mipsxx74Kcore_event_map
812 [PERF_COUNT_HW_MAX] = { 819 [PERF_COUNT_HW_MAX] = {
813 [PERF_COUNT_HW_CPU_CYCLES] = { 0x00, CNTR_EVEN | CNTR_ODD, P }, 820 [PERF_COUNT_HW_CPU_CYCLES] = { 0x00, CNTR_EVEN | CNTR_ODD, P },
814 [PERF_COUNT_HW_INSTRUCTIONS] = { 0x01, CNTR_EVEN | CNTR_ODD, T }, 821 [PERF_COUNT_HW_INSTRUCTIONS] = { 0x01, CNTR_EVEN | CNTR_ODD, T },
815 [PERF_COUNT_HW_CACHE_REFERENCES] = { UNSUPPORTED_PERF_EVENT_ID },
816 [PERF_COUNT_HW_CACHE_MISSES] = { UNSUPPORTED_PERF_EVENT_ID },
817 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = { 0x27, CNTR_EVEN, T }, 822 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = { 0x27, CNTR_EVEN, T },
818 [PERF_COUNT_HW_BRANCH_MISSES] = { 0x27, CNTR_ODD, T }, 823 [PERF_COUNT_HW_BRANCH_MISSES] = { 0x27, CNTR_ODD, T },
819 [PERF_COUNT_HW_BUS_CYCLES] = { UNSUPPORTED_PERF_EVENT_ID },
820}; 824};
821 825
822static const struct mips_perf_event octeon_event_map[PERF_COUNT_HW_MAX] = { 826static const struct mips_perf_event octeon_event_map[PERF_COUNT_HW_MAX] = {
@@ -829,6 +833,13 @@ static const struct mips_perf_event octeon_event_map[PERF_COUNT_HW_MAX] = {
829 [PERF_COUNT_HW_BUS_CYCLES] = { 0x25, CNTR_ALL }, 833 [PERF_COUNT_HW_BUS_CYCLES] = { 0x25, CNTR_ALL },
830}; 834};
831 835
836static const struct mips_perf_event bmips5000_event_map
837 [PERF_COUNT_HW_MAX] = {
838 [PERF_COUNT_HW_CPU_CYCLES] = { 0x00, CNTR_EVEN | CNTR_ODD, T },
839 [PERF_COUNT_HW_INSTRUCTIONS] = { 0x01, CNTR_EVEN | CNTR_ODD, T },
840 [PERF_COUNT_HW_BRANCH_MISSES] = { 0x02, CNTR_ODD, T },
841};
842
832/* 24K/34K/1004K cores can share the same cache event map. */ 843/* 24K/34K/1004K cores can share the same cache event map. */
833static const struct mips_perf_event mipsxxcore_cache_map 844static const struct mips_perf_event mipsxxcore_cache_map
834 [PERF_COUNT_HW_CACHE_MAX] 845 [PERF_COUNT_HW_CACHE_MAX]
@@ -849,10 +860,6 @@ static const struct mips_perf_event mipsxxcore_cache_map
849 [C(RESULT_ACCESS)] = { 0x0a, CNTR_EVEN, T }, 860 [C(RESULT_ACCESS)] = { 0x0a, CNTR_EVEN, T },
850 [C(RESULT_MISS)] = { 0x0b, CNTR_EVEN | CNTR_ODD, T }, 861 [C(RESULT_MISS)] = { 0x0b, CNTR_EVEN | CNTR_ODD, T },
851 }, 862 },
852 [C(OP_PREFETCH)] = {
853 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
854 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
855 },
856}, 863},
857[C(L1I)] = { 864[C(L1I)] = {
858 [C(OP_READ)] = { 865 [C(OP_READ)] = {
@@ -869,7 +876,6 @@ static const struct mips_perf_event mipsxxcore_cache_map
869 * Note that MIPS has only "hit" events countable for 876 * Note that MIPS has only "hit" events countable for
870 * the prefetch operation. 877 * the prefetch operation.
871 */ 878 */
872 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
873 }, 879 },
874}, 880},
875[C(LL)] = { 881[C(LL)] = {
@@ -881,10 +887,6 @@ static const struct mips_perf_event mipsxxcore_cache_map
881 [C(RESULT_ACCESS)] = { 0x15, CNTR_ODD, P }, 887 [C(RESULT_ACCESS)] = { 0x15, CNTR_ODD, P },
882 [C(RESULT_MISS)] = { 0x16, CNTR_EVEN, P }, 888 [C(RESULT_MISS)] = { 0x16, CNTR_EVEN, P },
883 }, 889 },
884 [C(OP_PREFETCH)] = {
885 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
886 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
887 },
888}, 890},
889[C(DTLB)] = { 891[C(DTLB)] = {
890 [C(OP_READ)] = { 892 [C(OP_READ)] = {
@@ -895,10 +897,6 @@ static const struct mips_perf_event mipsxxcore_cache_map
895 [C(RESULT_ACCESS)] = { 0x06, CNTR_EVEN, T }, 897 [C(RESULT_ACCESS)] = { 0x06, CNTR_EVEN, T },
896 [C(RESULT_MISS)] = { 0x06, CNTR_ODD, T }, 898 [C(RESULT_MISS)] = { 0x06, CNTR_ODD, T },
897 }, 899 },
898 [C(OP_PREFETCH)] = {
899 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
900 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
901 },
902}, 900},
903[C(ITLB)] = { 901[C(ITLB)] = {
904 [C(OP_READ)] = { 902 [C(OP_READ)] = {
@@ -909,10 +907,6 @@ static const struct mips_perf_event mipsxxcore_cache_map
909 [C(RESULT_ACCESS)] = { 0x05, CNTR_EVEN, T }, 907 [C(RESULT_ACCESS)] = { 0x05, CNTR_EVEN, T },
910 [C(RESULT_MISS)] = { 0x05, CNTR_ODD, T }, 908 [C(RESULT_MISS)] = { 0x05, CNTR_ODD, T },
911 }, 909 },
912 [C(OP_PREFETCH)] = {
913 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
914 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
915 },
916}, 910},
917[C(BPU)] = { 911[C(BPU)] = {
918 /* Using the same code for *HW_BRANCH* */ 912 /* Using the same code for *HW_BRANCH* */
@@ -924,24 +918,6 @@ static const struct mips_perf_event mipsxxcore_cache_map
924 [C(RESULT_ACCESS)] = { 0x02, CNTR_EVEN, T }, 918 [C(RESULT_ACCESS)] = { 0x02, CNTR_EVEN, T },
925 [C(RESULT_MISS)] = { 0x02, CNTR_ODD, T }, 919 [C(RESULT_MISS)] = { 0x02, CNTR_ODD, T },
926 }, 920 },
927 [C(OP_PREFETCH)] = {
928 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
929 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
930 },
931},
932[C(NODE)] = {
933 [C(OP_READ)] = {
934 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
935 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
936 },
937 [C(OP_WRITE)] = {
938 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
939 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
940 },
941 [C(OP_PREFETCH)] = {
942 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
943 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
944 },
945}, 921},
946}; 922};
947 923
@@ -965,10 +941,6 @@ static const struct mips_perf_event mipsxx74Kcore_cache_map
965 [C(RESULT_ACCESS)] = { 0x17, CNTR_ODD, T }, 941 [C(RESULT_ACCESS)] = { 0x17, CNTR_ODD, T },
966 [C(RESULT_MISS)] = { 0x18, CNTR_ODD, T }, 942 [C(RESULT_MISS)] = { 0x18, CNTR_ODD, T },
967 }, 943 },
968 [C(OP_PREFETCH)] = {
969 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
970 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
971 },
972}, 944},
973[C(L1I)] = { 945[C(L1I)] = {
974 [C(OP_READ)] = { 946 [C(OP_READ)] = {
@@ -985,7 +957,6 @@ static const struct mips_perf_event mipsxx74Kcore_cache_map
985 * Note that MIPS has only "hit" events countable for 957 * Note that MIPS has only "hit" events countable for
986 * the prefetch operation. 958 * the prefetch operation.
987 */ 959 */
988 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
989 }, 960 },
990}, 961},
991[C(LL)] = { 962[C(LL)] = {
@@ -997,25 +968,6 @@ static const struct mips_perf_event mipsxx74Kcore_cache_map
997 [C(RESULT_ACCESS)] = { 0x1c, CNTR_ODD, P }, 968 [C(RESULT_ACCESS)] = { 0x1c, CNTR_ODD, P },
998 [C(RESULT_MISS)] = { 0x1d, CNTR_EVEN | CNTR_ODD, P }, 969 [C(RESULT_MISS)] = { 0x1d, CNTR_EVEN | CNTR_ODD, P },
999 }, 970 },
1000 [C(OP_PREFETCH)] = {
1001 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1002 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1003 },
1004},
1005[C(DTLB)] = {
1006 /* 74K core does not have specific DTLB events. */
1007 [C(OP_READ)] = {
1008 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1009 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1010 },
1011 [C(OP_WRITE)] = {
1012 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1013 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1014 },
1015 [C(OP_PREFETCH)] = {
1016 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1017 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1018 },
1019}, 971},
1020[C(ITLB)] = { 972[C(ITLB)] = {
1021 [C(OP_READ)] = { 973 [C(OP_READ)] = {
@@ -1026,10 +978,6 @@ static const struct mips_perf_event mipsxx74Kcore_cache_map
1026 [C(RESULT_ACCESS)] = { 0x04, CNTR_EVEN, T }, 978 [C(RESULT_ACCESS)] = { 0x04, CNTR_EVEN, T },
1027 [C(RESULT_MISS)] = { 0x04, CNTR_ODD, T }, 979 [C(RESULT_MISS)] = { 0x04, CNTR_ODD, T },
1028 }, 980 },
1029 [C(OP_PREFETCH)] = {
1030 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1031 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1032 },
1033}, 981},
1034[C(BPU)] = { 982[C(BPU)] = {
1035 /* Using the same code for *HW_BRANCH* */ 983 /* Using the same code for *HW_BRANCH* */
@@ -1041,23 +989,64 @@ static const struct mips_perf_event mipsxx74Kcore_cache_map
1041 [C(RESULT_ACCESS)] = { 0x27, CNTR_EVEN, T }, 989 [C(RESULT_ACCESS)] = { 0x27, CNTR_EVEN, T },
1042 [C(RESULT_MISS)] = { 0x27, CNTR_ODD, T }, 990 [C(RESULT_MISS)] = { 0x27, CNTR_ODD, T },
1043 }, 991 },
1044 [C(OP_PREFETCH)] = { 992},
1045 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID }, 993};
1046 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID }, 994
995/* BMIPS5000 */
996static const struct mips_perf_event bmips5000_cache_map
997 [PERF_COUNT_HW_CACHE_MAX]
998 [PERF_COUNT_HW_CACHE_OP_MAX]
999 [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
1000[C(L1D)] = {
1001 /*
1002 * Like some other architectures (e.g. ARM), the performance
1003 * counters don't differentiate between read and write
1004 * accesses/misses, so this isn't strictly correct, but it's the
1005 * best we can do. Writes and reads get combined.
1006 */
1007 [C(OP_READ)] = {
1008 [C(RESULT_ACCESS)] = { 12, CNTR_EVEN, T },
1009 [C(RESULT_MISS)] = { 12, CNTR_ODD, T },
1010 },
1011 [C(OP_WRITE)] = {
1012 [C(RESULT_ACCESS)] = { 12, CNTR_EVEN, T },
1013 [C(RESULT_MISS)] = { 12, CNTR_ODD, T },
1047 }, 1014 },
1048}, 1015},
1049[C(NODE)] = { 1016[C(L1I)] = {
1050 [C(OP_READ)] = { 1017 [C(OP_READ)] = {
1051 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID }, 1018 [C(RESULT_ACCESS)] = { 10, CNTR_EVEN, T },
1052 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID }, 1019 [C(RESULT_MISS)] = { 10, CNTR_ODD, T },
1053 }, 1020 },
1054 [C(OP_WRITE)] = { 1021 [C(OP_WRITE)] = {
1055 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID }, 1022 [C(RESULT_ACCESS)] = { 10, CNTR_EVEN, T },
1056 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID }, 1023 [C(RESULT_MISS)] = { 10, CNTR_ODD, T },
1057 }, 1024 },
1058 [C(OP_PREFETCH)] = { 1025 [C(OP_PREFETCH)] = {
1059 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID }, 1026 [C(RESULT_ACCESS)] = { 23, CNTR_EVEN, T },
1060 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID }, 1027 /*
1028 * Note that MIPS has only "hit" events countable for
1029 * the prefetch operation.
1030 */
1031 },
1032},
1033[C(LL)] = {
1034 [C(OP_READ)] = {
1035 [C(RESULT_ACCESS)] = { 28, CNTR_EVEN, P },
1036 [C(RESULT_MISS)] = { 28, CNTR_ODD, P },
1037 },
1038 [C(OP_WRITE)] = {
1039 [C(RESULT_ACCESS)] = { 28, CNTR_EVEN, P },
1040 [C(RESULT_MISS)] = { 28, CNTR_ODD, P },
1041 },
1042},
1043[C(BPU)] = {
1044 /* Using the same code for *HW_BRANCH* */
1045 [C(OP_READ)] = {
1046 [C(RESULT_MISS)] = { 0x02, CNTR_ODD, T },
1047 },
1048 [C(OP_WRITE)] = {
1049 [C(RESULT_MISS)] = { 0x02, CNTR_ODD, T },
1061 }, 1050 },
1062}, 1051},
1063}; 1052};
@@ -1074,39 +1063,14 @@ static const struct mips_perf_event octeon_cache_map
1074 }, 1063 },
1075 [C(OP_WRITE)] = { 1064 [C(OP_WRITE)] = {
1076 [C(RESULT_ACCESS)] = { 0x30, CNTR_ALL }, 1065 [C(RESULT_ACCESS)] = { 0x30, CNTR_ALL },
1077 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1078 },
1079 [C(OP_PREFETCH)] = {
1080 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1081 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1082 }, 1066 },
1083}, 1067},
1084[C(L1I)] = { 1068[C(L1I)] = {
1085 [C(OP_READ)] = { 1069 [C(OP_READ)] = {
1086 [C(RESULT_ACCESS)] = { 0x18, CNTR_ALL }, 1070 [C(RESULT_ACCESS)] = { 0x18, CNTR_ALL },
1087 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1088 },
1089 [C(OP_WRITE)] = {
1090 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1091 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1092 }, 1071 },
1093 [C(OP_PREFETCH)] = { 1072 [C(OP_PREFETCH)] = {
1094 [C(RESULT_ACCESS)] = { 0x19, CNTR_ALL }, 1073 [C(RESULT_ACCESS)] = { 0x19, CNTR_ALL },
1095 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1096 },
1097},
1098[C(LL)] = {
1099 [C(OP_READ)] = {
1100 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1101 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1102 },
1103 [C(OP_WRITE)] = {
1104 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1105 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1106 },
1107 [C(OP_PREFETCH)] = {
1108 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1109 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1110 }, 1074 },
1111}, 1075},
1112[C(DTLB)] = { 1076[C(DTLB)] = {
@@ -1115,46 +1079,16 @@ static const struct mips_perf_event octeon_cache_map
1115 * read and write. 1079 * read and write.
1116 */ 1080 */
1117 [C(OP_READ)] = { 1081 [C(OP_READ)] = {
1118 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1119 [C(RESULT_MISS)] = { 0x35, CNTR_ALL }, 1082 [C(RESULT_MISS)] = { 0x35, CNTR_ALL },
1120 }, 1083 },
1121 [C(OP_WRITE)] = { 1084 [C(OP_WRITE)] = {
1122 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1123 [C(RESULT_MISS)] = { 0x35, CNTR_ALL }, 1085 [C(RESULT_MISS)] = { 0x35, CNTR_ALL },
1124 }, 1086 },
1125 [C(OP_PREFETCH)] = {
1126 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1127 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1128 },
1129}, 1087},
1130[C(ITLB)] = { 1088[C(ITLB)] = {
1131 [C(OP_READ)] = { 1089 [C(OP_READ)] = {
1132 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1133 [C(RESULT_MISS)] = { 0x37, CNTR_ALL }, 1090 [C(RESULT_MISS)] = { 0x37, CNTR_ALL },
1134 }, 1091 },
1135 [C(OP_WRITE)] = {
1136 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1137 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1138 },
1139 [C(OP_PREFETCH)] = {
1140 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1141 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1142 },
1143},
1144[C(BPU)] = {
1145 /* Using the same code for *HW_BRANCH* */
1146 [C(OP_READ)] = {
1147 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1148 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1149 },
1150 [C(OP_WRITE)] = {
1151 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1152 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1153 },
1154 [C(OP_PREFETCH)] = {
1155 [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID },
1156 [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID },
1157 },
1158}, 1092},
1159}; 1093};
1160 1094
@@ -1304,7 +1238,7 @@ static int mipsxx_pmu_handle_shared_irq(void)
1304 int handled = IRQ_NONE; 1238 int handled = IRQ_NONE;
1305 struct pt_regs *regs; 1239 struct pt_regs *regs;
1306 1240
1307 if (cpu_has_mips_r2 && !(read_c0_cause() & (1 << 26))) 1241 if (cpu_has_perf_cntr_intr_bit && !(read_c0_cause() & CAUSEF_PCI))
1308 return handled; 1242 return handled;
1309 /* 1243 /*
1310 * First we pause the local counters, so that when we are locked 1244 * First we pause the local counters, so that when we are locked
@@ -1314,7 +1248,7 @@ static int mipsxx_pmu_handle_shared_irq(void)
1314 * See also mipsxx_pmu_start(). 1248 * See also mipsxx_pmu_start().
1315 */ 1249 */
1316 pause_local_counters(); 1250 pause_local_counters();
1317#ifdef CONFIG_MIPS_MT_SMP 1251#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
1318 read_lock(&pmuint_rwlock); 1252 read_lock(&pmuint_rwlock);
1319#endif 1253#endif
1320 1254
@@ -1346,7 +1280,7 @@ static int mipsxx_pmu_handle_shared_irq(void)
1346 if (handled == IRQ_HANDLED) 1280 if (handled == IRQ_HANDLED)
1347 irq_work_run(); 1281 irq_work_run();
1348 1282
1349#ifdef CONFIG_MIPS_MT_SMP 1283#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
1350 read_unlock(&pmuint_rwlock); 1284 read_unlock(&pmuint_rwlock);
1351#endif 1285#endif
1352 resume_local_counters(); 1286 resume_local_counters();
@@ -1391,6 +1325,11 @@ static irqreturn_t mipsxx_pmu_handle_irq(int irq, void *dev)
1391#define IS_RANGE_V_1004K_EVENT(r) ((r) == 47) 1325#define IS_RANGE_V_1004K_EVENT(r) ((r) == 47)
1392#endif 1326#endif
1393 1327
1328/* BMIPS5000 */
1329#define IS_BOTH_COUNTERS_BMIPS5000_EVENT(b) \
1330 ((b) == 0 || (b) == 1)
1331
1332
1394/* 1333/*
1395 * User can use 0-255 raw events, where 0-127 for the events of even 1334 * User can use 0-255 raw events, where 0-127 for the events of even
1396 * counters, and 128-255 for odd counters. Note that bit 7 is used to 1335 * counters, and 128-255 for odd counters. Note that bit 7 is used to
@@ -1461,6 +1400,12 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config)
1461 raw_event.range = T; 1400 raw_event.range = T;
1462#endif 1401#endif
1463 break; 1402 break;
1403 case CPU_BMIPS5000:
1404 if (IS_BOTH_COUNTERS_BMIPS5000_EVENT(base_id))
1405 raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD;
1406 else
1407 raw_event.cntr_mask =
1408 raw_id > 127 ? CNTR_ODD : CNTR_EVEN;
1464 } 1409 }
1465 1410
1466 return &raw_event; 1411 return &raw_event;
@@ -1513,7 +1458,7 @@ init_hw_perf_events(void)
1513 return -ENODEV; 1458 return -ENODEV;
1514 } 1459 }
1515 1460
1516#ifdef CONFIG_MIPS_MT_SMP 1461#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
1517 cpu_has_mipsmt_pertccounters = read_c0_config7() & (1<<19); 1462 cpu_has_mipsmt_pertccounters = read_c0_config7() & (1<<19);
1518 if (!cpu_has_mipsmt_pertccounters) 1463 if (!cpu_has_mipsmt_pertccounters)
1519 counters = counters_total_to_per_cpu(counters); 1464 counters = counters_total_to_per_cpu(counters);
@@ -1572,6 +1517,11 @@ init_hw_perf_events(void)
1572 mipspmu.cache_event_map = &octeon_cache_map; 1517 mipspmu.cache_event_map = &octeon_cache_map;
1573 mipspmu.map_raw_event = octeon_pmu_map_raw_event; 1518 mipspmu.map_raw_event = octeon_pmu_map_raw_event;
1574 break; 1519 break;
1520 case CPU_BMIPS5000:
1521 mipspmu.name = "BMIPS5000";
1522 mipspmu.general_event_map = &bmips5000_event_map;
1523 mipspmu.cache_event_map = &bmips5000_cache_map;
1524 break;
1575 default: 1525 default:
1576 pr_cont("Either hardware does not support performance " 1526 pr_cont("Either hardware does not support performance "
1577 "counters, or not yet implemented.\n"); 1527 "counters, or not yet implemented.\n");
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
index 5542817c1b49..07dff54f2ce8 100644
--- a/arch/mips/kernel/proc.c
+++ b/arch/mips/kernel/proc.c
@@ -64,14 +64,17 @@ static int show_cpuinfo(struct seq_file *m, void *v)
64 cpu_data[n].watch_reg_masks[i]); 64 cpu_data[n].watch_reg_masks[i]);
65 seq_printf(m, "]\n"); 65 seq_printf(m, "]\n");
66 } 66 }
67 seq_printf(m, "ASEs implemented\t:%s%s%s%s%s%s\n", 67
68 cpu_has_mips16 ? " mips16" : "", 68 seq_printf(m, "ASEs implemented\t:");
69 cpu_has_mdmx ? " mdmx" : "", 69 if (cpu_has_mips16) seq_printf(m, "%s", " mips16");
70 cpu_has_mips3d ? " mips3d" : "", 70 if (cpu_has_mdmx) seq_printf(m, "%s", " mdmx");
71 cpu_has_smartmips ? " smartmips" : "", 71 if (cpu_has_mips3d) seq_printf(m, "%s", " mips3d");
72 cpu_has_dsp ? " dsp" : "", 72 if (cpu_has_smartmips) seq_printf(m, "%s", " smartmips");
73 cpu_has_mipsmt ? " mt" : "" 73 if (cpu_has_dsp) seq_printf(m, "%s", " dsp");
74 ); 74 if (cpu_has_dsp2) seq_printf(m, "%s", " dsp2");
75 if (cpu_has_mipsmt) seq_printf(m, "%s", " mt");
76 seq_printf(m, "\n");
77
75 seq_printf(m, "shadow register sets\t: %d\n", 78 seq_printf(m, "shadow register sets\t: %d\n",
76 cpu_data[n].srsets); 79 cpu_data[n].srsets);
77 seq_printf(m, "kscratch registers\t: %d\n", 80 seq_printf(m, "kscratch registers\t: %d\n",
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index df243a64f430..007ccbe1e264 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -1,6 +1,13 @@
1#include <asm/asm-offsets.h> 1#include <asm/asm-offsets.h>
2#include <asm/page.h> 2#include <asm/page.h>
3#include <asm/thread_info.h> 3#include <asm/thread_info.h>
4
5/*
6 * Put .bss..swapper_pg_dir as the first thing in .bss. This will
7 * ensure that it has .bss alignment (64K).
8 */
9#define BSS_FIRST_SECTIONS *(.bss..swapper_pg_dir)
10
4#include <asm-generic/vmlinux.lds.h> 11#include <asm-generic/vmlinux.lds.h>
5 12
6#undef mips 13#undef mips
@@ -119,11 +126,21 @@ SECTIONS
119 } 126 }
120 127
121 PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT) 128 PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
122 . = ALIGN(PAGE_SIZE); 129 /*
130 * Align to 64K in attempt to eliminate holes before the
131 * .bss..swapper_pg_dir section at the start of .bss. This
132 * also satisfies PAGE_SIZE alignment as the largest page size
133 * allowed is 64K.
134 */
135 . = ALIGN(0x10000);
123 __init_end = .; 136 __init_end = .;
124 /* freed after init ends here */ 137 /* freed after init ends here */
125 138
126 BSS_SECTION(0, 0, 0) 139 /*
140 * Force .bss to 64K alignment so that .bss..swapper_pg_dir
141 * gets that alignment. .sbss should be empty, so there will be
142 * no holes after __init_end. */
143 BSS_SECTION(0, 0x10000, 0)
127 144
128 _end = . ; 145 _end = . ;
129 146
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index f6f91523cb1c..eec690af6581 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -50,7 +50,6 @@
50#include <asm/mips_mt.h> 50#include <asm/mips_mt.h>
51#include <asm/processor.h> 51#include <asm/processor.h>
52#include <asm/vpe.h> 52#include <asm/vpe.h>
53#include <asm/kspd.h>
54 53
55typedef void *vpe_handle; 54typedef void *vpe_handle;
56 55
@@ -69,11 +68,6 @@ static char module_name[] = "vpe";
69static int major; 68static int major;
70static const int minor = 1; /* fixed for now */ 69static const int minor = 1; /* fixed for now */
71 70
72#ifdef CONFIG_MIPS_APSP_KSPD
73static struct kspd_notifications kspd_events;
74static int kspd_events_reqd;
75#endif
76
77/* grab the likely amount of memory we will need. */ 71/* grab the likely amount of memory we will need. */
78#ifdef CONFIG_MIPS_VPE_LOADER_TOM 72#ifdef CONFIG_MIPS_VPE_LOADER_TOM
79#define P_SIZE (2 * 1024 * 1024) 73#define P_SIZE (2 * 1024 * 1024)
@@ -1101,14 +1095,6 @@ static int vpe_open(struct inode *inode, struct file *filp)
1101 v->uid = filp->f_cred->fsuid; 1095 v->uid = filp->f_cred->fsuid;
1102 v->gid = filp->f_cred->fsgid; 1096 v->gid = filp->f_cred->fsgid;
1103 1097
1104#ifdef CONFIG_MIPS_APSP_KSPD
1105 /* get kspd to tell us when a syscall_exit happens */
1106 if (!kspd_events_reqd) {
1107 kspd_notify(&kspd_events);
1108 kspd_events_reqd++;
1109 }
1110#endif
1111
1112 v->cwd[0] = 0; 1098 v->cwd[0] = 0;
1113 ret = getcwd(v->cwd, VPE_PATH_MAX); 1099 ret = getcwd(v->cwd, VPE_PATH_MAX);
1114 if (ret < 0) 1100 if (ret < 0)
@@ -1341,13 +1327,6 @@ char *vpe_getcwd(int index)
1341 1327
1342EXPORT_SYMBOL(vpe_getcwd); 1328EXPORT_SYMBOL(vpe_getcwd);
1343 1329
1344#ifdef CONFIG_MIPS_APSP_KSPD
1345static void kspd_sp_exit( int sp_id)
1346{
1347 cleanup_tc(get_tc(sp_id));
1348}
1349#endif
1350
1351static ssize_t store_kill(struct device *dev, struct device_attribute *attr, 1330static ssize_t store_kill(struct device *dev, struct device_attribute *attr,
1352 const char *buf, size_t len) 1331 const char *buf, size_t len)
1353{ 1332{
@@ -1585,9 +1564,6 @@ out_reenable:
1585 emt(mtflags); 1564 emt(mtflags);
1586 local_irq_restore(flags); 1565 local_irq_restore(flags);
1587 1566
1588#ifdef CONFIG_MIPS_APSP_KSPD
1589 kspd_events.kspd_sp_exit = kspd_sp_exit;
1590#endif
1591 return 0; 1567 return 0;
1592 1568
1593out_class: 1569out_class:
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 1a85ba92eb5c..be9acb2b959d 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -469,19 +469,20 @@ void __init_refok free_initmem(void)
469#ifndef CONFIG_MIPS_PGD_C0_CONTEXT 469#ifndef CONFIG_MIPS_PGD_C0_CONTEXT
470unsigned long pgd_current[NR_CPUS]; 470unsigned long pgd_current[NR_CPUS];
471#endif 471#endif
472/*
473 * On 64-bit we've got three-level pagetables with a slightly
474 * different layout ...
475 */
476#define __page_aligned(order) __attribute__((__aligned__(PAGE_SIZE<<order)))
477 472
478/* 473/*
479 * gcc 3.3 and older have trouble determining that PTRS_PER_PGD and PGD_ORDER 474 * gcc 3.3 and older have trouble determining that PTRS_PER_PGD and PGD_ORDER
480 * are constants. So we use the variants from asm-offset.h until that gcc 475 * are constants. So we use the variants from asm-offset.h until that gcc
481 * will officially be retired. 476 * will officially be retired.
477 *
478 * Align swapper_pg_dir in to 64K, allows its address to be loaded
479 * with a single LUI instruction in the TLB handlers. If we used
480 * __aligned(64K), its size would get rounded up to the alignment
481 * size, and waste space. So we place it in its own section and align
482 * it in the linker script.
482 */ 483 */
483pgd_t swapper_pg_dir[_PTRS_PER_PGD] __page_aligned(_PGD_ORDER); 484pgd_t swapper_pg_dir[_PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
484#ifndef __PAGETABLE_PMD_FOLDED 485#ifndef __PAGETABLE_PMD_FOLDED
485pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned(PMD_ORDER); 486pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned_bss;
486#endif 487#endif
487pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER); 488pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned_bss;
diff --git a/arch/mips/mm/pgtable-64.c b/arch/mips/mm/pgtable-64.c
index cda4e300eb0a..25407794edb4 100644
--- a/arch/mips/mm/pgtable-64.c
+++ b/arch/mips/mm/pgtable-64.c
@@ -26,17 +26,17 @@ void pgd_init(unsigned long page)
26 p = (unsigned long *) page; 26 p = (unsigned long *) page;
27 end = p + PTRS_PER_PGD; 27 end = p + PTRS_PER_PGD;
28 28
29 while (p < end) { 29 do {
30 p[0] = entry; 30 p[0] = entry;
31 p[1] = entry; 31 p[1] = entry;
32 p[2] = entry; 32 p[2] = entry;
33 p[3] = entry; 33 p[3] = entry;
34 p[4] = entry; 34 p[4] = entry;
35 p[5] = entry;
36 p[6] = entry;
37 p[7] = entry;
38 p += 8; 35 p += 8;
39 } 36 p[-3] = entry;
37 p[-2] = entry;
38 p[-1] = entry;
39 } while (p != end);
40} 40}
41 41
42#ifndef __PAGETABLE_PMD_FOLDED 42#ifndef __PAGETABLE_PMD_FOLDED
@@ -47,17 +47,17 @@ void pmd_init(unsigned long addr, unsigned long pagetable)
47 p = (unsigned long *) addr; 47 p = (unsigned long *) addr;
48 end = p + PTRS_PER_PMD; 48 end = p + PTRS_PER_PMD;
49 49
50 while (p < end) { 50 do {
51 p[0] = pagetable; 51 p[0] = pagetable;
52 p[1] = pagetable; 52 p[1] = pagetable;
53 p[2] = pagetable; 53 p[2] = pagetable;
54 p[3] = pagetable; 54 p[3] = pagetable;
55 p[4] = pagetable; 55 p[4] = pagetable;
56 p[5] = pagetable;
57 p[6] = pagetable;
58 p[7] = pagetable;
59 p += 8; 56 p += 8;
60 } 57 p[-3] = pagetable;
58 p[-2] = pagetable;
59 p[-1] = pagetable;
60 } while (p != end);
61} 61}
62#endif 62#endif
63 63
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index e09d49256908..658a520364ce 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -599,8 +599,7 @@ static __cpuinit __maybe_unused void build_convert_pte_to_entrylo(u32 **p,
599 unsigned int reg) 599 unsigned int reg)
600{ 600{
601 if (cpu_has_rixi) { 601 if (cpu_has_rixi) {
602 UASM_i_SRL(p, reg, reg, ilog2(_PAGE_NO_EXEC)); 602 UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL));
603 UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
604 } else { 603 } else {
605#ifdef CONFIG_64BIT_PHYS_ADDR 604#ifdef CONFIG_64BIT_PHYS_ADDR
606 uasm_i_dsrl_safe(p, reg, reg, ilog2(_PAGE_GLOBAL)); 605 uasm_i_dsrl_safe(p, reg, reg, ilog2(_PAGE_GLOBAL));
@@ -1019,11 +1018,9 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
1019 uasm_i_ld(p, tmp, 0, ptep); /* get even pte */ 1018 uasm_i_ld(p, tmp, 0, ptep); /* get even pte */
1020 uasm_i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */ 1019 uasm_i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */
1021 if (cpu_has_rixi) { 1020 if (cpu_has_rixi) {
1022 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC)); 1021 UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL));
1023 UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC));
1024 UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
1025 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */ 1022 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
1026 UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC)); 1023 UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL));
1027 } else { 1024 } else {
1028 uasm_i_dsrl_safe(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */ 1025 uasm_i_dsrl_safe(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */
1029 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */ 1026 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
@@ -1046,13 +1043,11 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
1046 if (r45k_bvahwbug()) 1043 if (r45k_bvahwbug())
1047 build_tlb_probe_entry(p); 1044 build_tlb_probe_entry(p);
1048 if (cpu_has_rixi) { 1045 if (cpu_has_rixi) {
1049 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC)); 1046 UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL));
1050 UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC));
1051 UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
1052 if (r4k_250MHZhwbug()) 1047 if (r4k_250MHZhwbug())
1053 UASM_i_MTC0(p, 0, C0_ENTRYLO0); 1048 UASM_i_MTC0(p, 0, C0_ENTRYLO0);
1054 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */ 1049 UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
1055 UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC)); 1050 UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL));
1056 } else { 1051 } else {
1057 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */ 1052 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */
1058 if (r4k_250MHZhwbug()) 1053 if (r4k_250MHZhwbug())
@@ -1212,13 +1207,9 @@ build_fast_tlb_refill_handler (u32 **p, struct uasm_label **l,
1212 UASM_i_LW(p, odd, sizeof(pte_t), ptr); /* get odd pte */ 1207 UASM_i_LW(p, odd, sizeof(pte_t), ptr); /* get odd pte */
1213 } 1208 }
1214 if (cpu_has_rixi) { 1209 if (cpu_has_rixi) {
1215 uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_NO_EXEC)); 1210 uasm_i_drotr(p, even, even, ilog2(_PAGE_GLOBAL));
1216 uasm_i_dsrl_safe(p, odd, odd, ilog2(_PAGE_NO_EXEC));
1217 uasm_i_drotr(p, even, even,
1218 ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
1219 UASM_i_MTC0(p, even, C0_ENTRYLO0); /* load it */ 1211 UASM_i_MTC0(p, even, C0_ENTRYLO0); /* load it */
1220 uasm_i_drotr(p, odd, odd, 1212 uasm_i_drotr(p, odd, odd, ilog2(_PAGE_GLOBAL));
1221 ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
1222 } else { 1213 } else {
1223 uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_GLOBAL)); 1214 uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_GLOBAL));
1224 UASM_i_MTC0(p, even, C0_ENTRYLO0); /* load it */ 1215 UASM_i_MTC0(p, even, C0_ENTRYLO0); /* load it */
diff --git a/arch/mips/pci/fixup-malta.c b/arch/mips/pci/fixup-malta.c
index 819622f93e9c..9a1a2244522a 100644
--- a/arch/mips/pci/fixup-malta.c
+++ b/arch/mips/pci/fixup-malta.c
@@ -8,7 +8,8 @@
8#define PCID 4 8#define PCID 4
9 9
10/* This table is filled in by interrogating the PIIX4 chip */ 10/* This table is filled in by interrogating the PIIX4 chip */
11static char pci_irq[5] __initdata; 11static char pci_irq[5] __devinitdata = {
12};
12 13
13static char irq_tab[][5] __initdata = { 14static char irq_tab[][5] __initdata = {
14 /* INTA INTB INTC INTD */ 15 /* INTA INTB INTC INTD */
diff --git a/arch/mips/sni/a20r.c b/arch/mips/sni/a20r.c
index b2d4f492d782..9cb9d43a3a0e 100644
--- a/arch/mips/sni/a20r.c
+++ b/arch/mips/sni/a20r.c
@@ -118,26 +118,6 @@ static struct resource sc26xx_rsrc[] = {
118 } 118 }
119}; 119};
120 120
121static unsigned int sc26xx_data[2] = {
122 /* DTR | RTS | DSR | CTS | DCD | RI */
123 (8 << 0) | (4 << 4) | (6 << 8) | (0 << 12) | (6 << 16) | (0 << 20),
124 (3 << 0) | (2 << 4) | (1 << 8) | (2 << 12) | (3 << 16) | (4 << 20)
125};
126
127static struct platform_device sc26xx_pdev = {
128 .name = "SC26xx",
129 .num_resources = ARRAY_SIZE(sc26xx_rsrc),
130 .resource = sc26xx_rsrc,
131 .dev = {
132 .platform_data = sc26xx_data,
133 }
134};
135
136#warning "Please try migrate to use new driver SCCNXP and report the status" \
137 "in the linux-serial mailing list."
138
139/* The code bellow is a replacement of SC26XX to SCCNXP */
140#if 0
141#include <linux/platform_data/sccnxp.h> 121#include <linux/platform_data/sccnxp.h>
142 122
143static struct sccnxp_pdata sccnxp_data = { 123static struct sccnxp_pdata sccnxp_data = {
@@ -155,15 +135,14 @@ static struct sccnxp_pdata sccnxp_data = {
155 MCTRL_SIG(RNG_IP, LINE_IP3), 135 MCTRL_SIG(RNG_IP, LINE_IP3),
156}; 136};
157 137
158static struct platform_device sc2681_pdev = { 138static struct platform_device sc26xx_pdev = {
159 .name = "sc2681", 139 .name = "sc2681",
160 .resource = sc2xxx_rsrc, 140 .resource = sc26xx_rsrc,
161 .num_resources = ARRAY_SIZE(sc2xxx_rsrc), 141 .num_resources = ARRAY_SIZE(sc26xx_rsrc),
162 .dev = { 142 .dev = {
163 .platform_data = &sccnxp_data, 143 .platform_data = &sccnxp_data,
164 }, 144 },
165}; 145};
166#endif
167 146
168static u32 a20r_ack_hwint(void) 147static u32 a20r_ack_hwint(void)
169{ 148{
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index ddbdc33471a8..04669fac117b 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -9,6 +9,7 @@ config MN10300
9 select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER 9 select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER
10 select GENERIC_CLOCKEVENTS 10 select GENERIC_CLOCKEVENTS
11 select GENERIC_KERNEL_THREAD 11 select GENERIC_KERNEL_THREAD
12 select MODULES_USE_ELF_RELA
12 13
13config AM33_2 14config AM33_2
14 def_bool n 15 def_bool n
diff --git a/arch/mn10300/include/asm/module.h b/arch/mn10300/include/asm/module.h
index 5d7057d01494..6571103b0518 100644
--- a/arch/mn10300/include/asm/module.h
+++ b/arch/mn10300/include/asm/module.h
@@ -12,12 +12,7 @@
12#ifndef _ASM_MODULE_H 12#ifndef _ASM_MODULE_H
13#define _ASM_MODULE_H 13#define _ASM_MODULE_H
14 14
15struct mod_arch_specific { 15#include <asm-generic/module.h>
16};
17
18#define Elf_Shdr Elf32_Shdr
19#define Elf_Sym Elf32_Sym
20#define Elf_Ehdr Elf32_Ehdr
21 16
22/* 17/*
23 * Include the MN10300 architecture version. 18 * Include the MN10300 architecture version.
diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
index 49765b53f637..05f2ba41ff1a 100644
--- a/arch/openrisc/Kconfig
+++ b/arch/openrisc/Kconfig
@@ -21,6 +21,7 @@ config OPENRISC
21 select GENERIC_CLOCKEVENTS 21 select GENERIC_CLOCKEVENTS
22 select GENERIC_STRNCPY_FROM_USER 22 select GENERIC_STRNCPY_FROM_USER
23 select GENERIC_STRNLEN_USER 23 select GENERIC_STRNLEN_USER
24 select MODULES_USE_ELF_RELA
24 25
25config MMU 26config MMU
26 def_bool y 27 def_bool y
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index b87438bb3384..11def45b98c5 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -20,6 +20,8 @@ config PARISC
20 select ARCH_HAVE_NMI_SAFE_CMPXCHG 20 select ARCH_HAVE_NMI_SAFE_CMPXCHG
21 select GENERIC_SMP_IDLE_THREAD 21 select GENERIC_SMP_IDLE_THREAD
22 select GENERIC_STRNCPY_FROM_USER 22 select GENERIC_STRNCPY_FROM_USER
23 select HAVE_MOD_ARCH_SPECIFIC
24 select MODULES_USE_ELF_RELA
23 25
24 help 26 help
25 The PA-RISC microprocessor is designed by Hewlett-Packard and used 27 The PA-RISC microprocessor is designed by Hewlett-Packard and used
diff --git a/arch/parisc/include/asm/module.h b/arch/parisc/include/asm/module.h
index 1f4123427ea0..bab37e99168a 100644
--- a/arch/parisc/include/asm/module.h
+++ b/arch/parisc/include/asm/module.h
@@ -1,21 +1,11 @@
1#ifndef _ASM_PARISC_MODULE_H 1#ifndef _ASM_PARISC_MODULE_H
2#define _ASM_PARISC_MODULE_H 2#define _ASM_PARISC_MODULE_H
3
4#include <asm-generic/module.h>
5
3/* 6/*
4 * This file contains the parisc architecture specific module code. 7 * This file contains the parisc architecture specific module code.
5 */ 8 */
6#ifdef CONFIG_64BIT
7#define Elf_Shdr Elf64_Shdr
8#define Elf_Sym Elf64_Sym
9#define Elf_Ehdr Elf64_Ehdr
10#define Elf_Addr Elf64_Addr
11#define Elf_Rela Elf64_Rela
12#else
13#define Elf_Shdr Elf32_Shdr
14#define Elf_Sym Elf32_Sym
15#define Elf_Ehdr Elf32_Ehdr
16#define Elf_Addr Elf32_Addr
17#define Elf_Rela Elf32_Rela
18#endif
19 9
20struct unwind_table; 10struct unwind_table;
21 11
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 969f3d9ded91..a902a5c1c76a 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -142,6 +142,8 @@ config PPC
142 select GENERIC_STRNCPY_FROM_USER 142 select GENERIC_STRNCPY_FROM_USER
143 select GENERIC_STRNLEN_USER 143 select GENERIC_STRNLEN_USER
144 select GENERIC_KERNEL_THREAD 144 select GENERIC_KERNEL_THREAD
145 select HAVE_MOD_ARCH_SPECIFIC
146 select MODULES_USE_ELF_RELA
145 147
146config EARLY_PRINTK 148config EARLY_PRINTK
147 bool 149 bool
diff --git a/arch/powerpc/include/asm/module.h b/arch/powerpc/include/asm/module.h
index 0192a4ee2bc2..c1df590ec444 100644
--- a/arch/powerpc/include/asm/module.h
+++ b/arch/powerpc/include/asm/module.h
@@ -11,6 +11,7 @@
11 11
12#include <linux/list.h> 12#include <linux/list.h>
13#include <asm/bug.h> 13#include <asm/bug.h>
14#include <asm-generic/module.h>
14 15
15 16
16#ifndef __powerpc64__ 17#ifndef __powerpc64__
@@ -60,16 +61,10 @@ struct mod_arch_specific {
60 */ 61 */
61 62
62#ifdef __powerpc64__ 63#ifdef __powerpc64__
63# define Elf_Shdr Elf64_Shdr
64# define Elf_Sym Elf64_Sym
65# define Elf_Ehdr Elf64_Ehdr
66# ifdef MODULE 64# ifdef MODULE
67 asm(".section .stubs,\"ax\",@nobits; .align 3; .previous"); 65 asm(".section .stubs,\"ax\",@nobits; .align 3; .previous");
68# endif 66# endif
69#else 67#else
70# define Elf_Shdr Elf32_Shdr
71# define Elf_Sym Elf32_Sym
72# define Elf_Ehdr Elf32_Ehdr
73# ifdef MODULE 68# ifdef MODULE
74 asm(".section .plt,\"ax\",@nobits; .align 3; .previous"); 69 asm(".section .plt,\"ax\",@nobits; .align 3; .previous");
75 asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous"); 70 asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous");
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index e5dac1236185..3f3d9ca7a5b6 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -136,6 +136,8 @@ config S390
136 select KTIME_SCALAR if 32BIT 136 select KTIME_SCALAR if 32BIT
137 select HAVE_ARCH_SECCOMP_FILTER 137 select HAVE_ARCH_SECCOMP_FILTER
138 select GENERIC_KERNEL_THREAD 138 select GENERIC_KERNEL_THREAD
139 select HAVE_MOD_ARCH_SPECIFIC
140 select MODULES_USE_ELF_RELA
139 141
140config SCHED_OMIT_FRAME_POINTER 142config SCHED_OMIT_FRAME_POINTER
141 def_bool y 143 def_bool y
diff --git a/arch/s390/include/asm/module.h b/arch/s390/include/asm/module.h
index f0b6b26b6e59..df1f861a848a 100644
--- a/arch/s390/include/asm/module.h
+++ b/arch/s390/include/asm/module.h
@@ -1,5 +1,8 @@
1#ifndef _ASM_S390_MODULE_H 1#ifndef _ASM_S390_MODULE_H
2#define _ASM_S390_MODULE_H 2#define _ASM_S390_MODULE_H
3
4#include <asm-generic/module.h>
5
3/* 6/*
4 * This file contains the s390 architecture specific module code. 7 * This file contains the s390 architecture specific module code.
5 */ 8 */
@@ -28,19 +31,4 @@ struct mod_arch_specific
28 struct mod_arch_syminfo *syminfo; 31 struct mod_arch_syminfo *syminfo;
29}; 32};
30 33
31#ifdef CONFIG_64BIT
32#define ElfW(x) Elf64_ ## x
33#define ELFW(x) ELF64_ ## x
34#else
35#define ElfW(x) Elf32_ ## x
36#define ELFW(x) ELF32_ ## x
37#endif
38
39#define Elf_Addr ElfW(Addr)
40#define Elf_Rela ElfW(Rela)
41#define Elf_Shdr ElfW(Shdr)
42#define Elf_Sym ElfW(Sym)
43#define Elf_Ehdr ElfW(Ehdr)
44#define ELF_R_SYM ELFW(R_SYM)
45#define ELF_R_TYPE ELFW(R_TYPE)
46#endif /* _ASM_S390_MODULE_H */ 34#endif /* _ASM_S390_MODULE_H */
diff --git a/arch/score/Kconfig b/arch/score/Kconfig
index 461c23747491..4f93a431a45a 100644
--- a/arch/score/Kconfig
+++ b/arch/score/Kconfig
@@ -11,6 +11,8 @@ config SCORE
11 select ARCH_DISCARD_MEMBLOCK 11 select ARCH_DISCARD_MEMBLOCK
12 select GENERIC_CPU_DEVICES 12 select GENERIC_CPU_DEVICES
13 select GENERIC_CLOCKEVENTS 13 select GENERIC_CLOCKEVENTS
14 select HAVE_MOD_ARCH_SPECIFIC
15 select MODULES_USE_ELF_REL
14 16
15choice 17choice
16 prompt "System type" 18 prompt "System type"
diff --git a/arch/score/include/asm/module.h b/arch/score/include/asm/module.h
index f0b5dc0bd023..abf395bbfaba 100644
--- a/arch/score/include/asm/module.h
+++ b/arch/score/include/asm/module.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/list.h> 4#include <linux/list.h>
5#include <asm/uaccess.h> 5#include <asm/uaccess.h>
6#include <asm-generic/module.h>
6 7
7struct mod_arch_specific { 8struct mod_arch_specific {
8 /* Data Bus Error exception tables */ 9 /* Data Bus Error exception tables */
@@ -13,11 +14,6 @@ struct mod_arch_specific {
13 14
14typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */ 15typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */
15 16
16#define Elf_Shdr Elf32_Shdr
17#define Elf_Sym Elf32_Sym
18#define Elf_Ehdr Elf32_Ehdr
19#define Elf_Addr Elf32_Addr
20
21/* Given an address, look for it in the exception tables. */ 17/* Given an address, look for it in the exception tables. */
22#ifdef CONFIG_MODULES 18#ifdef CONFIG_MODULES
23const struct exception_table_entry *search_module_dbetables(unsigned long addr); 19const struct exception_table_entry *search_module_dbetables(unsigned long addr);
diff --git a/arch/score/kernel/module.c b/arch/score/kernel/module.c
index 469e3b64e2f2..1378d99baa3d 100644
--- a/arch/score/kernel/module.c
+++ b/arch/score/kernel/module.c
@@ -125,16 +125,6 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
125 return 0; 125 return 0;
126} 126}
127 127
128int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
129 unsigned int symindex, unsigned int relsec,
130 struct module *me)
131{
132 /* Non-standard return value... most other arch's return -ENOEXEC
133 * for an unsupported relocation variant
134 */
135 return 0;
136}
137
138/* Given an address, look for it in the module exception tables. */ 128/* Given an address, look for it in the module exception tables. */
139const struct exception_table_entry *search_module_dbetables(unsigned long addr) 129const struct exception_table_entry *search_module_dbetables(unsigned long addr)
140{ 130{
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 3b3e27a3ff2c..babc2b826c5c 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -38,6 +38,8 @@ config SUPERH
38 select GENERIC_CMOS_UPDATE if SH_SH03 || SH_DREAMCAST 38 select GENERIC_CMOS_UPDATE if SH_SH03 || SH_DREAMCAST
39 select GENERIC_STRNCPY_FROM_USER 39 select GENERIC_STRNCPY_FROM_USER
40 select GENERIC_STRNLEN_USER 40 select GENERIC_STRNLEN_USER
41 select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER
42 select MODULES_USE_ELF_RELA
41 help 43 help
42 The SuperH is a RISC processor targeted for use in embedded systems 44 The SuperH is a RISC processor targeted for use in embedded systems
43 and consumer electronics; it was also used in the Sega Dreamcast 45 and consumer electronics; it was also used in the Sega Dreamcast
diff --git a/arch/sh/include/asm/module.h b/arch/sh/include/asm/module.h
index b7927de86f9f..81300d8b5448 100644
--- a/arch/sh/include/asm/module.h
+++ b/arch/sh/include/asm/module.h
@@ -1,21 +1,13 @@
1#ifndef _ASM_SH_MODULE_H 1#ifndef _ASM_SH_MODULE_H
2#define _ASM_SH_MODULE_H 2#define _ASM_SH_MODULE_H
3 3
4struct mod_arch_specific { 4#include <asm-generic/module.h>
5
5#ifdef CONFIG_DWARF_UNWINDER 6#ifdef CONFIG_DWARF_UNWINDER
7struct mod_arch_specific {
6 struct list_head fde_list; 8 struct list_head fde_list;
7 struct list_head cie_list; 9 struct list_head cie_list;
8#endif
9}; 10};
10
11#ifdef CONFIG_64BIT
12#define Elf_Shdr Elf64_Shdr
13#define Elf_Sym Elf64_Sym
14#define Elf_Ehdr Elf64_Ehdr
15#else
16#define Elf_Shdr Elf32_Shdr
17#define Elf_Sym Elf32_Sym
18#define Elf_Ehdr Elf32_Ehdr
19#endif 11#endif
20 12
21#ifdef CONFIG_CPU_LITTLE_ENDIAN 13#ifdef CONFIG_CPU_LITTLE_ENDIAN
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 91c780c973ba..b6b442b0d793 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -39,6 +39,7 @@ config SPARC
39 select GENERIC_CLOCKEVENTS 39 select GENERIC_CLOCKEVENTS
40 select GENERIC_STRNCPY_FROM_USER 40 select GENERIC_STRNCPY_FROM_USER
41 select GENERIC_STRNLEN_USER 41 select GENERIC_STRNLEN_USER
42 select MODULES_USE_ELF_RELA
42 43
43config SPARC32 44config SPARC32
44 def_bool !64BIT 45 def_bool !64BIT
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild
index 10d54e5e37f5..645a58da0e86 100644
--- a/arch/sparc/include/asm/Kbuild
+++ b/arch/sparc/include/asm/Kbuild
@@ -7,4 +7,5 @@ generic-y += exec.h
7generic-y += local64.h 7generic-y += local64.h
8generic-y += irq_regs.h 8generic-y += irq_regs.h
9generic-y += local.h 9generic-y += local.h
10generic-y += module.h
10generic-y += word-at-a-time.h 11generic-y += word-at-a-time.h
diff --git a/arch/sparc/include/asm/module.h b/arch/sparc/include/asm/module.h
deleted file mode 100644
index ff8e02d80334..000000000000
--- a/arch/sparc/include/asm/module.h
+++ /dev/null
@@ -1,24 +0,0 @@
1#ifndef __SPARC_MODULE_H
2#define __SPARC_MODULE_H
3struct mod_arch_specific { };
4
5/*
6 * Use some preprocessor magic to define the correct symbol
7 * for sparc32 and sparc64.
8 * Elf_Addr becomes Elf32_Addr for sparc32 and Elf64_Addr for sparc64
9 */
10#define ___ELF(a, b, c) a##b##c
11#define __ELF(a, b, c) ___ELF(a, b, c)
12#define _Elf(t) __ELF(Elf, CONFIG_BITS, t)
13#define _ELF(t) __ELF(ELF, CONFIG_BITS, t)
14
15#define Elf_Shdr _Elf(_Shdr)
16#define Elf_Sym _Elf(_Sym)
17#define Elf_Ehdr _Elf(_Ehdr)
18#define Elf_Rela _Elf(_Rela)
19#define Elf_Addr _Elf(_Addr)
20
21#define ELF_R_SYM _ELF(_R_SYM)
22#define ELF_R_TYPE _ELF(_R_TYPE)
23
24#endif /* __SPARC_MODULE_H */
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index dc46490adca0..875d008828b8 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -20,6 +20,7 @@ config TILE
20 select SYS_HYPERVISOR 20 select SYS_HYPERVISOR
21 select ARCH_HAVE_NMI_SAFE_CMPXCHG 21 select ARCH_HAVE_NMI_SAFE_CMPXCHG
22 select GENERIC_CLOCKEVENTS 22 select GENERIC_CLOCKEVENTS
23 select MODULES_USE_ELF_RELA
23 24
24# FIXME: investigate whether we need/want these options. 25# FIXME: investigate whether we need/want these options.
25# select HAVE_IOREMAP_PROT 26# select HAVE_IOREMAP_PROT
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index 35ee2bf66354..e5c5473e69ce 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -15,6 +15,7 @@ config UNICORE32
15 select GENERIC_IRQ_SHOW 15 select GENERIC_IRQ_SHOW
16 select ARCH_WANT_FRAME_POINTERS 16 select ARCH_WANT_FRAME_POINTERS
17 select GENERIC_IOMAP 17 select GENERIC_IOMAP
18 select MODULES_USE_ELF_REL
18 help 19 help
19 UniCore-32 is 32-bit Instruction Set Architecture, 20 UniCore-32 is 32-bit Instruction Set Architecture,
20 including a series of low-power-consumption RISC chip 21 including a series of low-power-consumption RISC chip
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 70071b19eb98..46c3bff3ced2 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -110,6 +110,8 @@ config X86
110 select HAVE_IRQ_TIME_ACCOUNTING 110 select HAVE_IRQ_TIME_ACCOUNTING
111 select GENERIC_KERNEL_THREAD 111 select GENERIC_KERNEL_THREAD
112 select GENERIC_KERNEL_EXECVE 112 select GENERIC_KERNEL_EXECVE
113 select MODULES_USE_ELF_REL if X86_32
114 select MODULES_USE_ELF_RELA if X86_64
113 115
114config INSTRUCTION_DECODER 116config INSTRUCTION_DECODER
115 def_bool y 117 def_bool y
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index ce03476d8c8f..ccce0ed67dde 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -37,7 +37,8 @@ setup-y += video-bios.o
37targets += $(setup-y) 37targets += $(setup-y)
38hostprogs-y := mkcpustr tools/build 38hostprogs-y := mkcpustr tools/build
39 39
40HOST_EXTRACFLAGS += -I$(srctree)/tools/include $(USERINCLUDE) \ 40HOST_EXTRACFLAGS += -I$(srctree)/tools/include \
41 -include include/generated/autoconf.h \
41 -D__EXPORTED_HEADERS__ 42 -D__EXPORTED_HEADERS__
42 43
43$(obj)/cpu.o: $(obj)/cpustr.h 44$(obj)/cpu.o: $(obj)/cpustr.h
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index 9fa950df80e5..07611759ce35 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -24,9 +24,11 @@ config X86_32
24 def_bool !64BIT 24 def_bool !64BIT
25 select HAVE_AOUT 25 select HAVE_AOUT
26 select ARCH_WANT_IPC_PARSE_VERSION 26 select ARCH_WANT_IPC_PARSE_VERSION
27 select MODULES_USE_ELF_REL
27 28
28config X86_64 29config X86_64
29 def_bool 64BIT 30 def_bool 64BIT
31 select MODULES_USE_ELF_RELA
30 32
31config RWSEM_XCHGADD_ALGORITHM 33config RWSEM_XCHGADD_ALGORITHM
32 def_bool X86_XADD && 64BIT 34 def_bool X86_XADD && 64BIT
diff --git a/arch/xtensa/include/asm/module.h b/arch/xtensa/include/asm/module.h
index d9b34bee4d42..488b40c6f9b9 100644
--- a/arch/xtensa/include/asm/module.h
+++ b/arch/xtensa/include/asm/module.h
@@ -13,15 +13,8 @@
13#ifndef _XTENSA_MODULE_H 13#ifndef _XTENSA_MODULE_H
14#define _XTENSA_MODULE_H 14#define _XTENSA_MODULE_H
15 15
16struct mod_arch_specific
17{
18 /* No special elements, yet. */
19};
20
21#define MODULE_ARCH_VERMAGIC "xtensa-" __stringify(XCHAL_CORE_ID) " " 16#define MODULE_ARCH_VERMAGIC "xtensa-" __stringify(XCHAL_CORE_ID) " "
22 17
23#define Elf_Shdr Elf32_Shdr 18#include <asm-generic/module.h>
24#define Elf_Sym Elf32_Sym
25#define Elf_Ehdr Elf32_Ehdr
26 19
27#endif /* _XTENSA_MODULE_H */ 20#endif /* _XTENSA_MODULE_H */
diff --git a/crypto/Kconfig b/crypto/Kconfig
index 50402dc0ea35..6563366bae80 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -1216,5 +1216,6 @@ config CRYPTO_USER_API_SKCIPHER
1216 key cipher algorithms. 1216 key cipher algorithms.
1217 1217
1218source "drivers/crypto/Kconfig" 1218source "drivers/crypto/Kconfig"
1219source crypto/asymmetric_keys/Kconfig
1219 1220
1220endif # if CRYPTO 1221endif # if CRYPTO
diff --git a/crypto/Makefile b/crypto/Makefile
index a301ad2b258c..8cf61ffe3513 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -97,3 +97,4 @@ obj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) += algif_skcipher.o
97# 97#
98obj-$(CONFIG_XOR_BLOCKS) += xor.o 98obj-$(CONFIG_XOR_BLOCKS) += xor.o
99obj-$(CONFIG_ASYNC_CORE) += async_tx/ 99obj-$(CONFIG_ASYNC_CORE) += async_tx/
100obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/
diff --git a/crypto/asymmetric_keys/.gitignore b/crypto/asymmetric_keys/.gitignore
new file mode 100644
index 000000000000..ee328374dba8
--- /dev/null
+++ b/crypto/asymmetric_keys/.gitignore
@@ -0,0 +1 @@
*-asn1.[ch]
diff --git a/crypto/asymmetric_keys/Kconfig b/crypto/asymmetric_keys/Kconfig
new file mode 100644
index 000000000000..6d2c2ea12559
--- /dev/null
+++ b/crypto/asymmetric_keys/Kconfig
@@ -0,0 +1,38 @@
1menuconfig ASYMMETRIC_KEY_TYPE
2 tristate "Asymmetric (public-key cryptographic) key type"
3 depends on KEYS
4 help
5 This option provides support for a key type that holds the data for
6 the asymmetric keys used for public key cryptographic operations such
7 as encryption, decryption, signature generation and signature
8 verification.
9
10if ASYMMETRIC_KEY_TYPE
11
12config ASYMMETRIC_PUBLIC_KEY_SUBTYPE
13 tristate "Asymmetric public-key crypto algorithm subtype"
14 select MPILIB
15 help
16 This option provides support for asymmetric public key type handling.
17 If signature generation and/or verification are to be used,
18 appropriate hash algorithms (such as SHA-1) must be available.
19 ENOPKG will be reported if the requisite algorithm is unavailable.
20
21config PUBLIC_KEY_ALGO_RSA
22 tristate "RSA public-key algorithm"
23 depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE
24 select MPILIB_EXTRA
25 help
26 This option enables support for the RSA algorithm (PKCS#1, RFC3447).
27
28config X509_CERTIFICATE_PARSER
29 tristate "X.509 certificate parser"
30 depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE
31 select ASN1
32 select OID_REGISTRY
33 help
34 This option procides support for parsing X.509 format blobs for key
35 data and provides the ability to instantiate a crypto key from a
36 public key packet found inside the certificate.
37
38endif # ASYMMETRIC_KEY_TYPE
diff --git a/crypto/asymmetric_keys/Makefile b/crypto/asymmetric_keys/Makefile
new file mode 100644
index 000000000000..0727204aab68
--- /dev/null
+++ b/crypto/asymmetric_keys/Makefile
@@ -0,0 +1,27 @@
1#
2# Makefile for asymmetric cryptographic keys
3#
4
5obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys.o
6
7asymmetric_keys-y := asymmetric_type.o signature.o
8
9obj-$(CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE) += public_key.o
10obj-$(CONFIG_PUBLIC_KEY_ALGO_RSA) += rsa.o
11
12#
13# X.509 Certificate handling
14#
15obj-$(CONFIG_X509_CERTIFICATE_PARSER) += x509_key_parser.o
16x509_key_parser-y := \
17 x509-asn1.o \
18 x509_rsakey-asn1.o \
19 x509_cert_parser.o \
20 x509_public_key.o
21
22$(obj)/x509_cert_parser.o: $(obj)/x509-asn1.h $(obj)/x509_rsakey-asn1.h
23$(obj)/x509-asn1.o: $(obj)/x509-asn1.c $(obj)/x509-asn1.h
24$(obj)/x509_rsakey-asn1.o: $(obj)/x509_rsakey-asn1.c $(obj)/x509_rsakey-asn1.h
25
26clean-files += x509-asn1.c x509-asn1.h
27clean-files += x509_rsakey-asn1.c x509_rsakey-asn1.h
diff --git a/crypto/asymmetric_keys/asymmetric_keys.h b/crypto/asymmetric_keys/asymmetric_keys.h
new file mode 100644
index 000000000000..515b63430812
--- /dev/null
+++ b/crypto/asymmetric_keys/asymmetric_keys.h
@@ -0,0 +1,15 @@
1/* Internal definitions for asymmetric key type
2 *
3 * Copyright (C) 2012 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
12static inline const char *asymmetric_key_id(const struct key *key)
13{
14 return key->type_data.p[1];
15}
diff --git a/crypto/asymmetric_keys/asymmetric_type.c b/crypto/asymmetric_keys/asymmetric_type.c
new file mode 100644
index 000000000000..cf807654d221
--- /dev/null
+++ b/crypto/asymmetric_keys/asymmetric_type.c
@@ -0,0 +1,274 @@
1/* Asymmetric public-key cryptography key type
2 *
3 * See Documentation/security/asymmetric-keys.txt
4 *
5 * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
6 * Written by David Howells (dhowells@redhat.com)
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public Licence
10 * as published by the Free Software Foundation; either version
11 * 2 of the Licence, or (at your option) any later version.
12 */
13#include <keys/asymmetric-subtype.h>
14#include <keys/asymmetric-parser.h>
15#include <linux/seq_file.h>
16#include <linux/module.h>
17#include <linux/slab.h>
18#include "asymmetric_keys.h"
19
20MODULE_LICENSE("GPL");
21
22static LIST_HEAD(asymmetric_key_parsers);
23static DECLARE_RWSEM(asymmetric_key_parsers_sem);
24
25/*
26 * Match asymmetric keys on (part of) their name
27 * We have some shorthand methods for matching keys. We allow:
28 *
29 * "<desc>" - request a key by description
30 * "id:<id>" - request a key matching the ID
31 * "<subtype>:<id>" - request a key of a subtype
32 */
33static int asymmetric_key_match(const struct key *key, const void *description)
34{
35 const struct asymmetric_key_subtype *subtype = asymmetric_key_subtype(key);
36 const char *spec = description;
37 const char *id, *kid;
38 ptrdiff_t speclen;
39 size_t idlen, kidlen;
40
41 if (!subtype || !spec || !*spec)
42 return 0;
43
44 /* See if the full key description matches as is */
45 if (key->description && strcmp(key->description, description) == 0)
46 return 1;
47
48 /* All tests from here on break the criterion description into a
49 * specifier, a colon and then an identifier.
50 */
51 id = strchr(spec, ':');
52 if (!id)
53 return 0;
54
55 speclen = id - spec;
56 id++;
57
58 /* Anything after here requires a partial match on the ID string */
59 kid = asymmetric_key_id(key);
60 if (!kid)
61 return 0;
62
63 idlen = strlen(id);
64 kidlen = strlen(kid);
65 if (idlen > kidlen)
66 return 0;
67
68 kid += kidlen - idlen;
69 if (strcasecmp(id, kid) != 0)
70 return 0;
71
72 if (speclen == 2 &&
73 memcmp(spec, "id", 2) == 0)
74 return 1;
75
76 if (speclen == subtype->name_len &&
77 memcmp(spec, subtype->name, speclen) == 0)
78 return 1;
79
80 return 0;
81}
82
83/*
84 * Describe the asymmetric key
85 */
86static void asymmetric_key_describe(const struct key *key, struct seq_file *m)
87{
88 const struct asymmetric_key_subtype *subtype = asymmetric_key_subtype(key);
89 const char *kid = asymmetric_key_id(key);
90 size_t n;
91
92 seq_puts(m, key->description);
93
94 if (subtype) {
95 seq_puts(m, ": ");
96 subtype->describe(key, m);
97
98 if (kid) {
99 seq_putc(m, ' ');
100 n = strlen(kid);
101 if (n <= 8)
102 seq_puts(m, kid);
103 else
104 seq_puts(m, kid + n - 8);
105 }
106
107 seq_puts(m, " [");
108 /* put something here to indicate the key's capabilities */
109 seq_putc(m, ']');
110 }
111}
112
113/*
114 * Preparse a asymmetric payload to get format the contents appropriately for the
115 * internal payload to cut down on the number of scans of the data performed.
116 *
117 * We also generate a proposed description from the contents of the key that
118 * can be used to name the key if the user doesn't want to provide one.
119 */
120static int asymmetric_key_preparse(struct key_preparsed_payload *prep)
121{
122 struct asymmetric_key_parser *parser;
123 int ret;
124
125 pr_devel("==>%s()\n", __func__);
126
127 if (prep->datalen == 0)
128 return -EINVAL;
129
130 down_read(&asymmetric_key_parsers_sem);
131
132 ret = -EBADMSG;
133 list_for_each_entry(parser, &asymmetric_key_parsers, link) {
134 pr_debug("Trying parser '%s'\n", parser->name);
135
136 ret = parser->parse(prep);
137 if (ret != -EBADMSG) {
138 pr_debug("Parser recognised the format (ret %d)\n",
139 ret);
140 break;
141 }
142 }
143
144 up_read(&asymmetric_key_parsers_sem);
145 pr_devel("<==%s() = %d\n", __func__, ret);
146 return ret;
147}
148
149/*
150 * Clean up the preparse data
151 */
152static void asymmetric_key_free_preparse(struct key_preparsed_payload *prep)
153{
154 struct asymmetric_key_subtype *subtype = prep->type_data[0];
155
156 pr_devel("==>%s()\n", __func__);
157
158 if (subtype) {
159 subtype->destroy(prep->payload);
160 module_put(subtype->owner);
161 }
162 kfree(prep->type_data[1]);
163 kfree(prep->description);
164}
165
166/*
167 * Instantiate a asymmetric_key defined key. The key was preparsed, so we just
168 * have to transfer the data here.
169 */
170static int asymmetric_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
171{
172 int ret;
173
174 pr_devel("==>%s()\n", __func__);
175
176 ret = key_payload_reserve(key, prep->quotalen);
177 if (ret == 0) {
178 key->type_data.p[0] = prep->type_data[0];
179 key->type_data.p[1] = prep->type_data[1];
180 key->payload.data = prep->payload;
181 prep->type_data[0] = NULL;
182 prep->type_data[1] = NULL;
183 prep->payload = NULL;
184 }
185 pr_devel("<==%s() = %d\n", __func__, ret);
186 return ret;
187}
188
189/*
190 * dispose of the data dangling from the corpse of a asymmetric key
191 */
192static void asymmetric_key_destroy(struct key *key)
193{
194 struct asymmetric_key_subtype *subtype = asymmetric_key_subtype(key);
195 if (subtype) {
196 subtype->destroy(key->payload.data);
197 module_put(subtype->owner);
198 key->type_data.p[0] = NULL;
199 }
200 kfree(key->type_data.p[1]);
201 key->type_data.p[1] = NULL;
202}
203
204struct key_type key_type_asymmetric = {
205 .name = "asymmetric",
206 .preparse = asymmetric_key_preparse,
207 .free_preparse = asymmetric_key_free_preparse,
208 .instantiate = asymmetric_key_instantiate,
209 .match = asymmetric_key_match,
210 .destroy = asymmetric_key_destroy,
211 .describe = asymmetric_key_describe,
212};
213EXPORT_SYMBOL_GPL(key_type_asymmetric);
214
215/**
216 * register_asymmetric_key_parser - Register a asymmetric key blob parser
217 * @parser: The parser to register
218 */
219int register_asymmetric_key_parser(struct asymmetric_key_parser *parser)
220{
221 struct asymmetric_key_parser *cursor;
222 int ret;
223
224 down_write(&asymmetric_key_parsers_sem);
225
226 list_for_each_entry(cursor, &asymmetric_key_parsers, link) {
227 if (strcmp(cursor->name, parser->name) == 0) {
228 pr_err("Asymmetric key parser '%s' already registered\n",
229 parser->name);
230 ret = -EEXIST;
231 goto out;
232 }
233 }
234
235 list_add_tail(&parser->link, &asymmetric_key_parsers);
236
237 pr_notice("Asymmetric key parser '%s' registered\n", parser->name);
238 ret = 0;
239
240out:
241 up_write(&asymmetric_key_parsers_sem);
242 return ret;
243}
244EXPORT_SYMBOL_GPL(register_asymmetric_key_parser);
245
246/**
247 * unregister_asymmetric_key_parser - Unregister a asymmetric key blob parser
248 * @parser: The parser to unregister
249 */
250void unregister_asymmetric_key_parser(struct asymmetric_key_parser *parser)
251{
252 down_write(&asymmetric_key_parsers_sem);
253 list_del(&parser->link);
254 up_write(&asymmetric_key_parsers_sem);
255
256 pr_notice("Asymmetric key parser '%s' unregistered\n", parser->name);
257}
258EXPORT_SYMBOL_GPL(unregister_asymmetric_key_parser);
259
260/*
261 * Module stuff
262 */
263static int __init asymmetric_key_init(void)
264{
265 return register_key_type(&key_type_asymmetric);
266}
267
268static void __exit asymmetric_key_cleanup(void)
269{
270 unregister_key_type(&key_type_asymmetric);
271}
272
273module_init(asymmetric_key_init);
274module_exit(asymmetric_key_cleanup);
diff --git a/crypto/asymmetric_keys/public_key.c b/crypto/asymmetric_keys/public_key.c
new file mode 100644
index 000000000000..cb2e29180a87
--- /dev/null
+++ b/crypto/asymmetric_keys/public_key.c
@@ -0,0 +1,108 @@
1/* In-software asymmetric public-key crypto subtype
2 *
3 * See Documentation/crypto/asymmetric-keys.txt
4 *
5 * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
6 * Written by David Howells (dhowells@redhat.com)
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public Licence
10 * as published by the Free Software Foundation; either version
11 * 2 of the Licence, or (at your option) any later version.
12 */
13
14#define pr_fmt(fmt) "PKEY: "fmt
15#include <linux/module.h>
16#include <linux/export.h>
17#include <linux/kernel.h>
18#include <linux/slab.h>
19#include <linux/seq_file.h>
20#include <keys/asymmetric-subtype.h>
21#include "public_key.h"
22
23MODULE_LICENSE("GPL");
24
25const char *const pkey_algo[PKEY_ALGO__LAST] = {
26 [PKEY_ALGO_DSA] = "DSA",
27 [PKEY_ALGO_RSA] = "RSA",
28};
29EXPORT_SYMBOL_GPL(pkey_algo);
30
31const char *const pkey_hash_algo[PKEY_HASH__LAST] = {
32 [PKEY_HASH_MD4] = "md4",
33 [PKEY_HASH_MD5] = "md5",
34 [PKEY_HASH_SHA1] = "sha1",
35 [PKEY_HASH_RIPE_MD_160] = "rmd160",
36 [PKEY_HASH_SHA256] = "sha256",
37 [PKEY_HASH_SHA384] = "sha384",
38 [PKEY_HASH_SHA512] = "sha512",
39 [PKEY_HASH_SHA224] = "sha224",
40};
41EXPORT_SYMBOL_GPL(pkey_hash_algo);
42
43const char *const pkey_id_type[PKEY_ID_TYPE__LAST] = {
44 [PKEY_ID_PGP] = "PGP",
45 [PKEY_ID_X509] = "X509",
46};
47EXPORT_SYMBOL_GPL(pkey_id_type);
48
49/*
50 * Provide a part of a description of the key for /proc/keys.
51 */
52static void public_key_describe(const struct key *asymmetric_key,
53 struct seq_file *m)
54{
55 struct public_key *key = asymmetric_key->payload.data;
56
57 if (key)
58 seq_printf(m, "%s.%s",
59 pkey_id_type[key->id_type], key->algo->name);
60}
61
62/*
63 * Destroy a public key algorithm key.
64 */
65void public_key_destroy(void *payload)
66{
67 struct public_key *key = payload;
68 int i;
69
70 if (key) {
71 for (i = 0; i < ARRAY_SIZE(key->mpi); i++)
72 mpi_free(key->mpi[i]);
73 kfree(key);
74 }
75}
76EXPORT_SYMBOL_GPL(public_key_destroy);
77
78/*
79 * Verify a signature using a public key.
80 */
81static int public_key_verify_signature(const struct key *key,
82 const struct public_key_signature *sig)
83{
84 const struct public_key *pk = key->payload.data;
85
86 if (!pk->algo->verify_signature)
87 return -ENOTSUPP;
88
89 if (sig->nr_mpi != pk->algo->n_sig_mpi) {
90 pr_debug("Signature has %u MPI not %u\n",
91 sig->nr_mpi, pk->algo->n_sig_mpi);
92 return -EINVAL;
93 }
94
95 return pk->algo->verify_signature(pk, sig);
96}
97
98/*
99 * Public key algorithm asymmetric key subtype
100 */
101struct asymmetric_key_subtype public_key_subtype = {
102 .owner = THIS_MODULE,
103 .name = "public_key",
104 .describe = public_key_describe,
105 .destroy = public_key_destroy,
106 .verify_signature = public_key_verify_signature,
107};
108EXPORT_SYMBOL_GPL(public_key_subtype);
diff --git a/crypto/asymmetric_keys/public_key.h b/crypto/asymmetric_keys/public_key.h
new file mode 100644
index 000000000000..5e5e35626899
--- /dev/null
+++ b/crypto/asymmetric_keys/public_key.h
@@ -0,0 +1,30 @@
1/* Public key algorithm internals
2 *
3 * See Documentation/crypto/asymmetric-keys.txt
4 *
5 * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
6 * Written by David Howells (dhowells@redhat.com)
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public Licence
10 * as published by the Free Software Foundation; either version
11 * 2 of the Licence, or (at your option) any later version.
12 */
13
14#include <crypto/public_key.h>
15
16extern struct asymmetric_key_subtype public_key_subtype;
17
18/*
19 * Public key algorithm definition.
20 */
21struct public_key_algorithm {
22 const char *name;
23 u8 n_pub_mpi; /* Number of MPIs in public key */
24 u8 n_sec_mpi; /* Number of MPIs in secret key */
25 u8 n_sig_mpi; /* Number of MPIs in a signature */
26 int (*verify_signature)(const struct public_key *key,
27 const struct public_key_signature *sig);
28};
29
30extern const struct public_key_algorithm RSA_public_key_algorithm;
diff --git a/crypto/asymmetric_keys/rsa.c b/crypto/asymmetric_keys/rsa.c
new file mode 100644
index 000000000000..4a6a0696f8a3
--- /dev/null
+++ b/crypto/asymmetric_keys/rsa.c
@@ -0,0 +1,277 @@
1/* RSA asymmetric public-key algorithm [RFC3447]
2 *
3 * Copyright (C) 2012 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#define pr_fmt(fmt) "RSA: "fmt
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/slab.h>
16#include "public_key.h"
17
18MODULE_LICENSE("GPL");
19MODULE_DESCRIPTION("RSA Public Key Algorithm");
20
21#define kenter(FMT, ...) \
22 pr_devel("==> %s("FMT")\n", __func__, ##__VA_ARGS__)
23#define kleave(FMT, ...) \
24 pr_devel("<== %s()"FMT"\n", __func__, ##__VA_ARGS__)
25
26/*
27 * Hash algorithm OIDs plus ASN.1 DER wrappings [RFC4880 sec 5.2.2].
28 */
29static const u8 RSA_digest_info_MD5[] = {
30 0x30, 0x20, 0x30, 0x0C, 0x06, 0x08,
31 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x02, 0x05, /* OID */
32 0x05, 0x00, 0x04, 0x10
33};
34
35static const u8 RSA_digest_info_SHA1[] = {
36 0x30, 0x21, 0x30, 0x09, 0x06, 0x05,
37 0x2B, 0x0E, 0x03, 0x02, 0x1A,
38 0x05, 0x00, 0x04, 0x14
39};
40
41static const u8 RSA_digest_info_RIPE_MD_160[] = {
42 0x30, 0x21, 0x30, 0x09, 0x06, 0x05,
43 0x2B, 0x24, 0x03, 0x02, 0x01,
44 0x05, 0x00, 0x04, 0x14
45};
46
47static const u8 RSA_digest_info_SHA224[] = {
48 0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09,
49 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04,
50 0x05, 0x00, 0x04, 0x1C
51};
52
53static const u8 RSA_digest_info_SHA256[] = {
54 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09,
55 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01,
56 0x05, 0x00, 0x04, 0x20
57};
58
59static const u8 RSA_digest_info_SHA384[] = {
60 0x30, 0x41, 0x30, 0x0d, 0x06, 0x09,
61 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02,
62 0x05, 0x00, 0x04, 0x30
63};
64
65static const u8 RSA_digest_info_SHA512[] = {
66 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09,
67 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03,
68 0x05, 0x00, 0x04, 0x40
69};
70
71static const struct {
72 const u8 *data;
73 size_t size;
74} RSA_ASN1_templates[PKEY_HASH__LAST] = {
75#define _(X) { RSA_digest_info_##X, sizeof(RSA_digest_info_##X) }
76 [PKEY_HASH_MD5] = _(MD5),
77 [PKEY_HASH_SHA1] = _(SHA1),
78 [PKEY_HASH_RIPE_MD_160] = _(RIPE_MD_160),
79 [PKEY_HASH_SHA256] = _(SHA256),
80 [PKEY_HASH_SHA384] = _(SHA384),
81 [PKEY_HASH_SHA512] = _(SHA512),
82 [PKEY_HASH_SHA224] = _(SHA224),
83#undef _
84};
85
86/*
87 * RSAVP1() function [RFC3447 sec 5.2.2]
88 */
89static int RSAVP1(const struct public_key *key, MPI s, MPI *_m)
90{
91 MPI m;
92 int ret;
93
94 /* (1) Validate 0 <= s < n */
95 if (mpi_cmp_ui(s, 0) < 0) {
96 kleave(" = -EBADMSG [s < 0]");
97 return -EBADMSG;
98 }
99 if (mpi_cmp(s, key->rsa.n) >= 0) {
100 kleave(" = -EBADMSG [s >= n]");
101 return -EBADMSG;
102 }
103
104 m = mpi_alloc(0);
105 if (!m)
106 return -ENOMEM;
107
108 /* (2) m = s^e mod n */
109 ret = mpi_powm(m, s, key->rsa.e, key->rsa.n);
110 if (ret < 0) {
111 mpi_free(m);
112 return ret;
113 }
114
115 *_m = m;
116 return 0;
117}
118
119/*
120 * Integer to Octet String conversion [RFC3447 sec 4.1]
121 */
122static int RSA_I2OSP(MPI x, size_t xLen, u8 **_X)
123{
124 unsigned X_size, x_size;
125 int X_sign;
126 u8 *X;
127
128 /* Make sure the string is the right length. The number should begin
129 * with { 0x00, 0x01, ... } so we have to account for 15 leading zero
130 * bits not being reported by MPI.
131 */
132 x_size = mpi_get_nbits(x);
133 pr_devel("size(x)=%u xLen*8=%zu\n", x_size, xLen * 8);
134 if (x_size != xLen * 8 - 15)
135 return -ERANGE;
136
137 X = mpi_get_buffer(x, &X_size, &X_sign);
138 if (!X)
139 return -ENOMEM;
140 if (X_sign < 0) {
141 kfree(X);
142 return -EBADMSG;
143 }
144 if (X_size != xLen - 1) {
145 kfree(X);
146 return -EBADMSG;
147 }
148
149 *_X = X;
150 return 0;
151}
152
153/*
154 * Perform the RSA signature verification.
155 * @H: Value of hash of data and metadata
156 * @EM: The computed signature value
157 * @k: The size of EM (EM[0] is an invalid location but should hold 0x00)
158 * @hash_size: The size of H
159 * @asn1_template: The DigestInfo ASN.1 template
160 * @asn1_size: Size of asm1_template[]
161 */
162static int RSA_verify(const u8 *H, const u8 *EM, size_t k, size_t hash_size,
163 const u8 *asn1_template, size_t asn1_size)
164{
165 unsigned PS_end, T_offset, i;
166
167 kenter(",,%zu,%zu,%zu", k, hash_size, asn1_size);
168
169 if (k < 2 + 1 + asn1_size + hash_size)
170 return -EBADMSG;
171
172 /* Decode the EMSA-PKCS1-v1_5 */
173 if (EM[1] != 0x01) {
174 kleave(" = -EBADMSG [EM[1] == %02u]", EM[1]);
175 return -EBADMSG;
176 }
177
178 T_offset = k - (asn1_size + hash_size);
179 PS_end = T_offset - 1;
180 if (EM[PS_end] != 0x00) {
181 kleave(" = -EBADMSG [EM[T-1] == %02u]", EM[PS_end]);
182 return -EBADMSG;
183 }
184
185 for (i = 2; i < PS_end; i++) {
186 if (EM[i] != 0xff) {
187 kleave(" = -EBADMSG [EM[PS%x] == %02u]", i - 2, EM[i]);
188 return -EBADMSG;
189 }
190 }
191
192 if (memcmp(asn1_template, EM + T_offset, asn1_size) != 0) {
193 kleave(" = -EBADMSG [EM[T] ASN.1 mismatch]");
194 return -EBADMSG;
195 }
196
197 if (memcmp(H, EM + T_offset + asn1_size, hash_size) != 0) {
198 kleave(" = -EKEYREJECTED [EM[T] hash mismatch]");
199 return -EKEYREJECTED;
200 }
201
202 kleave(" = 0");
203 return 0;
204}
205
206/*
207 * Perform the verification step [RFC3447 sec 8.2.2].
208 */
209static int RSA_verify_signature(const struct public_key *key,
210 const struct public_key_signature *sig)
211{
212 size_t tsize;
213 int ret;
214
215 /* Variables as per RFC3447 sec 8.2.2 */
216 const u8 *H = sig->digest;
217 u8 *EM = NULL;
218 MPI m = NULL;
219 size_t k;
220
221 kenter("");
222
223 if (!RSA_ASN1_templates[sig->pkey_hash_algo].data)
224 return -ENOTSUPP;
225
226 /* (1) Check the signature size against the public key modulus size */
227 k = mpi_get_nbits(key->rsa.n);
228 tsize = mpi_get_nbits(sig->rsa.s);
229
230 /* According to RFC 4880 sec 3.2, length of MPI is computed starting
231 * from most significant bit. So the RFC 3447 sec 8.2.2 size check
232 * must be relaxed to conform with shorter signatures - so we fail here
233 * only if signature length is longer than modulus size.
234 */
235 pr_devel("step 1: k=%zu size(S)=%zu\n", k, tsize);
236 if (k < tsize) {
237 ret = -EBADMSG;
238 goto error;
239 }
240
241 /* Round up and convert to octets */
242 k = (k + 7) / 8;
243
244 /* (2b) Apply the RSAVP1 verification primitive to the public key */
245 ret = RSAVP1(key, sig->rsa.s, &m);
246 if (ret < 0)
247 goto error;
248
249 /* (2c) Convert the message representative (m) to an encoded message
250 * (EM) of length k octets.
251 *
252 * NOTE! The leading zero byte is suppressed by MPI, so we pass a
253 * pointer to the _preceding_ byte to RSA_verify()!
254 */
255 ret = RSA_I2OSP(m, k, &EM);
256 if (ret < 0)
257 goto error;
258
259 ret = RSA_verify(H, EM - 1, k, sig->digest_size,
260 RSA_ASN1_templates[sig->pkey_hash_algo].data,
261 RSA_ASN1_templates[sig->pkey_hash_algo].size);
262
263error:
264 kfree(EM);
265 mpi_free(m);
266 kleave(" = %d", ret);
267 return ret;
268}
269
270const struct public_key_algorithm RSA_public_key_algorithm = {
271 .name = "RSA",
272 .n_pub_mpi = 2,
273 .n_sec_mpi = 3,
274 .n_sig_mpi = 1,
275 .verify_signature = RSA_verify_signature,
276};
277EXPORT_SYMBOL_GPL(RSA_public_key_algorithm);
diff --git a/crypto/asymmetric_keys/signature.c b/crypto/asymmetric_keys/signature.c
new file mode 100644
index 000000000000..50b3f880b4ff
--- /dev/null
+++ b/crypto/asymmetric_keys/signature.c
@@ -0,0 +1,49 @@
1/* Signature verification with an asymmetric key
2 *
3 * See Documentation/security/asymmetric-keys.txt
4 *
5 * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
6 * Written by David Howells (dhowells@redhat.com)
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public Licence
10 * as published by the Free Software Foundation; either version
11 * 2 of the Licence, or (at your option) any later version.
12 */
13
14#include <keys/asymmetric-subtype.h>
15#include <linux/module.h>
16#include <linux/err.h>
17#include <crypto/public_key.h>
18#include "asymmetric_keys.h"
19
20/**
21 * verify_signature - Initiate the use of an asymmetric key to verify a signature
22 * @key: The asymmetric key to verify against
23 * @sig: The signature to check
24 *
25 * Returns 0 if successful or else an error.
26 */
27int verify_signature(const struct key *key,
28 const struct public_key_signature *sig)
29{
30 const struct asymmetric_key_subtype *subtype;
31 int ret;
32
33 pr_devel("==>%s()\n", __func__);
34
35 if (key->type != &key_type_asymmetric)
36 return -EINVAL;
37 subtype = asymmetric_key_subtype(key);
38 if (!subtype ||
39 !key->payload.data)
40 return -EINVAL;
41 if (!subtype->verify_signature)
42 return -ENOTSUPP;
43
44 ret = subtype->verify_signature(key, sig);
45
46 pr_devel("<==%s() = %d\n", __func__, ret);
47 return ret;
48}
49EXPORT_SYMBOL_GPL(verify_signature);
diff --git a/crypto/asymmetric_keys/x509.asn1 b/crypto/asymmetric_keys/x509.asn1
new file mode 100644
index 000000000000..bf32b3dff088
--- /dev/null
+++ b/crypto/asymmetric_keys/x509.asn1
@@ -0,0 +1,60 @@
1Certificate ::= SEQUENCE {
2 tbsCertificate TBSCertificate ({ x509_note_tbs_certificate }),
3 signatureAlgorithm AlgorithmIdentifier,
4 signature BIT STRING ({ x509_note_signature })
5 }
6
7TBSCertificate ::= SEQUENCE {
8 version [ 0 ] Version DEFAULT,
9 serialNumber CertificateSerialNumber,
10 signature AlgorithmIdentifier ({ x509_note_pkey_algo }),
11 issuer Name ({ x509_note_issuer }),
12 validity Validity,
13 subject Name ({ x509_note_subject }),
14 subjectPublicKeyInfo SubjectPublicKeyInfo,
15 issuerUniqueID [ 1 ] IMPLICIT UniqueIdentifier OPTIONAL,
16 subjectUniqueID [ 2 ] IMPLICIT UniqueIdentifier OPTIONAL,
17 extensions [ 3 ] Extensions OPTIONAL
18 }
19
20Version ::= INTEGER
21CertificateSerialNumber ::= INTEGER
22
23AlgorithmIdentifier ::= SEQUENCE {
24 algorithm OBJECT IDENTIFIER ({ x509_note_OID }),
25 parameters ANY OPTIONAL
26}
27
28Name ::= SEQUENCE OF RelativeDistinguishedName
29
30RelativeDistinguishedName ::= SET OF AttributeValueAssertion
31
32AttributeValueAssertion ::= SEQUENCE {
33 attributeType OBJECT IDENTIFIER ({ x509_note_OID }),
34 attributeValue ANY ({ x509_extract_name_segment })
35 }
36
37Validity ::= SEQUENCE {
38 notBefore Time ({ x509_note_not_before }),
39 notAfter Time ({ x509_note_not_after })
40 }
41
42Time ::= CHOICE {
43 utcTime UTCTime,
44 generalTime GeneralizedTime
45 }
46
47SubjectPublicKeyInfo ::= SEQUENCE {
48 algorithm AlgorithmIdentifier,
49 subjectPublicKey BIT STRING ({ x509_extract_key_data })
50 }
51
52UniqueIdentifier ::= BIT STRING
53
54Extensions ::= SEQUENCE OF Extension
55
56Extension ::= SEQUENCE {
57 extnid OBJECT IDENTIFIER ({ x509_note_OID }),
58 critical BOOLEAN DEFAULT,
59 extnValue OCTET STRING ({ x509_process_extension })
60 }
diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c
new file mode 100644
index 000000000000..7fabc4c01993
--- /dev/null
+++ b/crypto/asymmetric_keys/x509_cert_parser.c
@@ -0,0 +1,496 @@
1/* X.509 certificate parser
2 *
3 * Copyright (C) 2012 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#define pr_fmt(fmt) "X.509: "fmt
13#include <linux/kernel.h>
14#include <linux/slab.h>
15#include <linux/err.h>
16#include <linux/oid_registry.h>
17#include "public_key.h"
18#include "x509_parser.h"
19#include "x509-asn1.h"
20#include "x509_rsakey-asn1.h"
21
22struct x509_parse_context {
23 struct x509_certificate *cert; /* Certificate being constructed */
24 unsigned long data; /* Start of data */
25 const void *cert_start; /* Start of cert content */
26 const void *key; /* Key data */
27 size_t key_size; /* Size of key data */
28 enum OID last_oid; /* Last OID encountered */
29 enum OID algo_oid; /* Algorithm OID */
30 unsigned char nr_mpi; /* Number of MPIs stored */
31 u8 o_size; /* Size of organizationName (O) */
32 u8 cn_size; /* Size of commonName (CN) */
33 u8 email_size; /* Size of emailAddress */
34 u16 o_offset; /* Offset of organizationName (O) */
35 u16 cn_offset; /* Offset of commonName (CN) */
36 u16 email_offset; /* Offset of emailAddress */
37};
38
39/*
40 * Free an X.509 certificate
41 */
42void x509_free_certificate(struct x509_certificate *cert)
43{
44 if (cert) {
45 public_key_destroy(cert->pub);
46 kfree(cert->issuer);
47 kfree(cert->subject);
48 kfree(cert->fingerprint);
49 kfree(cert->authority);
50 kfree(cert);
51 }
52}
53
54/*
55 * Parse an X.509 certificate
56 */
57struct x509_certificate *x509_cert_parse(const void *data, size_t datalen)
58{
59 struct x509_certificate *cert;
60 struct x509_parse_context *ctx;
61 long ret;
62
63 ret = -ENOMEM;
64 cert = kzalloc(sizeof(struct x509_certificate), GFP_KERNEL);
65 if (!cert)
66 goto error_no_cert;
67 cert->pub = kzalloc(sizeof(struct public_key), GFP_KERNEL);
68 if (!cert->pub)
69 goto error_no_ctx;
70 ctx = kzalloc(sizeof(struct x509_parse_context), GFP_KERNEL);
71 if (!ctx)
72 goto error_no_ctx;
73
74 ctx->cert = cert;
75 ctx->data = (unsigned long)data;
76
77 /* Attempt to decode the certificate */
78 ret = asn1_ber_decoder(&x509_decoder, ctx, data, datalen);
79 if (ret < 0)
80 goto error_decode;
81
82 /* Decode the public key */
83 ret = asn1_ber_decoder(&x509_rsakey_decoder, ctx,
84 ctx->key, ctx->key_size);
85 if (ret < 0)
86 goto error_decode;
87
88 kfree(ctx);
89 return cert;
90
91error_decode:
92 kfree(ctx);
93error_no_ctx:
94 x509_free_certificate(cert);
95error_no_cert:
96 return ERR_PTR(ret);
97}
98
99/*
100 * Note an OID when we find one for later processing when we know how
101 * to interpret it.
102 */
103int x509_note_OID(void *context, size_t hdrlen,
104 unsigned char tag,
105 const void *value, size_t vlen)
106{
107 struct x509_parse_context *ctx = context;
108
109 ctx->last_oid = look_up_OID(value, vlen);
110 if (ctx->last_oid == OID__NR) {
111 char buffer[50];
112 sprint_oid(value, vlen, buffer, sizeof(buffer));
113 pr_debug("Unknown OID: [%lu] %s\n",
114 (unsigned long)value - ctx->data, buffer);
115 }
116 return 0;
117}
118
119/*
120 * Save the position of the TBS data so that we can check the signature over it
121 * later.
122 */
123int x509_note_tbs_certificate(void *context, size_t hdrlen,
124 unsigned char tag,
125 const void *value, size_t vlen)
126{
127 struct x509_parse_context *ctx = context;
128
129 pr_debug("x509_note_tbs_certificate(,%zu,%02x,%ld,%zu)!\n",
130 hdrlen, tag, (unsigned long)value - ctx->data, vlen);
131
132 ctx->cert->tbs = value - hdrlen;
133 ctx->cert->tbs_size = vlen + hdrlen;
134 return 0;
135}
136
137/*
138 * Record the public key algorithm
139 */
140int x509_note_pkey_algo(void *context, size_t hdrlen,
141 unsigned char tag,
142 const void *value, size_t vlen)
143{
144 struct x509_parse_context *ctx = context;
145
146 pr_debug("PubKey Algo: %u\n", ctx->last_oid);
147
148 switch (ctx->last_oid) {
149 case OID_md2WithRSAEncryption:
150 case OID_md3WithRSAEncryption:
151 default:
152 return -ENOPKG; /* Unsupported combination */
153
154 case OID_md4WithRSAEncryption:
155 ctx->cert->sig_hash_algo = PKEY_HASH_MD5;
156 ctx->cert->sig_pkey_algo = PKEY_ALGO_RSA;
157 break;
158
159 case OID_sha1WithRSAEncryption:
160 ctx->cert->sig_hash_algo = PKEY_HASH_SHA1;
161 ctx->cert->sig_pkey_algo = PKEY_ALGO_RSA;
162 break;
163
164 case OID_sha256WithRSAEncryption:
165 ctx->cert->sig_hash_algo = PKEY_HASH_SHA256;
166 ctx->cert->sig_pkey_algo = PKEY_ALGO_RSA;
167 break;
168
169 case OID_sha384WithRSAEncryption:
170 ctx->cert->sig_hash_algo = PKEY_HASH_SHA384;
171 ctx->cert->sig_pkey_algo = PKEY_ALGO_RSA;
172 break;
173
174 case OID_sha512WithRSAEncryption:
175 ctx->cert->sig_hash_algo = PKEY_HASH_SHA512;
176 ctx->cert->sig_pkey_algo = PKEY_ALGO_RSA;
177 break;
178
179 case OID_sha224WithRSAEncryption:
180 ctx->cert->sig_hash_algo = PKEY_HASH_SHA224;
181 ctx->cert->sig_pkey_algo = PKEY_ALGO_RSA;
182 break;
183 }
184
185 ctx->algo_oid = ctx->last_oid;
186 return 0;
187}
188
189/*
190 * Note the whereabouts and type of the signature.
191 */
192int x509_note_signature(void *context, size_t hdrlen,
193 unsigned char tag,
194 const void *value, size_t vlen)
195{
196 struct x509_parse_context *ctx = context;
197
198 pr_debug("Signature type: %u size %zu\n", ctx->last_oid, vlen);
199
200 if (ctx->last_oid != ctx->algo_oid) {
201 pr_warn("Got cert with pkey (%u) and sig (%u) algorithm OIDs\n",
202 ctx->algo_oid, ctx->last_oid);
203 return -EINVAL;
204 }
205
206 ctx->cert->sig = value;
207 ctx->cert->sig_size = vlen;
208 return 0;
209}
210
211/*
212 * Note some of the name segments from which we'll fabricate a name.
213 */
214int x509_extract_name_segment(void *context, size_t hdrlen,
215 unsigned char tag,
216 const void *value, size_t vlen)
217{
218 struct x509_parse_context *ctx = context;
219
220 switch (ctx->last_oid) {
221 case OID_commonName:
222 ctx->cn_size = vlen;
223 ctx->cn_offset = (unsigned long)value - ctx->data;
224 break;
225 case OID_organizationName:
226 ctx->o_size = vlen;
227 ctx->o_offset = (unsigned long)value - ctx->data;
228 break;
229 case OID_email_address:
230 ctx->email_size = vlen;
231 ctx->email_offset = (unsigned long)value - ctx->data;
232 break;
233 default:
234 break;
235 }
236
237 return 0;
238}
239
240/*
241 * Fabricate and save the issuer and subject names
242 */
243static int x509_fabricate_name(struct x509_parse_context *ctx, size_t hdrlen,
244 unsigned char tag,
245 char **_name, size_t vlen)
246{
247 const void *name, *data = (const void *)ctx->data;
248 size_t namesize;
249 char *buffer;
250
251 if (*_name)
252 return -EINVAL;
253
254 /* Empty name string if no material */
255 if (!ctx->cn_size && !ctx->o_size && !ctx->email_size) {
256 buffer = kmalloc(1, GFP_KERNEL);
257 if (!buffer)
258 return -ENOMEM;
259 buffer[0] = 0;
260 goto done;
261 }
262
263 if (ctx->cn_size && ctx->o_size) {
264 /* Consider combining O and CN, but use only the CN if it is
265 * prefixed by the O, or a significant portion thereof.
266 */
267 namesize = ctx->cn_size;
268 name = data + ctx->cn_offset;
269 if (ctx->cn_size >= ctx->o_size &&
270 memcmp(data + ctx->cn_offset, data + ctx->o_offset,
271 ctx->o_size) == 0)
272 goto single_component;
273 if (ctx->cn_size >= 7 &&
274 ctx->o_size >= 7 &&
275 memcmp(data + ctx->cn_offset, data + ctx->o_offset, 7) == 0)
276 goto single_component;
277
278 buffer = kmalloc(ctx->o_size + 2 + ctx->cn_size + 1,
279 GFP_KERNEL);
280 if (!buffer)
281 return -ENOMEM;
282
283 memcpy(buffer,
284 data + ctx->o_offset, ctx->o_size);
285 buffer[ctx->o_size + 0] = ':';
286 buffer[ctx->o_size + 1] = ' ';
287 memcpy(buffer + ctx->o_size + 2,
288 data + ctx->cn_offset, ctx->cn_size);
289 buffer[ctx->o_size + 2 + ctx->cn_size] = 0;
290 goto done;
291
292 } else if (ctx->cn_size) {
293 namesize = ctx->cn_size;
294 name = data + ctx->cn_offset;
295 } else if (ctx->o_size) {
296 namesize = ctx->o_size;
297 name = data + ctx->o_offset;
298 } else {
299 namesize = ctx->email_size;
300 name = data + ctx->email_offset;
301 }
302
303single_component:
304 buffer = kmalloc(namesize + 1, GFP_KERNEL);
305 if (!buffer)
306 return -ENOMEM;
307 memcpy(buffer, name, namesize);
308 buffer[namesize] = 0;
309
310done:
311 *_name = buffer;
312 ctx->cn_size = 0;
313 ctx->o_size = 0;
314 ctx->email_size = 0;
315 return 0;
316}
317
318int x509_note_issuer(void *context, size_t hdrlen,
319 unsigned char tag,
320 const void *value, size_t vlen)
321{
322 struct x509_parse_context *ctx = context;
323 return x509_fabricate_name(ctx, hdrlen, tag, &ctx->cert->issuer, vlen);
324}
325
326int x509_note_subject(void *context, size_t hdrlen,
327 unsigned char tag,
328 const void *value, size_t vlen)
329{
330 struct x509_parse_context *ctx = context;
331 return x509_fabricate_name(ctx, hdrlen, tag, &ctx->cert->subject, vlen);
332}
333
334/*
335 * Extract the data for the public key algorithm
336 */
337int x509_extract_key_data(void *context, size_t hdrlen,
338 unsigned char tag,
339 const void *value, size_t vlen)
340{
341 struct x509_parse_context *ctx = context;
342
343 if (ctx->last_oid != OID_rsaEncryption)
344 return -ENOPKG;
345
346 /* There seems to be an extraneous 0 byte on the front of the data */
347 ctx->cert->pkey_algo = PKEY_ALGO_RSA;
348 ctx->key = value + 1;
349 ctx->key_size = vlen - 1;
350 return 0;
351}
352
353/*
354 * Extract a RSA public key value
355 */
356int rsa_extract_mpi(void *context, size_t hdrlen,
357 unsigned char tag,
358 const void *value, size_t vlen)
359{
360 struct x509_parse_context *ctx = context;
361 MPI mpi;
362
363 if (ctx->nr_mpi >= ARRAY_SIZE(ctx->cert->pub->mpi)) {
364 pr_err("Too many public key MPIs in certificate\n");
365 return -EBADMSG;
366 }
367
368 mpi = mpi_read_raw_data(value, vlen);
369 if (!mpi)
370 return -ENOMEM;
371
372 ctx->cert->pub->mpi[ctx->nr_mpi++] = mpi;
373 return 0;
374}
375
376/*
377 * Process certificate extensions that are used to qualify the certificate.
378 */
379int x509_process_extension(void *context, size_t hdrlen,
380 unsigned char tag,
381 const void *value, size_t vlen)
382{
383 struct x509_parse_context *ctx = context;
384 const unsigned char *v = value;
385 char *f;
386 int i;
387
388 pr_debug("Extension: %u\n", ctx->last_oid);
389
390 if (ctx->last_oid == OID_subjectKeyIdentifier) {
391 /* Get hold of the key fingerprint */
392 if (vlen < 3)
393 return -EBADMSG;
394 if (v[0] != ASN1_OTS || v[1] != vlen - 2)
395 return -EBADMSG;
396 v += 2;
397 vlen -= 2;
398
399 f = kmalloc(vlen * 2 + 1, GFP_KERNEL);
400 if (!f)
401 return -ENOMEM;
402 for (i = 0; i < vlen; i++)
403 sprintf(f + i * 2, "%02x", v[i]);
404 pr_debug("fingerprint %s\n", f);
405 ctx->cert->fingerprint = f;
406 return 0;
407 }
408
409 if (ctx->last_oid == OID_authorityKeyIdentifier) {
410 /* Get hold of the CA key fingerprint */
411 if (vlen < 5)
412 return -EBADMSG;
413 if (v[0] != (ASN1_SEQ | (ASN1_CONS << 5)) ||
414 v[1] != vlen - 2 ||
415 v[2] != (ASN1_CONT << 6) ||
416 v[3] != vlen - 4)
417 return -EBADMSG;
418 v += 4;
419 vlen -= 4;
420
421 f = kmalloc(vlen * 2 + 1, GFP_KERNEL);
422 if (!f)
423 return -ENOMEM;
424 for (i = 0; i < vlen; i++)
425 sprintf(f + i * 2, "%02x", v[i]);
426 pr_debug("authority %s\n", f);
427 ctx->cert->authority = f;
428 return 0;
429 }
430
431 return 0;
432}
433
434/*
435 * Record a certificate time.
436 */
437static int x509_note_time(struct tm *tm, size_t hdrlen,
438 unsigned char tag,
439 const unsigned char *value, size_t vlen)
440{
441 const unsigned char *p = value;
442
443#define dec2bin(X) ((X) - '0')
444#define DD2bin(P) ({ unsigned x = dec2bin(P[0]) * 10 + dec2bin(P[1]); P += 2; x; })
445
446 if (tag == ASN1_UNITIM) {
447 /* UTCTime: YYMMDDHHMMSSZ */
448 if (vlen != 13)
449 goto unsupported_time;
450 tm->tm_year = DD2bin(p);
451 if (tm->tm_year >= 50)
452 tm->tm_year += 1900;
453 else
454 tm->tm_year += 2000;
455 } else if (tag == ASN1_GENTIM) {
456 /* GenTime: YYYYMMDDHHMMSSZ */
457 if (vlen != 15)
458 goto unsupported_time;
459 tm->tm_year = DD2bin(p) * 100 + DD2bin(p);
460 } else {
461 goto unsupported_time;
462 }
463
464 tm->tm_year -= 1900;
465 tm->tm_mon = DD2bin(p) - 1;
466 tm->tm_mday = DD2bin(p);
467 tm->tm_hour = DD2bin(p);
468 tm->tm_min = DD2bin(p);
469 tm->tm_sec = DD2bin(p);
470
471 if (*p != 'Z')
472 goto unsupported_time;
473
474 return 0;
475
476unsupported_time:
477 pr_debug("Got unsupported time [tag %02x]: '%*.*s'\n",
478 tag, (int)vlen, (int)vlen, value);
479 return -EBADMSG;
480}
481
482int x509_note_not_before(void *context, size_t hdrlen,
483 unsigned char tag,
484 const void *value, size_t vlen)
485{
486 struct x509_parse_context *ctx = context;
487 return x509_note_time(&ctx->cert->valid_from, hdrlen, tag, value, vlen);
488}
489
490int x509_note_not_after(void *context, size_t hdrlen,
491 unsigned char tag,
492 const void *value, size_t vlen)
493{
494 struct x509_parse_context *ctx = context;
495 return x509_note_time(&ctx->cert->valid_to, hdrlen, tag, value, vlen);
496}
diff --git a/crypto/asymmetric_keys/x509_parser.h b/crypto/asymmetric_keys/x509_parser.h
new file mode 100644
index 000000000000..f86dc5fcc4ad
--- /dev/null
+++ b/crypto/asymmetric_keys/x509_parser.h
@@ -0,0 +1,36 @@
1/* X.509 certificate parser internal definitions
2 *
3 * Copyright (C) 2012 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#include <crypto/public_key.h>
13
14struct x509_certificate {
15 struct x509_certificate *next;
16 struct public_key *pub; /* Public key details */
17 char *issuer; /* Name of certificate issuer */
18 char *subject; /* Name of certificate subject */
19 char *fingerprint; /* Key fingerprint as hex */
20 char *authority; /* Authority key fingerprint as hex */
21 struct tm valid_from;
22 struct tm valid_to;
23 enum pkey_algo pkey_algo : 8; /* Public key algorithm */
24 enum pkey_algo sig_pkey_algo : 8; /* Signature public key algorithm */
25 enum pkey_hash_algo sig_hash_algo : 8; /* Signature hash algorithm */
26 const void *tbs; /* Signed data */
27 size_t tbs_size; /* Size of signed data */
28 const void *sig; /* Signature data */
29 size_t sig_size; /* Size of sigature */
30};
31
32/*
33 * x509_cert_parser.c
34 */
35extern void x509_free_certificate(struct x509_certificate *cert);
36extern struct x509_certificate *x509_cert_parse(const void *data, size_t datalen);
diff --git a/crypto/asymmetric_keys/x509_public_key.c b/crypto/asymmetric_keys/x509_public_key.c
new file mode 100644
index 000000000000..06007f0e880c
--- /dev/null
+++ b/crypto/asymmetric_keys/x509_public_key.c
@@ -0,0 +1,239 @@
1/* Instantiate a public key crypto key from an X.509 Certificate
2 *
3 * Copyright (C) 2012 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#define pr_fmt(fmt) "X.509: "fmt
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/slab.h>
16#include <linux/err.h>
17#include <linux/mpi.h>
18#include <linux/asn1_decoder.h>
19#include <keys/asymmetric-subtype.h>
20#include <keys/asymmetric-parser.h>
21#include <crypto/hash.h>
22#include "asymmetric_keys.h"
23#include "public_key.h"
24#include "x509_parser.h"
25
26static const
27struct public_key_algorithm *x509_public_key_algorithms[PKEY_ALGO__LAST] = {
28 [PKEY_ALGO_DSA] = NULL,
29#if defined(CONFIG_PUBLIC_KEY_ALGO_RSA) || \
30 defined(CONFIG_PUBLIC_KEY_ALGO_RSA_MODULE)
31 [PKEY_ALGO_RSA] = &RSA_public_key_algorithm,
32#endif
33};
34
35/*
36 * Check the signature on a certificate using the provided public key
37 */
38static int x509_check_signature(const struct public_key *pub,
39 const struct x509_certificate *cert)
40{
41 struct public_key_signature *sig;
42 struct crypto_shash *tfm;
43 struct shash_desc *desc;
44 size_t digest_size, desc_size;
45 int ret;
46
47 pr_devel("==>%s()\n", __func__);
48
49 /* Allocate the hashing algorithm we're going to need and find out how
50 * big the hash operational data will be.
51 */
52 tfm = crypto_alloc_shash(pkey_hash_algo[cert->sig_hash_algo], 0, 0);
53 if (IS_ERR(tfm))
54 return (PTR_ERR(tfm) == -ENOENT) ? -ENOPKG : PTR_ERR(tfm);
55
56 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc);
57 digest_size = crypto_shash_digestsize(tfm);
58
59 /* We allocate the hash operational data storage on the end of our
60 * context data.
61 */
62 ret = -ENOMEM;
63 sig = kzalloc(sizeof(*sig) + desc_size + digest_size, GFP_KERNEL);
64 if (!sig)
65 goto error_no_sig;
66
67 sig->pkey_hash_algo = cert->sig_hash_algo;
68 sig->digest = (u8 *)sig + sizeof(*sig) + desc_size;
69 sig->digest_size = digest_size;
70
71 desc = (void *)sig + sizeof(*sig);
72 desc->tfm = tfm;
73 desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
74
75 ret = crypto_shash_init(desc);
76 if (ret < 0)
77 goto error;
78
79 ret = -ENOMEM;
80 sig->rsa.s = mpi_read_raw_data(cert->sig, cert->sig_size);
81 if (!sig->rsa.s)
82 goto error;
83
84 ret = crypto_shash_finup(desc, cert->tbs, cert->tbs_size, sig->digest);
85 if (ret < 0)
86 goto error_mpi;
87
88 ret = pub->algo->verify_signature(pub, sig);
89
90 pr_debug("Cert Verification: %d\n", ret);
91
92error_mpi:
93 mpi_free(sig->rsa.s);
94error:
95 kfree(sig);
96error_no_sig:
97 crypto_free_shash(tfm);
98
99 pr_devel("<==%s() = %d\n", __func__, ret);
100 return ret;
101}
102
103/*
104 * Attempt to parse a data blob for a key as an X509 certificate.
105 */
106static int x509_key_preparse(struct key_preparsed_payload *prep)
107{
108 struct x509_certificate *cert;
109 struct tm now;
110 size_t srlen, sulen;
111 char *desc = NULL;
112 int ret;
113
114 cert = x509_cert_parse(prep->data, prep->datalen);
115 if (IS_ERR(cert))
116 return PTR_ERR(cert);
117
118 pr_devel("Cert Issuer: %s\n", cert->issuer);
119 pr_devel("Cert Subject: %s\n", cert->subject);
120 pr_devel("Cert Key Algo: %s\n", pkey_algo[cert->pkey_algo]);
121 pr_devel("Cert Valid From: %04ld-%02d-%02d %02d:%02d:%02d\n",
122 cert->valid_from.tm_year + 1900, cert->valid_from.tm_mon + 1,
123 cert->valid_from.tm_mday, cert->valid_from.tm_hour,
124 cert->valid_from.tm_min, cert->valid_from.tm_sec);
125 pr_devel("Cert Valid To: %04ld-%02d-%02d %02d:%02d:%02d\n",
126 cert->valid_to.tm_year + 1900, cert->valid_to.tm_mon + 1,
127 cert->valid_to.tm_mday, cert->valid_to.tm_hour,
128 cert->valid_to.tm_min, cert->valid_to.tm_sec);
129 pr_devel("Cert Signature: %s + %s\n",
130 pkey_algo[cert->sig_pkey_algo],
131 pkey_hash_algo[cert->sig_hash_algo]);
132
133 if (!cert->fingerprint || !cert->authority) {
134 pr_warn("Cert for '%s' must have SubjKeyId and AuthKeyId extensions\n",
135 cert->subject);
136 ret = -EKEYREJECTED;
137 goto error_free_cert;
138 }
139
140 time_to_tm(CURRENT_TIME.tv_sec, 0, &now);
141 pr_devel("Now: %04ld-%02d-%02d %02d:%02d:%02d\n",
142 now.tm_year + 1900, now.tm_mon + 1, now.tm_mday,
143 now.tm_hour, now.tm_min, now.tm_sec);
144 if (now.tm_year < cert->valid_from.tm_year ||
145 (now.tm_year == cert->valid_from.tm_year &&
146 (now.tm_mon < cert->valid_from.tm_mon ||
147 (now.tm_mon == cert->valid_from.tm_mon &&
148 (now.tm_mday < cert->valid_from.tm_mday ||
149 (now.tm_mday == cert->valid_from.tm_mday &&
150 (now.tm_hour < cert->valid_from.tm_hour ||
151 (now.tm_hour == cert->valid_from.tm_hour &&
152 (now.tm_min < cert->valid_from.tm_min ||
153 (now.tm_min == cert->valid_from.tm_min &&
154 (now.tm_sec < cert->valid_from.tm_sec
155 ))))))))))) {
156 pr_warn("Cert %s is not yet valid\n", cert->fingerprint);
157 ret = -EKEYREJECTED;
158 goto error_free_cert;
159 }
160 if (now.tm_year > cert->valid_to.tm_year ||
161 (now.tm_year == cert->valid_to.tm_year &&
162 (now.tm_mon > cert->valid_to.tm_mon ||
163 (now.tm_mon == cert->valid_to.tm_mon &&
164 (now.tm_mday > cert->valid_to.tm_mday ||
165 (now.tm_mday == cert->valid_to.tm_mday &&
166 (now.tm_hour > cert->valid_to.tm_hour ||
167 (now.tm_hour == cert->valid_to.tm_hour &&
168 (now.tm_min > cert->valid_to.tm_min ||
169 (now.tm_min == cert->valid_to.tm_min &&
170 (now.tm_sec > cert->valid_to.tm_sec
171 ))))))))))) {
172 pr_warn("Cert %s has expired\n", cert->fingerprint);
173 ret = -EKEYEXPIRED;
174 goto error_free_cert;
175 }
176
177 cert->pub->algo = x509_public_key_algorithms[cert->pkey_algo];
178 cert->pub->id_type = PKEY_ID_X509;
179
180 /* Check the signature on the key */
181 if (strcmp(cert->fingerprint, cert->authority) == 0) {
182 ret = x509_check_signature(cert->pub, cert);
183 if (ret < 0)
184 goto error_free_cert;
185 }
186
187 /* Propose a description */
188 sulen = strlen(cert->subject);
189 srlen = strlen(cert->fingerprint);
190 ret = -ENOMEM;
191 desc = kmalloc(sulen + 2 + srlen + 1, GFP_KERNEL);
192 if (!desc)
193 goto error_free_cert;
194 memcpy(desc, cert->subject, sulen);
195 desc[sulen] = ':';
196 desc[sulen + 1] = ' ';
197 memcpy(desc + sulen + 2, cert->fingerprint, srlen);
198 desc[sulen + 2 + srlen] = 0;
199
200 /* We're pinning the module by being linked against it */
201 __module_get(public_key_subtype.owner);
202 prep->type_data[0] = &public_key_subtype;
203 prep->type_data[1] = cert->fingerprint;
204 prep->payload = cert->pub;
205 prep->description = desc;
206 prep->quotalen = 100;
207
208 /* We've finished with the certificate */
209 cert->pub = NULL;
210 cert->fingerprint = NULL;
211 desc = NULL;
212 ret = 0;
213
214error_free_cert:
215 x509_free_certificate(cert);
216 return ret;
217}
218
219static struct asymmetric_key_parser x509_key_parser = {
220 .owner = THIS_MODULE,
221 .name = "x509",
222 .parse = x509_key_preparse,
223};
224
225/*
226 * Module stuff
227 */
228static int __init x509_key_init(void)
229{
230 return register_asymmetric_key_parser(&x509_key_parser);
231}
232
233static void __exit x509_key_exit(void)
234{
235 unregister_asymmetric_key_parser(&x509_key_parser);
236}
237
238module_init(x509_key_init);
239module_exit(x509_key_exit);
diff --git a/crypto/asymmetric_keys/x509_rsakey.asn1 b/crypto/asymmetric_keys/x509_rsakey.asn1
new file mode 100644
index 000000000000..4ec7cc6532c1
--- /dev/null
+++ b/crypto/asymmetric_keys/x509_rsakey.asn1
@@ -0,0 +1,4 @@
1RSAPublicKey ::= SEQUENCE {
2 modulus INTEGER ({ rsa_extract_mpi }), -- n
3 publicExponent INTEGER ({ rsa_extract_mpi }) -- e
4 }
diff --git a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c
index e622863b292f..086f381d6489 100644
--- a/fs/cifs/cifs_spnego.c
+++ b/fs/cifs/cifs_spnego.c
@@ -31,18 +31,18 @@
31 31
32/* create a new cifs key */ 32/* create a new cifs key */
33static int 33static int
34cifs_spnego_key_instantiate(struct key *key, const void *data, size_t datalen) 34cifs_spnego_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
35{ 35{
36 char *payload; 36 char *payload;
37 int ret; 37 int ret;
38 38
39 ret = -ENOMEM; 39 ret = -ENOMEM;
40 payload = kmalloc(datalen, GFP_KERNEL); 40 payload = kmalloc(prep->datalen, GFP_KERNEL);
41 if (!payload) 41 if (!payload)
42 goto error; 42 goto error;
43 43
44 /* attach the data */ 44 /* attach the data */
45 memcpy(payload, data, datalen); 45 memcpy(payload, prep->data, prep->datalen);
46 key->payload.data = payload; 46 key->payload.data = payload;
47 ret = 0; 47 ret = 0;
48 48
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index 2ee5c54797fa..fc783e264420 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -167,17 +167,17 @@ static struct shrinker cifs_shrinker = {
167}; 167};
168 168
169static int 169static int
170cifs_idmap_key_instantiate(struct key *key, const void *data, size_t datalen) 170cifs_idmap_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
171{ 171{
172 char *payload; 172 char *payload;
173 173
174 payload = kmalloc(datalen, GFP_KERNEL); 174 payload = kmalloc(prep->datalen, GFP_KERNEL);
175 if (!payload) 175 if (!payload)
176 return -ENOMEM; 176 return -ENOMEM;
177 177
178 memcpy(payload, data, datalen); 178 memcpy(payload, prep->data, prep->datalen);
179 key->payload.data = payload; 179 key->payload.data = payload;
180 key->datalen = datalen; 180 key->datalen = prep->datalen;
181 return 0; 181 return 0;
182} 182}
183 183
diff --git a/include/asm-generic/bitops/count_zeros.h b/include/asm-generic/bitops/count_zeros.h
new file mode 100644
index 000000000000..97520d21fe62
--- /dev/null
+++ b/include/asm-generic/bitops/count_zeros.h
@@ -0,0 +1,57 @@
1/* Count leading and trailing zeros functions
2 *
3 * Copyright (C) 2012 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_GENERIC_BITOPS_COUNT_ZEROS_H_
13#define _ASM_GENERIC_BITOPS_COUNT_ZEROS_H_
14
15#include <asm/bitops.h>
16
17/**
18 * count_leading_zeros - Count the number of zeros from the MSB back
19 * @x: The value
20 *
21 * Count the number of leading zeros from the MSB going towards the LSB in @x.
22 *
23 * If the MSB of @x is set, the result is 0.
24 * If only the LSB of @x is set, then the result is BITS_PER_LONG-1.
25 * If @x is 0 then the result is COUNT_LEADING_ZEROS_0.
26 */
27static inline int count_leading_zeros(unsigned long x)
28{
29 if (sizeof(x) == 4)
30 return BITS_PER_LONG - fls(x);
31 else
32 return BITS_PER_LONG - fls64(x);
33}
34
35#define COUNT_LEADING_ZEROS_0 BITS_PER_LONG
36
37/**
38 * count_trailing_zeros - Count the number of zeros from the LSB forwards
39 * @x: The value
40 *
41 * Count the number of trailing zeros from the LSB going towards the MSB in @x.
42 *
43 * If the LSB of @x is set, the result is 0.
44 * If only the MSB of @x is set, then the result is BITS_PER_LONG-1.
45 * If @x is 0 then the result is COUNT_TRAILING_ZEROS_0.
46 */
47static inline int count_trailing_zeros(unsigned long x)
48{
49#define COUNT_TRAILING_ZEROS_0 (-1)
50
51 if (sizeof(x) == 4)
52 return ffs(x);
53 else
54 return (x != 0) ? __ffs(x) : COUNT_TRAILING_ZEROS_0;
55}
56
57#endif /* _ASM_GENERIC_BITOPS_COUNT_ZEROS_H_ */
diff --git a/include/asm-generic/module.h b/include/asm-generic/module.h
index ed5b44de4c91..14dc41d185a7 100644
--- a/include/asm-generic/module.h
+++ b/include/asm-generic/module.h
@@ -5,18 +5,44 @@
5 * Many architectures just need a simple module 5 * Many architectures just need a simple module
6 * loader without arch specific data. 6 * loader without arch specific data.
7 */ 7 */
8#ifndef CONFIG_HAVE_MOD_ARCH_SPECIFIC
8struct mod_arch_specific 9struct mod_arch_specific
9{ 10{
10}; 11};
12#endif
11 13
12#ifdef CONFIG_64BIT 14#ifdef CONFIG_64BIT
13#define Elf_Shdr Elf64_Shdr 15#define Elf_Shdr Elf64_Shdr
14#define Elf_Sym Elf64_Sym 16#define Elf_Phdr Elf64_Phdr
15#define Elf_Ehdr Elf64_Ehdr 17#define Elf_Sym Elf64_Sym
16#else 18#define Elf_Dyn Elf64_Dyn
17#define Elf_Shdr Elf32_Shdr 19#define Elf_Ehdr Elf64_Ehdr
18#define Elf_Sym Elf32_Sym 20#define Elf_Addr Elf64_Addr
19#define Elf_Ehdr Elf32_Ehdr 21#ifdef CONFIG_MODULES_USE_ELF_REL
22#define Elf_Rel Elf64_Rel
23#endif
24#ifdef CONFIG_MODULES_USE_ELF_RELA
25#define Elf_Rela Elf64_Rela
26#endif
27#define ELF_R_TYPE(X) ELF64_R_TYPE(X)
28#define ELF_R_SYM(X) ELF64_R_SYM(X)
29
30#else /* CONFIG_64BIT */
31
32#define Elf_Shdr Elf32_Shdr
33#define Elf_Phdr Elf32_Phdr
34#define Elf_Sym Elf32_Sym
35#define Elf_Dyn Elf32_Dyn
36#define Elf_Ehdr Elf32_Ehdr
37#define Elf_Addr Elf32_Addr
38#ifdef CONFIG_MODULES_USE_ELF_REL
39#define Elf_Rel Elf32_Rel
40#endif
41#ifdef CONFIG_MODULES_USE_ELF_RELA
42#define Elf_Rela Elf32_Rela
43#endif
44#define ELF_R_TYPE(X) ELF32_R_TYPE(X)
45#define ELF_R_SYM(X) ELF32_R_SYM(X)
20#endif 46#endif
21 47
22#endif /* __ASM_GENERIC_MODULE_H */ 48#endif /* __ASM_GENERIC_MODULE_H */
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 4e2e1cc505ab..d1ea7ce0b4cb 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -530,9 +530,18 @@
530 *(.scommon) \ 530 *(.scommon) \
531 } 531 }
532 532
533/*
534 * Allow archectures to redefine BSS_FIRST_SECTIONS to add extra
535 * sections to the front of bss.
536 */
537#ifndef BSS_FIRST_SECTIONS
538#define BSS_FIRST_SECTIONS
539#endif
540
533#define BSS(bss_align) \ 541#define BSS(bss_align) \
534 . = ALIGN(bss_align); \ 542 . = ALIGN(bss_align); \
535 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \ 543 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \
544 BSS_FIRST_SECTIONS \
536 *(.bss..page_aligned) \ 545 *(.bss..page_aligned) \
537 *(.dynbss) \ 546 *(.dynbss) \
538 *(.bss) \ 547 *(.bss) \
diff --git a/include/crypto/public_key.h b/include/crypto/public_key.h
new file mode 100644
index 000000000000..f5b0224c9967
--- /dev/null
+++ b/include/crypto/public_key.h
@@ -0,0 +1,108 @@
1/* Asymmetric public-key algorithm definitions
2 *
3 * See Documentation/crypto/asymmetric-keys.txt
4 *
5 * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
6 * Written by David Howells (dhowells@redhat.com)
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public Licence
10 * as published by the Free Software Foundation; either version
11 * 2 of the Licence, or (at your option) any later version.
12 */
13
14#ifndef _LINUX_PUBLIC_KEY_H
15#define _LINUX_PUBLIC_KEY_H
16
17#include <linux/mpi.h>
18
19enum pkey_algo {
20 PKEY_ALGO_DSA,
21 PKEY_ALGO_RSA,
22 PKEY_ALGO__LAST
23};
24
25extern const char *const pkey_algo[PKEY_ALGO__LAST];
26
27enum pkey_hash_algo {
28 PKEY_HASH_MD4,
29 PKEY_HASH_MD5,
30 PKEY_HASH_SHA1,
31 PKEY_HASH_RIPE_MD_160,
32 PKEY_HASH_SHA256,
33 PKEY_HASH_SHA384,
34 PKEY_HASH_SHA512,
35 PKEY_HASH_SHA224,
36 PKEY_HASH__LAST
37};
38
39extern const char *const pkey_hash_algo[PKEY_HASH__LAST];
40
41enum pkey_id_type {
42 PKEY_ID_PGP, /* OpenPGP generated key ID */
43 PKEY_ID_X509, /* X.509 arbitrary subjectKeyIdentifier */
44 PKEY_ID_TYPE__LAST
45};
46
47extern const char *const pkey_id_type[PKEY_ID_TYPE__LAST];
48
49/*
50 * Cryptographic data for the public-key subtype of the asymmetric key type.
51 *
52 * Note that this may include private part of the key as well as the public
53 * part.
54 */
55struct public_key {
56 const struct public_key_algorithm *algo;
57 u8 capabilities;
58#define PKEY_CAN_ENCRYPT 0x01
59#define PKEY_CAN_DECRYPT 0x02
60#define PKEY_CAN_SIGN 0x04
61#define PKEY_CAN_VERIFY 0x08
62 enum pkey_id_type id_type : 8;
63 union {
64 MPI mpi[5];
65 struct {
66 MPI p; /* DSA prime */
67 MPI q; /* DSA group order */
68 MPI g; /* DSA group generator */
69 MPI y; /* DSA public-key value = g^x mod p */
70 MPI x; /* DSA secret exponent (if present) */
71 } dsa;
72 struct {
73 MPI n; /* RSA public modulus */
74 MPI e; /* RSA public encryption exponent */
75 MPI d; /* RSA secret encryption exponent (if present) */
76 MPI p; /* RSA secret prime (if present) */
77 MPI q; /* RSA secret prime (if present) */
78 } rsa;
79 };
80};
81
82extern void public_key_destroy(void *payload);
83
84/*
85 * Public key cryptography signature data
86 */
87struct public_key_signature {
88 u8 *digest;
89 u8 digest_size; /* Number of bytes in digest */
90 u8 nr_mpi; /* Occupancy of mpi[] */
91 enum pkey_hash_algo pkey_hash_algo : 8;
92 union {
93 MPI mpi[2];
94 struct {
95 MPI s; /* m^d mod n */
96 } rsa;
97 struct {
98 MPI r;
99 MPI s;
100 } dsa;
101 };
102};
103
104struct key;
105extern int verify_signature(const struct key *key,
106 const struct public_key_signature *sig);
107
108#endif /* _LINUX_PUBLIC_KEY_H */
diff --git a/include/keys/asymmetric-parser.h b/include/keys/asymmetric-parser.h
new file mode 100644
index 000000000000..09b3b4807f5c
--- /dev/null
+++ b/include/keys/asymmetric-parser.h
@@ -0,0 +1,37 @@
1/* Asymmetric public-key cryptography data parser
2 *
3 * See Documentation/crypto/asymmetric-keys.txt
4 *
5 * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
6 * Written by David Howells (dhowells@redhat.com)
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public Licence
10 * as published by the Free Software Foundation; either version
11 * 2 of the Licence, or (at your option) any later version.
12 */
13
14#ifndef _KEYS_ASYMMETRIC_PARSER_H
15#define _KEYS_ASYMMETRIC_PARSER_H
16
17/*
18 * Key data parser. Called during key instantiation.
19 */
20struct asymmetric_key_parser {
21 struct list_head link;
22 struct module *owner;
23 const char *name;
24
25 /* Attempt to parse a key from the data blob passed to add_key() or
26 * keyctl_instantiate(). Should also generate a proposed description
27 * that the caller can optionally use for the key.
28 *
29 * Return EBADMSG if not recognised.
30 */
31 int (*parse)(struct key_preparsed_payload *prep);
32};
33
34extern int register_asymmetric_key_parser(struct asymmetric_key_parser *);
35extern void unregister_asymmetric_key_parser(struct asymmetric_key_parser *);
36
37#endif /* _KEYS_ASYMMETRIC_PARSER_H */
diff --git a/include/keys/asymmetric-subtype.h b/include/keys/asymmetric-subtype.h
new file mode 100644
index 000000000000..4b840e822209
--- /dev/null
+++ b/include/keys/asymmetric-subtype.h
@@ -0,0 +1,55 @@
1/* Asymmetric public-key cryptography key subtype
2 *
3 * See Documentation/security/asymmetric-keys.txt
4 *
5 * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
6 * Written by David Howells (dhowells@redhat.com)
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public Licence
10 * as published by the Free Software Foundation; either version
11 * 2 of the Licence, or (at your option) any later version.
12 */
13
14#ifndef _KEYS_ASYMMETRIC_SUBTYPE_H
15#define _KEYS_ASYMMETRIC_SUBTYPE_H
16
17#include <linux/seq_file.h>
18#include <keys/asymmetric-type.h>
19
20struct public_key_signature;
21
22/*
23 * Keys of this type declare a subtype that indicates the handlers and
24 * capabilities.
25 */
26struct asymmetric_key_subtype {
27 struct module *owner;
28 const char *name;
29 unsigned short name_len; /* length of name */
30
31 /* Describe a key of this subtype for /proc/keys */
32 void (*describe)(const struct key *key, struct seq_file *m);
33
34 /* Destroy a key of this subtype */
35 void (*destroy)(void *payload);
36
37 /* Verify the signature on a key of this subtype (optional) */
38 int (*verify_signature)(const struct key *key,
39 const struct public_key_signature *sig);
40};
41
42/**
43 * asymmetric_key_subtype - Get the subtype from an asymmetric key
44 * @key: The key of interest.
45 *
46 * Retrieves and returns the subtype pointer of the asymmetric key from the
47 * type-specific data attached to the key.
48 */
49static inline
50struct asymmetric_key_subtype *asymmetric_key_subtype(const struct key *key)
51{
52 return key->type_data.p[0];
53}
54
55#endif /* _KEYS_ASYMMETRIC_SUBTYPE_H */
diff --git a/include/keys/asymmetric-type.h b/include/keys/asymmetric-type.h
new file mode 100644
index 000000000000..7dd473496180
--- /dev/null
+++ b/include/keys/asymmetric-type.h
@@ -0,0 +1,25 @@
1/* Asymmetric Public-key cryptography key type interface
2 *
3 * See Documentation/security/asymmetric-keys.txt
4 *
5 * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
6 * Written by David Howells (dhowells@redhat.com)
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public Licence
10 * as published by the Free Software Foundation; either version
11 * 2 of the Licence, or (at your option) any later version.
12 */
13
14#ifndef _KEYS_ASYMMETRIC_TYPE_H
15#define _KEYS_ASYMMETRIC_TYPE_H
16
17#include <linux/key-type.h>
18
19extern struct key_type key_type_asymmetric;
20
21/*
22 * The payload is at the discretion of the subtype.
23 */
24
25#endif /* _KEYS_ASYMMETRIC_TYPE_H */
diff --git a/include/keys/user-type.h b/include/keys/user-type.h
index bc9ec1d7698c..5e452c84f1e6 100644
--- a/include/keys/user-type.h
+++ b/include/keys/user-type.h
@@ -35,8 +35,10 @@ struct user_key_payload {
35extern struct key_type key_type_user; 35extern struct key_type key_type_user;
36extern struct key_type key_type_logon; 36extern struct key_type key_type_logon;
37 37
38extern int user_instantiate(struct key *key, const void *data, size_t datalen); 38struct key_preparsed_payload;
39extern int user_update(struct key *key, const void *data, size_t datalen); 39
40extern int user_instantiate(struct key *key, struct key_preparsed_payload *prep);
41extern int user_update(struct key *key, struct key_preparsed_payload *prep);
40extern int user_match(const struct key *key, const void *criterion); 42extern int user_match(const struct key *key, const void *criterion);
41extern void user_revoke(struct key *key); 43extern void user_revoke(struct key *key);
42extern void user_destroy(struct key *key); 44extern void user_destroy(struct key *key);
diff --git a/include/linux/asn1.h b/include/linux/asn1.h
new file mode 100644
index 000000000000..5c3f4e4b9a23
--- /dev/null
+++ b/include/linux/asn1.h
@@ -0,0 +1,67 @@
1/* ASN.1 BER/DER/CER encoding definitions
2 *
3 * Copyright (C) 2012 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 _LINUX_ASN1_H
13#define _LINUX_ASN1_H
14
15/* Class */
16enum asn1_class {
17 ASN1_UNIV = 0, /* Universal */
18 ASN1_APPL = 1, /* Application */
19 ASN1_CONT = 2, /* Context */
20 ASN1_PRIV = 3 /* Private */
21};
22#define ASN1_CLASS_BITS 0xc0
23
24
25enum asn1_method {
26 ASN1_PRIM = 0, /* Primitive */
27 ASN1_CONS = 1 /* Constructed */
28};
29#define ASN1_CONS_BIT 0x20
30
31/* Tag */
32enum asn1_tag {
33 ASN1_EOC = 0, /* End Of Contents or N/A */
34 ASN1_BOOL = 1, /* Boolean */
35 ASN1_INT = 2, /* Integer */
36 ASN1_BTS = 3, /* Bit String */
37 ASN1_OTS = 4, /* Octet String */
38 ASN1_NULL = 5, /* Null */
39 ASN1_OID = 6, /* Object Identifier */
40 ASN1_ODE = 7, /* Object Description */
41 ASN1_EXT = 8, /* External */
42 ASN1_REAL = 9, /* Real float */
43 ASN1_ENUM = 10, /* Enumerated */
44 ASN1_EPDV = 11, /* Embedded PDV */
45 ASN1_UTF8STR = 12, /* UTF8 String */
46 ASN1_RELOID = 13, /* Relative OID */
47 /* 14 - Reserved */
48 /* 15 - Reserved */
49 ASN1_SEQ = 16, /* Sequence and Sequence of */
50 ASN1_SET = 17, /* Set and Set of */
51 ASN1_NUMSTR = 18, /* Numerical String */
52 ASN1_PRNSTR = 19, /* Printable String */
53 ASN1_TEXSTR = 20, /* T61 String / Teletext String */
54 ASN1_VIDSTR = 21, /* Videotex String */
55 ASN1_IA5STR = 22, /* IA5 String */
56 ASN1_UNITIM = 23, /* Universal Time */
57 ASN1_GENTIM = 24, /* General Time */
58 ASN1_GRASTR = 25, /* Graphic String */
59 ASN1_VISSTR = 26, /* Visible String */
60 ASN1_GENSTR = 27, /* General String */
61 ASN1_UNISTR = 28, /* Universal String */
62 ASN1_CHRSTR = 29, /* Character String */
63 ASN1_BMPSTR = 30, /* BMP String */
64 ASN1_LONG_TAG = 31 /* Long form tag */
65};
66
67#endif /* _LINUX_ASN1_H */
diff --git a/include/linux/asn1_ber_bytecode.h b/include/linux/asn1_ber_bytecode.h
new file mode 100644
index 000000000000..945d44ae529c
--- /dev/null
+++ b/include/linux/asn1_ber_bytecode.h
@@ -0,0 +1,87 @@
1/* ASN.1 BER/DER/CER parsing state machine internal definitions
2 *
3 * Copyright (C) 2012 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 _LINUX_ASN1_BER_BYTECODE_H
13#define _LINUX_ASN1_BER_BYTECODE_H
14
15#ifdef __KERNEL__
16#include <linux/types.h>
17#endif
18#include <linux/asn1.h>
19
20typedef int (*asn1_action_t)(void *context,
21 size_t hdrlen, /* In case of ANY type */
22 unsigned char tag, /* In case of ANY type */
23 const void *value, size_t vlen);
24
25struct asn1_decoder {
26 const unsigned char *machine;
27 size_t machlen;
28 const asn1_action_t *actions;
29};
30
31enum asn1_opcode {
32 /* The tag-matching ops come first and the odd-numbered slots
33 * are for OR_SKIP ops.
34 */
35#define ASN1_OP_MATCH__SKIP 0x01
36#define ASN1_OP_MATCH__ACT 0x02
37#define ASN1_OP_MATCH__JUMP 0x04
38#define ASN1_OP_MATCH__ANY 0x08
39#define ASN1_OP_MATCH__COND 0x10
40
41 ASN1_OP_MATCH = 0x00,
42 ASN1_OP_MATCH_OR_SKIP = 0x01,
43 ASN1_OP_MATCH_ACT = 0x02,
44 ASN1_OP_MATCH_ACT_OR_SKIP = 0x03,
45 ASN1_OP_MATCH_JUMP = 0x04,
46 ASN1_OP_MATCH_JUMP_OR_SKIP = 0x05,
47 ASN1_OP_MATCH_ANY = 0x08,
48 ASN1_OP_MATCH_ANY_ACT = 0x0a,
49 /* Everything before here matches unconditionally */
50
51 ASN1_OP_COND_MATCH_OR_SKIP = 0x11,
52 ASN1_OP_COND_MATCH_ACT_OR_SKIP = 0x13,
53 ASN1_OP_COND_MATCH_JUMP_OR_SKIP = 0x15,
54 ASN1_OP_COND_MATCH_ANY = 0x18,
55 ASN1_OP_COND_MATCH_ANY_ACT = 0x1a,
56
57 /* Everything before here will want a tag from the data */
58#define ASN1_OP__MATCHES_TAG ASN1_OP_COND_MATCH_ANY_ACT
59
60 /* These are here to help fill up space */
61 ASN1_OP_COND_FAIL = 0x1b,
62 ASN1_OP_COMPLETE = 0x1c,
63 ASN1_OP_ACT = 0x1d,
64 ASN1_OP_RETURN = 0x1e,
65
66 /* The following eight have bit 0 -> SET, 1 -> OF, 2 -> ACT */
67 ASN1_OP_END_SEQ = 0x20,
68 ASN1_OP_END_SET = 0x21,
69 ASN1_OP_END_SEQ_OF = 0x22,
70 ASN1_OP_END_SET_OF = 0x23,
71 ASN1_OP_END_SEQ_ACT = 0x24,
72 ASN1_OP_END_SET_ACT = 0x25,
73 ASN1_OP_END_SEQ_OF_ACT = 0x26,
74 ASN1_OP_END_SET_OF_ACT = 0x27,
75#define ASN1_OP_END__SET 0x01
76#define ASN1_OP_END__OF 0x02
77#define ASN1_OP_END__ACT 0x04
78
79 ASN1_OP__NR
80};
81
82#define _tag(CLASS, CP, TAG) ((ASN1_##CLASS << 6) | (ASN1_##CP << 5) | ASN1_##TAG)
83#define _tagn(CLASS, CP, TAG) ((ASN1_##CLASS << 6) | (ASN1_##CP << 5) | TAG)
84#define _jump_target(N) (N)
85#define _action(N) (N)
86
87#endif /* _LINUX_ASN1_BER_BYTECODE_H */
diff --git a/include/linux/asn1_decoder.h b/include/linux/asn1_decoder.h
new file mode 100644
index 000000000000..fa2ff5bc0483
--- /dev/null
+++ b/include/linux/asn1_decoder.h
@@ -0,0 +1,24 @@
1/* ASN.1 decoder
2 *
3 * Copyright (C) 2012 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 _LINUX_ASN1_DECODER_H
13#define _LINUX_ASN1_DECODER_H
14
15#include <linux/asn1.h>
16
17struct asn1_decoder;
18
19extern int asn1_ber_decoder(const struct asn1_decoder *decoder,
20 void *context,
21 const unsigned char *data,
22 size_t datalen);
23
24#endif /* _LINUX_ASN1_DECODER_H */
diff --git a/include/linux/key-type.h b/include/linux/key-type.h
index f0c651cda7b0..518a53afb9ea 100644
--- a/include/linux/key-type.h
+++ b/include/linux/key-type.h
@@ -26,6 +26,27 @@ struct key_construction {
26 struct key *authkey;/* authorisation for key being constructed */ 26 struct key *authkey;/* authorisation for key being constructed */
27}; 27};
28 28
29/*
30 * Pre-parsed payload, used by key add, update and instantiate.
31 *
32 * This struct will be cleared and data and datalen will be set with the data
33 * and length parameters from the caller and quotalen will be set from
34 * def_datalen from the key type. Then if the preparse() op is provided by the
35 * key type, that will be called. Then the struct will be passed to the
36 * instantiate() or the update() op.
37 *
38 * If the preparse() op is given, the free_preparse() op will be called to
39 * clear the contents.
40 */
41struct key_preparsed_payload {
42 char *description; /* Proposed key description (or NULL) */
43 void *type_data[2]; /* Private key-type data */
44 void *payload; /* Proposed payload */
45 const void *data; /* Raw data */
46 size_t datalen; /* Raw datalen */
47 size_t quotalen; /* Quota length for proposed payload */
48};
49
29typedef int (*request_key_actor_t)(struct key_construction *key, 50typedef int (*request_key_actor_t)(struct key_construction *key,
30 const char *op, void *aux); 51 const char *op, void *aux);
31 52
@@ -45,18 +66,28 @@ struct key_type {
45 /* vet a description */ 66 /* vet a description */
46 int (*vet_description)(const char *description); 67 int (*vet_description)(const char *description);
47 68
69 /* Preparse the data blob from userspace that is to be the payload,
70 * generating a proposed description and payload that will be handed to
71 * the instantiate() and update() ops.
72 */
73 int (*preparse)(struct key_preparsed_payload *prep);
74
75 /* Free a preparse data structure.
76 */
77 void (*free_preparse)(struct key_preparsed_payload *prep);
78
48 /* instantiate a key of this type 79 /* instantiate a key of this type
49 * - this method should call key_payload_reserve() to determine if the 80 * - this method should call key_payload_reserve() to determine if the
50 * user's quota will hold the payload 81 * user's quota will hold the payload
51 */ 82 */
52 int (*instantiate)(struct key *key, const void *data, size_t datalen); 83 int (*instantiate)(struct key *key, struct key_preparsed_payload *prep);
53 84
54 /* update a key of this type (optional) 85 /* update a key of this type (optional)
55 * - this method should call key_payload_reserve() to recalculate the 86 * - this method should call key_payload_reserve() to recalculate the
56 * quota consumption 87 * quota consumption
57 * - the key must be locked against read when modifying 88 * - the key must be locked against read when modifying
58 */ 89 */
59 int (*update)(struct key *key, const void *data, size_t datalen); 90 int (*update)(struct key *key, struct key_preparsed_payload *prep);
60 91
61 /* match a key against a description */ 92 /* match a key against a description */
62 int (*match)(const struct key *key, const void *desc); 93 int (*match)(const struct key *key, const void *desc);
diff --git a/include/linux/module.h b/include/linux/module.h
index fbcafe2ee13e..7760c6d344a3 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -21,6 +21,9 @@
21#include <linux/percpu.h> 21#include <linux/percpu.h>
22#include <asm/module.h> 22#include <asm/module.h>
23 23
24/* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */
25#define MODULE_SIG_STRING "~Module signature appended~\n"
26
24/* Not Yet Implemented */ 27/* Not Yet Implemented */
25#define MODULE_SUPPORTED_DEVICE(name) 28#define MODULE_SUPPORTED_DEVICE(name)
26 29
@@ -260,6 +263,11 @@ struct module
260 const unsigned long *unused_gpl_crcs; 263 const unsigned long *unused_gpl_crcs;
261#endif 264#endif
262 265
266#ifdef CONFIG_MODULE_SIG
267 /* Signature was verified. */
268 bool sig_ok;
269#endif
270
263 /* symbols that will be GPL-only in the near future. */ 271 /* symbols that will be GPL-only in the near future. */
264 const struct kernel_symbol *gpl_future_syms; 272 const struct kernel_symbol *gpl_future_syms;
265 const unsigned long *gpl_future_crcs; 273 const unsigned long *gpl_future_crcs;
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h
index b2be02ebf453..560ca53a75fa 100644
--- a/include/linux/moduleloader.h
+++ b/include/linux/moduleloader.h
@@ -28,21 +28,49 @@ void *module_alloc(unsigned long size);
28/* Free memory returned from module_alloc. */ 28/* Free memory returned from module_alloc. */
29void module_free(struct module *mod, void *module_region); 29void module_free(struct module *mod, void *module_region);
30 30
31/* Apply the given relocation to the (simplified) ELF. Return -error 31/*
32 or 0. */ 32 * Apply the given relocation to the (simplified) ELF. Return -error
33 * or 0.
34 */
35#ifdef CONFIG_MODULES_USE_ELF_REL
33int apply_relocate(Elf_Shdr *sechdrs, 36int apply_relocate(Elf_Shdr *sechdrs,
34 const char *strtab, 37 const char *strtab,
35 unsigned int symindex, 38 unsigned int symindex,
36 unsigned int relsec, 39 unsigned int relsec,
37 struct module *mod); 40 struct module *mod);
41#else
42static inline int apply_relocate(Elf_Shdr *sechdrs,
43 const char *strtab,
44 unsigned int symindex,
45 unsigned int relsec,
46 struct module *me)
47{
48 printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
49 return -ENOEXEC;
50}
51#endif
38 52
39/* Apply the given add relocation to the (simplified) ELF. Return 53/*
40 -error or 0 */ 54 * Apply the given add relocation to the (simplified) ELF. Return
55 * -error or 0
56 */
57#ifdef CONFIG_MODULES_USE_ELF_RELA
41int apply_relocate_add(Elf_Shdr *sechdrs, 58int apply_relocate_add(Elf_Shdr *sechdrs,
42 const char *strtab, 59 const char *strtab,
43 unsigned int symindex, 60 unsigned int symindex,
44 unsigned int relsec, 61 unsigned int relsec,
45 struct module *mod); 62 struct module *mod);
63#else
64static inline int apply_relocate_add(Elf_Shdr *sechdrs,
65 const char *strtab,
66 unsigned int symindex,
67 unsigned int relsec,
68 struct module *me)
69{
70 printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
71 return -ENOEXEC;
72}
73#endif
46 74
47/* Any final processing of module before access. Return -error or 0. */ 75/* Any final processing of module before access. Return -error or 0. */
48int module_finalize(const Elf_Ehdr *hdr, 76int module_finalize(const Elf_Ehdr *hdr,
diff --git a/include/linux/mpi.h b/include/linux/mpi.h
index d02cca6cc8ce..5af1b81def49 100644
--- a/include/linux/mpi.h
+++ b/include/linux/mpi.h
@@ -76,6 +76,7 @@ void mpi_swap(MPI a, MPI b);
76 76
77/*-- mpicoder.c --*/ 77/*-- mpicoder.c --*/
78MPI do_encode_md(const void *sha_buffer, unsigned nbits); 78MPI do_encode_md(const void *sha_buffer, unsigned nbits);
79MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes);
79MPI mpi_read_from_buffer(const void *buffer, unsigned *ret_nread); 80MPI mpi_read_from_buffer(const void *buffer, unsigned *ret_nread);
80int mpi_fromstr(MPI val, const char *str); 81int mpi_fromstr(MPI val, const char *str);
81u32 mpi_get_keyid(MPI a, u32 *keyid); 82u32 mpi_get_keyid(MPI a, u32 *keyid);
diff --git a/include/linux/oid_registry.h b/include/linux/oid_registry.h
new file mode 100644
index 000000000000..6926db724258
--- /dev/null
+++ b/include/linux/oid_registry.h
@@ -0,0 +1,92 @@
1/* ASN.1 Object identifier (OID) registry
2 *
3 * Copyright (C) 2012 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 _LINUX_OID_REGISTRY_H
13#define _LINUX_OID_REGISTRY_H
14
15#include <linux/types.h>
16
17/*
18 * OIDs are turned into these values if possible, or OID__NR if not held here.
19 *
20 * NOTE! Do not mess with the format of each line as this is read by
21 * build_OID_registry.pl to generate the data for look_up_OID().
22 */
23enum OID {
24 OID_id_dsa_with_sha1, /* 1.2.840.10030.4.3 */
25 OID_id_dsa, /* 1.2.840.10040.4.1 */
26 OID_id_ecdsa_with_sha1, /* 1.2.840.10045.4.1 */
27 OID_id_ecPublicKey, /* 1.2.840.10045.2.1 */
28
29 /* PKCS#1 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1)} */
30 OID_rsaEncryption, /* 1.2.840.113549.1.1.1 */
31 OID_md2WithRSAEncryption, /* 1.2.840.113549.1.1.2 */
32 OID_md3WithRSAEncryption, /* 1.2.840.113549.1.1.3 */
33 OID_md4WithRSAEncryption, /* 1.2.840.113549.1.1.4 */
34 OID_sha1WithRSAEncryption, /* 1.2.840.113549.1.1.5 */
35 OID_sha256WithRSAEncryption, /* 1.2.840.113549.1.1.11 */
36 OID_sha384WithRSAEncryption, /* 1.2.840.113549.1.1.12 */
37 OID_sha512WithRSAEncryption, /* 1.2.840.113549.1.1.13 */
38 OID_sha224WithRSAEncryption, /* 1.2.840.113549.1.1.14 */
39 /* PKCS#7 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-7(7)} */
40 OID_data, /* 1.2.840.113549.1.7.1 */
41 OID_signed_data, /* 1.2.840.113549.1.7.2 */
42 /* PKCS#9 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9)} */
43 OID_email_address, /* 1.2.840.113549.1.9.1 */
44 OID_content_type, /* 1.2.840.113549.1.9.3 */
45 OID_messageDigest, /* 1.2.840.113549.1.9.4 */
46 OID_signingTime, /* 1.2.840.113549.1.9.5 */
47 OID_smimeCapabilites, /* 1.2.840.113549.1.9.15 */
48 OID_smimeAuthenticatedAttrs, /* 1.2.840.113549.1.9.16.2.11 */
49
50 /* {iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2)} */
51 OID_md2, /* 1.2.840.113549.2.2 */
52 OID_md4, /* 1.2.840.113549.2.4 */
53 OID_md5, /* 1.2.840.113549.2.5 */
54
55 OID_certAuthInfoAccess, /* 1.3.6.1.5.5.7.1.1 */
56 OID_msOutlookExpress, /* 1.3.6.1.4.1.311.16.4 */
57 OID_sha1, /* 1.3.14.3.2.26 */
58
59 /* Distinguished Name attribute IDs [RFC 2256] */
60 OID_commonName, /* 2.5.4.3 */
61 OID_surname, /* 2.5.4.4 */
62 OID_countryName, /* 2.5.4.6 */
63 OID_locality, /* 2.5.4.7 */
64 OID_stateOrProvinceName, /* 2.5.4.8 */
65 OID_organizationName, /* 2.5.4.10 */
66 OID_organizationUnitName, /* 2.5.4.11 */
67 OID_title, /* 2.5.4.12 */
68 OID_description, /* 2.5.4.13 */
69 OID_name, /* 2.5.4.41 */
70 OID_givenName, /* 2.5.4.42 */
71 OID_initials, /* 2.5.4.43 */
72 OID_generationalQualifier, /* 2.5.4.44 */
73
74 /* Certificate extension IDs */
75 OID_subjectKeyIdentifier, /* 2.5.29.14 */
76 OID_keyUsage, /* 2.5.29.15 */
77 OID_subjectAltName, /* 2.5.29.17 */
78 OID_issuerAltName, /* 2.5.29.18 */
79 OID_basicConstraints, /* 2.5.29.19 */
80 OID_crlDistributionPoints, /* 2.5.29.31 */
81 OID_certPolicies, /* 2.5.29.32 */
82 OID_authorityKeyIdentifier, /* 2.5.29.35 */
83 OID_extKeyUsage, /* 2.5.29.37 */
84
85 OID__NR
86};
87
88extern enum OID look_up_OID(const void *data, size_t datasize);
89extern int sprint_oid(const void *, size_t, char *, size_t);
90extern int sprint_OID(enum OID, char *, size_t);
91
92#endif /* _LINUX_OID_REGISTRY_H */
diff --git a/init/Kconfig b/init/Kconfig
index 89e4cf672dfe..6fdd6e339326 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1574,6 +1574,66 @@ config MODULE_SRCVERSION_ALL
1574 the version). With this option, such a "srcversion" field 1574 the version). With this option, such a "srcversion" field
1575 will be created for all modules. If unsure, say N. 1575 will be created for all modules. If unsure, say N.
1576 1576
1577config MODULE_SIG
1578 bool "Module signature verification"
1579 depends on MODULES
1580 select KEYS
1581 select CRYPTO
1582 select ASYMMETRIC_KEY_TYPE
1583 select ASYMMETRIC_PUBLIC_KEY_SUBTYPE
1584 select PUBLIC_KEY_ALGO_RSA
1585 select ASN1
1586 select OID_REGISTRY
1587 select X509_CERTIFICATE_PARSER
1588 help
1589 Check modules for valid signatures upon load: the signature
1590 is simply appended to the module. For more information see
1591 Documentation/module-signing.txt.
1592
1593 !!!WARNING!!! If you enable this option, you MUST make sure that the
1594 module DOES NOT get stripped after being signed. This includes the
1595 debuginfo strip done by some packagers (such as rpmbuild) and
1596 inclusion into an initramfs that wants the module size reduced.
1597
1598config MODULE_SIG_FORCE
1599 bool "Require modules to be validly signed"
1600 depends on MODULE_SIG
1601 help
1602 Reject unsigned modules or signed modules for which we don't have a
1603 key. Without this, such modules will simply taint the kernel.
1604
1605choice
1606 prompt "Which hash algorithm should modules be signed with?"
1607 depends on MODULE_SIG
1608 help
1609 This determines which sort of hashing algorithm will be used during
1610 signature generation. This algorithm _must_ be built into the kernel
1611 directly so that signature verification can take place. It is not
1612 possible to load a signed module containing the algorithm to check
1613 the signature on that module.
1614
1615config MODULE_SIG_SHA1
1616 bool "Sign modules with SHA-1"
1617 select CRYPTO_SHA1
1618
1619config MODULE_SIG_SHA224
1620 bool "Sign modules with SHA-224"
1621 select CRYPTO_SHA256
1622
1623config MODULE_SIG_SHA256
1624 bool "Sign modules with SHA-256"
1625 select CRYPTO_SHA256
1626
1627config MODULE_SIG_SHA384
1628 bool "Sign modules with SHA-384"
1629 select CRYPTO_SHA512
1630
1631config MODULE_SIG_SHA512
1632 bool "Sign modules with SHA-512"
1633 select CRYPTO_SHA512
1634
1635endchoice
1636
1577endif # MODULES 1637endif # MODULES
1578 1638
1579config INIT_ALL_POSSIBLE 1639config INIT_ALL_POSSIBLE
@@ -1607,4 +1667,12 @@ config PADATA
1607config BROKEN_RODATA 1667config BROKEN_RODATA
1608 bool 1668 bool
1609 1669
1670config ASN1
1671 tristate
1672 help
1673 Build a simple ASN.1 grammar compiler that produces a bytecode output
1674 that can be interpreted by the ASN.1 stream decoder and used to
1675 inform it as to what tags are to be expected in a stream and what
1676 functions to call on what tags.
1677
1610source "kernel/Kconfig.locks" 1678source "kernel/Kconfig.locks"
diff --git a/kernel/Makefile b/kernel/Makefile
index 5404911eaee9..0dfeca4324ee 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -54,6 +54,7 @@ obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
54obj-$(CONFIG_PROVE_LOCKING) += spinlock.o 54obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
55obj-$(CONFIG_UID16) += uid16.o 55obj-$(CONFIG_UID16) += uid16.o
56obj-$(CONFIG_MODULES) += module.o 56obj-$(CONFIG_MODULES) += module.o
57obj-$(CONFIG_MODULE_SIG) += module_signing.o modsign_pubkey.o
57obj-$(CONFIG_KALLSYMS) += kallsyms.o 58obj-$(CONFIG_KALLSYMS) += kallsyms.o
58obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o 59obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
59obj-$(CONFIG_KEXEC) += kexec.o 60obj-$(CONFIG_KEXEC) += kexec.o
@@ -130,3 +131,79 @@ quiet_cmd_timeconst = TIMEC $@
130targets += timeconst.h 131targets += timeconst.h
131$(obj)/timeconst.h: $(src)/timeconst.pl FORCE 132$(obj)/timeconst.h: $(src)/timeconst.pl FORCE
132 $(call if_changed,timeconst) 133 $(call if_changed,timeconst)
134
135ifeq ($(CONFIG_MODULE_SIG),y)
136#
137# Pull the signing certificate and any extra certificates into the kernel
138#
139extra_certificates:
140 touch $@
141
142kernel/modsign_pubkey.o: signing_key.x509 extra_certificates
143
144###############################################################################
145#
146# If module signing is requested, say by allyesconfig, but a key has not been
147# supplied, then one will need to be generated to make sure the build does not
148# fail and that the kernel may be used afterwards.
149#
150###############################################################################
151sign_key_with_hash :=
152ifeq ($(CONFIG_MODULE_SIG_SHA1),y)
153sign_key_with_hash := -sha1
154endif
155ifeq ($(CONFIG_MODULE_SIG_SHA224),y)
156sign_key_with_hash := -sha224
157endif
158ifeq ($(CONFIG_MODULE_SIG_SHA256),y)
159sign_key_with_hash := -sha256
160endif
161ifeq ($(CONFIG_MODULE_SIG_SHA384),y)
162sign_key_with_hash := -sha384
163endif
164ifeq ($(CONFIG_MODULE_SIG_SHA512),y)
165sign_key_with_hash := -sha512
166endif
167ifeq ($(sign_key_with_hash),)
168$(error Could not determine digest type to use from kernel config)
169endif
170
171signing_key.priv signing_key.x509: x509.genkey
172 @echo "###"
173 @echo "### Now generating an X.509 key pair to be used for signing modules."
174 @echo "###"
175 @echo "### If this takes a long time, you might wish to run rngd in the"
176 @echo "### background to keep the supply of entropy topped up. It"
177 @echo "### needs to be run as root, and should use a hardware random"
178 @echo "### number generator if one is available, eg:"
179 @echo "###"
180 @echo "### rngd -r /dev/hwrandom"
181 @echo "###"
182 openssl req -new -nodes -utf8 $(sign_key_with_hash) -days 36500 -batch \
183 -x509 -config x509.genkey \
184 -outform DER -out signing_key.x509 \
185 -keyout signing_key.priv
186 @echo "###"
187 @echo "### Key pair generated."
188 @echo "###"
189
190x509.genkey:
191 @echo Generating X.509 key generation config
192 @echo >x509.genkey "[ req ]"
193 @echo >>x509.genkey "default_bits = 4096"
194 @echo >>x509.genkey "distinguished_name = req_distinguished_name"
195 @echo >>x509.genkey "prompt = no"
196 @echo >>x509.genkey "string_mask = utf8only"
197 @echo >>x509.genkey "x509_extensions = myexts"
198 @echo >>x509.genkey
199 @echo >>x509.genkey "[ req_distinguished_name ]"
200 @echo >>x509.genkey "O = Magrathea"
201 @echo >>x509.genkey "CN = Glacier signing key"
202 @echo >>x509.genkey "emailAddress = slartibartfast@magrathea.h2g2"
203 @echo >>x509.genkey
204 @echo >>x509.genkey "[ myexts ]"
205 @echo >>x509.genkey "basicConstraints=critical,CA:FALSE"
206 @echo >>x509.genkey "keyUsage=digitalSignature"
207 @echo >>x509.genkey "subjectKeyIdentifier=hash"
208 @echo >>x509.genkey "authorityKeyIdentifier=keyid"
209endif
diff --git a/kernel/modsign_pubkey.c b/kernel/modsign_pubkey.c
new file mode 100644
index 000000000000..4646eb2c3820
--- /dev/null
+++ b/kernel/modsign_pubkey.c
@@ -0,0 +1,113 @@
1/* Public keys for module signature verification
2 *
3 * Copyright (C) 2012 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#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/cred.h>
15#include <linux/err.h>
16#include <keys/asymmetric-type.h>
17#include "module-internal.h"
18
19struct key *modsign_keyring;
20
21extern __initdata const u8 modsign_certificate_list[];
22extern __initdata const u8 modsign_certificate_list_end[];
23asm(".section .init.data,\"aw\"\n"
24 "modsign_certificate_list:\n"
25 ".incbin \"signing_key.x509\"\n"
26 ".incbin \"extra_certificates\"\n"
27 "modsign_certificate_list_end:"
28 );
29
30/*
31 * We need to make sure ccache doesn't cache the .o file as it doesn't notice
32 * if modsign.pub changes.
33 */
34static __initdata const char annoy_ccache[] = __TIME__ "foo";
35
36/*
37 * Load the compiled-in keys
38 */
39static __init int module_verify_init(void)
40{
41 pr_notice("Initialise module verification\n");
42
43 modsign_keyring = key_alloc(&key_type_keyring, ".module_sign",
44 KUIDT_INIT(0), KGIDT_INIT(0),
45 current_cred(),
46 (KEY_POS_ALL & ~KEY_POS_SETATTR) |
47 KEY_USR_VIEW | KEY_USR_READ,
48 KEY_ALLOC_NOT_IN_QUOTA);
49 if (IS_ERR(modsign_keyring))
50 panic("Can't allocate module signing keyring\n");
51
52 if (key_instantiate_and_link(modsign_keyring, NULL, 0, NULL, NULL) < 0)
53 panic("Can't instantiate module signing keyring\n");
54
55 return 0;
56}
57
58/*
59 * Must be initialised before we try and load the keys into the keyring.
60 */
61device_initcall(module_verify_init);
62
63/*
64 * Load the compiled-in keys
65 */
66static __init int load_module_signing_keys(void)
67{
68 key_ref_t key;
69 const u8 *p, *end;
70 size_t plen;
71
72 pr_notice("Loading module verification certificates\n");
73
74 end = modsign_certificate_list_end;
75 p = modsign_certificate_list;
76 while (p < end) {
77 /* Each cert begins with an ASN.1 SEQUENCE tag and must be more
78 * than 256 bytes in size.
79 */
80 if (end - p < 4)
81 goto dodgy_cert;
82 if (p[0] != 0x30 &&
83 p[1] != 0x82)
84 goto dodgy_cert;
85 plen = (p[2] << 8) | p[3];
86 plen += 4;
87 if (plen > end - p)
88 goto dodgy_cert;
89
90 key = key_create_or_update(make_key_ref(modsign_keyring, 1),
91 "asymmetric",
92 NULL,
93 p,
94 plen,
95 (KEY_POS_ALL & ~KEY_POS_SETATTR) |
96 KEY_USR_VIEW,
97 KEY_ALLOC_NOT_IN_QUOTA);
98 if (IS_ERR(key))
99 pr_err("MODSIGN: Problem loading in-kernel X.509 certificate (%ld)\n",
100 PTR_ERR(key));
101 else
102 pr_notice("MODSIGN: Loaded cert '%s'\n",
103 key_ref_to_ptr(key)->description);
104 p += plen;
105 }
106
107 return 0;
108
109dodgy_cert:
110 pr_err("MODSIGN: Problem parsing in-kernel X.509 certificate list\n");
111 return 0;
112}
113late_initcall(load_module_signing_keys);
diff --git a/kernel/module-internal.h b/kernel/module-internal.h
new file mode 100644
index 000000000000..6114a13419bd
--- /dev/null
+++ b/kernel/module-internal.h
@@ -0,0 +1,15 @@
1/* Module internals
2 *
3 * Copyright (C) 2012 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
12extern struct key *modsign_keyring;
13
14extern int mod_verify_sig(const void *mod, unsigned long modlen,
15 const void *sig, unsigned long siglen);
diff --git a/kernel/module.c b/kernel/module.c
index 4edbd9c11aca..0e2da8695f8e 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -58,6 +58,8 @@
58#include <linux/jump_label.h> 58#include <linux/jump_label.h>
59#include <linux/pfn.h> 59#include <linux/pfn.h>
60#include <linux/bsearch.h> 60#include <linux/bsearch.h>
61#include <linux/fips.h>
62#include "module-internal.h"
61 63
62#define CREATE_TRACE_POINTS 64#define CREATE_TRACE_POINTS
63#include <trace/events/module.h> 65#include <trace/events/module.h>
@@ -102,6 +104,43 @@ static LIST_HEAD(modules);
102struct list_head *kdb_modules = &modules; /* kdb needs the list of modules */ 104struct list_head *kdb_modules = &modules; /* kdb needs the list of modules */
103#endif /* CONFIG_KGDB_KDB */ 105#endif /* CONFIG_KGDB_KDB */
104 106
107#ifdef CONFIG_MODULE_SIG
108#ifdef CONFIG_MODULE_SIG_FORCE
109static bool sig_enforce = true;
110#else
111static bool sig_enforce = false;
112
113static int param_set_bool_enable_only(const char *val,
114 const struct kernel_param *kp)
115{
116 int err;
117 bool test;
118 struct kernel_param dummy_kp = *kp;
119
120 dummy_kp.arg = &test;
121
122 err = param_set_bool(val, &dummy_kp);
123 if (err)
124 return err;
125
126 /* Don't let them unset it once it's set! */
127 if (!test && sig_enforce)
128 return -EROFS;
129
130 if (test)
131 sig_enforce = true;
132 return 0;
133}
134
135static const struct kernel_param_ops param_ops_bool_enable_only = {
136 .set = param_set_bool_enable_only,
137 .get = param_get_bool,
138};
139#define param_check_bool_enable_only param_check_bool
140
141module_param(sig_enforce, bool_enable_only, 0644);
142#endif /* !CONFIG_MODULE_SIG_FORCE */
143#endif /* CONFIG_MODULE_SIG */
105 144
106/* Block module loading/unloading? */ 145/* Block module loading/unloading? */
107int modules_disabled = 0; 146int modules_disabled = 0;
@@ -136,6 +175,7 @@ struct load_info {
136 unsigned long symoffs, stroffs; 175 unsigned long symoffs, stroffs;
137 struct _ddebug *debug; 176 struct _ddebug *debug;
138 unsigned int num_debug; 177 unsigned int num_debug;
178 bool sig_ok;
139 struct { 179 struct {
140 unsigned int sym, str, mod, vers, info, pcpu; 180 unsigned int sym, str, mod, vers, info, pcpu;
141 } index; 181 } index;
@@ -1949,26 +1989,6 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
1949 return ret; 1989 return ret;
1950} 1990}
1951 1991
1952int __weak apply_relocate(Elf_Shdr *sechdrs,
1953 const char *strtab,
1954 unsigned int symindex,
1955 unsigned int relsec,
1956 struct module *me)
1957{
1958 pr_err("module %s: REL relocation unsupported\n", me->name);
1959 return -ENOEXEC;
1960}
1961
1962int __weak apply_relocate_add(Elf_Shdr *sechdrs,
1963 const char *strtab,
1964 unsigned int symindex,
1965 unsigned int relsec,
1966 struct module *me)
1967{
1968 pr_err("module %s: RELA relocation unsupported\n", me->name);
1969 return -ENOEXEC;
1970}
1971
1972static int apply_relocations(struct module *mod, const struct load_info *info) 1992static int apply_relocations(struct module *mod, const struct load_info *info)
1973{ 1993{
1974 unsigned int i; 1994 unsigned int i;
@@ -2399,7 +2419,52 @@ static inline void kmemleak_load_module(const struct module *mod,
2399} 2419}
2400#endif 2420#endif
2401 2421
2402/* Sets info->hdr and info->len. */ 2422#ifdef CONFIG_MODULE_SIG
2423static int module_sig_check(struct load_info *info,
2424 const void *mod, unsigned long *len)
2425{
2426 int err = -ENOKEY;
2427 const unsigned long markerlen = sizeof(MODULE_SIG_STRING) - 1;
2428 const void *p = mod, *end = mod + *len;
2429
2430 /* Poor man's memmem. */
2431 while ((p = memchr(p, MODULE_SIG_STRING[0], end - p))) {
2432 if (p + markerlen > end)
2433 break;
2434
2435 if (memcmp(p, MODULE_SIG_STRING, markerlen) == 0) {
2436 const void *sig = p + markerlen;
2437 /* Truncate module up to signature. */
2438 *len = p - mod;
2439 err = mod_verify_sig(mod, *len, sig, end - sig);
2440 break;
2441 }
2442 p++;
2443 }
2444
2445 if (!err) {
2446 info->sig_ok = true;
2447 return 0;
2448 }
2449
2450 /* Not having a signature is only an error if we're strict. */
2451 if (err < 0 && fips_enabled)
2452 panic("Module verification failed with error %d in FIPS mode\n",
2453 err);
2454 if (err == -ENOKEY && !sig_enforce)
2455 err = 0;
2456
2457 return err;
2458}
2459#else /* !CONFIG_MODULE_SIG */
2460static int module_sig_check(struct load_info *info,
2461 void *mod, unsigned long *len)
2462{
2463 return 0;
2464}
2465#endif /* !CONFIG_MODULE_SIG */
2466
2467/* Sets info->hdr, info->len and info->sig_ok. */
2403static int copy_and_check(struct load_info *info, 2468static int copy_and_check(struct load_info *info,
2404 const void __user *umod, unsigned long len, 2469 const void __user *umod, unsigned long len,
2405 const char __user *uargs) 2470 const char __user *uargs)
@@ -2419,6 +2484,10 @@ static int copy_and_check(struct load_info *info,
2419 goto free_hdr; 2484 goto free_hdr;
2420 } 2485 }
2421 2486
2487 err = module_sig_check(info, hdr, &len);
2488 if (err)
2489 goto free_hdr;
2490
2422 /* Sanity checks against insmoding binaries or wrong arch, 2491 /* Sanity checks against insmoding binaries or wrong arch,
2423 weird elf version */ 2492 weird elf version */
2424 if (memcmp(hdr->e_ident, ELFMAG, SELFMAG) != 0 2493 if (memcmp(hdr->e_ident, ELFMAG, SELFMAG) != 0
@@ -2730,6 +2799,10 @@ static int check_module_license_and_versions(struct module *mod)
2730 if (strcmp(mod->name, "driverloader") == 0) 2799 if (strcmp(mod->name, "driverloader") == 0)
2731 add_taint_module(mod, TAINT_PROPRIETARY_MODULE); 2800 add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
2732 2801
2802 /* lve claims to be GPL but upstream won't provide source */
2803 if (strcmp(mod->name, "lve") == 0)
2804 add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
2805
2733#ifdef CONFIG_MODVERSIONS 2806#ifdef CONFIG_MODVERSIONS
2734 if ((mod->num_syms && !mod->crcs) 2807 if ((mod->num_syms && !mod->crcs)
2735 || (mod->num_gpl_syms && !mod->gpl_crcs) 2808 || (mod->num_gpl_syms && !mod->gpl_crcs)
@@ -2861,6 +2934,20 @@ static int post_relocation(struct module *mod, const struct load_info *info)
2861 return module_finalize(info->hdr, info->sechdrs, mod); 2934 return module_finalize(info->hdr, info->sechdrs, mod);
2862} 2935}
2863 2936
2937/* Is this module of this name done loading? No locks held. */
2938static bool finished_loading(const char *name)
2939{
2940 struct module *mod;
2941 bool ret;
2942
2943 mutex_lock(&module_mutex);
2944 mod = find_module(name);
2945 ret = !mod || mod->state != MODULE_STATE_COMING;
2946 mutex_unlock(&module_mutex);
2947
2948 return ret;
2949}
2950
2864/* Allocate and load the module: note that size of section 0 is always 2951/* Allocate and load the module: note that size of section 0 is always
2865 zero, and we rely on this for optional sections. */ 2952 zero, and we rely on this for optional sections. */
2866static struct module *load_module(void __user *umod, 2953static struct module *load_module(void __user *umod,
@@ -2868,7 +2955,7 @@ static struct module *load_module(void __user *umod,
2868 const char __user *uargs) 2955 const char __user *uargs)
2869{ 2956{
2870 struct load_info info = { NULL, }; 2957 struct load_info info = { NULL, };
2871 struct module *mod; 2958 struct module *mod, *old;
2872 long err; 2959 long err;
2873 2960
2874 pr_debug("load_module: umod=%p, len=%lu, uargs=%p\n", 2961 pr_debug("load_module: umod=%p, len=%lu, uargs=%p\n",
@@ -2886,6 +2973,12 @@ static struct module *load_module(void __user *umod,
2886 goto free_copy; 2973 goto free_copy;
2887 } 2974 }
2888 2975
2976#ifdef CONFIG_MODULE_SIG
2977 mod->sig_ok = info.sig_ok;
2978 if (!mod->sig_ok)
2979 add_taint_module(mod, TAINT_FORCED_MODULE);
2980#endif
2981
2889 /* Now module is in final location, initialize linked lists, etc. */ 2982 /* Now module is in final location, initialize linked lists, etc. */
2890 err = module_unload_init(mod); 2983 err = module_unload_init(mod);
2891 if (err) 2984 if (err)
@@ -2934,8 +3027,18 @@ static struct module *load_module(void __user *umod,
2934 * function to insert in a way safe to concurrent readers. 3027 * function to insert in a way safe to concurrent readers.
2935 * The mutex protects against concurrent writers. 3028 * The mutex protects against concurrent writers.
2936 */ 3029 */
3030again:
2937 mutex_lock(&module_mutex); 3031 mutex_lock(&module_mutex);
2938 if (find_module(mod->name)) { 3032 if ((old = find_module(mod->name)) != NULL) {
3033 if (old->state == MODULE_STATE_COMING) {
3034 /* Wait in case it fails to load. */
3035 mutex_unlock(&module_mutex);
3036 err = wait_event_interruptible(module_wq,
3037 finished_loading(mod->name));
3038 if (err)
3039 goto free_arch_cleanup;
3040 goto again;
3041 }
2939 err = -EEXIST; 3042 err = -EEXIST;
2940 goto unlock; 3043 goto unlock;
2941 } 3044 }
@@ -2975,7 +3078,7 @@ static struct module *load_module(void __user *umod,
2975 /* Unlink carefully: kallsyms could be walking list. */ 3078 /* Unlink carefully: kallsyms could be walking list. */
2976 list_del_rcu(&mod->list); 3079 list_del_rcu(&mod->list);
2977 module_bug_cleanup(mod); 3080 module_bug_cleanup(mod);
2978 3081 wake_up_all(&module_wq);
2979 ddebug: 3082 ddebug:
2980 dynamic_debug_remove(info.debug); 3083 dynamic_debug_remove(info.debug);
2981 unlock: 3084 unlock:
@@ -3050,7 +3153,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
3050 blocking_notifier_call_chain(&module_notify_list, 3153 blocking_notifier_call_chain(&module_notify_list,
3051 MODULE_STATE_GOING, mod); 3154 MODULE_STATE_GOING, mod);
3052 free_module(mod); 3155 free_module(mod);
3053 wake_up(&module_wq); 3156 wake_up_all(&module_wq);
3054 return ret; 3157 return ret;
3055 } 3158 }
3056 if (ret > 0) { 3159 if (ret > 0) {
@@ -3062,9 +3165,8 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
3062 dump_stack(); 3165 dump_stack();
3063 } 3166 }
3064 3167
3065 /* Now it's a first class citizen! Wake up anyone waiting for it. */ 3168 /* Now it's a first class citizen! */
3066 mod->state = MODULE_STATE_LIVE; 3169 mod->state = MODULE_STATE_LIVE;
3067 wake_up(&module_wq);
3068 blocking_notifier_call_chain(&module_notify_list, 3170 blocking_notifier_call_chain(&module_notify_list,
3069 MODULE_STATE_LIVE, mod); 3171 MODULE_STATE_LIVE, mod);
3070 3172
@@ -3087,6 +3189,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
3087 mod->init_ro_size = 0; 3189 mod->init_ro_size = 0;
3088 mod->init_text_size = 0; 3190 mod->init_text_size = 0;
3089 mutex_unlock(&module_mutex); 3191 mutex_unlock(&module_mutex);
3192 wake_up_all(&module_wq);
3090 3193
3091 return 0; 3194 return 0;
3092} 3195}
diff --git a/kernel/module_signing.c b/kernel/module_signing.c
new file mode 100644
index 000000000000..6b09f6983ac0
--- /dev/null
+++ b/kernel/module_signing.c
@@ -0,0 +1,243 @@
1/* Module signature checker
2 *
3 * Copyright (C) 2012 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#include <linux/kernel.h>
13#include <linux/err.h>
14#include <crypto/public_key.h>
15#include <crypto/hash.h>
16#include <keys/asymmetric-type.h>
17#include "module-internal.h"
18
19/*
20 * Module signature information block.
21 *
22 * The constituents of the signature section are, in order:
23 *
24 * - Signer's name
25 * - Key identifier
26 * - Signature data
27 * - Information block
28 */
29struct module_signature {
30 enum pkey_algo algo : 8; /* Public-key crypto algorithm */
31 enum pkey_hash_algo hash : 8; /* Digest algorithm */
32 enum pkey_id_type id_type : 8; /* Key identifier type */
33 u8 signer_len; /* Length of signer's name */
34 u8 key_id_len; /* Length of key identifier */
35 u8 __pad[3];
36 __be32 sig_len; /* Length of signature data */
37};
38
39/*
40 * Digest the module contents.
41 */
42static struct public_key_signature *mod_make_digest(enum pkey_hash_algo hash,
43 const void *mod,
44 unsigned long modlen)
45{
46 struct public_key_signature *pks;
47 struct crypto_shash *tfm;
48 struct shash_desc *desc;
49 size_t digest_size, desc_size;
50 int ret;
51
52 pr_devel("==>%s()\n", __func__);
53
54 /* Allocate the hashing algorithm we're going to need and find out how
55 * big the hash operational data will be.
56 */
57 tfm = crypto_alloc_shash(pkey_hash_algo[hash], 0, 0);
58 if (IS_ERR(tfm))
59 return (PTR_ERR(tfm) == -ENOENT) ? ERR_PTR(-ENOPKG) : ERR_CAST(tfm);
60
61 desc_size = crypto_shash_descsize(tfm) + sizeof(*desc);
62 digest_size = crypto_shash_digestsize(tfm);
63
64 /* We allocate the hash operational data storage on the end of our
65 * context data and the digest output buffer on the end of that.
66 */
67 ret = -ENOMEM;
68 pks = kzalloc(digest_size + sizeof(*pks) + desc_size, GFP_KERNEL);
69 if (!pks)
70 goto error_no_pks;
71
72 pks->pkey_hash_algo = hash;
73 pks->digest = (u8 *)pks + sizeof(*pks) + desc_size;
74 pks->digest_size = digest_size;
75
76 desc = (void *)pks + sizeof(*pks);
77 desc->tfm = tfm;
78 desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
79
80 ret = crypto_shash_init(desc);
81 if (ret < 0)
82 goto error;
83
84 ret = crypto_shash_finup(desc, mod, modlen, pks->digest);
85 if (ret < 0)
86 goto error;
87
88 crypto_free_shash(tfm);
89 pr_devel("<==%s() = ok\n", __func__);
90 return pks;
91
92error:
93 kfree(pks);
94error_no_pks:
95 crypto_free_shash(tfm);
96 pr_devel("<==%s() = %d\n", __func__, ret);
97 return ERR_PTR(ret);
98}
99
100/*
101 * Extract an MPI array from the signature data. This represents the actual
102 * signature. Each raw MPI is prefaced by a BE 2-byte value indicating the
103 * size of the MPI in bytes.
104 *
105 * RSA signatures only have one MPI, so currently we only read one.
106 */
107static int mod_extract_mpi_array(struct public_key_signature *pks,
108 const void *data, size_t len)
109{
110 size_t nbytes;
111 MPI mpi;
112
113 if (len < 3)
114 return -EBADMSG;
115 nbytes = ((const u8 *)data)[0] << 8 | ((const u8 *)data)[1];
116 data += 2;
117 len -= 2;
118 if (len != nbytes)
119 return -EBADMSG;
120
121 mpi = mpi_read_raw_data(data, nbytes);
122 if (!mpi)
123 return -ENOMEM;
124 pks->mpi[0] = mpi;
125 pks->nr_mpi = 1;
126 return 0;
127}
128
129/*
130 * Request an asymmetric key.
131 */
132static struct key *request_asymmetric_key(const char *signer, size_t signer_len,
133 const u8 *key_id, size_t key_id_len)
134{
135 key_ref_t key;
136 size_t i;
137 char *id, *q;
138
139 pr_devel("==>%s(,%zu,,%zu)\n", __func__, signer_len, key_id_len);
140
141 /* Construct an identifier. */
142 id = kmalloc(signer_len + 2 + key_id_len * 2 + 1, GFP_KERNEL);
143 if (!id)
144 return ERR_PTR(-ENOKEY);
145
146 memcpy(id, signer, signer_len);
147
148 q = id + signer_len;
149 *q++ = ':';
150 *q++ = ' ';
151 for (i = 0; i < key_id_len; i++) {
152 *q++ = hex_asc[*key_id >> 4];
153 *q++ = hex_asc[*key_id++ & 0x0f];
154 }
155
156 *q = 0;
157
158 pr_debug("Look up: \"%s\"\n", id);
159
160 key = keyring_search(make_key_ref(modsign_keyring, 1),
161 &key_type_asymmetric, id);
162 if (IS_ERR(key))
163 pr_warn("Request for unknown module key '%s' err %ld\n",
164 id, PTR_ERR(key));
165 kfree(id);
166
167 if (IS_ERR(key)) {
168 switch (PTR_ERR(key)) {
169 /* Hide some search errors */
170 case -EACCES:
171 case -ENOTDIR:
172 case -EAGAIN:
173 return ERR_PTR(-ENOKEY);
174 default:
175 return ERR_CAST(key);
176 }
177 }
178
179 pr_devel("<==%s() = 0 [%x]\n", __func__, key_serial(key_ref_to_ptr(key)));
180 return key_ref_to_ptr(key);
181}
182
183/*
184 * Verify the signature on a module.
185 */
186int mod_verify_sig(const void *mod, unsigned long modlen,
187 const void *sig, unsigned long siglen)
188{
189 struct public_key_signature *pks;
190 struct module_signature ms;
191 struct key *key;
192 size_t sig_len;
193 int ret;
194
195 pr_devel("==>%s(,%lu,,%lu,)\n", __func__, modlen, siglen);
196
197 if (siglen <= sizeof(ms))
198 return -EBADMSG;
199
200 memcpy(&ms, sig + (siglen - sizeof(ms)), sizeof(ms));
201 siglen -= sizeof(ms);
202
203 sig_len = be32_to_cpu(ms.sig_len);
204 if (sig_len >= siglen ||
205 siglen - sig_len != (size_t)ms.signer_len + ms.key_id_len)
206 return -EBADMSG;
207
208 /* For the moment, only support RSA and X.509 identifiers */
209 if (ms.algo != PKEY_ALGO_RSA ||
210 ms.id_type != PKEY_ID_X509)
211 return -ENOPKG;
212
213 if (ms.hash >= PKEY_HASH__LAST ||
214 !pkey_hash_algo[ms.hash])
215 return -ENOPKG;
216
217 key = request_asymmetric_key(sig, ms.signer_len,
218 sig + ms.signer_len, ms.key_id_len);
219 if (IS_ERR(key))
220 return PTR_ERR(key);
221
222 pks = mod_make_digest(ms.hash, mod, modlen);
223 if (IS_ERR(pks)) {
224 ret = PTR_ERR(pks);
225 goto error_put_key;
226 }
227
228 ret = mod_extract_mpi_array(pks, sig + ms.signer_len + ms.key_id_len,
229 sig_len);
230 if (ret < 0)
231 goto error_free_pks;
232
233 ret = verify_signature(key, pks);
234 pr_devel("verify_signature() = %d\n", ret);
235
236error_free_pks:
237 mpi_free(pks->rsa.s);
238 kfree(pks);
239error_put_key:
240 key_put(key);
241 pr_devel("<==%s() = %d\n", __func__, ret);
242 return ret;
243}
diff --git a/lib/.gitignore b/lib/.gitignore
index 3bef1ea94c99..09aae85418ab 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -3,4 +3,4 @@
3# 3#
4gen_crc32table 4gen_crc32table
5crc32table.h 5crc32table.h
6 6oid_registry_data.c
diff --git a/lib/Kconfig b/lib/Kconfig
index bb94c1ba616a..4b31a46fb307 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -396,4 +396,9 @@ config SIGNATURE
396config LIBFDT 396config LIBFDT
397 bool 397 bool
398 398
399config OID_REGISTRY
400 tristate
401 help
402 Enable fast lookup object identifier registry.
403
399endmenu 404endmenu
diff --git a/lib/Makefile b/lib/Makefile
index 3128e357e286..821a16229111 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -145,6 +145,8 @@ obj-$(CONFIG_INTERVAL_TREE_TEST) += interval_tree_test.o
145 145
146interval_tree_test-objs := interval_tree_test_main.o interval_tree.o 146interval_tree_test-objs := interval_tree_test_main.o interval_tree.o
147 147
148obj-$(CONFIG_ASN1) += asn1_decoder.o
149
148hostprogs-y := gen_crc32table 150hostprogs-y := gen_crc32table
149clean-files := crc32table.h 151clean-files := crc32table.h
150 152
@@ -155,3 +157,19 @@ quiet_cmd_crc32 = GEN $@
155 157
156$(obj)/crc32table.h: $(obj)/gen_crc32table 158$(obj)/crc32table.h: $(obj)/gen_crc32table
157 $(call cmd,crc32) 159 $(call cmd,crc32)
160
161#
162# Build a fast OID lookip registry from include/linux/oid_registry.h
163#
164obj-$(CONFIG_OID_REGISTRY) += oid_registry.o
165
166$(obj)/oid_registry.c: $(obj)/oid_registry_data.c
167
168$(obj)/oid_registry_data.c: $(srctree)/include/linux/oid_registry.h \
169 $(src)/build_OID_registry
170 $(call cmd,build_OID_registry)
171
172quiet_cmd_build_OID_registry = GEN $@
173 cmd_build_OID_registry = perl $(srctree)/$(src)/build_OID_registry $< $@
174
175clean-files += oid_registry_data.c
diff --git a/lib/asn1_decoder.c b/lib/asn1_decoder.c
new file mode 100644
index 000000000000..de2c8b5a715b
--- /dev/null
+++ b/lib/asn1_decoder.c
@@ -0,0 +1,487 @@
1/* Decoder for ASN.1 BER/DER/CER encoded bytestream
2 *
3 * Copyright (C) 2012 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#include <linux/export.h>
13#include <linux/kernel.h>
14#include <linux/errno.h>
15#include <linux/asn1_decoder.h>
16#include <linux/asn1_ber_bytecode.h>
17
18static const unsigned char asn1_op_lengths[ASN1_OP__NR] = {
19 /* OPC TAG JMP ACT */
20 [ASN1_OP_MATCH] = 1 + 1,
21 [ASN1_OP_MATCH_OR_SKIP] = 1 + 1,
22 [ASN1_OP_MATCH_ACT] = 1 + 1 + 1,
23 [ASN1_OP_MATCH_ACT_OR_SKIP] = 1 + 1 + 1,
24 [ASN1_OP_MATCH_JUMP] = 1 + 1 + 1,
25 [ASN1_OP_MATCH_JUMP_OR_SKIP] = 1 + 1 + 1,
26 [ASN1_OP_MATCH_ANY] = 1,
27 [ASN1_OP_MATCH_ANY_ACT] = 1 + 1,
28 [ASN1_OP_COND_MATCH_OR_SKIP] = 1 + 1,
29 [ASN1_OP_COND_MATCH_ACT_OR_SKIP] = 1 + 1 + 1,
30 [ASN1_OP_COND_MATCH_JUMP_OR_SKIP] = 1 + 1 + 1,
31 [ASN1_OP_COND_MATCH_ANY] = 1,
32 [ASN1_OP_COND_MATCH_ANY_ACT] = 1 + 1,
33 [ASN1_OP_COND_FAIL] = 1,
34 [ASN1_OP_COMPLETE] = 1,
35 [ASN1_OP_ACT] = 1 + 1,
36 [ASN1_OP_RETURN] = 1,
37 [ASN1_OP_END_SEQ] = 1,
38 [ASN1_OP_END_SEQ_OF] = 1 + 1,
39 [ASN1_OP_END_SET] = 1,
40 [ASN1_OP_END_SET_OF] = 1 + 1,
41 [ASN1_OP_END_SEQ_ACT] = 1 + 1,
42 [ASN1_OP_END_SEQ_OF_ACT] = 1 + 1 + 1,
43 [ASN1_OP_END_SET_ACT] = 1 + 1,
44 [ASN1_OP_END_SET_OF_ACT] = 1 + 1 + 1,
45};
46
47/*
48 * Find the length of an indefinite length object
49 * @data: The data buffer
50 * @datalen: The end of the innermost containing element in the buffer
51 * @_dp: The data parse cursor (updated before returning)
52 * @_len: Where to return the size of the element.
53 * @_errmsg: Where to return a pointer to an error message on error
54 */
55static int asn1_find_indefinite_length(const unsigned char *data, size_t datalen,
56 size_t *_dp, size_t *_len,
57 const char **_errmsg)
58{
59 unsigned char tag, tmp;
60 size_t dp = *_dp, len, n;
61 int indef_level = 1;
62
63next_tag:
64 if (unlikely(datalen - dp < 2)) {
65 if (datalen == dp)
66 goto missing_eoc;
67 goto data_overrun_error;
68 }
69
70 /* Extract a tag from the data */
71 tag = data[dp++];
72 if (tag == 0) {
73 /* It appears to be an EOC. */
74 if (data[dp++] != 0)
75 goto invalid_eoc;
76 if (--indef_level <= 0) {
77 *_len = dp - *_dp;
78 *_dp = dp;
79 return 0;
80 }
81 goto next_tag;
82 }
83
84 if (unlikely((tag & 0x1f) == 0x1f)) {
85 do {
86 if (unlikely(datalen - dp < 2))
87 goto data_overrun_error;
88 tmp = data[dp++];
89 } while (tmp & 0x80);
90 }
91
92 /* Extract the length */
93 len = data[dp++];
94 if (len < 0x7f) {
95 dp += len;
96 goto next_tag;
97 }
98
99 if (unlikely(len == 0x80)) {
100 /* Indefinite length */
101 if (unlikely((tag & ASN1_CONS_BIT) == ASN1_PRIM << 5))
102 goto indefinite_len_primitive;
103 indef_level++;
104 goto next_tag;
105 }
106
107 n = len - 0x80;
108 if (unlikely(n > sizeof(size_t) - 1))
109 goto length_too_long;
110 if (unlikely(n > datalen - dp))
111 goto data_overrun_error;
112 for (len = 0; n > 0; n--) {
113 len <<= 8;
114 len |= data[dp++];
115 }
116 dp += len;
117 goto next_tag;
118
119length_too_long:
120 *_errmsg = "Unsupported length";
121 goto error;
122indefinite_len_primitive:
123 *_errmsg = "Indefinite len primitive not permitted";
124 goto error;
125invalid_eoc:
126 *_errmsg = "Invalid length EOC";
127 goto error;
128data_overrun_error:
129 *_errmsg = "Data overrun error";
130 goto error;
131missing_eoc:
132 *_errmsg = "Missing EOC in indefinite len cons";
133error:
134 *_dp = dp;
135 return -1;
136}
137
138/**
139 * asn1_ber_decoder - Decoder BER/DER/CER ASN.1 according to pattern
140 * @decoder: The decoder definition (produced by asn1_compiler)
141 * @context: The caller's context (to be passed to the action functions)
142 * @data: The encoded data
143 * @datasize: The size of the encoded data
144 *
145 * Decode BER/DER/CER encoded ASN.1 data according to a bytecode pattern
146 * produced by asn1_compiler. Action functions are called on marked tags to
147 * allow the caller to retrieve significant data.
148 *
149 * LIMITATIONS:
150 *
151 * To keep down the amount of stack used by this function, the following limits
152 * have been imposed:
153 *
154 * (1) This won't handle datalen > 65535 without increasing the size of the
155 * cons stack elements and length_too_long checking.
156 *
157 * (2) The stack of constructed types is 10 deep. If the depth of non-leaf
158 * constructed types exceeds this, the decode will fail.
159 *
160 * (3) The SET type (not the SET OF type) isn't really supported as tracking
161 * what members of the set have been seen is a pain.
162 */
163int asn1_ber_decoder(const struct asn1_decoder *decoder,
164 void *context,
165 const unsigned char *data,
166 size_t datalen)
167{
168 const unsigned char *machine = decoder->machine;
169 const asn1_action_t *actions = decoder->actions;
170 size_t machlen = decoder->machlen;
171 enum asn1_opcode op;
172 unsigned char tag = 0, csp = 0, jsp = 0, optag = 0, hdr = 0;
173 const char *errmsg;
174 size_t pc = 0, dp = 0, tdp = 0, len = 0;
175 int ret;
176
177 unsigned char flags = 0;
178#define FLAG_INDEFINITE_LENGTH 0x01
179#define FLAG_MATCHED 0x02
180#define FLAG_CONS 0x20 /* Corresponds to CONS bit in the opcode tag
181 * - ie. whether or not we are going to parse
182 * a compound type.
183 */
184
185#define NR_CONS_STACK 10
186 unsigned short cons_dp_stack[NR_CONS_STACK];
187 unsigned short cons_datalen_stack[NR_CONS_STACK];
188 unsigned char cons_hdrlen_stack[NR_CONS_STACK];
189#define NR_JUMP_STACK 10
190 unsigned char jump_stack[NR_JUMP_STACK];
191
192 if (datalen > 65535)
193 return -EMSGSIZE;
194
195next_op:
196 pr_debug("next_op: pc=\e[32m%zu\e[m/%zu dp=\e[33m%zu\e[m/%zu C=%d J=%d\n",
197 pc, machlen, dp, datalen, csp, jsp);
198 if (unlikely(pc >= machlen))
199 goto machine_overrun_error;
200 op = machine[pc];
201 if (unlikely(pc + asn1_op_lengths[op] > machlen))
202 goto machine_overrun_error;
203
204 /* If this command is meant to match a tag, then do that before
205 * evaluating the command.
206 */
207 if (op <= ASN1_OP__MATCHES_TAG) {
208 unsigned char tmp;
209
210 /* Skip conditional matches if possible */
211 if ((op & ASN1_OP_MATCH__COND &&
212 flags & FLAG_MATCHED) ||
213 dp == datalen) {
214 pc += asn1_op_lengths[op];
215 goto next_op;
216 }
217
218 flags = 0;
219 hdr = 2;
220
221 /* Extract a tag from the data */
222 if (unlikely(dp >= datalen - 1))
223 goto data_overrun_error;
224 tag = data[dp++];
225 if (unlikely((tag & 0x1f) == 0x1f))
226 goto long_tag_not_supported;
227
228 if (op & ASN1_OP_MATCH__ANY) {
229 pr_debug("- any %02x\n", tag);
230 } else {
231 /* Extract the tag from the machine
232 * - Either CONS or PRIM are permitted in the data if
233 * CONS is not set in the op stream, otherwise CONS
234 * is mandatory.
235 */
236 optag = machine[pc + 1];
237 flags |= optag & FLAG_CONS;
238
239 /* Determine whether the tag matched */
240 tmp = optag ^ tag;
241 tmp &= ~(optag & ASN1_CONS_BIT);
242 pr_debug("- match? %02x %02x %02x\n", tag, optag, tmp);
243 if (tmp != 0) {
244 /* All odd-numbered tags are MATCH_OR_SKIP. */
245 if (op & ASN1_OP_MATCH__SKIP) {
246 pc += asn1_op_lengths[op];
247 dp--;
248 goto next_op;
249 }
250 goto tag_mismatch;
251 }
252 }
253 flags |= FLAG_MATCHED;
254
255 len = data[dp++];
256 if (len > 0x7f) {
257 if (unlikely(len == 0x80)) {
258 /* Indefinite length */
259 if (unlikely(!(tag & ASN1_CONS_BIT)))
260 goto indefinite_len_primitive;
261 flags |= FLAG_INDEFINITE_LENGTH;
262 if (unlikely(2 > datalen - dp))
263 goto data_overrun_error;
264 } else {
265 int n = len - 0x80;
266 if (unlikely(n > 2))
267 goto length_too_long;
268 if (unlikely(dp >= datalen - n))
269 goto data_overrun_error;
270 hdr += n;
271 for (len = 0; n > 0; n--) {
272 len <<= 8;
273 len |= data[dp++];
274 }
275 if (unlikely(len > datalen - dp))
276 goto data_overrun_error;
277 }
278 }
279
280 if (flags & FLAG_CONS) {
281 /* For expected compound forms, we stack the positions
282 * of the start and end of the data.
283 */
284 if (unlikely(csp >= NR_CONS_STACK))
285 goto cons_stack_overflow;
286 cons_dp_stack[csp] = dp;
287 cons_hdrlen_stack[csp] = hdr;
288 if (!(flags & FLAG_INDEFINITE_LENGTH)) {
289 cons_datalen_stack[csp] = datalen;
290 datalen = dp + len;
291 } else {
292 cons_datalen_stack[csp] = 0;
293 }
294 csp++;
295 }
296
297 pr_debug("- TAG: %02x %zu%s\n",
298 tag, len, flags & FLAG_CONS ? " CONS" : "");
299 tdp = dp;
300 }
301
302 /* Decide how to handle the operation */
303 switch (op) {
304 case ASN1_OP_MATCH_ANY_ACT:
305 case ASN1_OP_COND_MATCH_ANY_ACT:
306 ret = actions[machine[pc + 1]](context, hdr, tag, data + dp, len);
307 if (ret < 0)
308 return ret;
309 goto skip_data;
310
311 case ASN1_OP_MATCH_ACT:
312 case ASN1_OP_MATCH_ACT_OR_SKIP:
313 case ASN1_OP_COND_MATCH_ACT_OR_SKIP:
314 ret = actions[machine[pc + 2]](context, hdr, tag, data + dp, len);
315 if (ret < 0)
316 return ret;
317 goto skip_data;
318
319 case ASN1_OP_MATCH:
320 case ASN1_OP_MATCH_OR_SKIP:
321 case ASN1_OP_MATCH_ANY:
322 case ASN1_OP_COND_MATCH_OR_SKIP:
323 case ASN1_OP_COND_MATCH_ANY:
324 skip_data:
325 if (!(flags & FLAG_CONS)) {
326 if (flags & FLAG_INDEFINITE_LENGTH) {
327 ret = asn1_find_indefinite_length(
328 data, datalen, &dp, &len, &errmsg);
329 if (ret < 0)
330 goto error;
331 } else {
332 dp += len;
333 }
334 pr_debug("- LEAF: %zu\n", len);
335 }
336 pc += asn1_op_lengths[op];
337 goto next_op;
338
339 case ASN1_OP_MATCH_JUMP:
340 case ASN1_OP_MATCH_JUMP_OR_SKIP:
341 case ASN1_OP_COND_MATCH_JUMP_OR_SKIP:
342 pr_debug("- MATCH_JUMP\n");
343 if (unlikely(jsp == NR_JUMP_STACK))
344 goto jump_stack_overflow;
345 jump_stack[jsp++] = pc + asn1_op_lengths[op];
346 pc = machine[pc + 2];
347 goto next_op;
348
349 case ASN1_OP_COND_FAIL:
350 if (unlikely(!(flags & FLAG_MATCHED)))
351 goto tag_mismatch;
352 pc += asn1_op_lengths[op];
353 goto next_op;
354
355 case ASN1_OP_COMPLETE:
356 if (unlikely(jsp != 0 || csp != 0)) {
357 pr_err("ASN.1 decoder error: Stacks not empty at completion (%u, %u)\n",
358 jsp, csp);
359 return -EBADMSG;
360 }
361 return 0;
362
363 case ASN1_OP_END_SET:
364 case ASN1_OP_END_SET_ACT:
365 if (unlikely(!(flags & FLAG_MATCHED)))
366 goto tag_mismatch;
367 case ASN1_OP_END_SEQ:
368 case ASN1_OP_END_SET_OF:
369 case ASN1_OP_END_SEQ_OF:
370 case ASN1_OP_END_SEQ_ACT:
371 case ASN1_OP_END_SET_OF_ACT:
372 case ASN1_OP_END_SEQ_OF_ACT:
373 if (unlikely(csp <= 0))
374 goto cons_stack_underflow;
375 csp--;
376 tdp = cons_dp_stack[csp];
377 hdr = cons_hdrlen_stack[csp];
378 len = datalen;
379 datalen = cons_datalen_stack[csp];
380 pr_debug("- end cons t=%zu dp=%zu l=%zu/%zu\n",
381 tdp, dp, len, datalen);
382 if (datalen == 0) {
383 /* Indefinite length - check for the EOC. */
384 datalen = len;
385 if (unlikely(datalen - dp < 2))
386 goto data_overrun_error;
387 if (data[dp++] != 0) {
388 if (op & ASN1_OP_END__OF) {
389 dp--;
390 csp++;
391 pc = machine[pc + 1];
392 pr_debug("- continue\n");
393 goto next_op;
394 }
395 goto missing_eoc;
396 }
397 if (data[dp++] != 0)
398 goto invalid_eoc;
399 len = dp - tdp - 2;
400 } else {
401 if (dp < len && (op & ASN1_OP_END__OF)) {
402 datalen = len;
403 csp++;
404 pc = machine[pc + 1];
405 pr_debug("- continue\n");
406 goto next_op;
407 }
408 if (dp != len)
409 goto cons_length_error;
410 len -= tdp;
411 pr_debug("- cons len l=%zu d=%zu\n", len, dp - tdp);
412 }
413
414 if (op & ASN1_OP_END__ACT) {
415 unsigned char act;
416 if (op & ASN1_OP_END__OF)
417 act = machine[pc + 2];
418 else
419 act = machine[pc + 1];
420 ret = actions[act](context, hdr, 0, data + tdp, len);
421 }
422 pc += asn1_op_lengths[op];
423 goto next_op;
424
425 case ASN1_OP_ACT:
426 ret = actions[machine[pc + 1]](context, hdr, tag, data + tdp, len);
427 pc += asn1_op_lengths[op];
428 goto next_op;
429
430 case ASN1_OP_RETURN:
431 if (unlikely(jsp <= 0))
432 goto jump_stack_underflow;
433 pc = jump_stack[--jsp];
434 goto next_op;
435
436 default:
437 break;
438 }
439
440 /* Shouldn't reach here */
441 pr_err("ASN.1 decoder error: Found reserved opcode (%u)\n", op);
442 return -EBADMSG;
443
444data_overrun_error:
445 errmsg = "Data overrun error";
446 goto error;
447machine_overrun_error:
448 errmsg = "Machine overrun error";
449 goto error;
450jump_stack_underflow:
451 errmsg = "Jump stack underflow";
452 goto error;
453jump_stack_overflow:
454 errmsg = "Jump stack overflow";
455 goto error;
456cons_stack_underflow:
457 errmsg = "Cons stack underflow";
458 goto error;
459cons_stack_overflow:
460 errmsg = "Cons stack overflow";
461 goto error;
462cons_length_error:
463 errmsg = "Cons length error";
464 goto error;
465missing_eoc:
466 errmsg = "Missing EOC in indefinite len cons";
467 goto error;
468invalid_eoc:
469 errmsg = "Invalid length EOC";
470 goto error;
471length_too_long:
472 errmsg = "Unsupported length";
473 goto error;
474indefinite_len_primitive:
475 errmsg = "Indefinite len primitive not permitted";
476 goto error;
477tag_mismatch:
478 errmsg = "Unexpected tag";
479 goto error;
480long_tag_not_supported:
481 errmsg = "Long tag not supported";
482error:
483 pr_debug("\nASN1: %s [m=%zu d=%zu ot=%02x t=%02x l=%zu]\n",
484 errmsg, pc, dp, optag, tag, len);
485 return -EBADMSG;
486}
487EXPORT_SYMBOL_GPL(asn1_ber_decoder);
diff --git a/lib/build_OID_registry b/lib/build_OID_registry
new file mode 100755
index 000000000000..dfbdaab81bc8
--- /dev/null
+++ b/lib/build_OID_registry
@@ -0,0 +1,209 @@
1#!/usr/bin/perl -w
2#
3# Build a static ASN.1 Object Identified (OID) registry
4#
5# Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
6# Written by David Howells (dhowells@redhat.com)
7#
8# This program is free software; you can redistribute it and/or
9# modify it under the terms of the GNU General Public Licence
10# as published by the Free Software Foundation; either version
11# 2 of the Licence, or (at your option) any later version.
12#
13
14use strict;
15
16my @names = ();
17my @oids = ();
18
19if ($#ARGV != 1) {
20 print STDERR "Format: ", $0, " <in-h-file> <out-c-file>\n";
21 exit(2);
22}
23
24#
25# Open the file to read from
26#
27open IN_FILE, "<$ARGV[0]" || die;
28while (<IN_FILE>) {
29 chomp;
30 if (m!\s+OID_([a-zA-z][a-zA-Z0-9_]+),\s+/[*]\s+([012][.0-9]*)\s+[*]/!) {
31 push @names, $1;
32 push @oids, $2;
33 }
34}
35close IN_FILE || die;
36
37#
38# Open the files to write into
39#
40open C_FILE, ">$ARGV[1]" or die;
41print C_FILE "/*\n";
42print C_FILE " * Automatically generated by ", $0, ". Do not edit\n";
43print C_FILE " */\n";
44
45#
46# Split the data up into separate lists and also determine the lengths of the
47# encoded data arrays.
48#
49my @indices = ();
50my @lengths = ();
51my $total_length = 0;
52
53print "Compiling ", $#names + 1, " OIDs\n";
54
55for (my $i = 0; $i <= $#names; $i++) {
56 my $name = $names[$i];
57 my $oid = $oids[$i];
58
59 my @components = split(/[.]/, $oid);
60
61 # Determine the encoded length of this OID
62 my $size = $#components;
63 for (my $loop = 2; $loop <= $#components; $loop++) {
64 my $c = $components[$loop];
65
66 # We will base128 encode the number
67 my $tmp = ($c == 0) ? 0 : int(log($c)/log(2));
68 $tmp = int($tmp / 7);
69 $size += $tmp;
70 }
71 push @lengths, $size;
72 push @indices, $total_length;
73 $total_length += $size;
74}
75
76#
77# Emit the look-up-by-OID index table
78#
79print C_FILE "\n";
80if ($total_length <= 255) {
81 print C_FILE "static const unsigned char oid_index[OID__NR + 1] = {\n";
82} else {
83 print C_FILE "static const unsigned short oid_index[OID__NR + 1] = {\n";
84}
85for (my $i = 0; $i <= $#names; $i++) {
86 print C_FILE "\t[OID_", $names[$i], "] = ", $indices[$i], ",\n"
87}
88print C_FILE "\t[OID__NR] = ", $total_length, "\n";
89print C_FILE "};\n";
90
91#
92# Encode the OIDs
93#
94my @encoded_oids = ();
95
96for (my $i = 0; $i <= $#names; $i++) {
97 my @octets = ();
98
99 my @components = split(/[.]/, $oids[$i]);
100
101 push @octets, $components[0] * 40 + $components[1];
102
103 for (my $loop = 2; $loop <= $#components; $loop++) {
104 my $c = $components[$loop];
105
106 # Base128 encode the number
107 my $tmp = ($c == 0) ? 0 : int(log($c)/log(2));
108 $tmp = int($tmp / 7);
109
110 for (; $tmp > 0; $tmp--) {
111 push @octets, (($c >> $tmp * 7) & 0x7f) | 0x80;
112 }
113 push @octets, $c & 0x7f;
114 }
115
116 push @encoded_oids, \@octets;
117}
118
119#
120# Create a hash value for each OID
121#
122my @hash_values = ();
123for (my $i = 0; $i <= $#names; $i++) {
124 my @octets = @{$encoded_oids[$i]};
125
126 my $hash = $#octets;
127 foreach (@octets) {
128 $hash += $_ * 33;
129 }
130
131 $hash = ($hash >> 24) ^ ($hash >> 16) ^ ($hash >> 8) ^ ($hash);
132
133 push @hash_values, $hash & 0xff;
134}
135
136#
137# Emit the OID data
138#
139print C_FILE "\n";
140print C_FILE "static const unsigned char oid_data[", $total_length, "] = {\n";
141for (my $i = 0; $i <= $#names; $i++) {
142 my @octets = @{$encoded_oids[$i]};
143 print C_FILE "\t";
144 print C_FILE $_, ", " foreach (@octets);
145 print C_FILE "\t// ", $names[$i];
146 print C_FILE "\n";
147}
148print C_FILE "};\n";
149
150#
151# Build the search index table (ordered by length then hash then content)
152#
153my @index_table = ( 0 .. $#names );
154
155@index_table = sort {
156 my @octets_a = @{$encoded_oids[$a]};
157 my @octets_b = @{$encoded_oids[$b]};
158
159 return $hash_values[$a] <=> $hash_values[$b]
160 if ($hash_values[$a] != $hash_values[$b]);
161 return $#octets_a <=> $#octets_b
162 if ($#octets_a != $#octets_b);
163 for (my $i = $#octets_a; $i >= 0; $i--) {
164 return $octets_a[$i] <=> $octets_b[$i]
165 if ($octets_a[$i] != $octets_b[$i]);
166 }
167 return 0;
168
169} @index_table;
170
171#
172# Emit the search index and hash value table
173#
174print C_FILE "\n";
175print C_FILE "static const struct {\n";
176print C_FILE "\tunsigned char hash;\n";
177if ($#names <= 255) {
178 print C_FILE "\tenum OID oid : 8;\n";
179} else {
180 print C_FILE "\tenum OID oid : 16;\n";
181}
182print C_FILE "} oid_search_table[OID__NR] = {\n";
183for (my $i = 0; $i <= $#names; $i++) {
184 my @octets = @{$encoded_oids[$index_table[$i]]};
185 printf(C_FILE "\t[%3u] = { %3u, OID_%-35s }, // ",
186 $i,
187 $hash_values[$index_table[$i]],
188 $names[$index_table[$i]]);
189 printf C_FILE "%02x", $_ foreach (@octets);
190 print C_FILE "\n";
191}
192print C_FILE "};\n";
193
194#
195# Emit the OID debugging name table
196#
197#print C_FILE "\n";
198#print C_FILE "const char *const oid_name_table[OID__NR + 1] = {\n";
199#
200#for (my $i = 0; $i <= $#names; $i++) {
201# print C_FILE "\t\"", $names[$i], "\",\n"
202#}
203#print C_FILE "\t\"Unknown-OID\"\n";
204#print C_FILE "};\n";
205
206#
207# Polish off
208#
209close C_FILE or die;
diff --git a/lib/mpi/Makefile b/lib/mpi/Makefile
index 45ca90a8639c..019a68c90144 100644
--- a/lib/mpi/Makefile
+++ b/lib/mpi/Makefile
@@ -14,6 +14,7 @@ mpi-y = \
14 generic_mpih-add1.o \ 14 generic_mpih-add1.o \
15 mpicoder.o \ 15 mpicoder.o \
16 mpi-bit.o \ 16 mpi-bit.o \
17 mpi-cmp.o \
17 mpih-cmp.o \ 18 mpih-cmp.o \
18 mpih-div.o \ 19 mpih-div.o \
19 mpih-mul.o \ 20 mpih-mul.o \
diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
index 29f98624ef93..678ce4f1e124 100644
--- a/lib/mpi/longlong.h
+++ b/lib/mpi/longlong.h
@@ -19,6 +19,8 @@
19 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 19 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20 * MA 02111-1307, USA. */ 20 * MA 02111-1307, USA. */
21 21
22#include <asm-generic/bitops/count_zeros.h>
23
22/* You have to define the following before including this file: 24/* You have to define the following before including this file:
23 * 25 *
24 * UWtype -- An unsigned type, default type for operations (typically a "word") 26 * UWtype -- An unsigned type, default type for operations (typically a "word")
@@ -146,12 +148,6 @@ do { \
146 : "1" ((USItype)(n1)), \ 148 : "1" ((USItype)(n1)), \
147 "r" ((USItype)(n0)), \ 149 "r" ((USItype)(n0)), \
148 "r" ((USItype)(d))) 150 "r" ((USItype)(d)))
149
150#define count_leading_zeros(count, x) \
151 __asm__ ("clz %0,%1" \
152 : "=r" ((USItype)(count)) \
153 : "r" ((USItype)(x)))
154#define COUNT_LEADING_ZEROS_0 32
155#endif /* __a29k__ */ 151#endif /* __a29k__ */
156 152
157#if defined(__alpha) && W_TYPE_SIZE == 64 153#if defined(__alpha) && W_TYPE_SIZE == 64
@@ -298,11 +294,6 @@ extern UDItype __udiv_qrnnd();
298 : "1" ((USItype)(nh)), \ 294 : "1" ((USItype)(nh)), \
299 "0" ((USItype)(nl)), \ 295 "0" ((USItype)(nl)), \
300 "g" ((USItype)(d))) 296 "g" ((USItype)(d)))
301#define count_leading_zeros(count, x) \
302 __asm__ ("bsch/1 %1,%0" \
303 : "=g" (count) \
304 : "g" ((USItype)(x)), \
305 "0" ((USItype)0))
306#endif 297#endif
307 298
308/*************************************** 299/***************************************
@@ -354,27 +345,6 @@ do { USItype __r; \
354} while (0) 345} while (0)
355extern USItype __udiv_qrnnd(); 346extern USItype __udiv_qrnnd();
356#endif /* LONGLONG_STANDALONE */ 347#endif /* LONGLONG_STANDALONE */
357#define count_leading_zeros(count, x) \
358do { \
359 USItype __tmp; \
360 __asm__ ( \
361 "ldi 1,%0\n" \
362 "extru,= %1,15,16,%%r0 ; Bits 31..16 zero?\n" \
363 "extru,tr %1,15,16,%1 ; No. Shift down, skip add.\n" \
364 "ldo 16(%0),%0 ; Yes. Perform add.\n" \
365 "extru,= %1,23,8,%%r0 ; Bits 15..8 zero?\n" \
366 "extru,tr %1,23,8,%1 ; No. Shift down, skip add.\n" \
367 "ldo 8(%0),%0 ; Yes. Perform add.\n" \
368 "extru,= %1,27,4,%%r0 ; Bits 7..4 zero?\n" \
369 "extru,tr %1,27,4,%1 ; No. Shift down, skip add.\n" \
370 "ldo 4(%0),%0 ; Yes. Perform add.\n" \
371 "extru,= %1,29,2,%%r0 ; Bits 3..2 zero?\n" \
372 "extru,tr %1,29,2,%1 ; No. Shift down, skip add.\n" \
373 "ldo 2(%0),%0 ; Yes. Perform add.\n" \
374 "extru %1,30,1,%1 ; Extract bit 1.\n" \
375 "sub %0,%1,%0 ; Subtract it. " \
376 : "=r" (count), "=r" (__tmp) : "1" (x)); \
377} while (0)
378#endif /* hppa */ 348#endif /* hppa */
379 349
380/*************************************** 350/***************************************
@@ -457,15 +427,6 @@ do { \
457 : "0" ((USItype)(n0)), \ 427 : "0" ((USItype)(n0)), \
458 "1" ((USItype)(n1)), \ 428 "1" ((USItype)(n1)), \
459 "rm" ((USItype)(d))) 429 "rm" ((USItype)(d)))
460#define count_leading_zeros(count, x) \
461do { \
462 USItype __cbtmp; \
463 __asm__ ("bsrl %1,%0" \
464 : "=r" (__cbtmp) : "rm" ((USItype)(x))); \
465 (count) = __cbtmp ^ 31; \
466} while (0)
467#define count_trailing_zeros(count, x) \
468 __asm__ ("bsfl %1,%0" : "=r" (count) : "rm" ((USItype)(x)))
469#ifndef UMUL_TIME 430#ifndef UMUL_TIME
470#define UMUL_TIME 40 431#define UMUL_TIME 40
471#endif 432#endif
@@ -536,15 +497,6 @@ do { \
536 "dI" ((USItype)(d))); \ 497 "dI" ((USItype)(d))); \
537 (r) = __rq.__i.__l; (q) = __rq.__i.__h; \ 498 (r) = __rq.__i.__l; (q) = __rq.__i.__h; \
538} while (0) 499} while (0)
539#define count_leading_zeros(count, x) \
540do { \
541 USItype __cbtmp; \
542 __asm__ ("scanbit %1,%0" \
543 : "=r" (__cbtmp) \
544 : "r" ((USItype)(x))); \
545 (count) = __cbtmp ^ 31; \
546} while (0)
547#define COUNT_LEADING_ZEROS_0 (-32) /* sic */
548#if defined(__i960mx) /* what is the proper symbol to test??? */ 500#if defined(__i960mx) /* what is the proper symbol to test??? */
549#define rshift_rhlc(r, h, l, c) \ 501#define rshift_rhlc(r, h, l, c) \
550do { \ 502do { \
@@ -603,11 +555,6 @@ do { \
603 : "0" ((USItype)(n0)), \ 555 : "0" ((USItype)(n0)), \
604 "1" ((USItype)(n1)), \ 556 "1" ((USItype)(n1)), \
605 "dmi" ((USItype)(d))) 557 "dmi" ((USItype)(d)))
606#define count_leading_zeros(count, x) \
607 __asm__ ("bfffo %1{%b2:%b2},%0" \
608 : "=d" ((USItype)(count)) \
609 : "od" ((USItype)(x)), "n" (0))
610#define COUNT_LEADING_ZEROS_0 32
611#else /* not mc68020 */ 558#else /* not mc68020 */
612#define umul_ppmm(xh, xl, a, b) \ 559#define umul_ppmm(xh, xl, a, b) \
613do { USItype __umul_tmp1, __umul_tmp2; \ 560do { USItype __umul_tmp1, __umul_tmp2; \
@@ -664,15 +611,6 @@ do { USItype __umul_tmp1, __umul_tmp2; \
664 "rJ" ((USItype)(bh)), \ 611 "rJ" ((USItype)(bh)), \
665 "rJ" ((USItype)(al)), \ 612 "rJ" ((USItype)(al)), \
666 "rJ" ((USItype)(bl))) 613 "rJ" ((USItype)(bl)))
667#define count_leading_zeros(count, x) \
668do { \
669 USItype __cbtmp; \
670 __asm__ ("ff1 %0,%1" \
671 : "=r" (__cbtmp) \
672 : "r" ((USItype)(x))); \
673 (count) = __cbtmp ^ 31; \
674} while (0)
675#define COUNT_LEADING_ZEROS_0 63 /* sic */
676#if defined(__m88110__) 614#if defined(__m88110__)
677#define umul_ppmm(wh, wl, u, v) \ 615#define umul_ppmm(wh, wl, u, v) \
678do { \ 616do { \
@@ -779,12 +717,6 @@ do { \
779 : "0" (__xx.__ll), \ 717 : "0" (__xx.__ll), \
780 "g" ((USItype)(d))); \ 718 "g" ((USItype)(d))); \
781 (r) = __xx.__i.__l; (q) = __xx.__i.__h; }) 719 (r) = __xx.__i.__l; (q) = __xx.__i.__h; })
782#define count_trailing_zeros(count, x) \
783do { \
784 __asm__("ffsd %2,%0" \
785 : "=r"((USItype) (count)) \
786 : "0"((USItype) 0), "r"((USItype) (x))); \
787 } while (0)
788#endif /* __ns32000__ */ 720#endif /* __ns32000__ */
789 721
790/*************************************** 722/***************************************
@@ -855,11 +787,6 @@ do { \
855 "rI" ((USItype)(al)), \ 787 "rI" ((USItype)(al)), \
856 "r" ((USItype)(bl))); \ 788 "r" ((USItype)(bl))); \
857} while (0) 789} while (0)
858#define count_leading_zeros(count, x) \
859 __asm__ ("{cntlz|cntlzw} %0,%1" \
860 : "=r" ((USItype)(count)) \
861 : "r" ((USItype)(x)))
862#define COUNT_LEADING_ZEROS_0 32
863#if defined(_ARCH_PPC) 790#if defined(_ARCH_PPC)
864#define umul_ppmm(ph, pl, m0, m1) \ 791#define umul_ppmm(ph, pl, m0, m1) \
865do { \ 792do { \
@@ -1001,19 +928,6 @@ do { \
1001} while (0) 928} while (0)
1002#define UMUL_TIME 20 929#define UMUL_TIME 20
1003#define UDIV_TIME 200 930#define UDIV_TIME 200
1004#define count_leading_zeros(count, x) \
1005do { \
1006 if ((x) >= 0x10000) \
1007 __asm__ ("clz %0,%1" \
1008 : "=r" ((USItype)(count)) \
1009 : "r" ((USItype)(x) >> 16)); \
1010 else { \
1011 __asm__ ("clz %0,%1" \
1012 : "=r" ((USItype)(count)) \
1013 : "r" ((USItype)(x))); \
1014 (count) += 16; \
1015 } \
1016} while (0)
1017#endif /* RT/ROMP */ 931#endif /* RT/ROMP */
1018 932
1019/*************************************** 933/***************************************
@@ -1142,13 +1056,6 @@ do { \
1142 "rI" ((USItype)(d)) \ 1056 "rI" ((USItype)(d)) \
1143 : "%g1" __AND_CLOBBER_CC) 1057 : "%g1" __AND_CLOBBER_CC)
1144#define UDIV_TIME 37 1058#define UDIV_TIME 37
1145#define count_leading_zeros(count, x) \
1146 __asm__ ("scan %1,0,%0" \
1147 : "=r" ((USItype)(x)) \
1148 : "r" ((USItype)(count)))
1149/* Early sparclites return 63 for an argument of 0, but they warn that future
1150 implementations might change this. Therefore, leave COUNT_LEADING_ZEROS_0
1151 undefined. */
1152#endif /* __sparclite__ */ 1059#endif /* __sparclite__ */
1153#endif /* __sparc_v8__ */ 1060#endif /* __sparc_v8__ */
1154 /* Default to sparc v7 versions of umul_ppmm and udiv_qrnnd. */ 1061 /* Default to sparc v7 versions of umul_ppmm and udiv_qrnnd. */
@@ -1454,47 +1361,6 @@ do { \
1454#define udiv_qrnnd __udiv_qrnnd_c 1361#define udiv_qrnnd __udiv_qrnnd_c
1455#endif 1362#endif
1456 1363
1457#undef count_leading_zeros
1458#if !defined(count_leading_zeros)
1459 extern
1460#ifdef __STDC__
1461 const
1462#endif
1463 unsigned char __clz_tab[];
1464#define count_leading_zeros(count, x) \
1465do { \
1466 UWtype __xr = (x); \
1467 UWtype __a; \
1468 \
1469 if (W_TYPE_SIZE <= 32) { \
1470 __a = __xr < ((UWtype) 1 << 2*__BITS4) \
1471 ? (__xr < ((UWtype) 1 << __BITS4) ? 0 : __BITS4) \
1472 : (__xr < ((UWtype) 1 << 3*__BITS4) ? 2*__BITS4 : 3*__BITS4); \
1473 } \
1474 else { \
1475 for (__a = W_TYPE_SIZE - 8; __a > 0; __a -= 8) \
1476 if (((__xr >> __a) & 0xff) != 0) \
1477 break; \
1478 } \
1479 \
1480 (count) = W_TYPE_SIZE - (__clz_tab[__xr >> __a] + __a); \
1481} while (0)
1482 /* This version gives a well-defined value for zero. */
1483#define COUNT_LEADING_ZEROS_0 W_TYPE_SIZE
1484#endif
1485
1486#if !defined(count_trailing_zeros)
1487/* Define count_trailing_zeros using count_leading_zeros. The latter might be
1488 defined in asm, but if it is not, the C version above is good enough. */
1489#define count_trailing_zeros(count, x) \
1490do { \
1491 UWtype __ctz_x = (x); \
1492 UWtype __ctz_c; \
1493 count_leading_zeros(__ctz_c, __ctz_x & -__ctz_x); \
1494 (count) = W_TYPE_SIZE - 1 - __ctz_c; \
1495} while (0)
1496#endif
1497
1498#ifndef UDIV_NEEDS_NORMALIZATION 1364#ifndef UDIV_NEEDS_NORMALIZATION
1499#define UDIV_NEEDS_NORMALIZATION 0 1365#define UDIV_NEEDS_NORMALIZATION 0
1500#endif 1366#endif
diff --git a/lib/mpi/mpi-bit.c b/lib/mpi/mpi-bit.c
index 568724804f29..503537e08436 100644
--- a/lib/mpi/mpi-bit.c
+++ b/lib/mpi/mpi-bit.c
@@ -45,7 +45,7 @@ unsigned mpi_get_nbits(MPI a)
45 if (a->nlimbs) { 45 if (a->nlimbs) {
46 mpi_limb_t alimb = a->d[a->nlimbs - 1]; 46 mpi_limb_t alimb = a->d[a->nlimbs - 1];
47 if (alimb) 47 if (alimb)
48 count_leading_zeros(n, alimb); 48 n = count_leading_zeros(alimb);
49 else 49 else
50 n = BITS_PER_MPI_LIMB; 50 n = BITS_PER_MPI_LIMB;
51 n = BITS_PER_MPI_LIMB - n + (a->nlimbs - 1) * BITS_PER_MPI_LIMB; 51 n = BITS_PER_MPI_LIMB - n + (a->nlimbs - 1) * BITS_PER_MPI_LIMB;
diff --git a/lib/mpi/mpi-cmp.c b/lib/mpi/mpi-cmp.c
new file mode 100644
index 000000000000..1871e7b61ca0
--- /dev/null
+++ b/lib/mpi/mpi-cmp.c
@@ -0,0 +1,70 @@
1/* mpi-cmp.c - MPI functions
2 * Copyright (C) 1998, 1999 Free Software Foundation, Inc.
3 *
4 * This file is part of GnuPG.
5 *
6 * GnuPG 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 * GnuPG 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#include "mpi-internal.h"
22
23int mpi_cmp_ui(MPI u, unsigned long v)
24{
25 mpi_limb_t limb = v;
26
27 mpi_normalize(u);
28 if (!u->nlimbs && !limb)
29 return 0;
30 if (u->sign)
31 return -1;
32 if (u->nlimbs > 1)
33 return 1;
34
35 if (u->d[0] == limb)
36 return 0;
37 else if (u->d[0] > limb)
38 return 1;
39 else
40 return -1;
41}
42EXPORT_SYMBOL_GPL(mpi_cmp_ui);
43
44int mpi_cmp(MPI u, MPI v)
45{
46 mpi_size_t usize, vsize;
47 int cmp;
48
49 mpi_normalize(u);
50 mpi_normalize(v);
51 usize = u->nlimbs;
52 vsize = v->nlimbs;
53 if (!u->sign && v->sign)
54 return 1;
55 if (u->sign && !v->sign)
56 return -1;
57 if (usize != vsize && !u->sign && !v->sign)
58 return usize - vsize;
59 if (usize != vsize && u->sign && v->sign)
60 return vsize + usize;
61 if (!usize)
62 return 0;
63 cmp = mpihelp_cmp(u->d, v->d, usize);
64 if (!cmp)
65 return 0;
66 if ((cmp < 0 ? 1 : 0) == (u->sign ? 1 : 0))
67 return 1;
68 return -1;
69}
70EXPORT_SYMBOL_GPL(mpi_cmp);
diff --git a/lib/mpi/mpi-pow.c b/lib/mpi/mpi-pow.c
index 67f3e79af914..5464c8744ea9 100644
--- a/lib/mpi/mpi-pow.c
+++ b/lib/mpi/mpi-pow.c
@@ -77,7 +77,7 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod)
77 mp = mp_marker = mpi_alloc_limb_space(msize); 77 mp = mp_marker = mpi_alloc_limb_space(msize);
78 if (!mp) 78 if (!mp)
79 goto enomem; 79 goto enomem;
80 count_leading_zeros(mod_shift_cnt, mod->d[msize - 1]); 80 mod_shift_cnt = count_leading_zeros(mod->d[msize - 1]);
81 if (mod_shift_cnt) 81 if (mod_shift_cnt)
82 mpihelp_lshift(mp, mod->d, msize, mod_shift_cnt); 82 mpihelp_lshift(mp, mod->d, msize, mod_shift_cnt);
83 else 83 else
@@ -169,7 +169,7 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod)
169 169
170 i = esize - 1; 170 i = esize - 1;
171 e = ep[i]; 171 e = ep[i];
172 count_leading_zeros(c, e); 172 c = count_leading_zeros(e);
173 e = (e << c) << 1; /* shift the exp bits to the left, lose msb */ 173 e = (e << c) << 1; /* shift the exp bits to the left, lose msb */
174 c = BITS_PER_MPI_LIMB - 1 - c; 174 c = BITS_PER_MPI_LIMB - 1 - c;
175 175
diff --git a/lib/mpi/mpicoder.c b/lib/mpi/mpicoder.c
index f0fa65995800..3962b7f7fe3f 100644
--- a/lib/mpi/mpicoder.c
+++ b/lib/mpi/mpicoder.c
@@ -18,10 +18,65 @@
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 20
21#include <linux/bitops.h>
22#include <asm-generic/bitops/count_zeros.h>
21#include "mpi-internal.h" 23#include "mpi-internal.h"
22 24
23#define MAX_EXTERN_MPI_BITS 16384 25#define MAX_EXTERN_MPI_BITS 16384
24 26
27/**
28 * mpi_read_raw_data - Read a raw byte stream as a positive integer
29 * @xbuffer: The data to read
30 * @nbytes: The amount of data to read
31 */
32MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes)
33{
34 const uint8_t *buffer = xbuffer;
35 int i, j;
36 unsigned nbits, nlimbs;
37 mpi_limb_t a;
38 MPI val = NULL;
39
40 while (nbytes >= 0 && buffer[0] == 0) {
41 buffer++;
42 nbytes--;
43 }
44
45 nbits = nbytes * 8;
46 if (nbits > MAX_EXTERN_MPI_BITS) {
47 pr_info("MPI: mpi too large (%u bits)\n", nbits);
48 return NULL;
49 }
50 if (nbytes > 0)
51 nbits -= count_leading_zeros(buffer[0]);
52 else
53 nbits = 0;
54
55 nlimbs = (nbytes + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB;
56 val = mpi_alloc(nlimbs);
57 if (!val)
58 return NULL;
59 val->nbits = nbits;
60 val->sign = 0;
61 val->nlimbs = nlimbs;
62
63 if (nbytes > 0) {
64 i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB;
65 i %= BYTES_PER_MPI_LIMB;
66 for (j = nlimbs; j > 0; j--) {
67 a = 0;
68 for (; i < BYTES_PER_MPI_LIMB; i++) {
69 a <<= 8;
70 a |= *buffer++;
71 }
72 i = 0;
73 val->d[j - 1] = a;
74 }
75 }
76 return val;
77}
78EXPORT_SYMBOL_GPL(mpi_read_raw_data);
79
25MPI mpi_read_from_buffer(const void *xbuffer, unsigned *ret_nread) 80MPI mpi_read_from_buffer(const void *xbuffer, unsigned *ret_nread)
26{ 81{
27 const uint8_t *buffer = xbuffer; 82 const uint8_t *buffer = xbuffer;
diff --git a/lib/oid_registry.c b/lib/oid_registry.c
new file mode 100644
index 000000000000..d8de11f45908
--- /dev/null
+++ b/lib/oid_registry.c
@@ -0,0 +1,170 @@
1/* ASN.1 Object identifier (OID) registry
2 *
3 * Copyright (C) 2012 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#include <linux/export.h>
13#include <linux/oid_registry.h>
14#include <linux/kernel.h>
15#include <linux/errno.h>
16#include <linux/bug.h>
17#include "oid_registry_data.c"
18
19/**
20 * look_up_OID - Find an OID registration for the specified data
21 * @data: Binary representation of the OID
22 * @datasize: Size of the binary representation
23 */
24enum OID look_up_OID(const void *data, size_t datasize)
25{
26 const unsigned char *octets = data;
27 enum OID oid;
28 unsigned char xhash;
29 unsigned i, j, k, hash;
30 size_t len;
31
32 /* Hash the OID data */
33 hash = datasize - 1;
34
35 for (i = 0; i < datasize; i++)
36 hash += octets[i] * 33;
37 hash = (hash >> 24) ^ (hash >> 16) ^ (hash >> 8) ^ hash;
38 hash &= 0xff;
39
40 /* Binary search the OID registry. OIDs are stored in ascending order
41 * of hash value then ascending order of size and then in ascending
42 * order of reverse value.
43 */
44 i = 0;
45 k = OID__NR;
46 while (i < k) {
47 j = (i + k) / 2;
48
49 xhash = oid_search_table[j].hash;
50 if (xhash > hash) {
51 k = j;
52 continue;
53 }
54 if (xhash < hash) {
55 i = j + 1;
56 continue;
57 }
58
59 oid = oid_search_table[j].oid;
60 len = oid_index[oid + 1] - oid_index[oid];
61 if (len > datasize) {
62 k = j;
63 continue;
64 }
65 if (len < datasize) {
66 i = j + 1;
67 continue;
68 }
69
70 /* Variation is most likely to be at the tail end of the
71 * OID, so do the comparison in reverse.
72 */
73 while (len > 0) {
74 unsigned char a = oid_data[oid_index[oid] + --len];
75 unsigned char b = octets[len];
76 if (a > b) {
77 k = j;
78 goto next;
79 }
80 if (a < b) {
81 i = j + 1;
82 goto next;
83 }
84 }
85 return oid;
86 next:
87 ;
88 }
89
90 return OID__NR;
91}
92EXPORT_SYMBOL_GPL(look_up_OID);
93
94/*
95 * sprint_OID - Print an Object Identifier into a buffer
96 * @data: The encoded OID to print
97 * @datasize: The size of the encoded OID
98 * @buffer: The buffer to render into
99 * @bufsize: The size of the buffer
100 *
101 * The OID is rendered into the buffer in "a.b.c.d" format and the number of
102 * bytes is returned. -EBADMSG is returned if the data could not be intepreted
103 * and -ENOBUFS if the buffer was too small.
104 */
105int sprint_oid(const void *data, size_t datasize, char *buffer, size_t bufsize)
106{
107 const unsigned char *v = data, *end = v + datasize;
108 unsigned long num;
109 unsigned char n;
110 size_t ret;
111 int count;
112
113 if (v >= end)
114 return -EBADMSG;
115
116 n = *v++;
117 ret = count = snprintf(buffer, bufsize, "%u.%u", n / 40, n % 40);
118 buffer += count;
119 bufsize -= count;
120 if (bufsize == 0)
121 return -ENOBUFS;
122
123 while (v < end) {
124 num = 0;
125 n = *v++;
126 if (!(n & 0x80)) {
127 num = n;
128 } else {
129 num = n & 0x7f;
130 do {
131 if (v >= end)
132 return -EBADMSG;
133 n = *v++;
134 num <<= 7;
135 num |= n & 0x7f;
136 } while (n & 0x80);
137 }
138 ret += count = snprintf(buffer, bufsize, ".%lu", num);
139 buffer += count;
140 bufsize -= count;
141 if (bufsize == 0)
142 return -ENOBUFS;
143 }
144
145 return ret;
146}
147EXPORT_SYMBOL_GPL(sprint_oid);
148
149/**
150 * sprint_OID - Print an Object Identifier into a buffer
151 * @oid: The OID to print
152 * @buffer: The buffer to render into
153 * @bufsize: The size of the buffer
154 *
155 * The OID is rendered into the buffer in "a.b.c.d" format and the number of
156 * bytes is returned.
157 */
158int sprint_OID(enum OID oid, char *buffer, size_t bufsize)
159{
160 int ret;
161
162 BUG_ON(oid >= OID__NR);
163
164 ret = sprint_oid(oid_data + oid_index[oid],
165 oid_index[oid + 1] - oid_index[oid],
166 buffer, bufsize);
167 BUG_ON(ret == -EBADMSG);
168 return ret;
169}
170EXPORT_SYMBOL_GPL(sprint_OID);
diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c
index 9da7fdd3cd8a..af14cb425164 100644
--- a/net/ceph/crypto.c
+++ b/net/ceph/crypto.c
@@ -423,14 +423,15 @@ int ceph_encrypt2(struct ceph_crypto_key *secret, void *dst, size_t *dst_len,
423 } 423 }
424} 424}
425 425
426int ceph_key_instantiate(struct key *key, const void *data, size_t datalen) 426int ceph_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
427{ 427{
428 struct ceph_crypto_key *ckey; 428 struct ceph_crypto_key *ckey;
429 size_t datalen = prep->datalen;
429 int ret; 430 int ret;
430 void *p; 431 void *p;
431 432
432 ret = -EINVAL; 433 ret = -EINVAL;
433 if (datalen <= 0 || datalen > 32767 || !data) 434 if (datalen <= 0 || datalen > 32767 || !prep->data)
434 goto err; 435 goto err;
435 436
436 ret = key_payload_reserve(key, datalen); 437 ret = key_payload_reserve(key, datalen);
@@ -443,8 +444,8 @@ int ceph_key_instantiate(struct key *key, const void *data, size_t datalen)
443 goto err; 444 goto err;
444 445
445 /* TODO ceph_crypto_key_decode should really take const input */ 446 /* TODO ceph_crypto_key_decode should really take const input */
446 p = (void *)data; 447 p = (void *)prep->data;
447 ret = ceph_crypto_key_decode(ckey, &p, (char*)data+datalen); 448 ret = ceph_crypto_key_decode(ckey, &p, (char*)prep->data+datalen);
448 if (ret < 0) 449 if (ret < 0)
449 goto err_ckey; 450 goto err_ckey;
450 451
diff --git a/net/dns_resolver/dns_key.c b/net/dns_resolver/dns_key.c
index 9807945a56d9..8aa4b1115384 100644
--- a/net/dns_resolver/dns_key.c
+++ b/net/dns_resolver/dns_key.c
@@ -59,13 +59,13 @@ const struct cred *dns_resolver_cache;
59 * "ip1,ip2,...#foo=bar" 59 * "ip1,ip2,...#foo=bar"
60 */ 60 */
61static int 61static int
62dns_resolver_instantiate(struct key *key, const void *_data, size_t datalen) 62dns_resolver_instantiate(struct key *key, struct key_preparsed_payload *prep)
63{ 63{
64 struct user_key_payload *upayload; 64 struct user_key_payload *upayload;
65 unsigned long derrno; 65 unsigned long derrno;
66 int ret; 66 int ret;
67 size_t result_len = 0; 67 size_t datalen = prep->datalen, result_len = 0;
68 const char *data = _data, *end, *opt; 68 const char *data = prep->data, *end, *opt;
69 69
70 kenter("%%%d,%s,'%*.*s',%zu", 70 kenter("%%%d,%s,'%*.*s',%zu",
71 key->serial, key->description, 71 key->serial, key->description,
diff --git a/net/rxrpc/ar-key.c b/net/rxrpc/ar-key.c
index 011d2384b115..7633a752c65e 100644
--- a/net/rxrpc/ar-key.c
+++ b/net/rxrpc/ar-key.c
@@ -26,8 +26,8 @@
26#include "ar-internal.h" 26#include "ar-internal.h"
27 27
28static int rxrpc_vet_description_s(const char *); 28static int rxrpc_vet_description_s(const char *);
29static int rxrpc_instantiate(struct key *, const void *, size_t); 29static int rxrpc_instantiate(struct key *, struct key_preparsed_payload *);
30static int rxrpc_instantiate_s(struct key *, const void *, size_t); 30static int rxrpc_instantiate_s(struct key *, struct key_preparsed_payload *);
31static void rxrpc_destroy(struct key *); 31static void rxrpc_destroy(struct key *);
32static void rxrpc_destroy_s(struct key *); 32static void rxrpc_destroy_s(struct key *);
33static void rxrpc_describe(const struct key *, struct seq_file *); 33static void rxrpc_describe(const struct key *, struct seq_file *);
@@ -678,7 +678,7 @@ error:
678 * 678 *
679 * if no data is provided, then a no-security key is made 679 * if no data is provided, then a no-security key is made
680 */ 680 */
681static int rxrpc_instantiate(struct key *key, const void *data, size_t datalen) 681static int rxrpc_instantiate(struct key *key, struct key_preparsed_payload *prep)
682{ 682{
683 const struct rxrpc_key_data_v1 *v1; 683 const struct rxrpc_key_data_v1 *v1;
684 struct rxrpc_key_token *token, **pp; 684 struct rxrpc_key_token *token, **pp;
@@ -686,26 +686,26 @@ static int rxrpc_instantiate(struct key *key, const void *data, size_t datalen)
686 u32 kver; 686 u32 kver;
687 int ret; 687 int ret;
688 688
689 _enter("{%x},,%zu", key_serial(key), datalen); 689 _enter("{%x},,%zu", key_serial(key), prep->datalen);
690 690
691 /* handle a no-security key */ 691 /* handle a no-security key */
692 if (!data && datalen == 0) 692 if (!prep->data && prep->datalen == 0)
693 return 0; 693 return 0;
694 694
695 /* determine if the XDR payload format is being used */ 695 /* determine if the XDR payload format is being used */
696 if (datalen > 7 * 4) { 696 if (prep->datalen > 7 * 4) {
697 ret = rxrpc_instantiate_xdr(key, data, datalen); 697 ret = rxrpc_instantiate_xdr(key, prep->data, prep->datalen);
698 if (ret != -EPROTO) 698 if (ret != -EPROTO)
699 return ret; 699 return ret;
700 } 700 }
701 701
702 /* get the key interface version number */ 702 /* get the key interface version number */
703 ret = -EINVAL; 703 ret = -EINVAL;
704 if (datalen <= 4 || !data) 704 if (prep->datalen <= 4 || !prep->data)
705 goto error; 705 goto error;
706 memcpy(&kver, data, sizeof(kver)); 706 memcpy(&kver, prep->data, sizeof(kver));
707 data += sizeof(kver); 707 prep->data += sizeof(kver);
708 datalen -= sizeof(kver); 708 prep->datalen -= sizeof(kver);
709 709
710 _debug("KEY I/F VERSION: %u", kver); 710 _debug("KEY I/F VERSION: %u", kver);
711 711
@@ -715,11 +715,11 @@ static int rxrpc_instantiate(struct key *key, const void *data, size_t datalen)
715 715
716 /* deal with a version 1 key */ 716 /* deal with a version 1 key */
717 ret = -EINVAL; 717 ret = -EINVAL;
718 if (datalen < sizeof(*v1)) 718 if (prep->datalen < sizeof(*v1))
719 goto error; 719 goto error;
720 720
721 v1 = data; 721 v1 = prep->data;
722 if (datalen != sizeof(*v1) + v1->ticket_length) 722 if (prep->datalen != sizeof(*v1) + v1->ticket_length)
723 goto error; 723 goto error;
724 724
725 _debug("SCIX: %u", v1->security_index); 725 _debug("SCIX: %u", v1->security_index);
@@ -784,17 +784,17 @@ error:
784 * instantiate a server secret key 784 * instantiate a server secret key
785 * data should be a pointer to the 8-byte secret key 785 * data should be a pointer to the 8-byte secret key
786 */ 786 */
787static int rxrpc_instantiate_s(struct key *key, const void *data, 787static int rxrpc_instantiate_s(struct key *key,
788 size_t datalen) 788 struct key_preparsed_payload *prep)
789{ 789{
790 struct crypto_blkcipher *ci; 790 struct crypto_blkcipher *ci;
791 791
792 _enter("{%x},,%zu", key_serial(key), datalen); 792 _enter("{%x},,%zu", key_serial(key), prep->datalen);
793 793
794 if (datalen != 8) 794 if (prep->datalen != 8)
795 return -EINVAL; 795 return -EINVAL;
796 796
797 memcpy(&key->type_data, data, 8); 797 memcpy(&key->type_data, prep->data, 8);
798 798
799 ci = crypto_alloc_blkcipher("pcbc(des)", 0, CRYPTO_ALG_ASYNC); 799 ci = crypto_alloc_blkcipher("pcbc(des)", 0, CRYPTO_ALG_ASYNC);
800 if (IS_ERR(ci)) { 800 if (IS_ERR(ci)) {
@@ -802,7 +802,7 @@ static int rxrpc_instantiate_s(struct key *key, const void *data,
802 return PTR_ERR(ci); 802 return PTR_ERR(ci);
803 } 803 }
804 804
805 if (crypto_blkcipher_setkey(ci, data, 8) < 0) 805 if (crypto_blkcipher_setkey(ci, prep->data, 8) < 0)
806 BUG(); 806 BUG();
807 807
808 key->payload.data = ci; 808 key->payload.data = ci;
diff --git a/scripts/.gitignore b/scripts/.gitignore
index 65f362d931b5..fb070fa1038f 100644
--- a/scripts/.gitignore
+++ b/scripts/.gitignore
@@ -10,3 +10,4 @@ ihex2fw
10recordmcount 10recordmcount
11docproc 11docproc
12sortextable 12sortextable
13asn1_compiler
diff --git a/scripts/Makefile b/scripts/Makefile
index a55b0067758a..01e7adb838d9 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -16,8 +16,10 @@ hostprogs-$(CONFIG_VT) += conmakehash
16hostprogs-$(CONFIG_IKCONFIG) += bin2c 16hostprogs-$(CONFIG_IKCONFIG) += bin2c
17hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount 17hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount
18hostprogs-$(CONFIG_BUILDTIME_EXTABLE_SORT) += sortextable 18hostprogs-$(CONFIG_BUILDTIME_EXTABLE_SORT) += sortextable
19hostprogs-$(CONFIG_ASN1) += asn1_compiler
19 20
20HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include 21HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include
22HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
21 23
22always := $(hostprogs-y) $(hostprogs-m) 24always := $(hostprogs-y) $(hostprogs-m)
23 25
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index ff1720d28d0c..0e801c3cdaf8 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -354,6 +354,17 @@ quiet_cmd_cpp_lds_S = LDS $@
354$(obj)/%.lds: $(src)/%.lds.S FORCE 354$(obj)/%.lds: $(src)/%.lds.S FORCE
355 $(call if_changed_dep,cpp_lds_S) 355 $(call if_changed_dep,cpp_lds_S)
356 356
357# ASN.1 grammar
358# ---------------------------------------------------------------------------
359quiet_cmd_asn1_compiler = ASN.1 $@
360 cmd_asn1_compiler = $(objtree)/scripts/asn1_compiler $< \
361 $(subst .h,.c,$@) $(subst .c,.h,$@)
362
363.PRECIOUS: $(objtree)/$(obj)/%-asn1.c $(objtree)/$(obj)/%-asn1.h
364
365$(obj)/%-asn1.c $(obj)/%-asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler
366 $(call cmd,asn1_compiler)
367
357# Build the compiled-in targets 368# Build the compiled-in targets
358# --------------------------------------------------------------------------- 369# ---------------------------------------------------------------------------
359 370
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index a1cb0222ebe6..002089141df4 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -14,7 +14,8 @@
14# 3) create one <module>.mod.c file pr. module 14# 3) create one <module>.mod.c file pr. module
15# 4) create one Module.symvers file with CRC for all exported symbols 15# 4) create one Module.symvers file with CRC for all exported symbols
16# 5) compile all <module>.mod.c files 16# 5) compile all <module>.mod.c files
17# 6) final link of the module to a <module.ko> file 17# 6) final link of the module to a <module.ko> (or <module.unsigned>) file
18# 7) signs the modules to a <module.ko> file
18 19
19# Step 3 is used to place certain information in the module's ELF 20# Step 3 is used to place certain information in the module's ELF
20# section, including information such as: 21# section, including information such as:
@@ -32,6 +33,8 @@
32# Step 4 is solely used to allow module versioning in external modules, 33# Step 4 is solely used to allow module versioning in external modules,
33# where the CRC of each module is retrieved from the Module.symvers file. 34# where the CRC of each module is retrieved from the Module.symvers file.
34 35
36# Step 7 is dependent on CONFIG_MODULE_SIG being enabled.
37
35# KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined 38# KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined
36# symbols in the final module linking stage 39# symbols in the final module linking stage
37# KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules. 40# KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
@@ -116,6 +119,7 @@ $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
116targets += $(modules:.ko=.mod.o) 119targets += $(modules:.ko=.mod.o)
117 120
118# Step 6), final link of the modules 121# Step 6), final link of the modules
122ifneq ($(CONFIG_MODULE_SIG),y)
119quiet_cmd_ld_ko_o = LD [M] $@ 123quiet_cmd_ld_ko_o = LD [M] $@
120 cmd_ld_ko_o = $(LD) -r $(LDFLAGS) \ 124 cmd_ld_ko_o = $(LD) -r $(LDFLAGS) \
121 $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ 125 $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
@@ -125,7 +129,78 @@ $(modules): %.ko :%.o %.mod.o FORCE
125 $(call if_changed,ld_ko_o) 129 $(call if_changed,ld_ko_o)
126 130
127targets += $(modules) 131targets += $(modules)
132else
133quiet_cmd_ld_ko_unsigned_o = LD [M] $@
134 cmd_ld_ko_unsigned_o = \
135 $(LD) -r $(LDFLAGS) \
136 $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
137 -o $@ $(filter-out FORCE,$^) \
138 $(if $(AFTER_LINK),; $(AFTER_LINK))
139
140$(modules:.ko=.ko.unsigned): %.ko.unsigned :%.o %.mod.o FORCE
141 $(call if_changed,ld_ko_unsigned_o)
142
143targets += $(modules:.ko=.ko.unsigned)
144
145# Step 7), sign the modules
146MODSECKEY = ./signing_key.priv
147MODPUBKEY = ./signing_key.x509
148
149ifeq ($(wildcard $(MODSECKEY))+$(wildcard $(MODPUBKEY)),$(MODSECKEY)+$(MODPUBKEY))
150ifeq ($(KBUILD_SRC),)
151 # no O= is being used
152 SCRIPTS_DIR := scripts
153else
154 SCRIPTS_DIR := $(KBUILD_SRC)/scripts
155endif
156SIGN_MODULES := 1
157else
158SIGN_MODULES := 0
159endif
160
161# only sign if it's an in-tree module
162ifneq ($(KBUILD_EXTMOD),)
163SIGN_MODULES := 0
164endif
128 165
166# We strip the module as best we can - note that using both strip and eu-strip
167# results in a smaller module than using either alone.
168EU_STRIP = $(shell which eu-strip || echo true)
169
170quiet_cmd_sign_ko_stripped_ko_unsigned = STRIP [M] $@
171 cmd_sign_ko_stripped_ko_unsigned = \
172 cp $< $@ && \
173 strip -x -g $@ && \
174 $(EU_STRIP) $@
175
176ifeq ($(SIGN_MODULES),1)
177
178quiet_cmd_genkeyid = GENKEYID $@
179 cmd_genkeyid = \
180 perl $(SCRIPTS_DIR)/x509keyid $< $<.signer $<.keyid
181
182%.signer %.keyid: %
183 $(call if_changed,genkeyid)
184
185KEYRING_DEP := $(MODSECKEY) $(MODPUBKEY) $(MODPUBKEY).signer $(MODPUBKEY).keyid
186quiet_cmd_sign_ko_ko_stripped = SIGN [M] $@
187 cmd_sign_ko_ko_stripped = \
188 sh $(SCRIPTS_DIR)/sign-file $(MODSECKEY) $(MODPUBKEY) $< $@
189else
190KEYRING_DEP :=
191quiet_cmd_sign_ko_ko_unsigned = NO SIGN [M] $@
192 cmd_sign_ko_ko_unsigned = \
193 cp $< $@
194endif
195
196$(modules): %.ko :%.ko.stripped $(KEYRING_DEP) FORCE
197 $(call if_changed,sign_ko_ko_stripped)
198
199$(patsubst %.ko,%.ko.stripped,$(modules)): %.ko.stripped :%.ko.unsigned FORCE
200 $(call if_changed,sign_ko_stripped_ko_unsigned)
201
202targets += $(modules)
203endif
129 204
130# Add FORCE to the prequisites of a target to force it to be always rebuilt. 205# Add FORCE to the prequisites of a target to force it to be always rebuilt.
131# --------------------------------------------------------------------------- 206# ---------------------------------------------------------------------------
diff --git a/scripts/asn1_compiler.c b/scripts/asn1_compiler.c
new file mode 100644
index 000000000000..db0e5cd34c70
--- /dev/null
+++ b/scripts/asn1_compiler.c
@@ -0,0 +1,1545 @@
1/* Simplified ASN.1 notation parser
2 *
3 * Copyright (C) 2012 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#include <stdarg.h>
13#include <stdio.h>
14#include <stdlib.h>
15#include <stdint.h>
16#include <string.h>
17#include <ctype.h>
18#include <unistd.h>
19#include <fcntl.h>
20#include <sys/stat.h>
21#include <linux/asn1_ber_bytecode.h>
22
23enum token_type {
24 DIRECTIVE_ABSENT,
25 DIRECTIVE_ALL,
26 DIRECTIVE_ANY,
27 DIRECTIVE_APPLICATION,
28 DIRECTIVE_AUTOMATIC,
29 DIRECTIVE_BEGIN,
30 DIRECTIVE_BIT,
31 DIRECTIVE_BMPString,
32 DIRECTIVE_BOOLEAN,
33 DIRECTIVE_BY,
34 DIRECTIVE_CHARACTER,
35 DIRECTIVE_CHOICE,
36 DIRECTIVE_CLASS,
37 DIRECTIVE_COMPONENT,
38 DIRECTIVE_COMPONENTS,
39 DIRECTIVE_CONSTRAINED,
40 DIRECTIVE_CONTAINING,
41 DIRECTIVE_DEFAULT,
42 DIRECTIVE_DEFINED,
43 DIRECTIVE_DEFINITIONS,
44 DIRECTIVE_EMBEDDED,
45 DIRECTIVE_ENCODED,
46 DIRECTIVE_ENCODING_CONTROL,
47 DIRECTIVE_END,
48 DIRECTIVE_ENUMERATED,
49 DIRECTIVE_EXCEPT,
50 DIRECTIVE_EXPLICIT,
51 DIRECTIVE_EXPORTS,
52 DIRECTIVE_EXTENSIBILITY,
53 DIRECTIVE_EXTERNAL,
54 DIRECTIVE_FALSE,
55 DIRECTIVE_FROM,
56 DIRECTIVE_GeneralString,
57 DIRECTIVE_GeneralizedTime,
58 DIRECTIVE_GraphicString,
59 DIRECTIVE_IA5String,
60 DIRECTIVE_IDENTIFIER,
61 DIRECTIVE_IMPLICIT,
62 DIRECTIVE_IMPLIED,
63 DIRECTIVE_IMPORTS,
64 DIRECTIVE_INCLUDES,
65 DIRECTIVE_INSTANCE,
66 DIRECTIVE_INSTRUCTIONS,
67 DIRECTIVE_INTEGER,
68 DIRECTIVE_INTERSECTION,
69 DIRECTIVE_ISO646String,
70 DIRECTIVE_MAX,
71 DIRECTIVE_MIN,
72 DIRECTIVE_MINUS_INFINITY,
73 DIRECTIVE_NULL,
74 DIRECTIVE_NumericString,
75 DIRECTIVE_OBJECT,
76 DIRECTIVE_OCTET,
77 DIRECTIVE_OF,
78 DIRECTIVE_OPTIONAL,
79 DIRECTIVE_ObjectDescriptor,
80 DIRECTIVE_PATTERN,
81 DIRECTIVE_PDV,
82 DIRECTIVE_PLUS_INFINITY,
83 DIRECTIVE_PRESENT,
84 DIRECTIVE_PRIVATE,
85 DIRECTIVE_PrintableString,
86 DIRECTIVE_REAL,
87 DIRECTIVE_RELATIVE_OID,
88 DIRECTIVE_SEQUENCE,
89 DIRECTIVE_SET,
90 DIRECTIVE_SIZE,
91 DIRECTIVE_STRING,
92 DIRECTIVE_SYNTAX,
93 DIRECTIVE_T61String,
94 DIRECTIVE_TAGS,
95 DIRECTIVE_TRUE,
96 DIRECTIVE_TeletexString,
97 DIRECTIVE_UNION,
98 DIRECTIVE_UNIQUE,
99 DIRECTIVE_UNIVERSAL,
100 DIRECTIVE_UTCTime,
101 DIRECTIVE_UTF8String,
102 DIRECTIVE_UniversalString,
103 DIRECTIVE_VideotexString,
104 DIRECTIVE_VisibleString,
105 DIRECTIVE_WITH,
106 NR__DIRECTIVES,
107 TOKEN_ASSIGNMENT = NR__DIRECTIVES,
108 TOKEN_OPEN_CURLY,
109 TOKEN_CLOSE_CURLY,
110 TOKEN_OPEN_SQUARE,
111 TOKEN_CLOSE_SQUARE,
112 TOKEN_OPEN_ACTION,
113 TOKEN_CLOSE_ACTION,
114 TOKEN_COMMA,
115 TOKEN_NUMBER,
116 TOKEN_TYPE_NAME,
117 TOKEN_ELEMENT_NAME,
118 NR__TOKENS
119};
120
121static const unsigned char token_to_tag[NR__TOKENS] = {
122 /* EOC goes first */
123 [DIRECTIVE_BOOLEAN] = ASN1_BOOL,
124 [DIRECTIVE_INTEGER] = ASN1_INT,
125 [DIRECTIVE_BIT] = ASN1_BTS,
126 [DIRECTIVE_OCTET] = ASN1_OTS,
127 [DIRECTIVE_NULL] = ASN1_NULL,
128 [DIRECTIVE_OBJECT] = ASN1_OID,
129 [DIRECTIVE_ObjectDescriptor] = ASN1_ODE,
130 [DIRECTIVE_EXTERNAL] = ASN1_EXT,
131 [DIRECTIVE_REAL] = ASN1_REAL,
132 [DIRECTIVE_ENUMERATED] = ASN1_ENUM,
133 [DIRECTIVE_EMBEDDED] = 0,
134 [DIRECTIVE_UTF8String] = ASN1_UTF8STR,
135 [DIRECTIVE_RELATIVE_OID] = ASN1_RELOID,
136 /* 14 */
137 /* 15 */
138 [DIRECTIVE_SEQUENCE] = ASN1_SEQ,
139 [DIRECTIVE_SET] = ASN1_SET,
140 [DIRECTIVE_NumericString] = ASN1_NUMSTR,
141 [DIRECTIVE_PrintableString] = ASN1_PRNSTR,
142 [DIRECTIVE_T61String] = ASN1_TEXSTR,
143 [DIRECTIVE_TeletexString] = ASN1_TEXSTR,
144 [DIRECTIVE_VideotexString] = ASN1_VIDSTR,
145 [DIRECTIVE_IA5String] = ASN1_IA5STR,
146 [DIRECTIVE_UTCTime] = ASN1_UNITIM,
147 [DIRECTIVE_GeneralizedTime] = ASN1_GENTIM,
148 [DIRECTIVE_GraphicString] = ASN1_GRASTR,
149 [DIRECTIVE_VisibleString] = ASN1_VISSTR,
150 [DIRECTIVE_GeneralString] = ASN1_GENSTR,
151 [DIRECTIVE_UniversalString] = ASN1_UNITIM,
152 [DIRECTIVE_CHARACTER] = ASN1_CHRSTR,
153 [DIRECTIVE_BMPString] = ASN1_BMPSTR,
154};
155
156static const char asn1_classes[4][5] = {
157 [ASN1_UNIV] = "UNIV",
158 [ASN1_APPL] = "APPL",
159 [ASN1_CONT] = "CONT",
160 [ASN1_PRIV] = "PRIV"
161};
162
163static const char asn1_methods[2][5] = {
164 [ASN1_UNIV] = "PRIM",
165 [ASN1_APPL] = "CONS"
166};
167
168static const char *const asn1_universal_tags[32] = {
169 "EOC",
170 "BOOL",
171 "INT",
172 "BTS",
173 "OTS",
174 "NULL",
175 "OID",
176 "ODE",
177 "EXT",
178 "REAL",
179 "ENUM",
180 "EPDV",
181 "UTF8STR",
182 "RELOID",
183 NULL, /* 14 */
184 NULL, /* 15 */
185 "SEQ",
186 "SET",
187 "NUMSTR",
188 "PRNSTR",
189 "TEXSTR",
190 "VIDSTR",
191 "IA5STR",
192 "UNITIM",
193 "GENTIM",
194 "GRASTR",
195 "VISSTR",
196 "GENSTR",
197 "UNISTR",
198 "CHRSTR",
199 "BMPSTR",
200 NULL /* 31 */
201};
202
203static const char *filename;
204static const char *grammar_name;
205static const char *outputname;
206static const char *headername;
207
208static const char *const directives[NR__DIRECTIVES] = {
209#define _(X) [DIRECTIVE_##X] = #X
210 _(ABSENT),
211 _(ALL),
212 _(ANY),
213 _(APPLICATION),
214 _(AUTOMATIC),
215 _(BEGIN),
216 _(BIT),
217 _(BMPString),
218 _(BOOLEAN),
219 _(BY),
220 _(CHARACTER),
221 _(CHOICE),
222 _(CLASS),
223 _(COMPONENT),
224 _(COMPONENTS),
225 _(CONSTRAINED),
226 _(CONTAINING),
227 _(DEFAULT),
228 _(DEFINED),
229 _(DEFINITIONS),
230 _(EMBEDDED),
231 _(ENCODED),
232 [DIRECTIVE_ENCODING_CONTROL] = "ENCODING-CONTROL",
233 _(END),
234 _(ENUMERATED),
235 _(EXCEPT),
236 _(EXPLICIT),
237 _(EXPORTS),
238 _(EXTENSIBILITY),
239 _(EXTERNAL),
240 _(FALSE),
241 _(FROM),
242 _(GeneralString),
243 _(GeneralizedTime),
244 _(GraphicString),
245 _(IA5String),
246 _(IDENTIFIER),
247 _(IMPLICIT),
248 _(IMPLIED),
249 _(IMPORTS),
250 _(INCLUDES),
251 _(INSTANCE),
252 _(INSTRUCTIONS),
253 _(INTEGER),
254 _(INTERSECTION),
255 _(ISO646String),
256 _(MAX),
257 _(MIN),
258 [DIRECTIVE_MINUS_INFINITY] = "MINUS-INFINITY",
259 [DIRECTIVE_NULL] = "NULL",
260 _(NumericString),
261 _(OBJECT),
262 _(OCTET),
263 _(OF),
264 _(OPTIONAL),
265 _(ObjectDescriptor),
266 _(PATTERN),
267 _(PDV),
268 [DIRECTIVE_PLUS_INFINITY] = "PLUS-INFINITY",
269 _(PRESENT),
270 _(PRIVATE),
271 _(PrintableString),
272 _(REAL),
273 [DIRECTIVE_RELATIVE_OID] = "RELATIVE-OID",
274 _(SEQUENCE),
275 _(SET),
276 _(SIZE),
277 _(STRING),
278 _(SYNTAX),
279 _(T61String),
280 _(TAGS),
281 _(TRUE),
282 _(TeletexString),
283 _(UNION),
284 _(UNIQUE),
285 _(UNIVERSAL),
286 _(UTCTime),
287 _(UTF8String),
288 _(UniversalString),
289 _(VideotexString),
290 _(VisibleString),
291 _(WITH)
292};
293
294struct action {
295 struct action *next;
296 unsigned char index;
297 char name[];
298};
299
300static struct action *action_list;
301static unsigned nr_actions;
302
303struct token {
304 unsigned short line;
305 enum token_type token_type : 8;
306 unsigned char size;
307 struct action *action;
308 const char *value;
309 struct type *type;
310};
311
312static struct token *token_list;
313static unsigned nr_tokens;
314
315static int directive_compare(const void *_key, const void *_pdir)
316{
317 const struct token *token = _key;
318 const char *const *pdir = _pdir, *dir = *pdir;
319 size_t dlen, clen;
320 int val;
321
322 dlen = strlen(dir);
323 clen = (dlen < token->size) ? dlen : token->size;
324
325 //printf("cmp(%*.*s,%s) = ",
326 // (int)token->size, (int)token->size, token->value,
327 // dir);
328
329 val = memcmp(token->value, dir, clen);
330 if (val != 0) {
331 //printf("%d [cmp]\n", val);
332 return val;
333 }
334
335 if (dlen == token->size) {
336 //printf("0\n");
337 return 0;
338 }
339 //printf("%d\n", (int)dlen - (int)token->size);
340 return dlen - token->size; /* shorter -> negative */
341}
342
343/*
344 * Tokenise an ASN.1 grammar
345 */
346static void tokenise(char *buffer, char *end)
347{
348 struct token *tokens;
349 char *line, *nl, *p, *q;
350 unsigned tix, lineno;
351
352 /* Assume we're going to have half as many tokens as we have
353 * characters
354 */
355 token_list = tokens = calloc((end - buffer) / 2, sizeof(struct token));
356 if (!tokens) {
357 perror(NULL);
358 exit(1);
359 }
360 tix = 0;
361
362 lineno = 0;
363 while (buffer < end) {
364 /* First of all, break out a line */
365 lineno++;
366 line = buffer;
367 nl = memchr(line, '\n', end - buffer);
368 if (!nl) {
369 buffer = nl = end;
370 } else {
371 buffer = nl + 1;
372 *nl = '\0';
373 }
374
375 /* Remove "--" comments */
376 p = line;
377 next_comment:
378 while ((p = memchr(p, '-', nl - p))) {
379 if (p[1] == '-') {
380 /* Found a comment; see if there's a terminator */
381 q = p + 2;
382 while ((q = memchr(q, '-', nl - q))) {
383 if (q[1] == '-') {
384 /* There is - excise the comment */
385 q += 2;
386 memmove(p, q, nl - q);
387 goto next_comment;
388 }
389 q++;
390 }
391 *p = '\0';
392 nl = p;
393 break;
394 } else {
395 p++;
396 }
397 }
398
399 p = line;
400 while (p < nl) {
401 /* Skip white space */
402 while (p < nl && isspace(*p))
403 *(p++) = 0;
404 if (p >= nl)
405 break;
406
407 tokens[tix].line = lineno;
408 tokens[tix].value = p;
409
410 /* Handle string tokens */
411 if (isalpha(*p)) {
412 const char **dir;
413
414 /* Can be a directive, type name or element
415 * name. Find the end of the name.
416 */
417 q = p + 1;
418 while (q < nl && (isalnum(*q) || *q == '-' || *q == '_'))
419 q++;
420 tokens[tix].size = q - p;
421 p = q;
422
423 /* If it begins with a lowercase letter then
424 * it's an element name
425 */
426 if (islower(tokens[tix].value[0])) {
427 tokens[tix++].token_type = TOKEN_ELEMENT_NAME;
428 continue;
429 }
430
431 /* Otherwise we need to search the directive
432 * table
433 */
434 dir = bsearch(&tokens[tix], directives,
435 sizeof(directives) / sizeof(directives[1]),
436 sizeof(directives[1]),
437 directive_compare);
438 if (dir) {
439 tokens[tix++].token_type = dir - directives;
440 continue;
441 }
442
443 tokens[tix++].token_type = TOKEN_TYPE_NAME;
444 continue;
445 }
446
447 /* Handle numbers */
448 if (isdigit(*p)) {
449 /* Find the end of the number */
450 q = p + 1;
451 while (q < nl && (isdigit(*q)))
452 q++;
453 tokens[tix].size = q - p;
454 p = q;
455 tokens[tix++].token_type = TOKEN_NUMBER;
456 continue;
457 }
458
459 if (nl - p >= 3) {
460 if (memcmp(p, "::=", 3) == 0) {
461 p += 3;
462 tokens[tix].size = 3;
463 tokens[tix++].token_type = TOKEN_ASSIGNMENT;
464 continue;
465 }
466 }
467
468 if (nl - p >= 2) {
469 if (memcmp(p, "({", 2) == 0) {
470 p += 2;
471 tokens[tix].size = 2;
472 tokens[tix++].token_type = TOKEN_OPEN_ACTION;
473 continue;
474 }
475 if (memcmp(p, "})", 2) == 0) {
476 p += 2;
477 tokens[tix].size = 2;
478 tokens[tix++].token_type = TOKEN_CLOSE_ACTION;
479 continue;
480 }
481 }
482
483 if (nl - p >= 1) {
484 tokens[tix].size = 1;
485 switch (*p) {
486 case '{':
487 p += 1;
488 tokens[tix++].token_type = TOKEN_OPEN_CURLY;
489 continue;
490 case '}':
491 p += 1;
492 tokens[tix++].token_type = TOKEN_CLOSE_CURLY;
493 continue;
494 case '[':
495 p += 1;
496 tokens[tix++].token_type = TOKEN_OPEN_SQUARE;
497 continue;
498 case ']':
499 p += 1;
500 tokens[tix++].token_type = TOKEN_CLOSE_SQUARE;
501 continue;
502 case ',':
503 p += 1;
504 tokens[tix++].token_type = TOKEN_COMMA;
505 continue;
506 default:
507 break;
508 }
509 }
510
511 fprintf(stderr, "%s:%u: Unknown character in grammar: '%c'\n",
512 filename, lineno, *p);
513 exit(1);
514 }
515 }
516
517 nr_tokens = tix;
518 printf("Extracted %u tokens\n", nr_tokens);
519
520#if 0
521 {
522 int n;
523 for (n = 0; n < nr_tokens; n++)
524 printf("Token %3u: '%*.*s'\n",
525 n,
526 (int)token_list[n].size, (int)token_list[n].size,
527 token_list[n].value);
528 }
529#endif
530}
531
532static void build_type_list(void);
533static void parse(void);
534static void render(FILE *out, FILE *hdr);
535
536/*
537 *
538 */
539int main(int argc, char **argv)
540{
541 struct stat st;
542 ssize_t readlen;
543 FILE *out, *hdr;
544 char *buffer, *p;
545 int fd;
546
547 if (argc != 4) {
548 fprintf(stderr, "Format: %s <grammar-file> <c-file> <hdr-file>\n",
549 argv[0]);
550 exit(2);
551 }
552
553 filename = argv[1];
554 outputname = argv[2];
555 headername = argv[3];
556
557 fd = open(filename, O_RDONLY);
558 if (fd < 0) {
559 perror(filename);
560 exit(1);
561 }
562
563 if (fstat(fd, &st) < 0) {
564 perror(filename);
565 exit(1);
566 }
567
568 if (!(buffer = malloc(st.st_size + 1))) {
569 perror(NULL);
570 exit(1);
571 }
572
573 if ((readlen = read(fd, buffer, st.st_size)) < 0) {
574 perror(filename);
575 exit(1);
576 }
577
578 if (close(fd) < 0) {
579 perror(filename);
580 exit(1);
581 }
582
583 if (readlen != st.st_size) {
584 fprintf(stderr, "%s: Short read\n", filename);
585 exit(1);
586 }
587
588 p = strrchr(argv[1], '/');
589 p = p ? p + 1 : argv[1];
590 grammar_name = strdup(p);
591 if (!p) {
592 perror(NULL);
593 exit(1);
594 }
595 p = strchr(grammar_name, '.');
596 if (p)
597 *p = '\0';
598
599 buffer[readlen] = 0;
600 tokenise(buffer, buffer + readlen);
601 build_type_list();
602 parse();
603
604 out = fopen(outputname, "w");
605 if (!out) {
606 perror(outputname);
607 exit(1);
608 }
609
610 hdr = fopen(headername, "w");
611 if (!out) {
612 perror(headername);
613 exit(1);
614 }
615
616 render(out, hdr);
617
618 if (fclose(out) < 0) {
619 perror(outputname);
620 exit(1);
621 }
622
623 if (fclose(hdr) < 0) {
624 perror(headername);
625 exit(1);
626 }
627
628 return 0;
629}
630
631enum compound {
632 NOT_COMPOUND,
633 SET,
634 SET_OF,
635 SEQUENCE,
636 SEQUENCE_OF,
637 CHOICE,
638 ANY,
639 TYPE_REF,
640 TAG_OVERRIDE
641};
642
643struct element {
644 struct type *type_def;
645 struct token *name;
646 struct token *type;
647 struct action *action;
648 struct element *children;
649 struct element *next;
650 struct element *render_next;
651 struct element *list_next;
652 uint8_t n_elements;
653 enum compound compound : 8;
654 enum asn1_class class : 8;
655 enum asn1_method method : 8;
656 uint8_t tag;
657 unsigned entry_index;
658 unsigned flags;
659#define ELEMENT_IMPLICIT 0x0001
660#define ELEMENT_EXPLICIT 0x0002
661#define ELEMENT_MARKED 0x0004
662#define ELEMENT_RENDERED 0x0008
663#define ELEMENT_SKIPPABLE 0x0010
664#define ELEMENT_CONDITIONAL 0x0020
665};
666
667struct type {
668 struct token *name;
669 struct token *def;
670 struct element *element;
671 unsigned ref_count;
672 unsigned flags;
673#define TYPE_STOP_MARKER 0x0001
674#define TYPE_BEGIN 0x0002
675};
676
677static struct type *type_list;
678static struct type **type_index;
679static unsigned nr_types;
680
681static int type_index_compare(const void *_a, const void *_b)
682{
683 const struct type *const *a = _a, *const *b = _b;
684
685 if ((*a)->name->size != (*b)->name->size)
686 return (*a)->name->size - (*b)->name->size;
687 else
688 return memcmp((*a)->name->value, (*b)->name->value,
689 (*a)->name->size);
690}
691
692static int type_finder(const void *_key, const void *_ti)
693{
694 const struct token *token = _key;
695 const struct type *const *ti = _ti;
696 const struct type *type = *ti;
697
698 if (token->size != type->name->size)
699 return token->size - type->name->size;
700 else
701 return memcmp(token->value, type->name->value,
702 token->size);
703}
704
705/*
706 * Build up a list of types and a sorted index to that list.
707 */
708static void build_type_list(void)
709{
710 struct type *types;
711 unsigned nr, t, n;
712
713 nr = 0;
714 for (n = 0; n < nr_tokens - 1; n++)
715 if (token_list[n + 0].token_type == TOKEN_TYPE_NAME &&
716 token_list[n + 1].token_type == TOKEN_ASSIGNMENT)
717 nr++;
718
719 if (nr == 0) {
720 fprintf(stderr, "%s: No defined types\n", filename);
721 exit(1);
722 }
723
724 nr_types = nr;
725 types = type_list = calloc(nr + 1, sizeof(type_list[0]));
726 if (!type_list) {
727 perror(NULL);
728 exit(1);
729 }
730 type_index = calloc(nr, sizeof(type_index[0]));
731 if (!type_index) {
732 perror(NULL);
733 exit(1);
734 }
735
736 t = 0;
737 types[t].flags |= TYPE_BEGIN;
738 for (n = 0; n < nr_tokens - 1; n++) {
739 if (token_list[n + 0].token_type == TOKEN_TYPE_NAME &&
740 token_list[n + 1].token_type == TOKEN_ASSIGNMENT) {
741 types[t].name = &token_list[n];
742 type_index[t] = &types[t];
743 t++;
744 }
745 }
746 types[t].name = &token_list[n + 1];
747 types[t].flags |= TYPE_STOP_MARKER;
748
749 qsort(type_index, nr, sizeof(type_index[0]), type_index_compare);
750
751 printf("Extracted %u types\n", nr_types);
752#if 0
753 for (n = 0; n < nr_types; n++) {
754 struct type *type = type_index[n];
755 printf("- %*.*s\n",
756 (int)type->name->size,
757 (int)type->name->size,
758 type->name->value);
759 }
760#endif
761}
762
763static struct element *parse_type(struct token **_cursor, struct token *stop,
764 struct token *name);
765
766/*
767 * Parse the token stream
768 */
769static void parse(void)
770{
771 struct token *cursor;
772 struct type *type;
773
774 /* Parse one type definition statement at a time */
775 type = type_list;
776 do {
777 cursor = type->name;
778
779 if (cursor[0].token_type != TOKEN_TYPE_NAME ||
780 cursor[1].token_type != TOKEN_ASSIGNMENT)
781 abort();
782 cursor += 2;
783
784 type->element = parse_type(&cursor, type[1].name, NULL);
785 type->element->type_def = type;
786
787 if (cursor != type[1].name) {
788 fprintf(stderr, "%s:%d: Parse error at token '%*.*s'\n",
789 filename, cursor->line,
790 (int)cursor->size, (int)cursor->size, cursor->value);
791 exit(1);
792 }
793
794 } while (type++, !(type->flags & TYPE_STOP_MARKER));
795
796 printf("Extracted %u actions\n", nr_actions);
797}
798
799static struct element *element_list;
800
801static struct element *alloc_elem(struct token *type)
802{
803 struct element *e = calloc(1, sizeof(*e));
804 if (!e) {
805 perror(NULL);
806 exit(1);
807 }
808 e->list_next = element_list;
809 element_list = e;
810 return e;
811}
812
813static struct element *parse_compound(struct token **_cursor, struct token *end,
814 int alternates);
815
816/*
817 * Parse one type definition statement
818 */
819static struct element *parse_type(struct token **_cursor, struct token *end,
820 struct token *name)
821{
822 struct element *top, *element;
823 struct action *action, **ppaction;
824 struct token *cursor = *_cursor;
825 struct type **ref;
826 char *p;
827 int labelled = 0, implicit = 0;
828
829 top = element = alloc_elem(cursor);
830 element->class = ASN1_UNIV;
831 element->method = ASN1_PRIM;
832 element->tag = token_to_tag[cursor->token_type];
833 element->name = name;
834
835 /* Extract the tag value if one given */
836 if (cursor->token_type == TOKEN_OPEN_SQUARE) {
837 cursor++;
838 if (cursor >= end)
839 goto overrun_error;
840 switch (cursor->token_type) {
841 case DIRECTIVE_UNIVERSAL:
842 element->class = ASN1_UNIV;
843 cursor++;
844 break;
845 case DIRECTIVE_APPLICATION:
846 element->class = ASN1_APPL;
847 cursor++;
848 break;
849 case TOKEN_NUMBER:
850 element->class = ASN1_CONT;
851 break;
852 case DIRECTIVE_PRIVATE:
853 element->class = ASN1_PRIV;
854 cursor++;
855 break;
856 default:
857 fprintf(stderr, "%s:%d: Unrecognised tag class token '%*.*s'\n",
858 filename, cursor->line,
859 (int)cursor->size, (int)cursor->size, cursor->value);
860 exit(1);
861 }
862
863 if (cursor >= end)
864 goto overrun_error;
865 if (cursor->token_type != TOKEN_NUMBER) {
866 fprintf(stderr, "%s:%d: Missing tag number '%*.*s'\n",
867 filename, cursor->line,
868 (int)cursor->size, (int)cursor->size, cursor->value);
869 exit(1);
870 }
871
872 element->tag &= ~0x1f;
873 element->tag |= strtoul(cursor->value, &p, 10);
874 if (p - cursor->value != cursor->size)
875 abort();
876 cursor++;
877
878 if (cursor >= end)
879 goto overrun_error;
880 if (cursor->token_type != TOKEN_CLOSE_SQUARE) {
881 fprintf(stderr, "%s:%d: Missing closing square bracket '%*.*s'\n",
882 filename, cursor->line,
883 (int)cursor->size, (int)cursor->size, cursor->value);
884 exit(1);
885 }
886 cursor++;
887 if (cursor >= end)
888 goto overrun_error;
889 labelled = 1;
890 }
891
892 /* Handle implicit and explicit markers */
893 if (cursor->token_type == DIRECTIVE_IMPLICIT) {
894 element->flags |= ELEMENT_IMPLICIT;
895 implicit = 1;
896 cursor++;
897 if (cursor >= end)
898 goto overrun_error;
899 } else if (cursor->token_type == DIRECTIVE_EXPLICIT) {
900 element->flags |= ELEMENT_EXPLICIT;
901 cursor++;
902 if (cursor >= end)
903 goto overrun_error;
904 }
905
906 if (labelled) {
907 if (!implicit)
908 element->method |= ASN1_CONS;
909 element->compound = implicit ? TAG_OVERRIDE : SEQUENCE;
910 element->children = alloc_elem(cursor);
911 element = element->children;
912 element->class = ASN1_UNIV;
913 element->method = ASN1_PRIM;
914 element->tag = token_to_tag[cursor->token_type];
915 element->name = name;
916 }
917
918 /* Extract the type we're expecting here */
919 element->type = cursor;
920 switch (cursor->token_type) {
921 case DIRECTIVE_ANY:
922 element->compound = ANY;
923 cursor++;
924 break;
925
926 case DIRECTIVE_NULL:
927 case DIRECTIVE_BOOLEAN:
928 case DIRECTIVE_ENUMERATED:
929 case DIRECTIVE_INTEGER:
930 element->compound = NOT_COMPOUND;
931 cursor++;
932 break;
933
934 case DIRECTIVE_EXTERNAL:
935 element->method = ASN1_CONS;
936
937 case DIRECTIVE_BMPString:
938 case DIRECTIVE_GeneralString:
939 case DIRECTIVE_GraphicString:
940 case DIRECTIVE_IA5String:
941 case DIRECTIVE_ISO646String:
942 case DIRECTIVE_NumericString:
943 case DIRECTIVE_PrintableString:
944 case DIRECTIVE_T61String:
945 case DIRECTIVE_TeletexString:
946 case DIRECTIVE_UniversalString:
947 case DIRECTIVE_UTF8String:
948 case DIRECTIVE_VideotexString:
949 case DIRECTIVE_VisibleString:
950 case DIRECTIVE_ObjectDescriptor:
951 case DIRECTIVE_GeneralizedTime:
952 case DIRECTIVE_UTCTime:
953 element->compound = NOT_COMPOUND;
954 cursor++;
955 break;
956
957 case DIRECTIVE_BIT:
958 case DIRECTIVE_OCTET:
959 element->compound = NOT_COMPOUND;
960 cursor++;
961 if (cursor >= end)
962 goto overrun_error;
963 if (cursor->token_type != DIRECTIVE_STRING)
964 goto parse_error;
965 cursor++;
966 break;
967
968 case DIRECTIVE_OBJECT:
969 element->compound = NOT_COMPOUND;
970 cursor++;
971 if (cursor >= end)
972 goto overrun_error;
973 if (cursor->token_type != DIRECTIVE_IDENTIFIER)
974 goto parse_error;
975 cursor++;
976 break;
977
978 case TOKEN_TYPE_NAME:
979 element->compound = TYPE_REF;
980 ref = bsearch(cursor, type_index, nr_types, sizeof(type_index[0]),
981 type_finder);
982 if (!ref) {
983 fprintf(stderr, "%s:%d: Type '%*.*s' undefined\n",
984 filename, cursor->line,
985 (int)cursor->size, (int)cursor->size, cursor->value);
986 exit(1);
987 }
988 cursor->type = *ref;
989 (*ref)->ref_count++;
990 cursor++;
991 break;
992
993 case DIRECTIVE_CHOICE:
994 element->compound = CHOICE;
995 cursor++;
996 element->children = parse_compound(&cursor, end, 1);
997 break;
998
999 case DIRECTIVE_SEQUENCE:
1000 element->compound = SEQUENCE;
1001 element->method = ASN1_CONS;
1002 cursor++;
1003 if (cursor >= end)
1004 goto overrun_error;
1005 if (cursor->token_type == DIRECTIVE_OF) {
1006 element->compound = SEQUENCE_OF;
1007 cursor++;
1008 if (cursor >= end)
1009 goto overrun_error;
1010 element->children = parse_type(&cursor, end, NULL);
1011 } else {
1012 element->children = parse_compound(&cursor, end, 0);
1013 }
1014 break;
1015
1016 case DIRECTIVE_SET:
1017 element->compound = SET;
1018 element->method = ASN1_CONS;
1019 cursor++;
1020 if (cursor >= end)
1021 goto overrun_error;
1022 if (cursor->token_type == DIRECTIVE_OF) {
1023 element->compound = SET_OF;
1024 cursor++;
1025 if (cursor >= end)
1026 goto parse_error;
1027 element->children = parse_type(&cursor, end, NULL);
1028 } else {
1029 element->children = parse_compound(&cursor, end, 1);
1030 }
1031 break;
1032
1033 default:
1034 fprintf(stderr, "%s:%d: Token '%*.*s' does not introduce a type\n",
1035 filename, cursor->line,
1036 (int)cursor->size, (int)cursor->size, cursor->value);
1037 exit(1);
1038 }
1039
1040 /* Handle elements that are optional */
1041 if (cursor < end && (cursor->token_type == DIRECTIVE_OPTIONAL ||
1042 cursor->token_type == DIRECTIVE_DEFAULT)
1043 ) {
1044 cursor++;
1045 top->flags |= ELEMENT_SKIPPABLE;
1046 }
1047
1048 if (cursor < end && cursor->token_type == TOKEN_OPEN_ACTION) {
1049 cursor++;
1050 if (cursor >= end)
1051 goto overrun_error;
1052 if (cursor->token_type != TOKEN_ELEMENT_NAME) {
1053 fprintf(stderr, "%s:%d: Token '%*.*s' is not an action function name\n",
1054 filename, cursor->line,
1055 (int)cursor->size, (int)cursor->size, cursor->value);
1056 exit(1);
1057 }
1058
1059 action = malloc(sizeof(struct action) + cursor->size + 1);
1060 if (!action) {
1061 perror(NULL);
1062 exit(1);
1063 }
1064 action->index = 0;
1065 memcpy(action->name, cursor->value, cursor->size);
1066 action->name[cursor->size] = 0;
1067
1068 for (ppaction = &action_list;
1069 *ppaction;
1070 ppaction = &(*ppaction)->next
1071 ) {
1072 int cmp = strcmp(action->name, (*ppaction)->name);
1073 if (cmp == 0) {
1074 free(action);
1075 action = *ppaction;
1076 goto found;
1077 }
1078 if (cmp < 0) {
1079 action->next = *ppaction;
1080 *ppaction = action;
1081 nr_actions++;
1082 goto found;
1083 }
1084 }
1085 action->next = NULL;
1086 *ppaction = action;
1087 nr_actions++;
1088 found:
1089
1090 element->action = action;
1091 cursor->action = action;
1092 cursor++;
1093 if (cursor >= end)
1094 goto overrun_error;
1095 if (cursor->token_type != TOKEN_CLOSE_ACTION) {
1096 fprintf(stderr, "%s:%d: Missing close action, got '%*.*s'\n",
1097 filename, cursor->line,
1098 (int)cursor->size, (int)cursor->size, cursor->value);
1099 exit(1);
1100 }
1101 cursor++;
1102 }
1103
1104 *_cursor = cursor;
1105 return top;
1106
1107parse_error:
1108 fprintf(stderr, "%s:%d: Unexpected token '%*.*s'\n",
1109 filename, cursor->line,
1110 (int)cursor->size, (int)cursor->size, cursor->value);
1111 exit(1);
1112
1113overrun_error:
1114 fprintf(stderr, "%s: Unexpectedly hit EOF\n", filename);
1115 exit(1);
1116}
1117
1118/*
1119 * Parse a compound type list
1120 */
1121static struct element *parse_compound(struct token **_cursor, struct token *end,
1122 int alternates)
1123{
1124 struct element *children, **child_p = &children, *element;
1125 struct token *cursor = *_cursor, *name;
1126
1127 if (cursor->token_type != TOKEN_OPEN_CURLY) {
1128 fprintf(stderr, "%s:%d: Expected compound to start with brace not '%*.*s'\n",
1129 filename, cursor->line,
1130 (int)cursor->size, (int)cursor->size, cursor->value);
1131 exit(1);
1132 }
1133 cursor++;
1134 if (cursor >= end)
1135 goto overrun_error;
1136
1137 if (cursor->token_type == TOKEN_OPEN_CURLY) {
1138 fprintf(stderr, "%s:%d: Empty compound\n",
1139 filename, cursor->line);
1140 exit(1);
1141 }
1142
1143 for (;;) {
1144 name = NULL;
1145 if (cursor->token_type == TOKEN_ELEMENT_NAME) {
1146 name = cursor;
1147 cursor++;
1148 if (cursor >= end)
1149 goto overrun_error;
1150 }
1151
1152 element = parse_type(&cursor, end, name);
1153 if (alternates)
1154 element->flags |= ELEMENT_SKIPPABLE | ELEMENT_CONDITIONAL;
1155
1156 *child_p = element;
1157 child_p = &element->next;
1158
1159 if (cursor >= end)
1160 goto overrun_error;
1161 if (cursor->token_type != TOKEN_COMMA)
1162 break;
1163 cursor++;
1164 if (cursor >= end)
1165 goto overrun_error;
1166 }
1167
1168 children->flags &= ~ELEMENT_CONDITIONAL;
1169
1170 if (cursor->token_type != TOKEN_CLOSE_CURLY) {
1171 fprintf(stderr, "%s:%d: Expected compound closure, got '%*.*s'\n",
1172 filename, cursor->line,
1173 (int)cursor->size, (int)cursor->size, cursor->value);
1174 exit(1);
1175 }
1176 cursor++;
1177
1178 *_cursor = cursor;
1179 return children;
1180
1181overrun_error:
1182 fprintf(stderr, "%s: Unexpectedly hit EOF\n", filename);
1183 exit(1);
1184}
1185
1186static void render_element(FILE *out, struct element *e, struct element *tag);
1187static void render_out_of_line_list(FILE *out);
1188
1189static int nr_entries;
1190static int render_depth = 1;
1191static struct element *render_list, **render_list_p = &render_list;
1192
1193__attribute__((format(printf, 2, 3)))
1194static void render_opcode(FILE *out, const char *fmt, ...)
1195{
1196 va_list va;
1197
1198 if (out) {
1199 fprintf(out, "\t[%4d] =%*s", nr_entries, render_depth, "");
1200 va_start(va, fmt);
1201 vfprintf(out, fmt, va);
1202 va_end(va);
1203 }
1204 nr_entries++;
1205}
1206
1207__attribute__((format(printf, 2, 3)))
1208static void render_more(FILE *out, const char *fmt, ...)
1209{
1210 va_list va;
1211
1212 if (out) {
1213 va_start(va, fmt);
1214 vfprintf(out, fmt, va);
1215 va_end(va);
1216 }
1217}
1218
1219/*
1220 * Render the grammar into a state machine definition.
1221 */
1222static void render(FILE *out, FILE *hdr)
1223{
1224 struct element *e;
1225 struct action *action;
1226 struct type *root;
1227 int index;
1228
1229 fprintf(hdr, "/*\n");
1230 fprintf(hdr, " * Automatically generated by asn1_compiler. Do not edit\n");
1231 fprintf(hdr, " *\n");
1232 fprintf(hdr, " * ASN.1 parser for %s\n", grammar_name);
1233 fprintf(hdr, " */\n");
1234 fprintf(hdr, "#include <linux/asn1_decoder.h>\n");
1235 fprintf(hdr, "\n");
1236 fprintf(hdr, "extern const struct asn1_decoder %s_decoder;\n", grammar_name);
1237 if (ferror(hdr)) {
1238 perror(headername);
1239 exit(1);
1240 }
1241
1242 fprintf(out, "/*\n");
1243 fprintf(out, " * Automatically generated by asn1_compiler. Do not edit\n");
1244 fprintf(out, " *\n");
1245 fprintf(out, " * ASN.1 parser for %s\n", grammar_name);
1246 fprintf(out, " */\n");
1247 fprintf(out, "#include <linux/asn1_ber_bytecode.h>\n");
1248 fprintf(out, "#include \"%s-asn1.h\"\n", grammar_name);
1249 fprintf(out, "\n");
1250 if (ferror(out)) {
1251 perror(outputname);
1252 exit(1);
1253 }
1254
1255 /* Tabulate the action functions we might have to call */
1256 fprintf(hdr, "\n");
1257 index = 0;
1258 for (action = action_list; action; action = action->next) {
1259 action->index = index++;
1260 fprintf(hdr,
1261 "extern int %s(void *, size_t, unsigned char,"
1262 " const void *, size_t);\n",
1263 action->name);
1264 }
1265 fprintf(hdr, "\n");
1266
1267 fprintf(out, "enum %s_actions {\n", grammar_name);
1268 for (action = action_list; action; action = action->next)
1269 fprintf(out, "\tACT_%s = %u,\n",
1270 action->name, action->index);
1271 fprintf(out, "\tNR__%s_actions = %u\n", grammar_name, nr_actions);
1272 fprintf(out, "};\n");
1273
1274 fprintf(out, "\n");
1275 fprintf(out, "static const asn1_action_t %s_action_table[NR__%s_actions] = {\n",
1276 grammar_name, grammar_name);
1277 for (action = action_list; action; action = action->next)
1278 fprintf(out, "\t[%4u] = %s,\n", action->index, action->name);
1279 fprintf(out, "};\n");
1280
1281 if (ferror(out)) {
1282 perror(outputname);
1283 exit(1);
1284 }
1285
1286 /* We do two passes - the first one calculates all the offsets */
1287 printf("Pass 1\n");
1288 nr_entries = 0;
1289 root = &type_list[0];
1290 render_element(NULL, root->element, NULL);
1291 render_opcode(NULL, "ASN1_OP_COMPLETE,\n");
1292 render_out_of_line_list(NULL);
1293
1294 for (e = element_list; e; e = e->list_next)
1295 e->flags &= ~ELEMENT_RENDERED;
1296
1297 /* And then we actually render */
1298 printf("Pass 2\n");
1299 fprintf(out, "\n");
1300 fprintf(out, "static const unsigned char %s_machine[] = {\n",
1301 grammar_name);
1302
1303 nr_entries = 0;
1304 root = &type_list[0];
1305 render_element(out, root->element, NULL);
1306 render_opcode(out, "ASN1_OP_COMPLETE,\n");
1307 render_out_of_line_list(out);
1308
1309 fprintf(out, "};\n");
1310
1311 fprintf(out, "\n");
1312 fprintf(out, "const struct asn1_decoder %s_decoder = {\n", grammar_name);
1313 fprintf(out, "\t.machine = %s_machine,\n", grammar_name);
1314 fprintf(out, "\t.machlen = sizeof(%s_machine),\n", grammar_name);
1315 fprintf(out, "\t.actions = %s_action_table,\n", grammar_name);
1316 fprintf(out, "};\n");
1317}
1318
1319/*
1320 * Render the out-of-line elements
1321 */
1322static void render_out_of_line_list(FILE *out)
1323{
1324 struct element *e, *ce;
1325 const char *act;
1326 int entry;
1327
1328 while ((e = render_list)) {
1329 render_list = e->render_next;
1330 if (!render_list)
1331 render_list_p = &render_list;
1332
1333 render_more(out, "\n");
1334 e->entry_index = entry = nr_entries;
1335 render_depth++;
1336 for (ce = e->children; ce; ce = ce->next)
1337 render_element(out, ce, NULL);
1338 render_depth--;
1339
1340 act = e->action ? "_ACT" : "";
1341 switch (e->compound) {
1342 case SEQUENCE:
1343 render_opcode(out, "ASN1_OP_END_SEQ%s,\n", act);
1344 break;
1345 case SEQUENCE_OF:
1346 render_opcode(out, "ASN1_OP_END_SEQ_OF%s,\n", act);
1347 render_opcode(out, "_jump_target(%u),\n", entry);
1348 break;
1349 case SET:
1350 render_opcode(out, "ASN1_OP_END_SET%s,\n", act);
1351 break;
1352 case SET_OF:
1353 render_opcode(out, "ASN1_OP_END_SET_OF%s,\n", act);
1354 render_opcode(out, "_jump_target(%u),\n", entry);
1355 break;
1356 }
1357 if (e->action)
1358 render_opcode(out, "_action(ACT_%s),\n",
1359 e->action->name);
1360 render_opcode(out, "ASN1_OP_RETURN,\n");
1361 }
1362}
1363
1364/*
1365 * Render an element.
1366 */
1367static void render_element(FILE *out, struct element *e, struct element *tag)
1368{
1369 struct element *ec;
1370 const char *cond, *act;
1371 int entry, skippable = 0, outofline = 0;
1372
1373 if (e->flags & ELEMENT_SKIPPABLE ||
1374 (tag && tag->flags & ELEMENT_SKIPPABLE))
1375 skippable = 1;
1376
1377 if ((e->type_def && e->type_def->ref_count > 1) ||
1378 skippable)
1379 outofline = 1;
1380
1381 if (e->type_def && out) {
1382 render_more(out, "\t// %*.*s\n",
1383 (int)e->type_def->name->size, (int)e->type_def->name->size,
1384 e->type_def->name->value);
1385 }
1386
1387 /* Render the operation */
1388 cond = (e->flags & ELEMENT_CONDITIONAL ||
1389 (tag && tag->flags & ELEMENT_CONDITIONAL)) ? "COND_" : "";
1390 act = e->action ? "_ACT" : "";
1391 switch (e->compound) {
1392 case ANY:
1393 render_opcode(out, "ASN1_OP_%sMATCH_ANY%s,", cond, act);
1394 if (e->name)
1395 render_more(out, "\t\t// %*.*s",
1396 (int)e->name->size, (int)e->name->size,
1397 e->name->value);
1398 render_more(out, "\n");
1399 goto dont_render_tag;
1400
1401 case TAG_OVERRIDE:
1402 render_element(out, e->children, e);
1403 return;
1404
1405 case SEQUENCE:
1406 case SEQUENCE_OF:
1407 case SET:
1408 case SET_OF:
1409 render_opcode(out, "ASN1_OP_%sMATCH%s%s,",
1410 cond,
1411 outofline ? "_JUMP" : "",
1412 skippable ? "_OR_SKIP" : "");
1413 break;
1414
1415 case CHOICE:
1416 goto dont_render_tag;
1417
1418 case TYPE_REF:
1419 if (e->class == ASN1_UNIV && e->method == ASN1_PRIM && e->tag == 0)
1420 goto dont_render_tag;
1421 default:
1422 render_opcode(out, "ASN1_OP_%sMATCH%s%s,",
1423 cond, act,
1424 skippable ? "_OR_SKIP" : "");
1425 break;
1426 }
1427
1428 if (e->name)
1429 render_more(out, "\t\t// %*.*s",
1430 (int)e->name->size, (int)e->name->size,
1431 e->name->value);
1432 render_more(out, "\n");
1433
1434 /* Render the tag */
1435 if (!tag)
1436 tag = e;
1437 if (tag->class == ASN1_UNIV &&
1438 tag->tag != 14 &&
1439 tag->tag != 15 &&
1440 tag->tag != 31)
1441 render_opcode(out, "_tag(%s, %s, %s),\n",
1442 asn1_classes[tag->class],
1443 asn1_methods[tag->method | e->method],
1444 asn1_universal_tags[tag->tag]);
1445 else
1446 render_opcode(out, "_tagn(%s, %s, %2u),\n",
1447 asn1_classes[tag->class],
1448 asn1_methods[tag->method | e->method],
1449 tag->tag);
1450 tag = NULL;
1451dont_render_tag:
1452
1453 /* Deal with compound types */
1454 switch (e->compound) {
1455 case TYPE_REF:
1456 render_element(out, e->type->type->element, tag);
1457 if (e->action)
1458 render_opcode(out, "ASN1_OP_ACT,\n");
1459 break;
1460
1461 case SEQUENCE:
1462 if (outofline) {
1463 /* Render out-of-line for multiple use or
1464 * skipability */
1465 render_opcode(out, "_jump_target(%u),", e->entry_index);
1466 if (e->type_def && e->type_def->name)
1467 render_more(out, "\t\t// --> %*.*s",
1468 (int)e->type_def->name->size,
1469 (int)e->type_def->name->size,
1470 e->type_def->name->value);
1471 render_more(out, "\n");
1472 if (!(e->flags & ELEMENT_RENDERED)) {
1473 e->flags |= ELEMENT_RENDERED;
1474 *render_list_p = e;
1475 render_list_p = &e->render_next;
1476 }
1477 return;
1478 } else {
1479 /* Render inline for single use */
1480 render_depth++;
1481 for (ec = e->children; ec; ec = ec->next)
1482 render_element(out, ec, NULL);
1483 render_depth--;
1484 render_opcode(out, "ASN1_OP_END_SEQ%s,\n", act);
1485 }
1486 break;
1487
1488 case SEQUENCE_OF:
1489 case SET_OF:
1490 if (outofline) {
1491 /* Render out-of-line for multiple use or
1492 * skipability */
1493 render_opcode(out, "_jump_target(%u),", e->entry_index);
1494 if (e->type_def && e->type_def->name)
1495 render_more(out, "\t\t// --> %*.*s",
1496 (int)e->type_def->name->size,
1497 (int)e->type_def->name->size,
1498 e->type_def->name->value);
1499 render_more(out, "\n");
1500 if (!(e->flags & ELEMENT_RENDERED)) {
1501 e->flags |= ELEMENT_RENDERED;
1502 *render_list_p = e;
1503 render_list_p = &e->render_next;
1504 }
1505 return;
1506 } else {
1507 /* Render inline for single use */
1508 entry = nr_entries;
1509 render_depth++;
1510 render_element(out, e->children, NULL);
1511 render_depth--;
1512 if (e->compound == SEQUENCE_OF)
1513 render_opcode(out, "ASN1_OP_END_SEQ_OF%s,\n", act);
1514 else
1515 render_opcode(out, "ASN1_OP_END_SET_OF%s,\n", act);
1516 render_opcode(out, "_jump_target(%u),\n", entry);
1517 }
1518 break;
1519
1520 case SET:
1521 /* I can't think of a nice way to do SET support without having
1522 * a stack of bitmasks to make sure no element is repeated.
1523 * The bitmask has also to be checked that no non-optional
1524 * elements are left out whilst not preventing optional
1525 * elements from being left out.
1526 */
1527 fprintf(stderr, "The ASN.1 SET type is not currently supported.\n");
1528 exit(1);
1529
1530 case CHOICE:
1531 for (ec = e->children; ec; ec = ec->next)
1532 render_element(out, ec, NULL);
1533 if (!skippable)
1534 render_opcode(out, "ASN1_OP_COND_FAIL,\n");
1535 if (e->action)
1536 render_opcode(out, "ASN1_OP_ACT,\n");
1537 break;
1538
1539 default:
1540 break;
1541 }
1542
1543 if (e->action)
1544 render_opcode(out, "_action(ACT_%s),\n", e->action->name);
1545}
diff --git a/scripts/sign-file b/scripts/sign-file
new file mode 100644
index 000000000000..e58e34e50ac5
--- /dev/null
+++ b/scripts/sign-file
@@ -0,0 +1,115 @@
1#!/bin/sh
2#
3# Sign a module file using the given key.
4#
5# Format: sign-file <key> <x509> <src-file> <dst-file>
6#
7
8scripts=`dirname $0`
9
10CONFIG_MODULE_SIG_SHA512=y
11if [ -r .config ]
12then
13 . ./.config
14fi
15
16key="$1"
17x509="$2"
18src="$3"
19dst="$4"
20
21if [ ! -r "$key" ]
22then
23 echo "Can't read private key" >&2
24 exit 2
25fi
26
27if [ ! -r "$x509" ]
28then
29 echo "Can't read X.509 certificate" >&2
30 exit 2
31fi
32if [ ! -r "$x509.signer" ]
33then
34 echo "Can't read Signer name" >&2
35 exit 2;
36fi
37if [ ! -r "$x509.keyid" ]
38then
39 echo "Can't read Key identifier" >&2
40 exit 2;
41fi
42
43#
44# Signature parameters
45#
46algo=1 # Public-key crypto algorithm: RSA
47hash= # Digest algorithm
48id_type=1 # Identifier type: X.509
49
50#
51# Digest the data
52#
53dgst=
54if [ "$CONFIG_MODULE_SIG_SHA1" = "y" ]
55then
56 prologue="0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x04, 0x14"
57 dgst=-sha1
58 hash=2
59elif [ "$CONFIG_MODULE_SIG_SHA224" = "y" ]
60then
61 prologue="0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1C"
62 dgst=-sha224
63 hash=7
64elif [ "$CONFIG_MODULE_SIG_SHA256" = "y" ]
65then
66 prologue="0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20"
67 dgst=-sha256
68 hash=4
69elif [ "$CONFIG_MODULE_SIG_SHA384" = "y" ]
70then
71 prologue="0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30"
72 dgst=-sha384
73 hash=5
74elif [ "$CONFIG_MODULE_SIG_SHA512" = "y" ]
75then
76 prologue="0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40"
77 dgst=-sha512
78 hash=6
79else
80 echo "$0: Can't determine hash algorithm" >&2
81 exit 2
82fi
83
84(
85perl -e "binmode STDOUT; print pack(\"C*\", $prologue)" || exit $?
86openssl dgst $dgst -binary $src || exit $?
87) >$src.dig || exit $?
88
89#
90# Generate the binary signature, which will be just the integer that comprises
91# the signature with no metadata attached.
92#
93openssl rsautl -sign -inkey $key -keyform PEM -in $src.dig -out $src.sig || exit $?
94signerlen=`stat -c %s $x509.signer`
95keyidlen=`stat -c %s $x509.keyid`
96siglen=`stat -c %s $src.sig`
97
98#
99# Build the signed binary
100#
101(
102 cat $src || exit $?
103 echo '~Module signature appended~' || exit $?
104 cat $x509.signer $x509.keyid || exit $?
105
106 # Preface each signature integer with a 2-byte BE length
107 perl -e "binmode STDOUT; print pack(\"n\", $siglen)" || exit $?
108 cat $src.sig || exit $?
109
110 # Generate the information block
111 perl -e "binmode STDOUT; print pack(\"CCCCCxxxN\", $algo, $hash, $id_type, $signerlen, $keyidlen, $siglen + 2)" || exit $?
112) >$dst~ || exit $?
113
114# Permit in-place signing
115mv $dst~ $dst || exit $?
diff --git a/scripts/x509keyid b/scripts/x509keyid
new file mode 100755
index 000000000000..c8e91a4af385
--- /dev/null
+++ b/scripts/x509keyid
@@ -0,0 +1,268 @@
1#!/usr/bin/perl -w
2#
3# Generate an identifier from an X.509 certificate that can be placed in a
4# module signature to indentify the key to use.
5#
6# Format:
7#
8# ./scripts/x509keyid <x509-cert> <signer's-name> <key-id>
9#
10# We read the DER-encoded X509 certificate and parse it to extract the Subject
11# name and Subject Key Identifier. The provide the data we need to build the
12# certificate identifier.
13#
14# The signer's name part of the identifier is fabricated from the commonName,
15# the organizationName or the emailAddress components of the X.509 subject
16# name and written to the second named file.
17#
18# The subject key ID to select which of that signer's certificates we're
19# intending to use to sign the module is written to the third named file.
20#
21use strict;
22
23my $raw_data;
24
25die "Need three filenames\n" if ($#ARGV != 2);
26
27my $src = $ARGV[0];
28
29open(FD, "<$src") || die $src;
30binmode FD;
31my @st = stat(FD);
32die $src if (!@st);
33read(FD, $raw_data, $st[7]) || die $src;
34close(FD);
35
36my $UNIV = 0 << 6;
37my $APPL = 1 << 6;
38my $CONT = 2 << 6;
39my $PRIV = 3 << 6;
40
41my $CONS = 0x20;
42
43my $BOOLEAN = 0x01;
44my $INTEGER = 0x02;
45my $BIT_STRING = 0x03;
46my $OCTET_STRING = 0x04;
47my $NULL = 0x05;
48my $OBJ_ID = 0x06;
49my $UTF8String = 0x0c;
50my $SEQUENCE = 0x10;
51my $SET = 0x11;
52my $UTCTime = 0x17;
53my $GeneralizedTime = 0x18;
54
55my %OIDs = (
56 pack("CCC", 85, 4, 3) => "commonName",
57 pack("CCC", 85, 4, 6) => "countryName",
58 pack("CCC", 85, 4, 10) => "organizationName",
59 pack("CCC", 85, 4, 11) => "organizationUnitName",
60 pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 1, 1) => "rsaEncryption",
61 pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 1, 5) => "sha1WithRSAEncryption",
62 pack("CCCCCCCCC", 42, 134, 72, 134, 247, 13, 1, 9, 1) => "emailAddress",
63 pack("CCC", 85, 29, 35) => "authorityKeyIdentifier",
64 pack("CCC", 85, 29, 14) => "subjectKeyIdentifier",
65 pack("CCC", 85, 29, 19) => "basicConstraints"
66);
67
68###############################################################################
69#
70# Extract an ASN.1 element from a string and return information about it.
71#
72###############################################################################
73sub asn1_extract($$@)
74{
75 my ($cursor, $expected_tag, $optional) = @_;
76
77 return [ -1 ]
78 if ($cursor->[1] == 0 && $optional);
79
80 die $src, ": ", $cursor->[0], ": ASN.1 data underrun (elem ", $cursor->[1], ")\n"
81 if ($cursor->[1] < 2);
82
83 my ($tag, $len) = unpack("CC", substr(${$cursor->[2]}, $cursor->[0], 2));
84
85 if ($expected_tag != -1 && $tag != $expected_tag) {
86 return [ -1 ]
87 if ($optional);
88 die $src, ": ", $cursor->[0], ": ASN.1 unexpected tag (", $tag,
89 " not ", $expected_tag, ")\n";
90 }
91
92 $cursor->[0] += 2;
93 $cursor->[1] -= 2;
94
95 die $src, ": ", $cursor->[0], ": ASN.1 long tag\n"
96 if (($tag & 0x1f) == 0x1f);
97 die $src, ": ", $cursor->[0], ": ASN.1 indefinite length\n"
98 if ($len == 0x80);
99
100 if ($len > 0x80) {
101 my $l = $len - 0x80;
102 die $src, ": ", $cursor->[0], ": ASN.1 data underrun (len len $l)\n"
103 if ($cursor->[1] < $l);
104
105 if ($l == 0x1) {
106 $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1));
107 } elsif ($l = 0x2) {
108 $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0], 2));
109 } elsif ($l = 0x3) {
110 $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1)) << 16;
111 $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0] + 1, 2));
112 } elsif ($l = 0x4) {
113 $len = unpack("N", substr(${$cursor->[2]}, $cursor->[0], 4));
114 } else {
115 die $src, ": ", $cursor->[0], ": ASN.1 element too long (", $l, ")\n";
116 }
117
118 $cursor->[0] += $l;
119 $cursor->[1] -= $l;
120 }
121
122 die $src, ": ", $cursor->[0], ": ASN.1 data underrun (", $len, ")\n"
123 if ($cursor->[1] < $len);
124
125 my $ret = [ $tag, [ $cursor->[0], $len, $cursor->[2] ] ];
126 $cursor->[0] += $len;
127 $cursor->[1] -= $len;
128
129 return $ret;
130}
131
132###############################################################################
133#
134# Retrieve the data referred to by a cursor
135#
136###############################################################################
137sub asn1_retrieve($)
138{
139 my ($cursor) = @_;
140 my ($offset, $len, $data) = @$cursor;
141 return substr($$data, $offset, $len);
142}
143
144###############################################################################
145#
146# Roughly parse the X.509 certificate
147#
148###############################################################################
149my $cursor = [ 0, length($raw_data), \$raw_data ];
150
151my $cert = asn1_extract($cursor, $UNIV | $CONS | $SEQUENCE);
152my $tbs = asn1_extract($cert->[1], $UNIV | $CONS | $SEQUENCE);
153my $version = asn1_extract($tbs->[1], $CONT | $CONS | 0, 1);
154my $serial_number = asn1_extract($tbs->[1], $UNIV | $INTEGER);
155my $sig_type = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
156my $issuer = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
157my $validity = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
158my $subject = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
159my $key = asn1_extract($tbs->[1], $UNIV | $CONS | $SEQUENCE);
160my $issuer_uid = asn1_extract($tbs->[1], $CONT | $CONS | 1, 1);
161my $subject_uid = asn1_extract($tbs->[1], $CONT | $CONS | 2, 1);
162my $extension_list = asn1_extract($tbs->[1], $CONT | $CONS | 3, 1);
163
164my $subject_key_id = ();
165my $authority_key_id = ();
166
167#
168# Parse the extension list
169#
170if ($extension_list->[0] != -1) {
171 my $extensions = asn1_extract($extension_list->[1], $UNIV | $CONS | $SEQUENCE);
172
173 while ($extensions->[1]->[1] > 0) {
174 my $ext = asn1_extract($extensions->[1], $UNIV | $CONS | $SEQUENCE);
175 my $x_oid = asn1_extract($ext->[1], $UNIV | $OBJ_ID);
176 my $x_crit = asn1_extract($ext->[1], $UNIV | $BOOLEAN, 1);
177 my $x_val = asn1_extract($ext->[1], $UNIV | $OCTET_STRING);
178
179 my $raw_oid = asn1_retrieve($x_oid->[1]);
180 next if (!exists($OIDs{$raw_oid}));
181 my $x_type = $OIDs{$raw_oid};
182
183 my $raw_value = asn1_retrieve($x_val->[1]);
184
185 if ($x_type eq "subjectKeyIdentifier") {
186 my $vcursor = [ 0, length($raw_value), \$raw_value ];
187
188 $subject_key_id = asn1_extract($vcursor, $UNIV | $OCTET_STRING);
189 }
190 }
191}
192
193###############################################################################
194#
195# Determine what we're going to use as the signer's name. In order of
196# preference, take one of: commonName, organizationName or emailAddress.
197#
198###############################################################################
199my $org = "";
200my $cn = "";
201my $email = "";
202
203while ($subject->[1]->[1] > 0) {
204 my $rdn = asn1_extract($subject->[1], $UNIV | $CONS | $SET);
205 my $attr = asn1_extract($rdn->[1], $UNIV | $CONS | $SEQUENCE);
206 my $n_oid = asn1_extract($attr->[1], $UNIV | $OBJ_ID);
207 my $n_val = asn1_extract($attr->[1], -1);
208
209 my $raw_oid = asn1_retrieve($n_oid->[1]);
210 next if (!exists($OIDs{$raw_oid}));
211 my $n_type = $OIDs{$raw_oid};
212
213 my $raw_value = asn1_retrieve($n_val->[1]);
214
215 if ($n_type eq "organizationName") {
216 $org = $raw_value;
217 } elsif ($n_type eq "commonName") {
218 $cn = $raw_value;
219 } elsif ($n_type eq "emailAddress") {
220 $email = $raw_value;
221 }
222}
223
224my $id_name = $email;
225
226if ($org && $cn) {
227 # Don't use the organizationName if the commonName repeats it
228 if (length($org) <= length($cn) &&
229 substr($cn, 0, length($org)) eq $org) {
230 $id_name = $cn;
231 goto got_id_name;
232 }
233
234 # Or a signifcant chunk of it
235 if (length($org) >= 7 &&
236 length($cn) >= 7 &&
237 substr($cn, 0, 7) eq substr($org, 0, 7)) {
238 $id_name = $cn;
239 goto got_id_name;
240 }
241
242 $id_name = $org . ": " . $cn;
243} elsif ($org) {
244 $id_name = $org;
245} elsif ($cn) {
246 $id_name = $cn;
247}
248
249got_id_name:
250
251###############################################################################
252#
253# Output the signer's name and the key identifier that we're going to include
254# in module signatures.
255#
256###############################################################################
257die $src, ": ", "X.509: Couldn't find the Subject Key Identifier extension\n"
258 if (!$subject_key_id);
259
260my $id_key_id = asn1_retrieve($subject_key_id->[1]);
261
262open(OUTFD, ">$ARGV[1]") || die $ARGV[1];
263print OUTFD $id_name;
264close OUTFD || die $ARGV[1];
265
266open(OUTFD, ">$ARGV[2]") || die $ARGV[2];
267print OUTFD $id_key_id;
268close OUTFD || die $ARGV[2];
diff --git a/security/keys/encrypted-keys/encrypted.c b/security/keys/encrypted-keys/encrypted.c
index 2d1bb8af7696..9e1e005c7596 100644
--- a/security/keys/encrypted-keys/encrypted.c
+++ b/security/keys/encrypted-keys/encrypted.c
@@ -773,8 +773,8 @@ static int encrypted_init(struct encrypted_key_payload *epayload,
773 * 773 *
774 * On success, return 0. Otherwise return errno. 774 * On success, return 0. Otherwise return errno.
775 */ 775 */
776static int encrypted_instantiate(struct key *key, const void *data, 776static int encrypted_instantiate(struct key *key,
777 size_t datalen) 777 struct key_preparsed_payload *prep)
778{ 778{
779 struct encrypted_key_payload *epayload = NULL; 779 struct encrypted_key_payload *epayload = NULL;
780 char *datablob = NULL; 780 char *datablob = NULL;
@@ -782,16 +782,17 @@ static int encrypted_instantiate(struct key *key, const void *data,
782 char *master_desc = NULL; 782 char *master_desc = NULL;
783 char *decrypted_datalen = NULL; 783 char *decrypted_datalen = NULL;
784 char *hex_encoded_iv = NULL; 784 char *hex_encoded_iv = NULL;
785 size_t datalen = prep->datalen;
785 int ret; 786 int ret;
786 787
787 if (datalen <= 0 || datalen > 32767 || !data) 788 if (datalen <= 0 || datalen > 32767 || !prep->data)
788 return -EINVAL; 789 return -EINVAL;
789 790
790 datablob = kmalloc(datalen + 1, GFP_KERNEL); 791 datablob = kmalloc(datalen + 1, GFP_KERNEL);
791 if (!datablob) 792 if (!datablob)
792 return -ENOMEM; 793 return -ENOMEM;
793 datablob[datalen] = 0; 794 datablob[datalen] = 0;
794 memcpy(datablob, data, datalen); 795 memcpy(datablob, prep->data, datalen);
795 ret = datablob_parse(datablob, &format, &master_desc, 796 ret = datablob_parse(datablob, &format, &master_desc,
796 &decrypted_datalen, &hex_encoded_iv); 797 &decrypted_datalen, &hex_encoded_iv);
797 if (ret < 0) 798 if (ret < 0)
@@ -834,16 +835,17 @@ static void encrypted_rcu_free(struct rcu_head *rcu)
834 * 835 *
835 * On success, return 0. Otherwise return errno. 836 * On success, return 0. Otherwise return errno.
836 */ 837 */
837static int encrypted_update(struct key *key, const void *data, size_t datalen) 838static int encrypted_update(struct key *key, struct key_preparsed_payload *prep)
838{ 839{
839 struct encrypted_key_payload *epayload = key->payload.data; 840 struct encrypted_key_payload *epayload = key->payload.data;
840 struct encrypted_key_payload *new_epayload; 841 struct encrypted_key_payload *new_epayload;
841 char *buf; 842 char *buf;
842 char *new_master_desc = NULL; 843 char *new_master_desc = NULL;
843 const char *format = NULL; 844 const char *format = NULL;
845 size_t datalen = prep->datalen;
844 int ret = 0; 846 int ret = 0;
845 847
846 if (datalen <= 0 || datalen > 32767 || !data) 848 if (datalen <= 0 || datalen > 32767 || !prep->data)
847 return -EINVAL; 849 return -EINVAL;
848 850
849 buf = kmalloc(datalen + 1, GFP_KERNEL); 851 buf = kmalloc(datalen + 1, GFP_KERNEL);
@@ -851,7 +853,7 @@ static int encrypted_update(struct key *key, const void *data, size_t datalen)
851 return -ENOMEM; 853 return -ENOMEM;
852 854
853 buf[datalen] = 0; 855 buf[datalen] = 0;
854 memcpy(buf, data, datalen); 856 memcpy(buf, prep->data, datalen);
855 ret = datablob_parse(buf, &format, &new_master_desc, NULL, NULL); 857 ret = datablob_parse(buf, &format, &new_master_desc, NULL, NULL);
856 if (ret < 0) 858 if (ret < 0)
857 goto out; 859 goto out;
diff --git a/security/keys/key.c b/security/keys/key.c
index a30e92734905..a15c9da8f971 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -405,8 +405,7 @@ EXPORT_SYMBOL(key_payload_reserve);
405 * key_construction_mutex. 405 * key_construction_mutex.
406 */ 406 */
407static int __key_instantiate_and_link(struct key *key, 407static int __key_instantiate_and_link(struct key *key,
408 const void *data, 408 struct key_preparsed_payload *prep,
409 size_t datalen,
410 struct key *keyring, 409 struct key *keyring,
411 struct key *authkey, 410 struct key *authkey,
412 unsigned long *_prealloc) 411 unsigned long *_prealloc)
@@ -424,7 +423,7 @@ static int __key_instantiate_and_link(struct key *key,
424 /* can't instantiate twice */ 423 /* can't instantiate twice */
425 if (!test_bit(KEY_FLAG_INSTANTIATED, &key->flags)) { 424 if (!test_bit(KEY_FLAG_INSTANTIATED, &key->flags)) {
426 /* instantiate the key */ 425 /* instantiate the key */
427 ret = key->type->instantiate(key, data, datalen); 426 ret = key->type->instantiate(key, prep);
428 427
429 if (ret == 0) { 428 if (ret == 0) {
430 /* mark the key as being instantiated */ 429 /* mark the key as being instantiated */
@@ -475,22 +474,37 @@ int key_instantiate_and_link(struct key *key,
475 struct key *keyring, 474 struct key *keyring,
476 struct key *authkey) 475 struct key *authkey)
477{ 476{
477 struct key_preparsed_payload prep;
478 unsigned long prealloc; 478 unsigned long prealloc;
479 int ret; 479 int ret;
480 480
481 memset(&prep, 0, sizeof(prep));
482 prep.data = data;
483 prep.datalen = datalen;
484 prep.quotalen = key->type->def_datalen;
485 if (key->type->preparse) {
486 ret = key->type->preparse(&prep);
487 if (ret < 0)
488 goto error;
489 }
490
481 if (keyring) { 491 if (keyring) {
482 ret = __key_link_begin(keyring, key->type, key->description, 492 ret = __key_link_begin(keyring, key->type, key->description,
483 &prealloc); 493 &prealloc);
484 if (ret < 0) 494 if (ret < 0)
485 return ret; 495 goto error_free_preparse;
486 } 496 }
487 497
488 ret = __key_instantiate_and_link(key, data, datalen, keyring, authkey, 498 ret = __key_instantiate_and_link(key, &prep, keyring, authkey,
489 &prealloc); 499 &prealloc);
490 500
491 if (keyring) 501 if (keyring)
492 __key_link_end(keyring, key->type, prealloc); 502 __key_link_end(keyring, key->type, prealloc);
493 503
504error_free_preparse:
505 if (key->type->preparse)
506 key->type->free_preparse(&prep);
507error:
494 return ret; 508 return ret;
495} 509}
496 510
@@ -699,7 +713,7 @@ void key_type_put(struct key_type *ktype)
699 * if we get an error. 713 * if we get an error.
700 */ 714 */
701static inline key_ref_t __key_update(key_ref_t key_ref, 715static inline key_ref_t __key_update(key_ref_t key_ref,
702 const void *payload, size_t plen) 716 struct key_preparsed_payload *prep)
703{ 717{
704 struct key *key = key_ref_to_ptr(key_ref); 718 struct key *key = key_ref_to_ptr(key_ref);
705 int ret; 719 int ret;
@@ -715,7 +729,7 @@ static inline key_ref_t __key_update(key_ref_t key_ref,
715 729
716 down_write(&key->sem); 730 down_write(&key->sem);
717 731
718 ret = key->type->update(key, payload, plen); 732 ret = key->type->update(key, prep);
719 if (ret == 0) 733 if (ret == 0)
720 /* updating a negative key instantiates it */ 734 /* updating a negative key instantiates it */
721 clear_bit(KEY_FLAG_NEGATIVE, &key->flags); 735 clear_bit(KEY_FLAG_NEGATIVE, &key->flags);
@@ -767,6 +781,7 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref,
767 unsigned long flags) 781 unsigned long flags)
768{ 782{
769 unsigned long prealloc; 783 unsigned long prealloc;
784 struct key_preparsed_payload prep;
770 const struct cred *cred = current_cred(); 785 const struct cred *cred = current_cred();
771 struct key_type *ktype; 786 struct key_type *ktype;
772 struct key *keyring, *key = NULL; 787 struct key *keyring, *key = NULL;
@@ -782,8 +797,9 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref,
782 } 797 }
783 798
784 key_ref = ERR_PTR(-EINVAL); 799 key_ref = ERR_PTR(-EINVAL);
785 if (!ktype->match || !ktype->instantiate) 800 if (!ktype->match || !ktype->instantiate ||
786 goto error_2; 801 (!description && !ktype->preparse))
802 goto error_put_type;
787 803
788 keyring = key_ref_to_ptr(keyring_ref); 804 keyring = key_ref_to_ptr(keyring_ref);
789 805
@@ -791,18 +807,37 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref,
791 807
792 key_ref = ERR_PTR(-ENOTDIR); 808 key_ref = ERR_PTR(-ENOTDIR);
793 if (keyring->type != &key_type_keyring) 809 if (keyring->type != &key_type_keyring)
794 goto error_2; 810 goto error_put_type;
811
812 memset(&prep, 0, sizeof(prep));
813 prep.data = payload;
814 prep.datalen = plen;
815 prep.quotalen = ktype->def_datalen;
816 if (ktype->preparse) {
817 ret = ktype->preparse(&prep);
818 if (ret < 0) {
819 key_ref = ERR_PTR(ret);
820 goto error_put_type;
821 }
822 if (!description)
823 description = prep.description;
824 key_ref = ERR_PTR(-EINVAL);
825 if (!description)
826 goto error_free_prep;
827 }
795 828
796 ret = __key_link_begin(keyring, ktype, description, &prealloc); 829 ret = __key_link_begin(keyring, ktype, description, &prealloc);
797 if (ret < 0) 830 if (ret < 0) {
798 goto error_2; 831 key_ref = ERR_PTR(ret);
832 goto error_free_prep;
833 }
799 834
800 /* if we're going to allocate a new key, we're going to have 835 /* if we're going to allocate a new key, we're going to have
801 * to modify the keyring */ 836 * to modify the keyring */
802 ret = key_permission(keyring_ref, KEY_WRITE); 837 ret = key_permission(keyring_ref, KEY_WRITE);
803 if (ret < 0) { 838 if (ret < 0) {
804 key_ref = ERR_PTR(ret); 839 key_ref = ERR_PTR(ret);
805 goto error_3; 840 goto error_link_end;
806 } 841 }
807 842
808 /* if it's possible to update this type of key, search for an existing 843 /* if it's possible to update this type of key, search for an existing
@@ -833,25 +868,27 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref,
833 perm, flags); 868 perm, flags);
834 if (IS_ERR(key)) { 869 if (IS_ERR(key)) {
835 key_ref = ERR_CAST(key); 870 key_ref = ERR_CAST(key);
836 goto error_3; 871 goto error_link_end;
837 } 872 }
838 873
839 /* instantiate it and link it into the target keyring */ 874 /* instantiate it and link it into the target keyring */
840 ret = __key_instantiate_and_link(key, payload, plen, keyring, NULL, 875 ret = __key_instantiate_and_link(key, &prep, keyring, NULL, &prealloc);
841 &prealloc);
842 if (ret < 0) { 876 if (ret < 0) {
843 key_put(key); 877 key_put(key);
844 key_ref = ERR_PTR(ret); 878 key_ref = ERR_PTR(ret);
845 goto error_3; 879 goto error_link_end;
846 } 880 }
847 881
848 key_ref = make_key_ref(key, is_key_possessed(keyring_ref)); 882 key_ref = make_key_ref(key, is_key_possessed(keyring_ref));
849 883
850 error_3: 884error_link_end:
851 __key_link_end(keyring, ktype, prealloc); 885 __key_link_end(keyring, ktype, prealloc);
852 error_2: 886error_free_prep:
887 if (ktype->preparse)
888 ktype->free_preparse(&prep);
889error_put_type:
853 key_type_put(ktype); 890 key_type_put(ktype);
854 error: 891error:
855 return key_ref; 892 return key_ref;
856 893
857 found_matching_key: 894 found_matching_key:
@@ -859,10 +896,9 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref,
859 * - we can drop the locks first as we have the key pinned 896 * - we can drop the locks first as we have the key pinned
860 */ 897 */
861 __key_link_end(keyring, ktype, prealloc); 898 __key_link_end(keyring, ktype, prealloc);
862 key_type_put(ktype);
863 899
864 key_ref = __key_update(key_ref, payload, plen); 900 key_ref = __key_update(key_ref, &prep);
865 goto error; 901 goto error_free_prep;
866} 902}
867EXPORT_SYMBOL(key_create_or_update); 903EXPORT_SYMBOL(key_create_or_update);
868 904
@@ -881,6 +917,7 @@ EXPORT_SYMBOL(key_create_or_update);
881 */ 917 */
882int key_update(key_ref_t key_ref, const void *payload, size_t plen) 918int key_update(key_ref_t key_ref, const void *payload, size_t plen)
883{ 919{
920 struct key_preparsed_payload prep;
884 struct key *key = key_ref_to_ptr(key_ref); 921 struct key *key = key_ref_to_ptr(key_ref);
885 int ret; 922 int ret;
886 923
@@ -893,18 +930,31 @@ int key_update(key_ref_t key_ref, const void *payload, size_t plen)
893 930
894 /* attempt to update it if supported */ 931 /* attempt to update it if supported */
895 ret = -EOPNOTSUPP; 932 ret = -EOPNOTSUPP;
896 if (key->type->update) { 933 if (!key->type->update)
897 down_write(&key->sem); 934 goto error;
898
899 ret = key->type->update(key, payload, plen);
900 if (ret == 0)
901 /* updating a negative key instantiates it */
902 clear_bit(KEY_FLAG_NEGATIVE, &key->flags);
903 935
904 up_write(&key->sem); 936 memset(&prep, 0, sizeof(prep));
937 prep.data = payload;
938 prep.datalen = plen;
939 prep.quotalen = key->type->def_datalen;
940 if (key->type->preparse) {
941 ret = key->type->preparse(&prep);
942 if (ret < 0)
943 goto error;
905 } 944 }
906 945
907 error: 946 down_write(&key->sem);
947
948 ret = key->type->update(key, &prep);
949 if (ret == 0)
950 /* updating a negative key instantiates it */
951 clear_bit(KEY_FLAG_NEGATIVE, &key->flags);
952
953 up_write(&key->sem);
954
955 if (key->type->preparse)
956 key->type->free_preparse(&prep);
957error:
908 return ret; 958 return ret;
909} 959}
910EXPORT_SYMBOL(key_update); 960EXPORT_SYMBOL(key_update);
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index 305ecb76519c..5d34b4e827d6 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -46,6 +46,9 @@ static int key_get_type_from_user(char *type,
46 * Extract the description of a new key from userspace and either add it as a 46 * Extract the description of a new key from userspace and either add it as a
47 * new key to the specified keyring or update a matching key in that keyring. 47 * new key to the specified keyring or update a matching key in that keyring.
48 * 48 *
49 * If the description is NULL or an empty string, the key type is asked to
50 * generate one from the payload.
51 *
49 * The keyring must be writable so that we can attach the key to it. 52 * The keyring must be writable so that we can attach the key to it.
50 * 53 *
51 * If successful, the new key's serial number is returned, otherwise an error 54 * If successful, the new key's serial number is returned, otherwise an error
@@ -72,10 +75,17 @@ SYSCALL_DEFINE5(add_key, const char __user *, _type,
72 if (ret < 0) 75 if (ret < 0)
73 goto error; 76 goto error;
74 77
75 description = strndup_user(_description, PAGE_SIZE); 78 description = NULL;
76 if (IS_ERR(description)) { 79 if (_description) {
77 ret = PTR_ERR(description); 80 description = strndup_user(_description, PAGE_SIZE);
78 goto error; 81 if (IS_ERR(description)) {
82 ret = PTR_ERR(description);
83 goto error;
84 }
85 if (!*description) {
86 kfree(description);
87 description = NULL;
88 }
79 } 89 }
80 90
81 /* pull the payload in if one was supplied */ 91 /* pull the payload in if one was supplied */
diff --git a/security/keys/keyring.c b/security/keys/keyring.c
index a5f5c4b6edc5..6e42df15a24c 100644
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -66,7 +66,7 @@ static inline unsigned keyring_hash(const char *desc)
66 * operations. 66 * operations.
67 */ 67 */
68static int keyring_instantiate(struct key *keyring, 68static int keyring_instantiate(struct key *keyring,
69 const void *data, size_t datalen); 69 struct key_preparsed_payload *prep);
70static int keyring_match(const struct key *keyring, const void *criterion); 70static int keyring_match(const struct key *keyring, const void *criterion);
71static void keyring_revoke(struct key *keyring); 71static void keyring_revoke(struct key *keyring);
72static void keyring_destroy(struct key *keyring); 72static void keyring_destroy(struct key *keyring);
@@ -121,12 +121,12 @@ static void keyring_publish_name(struct key *keyring)
121 * Returns 0 on success, -EINVAL if given any data. 121 * Returns 0 on success, -EINVAL if given any data.
122 */ 122 */
123static int keyring_instantiate(struct key *keyring, 123static int keyring_instantiate(struct key *keyring,
124 const void *data, size_t datalen) 124 struct key_preparsed_payload *prep)
125{ 125{
126 int ret; 126 int ret;
127 127
128 ret = -EINVAL; 128 ret = -EINVAL;
129 if (datalen == 0) { 129 if (prep->datalen == 0) {
130 /* make the keyring available by name if it has one */ 130 /* make the keyring available by name if it has one */
131 keyring_publish_name(keyring); 131 keyring_publish_name(keyring);
132 ret = 0; 132 ret = 0;
diff --git a/security/keys/request_key_auth.c b/security/keys/request_key_auth.c
index 60d4e3f5e4bb..85730d5a5a59 100644
--- a/security/keys/request_key_auth.c
+++ b/security/keys/request_key_auth.c
@@ -19,7 +19,8 @@
19#include <asm/uaccess.h> 19#include <asm/uaccess.h>
20#include "internal.h" 20#include "internal.h"
21 21
22static int request_key_auth_instantiate(struct key *, const void *, size_t); 22static int request_key_auth_instantiate(struct key *,
23 struct key_preparsed_payload *);
23static void request_key_auth_describe(const struct key *, struct seq_file *); 24static void request_key_auth_describe(const struct key *, struct seq_file *);
24static void request_key_auth_revoke(struct key *); 25static void request_key_auth_revoke(struct key *);
25static void request_key_auth_destroy(struct key *); 26static void request_key_auth_destroy(struct key *);
@@ -42,10 +43,9 @@ struct key_type key_type_request_key_auth = {
42 * Instantiate a request-key authorisation key. 43 * Instantiate a request-key authorisation key.
43 */ 44 */
44static int request_key_auth_instantiate(struct key *key, 45static int request_key_auth_instantiate(struct key *key,
45 const void *data, 46 struct key_preparsed_payload *prep)
46 size_t datalen)
47{ 47{
48 key->payload.data = (struct request_key_auth *) data; 48 key->payload.data = (struct request_key_auth *)prep->data;
49 return 0; 49 return 0;
50} 50}
51 51
diff --git a/security/keys/trusted.c b/security/keys/trusted.c
index 3f163d0489ad..e13fcf7636f7 100644
--- a/security/keys/trusted.c
+++ b/security/keys/trusted.c
@@ -895,23 +895,24 @@ static struct trusted_key_payload *trusted_payload_alloc(struct key *key)
895 * 895 *
896 * On success, return 0. Otherwise return errno. 896 * On success, return 0. Otherwise return errno.
897 */ 897 */
898static int trusted_instantiate(struct key *key, const void *data, 898static int trusted_instantiate(struct key *key,
899 size_t datalen) 899 struct key_preparsed_payload *prep)
900{ 900{
901 struct trusted_key_payload *payload = NULL; 901 struct trusted_key_payload *payload = NULL;
902 struct trusted_key_options *options = NULL; 902 struct trusted_key_options *options = NULL;
903 size_t datalen = prep->datalen;
903 char *datablob; 904 char *datablob;
904 int ret = 0; 905 int ret = 0;
905 int key_cmd; 906 int key_cmd;
906 size_t key_len; 907 size_t key_len;
907 908
908 if (datalen <= 0 || datalen > 32767 || !data) 909 if (datalen <= 0 || datalen > 32767 || !prep->data)
909 return -EINVAL; 910 return -EINVAL;
910 911
911 datablob = kmalloc(datalen + 1, GFP_KERNEL); 912 datablob = kmalloc(datalen + 1, GFP_KERNEL);
912 if (!datablob) 913 if (!datablob)
913 return -ENOMEM; 914 return -ENOMEM;
914 memcpy(datablob, data, datalen); 915 memcpy(datablob, prep->data, datalen);
915 datablob[datalen] = '\0'; 916 datablob[datalen] = '\0';
916 917
917 options = trusted_options_alloc(); 918 options = trusted_options_alloc();
@@ -981,17 +982,18 @@ static void trusted_rcu_free(struct rcu_head *rcu)
981/* 982/*
982 * trusted_update - reseal an existing key with new PCR values 983 * trusted_update - reseal an existing key with new PCR values
983 */ 984 */
984static int trusted_update(struct key *key, const void *data, size_t datalen) 985static int trusted_update(struct key *key, struct key_preparsed_payload *prep)
985{ 986{
986 struct trusted_key_payload *p = key->payload.data; 987 struct trusted_key_payload *p = key->payload.data;
987 struct trusted_key_payload *new_p; 988 struct trusted_key_payload *new_p;
988 struct trusted_key_options *new_o; 989 struct trusted_key_options *new_o;
990 size_t datalen = prep->datalen;
989 char *datablob; 991 char *datablob;
990 int ret = 0; 992 int ret = 0;
991 993
992 if (!p->migratable) 994 if (!p->migratable)
993 return -EPERM; 995 return -EPERM;
994 if (datalen <= 0 || datalen > 32767 || !data) 996 if (datalen <= 0 || datalen > 32767 || !prep->data)
995 return -EINVAL; 997 return -EINVAL;
996 998
997 datablob = kmalloc(datalen + 1, GFP_KERNEL); 999 datablob = kmalloc(datalen + 1, GFP_KERNEL);
@@ -1008,7 +1010,7 @@ static int trusted_update(struct key *key, const void *data, size_t datalen)
1008 goto out; 1010 goto out;
1009 } 1011 }
1010 1012
1011 memcpy(datablob, data, datalen); 1013 memcpy(datablob, prep->data, datalen);
1012 datablob[datalen] = '\0'; 1014 datablob[datalen] = '\0';
1013 ret = datablob_parse(datablob, new_p, new_o); 1015 ret = datablob_parse(datablob, new_p, new_o);
1014 if (ret != Opt_update) { 1016 if (ret != Opt_update) {
diff --git a/security/keys/user_defined.c b/security/keys/user_defined.c
index c7660a25a3e4..55dc88939185 100644
--- a/security/keys/user_defined.c
+++ b/security/keys/user_defined.c
@@ -58,13 +58,14 @@ EXPORT_SYMBOL_GPL(key_type_logon);
58/* 58/*
59 * instantiate a user defined key 59 * instantiate a user defined key
60 */ 60 */
61int user_instantiate(struct key *key, const void *data, size_t datalen) 61int user_instantiate(struct key *key, struct key_preparsed_payload *prep)
62{ 62{
63 struct user_key_payload *upayload; 63 struct user_key_payload *upayload;
64 size_t datalen = prep->datalen;
64 int ret; 65 int ret;
65 66
66 ret = -EINVAL; 67 ret = -EINVAL;
67 if (datalen <= 0 || datalen > 32767 || !data) 68 if (datalen <= 0 || datalen > 32767 || !prep->data)
68 goto error; 69 goto error;
69 70
70 ret = key_payload_reserve(key, datalen); 71 ret = key_payload_reserve(key, datalen);
@@ -78,7 +79,7 @@ int user_instantiate(struct key *key, const void *data, size_t datalen)
78 79
79 /* attach the data */ 80 /* attach the data */
80 upayload->datalen = datalen; 81 upayload->datalen = datalen;
81 memcpy(upayload->data, data, datalen); 82 memcpy(upayload->data, prep->data, datalen);
82 rcu_assign_keypointer(key, upayload); 83 rcu_assign_keypointer(key, upayload);
83 ret = 0; 84 ret = 0;
84 85
@@ -92,13 +93,14 @@ EXPORT_SYMBOL_GPL(user_instantiate);
92 * update a user defined key 93 * update a user defined key
93 * - the key's semaphore is write-locked 94 * - the key's semaphore is write-locked
94 */ 95 */
95int user_update(struct key *key, const void *data, size_t datalen) 96int user_update(struct key *key, struct key_preparsed_payload *prep)
96{ 97{
97 struct user_key_payload *upayload, *zap; 98 struct user_key_payload *upayload, *zap;
99 size_t datalen = prep->datalen;
98 int ret; 100 int ret;
99 101
100 ret = -EINVAL; 102 ret = -EINVAL;
101 if (datalen <= 0 || datalen > 32767 || !data) 103 if (datalen <= 0 || datalen > 32767 || !prep->data)
102 goto error; 104 goto error;
103 105
104 /* construct a replacement payload */ 106 /* construct a replacement payload */
@@ -108,7 +110,7 @@ int user_update(struct key *key, const void *data, size_t datalen)
108 goto error; 110 goto error;
109 111
110 upayload->datalen = datalen; 112 upayload->datalen = datalen;
111 memcpy(upayload->data, data, datalen); 113 memcpy(upayload->data, prep->data, datalen);
112 114
113 /* check the quota and attach the new data */ 115 /* check the quota and attach the new data */
114 zap = upayload; 116 zap = upayload;
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 247264502fb7..f7c968ad5178 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -252,10 +252,10 @@ $(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
252 252
253LIB_FILE=$(OUTPUT)libperf.a 253LIB_FILE=$(OUTPUT)libperf.a
254 254
255LIB_H += ../../include/linux/perf_event.h 255LIB_H += ../../include/uapi/linux/perf_event.h
256LIB_H += ../../include/linux/rbtree.h 256LIB_H += ../../include/linux/rbtree.h
257LIB_H += ../../include/linux/list.h 257LIB_H += ../../include/linux/list.h
258LIB_H += ../../include/linux/const.h 258LIB_H += ../../include/uapi/linux/const.h
259LIB_H += ../../include/linux/hash.h 259LIB_H += ../../include/linux/hash.h
260LIB_H += ../../include/linux/stringify.h 260LIB_H += ../../include/linux/stringify.h
261LIB_H += util/include/linux/bitmap.h 261LIB_H += util/include/linux/bitmap.h
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index a89cbbb61801..276287783a03 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -112,7 +112,7 @@ void get_term_dimensions(struct winsize *ws);
112#include <sys/types.h> 112#include <sys/types.h>
113#include <sys/syscall.h> 113#include <sys/syscall.h>
114 114
115#include "../../include/linux/perf_event.h" 115#include "../../include/uapi/linux/perf_event.h"
116#include "util/types.h" 116#include "util/types.h"
117#include <stdbool.h> 117#include <stdbool.h>
118 118
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index ffdd94e9c9c3..618d41140abd 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -19,7 +19,7 @@
19#include "thread_map.h" 19#include "thread_map.h"
20#include "target.h" 20#include "target.h"
21#include "../../../include/linux/hw_breakpoint.h" 21#include "../../../include/linux/hw_breakpoint.h"
22#include "../../include/linux/perf_event.h" 22#include "../../../include/uapi/linux/perf_event.h"
23#include "perf_regs.h" 23#include "perf_regs.h"
24 24
25#define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y)) 25#define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y))
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 3ead0d59c03d..6f94d6dea00f 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/list.h> 4#include <linux/list.h>
5#include <stdbool.h> 5#include <stdbool.h>
6#include "../../../include/linux/perf_event.h" 6#include "../../../include/uapi/linux/perf_event.h"
7#include "types.h" 7#include "types.h"
8#include "xyarray.h" 8#include "xyarray.h"
9#include "cgroup.h" 9#include "cgroup.h"
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index 99bdd3abce59..879d215cdac9 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -1,7 +1,7 @@
1#ifndef __PERF_HEADER_H 1#ifndef __PERF_HEADER_H
2#define __PERF_HEADER_H 2#define __PERF_HEADER_H
3 3
4#include "../../../include/linux/perf_event.h" 4#include "../../../include/uapi/linux/perf_event.h"
5#include <sys/types.h> 5#include <sys/types.h>
6#include <stdbool.h> 6#include <stdbool.h>
7#include "types.h" 7#include "types.h"
diff --git a/tools/perf/util/include/asm/byteorder.h b/tools/perf/util/include/asm/byteorder.h
index b722abe3a626..2a9bdc066307 100644
--- a/tools/perf/util/include/asm/byteorder.h
+++ b/tools/perf/util/include/asm/byteorder.h
@@ -1,2 +1,2 @@
1#include <asm/types.h> 1#include <asm/types.h>
2#include "../../../../include/linux/swab.h" 2#include "../../../../include/uapi/linux/swab.h"
diff --git a/tools/perf/util/include/linux/const.h b/tools/perf/util/include/linux/const.h
index 1b476c9ae649..c10a35e1afb8 100644
--- a/tools/perf/util/include/linux/const.h
+++ b/tools/perf/util/include/linux/const.h
@@ -1 +1 @@
#include "../../../../include/linux/const.h" #include "../../../../include/uapi/linux/const.h"
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index c356e443448d..839230ceb18b 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -7,7 +7,7 @@
7#include <linux/list.h> 7#include <linux/list.h>
8#include <stdbool.h> 8#include <stdbool.h>
9#include "types.h" 9#include "types.h"
10#include "../../../include/linux/perf_event.h" 10#include "../../../include/uapi/linux/perf_event.h"
11#include "types.h" 11#include "types.h"
12 12
13struct list_head; 13struct list_head;
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 53c7794fc4be..39f3abac7744 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -2,7 +2,7 @@
2#define __PMU_H 2#define __PMU_H
3 3
4#include <linux/bitops.h> 4#include <linux/bitops.h>
5#include "../../../include/linux/perf_event.h" 5#include "../../../include/uapi/linux/perf_event.h"
6 6
7enum { 7enum {
8 PERF_PMU_FORMAT_VALUE_CONFIG, 8 PERF_PMU_FORMAT_VALUE_CONFIG,
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index aab414fbb64b..dd6426163ba6 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -7,7 +7,7 @@
7#include "symbol.h" 7#include "symbol.h"
8#include "thread.h" 8#include "thread.h"
9#include <linux/rbtree.h> 9#include <linux/rbtree.h>
10#include "../../../include/linux/perf_event.h" 10#include "../../../include/uapi/linux/perf_event.h"
11 11
12struct sample_queue; 12struct sample_queue;
13struct ip_callchain; 13struct ip_callchain;