diff options
Diffstat (limited to 'arch')
1036 files changed, 11042 insertions, 7951 deletions
diff --git a/arch/Kconfig b/arch/Kconfig index 54ffd0f9df2..7f8f281f258 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -113,6 +113,25 @@ config HAVE_EFFICIENT_UNALIGNED_ACCESS  	  See Documentation/unaligned-memory-access.txt for more  	  information on the topic of unaligned memory accesses. +config ARCH_USE_BUILTIN_BSWAP +       bool +       help +	 Modern versions of GCC (since 4.4) have builtin functions +	 for handling byte-swapping. Using these, instead of the old +	 inline assembler that the architecture code provides in the +	 __arch_bswapXX() macros, allows the compiler to see what's +	 happening and offers more opportunity for optimisation. In +	 particular, the compiler will be able to combine the byteswap +	 with a nearby load or store and use load-and-swap or +	 store-and-swap instructions if the architecture has them. It +	 should almost *never* result in code which is worse than the +	 hand-coded assembler in <asm/swab.h>.  But just in case it +	 does, the use of the builtins is optional. + +	 Any architecture with load-and-swap or store-and-swap +	 instructions should set this. And it shouldn't hurt to set it +	 on architectures that don't have such instructions. +  config HAVE_SYSCALL_WRAPPERS  	bool @@ -272,12 +291,6 @@ config ARCH_WANT_OLD_COMPAT_IPC  	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION  	bool -config GENERIC_KERNEL_THREAD -	bool - -config GENERIC_KERNEL_EXECVE -	bool -  config HAVE_ARCH_SECCOMP_FILTER  	bool  	help @@ -343,6 +356,9 @@ config MODULES_USE_ELF_REL  	  Modules only use ELF REL relocations.  Modules with ELF RELA  	  relocations will give an error. +config GENERIC_SIGALTSTACK +	bool +  #  # ABI hall of shame  # diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 5dd7f5db24d..9d5904cc771 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -20,10 +20,9 @@ config ALPHA  	select GENERIC_CMOS_UPDATE  	select GENERIC_STRNCPY_FROM_USER  	select GENERIC_STRNLEN_USER -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	select HAVE_MOD_ARCH_SPECIFIC  	select MODULES_USE_ELF_RELA +	select GENERIC_SIGALTSTACK  	help  	  The Alpha is a 64-bit general-purpose processor designed and  	  marketed by the Digital Equipment Corporation of blessed memory, diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild index dcfabb9f05a..a6e85f448c1 100644 --- a/arch/alpha/include/asm/Kbuild +++ b/arch/alpha/include/asm/Kbuild @@ -1,14 +1,5 @@ -include include/asm-generic/Kbuild.asm  generic-y += clkdev.h -header-y += compiler.h -header-y += console.h -header-y += fpu.h -header-y += gentrap.h -header-y += pal.h -header-y += reg.h -header-y += regdef.h -header-y += sysinfo.h  generic-y += exec.h  generic-y += trace_clock.h diff --git a/arch/alpha/include/asm/a.out.h b/arch/alpha/include/asm/a.out.h index acdc681231c..9abbd245530 100644 --- a/arch/alpha/include/asm/a.out.h +++ b/arch/alpha/include/asm/a.out.h @@ -1,94 +1,8 @@  #ifndef __ALPHA_A_OUT_H__  #define __ALPHA_A_OUT_H__ -#include <linux/types.h> +#include <uapi/asm/a.out.h> -/* - * OSF/1 ECOFF header structs.  ECOFF files consist of: - * 	- a file header (struct filehdr), - *	- an a.out header (struct aouthdr), - *	- one or more section headers (struct scnhdr).  - *	  The filhdr's "f_nscns" field contains the - *	  number of section headers. - */ - -struct filehdr -{ -	/* OSF/1 "file" header */ -	__u16 f_magic, f_nscns; -	__u32 f_timdat; -	__u64 f_symptr; -	__u32 f_nsyms; -	__u16 f_opthdr, f_flags; -}; - -struct aouthdr -{ -	__u64 info;		/* after that it looks quite normal.. */ -	__u64 tsize; -	__u64 dsize; -	__u64 bsize; -	__u64 entry; -	__u64 text_start;	/* with a few additions that actually make sense */ -	__u64 data_start; -	__u64 bss_start; -	__u32 gprmask, fprmask;	/* bitmask of general & floating point regs used in binary */ -	__u64 gpvalue; -}; - -struct scnhdr -{ -	char	s_name[8]; -	__u64	s_paddr; -	__u64	s_vaddr; -	__u64	s_size; -	__u64	s_scnptr; -	__u64	s_relptr; -	__u64	s_lnnoptr; -	__u16	s_nreloc; -	__u16	s_nlnno; -	__u32	s_flags; -}; - -struct exec -{ -	/* OSF/1 "file" header */ -	struct filehdr		fh; -	struct aouthdr		ah; -}; - -/* - * Define's so that the kernel exec code can access the a.out header - * fields... - */ -#define	a_info		ah.info -#define	a_text		ah.tsize -#define a_data		ah.dsize -#define a_bss		ah.bsize -#define a_entry		ah.entry -#define a_textstart	ah.text_start -#define	a_datastart	ah.data_start -#define	a_bssstart	ah.bss_start -#define	a_gprmask	ah.gprmask -#define a_fprmask	ah.fprmask -#define a_gpvalue	ah.gpvalue - -#define N_TXTADDR(x) ((x).a_textstart) -#define N_DATADDR(x) ((x).a_datastart) -#define N_BSSADDR(x) ((x).a_bssstart) -#define N_DRSIZE(x) 0 -#define N_TRSIZE(x) 0 -#define N_SYMSIZE(x) 0 - -#define AOUTHSZ		sizeof(struct aouthdr) -#define SCNHSZ		sizeof(struct scnhdr) -#define SCNROUND	16 - -#define N_TXTOFF(x) \ -  ((long) N_MAGIC(x) == ZMAGIC ? 0 : \ -   (sizeof(struct exec) + (x).fh.f_nscns*SCNHSZ + SCNROUND - 1) & ~(SCNROUND - 1)) - -#ifdef __KERNEL__  /* Assume that start addresses below 4G belong to a TASO application.     Unfortunately, there is no proper bit in the exec header to check. @@ -98,5 +12,4 @@ struct exec  	set_personality (((BFPM->taso || EX.ah.entry < 0x100000000L \  			   ? ADDR_LIMIT_32BIT : 0) | PER_OSF4)) -#endif /* __KERNEL__ */  #endif /* __A_OUT_GNU_H__ */ diff --git a/arch/alpha/include/asm/compiler.h b/arch/alpha/include/asm/compiler.h index da6bb199839..a7720b96bcc 100644 --- a/arch/alpha/include/asm/compiler.h +++ b/arch/alpha/include/asm/compiler.h @@ -1,119 +1,8 @@  #ifndef __ALPHA_COMPILER_H  #define __ALPHA_COMPILER_H -/*  - * Herein are macros we use when describing various patterns we want to GCC. - * In all cases we can get better schedules out of the compiler if we hide - * as little as possible inside inline assembly.  However, we want to be - * able to know what we'll get out before giving up inline assembly.  Thus - * these tests and macros. - */ +#include <uapi/asm/compiler.h> -#if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 -# define __kernel_insbl(val, shift)	__builtin_alpha_insbl(val, shift) -# define __kernel_inswl(val, shift)	__builtin_alpha_inswl(val, shift) -# define __kernel_insql(val, shift)	__builtin_alpha_insql(val, shift) -# define __kernel_inslh(val, shift)	__builtin_alpha_inslh(val, shift) -# define __kernel_extbl(val, shift)	__builtin_alpha_extbl(val, shift) -# define __kernel_extwl(val, shift)	__builtin_alpha_extwl(val, shift) -# define __kernel_cmpbge(a, b)		__builtin_alpha_cmpbge(a, b) -#else -# define __kernel_insbl(val, shift)					\ -  ({ unsigned long __kir;						\ -     __asm__("insbl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ -     __kir; }) -# define __kernel_inswl(val, shift)					\ -  ({ unsigned long __kir;						\ -     __asm__("inswl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ -     __kir; }) -# define __kernel_insql(val, shift)					\ -  ({ unsigned long __kir;						\ -     __asm__("insql %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ -     __kir; }) -# define __kernel_inslh(val, shift)					\ -  ({ unsigned long __kir;						\ -     __asm__("inslh %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ -     __kir; }) -# define __kernel_extbl(val, shift)					\ -  ({ unsigned long __kir;						\ -     __asm__("extbl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ -     __kir; }) -# define __kernel_extwl(val, shift)					\ -  ({ unsigned long __kir;						\ -     __asm__("extwl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ -     __kir; }) -# define __kernel_cmpbge(a, b)						\ -  ({ unsigned long __kir;						\ -     __asm__("cmpbge %r2,%1,%0" : "=r"(__kir) : "rI"(b), "rJ"(a));	\ -     __kir; }) -#endif - -#ifdef __alpha_cix__ -# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 -#  define __kernel_cttz(x)		__builtin_ctzl(x) -#  define __kernel_ctlz(x)		__builtin_clzl(x) -#  define __kernel_ctpop(x)		__builtin_popcountl(x) -# else -#  define __kernel_cttz(x)						\ -   ({ unsigned long __kir;						\ -      __asm__("cttz %1,%0" : "=r"(__kir) : "r"(x));			\ -      __kir; }) -#  define __kernel_ctlz(x)						\ -   ({ unsigned long __kir;						\ -      __asm__("ctlz %1,%0" : "=r"(__kir) : "r"(x));			\ -      __kir; }) -#  define __kernel_ctpop(x)						\ -   ({ unsigned long __kir;						\ -      __asm__("ctpop %1,%0" : "=r"(__kir) : "r"(x));			\ -      __kir; }) -# endif -#else -# define __kernel_cttz(x)						\ -  ({ unsigned long __kir;						\ -     __asm__(".arch ev67; cttz %1,%0" : "=r"(__kir) : "r"(x));		\ -     __kir; }) -# define __kernel_ctlz(x)						\ -  ({ unsigned long __kir;						\ -     __asm__(".arch ev67; ctlz %1,%0" : "=r"(__kir) : "r"(x));		\ -     __kir; }) -# define __kernel_ctpop(x)						\ -  ({ unsigned long __kir;						\ -     __asm__(".arch ev67; ctpop %1,%0" : "=r"(__kir) : "r"(x));		\ -     __kir; }) -#endif - - -/*  - * Beginning with EGCS 1.1, GCC defines __alpha_bwx__ when the BWX  - * extension is enabled.  Previous versions did not define anything - * we could test during compilation -- too bad, so sad. - */ - -#if defined(__alpha_bwx__) -#define __kernel_ldbu(mem)	(mem) -#define __kernel_ldwu(mem)	(mem) -#define __kernel_stb(val,mem)	((mem) = (val)) -#define __kernel_stw(val,mem)	((mem) = (val)) -#else -#define __kernel_ldbu(mem)				\ -  ({ unsigned char __kir;				\ -     __asm__(".arch ev56;				\ -	      ldbu %0,%1" : "=r"(__kir) : "m"(mem));	\ -     __kir; }) -#define __kernel_ldwu(mem)				\ -  ({ unsigned short __kir;				\ -     __asm__(".arch ev56;				\ -	      ldwu %0,%1" : "=r"(__kir) : "m"(mem));	\ -     __kir; }) -#define __kernel_stb(val,mem)				\ -  __asm__(".arch ev56;					\ -	   stb %1,%0" : "=m"(mem) : "r"(val)) -#define __kernel_stw(val,mem)				\ -  __asm__(".arch ev56;					\ -	   stw %1,%0" : "=m"(mem) : "r"(val)) -#endif - -#ifdef __KERNEL__  /* Some idiots over in <linux/compiler.h> thought inline should imply     always_inline.  This breaks stuff.  We'll include this file whenever     we run into such problems.  */ @@ -125,6 +14,4 @@  #undef __always_inline  #define __always_inline		inline __attribute__((always_inline)) -#endif /* __KERNEL__ */ -  #endif /* __ALPHA_COMPILER_H */ diff --git a/arch/alpha/include/asm/console.h b/arch/alpha/include/asm/console.h index a3ce4e62249..f2b584fe099 100644 --- a/arch/alpha/include/asm/console.h +++ b/arch/alpha/include/asm/console.h @@ -1,52 +1,8 @@  #ifndef __AXP_CONSOLE_H  #define __AXP_CONSOLE_H -/* - * Console callback routine numbers - */ -#define CCB_GETC		0x01 -#define CCB_PUTS		0x02 -#define CCB_RESET_TERM		0x03 -#define CCB_SET_TERM_INT	0x04 -#define CCB_SET_TERM_CTL	0x05 -#define CCB_PROCESS_KEYCODE	0x06 -#define CCB_OPEN_CONSOLE	0x07 -#define CCB_CLOSE_CONSOLE	0x08 +#include <uapi/asm/console.h> -#define CCB_OPEN		0x10 -#define CCB_CLOSE		0x11 -#define CCB_IOCTL		0x12 -#define CCB_READ		0x13 -#define CCB_WRITE		0x14 - -#define CCB_SET_ENV		0x20 -#define CCB_RESET_ENV		0x21 -#define CCB_GET_ENV		0x22 -#define CCB_SAVE_ENV		0x23 - -#define CCB_PSWITCH		0x30 -#define CCB_BIOS_EMUL		0x32 - -/* - * Environment variable numbers - */ -#define ENV_AUTO_ACTION		0x01 -#define ENV_BOOT_DEV		0x02 -#define ENV_BOOTDEF_DEV		0x03 -#define ENV_BOOTED_DEV		0x04 -#define ENV_BOOT_FILE		0x05 -#define ENV_BOOTED_FILE		0x06 -#define ENV_BOOT_OSFLAGS	0x07 -#define ENV_BOOTED_OSFLAGS	0x08 -#define ENV_BOOT_RESET		0x09 -#define ENV_DUMP_DEV		0x0A -#define ENV_ENABLE_AUDIT	0x0B -#define ENV_LICENSE		0x0C -#define ENV_CHAR_SET		0x0D -#define ENV_LANGUAGE		0x0E -#define ENV_TTY_DEV		0x0F - -#ifdef __KERNEL__  #ifndef __ASSEMBLY__  extern long callback_puts(long unit, const char *s, long length);  extern long callback_getc(long unit); @@ -70,6 +26,4 @@ struct hwrpb_struct;  extern int callback_init_done;  extern void * callback_init(void *);  #endif /* __ASSEMBLY__ */ -#endif /* __KERNEL__ */ -  #endif /* __AXP_CONSOLE_H */ diff --git a/arch/alpha/include/asm/fpu.h b/arch/alpha/include/asm/fpu.h index e477bcd5b94..71c20956b90 100644 --- a/arch/alpha/include/asm/fpu.h +++ b/arch/alpha/include/asm/fpu.h @@ -1,128 +1,8 @@  #ifndef __ASM_ALPHA_FPU_H  #define __ASM_ALPHA_FPU_H -#ifdef __KERNEL__  #include <asm/special_insns.h> -#endif - -/* - * Alpha floating-point control register defines: - */ -#define FPCR_DNOD	(1UL<<47)	/* denorm INV trap disable */ -#define FPCR_DNZ	(1UL<<48)	/* denorms to zero */ -#define FPCR_INVD	(1UL<<49)	/* invalid op disable (opt.) */ -#define FPCR_DZED	(1UL<<50)	/* division by zero disable (opt.) */ -#define FPCR_OVFD	(1UL<<51)	/* overflow disable (optional) */ -#define FPCR_INV	(1UL<<52)	/* invalid operation */ -#define FPCR_DZE	(1UL<<53)	/* division by zero */ -#define FPCR_OVF	(1UL<<54)	/* overflow */ -#define FPCR_UNF	(1UL<<55)	/* underflow */ -#define FPCR_INE	(1UL<<56)	/* inexact */ -#define FPCR_IOV	(1UL<<57)	/* integer overflow */ -#define FPCR_UNDZ	(1UL<<60)	/* underflow to zero (opt.) */ -#define FPCR_UNFD	(1UL<<61)	/* underflow disable (opt.) */ -#define FPCR_INED	(1UL<<62)	/* inexact disable (opt.) */ -#define FPCR_SUM	(1UL<<63)	/* summary bit */ - -#define FPCR_DYN_SHIFT	58		/* first dynamic rounding mode bit */ -#define FPCR_DYN_CHOPPED (0x0UL << FPCR_DYN_SHIFT)	/* towards 0 */ -#define FPCR_DYN_MINUS	 (0x1UL << FPCR_DYN_SHIFT)	/* towards -INF */ -#define FPCR_DYN_NORMAL	 (0x2UL << FPCR_DYN_SHIFT)	/* towards nearest */ -#define FPCR_DYN_PLUS	 (0x3UL << FPCR_DYN_SHIFT)	/* towards +INF */ -#define FPCR_DYN_MASK	 (0x3UL << FPCR_DYN_SHIFT) - -#define FPCR_MASK	0xffff800000000000L - -/* - * IEEE trap enables are implemented in software.  These per-thread - * bits are stored in the "ieee_state" field of "struct thread_info". - * Thus, the bits are defined so as not to conflict with the - * floating-point enable bit (which is architected).  On top of that, - * we want to make these bits compatible with OSF/1 so - * ieee_set_fp_control() etc. can be implemented easily and - * compatibly.  The corresponding definitions are in - * /usr/include/machine/fpu.h under OSF/1. - */ -#define IEEE_TRAP_ENABLE_INV	(1UL<<1)	/* invalid op */ -#define IEEE_TRAP_ENABLE_DZE	(1UL<<2)	/* division by zero */ -#define IEEE_TRAP_ENABLE_OVF	(1UL<<3)	/* overflow */ -#define IEEE_TRAP_ENABLE_UNF	(1UL<<4)	/* underflow */ -#define IEEE_TRAP_ENABLE_INE	(1UL<<5)	/* inexact */ -#define IEEE_TRAP_ENABLE_DNO	(1UL<<6)	/* denorm */ -#define IEEE_TRAP_ENABLE_MASK	(IEEE_TRAP_ENABLE_INV | IEEE_TRAP_ENABLE_DZE |\ -				 IEEE_TRAP_ENABLE_OVF | IEEE_TRAP_ENABLE_UNF |\ -				 IEEE_TRAP_ENABLE_INE | IEEE_TRAP_ENABLE_DNO) - -/* Denorm and Underflow flushing */ -#define IEEE_MAP_DMZ		(1UL<<12)	/* Map denorm inputs to zero */ -#define IEEE_MAP_UMZ		(1UL<<13)	/* Map underflowed outputs to zero */ - -#define IEEE_MAP_MASK		(IEEE_MAP_DMZ | IEEE_MAP_UMZ) - -/* status bits coming from fpcr: */ -#define IEEE_STATUS_INV		(1UL<<17) -#define IEEE_STATUS_DZE		(1UL<<18) -#define IEEE_STATUS_OVF		(1UL<<19) -#define IEEE_STATUS_UNF		(1UL<<20) -#define IEEE_STATUS_INE		(1UL<<21) -#define IEEE_STATUS_DNO		(1UL<<22) - -#define IEEE_STATUS_MASK	(IEEE_STATUS_INV | IEEE_STATUS_DZE |	\ -				 IEEE_STATUS_OVF | IEEE_STATUS_UNF |	\ -				 IEEE_STATUS_INE | IEEE_STATUS_DNO) - -#define IEEE_SW_MASK		(IEEE_TRAP_ENABLE_MASK |		\ -				 IEEE_STATUS_MASK | IEEE_MAP_MASK) - -#define IEEE_CURRENT_RM_SHIFT	32 -#define IEEE_CURRENT_RM_MASK	(3UL<<IEEE_CURRENT_RM_SHIFT) - -#define IEEE_STATUS_TO_EXCSUM_SHIFT	16 - -#define IEEE_INHERIT    (1UL<<63)	/* inherit on thread create? */ - -/* - * Convert the software IEEE trap enable and status bits into the - * hardware fpcr format.  - * - * Digital Unix engineers receive my thanks for not defining the - * software bits identical to the hardware bits.  The chip designers - * receive my thanks for making all the not-implemented fpcr bits - * RAZ forcing us to use system calls to read/write this value. - */ - -static inline unsigned long -ieee_swcr_to_fpcr(unsigned long sw) -{ -	unsigned long fp; -	fp = (sw & IEEE_STATUS_MASK) << 35; -	fp |= (sw & IEEE_MAP_DMZ) << 36; -	fp |= (sw & IEEE_STATUS_MASK ? FPCR_SUM : 0); -	fp |= (~sw & (IEEE_TRAP_ENABLE_INV -		      | IEEE_TRAP_ENABLE_DZE -		      | IEEE_TRAP_ENABLE_OVF)) << 48; -	fp |= (~sw & (IEEE_TRAP_ENABLE_UNF | IEEE_TRAP_ENABLE_INE)) << 57; -	fp |= (sw & IEEE_MAP_UMZ ? FPCR_UNDZ | FPCR_UNFD : 0); -	fp |= (~sw & IEEE_TRAP_ENABLE_DNO) << 41; -	return fp; -} - -static inline unsigned long -ieee_fpcr_to_swcr(unsigned long fp) -{ -	unsigned long sw; -	sw = (fp >> 35) & IEEE_STATUS_MASK; -	sw |= (fp >> 36) & IEEE_MAP_DMZ; -	sw |= (~fp >> 48) & (IEEE_TRAP_ENABLE_INV -			     | IEEE_TRAP_ENABLE_DZE -			     | IEEE_TRAP_ENABLE_OVF); -	sw |= (~fp >> 57) & (IEEE_TRAP_ENABLE_UNF | IEEE_TRAP_ENABLE_INE); -	sw |= (fp >> 47) & IEEE_MAP_UMZ; -	sw |= (~fp >> 41) & IEEE_TRAP_ENABLE_DNO; -	return sw; -} - -#ifdef __KERNEL__ +#include <uapi/asm/fpu.h>  /* The following two functions don't need trapb/excb instructions     around the mf_fpcr/mt_fpcr instructions because (a) the kernel @@ -192,6 +72,4 @@ extern void alpha_write_fp_reg (unsigned long reg, unsigned long val);  extern unsigned long alpha_read_fp_reg_s (unsigned long reg);  extern void alpha_write_fp_reg_s (unsigned long reg, unsigned long val); -#endif /* __KERNEL__ */ -  #endif /* __ASM_ALPHA_FPU_H */ diff --git a/arch/alpha/include/asm/pal.h b/arch/alpha/include/asm/pal.h index 6699ee58342..6fcd2b5b08f 100644 --- a/arch/alpha/include/asm/pal.h +++ b/arch/alpha/include/asm/pal.h @@ -1,54 +1,8 @@  #ifndef __ALPHA_PAL_H  #define __ALPHA_PAL_H -/* - * Common PAL-code - */ -#define PAL_halt	  0 -#define PAL_cflush	  1 -#define PAL_draina	  2 -#define PAL_bpt		128 -#define PAL_bugchk	129 -#define PAL_chmk	131 -#define PAL_callsys	131 -#define PAL_imb		134 -#define PAL_rduniq	158 -#define PAL_wruniq	159 -#define PAL_gentrap	170 -#define PAL_nphalt	190 - -/* - * VMS specific PAL-code - */ -#define PAL_swppal	10 -#define PAL_mfpr_vptb	41 +#include <uapi/asm/pal.h> -/* - * OSF specific PAL-code - */ -#define PAL_cserve	 9 -#define PAL_wripir	13 -#define PAL_rdmces	16 -#define PAL_wrmces	17 -#define PAL_wrfen	43 -#define PAL_wrvptptr	45 -#define PAL_jtopal	46 -#define PAL_swpctx	48 -#define PAL_wrval	49 -#define PAL_rdval	50 -#define PAL_tbi		51 -#define PAL_wrent	52 -#define PAL_swpipl	53 -#define PAL_rdps	54 -#define PAL_wrkgp	55 -#define PAL_wrusp	56 -#define PAL_wrperfmon	57 -#define PAL_rdusp	58 -#define PAL_whami	60 -#define PAL_retsys	61 -#define PAL_rti		63 - -#ifdef __KERNEL__  #ifndef __ASSEMBLY__  extern void halt(void) __attribute__((noreturn)); @@ -158,6 +112,4 @@ __CALL_PAL_W1(wrvptptr, unsigned long);  #define tbia()		__tbi(-2, /* no second argument */)  #endif /* !__ASSEMBLY__ */ -#endif /* __KERNEL__ */ -  #endif /* __ALPHA_PAL_H */ diff --git a/arch/alpha/include/asm/param.h b/arch/alpha/include/asm/param.h index e691ecfedb2..bf46af51941 100644 --- a/arch/alpha/include/asm/param.h +++ b/arch/alpha/include/asm/param.h @@ -1,27 +1,9 @@  #ifndef _ASM_ALPHA_PARAM_H  #define _ASM_ALPHA_PARAM_H -/* ??? Gross.  I don't want to parameterize this, and supposedly the -   hardware ignores reprogramming.  We also need userland buy-in to the  -   change in HZ, since this is visible in the wait4 resources etc.  */ +#include <uapi/asm/param.h> -#ifdef __KERNEL__  #define HZ		CONFIG_HZ  #define USER_HZ		HZ -#else -#define HZ		1024 -#endif - -#define EXEC_PAGESIZE	8192 - -#ifndef NOGROUP -#define NOGROUP		(-1) -#endif - -#define MAXHOSTNAMELEN	64	/* max length of hostname */ - -#ifdef __KERNEL__  # define CLOCKS_PER_SEC	HZ	/* frequency at which times() counts */ -#endif -  #endif /* _ASM_ALPHA_PARAM_H */ diff --git a/arch/alpha/include/asm/parport.h b/arch/alpha/include/asm/parport.h index c5ee7cbb2fc..6abd0af11f1 100644 --- a/arch/alpha/include/asm/parport.h +++ b/arch/alpha/include/asm/parport.h @@ -9,8 +9,8 @@  #ifndef _ASM_AXP_PARPORT_H  #define _ASM_AXP_PARPORT_H 1 -static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); -static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) +static int parport_pc_find_isa_ports (int autoirq, int autodma); +static int parport_pc_find_nonpci_ports (int autoirq, int autodma)  {  	return parport_pc_find_isa_ports (autoirq, autodma);  } diff --git a/arch/alpha/include/asm/ptrace.h b/arch/alpha/include/asm/ptrace.h index b4c5b2fbb64..21128505ddb 100644 --- a/arch/alpha/include/asm/ptrace.h +++ b/arch/alpha/include/asm/ptrace.h @@ -1,77 +1,14 @@  #ifndef _ASMAXP_PTRACE_H  #define _ASMAXP_PTRACE_H +#include <uapi/asm/ptrace.h> -/* - * This struct defines the way the registers are stored on the - * kernel stack during a system call or other kernel entry - * - * NOTE! I want to minimize the overhead of system calls, so this - * struct has as little information as possible.  I does not have - * - *  - floating point regs: the kernel doesn't change those - *  - r9-15: saved by the C compiler - * - * This makes "fork()" and "exec()" a bit more complex, but should - * give us low system call latency. - */ - -struct pt_regs { -	unsigned long r0; -	unsigned long r1; -	unsigned long r2; -	unsigned long r3; -	unsigned long r4; -	unsigned long r5; -	unsigned long r6; -	unsigned long r7; -	unsigned long r8; -	unsigned long r19; -	unsigned long r20; -	unsigned long r21; -	unsigned long r22; -	unsigned long r23; -	unsigned long r24; -	unsigned long r25; -	unsigned long r26; -	unsigned long r27; -	unsigned long r28; -	unsigned long hae; -/* JRP - These are the values provided to a0-a2 by PALcode */ -	unsigned long trap_a0; -	unsigned long trap_a1; -	unsigned long trap_a2; -/* These are saved by PAL-code: */ -	unsigned long ps; -	unsigned long pc; -	unsigned long gp; -	unsigned long r16; -	unsigned long r17; -	unsigned long r18; -}; - -/* - * This is the extended stack used by signal handlers and the context - * switcher: it's pushed after the normal "struct pt_regs". - */ -struct switch_stack { -	unsigned long r9; -	unsigned long r10; -	unsigned long r11; -	unsigned long r12; -	unsigned long r13; -	unsigned long r14; -	unsigned long r15; -	unsigned long r26; -	unsigned long fp[32];	/* fp[31] is fpcr */ -}; - -#ifdef __KERNEL__  #define arch_has_single_step()		(1)  #define user_mode(regs) (((regs)->ps & 8) != 0)  #define instruction_pointer(regs) ((regs)->pc)  #define profile_pc(regs) instruction_pointer(regs) +#define current_user_stack_pointer() rdusp()  #define task_pt_regs(task) \    ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1) @@ -83,5 +20,3 @@ struct switch_stack {  #define force_successful_syscall_return() (current_pt_regs()->r0 = 0)  #endif - -#endif diff --git a/arch/alpha/include/asm/signal.h b/arch/alpha/include/asm/signal.h index 45552862cc1..8a1ac28cd56 100644 --- a/arch/alpha/include/asm/signal.h +++ b/arch/alpha/include/asm/signal.h @@ -1,12 +1,8 @@  #ifndef _ASMAXP_SIGNAL_H  #define _ASMAXP_SIGNAL_H -#include <linux/types.h> +#include <uapi/asm/signal.h> -/* Avoid too many header ordering problems.  */ -struct siginfo; - -#ifdef __KERNEL__  /* Digital Unix defines 64 signals.  Most things should be clean enough     to redefine this at will, if care is taken to make libc match.  */ @@ -20,100 +16,6 @@ typedef struct {  	unsigned long sig[_NSIG_WORDS];  } sigset_t; -#else -/* Here we must cater to libcs that poke about in kernel headers.  */ - -#define NSIG		32 -typedef unsigned long sigset_t; - -#endif /* __KERNEL__ */ - - -/* - * Linux/AXP has different signal numbers that Linux/i386: I'm trying - * to make it OSF/1 binary compatible, at least for normal binaries. - */ -#define SIGHUP		 1 -#define SIGINT		 2 -#define SIGQUIT		 3 -#define SIGILL		 4 -#define SIGTRAP		 5 -#define SIGABRT		 6 -#define SIGEMT		 7 -#define SIGFPE		 8 -#define SIGKILL		 9 -#define SIGBUS		10 -#define SIGSEGV		11 -#define SIGSYS		12 -#define SIGPIPE		13 -#define SIGALRM		14 -#define SIGTERM		15 -#define SIGURG		16 -#define SIGSTOP		17 -#define SIGTSTP		18 -#define SIGCONT		19 -#define SIGCHLD		20 -#define SIGTTIN		21 -#define SIGTTOU		22 -#define SIGIO		23 -#define SIGXCPU		24 -#define SIGXFSZ		25 -#define SIGVTALRM	26 -#define SIGPROF		27 -#define SIGWINCH	28 -#define SIGINFO		29 -#define SIGUSR1		30 -#define SIGUSR2		31 - -#define SIGPOLL	SIGIO -#define SIGPWR	SIGINFO -#define SIGIOT	SIGABRT - -/* These should not be considered constants from userland.  */ -#define SIGRTMIN	32 -#define SIGRTMAX	_NSIG - -/* - * SA_FLAGS values: - * - * SA_ONSTACK indicates that a registered stack_t will be used. - * SA_RESTART flag to get restarting signals (which were the default long ago) - * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. - * SA_RESETHAND clears the handler when the signal is delivered. - * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. - * SA_NODEFER prevents the current signal from being masked in the handler. - * - * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single - * Unix names RESETHAND and NODEFER respectively. - */ - -#define SA_ONSTACK	0x00000001 -#define SA_RESTART	0x00000002 -#define SA_NOCLDSTOP	0x00000004 -#define SA_NODEFER	0x00000008 -#define SA_RESETHAND	0x00000010 -#define SA_NOCLDWAIT	0x00000020 -#define SA_SIGINFO	0x00000040 - -#define SA_ONESHOT	SA_RESETHAND -#define SA_NOMASK	SA_NODEFER - -/*  - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 - -#define MINSIGSTKSZ	4096 -#define SIGSTKSZ	16384 - -#define SIG_BLOCK          1	/* for blocking signals */ -#define SIG_UNBLOCK        2	/* for unblocking signals */ -#define SIG_SETMASK        3	/* for setting the signal mask */ - -#include <asm-generic/signal-defs.h> - -#ifdef __KERNEL__  struct osf_sigaction {  	__sighandler_t	sa_handler;  	old_sigset_t	sa_mask; @@ -130,40 +32,5 @@ struct k_sigaction {  	struct sigaction sa;  	__sigrestore_t ka_restorer;  }; -#else -/* Here we must cater to libcs that poke about in kernel headers.  */ - -struct sigaction { -	union { -	  __sighandler_t	_sa_handler; -	  void (*_sa_sigaction)(int, struct siginfo *, void *); -	} _u; -	sigset_t	sa_mask; -	int		sa_flags; -}; - -#define sa_handler	_u._sa_handler -#define sa_sigaction	_u._sa_sigaction - -#endif /* __KERNEL__ */ - -typedef struct sigaltstack { -	void __user *ss_sp; -	int ss_flags; -	size_t ss_size; -} stack_t; - -/* sigstack(2) is deprecated, and will be withdrawn in a future version -   of the X/Open CAE Specification.  Use sigaltstack instead.  It is only -   implemented here for OSF/1 compatibility.  */ - -struct sigstack { -	void __user *ss_sp; -	int ss_onstack; -}; - -#ifdef __KERNEL__  #include <asm/sigcontext.h>  #endif - -#endif diff --git a/arch/alpha/include/asm/socket.h b/arch/alpha/include/asm/socket.h index 0087d053b77..8d806d80ed2 100644 --- a/arch/alpha/include/asm/socket.h +++ b/arch/alpha/include/asm/socket.h @@ -1,87 +1,10 @@  #ifndef _ASM_SOCKET_H  #define _ASM_SOCKET_H -#include <asm/sockios.h> +#include <uapi/asm/socket.h> -/* For setsockopt(2) */ -/* - * Note: we only bother about making the SOL_SOCKET options - * same as OSF/1, as that's all that "normal" programs are - * likely to set.  We don't necessarily want to be binary - * compatible with _everything_.  - */ -#define SOL_SOCKET	0xffff - -#define SO_DEBUG	0x0001 -#define SO_REUSEADDR	0x0004 -#define SO_KEEPALIVE	0x0008 -#define SO_DONTROUTE	0x0010 -#define SO_BROADCAST	0x0020 -#define SO_LINGER	0x0080 -#define SO_OOBINLINE	0x0100 -/* To add :#define SO_REUSEPORT 0x0200 */ - -#define SO_TYPE		0x1008 -#define SO_ERROR	0x1007 -#define SO_SNDBUF	0x1001 -#define SO_RCVBUF	0x1002 -#define SO_SNDBUFFORCE	0x100a -#define SO_RCVBUFFORCE	0x100b -#define	SO_RCVLOWAT	0x1010 -#define	SO_SNDLOWAT	0x1011 -#define	SO_RCVTIMEO	0x1012 -#define	SO_SNDTIMEO	0x1013 -#define SO_ACCEPTCONN	0x1014 -#define SO_PROTOCOL	0x1028 -#define SO_DOMAIN	0x1029 - -/* linux-specific, might as well be the same as on i386 */ -#define SO_NO_CHECK	11 -#define SO_PRIORITY	12 -#define SO_BSDCOMPAT	14 - -#define SO_PASSCRED	17 -#define SO_PEERCRED	18 -#define SO_BINDTODEVICE 25 - -/* Socket filtering */ -#define SO_ATTACH_FILTER        26 -#define SO_DETACH_FILTER        27 -#define SO_GET_FILTER		SO_ATTACH_FILTER - -#define SO_PEERNAME		28 -#define SO_TIMESTAMP		29 -#define SCM_TIMESTAMP		SO_TIMESTAMP - -#define SO_PEERSEC		30 -#define SO_PASSSEC		34 -#define SO_TIMESTAMPNS		35 -#define SCM_TIMESTAMPNS		SO_TIMESTAMPNS - -/* Security levels - as per NRL IPv6 - don't actually do anything */ -#define SO_SECURITY_AUTHENTICATION		19 -#define SO_SECURITY_ENCRYPTION_TRANSPORT	20 -#define SO_SECURITY_ENCRYPTION_NETWORK		21 - -#define SO_MARK			36 - -#define SO_TIMESTAMPING		37 -#define SCM_TIMESTAMPING	SO_TIMESTAMPING - -#define SO_RXQ_OVFL             40 - -#define SO_WIFI_STATUS		41 -#define SCM_WIFI_STATUS		SO_WIFI_STATUS -#define SO_PEEK_OFF		42 - -/* Instruct lower device to use last 4-bytes of skb data as FCS */ -#define SO_NOFCS		43 - -#ifdef __KERNEL__  /* O_NONBLOCK clashes with the bits used for socket types.  Therefore we   * have to define SOCK_NONBLOCK to a different value here.   */  #define SOCK_NONBLOCK	0x40000000 -#endif /* __KERNEL__ */ -  #endif /* _ASM_SOCKET_H */ diff --git a/arch/alpha/include/asm/termios.h b/arch/alpha/include/asm/termios.h index fa13716a11c..7fde0f88da8 100644 --- a/arch/alpha/include/asm/termios.h +++ b/arch/alpha/include/asm/termios.h @@ -1,72 +1,8 @@  #ifndef _ALPHA_TERMIOS_H  #define _ALPHA_TERMIOS_H -#include <asm/ioctls.h> -#include <asm/termbits.h> +#include <uapi/asm/termios.h> -struct sgttyb { -	char	sg_ispeed; -	char	sg_ospeed; -	char	sg_erase; -	char	sg_kill; -	short	sg_flags; -}; - -struct tchars { -	char	t_intrc; -	char	t_quitc; -	char	t_startc; -	char	t_stopc; -	char	t_eofc; -	char	t_brkc; -}; - -struct ltchars { -	char	t_suspc; -	char	t_dsuspc; -	char	t_rprntc; -	char	t_flushc; -	char	t_werasc; -	char	t_lnextc; -}; - -struct winsize { -	unsigned short ws_row; -	unsigned short ws_col; -	unsigned short ws_xpixel; -	unsigned short ws_ypixel; -}; - -#define NCC 8 -struct termio { -	unsigned short c_iflag;		/* input mode flags */ -	unsigned short c_oflag;		/* output mode flags */ -	unsigned short c_cflag;		/* control mode flags */ -	unsigned short c_lflag;		/* local mode flags */ -	unsigned char c_line;		/* line discipline */ -	unsigned char c_cc[NCC];	/* control characters */ -}; - -/* - * c_cc characters in the termio structure.  Oh, how I love being - * backwardly compatible.  Notice that character 4 and 5 are - * interpreted differently depending on whether ICANON is set in - * c_lflag.  If it's set, they are used as _VEOF and _VEOL, otherwise - * as _VMIN and V_TIME.  This is for compatibility with OSF/1 (which - * is compatible with sysV)... - */ -#define _VINTR	0 -#define _VQUIT	1 -#define _VERASE	2 -#define _VKILL	3 -#define _VEOF	4 -#define _VMIN	4 -#define _VEOL	5 -#define _VTIME	5 -#define _VEOL2	6 -#define _VSWTC	7 - -#ifdef __KERNEL__  /*	eof=^D		eol=\0		eol2=\0		erase=del  	werase=^W	kill=^U		reprint=^R	sxtc=\0  	intr=^C		quit=^\		susp=^Z		<OSF/1 VDSUSP> @@ -141,6 +77,4 @@ struct termio {  #define kernel_termios_to_user_termios(u, k) \  	copy_to_user(u, k, sizeof(struct termios)) -#endif	/* __KERNEL__ */ -  #endif	/* _ALPHA_TERMIOS_H */ diff --git a/arch/alpha/include/asm/types.h b/arch/alpha/include/asm/types.h index 0a0579076f4..f61e1a56c37 100644 --- a/arch/alpha/include/asm/types.h +++ b/arch/alpha/include/asm/types.h @@ -1,18 +1,7 @@  #ifndef _ALPHA_TYPES_H  #define _ALPHA_TYPES_H -/* - * This file is never included by application software unless - * explicitly requested (e.g., via linux/types.h) in which case the - * application is Linux specific so (user-) name space pollution is - * not a major issue.  However, for interoperability, libraries still - * need to be careful to avoid a name clashes. - */ - -#ifdef __KERNEL__  #include <asm-generic/int-ll64.h> -#else -#include <asm-generic/int-l64.h> -#endif +#include <uapi/asm/types.h>  #endif /* _ALPHA_TYPES_H */ diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h index eb3a4664ced..b3396ee039b 100644 --- a/arch/alpha/include/asm/unistd.h +++ b/arch/alpha/include/asm/unistd.h @@ -1,474 +1,8 @@  #ifndef _ALPHA_UNISTD_H  #define _ALPHA_UNISTD_H -#define __NR_osf_syscall	  0	/* not implemented */ -#define __NR_exit		  1 -#define __NR_fork		  2 -#define __NR_read		  3 -#define __NR_write		  4 -#define __NR_osf_old_open	  5	/* not implemented */ -#define __NR_close		  6 -#define __NR_osf_wait4		  7 -#define __NR_osf_old_creat	  8	/* not implemented */ -#define __NR_link		  9 -#define __NR_unlink		 10 -#define __NR_osf_execve		 11	/* not implemented */ -#define __NR_chdir		 12 -#define __NR_fchdir		 13 -#define __NR_mknod		 14 -#define __NR_chmod		 15 -#define __NR_chown		 16 -#define __NR_brk		 17 -#define __NR_osf_getfsstat	 18	/* not implemented */ -#define __NR_lseek		 19 -#define __NR_getxpid		 20 -#define __NR_osf_mount		 21 -#define __NR_umount		 22 -#define __NR_setuid		 23 -#define __NR_getxuid		 24 -#define __NR_exec_with_loader	 25	/* not implemented */ -#define __NR_ptrace		 26 -#define __NR_osf_nrecvmsg	 27	/* not implemented */ -#define __NR_osf_nsendmsg	 28	/* not implemented */ -#define __NR_osf_nrecvfrom	 29	/* not implemented */ -#define __NR_osf_naccept	 30	/* not implemented */ -#define __NR_osf_ngetpeername	 31	/* not implemented */ -#define __NR_osf_ngetsockname	 32	/* not implemented */ -#define __NR_access		 33 -#define __NR_osf_chflags	 34	/* not implemented */ -#define __NR_osf_fchflags	 35	/* not implemented */ -#define __NR_sync		 36 -#define __NR_kill		 37 -#define __NR_osf_old_stat	 38	/* not implemented */ -#define __NR_setpgid		 39 -#define __NR_osf_old_lstat	 40	/* not implemented */ -#define __NR_dup		 41 -#define __NR_pipe		 42 -#define __NR_osf_set_program_attributes	43 -#define __NR_osf_profil		 44	/* not implemented */ -#define __NR_open		 45 -#define __NR_osf_old_sigaction	 46	/* not implemented */ -#define __NR_getxgid		 47 -#define __NR_osf_sigprocmask	 48 -#define __NR_osf_getlogin	 49	/* not implemented */ -#define __NR_osf_setlogin	 50	/* not implemented */ -#define __NR_acct		 51 -#define __NR_sigpending		 52 +#include <uapi/asm/unistd.h> -#define __NR_ioctl		 54 -#define __NR_osf_reboot		 55	/* not implemented */ -#define __NR_osf_revoke		 56	/* not implemented */ -#define __NR_symlink		 57 -#define __NR_readlink		 58 -#define __NR_execve		 59 -#define __NR_umask		 60 -#define __NR_chroot		 61 -#define __NR_osf_old_fstat	 62	/* not implemented */ -#define __NR_getpgrp		 63 -#define __NR_getpagesize	 64 -#define __NR_osf_mremap		 65	/* not implemented */ -#define __NR_vfork		 66 -#define __NR_stat		 67 -#define __NR_lstat		 68 -#define __NR_osf_sbrk		 69	/* not implemented */ -#define __NR_osf_sstk		 70	/* not implemented */ -#define __NR_mmap		 71	/* OSF/1 mmap is superset of Linux */ -#define __NR_osf_old_vadvise	 72	/* not implemented */ -#define __NR_munmap		 73 -#define __NR_mprotect		 74 -#define __NR_madvise		 75 -#define __NR_vhangup		 76 -#define __NR_osf_kmodcall	 77	/* not implemented */ -#define __NR_osf_mincore	 78	/* not implemented */ -#define __NR_getgroups		 79 -#define __NR_setgroups		 80 -#define __NR_osf_old_getpgrp	 81	/* not implemented */ -#define __NR_setpgrp		 82	/* BSD alias for setpgid */ -#define __NR_osf_setitimer	 83 -#define __NR_osf_old_wait	 84	/* not implemented */ -#define __NR_osf_table		 85	/* not implemented */ -#define __NR_osf_getitimer	 86 -#define __NR_gethostname	 87 -#define __NR_sethostname	 88 -#define __NR_getdtablesize	 89 -#define __NR_dup2		 90 -#define __NR_fstat		 91 -#define __NR_fcntl		 92 -#define __NR_osf_select		 93 -#define __NR_poll		 94 -#define __NR_fsync		 95 -#define __NR_setpriority	 96 -#define __NR_socket		 97 -#define __NR_connect		 98 -#define __NR_accept		 99 -#define __NR_getpriority	100 -#define __NR_send		101 -#define __NR_recv		102 -#define __NR_sigreturn		103 -#define __NR_bind		104 -#define __NR_setsockopt		105 -#define __NR_listen		106 -#define __NR_osf_plock		107	/* not implemented */ -#define __NR_osf_old_sigvec	108	/* not implemented */ -#define __NR_osf_old_sigblock	109	/* not implemented */ -#define __NR_osf_old_sigsetmask	110	/* not implemented */ -#define __NR_sigsuspend		111 -#define __NR_osf_sigstack	112 -#define __NR_recvmsg		113 -#define __NR_sendmsg		114 -#define __NR_osf_old_vtrace	115	/* not implemented */ -#define __NR_osf_gettimeofday	116 -#define __NR_osf_getrusage	117 -#define __NR_getsockopt		118 - -#define __NR_readv		120 -#define __NR_writev		121 -#define __NR_osf_settimeofday	122 -#define __NR_fchown		123 -#define __NR_fchmod		124 -#define __NR_recvfrom		125 -#define __NR_setreuid		126 -#define __NR_setregid		127 -#define __NR_rename		128 -#define __NR_truncate		129 -#define __NR_ftruncate		130 -#define __NR_flock		131 -#define __NR_setgid		132 -#define __NR_sendto		133 -#define __NR_shutdown		134 -#define __NR_socketpair		135 -#define __NR_mkdir		136 -#define __NR_rmdir		137 -#define __NR_osf_utimes		138 -#define __NR_osf_old_sigreturn	139	/* not implemented */ -#define __NR_osf_adjtime	140	/* not implemented */ -#define __NR_getpeername	141 -#define __NR_osf_gethostid	142	/* not implemented */ -#define __NR_osf_sethostid	143	/* not implemented */ -#define __NR_getrlimit		144 -#define __NR_setrlimit		145 -#define __NR_osf_old_killpg	146	/* not implemented */ -#define __NR_setsid		147 -#define __NR_quotactl		148 -#define __NR_osf_oldquota	149	/* not implemented */ -#define __NR_getsockname	150 - -#define __NR_osf_pid_block	153	/* not implemented */ -#define __NR_osf_pid_unblock	154	/* not implemented */ - -#define __NR_sigaction		156 -#define __NR_osf_sigwaitprim	157	/* not implemented */ -#define __NR_osf_nfssvc		158	/* not implemented */ -#define __NR_osf_getdirentries	159 -#define __NR_osf_statfs		160 -#define __NR_osf_fstatfs	161 - -#define __NR_osf_asynch_daemon	163	/* not implemented */ -#define __NR_osf_getfh		164	/* not implemented */	 -#define __NR_osf_getdomainname	165 -#define __NR_setdomainname	166 - -#define __NR_osf_exportfs	169	/* not implemented */ - -#define __NR_osf_alt_plock	181	/* not implemented */ - -#define __NR_osf_getmnt		184	/* not implemented */ - -#define __NR_osf_alt_sigpending	187	/* not implemented */ -#define __NR_osf_alt_setsid	188	/* not implemented */ - -#define __NR_osf_swapon		199 -#define __NR_msgctl		200 -#define __NR_msgget		201 -#define __NR_msgrcv		202 -#define __NR_msgsnd		203 -#define __NR_semctl		204 -#define __NR_semget		205 -#define __NR_semop		206 -#define __NR_osf_utsname	207 -#define __NR_lchown		208 -#define __NR_osf_shmat		209 -#define __NR_shmctl		210 -#define __NR_shmdt		211 -#define __NR_shmget		212 -#define __NR_osf_mvalid		213	/* not implemented */ -#define __NR_osf_getaddressconf	214	/* not implemented */ -#define __NR_osf_msleep		215	/* not implemented */ -#define __NR_osf_mwakeup	216	/* not implemented */ -#define __NR_msync		217 -#define __NR_osf_signal		218	/* not implemented */ -#define __NR_osf_utc_gettime	219	/* not implemented */ -#define __NR_osf_utc_adjtime	220	/* not implemented */ - -#define __NR_osf_security	222	/* not implemented */ -#define __NR_osf_kloadcall	223	/* not implemented */ - -#define __NR_osf_stat		224 -#define __NR_osf_lstat		225 -#define __NR_osf_fstat		226 -#define __NR_osf_statfs64	227 -#define __NR_osf_fstatfs64	228 - -#define __NR_getpgid		233 -#define __NR_getsid		234 -#define __NR_sigaltstack	235 -#define __NR_osf_waitid		236	/* not implemented */ -#define __NR_osf_priocntlset	237	/* not implemented */ -#define __NR_osf_sigsendset	238	/* not implemented */ -#define __NR_osf_set_speculative	239	/* not implemented */ -#define __NR_osf_msfs_syscall	240	/* not implemented */ -#define __NR_osf_sysinfo	241 -#define __NR_osf_uadmin		242	/* not implemented */ -#define __NR_osf_fuser		243	/* not implemented */ -#define __NR_osf_proplist_syscall    244 -#define __NR_osf_ntp_adjtime	245	/* not implemented */ -#define __NR_osf_ntp_gettime	246	/* not implemented */ -#define __NR_osf_pathconf	247	/* not implemented */ -#define __NR_osf_fpathconf	248	/* not implemented */ - -#define __NR_osf_uswitch	250	/* not implemented */ -#define __NR_osf_usleep_thread	251 -#define __NR_osf_audcntl	252	/* not implemented */ -#define __NR_osf_audgen		253	/* not implemented */ -#define __NR_sysfs		254 -#define __NR_osf_subsys_info	255	/* not implemented */ -#define __NR_osf_getsysinfo	256 -#define __NR_osf_setsysinfo	257 -#define __NR_osf_afs_syscall	258	/* not implemented */ -#define __NR_osf_swapctl	259	/* not implemented */ -#define __NR_osf_memcntl	260	/* not implemented */ -#define __NR_osf_fdatasync	261	/* not implemented */ - -/* - * Ignore legacy syscalls that we don't use. - */ -#define __IGNORE_alarm -#define __IGNORE_creat -#define __IGNORE_getegid -#define __IGNORE_geteuid -#define __IGNORE_getgid -#define __IGNORE_getpid -#define __IGNORE_getppid -#define __IGNORE_getuid -#define __IGNORE_pause -#define __IGNORE_time -#define __IGNORE_utime -#define __IGNORE_umount2 - -/* - * Linux-specific system calls begin at 300 - */ -#define __NR_bdflush		300 -#define __NR_sethae		301 -#define __NR_mount		302 -#define __NR_old_adjtimex	303 -#define __NR_swapoff		304 -#define __NR_getdents		305 -#define __NR_create_module	306 -#define __NR_init_module	307 -#define __NR_delete_module	308 -#define __NR_get_kernel_syms	309 -#define __NR_syslog		310 -#define __NR_reboot		311 -#define __NR_clone		312 -#define __NR_uselib		313 -#define __NR_mlock		314 -#define __NR_munlock		315 -#define __NR_mlockall		316 -#define __NR_munlockall		317 -#define __NR_sysinfo		318 -#define __NR__sysctl		319 -/* 320 was sys_idle.  */ -#define __NR_oldumount		321 -#define __NR_swapon		322 -#define __NR_times		323 -#define __NR_personality	324 -#define __NR_setfsuid		325 -#define __NR_setfsgid		326 -#define __NR_ustat		327 -#define __NR_statfs		328 -#define __NR_fstatfs		329 -#define __NR_sched_setparam		330 -#define __NR_sched_getparam		331 -#define __NR_sched_setscheduler		332 -#define __NR_sched_getscheduler		333 -#define __NR_sched_yield		334 -#define __NR_sched_get_priority_max	335 -#define __NR_sched_get_priority_min	336 -#define __NR_sched_rr_get_interval	337 -#define __NR_afs_syscall		338 -#define __NR_uname			339 -#define __NR_nanosleep			340 -#define __NR_mremap			341 -#define __NR_nfsservctl			342 -#define __NR_setresuid			343 -#define __NR_getresuid			344 -#define __NR_pciconfig_read		345 -#define __NR_pciconfig_write		346 -#define __NR_query_module		347 -#define __NR_prctl			348 -#define __NR_pread64			349 -#define __NR_pwrite64			350 -#define __NR_rt_sigreturn		351 -#define __NR_rt_sigaction		352 -#define __NR_rt_sigprocmask		353 -#define __NR_rt_sigpending		354 -#define __NR_rt_sigtimedwait		355 -#define __NR_rt_sigqueueinfo		356 -#define __NR_rt_sigsuspend		357 -#define __NR_select			358 -#define __NR_gettimeofday		359 -#define __NR_settimeofday		360 -#define __NR_getitimer			361 -#define __NR_setitimer			362 -#define __NR_utimes			363 -#define __NR_getrusage			364 -#define __NR_wait4			365 -#define __NR_adjtimex			366 -#define __NR_getcwd			367 -#define __NR_capget			368 -#define __NR_capset			369 -#define __NR_sendfile			370 -#define __NR_setresgid			371 -#define __NR_getresgid			372 -#define __NR_dipc			373 -#define __NR_pivot_root			374 -#define __NR_mincore			375 -#define __NR_pciconfig_iobase		376 -#define __NR_getdents64			377 -#define __NR_gettid			378 -#define __NR_readahead			379 -/* 380 is unused */ -#define __NR_tkill			381 -#define __NR_setxattr			382 -#define __NR_lsetxattr			383 -#define __NR_fsetxattr			384 -#define __NR_getxattr			385 -#define __NR_lgetxattr			386 -#define __NR_fgetxattr			387 -#define __NR_listxattr			388 -#define __NR_llistxattr			389 -#define __NR_flistxattr			390 -#define __NR_removexattr		391 -#define __NR_lremovexattr		392 -#define __NR_fremovexattr		393 -#define __NR_futex			394 -#define __NR_sched_setaffinity		395      -#define __NR_sched_getaffinity		396 -#define __NR_tuxcall			397 -#define __NR_io_setup			398 -#define __NR_io_destroy			399 -#define __NR_io_getevents		400 -#define __NR_io_submit			401 -#define __NR_io_cancel			402 -#define __NR_exit_group			405 -#define __NR_lookup_dcookie		406 -#define __NR_epoll_create		407 -#define __NR_epoll_ctl			408 -#define __NR_epoll_wait			409 -/* Feb 2007: These three sys_epoll defines shouldn't be here but culling - * them would break userspace apps ... we'll kill them off in 2010 :) */ -#define __NR_sys_epoll_create		__NR_epoll_create -#define __NR_sys_epoll_ctl		__NR_epoll_ctl -#define __NR_sys_epoll_wait		__NR_epoll_wait -#define __NR_remap_file_pages		410 -#define __NR_set_tid_address		411 -#define __NR_restart_syscall		412 -#define __NR_fadvise64			413 -#define __NR_timer_create		414 -#define __NR_timer_settime		415 -#define __NR_timer_gettime		416 -#define __NR_timer_getoverrun		417 -#define __NR_timer_delete		418 -#define __NR_clock_settime		419 -#define __NR_clock_gettime		420 -#define __NR_clock_getres		421 -#define __NR_clock_nanosleep		422 -#define __NR_semtimedop			423 -#define __NR_tgkill			424 -#define __NR_stat64			425 -#define __NR_lstat64			426 -#define __NR_fstat64			427 -#define __NR_vserver			428 -#define __NR_mbind			429 -#define __NR_get_mempolicy		430 -#define __NR_set_mempolicy		431 -#define __NR_mq_open			432 -#define __NR_mq_unlink			433 -#define __NR_mq_timedsend		434 -#define __NR_mq_timedreceive		435 -#define __NR_mq_notify			436 -#define __NR_mq_getsetattr		437 -#define __NR_waitid			438 -#define __NR_add_key			439 -#define __NR_request_key		440 -#define __NR_keyctl			441 -#define __NR_ioprio_set			442 -#define __NR_ioprio_get			443 -#define __NR_inotify_init		444 -#define __NR_inotify_add_watch		445 -#define __NR_inotify_rm_watch		446 -#define __NR_fdatasync			447 -#define __NR_kexec_load			448 -#define __NR_migrate_pages		449 -#define __NR_openat			450 -#define __NR_mkdirat			451 -#define __NR_mknodat			452 -#define __NR_fchownat			453 -#define __NR_futimesat			454 -#define __NR_fstatat64			455 -#define __NR_unlinkat			456 -#define __NR_renameat			457 -#define __NR_linkat			458 -#define __NR_symlinkat			459 -#define __NR_readlinkat			460 -#define __NR_fchmodat			461 -#define __NR_faccessat			462 -#define __NR_pselect6			463 -#define __NR_ppoll			464 -#define __NR_unshare			465 -#define __NR_set_robust_list		466 -#define __NR_get_robust_list		467 -#define __NR_splice			468 -#define __NR_sync_file_range		469 -#define __NR_tee			470 -#define __NR_vmsplice			471 -#define __NR_move_pages			472 -#define __NR_getcpu			473 -#define __NR_epoll_pwait		474 -#define __NR_utimensat			475 -#define __NR_signalfd			476 -#define __NR_timerfd			477 -#define __NR_eventfd			478 -#define __NR_recvmmsg			479 -#define __NR_fallocate			480 -#define __NR_timerfd_create		481 -#define __NR_timerfd_settime		482 -#define __NR_timerfd_gettime		483 -#define __NR_signalfd4			484 -#define __NR_eventfd2			485 -#define __NR_epoll_create1		486 -#define __NR_dup3			487 -#define __NR_pipe2			488 -#define __NR_inotify_init1		489 -#define __NR_preadv			490 -#define __NR_pwritev			491 -#define __NR_rt_tgsigqueueinfo		492 -#define __NR_perf_event_open		493 -#define __NR_fanotify_init		494 -#define __NR_fanotify_mark		495 -#define __NR_prlimit64			496 -#define __NR_name_to_handle_at		497 -#define __NR_open_by_handle_at		498 -#define __NR_clock_adjtime		499 -#define __NR_syncfs			500 -#define __NR_setns			501 -#define __NR_accept4			502 -#define __NR_sendmmsg			503 -#define __NR_process_vm_readv		504 -#define __NR_process_vm_writev		505 - -#ifdef __KERNEL__  #define NR_SYSCALLS			506 @@ -481,7 +15,6 @@  #define __ARCH_WANT_SYS_OLDUMOUNT  #define __ARCH_WANT_SYS_SIGPENDING  #define __ARCH_WANT_SYS_RT_SIGSUSPEND -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_VFORK  #define __ARCH_WANT_SYS_CLONE @@ -498,5 +31,4 @@  #define cond_syscall(x)  asm(".weak\t" #x "\n" #x " = sys_ni_syscall") -#endif /* __KERNEL__ */  #endif /* _ALPHA_UNISTD_H */ diff --git a/arch/alpha/include/uapi/asm/Kbuild b/arch/alpha/include/uapi/asm/Kbuild index baebb3da1d4..d96f2ef5b63 100644 --- a/arch/alpha/include/uapi/asm/Kbuild +++ b/arch/alpha/include/uapi/asm/Kbuild @@ -1,3 +1,43 @@  # UAPI Header export list  include include/uapi/asm-generic/Kbuild.asm +header-y += a.out.h +header-y += auxvec.h +header-y += bitsperlong.h +header-y += byteorder.h +header-y += compiler.h +header-y += console.h +header-y += errno.h +header-y += fcntl.h +header-y += fpu.h +header-y += gentrap.h +header-y += ioctl.h +header-y += ioctls.h +header-y += ipcbuf.h +header-y += kvm_para.h +header-y += mman.h +header-y += msgbuf.h +header-y += pal.h +header-y += param.h +header-y += poll.h +header-y += posix_types.h +header-y += ptrace.h +header-y += reg.h +header-y += regdef.h +header-y += resource.h +header-y += sembuf.h +header-y += setup.h +header-y += shmbuf.h +header-y += sigcontext.h +header-y += siginfo.h +header-y += signal.h +header-y += socket.h +header-y += sockios.h +header-y += stat.h +header-y += statfs.h +header-y += swab.h +header-y += sysinfo.h +header-y += termbits.h +header-y += termios.h +header-y += types.h +header-y += unistd.h diff --git a/arch/alpha/include/uapi/asm/a.out.h b/arch/alpha/include/uapi/asm/a.out.h new file mode 100644 index 00000000000..547707246f6 --- /dev/null +++ b/arch/alpha/include/uapi/asm/a.out.h @@ -0,0 +1,91 @@ +#ifndef _UAPI__ALPHA_A_OUT_H__ +#define _UAPI__ALPHA_A_OUT_H__ + +#include <linux/types.h> + +/* + * OSF/1 ECOFF header structs.  ECOFF files consist of: + * 	- a file header (struct filehdr), + *	- an a.out header (struct aouthdr), + *	- one or more section headers (struct scnhdr).  + *	  The filhdr's "f_nscns" field contains the + *	  number of section headers. + */ + +struct filehdr +{ +	/* OSF/1 "file" header */ +	__u16 f_magic, f_nscns; +	__u32 f_timdat; +	__u64 f_symptr; +	__u32 f_nsyms; +	__u16 f_opthdr, f_flags; +}; + +struct aouthdr +{ +	__u64 info;		/* after that it looks quite normal.. */ +	__u64 tsize; +	__u64 dsize; +	__u64 bsize; +	__u64 entry; +	__u64 text_start;	/* with a few additions that actually make sense */ +	__u64 data_start; +	__u64 bss_start; +	__u32 gprmask, fprmask;	/* bitmask of general & floating point regs used in binary */ +	__u64 gpvalue; +}; + +struct scnhdr +{ +	char	s_name[8]; +	__u64	s_paddr; +	__u64	s_vaddr; +	__u64	s_size; +	__u64	s_scnptr; +	__u64	s_relptr; +	__u64	s_lnnoptr; +	__u16	s_nreloc; +	__u16	s_nlnno; +	__u32	s_flags; +}; + +struct exec +{ +	/* OSF/1 "file" header */ +	struct filehdr		fh; +	struct aouthdr		ah; +}; + +/* + * Define's so that the kernel exec code can access the a.out header + * fields... + */ +#define	a_info		ah.info +#define	a_text		ah.tsize +#define a_data		ah.dsize +#define a_bss		ah.bsize +#define a_entry		ah.entry +#define a_textstart	ah.text_start +#define	a_datastart	ah.data_start +#define	a_bssstart	ah.bss_start +#define	a_gprmask	ah.gprmask +#define a_fprmask	ah.fprmask +#define a_gpvalue	ah.gpvalue + +#define N_TXTADDR(x) ((x).a_textstart) +#define N_DATADDR(x) ((x).a_datastart) +#define N_BSSADDR(x) ((x).a_bssstart) +#define N_DRSIZE(x) 0 +#define N_TRSIZE(x) 0 +#define N_SYMSIZE(x) 0 + +#define AOUTHSZ		sizeof(struct aouthdr) +#define SCNHSZ		sizeof(struct scnhdr) +#define SCNROUND	16 + +#define N_TXTOFF(x) \ +  ((long) N_MAGIC(x) == ZMAGIC ? 0 : \ +   (sizeof(struct exec) + (x).fh.f_nscns*SCNHSZ + SCNROUND - 1) & ~(SCNROUND - 1)) + +#endif /* _UAPI__ALPHA_A_OUT_H__ */ diff --git a/arch/alpha/include/asm/auxvec.h b/arch/alpha/include/uapi/asm/auxvec.h index a3a579dfdb4..a3a579dfdb4 100644 --- a/arch/alpha/include/asm/auxvec.h +++ b/arch/alpha/include/uapi/asm/auxvec.h diff --git a/arch/alpha/include/asm/bitsperlong.h b/arch/alpha/include/uapi/asm/bitsperlong.h index ad57f786820..ad57f786820 100644 --- a/arch/alpha/include/asm/bitsperlong.h +++ b/arch/alpha/include/uapi/asm/bitsperlong.h diff --git a/arch/alpha/include/asm/byteorder.h b/arch/alpha/include/uapi/asm/byteorder.h index 73683093202..73683093202 100644 --- a/arch/alpha/include/asm/byteorder.h +++ b/arch/alpha/include/uapi/asm/byteorder.h diff --git a/arch/alpha/include/uapi/asm/compiler.h b/arch/alpha/include/uapi/asm/compiler.h new file mode 100644 index 00000000000..32cc7833f0c --- /dev/null +++ b/arch/alpha/include/uapi/asm/compiler.h @@ -0,0 +1,117 @@ +#ifndef _UAPI__ALPHA_COMPILER_H +#define _UAPI__ALPHA_COMPILER_H + +/*  + * Herein are macros we use when describing various patterns we want to GCC. + * In all cases we can get better schedules out of the compiler if we hide + * as little as possible inside inline assembly.  However, we want to be + * able to know what we'll get out before giving up inline assembly.  Thus + * these tests and macros. + */ + +#if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 +# define __kernel_insbl(val, shift)	__builtin_alpha_insbl(val, shift) +# define __kernel_inswl(val, shift)	__builtin_alpha_inswl(val, shift) +# define __kernel_insql(val, shift)	__builtin_alpha_insql(val, shift) +# define __kernel_inslh(val, shift)	__builtin_alpha_inslh(val, shift) +# define __kernel_extbl(val, shift)	__builtin_alpha_extbl(val, shift) +# define __kernel_extwl(val, shift)	__builtin_alpha_extwl(val, shift) +# define __kernel_cmpbge(a, b)		__builtin_alpha_cmpbge(a, b) +#else +# define __kernel_insbl(val, shift)					\ +  ({ unsigned long __kir;						\ +     __asm__("insbl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ +     __kir; }) +# define __kernel_inswl(val, shift)					\ +  ({ unsigned long __kir;						\ +     __asm__("inswl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ +     __kir; }) +# define __kernel_insql(val, shift)					\ +  ({ unsigned long __kir;						\ +     __asm__("insql %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ +     __kir; }) +# define __kernel_inslh(val, shift)					\ +  ({ unsigned long __kir;						\ +     __asm__("inslh %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ +     __kir; }) +# define __kernel_extbl(val, shift)					\ +  ({ unsigned long __kir;						\ +     __asm__("extbl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ +     __kir; }) +# define __kernel_extwl(val, shift)					\ +  ({ unsigned long __kir;						\ +     __asm__("extwl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));	\ +     __kir; }) +# define __kernel_cmpbge(a, b)						\ +  ({ unsigned long __kir;						\ +     __asm__("cmpbge %r2,%1,%0" : "=r"(__kir) : "rI"(b), "rJ"(a));	\ +     __kir; }) +#endif + +#ifdef __alpha_cix__ +# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 +#  define __kernel_cttz(x)		__builtin_ctzl(x) +#  define __kernel_ctlz(x)		__builtin_clzl(x) +#  define __kernel_ctpop(x)		__builtin_popcountl(x) +# else +#  define __kernel_cttz(x)						\ +   ({ unsigned long __kir;						\ +      __asm__("cttz %1,%0" : "=r"(__kir) : "r"(x));			\ +      __kir; }) +#  define __kernel_ctlz(x)						\ +   ({ unsigned long __kir;						\ +      __asm__("ctlz %1,%0" : "=r"(__kir) : "r"(x));			\ +      __kir; }) +#  define __kernel_ctpop(x)						\ +   ({ unsigned long __kir;						\ +      __asm__("ctpop %1,%0" : "=r"(__kir) : "r"(x));			\ +      __kir; }) +# endif +#else +# define __kernel_cttz(x)						\ +  ({ unsigned long __kir;						\ +     __asm__(".arch ev67; cttz %1,%0" : "=r"(__kir) : "r"(x));		\ +     __kir; }) +# define __kernel_ctlz(x)						\ +  ({ unsigned long __kir;						\ +     __asm__(".arch ev67; ctlz %1,%0" : "=r"(__kir) : "r"(x));		\ +     __kir; }) +# define __kernel_ctpop(x)						\ +  ({ unsigned long __kir;						\ +     __asm__(".arch ev67; ctpop %1,%0" : "=r"(__kir) : "r"(x));		\ +     __kir; }) +#endif + + +/*  + * Beginning with EGCS 1.1, GCC defines __alpha_bwx__ when the BWX  + * extension is enabled.  Previous versions did not define anything + * we could test during compilation -- too bad, so sad. + */ + +#if defined(__alpha_bwx__) +#define __kernel_ldbu(mem)	(mem) +#define __kernel_ldwu(mem)	(mem) +#define __kernel_stb(val,mem)	((mem) = (val)) +#define __kernel_stw(val,mem)	((mem) = (val)) +#else +#define __kernel_ldbu(mem)				\ +  ({ unsigned char __kir;				\ +     __asm__(".arch ev56;				\ +	      ldbu %0,%1" : "=r"(__kir) : "m"(mem));	\ +     __kir; }) +#define __kernel_ldwu(mem)				\ +  ({ unsigned short __kir;				\ +     __asm__(".arch ev56;				\ +	      ldwu %0,%1" : "=r"(__kir) : "m"(mem));	\ +     __kir; }) +#define __kernel_stb(val,mem)				\ +  __asm__(".arch ev56;					\ +	   stb %1,%0" : "=m"(mem) : "r"(val)) +#define __kernel_stw(val,mem)				\ +  __asm__(".arch ev56;					\ +	   stw %1,%0" : "=m"(mem) : "r"(val)) +#endif + + +#endif /* _UAPI__ALPHA_COMPILER_H */ diff --git a/arch/alpha/include/uapi/asm/console.h b/arch/alpha/include/uapi/asm/console.h new file mode 100644 index 00000000000..fd08a191f36 --- /dev/null +++ b/arch/alpha/include/uapi/asm/console.h @@ -0,0 +1,50 @@ +#ifndef _UAPI__AXP_CONSOLE_H +#define _UAPI__AXP_CONSOLE_H + +/* + * Console callback routine numbers + */ +#define CCB_GETC		0x01 +#define CCB_PUTS		0x02 +#define CCB_RESET_TERM		0x03 +#define CCB_SET_TERM_INT	0x04 +#define CCB_SET_TERM_CTL	0x05 +#define CCB_PROCESS_KEYCODE	0x06 +#define CCB_OPEN_CONSOLE	0x07 +#define CCB_CLOSE_CONSOLE	0x08 + +#define CCB_OPEN		0x10 +#define CCB_CLOSE		0x11 +#define CCB_IOCTL		0x12 +#define CCB_READ		0x13 +#define CCB_WRITE		0x14 + +#define CCB_SET_ENV		0x20 +#define CCB_RESET_ENV		0x21 +#define CCB_GET_ENV		0x22 +#define CCB_SAVE_ENV		0x23 + +#define CCB_PSWITCH		0x30 +#define CCB_BIOS_EMUL		0x32 + +/* + * Environment variable numbers + */ +#define ENV_AUTO_ACTION		0x01 +#define ENV_BOOT_DEV		0x02 +#define ENV_BOOTDEF_DEV		0x03 +#define ENV_BOOTED_DEV		0x04 +#define ENV_BOOT_FILE		0x05 +#define ENV_BOOTED_FILE		0x06 +#define ENV_BOOT_OSFLAGS	0x07 +#define ENV_BOOTED_OSFLAGS	0x08 +#define ENV_BOOT_RESET		0x09 +#define ENV_DUMP_DEV		0x0A +#define ENV_ENABLE_AUDIT	0x0B +#define ENV_LICENSE		0x0C +#define ENV_CHAR_SET		0x0D +#define ENV_LANGUAGE		0x0E +#define ENV_TTY_DEV		0x0F + + +#endif /* _UAPI__AXP_CONSOLE_H */ diff --git a/arch/alpha/include/asm/errno.h b/arch/alpha/include/uapi/asm/errno.h index e5f29ca2818..e5f29ca2818 100644 --- a/arch/alpha/include/asm/errno.h +++ b/arch/alpha/include/uapi/asm/errno.h diff --git a/arch/alpha/include/asm/fcntl.h b/arch/alpha/include/uapi/asm/fcntl.h index 6d9e805f18a..6d9e805f18a 100644 --- a/arch/alpha/include/asm/fcntl.h +++ b/arch/alpha/include/uapi/asm/fcntl.h diff --git a/arch/alpha/include/uapi/asm/fpu.h b/arch/alpha/include/uapi/asm/fpu.h new file mode 100644 index 00000000000..21a053ca223 --- /dev/null +++ b/arch/alpha/include/uapi/asm/fpu.h @@ -0,0 +1,123 @@ +#ifndef _UAPI__ASM_ALPHA_FPU_H +#define _UAPI__ASM_ALPHA_FPU_H + + +/* + * Alpha floating-point control register defines: + */ +#define FPCR_DNOD	(1UL<<47)	/* denorm INV trap disable */ +#define FPCR_DNZ	(1UL<<48)	/* denorms to zero */ +#define FPCR_INVD	(1UL<<49)	/* invalid op disable (opt.) */ +#define FPCR_DZED	(1UL<<50)	/* division by zero disable (opt.) */ +#define FPCR_OVFD	(1UL<<51)	/* overflow disable (optional) */ +#define FPCR_INV	(1UL<<52)	/* invalid operation */ +#define FPCR_DZE	(1UL<<53)	/* division by zero */ +#define FPCR_OVF	(1UL<<54)	/* overflow */ +#define FPCR_UNF	(1UL<<55)	/* underflow */ +#define FPCR_INE	(1UL<<56)	/* inexact */ +#define FPCR_IOV	(1UL<<57)	/* integer overflow */ +#define FPCR_UNDZ	(1UL<<60)	/* underflow to zero (opt.) */ +#define FPCR_UNFD	(1UL<<61)	/* underflow disable (opt.) */ +#define FPCR_INED	(1UL<<62)	/* inexact disable (opt.) */ +#define FPCR_SUM	(1UL<<63)	/* summary bit */ + +#define FPCR_DYN_SHIFT	58		/* first dynamic rounding mode bit */ +#define FPCR_DYN_CHOPPED (0x0UL << FPCR_DYN_SHIFT)	/* towards 0 */ +#define FPCR_DYN_MINUS	 (0x1UL << FPCR_DYN_SHIFT)	/* towards -INF */ +#define FPCR_DYN_NORMAL	 (0x2UL << FPCR_DYN_SHIFT)	/* towards nearest */ +#define FPCR_DYN_PLUS	 (0x3UL << FPCR_DYN_SHIFT)	/* towards +INF */ +#define FPCR_DYN_MASK	 (0x3UL << FPCR_DYN_SHIFT) + +#define FPCR_MASK	0xffff800000000000L + +/* + * IEEE trap enables are implemented in software.  These per-thread + * bits are stored in the "ieee_state" field of "struct thread_info". + * Thus, the bits are defined so as not to conflict with the + * floating-point enable bit (which is architected).  On top of that, + * we want to make these bits compatible with OSF/1 so + * ieee_set_fp_control() etc. can be implemented easily and + * compatibly.  The corresponding definitions are in + * /usr/include/machine/fpu.h under OSF/1. + */ +#define IEEE_TRAP_ENABLE_INV	(1UL<<1)	/* invalid op */ +#define IEEE_TRAP_ENABLE_DZE	(1UL<<2)	/* division by zero */ +#define IEEE_TRAP_ENABLE_OVF	(1UL<<3)	/* overflow */ +#define IEEE_TRAP_ENABLE_UNF	(1UL<<4)	/* underflow */ +#define IEEE_TRAP_ENABLE_INE	(1UL<<5)	/* inexact */ +#define IEEE_TRAP_ENABLE_DNO	(1UL<<6)	/* denorm */ +#define IEEE_TRAP_ENABLE_MASK	(IEEE_TRAP_ENABLE_INV | IEEE_TRAP_ENABLE_DZE |\ +				 IEEE_TRAP_ENABLE_OVF | IEEE_TRAP_ENABLE_UNF |\ +				 IEEE_TRAP_ENABLE_INE | IEEE_TRAP_ENABLE_DNO) + +/* Denorm and Underflow flushing */ +#define IEEE_MAP_DMZ		(1UL<<12)	/* Map denorm inputs to zero */ +#define IEEE_MAP_UMZ		(1UL<<13)	/* Map underflowed outputs to zero */ + +#define IEEE_MAP_MASK		(IEEE_MAP_DMZ | IEEE_MAP_UMZ) + +/* status bits coming from fpcr: */ +#define IEEE_STATUS_INV		(1UL<<17) +#define IEEE_STATUS_DZE		(1UL<<18) +#define IEEE_STATUS_OVF		(1UL<<19) +#define IEEE_STATUS_UNF		(1UL<<20) +#define IEEE_STATUS_INE		(1UL<<21) +#define IEEE_STATUS_DNO		(1UL<<22) + +#define IEEE_STATUS_MASK	(IEEE_STATUS_INV | IEEE_STATUS_DZE |	\ +				 IEEE_STATUS_OVF | IEEE_STATUS_UNF |	\ +				 IEEE_STATUS_INE | IEEE_STATUS_DNO) + +#define IEEE_SW_MASK		(IEEE_TRAP_ENABLE_MASK |		\ +				 IEEE_STATUS_MASK | IEEE_MAP_MASK) + +#define IEEE_CURRENT_RM_SHIFT	32 +#define IEEE_CURRENT_RM_MASK	(3UL<<IEEE_CURRENT_RM_SHIFT) + +#define IEEE_STATUS_TO_EXCSUM_SHIFT	16 + +#define IEEE_INHERIT    (1UL<<63)	/* inherit on thread create? */ + +/* + * Convert the software IEEE trap enable and status bits into the + * hardware fpcr format.  + * + * Digital Unix engineers receive my thanks for not defining the + * software bits identical to the hardware bits.  The chip designers + * receive my thanks for making all the not-implemented fpcr bits + * RAZ forcing us to use system calls to read/write this value. + */ + +static inline unsigned long +ieee_swcr_to_fpcr(unsigned long sw) +{ +	unsigned long fp; +	fp = (sw & IEEE_STATUS_MASK) << 35; +	fp |= (sw & IEEE_MAP_DMZ) << 36; +	fp |= (sw & IEEE_STATUS_MASK ? FPCR_SUM : 0); +	fp |= (~sw & (IEEE_TRAP_ENABLE_INV +		      | IEEE_TRAP_ENABLE_DZE +		      | IEEE_TRAP_ENABLE_OVF)) << 48; +	fp |= (~sw & (IEEE_TRAP_ENABLE_UNF | IEEE_TRAP_ENABLE_INE)) << 57; +	fp |= (sw & IEEE_MAP_UMZ ? FPCR_UNDZ | FPCR_UNFD : 0); +	fp |= (~sw & IEEE_TRAP_ENABLE_DNO) << 41; +	return fp; +} + +static inline unsigned long +ieee_fpcr_to_swcr(unsigned long fp) +{ +	unsigned long sw; +	sw = (fp >> 35) & IEEE_STATUS_MASK; +	sw |= (fp >> 36) & IEEE_MAP_DMZ; +	sw |= (~fp >> 48) & (IEEE_TRAP_ENABLE_INV +			     | IEEE_TRAP_ENABLE_DZE +			     | IEEE_TRAP_ENABLE_OVF); +	sw |= (~fp >> 57) & (IEEE_TRAP_ENABLE_UNF | IEEE_TRAP_ENABLE_INE); +	sw |= (fp >> 47) & IEEE_MAP_UMZ; +	sw |= (~fp >> 41) & IEEE_TRAP_ENABLE_DNO; +	return sw; +} + + +#endif /* _UAPI__ASM_ALPHA_FPU_H */ diff --git a/arch/alpha/include/asm/gentrap.h b/arch/alpha/include/uapi/asm/gentrap.h index ae50cc3192c..ae50cc3192c 100644 --- a/arch/alpha/include/asm/gentrap.h +++ b/arch/alpha/include/uapi/asm/gentrap.h diff --git a/arch/alpha/include/asm/ioctl.h b/arch/alpha/include/uapi/asm/ioctl.h index fc63727f417..fc63727f417 100644 --- a/arch/alpha/include/asm/ioctl.h +++ b/arch/alpha/include/uapi/asm/ioctl.h diff --git a/arch/alpha/include/asm/ioctls.h b/arch/alpha/include/uapi/asm/ioctls.h index 92c557be49f..92c557be49f 100644 --- a/arch/alpha/include/asm/ioctls.h +++ b/arch/alpha/include/uapi/asm/ioctls.h diff --git a/arch/alpha/include/asm/ipcbuf.h b/arch/alpha/include/uapi/asm/ipcbuf.h index 84c7e51cb6d..84c7e51cb6d 100644 --- a/arch/alpha/include/asm/ipcbuf.h +++ b/arch/alpha/include/uapi/asm/ipcbuf.h diff --git a/arch/alpha/include/asm/kvm_para.h b/arch/alpha/include/uapi/asm/kvm_para.h index 14fab8f0b95..14fab8f0b95 100644 --- a/arch/alpha/include/asm/kvm_para.h +++ b/arch/alpha/include/uapi/asm/kvm_para.h diff --git a/arch/alpha/include/asm/mman.h b/arch/alpha/include/uapi/asm/mman.h index 0086b472bc2..0086b472bc2 100644 --- a/arch/alpha/include/asm/mman.h +++ b/arch/alpha/include/uapi/asm/mman.h diff --git a/arch/alpha/include/asm/msgbuf.h b/arch/alpha/include/uapi/asm/msgbuf.h index 98496501a2b..98496501a2b 100644 --- a/arch/alpha/include/asm/msgbuf.h +++ b/arch/alpha/include/uapi/asm/msgbuf.h diff --git a/arch/alpha/include/uapi/asm/pal.h b/arch/alpha/include/uapi/asm/pal.h new file mode 100644 index 00000000000..3c0ce08e5f5 --- /dev/null +++ b/arch/alpha/include/uapi/asm/pal.h @@ -0,0 +1,52 @@ +#ifndef _UAPI__ALPHA_PAL_H +#define _UAPI__ALPHA_PAL_H + +/* + * Common PAL-code + */ +#define PAL_halt	  0 +#define PAL_cflush	  1 +#define PAL_draina	  2 +#define PAL_bpt		128 +#define PAL_bugchk	129 +#define PAL_chmk	131 +#define PAL_callsys	131 +#define PAL_imb		134 +#define PAL_rduniq	158 +#define PAL_wruniq	159 +#define PAL_gentrap	170 +#define PAL_nphalt	190 + +/* + * VMS specific PAL-code + */ +#define PAL_swppal	10 +#define PAL_mfpr_vptb	41 + +/* + * OSF specific PAL-code + */ +#define PAL_cserve	 9 +#define PAL_wripir	13 +#define PAL_rdmces	16 +#define PAL_wrmces	17 +#define PAL_wrfen	43 +#define PAL_wrvptptr	45 +#define PAL_jtopal	46 +#define PAL_swpctx	48 +#define PAL_wrval	49 +#define PAL_rdval	50 +#define PAL_tbi		51 +#define PAL_wrent	52 +#define PAL_swpipl	53 +#define PAL_rdps	54 +#define PAL_wrkgp	55 +#define PAL_wrusp	56 +#define PAL_wrperfmon	57 +#define PAL_rdusp	58 +#define PAL_whami	60 +#define PAL_retsys	61 +#define PAL_rti		63 + + +#endif /* _UAPI__ALPHA_PAL_H */ diff --git a/arch/alpha/include/uapi/asm/param.h b/arch/alpha/include/uapi/asm/param.h new file mode 100644 index 00000000000..29daed819eb --- /dev/null +++ b/arch/alpha/include/uapi/asm/param.h @@ -0,0 +1,21 @@ +#ifndef _UAPI_ASM_ALPHA_PARAM_H +#define _UAPI_ASM_ALPHA_PARAM_H + +/* ??? Gross.  I don't want to parameterize this, and supposedly the +   hardware ignores reprogramming.  We also need userland buy-in to the  +   change in HZ, since this is visible in the wait4 resources etc.  */ + +#ifndef __KERNEL__ +#define HZ		1024 +#endif + +#define EXEC_PAGESIZE	8192 + +#ifndef NOGROUP +#define NOGROUP		(-1) +#endif + +#define MAXHOSTNAMELEN	64	/* max length of hostname */ + + +#endif /* _UAPI_ASM_ALPHA_PARAM_H */ diff --git a/arch/alpha/include/asm/poll.h b/arch/alpha/include/uapi/asm/poll.h index c98509d3149..c98509d3149 100644 --- a/arch/alpha/include/asm/poll.h +++ b/arch/alpha/include/uapi/asm/poll.h diff --git a/arch/alpha/include/asm/posix_types.h b/arch/alpha/include/uapi/asm/posix_types.h index 5a8a48320ef..5a8a48320ef 100644 --- a/arch/alpha/include/asm/posix_types.h +++ b/arch/alpha/include/uapi/asm/posix_types.h diff --git a/arch/alpha/include/uapi/asm/ptrace.h b/arch/alpha/include/uapi/asm/ptrace.h new file mode 100644 index 00000000000..5ce83fa9a05 --- /dev/null +++ b/arch/alpha/include/uapi/asm/ptrace.h @@ -0,0 +1,70 @@ +#ifndef _UAPI_ASMAXP_PTRACE_H +#define _UAPI_ASMAXP_PTRACE_H + + +/* + * This struct defines the way the registers are stored on the + * kernel stack during a system call or other kernel entry + * + * NOTE! I want to minimize the overhead of system calls, so this + * struct has as little information as possible.  I does not have + * + *  - floating point regs: the kernel doesn't change those + *  - r9-15: saved by the C compiler + * + * This makes "fork()" and "exec()" a bit more complex, but should + * give us low system call latency. + */ + +struct pt_regs { +	unsigned long r0; +	unsigned long r1; +	unsigned long r2; +	unsigned long r3; +	unsigned long r4; +	unsigned long r5; +	unsigned long r6; +	unsigned long r7; +	unsigned long r8; +	unsigned long r19; +	unsigned long r20; +	unsigned long r21; +	unsigned long r22; +	unsigned long r23; +	unsigned long r24; +	unsigned long r25; +	unsigned long r26; +	unsigned long r27; +	unsigned long r28; +	unsigned long hae; +/* JRP - These are the values provided to a0-a2 by PALcode */ +	unsigned long trap_a0; +	unsigned long trap_a1; +	unsigned long trap_a2; +/* These are saved by PAL-code: */ +	unsigned long ps; +	unsigned long pc; +	unsigned long gp; +	unsigned long r16; +	unsigned long r17; +	unsigned long r18; +}; + +/* + * This is the extended stack used by signal handlers and the context + * switcher: it's pushed after the normal "struct pt_regs". + */ +struct switch_stack { +	unsigned long r9; +	unsigned long r10; +	unsigned long r11; +	unsigned long r12; +	unsigned long r13; +	unsigned long r14; +	unsigned long r15; +	unsigned long r26; +	unsigned long fp[32];	/* fp[31] is fpcr */ +}; + + +#endif /* _UAPI_ASMAXP_PTRACE_H */ diff --git a/arch/alpha/include/asm/reg.h b/arch/alpha/include/uapi/asm/reg.h index 86ff916fb06..86ff916fb06 100644 --- a/arch/alpha/include/asm/reg.h +++ b/arch/alpha/include/uapi/asm/reg.h diff --git a/arch/alpha/include/asm/regdef.h b/arch/alpha/include/uapi/asm/regdef.h index 142df9c4f8b..142df9c4f8b 100644 --- a/arch/alpha/include/asm/regdef.h +++ b/arch/alpha/include/uapi/asm/regdef.h diff --git a/arch/alpha/include/asm/resource.h b/arch/alpha/include/uapi/asm/resource.h index c10874ff597..c10874ff597 100644 --- a/arch/alpha/include/asm/resource.h +++ b/arch/alpha/include/uapi/asm/resource.h diff --git a/arch/alpha/include/asm/sembuf.h b/arch/alpha/include/uapi/asm/sembuf.h index 7b38b153478..7b38b153478 100644 --- a/arch/alpha/include/asm/sembuf.h +++ b/arch/alpha/include/uapi/asm/sembuf.h diff --git a/arch/alpha/include/asm/setup.h b/arch/alpha/include/uapi/asm/setup.h index b50014b3090..b50014b3090 100644 --- a/arch/alpha/include/asm/setup.h +++ b/arch/alpha/include/uapi/asm/setup.h diff --git a/arch/alpha/include/asm/shmbuf.h b/arch/alpha/include/uapi/asm/shmbuf.h index 37ee84f0508..37ee84f0508 100644 --- a/arch/alpha/include/asm/shmbuf.h +++ b/arch/alpha/include/uapi/asm/shmbuf.h diff --git a/arch/alpha/include/asm/sigcontext.h b/arch/alpha/include/uapi/asm/sigcontext.h index 323cdb02619..323cdb02619 100644 --- a/arch/alpha/include/asm/sigcontext.h +++ b/arch/alpha/include/uapi/asm/sigcontext.h diff --git a/arch/alpha/include/asm/siginfo.h b/arch/alpha/include/uapi/asm/siginfo.h index 9822362a842..9822362a842 100644 --- a/arch/alpha/include/asm/siginfo.h +++ b/arch/alpha/include/uapi/asm/siginfo.h diff --git a/arch/alpha/include/uapi/asm/signal.h b/arch/alpha/include/uapi/asm/signal.h new file mode 100644 index 00000000000..dd4ca4bcbb4 --- /dev/null +++ b/arch/alpha/include/uapi/asm/signal.h @@ -0,0 +1,129 @@ +#ifndef _UAPI_ASMAXP_SIGNAL_H +#define _UAPI_ASMAXP_SIGNAL_H + +#include <linux/types.h> + +/* Avoid too many header ordering problems.  */ +struct siginfo; + +#ifndef __KERNEL__ +/* Here we must cater to libcs that poke about in kernel headers.  */ + +#define NSIG		32 +typedef unsigned long sigset_t; + +#endif /* __KERNEL__ */ + + +/* + * Linux/AXP has different signal numbers that Linux/i386: I'm trying + * to make it OSF/1 binary compatible, at least for normal binaries. + */ +#define SIGHUP		 1 +#define SIGINT		 2 +#define SIGQUIT		 3 +#define SIGILL		 4 +#define SIGTRAP		 5 +#define SIGABRT		 6 +#define SIGEMT		 7 +#define SIGFPE		 8 +#define SIGKILL		 9 +#define SIGBUS		10 +#define SIGSEGV		11 +#define SIGSYS		12 +#define SIGPIPE		13 +#define SIGALRM		14 +#define SIGTERM		15 +#define SIGURG		16 +#define SIGSTOP		17 +#define SIGTSTP		18 +#define SIGCONT		19 +#define SIGCHLD		20 +#define SIGTTIN		21 +#define SIGTTOU		22 +#define SIGIO		23 +#define SIGXCPU		24 +#define SIGXFSZ		25 +#define SIGVTALRM	26 +#define SIGPROF		27 +#define SIGWINCH	28 +#define SIGINFO		29 +#define SIGUSR1		30 +#define SIGUSR2		31 + +#define SIGPOLL	SIGIO +#define SIGPWR	SIGINFO +#define SIGIOT	SIGABRT + +/* These should not be considered constants from userland.  */ +#define SIGRTMIN	32 +#define SIGRTMAX	_NSIG + +/* + * SA_FLAGS values: + * + * SA_ONSTACK indicates that a registered stack_t will be used. + * SA_RESTART flag to get restarting signals (which were the default long ago) + * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. + * SA_RESETHAND clears the handler when the signal is delivered. + * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. + * SA_NODEFER prevents the current signal from being masked in the handler. + * + * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single + * Unix names RESETHAND and NODEFER respectively. + */ + +#define SA_ONSTACK	0x00000001 +#define SA_RESTART	0x00000002 +#define SA_NOCLDSTOP	0x00000004 +#define SA_NODEFER	0x00000008 +#define SA_RESETHAND	0x00000010 +#define SA_NOCLDWAIT	0x00000020 +#define SA_SIGINFO	0x00000040 + +#define SA_ONESHOT	SA_RESETHAND +#define SA_NOMASK	SA_NODEFER + +#define MINSIGSTKSZ	4096 +#define SIGSTKSZ	16384 + +#define SIG_BLOCK          1	/* for blocking signals */ +#define SIG_UNBLOCK        2	/* for unblocking signals */ +#define SIG_SETMASK        3	/* for setting the signal mask */ + +#include <asm-generic/signal-defs.h> + +#ifndef __KERNEL__ +/* Here we must cater to libcs that poke about in kernel headers.  */ + +struct sigaction { +	union { +	  __sighandler_t	_sa_handler; +	  void (*_sa_sigaction)(int, struct siginfo *, void *); +	} _u; +	sigset_t	sa_mask; +	int		sa_flags; +}; + +#define sa_handler	_u._sa_handler +#define sa_sigaction	_u._sa_sigaction + +#endif /* __KERNEL__ */ + +typedef struct sigaltstack { +	void __user *ss_sp; +	int ss_flags; +	size_t ss_size; +} stack_t; + +/* sigstack(2) is deprecated, and will be withdrawn in a future version +   of the X/Open CAE Specification.  Use sigaltstack instead.  It is only +   implemented here for OSF/1 compatibility.  */ + +struct sigstack { +	void __user *ss_sp; +	int ss_onstack; +}; + + +#endif /* _UAPI_ASMAXP_SIGNAL_H */ diff --git a/arch/alpha/include/uapi/asm/socket.h b/arch/alpha/include/uapi/asm/socket.h new file mode 100644 index 00000000000..097c1577735 --- /dev/null +++ b/arch/alpha/include/uapi/asm/socket.h @@ -0,0 +1,81 @@ +#ifndef _UAPI_ASM_SOCKET_H +#define _UAPI_ASM_SOCKET_H + +#include <asm/sockios.h> + +/* For setsockopt(2) */ +/* + * Note: we only bother about making the SOL_SOCKET options + * same as OSF/1, as that's all that "normal" programs are + * likely to set.  We don't necessarily want to be binary + * compatible with _everything_.  + */ +#define SOL_SOCKET	0xffff + +#define SO_DEBUG	0x0001 +#define SO_REUSEADDR	0x0004 +#define SO_KEEPALIVE	0x0008 +#define SO_DONTROUTE	0x0010 +#define SO_BROADCAST	0x0020 +#define SO_LINGER	0x0080 +#define SO_OOBINLINE	0x0100 +/* To add :#define SO_REUSEPORT 0x0200 */ + +#define SO_TYPE		0x1008 +#define SO_ERROR	0x1007 +#define SO_SNDBUF	0x1001 +#define SO_RCVBUF	0x1002 +#define SO_SNDBUFFORCE	0x100a +#define SO_RCVBUFFORCE	0x100b +#define	SO_RCVLOWAT	0x1010 +#define	SO_SNDLOWAT	0x1011 +#define	SO_RCVTIMEO	0x1012 +#define	SO_SNDTIMEO	0x1013 +#define SO_ACCEPTCONN	0x1014 +#define SO_PROTOCOL	0x1028 +#define SO_DOMAIN	0x1029 + +/* linux-specific, might as well be the same as on i386 */ +#define SO_NO_CHECK	11 +#define SO_PRIORITY	12 +#define SO_BSDCOMPAT	14 + +#define SO_PASSCRED	17 +#define SO_PEERCRED	18 +#define SO_BINDTODEVICE 25 + +/* Socket filtering */ +#define SO_ATTACH_FILTER        26 +#define SO_DETACH_FILTER        27 +#define SO_GET_FILTER		SO_ATTACH_FILTER + +#define SO_PEERNAME		28 +#define SO_TIMESTAMP		29 +#define SCM_TIMESTAMP		SO_TIMESTAMP + +#define SO_PEERSEC		30 +#define SO_PASSSEC		34 +#define SO_TIMESTAMPNS		35 +#define SCM_TIMESTAMPNS		SO_TIMESTAMPNS + +/* Security levels - as per NRL IPv6 - don't actually do anything */ +#define SO_SECURITY_AUTHENTICATION		19 +#define SO_SECURITY_ENCRYPTION_TRANSPORT	20 +#define SO_SECURITY_ENCRYPTION_NETWORK		21 + +#define SO_MARK			36 + +#define SO_TIMESTAMPING		37 +#define SCM_TIMESTAMPING	SO_TIMESTAMPING + +#define SO_RXQ_OVFL             40 + +#define SO_WIFI_STATUS		41 +#define SCM_WIFI_STATUS		SO_WIFI_STATUS +#define SO_PEEK_OFF		42 + +/* Instruct lower device to use last 4-bytes of skb data as FCS */ +#define SO_NOFCS		43 + + +#endif /* _UAPI_ASM_SOCKET_H */ diff --git a/arch/alpha/include/asm/sockios.h b/arch/alpha/include/uapi/asm/sockios.h index 7932c7ab4a4..7932c7ab4a4 100644 --- a/arch/alpha/include/asm/sockios.h +++ b/arch/alpha/include/uapi/asm/sockios.h diff --git a/arch/alpha/include/asm/stat.h b/arch/alpha/include/uapi/asm/stat.h index 07ad3e6b3f3..07ad3e6b3f3 100644 --- a/arch/alpha/include/asm/stat.h +++ b/arch/alpha/include/uapi/asm/stat.h diff --git a/arch/alpha/include/asm/statfs.h b/arch/alpha/include/uapi/asm/statfs.h index ccd2e186bfd..ccd2e186bfd 100644 --- a/arch/alpha/include/asm/statfs.h +++ b/arch/alpha/include/uapi/asm/statfs.h diff --git a/arch/alpha/include/asm/swab.h b/arch/alpha/include/uapi/asm/swab.h index 4d682b16c7c..4d682b16c7c 100644 --- a/arch/alpha/include/asm/swab.h +++ b/arch/alpha/include/uapi/asm/swab.h diff --git a/arch/alpha/include/asm/sysinfo.h b/arch/alpha/include/uapi/asm/sysinfo.h index 0b80e79d75e..0b80e79d75e 100644 --- a/arch/alpha/include/asm/sysinfo.h +++ b/arch/alpha/include/uapi/asm/sysinfo.h diff --git a/arch/alpha/include/asm/termbits.h b/arch/alpha/include/uapi/asm/termbits.h index 879dd358992..879dd358992 100644 --- a/arch/alpha/include/asm/termbits.h +++ b/arch/alpha/include/uapi/asm/termbits.h diff --git a/arch/alpha/include/uapi/asm/termios.h b/arch/alpha/include/uapi/asm/termios.h new file mode 100644 index 00000000000..580ed1e4854 --- /dev/null +++ b/arch/alpha/include/uapi/asm/termios.h @@ -0,0 +1,70 @@ +#ifndef _UAPI_ALPHA_TERMIOS_H +#define _UAPI_ALPHA_TERMIOS_H + +#include <asm/ioctls.h> +#include <asm/termbits.h> + +struct sgttyb { +	char	sg_ispeed; +	char	sg_ospeed; +	char	sg_erase; +	char	sg_kill; +	short	sg_flags; +}; + +struct tchars { +	char	t_intrc; +	char	t_quitc; +	char	t_startc; +	char	t_stopc; +	char	t_eofc; +	char	t_brkc; +}; + +struct ltchars { +	char	t_suspc; +	char	t_dsuspc; +	char	t_rprntc; +	char	t_flushc; +	char	t_werasc; +	char	t_lnextc; +}; + +struct winsize { +	unsigned short ws_row; +	unsigned short ws_col; +	unsigned short ws_xpixel; +	unsigned short ws_ypixel; +}; + +#define NCC 8 +struct termio { +	unsigned short c_iflag;		/* input mode flags */ +	unsigned short c_oflag;		/* output mode flags */ +	unsigned short c_cflag;		/* control mode flags */ +	unsigned short c_lflag;		/* local mode flags */ +	unsigned char c_line;		/* line discipline */ +	unsigned char c_cc[NCC];	/* control characters */ +}; + +/* + * c_cc characters in the termio structure.  Oh, how I love being + * backwardly compatible.  Notice that character 4 and 5 are + * interpreted differently depending on whether ICANON is set in + * c_lflag.  If it's set, they are used as _VEOF and _VEOL, otherwise + * as _VMIN and V_TIME.  This is for compatibility with OSF/1 (which + * is compatible with sysV)... + */ +#define _VINTR	0 +#define _VQUIT	1 +#define _VERASE	2 +#define _VKILL	3 +#define _VEOF	4 +#define _VMIN	4 +#define _VEOL	5 +#define _VTIME	5 +#define _VEOL2	6 +#define _VSWTC	7 + + +#endif /* _UAPI_ALPHA_TERMIOS_H */ diff --git a/arch/alpha/include/uapi/asm/types.h b/arch/alpha/include/uapi/asm/types.h new file mode 100644 index 00000000000..9fd3cd45977 --- /dev/null +++ b/arch/alpha/include/uapi/asm/types.h @@ -0,0 +1,16 @@ +#ifndef _UAPI_ALPHA_TYPES_H +#define _UAPI_ALPHA_TYPES_H + +/* + * This file is never included by application software unless + * explicitly requested (e.g., via linux/types.h) in which case the + * application is Linux specific so (user-) name space pollution is + * not a major issue.  However, for interoperability, libraries still + * need to be careful to avoid a name clashes. + */ + +#ifndef __KERNEL__ +#include <asm-generic/int-l64.h> +#endif + +#endif /* _UAPI_ALPHA_TYPES_H */ diff --git a/arch/alpha/include/uapi/asm/unistd.h b/arch/alpha/include/uapi/asm/unistd.h new file mode 100644 index 00000000000..801d28bcea5 --- /dev/null +++ b/arch/alpha/include/uapi/asm/unistd.h @@ -0,0 +1,471 @@ +#ifndef _UAPI_ALPHA_UNISTD_H +#define _UAPI_ALPHA_UNISTD_H + +#define __NR_osf_syscall	  0	/* not implemented */ +#define __NR_exit		  1 +#define __NR_fork		  2 +#define __NR_read		  3 +#define __NR_write		  4 +#define __NR_osf_old_open	  5	/* not implemented */ +#define __NR_close		  6 +#define __NR_osf_wait4		  7 +#define __NR_osf_old_creat	  8	/* not implemented */ +#define __NR_link		  9 +#define __NR_unlink		 10 +#define __NR_osf_execve		 11	/* not implemented */ +#define __NR_chdir		 12 +#define __NR_fchdir		 13 +#define __NR_mknod		 14 +#define __NR_chmod		 15 +#define __NR_chown		 16 +#define __NR_brk		 17 +#define __NR_osf_getfsstat	 18	/* not implemented */ +#define __NR_lseek		 19 +#define __NR_getxpid		 20 +#define __NR_osf_mount		 21 +#define __NR_umount		 22 +#define __NR_setuid		 23 +#define __NR_getxuid		 24 +#define __NR_exec_with_loader	 25	/* not implemented */ +#define __NR_ptrace		 26 +#define __NR_osf_nrecvmsg	 27	/* not implemented */ +#define __NR_osf_nsendmsg	 28	/* not implemented */ +#define __NR_osf_nrecvfrom	 29	/* not implemented */ +#define __NR_osf_naccept	 30	/* not implemented */ +#define __NR_osf_ngetpeername	 31	/* not implemented */ +#define __NR_osf_ngetsockname	 32	/* not implemented */ +#define __NR_access		 33 +#define __NR_osf_chflags	 34	/* not implemented */ +#define __NR_osf_fchflags	 35	/* not implemented */ +#define __NR_sync		 36 +#define __NR_kill		 37 +#define __NR_osf_old_stat	 38	/* not implemented */ +#define __NR_setpgid		 39 +#define __NR_osf_old_lstat	 40	/* not implemented */ +#define __NR_dup		 41 +#define __NR_pipe		 42 +#define __NR_osf_set_program_attributes	43 +#define __NR_osf_profil		 44	/* not implemented */ +#define __NR_open		 45 +#define __NR_osf_old_sigaction	 46	/* not implemented */ +#define __NR_getxgid		 47 +#define __NR_osf_sigprocmask	 48 +#define __NR_osf_getlogin	 49	/* not implemented */ +#define __NR_osf_setlogin	 50	/* not implemented */ +#define __NR_acct		 51 +#define __NR_sigpending		 52 + +#define __NR_ioctl		 54 +#define __NR_osf_reboot		 55	/* not implemented */ +#define __NR_osf_revoke		 56	/* not implemented */ +#define __NR_symlink		 57 +#define __NR_readlink		 58 +#define __NR_execve		 59 +#define __NR_umask		 60 +#define __NR_chroot		 61 +#define __NR_osf_old_fstat	 62	/* not implemented */ +#define __NR_getpgrp		 63 +#define __NR_getpagesize	 64 +#define __NR_osf_mremap		 65	/* not implemented */ +#define __NR_vfork		 66 +#define __NR_stat		 67 +#define __NR_lstat		 68 +#define __NR_osf_sbrk		 69	/* not implemented */ +#define __NR_osf_sstk		 70	/* not implemented */ +#define __NR_mmap		 71	/* OSF/1 mmap is superset of Linux */ +#define __NR_osf_old_vadvise	 72	/* not implemented */ +#define __NR_munmap		 73 +#define __NR_mprotect		 74 +#define __NR_madvise		 75 +#define __NR_vhangup		 76 +#define __NR_osf_kmodcall	 77	/* not implemented */ +#define __NR_osf_mincore	 78	/* not implemented */ +#define __NR_getgroups		 79 +#define __NR_setgroups		 80 +#define __NR_osf_old_getpgrp	 81	/* not implemented */ +#define __NR_setpgrp		 82	/* BSD alias for setpgid */ +#define __NR_osf_setitimer	 83 +#define __NR_osf_old_wait	 84	/* not implemented */ +#define __NR_osf_table		 85	/* not implemented */ +#define __NR_osf_getitimer	 86 +#define __NR_gethostname	 87 +#define __NR_sethostname	 88 +#define __NR_getdtablesize	 89 +#define __NR_dup2		 90 +#define __NR_fstat		 91 +#define __NR_fcntl		 92 +#define __NR_osf_select		 93 +#define __NR_poll		 94 +#define __NR_fsync		 95 +#define __NR_setpriority	 96 +#define __NR_socket		 97 +#define __NR_connect		 98 +#define __NR_accept		 99 +#define __NR_getpriority	100 +#define __NR_send		101 +#define __NR_recv		102 +#define __NR_sigreturn		103 +#define __NR_bind		104 +#define __NR_setsockopt		105 +#define __NR_listen		106 +#define __NR_osf_plock		107	/* not implemented */ +#define __NR_osf_old_sigvec	108	/* not implemented */ +#define __NR_osf_old_sigblock	109	/* not implemented */ +#define __NR_osf_old_sigsetmask	110	/* not implemented */ +#define __NR_sigsuspend		111 +#define __NR_osf_sigstack	112 +#define __NR_recvmsg		113 +#define __NR_sendmsg		114 +#define __NR_osf_old_vtrace	115	/* not implemented */ +#define __NR_osf_gettimeofday	116 +#define __NR_osf_getrusage	117 +#define __NR_getsockopt		118 + +#define __NR_readv		120 +#define __NR_writev		121 +#define __NR_osf_settimeofday	122 +#define __NR_fchown		123 +#define __NR_fchmod		124 +#define __NR_recvfrom		125 +#define __NR_setreuid		126 +#define __NR_setregid		127 +#define __NR_rename		128 +#define __NR_truncate		129 +#define __NR_ftruncate		130 +#define __NR_flock		131 +#define __NR_setgid		132 +#define __NR_sendto		133 +#define __NR_shutdown		134 +#define __NR_socketpair		135 +#define __NR_mkdir		136 +#define __NR_rmdir		137 +#define __NR_osf_utimes		138 +#define __NR_osf_old_sigreturn	139	/* not implemented */ +#define __NR_osf_adjtime	140	/* not implemented */ +#define __NR_getpeername	141 +#define __NR_osf_gethostid	142	/* not implemented */ +#define __NR_osf_sethostid	143	/* not implemented */ +#define __NR_getrlimit		144 +#define __NR_setrlimit		145 +#define __NR_osf_old_killpg	146	/* not implemented */ +#define __NR_setsid		147 +#define __NR_quotactl		148 +#define __NR_osf_oldquota	149	/* not implemented */ +#define __NR_getsockname	150 + +#define __NR_osf_pid_block	153	/* not implemented */ +#define __NR_osf_pid_unblock	154	/* not implemented */ + +#define __NR_sigaction		156 +#define __NR_osf_sigwaitprim	157	/* not implemented */ +#define __NR_osf_nfssvc		158	/* not implemented */ +#define __NR_osf_getdirentries	159 +#define __NR_osf_statfs		160 +#define __NR_osf_fstatfs	161 + +#define __NR_osf_asynch_daemon	163	/* not implemented */ +#define __NR_osf_getfh		164	/* not implemented */	 +#define __NR_osf_getdomainname	165 +#define __NR_setdomainname	166 + +#define __NR_osf_exportfs	169	/* not implemented */ + +#define __NR_osf_alt_plock	181	/* not implemented */ + +#define __NR_osf_getmnt		184	/* not implemented */ + +#define __NR_osf_alt_sigpending	187	/* not implemented */ +#define __NR_osf_alt_setsid	188	/* not implemented */ + +#define __NR_osf_swapon		199 +#define __NR_msgctl		200 +#define __NR_msgget		201 +#define __NR_msgrcv		202 +#define __NR_msgsnd		203 +#define __NR_semctl		204 +#define __NR_semget		205 +#define __NR_semop		206 +#define __NR_osf_utsname	207 +#define __NR_lchown		208 +#define __NR_osf_shmat		209 +#define __NR_shmctl		210 +#define __NR_shmdt		211 +#define __NR_shmget		212 +#define __NR_osf_mvalid		213	/* not implemented */ +#define __NR_osf_getaddressconf	214	/* not implemented */ +#define __NR_osf_msleep		215	/* not implemented */ +#define __NR_osf_mwakeup	216	/* not implemented */ +#define __NR_msync		217 +#define __NR_osf_signal		218	/* not implemented */ +#define __NR_osf_utc_gettime	219	/* not implemented */ +#define __NR_osf_utc_adjtime	220	/* not implemented */ + +#define __NR_osf_security	222	/* not implemented */ +#define __NR_osf_kloadcall	223	/* not implemented */ + +#define __NR_osf_stat		224 +#define __NR_osf_lstat		225 +#define __NR_osf_fstat		226 +#define __NR_osf_statfs64	227 +#define __NR_osf_fstatfs64	228 + +#define __NR_getpgid		233 +#define __NR_getsid		234 +#define __NR_sigaltstack	235 +#define __NR_osf_waitid		236	/* not implemented */ +#define __NR_osf_priocntlset	237	/* not implemented */ +#define __NR_osf_sigsendset	238	/* not implemented */ +#define __NR_osf_set_speculative	239	/* not implemented */ +#define __NR_osf_msfs_syscall	240	/* not implemented */ +#define __NR_osf_sysinfo	241 +#define __NR_osf_uadmin		242	/* not implemented */ +#define __NR_osf_fuser		243	/* not implemented */ +#define __NR_osf_proplist_syscall    244 +#define __NR_osf_ntp_adjtime	245	/* not implemented */ +#define __NR_osf_ntp_gettime	246	/* not implemented */ +#define __NR_osf_pathconf	247	/* not implemented */ +#define __NR_osf_fpathconf	248	/* not implemented */ + +#define __NR_osf_uswitch	250	/* not implemented */ +#define __NR_osf_usleep_thread	251 +#define __NR_osf_audcntl	252	/* not implemented */ +#define __NR_osf_audgen		253	/* not implemented */ +#define __NR_sysfs		254 +#define __NR_osf_subsys_info	255	/* not implemented */ +#define __NR_osf_getsysinfo	256 +#define __NR_osf_setsysinfo	257 +#define __NR_osf_afs_syscall	258	/* not implemented */ +#define __NR_osf_swapctl	259	/* not implemented */ +#define __NR_osf_memcntl	260	/* not implemented */ +#define __NR_osf_fdatasync	261	/* not implemented */ + +/* + * Ignore legacy syscalls that we don't use. + */ +#define __IGNORE_alarm +#define __IGNORE_creat +#define __IGNORE_getegid +#define __IGNORE_geteuid +#define __IGNORE_getgid +#define __IGNORE_getpid +#define __IGNORE_getppid +#define __IGNORE_getuid +#define __IGNORE_pause +#define __IGNORE_time +#define __IGNORE_utime +#define __IGNORE_umount2 + +/* + * Linux-specific system calls begin at 300 + */ +#define __NR_bdflush		300 +#define __NR_sethae		301 +#define __NR_mount		302 +#define __NR_old_adjtimex	303 +#define __NR_swapoff		304 +#define __NR_getdents		305 +#define __NR_create_module	306 +#define __NR_init_module	307 +#define __NR_delete_module	308 +#define __NR_get_kernel_syms	309 +#define __NR_syslog		310 +#define __NR_reboot		311 +#define __NR_clone		312 +#define __NR_uselib		313 +#define __NR_mlock		314 +#define __NR_munlock		315 +#define __NR_mlockall		316 +#define __NR_munlockall		317 +#define __NR_sysinfo		318 +#define __NR__sysctl		319 +/* 320 was sys_idle.  */ +#define __NR_oldumount		321 +#define __NR_swapon		322 +#define __NR_times		323 +#define __NR_personality	324 +#define __NR_setfsuid		325 +#define __NR_setfsgid		326 +#define __NR_ustat		327 +#define __NR_statfs		328 +#define __NR_fstatfs		329 +#define __NR_sched_setparam		330 +#define __NR_sched_getparam		331 +#define __NR_sched_setscheduler		332 +#define __NR_sched_getscheduler		333 +#define __NR_sched_yield		334 +#define __NR_sched_get_priority_max	335 +#define __NR_sched_get_priority_min	336 +#define __NR_sched_rr_get_interval	337 +#define __NR_afs_syscall		338 +#define __NR_uname			339 +#define __NR_nanosleep			340 +#define __NR_mremap			341 +#define __NR_nfsservctl			342 +#define __NR_setresuid			343 +#define __NR_getresuid			344 +#define __NR_pciconfig_read		345 +#define __NR_pciconfig_write		346 +#define __NR_query_module		347 +#define __NR_prctl			348 +#define __NR_pread64			349 +#define __NR_pwrite64			350 +#define __NR_rt_sigreturn		351 +#define __NR_rt_sigaction		352 +#define __NR_rt_sigprocmask		353 +#define __NR_rt_sigpending		354 +#define __NR_rt_sigtimedwait		355 +#define __NR_rt_sigqueueinfo		356 +#define __NR_rt_sigsuspend		357 +#define __NR_select			358 +#define __NR_gettimeofday		359 +#define __NR_settimeofday		360 +#define __NR_getitimer			361 +#define __NR_setitimer			362 +#define __NR_utimes			363 +#define __NR_getrusage			364 +#define __NR_wait4			365 +#define __NR_adjtimex			366 +#define __NR_getcwd			367 +#define __NR_capget			368 +#define __NR_capset			369 +#define __NR_sendfile			370 +#define __NR_setresgid			371 +#define __NR_getresgid			372 +#define __NR_dipc			373 +#define __NR_pivot_root			374 +#define __NR_mincore			375 +#define __NR_pciconfig_iobase		376 +#define __NR_getdents64			377 +#define __NR_gettid			378 +#define __NR_readahead			379 +/* 380 is unused */ +#define __NR_tkill			381 +#define __NR_setxattr			382 +#define __NR_lsetxattr			383 +#define __NR_fsetxattr			384 +#define __NR_getxattr			385 +#define __NR_lgetxattr			386 +#define __NR_fgetxattr			387 +#define __NR_listxattr			388 +#define __NR_llistxattr			389 +#define __NR_flistxattr			390 +#define __NR_removexattr		391 +#define __NR_lremovexattr		392 +#define __NR_fremovexattr		393 +#define __NR_futex			394 +#define __NR_sched_setaffinity		395      +#define __NR_sched_getaffinity		396 +#define __NR_tuxcall			397 +#define __NR_io_setup			398 +#define __NR_io_destroy			399 +#define __NR_io_getevents		400 +#define __NR_io_submit			401 +#define __NR_io_cancel			402 +#define __NR_exit_group			405 +#define __NR_lookup_dcookie		406 +#define __NR_epoll_create		407 +#define __NR_epoll_ctl			408 +#define __NR_epoll_wait			409 +/* Feb 2007: These three sys_epoll defines shouldn't be here but culling + * them would break userspace apps ... we'll kill them off in 2010 :) */ +#define __NR_sys_epoll_create		__NR_epoll_create +#define __NR_sys_epoll_ctl		__NR_epoll_ctl +#define __NR_sys_epoll_wait		__NR_epoll_wait +#define __NR_remap_file_pages		410 +#define __NR_set_tid_address		411 +#define __NR_restart_syscall		412 +#define __NR_fadvise64			413 +#define __NR_timer_create		414 +#define __NR_timer_settime		415 +#define __NR_timer_gettime		416 +#define __NR_timer_getoverrun		417 +#define __NR_timer_delete		418 +#define __NR_clock_settime		419 +#define __NR_clock_gettime		420 +#define __NR_clock_getres		421 +#define __NR_clock_nanosleep		422 +#define __NR_semtimedop			423 +#define __NR_tgkill			424 +#define __NR_stat64			425 +#define __NR_lstat64			426 +#define __NR_fstat64			427 +#define __NR_vserver			428 +#define __NR_mbind			429 +#define __NR_get_mempolicy		430 +#define __NR_set_mempolicy		431 +#define __NR_mq_open			432 +#define __NR_mq_unlink			433 +#define __NR_mq_timedsend		434 +#define __NR_mq_timedreceive		435 +#define __NR_mq_notify			436 +#define __NR_mq_getsetattr		437 +#define __NR_waitid			438 +#define __NR_add_key			439 +#define __NR_request_key		440 +#define __NR_keyctl			441 +#define __NR_ioprio_set			442 +#define __NR_ioprio_get			443 +#define __NR_inotify_init		444 +#define __NR_inotify_add_watch		445 +#define __NR_inotify_rm_watch		446 +#define __NR_fdatasync			447 +#define __NR_kexec_load			448 +#define __NR_migrate_pages		449 +#define __NR_openat			450 +#define __NR_mkdirat			451 +#define __NR_mknodat			452 +#define __NR_fchownat			453 +#define __NR_futimesat			454 +#define __NR_fstatat64			455 +#define __NR_unlinkat			456 +#define __NR_renameat			457 +#define __NR_linkat			458 +#define __NR_symlinkat			459 +#define __NR_readlinkat			460 +#define __NR_fchmodat			461 +#define __NR_faccessat			462 +#define __NR_pselect6			463 +#define __NR_ppoll			464 +#define __NR_unshare			465 +#define __NR_set_robust_list		466 +#define __NR_get_robust_list		467 +#define __NR_splice			468 +#define __NR_sync_file_range		469 +#define __NR_tee			470 +#define __NR_vmsplice			471 +#define __NR_move_pages			472 +#define __NR_getcpu			473 +#define __NR_epoll_pwait		474 +#define __NR_utimensat			475 +#define __NR_signalfd			476 +#define __NR_timerfd			477 +#define __NR_eventfd			478 +#define __NR_recvmmsg			479 +#define __NR_fallocate			480 +#define __NR_timerfd_create		481 +#define __NR_timerfd_settime		482 +#define __NR_timerfd_gettime		483 +#define __NR_signalfd4			484 +#define __NR_eventfd2			485 +#define __NR_epoll_create1		486 +#define __NR_dup3			487 +#define __NR_pipe2			488 +#define __NR_inotify_init1		489 +#define __NR_preadv			490 +#define __NR_pwritev			491 +#define __NR_rt_tgsigqueueinfo		492 +#define __NR_perf_event_open		493 +#define __NR_fanotify_init		494 +#define __NR_fanotify_mark		495 +#define __NR_prlimit64			496 +#define __NR_name_to_handle_at		497 +#define __NR_open_by_handle_at		498 +#define __NR_clock_adjtime		499 +#define __NR_syncfs			500 +#define __NR_setns			501 +#define __NR_accept4			502 +#define __NR_sendmmsg			503 +#define __NR_process_vm_readv		504 +#define __NR_process_vm_writev		505 + +#endif /* _UAPI_ALPHA_UNISTD_H */ diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index ef757147cbf..edb4e0097b7 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -59,13 +59,13 @@ struct pci_controller *pci_isa_hose;   * Quirks.   */ -static void __devinit quirk_isa_bridge(struct pci_dev *dev) +static void quirk_isa_bridge(struct pci_dev *dev)  {  	dev->class = PCI_CLASS_BRIDGE_ISA << 8;  }  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82378, quirk_isa_bridge); -static void __devinit quirk_cypress(struct pci_dev *dev) +static void quirk_cypress(struct pci_dev *dev)  {  	/* The Notorious Cy82C693 chip.  */ @@ -104,7 +104,7 @@ static void __devinit quirk_cypress(struct pci_dev *dev)  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, quirk_cypress);  /* Called for each device after PCI setup is done. */ -static void __devinit pcibios_fixup_final(struct pci_dev *dev) +static void pcibios_fixup_final(struct pci_dev *dev)  {  	unsigned int class = dev->class >> 8; @@ -198,8 +198,7 @@ subsys_initcall(pcibios_init);  #ifdef ALPHA_RESTORE_SRM_SETUP  static struct pdev_srm_saved_conf *srm_saved_configs; -void __devinit -pdev_save_srm_config(struct pci_dev *dev) +void pdev_save_srm_config(struct pci_dev *dev)  {  	struct pdev_srm_saved_conf *tmp;  	static int printed = 0; @@ -241,8 +240,7 @@ pci_restore_srm_config(void)  }  #endif -void __devinit -pcibios_fixup_bus(struct pci_bus *bus) +void pcibios_fixup_bus(struct pci_bus *bus)  {  	struct pci_dev *dev = bus->self; diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c index 336393c9c11..02d02c047f1 100644 --- a/arch/alpha/kernel/signal.c +++ b/arch/alpha/kernel/signal.c @@ -122,12 +122,6 @@ SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask)  	return sigsuspend(&blocked);  } -asmlinkage int -sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) -{ -	return do_sigaltstack(uss, uoss, rdusp()); -} -  /*   * Do a signal return; undo the signal stack.   */ @@ -418,9 +412,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,  	err |= __put_user(0, &frame->uc.uc_flags);  	err |= __put_user(0, &frame->uc.uc_link);  	err |= __put_user(set->sig[0], &frame->uc.uc_osf_sigmask); -	err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); -	err |= __put_user(sas_ss_flags(oldsp), &frame->uc.uc_stack.ss_flags); -	err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); +	err |= __save_altstack(&frame->uc.uc_stack, oldsp);  	err |= setup_sigcontext(&frame->uc.uc_mcontext, regs,   				set->sig[0], oldsp);  	err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index a41ad90a97a..9603bc234b4 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -68,7 +68,7 @@ enum ipi_message_type {  };  /* Set to a secondary's cpuid when it comes online.  */ -static int smp_secondary_alive __devinitdata = 0; +static int smp_secondary_alive = 0;  int smp_num_probed;		/* Internal processor count */  int smp_num_cpus = 1;		/* Number that came online.  */ @@ -172,7 +172,7 @@ smp_callin(void)  }  /* Wait until hwrpb->txrdy is clear for cpu.  Return -1 on timeout.  */ -static int __devinit +static int  wait_for_txrdy (unsigned long cpumask)  {  	unsigned long timeout; @@ -468,7 +468,7 @@ smp_prepare_cpus(unsigned int max_cpus)  	smp_num_cpus = smp_num_probed;  } -void __devinit +void  smp_prepare_boot_cpu(void)  {  } diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c index 2533db280d9..5cf4a481b8c 100644 --- a/arch/alpha/kernel/sys_titan.c +++ b/arch/alpha/kernel/sys_titan.c @@ -303,7 +303,7 @@ titan_late_init(void)  } -static int __devinit +static int  titan_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)  {  	u8 intline; diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 8c83d98424c..67874b82a4e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -12,8 +12,6 @@ config ARM  	select GENERIC_CLOCKEVENTS_BROADCAST if SMP  	select GENERIC_IRQ_PROBE  	select GENERIC_IRQ_SHOW -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	select GENERIC_PCI_IOMAP  	select GENERIC_SMP_IDLE_THREAD  	select GENERIC_STRNCPY_FROM_USER @@ -373,7 +371,6 @@ config ARCH_CNS3XXX  config ARCH_CLPS711X  	bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"  	select ARCH_REQUIRE_GPIOLIB -	select ARCH_USES_GETTIMEOFFSET  	select AUTO_ZRELADDR  	select CLKDEV_LOOKUP  	select COMMON_CLK @@ -1232,6 +1229,7 @@ config ARM_ERRATA_430973  config ARM_ERRATA_458693  	bool "ARM errata: Processor deadlock when a false hazard is created"  	depends on CPU_V7 +	depends on !ARCH_MULTIPLATFORM  	help  	  This option enables the workaround for the 458693 Cortex-A8 (r2p0)  	  erratum. For very specific sequences of memory operations, it is @@ -1245,6 +1243,7 @@ config ARM_ERRATA_458693  config ARM_ERRATA_460075  	bool "ARM errata: Data written to the L2 cache can be overwritten with stale data"  	depends on CPU_V7 +	depends on !ARCH_MULTIPLATFORM  	help  	  This option enables the workaround for the 460075 Cortex-A8 (r2p0)  	  erratum. Any asynchronous access to the L2 cache may encounter a @@ -1257,6 +1256,7 @@ config ARM_ERRATA_460075  config ARM_ERRATA_742230  	bool "ARM errata: DMB operation may be faulty"  	depends on CPU_V7 && SMP +	depends on !ARCH_MULTIPLATFORM  	help  	  This option enables the workaround for the 742230 Cortex-A9  	  (r1p0..r2p2) erratum. Under rare circumstances, a DMB instruction @@ -1269,6 +1269,7 @@ config ARM_ERRATA_742230  config ARM_ERRATA_742231  	bool "ARM errata: Incorrect hazard handling in the SCU may lead to data corruption"  	depends on CPU_V7 && SMP +	depends on !ARCH_MULTIPLATFORM  	help  	  This option enables the workaround for the 742231 Cortex-A9  	  (r2p0..r2p2) erratum. Under certain conditions, specific to the @@ -1319,6 +1320,7 @@ config PL310_ERRATA_727915  config ARM_ERRATA_743622  	bool "ARM errata: Faulty hazard checking in the Store Buffer may lead to data corruption"  	depends on CPU_V7 +	depends on !ARCH_MULTIPLATFORM  	help  	  This option enables the workaround for the 743622 Cortex-A9  	  (r2p*) erratum. Under very rare conditions, a faulty @@ -1332,6 +1334,7 @@ config ARM_ERRATA_743622  config ARM_ERRATA_751472  	bool "ARM errata: Interrupted ICIALLUIS may prevent completion of broadcasted operation"  	depends on CPU_V7 +	depends on !ARCH_MULTIPLATFORM  	help  	  This option enables the workaround for the 751472 Cortex-A9 (prior  	  to r3p0) erratum. An interrupted ICIALLUIS operation may prevent the diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 49ca86e37b8..fe4d9c3ad76 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -44,7 +44,7 @@  #else -#include <mach/debug-macro.S> +#include CONFIG_DEBUG_LL_INCLUDE  		.macro	writeb,	ch, rb  		senduart \ch, \rb diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 0f441740c22..5ebb44fe826 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -42,11 +42,10 @@ dtb-$(CONFIG_ARCH_DOVE) += dove-cm-a510.dtb \  dtb-$(CONFIG_ARCH_EXYNOS) += exynos4210-origen.dtb \  	exynos4210-smdkv310.dtb \  	exynos4210-trats.dtb \ -	exynos5250-smdk5250.dtb \ -	exynos5440-ssdk5440.dtb \  	exynos4412-smdk4412.dtb \  	exynos5250-smdk5250.dtb \ -	exynos5250-snow.dtb +	exynos5250-snow.dtb \ +	exynos5440-ssdk5440.dtb  dtb-$(CONFIG_ARCH_HIGHBANK) += highbank.dtb \  	ecx-2000.dtb  dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \ @@ -107,6 +106,7 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \  	omap3-evm.dtb \  	omap3-tobi.dtb \  	omap4-panda.dtb \ +	omap4-panda-a4.dtb \  	omap4-panda-es.dtb \  	omap4-var-som.dtb \  	omap4-sdp.dtb \ @@ -131,8 +131,8 @@ dtb-$(CONFIG_ARCH_SPEAR3XX)+= spear300-evb.dtb \  	spear320-evb.dtb \  	spear320-hmi.dtb  dtb-$(CONFIG_ARCH_SPEAR6XX)+= spear600-evb.dtb -dtb-$(CONFIG_ARCH_SUNXI) += sun4i-cubieboard.dtb \ -	sun5i-olinuxino.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun4i-a10-cubieboard.dtb \ +	sun5i-a13-olinuxino.dtb  dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \  	tegra20-medcom-wide.dtb \  	tegra20-paz00.dtb \ @@ -155,6 +155,7 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \  dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb  targets += dtbs +targets += $(dtb-y)  endif  # *.dtb used to be generated in the directory above. Clean out the diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi index cf6c48a09ea..4c0abe85405 100644 --- a/arch/arm/boot/dts/armada-370-xp.dtsi +++ b/arch/arm/boot/dts/armada-370-xp.dtsi @@ -50,17 +50,19 @@  		ranges;  		serial@d0012000 { -				compatible = "ns16550"; +				compatible = "snps,dw-apb-uart";  				reg = <0xd0012000 0x100>;  				reg-shift = <2>;  				interrupts = <41>; +				reg-io-width = <4>;  				status = "disabled";  		};  		serial@d0012100 { -				compatible = "ns16550"; +				compatible = "snps,dw-apb-uart";  				reg = <0xd0012100 0x100>;  				reg-shift = <2>;  				interrupts = <42>; +				reg-io-width = <4>;  				status = "disabled";  		}; diff --git a/arch/arm/boot/dts/armada-xp-mv78230.dtsi b/arch/arm/boot/dts/armada-xp-mv78230.dtsi index c45c7b4dc35..271855a6e22 100644 --- a/arch/arm/boot/dts/armada-xp-mv78230.dtsi +++ b/arch/arm/boot/dts/armada-xp-mv78230.dtsi @@ -34,7 +34,14 @@  		reg = <0>;  		clocks = <&cpuclk 0>;  	    }; -	} + +	    cpu@1 { +		device_type = "cpu"; +		compatible = "marvell,sheeva-v7"; +		reg = <1>; +		clocks = <&cpuclk 1>; +	    }; +	};  	soc {  		pinctrl { diff --git a/arch/arm/boot/dts/armada-xp-mv78260.dtsi b/arch/arm/boot/dts/armada-xp-mv78260.dtsi index a2aee570737..1c1937dbce7 100644 --- a/arch/arm/boot/dts/armada-xp-mv78260.dtsi +++ b/arch/arm/boot/dts/armada-xp-mv78260.dtsi @@ -85,5 +85,13 @@  			#interrupts-cells = <2>;  			interrupts = <24>;  		}; + +		ethernet@d0034000 { +				compatible = "marvell,armada-370-neta"; +				reg = <0xd0034000 0x2500>; +				interrupts = <14>; +				clocks = <&gateclk 1>; +				status = "disabled"; +		};  	};  }; diff --git a/arch/arm/boot/dts/armada-xp-mv78460.dtsi b/arch/arm/boot/dts/armada-xp-mv78460.dtsi index da03a129243..4905cf3a5ef 100644 --- a/arch/arm/boot/dts/armada-xp-mv78460.dtsi +++ b/arch/arm/boot/dts/armada-xp-mv78460.dtsi @@ -100,5 +100,13 @@  			#interrupts-cells = <2>;  			interrupts = <24>;  		}; + +		ethernet@d0034000 { +				compatible = "marvell,armada-370-neta"; +				reg = <0xd0034000 0x2500>; +				interrupts = <14>; +				clocks = <&gateclk 1>; +				status = "disabled"; +		};  	};   }; diff --git a/arch/arm/boot/dts/armada-xp.dtsi b/arch/arm/boot/dts/armada-xp.dtsi index 367aa3f9491..2e37ef101c9 100644 --- a/arch/arm/boot/dts/armada-xp.dtsi +++ b/arch/arm/boot/dts/armada-xp.dtsi @@ -42,17 +42,19 @@  	soc {  		serial@d0012200 { -				compatible = "ns16550"; +				compatible = "snps,dw-apb-uart";  				reg = <0xd0012200 0x100>;  				reg-shift = <2>;  				interrupts = <43>; +				reg-io-width = <4>;  				status = "disabled";  		};  		serial@d0012300 { -				compatible = "ns16550"; +				compatible = "snps,dw-apb-uart";  				reg = <0xd0012300 0x100>;  				reg-shift = <2>;  				interrupts = <44>; +				reg-io-width = <4>;  				status = "disabled";  		}; @@ -93,14 +95,6 @@  				status = "disabled";  		}; -		ethernet@d0034000 { -				compatible = "marvell,armada-370-neta"; -				reg = <0xd0034000 0x2500>; -				interrupts = <14>; -				clocks = <&gateclk 1>; -				status = "disabled"; -		}; -  		xor@d0060900 {  			compatible = "marvell,orion-xor";  			reg = <0xd0060900 0x100 diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi index 68bccf41a2c..cb7bcc51608 100644 --- a/arch/arm/boot/dts/at91sam9260.dtsi +++ b/arch/arm/boot/dts/at91sam9260.dtsi @@ -306,6 +306,22 @@  					};  				}; +				ssc0 { +					pinctrl_ssc0_tx: ssc0_tx-0 { +						atmel,pins = +							<1 16 0x1 0x0	/* PB16 periph A */ +							 1 17 0x1 0x0	/* PB17 periph A */ +							 1 18 0x1 0x0>;	/* PB18 periph A */ +					}; + +					pinctrl_ssc0_rx: ssc0_rx-0 { +						atmel,pins = +							<1 19 0x1 0x0	/* PB19 periph A */ +							 1 20 0x1 0x0	/* PB20 periph A */ +							 1 21 0x1 0x0>;	/* PB21 periph A */ +					}; +				}; +  				pioA: gpio@fffff400 {  					compatible = "atmel,at91rm9200-gpio";  					reg = <0xfffff400 0x200>; @@ -450,6 +466,8 @@  				compatible = "atmel,at91rm9200-ssc";  				reg = <0xfffbc000 0x4000>;  				interrupts = <14 4 5>; +				pinctrl-names = "default"; +				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;  				status = "disabled";  			}; diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi index 8e6251f1f7a..271d4de026e 100644 --- a/arch/arm/boot/dts/at91sam9263.dtsi +++ b/arch/arm/boot/dts/at91sam9263.dtsi @@ -271,6 +271,38 @@  					};  				}; +				ssc0 { +					pinctrl_ssc0_tx: ssc0_tx-0 { +						atmel,pins = +							<1 0 0x2 0x0	/* PB0 periph B */ +							 1 1 0x2 0x0	/* PB1 periph B */ +							 1 2 0x2 0x0>;	/* PB2 periph B */ +					}; + +					pinctrl_ssc0_rx: ssc0_rx-0 { +						atmel,pins = +							<1 3 0x2 0x0	/* PB3 periph B */ +							 1 4 0x2 0x0	/* PB4 periph B */ +							 1 5 0x2 0x0>;	/* PB5 periph B */ +					}; +				}; + +				ssc1 { +					pinctrl_ssc1_tx: ssc1_tx-0 { +						atmel,pins = +							<1 6 0x1 0x0	/* PB6 periph A */ +							 1 7 0x1 0x0	/* PB7 periph A */ +							 1 8 0x1 0x0>;	/* PB8 periph A */ +					}; + +					pinctrl_ssc1_rx: ssc1_rx-0 { +						atmel,pins = +							<1 9 0x1 0x0	/* PB9 periph A */ +							 1 10 0x1 0x0	/* PB10 periph A */ +							 1 11 0x1 0x0>;	/* PB11 periph A */ +					}; +				}; +  				pioA: gpio@fffff200 {  					compatible = "atmel,at91rm9200-gpio";  					reg = <0xfffff200 0x200>; @@ -368,14 +400,18 @@  				compatible = "atmel,at91rm9200-ssc";  				reg = <0xfff98000 0x4000>;  				interrupts = <16 4 5>; -				status = "disable"; +				pinctrl-names = "default"; +				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; +				status = "disabled";  			};  			ssc1: ssc@fff9c000 {  				compatible = "atmel,at91rm9200-ssc";  				reg = <0xfff9c000 0x4000>;  				interrupts = <17 4 5>; -				status = "disable"; +				pinctrl-names = "default"; +				pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>; +				status = "disabled";  			};  			macb0: ethernet@fffbc000 { diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi index fa1ae0c5479..6b1d4cab24c 100644 --- a/arch/arm/boot/dts/at91sam9g45.dtsi +++ b/arch/arm/boot/dts/at91sam9g45.dtsi @@ -290,6 +290,38 @@  					};  				}; +				ssc0 { +					pinctrl_ssc0_tx: ssc0_tx-0 { +						atmel,pins = +							<3 0 0x1 0x0	/* PD0 periph A */ +							 3 1 0x1 0x0	/* PD1 periph A */ +							 3 2 0x1 0x0>;	/* PD2 periph A */ +					}; + +					pinctrl_ssc0_rx: ssc0_rx-0 { +						atmel,pins = +							<3 3 0x1 0x0	/* PD3 periph A */ +							 3 4 0x1 0x0	/* PD4 periph A */ +							 3 5 0x1 0x0>;	/* PD5 periph A */ +					}; +				}; + +				ssc1 { +					pinctrl_ssc1_tx: ssc1_tx-0 { +						atmel,pins = +							<3 10 0x1 0x0	/* PD10 periph A */ +							 3 11 0x1 0x0	/* PD11 periph A */ +							 3 12 0x1 0x0>;	/* PD12 periph A */ +					}; + +					pinctrl_ssc1_rx: ssc1_rx-0 { +						atmel,pins = +							<3 13 0x1 0x0	/* PD13 periph A */ +							 3 14 0x1 0x0	/* PD14 periph A */ +							 3 15 0x1 0x0>;	/* PD15 periph A */ +					}; +				}; +  				pioA: gpio@fffff200 {  					compatible = "atmel,at91rm9200-gpio";  					reg = <0xfffff200 0x200>; @@ -425,14 +457,18 @@  				compatible = "atmel,at91sam9g45-ssc";  				reg = <0xfff9c000 0x4000>;  				interrupts = <16 4 5>; -				status = "disable"; +				pinctrl-names = "default"; +				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; +				status = "disabled";  			};  			ssc1: ssc@fffa0000 {  				compatible = "atmel,at91sam9g45-ssc";  				reg = <0xfffa0000 0x4000>;  				interrupts = <17 4 5>; -				status = "disable"; +				pinctrl-names = "default"; +				pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>; +				status = "disabled";  			};  			adc0: adc@fffb0000 { diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi index e9efb34f437..80e29c605d4 100644 --- a/arch/arm/boot/dts/at91sam9n12.dtsi +++ b/arch/arm/boot/dts/at91sam9n12.dtsi @@ -28,6 +28,7 @@  		tcb1 = &tcb1;  		i2c0 = &i2c0;  		i2c1 = &i2c1; +		ssc0 = &ssc0;  	};  	cpus {  		cpu@0 { @@ -244,6 +245,22 @@  					};  				}; +				ssc0 { +					pinctrl_ssc0_tx: ssc0_tx-0 { +						atmel,pins = +							<0 24 0x2 0x0	/* PA24 periph B */ +							 0 25 0x2 0x0	/* PA25 periph B */ +							 0 26 0x2 0x0>;	/* PA26 periph B */ +					}; + +					pinctrl_ssc0_rx: ssc0_rx-0 { +						atmel,pins = +							<0 27 0x2 0x0	/* PA27 periph B */ +							 0 28 0x2 0x0	/* PA28 periph B */ +							 0 29 0x2 0x0>;	/* PA29 periph B */ +					}; +				}; +  				pioA: gpio@fffff400 {  					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";  					reg = <0xfffff400 0x200>; @@ -294,6 +311,15 @@  				status = "disabled";  			}; +			ssc0: ssc@f0010000 { +				compatible = "atmel,at91sam9g45-ssc"; +				reg = <0xf0010000 0x4000>; +				interrupts = <28 4 5>; +				pinctrl-names = "default"; +				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; +				status = "disabled"; +			}; +  			usart0: serial@f801c000 {  				compatible = "atmel,at91sam9260-usart";  				reg = <0xf801c000 0x4000>; diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi index 617ede541ca..3a47cf95214 100644 --- a/arch/arm/boot/dts/at91sam9x5.dtsi +++ b/arch/arm/boot/dts/at91sam9x5.dtsi @@ -88,13 +88,6 @@  				interrupts = <1 4 7>;  			}; -			ssc0: ssc@f0010000 { -				compatible = "atmel,at91sam9g45-ssc"; -				reg = <0xf0010000 0x4000>; -				interrupts = <28 4 5>; -				status = "disable"; -			}; -  			tcb0: timer@f8008000 {  				compatible = "atmel,at91sam9x5-tcb";  				reg = <0xf8008000 0x100>; @@ -290,6 +283,22 @@  					};  				}; +				ssc0 { +					pinctrl_ssc0_tx: ssc0_tx-0 { +						atmel,pins = +							<0 24 0x2 0x0	/* PA24 periph B */ +							 0 25 0x2 0x0	/* PA25 periph B */ +							 0 26 0x2 0x0>;	/* PA26 periph B */ +					}; + +					pinctrl_ssc0_rx: ssc0_rx-0 { +						atmel,pins = +							<0 27 0x2 0x0	/* PA27 periph B */ +							 0 28 0x2 0x0	/* PA28 periph B */ +							 0 29 0x2 0x0>;	/* PA29 periph B */ +					}; +				}; +  				pioA: gpio@fffff400 {  					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";  					reg = <0xfffff400 0x200>; @@ -333,6 +342,15 @@  				};  			}; +			ssc0: ssc@f0010000 { +				compatible = "atmel,at91sam9g45-ssc"; +				reg = <0xf0010000 0x4000>; +				interrupts = <28 4 5>; +				pinctrl-names = "default"; +				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; +				status = "disabled"; +			}; +  			mmc0: mmc@f0008000 {  				compatible = "atmel,hsmci";  				reg = <0xf0008000 0x600>; diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi index 2efd9c891bc..63f2fbcfe81 100644 --- a/arch/arm/boot/dts/dbx5x0.dtsi +++ b/arch/arm/boot/dts/dbx5x0.dtsi @@ -170,7 +170,9 @@  			gpio-bank = <8>;  		}; -		pinctrl { +		pinctrl@80157000 { +			// This is actually the PRCMU base address +			reg = <0x80157000 0x2000>;  			compatible = "stericsson,nmk_pinctrl";  		}; diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi index f3f7e9d8adc..42eac1ff3cc 100644 --- a/arch/arm/boot/dts/dove.dtsi +++ b/arch/arm/boot/dts/dove.dtsi @@ -117,6 +117,7 @@  		pinctrl: pinctrl@d0200 {  			compatible = "marvell,dove-pinctrl";  			reg = <0xd0200 0x10>; +			clocks = <&gate_clk 22>;  		};  		spi0: spi@10600 { diff --git a/arch/arm/boot/dts/ecx-2000.dts b/arch/arm/boot/dts/ecx-2000.dts index 46477ac1de9..139b40cc3a2 100644 --- a/arch/arm/boot/dts/ecx-2000.dts +++ b/arch/arm/boot/dts/ecx-2000.dts @@ -32,6 +32,7 @@  		cpu@0 {  			compatible = "arm,cortex-a15"; +			device_type = "cpu";  			reg = <0>;  			clocks = <&a9pll>;  			clock-names = "cpu"; @@ -39,6 +40,7 @@  		cpu@1 {  			compatible = "arm,cortex-a15"; +			device_type = "cpu";  			reg = <1>;  			clocks = <&a9pll>;  			clock-names = "cpu"; @@ -46,6 +48,7 @@  		cpu@2 {  			compatible = "arm,cortex-a15"; +			device_type = "cpu";  			reg = <2>;  			clocks = <&a9pll>;  			clock-names = "cpu"; @@ -53,6 +56,7 @@  		cpu@3 {  			compatible = "arm,cortex-a15"; +			device_type = "cpu";  			reg = <3>;  			clocks = <&a9pll>;  			clock-names = "cpu"; diff --git a/arch/arm/boot/dts/exynos4210-smdkv310.dts b/arch/arm/boot/dts/exynos4210-smdkv310.dts index 9b23a8255e3..f63490707f3 100644 --- a/arch/arm/boot/dts/exynos4210-smdkv310.dts +++ b/arch/arm/boot/dts/exynos4210-smdkv310.dts @@ -26,7 +26,7 @@  	};  	chosen { -		bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc"; +		bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc";  	};  	sdhci@12530000 { diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi index 2e3b6efaf1a..3acf594ea60 100644 --- a/arch/arm/boot/dts/exynos5250.dtsi +++ b/arch/arm/boot/dts/exynos5250.dtsi @@ -574,7 +574,7 @@  	hdmi {  		compatible = "samsung,exynos5-hdmi"; -		reg = <0x14530000 0x100000>; +		reg = <0x14530000 0x70000>;  		interrupts = <0 95 0>;  	}; diff --git a/arch/arm/boot/dts/exynos5440-ssdk5440.dts b/arch/arm/boot/dts/exynos5440-ssdk5440.dts index 921c83cf694..81e2c964a90 100644 --- a/arch/arm/boot/dts/exynos5440-ssdk5440.dts +++ b/arch/arm/boot/dts/exynos5440-ssdk5440.dts @@ -21,7 +21,7 @@  	};  	chosen { -		bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x81000000,8M console=ttySAC2,115200 init=/linuxrc"; +		bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x81000000,8M console=ttySAC0,115200 init=/linuxrc";  	};  	spi { diff --git a/arch/arm/boot/dts/highbank.dts b/arch/arm/boot/dts/highbank.dts index a9ae5d32e80..5927a8df562 100644 --- a/arch/arm/boot/dts/highbank.dts +++ b/arch/arm/boot/dts/highbank.dts @@ -30,33 +30,37 @@  		#address-cells = <1>;  		#size-cells = <0>; -		cpu@0 { +		cpu@900 {  			compatible = "arm,cortex-a9"; -			reg = <0>; +			device_type = "cpu"; +			reg = <0x900>;  			next-level-cache = <&L2>;  			clocks = <&a9pll>;  			clock-names = "cpu";  		}; -		cpu@1 { +		cpu@901 {  			compatible = "arm,cortex-a9"; -			reg = <1>; +			device_type = "cpu"; +			reg = <0x901>;  			next-level-cache = <&L2>;  			clocks = <&a9pll>;  			clock-names = "cpu";  		}; -		cpu@2 { +		cpu@902 {  			compatible = "arm,cortex-a9"; -			reg = <2>; +			device_type = "cpu"; +			reg = <0x902>;  			next-level-cache = <&L2>;  			clocks = <&a9pll>;  			clock-names = "cpu";  		}; -		cpu@3 { +		cpu@903 {  			compatible = "arm,cortex-a9"; -			reg = <3>; +			device_type = "cpu"; +			reg = <0x903>;  			next-level-cache = <&L2>;  			clocks = <&a9pll>;  			clock-names = "cpu"; diff --git a/arch/arm/boot/dts/imx23-olinuxino.dts b/arch/arm/boot/dts/imx23-olinuxino.dts index 7c43b8e70b9..e7484e4ea65 100644 --- a/arch/arm/boot/dts/imx23-olinuxino.dts +++ b/arch/arm/boot/dts/imx23-olinuxino.dts @@ -39,17 +39,17 @@  				hog_pins_a: hog@0 {  					reg = <0>;  					fsl,pinmux-ids = < -						0x2013 /* MX23_PAD_SSP1_DETECT__GPIO_2_1 */ +						0x0113 /* MX23_PAD_GPMI_ALE__GPIO_0_17 */  					>;  					fsl,drive-strength = <0>;  					fsl,voltage = <1>;  					fsl,pull-up = <0>;  				}; -				led_pin_gpio0_17: led_gpio0_17@0 { +				led_pin_gpio2_1: led_gpio2_1@0 {  					reg = <0>;  					fsl,pinmux-ids = < -						0x0113 /* MX23_PAD_GPMI_ALE__GPIO_0_17 */ +						0x2013 /* MX23_PAD_SSP1_DETECT__GPIO_2_1 */  					>;  					fsl,drive-strength = <0>;  					fsl,voltage = <1>; @@ -110,7 +110,7 @@  	leds {  		compatible = "gpio-leds";  		pinctrl-names = "default"; -		pinctrl-0 = <&led_pin_gpio0_17>; +		pinctrl-0 = <&led_pin_gpio2_1>;  		user {  			label = "green"; diff --git a/arch/arm/boot/dts/imx27-3ds.dts b/arch/arm/boot/dts/imx27-3ds.dts index b01c0d745fc..fa04c7b18bc 100644 --- a/arch/arm/boot/dts/imx27-3ds.dts +++ b/arch/arm/boot/dts/imx27-3ds.dts @@ -21,17 +21,17 @@  	};  	soc { -		aipi@10000000 { /* aipi */ - +		aipi@10000000 { /* aipi1 */  			uart1: serial@1000a000 {  				fsl,uart-has-rtscts;  				status = "okay";  			}; +		}; -			fec@1002b000 { +		aipi@10020000 { /* aipi2 */ +			ethernet@1002b000 {  				status = "okay";  			};  		};  	}; -  }; diff --git a/arch/arm/boot/dts/imx27-phytec-phycore.dts b/arch/arm/boot/dts/imx27-phytec-phycore.dts index af50469e34b..53b0ec0c228 100644 --- a/arch/arm/boot/dts/imx27-phytec-phycore.dts +++ b/arch/arm/boot/dts/imx27-phytec-phycore.dts @@ -21,8 +21,7 @@  	};  	soc { -		aipi@10000000 { /* aipi */ - +		aipi@10000000 { /* aipi1 */  			serial@1000a000 {  				fsl,uart-has-rtscts;  				status = "okay"; @@ -38,10 +37,6 @@  				status = "okay";  			}; -			ethernet@1002b000 { -				status = "okay"; -			}; -  			i2c@1001d000 {  				clock-frequency = <400000>;  				status = "okay"; @@ -60,6 +55,12 @@  				};  			};  		}; + +		aipi@10020000 { /* aipi2 */ +			ethernet@1002b000 { +				status = "okay"; +			}; +		};  	};  	nor_flash@c0000000 { diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi index b8d3905915a..5a82cb5707a 100644 --- a/arch/arm/boot/dts/imx27.dtsi +++ b/arch/arm/boot/dts/imx27.dtsi @@ -55,7 +55,7 @@  			compatible = "fsl,aipi-bus", "simple-bus";  			#address-cells = <1>;  			#size-cells = <1>; -			reg = <0x10000000 0x10000000>; +			reg = <0x10000000 0x20000>;  			ranges;  			wdog: wdog@10002000 { @@ -211,6 +211,15 @@  				status = "disabled";  			}; +		}; + +		aipi@10020000 { /* AIPI2 */ +			compatible = "fsl,aipi-bus", "simple-bus"; +			#address-cells = <1>; +			#size-cells = <1>; +			reg = <0x10020000 0x20000>; +			ranges; +  			fec: ethernet@1002b000 {  				compatible = "fsl,imx27-fec";  				reg = <0x1002b000 0x4000>; diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts b/arch/arm/boot/dts/imx28-cfa10049.dts index b222614ac9e..bdc80a4453d 100644 --- a/arch/arm/boot/dts/imx28-cfa10049.dts +++ b/arch/arm/boot/dts/imx28-cfa10049.dts @@ -92,6 +92,30 @@  				status = "okay";  			}; +			i2cmux { +				compatible = "i2c-mux-gpio"; +				#address-cells = <1>; +				#size-cells = <0>; +				mux-gpios = <&gpio1 22 0 &gpio1 23 0>; +				i2c-parent = <&i2c1>; + +				i2c@0 { +					reg = <0>; +				}; + +				i2c@1 { +					reg = <1>; +				}; + +				i2c@2 { +					reg = <2>; +				}; + +				i2c@3 { +					reg = <3>; +				}; +			}; +  			usbphy1: usbphy@8007e000 {  				status = "okay";  			}; diff --git a/arch/arm/boot/dts/imx31-bug.dts b/arch/arm/boot/dts/imx31-bug.dts index 24731cb78e8..7f67402328d 100644 --- a/arch/arm/boot/dts/imx31-bug.dts +++ b/arch/arm/boot/dts/imx31-bug.dts @@ -14,7 +14,7 @@  / {  	model = "Buglabs i.MX31 Bug 1.x"; -	compatible = "fsl,imx31-bug", "fsl,imx31"; +	compatible = "buglabs,imx31-bug", "fsl,imx31";  	memory {  		reg = <0x80000000 0x8000000>; /* 128M */ diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi index 552aed4ff98..edc3f1eb669 100644 --- a/arch/arm/boot/dts/imx53.dtsi +++ b/arch/arm/boot/dts/imx53.dtsi @@ -492,7 +492,7 @@  				compatible = "fsl,imx53-flexcan", "fsl,p1010-flexcan";  				reg = <0x53fcc000 0x4000>;  				interrupts = <83>; -				clocks = <&clks 158>, <&clks 157>; +				clocks = <&clks 87>, <&clks 86>;  				clock-names = "ipg", "per";  				status = "disabled";  			}; diff --git a/arch/arm/boot/dts/kirkwood-6282.dtsi b/arch/arm/boot/dts/kirkwood-6282.dtsi index 9ae2004d567..4ccea2130a6 100644 --- a/arch/arm/boot/dts/kirkwood-6282.dtsi +++ b/arch/arm/boot/dts/kirkwood-6282.dtsi @@ -39,6 +39,7 @@  			#size-cells = <0>;  			interrupts = <32>;  			clock-frequency = <100000>; +			clocks = <&gate_clk 7>;  			status = "disabled";  		};  	}; diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts index c0de5a7f660..cd15452a52a 100644 --- a/arch/arm/boot/dts/kirkwood-topkick.dts +++ b/arch/arm/boot/dts/kirkwood-topkick.dts @@ -82,4 +82,21 @@  			gpios = <&gpio1 16 1>;  		};  	}; +	regulators { +		compatible = "simple-bus"; +		#address-cells = <1>; +		#size-cells = <0>; + +		sata0_power: regulator@1 { +			compatible = "regulator-fixed"; +			reg = <1>; +			regulator-name = "SATA0 Power"; +			regulator-min-microvolt = <5000000>; +			regulator-max-microvolt = <5000000>; +			enable-active-high; +			regulator-always-on; +			regulator-boot-on; +			gpio = <&gpio1 4 0>; +		}; +	};  }; diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi index 7735cee4a9c..110d6cbb795 100644 --- a/arch/arm/boot/dts/kirkwood.dtsi +++ b/arch/arm/boot/dts/kirkwood.dtsi @@ -144,6 +144,7 @@  			compatible = "marvell,orion-ehci";  			reg = <0x50000 0x1000>;  			interrupts = <19>; +			clocks = <&gate_clk 3>;  			status = "okay";  		}; diff --git a/arch/arm/boot/dts/omap2420-h4.dts b/arch/arm/boot/dts/omap2420-h4.dts index 77b84e17c47..9b0d07746cb 100644 --- a/arch/arm/boot/dts/omap2420-h4.dts +++ b/arch/arm/boot/dts/omap2420-h4.dts @@ -15,6 +15,6 @@  	memory {  		device_type = "memory"; -		reg = <0x80000000 0x84000000>; /* 64 MB */ +		reg = <0x80000000 0x4000000>; /* 64 MB */  	};  }; diff --git a/arch/arm/boot/dts/spear13xx.dtsi b/arch/arm/boot/dts/spear13xx.dtsi index 009096d1d2c..b4ca60f4eb4 100644 --- a/arch/arm/boot/dts/spear13xx.dtsi +++ b/arch/arm/boot/dts/spear13xx.dtsi @@ -73,7 +73,7 @@  				400000  				500000  				600000 >; -		status = "disable"; +		status = "disabled";  	};  	ahb { @@ -118,15 +118,15 @@  			compatible = "st,spear600-fsmc-nand";  			#address-cells = <1>;  			#size-cells = <1>; -			reg = <0xb0000000 0x1000	/* FSMC Register */ -			       0xb0800000 0x0010>;	/* NAND Base */ -			reg-names = "fsmc_regs", "nand_data"; +			reg = <0xb0000000 0x1000	/* FSMC Register*/ +			       0xb0800000 0x0010	/* NAND Base DATA */ +			       0xb0820000 0x0010	/* NAND Base ADDR */ +			       0xb0810000 0x0010>;	/* NAND Base CMD */ +			reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";  			interrupts = <0 20 0x4  				      0 21 0x4  				      0 22 0x4  				      0 23 0x4>; -			st,ale-off = <0x20000>; -			st,cle-off = <0x10000>;  			st,mode = <2>;  			status = "disabled";  		}; @@ -144,7 +144,7 @@  			compatible = "st,pcm-audio";  			#address-cells = <0>;  			#size-cells = <0>; -			status = "disable"; +			status = "disabled";  		};  		smi: flash@ea000000 { diff --git a/arch/arm/boot/dts/spear300.dtsi b/arch/arm/boot/dts/spear300.dtsi index 090adc65601..f79b3dfaabe 100644 --- a/arch/arm/boot/dts/spear300.dtsi +++ b/arch/arm/boot/dts/spear300.dtsi @@ -38,10 +38,10 @@  			#address-cells = <1>;  			#size-cells = <1>;  			reg = <0x94000000 0x1000	/* FSMC Register */ -			       0x80000000 0x0010>;	/* NAND Base */ -			reg-names = "fsmc_regs", "nand_data"; -			st,ale-off = <0x20000>; -			st,cle-off = <0x10000>; +			       0x80000000 0x0010	/* NAND Base DATA */ +			       0x80020000 0x0010	/* NAND Base ADDR */ +			       0x80010000 0x0010>;	/* NAND Base CMD */ +			reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";  			status = "disabled";  		}; diff --git a/arch/arm/boot/dts/spear310.dtsi b/arch/arm/boot/dts/spear310.dtsi index e814e5e9708..ab45b8c8198 100644 --- a/arch/arm/boot/dts/spear310.dtsi +++ b/arch/arm/boot/dts/spear310.dtsi @@ -33,10 +33,10 @@  			#address-cells = <1>;  			#size-cells = <1>;  			reg = <0x44000000 0x1000	/* FSMC Register */ -			       0x40000000 0x0010>;	/* NAND Base */ -			reg-names = "fsmc_regs", "nand_data"; -			st,ale-off = <0x10000>; -			st,cle-off = <0x20000>; +			       0x40000000 0x0010	/* NAND Base DATA */ +			       0x40020000 0x0010	/* NAND Base ADDR */ +			       0x40010000 0x0010>;	/* NAND Base CMD */ +			reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";  			status = "disabled";  		}; diff --git a/arch/arm/boot/dts/spear320.dtsi b/arch/arm/boot/dts/spear320.dtsi index c056a84deab..caa5520b1fd 100644 --- a/arch/arm/boot/dts/spear320.dtsi +++ b/arch/arm/boot/dts/spear320.dtsi @@ -40,10 +40,10 @@  			#address-cells = <1>;  			#size-cells = <1>;  			reg = <0x4c000000 0x1000	/* FSMC Register */ -			       0x50000000 0x0010>;	/* NAND Base */ -			reg-names = "fsmc_regs", "nand_data"; -			st,ale-off = <0x20000>; -			st,cle-off = <0x10000>; +			       0x50000000 0x0010	/* NAND Base DATA */ +			       0x50020000 0x0010	/* NAND Base ADDR */ +			       0x50010000 0x0010>;	/* NAND Base CMD */ +			reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";  			status = "disabled";  		}; diff --git a/arch/arm/boot/dts/spear600.dtsi b/arch/arm/boot/dts/spear600.dtsi index e051dde5181..19f99dc4115 100644 --- a/arch/arm/boot/dts/spear600.dtsi +++ b/arch/arm/boot/dts/spear600.dtsi @@ -76,10 +76,10 @@  			#address-cells = <1>;  			#size-cells = <1>;  			reg = <0xd1800000 0x1000	/* FSMC Register */ -			       0xd2000000 0x4000>;	/* NAND Base */ -			reg-names = "fsmc_regs", "nand_data"; -			st,ale-off = <0x20000>; -			st,cle-off = <0x10000>; +			       0xd2000000 0x0010	/* NAND Base DATA */ +			       0xd2020000 0x0010	/* NAND Base ADDR */ +			       0xd2010000 0x0010>;	/* NAND Base CMD */ +			reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";  			status = "disabled";  		}; diff --git a/arch/arm/boot/dts/sun4i-cubieboard.dts b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts index f4ca126ad99..5cab8254043 100644 --- a/arch/arm/boot/dts/sun4i-cubieboard.dts +++ b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts @@ -11,11 +11,11 @@   */  /dts-v1/; -/include/ "sun4i.dtsi" +/include/ "sun4i-a10.dtsi"  / {  	model = "Cubietech Cubieboard"; -	compatible = "cubietech,cubieboard", "allwinner,sun4i"; +	compatible = "cubietech,a10-cubieboard", "allwinner,sun4i-a10";  	aliases {  		serial0 = &uart0; diff --git a/arch/arm/boot/dts/sun4i.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi index e61fdd47bd0..e61fdd47bd0 100644 --- a/arch/arm/boot/dts/sun4i.dtsi +++ b/arch/arm/boot/dts/sun4i-a10.dtsi diff --git a/arch/arm/boot/dts/sun5i-olinuxino.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts index d6ff889a5d8..498a091a4ea 100644 --- a/arch/arm/boot/dts/sun5i-olinuxino.dts +++ b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts @@ -12,11 +12,11 @@   */  /dts-v1/; -/include/ "sun5i.dtsi" +/include/ "sun5i-a13.dtsi"  / {  	model = "Olimex A13-Olinuxino"; -	compatible = "olimex,a13-olinuxino", "allwinner,sun5i"; +	compatible = "olimex,a13-olinuxino", "allwinner,sun5i-a13";  	chosen {  		bootargs = "earlyprintk console=ttyS0,115200"; diff --git a/arch/arm/boot/dts/sun5i.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi index 59a2d265a98..59a2d265a98 100644 --- a/arch/arm/boot/dts/sun5i.dtsi +++ b/arch/arm/boot/dts/sun5i-a13.dtsi diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi index 63411b03693..ed0bc954683 100644 --- a/arch/arm/boot/dts/twl4030.dtsi +++ b/arch/arm/boot/dts/twl4030.dtsi @@ -19,6 +19,10 @@  		interrupts = <11>;  	}; +	watchdog { +		compatible = "ti,twl4030-wdt"; +	}; +  	vdac: regulator-vdac {  		compatible = "ti,twl4030-vdac";  		regulator-min-microvolt = <1800000>; diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index 9173d112ea0..e57d7e5bf96 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c @@ -686,8 +686,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,   *	%-EINVAL	no platform data passed   *	%0		successful.   */ -static int __devinit -__sa1111_probe(struct device *me, struct resource *mem, int irq) +static int __sa1111_probe(struct device *me, struct resource *mem, int irq)  {  	struct sa1111_platform_data *pd = me->platform_data;  	struct sa1111 *sachip; @@ -1011,7 +1010,7 @@ static int sa1111_resume(struct platform_device *dev)  #define sa1111_resume  NULL  #endif -static int __devinit sa1111_probe(struct platform_device *pdev) +static int sa1111_probe(struct platform_device *pdev)  {  	struct resource *mem;  	int irq; diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c index 0c616d5fcb0..a5c3dc38aa1 100644 --- a/arch/arm/common/scoop.c +++ b/arch/arm/common/scoop.c @@ -176,7 +176,7 @@ static int scoop_resume(struct platform_device *dev)  #define scoop_resume	NULL  #endif -static int __devinit scoop_probe(struct platform_device *pdev) +static int scoop_probe(struct platform_device *pdev)  {  	struct scoop_dev *devptr;  	struct scoop_config *inf; @@ -243,7 +243,7 @@ err_ioremap:  	return ret;  } -static int __devexit scoop_remove(struct platform_device *pdev) +static int scoop_remove(struct platform_device *pdev)  {  	struct scoop_dev *sdev = platform_get_drvdata(pdev);  	int ret; @@ -268,7 +268,7 @@ static int __devexit scoop_remove(struct platform_device *pdev)  static struct platform_driver scoop_driver = {  	.probe		= scoop_probe, -	.remove		= __devexit_p(scoop_remove), +	.remove		= scoop_remove,  	.suspend	= scoop_suspend,  	.resume		= scoop_resume,  	.driver		= { diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c index e4df17ca90c..8f324b99416 100644 --- a/arch/arm/common/vic.c +++ b/arch/arm/common/vic.c @@ -206,6 +206,7 @@ static void __init vic_register(void __iomem *base, unsigned int irq,  				struct device_node *node)  {  	struct vic_device *v; +	int i;  	if (vic_id >= ARRAY_SIZE(vic_devices)) {  		printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__); @@ -220,6 +221,10 @@ static void __init vic_register(void __iomem *base, unsigned int irq,  	vic_id++;  	v->domain = irq_domain_add_simple(node, fls(valid_sources), irq,  					  &vic_irqdomain_ops, v); +	/* create an IRQ mapping for each valid IRQ */ +	for (i = 0; i < fls(valid_sources); i++) +		if (valid_sources & (1 << i)) +			irq_create_mapping(v->domain, i);  }  static void vic_ack_irq(struct irq_data *d) @@ -416,9 +421,9 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent)  		return -EIO;  	/* -	 * Passing -1 as first IRQ makes the simple domain allocate descriptors +	 * Passing 0 as first IRQ makes the simple domain allocate descriptors  	 */ -	__vic_init(regs, -1, ~0, ~0, node); +	__vic_init(regs, 0, ~0, ~0, node);  	return 0;  } diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index dbea6f4efe9..2eeff1e64b6 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig @@ -6,6 +6,7 @@ CONFIG_MACH_ARMADA_370=y  CONFIG_MACH_ARMADA_XP=y  CONFIG_ARCH_HIGHBANK=y  CONFIG_ARCH_SOCFPGA=y +CONFIG_ARCH_SUNXI=y  # CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA is not set  CONFIG_ARM_ERRATA_754322=y  CONFIG_SMP=y diff --git a/arch/arm/configs/mvebu_defconfig b/arch/arm/configs/mvebu_defconfig index a702fb345c0..b5bc96cb65a 100644 --- a/arch/arm/configs/mvebu_defconfig +++ b/arch/arm/configs/mvebu_defconfig @@ -33,9 +33,7 @@ CONFIG_MVNETA=y  CONFIG_MARVELL_PHY=y  CONFIG_SERIAL_8250=y  CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_I2C=y -CONFIG_I2C_MV64XXX=y +CONFIG_SERIAL_8250_DW=y  CONFIG_GPIOLIB=y  CONFIG_GPIO_SYSFS=y  # CONFIG_USB_SUPPORT is not set diff --git a/arch/arm/configs/nhk8815_defconfig b/arch/arm/configs/nhk8815_defconfig index 240b25eea56..86cfd2959c4 100644 --- a/arch/arm/configs/nhk8815_defconfig +++ b/arch/arm/configs/nhk8815_defconfig @@ -57,7 +57,7 @@ CONFIG_MTD_CHAR=y  CONFIG_MTD_BLOCK=y  CONFIG_MTD_NAND=y  CONFIG_MTD_NAND_ECC_SMC=y -CONFIG_MTD_NAND_NOMADIK=y +CONFIG_MTD_NAND_FSMC=y  CONFIG_MTD_ONENAND=y  CONFIG_MTD_ONENAND_VERIFY_WRITE=y  CONFIG_MTD_ONENAND_GENERIC=y diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig index a1dc5c071e7..82ce8d738fa 100644 --- a/arch/arm/configs/omap2plus_defconfig +++ b/arch/arm/configs/omap2plus_defconfig @@ -65,6 +65,8 @@ CONFIG_MAC80211_RC_PID=y  CONFIG_MAC80211_RC_DEFAULT_PID=y  CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"  CONFIG_CONNECTOR=y +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y  CONFIG_MTD=y  CONFIG_MTD_CMDLINE_PARTS=y  CONFIG_MTD_CHAR=y @@ -132,9 +134,11 @@ CONFIG_POWER_SUPPLY=y  CONFIG_WATCHDOG=y  CONFIG_OMAP_WATCHDOG=y  CONFIG_TWL4030_WATCHDOG=y +CONFIG_MFD_TPS65217=y  CONFIG_REGULATOR_TWL4030=y  CONFIG_REGULATOR_TPS65023=y  CONFIG_REGULATOR_TPS6507X=y +CONFIG_REGULATOR_TPS65217=y  CONFIG_FB=y  CONFIG_FIRMWARE_EDID=y  CONFIG_FB_MODE_HELPERS=y @@ -170,6 +174,7 @@ CONFIG_SND_DEBUG=y  CONFIG_SND_USB_AUDIO=m  CONFIG_SND_SOC=m  CONFIG_SND_OMAP_SOC=m +CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m  CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m  CONFIG_USB=y  CONFIG_USB_DEBUG=y diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index 67d06324e74..5b579b95150 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h @@ -91,6 +91,7 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)   */  static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)  { +	debug_dma_mapping_error(dev, dma_addr);  	return dma_addr == DMA_ERROR_CODE;  } diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h index 7cd13cc6262..21a2700d295 100644 --- a/arch/arm/include/asm/unistd.h +++ b/arch/arm/include/asm/unistd.h @@ -41,7 +41,6 @@  #define __ARCH_WANT_OLD_READDIR  #define __ARCH_WANT_SYS_SOCKETCALL  #endif -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_VFORK  #define __ARCH_WANT_SYS_CLONE diff --git a/arch/arm/include/uapi/asm/signal.h b/arch/arm/include/uapi/asm/signal.h index 921c57fdc52..33073bdcf09 100644 --- a/arch/arm/include/uapi/asm/signal.h +++ b/arch/arm/include/uapi/asm/signal.h @@ -87,13 +87,6 @@ typedef unsigned long sigset_t;  #define SA_NOMASK	SA_NODEFER  #define SA_ONESHOT	SA_RESETHAND - -/*  - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 -  #define MINSIGSTKSZ	2048  #define SIGSTKSZ	8192 diff --git a/arch/arm/include/uapi/asm/unistd.h b/arch/arm/include/uapi/asm/unistd.h index ac03bdb4ae4..4da7cde70b5 100644 --- a/arch/arm/include/uapi/asm/unistd.h +++ b/arch/arm/include/uapi/asm/unistd.h @@ -405,6 +405,7 @@  #define __NR_process_vm_readv		(__NR_SYSCALL_BASE+376)  #define __NR_process_vm_writev		(__NR_SYSCALL_BASE+377)  					/* 378 for kcmp */ +#define __NR_finit_module		(__NR_SYSCALL_BASE+379)  /*   * This may need to be greater than __NR_last_syscall+1 in order to diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index 9b722612553..379cf329239 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -78,7 +78,7 @@ void pcibios_report_status(u_int status_mask, int warn)   * Bug 3 is responsible for the sound DMA grinding to a halt.  We now   * live with bug 2.   */ -static void __devinit pci_fixup_83c553(struct pci_dev *dev) +static void pci_fixup_83c553(struct pci_dev *dev)  {  	/*  	 * Set memory region to start at address 0, and enable IO @@ -130,7 +130,7 @@ static void __devinit pci_fixup_83c553(struct pci_dev *dev)  }  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_83C553, pci_fixup_83c553); -static void __devinit pci_fixup_unassign(struct pci_dev *dev) +static void pci_fixup_unassign(struct pci_dev *dev)  {  	dev->resource[0].end -= dev->resource[0].start;  	dev->resource[0].start = 0; @@ -142,7 +142,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_ID_WINBOND2_89C940F,   * if it is the host bridge by marking it as such.  These resources are of   * no consequence to the PCI layer (they are handled elsewhere).   */ -static void __devinit pci_fixup_dec21285(struct pci_dev *dev) +static void pci_fixup_dec21285(struct pci_dev *dev)  {  	int i; @@ -161,7 +161,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21285, pci_fixup_d  /*   * PCI IDE controllers use non-standard I/O port decoding, respect it.   */ -static void __devinit pci_fixup_ide_bases(struct pci_dev *dev) +static void pci_fixup_ide_bases(struct pci_dev *dev)  {  	struct resource *r;  	int i; @@ -182,7 +182,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_ide_bases);  /*   * Put the DEC21142 to sleep   */ -static void __devinit pci_fixup_dec21142(struct pci_dev *dev) +static void pci_fixup_dec21142(struct pci_dev *dev)  {  	pci_write_config_dword(dev, 0x40, 0x80000000);  } @@ -204,7 +204,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21142, pci_fixup_d   * functional.  However, The CY82C693U _does not work_ in bus   * master mode without locking the PCI bus solid.   */ -static void __devinit pci_fixup_cy82c693(struct pci_dev *dev) +static void pci_fixup_cy82c693(struct pci_dev *dev)  {  	if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) {  		u32 base0, base1; @@ -254,7 +254,7 @@ static void __devinit pci_fixup_cy82c693(struct pci_dev *dev)  }  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, pci_fixup_cy82c693); -static void __devinit pci_fixup_it8152(struct pci_dev *dev) +static void pci_fixup_it8152(struct pci_dev *dev)  {  	int i;  	/* fixup for ITE 8152 devices */ @@ -361,9 +361,7 @@ void pcibios_fixup_bus(struct pci_bus *bus)  	printk(KERN_INFO "PCI: bus%d: Fast back to back transfers %sabled\n",  		bus->number, (features & PCI_COMMAND_FAST_BACK) ? "en" : "dis");  } -#ifdef CONFIG_HOTPLUG  EXPORT_SYMBOL(pcibios_fixup_bus); -#endif  /*   * Swizzle the device pin each time we cross a bridge.  If a platform does @@ -380,7 +378,7 @@ EXPORT_SYMBOL(pcibios_fixup_bus);   * PCI standard swizzle is implemented on plug-in cards and Cardbus based   * PCI extenders, so it can not be ignored.   */ -static u8 __devinit pcibios_swizzle(struct pci_dev *dev, u8 *pin) +static u8 pcibios_swizzle(struct pci_dev *dev, u8 *pin)  {  	struct pci_sys_data *sys = dev->sysdata;  	int slot, oldpin = *pin; diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index 5935b6a02e6..a4fda4e7a37 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S @@ -388,6 +388,7 @@  		CALL(sys_process_vm_readv)  		CALL(sys_process_vm_writev)  		CALL(sys_ni_syscall)	/* reserved for sys_kcmp */ +		CALL(sys_finit_module)  #ifndef syscalls_counted  .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls  #define syscalls_counted diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c index 36d20bd5012..9b6de8c988f 100644 --- a/arch/arm/kernel/etm.c +++ b/arch/arm/kernel/etm.c @@ -339,7 +339,7 @@ static struct miscdevice etb_miscdev = {  	.fops = &etb_fops,  }; -static int __devinit etb_probe(struct amba_device *dev, const struct amba_id *id) +static int etb_probe(struct amba_device *dev, const struct amba_id *id)  {  	struct tracectx *t = &tracer;  	int ret = 0; @@ -531,7 +531,7 @@ static ssize_t trace_mode_store(struct kobject *kobj,  static struct kobj_attribute trace_mode_attr =  	__ATTR(trace_mode, 0644, trace_mode_show, trace_mode_store); -static int __devinit etm_probe(struct amba_device *dev, const struct amba_id *id) +static int etm_probe(struct amba_device *dev, const struct amba_id *id)  {  	struct tracectx *t = &tracer;  	int ret = 0; diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c index 9a4f6307a01..5f6620684e2 100644 --- a/arch/arm/kernel/perf_event_cpu.c +++ b/arch/arm/kernel/perf_event_cpu.c @@ -132,7 +132,7 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler)  	return 0;  } -static void __devinit cpu_pmu_init(struct arm_pmu *cpu_pmu) +static void cpu_pmu_init(struct arm_pmu *cpu_pmu)  {  	int cpu;  	for_each_possible_cpu(cpu) { @@ -178,7 +178,7 @@ static struct notifier_block __cpuinitdata cpu_pmu_hotplug_notifier = {  /*   * PMU platform driver and devicetree bindings.   */ -static struct of_device_id __devinitdata cpu_pmu_of_device_ids[] = { +static struct of_device_id cpu_pmu_of_device_ids[] = {  	{.compatible = "arm,cortex-a15-pmu",	.data = armv7_a15_pmu_init},  	{.compatible = "arm,cortex-a9-pmu",	.data = armv7_a9_pmu_init},  	{.compatible = "arm,cortex-a8-pmu",	.data = armv7_a8_pmu_init}, @@ -190,7 +190,7 @@ static struct of_device_id __devinitdata cpu_pmu_of_device_ids[] = {  	{},  }; -static struct platform_device_id __devinitdata cpu_pmu_plat_device_ids[] = { +static struct platform_device_id cpu_pmu_plat_device_ids[] = {  	{.name = "arm-pmu"},  	{},  }; @@ -198,7 +198,7 @@ static struct platform_device_id __devinitdata cpu_pmu_plat_device_ids[] = {  /*   * CPU PMU identification and probing.   */ -static int __devinit probe_current_pmu(struct arm_pmu *pmu) +static int probe_current_pmu(struct arm_pmu *pmu)  {  	int cpu = get_cpu();  	unsigned long cpuid = read_cpuid_id(); @@ -252,7 +252,7 @@ static int __devinit probe_current_pmu(struct arm_pmu *pmu)  	return ret;  } -static int __devinit cpu_pmu_device_probe(struct platform_device *pdev) +static int cpu_pmu_device_probe(struct platform_device *pdev)  {  	const struct of_device_id *of_id;  	int (*init_fn)(struct arm_pmu *); diff --git a/arch/arm/kernel/perf_event_v6.c b/arch/arm/kernel/perf_event_v6.c index f3e22ff8b6a..041d0526a28 100644 --- a/arch/arm/kernel/perf_event_v6.c +++ b/arch/arm/kernel/perf_event_v6.c @@ -653,7 +653,7 @@ static int armv6_map_event(struct perf_event *event)  				&armv6_perf_cache_map, 0xFF);  } -static int __devinit armv6pmu_init(struct arm_pmu *cpu_pmu) +static int armv6pmu_init(struct arm_pmu *cpu_pmu)  {  	cpu_pmu->name		= "v6";  	cpu_pmu->handle_irq	= armv6pmu_handle_irq; @@ -685,7 +685,7 @@ static int armv6mpcore_map_event(struct perf_event *event)  				&armv6mpcore_perf_cache_map, 0xFF);  } -static int __devinit armv6mpcore_pmu_init(struct arm_pmu *cpu_pmu) +static int armv6mpcore_pmu_init(struct arm_pmu *cpu_pmu)  {  	cpu_pmu->name		= "v6mpcore";  	cpu_pmu->handle_irq	= armv6pmu_handle_irq; diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c index 7d0cce85d17..4fbc757d9cf 100644 --- a/arch/arm/kernel/perf_event_v7.c +++ b/arch/arm/kernel/perf_event_v7.c @@ -1226,7 +1226,7 @@ static void armv7pmu_init(struct arm_pmu *cpu_pmu)  	cpu_pmu->max_period	= (1LLU << 32) - 1;  }; -static u32 __devinit armv7_read_num_pmnc_events(void) +static u32 armv7_read_num_pmnc_events(void)  {  	u32 nb_cnt; @@ -1237,7 +1237,7 @@ static u32 __devinit armv7_read_num_pmnc_events(void)  	return nb_cnt + 1;  } -static int __devinit armv7_a8_pmu_init(struct arm_pmu *cpu_pmu) +static int armv7_a8_pmu_init(struct arm_pmu *cpu_pmu)  {  	armv7pmu_init(cpu_pmu);  	cpu_pmu->name		= "ARMv7 Cortex-A8"; @@ -1246,7 +1246,7 @@ static int __devinit armv7_a8_pmu_init(struct arm_pmu *cpu_pmu)  	return 0;  } -static int __devinit armv7_a9_pmu_init(struct arm_pmu *cpu_pmu) +static int armv7_a9_pmu_init(struct arm_pmu *cpu_pmu)  {  	armv7pmu_init(cpu_pmu);  	cpu_pmu->name		= "ARMv7 Cortex-A9"; @@ -1255,7 +1255,7 @@ static int __devinit armv7_a9_pmu_init(struct arm_pmu *cpu_pmu)  	return 0;  } -static int __devinit armv7_a5_pmu_init(struct arm_pmu *cpu_pmu) +static int armv7_a5_pmu_init(struct arm_pmu *cpu_pmu)  {  	armv7pmu_init(cpu_pmu);  	cpu_pmu->name		= "ARMv7 Cortex-A5"; @@ -1264,7 +1264,7 @@ static int __devinit armv7_a5_pmu_init(struct arm_pmu *cpu_pmu)  	return 0;  } -static int __devinit armv7_a15_pmu_init(struct arm_pmu *cpu_pmu) +static int armv7_a15_pmu_init(struct arm_pmu *cpu_pmu)  {  	armv7pmu_init(cpu_pmu);  	cpu_pmu->name		= "ARMv7 Cortex-A15"; @@ -1274,7 +1274,7 @@ static int __devinit armv7_a15_pmu_init(struct arm_pmu *cpu_pmu)  	return 0;  } -static int __devinit armv7_a7_pmu_init(struct arm_pmu *cpu_pmu) +static int armv7_a7_pmu_init(struct arm_pmu *cpu_pmu)  {  	armv7pmu_init(cpu_pmu);  	cpu_pmu->name		= "ARMv7 Cortex-A7"; diff --git a/arch/arm/kernel/perf_event_xscale.c b/arch/arm/kernel/perf_event_xscale.c index 0c8265e53d5..2b0fe30ec12 100644 --- a/arch/arm/kernel/perf_event_xscale.c +++ b/arch/arm/kernel/perf_event_xscale.c @@ -440,7 +440,7 @@ static int xscale_map_event(struct perf_event *event)  				&xscale_perf_cache_map, 0xFF);  } -static int __devinit xscale1pmu_init(struct arm_pmu *cpu_pmu) +static int xscale1pmu_init(struct arm_pmu *cpu_pmu)  {  	cpu_pmu->name		= "xscale1";  	cpu_pmu->handle_irq	= xscale1pmu_handle_irq; @@ -810,7 +810,7 @@ static inline void xscale2pmu_write_counter(struct perf_event *event, u32 val)  	}  } -static int __devinit xscale2pmu_init(struct arm_pmu *cpu_pmu) +static int xscale2pmu_init(struct arm_pmu *cpu_pmu)  {  	cpu_pmu->name		= "xscale2";  	cpu_pmu->handle_irq	= xscale2pmu_handle_irq; diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 9a89bf4aefe..3f6cbb2e3ed 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -733,7 +733,7 @@ void __init setup_arch(char **cmdline_p)  	setup_processor();  	mdesc = setup_machine_fdt(__atags_pointer);  	if (!mdesc) -		mdesc = setup_machine_tags(__atags_pointer, machine_arch_type); +		mdesc = setup_machine_tags(__atags_pointer, __machine_arch_type);  	machine_desc = mdesc;  	machine_name = mdesc->name; diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c index df745188f5d..ab1017bd166 100644 --- a/arch/arm/kernel/swp_emulate.c +++ b/arch/arm/kernel/swp_emulate.c @@ -109,10 +109,12 @@ static void set_segfault(struct pt_regs *regs, unsigned long addr)  {  	siginfo_t info; +	down_read(¤t->mm->mmap_sem);  	if (find_vma(current->mm, addr) == NULL)  		info.si_code = SEGV_MAPERR;  	else  		info.si_code = SEGV_ACCERR; +	up_read(¤t->mm->mmap_sem);  	info.si_signo = SIGSEGV;  	info.si_errno = 0; diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index b9f38e388b4..11c1785bf63 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -140,6 +140,8 @@ SECTIONS  	}  #endif +	NOTES +  	_etext = .;			/* End of text and rodata section */  #ifndef CONFIG_XIP_KERNEL @@ -295,8 +297,6 @@ SECTIONS  	}  #endif -	NOTES -  	BSS_SECTION(0, 0, 0)  	_end = .; diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 7211772edd9..0299915575a 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -41,6 +41,7 @@  #include <mach/cp_intc.h>  #include <mach/da8xx.h>  #include <mach/mux.h> +#include <mach/sram.h>  #include <asm/mach-types.h>  #include <asm/mach/arch.h> diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 9211e8800c7..6e2f1631df5 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c @@ -358,7 +358,7 @@ static int cpld_video_probe(struct i2c_client *client,  	return 0;  } -static int __devexit cpld_video_remove(struct i2c_client *client) +static int cpld_video_remove(struct i2c_client *client)  {  	cpld_client = NULL;  	return 0; diff --git a/arch/arm/mach-davinci/cdce949.c b/arch/arm/mach-davinci/cdce949.c index f2232ca6d07..abafb92031c 100644 --- a/arch/arm/mach-davinci/cdce949.c +++ b/arch/arm/mach-davinci/cdce949.c @@ -256,7 +256,7 @@ static int cdce_probe(struct i2c_client *client,  	return 0;  } -static int __devexit cdce_remove(struct i2c_client *client) +static int cdce_remove(struct i2c_client *client)  {  	cdce_i2c_client = NULL;  	return 0; @@ -274,7 +274,7 @@ static struct i2c_driver cdce_driver = {  		.name	= "cdce949",  	},  	.probe		= cdce_probe, -	.remove		= __devexit_p(cdce_remove), +	.remove		= cdce_remove,  	.id_table	= cdce_id,  }; diff --git a/arch/arm/mach-dove/pcie.c b/arch/arm/mach-dove/pcie.c index 0ef4435b165..8a275f29752 100644 --- a/arch/arm/mach-dove/pcie.c +++ b/arch/arm/mach-dove/pcie.c @@ -135,7 +135,7 @@ static struct pci_ops pcie_ops = {  	.write = pcie_wr_conf,  }; -static void __devinit rc_pci_fixup(struct pci_dev *dev) +static void rc_pci_fixup(struct pci_dev *dev)  {  	/*  	 * Prevent enumeration of root complex. diff --git a/arch/arm/mach-ep93xx/include/mach/uncompress.h b/arch/arm/mach-ep93xx/include/mach/uncompress.h index 16026c2b1c8..d64274fc576 100644 --- a/arch/arm/mach-ep93xx/include/mach/uncompress.h +++ b/arch/arm/mach-ep93xx/include/mach/uncompress.h @@ -47,13 +47,9 @@ static void __raw_writel(unsigned int value, unsigned int ptr)  static inline void putc(int c)  { -	int i; - -	for (i = 0; i < 1000; i++) { -		/* Transmit fifo not full?  */ -		if (!(__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF)) -			break; -	} +	/* Transmit fifo not full?  */ +	while (__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF) +		;  	__raw_writeb(c, PHYS_UART_DATA);  } diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 91d5b6f1d5a..e103c290bc9 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -74,6 +74,8 @@ config SOC_EXYNOS5440  	depends on ARCH_EXYNOS5  	select ARM_ARCH_TIMER  	select AUTO_ZRELADDR +	select PINCTRL +	select PINCTRL_EXYNOS5440  	help  	  Enable EXYNOS5440 SoC support diff --git a/arch/arm/mach-exynos/clock-exynos4.c b/arch/arm/mach-exynos/clock-exynos4.c index efead60b943..bbcb3dea0d4 100644 --- a/arch/arm/mach-exynos/clock-exynos4.c +++ b/arch/arm/mach-exynos/clock-exynos4.c @@ -529,7 +529,7 @@ static struct clk exynos4_init_clocks_off[] = {  		.enable		= exynos4_clk_ip_fsys_ctrl,  		.ctrlbit	= (1 << 8),  	}, { -		.name		= "dwmmc", +		.name		= "biu",  		.parent		= &exynos4_clk_aclk_133.clk,  		.enable		= exynos4_clk_ip_fsys_ctrl,  		.ctrlbit	= (1 << 9), @@ -1134,7 +1134,7 @@ static struct clksrc_clk exynos4_clksrcs[] = {  		.reg_div = { .reg = EXYNOS4_CLKDIV_MFC, .shift = 0, .size = 4 },  	}, {  		.clk	= { -			.name		= "sclk_dwmmc", +			.name		= "ciu",  			.parent		= &exynos4_clk_dout_mmc4.clk,  			.enable		= exynos4_clksrc_mask_fsys_ctrl,  			.ctrlbit	= (1 << 16), diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index ddd4b72c6f9..1a89824a5f7 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -424,11 +424,18 @@ static void __init exynos5_init_clocks(int xtal)  {  	printk(KERN_DEBUG "%s: initializing clocks\n", __func__); +	/* EXYNOS5440 can support only common clock framework */ + +	if (soc_is_exynos5440()) +		return; + +#ifdef CONFIG_SOC_EXYNOS5250  	s3c24xx_register_baseclocks(xtal);  	s5p_register_clocks(xtal);  	exynos5_register_clocks();  	exynos5_setup_clocks(); +#endif  }  #define COMBINER_ENABLE_SET	0x0 @@ -679,7 +686,8 @@ void __init exynos5_init_irq(void)  	 * Theses parameters should be NULL and 0 because EXYNOS4  	 * uses GIC instead of VIC.  	 */ -	s5p_init_irq(NULL, 0); +	if (!of_machine_is_compatible("samsung,exynos5440")) +		s5p_init_irq(NULL, 0);  	gic_arch_extn.irq_set_wake = s3c_irq_wake;  } diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index dac146df79a..04744f9c120 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -25,7 +25,7 @@ void exynos_init_late(void);  #ifdef CONFIG_PM_GENERIC_DOMAINS  int exynos_pm_late_initcall(void);  #else -static int exynos_pm_late_initcall(void) { return 0; } +static inline int exynos_pm_late_initcall(void) { return 0; }  #endif  #ifdef CONFIG_ARCH_EXYNOS4 diff --git a/arch/arm/mach-exynos/dev-audio.c b/arch/arm/mach-exynos/dev-audio.c index a1cb42c3959..9d1a60951d7 100644 --- a/arch/arm/mach-exynos/dev-audio.c +++ b/arch/arm/mach-exynos/dev-audio.c @@ -23,11 +23,6 @@  #include <mach/irqs.h>  #include <mach/regs-audss.h> -static const char *rclksrc[] = { -	[0] = "busclk", -	[1] = "i2sclk", -}; -  static int exynos4_cfg_i2s(struct platform_device *pdev)  {  	/* configure GPIO for i2s port */ @@ -55,7 +50,6 @@ static struct s3c_audio_pdata i2sv5_pdata = {  		.i2s = {  			.quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI  					 | QUIRK_NEED_RSTCLR, -			.src_clk = rclksrc,  			.idma_addr = EXYNOS4_AUDSS_INT_MEM,  		},  	}, @@ -78,17 +72,11 @@ struct platform_device exynos4_device_i2s0 = {  	},  }; -static const char *rclksrc_v3[] = { -	[0] = "sclk_i2s", -	[1] = "no_such_clock", -}; -  static struct s3c_audio_pdata i2sv3_pdata = {  	.cfg_gpio = exynos4_cfg_i2s,  	.type = {  		.i2s = {  			.quirks = QUIRK_NO_MUXPSR, -			.src_clk = rclksrc_v3,  		},  	},  }; diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index f038c8cadca..e99d3d8f2bc 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c @@ -163,6 +163,7 @@ static char const *exynos5_dt_compat[] __initdata = {  static void __init exynos5_reserve(void)  { +#ifdef CONFIG_S5P_DEV_MFC  	struct s5p_mfc_dt_meminfo mfc_mem;  	/* Reserve memory for MFC only if it's available */ @@ -170,6 +171,7 @@ static void __init exynos5_reserve(void)  	if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem))  		s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff,  				mfc_mem.lsize); +#endif  }  DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)") diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c index e6f4191cd14..5e34b9c1619 100644 --- a/arch/arm/mach-exynos/mach-origen.c +++ b/arch/arm/mach-exynos/mach-origen.c @@ -621,7 +621,7 @@ static struct pwm_lookup origen_pwm_lookup[] = {  	PWM_LOOKUP("s3c24xx-pwm.0", 0, "pwm-backlight.0", NULL),  }; -#ifdef CONFIG_DRM_EXYNOS +#ifdef CONFIG_DRM_EXYNOS_FIMD  static struct exynos_drm_fimd_pdata drm_fimd_pdata = {  	.panel	= {  		.timing	= { @@ -793,7 +793,7 @@ static void __init origen_machine_init(void)  	s5p_i2c_hdmiphy_set_platdata(NULL);  	s5p_hdmi_set_platdata(&hdmiphy_info, NULL, 0); -#ifdef CONFIG_DRM_EXYNOS +#ifdef CONFIG_DRM_EXYNOS_FIMD  	s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata;  	exynos4_fimd0_gpio_setup_24bpp();  #else diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c index a1555a73c7a..ae6da40c2aa 100644 --- a/arch/arm/mach-exynos/mach-smdk4x12.c +++ b/arch/arm/mach-exynos/mach-smdk4x12.c @@ -246,7 +246,7 @@ static struct samsung_keypad_platdata smdk4x12_keypad_data __initdata = {  	.cols		= 8,  }; -#ifdef CONFIG_DRM_EXYNOS +#ifdef CONFIG_DRM_EXYNOS_FIMD  static struct exynos_drm_fimd_pdata drm_fimd_pdata = {  	.panel	= {  		.timing	= { @@ -360,7 +360,7 @@ static void __init smdk4x12_machine_init(void)  	s3c_hsotg_set_platdata(&smdk4x12_hsotg_pdata); -#ifdef CONFIG_DRM_EXYNOS +#ifdef CONFIG_DRM_EXYNOS_FIMD  	s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata;  	exynos4_fimd0_gpio_setup_24bpp();  #else diff --git a/arch/arm/mach-exynos/mach-smdkv310.c b/arch/arm/mach-exynos/mach-smdkv310.c index b7384241fb0..35548e3c097 100644 --- a/arch/arm/mach-exynos/mach-smdkv310.c +++ b/arch/arm/mach-exynos/mach-smdkv310.c @@ -159,7 +159,7 @@ static struct platform_device smdkv310_lcd_lte480wv = {  	.dev.platform_data	= &smdkv310_lcd_lte480wv_data,  }; -#ifdef CONFIG_DRM_EXYNOS +#ifdef CONFIG_DRM_EXYNOS_FIMD  static struct exynos_drm_fimd_pdata drm_fimd_pdata = {  	.panel	= {  		.timing	= { @@ -402,7 +402,7 @@ static void __init smdkv310_machine_init(void)  	samsung_bl_set(&smdkv310_bl_gpio_info, &smdkv310_bl_data);  	pwm_add_table(smdkv310_pwm_lookup, ARRAY_SIZE(smdkv310_pwm_lookup)); -#ifdef CONFIG_DRM_EXYNOS +#ifdef CONFIG_DRM_EXYNOS_FIMD  	s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata;  	exynos4_fimd0_gpio_setup_24bpp();  #else diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index 4ca8ff14a5b..c5c840e947b 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -198,7 +198,7 @@ static void __init exynos_smp_prepare_cpus(unsigned int max_cpus)  {  	int i; -	if (!soc_is_exynos5250()) +	if (!(soc_is_exynos5250() || soc_is_exynos5440()))  		scu_enable(scu_base_addr());  	/* diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index dc248167d20..981dc1e1da5 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c @@ -135,7 +135,7 @@ static struct sys_timer highbank_timer = {  static void highbank_power_off(void)  { -	hignbank_set_pwr_shutdown(); +	highbank_set_pwr_shutdown();  	while (1)  		cpu_do_idle(); diff --git a/arch/arm/mach-highbank/hotplug.c b/arch/arm/mach-highbank/hotplug.c index 7b60faccd55..f30c5284339 100644 --- a/arch/arm/mach-highbank/hotplug.c +++ b/arch/arm/mach-highbank/hotplug.c @@ -30,7 +30,7 @@ void __ref highbank_cpu_die(unsigned int cpu)  {  	flush_cache_all(); -	highbank_set_cpu_jump(cpu, secondary_startup); +	highbank_set_cpu_jump(cpu, phys_to_virt(0));  	highbank_set_core_pwr();  	cpu_do_idle(); diff --git a/arch/arm/mach-highbank/platsmp.c b/arch/arm/mach-highbank/platsmp.c index 1129957f6c1..4ecc864ac8b 100644 --- a/arch/arm/mach-highbank/platsmp.c +++ b/arch/arm/mach-highbank/platsmp.c @@ -32,6 +32,7 @@ static void __cpuinit highbank_secondary_init(unsigned int cpu)  static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle)  { +	highbank_set_cpu_jump(cpu, secondary_startup);  	gic_raise_softirq(cpumask_of(cpu), 0);  	return 0;  } @@ -61,19 +62,8 @@ static void __init highbank_smp_init_cpus(void)  static void __init highbank_smp_prepare_cpus(unsigned int max_cpus)  { -	int i; -  	if (scu_base_addr)  		scu_enable(scu_base_addr); - -	/* -	 * Write the address of secondary startup into the jump table -	 * The cores are in wfi and wait until they receive a soft interrupt -	 * and a non-zero value to jump to. Then the secondary CPU branches -	 * to this address. -	 */ -	for (i = 1; i < max_cpus; i++) -		highbank_set_cpu_jump(i, secondary_startup);  }  struct smp_operations highbank_smp_ops __initdata = { diff --git a/arch/arm/mach-highbank/pm.c b/arch/arm/mach-highbank/pm.c index 74aa135966f..04eddb4f438 100644 --- a/arch/arm/mach-highbank/pm.c +++ b/arch/arm/mach-highbank/pm.c @@ -14,10 +14,12 @@   * this program.  If not, see <http://www.gnu.org/licenses/>.   */ +#include <linux/cpu_pm.h>  #include <linux/init.h>  #include <linux/io.h>  #include <linux/suspend.h> +#include <asm/cacheflush.h>  #include <asm/proc-fns.h>  #include <asm/suspend.h> @@ -26,16 +28,31 @@  static int highbank_suspend_finish(unsigned long val)  { +	outer_flush_all(); +	outer_disable(); + +	highbank_set_pwr_suspend(); +  	cpu_do_idle(); + +	highbank_clear_pwr_request();  	return 0;  }  static int highbank_pm_enter(suspend_state_t state)  { -	hignbank_set_pwr_suspend(); +	cpu_pm_enter(); +	cpu_cluster_pm_enter(); +  	highbank_set_cpu_jump(0, cpu_resume);  	cpu_suspend(0, highbank_suspend_finish); +	cpu_cluster_pm_exit(); +	cpu_pm_exit(); + +	highbank_smc1(0x102, 0x1); +	if (scu_base_addr) +		scu_enable(scu_base_addr);  	return 0;  } diff --git a/arch/arm/mach-highbank/sysregs.h b/arch/arm/mach-highbank/sysregs.h index e13e8ea7c6c..70af9d13fce 100644 --- a/arch/arm/mach-highbank/sysregs.h +++ b/arch/arm/mach-highbank/sysregs.h @@ -44,28 +44,43 @@ static inline void highbank_set_core_pwr(void)  		writel_relaxed(1, sregs_base + SREG_CPU_PWR_CTRL(cpu));  } -static inline void hignbank_set_pwr_suspend(void) +static inline void highbank_clear_core_pwr(void) +{ +	int cpu = cpu_logical_map(smp_processor_id()); +	if (scu_base_addr) +		scu_power_mode(scu_base_addr, SCU_PM_NORMAL); +	else +		writel_relaxed(0, sregs_base + SREG_CPU_PWR_CTRL(cpu)); +} + +static inline void highbank_set_pwr_suspend(void)  {  	writel(HB_PWR_SUSPEND, sregs_base + HB_SREG_A9_PWR_REQ);  	highbank_set_core_pwr();  } -static inline void hignbank_set_pwr_shutdown(void) +static inline void highbank_set_pwr_shutdown(void)  {  	writel(HB_PWR_SHUTDOWN, sregs_base + HB_SREG_A9_PWR_REQ);  	highbank_set_core_pwr();  } -static inline void hignbank_set_pwr_soft_reset(void) +static inline void highbank_set_pwr_soft_reset(void)  {  	writel(HB_PWR_SOFT_RESET, sregs_base + HB_SREG_A9_PWR_REQ);  	highbank_set_core_pwr();  } -static inline void hignbank_set_pwr_hard_reset(void) +static inline void highbank_set_pwr_hard_reset(void)  {  	writel(HB_PWR_HARD_RESET, sregs_base + HB_SREG_A9_PWR_REQ);  	highbank_set_core_pwr();  } +static inline void highbank_clear_pwr_request(void) +{ +	writel(~0UL, sregs_base + HB_SREG_A9_PWR_REQ); +	highbank_clear_core_pwr(); +} +  #endif diff --git a/arch/arm/mach-highbank/system.c b/arch/arm/mach-highbank/system.c index aed96ad9bd4..37d8384dcf1 100644 --- a/arch/arm/mach-highbank/system.c +++ b/arch/arm/mach-highbank/system.c @@ -22,9 +22,9 @@  void highbank_restart(char mode, const char *cmd)  {  	if (mode == 'h') -		hignbank_set_pwr_hard_reset(); +		highbank_set_pwr_hard_reset();  	else -		hignbank_set_pwr_soft_reset(); +		highbank_set_pwr_soft_reset();  	while (1)  		cpu_do_idle(); diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 1ad0d76de8c..3e628fd7a67 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -841,8 +841,6 @@ config SOC_IMX6Q  	select ARCH_HAS_CPUFREQ  	select ARCH_HAS_OPP  	select ARM_CPU_SUSPEND if PM -	select ARM_ERRATA_743622 -	select ARM_ERRATA_751472  	select ARM_ERRATA_754322  	select ARM_ERRATA_764369 if SMP  	select ARM_ERRATA_775420 diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c index e8c0473c756..579023f59dc 100644 --- a/arch/arm/mach-imx/clk-imx51-imx53.c +++ b/arch/arm/mach-imx/clk-imx51-imx53.c @@ -319,6 +319,7 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,  			unsigned long rate_ckih1, unsigned long rate_ckih2)  {  	int i; +	u32 val;  	struct device_node *np;  	clk[pll1_sw] = imx_clk_pllv2("pll1_sw", "osc", MX51_DPLL1_BASE); @@ -390,6 +391,21 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,  	imx_print_silicon_rev("i.MX51", mx51_revision());  	clk_disable_unprepare(clk[iim_gate]); +	/* +	 * Reference Manual says: Functionality of CCDR[18] and CLPCR[23] is no +	 * longer supported. Set to one for better power saving. +	 * +	 * The effect of not setting these bits is that MIPI clocks can't be +	 * enabled without the IPU clock being enabled aswell. +	 */ +	val = readl(MXC_CCM_CCDR); +	val |= 1 << 18; +	writel(val, MXC_CCM_CCDR); + +	val = readl(MXC_CCM_CLPCR); +	val |= 1 << 23; +	writel(val, MXC_CCM_CLPCR); +  	return 0;  } diff --git a/arch/arm/mach-imx/cpufreq.c b/arch/arm/mach-imx/cpufreq.c index 36e8b399447..d8c75c3c925 100644 --- a/arch/arm/mach-imx/cpufreq.c +++ b/arch/arm/mach-imx/cpufreq.c @@ -188,7 +188,7 @@ static struct cpufreq_driver mxc_driver = {  	.name = "imx",  }; -static int __devinit mxc_cpufreq_driver_init(void) +static int mxc_cpufreq_driver_init(void)  {  	return cpufreq_register_driver(&mxc_driver);  } diff --git a/arch/arm/plat-mxc/devices/platform-mx2-emma.c b/arch/arm/mach-imx/devices/platform-mx2-emma.c index 508404ddd4e..11bd01d402f 100644 --- a/arch/arm/plat-mxc/devices/platform-mx2-emma.c +++ b/arch/arm/mach-imx/devices/platform-mx2-emma.c @@ -6,8 +6,8 @@   * the terms of the GNU General Public License version 2 as published by the   * Free Software Foundation.   */ -#include <mach/hardware.h> -#include <mach/devices-common.h> +#include "../hardware.h" +#include "devices-common.h"  #define imx_mx2_emmaprp_data_entry_single(soc)				\  	{								\ diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index c461e98496c..7a9686ad994 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -21,7 +21,7 @@  #define BP_MMDC_MAPSR_PSD	0  #define BP_MMDC_MAPSR_PSS	4 -static int __devinit imx_mmdc_probe(struct platform_device *pdev) +static int imx_mmdc_probe(struct platform_device *pdev)  {  	struct device_node *np = pdev->dev.of_node;  	void __iomem *mmdc_base, *reg; diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c index 2f28018c444..9082b84aeeb 100644 --- a/arch/arm/mach-iop13xx/pci.c +++ b/arch/arm/mach-iop13xx/pci.c @@ -504,7 +504,7 @@ iop13xx_pci_abort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)  /* Scan an IOP13XX PCI bus.  nr selects which ATU we use.   */ -struct pci_bus * __devinit iop13xx_scan_bus(int nr, struct pci_sys_data *sys) +struct pci_bus *iop13xx_scan_bus(int nr, struct pci_sys_data *sys)  {  	int which_atu;  	struct pci_bus *bus = NULL; diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index ff4150a2ad0..de4fd2bb1e2 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c @@ -67,6 +67,10 @@ static void __init kirkwood_legacy_clk_init(void)  	orion_clkdev_add(NULL, "mv643xx_eth_port.1",  			 of_clk_get_from_provider(&clkspec)); +	clkspec.args[0] = CGC_BIT_SDIO; +	orion_clkdev_add(NULL, "mvsdio", +			 of_clk_get_from_provider(&clkspec)); +  }  static void __init kirkwood_of_clk_init(void) diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c index 15e69fcde9f..23d2dd1b1b1 100644 --- a/arch/arm/mach-kirkwood/board-usi_topkick.c +++ b/arch/arm/mach-kirkwood/board-usi_topkick.c @@ -64,8 +64,6 @@ static unsigned int topkick_mpp_config[] __initdata = {  	0  }; -#define TOPKICK_SATA0_PWR_ENABLE 36 -  void __init usi_topkick_init(void)  {  	/* @@ -73,8 +71,6 @@ void __init usi_topkick_init(void)  	 */  	kirkwood_mpp_conf(topkick_mpp_config); -	/* SATA0 power enable */ -	gpio_set_value(TOPKICK_SATA0_PWR_ENABLE, 1);  	kirkwood_ge00_init(&topkick_ge00_data);  	kirkwood_sdio_init(&topkick_mvsdio_data); diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c index ef102646ba9..a1c3ab6fc80 100644 --- a/arch/arm/mach-kirkwood/pcie.c +++ b/arch/arm/mach-kirkwood/pcie.c @@ -214,7 +214,7 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)   * PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on   * the device. Decoding setup is handled by the orion code.   */ -static void __devinit rc_pci_fixup(struct pci_dev *dev) +static void rc_pci_fixup(struct pci_dev *dev)  {  	if (dev->bus->parent == NULL && dev->devfn == 0) {  		int i; diff --git a/arch/arm/mach-ks8695/board-acs5k.c b/arch/arm/mach-ks8695/board-acs5k.c index 255502ddd87..b0c306ccbc6 100644 --- a/arch/arm/mach-ks8695/board-acs5k.c +++ b/arch/arm/mach-ks8695/board-acs5k.c @@ -92,7 +92,7 @@ static struct i2c_board_info acs5k_i2c_devs[] __initdata = {  	},  }; -static void __devinit acs5k_i2c_init(void) +static void acs5k_i2c_init(void)  {  	/* The gpio interface */  	platform_device_register(&acs5k_i2c_device); diff --git a/arch/arm/mach-mmp/sram.c b/arch/arm/mach-mmp/sram.c index a6c08ede449..bf5e64906e6 100644 --- a/arch/arm/mach-mmp/sram.c +++ b/arch/arm/mach-mmp/sram.c @@ -61,7 +61,7 @@ struct gen_pool *sram_get_gpool(char *pool_name)  }  EXPORT_SYMBOL(sram_get_gpool); -static int __devinit sram_probe(struct platform_device *pdev) +static int sram_probe(struct platform_device *pdev)  {  	struct sram_platdata *pdata = pdev->dev.platform_data;  	struct sram_bank_info *info; @@ -125,7 +125,7 @@ out:  	return ret;  } -static int __devexit sram_remove(struct platform_device *pdev) +static int sram_remove(struct platform_device *pdev)  {  	struct sram_bank_info *info; diff --git a/arch/arm/mach-msm/proc_comm.c b/arch/arm/mach-msm/proc_comm.c index 8f1eecd8818..507f5ca8069 100644 --- a/arch/arm/mach-msm/proc_comm.c +++ b/arch/arm/mach-msm/proc_comm.c @@ -120,7 +120,7 @@ int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2)   * and unknown state. This function should be called early to   * wait on the ARM9.   */ -void __devinit proc_comm_boot_wait(void) +void proc_comm_boot_wait(void)  {  	void __iomem *base = MSM_SHARED_RAM_BASE; diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c index c5a2eddc6cd..b1588a1ea2f 100644 --- a/arch/arm/mach-msm/smd.c +++ b/arch/arm/mach-msm/smd.c @@ -988,7 +988,7 @@ int smd_core_init(void)  	return 0;  } -static int __devinit msm_smd_probe(struct platform_device *pdev) +static int msm_smd_probe(struct platform_device *pdev)  {  	/*  	 * If we haven't waited for the ARM9 to boot up till now, diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c index a9a154a646d..ee8c0b51df2 100644 --- a/arch/arm/mach-mv78xx0/pcie.c +++ b/arch/arm/mach-mv78xx0/pcie.c @@ -173,7 +173,7 @@ static struct pci_ops pcie_ops = {  	.write = pcie_wr_conf,  }; -static void __devinit rc_pci_fixup(struct pci_dev *dev) +static void rc_pci_fixup(struct pci_dev *dev)  {  	/*  	 * Prevent enumeration of root complex. diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index 98070370d60..c66129b5dd1 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c @@ -240,7 +240,7 @@ static void __init update_fec_mac_prop(enum mac_oui oui)  		macaddr[4] = (val >> 8) & 0xff;  		macaddr[5] = (val >> 0) & 0xff; -		prom_update_property(np, newmac); +		of_update_property(np, newmac);  	}  } diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c index 5ccdf53c5a9..9f19069248d 100644 --- a/arch/arm/mach-nomadik/board-nhk8815.c +++ b/arch/arm/mach-nomadik/board-nhk8815.c @@ -19,6 +19,7 @@  #include <linux/gpio.h>  #include <linux/mtd/mtd.h>  #include <linux/mtd/nand.h> +#include <linux/mtd/fsmc.h>  #include <linux/mtd/onenand.h>  #include <linux/mtd/partitions.h>  #include <linux/i2c.h> @@ -26,14 +27,12 @@  #include <linux/pinctrl/machine.h>  #include <linux/platform_data/pinctrl-nomadik.h>  #include <linux/platform_data/clocksource-nomadik-mtu.h> -#include <linux/platform_data/mtd-nomadik-nand.h>  #include <asm/hardware/vic.h>  #include <asm/sizes.h>  #include <asm/mach-types.h>  #include <asm/mach/arch.h>  #include <asm/mach/flash.h>  #include <asm/mach/time.h> -#include <mach/fsmc.h>  #include <mach/irqs.h>  #include "cpu-8815.h" @@ -42,39 +41,34 @@  #define SRC_CR_INIT_MASK	0x00007fff  #define SRC_CR_INIT_VAL		0x2aaa8000 +#define ALE_OFF 0x1000000 +#define CLE_OFF 0x800000 +  /* These addresses span 16MB, so use three individual pages */  static struct resource nhk8815_nand_resources[] = {  	{ +		.name = "nand_data", +		.start = 0x40000000, +		.end = 0x40000000 + SZ_16K - 1, +		.flags = IORESOURCE_MEM, +	}, {  		.name = "nand_addr", -		.start = NAND_IO_ADDR, -		.end = NAND_IO_ADDR + 0xfff, +		.start = 0x40000000 + ALE_OFF, +		.end = 0x40000000 +ALE_OFF + SZ_16K - 1,  		.flags = IORESOURCE_MEM,  	}, {  		.name = "nand_cmd", -		.start = NAND_IO_CMD, -		.end = NAND_IO_CMD + 0xfff, +		.start = 0x40000000 + CLE_OFF, +		.end = 0x40000000 + CLE_OFF + SZ_16K - 1,  		.flags = IORESOURCE_MEM,  	}, { -		.name = "nand_data", -		.start = NAND_IO_DATA, -		.end = NAND_IO_DATA + 0xfff, +		.name  = "fsmc_regs", +		.start = NOMADIK_FSMC_BASE, +		.end   = NOMADIK_FSMC_BASE + SZ_4K - 1,  		.flags = IORESOURCE_MEM, -	} +	},  }; -static int nhk8815_nand_init(void) -{ -	/* FSMC setup for nand chip select (8-bit nand in 8815NHK) */ -	writel(0x0000000E, FSMC_PCR(0)); -	writel(0x000D0A00, FSMC_PMEM(0)); -	writel(0x00100A00, FSMC_PATT(0)); - -	/* enable access to the chip select area */ -	writel(readl(FSMC_PCR(0)) | 0x04, FSMC_PCR(0)); - -	return 0; -} -  /*   * These partitions are the same as those used in the 2.6.20 release   * shipped by the vendor; the first two partitions are mandated @@ -108,20 +102,28 @@ static struct mtd_partition nhk8815_partitions[] = {  	}  }; -static struct nomadik_nand_platform_data nhk8815_nand_data = { -	.parts		= nhk8815_partitions, -	.nparts		= ARRAY_SIZE(nhk8815_partitions), -	.options	= NAND_COPYBACK | NAND_CACHEPRG | NAND_NO_PADDING, -	.init		= nhk8815_nand_init, +static struct fsmc_nand_timings nhk8815_nand_timings = { +	.thiz	= 0, +	.thold	= 0x10, +	.twait	= 0x0A, +	.tset	= 0, +}; + +static struct fsmc_nand_platform_data nhk8815_nand_platform_data = { +	.nand_timings = &nhk8815_nand_timings, +	.partitions = nhk8815_partitions, +	.nr_partitions = ARRAY_SIZE(nhk8815_partitions), +	.width = FSMC_NAND_BW8,  };  static struct platform_device nhk8815_nand_device = { -	.name		= "nomadik_nand", -	.dev		= { -		.platform_data = &nhk8815_nand_data, +	.name = "fsmc-nand", +	.id = -1, +	.resource = nhk8815_nand_resources, +	.num_resources = ARRAY_SIZE(nhk8815_nand_resources), +	.dev = { +		.platform_data = &nhk8815_nand_platform_data,  	}, -	.resource	= nhk8815_nand_resources, -	.num_resources	= ARRAY_SIZE(nhk8815_nand_resources),  };  /* These are the partitions for the OneNand device, different from above */ @@ -176,6 +178,10 @@ static struct platform_device nhk8815_onenand_device = {  	.num_resources	= ARRAY_SIZE(nhk8815_onenand_resource),  }; +/* bus control reg. and bus timing reg. for CS0..CS3 */ +#define FSMC_BCR(x)	(NOMADIK_FSMC_VA + (x << 3)) +#define FSMC_BTR(x)	(NOMADIK_FSMC_VA + (x << 3) + 0x04) +  static void __init nhk8815_onenand_init(void)  {  #ifdef CONFIG_MTD_ONENAND diff --git a/arch/arm/mach-nomadik/include/mach/fsmc.h b/arch/arm/mach-nomadik/include/mach/fsmc.h deleted file mode 100644 index 8c2c0518368..00000000000 --- a/arch/arm/mach-nomadik/include/mach/fsmc.h +++ /dev/null @@ -1,29 +0,0 @@ - -/* Definitions for the Nomadik FSMC "Flexible Static Memory controller" */ - -#ifndef __ASM_ARCH_FSMC_H -#define __ASM_ARCH_FSMC_H - -#include <mach/hardware.h> -/* - * Register list - */ - -/* bus control reg. and bus timing reg. for CS0..CS3 */ -#define FSMC_BCR(x)     (NOMADIK_FSMC_VA + (x << 3)) -#define FSMC_BTR(x)     (NOMADIK_FSMC_VA + (x << 3) + 0x04) - -/* PC-card and NAND: - * PCR = control register - * PMEM = memory timing - * PATT = attribute timing - * PIO = I/O timing - * PECCR = ECC result - */ -#define FSMC_PCR(x)     (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x00) -#define FSMC_PMEM(x)    (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x08) -#define FSMC_PATT(x)    (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x0c) -#define FSMC_PIO(x)     (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x10) -#define FSMC_PECCR(x)   (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x14) - -#endif /* __ASM_ARCH_FSMC_H */ diff --git a/arch/arm/mach-nomadik/include/mach/irqs.h b/arch/arm/mach-nomadik/include/mach/irqs.h index b549d057154..215f8cdb400 100644 --- a/arch/arm/mach-nomadik/include/mach/irqs.h +++ b/arch/arm/mach-nomadik/include/mach/irqs.h @@ -22,49 +22,49 @@  #include <mach/hardware.h> -#define IRQ_VIC_START		1	/* first VIC interrupt is 1 */ +#define IRQ_VIC_START		32	/* first VIC interrupt is 1 */  /*   * Interrupt numbers generic for all Nomadik Chip cuts   */ -#define IRQ_WATCHDOG			1 -#define IRQ_SOFTINT			2 -#define IRQ_CRYPTO			3 -#define IRQ_OWM				4 -#define IRQ_MTU0			5 -#define IRQ_MTU1			6 -#define IRQ_GPIO0			7 -#define IRQ_GPIO1			8 -#define IRQ_GPIO2			9 -#define IRQ_GPIO3			10 -#define IRQ_RTC_RTT			11 -#define IRQ_SSP				12 -#define IRQ_UART0			13 -#define IRQ_DMA1			14 -#define IRQ_CLCD_MDIF			15 -#define IRQ_DMA0			16 -#define IRQ_PWRFAIL			17 -#define IRQ_UART1			18 -#define IRQ_FIRDA			19 -#define IRQ_MSP0			20 -#define IRQ_I2C0			21 -#define IRQ_I2C1			22 -#define IRQ_SDMMC			23 -#define IRQ_USBOTG			24 -#define IRQ_SVA_IT0			25 -#define IRQ_SVA_IT1			26 -#define IRQ_SAA_IT0			27 -#define IRQ_SAA_IT1			28 -#define IRQ_UART2			29 -#define IRQ_MSP2			30 -#define IRQ_L2CC			49 -#define IRQ_HPI				50 -#define IRQ_SKE				51 -#define IRQ_KP				52 -#define IRQ_MEMST			55 -#define IRQ_SGA_IT			59 -#define IRQ_USBM			61 -#define IRQ_MSP1			63 +#define IRQ_WATCHDOG			(IRQ_VIC_START+0) +#define IRQ_SOFTINT			(IRQ_VIC_START+1) +#define IRQ_CRYPTO			(IRQ_VIC_START+2) +#define IRQ_OWM				(IRQ_VIC_START+3) +#define IRQ_MTU0			(IRQ_VIC_START+4) +#define IRQ_MTU1			(IRQ_VIC_START+5) +#define IRQ_GPIO0			(IRQ_VIC_START+6) +#define IRQ_GPIO1			(IRQ_VIC_START+7) +#define IRQ_GPIO2			(IRQ_VIC_START+8) +#define IRQ_GPIO3			(IRQ_VIC_START+9) +#define IRQ_RTC_RTT			(IRQ_VIC_START+10) +#define IRQ_SSP				(IRQ_VIC_START+11) +#define IRQ_UART0			(IRQ_VIC_START+12) +#define IRQ_DMA1			(IRQ_VIC_START+13) +#define IRQ_CLCD_MDIF			(IRQ_VIC_START+14) +#define IRQ_DMA0			(IRQ_VIC_START+15) +#define IRQ_PWRFAIL			(IRQ_VIC_START+16) +#define IRQ_UART1			(IRQ_VIC_START+17) +#define IRQ_FIRDA			(IRQ_VIC_START+18) +#define IRQ_MSP0			(IRQ_VIC_START+19) +#define IRQ_I2C0			(IRQ_VIC_START+20) +#define IRQ_I2C1			(IRQ_VIC_START+21) +#define IRQ_SDMMC			(IRQ_VIC_START+22) +#define IRQ_USBOTG			(IRQ_VIC_START+23) +#define IRQ_SVA_IT0			(IRQ_VIC_START+24) +#define IRQ_SVA_IT1			(IRQ_VIC_START+25) +#define IRQ_SAA_IT0			(IRQ_VIC_START+26) +#define IRQ_SAA_IT1			(IRQ_VIC_START+27) +#define IRQ_UART2			(IRQ_VIC_START+28) +#define IRQ_MSP2			(IRQ_VIC_START+29) +#define IRQ_L2CC			(IRQ_VIC_START+30) +#define IRQ_HPI				(IRQ_VIC_START+31) +#define IRQ_SKE				(IRQ_VIC_START+32) +#define IRQ_KP				(IRQ_VIC_START+33) +#define IRQ_MEMST			(IRQ_VIC_START+34) +#define IRQ_SGA_IT			(IRQ_VIC_START+35) +#define IRQ_USBM			(IRQ_VIC_START+36) +#define IRQ_MSP1			(IRQ_VIC_START+37)  #define NOMADIK_GPIO_OFFSET		(IRQ_VIC_START+64) diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile index f0e69cbc5ba..222d58c0ae7 100644 --- a/arch/arm/mach-omap1/Makefile +++ b/arch/arm/mach-omap1/Makefile @@ -4,7 +4,7 @@  # Common support  obj-y := io.o id.o sram-init.o sram.o time.o irq.o mux.o flash.o \ -	 serial.o devices.o dma.o +	 serial.o devices.o dma.o fb.o  obj-y += clock.o clock_data.o opp_data.o reset.o pm_bus.o timer.o  ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),) diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index a8fce3ccc70..2e98a3ac7c5 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -160,7 +160,7 @@ static struct omap_lcd_config ams_delta_lcd_config __initdata = {  	.ctrl_name	= "internal",  }; -static struct omap_usb_config ams_delta_usb_config = { +static struct omap_usb_config ams_delta_usb_config __initdata = {  	.register_host	= 1,  	.hmc_mode	= 16,  	.pins[0]	= 2, diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index 3e8ead67e45..24d2f2df11a 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c @@ -112,17 +112,6 @@ static void __init mipid_dev_init(void)  	omapfb_set_lcd_config(&nokia770_lcd_config);  } -static void __init ads7846_dev_init(void) -{ -	if (gpio_request(ADS7846_PENDOWN_GPIO, "ADS7846 pendown") < 0) -		printk(KERN_ERR "can't get ads7846 pen down GPIO\n"); -} - -static int ads7846_get_pendown_state(void) -{ -	return !gpio_get_value(ADS7846_PENDOWN_GPIO); -} -  static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = {  	.x_max		= 0x0fff,  	.y_max		= 0x0fff, @@ -131,7 +120,7 @@ static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata =  	.debounce_max	= 10,  	.debounce_tol	= 3,  	.debounce_rep	= 1, -	.get_pendown_state	= ads7846_get_pendown_state, +	.gpio_pendown	= ADS7846_PENDOWN_GPIO,  };  static struct spi_board_info nokia770_spi_board_info[] __initdata = { @@ -241,7 +230,6 @@ static void __init omap_nokia770_init(void)  	omap_serial_init();  	omap_register_i2c_bus(1, 100, NULL, 0);  	hwa742_dev_init(); -	ads7846_dev_init();  	mipid_dev_init();  	omap1_usb_init(&nokia770_usb_config);  	nokia770_mmc_init(); diff --git a/arch/arm/mach-omap1/fb.c b/arch/arm/mach-omap1/fb.c new file mode 100644 index 00000000000..c770d45c722 --- /dev/null +++ b/arch/arm/mach-omap1/fb.c @@ -0,0 +1,80 @@ +/* + * File: arch/arm/plat-omap/fb.c + * + * Framebuffer device registration for TI OMAP platforms + * + * Copyright (C) 2006 Nokia Corporation + * Author: Imre Deak <imre.deak@nokia.com> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. + */ + +#include <linux/module.h> +#include <linux/kernel.h> +#include <linux/mm.h> +#include <linux/init.h> +#include <linux/platform_device.h> +#include <linux/memblock.h> +#include <linux/io.h> +#include <linux/omapfb.h> +#include <linux/dma-mapping.h> + +#include <asm/mach/map.h> + +#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) + +static bool omapfb_lcd_configured; +static struct omapfb_platform_data omapfb_config; + +static u64 omap_fb_dma_mask = ~(u32)0; + +static struct platform_device omap_fb_device = { +	.name		= "omapfb", +	.id		= -1, +	.dev = { +		.dma_mask		= &omap_fb_dma_mask, +		.coherent_dma_mask	= DMA_BIT_MASK(32), +		.platform_data		= &omapfb_config, +	}, +	.num_resources = 0, +}; + +void __init omapfb_set_lcd_config(const struct omap_lcd_config *config) +{ +	omapfb_config.lcd = *config; +	omapfb_lcd_configured = true; +} + +static int __init omap_init_fb(void) +{ +	/* +	 * If the board file has not set the lcd config with +	 * omapfb_set_lcd_config(), don't bother registering the omapfb device +	 */ +	if (!omapfb_lcd_configured) +		return 0; + +	return platform_device_register(&omap_fb_device); +} + +arch_initcall(omap_init_fb); + +#else + +void __init omapfb_set_lcd_config(const struct omap_lcd_config *config) +{ +} + +#endif diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c index e962926b67b..efc8f207f6f 100644 --- a/arch/arm/mach-omap1/mailbox.c +++ b/arch/arm/mach-omap1/mailbox.c @@ -142,7 +142,7 @@ static struct omap_mbox mbox_dsp_info = {  static struct omap_mbox *omap1_mboxes[] = { &mbox_dsp_info, NULL }; -static int __devinit omap1_mbox_probe(struct platform_device *pdev) +static int omap1_mbox_probe(struct platform_device *pdev)  {  	struct resource *mem;  	int ret; @@ -165,7 +165,7 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev)  	return 0;  } -static int __devexit omap1_mbox_remove(struct platform_device *pdev) +static int omap1_mbox_remove(struct platform_device *pdev)  {  	omap_mbox_unregister();  	iounmap(mbox_base); @@ -174,7 +174,7 @@ static int __devexit omap1_mbox_remove(struct platform_device *pdev)  static struct platform_driver omap1_mbox_driver = {  	.probe	= omap1_mbox_probe, -	.remove	= __devexit_p(omap1_mbox_remove), +	.remove	= omap1_mbox_remove,  	.driver	= {  		.name	= "omap-mailbox",  	}, diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c index 104fed366b8..1a1db5971cd 100644 --- a/arch/arm/mach-omap1/usb.c +++ b/arch/arm/mach-omap1/usb.c @@ -629,8 +629,14 @@ static void __init omap_1510_usb_init(struct omap_usb_config *config)  static inline void omap_1510_usb_init(struct omap_usb_config *config) {}  #endif -void __init omap1_usb_init(struct omap_usb_config *pdata) +void __init omap1_usb_init(struct omap_usb_config *_pdata)  { +	struct omap_usb_config *pdata; + +	pdata = kmemdup(_pdata, sizeof(*pdata), GFP_KERNEL); +	if (!pdata) +		return; +  	pdata->usb0_init = omap1_usb0_init;  	pdata->usb1_init = omap1_usb1_init;  	pdata->usb2_init = omap1_usb2_init; diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index be0f62bf903..41b581fd021 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -26,6 +26,8 @@ config SOC_HAS_OMAP2_SDRC  config SOC_HAS_REALTIME_COUNTER  	bool "Real time free running counter" +	depends on SOC_OMAP5 +	default y  config ARCH_OMAP2  	bool "TI OMAP2" @@ -79,7 +81,6 @@ config SOC_OMAP5  	select ARM_GIC  	select CPU_V7  	select HAVE_SMP -	select SOC_HAS_REALTIME_COUNTER  	select COMMON_CLK  comment "OMAP Core Type" diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index a8004f33b7e..947cafe65ae 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -3,7 +3,7 @@  #  # Common support -obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer.o pm.o \ +obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \  	 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \  	 omap_device.o sram.o diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 7b201546834..bb73afc9ac1 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -157,6 +157,7 @@ static struct omap_dss_device sdp3430_lcd_device = {  static struct tfp410_platform_data dvi_panel = {  	.power_down_gpio	= -1, +	.i2c_bus_num		= -1,  };  static struct omap_dss_device sdp3430_dvi_device = { diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 4be58fd071f..f81a303b87f 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -208,6 +208,7 @@ static struct omap_dss_device am3517_evm_tv_device = {  static struct tfp410_platform_data dvi_panel = {  	.power_down_gpio	= -1, +	.i2c_bus_num		= -1,  };  static struct omap_dss_device am3517_evm_dvi_device = { diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index c8e37dc0089..b3102c2f4a3 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -241,6 +241,7 @@ static struct omap_dss_device cm_t35_lcd_device = {  static struct tfp410_platform_data dvi_panel = {  	.power_down_gpio	= CM_T35_DVI_EN_GPIO, +	.i2c_bus_num		= -1,  };  static struct omap_dss_device cm_t35_dvi_device = { diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 7667eb74952..12865af25d3 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c @@ -141,6 +141,7 @@ static struct omap_dss_device devkit8000_lcd_device = {  static struct tfp410_platform_data dvi_panel = {  	.power_down_gpio	= -1, +	.i2c_bus_num		= 1,  };  static struct omap_dss_device devkit8000_dvi_device = { diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 9a3878ec225..3be1311f9e3 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c @@ -27,14 +27,12 @@  #include <linux/io.h>  #include <linux/input/matrix_keypad.h>  #include <linux/mfd/menelaus.h> +#include <linux/omap-dma.h>  #include <asm/mach-types.h>  #include <asm/mach/arch.h>  #include <asm/mach/map.h> -#include <linux/omap-dma.h> -#include <plat/debug-devices.h> -  #include <video/omapdss.h>  #include <video/omap-panel-generic-dpi.h> @@ -42,11 +40,9 @@  #include "mux.h"  #include "control.h"  #include "gpmc.h" +#include "gpmc-smc91x.h"  #define H4_FLASH_CS	0 -#define H4_SMC91X_CS	1 - -#define H4_ETHR_GPIO_IRQ		92  #if defined(CONFIG_KEYBOARD_MATRIX) || defined(CONFIG_KEYBOARD_MATRIX_MODULE)  static const uint32_t board_matrix_keys[] = { @@ -250,71 +246,31 @@ static u32 is_gpmc_muxed(void)  		return 0;  } -static inline void __init h4_init_debug(void) -{ -	int eth_cs; -	unsigned long cs_mem_base; -	unsigned int muxed, rate; -	struct clk *gpmc_fck; - -	eth_cs	= H4_SMC91X_CS; +#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE) -	gpmc_fck = clk_get(NULL, "gpmc_fck");	/* Always on ENABLE_ON_INIT */ -	if (IS_ERR(gpmc_fck)) { -		WARN_ON(1); -		return; -	} - -	clk_prepare_enable(gpmc_fck); -	rate = clk_get_rate(gpmc_fck); -	clk_disable_unprepare(gpmc_fck); -	clk_put(gpmc_fck); +static struct omap_smc91x_platform_data board_smc91x_data = { +	.cs		= 1, +	.gpio_irq	= 92, +	.flags		= GPMC_TIMINGS_SMC91C96 | IORESOURCE_IRQ_LOWLEVEL, +}; +static void __init board_smc91x_init(void) +{  	if (is_gpmc_muxed()) -		muxed = 0x200; -	else -		muxed = 0; - -	/* Make sure CS1 timings are correct */ -	gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG1, -			  0x00011000 | muxed); - -	if (rate >= 160000000) { -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f01); -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080803); -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1c0b1c0a); -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F); -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4); -	} else if (rate >= 130000000) { -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00); -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802); -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09); -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F); -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4); -	} else {/* rate = 100000000 */ -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00); -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802); -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09); -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x031A1F1F); -		gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000003C2); -	} - -	if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) { -		printk(KERN_ERR "Failed to request GPMC mem for smc91x\n"); -		goto out; -	} +		board_smc91x_data.flags |= GPMC_MUX_ADD_DATA; -	udelay(100); +	omap_mux_init_gpio(board_smc91x_data.gpio_irq, OMAP_PIN_INPUT); +	gpmc_smc91x_init(&board_smc91x_data); +} -	omap_mux_init_gpio(92, 0); -	if (debug_card_init(cs_mem_base, H4_ETHR_GPIO_IRQ) < 0) -		gpmc_cs_free(eth_cs); +#else -out: -	clk_disable_unprepare(gpmc_fck); -	clk_put(gpmc_fck); +static inline void board_smc91x_init(void) +{  } +#endif +  static void __init h4_init_flash(void)  {  	unsigned long base; @@ -371,6 +327,7 @@ static void __init omap_h4_init(void)  	omap_serial_init();  	omap_sdrc_init(NULL, NULL);  	h4_init_flash(); +	board_smc91x_init();  	omap_display_init(&h4_dss_data);  } diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index a4e167c55c1..0abb30fe399 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c @@ -16,10 +16,12 @@  #include <linux/gpio.h>  #include <linux/init.h>  #include <linux/io.h> +#include <linux/irq.h>  #include <linux/stddef.h>  #include <linux/i2c.h>  #include <linux/spi/spi.h>  #include <linux/usb/musb.h> +#include <linux/platform_data/i2c-cbus-gpio.h>  #include <linux/platform_data/spi-omap2-mcspi.h>  #include <linux/platform_data/mtd-onenand-omap2.h>  #include <linux/mfd/menelaus.h> @@ -40,6 +42,45 @@  #define TUSB6010_GPIO_ENABLE	0  #define TUSB6010_DMACHAN	0x3f +#if defined(CONFIG_I2C_CBUS_GPIO) || defined(CONFIG_I2C_CBUS_GPIO_MODULE) +static struct i2c_cbus_platform_data n8x0_cbus_data = { +	.clk_gpio = 66, +	.dat_gpio = 65, +	.sel_gpio = 64, +}; + +static struct platform_device n8x0_cbus_device = { +	.name	= "i2c-cbus-gpio", +	.id	= 3, +	.dev	= { +		.platform_data = &n8x0_cbus_data, +	}, +}; + +static struct i2c_board_info n8x0_i2c_board_info_3[] __initdata = { +	{ +		I2C_BOARD_INFO("retu-mfd", 0x01), +	}, +}; + +static void __init n8x0_cbus_init(void) +{ +	const int retu_irq_gpio = 108; + +	if (gpio_request_one(retu_irq_gpio, GPIOF_IN, "Retu IRQ")) +		return; +	irq_set_irq_type(gpio_to_irq(retu_irq_gpio), IRQ_TYPE_EDGE_RISING); +	n8x0_i2c_board_info_3[0].irq = gpio_to_irq(retu_irq_gpio); +	i2c_register_board_info(3, n8x0_i2c_board_info_3, +				ARRAY_SIZE(n8x0_i2c_board_info_3)); +	platform_device_register(&n8x0_cbus_device); +} +#else /* CONFIG_I2C_CBUS_GPIO */ +static void __init n8x0_cbus_init(void) +{ +} +#endif /* CONFIG_I2C_CBUS_GPIO */ +  #if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_TUSB6010_MODULE)  /*   * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and @@ -678,6 +719,7 @@ static void __init n8x0_init_machine(void)  	gpmc_onenand_init(board_onenand_data);  	n8x0_mmc_init();  	n8x0_usb_init(); +	n8x0_cbus_init();  }  MACHINE_START(NOKIA_N800, "Nokia N800") diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 54647d6286b..3985f35aee0 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -240,6 +240,7 @@ static struct omap_dss_device omap3_evm_tv_device = {  static struct tfp410_platform_data dvi_panel = {  	.power_down_gpio	= OMAP3EVM_DVI_PANEL_EN_GPIO, +	.i2c_bus_num		= -1,  };  static struct omap_dss_device omap3_evm_dvi_device = { diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c index d8638b3b4f9..53a6cbcf974 100644 --- a/arch/arm/mach-omap2/board-omap3stalker.c +++ b/arch/arm/mach-omap2/board-omap3stalker.c @@ -118,6 +118,7 @@ static struct omap_dss_device omap3_stalker_tv_device = {  static struct tfp410_platform_data dvi_panel = {  	.power_down_gpio	= DSS_ENABLE_GPIO, +	.i2c_bus_num		= -1,  };  static struct omap_dss_device omap3_stalker_dvi_device = { diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index 60529e0b3d6..cf07e289b4e 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c @@ -256,6 +256,11 @@ static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {  	},  }; +static struct platform_device rx51_battery_device = { +	.name	= "rx51-battery", +	.id	= -1, +}; +  static void rx51_charger_set_power(bool on)  {  	gpio_set_value(RX51_USB_TRANSCEIVER_RST_GPIO, on); @@ -277,6 +282,7 @@ static void __init rx51_charger_init(void)  	WARN_ON(gpio_request_one(RX51_USB_TRANSCEIVER_RST_GPIO,  		GPIOF_OUT_INIT_HIGH, "isp1704_reset")); +	platform_device_register(&rx51_battery_device);  	platform_device_register(&rx51_charger_device);  } diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c index bdf39481fbd..6ef87580c33 100644 --- a/arch/arm/mach-omap2/cclock3xxx_data.c +++ b/arch/arm/mach-omap2/cclock3xxx_data.c @@ -1167,6 +1167,8 @@ static const struct clk_ops emu_src_ck_ops = {  	.recalc_rate	= &omap2_clksel_recalc,  	.get_parent	= &omap2_clksel_find_parent_index,  	.set_parent	= &omap2_clksel_set_parent, +	.enable		= &omap2_clkops_enable_clkdm, +	.disable	= &omap2_clkops_disable_clkdm,  };  static struct clk emu_src_ck; diff --git a/arch/arm/mach-omap2/cclock44xx_data.c b/arch/arm/mach-omap2/cclock44xx_data.c index aa56c3e5bb3..5789a5e2556 100644 --- a/arch/arm/mach-omap2/cclock44xx_data.c +++ b/arch/arm/mach-omap2/cclock44xx_data.c @@ -40,6 +40,14 @@  #define OMAP4430_MODULEMODE_HWCTRL_SHIFT		0  #define OMAP4430_MODULEMODE_SWCTRL_SHIFT		1 +/* + * OMAP4 ABE DPLL default frequency. In OMAP4460 TRM version V, section + * "3.6.3.2.3 CM1_ABE Clock Generator" states that the "DPLL_ABE_X2_CLK + * must be set to 196.608 MHz" and hence, the DPLL locked frequency is + * half of this value. + */ +#define OMAP4_DPLL_ABE_DEFFREQ				98304000 +  /* Root clocks */  DEFINE_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0); @@ -124,6 +132,8 @@ static struct dpll_data dpll_abe_dd = {  	.enable_mask	= OMAP4430_DPLL_EN_MASK,  	.autoidle_mask	= OMAP4430_AUTO_DPLL_MODE_MASK,  	.idlest_mask	= OMAP4430_ST_DPLL_CLK_MASK, +	.m4xen_mask	= OMAP4430_DPLL_REGM4XEN_MASK, +	.lpmode_mask	= OMAP4430_DPLL_LPMODE_EN_MASK,  	.max_multiplier	= 2047,  	.max_divider	= 128,  	.min_divider	= 1, @@ -233,7 +243,7 @@ static struct dpll_data dpll_core_dd = {  static const char *dpll_core_ck_parents[] = { -	"sys_clkin_ck", +	"sys_clkin_ck", "core_hsd_byp_clk_mux_ck"  };  static struct clk dpll_core_ck; @@ -286,9 +296,9 @@ DEFINE_CLK_DIVIDER(div_core_ck, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck, 0x0,  		   OMAP4430_CM_CLKSEL_CORE, OMAP4430_CLKSEL_CORE_SHIFT,  		   OMAP4430_CLKSEL_CORE_WIDTH, 0x0, NULL); -DEFINE_CLK_OMAP_HSDIVIDER(div_iva_hs_clk, "dpll_core_m5x2_ck", -			  &dpll_core_m5x2_ck, 0x0, OMAP4430_CM_BYPCLK_DPLL_IVA, -			  OMAP4430_CLKSEL_0_1_MASK); +DEFINE_CLK_DIVIDER(div_iva_hs_clk, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck, +		   0x0, OMAP4430_CM_BYPCLK_DPLL_IVA, OMAP4430_CLKSEL_0_1_SHIFT, +		   OMAP4430_CLKSEL_0_1_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);  DEFINE_CLK_DIVIDER(div_mpu_hs_clk, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck,  		   0x0, OMAP4430_CM_BYPCLK_DPLL_MPU, OMAP4430_CLKSEL_0_1_SHIFT, @@ -363,8 +373,21 @@ static struct dpll_data dpll_iva_dd = {  	.min_divider	= 1,  }; +static const char *dpll_iva_ck_parents[] = { +	"sys_clkin_ck", "iva_hsd_byp_clk_mux_ck" +}; +  static struct clk dpll_iva_ck; +static const struct clk_ops dpll_ck_ops = { +	.enable		= &omap3_noncore_dpll_enable, +	.disable	= &omap3_noncore_dpll_disable, +	.recalc_rate	= &omap3_dpll_recalc, +	.round_rate	= &omap2_dpll_round_rate, +	.set_rate	= &omap3_noncore_dpll_set_rate, +	.get_parent	= &omap2_init_dpll_parent, +}; +  static struct clk_hw_omap dpll_iva_ck_hw = {  	.hw = {  		.clk = &dpll_iva_ck, @@ -373,7 +396,7 @@ static struct clk_hw_omap dpll_iva_ck_hw = {  	.ops		= &clkhwops_omap3_dpll,  }; -DEFINE_STRUCT_CLK(dpll_iva_ck, dpll_core_ck_parents, dpll_abe_ck_ops); +DEFINE_STRUCT_CLK(dpll_iva_ck, dpll_iva_ck_parents, dpll_ck_ops);  static const char *dpll_iva_x2_ck_parents[] = {  	"dpll_iva_ck", @@ -416,6 +439,10 @@ static struct dpll_data dpll_mpu_dd = {  	.min_divider	= 1,  }; +static const char *dpll_mpu_ck_parents[] = { +	"sys_clkin_ck", "div_mpu_hs_clk" +}; +  static struct clk dpll_mpu_ck;  static struct clk_hw_omap dpll_mpu_ck_hw = { @@ -426,7 +453,7 @@ static struct clk_hw_omap dpll_mpu_ck_hw = {  	.ops		= &clkhwops_omap3_dpll,  }; -DEFINE_STRUCT_CLK(dpll_mpu_ck, dpll_core_ck_parents, dpll_abe_ck_ops); +DEFINE_STRUCT_CLK(dpll_mpu_ck, dpll_mpu_ck_parents, dpll_ck_ops);  DEFINE_CLK_FIXED_FACTOR(mpu_periphclk, "dpll_mpu_ck", &dpll_mpu_ck, 0x0, 1, 2); @@ -464,6 +491,9 @@ static struct dpll_data dpll_per_dd = {  	.min_divider	= 1,  }; +static const char *dpll_per_ck_parents[] = { +	"sys_clkin_ck", "per_hsd_byp_clk_mux_ck" +};  static struct clk dpll_per_ck; @@ -475,7 +505,7 @@ static struct clk_hw_omap dpll_per_ck_hw = {  	.ops		= &clkhwops_omap3_dpll,  }; -DEFINE_STRUCT_CLK(dpll_per_ck, dpll_core_ck_parents, dpll_abe_ck_ops); +DEFINE_STRUCT_CLK(dpll_per_ck, dpll_per_ck_parents, dpll_ck_ops);  DEFINE_CLK_DIVIDER(dpll_per_m2_ck, "dpll_per_ck", &dpll_per_ck, 0x0,  		   OMAP4430_CM_DIV_M2_DPLL_PER, OMAP4430_DPLL_CLKOUT_DIV_SHIFT, @@ -559,6 +589,10 @@ static struct dpll_data dpll_usb_dd = {  	.min_divider	= 1,  }; +static const char *dpll_usb_ck_parents[] = { +	"sys_clkin_ck", "usb_hs_clk_div_ck" +}; +  static struct clk dpll_usb_ck;  static struct clk_hw_omap dpll_usb_ck_hw = { @@ -569,7 +603,7 @@ static struct clk_hw_omap dpll_usb_ck_hw = {  	.ops		= &clkhwops_omap3_dpll,  }; -DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_core_ck_parents, dpll_abe_ck_ops); +DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_usb_ck_parents, dpll_ck_ops);  static const char *dpll_usb_clkdcoldo_ck_parents[] = {  	"dpll_usb_ck", @@ -696,9 +730,13 @@ DEFINE_CLK_DIVIDER(syc_clk_div_ck, "sys_clkin_ck", &sys_clkin_ck, 0x0,  		   OMAP4430_CM_ABE_DSS_SYS_CLKSEL, OMAP4430_CLKSEL_0_0_SHIFT,  		   OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL); +static const char *dbgclk_mux_ck_parents[] = { +	"sys_clkin_ck" +}; +  static struct clk dbgclk_mux_ck;  DEFINE_STRUCT_CLK_HW_OMAP(dbgclk_mux_ck, NULL); -DEFINE_STRUCT_CLK(dbgclk_mux_ck, dpll_core_ck_parents, +DEFINE_STRUCT_CLK(dbgclk_mux_ck, dbgclk_mux_ck_parents,  		  dpll_usb_clkdcoldo_ck_ops);  /* Leaf clocks controlled by modules */ @@ -1935,10 +1973,10 @@ static struct omap_clk omap44xx_clks[] = {  	CLK("4803e000.timer",	"timer_sys_ck",	&sys_clkin_ck,	CK_443X),  	CLK("48086000.timer",	"timer_sys_ck",	&sys_clkin_ck,	CK_443X),  	CLK("48088000.timer",	"timer_sys_ck",	&sys_clkin_ck,	CK_443X), -	CLK("49038000.timer",	"timer_sys_ck",	&syc_clk_div_ck,	CK_443X), -	CLK("4903a000.timer",	"timer_sys_ck",	&syc_clk_div_ck,	CK_443X), -	CLK("4903c000.timer",	"timer_sys_ck",	&syc_clk_div_ck,	CK_443X), -	CLK("4903e000.timer",	"timer_sys_ck",	&syc_clk_div_ck,	CK_443X), +	CLK("40138000.timer",	"timer_sys_ck",	&syc_clk_div_ck,	CK_443X), +	CLK("4013a000.timer",	"timer_sys_ck",	&syc_clk_div_ck,	CK_443X), +	CLK("4013c000.timer",	"timer_sys_ck",	&syc_clk_div_ck,	CK_443X), +	CLK("4013e000.timer",	"timer_sys_ck",	&syc_clk_div_ck,	CK_443X),  	CLK(NULL,	"cpufreq_ck",	&dpll_mpu_ck,	CK_443X),  }; @@ -1955,6 +1993,7 @@ int __init omap4xxx_clk_init(void)  {  	u32 cpu_clkflg;  	struct omap_clk *c; +	int rc;  	if (cpu_is_omap443x()) {  		cpu_mask = RATE_IN_4430; @@ -1983,5 +2022,18 @@ int __init omap4xxx_clk_init(void)  	omap2_clk_enable_init_clocks(enable_init_clks,  				     ARRAY_SIZE(enable_init_clks)); +	/* +	 * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power +	 * state when turning the ABE clock domain. Workaround this by +	 * locking the ABE DPLL on boot. +	 */ +	if (cpu_is_omap446x()) { +		rc = clk_set_parent(&abe_dpll_refclk_mux_ck, &sys_32k_ck); +		if (!rc) +			rc = clk_set_rate(&dpll_abe_ck, OMAP4_DPLL_ABE_DEFFREQ); +		if (rc) +			pr_err("%s: failed to configure ABE DPLL!\n", __func__); +	} +  	return 0;  } diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index 9917f793c3b..b40204837bd 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h @@ -195,6 +195,10 @@ struct clksel {   * @enable_mask: mask of the DPLL mode bitfield in @control_reg   * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate()   * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate() + * @last_rounded_m4xen: cache of the last M4X result of + *			omap4_dpll_regm4xen_round_rate() + * @last_rounded_lpmode: cache of the last lpmode result of + *			 omap4_dpll_lpmode_recalc()   * @max_multiplier: maximum valid non-bypass multiplier value (actual)   * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()   * @min_divider: minimum valid non-bypass divider value (actual) @@ -205,6 +209,8 @@ struct clksel {   * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg   * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg   * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg + * @lpmode_mask: mask of the DPLL low-power mode bitfield in @control_reg + * @m4xen_mask: mask of the DPLL M4X multiplier bitfield in @control_reg   * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg   * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs   * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs @@ -233,6 +239,8 @@ struct dpll_data {  	u32			enable_mask;  	unsigned long		last_rounded_rate;  	u16			last_rounded_m; +	u8			last_rounded_m4xen; +	u8			last_rounded_lpmode;  	u16			max_multiplier;  	u8			last_rounded_n;  	u8			min_divider; @@ -245,6 +253,8 @@ struct dpll_data {  	u32			idlest_mask;  	u32			dco_mask;  	u32			sddiv_mask; +	u32			lpmode_mask; +	u32			m4xen_mask;  	u8			auto_recal_bit;  	u8			recal_en_bit;  	u8			recal_st_bit; diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index 384873580b2..7faf82d4e85 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c @@ -998,7 +998,8 @@ int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)  	spin_lock_irqsave(&clkdm->lock, flags);  	/* corner case: disabling unused clocks */ -	if (__clk_get_enable_count(clk) == 0) +	if ((__clk_get_enable_count(clk) == 0) && +	    (atomic_read(&clkdm->usecount) == 0))  		goto ccd_exit;  	if (atomic_read(&clkdm->usecount) == 0) { diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c index 5c2fd4863b2..2dabb9ecb98 100644 --- a/arch/arm/mach-omap2/common.c +++ b/arch/arm/mach-omap2/common.c @@ -16,8 +16,6 @@  #include <linux/init.h>  #include <linux/platform_data/dsp-omap.h> -#include <plat/vram.h> -  #include "common.h"  #include "omap-secure.h" @@ -32,7 +30,6 @@ int __weak omap_secure_ram_reserve_memblock(void)  void __init omap_reserve(void)  { -	omap_vram_reserve_sdram_memblock();  	omap_dsp_reserve_sdram_memblock();  	omap_secure_ram_reserve_memblock();  	omap_barrier_reserve_memblock(); diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h index 3d944d3263d..e6c328128a0 100644 --- a/arch/arm/mach-omap2/control.h +++ b/arch/arm/mach-omap2/control.h @@ -234,7 +234,7 @@  #define OMAP343X_PADCONF_ETK_D14	OMAP343X_PADCONF_ETK(16)  #define OMAP343X_PADCONF_ETK_D15	OMAP343X_PADCONF_ETK(17) -/* 34xx GENERAL_WKUP regist offsets */ +/* 34xx GENERAL_WKUP register offsets */  #define OMAP343X_CONTROL_WKUP_DEBOBSMUX(i) (OMAP343X_CONTROL_GENERAL_WKUP + \  						0x008 + (i))  #define OMAP343X_CONTROL_WKUP_DEBOBS0 (OMAP343X_CONTROL_GENERAL_WKUP + 0x008) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index bca7a888570..22590dbe8f1 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -40,6 +40,8 @@ struct omap3_idle_statedata {  	u32 core_state;  }; +static struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd; +  static struct omap3_idle_statedata omap3_idle_data[] = {  	{  		.mpu_state = PWRDM_POWER_ON, @@ -71,7 +73,7 @@ static struct omap3_idle_statedata omap3_idle_data[] = {  	},  }; -static struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd; +/* Private functions */  static int __omap3_enter_idle(struct cpuidle_device *dev,  				struct cpuidle_driver *drv, @@ -260,11 +262,11 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,  	return ret;  } -DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); +static DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); -struct cpuidle_driver omap3_idle_driver = { -	.name = 	"omap3_idle", -	.owner = 	THIS_MODULE, +static struct cpuidle_driver omap3_idle_driver = { +	.name =		"omap3_idle", +	.owner =	THIS_MODULE,  	.states = {  		{  			.enter		  = omap3_enter_idle_bm, @@ -327,6 +329,8 @@ struct cpuidle_driver omap3_idle_driver = {  	.safe_state_index = 0,  }; +/* Public functions */ +  /**   * omap3_idle_init - Init routine for OMAP3 idle   * diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c index 288bee6cbb7..d639aef0ded 100644 --- a/arch/arm/mach-omap2/cpuidle44xx.c +++ b/arch/arm/mach-omap2/cpuidle44xx.c @@ -54,6 +54,8 @@ static struct clockdomain *cpu_clkdm[NR_CPUS];  static atomic_t abort_barrier;  static bool cpu_done[NR_CPUS]; +/* Private functions */ +  /**   * omap4_enter_idle_coupled_[simple/coupled] - OMAP4 cpuidle entry functions   * @dev: cpuidle device @@ -161,9 +163,19 @@ fail:  	return index;  } -DEFINE_PER_CPU(struct cpuidle_device, omap4_idle_dev); +/* + * For each cpu, setup the broadcast timer because local timers + * stops for the states above C1. + */ +static void omap_setup_broadcast_timer(void *arg) +{ +	int cpu = smp_processor_id(); +	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu); +} + +static DEFINE_PER_CPU(struct cpuidle_device, omap4_idle_dev); -struct cpuidle_driver omap4_idle_driver = { +static struct cpuidle_driver omap4_idle_driver = {  	.name				= "omap4_idle",  	.owner				= THIS_MODULE,  	.en_core_tk_irqen		= 1, @@ -178,7 +190,7 @@ struct cpuidle_driver omap4_idle_driver = {  			.desc = "MPUSS ON"  		},  		{ -                        /* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */ +			/* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */  			.exit_latency = 328 + 440,  			.target_residency = 960,  			.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED, @@ -200,15 +212,7 @@ struct cpuidle_driver omap4_idle_driver = {  	.safe_state_index = 0,  }; -/* - * For each cpu, setup the broadcast timer because local timers - * stops for the states above C1. - */ -static void omap_setup_broadcast_timer(void *arg) -{ -	int cpu = smp_processor_id(); -	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu); -} +/* Public functions */  /**   * omap4_idle_init - Init routine for OMAP4 idle diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 4abb8b5e9bc..5e304d0719a 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -226,7 +226,7 @@ static struct platform_device omap3isp_device = {  };  static struct omap_iommu_arch_data omap3_isp_iommu = { -	.name = "isp", +	.name = "mmu_isp",  };  int omap3_init_camera(struct isp_platform_data *pdata) diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c index fafb28c0dcb..0a02aab5df6 100644 --- a/arch/arm/mach-omap2/dpll3xxx.c +++ b/arch/arm/mach-omap2/dpll3xxx.c @@ -291,16 +291,13 @@ static void _lookup_sddiv(struct clk_hw_omap *clk, u8 *sd_div, u16 m, u8 n)  /*   * _omap3_noncore_dpll_program - set non-core DPLL M,N values directly - * @clk: struct clk * of DPLL to set - * @m: DPLL multiplier to set - * @n: DPLL divider to set - * @freqsel: FREQSEL value to set + * @clk:	struct clk * of DPLL to set + * @freqsel:	FREQSEL value to set   * - * Program the DPLL with the supplied M, N values, and wait for the DPLL to - * lock..  Returns -EINVAL upon error, or 0 upon success. + * Program the DPLL with the last M, N values calculated, and wait for + * the DPLL to lock. Returns -EINVAL upon error, or 0 upon success.   */ -static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 m, u8 n, -				      u16 freqsel) +static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 freqsel)  {  	struct dpll_data *dd = clk->dpll_data;  	u8 dco, sd_div; @@ -323,23 +320,45 @@ static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 m, u8 n,  	/* Set DPLL multiplier, divider */  	v = __raw_readl(dd->mult_div1_reg);  	v &= ~(dd->mult_mask | dd->div1_mask); -	v |= m << __ffs(dd->mult_mask); -	v |= (n - 1) << __ffs(dd->div1_mask); +	v |= dd->last_rounded_m << __ffs(dd->mult_mask); +	v |= (dd->last_rounded_n - 1) << __ffs(dd->div1_mask);  	/* Configure dco and sd_div for dplls that have these fields */  	if (dd->dco_mask) { -		_lookup_dco(clk, &dco, m, n); +		_lookup_dco(clk, &dco, dd->last_rounded_m, dd->last_rounded_n);  		v &= ~(dd->dco_mask);  		v |= dco << __ffs(dd->dco_mask);  	}  	if (dd->sddiv_mask) { -		_lookup_sddiv(clk, &sd_div, m, n); +		_lookup_sddiv(clk, &sd_div, dd->last_rounded_m, +			      dd->last_rounded_n);  		v &= ~(dd->sddiv_mask);  		v |= sd_div << __ffs(dd->sddiv_mask);  	}  	__raw_writel(v, dd->mult_div1_reg); +	/* Set 4X multiplier and low-power mode */ +	if (dd->m4xen_mask || dd->lpmode_mask) { +		v = __raw_readl(dd->control_reg); + +		if (dd->m4xen_mask) { +			if (dd->last_rounded_m4xen) +				v |= dd->m4xen_mask; +			else +				v &= ~dd->m4xen_mask; +		} + +		if (dd->lpmode_mask) { +			if (dd->last_rounded_lpmode) +				v |= dd->lpmode_mask; +			else +				v &= ~dd->lpmode_mask; +		} + +		__raw_writel(v, dd->control_reg); +	} +  	/* We let the clock framework set the other output dividers later */  	/* REVISIT: Set ramp-up delay? */ @@ -485,15 +504,13 @@ int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate,  		if (!cpu_is_omap44xx() && !cpu_is_omap3630()) {  			freqsel = _omap3_dpll_compute_freqsel(clk,  						dd->last_rounded_n); -			if (!freqsel) -				WARN_ON(1); +			WARN_ON(!freqsel);  		}  		pr_debug("%s: %s: set rate: locking rate to %lu.\n",  			 __func__, __clk_get_name(hw->clk), rate); -		ret = omap3_noncore_dpll_program(clk, dd->last_rounded_m, -						dd->last_rounded_n, freqsel); +		ret = omap3_noncore_dpll_program(clk, freqsel);  		if (!ret)  			new_parent = dd->clk_ref;  	} diff --git a/arch/arm/mach-omap2/dpll44xx.c b/arch/arm/mach-omap2/dpll44xx.c index d3326c474fd..d28b0f72671 100644 --- a/arch/arm/mach-omap2/dpll44xx.c +++ b/arch/arm/mach-omap2/dpll44xx.c @@ -20,6 +20,15 @@  #include "clock44xx.h"  #include "cm-regbits-44xx.h" +/* + * Maximum DPLL input frequency (FINT) and output frequency (FOUT) that + * can supported when using the DPLL low-power mode. Frequencies are + * defined in OMAP4430/60 Public TRM section 3.6.3.3.2 "Enable Control, + * Status, and Low-Power Operation Mode". + */ +#define OMAP4_DPLL_LP_FINT_MAX	1000000 +#define OMAP4_DPLL_LP_FOUT_MAX	100000000 +  /* Supported only on OMAP4 */  int omap4_dpllmx_gatectrl_read(struct clk_hw_omap *clk)  { @@ -82,6 +91,31 @@ const struct clk_hw_omap_ops clkhwops_omap4_dpllmx = {  };  /** + * omap4_dpll_lpmode_recalc - compute DPLL low-power setting + * @dd: pointer to the dpll data structure + * + * Calculates if low-power mode can be enabled based upon the last + * multiplier and divider values calculated. If low-power mode can be + * enabled, then the bit to enable low-power mode is stored in the + * last_rounded_lpmode variable. This implementation is based upon the + * criteria for enabling low-power mode as described in the OMAP4430/60 + * Public TRM section 3.6.3.3.2 "Enable Control, Status, and Low-Power + * Operation Mode". + */ +static void omap4_dpll_lpmode_recalc(struct dpll_data *dd) +{ +	long fint, fout; + +	fint = __clk_get_rate(dd->clk_ref) / (dd->last_rounded_n + 1); +	fout = fint * dd->last_rounded_m; + +	if ((fint < OMAP4_DPLL_LP_FINT_MAX) && (fout < OMAP4_DPLL_LP_FOUT_MAX)) +		dd->last_rounded_lpmode = 1; +	else +		dd->last_rounded_lpmode = 0; +} + +/**   * omap4_dpll_regm4xen_recalc - compute DPLL rate, considering REGM4XEN bit   * @clk: struct clk * of the DPLL to compute the rate for   * @@ -130,7 +164,6 @@ long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw,  				    unsigned long *parent_rate)  {  	struct clk_hw_omap *clk = to_clk_hw_omap(hw); -	u32 v;  	struct dpll_data *dd;  	long r; @@ -139,18 +172,31 @@ long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw,  	dd = clk->dpll_data; -	/* regm4xen adds a multiplier of 4 to DPLL calculations */ -	v = __raw_readl(dd->control_reg) & OMAP4430_DPLL_REGM4XEN_MASK; - -	if (v) -		target_rate = target_rate / OMAP4430_REGM4XEN_MULT; +	dd->last_rounded_m4xen = 0; +	/* +	 * First try to compute the DPLL configuration for +	 * target rate without using the 4X multiplier. +	 */  	r = omap2_dpll_round_rate(hw, target_rate, NULL); +	if (r != ~0) +		goto out; + +	/* +	 * If we did not find a valid DPLL configuration, try again, but +	 * this time see if using the 4X multiplier can help. Enabling the +	 * 4X multiplier is equivalent to dividing the target rate by 4. +	 */ +	r = omap2_dpll_round_rate(hw, target_rate / OMAP4430_REGM4XEN_MULT, +				  NULL);  	if (r == ~0)  		return r; -	if (v) -		clk->dpll_data->last_rounded_rate *= OMAP4430_REGM4XEN_MULT; +	dd->last_rounded_rate *= OMAP4430_REGM4XEN_MULT; +	dd->last_rounded_m4xen = 1; + +out: +	omap4_dpll_lpmode_recalc(dd); -	return clk->dpll_data->last_rounded_rate; +	return dd->last_rounded_rate;  } diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c index fce5aa3fff4..4c7566c7e24 100644 --- a/arch/arm/mach-omap2/drm.c +++ b/arch/arm/mach-omap2/drm.c @@ -27,7 +27,6 @@  #include "omap_device.h"  #include "omap_hwmod.h" -#include <plat/cpu.h>  #if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE) diff --git a/arch/arm/mach-omap2/dss-common.c b/arch/arm/mach-omap2/dss-common.c index 679a0478644..4be5cfc81ab 100644 --- a/arch/arm/mach-omap2/dss-common.c +++ b/arch/arm/mach-omap2/dss-common.c @@ -31,8 +31,7 @@  #include <video/omap-panel-nokia-dsi.h>  #include <video/omap-panel-picodlp.h> -#include <plat/cpu.h> - +#include "soc.h"  #include "dss-common.h"  #include "mux.h" diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/mach-omap2/fb.c index a3367b783fc..d9bd965f6d0 100644 --- a/arch/arm/plat-omap/fb.c +++ b/arch/arm/mach-omap2/fb.c @@ -1,6 +1,4 @@  /* - * File: arch/arm/plat-omap/fb.c - *   * Framebuffer device registration for TI OMAP platforms   *   * Copyright (C) 2006 Nokia Corporation @@ -33,7 +31,7 @@  #include <asm/mach/map.h> -#include <plat/cpu.h> +#include "soc.h"  #ifdef CONFIG_OMAP2_VRFB @@ -94,45 +92,7 @@ static int __init omap_init_vrfb(void)  arch_initcall(omap_init_vrfb);  #endif -#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) - -static bool omapfb_lcd_configured; -static struct omapfb_platform_data omapfb_config; - -static u64 omap_fb_dma_mask = ~(u32)0; - -static struct platform_device omap_fb_device = { -	.name		= "omapfb", -	.id		= -1, -	.dev = { -		.dma_mask		= &omap_fb_dma_mask, -		.coherent_dma_mask	= DMA_BIT_MASK(32), -		.platform_data		= &omapfb_config, -	}, -	.num_resources = 0, -}; - -void __init omapfb_set_lcd_config(const struct omap_lcd_config *config) -{ -	omapfb_config.lcd = *config; -	omapfb_lcd_configured = true; -} - -static int __init omap_init_fb(void) -{ -	/* -	 * If the board file has not set the lcd config with -	 * omapfb_set_lcd_config(), don't bother registering the omapfb device -	 */ -	if (!omapfb_lcd_configured) -		return 0; - -	return platform_device_register(&omap_fb_device); -} - -arch_initcall(omap_init_fb); - -#elif defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) +#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)  static u64 omap_fb_dma_mask = ~(u32)0;  static struct omapfb_platform_data omapfb_config; @@ -155,10 +115,4 @@ static int __init omap_init_fb(void)  arch_initcall(omap_init_fb); -#else - -void __init omapfb_set_lcd_config(const struct omap_lcd_config *config) -{ -} -  #endif diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 65468f6d7f0..8033cb747c8 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -744,7 +744,7 @@ static int gpmc_setup_irq(void)  	return request_irq(gpmc_irq, gpmc_handle_irq, 0, "gpmc", NULL);  } -static __devexit int gpmc_free_irq(void) +static int gpmc_free_irq(void)  {  	int i; @@ -762,7 +762,7 @@ static __devexit int gpmc_free_irq(void)  	return 0;  } -static void __devexit gpmc_mem_exit(void) +static void gpmc_mem_exit(void)  {  	int cs; @@ -774,7 +774,7 @@ static void __devexit gpmc_mem_exit(void)  } -static int __devinit gpmc_mem_init(void) +static int gpmc_mem_init(void)  {  	int cs, rc;  	unsigned long boot_rom_space = 0; @@ -1121,7 +1121,7 @@ int gpmc_calc_timings(struct gpmc_timings *gpmc_t,  	return 0;  } -static __devinit int gpmc_probe(struct platform_device *pdev) +static int gpmc_probe(struct platform_device *pdev)  {  	int rc;  	u32 l; @@ -1177,7 +1177,7 @@ static __devinit int gpmc_probe(struct platform_device *pdev)  	return 0;  } -static __devexit int gpmc_remove(struct platform_device *pdev) +static int gpmc_remove(struct platform_device *pdev)  {  	gpmc_free_irq();  	gpmc_mem_exit(); @@ -1187,7 +1187,7 @@ static __devexit int gpmc_remove(struct platform_device *pdev)  static struct platform_driver gpmc_driver = {  	.probe		= gpmc_probe, -	.remove		= __devexit_p(gpmc_remove), +	.remove		= gpmc_remove,  	.driver		= {  		.name	= DEVICE_NAME,  		.owner	= THIS_MODULE, diff --git a/arch/arm/mach-omap2/i2c.c b/arch/arm/mach-omap2/i2c.c index fbb9b152cd5..b9074dde3b9 100644 --- a/arch/arm/mach-omap2/i2c.c +++ b/arch/arm/mach-omap2/i2c.c @@ -22,6 +22,7 @@  #include "soc.h"  #include "omap_hwmod.h"  #include "omap_device.h" +#include "omap-pm.h"  #include "prm.h"  #include "common.h" @@ -120,6 +121,16 @@ static int __init omap_i2c_nr_ports(void)  	return ports;  } +/* + * XXX This function is a temporary compatibility wrapper - only + * needed until the I2C driver can be converted to call + * omap_pm_set_max_dev_wakeup_lat() and handle a return code. + */ +static void omap_pm_set_max_mpu_wakeup_lat_compat(struct device *dev, long t) +{ +	omap_pm_set_max_mpu_wakeup_lat(dev, t); +} +  static const char name[] = "omap_i2c";  int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata, @@ -157,6 +168,15 @@ int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata,  	dev_attr = (struct omap_i2c_dev_attr *)oh->dev_attr;  	pdata->flags = dev_attr->flags; +	/* +	 * When waiting for completion of a i2c transfer, we need to +	 * set a wake up latency constraint for the MPU. This is to +	 * ensure quick enough wakeup from idle, when transfer +	 * completes. +	 * Only omap3 has support for constraints +	 */ +	if (cpu_is_omap34xx()) +		pdata->set_mpu_wkup_lat = omap_pm_set_max_mpu_wakeup_lat_compat;  	pdev = omap_device_build(name, bus_id, oh, pdata,  			sizeof(struct omap_i2c_bus_platform_data),  			NULL, 0, 0); diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index 0d974565f8c..0b080267b7f 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c @@ -342,7 +342,7 @@ struct omap_mbox mbox_2_info = {  struct omap_mbox *omap4_mboxes[] = { &mbox_1_info, &mbox_2_info, NULL };  #endif -static int __devinit omap2_mbox_probe(struct platform_device *pdev) +static int omap2_mbox_probe(struct platform_device *pdev)  {  	struct resource *mem;  	int ret; @@ -395,7 +395,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)  	return 0;  } -static int __devexit omap2_mbox_remove(struct platform_device *pdev) +static int omap2_mbox_remove(struct platform_device *pdev)  {  	omap_mbox_unregister();  	iounmap(mbox_base); @@ -404,7 +404,7 @@ static int __devexit omap2_mbox_remove(struct platform_device *pdev)  static struct platform_driver omap2_mbox_driver = {  	.probe = omap2_mbox_probe, -	.remove = __devexit_p(omap2_mbox_remove), +	.remove = omap2_mbox_remove,  	.driver = {  		.name = "omap-mailbox",  	}, diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index 26126343d6a..6a217c98db5 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c @@ -135,10 +135,7 @@ static int __init _omap_mux_init_gpio(struct omap_mux_partition *partition,  	old_mode = omap_mux_read(partition, gpio_mux->reg_offset);  	mux_mode = val & ~(OMAP_MUX_NR_MODES - 1); -	if (partition->flags & OMAP_MUX_GPIO_IN_MODE3) -		mux_mode |= OMAP_MUX_MODE3; -	else -		mux_mode |= OMAP_MUX_MODE4; +	mux_mode |= partition->gpio;  	pr_debug("%s: Setting signal %s.gpio%i 0x%04x -> 0x%04x\n", __func__,  		 gpio_mux->muxnames[0], gpio, old_mode, mux_mode);  	omap_mux_write(partition, mux_mode, gpio_mux->reg_offset); @@ -800,7 +797,7 @@ int __init omap_mux_late_init(void)  			struct omap_mux *m = &e->mux;  			u16 mode = omap_mux_read(partition, m->reg_offset); -			if (OMAP_MODE_GPIO(mode)) +			if (OMAP_MODE_GPIO(partition, mode))  				continue;  #ifndef CONFIG_DEBUG_FS @@ -1065,7 +1062,7 @@ static void __init omap_mux_init_list(struct omap_mux_partition *partition,  		}  #else  		/* Skip pins that are not muxed as GPIO by bootloader */ -		if (!OMAP_MODE_GPIO(omap_mux_read(partition, +		if (!OMAP_MODE_GPIO(partition, omap_mux_read(partition,  				    superset->reg_offset))) {  			superset++;  			continue; @@ -1132,6 +1129,7 @@ int __init omap_mux_init(const char *name, u32 flags,  	partition->name = name;  	partition->flags = flags; +	partition->gpio = flags & OMAP_MUX_MODE7;  	partition->size = mux_size;  	partition->phys = mux_pbase;  	partition->base = ioremap(mux_pbase, mux_size); diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h index 76f9b3c2f58..fdb22f14021 100644 --- a/arch/arm/mach-omap2/mux.h +++ b/arch/arm/mach-omap2/mux.h @@ -58,7 +58,8 @@  #define OMAP_PIN_OFF_INPUT_PULLDOWN	(OMAP_OFF_EN | OMAP_OFF_PULL_EN)  #define OMAP_PIN_OFF_WAKEUPENABLE	OMAP_WAKEUP_EN -#define OMAP_MODE_GPIO(x)	(((x) & OMAP_MUX_MODE7) == OMAP_MUX_MODE4) +#define OMAP_MODE_GPIO(partition, x)	(((x) & OMAP_MUX_MODE7) == \ +					  partition->gpio)  #define OMAP_MODE_UART(x)	(((x) & OMAP_MUX_MODE7) == OMAP_MUX_MODE0)  /* Flags for omapX_mux_init */ @@ -79,13 +80,20 @@  /*   * omap_mux_init flags definition:   * + * OMAP_GPIO_MUX_MODE, bits 0-2: gpio muxing mode, same like pad control + *      register which includes values from 0-7.   * OMAP_MUX_REG_8BIT: Ensure that access to padconf is done in 8 bits.   * The default value is 16 bits. - * OMAP_MUX_GPIO_IN_MODE3: The GPIO is selected in mode3. - * The default is mode4.   */ -#define OMAP_MUX_REG_8BIT		(1 << 0) -#define OMAP_MUX_GPIO_IN_MODE3		(1 << 1) +#define OMAP_MUX_GPIO_IN_MODE0		OMAP_MUX_MODE0 +#define OMAP_MUX_GPIO_IN_MODE1		OMAP_MUX_MODE1 +#define OMAP_MUX_GPIO_IN_MODE2		OMAP_MUX_MODE2 +#define OMAP_MUX_GPIO_IN_MODE3		OMAP_MUX_MODE3 +#define OMAP_MUX_GPIO_IN_MODE4		OMAP_MUX_MODE4 +#define OMAP_MUX_GPIO_IN_MODE5		OMAP_MUX_MODE5 +#define OMAP_MUX_GPIO_IN_MODE6		OMAP_MUX_MODE6 +#define OMAP_MUX_GPIO_IN_MODE7		OMAP_MUX_MODE7 +#define OMAP_MUX_REG_8BIT		(1 << 3)  /**   * struct omap_board_data - board specific device data @@ -105,6 +113,7 @@ struct omap_board_data {   * struct mux_partition - contain partition related information   * @name: name of the current partition   * @flags: flags specific to this partition + * @gpio: gpio mux mode   * @phys: physical address   * @size: partition size   * @base: virtual address after ioremap @@ -114,6 +123,7 @@ struct omap_board_data {  struct omap_mux_partition {  	const char		*name;  	u32			flags; +	u32			gpio;  	u32			phys;  	u32			size;  	void __iomem		*base; diff --git a/arch/arm/mach-omap2/mux34xx.c b/arch/arm/mach-omap2/mux34xx.c index c47140bbbec..c53609f4629 100644 --- a/arch/arm/mach-omap2/mux34xx.c +++ b/arch/arm/mach-omap2/mux34xx.c @@ -2053,7 +2053,7 @@ int __init omap3_mux_init(struct omap_board_mux *board_subset, int flags)  		return -EINVAL;  	} -	return omap_mux_init("core", 0, +	return omap_mux_init("core", OMAP_MUX_GPIO_IN_MODE4,  			     OMAP3_CONTROL_PADCONF_MUX_PBASE,  			     OMAP3_CONTROL_PADCONF_MUX_SIZE,  			     omap3_muxmodes, package_subset, board_subset, diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c index a6a4ff8744b..6da4f7ae9d7 100644 --- a/arch/arm/mach-omap2/omap-iommu.c +++ b/arch/arm/mach-omap2/omap-iommu.c @@ -12,153 +12,60 @@  #include <linux/module.h>  #include <linux/platform_device.h> +#include <linux/err.h> +#include <linux/slab.h>  #include <linux/platform_data/iommu-omap.h> +#include "omap_hwmod.h" +#include "omap_device.h" -#include "soc.h" -#include "common.h" - -struct iommu_device { -	resource_size_t base; -	int irq; -	struct iommu_platform_data pdata; -	struct resource res[2]; -}; -static struct iommu_device *devices; -static int num_iommu_devices; - -#ifdef CONFIG_ARCH_OMAP3 -static struct iommu_device omap3_devices[] = { -	{ -		.base = 0x480bd400, -		.irq = 24 + OMAP_INTC_START, -		.pdata = { -			.name = "isp", -			.nr_tlb_entries = 8, -			.clk_name = "cam_ick", -			.da_start = 0x0, -			.da_end = 0xFFFFF000, -		}, -	}, -#if defined(CONFIG_OMAP_IOMMU_IVA2) -	{ -		.base = 0x5d000000, -		.irq = 28 + OMAP_INTC_START, -		.pdata = { -			.name = "iva2", -			.nr_tlb_entries = 32, -			.clk_name = "iva2_ck", -			.da_start = 0x11000000, -			.da_end = 0xFFFFF000, -		}, -	}, -#endif -}; -#define NR_OMAP3_IOMMU_DEVICES ARRAY_SIZE(omap3_devices) -static struct platform_device *omap3_iommu_pdev[NR_OMAP3_IOMMU_DEVICES]; -#else -#define omap3_devices		NULL -#define NR_OMAP3_IOMMU_DEVICES	0 -#define omap3_iommu_pdev	NULL -#endif +static int __init omap_iommu_dev_init(struct omap_hwmod *oh, void *unused) +{ +	struct platform_device *pdev; +	struct iommu_platform_data *pdata; +	struct omap_mmu_dev_attr *a = (struct omap_mmu_dev_attr *)oh->dev_attr; +	static int i; -#ifdef CONFIG_ARCH_OMAP4 -static struct iommu_device omap4_devices[] = { -	{ -		.base = OMAP4_MMU1_BASE, -		.irq = 100 + OMAP44XX_IRQ_GIC_START, -		.pdata = { -			.name = "ducati", -			.nr_tlb_entries = 32, -			.clk_name = "ipu_fck", -			.da_start = 0x0, -			.da_end = 0xFFFFF000, -		}, -	}, -	{ -		.base = OMAP4_MMU2_BASE, -		.irq = 28 + OMAP44XX_IRQ_GIC_START, -		.pdata = { -			.name = "tesla", -			.nr_tlb_entries = 32, -			.clk_name = "dsp_fck", -			.da_start = 0x0, -			.da_end = 0xFFFFF000, -		}, -	}, -}; -#define NR_OMAP4_IOMMU_DEVICES ARRAY_SIZE(omap4_devices) -static struct platform_device *omap4_iommu_pdev[NR_OMAP4_IOMMU_DEVICES]; -#else -#define omap4_devices		NULL -#define NR_OMAP4_IOMMU_DEVICES	0 -#define omap4_iommu_pdev	NULL -#endif +	pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); +	if (!pdata) +		return -ENOMEM; -static struct platform_device **omap_iommu_pdev; +	pdata->name = oh->name; +	pdata->nr_tlb_entries = a->nr_tlb_entries; +	pdata->da_start = a->da_start; +	pdata->da_end = a->da_end; -static int __init omap_iommu_init(void) -{ -	int i, err; -	struct resource res[] = { -		{ .flags = IORESOURCE_MEM }, -		{ .flags = IORESOURCE_IRQ }, -	}; +	if (oh->rst_lines_cnt == 1) { +		pdata->reset_name = oh->rst_lines->name; +		pdata->assert_reset = omap_device_assert_hardreset; +		pdata->deassert_reset = omap_device_deassert_hardreset; +	} -	if (cpu_is_omap34xx()) { -		devices = omap3_devices; -		omap_iommu_pdev = omap3_iommu_pdev; -		num_iommu_devices = NR_OMAP3_IOMMU_DEVICES; -	} else if (cpu_is_omap44xx()) { -		devices = omap4_devices; -		omap_iommu_pdev = omap4_iommu_pdev; -		num_iommu_devices = NR_OMAP4_IOMMU_DEVICES; -	} else -		return -ENODEV; +	pdev = omap_device_build("omap-iommu", i, oh, pdata, sizeof(*pdata), +				NULL, 0, 0); -	for (i = 0; i < num_iommu_devices; i++) { -		struct platform_device *pdev; -		const struct iommu_device *d = &devices[i]; +	kfree(pdata); -		pdev = platform_device_alloc("omap-iommu", i); -		if (!pdev) { -			err = -ENOMEM; -			goto err_out; -		} +	if (IS_ERR(pdev)) { +		pr_err("%s: device build err: %ld\n", __func__, PTR_ERR(pdev)); +		return PTR_ERR(pdev); +	} -		res[0].start = d->base; -		res[0].end = d->base + MMU_REG_SIZE - 1; -		res[1].start = res[1].end = d->irq; +	i++; -		err = platform_device_add_resources(pdev, res, -						    ARRAY_SIZE(res)); -		if (err) -			goto err_out; -		err = platform_device_add_data(pdev, &d->pdata, -					       sizeof(d->pdata)); -		if (err) -			goto err_out; -		err = platform_device_add(pdev); -		if (err) -			goto err_out; -		omap_iommu_pdev[i] = pdev; -	}  	return 0; +} -err_out: -	while (i--) -		platform_device_put(omap_iommu_pdev[i]); -	return err; +static int __init omap_iommu_init(void) +{ +	return omap_hwmod_for_each_by_class("mmu", omap_iommu_dev_init, NULL);  }  /* must be ready before omap3isp is probed */  subsys_initcall(omap_iommu_init);  static void __exit omap_iommu_exit(void)  { -	int i; - -	for (i = 0; i < num_iommu_devices; i++) -		platform_device_unregister(omap_iommu_pdev[i]); +	/* Do nothing */  }  module_exit(omap_iommu_exit); diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c index 6c8fa70ddad..d2d3840557c 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c @@ -77,8 +77,7 @@ static struct omap_hwmod_class i2c_class = {  static struct omap_i2c_dev_attr i2c_dev_attr = {  	.fifo_depth	= 8, /* bytes */ -	.flags		= OMAP_I2C_FLAG_APPLY_ERRATA_I207 | -			  OMAP_I2C_FLAG_BUS_SHIFT_2 | +	.flags		= OMAP_I2C_FLAG_BUS_SHIFT_2 |  			  OMAP_I2C_FLAG_FORCE_19200_INT_CLK,  }; diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c index 32820d89f5b..646c14d9fdb 100644 --- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c @@ -1118,8 +1118,7 @@ static struct omap_hwmod_class i2c_class = {  };  static struct omap_i2c_dev_attr i2c_dev_attr = { -	.flags = OMAP_I2C_FLAG_BUS_SHIFT_NONE | -		  OMAP_I2C_FLAG_RESET_REGS_POSTIDLE, +	.flags = OMAP_I2C_FLAG_BUS_SHIFT_NONE,  };  /* i2c1 */ @@ -2071,7 +2070,7 @@ static struct omap_hwmod_irq_info am33xx_usbss_mpu_irqs[] = {  	{ .name = "usbss-irq", .irq = 17 + OMAP_INTC_START, },  	{ .name = "musb0-irq", .irq = 18 + OMAP_INTC_START, },  	{ .name = "musb1-irq", .irq = 19 + OMAP_INTC_START, }, -	{ .irq = -1 + OMAP_INTC_START, }, +	{ .irq = -1, },  };  static struct omap_hwmod am33xx_usbss_hwmod = { @@ -2516,7 +2515,7 @@ static struct omap_hwmod_ocp_if am33xx_l4_hs__cpgmac0 = {  	.user		= OCP_USER_MPU,  }; -struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = { +static struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = {  	{  		.pa_start	= 0x4A101000,  		.pa_end		= 0x4A101000 + SZ_256 - 1, @@ -2524,7 +2523,7 @@ struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = {  	{ }  }; -struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = { +static struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = {  	.master		= &am33xx_cpgmac0_hwmod,  	.slave		= &am33xx_mdio_hwmod,  	.addr		= am33xx_mdio_addr_space, diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index ec4499e5a4c..8bb2628df34 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c @@ -794,9 +794,7 @@ static struct omap_hwmod omap3xxx_dss_venc_hwmod = {  /* I2C1 */  static struct omap_i2c_dev_attr i2c1_dev_attr = {  	.fifo_depth	= 8, /* bytes */ -	.flags		= OMAP_I2C_FLAG_APPLY_ERRATA_I207 | -			  OMAP_I2C_FLAG_RESET_REGS_POSTIDLE | -			  OMAP_I2C_FLAG_BUS_SHIFT_2, +	.flags		= OMAP_I2C_FLAG_BUS_SHIFT_2,  };  static struct omap_hwmod omap3xxx_i2c1_hwmod = { @@ -821,9 +819,7 @@ static struct omap_hwmod omap3xxx_i2c1_hwmod = {  /* I2C2 */  static struct omap_i2c_dev_attr i2c2_dev_attr = {  	.fifo_depth	= 8, /* bytes */ -	.flags = OMAP_I2C_FLAG_APPLY_ERRATA_I207 | -		 OMAP_I2C_FLAG_RESET_REGS_POSTIDLE | -		 OMAP_I2C_FLAG_BUS_SHIFT_2, +	.flags = OMAP_I2C_FLAG_BUS_SHIFT_2,  };  static struct omap_hwmod omap3xxx_i2c2_hwmod = { @@ -848,9 +844,7 @@ static struct omap_hwmod omap3xxx_i2c2_hwmod = {  /* I2C3 */  static struct omap_i2c_dev_attr i2c3_dev_attr = {  	.fifo_depth	= 64, /* bytes */ -	.flags = OMAP_I2C_FLAG_APPLY_ERRATA_I207 | -		 OMAP_I2C_FLAG_RESET_REGS_POSTIDLE | -		 OMAP_I2C_FLAG_BUS_SHIFT_2, +	.flags = OMAP_I2C_FLAG_BUS_SHIFT_2,  };  static struct omap_hwmod_irq_info i2c3_mpu_irqs[] = { diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index eb61cfd9452..129d5081ed1 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c @@ -26,7 +26,6 @@  #include <linux/omap-dma.h> -#include <linux/platform_data/omap_ocp2scp.h>  #include <linux/platform_data/spi-omap2-mcspi.h>  #include <linux/platform_data/asoc-ti-mcbsp.h>  #include <linux/platform_data/iommu-omap.h> @@ -653,7 +652,7 @@ static struct omap_hwmod omap44xx_dsp_hwmod = {  	.mpu_irqs	= omap44xx_dsp_irqs,  	.rst_lines	= omap44xx_dsp_resets,  	.rst_lines_cnt	= ARRAY_SIZE(omap44xx_dsp_resets), -	.main_clk	= "dsp_fck", +	.main_clk	= "dpll_iva_m4x2_ck",  	.prcm = {  		.omap4 = {  			.clkctrl_offs = OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET, @@ -1529,8 +1528,7 @@ static struct omap_hwmod_class omap44xx_i2c_hwmod_class = {  };  static struct omap_i2c_dev_attr i2c_dev_attr = { -	.flags	= OMAP_I2C_FLAG_BUS_SHIFT_NONE | -			OMAP_I2C_FLAG_RESET_REGS_POSTIDLE, +	.flags	= OMAP_I2C_FLAG_BUS_SHIFT_NONE,  };  /* i2c1 */ @@ -1680,7 +1678,7 @@ static struct omap_hwmod omap44xx_ipu_hwmod = {  	.mpu_irqs	= omap44xx_ipu_irqs,  	.rst_lines	= omap44xx_ipu_resets,  	.rst_lines_cnt	= ARRAY_SIZE(omap44xx_ipu_resets), -	.main_clk	= "ipu_fck", +	.main_clk	= "ducati_clk_mux_ck",  	.prcm = {  		.omap4 = {  			.clkctrl_offs = OMAP4_CM_DUCATI_DUCATI_CLKCTRL_OFFSET, diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c index fefd4016662..615e5b1fb02 100644 --- a/arch/arm/mach-omap2/omap_twl.c +++ b/arch/arm/mach-omap2/omap_twl.c @@ -292,8 +292,8 @@ int __init omap3_twl_set_sr_bit(bool enable)  	if (twl_sr_enable_autoinit)  		pr_warning("%s: unexpected multiple calls\n", __func__); -	ret = twl_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &temp, -					TWL4030_DCDC_GLOBAL_CFG); +	ret = twl_i2c_read_u8(TWL_MODULE_PM_RECEIVER, &temp, +			      TWL4030_DCDC_GLOBAL_CFG);  	if (ret)  		goto err; @@ -302,8 +302,8 @@ int __init omap3_twl_set_sr_bit(bool enable)  	else  		temp &= ~SMARTREFLEX_ENABLE; -	ret = twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, temp, -				TWL4030_DCDC_GLOBAL_CFG); +	ret = twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, temp, +			       TWL4030_DCDC_GLOBAL_CFG);  	if (!ret) {  		twl_sr_enable_autoinit = true;  		return 0; diff --git a/arch/arm/mach-omap2/pmu.c b/arch/arm/mach-omap2/pmu.c index 250d909e38b..eb78ae7a346 100644 --- a/arch/arm/mach-omap2/pmu.c +++ b/arch/arm/mach-omap2/pmu.c @@ -11,8 +11,6 @@   * the Free Software Foundation; either version 2 of the License, or   * (at your option) any later version.   */ -#include <linux/pm_runtime.h> -  #include <asm/pmu.h>  #include "soc.h" diff --git a/arch/arm/mach-omap2/prm2xxx.c b/arch/arm/mach-omap2/prm2xxx.c index faeab18696d..418de9c3b31 100644 --- a/arch/arm/mach-omap2/prm2xxx.c +++ b/arch/arm/mach-omap2/prm2xxx.c @@ -18,9 +18,8 @@  #include <linux/io.h>  #include <linux/irq.h> +#include "soc.h"  #include "common.h" -#include <plat/cpu.h> -  #include "vp.h"  #include "powerdomain.h"  #include "clockdomain.h" @@ -29,6 +28,14 @@  #include "prm-regbits-24xx.h"  /* + * OMAP24xx PM_PWSTCTRL_*.POWERSTATE and PM_PWSTST_*.LASTSTATEENTERED bits - + * these are reversed from the bits used on OMAP3+ + */ +#define OMAP24XX_PWRDM_POWER_ON			0x0 +#define OMAP24XX_PWRDM_POWER_RET		0x1 +#define OMAP24XX_PWRDM_POWER_OFF		0x3 + +/*   * omap2xxx_prm_reset_src_map - map from bits in the PRM_RSTST_WKUP   *   hardware register (which are specific to the OMAP2xxx SoCs) to   *   reset source ID bit shifts (which is an OMAP SoC-independent @@ -69,6 +76,34 @@ static u32 omap2xxx_prm_read_reset_sources(void)  }  /** + * omap2xxx_pwrst_to_common_pwrst - convert OMAP2xxx pwrst to common pwrst + * @omap2xxx_pwrst: OMAP2xxx hardware power state to convert + * + * Return the common power state bits corresponding to the OMAP2xxx + * hardware power state bits @omap2xxx_pwrst, or -EINVAL upon error. + */ +static int omap2xxx_pwrst_to_common_pwrst(u8 omap2xxx_pwrst) +{ +	u8 pwrst; + +	switch (omap2xxx_pwrst) { +	case OMAP24XX_PWRDM_POWER_OFF: +		pwrst = PWRDM_POWER_OFF; +		break; +	case OMAP24XX_PWRDM_POWER_RET: +		pwrst = PWRDM_POWER_RET; +		break; +	case OMAP24XX_PWRDM_POWER_ON: +		pwrst = PWRDM_POWER_ON; +		break; +	default: +		return -EINVAL; +	} + +	return pwrst; +} + +/**   * omap2xxx_prm_dpll_reset - use DPLL reset to reboot the OMAP SoC   *   * Set the DPLL reset bit, which should reboot the SoC.  This is the @@ -98,10 +133,56 @@ int omap2xxx_clkdm_wakeup(struct clockdomain *clkdm)  	return 0;  } +static int omap2xxx_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) +{ +	u8 omap24xx_pwrst; + +	switch (pwrst) { +	case PWRDM_POWER_OFF: +		omap24xx_pwrst = OMAP24XX_PWRDM_POWER_OFF; +		break; +	case PWRDM_POWER_RET: +		omap24xx_pwrst = OMAP24XX_PWRDM_POWER_RET; +		break; +	case PWRDM_POWER_ON: +		omap24xx_pwrst = OMAP24XX_PWRDM_POWER_ON; +		break; +	default: +		return -EINVAL; +	} + +	omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK, +				   (omap24xx_pwrst << OMAP_POWERSTATE_SHIFT), +				   pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL); +	return 0; +} + +static int omap2xxx_pwrdm_read_next_pwrst(struct powerdomain *pwrdm) +{ +	u8 omap2xxx_pwrst; + +	omap2xxx_pwrst = omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs, +						       OMAP2_PM_PWSTCTRL, +						       OMAP_POWERSTATE_MASK); + +	return omap2xxx_pwrst_to_common_pwrst(omap2xxx_pwrst); +} + +static int omap2xxx_pwrdm_read_pwrst(struct powerdomain *pwrdm) +{ +	u8 omap2xxx_pwrst; + +	omap2xxx_pwrst = omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs, +						       OMAP2_PM_PWSTST, +						       OMAP_POWERSTATEST_MASK); + +	return omap2xxx_pwrst_to_common_pwrst(omap2xxx_pwrst); +} +  struct pwrdm_ops omap2_pwrdm_operations = { -	.pwrdm_set_next_pwrst	= omap2_pwrdm_set_next_pwrst, -	.pwrdm_read_next_pwrst	= omap2_pwrdm_read_next_pwrst, -	.pwrdm_read_pwrst	= omap2_pwrdm_read_pwrst, +	.pwrdm_set_next_pwrst	= omap2xxx_pwrdm_set_next_pwrst, +	.pwrdm_read_next_pwrst	= omap2xxx_pwrdm_read_next_pwrst, +	.pwrdm_read_pwrst	= omap2xxx_pwrdm_read_pwrst,  	.pwrdm_set_logic_retst	= omap2_pwrdm_set_logic_retst,  	.pwrdm_set_mem_onst	= omap2_pwrdm_set_mem_onst,  	.pwrdm_set_mem_retst	= omap2_pwrdm_set_mem_retst, diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c index 30517f5af70..a3e121f94a8 100644 --- a/arch/arm/mach-omap2/prm2xxx_3xxx.c +++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c @@ -103,28 +103,6 @@ int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift)  /* Powerdomain low-level functions */  /* Common functions across OMAP2 and OMAP3 */ -int omap2_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) -{ -	omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK, -				   (pwrst << OMAP_POWERSTATE_SHIFT), -				   pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL); -	return 0; -} - -int omap2_pwrdm_read_next_pwrst(struct powerdomain *pwrdm) -{ -	return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs, -					     OMAP2_PM_PWSTCTRL, -					     OMAP_POWERSTATE_MASK); -} - -int omap2_pwrdm_read_pwrst(struct powerdomain *pwrdm) -{ -	return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs, -					     OMAP2_PM_PWSTST, -					     OMAP_POWERSTATEST_MASK); -} -  int omap2_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,  								u8 pwrst)  { diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c index db198d05858..e648bd55b07 100644 --- a/arch/arm/mach-omap2/prm3xxx.c +++ b/arch/arm/mach-omap2/prm3xxx.c @@ -18,9 +18,8 @@  #include <linux/io.h>  #include <linux/irq.h> +#include "soc.h"  #include "common.h" -#include <plat/cpu.h> -  #include "vp.h"  #include "powerdomain.h"  #include "prm3xxx.h" @@ -278,6 +277,28 @@ static u32 omap3xxx_prm_read_reset_sources(void)  /* Powerdomain low-level functions */ +static int omap3_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) +{ +	omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK, +				   (pwrst << OMAP_POWERSTATE_SHIFT), +				   pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL); +	return 0; +} + +static int omap3_pwrdm_read_next_pwrst(struct powerdomain *pwrdm) +{ +	return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs, +					     OMAP2_PM_PWSTCTRL, +					     OMAP_POWERSTATE_MASK); +} + +static int omap3_pwrdm_read_pwrst(struct powerdomain *pwrdm) +{ +	return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs, +					     OMAP2_PM_PWSTST, +					     OMAP_POWERSTATEST_MASK); +} +  /* Applicable only for OMAP3. Not supported on OMAP2 */  static int omap3_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)  { @@ -356,9 +377,9 @@ static int omap3_pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)  }  struct pwrdm_ops omap3_pwrdm_operations = { -	.pwrdm_set_next_pwrst	= omap2_pwrdm_set_next_pwrst, -	.pwrdm_read_next_pwrst	= omap2_pwrdm_read_next_pwrst, -	.pwrdm_read_pwrst	= omap2_pwrdm_read_pwrst, +	.pwrdm_set_next_pwrst	= omap3_pwrdm_set_next_pwrst, +	.pwrdm_read_next_pwrst	= omap3_pwrdm_read_next_pwrst, +	.pwrdm_read_pwrst	= omap3_pwrdm_read_pwrst,  	.pwrdm_read_prev_pwrst	= omap3_pwrdm_read_prev_pwrst,  	.pwrdm_set_logic_retst	= omap2_pwrdm_set_logic_retst,  	.pwrdm_read_logic_pwrst	= omap3_pwrdm_read_logic_pwrst, diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index 7498bc77fe8..c05a343d465 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c @@ -56,9 +56,9 @@ static struct omap_prcm_irq_setup omap4_prcm_irq_setup = {   *   enumeration)   */  static struct prm_reset_src_map omap44xx_prm_reset_src_map[] = { -	{ OMAP4430_RST_GLOBAL_WARM_SW_SHIFT, +	{ OMAP4430_GLOBAL_WARM_SW_RST_SHIFT,  	  OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT }, -	{ OMAP4430_RST_GLOBAL_COLD_SW_SHIFT, +	{ OMAP4430_GLOBAL_COLD_RST_SHIFT,  	  OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT },  	{ OMAP4430_MPU_SECURITY_VIOL_RST_SHIFT,  	  OMAP_SECU_VIOL_RST_SRC_ID_SHIFT }, @@ -333,7 +333,7 @@ static u32 omap44xx_prm_read_reset_sources(void)  	u32 r = 0;  	u32 v; -	v = omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST, +	v = omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST,  				    OMAP4_RM_RSTST);  	p = omap44xx_prm_reset_src_map; diff --git a/arch/arm/mach-omap2/prm44xx.h b/arch/arm/mach-omap2/prm44xx.h index 22b0979206c..8ee1fbdec56 100644 --- a/arch/arm/mach-omap2/prm44xx.h +++ b/arch/arm/mach-omap2/prm44xx.h @@ -62,8 +62,8 @@  /* OMAP4 specific register offsets */  #define OMAP4_RM_RSTCTRL				0x0000 -#define OMAP4_RM_RSTTIME				0x0004 -#define OMAP4_RM_RSTST					0x0008 +#define OMAP4_RM_RSTST					0x0004 +#define OMAP4_RM_RSTTIME				0x0008  #define OMAP4_PM_PWSTCTRL				0x0000  #define OMAP4_PM_PWSTST					0x0004 diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 93d102535c8..04fdbc4c499 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -27,8 +27,7 @@  #include <linux/pm_runtime.h>  #include <linux/console.h>  #include <linux/omap-dma.h> - -#include <plat/omap-serial.h> +#include <linux/platform_data/serial-omap.h>  #include "common.h"  #include "omap_hwmod.h" diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 7016637b531..691aa674665 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -175,7 +175,7 @@ static struct device_node * __init omap_get_timer_dt(struct of_device_id *match,  			continue;  		} -		prom_add_property(np, &device_disabled); +		of_add_property(np, &device_disabled);  		return np;  	} @@ -190,7 +190,7 @@ static struct device_node * __init omap_get_timer_dt(struct of_device_id *match,   * kernel registering these devices remove them dynamically from the device   * tree on boot.   */ -void __init omap_dmtimer_init(void) +static void __init omap_dmtimer_init(void)  {  	struct device_node *np; @@ -210,7 +210,7 @@ void __init omap_dmtimer_init(void)   *   * Get the timer errata flags that are specific to the OMAP device being used.   */ -u32 __init omap_dm_timer_get_errata(void) +static u32 __init omap_dm_timer_get_errata(void)  {  	if (cpu_is_omap24xx())  		return 0; @@ -392,7 +392,7 @@ static struct of_device_id omap_counter_match[] __initdata = {  };  /* Setup free-running counter for clocksource */ -static int __init omap2_sync32k_clocksource_init(void) +static int __init __maybe_unused omap2_sync32k_clocksource_init(void)  {  	int ret;  	struct device_node *np = NULL; diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c index d1dbe125b34..2e44e8a2288 100644 --- a/arch/arm/mach-omap2/usb-host.c +++ b/arch/arm/mach-omap2/usb-host.c @@ -508,6 +508,10 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)  	if (cpu_is_omap34xx()) {  		setup_ehci_io_mux(pdata->port_mode);  		setup_ohci_io_mux(pdata->port_mode); + +		if (omap_rev() <= OMAP3430_REV_ES2_1) +			usbhs_data.single_ulpi_bypass = true; +  	} else if (cpu_is_omap44xx()) {  		setup_4430ehci_io_mux(pdata->port_mode);  		setup_4430ohci_io_mux(pdata->port_mode); diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c index cd50e328db2..d9c7c3bf0d9 100644 --- a/arch/arm/mach-orion5x/pci.c +++ b/arch/arm/mach-orion5x/pci.c @@ -506,7 +506,7 @@ static int __init pci_setup(struct pci_sys_data *sys)  /*****************************************************************************   * General PCIe + PCI   ****************************************************************************/ -static void __devinit rc_pci_fixup(struct pci_dev *dev) +static void rc_pci_fixup(struct pci_dev *dev)  {  	/*  	 * Prevent enumeration of root complex. diff --git a/arch/arm/mach-prima2/pm.c b/arch/arm/mach-prima2/pm.c index fb5a7910af3..9936c180bf0 100644 --- a/arch/arm/mach-prima2/pm.c +++ b/arch/arm/mach-prima2/pm.c @@ -123,7 +123,7 @@ static const struct of_device_id memc_ids[] = {  	{}  }; -static int __devinit sirfsoc_memc_probe(struct platform_device *op) +static int sirfsoc_memc_probe(struct platform_device *op)  {  	struct device_node *np = op->dev.of_node; diff --git a/arch/arm/mach-prima2/rtciobrg.c b/arch/arm/mach-prima2/rtciobrg.c index 9d80f1e20a9..55735360213 100644 --- a/arch/arm/mach-prima2/rtciobrg.c +++ b/arch/arm/mach-prima2/rtciobrg.c @@ -107,7 +107,7 @@ static const struct of_device_id rtciobrg_ids[] = {  	{}  }; -static int __devinit sirfsoc_rtciobrg_probe(struct platform_device *op) +static int sirfsoc_rtciobrg_probe(struct platform_device *op)  {  	struct device_node *np = op->dev.of_node; diff --git a/arch/arm/mach-pxa/corgi_pm.c b/arch/arm/mach-pxa/corgi_pm.c index 048c4299473..7a39efc5086 100644 --- a/arch/arm/mach-pxa/corgi_pm.c +++ b/arch/arm/mach-pxa/corgi_pm.c @@ -198,7 +198,7 @@ static struct sharpsl_charger_machinfo corgi_pm_machinfo = {  static struct platform_device *corgipm_device; -static int __devinit corgipm_init(void) +static int corgipm_init(void)  {  	int ret; diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h index a611ad3153c..b6132aa95dc 100644 --- a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h +++ b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h @@ -463,6 +463,9 @@  	GPIO76_LCD_PCLK,	\  	GPIO77_LCD_BIAS +/* these enable a work-around for a hw bug in pxa27x during ac97 warm reset */ +#define GPIO113_AC97_nRESET_GPIO_HIGH MFP_CFG_OUT(GPIO113, AF0, DEFAULT) +#define GPIO95_AC97_nRESET_GPIO_HIGH MFP_CFG_OUT(GPIO95, AF0, DEFAULT)  extern int keypad_set_wake(unsigned int on);  #endif /* __ASM_ARCH_MFP_PXA27X_H */ diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 8047ee0effc..616cb87b617 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c @@ -47,9 +47,9 @@ void pxa27x_clear_otgph(void)  EXPORT_SYMBOL(pxa27x_clear_otgph);  static unsigned long ac97_reset_config[] = { -	GPIO113_GPIO, +	GPIO113_AC97_nRESET_GPIO_HIGH,  	GPIO113_AC97_nRESET, -	GPIO95_GPIO, +	GPIO95_AC97_nRESET_GPIO_HIGH,  	GPIO95_AC97_nRESET,  }; diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c index ec55c575ed1..0a36d3585f2 100644 --- a/arch/arm/mach-pxa/sharpsl_pm.c +++ b/arch/arm/mach-pxa/sharpsl_pm.c @@ -829,7 +829,7 @@ static const struct platform_suspend_ops sharpsl_pm_ops = {  };  #endif -static int __devinit sharpsl_pm_probe(struct platform_device *pdev) +static int sharpsl_pm_probe(struct platform_device *pdev)  {  	int ret, irq; @@ -941,7 +941,7 @@ static struct platform_driver sharpsl_pm_driver = {  	},  }; -static int __devinit sharpsl_pm_init(void) +static int sharpsl_pm_init(void)  {  	return platform_driver_register(&sharpsl_pm_driver);  } diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c index 842596d4d31..e191f9996b2 100644 --- a/arch/arm/mach-pxa/spitz_pm.c +++ b/arch/arm/mach-pxa/spitz_pm.c @@ -232,7 +232,7 @@ struct sharpsl_charger_machinfo spitz_pm_machinfo = {  static struct platform_device *spitzpm_device; -static int __devinit spitzpm_init(void) +static int spitzpm_init(void)  {  	int ret; diff --git a/arch/arm/mach-pxa/tosa-bt.c b/arch/arm/mach-pxa/tosa-bt.c index b9b1e5c2b29..fc3646c2c69 100644 --- a/arch/arm/mach-pxa/tosa-bt.c +++ b/arch/arm/mach-pxa/tosa-bt.c @@ -102,7 +102,7 @@ err_reset:  	return rc;  } -static int __devexit tosa_bt_remove(struct platform_device *dev) +static int tosa_bt_remove(struct platform_device *dev)  {  	struct tosa_bt_data *data = dev->dev.platform_data;  	struct rfkill *rfk = platform_get_drvdata(dev); @@ -125,7 +125,7 @@ static int __devexit tosa_bt_remove(struct platform_device *dev)  static struct platform_driver tosa_bt_driver = {  	.probe = tosa_bt_probe, -	.remove = __devexit_p(tosa_bt_remove), +	.remove = tosa_bt_remove,  	.driver = {  		.name = "tosa-bt", diff --git a/arch/arm/mach-realview/include/mach/board-eb.h b/arch/arm/mach-realview/include/mach/board-eb.h index 124bce6b4d7..a301e61a555 100644 --- a/arch/arm/mach-realview/include/mach/board-eb.h +++ b/arch/arm/mach-realview/include/mach/board-eb.h @@ -47,7 +47,7 @@  #define REALVIEW_EB_USB_BASE		0x4F000000	/* USB */  #ifdef CONFIG_REALVIEW_EB_ARM11MP_REVB -#define REALVIEW_EB11MP_PRIV_MEM_BASE	0x1F000000 +#define REALVIEW_EB11MP_PRIV_MEM_BASE	0x10100000  #define REALVIEW_EB11MP_L220_BASE	0x10102000	/* L220 registers */  #define REALVIEW_EB11MP_SYS_PLD_CTRL1	0xD8		/* Register offset for MPCore sysctl */  #else diff --git a/arch/arm/mach-s3c24xx/h1940-bluetooth.c b/arch/arm/mach-s3c24xx/h1940-bluetooth.c index 57aee916bdb..3f40c61b6e0 100644 --- a/arch/arm/mach-s3c24xx/h1940-bluetooth.c +++ b/arch/arm/mach-s3c24xx/h1940-bluetooth.c @@ -62,7 +62,7 @@ static const struct rfkill_ops h1940bt_rfkill_ops = {  	.set_block = h1940bt_set_block,  }; -static int __devinit h1940bt_probe(struct platform_device *pdev) +static int h1940bt_probe(struct platform_device *pdev)  {  	struct rfkill *rfk;  	int ret = 0; diff --git a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c index 5876c6ba750..45e74363aaa 100644 --- a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c +++ b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c @@ -93,7 +93,7 @@ static struct notifier_block osiris_dvs_nb = {  	.notifier_call	= osiris_dvs_notify,  }; -static int __devinit osiris_dvs_probe(struct platform_device *pdev) +static int osiris_dvs_probe(struct platform_device *pdev)  {  	int ret; @@ -126,7 +126,7 @@ err_nogpio:  	return ret;  } -static int __devexit osiris_dvs_remove(struct platform_device *pdev) +static int osiris_dvs_remove(struct platform_device *pdev)  {  	dev_info(&pdev->dev, "exiting\n"); @@ -167,7 +167,7 @@ static const struct dev_pm_ops osiris_dvs_pm = {  static struct platform_driver osiris_dvs_driver = {  	.probe		= osiris_dvs_probe, -	.remove		= __devexit_p(osiris_dvs_remove), +	.remove		= osiris_dvs_remove,  	.driver		= {  		.name	= "osiris-dvs",  		.owner	= THIS_MODULE, diff --git a/arch/arm/mach-s3c64xx/clock.c b/arch/arm/mach-s3c64xx/clock.c index 1a6f8577744..803711e283b 100644 --- a/arch/arm/mach-s3c64xx/clock.c +++ b/arch/arm/mach-s3c64xx/clock.c @@ -149,25 +149,6 @@ static struct clk init_clocks_off[] = {  		.enable		= s3c64xx_pclk_ctrl,  		.ctrlbit	= S3C6410_CLKCON_PCLK_I2C1,  	}, { -		.name		= "iis", -		.devname	= "samsung-i2s.0", -		.parent		= &clk_p, -		.enable		= s3c64xx_pclk_ctrl, -		.ctrlbit	= S3C_CLKCON_PCLK_IIS0, -	}, { -		.name		= "iis", -		.devname	= "samsung-i2s.1", -		.parent		= &clk_p, -		.enable		= s3c64xx_pclk_ctrl, -		.ctrlbit	= S3C_CLKCON_PCLK_IIS1, -	}, { -#ifdef CONFIG_CPU_S3C6410 -		.name		= "iis", -		.parent		= &clk_p, -		.enable		= s3c64xx_pclk_ctrl, -		.ctrlbit	= S3C6410_CLKCON_PCLK_IIS2, -	}, { -#endif  		.name		= "keypad",  		.parent		= &clk_p,  		.enable		= s3c64xx_pclk_ctrl, @@ -337,6 +318,32 @@ static struct clk clk_48m_spi1 = {  	.ctrlbit	= S3C_CLKCON_SCLK_SPI1_48,  }; +static struct clk clk_i2s0 = { +	.name		= "iis", +	.devname	= "samsung-i2s.0", +	.parent		= &clk_p, +	.enable		= s3c64xx_pclk_ctrl, +	.ctrlbit	= S3C_CLKCON_PCLK_IIS0, +}; + +static struct clk clk_i2s1 = { +	.name		= "iis", +	.devname	= "samsung-i2s.1", +	.parent		= &clk_p, +	.enable		= s3c64xx_pclk_ctrl, +	.ctrlbit	= S3C_CLKCON_PCLK_IIS1, +}; + +#ifdef CONFIG_CPU_S3C6410 +static struct clk clk_i2s2 = { +	.name		= "iis", +	.devname	= "samsung-i2s.2", +	.parent		= &clk_p, +	.enable		= s3c64xx_pclk_ctrl, +	.ctrlbit	= S3C6410_CLKCON_PCLK_IIS2, +}; +#endif +  static struct clk init_clocks[] = {  	{  		.name		= "lcd", @@ -660,6 +667,7 @@ static struct clksrc_sources clkset_audio1 = {  	.nr_sources	= ARRAY_SIZE(clkset_audio1_list),  }; +#ifdef CONFIG_CPU_S3C6410  static struct clk *clkset_audio2_list[] = {  	[0] = &clk_mout_epll.clk,  	[1] = &clk_dout_mpll, @@ -672,6 +680,7 @@ static struct clksrc_sources clkset_audio2 = {  	.sources	= clkset_audio2_list,  	.nr_sources	= ARRAY_SIZE(clkset_audio2_list),  }; +#endif  static struct clksrc_clk clksrcs[] = {  	{ @@ -685,36 +694,6 @@ static struct clksrc_clk clksrcs[] = {  		.sources	= &clkset_uhost,  	}, {  		.clk	= { -			.name		= "audio-bus", -			.devname	= "samsung-i2s.0", -			.ctrlbit        = S3C_CLKCON_SCLK_AUDIO0, -			.enable		= s3c64xx_sclk_ctrl, -		}, -		.reg_src	= { .reg = S3C_CLK_SRC, .shift = 7, .size = 3  }, -		.reg_div	= { .reg = S3C_CLK_DIV2, .shift = 8, .size = 4  }, -		.sources	= &clkset_audio0, -	}, { -		.clk	= { -			.name		= "audio-bus", -			.devname	= "samsung-i2s.1", -			.ctrlbit        = S3C_CLKCON_SCLK_AUDIO1, -			.enable		= s3c64xx_sclk_ctrl, -		}, -		.reg_src	= { .reg = S3C_CLK_SRC, .shift = 10, .size = 3  }, -		.reg_div	= { .reg = S3C_CLK_DIV2, .shift = 12, .size = 4  }, -		.sources	= &clkset_audio1, -	}, { -		.clk	= { -			.name		= "audio-bus", -			.devname	= "samsung-i2s.2", -			.ctrlbit        = S3C6410_CLKCON_SCLK_AUDIO2, -			.enable		= s3c64xx_sclk_ctrl, -		}, -		.reg_src	= { .reg = S3C6410_CLK_SRC2, .shift = 0, .size = 3  }, -		.reg_div	= { .reg = S3C_CLK_DIV2, .shift = 24, .size = 4  }, -		.sources	= &clkset_audio2, -	}, { -		.clk	= {  			.name		= "irda-bus",  			.ctrlbit        = S3C_CLKCON_SCLK_IRDA,  			.enable		= s3c64xx_sclk_ctrl, @@ -805,6 +784,43 @@ static struct clksrc_clk clk_sclk_spi1 = {  	.sources = &clkset_spi_mmc,  }; +static struct clksrc_clk clk_audio_bus0 = { +	.clk	= { +		.name		= "audio-bus", +		.devname	= "samsung-i2s.0", +		.ctrlbit	= S3C_CLKCON_SCLK_AUDIO0, +		.enable		= s3c64xx_sclk_ctrl, +	}, +	.reg_src	= { .reg = S3C_CLK_SRC, .shift = 7, .size = 3  }, +	.reg_div	= { .reg = S3C_CLK_DIV2, .shift = 8, .size = 4  }, +	.sources	= &clkset_audio0, +}; + +static struct clksrc_clk clk_audio_bus1 = { +	.clk	= { +		.name		= "audio-bus", +		.devname	= "samsung-i2s.1", +		.ctrlbit	= S3C_CLKCON_SCLK_AUDIO1, +		.enable		= s3c64xx_sclk_ctrl, +	}, +	.reg_src	= { .reg = S3C_CLK_SRC, .shift = 10, .size = 3  }, +	.reg_div	= { .reg = S3C_CLK_DIV2, .shift = 12, .size = 4  }, +	.sources	= &clkset_audio1, +}; + +#ifdef CONFIG_CPU_S3C6410 +static struct clksrc_clk clk_audio_bus2 = { +	.clk	= { +		.name		= "audio-bus", +		.devname	= "samsung-i2s.2", +		.ctrlbit	= S3C6410_CLKCON_SCLK_AUDIO2, +		.enable		= s3c64xx_sclk_ctrl, +	}, +	.reg_src	= { .reg = S3C6410_CLK_SRC2, .shift = 0, .size = 3  }, +	.reg_div	= { .reg = S3C_CLK_DIV2, .shift = 24, .size = 4  }, +	.sources	= &clkset_audio2, +}; +#endif  /* Clock initialisation code */  static struct clksrc_clk *init_parents[] = { @@ -820,6 +836,8 @@ static struct clksrc_clk *clksrc_cdev[] = {  	&clk_sclk_mmc2,  	&clk_sclk_spi0,  	&clk_sclk_spi1, +	&clk_audio_bus0, +	&clk_audio_bus1,  };  static struct clk *clk_cdev[] = { @@ -828,6 +846,8 @@ static struct clk *clk_cdev[] = {  	&clk_hsmmc2,  	&clk_48m_spi0,  	&clk_48m_spi1, +	&clk_i2s0, +	&clk_i2s1,  };  static struct clk_lookup s3c64xx_clk_lookup[] = { @@ -844,6 +864,14 @@ static struct clk_lookup s3c64xx_clk_lookup[] = {  	CLKDEV_INIT("s3c6410-spi.0", "spi_busclk2", &clk_48m_spi0),  	CLKDEV_INIT("s3c6410-spi.1", "spi_busclk1", &clk_sclk_spi1.clk),  	CLKDEV_INIT("s3c6410-spi.1", "spi_busclk2", &clk_48m_spi1), +	CLKDEV_INIT("samsung-i2s.0", "i2s_opclk0", &clk_i2s0), +	CLKDEV_INIT("samsung-i2s.0", "i2s_opclk1", &clk_audio_bus0.clk), +	CLKDEV_INIT("samsung-i2s.1", "i2s_opclk0", &clk_i2s1), +	CLKDEV_INIT("samsung-i2s.1", "i2s_opclk1", &clk_audio_bus1.clk), +#ifdef CONFIG_CPU_S3C6410 +	CLKDEV_INIT("samsung-i2s.2", "i2s_opclk0", &clk_i2s2), +	CLKDEV_INIT("samsung-i2s.2", "i2s_opclk1", &clk_audio_bus2.clk), +#endif  };  #define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c index 35f3e07eacc..e367e87bbc2 100644 --- a/arch/arm/mach-s3c64xx/dev-audio.c +++ b/arch/arm/mach-s3c64xx/dev-audio.c @@ -23,11 +23,6 @@  #include <linux/platform_data/asoc-s3c.h>  #include <plat/gpio-cfg.h> -static const char *rclksrc[] = { -	[0] = "iis", -	[1] = "audio-bus", -}; -  static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev)  {  	unsigned int base; @@ -64,11 +59,6 @@ static struct resource s3c64xx_iis0_resource[] = {  static struct s3c_audio_pdata i2sv3_pdata = {  	.cfg_gpio = s3c64xx_i2s_cfg_gpio, -	.type = { -		.i2s = { -			.src_clk = rclksrc, -		}, -	},  };  struct platform_device s3c64xx_device_iis0 = { @@ -110,7 +100,6 @@ static struct s3c_audio_pdata i2sv4_pdata = {  	.type = {  		.i2s = {  			.quirks = QUIRK_PRI_6CHAN, -			.src_clk = rclksrc,  		},  	},  }; diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c index c6d8dba9062..553059f5184 100644 --- a/arch/arm/mach-s3c64xx/mach-crag6410-module.c +++ b/arch/arm/mach-s3c64xx/mach-crag6410-module.c @@ -290,7 +290,7 @@ static const struct i2c_board_info wm2200_i2c[] = {  	  .platform_data = &wm2200_pdata, },  }; -static __devinitdata const struct { +static const struct {  	u8 id;  	u8 rev;  	const char *name; @@ -343,8 +343,8 @@ static __devinitdata const struct {  	  .i2c_devs = wm2200_i2c, .num_i2c_devs = ARRAY_SIZE(wm2200_i2c) },  }; -static __devinit int wlf_gf_module_probe(struct i2c_client *i2c, -					 const struct i2c_device_id *i2c_id) +static int wlf_gf_module_probe(struct i2c_client *i2c, +			       const struct i2c_device_id *i2c_id)  {  	int ret, i, j, id, rev; diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c index cdde249166b..bf6311a28f3 100644 --- a/arch/arm/mach-s3c64xx/mach-crag6410.c +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c @@ -171,7 +171,7 @@ static struct fb_videomode crag6410_lcd_timing = {  };  /* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */ -static struct s3c_fb_platdata crag6410_lcd_pdata __devinitdata = { +static struct s3c_fb_platdata crag6410_lcd_pdata = {  	.setup_gpio	= s3c64xx_fb_gpio_setup_24bpp,  	.vtiming	= &crag6410_lcd_timing,  	.win[0]		= &crag6410_fb_win0, @@ -181,7 +181,7 @@ static struct s3c_fb_platdata crag6410_lcd_pdata __devinitdata = {  /* 2x6 keypad */ -static uint32_t crag6410_keymap[] __devinitdata = { +static uint32_t crag6410_keymap[] = {  	/* KEY(row, col, keycode) */  	KEY(0, 0, KEY_VOLUMEUP),  	KEY(0, 1, KEY_HOME), @@ -197,12 +197,12 @@ static uint32_t crag6410_keymap[] __devinitdata = {  	KEY(1, 5, KEY_CAMERA),  }; -static struct matrix_keymap_data crag6410_keymap_data __devinitdata = { +static struct matrix_keymap_data crag6410_keymap_data = {  	.keymap		= crag6410_keymap,  	.keymap_size	= ARRAY_SIZE(crag6410_keymap),  }; -static struct samsung_keypad_platdata crag6410_keypad_data __devinitdata = { +static struct samsung_keypad_platdata crag6410_keypad_data = {  	.keymap_data	= &crag6410_keymap_data,  	.rows		= 2,  	.cols		= 6, @@ -407,11 +407,11 @@ static struct wm831x_buckv_pdata vddarm_pdata = {  	.dvs_gpio = S3C64XX_GPK(0),  }; -static struct regulator_consumer_supply vddarm_consumers[] __devinitdata = { +static struct regulator_consumer_supply vddarm_consumers[] = {  	REGULATOR_SUPPLY("vddarm", NULL),  }; -static struct regulator_init_data vddarm __devinitdata = { +static struct regulator_init_data vddarm = {  	.constraints = {  		.name = "VDDARM",  		.min_uV = 1000000, @@ -425,11 +425,11 @@ static struct regulator_init_data vddarm __devinitdata = {  	.driver_data = &vddarm_pdata,  }; -static struct regulator_consumer_supply vddint_consumers[] __devinitdata = { +static struct regulator_consumer_supply vddint_consumers[] = {  	REGULATOR_SUPPLY("vddint", NULL),  }; -static struct regulator_init_data vddint __devinitdata = { +static struct regulator_init_data vddint = {  	.constraints = {  		.name = "VDDINT",  		.min_uV = 1000000, @@ -442,27 +442,27 @@ static struct regulator_init_data vddint __devinitdata = {  	.supply_regulator = "WALLVDD",  }; -static struct regulator_init_data vddmem __devinitdata = { +static struct regulator_init_data vddmem = {  	.constraints = {  		.name = "VDDMEM",  		.always_on = 1,  	},  }; -static struct regulator_init_data vddsys __devinitdata = { +static struct regulator_init_data vddsys = {  	.constraints = {  		.name = "VDDSYS,VDDEXT,VDDPCM,VDDSS",  		.always_on = 1,  	},  }; -static struct regulator_consumer_supply vddmmc_consumers[] __devinitdata = { +static struct regulator_consumer_supply vddmmc_consumers[] = {  	REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"),  	REGULATOR_SUPPLY("vmmc", "s3c-sdhci.1"),  	REGULATOR_SUPPLY("vmmc", "s3c-sdhci.2"),  }; -static struct regulator_init_data vddmmc __devinitdata = { +static struct regulator_init_data vddmmc = {  	.constraints = {  		.name = "VDDMMC,UH",  		.always_on = 1, @@ -472,7 +472,7 @@ static struct regulator_init_data vddmmc __devinitdata = {  	.supply_regulator = "WALLVDD",  }; -static struct regulator_init_data vddotgi __devinitdata = { +static struct regulator_init_data vddotgi = {  	.constraints = {  		.name = "VDDOTGi",  		.always_on = 1, @@ -480,7 +480,7 @@ static struct regulator_init_data vddotgi __devinitdata = {  	.supply_regulator = "WALLVDD",  }; -static struct regulator_init_data vddotg __devinitdata = { +static struct regulator_init_data vddotg = {  	.constraints = {  		.name = "VDDOTG",  		.always_on = 1, @@ -488,7 +488,7 @@ static struct regulator_init_data vddotg __devinitdata = {  	.supply_regulator = "WALLVDD",  }; -static struct regulator_init_data vddhi __devinitdata = { +static struct regulator_init_data vddhi = {  	.constraints = {  		.name = "VDDHI",  		.always_on = 1, @@ -496,7 +496,7 @@ static struct regulator_init_data vddhi __devinitdata = {  	.supply_regulator = "WALLVDD",  }; -static struct regulator_init_data vddadc __devinitdata = { +static struct regulator_init_data vddadc = {  	.constraints = {  		.name = "VDDADC,VDDDAC",  		.always_on = 1, @@ -504,7 +504,7 @@ static struct regulator_init_data vddadc __devinitdata = {  	.supply_regulator = "WALLVDD",  }; -static struct regulator_init_data vddmem0 __devinitdata = { +static struct regulator_init_data vddmem0 = {  	.constraints = {  		.name = "VDDMEM0",  		.always_on = 1, @@ -512,7 +512,7 @@ static struct regulator_init_data vddmem0 __devinitdata = {  	.supply_regulator = "WALLVDD",  }; -static struct regulator_init_data vddpll __devinitdata = { +static struct regulator_init_data vddpll = {  	.constraints = {  		.name = "VDDPLL",  		.always_on = 1, @@ -520,7 +520,7 @@ static struct regulator_init_data vddpll __devinitdata = {  	.supply_regulator = "WALLVDD",  }; -static struct regulator_init_data vddlcd __devinitdata = { +static struct regulator_init_data vddlcd = {  	.constraints = {  		.name = "VDDLCD",  		.always_on = 1, @@ -528,7 +528,7 @@ static struct regulator_init_data vddlcd __devinitdata = {  	.supply_regulator = "WALLVDD",  }; -static struct regulator_init_data vddalive __devinitdata = { +static struct regulator_init_data vddalive = {  	.constraints = {  		.name = "VDDALIVE",  		.always_on = 1, @@ -536,28 +536,28 @@ static struct regulator_init_data vddalive __devinitdata = {  	.supply_regulator = "WALLVDD",  }; -static struct wm831x_backup_pdata banff_backup_pdata __devinitdata = { +static struct wm831x_backup_pdata banff_backup_pdata = {  	.charger_enable = 1,  	.vlim = 2500,  /* mV */  	.ilim = 200,   /* uA */  }; -static struct wm831x_status_pdata banff_red_led __devinitdata = { +static struct wm831x_status_pdata banff_red_led = {  	.name = "banff:red:",  	.default_src = WM831X_STATUS_MANUAL,  }; -static struct wm831x_status_pdata banff_green_led __devinitdata = { +static struct wm831x_status_pdata banff_green_led = {  	.name = "banff:green:",  	.default_src = WM831X_STATUS_MANUAL,  }; -static struct wm831x_touch_pdata touch_pdata __devinitdata = { +static struct wm831x_touch_pdata touch_pdata = {  	.data_irq = S3C_EINT(26),  	.pd_irq = S3C_EINT(27),  }; -static struct wm831x_pdata crag_pmic_pdata __devinitdata = { +static struct wm831x_pdata crag_pmic_pdata = {  	.wm831x_num = 1,  	.gpio_base = BANFF_PMIC_GPIO_BASE,  	.soft_shutdown = true, @@ -601,7 +601,7 @@ static struct wm831x_pdata crag_pmic_pdata __devinitdata = {  	.touch = &touch_pdata,  }; -static struct i2c_board_info i2c_devs0[] __devinitdata = { +static struct i2c_board_info i2c_devs0[] = {  	{ I2C_BOARD_INFO("24c08", 0x50), },  	{ I2C_BOARD_INFO("tca6408", 0x20),  	  .platform_data = &crag6410_pca_data, @@ -616,13 +616,13 @@ static struct s3c2410_platform_i2c i2c0_pdata = {  	.frequency = 400000,  }; -static struct regulator_consumer_supply pvdd_1v2_consumers[] __devinitdata = { +static struct regulator_consumer_supply pvdd_1v2_consumers[] = {  	REGULATOR_SUPPLY("DCVDD", "spi0.0"),  	REGULATOR_SUPPLY("AVDD", "spi0.0"),  	REGULATOR_SUPPLY("AVDD", "spi0.1"),  }; -static struct regulator_init_data pvdd_1v2 __devinitdata = { +static struct regulator_init_data pvdd_1v2 = {  	.constraints = {  		.name = "PVDD_1V2",  		.valid_ops_mask = REGULATOR_CHANGE_STATUS, @@ -632,7 +632,7 @@ static struct regulator_init_data pvdd_1v2 __devinitdata = {  	.num_consumer_supplies = ARRAY_SIZE(pvdd_1v2_consumers),  }; -static struct regulator_consumer_supply pvdd_1v8_consumers[] __devinitdata = { +static struct regulator_consumer_supply pvdd_1v8_consumers[] = {  	REGULATOR_SUPPLY("LDOVDD", "1-001a"),  	REGULATOR_SUPPLY("PLLVDD", "1-001a"),  	REGULATOR_SUPPLY("DBVDD", "1-001a"), @@ -664,7 +664,7 @@ static struct regulator_consumer_supply pvdd_1v8_consumers[] __devinitdata = {  	REGULATOR_SUPPLY("CPVDD", "wm5110-codec"),  }; -static struct regulator_init_data pvdd_1v8 __devinitdata = { +static struct regulator_init_data pvdd_1v8 = {  	.constraints = {  		.name = "PVDD_1V8",  		.always_on = 1, @@ -674,12 +674,12 @@ static struct regulator_init_data pvdd_1v8 __devinitdata = {  	.num_consumer_supplies = ARRAY_SIZE(pvdd_1v8_consumers),  }; -static struct regulator_consumer_supply pvdd_3v3_consumers[] __devinitdata = { +static struct regulator_consumer_supply pvdd_3v3_consumers[] = {  	REGULATOR_SUPPLY("MICVDD", "1-001a"),  	REGULATOR_SUPPLY("AVDD1", "1-001a"),  }; -static struct regulator_init_data pvdd_3v3 __devinitdata = { +static struct regulator_init_data pvdd_3v3 = {  	.constraints = {  		.name = "PVDD_3V3",  		.always_on = 1, @@ -689,7 +689,7 @@ static struct regulator_init_data pvdd_3v3 __devinitdata = {  	.num_consumer_supplies = ARRAY_SIZE(pvdd_3v3_consumers),  }; -static struct wm831x_pdata glenfarclas_pmic_pdata __devinitdata = { +static struct wm831x_pdata glenfarclas_pmic_pdata = {  	.wm831x_num = 2,  	.irq_base = GLENFARCLAS_PMIC_IRQ_BASE,  	.gpio_base = GLENFARCLAS_PMIC_GPIO_BASE, @@ -721,7 +721,7 @@ static struct wm1250_ev1_pdata wm1250_ev1_pdata = {  	},  }; -static struct i2c_board_info i2c_devs1[] __devinitdata = { +static struct i2c_board_info i2c_devs1[] = {  	{ I2C_BOARD_INFO("wm8311", 0x34),  	  .irq = S3C_EINT(0),  	  .platform_data = &glenfarclas_pmic_pdata }, diff --git a/arch/arm/mach-s5p64x0/clock-s5p6440.c b/arch/arm/mach-s5p64x0/clock-s5p6440.c index 000445596ec..5112371079d 100644 --- a/arch/arm/mach-s5p64x0/clock-s5p6440.c +++ b/arch/arm/mach-s5p64x0/clock-s5p6440.c @@ -243,12 +243,6 @@ static struct clk init_clocks_off[] = {  		.enable		= s5p64x0_pclk_ctrl,  		.ctrlbit	= (1 << 25),  	}, { -		.name		= "iis", -		.devname	= "samsung-i2s.0", -		.parent		= &clk_pclk_low.clk, -		.enable		= s5p64x0_pclk_ctrl, -		.ctrlbit	= (1 << 26), -	}, {  		.name		= "dsim",  		.parent		= &clk_pclk_low.clk,  		.enable		= s5p64x0_pclk_ctrl, @@ -405,15 +399,6 @@ static struct clksrc_clk clksrcs[] = {  		.sources = &clkset_group1,  		.reg_src = { .reg = S5P64X0_CLK_SRC1, .shift = 8, .size = 2 },  		.reg_div = { .reg = S5P64X0_CLK_DIV3, .shift = 4, .size = 4 }, -	}, { -		.clk	= { -			.name		= "sclk_audio2", -			.ctrlbit	= (1 << 11), -			.enable		= s5p64x0_sclk_ctrl, -		}, -		.sources = &clkset_audio, -		.reg_src = { .reg = S5P64X0_CLK_SRC1, .shift = 0, .size = 3 }, -		.reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 24, .size = 4 },  	},  }; @@ -464,6 +449,26 @@ static struct clksrc_clk clk_sclk_uclk = {  	.reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 },  }; +static struct clk clk_i2s0 = { +	.name		= "iis", +	.devname	= "samsung-i2s.0", +	.parent		= &clk_pclk_low.clk, +	.enable		= s5p64x0_pclk_ctrl, +	.ctrlbit	= (1 << 26), +}; + +static struct clksrc_clk clk_audio_bus2 = { +	.clk	= { +		.name		= "sclk_audio2", +		.devname	= "samsung-i2s.0", +		.ctrlbit	= (1 << 11), +		.enable		= s5p64x0_sclk_ctrl, +	}, +	.sources = &clkset_audio, +	.reg_src = { .reg = S5P64X0_CLK_SRC1, .shift = 0, .size = 3 }, +	.reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 24, .size = 4 }, +}; +  static struct clksrc_clk clk_sclk_spi0 = {  	.clk	= {  		.name		= "sclk_spi", @@ -506,13 +511,18 @@ static struct clk dummy_apb_pclk = {  	.id		= -1,  }; +static struct clk *clk_cdev[] = { +	&clk_i2s0, +}; +  static struct clksrc_clk *clksrc_cdev[] = {  	&clk_sclk_uclk,  	&clk_sclk_spi0,  	&clk_sclk_spi1,  	&clk_sclk_mmc0,  	&clk_sclk_mmc1, -	&clk_sclk_mmc2 +	&clk_sclk_mmc2, +	&clk_audio_bus2,  };  static struct clk_lookup s5p6440_clk_lookup[] = { @@ -524,6 +534,8 @@ static struct clk_lookup s5p6440_clk_lookup[] = {  	CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),  	CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),  	CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk), +	CLKDEV_INIT("samsung-i2s.0", "i2s_opclk0", &clk_i2s0), +	CLKDEV_INIT("samsung-i2s.0", "i2s_opclk1", &clk_audio_bus2.clk),  };  void __init_or_cpufreq s5p6440_setup_clocks(void) @@ -596,12 +608,17 @@ static struct clk *clks[] __initdata = {  void __init s5p6440_register_clocks(void)  {  	int ptr; +	unsigned int cnt;  	s3c24xx_register_clocks(clks, ARRAY_SIZE(clks));  	for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++)  		s3c_register_clksrc(sysclks[ptr], 1); +	s3c24xx_register_clocks(clk_cdev, ARRAY_SIZE(clk_cdev)); +	for (cnt = 0; cnt < ARRAY_SIZE(clk_cdev); cnt++) +		s3c_disable_clocks(clk_cdev[cnt], 1); +  	s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));  	s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));  	for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) diff --git a/arch/arm/mach-s5p64x0/clock-s5p6450.c b/arch/arm/mach-s5p64x0/clock-s5p6450.c index f3e0ef3d27c..154dea702d7 100644 --- a/arch/arm/mach-s5p64x0/clock-s5p6450.c +++ b/arch/arm/mach-s5p64x0/clock-s5p6450.c @@ -247,24 +247,6 @@ static struct clk init_clocks_off[] = {  		.enable		= s5p64x0_pclk_ctrl,  		.ctrlbit	= (1 << 22),  	}, { -		.name		= "iis", -		.devname	= "samsung-i2s.0", -		.parent		= &clk_pclk_low.clk, -		.enable		= s5p64x0_pclk_ctrl, -		.ctrlbit	= (1 << 26), -	}, { -		.name		= "iis", -		.devname	= "samsung-i2s.1", -		.parent		= &clk_pclk_low.clk, -		.enable		= s5p64x0_pclk_ctrl, -		.ctrlbit	= (1 << 15), -	}, { -		.name		= "iis", -		.devname	= "samsung-i2s.2", -		.parent		= &clk_pclk_low.clk, -		.enable		= s5p64x0_pclk_ctrl, -		.ctrlbit	= (1 << 16), -	}, {  		.name		= "i2c",  		.devname	= "s3c2440-i2c.1",  		.parent		= &clk_pclk_low.clk, @@ -402,6 +384,7 @@ static struct clksrc_sources clkset_sclk_audio0 = {  static struct clksrc_clk clk_sclk_audio0 = {  	.clk		= {  		.name		= "audio-bus", +		.devname	= "samsung-i2s.0",  		.enable		= s5p64x0_sclk_ctrl,  		.ctrlbit	= (1 << 8),  		.parent		= &clk_dout_epll.clk, @@ -549,6 +532,36 @@ static struct clksrc_clk clk_sclk_spi1 = {  	.reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 4, .size = 4 },  }; +static struct clk clk_i2s0 = { +	.name		= "iis", +	.devname	= "samsung-i2s.0", +	.parent		= &clk_pclk_low.clk, +	.enable		= s5p64x0_pclk_ctrl, +	.ctrlbit	= (1 << 26), +}; + +static struct clk clk_i2s1 = { +	.name		= "iis", +	.devname	= "samsung-i2s.1", +	.parent		= &clk_pclk_low.clk, +	.enable		= s5p64x0_pclk_ctrl, +	.ctrlbit	= (1 << 15), +}; + +static struct clk clk_i2s2 = { +	.name		= "iis", +	.devname	= "samsung-i2s.2", +	.parent		= &clk_pclk_low.clk, +	.enable		= s5p64x0_pclk_ctrl, +	.ctrlbit	= (1 << 16), +}; + +static struct clk *clk_cdev[] = { +	&clk_i2s0, +	&clk_i2s1, +	&clk_i2s2, +}; +  static struct clksrc_clk *clksrc_cdev[] = {  	&clk_sclk_uclk,  	&clk_sclk_spi0, @@ -556,6 +569,7 @@ static struct clksrc_clk *clksrc_cdev[] = {  	&clk_sclk_mmc0,  	&clk_sclk_mmc1,  	&clk_sclk_mmc2, +	&clk_sclk_audio0,  };  static struct clk_lookup s5p6450_clk_lookup[] = { @@ -567,6 +581,10 @@ static struct clk_lookup s5p6450_clk_lookup[] = {  	CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),  	CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),  	CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk), +	CLKDEV_INIT("samsung-i2s.0", "i2s_opclk0", &clk_i2s0), +	CLKDEV_INIT("samsung-i2s.0", "i2s_opclk1", &clk_sclk_audio0.clk), +	CLKDEV_INIT("samsung-i2s.1", "i2s_opclk0", &clk_i2s1), +	CLKDEV_INIT("samsung-i2s.2", "i2s_opclk0", &clk_i2s2),  };  /* Clock initialization code */ @@ -584,7 +602,6 @@ static struct clksrc_clk *sysclks[] = {  	&clk_pclk,  	&clk_hclk_low,  	&clk_pclk_low, -	&clk_sclk_audio0,  };  static struct clk dummy_apb_pclk = { @@ -661,10 +678,16 @@ void __init_or_cpufreq s5p6450_setup_clocks(void)  void __init s5p6450_register_clocks(void)  {  	int ptr; +	unsigned int cnt;  	for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++)  		s3c_register_clksrc(sysclks[ptr], 1); + +	s3c24xx_register_clocks(clk_cdev, ARRAY_SIZE(clk_cdev)); +	for (cnt = 0; cnt < ARRAY_SIZE(clk_cdev); cnt++) +		s3c_disable_clocks(clk_cdev[cnt], 1); +  	s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));  	s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));  	for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) diff --git a/arch/arm/mach-s5p64x0/dev-audio.c b/arch/arm/mach-s5p64x0/dev-audio.c index a0d6edfd23a..723d4773c32 100644 --- a/arch/arm/mach-s5p64x0/dev-audio.c +++ b/arch/arm/mach-s5p64x0/dev-audio.c @@ -19,11 +19,6 @@  #include <mach/dma.h>  #include <mach/irqs.h> -static const char *rclksrc[] = { -	[0] = "iis", -	[1] = "sclk_audio2", -}; -  static int s5p6440_cfg_i2s(struct platform_device *pdev)  {  	switch (pdev->id) { @@ -45,7 +40,6 @@ static struct s3c_audio_pdata s5p6440_i2s_pdata = {  	.type = {  		.i2s = {  			.quirks = QUIRK_PRI_6CHAN, -			.src_clk = rclksrc,  		},  	},  }; @@ -93,7 +87,6 @@ static struct s3c_audio_pdata s5p6450_i2s0_pdata = {  	.type = {  		.i2s = {  			.quirks = QUIRK_PRI_6CHAN, -			.src_clk = rclksrc,  		},  	},  }; @@ -110,11 +103,6 @@ struct platform_device s5p6450_device_iis0 = {  static struct s3c_audio_pdata s5p6450_i2s_pdata = {  	.cfg_gpio = s5p6450_cfg_i2s, -	.type = { -		.i2s = { -			.src_clk = rclksrc, -		}, -	},  };  static struct resource s5p6450_i2s1_resource[] = { diff --git a/arch/arm/mach-s5pc100/clock.c b/arch/arm/mach-s5pc100/clock.c index 926219791f0..a206dc35eff 100644 --- a/arch/arm/mach-s5pc100/clock.c +++ b/arch/arm/mach-s5pc100/clock.c @@ -606,24 +606,6 @@ static struct clk init_clocks_off[] = {  		.enable		= s5pc100_d1_4_ctrl,  		.ctrlbit	= (1 << 13),  	}, { -		.name		= "iis", -		.devname	= "samsung-i2s.0", -		.parent		= &clk_div_pclkd1.clk, -		.enable		= s5pc100_d1_5_ctrl, -		.ctrlbit	= (1 << 0), -	}, { -		.name		= "iis", -		.devname	= "samsung-i2s.1", -		.parent		= &clk_div_pclkd1.clk, -		.enable		= s5pc100_d1_5_ctrl, -		.ctrlbit	= (1 << 1), -	}, { -		.name		= "iis", -		.devname	= "samsung-i2s.2", -		.parent		= &clk_div_pclkd1.clk, -		.enable		= s5pc100_d1_5_ctrl, -		.ctrlbit	= (1 << 2), -	}, {  		.name		= "ac97",  		.parent		= &clk_div_pclkd1.clk,  		.enable		= s5pc100_d1_5_ctrl, @@ -724,6 +706,30 @@ static struct clk clk_48m_spi2 = {  	.ctrlbit	= (1 << 9),  }; +static struct clk clk_i2s0 = { +	.name		= "iis", +	.devname	= "samsung-i2s.0", +	.parent		= &clk_div_pclkd1.clk, +	.enable		= s5pc100_d1_5_ctrl, +	.ctrlbit	= (1 << 0), +}; + +static struct clk clk_i2s1 = { +	.name		= "iis", +	.devname	= "samsung-i2s.1", +	.parent		= &clk_div_pclkd1.clk, +	.enable		= s5pc100_d1_5_ctrl, +	.ctrlbit	= (1 << 1), +}; + +static struct clk clk_i2s2 = { +	.name		= "iis", +	.devname	= "samsung-i2s.2", +	.parent		= &clk_div_pclkd1.clk, +	.enable		= s5pc100_d1_5_ctrl, +	.ctrlbit	= (1 << 2), +}; +  static struct clk clk_vclk54m = {  	.name		= "vclk_54m",  	.rate		= 54000000, @@ -1154,6 +1160,9 @@ static struct clk *clk_cdev[] = {  	&clk_48m_spi0,  	&clk_48m_spi1,  	&clk_48m_spi2, +	&clk_i2s0, +	&clk_i2s1, +	&clk_i2s2,  };  static struct clksrc_clk *clksrc_cdev[] = { @@ -1321,6 +1330,9 @@ static struct clk_lookup s5pc100_clk_lookup[] = {  	CLKDEV_INIT("s5pc100-spi.1", "spi_busclk2", &clk_sclk_spi1.clk),  	CLKDEV_INIT("s5pc100-spi.2", "spi_busclk1", &clk_48m_spi2),  	CLKDEV_INIT("s5pc100-spi.2", "spi_busclk2", &clk_sclk_spi2.clk), +	CLKDEV_INIT("samsung-i2s.0", "i2s_opclk0", &clk_i2s0), +	CLKDEV_INIT("samsung-i2s.1", "i2s_opclk0", &clk_i2s1), +	CLKDEV_INIT("samsung-i2s.2", "i2s_opclk0", &clk_i2s2),  };  void __init s5pc100_register_clocks(void) diff --git a/arch/arm/mach-s5pc100/dev-audio.c b/arch/arm/mach-s5pc100/dev-audio.c index 1cc252cef26..46f488b0939 100644 --- a/arch/arm/mach-s5pc100/dev-audio.c +++ b/arch/arm/mach-s5pc100/dev-audio.c @@ -39,18 +39,12 @@ static int s5pc100_cfg_i2s(struct platform_device *pdev)  	return 0;  } -static const char *rclksrc_v5[] = { -	[0] = "iis", -	[1] = "i2sclkd2", -}; -  static struct s3c_audio_pdata i2sv5_pdata = {  	.cfg_gpio = s5pc100_cfg_i2s,  	.type = {  		.i2s = {  			.quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI  					 | QUIRK_NEED_RSTCLR, -			.src_clk = rclksrc_v5,  		},  	},  }; @@ -72,18 +66,8 @@ struct platform_device s5pc100_device_iis0 = {  	},  }; -static const char *rclksrc_v3[] = { -	[0] = "iis", -	[1] = "sclk_audio", -}; -  static struct s3c_audio_pdata i2sv3_pdata = {  	.cfg_gpio = s5pc100_cfg_i2s, -	.type = { -		.i2s = { -			.src_clk = rclksrc_v3, -		}, -	},  };  static struct resource s5pc100_iis1_resource[] = { diff --git a/arch/arm/mach-s5pv210/dev-audio.c b/arch/arm/mach-s5pv210/dev-audio.c index 0a5480bbcbd..addfb165c13 100644 --- a/arch/arm/mach-s5pv210/dev-audio.c +++ b/arch/arm/mach-s5pv210/dev-audio.c @@ -20,11 +20,6 @@  #include <mach/irqs.h>  #include <mach/regs-audss.h> -static const char *rclksrc[] = { -	[0] = "busclk", -	[1] = "i2sclk", -}; -  static int s5pv210_cfg_i2s(struct platform_device *pdev)  {  	/* configure GPIO for i2s port */ @@ -52,7 +47,6 @@ static struct s3c_audio_pdata i2sv5_pdata = {  		.i2s = {  			.quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI  					 | QUIRK_NEED_RSTCLR, -			.src_clk = rclksrc,  			.idma_addr = S5PV210_AUDSS_INT_MEM,  		},  	}, @@ -75,18 +69,8 @@ struct platform_device s5pv210_device_iis0 = {  	},  }; -static const char *rclksrc_v3[] = { -	[0] = "iis", -	[1] = "audio-bus", -}; -  static struct s3c_audio_pdata i2sv3_pdata = {  	.cfg_gpio = s5pv210_cfg_i2s, -	.type = { -		.i2s = { -			.src_clk = rclksrc_v3, -		}, -	},  };  static struct resource s5pv210_iis1_resource[] = { diff --git a/arch/arm/mach-sa1100/jornada720_ssp.c b/arch/arm/mach-sa1100/jornada720_ssp.c index 7f07f08d896..b143c465934 100644 --- a/arch/arm/mach-sa1100/jornada720_ssp.c +++ b/arch/arm/mach-sa1100/jornada720_ssp.c @@ -130,7 +130,7 @@ void jornada_ssp_end(void)  };  EXPORT_SYMBOL(jornada_ssp_end); -static int __devinit jornada_ssp_probe(struct platform_device *dev) +static int jornada_ssp_probe(struct platform_device *dev)  {  	int ret; diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c index 88be0474f3d..400f8033204 100644 --- a/arch/arm/mach-sa1100/neponset.c +++ b/arch/arm/mach-sa1100/neponset.c @@ -154,7 +154,7 @@ static u_int neponset_get_mctrl(struct uart_port *port)  	return ret;  } -static struct sa1100_port_fns neponset_port_fns __devinitdata = { +static struct sa1100_port_fns neponset_port_fns = {  	.set_mctrl	= neponset_set_mctrl,  	.get_mctrl	= neponset_get_mctrl,  }; @@ -233,7 +233,7 @@ static struct sa1111_platform_data sa1111_info = {  	.disable_devs	= SA1111_DEVID_PS2_MSE,  }; -static int __devinit neponset_probe(struct platform_device *dev) +static int neponset_probe(struct platform_device *dev)  {  	struct neponset_drvdata *d;  	struct resource *nep_res, *sa1111_res, *smc91x_res; @@ -368,7 +368,7 @@ static int __devinit neponset_probe(struct platform_device *dev)  	return ret;  } -static int __devexit neponset_remove(struct platform_device *dev) +static int neponset_remove(struct platform_device *dev)  {  	struct neponset_drvdata *d = platform_get_drvdata(dev);  	int irq = platform_get_irq(dev, 0); @@ -420,7 +420,7 @@ static const struct dev_pm_ops neponset_pm_ops = {  static struct platform_driver neponset_device_driver = {  	.probe		= neponset_probe, -	.remove		= __devexit_p(neponset_remove), +	.remove		= neponset_remove,  	.driver		= {  		.name	= "neponset",  		.owner	= THIS_MODULE, diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c index 9be910f7920..1dc8a92e5a5 100644 --- a/arch/arm/mach-sunxi/sunxi.c +++ b/arch/arm/mach-sunxi/sunxi.c @@ -80,8 +80,8 @@ static void __init sunxi_dt_init(void)  }  static const char * const sunxi_board_dt_compat[] = { -	"allwinner,sun4i", -	"allwinner,sun5i", +	"allwinner,sun4i-a10", +	"allwinner,sun5i-a13",  	NULL,  }; diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index 0816562725f..d54cfc54b9f 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c @@ -104,7 +104,7 @@ static __initdata struct tegra_clk_init_table tegra20_clk_init_table[] = {  static __initdata struct tegra_clk_init_table tegra30_clk_init_table[] = {  	/* name		parent		rate		enabled */  	{ "clk_m",	NULL,		0,		true }, -	{ "pll_p",	"clk_m",	408000000,	true }, +	{ "pll_p",	"pll_ref",	408000000,	true },  	{ "pll_p_out1",	"pll_p",	9600000,	true },  	{ "pll_p_out4",	"pll_p",	102000000,	true },  	{ "sclk",	"pll_p_out4",	102000000,	true }, diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c index 53d08587179..bffcd643d7a 100644 --- a/arch/arm/mach-tegra/pcie.c +++ b/arch/arm/mach-tegra/pcie.c @@ -331,7 +331,7 @@ static struct pci_ops tegra_pcie_ops = {  	.write	= tegra_pcie_write_conf,  }; -static void __devinit tegra_pcie_fixup_bridge(struct pci_dev *dev) +static void tegra_pcie_fixup_bridge(struct pci_dev *dev)  {  	u16 reg; @@ -345,7 +345,7 @@ static void __devinit tegra_pcie_fixup_bridge(struct pci_dev *dev)  DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, tegra_pcie_fixup_bridge);  /* Tegra PCIE root complex wrongly reports device class */ -static void __devinit tegra_pcie_fixup_class(struct pci_dev *dev) +static void tegra_pcie_fixup_class(struct pci_dev *dev)  {  	dev->class = PCI_CLASS_BRIDGE_PCI << 8;  } @@ -353,7 +353,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0bf0, tegra_pcie_fixup_class);  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0bf1, tegra_pcie_fixup_class);  /* Tegra PCIE requires relaxed ordering */ -static void __devinit tegra_pcie_relax_enable(struct pci_dev *dev) +static void tegra_pcie_relax_enable(struct pci_dev *dev)  {  	pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_RELAX_EN);  } diff --git a/arch/arm/mach-tegra/tegra2_emc.c b/arch/arm/mach-tegra/tegra2_emc.c index 837c7b9ea63..e18aa2f83eb 100644 --- a/arch/arm/mach-tegra/tegra2_emc.c +++ b/arch/arm/mach-tegra/tegra2_emc.c @@ -268,7 +268,7 @@ static struct tegra_emc_pdata *tegra_emc_dt_parse_pdata(  }  #endif -static struct tegra_emc_pdata __devinit *tegra_emc_fill_pdata(struct platform_device *pdev) +static struct tegra_emc_pdata *tegra_emc_fill_pdata(struct platform_device *pdev)  {  	struct clk *c = clk_get_sys(NULL, "emc");  	struct tegra_emc_pdata *pdata; @@ -296,7 +296,7 @@ static struct tegra_emc_pdata __devinit *tegra_emc_fill_pdata(struct platform_de  	return pdata;  } -static int __devinit tegra_emc_probe(struct platform_device *pdev) +static int tegra_emc_probe(struct platform_device *pdev)  {  	struct tegra_emc_pdata *pdata;  	struct resource *res; @@ -333,7 +333,7 @@ static int __devinit tegra_emc_probe(struct platform_device *pdev)  	return 0;  } -static struct of_device_id tegra_emc_of_match[] __devinitdata = { +static struct of_device_id tegra_emc_of_match[] = {  	{ .compatible = "nvidia,tegra20-emc", },  	{ },  }; diff --git a/arch/arm/mach-tegra/tegra30_clocks.c b/arch/arm/mach-tegra/tegra30_clocks.c index efc000e32e1..d7147779f8e 100644 --- a/arch/arm/mach-tegra/tegra30_clocks.c +++ b/arch/arm/mach-tegra/tegra30_clocks.c @@ -2045,9 +2045,7 @@ struct clk_ops tegra30_periph_clk_ops = {  static int tegra30_dsib_clk_set_parent(struct clk_hw *hw, u8 index)  {  	struct clk *d = clk_get_sys(NULL, "pll_d"); -	/* The DSIB parent selection bit is in PLLD base -	   register - can not do direct r-m-w, must be -	   protected by PLLD lock */ +	/* The DSIB parent selection bit is in PLLD base register */  	tegra_clk_cfg_ex(  		d, TEGRA_CLK_PLLD_MIPI_MUX_SEL, index); diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c index 12f3994c43d..4ce77cdc31c 100644 --- a/arch/arm/mach-u300/core.c +++ b/arch/arm/mach-u300/core.c @@ -27,7 +27,6 @@  #include <linux/mtd/nand.h>  #include <linux/mtd/fsmc.h>  #include <linux/pinctrl/machine.h> -#include <linux/pinctrl/consumer.h>  #include <linux/pinctrl/pinconf-generic.h>  #include <linux/dma-mapping.h>  #include <linux/platform_data/clk-u300.h> @@ -250,6 +249,18 @@ static struct resource rtc_resources[] = {   */  static struct resource fsmc_resources[] = {  	{ +		.name  = "nand_addr", +		.start = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_ALE, +		.end   = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_ALE + SZ_16K - 1, +		.flags = IORESOURCE_MEM, +	}, +	{ +		.name  = "nand_cmd", +		.start = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_CLE, +		.end   = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_CLE + SZ_16K - 1, +		.flags = IORESOURCE_MEM, +	}, +	{  		.name  = "nand_data",  		.start = U300_NAND_CS0_PHYS_BASE,  		.end   = U300_NAND_CS0_PHYS_BASE + SZ_16K - 1, @@ -1492,8 +1503,6 @@ static struct fsmc_nand_platform_data nand_platform_data = {  	.nr_partitions = ARRAY_SIZE(u300_partitions),  	.options = NAND_SKIP_BBTSCAN,  	.width = FSMC_NAND_BW8, -	.ale_off = PLAT_NAND_ALE, -	.cle_off = PLAT_NAND_CLE,  };  static struct platform_device nand_device = { @@ -1543,39 +1552,6 @@ static struct pinctrl_map __initdata u300_pinmux_map[] = {  				    pin_highz_conf),  }; -struct u300_mux_hog { -	struct device *dev; -	struct pinctrl *p; -}; - -static struct u300_mux_hog u300_mux_hogs[] = { -	{ -		.dev = &uart0_device.dev, -	}, -	{ -		.dev = &mmcsd_device.dev, -	}, -}; - -static int __init u300_pinctrl_fetch(void) -{ -	int i; - -	for (i = 0; i < ARRAY_SIZE(u300_mux_hogs); i++) { -		struct pinctrl *p; - -		p = pinctrl_get_select_default(u300_mux_hogs[i].dev); -		if (IS_ERR(p)) { -			pr_err("u300: could not get pinmux hog for dev %s\n", -			       dev_name(u300_mux_hogs[i].dev)); -			continue; -		} -		u300_mux_hogs[i].p = p; -	} -	return 0; -} -subsys_initcall(u300_pinctrl_fetch); -  /*   * Notice that AMBA devices are initialized before platform devices.   * diff --git a/arch/arm/mach-u300/dummyspichip.c b/arch/arm/mach-u300/dummyspichip.c index 03f79361259..2785cb67b5e 100644 --- a/arch/arm/mach-u300/dummyspichip.c +++ b/arch/arm/mach-u300/dummyspichip.c @@ -222,7 +222,7 @@ static ssize_t dummy_looptest(struct device *dev,  static DEVICE_ATTR(looptest, S_IRUGO, dummy_looptest, NULL); -static int __devinit pl022_dummy_probe(struct spi_device *spi) +static int pl022_dummy_probe(struct spi_device *spi)  {  	struct dummy *p_dummy;  	int status; @@ -251,7 +251,7 @@ out_dev_create_looptest_failed:  	return status;  } -static int __devexit pl022_dummy_remove(struct spi_device *spi) +static int pl022_dummy_remove(struct spi_device *spi)  {  	struct dummy *p_dummy = dev_get_drvdata(&spi->dev); @@ -269,7 +269,7 @@ static struct spi_driver pl022_dummy_driver = {  		.owner	= THIS_MODULE,  	},  	.probe	= pl022_dummy_probe, -	.remove	= __devexit_p(pl022_dummy_remove), +	.remove	= pl022_dummy_remove,  };  static int __init pl022_init_dummy(void) diff --git a/arch/arm/mach-ux500/board-mop500-stuib.c b/arch/arm/mach-ux500/board-mop500-stuib.c index 564f57d5d8a..7e1f294f043 100644 --- a/arch/arm/mach-ux500/board-mop500-stuib.c +++ b/arch/arm/mach-ux500/board-mop500-stuib.c @@ -77,9 +77,6 @@ static struct i2c_board_info __initdata mop500_i2c0_devices_stuib[] = {   * BU21013 ROHM touchscreen interface on the STUIBs   */ -/* tracks number of bu21013 devices being enabled */ -static int bu21013_devices; -  #define TOUCH_GPIO_PIN  84  #define TOUCH_XMAX	384 @@ -88,73 +85,8 @@ static int bu21013_devices;  #define PRCMU_CLOCK_OCR		0x1CC  #define TSC_EXT_CLOCK_9_6MHZ	0x840000 -/** - * bu21013_gpio_board_init : configures the touch panel. - * @reset_pin: reset pin number - * This function can be used to configures - * the voltage and reset the touch panel controller. - */ -static int bu21013_gpio_board_init(int reset_pin) -{ -	int retval = 0; - -	bu21013_devices++; -	if (bu21013_devices == 1) { -		retval = gpio_request(reset_pin, "touchp_reset"); -		if (retval) { -			printk(KERN_ERR "Unable to request gpio reset_pin"); -			return retval; -		} -		retval = gpio_direction_output(reset_pin, 1); -		if (retval < 0) { -			printk(KERN_ERR "%s: gpio direction failed\n", -					__func__); -			return retval; -		} -	} - -	return retval; -} - -/** - * bu21013_gpio_board_exit : deconfigures the touch panel controller - * @reset_pin: reset pin number - * This function can be used to deconfigures the chip selection - * for touch panel controller. - */ -static int bu21013_gpio_board_exit(int reset_pin) -{ -	int retval = 0; - -	if (bu21013_devices == 1) { -		retval = gpio_direction_output(reset_pin, 0); -		if (retval < 0) { -			printk(KERN_ERR "%s: gpio direction failed\n", -					__func__); -			return retval; -		} -		gpio_set_value(reset_pin, 0); -	} -	bu21013_devices--; - -	return retval; -} - -/** - * bu21013_read_pin_val : get the interrupt pin value - * This function can be used to get the interrupt pin value for touch panel - * controller. - */ -static int bu21013_read_pin_val(void) -{ -	return gpio_get_value(TOUCH_GPIO_PIN); -} -  static struct bu21013_platform_device tsc_plat_device = { -	.cs_en = bu21013_gpio_board_init, -	.cs_dis = bu21013_gpio_board_exit, -	.irq_read_val = bu21013_read_pin_val, -	.irq = NOMADIK_GPIO_TO_IRQ(TOUCH_GPIO_PIN), +	.touch_pin = TOUCH_GPIO_PIN,  	.touch_x_max = TOUCH_XMAX,  	.touch_y_max = TOUCH_YMAX,  	.ext_clk = false, @@ -171,7 +103,6 @@ static struct i2c_board_info __initdata u8500_i2c3_devices_stuib[] = {  		I2C_BOARD_INFO("bu21013_tp", 0x5D),  		.platform_data = &tsc_plat_device,  	}, -  };  void __init mop500_stuib_init(void) diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index db0bb75e2c7..5b286e06474 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -285,7 +285,8 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {  	OF_DEV_AUXDATA("st,nomadik-i2c", 0x80110000, "nmk-i2c.3", NULL),  	OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL),  	/* Requires device name bindings. */ -	OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL), +	OF_DEV_AUXDATA("stericsson,nmk_pinctrl", U8500_PRCMU_BASE, +		"pinctrl-db8500", NULL),  	/* Requires clock name and DMA bindings. */  	OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000,  		"ux500-msp-i2s.0", &msp0_platform_data), diff --git a/arch/arm/mach-ux500/devices-db8500.h b/arch/arm/mach-ux500/devices-db8500.h index 4b24c999265..a5e05f6e256 100644 --- a/arch/arm/mach-ux500/devices-db8500.h +++ b/arch/arm/mach-ux500/devices-db8500.h @@ -8,6 +8,7 @@  #ifndef __DEVICES_DB8500_H  #define __DEVICES_DB8500_H +#include <linux/platform_data/usb-musb-ux500.h>  #include <mach/irqs.h>  #include "devices-common.h" diff --git a/arch/arm/mach-versatile/include/mach/irqs.h b/arch/arm/mach-versatile/include/mach/irqs.h index bf44c61bd1f..0fd771ca617 100644 --- a/arch/arm/mach-versatile/include/mach/irqs.h +++ b/arch/arm/mach-versatile/include/mach/irqs.h @@ -25,7 +25,7 @@   *  IRQ interrupts definitions are the same as the INT definitions   *  held within platform.h   */ -#define IRQ_VIC_START		0 +#define IRQ_VIC_START		32  #define IRQ_WDOGINT		(IRQ_VIC_START + INT_WDOGINT)  #define IRQ_SOFTINT		(IRQ_VIC_START + INT_SOFTINT)  #define IRQ_COMMRx		(IRQ_VIC_START + INT_COMMRx) @@ -100,7 +100,7 @@  /*   * Secondary interrupt controller   */ -#define IRQ_SIC_START		32 +#define IRQ_SIC_START		64  #define IRQ_SIC_MMCI0B 		(IRQ_SIC_START + SIC_INT_MMCI0B)  #define IRQ_SIC_MMCI1B 		(IRQ_SIC_START + SIC_INT_MMCI1B)  #define IRQ_SIC_KMI0		(IRQ_SIC_START + SIC_INT_KMI0) @@ -120,7 +120,7 @@  #define IRQ_SIC_PCI1		(IRQ_SIC_START + SIC_INT_PCI1)  #define IRQ_SIC_PCI2		(IRQ_SIC_START + SIC_INT_PCI2)  #define IRQ_SIC_PCI3		(IRQ_SIC_START + SIC_INT_PCI3) -#define IRQ_SIC_END		63 +#define IRQ_SIC_END		95  #define IRQ_GPIO0_START		(IRQ_SIC_END + 1)  #define IRQ_GPIO0_END		(IRQ_GPIO0_START + 31) diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig index 99e63f5f99d..52d315b792c 100644 --- a/arch/arm/mach-vexpress/Kconfig +++ b/arch/arm/mach-vexpress/Kconfig @@ -42,7 +42,6 @@ config ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA  	bool "Enable A5 and A9 only errata work-arounds"  	default y  	select ARM_ERRATA_720789 -	select ARM_ERRATA_751472  	select PL310_ERRATA_753970 if CACHE_PL310  	help  	  Provides common dependencies for Versatile Express platforms diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 6911b8b2745..c2f37390308 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -352,7 +352,8 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)  		/* Unmapped register. */  		sync_reg_offset = L2X0_DUMMY_REG;  #endif -		outer_cache.set_debug = pl310_set_debug; +		if ((cache_id & L2X0_CACHE_ID_RTL_MASK) <= L2X0_CACHE_ID_RTL_R3P0) +			outer_cache.set_debug = pl310_set_debug;  		break;  	case L2X0_CACHE_ID_PART_L210:  		ways = (aux >> 13) & 0xf; @@ -459,8 +460,8 @@ static void aurora_pa_range(unsigned long start, unsigned long end,  	unsigned long flags;  	raw_spin_lock_irqsave(&l2x0_lock, flags); -	writel(start, l2x0_base + AURORA_RANGE_BASE_ADDR_REG); -	writel(end, l2x0_base + offset); +	writel_relaxed(start, l2x0_base + AURORA_RANGE_BASE_ADDR_REG); +	writel_relaxed(end, l2x0_base + offset);  	raw_spin_unlock_irqrestore(&l2x0_lock, flags);  	cache_sync(); @@ -505,15 +506,21 @@ static void aurora_clean_range(unsigned long start, unsigned long end)  static void aurora_flush_range(unsigned long start, unsigned long end)  { -	if (!l2_wt_override) { -		start &= ~(CACHE_LINE_SIZE - 1); -		end = ALIGN(end, CACHE_LINE_SIZE); -		while (start != end) { -			unsigned long range_end = calc_range_end(start, end); +	start &= ~(CACHE_LINE_SIZE - 1); +	end = ALIGN(end, CACHE_LINE_SIZE); +	while (start != end) { +		unsigned long range_end = calc_range_end(start, end); +		/* +		 * If L2 is forced to WT, the L2 will always be clean and we +		 * just need to invalidate. +		 */ +		if (l2_wt_override)  			aurora_pa_range(start, range_end - CACHE_LINE_SIZE, -					AURORA_FLUSH_RANGE_REG); -			start = range_end; -		} +							AURORA_INVAL_RANGE_REG); +		else +			aurora_pa_range(start, range_end - CACHE_LINE_SIZE, +							AURORA_FLUSH_RANGE_REG); +		start = range_end;  	}  } @@ -668,8 +675,9 @@ static void pl310_resume(void)  static void aurora_resume(void)  {  	if (!(readl(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) { -		writel(l2x0_saved_regs.aux_ctrl, l2x0_base + L2X0_AUX_CTRL); -		writel(l2x0_saved_regs.ctrl, l2x0_base + L2X0_CTRL); +		writel_relaxed(l2x0_saved_regs.aux_ctrl, +				l2x0_base + L2X0_AUX_CTRL); +		writel_relaxed(l2x0_saved_regs.ctrl, l2x0_base + L2X0_CTRL);  	}  } diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S index cd956647c21..7539ec27506 100644 --- a/arch/arm/mm/cache-v7.S +++ b/arch/arm/mm/cache-v7.S @@ -44,8 +44,10 @@ ENDPROC(v7_flush_icache_all)  ENTRY(v7_flush_dcache_louis)  	dmb					@ ensure ordering with previous memory accesses  	mrc	p15, 1, r0, c0, c0, 1		@ read clidr, r0 = clidr -	ands	r3, r0, #0xe00000		@ extract LoUIS from clidr -	mov	r3, r3, lsr #20			@ r3 = LoUIS * 2 +	ALT_SMP(ands	r3, r0, #(7 << 21))	@ extract LoUIS from clidr +	ALT_UP(ands	r3, r0, #(7 << 27))	@ extract LoUU from clidr +	ALT_SMP(mov	r3, r3, lsr #20)	@ r3 = LoUIS * 2 +	ALT_UP(mov	r3, r3, lsr #26)	@ r3 = LoUU * 2  	moveq	pc, lr				@ return if level == 0  	mov	r10, #0				@ r10 (starting level) = 0  	b	flush_levels			@ start flushing cache levels diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 350f6a74992..3a3c015f8d5 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -169,6 +169,7 @@ __v7_ca15mp_setup:  	orreq	r0, r0, r10			@ Enable CPU-specific SMP bits  	mcreq	p15, 0, r0, c1, c0, 1  #endif +	b	__v7_setup  __v7_pj4b_setup:  #ifdef CONFIG_CPU_PJ4B @@ -245,7 +246,8 @@ __v7_setup:  	ldr	r10, =0x00000c08		@ Cortex-A8 primary part number  	teq	r0, r10  	bne	2f -#ifdef CONFIG_ARM_ERRATA_430973 +#if defined(CONFIG_ARM_ERRATA_430973) && !defined(CONFIG_ARCH_MULTIPLATFORM) +  	teq	r5, #0x00100000			@ only present in r1p*  	mrceq	p15, 0, r10, c1, c0, 1		@ read aux control register  	orreq	r10, r10, #(1 << 6)		@ set IBE to 1 diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile index 8d885848600..a14a78a2f14 100644 --- a/arch/arm/plat-omap/Makefile +++ b/arch/arm/plat-omap/Makefile @@ -3,7 +3,7 @@  #  # Common support -obj-y := sram.o dma.o fb.o counter_32k.o +obj-y := sram.o dma.o counter_32k.o  obj-m :=  obj-n :=  obj-  := @@ -11,7 +11,6 @@ obj-  :=  # omap_device support (OMAP2+ only at the moment)  obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o -obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o  obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o  i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o  obj-y += $(i2c-omap-m) $(i2c-omap-y) diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c index f3771cdb983..5b0b86bb34b 100644 --- a/arch/arm/plat-omap/counter_32k.c +++ b/arch/arm/plat-omap/counter_32k.c @@ -22,6 +22,8 @@  #include <asm/mach/time.h>  #include <asm/sched_clock.h> +#include <plat/counter-32k.h> +  /* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */  #define OMAP2_32KSYNCNT_REV_OFF		0x0  #define OMAP2_32KSYNCNT_REV_SCHEME	(0x3 << 30) diff --git a/arch/arm/plat-omap/debug-devices.c b/arch/arm/plat-omap/debug-devices.c deleted file mode 100644 index a609e216181..00000000000 --- a/arch/arm/plat-omap/debug-devices.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * linux/arch/arm/plat-omap/debug-devices.c - * - * Copyright (C) 2005 Nokia Corporation - * Modified from mach-omap2/board-h4.c - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include <linux/gpio.h> -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/platform_device.h> -#include <linux/io.h> -#include <linux/smc91x.h> - -#include <plat/debug-devices.h> - -/* Many OMAP development platforms reuse the same "debug board"; these - * platforms include H2, H3, H4, and Perseus2. - */ - -static struct smc91x_platdata smc91x_info = { -	.flags	= SMC91X_USE_16BIT | SMC91X_NOWAIT, -	.leda	= RPC_LED_100_10, -	.ledb	= RPC_LED_TX_RX, -}; - -static struct resource smc91x_resources[] = { -	[0] = { -		.flags  = IORESOURCE_MEM, -	}, -	[1] = { -		.flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, -	}, -}; - -static struct platform_device smc91x_device = { -	.name		= "smc91x", -	.id		= -1, -	.dev		= { -		.platform_data = &smc91x_info, -	}, -	.num_resources	= ARRAY_SIZE(smc91x_resources), -	.resource	= smc91x_resources, -}; - -static struct resource led_resources[] = { -	[0] = { -		.flags	= IORESOURCE_MEM, -	}, -}; - -static struct platform_device led_device = { -	.name		= "omap_dbg_led", -	.id		= -1, -	.num_resources	= ARRAY_SIZE(led_resources), -	.resource	= led_resources, -}; - -static struct platform_device *debug_devices[] __initdata = { -	&smc91x_device, -	&led_device, -	/* ps2 kbd + mouse ports */ -	/* 4 extra uarts */ -	/* 6 input dip switches */ -	/* 8 output pins */ -}; - -int __init debug_card_init(u32 addr, unsigned gpio) -{ -	int	status; - -	smc91x_resources[0].start = addr + 0x300; -	smc91x_resources[0].end   = addr + 0x30f; - -	smc91x_resources[1].start = gpio_to_irq(gpio); -	smc91x_resources[1].end   = gpio_to_irq(gpio); - -	status = gpio_request(gpio, "SMC91x irq"); -	if (status < 0) { -		printk(KERN_ERR "GPIO%d unavailable for smc91x IRQ\n", gpio); -		return status; -	} -	gpio_direction_input(gpio); - -	led_resources[0].start = addr; -	led_resources[0].end   = addr + SZ_4K - 1; - -	return platform_add_devices(debug_devices, ARRAY_SIZE(debug_devices)); -} diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 37a488aaa2b..4136b20cba3 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -2000,7 +2000,7 @@ void omap_dma_global_context_restore(void)  			omap_clear_dma(ch);  } -static int __devinit omap_system_dma_probe(struct platform_device *pdev) +static int omap_system_dma_probe(struct platform_device *pdev)  {  	int ch, ret = 0;  	int dma_irq; @@ -2116,7 +2116,7 @@ exit_dma_lch_fail:  	return ret;  } -static int __devexit omap_system_dma_remove(struct platform_device *pdev) +static int omap_system_dma_remove(struct platform_device *pdev)  {  	int dma_irq; @@ -2140,7 +2140,7 @@ static int __devexit omap_system_dma_remove(struct platform_device *pdev)  static struct platform_driver omap_system_dma_driver = {  	.probe		= omap_system_dma_probe, -	.remove		= __devexit_p(omap_system_dma_remove), +	.remove		= omap_system_dma_remove,  	.driver		= {  		.name	= "omap_dma_system"  	}, diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index 89585c29355..7b433f3bddc 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c @@ -777,7 +777,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timers_active);   * Called by driver framework at the end of device registration for all   * timer devices.   */ -static int __devinit omap_dm_timer_probe(struct platform_device *pdev) +static int omap_dm_timer_probe(struct platform_device *pdev)  {  	unsigned long flags;  	struct omap_dm_timer *timer; @@ -864,7 +864,7 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)   * In addition to freeing platform resources it also deletes the timer   * entry from the local list.   */ -static int __devexit omap_dm_timer_remove(struct platform_device *pdev) +static int omap_dm_timer_remove(struct platform_device *pdev)  {  	struct omap_dm_timer *timer;  	unsigned long flags; @@ -891,26 +891,15 @@ MODULE_DEVICE_TABLE(of, omap_timer_match);  static struct platform_driver omap_dm_timer_driver = {  	.probe  = omap_dm_timer_probe, -	.remove = __devexit_p(omap_dm_timer_remove), +	.remove = omap_dm_timer_remove,  	.driver = {  		.name   = "omap_timer",  		.of_match_table = of_match_ptr(omap_timer_match),  	},  }; -static int __init omap_dm_timer_driver_init(void) -{ -	return platform_driver_register(&omap_dm_timer_driver); -} - -static void __exit omap_dm_timer_driver_exit(void) -{ -	platform_driver_unregister(&omap_dm_timer_driver); -} -  early_platform_init("earlytimer", &omap_dm_timer_driver); -module_init(omap_dm_timer_driver_init); -module_exit(omap_dm_timer_driver_exit); +module_platform_driver(omap_dm_timer_driver);  MODULE_DESCRIPTION("OMAP Dual-Mode Timer Driver");  MODULE_LICENSE("GPL"); diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h index b4516aba67e..c9a66bf36c9 100644 --- a/arch/arm/plat-omap/include/plat/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h @@ -32,8 +32,4 @@  #include <mach/soc.h>  #endif -#ifdef CONFIG_ARCH_OMAP2PLUS -#include "../../mach-omap2/soc.h" -#endif -  #endif diff --git a/arch/arm/plat-omap/include/plat/debug-devices.h b/arch/arm/plat-omap/include/plat/debug-devices.h deleted file mode 100644 index 8fc4287222d..00000000000 --- a/arch/arm/plat-omap/include/plat/debug-devices.h +++ /dev/null @@ -1,2 +0,0 @@ -/* for TI reference platforms sharing the same debug card */ -extern int debug_card_init(u32 addr, unsigned gpio); diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h deleted file mode 100644 index ff9b0aab528..00000000000 --- a/arch/arm/plat-omap/include/plat/omap-serial.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Driver for OMAP-UART controller. - * Based on drivers/serial/8250.c - * - * Copyright (C) 2010 Texas Instruments. - * - * Authors: - *	Govindraj R	<govindraj.raja@ti.com> - *	Thara Gopinath	<thara@ti.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ - -#ifndef __OMAP_SERIAL_H__ -#define __OMAP_SERIAL_H__ - -#include <linux/serial_core.h> -#include <linux/device.h> -#include <linux/pm_qos.h> - -#define DRIVER_NAME	"omap_uart" - -/* - * Use tty device name as ttyO, [O -> OMAP] - * in bootargs we specify as console=ttyO0 if uart1 - * is used as console uart. - */ -#define OMAP_SERIAL_NAME	"ttyO" - -struct omap_uart_port_info { -	bool			dma_enabled;	/* To specify DMA Mode */ -	unsigned int		uartclk;	/* UART clock rate */ -	upf_t			flags;		/* UPF_* flags */ -	unsigned int		dma_rx_buf_size; -	unsigned int		dma_rx_timeout; -	unsigned int		autosuspend_timeout; -	unsigned int		dma_rx_poll_rate; -	int			DTR_gpio; -	int			DTR_inverted; -	int			DTR_present; - -	int (*get_context_loss_count)(struct device *); -	void (*set_forceidle)(struct device *); -	void (*set_noidle)(struct device *); -	void (*enable_wakeup)(struct device *, bool); -}; - -#endif /* __OMAP_SERIAL_H__ */ diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index 743fc2836f7..a5bc92d7e47 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c @@ -26,6 +26,8 @@  #include <asm/mach/map.h> +#include <plat/sram.h> +  #define ROUND_DOWN(value,boundary)	((value) & (~((boundary)-1)))  static void __iomem *omap_sram_base; diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c index 584c9bf8ed2..8e11e96eab5 100644 --- a/arch/arm/plat-pxa/ssp.c +++ b/arch/arm/plat-pxa/ssp.c @@ -72,7 +72,7 @@ void pxa_ssp_free(struct ssp_device *ssp)  }  EXPORT_SYMBOL(pxa_ssp_free); -static int __devinit pxa_ssp_probe(struct platform_device *pdev) +static int pxa_ssp_probe(struct platform_device *pdev)  {  	const struct platform_device_id *id = platform_get_device_id(pdev);  	struct resource *res; @@ -164,7 +164,7 @@ err_free:  	return ret;  } -static int __devexit pxa_ssp_remove(struct platform_device *pdev) +static int pxa_ssp_remove(struct platform_device *pdev)  {  	struct resource *res;  	struct ssp_device *ssp; @@ -199,7 +199,7 @@ static const struct platform_device_id ssp_id_table[] = {  static struct platform_driver pxa_ssp_driver = {  	.probe		= pxa_ssp_probe, -	.remove		= __devexit_p(pxa_ssp_remove), +	.remove		= pxa_ssp_remove,  	.driver		= {  		.owner	= THIS_MODULE,  		.name	= "pxa2xx-ssp", diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c index 37542c2689a..2d676ab50f7 100644 --- a/arch/arm/plat-samsung/adc.c +++ b/arch/arm/plat-samsung/adc.c @@ -416,7 +416,7 @@ static int s3c_adc_probe(struct platform_device *pdev)  	return 0;  } -static int __devexit s3c_adc_remove(struct platform_device *pdev) +static int s3c_adc_remove(struct platform_device *pdev)  {  	struct adc_device *adc = platform_get_drvdata(pdev); @@ -516,7 +516,7 @@ static struct platform_driver s3c_adc_driver = {  		.pm	= &adc_pm_ops,  	},  	.probe		= s3c_adc_probe, -	.remove		= __devexit_p(s3c_adc_remove), +	.remove		= s3c_adc_remove,  };  static int __init adc_init(void) diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h index e0072ce8d6e..b69e11dc679 100644 --- a/arch/arm/plat-samsung/include/plat/cpu.h +++ b/arch/arm/plat-samsung/include/plat/cpu.h @@ -43,7 +43,7 @@ extern unsigned long samsung_cpu_id;  #define EXYNOS4_CPU_MASK	0xFFFE0000  #define EXYNOS5250_SOC_ID	0x43520000 -#define EXYNOS5440_SOC_ID	0x54400000 +#define EXYNOS5440_SOC_ID	0xE5440000  #define EXYNOS5_SOC_MASK	0xFFFFF000  #define IS_SAMSUNG_CPU(name, id, mask)		\ diff --git a/arch/arm/plat-samsung/include/plat/gpio-core.h b/arch/arm/plat-samsung/include/plat/gpio-core.h index dfd8b7af8c7..f7a3ea2c498 100644 --- a/arch/arm/plat-samsung/include/plat/gpio-core.h +++ b/arch/arm/plat-samsung/include/plat/gpio-core.h @@ -11,6 +11,9 @@   * published by the Free Software Foundation.  */ +#ifndef __PLAT_SAMSUNG_GPIO_CORE_H +#define __PLAT_SAMSUNG_GPIO_CORE_H +  #define GPIOCON_OFF	(0x00)  #define GPIODAT_OFF	(0x04) @@ -124,3 +127,5 @@ extern struct samsung_gpio_pm samsung_gpio_pm_4bit;  /* locking wrappers to deal with multiple access to the same gpio bank */  #define samsung_gpio_lock(_oc, _fl) spin_lock_irqsave(&(_oc)->lock, _fl)  #define samsung_gpio_unlock(_oc, _fl) spin_unlock_irqrestore(&(_oc)->lock, _fl) + +#endif /* __PLAT_SAMSUNG_GPIO_CORE_H */ diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index f9ccff91591..f8f362aafee 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -2,14 +2,14 @@ config ARM64  	def_bool y  	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE  	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION +	select ARM_AMBA +	select CLONE_BACKWARDS  	select COMMON_CLK  	select GENERIC_CLOCKEVENTS  	select GENERIC_HARDIRQS_NO_DEPRECATED  	select GENERIC_IOMAP  	select GENERIC_IRQ_PROBE  	select GENERIC_IRQ_SHOW -	select GENERIC_KERNEL_EXECVE -	select GENERIC_KERNEL_THREAD  	select GENERIC_SMP_IDLE_THREAD  	select GENERIC_TIME_VSYSCALL  	select HARDIRQS_SW_RESEND @@ -33,7 +33,6 @@ config ARM64  	select RTC_LIB  	select SPARSE_IRQ  	select SYSCTL_EXCEPTION_TRACE -	select CLONE_BACKWARDS  	help  	  ARM 64-bit (AArch64) Linux support. @@ -92,6 +91,9 @@ config SWIOTLB  config IOMMU_HELPER  	def_bool SWIOTLB +config GENERIC_GPIO +	def_bool y +  source "init/Kconfig"  source "kernel/Kconfig.freezer" diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile index 801e2d7fcbc..32ac0aef006 100644 --- a/arch/arm64/boot/dts/Makefile +++ b/arch/arm64/boot/dts/Makefile @@ -1,4 +1,5 @@  targets += dtbs +targets += $(dtb-y)  dtbs: $(addprefix $(obj)/, $(dtb-y)) diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index 37e610dc084..618b450e5a1 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h @@ -23,6 +23,7 @@   */  #include <linux/types.h>  #include <linux/sched.h> +#include <linux/ptrace.h>  #define COMPAT_USER_HZ		100  #define COMPAT_UTS_MACHINE	"armv8l\0\0" @@ -209,10 +210,11 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)  	return (u32)(unsigned long)uptr;  } +#define compat_user_stack_pointer() (current_pt_regs()->compat_sp) +  static inline void __user *arch_compat_alloc_user_space(long len)  { -	struct pt_regs *regs = task_pt_regs(current); -	return (void __user *)regs->compat_sp - len; +	return (void __user *)compat_user_stack_pointer() - len;  }  struct compat_ipc64_perm { diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h index 538f4b44db5..99477689419 100644 --- a/arch/arm64/include/asm/dma-mapping.h +++ b/arch/arm64/include/asm/dma-mapping.h @@ -50,6 +50,7 @@ static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dev_addr)  static inline int dma_mapping_error(struct device *dev, dma_addr_t dev_addr)  {  	struct dma_map_ops *ops = get_dma_ops(dev); +	debug_dma_mapping_error(dev, dev_addr);  	return ops->mapping_error(dev, dev_addr);  } diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 64b13394950..e333a243bfc 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -24,7 +24,8 @@  /*   * Software defined PTE bits definition.   */ -#define PTE_VALID		(_AT(pteval_t, 1) << 0)	/* pte_present() check */ +#define PTE_VALID		(_AT(pteval_t, 1) << 0) +#define PTE_PROT_NONE		(_AT(pteval_t, 1) << 1)	/* only when !PTE_VALID */  #define PTE_FILE		(_AT(pteval_t, 1) << 2)	/* only when !pte_present() */  #define PTE_DIRTY		(_AT(pteval_t, 1) << 55)  #define PTE_SPECIAL		(_AT(pteval_t, 1) << 56) @@ -60,9 +61,12 @@ extern void __pgd_error(const char *file, int line, unsigned long val);  extern pgprot_t pgprot_default; -#define _MOD_PROT(p, b)	__pgprot(pgprot_val(p) | (b)) +#define __pgprot_modify(prot,mask,bits) \ +	__pgprot((pgprot_val(prot) & ~(mask)) | (bits)) + +#define _MOD_PROT(p, b)		__pgprot_modify(p, 0, b) -#define PAGE_NONE		_MOD_PROT(pgprot_default, PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) +#define PAGE_NONE		__pgprot_modify(pgprot_default, PTE_TYPE_MASK, PTE_PROT_NONE)  #define PAGE_SHARED		_MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_UXN)  #define PAGE_SHARED_EXEC	_MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN)  #define PAGE_COPY		_MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) @@ -72,7 +76,7 @@ extern pgprot_t pgprot_default;  #define PAGE_KERNEL		_MOD_PROT(pgprot_default, PTE_PXN | PTE_UXN | PTE_DIRTY)  #define PAGE_KERNEL_EXEC	_MOD_PROT(pgprot_default, PTE_UXN | PTE_DIRTY) -#define __PAGE_NONE		__pgprot(_PAGE_DEFAULT | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) +#define __PAGE_NONE		__pgprot(((_PAGE_DEFAULT) & ~PTE_TYPE_MASK) | PTE_PROT_NONE)  #define __PAGE_SHARED		__pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN)  #define __PAGE_SHARED_EXEC	__pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN)  #define __PAGE_COPY		__pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) @@ -125,16 +129,15 @@ extern struct page *empty_zero_page;  /*   * The following only work if pte_present(). Undefined behaviour otherwise.   */ -#define pte_present(pte)	(pte_val(pte) & PTE_VALID) +#define pte_present(pte)	(pte_val(pte) & (PTE_VALID | PTE_PROT_NONE))  #define pte_dirty(pte)		(pte_val(pte) & PTE_DIRTY)  #define pte_young(pte)		(pte_val(pte) & PTE_AF)  #define pte_special(pte)	(pte_val(pte) & PTE_SPECIAL)  #define pte_write(pte)		(!(pte_val(pte) & PTE_RDONLY))  #define pte_exec(pte)		(!(pte_val(pte) & PTE_UXN)) -#define pte_present_exec_user(pte) \ -	((pte_val(pte) & (PTE_VALID | PTE_USER | PTE_UXN)) == \ -	 (PTE_VALID | PTE_USER)) +#define pte_valid_user(pte) \ +	((pte_val(pte) & (PTE_VALID | PTE_USER)) == (PTE_VALID | PTE_USER))  #define PTE_BIT_FUNC(fn,op) \  static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } @@ -157,10 +160,13 @@ extern void __sync_icache_dcache(pte_t pteval, unsigned long addr);  static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,  			      pte_t *ptep, pte_t pte)  { -	if (pte_present_exec_user(pte)) -		__sync_icache_dcache(pte, addr); -	if (!pte_dirty(pte)) -		pte = pte_wrprotect(pte); +	if (pte_valid_user(pte)) { +		if (pte_exec(pte)) +			__sync_icache_dcache(pte, addr); +		if (!pte_dirty(pte)) +			pte = pte_wrprotect(pte); +	} +  	set_pte(ptep, pte);  } @@ -170,9 +176,6 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,  #define pte_huge(pte)		((pte_val(pte) & PTE_TYPE_MASK) == PTE_TYPE_HUGEPAGE)  #define pte_mkhuge(pte)		(__pte((pte_val(pte) & ~PTE_TYPE_MASK) | PTE_TYPE_HUGEPAGE)) -#define __pgprot_modify(prot,mask,bits)		\ -	__pgprot((pgprot_val(prot) & ~(mask)) | (bits)) -  #define __HAVE_ARCH_PTE_SPECIAL  /* @@ -264,7 +267,8 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)  static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)  { -	const pteval_t mask = PTE_USER | PTE_PXN | PTE_UXN | PTE_RDONLY; +	const pteval_t mask = PTE_USER | PTE_PXN | PTE_UXN | PTE_RDONLY | +			      PTE_PROT_NONE | PTE_VALID;  	pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask);  	return pte;  } diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index 76fb7dd3350..744087fb521 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h @@ -28,6 +28,5 @@  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_VFORK  #endif -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_CLONE  #include <uapi/asm/unistd.h> diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 58432625fdb..5ef47ba3ed4 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h @@ -395,8 +395,13 @@ __SYSCALL(370, sys_name_to_handle_at)  __SYSCALL(371, compat_sys_open_by_handle_at)  __SYSCALL(372, compat_sys_clock_adjtime)  __SYSCALL(373, sys_syncfs) +__SYSCALL(374, compat_sys_sendmmsg) +__SYSCALL(375, sys_setns) +__SYSCALL(376, compat_sys_process_vm_readv) +__SYSCALL(377, compat_sys_process_vm_writev) +__SYSCALL(378, sys_ni_syscall)			/* 378 for kcmp */ -#define __NR_compat_syscalls		374 +#define __NR_compat_syscalls		379  /*   * Compat syscall numbers used by the AArch64 kernel. diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index c76c7241125..f7073c7b1ca 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c @@ -1221,7 +1221,7 @@ static struct of_device_id armpmu_of_device_ids[] = {  	{},  }; -static int __devinit armpmu_device_probe(struct platform_device *pdev) +static int armpmu_device_probe(struct platform_device *pdev)  {  	if (!cpu_pmu)  		return -ENODEV; diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c index c958cb84d75..6a389dc1bd4 100644 --- a/arch/arm64/kernel/vdso.c +++ b/arch/arm64/kernel/vdso.c @@ -252,10 +252,6 @@ void update_vsyscall(struct timekeeper *tk)  void update_vsyscall_tz(void)  { -	++vdso_data->tb_seq_count; -	smp_wmb();  	vdso_data->tz_minuteswest	= sys_tz.tz_minuteswest;  	vdso_data->tz_dsttime		= sys_tz.tz_dsttime; -	smp_wmb(); -	++vdso_data->tb_seq_count;  } diff --git a/arch/arm64/kernel/vdso/gettimeofday.S b/arch/arm64/kernel/vdso/gettimeofday.S index 8bf658d974f..f0a6d10b521 100644 --- a/arch/arm64/kernel/vdso/gettimeofday.S +++ b/arch/arm64/kernel/vdso/gettimeofday.S @@ -73,8 +73,6 @@ ENTRY(__kernel_gettimeofday)  	/* If tz is NULL, return 0. */  	cbz	x1, 3f  	ldp	w4, w5, [vdso_data, #VDSO_TZ_MINWEST] -	seqcnt_read w9 -	seqcnt_check w9, 1b  	stp	w4, w5, [x1, #TZ_MINWEST]  3:  	mov	x0, xzr diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig index e40c9bd7914..2ae6591b3a5 100644 --- a/arch/avr32/Kconfig +++ b/arch/avr32/Kconfig @@ -17,8 +17,6 @@ config AVR32  	select GENERIC_CLOCKEVENTS  	select HAVE_MOD_ARCH_SPECIFIC  	select MODULES_USE_ELF_RELA -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	help  	  AVR32 is a high-performance 32-bit RISC microprocessor core,  	  designed for cost-sensitive embedded applications, with particular diff --git a/arch/avr32/include/asm/ptrace.h b/arch/avr32/include/asm/ptrace.h index 8d3c412fc65..630e4f9bf5f 100644 --- a/arch/avr32/include/asm/ptrace.h +++ b/arch/avr32/include/asm/ptrace.h @@ -21,6 +21,7 @@  #define user_mode(regs)                 (((regs)->sr & MODE_MASK) == MODE_USER)  #define instruction_pointer(regs)       ((regs)->pc)  #define profile_pc(regs)                instruction_pointer(regs) +#define user_stack_pointer(regs)	((regs)->sp)  static __inline__ int valid_user_regs(struct pt_regs *regs)  { diff --git a/arch/avr32/include/asm/unistd.h b/arch/avr32/include/asm/unistd.h index f05a9804e8e..0bdf6371574 100644 --- a/arch/avr32/include/asm/unistd.h +++ b/arch/avr32/include/asm/unistd.h @@ -39,7 +39,6 @@  #define __ARCH_WANT_SYS_GETPGRP  #define __ARCH_WANT_SYS_RT_SIGACTION  #define __ARCH_WANT_SYS_RT_SIGSUSPEND -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_VFORK  #define __ARCH_WANT_SYS_CLONE diff --git a/arch/avr32/include/uapi/asm/signal.h b/arch/avr32/include/uapi/asm/signal.h index eb46f61adb7..1b77a93eff5 100644 --- a/arch/avr32/include/uapi/asm/signal.h +++ b/arch/avr32/include/uapi/asm/signal.h @@ -89,12 +89,6 @@ typedef unsigned long sigset_t;  #define SA_NOMASK	SA_NODEFER  #define SA_ONESHOT	SA_RESETHAND -/* - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 -  #define MINSIGSTKSZ	2048  #define SIGSTKSZ	8192 diff --git a/arch/avr32/lib/delay.c b/arch/avr32/lib/delay.c index 9aa8800830f..c2f4a07dcda 100644 --- a/arch/avr32/lib/delay.c +++ b/arch/avr32/lib/delay.c @@ -20,7 +20,7 @@  #include <asm/processor.h>  #include <asm/sysreg.h> -int __devinit read_current_timer(unsigned long *timer_value) +int read_current_timer(unsigned long *timer_value)  {  	*timer_value = sysreg_read(COUNT);  	return 0; diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index ab9ff4075f4..b6f3ad5441c 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig @@ -45,8 +45,6 @@ config BLACKFIN  	select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS  	select HAVE_MOD_ARCH_SPECIFIC  	select MODULES_USE_ELF_RELA -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  config GENERIC_CSUM  	def_bool y diff --git a/arch/blackfin/include/asm/Kbuild b/arch/blackfin/include/asm/Kbuild index 27d70759474..127826f8a37 100644 --- a/arch/blackfin/include/asm/Kbuild +++ b/arch/blackfin/include/asm/Kbuild @@ -1,4 +1,3 @@ -include include/asm-generic/Kbuild.asm  generic-y += auxvec.h  generic-y += bitsperlong.h @@ -17,6 +16,7 @@ generic-y += ipcbuf.h  generic-y += irq_regs.h  generic-y += kdebug.h  generic-y += kmap_types.h +generic-y += kvm_para.h  generic-y += local64.h  generic-y += local.h  generic-y += mman.h @@ -44,7 +44,3 @@ generic-y += ucontext.h  generic-y += unaligned.h  generic-y += user.h  generic-y += xor.h - -header-y += bfin_sport.h -header-y += cachectl.h -header-y += fixed_code.h diff --git a/arch/blackfin/include/asm/bfin_sport.h b/arch/blackfin/include/asm/bfin_sport.h index f8907ea6b5b..50b9dfd4839 100644 --- a/arch/blackfin/include/asm/bfin_sport.h +++ b/arch/blackfin/include/asm/bfin_sport.h @@ -5,65 +5,12 @@   *   * Licensed under the GPL-2 or later.   */ -  #ifndef __BFIN_SPORT_H__  #define __BFIN_SPORT_H__ -/* Sport mode: it can be set to TDM, i2s or others */ -#define NORM_MODE	0x0 -#define TDM_MODE	0x1 -#define I2S_MODE	0x2 -#define NDSO_MODE	0x3 - -/* Data format, normal, a-law or u-law */ -#define NORM_FORMAT	0x0 -#define ALAW_FORMAT	0x2 -#define ULAW_FORMAT	0x3 - -/* Function driver which use sport must initialize the structure */ -struct sport_config { -	/* TDM (multichannels), I2S or other mode */ -	unsigned int mode:3; -	unsigned int polled;	/* use poll instead of irq when set */ - -	/* if TDM mode is selected, channels must be set */ -	int channels;	/* Must be in 8 units */ -	unsigned int frame_delay:4;	/* Delay between frame sync pulse and first bit */ - -	/* I2S mode */ -	unsigned int right_first:1;	/* Right stereo channel first */ - -	/* In mormal mode, the following item need to be set */ -	unsigned int lsb_first:1;	/* order of transmit or receive data */ -	unsigned int fsync:1;	/* Frame sync required */ -	unsigned int data_indep:1;	/* data independent frame sync generated */ -	unsigned int act_low:1;	/* Active low TFS */ -	unsigned int late_fsync:1;	/* Late frame sync */ -	unsigned int tckfe:1; -	unsigned int sec_en:1;	/* Secondary side enabled */ - -	/* Choose clock source */ -	unsigned int int_clk:1;	/* Internal or external clock */ - -	/* If external clock is used, the following fields are ignored */ -	int serial_clk; -	int fsync_clk; - -	unsigned int data_format:2;	/* Normal, u-law or a-law */ - -	int word_len;		/* How length of the word in bits, 3-32 bits */ -	int dma_enabled; -}; - -/* Userspace interface */ -#define SPORT_IOC_MAGIC		'P' -#define SPORT_IOC_CONFIG	_IOWR('P', 0x01, struct sport_config) -#define SPORT_IOC_GET_SYSTEMCLOCK         _IOR('P', 0x02, unsigned long) -#define SPORT_IOC_SET_BAUDRATE            _IOW('P', 0x03, unsigned long) - -#ifdef __KERNEL__  #include <linux/types.h> +#include <uapi/asm/bfin_sport.h>  /*   * All Blackfin system MMRs are padded to 32bits even if the register @@ -122,76 +69,3 @@ struct bfin_snd_platform_data {  })  #endif - -/* SPORT_TCR1 Masks */ -#define TSPEN		0x0001	/* TX enable */ -#define ITCLK		0x0002	/* Internal TX Clock Select */ -#define TDTYPE		0x000C	/* TX Data Formatting Select */ -#define DTYPE_NORM	0x0000	/* Data Format Normal */ -#define DTYPE_ULAW	0x0008	/* Compand Using u-Law */ -#define DTYPE_ALAW	0x000C	/* Compand Using A-Law */ -#define TLSBIT		0x0010	/* TX Bit Order */ -#define ITFS		0x0200	/* Internal TX Frame Sync Select */ -#define TFSR		0x0400	/* TX Frame Sync Required Select */ -#define DITFS		0x0800	/* Data Independent TX Frame Sync Select */ -#define LTFS		0x1000	/* Low TX Frame Sync Select */ -#define LATFS		0x2000	/* Late TX Frame Sync Select */ -#define TCKFE		0x4000	/* TX Clock Falling Edge Select */ - -/* SPORT_TCR2 Masks */ -#define SLEN		0x001F	/* SPORT TX Word Length (2 - 31) */ -#define DP_SLEN(x)	BFIN_DEPOSIT(SLEN, x) -#define EX_SLEN(x)	BFIN_EXTRACT(SLEN, x) -#define TXSE		0x0100	/* TX Secondary Enable */ -#define TSFSE		0x0200	/* TX Stereo Frame Sync Enable */ -#define TRFST		0x0400	/* TX Right-First Data Order */ - -/* SPORT_RCR1 Masks */ -#define RSPEN		0x0001	/* RX enable */ -#define IRCLK		0x0002	/* Internal RX Clock Select */ -#define RDTYPE		0x000C	/* RX Data Formatting Select */ -/* DTYPE_* defined above */ -#define RLSBIT		0x0010	/* RX Bit Order */ -#define IRFS		0x0200	/* Internal RX Frame Sync Select */ -#define RFSR		0x0400	/* RX Frame Sync Required Select */ -#define LRFS		0x1000	/* Low RX Frame Sync Select */ -#define LARFS		0x2000	/* Late RX Frame Sync Select */ -#define RCKFE		0x4000	/* RX Clock Falling Edge Select */ - -/* SPORT_RCR2 Masks */ -/* SLEN defined above */ -#define RXSE		0x0100	/* RX Secondary Enable */ -#define RSFSE		0x0200	/* RX Stereo Frame Sync Enable */ -#define RRFST		0x0400	/* Right-First Data Order */ - -/* SPORT_STAT Masks */ -#define RXNE		0x0001	/* RX FIFO Not Empty Status */ -#define RUVF		0x0002	/* RX Underflow Status */ -#define ROVF		0x0004	/* RX Overflow Status */ -#define TXF		0x0008	/* TX FIFO Full Status */ -#define TUVF		0x0010	/* TX Underflow Status */ -#define TOVF		0x0020	/* TX Overflow Status */ -#define TXHRE		0x0040	/* TX Hold Register Empty */ - -/* SPORT_MCMC1 Masks */ -#define SP_WOFF		0x03FF	/* Multichannel Window Offset Field */ -#define DP_SP_WOFF(x)	BFIN_DEPOSIT(SP_WOFF, x) -#define EX_SP_WOFF(x)	BFIN_EXTRACT(SP_WOFF, x) -#define SP_WSIZE	0xF000	/* Multichannel Window Size Field */ -#define DP_SP_WSIZE(x)	BFIN_DEPOSIT(SP_WSIZE, x) -#define EX_SP_WSIZE(x)	BFIN_EXTRACT(SP_WSIZE, x) - -/* SPORT_MCMC2 Masks */ -#define MCCRM		0x0003	/* Multichannel Clock Recovery Mode */ -#define REC_BYPASS	0x0000	/* Bypass Mode (No Clock Recovery) */ -#define REC_2FROM4	0x0002	/* Recover 2 MHz Clock from 4 MHz Clock */ -#define REC_8FROM16	0x0003	/* Recover 8 MHz Clock from 16 MHz Clock */ -#define MCDTXPE		0x0004	/* Multichannel DMA Transmit Packing */ -#define MCDRXPE		0x0008	/* Multichannel DMA Receive Packing */ -#define MCMEN		0x0010	/* Multichannel Frame Mode Enable */ -#define FSDR		0x0080	/* Multichannel Frame Sync to Data Relationship */ -#define MFD		0xF000	/* Multichannel Frame Delay */ -#define DP_MFD(x)	BFIN_DEPOSIT(MFD, x) -#define EX_MFD(x)	BFIN_EXTRACT(MFD, x) - -#endif diff --git a/arch/blackfin/include/asm/bfin_twi.h b/arch/blackfin/include/asm/bfin_twi.h index f4a07278743..90c3c006557 100644 --- a/arch/blackfin/include/asm/bfin_twi.h +++ b/arch/blackfin/include/asm/bfin_twi.h @@ -61,7 +61,7 @@ struct bfin_twi_iface {  	int			cur_msg;  	u16			saved_clkdiv;  	u16			saved_control; -	struct bfin_twi_regs	*regs_base; +	struct bfin_twi_regs __iomem *regs_base;  };  #define DEFINE_TWI_REG(reg_name, reg) \ diff --git a/arch/blackfin/include/asm/fixed_code.h b/arch/blackfin/include/asm/fixed_code.h index 5395088b2d0..bc330f06207 100644 --- a/arch/blackfin/include/asm/fixed_code.h +++ b/arch/blackfin/include/asm/fixed_code.h @@ -6,11 +6,11 @@   *   * Licensed under the GPL-2 or later.   */ -  #ifndef __BFIN_ASM_FIXED_CODE_H__  #define __BFIN_ASM_FIXED_CODE_H__ -#ifdef __KERNEL__ +#include <uapi/asm/fixed_code.h> +  #ifndef __ASSEMBLY__  #include <linux/linkage.h>  #include <linux/ptrace.h> @@ -28,29 +28,3 @@ extern void safe_user_instruction(void);  extern void sigreturn_stub(void);  #endif  #endif - -#ifndef CONFIG_PHY_RAM_BASE_ADDRESS -#define CONFIG_PHY_RAM_BASE_ADDRESS	0x0 -#endif - -#define FIXED_CODE_START	(CONFIG_PHY_RAM_BASE_ADDRESS + 0x400) - -#define SIGRETURN_STUB		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x400) - -#define ATOMIC_SEQS_START	(CONFIG_PHY_RAM_BASE_ADDRESS + 0x410) - -#define ATOMIC_XCHG32		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x410) -#define ATOMIC_CAS32		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x420) -#define ATOMIC_ADD32		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x430) -#define ATOMIC_SUB32		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x440) -#define ATOMIC_IOR32		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x450) -#define ATOMIC_AND32		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x460) -#define ATOMIC_XOR32		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x470) - -#define ATOMIC_SEQS_END		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x480) - -#define SAFE_USER_INSTRUCTION   (CONFIG_PHY_RAM_BASE_ADDRESS + 0x480) - -#define FIXED_CODE_END		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x490) - -#endif diff --git a/arch/blackfin/include/asm/pgtable.h b/arch/blackfin/include/asm/pgtable.h index dcca3e6d6e8..b8663921d3c 100644 --- a/arch/blackfin/include/asm/pgtable.h +++ b/arch/blackfin/include/asm/pgtable.h @@ -83,8 +83,6 @@ PTE_BIT_FUNC(mkyoung, |= _PAGE_ACCESSED);  #define ZERO_PAGE(vaddr)	virt_to_page(empty_zero_page)  extern char empty_zero_page[]; -extern unsigned int kobjsize(const void *objp); -  #define swapper_pg_dir ((pgd_t *) 0)  /*   * No page table caches to initialise. diff --git a/arch/blackfin/include/asm/ptrace.h b/arch/blackfin/include/asm/ptrace.h index 10d8641180f..c00491594b4 100644 --- a/arch/blackfin/include/asm/ptrace.h +++ b/arch/blackfin/include/asm/ptrace.h @@ -3,102 +3,13 @@   *   * Licensed under the GPL-2 or later.   */ -  #ifndef _BFIN_PTRACE_H  #define _BFIN_PTRACE_H -/* - * GCC defines register number like this: - * ----------------------------- - *       0 - 7 are data registers R0-R7 - *       8 - 15 are address registers P0-P7 - *      16 - 31 dsp registers I/B/L0 -- I/B/L3 & M0--M3 - *      32 - 33 A registers A0 & A1 - *      34 -    status register - * ----------------------------- - * - * We follows above, except: - *      32-33 --- Low 32-bit of A0&1 - *      34-35 --- High 8-bit of A0&1 - */ +#include <uapi/asm/ptrace.h>  #ifndef __ASSEMBLY__ -struct task_struct; - -/* this struct defines the way the registers are stored on the -   stack during a system call. */ - -struct pt_regs { -	long orig_pc; -	long ipend; -	long seqstat; -	long rete; -	long retn; -	long retx; -	long pc;		/* PC == RETI */ -	long rets; -	long reserved;		/* Used as scratch during system calls */ -	long astat; -	long lb1; -	long lb0; -	long lt1; -	long lt0; -	long lc1; -	long lc0; -	long a1w; -	long a1x; -	long a0w; -	long a0x; -	long b3; -	long b2; -	long b1; -	long b0; -	long l3; -	long l2; -	long l1; -	long l0; -	long m3; -	long m2; -	long m1; -	long m0; -	long i3; -	long i2; -	long i1; -	long i0; -	long usp; -	long fp; -	long p5; -	long p4; -	long p3; -	long p2; -	long p1; -	long p0; -	long r7; -	long r6; -	long r5; -	long r4; -	long r3; -	long r2; -	long r1; -	long r0; -	long orig_r0; -	long orig_p0; -	long syscfg; -}; - -/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ -#define PTRACE_GETREGS            12 -#define PTRACE_SETREGS            13	/* ptrace signal  */ - -#define PTRACE_GETFDPIC           31	/* get the ELF fdpic loadmap address */ -#define PTRACE_GETFDPIC_EXEC       0	/* [addr] request the executable loadmap */ -#define PTRACE_GETFDPIC_INTERP     1	/* [addr] request the interpreter loadmap */ - -#define PS_S  (0x0002) - -#ifdef __KERNEL__ -  /* user_mode returns true if only one bit is set in IPEND, other than the     master interrupt enable.  */  #define user_mode(regs) (!(((regs)->ipend & ~0x10) & (((regs)->ipend & ~0x10) - 1))) @@ -106,6 +17,7 @@ struct pt_regs {  #define arch_has_single_step()	(1)  /* common code demands this function */  #define ptrace_disable(child) user_disable_single_step(child) +#define current_user_stack_pointer() rdusp()  extern int is_user_addr_valid(struct task_struct *child,  			      unsigned long start, unsigned long len); @@ -126,75 +38,5 @@ extern int is_user_addr_valid(struct task_struct *child,  #include <asm-generic/ptrace.h> -#endif  /*  __KERNEL__  */ -  #endif				/* __ASSEMBLY__ */ - -/* - * Offsets used by 'ptrace' system call interface. - */ - -#define PT_R0 204 -#define PT_R1 200 -#define PT_R2 196 -#define PT_R3 192 -#define PT_R4 188 -#define PT_R5 184 -#define PT_R6 180 -#define PT_R7 176 -#define PT_P0 172 -#define PT_P1 168 -#define PT_P2 164 -#define PT_P3 160 -#define PT_P4 156 -#define PT_P5 152 -#define PT_FP 148 -#define PT_USP 144 -#define PT_I0 140 -#define PT_I1 136 -#define PT_I2 132 -#define PT_I3 128 -#define PT_M0 124 -#define PT_M1 120 -#define PT_M2 116 -#define PT_M3 112 -#define PT_L0 108 -#define PT_L1 104 -#define PT_L2 100 -#define PT_L3 96 -#define PT_B0 92 -#define PT_B1 88 -#define PT_B2 84 -#define PT_B3 80 -#define PT_A0X 76 -#define PT_A0W 72 -#define PT_A1X 68 -#define PT_A1W 64 -#define PT_LC0 60 -#define PT_LC1 56 -#define PT_LT0 52 -#define PT_LT1 48 -#define PT_LB0 44 -#define PT_LB1 40 -#define PT_ASTAT 36 -#define PT_RESERVED 32 -#define PT_RETS 28 -#define PT_PC 24 -#define PT_RETX 20 -#define PT_RETN 16 -#define PT_RETE 12 -#define PT_SEQSTAT 8 -#define PT_IPEND 4 - -#define PT_ORIG_R0 208 -#define PT_ORIG_P0 212 -#define PT_SYSCFG 216 -#define PT_TEXT_ADDR 220 -#define PT_TEXT_END_ADDR 224 -#define PT_DATA_ADDR 228 -#define PT_FDPIC_EXEC 232 -#define PT_FDPIC_INTERP 236 - -#define PT_LAST_PSEUDO PT_FDPIC_INTERP -  #endif				/* _BFIN_PTRACE_H */ diff --git a/arch/blackfin/include/asm/uaccess.h b/arch/blackfin/include/asm/uaccess.h index 5cc11150282..461bb542e2e 100644 --- a/arch/blackfin/include/asm/uaccess.h +++ b/arch/blackfin/include/asm/uaccess.h @@ -34,23 +34,6 @@ static inline void set_fs(mm_segment_t fs)  #define access_ok(type, addr, size) _access_ok((unsigned long)(addr), (size)) -static inline int is_in_rom(unsigned long addr) -{ -	/* -	 * What we are really trying to do is determine if addr is -	 * in an allocated kernel memory region. If not then assume -	 * we cannot free it or otherwise de-allocate it. Ideally -	 * we could restrict this to really being in a ROM or flash, -	 * but that would need to be done on a board by board basis, -	 * not globally. -	 */ -	if ((addr < _ramstart) || (addr >= _ramend)) -		return (1); - -	/* Default case, not in ROM */ -	return (0); -} -  /*   * The fs value determines whether argument validity checking should be   * performed or not.  If get_fs() == USER_DS, checking is performed, with @@ -89,7 +72,7 @@ struct exception_table_entry {  	({							\  		int _err = 0;					\  		typeof(*(p)) _x = (x);				\ -		typeof(*(p)) *_p = (p);				\ +		typeof(*(p)) __user *_p = (p);				\  		if (!access_ok(VERIFY_WRITE, _p, sizeof(*(_p)))) {\  			_err = -EFAULT;				\  		}						\ @@ -108,8 +91,8 @@ struct exception_table_entry {  			long _xl, _xh;				\  			_xl = ((long *)&_x)[0];			\  			_xh = ((long *)&_x)[1];			\ -			__put_user_asm(_xl, ((long *)_p)+0, );	\ -			__put_user_asm(_xh, ((long *)_p)+1, );	\ +			__put_user_asm(_xl, ((long __user *)_p)+0, );	\ +			__put_user_asm(_xh, ((long __user *)_p)+1, );	\  		} break;					\  		default:					\  			_err = __put_user_bad();		\ @@ -136,7 +119,7 @@ static inline int bad_user_access_length(void)   * aliasing issues.   */ -#define __ptr(x) ((unsigned long *)(x)) +#define __ptr(x) ((unsigned long __force *)(x))  #define __put_user_asm(x,p,bhw)				\  	__asm__ (#bhw"[%1] = %0;\n\t"			\ @@ -216,12 +199,12 @@ copy_to_user(void __user *to, const void *from, unsigned long n)   */  static inline long __must_check -strncpy_from_user(char *dst, const char *src, long count) +strncpy_from_user(char *dst, const char __user *src, long count)  {  	char *tmp;  	if (!access_ok(VERIFY_READ, src, 1))  		return -EFAULT; -	strncpy(dst, src, count); +	strncpy(dst, (const char __force *)src, count);  	for (tmp = dst; *tmp && count > 0; tmp++, count--) ;  	return (tmp - dst);  } @@ -237,18 +220,18 @@ strncpy_from_user(char *dst, const char *src, long count)   * On exception, returns 0.   * If the string is too long, returns a value greater than n.   */ -static inline long __must_check strnlen_user(const char *src, long n) +static inline long __must_check strnlen_user(const char __user *src, long n)  {  	if (!access_ok(VERIFY_READ, src, 1))  		return 0; -	return strnlen(src, n) + 1; +	return strnlen((const char __force *)src, n) + 1;  } -static inline long __must_check strlen_user(const char *src) +static inline long __must_check strlen_user(const char __user *src)  {  	if (!access_ok(VERIFY_READ, src, 1))  		return 0; -	return strlen(src) + 1; +	return strlen((const char __force *)src) + 1;  }  /* @@ -256,11 +239,11 @@ static inline long __must_check strlen_user(const char *src)   */  static inline unsigned long __must_check -__clear_user(void *to, unsigned long n) +__clear_user(void __user *to, unsigned long n)  {  	if (!access_ok(VERIFY_WRITE, to, n))  		return n; -	memset(to, 0, n); +	memset((void __force *)to, 0, n);  	return 0;  } diff --git a/arch/blackfin/include/asm/unistd.h b/arch/blackfin/include/asm/unistd.h index 460514a1a4e..e943cb13004 100644 --- a/arch/blackfin/include/asm/unistd.h +++ b/arch/blackfin/include/asm/unistd.h @@ -3,437 +3,11 @@   *   * Licensed under the GPL-2 or later.   */ -  #ifndef __ASM_BFIN_UNISTD_H  #define __ASM_BFIN_UNISTD_H -/* - * This file contains the system call numbers. - */ -#define __NR_restart_syscall	  0 -#define __NR_exit		  1 -				/* 2 __NR_fork not supported on nommu */ -#define __NR_read		  3 -#define __NR_write		  4 -#define __NR_open		  5 -#define __NR_close		  6 -				/* 7 __NR_waitpid obsolete */ -#define __NR_creat		  8 -#define __NR_link		  9 -#define __NR_unlink		 10 -#define __NR_execve		 11 -#define __NR_chdir		 12 -#define __NR_time		 13 -#define __NR_mknod		 14 -#define __NR_chmod		 15 -#define __NR_chown		 16 -				/* 17 __NR_break obsolete */ -				/* 18 __NR_oldstat obsolete */ -#define __NR_lseek		 19 -#define __NR_getpid		 20 -#define __NR_mount		 21 -				/* 22 __NR_umount obsolete */ -#define __NR_setuid		 23 -#define __NR_getuid		 24 -#define __NR_stime		 25 -#define __NR_ptrace		 26 -#define __NR_alarm		 27 -				/* 28 __NR_oldfstat obsolete */ -#define __NR_pause		 29 -				/* 30 __NR_utime obsolete */ -				/* 31 __NR_stty obsolete */ -				/* 32 __NR_gtty obsolete */ -#define __NR_access		 33 -#define __NR_nice		 34 -				/* 35 __NR_ftime obsolete */ -#define __NR_sync		 36 -#define __NR_kill		 37 -#define __NR_rename		 38 -#define __NR_mkdir		 39 -#define __NR_rmdir		 40 -#define __NR_dup		 41 -#define __NR_pipe		 42 -#define __NR_times		 43 -				/* 44 __NR_prof obsolete */ -#define __NR_brk		 45 -#define __NR_setgid		 46 -#define __NR_getgid		 47 -				/* 48 __NR_signal obsolete */ -#define __NR_geteuid		 49 -#define __NR_getegid		 50 -#define __NR_acct		 51 -#define __NR_umount2		 52 -				/* 53 __NR_lock obsolete */ -#define __NR_ioctl		 54 -#define __NR_fcntl		 55 -				/* 56 __NR_mpx obsolete */ -#define __NR_setpgid		 57 -				/* 58 __NR_ulimit obsolete */ -				/* 59 __NR_oldolduname obsolete */ -#define __NR_umask		 60 -#define __NR_chroot		 61 -#define __NR_ustat		 62 -#define __NR_dup2		 63 -#define __NR_getppid		 64 -#define __NR_getpgrp		 65 -#define __NR_setsid		 66 -				/* 67 __NR_sigaction obsolete */ -#define __NR_sgetmask		 68 -#define __NR_ssetmask		 69 -#define __NR_setreuid		 70 -#define __NR_setregid		 71 -				/* 72 __NR_sigsuspend obsolete */ -				/* 73 __NR_sigpending obsolete */ -#define __NR_sethostname	 74 -#define __NR_setrlimit		 75 -				/* 76 __NR_old_getrlimit obsolete */ -#define __NR_getrusage		 77 -#define __NR_gettimeofday	 78 -#define __NR_settimeofday	 79 -#define __NR_getgroups		 80 -#define __NR_setgroups		 81 -				/* 82 __NR_select obsolete */ -#define __NR_symlink		 83 -				/* 84 __NR_oldlstat obsolete */ -#define __NR_readlink		 85 -				/* 86 __NR_uselib obsolete */ -				/* 87 __NR_swapon obsolete */ -#define __NR_reboot		 88 -				/* 89 __NR_readdir obsolete */ -				/* 90 __NR_mmap obsolete */ -#define __NR_munmap		 91 -#define __NR_truncate		 92 -#define __NR_ftruncate		 93 -#define __NR_fchmod		 94 -#define __NR_fchown		 95 -#define __NR_getpriority	 96 -#define __NR_setpriority	 97 -				/* 98 __NR_profil obsolete */ -#define __NR_statfs		 99 -#define __NR_fstatfs		100 -				/* 101 __NR_ioperm */ -				/* 102 __NR_socketcall obsolete */ -#define __NR_syslog		103 -#define __NR_setitimer		104 -#define __NR_getitimer		105 -#define __NR_stat		106 -#define __NR_lstat		107 -#define __NR_fstat		108 -				/* 109 __NR_olduname obsolete */ -				/* 110 __NR_iopl obsolete */ -#define __NR_vhangup		111 -				/* 112 __NR_idle obsolete */ -				/* 113 __NR_vm86old */ -#define __NR_wait4		114 -				/* 115 __NR_swapoff obsolete */ -#define __NR_sysinfo		116 -				/* 117 __NR_ipc oboslete */ -#define __NR_fsync		118 -				/* 119 __NR_sigreturn obsolete */ -#define __NR_clone		120 -#define __NR_setdomainname	121 -#define __NR_uname		122 -				/* 123 __NR_modify_ldt obsolete */ -#define __NR_adjtimex		124 -#define __NR_mprotect		125 -				/* 126 __NR_sigprocmask obsolete */ -				/* 127 __NR_create_module obsolete */ -#define __NR_init_module	128 -#define __NR_delete_module	129 -				/* 130 __NR_get_kernel_syms obsolete */ -#define __NR_quotactl		131 -#define __NR_getpgid		132 -#define __NR_fchdir		133 -#define __NR_bdflush		134 -				/* 135 was sysfs */ -#define __NR_personality	136 -				/* 137 __NR_afs_syscall */ -#define __NR_setfsuid		138 -#define __NR_setfsgid		139 -#define __NR__llseek		140 -#define __NR_getdents		141 -				/* 142 __NR__newselect obsolete */ -#define __NR_flock		143 -				/* 144 __NR_msync obsolete */ -#define __NR_readv		145 -#define __NR_writev		146 -#define __NR_getsid		147 -#define __NR_fdatasync		148 -#define __NR__sysctl		149 -				/* 150 __NR_mlock */ -				/* 151 __NR_munlock */ -				/* 152 __NR_mlockall */ -				/* 153 __NR_munlockall */ -#define __NR_sched_setparam		154 -#define __NR_sched_getparam		155 -#define __NR_sched_setscheduler		156 -#define __NR_sched_getscheduler		157 -#define __NR_sched_yield		158 -#define __NR_sched_get_priority_max	159 -#define __NR_sched_get_priority_min	160 -#define __NR_sched_rr_get_interval	161 -#define __NR_nanosleep		162 -#define __NR_mremap		163 -#define __NR_setresuid		164 -#define __NR_getresuid		165 -				/* 166 __NR_vm86 */ -				/* 167 __NR_query_module */ -				/* 168 __NR_poll */ -#define __NR_nfsservctl		169 -#define __NR_setresgid		170 -#define __NR_getresgid		171 -#define __NR_prctl		172 -#define __NR_rt_sigreturn	173 -#define __NR_rt_sigaction	174 -#define __NR_rt_sigprocmask	175 -#define __NR_rt_sigpending	176 -#define __NR_rt_sigtimedwait	177 -#define __NR_rt_sigqueueinfo	178 -#define __NR_rt_sigsuspend	179 -#define __NR_pread		180 -#define __NR_pwrite		181 -#define __NR_lchown		182 -#define __NR_getcwd		183 -#define __NR_capget		184 -#define __NR_capset		185 -#define __NR_sigaltstack	186 -#define __NR_sendfile		187 -				/* 188 __NR_getpmsg */ -				/* 189 __NR_putpmsg */ -#define __NR_vfork		190 -#define __NR_getrlimit		191 -#define __NR_mmap2		192 -#define __NR_truncate64		193 -#define __NR_ftruncate64	194 -#define __NR_stat64		195 -#define __NR_lstat64		196 -#define __NR_fstat64		197 -#define __NR_chown32		198 -#define __NR_getuid32		199 -#define __NR_getgid32		200 -#define __NR_geteuid32		201 -#define __NR_getegid32		202 -#define __NR_setreuid32		203 -#define __NR_setregid32		204 -#define __NR_getgroups32	205 -#define __NR_setgroups32	206 -#define __NR_fchown32		207 -#define __NR_setresuid32	208 -#define __NR_getresuid32	209 -#define __NR_setresgid32	210 -#define __NR_getresgid32	211 -#define __NR_lchown32		212 -#define __NR_setuid32		213 -#define __NR_setgid32		214 -#define __NR_setfsuid32		215 -#define __NR_setfsgid32		216 -#define __NR_pivot_root		217 -				/* 218 __NR_mincore */ -				/* 219 __NR_madvise */ -#define __NR_getdents64		220 -#define __NR_fcntl64		221 -				/* 222 reserved for TUX */ -				/* 223 reserved for TUX */ -#define __NR_gettid		224 -#define __NR_readahead		225 -#define __NR_setxattr		226 -#define __NR_lsetxattr		227 -#define __NR_fsetxattr		228 -#define __NR_getxattr		229 -#define __NR_lgetxattr		230 -#define __NR_fgetxattr		231 -#define __NR_listxattr		232 -#define __NR_llistxattr		233 -#define __NR_flistxattr		234 -#define __NR_removexattr	235 -#define __NR_lremovexattr	236 -#define __NR_fremovexattr	237 -#define __NR_tkill		238 -#define __NR_sendfile64		239 -#define __NR_futex		240 -#define __NR_sched_setaffinity	241 -#define __NR_sched_getaffinity	242 -				/* 243 __NR_set_thread_area */ -				/* 244 __NR_get_thread_area */ -#define __NR_io_setup		245 -#define __NR_io_destroy		246 -#define __NR_io_getevents	247 -#define __NR_io_submit		248 -#define __NR_io_cancel		249 -				/* 250 __NR_alloc_hugepages */ -				/* 251 __NR_free_hugepages */ -#define __NR_exit_group		252 -#define __NR_lookup_dcookie     253 -#define __NR_bfin_spinlock      254 - -#define __NR_epoll_create	255 -#define __NR_epoll_ctl		256 -#define __NR_epoll_wait		257 -				/* 258 __NR_remap_file_pages */ -#define __NR_set_tid_address	259 -#define __NR_timer_create	260 -#define __NR_timer_settime	261 -#define __NR_timer_gettime	262 -#define __NR_timer_getoverrun	263 -#define __NR_timer_delete	264 -#define __NR_clock_settime	265 -#define __NR_clock_gettime	266 -#define __NR_clock_getres	267 -#define __NR_clock_nanosleep	268 -#define __NR_statfs64		269 -#define __NR_fstatfs64		270 -#define __NR_tgkill		271 -#define __NR_utimes		272 -#define __NR_fadvise64_64	273 -				/* 274 __NR_vserver */ -				/* 275 __NR_mbind */ -				/* 276 __NR_get_mempolicy */ -				/* 277 __NR_set_mempolicy */ -#define __NR_mq_open 		278 -#define __NR_mq_unlink		279 -#define __NR_mq_timedsend	280 -#define __NR_mq_timedreceive	281 -#define __NR_mq_notify		282 -#define __NR_mq_getsetattr	283 -#define __NR_kexec_load		284 -#define __NR_waitid		285 -#define __NR_add_key		286 -#define __NR_request_key	287 -#define __NR_keyctl		288 -#define __NR_ioprio_set		289 -#define __NR_ioprio_get		290 -#define __NR_inotify_init	291 -#define __NR_inotify_add_watch	292 -#define __NR_inotify_rm_watch	293 -				/* 294 __NR_migrate_pages */ -#define __NR_openat		295 -#define __NR_mkdirat		296 -#define __NR_mknodat		297 -#define __NR_fchownat		298 -#define __NR_futimesat		299 -#define __NR_fstatat64		300 -#define __NR_unlinkat		301 -#define __NR_renameat		302 -#define __NR_linkat		303 -#define __NR_symlinkat		304 -#define __NR_readlinkat		305 -#define __NR_fchmodat		306 -#define __NR_faccessat		307 -#define __NR_pselect6		308 -#define __NR_ppoll		309 -#define __NR_unshare		310 - -/* Blackfin private syscalls */ -#define __NR_sram_alloc		311 -#define __NR_sram_free		312 -#define __NR_dma_memcpy		313 - -/* socket syscalls */ -#define __NR_accept		314 -#define __NR_bind		315 -#define __NR_connect		316 -#define __NR_getpeername	317 -#define __NR_getsockname	318 -#define __NR_getsockopt		319 -#define __NR_listen		320 -#define __NR_recv		321 -#define __NR_recvfrom		322 -#define __NR_recvmsg		323 -#define __NR_send		324 -#define __NR_sendmsg		325 -#define __NR_sendto		326 -#define __NR_setsockopt		327 -#define __NR_shutdown		328 -#define __NR_socket		329 -#define __NR_socketpair		330 - -/* sysv ipc syscalls */ -#define __NR_semctl		331 -#define __NR_semget		332 -#define __NR_semop		333 -#define __NR_msgctl		334 -#define __NR_msgget		335 -#define __NR_msgrcv		336 -#define __NR_msgsnd		337 -#define __NR_shmat		338 -#define __NR_shmctl		339 -#define __NR_shmdt		340 -#define __NR_shmget		341 -#define __NR_splice		342 -#define __NR_sync_file_range	343 -#define __NR_tee		344 -#define __NR_vmsplice		345 +#include <uapi/asm/unistd.h> -#define __NR_epoll_pwait	346 -#define __NR_utimensat		347 -#define __NR_signalfd		348 -#define __NR_timerfd_create	349 -#define __NR_eventfd		350 -#define __NR_pread64		351 -#define __NR_pwrite64		352 -#define __NR_fadvise64		353 -#define __NR_set_robust_list	354 -#define __NR_get_robust_list	355 -#define __NR_fallocate		356 -#define __NR_semtimedop		357 -#define __NR_timerfd_settime	358 -#define __NR_timerfd_gettime	359 -#define __NR_signalfd4		360 -#define __NR_eventfd2		361 -#define __NR_epoll_create1	362 -#define __NR_dup3		363 -#define __NR_pipe2		364 -#define __NR_inotify_init1	365 -#define __NR_preadv		366 -#define __NR_pwritev		367 -#define __NR_rt_tgsigqueueinfo	368 -#define __NR_perf_event_open	369 -#define __NR_recvmmsg		370 -#define __NR_fanotify_init	371 -#define __NR_fanotify_mark	372 -#define __NR_prlimit64		373 -#define __NR_cacheflush		374 -#define __NR_name_to_handle_at	375 -#define __NR_open_by_handle_at	376 -#define __NR_clock_adjtime	377 -#define __NR_syncfs		378 -#define __NR_setns		379 -#define __NR_sendmmsg		380 -#define __NR_process_vm_readv	381 -#define __NR_process_vm_writev	382 - -#define __NR_syscall		383 -#define NR_syscalls		__NR_syscall - -/* Old optional stuff no one actually uses */ -#define __IGNORE_sysfs -#define __IGNORE_uselib - -/* Implement the newer interfaces */ -#define __IGNORE_mmap -#define __IGNORE_poll -#define __IGNORE_select -#define __IGNORE_utime - -/* Not relevant on no-mmu */ -#define __IGNORE_swapon -#define __IGNORE_swapoff -#define __IGNORE_msync -#define __IGNORE_mlock -#define __IGNORE_munlock -#define __IGNORE_mlockall -#define __IGNORE_munlockall -#define __IGNORE_mincore -#define __IGNORE_madvise -#define __IGNORE_remap_file_pages -#define __IGNORE_mbind -#define __IGNORE_get_mempolicy -#define __IGNORE_set_mempolicy -#define __IGNORE_migrate_pages -#define __IGNORE_move_pages -#define __IGNORE_getcpu - -#ifdef __KERNEL__  #define __ARCH_WANT_STAT64  #define __ARCH_WANT_SYS_ALARM  #define __ARCH_WANT_SYS_GETHOSTNAME @@ -446,7 +20,6 @@  #define __ARCH_WANT_SYS_NICE  #define __ARCH_WANT_SYS_RT_SIGACTION  #define __ARCH_WANT_SYS_RT_SIGSUSPEND -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_VFORK  /* @@ -457,6 +30,4 @@   */  #define cond_syscall(x) asm(".weak\t_" #x "\n\t.set\t_" #x ",_sys_ni_syscall"); -#endif	/* __KERNEL__ */ -  #endif				/* __ASM_BFIN_UNISTD_H */ diff --git a/arch/blackfin/include/mach-common/irq.h b/arch/blackfin/include/mach-common/irq.h index cab14e911dc..af9fc8171eb 100644 --- a/arch/blackfin/include/mach-common/irq.h +++ b/arch/blackfin/include/mach-common/irq.h @@ -40,8 +40,6 @@  #define IRQ_HWERR		5	/* Hardware Error */  #define IRQ_CORETMR		6	/* Core timer */ -#define BFIN_IRQ(x)		((x) + 7) -  #define IVG7			7  #define IVG8			8  #define IVG9			9 @@ -52,6 +50,9 @@  #define IVG14			14  #define IVG15			15 +#define BFIN_IRQ(x)		((x) + IVG7) +#define BFIN_SYSIRQ(x)		((x) - IVG7) +  #define NR_IRQS			(NR_MACH_IRQS + NR_SPARE_IRQS)  #endif diff --git a/arch/blackfin/include/uapi/asm/Kbuild b/arch/blackfin/include/uapi/asm/Kbuild index baebb3da1d4..0bd28f77abc 100644 --- a/arch/blackfin/include/uapi/asm/Kbuild +++ b/arch/blackfin/include/uapi/asm/Kbuild @@ -1,3 +1,19 @@  # UAPI Header export list  include include/uapi/asm-generic/Kbuild.asm +header-y += bfin_sport.h +header-y += byteorder.h +header-y += cachectl.h +header-y += fcntl.h +header-y += fixed_code.h +header-y += ioctls.h +header-y += kvm_para.h +header-y += poll.h +header-y += posix_types.h +header-y += ptrace.h +header-y += sigcontext.h +header-y += siginfo.h +header-y += signal.h +header-y += stat.h +header-y += swab.h +header-y += unistd.h diff --git a/arch/blackfin/include/uapi/asm/bfin_sport.h b/arch/blackfin/include/uapi/asm/bfin_sport.h new file mode 100644 index 00000000000..c086de87ee6 --- /dev/null +++ b/arch/blackfin/include/uapi/asm/bfin_sport.h @@ -0,0 +1,136 @@ +/* + * bfin_sport.h - interface to Blackfin SPORTs + * + * Copyright 2004-2009 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#ifndef _UAPI__BFIN_SPORT_H__ +#define _UAPI__BFIN_SPORT_H__ + +/* Sport mode: it can be set to TDM, i2s or others */ +#define NORM_MODE	0x0 +#define TDM_MODE	0x1 +#define I2S_MODE	0x2 +#define NDSO_MODE	0x3 + +/* Data format, normal, a-law or u-law */ +#define NORM_FORMAT	0x0 +#define ALAW_FORMAT	0x2 +#define ULAW_FORMAT	0x3 + +/* Function driver which use sport must initialize the structure */ +struct sport_config { +	/* TDM (multichannels), I2S or other mode */ +	unsigned int mode:3; +	unsigned int polled;	/* use poll instead of irq when set */ + +	/* if TDM mode is selected, channels must be set */ +	int channels;	/* Must be in 8 units */ +	unsigned int frame_delay:4;	/* Delay between frame sync pulse and first bit */ + +	/* I2S mode */ +	unsigned int right_first:1;	/* Right stereo channel first */ + +	/* In mormal mode, the following item need to be set */ +	unsigned int lsb_first:1;	/* order of transmit or receive data */ +	unsigned int fsync:1;	/* Frame sync required */ +	unsigned int data_indep:1;	/* data independent frame sync generated */ +	unsigned int act_low:1;	/* Active low TFS */ +	unsigned int late_fsync:1;	/* Late frame sync */ +	unsigned int tckfe:1; +	unsigned int sec_en:1;	/* Secondary side enabled */ + +	/* Choose clock source */ +	unsigned int int_clk:1;	/* Internal or external clock */ + +	/* If external clock is used, the following fields are ignored */ +	int serial_clk; +	int fsync_clk; + +	unsigned int data_format:2;	/* Normal, u-law or a-law */ + +	int word_len;		/* How length of the word in bits, 3-32 bits */ +	int dma_enabled; +}; + +/* Userspace interface */ +#define SPORT_IOC_MAGIC		'P' +#define SPORT_IOC_CONFIG	_IOWR('P', 0x01, struct sport_config) +#define SPORT_IOC_GET_SYSTEMCLOCK         _IOR('P', 0x02, unsigned long) +#define SPORT_IOC_SET_BAUDRATE            _IOW('P', 0x03, unsigned long) + + +/* SPORT_TCR1 Masks */ +#define TSPEN		0x0001	/* TX enable */ +#define ITCLK		0x0002	/* Internal TX Clock Select */ +#define TDTYPE		0x000C	/* TX Data Formatting Select */ +#define DTYPE_NORM	0x0000	/* Data Format Normal */ +#define DTYPE_ULAW	0x0008	/* Compand Using u-Law */ +#define DTYPE_ALAW	0x000C	/* Compand Using A-Law */ +#define TLSBIT		0x0010	/* TX Bit Order */ +#define ITFS		0x0200	/* Internal TX Frame Sync Select */ +#define TFSR		0x0400	/* TX Frame Sync Required Select */ +#define DITFS		0x0800	/* Data Independent TX Frame Sync Select */ +#define LTFS		0x1000	/* Low TX Frame Sync Select */ +#define LATFS		0x2000	/* Late TX Frame Sync Select */ +#define TCKFE		0x4000	/* TX Clock Falling Edge Select */ + +/* SPORT_TCR2 Masks */ +#define SLEN		0x001F	/* SPORT TX Word Length (2 - 31) */ +#define DP_SLEN(x)	BFIN_DEPOSIT(SLEN, x) +#define EX_SLEN(x)	BFIN_EXTRACT(SLEN, x) +#define TXSE		0x0100	/* TX Secondary Enable */ +#define TSFSE		0x0200	/* TX Stereo Frame Sync Enable */ +#define TRFST		0x0400	/* TX Right-First Data Order */ + +/* SPORT_RCR1 Masks */ +#define RSPEN		0x0001	/* RX enable */ +#define IRCLK		0x0002	/* Internal RX Clock Select */ +#define RDTYPE		0x000C	/* RX Data Formatting Select */ +/* DTYPE_* defined above */ +#define RLSBIT		0x0010	/* RX Bit Order */ +#define IRFS		0x0200	/* Internal RX Frame Sync Select */ +#define RFSR		0x0400	/* RX Frame Sync Required Select */ +#define LRFS		0x1000	/* Low RX Frame Sync Select */ +#define LARFS		0x2000	/* Late RX Frame Sync Select */ +#define RCKFE		0x4000	/* RX Clock Falling Edge Select */ + +/* SPORT_RCR2 Masks */ +/* SLEN defined above */ +#define RXSE		0x0100	/* RX Secondary Enable */ +#define RSFSE		0x0200	/* RX Stereo Frame Sync Enable */ +#define RRFST		0x0400	/* Right-First Data Order */ + +/* SPORT_STAT Masks */ +#define RXNE		0x0001	/* RX FIFO Not Empty Status */ +#define RUVF		0x0002	/* RX Underflow Status */ +#define ROVF		0x0004	/* RX Overflow Status */ +#define TXF		0x0008	/* TX FIFO Full Status */ +#define TUVF		0x0010	/* TX Underflow Status */ +#define TOVF		0x0020	/* TX Overflow Status */ +#define TXHRE		0x0040	/* TX Hold Register Empty */ + +/* SPORT_MCMC1 Masks */ +#define SP_WOFF		0x03FF	/* Multichannel Window Offset Field */ +#define DP_SP_WOFF(x)	BFIN_DEPOSIT(SP_WOFF, x) +#define EX_SP_WOFF(x)	BFIN_EXTRACT(SP_WOFF, x) +#define SP_WSIZE	0xF000	/* Multichannel Window Size Field */ +#define DP_SP_WSIZE(x)	BFIN_DEPOSIT(SP_WSIZE, x) +#define EX_SP_WSIZE(x)	BFIN_EXTRACT(SP_WSIZE, x) + +/* SPORT_MCMC2 Masks */ +#define MCCRM		0x0003	/* Multichannel Clock Recovery Mode */ +#define REC_BYPASS	0x0000	/* Bypass Mode (No Clock Recovery) */ +#define REC_2FROM4	0x0002	/* Recover 2 MHz Clock from 4 MHz Clock */ +#define REC_8FROM16	0x0003	/* Recover 8 MHz Clock from 16 MHz Clock */ +#define MCDTXPE		0x0004	/* Multichannel DMA Transmit Packing */ +#define MCDRXPE		0x0008	/* Multichannel DMA Receive Packing */ +#define MCMEN		0x0010	/* Multichannel Frame Mode Enable */ +#define FSDR		0x0080	/* Multichannel Frame Sync to Data Relationship */ +#define MFD		0xF000	/* Multichannel Frame Delay */ +#define DP_MFD(x)	BFIN_DEPOSIT(MFD, x) +#define EX_MFD(x)	BFIN_EXTRACT(MFD, x) + +#endif /* _UAPI__BFIN_SPORT_H__ */ diff --git a/arch/blackfin/include/asm/byteorder.h b/arch/blackfin/include/uapi/asm/byteorder.h index 9558416d578..9558416d578 100644 --- a/arch/blackfin/include/asm/byteorder.h +++ b/arch/blackfin/include/uapi/asm/byteorder.h diff --git a/arch/blackfin/include/asm/cachectl.h b/arch/blackfin/include/uapi/asm/cachectl.h index 03255df6c1e..03255df6c1e 100644 --- a/arch/blackfin/include/asm/cachectl.h +++ b/arch/blackfin/include/uapi/asm/cachectl.h diff --git a/arch/blackfin/include/asm/fcntl.h b/arch/blackfin/include/uapi/asm/fcntl.h index 251c911d59c..251c911d59c 100644 --- a/arch/blackfin/include/asm/fcntl.h +++ b/arch/blackfin/include/uapi/asm/fcntl.h diff --git a/arch/blackfin/include/uapi/asm/fixed_code.h b/arch/blackfin/include/uapi/asm/fixed_code.h new file mode 100644 index 00000000000..3bef1dca379 --- /dev/null +++ b/arch/blackfin/include/uapi/asm/fixed_code.h @@ -0,0 +1,38 @@ +/* + * This file defines the fixed addresses where userspace programs + * can find atomic code sequences. + * + * Copyright 2007-2008 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#ifndef _UAPI__BFIN_ASM_FIXED_CODE_H__ +#define _UAPI__BFIN_ASM_FIXED_CODE_H__ + + +#ifndef CONFIG_PHY_RAM_BASE_ADDRESS +#define CONFIG_PHY_RAM_BASE_ADDRESS	0x0 +#endif + +#define FIXED_CODE_START	(CONFIG_PHY_RAM_BASE_ADDRESS + 0x400) + +#define SIGRETURN_STUB		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x400) + +#define ATOMIC_SEQS_START	(CONFIG_PHY_RAM_BASE_ADDRESS + 0x410) + +#define ATOMIC_XCHG32		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x410) +#define ATOMIC_CAS32		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x420) +#define ATOMIC_ADD32		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x430) +#define ATOMIC_SUB32		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x440) +#define ATOMIC_IOR32		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x450) +#define ATOMIC_AND32		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x460) +#define ATOMIC_XOR32		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x470) + +#define ATOMIC_SEQS_END		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x480) + +#define SAFE_USER_INSTRUCTION   (CONFIG_PHY_RAM_BASE_ADDRESS + 0x480) + +#define FIXED_CODE_END		(CONFIG_PHY_RAM_BASE_ADDRESS + 0x490) + +#endif /* _UAPI__BFIN_ASM_FIXED_CODE_H__ */ diff --git a/arch/blackfin/include/asm/ioctls.h b/arch/blackfin/include/uapi/asm/ioctls.h index eca8d75b0a8..eca8d75b0a8 100644 --- a/arch/blackfin/include/asm/ioctls.h +++ b/arch/blackfin/include/uapi/asm/ioctls.h diff --git a/arch/blackfin/include/asm/poll.h b/arch/blackfin/include/uapi/asm/poll.h index 072d8966c5c..072d8966c5c 100644 --- a/arch/blackfin/include/asm/poll.h +++ b/arch/blackfin/include/uapi/asm/poll.h diff --git a/arch/blackfin/include/asm/posix_types.h b/arch/blackfin/include/uapi/asm/posix_types.h index 1bd3436db6a..1bd3436db6a 100644 --- a/arch/blackfin/include/asm/posix_types.h +++ b/arch/blackfin/include/uapi/asm/posix_types.h diff --git a/arch/blackfin/include/uapi/asm/ptrace.h b/arch/blackfin/include/uapi/asm/ptrace.h new file mode 100644 index 00000000000..fd48bd0739d --- /dev/null +++ b/arch/blackfin/include/uapi/asm/ptrace.h @@ -0,0 +1,170 @@ +/* + * Copyright 2004-2008 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#ifndef _UAPI_BFIN_PTRACE_H +#define _UAPI_BFIN_PTRACE_H + +/* + * GCC defines register number like this: + * ----------------------------- + *       0 - 7 are data registers R0-R7 + *       8 - 15 are address registers P0-P7 + *      16 - 31 dsp registers I/B/L0 -- I/B/L3 & M0--M3 + *      32 - 33 A registers A0 & A1 + *      34 -    status register + * ----------------------------- + * + * We follows above, except: + *      32-33 --- Low 32-bit of A0&1 + *      34-35 --- High 8-bit of A0&1 + */ + +#ifndef __ASSEMBLY__ + +struct task_struct; + +/* this struct defines the way the registers are stored on the +   stack during a system call. */ + +struct pt_regs { +	long orig_pc; +	long ipend; +	long seqstat; +	long rete; +	long retn; +	long retx; +	long pc;		/* PC == RETI */ +	long rets; +	long reserved;		/* Used as scratch during system calls */ +	long astat; +	long lb1; +	long lb0; +	long lt1; +	long lt0; +	long lc1; +	long lc0; +	long a1w; +	long a1x; +	long a0w; +	long a0x; +	long b3; +	long b2; +	long b1; +	long b0; +	long l3; +	long l2; +	long l1; +	long l0; +	long m3; +	long m2; +	long m1; +	long m0; +	long i3; +	long i2; +	long i1; +	long i0; +	long usp; +	long fp; +	long p5; +	long p4; +	long p3; +	long p2; +	long p1; +	long p0; +	long r7; +	long r6; +	long r5; +	long r4; +	long r3; +	long r2; +	long r1; +	long r0; +	long orig_r0; +	long orig_p0; +	long syscfg; +}; + +/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ +#define PTRACE_GETREGS            12 +#define PTRACE_SETREGS            13	/* ptrace signal  */ + +#define PTRACE_GETFDPIC           31	/* get the ELF fdpic loadmap address */ +#define PTRACE_GETFDPIC_EXEC       0	/* [addr] request the executable loadmap */ +#define PTRACE_GETFDPIC_INTERP     1	/* [addr] request the interpreter loadmap */ + +#define PS_S  (0x0002) + + +#endif				/* __ASSEMBLY__ */ + +/* + * Offsets used by 'ptrace' system call interface. + */ + +#define PT_R0 204 +#define PT_R1 200 +#define PT_R2 196 +#define PT_R3 192 +#define PT_R4 188 +#define PT_R5 184 +#define PT_R6 180 +#define PT_R7 176 +#define PT_P0 172 +#define PT_P1 168 +#define PT_P2 164 +#define PT_P3 160 +#define PT_P4 156 +#define PT_P5 152 +#define PT_FP 148 +#define PT_USP 144 +#define PT_I0 140 +#define PT_I1 136 +#define PT_I2 132 +#define PT_I3 128 +#define PT_M0 124 +#define PT_M1 120 +#define PT_M2 116 +#define PT_M3 112 +#define PT_L0 108 +#define PT_L1 104 +#define PT_L2 100 +#define PT_L3 96 +#define PT_B0 92 +#define PT_B1 88 +#define PT_B2 84 +#define PT_B3 80 +#define PT_A0X 76 +#define PT_A0W 72 +#define PT_A1X 68 +#define PT_A1W 64 +#define PT_LC0 60 +#define PT_LC1 56 +#define PT_LT0 52 +#define PT_LT1 48 +#define PT_LB0 44 +#define PT_LB1 40 +#define PT_ASTAT 36 +#define PT_RESERVED 32 +#define PT_RETS 28 +#define PT_PC 24 +#define PT_RETX 20 +#define PT_RETN 16 +#define PT_RETE 12 +#define PT_SEQSTAT 8 +#define PT_IPEND 4 + +#define PT_ORIG_R0 208 +#define PT_ORIG_P0 212 +#define PT_SYSCFG 216 +#define PT_TEXT_ADDR 220 +#define PT_TEXT_END_ADDR 224 +#define PT_DATA_ADDR 228 +#define PT_FDPIC_EXEC 232 +#define PT_FDPIC_INTERP 236 + +#define PT_LAST_PSEUDO PT_FDPIC_INTERP + +#endif /* _UAPI_BFIN_PTRACE_H */ diff --git a/arch/blackfin/include/asm/sigcontext.h b/arch/blackfin/include/uapi/asm/sigcontext.h index 906bdc1f5fd..906bdc1f5fd 100644 --- a/arch/blackfin/include/asm/sigcontext.h +++ b/arch/blackfin/include/uapi/asm/sigcontext.h diff --git a/arch/blackfin/include/asm/siginfo.h b/arch/blackfin/include/uapi/asm/siginfo.h index 3e81306394e..3e81306394e 100644 --- a/arch/blackfin/include/asm/siginfo.h +++ b/arch/blackfin/include/uapi/asm/siginfo.h diff --git a/arch/blackfin/include/asm/signal.h b/arch/blackfin/include/uapi/asm/signal.h index 77a3bf37b69..77a3bf37b69 100644 --- a/arch/blackfin/include/asm/signal.h +++ b/arch/blackfin/include/uapi/asm/signal.h diff --git a/arch/blackfin/include/asm/stat.h b/arch/blackfin/include/uapi/asm/stat.h index 2e27665c4e9..2e27665c4e9 100644 --- a/arch/blackfin/include/asm/stat.h +++ b/arch/blackfin/include/uapi/asm/stat.h diff --git a/arch/blackfin/include/asm/swab.h b/arch/blackfin/include/uapi/asm/swab.h index 89de6507ca2..89de6507ca2 100644 --- a/arch/blackfin/include/asm/swab.h +++ b/arch/blackfin/include/uapi/asm/swab.h diff --git a/arch/blackfin/include/uapi/asm/unistd.h b/arch/blackfin/include/uapi/asm/unistd.h new file mode 100644 index 00000000000..a4511649a86 --- /dev/null +++ b/arch/blackfin/include/uapi/asm/unistd.h @@ -0,0 +1,437 @@ +/* + * Copyright 2004-2009 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#ifndef _UAPI__ASM_BFIN_UNISTD_H +#define _UAPI__ASM_BFIN_UNISTD_H +/* + * This file contains the system call numbers. + */ +#define __NR_restart_syscall	  0 +#define __NR_exit		  1 +				/* 2 __NR_fork not supported on nommu */ +#define __NR_read		  3 +#define __NR_write		  4 +#define __NR_open		  5 +#define __NR_close		  6 +				/* 7 __NR_waitpid obsolete */ +#define __NR_creat		  8 +#define __NR_link		  9 +#define __NR_unlink		 10 +#define __NR_execve		 11 +#define __NR_chdir		 12 +#define __NR_time		 13 +#define __NR_mknod		 14 +#define __NR_chmod		 15 +#define __NR_chown		 16 +				/* 17 __NR_break obsolete */ +				/* 18 __NR_oldstat obsolete */ +#define __NR_lseek		 19 +#define __NR_getpid		 20 +#define __NR_mount		 21 +				/* 22 __NR_umount obsolete */ +#define __NR_setuid		 23 +#define __NR_getuid		 24 +#define __NR_stime		 25 +#define __NR_ptrace		 26 +#define __NR_alarm		 27 +				/* 28 __NR_oldfstat obsolete */ +#define __NR_pause		 29 +				/* 30 __NR_utime obsolete */ +				/* 31 __NR_stty obsolete */ +				/* 32 __NR_gtty obsolete */ +#define __NR_access		 33 +#define __NR_nice		 34 +				/* 35 __NR_ftime obsolete */ +#define __NR_sync		 36 +#define __NR_kill		 37 +#define __NR_rename		 38 +#define __NR_mkdir		 39 +#define __NR_rmdir		 40 +#define __NR_dup		 41 +#define __NR_pipe		 42 +#define __NR_times		 43 +				/* 44 __NR_prof obsolete */ +#define __NR_brk		 45 +#define __NR_setgid		 46 +#define __NR_getgid		 47 +				/* 48 __NR_signal obsolete */ +#define __NR_geteuid		 49 +#define __NR_getegid		 50 +#define __NR_acct		 51 +#define __NR_umount2		 52 +				/* 53 __NR_lock obsolete */ +#define __NR_ioctl		 54 +#define __NR_fcntl		 55 +				/* 56 __NR_mpx obsolete */ +#define __NR_setpgid		 57 +				/* 58 __NR_ulimit obsolete */ +				/* 59 __NR_oldolduname obsolete */ +#define __NR_umask		 60 +#define __NR_chroot		 61 +#define __NR_ustat		 62 +#define __NR_dup2		 63 +#define __NR_getppid		 64 +#define __NR_getpgrp		 65 +#define __NR_setsid		 66 +				/* 67 __NR_sigaction obsolete */ +#define __NR_sgetmask		 68 +#define __NR_ssetmask		 69 +#define __NR_setreuid		 70 +#define __NR_setregid		 71 +				/* 72 __NR_sigsuspend obsolete */ +				/* 73 __NR_sigpending obsolete */ +#define __NR_sethostname	 74 +#define __NR_setrlimit		 75 +				/* 76 __NR_old_getrlimit obsolete */ +#define __NR_getrusage		 77 +#define __NR_gettimeofday	 78 +#define __NR_settimeofday	 79 +#define __NR_getgroups		 80 +#define __NR_setgroups		 81 +				/* 82 __NR_select obsolete */ +#define __NR_symlink		 83 +				/* 84 __NR_oldlstat obsolete */ +#define __NR_readlink		 85 +				/* 86 __NR_uselib obsolete */ +				/* 87 __NR_swapon obsolete */ +#define __NR_reboot		 88 +				/* 89 __NR_readdir obsolete */ +				/* 90 __NR_mmap obsolete */ +#define __NR_munmap		 91 +#define __NR_truncate		 92 +#define __NR_ftruncate		 93 +#define __NR_fchmod		 94 +#define __NR_fchown		 95 +#define __NR_getpriority	 96 +#define __NR_setpriority	 97 +				/* 98 __NR_profil obsolete */ +#define __NR_statfs		 99 +#define __NR_fstatfs		100 +				/* 101 __NR_ioperm */ +				/* 102 __NR_socketcall obsolete */ +#define __NR_syslog		103 +#define __NR_setitimer		104 +#define __NR_getitimer		105 +#define __NR_stat		106 +#define __NR_lstat		107 +#define __NR_fstat		108 +				/* 109 __NR_olduname obsolete */ +				/* 110 __NR_iopl obsolete */ +#define __NR_vhangup		111 +				/* 112 __NR_idle obsolete */ +				/* 113 __NR_vm86old */ +#define __NR_wait4		114 +				/* 115 __NR_swapoff obsolete */ +#define __NR_sysinfo		116 +				/* 117 __NR_ipc oboslete */ +#define __NR_fsync		118 +				/* 119 __NR_sigreturn obsolete */ +#define __NR_clone		120 +#define __NR_setdomainname	121 +#define __NR_uname		122 +				/* 123 __NR_modify_ldt obsolete */ +#define __NR_adjtimex		124 +#define __NR_mprotect		125 +				/* 126 __NR_sigprocmask obsolete */ +				/* 127 __NR_create_module obsolete */ +#define __NR_init_module	128 +#define __NR_delete_module	129 +				/* 130 __NR_get_kernel_syms obsolete */ +#define __NR_quotactl		131 +#define __NR_getpgid		132 +#define __NR_fchdir		133 +#define __NR_bdflush		134 +				/* 135 was sysfs */ +#define __NR_personality	136 +				/* 137 __NR_afs_syscall */ +#define __NR_setfsuid		138 +#define __NR_setfsgid		139 +#define __NR__llseek		140 +#define __NR_getdents		141 +				/* 142 __NR__newselect obsolete */ +#define __NR_flock		143 +				/* 144 __NR_msync obsolete */ +#define __NR_readv		145 +#define __NR_writev		146 +#define __NR_getsid		147 +#define __NR_fdatasync		148 +#define __NR__sysctl		149 +				/* 150 __NR_mlock */ +				/* 151 __NR_munlock */ +				/* 152 __NR_mlockall */ +				/* 153 __NR_munlockall */ +#define __NR_sched_setparam		154 +#define __NR_sched_getparam		155 +#define __NR_sched_setscheduler		156 +#define __NR_sched_getscheduler		157 +#define __NR_sched_yield		158 +#define __NR_sched_get_priority_max	159 +#define __NR_sched_get_priority_min	160 +#define __NR_sched_rr_get_interval	161 +#define __NR_nanosleep		162 +#define __NR_mremap		163 +#define __NR_setresuid		164 +#define __NR_getresuid		165 +				/* 166 __NR_vm86 */ +				/* 167 __NR_query_module */ +				/* 168 __NR_poll */ +#define __NR_nfsservctl		169 +#define __NR_setresgid		170 +#define __NR_getresgid		171 +#define __NR_prctl		172 +#define __NR_rt_sigreturn	173 +#define __NR_rt_sigaction	174 +#define __NR_rt_sigprocmask	175 +#define __NR_rt_sigpending	176 +#define __NR_rt_sigtimedwait	177 +#define __NR_rt_sigqueueinfo	178 +#define __NR_rt_sigsuspend	179 +#define __NR_pread		180 +#define __NR_pwrite		181 +#define __NR_lchown		182 +#define __NR_getcwd		183 +#define __NR_capget		184 +#define __NR_capset		185 +#define __NR_sigaltstack	186 +#define __NR_sendfile		187 +				/* 188 __NR_getpmsg */ +				/* 189 __NR_putpmsg */ +#define __NR_vfork		190 +#define __NR_getrlimit		191 +#define __NR_mmap2		192 +#define __NR_truncate64		193 +#define __NR_ftruncate64	194 +#define __NR_stat64		195 +#define __NR_lstat64		196 +#define __NR_fstat64		197 +#define __NR_chown32		198 +#define __NR_getuid32		199 +#define __NR_getgid32		200 +#define __NR_geteuid32		201 +#define __NR_getegid32		202 +#define __NR_setreuid32		203 +#define __NR_setregid32		204 +#define __NR_getgroups32	205 +#define __NR_setgroups32	206 +#define __NR_fchown32		207 +#define __NR_setresuid32	208 +#define __NR_getresuid32	209 +#define __NR_setresgid32	210 +#define __NR_getresgid32	211 +#define __NR_lchown32		212 +#define __NR_setuid32		213 +#define __NR_setgid32		214 +#define __NR_setfsuid32		215 +#define __NR_setfsgid32		216 +#define __NR_pivot_root		217 +				/* 218 __NR_mincore */ +				/* 219 __NR_madvise */ +#define __NR_getdents64		220 +#define __NR_fcntl64		221 +				/* 222 reserved for TUX */ +				/* 223 reserved for TUX */ +#define __NR_gettid		224 +#define __NR_readahead		225 +#define __NR_setxattr		226 +#define __NR_lsetxattr		227 +#define __NR_fsetxattr		228 +#define __NR_getxattr		229 +#define __NR_lgetxattr		230 +#define __NR_fgetxattr		231 +#define __NR_listxattr		232 +#define __NR_llistxattr		233 +#define __NR_flistxattr		234 +#define __NR_removexattr	235 +#define __NR_lremovexattr	236 +#define __NR_fremovexattr	237 +#define __NR_tkill		238 +#define __NR_sendfile64		239 +#define __NR_futex		240 +#define __NR_sched_setaffinity	241 +#define __NR_sched_getaffinity	242 +				/* 243 __NR_set_thread_area */ +				/* 244 __NR_get_thread_area */ +#define __NR_io_setup		245 +#define __NR_io_destroy		246 +#define __NR_io_getevents	247 +#define __NR_io_submit		248 +#define __NR_io_cancel		249 +				/* 250 __NR_alloc_hugepages */ +				/* 251 __NR_free_hugepages */ +#define __NR_exit_group		252 +#define __NR_lookup_dcookie     253 +#define __NR_bfin_spinlock      254 + +#define __NR_epoll_create	255 +#define __NR_epoll_ctl		256 +#define __NR_epoll_wait		257 +				/* 258 __NR_remap_file_pages */ +#define __NR_set_tid_address	259 +#define __NR_timer_create	260 +#define __NR_timer_settime	261 +#define __NR_timer_gettime	262 +#define __NR_timer_getoverrun	263 +#define __NR_timer_delete	264 +#define __NR_clock_settime	265 +#define __NR_clock_gettime	266 +#define __NR_clock_getres	267 +#define __NR_clock_nanosleep	268 +#define __NR_statfs64		269 +#define __NR_fstatfs64		270 +#define __NR_tgkill		271 +#define __NR_utimes		272 +#define __NR_fadvise64_64	273 +				/* 274 __NR_vserver */ +				/* 275 __NR_mbind */ +				/* 276 __NR_get_mempolicy */ +				/* 277 __NR_set_mempolicy */ +#define __NR_mq_open 		278 +#define __NR_mq_unlink		279 +#define __NR_mq_timedsend	280 +#define __NR_mq_timedreceive	281 +#define __NR_mq_notify		282 +#define __NR_mq_getsetattr	283 +#define __NR_kexec_load		284 +#define __NR_waitid		285 +#define __NR_add_key		286 +#define __NR_request_key	287 +#define __NR_keyctl		288 +#define __NR_ioprio_set		289 +#define __NR_ioprio_get		290 +#define __NR_inotify_init	291 +#define __NR_inotify_add_watch	292 +#define __NR_inotify_rm_watch	293 +				/* 294 __NR_migrate_pages */ +#define __NR_openat		295 +#define __NR_mkdirat		296 +#define __NR_mknodat		297 +#define __NR_fchownat		298 +#define __NR_futimesat		299 +#define __NR_fstatat64		300 +#define __NR_unlinkat		301 +#define __NR_renameat		302 +#define __NR_linkat		303 +#define __NR_symlinkat		304 +#define __NR_readlinkat		305 +#define __NR_fchmodat		306 +#define __NR_faccessat		307 +#define __NR_pselect6		308 +#define __NR_ppoll		309 +#define __NR_unshare		310 + +/* Blackfin private syscalls */ +#define __NR_sram_alloc		311 +#define __NR_sram_free		312 +#define __NR_dma_memcpy		313 + +/* socket syscalls */ +#define __NR_accept		314 +#define __NR_bind		315 +#define __NR_connect		316 +#define __NR_getpeername	317 +#define __NR_getsockname	318 +#define __NR_getsockopt		319 +#define __NR_listen		320 +#define __NR_recv		321 +#define __NR_recvfrom		322 +#define __NR_recvmsg		323 +#define __NR_send		324 +#define __NR_sendmsg		325 +#define __NR_sendto		326 +#define __NR_setsockopt		327 +#define __NR_shutdown		328 +#define __NR_socket		329 +#define __NR_socketpair		330 + +/* sysv ipc syscalls */ +#define __NR_semctl		331 +#define __NR_semget		332 +#define __NR_semop		333 +#define __NR_msgctl		334 +#define __NR_msgget		335 +#define __NR_msgrcv		336 +#define __NR_msgsnd		337 +#define __NR_shmat		338 +#define __NR_shmctl		339 +#define __NR_shmdt		340 +#define __NR_shmget		341 + +#define __NR_splice		342 +#define __NR_sync_file_range	343 +#define __NR_tee		344 +#define __NR_vmsplice		345 + +#define __NR_epoll_pwait	346 +#define __NR_utimensat		347 +#define __NR_signalfd		348 +#define __NR_timerfd_create	349 +#define __NR_eventfd		350 +#define __NR_pread64		351 +#define __NR_pwrite64		352 +#define __NR_fadvise64		353 +#define __NR_set_robust_list	354 +#define __NR_get_robust_list	355 +#define __NR_fallocate		356 +#define __NR_semtimedop		357 +#define __NR_timerfd_settime	358 +#define __NR_timerfd_gettime	359 +#define __NR_signalfd4		360 +#define __NR_eventfd2		361 +#define __NR_epoll_create1	362 +#define __NR_dup3		363 +#define __NR_pipe2		364 +#define __NR_inotify_init1	365 +#define __NR_preadv		366 +#define __NR_pwritev		367 +#define __NR_rt_tgsigqueueinfo	368 +#define __NR_perf_event_open	369 +#define __NR_recvmmsg		370 +#define __NR_fanotify_init	371 +#define __NR_fanotify_mark	372 +#define __NR_prlimit64		373 +#define __NR_cacheflush		374 +#define __NR_name_to_handle_at	375 +#define __NR_open_by_handle_at	376 +#define __NR_clock_adjtime	377 +#define __NR_syncfs		378 +#define __NR_setns		379 +#define __NR_sendmmsg		380 +#define __NR_process_vm_readv	381 +#define __NR_process_vm_writev	382 + +#define __NR_syscall		383 +#define NR_syscalls		__NR_syscall + +/* Old optional stuff no one actually uses */ +#define __IGNORE_sysfs +#define __IGNORE_uselib + +/* Implement the newer interfaces */ +#define __IGNORE_mmap +#define __IGNORE_poll +#define __IGNORE_select +#define __IGNORE_utime + +/* Not relevant on no-mmu */ +#define __IGNORE_swapon +#define __IGNORE_swapoff +#define __IGNORE_msync +#define __IGNORE_mlock +#define __IGNORE_munlock +#define __IGNORE_mlockall +#define __IGNORE_munlockall +#define __IGNORE_mincore +#define __IGNORE_madvise +#define __IGNORE_remap_file_pages +#define __IGNORE_mbind +#define __IGNORE_get_mempolicy +#define __IGNORE_set_mempolicy +#define __IGNORE_migrate_pages +#define __IGNORE_move_pages +#define __IGNORE_getcpu + + +#endif /* _UAPI__ASM_BFIN_UNISTD_H */ diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c index 9b80b152435..b882ce22c34 100644 --- a/arch/blackfin/kernel/kgdb.c +++ b/arch/blackfin/kernel/kgdb.c @@ -329,6 +329,9 @@ static void bfin_disable_hw_debug(struct pt_regs *regs)  }  #ifdef CONFIG_SMP +extern void generic_exec_single(int cpu, struct call_single_data *data, int wait); +static struct call_single_data kgdb_smp_ipi_data[NR_CPUS]; +  void kgdb_passive_cpu_callback(void *info)  {  	kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs()); @@ -336,12 +339,18 @@ void kgdb_passive_cpu_callback(void *info)  void kgdb_roundup_cpus(unsigned long flags)  { -	smp_call_function(kgdb_passive_cpu_callback, NULL, 0); +	unsigned int cpu; + +	for (cpu = cpumask_first(cpu_online_mask); cpu < nr_cpu_ids; +		cpu = cpumask_next(cpu, cpu_online_mask)) { +		kgdb_smp_ipi_data[cpu].func = kgdb_passive_cpu_callback; +		generic_exec_single(cpu, &kgdb_smp_ipi_data[cpu], 0); +	}  }  void kgdb_roundup_cpu(int cpu, unsigned long flags)  { -	smp_call_function_single(cpu, kgdb_passive_cpu_callback, NULL, 0); +	generic_exec_single(cpu, &kgdb_smp_ipi_data[cpu], 0);  }  #endif diff --git a/arch/blackfin/mach-bf518/include/mach/anomaly.h b/arch/blackfin/mach-bf518/include/mach/anomaly.h index 845e6bc8d63..46cb88231d6 100644 --- a/arch/blackfin/mach-bf518/include/mach/anomaly.h +++ b/arch/blackfin/mach-bf518/include/mach/anomaly.h @@ -165,5 +165,6 @@  #define ANOMALY_05000474 (0)  #define ANOMALY_05000475 (0)  #define ANOMALY_05000480 (0) +#define ANOMALY_16000030 (0)  #endif diff --git a/arch/blackfin/mach-bf527/include/mach/anomaly.h b/arch/blackfin/mach-bf527/include/mach/anomaly.h index aa14110be4c..2f9cc33deec 100644 --- a/arch/blackfin/mach-bf527/include/mach/anomaly.h +++ b/arch/blackfin/mach-bf527/include/mach/anomaly.h @@ -285,5 +285,6 @@  #define ANOMALY_05000448 (0)  #define ANOMALY_05000474 (0)  #define ANOMALY_05000480 (0) +#define ANOMALY_16000030 (0)  #endif diff --git a/arch/blackfin/mach-bf533/include/mach/anomaly.h b/arch/blackfin/mach-bf533/include/mach/anomaly.h index 3a8f73a669f..0e754efc3cf 100644 --- a/arch/blackfin/mach-bf533/include/mach/anomaly.h +++ b/arch/blackfin/mach-bf533/include/mach/anomaly.h @@ -378,5 +378,6 @@  #define ANOMALY_05000474 (0)  #define ANOMALY_05000480 (0)  #define ANOMALY_05000485 (0) +#define ANOMALY_16000030 (0)  #endif diff --git a/arch/blackfin/mach-bf537/include/mach/anomaly.h b/arch/blackfin/mach-bf537/include/mach/anomaly.h index df921269639..2bc70c5b941 100644 --- a/arch/blackfin/mach-bf537/include/mach/anomaly.h +++ b/arch/blackfin/mach-bf537/include/mach/anomaly.h @@ -236,5 +236,6 @@  #define ANOMALY_05000467 (0)  #define ANOMALY_05000474 (0)  #define ANOMALY_05000485 (0) +#define ANOMALY_16000030 (0)  #endif diff --git a/arch/blackfin/mach-bf538/include/mach/anomaly.h b/arch/blackfin/mach-bf538/include/mach/anomaly.h index 318d922d11d..eaac26973f6 100644 --- a/arch/blackfin/mach-bf538/include/mach/anomaly.h +++ b/arch/blackfin/mach-bf538/include/mach/anomaly.h @@ -210,5 +210,6 @@  #define ANOMALY_05000474 (0)  #define ANOMALY_05000480 (0)  #define ANOMALY_05000485 (0) +#define ANOMALY_16000030 (0)  #endif diff --git a/arch/blackfin/mach-bf548/include/mach/anomaly.h b/arch/blackfin/mach-bf548/include/mach/anomaly.h index 5b711d85b90..098fad63e03 100644 --- a/arch/blackfin/mach-bf548/include/mach/anomaly.h +++ b/arch/blackfin/mach-bf548/include/mach/anomaly.h @@ -296,5 +296,6 @@  #define ANOMALY_05000440 (0)  #define ANOMALY_05000475 (0)  #define ANOMALY_05000480 (0) +#define ANOMALY_16000030 (0)  #endif diff --git a/arch/blackfin/mach-bf561/include/mach/anomaly.h b/arch/blackfin/mach-bf561/include/mach/anomaly.h index 72476ff5033..038249c1d0d 100644 --- a/arch/blackfin/mach-bf561/include/mach/anomaly.h +++ b/arch/blackfin/mach-bf561/include/mach/anomaly.h @@ -348,5 +348,6 @@  #define ANOMALY_05000474 (0)  #define ANOMALY_05000480 (0)  #define ANOMALY_05000485 (0) +#define ANOMALY_16000030 (0)  #endif diff --git a/arch/blackfin/mach-bf609/include/mach/irq.h b/arch/blackfin/mach-bf609/include/mach/irq.h index 23e74cdeeee..fa0843d5d77 100644 --- a/arch/blackfin/mach-bf609/include/mach/irq.h +++ b/arch/blackfin/mach-bf609/include/mach/irq.h @@ -9,9 +9,6 @@  #include <mach-common/irq.h> -#undef BFIN_IRQ -#define BFIN_IRQ(x) ((x) + IVG15) -  #define NR_PERI_INTS		(5 * 32)  #define IRQ_SEC_ERR		BFIN_IRQ(0)	/* SEC Error */ diff --git a/arch/blackfin/mach-bf609/pm.c b/arch/blackfin/mach-bf609/pm.c index dacafc163f7..ad505d9db4a 100644 --- a/arch/blackfin/mach-bf609/pm.c +++ b/arch/blackfin/mach-bf609/pm.c @@ -174,7 +174,6 @@ void bfin_hibernate_syscontrol(void)  	bfin_write32(DPM0_RESTORE5, bfin_read32(DPM0_RESTORE5) | 4);  } -#define IRQ_SID(irq)   ((irq) - IVG15)  asmlinkage void enter_deepsleep(void);  __attribute__((l1_text)) @@ -311,7 +310,7 @@ static irqreturn_t test_isr(int irq, void *dev_id)  {  	printk(KERN_DEBUG "gpio irq %d\n", irq);  	if (irq == 231) -		bfin_sec_raise_irq(IRQ_SID(IRQ_SOFT1)); +		bfin_sec_raise_irq(BFIN_SYSIRQ(IRQ_SOFT1));  	return IRQ_HANDLED;  } diff --git a/arch/blackfin/mach-common/dpmc.c b/arch/blackfin/mach-common/dpmc.c index f5685a496c5..724a8c5f557 100644 --- a/arch/blackfin/mach-common/dpmc.c +++ b/arch/blackfin/mach-common/dpmc.c @@ -129,7 +129,7 @@ static struct notifier_block vreg_cpufreq_notifier_block = {   *	bfin_dpmc_probe -   *   */ -static int __devinit bfin_dpmc_probe(struct platform_device *pdev) +static int bfin_dpmc_probe(struct platform_device *pdev)  {  	if (pdev->dev.platform_data)  		pdata = pdev->dev.platform_data; @@ -143,7 +143,7 @@ static int __devinit bfin_dpmc_probe(struct platform_device *pdev)  /**   *	bfin_dpmc_remove -   */ -static int __devexit bfin_dpmc_remove(struct platform_device *pdev) +static int bfin_dpmc_remove(struct platform_device *pdev)  {  	pdata = NULL;  	return cpufreq_unregister_notifier(&vreg_cpufreq_notifier_block, @@ -152,29 +152,12 @@ static int __devexit bfin_dpmc_remove(struct platform_device *pdev)  struct platform_driver bfin_dpmc_device_driver = {  	.probe   = bfin_dpmc_probe, -	.remove  = __devexit_p(bfin_dpmc_remove), +	.remove  = bfin_dpmc_remove,  	.driver  = {  		.name = DRIVER_NAME,  	}  }; - -/** - *	bfin_dpmc_init - Init driver - */ -static int __init bfin_dpmc_init(void) -{ -	return platform_driver_register(&bfin_dpmc_device_driver); -} -module_init(bfin_dpmc_init); - -/** - *	bfin_dpmc_exit - break down driver - */ -static void __exit bfin_dpmc_exit(void) -{ -	platform_driver_unregister(&bfin_dpmc_device_driver); -} -module_exit(bfin_dpmc_exit); +module_platform_driver(bfin_dpmc_device_driver);  MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");  MODULE_DESCRIPTION("cpu power management driver for Blackfin"); diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c index 902bebc434c..83ff311fd6e 100644 --- a/arch/blackfin/mach-common/ints-priority.c +++ b/arch/blackfin/mach-common/ints-priority.c @@ -28,12 +28,6 @@  #include <asm/dpmc.h>  #include <asm/traps.h> -#ifndef SEC_GCTL -# define SIC_SYSIRQ(irq)	(irq - (IRQ_CORETMR + 1)) -#else -# define SIC_SYSIRQ(irq)	((irq) - IVG15) -#endif -  /*   * NOTES:   * - we have separated the physical Hardware interrupt from the @@ -141,13 +135,13 @@ static void bfin_core_unmask_irq(struct irq_data *d)  	return;  } +#ifndef SEC_GCTL  void bfin_internal_mask_irq(unsigned int irq)  {  	unsigned long flags = hard_local_irq_save(); -#ifndef SEC_GCTL  #ifdef SIC_IMASK0 -	unsigned mask_bank = SIC_SYSIRQ(irq) / 32; -	unsigned mask_bit = SIC_SYSIRQ(irq) % 32; +	unsigned mask_bank = BFIN_SYSIRQ(irq) / 32; +	unsigned mask_bit = BFIN_SYSIRQ(irq) % 32;  	bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) &  			~(1 << mask_bit));  # if defined(CONFIG_SMP) || defined(CONFIG_ICC) @@ -156,9 +150,8 @@ void bfin_internal_mask_irq(unsigned int irq)  # endif  #else  	bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() & -			~(1 << SIC_SYSIRQ(irq))); +			~(1 << BFIN_SYSIRQ(irq)));  #endif /* end of SIC_IMASK0 */ -#endif  	hard_local_irq_restore(flags);  } @@ -176,10 +169,9 @@ void bfin_internal_unmask_irq(unsigned int irq)  {  	unsigned long flags = hard_local_irq_save(); -#ifndef SEC_GCTL  #ifdef SIC_IMASK0 -	unsigned mask_bank = SIC_SYSIRQ(irq) / 32; -	unsigned mask_bit = SIC_SYSIRQ(irq) % 32; +	unsigned mask_bank = BFIN_SYSIRQ(irq) / 32; +	unsigned mask_bit = BFIN_SYSIRQ(irq) % 32;  # ifdef CONFIG_SMP  	if (cpumask_test_cpu(0, affinity))  # endif @@ -194,17 +186,103 @@ void bfin_internal_unmask_irq(unsigned int irq)  # endif  #else  	bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() | -			(1 << SIC_SYSIRQ(irq))); +			(1 << BFIN_SYSIRQ(irq))); +#endif +	hard_local_irq_restore(flags); +} + +#ifdef CONFIG_SMP +static void bfin_internal_unmask_irq_chip(struct irq_data *d) +{ +	bfin_internal_unmask_irq_affinity(d->irq, d->affinity); +} + +static int bfin_internal_set_affinity(struct irq_data *d, +				      const struct cpumask *mask, bool force) +{ +	bfin_internal_mask_irq(d->irq); +	bfin_internal_unmask_irq_affinity(d->irq, mask); + +	return 0; +} +#else +static void bfin_internal_unmask_irq_chip(struct irq_data *d) +{ +	bfin_internal_unmask_irq(d->irq); +}  #endif + +#if defined(CONFIG_PM) +int bfin_internal_set_wake(unsigned int irq, unsigned int state) +{ +	u32 bank, bit, wakeup = 0; +	unsigned long flags; +	bank = BFIN_SYSIRQ(irq) / 32; +	bit = BFIN_SYSIRQ(irq) % 32; + +	switch (irq) { +#ifdef IRQ_RTC +	case IRQ_RTC: +	wakeup |= WAKE; +	break; +#endif +#ifdef IRQ_CAN0_RX +	case IRQ_CAN0_RX: +	wakeup |= CANWE; +	break;  #endif +#ifdef IRQ_CAN1_RX +	case IRQ_CAN1_RX: +	wakeup |= CANWE; +	break; +#endif +#ifdef IRQ_USB_INT0 +	case IRQ_USB_INT0: +	wakeup |= USBWE; +	break; +#endif +#ifdef CONFIG_BF54x +	case IRQ_CNT: +	wakeup |= ROTWE; +	break; +#endif +	default: +	break; +	} + +	flags = hard_local_irq_save(); + +	if (state) { +		bfin_sic_iwr[bank] |= (1 << bit); +		vr_wakeup  |= wakeup; + +	} else { +		bfin_sic_iwr[bank] &= ~(1 << bit); +		vr_wakeup  &= ~wakeup; +	} +  	hard_local_irq_restore(flags); + +	return 0;  } -#ifdef SEC_GCTL +static int bfin_internal_set_wake_chip(struct irq_data *d, unsigned int state) +{ +	return bfin_internal_set_wake(d->irq, state); +} +#else +inline int bfin_internal_set_wake(unsigned int irq, unsigned int state) +{ +	return 0; +} +# define bfin_internal_set_wake_chip NULL +#endif + +#else /* SEC_GCTL */  static void bfin_sec_preflow_handler(struct irq_data *d)  {  	unsigned long flags = hard_local_irq_save(); -	unsigned int sid = SIC_SYSIRQ(d->irq); +	unsigned int sid = BFIN_SYSIRQ(d->irq);  	bfin_write_SEC_SCI(0, SEC_CSID, sid); @@ -214,7 +292,7 @@ static void bfin_sec_preflow_handler(struct irq_data *d)  static void bfin_sec_mask_ack_irq(struct irq_data *d)  {  	unsigned long flags = hard_local_irq_save(); -	unsigned int sid = SIC_SYSIRQ(d->irq); +	unsigned int sid = BFIN_SYSIRQ(d->irq);  	bfin_write_SEC_SCI(0, SEC_CSID, sid); @@ -224,7 +302,7 @@ static void bfin_sec_mask_ack_irq(struct irq_data *d)  static void bfin_sec_unmask_irq(struct irq_data *d)  {  	unsigned long flags = hard_local_irq_save(); -	unsigned int sid = SIC_SYSIRQ(d->irq); +	unsigned int sid = BFIN_SYSIRQ(d->irq);  	bfin_write32(SEC_END, sid); @@ -269,7 +347,7 @@ static void bfin_sec_enable_sci(unsigned int sid)  	unsigned long flags = hard_local_irq_save();  	uint32_t reg_sctl = bfin_read_SEC_SCTL(sid); -	if (sid == SIC_SYSIRQ(IRQ_WATCH0)) +	if (sid == BFIN_SYSIRQ(IRQ_WATCH0))  		reg_sctl |= SEC_SCTL_FAULT_EN;  	else  		reg_sctl |= SEC_SCTL_INT_EN; @@ -292,7 +370,7 @@ static void bfin_sec_disable_sci(unsigned int sid)  static void bfin_sec_enable(struct irq_data *d)  {  	unsigned long flags = hard_local_irq_save(); -	unsigned int sid = SIC_SYSIRQ(d->irq); +	unsigned int sid = BFIN_SYSIRQ(d->irq);  	bfin_sec_enable_sci(sid);  	bfin_sec_enable_ssi(sid); @@ -303,7 +381,7 @@ static void bfin_sec_enable(struct irq_data *d)  static void bfin_sec_disable(struct irq_data *d)  {  	unsigned long flags = hard_local_irq_save(); -	unsigned int sid = SIC_SYSIRQ(d->irq); +	unsigned int sid = BFIN_SYSIRQ(d->irq);  	bfin_sec_disable_sci(sid);  	bfin_sec_disable_ssi(sid); @@ -328,9 +406,10 @@ static void bfin_sec_set_priority(unsigned int sec_int_levels, u8 *sec_int_prior  	hard_local_irq_restore(flags);  } -void bfin_sec_raise_irq(unsigned int sid) +void bfin_sec_raise_irq(unsigned int irq)  {  	unsigned long flags = hard_local_irq_save(); +	unsigned int sid = BFIN_SYSIRQ(irq);  	bfin_write32(SEC_RAISE, sid); @@ -341,8 +420,13 @@ static void init_software_driven_irq(void)  {  	bfin_sec_set_ssi_coreid(34, 0);  	bfin_sec_set_ssi_coreid(35, 1); + +	bfin_sec_enable_sci(35); +	bfin_sec_enable_ssi(35);  	bfin_sec_set_ssi_coreid(36, 0);  	bfin_sec_set_ssi_coreid(37, 1); +	bfin_sec_enable_sci(37); +	bfin_sec_enable_ssi(37);  }  void bfin_sec_resume(void) @@ -412,6 +496,8 @@ void handle_sec_fault(unsigned int irq, struct irq_desc *desc)  	}  	raw_spin_unlock(&desc->lock); + +	handle_fasteoi_irq(irq, desc);  }  void handle_core_fault(unsigned int irq, struct irq_desc *desc) @@ -431,105 +517,18 @@ void handle_core_fault(unsigned int irq, struct irq_desc *desc)  		printk(KERN_NOTICE "Kernel Stack\n");  		show_stack(current, NULL);  		print_modules(); -		panic("Kernel core hardware error"); +		panic("Core 0 hardware error");  		break;  	case IRQ_C0_NMI_L1_PARITY_ERR: -		panic("NMI occurs unexpectedly"); +		panic("Core 0 NMI L1 parity error");  		break;  	default: -		panic("Core 1 fault occurs unexpectedly"); +		panic("Core 1 fault %d occurs unexpectedly", irq);  	}  	raw_spin_unlock(&desc->lock);  } -#endif - -#ifdef CONFIG_SMP -static void bfin_internal_unmask_irq_chip(struct irq_data *d) -{ -	bfin_internal_unmask_irq_affinity(d->irq, d->affinity); -} - -static int bfin_internal_set_affinity(struct irq_data *d, -				      const struct cpumask *mask, bool force) -{ -	bfin_internal_mask_irq(d->irq); -	bfin_internal_unmask_irq_affinity(d->irq, mask); - -	return 0; -} -#else -static void bfin_internal_unmask_irq_chip(struct irq_data *d) -{ -	bfin_internal_unmask_irq(d->irq); -} -#endif - -#if defined(CONFIG_PM) && !defined(SEC_GCTL) -int bfin_internal_set_wake(unsigned int irq, unsigned int state) -{ -	u32 bank, bit, wakeup = 0; -	unsigned long flags; -	bank = SIC_SYSIRQ(irq) / 32; -	bit = SIC_SYSIRQ(irq) % 32; - -	switch (irq) { -#ifdef IRQ_RTC -	case IRQ_RTC: -	wakeup |= WAKE; -	break; -#endif -#ifdef IRQ_CAN0_RX -	case IRQ_CAN0_RX: -	wakeup |= CANWE; -	break; -#endif -#ifdef IRQ_CAN1_RX -	case IRQ_CAN1_RX: -	wakeup |= CANWE; -	break; -#endif -#ifdef IRQ_USB_INT0 -	case IRQ_USB_INT0: -	wakeup |= USBWE; -	break; -#endif -#ifdef CONFIG_BF54x -	case IRQ_CNT: -	wakeup |= ROTWE; -	break; -#endif -	default: -	break; -	} - -	flags = hard_local_irq_save(); - -	if (state) { -		bfin_sic_iwr[bank] |= (1 << bit); -		vr_wakeup  |= wakeup; - -	} else { -		bfin_sic_iwr[bank] &= ~(1 << bit); -		vr_wakeup  &= ~wakeup; -	} - -	hard_local_irq_restore(flags); - -	return 0; -} - -static int bfin_internal_set_wake_chip(struct irq_data *d, unsigned int state) -{ -	return bfin_internal_set_wake(d->irq, state); -} -#else -inline int bfin_internal_set_wake(unsigned int irq, unsigned int state) -{ -	return 0; -} -# define bfin_internal_set_wake_chip NULL -#endif +#endif /* SEC_GCTL */  static struct irq_chip bfin_core_irqchip = {  	.name = "CORE", @@ -537,6 +536,7 @@ static struct irq_chip bfin_core_irqchip = {  	.irq_unmask = bfin_core_unmask_irq,  }; +#ifndef SEC_GCTL  static struct irq_chip bfin_internal_irqchip = {  	.name = "INTN",  	.irq_mask = bfin_internal_mask_irq_chip, @@ -548,8 +548,7 @@ static struct irq_chip bfin_internal_irqchip = {  #endif  	.irq_set_wake = bfin_internal_set_wake_chip,  }; - -#ifdef SEC_GCTL +#else  static struct irq_chip bfin_sec_irqchip = {  	.name = "SEC",  	.irq_mask_ack = bfin_sec_mask_ack_irq, @@ -1138,7 +1137,9 @@ static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state)  		return -EINVAL;  	} +#ifndef SEC_GCTL  	bfin_internal_set_wake(pint_irq, state); +#endif  	return 0;  } @@ -1173,7 +1174,7 @@ static int sec_suspend(void)  	u32 bank;  	for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) -		save_pint_sec_ctl[bank] = bfin_read_SEC_SCTL(bank + SIC_SYSIRQ(IRQ_PINT0)); +		save_pint_sec_ctl[bank] = bfin_read_SEC_SCTL(bank + BFIN_SYSIRQ(IRQ_PINT0));  	return 0;  } @@ -1187,7 +1188,7 @@ static void sec_resume(void)  	bfin_write_SEC_SCI(0, SEC_CCTL, SEC_CCTL_EN | SEC_CCTL_NMI_EN);  	for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) -		bfin_write_SEC_SCTL(bank + SIC_SYSIRQ(IRQ_PINT0), save_pint_sec_ctl[bank]); +		bfin_write_SEC_SCTL(bank + BFIN_SYSIRQ(IRQ_PINT0), save_pint_sec_ctl[bank]);  }  static struct syscore_ops sec_pm_syscore_ops = { @@ -1538,33 +1539,26 @@ int __init init_arch_irq(void)  	for (irq = 0; irq <= SYS_IRQS; irq++) {  		if (irq <= IRQ_CORETMR) { -			irq_set_chip(irq, &bfin_core_irqchip); -#ifdef CONFIG_TICKSOURCE_CORETMR +			irq_set_chip_and_handler(irq, &bfin_core_irqchip, +				handle_simple_irq); +#if defined(CONFIG_TICKSOURCE_CORETMR) && defined(CONFIG_SMP)  			if (irq == IRQ_CORETMR) -# ifdef CONFIG_SMP  				irq_set_handler(irq, handle_percpu_irq); -# else -				irq_set_handler(irq, handle_simple_irq); -# endif  #endif -		} else if (irq < BFIN_IRQ(0)) { -			irq_set_chip_and_handler(irq, &bfin_internal_irqchip, -					handle_simple_irq); -		} else if (irq == IRQ_SEC_ERR) { -			irq_set_chip_and_handler(irq, &bfin_sec_irqchip, -					handle_sec_fault); -		} else if (irq < CORE_IRQS && irq >= IRQ_C0_DBL_FAULT) { -			irq_set_chip_and_handler(irq, &bfin_sec_irqchip, -					handle_core_fault);  		} else if (irq >= BFIN_IRQ(21) && irq <= BFIN_IRQ(26)) {  			irq_set_chip(irq, &bfin_sec_irqchip);  			irq_set_chained_handler(irq, bfin_demux_gpio_irq);  		} else if (irq >= BFIN_IRQ(34) && irq <= BFIN_IRQ(37)) { -			irq_set_chip(irq, &bfin_sec_irqchip); -			irq_set_handler(irq, handle_percpu_irq); -		} else {  			irq_set_chip_and_handler(irq, &bfin_sec_irqchip, -					handle_fasteoi_irq); +				handle_percpu_irq); +		} else { +			irq_set_chip(irq, &bfin_sec_irqchip); +			if (irq == IRQ_SEC_ERR) +				irq_set_handler(irq, handle_sec_fault); +			else if (irq >= IRQ_C0_DBL_FAULT && irq < CORE_IRQS) +				irq_set_handler(irq, handle_core_fault); +			else +				irq_set_handler(irq, handle_fasteoi_irq);  			__irq_set_preflow_handler(irq, bfin_sec_preflow_handler);  		}  	} @@ -1593,8 +1587,8 @@ int __init init_arch_irq(void)  	bfin_write_SEC_FCTL(SEC_FCTL_EN | SEC_FCTL_SYSRST_EN | SEC_FCTL_FLTIN_EN); -	bfin_sec_enable_sci(SIC_SYSIRQ(IRQ_WATCH0)); -	bfin_sec_enable_ssi(SIC_SYSIRQ(IRQ_WATCH0)); +	bfin_sec_enable_sci(BFIN_SYSIRQ(IRQ_WATCH0)); +	bfin_sec_enable_ssi(BFIN_SYSIRQ(IRQ_WATCH0));  	bfin_write_SEC_SCI(0, SEC_CCTL, SEC_CCTL_RESET);  	udelay(100);  	bfin_write_SEC_GCTL(SEC_GCTL_EN); diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig index 66eab3703c7..f6a3648f5ec 100644 --- a/arch/c6x/Kconfig +++ b/arch/c6x/Kconfig @@ -17,8 +17,6 @@ config C6X  	select OF  	select OF_EARLY_FLATTREE  	select GENERIC_CLOCKEVENTS -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	select MODULES_USE_ELF_RELA  config MMU diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild index eae7b5963e8..4258b088aa9 100644 --- a/arch/c6x/include/asm/Kbuild +++ b/arch/c6x/include/asm/Kbuild @@ -25,6 +25,7 @@ generic-y += kdebug.h  generic-y += kmap_types.h  generic-y += local.h  generic-y += mman.h +generic-y += mmu.h  generic-y += mmu_context.h  generic-y += msgbuf.h  generic-y += param.h diff --git a/arch/c6x/include/asm/dma-mapping.h b/arch/c6x/include/asm/dma-mapping.h index 03579fd99db..3c694065030 100644 --- a/arch/c6x/include/asm/dma-mapping.h +++ b/arch/c6x/include/asm/dma-mapping.h @@ -32,6 +32,7 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)   */  static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)  { +	debug_dma_mapping_error(dev, dma_addr);  	return dma_addr == ~0;  } diff --git a/arch/c6x/include/asm/mmu.h b/arch/c6x/include/asm/mmu.h deleted file mode 100644 index 4467e770a1c..00000000000 --- a/arch/c6x/include/asm/mmu.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - *  Port on Texas Instruments TMS320C6x architecture - * - *  Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated - *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com) - * - *  This program is free software; you can redistribute it and/or modify - *  it under the terms of the GNU General Public License version 2 as - *  published by the Free Software Foundation. - */ -#ifndef _ASM_C6X_MMU_H -#define _ASM_C6X_MMU_H - -typedef struct { -	unsigned long		end_brk; -#ifdef CONFIG_BINFMT_ELF_FDPIC -	unsigned long	exec_fdpic_loadmap; -	unsigned long	interp_fdpic_loadmap; -#endif -} mm_context_t; - -#endif /* _ASM_C6X_MMU_H */ diff --git a/arch/c6x/include/uapi/asm/unistd.h b/arch/c6x/include/uapi/asm/unistd.h index f3987a8703d..e7d09a614d1 100644 --- a/arch/c6x/include/uapi/asm/unistd.h +++ b/arch/c6x/include/uapi/asm/unistd.h @@ -14,7 +14,6 @@   *   more details.   */ -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_CLONE  /* Use the standard ABI for syscalls. */ diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 0cac6a49f23..c59a01dd9c0 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig @@ -49,8 +49,6 @@ config CRIS  	select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32  	select GENERIC_CMOS_UPDATE  	select MODULES_USE_ELF_RELA -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	select CLONE_BACKWARDS2  config HZ diff --git a/arch/cris/arch-v32/drivers/pci/bios.c b/arch/cris/arch-v32/drivers/pci/bios.c index e3dfc72d0cf..64a5fb93767 100644 --- a/arch/cris/arch-v32/drivers/pci/bios.c +++ b/arch/cris/arch-v32/drivers/pci/bios.c @@ -2,7 +2,7 @@  #include <linux/kernel.h>  #include <arch/hwregs/intr_vect.h> -void __devinit  pcibios_fixup_bus(struct pci_bus *b) +void pcibios_fixup_bus(struct pci_bus *b)  {  } diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c index ebe2cb30bd1..04a16edd540 100644 --- a/arch/cris/arch-v32/kernel/smp.c +++ b/arch/cris/arch-v32/kernel/smp.c @@ -84,7 +84,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)  		cpumask_set_cpu(i, &phys_cpu_present_map);  } -void __devinit smp_prepare_boot_cpu(void) +void smp_prepare_boot_cpu(void)  {  	/* PGD pointer has moved after per_cpu initialization so  	 * update the MMU. diff --git a/arch/cris/include/arch-v10/arch/Kbuild b/arch/cris/include/arch-v10/arch/Kbuild index 7a192e1290b..1f0fc7a66f5 100644 --- a/arch/cris/include/arch-v10/arch/Kbuild +++ b/arch/cris/include/arch-v10/arch/Kbuild @@ -1,4 +1 @@ -header-y += user.h -header-y += svinto.h -header-y += sv_addr_ag.h -header-y += sv_addr.agh +# CRISv10 arch diff --git a/arch/cris/include/arch-v32/arch/Kbuild b/arch/cris/include/arch-v32/arch/Kbuild index 35f2fc4f993..2fd65c7e15c 100644 --- a/arch/cris/include/arch-v32/arch/Kbuild +++ b/arch/cris/include/arch-v32/arch/Kbuild @@ -1,2 +1 @@ -header-y += user.h -header-y += cryptocop.h +# CRISv32 arch diff --git a/arch/cris/include/arch-v32/arch/cryptocop.h b/arch/cris/include/arch-v32/arch/cryptocop.h index e1cd83dfabb..716e434e926 100644 --- a/arch/cris/include/arch-v32/arch/cryptocop.h +++ b/arch/cris/include/arch-v32/arch/cryptocop.h @@ -2,123 +2,11 @@   * The device /dev/cryptocop is accessible using this driver using   * CRYPTOCOP_MAJOR (254) and minor number 0.   */ -  #ifndef CRYPTOCOP_H  #define CRYPTOCOP_H -#include <linux/uio.h> - - -#define CRYPTOCOP_SESSION_ID_NONE (0) - -typedef unsigned long long int cryptocop_session_id; - -/* cryptocop ioctls */ -#define ETRAXCRYPTOCOP_IOCTYPE         (250) - -#define CRYPTOCOP_IO_CREATE_SESSION    _IOWR(ETRAXCRYPTOCOP_IOCTYPE, 1, struct strcop_session_op) -#define CRYPTOCOP_IO_CLOSE_SESSION     _IOW(ETRAXCRYPTOCOP_IOCTYPE, 2, struct strcop_session_op) -#define CRYPTOCOP_IO_PROCESS_OP        _IOWR(ETRAXCRYPTOCOP_IOCTYPE, 3, struct strcop_crypto_op) -#define CRYPTOCOP_IO_MAXNR             (3) - -typedef enum { -	cryptocop_cipher_des = 0, -	cryptocop_cipher_3des = 1, -	cryptocop_cipher_aes = 2, -	cryptocop_cipher_m2m = 3, /* mem2mem is essentially a NULL cipher with blocklength=1 */ -	cryptocop_cipher_none -} cryptocop_cipher_type; - -typedef enum { -	cryptocop_digest_sha1 = 0, -	cryptocop_digest_md5 = 1, -	cryptocop_digest_none -} cryptocop_digest_type; - -typedef enum { -	cryptocop_csum_le = 0, -	cryptocop_csum_be = 1, -	cryptocop_csum_none -} cryptocop_csum_type; - -typedef enum { -	cryptocop_cipher_mode_ecb = 0, -	cryptocop_cipher_mode_cbc, -	cryptocop_cipher_mode_none -} cryptocop_cipher_mode; - -typedef enum { -	cryptocop_3des_eee = 0, -	cryptocop_3des_eed = 1, -	cryptocop_3des_ede = 2, -	cryptocop_3des_edd = 3, -	cryptocop_3des_dee = 4, -	cryptocop_3des_ded = 5, -	cryptocop_3des_dde = 6, -	cryptocop_3des_ddd = 7 -} cryptocop_3des_mode; - -/* Usermode accessible (ioctl) operations. */ -struct strcop_session_op{ -	cryptocop_session_id    ses_id; +#include <uapi/arch-v32/arch/cryptocop.h> -	cryptocop_cipher_type   cipher; /* AES, DES, 3DES, m2m, none */ - -	cryptocop_cipher_mode   cmode; /* ECB, CBC, none */ -	cryptocop_3des_mode     des3_mode; - -	cryptocop_digest_type   digest; /* MD5, SHA1, none */ - -	cryptocop_csum_type     csum;   /* BE, LE, none */ - -	unsigned char           *key; -	size_t                  keylen; -}; - -#define CRYPTOCOP_CSUM_LENGTH         (2) -#define CRYPTOCOP_MAX_DIGEST_LENGTH   (20)  /* SHA-1 20, MD5 16 */ -#define CRYPTOCOP_MAX_IV_LENGTH       (16)  /* (3)DES==8, AES == 16 */ -#define CRYPTOCOP_MAX_KEY_LENGTH      (32) - -struct strcop_crypto_op{ -	cryptocop_session_id ses_id; - -	/* Indata. */ -	unsigned char            *indata; -	size_t                   inlen; /* Total indata length. */ - -	/* Cipher configuration. */ -	unsigned char            do_cipher:1; -	unsigned char            decrypt:1; /* 1 == decrypt, 0 == encrypt */ -	unsigned char            cipher_explicit:1; -	size_t                   cipher_start; -	size_t                   cipher_len; -	/* cipher_iv is used if do_cipher and cipher_explicit and the cipher -	   mode is CBC.  The length is controlled by the type of cipher, -	   e.g. DES/3DES 8 octets and AES 16 octets. */ -	unsigned char            cipher_iv[CRYPTOCOP_MAX_IV_LENGTH]; -	/* Outdata. */ -	unsigned char            *cipher_outdata; -	size_t                   cipher_outlen; - -	/* digest configuration. */ -	unsigned char            do_digest:1; -	size_t                   digest_start; -	size_t                   digest_len; -	/* Outdata.  The actual length is determined by the type of the digest. */ -	unsigned char            digest[CRYPTOCOP_MAX_DIGEST_LENGTH]; - -	/* Checksum configuration. */ -	unsigned char            do_csum:1; -	size_t                   csum_start; -	size_t                   csum_len; -	/* Outdata. */ -	unsigned char            csum[CRYPTOCOP_CSUM_LENGTH]; -}; - - - -#ifdef __KERNEL__  /********** The API to use from inside the kernel. ************/ @@ -267,6 +155,4 @@ int cryptocop_job_queue_insert_crypto(struct cryptocop_operation *operation);  int cryptocop_job_queue_insert_user_job(struct cryptocop_operation *operation); -#endif /* __KERNEL__ */ -  #endif /* CRYPTOCOP_H */ diff --git a/arch/cris/include/arch-v32/arch/spinlock.h b/arch/cris/include/arch-v32/arch/spinlock.h index f171a6600fb..f13275522f4 100644 --- a/arch/cris/include/arch-v32/arch/spinlock.h +++ b/arch/cris/include/arch-v32/arch/spinlock.h @@ -118,7 +118,7 @@ static  inline int arch_write_trylock(arch_rwlock_t *rw)  		ret = 1;  	}  	arch_spin_unlock(&rw->slock); -	return 1; +	return ret;  }  #define _raw_read_lock_flags(lock, flags) _raw_read_lock(lock) diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild index 15a122c3767..f1e79edc9dd 100644 --- a/arch/cris/include/asm/Kbuild +++ b/arch/cris/include/asm/Kbuild @@ -1,12 +1,7 @@ -include include/asm-generic/Kbuild.asm  header-y += arch-v10/  header-y += arch-v32/ -header-y += ethernet.h -header-y += etraxgpio.h -header-y += rs485.h -header-y += sync_serial.h  generic-y += clkdev.h  generic-y += exec.h diff --git a/arch/cris/include/asm/io.h b/arch/cris/include/asm/io.h index 32567bc2a42..ac12ae2b928 100644 --- a/arch/cris/include/asm/io.h +++ b/arch/cris/include/asm/io.h @@ -133,12 +133,39 @@ static inline void writel(unsigned int b, volatile void __iomem *addr)  #define insb(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,1,count) : 0)  #define insw(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,2,count) : 0)  #define insl(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,4,count) : 0) -#define outb(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,1,1) -#define outw(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,2,1) -#define outl(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,4,1) -#define outsb(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,1,count) -#define outsw(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,2,count) -#define outsl(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,3,count) +static inline void outb(unsigned char data, unsigned int port) +{ +	if (cris_iops) +		cris_iops->write_io(port, (void *) &data, 1, 1); +} +static inline void outw(unsigned short data, unsigned int port) +{ +	if (cris_iops) +		cris_iops->write_io(port, (void *) &data, 2, 1); +} +static inline void outl(unsigned int data, unsigned int port) +{ +	if (cris_iops) +		cris_iops->write_io(port, (void *) &data, 4, 1); +} +static inline void outsb(unsigned int port, const void *addr, +			 unsigned long count) +{ +	if (cris_iops) +		cris_iops->write_io(port, (void *)addr, 1, count); +} +static inline void outsw(unsigned int port, const void *addr, +			 unsigned long count) +{ +	if (cris_iops) +		cris_iops->write_io(port, (void *)addr, 2, count); +} +static inline void outsl(unsigned int port, const void *addr, +			 unsigned long count) +{ +	if (cris_iops) +		cris_iops->write_io(port, (void *)addr, 4, count); +}  /*   * Convert a physical pointer to a virtual kernel pointer for /dev/mem diff --git a/arch/cris/include/asm/ptrace.h b/arch/cris/include/asm/ptrace.h index 6618893bfe8..9e788d04a4e 100644 --- a/arch/cris/include/asm/ptrace.h +++ b/arch/cris/include/asm/ptrace.h @@ -1,16 +1,14 @@  #ifndef _CRIS_PTRACE_H  #define _CRIS_PTRACE_H -#include <arch/ptrace.h> +#include <uapi/asm/ptrace.h> -#ifdef __KERNEL__  /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */  #define PTRACE_GETREGS            12  #define PTRACE_SETREGS            13  #define profile_pc(regs) instruction_pointer(regs) - -#endif /* __KERNEL__ */ +#define current_user_stack_pointer() rdusp()  #endif /* _CRIS_PTRACE_H */ diff --git a/arch/cris/include/asm/signal.h b/arch/cris/include/asm/signal.h index 72dbbf59dfa..c0cb1fd4644 100644 --- a/arch/cris/include/asm/signal.h +++ b/arch/cris/include/asm/signal.h @@ -1,12 +1,8 @@  #ifndef _ASM_CRIS_SIGNAL_H  #define _ASM_CRIS_SIGNAL_H -#include <linux/types.h> +#include <uapi/asm/signal.h> -/* Avoid too many header ordering problems.  */ -struct siginfo; - -#ifdef __KERNEL__  /* Most things should be clean enough to redefine this at will, if care     is taken to make libc match.  */ @@ -20,95 +16,6 @@ typedef struct {  	unsigned long sig[_NSIG_WORDS];  } sigset_t; -#else -/* Here we must cater to libcs that poke about in kernel headers.  */ - -#define NSIG		32 -typedef unsigned long sigset_t; - -#endif /* __KERNEL__ */ - -#define SIGHUP		 1 -#define SIGINT		 2 -#define SIGQUIT		 3 -#define SIGILL		 4 -#define SIGTRAP		 5 -#define SIGABRT		 6 -#define SIGIOT		 6 -#define SIGBUS		 7 -#define SIGFPE		 8 -#define SIGKILL		 9 -#define SIGUSR1		10 -#define SIGSEGV		11 -#define SIGUSR2		12 -#define SIGPIPE		13 -#define SIGALRM		14 -#define SIGTERM		15 -#define SIGSTKFLT	16 -#define SIGCHLD		17 -#define SIGCONT		18 -#define SIGSTOP		19 -#define SIGTSTP		20 -#define SIGTTIN		21 -#define SIGTTOU		22 -#define SIGURG		23 -#define SIGXCPU		24 -#define SIGXFSZ		25 -#define SIGVTALRM	26 -#define SIGPROF		27 -#define SIGWINCH	28 -#define SIGIO		29 -#define SIGPOLL		SIGIO -/* -#define SIGLOST		29 -*/ -#define SIGPWR		30 -#define SIGSYS          31 -#define	SIGUNUSED	31 - -/* These should not be considered constants from userland.  */ -#define SIGRTMIN        32 -#define SIGRTMAX        _NSIG - -/* - * SA_FLAGS values: - * - * SA_ONSTACK indicates that a registered stack_t will be used. - * SA_RESTART flag to get restarting signals (which were the default long ago) - * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. - * SA_RESETHAND clears the handler when the signal is delivered. - * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. - * SA_NODEFER prevents the current signal from being masked in the handler. - * - * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single - * Unix names RESETHAND and NODEFER respectively. - */ - -#define SA_NOCLDSTOP	0x00000001u -#define SA_NOCLDWAIT	0x00000002u -#define SA_SIGINFO	0x00000004u -#define SA_ONSTACK	0x08000000u -#define SA_RESTART	0x10000000u -#define SA_NODEFER	0x40000000u -#define SA_RESETHAND	0x80000000u - -#define SA_NOMASK	SA_NODEFER -#define SA_ONESHOT	SA_RESETHAND - -#define SA_RESTORER	0x04000000 - -/*  - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 - -#define MINSIGSTKSZ	2048 -#define SIGSTKSZ	8192 - -#include <asm-generic/signal-defs.h> - -#ifdef __KERNEL__  struct old_sigaction {  	__sighandler_t sa_handler;  	old_sigset_t sa_mask; @@ -126,32 +33,6 @@ struct sigaction {  struct k_sigaction {  	struct sigaction sa;  }; -#else -/* Here we must cater to libcs that poke about in kernel headers.  */ - -struct sigaction { -	union { -	  __sighandler_t _sa_handler; -	  void (*_sa_sigaction)(int, struct siginfo *, void *); -	} _u; -	sigset_t sa_mask; -	unsigned long sa_flags; -	void (*sa_restorer)(void); -}; - -#define sa_handler	_u._sa_handler -#define sa_sigaction	_u._sa_sigaction - -#endif /* __KERNEL__ */ - -typedef struct sigaltstack { -	void *ss_sp; -	int ss_flags; -	size_t ss_size; -} stack_t; - -#ifdef __KERNEL__  #include <asm/sigcontext.h> -#endif /* __KERNEL__ */  #endif diff --git a/arch/cris/include/asm/swab.h b/arch/cris/include/asm/swab.h index 80668e88419..991b6ace1ba 100644 --- a/arch/cris/include/asm/swab.h +++ b/arch/cris/include/asm/swab.h @@ -1,8 +1,7 @@  #ifndef _CRIS_SWAB_H  #define _CRIS_SWAB_H -#ifdef __KERNEL__  #include <arch/swab.h> -#endif /* __KERNEL__ */ +#include <uapi/asm/swab.h>  #endif /* _CRIS_SWAB_H */ diff --git a/arch/cris/include/asm/termios.h b/arch/cris/include/asm/termios.h index 1265109f4ce..1991cd9e408 100644 --- a/arch/cris/include/asm/termios.h +++ b/arch/cris/include/asm/termios.h @@ -1,47 +1,8 @@  #ifndef _CRIS_TERMIOS_H  #define _CRIS_TERMIOS_H -#include <asm/termbits.h> -#include <asm/ioctls.h> -#include <asm/rs485.h> -#include <linux/serial.h> +#include <uapi/asm/termios.h> -struct winsize { -	unsigned short ws_row; -	unsigned short ws_col; -	unsigned short ws_xpixel; -	unsigned short ws_ypixel; -}; - -#define NCC 8 -struct termio { -	unsigned short c_iflag;		/* input mode flags */ -	unsigned short c_oflag;		/* output mode flags */ -	unsigned short c_cflag;		/* control mode flags */ -	unsigned short c_lflag;		/* local mode flags */ -	unsigned char c_line;		/* line discipline */ -	unsigned char c_cc[NCC];	/* control characters */ -}; - -/* modem lines */ -#define TIOCM_LE	0x001 -#define TIOCM_DTR	0x002 -#define TIOCM_RTS	0x004 -#define TIOCM_ST	0x008 -#define TIOCM_SR	0x010 -#define TIOCM_CTS	0x020 -#define TIOCM_CAR	0x040 -#define TIOCM_RNG	0x080 -#define TIOCM_DSR	0x100 -#define TIOCM_CD	TIOCM_CAR -#define TIOCM_RI	TIOCM_RNG -#define TIOCM_OUT1	0x2000 -#define TIOCM_OUT2	0x4000 -#define TIOCM_LOOP	0x8000 - -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ - -#ifdef __KERNEL__  /*	intr=^C		quit=^\		erase=del	kill=^U  	eof=^D		vtime=\0	vmin=\1		sxtc=\0 @@ -87,6 +48,4 @@ struct termio {  #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))  #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) -#endif	/* __KERNEL__ */ -  #endif	/* _CRIS_TERMIOS_H */ diff --git a/arch/cris/include/asm/types.h b/arch/cris/include/asm/types.h index adaf82780bb..a3cac7757c7 100644 --- a/arch/cris/include/asm/types.h +++ b/arch/cris/include/asm/types.h @@ -1,15 +1,12 @@  #ifndef _ETRAX_TYPES_H  #define _ETRAX_TYPES_H -#include <asm-generic/int-ll64.h> +#include <uapi/asm/types.h>  /*   * These aren't exported outside the kernel to avoid name space clashes   */ -#ifdef __KERNEL__  #define BITS_PER_LONG 32 -#endif /* __KERNEL__ */ -  #endif diff --git a/arch/cris/include/asm/unistd.h b/arch/cris/include/asm/unistd.h index f27b542e0eb..6d062bdf92d 100644 --- a/arch/cris/include/asm/unistd.h +++ b/arch/cris/include/asm/unistd.h @@ -1,347 +1,8 @@  #ifndef _ASM_CRIS_UNISTD_H_  #define _ASM_CRIS_UNISTD_H_ -/* - * This file contains the system call numbers, and stub macros for libc. - */ - -#define __NR_restart_syscall      0 -#define __NR_exit		  1 -#define __NR_fork		  2 -#define __NR_read		  3 -#define __NR_write		  4 -#define __NR_open		  5 -#define __NR_close		  6 -#define __NR_waitpid		  7 -#define __NR_creat		  8 -#define __NR_link		  9 -#define __NR_unlink		 10 -#define __NR_execve		 11 -#define __NR_chdir		 12 -#define __NR_time		 13 -#define __NR_mknod		 14 -#define __NR_chmod		 15 -#define __NR_lchown		 16 -#define __NR_break		 17 -#define __NR_oldstat		 18 -#define __NR_lseek		 19 -#define __NR_getpid		 20 -#define __NR_mount		 21 -#define __NR_umount		 22 -#define __NR_setuid		 23 -#define __NR_getuid		 24 -#define __NR_stime		 25 -#define __NR_ptrace		 26 -#define __NR_alarm		 27 -#define __NR_oldfstat		 28 -#define __NR_pause		 29 -#define __NR_utime		 30 -#define __NR_stty		 31 -#define __NR_gtty		 32 -#define __NR_access		 33 -#define __NR_nice		 34 -#define __NR_ftime		 35 -#define __NR_sync		 36 -#define __NR_kill		 37 -#define __NR_rename		 38 -#define __NR_mkdir		 39 -#define __NR_rmdir		 40 -#define __NR_dup		 41 -#define __NR_pipe		 42 -#define __NR_times		 43 -#define __NR_prof		 44 -#define __NR_brk		 45 -#define __NR_setgid		 46 -#define __NR_getgid		 47 -#define __NR_signal		 48 -#define __NR_geteuid		 49 -#define __NR_getegid		 50 -#define __NR_acct		 51 -#define __NR_umount2		 52 -#define __NR_lock		 53 -#define __NR_ioctl		 54 -#define __NR_fcntl		 55 -#define __NR_mpx		 56 -#define __NR_setpgid		 57 -#define __NR_ulimit		 58 -#define __NR_oldolduname	 59 -#define __NR_umask		 60 -#define __NR_chroot		 61 -#define __NR_ustat		 62 -#define __NR_dup2		 63 -#define __NR_getppid		 64 -#define __NR_getpgrp		 65 -#define __NR_setsid		 66 -#define __NR_sigaction		 67 -#define __NR_sgetmask		 68 -#define __NR_ssetmask		 69 -#define __NR_setreuid		 70 -#define __NR_setregid		 71 -#define __NR_sigsuspend		 72 -#define __NR_sigpending		 73 -#define __NR_sethostname	 74 -#define __NR_setrlimit		 75 -#define __NR_getrlimit		 76 -#define __NR_getrusage		 77 -#define __NR_gettimeofday	 78 -#define __NR_settimeofday	 79 -#define __NR_getgroups		 80 -#define __NR_setgroups		 81 -#define __NR_select		 82 -#define __NR_symlink		 83 -#define __NR_oldlstat		 84 -#define __NR_readlink		 85 -#define __NR_uselib		 86 -#define __NR_swapon		 87 -#define __NR_reboot		 88 -#define __NR_readdir		 89 -#define __NR_mmap		 90 -#define __NR_munmap		 91 -#define __NR_truncate		 92 -#define __NR_ftruncate		 93 -#define __NR_fchmod		 94 -#define __NR_fchown		 95 -#define __NR_getpriority	 96 -#define __NR_setpriority	 97 -#define __NR_profil		 98 -#define __NR_statfs		 99 -#define __NR_fstatfs		100 -#define __NR_ioperm		101 -#define __NR_socketcall		102 -#define __NR_syslog		103 -#define __NR_setitimer		104 -#define __NR_getitimer		105 -#define __NR_stat		106 -#define __NR_lstat		107 -#define __NR_fstat		108 -#define __NR_olduname		109 -#define __NR_iopl		110 -#define __NR_vhangup		111 -#define __NR_idle		112 -#define __NR_vm86		113 -#define __NR_wait4		114 -#define __NR_swapoff		115 -#define __NR_sysinfo		116 -#define __NR_ipc		117 -#define __NR_fsync		118 -#define __NR_sigreturn		119 -#define __NR_clone		120 -#define __NR_setdomainname	121 -#define __NR_uname		122 -#define __NR_modify_ldt		123 -#define __NR_adjtimex		124 -#define __NR_mprotect		125 -#define __NR_sigprocmask	126 -#define __NR_create_module	127 -#define __NR_init_module	128 -#define __NR_delete_module	129 -#define __NR_get_kernel_syms	130 -#define __NR_quotactl		131 -#define __NR_getpgid		132 -#define __NR_fchdir		133 -#define __NR_bdflush		134 -#define __NR_sysfs		135 -#define __NR_personality	136 -#define __NR_afs_syscall	137 /* Syscall for Andrew File System */ -#define __NR_setfsuid		138 -#define __NR_setfsgid		139 -#define __NR__llseek		140 -#define __NR_getdents		141 -#define __NR__newselect		142 -#define __NR_flock		143 -#define __NR_msync		144 -#define __NR_readv		145 -#define __NR_writev		146 -#define __NR_getsid		147 -#define __NR_fdatasync		148 -#define __NR__sysctl		149 -#define __NR_mlock		150 -#define __NR_munlock		151 -#define __NR_mlockall		152 -#define __NR_munlockall		153 -#define __NR_sched_setparam		154 -#define __NR_sched_getparam		155 -#define __NR_sched_setscheduler		156 -#define __NR_sched_getscheduler		157 -#define __NR_sched_yield		158 -#define __NR_sched_get_priority_max	159 -#define __NR_sched_get_priority_min	160 -#define __NR_sched_rr_get_interval	161 -#define __NR_nanosleep		162 -#define __NR_mremap		163 -#define __NR_setresuid		164 -#define __NR_getresuid		165 - -#define __NR_query_module	167 -#define __NR_poll		168 -#define __NR_nfsservctl		169 -#define __NR_setresgid		170 -#define __NR_getresgid		171 -#define __NR_prctl              172 -#define __NR_rt_sigreturn	173 -#define __NR_rt_sigaction	174 -#define __NR_rt_sigprocmask	175 -#define __NR_rt_sigpending	176 -#define __NR_rt_sigtimedwait	177 -#define __NR_rt_sigqueueinfo	178 -#define __NR_rt_sigsuspend	179 -#define __NR_pread64		180 -#define __NR_pwrite64		181 -#define __NR_chown		182 -#define __NR_getcwd		183 -#define __NR_capget		184 -#define __NR_capset		185 -#define __NR_sigaltstack	186 -#define __NR_sendfile		187 -#define __NR_getpmsg		188	/* some people actually want streams */ -#define __NR_putpmsg		189	/* some people actually want streams */ -#define __NR_vfork		190 -#define __NR_ugetrlimit		191	/* SuS compliant getrlimit */ -#define __NR_mmap2		192 -#define __NR_truncate64		193 -#define __NR_ftruncate64	194 -#define __NR_stat64		195 -#define __NR_lstat64		196 -#define __NR_fstat64		197 -#define __NR_lchown32		198 -#define __NR_getuid32		199 -#define __NR_getgid32		200 -#define __NR_geteuid32		201 -#define __NR_getegid32		202 -#define __NR_setreuid32		203 -#define __NR_setregid32		204 -#define __NR_getgroups32	205 -#define __NR_setgroups32	206 -#define __NR_fchown32		207 -#define __NR_setresuid32	208 -#define __NR_getresuid32	209 -#define __NR_setresgid32	210 -#define __NR_getresgid32	211 -#define __NR_chown32		212 -#define __NR_setuid32		213 -#define __NR_setgid32		214 -#define __NR_setfsuid32		215 -#define __NR_setfsgid32		216 -#define __NR_pivot_root		217 -#define __NR_mincore		218 -#define __NR_madvise		219 -#define __NR_getdents64		220 -#define __NR_fcntl64		221 -/* 223 is unused */ -#define __NR_gettid             224 -#define __NR_readahead          225 -#define __NR_setxattr		226 -#define __NR_lsetxattr		227 -#define __NR_fsetxattr		228 -#define __NR_getxattr		229 -#define __NR_lgetxattr		230 -#define __NR_fgetxattr		231 -#define __NR_listxattr		232 -#define __NR_llistxattr		233 -#define __NR_flistxattr		234 -#define __NR_removexattr	235 -#define __NR_lremovexattr	236 -#define __NR_fremovexattr	237 -#define __NR_tkill		238 -#define __NR_sendfile64		239 -#define __NR_futex		240 -#define __NR_sched_setaffinity	241 -#define __NR_sched_getaffinity	242 -#define __NR_set_thread_area	243 -#define __NR_get_thread_area	244 -#define __NR_io_setup		245 -#define __NR_io_destroy		246 -#define __NR_io_getevents	247 -#define __NR_io_submit		248 -#define __NR_io_cancel		249 -#define __NR_fadvise64		250 -/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */ -#define __NR_exit_group		252 -#define __NR_lookup_dcookie	253 -#define __NR_epoll_create	254 -#define __NR_epoll_ctl		255 -#define __NR_epoll_wait		256 -#define __NR_remap_file_pages	257 -#define __NR_set_tid_address	258 -#define __NR_timer_create	259 -#define __NR_timer_settime	(__NR_timer_create+1) -#define __NR_timer_gettime	(__NR_timer_create+2) -#define __NR_timer_getoverrun	(__NR_timer_create+3) -#define __NR_timer_delete	(__NR_timer_create+4) -#define __NR_clock_settime	(__NR_timer_create+5) -#define __NR_clock_gettime	(__NR_timer_create+6) -#define __NR_clock_getres	(__NR_timer_create+7) -#define __NR_clock_nanosleep	(__NR_timer_create+8) -#define __NR_statfs64		268 -#define __NR_fstatfs64		269 -#define __NR_tgkill		270 -#define __NR_utimes		271 -#define __NR_fadvise64_64	272 -#define __NR_vserver		273 -#define __NR_mbind		274 -#define __NR_get_mempolicy	275 -#define __NR_set_mempolicy	276 -#define __NR_mq_open		277 -#define __NR_mq_unlink		(__NR_mq_open+1) -#define __NR_mq_timedsend	(__NR_mq_open+2) -#define __NR_mq_timedreceive	(__NR_mq_open+3) -#define __NR_mq_notify		(__NR_mq_open+4) -#define __NR_mq_getsetattr	(__NR_mq_open+5) -#define __NR_kexec_load		283 -#define __NR_waitid		284 -/* #define __NR_sys_setaltroot	285 */ -#define __NR_add_key		286 -#define __NR_request_key	287 -#define __NR_keyctl		288 -#define __NR_ioprio_set		289 -#define __NR_ioprio_get		290 -#define __NR_inotify_init	291 -#define __NR_inotify_add_watch	292 -#define __NR_inotify_rm_watch	293 -#define __NR_migrate_pages	294 -#define __NR_openat		295 -#define __NR_mkdirat		296 -#define __NR_mknodat		297 -#define __NR_fchownat		298 -#define __NR_futimesat		299 -#define __NR_fstatat64		300 -#define __NR_unlinkat		301 -#define __NR_renameat		302 -#define __NR_linkat		303 -#define __NR_symlinkat		304 -#define __NR_readlinkat		305 -#define __NR_fchmodat		306 -#define __NR_faccessat		307 -#define __NR_pselect6		308 -#define __NR_ppoll		309 -#define __NR_unshare		310 -#define __NR_set_robust_list	311 -#define __NR_get_robust_list	312 -#define __NR_splice		313 -#define __NR_sync_file_range	314 -#define __NR_tee		315 -#define __NR_vmsplice		316 -#define __NR_move_pages		317 -#define __NR_getcpu		318 -#define __NR_epoll_pwait	319 -#define __NR_utimensat		320 -#define __NR_signalfd		321 -#define __NR_timerfd_create	322 -#define __NR_eventfd		323 -#define __NR_fallocate		324 -#define __NR_timerfd_settime	325 -#define __NR_timerfd_gettime	326 -#define __NR_signalfd4		327 -#define __NR_eventfd2		328 -#define __NR_epoll_create1	329 -#define __NR_dup3		330 -#define __NR_pipe2		331 -#define __NR_inotify_init1	332 -#define __NR_preadv		333 -#define __NR_pwritev		334 -#define __NR_setns		335 +#include <uapi/asm/unistd.h> -#ifdef __KERNEL__  #define NR_syscalls 336 @@ -371,7 +32,6 @@  #define __ARCH_WANT_SYS_SIGPROCMASK  #define __ARCH_WANT_SYS_RT_SIGACTION  #define __ARCH_WANT_SYS_RT_SIGSUSPEND -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_VFORK  #define __ARCH_WANT_SYS_CLONE @@ -384,5 +44,4 @@   */  #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") -#endif /* __KERNEL__ */  #endif /* _ASM_CRIS_UNISTD_H_ */ diff --git a/arch/cris/include/uapi/arch-v10/arch/Kbuild b/arch/cris/include/uapi/arch-v10/arch/Kbuild index aafaa5aa54d..9048c87a782 100644 --- a/arch/cris/include/uapi/arch-v10/arch/Kbuild +++ b/arch/cris/include/uapi/arch-v10/arch/Kbuild @@ -1 +1,5 @@  # UAPI Header export list +header-y += sv_addr.agh +header-y += sv_addr_ag.h +header-y += svinto.h +header-y += user.h diff --git a/arch/cris/include/arch-v10/arch/sv_addr.agh b/arch/cris/include/uapi/arch-v10/arch/sv_addr.agh index 6ac3a7bc976..6ac3a7bc976 100644 --- a/arch/cris/include/arch-v10/arch/sv_addr.agh +++ b/arch/cris/include/uapi/arch-v10/arch/sv_addr.agh diff --git a/arch/cris/include/arch-v10/arch/sv_addr_ag.h b/arch/cris/include/uapi/arch-v10/arch/sv_addr_ag.h index 5517f04153a..5517f04153a 100644 --- a/arch/cris/include/arch-v10/arch/sv_addr_ag.h +++ b/arch/cris/include/uapi/arch-v10/arch/sv_addr_ag.h diff --git a/arch/cris/include/arch-v10/arch/svinto.h b/arch/cris/include/uapi/arch-v10/arch/svinto.h index da5c1527265..da5c1527265 100644 --- a/arch/cris/include/arch-v10/arch/svinto.h +++ b/arch/cris/include/uapi/arch-v10/arch/svinto.h diff --git a/arch/cris/include/arch-v10/arch/user.h b/arch/cris/include/uapi/arch-v10/arch/user.h index 9303ea77c91..9303ea77c91 100644 --- a/arch/cris/include/arch-v10/arch/user.h +++ b/arch/cris/include/uapi/arch-v10/arch/user.h diff --git a/arch/cris/include/uapi/arch-v32/arch/Kbuild b/arch/cris/include/uapi/arch-v32/arch/Kbuild index aafaa5aa54d..59efffd16b6 100644 --- a/arch/cris/include/uapi/arch-v32/arch/Kbuild +++ b/arch/cris/include/uapi/arch-v32/arch/Kbuild @@ -1 +1,3 @@  # UAPI Header export list +header-y += cryptocop.h +header-y += user.h diff --git a/arch/cris/include/uapi/arch-v32/arch/cryptocop.h b/arch/cris/include/uapi/arch-v32/arch/cryptocop.h new file mode 100644 index 00000000000..694fd13ce1c --- /dev/null +++ b/arch/cris/include/uapi/arch-v32/arch/cryptocop.h @@ -0,0 +1,122 @@ +/* + * The device /dev/cryptocop is accessible using this driver using + * CRYPTOCOP_MAJOR (254) and minor number 0. + */ + +#ifndef _UAPICRYPTOCOP_H +#define _UAPICRYPTOCOP_H + +#include <linux/uio.h> + + +#define CRYPTOCOP_SESSION_ID_NONE (0) + +typedef unsigned long long int cryptocop_session_id; + +/* cryptocop ioctls */ +#define ETRAXCRYPTOCOP_IOCTYPE         (250) + +#define CRYPTOCOP_IO_CREATE_SESSION    _IOWR(ETRAXCRYPTOCOP_IOCTYPE, 1, struct strcop_session_op) +#define CRYPTOCOP_IO_CLOSE_SESSION     _IOW(ETRAXCRYPTOCOP_IOCTYPE, 2, struct strcop_session_op) +#define CRYPTOCOP_IO_PROCESS_OP        _IOWR(ETRAXCRYPTOCOP_IOCTYPE, 3, struct strcop_crypto_op) +#define CRYPTOCOP_IO_MAXNR             (3) + +typedef enum { +	cryptocop_cipher_des = 0, +	cryptocop_cipher_3des = 1, +	cryptocop_cipher_aes = 2, +	cryptocop_cipher_m2m = 3, /* mem2mem is essentially a NULL cipher with blocklength=1 */ +	cryptocop_cipher_none +} cryptocop_cipher_type; + +typedef enum { +	cryptocop_digest_sha1 = 0, +	cryptocop_digest_md5 = 1, +	cryptocop_digest_none +} cryptocop_digest_type; + +typedef enum { +	cryptocop_csum_le = 0, +	cryptocop_csum_be = 1, +	cryptocop_csum_none +} cryptocop_csum_type; + +typedef enum { +	cryptocop_cipher_mode_ecb = 0, +	cryptocop_cipher_mode_cbc, +	cryptocop_cipher_mode_none +} cryptocop_cipher_mode; + +typedef enum { +	cryptocop_3des_eee = 0, +	cryptocop_3des_eed = 1, +	cryptocop_3des_ede = 2, +	cryptocop_3des_edd = 3, +	cryptocop_3des_dee = 4, +	cryptocop_3des_ded = 5, +	cryptocop_3des_dde = 6, +	cryptocop_3des_ddd = 7 +} cryptocop_3des_mode; + +/* Usermode accessible (ioctl) operations. */ +struct strcop_session_op{ +	cryptocop_session_id    ses_id; + +	cryptocop_cipher_type   cipher; /* AES, DES, 3DES, m2m, none */ + +	cryptocop_cipher_mode   cmode; /* ECB, CBC, none */ +	cryptocop_3des_mode     des3_mode; + +	cryptocop_digest_type   digest; /* MD5, SHA1, none */ + +	cryptocop_csum_type     csum;   /* BE, LE, none */ + +	unsigned char           *key; +	size_t                  keylen; +}; + +#define CRYPTOCOP_CSUM_LENGTH         (2) +#define CRYPTOCOP_MAX_DIGEST_LENGTH   (20)  /* SHA-1 20, MD5 16 */ +#define CRYPTOCOP_MAX_IV_LENGTH       (16)  /* (3)DES==8, AES == 16 */ +#define CRYPTOCOP_MAX_KEY_LENGTH      (32) + +struct strcop_crypto_op{ +	cryptocop_session_id ses_id; + +	/* Indata. */ +	unsigned char            *indata; +	size_t                   inlen; /* Total indata length. */ + +	/* Cipher configuration. */ +	unsigned char            do_cipher:1; +	unsigned char            decrypt:1; /* 1 == decrypt, 0 == encrypt */ +	unsigned char            cipher_explicit:1; +	size_t                   cipher_start; +	size_t                   cipher_len; +	/* cipher_iv is used if do_cipher and cipher_explicit and the cipher +	   mode is CBC.  The length is controlled by the type of cipher, +	   e.g. DES/3DES 8 octets and AES 16 octets. */ +	unsigned char            cipher_iv[CRYPTOCOP_MAX_IV_LENGTH]; +	/* Outdata. */ +	unsigned char            *cipher_outdata; +	size_t                   cipher_outlen; + +	/* digest configuration. */ +	unsigned char            do_digest:1; +	size_t                   digest_start; +	size_t                   digest_len; +	/* Outdata.  The actual length is determined by the type of the digest. */ +	unsigned char            digest[CRYPTOCOP_MAX_DIGEST_LENGTH]; + +	/* Checksum configuration. */ +	unsigned char            do_csum:1; +	size_t                   csum_start; +	size_t                   csum_len; +	/* Outdata. */ +	unsigned char            csum[CRYPTOCOP_CSUM_LENGTH]; +}; + + + + +#endif /* _UAPICRYPTOCOP_H */ diff --git a/arch/cris/include/arch-v32/arch/user.h b/arch/cris/include/uapi/arch-v32/arch/user.h index 03fa1f3c3c0..03fa1f3c3c0 100644 --- a/arch/cris/include/arch-v32/arch/user.h +++ b/arch/cris/include/uapi/arch-v32/arch/user.h diff --git a/arch/cris/include/uapi/asm/Kbuild b/arch/cris/include/uapi/asm/Kbuild index f50236ae9ca..7d47b366ad8 100644 --- a/arch/cris/include/uapi/asm/Kbuild +++ b/arch/cris/include/uapi/asm/Kbuild @@ -3,3 +3,37 @@ include include/uapi/asm-generic/Kbuild.asm  header-y += arch-v10/  header-y += arch-v32/ +header-y += auxvec.h +header-y += bitsperlong.h +header-y += byteorder.h +header-y += errno.h +header-y += ethernet.h +header-y += etraxgpio.h +header-y += fcntl.h +header-y += ioctl.h +header-y += ioctls.h +header-y += ipcbuf.h +header-y += mman.h +header-y += msgbuf.h +header-y += param.h +header-y += poll.h +header-y += posix_types.h +header-y += ptrace.h +header-y += resource.h +header-y += rs485.h +header-y += sembuf.h +header-y += setup.h +header-y += shmbuf.h +header-y += sigcontext.h +header-y += siginfo.h +header-y += signal.h +header-y += socket.h +header-y += sockios.h +header-y += stat.h +header-y += statfs.h +header-y += swab.h +header-y += sync_serial.h +header-y += termbits.h +header-y += termios.h +header-y += types.h +header-y += unistd.h diff --git a/arch/cris/include/asm/auxvec.h b/arch/cris/include/uapi/asm/auxvec.h index cb30b01bf19..cb30b01bf19 100644 --- a/arch/cris/include/asm/auxvec.h +++ b/arch/cris/include/uapi/asm/auxvec.h diff --git a/arch/cris/include/asm/bitsperlong.h b/arch/cris/include/uapi/asm/bitsperlong.h index 6dc0bb0c13b..6dc0bb0c13b 100644 --- a/arch/cris/include/asm/bitsperlong.h +++ b/arch/cris/include/uapi/asm/bitsperlong.h diff --git a/arch/cris/include/asm/byteorder.h b/arch/cris/include/uapi/asm/byteorder.h index bcd189798e2..bcd189798e2 100644 --- a/arch/cris/include/asm/byteorder.h +++ b/arch/cris/include/uapi/asm/byteorder.h diff --git a/arch/cris/include/asm/errno.h b/arch/cris/include/uapi/asm/errno.h index 2bf5eb5fa77..2bf5eb5fa77 100644 --- a/arch/cris/include/asm/errno.h +++ b/arch/cris/include/uapi/asm/errno.h diff --git a/arch/cris/include/asm/ethernet.h b/arch/cris/include/uapi/asm/ethernet.h index 4d58652c3a4..4d58652c3a4 100644 --- a/arch/cris/include/asm/ethernet.h +++ b/arch/cris/include/uapi/asm/ethernet.h diff --git a/arch/cris/include/asm/etraxgpio.h b/arch/cris/include/uapi/asm/etraxgpio.h index 461c089db76..461c089db76 100644 --- a/arch/cris/include/asm/etraxgpio.h +++ b/arch/cris/include/uapi/asm/etraxgpio.h diff --git a/arch/cris/include/asm/fcntl.h b/arch/cris/include/uapi/asm/fcntl.h index 46ab12db573..46ab12db573 100644 --- a/arch/cris/include/asm/fcntl.h +++ b/arch/cris/include/uapi/asm/fcntl.h diff --git a/arch/cris/include/asm/ioctl.h b/arch/cris/include/uapi/asm/ioctl.h index b279fe06dfe..b279fe06dfe 100644 --- a/arch/cris/include/asm/ioctl.h +++ b/arch/cris/include/uapi/asm/ioctl.h diff --git a/arch/cris/include/asm/ioctls.h b/arch/cris/include/uapi/asm/ioctls.h index 488fbb3f5e8..488fbb3f5e8 100644 --- a/arch/cris/include/asm/ioctls.h +++ b/arch/cris/include/uapi/asm/ioctls.h diff --git a/arch/cris/include/asm/ipcbuf.h b/arch/cris/include/uapi/asm/ipcbuf.h index 84c7e51cb6d..84c7e51cb6d 100644 --- a/arch/cris/include/asm/ipcbuf.h +++ b/arch/cris/include/uapi/asm/ipcbuf.h diff --git a/arch/cris/include/asm/mman.h b/arch/cris/include/uapi/asm/mman.h index 8eebf89f5ab..8eebf89f5ab 100644 --- a/arch/cris/include/asm/mman.h +++ b/arch/cris/include/uapi/asm/mman.h diff --git a/arch/cris/include/asm/msgbuf.h b/arch/cris/include/uapi/asm/msgbuf.h index ada63df1d57..ada63df1d57 100644 --- a/arch/cris/include/asm/msgbuf.h +++ b/arch/cris/include/uapi/asm/msgbuf.h diff --git a/arch/cris/include/asm/param.h b/arch/cris/include/uapi/asm/param.h index 484fcf8667c..484fcf8667c 100644 --- a/arch/cris/include/asm/param.h +++ b/arch/cris/include/uapi/asm/param.h diff --git a/arch/cris/include/asm/poll.h b/arch/cris/include/uapi/asm/poll.h index c98509d3149..c98509d3149 100644 --- a/arch/cris/include/asm/poll.h +++ b/arch/cris/include/uapi/asm/poll.h diff --git a/arch/cris/include/asm/posix_types.h b/arch/cris/include/uapi/asm/posix_types.h index ce4e5179315..ce4e5179315 100644 --- a/arch/cris/include/asm/posix_types.h +++ b/arch/cris/include/uapi/asm/posix_types.h diff --git a/arch/cris/include/uapi/asm/ptrace.h b/arch/cris/include/uapi/asm/ptrace.h new file mode 100644 index 00000000000..c689c9bbbe5 --- /dev/null +++ b/arch/cris/include/uapi/asm/ptrace.h @@ -0,0 +1 @@ +#include <arch/ptrace.h> diff --git a/arch/cris/include/asm/resource.h b/arch/cris/include/uapi/asm/resource.h index b5d29448de4..b5d29448de4 100644 --- a/arch/cris/include/asm/resource.h +++ b/arch/cris/include/uapi/asm/resource.h diff --git a/arch/cris/include/asm/rs485.h b/arch/cris/include/uapi/asm/rs485.h index ad40f9fbcb8..ad40f9fbcb8 100644 --- a/arch/cris/include/asm/rs485.h +++ b/arch/cris/include/uapi/asm/rs485.h diff --git a/arch/cris/include/asm/sembuf.h b/arch/cris/include/uapi/asm/sembuf.h index 7fed9843796..7fed9843796 100644 --- a/arch/cris/include/asm/sembuf.h +++ b/arch/cris/include/uapi/asm/sembuf.h diff --git a/arch/cris/include/asm/setup.h b/arch/cris/include/uapi/asm/setup.h index b90728652d1..b90728652d1 100644 --- a/arch/cris/include/asm/setup.h +++ b/arch/cris/include/uapi/asm/setup.h diff --git a/arch/cris/include/asm/shmbuf.h b/arch/cris/include/uapi/asm/shmbuf.h index 3239e3f000e..3239e3f000e 100644 --- a/arch/cris/include/asm/shmbuf.h +++ b/arch/cris/include/uapi/asm/shmbuf.h diff --git a/arch/cris/include/asm/sigcontext.h b/arch/cris/include/uapi/asm/sigcontext.h index a1d634e120d..a1d634e120d 100644 --- a/arch/cris/include/asm/sigcontext.h +++ b/arch/cris/include/uapi/asm/sigcontext.h diff --git a/arch/cris/include/asm/siginfo.h b/arch/cris/include/uapi/asm/siginfo.h index c1cd6d16928..c1cd6d16928 100644 --- a/arch/cris/include/asm/siginfo.h +++ b/arch/cris/include/uapi/asm/siginfo.h diff --git a/arch/cris/include/uapi/asm/signal.h b/arch/cris/include/uapi/asm/signal.h new file mode 100644 index 00000000000..ce42fa7c32a --- /dev/null +++ b/arch/cris/include/uapi/asm/signal.h @@ -0,0 +1,116 @@ +#ifndef _UAPI_ASM_CRIS_SIGNAL_H +#define _UAPI_ASM_CRIS_SIGNAL_H + +#include <linux/types.h> + +/* Avoid too many header ordering problems.  */ +struct siginfo; + +#ifndef __KERNEL__ +/* Here we must cater to libcs that poke about in kernel headers.  */ + +#define NSIG		32 +typedef unsigned long sigset_t; + +#endif /* __KERNEL__ */ + +#define SIGHUP		 1 +#define SIGINT		 2 +#define SIGQUIT		 3 +#define SIGILL		 4 +#define SIGTRAP		 5 +#define SIGABRT		 6 +#define SIGIOT		 6 +#define SIGBUS		 7 +#define SIGFPE		 8 +#define SIGKILL		 9 +#define SIGUSR1		10 +#define SIGSEGV		11 +#define SIGUSR2		12 +#define SIGPIPE		13 +#define SIGALRM		14 +#define SIGTERM		15 +#define SIGSTKFLT	16 +#define SIGCHLD		17 +#define SIGCONT		18 +#define SIGSTOP		19 +#define SIGTSTP		20 +#define SIGTTIN		21 +#define SIGTTOU		22 +#define SIGURG		23 +#define SIGXCPU		24 +#define SIGXFSZ		25 +#define SIGVTALRM	26 +#define SIGPROF		27 +#define SIGWINCH	28 +#define SIGIO		29 +#define SIGPOLL		SIGIO +/* +#define SIGLOST		29 +*/ +#define SIGPWR		30 +#define SIGSYS          31 +#define	SIGUNUSED	31 + +/* These should not be considered constants from userland.  */ +#define SIGRTMIN        32 +#define SIGRTMAX        _NSIG + +/* + * SA_FLAGS values: + * + * SA_ONSTACK indicates that a registered stack_t will be used. + * SA_RESTART flag to get restarting signals (which were the default long ago) + * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. + * SA_RESETHAND clears the handler when the signal is delivered. + * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. + * SA_NODEFER prevents the current signal from being masked in the handler. + * + * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single + * Unix names RESETHAND and NODEFER respectively. + */ + +#define SA_NOCLDSTOP	0x00000001u +#define SA_NOCLDWAIT	0x00000002u +#define SA_SIGINFO	0x00000004u +#define SA_ONSTACK	0x08000000u +#define SA_RESTART	0x10000000u +#define SA_NODEFER	0x40000000u +#define SA_RESETHAND	0x80000000u + +#define SA_NOMASK	SA_NODEFER +#define SA_ONESHOT	SA_RESETHAND + +#define SA_RESTORER	0x04000000 + +#define MINSIGSTKSZ	2048 +#define SIGSTKSZ	8192 + +#include <asm-generic/signal-defs.h> + +#ifndef __KERNEL__ +/* Here we must cater to libcs that poke about in kernel headers.  */ + +struct sigaction { +	union { +	  __sighandler_t _sa_handler; +	  void (*_sa_sigaction)(int, struct siginfo *, void *); +	} _u; +	sigset_t sa_mask; +	unsigned long sa_flags; +	void (*sa_restorer)(void); +}; + +#define sa_handler	_u._sa_handler +#define sa_sigaction	_u._sa_sigaction + +#endif /* __KERNEL__ */ + +typedef struct sigaltstack { +	void *ss_sp; +	int ss_flags; +	size_t ss_size; +} stack_t; + + +#endif /* _UAPI_ASM_CRIS_SIGNAL_H */ diff --git a/arch/cris/include/asm/socket.h b/arch/cris/include/uapi/asm/socket.h index b681b043f6c..b681b043f6c 100644 --- a/arch/cris/include/asm/socket.h +++ b/arch/cris/include/uapi/asm/socket.h diff --git a/arch/cris/include/asm/sockios.h b/arch/cris/include/uapi/asm/sockios.h index cfe7bfecf59..cfe7bfecf59 100644 --- a/arch/cris/include/asm/sockios.h +++ b/arch/cris/include/uapi/asm/sockios.h diff --git a/arch/cris/include/asm/stat.h b/arch/cris/include/uapi/asm/stat.h index 9e558cc3c43..9e558cc3c43 100644 --- a/arch/cris/include/asm/stat.h +++ b/arch/cris/include/uapi/asm/stat.h diff --git a/arch/cris/include/asm/statfs.h b/arch/cris/include/uapi/asm/statfs.h index fdaf921844b..fdaf921844b 100644 --- a/arch/cris/include/asm/statfs.h +++ b/arch/cris/include/uapi/asm/statfs.h diff --git a/arch/cris/include/uapi/asm/swab.h b/arch/cris/include/uapi/asm/swab.h new file mode 100644 index 00000000000..4adf1e9f0b0 --- /dev/null +++ b/arch/cris/include/uapi/asm/swab.h @@ -0,0 +1,3 @@ +/* + * CRIS byte swapping. + */ diff --git a/arch/cris/include/asm/sync_serial.h b/arch/cris/include/uapi/asm/sync_serial.h index 7f827fea30e..7f827fea30e 100644 --- a/arch/cris/include/asm/sync_serial.h +++ b/arch/cris/include/uapi/asm/sync_serial.h diff --git a/arch/cris/include/asm/termbits.h b/arch/cris/include/uapi/asm/termbits.h index 1c43bc874cc..1c43bc874cc 100644 --- a/arch/cris/include/asm/termbits.h +++ b/arch/cris/include/uapi/asm/termbits.h diff --git a/arch/cris/include/uapi/asm/termios.h b/arch/cris/include/uapi/asm/termios.h new file mode 100644 index 00000000000..0a0386a5502 --- /dev/null +++ b/arch/cris/include/uapi/asm/termios.h @@ -0,0 +1,45 @@ +#ifndef _UAPI_CRIS_TERMIOS_H +#define _UAPI_CRIS_TERMIOS_H + +#include <asm/termbits.h> +#include <asm/ioctls.h> +#include <asm/rs485.h> +#include <linux/serial.h> + +struct winsize { +	unsigned short ws_row; +	unsigned short ws_col; +	unsigned short ws_xpixel; +	unsigned short ws_ypixel; +}; + +#define NCC 8 +struct termio { +	unsigned short c_iflag;		/* input mode flags */ +	unsigned short c_oflag;		/* output mode flags */ +	unsigned short c_cflag;		/* control mode flags */ +	unsigned short c_lflag;		/* local mode flags */ +	unsigned char c_line;		/* line discipline */ +	unsigned char c_cc[NCC];	/* control characters */ +}; + +/* modem lines */ +#define TIOCM_LE	0x001 +#define TIOCM_DTR	0x002 +#define TIOCM_RTS	0x004 +#define TIOCM_ST	0x008 +#define TIOCM_SR	0x010 +#define TIOCM_CTS	0x020 +#define TIOCM_CAR	0x040 +#define TIOCM_RNG	0x080 +#define TIOCM_DSR	0x100 +#define TIOCM_CD	TIOCM_CAR +#define TIOCM_RI	TIOCM_RNG +#define TIOCM_OUT1	0x2000 +#define TIOCM_OUT2	0x4000 +#define TIOCM_LOOP	0x8000 + +/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ + + +#endif /* _UAPI_CRIS_TERMIOS_H */ diff --git a/arch/cris/include/uapi/asm/types.h b/arch/cris/include/uapi/asm/types.h new file mode 100644 index 00000000000..9ec9d4c5ac4 --- /dev/null +++ b/arch/cris/include/uapi/asm/types.h @@ -0,0 +1 @@ +#include <asm-generic/int-ll64.h> diff --git a/arch/cris/include/uapi/asm/unistd.h b/arch/cris/include/uapi/asm/unistd.h new file mode 100644 index 00000000000..48842896f6c --- /dev/null +++ b/arch/cris/include/uapi/asm/unistd.h @@ -0,0 +1,344 @@ +#ifndef _UAPI_ASM_CRIS_UNISTD_H_ +#define _UAPI_ASM_CRIS_UNISTD_H_ + +/* + * This file contains the system call numbers, and stub macros for libc. + */ + +#define __NR_restart_syscall      0 +#define __NR_exit		  1 +#define __NR_fork		  2 +#define __NR_read		  3 +#define __NR_write		  4 +#define __NR_open		  5 +#define __NR_close		  6 +#define __NR_waitpid		  7 +#define __NR_creat		  8 +#define __NR_link		  9 +#define __NR_unlink		 10 +#define __NR_execve		 11 +#define __NR_chdir		 12 +#define __NR_time		 13 +#define __NR_mknod		 14 +#define __NR_chmod		 15 +#define __NR_lchown		 16 +#define __NR_break		 17 +#define __NR_oldstat		 18 +#define __NR_lseek		 19 +#define __NR_getpid		 20 +#define __NR_mount		 21 +#define __NR_umount		 22 +#define __NR_setuid		 23 +#define __NR_getuid		 24 +#define __NR_stime		 25 +#define __NR_ptrace		 26 +#define __NR_alarm		 27 +#define __NR_oldfstat		 28 +#define __NR_pause		 29 +#define __NR_utime		 30 +#define __NR_stty		 31 +#define __NR_gtty		 32 +#define __NR_access		 33 +#define __NR_nice		 34 +#define __NR_ftime		 35 +#define __NR_sync		 36 +#define __NR_kill		 37 +#define __NR_rename		 38 +#define __NR_mkdir		 39 +#define __NR_rmdir		 40 +#define __NR_dup		 41 +#define __NR_pipe		 42 +#define __NR_times		 43 +#define __NR_prof		 44 +#define __NR_brk		 45 +#define __NR_setgid		 46 +#define __NR_getgid		 47 +#define __NR_signal		 48 +#define __NR_geteuid		 49 +#define __NR_getegid		 50 +#define __NR_acct		 51 +#define __NR_umount2		 52 +#define __NR_lock		 53 +#define __NR_ioctl		 54 +#define __NR_fcntl		 55 +#define __NR_mpx		 56 +#define __NR_setpgid		 57 +#define __NR_ulimit		 58 +#define __NR_oldolduname	 59 +#define __NR_umask		 60 +#define __NR_chroot		 61 +#define __NR_ustat		 62 +#define __NR_dup2		 63 +#define __NR_getppid		 64 +#define __NR_getpgrp		 65 +#define __NR_setsid		 66 +#define __NR_sigaction		 67 +#define __NR_sgetmask		 68 +#define __NR_ssetmask		 69 +#define __NR_setreuid		 70 +#define __NR_setregid		 71 +#define __NR_sigsuspend		 72 +#define __NR_sigpending		 73 +#define __NR_sethostname	 74 +#define __NR_setrlimit		 75 +#define __NR_getrlimit		 76 +#define __NR_getrusage		 77 +#define __NR_gettimeofday	 78 +#define __NR_settimeofday	 79 +#define __NR_getgroups		 80 +#define __NR_setgroups		 81 +#define __NR_select		 82 +#define __NR_symlink		 83 +#define __NR_oldlstat		 84 +#define __NR_readlink		 85 +#define __NR_uselib		 86 +#define __NR_swapon		 87 +#define __NR_reboot		 88 +#define __NR_readdir		 89 +#define __NR_mmap		 90 +#define __NR_munmap		 91 +#define __NR_truncate		 92 +#define __NR_ftruncate		 93 +#define __NR_fchmod		 94 +#define __NR_fchown		 95 +#define __NR_getpriority	 96 +#define __NR_setpriority	 97 +#define __NR_profil		 98 +#define __NR_statfs		 99 +#define __NR_fstatfs		100 +#define __NR_ioperm		101 +#define __NR_socketcall		102 +#define __NR_syslog		103 +#define __NR_setitimer		104 +#define __NR_getitimer		105 +#define __NR_stat		106 +#define __NR_lstat		107 +#define __NR_fstat		108 +#define __NR_olduname		109 +#define __NR_iopl		110 +#define __NR_vhangup		111 +#define __NR_idle		112 +#define __NR_vm86		113 +#define __NR_wait4		114 +#define __NR_swapoff		115 +#define __NR_sysinfo		116 +#define __NR_ipc		117 +#define __NR_fsync		118 +#define __NR_sigreturn		119 +#define __NR_clone		120 +#define __NR_setdomainname	121 +#define __NR_uname		122 +#define __NR_modify_ldt		123 +#define __NR_adjtimex		124 +#define __NR_mprotect		125 +#define __NR_sigprocmask	126 +#define __NR_create_module	127 +#define __NR_init_module	128 +#define __NR_delete_module	129 +#define __NR_get_kernel_syms	130 +#define __NR_quotactl		131 +#define __NR_getpgid		132 +#define __NR_fchdir		133 +#define __NR_bdflush		134 +#define __NR_sysfs		135 +#define __NR_personality	136 +#define __NR_afs_syscall	137 /* Syscall for Andrew File System */ +#define __NR_setfsuid		138 +#define __NR_setfsgid		139 +#define __NR__llseek		140 +#define __NR_getdents		141 +#define __NR__newselect		142 +#define __NR_flock		143 +#define __NR_msync		144 +#define __NR_readv		145 +#define __NR_writev		146 +#define __NR_getsid		147 +#define __NR_fdatasync		148 +#define __NR__sysctl		149 +#define __NR_mlock		150 +#define __NR_munlock		151 +#define __NR_mlockall		152 +#define __NR_munlockall		153 +#define __NR_sched_setparam		154 +#define __NR_sched_getparam		155 +#define __NR_sched_setscheduler		156 +#define __NR_sched_getscheduler		157 +#define __NR_sched_yield		158 +#define __NR_sched_get_priority_max	159 +#define __NR_sched_get_priority_min	160 +#define __NR_sched_rr_get_interval	161 +#define __NR_nanosleep		162 +#define __NR_mremap		163 +#define __NR_setresuid		164 +#define __NR_getresuid		165 + +#define __NR_query_module	167 +#define __NR_poll		168 +#define __NR_nfsservctl		169 +#define __NR_setresgid		170 +#define __NR_getresgid		171 +#define __NR_prctl              172 +#define __NR_rt_sigreturn	173 +#define __NR_rt_sigaction	174 +#define __NR_rt_sigprocmask	175 +#define __NR_rt_sigpending	176 +#define __NR_rt_sigtimedwait	177 +#define __NR_rt_sigqueueinfo	178 +#define __NR_rt_sigsuspend	179 +#define __NR_pread64		180 +#define __NR_pwrite64		181 +#define __NR_chown		182 +#define __NR_getcwd		183 +#define __NR_capget		184 +#define __NR_capset		185 +#define __NR_sigaltstack	186 +#define __NR_sendfile		187 +#define __NR_getpmsg		188	/* some people actually want streams */ +#define __NR_putpmsg		189	/* some people actually want streams */ +#define __NR_vfork		190 +#define __NR_ugetrlimit		191	/* SuS compliant getrlimit */ +#define __NR_mmap2		192 +#define __NR_truncate64		193 +#define __NR_ftruncate64	194 +#define __NR_stat64		195 +#define __NR_lstat64		196 +#define __NR_fstat64		197 +#define __NR_lchown32		198 +#define __NR_getuid32		199 +#define __NR_getgid32		200 +#define __NR_geteuid32		201 +#define __NR_getegid32		202 +#define __NR_setreuid32		203 +#define __NR_setregid32		204 +#define __NR_getgroups32	205 +#define __NR_setgroups32	206 +#define __NR_fchown32		207 +#define __NR_setresuid32	208 +#define __NR_getresuid32	209 +#define __NR_setresgid32	210 +#define __NR_getresgid32	211 +#define __NR_chown32		212 +#define __NR_setuid32		213 +#define __NR_setgid32		214 +#define __NR_setfsuid32		215 +#define __NR_setfsgid32		216 +#define __NR_pivot_root		217 +#define __NR_mincore		218 +#define __NR_madvise		219 +#define __NR_getdents64		220 +#define __NR_fcntl64		221 +/* 223 is unused */ +#define __NR_gettid             224 +#define __NR_readahead          225 +#define __NR_setxattr		226 +#define __NR_lsetxattr		227 +#define __NR_fsetxattr		228 +#define __NR_getxattr		229 +#define __NR_lgetxattr		230 +#define __NR_fgetxattr		231 +#define __NR_listxattr		232 +#define __NR_llistxattr		233 +#define __NR_flistxattr		234 +#define __NR_removexattr	235 +#define __NR_lremovexattr	236 +#define __NR_fremovexattr	237 +#define __NR_tkill		238 +#define __NR_sendfile64		239 +#define __NR_futex		240 +#define __NR_sched_setaffinity	241 +#define __NR_sched_getaffinity	242 +#define __NR_set_thread_area	243 +#define __NR_get_thread_area	244 +#define __NR_io_setup		245 +#define __NR_io_destroy		246 +#define __NR_io_getevents	247 +#define __NR_io_submit		248 +#define __NR_io_cancel		249 +#define __NR_fadvise64		250 +/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */ +#define __NR_exit_group		252 +#define __NR_lookup_dcookie	253 +#define __NR_epoll_create	254 +#define __NR_epoll_ctl		255 +#define __NR_epoll_wait		256 +#define __NR_remap_file_pages	257 +#define __NR_set_tid_address	258 +#define __NR_timer_create	259 +#define __NR_timer_settime	(__NR_timer_create+1) +#define __NR_timer_gettime	(__NR_timer_create+2) +#define __NR_timer_getoverrun	(__NR_timer_create+3) +#define __NR_timer_delete	(__NR_timer_create+4) +#define __NR_clock_settime	(__NR_timer_create+5) +#define __NR_clock_gettime	(__NR_timer_create+6) +#define __NR_clock_getres	(__NR_timer_create+7) +#define __NR_clock_nanosleep	(__NR_timer_create+8) +#define __NR_statfs64		268 +#define __NR_fstatfs64		269 +#define __NR_tgkill		270 +#define __NR_utimes		271 +#define __NR_fadvise64_64	272 +#define __NR_vserver		273 +#define __NR_mbind		274 +#define __NR_get_mempolicy	275 +#define __NR_set_mempolicy	276 +#define __NR_mq_open		277 +#define __NR_mq_unlink		(__NR_mq_open+1) +#define __NR_mq_timedsend	(__NR_mq_open+2) +#define __NR_mq_timedreceive	(__NR_mq_open+3) +#define __NR_mq_notify		(__NR_mq_open+4) +#define __NR_mq_getsetattr	(__NR_mq_open+5) +#define __NR_kexec_load		283 +#define __NR_waitid		284 +/* #define __NR_sys_setaltroot	285 */ +#define __NR_add_key		286 +#define __NR_request_key	287 +#define __NR_keyctl		288 +#define __NR_ioprio_set		289 +#define __NR_ioprio_get		290 +#define __NR_inotify_init	291 +#define __NR_inotify_add_watch	292 +#define __NR_inotify_rm_watch	293 +#define __NR_migrate_pages	294 +#define __NR_openat		295 +#define __NR_mkdirat		296 +#define __NR_mknodat		297 +#define __NR_fchownat		298 +#define __NR_futimesat		299 +#define __NR_fstatat64		300 +#define __NR_unlinkat		301 +#define __NR_renameat		302 +#define __NR_linkat		303 +#define __NR_symlinkat		304 +#define __NR_readlinkat		305 +#define __NR_fchmodat		306 +#define __NR_faccessat		307 +#define __NR_pselect6		308 +#define __NR_ppoll		309 +#define __NR_unshare		310 +#define __NR_set_robust_list	311 +#define __NR_get_robust_list	312 +#define __NR_splice		313 +#define __NR_sync_file_range	314 +#define __NR_tee		315 +#define __NR_vmsplice		316 +#define __NR_move_pages		317 +#define __NR_getcpu		318 +#define __NR_epoll_pwait	319 +#define __NR_utimensat		320 +#define __NR_signalfd		321 +#define __NR_timerfd_create	322 +#define __NR_eventfd		323 +#define __NR_fallocate		324 +#define __NR_timerfd_settime	325 +#define __NR_timerfd_gettime	326 +#define __NR_signalfd4		327 +#define __NR_eventfd2		328 +#define __NR_epoll_create1	329 +#define __NR_dup3		330 +#define __NR_pipe2		331 +#define __NR_inotify_init1	332 +#define __NR_preadv		333 +#define __NR_pwritev		334 +#define __NR_setns		335 + +#endif /* _UAPI_ASM_CRIS_UNISTD_H_ */ diff --git a/arch/cris/kernel/asm-offsets.c b/arch/cris/kernel/asm-offsets.c index dd7b8e98322..a5fd88d816a 100644 --- a/arch/cris/kernel/asm-offsets.c +++ b/arch/cris/kernel/asm-offsets.c @@ -1,3 +1,4 @@ +#include <linux/kbuild.h>  #include <linux/sched.h>  #include <asm/thread_info.h> @@ -7,11 +8,6 @@   * and format the required data.   */ -#define DEFINE(sym, val) \ -	asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) -  #if !defined(CONFIG_ETRAX_ARCH_V10) && !defined(CONFIG_ETRAX_ARCH_V32)  #error One of ARCH v10 and ARCH v32 must be true!  #endif diff --git a/arch/cris/kernel/module.c b/arch/cris/kernel/module.c index 37400f5869e..51123f985eb 100644 --- a/arch/cris/kernel/module.c +++ b/arch/cris/kernel/module.c @@ -32,8 +32,6 @@  #ifdef CONFIG_ETRAX_KMALLOCED_MODULES  void *module_alloc(unsigned long size)  { -	if (size == 0) -		return NULL;  	return kmalloc(size, GFP_KERNEL);  } diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index df2eb4bd9fa..9d262645f66 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig @@ -12,8 +12,6 @@ config FRV  	select ARCH_HAVE_NMI_SAFE_CMPXCHG  	select GENERIC_CPU_DEVICES  	select ARCH_WANT_IPC_PARSE_VERSION -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  config ZONE_DMA  	bool diff --git a/arch/frv/include/asm/unistd.h b/arch/frv/include/asm/unistd.h index 1807d8ea8cb..d685da17f5f 100644 --- a/arch/frv/include/asm/unistd.h +++ b/arch/frv/include/asm/unistd.h @@ -29,7 +29,6 @@  #define __ARCH_WANT_SYS_SIGPROCMASK  #define __ARCH_WANT_SYS_RT_SIGACTION  #define __ARCH_WANT_SYS_RT_SIGSUSPEND -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_VFORK  #define __ARCH_WANT_SYS_CLONE diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c index 3cb3392f799..a5136474c6f 100644 --- a/arch/frv/kernel/setup.c +++ b/arch/frv/kernel/setup.c @@ -852,7 +852,7 @@ void __init setup_arch(char **cmdline_p)  /*   *   */ -static int __devinit setup_arch_serial(void) +static int setup_arch_serial(void)  {  	/* register those serial ports that are available */  #ifndef CONFIG_GDBSTUB_UART0 diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c index 71e9bcf5810..d186b254ce9 100644 --- a/arch/frv/mb93090-mb00/pci-vdk.c +++ b/arch/frv/mb93090-mb00/pci-vdk.c @@ -268,7 +268,7 @@ static void __init pci_fixup_umc_ide(struct pci_dev *d)  		d->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO;  } -static void __devinit pci_fixup_ide_bases(struct pci_dev *d) +static void pci_fixup_ide_bases(struct pci_dev *d)  {  	int i; @@ -287,7 +287,7 @@ static void __devinit pci_fixup_ide_bases(struct pci_dev *d)  	}  } -static void __devinit pci_fixup_ide_trash(struct pci_dev *d) +static void pci_fixup_ide_trash(struct pci_dev *d)  {  	int i; @@ -300,7 +300,7 @@ static void __devinit pci_fixup_ide_trash(struct pci_dev *d)  		d->resource[i].start = d->resource[i].end = d->resource[i].flags = 0;  } -static void __devinit  pci_fixup_latency(struct pci_dev *d) +static void pci_fixup_latency(struct pci_dev *d)  {  	/*  	 *  SiS 5597 and 5598 chipsets require latency timer set to diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index 04bef4d25b4..2d2efb653ee 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig @@ -3,13 +3,12 @@ config H8300  	default y  	select HAVE_IDE  	select HAVE_GENERIC_HARDIRQS +	select GENERIC_ATOMIC64  	select HAVE_UID16  	select ARCH_WANT_IPC_PARSE_VERSION  	select GENERIC_IRQ_SHOW  	select GENERIC_CPU_DEVICES  	select MODULES_USE_ELF_RELA -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  config SYMBOL_PREFIX  	string diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild index 4bc8ae73e08..995eb47e01b 100644 --- a/arch/h8300/include/asm/Kbuild +++ b/arch/h8300/include/asm/Kbuild @@ -1,6 +1,6 @@ -include include/asm-generic/Kbuild.asm  generic-y += clkdev.h  generic-y += exec.h +generic-y += mmu.h  generic-y += module.h  generic-y += trace_clock.h diff --git a/arch/h8300/include/asm/mmu.h b/arch/h8300/include/asm/mmu.h deleted file mode 100644 index 31309969df7..00000000000 --- a/arch/h8300/include/asm/mmu.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __MMU_H -#define __MMU_H - -/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */ - -typedef struct { -	unsigned long		end_brk; -} mm_context_t; - -#endif diff --git a/arch/h8300/include/asm/param.h b/arch/h8300/include/asm/param.h index 1c72fb8080f..c3909e7ff17 100644 --- a/arch/h8300/include/asm/param.h +++ b/arch/h8300/include/asm/param.h @@ -1,20 +1,9 @@  #ifndef _H8300_PARAM_H  #define _H8300_PARAM_H -#ifdef __KERNEL__ +#include <uapi/asm/param.h> +  #define HZ		CONFIG_HZ  #define	USER_HZ		HZ  #define	CLOCKS_PER_SEC	(USER_HZ) -#else -#define HZ		100 -#endif - -#define EXEC_PAGESIZE	4096 - -#ifndef NOGROUP -#define NOGROUP		(-1) -#endif - -#define MAXHOSTNAMELEN	64	/* max length of hostname */ -  #endif /* _H8300_PARAM_H */ diff --git a/arch/h8300/include/asm/ptrace.h b/arch/h8300/include/asm/ptrace.h index 7468589a128..c1826b95c5c 100644 --- a/arch/h8300/include/asm/ptrace.h +++ b/arch/h8300/include/asm/ptrace.h @@ -1,46 +1,11 @@  #ifndef _H8300_PTRACE_H  #define _H8300_PTRACE_H -#ifndef __ASSEMBLY__ - -#define PT_ER1	   0 -#define PT_ER2	   1 -#define PT_ER3	   2 -#define PT_ER4	   3 -#define PT_ER5	   4 -#define PT_ER6	   5 -#define PT_ER0	   6 -#define PT_ORIG_ER0	   7 -#define PT_CCR	   8 -#define PT_PC	   9 -#define PT_USP	   10 -#define PT_EXR     12 - -/* this struct defines the way the registers are stored on the -   stack during a system call. */ +#include <uapi/asm/ptrace.h> -struct pt_regs { -	long     retpc; -	long     er4; -	long     er5; -	long     er6; -	long     er3; -	long     er2; -	long     er1; -	long     orig_er0; -	unsigned short ccr; -	long     er0; -	long     vector; +#ifndef __ASSEMBLY__  #if defined(CONFIG_CPU_H8S) -	unsigned short exr;  #endif -	unsigned long  pc; -} __attribute__((aligned(2),packed)); - -#define PTRACE_GETREGS            12 -#define PTRACE_SETREGS            13 - -#ifdef __KERNEL__  #ifndef PS_S  #define PS_S  (0x10)  #endif @@ -63,6 +28,6 @@ struct pt_regs {  #define current_pt_regs() ((struct pt_regs *) \  	(THREAD_SIZE + (unsigned long)current_thread_info()) - 1)  #define signal_pt_regs() ((struct pt_regs *)current->thread.esp0) -#endif /* __KERNEL__ */ +#define current_user_stack_pointer() rdusp()  #endif /* __ASSEMBLY__ */  #endif /* _H8300_PTRACE_H */ diff --git a/arch/h8300/include/asm/signal.h b/arch/h8300/include/asm/signal.h index c43c0a7d2c2..66c81c67e55 100644 --- a/arch/h8300/include/asm/signal.h +++ b/arch/h8300/include/asm/signal.h @@ -1,12 +1,8 @@  #ifndef _H8300_SIGNAL_H  #define _H8300_SIGNAL_H -#include <linux/types.h> +#include <uapi/asm/signal.h> -/* Avoid too many header ordering problems.  */ -struct siginfo; - -#ifdef __KERNEL__  /* Most things should be clean enough to redefine this at will, if care     is taken to make libc match.  */ @@ -20,94 +16,6 @@ typedef struct {  	unsigned long sig[_NSIG_WORDS];  } sigset_t; -#else -/* Here we must cater to libcs that poke about in kernel headers.  */ - -#define NSIG		32 -typedef unsigned long sigset_t; - -#endif /* __KERNEL__ */ - -#define SIGHUP		 1 -#define SIGINT		 2 -#define SIGQUIT		 3 -#define SIGILL		 4 -#define SIGTRAP		 5 -#define SIGABRT		 6 -#define SIGIOT		 6 -#define SIGBUS		 7 -#define SIGFPE		 8 -#define SIGKILL		 9 -#define SIGUSR1		10 -#define SIGSEGV		11 -#define SIGUSR2		12 -#define SIGPIPE		13 -#define SIGALRM		14 -#define SIGTERM		15 -#define SIGSTKFLT	16 -#define SIGCHLD		17 -#define SIGCONT		18 -#define SIGSTOP		19 -#define SIGTSTP		20 -#define SIGTTIN		21 -#define SIGTTOU		22 -#define SIGURG		23 -#define SIGXCPU		24 -#define SIGXFSZ		25 -#define SIGVTALRM	26 -#define SIGPROF		27 -#define SIGWINCH	28 -#define SIGIO		29 -#define SIGPOLL		SIGIO -/* -#define SIGLOST		29 -*/ -#define SIGPWR		30 -#define SIGSYS		31 -#define	SIGUNUSED	31 - -/* These should not be considered constants from userland.  */ -#define SIGRTMIN	32 -#define SIGRTMAX	_NSIG - -/* - * SA_FLAGS values: - * - * SA_ONSTACK indicates that a registered stack_t will be used. - * SA_RESTART flag to get restarting signals (which were the default long ago) - * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. - * SA_RESETHAND clears the handler when the signal is delivered. - * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. - * SA_NODEFER prevents the current signal from being masked in the handler. - * - * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single - * Unix names RESETHAND and NODEFER respectively. - */ -#define SA_NOCLDSTOP	0x00000001 -#define SA_NOCLDWAIT	0x00000002 /* not supported yet */ -#define SA_SIGINFO	0x00000004 -#define SA_ONSTACK	0x08000000 -#define SA_RESTART	0x10000000 -#define SA_NODEFER	0x40000000 -#define SA_RESETHAND	0x80000000 - -#define SA_NOMASK	SA_NODEFER -#define SA_ONESHOT	SA_RESETHAND - -#define SA_RESTORER	0x04000000 - -/*  - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 - -#define MINSIGSTKSZ	2048 -#define SIGSTKSZ	8192 - -#include <asm-generic/signal-defs.h> - -#ifdef __KERNEL__  struct old_sigaction {  	__sighandler_t sa_handler;  	old_sigset_t sa_mask; @@ -125,35 +33,8 @@ struct sigaction {  struct k_sigaction {  	struct sigaction sa;  }; -#else -/* Here we must cater to libcs that poke about in kernel headers.  */ - -struct sigaction { -	union { -	  __sighandler_t _sa_handler; -	  void (*_sa_sigaction)(int, struct siginfo *, void *); -	} _u; -	sigset_t sa_mask; -	unsigned long sa_flags; -	void (*sa_restorer)(void); -}; - -#define sa_handler	_u._sa_handler -#define sa_sigaction	_u._sa_sigaction - -#endif /* __KERNEL__ */ - -typedef struct sigaltstack { -	void *ss_sp; -	int ss_flags; -	size_t ss_size; -} stack_t; - -#ifdef __KERNEL__  #include <asm/sigcontext.h>  #undef __HAVE_ARCH_SIG_BITOPS -#endif /* __KERNEL__ */ -  #endif /* _H8300_SIGNAL_H */ diff --git a/arch/h8300/include/asm/termios.h b/arch/h8300/include/asm/termios.h index 70eea64b421..93a63df5624 100644 --- a/arch/h8300/include/asm/termios.h +++ b/arch/h8300/include/asm/termios.h @@ -1,27 +1,8 @@  #ifndef _H8300_TERMIOS_H  #define _H8300_TERMIOS_H -#include <asm/termbits.h> -#include <asm/ioctls.h> -  -struct winsize { -	unsigned short ws_row; -	unsigned short ws_col; -	unsigned short ws_xpixel; -	unsigned short ws_ypixel; -}; +#include <uapi/asm/termios.h> -#define NCC 8 -struct termio { -	unsigned short c_iflag;		/* input mode flags */ -	unsigned short c_oflag;		/* output mode flags */ -	unsigned short c_cflag;		/* control mode flags */ -	unsigned short c_lflag;		/* local mode flags */ -	unsigned char c_line;		/* line discipline */ -	unsigned char c_cc[NCC];	/* control characters */ -}; - -#ifdef __KERNEL__  /*	intr=^C		quit=^|		erase=del	kill=^U  	eof=^D		vtime=\0	vmin=\1		sxtc=\0  	start=^Q	stop=^S		susp=^Z		eol=\0 @@ -29,27 +10,6 @@ struct termio {  	eol2=\0  */  #define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" -#endif - -/* modem lines */ -#define TIOCM_LE	0x001 -#define TIOCM_DTR	0x002 -#define TIOCM_RTS	0x004 -#define TIOCM_ST	0x008 -#define TIOCM_SR	0x010 -#define TIOCM_CTS	0x020 -#define TIOCM_CAR	0x040 -#define TIOCM_RNG	0x080 -#define TIOCM_DSR	0x100 -#define TIOCM_CD	TIOCM_CAR -#define TIOCM_RI	TIOCM_RNG -#define TIOCM_OUT1	0x2000 -#define TIOCM_OUT2	0x4000 -#define TIOCM_LOOP	0x8000 - -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ - -#ifdef __KERNEL__  /*   * Translate a "termio" structure into a "termios". Ugh. @@ -87,6 +47,4 @@ struct termio {  #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))  #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) -#endif	/* __KERNEL__ */ -  #endif /* _H8300_TERMIOS_H */ diff --git a/arch/h8300/include/asm/types.h b/arch/h8300/include/asm/types.h index 07257d9487d..c012707f603 100644 --- a/arch/h8300/include/asm/types.h +++ b/arch/h8300/include/asm/types.h @@ -1,12 +1,9 @@  #ifndef _H8300_TYPES_H  #define _H8300_TYPES_H -#include <asm-generic/int-ll64.h> +#include <uapi/asm/types.h> -#ifdef __KERNEL__  #define BITS_PER_LONG 32 -#endif /* __KERNEL__ */ -  #endif /* _H8300_TYPES_H */ diff --git a/arch/h8300/include/asm/unistd.h b/arch/h8300/include/asm/unistd.h index c2c2f5c7d6b..aa38105959f 100644 --- a/arch/h8300/include/asm/unistd.h +++ b/arch/h8300/include/asm/unistd.h @@ -1,333 +1,8 @@  #ifndef _ASM_H8300_UNISTD_H_  #define _ASM_H8300_UNISTD_H_ -/* - * This file contains the system call numbers. - */ - -#define __NR_restart_syscall      0 -#define __NR_exit		  1 -#define __NR_fork		  2 -#define __NR_read		  3 -#define __NR_write		  4 -#define __NR_open		  5 -#define __NR_close		  6 -#define __NR_waitpid		  7 -#define __NR_creat		  8 -#define __NR_link		  9 -#define __NR_unlink		 10 -#define __NR_execve		 11 -#define __NR_chdir		 12 -#define __NR_time		 13 -#define __NR_mknod		 14 -#define __NR_chmod		 15 -#define __NR_lchown		 16 -#define __NR_break		 17 -#define __NR_oldstat		 18 -#define __NR_lseek		 19 -#define __NR_getpid		 20 -#define __NR_mount		 21 -#define __NR_umount		 22 -#define __NR_setuid		 23 -#define __NR_getuid		 24 -#define __NR_stime		 25 -#define __NR_ptrace		 26 -#define __NR_alarm		 27 -#define __NR_oldfstat		 28 -#define __NR_pause		 29 -#define __NR_utime		 30 -#define __NR_stty		 31 -#define __NR_gtty		 32 -#define __NR_access		 33 -#define __NR_nice		 34 -#define __NR_ftime		 35 -#define __NR_sync		 36 -#define __NR_kill		 37 -#define __NR_rename		 38 -#define __NR_mkdir		 39 -#define __NR_rmdir		 40 -#define __NR_dup		 41 -#define __NR_pipe		 42 -#define __NR_times		 43 -#define __NR_prof		 44 -#define __NR_brk		 45 -#define __NR_setgid		 46 -#define __NR_getgid		 47 -#define __NR_signal		 48 -#define __NR_geteuid		 49 -#define __NR_getegid		 50 -#define __NR_acct		 51 -#define __NR_umount2		 52 -#define __NR_lock		 53 -#define __NR_ioctl		 54 -#define __NR_fcntl		 55 -#define __NR_mpx		 56 -#define __NR_setpgid		 57 -#define __NR_ulimit		 58 -#define __NR_oldolduname	 59 -#define __NR_umask		 60 -#define __NR_chroot		 61 -#define __NR_ustat		 62 -#define __NR_dup2		 63 -#define __NR_getppid		 64 -#define __NR_getpgrp		 65 -#define __NR_setsid		 66 -#define __NR_sigaction		 67 -#define __NR_sgetmask		 68 -#define __NR_ssetmask		 69 -#define __NR_setreuid		 70 -#define __NR_setregid		 71 -#define __NR_sigsuspend		 72 -#define __NR_sigpending		 73 -#define __NR_sethostname	 74 -#define __NR_setrlimit		 75 -#define __NR_getrlimit		 76 -#define __NR_getrusage		 77 -#define __NR_gettimeofday	 78 -#define __NR_settimeofday	 79 -#define __NR_getgroups		 80 -#define __NR_setgroups		 81 -#define __NR_select		 82 -#define __NR_symlink		 83 -#define __NR_oldlstat		 84 -#define __NR_readlink		 85 -#define __NR_uselib		 86 -#define __NR_swapon		 87 -#define __NR_reboot		 88 -#define __NR_readdir		 89 -#define __NR_mmap		 90 -#define __NR_munmap		 91 -#define __NR_truncate		 92 -#define __NR_ftruncate		 93 -#define __NR_fchmod		 94 -#define __NR_fchown		 95 -#define __NR_getpriority	 96 -#define __NR_setpriority	 97 -#define __NR_profil		 98 -#define __NR_statfs		 99 -#define __NR_fstatfs		100 -#define __NR_ioperm		101 -#define __NR_socketcall		102 -#define __NR_syslog		103 -#define __NR_setitimer		104 -#define __NR_getitimer		105 -#define __NR_stat		106 -#define __NR_lstat		107 -#define __NR_fstat		108 -#define __NR_olduname		109 -#define __NR_iopl		110 -#define __NR_vhangup		111 -#define __NR_idle		112 -#define __NR_vm86old		113 -#define __NR_wait4		114 -#define __NR_swapoff		115 -#define __NR_sysinfo		116 -#define __NR_ipc		117 -#define __NR_fsync		118 -#define __NR_sigreturn		119 -#define __NR_clone		120 -#define __NR_setdomainname	121 -#define __NR_uname		122 -#define __NR_modify_ldt		123 -#define __NR_adjtimex		124 -#define __NR_mprotect		125 -#define __NR_sigprocmask	126 -#define __NR_create_module	127 -#define __NR_init_module	128 -#define __NR_delete_module	129 -#define __NR_get_kernel_syms	130 -#define __NR_quotactl		131 -#define __NR_getpgid		132 -#define __NR_fchdir		133 -#define __NR_bdflush		134 -#define __NR_sysfs		135 -#define __NR_personality	136 -#define __NR_afs_syscall	137 /* Syscall for Andrew File System */ -#define __NR_setfsuid		138 -#define __NR_setfsgid		139 -#define __NR__llseek		140 -#define __NR_getdents		141 -#define __NR__newselect		142 -#define __NR_flock		143 -#define __NR_msync		144 -#define __NR_readv		145 -#define __NR_writev		146 -#define __NR_getsid		147 -#define __NR_fdatasync		148 -#define __NR__sysctl		149 -#define __NR_mlock		150 -#define __NR_munlock		151 -#define __NR_mlockall		152 -#define __NR_munlockall		153 -#define __NR_sched_setparam		154 -#define __NR_sched_getparam		155 -#define __NR_sched_setscheduler		156 -#define __NR_sched_getscheduler		157 -#define __NR_sched_yield		158 -#define __NR_sched_get_priority_max	159 -#define __NR_sched_get_priority_min	160 -#define __NR_sched_rr_get_interval	161 -#define __NR_nanosleep		162 -#define __NR_mremap		163 -#define __NR_setresuid		164 -#define __NR_getresuid		165 -#define __NR_vm86		166 -#define __NR_query_module	167 -#define __NR_poll		168 -#define __NR_nfsservctl		169 -#define __NR_setresgid		170 -#define __NR_getresgid		171 -#define __NR_prctl		172 -#define __NR_rt_sigreturn	173 -#define __NR_rt_sigaction	174 -#define __NR_rt_sigprocmask	175 -#define __NR_rt_sigpending	176 -#define __NR_rt_sigtimedwait	177 -#define __NR_rt_sigqueueinfo	178 -#define __NR_rt_sigsuspend	179 -#define __NR_pread64		180 -#define __NR_pwrite64		181 -#define __NR_chown		182 -#define __NR_getcwd		183 -#define __NR_capget		184 -#define __NR_capset		185 -#define __NR_sigaltstack	186 -#define __NR_sendfile		187 -#define __NR_getpmsg		188	/* some people actually want streams */ -#define __NR_putpmsg		189	/* some people actually want streams */ -#define __NR_vfork		190 -#define __NR_ugetrlimit		191 -#define __NR_mmap2		192 -#define __NR_truncate64		193 -#define __NR_ftruncate64	194 -#define __NR_stat64		195 -#define __NR_lstat64		196 -#define __NR_fstat64		197 -#define __NR_lchown32		198 -#define __NR_getuid32		199 -#define __NR_getgid32		200 -#define __NR_geteuid32		201 -#define __NR_getegid32		202 -#define __NR_setreuid32		203 -#define __NR_setregid32		204 -#define __NR_getgroups32	205 -#define __NR_setgroups32	206 -#define __NR_fchown32		207 -#define __NR_setresuid32	208 -#define __NR_getresuid32	209 -#define __NR_setresgid32	210 -#define __NR_getresgid32	211 -#define __NR_chown32		212 -#define __NR_setuid32		213 -#define __NR_setgid32		214 -#define __NR_setfsuid32		215 -#define __NR_setfsgid32		216 -#define __NR_pivot_root		217 -#define __NR_mincore		218 -#define __NR_madvise		219 -#define __NR_madvise1		219 -#define __NR_getdents64		220 -#define __NR_fcntl64		221 -/* 223 is unused */ -#define __NR_gettid		224 -#define __NR_readahead		225 -#define __NR_setxattr		226 -#define __NR_lsetxattr		227 -#define __NR_fsetxattr		228 -#define __NR_getxattr		229 -#define __NR_lgetxattr		230 -#define __NR_fgetxattr		231 -#define __NR_listxattr		232 -#define __NR_llistxattr		233 -#define __NR_flistxattr		234 -#define __NR_removexattr	235 -#define __NR_lremovexattr	236 -#define __NR_fremovexattr	237 -#define __NR_tkill		238 -#define __NR_sendfile64		239 -#define __NR_futex		240 -#define __NR_sched_setaffinity	241 -#define __NR_sched_getaffinity	242 -#define __NR_set_thread_area	243 -#define __NR_get_thread_area	244 -#define __NR_io_setup		245 -#define __NR_io_destroy		246 -#define __NR_io_getevents	247 -#define __NR_io_submit		248 -#define __NR_io_cancel		249 -#define __NR_fadvise64		250 -/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */ -#define __NR_exit_group		252 -#define __NR_lookup_dcookie	253 -#define __NR_epoll_create	254 -#define __NR_epoll_ctl		255 -#define __NR_epoll_wait		256 -#define __NR_remap_file_pages	257 -#define __NR_set_tid_address	258 -#define __NR_timer_create	259 -#define __NR_timer_settime	(__NR_timer_create+1) -#define __NR_timer_gettime	(__NR_timer_create+2) -#define __NR_timer_getoverrun	(__NR_timer_create+3) -#define __NR_timer_delete	(__NR_timer_create+4) -#define __NR_clock_settime	(__NR_timer_create+5) -#define __NR_clock_gettime	(__NR_timer_create+6) -#define __NR_clock_getres	(__NR_timer_create+7) -#define __NR_clock_nanosleep	(__NR_timer_create+8) -#define __NR_statfs64		268 -#define __NR_fstatfs64		269 -#define __NR_tgkill		270 -#define __NR_utimes		271 -#define __NR_fadvise64_64	272 -#define __NR_vserver		273 -#define __NR_mbind		274 -#define __NR_get_mempolicy	275 -#define __NR_set_mempolicy	276 -#define __NR_mq_open 		277 -#define __NR_mq_unlink		(__NR_mq_open+1) -#define __NR_mq_timedsend	(__NR_mq_open+2) -#define __NR_mq_timedreceive	(__NR_mq_open+3) -#define __NR_mq_notify		(__NR_mq_open+4) -#define __NR_mq_getsetattr	(__NR_mq_open+5) -#define __NR_kexec_load		283 -#define __NR_waitid		284 -/* #define __NR_sys_setaltroot	285 */ -#define __NR_add_key		286 -#define __NR_request_key	287 -#define __NR_keyctl		288 -#define __NR_ioprio_set		289 -#define __NR_ioprio_get		290 -#define __NR_inotify_init	291 -#define __NR_inotify_add_watch	292 -#define __NR_inotify_rm_watch	293 -#define __NR_migrate_pages	294 -#define __NR_openat		295 -#define __NR_mkdirat		296 -#define __NR_mknodat		297 -#define __NR_fchownat		298 -#define __NR_futimesat		299 -#define __NR_fstatat64		300 -#define __NR_unlinkat		301 -#define __NR_renameat		302 -#define __NR_linkat		303 -#define __NR_symlinkat		304 -#define __NR_readlinkat		305 -#define __NR_fchmodat		306 -#define __NR_faccessat		307 -#define __NR_pselect6		308 -#define __NR_ppoll		309 -#define __NR_unshare		310 -#define __NR_set_robust_list	311 -#define __NR_get_robust_list	312 -#define __NR_splice		313 -#define __NR_sync_file_range	314 -#define __NR_tee		315 -#define __NR_vmsplice		316 -#define __NR_move_pages		317 -#define __NR_getcpu		318 -#define __NR_epoll_pwait	319 -#define __NR_setns		320 +#include <uapi/asm/unistd.h> -#ifdef __KERNEL__  #define NR_syscalls 321 @@ -356,7 +31,6 @@  #define __ARCH_WANT_SYS_SIGPROCMASK  #define __ARCH_WANT_SYS_RT_SIGACTION  #define __ARCH_WANT_SYS_RT_SIGSUSPEND -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_VFORK  #define __ARCH_WANT_SYS_CLONE @@ -368,5 +42,4 @@    asm (".weak\t_" #name "\n"				\         ".set\t_" #name ",_sys_ni_syscall"); -#endif /* __KERNEL__ */  #endif /* _ASM_H8300_UNISTD_H_ */ diff --git a/arch/h8300/include/uapi/asm/Kbuild b/arch/h8300/include/uapi/asm/Kbuild index baebb3da1d4..040178cdb3e 100644 --- a/arch/h8300/include/uapi/asm/Kbuild +++ b/arch/h8300/include/uapi/asm/Kbuild @@ -1,3 +1,34 @@  # UAPI Header export list  include include/uapi/asm-generic/Kbuild.asm +header-y += auxvec.h +header-y += bitsperlong.h +header-y += byteorder.h +header-y += errno.h +header-y += fcntl.h +header-y += ioctl.h +header-y += ioctls.h +header-y += ipcbuf.h +header-y += kvm_para.h +header-y += mman.h +header-y += msgbuf.h +header-y += param.h +header-y += poll.h +header-y += posix_types.h +header-y += ptrace.h +header-y += resource.h +header-y += sembuf.h +header-y += setup.h +header-y += shmbuf.h +header-y += sigcontext.h +header-y += siginfo.h +header-y += signal.h +header-y += socket.h +header-y += sockios.h +header-y += stat.h +header-y += statfs.h +header-y += swab.h +header-y += termbits.h +header-y += termios.h +header-y += types.h +header-y += unistd.h diff --git a/arch/h8300/include/asm/auxvec.h b/arch/h8300/include/uapi/asm/auxvec.h index 1d36fe38b08..1d36fe38b08 100644 --- a/arch/h8300/include/asm/auxvec.h +++ b/arch/h8300/include/uapi/asm/auxvec.h diff --git a/arch/h8300/include/asm/bitsperlong.h b/arch/h8300/include/uapi/asm/bitsperlong.h index 6dc0bb0c13b..6dc0bb0c13b 100644 --- a/arch/h8300/include/asm/bitsperlong.h +++ b/arch/h8300/include/uapi/asm/bitsperlong.h diff --git a/arch/h8300/include/asm/byteorder.h b/arch/h8300/include/uapi/asm/byteorder.h index 13539da99ef..13539da99ef 100644 --- a/arch/h8300/include/asm/byteorder.h +++ b/arch/h8300/include/uapi/asm/byteorder.h diff --git a/arch/h8300/include/asm/errno.h b/arch/h8300/include/uapi/asm/errno.h index 0c2f5641fdc..0c2f5641fdc 100644 --- a/arch/h8300/include/asm/errno.h +++ b/arch/h8300/include/uapi/asm/errno.h diff --git a/arch/h8300/include/asm/fcntl.h b/arch/h8300/include/uapi/asm/fcntl.h index 1952cb2e3b0..1952cb2e3b0 100644 --- a/arch/h8300/include/asm/fcntl.h +++ b/arch/h8300/include/uapi/asm/fcntl.h diff --git a/arch/h8300/include/asm/ioctl.h b/arch/h8300/include/uapi/asm/ioctl.h index b279fe06dfe..b279fe06dfe 100644 --- a/arch/h8300/include/asm/ioctl.h +++ b/arch/h8300/include/uapi/asm/ioctl.h diff --git a/arch/h8300/include/asm/ioctls.h b/arch/h8300/include/uapi/asm/ioctls.h index 30eaed2facd..30eaed2facd 100644 --- a/arch/h8300/include/asm/ioctls.h +++ b/arch/h8300/include/uapi/asm/ioctls.h diff --git a/arch/h8300/include/asm/ipcbuf.h b/arch/h8300/include/uapi/asm/ipcbuf.h index 84c7e51cb6d..84c7e51cb6d 100644 --- a/arch/h8300/include/asm/ipcbuf.h +++ b/arch/h8300/include/uapi/asm/ipcbuf.h diff --git a/arch/blackfin/include/asm/kvm_para.h b/arch/h8300/include/uapi/asm/kvm_para.h index 14fab8f0b95..14fab8f0b95 100644 --- a/arch/blackfin/include/asm/kvm_para.h +++ b/arch/h8300/include/uapi/asm/kvm_para.h diff --git a/arch/h8300/include/asm/mman.h b/arch/h8300/include/uapi/asm/mman.h index 8eebf89f5ab..8eebf89f5ab 100644 --- a/arch/h8300/include/asm/mman.h +++ b/arch/h8300/include/uapi/asm/mman.h diff --git a/arch/h8300/include/asm/msgbuf.h b/arch/h8300/include/uapi/asm/msgbuf.h index 6b148cd09aa..6b148cd09aa 100644 --- a/arch/h8300/include/asm/msgbuf.h +++ b/arch/h8300/include/uapi/asm/msgbuf.h diff --git a/arch/h8300/include/uapi/asm/param.h b/arch/h8300/include/uapi/asm/param.h new file mode 100644 index 00000000000..3dd18ae15f0 --- /dev/null +++ b/arch/h8300/include/uapi/asm/param.h @@ -0,0 +1,16 @@ +#ifndef _UAPI_H8300_PARAM_H +#define _UAPI_H8300_PARAM_H + +#ifndef __KERNEL__ +#define HZ		100 +#endif + +#define EXEC_PAGESIZE	4096 + +#ifndef NOGROUP +#define NOGROUP		(-1) +#endif + +#define MAXHOSTNAMELEN	64	/* max length of hostname */ + +#endif /* _UAPI_H8300_PARAM_H */ diff --git a/arch/h8300/include/asm/poll.h b/arch/h8300/include/uapi/asm/poll.h index f61540c22d9..f61540c22d9 100644 --- a/arch/h8300/include/asm/poll.h +++ b/arch/h8300/include/uapi/asm/poll.h diff --git a/arch/h8300/include/asm/posix_types.h b/arch/h8300/include/uapi/asm/posix_types.h index 91e62ba4c7b..91e62ba4c7b 100644 --- a/arch/h8300/include/asm/posix_types.h +++ b/arch/h8300/include/uapi/asm/posix_types.h diff --git a/arch/h8300/include/uapi/asm/ptrace.h b/arch/h8300/include/uapi/asm/ptrace.h new file mode 100644 index 00000000000..ef39ec5977b --- /dev/null +++ b/arch/h8300/include/uapi/asm/ptrace.h @@ -0,0 +1,44 @@ +#ifndef _UAPI_H8300_PTRACE_H +#define _UAPI_H8300_PTRACE_H + +#ifndef __ASSEMBLY__ + +#define PT_ER1	   0 +#define PT_ER2	   1 +#define PT_ER3	   2 +#define PT_ER4	   3 +#define PT_ER5	   4 +#define PT_ER6	   5 +#define PT_ER0	   6 +#define PT_ORIG_ER0	   7 +#define PT_CCR	   8 +#define PT_PC	   9 +#define PT_USP	   10 +#define PT_EXR     12 + +/* this struct defines the way the registers are stored on the +   stack during a system call. */ + +struct pt_regs { +	long     retpc; +	long     er4; +	long     er5; +	long     er6; +	long     er3; +	long     er2; +	long     er1; +	long     orig_er0; +	unsigned short ccr; +	long     er0; +	long     vector; +#if defined(CONFIG_CPU_H8S) +	unsigned short exr; +#endif +	unsigned long  pc; +} __attribute__((aligned(2),packed)); + +#define PTRACE_GETREGS            12 +#define PTRACE_SETREGS            13 + +#endif /* __ASSEMBLY__ */ +#endif /* _UAPI_H8300_PTRACE_H */ diff --git a/arch/h8300/include/asm/resource.h b/arch/h8300/include/uapi/asm/resource.h index 46c5f439160..46c5f439160 100644 --- a/arch/h8300/include/asm/resource.h +++ b/arch/h8300/include/uapi/asm/resource.h diff --git a/arch/h8300/include/asm/sembuf.h b/arch/h8300/include/uapi/asm/sembuf.h index e04a3ec0cb9..e04a3ec0cb9 100644 --- a/arch/h8300/include/asm/sembuf.h +++ b/arch/h8300/include/uapi/asm/sembuf.h diff --git a/arch/h8300/include/asm/setup.h b/arch/h8300/include/uapi/asm/setup.h index e2c600e9673..e2c600e9673 100644 --- a/arch/h8300/include/asm/setup.h +++ b/arch/h8300/include/uapi/asm/setup.h diff --git a/arch/h8300/include/asm/shmbuf.h b/arch/h8300/include/uapi/asm/shmbuf.h index 64e77993a7a..64e77993a7a 100644 --- a/arch/h8300/include/asm/shmbuf.h +++ b/arch/h8300/include/uapi/asm/shmbuf.h diff --git a/arch/h8300/include/asm/sigcontext.h b/arch/h8300/include/uapi/asm/sigcontext.h index e4b81505f8f..e4b81505f8f 100644 --- a/arch/h8300/include/asm/sigcontext.h +++ b/arch/h8300/include/uapi/asm/sigcontext.h diff --git a/arch/h8300/include/asm/siginfo.h b/arch/h8300/include/uapi/asm/siginfo.h index bc8fbea931a..bc8fbea931a 100644 --- a/arch/h8300/include/asm/siginfo.h +++ b/arch/h8300/include/uapi/asm/siginfo.h diff --git a/arch/h8300/include/uapi/asm/signal.h b/arch/h8300/include/uapi/asm/signal.h new file mode 100644 index 00000000000..af3a6c37fee --- /dev/null +++ b/arch/h8300/include/uapi/asm/signal.h @@ -0,0 +1,115 @@ +#ifndef _UAPI_H8300_SIGNAL_H +#define _UAPI_H8300_SIGNAL_H + +#include <linux/types.h> + +/* Avoid too many header ordering problems.  */ +struct siginfo; + +#ifndef __KERNEL__ +/* Here we must cater to libcs that poke about in kernel headers.  */ + +#define NSIG		32 +typedef unsigned long sigset_t; + +#endif /* __KERNEL__ */ + +#define SIGHUP		 1 +#define SIGINT		 2 +#define SIGQUIT		 3 +#define SIGILL		 4 +#define SIGTRAP		 5 +#define SIGABRT		 6 +#define SIGIOT		 6 +#define SIGBUS		 7 +#define SIGFPE		 8 +#define SIGKILL		 9 +#define SIGUSR1		10 +#define SIGSEGV		11 +#define SIGUSR2		12 +#define SIGPIPE		13 +#define SIGALRM		14 +#define SIGTERM		15 +#define SIGSTKFLT	16 +#define SIGCHLD		17 +#define SIGCONT		18 +#define SIGSTOP		19 +#define SIGTSTP		20 +#define SIGTTIN		21 +#define SIGTTOU		22 +#define SIGURG		23 +#define SIGXCPU		24 +#define SIGXFSZ		25 +#define SIGVTALRM	26 +#define SIGPROF		27 +#define SIGWINCH	28 +#define SIGIO		29 +#define SIGPOLL		SIGIO +/* +#define SIGLOST		29 +*/ +#define SIGPWR		30 +#define SIGSYS		31 +#define	SIGUNUSED	31 + +/* These should not be considered constants from userland.  */ +#define SIGRTMIN	32 +#define SIGRTMAX	_NSIG + +/* + * SA_FLAGS values: + * + * SA_ONSTACK indicates that a registered stack_t will be used. + * SA_RESTART flag to get restarting signals (which were the default long ago) + * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. + * SA_RESETHAND clears the handler when the signal is delivered. + * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. + * SA_NODEFER prevents the current signal from being masked in the handler. + * + * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single + * Unix names RESETHAND and NODEFER respectively. + */ +#define SA_NOCLDSTOP	0x00000001 +#define SA_NOCLDWAIT	0x00000002 /* not supported yet */ +#define SA_SIGINFO	0x00000004 +#define SA_ONSTACK	0x08000000 +#define SA_RESTART	0x10000000 +#define SA_NODEFER	0x40000000 +#define SA_RESETHAND	0x80000000 + +#define SA_NOMASK	SA_NODEFER +#define SA_ONESHOT	SA_RESETHAND + +#define SA_RESTORER	0x04000000 + +#define MINSIGSTKSZ	2048 +#define SIGSTKSZ	8192 + +#include <asm-generic/signal-defs.h> + +#ifndef __KERNEL__ +/* Here we must cater to libcs that poke about in kernel headers.  */ + +struct sigaction { +	union { +	  __sighandler_t _sa_handler; +	  void (*_sa_sigaction)(int, struct siginfo *, void *); +	} _u; +	sigset_t sa_mask; +	unsigned long sa_flags; +	void (*sa_restorer)(void); +}; + +#define sa_handler	_u._sa_handler +#define sa_sigaction	_u._sa_sigaction + +#endif /* __KERNEL__ */ + +typedef struct sigaltstack { +	void *ss_sp; +	int ss_flags; +	size_t ss_size; +} stack_t; + + +#endif /* _UAPI_H8300_SIGNAL_H */ diff --git a/arch/h8300/include/asm/socket.h b/arch/h8300/include/uapi/asm/socket.h index 90a2e573c7e..90a2e573c7e 100644 --- a/arch/h8300/include/asm/socket.h +++ b/arch/h8300/include/uapi/asm/socket.h diff --git a/arch/h8300/include/asm/sockios.h b/arch/h8300/include/uapi/asm/sockios.h index e9c7ec810c2..e9c7ec810c2 100644 --- a/arch/h8300/include/asm/sockios.h +++ b/arch/h8300/include/uapi/asm/sockios.h diff --git a/arch/h8300/include/asm/stat.h b/arch/h8300/include/uapi/asm/stat.h index 62c3cc24dfe..62c3cc24dfe 100644 --- a/arch/h8300/include/asm/stat.h +++ b/arch/h8300/include/uapi/asm/stat.h diff --git a/arch/h8300/include/asm/statfs.h b/arch/h8300/include/uapi/asm/statfs.h index b96efa712aa..b96efa712aa 100644 --- a/arch/h8300/include/asm/statfs.h +++ b/arch/h8300/include/uapi/asm/statfs.h diff --git a/arch/h8300/include/asm/swab.h b/arch/h8300/include/uapi/asm/swab.h index 39abbf52807..39abbf52807 100644 --- a/arch/h8300/include/asm/swab.h +++ b/arch/h8300/include/uapi/asm/swab.h diff --git a/arch/h8300/include/asm/termbits.h b/arch/h8300/include/uapi/asm/termbits.h index 3287a6244d7..3287a6244d7 100644 --- a/arch/h8300/include/asm/termbits.h +++ b/arch/h8300/include/uapi/asm/termbits.h diff --git a/arch/h8300/include/uapi/asm/termios.h b/arch/h8300/include/uapi/asm/termios.h new file mode 100644 index 00000000000..5a67d7e3884 --- /dev/null +++ b/arch/h8300/include/uapi/asm/termios.h @@ -0,0 +1,44 @@ +#ifndef _UAPI_H8300_TERMIOS_H +#define _UAPI_H8300_TERMIOS_H + +#include <asm/termbits.h> +#include <asm/ioctls.h> +  +struct winsize { +	unsigned short ws_row; +	unsigned short ws_col; +	unsigned short ws_xpixel; +	unsigned short ws_ypixel; +}; + +#define NCC 8 +struct termio { +	unsigned short c_iflag;		/* input mode flags */ +	unsigned short c_oflag;		/* output mode flags */ +	unsigned short c_cflag;		/* control mode flags */ +	unsigned short c_lflag;		/* local mode flags */ +	unsigned char c_line;		/* line discipline */ +	unsigned char c_cc[NCC];	/* control characters */ +}; + + +/* modem lines */ +#define TIOCM_LE	0x001 +#define TIOCM_DTR	0x002 +#define TIOCM_RTS	0x004 +#define TIOCM_ST	0x008 +#define TIOCM_SR	0x010 +#define TIOCM_CTS	0x020 +#define TIOCM_CAR	0x040 +#define TIOCM_RNG	0x080 +#define TIOCM_DSR	0x100 +#define TIOCM_CD	TIOCM_CAR +#define TIOCM_RI	TIOCM_RNG +#define TIOCM_OUT1	0x2000 +#define TIOCM_OUT2	0x4000 +#define TIOCM_LOOP	0x8000 + +/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ + + +#endif /* _UAPI_H8300_TERMIOS_H */ diff --git a/arch/h8300/include/uapi/asm/types.h b/arch/h8300/include/uapi/asm/types.h new file mode 100644 index 00000000000..9ec9d4c5ac4 --- /dev/null +++ b/arch/h8300/include/uapi/asm/types.h @@ -0,0 +1 @@ +#include <asm-generic/int-ll64.h> diff --git a/arch/h8300/include/uapi/asm/unistd.h b/arch/h8300/include/uapi/asm/unistd.h new file mode 100644 index 00000000000..8cb5d429f84 --- /dev/null +++ b/arch/h8300/include/uapi/asm/unistd.h @@ -0,0 +1,330 @@ +#ifndef _UAPI_ASM_H8300_UNISTD_H_ +#define _UAPI_ASM_H8300_UNISTD_H_ + +/* + * This file contains the system call numbers. + */ + +#define __NR_restart_syscall      0 +#define __NR_exit		  1 +#define __NR_fork		  2 +#define __NR_read		  3 +#define __NR_write		  4 +#define __NR_open		  5 +#define __NR_close		  6 +#define __NR_waitpid		  7 +#define __NR_creat		  8 +#define __NR_link		  9 +#define __NR_unlink		 10 +#define __NR_execve		 11 +#define __NR_chdir		 12 +#define __NR_time		 13 +#define __NR_mknod		 14 +#define __NR_chmod		 15 +#define __NR_lchown		 16 +#define __NR_break		 17 +#define __NR_oldstat		 18 +#define __NR_lseek		 19 +#define __NR_getpid		 20 +#define __NR_mount		 21 +#define __NR_umount		 22 +#define __NR_setuid		 23 +#define __NR_getuid		 24 +#define __NR_stime		 25 +#define __NR_ptrace		 26 +#define __NR_alarm		 27 +#define __NR_oldfstat		 28 +#define __NR_pause		 29 +#define __NR_utime		 30 +#define __NR_stty		 31 +#define __NR_gtty		 32 +#define __NR_access		 33 +#define __NR_nice		 34 +#define __NR_ftime		 35 +#define __NR_sync		 36 +#define __NR_kill		 37 +#define __NR_rename		 38 +#define __NR_mkdir		 39 +#define __NR_rmdir		 40 +#define __NR_dup		 41 +#define __NR_pipe		 42 +#define __NR_times		 43 +#define __NR_prof		 44 +#define __NR_brk		 45 +#define __NR_setgid		 46 +#define __NR_getgid		 47 +#define __NR_signal		 48 +#define __NR_geteuid		 49 +#define __NR_getegid		 50 +#define __NR_acct		 51 +#define __NR_umount2		 52 +#define __NR_lock		 53 +#define __NR_ioctl		 54 +#define __NR_fcntl		 55 +#define __NR_mpx		 56 +#define __NR_setpgid		 57 +#define __NR_ulimit		 58 +#define __NR_oldolduname	 59 +#define __NR_umask		 60 +#define __NR_chroot		 61 +#define __NR_ustat		 62 +#define __NR_dup2		 63 +#define __NR_getppid		 64 +#define __NR_getpgrp		 65 +#define __NR_setsid		 66 +#define __NR_sigaction		 67 +#define __NR_sgetmask		 68 +#define __NR_ssetmask		 69 +#define __NR_setreuid		 70 +#define __NR_setregid		 71 +#define __NR_sigsuspend		 72 +#define __NR_sigpending		 73 +#define __NR_sethostname	 74 +#define __NR_setrlimit		 75 +#define __NR_getrlimit		 76 +#define __NR_getrusage		 77 +#define __NR_gettimeofday	 78 +#define __NR_settimeofday	 79 +#define __NR_getgroups		 80 +#define __NR_setgroups		 81 +#define __NR_select		 82 +#define __NR_symlink		 83 +#define __NR_oldlstat		 84 +#define __NR_readlink		 85 +#define __NR_uselib		 86 +#define __NR_swapon		 87 +#define __NR_reboot		 88 +#define __NR_readdir		 89 +#define __NR_mmap		 90 +#define __NR_munmap		 91 +#define __NR_truncate		 92 +#define __NR_ftruncate		 93 +#define __NR_fchmod		 94 +#define __NR_fchown		 95 +#define __NR_getpriority	 96 +#define __NR_setpriority	 97 +#define __NR_profil		 98 +#define __NR_statfs		 99 +#define __NR_fstatfs		100 +#define __NR_ioperm		101 +#define __NR_socketcall		102 +#define __NR_syslog		103 +#define __NR_setitimer		104 +#define __NR_getitimer		105 +#define __NR_stat		106 +#define __NR_lstat		107 +#define __NR_fstat		108 +#define __NR_olduname		109 +#define __NR_iopl		110 +#define __NR_vhangup		111 +#define __NR_idle		112 +#define __NR_vm86old		113 +#define __NR_wait4		114 +#define __NR_swapoff		115 +#define __NR_sysinfo		116 +#define __NR_ipc		117 +#define __NR_fsync		118 +#define __NR_sigreturn		119 +#define __NR_clone		120 +#define __NR_setdomainname	121 +#define __NR_uname		122 +#define __NR_modify_ldt		123 +#define __NR_adjtimex		124 +#define __NR_mprotect		125 +#define __NR_sigprocmask	126 +#define __NR_create_module	127 +#define __NR_init_module	128 +#define __NR_delete_module	129 +#define __NR_get_kernel_syms	130 +#define __NR_quotactl		131 +#define __NR_getpgid		132 +#define __NR_fchdir		133 +#define __NR_bdflush		134 +#define __NR_sysfs		135 +#define __NR_personality	136 +#define __NR_afs_syscall	137 /* Syscall for Andrew File System */ +#define __NR_setfsuid		138 +#define __NR_setfsgid		139 +#define __NR__llseek		140 +#define __NR_getdents		141 +#define __NR__newselect		142 +#define __NR_flock		143 +#define __NR_msync		144 +#define __NR_readv		145 +#define __NR_writev		146 +#define __NR_getsid		147 +#define __NR_fdatasync		148 +#define __NR__sysctl		149 +#define __NR_mlock		150 +#define __NR_munlock		151 +#define __NR_mlockall		152 +#define __NR_munlockall		153 +#define __NR_sched_setparam		154 +#define __NR_sched_getparam		155 +#define __NR_sched_setscheduler		156 +#define __NR_sched_getscheduler		157 +#define __NR_sched_yield		158 +#define __NR_sched_get_priority_max	159 +#define __NR_sched_get_priority_min	160 +#define __NR_sched_rr_get_interval	161 +#define __NR_nanosleep		162 +#define __NR_mremap		163 +#define __NR_setresuid		164 +#define __NR_getresuid		165 +#define __NR_vm86		166 +#define __NR_query_module	167 +#define __NR_poll		168 +#define __NR_nfsservctl		169 +#define __NR_setresgid		170 +#define __NR_getresgid		171 +#define __NR_prctl		172 +#define __NR_rt_sigreturn	173 +#define __NR_rt_sigaction	174 +#define __NR_rt_sigprocmask	175 +#define __NR_rt_sigpending	176 +#define __NR_rt_sigtimedwait	177 +#define __NR_rt_sigqueueinfo	178 +#define __NR_rt_sigsuspend	179 +#define __NR_pread64		180 +#define __NR_pwrite64		181 +#define __NR_chown		182 +#define __NR_getcwd		183 +#define __NR_capget		184 +#define __NR_capset		185 +#define __NR_sigaltstack	186 +#define __NR_sendfile		187 +#define __NR_getpmsg		188	/* some people actually want streams */ +#define __NR_putpmsg		189	/* some people actually want streams */ +#define __NR_vfork		190 +#define __NR_ugetrlimit		191 +#define __NR_mmap2		192 +#define __NR_truncate64		193 +#define __NR_ftruncate64	194 +#define __NR_stat64		195 +#define __NR_lstat64		196 +#define __NR_fstat64		197 +#define __NR_lchown32		198 +#define __NR_getuid32		199 +#define __NR_getgid32		200 +#define __NR_geteuid32		201 +#define __NR_getegid32		202 +#define __NR_setreuid32		203 +#define __NR_setregid32		204 +#define __NR_getgroups32	205 +#define __NR_setgroups32	206 +#define __NR_fchown32		207 +#define __NR_setresuid32	208 +#define __NR_getresuid32	209 +#define __NR_setresgid32	210 +#define __NR_getresgid32	211 +#define __NR_chown32		212 +#define __NR_setuid32		213 +#define __NR_setgid32		214 +#define __NR_setfsuid32		215 +#define __NR_setfsgid32		216 +#define __NR_pivot_root		217 +#define __NR_mincore		218 +#define __NR_madvise		219 +#define __NR_madvise1		219 +#define __NR_getdents64		220 +#define __NR_fcntl64		221 +/* 223 is unused */ +#define __NR_gettid		224 +#define __NR_readahead		225 +#define __NR_setxattr		226 +#define __NR_lsetxattr		227 +#define __NR_fsetxattr		228 +#define __NR_getxattr		229 +#define __NR_lgetxattr		230 +#define __NR_fgetxattr		231 +#define __NR_listxattr		232 +#define __NR_llistxattr		233 +#define __NR_flistxattr		234 +#define __NR_removexattr	235 +#define __NR_lremovexattr	236 +#define __NR_fremovexattr	237 +#define __NR_tkill		238 +#define __NR_sendfile64		239 +#define __NR_futex		240 +#define __NR_sched_setaffinity	241 +#define __NR_sched_getaffinity	242 +#define __NR_set_thread_area	243 +#define __NR_get_thread_area	244 +#define __NR_io_setup		245 +#define __NR_io_destroy		246 +#define __NR_io_getevents	247 +#define __NR_io_submit		248 +#define __NR_io_cancel		249 +#define __NR_fadvise64		250 +/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */ +#define __NR_exit_group		252 +#define __NR_lookup_dcookie	253 +#define __NR_epoll_create	254 +#define __NR_epoll_ctl		255 +#define __NR_epoll_wait		256 +#define __NR_remap_file_pages	257 +#define __NR_set_tid_address	258 +#define __NR_timer_create	259 +#define __NR_timer_settime	(__NR_timer_create+1) +#define __NR_timer_gettime	(__NR_timer_create+2) +#define __NR_timer_getoverrun	(__NR_timer_create+3) +#define __NR_timer_delete	(__NR_timer_create+4) +#define __NR_clock_settime	(__NR_timer_create+5) +#define __NR_clock_gettime	(__NR_timer_create+6) +#define __NR_clock_getres	(__NR_timer_create+7) +#define __NR_clock_nanosleep	(__NR_timer_create+8) +#define __NR_statfs64		268 +#define __NR_fstatfs64		269 +#define __NR_tgkill		270 +#define __NR_utimes		271 +#define __NR_fadvise64_64	272 +#define __NR_vserver		273 +#define __NR_mbind		274 +#define __NR_get_mempolicy	275 +#define __NR_set_mempolicy	276 +#define __NR_mq_open 		277 +#define __NR_mq_unlink		(__NR_mq_open+1) +#define __NR_mq_timedsend	(__NR_mq_open+2) +#define __NR_mq_timedreceive	(__NR_mq_open+3) +#define __NR_mq_notify		(__NR_mq_open+4) +#define __NR_mq_getsetattr	(__NR_mq_open+5) +#define __NR_kexec_load		283 +#define __NR_waitid		284 +/* #define __NR_sys_setaltroot	285 */ +#define __NR_add_key		286 +#define __NR_request_key	287 +#define __NR_keyctl		288 +#define __NR_ioprio_set		289 +#define __NR_ioprio_get		290 +#define __NR_inotify_init	291 +#define __NR_inotify_add_watch	292 +#define __NR_inotify_rm_watch	293 +#define __NR_migrate_pages	294 +#define __NR_openat		295 +#define __NR_mkdirat		296 +#define __NR_mknodat		297 +#define __NR_fchownat		298 +#define __NR_futimesat		299 +#define __NR_fstatat64		300 +#define __NR_unlinkat		301 +#define __NR_renameat		302 +#define __NR_linkat		303 +#define __NR_symlinkat		304 +#define __NR_readlinkat		305 +#define __NR_fchmodat		306 +#define __NR_faccessat		307 +#define __NR_pselect6		308 +#define __NR_ppoll		309 +#define __NR_unshare		310 +#define __NR_set_robust_list	311 +#define __NR_get_robust_list	312 +#define __NR_splice		313 +#define __NR_sync_file_range	314 +#define __NR_tee		315 +#define __NR_vmsplice		316 +#define __NR_move_pages		317 +#define __NR_getcpu		318 +#define __NR_epoll_pwait	319 +#define __NR_setns		320 + +#endif /* _UAPI_ASM_H8300_UNISTD_H_ */ diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index e418803b6c8..0744f7d7b1f 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig @@ -31,8 +31,6 @@ config HEXAGON  	select GENERIC_CLOCKEVENTS  	select GENERIC_CLOCKEVENTS_BROADCAST  	select MODULES_USE_ELF_RELA -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	---help---  	  Qualcomm Hexagon is a processor architecture designed for high  	  performance and low power across a wide variety of applications. diff --git a/arch/hexagon/include/uapi/asm/unistd.h b/arch/hexagon/include/uapi/asm/unistd.h index 2af81533bd0..4a87cc47075 100644 --- a/arch/hexagon/include/uapi/asm/unistd.h +++ b/arch/hexagon/include/uapi/asm/unistd.h @@ -27,7 +27,6 @@   */  #define sys_mmap2 sys_mmap_pgoff -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_CLONE  #include <asm-generic/unistd.h> diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 67060046812..3279646120e 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -42,8 +42,6 @@ config IA64  	select GENERIC_TIME_VSYSCALL_OLD  	select HAVE_MOD_ARCH_SPECIFIC  	select MODULES_USE_ELF_RELA -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	default y  	help  	  The Itanium Processor Family is Intel's 64-bit successor to diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h index 301609c3fce..359e68a03ca 100644 --- a/arch/ia64/include/asm/acpi.h +++ b/arch/ia64/include/asm/acpi.h @@ -153,7 +153,7 @@ extern int additional_cpus;  #else  #define MAX_PXM_DOMAINS (256)  #endif -extern int __devinitdata pxm_to_nid_map[MAX_PXM_DOMAINS]; +extern int pxm_to_nid_map[MAX_PXM_DOMAINS];  extern int __initdata nid_to_pxm_map[MAX_NUMNODES];  #endif diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h index 4f5e8148440..cf3ab7e784b 100644 --- a/arch/ia64/include/asm/dma-mapping.h +++ b/arch/ia64/include/asm/dma-mapping.h @@ -58,6 +58,7 @@ static inline void dma_free_attrs(struct device *dev, size_t size,  static inline int dma_mapping_error(struct device *dev, dma_addr_t daddr)  {  	struct dma_map_ops *ops = platform_dma_get_ops(dev); +	debug_dma_mapping_error(dev, daddr);  	return ops->mapping_error(dev, daddr);  } diff --git a/arch/ia64/include/asm/iosapic.h b/arch/ia64/include/asm/iosapic.h index b9c102e15f2..94c89a2d97f 100644 --- a/arch/ia64/include/asm/iosapic.h +++ b/arch/ia64/include/asm/iosapic.h @@ -87,18 +87,13 @@ static inline void iosapic_eoi(char __iomem *iosapic, u32 vector)  }  extern void __init iosapic_system_init (int pcat_compat); -extern int __devinit iosapic_init (unsigned long address, -				    unsigned int gsi_base); -#ifdef CONFIG_HOTPLUG +extern int iosapic_init (unsigned long address, unsigned int gsi_base);  extern int iosapic_remove (unsigned int gsi_base); -#else -#define iosapic_remove(gsi_base)				(-EINVAL) -#endif /* CONFIG_HOTPLUG */  extern int gsi_to_irq (unsigned int gsi);  extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity,  				  unsigned long trigger);  extern void iosapic_unregister_intr (unsigned int irq); -extern void __devinit iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi, +extern void iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,  				      unsigned long polarity,  				      unsigned long trigger);  extern int __init iosapic_register_platform_intr (u32 int_type, @@ -109,7 +104,7 @@ extern int __init iosapic_register_platform_intr (u32 int_type,  					   unsigned long trigger);  #ifdef CONFIG_NUMA -extern void __devinit map_iosapic_to_node (unsigned int, int); +extern void map_iosapic_to_node (unsigned int, int);  #endif  #else  #define iosapic_system_init(pcat_compat)			do { } while (0) diff --git a/arch/ia64/include/asm/parport.h b/arch/ia64/include/asm/parport.h index 67e16adfcd2..638b4d271b9 100644 --- a/arch/ia64/include/asm/parport.h +++ b/arch/ia64/include/asm/parport.h @@ -9,10 +9,9 @@  #ifndef _ASM_IA64_PARPORT_H  #define _ASM_IA64_PARPORT_H 1 -static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); +static int parport_pc_find_isa_ports(int autoirq, int autodma); -static int __devinit -parport_pc_find_nonpci_ports (int autoirq, int autodma) +static int parport_pc_find_nonpci_ports(int autoirq, int autodma)  {  	return parport_pc_find_isa_ports(autoirq, autodma);  } diff --git a/arch/ia64/include/asm/ptrace.h b/arch/ia64/include/asm/ptrace.h index b0e973649cb..845143990a1 100644 --- a/arch/ia64/include/asm/ptrace.h +++ b/arch/ia64/include/asm/ptrace.h @@ -78,6 +78,11 @@ static inline long regs_return_value(struct pt_regs *regs)  	unsigned long __ip = instruction_pointer(regs);			\  	(__ip & ~3UL) + ((__ip & 3UL) << 2);				\  }) +/* + * Why not default?  Because user_stack_pointer() on ia64 gives register + * stack backing store instead... + */ +#define current_user_stack_pointer() (current_pt_regs()->r12)    /* given a pointer to a task_struct, return the user's pt_regs */  # define task_pt_regs(t)		(((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1) diff --git a/arch/ia64/include/asm/smp.h b/arch/ia64/include/asm/smp.h index 0b3b3997dec..fea21e98602 100644 --- a/arch/ia64/include/asm/smp.h +++ b/arch/ia64/include/asm/smp.h @@ -55,7 +55,7 @@ extern struct smp_boot_data {  	int cpu_phys_id[NR_CPUS];  } smp_boot_data __initdata; -extern char no_int_routing __devinitdata; +extern char no_int_routing;  extern cpumask_t cpu_core_map[NR_CPUS];  DECLARE_PER_CPU_SHARED_ALIGNED(cpumask_t, cpu_sibling_map); diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index 1574bca8613..c3cc42a15af 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h @@ -11,7 +11,7 @@ -#define NR_syscalls			311 /* length of syscall table */ +#define NR_syscalls			312 /* length of syscall table */  /*   * The following defines stop scripts/checksyscalls.sh from complaining about @@ -29,7 +29,6 @@  #define __ARCH_WANT_SYS_RT_SIGACTION  #define __ARCH_WANT_SYS_RT_SIGSUSPEND -#define __ARCH_WANT_SYS_EXECVE  #if !defined(__ASSEMBLY__) && !defined(ASSEMBLER) diff --git a/arch/ia64/include/uapi/asm/signal.h b/arch/ia64/include/uapi/asm/signal.h index e531c424434..c0ea2855e96 100644 --- a/arch/ia64/include/uapi/asm/signal.h +++ b/arch/ia64/include/uapi/asm/signal.h @@ -79,12 +79,6 @@  #define SA_RESTORER	0x04000000  /* - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 - -/*   * The minimum stack size needs to be fairly large because we want to   * be sure that an app compiled for today's CPUs will continue to run   * on all future CPU models.  The CPU model matters because the signal diff --git a/arch/ia64/include/uapi/asm/unistd.h b/arch/ia64/include/uapi/asm/unistd.h index b706aa54df2..34fd6fe46da 100644 --- a/arch/ia64/include/uapi/asm/unistd.h +++ b/arch/ia64/include/uapi/asm/unistd.h @@ -324,5 +324,6 @@  #define __NR_process_vm_readv		1332  #define __NR_process_vm_writev		1333  #define __NR_accept4			1334 +#define __NR_finit_module		1335  #endif /* _UAPI_ASM_IA64_UNISTD_H */ diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index e9682f5be34..335eb07480f 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c @@ -422,7 +422,7 @@ static int __init acpi_parse_madt(struct acpi_table_header *table)  #define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32)  static int __initdata srat_num_cpus;	/* number of cpus */ -static u32 __devinitdata pxm_flag[PXM_FLAG_LEN]; +static u32 pxm_flag[PXM_FLAG_LEN];  #define pxm_bit_set(bit)	(set_bit(bit,(void *)pxm_flag))  #define pxm_bit_test(bit)	(test_bit(bit,(void *)pxm_flag))  static struct acpi_table_slit __initdata *slit_table; @@ -956,8 +956,8 @@ EXPORT_SYMBOL(acpi_unmap_lsapic);  #endif				/* CONFIG_ACPI_HOTPLUG_CPU */  #ifdef CONFIG_ACPI_NUMA -static acpi_status __devinit -acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret) +static acpi_status acpi_map_iosapic(acpi_handle handle, u32 depth, +				    void *context, void **ret)  {  	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };  	union acpi_object *obj; diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index e25b784a2b7..6bfd8429ee0 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S @@ -1785,6 +1785,7 @@ sys_call_table:  	data8 sys_process_vm_readv  	data8 sys_process_vm_writev  	data8 sys_accept4 +	data8 sys_finit_module			// 1335  	.org sys_call_table + 8*NR_syscalls	// guard against failures to increase NR_syscalls  #endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */ diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index ef4b5d877cf..ee33c3aaa2f 100644 --- a/arch/ia64/kernel/iosapic.c +++ b/arch/ia64/kernel/iosapic.c @@ -147,7 +147,7 @@ static struct iosapic_intr_info {  	unsigned char	trigger	: 1;	/* trigger mode (see iosapic.h) */  } iosapic_intr_info[NR_IRQS]; -static unsigned char pcat_compat __devinitdata;	/* 8259 compatibility flag */ +static unsigned char pcat_compat;	/* 8259 compatibility flag */  static inline void  iosapic_write(struct iosapic *iosapic, unsigned int reg, u32 val) @@ -914,10 +914,8 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi,  /*   * ACPI calls this when it finds an entry for a legacy ISA IRQ override.   */ -void __devinit -iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi, -			  unsigned long polarity, -			  unsigned long trigger) +void iosapic_override_isa_irq(unsigned int isa_irq, unsigned int gsi, +			      unsigned long polarity, unsigned long trigger)  {  	int vector, irq;  	unsigned int dest = cpu_physical_id(smp_processor_id()); @@ -1012,8 +1010,7 @@ iosapic_check_gsi_range (unsigned int gsi_base, unsigned int ver)  	return 0;  } -int __devinit -iosapic_init (unsigned long phys_addr, unsigned int gsi_base) +int iosapic_init(unsigned long phys_addr, unsigned int gsi_base)  {  	int num_rte, err, index;  	unsigned int isa_irq, ver; @@ -1070,9 +1067,7 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base)  	return 0;  } -#ifdef CONFIG_HOTPLUG -int -iosapic_remove (unsigned int gsi_base) +int iosapic_remove(unsigned int gsi_base)  {  	int index, err = 0;  	unsigned long flags; @@ -1098,11 +1093,9 @@ iosapic_remove (unsigned int gsi_base)  	spin_unlock_irqrestore(&iosapic_lock, flags);  	return err;  } -#endif /* CONFIG_HOTPLUG */  #ifdef CONFIG_NUMA -void __devinit -map_iosapic_to_node(unsigned int gsi_base, int node) +void map_iosapic_to_node(unsigned int gsi_base, int node)  {  	int index; diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c index 4265ff64219..b7a5fffe092 100644 --- a/arch/ia64/kernel/ptrace.c +++ b/arch/ia64/kernel/ptrace.c @@ -672,33 +672,6 @@ ptrace_attach_sync_user_rbs (struct task_struct *child)  	read_unlock(&tasklist_lock);  } -static inline int -thread_matches (struct task_struct *thread, unsigned long addr) -{ -	unsigned long thread_rbs_end; -	struct pt_regs *thread_regs; - -	if (ptrace_check_attach(thread, 0) < 0) -		/* -		 * If the thread is not in an attachable state, we'll -		 * ignore it.  The net effect is that if ADDR happens -		 * to overlap with the portion of the thread's -		 * register backing store that is currently residing -		 * on the thread's kernel stack, then ptrace() may end -		 * up accessing a stale value.  But if the thread -		 * isn't stopped, that's a problem anyhow, so we're -		 * doing as well as we can... -		 */ -		return 0; - -	thread_regs = task_pt_regs(thread); -	thread_rbs_end = ia64_get_user_rbs_end(thread, thread_regs, NULL); -	if (!on_kernel_rbs(addr, thread_regs->ar_bspstore, thread_rbs_end)) -		return 0; - -	return 1;	/* looks like we've got a winner */ -} -  /*   * Write f32-f127 back to task->thread.fph if it has been modified.   */ diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index 6a368cb2043..500f1e4d9f9 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c @@ -347,8 +347,7 @@ ia64_sync_itc (unsigned int master)  /*   * Ideally sets up per-cpu profiling hooks.  Doesn't do much now...   */ -static inline void __devinit -smp_setup_percpu_timer (void) +static inline void smp_setup_percpu_timer(void)  {  } @@ -563,7 +562,7 @@ smp_prepare_cpus (unsigned int max_cpus)  	}  } -void __devinit smp_prepare_boot_cpu(void) +void smp_prepare_boot_cpu(void)  {  	set_cpu_online(smp_processor_id(), true);  	cpu_set(smp_processor_id(), cpu_callin_map); @@ -713,8 +712,7 @@ smp_cpus_done (unsigned int dummy)  	       (int)num_online_cpus(), bogosum/(500000/HZ), (bogosum/(5000/HZ))%100);  } -static inline void __devinit -set_cpu_sibling_map(int cpu) +static inline void set_cpu_sibling_map(int cpu)  {  	int i; @@ -793,8 +791,7 @@ init_smp_config(void)   * identify_siblings(cpu) gets called from identify_cpu. This populates the    * information related to logical execution units in per_cpu_data structure.   */ -void __devinit -identify_siblings(struct cpuinfo_ia64 *c) +void identify_siblings(struct cpuinfo_ia64 *c)  {  	long status;  	u16 pltid; diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index b1995efbfd2..88a794536bc 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c @@ -243,8 +243,7 @@ static int __init nojitter_setup(char *str)  __setup("nojitter", nojitter_setup); -void __devinit -ia64_init_itm (void) +void ia64_init_itm(void)  {  	unsigned long platform_base_freq, itc_freq;  	struct pal_freq_ratio itc_ratio, proc_ratio; diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index 082e383c1b6..b755ea92aea 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c @@ -294,11 +294,10 @@ setup_gate (void)  	ia64_patch_gate();  } -void __devinit -ia64_mmu_init (void *my_cpu_data) +void ia64_mmu_init(void *my_cpu_data)  {  	unsigned long pta, impl_va_bits; -	extern void __devinit tlb_init (void); +	extern void tlb_init(void);  #ifdef CONFIG_DISABLE_VHPT  #	define VHPT_ENABLE_BIT	0 diff --git a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c index 7b3cdc6c6d9..ed612976868 100644 --- a/arch/ia64/mm/tlb.c +++ b/arch/ia64/mm/tlb.c @@ -337,8 +337,7 @@ flush_tlb_range (struct vm_area_struct *vma, unsigned long start,  }  EXPORT_SYMBOL(flush_tlb_range); -void __devinit -ia64_tlb_init (void) +void ia64_tlb_init(void)  {  	ia64_ptce_info_t uninitialized_var(ptce_info); /* GCC be quiet */  	u64 tr_pgbits; diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c index eab28e31402..5dc969dd4ac 100644 --- a/arch/ia64/pci/fixup.c +++ b/arch/ia64/pci/fixup.c @@ -24,7 +24,7 @@   * video device at this point.   */ -static void __devinit pci_fixup_video(struct pci_dev *pdev) +static void pci_fixup_video(struct pci_dev *pdev)  {  	struct pci_dev *bridge;  	struct pci_bus *bus; diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 5faa66c5c2a..55b72ad5732 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -116,8 +116,7 @@ struct pci_ops pci_root_ops = {  /* Called by ACPI when it finds a new root bus.  */ -static struct pci_controller * __devinit -alloc_pci_controller (int seg) +static struct pci_controller *alloc_pci_controller(int seg)  {  	struct pci_controller *controller; @@ -165,8 +164,8 @@ new_space (u64 phys_base, int sparse)  	return i;  } -static u64 __devinit -add_io_space (struct pci_root_info *info, struct acpi_resource_address64 *addr) +static u64 add_io_space(struct pci_root_info *info, +			struct acpi_resource_address64 *addr)  {  	struct resource *resource;  	char *name; @@ -226,8 +225,8 @@ out:  	return ~0;  } -static acpi_status __devinit resource_to_window(struct acpi_resource *resource, -	struct acpi_resource_address64 *addr) +static acpi_status resource_to_window(struct acpi_resource *resource, +				      struct acpi_resource_address64 *addr)  {  	acpi_status status; @@ -249,8 +248,7 @@ static acpi_status __devinit resource_to_window(struct acpi_resource *resource,  	return AE_ERROR;  } -static acpi_status __devinit -count_window (struct acpi_resource *resource, void *data) +static acpi_status count_window(struct acpi_resource *resource, void *data)  {  	unsigned int *windows = (unsigned int *) data;  	struct acpi_resource_address64 addr; @@ -263,7 +261,7 @@ count_window (struct acpi_resource *resource, void *data)  	return AE_OK;  } -static __devinit acpi_status add_window(struct acpi_resource *res, void *data) +static acpi_status add_window(struct acpi_resource *res, void *data)  {  	struct pci_root_info *info = data;  	struct pci_window *window; @@ -324,8 +322,7 @@ static __devinit acpi_status add_window(struct acpi_resource *res, void *data)  	return AE_OK;  } -struct pci_bus * __devinit -pci_acpi_scan_root(struct acpi_pci_root *root) +struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)  {  	struct acpi_device *device = root->device;  	int domain = root->segment; @@ -396,7 +393,7 @@ out1:  	return NULL;  } -static int __devinit is_valid_resource(struct pci_dev *dev, int idx) +static int is_valid_resource(struct pci_dev *dev, int idx)  {  	unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM;  	struct resource *devr = &dev->resource[idx], *busr; @@ -414,8 +411,7 @@ static int __devinit is_valid_resource(struct pci_dev *dev, int idx)  	return 0;  } -static void __devinit -pcibios_fixup_resources(struct pci_dev *dev, int start, int limit) +static void pcibios_fixup_resources(struct pci_dev *dev, int start, int limit)  {  	int i; @@ -427,13 +423,13 @@ pcibios_fixup_resources(struct pci_dev *dev, int start, int limit)  	}  } -void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) +void pcibios_fixup_device_resources(struct pci_dev *dev)  {  	pcibios_fixup_resources(dev, 0, PCI_BRIDGE_RESOURCES);  }  EXPORT_SYMBOL_GPL(pcibios_fixup_device_resources); -static void __devinit pcibios_fixup_bridge_resources(struct pci_dev *dev) +static void pcibios_fixup_bridge_resources(struct pci_dev *dev)  {  	pcibios_fixup_resources(dev, PCI_BRIDGE_RESOURCES, PCI_NUM_RESOURCES);  } @@ -441,8 +437,7 @@ static void __devinit pcibios_fixup_bridge_resources(struct pci_dev *dev)  /*   *  Called after each bus is probed, but before its children are examined.   */ -void __devinit -pcibios_fixup_bus (struct pci_bus *b) +void pcibios_fixup_bus(struct pci_bus *b)  {  	struct pci_dev *dev; diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c index 8630875e74b..11f2275570f 100644 --- a/arch/ia64/sn/kernel/io_common.c +++ b/arch/ia64/sn/kernel/io_common.c @@ -435,8 +435,7 @@ void sn_generate_path(struct pci_bus *pci_bus, char *address)  						geo_slot(geoid));  } -void __devinit -sn_pci_fixup_bus(struct pci_bus *bus) +void sn_pci_fixup_bus(struct pci_bus *bus)  {  	if (SN_ACPI_BASE_SUPPORT()) diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c index 4554f68b786..b9992571c03 100644 --- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c +++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c @@ -977,7 +977,7 @@ int sn_hwperf_get_nearest_node(cnodeid_t node,  	return e;  } -static int __devinit sn_hwperf_misc_register_init(void) +static int sn_hwperf_misc_register_init(void)  {  	int e; diff --git a/arch/ia64/xen/irq_xen.c b/arch/ia64/xen/irq_xen.c index 01f479ee1c4..efb74dafec4 100644 --- a/arch/ia64/xen/irq_xen.c +++ b/arch/ia64/xen/irq_xen.c @@ -273,9 +273,8 @@ xen_bind_early_percpu_irq(void)   */  #ifdef CONFIG_HOTPLUG_CPU -static int __devinit -unbind_evtchn_callback(struct notifier_block *nfb, -		       unsigned long action, void *hcpu) +static int unbind_evtchn_callback(struct notifier_block *nfb, +				  unsigned long action, void *hcpu)  {  	unsigned int cpu = (unsigned long)hcpu; diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig index 5183f43a2cf..f807721e19a 100644 --- a/arch/m32r/Kconfig +++ b/arch/m32r/Kconfig @@ -15,8 +15,6 @@ config M32R  	select GENERIC_ATOMIC64  	select ARCH_USES_GETTIMEOFFSET  	select MODULES_USE_ELF_RELA -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  config SBUS  	bool diff --git a/arch/m32r/include/asm/Kbuild b/arch/m32r/include/asm/Kbuild index 4bc8ae73e08..bebdc36ebb0 100644 --- a/arch/m32r/include/asm/Kbuild +++ b/arch/m32r/include/asm/Kbuild @@ -1,4 +1,3 @@ -include include/asm-generic/Kbuild.asm  generic-y += clkdev.h  generic-y += exec.h diff --git a/arch/m32r/include/asm/ptrace.h b/arch/m32r/include/asm/ptrace.h index c4432f1fb2c..fa58ccfff86 100644 --- a/arch/m32r/include/asm/ptrace.h +++ b/arch/m32r/include/asm/ptrace.h @@ -1,6 +1,3 @@ -#ifndef _ASM_M32R_PTRACE_H -#define _ASM_M32R_PTRACE_H -  /*   * linux/include/asm-m32r/ptrace.h   * @@ -11,111 +8,12 @@   * M32R version:   *   Copyright (C) 2001-2002, 2004  Hirokazu Takata <takata at linux-m32r.org>   */ +#ifndef _ASM_M32R_PTRACE_H +#define _ASM_M32R_PTRACE_H -/* 0 - 13 are integer registers (general purpose registers).  */ -#define PT_R4		0 -#define PT_R5		1 -#define PT_R6		2 -#define PT_REGS 	3 -#define PT_R0		4 -#define PT_R1		5 -#define PT_R2		6 -#define PT_R3		7 -#define PT_R7		8 -#define PT_R8		9 -#define PT_R9		10 -#define PT_R10		11 -#define PT_R11		12 -#define PT_R12		13 -#define PT_SYSCNR	14 -#define PT_R13		PT_FP -#define PT_R14		PT_LR -#define PT_R15		PT_SP - -/* processor status and miscellaneous context registers.  */ -#define PT_ACC0H	15 -#define PT_ACC0L	16 -#define PT_ACC1H	17	/* ISA_DSP_LEVEL2 only */ -#define PT_ACC1L	18	/* ISA_DSP_LEVEL2 only */ -#define PT_PSW		19 -#define PT_BPC		20 -#define PT_BBPSW	21 -#define PT_BBPC		22 -#define PT_SPU		23 -#define PT_FP		24 -#define PT_LR		25 -#define PT_SPI		26 -#define PT_ORIGR0	27 - -/* virtual pt_reg entry for gdb */ -#define PT_PC		30 -#define PT_CBR		31 -#define PT_EVB		32 - - -/* Control registers.  */ -#define SPR_CR0 PT_PSW -#define SPR_CR1 PT_CBR		/* read only */ -#define SPR_CR2 PT_SPI -#define SPR_CR3 PT_SPU -#define SPR_CR4 -#define SPR_CR5 PT_EVB		/* part of M32R/E, M32R/I core only */ -#define SPR_CR6 PT_BPC -#define SPR_CR7 -#define SPR_CR8 PT_BBPSW -#define SPR_CR9 -#define SPR_CR10 -#define SPR_CR11 -#define SPR_CR12 -#define SPR_CR13 PT_WR -#define SPR_CR14 PT_BBPC -#define SPR_CR15 - -/* this struct defines the way the registers are stored on the -   stack during a system call. */ -struct pt_regs { -	/* Saved main processor registers. */ -	unsigned long r4; -	unsigned long r5; -	unsigned long r6; -	struct pt_regs *pt_regs; -	unsigned long r0; -	unsigned long r1; -	unsigned long r2; -	unsigned long r3; -	unsigned long r7; -	unsigned long r8; -	unsigned long r9; -	unsigned long r10; -	unsigned long r11; -	unsigned long r12; -	long syscall_nr; - -	/* Saved main processor status and miscellaneous context registers. */ -	unsigned long acc0h; -	unsigned long acc0l; -	unsigned long acc1h;	/* ISA_DSP_LEVEL2 only */ -	unsigned long acc1l;	/* ISA_DSP_LEVEL2 only */ -	unsigned long psw; -	unsigned long bpc;		/* saved PC for TRAP syscalls */ -	unsigned long bbpsw; -	unsigned long bbpc; -	unsigned long spu;		/* saved user stack */ -	unsigned long fp; -	unsigned long lr;		/* saved PC for JL syscalls */ -	unsigned long spi;		/* saved kernel stack */ -	unsigned long orig_r0; -}; - -/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ -#define PTRACE_GETREGS		12 -#define PTRACE_SETREGS		13 - -#define PTRACE_OLDSETOPTIONS	21 - -#ifdef __KERNEL__  #include <asm/m32r.h>		/* M32R_PSW_BSM, M32R_PSW_BPM */ +#include <uapi/asm/ptrace.h>  #define arch_has_single_step() (1) @@ -134,6 +32,7 @@ extern void init_debug_traps(struct task_struct *);  #define instruction_pointer(regs) ((regs)->bpc)  #define profile_pc(regs) instruction_pointer(regs) +#define user_stack_pointer(regs) ((regs)->spu)  extern void withdraw_debug_trap(struct pt_regs *regs); @@ -142,6 +41,4 @@ extern void withdraw_debug_trap(struct pt_regs *regs);  #define current_pt_regs() ((struct pt_regs *) \  	((unsigned long)current_thread_info() + THREAD_SIZE) - 1) -#endif /* __KERNEL */ -  #endif /* _ASM_M32R_PTRACE_H */ diff --git a/arch/m32r/include/asm/setup.h b/arch/m32r/include/asm/setup.h index c637ab99239..bbe59a9ce8c 100644 --- a/arch/m32r/include/asm/setup.h +++ b/arch/m32r/include/asm/setup.h @@ -1,13 +1,8 @@  #ifndef _ASM_M32R_SETUP_H  #define _ASM_M32R_SETUP_H -/* - * This is set up by the setup-routine at boot-time - */ +#include <uapi/asm/setup.h> -#define COMMAND_LINE_SIZE       512 - -#ifdef __KERNEL__  #define PARAM			((unsigned char *)empty_zero_page) @@ -33,6 +28,4 @@  extern unsigned long memory_start;  extern unsigned long memory_end; -#endif  /*  __KERNEL__  */ -  #endif /* _ASM_M32R_SETUP_H */ diff --git a/arch/m32r/include/asm/signal.h b/arch/m32r/include/asm/signal.h index e4d2e2ad5f1..a5ba4a217fb 100644 --- a/arch/m32r/include/asm/signal.h +++ b/arch/m32r/include/asm/signal.h @@ -1,14 +1,8 @@  #ifndef _ASM_M32R_SIGNAL_H  #define _ASM_M32R_SIGNAL_H -#include <linux/types.h> -#include <linux/time.h> -#include <linux/compiler.h> +#include <uapi/asm/signal.h> -/* Avoid too many header ordering problems.  */ -struct siginfo; - -#ifdef __KERNEL__  /* Most things should be clean enough to redefine this at will, if care     is taken to make libc match.  */ @@ -22,94 +16,6 @@ typedef struct {  	unsigned long sig[_NSIG_WORDS];  } sigset_t; -#else -/* Here we must cater to libcs that poke about in kernel headers.  */ - -#define NSIG		32 -typedef unsigned long sigset_t; - -#endif /* __KERNEL__ */ - -#define SIGHUP		 1 -#define SIGINT		 2 -#define SIGQUIT		 3 -#define SIGILL		 4 -#define SIGTRAP		 5 -#define SIGABRT		 6 -#define SIGIOT		 6 -#define SIGBUS		 7 -#define SIGFPE		 8 -#define SIGKILL		 9 -#define SIGUSR1		10 -#define SIGSEGV		11 -#define SIGUSR2		12 -#define SIGPIPE		13 -#define SIGALRM		14 -#define SIGTERM		15 -#define SIGSTKFLT	16 -#define SIGCHLD		17 -#define SIGCONT		18 -#define SIGSTOP		19 -#define SIGTSTP		20 -#define SIGTTIN		21 -#define SIGTTOU		22 -#define SIGURG		23 -#define SIGXCPU		24 -#define SIGXFSZ		25 -#define SIGVTALRM	26 -#define SIGPROF		27 -#define SIGWINCH	28 -#define SIGIO		29 -#define SIGPOLL		SIGIO -/* -#define SIGLOST		29 -*/ -#define SIGPWR		30 -#define SIGSYS		31 -#define	SIGUNUSED	31 - -/* These should not be considered constants from userland.  */ -#define SIGRTMIN	32 -#define SIGRTMAX	_NSIG - -/* - * SA_FLAGS values: - * - * SA_ONSTACK indicates that a registered stack_t will be used. - * SA_RESTART flag to get restarting signals (which were the default long ago) - * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. - * SA_RESETHAND clears the handler when the signal is delivered. - * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. - * SA_NODEFER prevents the current signal from being masked in the handler. - * - * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single - * Unix names RESETHAND and NODEFER respectively. - */ -#define SA_NOCLDSTOP	0x00000001u -#define SA_NOCLDWAIT	0x00000002u -#define SA_SIGINFO	0x00000004u -#define SA_ONSTACK	0x08000000u -#define SA_RESTART	0x10000000u -#define SA_NODEFER	0x40000000u -#define SA_RESETHAND	0x80000000u - -#define SA_NOMASK	SA_NODEFER -#define SA_ONESHOT	SA_RESETHAND - -#define SA_RESTORER	0x04000000 - -/* - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 - -#define MINSIGSTKSZ	2048 -#define SIGSTKSZ	8192 - -#include <asm-generic/signal-defs.h> - -#ifdef __KERNEL__  struct sigaction {  	__sighandler_t sa_handler;  	unsigned long sa_flags; @@ -120,35 +26,8 @@ struct sigaction {  struct k_sigaction {  	struct sigaction sa;  }; -#else -/* Here we must cater to libcs that poke about in kernel headers.  */ - -struct sigaction { -	union { -	  __sighandler_t _sa_handler; -	  void (*_sa_sigaction)(int, struct siginfo *, void *); -	} _u; -	sigset_t sa_mask; -	unsigned long sa_flags; -	void (*sa_restorer)(void); -}; - -#define sa_handler	_u._sa_handler -#define sa_sigaction	_u._sa_sigaction - -#endif /* __KERNEL__ */ - -typedef struct sigaltstack { -	void __user *ss_sp; -	int ss_flags; -	size_t ss_size; -} stack_t; - -#ifdef __KERNEL__  #include <asm/sigcontext.h>  #undef __HAVE_ARCH_SIG_BITOPS -#endif /* __KERNEL__ */ -  #endif  /* _ASM_M32R_SIGNAL_H */ diff --git a/arch/m32r/include/asm/termios.h b/arch/m32r/include/asm/termios.h index 93ce79fd342..680898f0b3d 100644 --- a/arch/m32r/include/asm/termios.h +++ b/arch/m32r/include/asm/termios.h @@ -1,46 +1,8 @@  #ifndef _M32R_TERMIOS_H  #define _M32R_TERMIOS_H -#include <asm/termbits.h> -#include <asm/ioctls.h> - -struct winsize { -	unsigned short ws_row; -	unsigned short ws_col; -	unsigned short ws_xpixel; -	unsigned short ws_ypixel; -}; - -#define NCC 8 -struct termio { -	unsigned short c_iflag;		/* input mode flags */ -	unsigned short c_oflag;		/* output mode flags */ -	unsigned short c_cflag;		/* control mode flags */ -	unsigned short c_lflag;		/* local mode flags */ -	unsigned char c_line;		/* line discipline */ -	unsigned char c_cc[NCC];	/* control characters */ -}; - -/* modem lines */ -#define TIOCM_LE	0x001 -#define TIOCM_DTR	0x002 -#define TIOCM_RTS	0x004 -#define TIOCM_ST	0x008 -#define TIOCM_SR	0x010 -#define TIOCM_CTS	0x020 -#define TIOCM_CAR	0x040 -#define TIOCM_RNG	0x080 -#define TIOCM_DSR	0x100 -#define TIOCM_CD	TIOCM_CAR -#define TIOCM_RI	TIOCM_RNG -#define TIOCM_OUT1	0x2000 -#define TIOCM_OUT2	0x4000 -#define TIOCM_LOOP	0x8000 - -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ - -#ifdef __KERNEL__  #include <linux/module.h> +#include <uapi/asm/termios.h>  /*	intr=^C		quit=^\		erase=del	kill=^U  	eof=^D		vtime=\0	vmin=\1		sxtc=\0 @@ -86,6 +48,4 @@ struct termio {  #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))  #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) -#endif	/* __KERNEL__ */ -  #endif	/* _M32R_TERMIOS_H */ diff --git a/arch/m32r/include/asm/types.h b/arch/m32r/include/asm/types.h index bb2eeadecf9..04a44c6ee34 100644 --- a/arch/m32r/include/asm/types.h +++ b/arch/m32r/include/asm/types.h @@ -1,15 +1,12 @@  #ifndef _ASM_M32R_TYPES_H  #define _ASM_M32R_TYPES_H -#include <asm-generic/int-ll64.h> +#include <uapi/asm/types.h>  /*   * These aren't exported outside the kernel to avoid name space clashes   */ -#ifdef __KERNEL__  #define BITS_PER_LONG 32 -#endif /* __KERNEL__ */ -  #endif /* _ASM_M32R_TYPES_H */ diff --git a/arch/m32r/include/asm/unistd.h b/arch/m32r/include/asm/unistd.h index d9e7351af2a..79b063caec8 100644 --- a/arch/m32r/include/asm/unistd.h +++ b/arch/m32r/include/asm/unistd.h @@ -1,338 +1,8 @@  #ifndef _ASM_M32R_UNISTD_H  #define _ASM_M32R_UNISTD_H -/* - * This file contains the system call numbers. - */ - -#define __NR_restart_syscall	  0 -#define __NR_exit		  1 -#define __NR_fork		  2 -#define __NR_read		  3 -#define __NR_write		  4 -#define __NR_open		  5 -#define __NR_close		  6 -#define __NR_waitpid		  7 -#define __NR_creat		  8 -#define __NR_link		  9 -#define __NR_unlink		 10 -#define __NR_execve		 11 -#define __NR_chdir		 12 -#define __NR_time		 13 -#define __NR_mknod		 14 -#define __NR_chmod		 15 -/* 16 is unused */ -/* 17 is unused */ -/* 18 is unused */ -#define __NR_lseek		 19 -#define __NR_getpid		 20 -#define __NR_mount		 21 -#define __NR_umount		 22 -/* 23 is unused */ -/* 24 is unused */ -#define __NR_stime		 25 -#define __NR_ptrace		 26 -#define __NR_alarm		 27 -/* 28 is unused */ -#define __NR_pause		 29 -#define __NR_utime		 30 -/* 31 is unused */ -#define __NR_cachectl		 32 /* old #define __NR_gtty		 32*/ -#define __NR_access		 33 -/* 34 is unused */ -/* 35 is unused */ -#define __NR_sync		 36 -#define __NR_kill		 37 -#define __NR_rename		 38 -#define __NR_mkdir		 39 -#define __NR_rmdir		 40 -#define __NR_dup		 41 -#define __NR_pipe		 42 -#define __NR_times		 43 -/* 44 is unused */ -#define __NR_brk		 45 -/* 46 is unused */ -/* 47 is unused (getgid16) */ -/* 48 is unused */ -/* 49 is unused */ -/* 50 is unused */ -#define __NR_acct		 51 -#define __NR_umount2		 52 -/* 53 is unused */ -#define __NR_ioctl		 54 -/* 55 is unused (fcntl) */ -/* 56 is unused */ -#define __NR_setpgid		 57 -/* 58 is unused */ -/* 59 is unused */ -#define __NR_umask		 60 -#define __NR_chroot		 61 -#define __NR_ustat		 62 -#define __NR_dup2		 63 -#define __NR_getppid		 64 -#define __NR_getpgrp		 65 -#define __NR_setsid		 66 -/* 67 is unused */ -/* 68 is unused*/ -/* 69 is unused*/ -/* 70 is unused */ -/* 71 is unused */ -/* 72 is unused */ -/* 73 is unused */ -#define __NR_sethostname	 74 -#define __NR_setrlimit		 75 -/* 76 is unused (old getrlimit) */ -#define __NR_getrusage		 77 -#define __NR_gettimeofday	 78 -#define __NR_settimeofday	 79 -/* 80 is unused */ -/* 81 is unused */ -/* 82 is unused */ -#define __NR_symlink		 83 -/* 84 is unused */ -#define __NR_readlink		 85 -#define __NR_uselib		 86 -#define __NR_swapon		 87 -#define __NR_reboot		 88 -/* 89 is unused */ -/* 90 is unused */ -#define __NR_munmap		 91 -#define __NR_truncate		 92 -#define __NR_ftruncate		 93 -#define __NR_fchmod		 94 -/* 95 is unused */ -#define __NR_getpriority	 96 -#define __NR_setpriority	 97 -/* 98 is unused */ -#define __NR_statfs		 99 -#define __NR_fstatfs		100 -/* 101 is unused */ -#define __NR_socketcall		102 -#define __NR_syslog		103 -#define __NR_setitimer		104 -#define __NR_getitimer		105 -#define __NR_stat		106 -#define __NR_lstat		107 -#define __NR_fstat		108 -/* 109 is unused */ -/* 110 is unused */ -#define __NR_vhangup		111 -/* 112 is unused */ -/* 113 is unused */ -#define __NR_wait4		114 -#define __NR_swapoff		115 -#define __NR_sysinfo		116 -#define __NR_ipc		117 -#define __NR_fsync		118 -/* 119 is unused */ -#define __NR_clone		120 -#define __NR_setdomainname	121 -#define __NR_uname		122 -/* 123 is unused */ -#define __NR_adjtimex		124 -#define __NR_mprotect		125 -/* 126 is unused */ -/* 127 is unused */ -#define __NR_init_module	128 -#define __NR_delete_module	129 -/* 130 is unused */ -#define __NR_quotactl		131 -#define __NR_getpgid		132 -#define __NR_fchdir		133 -#define __NR_bdflush		134 -#define __NR_sysfs		135 -#define __NR_personality	136 -/* 137 is unused */ -/* 138 is unused */ -/* 139 is unused */ -#define __NR__llseek		140 -#define __NR_getdents		141 -#define __NR__newselect		142 -#define __NR_flock		143 -#define __NR_msync		144 -#define __NR_readv		145 -#define __NR_writev		146 -#define __NR_getsid		147 -#define __NR_fdatasync		148 -#define __NR__sysctl		149 -#define __NR_mlock		150 -#define __NR_munlock		151 -#define __NR_mlockall		152 -#define __NR_munlockall		153 -#define __NR_sched_setparam		154 -#define __NR_sched_getparam		155 -#define __NR_sched_setscheduler		156 -#define __NR_sched_getscheduler		157 -#define __NR_sched_yield		158 -#define __NR_sched_get_priority_max	159 -#define __NR_sched_get_priority_min	160 -#define __NR_sched_rr_get_interval	161 -#define __NR_nanosleep		162 -#define __NR_mremap		163 -/* 164 is unused */ -/* 165 is unused */ -#define __NR_tas		166 -/* 167 is unused */ -#define __NR_poll		168 -#define __NR_nfsservctl		169 -/* 170 is unused */ -/* 171 is unused */ -#define __NR_prctl              172 -#define __NR_rt_sigreturn	173 -#define __NR_rt_sigaction	174 -#define __NR_rt_sigprocmask	175 -#define __NR_rt_sigpending	176 -#define __NR_rt_sigtimedwait	177 -#define __NR_rt_sigqueueinfo	178 -#define __NR_rt_sigsuspend	179 -#define __NR_pread64		180 -#define __NR_pwrite64		181 -/* 182 is unused */ -#define __NR_getcwd		183 -#define __NR_capget		184 -#define __NR_capset		185 -#define __NR_sigaltstack	186 -#define __NR_sendfile		187 -/* 188 is unused */ -/* 189 is unused */ -#define __NR_vfork		190 -#define __NR_ugetrlimit		191	/* SuS compliant getrlimit */ -#define __NR_mmap2		192 -#define __NR_truncate64		193 -#define __NR_ftruncate64	194 -#define __NR_stat64		195 -#define __NR_lstat64		196 -#define __NR_fstat64		197 -#define __NR_lchown32		198 -#define __NR_getuid32		199 -#define __NR_getgid32		200 -#define __NR_geteuid32		201 -#define __NR_getegid32		202 -#define __NR_setreuid32		203 -#define __NR_setregid32		204 -#define __NR_getgroups32	205 -#define __NR_setgroups32	206 -#define __NR_fchown32		207 -#define __NR_setresuid32	208 -#define __NR_getresuid32	209 -#define __NR_setresgid32	210 -#define __NR_getresgid32	211 -#define __NR_chown32		212 -#define __NR_setuid32		213 -#define __NR_setgid32		214 -#define __NR_setfsuid32		215 -#define __NR_setfsgid32		216 -#define __NR_pivot_root		217 -#define __NR_mincore		218 -#define __NR_madvise		219 -#define __NR_getdents64		220 -#define __NR_fcntl64		221 -/* 222 is unused */ -/* 223 is unused */ -#define __NR_gettid		224 -#define __NR_readahead		225 -#define __NR_setxattr		226 -#define __NR_lsetxattr		227 -#define __NR_fsetxattr		228 -#define __NR_getxattr		229 -#define __NR_lgetxattr		230 -#define __NR_fgetxattr		231 -#define __NR_listxattr		232 -#define __NR_llistxattr		233 -#define __NR_flistxattr		234 -#define __NR_removexattr	235 -#define __NR_lremovexattr	236 -#define __NR_fremovexattr	237 -#define __NR_tkill		238 -#define __NR_sendfile64		239 -#define __NR_futex		240 -#define __NR_sched_setaffinity	241 -#define __NR_sched_getaffinity	242 -#define __NR_set_thread_area	243 -#define __NR_get_thread_area	244 -#define __NR_io_setup		245 -#define __NR_io_destroy		246 -#define __NR_io_getevents	247 -#define __NR_io_submit		248 -#define __NR_io_cancel		249 -#define __NR_fadvise64		250 -/* 251 is unused */ -#define __NR_exit_group		252 -#define __NR_lookup_dcookie	253 -#define __NR_epoll_create	254 -#define __NR_epoll_ctl		255 -#define __NR_epoll_wait		256 -#define __NR_remap_file_pages	257 -#define __NR_set_tid_address	258 -#define __NR_timer_create	259 -#define __NR_timer_settime	(__NR_timer_create+1) -#define __NR_timer_gettime	(__NR_timer_create+2) -#define __NR_timer_getoverrun	(__NR_timer_create+3) -#define __NR_timer_delete	(__NR_timer_create+4) -#define __NR_clock_settime	(__NR_timer_create+5) -#define __NR_clock_gettime	(__NR_timer_create+6) -#define __NR_clock_getres	(__NR_timer_create+7) -#define __NR_clock_nanosleep	(__NR_timer_create+8) -#define __NR_statfs64		268 -#define __NR_fstatfs64		269 -#define __NR_tgkill		270 -#define __NR_utimes		271 -#define __NR_fadvise64_64	272 -#define __NR_vserver		273 -#define __NR_mbind		274 -#define __NR_get_mempolicy	275 -#define __NR_set_mempolicy	276 -#define __NR_mq_open		277 -#define __NR_mq_unlink		(__NR_mq_open+1) -#define __NR_mq_timedsend	(__NR_mq_open+2) -#define __NR_mq_timedreceive	(__NR_mq_open+3) -#define __NR_mq_notify		(__NR_mq_open+4) -#define __NR_mq_getsetattr	(__NR_mq_open+5) -#define __NR_kexec_load		283 -#define __NR_waitid		284 -/* 285 is unused */ -#define __NR_add_key		286 -#define __NR_request_key	287 -#define __NR_keyctl		288 -#define __NR_ioprio_set		289 -#define __NR_ioprio_get		290 -#define __NR_inotify_init	291 -#define __NR_inotify_add_watch	292 -#define __NR_inotify_rm_watch	293 -#define __NR_migrate_pages	294 -#define __NR_openat		295 -#define __NR_mkdirat		296 -#define __NR_mknodat		297 -#define __NR_fchownat		298 -#define __NR_futimesat		299 -#define __NR_fstatat64		300 -#define __NR_unlinkat		301 -#define __NR_renameat		302 -#define __NR_linkat		303 -#define __NR_symlinkat		304 -#define __NR_readlinkat		305 -#define __NR_fchmodat		306 -#define __NR_faccessat		307 -#define __NR_pselect6		308 -#define __NR_ppoll		309 -#define __NR_unshare		310 -#define __NR_set_robust_list	311 -#define __NR_get_robust_list	312 -#define __NR_splice		313 -#define __NR_sync_file_range	314 -#define __NR_tee		315 -#define __NR_vmsplice		316 -#define __NR_move_pages		317 -#define __NR_getcpu		318 -#define __NR_epoll_pwait	319 -#define __NR_utimensat		320 -#define __NR_signalfd		321 -/* #define __NR_timerfd		322 removed */ -#define __NR_eventfd		323 -#define __NR_fallocate		324 -#define __NR_setns		325 +#include <uapi/asm/unistd.h> -#ifdef __KERNEL__  #define NR_syscalls 326 @@ -352,7 +22,6 @@  #define __ARCH_WANT_SYS_OLDUMOUNT  #define __ARCH_WANT_SYS_RT_SIGACTION  #define __ARCH_WANT_SYS_RT_SIGSUSPEND -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_CLONE  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_VFORK @@ -391,5 +60,4 @@  #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")  #endif -#endif /* __KERNEL__ */  #endif /* _ASM_M32R_UNISTD_H */ diff --git a/arch/m32r/include/uapi/asm/Kbuild b/arch/m32r/include/uapi/asm/Kbuild index baebb3da1d4..43937a61d6c 100644 --- a/arch/m32r/include/uapi/asm/Kbuild +++ b/arch/m32r/include/uapi/asm/Kbuild @@ -1,3 +1,33 @@  # UAPI Header export list  include include/uapi/asm-generic/Kbuild.asm +header-y += auxvec.h +header-y += bitsperlong.h +header-y += byteorder.h +header-y += errno.h +header-y += fcntl.h +header-y += ioctl.h +header-y += ioctls.h +header-y += ipcbuf.h +header-y += mman.h +header-y += msgbuf.h +header-y += param.h +header-y += poll.h +header-y += posix_types.h +header-y += ptrace.h +header-y += resource.h +header-y += sembuf.h +header-y += setup.h +header-y += shmbuf.h +header-y += sigcontext.h +header-y += siginfo.h +header-y += signal.h +header-y += socket.h +header-y += sockios.h +header-y += stat.h +header-y += statfs.h +header-y += swab.h +header-y += termbits.h +header-y += termios.h +header-y += types.h +header-y += unistd.h diff --git a/arch/m32r/include/asm/auxvec.h b/arch/m32r/include/uapi/asm/auxvec.h index f76dcc860fa..f76dcc860fa 100644 --- a/arch/m32r/include/asm/auxvec.h +++ b/arch/m32r/include/uapi/asm/auxvec.h diff --git a/arch/m32r/include/asm/bitsperlong.h b/arch/m32r/include/uapi/asm/bitsperlong.h index 6dc0bb0c13b..6dc0bb0c13b 100644 --- a/arch/m32r/include/asm/bitsperlong.h +++ b/arch/m32r/include/uapi/asm/bitsperlong.h diff --git a/arch/m32r/include/asm/byteorder.h b/arch/m32r/include/uapi/asm/byteorder.h index 21855d8b028..21855d8b028 100644 --- a/arch/m32r/include/asm/byteorder.h +++ b/arch/m32r/include/uapi/asm/byteorder.h diff --git a/arch/m32r/include/asm/errno.h b/arch/m32r/include/uapi/asm/errno.h index 777149262aa..777149262aa 100644 --- a/arch/m32r/include/asm/errno.h +++ b/arch/m32r/include/uapi/asm/errno.h diff --git a/arch/m32r/include/asm/fcntl.h b/arch/m32r/include/uapi/asm/fcntl.h index 46ab12db573..46ab12db573 100644 --- a/arch/m32r/include/asm/fcntl.h +++ b/arch/m32r/include/uapi/asm/fcntl.h diff --git a/arch/m32r/include/asm/ioctl.h b/arch/m32r/include/uapi/asm/ioctl.h index b279fe06dfe..b279fe06dfe 100644 --- a/arch/m32r/include/asm/ioctl.h +++ b/arch/m32r/include/uapi/asm/ioctl.h diff --git a/arch/m32r/include/asm/ioctls.h b/arch/m32r/include/uapi/asm/ioctls.h index 349bf87bfbd..349bf87bfbd 100644 --- a/arch/m32r/include/asm/ioctls.h +++ b/arch/m32r/include/uapi/asm/ioctls.h diff --git a/arch/m32r/include/asm/ipcbuf.h b/arch/m32r/include/uapi/asm/ipcbuf.h index 84c7e51cb6d..84c7e51cb6d 100644 --- a/arch/m32r/include/asm/ipcbuf.h +++ b/arch/m32r/include/uapi/asm/ipcbuf.h diff --git a/arch/m32r/include/asm/mman.h b/arch/m32r/include/uapi/asm/mman.h index 8eebf89f5ab..8eebf89f5ab 100644 --- a/arch/m32r/include/asm/mman.h +++ b/arch/m32r/include/uapi/asm/mman.h diff --git a/arch/m32r/include/asm/msgbuf.h b/arch/m32r/include/uapi/asm/msgbuf.h index 0d5a877b813..0d5a877b813 100644 --- a/arch/m32r/include/asm/msgbuf.h +++ b/arch/m32r/include/uapi/asm/msgbuf.h diff --git a/arch/m32r/include/asm/param.h b/arch/m32r/include/uapi/asm/param.h index fa207bdf96e..fa207bdf96e 100644 --- a/arch/m32r/include/asm/param.h +++ b/arch/m32r/include/uapi/asm/param.h diff --git a/arch/m32r/include/asm/poll.h b/arch/m32r/include/uapi/asm/poll.h index c98509d3149..c98509d3149 100644 --- a/arch/m32r/include/asm/poll.h +++ b/arch/m32r/include/uapi/asm/poll.h diff --git a/arch/m32r/include/asm/posix_types.h b/arch/m32r/include/uapi/asm/posix_types.h index 236de26a409..236de26a409 100644 --- a/arch/m32r/include/asm/posix_types.h +++ b/arch/m32r/include/uapi/asm/posix_types.h diff --git a/arch/m32r/include/uapi/asm/ptrace.h b/arch/m32r/include/uapi/asm/ptrace.h new file mode 100644 index 00000000000..f6930a82251 --- /dev/null +++ b/arch/m32r/include/uapi/asm/ptrace.h @@ -0,0 +1,117 @@ +/* + * linux/include/asm-m32r/ptrace.h + * + * This file is subject to the terms and conditions of the GNU General Public + * License.  See the file "COPYING" in the main directory of this archive + * for more details. + * + * M32R version: + *   Copyright (C) 2001-2002, 2004  Hirokazu Takata <takata at linux-m32r.org> + */ +#ifndef _UAPI_ASM_M32R_PTRACE_H +#define _UAPI_ASM_M32R_PTRACE_H + + +/* 0 - 13 are integer registers (general purpose registers).  */ +#define PT_R4		0 +#define PT_R5		1 +#define PT_R6		2 +#define PT_REGS 	3 +#define PT_R0		4 +#define PT_R1		5 +#define PT_R2		6 +#define PT_R3		7 +#define PT_R7		8 +#define PT_R8		9 +#define PT_R9		10 +#define PT_R10		11 +#define PT_R11		12 +#define PT_R12		13 +#define PT_SYSCNR	14 +#define PT_R13		PT_FP +#define PT_R14		PT_LR +#define PT_R15		PT_SP + +/* processor status and miscellaneous context registers.  */ +#define PT_ACC0H	15 +#define PT_ACC0L	16 +#define PT_ACC1H	17	/* ISA_DSP_LEVEL2 only */ +#define PT_ACC1L	18	/* ISA_DSP_LEVEL2 only */ +#define PT_PSW		19 +#define PT_BPC		20 +#define PT_BBPSW	21 +#define PT_BBPC		22 +#define PT_SPU		23 +#define PT_FP		24 +#define PT_LR		25 +#define PT_SPI		26 +#define PT_ORIGR0	27 + +/* virtual pt_reg entry for gdb */ +#define PT_PC		30 +#define PT_CBR		31 +#define PT_EVB		32 + + +/* Control registers.  */ +#define SPR_CR0 PT_PSW +#define SPR_CR1 PT_CBR		/* read only */ +#define SPR_CR2 PT_SPI +#define SPR_CR3 PT_SPU +#define SPR_CR4 +#define SPR_CR5 PT_EVB		/* part of M32R/E, M32R/I core only */ +#define SPR_CR6 PT_BPC +#define SPR_CR7 +#define SPR_CR8 PT_BBPSW +#define SPR_CR9 +#define SPR_CR10 +#define SPR_CR11 +#define SPR_CR12 +#define SPR_CR13 PT_WR +#define SPR_CR14 PT_BBPC +#define SPR_CR15 + +/* this struct defines the way the registers are stored on the +   stack during a system call. */ +struct pt_regs { +	/* Saved main processor registers. */ +	unsigned long r4; +	unsigned long r5; +	unsigned long r6; +	struct pt_regs *pt_regs; +	unsigned long r0; +	unsigned long r1; +	unsigned long r2; +	unsigned long r3; +	unsigned long r7; +	unsigned long r8; +	unsigned long r9; +	unsigned long r10; +	unsigned long r11; +	unsigned long r12; +	long syscall_nr; + +	/* Saved main processor status and miscellaneous context registers. */ +	unsigned long acc0h; +	unsigned long acc0l; +	unsigned long acc1h;	/* ISA_DSP_LEVEL2 only */ +	unsigned long acc1l;	/* ISA_DSP_LEVEL2 only */ +	unsigned long psw; +	unsigned long bpc;		/* saved PC for TRAP syscalls */ +	unsigned long bbpsw; +	unsigned long bbpc; +	unsigned long spu;		/* saved user stack */ +	unsigned long fp; +	unsigned long lr;		/* saved PC for JL syscalls */ +	unsigned long spi;		/* saved kernel stack */ +	unsigned long orig_r0; +}; + +/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ +#define PTRACE_GETREGS		12 +#define PTRACE_SETREGS		13 + +#define PTRACE_OLDSETOPTIONS	21 + + +#endif /* _UAPI_ASM_M32R_PTRACE_H */ diff --git a/arch/m32r/include/asm/resource.h b/arch/m32r/include/uapi/asm/resource.h index b1ce766e37a..b1ce766e37a 100644 --- a/arch/m32r/include/asm/resource.h +++ b/arch/m32r/include/uapi/asm/resource.h diff --git a/arch/m32r/include/asm/sembuf.h b/arch/m32r/include/uapi/asm/sembuf.h index c9873d6890e..c9873d6890e 100644 --- a/arch/m32r/include/asm/sembuf.h +++ b/arch/m32r/include/uapi/asm/sembuf.h diff --git a/arch/m32r/include/uapi/asm/setup.h b/arch/m32r/include/uapi/asm/setup.h new file mode 100644 index 00000000000..96961a42e5f --- /dev/null +++ b/arch/m32r/include/uapi/asm/setup.h @@ -0,0 +1,11 @@ +#ifndef _UAPI_ASM_M32R_SETUP_H +#define _UAPI_ASM_M32R_SETUP_H + +/* + * This is set up by the setup-routine at boot-time + */ + +#define COMMAND_LINE_SIZE       512 + + +#endif /* _UAPI_ASM_M32R_SETUP_H */ diff --git a/arch/m32r/include/asm/shmbuf.h b/arch/m32r/include/uapi/asm/shmbuf.h index b0cdf0aa7d6..b0cdf0aa7d6 100644 --- a/arch/m32r/include/asm/shmbuf.h +++ b/arch/m32r/include/uapi/asm/shmbuf.h diff --git a/arch/m32r/include/asm/sigcontext.h b/arch/m32r/include/uapi/asm/sigcontext.h index da4a9c36d09..da4a9c36d09 100644 --- a/arch/m32r/include/asm/sigcontext.h +++ b/arch/m32r/include/uapi/asm/sigcontext.h diff --git a/arch/m32r/include/asm/siginfo.h b/arch/m32r/include/uapi/asm/siginfo.h index 7d9cd9ebfd0..7d9cd9ebfd0 100644 --- a/arch/m32r/include/asm/siginfo.h +++ b/arch/m32r/include/uapi/asm/siginfo.h diff --git a/arch/m32r/include/uapi/asm/signal.h b/arch/m32r/include/uapi/asm/signal.h new file mode 100644 index 00000000000..54acacb1f1f --- /dev/null +++ b/arch/m32r/include/uapi/asm/signal.h @@ -0,0 +1,117 @@ +#ifndef _UAPI_ASM_M32R_SIGNAL_H +#define _UAPI_ASM_M32R_SIGNAL_H + +#include <linux/types.h> +#include <linux/time.h> +#include <linux/compiler.h> + +/* Avoid too many header ordering problems.  */ +struct siginfo; + +#ifndef __KERNEL__ +/* Here we must cater to libcs that poke about in kernel headers.  */ + +#define NSIG		32 +typedef unsigned long sigset_t; + +#endif /* __KERNEL__ */ + +#define SIGHUP		 1 +#define SIGINT		 2 +#define SIGQUIT		 3 +#define SIGILL		 4 +#define SIGTRAP		 5 +#define SIGABRT		 6 +#define SIGIOT		 6 +#define SIGBUS		 7 +#define SIGFPE		 8 +#define SIGKILL		 9 +#define SIGUSR1		10 +#define SIGSEGV		11 +#define SIGUSR2		12 +#define SIGPIPE		13 +#define SIGALRM		14 +#define SIGTERM		15 +#define SIGSTKFLT	16 +#define SIGCHLD		17 +#define SIGCONT		18 +#define SIGSTOP		19 +#define SIGTSTP		20 +#define SIGTTIN		21 +#define SIGTTOU		22 +#define SIGURG		23 +#define SIGXCPU		24 +#define SIGXFSZ		25 +#define SIGVTALRM	26 +#define SIGPROF		27 +#define SIGWINCH	28 +#define SIGIO		29 +#define SIGPOLL		SIGIO +/* +#define SIGLOST		29 +*/ +#define SIGPWR		30 +#define SIGSYS		31 +#define	SIGUNUSED	31 + +/* These should not be considered constants from userland.  */ +#define SIGRTMIN	32 +#define SIGRTMAX	_NSIG + +/* + * SA_FLAGS values: + * + * SA_ONSTACK indicates that a registered stack_t will be used. + * SA_RESTART flag to get restarting signals (which were the default long ago) + * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. + * SA_RESETHAND clears the handler when the signal is delivered. + * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. + * SA_NODEFER prevents the current signal from being masked in the handler. + * + * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single + * Unix names RESETHAND and NODEFER respectively. + */ +#define SA_NOCLDSTOP	0x00000001u +#define SA_NOCLDWAIT	0x00000002u +#define SA_SIGINFO	0x00000004u +#define SA_ONSTACK	0x08000000u +#define SA_RESTART	0x10000000u +#define SA_NODEFER	0x40000000u +#define SA_RESETHAND	0x80000000u + +#define SA_NOMASK	SA_NODEFER +#define SA_ONESHOT	SA_RESETHAND + +#define SA_RESTORER	0x04000000 + +#define MINSIGSTKSZ	2048 +#define SIGSTKSZ	8192 + +#include <asm-generic/signal-defs.h> + +#ifndef __KERNEL__ +/* Here we must cater to libcs that poke about in kernel headers.  */ + +struct sigaction { +	union { +	  __sighandler_t _sa_handler; +	  void (*_sa_sigaction)(int, struct siginfo *, void *); +	} _u; +	sigset_t sa_mask; +	unsigned long sa_flags; +	void (*sa_restorer)(void); +}; + +#define sa_handler	_u._sa_handler +#define sa_sigaction	_u._sa_sigaction + +#endif /* __KERNEL__ */ + +typedef struct sigaltstack { +	void __user *ss_sp; +	int ss_flags; +	size_t ss_size; +} stack_t; + + +#endif /* _UAPI_ASM_M32R_SIGNAL_H */ diff --git a/arch/m32r/include/asm/socket.h b/arch/m32r/include/uapi/asm/socket.h index 5e7088a2672..5e7088a2672 100644 --- a/arch/m32r/include/asm/socket.h +++ b/arch/m32r/include/uapi/asm/socket.h diff --git a/arch/m32r/include/asm/sockios.h b/arch/m32r/include/uapi/asm/sockios.h index 6c1fb9b43bd..6c1fb9b43bd 100644 --- a/arch/m32r/include/asm/sockios.h +++ b/arch/m32r/include/uapi/asm/sockios.h diff --git a/arch/m32r/include/asm/stat.h b/arch/m32r/include/uapi/asm/stat.h index da4518f82d6..da4518f82d6 100644 --- a/arch/m32r/include/asm/stat.h +++ b/arch/m32r/include/uapi/asm/stat.h diff --git a/arch/m32r/include/asm/statfs.h b/arch/m32r/include/uapi/asm/statfs.h index 6eb4c6007e6..6eb4c6007e6 100644 --- a/arch/m32r/include/asm/statfs.h +++ b/arch/m32r/include/uapi/asm/statfs.h diff --git a/arch/m32r/include/asm/swab.h b/arch/m32r/include/uapi/asm/swab.h index 54dab001d6d..54dab001d6d 100644 --- a/arch/m32r/include/asm/swab.h +++ b/arch/m32r/include/uapi/asm/swab.h diff --git a/arch/m32r/include/asm/termbits.h b/arch/m32r/include/uapi/asm/termbits.h index 957a3c68854..957a3c68854 100644 --- a/arch/m32r/include/asm/termbits.h +++ b/arch/m32r/include/uapi/asm/termbits.h diff --git a/arch/m32r/include/uapi/asm/termios.h b/arch/m32r/include/uapi/asm/termios.h new file mode 100644 index 00000000000..07ad27b8f7d --- /dev/null +++ b/arch/m32r/include/uapi/asm/termios.h @@ -0,0 +1,43 @@ +#ifndef _UAPI_M32R_TERMIOS_H +#define _UAPI_M32R_TERMIOS_H + +#include <asm/termbits.h> +#include <asm/ioctls.h> + +struct winsize { +	unsigned short ws_row; +	unsigned short ws_col; +	unsigned short ws_xpixel; +	unsigned short ws_ypixel; +}; + +#define NCC 8 +struct termio { +	unsigned short c_iflag;		/* input mode flags */ +	unsigned short c_oflag;		/* output mode flags */ +	unsigned short c_cflag;		/* control mode flags */ +	unsigned short c_lflag;		/* local mode flags */ +	unsigned char c_line;		/* line discipline */ +	unsigned char c_cc[NCC];	/* control characters */ +}; + +/* modem lines */ +#define TIOCM_LE	0x001 +#define TIOCM_DTR	0x002 +#define TIOCM_RTS	0x004 +#define TIOCM_ST	0x008 +#define TIOCM_SR	0x010 +#define TIOCM_CTS	0x020 +#define TIOCM_CAR	0x040 +#define TIOCM_RNG	0x080 +#define TIOCM_DSR	0x100 +#define TIOCM_CD	TIOCM_CAR +#define TIOCM_RI	TIOCM_RNG +#define TIOCM_OUT1	0x2000 +#define TIOCM_OUT2	0x4000 +#define TIOCM_LOOP	0x8000 + +/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ + + +#endif /* _UAPI_M32R_TERMIOS_H */ diff --git a/arch/m32r/include/uapi/asm/types.h b/arch/m32r/include/uapi/asm/types.h new file mode 100644 index 00000000000..9ec9d4c5ac4 --- /dev/null +++ b/arch/m32r/include/uapi/asm/types.h @@ -0,0 +1 @@ +#include <asm-generic/int-ll64.h> diff --git a/arch/m32r/include/uapi/asm/unistd.h b/arch/m32r/include/uapi/asm/unistd.h new file mode 100644 index 00000000000..5a54f2ae3b5 --- /dev/null +++ b/arch/m32r/include/uapi/asm/unistd.h @@ -0,0 +1,335 @@ +#ifndef _UAPI_ASM_M32R_UNISTD_H +#define _UAPI_ASM_M32R_UNISTD_H + +/* + * This file contains the system call numbers. + */ + +#define __NR_restart_syscall	  0 +#define __NR_exit		  1 +#define __NR_fork		  2 +#define __NR_read		  3 +#define __NR_write		  4 +#define __NR_open		  5 +#define __NR_close		  6 +#define __NR_waitpid		  7 +#define __NR_creat		  8 +#define __NR_link		  9 +#define __NR_unlink		 10 +#define __NR_execve		 11 +#define __NR_chdir		 12 +#define __NR_time		 13 +#define __NR_mknod		 14 +#define __NR_chmod		 15 +/* 16 is unused */ +/* 17 is unused */ +/* 18 is unused */ +#define __NR_lseek		 19 +#define __NR_getpid		 20 +#define __NR_mount		 21 +#define __NR_umount		 22 +/* 23 is unused */ +/* 24 is unused */ +#define __NR_stime		 25 +#define __NR_ptrace		 26 +#define __NR_alarm		 27 +/* 28 is unused */ +#define __NR_pause		 29 +#define __NR_utime		 30 +/* 31 is unused */ +#define __NR_cachectl		 32 /* old #define __NR_gtty		 32*/ +#define __NR_access		 33 +/* 34 is unused */ +/* 35 is unused */ +#define __NR_sync		 36 +#define __NR_kill		 37 +#define __NR_rename		 38 +#define __NR_mkdir		 39 +#define __NR_rmdir		 40 +#define __NR_dup		 41 +#define __NR_pipe		 42 +#define __NR_times		 43 +/* 44 is unused */ +#define __NR_brk		 45 +/* 46 is unused */ +/* 47 is unused (getgid16) */ +/* 48 is unused */ +/* 49 is unused */ +/* 50 is unused */ +#define __NR_acct		 51 +#define __NR_umount2		 52 +/* 53 is unused */ +#define __NR_ioctl		 54 +/* 55 is unused (fcntl) */ +/* 56 is unused */ +#define __NR_setpgid		 57 +/* 58 is unused */ +/* 59 is unused */ +#define __NR_umask		 60 +#define __NR_chroot		 61 +#define __NR_ustat		 62 +#define __NR_dup2		 63 +#define __NR_getppid		 64 +#define __NR_getpgrp		 65 +#define __NR_setsid		 66 +/* 67 is unused */ +/* 68 is unused*/ +/* 69 is unused*/ +/* 70 is unused */ +/* 71 is unused */ +/* 72 is unused */ +/* 73 is unused */ +#define __NR_sethostname	 74 +#define __NR_setrlimit		 75 +/* 76 is unused (old getrlimit) */ +#define __NR_getrusage		 77 +#define __NR_gettimeofday	 78 +#define __NR_settimeofday	 79 +/* 80 is unused */ +/* 81 is unused */ +/* 82 is unused */ +#define __NR_symlink		 83 +/* 84 is unused */ +#define __NR_readlink		 85 +#define __NR_uselib		 86 +#define __NR_swapon		 87 +#define __NR_reboot		 88 +/* 89 is unused */ +/* 90 is unused */ +#define __NR_munmap		 91 +#define __NR_truncate		 92 +#define __NR_ftruncate		 93 +#define __NR_fchmod		 94 +/* 95 is unused */ +#define __NR_getpriority	 96 +#define __NR_setpriority	 97 +/* 98 is unused */ +#define __NR_statfs		 99 +#define __NR_fstatfs		100 +/* 101 is unused */ +#define __NR_socketcall		102 +#define __NR_syslog		103 +#define __NR_setitimer		104 +#define __NR_getitimer		105 +#define __NR_stat		106 +#define __NR_lstat		107 +#define __NR_fstat		108 +/* 109 is unused */ +/* 110 is unused */ +#define __NR_vhangup		111 +/* 112 is unused */ +/* 113 is unused */ +#define __NR_wait4		114 +#define __NR_swapoff		115 +#define __NR_sysinfo		116 +#define __NR_ipc		117 +#define __NR_fsync		118 +/* 119 is unused */ +#define __NR_clone		120 +#define __NR_setdomainname	121 +#define __NR_uname		122 +/* 123 is unused */ +#define __NR_adjtimex		124 +#define __NR_mprotect		125 +/* 126 is unused */ +/* 127 is unused */ +#define __NR_init_module	128 +#define __NR_delete_module	129 +/* 130 is unused */ +#define __NR_quotactl		131 +#define __NR_getpgid		132 +#define __NR_fchdir		133 +#define __NR_bdflush		134 +#define __NR_sysfs		135 +#define __NR_personality	136 +/* 137 is unused */ +/* 138 is unused */ +/* 139 is unused */ +#define __NR__llseek		140 +#define __NR_getdents		141 +#define __NR__newselect		142 +#define __NR_flock		143 +#define __NR_msync		144 +#define __NR_readv		145 +#define __NR_writev		146 +#define __NR_getsid		147 +#define __NR_fdatasync		148 +#define __NR__sysctl		149 +#define __NR_mlock		150 +#define __NR_munlock		151 +#define __NR_mlockall		152 +#define __NR_munlockall		153 +#define __NR_sched_setparam		154 +#define __NR_sched_getparam		155 +#define __NR_sched_setscheduler		156 +#define __NR_sched_getscheduler		157 +#define __NR_sched_yield		158 +#define __NR_sched_get_priority_max	159 +#define __NR_sched_get_priority_min	160 +#define __NR_sched_rr_get_interval	161 +#define __NR_nanosleep		162 +#define __NR_mremap		163 +/* 164 is unused */ +/* 165 is unused */ +#define __NR_tas		166 +/* 167 is unused */ +#define __NR_poll		168 +#define __NR_nfsservctl		169 +/* 170 is unused */ +/* 171 is unused */ +#define __NR_prctl              172 +#define __NR_rt_sigreturn	173 +#define __NR_rt_sigaction	174 +#define __NR_rt_sigprocmask	175 +#define __NR_rt_sigpending	176 +#define __NR_rt_sigtimedwait	177 +#define __NR_rt_sigqueueinfo	178 +#define __NR_rt_sigsuspend	179 +#define __NR_pread64		180 +#define __NR_pwrite64		181 +/* 182 is unused */ +#define __NR_getcwd		183 +#define __NR_capget		184 +#define __NR_capset		185 +#define __NR_sigaltstack	186 +#define __NR_sendfile		187 +/* 188 is unused */ +/* 189 is unused */ +#define __NR_vfork		190 +#define __NR_ugetrlimit		191	/* SuS compliant getrlimit */ +#define __NR_mmap2		192 +#define __NR_truncate64		193 +#define __NR_ftruncate64	194 +#define __NR_stat64		195 +#define __NR_lstat64		196 +#define __NR_fstat64		197 +#define __NR_lchown32		198 +#define __NR_getuid32		199 +#define __NR_getgid32		200 +#define __NR_geteuid32		201 +#define __NR_getegid32		202 +#define __NR_setreuid32		203 +#define __NR_setregid32		204 +#define __NR_getgroups32	205 +#define __NR_setgroups32	206 +#define __NR_fchown32		207 +#define __NR_setresuid32	208 +#define __NR_getresuid32	209 +#define __NR_setresgid32	210 +#define __NR_getresgid32	211 +#define __NR_chown32		212 +#define __NR_setuid32		213 +#define __NR_setgid32		214 +#define __NR_setfsuid32		215 +#define __NR_setfsgid32		216 +#define __NR_pivot_root		217 +#define __NR_mincore		218 +#define __NR_madvise		219 +#define __NR_getdents64		220 +#define __NR_fcntl64		221 +/* 222 is unused */ +/* 223 is unused */ +#define __NR_gettid		224 +#define __NR_readahead		225 +#define __NR_setxattr		226 +#define __NR_lsetxattr		227 +#define __NR_fsetxattr		228 +#define __NR_getxattr		229 +#define __NR_lgetxattr		230 +#define __NR_fgetxattr		231 +#define __NR_listxattr		232 +#define __NR_llistxattr		233 +#define __NR_flistxattr		234 +#define __NR_removexattr	235 +#define __NR_lremovexattr	236 +#define __NR_fremovexattr	237 +#define __NR_tkill		238 +#define __NR_sendfile64		239 +#define __NR_futex		240 +#define __NR_sched_setaffinity	241 +#define __NR_sched_getaffinity	242 +#define __NR_set_thread_area	243 +#define __NR_get_thread_area	244 +#define __NR_io_setup		245 +#define __NR_io_destroy		246 +#define __NR_io_getevents	247 +#define __NR_io_submit		248 +#define __NR_io_cancel		249 +#define __NR_fadvise64		250 +/* 251 is unused */ +#define __NR_exit_group		252 +#define __NR_lookup_dcookie	253 +#define __NR_epoll_create	254 +#define __NR_epoll_ctl		255 +#define __NR_epoll_wait		256 +#define __NR_remap_file_pages	257 +#define __NR_set_tid_address	258 +#define __NR_timer_create	259 +#define __NR_timer_settime	(__NR_timer_create+1) +#define __NR_timer_gettime	(__NR_timer_create+2) +#define __NR_timer_getoverrun	(__NR_timer_create+3) +#define __NR_timer_delete	(__NR_timer_create+4) +#define __NR_clock_settime	(__NR_timer_create+5) +#define __NR_clock_gettime	(__NR_timer_create+6) +#define __NR_clock_getres	(__NR_timer_create+7) +#define __NR_clock_nanosleep	(__NR_timer_create+8) +#define __NR_statfs64		268 +#define __NR_fstatfs64		269 +#define __NR_tgkill		270 +#define __NR_utimes		271 +#define __NR_fadvise64_64	272 +#define __NR_vserver		273 +#define __NR_mbind		274 +#define __NR_get_mempolicy	275 +#define __NR_set_mempolicy	276 +#define __NR_mq_open		277 +#define __NR_mq_unlink		(__NR_mq_open+1) +#define __NR_mq_timedsend	(__NR_mq_open+2) +#define __NR_mq_timedreceive	(__NR_mq_open+3) +#define __NR_mq_notify		(__NR_mq_open+4) +#define __NR_mq_getsetattr	(__NR_mq_open+5) +#define __NR_kexec_load		283 +#define __NR_waitid		284 +/* 285 is unused */ +#define __NR_add_key		286 +#define __NR_request_key	287 +#define __NR_keyctl		288 +#define __NR_ioprio_set		289 +#define __NR_ioprio_get		290 +#define __NR_inotify_init	291 +#define __NR_inotify_add_watch	292 +#define __NR_inotify_rm_watch	293 +#define __NR_migrate_pages	294 +#define __NR_openat		295 +#define __NR_mkdirat		296 +#define __NR_mknodat		297 +#define __NR_fchownat		298 +#define __NR_futimesat		299 +#define __NR_fstatat64		300 +#define __NR_unlinkat		301 +#define __NR_renameat		302 +#define __NR_linkat		303 +#define __NR_symlinkat		304 +#define __NR_readlinkat		305 +#define __NR_fchmodat		306 +#define __NR_faccessat		307 +#define __NR_pselect6		308 +#define __NR_ppoll		309 +#define __NR_unshare		310 +#define __NR_set_robust_list	311 +#define __NR_get_robust_list	312 +#define __NR_splice		313 +#define __NR_sync_file_range	314 +#define __NR_tee		315 +#define __NR_vmsplice		316 +#define __NR_move_pages		317 +#define __NR_getcpu		318 +#define __NR_epoll_pwait	319 +#define __NR_utimensat		320 +#define __NR_signalfd		321 +/* #define __NR_timerfd		322 removed */ +#define __NR_eventfd		323 +#define __NR_fallocate		324 +#define __NR_setns		325 + +#endif /* _UAPI_ASM_M32R_UNISTD_H */ diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c index a2cfc0abb05..13168a769f8 100644 --- a/arch/m32r/kernel/smpboot.c +++ b/arch/m32r/kernel/smpboot.c @@ -127,7 +127,7 @@ static void unmap_cpu_to_physid(int, int);  /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/  /* Boot up APs Routines : BSP                                                */  /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ -void __devinit smp_prepare_boot_cpu(void) +void smp_prepare_boot_cpu(void)  {  	bsp_phys_id = hard_smp_processor_id();  	physid_set(bsp_phys_id, phys_cpu_present_map); diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 953a7ba5d05..6710084e072 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -15,8 +15,6 @@ config M68K  	select FPU if MMU  	select ARCH_WANT_IPC_PARSE_VERSION  	select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	select HAVE_MOD_ARCH_SPECIFIC  	select MODULES_USE_ELF_REL  	select MODULES_USE_ELF_RELA diff --git a/arch/m68k/emu/nfeth.c b/arch/m68k/emu/nfeth.c index a985a7e87d4..695cd737a42 100644 --- a/arch/m68k/emu/nfeth.c +++ b/arch/m68k/emu/nfeth.c @@ -39,7 +39,7 @@ enum {  #define MAX_UNIT	8  /* These identify the driver base version and may not be removed. */ -static const char version[] __devinitconst = +static const char version[] =  	KERN_INFO KBUILD_MODNAME ".c:v" DRV_VERSION " " DRV_RELDATE  	" S.Opichal, M.Jurik, P.Stehlik\n"  	KERN_INFO " http://aranym.org/\n"; diff --git a/arch/m68k/include/asm/parport.h b/arch/m68k/include/asm/parport.h index 646b1872f73..5ea75e6a739 100644 --- a/arch/m68k/include/asm/parport.h +++ b/arch/m68k/include/asm/parport.h @@ -15,8 +15,8 @@  #define outsl(port,buf,len)  isa_outsb(port,buf,(len)<<2)  /* no dma, or IRQ autoprobing */ -static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); -static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) +static int parport_pc_find_isa_ports (int autoirq, int autodma); +static int parport_pc_find_nonpci_ports (int autoirq, int autodma)  {          if (! (MACH_IS_Q40))  	  return 0; /* count=0 */ diff --git a/arch/m68k/include/asm/pgtable_no.h b/arch/m68k/include/asm/pgtable_no.h index bf86b29fe64..037028f4ab7 100644 --- a/arch/m68k/include/asm/pgtable_no.h +++ b/arch/m68k/include/asm/pgtable_no.h @@ -64,6 +64,8 @@ extern unsigned int kobjsize(const void *objp);   */  #define	VMALLOC_START	0  #define	VMALLOC_END	0xffffffff +#define	KMAP_START	0 +#define	KMAP_END	0xffffffff  #include <asm-generic/pgtable.h> diff --git a/arch/m68k/include/asm/ptrace.h b/arch/m68k/include/asm/ptrace.h index 0f717045bdd..a45cb6894ad 100644 --- a/arch/m68k/include/asm/ptrace.h +++ b/arch/m68k/include/asm/ptrace.h @@ -15,6 +15,7 @@  #define profile_pc(regs) instruction_pointer(regs)  #define current_pt_regs() \  	(struct pt_regs *)((char *)current_thread_info() + THREAD_SIZE) - 1 +#define current_user_stack_pointer() rdusp()  #define arch_has_single_step()	(1) diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index a021d67cdd7..847994ce680 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h @@ -31,7 +31,6 @@  #define __ARCH_WANT_SYS_SIGPROCMASK  #define __ARCH_WANT_SYS_RT_SIGACTION  #define __ARCH_WANT_SYS_RT_SIGSUSPEND -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_VFORK diff --git a/arch/m68k/include/uapi/asm/signal.h b/arch/m68k/include/uapi/asm/signal.h index 2b450f311bd..cba6f858bb4 100644 --- a/arch/m68k/include/uapi/asm/signal.h +++ b/arch/m68k/include/uapi/asm/signal.h @@ -80,12 +80,6 @@ typedef unsigned long sigset_t;  #define SA_NOMASK	SA_NODEFER  #define SA_ONESHOT	SA_RESETHAND -/* - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 -  #define MINSIGSTKSZ	2048  #define SIGSTKSZ	8192 diff --git a/arch/m68k/kernel/pcibios.c b/arch/m68k/kernel/pcibios.c index 73fa0b56a06..931a31ff59d 100644 --- a/arch/m68k/kernel/pcibios.c +++ b/arch/m68k/kernel/pcibios.c @@ -87,7 +87,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)  	return 0;  } -void __devinit pcibios_fixup_bus(struct pci_bus *bus) +void pcibios_fixup_bus(struct pci_bus *bus)  {  	struct pci_dev *dev; @@ -97,7 +97,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)  	}  } -char __devinit *pcibios_setup(char *str) +char *pcibios_setup(char *str)  {  	return str;  } diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c index f0e05bce92f..afd8106fd83 100644 --- a/arch/m68k/mm/init.c +++ b/arch/m68k/mm/init.c @@ -39,6 +39,11 @@  void *empty_zero_page;  EXPORT_SYMBOL(empty_zero_page); +#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE) +extern void init_pointer_table(unsigned long ptable); +extern pmd_t *zero_pgtable; +#endif +  #ifdef CONFIG_MMU  pg_data_t pg_data_map[MAX_NUMNODES]; @@ -69,9 +74,6 @@ void __init m68k_setup_node(int node)  	node_set_online(node);  } -extern void init_pointer_table(unsigned long ptable); -extern pmd_t *zero_pgtable; -  #else /* CONFIG_MMU */  /* diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 4bcf89148f3..ba3b7c8c04b 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -26,8 +26,6 @@ config MICROBLAZE  	select GENERIC_ATOMIC64  	select GENERIC_CLOCKEVENTS  	select MODULES_USE_ELF_RELA -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	select CLONE_BACKWARDS  config SWAP diff --git a/arch/microblaze/configs/mmu_defconfig b/arch/microblaze/configs/mmu_defconfig index b3f5eecff2a..d2b097a652d 100644 --- a/arch/microblaze/configs/mmu_defconfig +++ b/arch/microblaze/configs/mmu_defconfig @@ -1,25 +1,22 @@  CONFIG_EXPERIMENTAL=y  CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +CONFIG_FHANDLE=y +CONFIG_AUDIT=y +CONFIG_AUDIT_LOGINUID_IMMUTABLE=y  CONFIG_IKCONFIG=y  CONFIG_IKCONFIG_PROC=y +CONFIG_SYSFS_DEPRECATED=y  CONFIG_SYSFS_DEPRECATED_V2=y -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="rootfs.cpio" -CONFIG_INITRAMFS_COMPRESSION_GZIP=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_EXPERT=y  CONFIG_KALLSYMS_ALL=y -CONFIG_KALLSYMS_EXTRA_PASS=y -# CONFIG_HOTPLUG is not set  # CONFIG_BASE_FULL is not set -# CONFIG_FUTEX is not set -# CONFIG_EPOLL is not set -# CONFIG_SIGNALFD is not set -# CONFIG_SHMEM is not set +CONFIG_EMBEDDED=y  CONFIG_SLAB=y  CONFIG_MODULES=y  CONFIG_MODULE_UNLOAD=y  # CONFIG_BLK_DEV_BSG is not set +CONFIG_PARTITION_ADVANCED=y +# CONFIG_EFI_PARTITION is not set  CONFIG_OPT_LIB_ASM=y  CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1  CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1 @@ -31,39 +28,62 @@ CONFIG_HZ_100=y  CONFIG_MMU=y  CONFIG_CMDLINE_BOOL=y  CONFIG_CMDLINE_FORCE=y +CONFIG_HIGHMEM=y +CONFIG_PCI=y +CONFIG_PCI_XILINX=y  CONFIG_NET=y  CONFIG_PACKET=y  CONFIG_UNIX=y  CONFIG_INET=y  # CONFIG_INET_LRO is not set  # CONFIG_IPV6 is not set +CONFIG_MTD=y  CONFIG_PROC_DEVICETREE=y  CONFIG_BLK_DEV_RAM=y  CONFIG_BLK_DEV_RAM_SIZE=8192  CONFIG_NETDEVICES=y -CONFIG_NET_ETHERNET=y  CONFIG_XILINX_EMACLITE=y +CONFIG_XILINX_LL_TEMAC=y  # CONFIG_INPUT is not set  # CONFIG_SERIO is not set  # CONFIG_VT is not set +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y  CONFIG_SERIAL_UARTLITE=y  CONFIG_SERIAL_UARTLITE_CONSOLE=y  # CONFIG_HW_RANDOM is not set +CONFIG_XILINX_HWICAP=y +CONFIG_I2C=y +CONFIG_I2C_XILINX=y +CONFIG_SPI=y +CONFIG_SPI_XILINX=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_XILINX=y  # CONFIG_HWMON is not set +CONFIG_WATCHDOG=y +CONFIG_XILINX_WATCHDOG=y +CONFIG_FB=y +CONFIG_FB_XILINX=y  # CONFIG_USB_SUPPORT is not set +CONFIG_UIO=y +CONFIG_UIO_PDRV=y +CONFIG_UIO_PDRV_GENIRQ=y +CONFIG_UIO_DMEM_GENIRQ=y  CONFIG_EXT2_FS=y  # CONFIG_DNOTIFY is not set +CONFIG_CRAMFS=y +CONFIG_ROMFS_FS=y  CONFIG_NFS_FS=y -CONFIG_NFS_V3=y  CONFIG_CIFS=y  CONFIG_CIFS_STATS=y  CONFIG_CIFS_STATS2=y -CONFIG_PARTITION_ADVANCED=y -CONFIG_DEBUG_KERNEL=y  CONFIG_DETECT_HUNG_TASK=y  CONFIG_DEBUG_SLAB=y  CONFIG_DEBUG_SPINLOCK=y  CONFIG_DEBUG_INFO=y -# CONFIG_RCU_CPU_STALL_DETECTOR is not set  CONFIG_EARLY_PRINTK=y +CONFIG_KEYS=y +CONFIG_ENCRYPTED_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y  # CONFIG_CRYPTO_ANSI_CPRNG is not set diff --git a/arch/microblaze/configs/nommu_defconfig b/arch/microblaze/configs/nommu_defconfig index 0249e4b7e1d..10b5172283d 100644 --- a/arch/microblaze/configs/nommu_defconfig +++ b/arch/microblaze/configs/nommu_defconfig @@ -1,41 +1,42 @@  CONFIG_EXPERIMENTAL=y  CONFIG_SYSVIPC=y  CONFIG_POSIX_MQUEUE=y +CONFIG_FHANDLE=y +CONFIG_AUDIT=y +CONFIG_AUDIT_LOGINUID_IMMUTABLE=y  CONFIG_BSD_PROCESS_ACCT=y  CONFIG_BSD_PROCESS_ACCT_V3=y  CONFIG_IKCONFIG=y  CONFIG_IKCONFIG_PROC=y +CONFIG_SYSFS_DEPRECATED=y  CONFIG_SYSFS_DEPRECATED_V2=y -CONFIG_EXPERT=y  CONFIG_KALLSYMS_ALL=y -CONFIG_KALLSYMS_EXTRA_PASS=y -# CONFIG_HOTPLUG is not set  # CONFIG_BASE_FULL is not set +CONFIG_EMBEDDED=y  CONFIG_SLAB=y  CONFIG_MODULES=y  CONFIG_MODULE_UNLOAD=y  # CONFIG_BLK_DEV_BSG is not set -# CONFIG_OPT_LIB_FUNCTION is not set +CONFIG_PARTITION_ADVANCED=y +# CONFIG_EFI_PARTITION is not set  CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1  CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1  CONFIG_XILINX_MICROBLAZE0_USE_BARREL=1  CONFIG_XILINX_MICROBLAZE0_USE_DIV=1  CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=2  CONFIG_XILINX_MICROBLAZE0_USE_FPU=2 -CONFIG_HIGH_RES_TIMERS=y  CONFIG_HZ_100=y  CONFIG_CMDLINE_BOOL=y -CONFIG_BINFMT_FLAT=y +CONFIG_CMDLINE_FORCE=y +CONFIG_PCI=y +CONFIG_PCI_XILINX=y  CONFIG_NET=y  CONFIG_PACKET=y  CONFIG_UNIX=y  CONFIG_INET=y  # CONFIG_INET_LRO is not set  # CONFIG_IPV6 is not set -# CONFIG_PREVENT_FIRMWARE_BUILD is not set  CONFIG_MTD=y -CONFIG_MTD_CONCAT=y -CONFIG_MTD_PARTITIONS=y  CONFIG_MTD_CMDLINE_PARTS=y  CONFIG_MTD_CHAR=y  CONFIG_MTD_BLOCK=y @@ -45,41 +46,55 @@ CONFIG_MTD_CFI_AMDSTD=y  CONFIG_MTD_RAM=y  CONFIG_MTD_UCLINUX=y  CONFIG_PROC_DEVICETREE=y -CONFIG_BLK_DEV_NBD=y  CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=8192  CONFIG_NETDEVICES=y -CONFIG_NET_ETHERNET=y +CONFIG_XILINX_EMACLITE=y +CONFIG_XILINX_LL_TEMAC=y  # CONFIG_INPUT is not set  # CONFIG_SERIO is not set  # CONFIG_VT is not set +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y  CONFIG_SERIAL_UARTLITE=y  CONFIG_SERIAL_UARTLITE_CONSOLE=y -CONFIG_HW_RANDOM=y +# CONFIG_HW_RANDOM is not set +CONFIG_XILINX_HWICAP=y +CONFIG_I2C=y +CONFIG_I2C_XILINX=y +CONFIG_SPI=y +CONFIG_SPI_XILINX=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_XILINX=y  # CONFIG_HWMON is not set -CONFIG_VIDEO_OUTPUT_CONTROL=y +CONFIG_WATCHDOG=y +CONFIG_XILINX_WATCHDOG=y +CONFIG_FB=y +CONFIG_FB_XILINX=y +# CONFIG_USB_SUPPORT is not set +CONFIG_UIO=y +CONFIG_UIO_PDRV=y +CONFIG_UIO_PDRV_GENIRQ=y +CONFIG_UIO_DMEM_GENIRQ=y  CONFIG_EXT2_FS=y  # CONFIG_DNOTIFY is not set  CONFIG_CRAMFS=y  CONFIG_ROMFS_FS=y  CONFIG_NFS_FS=y -CONFIG_NFS_V3=y  CONFIG_NFS_V3_ACL=y -CONFIG_UNUSED_SYMBOLS=y -CONFIG_DEBUG_FS=y -CONFIG_DEBUG_KERNEL=y -CONFIG_DEBUG_SHIRQ=y +CONFIG_NLS=y  CONFIG_DETECT_HUNG_TASK=y -CONFIG_SCHEDSTATS=y -CONFIG_TIMER_STATS=y -CONFIG_DEBUG_OBJECTS=y -CONFIG_DEBUG_OBJECTS_SELFTEST=y -CONFIG_DEBUG_OBJECTS_FREE=y -CONFIG_DEBUG_OBJECTS_TIMERS=y +CONFIG_DEBUG_SLAB=y +CONFIG_DEBUG_SPINLOCK=y  CONFIG_DEBUG_INFO=y -CONFIG_DEBUG_LIST=y -CONFIG_DEBUG_SG=y -# CONFIG_RCU_CPU_STALL_DETECTOR is not set -CONFIG_SYSCTL_SYSCALL_CHECK=y  CONFIG_EARLY_PRINTK=y +CONFIG_KEYS=y +CONFIG_ENCRYPTED_KEYS=y +CONFIG_KEYS_DEBUG_PROC_KEYS=y +CONFIG_CRYPTO_ECB=y +CONFIG_CRYPTO_MD4=y +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_ARC4=y +CONFIG_CRYPTO_DES=y  # CONFIG_CRYPTO_ANSI_CPRNG is not set -# CONFIG_CRC32 is not set diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h index 01d228286cb..46460f1c49c 100644 --- a/arch/microblaze/include/asm/dma-mapping.h +++ b/arch/microblaze/include/asm/dma-mapping.h @@ -114,6 +114,8 @@ static inline void __dma_sync(unsigned long paddr,  static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)  {  	struct dma_map_ops *ops = get_dma_ops(dev); + +	debug_dma_mapping_error(dev, dma_addr);  	if (ops->mapping_error)  		return ops->mapping_error(dev, dma_addr); diff --git a/arch/microblaze/include/asm/highmem.h b/arch/microblaze/include/asm/highmem.h index 2446a73140a..d0463893243 100644 --- a/arch/microblaze/include/asm/highmem.h +++ b/arch/microblaze/include/asm/highmem.h @@ -71,7 +71,7 @@ static inline void kunmap(struct page *page)  	kunmap_high(page);  } -static inline void *__kmap_atomic(struct page *page) +static inline void *kmap_atomic(struct page *page)  {  	return kmap_atomic_prot(page, kmap_prot);  } diff --git a/arch/microblaze/include/asm/ptrace.h b/arch/microblaze/include/asm/ptrace.h index 3732bcf186f..5b18ec124e5 100644 --- a/arch/microblaze/include/asm/ptrace.h +++ b/arch/microblaze/include/asm/ptrace.h @@ -16,6 +16,7 @@  #define instruction_pointer(regs)	((regs)->pc)  #define profile_pc(regs)		instruction_pointer(regs) +#define user_stack_pointer(regs)	((regs)->r1)  static inline long regs_return_value(struct pt_regs *regs)  { diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h index 927540d3cb7..a1ab5f0009e 100644 --- a/arch/microblaze/include/asm/uaccess.h +++ b/arch/microblaze/include/asm/uaccess.h @@ -108,7 +108,7 @@ static inline int ___range_ok(unsigned long addr, unsigned long size)  # define __EX_TABLE_SECTION	".section __ex_table,\"a\"\n"  #else  # define __FIXUP_SECTION	".section .discard,\"ax\"\n" -# define __EX_TABLE_SECTION	".section .discard,\"a\"\n" +# define __EX_TABLE_SECTION	".section .discard,\"ax\"\n"  #endif  extern unsigned long __copy_tofrom_user(void __user *to, diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h index 99e23937a31..10f8ac18685 100644 --- a/arch/microblaze/include/asm/unistd.h +++ b/arch/microblaze/include/asm/unistd.h @@ -35,12 +35,9 @@  #define __ARCH_WANT_SYS_SIGPROCMASK  #define __ARCH_WANT_SYS_RT_SIGACTION  #define __ARCH_WANT_SYS_RT_SIGSUSPEND -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_CLONE  #define __ARCH_WANT_SYS_VFORK -#ifdef CONFIG_MMU  #define __ARCH_WANT_SYS_FORK -#endif  /*   * "Conditional" syscalls diff --git a/arch/microblaze/include/uapi/asm/unistd.h b/arch/microblaze/include/uapi/asm/unistd.h index ccb6920f3b3..5f7fe7582f3 100644 --- a/arch/microblaze/include/uapi/asm/unistd.h +++ b/arch/microblaze/include/uapi/asm/unistd.h @@ -395,7 +395,8 @@  #define __NR_process_vm_readv	377  #define __NR_process_vm_writev	378  #define __NR_kcmp		379 +#define __NR_finit_module	380 -#define __NR_syscalls		380 +#define __NR_syscalls		381  #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */ diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S index 1cbace29b5e..4fca56cf02f 100644 --- a/arch/microblaze/kernel/syscall_table.S +++ b/arch/microblaze/kernel/syscall_table.S @@ -380,3 +380,4 @@ ENTRY(sys_call_table)  	.long sys_process_vm_readv  	.long sys_process_vm_writev  	.long sys_kcmp +	.long sys_finit_module diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index a1c5b996d66..96416553cb3 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -287,7 +287,7 @@ static struct resource *__pci_mmap_make_offset(struct pci_dev *dev,  	unsigned long io_offset = 0;  	int i, res_bit; -	if (hose == 0) +	if (!hose)  		return NULL;		/* should never happen */  	/* If memory, add on the PCI bridge address offset */ @@ -655,9 +655,8 @@ void pci_resource_to_user(const struct pci_dev *dev, int bar,   *   - Some 32 bits platforms such as 4xx can have physical space larger than   *     32 bits so we need to use 64 bits values for the parsing   */ -void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, -					    struct device_node *dev, -					    int primary) +void pci_process_bridge_OF_ranges(struct pci_controller *hose, +				  struct device_node *dev, int primary)  {  	const u32 *ranges;  	int rlen; @@ -822,15 +821,13 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,  /* Decide whether to display the domain number in /proc */  int pci_proc_domain(struct pci_bus *bus)  { -	struct pci_controller *hose = pci_bus_to_host(bus); -  	return 0;  }  /* This header fixup will do the resource fixup for all devices as they are   * probed, but not for bridge ranges   */ -static void __devinit pcibios_fixup_resources(struct pci_dev *dev) +static void pcibios_fixup_resources(struct pci_dev *dev)  {  	struct pci_controller *hose = pci_bus_to_host(dev->bus);  	int i; @@ -871,8 +868,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources);   * things go more smoothly when it gets it right. It should covers cases such   * as Apple "closed" bridge resources and bare-metal pSeries unassigned bridges   */ -static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus, -							   struct resource *res) +static int pcibios_uninitialized_bridge_resource(struct pci_bus *bus, +						 struct resource *res)  {  	struct pci_controller *hose = pci_bus_to_host(bus);  	struct pci_dev *dev = bus->self; @@ -933,7 +930,7 @@ static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus,  }  /* Fixup resources of a PCI<->PCI bridge */ -static void __devinit pcibios_fixup_bridge(struct pci_bus *bus) +static void pcibios_fixup_bridge(struct pci_bus *bus)  {  	struct resource *res;  	int i; @@ -970,14 +967,14 @@ static void __devinit pcibios_fixup_bridge(struct pci_bus *bus)  	}  } -void __devinit pcibios_setup_bus_self(struct pci_bus *bus) +void pcibios_setup_bus_self(struct pci_bus *bus)  {  	/* Fix up the bus resources for P2P bridges */  	if (bus->self != NULL)  		pcibios_fixup_bridge(bus);  } -void __devinit pcibios_setup_bus_devices(struct pci_bus *bus) +void pcibios_setup_bus_devices(struct pci_bus *bus)  {  	struct pci_dev *dev; @@ -1002,7 +999,7 @@ void __devinit pcibios_setup_bus_devices(struct pci_bus *bus)  	}  } -void __devinit pcibios_fixup_bus(struct pci_bus *bus) +void pcibios_fixup_bus(struct pci_bus *bus)  {  	/* When called from the generic PCI probe, read PCI<->PCI bridge  	 * bases. This is -not- called when generating the PCI tree from @@ -1124,7 +1121,7 @@ static int __init reparent_resources(struct resource *parent,   *	    as well.   */ -void pcibios_allocate_bus_resources(struct pci_bus *bus) +static void pcibios_allocate_bus_resources(struct pci_bus *bus)  {  	struct pci_bus *b;  	int i; @@ -1179,7 +1176,7 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)  		}  		printk(KERN_WARNING "PCI: Cannot allocate resource region "  		       "%d of PCI bridge %d, will remap\n", i, bus->number); -clear_resource: +  		res->start = res->end = 0;  		res->flags = 0;  	} @@ -1188,7 +1185,7 @@ clear_resource:  		pcibios_allocate_bus_resources(b);  } -static inline void __devinit alloc_resource(struct pci_dev *dev, int idx) +static inline void alloc_resource(struct pci_dev *dev, int idx)  {  	struct resource *pr, *r = &dev->resource[idx]; @@ -1351,7 +1348,7 @@ void __init pcibios_resource_survey(void)   * rest of the code later, for now, keep it as-is as our main   * resource allocation function doesn't deal with sub-trees yet.   */ -void __devinit pcibios_claim_one_bus(struct pci_bus *bus) +void pcibios_claim_one_bus(struct pci_bus *bus)  {  	struct pci_dev *dev;  	struct pci_bus *child_bus; @@ -1410,7 +1407,8 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)  	return pci_enable_resources(dev, mask);  } -static void __devinit pcibios_setup_phb_resources(struct pci_controller *hose, struct list_head *resources) +static void pcibios_setup_phb_resources(struct pci_controller *hose, +					struct list_head *resources)  {  	unsigned long io_offset;  	struct resource *res; @@ -1433,7 +1431,8 @@ static void __devinit pcibios_setup_phb_resources(struct pci_controller *hose, s  		res->end = res->start + IO_SPACE_LIMIT;  		res->flags = IORESOURCE_IO;  	} -	pci_add_resource_offset(resources, res, hose->io_base_virt - _IO_BASE); +	pci_add_resource_offset(resources, res, +		(__force resource_size_t)(hose->io_base_virt - _IO_BASE));  	pr_debug("PCI: PHB IO resource    = %016llx-%016llx [%lx]\n",  		 (unsigned long long)res->start, @@ -1477,7 +1476,7 @@ struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus)  	return of_node_get(hose->dn);  } -static void __devinit pcibios_scan_phb(struct pci_controller *hose) +static void pcibios_scan_phb(struct pci_controller *hose)  {  	LIST_HEAD(resources);  	struct pci_bus *bus; diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index d971d1586f1..2ac626ab9d4 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -39,10 +39,8 @@ config MIPS  	select GENERIC_CLOCKEVENTS  	select GENERIC_CMOS_UPDATE  	select HAVE_MOD_ARCH_SPECIFIC -	select MODULES_USE_ELF_REL -	select MODULES_USE_ELF_RELA if 64BIT -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE +	select MODULES_USE_ELF_REL if MODULES +	select MODULES_USE_ELF_RELA if MODULES && 64BIT  menu "Machine selection" diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c index a7193ae13a5..b67930d1932 100644 --- a/arch/mips/alchemy/common/time.c +++ b/arch/mips/alchemy/common/time.c @@ -53,7 +53,7 @@ static struct clocksource au1x_counter1_clocksource = {  	.read		= au1x_counter1_read,  	.mask		= CLOCKSOURCE_MASK(32),  	.flags		= CLOCK_SOURCE_IS_CONTINUOUS, -	.rating		= 100, +	.rating		= 1500,  };  static int au1x_rtcmatch2_set_next_event(unsigned long delta, @@ -84,7 +84,7 @@ static irqreturn_t au1x_rtcmatch2_irq(int irq, void *dev_id)  static struct clock_event_device au1x_rtcmatch2_clockdev = {  	.name		= "rtcmatch2",  	.features	= CLOCK_EVT_FEAT_ONESHOT, -	.rating		= 100, +	.rating		= 1500,  	.set_next_event	= au1x_rtcmatch2_set_next_event,  	.set_mode	= au1x_rtcmatch2_set_mode,  	.cpumask	= cpu_all_mask, @@ -158,20 +158,6 @@ cntr_err:  	return -1;  } -static void __init alchemy_setup_c0timer(void) -{ -	/* -	 * MIPS kernel assigns 'au1k_wait' to 'cpu_wait' before this -	 * function is called.  Because the Alchemy counters are unusable -	 * the C0 timekeeping code is installed and use of the 'wait' -	 * instruction must be prohibited, which is done most easily by -	 * assigning NULL to cpu_wait. -	 */ -	cpu_wait = NULL; -	r4k_clockevent_init(); -	init_r4k_clocksource(); -} -  static int alchemy_m2inttab[] __initdata = {  	AU1000_RTC_MATCH2_INT,  	AU1500_RTC_MATCH2_INT, @@ -186,8 +172,7 @@ void __init plat_time_init(void)  	int t;  	t = alchemy_get_cputype(); -	if (t == ALCHEMY_CPU_UNKNOWN) -		alchemy_setup_c0timer(); -	else if (alchemy_time_init(alchemy_m2inttab[t])) -		alchemy_setup_c0timer(); +	if (t == ALCHEMY_CPU_UNKNOWN || +	    alchemy_time_init(alchemy_m2inttab[t])) +		cpu_wait = NULL;	/* wait doesn't work with r4k timer */  } diff --git a/arch/mips/cavium-octeon/serial.c b/arch/mips/cavium-octeon/serial.c index 569f41bdcc4..f393f65f392 100644 --- a/arch/mips/cavium-octeon/serial.c +++ b/arch/mips/cavium-octeon/serial.c @@ -43,7 +43,7 @@ void octeon_serial_out(struct uart_port *up, int offset, int value)  	cvmx_write_csr((uint64_t)(up->membase + (offset << 3)), (u8)value);  } -static int __devinit octeon_serial_probe(struct platform_device *pdev) +static int octeon_serial_probe(struct platform_device *pdev)  {  	int irq, res;  	struct resource *res_mem; diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h index be39a12901c..006b43e38a9 100644 --- a/arch/mips/include/asm/dma-mapping.h +++ b/arch/mips/include/asm/dma-mapping.h @@ -40,6 +40,8 @@ static inline int dma_supported(struct device *dev, u64 mask)  static inline int dma_mapping_error(struct device *dev, u64 mask)  {  	struct dma_map_ops *ops = get_dma_ops(dev); + +	debug_dma_mapping_error(dev, mask);  	return ops->mapping_error(dev, mask);  } diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h index 31ab10f02ba..dbaec94046d 100644 --- a/arch/mips/include/asm/page.h +++ b/arch/mips/include/asm/page.h @@ -45,8 +45,6 @@  #define HUGETLB_PAGE_ORDER	({BUILD_BUG(); 0; })  #endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */ -#ifndef __ASSEMBLY__ -  #include <linux/pfn.h>  #include <asm/io.h> @@ -139,8 +137,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;   */  #define ptep_buddy(x)	((pte_t *)((unsigned long)(x) ^ sizeof(pte_t))) -#endif /* !__ASSEMBLY__ */ -  /*   * __pa()/__va() should be used only during mem init.   */ @@ -202,7 +198,10 @@ typedef struct { unsigned long pgprot; } pgprot_t;  #endif  #define virt_to_page(kaddr)	pfn_to_page(PFN_DOWN(virt_to_phys(kaddr))) -#define virt_addr_valid(kaddr)	pfn_valid(PFN_DOWN(virt_to_phys(kaddr))) + +extern int __virt_addr_valid(const volatile void *kaddr); +#define virt_addr_valid(kaddr)						\ +	__virt_addr_valid((const volatile void *) (kaddr))  #define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | VM_EXEC | \  				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h index 90bf3b3fce1..d69ea743272 100644 --- a/arch/mips/include/asm/pci.h +++ b/arch/mips/include/asm/pci.h @@ -145,7 +145,7 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)  extern char * (*pcibios_plat_setup)(char *str);  /* this function parses memory ranges from a device node */ -extern void __devinit pci_load_of_ranges(struct pci_controller *hose, -					 struct device_node *node); +extern void pci_load_of_ranges(struct pci_controller *hose, +			       struct device_node *node);  #endif /* _ASM_PCI_H */ diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h index cec5e125f7e..a3186f2bb8a 100644 --- a/arch/mips/include/asm/ptrace.h +++ b/arch/mips/include/asm/ptrace.h @@ -49,6 +49,7 @@ static inline long regs_return_value(struct pt_regs *regs)  #define instruction_pointer(regs) ((regs)->cp0_epc)  #define profile_pc(regs) instruction_pointer(regs) +#define user_stack_pointer(r) ((r)->regs[29])  extern asmlinkage void syscall_trace_enter(struct pt_regs *regs);  extern asmlinkage void syscall_trace_leave(struct pt_regs *regs); diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h index 18806a52061..b2050b9e64b 100644 --- a/arch/mips/include/asm/thread_info.h +++ b/arch/mips/include/asm/thread_info.h @@ -29,10 +29,11 @@ struct thread_info {  	__u32			cpu;		/* current CPU */  	int			preempt_count;	/* 0 => preemptable, <0 => BUG */ -	mm_segment_t		addr_limit;	/* thread address space: -						   0-0xBFFFFFFF for user-thead -						   0-0xFFFFFFFF for kernel-thread -						*/ +	mm_segment_t		addr_limit;	/* +						 * thread address space limit: +						 * 0x7fffffff for user-thead +						 * 0xffffffff for kernel-thread +						 */  	struct restart_block	restart_block;  	struct pt_regs		*regs;  }; diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h index b306e2081ca..9e47cc11aa2 100644 --- a/arch/mips/include/asm/unistd.h +++ b/arch/mips/include/asm/unistd.h @@ -20,7 +20,6 @@  #define __ARCH_OMIT_COMPAT_SYS_GETDENTS64  #define __ARCH_WANT_OLD_READDIR  #define __ARCH_WANT_SYS_ALARM -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_GETHOSTNAME  #define __ARCH_WANT_SYS_IPC  #define __ARCH_WANT_SYS_PAUSE diff --git a/arch/mips/include/uapi/asm/signal.h b/arch/mips/include/uapi/asm/signal.h index 3f1237c6c80..770732cb8d0 100644 --- a/arch/mips/include/uapi/asm/signal.h +++ b/arch/mips/include/uapi/asm/signal.h @@ -86,12 +86,6 @@ typedef unsigned long old_sigset_t;		/* at least 32 bits */  #define SA_RESTORER	0x04000000	/* Only for o32 */ -/* - * sigaltstack controls - */ -#define SS_ONSTACK     1 -#define SS_DISABLE     2 -  #define MINSIGSTKSZ    2048  #define SIGSTKSZ       8192 diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h index cc98a9dcb01..0eebf3c3e03 100644 --- a/arch/mips/include/uapi/asm/unistd.h +++ b/arch/mips/include/uapi/asm/unistd.h @@ -368,16 +368,17 @@  #define __NR_process_vm_readv		(__NR_Linux + 345)  #define __NR_process_vm_writev		(__NR_Linux + 346)  #define __NR_kcmp			(__NR_Linux + 347) +#define __NR_finit_module		(__NR_Linux + 348)  /*   * Offset of the last Linux o32 flavoured syscall   */ -#define __NR_Linux_syscalls		347 +#define __NR_Linux_syscalls		348  #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */  #define __NR_O32_Linux			4000 -#define __NR_O32_Linux_syscalls		347 +#define __NR_O32_Linux_syscalls		348  #if _MIPS_SIM == _MIPS_SIM_ABI64 @@ -692,16 +693,17 @@  #define __NR_process_vm_readv		(__NR_Linux + 304)  #define __NR_process_vm_writev		(__NR_Linux + 305)  #define __NR_kcmp			(__NR_Linux + 306) +#define __NR_finit_module		(__NR_Linux + 307)  /*   * Offset of the last Linux 64-bit flavoured syscall   */ -#define __NR_Linux_syscalls		306 +#define __NR_Linux_syscalls		307  #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */  #define __NR_64_Linux			5000 -#define __NR_64_Linux_syscalls		306 +#define __NR_64_Linux_syscalls		307  #if _MIPS_SIM == _MIPS_SIM_NABI32 @@ -1021,15 +1023,16 @@  #define __NR_process_vm_readv		(__NR_Linux + 309)  #define __NR_process_vm_writev		(__NR_Linux + 310)  #define __NR_kcmp			(__NR_Linux + 311) +#define __NR_finit_module		(__NR_Linux + 312)  /*   * Offset of the last N32 flavoured syscall   */ -#define __NR_Linux_syscalls		311 +#define __NR_Linux_syscalls		312  #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */  #define __NR_N32_Linux			6000 -#define __NR_N32_Linux_syscalls		311 +#define __NR_N32_Linux_syscalls		312  #endif /* _UAPI_ASM_UNISTD_H */ diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c index 9690998d4ef..50285b2c7ff 100644 --- a/arch/mips/kernel/asm-offsets.c +++ b/arch/mips/kernel/asm-offsets.c @@ -200,6 +200,9 @@ void output_mm_defines(void)  	DEFINE(_PTRS_PER_PMD, PTRS_PER_PMD);  	DEFINE(_PTRS_PER_PTE, PTRS_PER_PTE);  	BLANK(); +	DEFINE(_PAGE_SHIFT, PAGE_SHIFT); +	DEFINE(_PAGE_SIZE, PAGE_SIZE); +	BLANK();  }  #ifdef CONFIG_32BIT diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index 8882e5766f2..8a0096d6281 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S @@ -19,7 +19,6 @@  #include <asm/mipsregs.h>  #include <asm/stackframe.h>  #include <asm/war.h> -#include <asm/page.h>  #include <asm/thread_info.h>  #define PANIC_PIC(msg)					\ @@ -483,8 +482,8 @@ NESTED(nmi_handler, PT_SIZE, sp)  	MFC0	k1, CP0_ENTRYHI  	andi	k1, 0xff	/* ASID_MASK */  	MFC0	k0, CP0_EPC -	PTR_SRL	k0, PAGE_SHIFT + 1 -	PTR_SLL	k0, PAGE_SHIFT + 1 +	PTR_SRL	k0, _PAGE_SHIFT + 1 +	PTR_SLL	k0, _PAGE_SHIFT + 1  	or	k1, k0  	MTC0	k1, CP0_ENTRYHI  	mtc0_tlbw_hazard diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S index ea695d9605e..fcf97312f32 100644 --- a/arch/mips/kernel/head.S +++ b/arch/mips/kernel/head.S @@ -21,7 +21,6 @@  #include <asm/asmmacro.h>  #include <asm/irqflags.h>  #include <asm/regdef.h> -#include <asm/page.h>  #include <asm/pgtable-bits.h>  #include <asm/mipsregs.h>  #include <asm/stackframe.h> diff --git a/arch/mips/kernel/octeon_switch.S b/arch/mips/kernel/octeon_switch.S index 0441f54b2a6..207f1341578 100644 --- a/arch/mips/kernel/octeon_switch.S +++ b/arch/mips/kernel/octeon_switch.S @@ -15,7 +15,6 @@  #include <asm/fpregdef.h>  #include <asm/mipsregs.h>  #include <asm/asm-offsets.h> -#include <asm/page.h>  #include <asm/pgtable-bits.h>  #include <asm/regdef.h>  #include <asm/stackframe.h> diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c index b14c14d90fc..d9c81c5a6c9 100644 --- a/arch/mips/kernel/perf_event_mipsxx.c +++ b/arch/mips/kernel/perf_event_mipsxx.c @@ -847,7 +847,6 @@ static const struct mips_perf_event xlp_event_map[PERF_COUNT_HW_MAX] = {  	[PERF_COUNT_HW_CACHE_MISSES] = { 0x07, CNTR_ALL }, /* PAPI_L1_ICM */  	[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = { 0x1b, CNTR_ALL }, /* PAPI_BR_CN */  	[PERF_COUNT_HW_BRANCH_MISSES] = { 0x1c, CNTR_ALL }, /* PAPI_BR_MSP */ -	[PERF_COUNT_HW_BUS_CYCLES] = { UNSUPPORTED_PERF_EVENT_ID },  };  /* 24K/34K/1004K cores can share the same cache event map. */ @@ -1115,24 +1114,12 @@ static const struct mips_perf_event xlp_cache_map  		[C(RESULT_ACCESS)]	= { 0x2f, CNTR_ALL }, /* PAPI_L1_DCW */  		[C(RESULT_MISS)]	= { 0x2e, CNTR_ALL }, /* PAPI_L1_STM */  	}, -	[C(OP_PREFETCH)] = { -		[C(RESULT_ACCESS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -		[C(RESULT_MISS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -	},  },  [C(L1I)] = {  	[C(OP_READ)] = {  		[C(RESULT_ACCESS)]	= { 0x04, CNTR_ALL }, /* PAPI_L1_ICA */  		[C(RESULT_MISS)]	= { 0x07, CNTR_ALL }, /* PAPI_L1_ICM */  	}, -	[C(OP_WRITE)] = { -		[C(RESULT_ACCESS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -		[C(RESULT_MISS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -	}, -	[C(OP_PREFETCH)] = { -		[C(RESULT_ACCESS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -		[C(RESULT_MISS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -	},  },  [C(LL)] = {  	[C(OP_READ)] = { @@ -1143,10 +1130,6 @@ static const struct mips_perf_event xlp_cache_map  		[C(RESULT_ACCESS)]	= { 0x34, CNTR_ALL }, /* PAPI_L2_DCA */  		[C(RESULT_MISS)]	= { 0x36, CNTR_ALL }, /* PAPI_L2_DCM */  	}, -	[C(OP_PREFETCH)] = { -		[C(RESULT_ACCESS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -		[C(RESULT_MISS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -	},  },  [C(DTLB)] = {  	/* @@ -1154,45 +1137,24 @@ static const struct mips_perf_event xlp_cache_map  	 * read and write.  	 */  	[C(OP_READ)] = { -		[C(RESULT_ACCESS)]	= { UNSUPPORTED_PERF_EVENT_ID },  		[C(RESULT_MISS)]	= { 0x2d, CNTR_ALL }, /* PAPI_TLB_DM */  	},  	[C(OP_WRITE)] = { -		[C(RESULT_ACCESS)]	= { UNSUPPORTED_PERF_EVENT_ID },  		[C(RESULT_MISS)]	= { 0x2d, CNTR_ALL }, /* PAPI_TLB_DM */  	}, -	[C(OP_PREFETCH)] = { -		[C(RESULT_ACCESS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -		[C(RESULT_MISS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -	},  },  [C(ITLB)] = {  	[C(OP_READ)] = { -		[C(RESULT_ACCESS)]	= { UNSUPPORTED_PERF_EVENT_ID },  		[C(RESULT_MISS)]	= { 0x08, CNTR_ALL }, /* PAPI_TLB_IM */  	},  	[C(OP_WRITE)] = { -		[C(RESULT_ACCESS)]	= { UNSUPPORTED_PERF_EVENT_ID },  		[C(RESULT_MISS)]	= { 0x08, CNTR_ALL }, /* PAPI_TLB_IM */  	}, -	[C(OP_PREFETCH)] = { -		[C(RESULT_ACCESS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -		[C(RESULT_MISS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -	},  },  [C(BPU)] = {  	[C(OP_READ)] = { -		[C(RESULT_ACCESS)]	= { UNSUPPORTED_PERF_EVENT_ID },  		[C(RESULT_MISS)]	= { 0x25, CNTR_ALL },  	}, -	[C(OP_WRITE)] = { -		[C(RESULT_ACCESS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -		[C(RESULT_MISS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -	}, -	[C(OP_PREFETCH)] = { -		[C(RESULT_ACCESS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -		[C(RESULT_MISS)]	= { UNSUPPORTED_PERF_EVENT_ID }, -	},  },  }; diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S index 9c51be5a163..8d32d5a6b46 100644 --- a/arch/mips/kernel/r2300_switch.S +++ b/arch/mips/kernel/r2300_switch.S @@ -15,7 +15,6 @@  #include <asm/fpregdef.h>  #include <asm/mipsregs.h>  #include <asm/asm-offsets.h> -#include <asm/page.h>  #include <asm/regdef.h>  #include <asm/stackframe.h>  #include <asm/thread_info.h> diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S index 42d2a393842..8decdfacb44 100644 --- a/arch/mips/kernel/r4k_switch.S +++ b/arch/mips/kernel/r4k_switch.S @@ -15,7 +15,6 @@  #include <asm/fpregdef.h>  #include <asm/mipsregs.h>  #include <asm/asm-offsets.h> -#include <asm/page.h>  #include <asm/pgtable-bits.h>  #include <asm/regdef.h>  #include <asm/stackframe.h> diff --git a/arch/mips/kernel/relocate_kernel.S b/arch/mips/kernel/relocate_kernel.S index e4142c5f7c2..804ebb2c34a 100644 --- a/arch/mips/kernel/relocate_kernel.S +++ b/arch/mips/kernel/relocate_kernel.S @@ -9,7 +9,6 @@  #include <asm/asm.h>  #include <asm/asmmacro.h>  #include <asm/regdef.h> -#include <asm/page.h>  #include <asm/mipsregs.h>  #include <asm/stackframe.h>  #include <asm/addrspace.h> @@ -50,7 +49,7 @@ process_entry:  	and		s3, s2, 0x8  	beq		s3, zero, process_entry  	and		s2, s2, ~0x8 -	li		s6, (1 << PAGE_SHIFT) / SZREG +	li		s6, (1 << _PAGE_SHIFT) / SZREG  copy_word:  	/* copy page word by word */ diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index 374f66e05f3..d20a4bc9ed0 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S @@ -583,6 +583,7 @@ einval:	li	v0, -ENOSYS  	sys	sys_process_vm_readv	6	/* 4345 */  	sys	sys_process_vm_writev	6  	sys	sys_kcmp		5 +	sys	sys_finit_module	3  	.endm  	/* We pre-compute the number of _instruction_ bytes needed to diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index 169de6a6d91..b64f642da07 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S @@ -422,4 +422,5 @@ sys_call_table:  	PTR	sys_process_vm_readv  	PTR	sys_process_vm_writev		/* 5305 */  	PTR	sys_kcmp +	PTR	sys_finit_module  	.size	sys_call_table,.-sys_call_table diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index ad3de9668da..c29ac197f44 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S @@ -416,4 +416,5 @@ EXPORT(sysn32_call_table)  	PTR	compat_sys_process_vm_readv  	PTR	compat_sys_process_vm_writev	/* 6310 */  	PTR	sys_kcmp +	PTR	sys_finit_module  	.size	sysn32_call_table,.-sysn32_call_table diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 9601be6afa3..cf3e75e4665 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S @@ -540,4 +540,5 @@ sys_call_table:  	PTR	compat_sys_process_vm_readv	/* 4345 */  	PTR	compat_sys_process_vm_writev  	PTR	sys_kcmp +	PTR	sys_finit_module  	.size	sys_call_table,.-sys_call_table diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 2e6374a589e..66bf4e22d9b 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c @@ -188,7 +188,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)  }  /* preload SMP state for boot cpu */ -void __devinit smp_prepare_boot_cpu(void) +void smp_prepare_boot_cpu(void)  {  	set_cpu_possible(0, true);  	set_cpu_online(0, true); diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 007ccbe1e26..0a4336b803e 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -1,7 +1,8 @@  #include <asm/asm-offsets.h> -#include <asm/page.h>  #include <asm/thread_info.h> +#define PAGE_SIZE _PAGE_SIZE +  /*   * Put .bss..swapper_pg_dir as the first thing in .bss. This will   * ensure that it has .bss alignment (64K). diff --git a/arch/mips/lantiq/xway/dma.c b/arch/mips/lantiq/xway/dma.c index 6453962ac89..e44a1866653 100644 --- a/arch/mips/lantiq/xway/dma.c +++ b/arch/mips/lantiq/xway/dma.c @@ -210,7 +210,7 @@ ltq_dma_init_port(int p)  }  EXPORT_SYMBOL_GPL(ltq_dma_init_port); -static int __devinit +static int  ltq_dma_init(struct platform_device *pdev)  {  	struct clk *clk; diff --git a/arch/mips/lantiq/xway/gptu.c b/arch/mips/lantiq/xway/gptu.c index cbb56fc022b..e30b1ed1b93 100644 --- a/arch/mips/lantiq/xway/gptu.c +++ b/arch/mips/lantiq/xway/gptu.c @@ -133,7 +133,7 @@ static inline void clkdev_add_gptu(struct device *dev, const char *con,  	clkdev_add(&clk->cl);  } -static int __devinit gptu_probe(struct platform_device *pdev) +static int gptu_probe(struct platform_device *pdev)  {  	struct clk *clk;  	struct resource *res; diff --git a/arch/mips/lantiq/xway/xrx200_phy_fw.c b/arch/mips/lantiq/xway/xrx200_phy_fw.c index fe808bf5366..d4d9d31f152 100644 --- a/arch/mips/lantiq/xway/xrx200_phy_fw.c +++ b/arch/mips/lantiq/xway/xrx200_phy_fw.c @@ -54,7 +54,7 @@ static dma_addr_t xway_gphy_load(struct platform_device *pdev)  	return dev_addr;  } -static int __devinit xway_phy_fw_probe(struct platform_device *pdev) +static int xway_phy_fw_probe(struct platform_device *pdev)  {  	dma_addr_t fw_addr;  	struct property *pp; diff --git a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c index cacfd31e8ec..7657fd21cd3 100644 --- a/arch/mips/mm/ioremap.c +++ b/arch/mips/mm/ioremap.c @@ -190,3 +190,9 @@ void __iounmap(const volatile void __iomem *addr)  EXPORT_SYMBOL(__ioremap);  EXPORT_SYMBOL(__iounmap); + +int __virt_addr_valid(const volatile void *kaddr) +{ +	return pfn_valid(PFN_DOWN(virt_to_phys(kaddr))); +} +EXPORT_SYMBOL_GPL(__virt_addr_valid); diff --git a/arch/mips/mm/tlbex-fault.S b/arch/mips/mm/tlbex-fault.S index e99eaa1fbed..318855eb5f8 100644 --- a/arch/mips/mm/tlbex-fault.S +++ b/arch/mips/mm/tlbex-fault.S @@ -7,7 +7,6 @@   * Copyright (C) 1999 Silicon Graphics, Inc.   */  #include <asm/mipsregs.h> -#include <asm/page.h>  #include <asm/regdef.h>  #include <asm/stackframe.h> diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 05613355627..1c8ac49ec72 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c @@ -976,13 +976,6 @@ build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr)  #endif  	uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */  	uasm_i_lw(p, ptr, uasm_rel_lo(pgdc), ptr); - -	if (cpu_has_mips_r2) { -		uasm_i_ext(p, tmp, tmp, PGDIR_SHIFT, (32 - PGDIR_SHIFT)); -		uasm_i_ins(p, ptr, tmp, PGD_T_LOG2, (32 - PGDIR_SHIFT)); -		return; -	} -  	uasm_i_srl(p, tmp, tmp, PGDIR_SHIFT); /* get pgd only bits */  	uasm_i_sll(p, tmp, tmp, PGD_T_LOG2);  	uasm_i_addu(p, ptr, ptr, tmp); /* add in pgd offset */ @@ -1018,15 +1011,6 @@ static void __cpuinit build_adjust_context(u32 **p, unsigned int ctx)  static void __cpuinit build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr)  { -	if (cpu_has_mips_r2) { -		/* PTE ptr offset is obtained from BadVAddr */ -		UASM_i_MFC0(p, tmp, C0_BADVADDR); -		UASM_i_LW(p, ptr, 0, ptr); -		uasm_i_ext(p, tmp, tmp, PAGE_SHIFT+1, PGDIR_SHIFT-PAGE_SHIFT-1); -		uasm_i_ins(p, ptr, tmp, PTE_T_LOG2+1, PGDIR_SHIFT-PAGE_SHIFT-1); -		return; -	} -  	/*  	 * Bug workaround for the Nevada. It seems as if under certain  	 * circumstances the move from cp0_context might produce a diff --git a/arch/mips/mti-sead3/sead3-i2c-drv.c b/arch/mips/mti-sead3/sead3-i2c-drv.c index 0375ee66bca..7aa2225e75b 100644 --- a/arch/mips/mti-sead3/sead3-i2c-drv.c +++ b/arch/mips/mti-sead3/sead3-i2c-drv.c @@ -297,7 +297,7 @@ static void sead3_i2c_platform_setup(struct pic32_i2c_platform_data *priv)  		priv->base + PIC32_I2CxSTATCLR);  } -static int __devinit sead3_i2c_platform_probe(struct platform_device *pdev) +static int sead3_i2c_platform_probe(struct platform_device *pdev)  {  	struct pic32_i2c_platform_data *priv;  	struct resource *r; @@ -345,7 +345,7 @@ out:  	return ret;  } -static int __devexit sead3_i2c_platform_remove(struct platform_device *pdev) +static int sead3_i2c_platform_remove(struct platform_device *pdev)  {  	struct pic32_i2c_platform_data *priv = platform_get_drvdata(pdev); @@ -383,7 +383,7 @@ static struct platform_driver sead3_i2c_platform_driver = {  		.owner	= THIS_MODULE,  	},  	.probe		= sead3_i2c_platform_probe, -	.remove		= __devexit_p(sead3_i2c_platform_remove), +	.remove		= sead3_i2c_platform_remove,  	.suspend	= sead3_i2c_platform_suspend,  	.resume		= sead3_i2c_platform_resume,  }; diff --git a/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c b/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c index 46509b0a620..514675ed0cd 100644 --- a/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c +++ b/arch/mips/mti-sead3/sead3-pic32-i2c-drv.c @@ -304,8 +304,7 @@ static void i2c_platform_disable(struct i2c_platform_data *priv)  	pr_debug("i2c_platform_disable\n");  } -static int __devinit -i2c_platform_probe(struct platform_device *pdev) +static int i2c_platform_probe(struct platform_device *pdev)  {  	struct i2c_platform_data *priv;  	struct resource *r; @@ -362,8 +361,7 @@ out:  	return ret;  } -static int __devexit -i2c_platform_remove(struct platform_device *pdev) +static int i2c_platform_remove(struct platform_device *pdev)  {  	struct i2c_platform_data *priv = platform_get_drvdata(pdev); @@ -408,7 +406,7 @@ static struct platform_driver i2c_platform_driver = {  		.owner	= THIS_MODULE,  	},  	.probe		= i2c_platform_probe, -	.remove		= __devexit_p(i2c_platform_remove), +	.remove		= i2c_platform_remove,  	.suspend	= i2c_platform_suspend,  	.resume		= i2c_platform_resume,  }; diff --git a/arch/mips/pci/fixup-cobalt.c b/arch/mips/pci/fixup-cobalt.c index 3e7ce65d776..9553b14002d 100644 --- a/arch/mips/pci/fixup-cobalt.c +++ b/arch/mips/pci/fixup-cobalt.c @@ -37,7 +37,7 @@  #define VIA_COBALT_BRD_ID_REG  0x94  #define VIA_COBALT_BRD_REG_to_ID(reg)	((unsigned char)(reg) >> 4) -static void __devinit qube_raq_galileo_early_fixup(struct pci_dev *dev) +static void qube_raq_galileo_early_fixup(struct pci_dev *dev)  {  	if (dev->devfn == PCI_DEVFN(0, 0) &&  		(dev->class >> 8) == PCI_CLASS_MEMORY_OTHER) { @@ -51,7 +51,7 @@ static void __devinit qube_raq_galileo_early_fixup(struct pci_dev *dev)  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT64111,  	 qube_raq_galileo_early_fixup); -static void __devinit qube_raq_via_bmIDE_fixup(struct pci_dev *dev) +static void qube_raq_via_bmIDE_fixup(struct pci_dev *dev)  {  	unsigned short cfgword;  	unsigned char lt; @@ -74,7 +74,7 @@ static void __devinit qube_raq_via_bmIDE_fixup(struct pci_dev *dev)  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1,  	 qube_raq_via_bmIDE_fixup); -static void __devinit qube_raq_galileo_fixup(struct pci_dev *dev) +static void qube_raq_galileo_fixup(struct pci_dev *dev)  {  	if (dev->devfn != PCI_DEVFN(0, 0))  		return; @@ -129,7 +129,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT64111,  int cobalt_board_id; -static void __devinit qube_raq_via_board_id_fixup(struct pci_dev *dev) +static void qube_raq_via_board_id_fixup(struct pci_dev *dev)  {  	u8 id;  	int retval; diff --git a/arch/mips/pci/fixup-emma2rh.c b/arch/mips/pci/fixup-emma2rh.c index 0d9ccf4dfc5..beaec32b02e 100644 --- a/arch/mips/pci/fixup-emma2rh.c +++ b/arch/mips/pci/fixup-emma2rh.c @@ -52,7 +52,7 @@ static unsigned char irq_map[][5] __initdata = {  	       MARKEINS_PCI_IRQ_INTA, MARKEINS_PCI_IRQ_INTB,},  }; -static void __devinit nec_usb_controller_fixup(struct pci_dev *dev) +static void nec_usb_controller_fixup(struct pci_dev *dev)  {  	if (PCI_SLOT(dev->devfn) == EMMA2RH_USB_SLOT)  		/* on board USB controller configuration */ @@ -67,7 +67,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB,   * if it is the host bridge by marking it as such.  These resources are of   * no consequence to the PCI layer (they are handled elsewhere).   */ -static void __devinit emma2rh_pci_host_fixup(struct pci_dev *dev) +static void emma2rh_pci_host_fixup(struct pci_dev *dev)  {  	int i; diff --git a/arch/mips/pci/fixup-fuloong2e.c b/arch/mips/pci/fixup-fuloong2e.c index 0857ab8c391..63ab4a042cd 100644 --- a/arch/mips/pci/fixup-fuloong2e.c +++ b/arch/mips/pci/fixup-fuloong2e.c @@ -48,7 +48,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)  	return 0;  } -static void __devinit loongson2e_nec_fixup(struct pci_dev *pdev) +static void loongson2e_nec_fixup(struct pci_dev *pdev)  {  	unsigned int val; @@ -60,7 +60,7 @@ static void __devinit loongson2e_nec_fixup(struct pci_dev *pdev)  	pci_write_config_dword(pdev, 0xe4, 1 << 5);  } -static void __devinit loongson2e_686b_func0_fixup(struct pci_dev *pdev) +static void loongson2e_686b_func0_fixup(struct pci_dev *pdev)  {  	unsigned char c; @@ -135,7 +135,7 @@ static void __devinit loongson2e_686b_func0_fixup(struct pci_dev *pdev)  	printk(KERN_INFO"via686b fix: ISA bridge done\n");  } -static void __devinit loongson2e_686b_func1_fixup(struct pci_dev *pdev) +static void loongson2e_686b_func1_fixup(struct pci_dev *pdev)  {  	printk(KERN_INFO"via686b fix: IDE\n"); @@ -168,19 +168,19 @@ static void __devinit loongson2e_686b_func1_fixup(struct pci_dev *pdev)  	printk(KERN_INFO"via686b fix: IDE done\n");  } -static void __devinit loongson2e_686b_func2_fixup(struct pci_dev *pdev) +static void loongson2e_686b_func2_fixup(struct pci_dev *pdev)  {  	/* irq routing */  	pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, 10);  } -static void __devinit loongson2e_686b_func3_fixup(struct pci_dev *pdev) +static void loongson2e_686b_func3_fixup(struct pci_dev *pdev)  {  	/* irq routing */  	pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, 11);  } -static void __devinit loongson2e_686b_func5_fixup(struct pci_dev *pdev) +static void loongson2e_686b_func5_fixup(struct pci_dev *pdev)  {  	unsigned int val;  	unsigned char c; diff --git a/arch/mips/pci/fixup-lemote2f.c b/arch/mips/pci/fixup-lemote2f.c index a7b917dcf60..519daaebb5d 100644 --- a/arch/mips/pci/fixup-lemote2f.c +++ b/arch/mips/pci/fixup-lemote2f.c @@ -96,21 +96,21 @@ int pcibios_plat_dev_init(struct pci_dev *dev)  }  /* CS5536 SPEC. fixup */ -static void __devinit loongson_cs5536_isa_fixup(struct pci_dev *pdev) +static void loongson_cs5536_isa_fixup(struct pci_dev *pdev)  {  	/* the uart1 and uart2 interrupt in PIC is enabled as default */  	pci_write_config_dword(pdev, PCI_UART1_INT_REG, 1);  	pci_write_config_dword(pdev, PCI_UART2_INT_REG, 1);  } -static void __devinit loongson_cs5536_ide_fixup(struct pci_dev *pdev) +static void loongson_cs5536_ide_fixup(struct pci_dev *pdev)  {  	/* setting the mutex pin as IDE function */  	pci_write_config_dword(pdev, PCI_IDE_CFG_REG,  			       CS5536_IDE_FLASH_SIGNATURE);  } -static void __devinit loongson_cs5536_acc_fixup(struct pci_dev *pdev) +static void loongson_cs5536_acc_fixup(struct pci_dev *pdev)  {  	/* enable the AUDIO interrupt in PIC  */  	pci_write_config_dword(pdev, PCI_ACC_INT_REG, 1); @@ -118,14 +118,14 @@ static void __devinit loongson_cs5536_acc_fixup(struct pci_dev *pdev)  	pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xc0);  } -static void __devinit loongson_cs5536_ohci_fixup(struct pci_dev *pdev) +static void loongson_cs5536_ohci_fixup(struct pci_dev *pdev)  {  	/* enable the OHCI interrupt in PIC */  	/* THE OHCI, EHCI, UDC, OTG are shared with interrupt in PIC */  	pci_write_config_dword(pdev, PCI_OHCI_INT_REG, 1);  } -static void __devinit loongson_cs5536_ehci_fixup(struct pci_dev *pdev) +static void loongson_cs5536_ehci_fixup(struct pci_dev *pdev)  {  	u32 hi, lo; @@ -137,7 +137,7 @@ static void __devinit loongson_cs5536_ehci_fixup(struct pci_dev *pdev)  	pci_write_config_dword(pdev, PCI_EHCI_FLADJ_REG, 0x2000);  } -static void __devinit loongson_nec_fixup(struct pci_dev *pdev) +static void loongson_nec_fixup(struct pci_dev *pdev)  {  	unsigned int val; diff --git a/arch/mips/pci/fixup-malta.c b/arch/mips/pci/fixup-malta.c index 9a1a2244522..75d03f6be3b 100644 --- a/arch/mips/pci/fixup-malta.c +++ b/arch/mips/pci/fixup-malta.c @@ -8,7 +8,7 @@  #define PCID		4  /* This table is filled in by interrogating the PIIX4 chip */ -static char pci_irq[5] __devinitdata = { +static char pci_irq[5] = {  };  static char irq_tab[][5] __initdata = { @@ -50,10 +50,10 @@ int pcibios_plat_dev_init(struct pci_dev *dev)  	return 0;  } -static void __devinit malta_piix_func0_fixup(struct pci_dev *pdev) +static void malta_piix_func0_fixup(struct pci_dev *pdev)  {  	unsigned char reg_val; -	static int piixirqmap[16] __devinitdata = {  /* PIIX PIRQC[A:D] irq mappings */ +	static int piixirqmap[16] = {  /* PIIX PIRQC[A:D] irq mappings */  		0,  0, 	0,  3,  		4,  5,  6,  7,  		0,  9, 10, 11, @@ -84,7 +84,7 @@ static void __devinit malta_piix_func0_fixup(struct pci_dev *pdev)  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_0,  	 malta_piix_func0_fixup); -static void __devinit malta_piix_func1_fixup(struct pci_dev *pdev) +static void malta_piix_func1_fixup(struct pci_dev *pdev)  {  	unsigned char reg_val; @@ -104,7 +104,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB,  	 malta_piix_func1_fixup);  /* Enable PCI 2.1 compatibility in PIIX4 */ -static void __devinit quirk_dlcsetup(struct pci_dev *dev) +static void quirk_dlcsetup(struct pci_dev *dev)  {  	u8 odlc, ndlc; diff --git a/arch/mips/pci/fixup-rc32434.c b/arch/mips/pci/fixup-rc32434.c index 76bb1be99d4..d0f6ecbf35f 100644 --- a/arch/mips/pci/fixup-rc32434.c +++ b/arch/mips/pci/fixup-rc32434.c @@ -32,12 +32,12 @@  #include <asm/mach-rc32434/rc32434.h>  #include <asm/mach-rc32434/irq.h> -static int __devinitdata irq_map[2][12] = { +static int irq_map[2][12] = {  	{0, 0, 2, 3, 2, 3, 0, 0, 0, 0, 0, 1},  	{0, 0, 1, 3, 0, 2, 1, 3, 0, 2, 1, 3}  }; -int __devinit pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) +int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)  {  	int irq = 0; @@ -47,7 +47,7 @@ int __devinit pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)  	return irq + GROUP4_IRQ_BASE + 4;  } -static void __devinit rc32434_pci_early_fixup(struct pci_dev *dev) +static void rc32434_pci_early_fixup(struct pci_dev *dev)  {  	if (PCI_SLOT(dev->devfn) == 6 && dev->bus->number == 0) {  		/* disable prefetched memory range */ diff --git a/arch/mips/pci/fixup-sb1250.c b/arch/mips/pci/fixup-sb1250.c index d02900a7291..1441becdcb6 100644 --- a/arch/mips/pci/fixup-sb1250.c +++ b/arch/mips/pci/fixup-sb1250.c @@ -15,7 +15,7 @@   * Set the BCM1250, etc. PCI host bridge's TRDY timeout   * to the finite max.   */ -static void __devinit quirk_sb1250_pci(struct pci_dev *dev) +static void quirk_sb1250_pci(struct pci_dev *dev)  {  	pci_write_config_byte(dev, 0x40, 0xff);  } @@ -25,7 +25,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIBYTE, PCI_DEVICE_ID_BCM1250_PCI,  /*   * The BCM1250, etc. PCI/HT bridge reports as a host bridge.   */ -static void __devinit quirk_sb1250_ht(struct pci_dev *dev) +static void quirk_sb1250_ht(struct pci_dev *dev)  {  	dev->class = PCI_CLASS_BRIDGE_PCI << 8;  } @@ -35,7 +35,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIBYTE, PCI_DEVICE_ID_BCM1250_HT,  /*   * Set the SP1011 HT/PCI bridge's TRDY timeout to the finite max.   */ -static void __devinit quirk_sp1011(struct pci_dev *dev) +static void quirk_sp1011(struct pci_dev *dev)  {  	pci_write_config_byte(dev, 0x64, 0xff);  } diff --git a/arch/mips/pci/ops-bcm63xx.c b/arch/mips/pci/ops-bcm63xx.c index 65c7bd10048..4a156629e95 100644 --- a/arch/mips/pci/ops-bcm63xx.c +++ b/arch/mips/pci/ops-bcm63xx.c @@ -411,7 +411,7 @@ struct pci_ops bcm63xx_cb_ops = {   * only one IO window, so it  cannot be shared by PCI and cardbus, use   * fixup to choose and detect unhandled configuration   */ -static void __devinit bcm63xx_fixup(struct pci_dev *dev) +static void bcm63xx_fixup(struct pci_dev *dev)  {  	static int io_window = -1;  	int i, found, new_io_window; diff --git a/arch/mips/pci/ops-tx4927.c b/arch/mips/pci/ops-tx4927.c index bc13e29d2bb..0d69d6f4ea4 100644 --- a/arch/mips/pci/ops-tx4927.c +++ b/arch/mips/pci/ops-tx4927.c @@ -191,13 +191,13 @@ static struct {  	u8 trdyto;  	u8 retryto;  	u16 gbwc; -} tx4927_pci_opts __devinitdata = { +} tx4927_pci_opts = {  	.trdyto = 0,  	.retryto = 0,  	.gbwc = 0xfe0,	/* 4064 GBUSCLK for CCFG.GTOT=0b11 */  }; -char *__devinit tx4927_pcibios_setup(char *str) +char *tx4927_pcibios_setup(char *str)  {  	unsigned long val; @@ -495,7 +495,7 @@ irqreturn_t tx4927_pcierr_interrupt(int irq, void *dev_id)  }  #ifdef CONFIG_TOSHIBA_FPCIB0 -static void __devinit tx4927_quirk_slc90e66_bridge(struct pci_dev *dev) +static void tx4927_quirk_slc90e66_bridge(struct pci_dev *dev)  {  	struct tx4927_pcic_reg __iomem *pcicptr = pci_bus_to_pcicptr(dev->bus); diff --git a/arch/mips/pci/pci-alchemy.c b/arch/mips/pci/pci-alchemy.c index ec125bed721..c4ea6cc55f9 100644 --- a/arch/mips/pci/pci-alchemy.c +++ b/arch/mips/pci/pci-alchemy.c @@ -356,7 +356,7 @@ static struct syscore_ops alchemy_pci_pmops = {  	.resume		= alchemy_pci_resume,  }; -static int __devinit alchemy_pci_probe(struct platform_device *pdev) +static int alchemy_pci_probe(struct platform_device *pdev)  {  	struct alchemy_pci_platdata *pd = pdev->dev.platform_data;  	struct alchemy_pci_context *ctx; diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c index fdc24440294..7f4f49b09b5 100644 --- a/arch/mips/pci/pci-ip27.c +++ b/arch/mips/pci/pci-ip27.c @@ -143,7 +143,7 @@ int __cpuinit bridge_probe(nasid_t nasid, int widget_id, int masterwid)   * A given PCI device, in general, should be able to intr any of the cpus   * on any one of the hubs connected to its xbow.   */ -int __devinit pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) +int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)  {  	return 0;  } @@ -212,7 +212,7 @@ static inline void pci_enable_swapping(struct pci_dev *dev)  	bridge->b_widget.w_tflush;	/* Flush */  } -static void __devinit pci_fixup_ioc3(struct pci_dev *d) +static void pci_fixup_ioc3(struct pci_dev *d)  {  	pci_disable_swapping(d);  } diff --git a/arch/mips/pci/pci-lantiq.c b/arch/mips/pci/pci-lantiq.c index 075d87acd12..95681789b51 100644 --- a/arch/mips/pci/pci-lantiq.c +++ b/arch/mips/pci/pci-lantiq.c @@ -95,7 +95,7 @@ static inline u32 ltq_calc_bar11mask(void)  	return bar11mask;  } -static int __devinit ltq_pci_startup(struct platform_device *pdev) +static int ltq_pci_startup(struct platform_device *pdev)  {  	struct device_node *node = pdev->dev.of_node;  	const __be32 *req_mask, *bus_clk; @@ -201,7 +201,7 @@ static int __devinit ltq_pci_startup(struct platform_device *pdev)  	return 0;  } -static int __devinit ltq_pci_probe(struct platform_device *pdev) +static int ltq_pci_probe(struct platform_device *pdev)  {  	struct resource *res_cfg, *res_bridge; diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index 4040416e060..a1843448fad 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c @@ -76,7 +76,7 @@ pcibios_align_resource(void *data, const struct resource *res,  	return start;  } -static void __devinit pcibios_scanbus(struct pci_controller *hose) +static void pcibios_scanbus(struct pci_controller *hose)  {  	static int next_busno;  	static int need_domain_info; @@ -120,8 +120,7 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose)  }  #ifdef CONFIG_OF -void __devinit pci_load_of_ranges(struct pci_controller *hose, -				struct device_node *node) +void pci_load_of_ranges(struct pci_controller *hose, struct device_node *node)  {  	const __be32 *ranges;  	int rlen; @@ -174,7 +173,7 @@ void __devinit pci_load_of_ranges(struct pci_controller *hose,  static DEFINE_MUTEX(pci_scan_mutex); -void __devinit register_pci_controller(struct pci_controller *hose) +void register_pci_controller(struct pci_controller *hose)  {  	if (request_resource(&iomem_resource, hose->mem_resource) < 0)  		goto out; @@ -303,7 +302,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)  	return pcibios_plat_dev_init(dev);  } -void __devinit pcibios_fixup_bus(struct pci_bus *bus) +void pcibios_fixup_bus(struct pci_bus *bus)  {  	struct pci_dev *dev = bus->self; diff --git a/arch/mips/power/hibernate.S b/arch/mips/power/hibernate.S index f8a751c0328..61e2558a2dc 100644 --- a/arch/mips/power/hibernate.S +++ b/arch/mips/power/hibernate.S @@ -8,7 +8,6 @@   *         Wu Zhangjin <wuzhangjin@gmail.com>   */  #include <asm/asm-offsets.h> -#include <asm/page.h>  #include <asm/regdef.h>  #include <asm/asm.h> @@ -35,7 +34,7 @@ LEAF(swsusp_arch_resume)  0:  	PTR_L t1, PBE_ADDRESS(t0)   /* source */  	PTR_L t2, PBE_ORIG_ADDRESS(t0) /* destination */ -	PTR_ADDU t3, t1, PAGE_SIZE +	PTR_ADDU t3, t1, _PAGE_SIZE  1:  	REG_L t8, (t1)  	REG_S t8, (t2) diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c index d6c7bd4b5ab..2e9c283b8e6 100644 --- a/arch/mips/sni/setup.c +++ b/arch/mips/sni/setup.c @@ -236,7 +236,7 @@ void __init plat_mem_setup(void)  #include <video/vga.h>  #include <video/cirrus.h> -static void __devinit quirk_cirrus_ram_size(struct pci_dev *dev) +static void quirk_cirrus_ram_size(struct pci_dev *dev)  {  	u16 cmd; diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c index b14ee53581a..ce8f8b9b930 100644 --- a/arch/mips/txx9/generic/pci.c +++ b/arch/mips/txx9/generic/pci.c @@ -256,8 +256,7 @@ static irqreturn_t i8259_interrupt(int irq, void *dev_id)  	return IRQ_HANDLED;  } -static int __devinit -txx9_i8259_irq_setup(int irq) +static int txx9_i8259_irq_setup(int irq)  {  	int err; @@ -269,7 +268,7 @@ txx9_i8259_irq_setup(int irq)  	return err;  } -static void __devinit quirk_slc90e66_bridge(struct pci_dev *dev) +static void quirk_slc90e66_bridge(struct pci_dev *dev)  {  	int irq;	/* PCI/ISA Bridge interrupt */  	u8 reg_64; @@ -304,7 +303,7 @@ static void __devinit quirk_slc90e66_bridge(struct pci_dev *dev)  	smsc_fdc37m81x_config_end();  } -static void __devinit quirk_slc90e66_ide(struct pci_dev *dev) +static void quirk_slc90e66_ide(struct pci_dev *dev)  {  	unsigned char dat;  	int regs[2] = {0x41, 0x43}; @@ -339,7 +338,7 @@ static void __devinit quirk_slc90e66_ide(struct pci_dev *dev)  }  #endif /* CONFIG_TOSHIBA_FPCIB0 */ -static void __devinit tc35815_fixup(struct pci_dev *dev) +static void tc35815_fixup(struct pci_dev *dev)  {  	/* This device may have PM registers but not they are not supported. */  	if (dev->pm_cap) { @@ -348,7 +347,7 @@ static void __devinit tc35815_fixup(struct pci_dev *dev)  	}  } -static void __devinit final_fixup(struct pci_dev *dev) +static void final_fixup(struct pci_dev *dev)  {  	unsigned char bist; diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig index 72471744a91..e70001cfa05 100644 --- a/arch/mn10300/Kconfig +++ b/arch/mn10300/Kconfig @@ -6,10 +6,9 @@ config MN10300  	select ARCH_WANT_IPC_PARSE_VERSION  	select HAVE_ARCH_TRACEHOOK  	select HAVE_ARCH_KGDB +	select GENERIC_ATOMIC64  	select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER  	select GENERIC_CLOCKEVENTS -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	select MODULES_USE_ELF_RELA  config AM33_2 diff --git a/arch/mn10300/include/asm/unistd.h b/arch/mn10300/include/asm/unistd.h index cabf8ba73b2..e6d2ed4ba68 100644 --- a/arch/mn10300/include/asm/unistd.h +++ b/arch/mn10300/include/asm/unistd.h @@ -43,7 +43,6 @@  #define __ARCH_WANT_SYS_SIGPROCMASK  #define __ARCH_WANT_SYS_RT_SIGACTION  #define __ARCH_WANT_SYS_RT_SIGSUSPEND -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_VFORK  #define __ARCH_WANT_SYS_CLONE diff --git a/arch/mn10300/include/uapi/asm/signal.h b/arch/mn10300/include/uapi/asm/signal.h index 08dcd6a8561..f423a08d7ee 100644 --- a/arch/mn10300/include/uapi/asm/signal.h +++ b/arch/mn10300/include/uapi/asm/signal.h @@ -92,12 +92,6 @@ typedef unsigned long sigset_t;  #define SA_RESTORER	0x04000000 -/* - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 -  #define MINSIGSTKSZ	2048  #define SIGSTKSZ	8192 diff --git a/arch/mn10300/kernel/smp.c b/arch/mn10300/kernel/smp.c index 95983cd21e7..5d7e152a23b 100644 --- a/arch/mn10300/kernel/smp.c +++ b/arch/mn10300/kernel/smp.c @@ -905,7 +905,7 @@ void __init smp_cpus_done(unsigned int max_cpus)   * Set up the cpu_online_mask, cpu_callout_map and cpu_callin_map of the boot   * processor (CPU 0).   */ -void __devinit smp_prepare_boot_cpu(void) +void smp_prepare_boot_cpu(void)  {  	cpumask_set_cpu(0, &cpu_callout_map);  	cpumask_set_cpu(0, &cpu_callin_map); @@ -930,7 +930,7 @@ void initialize_secondary(void)   * __cpu_up - Set smp_commenced_mask for the nominated CPU   * @cpu: The target CPU.   */ -int __devinit __cpu_up(unsigned int cpu, struct task_struct *tidle) +int __cpu_up(unsigned int cpu, struct task_struct *tidle)  {  	int timeout; diff --git a/arch/mn10300/unit-asb2305/pci.c b/arch/mn10300/unit-asb2305/pci.c index e2059486d3f..6911e845b8c 100644 --- a/arch/mn10300/unit-asb2305/pci.c +++ b/arch/mn10300/unit-asb2305/pci.c @@ -282,7 +282,7 @@ static int __init pci_check_direct(void)  	return -ENODEV;  } -static int __devinit is_valid_resource(struct pci_dev *dev, int idx) +static int is_valid_resource(struct pci_dev *dev, int idx)  {  	unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM;  	struct resource *devr = &dev->resource[idx], *busr; @@ -302,7 +302,7 @@ static int __devinit is_valid_resource(struct pci_dev *dev, int idx)  	return 0;  } -static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) +static void pcibios_fixup_device_resources(struct pci_dev *dev)  {  	int limit, i; @@ -325,7 +325,7 @@ static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)   *  Called after each bus is probed, but before its children   *  are examined.   */ -void __devinit pcibios_fixup_bus(struct pci_bus *bus) +void pcibios_fixup_bus(struct pci_bus *bus)  {  	struct pci_dev *dev; diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index ec37e185d20..0ac66f67521 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -22,8 +22,6 @@ config OPENRISC  	select GENERIC_STRNCPY_FROM_USER  	select GENERIC_STRNLEN_USER  	select MODULES_USE_ELF_RELA -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  config MMU  	def_bool y diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild index 8971026e1c6..f20d01d9aaf 100644 --- a/arch/openrisc/include/asm/Kbuild +++ b/arch/openrisc/include/asm/Kbuild @@ -32,6 +32,7 @@ generic-y += ipcbuf.h  generic-y += irq_regs.h  generic-y += kdebug.h  generic-y += kmap_types.h +generic-y += kvm_para.h  generic-y += local.h  generic-y += mman.h  generic-y += module.h diff --git a/arch/openrisc/include/asm/io.h b/arch/openrisc/include/asm/io.h index 07f5299d6c2..7c691399da3 100644 --- a/arch/openrisc/include/asm/io.h +++ b/arch/openrisc/include/asm/io.h @@ -30,6 +30,7 @@  #define PIO_MASK		0  #include <asm-generic/io.h> +#include <asm/pgtable.h>  extern void __iomem *__ioremap(phys_addr_t offset, unsigned long size,  				pgprot_t prot); diff --git a/arch/openrisc/include/uapi/asm/kvm_para.h b/arch/openrisc/include/uapi/asm/kvm_para.h deleted file mode 100644 index 14fab8f0b95..00000000000 --- a/arch/openrisc/include/uapi/asm/kvm_para.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/kvm_para.h> diff --git a/arch/openrisc/include/uapi/asm/unistd.h b/arch/openrisc/include/uapi/asm/unistd.h index 5082b806632..ce40b71df00 100644 --- a/arch/openrisc/include/uapi/asm/unistd.h +++ b/arch/openrisc/include/uapi/asm/unistd.h @@ -20,7 +20,6 @@  #define sys_mmap2 sys_mmap_pgoff -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_CLONE diff --git a/arch/openrisc/kernel/asm-offsets.c b/arch/openrisc/kernel/asm-offsets.c index 1a242a0d758..ddb73685586 100644 --- a/arch/openrisc/kernel/asm-offsets.c +++ b/arch/openrisc/kernel/asm-offsets.c @@ -34,15 +34,11 @@  #include <linux/mm.h>  #include <linux/io.h>  #include <linux/thread_info.h> +#include <linux/kbuild.h>  #include <asm/page.h>  #include <asm/pgtable.h>  #include <asm/processor.h> -#define DEFINE(sym, val) \ -		asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) -  int main(void)  {  	/* offsets into the task_struct */ diff --git a/arch/openrisc/lib/delay.c b/arch/openrisc/lib/delay.c index c330767c921..c82b09f4a10 100644 --- a/arch/openrisc/lib/delay.c +++ b/arch/openrisc/lib/delay.c @@ -22,7 +22,7 @@  #include <asm/timex.h>  #include <asm/processor.h> -int __devinit read_current_timer(unsigned long *timer_value) +int read_current_timer(unsigned long *timer_value)  {  	*timer_value = mfspr(SPR_TTCR);  	return 0; diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index e688a2be30f..b77feffbade 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -22,8 +22,6 @@ config PARISC  	select GENERIC_STRNCPY_FROM_USER  	select HAVE_MOD_ARCH_SPECIFIC  	select MODULES_USE_ELF_RELA -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	select CLONE_BACKWARDS  	help diff --git a/arch/parisc/include/asm/parport.h b/arch/parisc/include/asm/parport.h index 00d9cc3e7b9..c391d7cbc22 100644 --- a/arch/parisc/include/asm/parport.h +++ b/arch/parisc/include/asm/parport.h @@ -8,7 +8,7 @@  #define _ASM_PARPORT_H 1 -static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) +static int parport_pc_find_nonpci_ports (int autoirq, int autodma)  {  	/* nothing ! */  	return 0; diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h index 1efef41659c..3043194547c 100644 --- a/arch/parisc/include/asm/unistd.h +++ b/arch/parisc/include/asm/unistd.h @@ -163,7 +163,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)	\  #define __ARCH_WANT_SYS_RT_SIGACTION  #define __ARCH_WANT_SYS_RT_SIGSUSPEND  #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_VFORK  #define __ARCH_WANT_SYS_CLONE diff --git a/arch/parisc/include/uapi/asm/signal.h b/arch/parisc/include/uapi/asm/signal.h index b1ddaa24337..a2fa297196b 100644 --- a/arch/parisc/include/uapi/asm/signal.h +++ b/arch/parisc/include/uapi/asm/signal.h @@ -71,12 +71,6 @@  #define SA_RESTORER	0x04000000 /* obsolete -- ignored */ -/*  - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 -  #define MINSIGSTKSZ	2048  #define SIGSTKSZ	8192 diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S index bfb44247d7a..eb7850b46c2 100644 --- a/arch/parisc/kernel/entry.S +++ b/arch/parisc/kernel/entry.S @@ -1865,7 +1865,7 @@ syscall_restore:  	/* Are we being ptraced? */  	ldw	TASK_FLAGS(%r1),%r19 -	ldi	(_TIF_SINGLESTEP|_TIF_BLOCKSTEP),%r2 +	ldi	_TIF_SYSCALL_TRACE_MASK,%r2  	and,COND(=)	%r19,%r2,%r0  	b,n	syscall_restore_rfi @@ -1978,15 +1978,23 @@ syscall_restore_rfi:  	/* sr2 should be set to zero for userspace syscalls */  	STREG	%r0,TASK_PT_SR2(%r1) -pt_regs_ok:  	LDREG	TASK_PT_GR31(%r1),%r2 -	depi	3,31,2,%r2			   /* ensure return to user mode. */ -	STREG	%r2,TASK_PT_IAOQ0(%r1) +	depi	3,31,2,%r2		   /* ensure return to user mode. */ +	STREG   %r2,TASK_PT_IAOQ0(%r1)  	ldo	4(%r2),%r2  	STREG	%r2,TASK_PT_IAOQ1(%r1) +	b	intr_restore  	copy	%r25,%r16 + +pt_regs_ok: +	LDREG	TASK_PT_IAOQ0(%r1),%r2 +	depi	3,31,2,%r2		   /* ensure return to user mode. */ +	STREG	%r2,TASK_PT_IAOQ0(%r1) +	LDREG	TASK_PT_IAOQ1(%r1),%r2 +	depi	3,31,2,%r2 +	STREG	%r2,TASK_PT_IAOQ1(%r1)  	b	intr_restore -	nop +	copy	%r25,%r16  	.import schedule,code  syscall_do_resched: diff --git a/arch/parisc/kernel/hardware.c b/arch/parisc/kernel/hardware.c index f48a640b55f..f7752f6af29 100644 --- a/arch/parisc/kernel/hardware.c +++ b/arch/parisc/kernel/hardware.c @@ -38,7 +38,7 @@   *	so don't reference this table after starting the init process   */ -static struct hp_hardware hp_hardware_list[] __devinitdata = { +static struct hp_hardware hp_hardware_list[] = {  	{HPHW_NPROC,0x01,0x4,0x0,"Indigo (840, 930)"},  	{HPHW_NPROC,0x8,0x4,0x01,"Firefox(825,925)"},  	{HPHW_NPROC,0xA,0x4,0x01,"Top Gun (835,834,935,635)"}, @@ -1230,7 +1230,7 @@ static struct hp_cpu_type_mask {  	unsigned short model;  	unsigned short mask;  	enum cpu_type cpu; -} hp_cpu_type_mask_list[] __devinitdata = { +} hp_cpu_type_mask_list[] = {  	{ 0x0000, 0x0ff0, pcx    },  /* 0x0000 - 0x000f */  	{ 0x0048, 0x0ff0, pcxl   },  /* 0x0040 - 0x004f */ @@ -1327,8 +1327,7 @@ const char * const cpu_name_version[][2] = {  	[mako2] = { "PA8900 (Shortfin)",	"2.0" }  }; -const char * __devinit -parisc_hardware_description(struct parisc_device_id *id) +const char *parisc_hardware_description(struct parisc_device_id *id)  {  	struct hp_hardware *listptr; diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c index c0b1affc06a..0299d63cd11 100644 --- a/arch/parisc/kernel/irq.c +++ b/arch/parisc/kernel/irq.c @@ -410,11 +410,13 @@ void __init init_IRQ(void)  {  	local_irq_disable();	/* PARANOID - should already be disabled */  	mtctl(~0UL, 23);	/* EIRR : clear all pending external intr */ -	claim_cpu_irqs();  #ifdef CONFIG_SMP -	if (!cpu_eiem) +	if (!cpu_eiem) { +		claim_cpu_irqs();  		cpu_eiem = EIEM_MASK(IPI_IRQ) | EIEM_MASK(TIMER_IRQ); +	}  #else +	claim_cpu_irqs();  	cpu_eiem = EIEM_MASK(TIMER_IRQ);  #endif          set_eiem(cpu_eiem);	/* EIEM : enable all external intr */ diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c index 5e34ccf39a4..2a625fb063e 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c @@ -214,8 +214,6 @@ static inline int reassemble_22(int as22)  void *module_alloc(unsigned long size)  { -	if (size == 0) -		return NULL;  	/* using RWX means less protection for modules, but it's  	 * easier than trying to map the text, data, init_text and  	 * init_data correctly */ diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c index 857c2f54547..534abd4936e 100644 --- a/arch/parisc/kernel/ptrace.c +++ b/arch/parisc/kernel/ptrace.c @@ -26,7 +26,7 @@  #include <asm/asm-offsets.h>  /* PSW bits we allow the debugger to modify */ -#define USER_PSW_BITS	(PSW_N | PSW_V | PSW_CB) +#define USER_PSW_BITS	(PSW_N | PSW_B | PSW_V | PSW_CB)  /*   * Called by kernel/ptrace.c when detaching.. diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c index 53799695599..fd051705a40 100644 --- a/arch/parisc/kernel/signal.c +++ b/arch/parisc/kernel/signal.c @@ -190,8 +190,10 @@ get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size)  	DBG(1,"get_sigframe: ka = %#lx, sp = %#lx, frame_size = %#lx\n",  			(unsigned long)ka, sp, frame_size); +	/* Align alternate stack and reserve 64 bytes for the signal +	   handler's frame marker.  */  	if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! sas_ss_flags(sp)) -		sp = current->sas_ss_sp; /* Stacks grow up! */ +		sp = (current->sas_ss_sp + 0x7f) & ~0x3f; /* Stacks grow up! */  	DBG(1,"get_sigframe: Returning sp = %#lx\n", (unsigned long)sp);  	return (void __user *) sp; /* Stacks grow up.  Fun. */ diff --git a/arch/parisc/math-emu/cnv_float.h b/arch/parisc/math-emu/cnv_float.h index 9071e093164..933423fa514 100644 --- a/arch/parisc/math-emu/cnv_float.h +++ b/arch/parisc/math-emu/cnv_float.h @@ -347,16 +347,15 @@      Sgl_isinexact_to_fix(sgl_value,exponent)  #define Duint_from_sgl_mantissa(sgl_value,exponent,dresultA,dresultB)	\ -  {Sall(sgl_value) <<= SGL_EXP_LENGTH;  /*  left-justify  */		\ +  {unsigned int val = Sall(sgl_value) << SGL_EXP_LENGTH;		\      if (exponent <= 31) {						\ -    	Dintp1(dresultA) = 0;						\ -    	Dintp2(dresultB) = (unsigned)Sall(sgl_value) >> (31 - exponent); \ +	Dintp1(dresultA) = 0;						\ +	Dintp2(dresultB) = val >> (31 - exponent);			\      }									\      else {								\ -    	Dintp1(dresultA) = Sall(sgl_value) >> (63 - exponent);		\ -    	Dintp2(dresultB) = Sall(sgl_value) << (exponent - 31);		\ +	Dintp1(dresultA) = val >> (63 - exponent);			\ +	Dintp2(dresultB) = exponent <= 62 ? val << (exponent - 31) : 0;	\      }									\ -    Sall(sgl_value) >>= SGL_EXP_LENGTH;  /* return to original */	\    }  #define Duint_setzero(dresultA,dresultB) 	\ diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 951a517a1a0..17903f1f356 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -141,10 +141,8 @@ config PPC  	select GENERIC_CLOCKEVENTS  	select GENERIC_STRNCPY_FROM_USER  	select GENERIC_STRNLEN_USER -	select GENERIC_KERNEL_THREAD  	select HAVE_MOD_ARCH_SPECIFIC  	select MODULES_USE_ELF_RELA -	select GENERIC_KERNEL_EXECVE  	select CLONE_BACKWARDS  config EARLY_PRINTK diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 159e94f4b22..b639852116f 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -181,7 +181,7 @@ $(BOOT_TARGETS2): vmlinux  bootwrapper_install:  	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) -%.dtb: +%.dtb: scripts  	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)  define archhelp diff --git a/arch/powerpc/boot/dts/a3m071.dts b/arch/powerpc/boot/dts/a3m071.dts new file mode 100644 index 00000000000..877a28cb77e --- /dev/null +++ b/arch/powerpc/boot/dts/a3m071.dts @@ -0,0 +1,144 @@ +/* + * a3m071 board Device Tree Source + * + * Copyright 2012 Stefan Roese <sr@denx.de> + * + * Copyright (C) 2011 DENX Software Engineering GmbH + * Heiko Schocher <hs@denx.de> + * + * Copyright (C) 2007 Semihalf + * Marian Balakowicz <m8@semihalf.com> + * + * This program is free software; you can redistribute  it and/or modify it + * under  the terms of  the GNU General  Public License as published by the + * Free Software Foundation;  either version 2 of the  License, or (at your + * option) any later version. + */ + +/include/ "mpc5200b.dtsi" + +/ { +	model = "anonymous,a3m071"; +	compatible = "anonymous,a3m071"; + +	soc5200@f0000000 { +		#address-cells = <1>; +		#size-cells = <1>; +		compatible = "fsl,mpc5200b-immr"; +		ranges = <0 0xf0000000 0x0000c000>; +		reg = <0xf0000000 0x00000100>; +		bus-frequency = <0>; /* From boot loader */ +		system-frequency = <0>; /* From boot loader */ + +		timer@600 { +			fsl,has-wdt; +		}; + +		spi@f00 { +			status = "disabled"; +		}; + +		usb: usb@1000 { +			status = "disabled"; +		}; + +		psc@2000 { +			compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; +			reg = <0x2000 0x100>; +			interrupts = <2 1 0>; +		}; + +		psc@2200 { +			status = "disabled"; +		}; + +		psc@2400 { +			status = "disabled"; +		}; + +		psc@2600 { +			status = "disabled"; +		}; + +		psc@2800 { +			status = "disabled"; +		}; + +		psc@2c00 {		// PSC6 +			compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; +			reg = <0x2c00 0x100>; +			interrupts = <2 4 0>; +		}; + +		ethernet@3000 { +			phy-handle = <&phy0>; +		}; + +		mdio@3000 { +			phy0: ethernet-phy@3 { +				reg = <0x03>; +			}; +		}; + +		ata@3a00 { +			status = "disabled"; +		}; + +		i2c@3d00 { +			status = "disabled"; +		}; + +		i2c@3d40 { +			status = "disabled"; +		}; +	}; + +	localbus { +		compatible = "fsl,mpc5200b-lpb","simple-bus"; +		#address-cells = <2>; +		#size-cells = <1>; +		ranges = <0 0 0xfc000000 0x02000000 +			  3 0 0xe9000000 0x00080000 +			  5 0 0xe8000000 0x00010000>; + +		flash@0,0 { +			#address-cells = <1>; +			#size-cells = <1>; +			reg = <0 0x0 0x02000000>; +			compatible = "cfi-flash"; +			bank-width = <2>; +			partition@0x0 { +				label = "u-boot"; +				reg = <0x00000000 0x00040000>; +				read-only; +			}; +			partition@0x00040000 { +				label = "env"; +				reg = <0x00040000 0x00020000>; +			}; +			partition@0x00060000 { +				label = "dtb"; +				reg = <0x00060000 0x00020000>; +			}; +			partition@0x00080000 { +				label = "kernel"; +				reg = <0x00080000 0x00500000>; +			}; +			partition@0x00580000 { +				label = "root"; +				reg = <0x00580000 0x00A80000>; +			}; +		}; + +		fpga@3,0 { +			compatible = "anonymous,a3m071-fpga"; +			reg = <3 0x0 0x00080000 +			       5 0x0 0x00010000>; +			interrupts = <0 0 3>;  /* level low */ +		}; +	}; + +	pci@f0000d00 { +		status = "disabled"; +	}; +}; diff --git a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi index 64b6abea846..5d7205b7bb0 100644 --- a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi +++ b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi @@ -354,4 +354,5 @@  /include/ "qoriq-sata2-0.dtsi"  /include/ "qoriq-sata2-1.dtsi"  /include/ "qoriq-sec4.2-0.dtsi" +/include/ "qoriq-raid1.0-0.dtsi"  }; diff --git a/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi index 0a198b0a77e..8df47fc45ab 100644 --- a/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi +++ b/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi @@ -73,6 +73,12 @@  		rtic_c = &rtic_c;  		rtic_d = &rtic_d;  		sec_mon = &sec_mon; + +		raideng = &raideng; +		raideng_jr0 = &raideng_jr0; +		raideng_jr1 = &raideng_jr1; +		raideng_jr2 = &raideng_jr2; +		raideng_jr3 = &raideng_jr3;  	};  	cpus { diff --git a/arch/powerpc/boot/dts/fsl/qoriq-raid1.0-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-raid1.0-0.dtsi new file mode 100644 index 00000000000..8d2e8aa6cf8 --- /dev/null +++ b/arch/powerpc/boot/dts/fsl/qoriq-raid1.0-0.dtsi @@ -0,0 +1,85 @@ +/* + * QorIQ RAID 1.0 device tree stub [ controller @ offset 0x320000 ] + * + * Copyright 2012 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + *     * Redistributions of source code must retain the above copyright + *       notice, this list of conditions and the following disclaimer. + *     * Redistributions in binary form must reproduce the above copyright + *       notice, this list of conditions and the following disclaimer in the + *       documentation and/or other materials provided with the distribution. + *     * Neither the name of Freescale Semiconductor nor the + *       names of its contributors may be used to endorse or promote products + *       derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +raideng: raideng@320000 { +	compatible = "fsl,raideng-v1.0"; +	#address-cells = <1>; +	#size-cells = <1>; +	reg = <0x320000 0x10000>; +	ranges = <0 0x320000 0x10000>; + +	raideng_jq0@1000 { +		compatible = "fsl,raideng-v1.0-job-queue"; +		#address-cells = <1>; +		#size-cells = <1>; +		reg = <0x1000 0x1000>; +		ranges = <0x0 0x1000 0x1000>; + +		raideng_jr0: jr@0 { +			compatible = "fsl,raideng-v1.0-job-ring", "fsl,raideng-v1.0-hp-ring"; +			reg = <0x0 0x400>; +			interrupts = <139 2 0 0>; +			interrupt-parent = <&mpic>; +		}; + +		raideng_jr1: jr@400 { +			compatible = "fsl,raideng-v1.0-job-ring", "fsl,raideng-v1.0-lp-ring"; +			reg = <0x400 0x400>; +			interrupts = <140 2 0 0>; +			interrupt-parent = <&mpic>; +		}; +	}; + +	raideng_jq1@2000 { +		compatible = "fsl,raideng-v1.0-job-queue"; +		#address-cells = <1>; +		#size-cells = <1>; +		reg = <0x2000 0x1000>; +		ranges = <0x0 0x2000 0x1000>; + +		raideng_jr2: jr@0 { +			compatible = "fsl,raideng-v1.0-job-ring", "fsl,raideng-v1.0-hp-ring"; +			reg = <0x0 0x400>; +			interrupts = <141 2 0 0>; +			interrupt-parent = <&mpic>; +		}; + +		raideng_jr3: jr@400 { +			compatible = "fsl,raideng-v1.0-job-ring", "fsl,raideng-v1.0-lp-ring"; +			reg = <0x400 0x400>; +			interrupts = <142 2 0 0>; +			interrupt-parent = <&mpic>; +		}; +	}; +}; diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig index 1f710a32ffa..5b8e1e50827 100644 --- a/arch/powerpc/configs/pseries_defconfig +++ b/arch/powerpc/configs/pseries_defconfig @@ -2,7 +2,7 @@ CONFIG_PPC64=y  CONFIG_ALTIVEC=y  CONFIG_VSX=y  CONFIG_SMP=y -CONFIG_NR_CPUS=1024 +CONFIG_NR_CPUS=2048  CONFIG_EXPERIMENTAL=y  CONFIG_SYSVIPC=y  CONFIG_POSIX_MQUEUE=y diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h index dc2cf9c6d9e..ef918a2328b 100644 --- a/arch/powerpc/include/asm/bitops.h +++ b/arch/powerpc/include/asm/bitops.h @@ -52,8 +52,6 @@  #define smp_mb__before_clear_bit()	smp_mb()  #define smp_mb__after_clear_bit()	smp_mb() -#define BITOP_MASK(nr)		(1UL << ((nr) % BITS_PER_LONG)) -#define BITOP_WORD(nr)		((nr) / BITS_PER_LONG)  #define BITOP_LE_SWIZZLE	((BITS_PER_LONG-1) & ~0x7)  /* Macro for generating the ***_bits() functions */ @@ -83,22 +81,22 @@ DEFINE_BITOP(change_bits, xor, "", "")  static __inline__ void set_bit(int nr, volatile unsigned long *addr)  { -	set_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); +	set_bits(BIT_MASK(nr), addr + BIT_WORD(nr));  }  static __inline__ void clear_bit(int nr, volatile unsigned long *addr)  { -	clear_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); +	clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr));  }  static __inline__ void clear_bit_unlock(int nr, volatile unsigned long *addr)  { -	clear_bits_unlock(BITOP_MASK(nr), addr + BITOP_WORD(nr)); +	clear_bits_unlock(BIT_MASK(nr), addr + BIT_WORD(nr));  }  static __inline__ void change_bit(int nr, volatile unsigned long *addr)  { -	change_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); +	change_bits(BIT_MASK(nr), addr + BIT_WORD(nr));  }  /* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output @@ -136,26 +134,26 @@ DEFINE_TESTOP(test_and_change_bits, xor, PPC_ATOMIC_ENTRY_BARRIER,  static __inline__ int test_and_set_bit(unsigned long nr,  				       volatile unsigned long *addr)  { -	return test_and_set_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; +	return test_and_set_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;  }  static __inline__ int test_and_set_bit_lock(unsigned long nr,  				       volatile unsigned long *addr)  { -	return test_and_set_bits_lock(BITOP_MASK(nr), -				addr + BITOP_WORD(nr)) != 0; +	return test_and_set_bits_lock(BIT_MASK(nr), +				addr + BIT_WORD(nr)) != 0;  }  static __inline__ int test_and_clear_bit(unsigned long nr,  					 volatile unsigned long *addr)  { -	return test_and_clear_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; +	return test_and_clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;  }  static __inline__ int test_and_change_bit(unsigned long nr,  					  volatile unsigned long *addr)  { -	return test_and_change_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; +	return test_and_change_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;  }  #include <asm-generic/bitops/non-atomic.h> @@ -280,61 +278,8 @@ unsigned long __arch_hweight64(__u64 w);  #include <asm-generic/bitops/find.h>  /* Little-endian versions */ +#include <asm-generic/bitops/le.h> -static __inline__ int test_bit_le(unsigned long nr, -				  __const__ void *addr) -{ -	__const__ unsigned char	*tmp = (__const__ unsigned char *) addr; -	return (tmp[nr >> 3] >> (nr & 7)) & 1; -} - -static inline void set_bit_le(int nr, void *addr) -{ -	set_bit(nr ^ BITOP_LE_SWIZZLE, addr); -} - -static inline void clear_bit_le(int nr, void *addr) -{ -	clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); -} - -static inline void __set_bit_le(int nr, void *addr) -{ -	__set_bit(nr ^ BITOP_LE_SWIZZLE, addr); -} - -static inline void __clear_bit_le(int nr, void *addr) -{ -	__clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); -} - -static inline int test_and_set_bit_le(int nr, void *addr) -{ -	return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); -} - -static inline int test_and_clear_bit_le(int nr, void *addr) -{ -	return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); -} - -static inline int __test_and_set_bit_le(int nr, void *addr) -{ -	return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); -} - -static inline int __test_and_clear_bit_le(int nr, void *addr) -{ -	return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); -} - -#define find_first_zero_bit_le(addr, size) \ -	find_next_zero_bit_le((addr), (size), 0) -unsigned long find_next_zero_bit_le(const void *addr, -				    unsigned long size, unsigned long offset); - -unsigned long find_next_bit_le(const void *addr, -				    unsigned long size, unsigned long offset);  /* Bitmap functions for the ext2 filesystem */  #include <asm-generic/bitops/ext2-atomic-setbit.h> diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h index 21a0687b8c4..76f81bd64f1 100644 --- a/arch/powerpc/include/asm/cputable.h +++ b/arch/powerpc/include/asm/cputable.h @@ -401,6 +401,14 @@ extern const char *powerpc_base_platform;  	    CPU_FTR_DSCR | CPU_FTR_SAO  | CPU_FTR_ASYM_SMT | \  	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \  	    CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY) +#define CPU_FTRS_POWER8 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ +	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\ +	    CPU_FTR_MMCRA | CPU_FTR_SMT | \ +	    CPU_FTR_COHERENT_ICACHE | \ +	    CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ +	    CPU_FTR_DSCR | CPU_FTR_SAO  | \ +	    CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ +	    CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY)  #define CPU_FTRS_CELL	(CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \  	    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \  	    CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ @@ -421,8 +429,8 @@ extern const char *powerpc_base_platform;  #define CPU_FTRS_POSSIBLE	\  	    (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 |	\  	    CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 |	\ -	    CPU_FTRS_POWER7 | CPU_FTRS_CELL | CPU_FTRS_PA6T |		\ -	    CPU_FTR_VSX) +	    CPU_FTRS_POWER7 | CPU_FTRS_POWER8 | CPU_FTRS_CELL |		\ +	    CPU_FTRS_PA6T | CPU_FTR_VSX)  #endif  #else  enum { diff --git a/arch/powerpc/include/asm/dbell.h b/arch/powerpc/include/asm/dbell.h index 154c067761b..607e4eeeb69 100644 --- a/arch/powerpc/include/asm/dbell.h +++ b/arch/powerpc/include/asm/dbell.h @@ -1,5 +1,5 @@  /* - * Copyright 2009 Freescale Semicondutor, Inc. + * Copyright 2009 Freescale Semiconductor, Inc.   *   * This program is free software; you can redistribute it and/or   * modify it under the terms of the GNU General Public License diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 78160874809..e27e9ad6818 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h @@ -172,6 +172,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)  {  	struct dma_map_ops *dma_ops = get_dma_ops(dev); +	debug_dma_mapping_error(dev, dma_addr);  	if (dma_ops->mapping_error)  		return dma_ops->mapping_error(dev, dma_addr); diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h index b0ef73882b3..a8fb03e2277 100644 --- a/arch/powerpc/include/asm/eeh.h +++ b/arch/powerpc/include/asm/eeh.h @@ -183,7 +183,7 @@ static inline void eeh_unlock(void)  #define EEH_MAX_ALLOWED_FREEZES 5  typedef void *(*eeh_traverse_func)(void *data, void *flag); -int __devinit eeh_phb_pe_create(struct pci_controller *phb); +int eeh_phb_pe_create(struct pci_controller *phb);  int eeh_add_to_parent_pe(struct eeh_dev *edev);  int eeh_rmv_from_parent_pe(struct eeh_dev *edev, int purge_pe);  void *eeh_pe_dev_traverse(struct eeh_pe *root, @@ -191,8 +191,8 @@ void *eeh_pe_dev_traverse(struct eeh_pe *root,  void eeh_pe_restore_bars(struct eeh_pe *pe);  struct pci_bus *eeh_pe_bus_get(struct eeh_pe *pe); -void * __devinit eeh_dev_init(struct device_node *dn, void *data); -void __devinit eeh_dev_phb_init_dynamic(struct pci_controller *phb); +void *eeh_dev_init(struct device_node *dn, void *data); +void eeh_dev_phb_init_dynamic(struct pci_controller *phb);  int __init eeh_ops_register(struct eeh_ops *ops);  int __exit eeh_ops_unregister(const char *name);  unsigned long eeh_check_failure(const volatile void __iomem *token, diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h index a43c1473915..ad708dda3ba 100644 --- a/arch/powerpc/include/asm/exception-64s.h +++ b/arch/powerpc/include/asm/exception-64s.h @@ -48,6 +48,35 @@  #define EX_LR		72  #define EX_CFAR		80 +#ifdef CONFIG_RELOCATABLE +#define EXCEPTION_RELON_PROLOG_PSERIES_1(label, h)			\ +	ld	r12,PACAKBASE(r13);	/* get high part of &label */	\ +	mfspr	r11,SPRN_##h##SRR0;	/* save SRR0 */			\ +	LOAD_HANDLER(r12,label);					\ +	mtlr	r12;							\ +	mfspr	r12,SPRN_##h##SRR1;	/* and SRR1 */			\ +	li	r10,MSR_RI;						\ +	mtmsrd 	r10,1;			/* Set RI (EE=0) */		\ +	blr; +#else +/* If not relocatable, we can jump directly -- and save messing with LR */ +#define EXCEPTION_RELON_PROLOG_PSERIES_1(label, h)			\ +	mfspr	r11,SPRN_##h##SRR0;	/* save SRR0 */			\ +	mfspr	r12,SPRN_##h##SRR1;	/* and SRR1 */			\ +	li	r10,MSR_RI;						\ +	mtmsrd 	r10,1;			/* Set RI (EE=0) */		\ +	b	label; +#endif + +/* + * As EXCEPTION_PROLOG_PSERIES(), except we've already got relocation on + * so no need to rfid.  Save lr in case we're CONFIG_RELOCATABLE, in which + * case EXCEPTION_RELON_PROLOG_PSERIES_1 will be using lr. + */ +#define EXCEPTION_RELON_PROLOG_PSERIES(area, label, h, extra, vec)	\ +	EXCEPTION_PROLOG_1(area, extra, vec);				\ +	EXCEPTION_RELON_PROLOG_PSERIES_1(label, h) +  /*   * We're short on space and time in the exception prolog, so we can't   * use the normal SET_REG_IMMEDIATE macro. Normally we just need the @@ -55,12 +84,29 @@   * word.   */  #define LOAD_HANDLER(reg, label)					\ -	addi	reg,reg,(label)-_stext;	/* virt addr of handler ... */ +	/* Handlers must be within 64K of kbase, which must be 64k aligned */ \ +	ori	reg,reg,(label)-_stext;	/* virt addr of handler ... */  /* Exception register prefixes */  #define EXC_HV	H  #define EXC_STD +#if defined(CONFIG_RELOCATABLE) +/* + * If we support interrupts with relocation on AND we're a relocatable + * kernel, we need to use LR to get to the 2nd level handler.  So, save/restore + * it when required. + */ +#define SAVE_LR(reg, area)	mflr	reg ; 	std	reg,area+EX_LR(r13) +#define GET_LR(reg, area) 			ld	reg,area+EX_LR(r13) +#define RESTORE_LR(reg, area)	ld	reg,area+EX_LR(r13) ; mtlr reg +#else +/* ...else LR is unused and in register. */ +#define SAVE_LR(reg, area) +#define GET_LR(reg, area) 	mflr	reg +#define RESTORE_LR(reg, area) +#endif +  #define __EXCEPTION_PROLOG_1(area, extra, vec)				\  	GET_PACA(r13);							\  	std	r9,area+EX_R9(r13);	/* save r9 - r12 */		\ @@ -69,6 +115,7 @@  	mfspr	r10,SPRN_CFAR;						\  	std	r10,area+EX_CFAR(r13);					\  	END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66);		\ +	SAVE_LR(r10, area);						\  	mfcr	r9;							\  	extra(vec);							\  	std	r11,area+EX_R11(r13);					\ @@ -169,6 +216,7 @@ do_kvm_##n:								\  	sth	r1,PACA_TRAP_SAVE(r13);					   \  	std	r3,area+EX_R3(r13);					   \  	addi	r3,r13,area;		/* r3 -> where regs are saved*/	   \ +	RESTORE_LR(r1, area);						   \  	b	bad_stack;						   \  3:	std	r9,_CCR(r1);		/* save CR in stackframe	*/ \  	std	r11,_NIP(r1);		/* save SRR0 in stackframe	*/ \ @@ -194,8 +242,8 @@ do_kvm_##n:								\  	ld	r10,area+EX_CFAR(r13);					   \  	std	r10,ORIG_GPR3(r1);					   \  	END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66);		   \ +	GET_LR(r9,area);		/* Get LR, later save to stack	*/ \  	ld	r2,PACATOC(r13);	/* get kernel TOC into r2	*/ \ -	mflr	r9;			/* save LR in stackframe	*/ \  	std	r9,_LINK(r1);						   \  	mfctr	r10;			/* save CTR in stackframe	*/ \  	std	r10,_CTR(r1);						   \ @@ -232,6 +280,26 @@ label##_hv:						\  	EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common,	\  				 EXC_HV, KVMTEST, vec) +#define STD_RELON_EXCEPTION_PSERIES(loc, vec, label)	\ +	. = loc;					\ +	.globl label##_relon_pSeries;			\ +label##_relon_pSeries:					\ +	HMT_MEDIUM;					\ +	/* No guest interrupts come through here */	\ +	SET_SCRATCH0(r13);		/* save r13 */	\ +	EXCEPTION_RELON_PROLOG_PSERIES(PACA_EXGEN, label##_common, \ +				       EXC_STD, KVMTEST_PR, vec) + +#define STD_RELON_EXCEPTION_HV(loc, vec, label)		\ +	. = loc;					\ +	.globl label##_relon_hv;			\ +label##_relon_hv:					\ +	HMT_MEDIUM;					\ +	/* No guest interrupts come through here */	\ +	SET_SCRATCH0(r13);	/* save r13 */		\ +	EXCEPTION_RELON_PROLOG_PSERIES(PACA_EXGEN, label##_common, \ +				       EXC_HV, KVMTEST, vec) +  /* This associate vector numbers with bits in paca->irq_happened */  #define SOFTEN_VALUE_0x500	PACA_IRQ_EE  #define SOFTEN_VALUE_0x502	PACA_IRQ_EE @@ -257,6 +325,9 @@ label##_hv:						\  	KVMTEST(vec);							\  	_SOFTEN_TEST(EXC_STD, vec) +#define SOFTEN_NOTEST_PR(vec)		_SOFTEN_TEST(EXC_STD, vec) +#define SOFTEN_NOTEST_HV(vec)		_SOFTEN_TEST(EXC_HV, vec) +  #define __MASKABLE_EXCEPTION_PSERIES(vec, label, h, extra)		\  	HMT_MEDIUM;							\  	SET_SCRATCH0(r13);    /* save r13 */				\ @@ -279,6 +350,28 @@ label##_hv:								\  	_MASKABLE_EXCEPTION_PSERIES(vec, label,				\  				    EXC_HV, SOFTEN_TEST_HV) +#define __MASKABLE_RELON_EXCEPTION_PSERIES(vec, label, h, extra)	\ +	HMT_MEDIUM;							\ +	SET_SCRATCH0(r13);    /* save r13 */				\ +	__EXCEPTION_PROLOG_1(PACA_EXGEN, extra, vec);		\ +	EXCEPTION_RELON_PROLOG_PSERIES_1(label##_common, h); +#define _MASKABLE_RELON_EXCEPTION_PSERIES(vec, label, h, extra)	\ +	__MASKABLE_RELON_EXCEPTION_PSERIES(vec, label, h, extra) + +#define MASKABLE_RELON_EXCEPTION_PSERIES(loc, vec, label)		\ +	. = loc;							\ +	.globl label##_relon_pSeries;					\ +label##_relon_pSeries:							\ +	_MASKABLE_RELON_EXCEPTION_PSERIES(vec, label,			\ +					  EXC_STD, SOFTEN_NOTEST_PR) + +#define MASKABLE_RELON_EXCEPTION_HV(loc, vec, label)			\ +	. = loc;							\ +	.globl label##_relon_hv;					\ +label##_relon_hv:							\ +	_MASKABLE_RELON_EXCEPTION_PSERIES(vec, label,			\ +					  EXC_HV, SOFTEN_NOTEST_HV) +  /*   * Our exception common code can be passed various "additions"   * to specify the behaviour of interrupts, whether to kick the diff --git a/arch/powerpc/include/asm/firmware.h b/arch/powerpc/include/asm/firmware.h index ad0b751b0d7..973cc3be011 100644 --- a/arch/powerpc/include/asm/firmware.h +++ b/arch/powerpc/include/asm/firmware.h @@ -49,6 +49,7 @@  #define FW_FEATURE_XCMO		ASM_CONST(0x0000000008000000)  #define FW_FEATURE_OPAL		ASM_CONST(0x0000000010000000)  #define FW_FEATURE_OPALv2	ASM_CONST(0x0000000020000000) +#define FW_FEATURE_SET_MODE	ASM_CONST(0x0000000040000000)  #ifndef __ASSEMBLY__ @@ -62,7 +63,8 @@ enum {  		FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN |  		FW_FEATURE_BULK_REMOVE | FW_FEATURE_XDABR |  		FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR | -		FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO, +		FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO | +		FW_FEATURE_SET_MODE,  	FW_FEATURE_PSERIES_ALWAYS = 0,  	FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_OPALv2,  	FW_FEATURE_POWERNV_ALWAYS = 0, diff --git a/arch/powerpc/include/asm/fsl_gtm.h b/arch/powerpc/include/asm/fsl_gtm.h index 8e8c9b5032d..3b05808f9ca 100644 --- a/arch/powerpc/include/asm/fsl_gtm.h +++ b/arch/powerpc/include/asm/fsl_gtm.h @@ -1,7 +1,7 @@  /*   * Freescale General-purpose Timers Module   * - * Copyright (c) Freescale Semicondutor, Inc. 2006. + * Copyright 2006 Freescale Semiconductor, Inc.   *               Shlomi Gridish <gridish@freescale.com>   *               Jerry Huang <Chang-Ming.Huang@freescale.com>   * Copyright (c) MontaVista Software, Inc. 2008. diff --git a/arch/powerpc/include/asm/fsl_guts.h b/arch/powerpc/include/asm/fsl_guts.h index dd5ba2c2277..77ced0b3d81 100644 --- a/arch/powerpc/include/asm/fsl_guts.h +++ b/arch/powerpc/include/asm/fsl_guts.h @@ -71,7 +71,9 @@ struct ccsr_guts {  	u8	res0c4[0x224 - 0xc4];  	__be32  iodelay1;	/* 0x.0224 - IO delay control register 1 */  	__be32  iodelay2;	/* 0x.0228 - IO delay control register 2 */ -	u8	res22c[0x800 - 0x22c]; +	u8	res22c[0x604 - 0x22c]; +	__be32	pamubypenr; 	/* 0x.604 - PAMU bypass enable register */ +	u8	res608[0x800 - 0x608];  	__be32	clkdvdr;	/* 0x.0800 - Clock Divide Register */  	u8	res804[0x900 - 0x804];  	__be32	ircr;		/* 0x.0900 - Infrared Control Register */ diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h index 7a867065db7..0975e5c0bb1 100644 --- a/arch/powerpc/include/asm/hvcall.h +++ b/arch/powerpc/include/asm/hvcall.h @@ -267,7 +267,8 @@  #define H_RANDOM		0x300  #define H_COP			0x304  #define H_GET_MPP_X		0x314 -#define MAX_HCALL_OPCODE	H_GET_MPP_X +#define H_SET_MODE		0x31C +#define MAX_HCALL_OPCODE	H_SET_MODE  #ifndef __ASSEMBLY__ @@ -355,6 +356,26 @@ struct hvcall_mpp_x_data {  int h_get_mpp_x(struct hvcall_mpp_x_data *mpp_x_data); +static inline unsigned int get_longbusy_msecs(int longbusy_rc) +{ +	switch (longbusy_rc) { +	case H_LONG_BUSY_ORDER_1_MSEC: +		return 1; +	case H_LONG_BUSY_ORDER_10_MSEC: +		return 10; +	case H_LONG_BUSY_ORDER_100_MSEC: +		return 100; +	case H_LONG_BUSY_ORDER_1_SEC: +		return 1000; +	case H_LONG_BUSY_ORDER_10_SEC: +		return 10000; +	case H_LONG_BUSY_ORDER_100_SEC: +		return 100000; +	default: +		return 1; +	} +} +  #ifdef CONFIG_PPC_PSERIES  extern int CMO_PrPSP;  extern int CMO_SecPSP; diff --git a/arch/powerpc/include/asm/immap_qe.h b/arch/powerpc/include/asm/immap_qe.h index 61e8490786b..bedbff89142 100644 --- a/arch/powerpc/include/asm/immap_qe.h +++ b/arch/powerpc/include/asm/immap_qe.h @@ -3,7 +3,7 @@   * The Internal Memory Map for devices with QE on them. This   * is the superset of all QE devices (8360, etc.). - * Copyright (C) 2006. Freescale Semicondutor, Inc. All rights reserved. + * Copyright (C) 2006. Freescale Semiconductor, Inc. All rights reserved.   *   * Authors: 	Shlomi Gridish <gridish@freescale.com>   * 		Li Yang <leoli@freescale.com> diff --git a/arch/powerpc/include/asm/io-workarounds.h b/arch/powerpc/include/asm/io-workarounds.h index fbae4928692..f96dd096ff4 100644 --- a/arch/powerpc/include/asm/io-workarounds.h +++ b/arch/powerpc/include/asm/io-workarounds.h @@ -31,8 +31,8 @@ struct iowa_bus {  	void   *private;  }; -void __devinit iowa_register_bus(struct pci_controller *, struct ppc_pci_io *, -				 int (*)(struct iowa_bus *, void *), void *); +void iowa_register_bus(struct pci_controller *, struct ppc_pci_io *, +		       int (*)(struct iowa_bus *, void *), void *);  struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR);  struct iowa_bus *iowa_pio_find_bus(unsigned long); diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 3c82daf8be9..19d9d96eb8d 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h @@ -166,9 +166,6 @@ struct machdep_calls {  						unsigned long size,  						pgprot_t vma_prot); -	/* Idle loop for this platform, leave empty for default idle loop */ -	void		(*idle_loop)(void); -  	/*  	 * Function for waiting for work with reduced power in idle loop;  	 * called with interrupts disabled. diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h index 5e38eedea21..691fd8aca93 100644 --- a/arch/powerpc/include/asm/mmu.h +++ b/arch/powerpc/include/asm/mmu.h @@ -101,6 +101,7 @@  #define MMU_FTRS_POWER5		MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE  #define MMU_FTRS_POWER6		MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE  #define MMU_FTRS_POWER7		MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE +#define MMU_FTRS_POWER8		MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE  #define MMU_FTRS_CELL		MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \  				MMU_FTR_CI_LARGE_PAGE  #define MMU_FTRS_PA6T		MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ diff --git a/arch/powerpc/include/asm/pSeries_reconfig.h b/arch/powerpc/include/asm/pSeries_reconfig.h deleted file mode 100644 index c07edfe98b9..00000000000 --- a/arch/powerpc/include/asm/pSeries_reconfig.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _PPC64_PSERIES_RECONFIG_H -#define _PPC64_PSERIES_RECONFIG_H -#ifdef __KERNEL__ - -#include <linux/notifier.h> - -/* - * Use this API if your code needs to know about OF device nodes being - * added or removed on pSeries systems. - */ - -#define PSERIES_RECONFIG_ADD		0x0001 -#define PSERIES_RECONFIG_REMOVE		0x0002 -#define PSERIES_DRCONF_MEM_ADD		0x0003 -#define PSERIES_DRCONF_MEM_REMOVE	0x0004 -#define PSERIES_UPDATE_PROPERTY		0x0005 - -/** - * pSeries_reconfig_notify - Notifier value structure for OFDT property updates - * - * @node: Device tree node which owns the property being updated - * @property: Updated property - */ -struct pSeries_reconfig_prop_update { -	struct device_node *node; -	struct property *property; -}; - -#ifdef CONFIG_PPC_PSERIES -extern int pSeries_reconfig_notifier_register(struct notifier_block *); -extern void pSeries_reconfig_notifier_unregister(struct notifier_block *); -extern int pSeries_reconfig_notify(unsigned long action, void *p); -/* Not the best place to put this, will be fixed when we move some - * of the rtas suspend-me stuff to pseries */ -extern void pSeries_coalesce_init(void); -#else /* !CONFIG_PPC_PSERIES */ -static inline int pSeries_reconfig_notifier_register(struct notifier_block *nb) -{ -	return 0; -} -static inline void pSeries_reconfig_notifier_unregister(struct notifier_block *nb) { } -static inline void pSeries_coalesce_init(void) { } -#endif /* CONFIG_PPC_PSERIES */ - - -#endif /* __KERNEL__ */ -#endif /* _PPC64_PSERIES_RECONFIG_H */ diff --git a/arch/powerpc/include/asm/parport.h b/arch/powerpc/include/asm/parport.h index 1ca1102b4a2..6dc2577932b 100644 --- a/arch/powerpc/include/asm/parport.h +++ b/arch/powerpc/include/asm/parport.h @@ -12,7 +12,7 @@  #include <asm/prom.h> -static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) +static int parport_pc_find_nonpci_ports (int autoirq, int autodma)  {  	struct device_node *np;  	const u32 *prop; diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h index 42b1f43b943..51fb00a20d7 100644 --- a/arch/powerpc/include/asm/ppc-opcode.h +++ b/arch/powerpc/include/asm/ppc-opcode.h @@ -1,5 +1,5 @@  /* - * Copyright 2009 Freescale Semicondutor, Inc. + * Copyright 2009 Freescale Semiconductor, Inc.   *   * This program is free software; you can redistribute it and/or   * modify it under the terms of the GNU General Public License @@ -86,6 +86,7 @@  #define PPC_INST_DCBA_MASK		0xfc0007fe  #define PPC_INST_DCBAL			0x7c2005ec  #define PPC_INST_DCBZL			0x7c2007ec +#define PPC_INST_ICBT			0x7c00002c  #define PPC_INST_ISEL			0x7c00001e  #define PPC_INST_ISEL_MASK		0xfc00003e  #define PPC_INST_LDARX			0x7c0000a8 @@ -201,6 +202,7 @@  #define __PPC_MB(s)	(((s) & 0x1f) << 6)  #define __PPC_ME(s)	(((s) & 0x1f) << 1)  #define __PPC_BI(s)	(((s) & 0x1f) << 16) +#define __PPC_CT(t)	(((t) & 0x0f) << 21)  /*   * Only use the larx hint bit on 64bit CPUs. e500v1/v2 based CPUs will treat a @@ -263,6 +265,8 @@  					__PPC_RS(t) | __PPC_RA0(a) | __PPC_RB(b))  #define PPC_SLBFEE_DOT(t, b)	stringify_in_c(.long PPC_INST_SLBFEE | \  					__PPC_RT(t) | __PPC_RB(b)) +#define PPC_ICBT(c,a,b)		stringify_in_c(.long PPC_INST_ICBT | \ +				       __PPC_CT(c) | __PPC_RA0(a) | __PPC_RB(b))  /* PASemi instructions */  #define LBZCIX(t,a,b)		stringify_in_c(.long PPC_INST_LBZCIX | \  				       __PPC_RT(t) | __PPC_RA(a) | __PPC_RB(b)) diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h index b5c91901e38..99c92d5363e 100644 --- a/arch/powerpc/include/asm/prom.h +++ b/arch/powerpc/include/asm/prom.h @@ -58,6 +58,22 @@ static inline int of_node_to_nid(struct device_node *device) { return 0; }  extern void of_instantiate_rtc(void); +/* The of_drconf_cell struct defines the layout of the LMB array + * specified in the device tree property + * ibm,dynamic-reconfiguration-memory/ibm,dynamic-memory + */ +struct of_drconf_cell { +	u64	base_addr; +	u32	drc_index; +	u32	reserved; +	u32	aa_index; +	u32	flags; +}; + +#define DRCONF_MEM_ASSIGNED	0x00000008 +#define DRCONF_MEM_AI_INVALID	0x00000040 +#define DRCONF_MEM_RESERVED	0x00000080 +  /* These includes are put at the bottom because they may contain things   * that are overridden by this file.  Ideally they shouldn't be included   * by this file, but there are a bunch of .c files that currently depend diff --git a/arch/powerpc/include/asm/qe.h b/arch/powerpc/include/asm/qe.h index 229571a4939..32b9bfa0c9b 100644 --- a/arch/powerpc/include/asm/qe.h +++ b/arch/powerpc/include/asm/qe.h @@ -1,5 +1,5 @@  /* - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved.   *   * Authors: 	Shlomi Gridish <gridish@freescale.com>   * 		Li Yang <leoli@freescale.com> diff --git a/arch/powerpc/include/asm/qe_ic.h b/arch/powerpc/include/asm/qe_ic.h index f706164b0bd..25784cc959a 100644 --- a/arch/powerpc/include/asm/qe_ic.h +++ b/arch/powerpc/include/asm/qe_ic.h @@ -1,5 +1,5 @@  /* - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved.   *   * Authors: 	Shlomi Gridish <gridish@freescale.com>   * 		Li Yang <leoli@freescale.com> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 97d37278ea2..3d5c9dc8917 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -249,6 +249,8 @@  #define   LPCR_RMLS    0x1C000000      /* impl dependent rmo limit sel */  #define	  LPCR_RMLS_SH	(63-37)  #define   LPCR_ILE     0x02000000      /* !HV irqs set MSR:LE */ +#define   LPCR_AIL_0	0x00000000	/* MMU off exception offset 0x0 */ +#define   LPCR_AIL_3	0x01800000	/* MMU on exception offset 0xc00...4xxx */  #define   LPCR_PECE	0x00007000	/* powersave exit cause enable */  #define     LPCR_PECE0	0x00004000	/* ext. exceptions can cause exit */  #define     LPCR_PECE1	0x00002000	/* decrementer can cause exit */ @@ -1030,6 +1032,7 @@  #define PVR_970MP	0x0044  #define PVR_970GX	0x0045  #define PVR_POWER7p	0x004A +#define PVR_POWER8	0x004B  #define PVR_BE		0x0070  #define PVR_PA6T	0x0090 diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h index 557cff845de..aef00c67590 100644 --- a/arch/powerpc/include/asm/rtas.h +++ b/arch/powerpc/include/asm/rtas.h @@ -353,8 +353,13 @@ static inline int page_is_rtas_user_buf(unsigned long pfn)  		return 1;  	return 0;  } + +/* Not the best place to put pSeries_coalesce_init, will be fixed when we + * move some of the rtas suspend-me stuff to pseries */ +extern void pSeries_coalesce_init(void);  #else  static inline int page_is_rtas_user_buf(unsigned long pfn) { return 0;} +static inline void pSeries_coalesce_init(void) { }  #endif  extern int call_rtas(const char *, int, int, unsigned long *, ...); diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h new file mode 100644 index 00000000000..d3ca85529b8 --- /dev/null +++ b/arch/powerpc/include/asm/setup.h @@ -0,0 +1,29 @@ +#ifndef _ASM_POWERPC_SETUP_H +#define _ASM_POWERPC_SETUP_H + +#include <uapi/asm/setup.h> + +#ifndef __ASSEMBLY__ +extern void ppc_printk_progress(char *s, unsigned short hex); + +extern unsigned int rtas_data; +extern int mem_init_done;	/* set on boot once kmalloc can be called */ +extern int init_bootmem_done;	/* set once bootmem is available */ +extern unsigned long long memory_limit; +extern unsigned long klimit; +extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); + +struct device_node; +extern void note_scsi_host(struct device_node *, void *); + +/* Used in very early kernel initialization. */ +extern unsigned long reloc_offset(void); +extern unsigned long add_reloc_offset(unsigned long); +extern void reloc_got2(unsigned long); + +#define PTRRELOC(x)	((typeof(x)) add_reloc_offset((unsigned long)(x))) + +#endif /* !__ASSEMBLY__ */ + +#endif	/* _ASM_POWERPC_SETUP_H */ + diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h index 5a4e437c238..195ce2ac569 100644 --- a/arch/powerpc/include/asm/smp.h +++ b/arch/powerpc/include/asm/smp.h @@ -54,8 +54,8 @@ struct smp_ops_t {  extern void smp_send_debugger_break(void);  extern void start_secondary_resume(void); -extern void __devinit smp_generic_give_timebase(void); -extern void __devinit smp_generic_take_timebase(void); +extern void smp_generic_give_timebase(void); +extern void smp_generic_take_timebase(void);  DECLARE_PER_CPU(unsigned int, cpu_pvr); diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index cec8aae5cbf..97909d3b1d7 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h @@ -356,3 +356,4 @@ COMPAT_SYS_SPU(sendmmsg)  SYSCALL_SPU(setns)  COMPAT_SYS(process_vm_readv)  COMPAT_SYS(process_vm_writev) +SYSCALL(finit_module) diff --git a/arch/powerpc/include/asm/ucc.h b/arch/powerpc/include/asm/ucc.h index 46b09ba6bea..6927ac26516 100644 --- a/arch/powerpc/include/asm/ucc.h +++ b/arch/powerpc/include/asm/ucc.h @@ -1,5 +1,5 @@  /* - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved.   *   * Authors: 	Shlomi Gridish <gridish@freescale.com>   * 		Li Yang <leoli@freescale.com> diff --git a/arch/powerpc/include/asm/ucc_fast.h b/arch/powerpc/include/asm/ucc_fast.h index 4644c840e2f..72ea9bab07d 100644 --- a/arch/powerpc/include/asm/ucc_fast.h +++ b/arch/powerpc/include/asm/ucc_fast.h @@ -1,7 +1,7 @@  /*   * Internal header file for UCC FAST unit routines.   * - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved.   *   * Authors: 	Shlomi Gridish <gridish@freescale.com>   * 		Li Yang <leoli@freescale.com> diff --git a/arch/powerpc/include/asm/ucc_slow.h b/arch/powerpc/include/asm/ucc_slow.h index cf131ffdb8d..c44131e68e1 100644 --- a/arch/powerpc/include/asm/ucc_slow.h +++ b/arch/powerpc/include/asm/ucc_slow.h @@ -1,5 +1,5 @@  /* - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved.   *   * Authors: 	Shlomi Gridish <gridish@freescale.com>   * 		Li Yang <leoli@freescale.com> diff --git a/arch/powerpc/include/asm/udbg.h b/arch/powerpc/include/asm/udbg.h index b3038817b8d..5a7510e9d09 100644 --- a/arch/powerpc/include/asm/udbg.h +++ b/arch/powerpc/include/asm/udbg.h @@ -21,7 +21,6 @@ extern int (*udbg_getc_poll)(void);  extern void udbg_puts(const char *s);  extern int udbg_write(const char *s, int n); -extern int udbg_read(char *buf, int buflen);  extern void register_early_udbg_console(void);  extern void udbg_printf(const char *fmt, ...) diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index bcbbe413c60..1d4864a40e3 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h @@ -12,7 +12,7 @@  #include <uapi/asm/unistd.h> -#define __NR_syscalls		353 +#define __NR_syscalls		354  #define __NR__exit __NR_exit  #define NR_syscalls	__NR_syscalls @@ -56,7 +56,6 @@  #define __ARCH_WANT_COMPAT_SYS_SENDFILE  #define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL  #endif -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_VFORK  #define __ARCH_WANT_SYS_CLONE diff --git a/arch/powerpc/include/asm/vio.h b/arch/powerpc/include/asm/vio.h index df81cb72d1e..68d0cc998b1 100644 --- a/arch/powerpc/include/asm/vio.h +++ b/arch/powerpc/include/asm/vio.h @@ -139,7 +139,7 @@ extern void vio_unregister_driver(struct vio_driver *drv);  extern int vio_cmo_entitlement_update(size_t);  extern void vio_cmo_set_dev_desired(struct vio_dev *viodev, size_t desired); -extern void __devinit vio_unregister_device(struct vio_dev *dev); +extern void vio_unregister_device(struct vio_dev *dev);  extern int vio_h_cop_sync(struct vio_dev *vdev, struct vio_pfo_op *op); diff --git a/arch/powerpc/include/uapi/asm/kvm_para.h b/arch/powerpc/include/uapi/asm/kvm_para.h index ed0e0254b47..e3af3286a06 100644 --- a/arch/powerpc/include/uapi/asm/kvm_para.h +++ b/arch/powerpc/include/uapi/asm/kvm_para.h @@ -78,7 +78,7 @@ struct kvm_vcpu_arch_shared {  #define KVM_HCALL_TOKEN(num)     _EV_HCALL_TOKEN(EV_KVM_VENDOR_ID, num) -#include <uapi/asm/epapr_hcalls.h> +#include <asm/epapr_hcalls.h>  #define KVM_FEATURE_MAGIC_PAGE	1 diff --git a/arch/powerpc/include/uapi/asm/setup.h b/arch/powerpc/include/uapi/asm/setup.h index 8b9a306260b..552df83f1a4 100644 --- a/arch/powerpc/include/uapi/asm/setup.h +++ b/arch/powerpc/include/uapi/asm/setup.h @@ -1,32 +1 @@ -#ifndef _ASM_POWERPC_SETUP_H -#define _ASM_POWERPC_SETUP_H -  #include <asm-generic/setup.h> - -#ifndef __ASSEMBLY__ -extern void ppc_printk_progress(char *s, unsigned short hex); - -extern unsigned int rtas_data; -extern int mem_init_done;	/* set on boot once kmalloc can be called */ -extern int init_bootmem_done;	/* set once bootmem is available */ -extern unsigned long long memory_limit; -extern unsigned long klimit; -extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); - -extern void via_cuda_init(void); -extern void read_rtc_time(void); -extern void pmac_find_display(void); - -struct device_node; -extern void note_scsi_host(struct device_node *, void *); - -/* Used in very early kernel initialization. */ -extern unsigned long reloc_offset(void); -extern unsigned long add_reloc_offset(unsigned long); -extern void reloc_got2(unsigned long); - -#define PTRRELOC(x)	((typeof(x)) add_reloc_offset((unsigned long)(x))) - -#endif /* !__ASSEMBLY__ */ - -#endif	/* _ASM_POWERPC_SETUP_H */ diff --git a/arch/powerpc/include/uapi/asm/signal.h b/arch/powerpc/include/uapi/asm/signal.h index 48fa8d3f2f9..e079fb39d5b 100644 --- a/arch/powerpc/include/uapi/asm/signal.h +++ b/arch/powerpc/include/uapi/asm/signal.h @@ -85,12 +85,6 @@ typedef struct {  #define SA_RESTORER	0x04000000U -/* - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 -  #define MINSIGSTKSZ	2048  #define SIGSTKSZ	8192 diff --git a/arch/powerpc/include/uapi/asm/unistd.h b/arch/powerpc/include/uapi/asm/unistd.h index 380b5d37a90..8c478c6c6b1 100644 --- a/arch/powerpc/include/uapi/asm/unistd.h +++ b/arch/powerpc/include/uapi/asm/unistd.h @@ -375,6 +375,7 @@  #define __NR_setns		350  #define __NR_process_vm_readv	351  #define __NR_process_vm_writev	352 +#define __NR_finit_module	353  #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index cde12f8a4eb..8f619342f14 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -38,7 +38,7 @@ obj-$(CONFIG_PPC64)		+= setup_64.o sys_ppc32.o \  				   paca.o nvram_64.o firmware.o  obj-$(CONFIG_HAVE_HW_BREAKPOINT)	+= hw_breakpoint.o  obj-$(CONFIG_PPC_BOOK3S_64)	+= cpu_setup_ppc970.o cpu_setup_pa6t.o -obj-$(CONFIG_PPC_BOOK3S_64)	+= cpu_setup_power7.o +obj-$(CONFIG_PPC_BOOK3S_64)	+= cpu_setup_power.o  obj64-$(CONFIG_RELOCATABLE)	+= reloc_64.o  obj-$(CONFIG_PPC_BOOK3E_64)	+= exceptions-64e.o idle_book3e.o  obj-$(CONFIG_PPC_A2)		+= cpu_setup_a2.o diff --git a/arch/powerpc/kernel/cpu_setup_power7.S b/arch/powerpc/kernel/cpu_setup_power.S index 76797c5105d..57cf14065ae 100644 --- a/arch/powerpc/kernel/cpu_setup_power7.S +++ b/arch/powerpc/kernel/cpu_setup_power.S @@ -27,6 +27,7 @@ _GLOBAL(__setup_cpu_power7)  	beqlr  	li	r0,0  	mtspr	SPRN_LPID,r0 +	mfspr	r3,SPRN_LPCR  	bl	__init_LPCR  	bl	__init_TLB  	mtlr	r11 @@ -39,6 +40,35 @@ _GLOBAL(__restore_cpu_power7)  	beqlr  	li	r0,0  	mtspr	SPRN_LPID,r0 +	mfspr	r3,SPRN_LPCR +	bl	__init_LPCR +	bl	__init_TLB +	mtlr	r11 +	blr + +_GLOBAL(__setup_cpu_power8) +	mflr	r11 +	bl	__init_hvmode_206 +	mtlr	r11 +	beqlr +	li	r0,0 +	mtspr	SPRN_LPID,r0 +	mfspr	r3,SPRN_LPCR +	oris	r3, r3, LPCR_AIL_3@h +	bl	__init_LPCR +	bl	__init_TLB +	mtlr	r11 +	blr + +_GLOBAL(__restore_cpu_power8) +	mflr	r11 +	mfmsr	r3 +	rldicl.	r0,r3,4,63 +	beqlr +	li	r0,0 +	mtspr	SPRN_LPID,r0 +	mfspr   r3,SPRN_LPCR +	oris	r3, r3, LPCR_AIL_3@h  	bl	__init_LPCR  	bl	__init_TLB  	mtlr	r11 @@ -57,6 +87,7 @@ __init_hvmode_206:  __init_LPCR:  	/* Setup a sane LPCR: +	 *   Called with initial LPCR in R3  	 *  	 *   LPES = 0b01 (HSRR0/1 used for 0x500)  	 *   PECE = 0b111 @@ -67,7 +98,6 @@ __init_LPCR:  	 *  	 * Other bits untouched for now  	 */ -	mfspr	r3,SPRN_LPCR  	li	r5,1  	rldimi	r3,r5, LPCR_LPES_SH, 64-LPCR_LPES_SH-2  	ori	r3,r3,(LPCR_PECE0|LPCR_PECE1|LPCR_PECE2) diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index 0514c21f138..75a3d71b895 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c @@ -68,6 +68,8 @@ extern void __restore_cpu_pa6t(void);  extern void __restore_cpu_ppc970(void);  extern void __setup_cpu_power7(unsigned long offset, struct cpu_spec* spec);  extern void __restore_cpu_power7(void); +extern void __setup_cpu_power8(unsigned long offset, struct cpu_spec* spec); +extern void __restore_cpu_power8(void);  extern void __restore_cpu_a2(void);  #endif /* CONFIG_PPC64 */  #if defined(CONFIG_E500) @@ -94,6 +96,10 @@ extern void __restore_cpu_e5500(void);  				 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \  				 PPC_FEATURE_TRUE_LE | \  				 PPC_FEATURE_PSERIES_PERFMON_COMPAT) +#define COMMON_USER_POWER8	(COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_06 |\ +				 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ +				 PPC_FEATURE_TRUE_LE | \ +				 PPC_FEATURE_PSERIES_PERFMON_COMPAT)  #define COMMON_USER_PA6T	(COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\  				 PPC_FEATURE_TRUE_LE | \  				 PPC_FEATURE_HAS_ALTIVEC_COMP) @@ -429,6 +435,21 @@ static struct cpu_spec __initdata cpu_specs[] = {  		.cpu_restore		= __restore_cpu_power7,  		.platform		= "power7",  	}, +	{	/* 2.07-compliant processor, i.e. Power8 "architected" mode */ +		.pvr_mask		= 0xffffffff, +		.pvr_value		= 0x0f000004, +		.cpu_name		= "POWER8 (architected)", +		.cpu_features		= CPU_FTRS_POWER8, +		.cpu_user_features	= COMMON_USER_POWER8, +		.mmu_features		= MMU_FTRS_POWER8, +		.icache_bsize		= 128, +		.dcache_bsize		= 128, +		.oprofile_type		= PPC_OPROFILE_POWER4, +		.oprofile_cpu_type	= "ppc64/ibm-compat-v1", +		.cpu_setup		= __setup_cpu_power8, +		.cpu_restore		= __restore_cpu_power8, +		.platform		= "power8", +	},  	{	/* Power7 */  		.pvr_mask		= 0xffff0000,  		.pvr_value		= 0x003f0000, @@ -463,6 +484,23 @@ static struct cpu_spec __initdata cpu_specs[] = {  		.cpu_restore		= __restore_cpu_power7,  		.platform		= "power7+",  	}, +	{	/* Power8 */ +		.pvr_mask		= 0xffff0000, +		.pvr_value		= 0x004b0000, +		.cpu_name		= "POWER8 (raw)", +		.cpu_features		= CPU_FTRS_POWER8, +		.cpu_user_features	= COMMON_USER_POWER8, +		.mmu_features		= MMU_FTRS_POWER8, +		.icache_bsize		= 128, +		.dcache_bsize		= 128, +		.num_pmcs		= 6, +		.pmc_type		= PPC_PMC_IBM, +		.oprofile_cpu_type	= "ppc64/power8", +		.oprofile_type		= PPC_OPROFILE_POWER4, +		.cpu_setup		= __setup_cpu_power8, +		.cpu_restore		= __restore_cpu_power8, +		.platform		= "power8", +	},  	{	/* Cell Broadband Engine */  		.pvr_mask		= 0xffff0000,  		.pvr_value		= 0x00700000, diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index e9a906c2723..b310a057362 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S @@ -373,6 +373,8 @@ _GLOBAL(ret_from_fork)  _GLOBAL(ret_from_kernel_thread)  	bl	.schedule_tail  	REST_NVGPRS(r1) +	li	r3,0 +	std	r3,0(r1)  	ld	r14, 0(r14)  	mtlr	r14  	mr	r3,r15 diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 10b658ad65e..4665e82fa37 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S @@ -19,12 +19,76 @@  /*   * We layout physical memory as follows:   * 0x0000 - 0x00ff : Secondary processor spin code - * 0x0100 - 0x2fff : pSeries Interrupt prologs - * 0x3000 - 0x5fff : interrupt support common interrupt prologs - * 0x6000 - 0x6fff : Initial (CPU0) segment table + * 0x0100 - 0x17ff : pSeries Interrupt prologs + * 0x1800 - 0x4000 : interrupt support common interrupt prologs + * 0x4000 - 0x5fff : pSeries interrupts with IR=1,DR=1 + * 0x6000 - 0x6fff : more interrupt support including for IR=1,DR=1   * 0x7000 - 0x7fff : FWNMI data area - * 0x8000 -        : Early init and support code + * 0x8000 - 0x8fff : Initial (CPU0) segment table + * 0x9000 -        : Early init and support code   */ +	/* Syscall routine is used twice, in reloc-off and reloc-on paths */ +#define SYSCALL_PSERIES_1 					\ +BEGIN_FTR_SECTION						\ +	cmpdi	r0,0x1ebe ; 					\ +	beq-	1f ;						\ +END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE)				\ +	mr	r9,r13 ;					\ +	GET_PACA(r13) ;						\ +	mfspr	r11,SPRN_SRR0 ;					\ +0: + +#define SYSCALL_PSERIES_2_RFID 					\ +	mfspr	r12,SPRN_SRR1 ;					\ +	ld	r10,PACAKBASE(r13) ; 				\ +	LOAD_HANDLER(r10, system_call_entry) ; 			\ +	mtspr	SPRN_SRR0,r10 ; 				\ +	ld	r10,PACAKMSR(r13) ;				\ +	mtspr	SPRN_SRR1,r10 ; 				\ +	rfid ; 							\ +	b	. ;	/* prevent speculative execution */ + +#define SYSCALL_PSERIES_3					\ +	/* Fast LE/BE switch system call */			\ +1:	mfspr	r12,SPRN_SRR1 ;					\ +	xori	r12,r12,MSR_LE ;				\ +	mtspr	SPRN_SRR1,r12 ;					\ +	rfid ;		/* return to userspace */		\ +	b	. ;						\ +2:	mfspr	r12,SPRN_SRR1 ;					\ +	andi.	r12,r12,MSR_PR ;				\ +	bne	0b ;						\ +	mtspr	SPRN_SRR0,r3 ;					\ +	mtspr	SPRN_SRR1,r4 ;					\ +	mtspr	SPRN_SDR1,r5 ;					\ +	rfid ;							\ +	b	. ;	/* prevent speculative execution */ + +#if defined(CONFIG_RELOCATABLE) +	/* +	 * We can't branch directly; in the direct case we use LR +	 * and system_call_entry restores LR.  (We thus need to move +	 * LR to r10 in the RFID case too.) +	 */ +#define SYSCALL_PSERIES_2_DIRECT				\ +	mflr	r10 ;						\ +	ld	r12,PACAKBASE(r13) ; 				\ +	LOAD_HANDLER(r12, system_call_entry_direct) ;		\ +	mtlr	r12 ;						\ +	mfspr	r12,SPRN_SRR1 ;					\ +	/* Re-use of r13... No spare regs to do this */	\ +	li	r13,MSR_RI ;					\ +	mtmsrd 	r13,1 ;						\ +	GET_PACA(r13) ;	/* get r13 back */			\ +	blr ; +#else +	/* We can branch directly */ +#define SYSCALL_PSERIES_2_DIRECT				\ +	mfspr	r12,SPRN_SRR1 ;					\ +	li	r10,MSR_RI ;					\ +	mtmsrd 	r10,1 ;			/* Set RI (EE=0) */	\ +	b	system_call_entry_direct ; +#endif  /*   * This is the start of the interrupt handlers for pSeries @@ -207,31 +271,11 @@ system_call_pSeries:  	KVMTEST(0xc00)  	GET_SCRATCH0(r13)  #endif -BEGIN_FTR_SECTION -	cmpdi	r0,0x1ebe -	beq-	1f -END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) -	mr	r9,r13 -	GET_PACA(r13) -	mfspr	r11,SPRN_SRR0 -	mfspr	r12,SPRN_SRR1 -	ld	r10,PACAKBASE(r13) -	LOAD_HANDLER(r10, system_call_entry) -	mtspr	SPRN_SRR0,r10 -	ld	r10,PACAKMSR(r13) -	mtspr	SPRN_SRR1,r10 -	rfid -	b	.	/* prevent speculative execution */ - +	SYSCALL_PSERIES_1 +	SYSCALL_PSERIES_2_RFID +	SYSCALL_PSERIES_3  	KVM_HANDLER(PACA_EXGEN, EXC_STD, 0xc00) -/* Fast LE/BE switch system call */ -1:	mfspr	r12,SPRN_SRR1 -	xori	r12,r12,MSR_LE -	mtspr	SPRN_SRR1,r12 -	rfid		/* return to userspace */ -	b	. -  	STD_EXCEPTION_PSERIES(0xd00, 0xd00, single_step)  	KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xd00) @@ -276,7 +320,7 @@ vsx_unavailable_pSeries_1:  	KVM_HANDLER_PR_SKIP(PACA_EXGEN, EXC_STD, 0x1300)  	. = 0x1500 -	.global denorm_Hypervisor +	.global denorm_exception_hv  denorm_exception_hv:  	HMT_MEDIUM  	mtspr	SPRN_SPRG_HSCRATCH0,r13 @@ -311,12 +355,14 @@ denorm_exception_hv:  #ifdef CONFIG_CBE_RAS  	STD_EXCEPTION_HV(0x1800, 0x1802, cbe_thermal)  	KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0x1802) +#else +	. = 0x1800  #endif /* CONFIG_CBE_RAS */ -	. = 0x3000  /*** Out of line interrupts support ***/ +	.align	7  	/* moved from 0x200 */  machine_check_pSeries:  	.globl machine_check_fwnmi @@ -575,16 +621,12 @@ slb_miss_user_pseries:  	b	.				/* prevent spec. execution */  #endif /* __DISABLED__ */ -	.align	7 -	.globl	__end_interrupts -__end_interrupts: -  /*   * Code from here down to __end_handlers is invoked from the   * exception prologs above.  Because the prologs assemble the   * addresses of these handlers using the LOAD_HANDLER macro, - * which uses an addi instruction, these handlers must be in - * the first 32k of the kernel image. + * which uses an ori instruction, these handlers must be in + * the first 64k of the kernel image.   */  /*** Common interrupt handlers ***/ @@ -613,8 +655,8 @@ machine_check_common:  	STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception)  	STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception)  	STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception) -        STD_EXCEPTION_COMMON(0xe40, emulation_assist, .program_check_exception) -        STD_EXCEPTION_COMMON(0xe60, hmi_exception, .unknown_exception) +	STD_EXCEPTION_COMMON(0xe40, emulation_assist, .program_check_exception) +	STD_EXCEPTION_COMMON(0xe60, hmi_exception, .unknown_exception)  	STD_EXCEPTION_COMMON_ASYNC(0xf00, performance_monitor, .performance_monitor_exception)  	STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception)  	STD_EXCEPTION_COMMON(0x1502, denorm, .unknown_exception) @@ -629,7 +671,158 @@ machine_check_common:  	STD_EXCEPTION_COMMON(0x1800, cbe_thermal, .cbe_thermal_exception)  #endif /* CONFIG_CBE_RAS */ +	/* +	 * Relocation-on interrupts: A subset of the interrupts can be delivered +	 * with IR=1/DR=1, if AIL==2 and MSR.HV won't be changed by delivering +	 * it.  Addresses are the same as the original interrupt addresses, but +	 * offset by 0xc000000000004000. +	 * It's impossible to receive interrupts below 0x300 via this mechanism. +	 * KVM: None of these traps are from the guest ; anything that escalated +	 * to HV=1 from HV=0 is delivered via real mode handlers. +	 */ + +	/* +	 * This uses the standard macro, since the original 0x300 vector +	 * only has extra guff for STAB-based processors -- which never +	 * come here. +	 */ +	STD_RELON_EXCEPTION_PSERIES(0x4300, 0x300, data_access) +	. = 0x4380 +	.globl data_access_slb_relon_pSeries +data_access_slb_relon_pSeries: +	HMT_MEDIUM +	SET_SCRATCH0(r13) +	EXCEPTION_PROLOG_1(PACA_EXSLB, NOTEST, 0x380) +	std	r3,PACA_EXSLB+EX_R3(r13) +	mfspr	r3,SPRN_DAR +	mfspr	r12,SPRN_SRR1 +#ifndef CONFIG_RELOCATABLE +	b	.slb_miss_realmode +#else +	/* +	 * We can't just use a direct branch to .slb_miss_realmode +	 * because the distance from here to there depends on where +	 * the kernel ends up being put. +	 */ +	mfctr	r11 +	ld	r10,PACAKBASE(r13) +	LOAD_HANDLER(r10, .slb_miss_realmode) +	mtctr	r10 +	bctr +#endif + +	STD_RELON_EXCEPTION_PSERIES(0x4400, 0x400, instruction_access) +	. = 0x4480 +	.globl instruction_access_slb_relon_pSeries +instruction_access_slb_relon_pSeries: +	HMT_MEDIUM +	SET_SCRATCH0(r13) +	EXCEPTION_PROLOG_1(PACA_EXSLB, NOTEST, 0x480) +	std	r3,PACA_EXSLB+EX_R3(r13) +	mfspr	r3,SPRN_SRR0		/* SRR0 is faulting address */ +	mfspr	r12,SPRN_SRR1 +#ifndef CONFIG_RELOCATABLE +	b	.slb_miss_realmode +#else +	mfctr	r11 +	ld	r10,PACAKBASE(r13) +	LOAD_HANDLER(r10, .slb_miss_realmode) +	mtctr	r10 +	bctr +#endif + +	. = 0x4500 +	.globl hardware_interrupt_relon_pSeries; +	.globl hardware_interrupt_relon_hv; +hardware_interrupt_relon_pSeries: +hardware_interrupt_relon_hv: +	BEGIN_FTR_SECTION +		_MASKABLE_RELON_EXCEPTION_PSERIES(0x502, hardware_interrupt, EXC_HV, SOFTEN_TEST_HV) +	FTR_SECTION_ELSE +		_MASKABLE_RELON_EXCEPTION_PSERIES(0x500, hardware_interrupt, EXC_STD, SOFTEN_TEST_PR) +	ALT_FTR_SECTION_END_IFSET(CPU_FTR_ARCH_206) +	STD_RELON_EXCEPTION_PSERIES(0x4600, 0x600, alignment) +	STD_RELON_EXCEPTION_PSERIES(0x4700, 0x700, program_check) +	STD_RELON_EXCEPTION_PSERIES(0x4800, 0x800, fp_unavailable) +	MASKABLE_RELON_EXCEPTION_PSERIES(0x4900, 0x900, decrementer) +	STD_RELON_EXCEPTION_HV(0x4980, 0x982, hdecrementer) +	STD_RELON_EXCEPTION_PSERIES(0x4b00, 0xb00, trap_0b) + +	. = 0x4c00 +	.globl system_call_relon_pSeries +system_call_relon_pSeries: +	HMT_MEDIUM +	SYSCALL_PSERIES_1 +	SYSCALL_PSERIES_2_DIRECT +	SYSCALL_PSERIES_3 + +	STD_RELON_EXCEPTION_PSERIES(0x4d00, 0xd00, single_step) + +	. = 0x4e00 +	b	h_data_storage_relon_hv + +	. = 0x4e20 +	b	h_instr_storage_relon_hv + +	. = 0x4e40 +	b	emulation_assist_relon_hv + +	. = 0x4e50 +	b	hmi_exception_relon_hv + +	. = 0x4e60 +	b	hmi_exception_relon_hv + +	/* For when we support the doorbell interrupt: +	STD_RELON_EXCEPTION_HYPERVISOR(0x4e80, 0xe80, doorbell_hyper) +	*/ + +performance_monitor_relon_pSeries_1: +	. = 0x4f00 +	b	performance_monitor_relon_pSeries + +altivec_unavailable_relon_pSeries_1: +	. = 0x4f20 +	b	altivec_unavailable_relon_pSeries + +vsx_unavailable_relon_pSeries_1: +	. = 0x4f40 +	b	vsx_unavailable_relon_pSeries + +#ifdef CONFIG_CBE_RAS +	STD_RELON_EXCEPTION_HV(0x5200, 0x1202, cbe_system_error) +#endif /* CONFIG_CBE_RAS */ +	STD_RELON_EXCEPTION_PSERIES(0x5300, 0x1300, instruction_breakpoint) +#ifdef CONFIG_PPC_DENORMALISATION +	. = 0x5500 +	b	denorm_exception_hv +#endif +#ifdef CONFIG_CBE_RAS +	STD_RELON_EXCEPTION_HV(0x5600, 0x1602, cbe_maintenance) +#else +#ifdef CONFIG_HVC_SCOM +	STD_RELON_EXCEPTION_HV(0x5600, 0x1600, maintence_interrupt) +	KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0x1600) +#endif /* CONFIG_HVC_SCOM */ +#endif /* CONFIG_CBE_RAS */ +	STD_RELON_EXCEPTION_PSERIES(0x5700, 0x1700, altivec_assist) +#ifdef CONFIG_CBE_RAS +	STD_RELON_EXCEPTION_HV(0x5800, 0x1802, cbe_thermal) +#endif /* CONFIG_CBE_RAS */ + +	/* Other future vectors */  	.align	7 +	.globl	__end_interrupts +__end_interrupts: + +	.align	7 +system_call_entry_direct: +#if defined(CONFIG_RELOCATABLE) +	/* The first level prologue may have used LR to get here, saving +	 * orig in r10.  To save hacking/ifdeffing common code, restore here. +	 */ +	mtlr	r10 +#endif  system_call_entry:  	b	system_call_common @@ -714,21 +907,21 @@ data_access_common:  	ld	r3,PACA_EXGEN+EX_DAR(r13)  	lwz	r4,PACA_EXGEN+EX_DSISR(r13)  	li	r5,0x300 -	b	.do_hash_page	 	/* Try to handle as hpte fault */ +	b	.do_hash_page		/* Try to handle as hpte fault */  	.align  7 -        .globl  h_data_storage_common +	.globl  h_data_storage_common  h_data_storage_common: -        mfspr   r10,SPRN_HDAR -        std     r10,PACA_EXGEN+EX_DAR(r13) -        mfspr   r10,SPRN_HDSISR -        stw     r10,PACA_EXGEN+EX_DSISR(r13) -        EXCEPTION_PROLOG_COMMON(0xe00, PACA_EXGEN) -        bl      .save_nvgprs +	mfspr   r10,SPRN_HDAR +	std     r10,PACA_EXGEN+EX_DAR(r13) +	mfspr   r10,SPRN_HDSISR +	stw     r10,PACA_EXGEN+EX_DSISR(r13) +	EXCEPTION_PROLOG_COMMON(0xe00, PACA_EXGEN) +	bl      .save_nvgprs  	DISABLE_INTS -        addi    r3,r1,STACK_FRAME_OVERHEAD -        bl      .unknown_exception -        b       .ret_from_except +	addi    r3,r1,STACK_FRAME_OVERHEAD +	bl      .unknown_exception +	b       .ret_from_except  	.align	7  	.globl instruction_access_common @@ -741,7 +934,7 @@ instruction_access_common:  	li	r5,0x400  	b	.do_hash_page		/* Try to handle as hpte fault */ -        STD_EXCEPTION_COMMON(0xe20, h_instr_storage, .unknown_exception) +	STD_EXCEPTION_COMMON(0xe20, h_instr_storage, .unknown_exception)  /*   * Here is the common SLB miss user that is used when going to virtual @@ -1152,6 +1345,21 @@ _GLOBAL(do_stab_bolted)  	rfid  	b	.	/* prevent speculative execution */ + +	/* Equivalents to the above handlers for relocation-on interrupt vectors */ +	STD_RELON_EXCEPTION_HV(., 0xe00, h_data_storage) +	KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe00) +	STD_RELON_EXCEPTION_HV(., 0xe20, h_instr_storage) +	KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe20) +	STD_RELON_EXCEPTION_HV(., 0xe40, emulation_assist) +	KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe40) +	STD_RELON_EXCEPTION_HV(., 0xe60, hmi_exception) +	KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe60) + +	STD_RELON_EXCEPTION_PSERIES(., 0xf00, performance_monitor) +	STD_RELON_EXCEPTION_PSERIES(., 0xf20, altivec_unavailable) +	STD_RELON_EXCEPTION_PSERIES(., 0xf40, vsx_unavailable) +  #if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV)  /*   * Data area reserved for FWNMI option. @@ -1164,7 +1372,7 @@ fwnmi_data_area:  	/* pseries and powernv need to keep the whole page from  	 * 0x7000 to 0x8000 free for use by the firmware  	 */ -        . = 0x8000 +	. = 0x8000  #endif /* defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) */  /* Space for CPU0's segment table */ diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 58bddee8e1e..116f0868695 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S @@ -422,7 +422,7 @@ _STATIC(__after_prom_start)  	tovirt(r6,r6)			/* on booke, we already run at PAGE_OFFSET */  #endif -#ifdef CONFIG_CRASH_DUMP +#ifdef CONFIG_RELOCATABLE  /*   * Check if the kernel has to be running as relocatable kernel based on the   * variable __run_at_load, if it is set the kernel is treated as relocatable @@ -432,7 +432,8 @@ _STATIC(__after_prom_start)  	cmplwi	cr0,r7,1  	bne	3f -	li	r5,__end_interrupts - _stext	/* just copy interrupts */ +	/* just copy interrupts */ +	LOAD_REG_IMMEDIATE(r5, __end_interrupts - _stext)  	b	5f  3:  #endif @@ -703,6 +704,7 @@ _INIT_STATIC(start_here_multiplatform)  #ifdef CONFIG_PPC_EARLY_DEBUG_OPAL  	/* Setup OPAL entry */ +	LOAD_REG_ADDR(r11, opal)  	std	r28,0(r11);  	std	r29,8(r11);  #endif diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c index 2099d9a879e..ea78761aa16 100644 --- a/arch/powerpc/kernel/idle.c +++ b/arch/powerpc/kernel/idle.c @@ -55,9 +55,6 @@ __setup("powersave=off", powersave_off);   */  void cpu_idle(void)  { -	if (ppc_md.idle_loop) -		ppc_md.idle_loop();	/* doesn't return */ -  	set_thread_flag(TIF_POLLING_NRFLAG);  	while (1) {  		tick_nohz_idle_enter(); diff --git a/arch/powerpc/kernel/io-workarounds.c b/arch/powerpc/kernel/io-workarounds.c index 12d329bcbb9..50e90b7e713 100644 --- a/arch/powerpc/kernel/io-workarounds.c +++ b/arch/powerpc/kernel/io-workarounds.c @@ -118,7 +118,7 @@ static void iowa_##name at					\  #undef DEF_PCI_AC_RET  #undef DEF_PCI_AC_NORET -static const struct ppc_pci_io __devinitconst iowa_pci_io = { +static const struct ppc_pci_io iowa_pci_io = {  #define DEF_PCI_AC_RET(name, ret, at, al, space, aa)	.name = iowa_##name,  #define DEF_PCI_AC_NORET(name, at, al, space, aa)	.name = iowa_##name, @@ -146,7 +146,7 @@ static void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,  }  /* Enable IO workaround */ -static void __devinit io_workaround_init(void) +static void io_workaround_init(void)  {  	static int io_workaround_inited; @@ -158,9 +158,8 @@ static void __devinit io_workaround_init(void)  }  /* Register new bus to support workaround */ -void __devinit iowa_register_bus(struct pci_controller *phb, -			struct ppc_pci_io *ops, -			int (*initfunc)(struct iowa_bus *, void *), void *data) +void iowa_register_bus(struct pci_controller *phb, struct ppc_pci_io *ops, +		       int (*initfunc)(struct iowa_bus *, void *), void *data)  {  	struct iowa_bus *bus;  	struct device_node *np = phb->dn; diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index 8226c6cb348..c862fd716fe 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c @@ -656,7 +656,7 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)  	struct iommu_pool *p;  	/* number of bytes needed for the bitmap */ -	sz = (tbl->it_size + 7) >> 3; +	sz = BITS_TO_LONGS(tbl->it_size) * sizeof(unsigned long);  	page = alloc_pages_node(nid, GFP_ATOMIC, get_order(sz));  	if (!page) @@ -708,7 +708,7 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)  void iommu_free_table(struct iommu_table *tbl, const char *node_name)  { -	unsigned long bitmap_sz, i; +	unsigned long bitmap_sz;  	unsigned int order;  	if (!tbl || !tbl->it_map) { @@ -718,17 +718,11 @@ void iommu_free_table(struct iommu_table *tbl, const char *node_name)  	}  	/* verify that table contains no entries */ -	/* it_size is in entries, and we're examining 64 at a time */ -	for (i = 0; i < (tbl->it_size/64); i++) { -		if (tbl->it_map[i] != 0) { -			printk(KERN_WARNING "%s: Unexpected TCEs for %s\n", -				__func__, node_name); -			break; -		} -	} +	if (!bitmap_empty(tbl->it_map, tbl->it_size)) +		pr_warn("%s: Unexpected TCEs for %s\n", __func__, node_name);  	/* calculate bitmap size in bytes */ -	bitmap_sz = (tbl->it_size + 7) / 8; +	bitmap_sz = BITS_TO_LONGS(tbl->it_size) * sizeof(unsigned long);  	/* free bitmap */  	order = get_order(bitmap_sz); diff --git a/arch/powerpc/kernel/isa-bridge.c b/arch/powerpc/kernel/isa-bridge.c index d45ec58703c..0f199709796 100644 --- a/arch/powerpc/kernel/isa-bridge.c +++ b/arch/powerpc/kernel/isa-bridge.c @@ -41,8 +41,8 @@ EXPORT_SYMBOL_GPL(isa_bridge_pcidev);  #define ISA_SPACE_MASK 0x1  #define ISA_SPACE_IO 0x1 -static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node, -						unsigned long phb_io_base_phys) +static void pci_process_ISA_OF_ranges(struct device_node *isa_node, +				      unsigned long phb_io_base_phys)  {  	/* We should get some saner parsing here and remove these structs */  	struct pci_address { @@ -170,8 +170,8 @@ void __init isa_bridge_find_early(struct pci_controller *hose)   * isa_bridge_find_late - Find and map the ISA IO space upon discovery of   *                        a new ISA bridge   */ -static void __devinit isa_bridge_find_late(struct pci_dev *pdev, -					   struct device_node *devnode) +static void isa_bridge_find_late(struct pci_dev *pdev, +				 struct device_node *devnode)  {  	struct pci_controller *hose = pci_bus_to_host(pdev->bus); @@ -215,8 +215,8 @@ static void isa_bridge_remove(void)  /**   * isa_bridge_notify - Get notified of PCI devices addition/removal   */ -static int __devinit isa_bridge_notify(struct notifier_block *nb, -				       unsigned long action, void *data) +static int isa_bridge_notify(struct notifier_block *nb, unsigned long action, +			     void *data)  {  	struct device *dev = data;  	struct pci_dev *pdev = to_pci_dev(dev); diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index fa9f6c72f55..e1ec57e87b3 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c @@ -218,23 +218,23 @@ static void __init export_crashk_values(struct device_node *node)  	 * be sure what's in them, so remove them. */  	prop = of_find_property(node, "linux,crashkernel-base", NULL);  	if (prop) -		prom_remove_property(node, prop); +		of_remove_property(node, prop);  	prop = of_find_property(node, "linux,crashkernel-size", NULL);  	if (prop) -		prom_remove_property(node, prop); +		of_remove_property(node, prop);  	if (crashk_res.start != 0) { -		prom_add_property(node, &crashk_base_prop); +		of_add_property(node, &crashk_base_prop);  		crashk_size = resource_size(&crashk_res); -		prom_add_property(node, &crashk_size_prop); +		of_add_property(node, &crashk_size_prop);  	}  	/*  	 * memory_limit is required by the kexec-tools to limit the  	 * crash regions to the actual memory used.  	 */ -	prom_update_property(node, &memory_limit_prop); +	of_update_property(node, &memory_limit_prop);  }  static int __init kexec_setup(void) @@ -249,11 +249,11 @@ static int __init kexec_setup(void)  	/* remove any stale properties so ours can be found */  	prop = of_find_property(node, kernel_end_prop.name, NULL);  	if (prop) -		prom_remove_property(node, prop); +		of_remove_property(node, prop);  	/* information needed by userspace when using default_machine_kexec */  	kernel_end = __pa(_end); -	prom_add_property(node, &kernel_end_prop); +	of_add_property(node, &kernel_end_prop);  	export_crashk_values(node); diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c index d7f609086a9..7206701b1ff 100644 --- a/arch/powerpc/kernel/machine_kexec_64.c +++ b/arch/powerpc/kernel/machine_kexec_64.c @@ -389,14 +389,14 @@ static int __init export_htab_values(void)  	/* remove any stale propertys so ours can be found */  	prop = of_find_property(node, htab_base_prop.name, NULL);  	if (prop) -		prom_remove_property(node, prop); +		of_remove_property(node, prop);  	prop = of_find_property(node, htab_size_prop.name, NULL);  	if (prop) -		prom_remove_property(node, prop); +		of_remove_property(node, prop);  	htab_base = __pa(htab_address); -	prom_add_property(node, &htab_base_prop); -	prom_add_property(node, &htab_size_prop); +	of_add_property(node, &htab_base_prop); +	of_add_property(node, &htab_size_prop);  	of_node_put(node);  	return 0; diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c index 9db8ec07ec9..07c12697d70 100644 --- a/arch/powerpc/kernel/of_platform.c +++ b/arch/powerpc/kernel/of_platform.c @@ -37,7 +37,7 @@   * lacking some bits needed here.   */ -static int __devinit of_pci_phb_probe(struct platform_device *dev) +static int of_pci_phb_probe(struct platform_device *dev)  {  	struct pci_controller *phb; diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index abc0d085699..7c37379ea9b 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -673,9 +673,8 @@ void pci_resource_to_user(const struct pci_dev *dev, int bar,   *   - Some 32 bits platforms such as 4xx can have physical space larger than   *     32 bits so we need to use 64 bits values for the parsing   */ -void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, -					    struct device_node *dev, -					    int primary) +void pci_process_bridge_OF_ranges(struct pci_controller *hose, +				  struct device_node *dev, int primary)  {  	const u32 *ranges;  	int rlen; @@ -848,7 +847,7 @@ int pci_proc_domain(struct pci_bus *bus)  /* This header fixup will do the resource fixup for all devices as they are   * probed, but not for bridge ranges   */ -static void __devinit pcibios_fixup_resources(struct pci_dev *dev) +static void pcibios_fixup_resources(struct pci_dev *dev)  {  	struct pci_controller *hose = pci_bus_to_host(dev->bus);  	int i; @@ -902,8 +901,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources);   * things go more smoothly when it gets it right. It should covers cases such   * as Apple "closed" bridge resources and bare-metal pSeries unassigned bridges   */ -static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus, -							   struct resource *res) +static int pcibios_uninitialized_bridge_resource(struct pci_bus *bus, +						 struct resource *res)  {  	struct pci_controller *hose = pci_bus_to_host(bus);  	struct pci_dev *dev = bus->self; @@ -967,7 +966,7 @@ static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus,  }  /* Fixup resources of a PCI<->PCI bridge */ -static void __devinit pcibios_fixup_bridge(struct pci_bus *bus) +static void pcibios_fixup_bridge(struct pci_bus *bus)  {  	struct resource *res;  	int i; @@ -1007,7 +1006,7 @@ static void __devinit pcibios_fixup_bridge(struct pci_bus *bus)  	}  } -void __devinit pcibios_setup_bus_self(struct pci_bus *bus) +void pcibios_setup_bus_self(struct pci_bus *bus)  {  	/* Fix up the bus resources for P2P bridges */  	if (bus->self != NULL) @@ -1024,7 +1023,7 @@ void __devinit pcibios_setup_bus_self(struct pci_bus *bus)  		ppc_md.pci_dma_bus_setup(bus);  } -void __devinit pcibios_setup_bus_devices(struct pci_bus *bus) +void pcibios_setup_bus_devices(struct pci_bus *bus)  {  	struct pci_dev *dev; @@ -1063,7 +1062,7 @@ void pcibios_set_master(struct pci_dev *dev)  	/* No special bus mastering setup handling */  } -void __devinit pcibios_fixup_bus(struct pci_bus *bus) +void pcibios_fixup_bus(struct pci_bus *bus)  {  	/* When called from the generic PCI probe, read PCI<->PCI bridge  	 * bases. This is -not- called when generating the PCI tree from @@ -1080,7 +1079,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)  }  EXPORT_SYMBOL(pcibios_fixup_bus); -void __devinit pci_fixup_cardbus(struct pci_bus *bus) +void pci_fixup_cardbus(struct pci_bus *bus)  {  	/* Now fixup devices on that bus */  	pcibios_setup_bus_devices(bus); @@ -1264,7 +1263,7 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)  		pcibios_allocate_bus_resources(b);  } -static inline void __devinit alloc_resource(struct pci_dev *dev, int idx) +static inline void alloc_resource(struct pci_dev *dev, int idx)  {  	struct resource *pr, *r = &dev->resource[idx]; @@ -1500,7 +1499,8 @@ resource_size_t pcibios_io_space_offset(struct pci_controller *hose)  	return (unsigned long) hose->io_base_virt - _IO_BASE;  } -static void __devinit pcibios_setup_phb_resources(struct pci_controller *hose, struct list_head *resources) +static void pcibios_setup_phb_resources(struct pci_controller *hose, +					struct list_head *resources)  {  	struct resource *res;  	int i; @@ -1639,7 +1639,7 @@ struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus)   * pci_scan_phb - Given a pci_controller, setup and scan the PCI bus   * @hose: Pointer to the PCI host controller instance structure   */ -void __devinit pcibios_scan_phb(struct pci_controller *hose) +void pcibios_scan_phb(struct pci_controller *hose)  {  	LIST_HEAD(resources);  	struct pci_bus *bus; diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 4b06ec5a502..e37c2152acf 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c @@ -208,12 +208,12 @@ pci_create_OF_bus_map(void)  		of_prop->name = "pci-OF-bus-map";  		of_prop->length = 256;  		of_prop->value = &of_prop[1]; -		prom_add_property(dn, of_prop); +		of_add_property(dn, of_prop);  		of_node_put(dn);  	}  } -void __devinit pcibios_setup_phb_io_space(struct pci_controller *hose) +void pcibios_setup_phb_io_space(struct pci_controller *hose)  {  	unsigned long io_offset;  	struct resource *res = &hose->io_resource; diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 2cbe6768fdd..51a133a78a0 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c @@ -122,7 +122,7 @@ int pcibios_unmap_io_space(struct pci_bus *bus)  }  EXPORT_SYMBOL_GPL(pcibios_unmap_io_space); -static int __devinit pcibios_map_phb_io_space(struct pci_controller *hose) +static int pcibios_map_phb_io_space(struct pci_controller *hose)  {  	struct vm_struct *area;  	unsigned long phys_page; @@ -173,7 +173,7 @@ static int __devinit pcibios_map_phb_io_space(struct pci_controller *hose)  	return 0;  } -int __devinit pcibios_map_io_space(struct pci_bus *bus) +int pcibios_map_io_space(struct pci_bus *bus)  {  	WARN_ON(bus == NULL); @@ -193,7 +193,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)  }  EXPORT_SYMBOL_GPL(pcibios_map_io_space); -void __devinit pcibios_setup_phb_io_space(struct pci_controller *hose) +void pcibios_setup_phb_io_space(struct pci_controller *hose)  {  	pcibios_map_phb_io_space(hose);  } diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index dd9e4a04bf7..e7af165f8b9 100644 --- a/arch/powerpc/kernel/pci_dn.c +++ b/arch/powerpc/kernel/pci_dn.c @@ -36,7 +36,7 @@   * Traverse_func that inits the PCI fields of the device node.   * NOTE: this *must* be done before read/write config to the device.   */ -void * __devinit update_dn_pci_info(struct device_node *dn, void *data) +void *update_dn_pci_info(struct device_node *dn, void *data)  {  	struct pci_controller *phb = data;  	const int *type = @@ -129,7 +129,7 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,   * subsystem is set up, before kmalloc is valid) and during the    * dynamic lpar operation of adding a PHB to a running system.   */ -void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb) +void pci_devs_phb_init_dynamic(struct pci_controller *phb)  {  	struct device_node *dn = phb->dn;  	struct pci_dn *pdn; diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c index 30378a19f65..2a67e9baa59 100644 --- a/arch/powerpc/kernel/pci_of_scan.c +++ b/arch/powerpc/kernel/pci_of_scan.c @@ -204,7 +204,7 @@ EXPORT_SYMBOL(of_create_pci_dev);   * this routine in turn call of_scan_bus() recusively to scan for more child   * devices.   */ -void __devinit of_scan_pci_bridge(struct pci_dev *dev) +void of_scan_pci_bridge(struct pci_dev *dev)  {  	struct device_node *node = dev->dev.of_node;  	struct pci_bus *bus; @@ -299,8 +299,8 @@ EXPORT_SYMBOL(of_scan_pci_bridge);   * @bus: pci_bus structure for the PCI bus   * @rescan_existing: Flag indicating bus has already been set up   */ -static void __devinit __of_scan_bus(struct device_node *node, -				    struct pci_bus *bus, int rescan_existing) +static void __of_scan_bus(struct device_node *node, struct pci_bus *bus, +			  int rescan_existing)  {  	struct device_node *child;  	const u32 *reg; @@ -348,8 +348,7 @@ static void __devinit __of_scan_bus(struct device_node *node,   * @node: device tree node for the PCI bus   * @bus: pci_bus structure for the PCI bus   */ -void __devinit of_scan_bus(struct device_node *node, -			   struct pci_bus *bus) +void of_scan_bus(struct device_node *node, struct pci_bus *bus)  {  	__of_scan_bus(node, bus, 0);  } @@ -363,8 +362,7 @@ EXPORT_SYMBOL_GPL(of_scan_bus);   * Same as of_scan_bus, but for a pci_bus structure that has already been   * setup.   */ -void __devinit of_rescan_bus(struct device_node *node, -			     struct pci_bus *bus) +void of_rescan_bus(struct device_node *node, struct pci_bus *bus)  {  	__of_scan_bus(node, bus, 1);  } diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 37725e86651..8b6f7a99cce 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -32,6 +32,7 @@  #include <linux/debugfs.h>  #include <linux/irq.h>  #include <linux/memblock.h> +#include <linux/of.h>  #include <asm/prom.h>  #include <asm/rtas.h> @@ -49,11 +50,11 @@  #include <asm/btext.h>  #include <asm/sections.h>  #include <asm/machdep.h> -#include <asm/pSeries_reconfig.h>  #include <asm/pci-bridge.h>  #include <asm/kexec.h>  #include <asm/opal.h>  #include <asm/fadump.h> +#include <asm/debug.h>  #include <mm/mmu_decl.h> @@ -802,7 +803,7 @@ static int prom_reconfig_notifier(struct notifier_block *nb,  	int err;  	switch (action) { -	case PSERIES_RECONFIG_ADD: +	case OF_RECONFIG_ATTACH_NODE:  		err = of_finish_dynamic_node(node);  		if (err < 0)  			printk(KERN_ERR "finish_node returned %d\n", err); @@ -821,7 +822,7 @@ static struct notifier_block prom_reconfig_nb = {  static int __init prom_reconfig_setup(void)  { -	return pSeries_reconfig_notifier_register(&prom_reconfig_nb); +	return of_reconfig_notifier_register(&prom_reconfig_nb);  }  __initcall(prom_reconfig_setup);  #endif diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index cb6c123722a..779f34049a5 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c @@ -671,6 +671,7 @@ static void __init early_cmdline_parse(void)  #define OV1_PPC_2_04		0x08	/* set if we support PowerPC 2.04 */  #define OV1_PPC_2_05		0x04	/* set if we support PowerPC 2.05 */  #define OV1_PPC_2_06		0x02	/* set if we support PowerPC 2.06 */ +#define OV1_PPC_2_07		0x01	/* set if we support PowerPC 2.07 */  /* Option vector 2: Open Firmware options supported */  #define OV2_REAL_MODE		0x20	/* set if we want OF in real mode */ @@ -707,6 +708,7 @@ static void __init early_cmdline_parse(void)  #define OV5_PFO_HW_RNG		0x80	/* PFO Random Number Generator */  #define OV5_PFO_HW_842		0x40	/* PFO Compression Accelerator */  #define OV5_PFO_HW_ENCR		0x20	/* PFO Encryption Accelerator */ +#define OV5_SUB_PROCESSORS	0x01    /* 1,2,or 4 Sub-Processors supported */  /* Option Vector 6: IBM PAPR hints */  #define OV6_LINUX		0x02	/* Linux is our OS */ @@ -719,6 +721,8 @@ static unsigned char ibm_architecture_vec[] = {  	W(0xfffe0000), W(0x003a0000),	/* POWER5/POWER5+ */  	W(0xffff0000), W(0x003e0000),	/* POWER6 */  	W(0xffff0000), W(0x003f0000),	/* POWER7 */ +	W(0xffff0000), W(0x004b0000),	/* POWER8 */ +	W(0xffffffff), W(0x0f000004),	/* all 2.07-compliant */  	W(0xffffffff), W(0x0f000003),	/* all 2.06-compliant */  	W(0xffffffff), W(0x0f000002),	/* all 2.05-compliant */  	W(0xfffffffe), W(0x0f000001),	/* all 2.04-compliant and earlier */ @@ -728,7 +732,7 @@ static unsigned char ibm_architecture_vec[] = {  	3 - 2,				/* length */  	0,				/* don't ignore, don't halt */  	OV1_PPC_2_00 | OV1_PPC_2_01 | OV1_PPC_2_02 | OV1_PPC_2_03 | -	OV1_PPC_2_04 | OV1_PPC_2_05 | OV1_PPC_2_06, +	OV1_PPC_2_04 | OV1_PPC_2_05 | OV1_PPC_2_06 | OV1_PPC_2_07,  	/* option vector 2: Open Firmware options supported */  	34 - 2,				/* length */ @@ -755,7 +759,7 @@ static unsigned char ibm_architecture_vec[] = {  	OV4_MIN_ENT_CAP,		/* minimum VP entitled capacity */  	/* option vector 5: PAPR/OF options */ -	18 - 2,				/* length */ +	19 - 2,				/* length */  	0,				/* don't ignore, don't halt */  	OV5_LPAR | OV5_SPLPAR | OV5_LARGE_PAGES | OV5_DRCONF_MEMORY |  	OV5_DONATE_DEDICATE_CPU | OV5_MSI, @@ -769,13 +773,14 @@ static unsigned char ibm_architecture_vec[] = {  	 * must match by the macro below. Update the definition if  	 * the structure layout changes.  	 */ -#define IBM_ARCH_VEC_NRCORES_OFFSET	101 +#define IBM_ARCH_VEC_NRCORES_OFFSET	117  	W(NR_CPUS),			/* number of cores supported */  	0,  	0,  	0,  	0,  	OV5_PFO_HW_RNG | OV5_PFO_HW_ENCR | OV5_PFO_HW_842, +	OV5_SUB_PROCESSORS,  	/* option vector 6: IBM PAPR hints */  	4 - 2,				/* length */  	0, diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 79d8e56470d..c4970004d44 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c @@ -952,6 +952,10 @@ int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,  		arch_bp_generic_fields(data &  					(DABR_DATA_WRITE | DABR_DATA_READ),  							&attr.bp_type); + +		/* Enable breakpoint */ +		attr.disabled = false; +  		ret =  modify_user_hw_breakpoint(bp, &attr);  		if (ret) {  			ptrace_put_breakpoints(task); @@ -1037,7 +1041,7 @@ void ptrace_disable(struct task_struct *child)  }  #ifdef CONFIG_PPC_ADV_DEBUG_REGS -static long set_intruction_bp(struct task_struct *child, +static long set_instruction_bp(struct task_struct *child,  			      struct ppc_hw_breakpoint *bp_info)  {  	int slot; @@ -1338,6 +1342,12 @@ static int set_dac_range(struct task_struct *child,  static long ppc_set_hwdebug(struct task_struct *child,  		     struct ppc_hw_breakpoint *bp_info)  { +#ifdef CONFIG_HAVE_HW_BREAKPOINT +	int len = 0; +	struct thread_struct *thread = &(child->thread); +	struct perf_event *bp; +	struct perf_event_attr attr; +#endif /* CONFIG_HAVE_HW_BREAKPOINT */  #ifndef CONFIG_PPC_ADV_DEBUG_REGS  	unsigned long dabr;  #endif @@ -1365,7 +1375,7 @@ static long ppc_set_hwdebug(struct task_struct *child,  		if ((bp_info->trigger_type != PPC_BREAKPOINT_TRIGGER_EXECUTE) ||  		    (bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE))  			return -EINVAL; -		return set_intruction_bp(child, bp_info); +		return set_instruction_bp(child, bp_info);  	}  	if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_EXACT)  		return set_dac(child, bp_info); @@ -1381,13 +1391,9 @@ static long ppc_set_hwdebug(struct task_struct *child,  	 */  	if ((bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_RW) == 0 ||  	    (bp_info->trigger_type & ~PPC_BREAKPOINT_TRIGGER_RW) != 0 || -	    bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT ||  	    bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE)  		return -EINVAL; -	if (child->thread.dabr) -		return -ENOSPC; -  	if ((unsigned long)bp_info->addr >= TASK_SIZE)  		return -EIO; @@ -1397,6 +1403,50 @@ static long ppc_set_hwdebug(struct task_struct *child,  		dabr |= DABR_DATA_READ;  	if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE)  		dabr |= DABR_DATA_WRITE; +#ifdef CONFIG_HAVE_HW_BREAKPOINT +	if (ptrace_get_breakpoints(child) < 0) +		return -ESRCH; + +	/* +	 * Check if the request is for 'range' breakpoints. We can +	 * support it if range < 8 bytes. +	 */ +	if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE) { +		len = bp_info->addr2 - bp_info->addr; +	} else if (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) { +		ptrace_put_breakpoints(child); +		return -EINVAL; +	} +	bp = thread->ptrace_bps[0]; +	if (bp) { +		ptrace_put_breakpoints(child); +		return -ENOSPC; +	} + +	/* Create a new breakpoint request if one doesn't exist already */ +	hw_breakpoint_init(&attr); +	attr.bp_addr = (unsigned long)bp_info->addr & ~HW_BREAKPOINT_ALIGN; +	attr.bp_len = len; +	arch_bp_generic_fields(dabr & (DABR_DATA_WRITE | DABR_DATA_READ), +								&attr.bp_type); + +	thread->ptrace_bps[0] = bp = register_user_hw_breakpoint(&attr, +					       ptrace_triggered, NULL, child); +	if (IS_ERR(bp)) { +		thread->ptrace_bps[0] = NULL; +		ptrace_put_breakpoints(child); +		return PTR_ERR(bp); +	} + +	ptrace_put_breakpoints(child); +	return 1; +#endif /* CONFIG_HAVE_HW_BREAKPOINT */ + +	if (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) +		return -EINVAL; + +	if (child->thread.dabr) +		return -ENOSPC;  	child->thread.dabr = dabr;  	child->thread.dabrx = DABRX_ALL; @@ -1405,8 +1455,13 @@ static long ppc_set_hwdebug(struct task_struct *child,  #endif /* !CONFIG_PPC_ADV_DEBUG_DVCS */  } -static long ppc_del_hwdebug(struct task_struct *child, long addr, long data) +static long ppc_del_hwdebug(struct task_struct *child, long data)  { +#ifdef CONFIG_HAVE_HW_BREAKPOINT +	int ret = 0; +	struct thread_struct *thread = &(child->thread); +	struct perf_event *bp; +#endif /* CONFIG_HAVE_HW_BREAKPOINT */  #ifdef CONFIG_PPC_ADV_DEBUG_REGS  	int rc; @@ -1426,10 +1481,25 @@ static long ppc_del_hwdebug(struct task_struct *child, long addr, long data)  #else  	if (data != 1)  		return -EINVAL; + +#ifdef CONFIG_HAVE_HW_BREAKPOINT +	if (ptrace_get_breakpoints(child) < 0) +		return -ESRCH; + +	bp = thread->ptrace_bps[0]; +	if (bp) { +		unregister_hw_breakpoint(bp); +		thread->ptrace_bps[0] = NULL; +	} else +		ret = -ENOENT; +	ptrace_put_breakpoints(child); +	return ret; +#else /* CONFIG_HAVE_HW_BREAKPOINT */  	if (child->thread.dabr == 0)  		return -ENOENT;  	child->thread.dabr = 0; +#endif /* CONFIG_HAVE_HW_BREAKPOINT */  	return 0;  #endif @@ -1536,7 +1606,11 @@ long arch_ptrace(struct task_struct *child, long request,  		dbginfo.data_bp_alignment = 4;  #endif  		dbginfo.sizeof_condition = 0; +#ifdef CONFIG_HAVE_HW_BREAKPOINT +		dbginfo.features = PPC_DEBUG_FEATURE_DATA_BP_RANGE; +#else  		dbginfo.features = 0; +#endif /* CONFIG_HAVE_HW_BREAKPOINT */  #endif /* CONFIG_PPC_ADV_DEBUG_REGS */  		if (!access_ok(VERIFY_WRITE, datavp, @@ -1563,7 +1637,7 @@ long arch_ptrace(struct task_struct *child, long request,  	}  	case PPC_PTRACE_DELHWDEBUG: { -		ret = ppc_del_hwdebug(child, addr, data); +		ret = ppc_del_hwdebug(child, data);  		break;  	} diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index fcec38241f7..1fd6e7b2f39 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c @@ -42,7 +42,6 @@  #include <asm/time.h>  #include <asm/mmu.h>  #include <asm/topology.h> -#include <asm/pSeries_reconfig.h>  struct rtas_t rtas = {  	.lock = __ARCH_SPIN_LOCK_UNLOCKED diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c index 20b0120db0c..8329190312c 100644 --- a/arch/powerpc/kernel/rtas_flash.c +++ b/arch/powerpc/kernel/rtas_flash.c @@ -650,10 +650,8 @@ static int initialize_flash_pde_data(const char *rtas_call_name,  	int token;  	dp->data = kzalloc(buf_size, GFP_KERNEL); -	if (dp->data == NULL) { -		remove_flash_pde(dp); +	if (dp->data == NULL)  		return -ENOMEM; -	}  	/*  	 * This code assumes that the status int is the first member of the diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c index 6de63e3250b..71cb20d6ec6 100644 --- a/arch/powerpc/kernel/rtas_pci.c +++ b/arch/powerpc/kernel/rtas_pci.c @@ -209,7 +209,7 @@ void __init init_pci_config_tokens (void)  	ibm_write_pci_config = rtas_token("ibm,write-pci-config");  } -unsigned long __devinit get_phb_buid (struct device_node *phb) +unsigned long get_phb_buid (struct device_node *phb)  {  	struct resource r; @@ -237,7 +237,7 @@ static int phb_set_bus_ranges(struct device_node *dev,  	return 0;  } -int __devinit rtas_setup_phb(struct pci_controller *phb) +int rtas_setup_phb(struct pci_controller *phb)  {  	struct device_node *dev = phb->dn; diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index efb6a41b313..6da881b35da 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -601,6 +601,11 @@ void __init setup_arch(char **cmdline_p)  	kvm_linear_init(); +	/* Interrupt code needs to be 64K-aligned */ +	if ((unsigned long)_stext & 0xffff) +		panic("Kernelbase not 64K-aligned (0x%lx)!\n", +		      (unsigned long)_stext); +  	ppc64_boot_msg(0x15, "Setup Done");  } diff --git a/arch/powerpc/kernel/smp-tbsync.c b/arch/powerpc/kernel/smp-tbsync.c index 640de836e46..e68fd1ae727 100644 --- a/arch/powerpc/kernel/smp-tbsync.c +++ b/arch/powerpc/kernel/smp-tbsync.c @@ -36,13 +36,13 @@ static struct {  static volatile int		running; -static void __devinit enter_contest(u64 mark, long add) +static void enter_contest(u64 mark, long add)  {  	while (get_tb() < mark)  		tbsync->race_result = add;  } -void __devinit smp_generic_take_timebase(void) +void smp_generic_take_timebase(void)  {  	int cmd;  	u64 tb; @@ -75,7 +75,7 @@ void __devinit smp_generic_take_timebase(void)  	local_irq_restore(flags);  } -static int __devinit start_contest(int cmd, long offset, int num) +static int start_contest(int cmd, long offset, int num)  {  	int i, score=0;  	u64 tb; @@ -110,7 +110,7 @@ static int __devinit start_contest(int cmd, long offset, int num)  	return score;  } -void __devinit smp_generic_give_timebase(void) +void smp_generic_give_timebase(void)  {  	int i, score, score2, old, min=0, max=5000, offset=1000; diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index e5b133ebd8a..793401e6508 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -82,7 +82,7 @@ int smt_enabled_at_boot = 1;  static void (*crash_ipi_function_ptr)(struct pt_regs *) = NULL;  #ifdef CONFIG_PPC64 -int __devinit smp_generic_kick_cpu(int nr) +int smp_generic_kick_cpu(int nr)  {  	BUG_ON(nr < 0 || nr >= NR_CPUS); @@ -311,7 +311,7 @@ void smp_send_stop(void)  struct thread_info *current_set[NR_CPUS]; -static void __devinit smp_store_cpu_info(int id) +static void smp_store_cpu_info(int id)  {  	per_cpu(cpu_pvr, id) = mfspr(SPRN_PVR);  #ifdef CONFIG_PPC_FSL_BOOK3E @@ -355,7 +355,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)  		max_cpus = 1;  } -void __devinit smp_prepare_boot_cpu(void) +void smp_prepare_boot_cpu(void)  {  	BUG_ON(smp_processor_id() != boot_cpuid);  #ifdef CONFIG_PPC64 @@ -610,7 +610,7 @@ static struct device_node *cpu_to_l2cache(int cpu)  }  /* Activate a secondary processor. */ -void __devinit start_secondary(void *unused) +void start_secondary(void *unused)  {  	unsigned int cpu = smp_processor_id();  	struct device_node *l2_cache; diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index b3b14352b05..6f6b1cccc91 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -770,13 +770,8 @@ void update_vsyscall_old(struct timespec *wall_time, struct timespec *wtm,  void update_vsyscall_tz(void)  { -	/* Make userspace gettimeofday spin until we're done. */ -	++vdso_data->tb_update_count; -	smp_mb();  	vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;  	vdso_data->tz_dsttime = sys_tz.tz_dsttime; -	smp_mb(); -	++vdso_data->tb_update_count;  }  static void __init clocksource_init(void) diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c index c39c1ca77f4..f9748498fe5 100644 --- a/arch/powerpc/kernel/udbg.c +++ b/arch/powerpc/kernel/udbg.c @@ -122,29 +122,6 @@ int udbg_write(const char *s, int n)  	return n - remain;  } -int udbg_read(char *buf, int buflen) -{ -	char *p = buf; -	int i, c; - -	if (!udbg_getc) -		return 0; - -	for (i = 0; i < buflen; ++i) { -		do { -			c = udbg_getc(); -			if (c == -1 && i == 0) -				return -1; - -		} while (c == 0x11 || c == 0x13); -		if (c == 0 || c == -1) -			break; -		*p++ = c; -	} - -	return i; -} -  #define UDBG_BUFSIZE 256  void udbg_printf(const char *fmt, ...)  { diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index 201ba59738b..536016d792b 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c @@ -1289,7 +1289,7 @@ void vio_unregister_driver(struct vio_driver *viodrv)  EXPORT_SYMBOL(vio_unregister_driver);  /* vio_dev refcount hit 0 */ -static void __devinit vio_dev_release(struct device *dev) +static void vio_dev_release(struct device *dev)  {  	struct iommu_table *tbl = get_iommu_table_base(dev); @@ -1545,7 +1545,7 @@ static struct device_attribute vio_dev_attrs[] = {  	__ATTR_NULL  }; -void __devinit vio_unregister_device(struct vio_dev *viodev) +void vio_unregister_device(struct vio_dev *viodev)  {  	device_unregister(&viodev->dev);  } diff --git a/arch/powerpc/kvm/book3s_hv_ras.c b/arch/powerpc/kvm/book3s_hv_ras.c index 35f3cf0269b..a353c485808 100644 --- a/arch/powerpc/kvm/book3s_hv_ras.c +++ b/arch/powerpc/kvm/book3s_hv_ras.c @@ -79,7 +79,9 @@ static void flush_tlb_power7(struct kvm_vcpu *vcpu)  static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu)  {  	unsigned long srr1 = vcpu->arch.shregs.msr; +#ifdef CONFIG_PPC_POWERNV  	struct opal_machine_check_event *opal_evt; +#endif  	long handled = 1;  	if (srr1 & SRR1_MC_LDSTERR) { @@ -117,6 +119,7 @@ static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu)  		handled = 0;  	} +#ifdef CONFIG_PPC_POWERNV  	/*  	 * See if OPAL has already handled the condition.  	 * We assume that if the condition is recovered then OPAL @@ -131,6 +134,7 @@ static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu)  	if (handled)  		opal_evt->in_use = 0; +#endif  	return handled;  } diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 59213cfaeca..bba87ca2b4d 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -399,18 +399,6 @@ static unsigned long read_n_cells(int n, const unsigned int **buf)  	return result;  } -struct of_drconf_cell { -	u64	base_addr; -	u32	drc_index; -	u32	reserved; -	u32	aa_index; -	u32	flags; -}; - -#define DRCONF_MEM_ASSIGNED	0x00000008 -#define DRCONF_MEM_AI_INVALID	0x00000040 -#define DRCONF_MEM_RESERVED	0x00000080 -  /*   * Read the next memblock list entry from the ibm,dynamic-memory property   * and return the information in the provided of_drconf_cell structure. diff --git a/arch/powerpc/mm/tlb_hash64.c b/arch/powerpc/mm/tlb_hash64.c index ae758b3ff72..0d82ef50dc3 100644 --- a/arch/powerpc/mm/tlb_hash64.c +++ b/arch/powerpc/mm/tlb_hash64.c @@ -186,8 +186,6 @@ void tlb_flush(struct mmu_gather *tlb)   * Because of that usage pattern, it's only available with CONFIG_HOTPLUG   * and is implemented for small size rather than speed.   */ -#ifdef CONFIG_HOTPLUG -  void __flush_hash_table_range(struct mm_struct *mm, unsigned long start,  			      unsigned long end)  { @@ -221,5 +219,3 @@ void __flush_hash_table_range(struct mm_struct *mm, unsigned long start,  	arch_leave_lazy_mmu_mode();  	local_irq_restore(flags);  } - -#endif /* CONFIG_HOTPLUG */ diff --git a/arch/powerpc/mm/tlb_nohash_low.S b/arch/powerpc/mm/tlb_nohash_low.S index fab919fd138..626ad081639 100644 --- a/arch/powerpc/mm/tlb_nohash_low.S +++ b/arch/powerpc/mm/tlb_nohash_low.S @@ -191,12 +191,6 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_47x)  #ifdef CONFIG_PPC_47x  /* - * 47x variant of icbt - */ -# define ICBT(CT,RA,RB)	\ -	.long	0x7c00002c | ((CT) << 21) | ((RA) << 16) | ((RB) << 11) - -/*   * _tlbivax_bcast is only on 47x. We don't bother doing a runtime   * check though, it will blow up soon enough if we mistakenly try   * to use it on a 440. @@ -208,8 +202,7 @@ _GLOBAL(_tlbivax_bcast)  	wrteei	0  	mtspr	SPRN_MMUCR,r5  	isync -/*	tlbivax	0,r3 - use .long to avoid binutils deps */ -	.long 0x7c000624 | (r3 << 11) +	PPC_TLBIVAX(0, R3)  	isync  	eieio  	tlbsync @@ -227,11 +220,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_476_DD2)  	bl	2f  2:	mflr	r6  	li	r7,32 -	ICBT(0,r6,r7)		/* touch next cache line */ +	PPC_ICBT(0,R6,R7)		/* touch next cache line */  	add	r6,r6,r7 -	ICBT(0,r6,r7)		/* touch next cache line */ +	PPC_ICBT(0,R6,R7)		/* touch next cache line */  	add	r6,r6,r7 -	ICBT(0,r6,r7)		/* touch next cache line */ +	PPC_ICBT(0,R6,R7)		/* touch next cache line */  	sync  	nop  	nop diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c index 441af08edf4..2ee01e38d5e 100644 --- a/arch/powerpc/perf/power7-pmu.c +++ b/arch/powerpc/perf/power7-pmu.c @@ -54,8 +54,10 @@   * Layout of constraint bits:   * 6666555555555544444444443333333333222222222211111111110000000000   * 3210987654321098765432109876543210987654321098765432109876543210 - *                                                 [  ><><><><><><> - *                                                  NC P6P5P4P3P2P1 + *                                              < ><  ><><><><><><> + *                                              L2  NC P6P5P4P3P2P1 + * + * L2 - 16-18 - Required L2SEL value (select field)   *   * NC - number of counters   *     15: NC error 0x8000 @@ -72,7 +74,7 @@  static int power7_get_constraint(u64 event, unsigned long *maskp,  				 unsigned long *valp)  { -	int pmc, sh; +	int pmc, sh, unit;  	unsigned long mask = 0, value = 0;  	pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; @@ -90,6 +92,15 @@ static int power7_get_constraint(u64 event, unsigned long *maskp,  		mask  |= 0x8000;  		value |= 0x1000;  	} + +	unit = (event >> PM_UNIT_SH) & PM_UNIT_MSK; +	if (unit == 6) { +		/* L2SEL must be identical across events */ +		int l2sel = (event >> PM_L2SEL_SH) & PM_L2SEL_MSK; +		mask  |= 0x7 << 16; +		value |= l2sel << 16; +	} +  	*maskp = mask;  	*valp = value;  	return 0; diff --git a/arch/powerpc/platforms/40x/ppc40x_simple.c b/arch/powerpc/platforms/40x/ppc40x_simple.c index 969dddcf332..8f3920e5a04 100644 --- a/arch/powerpc/platforms/40x/ppc40x_simple.c +++ b/arch/powerpc/platforms/40x/ppc40x_simple.c @@ -57,7 +57,8 @@ static const char * const board[] __initconst = {  	"amcc,makalu",  	"apm,klondike",  	"est,hotfoot", -	"plathome,obs600" +	"plathome,obs600", +	NULL  };  static int __init ppc40x_probe(void) diff --git a/arch/powerpc/platforms/44x/currituck.c b/arch/powerpc/platforms/44x/currituck.c index 6bd89a0e0de..ecd3890c40d 100644 --- a/arch/powerpc/platforms/44x/currituck.c +++ b/arch/powerpc/platforms/44x/currituck.c @@ -46,7 +46,7 @@ static __initdata struct of_device_id ppc47x_of_bus[] = {  /* The EEPROM is missing and the default values are bogus.  This forces USB in   * to EHCI mode */ -static void __devinit quirk_ppc_currituck_usb_fixup(struct pci_dev *dev) +static void quirk_ppc_currituck_usb_fixup(struct pci_dev *dev)  {  	if (of_machine_is_compatible("ibm,currituck")) {  		pci_write_config_dword(dev, 0xe0, 0x0114231f); diff --git a/arch/powerpc/platforms/44x/virtex_ml510.c b/arch/powerpc/platforms/44x/virtex_ml510.c index ba4a6e388a4..1fdb8748638 100644 --- a/arch/powerpc/platforms/44x/virtex_ml510.c +++ b/arch/powerpc/platforms/44x/virtex_ml510.c @@ -5,7 +5,7 @@  /**   * ml510_ail_quirk   */ -static void __devinit ml510_ali_quirk(struct pci_dev *dev) +static void ml510_ali_quirk(struct pci_dev *dev)  {  	/* Enable the IDE controller */  	pci_write_config_byte(dev, 0x58, 0x4c); diff --git a/arch/powerpc/platforms/512x/Kconfig b/arch/powerpc/platforms/512x/Kconfig index b62508b113d..c16999802ec 100644 --- a/arch/powerpc/platforms/512x/Kconfig +++ b/arch/powerpc/platforms/512x/Kconfig @@ -2,7 +2,6 @@ config PPC_MPC512x  	bool "512x-based boards"  	depends on 6xx  	select FSL_SOC -	select FB_FSL_DIU  	select IPIC  	select PPC_CLOCK  	select PPC_PCI_CHOICE diff --git a/arch/powerpc/platforms/512x/mpc5121_ads.c b/arch/powerpc/platforms/512x/mpc5121_ads.c index dcef6ade48e..0a134e0469e 100644 --- a/arch/powerpc/platforms/512x/mpc5121_ads.c +++ b/arch/powerpc/platforms/512x/mpc5121_ads.c @@ -42,7 +42,10 @@ static void __init mpc5121_ads_setup_arch(void)  	for_each_compatible_node(np, "pci", "fsl,mpc5121-pci")  		mpc83xx_add_bridge(np);  #endif + +#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)  	mpc512x_setup_diu(); +#endif  }  static void __init mpc5121_ads_init_IRQ(void) diff --git a/arch/powerpc/platforms/512x/mpc512x.h b/arch/powerpc/platforms/512x/mpc512x.h index 1ab6d11d0b1..c32b399eb95 100644 --- a/arch/powerpc/platforms/512x/mpc512x.h +++ b/arch/powerpc/platforms/512x/mpc512x.h @@ -16,6 +16,13 @@ extern void __init mpc512x_init(void);  extern int __init mpc5121_clk_init(void);  void __init mpc512x_declare_of_platform_devices(void);  extern void mpc512x_restart(char *cmd); -extern void mpc512x_init_diu(void); -extern void mpc512x_setup_diu(void); + +#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) +void mpc512x_init_diu(void); +void mpc512x_setup_diu(void); +#else +#define mpc512x_init_diu NULL +#define mpc512x_setup_diu NULL +#endif +  #endif				/* __MPC512X_H__ */ diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c index 1650e090ef3..35f14fda108 100644 --- a/arch/powerpc/platforms/512x/mpc512x_shared.c +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c @@ -58,6 +58,8 @@ void mpc512x_restart(char *cmd)  		;  } +#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) +  struct fsl_diu_shared_fb {  	u8		gamma[0x300];	/* 32-bit aligned! */  	struct diu_ad	ad0;		/* 32-bit aligned! */ @@ -66,25 +68,6 @@ struct fsl_diu_shared_fb {  	bool		in_use;  }; -u32 mpc512x_get_pixel_format(enum fsl_diu_monitor_port port, -			     unsigned int bits_per_pixel) -{ -	switch (bits_per_pixel) { -	case 32: -		return 0x88883316; -	case 24: -		return 0x88082219; -	case 16: -		return 0x65053118; -	} -	return 0x00000400; -} - -void mpc512x_set_gamma_table(enum fsl_diu_monitor_port port, -			     char *gamma_table_base) -{ -} -  void mpc512x_set_monitor_port(enum fsl_diu_monitor_port port)  {  } @@ -320,14 +303,14 @@ void __init mpc512x_setup_diu(void)  		}  	} -	diu_ops.get_pixel_format	= mpc512x_get_pixel_format; -	diu_ops.set_gamma_table		= mpc512x_set_gamma_table;  	diu_ops.set_monitor_port	= mpc512x_set_monitor_port;  	diu_ops.set_pixel_clock		= mpc512x_set_pixel_clock;  	diu_ops.valid_monitor_port	= mpc512x_valid_monitor_port;  	diu_ops.release_bootmem		= mpc512x_release_bootmem;  } +#endif +  void __init mpc512x_init_IRQ(void)  {  	struct device_node *np; diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c index 448d862bcf3..1843bc93201 100644 --- a/arch/powerpc/platforms/52xx/lite5200.c +++ b/arch/powerpc/platforms/52xx/lite5200.c @@ -4,7 +4,7 @@   * Written by: Grant Likely <grant.likely@secretlab.ca>   *   * Copyright (C) Secret Lab Technologies Ltd. 2006. All rights reserved. - * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. + * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved.   *   * Description:   * This program is free software; you can redistribute  it and/or modify it diff --git a/arch/powerpc/platforms/52xx/mpc5200_simple.c b/arch/powerpc/platforms/52xx/mpc5200_simple.c index 9cf36020cf0..792a301a0bf 100644 --- a/arch/powerpc/platforms/52xx/mpc5200_simple.c +++ b/arch/powerpc/platforms/52xx/mpc5200_simple.c @@ -50,6 +50,7 @@ static void __init mpc5200_simple_setup_arch(void)  /* list of the supported boards */  static const char *board[] __initdata = { +	"anonymous,a3m071",  	"anonymous,a4m072",  	"anon,charon",  	"ifm,o2d", diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c index a51cb07bd66..692998244d2 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c @@ -669,7 +669,7 @@ static struct miscdevice mpc52xx_wdt_miscdev = {  	.fops		= &mpc52xx_wdt_fops,  }; -static int __devinit mpc52xx_gpt_wdt_init(void) +static int mpc52xx_gpt_wdt_init(void)  {  	int err; @@ -704,7 +704,7 @@ static int mpc52xx_gpt_wdt_setup(struct mpc52xx_gpt_priv *gpt,  #else -static int __devinit mpc52xx_gpt_wdt_init(void) +static int mpc52xx_gpt_wdt_init(void)  {  	return 0;  } @@ -720,7 +720,7 @@ static inline int mpc52xx_gpt_wdt_setup(struct mpc52xx_gpt_priv *gpt,  /* ---------------------------------------------------------------------   * of_platform bus binding code   */ -static int __devinit mpc52xx_gpt_probe(struct platform_device *ofdev) +static int mpc52xx_gpt_probe(struct platform_device *ofdev)  {  	struct mpc52xx_gpt_priv *gpt; diff --git a/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c b/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c index 2351f9e0fb6..f9f4537f546 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c @@ -470,7 +470,7 @@ void mpc52xx_lpbfifo_abort(struct mpc52xx_lpbfifo_request *req)  }  EXPORT_SYMBOL(mpc52xx_lpbfifo_abort); -static int __devinit mpc52xx_lpbfifo_probe(struct platform_device *op) +static int mpc52xx_lpbfifo_probe(struct platform_device *op)  {  	struct resource res;  	int rc = -ENOMEM; @@ -540,7 +540,7 @@ static int __devinit mpc52xx_lpbfifo_probe(struct platform_device *op)  } -static int __devexit mpc52xx_lpbfifo_remove(struct platform_device *op) +static int mpc52xx_lpbfifo_remove(struct platform_device *op)  {  	if (lpbfifo.dev != &op->dev)  		return 0; @@ -564,7 +564,7 @@ static int __devexit mpc52xx_lpbfifo_remove(struct platform_device *op)  	return 0;  } -static struct of_device_id mpc52xx_lpbfifo_match[] __devinitconst = { +static struct of_device_id mpc52xx_lpbfifo_match[] = {  	{ .compatible = "fsl,mpc5200-lpbfifo", },  	{},  }; @@ -576,20 +576,6 @@ static struct platform_driver mpc52xx_lpbfifo_driver = {  		.of_match_table = mpc52xx_lpbfifo_match,  	},  	.probe = mpc52xx_lpbfifo_probe, -	.remove = __devexit_p(mpc52xx_lpbfifo_remove), +	.remove = mpc52xx_lpbfifo_remove,  }; - -/*********************************************************************** - * Module init/exit - */ -static int __init mpc52xx_lpbfifo_init(void) -{ -	return platform_driver_register(&mpc52xx_lpbfifo_driver); -} -module_init(mpc52xx_lpbfifo_init); - -static void __exit mpc52xx_lpbfifo_exit(void) -{ -	platform_driver_unregister(&mpc52xx_lpbfifo_driver); -} -module_exit(mpc52xx_lpbfifo_exit); +module_platform_driver(mpc52xx_lpbfifo_driver); diff --git a/arch/powerpc/platforms/82xx/ep8248e.c b/arch/powerpc/platforms/82xx/ep8248e.c index 10ff526cd04..79799b29ffe 100644 --- a/arch/powerpc/platforms/82xx/ep8248e.c +++ b/arch/powerpc/platforms/82xx/ep8248e.c @@ -111,7 +111,7 @@ static struct mdiobb_ctrl ep8248e_mdio_ctrl = {  	.ops = &ep8248e_mdio_ops,  }; -static int __devinit ep8248e_mdio_probe(struct platform_device *ofdev) +static int ep8248e_mdio_probe(struct platform_device *ofdev)  {  	struct mii_bus *bus;  	struct resource res; diff --git a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c index 328d221fd1c..74861a7fb80 100644 --- a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c +++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c @@ -16,7 +16,6 @@  #include <linux/spinlock.h>  #include <linux/irq.h>  #include <linux/types.h> -#include <linux/bootmem.h>  #include <linux/slab.h>  #include <asm/io.h> @@ -149,7 +148,7 @@ int __init pq2ads_pci_init_irq(void)  	priv->regs = of_iomap(np, 0);  	if (!priv->regs) {  		printk(KERN_ERR "Cannot map PCI PIC registers.\n"); -		goto out_free_bootmem; +		goto out_free_kmalloc;  	}  	/* mask all PCI interrupts */ @@ -171,9 +170,8 @@ int __init pq2ads_pci_init_irq(void)  out_unmap_regs:  	iounmap(priv->regs); -out_free_bootmem: -	free_bootmem((unsigned long)priv, -	             sizeof(struct pq2ads_pci_pic)); +out_free_kmalloc: +	kfree(priv);  	of_node_put(np);  out_unmap_irq:  	irq_dispose_mapping(irq); diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c index ef6537b8ed3..624cb51d19c 100644 --- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c +++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c @@ -145,8 +145,7 @@ static int mcu_gpiochip_remove(struct mcu *mcu)  	return gpiochip_remove(&mcu->gc);  } -static int __devinit mcu_probe(struct i2c_client *client, -			       const struct i2c_device_id *id) +static int mcu_probe(struct i2c_client *client, const struct i2c_device_id *id)  {  	struct mcu *mcu;  	int ret; @@ -188,7 +187,7 @@ err:  	return ret;  } -static int __devexit mcu_remove(struct i2c_client *client) +static int mcu_remove(struct i2c_client *client)  {  	struct mcu *mcu = i2c_get_clientdata(client);  	int ret; @@ -216,7 +215,7 @@ static const struct i2c_device_id mcu_ids[] = {  };  MODULE_DEVICE_TABLE(i2c, mcu_ids); -static struct of_device_id mcu_of_match_table[] __devinitdata = { +static struct of_device_id mcu_of_match_table[] = {  	{ .compatible = "fsl,mcu-mpc8349emitx", },  	{ },  }; @@ -228,7 +227,7 @@ static struct i2c_driver mcu_driver = {  		.of_match_table = mcu_of_match_table,  	},  	.probe = mcu_probe, -	.remove	= __devexit_p(mcu_remove), +	.remove	= mcu_remove,  	.id_table = mcu_ids,  }; diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c index d440435e055..8d762203eef 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c @@ -1,5 +1,5 @@  /* - * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. + * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved.   *   * Description:   * MPC832xE MDS board specific routines. diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c index 1b1f6c8a1a1..1a26d2f8340 100644 --- a/arch/powerpc/platforms/83xx/mpc836x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c @@ -1,5 +1,5 @@  /* - * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. + * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved.   *   * Author: Li Yang <LeoLi@freescale.com>   *	   Yin Olivia <Hong-hua.Yin@freescale.com> diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c index f8769d713d6..b63b42d11d6 100644 --- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c +++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c @@ -1,7 +1,7 @@  /*   * MPC8360E-RDK board file.   * - * Copyright (c) 2006  Freescale Semicondutor, Inc. + * Copyright (c) 2006  Freescale Semiconductor, Inc.   * Copyright (c) 2007-2008  MontaVista Software, Inc.   *   * Author: Anton Vorontsov <avorontsov@ru.mvista.com> diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c index eca1f0960ff..9813c81e8e5 100644 --- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c @@ -1,7 +1,7 @@  /*   * arch/powerpc/platforms/83xx/mpc837x_rdb.c   * - * Copyright (C) 2007 Freescale Semicondutor, Inc. All rights reserved. + * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.   *   * MPC837x RDB board specific routines   * diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c b/arch/powerpc/platforms/85xx/corenet_ds.c index ed69c925071..6f355d8c92f 100644 --- a/arch/powerpc/platforms/85xx/corenet_ds.c +++ b/arch/powerpc/platforms/85xx/corenet_ds.c @@ -64,7 +64,7 @@ void __init corenet_ds_setup_arch(void)  	pr_info("%s board from Freescale Semiconductor\n", ppc_md.name);  } -static const struct of_device_id of_device_ids[] __devinitconst = { +static const struct of_device_id of_device_ids[] = {  	{  		.compatible	= "simple-bus"  	}, diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c index c474505ad0d..7a31a0e1df2 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c @@ -154,7 +154,7 @@ static void __init mpc85xx_cds_pci_irq_fixup(struct pci_dev *dev)  	}  } -static void __devinit skip_fake_bridge(struct pci_dev *dev) +static void skip_fake_bridge(struct pci_dev *dev)  {  	/* Make it an error to skip the fake bridge  	 * in pci_setup_device() in probe.c */ diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index 8498f732347..bd12588fa25 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c @@ -1,5 +1,5 @@  /* - * Copyright (C) 2006-2010, 2012 Freescale Semicondutor, Inc. + * Copyright (C) 2006-2010, 2012 Freescale Semiconductor, Inc.   * All rights reserved.   *   * Author: Andy Fleming <afleming@freescale.com> diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c index 848a3e98e1c..7328b8d7412 100644 --- a/arch/powerpc/platforms/85xx/p1022_ds.c +++ b/arch/powerpc/platforms/85xx/p1022_ds.c @@ -249,7 +249,7 @@ static void p1022ds_set_monitor_port(enum fsl_diu_monitor_port port)  		goto exit;  	} -	iprop = of_get_property(law_node, "fsl,num-laws", 0); +	iprop = of_get_property(law_node, "fsl,num-laws", NULL);  	if (!iprop) {  		pr_err("p1022ds: LAW node is missing fsl,num-laws property\n");  		goto exit; @@ -539,7 +539,7 @@ static void __init p1022_ds_setup_arch(void)  				};  				/* -				 * prom_update_property() is called before +				 * of_update_property() is called before  				 * kmalloc() is available, so the 'new' object  				 * should be allocated in the global area.  				 * The easiest way is to do that is to @@ -548,7 +548,7 @@ static void __init p1022_ds_setup_arch(void)  				 */  				pr_info("p1022ds: disabling %s node",  					np2->full_name); -				prom_update_property(np2, &nor_status); +				of_update_property(np2, &nor_status);  				of_node_put(np2);  			} @@ -564,7 +564,7 @@ static void __init p1022_ds_setup_arch(void)  				pr_info("p1022ds: disabling %s node",  					np2->full_name); -				prom_update_property(np2, &nand_status); +				of_update_property(np2, &nand_status);  				of_node_put(np2);  			} diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c index 6fcfa12e5c5..148c2f2d978 100644 --- a/arch/powerpc/platforms/85xx/smp.c +++ b/arch/powerpc/platforms/85xx/smp.c @@ -128,6 +128,19 @@ static void __cpuinit smp_85xx_mach_cpu_die(void)  }  #endif +static inline void flush_spin_table(void *spin_table) +{ +	flush_dcache_range((ulong)spin_table, +		(ulong)spin_table + sizeof(struct epapr_spin_table)); +} + +static inline u32 read_spin_table_addr_l(void *spin_table) +{ +	flush_dcache_range((ulong)spin_table, +		(ulong)spin_table + sizeof(struct epapr_spin_table)); +	return in_be32(&((struct epapr_spin_table *)spin_table)->addr_l); +} +  static int __cpuinit smp_85xx_kick_cpu(int nr)  {  	unsigned long flags; @@ -161,8 +174,8 @@ static int __cpuinit smp_85xx_kick_cpu(int nr)  	/* Map the spin table */  	if (ioremappable) -		spin_table = ioremap(*cpu_rel_addr, -				sizeof(struct epapr_spin_table)); +		spin_table = ioremap_prot(*cpu_rel_addr, +			sizeof(struct epapr_spin_table), _PAGE_COHERENT);  	else  		spin_table = phys_to_virt(*cpu_rel_addr); @@ -173,7 +186,16 @@ static int __cpuinit smp_85xx_kick_cpu(int nr)  	generic_set_cpu_up(nr);  	if (system_state == SYSTEM_RUNNING) { +		/* +		 * To keep it compatible with old boot program which uses +		 * cache-inhibit spin table, we need to flush the cache +		 * before accessing spin table to invalidate any staled data. +		 * We also need to flush the cache after writing to spin +		 * table to push data out. +		 */ +		flush_spin_table(spin_table);  		out_be32(&spin_table->addr_l, 0); +		flush_spin_table(spin_table);  		/*  		 * We don't set the BPTR register here since it already points @@ -181,9 +203,14 @@ static int __cpuinit smp_85xx_kick_cpu(int nr)  		 */  		mpic_reset_core(hw_cpu); -		/* wait until core is ready... */ -		if (!spin_event_timeout(in_be32(&spin_table->addr_l) == 1, -						10000, 100)) { +		/* +		 * wait until core is ready... +		 * We need to invalidate the stale data, in case the boot +		 * loader uses a cache-inhibited spin table. +		 */ +		if (!spin_event_timeout( +				read_spin_table_addr_l(spin_table) == 1, +				10000, 100)) {  			pr_err("%s: timeout waiting for core %d to reset\n",  							__func__, hw_cpu);  			ret = -ENOENT; @@ -194,12 +221,10 @@ static int __cpuinit smp_85xx_kick_cpu(int nr)  		__secondary_hold_acknowledge = -1;  	}  #endif +	flush_spin_table(spin_table);  	out_be32(&spin_table->pir, hw_cpu);  	out_be32(&spin_table->addr_l, __pa(__early_start)); - -	if (!ioremappable) -		flush_dcache_range((ulong)spin_table, -			(ulong)spin_table + sizeof(struct epapr_spin_table)); +	flush_spin_table(spin_table);  	/* Wait a bit for the CPU to ack. */  	if (!spin_event_timeout(__secondary_hold_acknowledge == hw_cpu, @@ -213,13 +238,11 @@ out:  #else  	smp_generic_kick_cpu(nr); +	flush_spin_table(spin_table);  	out_be32(&spin_table->pir, hw_cpu);  	out_be64((u64 *)(&spin_table->addr_h),  	  __pa((u64)*((unsigned long long *)generic_secondary_smp_init))); - -	if (!ioremappable) -		flush_dcache_range((ulong)spin_table, -			(ulong)spin_table + sizeof(struct epapr_spin_table)); +	flush_spin_table(spin_table);  #endif  	local_irq_restore(flags); diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c index b4e58cdc09a..ec0b7272fae 100644 --- a/arch/powerpc/platforms/85xx/tqm85xx.c +++ b/arch/powerpc/platforms/85xx/tqm85xx.c @@ -85,7 +85,7 @@ static void tqm85xx_show_cpuinfo(struct seq_file *m)  	seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));  } -static void __devinit tqm85xx_ti1520_fixup(struct pci_dev *pdev) +static void tqm85xx_ti1520_fixup(struct pci_dev *pdev)  {  	unsigned int val; diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c b/arch/powerpc/platforms/86xx/gef_ppc9a.c index bf5338754c5..c23f3443880 100644 --- a/arch/powerpc/platforms/86xx/gef_ppc9a.c +++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c @@ -159,7 +159,7 @@ static void gef_ppc9a_show_cpuinfo(struct seq_file *m)  		gef_ppc9a_get_vme_is_syscon() ? "yes" : "no");  } -static void __devinit gef_ppc9a_nec_fixup(struct pci_dev *pdev) +static void gef_ppc9a_nec_fixup(struct pci_dev *pdev)  {  	unsigned int val; diff --git a/arch/powerpc/platforms/86xx/gef_sbc310.c b/arch/powerpc/platforms/86xx/gef_sbc310.c index 0b7851330a0..8a6ac20686e 100644 --- a/arch/powerpc/platforms/86xx/gef_sbc310.c +++ b/arch/powerpc/platforms/86xx/gef_sbc310.c @@ -146,7 +146,7 @@ static void gef_sbc310_show_cpuinfo(struct seq_file *m)  } -static void __devinit gef_sbc310_nec_fixup(struct pci_dev *pdev) +static void gef_sbc310_nec_fixup(struct pci_dev *pdev)  {  	unsigned int val; diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c index b9eb174897b..06c72636f29 100644 --- a/arch/powerpc/platforms/86xx/gef_sbc610.c +++ b/arch/powerpc/platforms/86xx/gef_sbc610.c @@ -136,7 +136,7 @@ static void gef_sbc610_show_cpuinfo(struct seq_file *m)  	seq_printf(m, "SVR\t\t: 0x%x\n", svid);  } -static void __devinit gef_sbc610_nec_fixup(struct pci_dev *pdev) +static void gef_sbc610_nec_fixup(struct pci_dev *pdev)  {  	unsigned int val; diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c index a817398a56d..04d9d317f74 100644 --- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c +++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c @@ -353,5 +353,7 @@ define_machine(mpc86xx_hpcd) {  	.time_init		= mpc86xx_time_init,  	.calibrate_decr		= generic_calibrate_decr,  	.progress		= udbg_progress, +#ifdef CONFIG_PCI  	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus, +#endif  }; diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c index 4ab08767118..6ae25fb6201 100644 --- a/arch/powerpc/platforms/cell/setup.c +++ b/arch/powerpc/platforms/cell/setup.c @@ -117,7 +117,7 @@ static void cell_fixup_pcie_rootcomplex(struct pci_dev *dev)  }  DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, cell_fixup_pcie_rootcomplex); -static int __devinit cell_setup_phb(struct pci_controller *phb) +static int cell_setup_phb(struct pci_controller *phb)  {  	const char *model;  	struct device_node *np; diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c index 49a65e2dfc7..d35dbbc8ec7 100644 --- a/arch/powerpc/platforms/cell/smp.c +++ b/arch/powerpc/platforms/cell/smp.c @@ -67,7 +67,7 @@ static cpumask_t of_spin_map;   *	0	- failure   *	1	- success   */ -static inline int __devinit smp_startup_cpu(unsigned int lcpu) +static inline int smp_startup_cpu(unsigned int lcpu)  {  	int status;  	unsigned long start_here = __pa((u32)*((unsigned long *) @@ -108,7 +108,7 @@ static int __init smp_iic_probe(void)  	return cpumask_weight(cpu_possible_mask);  } -static void __devinit smp_cell_setup_cpu(int cpu) +static void smp_cell_setup_cpu(int cpu)  {  	if (cpu != boot_cpuid)  		iic_setup_cpu(); @@ -119,7 +119,7 @@ static void __devinit smp_cell_setup_cpu(int cpu)  	mtspr(SPRN_DABRX, DABRX_KERNEL | DABRX_USER);  } -static int __devinit smp_cell_kick_cpu(int nr) +static int smp_cell_kick_cpu(int nr)  {  	BUG_ON(nr < 0 || nr >= NR_CPUS); diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/platforms/cell/spufs/syscalls.c index 5b7d8ffbf89..baee994fe81 100644 --- a/arch/powerpc/platforms/cell/spufs/syscalls.c +++ b/arch/powerpc/platforms/cell/spufs/syscalls.c @@ -66,7 +66,7 @@ static long do_spu_create(const char __user *pathname, unsigned int flags,  	struct dentry *dentry;  	int ret; -	dentry = user_path_create(AT_FDCWD, pathname, &path, 1); +	dentry = user_path_create(AT_FDCWD, pathname, &path, LOOKUP_DIRECTORY);  	ret = PTR_ERR(dentry);  	if (!IS_ERR(dentry)) {  		ret = spufs_create(&path, dentry, flags, mode, neighbor); diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c index 83285c5a204..1b87e198faa 100644 --- a/arch/powerpc/platforms/chrp/pci.c +++ b/arch/powerpc/platforms/chrp/pci.c @@ -323,7 +323,7 @@ chrp_find_bridges(void)   * ATA controller to be set to fully native mode or bad things   * will happen.   */ -static void __devinit chrp_pci_fixup_winbond_ata(struct pci_dev *sl82c105) +static void chrp_pci_fixup_winbond_ata(struct pci_dev *sl82c105)  {  	u8 progif; diff --git a/arch/powerpc/platforms/chrp/smp.c b/arch/powerpc/platforms/chrp/smp.c index feab30bbae2..dead91b177b 100644 --- a/arch/powerpc/platforms/chrp/smp.c +++ b/arch/powerpc/platforms/chrp/smp.c @@ -30,7 +30,7 @@  #include <asm/mpic.h>  #include <asm/rtas.h> -static int __devinit smp_chrp_kick_cpu(int nr) +static int smp_chrp_kick_cpu(int nr)  {  	*(unsigned long *)KERNELBASE = nr;  	asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory"); @@ -38,7 +38,7 @@ static int __devinit smp_chrp_kick_cpu(int nr)  	return 0;  } -static void __devinit smp_chrp_setup_cpu(int cpu_nr) +static void smp_chrp_setup_cpu(int cpu_nr)  {  	mpic_setup_this_cpu();  } diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c index 64fde058e54..92ac9b52b32 100644 --- a/arch/powerpc/platforms/fsl_uli1575.c +++ b/arch/powerpc/platforms/fsl_uli1575.c @@ -59,7 +59,7 @@ static inline bool is_quirk_valid(void)  }  /* Bridge */ -static void __devinit early_uli5249(struct pci_dev *dev) +static void early_uli5249(struct pci_dev *dev)  {  	unsigned char temp; @@ -82,7 +82,7 @@ static void __devinit early_uli5249(struct pci_dev *dev)  } -static void __devinit quirk_uli1575(struct pci_dev *dev) +static void quirk_uli1575(struct pci_dev *dev)  {  	int i; @@ -139,7 +139,7 @@ static void __devinit quirk_uli1575(struct pci_dev *dev)  	pci_write_config_byte(dev, 0x75, ULI_8259_IRQ15);  } -static void __devinit quirk_final_uli1575(struct pci_dev *dev) +static void quirk_final_uli1575(struct pci_dev *dev)  {  	/* Set i8259 interrupt trigger  	 * IRQ 3:  Level @@ -175,7 +175,7 @@ static void __devinit quirk_final_uli1575(struct pci_dev *dev)  }  /* SATA */ -static void __devinit quirk_uli5288(struct pci_dev *dev) +static void quirk_uli5288(struct pci_dev *dev)  {  	unsigned char c;  	unsigned int d; @@ -200,7 +200,7 @@ static void __devinit quirk_uli5288(struct pci_dev *dev)  }  /* PATA */ -static void __devinit quirk_uli5229(struct pci_dev *dev) +static void quirk_uli5229(struct pci_dev *dev)  {  	unsigned short temp; @@ -216,7 +216,7 @@ static void __devinit quirk_uli5229(struct pci_dev *dev)  }  /* We have to do a dummy read on the P2P for the RTC to work, WTF */ -static void __devinit quirk_final_uli5249(struct pci_dev *dev) +static void quirk_final_uli5249(struct pci_dev *dev)  {  	int i;  	u8 *dummy; @@ -253,7 +253,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5249, quirk_final_uli5249);  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x1575, quirk_final_uli1575);  DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229); -static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev) +static void hpcd_quirk_uli1575(struct pci_dev *dev)  {  	u32 temp32; @@ -269,7 +269,7 @@ static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev)  	pci_write_config_dword(dev, 0x90, (temp32 | 1<<22));  } -static void __devinit hpcd_quirk_uli5288(struct pci_dev *dev) +static void hpcd_quirk_uli5288(struct pci_dev *dev)  {  	unsigned char c; @@ -295,7 +295,7 @@ static void __devinit hpcd_quirk_uli5288(struct pci_dev *dev)   * IRQ14 is a sideband interrupt from IDE device to CPU and we use this   * as the interrupt for IDE device.   */ -static void __devinit hpcd_quirk_uli5229(struct pci_dev *dev) +static void hpcd_quirk_uli5229(struct pci_dev *dev)  {  	unsigned char c; @@ -317,7 +317,7 @@ static void __devinit hpcd_quirk_uli5229(struct pci_dev *dev)   * bug by re-assigning a correct irq to 5288.   *   */ -static void __devinit hpcd_final_uli5288(struct pci_dev *dev) +static void hpcd_final_uli5288(struct pci_dev *dev)  {  	struct pci_controller *hose = pci_bus_to_host(dev->bus);  	struct device_node *hosenode = hose ? hose->dn : NULL; diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c index 465ee8f5c08..f7136aae8bb 100644 --- a/arch/powerpc/platforms/maple/pci.c +++ b/arch/powerpc/platforms/maple/pci.c @@ -543,7 +543,7 @@ static int __init maple_add_bridge(struct device_node *dev)  } -void __devinit maple_pci_irq_fixup(struct pci_dev *dev) +void maple_pci_irq_fixup(struct pci_dev *dev)  {  	DBG(" -> maple_pci_irq_fixup\n"); @@ -648,7 +648,7 @@ int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel)  	return irq;  } -static void __devinit quirk_ipr_msi(struct pci_dev *dev) +static void quirk_ipr_msi(struct pci_dev *dev)  {  	/* Something prevents MSIs from the IPR from working on Bimini,  	 * and the driver has no smarts to recover. So disable MSI diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c index 9886296e08d..0237ab782fb 100644 --- a/arch/powerpc/platforms/pasemi/gpio_mdio.c +++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c @@ -216,7 +216,7 @@ static int gpio_mdio_reset(struct mii_bus *bus)  } -static int __devinit gpio_mdio_probe(struct platform_device *ofdev) +static int gpio_mdio_probe(struct platform_device *ofdev)  {  	struct device *dev = &ofdev->dev;  	struct device_node *np = ofdev->dev.of_node; diff --git a/arch/powerpc/platforms/pasemi/pasemi.h b/arch/powerpc/platforms/pasemi/pasemi.h index b1e524f7489..ea65bf0eb89 100644 --- a/arch/powerpc/platforms/pasemi/pasemi.h +++ b/arch/powerpc/platforms/pasemi/pasemi.h @@ -3,8 +3,8 @@  extern unsigned long pas_get_boot_time(void);  extern void pas_pci_init(void); -extern void __devinit pas_pci_irq_fixup(struct pci_dev *dev); -extern void __devinit pas_pci_dma_dev_setup(struct pci_dev *dev); +extern void pas_pci_irq_fixup(struct pci_dev *dev); +extern void pas_pci_dma_dev_setup(struct pci_dev *dev);  extern void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset); diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index 2ed9212d7d5..8c54de6d8ec 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c @@ -76,7 +76,7 @@ static void pas_restart(char *cmd)  static arch_spinlock_t timebase_lock;  static unsigned long timebase; -static void __devinit pas_give_timebase(void) +static void pas_give_timebase(void)  {  	unsigned long flags; @@ -94,7 +94,7 @@ static void __devinit pas_give_timebase(void)  	local_irq_restore(flags);  } -static void __devinit pas_take_timebase(void) +static void pas_take_timebase(void)  {  	while (!timebase)  		smp_rmb(); diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c index 64171198535..311b804353b 100644 --- a/arch/powerpc/platforms/powermac/cpufreq_32.c +++ b/arch/powerpc/platforms/powermac/cpufreq_32.c @@ -55,6 +55,7 @@ static unsigned int low_freq;  static unsigned int hi_freq;  static unsigned int cur_freq;  static unsigned int sleep_freq; +static unsigned long transition_latency;  /*   * Different models uses different mechanisms to switch the frequency @@ -403,7 +404,7 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)  	if (policy->cpu != 0)  		return -ENODEV; -	policy->cpuinfo.transition_latency	= CPUFREQ_ETERNAL; +	policy->cpuinfo.transition_latency	= transition_latency;  	policy->cur = cur_freq;  	cpufreq_frequency_table_get_attr(pmac_cpu_freqs, policy->cpu); @@ -658,12 +659,14 @@ static int __init pmac_cpufreq_setup(void)  	if (!value)  		goto out;  	cur_freq = (*value) / 1000; +	transition_latency = CPUFREQ_ETERNAL;  	/*  Check for 7447A based MacRISC3 */  	if (of_machine_is_compatible("MacRISC3") &&  	    of_get_property(cpunode, "dynamic-power-step", NULL) &&  	    PVR_VER(mfspr(SPRN_PVR)) == 0x8003) {  		pmac_cpufreq_init_7447A(cpunode); +		transition_latency = 8000000;  	/* Check for other MacRISC3 machines */  	} else if (of_machine_is_compatible("PowerBook3,4") ||  		   of_machine_is_compatible("PowerBook3,5") || diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index 43bbe1bda93..2b8af75abc2 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c @@ -561,7 +561,7 @@ static struct pci_ops u4_pcie_pci_ops =  	.write = u4_pcie_write_config,  }; -static void __devinit pmac_pci_fixup_u4_of_node(struct pci_dev *dev) +static void pmac_pci_fixup_u4_of_node(struct pci_dev *dev)  {  	/* Apple's device-tree "hides" the root complex virtual P2P bridge  	 * on U4. However, Linux sees it, causing the PCI <-> OF matching @@ -988,7 +988,7 @@ static int __init pmac_add_bridge(struct device_node *dev)  	return 0;  } -void __devinit pmac_pci_irq_fixup(struct pci_dev *dev) +void pmac_pci_irq_fixup(struct pci_dev *dev)  {  #ifdef CONFIG_PPC32  	/* Fixup interrupt for the modem/ethernet combo controller. @@ -1138,7 +1138,7 @@ int pmac_pci_enable_device_hook(struct pci_dev *dev)  	return 0;  } -void __devinit pmac_pci_fixup_ohci(struct pci_dev *dev) +void pmac_pci_fixup_ohci(struct pci_dev *dev)  {  	struct device_node *node = pci_device_to_OF_node(dev); diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index b4ddaa3fbb2..bdb738a69e4 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c @@ -484,7 +484,7 @@ static void smp_core99_give_timebase(void)  } -static void __devinit smp_core99_take_timebase(void) +static void smp_core99_take_timebase(void)  {  	unsigned long flags; @@ -669,7 +669,7 @@ static void smp_core99_gpio_tb_freeze(int freeze)  volatile static long int core99_l2_cache;  volatile static long int core99_l3_cache; -static void __devinit core99_init_caches(int cpu) +static void core99_init_caches(int cpu)  {  #ifndef CONFIG_PPC64  	if (!cpu_has_feature(CPU_FTR_L2CR)) @@ -801,7 +801,7 @@ static int __init smp_core99_probe(void)  	return ncpus;  } -static int __devinit smp_core99_kick_cpu(int nr) +static int smp_core99_kick_cpu(int nr)  {  	unsigned int save_vector;  	unsigned long target, flags; @@ -844,7 +844,7 @@ static int __devinit smp_core99_kick_cpu(int nr)  	return 0;  } -static void __devinit smp_core99_setup_cpu(int cpu_nr) +static void smp_core99_setup_cpu(int cpu_nr)  {  	/* Setup L2/L3 */  	if (cpu_nr != 0) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 471aa3ccd9f..8e90e8906df 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -34,24 +34,12 @@  #include "powernv.h"  #include "pci.h" -static int __pe_printk(const char *level, const struct pnv_ioda_pe *pe, -		       struct va_format *vaf) -{ -	char pfix[32]; - -	if (pe->pdev) -		strlcpy(pfix, dev_name(&pe->pdev->dev), sizeof(pfix)); -	else -		sprintf(pfix, "%04x:%02x     ", -			pci_domain_nr(pe->pbus), pe->pbus->number); -	return printk("pci %s%s: [PE# %.3d] %pV", level, pfix, pe->pe_number, vaf); -} -  #define define_pe_printk_level(func, kern_level)		\  static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...)	\  {								\  	struct va_format vaf;					\  	va_list args;						\ +	char pfix[32];						\  	int r;							\  								\  	va_start(args, fmt);					\ @@ -59,7 +47,16 @@ static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...)	\  	vaf.fmt = fmt;						\  	vaf.va = &args;						\  								\ -	r = __pe_printk(kern_level, pe, &vaf);			\ +	if (pe->pdev)						\ +		strlcpy(pfix, dev_name(&pe->pdev->dev),		\ +			sizeof(pfix));				\ +	else							\ +		sprintf(pfix, "%04x:%02x     ",			\ +			pci_domain_nr(pe->pbus),		\ +			pe->pbus->number);			\ +	r = printk(kern_level "pci %s: [PE# %.3d] %pV",		\ +		   pfix, pe->pe_number, &vaf);			\ +								\  	va_end(args);						\  								\  	return r;						\ @@ -79,7 +76,7 @@ static struct pci_dn *pnv_ioda_get_pdn(struct pci_dev *dev)  	return PCI_DN(np);  } -static int __devinit pnv_ioda_alloc_pe(struct pnv_phb *phb) +static int pnv_ioda_alloc_pe(struct pnv_phb *phb)  {  	unsigned long pe; @@ -94,7 +91,7 @@ static int __devinit pnv_ioda_alloc_pe(struct pnv_phb *phb)  	return pe;  } -static void __devinit pnv_ioda_free_pe(struct pnv_phb *phb, int pe) +static void pnv_ioda_free_pe(struct pnv_phb *phb, int pe)  {  	WARN_ON(phb->ioda.pe_array[pe].pdev); @@ -106,7 +103,7 @@ static void __devinit pnv_ioda_free_pe(struct pnv_phb *phb, int pe)   * but in the meantime, we need to protect them to avoid warnings   */  #ifdef CONFIG_PCI_MSI -static struct pnv_ioda_pe * __devinit pnv_ioda_get_pe(struct pci_dev *dev) +static struct pnv_ioda_pe *pnv_ioda_get_pe(struct pci_dev *dev)  {  	struct pci_controller *hose = pci_bus_to_host(dev->bus);  	struct pnv_phb *phb = hose->private_data; @@ -120,8 +117,7 @@ static struct pnv_ioda_pe * __devinit pnv_ioda_get_pe(struct pci_dev *dev)  }  #endif /* CONFIG_PCI_MSI */ -static int __devinit pnv_ioda_configure_pe(struct pnv_phb *phb, -					   struct pnv_ioda_pe *pe) +static int pnv_ioda_configure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)  {  	struct pci_dev *parent;  	uint8_t bcomp, dcomp, fcomp; @@ -210,8 +206,8 @@ static int __devinit pnv_ioda_configure_pe(struct pnv_phb *phb,  	return 0;  } -static void __devinit pnv_ioda_link_pe_by_weight(struct pnv_phb *phb, -						 struct pnv_ioda_pe *pe) +static void pnv_ioda_link_pe_by_weight(struct pnv_phb *phb, +				       struct pnv_ioda_pe *pe)  {  	struct pnv_ioda_pe *lpe; @@ -249,7 +245,7 @@ static unsigned int pnv_ioda_dma_weight(struct pci_dev *dev)  }  #if 0 -static struct pnv_ioda_pe * __devinit pnv_ioda_setup_dev_PE(struct pci_dev *dev) +static struct pnv_ioda_pe *pnv_ioda_setup_dev_PE(struct pci_dev *dev)  {  	struct pci_controller *hose = pci_bus_to_host(dev->bus);  	struct pnv_phb *phb = hose->private_data; @@ -346,7 +342,7 @@ static void pnv_ioda_setup_same_PE(struct pci_bus *bus, struct pnv_ioda_pe *pe)   * subordinate PCI devices and buses. The second type of PE is normally   * orgiriated by PCIe-to-PCI bridge or PLX switch downstream ports.   */ -static void __devinit pnv_ioda_setup_bus_PE(struct pci_bus *bus, int all) +static void pnv_ioda_setup_bus_PE(struct pci_bus *bus, int all)  {  	struct pci_controller *hose = pci_bus_to_host(bus);  	struct pnv_phb *phb = hose->private_data; @@ -402,7 +398,7 @@ static void __devinit pnv_ioda_setup_bus_PE(struct pci_bus *bus, int all)  	pnv_ioda_link_pe_by_weight(phb, pe);  } -static void __devinit pnv_ioda_setup_PEs(struct pci_bus *bus) +static void pnv_ioda_setup_PEs(struct pci_bus *bus)  {  	struct pci_dev *dev; @@ -426,7 +422,7 @@ static void __devinit pnv_ioda_setup_PEs(struct pci_bus *bus)   * port to PE# here. The game rule here is expected to be changed   * as soon as we can detected PLX bridge correctly.   */ -static void __devinit pnv_pci_ioda_setup_PEs(void) +static void pnv_pci_ioda_setup_PEs(void)  {  	struct pci_controller *hose, *tmp; @@ -435,14 +431,12 @@ static void __devinit pnv_pci_ioda_setup_PEs(void)  	}  } -static void __devinit pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb, -						 struct pci_dev *dev) +static void pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb, struct pci_dev *dev)  {  	/* We delay DMA setup after we have assigned all PE# */  } -static void __devinit pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, -					     struct pci_bus *bus) +static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, struct pci_bus *bus)  {  	struct pci_dev *dev; @@ -453,10 +447,9 @@ static void __devinit pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe,  	}  } -static void __devinit pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb, -						struct pnv_ioda_pe *pe, -						unsigned int base, -						unsigned int segs) +static void pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb, +				      struct pnv_ioda_pe *pe, unsigned int base, +				      unsigned int segs)  {  	struct page *tce_mem = NULL; @@ -544,7 +537,7 @@ static void __devinit pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb,  		__free_pages(tce_mem, get_order(TCE32_TABLE_SIZE * segs));  } -static void __devinit pnv_ioda_setup_dma(struct pnv_phb *phb) +static void pnv_ioda_setup_dma(struct pnv_phb *phb)  {  	struct pci_controller *hose = phb->hose;  	unsigned int residual, remaining, segs, tw, base; @@ -687,8 +680,8 @@ static void pnv_pci_init_ioda_msis(struct pnv_phb *phb) { }   * to bottom style. So the the I/O or MMIO segment assigned to   * parent PE could be overrided by its child PEs if necessary.   */ -static void __devinit pnv_ioda_setup_pe_seg(struct pci_controller *hose, -				struct pnv_ioda_pe *pe) +static void pnv_ioda_setup_pe_seg(struct pci_controller *hose, +				  struct pnv_ioda_pe *pe)  {  	struct pnv_phb *phb = hose->private_data;  	struct pci_bus_region region; @@ -756,7 +749,7 @@ static void __devinit pnv_ioda_setup_pe_seg(struct pci_controller *hose,  	}  } -static void __devinit pnv_pci_ioda_setup_seg(void) +static void pnv_pci_ioda_setup_seg(void)  {  	struct pci_controller *tmp, *hose;  	struct pnv_phb *phb; @@ -770,7 +763,7 @@ static void __devinit pnv_pci_ioda_setup_seg(void)  	}  } -static void __devinit pnv_pci_ioda_setup_DMA(void) +static void pnv_pci_ioda_setup_DMA(void)  {  	struct pci_controller *hose, *tmp;  	struct pnv_phb *phb; @@ -784,7 +777,7 @@ static void __devinit pnv_pci_ioda_setup_DMA(void)  	}  } -static void __devinit pnv_pci_ioda_fixup(void) +static void pnv_pci_ioda_fixup(void)  {  	pnv_pci_ioda_setup_PEs();  	pnv_pci_ioda_setup_seg(); @@ -832,7 +825,7 @@ static resource_size_t pnv_pci_window_alignment(struct pci_bus *bus,  /* Prevent enabling devices for which we couldn't properly   * assign a PE   */ -static int __devinit pnv_pci_enable_device_hook(struct pci_dev *dev) +static int pnv_pci_enable_device_hook(struct pci_dev *dev)  {  	struct pci_controller *hose = pci_bus_to_host(dev->bus);  	struct pnv_phb *phb = hose->private_data; diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c b/arch/powerpc/platforms/powernv/pci-p5ioc2.c index 6b4bef4e9d8..7db8771a40f 100644 --- a/arch/powerpc/platforms/powernv/pci-p5ioc2.c +++ b/arch/powerpc/platforms/powernv/pci-p5ioc2.c @@ -84,8 +84,8 @@ static void pnv_pci_init_p5ioc2_msis(struct pnv_phb *phb)  static void pnv_pci_init_p5ioc2_msis(struct pnv_phb *phb) { }  #endif /* CONFIG_PCI_MSI */ -static void __devinit pnv_pci_p5ioc2_dma_dev_setup(struct pnv_phb *phb, -						   struct pci_dev *pdev) +static void pnv_pci_p5ioc2_dma_dev_setup(struct pnv_phb *phb, +					 struct pci_dev *pdev)  {  	if (phb->p5ioc2.iommu_table.it_map == NULL)  		iommu_init_table(&phb->p5ioc2.iommu_table, phb->hose->node); diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index c01688a1a74..b8b8e0bd989 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c @@ -464,8 +464,7 @@ void pnv_pci_setup_iommu_table(struct iommu_table *tbl,  	tbl->it_type = TCE_PCI;  } -static struct iommu_table * __devinit -pnv_pci_setup_bml_iommu(struct pci_controller *hose) +static struct iommu_table *pnv_pci_setup_bml_iommu(struct pci_controller *hose)  {  	struct iommu_table *tbl;  	const __be64 *basep, *swinvp; @@ -496,8 +495,8 @@ pnv_pci_setup_bml_iommu(struct pci_controller *hose)  	return tbl;  } -static void __devinit pnv_pci_dma_fallback_setup(struct pci_controller *hose, -						 struct pci_dev *pdev) +static void pnv_pci_dma_fallback_setup(struct pci_controller *hose, +				       struct pci_dev *pdev)  {  	struct device_node *np = pci_bus_to_OF_node(hose->bus);  	struct pci_dn *pdn; @@ -512,7 +511,7 @@ static void __devinit pnv_pci_dma_fallback_setup(struct pci_controller *hose,  	set_iommu_table_base(&pdev->dev, pdn->iommu_table);  } -static void __devinit pnv_pci_dma_dev_setup(struct pci_dev *pdev) +static void pnv_pci_dma_dev_setup(struct pci_dev *pdev)  {  	struct pci_controller *hose = pci_bus_to_host(pdev->bus);  	struct pnv_phb *phb = hose->private_data; @@ -527,7 +526,7 @@ static void __devinit pnv_pci_dma_dev_setup(struct pci_dev *pdev)  }  /* Fixup wrong class code in p7ioc root complex */ -static void __devinit pnv_p7ioc_rc_quirk(struct pci_dev *dev) +static void pnv_p7ioc_rc_quirk(struct pci_dev *dev)  {  	dev->class = PCI_CLASS_BRIDGE_PCI << 8;  } diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c index 7698b6e13c5..0bdc735db16 100644 --- a/arch/powerpc/platforms/powernv/smp.c +++ b/arch/powerpc/platforms/powernv/smp.c @@ -62,7 +62,7 @@ static int pnv_smp_cpu_bootable(unsigned int nr)  	return 1;  } -int __devinit pnv_smp_kick_cpu(int nr) +int pnv_smp_kick_cpu(int nr)  {  	unsigned int pcpu = get_hard_smp_processor_id(nr);  	unsigned long start_here = __pa(*((unsigned long *) diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c index 56d26bc4fd4..09787139834 100644 --- a/arch/powerpc/platforms/ps3/os-area.c +++ b/arch/powerpc/platforms/ps3/os-area.c @@ -280,13 +280,13 @@ static void os_area_set_property(struct device_node *node,  	if (tmp) {  		pr_debug("%s:%d found %s\n", __func__, __LINE__, prop->name); -		prom_remove_property(node, tmp); +		of_remove_property(node, tmp);  	} -	result = prom_add_property(node, prop); +	result = of_add_property(node, prop);  	if (result) -		pr_debug("%s:%d prom_set_property failed\n", __func__, +		pr_debug("%s:%d of_set_property failed\n", __func__,  			__LINE__);  } diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c index 9b47ba7a5de..bfccdc7cb85 100644 --- a/arch/powerpc/platforms/ps3/repository.c +++ b/arch/powerpc/platforms/ps3/repository.c @@ -437,7 +437,7 @@ found_dev:  	return 0;  } -int __devinit ps3_repository_find_devices(enum ps3_bus_type bus_type, +int ps3_repository_find_devices(enum ps3_bus_type bus_type,  	int (*callback)(const struct ps3_repository_device *repo))  {  	int result = 0; diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index 0f1b706506e..a1a7b9a67ff 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c @@ -13,17 +13,16 @@  #include <linux/kernel.h>  #include <linux/kref.h>  #include <linux/notifier.h> -#include <linux/proc_fs.h>  #include <linux/spinlock.h>  #include <linux/cpu.h>  #include <linux/slab.h> +#include <linux/of.h>  #include "offline_states.h"  #include <asm/prom.h>  #include <asm/machdep.h>  #include <asm/uaccess.h>  #include <asm/rtas.h> -#include <asm/pSeries_reconfig.h>  struct cc_workarea {  	u32	drc_index; @@ -255,9 +254,6 @@ static struct device_node *derive_parent(const char *path)  int dlpar_attach_node(struct device_node *dn)  { -#ifdef CONFIG_PROC_DEVICETREE -	struct proc_dir_entry *ent; -#endif  	int rc;  	of_node_set_flag(dn, OF_DYNAMIC); @@ -266,44 +262,26 @@ int dlpar_attach_node(struct device_node *dn)  	if (!dn->parent)  		return -ENOMEM; -	rc = pSeries_reconfig_notify(PSERIES_RECONFIG_ADD, dn); +	rc = of_attach_node(dn);  	if (rc) {  		printk(KERN_ERR "Failed to add device node %s\n",  		       dn->full_name);  		return rc;  	} -	of_attach_node(dn); - -#ifdef CONFIG_PROC_DEVICETREE -	ent = proc_mkdir(strrchr(dn->full_name, '/') + 1, dn->parent->pde); -	if (ent) -		proc_device_tree_add_node(dn, ent); -#endif -  	of_node_put(dn->parent);  	return 0;  }  int dlpar_detach_node(struct device_node *dn)  { -#ifdef CONFIG_PROC_DEVICETREE -	struct device_node *parent = dn->parent; -	struct property *prop = dn->properties; - -	while (prop) { -		remove_proc_entry(prop->name, dn->pde); -		prop = prop->next; -	} +	int rc; -	if (dn->pde) -		remove_proc_entry(dn->pde->name, parent->pde); -#endif +	rc = of_detach_node(dn); +	if (rc) +		return rc; -	pSeries_reconfig_notify(PSERIES_RECONFIG_REMOVE, dn); -	of_detach_node(dn);  	of_node_put(dn); /* Must decrement the refcount */ -  	return 0;  } diff --git a/arch/powerpc/platforms/pseries/eeh_dev.c b/arch/powerpc/platforms/pseries/eeh_dev.c index 66442341d3a..1efa28f5fc5 100644 --- a/arch/powerpc/platforms/pseries/eeh_dev.c +++ b/arch/powerpc/platforms/pseries/eeh_dev.c @@ -49,7 +49,7 @@   * It will create EEH device according to the given OF node. The function   * might be called by PCI emunation, DR, PHB hotplug.   */ -void * __devinit eeh_dev_init(struct device_node *dn, void *data) +void *eeh_dev_init(struct device_node *dn, void *data)  {  	struct pci_controller *phb = data;  	struct eeh_dev *edev; @@ -77,7 +77,7 @@ void * __devinit eeh_dev_init(struct device_node *dn, void *data)   * Scan the PHB OF node and its child association, then create the   * EEH devices accordingly   */ -void __devinit eeh_dev_phb_init_dynamic(struct pci_controller *phb) +void eeh_dev_phb_init_dynamic(struct pci_controller *phb)  {  	struct device_node *dn = phb->dn; diff --git a/arch/powerpc/platforms/pseries/eeh_pe.c b/arch/powerpc/platforms/pseries/eeh_pe.c index d16c8ded108..fe43d1aa2cf 100644 --- a/arch/powerpc/platforms/pseries/eeh_pe.c +++ b/arch/powerpc/platforms/pseries/eeh_pe.c @@ -66,7 +66,7 @@ static struct eeh_pe *eeh_pe_alloc(struct pci_controller *phb, int type)   * The function should be called while the PHB is detected during   * system boot or PCI hotplug in order to create PHB PE.   */ -int __devinit eeh_phb_pe_create(struct pci_controller *phb) +int eeh_phb_pe_create(struct pci_controller *phb)  {  	struct eeh_pe *pe; diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c index 0b0eff0cce3..7b56118f531 100644 --- a/arch/powerpc/platforms/pseries/firmware.c +++ b/arch/powerpc/platforms/pseries/firmware.c @@ -56,6 +56,7 @@ firmware_features_table[FIRMWARE_MAX_FEATURES] = {  	{FW_FEATURE_MULTITCE,		"hcall-multi-tce"},  	{FW_FEATURE_SPLPAR,		"hcall-splpar"},  	{FW_FEATURE_VPHN,		"hcall-vphn"}, +	{FW_FEATURE_SET_MODE,		"hcall-set-mode"},  };  /* Build up the firmware features bitmask using the contents of diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index 64c97d8ac0c..a38956269fb 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c @@ -23,12 +23,12 @@  #include <linux/delay.h>  #include <linux/sched.h>	/* for idle_task_exit */  #include <linux/cpu.h> +#include <linux/of.h>  #include <asm/prom.h>  #include <asm/rtas.h>  #include <asm/firmware.h>  #include <asm/machdep.h>  #include <asm/vdso_datapage.h> -#include <asm/pSeries_reconfig.h>  #include <asm/xics.h>  #include "plpar_wrappers.h"  #include "offline_states.h" @@ -333,10 +333,10 @@ static int pseries_smp_notifier(struct notifier_block *nb,  	int err = 0;  	switch (action) { -	case PSERIES_RECONFIG_ADD: +	case OF_RECONFIG_ATTACH_NODE:  		err = pseries_add_processor(node);  		break; -	case PSERIES_RECONFIG_REMOVE: +	case OF_RECONFIG_DETACH_NODE:  		pseries_remove_processor(node);  		break;  	} @@ -399,7 +399,7 @@ static int __init pseries_cpu_hotplug_init(void)  	/* Processors can be added/removed only on LPAR */  	if (firmware_has_feature(FW_FEATURE_LPAR)) { -		pSeries_reconfig_notifier_register(&pseries_smp_nb); +		of_reconfig_notifier_register(&pseries_smp_nb);  		cpu_maps_update_begin();  		if (cede_offline_enabled && parse_cede_parameters() == 0) {  			default_offline_state = CPU_STATE_INACTIVE; diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index ecdb0a6b317..2372c609fa2 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c @@ -16,7 +16,6 @@  #include <asm/firmware.h>  #include <asm/machdep.h> -#include <asm/pSeries_reconfig.h>  #include <asm/sparsemem.h>  static unsigned long get_memblock_size(void) @@ -187,42 +186,69 @@ static int pseries_add_memory(struct device_node *np)  	return (ret < 0) ? -EINVAL : 0;  } -static int pseries_drconf_memory(unsigned long *base, unsigned int action) +static int pseries_update_drconf_memory(struct of_prop_reconfig *pr)  { +	struct of_drconf_cell *new_drmem, *old_drmem;  	unsigned long memblock_size; -	int rc; +	u32 entries; +	u32 *p; +	int i, rc = -EINVAL;  	memblock_size = get_memblock_size();  	if (!memblock_size)  		return -EINVAL; -	if (action == PSERIES_DRCONF_MEM_ADD) { -		rc = memblock_add(*base, memblock_size); -		rc = (rc < 0) ? -EINVAL : 0; -	} else if (action == PSERIES_DRCONF_MEM_REMOVE) { -		rc = pseries_remove_memblock(*base, memblock_size); -	} else { -		rc = -EINVAL; +	p = (u32 *)of_get_property(pr->dn, "ibm,dynamic-memory", NULL); +	if (!p) +		return -EINVAL; + +	/* The first int of the property is the number of lmb's described +	 * by the property. This is followed by an array of of_drconf_cell +	 * entries. Get the niumber of entries and skip to the array of +	 * of_drconf_cell's. +	 */ +	entries = *p++; +	old_drmem = (struct of_drconf_cell *)p; + +	p = (u32 *)pr->prop->value; +	p++; +	new_drmem = (struct of_drconf_cell *)p; + +	for (i = 0; i < entries; i++) { +		if ((old_drmem[i].flags & DRCONF_MEM_ASSIGNED) && +		    (!(new_drmem[i].flags & DRCONF_MEM_ASSIGNED))) { +			rc = pseries_remove_memblock(old_drmem[i].base_addr, +						     memblock_size); +			break; +		} else if ((!(old_drmem[i].flags & DRCONF_MEM_ASSIGNED)) && +			   (new_drmem[i].flags & DRCONF_MEM_ASSIGNED)) { +			rc = memblock_add(old_drmem[i].base_addr, +					  memblock_size); +			rc = (rc < 0) ? -EINVAL : 0; +			break; +		}  	}  	return rc;  }  static int pseries_memory_notifier(struct notifier_block *nb, -				unsigned long action, void *node) +				   unsigned long action, void *node)  { +	struct of_prop_reconfig *pr;  	int err = 0;  	switch (action) { -	case PSERIES_RECONFIG_ADD: +	case OF_RECONFIG_ATTACH_NODE:  		err = pseries_add_memory(node);  		break; -	case PSERIES_RECONFIG_REMOVE: +	case OF_RECONFIG_DETACH_NODE:  		err = pseries_remove_memory(node);  		break; -	case PSERIES_DRCONF_MEM_ADD: -	case PSERIES_DRCONF_MEM_REMOVE: -		err = pseries_drconf_memory(node, action); +	case OF_RECONFIG_UPDATE_PROPERTY: +		pr = (struct of_prop_reconfig *)node; +		if (!strcmp(pr->prop->name, "ibm,dynamic-memory")) +			err = pseries_update_drconf_memory(pr);  		break;  	}  	return notifier_from_errno(err); @@ -235,7 +261,7 @@ static struct notifier_block pseries_mem_nb = {  static int __init pseries_memory_hotplug_init(void)  {  	if (firmware_has_feature(FW_FEATURE_LPAR)) -		pSeries_reconfig_notifier_register(&pseries_mem_nb); +		of_reconfig_notifier_register(&pseries_mem_nb);  	return 0;  } diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 6153eea27ce..e2685badb5d 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c @@ -36,13 +36,13 @@  #include <linux/dma-mapping.h>  #include <linux/crash_dump.h>  #include <linux/memory.h> +#include <linux/of.h>  #include <asm/io.h>  #include <asm/prom.h>  #include <asm/rtas.h>  #include <asm/iommu.h>  #include <asm/pci-bridge.h>  #include <asm/machdep.h> -#include <asm/pSeries_reconfig.h>  #include <asm/firmware.h>  #include <asm/tce.h>  #include <asm/ppc-pci.h> @@ -760,7 +760,7 @@ static void remove_ddw(struct device_node *np)  	__remove_ddw(np, ddw_avail, liobn);  delprop: -	ret = prom_remove_property(np, win64); +	ret = of_remove_property(np, win64);  	if (ret)  		pr_warning("%s: failed to remove direct window property: %d\n",  			np->full_name, ret); @@ -1070,7 +1070,7 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)  		goto out_free_window;  	} -	ret = prom_add_property(pdn, win64); +	ret = of_add_property(pdn, win64);  	if (ret) {  		dev_err(&dev->dev, "unable to add dma window property for %s: %d",  			 pdn->full_name, ret); @@ -1294,7 +1294,7 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti  	struct direct_window *window;  	switch (action) { -	case PSERIES_RECONFIG_REMOVE: +	case OF_RECONFIG_DETACH_NODE:  		if (pci && pci->iommu_table)  			iommu_free_table(pci->iommu_table, np->full_name); @@ -1357,7 +1357,7 @@ void iommu_init_early_pSeries(void)  	} -	pSeries_reconfig_notifier_register(&iommu_reconfig_nb); +	of_reconfig_notifier_register(&iommu_reconfig_nb);  	register_memory_notifier(&iommu_mem_nb);  	set_pci_dma_ops(&dma_iommu_ops); diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c index dd30b12edfe..6573808cc5f 100644 --- a/arch/powerpc/platforms/pseries/mobility.c +++ b/arch/powerpc/platforms/pseries/mobility.c @@ -116,7 +116,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop,  	}  	if (!more) { -		prom_update_property(dn, new_prop); +		of_update_property(dn, new_prop);  		new_prop = NULL;  	} @@ -172,7 +172,7 @@ static int update_dt_node(u32 phandle)  			case 0x80000000:  				prop = of_find_property(dn, prop_name, NULL); -				prom_remove_property(dn, prop); +				of_remove_property(dn, prop);  				prop = NULL;  				break; diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c index 261a577a3dd..c91b22be928 100644 --- a/arch/powerpc/platforms/pseries/pci_dlpar.c +++ b/arch/powerpc/platforms/pseries/pci_dlpar.c @@ -149,7 +149,7 @@ void pcibios_add_pci_devices(struct pci_bus * bus)  }  EXPORT_SYMBOL_GPL(pcibios_add_pci_devices); -struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn) +struct pci_controller *init_phb_dynamic(struct device_node *dn)  {  	struct pci_controller *phb; diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h index 13e8cc43adf..e6cc34a6705 100644 --- a/arch/powerpc/platforms/pseries/plpar_wrappers.h +++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h @@ -273,4 +273,35 @@ static inline long plpar_put_term_char(unsigned long termno, unsigned long len,  			lbuf[1]);  } +/* Set various resource mode parameters */ +static inline long plpar_set_mode(unsigned long mflags, unsigned long resource, +		unsigned long value1, unsigned long value2) +{ +	return plpar_hcall_norets(H_SET_MODE, mflags, resource, value1, value2); +} + +/* + * Enable relocation on exceptions on this partition + * + * Note: this call has a partition wide scope and can take a while to complete. + * If it returns H_LONG_BUSY_* it should be retried periodically until it + * returns H_SUCCESS. + */ +static inline long enable_reloc_on_exceptions(void) +{ +	/* mflags = 3: Exceptions at 0xC000000000004000 */ +	return plpar_set_mode(3, 3, 0, 0); +} + +/* + * Disable relocation on exceptions on this partition + * + * Note: this call has a partition wide scope and can take a while to complete. + * If it returns H_LONG_BUSY_* it should be retried periodically until it + * returns H_SUCCESS. + */ +static inline long disable_reloc_on_exceptions(void) { +	return plpar_set_mode(0, 3, 0, 0); +} +  #endif /* _PSERIES_PLPAR_WRAPPERS_H */ diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 2f4668136b2..d6491bd481d 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c @@ -16,55 +16,13 @@  #include <linux/notifier.h>  #include <linux/proc_fs.h>  #include <linux/slab.h> +#include <linux/of.h>  #include <asm/prom.h>  #include <asm/machdep.h>  #include <asm/uaccess.h> -#include <asm/pSeries_reconfig.h>  #include <asm/mmu.h> - - -/* - * Routines for "runtime" addition and removal of device tree nodes. - */ -#ifdef CONFIG_PROC_DEVICETREE -/* - * Add a node to /proc/device-tree. - */ -static void add_node_proc_entries(struct device_node *np) -{ -	struct proc_dir_entry *ent; - -	ent = proc_mkdir(strrchr(np->full_name, '/') + 1, np->parent->pde); -	if (ent) -		proc_device_tree_add_node(np, ent); -} - -static void remove_node_proc_entries(struct device_node *np) -{ -	struct property *pp = np->properties; -	struct device_node *parent = np->parent; - -	while (pp) { -		remove_proc_entry(pp->name, np->pde); -		pp = pp->next; -	} -	if (np->pde) -		remove_proc_entry(np->pde->name, parent->pde); -} -#else /* !CONFIG_PROC_DEVICETREE */ -static void add_node_proc_entries(struct device_node *np) -{ -	return; -} - -static void remove_node_proc_entries(struct device_node *np) -{ -	return; -} -#endif /* CONFIG_PROC_DEVICETREE */ -  /**   *	derive_parent - basically like dirname(1)   *	@path:  the full_name of a node to be added to the tree @@ -97,28 +55,6 @@ static struct device_node *derive_parent(const char *path)  	return parent;  } -static BLOCKING_NOTIFIER_HEAD(pSeries_reconfig_chain); - -int pSeries_reconfig_notifier_register(struct notifier_block *nb) -{ -	return blocking_notifier_chain_register(&pSeries_reconfig_chain, nb); -} -EXPORT_SYMBOL_GPL(pSeries_reconfig_notifier_register); - -void pSeries_reconfig_notifier_unregister(struct notifier_block *nb) -{ -	blocking_notifier_chain_unregister(&pSeries_reconfig_chain, nb); -} -EXPORT_SYMBOL_GPL(pSeries_reconfig_notifier_unregister); - -int pSeries_reconfig_notify(unsigned long action, void *p) -{ -	int err = blocking_notifier_call_chain(&pSeries_reconfig_chain, -						action, p); - -	return notifier_to_errno(err); -} -  static int pSeries_reconfig_add_node(const char *path, struct property *proplist)  {  	struct device_node *np; @@ -142,16 +78,12 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist  		goto out_err;  	} -	err = pSeries_reconfig_notify(PSERIES_RECONFIG_ADD, np); +	err = of_attach_node(np);  	if (err) {  		printk(KERN_ERR "Failed to add device node %s\n", path);  		goto out_err;  	} -	of_attach_node(np); - -	add_node_proc_entries(np); -  	of_node_put(np->parent);  	return 0; @@ -179,11 +111,7 @@ static int pSeries_reconfig_remove_node(struct device_node *np)  		return -EBUSY;  	} -	remove_node_proc_entries(np); - -	pSeries_reconfig_notify(PSERIES_RECONFIG_REMOVE, np);  	of_detach_node(np); -  	of_node_put(parent);  	of_node_put(np); /* Must decrement the refcount */  	return 0; @@ -397,7 +325,7 @@ static int do_add_property(char *buf, size_t bufsize)  	if (!prop)  		return -ENOMEM; -	prom_add_property(np, prop); +	of_add_property(np, prop);  	return 0;  } @@ -421,16 +349,15 @@ static int do_remove_property(char *buf, size_t bufsize)  	prop = of_find_property(np, buf, NULL); -	return prom_remove_property(np, prop); +	return of_remove_property(np, prop);  }  static int do_update_property(char *buf, size_t bufsize)  {  	struct device_node *np; -	struct pSeries_reconfig_prop_update upd_value;  	unsigned char *value;  	char *name, *end, *next_prop; -	int rc, length; +	int length;  	struct property *newprop;  	buf = parse_node(buf, bufsize, &np);  	end = buf + bufsize; @@ -452,41 +379,7 @@ static int do_update_property(char *buf, size_t bufsize)  	if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size"))  		slb_set_size(*(int *)value); -	upd_value.node = np; -	upd_value.property = newprop; -	pSeries_reconfig_notify(PSERIES_UPDATE_PROPERTY, &upd_value); - -	rc = prom_update_property(np, newprop); -	if (rc) -		return rc; - -	/* For memory under the ibm,dynamic-reconfiguration-memory node -	 * of the device tree, adding and removing memory is just an update -	 * to the ibm,dynamic-memory property instead of adding/removing a -	 * memory node in the device tree.  For these cases we still need to -	 * involve the notifier chain. -	 */ -	if (!strcmp(name, "ibm,dynamic-memory")) { -		int action; - -		next_prop = parse_next_property(next_prop, end, &name, -						&length, &value); -		if (!next_prop) -			return -EINVAL; - -		if (!strcmp(name, "add")) -			action = PSERIES_DRCONF_MEM_ADD; -		else -			action = PSERIES_DRCONF_MEM_REMOVE; - -		rc = pSeries_reconfig_notify(action, value); -		if (rc) { -			prom_update_property(np, newprop); -			return rc; -		} -	} - -	return 0; +	return of_update_property(np, newprop);  }  /** diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index e3cb7ae6165..ca55882465d 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@ -40,6 +40,8 @@  #include <linux/seq_file.h>  #include <linux/root_dev.h>  #include <linux/cpuidle.h> +#include <linux/of.h> +#include <linux/kexec.h>  #include <asm/mmu.h>  #include <asm/processor.h> @@ -63,7 +65,6 @@  #include <asm/smp.h>  #include <asm/firmware.h>  #include <asm/eeh.h> -#include <asm/pSeries_reconfig.h>  #include "plpar_wrappers.h"  #include "pseries.h" @@ -258,7 +259,7 @@ static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long act  	int err = NOTIFY_OK;  	switch (action) { -	case PSERIES_RECONFIG_ADD: +	case OF_RECONFIG_ATTACH_NODE:  		pci = np->parent->data;  		if (pci) {  			update_dn_pci_info(np, pci->phb); @@ -367,6 +368,65 @@ static void pSeries_idle(void)  	}  } +/* + * Enable relocation on during exceptions. This has partition wide scope and + * may take a while to complete, if it takes longer than one second we will + * just give up rather than wasting any more time on this - if that turns out + * to ever be a problem in practice we can move this into a kernel thread to + * finish off the process later in boot. + */ +static int __init pSeries_enable_reloc_on_exc(void) +{ +	long rc; +	unsigned int delay, total_delay = 0; + +	while (1) { +		rc = enable_reloc_on_exceptions(); +		if (!H_IS_LONG_BUSY(rc)) +			return rc; + +		delay = get_longbusy_msecs(rc); +		total_delay += delay; +		if (total_delay > 1000) { +			pr_warn("Warning: Giving up waiting to enable " +				"relocation on exceptions (%u msec)!\n", +				total_delay); +			return rc; +		} + +		mdelay(delay); +	} +} + +#ifdef CONFIG_KEXEC +static long pSeries_disable_reloc_on_exc(void) +{ +	long rc; + +	while (1) { +		rc = disable_reloc_on_exceptions(); +		if (!H_IS_LONG_BUSY(rc)) +			return rc; +		mdelay(get_longbusy_msecs(rc)); +	} +} + +static void pSeries_machine_kexec(struct kimage *image) +{ +	long rc; + +	if (firmware_has_feature(FW_FEATURE_SET_MODE) && +	    (image->type != KEXEC_TYPE_CRASH)) { +		rc = pSeries_disable_reloc_on_exc(); +		if (rc != H_SUCCESS) +			pr_warning("Warning: Failed to disable relocation on " +				   "exceptions: %ld\n", rc); +	} + +	default_machine_kexec(image); +} +#endif +  static void __init pSeries_setup_arch(void)  {  	panic_timeout = 10; @@ -389,7 +449,7 @@ static void __init pSeries_setup_arch(void)  	/* Find and initialize PCI host bridges */  	init_pci_config_tokens();  	find_and_init_phbs(); -	pSeries_reconfig_notifier_register(&pci_dn_reconfig_nb); +	of_reconfig_notifier_register(&pci_dn_reconfig_nb);  	pSeries_nvram_init(); @@ -402,6 +462,14 @@ static void __init pSeries_setup_arch(void)  		ppc_md.enable_pmcs = pseries_lpar_enable_pmcs;  	else  		ppc_md.enable_pmcs = power4_enable_pmcs; + +	if (firmware_has_feature(FW_FEATURE_SET_MODE)) { +		long rc; +		if ((rc = pSeries_enable_reloc_on_exc()) != H_SUCCESS) { +			pr_warn("Unable to enable relocation on exceptions: " +				"%ld\n", rc); +		} +	}  }  static int __init pSeries_init_panel(void) @@ -659,4 +727,7 @@ define_machine(pseries) {  	.progress		= rtas_progress,  	.system_reset_exception = pSeries_system_reset_exception,  	.machine_check_exception = pSeries_machine_check_exception, +#ifdef CONFIG_KEXEC +	.machine_kexec          = pSeries_machine_kexec, +#endif  }; diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index 71706bc34a0..80cd0be71e0 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c @@ -38,7 +38,6 @@  #include <asm/cputable.h>  #include <asm/firmware.h>  #include <asm/rtas.h> -#include <asm/pSeries_reconfig.h>  #include <asm/mpic.h>  #include <asm/vdso_datapage.h>  #include <asm/cputhreads.h> @@ -88,7 +87,7 @@ int smp_query_cpu_stopped(unsigned int pcpu)   *	0	- failure   *	1	- success   */ -static inline int __devinit smp_startup_cpu(unsigned int lcpu) +static inline int smp_startup_cpu(unsigned int lcpu)  {  	int status;  	unsigned long start_here = __pa((u32)*((unsigned long *) @@ -134,7 +133,7 @@ out:  	return 1;  } -static void __devinit smp_xics_setup_cpu(int cpu) +static void smp_xics_setup_cpu(int cpu)  {  	if (cpu != boot_cpuid)  		xics_setup_cpu(); @@ -149,7 +148,7 @@ static void __devinit smp_xics_setup_cpu(int cpu)  #endif  } -static int __devinit smp_pSeries_kick_cpu(int nr) +static int smp_pSeries_kick_cpu(int nr)  {  	BUG_ON(nr < 0 || nr >= NR_CPUS); diff --git a/arch/powerpc/platforms/wsp/scom_smp.c b/arch/powerpc/platforms/wsp/scom_smp.c index 141e7803209..b56b70aeb49 100644 --- a/arch/powerpc/platforms/wsp/scom_smp.c +++ b/arch/powerpc/platforms/wsp/scom_smp.c @@ -337,8 +337,7 @@ scom_fail:  	return rc;  } -int __devinit a2_scom_startup_cpu(unsigned int lcpu, int thr_idx, -				  struct device_node *np) +int a2_scom_startup_cpu(unsigned int lcpu, int thr_idx, struct device_node *np)  {  	u64 init_iar, init_msr, init_ccr2;  	unsigned long start_here; diff --git a/arch/powerpc/platforms/wsp/smp.c b/arch/powerpc/platforms/wsp/smp.c index 0ba103ae83a..332a18b8140 100644 --- a/arch/powerpc/platforms/wsp/smp.c +++ b/arch/powerpc/platforms/wsp/smp.c @@ -23,7 +23,7 @@  #include "ics.h"  #include "wsp.h" -static void __devinit smp_a2_setup_cpu(int cpu) +static void smp_a2_setup_cpu(int cpu)  {  	doorbell_setup_this_cpu(); @@ -31,7 +31,7 @@ static void __devinit smp_a2_setup_cpu(int cpu)  		xics_setup_cpu();  } -int __devinit smp_a2_kick_cpu(int nr) +int smp_a2_kick_cpu(int nr)  {  	const char *enable_method;  	struct device_node *np; diff --git a/arch/powerpc/platforms/wsp/wsp.h b/arch/powerpc/platforms/wsp/wsp.h index 10c1d1fff36..62ef21afb89 100644 --- a/arch/powerpc/platforms/wsp/wsp.h +++ b/arch/powerpc/platforms/wsp/wsp.h @@ -18,7 +18,7 @@ extern void a2_setup_smp(void);  extern int a2_scom_startup_cpu(unsigned int lcpu, int thr_idx,  			       struct device_node *np);  extern int smp_a2_cpu_bootable(unsigned int nr); -extern int __devinit smp_a2_kick_cpu(int nr); +extern int smp_a2_kick_cpu(int nr);  extern void opb_pic_init(void); diff --git a/arch/powerpc/platforms/wsp/wsp_pci.c b/arch/powerpc/platforms/wsp/wsp_pci.c index 1526551f9fe..8e22f561d17 100644 --- a/arch/powerpc/platforms/wsp/wsp_pci.c +++ b/arch/powerpc/platforms/wsp/wsp_pci.c @@ -402,7 +402,7 @@ static struct wsp_dma_table *wsp_pci_create_dma32_table(struct wsp_phb *phb,  	return ERR_PTR(-ENOMEM);  } -static void __devinit wsp_pci_dma_dev_setup(struct pci_dev *pdev) +static void wsp_pci_dma_dev_setup(struct pci_dev *pdev)  {  	struct dev_archdata *archdata = &pdev->dev.archdata;  	struct pci_controller *hose = pci_bus_to_host(pdev->bus); diff --git a/arch/powerpc/sysdev/bestcomm/bestcomm.c b/arch/powerpc/sysdev/bestcomm/bestcomm.c index b3fbb271be8..d9130630f7e 100644 --- a/arch/powerpc/sysdev/bestcomm/bestcomm.c +++ b/arch/powerpc/sysdev/bestcomm/bestcomm.c @@ -30,7 +30,7 @@  #define DRIVER_NAME "bestcomm-core"  /* MPC5200 device tree match tables */ -static struct of_device_id mpc52xx_sram_ids[] __devinitdata = { +static struct of_device_id mpc52xx_sram_ids[] = {  	{ .compatible = "fsl,mpc5200-sram", },  	{ .compatible = "mpc5200-sram", },  	{} @@ -273,8 +273,7 @@ static u32 fdt_ops[] = {  }; -static int __devinit -bcom_engine_init(void) +static int bcom_engine_init(void)  {  	int task;  	phys_addr_t tdt_pa, ctx_pa, var_pa, fdt_pa; @@ -365,7 +364,7 @@ bcom_engine_cleanup(void)  /* OF platform driver                                                       */  /* ======================================================================== */ -static int __devinit mpc52xx_bcom_probe(struct platform_device *op) +static int mpc52xx_bcom_probe(struct platform_device *op)  {  	struct device_node *ofn_sram;  	struct resource res_bcom; diff --git a/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c b/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c index d131c8a1cb1..8cf93f029e1 100644 --- a/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c +++ b/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c @@ -69,7 +69,7 @@ static int __init get_offset_from_cmdline(char *str)  __setup("cache-sram-size=", get_size_from_cmdline);  __setup("cache-sram-offset=", get_offset_from_cmdline); -static int __devinit mpc85xx_l2ctlr_of_probe(struct platform_device *dev) +static int mpc85xx_l2ctlr_of_probe(struct platform_device *dev)  {  	long rval;  	unsigned int rem; @@ -160,7 +160,7 @@ static int __devinit mpc85xx_l2ctlr_of_probe(struct platform_device *dev)  	return 0;  } -static int __devexit mpc85xx_l2ctlr_of_remove(struct platform_device *dev) +static int mpc85xx_l2ctlr_of_remove(struct platform_device *dev)  {  	BUG_ON(!l2ctlr); @@ -213,7 +213,7 @@ static struct platform_driver mpc85xx_l2ctlr_of_platform_driver = {  		.of_match_table	= mpc85xx_l2ctlr_of_match,  	},  	.probe		= mpc85xx_l2ctlr_of_probe, -	.remove		= __devexit_p(mpc85xx_l2ctlr_of_remove), +	.remove		= mpc85xx_l2ctlr_of_remove,  };  static __init int mpc85xx_l2ctlr_of_init(void) diff --git a/arch/powerpc/sysdev/fsl_gtm.c b/arch/powerpc/sysdev/fsl_gtm.c index 02cf1e7e77f..0eb871cc343 100644 --- a/arch/powerpc/sysdev/fsl_gtm.c +++ b/arch/powerpc/sysdev/fsl_gtm.c @@ -1,7 +1,7 @@  /*   * Freescale General-purpose Timers Module   * - * Copyright (c) Freescale Semicondutor, Inc. 2006. + * Copyright (c) Freescale Semiconductor, Inc. 2006.   *               Shlomi Gridish <gridish@freescale.com>   *               Jerry Huang <Chang-Ming.Huang@freescale.com>   * Copyright (c) MontaVista Software, Inc. 2008. diff --git a/arch/powerpc/sysdev/fsl_ifc.c b/arch/powerpc/sysdev/fsl_ifc.c index 097cc9d2585..2a36fd6a958 100644 --- a/arch/powerpc/sysdev/fsl_ifc.c +++ b/arch/powerpc/sysdev/fsl_ifc.c @@ -73,7 +73,7 @@ int fsl_ifc_find(phys_addr_t addr_base)  }  EXPORT_SYMBOL(fsl_ifc_find); -static int __devinit fsl_ifc_ctrl_init(struct fsl_ifc_ctrl *ctrl) +static int fsl_ifc_ctrl_init(struct fsl_ifc_ctrl *ctrl)  {  	struct fsl_ifc_regs __iomem *ifc = ctrl->regs; @@ -211,7 +211,7 @@ static irqreturn_t fsl_ifc_ctrl_irq(int irqno, void *data)   * resources for the NAND banks themselves are allocated   * in the chip probe function.  */ -static int __devinit fsl_ifc_ctrl_probe(struct platform_device *dev) +static int fsl_ifc_ctrl_probe(struct platform_device *dev)  {  	int ret = 0; diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c index 483126d7b3c..300be2d06a2 100644 --- a/arch/powerpc/sysdev/fsl_lbc.c +++ b/arch/powerpc/sysdev/fsl_lbc.c @@ -185,8 +185,8 @@ int fsl_upm_run_pattern(struct fsl_upm *upm, void __iomem *io_base, u32 mar)  }  EXPORT_SYMBOL(fsl_upm_run_pattern); -static int __devinit fsl_lbc_ctrl_init(struct fsl_lbc_ctrl *ctrl, -				       struct device_node *node) +static int fsl_lbc_ctrl_init(struct fsl_lbc_ctrl *ctrl, +			     struct device_node *node)  {  	struct fsl_lbc_regs __iomem *lbc = ctrl->regs; @@ -273,7 +273,7 @@ static irqreturn_t fsl_lbc_ctrl_irq(int irqno, void *data)   * in the chip probe function.  */ -static int __devinit fsl_lbc_ctrl_probe(struct platform_device *dev) +static int fsl_lbc_ctrl_probe(struct platform_device *dev)  {  	int ret; diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c index 63c5f04ea58..6e53d97abd3 100644 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c @@ -333,9 +333,8 @@ static int fsl_of_msi_remove(struct platform_device *ofdev)  	return 0;  } -static int __devinit fsl_msi_setup_hwirq(struct fsl_msi *msi, -					 struct platform_device *dev, -					 int offset, int irq_index) +static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct platform_device *dev, +			       int offset, int irq_index)  {  	struct fsl_msi_cascade_data *cascade_data = NULL;  	int virt_msir; @@ -363,7 +362,7 @@ static int __devinit fsl_msi_setup_hwirq(struct fsl_msi *msi,  }  static const struct of_device_id fsl_of_msi_ids[]; -static int __devinit fsl_of_msi_probe(struct platform_device *dev) +static int fsl_of_msi_probe(struct platform_device *dev)  {  	const struct of_device_id *match;  	struct fsl_msi *msi; diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 01b62a62c63..92a5915b182 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -36,7 +36,7 @@  static int fsl_pcie_bus_fixup, is_mpc83xx_pci; -static void __devinit quirk_fsl_pcie_header(struct pci_dev *dev) +static void quirk_fsl_pcie_header(struct pci_dev *dev)  {  	u8 hdr_type; @@ -89,7 +89,7 @@ static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask)  	return 0;  } -static int __init setup_one_atmu(struct ccsr_pci __iomem *pci, +static int setup_one_atmu(struct ccsr_pci __iomem *pci,  	unsigned int index, const struct resource *res,  	resource_size_t offset)  { @@ -126,7 +126,7 @@ static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,  }  /* atmu setup for fsl pci/pcie controller */ -static void __init setup_pci_atmu(struct pci_controller *hose, +static void setup_pci_atmu(struct pci_controller *hose,  				  struct resource *rsrc)  {  	struct ccsr_pci __iomem *pci; @@ -871,7 +871,7 @@ void fsl_pci_assign_primary(void)  	}  } -static int __devinit fsl_pci_probe(struct platform_device *pdev) +static int fsl_pci_probe(struct platform_device *pdev)  {  	int ret;  	struct device_node *node; @@ -902,9 +902,42 @@ static int __devinit fsl_pci_probe(struct platform_device *pdev)  	return 0;  } +#ifdef CONFIG_PM +static int fsl_pci_resume(struct device *dev) +{ +	struct pci_controller *hose; +	struct resource pci_rsrc; + +	hose = pci_find_hose_for_OF_device(dev->of_node); +	if (!hose) +		return -ENODEV; + +	if (of_address_to_resource(dev->of_node, 0, &pci_rsrc)) { +		dev_err(dev, "Get pci register base failed."); +		return -ENODEV; +	} + +	setup_pci_atmu(hose, &pci_rsrc); + +	return 0; +} + +static const struct dev_pm_ops pci_pm_ops = { +	.resume = fsl_pci_resume, +}; + +#define PCI_PM_OPS (&pci_pm_ops) + +#else + +#define PCI_PM_OPS NULL + +#endif +  static struct platform_driver fsl_pci_driver = {  	.driver = {  		.name = "fsl-pci", +		.pm = PCI_PM_OPS,  		.of_match_table = pci_ids,  	},  	.probe = fsl_pci_probe, diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c index 5b6f556094d..e2fb3171f41 100644 --- a/arch/powerpc/sysdev/fsl_rio.c +++ b/arch/powerpc/sysdev/fsl_rio.c @@ -644,7 +644,7 @@ err_rio_regs:  /* The probe function for RapidIO peer-to-peer network.   */ -static int __devinit fsl_of_rio_rpn_probe(struct platform_device *dev) +static int fsl_of_rio_rpn_probe(struct platform_device *dev)  {  	printk(KERN_INFO "Setting up RapidIO peer-to-peer network %s\n",  			dev->dev.of_node->full_name); diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 9c6e535daad..3b2efd41abf 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c @@ -1864,7 +1864,7 @@ int __init smp_mpic_probe(void)  	return nr_cpus;  } -void __devinit smp_mpic_setup_cpu(int cpu) +void smp_mpic_setup_cpu(int cpu)  {  	mpic_setup_this_cpu();  } diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c index e961f8c4a8f..c75325865a8 100644 --- a/arch/powerpc/sysdev/mpic_msgr.c +++ b/arch/powerpc/sysdev/mpic_msgr.c @@ -160,7 +160,7 @@ static int mpic_msgr_block_number(struct device_node *node)  /* The probe function for a single message register block.   */ -static __devinit int mpic_msgr_probe(struct platform_device *dev) +static int mpic_msgr_probe(struct platform_device *dev)  {  	void __iomem *msgr_block_addr;  	int block_number; diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c index 364b14d4754..330d56613c5 100644 --- a/arch/powerpc/sysdev/mv64x60_pci.c +++ b/arch/powerpc/sysdev/mv64x60_pci.c @@ -104,7 +104,7 @@ subsys_initcall(mv64x60_sysfs_init);  #endif /* CONFIG_SYSFS */ -static void __devinit mv64x60_pci_fixup_early(struct pci_dev *dev) +static void mv64x60_pci_fixup_early(struct pci_dev *dev)  {  	/*  	 * Set the host bridge hdr_type to an invalid value so that diff --git a/arch/powerpc/sysdev/pmi.c b/arch/powerpc/sysdev/pmi.c index 8f0465422b1..5aaf86c0389 100644 --- a/arch/powerpc/sysdev/pmi.c +++ b/arch/powerpc/sysdev/pmi.c @@ -214,18 +214,7 @@ static struct platform_driver pmi_of_platform_driver = {  		.of_match_table = pmi_match,  	},  }; - -static int __init pmi_module_init(void) -{ -	return platform_driver_register(&pmi_of_platform_driver); -} -module_init(pmi_module_init); - -static void __exit pmi_module_exit(void) -{ -	platform_driver_unregister(&pmi_of_platform_driver); -} -module_exit(pmi_module_exit); +module_platform_driver(pmi_of_platform_driver);  int pmi_send_message(pmi_message_t msg)  { diff --git a/arch/powerpc/sysdev/ppc4xx_msi.c b/arch/powerpc/sysdev/ppc4xx_msi.c index 82c6702dcba..43948da837a 100644 --- a/arch/powerpc/sysdev/ppc4xx_msi.c +++ b/arch/powerpc/sysdev/ppc4xx_msi.c @@ -220,7 +220,7 @@ static int ppc4xx_of_msi_remove(struct platform_device *dev)  	return 0;  } -static int __devinit ppc4xx_msi_probe(struct platform_device *dev) +static int ppc4xx_msi_probe(struct platform_device *dev)  {  	struct ppc4xx_msi *msi;  	struct resource res; diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c index b0436752972..238a07b97f2 100644 --- a/arch/powerpc/sysdev/qe_lib/qe.c +++ b/arch/powerpc/sysdev/qe_lib/qe.c @@ -1,5 +1,5 @@  /* - * Copyright (C) 2006-2010 Freescale Semicondutor, Inc. All rights reserved. + * Copyright (C) 2006-2010 Freescale Semiconductor, Inc. All rights reserved.   *   * Authors: 	Shlomi Gridish <gridish@freescale.com>   * 		Li Yang <leoli@freescale.com> diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c index 2fba6ef2f95..b2b87c30e26 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.c +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c @@ -1,7 +1,7 @@  /*   * arch/powerpc/sysdev/qe_lib/qe_ic.c   * - * Copyright (C) 2006 Freescale Semicondutor, Inc.  All rights reserved. + * Copyright (C) 2006 Freescale Semiconductor, Inc.  All rights reserved.   *   * Author: Li Yang <leoli@freescale.com>   * Based on code from Shlomi Gridish <gridish@freescale.com> diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.h b/arch/powerpc/sysdev/qe_lib/qe_ic.h index c327872ed35..efef7ab9b75 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.h +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.h @@ -3,7 +3,7 @@   *   * QUICC ENGINE Interrupt Controller Header   * - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved.   *   * Author: Li Yang <leoli@freescale.com>   * Based on code from Shlomi Gridish <gridish@freescale.com> diff --git a/arch/powerpc/sysdev/qe_lib/qe_io.c b/arch/powerpc/sysdev/qe_lib/qe_io.c index fd1a6c3b172..a88807b3dd5 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_io.c +++ b/arch/powerpc/sysdev/qe_lib/qe_io.c @@ -3,7 +3,7 @@   *   * QE Parallel I/O ports configuration routines   * - * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. + * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved.   *   * Author: Li Yang <LeoLi@freescale.com>   * Based on code from Shlomi Gridish <gridish@freescale.com> diff --git a/arch/powerpc/sysdev/qe_lib/ucc.c b/arch/powerpc/sysdev/qe_lib/ucc.c index 04677505f20..134b07d2943 100644 --- a/arch/powerpc/sysdev/qe_lib/ucc.c +++ b/arch/powerpc/sysdev/qe_lib/ucc.c @@ -3,7 +3,7 @@   *   * QE UCC API Set - UCC specific routines implementations.   * - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved.   *   * Authors: 	Shlomi Gridish <gridish@freescale.com>   * 		Li Yang <leoli@freescale.com> diff --git a/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/arch/powerpc/sysdev/qe_lib/ucc_fast.c index fba02440d12..cceb2e36673 100644 --- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c +++ b/arch/powerpc/sysdev/qe_lib/ucc_fast.c @@ -1,5 +1,5 @@  /* - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved.   *   * Authors: 	Shlomi Gridish <gridish@freescale.com>   * 		Li Yang <leoli@freescale.com> diff --git a/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/arch/powerpc/sysdev/qe_lib/ucc_slow.c index 524c0ead941..1c062f48f1a 100644 --- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c +++ b/arch/powerpc/sysdev/qe_lib/ucc_slow.c @@ -1,5 +1,5 @@  /* - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved.   *   * Authors: 	Shlomi Gridish <gridish@freescale.com>   * 		Li Yang <leoli@freescale.com> diff --git a/arch/powerpc/sysdev/qe_lib/usb.c b/arch/powerpc/sysdev/qe_lib/usb.c index 9162828f5da..27f23bd15eb 100644 --- a/arch/powerpc/sysdev/qe_lib/usb.c +++ b/arch/powerpc/sysdev/qe_lib/usb.c @@ -1,7 +1,7 @@  /*   * QE USB routines   * - * Copyright (c) Freescale Semicondutor, Inc. 2006. + * Copyright 2006 Freescale Semiconductor, Inc.   *               Shlomi Gridish <gridish@freescale.com>   *               Jerry Huang <Chang-Ming.Huang@freescale.com>   * Copyright (c) MontaVista Software, Inc. 2008. diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile index c168c54e3c4..b49fdbd1580 100644 --- a/arch/powerpc/xmon/Makefile +++ b/arch/powerpc/xmon/Makefile @@ -6,7 +6,7 @@ GCOV_PROFILE := n  ccflags-$(CONFIG_PPC64) := -mno-minimal-toc -obj-y			+= xmon.o start.o nonstdio.o +obj-y			+= xmon.o nonstdio.o  ifdef CONFIG_XMON_DISASSEMBLY  obj-y			+= ppc-dis.o ppc-opc.o diff --git a/arch/powerpc/xmon/nonstdio.c b/arch/powerpc/xmon/nonstdio.c index bfac84fbe78..bce3dcfe505 100644 --- a/arch/powerpc/xmon/nonstdio.c +++ b/arch/powerpc/xmon/nonstdio.c @@ -7,9 +7,23 @@   *      2 of the License, or (at your option) any later version.   */  #include <linux/string.h> +#include <asm/udbg.h>  #include <asm/time.h>  #include "nonstdio.h" + +static int xmon_write(const void *ptr, int nb) +{ +	return udbg_write(ptr, nb); +} + +static int xmon_readchar(void) +{ +	if (udbg_getc) +		return udbg_getc(); +	return -1; +} +  int xmon_putchar(int c)  {  	char ch = c; @@ -23,34 +37,7 @@ static char line[256];  static char *lineptr;  static int lineleft; -int xmon_expect(const char *str, unsigned long timeout) -{ -	int c; -	unsigned long t0; - -	/* assume 25MHz default timebase if tb_ticks_per_sec not set yet */ -	timeout *= tb_ticks_per_sec? tb_ticks_per_sec: 25000000; -	t0 = get_tbl(); -	do { -		lineptr = line; -		for (;;) { -			c = xmon_read_poll(); -			if (c == -1) { -				if (get_tbl() - t0 > timeout) -					return 0; -				continue; -			} -			if (c == '\n') -				break; -			if (c != '\r' && lineptr < &line[sizeof(line) - 1]) -				*lineptr++ = c; -		} -		*lineptr = 0; -	} while (strstr(line, str) == NULL); -	return 1; -} - -int xmon_getchar(void) +static int xmon_getchar(void)  {  	int c; @@ -124,13 +111,19 @@ char *xmon_gets(char *str, int nb)  void xmon_printf(const char *format, ...)  {  	va_list args; -	int n;  	static char xmon_outbuf[1024]; +	int rc, n;  	va_start(args, format);  	n = vsnprintf(xmon_outbuf, sizeof(xmon_outbuf), format, args);  	va_end(args); -	xmon_write(xmon_outbuf, n); + +	rc = xmon_write(xmon_outbuf, n); + +	if (n && rc == 0) { +		/* No udbg hooks, fallback to printk() - dangerous */ +		printk(xmon_outbuf); +	}  }  void xmon_puts(const char *str) diff --git a/arch/powerpc/xmon/nonstdio.h b/arch/powerpc/xmon/nonstdio.h index 23dd95f4599..18a51ded4ff 100644 --- a/arch/powerpc/xmon/nonstdio.h +++ b/arch/powerpc/xmon/nonstdio.h @@ -4,12 +4,6 @@  #define putchar	xmon_putchar  extern int xmon_putchar(int c); -extern int xmon_getchar(void);  extern void xmon_puts(const char *);  extern char *xmon_gets(char *, int);  extern void xmon_printf(const char *, ...); -extern void xmon_map_scc(void); -extern int xmon_expect(const char *str, unsigned long timeout); -extern int xmon_write(const void *ptr, int nb); -extern int xmon_readchar(void); -extern int xmon_read_poll(void); diff --git a/arch/powerpc/xmon/start.c b/arch/powerpc/xmon/start.c deleted file mode 100644 index 8864de2af38..00000000000 --- a/arch/powerpc/xmon/start.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 1996 Paul Mackerras. - * - *      This program is free software; you can redistribute it and/or - *      modify it under the terms of the GNU General Public License - *      as published by the Free Software Foundation; either version - *      2 of the License, or (at your option) any later version. - */ -#include <asm/machdep.h> -#include <asm/udbg.h> -#include "nonstdio.h" - -void xmon_map_scc(void) -{ -} - -int xmon_write(const void *ptr, int nb) -{ -	return udbg_write(ptr, nb); -} - -int xmon_readchar(void) -{ -	if (udbg_getc) -		return udbg_getc(); -	return -1; -} - -int xmon_read_poll(void) -{ -	if (udbg_getc_poll) -		return udbg_getc_poll(); -	return -1; -} diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 3a56a639a92..1f8d2f10a43 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -52,9 +52,6 @@  #include "nonstdio.h"  #include "dis-asm.h" -#define scanhex	xmon_scanhex -#define skipbl	xmon_skipbl -  #ifdef CONFIG_SMP  static cpumask_t cpus_in_xmon = CPU_MASK_NONE;  static unsigned long xmon_taken = 1; @@ -169,12 +166,8 @@ extern void xmon_leave(void);  #ifdef CONFIG_PPC64  #define REG		"%.16lx" -#define REGS_PER_LINE	4 -#define LAST_VOLATILE	13  #else  #define REG		"%.8lx" -#define REGS_PER_LINE	8 -#define LAST_VOLATILE	12  #endif  #define GETWORD(v)	(((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3]) @@ -1288,27 +1281,19 @@ static void get_function_bounds(unsigned long pc, unsigned long *startp,  	catch_memory_errors = 0;  } -static int xmon_depth_to_print = 64; -  #define LRSAVE_OFFSET		(STACK_FRAME_LR_SAVE * sizeof(unsigned long))  #define MARKER_OFFSET		(STACK_FRAME_MARKER * sizeof(unsigned long)) -#ifdef __powerpc64__ -#define REGS_OFFSET		0x70 -#else -#define REGS_OFFSET		16 -#endif -  static void xmon_show_stack(unsigned long sp, unsigned long lr,  			    unsigned long pc)  { +	int max_to_print = 64;  	unsigned long ip;  	unsigned long newsp;  	unsigned long marker; -	int count = 0;  	struct pt_regs regs; -	do { +	while (max_to_print--) {  		if (sp < PAGE_OFFSET) {  			if (sp != 0)  				printf("SP (%lx) is in userspace\n", sp); @@ -1362,10 +1347,10 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr,  		   an exception frame. */  		if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long))  		    && marker == STACK_FRAME_REGS_MARKER) { -			if (mread(sp + REGS_OFFSET, ®s, sizeof(regs)) +			if (mread(sp + STACK_FRAME_OVERHEAD, ®s, sizeof(regs))  			    != sizeof(regs)) {  				printf("Couldn't read registers at %lx\n", -				       sp + REGS_OFFSET); +				       sp + STACK_FRAME_OVERHEAD);  				break;  			}  			printf("--- Exception: %lx %s at ", regs.trap, @@ -1379,7 +1364,7 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr,  			break;  		sp = newsp; -	} while (count++ < xmon_depth_to_print); +	}  }  static void backtrace(struct pt_regs *excp) @@ -2943,7 +2928,6 @@ static void xmon_init(int enable)  		__debugger_dabr_match = NULL;  		__debugger_fault_handler = NULL;  	} -	xmon_map_scc();  }  #ifdef CONFIG_MAGIC_SYSRQ diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 32425af9d68..b5ea38c2564 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -137,8 +137,6 @@ config S390  	select GENERIC_CLOCKEVENTS  	select KTIME_SCALAR if 32BIT  	select HAVE_ARCH_SECCOMP_FILTER -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	select HAVE_MOD_ARCH_SPECIFIC  	select MODULES_USE_ELF_RELA  	select CLONE_BACKWARDS2 diff --git a/arch/s390/Makefile b/arch/s390/Makefile index 4b8e08b56f4..7e3ce78d429 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile @@ -24,8 +24,8 @@ CHECKFLAGS	+= -D__s390__ -msize-long  else  LD_BFD		:= elf64-s390  LDFLAGS		:= -m elf64_s390 -KBUILD_AFLAGS_MODULE += -fpic -D__PIC__ -KBUILD_CFLAGS_MODULE += -fpic -D__PIC__ +KBUILD_AFLAGS_MODULE += -fPIC +KBUILD_CFLAGS_MODULE += -fPIC  KBUILD_CFLAGS	+= -m64  KBUILD_AFLAGS	+= -m64  UTS_MACHINE	:= s390x diff --git a/arch/s390/include/asm/ccwdev.h b/arch/s390/include/asm/ccwdev.h index 6d1f3573f0d..e6061617a50 100644 --- a/arch/s390/include/asm/ccwdev.h +++ b/arch/s390/include/asm/ccwdev.h @@ -12,15 +12,13 @@  #include <linux/mod_devicetable.h>  #include <asm/fcx.h>  #include <asm/irq.h> +#include <asm/schid.h>  /* structs from asm/cio.h */  struct irb;  struct ccw1;  struct ccw_dev_id; -/* from asm/schid.h */ -struct subchannel_id; -  /* simplified initializers for struct ccw_device:   * CCW_DEVICE and CCW_DEVICE_DEVTYPE initialize one   * entry in your MODULE_DEVICE_TABLE and set the match_flag correctly */ diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h index 18cd6b59265..f8c6df6cd1f 100644 --- a/arch/s390/include/asm/compat.h +++ b/arch/s390/include/asm/compat.h @@ -7,6 +7,9 @@  #include <linux/sched.h>  #include <linux/thread_info.h> +#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p(typeof(0?(t)0:0ULL), u64)) +#define __SC_DELOUSE(t,v) (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)) +  #define PSW32_MASK_PER		0x40000000UL  #define PSW32_MASK_DAT		0x04000000UL  #define PSW32_MASK_IO		0x02000000UL diff --git a/arch/s390/include/asm/dma.h b/arch/s390/include/asm/dma.h index de015d85e3e..bb9bdcd2086 100644 --- a/arch/s390/include/asm/dma.h +++ b/arch/s390/include/asm/dma.h @@ -10,4 +10,10 @@   */  #define MAX_DMA_ADDRESS         0x80000000 +#ifdef CONFIG_PCI +extern int isa_dma_bridge_buggy; +#else +#define isa_dma_bridge_buggy	(0) +#endif +  #endif /* _ASM_S390_DMA_H */ diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h index 16c3eb164f4..27cb32185ce 100644 --- a/arch/s390/include/asm/io.h +++ b/arch/s390/include/asm/io.h @@ -85,6 +85,11 @@ static inline void iounmap(volatile void __iomem *addr)  #define __raw_writel	zpci_write_u32  #define __raw_writeq	zpci_write_u64 +#define readb_relaxed	readb +#define readw_relaxed	readw +#define readl_relaxed	readl +#define readq_relaxed	readq +  #endif /* CONFIG_PCI */  #include <asm-generic/io.h> diff --git a/arch/s390/include/asm/irq.h b/arch/s390/include/asm/irq.h index e6972f85d2b..7def77302d6 100644 --- a/arch/s390/include/asm/irq.h +++ b/arch/s390/include/asm/irq.h @@ -2,43 +2,61 @@  #define _ASM_IRQ_H  #include <linux/hardirq.h> +#include <linux/percpu.h> +#include <linux/cache.h>  #include <linux/types.h> -enum interruption_class { +enum interruption_main_class {  	EXTERNAL_INTERRUPT,  	IO_INTERRUPT, -	EXTINT_CLK, -	EXTINT_EXC, -	EXTINT_EMS, -	EXTINT_TMR, -	EXTINT_TLA, -	EXTINT_PFL, -	EXTINT_DSD, -	EXTINT_VRT, -	EXTINT_SCP, -	EXTINT_IUC, -	EXTINT_CMS, -	EXTINT_CMC, -	EXTINT_CMR, -	IOINT_CIO, -	IOINT_QAI, -	IOINT_DAS, -	IOINT_C15, -	IOINT_C70, -	IOINT_TAP, -	IOINT_VMR, -	IOINT_LCS, -	IOINT_CLW, -	IOINT_CTC, -	IOINT_APB, -	IOINT_ADM, -	IOINT_CSC, -	IOINT_PCI, -	IOINT_MSI, +	NR_IRQS +}; + +enum interruption_class { +	IRQEXT_CLK, +	IRQEXT_EXC, +	IRQEXT_EMS, +	IRQEXT_TMR, +	IRQEXT_TLA, +	IRQEXT_PFL, +	IRQEXT_DSD, +	IRQEXT_VRT, +	IRQEXT_SCP, +	IRQEXT_IUC, +	IRQEXT_CMS, +	IRQEXT_CMC, +	IRQEXT_CMR, +	IRQIO_CIO, +	IRQIO_QAI, +	IRQIO_DAS, +	IRQIO_C15, +	IRQIO_C70, +	IRQIO_TAP, +	IRQIO_VMR, +	IRQIO_LCS, +	IRQIO_CLW, +	IRQIO_CTC, +	IRQIO_APB, +	IRQIO_ADM, +	IRQIO_CSC, +	IRQIO_PCI, +	IRQIO_MSI,  	NMI_NMI, -	NR_IRQS, +	CPU_RST, +	NR_ARCH_IRQS  }; +struct irq_stat { +	unsigned int irqs[NR_ARCH_IRQS]; +}; + +DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat); + +static __always_inline void inc_irq_stat(enum interruption_class irq) +{ +	__get_cpu_var(irq_stat).irqs[irq]++; +} +  struct ext_code {  	unsigned short subcode;  	unsigned short code; diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h index a6175ad0c42..b1fa93c606a 100644 --- a/arch/s390/include/asm/pci.h +++ b/arch/s390/include/asm/pci.h @@ -9,6 +9,7 @@  #include <asm-generic/pci.h>  #include <asm-generic/pci-dma-compat.h>  #include <asm/pci_clp.h> +#include <asm/pci_debug.h>  #define PCIBIOS_MIN_IO		0x1000  #define PCIBIOS_MIN_MEM		0x10000000 @@ -33,6 +34,25 @@ int pci_proc_domain(struct pci_bus *);  #define ZPCI_FC_BLOCKED			0x20  #define ZPCI_FC_DMA_ENABLED		0x10 +struct zpci_fmb { +	u32 format	:  8; +	u32 dma_valid	:  1; +	u32		: 23; +	u32 samples; +	u64 last_update; +	/* hardware counters */ +	u64 ld_ops; +	u64 st_ops; +	u64 stb_ops; +	u64 rpcit_ops; +	u64 dma_rbytes; +	u64 dma_wbytes; +	/* software counters */ +	atomic64_t allocated_pages; +	atomic64_t mapped_pages; +	atomic64_t unmapped_pages; +} __packed __aligned(16); +  struct msi_map {  	unsigned long irq;  	struct msi_desc *msi; @@ -92,7 +112,15 @@ struct zpci_dev {  	u64		end_dma;	/* End of available DMA addresses */  	u64		dma_mask;	/* DMA address space mask */ +	/* Function measurement block */ +	struct zpci_fmb *fmb; +	u16		fmb_update;	/* update interval */ +  	enum pci_bus_speed max_bus_speed; + +	struct dentry	*debugfs_dev; +	struct dentry	*debugfs_perf; +	struct dentry	*debugfs_debug;  };  struct pci_hp_callback_ops { @@ -155,4 +183,15 @@ extern struct list_head zpci_list;  extern struct pci_hp_callback_ops hotplug_ops;  extern unsigned int pci_probe; +/* FMB */ +int zpci_fmb_enable_device(struct zpci_dev *); +int zpci_fmb_disable_device(struct zpci_dev *); + +/* Debug */ +int zpci_debug_init(void); +void zpci_debug_exit(void); +void zpci_debug_init_device(struct zpci_dev *); +void zpci_debug_exit_device(struct zpci_dev *); +void zpci_debug_info(struct zpci_dev *, struct seq_file *); +  #endif diff --git a/arch/s390/include/asm/pci_debug.h b/arch/s390/include/asm/pci_debug.h new file mode 100644 index 00000000000..6bbec4265b6 --- /dev/null +++ b/arch/s390/include/asm/pci_debug.h @@ -0,0 +1,36 @@ +#ifndef _S390_ASM_PCI_DEBUG_H +#define _S390_ASM_PCI_DEBUG_H + +#include <asm/debug.h> + +extern debug_info_t *pci_debug_msg_id; +extern debug_info_t *pci_debug_err_id; + +#ifdef CONFIG_PCI_DEBUG +#define zpci_dbg(fmt, args...)							\ +	do {									\ +		if (pci_debug_msg_id->level >= 2)				\ +			debug_sprintf_event(pci_debug_msg_id, 2, fmt , ## args);\ +	} while (0) + +#else /* !CONFIG_PCI_DEBUG */ +#define zpci_dbg(fmt, args...) do { } while (0) +#endif + +#define zpci_err(text...)							\ +	do {									\ +		char debug_buffer[16];						\ +		snprintf(debug_buffer, 16, text);				\ +		debug_text_event(pci_debug_err_id, 0, debug_buffer);		\ +	} while (0) + +static inline void zpci_err_hex(void *addr, int len) +{ +	while (len > 0) { +		debug_event(pci_debug_err_id, 0, (void *) addr, len); +		len -= pci_debug_err_id->buf_size; +		addr += pci_debug_err_id->buf_size; +	} +} + +#endif diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index c928dc1938f..c1d7930a82f 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h @@ -1387,10 +1387,7 @@ static inline int has_transparent_hugepage(void)  static inline unsigned long pmd_pfn(pmd_t pmd)  { -	if (pmd_trans_huge(pmd)) -		return pmd_val(pmd) >> HPAGE_SHIFT; -	else -		return pmd_val(pmd) >> PAGE_SHIFT; +	return pmd_val(pmd) >> PAGE_SHIFT;  }  #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h index fba4d66788a..4c060bb5b8e 100644 --- a/arch/s390/include/asm/timex.h +++ b/arch/s390/include/asm/timex.h @@ -128,4 +128,32 @@ static inline unsigned long long get_clock_monotonic(void)  	return get_clock_xt() - sched_clock_base_cc;  } +/** + * tod_to_ns - convert a TOD format value to nanoseconds + * @todval: to be converted TOD format value + * Returns: number of nanoseconds that correspond to the TOD format value + * + * Converting a 64 Bit TOD format value to nanoseconds means that the value + * must be divided by 4.096. In order to achieve that we multiply with 125 + * and divide by 512: + * + *    ns = (todval * 125) >> 9; + * + * In order to avoid an overflow with the multiplication we can rewrite this. + * With a split todval == 2^32 * th + tl (th upper 32 bits, tl lower 32 bits) + * we end up with + * + *    ns = ((2^32 * th + tl) * 125 ) >> 9; + * -> ns = (2^23 * th * 125) + ((tl * 125) >> 9); + * + */ +static inline unsigned long long tod_to_ns(unsigned long long todval) +{ +	unsigned long long ns; + +	ns = ((todval >> 32) << 23) * 125; +	ns += ((todval & 0xffffffff) * 125) >> 9; +	return ns; +} +  #endif diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h index 086bb8eaf6a..63653087251 100644 --- a/arch/s390/include/asm/unistd.h +++ b/arch/s390/include/asm/unistd.h @@ -53,7 +53,6 @@  #   define __ARCH_WANT_COMPAT_SYS_TIME  #   define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND  # endif -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_VFORK  #define __ARCH_WANT_SYS_CLONE diff --git a/arch/s390/include/uapi/asm/signal.h b/arch/s390/include/uapi/asm/signal.h index 8c6a49e392e..2f43cfbf5f1 100644 --- a/arch/s390/include/uapi/asm/signal.h +++ b/arch/s390/include/uapi/asm/signal.h @@ -90,12 +90,6 @@ typedef unsigned long sigset_t;  #define SA_RESTORER     0x04000000 -/* - * sigaltstack controls - */ -#define SS_ONSTACK      1 -#define SS_DISABLE      2 -  #define MINSIGSTKSZ     2048  #define SIGSTKSZ        8192 diff --git a/arch/s390/include/uapi/asm/unistd.h b/arch/s390/include/uapi/asm/unistd.h index 63e6078699f..864f693c237 100644 --- a/arch/s390/include/uapi/asm/unistd.h +++ b/arch/s390/include/uapi/asm/unistd.h @@ -279,7 +279,8 @@  #define __NR_process_vm_writev	341  #define __NR_s390_runtime_instr 342  #define __NR_kcmp		343 -#define NR_syscalls 344 +#define __NR_finit_module	344 +#define NR_syscalls 345  /*    * There are some system calls that are not present on 64 bit, some diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index 827e094a2f4..9b9a805656b 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S @@ -1659,3 +1659,9 @@ ENTRY(sys_kcmp_wrapper)  	llgfr	%r5,%r5			# unsigned long  	llgfr	%r6,%r6			# unsigned long  	jg	sys_kcmp + +ENTRY(sys_finit_module_wrapper) +	lgfr	%r2,%r2			# int +	llgtr	%r3,%r3			# const char __user * +	lgfr	%r4,%r4			# int +	jg	sys_finit_module diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index ba500d8dc39..4e8215e0d4b 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c @@ -1127,13 +1127,14 @@ debug_register_view(debug_info_t * id, struct debug_view *view)  	if (i == DEBUG_MAX_VIEWS) {  		pr_err("Registering view %s/%s would exceed the maximum "  		       "number of views %i\n", id->name, view->name, i); -		debugfs_remove(pde);  		rc = -1;  	} else {  		id->views[i] = view;  		id->debugfs_entries[i] = pde;  	}  	spin_unlock_irqrestore(&id->lock, flags); +	if (rc) +		debugfs_remove(pde);  out:  	return rc;  } @@ -1146,9 +1147,9 @@ EXPORT_SYMBOL(debug_register_view);  int  debug_unregister_view(debug_info_t * id, struct debug_view *view)  { -	int rc = 0; -	int i; +	struct dentry *dentry = NULL;  	unsigned long flags; +	int i, rc = 0;  	if (!id)  		goto out; @@ -1160,10 +1161,12 @@ debug_unregister_view(debug_info_t * id, struct debug_view *view)  	if (i == DEBUG_MAX_VIEWS)  		rc = -1;  	else { -		debugfs_remove(id->debugfs_entries[i]); +		dentry = id->debugfs_entries[i];  		id->views[i] = NULL; +		id->debugfs_entries[i] = NULL;  	}  	spin_unlock_irqrestore(&id->lock, flags); +	debugfs_remove(dentry);  out:  	return rc;  } diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c index bf24293970c..9df824ea166 100644 --- a/arch/s390/kernel/irq.c +++ b/arch/s390/kernel/irq.c @@ -24,43 +24,65 @@  #include <asm/irq.h>  #include "entry.h" +DEFINE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat); +EXPORT_PER_CPU_SYMBOL_GPL(irq_stat); +  struct irq_class {  	char *name;  	char *desc;  }; -static const struct irq_class intrclass_names[] = { +/* + * The list of "main" irq classes on s390. This is the list of interrrupts + * that appear both in /proc/stat ("intr" line) and /proc/interrupts. + * Historically only external and I/O interrupts have been part of /proc/stat. + * We can't add the split external and I/O sub classes since the first field + * in the "intr" line in /proc/stat is supposed to be the sum of all other + * fields. + * Since the external and I/O interrupt fields are already sums we would end + * up with having a sum which accounts each interrupt twice. + */ +static const struct irq_class irqclass_main_desc[NR_IRQS] = {  	[EXTERNAL_INTERRUPT] = {.name = "EXT"}, -	[IO_INTERRUPT]	     = {.name = "I/O"}, -	[EXTINT_CLK] = {.name = "CLK", .desc = "[EXT] Clock Comparator"}, -	[EXTINT_EXC] = {.name = "EXC", .desc = "[EXT] External Call"}, -	[EXTINT_EMS] = {.name = "EMS", .desc = "[EXT] Emergency Signal"}, -	[EXTINT_TMR] = {.name = "TMR", .desc = "[EXT] CPU Timer"}, -	[EXTINT_TLA] = {.name = "TAL", .desc = "[EXT] Timing Alert"}, -	[EXTINT_PFL] = {.name = "PFL", .desc = "[EXT] Pseudo Page Fault"}, -	[EXTINT_DSD] = {.name = "DSD", .desc = "[EXT] DASD Diag"}, -	[EXTINT_VRT] = {.name = "VRT", .desc = "[EXT] Virtio"}, -	[EXTINT_SCP] = {.name = "SCP", .desc = "[EXT] Service Call"}, -	[EXTINT_IUC] = {.name = "IUC", .desc = "[EXT] IUCV"}, -	[EXTINT_CMS] = {.name = "CMS", .desc = "[EXT] CPU-Measurement: Sampling"}, -	[EXTINT_CMC] = {.name = "CMC", .desc = "[EXT] CPU-Measurement: Counter"}, -	[EXTINT_CMR] = {.name = "CMR", .desc = "[EXT] CPU-Measurement: RI"}, -	[IOINT_CIO]  = {.name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt"}, -	[IOINT_QAI]  = {.name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt"}, -	[IOINT_DAS]  = {.name = "DAS", .desc = "[I/O] DASD"}, -	[IOINT_C15]  = {.name = "C15", .desc = "[I/O] 3215"}, -	[IOINT_C70]  = {.name = "C70", .desc = "[I/O] 3270"}, -	[IOINT_TAP]  = {.name = "TAP", .desc = "[I/O] Tape"}, -	[IOINT_VMR]  = {.name = "VMR", .desc = "[I/O] Unit Record Devices"}, -	[IOINT_LCS]  = {.name = "LCS", .desc = "[I/O] LCS"}, -	[IOINT_CLW]  = {.name = "CLW", .desc = "[I/O] CLAW"}, -	[IOINT_CTC]  = {.name = "CTC", .desc = "[I/O] CTC"}, -	[IOINT_APB]  = {.name = "APB", .desc = "[I/O] AP Bus"}, -	[IOINT_ADM]  = {.name = "ADM", .desc = "[I/O] EADM Subchannel"}, -	[IOINT_CSC]  = {.name = "CSC", .desc = "[I/O] CHSC Subchannel"}, -	[IOINT_PCI]  = {.name = "PCI", .desc = "[I/O] PCI Interrupt" }, -	[IOINT_MSI] =  {.name = "MSI", .desc = "[I/O] MSI Interrupt" }, +	[IO_INTERRUPT]	     = {.name = "I/O"} +}; + +/* + * The list of split external and I/O interrupts that appear only in + * /proc/interrupts. + * In addition this list contains non external / I/O events like NMIs. + */ +static const struct irq_class irqclass_sub_desc[NR_ARCH_IRQS] = { +	[IRQEXT_CLK] = {.name = "CLK", .desc = "[EXT] Clock Comparator"}, +	[IRQEXT_EXC] = {.name = "EXC", .desc = "[EXT] External Call"}, +	[IRQEXT_EMS] = {.name = "EMS", .desc = "[EXT] Emergency Signal"}, +	[IRQEXT_TMR] = {.name = "TMR", .desc = "[EXT] CPU Timer"}, +	[IRQEXT_TLA] = {.name = "TAL", .desc = "[EXT] Timing Alert"}, +	[IRQEXT_PFL] = {.name = "PFL", .desc = "[EXT] Pseudo Page Fault"}, +	[IRQEXT_DSD] = {.name = "DSD", .desc = "[EXT] DASD Diag"}, +	[IRQEXT_VRT] = {.name = "VRT", .desc = "[EXT] Virtio"}, +	[IRQEXT_SCP] = {.name = "SCP", .desc = "[EXT] Service Call"}, +	[IRQEXT_IUC] = {.name = "IUC", .desc = "[EXT] IUCV"}, +	[IRQEXT_CMS] = {.name = "CMS", .desc = "[EXT] CPU-Measurement: Sampling"}, +	[IRQEXT_CMC] = {.name = "CMC", .desc = "[EXT] CPU-Measurement: Counter"}, +	[IRQEXT_CMR] = {.name = "CMR", .desc = "[EXT] CPU-Measurement: RI"}, +	[IRQIO_CIO]  = {.name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt"}, +	[IRQIO_QAI]  = {.name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt"}, +	[IRQIO_DAS]  = {.name = "DAS", .desc = "[I/O] DASD"}, +	[IRQIO_C15]  = {.name = "C15", .desc = "[I/O] 3215"}, +	[IRQIO_C70]  = {.name = "C70", .desc = "[I/O] 3270"}, +	[IRQIO_TAP]  = {.name = "TAP", .desc = "[I/O] Tape"}, +	[IRQIO_VMR]  = {.name = "VMR", .desc = "[I/O] Unit Record Devices"}, +	[IRQIO_LCS]  = {.name = "LCS", .desc = "[I/O] LCS"}, +	[IRQIO_CLW]  = {.name = "CLW", .desc = "[I/O] CLAW"}, +	[IRQIO_CTC]  = {.name = "CTC", .desc = "[I/O] CTC"}, +	[IRQIO_APB]  = {.name = "APB", .desc = "[I/O] AP Bus"}, +	[IRQIO_ADM]  = {.name = "ADM", .desc = "[I/O] EADM Subchannel"}, +	[IRQIO_CSC]  = {.name = "CSC", .desc = "[I/O] CHSC Subchannel"}, +	[IRQIO_PCI]  = {.name = "PCI", .desc = "[I/O] PCI Interrupt" }, +	[IRQIO_MSI]  = {.name = "MSI", .desc = "[I/O] MSI Interrupt" },  	[NMI_NMI]    = {.name = "NMI", .desc = "[NMI] Machine Check"}, +	[CPU_RST]    = {.name = "RST", .desc = "[CPU] CPU Restart"},  };  /* @@ -68,30 +90,34 @@ static const struct irq_class intrclass_names[] = {   */  int show_interrupts(struct seq_file *p, void *v)  { -	int i = *(loff_t *) v, j; +	int irq = *(loff_t *) v; +	int cpu;  	get_online_cpus(); -	if (i == 0) { +	if (irq == 0) {  		seq_puts(p, "           "); -		for_each_online_cpu(j) -			seq_printf(p, "CPU%d       ",j); +		for_each_online_cpu(cpu) +			seq_printf(p, "CPU%d       ", cpu);  		seq_putc(p, '\n');  	} - -	if (i < NR_IRQS) { -		seq_printf(p, "%s: ", intrclass_names[i].name); -#ifndef CONFIG_SMP -		seq_printf(p, "%10u ", kstat_irqs(i)); -#else -		for_each_online_cpu(j) -			seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); -#endif -		if (intrclass_names[i].desc) -			seq_printf(p, "  %s", intrclass_names[i].desc); -                seq_putc(p, '\n'); -        } +	if (irq < NR_IRQS) { +		seq_printf(p, "%s: ", irqclass_main_desc[irq].name); +		for_each_online_cpu(cpu) +			seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[irq]); +		seq_putc(p, '\n'); +		goto skip_arch_irqs; +	} +	for (irq = 0; irq < NR_ARCH_IRQS; irq++) { +		seq_printf(p, "%s: ", irqclass_sub_desc[irq].name); +		for_each_online_cpu(cpu) +			seq_printf(p, "%10u ", per_cpu(irq_stat, cpu).irqs[irq]); +		if (irqclass_sub_desc[irq].desc) +			seq_printf(p, "  %s", irqclass_sub_desc[irq].desc); +		seq_putc(p, '\n'); +	} +skip_arch_irqs:  	put_online_cpus(); -        return 0; +	return 0;  }  /* @@ -222,7 +248,7 @@ void __irq_entry do_extint(struct pt_regs *regs, struct ext_code ext_code,  		/* Serve timer interrupts first. */  		clock_comparator_work();  	} -	kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; +	kstat_incr_irqs_this_cpu(EXTERNAL_INTERRUPT, NULL);  	if (ext_code.code != 0x1004)  		__get_cpu_var(s390_idle).nohz_delay = 1; diff --git a/arch/s390/kernel/nmi.c b/arch/s390/kernel/nmi.c index a6daa5c5cdb..7918fbea36b 100644 --- a/arch/s390/kernel/nmi.c +++ b/arch/s390/kernel/nmi.c @@ -254,7 +254,7 @@ void notrace s390_do_machine_check(struct pt_regs *regs)  	int umode;  	nmi_enter(); -	kstat_cpu(smp_processor_id()).irqs[NMI_NMI]++; +	inc_irq_stat(NMI_NMI);  	mci = (struct mci *) &S390_lowcore.mcck_interruption_code;  	mcck = &__get_cpu_var(cpu_mcck);  	umode = user_mode(regs); diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c index c4e7269d4a0..86ec7447e1f 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c @@ -229,7 +229,7 @@ static void cpumf_measurement_alert(struct ext_code ext_code,  	if (!(alert & CPU_MF_INT_CF_MASK))  		return; -	kstat_cpu(smp_processor_id()).irqs[EXTINT_CMC]++; +	inc_irq_stat(IRQEXT_CMC);  	cpuhw = &__get_cpu_var(cpu_hw_events);  	/* Measurement alerts are shared and might happen when the PMU diff --git a/arch/s390/kernel/runtime_instr.c b/arch/s390/kernel/runtime_instr.c index 61066f6f71a..077a99389b0 100644 --- a/arch/s390/kernel/runtime_instr.c +++ b/arch/s390/kernel/runtime_instr.c @@ -71,7 +71,7 @@ static void runtime_instr_int_handler(struct ext_code ext_code,  	if (!(param32 & CPU_MF_INT_RI_MASK))  		return; -	kstat_cpu(smp_processor_id()).irqs[EXTINT_CMR]++; +	inc_irq_stat(IRQEXT_CMR);  	if (!current->thread.ri_cb)  		return; diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 2568590973a..a5360de85ec 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c @@ -16,7 +16,7 @@  #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt  #include <linux/errno.h> -#include <linux/module.h> +#include <linux/export.h>  #include <linux/sched.h>  #include <linux/kernel.h>  #include <linux/memblock.h> @@ -289,6 +289,7 @@ void machine_power_off(void)   * Dummy power off function.   */  void (*pm_power_off)(void) = machine_power_off; +EXPORT_SYMBOL_GPL(pm_power_off);  static int __init early_parse_mem(char *p)  { diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index ea431e551c6..7433a2f9e5c 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -433,9 +433,9 @@ static void do_ext_call_interrupt(struct ext_code ext_code,  	cpu = smp_processor_id();  	if (ext_code.code == 0x1202) -		kstat_cpu(cpu).irqs[EXTINT_EXC]++; +		inc_irq_stat(IRQEXT_EXC);  	else -		kstat_cpu(cpu).irqs[EXTINT_EMS]++; +		inc_irq_stat(IRQEXT_EMS);  	/*  	 * handle bit signal external calls  	 */ @@ -623,9 +623,9 @@ static struct sclp_cpu_info *smp_get_cpu_info(void)  	return info;  } -static int __devinit smp_add_present_cpu(int cpu); +static int __cpuinit smp_add_present_cpu(int cpu); -static int __devinit __smp_rescan_cpus(struct sclp_cpu_info *info, +static int __cpuinit __smp_rescan_cpus(struct sclp_cpu_info *info,  				       int sysfs_add)  {  	struct pcpu *pcpu; @@ -709,6 +709,7 @@ static void __cpuinit smp_start_secondary(void *cpuvoid)  	pfault_init();  	notify_cpu_starting(smp_processor_id());  	set_cpu_online(smp_processor_id(), true); +	inc_irq_stat(CPU_RST);  	local_irq_enable();  	/* cpu_idle will call schedule for us */  	cpu_idle(); @@ -986,7 +987,7 @@ static int __cpuinit smp_cpu_notify(struct notifier_block *self,  	return notifier_from_errno(err);  } -static int __devinit smp_add_present_cpu(int cpu) +static int __cpuinit smp_add_present_cpu(int cpu)  {  	struct cpu *c = &pcpu_devices[cpu].cpu;  	struct device *s = &c->dev; diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 48174850f3b..6a6c61f94dd 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S @@ -352,3 +352,4 @@ SYSCALL(sys_process_vm_readv,sys_process_vm_readv,compat_sys_process_vm_readv_wr  SYSCALL(sys_process_vm_writev,sys_process_vm_writev,compat_sys_process_vm_writev_wrapper)  SYSCALL(sys_ni_syscall,sys_s390_runtime_instr,sys_s390_runtime_instr_wrapper)  SYSCALL(sys_kcmp,sys_kcmp,sys_kcmp_wrapper) +SYSCALL(sys_finit_module,sys_finit_module,sys_finit_module_wrapper) diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 7fcd690d42c..a5f4f5a1d24 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -63,7 +63,7 @@ static DEFINE_PER_CPU(struct clock_event_device, comparators);   */  unsigned long long notrace __kprobes sched_clock(void)  { -	return (get_clock_monotonic() * 125) >> 9; +	return tod_to_ns(get_clock_monotonic());  }  /* @@ -168,7 +168,7 @@ static void clock_comparator_interrupt(struct ext_code ext_code,  				       unsigned int param32,  				       unsigned long param64)  { -	kstat_cpu(smp_processor_id()).irqs[EXTINT_CLK]++; +	inc_irq_stat(IRQEXT_CLK);  	if (S390_lowcore.clock_comparator == -1ULL)  		set_clock_comparator(S390_lowcore.clock_comparator);  } @@ -179,7 +179,7 @@ static void stp_timing_alert(struct stp_irq_parm *);  static void timing_alert_interrupt(struct ext_code ext_code,  				   unsigned int param32, unsigned long param64)  { -	kstat_cpu(smp_processor_id()).irqs[EXTINT_TLA]++; +	inc_irq_stat(IRQEXT_TLA);  	if (param32 & 0x00c40000)  		etr_timing_alert((struct etr_irq_parm *) ¶m32);  	if (param32 & 0x00038000) diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index f1aba87cceb..4b2e3e31700 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c @@ -10,6 +10,7 @@  #include <linux/bootmem.h>  #include <linux/cpuset.h>  #include <linux/device.h> +#include <linux/export.h>  #include <linux/kernel.h>  #include <linux/sched.h>  #include <linux/init.h> @@ -42,6 +43,7 @@ static struct mask_info socket_info;  static struct mask_info book_info;  struct cpu_topology_s390 cpu_topology[NR_CPUS]; +EXPORT_SYMBOL_GPL(cpu_topology);  static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu)  { diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index c30615e605a..82c481ddef7 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c @@ -408,7 +408,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu)  		return 0;  	} -	sltime = ((vcpu->arch.sie_block->ckc - now)*125)>>9; +	sltime = tod_to_ns(vcpu->arch.sie_block->ckc - now);  	hrtimer_start(&vcpu->arch.ckc_timer, ktime_set (0, sltime) , HRTIMER_MODE_REL);  	VCPU_EVENT(vcpu, 5, "enabled wait via clock comparator: %llx ns", sltime); diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index c9011bfaabb..f090e819bf7 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -613,7 +613,9 @@ static int __vcpu_run(struct kvm_vcpu *vcpu)  		kvm_s390_deliver_pending_interrupts(vcpu);  	vcpu->arch.sie_block->icptcode = 0; +	preempt_disable();  	kvm_guest_enter(); +	preempt_enable();  	VCPU_EVENT(vcpu, 6, "entering sie flags %x",  		   atomic_read(&vcpu->arch.sie_block->cpuflags));  	trace_kvm_s390_sie_enter(vcpu, diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 42601d6e166..2fb9e63b8fc 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -569,7 +569,7 @@ static void pfault_interrupt(struct ext_code ext_code,  	subcode = ext_code.subcode;  	if ((subcode & 0xff00) != __SUBCODE_MASK)  		return; -	kstat_cpu(smp_processor_id()).irqs[EXTINT_PFL]++; +	inc_irq_stat(IRQEXT_PFL);  	/* Get the token (= pid of the affected task). */  	pid = sizeof(void *) == 4 ? param32 : param64;  	rcu_read_lock(); diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c index 0cb385da202..b5b2916895e 100644 --- a/arch/s390/oprofile/hwsampler.c +++ b/arch/s390/oprofile/hwsampler.c @@ -233,7 +233,7 @@ static void hws_ext_handler(struct ext_code ext_code,  	if (!(param32 & CPU_MF_INT_SF_MASK))  		return; -	kstat_cpu(smp_processor_id()).irqs[EXTINT_CMS]++; +	inc_irq_stat(IRQEXT_CMS);  	atomic_xchg(&cb->ext_params, atomic_read(&cb->ext_params) | param32);  	if (hws_wq) diff --git a/arch/s390/pci/Makefile b/arch/s390/pci/Makefile index ab0827b6bc4..f0f426a113c 100644 --- a/arch/s390/pci/Makefile +++ b/arch/s390/pci/Makefile @@ -3,4 +3,4 @@  #  obj-$(CONFIG_PCI)	+= pci.o pci_dma.o pci_clp.o pci_msi.o \ -			   pci_sysfs.o pci_event.o +			   pci_sysfs.o pci_event.o pci_debug.o diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 7ed38e5e302..60e0372545d 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -98,6 +98,10 @@ EXPORT_SYMBOL_GPL(zpci_iomap_start);  static int __read_mostly aisb_max;  static struct kmem_cache *zdev_irq_cache; +static struct kmem_cache *zdev_fmb_cache; + +debug_info_t *pci_debug_msg_id; +debug_info_t *pci_debug_err_id;  static inline int irq_to_msi_nr(unsigned int irq)  { @@ -156,35 +160,6 @@ int pci_proc_domain(struct pci_bus *bus)  }  EXPORT_SYMBOL_GPL(pci_proc_domain); -/* Store PCI function information block */ -static int zpci_store_fib(struct zpci_dev *zdev, u8 *fc) -{ -	struct zpci_fib *fib; -	u8 status, cc; - -	fib = (void *) get_zeroed_page(GFP_KERNEL); -	if (!fib) -		return -ENOMEM; - -	do { -		cc = __stpcifc(zdev->fh, 0, fib, &status); -		if (cc == 2) { -			msleep(ZPCI_INSN_BUSY_DELAY); -			memset(fib, 0, PAGE_SIZE); -		} -	} while (cc == 2); - -	if (cc) -		pr_err_once("%s: cc: %u  status: %u\n", -			    __func__, cc, status); - -	/* Return PCI function controls */ -	*fc = fib->fc; - -	free_page((unsigned long) fib); -	return (cc) ? -EIO : 0; -} -  /* Modify PCI: Register adapter interruptions */  static int zpci_register_airq(struct zpci_dev *zdev, unsigned int aisb,  			      u64 aibv) @@ -216,6 +191,7 @@ struct mod_pci_args {  	u64 base;  	u64 limit;  	u64 iota; +	u64 fmb_addr;  };  static int mod_pci(struct zpci_dev *zdev, int fn, u8 dmaas, struct mod_pci_args *args) @@ -232,6 +208,7 @@ static int mod_pci(struct zpci_dev *zdev, int fn, u8 dmaas, struct mod_pci_args  	fib->pba = args->base;  	fib->pal = args->limit;  	fib->iota = args->iota; +	fib->fmb_addr = args->fmb_addr;  	rc = mpcifc_instr(req, fib);  	free_page((unsigned long) fib); @@ -242,7 +219,7 @@ static int mod_pci(struct zpci_dev *zdev, int fn, u8 dmaas, struct mod_pci_args  int zpci_register_ioat(struct zpci_dev *zdev, u8 dmaas,  		       u64 base, u64 limit, u64 iota)  { -	struct mod_pci_args args = { base, limit, iota }; +	struct mod_pci_args args = { base, limit, iota, 0 };  	WARN_ON_ONCE(iota & 0x3fff);  	args.iota |= ZPCI_IOTA_RTTO_FLAG; @@ -252,7 +229,7 @@ int zpci_register_ioat(struct zpci_dev *zdev, u8 dmaas,  /* Modify PCI: Unregister I/O address translation parameters */  int zpci_unregister_ioat(struct zpci_dev *zdev, u8 dmaas)  { -	struct mod_pci_args args = { 0, 0, 0 }; +	struct mod_pci_args args = { 0, 0, 0, 0 };  	return mod_pci(zdev, ZPCI_MOD_FC_DEREG_IOAT, dmaas, &args);  } @@ -260,11 +237,46 @@ int zpci_unregister_ioat(struct zpci_dev *zdev, u8 dmaas)  /* Modify PCI: Unregister adapter interruptions */  static int zpci_unregister_airq(struct zpci_dev *zdev)  { -	struct mod_pci_args args = { 0, 0, 0 }; +	struct mod_pci_args args = { 0, 0, 0, 0 };  	return mod_pci(zdev, ZPCI_MOD_FC_DEREG_INT, 0, &args);  } +/* Modify PCI: Set PCI function measurement parameters */ +int zpci_fmb_enable_device(struct zpci_dev *zdev) +{ +	struct mod_pci_args args = { 0, 0, 0, 0 }; + +	if (zdev->fmb) +		return -EINVAL; + +	zdev->fmb = kmem_cache_alloc(zdev_fmb_cache, GFP_KERNEL); +	if (!zdev->fmb) +		return -ENOMEM; +	memset(zdev->fmb, 0, sizeof(*zdev->fmb)); +	WARN_ON((u64) zdev->fmb & 0xf); + +	args.fmb_addr = virt_to_phys(zdev->fmb); +	return mod_pci(zdev, ZPCI_MOD_FC_SET_MEASURE, 0, &args); +} + +/* Modify PCI: Disable PCI function measurement */ +int zpci_fmb_disable_device(struct zpci_dev *zdev) +{ +	struct mod_pci_args args = { 0, 0, 0, 0 }; +	int rc; + +	if (!zdev->fmb) +		return -EINVAL; + +	/* Function measurement is disabled if fmb address is zero */ +	rc = mod_pci(zdev, ZPCI_MOD_FC_SET_MEASURE, 0, &args); + +	kmem_cache_free(zdev_fmb_cache, zdev->fmb); +	zdev->fmb = NULL; +	return rc; +} +  #define ZPCI_PCIAS_CFGSPC	15  static int zpci_cfg_load(struct zpci_dev *zdev, int offset, u32 *val, u8 len) @@ -344,7 +356,7 @@ unsigned int probe_irq_mask(unsigned long val)  }  EXPORT_SYMBOL_GPL(probe_irq_mask); -void __devinit pcibios_fixup_bus(struct pci_bus *bus) +void pcibios_fixup_bus(struct pci_bus *bus)  {  } @@ -428,7 +440,7 @@ static void zpci_irq_handler(void *dont, void *need)  	int rescan = 0, max = aisb_max;  	struct zdev_irq_map *imap; -	kstat_cpu(smp_processor_id()).irqs[IOINT_PCI]++; +	inc_irq_stat(IRQIO_PCI);  	sbit = start;  scan: @@ -440,7 +452,7 @@ scan:  		/* find vector bit */  		imap = bucket->imap[sbit];  		for_each_set_bit_left(mbit, &imap->aibv, imap->msi_vecs) { -			kstat_cpu(smp_processor_id()).irqs[IOINT_MSI]++; +			inc_irq_stat(IRQIO_MSI);  			clear_bit(63 - mbit, &imap->aibv);  			spin_lock(&imap->lock); @@ -633,6 +645,7 @@ static void zpci_remove_device(struct pci_dev *pdev)  	dev_info(&pdev->dev, "Removing device %u\n", zdev->domain);  	zdev->state = ZPCI_FN_STATE_CONFIGURED;  	zpci_dma_exit_device(zdev); +	zpci_fmb_disable_device(zdev);  	zpci_sysfs_remove_device(&pdev->dev);  	zpci_unmap_resources(pdev);  	list_del(&zdev->entry);		/* can be called from init */ @@ -799,6 +812,16 @@ static void zpci_irq_exit(void)  	kfree(bucket);  } +void zpci_debug_info(struct zpci_dev *zdev, struct seq_file *m) +{ +	if (!zdev) +		return; + +	seq_printf(m, "global irq retries: %u\n", atomic_read(&irq_retries)); +	seq_printf(m, "aibv[0]:%016lx  aibv[1]:%016lx  aisb:%016lx\n", +		   get_imap(0)->aibv, get_imap(1)->aibv, *bucket->aisb); +} +  static struct resource *zpci_alloc_bus_resource(unsigned long start, unsigned long size,  						unsigned long flags, int domain)  { @@ -994,6 +1017,8 @@ int zpci_scan_device(struct zpci_dev *zdev)  		goto out;  	} +	zpci_debug_init_device(zdev); +	zpci_fmb_enable_device(zdev);  	zpci_map_resources(zdev);  	pci_bus_add_devices(zdev->bus); @@ -1020,6 +1045,11 @@ static int zpci_mem_init(void)  	if (!zdev_irq_cache)  		goto error_zdev; +	zdev_fmb_cache = kmem_cache_create("PCI_FMB_cache", sizeof(struct zpci_fmb), +				16, 0, NULL); +	if (!zdev_fmb_cache) +		goto error_fmb; +  	/* TODO: use realloc */  	zpci_iomap_start = kzalloc(ZPCI_IOMAP_MAX_ENTRIES * sizeof(*zpci_iomap_start),  				   GFP_KERNEL); @@ -1028,6 +1058,8 @@ static int zpci_mem_init(void)  	return 0;  error_iomap: +	kmem_cache_destroy(zdev_fmb_cache); +error_fmb:  	kmem_cache_destroy(zdev_irq_cache);  error_zdev:  	return -ENOMEM; @@ -1037,6 +1069,7 @@ static void zpci_mem_exit(void)  {  	kfree(zpci_iomap_start);  	kmem_cache_destroy(zdev_irq_cache); +	kmem_cache_destroy(zdev_fmb_cache);  }  unsigned int pci_probe = 1; @@ -1066,6 +1099,10 @@ static int __init pci_base_init(void)  		test_facility(69), test_facility(70),  		test_facility(71)); +	rc = zpci_debug_init(); +	if (rc) +		return rc; +  	rc = zpci_mem_init();  	if (rc)  		goto out_mem; @@ -1098,6 +1135,7 @@ out_irq:  out_hash:  	zpci_mem_exit();  out_mem: +	zpci_debug_exit();  	return rc;  }  subsys_initcall(pci_base_init); diff --git a/arch/s390/pci/pci_clp.c b/arch/s390/pci/pci_clp.c index 7f4ce8d874a..2c847143cbd 100644 --- a/arch/s390/pci/pci_clp.c +++ b/arch/s390/pci/pci_clp.c @@ -51,6 +51,7 @@ static void clp_store_query_pci_fngrp(struct zpci_dev *zdev,  	zdev->tlb_refresh = response->refresh;  	zdev->dma_mask = response->dasm;  	zdev->msi_addr = response->msia; +	zdev->fmb_update = response->mui;  	pr_debug("Supported number of MSI vectors: %u\n", response->noi);  	switch (response->version) { diff --git a/arch/s390/pci/pci_debug.c b/arch/s390/pci/pci_debug.c new file mode 100644 index 00000000000..a303c95346c --- /dev/null +++ b/arch/s390/pci/pci_debug.c @@ -0,0 +1,193 @@ +/* + *  Copyright IBM Corp. 2012 + * + *  Author(s): + *    Jan Glauber <jang@linux.vnet.ibm.com> + */ + +#define COMPONENT "zPCI" +#define pr_fmt(fmt) COMPONENT ": " fmt + +#include <linux/kernel.h> +#include <linux/seq_file.h> +#include <linux/debugfs.h> +#include <linux/pci.h> +#include <asm/debug.h> + +#include <asm/pci_dma.h> + +static struct dentry *debugfs_root; + +static char *pci_perf_names[] = { +	/* hardware counters */ +	"Load operations", +	"Store operations", +	"Store block operations", +	"Refresh operations", +	"DMA read bytes", +	"DMA write bytes", +	/* software counters */ +	"Allocated pages", +	"Mapped pages", +	"Unmapped pages", +}; + +static int pci_perf_show(struct seq_file *m, void *v) +{ +	struct zpci_dev *zdev = m->private; +	u64 *stat; +	int i; + +	if (!zdev) +		return 0; +	if (!zdev->fmb) +		return seq_printf(m, "FMB statistics disabled\n"); + +	/* header */ +	seq_printf(m, "FMB @ %p\n", zdev->fmb); +	seq_printf(m, "Update interval: %u ms\n", zdev->fmb_update); +	seq_printf(m, "Samples: %u\n", zdev->fmb->samples); +	seq_printf(m, "Last update TOD: %Lx\n", zdev->fmb->last_update); + +	/* hardware counters */ +	stat = (u64 *) &zdev->fmb->ld_ops; +	for (i = 0; i < 4; i++) +		seq_printf(m, "%26s:\t%llu\n", +			   pci_perf_names[i], *(stat + i)); +	if (zdev->fmb->dma_valid) +		for (i = 4; i < 6; i++) +			seq_printf(m, "%26s:\t%llu\n", +				   pci_perf_names[i], *(stat + i)); +	/* software counters */ +	for (i = 6; i < ARRAY_SIZE(pci_perf_names); i++) +		seq_printf(m, "%26s:\t%llu\n", +			   pci_perf_names[i], +			   atomic64_read((atomic64_t *) (stat + i))); + +	return 0; +} + +static ssize_t pci_perf_seq_write(struct file *file, const char __user *ubuf, +				  size_t count, loff_t *off) +{ +	struct zpci_dev *zdev = ((struct seq_file *) file->private_data)->private; +	unsigned long val; +	int rc; + +	if (!zdev) +		return 0; + +	rc = kstrtoul_from_user(ubuf, count, 10, &val); +	if (rc) +		return rc; + +	switch (val) { +	case 0: +		rc = zpci_fmb_disable_device(zdev); +		if (rc) +			return rc; +		break; +	case 1: +		rc = zpci_fmb_enable_device(zdev); +		if (rc) +			return rc; +		break; +	} +	return count; +} + +static int pci_perf_seq_open(struct inode *inode, struct file *filp) +{ +	return single_open(filp, pci_perf_show, +			   filp->f_path.dentry->d_inode->i_private); +} + +static const struct file_operations debugfs_pci_perf_fops = { +	.open	 = pci_perf_seq_open, +	.read	 = seq_read, +	.write	 = pci_perf_seq_write, +	.llseek  = seq_lseek, +	.release = single_release, +}; + +static int pci_debug_show(struct seq_file *m, void *v) +{ +	struct zpci_dev *zdev = m->private; + +	zpci_debug_info(zdev, m); +	return 0; +} + +static int pci_debug_seq_open(struct inode *inode, struct file *filp) +{ +	return single_open(filp, pci_debug_show, +			   filp->f_path.dentry->d_inode->i_private); +} + +static const struct file_operations debugfs_pci_debug_fops = { +	.open	 = pci_debug_seq_open, +	.read	 = seq_read, +	.llseek  = seq_lseek, +	.release = single_release, +}; + +void zpci_debug_init_device(struct zpci_dev *zdev) +{ +	zdev->debugfs_dev = debugfs_create_dir(dev_name(&zdev->pdev->dev), +					       debugfs_root); +	if (IS_ERR(zdev->debugfs_dev)) +		zdev->debugfs_dev = NULL; + +	zdev->debugfs_perf = debugfs_create_file("statistics", +				S_IFREG | S_IRUGO | S_IWUSR, +				zdev->debugfs_dev, zdev, +				&debugfs_pci_perf_fops); +	if (IS_ERR(zdev->debugfs_perf)) +		zdev->debugfs_perf = NULL; + +	zdev->debugfs_debug = debugfs_create_file("debug", +				S_IFREG | S_IRUGO | S_IWUSR, +				zdev->debugfs_dev, zdev, +				&debugfs_pci_debug_fops); +	if (IS_ERR(zdev->debugfs_debug)) +		zdev->debugfs_debug = NULL; +} + +void zpci_debug_exit_device(struct zpci_dev *zdev) +{ +	debugfs_remove(zdev->debugfs_perf); +	debugfs_remove(zdev->debugfs_debug); +	debugfs_remove(zdev->debugfs_dev); +} + +int __init zpci_debug_init(void) +{ +	/* event trace buffer */ +	pci_debug_msg_id = debug_register("pci_msg", 16, 1, 16 * sizeof(long)); +	if (!pci_debug_msg_id) +		return -EINVAL; +	debug_register_view(pci_debug_msg_id, &debug_sprintf_view); +	debug_set_level(pci_debug_msg_id, 3); +	zpci_dbg("Debug view initialized\n"); + +	/* error log */ +	pci_debug_err_id = debug_register("pci_error", 2, 1, 16); +	if (!pci_debug_err_id) +		return -EINVAL; +	debug_register_view(pci_debug_err_id, &debug_hex_ascii_view); +	debug_set_level(pci_debug_err_id, 6); +	zpci_err("Debug view initialized\n"); + +	debugfs_root = debugfs_create_dir("pci", NULL); +	return 0; +} + +void zpci_debug_exit(void) +{ +	if (pci_debug_msg_id) +		debug_unregister(pci_debug_msg_id); +	if (pci_debug_err_id) +		debug_unregister(pci_debug_err_id); + +	debugfs_remove(debugfs_root); +} diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c index c64b4b294b0..a547419907c 100644 --- a/arch/s390/pci/pci_dma.c +++ b/arch/s390/pci/pci_dma.c @@ -13,8 +13,6 @@  #include <linux/pci.h>  #include <asm/pci_dma.h> -static enum zpci_ioat_dtype zpci_ioat_dt = ZPCI_IOTA_RTTO; -  static struct kmem_cache *dma_region_table_cache;  static struct kmem_cache *dma_page_table_cache; @@ -291,8 +289,10 @@ static dma_addr_t s390_dma_map_pages(struct device *dev, struct page *page,  	if (direction == DMA_NONE || direction == DMA_TO_DEVICE)  		flags |= ZPCI_TABLE_PROTECTED; -	if (!dma_update_trans(zdev, pa, dma_addr, size, flags)) +	if (!dma_update_trans(zdev, pa, dma_addr, size, flags)) { +		atomic64_add(nr_pages, (atomic64_t *) &zdev->fmb->mapped_pages);  		return dma_addr + offset; +	}  out_free:  	dma_free_iommu(zdev, iommu_page_index, nr_pages); @@ -315,6 +315,7 @@ static void s390_dma_unmap_pages(struct device *dev, dma_addr_t dma_addr,  			     ZPCI_TABLE_PROTECTED | ZPCI_PTE_INVALID))  		dev_err(dev, "Failed to unmap addr: %Lx\n", dma_addr); +	atomic64_add(npages, (atomic64_t *) &zdev->fmb->unmapped_pages);  	iommu_page_index = (dma_addr - zdev->start_dma) >> PAGE_SHIFT;  	dma_free_iommu(zdev, iommu_page_index, npages);  } @@ -323,6 +324,7 @@ static void *s390_dma_alloc(struct device *dev, size_t size,  			    dma_addr_t *dma_handle, gfp_t flag,  			    struct dma_attrs *attrs)  { +	struct zpci_dev *zdev = get_zdev(container_of(dev, struct pci_dev, dev));  	struct page *page;  	unsigned long pa;  	dma_addr_t map; @@ -331,6 +333,8 @@ static void *s390_dma_alloc(struct device *dev, size_t size,  	page = alloc_pages(flag, get_order(size));  	if (!page)  		return NULL; + +	atomic64_add(size / PAGE_SIZE, (atomic64_t *) &zdev->fmb->allocated_pages);  	pa = page_to_phys(page);  	memset((void *) pa, 0, size); diff --git a/arch/s390/pci/pci_event.c b/arch/s390/pci/pci_event.c index dbed8cd3370..ec62e3a0dc0 100644 --- a/arch/s390/pci/pci_event.c +++ b/arch/s390/pci/pci_event.c @@ -45,6 +45,8 @@ static void zpci_event_log_err(struct zpci_ccdf_err *ccdf)  {  	struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid); +	zpci_err("SEI error CCD:\n"); +	zpci_err_hex(ccdf, sizeof(*ccdf));  	dev_err(&zdev->pdev->dev, "event code: 0x%x\n", ccdf->pec);  } diff --git a/arch/score/Kconfig b/arch/score/Kconfig index 45893390c7d..3b1482e7afa 100644 --- a/arch/score/Kconfig +++ b/arch/score/Kconfig @@ -13,8 +13,6 @@ config SCORE         select GENERIC_CLOCKEVENTS         select HAVE_MOD_ARCH_SPECIFIC  	select MODULES_USE_ELF_REL -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	select CLONE_BACKWARDS  choice diff --git a/arch/score/include/asm/Kbuild b/arch/score/include/asm/Kbuild index 16e41fe1a41..cebaff8069a 100644 --- a/arch/score/include/asm/Kbuild +++ b/arch/score/include/asm/Kbuild @@ -1,4 +1,3 @@ -include include/asm-generic/Kbuild.asm  header-y += diff --git a/arch/score/include/asm/kvm_para.h b/arch/score/include/asm/kvm_para.h deleted file mode 100644 index 14fab8f0b95..00000000000 --- a/arch/score/include/asm/kvm_para.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/kvm_para.h> diff --git a/arch/score/include/asm/ptrace.h b/arch/score/include/asm/ptrace.h index e89dc9b1ef4..abc279d96b7 100644 --- a/arch/score/include/asm/ptrace.h +++ b/arch/score/include/asm/ptrace.h @@ -1,78 +1,8 @@  #ifndef _ASM_SCORE_PTRACE_H  #define _ASM_SCORE_PTRACE_H -#define PTRACE_GETREGS		12 -#define PTRACE_SETREGS		13 +#include <uapi/asm/ptrace.h> -#define PC		32 -#define CONDITION	33 -#define ECR		34 -#define EMA		35 -#define CEH		36 -#define CEL		37 -#define COUNTER		38 -#define LDCR		39 -#define STCR		40 -#define PSR		41 - -#define SINGLESTEP16_INSN	0x7006 -#define SINGLESTEP32_INSN	0x840C8000 -#define BREAKPOINT16_INSN	0x7002		/* work on SPG300 */ -#define BREAKPOINT32_INSN	0x84048000	/* work on SPG300 */ - -/* Define instruction mask */ -#define INSN32_MASK	0x80008000 - -#define J32	0x88008000	/* 1_00010_0000000000_1_000000000000000 */ -#define J32M	0xFC008000	/* 1_11111_0000000000_1_000000000000000 */ - -#define B32	0x90008000	/* 1_00100_0000000000_1_000000000000000 */ -#define B32M	0xFC008000 -#define BL32	0x90008001	/* 1_00100_0000000000_1_000000000000001 */ -#define BL32M	B32 -#define BR32	0x80008008	/* 1_00000_0000000000_1_00000000_000100_0 */ -#define BR32M	0xFFE0807E -#define BRL32	0x80008009	/* 1_00000_0000000000_1_00000000_000100_1 */ -#define BRL32M	BR32M - -#define B32_SET	(J32 | B32 | BL32 | BR32 | BRL32) - -#define J16	0x3000		/* 0_011_....... */ -#define J16M	0xF000 -#define B16	0x4000		/* 0_100_....... */ -#define B16M	0xF000 -#define BR16	0x0004		/* 0_000.......0100 */ -#define BR16M	0xF00F -#define B16_SET (J16 | B16 | BR16) - - -/* - * This struct defines the way the registers are stored on the stack during a - * system call/exception. As usual the registers k0/k1 aren't being saved. - */ -struct pt_regs { -	unsigned long pad0[6];	/* stack arguments */ -	unsigned long orig_r4; -	unsigned long orig_r7; -	long is_syscall; - -	unsigned long regs[32]; - -	unsigned long cel; -	unsigned long ceh; - -	unsigned long sr0;	/* cnt */ -	unsigned long sr1;	/* lcr */ -	unsigned long sr2;	/* scr */ - -	unsigned long cp0_epc; -	unsigned long cp0_ema; -	unsigned long cp0_psr; -	unsigned long cp0_ecr; -	unsigned long cp0_condition; -}; - -#ifdef __KERNEL__  struct task_struct; @@ -83,6 +13,7 @@ struct task_struct;  #define instruction_pointer(regs)	((unsigned long)(regs)->cp0_epc)  #define profile_pc(regs)		instruction_pointer(regs) +#define user_stack_pointer(r)		((unsigned long)(r)->regs[0])  extern void do_syscall_trace(struct pt_regs *regs, int entryexit);  extern int read_tsk_long(struct task_struct *, unsigned long, unsigned long *); @@ -91,6 +22,4 @@ extern int read_tsk_short(struct task_struct *, unsigned long,  #define arch_has_single_step()	(1) -#endif /* __KERNEL__ */ -  #endif /* _ASM_SCORE_PTRACE_H */ diff --git a/arch/score/include/asm/setup.h b/arch/score/include/asm/setup.h index 3cb944dc68d..1f3aa7262fa 100644 --- a/arch/score/include/asm/setup.h +++ b/arch/score/include/asm/setup.h @@ -1,11 +1,8 @@  #ifndef _ASM_SCORE_SETUP_H  #define _ASM_SCORE_SETUP_H -#define COMMAND_LINE_SIZE	256 -#define MEMORY_START		0 -#define MEMORY_SIZE		0x2000000 +#include <uapi/asm/setup.h> -#ifdef __KERNEL__  extern void pagetable_init(void);  extern void pgd_init(unsigned long page); @@ -36,6 +33,4 @@ extern void debug_exception_vector(void);  extern void general_exception_vector(void);  extern void interrupt_exception_vector(void); -#endif /* __KERNEL__ */ -  #endif /* _ASM_SCORE_SETUP_H */ diff --git a/arch/score/include/uapi/asm/Kbuild b/arch/score/include/uapi/asm/Kbuild index baebb3da1d4..040178cdb3e 100644 --- a/arch/score/include/uapi/asm/Kbuild +++ b/arch/score/include/uapi/asm/Kbuild @@ -1,3 +1,34 @@  # UAPI Header export list  include include/uapi/asm-generic/Kbuild.asm +header-y += auxvec.h +header-y += bitsperlong.h +header-y += byteorder.h +header-y += errno.h +header-y += fcntl.h +header-y += ioctl.h +header-y += ioctls.h +header-y += ipcbuf.h +header-y += kvm_para.h +header-y += mman.h +header-y += msgbuf.h +header-y += param.h +header-y += poll.h +header-y += posix_types.h +header-y += ptrace.h +header-y += resource.h +header-y += sembuf.h +header-y += setup.h +header-y += shmbuf.h +header-y += sigcontext.h +header-y += siginfo.h +header-y += signal.h +header-y += socket.h +header-y += sockios.h +header-y += stat.h +header-y += statfs.h +header-y += swab.h +header-y += termbits.h +header-y += termios.h +header-y += types.h +header-y += unistd.h diff --git a/arch/score/include/asm/auxvec.h b/arch/score/include/uapi/asm/auxvec.h index f69151565ae..f69151565ae 100644 --- a/arch/score/include/asm/auxvec.h +++ b/arch/score/include/uapi/asm/auxvec.h diff --git a/arch/score/include/asm/bitsperlong.h b/arch/score/include/uapi/asm/bitsperlong.h index 86ff337aa45..86ff337aa45 100644 --- a/arch/score/include/asm/bitsperlong.h +++ b/arch/score/include/uapi/asm/bitsperlong.h diff --git a/arch/score/include/asm/byteorder.h b/arch/score/include/uapi/asm/byteorder.h index 88cbebc7921..88cbebc7921 100644 --- a/arch/score/include/asm/byteorder.h +++ b/arch/score/include/uapi/asm/byteorder.h diff --git a/arch/score/include/asm/errno.h b/arch/score/include/uapi/asm/errno.h index 29ff39d5ab4..29ff39d5ab4 100644 --- a/arch/score/include/asm/errno.h +++ b/arch/score/include/uapi/asm/errno.h diff --git a/arch/score/include/asm/fcntl.h b/arch/score/include/uapi/asm/fcntl.h index 03968a3103a..03968a3103a 100644 --- a/arch/score/include/asm/fcntl.h +++ b/arch/score/include/uapi/asm/fcntl.h diff --git a/arch/score/include/asm/ioctl.h b/arch/score/include/uapi/asm/ioctl.h index a351d2194bf..a351d2194bf 100644 --- a/arch/score/include/asm/ioctl.h +++ b/arch/score/include/uapi/asm/ioctl.h diff --git a/arch/score/include/asm/ioctls.h b/arch/score/include/uapi/asm/ioctls.h index ed01d2b9aea..ed01d2b9aea 100644 --- a/arch/score/include/asm/ioctls.h +++ b/arch/score/include/uapi/asm/ioctls.h diff --git a/arch/score/include/asm/ipcbuf.h b/arch/score/include/uapi/asm/ipcbuf.h index e082ceff181..e082ceff181 100644 --- a/arch/score/include/asm/ipcbuf.h +++ b/arch/score/include/uapi/asm/ipcbuf.h diff --git a/arch/h8300/include/asm/kvm_para.h b/arch/score/include/uapi/asm/kvm_para.h index 14fab8f0b95..14fab8f0b95 100644 --- a/arch/h8300/include/asm/kvm_para.h +++ b/arch/score/include/uapi/asm/kvm_para.h diff --git a/arch/score/include/asm/mman.h b/arch/score/include/uapi/asm/mman.h index 84d85ddfed8..84d85ddfed8 100644 --- a/arch/score/include/asm/mman.h +++ b/arch/score/include/uapi/asm/mman.h diff --git a/arch/score/include/asm/msgbuf.h b/arch/score/include/uapi/asm/msgbuf.h index 7506721e29f..7506721e29f 100644 --- a/arch/score/include/asm/msgbuf.h +++ b/arch/score/include/uapi/asm/msgbuf.h diff --git a/arch/score/include/asm/param.h b/arch/score/include/uapi/asm/param.h index 916b8690b6a..916b8690b6a 100644 --- a/arch/score/include/asm/param.h +++ b/arch/score/include/uapi/asm/param.h diff --git a/arch/score/include/asm/poll.h b/arch/score/include/uapi/asm/poll.h index 18532db0286..18532db0286 100644 --- a/arch/score/include/asm/poll.h +++ b/arch/score/include/uapi/asm/poll.h diff --git a/arch/score/include/asm/posix_types.h b/arch/score/include/uapi/asm/posix_types.h index b88acf80048..b88acf80048 100644 --- a/arch/score/include/asm/posix_types.h +++ b/arch/score/include/uapi/asm/posix_types.h diff --git a/arch/score/include/uapi/asm/ptrace.h b/arch/score/include/uapi/asm/ptrace.h new file mode 100644 index 00000000000..f59771a3f12 --- /dev/null +++ b/arch/score/include/uapi/asm/ptrace.h @@ -0,0 +1,76 @@ +#ifndef _UAPI_ASM_SCORE_PTRACE_H +#define _UAPI_ASM_SCORE_PTRACE_H + +#define PTRACE_GETREGS		12 +#define PTRACE_SETREGS		13 + +#define PC		32 +#define CONDITION	33 +#define ECR		34 +#define EMA		35 +#define CEH		36 +#define CEL		37 +#define COUNTER		38 +#define LDCR		39 +#define STCR		40 +#define PSR		41 + +#define SINGLESTEP16_INSN	0x7006 +#define SINGLESTEP32_INSN	0x840C8000 +#define BREAKPOINT16_INSN	0x7002		/* work on SPG300 */ +#define BREAKPOINT32_INSN	0x84048000	/* work on SPG300 */ + +/* Define instruction mask */ +#define INSN32_MASK	0x80008000 + +#define J32	0x88008000	/* 1_00010_0000000000_1_000000000000000 */ +#define J32M	0xFC008000	/* 1_11111_0000000000_1_000000000000000 */ + +#define B32	0x90008000	/* 1_00100_0000000000_1_000000000000000 */ +#define B32M	0xFC008000 +#define BL32	0x90008001	/* 1_00100_0000000000_1_000000000000001 */ +#define BL32M	B32 +#define BR32	0x80008008	/* 1_00000_0000000000_1_00000000_000100_0 */ +#define BR32M	0xFFE0807E +#define BRL32	0x80008009	/* 1_00000_0000000000_1_00000000_000100_1 */ +#define BRL32M	BR32M + +#define B32_SET	(J32 | B32 | BL32 | BR32 | BRL32) + +#define J16	0x3000		/* 0_011_....... */ +#define J16M	0xF000 +#define B16	0x4000		/* 0_100_....... */ +#define B16M	0xF000 +#define BR16	0x0004		/* 0_000.......0100 */ +#define BR16M	0xF00F +#define B16_SET (J16 | B16 | BR16) + + +/* + * This struct defines the way the registers are stored on the stack during a + * system call/exception. As usual the registers k0/k1 aren't being saved. + */ +struct pt_regs { +	unsigned long pad0[6];	/* stack arguments */ +	unsigned long orig_r4; +	unsigned long orig_r7; +	long is_syscall; + +	unsigned long regs[32]; + +	unsigned long cel; +	unsigned long ceh; + +	unsigned long sr0;	/* cnt */ +	unsigned long sr1;	/* lcr */ +	unsigned long sr2;	/* scr */ + +	unsigned long cp0_epc; +	unsigned long cp0_ema; +	unsigned long cp0_psr; +	unsigned long cp0_ecr; +	unsigned long cp0_condition; +}; + + +#endif /* _UAPI_ASM_SCORE_PTRACE_H */ diff --git a/arch/score/include/asm/resource.h b/arch/score/include/uapi/asm/resource.h index 9ce22bc7b47..9ce22bc7b47 100644 --- a/arch/score/include/asm/resource.h +++ b/arch/score/include/uapi/asm/resource.h diff --git a/arch/score/include/asm/sembuf.h b/arch/score/include/uapi/asm/sembuf.h index dae5e835ce9..dae5e835ce9 100644 --- a/arch/score/include/asm/sembuf.h +++ b/arch/score/include/uapi/asm/sembuf.h diff --git a/arch/score/include/uapi/asm/setup.h b/arch/score/include/uapi/asm/setup.h new file mode 100644 index 00000000000..ab9dbdb59bb --- /dev/null +++ b/arch/score/include/uapi/asm/setup.h @@ -0,0 +1,9 @@ +#ifndef _UAPI_ASM_SCORE_SETUP_H +#define _UAPI_ASM_SCORE_SETUP_H + +#define COMMAND_LINE_SIZE	256 +#define MEMORY_START		0 +#define MEMORY_SIZE		0x2000000 + + +#endif /* _UAPI_ASM_SCORE_SETUP_H */ diff --git a/arch/score/include/asm/shmbuf.h b/arch/score/include/uapi/asm/shmbuf.h index c85b2429ba2..c85b2429ba2 100644 --- a/arch/score/include/asm/shmbuf.h +++ b/arch/score/include/uapi/asm/shmbuf.h diff --git a/arch/score/include/asm/sigcontext.h b/arch/score/include/uapi/asm/sigcontext.h index 5ffda39ddb9..5ffda39ddb9 100644 --- a/arch/score/include/asm/sigcontext.h +++ b/arch/score/include/uapi/asm/sigcontext.h diff --git a/arch/score/include/asm/siginfo.h b/arch/score/include/uapi/asm/siginfo.h index 87ca35607a2..87ca35607a2 100644 --- a/arch/score/include/asm/siginfo.h +++ b/arch/score/include/uapi/asm/siginfo.h diff --git a/arch/score/include/asm/signal.h b/arch/score/include/uapi/asm/signal.h index 2605bc06b64..2605bc06b64 100644 --- a/arch/score/include/asm/signal.h +++ b/arch/score/include/uapi/asm/signal.h diff --git a/arch/score/include/asm/socket.h b/arch/score/include/uapi/asm/socket.h index 612a70e385b..612a70e385b 100644 --- a/arch/score/include/asm/socket.h +++ b/arch/score/include/uapi/asm/socket.h diff --git a/arch/score/include/asm/sockios.h b/arch/score/include/uapi/asm/sockios.h index ba825648018..ba825648018 100644 --- a/arch/score/include/asm/sockios.h +++ b/arch/score/include/uapi/asm/sockios.h diff --git a/arch/score/include/asm/stat.h b/arch/score/include/uapi/asm/stat.h index 5037055500a..5037055500a 100644 --- a/arch/score/include/asm/stat.h +++ b/arch/score/include/uapi/asm/stat.h diff --git a/arch/score/include/asm/statfs.h b/arch/score/include/uapi/asm/statfs.h index 36e41004e99..36e41004e99 100644 --- a/arch/score/include/asm/statfs.h +++ b/arch/score/include/uapi/asm/statfs.h diff --git a/arch/score/include/asm/swab.h b/arch/score/include/uapi/asm/swab.h index fadc3cc6d8a..fadc3cc6d8a 100644 --- a/arch/score/include/asm/swab.h +++ b/arch/score/include/uapi/asm/swab.h diff --git a/arch/score/include/asm/termbits.h b/arch/score/include/uapi/asm/termbits.h index 9a95c141243..9a95c141243 100644 --- a/arch/score/include/asm/termbits.h +++ b/arch/score/include/uapi/asm/termbits.h diff --git a/arch/score/include/asm/termios.h b/arch/score/include/uapi/asm/termios.h index 40984e811ad..40984e811ad 100644 --- a/arch/score/include/asm/termios.h +++ b/arch/score/include/uapi/asm/termios.h diff --git a/arch/score/include/asm/types.h b/arch/score/include/uapi/asm/types.h index 2140032778e..2140032778e 100644 --- a/arch/score/include/asm/types.h +++ b/arch/score/include/uapi/asm/types.h diff --git a/arch/score/include/asm/unistd.h b/arch/score/include/uapi/asm/unistd.h index 56001c93095..9cb4260a5f3 100644 --- a/arch/score/include/asm/unistd.h +++ b/arch/score/include/uapi/asm/unistd.h @@ -4,7 +4,6 @@  #define __ARCH_WANT_SYSCALL_NO_FLAGS  #define __ARCH_WANT_SYSCALL_OFF_T  #define __ARCH_WANT_SYSCALL_DEPRECATED -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_CLONE  #define __ARCH_WANT_SYS_FORK  #define __ARCH_WANT_SYS_VFORK diff --git a/arch/score/mm/cache.c b/arch/score/mm/cache.c index b25e9574360..f85ec1a7c88 100644 --- a/arch/score/mm/cache.c +++ b/arch/score/mm/cache.c @@ -113,7 +113,7 @@ static inline void setup_protection_map(void)  	protection_map[15] = PAGE_SHARED;  } -void __devinit cpu_cache_init(void) +void cpu_cache_init(void)  {  	setup_protection_map();  } diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 8451317eed5..babc2b826c5 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -40,8 +40,6 @@ config SUPERH  	select GENERIC_STRNLEN_USER  	select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER  	select MODULES_USE_ELF_RELA -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	help  	  The SuperH is a RISC processor targeted for use in embedded systems  	  and consumer electronics; it was also used in the Sega Dreamcast diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 3fede4556c9..a0fa5791cd4 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c @@ -70,6 +70,16 @@   *                                  OFF-ON : MMC   */ +/* + * FSI - DA7210 + * + * it needs amixer settings for playing + * + * amixer set 'HeadPhone' 80 + * amixer set 'Out Mixer Left DAC Left' on + * amixer set 'Out Mixer Right DAC Right' on + */ +  /* Heartbeat */  static unsigned char led_pos[] = { 0, 1, 2, 3 }; diff --git a/arch/sh/drivers/pci/fixups-dreamcast.c b/arch/sh/drivers/pci/fixups-dreamcast.c index a5fe1b54c95..d6cde700e31 100644 --- a/arch/sh/drivers/pci/fixups-dreamcast.c +++ b/arch/sh/drivers/pci/fixups-dreamcast.c @@ -28,7 +28,7 @@  #include <asm/irq.h>  #include <mach/pci.h> -static void __devinit gapspci_fixup_resources(struct pci_dev *dev) +static void gapspci_fixup_resources(struct pci_dev *dev)  {  	struct pci_channel *p = dev->sysdata; diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index 81e5dafed3e..102f5d58b03 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c @@ -32,7 +32,7 @@ static struct pci_channel *hose_head, **hose_tail = &hose_head;  static int pci_initialized; -static void __devinit pcibios_scanbus(struct pci_channel *hose) +static void pcibios_scanbus(struct pci_channel *hose)  {  	static int next_busno;  	static int need_domain_info; @@ -82,7 +82,7 @@ static void __devinit pcibios_scanbus(struct pci_channel *hose)  DEFINE_RAW_SPINLOCK(pci_config_lock);  static DEFINE_MUTEX(pci_scan_mutex); -int __devinit register_pci_controller(struct pci_channel *hose) +int register_pci_controller(struct pci_channel *hose)  {  	int i; @@ -156,7 +156,7 @@ subsys_initcall(pcibios_init);   *  Called after each bus is probed, but before its children   *  are examined.   */ -void __devinit pcibios_fixup_bus(struct pci_bus *bus) +void pcibios_fixup_bus(struct pci_bus *bus)  {  } diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c index 9e702f2f804..c2c85f6cd73 100644 --- a/arch/sh/drivers/pci/pcie-sh7786.c +++ b/arch/sh/drivers/pci/pcie-sh7786.c @@ -132,7 +132,7 @@ static struct clk fixed_pciexclkp = {  	.rate = 100000000,	/* 100 MHz reference clock */  }; -static void __devinit sh7786_pci_fixup(struct pci_dev *dev) +static void sh7786_pci_fixup(struct pci_dev *dev)  {  	/*  	 * Prevent enumeration of root complex resources. diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h index 8bd965e00a1..b437f2c780b 100644 --- a/arch/sh/include/asm/dma-mapping.h +++ b/arch/sh/include/asm/dma-mapping.h @@ -46,6 +46,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)  {  	struct dma_map_ops *ops = get_dma_ops(dev); +	debug_dma_mapping_error(dev, dma_addr);  	if (ops->mapping_error)  		return ops->mapping_error(dev, dma_addr); diff --git a/arch/sh/include/asm/elf.h b/arch/sh/include/asm/elf.h index 37924afa8d8..bf9f44f17c2 100644 --- a/arch/sh/include/asm/elf.h +++ b/arch/sh/include/asm/elf.h @@ -203,9 +203,9 @@ extern void __kernel_vsyscall;  	if (vdso_enabled)					\  		NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE);	\  	else							\ -		NEW_AUX_ENT(AT_IGNORE, 0); +		NEW_AUX_ENT(AT_IGNORE, 0)  #else -#define VSYSCALL_AUX_ENT +#define VSYSCALL_AUX_ENT	NEW_AUX_ENT(AT_IGNORE, 0)  #endif /* CONFIG_VSYSCALL */  #ifdef CONFIG_SH_FPU diff --git a/arch/sh/include/asm/processor_32.h b/arch/sh/include/asm/processor_32.h index b1320d55ca3..e699a12cdcc 100644 --- a/arch/sh/include/asm/processor_32.h +++ b/arch/sh/include/asm/processor_32.h @@ -39,7 +39,7 @@  /* This decides where the kernel will search for a free chunk of vm   * space during mmap's.   */ -#define TASK_UNMAPPED_BASE	(TASK_SIZE / 3) +#define TASK_UNMAPPED_BASE	PAGE_ALIGN(TASK_SIZE / 3)  /*   * Bit of SR register diff --git a/arch/sh/include/asm/processor_64.h b/arch/sh/include/asm/processor_64.h index 1ee8946f095..1cc7d319714 100644 --- a/arch/sh/include/asm/processor_64.h +++ b/arch/sh/include/asm/processor_64.h @@ -47,7 +47,7 @@ pc; })  /* This decides where the kernel will search for a free chunk of vm   * space during mmap's.   */ -#define TASK_UNMAPPED_BASE	(TASK_SIZE / 3) +#define TASK_UNMAPPED_BASE	PAGE_ALIGN(TASK_SIZE / 3)  /*   * Bit of SR register diff --git a/arch/sh/include/asm/unistd.h b/arch/sh/include/asm/unistd.h index 43d3f26b2ea..012004ed333 100644 --- a/arch/sh/include/asm/unistd.h +++ b/arch/sh/include/asm/unistd.h @@ -28,7 +28,6 @@  # define __ARCH_WANT_SYS_SIGPENDING  # define __ARCH_WANT_SYS_SIGPROCMASK  # define __ARCH_WANT_SYS_RT_SIGACTION -# define __ARCH_WANT_SYS_EXECVE  # define __ARCH_WANT_SYS_FORK  # define __ARCH_WANT_SYS_VFORK  # define __ARCH_WANT_SYS_CLONE diff --git a/arch/sh/include/uapi/asm/unistd_32.h b/arch/sh/include/uapi/asm/unistd_32.h index 9e465f246dc..d13a1d62373 100644 --- a/arch/sh/include/uapi/asm/unistd_32.h +++ b/arch/sh/include/uapi/asm/unistd_32.h @@ -379,7 +379,8 @@  #define __NR_process_vm_readv	365  #define __NR_process_vm_writev	366  #define __NR_kcmp		367 +#define __NR_finit_module	368 -#define NR_syscalls 368 +#define NR_syscalls 369  #endif /* __ASM_SH_UNISTD_32_H */ diff --git a/arch/sh/include/uapi/asm/unistd_64.h b/arch/sh/include/uapi/asm/unistd_64.h index 8e3a2edd284..e6820c86e8c 100644 --- a/arch/sh/include/uapi/asm/unistd_64.h +++ b/arch/sh/include/uapi/asm/unistd_64.h @@ -399,7 +399,8 @@  #define __NR_process_vm_readv	376  #define __NR_process_vm_writev	377  #define __NR_kcmp		378 +#define __NR_finit_module	379 -#define NR_syscalls 379 +#define NR_syscalls 380  #endif /* __ASM_SH_UNISTD_64_H */ diff --git a/arch/sh/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S index fe97ae5e56f..734234be2f0 100644 --- a/arch/sh/kernel/syscalls_32.S +++ b/arch/sh/kernel/syscalls_32.S @@ -385,3 +385,4 @@ ENTRY(sys_call_table)  	.long sys_process_vm_readv	/* 365 */  	.long sys_process_vm_writev  	.long sys_kcmp +	.long sys_finit_module diff --git a/arch/sh/kernel/syscalls_64.S b/arch/sh/kernel/syscalls_64.S index 5c7b1c67bdc..579fcb9a896 100644 --- a/arch/sh/kernel/syscalls_64.S +++ b/arch/sh/kernel/syscalls_64.S @@ -405,3 +405,4 @@ sys_call_table:  	.long sys_process_vm_readv  	.long sys_process_vm_writev  	.long sys_kcmp +	.long sys_finit_module diff --git a/arch/sh/lib/mcount.S b/arch/sh/lib/mcount.S index 60164e65d66..52aa2011d75 100644 --- a/arch/sh/lib/mcount.S +++ b/arch/sh/lib/mcount.S @@ -294,6 +294,8 @@ stack_panic:  	.align 2  .L_init_thread_union:  	.long	init_thread_union +.L_ebss: +	.long	__bss_stop  .Lpanic:  	.long	panic  .Lpanic_s: diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 0c7d365fa40..9f2edb5c555 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -41,8 +41,6 @@ config SPARC  	select GENERIC_STRNCPY_FROM_USER  	select GENERIC_STRNLEN_USER  	select MODULES_USE_ELF_RELA -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  config SPARC32  	def_bool !64BIT diff --git a/arch/sparc/crypto/aes_asm.S b/arch/sparc/crypto/aes_asm.S index 23f6cbb910d..1cda8aa7cb8 100644 --- a/arch/sparc/crypto/aes_asm.S +++ b/arch/sparc/crypto/aes_asm.S @@ -1024,7 +1024,11 @@ ENTRY(aes_sparc64_ecb_encrypt_256)  	 add		%o2, 0x20, %o2  	brlz,pt		%o3, 11f  	 nop -10:	ldx		[%o1 + 0x00], %g3 +10:	ldd		[%o0 + 0xd0], %f56 +	ldd		[%o0 + 0xd8], %f58 +	ldd		[%o0 + 0xe0], %f60 +	ldd		[%o0 + 0xe8], %f62 +	ldx		[%o1 + 0x00], %g3  	ldx		[%o1 + 0x08], %g7  	xor		%g1, %g3, %g3  	xor		%g2, %g7, %g7 @@ -1128,9 +1132,9 @@ ENTRY(aes_sparc64_ecb_decrypt_256)  	/* %o0=&key[key_len], %o1=input, %o2=output, %o3=len */  	ldx		[%o0 - 0x10], %g1  	subcc		%o3, 0x10, %o3 +	ldx		[%o0 - 0x08], %g2  	be		10f -	 ldx		[%o0 - 0x08], %g2 -	sub		%o0, 0xf0, %o0 +	 sub		%o0, 0xf0, %o0  1:	ldx		[%o1 + 0x00], %g3  	ldx		[%o1 + 0x08], %g7  	ldx		[%o1 + 0x10], %o4 @@ -1154,7 +1158,11 @@ ENTRY(aes_sparc64_ecb_decrypt_256)  	 add		%o2, 0x20, %o2  	brlz,pt		%o3, 11f  	 nop -10:	ldx		[%o1 + 0x00], %g3 +10:	ldd		[%o0 + 0x18], %f56 +	ldd		[%o0 + 0x10], %f58 +	ldd		[%o0 + 0x08], %f60 +	ldd		[%o0 + 0x00], %f62 +	ldx		[%o1 + 0x00], %g3  	ldx		[%o1 + 0x08], %g7  	xor		%g1, %g3, %g3  	xor		%g2, %g7, %g7 @@ -1511,11 +1519,11 @@ ENTRY(aes_sparc64_ctr_crypt_256)  	 add		%o2, 0x20, %o2  	brlz,pt		%o3, 11f  	 nop -	ldd		[%o0 + 0xd0], %f56 +10:	ldd		[%o0 + 0xd0], %f56  	ldd		[%o0 + 0xd8], %f58  	ldd		[%o0 + 0xe0], %f60  	ldd		[%o0 + 0xe8], %f62 -10:	xor		%g1, %g3, %o5 +	xor		%g1, %g3, %o5  	MOVXTOD_O5_F0  	xor		%g2, %g7, %o5  	MOVXTOD_O5_F2 diff --git a/arch/sparc/crypto/aes_glue.c b/arch/sparc/crypto/aes_glue.c index 3965d1d36df..503e6d96ad4 100644 --- a/arch/sparc/crypto/aes_glue.c +++ b/arch/sparc/crypto/aes_glue.c @@ -222,6 +222,7 @@ static int ecb_encrypt(struct blkcipher_desc *desc,  	blkcipher_walk_init(&walk, dst, src, nbytes);  	err = blkcipher_walk_virt(desc, &walk); +	desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;  	ctx->ops->load_encrypt_keys(&ctx->key[0]);  	while ((nbytes = walk.nbytes)) { @@ -251,6 +252,7 @@ static int ecb_decrypt(struct blkcipher_desc *desc,  	blkcipher_walk_init(&walk, dst, src, nbytes);  	err = blkcipher_walk_virt(desc, &walk); +	desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;  	ctx->ops->load_decrypt_keys(&ctx->key[0]);  	key_end = &ctx->key[ctx->expanded_key_length / sizeof(u64)]; @@ -280,6 +282,7 @@ static int cbc_encrypt(struct blkcipher_desc *desc,  	blkcipher_walk_init(&walk, dst, src, nbytes);  	err = blkcipher_walk_virt(desc, &walk); +	desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;  	ctx->ops->load_encrypt_keys(&ctx->key[0]);  	while ((nbytes = walk.nbytes)) { @@ -309,6 +312,7 @@ static int cbc_decrypt(struct blkcipher_desc *desc,  	blkcipher_walk_init(&walk, dst, src, nbytes);  	err = blkcipher_walk_virt(desc, &walk); +	desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;  	ctx->ops->load_decrypt_keys(&ctx->key[0]);  	key_end = &ctx->key[ctx->expanded_key_length / sizeof(u64)]; @@ -329,6 +333,22 @@ static int cbc_decrypt(struct blkcipher_desc *desc,  	return err;  } +static void ctr_crypt_final(struct crypto_sparc64_aes_ctx *ctx, +			    struct blkcipher_walk *walk) +{ +	u8 *ctrblk = walk->iv; +	u64 keystream[AES_BLOCK_SIZE / sizeof(u64)]; +	u8 *src = walk->src.virt.addr; +	u8 *dst = walk->dst.virt.addr; +	unsigned int nbytes = walk->nbytes; + +	ctx->ops->ecb_encrypt(&ctx->key[0], (const u64 *)ctrblk, +			      keystream, AES_BLOCK_SIZE); +	crypto_xor((u8 *) keystream, src, nbytes); +	memcpy(dst, keystream, nbytes); +	crypto_inc(ctrblk, AES_BLOCK_SIZE); +} +  static int ctr_crypt(struct blkcipher_desc *desc,  		     struct scatterlist *dst, struct scatterlist *src,  		     unsigned int nbytes) @@ -338,10 +358,11 @@ static int ctr_crypt(struct blkcipher_desc *desc,  	int err;  	blkcipher_walk_init(&walk, dst, src, nbytes); -	err = blkcipher_walk_virt(desc, &walk); +	err = blkcipher_walk_virt_block(desc, &walk, AES_BLOCK_SIZE); +	desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;  	ctx->ops->load_encrypt_keys(&ctx->key[0]); -	while ((nbytes = walk.nbytes)) { +	while ((nbytes = walk.nbytes) >= AES_BLOCK_SIZE) {  		unsigned int block_len = nbytes & AES_BLOCK_MASK;  		if (likely(block_len)) { @@ -353,6 +374,10 @@ static int ctr_crypt(struct blkcipher_desc *desc,  		nbytes &= AES_BLOCK_SIZE - 1;  		err = blkcipher_walk_done(desc, &walk, nbytes);  	} +	if (walk.nbytes) { +		ctr_crypt_final(ctx, &walk); +		err = blkcipher_walk_done(desc, &walk, 0); +	}  	fprs_write(0);  	return err;  } @@ -418,7 +443,7 @@ static struct crypto_alg algs[] = { {  	.cra_driver_name	= "ctr-aes-sparc64",  	.cra_priority		= SPARC_CR_OPCODE_PRIORITY,  	.cra_flags		= CRYPTO_ALG_TYPE_BLKCIPHER, -	.cra_blocksize		= AES_BLOCK_SIZE, +	.cra_blocksize		= 1,  	.cra_ctxsize		= sizeof(struct crypto_sparc64_aes_ctx),  	.cra_alignmask		= 7,  	.cra_type		= &crypto_blkcipher_type, diff --git a/arch/sparc/crypto/camellia_glue.c b/arch/sparc/crypto/camellia_glue.c index 62c89af3fd3..888f6260b4e 100644 --- a/arch/sparc/crypto/camellia_glue.c +++ b/arch/sparc/crypto/camellia_glue.c @@ -98,6 +98,7 @@ static int __ecb_crypt(struct blkcipher_desc *desc,  	blkcipher_walk_init(&walk, dst, src, nbytes);  	err = blkcipher_walk_virt(desc, &walk); +	desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;  	if (encrypt)  		key = &ctx->encrypt_key[0]; @@ -160,6 +161,7 @@ static int cbc_encrypt(struct blkcipher_desc *desc,  	blkcipher_walk_init(&walk, dst, src, nbytes);  	err = blkcipher_walk_virt(desc, &walk); +	desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;  	key = &ctx->encrypt_key[0];  	camellia_sparc64_load_keys(key, ctx->key_len); @@ -198,6 +200,7 @@ static int cbc_decrypt(struct blkcipher_desc *desc,  	blkcipher_walk_init(&walk, dst, src, nbytes);  	err = blkcipher_walk_virt(desc, &walk); +	desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;  	key = &ctx->decrypt_key[0];  	camellia_sparc64_load_keys(key, ctx->key_len); diff --git a/arch/sparc/crypto/des_asm.S b/arch/sparc/crypto/des_asm.S index 30b6e90b28b..b5c8fc269b5 100644 --- a/arch/sparc/crypto/des_asm.S +++ b/arch/sparc/crypto/des_asm.S @@ -376,6 +376,7 @@ ENTRY(des3_ede_sparc64_ecb_crypt)  1:	ldd	[%o1 + 0x00], %f60  	DES3_LOOP_BODY(60)  	std	%f60, [%o2 + 0x00] +	add	%o1, 0x08, %o1  	subcc	%o3, 0x08, %o3  	bne,pt	%icc, 1b  	 add	%o2, 0x08, %o2 diff --git a/arch/sparc/crypto/des_glue.c b/arch/sparc/crypto/des_glue.c index 41524cebcc4..3065bc61f9d 100644 --- a/arch/sparc/crypto/des_glue.c +++ b/arch/sparc/crypto/des_glue.c @@ -100,6 +100,7 @@ static int __ecb_crypt(struct blkcipher_desc *desc,  	blkcipher_walk_init(&walk, dst, src, nbytes);  	err = blkcipher_walk_virt(desc, &walk); +	desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;  	if (encrypt)  		des_sparc64_load_keys(&ctx->encrypt_expkey[0]); @@ -147,6 +148,7 @@ static int cbc_encrypt(struct blkcipher_desc *desc,  	blkcipher_walk_init(&walk, dst, src, nbytes);  	err = blkcipher_walk_virt(desc, &walk); +	desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;  	des_sparc64_load_keys(&ctx->encrypt_expkey[0]);  	while ((nbytes = walk.nbytes)) { @@ -177,6 +179,7 @@ static int cbc_decrypt(struct blkcipher_desc *desc,  	blkcipher_walk_init(&walk, dst, src, nbytes);  	err = blkcipher_walk_virt(desc, &walk); +	desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;  	des_sparc64_load_keys(&ctx->decrypt_expkey[0]);  	while ((nbytes = walk.nbytes)) { @@ -266,6 +269,7 @@ static int __ecb3_crypt(struct blkcipher_desc *desc,  	blkcipher_walk_init(&walk, dst, src, nbytes);  	err = blkcipher_walk_virt(desc, &walk); +	desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;  	if (encrypt)  		K = &ctx->encrypt_expkey[0]; @@ -317,6 +321,7 @@ static int cbc3_encrypt(struct blkcipher_desc *desc,  	blkcipher_walk_init(&walk, dst, src, nbytes);  	err = blkcipher_walk_virt(desc, &walk); +	desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;  	K = &ctx->encrypt_expkey[0];  	des3_ede_sparc64_load_keys(K); @@ -352,6 +357,7 @@ static int cbc3_decrypt(struct blkcipher_desc *desc,  	blkcipher_walk_init(&walk, dst, src, nbytes);  	err = blkcipher_walk_virt(desc, &walk); +	desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;  	K = &ctx->decrypt_expkey[0];  	des3_ede_sparc64_load_keys(K); diff --git a/arch/sparc/include/asm/dma-mapping.h b/arch/sparc/include/asm/dma-mapping.h index 8493fd3c7ba..05fe53f5346 100644 --- a/arch/sparc/include/asm/dma-mapping.h +++ b/arch/sparc/include/asm/dma-mapping.h @@ -59,6 +59,7 @@ static inline void dma_free_attrs(struct device *dev, size_t size,  static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)  { +	debug_dma_mapping_error(dev, dma_addr);  	return (dma_addr == DMA_ERROR_CODE);  } diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h index 8c5eed6d267..9661e9bc7bb 100644 --- a/arch/sparc/include/asm/hugetlb.h +++ b/arch/sparc/include/asm/hugetlb.h @@ -61,14 +61,20 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)  static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,  					   unsigned long addr, pte_t *ptep)  { -	ptep_set_wrprotect(mm, addr, ptep); +	pte_t old_pte = *ptep; +	set_huge_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));  }  static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,  					     unsigned long addr, pte_t *ptep,  					     pte_t pte, int dirty)  { -	return ptep_set_access_flags(vma, addr, ptep, pte, dirty); +	int changed = !pte_same(*ptep, pte); +	if (changed) { +		set_huge_pte_at(vma->vm_mm, addr, ptep, pte); +		flush_tlb_page(vma, addr); +	} +	return changed;  }  static inline pte_t huge_ptep_get(pte_t *ptep) diff --git a/arch/sparc/include/asm/parport.h b/arch/sparc/include/asm/parport.h index cb33608cc68..c55291e5b83 100644 --- a/arch/sparc/include/asm/parport.h +++ b/arch/sparc/include/asm/parport.h @@ -103,7 +103,7 @@ static inline unsigned int get_dma_residue(unsigned int dmanr)  	return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info);  } -static int __devinit ecpp_probe(struct platform_device *op) +static int ecpp_probe(struct platform_device *op)  {  	unsigned long base = op->resource[0].start;  	unsigned long config = op->resource[1].start; @@ -192,7 +192,7 @@ out_err:  	return err;  } -static int __devexit ecpp_remove(struct platform_device *op) +static int ecpp_remove(struct platform_device *op)  {  	struct parport *p = dev_get_drvdata(&op->dev);  	int slot = p->dma; @@ -242,7 +242,7 @@ static struct platform_driver ecpp_driver = {  		.of_match_table = ecpp_match,  	},  	.probe			= ecpp_probe, -	.remove			= __devexit_p(ecpp_remove), +	.remove			= ecpp_remove,  };  static int parport_pc_find_nonpci_ports(int autoirq, int autodma) diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h index 95515f1e7ce..7870be0f5ad 100644 --- a/arch/sparc/include/asm/pgtable_64.h +++ b/arch/sparc/include/asm/pgtable_64.h @@ -617,6 +617,12 @@ static inline unsigned long pte_present(pte_t pte)  	return val;  } +#define pte_accessible pte_accessible +static inline unsigned long pte_accessible(pte_t a) +{ +	return pte_val(a) & _PAGE_VALID; +} +  static inline unsigned long pte_special(pte_t pte)  {  	return pte_val(pte) & _PAGE_SPECIAL; @@ -802,7 +808,7 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,  	 * SUN4V NOTE: _PAGE_VALID is the same value in both the SUN4U  	 *             and SUN4V pte layout, so this inline test is fine.  	 */ -	if (likely(mm != &init_mm) && (pte_val(orig) & _PAGE_VALID)) +	if (likely(mm != &init_mm) && pte_accessible(orig))  		tlb_batch_add(mm, addr, ptep, orig, fullmm);  } diff --git a/arch/sparc/include/asm/timer_64.h b/arch/sparc/include/asm/timer_64.h index ef3c3682deb..01197d8215c 100644 --- a/arch/sparc/include/asm/timer_64.h +++ b/arch/sparc/include/asm/timer_64.h @@ -24,7 +24,7 @@ struct sparc64_tick_ops {  extern struct sparc64_tick_ops *tick_ops;  extern unsigned long sparc64_get_clock_tick(unsigned int cpu); -extern void __devinit setup_sparc64_timer(void); +extern void setup_sparc64_timer(void);  extern void __init time_init(void);  #endif /* _SPARC64_TIMER_H */ diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h index 497386a7ed2..87ce24c5eb9 100644 --- a/arch/sparc/include/asm/unistd.h +++ b/arch/sparc/include/asm/unistd.h @@ -47,7 +47,6 @@  #define __ARCH_WANT_COMPAT_SYS_SENDFILE  #define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL  #endif -#define __ARCH_WANT_SYS_EXECVE  /*   * "Conditional" syscalls diff --git a/arch/sparc/include/uapi/asm/signal.h b/arch/sparc/include/uapi/asm/signal.h index 1a041892538..c4ffd6c9710 100644 --- a/arch/sparc/include/uapi/asm/signal.h +++ b/arch/sparc/include/uapi/asm/signal.h @@ -147,12 +147,6 @@ struct sigstack {  #define SIG_UNBLOCK        0x02	/* for unblocking signals */  #define SIG_SETMASK        0x04	/* for setting the signal mask */ -/* - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 -  #define MINSIGSTKSZ	4096  #define SIGSTKSZ	16384 diff --git a/arch/sparc/include/uapi/asm/unistd.h b/arch/sparc/include/uapi/asm/unistd.h index cac719d1bc5..62ced589bcf 100644 --- a/arch/sparc/include/uapi/asm/unistd.h +++ b/arch/sparc/include/uapi/asm/unistd.h @@ -407,8 +407,9 @@  #define __NR_process_vm_writev	339  #define __NR_kern_features	340  #define __NR_kcmp		341 +#define __NR_finit_module	342 -#define NR_syscalls		342 +#define NR_syscalls		343  /* Bitmask values returned from kern_features system call.  */  #define KERN_FEATURE_MIXED_MODE_STACK	0x00000001 diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c index 812e10bbb0b..348fa1aeabc 100644 --- a/arch/sparc/kernel/apc.c +++ b/arch/sparc/kernel/apc.c @@ -31,7 +31,7 @@  #define APC_DEVNAME "apc"  static u8 __iomem *regs; -static int apc_no_idle __devinitdata = 0; +static int apc_no_idle = 0;  #define apc_readb(offs)		(sbus_readb(regs+offs))  #define apc_writeb(val, offs) 	(sbus_writeb(val, regs+offs)) @@ -138,7 +138,7 @@ static const struct file_operations apc_fops = {  static struct miscdevice apc_miscdev = { APC_MINOR, APC_DEVNAME, &apc_fops }; -static int __devinit apc_probe(struct platform_device *op) +static int apc_probe(struct platform_device *op)  {  	int err; diff --git a/arch/sparc/kernel/auxio_64.c b/arch/sparc/kernel/auxio_64.c index 773091ac71a..86e55778e4a 100644 --- a/arch/sparc/kernel/auxio_64.c +++ b/arch/sparc/kernel/auxio_64.c @@ -102,7 +102,7 @@ static const struct of_device_id auxio_match[] = {  MODULE_DEVICE_TABLE(of, auxio_match); -static int __devinit auxio_probe(struct platform_device *dev) +static int auxio_probe(struct platform_device *dev)  {  	struct device_node *dp = dev->dev.of_node;  	unsigned long size; diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c index 9708851a8b9..052b5a44318 100644 --- a/arch/sparc/kernel/central.c +++ b/arch/sparc/kernel/central.c @@ -33,7 +33,7 @@ struct fhc {  	struct platform_device	leds_pdev;  }; -static int __devinit clock_board_calc_nslots(struct clock_board *p) +static int clock_board_calc_nslots(struct clock_board *p)  {  	u8 reg = upa_readb(p->clock_regs + CLOCK_STAT1) & 0xc0; @@ -60,7 +60,7 @@ static int __devinit clock_board_calc_nslots(struct clock_board *p)  	}  } -static int __devinit clock_board_probe(struct platform_device *op) +static int clock_board_probe(struct platform_device *op)  {  	struct clock_board *p = kzalloc(sizeof(*p), GFP_KERNEL);  	int err = -ENOMEM; @@ -157,7 +157,7 @@ static struct platform_driver clock_board_driver = {  	},  }; -static int __devinit fhc_probe(struct platform_device *op) +static int fhc_probe(struct platform_device *op)  {  	struct fhc *p = kzalloc(sizeof(*p), GFP_KERNEL);  	int err = -ENOMEM; diff --git a/arch/sparc/kernel/chmc.c b/arch/sparc/kernel/chmc.c index 5f450260981..dbb210d74e2 100644 --- a/arch/sparc/kernel/chmc.c +++ b/arch/sparc/kernel/chmc.c @@ -336,9 +336,9 @@ static int jbusmc_print_dimm(int syndrome_code,  	return 0;  } -static u64 __devinit jbusmc_dimm_group_size(u64 base, -					    const struct linux_prom64_registers *mem_regs, -					    int num_mem_regs) +static u64 jbusmc_dimm_group_size(u64 base, +				  const struct linux_prom64_registers *mem_regs, +				  int num_mem_regs)  {  	u64 max = base + (8UL * 1024 * 1024 * 1024);  	u64 max_seen = base; @@ -363,10 +363,10 @@ static u64 __devinit jbusmc_dimm_group_size(u64 base,  	return max_seen - base;  } -static void __devinit jbusmc_construct_one_dimm_group(struct jbusmc *p, -						      unsigned long index, -						      const struct linux_prom64_registers *mem_regs, -						      int num_mem_regs) +static void jbusmc_construct_one_dimm_group(struct jbusmc *p, +					    unsigned long index, +					    const struct linux_prom64_registers *mem_regs, +					    int num_mem_regs)  {  	struct jbusmc_dimm_group *dp = &p->dimm_groups[index]; @@ -378,9 +378,9 @@ static void __devinit jbusmc_construct_one_dimm_group(struct jbusmc *p,  	dp->size = jbusmc_dimm_group_size(dp->base_addr, mem_regs, num_mem_regs);  } -static void __devinit jbusmc_construct_dimm_groups(struct jbusmc *p, -						   const struct linux_prom64_registers *mem_regs, -						   int num_mem_regs) +static void jbusmc_construct_dimm_groups(struct jbusmc *p, +					 const struct linux_prom64_registers *mem_regs, +					 int num_mem_regs)  {  	if (p->mc_reg_1 & JB_MC_REG1_DIMM1_BANK0) {  		jbusmc_construct_one_dimm_group(p, 0, mem_regs, num_mem_regs); @@ -392,7 +392,7 @@ static void __devinit jbusmc_construct_dimm_groups(struct jbusmc *p,  	}  } -static int __devinit jbusmc_probe(struct platform_device *op) +static int jbusmc_probe(struct platform_device *op)  {  	const struct linux_prom64_registers *mem_regs;  	struct device_node *mem_node; @@ -689,7 +689,7 @@ static void chmc_fetch_decode_regs(struct chmc *p)  				      chmc_read_mcreg(p, CHMCTRL_DECODE4));  } -static int __devinit chmc_probe(struct platform_device *op) +static int chmc_probe(struct platform_device *op)  {  	struct device_node *dp = op->dev.of_node;  	unsigned long ver; @@ -763,7 +763,7 @@ out_free:  	goto out;  } -static int __devinit us3mc_probe(struct platform_device *op) +static int us3mc_probe(struct platform_device *op)  {  	if (mc_type == MC_TYPE_SAFARI)  		return chmc_probe(op); @@ -772,21 +772,21 @@ static int __devinit us3mc_probe(struct platform_device *op)  	return -ENODEV;  } -static void __devexit chmc_destroy(struct platform_device *op, struct chmc *p) +static void chmc_destroy(struct platform_device *op, struct chmc *p)  {  	list_del(&p->list);  	of_iounmap(&op->resource[0], p->regs, 0x48);  	kfree(p);  } -static void __devexit jbusmc_destroy(struct platform_device *op, struct jbusmc *p) +static void jbusmc_destroy(struct platform_device *op, struct jbusmc *p)  {  	mc_list_del(&p->list);  	of_iounmap(&op->resource[0], p->regs, JBUSMC_REGS_SIZE);  	kfree(p);  } -static int __devexit us3mc_remove(struct platform_device *op) +static int us3mc_remove(struct platform_device *op)  {  	void *p = dev_get_drvdata(&op->dev); @@ -814,7 +814,7 @@ static struct platform_driver us3mc_driver = {  		.of_match_table = us3mc_match,  	},  	.probe		= us3mc_probe, -	.remove		= __devexit_p(us3mc_remove), +	.remove		= us3mc_remove,  };  static inline bool us3mc_platform(void) diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index f09257c8610..75bb608c423 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c @@ -29,7 +29,7 @@  #define DRV_MODULE_VERSION	"1.0"  #define DRV_MODULE_RELDATE	"Jul 11, 2007" -static char version[] __devinitdata = +static char version[] =  	DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";  MODULE_AUTHOR("David S. Miller (davem@davemloft.net)");  MODULE_DESCRIPTION("Sun LDOM domain services driver"); @@ -1146,8 +1146,7 @@ static void ds_event(void *arg, int event)  	spin_unlock_irqrestore(&ds_lock, flags);  } -static int __devinit ds_probe(struct vio_dev *vdev, -			      const struct vio_device_id *id) +static int ds_probe(struct vio_dev *vdev, const struct vio_device_id *id)  {  	static int ds_version_printed;  	struct ldc_channel_config ds_cfg = { diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c index 81d92fc9983..9fcc6b4e93b 100644 --- a/arch/sparc/kernel/ldc.c +++ b/arch/sparc/kernel/ldc.c @@ -27,7 +27,7 @@  #define DRV_MODULE_VERSION	"1.1"  #define DRV_MODULE_RELDATE	"July 22, 2008" -static char version[] __devinitdata = +static char version[] =  	DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";  #define LDC_PACKET_SIZE		64 diff --git a/arch/sparc/kernel/leon_pci.c b/arch/sparc/kernel/leon_pci.c index fc052116156..852dc843052 100644 --- a/arch/sparc/kernel/leon_pci.c +++ b/arch/sparc/kernel/leon_pci.c @@ -43,7 +43,7 @@ void leon_pci_init(struct platform_device *ofdev, struct leon_pci_info *info)  	}  } -void __devinit pcibios_fixup_bus(struct pci_bus *pbus) +void pcibios_fixup_bus(struct pci_bus *pbus)  {  	struct pci_dev *dev;  	int i, has_io, has_mem; diff --git a/arch/sparc/kernel/leon_pci_grpci2.c b/arch/sparc/kernel/leon_pci_grpci2.c index b1bc38853a3..fc4320886a3 100644 --- a/arch/sparc/kernel/leon_pci_grpci2.c +++ b/arch/sparc/kernel/leon_pci_grpci2.c @@ -668,7 +668,7 @@ static irqreturn_t grpci2_err_interrupt(int irq, void *arg)  	return IRQ_HANDLED;  } -static int __devinit grpci2_of_probe(struct platform_device *ofdev) +static int grpci2_of_probe(struct platform_device *ofdev)  {  	struct grpci2_regs *regs;  	struct grpci2_priv *priv; diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c index f1ddc0d2367..4435488ebe2 100644 --- a/arch/sparc/kernel/module.c +++ b/arch/sparc/kernel/module.c @@ -43,10 +43,6 @@ void *module_alloc(unsigned long size)  {  	void *ret; -	/* We handle the zero case fine, unlike vmalloc */ -	if (size == 0) -		return NULL; -  	ret = module_map(size);  	if (ret)  		memset(ret, 0, size); diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 75b31bcdead..baf4366e2d6 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c @@ -356,7 +356,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,  	return dev;  } -static void __devinit apb_calc_first_last(u8 map, u32 *first_p, u32 *last_p) +static void apb_calc_first_last(u8 map, u32 *first_p, u32 *last_p)  {  	u32 idx, first, last; @@ -378,9 +378,9 @@ static void __devinit apb_calc_first_last(u8 map, u32 *first_p, u32 *last_p)  /* Cook up fake bus resources for SUNW,simba PCI bridges which lack   * a proper 'ranges' property.   */ -static void __devinit apb_fake_ranges(struct pci_dev *dev, -				      struct pci_bus *bus, -				      struct pci_pbm_info *pbm) +static void apb_fake_ranges(struct pci_dev *dev, +			    struct pci_bus *bus, +			    struct pci_pbm_info *pbm)  {  	struct pci_bus_region region;  	struct resource *res; @@ -404,15 +404,15 @@ static void __devinit apb_fake_ranges(struct pci_dev *dev,  	pcibios_bus_to_resource(dev, res, ®ion);  } -static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, -				      struct device_node *node, -				      struct pci_bus *bus); +static void pci_of_scan_bus(struct pci_pbm_info *pbm, +			    struct device_node *node, +			    struct pci_bus *bus);  #define GET_64BIT(prop, i)	((((u64) (prop)[(i)]) << 32) | (prop)[(i)+1]) -static void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm, -					 struct device_node *node, -					 struct pci_dev *dev) +static void of_scan_pci_bridge(struct pci_pbm_info *pbm, +			       struct device_node *node, +			       struct pci_dev *dev)  {  	struct pci_bus *bus;  	const u32 *busrange, *ranges; @@ -503,9 +503,9 @@ after_ranges:  	pci_of_scan_bus(pbm, node, bus);  } -static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, -				      struct device_node *node, -				      struct pci_bus *bus) +static void pci_of_scan_bus(struct pci_pbm_info *pbm, +			    struct device_node *node, +			    struct pci_bus *bus)  {  	struct device_node *child;  	const u32 *reg; @@ -564,7 +564,7 @@ show_pciobppath_attr(struct device * dev, struct device_attribute * attr, char *  static DEVICE_ATTR(obppath, S_IRUSR | S_IRGRP | S_IROTH, show_pciobppath_attr, NULL); -static void __devinit pci_bus_register_of_sysfs(struct pci_bus *bus) +static void pci_bus_register_of_sysfs(struct pci_bus *bus)  {  	struct pci_dev *dev;  	struct pci_bus *child_bus; @@ -585,8 +585,8 @@ static void __devinit pci_bus_register_of_sysfs(struct pci_bus *bus)  		pci_bus_register_of_sysfs(child_bus);  } -struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm, -					    struct device *parent) +struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm, +				 struct device *parent)  {  	LIST_HEAD(resources);  	struct device_node *node = pbm->op->dev.of_node; @@ -618,7 +618,7 @@ struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm,  	return bus;  } -void __devinit pcibios_fixup_bus(struct pci_bus *pbus) +void pcibios_fixup_bus(struct pci_bus *pbus)  {  } @@ -949,8 +949,7 @@ static int __init pcibios_init(void)  subsys_initcall(pcibios_init);  #ifdef CONFIG_SYSFS -static void __devinit pci_bus_slot_names(struct device_node *node, -					 struct pci_bus *bus) +static void pci_bus_slot_names(struct device_node *node, struct pci_bus *bus)  {  	const struct pci_slot_names {  		u32	slot_mask; diff --git a/arch/sparc/kernel/pci_fire.c b/arch/sparc/kernel/pci_fire.c index 188f935276f..e60fc6a67e9 100644 --- a/arch/sparc/kernel/pci_fire.c +++ b/arch/sparc/kernel/pci_fire.c @@ -408,8 +408,8 @@ static void pci_fire_hw_init(struct pci_pbm_info *pbm)  	upa_writeq(~(u64)0, pbm->pbm_regs + FIRE_PEC_IENAB);  } -static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm, -				       struct platform_device *op, u32 portid) +static int pci_fire_pbm_init(struct pci_pbm_info *pbm, +			     struct platform_device *op, u32 portid)  {  	const struct linux_prom64_registers *regs;  	struct device_node *dp = op->dev.of_node; @@ -454,7 +454,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm,  	return 0;  } -static int __devinit fire_probe(struct platform_device *op) +static int fire_probe(struct platform_device *op)  {  	struct device_node *dp = op->dev.of_node;  	struct pci_pbm_info *pbm; diff --git a/arch/sparc/kernel/pci_psycho.c b/arch/sparc/kernel/pci_psycho.c index f4d29e15ce7..c647634ead2 100644 --- a/arch/sparc/kernel/pci_psycho.c +++ b/arch/sparc/kernel/pci_psycho.c @@ -366,8 +366,8 @@ static void pbm_config_busmastering(struct pci_pbm_info *pbm)  	pci_config_write8(addr, 64);  } -static void __devinit psycho_scan_bus(struct pci_pbm_info *pbm, -				      struct device *parent) +static void psycho_scan_bus(struct pci_pbm_info *pbm, +			    struct device *parent)  {  	pbm_config_busmastering(pbm);  	pbm->is_66mhz_capable = 0; @@ -483,15 +483,15 @@ static void psycho_pbm_strbuf_init(struct pci_pbm_info *pbm,  #define PSYCHO_MEMSPACE_B	0x180000000UL  #define PSYCHO_MEMSPACE_SIZE	0x07fffffffUL -static void __devinit psycho_pbm_init(struct pci_pbm_info *pbm, -				      struct platform_device *op, int is_pbm_a) +static void psycho_pbm_init(struct pci_pbm_info *pbm, +			    struct platform_device *op, int is_pbm_a)  {  	psycho_pbm_init_common(pbm, op, "PSYCHO", PBM_CHIP_TYPE_PSYCHO);  	psycho_pbm_strbuf_init(pbm, is_pbm_a);  	psycho_scan_bus(pbm, &op->dev);  } -static struct pci_pbm_info * __devinit psycho_find_sibling(u32 upa_portid) +static struct pci_pbm_info *psycho_find_sibling(u32 upa_portid)  {  	struct pci_pbm_info *pbm; @@ -504,7 +504,7 @@ static struct pci_pbm_info * __devinit psycho_find_sibling(u32 upa_portid)  #define PSYCHO_CONFIGSPACE	0x001000000UL -static int __devinit psycho_probe(struct platform_device *op) +static int psycho_probe(struct platform_device *op)  {  	const struct linux_prom64_registers *pr_regs;  	struct device_node *dp = op->dev.of_node; diff --git a/arch/sparc/kernel/pci_sabre.c b/arch/sparc/kernel/pci_sabre.c index 3efaa4644d6..6f00d27e8da 100644 --- a/arch/sparc/kernel/pci_sabre.c +++ b/arch/sparc/kernel/pci_sabre.c @@ -403,8 +403,7 @@ static void apb_init(struct pci_bus *sabre_bus)  	}  } -static void __devinit sabre_scan_bus(struct pci_pbm_info *pbm, -				     struct device *parent) +static void sabre_scan_bus(struct pci_pbm_info *pbm, struct device *parent)  {  	static int once; @@ -443,8 +442,8 @@ static void __devinit sabre_scan_bus(struct pci_pbm_info *pbm,  	sabre_register_error_handlers(pbm);  } -static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm, -				     struct platform_device *op) +static void sabre_pbm_init(struct pci_pbm_info *pbm, +			   struct platform_device *op)  {  	psycho_pbm_init_common(pbm, op, "SABRE", PBM_CHIP_TYPE_SABRE);  	pbm->pci_afsr = pbm->controller_regs + SABRE_PIOAFSR; @@ -454,7 +453,7 @@ static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm,  }  static const struct of_device_id sabre_match[]; -static int __devinit sabre_probe(struct platform_device *op) +static int sabre_probe(struct platform_device *op)  {  	const struct of_device_id *match;  	const struct linux_prom64_registers *pr_regs; diff --git a/arch/sparc/kernel/pci_schizo.c b/arch/sparc/kernel/pci_schizo.c index 13d4aa20b5a..8f76f23dac3 100644 --- a/arch/sparc/kernel/pci_schizo.c +++ b/arch/sparc/kernel/pci_schizo.c @@ -1064,8 +1064,7 @@ static void pbm_config_busmastering(struct pci_pbm_info *pbm)  	pci_config_write8(addr, 64);  } -static void __devinit schizo_scan_bus(struct pci_pbm_info *pbm, -				      struct device *parent) +static void schizo_scan_bus(struct pci_pbm_info *pbm, struct device *parent)  {  	pbm_config_busmastering(pbm);  	pbm->is_66mhz_capable = @@ -1307,9 +1306,9 @@ static void schizo_pbm_hw_init(struct pci_pbm_info *pbm)  	}  } -static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm, -				     struct platform_device *op, u32 portid, -				     int chip_type) +static int schizo_pbm_init(struct pci_pbm_info *pbm, +			   struct platform_device *op, u32 portid, +			   int chip_type)  {  	const struct linux_prom64_registers *regs;  	struct device_node *dp = op->dev.of_node; @@ -1400,8 +1399,7 @@ static inline int portid_compare(u32 x, u32 y, int chip_type)  	return (x == y);  } -static struct pci_pbm_info * __devinit schizo_find_sibling(u32 portid, -							   int chip_type) +static struct pci_pbm_info *schizo_find_sibling(u32 portid, int chip_type)  {  	struct pci_pbm_info *pbm; @@ -1412,7 +1410,7 @@ static struct pci_pbm_info * __devinit schizo_find_sibling(u32 portid,  	return NULL;  } -static int __devinit __schizo_init(struct platform_device *op, unsigned long chip_type) +static int __schizo_init(struct platform_device *op, unsigned long chip_type)  {  	struct device_node *dp = op->dev.of_node;  	struct pci_pbm_info *pbm; @@ -1460,7 +1458,7 @@ out_err:  }  static const struct of_device_id schizo_match[]; -static int __devinit schizo_probe(struct platform_device *op) +static int schizo_probe(struct platform_device *op)  {  	const struct of_device_id *match; diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c index 051b69caeff..d07f6b29aed 100644 --- a/arch/sparc/kernel/pci_sun4v.c +++ b/arch/sparc/kernel/pci_sun4v.c @@ -536,8 +536,7 @@ static struct dma_map_ops sun4v_dma_ops = {  	.unmap_sg			= dma_4v_unmap_sg,  }; -static void __devinit pci_sun4v_scan_bus(struct pci_pbm_info *pbm, -					 struct device *parent) +static void pci_sun4v_scan_bus(struct pci_pbm_info *pbm, struct device *parent)  {  	struct property *prop;  	struct device_node *dp; @@ -550,8 +549,8 @@ static void __devinit pci_sun4v_scan_bus(struct pci_pbm_info *pbm,  	/* XXX register error interrupt handlers XXX */  } -static unsigned long __devinit probe_existing_entries(struct pci_pbm_info *pbm, -						      struct iommu *iommu) +static unsigned long probe_existing_entries(struct pci_pbm_info *pbm, +					    struct iommu *iommu)  {  	struct iommu_arena *arena = &iommu->arena;  	unsigned long i, cnt = 0; @@ -578,7 +577,7 @@ static unsigned long __devinit probe_existing_entries(struct pci_pbm_info *pbm,  	return cnt;  } -static int __devinit pci_sun4v_iommu_init(struct pci_pbm_info *pbm) +static int pci_sun4v_iommu_init(struct pci_pbm_info *pbm)  {  	static const u32 vdma_default[] = { 0x80000000, 0x80000000 };  	struct iommu *iommu = pbm->iommu; @@ -879,8 +878,8 @@ static void pci_sun4v_msi_init(struct pci_pbm_info *pbm)  }  #endif /* !(CONFIG_PCI_MSI) */ -static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm, -					struct platform_device *op, u32 devhandle) +static int pci_sun4v_pbm_init(struct pci_pbm_info *pbm, +			      struct platform_device *op, u32 devhandle)  {  	struct device_node *dp = op->dev.of_node;  	int err; @@ -919,7 +918,7 @@ static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm,  	return 0;  } -static int __devinit pci_sun4v_probe(struct platform_device *op) +static int pci_sun4v_probe(struct platform_device *op)  {  	const struct linux_prom64_registers *regs;  	static int hvapi_negotiated = 0; diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index 521fdf1b20e..09f4fdd8d80 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c @@ -439,8 +439,7 @@ int pcic_present(void)  	return pcic0_up;  } -static int __devinit pdev_to_pnode(struct linux_pbm_info *pbm, -				    struct pci_dev *pdev) +static int pdev_to_pnode(struct linux_pbm_info *pbm, struct pci_dev *pdev)  {  	struct linux_prom_pci_registers regs[PROMREG_MAX];  	int err; @@ -595,7 +594,7 @@ pcic_fill_irq(struct linux_pcic *pcic, struct pci_dev *dev, int node)  /*   * Normally called from {do_}pci_scan_bus...   */ -void __devinit pcibios_fixup_bus(struct pci_bus *bus) +void pcibios_fixup_bus(struct pci_bus *bus)  {  	struct pci_dev *dev;  	int i, has_io, has_mem; diff --git a/arch/sparc/kernel/pmc.c b/arch/sparc/kernel/pmc.c index 0e3202239ff..dcbb62f6306 100644 --- a/arch/sparc/kernel/pmc.c +++ b/arch/sparc/kernel/pmc.c @@ -52,7 +52,7 @@ static void pmc_swift_idle(void)  #endif  } -static int __devinit pmc_probe(struct platform_device *op) +static int pmc_probe(struct platform_device *op)  {  	regs = of_ioremap(&op->resource[0], 0,  			  resource_size(&op->resource[0]), PMC_OBPNAME); diff --git a/arch/sparc/kernel/power.c b/arch/sparc/kernel/power.c index 0d39075063b..4cb23c41553 100644 --- a/arch/sparc/kernel/power.c +++ b/arch/sparc/kernel/power.c @@ -23,7 +23,7 @@ static irqreturn_t power_handler(int irq, void *dev_id)  	return IRQ_HANDLED;  } -static int __devinit has_button_interrupt(unsigned int irq, struct device_node *dp) +static int has_button_interrupt(unsigned int irq, struct device_node *dp)  {  	if (irq == 0xffffffff)  		return 0; @@ -33,7 +33,7 @@ static int __devinit has_button_interrupt(unsigned int irq, struct device_node *  	return 1;  } -static int __devinit power_probe(struct platform_device *op) +static int power_probe(struct platform_device *op)  {  	struct resource *res = &op->resource[0];  	unsigned int irq = op->archdata.irqs[0]; diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index d94b878577b..537eb66abd0 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c @@ -1180,7 +1180,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)  {  } -void __devinit smp_prepare_boot_cpu(void) +void smp_prepare_boot_cpu(void)  {  } @@ -1194,7 +1194,7 @@ void __init smp_setup_processor_id(void)  		xcall_deliver_impl = hypervisor_xcall_deliver;  } -void __devinit smp_fill_in_sib_core_maps(void) +void smp_fill_in_sib_core_maps(void)  {  	unsigned int i; diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S index 5147f574f12..6ac43c36bbb 100644 --- a/arch/sparc/kernel/systbls_32.S +++ b/arch/sparc/kernel/systbls_32.S @@ -85,4 +85,4 @@ sys_call_table:  /*325*/	.long sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init  /*330*/	.long sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime  /*335*/	.long sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev -/*340*/	.long sys_ni_syscall, sys_kcmp +/*340*/	.long sys_ni_syscall, sys_kcmp, sys_finit_module diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S index cdbd9b81775..1009ecb9267 100644 --- a/arch/sparc/kernel/systbls_64.S +++ b/arch/sparc/kernel/systbls_64.S @@ -86,7 +86,7 @@ sys_call_table32:  	.word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo, sys_perf_event_open, compat_sys_recvmmsg, sys_fanotify_init  /*330*/	.word sys32_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime  	.word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev -/*340*/	.word sys_kern_features, sys_kcmp +/*340*/	.word sys_kern_features, sys_kcmp, sys_finit_module  #endif /* CONFIG_COMPAT */ @@ -164,4 +164,4 @@ sys_call_table:  	.word sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init  /*330*/	.word sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime  	.word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev -/*340*/	.word sys_kern_features, sys_kcmp +/*340*/	.word sys_kern_features, sys_kcmp, sys_finit_module diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c index 953641549e8..c4c27b0f906 100644 --- a/arch/sparc/kernel/time_32.c +++ b/arch/sparc/kernel/time_32.c @@ -278,7 +278,7 @@ static struct platform_device m48t59_rtc = {  	},  }; -static int __devinit clock_probe(struct platform_device *op) +static int clock_probe(struct platform_device *op)  {  	struct device_node *dp = op->dev.of_node;  	const char *model = of_get_property(dp, "model", NULL); diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c index e861072b9c5..c3d82b5f54c 100644 --- a/arch/sparc/kernel/time_64.c +++ b/arch/sparc/kernel/time_64.c @@ -419,7 +419,7 @@ static struct platform_device rtc_cmos_device = {  	.num_resources	= 1,  }; -static int __devinit rtc_probe(struct platform_device *op) +static int rtc_probe(struct platform_device *op)  {  	struct resource *r; @@ -477,7 +477,7 @@ static struct platform_device rtc_bq4802_device = {  	.num_resources	= 1,  }; -static int __devinit bq4802_probe(struct platform_device *op) +static int bq4802_probe(struct platform_device *op)  {  	printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n", @@ -534,7 +534,7 @@ static struct platform_device m48t59_rtc = {  	},  }; -static int __devinit mostek_probe(struct platform_device *op) +static int mostek_probe(struct platform_device *op)  {  	struct device_node *dp = op->dev.of_node; @@ -746,7 +746,7 @@ void __irq_entry timer_interrupt(int irq, struct pt_regs *regs)  	set_irq_regs(old_regs);  } -void __devinit setup_sparc64_timer(void) +void setup_sparc64_timer(void)  {  	struct clock_event_device *sevt;  	unsigned long pstate; @@ -844,7 +844,7 @@ unsigned long long sched_clock(void)  		>> SPARC64_NSEC_PER_CYC_SHIFT;  } -int __devinit read_current_timer(unsigned long *timer_val) +int read_current_timer(unsigned long *timer_val)  {  	*timer_val = tick_ops->get_tick();  	return 0; diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 85be1ca539b..c3b72423c84 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -87,8 +87,8 @@ static unsigned long cpu_pgsz_mask;  #define MAX_BANKS	32 -static struct linux_prom64_registers pavail[MAX_BANKS] __devinitdata; -static int pavail_ents __devinitdata; +static struct linux_prom64_registers pavail[MAX_BANKS]; +static int pavail_ents;  static int cmp_p64(const void *a, const void *b)  { @@ -1931,7 +1931,7 @@ void __init paging_init(void)  	printk("Booting Linux...\n");  } -int __devinit page_in_phys_avail(unsigned long paddr) +int page_in_phys_avail(unsigned long paddr)  {  	int i; diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig index ea7f61e8bc9..875d008828b 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig @@ -21,8 +21,6 @@ config TILE  	select ARCH_HAVE_NMI_SAFE_CMPXCHG  	select GENERIC_CLOCKEVENTS  	select MODULES_USE_ELF_RELA -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  # FIXME: investigate whether we need/want these options.  #	select HAVE_IOREMAP_PROT diff --git a/arch/tile/include/asm/dma-mapping.h b/arch/tile/include/asm/dma-mapping.h index 4b6247d1a31..f2ff191376b 100644 --- a/arch/tile/include/asm/dma-mapping.h +++ b/arch/tile/include/asm/dma-mapping.h @@ -72,6 +72,7 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)  static inline int  dma_mapping_error(struct device *dev, dma_addr_t dma_addr)  { +	debug_dma_mapping_error(dev, dma_addr);  	return get_dma_ops(dev)->mapping_error(dev, dma_addr);  } diff --git a/arch/tile/include/asm/elf.h b/arch/tile/include/asm/elf.h index b73e1039c91..ff8a9340882 100644 --- a/arch/tile/include/asm/elf.h +++ b/arch/tile/include/asm/elf.h @@ -170,4 +170,6 @@ do { \  #endif /* CONFIG_COMPAT */ +#define CORE_DUMP_USE_REGSET +  #endif /* _ASM_TILE_ELF_H */ diff --git a/arch/tile/include/asm/pci.h b/arch/tile/include/asm/pci.h index 302cdf71cee..54a924208d3 100644 --- a/arch/tile/include/asm/pci.h +++ b/arch/tile/include/asm/pci.h @@ -188,7 +188,7 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);  int __init tile_pci_init(void);  int __init pcibios_init(void); -void __devinit pcibios_fixup_bus(struct pci_bus *bus); +void pcibios_fixup_bus(struct pci_bus *bus);  #define pci_domain_nr(bus) (((struct pci_controller *)(bus)->sysdata)->index) diff --git a/arch/tile/include/asm/ptrace.h b/arch/tile/include/asm/ptrace.h index 1a4fd9ab0ee..2e83fc1b946 100644 --- a/arch/tile/include/asm/ptrace.h +++ b/arch/tile/include/asm/ptrace.h @@ -24,8 +24,7 @@ typedef unsigned long pt_reg_t;  #include <uapi/asm/ptrace.h>  #define PTRACE_O_MASK_TILE	(PTRACE_O_TRACEMIGRATE) -#define PT_TRACE_MIGRATE	0x00080000 -#define PT_TRACE_MASK_TILE	(PT_TRACE_MIGRATE) +#define PT_TRACE_MIGRATE	PT_EVENT_FLAG(PTRACE_EVENT_MIGRATE)  /* Flag bits in pt_regs.flags */  #define PT_FLAGS_DISABLE_IRQ    1  /* on return to kernel, disable irqs */ @@ -36,6 +35,7 @@ typedef unsigned long pt_reg_t;  #define instruction_pointer(regs) ((regs)->pc)  #define profile_pc(regs) instruction_pointer(regs) +#define user_stack_pointer(regs) ((regs)->sp)  /* Does the process account for user or for system time? */  #define user_mode(regs) (EX1_PL((regs)->ex1) == USER_PL) diff --git a/arch/tile/include/asm/unistd.h b/arch/tile/include/asm/unistd.h index fe841e7d496..6ac21034f69 100644 --- a/arch/tile/include/asm/unistd.h +++ b/arch/tile/include/asm/unistd.h @@ -17,6 +17,5 @@  #define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL  #endif  #define __ARCH_WANT_SYS_NEWFSTATAT -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_CLONE  #include <uapi/asm/unistd.h> diff --git a/arch/tile/include/uapi/asm/ptrace.h b/arch/tile/include/uapi/asm/ptrace.h index c717d0fec72..7757e1985fb 100644 --- a/arch/tile/include/uapi/asm/ptrace.h +++ b/arch/tile/include/uapi/asm/ptrace.h @@ -81,8 +81,14 @@ struct pt_regs {  #define PTRACE_SETFPREGS	15  /* Support TILE-specific ptrace options, with events starting at 16. */ -#define PTRACE_O_TRACEMIGRATE	0x00010000  #define PTRACE_EVENT_MIGRATE	16 +#define PTRACE_O_TRACEMIGRATE	(1 << PTRACE_EVENT_MIGRATE) +/* + * Flag bits in pt_regs.flags that are part of the ptrace API. + * We start our numbering higher up to avoid confusion with the + * non-ABI kernel-internal values that use the low 16 bits. + */ +#define PT_FLAGS_COMPAT		0x10000  /* process is an -m32 compat process */  #endif /* _UAPI_ASM_TILE_PTRACE_H */ diff --git a/arch/tile/kernel/module.c b/arch/tile/kernel/module.c index 243ffebe38d..4918d91bc3a 100644 --- a/arch/tile/kernel/module.c +++ b/arch/tile/kernel/module.c @@ -42,8 +42,6 @@ void *module_alloc(unsigned long size)  	int i = 0;  	int npages; -	if (size == 0) -		return NULL;  	npages = (size + PAGE_SIZE - 1) / PAGE_SIZE;  	pages = kmalloc(npages * sizeof(struct page *), GFP_KERNEL);  	if (pages == NULL) diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c index 759822687e8..67237d34c2e 100644 --- a/arch/tile/kernel/pci.c +++ b/arch/tile/kernel/pci.c @@ -81,7 +81,7 @@ EXPORT_SYMBOL(pcibios_align_resource);   * controller_id is the controller number, config type is 0 or 1 for   * config0 or config1 operations.   */ -static int __devinit tile_pcie_open(int controller_id, int config_type) +static int tile_pcie_open(int controller_id, int config_type)  {  	char filename[32];  	int fd; @@ -97,8 +97,7 @@ static int __devinit tile_pcie_open(int controller_id, int config_type)  /*   * Get the IRQ numbers from the HV and set up the handlers for them.   */ -static int __devinit tile_init_irqs(int controller_id, -				 struct pci_controller *controller) +static int tile_init_irqs(int controller_id, struct pci_controller *controller)  {  	char filename[32];  	int fd; @@ -237,7 +236,7 @@ static int tile_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)  } -static void __devinit fixup_read_and_payload_sizes(void) +static void fixup_read_and_payload_sizes(void)  {  	struct pci_dev *dev = NULL;  	int smallest_max_payload = 0x1; /* Tile maxes out at 256 bytes. */ @@ -245,7 +244,7 @@ static void __devinit fixup_read_and_payload_sizes(void)  	u16 new_values;  	/* Scan for the smallest maximum payload size. */ -	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { +	for_each_pci_dev(dev) {  		u32 devcap;  		int max_payload; @@ -260,7 +259,7 @@ static void __devinit fixup_read_and_payload_sizes(void)  	/* Now, set the max_payload_size for all devices to that value. */  	new_values = (max_read_size << 12) | (smallest_max_payload << 5); -	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) +	for_each_pci_dev(dev)  		pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL,  				PCI_EXP_DEVCTL_PAYLOAD | PCI_EXP_DEVCTL_READRQ,  				new_values); @@ -379,7 +378,7 @@ subsys_initcall(pcibios_init);  /*   * No bus fixups needed.   */ -void __devinit pcibios_fixup_bus(struct pci_bus *bus) +void pcibios_fixup_bus(struct pci_bus *bus)  {  	/* Nothing needs to be done. */  } @@ -458,11 +457,8 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)   * specified bus & slot.   */ -static int __devinit tile_cfg_read(struct pci_bus *bus, -				   unsigned int devfn, -				   int offset, -				   int size, -				   u32 *val) +static int tile_cfg_read(struct pci_bus *bus, unsigned int devfn, int offset, +			 int size, u32 *val)  {  	struct pci_controller *controller = bus->sysdata;  	int busnum = bus->number & 0xff; @@ -504,11 +500,8 @@ static int __devinit tile_cfg_read(struct pci_bus *bus,   * See tile_cfg_read() for relevant comments.   * Note that "val" is the value to write, not a pointer to that value.   */ -static int __devinit tile_cfg_write(struct pci_bus *bus, -				    unsigned int devfn, -				    int offset, -				    int size, -				    u32 val) +static int tile_cfg_write(struct pci_bus *bus, unsigned int devfn, int offset, +			  int size, u32 val)  {  	struct pci_controller *controller = bus->sysdata;  	int busnum = bus->number & 0xff; diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c index 2ba6d052f85..11425633b2d 100644 --- a/arch/tile/kernel/pci_gx.c +++ b/arch/tile/kernel/pci_gx.c @@ -58,10 +58,10 @@  #define TRACE_CFG_RD(...)  #endif -static int __devinitdata pci_probe = 1; +static int pci_probe = 1;  /* Information on the PCIe RC ports configuration. */ -static int __devinitdata pcie_rc[TILEGX_NUM_TRIO][TILEGX_TRIO_PCIES]; +static int pcie_rc[TILEGX_NUM_TRIO][TILEGX_TRIO_PCIES];  /*   * On some platforms with one or more Gx endpoint ports, we need to @@ -72,7 +72,7 @@ static int __devinitdata pcie_rc[TILEGX_NUM_TRIO][TILEGX_TRIO_PCIES];   * the delay in seconds. If the delay is not provided, the value   * will be DEFAULT_RC_DELAY.   */ -static int __devinitdata rc_delay[TILEGX_NUM_TRIO][TILEGX_TRIO_PCIES]; +static int rc_delay[TILEGX_NUM_TRIO][TILEGX_TRIO_PCIES];  /* Default number of seconds that the PCIe RC port probe can be delayed. */  #define DEFAULT_RC_DELAY	10 @@ -137,7 +137,7 @@ static int tile_irq_cpu(int irq)  /*   * Open a file descriptor to the TRIO shim.   */ -static int __devinit tile_pcie_open(int trio_index) +static int tile_pcie_open(int trio_index)  {  	gxio_trio_context_t *context = &trio_contexts[trio_index];  	int ret; @@ -265,7 +265,7 @@ trio_handle_level_irq(unsigned int irq, struct irq_desc *desc)   * Create kernel irqs and set up the handlers for the legacy interrupts.   * Also some minimum initialization for the MSI support.   */ -static int __devinit tile_init_irqs(struct pci_controller *controller) +static int tile_init_irqs(struct pci_controller *controller)  {  	int i;  	int j; @@ -459,8 +459,7 @@ static int tile_map_irq(const struct pci_dev *dev, u8 device, u8 pin)  } -static void __devinit fixup_read_and_payload_sizes(struct pci_controller * -						controller) +static void fixup_read_and_payload_sizes(struct pci_controller *controller)  {  	gxio_trio_context_t *trio_context = controller->trio;  	struct pci_bus *root_bus = controller->root_bus; @@ -541,7 +540,7 @@ static void __devinit fixup_read_and_payload_sizes(struct pci_controller *  	}  } -static int __devinit setup_pcie_rc_delay(char *str) +static int setup_pcie_rc_delay(char *str)  {  	unsigned long delay = 0;  	unsigned long trio_index; @@ -1016,7 +1015,7 @@ alloc_mem_map_failed:  subsys_initcall(pcibios_init);  /* Note: to be deleted after Linux 3.6 merge. */ -void __devinit pcibios_fixup_bus(struct pci_bus *bus) +void pcibios_fixup_bus(struct pci_bus *bus)  {  } @@ -1024,7 +1023,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)   * This can be called from the generic PCI layer, but doesn't need to   * do anything.   */ -char __devinit *pcibios_setup(char *str) +char *pcibios_setup(char *str)  {  	if (!strcmp(str, "off")) {  		pci_probe = 0; @@ -1047,8 +1046,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)  }  /* Called for each device after PCI setup is done. */ -static void __init -pcibios_fixup_final(struct pci_dev *pdev) +static void pcibios_fixup_final(struct pci_dev *pdev)  {  	set_dma_ops(&pdev->dev, gx_pci_dma_map_ops);  	set_dma_offset(&pdev->dev, TILE_PCI_MEM_MAP_BASE_OFFSET); @@ -1144,11 +1142,8 @@ EXPORT_SYMBOL(pci_iounmap);   * specified bus & device.   */ -static int __devinit tile_cfg_read(struct pci_bus *bus, -				   unsigned int devfn, -				   int offset, -				   int size, -				   u32 *val) +static int tile_cfg_read(struct pci_bus *bus, unsigned int devfn, int offset, +			 int size, u32 *val)  {  	struct pci_controller *controller = bus->sysdata;  	gxio_trio_context_t *trio_context = controller->trio; @@ -1272,11 +1267,8 @@ invalid_device:   * See tile_cfg_read() for relevent comments.   * Note that "val" is the value to write, not a pointer to that value.   */ -static int __devinit tile_cfg_write(struct pci_bus *bus, -				    unsigned int devfn, -				    int offset, -				    int size, -				    u32 val) +static int tile_cfg_write(struct pci_bus *bus, unsigned int devfn, int offset, +			  int size, u32 val)  {  	struct pci_controller *controller = bus->sysdata;  	gxio_trio_context_t *trio_context = controller->trio; diff --git a/arch/tile/kernel/ptrace.c b/arch/tile/kernel/ptrace.c index e92e40527d6..9835312d5a9 100644 --- a/arch/tile/kernel/ptrace.c +++ b/arch/tile/kernel/ptrace.c @@ -19,7 +19,10 @@  #include <linux/kprobes.h>  #include <linux/compat.h>  #include <linux/uaccess.h> +#include <linux/regset.h> +#include <linux/elf.h>  #include <asm/traps.h> +#include <arch/chip.h>  void user_enable_single_step(struct task_struct *child)  { @@ -45,6 +48,100 @@ void ptrace_disable(struct task_struct *child)  	clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);  } +/* + * Get registers from task and ready the result for userspace. + * Note that we localize the API issues to getregs() and putregs() at + * some cost in performance, e.g. we need a full pt_regs copy for + * PEEKUSR, and two copies for POKEUSR.  But in general we expect + * GETREGS/PUTREGS to be the API of choice anyway. + */ +static char *getregs(struct task_struct *child, struct pt_regs *uregs) +{ +	*uregs = *task_pt_regs(child); + +	/* Set up flags ABI bits. */ +	uregs->flags = 0; +#ifdef CONFIG_COMPAT +	if (task_thread_info(child)->status & TS_COMPAT) +		uregs->flags |= PT_FLAGS_COMPAT; +#endif + +	return (char *)uregs; +} + +/* Put registers back to task. */ +static void putregs(struct task_struct *child, struct pt_regs *uregs) +{ +	struct pt_regs *regs = task_pt_regs(child); + +	/* Don't allow overwriting the kernel-internal flags word. */ +	uregs->flags = regs->flags; + +	/* Only allow setting the ICS bit in the ex1 word. */ +	uregs->ex1 = PL_ICS_EX1(USER_PL, EX1_ICS(uregs->ex1)); + +	*regs = *uregs; +} + +enum tile_regset { +	REGSET_GPR, +}; + +static int tile_gpr_get(struct task_struct *target, +			  const struct user_regset *regset, +			  unsigned int pos, unsigned int count, +			  void *kbuf, void __user *ubuf) +{ +	struct pt_regs regs; + +	getregs(target, ®s); + +	return user_regset_copyout(&pos, &count, &kbuf, &ubuf, ®s, 0, +				   sizeof(regs)); +} + +static int tile_gpr_set(struct task_struct *target, +			  const struct user_regset *regset, +			  unsigned int pos, unsigned int count, +			  const void *kbuf, const void __user *ubuf) +{ +	int ret; +	struct pt_regs regs; + +	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, ®s, 0, +				 sizeof(regs)); +	if (ret) +		return ret; + +	putregs(target, ®s); + +	return 0; +} + +static const struct user_regset tile_user_regset[] = { +	[REGSET_GPR] = { +		.core_note_type = NT_PRSTATUS, +		.n = ELF_NGREG, +		.size = sizeof(elf_greg_t), +		.align = sizeof(elf_greg_t), +		.get = tile_gpr_get, +		.set = tile_gpr_set, +	}, +}; + +static const struct user_regset_view tile_user_regset_view = { +	.name = CHIP_ARCH_NAME, +	.e_machine = ELF_ARCH, +	.ei_osabi = ELF_OSABI, +	.regsets = tile_user_regset, +	.n = ARRAY_SIZE(tile_user_regset), +}; + +const struct user_regset_view *task_user_regset_view(struct task_struct *task) +{ +	return &tile_user_regset_view; +} +  long arch_ptrace(struct task_struct *child, long request,  		 unsigned long addr, unsigned long data)  { @@ -53,14 +150,13 @@ long arch_ptrace(struct task_struct *child, long request,  	long ret = -EIO;  	char *childreg;  	struct pt_regs copyregs; -	int ex1_offset;  	switch (request) {  	case PTRACE_PEEKUSR:  /* Read register from pt_regs. */  		if (addr >= PTREGS_SIZE)  			break; -		childreg = (char *)task_pt_regs(child) + addr; +		childreg = getregs(child, ©regs) + addr;  #ifdef CONFIG_COMPAT  		if (is_compat_task()) {  			if (addr & (sizeof(compat_long_t)-1)) @@ -79,17 +175,7 @@ long arch_ptrace(struct task_struct *child, long request,  	case PTRACE_POKEUSR:  /* Write register in pt_regs. */  		if (addr >= PTREGS_SIZE)  			break; -		childreg = (char *)task_pt_regs(child) + addr; - -		/* Guard against overwrites of the privilege level. */ -		ex1_offset = PTREGS_OFFSET_EX1; -#if defined(CONFIG_COMPAT) && defined(__BIG_ENDIAN) -		if (is_compat_task())   /* point at low word */ -			ex1_offset += sizeof(compat_long_t); -#endif -		if (addr == ex1_offset) -			data = PL_ICS_EX1(USER_PL, EX1_ICS(data)); - +		childreg = getregs(child, ©regs) + addr;  #ifdef CONFIG_COMPAT  		if (is_compat_task()) {  			if (addr & (sizeof(compat_long_t)-1)) @@ -102,24 +188,20 @@ long arch_ptrace(struct task_struct *child, long request,  				break;  			*(long *)childreg = data;  		} +		putregs(child, ©regs);  		ret = 0;  		break;  	case PTRACE_GETREGS:  /* Get all registers from the child. */ -		if (copy_to_user(datap, task_pt_regs(child), -				 sizeof(struct pt_regs)) == 0) { -			ret = 0; -		} +		ret = copy_regset_to_user(child, &tile_user_regset_view, +					  REGSET_GPR, 0, +					  sizeof(struct pt_regs), datap);  		break;  	case PTRACE_SETREGS:  /* Set all registers in the child. */ -		if (copy_from_user(©regs, datap, -				   sizeof(struct pt_regs)) == 0) { -			copyregs.ex1 = -				PL_ICS_EX1(USER_PL, EX1_ICS(copyregs.ex1)); -			*task_pt_regs(child) = copyregs; -			ret = 0; -		} +		ret = copy_regset_from_user(child, &tile_user_regset_view, +					    REGSET_GPR, 0, +					    sizeof(struct pt_regs), datap);  		break;  	case PTRACE_GETFPREGS:  /* Get the child FPU state. */ @@ -128,12 +210,16 @@ long arch_ptrace(struct task_struct *child, long request,  	case PTRACE_SETOPTIONS:  		/* Support TILE-specific ptrace options. */ -		child->ptrace &= ~PT_TRACE_MASK_TILE; +		BUILD_BUG_ON(PTRACE_O_MASK_TILE & PTRACE_O_MASK);  		tmp = data & PTRACE_O_MASK_TILE;  		data &= ~PTRACE_O_MASK_TILE;  		ret = ptrace_request(child, request, addr, data); -		if (tmp & PTRACE_O_TRACEMIGRATE) -			child->ptrace |= PT_TRACE_MIGRATE; +		if (ret == 0) { +			unsigned int flags = child->ptrace; +			flags &= ~(PTRACE_O_MASK_TILE << PT_OPT_FLAG_SHIFT); +			flags |= (tmp << PT_OPT_FLAG_SHIFT); +			child->ptrace = flags; +		}  		break;  	default: diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c index db18eb6124e..48ccf718e29 100644 --- a/arch/um/kernel/signal.c +++ b/arch/um/kernel/signal.c @@ -132,8 +132,3 @@ long sys_sigsuspend(int history0, int history1, old_sigset_t mask)  	siginitset(&blocked, mask);  	return sigsuspend(&blocked);  } - -long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) -{ -	return do_sigaltstack(uss, uoss, PT_REGS_SP(¤t->thread.regs)); -} diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig index c4fbb21e802..60651df5f95 100644 --- a/arch/unicore32/Kconfig +++ b/arch/unicore32/Kconfig @@ -16,8 +16,6 @@ config UNICORE32  	select ARCH_WANT_FRAME_POINTERS  	select GENERIC_IOMAP  	select MODULES_USE_ELF_REL -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	help  	  UniCore-32 is 32-bit Instruction Set Architecture,  	  including a series of low-power-consumption RISC chip diff --git a/arch/unicore32/include/asm/ptrace.h b/arch/unicore32/include/asm/ptrace.h index 726749dab52..9df53d991c7 100644 --- a/arch/unicore32/include/asm/ptrace.h +++ b/arch/unicore32/include/asm/ptrace.h @@ -54,6 +54,7 @@ static inline int valid_user_regs(struct pt_regs *regs)  }  #define instruction_pointer(regs)	((regs)->UCreg_pc) +#define user_stack_pointer(regs)	((regs)->UCreg_sp)  #endif /* __ASSEMBLY__ */  #endif diff --git a/arch/unicore32/include/uapi/asm/unistd.h b/arch/unicore32/include/uapi/asm/unistd.h index 00cf5e286fc..d4cc4559d84 100644 --- a/arch/unicore32/include/uapi/asm/unistd.h +++ b/arch/unicore32/include/uapi/asm/unistd.h @@ -12,5 +12,4 @@  /* Use the standard ABI for syscalls. */  #include <asm-generic/unistd.h> -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_CLONE diff --git a/arch/unicore32/kernel/module.c b/arch/unicore32/kernel/module.c index 8fbe8577f5e..16bd1495b93 100644 --- a/arch/unicore32/kernel/module.c +++ b/arch/unicore32/kernel/module.c @@ -27,9 +27,6 @@ void *module_alloc(unsigned long size)  	struct vm_struct *area;  	size = PAGE_ALIGN(size); -	if (!size) -		return NULL; -  	area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END);  	if (!area)  		return NULL; diff --git a/arch/unicore32/kernel/pci.c b/arch/unicore32/kernel/pci.c index 7c4359240b8..ef69c0c8282 100644 --- a/arch/unicore32/kernel/pci.c +++ b/arch/unicore32/kernel/pci.c @@ -167,7 +167,7 @@ static inline int pdev_bad_for_parity(struct pci_dev *dev)   * pcibios_fixup_bus - Called after each bus is probed,   * but before its children are examined.   */ -void __devinit pcibios_fixup_bus(struct pci_bus *bus) +void pcibios_fixup_bus(struct pci_bus *bus)  {  	struct pci_dev *dev;  	u16 features = PCI_COMMAND_SERR diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 97f8c5ad8c2..79795af5981 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -110,11 +110,10 @@ config X86  	select GENERIC_STRNLEN_USER  	select HAVE_CONTEXT_TRACKING if X86_64  	select HAVE_IRQ_TIME_ACCOUNTING -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	select MODULES_USE_ELF_REL if X86_32  	select MODULES_USE_ELF_RELA if X86_64  	select CLONE_BACKWARDS if X86_32 +	select GENERIC_SIGALTSTACK  config INSTRUCTION_DECODER  	def_bool y diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 05afcca66de..e71fc4279aa 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -123,9 +123,10 @@ cfi-sections := $(call as-instr,.cfi_sections .debug_frame,-DCONFIG_AS_CFI_SECTI  # does binutils support specific instructions?  asinstr := $(call as-instr,fxsaveq (%rax),-DCONFIG_AS_FXSAVEQ=1)  avx_instr := $(call as-instr,vxorps %ymm0$(comma)%ymm1$(comma)%ymm2,-DCONFIG_AS_AVX=1) +avx2_instr :=$(call as-instr,vpbroadcastb %xmm0$(comma)%ymm1,-DCONFIG_AS_AVX2=1) -KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) -KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) +KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) +KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr)  LDFLAGS := -m elf_$(UTS_MACHINE) diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index b1942e22276..18e329ca108 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c @@ -302,7 +302,7 @@ static efi_status_t setup_efi_pci(struct boot_params *params)  		if (status != EFI_SUCCESS)  			continue; -		if (!attributes & EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM) +		if (!(attributes & EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM))  			continue;  		if (!pci->romimage || !pci->romsize) diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c index efc6a958b71..a1daf4a6500 100644 --- a/arch/x86/ia32/ia32_signal.c +++ b/arch/x86/ia32/ia32_signal.c @@ -136,52 +136,6 @@ asmlinkage long sys32_sigsuspend(int history0, int history1, old_sigset_t mask)  	return sigsuspend(&blocked);  } -asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr, -				  stack_ia32_t __user *uoss_ptr, -				  struct pt_regs *regs) -{ -	stack_t uss, uoss; -	int ret, err = 0; -	mm_segment_t seg; - -	if (uss_ptr) { -		u32 ptr; - -		memset(&uss, 0, sizeof(stack_t)); -		if (!access_ok(VERIFY_READ, uss_ptr, sizeof(stack_ia32_t))) -			return -EFAULT; - -		get_user_try { -			get_user_ex(ptr, &uss_ptr->ss_sp); -			get_user_ex(uss.ss_flags, &uss_ptr->ss_flags); -			get_user_ex(uss.ss_size, &uss_ptr->ss_size); -		} get_user_catch(err); - -		if (err) -			return -EFAULT; -		uss.ss_sp = compat_ptr(ptr); -	} -	seg = get_fs(); -	set_fs(KERNEL_DS); -	ret = do_sigaltstack((stack_t __force __user *) (uss_ptr ? &uss : NULL), -			     (stack_t __force __user *) &uoss, regs->sp); -	set_fs(seg); -	if (ret >= 0 && uoss_ptr)  { -		if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t))) -			return -EFAULT; - -		put_user_try { -			put_user_ex(ptr_to_compat(uoss.ss_sp), &uoss_ptr->ss_sp); -			put_user_ex(uoss.ss_flags, &uoss_ptr->ss_flags); -			put_user_ex(uoss.ss_size, &uoss_ptr->ss_size); -		} put_user_catch(err); - -		if (err) -			ret = -EFAULT; -	} -	return ret; -} -  /*   * Do a signal return; undo the signal stack.   */ @@ -292,7 +246,6 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)  	struct rt_sigframe_ia32 __user *frame;  	sigset_t set;  	unsigned int ax; -	struct pt_regs tregs;  	frame = (struct rt_sigframe_ia32 __user *)(regs->sp - 4); @@ -306,8 +259,7 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)  	if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))  		goto badframe; -	tregs = *regs; -	if (sys32_sigaltstack(&frame->uc.uc_stack, NULL, &tregs) == -EFAULT) +	if (compat_restore_altstack(&frame->uc.uc_stack))  		goto badframe;  	return ax; @@ -515,10 +467,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,  		else  			put_user_ex(0, &frame->uc.uc_flags);  		put_user_ex(0, &frame->uc.uc_link); -		put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); -		put_user_ex(sas_ss_flags(regs->sp), -			    &frame->uc.uc_stack.ss_flags); -		put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size); +		err |= __compat_save_altstack(&frame->uc.uc_stack, regs->sp);  		if (ka->sa.sa_flags & SA_RESTORER)  			restorer = ka->sa.sa_restorer; diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 32e6f05ddaa..102ff7cb3e4 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S @@ -464,7 +464,6 @@ GLOBAL(\label)  	PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi  	PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi -	PTREGSCALL stub32_sigaltstack, sys32_sigaltstack, %rdx  	PTREGSCALL stub32_execve, compat_sys_execve, %rcx  	PTREGSCALL stub32_fork, sys_fork, %rdi  	PTREGSCALL stub32_vfork, sys_vfork, %rdi diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h index f7b4c7903e7..808dae63eee 100644 --- a/arch/x86/include/asm/dma-mapping.h +++ b/arch/x86/include/asm/dma-mapping.h @@ -47,6 +47,7 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)  static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)  {  	struct dma_map_ops *ops = get_dma_ops(dev); +	debug_dma_mapping_error(dev, dma_addr);  	if (ops->mapping_error)  		return ops->mapping_error(dev, dma_addr); diff --git a/arch/x86/include/asm/ia32.h b/arch/x86/include/asm/ia32.h index e6232773ce4..4c6da2e4bb1 100644 --- a/arch/x86/include/asm/ia32.h +++ b/arch/x86/include/asm/ia32.h @@ -29,16 +29,10 @@ struct old_sigaction32 {  	unsigned int sa_restorer;	/* Another 32 bit pointer */  }; -typedef struct sigaltstack_ia32 { -	unsigned int	ss_sp; -	int		ss_flags; -	unsigned int	ss_size; -} stack_ia32_t; -  struct ucontext_ia32 {  	unsigned int	  uc_flags;  	unsigned int 	  uc_link; -	stack_ia32_t	  uc_stack; +	compat_stack_t	  uc_stack;  	struct sigcontext_ia32 uc_mcontext;  	compat_sigset_t	  uc_sigmask;	/* mask last for extensibility */  }; @@ -46,7 +40,7 @@ struct ucontext_ia32 {  struct ucontext_x32 {  	unsigned int	  uc_flags;  	unsigned int 	  uc_link; -	stack_ia32_t	  uc_stack; +	compat_stack_t	  uc_stack;  	unsigned int	  uc__pad0;     /* needed for alignment */  	struct sigcontext uc_mcontext;  /* the 64-bit sigcontext type */  	compat_sigset_t	  uc_sigmask;	/* mask last for extensibility */ diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h index a0facf3908d..5edd1742cfd 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h @@ -528,7 +528,6 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,  		PVOP_VCALL4(pv_mmu_ops.set_pte_at, mm, addr, ptep, pte.pte);  } -#ifdef CONFIG_TRANSPARENT_HUGEPAGE  static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,  			      pmd_t *pmdp, pmd_t pmd)  { @@ -539,7 +538,6 @@ static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,  		PVOP_VCALL4(pv_mmu_ops.set_pmd_at, mm, addr, pmdp,  			    native_pmd_val(pmd));  } -#endif  static inline void set_pmd(pmd_t *pmdp, pmd_t pmd)  { diff --git a/arch/x86/include/asm/parport.h b/arch/x86/include/asm/parport.h index 3c4ffeb467e..0d2d3b29118 100644 --- a/arch/x86/include/asm/parport.h +++ b/arch/x86/include/asm/parport.h @@ -1,8 +1,8 @@  #ifndef _ASM_X86_PARPORT_H  #define _ASM_X86_PARPORT_H -static int __devinit parport_pc_find_isa_ports(int autoirq, int autodma); -static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma) +static int parport_pc_find_isa_ports(int autoirq, int autodma); +static int parport_pc_find_nonpci_ports(int autoirq, int autodma)  {  	return parport_pc_find_isa_ports(autoirq, autodma);  } diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h index 73e8eeff22e..747e5a38b59 100644 --- a/arch/x86/include/asm/pci_x86.h +++ b/arch/x86/include/asm/pci_x86.h @@ -140,11 +140,10 @@ struct pci_mmcfg_region {  extern int __init pci_mmcfg_arch_init(void);  extern void __init pci_mmcfg_arch_free(void); -extern int __devinit pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg); +extern int pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg);  extern void pci_mmcfg_arch_unmap(struct pci_mmcfg_region *cfg); -extern int __devinit pci_mmconfig_insert(struct device *dev, -					 u16 seg, u8 start, -					 u8 end, phys_addr_t addr); +extern int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end, +			       phys_addr_t addr);  extern int pci_mmconfig_delete(u16 seg, u8 start, u8 end);  extern struct pci_mmcfg_region *pci_mmconfig_lookup(int segment, int bus); diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h index 03ca442d8f0..942a08623a1 100644 --- a/arch/x86/include/asm/ptrace.h +++ b/arch/x86/include/asm/ptrace.h @@ -133,6 +133,13 @@ static inline bool user_64bit_mode(struct pt_regs *regs)  	return regs->cs == __USER_CS || regs->cs == pv_info.extra_user_64bit_cs;  #endif  } + +#define current_user_stack_pointer()	this_cpu_read(old_rsp) +/* ia32 vs. x32 difference */ +#define compat_user_stack_pointer()	\ +	(test_thread_flag(TIF_IA32) 	\ +	 ? current_pt_regs()->sp 	\ +	 : this_cpu_read(old_rsp))  #endif  #ifdef CONFIG_X86_32 diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h index c76fae4d90b..31f61f96e0f 100644 --- a/arch/x86/include/asm/sys_ia32.h +++ b/arch/x86/include/asm/sys_ia32.h @@ -69,8 +69,6 @@ asmlinkage long sys32_fallocate(int, int, unsigned,  /* ia32/ia32_signal.c */  asmlinkage long sys32_sigsuspend(int, int, old_sigset_t); -asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *, -				  stack_ia32_t __user *, struct pt_regs *);  asmlinkage long sys32_sigreturn(struct pt_regs *);  asmlinkage long sys32_rt_sigreturn(struct pt_regs *); diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h index 2f8374718aa..58b7e3eac0a 100644 --- a/arch/x86/include/asm/syscalls.h +++ b/arch/x86/include/asm/syscalls.h @@ -25,9 +25,6 @@ asmlinkage int sys_modify_ldt(int, void __user *, unsigned long);  /* kernel/signal.c */  long sys_rt_sigreturn(struct pt_regs *); -long sys_sigaltstack(const stack_t __user *, stack_t __user *, -		     struct pt_regs *); -  /* kernel/tls.c */  asmlinkage int sys_set_thread_area(struct user_desc __user *); diff --git a/arch/x86/include/asm/unistd.h b/arch/x86/include/asm/unistd.h index 1003e69a40d..a0790e07ba6 100644 --- a/arch/x86/include/asm/unistd.h +++ b/arch/x86/include/asm/unistd.h @@ -48,7 +48,6 @@  # define __ARCH_WANT_SYS_TIME  # define __ARCH_WANT_SYS_UTIME  # define __ARCH_WANT_SYS_WAITPID -# define __ARCH_WANT_SYS_EXECVE  # define __ARCH_WANT_SYS_FORK  # define __ARCH_WANT_SYS_VFORK  # define __ARCH_WANT_SYS_CLONE diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h index 6e930b21872..433a59fb1a7 100644 --- a/arch/x86/include/uapi/asm/msr-index.h +++ b/arch/x86/include/uapi/asm/msr-index.h @@ -35,11 +35,14 @@  #define MSR_IA32_PERFCTR0		0x000000c1  #define MSR_IA32_PERFCTR1		0x000000c2  #define MSR_FSB_FREQ			0x000000cd +#define MSR_NHM_PLATFORM_INFO		0x000000ce  #define MSR_NHM_SNB_PKG_CST_CFG_CTL	0x000000e2  #define NHM_C3_AUTO_DEMOTE		(1UL << 25)  #define NHM_C1_AUTO_DEMOTE		(1UL << 26)  #define ATM_LNC_C6_AUTO_DEMOTE		(1UL << 25) +#define SNB_C1_AUTO_UNDEMOTE		(1UL << 27) +#define SNB_C3_AUTO_UNDEMOTE		(1UL << 28)  #define MSR_MTRRcap			0x000000fe  #define MSR_IA32_BBL_CR_CTL		0x00000119 @@ -55,6 +58,8 @@  #define MSR_OFFCORE_RSP_0		0x000001a6  #define MSR_OFFCORE_RSP_1		0x000001a7 +#define MSR_NHM_TURBO_RATIO_LIMIT	0x000001ad +#define MSR_IVT_TURBO_RATIO_LIMIT	0x000001ae  #define MSR_LBR_SELECT			0x000001c8  #define MSR_LBR_TOS			0x000001c9 @@ -103,6 +108,38 @@  #define MSR_IA32_MC0_ADDR		0x00000402  #define MSR_IA32_MC0_MISC		0x00000403 +/* C-state Residency Counters */ +#define MSR_PKG_C3_RESIDENCY		0x000003f8 +#define MSR_PKG_C6_RESIDENCY		0x000003f9 +#define MSR_PKG_C7_RESIDENCY		0x000003fa +#define MSR_CORE_C3_RESIDENCY		0x000003fc +#define MSR_CORE_C6_RESIDENCY		0x000003fd +#define MSR_CORE_C7_RESIDENCY		0x000003fe +#define MSR_PKG_C2_RESIDENCY		0x0000060d + +/* Run Time Average Power Limiting (RAPL) Interface */ + +#define MSR_RAPL_POWER_UNIT		0x00000606 + +#define MSR_PKG_POWER_LIMIT		0x00000610 +#define MSR_PKG_ENERGY_STATUS		0x00000611 +#define MSR_PKG_PERF_STATUS		0x00000613 +#define MSR_PKG_POWER_INFO		0x00000614 + +#define MSR_DRAM_POWER_LIMIT		0x00000618 +#define MSR_DRAM_ENERGY_STATUS		0x00000619 +#define MSR_DRAM_PERF_STATUS		0x0000061b +#define MSR_DRAM_POWER_INFO		0x0000061c + +#define MSR_PP0_POWER_LIMIT		0x00000638 +#define MSR_PP0_ENERGY_STATUS		0x00000639 +#define MSR_PP0_POLICY			0x0000063a +#define MSR_PP0_PERF_STATUS		0x0000063b + +#define MSR_PP1_POWER_LIMIT		0x00000640 +#define MSR_PP1_ENERGY_STATUS		0x00000641 +#define MSR_PP1_POLICY			0x00000642 +  #define MSR_AMD64_MC0_MASK		0xc0010044  #define MSR_IA32_MCx_CTL(x)		(MSR_IA32_MC0_CTL + 4*(x)) diff --git a/arch/x86/include/uapi/asm/signal.h b/arch/x86/include/uapi/asm/signal.h index 0818f9a8e88..aa7d6ae39e0 100644 --- a/arch/x86/include/uapi/asm/signal.h +++ b/arch/x86/include/uapi/asm/signal.h @@ -87,12 +87,6 @@ typedef unsigned long sigset_t;  #define SA_RESTORER	0x04000000 -/* - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 -  #define MINSIGSTKSZ	2048  #define SIGSTKSZ	8192 diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 4428fd178bc..6774c17a557 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c @@ -340,9 +340,6 @@ int x86_setup_perfctr(struct perf_event *event)  		/* BTS is currently only allowed for user-mode. */  		if (!attr->exclude_kernel)  			return -EOPNOTSUPP; - -		if (!attr->exclude_guest) -			return -EOPNOTSUPP;  	}  	hwc->config |= config; @@ -385,9 +382,6 @@ int x86_pmu_hw_config(struct perf_event *event)  	if (event->attr.precise_ip) {  		int precise = 0; -		if (!event->attr.exclude_guest) -			return -EOPNOTSUPP; -  		/* Support for constant skid */  		if (x86_pmu.pebs_active && !x86_pmu.pebs_broken) {  			precise++; diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c index 3cf3d97cce3..b43200dbfe7 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c @@ -2500,7 +2500,7 @@ static bool pcidrv_registered;  /*   * add a pci uncore device   */ -static int __devinit uncore_pci_add(struct intel_uncore_type *type, struct pci_dev *pdev) +static int uncore_pci_add(struct intel_uncore_type *type, struct pci_dev *pdev)  {  	struct intel_uncore_pmu *pmu;  	struct intel_uncore_box *box; @@ -2571,8 +2571,8 @@ static void uncore_pci_remove(struct pci_dev *pdev)  	kfree(box);  } -static int __devinit uncore_pci_probe(struct pci_dev *pdev, -				const struct pci_device_id *id) +static int uncore_pci_probe(struct pci_dev *pdev, +			    const struct pci_device_id *id)  {  	struct intel_uncore_type *type; diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c index fbd89556229..3286a92e662 100644 --- a/arch/x86/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c @@ -26,11 +26,6 @@ static void show_cpuinfo_core(struct seq_file *m, struct cpuinfo_x86 *c,  #ifdef CONFIG_X86_32  static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)  { -	/* -	 * We use exception 16 if we have hardware math and we've either seen -	 * it or the CPU claims it is internal -	 */ -	int fpu_exception = c->hard_math && (ignore_fpu_irq || cpu_has_fpu);  	seq_printf(m,  		   "fdiv_bug\t: %s\n"  		   "hlt_bug\t\t: %s\n" @@ -45,7 +40,7 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)  		   c->f00f_bug ? "yes" : "no",  		   c->coma_bug ? "yes" : "no",  		   c->hard_math ? "yes" : "no", -		   fpu_exception ? "yes" : "no", +		   c->hard_math ? "yes" : "no",  		   c->cpuid_level,  		   c->wp_works_ok ? "yes" : "no");  } diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index c763116c535..6ed91d9980e 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S @@ -739,7 +739,6 @@ ENTRY(ptregs_##name) ; \  ENDPROC(ptregs_##name)  PTREGSCALL1(iopl) -PTREGSCALL2(sigaltstack)  PTREGSCALL0(sigreturn)  PTREGSCALL0(rt_sigreturn)  PTREGSCALL2(vm86) @@ -1066,7 +1065,6 @@ ENTRY(xen_failsafe_callback)  	lea 16(%esp),%esp  	CFI_ADJUST_CFA_OFFSET -16  	jz 5f -	addl $16,%esp  	jmp iret_exc  5:	pushl_cfi $-1 /* orig_ax = -1 => not a system call */  	SAVE_ALL diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 70641aff0c2..07a7a04529b 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -864,7 +864,6 @@ END(stub_\func)  	FORK_LIKE  clone  	FORK_LIKE  fork  	FORK_LIKE  vfork -	PTREGSCALL stub_sigaltstack, sys_sigaltstack, %rdx  	PTREGSCALL stub_iopl, sys_iopl, %rsi  ENTRY(ptregscall_common) @@ -913,8 +912,6 @@ ENTRY(stub_rt_sigreturn)  END(stub_rt_sigreturn)  #ifdef CONFIG_X86_X32_ABI -	PTREGSCALL stub_x32_sigaltstack, sys32_sigaltstack, %rdx -  ENTRY(stub_x32_rt_sigreturn)  	CFI_STARTPROC  	addq $8, %rsp diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c index 6e03b0d6913..7dc4e459c2b 100644 --- a/arch/x86/kernel/irqinit.c +++ b/arch/x86/kernel/irqinit.c @@ -42,39 +42,6 @@   * (these are usually mapped into the 0x30-0xff vector range)   */ -#ifdef CONFIG_X86_32 -/* - * Note that on a 486, we don't want to do a SIGFPE on an irq13 - * as the irq is unreliable, and exception 16 works correctly - * (ie as explained in the intel literature). On a 386, you - * can't use exception 16 due to bad IBM design, so we have to - * rely on the less exact irq13. - * - * Careful.. Not only is IRQ13 unreliable, but it is also - * leads to races. IBM designers who came up with it should - * be shot. - */ - -static irqreturn_t math_error_irq(int cpl, void *dev_id) -{ -	outb(0, 0xF0); -	if (ignore_fpu_irq || !boot_cpu_data.hard_math) -		return IRQ_NONE; -	math_error(get_irq_regs(), 0, X86_TRAP_MF); -	return IRQ_HANDLED; -} - -/* - * New motherboards sometimes make IRQ 13 be a PCI interrupt, - * so allow interrupt sharing. - */ -static struct irqaction fpu_irq = { -	.handler = math_error_irq, -	.name = "fpu", -	.flags = IRQF_NO_THREAD, -}; -#endif -  /*   * IRQ2 is cascade interrupt to second interrupt controller   */ @@ -242,13 +209,6 @@ void __init native_init_IRQ(void)  		setup_irq(2, &irq2);  #ifdef CONFIG_X86_32 -	/* -	 * External FPU? Set up irq13 if so, for -	 * original braindamaged IBM FERR coupling. -	 */ -	if (boot_cpu_data.hard_math && !cpu_has_fpu) -		setup_irq(FPU_IRQ, &fpu_irq); -  	irq_ctx_init(smp_processor_id());  #endif  } diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 08b973f6403..9c2bd8bd4b4 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -43,6 +43,7 @@  #include <asm/apicdef.h>  #include <asm/hypervisor.h>  #include <asm/kvm_guest.h> +#include <asm/context_tracking.h>  static int kvmapf = 1; @@ -121,6 +122,8 @@ void kvm_async_pf_task_wait(u32 token)  	struct kvm_task_sleep_node n, *e;  	DEFINE_WAIT(wait); +	rcu_irq_enter(); +  	spin_lock(&b->lock);  	e = _find_apf_task(b, token);  	if (e) { @@ -128,6 +131,8 @@ void kvm_async_pf_task_wait(u32 token)  		hlist_del(&e->link);  		kfree(e);  		spin_unlock(&b->lock); + +		rcu_irq_exit();  		return;  	} @@ -152,13 +157,16 @@ void kvm_async_pf_task_wait(u32 token)  			/*  			 * We cannot reschedule. So halt.  			 */ +			rcu_irq_exit();  			native_safe_halt(); +			rcu_irq_enter();  			local_irq_disable();  		}  	}  	if (!n.halted)  		finish_wait(&n.wq, &wait); +	rcu_irq_exit();  	return;  }  EXPORT_SYMBOL_GPL(kvm_async_pf_task_wait); @@ -252,10 +260,10 @@ do_async_page_fault(struct pt_regs *regs, unsigned long error_code)  		break;  	case KVM_PV_REASON_PAGE_NOT_PRESENT:  		/* page is swapped out by the host. */ -		rcu_irq_enter(); +		exception_enter(regs);  		exit_idle();  		kvm_async_pf_task_wait((u32)read_cr2()); -		rcu_irq_exit(); +		exception_exit(regs);  		break;  	case KVM_PV_REASON_PAGE_READY:  		rcu_irq_enter(); diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index de2b7ad7027..0f5dec5c80e 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c @@ -265,7 +265,7 @@ rootfs_initcall(pci_iommu_init);  #ifdef CONFIG_PCI  /* Many VIA bridges seem to corrupt data for DAC. Disable it here */ -static __devinit void via_no_dac(struct pci_dev *dev) +static void via_no_dac(struct pci_dev *dev)  {  	if (forbid_dac == 0) {  		dev_info(&dev->dev, "disabling DAC on VIA PCI bridge\n"); diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c index 1b27de56356..26ee48a33dc 100644 --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c @@ -8,7 +8,7 @@  #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI) -static void __devinit quirk_intel_irqbalance(struct pci_dev *dev) +static void quirk_intel_irqbalance(struct pci_dev *dev)  {  	u8 config;  	u16 word; @@ -512,7 +512,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS,  #if defined(CONFIG_PCI) && defined(CONFIG_NUMA)  /* Set correct numa_node information for AMD NB functions */ -static void __devinit quirk_amd_nb_node(struct pci_dev *dev) +static void quirk_amd_nb_node(struct pci_dev *dev)  {  	struct pci_dev *nb_ht;  	unsigned int devfn; diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 23ddd558fbd..00f6c1472b8 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -610,6 +610,83 @@ static __init void reserve_ibft_region(void)  static unsigned reserve_low = CONFIG_X86_RESERVE_LOW << 10; +static bool __init snb_gfx_workaround_needed(void) +{ +#ifdef CONFIG_PCI +	int i; +	u16 vendor, devid; +	static const __initconst u16 snb_ids[] = { +		0x0102, +		0x0112, +		0x0122, +		0x0106, +		0x0116, +		0x0126, +		0x010a, +	}; + +	/* Assume no if something weird is going on with PCI */ +	if (!early_pci_allowed()) +		return false; + +	vendor = read_pci_config_16(0, 2, 0, PCI_VENDOR_ID); +	if (vendor != 0x8086) +		return false; + +	devid = read_pci_config_16(0, 2, 0, PCI_DEVICE_ID); +	for (i = 0; i < ARRAY_SIZE(snb_ids); i++) +		if (devid == snb_ids[i]) +			return true; +#endif + +	return false; +} + +/* + * Sandy Bridge graphics has trouble with certain ranges, exclude + * them from allocation. + */ +static void __init trim_snb_memory(void) +{ +	static const __initconst unsigned long bad_pages[] = { +		0x20050000, +		0x20110000, +		0x20130000, +		0x20138000, +		0x40004000, +	}; +	int i; + +	if (!snb_gfx_workaround_needed()) +		return; + +	printk(KERN_DEBUG "reserving inaccessible SNB gfx pages\n"); + +	/* +	 * Reserve all memory below the 1 MB mark that has not +	 * already been reserved. +	 */ +	memblock_reserve(0, 1<<20); +	 +	for (i = 0; i < ARRAY_SIZE(bad_pages); i++) { +		if (memblock_reserve(bad_pages[i], PAGE_SIZE)) +			printk(KERN_WARNING "failed to reserve 0x%08lx\n", +			       bad_pages[i]); +	} +} + +/* + * Here we put platform-specific memory range workarounds, i.e. + * memory known to be corrupt or otherwise in need to be reserved on + * specific platforms. + * + * If this gets used more widely it could use a real dispatch mechanism. + */ +static void __init trim_platform_memory_ranges(void) +{ +	trim_snb_memory(); +} +  static void __init trim_bios_range(void)  {  	/* @@ -630,6 +707,7 @@ static void __init trim_bios_range(void)  	 * take them out.  	 */  	e820_remove_range(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_RAM, 1); +  	sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);  } @@ -908,6 +986,8 @@ void __init setup_arch(char **cmdline_p)  	setup_real_mode(); +	trim_platform_memory_ranges(); +  	init_gbpages();  	/* max_pfn_mapped is updated here */ diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index fbbb604313a..d6bf1f34a6e 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c @@ -364,10 +364,7 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,  		else  			put_user_ex(0, &frame->uc.uc_flags);  		put_user_ex(0, &frame->uc.uc_link); -		put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); -		put_user_ex(sas_ss_flags(regs->sp), -			    &frame->uc.uc_stack.ss_flags); -		put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size); +		err |= __save_altstack(&frame->uc.uc_stack, regs->sp);  		/* Set up to return from userspace.  */  		restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn); @@ -414,7 +411,6 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,  	struct rt_sigframe __user *frame;  	void __user *fp = NULL;  	int err = 0; -	struct task_struct *me = current;  	frame = get_sigframe(ka, regs, sizeof(struct rt_sigframe), &fp); @@ -433,10 +429,7 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,  		else  			put_user_ex(0, &frame->uc.uc_flags);  		put_user_ex(0, &frame->uc.uc_link); -		put_user_ex(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp); -		put_user_ex(sas_ss_flags(regs->sp), -			    &frame->uc.uc_stack.ss_flags); -		put_user_ex(me->sas_ss_size, &frame->uc.uc_stack.ss_size); +		err |= __save_altstack(&frame->uc.uc_stack, regs->sp);  		/* Set up to return from userspace.  If provided, use a stub  		   already in userspace.  */ @@ -503,10 +496,7 @@ static int x32_setup_rt_frame(int sig, struct k_sigaction *ka,  		else  			put_user_ex(0, &frame->uc.uc_flags);  		put_user_ex(0, &frame->uc.uc_link); -		put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); -		put_user_ex(sas_ss_flags(regs->sp), -			    &frame->uc.uc_stack.ss_flags); -		put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size); +		err |= __compat_save_altstack(&frame->uc.uc_stack, regs->sp);  		put_user_ex(0, &frame->uc.uc__pad0);  		if (ka->sa.sa_flags & SA_RESTORER) { @@ -603,13 +593,6 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,  }  #endif /* CONFIG_X86_32 */ -long -sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, -		struct pt_regs *regs) -{ -	return do_sigaltstack(uss, uoss, regs->sp); -} -  /*   * Do a signal return; undo the signal stack.   */ @@ -659,7 +642,7 @@ long sys_rt_sigreturn(struct pt_regs *regs)  	if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))  		goto badframe; -	if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT) +	if (restore_altstack(&frame->uc.uc_stack))  		goto badframe;  	return ax; @@ -865,7 +848,6 @@ asmlinkage long sys32_x32_rt_sigreturn(struct pt_regs *regs)  	struct rt_sigframe_x32 __user *frame;  	sigset_t set;  	unsigned long ax; -	struct pt_regs tregs;  	frame = (struct rt_sigframe_x32 __user *)(regs->sp - 8); @@ -879,8 +861,7 @@ asmlinkage long sys32_x32_rt_sigreturn(struct pt_regs *regs)  	if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))  		goto badframe; -	tregs = *regs; -	if (sys32_sigaltstack(&frame->uc.uc_stack, NULL, &tregs) == -EFAULT) +	if (compat_restore_altstack(&frame->uc.uc_stack))  		goto badframe;  	return ax; diff --git a/arch/x86/kernel/step.c b/arch/x86/kernel/step.c index cd3b2438a98..9b4d51d0c0d 100644 --- a/arch/x86/kernel/step.c +++ b/arch/x86/kernel/step.c @@ -165,10 +165,11 @@ void set_task_blockstep(struct task_struct *task, bool on)  	 * Ensure irq/preemption can't change debugctl in between.  	 * Note also that both TIF_BLOCKSTEP and debugctl should  	 * be changed atomically wrt preemption. -	 * FIXME: this means that set/clear TIF_BLOCKSTEP is simply -	 * wrong if task != current, SIGKILL can wakeup the stopped -	 * tracee and set/clear can play with the running task, this -	 * can confuse the next __switch_to_xtra(). +	 * +	 * NOTE: this means that set/clear TIF_BLOCKSTEP is only safe if +	 * task is current or it can't be running, otherwise we can race +	 * with __switch_to_xtra(). We rely on ptrace_freeze_traced() but +	 * PTRACE_KILL is not safe.  	 */  	local_irq_disable();  	debugctl = get_debugctlmsr(); diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index eb8586693e0..ecffca11f4e 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -69,9 +69,6 @@  asmlinkage int system_call(void); -/* Do we ignore FPU interrupts ? */ -char ignore_fpu_irq; -  /*   * The IDT has to be page-aligned to simplify the Pentium   * F0 0F bug workaround. @@ -564,9 +561,6 @@ void math_error(struct pt_regs *regs, int error_code, int trapnr)  dotraplinkage void do_coprocessor_error(struct pt_regs *regs, long error_code)  { -#ifdef CONFIG_X86_32 -	ignore_fpu_irq = 1; -#endif  	exception_enter(regs);  	math_error(regs, error_code, X86_TRAP_MF);  	exception_exit(regs); diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 76f54461f7c..c243b81e3c7 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -120,7 +120,7 @@ struct kvm_shared_msrs {  };  static struct kvm_shared_msrs_global __read_mostly shared_msrs_global; -static DEFINE_PER_CPU(struct kvm_shared_msrs, shared_msrs); +static struct kvm_shared_msrs __percpu *shared_msrs;  struct kvm_stats_debugfs_item debugfs_entries[] = {  	{ "pf_fixed", VCPU_STAT(pf_fixed) }, @@ -191,10 +191,10 @@ static void kvm_on_user_return(struct user_return_notifier *urn)  static void shared_msr_update(unsigned slot, u32 msr)  { -	struct kvm_shared_msrs *smsr;  	u64 value; +	unsigned int cpu = smp_processor_id(); +	struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu); -	smsr = &__get_cpu_var(shared_msrs);  	/* only read, and nobody should modify it at this time,  	 * so don't need lock */  	if (slot >= shared_msrs_global.nr) { @@ -226,7 +226,8 @@ static void kvm_shared_msr_cpu_online(void)  void kvm_set_shared_msr(unsigned slot, u64 value, u64 mask)  { -	struct kvm_shared_msrs *smsr = &__get_cpu_var(shared_msrs); +	unsigned int cpu = smp_processor_id(); +	struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu);  	if (((value ^ smsr->values[slot].curr) & mask) == 0)  		return; @@ -242,7 +243,8 @@ EXPORT_SYMBOL_GPL(kvm_set_shared_msr);  static void drop_user_return_notifiers(void *ignore)  { -	struct kvm_shared_msrs *smsr = &__get_cpu_var(shared_msrs); +	unsigned int cpu = smp_processor_id(); +	struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu);  	if (smsr->registered)  		kvm_on_user_return(&smsr->urn); @@ -5233,9 +5235,16 @@ int kvm_arch_init(void *opaque)  		goto out;  	} +	r = -ENOMEM; +	shared_msrs = alloc_percpu(struct kvm_shared_msrs); +	if (!shared_msrs) { +		printk(KERN_ERR "kvm: failed to allocate percpu kvm_shared_msrs\n"); +		goto out; +	} +  	r = kvm_mmu_module_init();  	if (r) -		goto out; +		goto out_free_percpu;  	kvm_set_mmio_spte_mask();  	kvm_init_msr_list(); @@ -5258,6 +5267,8 @@ int kvm_arch_init(void *opaque)  	return 0; +out_free_percpu: +	free_percpu(shared_msrs);  out:  	return r;  } @@ -5275,6 +5286,7 @@ void kvm_arch_exit(void)  #endif  	kvm_x86_ops = NULL;  	kvm_mmu_module_exit(); +	free_percpu(shared_msrs);  }  int kvm_emulate_halt(struct kvm_vcpu *vcpu) diff --git a/arch/x86/lib/delay.c b/arch/x86/lib/delay.c index e395693abdb..7c3bee636e2 100644 --- a/arch/x86/lib/delay.c +++ b/arch/x86/lib/delay.c @@ -98,7 +98,7 @@ void use_tsc_delay(void)  	delay_fn = delay_tsc;  } -int __devinit read_current_timer(unsigned long *timer_val) +int read_current_timer(unsigned long *timer_val)  {  	if (delay_fn == delay_tsc) {  		rdtscll(*timer_val); diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 0c01261fe5a..53ea60458e0 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c @@ -145,7 +145,7 @@ void __init pci_acpi_crs_quirks(void)  }  #ifdef	CONFIG_PCI_MMCONFIG -static int __devinit check_segment(u16 seg, struct device *dev, char *estr) +static int check_segment(u16 seg, struct device *dev, char *estr)  {  	if (seg) {  		dev_err(dev, @@ -168,9 +168,8 @@ static int __devinit check_segment(u16 seg, struct device *dev, char *estr)  	return 0;  } -static int __devinit setup_mcfg_map(struct pci_root_info *info, -				    u16 seg, u8 start, u8 end, -				    phys_addr_t addr) +static int setup_mcfg_map(struct pci_root_info *info, u16 seg, u8 start, +			  u8 end, phys_addr_t addr)  {  	int result;  	struct device *dev = &info->bridge->dev; @@ -208,7 +207,7 @@ static void teardown_mcfg_map(struct pci_root_info *info)  	}  }  #else -static int __devinit setup_mcfg_map(struct pci_root_info *info, +static int setup_mcfg_map(struct pci_root_info *info,  				    u16 seg, u8 start, u8 end,  				    phys_addr_t addr)  { @@ -474,7 +473,7 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device,  				info);  } -struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root) +struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)  {  	struct acpi_device *device = root->device;  	struct pci_root_info *info = NULL; diff --git a/arch/x86/pci/bus_numa.c b/arch/x86/pci/bus_numa.c index d37e2fec97e..c2735feb250 100644 --- a/arch/x86/pci/bus_numa.c +++ b/arch/x86/pci/bus_numa.c @@ -93,8 +93,8 @@ struct pci_root_info __init *alloc_pci_root_info(int bus_min, int bus_max,  	return info;  } -void __devinit update_res(struct pci_root_info *info, resource_size_t start, -			  resource_size_t end, unsigned long flags, int merge) +void update_res(struct pci_root_info *info, resource_size_t start, +		resource_size_t end, unsigned long flags, int merge)  {  	struct resource *res;  	struct pci_root_res *root_res; diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 1b1dda90a94..ccd0ab3ab89 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -81,14 +81,14 @@ struct pci_ops pci_root_ops = {   */  DEFINE_RAW_SPINLOCK(pci_config_lock); -static int __devinit can_skip_ioresource_align(const struct dmi_system_id *d) +static int can_skip_ioresource_align(const struct dmi_system_id *d)  {  	pci_probe |= PCI_CAN_SKIP_ISA_ALIGN;  	printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident);  	return 0;  } -static const struct dmi_system_id can_skip_pciprobe_dmi_table[] __devinitconst = { +static const struct dmi_system_id can_skip_pciprobe_dmi_table[] = {  /*   * Systems where PCI IO resource ISA alignment can be skipped   * when the ISA enable bit in the bridge control is not set @@ -125,7 +125,7 @@ void __init dmi_check_skip_isa_align(void)  	dmi_check_system(can_skip_pciprobe_dmi_table);  } -static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) +static void pcibios_fixup_device_resources(struct pci_dev *dev)  {  	struct resource *rom_r = &dev->resource[PCI_ROM_RESOURCE];  	struct resource *bar_r; @@ -162,7 +162,7 @@ static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)   *  are examined.   */ -void __devinit pcibios_fixup_bus(struct pci_bus *b) +void pcibios_fixup_bus(struct pci_bus *b)  {  	struct pci_dev *dev; @@ -176,7 +176,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *b)   * on the kernel command line (which was parsed earlier).   */ -static int __devinit set_bf_sort(const struct dmi_system_id *d) +static int set_bf_sort(const struct dmi_system_id *d)  {  	if (pci_bf_sort == pci_bf_sort_default) {  		pci_bf_sort = pci_dmi_bf; @@ -185,7 +185,7 @@ static int __devinit set_bf_sort(const struct dmi_system_id *d)  	return 0;  } -static void __devinit read_dmi_type_b1(const struct dmi_header *dm, +static void read_dmi_type_b1(const struct dmi_header *dm,  				       void *private_data)  {  	u8 *d = (u8 *)dm + 4; @@ -207,7 +207,7 @@ static void __devinit read_dmi_type_b1(const struct dmi_header *dm,  	}  } -static int __devinit find_sort_method(const struct dmi_system_id *d) +static int find_sort_method(const struct dmi_system_id *d)  {  	dmi_walk(read_dmi_type_b1, NULL); @@ -222,7 +222,7 @@ static int __devinit find_sort_method(const struct dmi_system_id *d)   * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus)   */  #ifdef __i386__ -static int __devinit assign_all_busses(const struct dmi_system_id *d) +static int assign_all_busses(const struct dmi_system_id *d)  {  	pci_probe |= PCI_ASSIGN_ALL_BUSSES;  	printk(KERN_INFO "%s detected: enabling PCI bus# renumbering" @@ -231,7 +231,7 @@ static int __devinit assign_all_busses(const struct dmi_system_id *d)  }  #endif -static int __devinit set_scan_all(const struct dmi_system_id *d) +static int set_scan_all(const struct dmi_system_id *d)  {  	printk(KERN_INFO "PCI: %s detected, enabling pci=pcie_scan_all\n",  	       d->ident); @@ -239,7 +239,7 @@ static int __devinit set_scan_all(const struct dmi_system_id *d)  	return 0;  } -static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = { +static const struct dmi_system_id pciprobe_dmi_table[] = {  #ifdef __i386__  /*   * Laptops which need pci=assign-busses to see Cardbus cards @@ -434,7 +434,8 @@ static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = {  		.callback = set_scan_all,  		.ident = "Stratus/NEC ftServer",  		.matches = { -			DMI_MATCH(DMI_SYS_VENDOR, "ftServer"), +			DMI_MATCH(DMI_SYS_VENDOR, "Stratus"), +			DMI_MATCH(DMI_PRODUCT_NAME, "ftServer"),  		},  	},  	{} @@ -445,7 +446,7 @@ void __init dmi_check_pciprobe(void)  	dmi_check_system(pciprobe_dmi_table);  } -struct pci_bus * __devinit pcibios_scan_root(int busnum) +struct pci_bus *pcibios_scan_root(int busnum)  {  	struct pci_bus *bus = NULL; @@ -664,7 +665,7 @@ int pci_ext_cfg_avail(void)  		return 0;  } -struct pci_bus * __devinit pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node) +struct pci_bus *pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node)  {  	LIST_HEAD(resources);  	struct pci_bus *bus = NULL; @@ -692,7 +693,7 @@ struct pci_bus * __devinit pci_scan_bus_on_node(int busno, struct pci_ops *ops,  	return bus;  } -struct pci_bus * __devinit pci_scan_bus_with_sysdata(int busno) +struct pci_bus *pci_scan_bus_with_sysdata(int busno)  {  	return pci_scan_bus_on_node(busno, &pci_root_ops, -1);  } diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index af8a224db21..f5809fa2753 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c @@ -9,7 +9,7 @@  #include <linux/vgaarb.h>  #include <asm/pci_x86.h> -static void __devinit pci_fixup_i450nx(struct pci_dev *d) +static void pci_fixup_i450nx(struct pci_dev *d)  {  	/*  	 * i450NX -- Find and scan all secondary buses on all PXB's. @@ -34,7 +34,7 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d)  }  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, pci_fixup_i450nx); -static void __devinit pci_fixup_i450gx(struct pci_dev *d) +static void pci_fixup_i450gx(struct pci_dev *d)  {  	/*  	 * i450GX and i450KX -- Find and scan all secondary buses. @@ -48,7 +48,7 @@ static void __devinit pci_fixup_i450gx(struct pci_dev *d)  }  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, pci_fixup_i450gx); -static void __devinit  pci_fixup_umc_ide(struct pci_dev *d) +static void pci_fixup_umc_ide(struct pci_dev *d)  {  	/*  	 * UM8886BF IDE controller sets region type bits incorrectly, @@ -62,7 +62,7 @@ static void __devinit  pci_fixup_umc_ide(struct pci_dev *d)  }  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, pci_fixup_umc_ide); -static void __devinit  pci_fixup_ncr53c810(struct pci_dev *d) +static void pci_fixup_ncr53c810(struct pci_dev *d)  {  	/*  	 * NCR 53C810 returns class code 0 (at least on some systems). @@ -75,7 +75,7 @@ static void __devinit  pci_fixup_ncr53c810(struct pci_dev *d)  }  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, pci_fixup_ncr53c810); -static void __devinit  pci_fixup_latency(struct pci_dev *d) +static void pci_fixup_latency(struct pci_dev *d)  {  	/*  	 *  SiS 5597 and 5598 chipsets require latency timer set to @@ -87,7 +87,7 @@ static void __devinit  pci_fixup_latency(struct pci_dev *d)  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5597, pci_fixup_latency);  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5598, pci_fixup_latency); -static void __devinit pci_fixup_piix4_acpi(struct pci_dev *d) +static void pci_fixup_piix4_acpi(struct pci_dev *d)  {  	/*  	 * PIIX4 ACPI device: hardwired IRQ9 @@ -163,7 +163,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8367_0, pci_fixup_   * system to PCI bus no matter what are their window settings, so they are   * "transparent" (or subtractive decoding) from programmers point of view.   */ -static void __devinit pci_fixup_transparent_bridge(struct pci_dev *dev) +static void pci_fixup_transparent_bridge(struct pci_dev *dev)  {  	if ((dev->device & 0xff00) == 0x2400)  		dev->transparent = 1; @@ -317,7 +317,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_MCH_PC1,	pcie_r   * video device at this point.   */ -static void __devinit pci_fixup_video(struct pci_dev *pdev) +static void pci_fixup_video(struct pci_dev *pdev)  {  	struct pci_dev *bridge;  	struct pci_bus *bus; @@ -357,7 +357,7 @@ DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,  				PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video); -static const struct dmi_system_id __devinitconst msi_k8t_dmi_table[] = { +static const struct dmi_system_id msi_k8t_dmi_table[] = {  	{  		.ident = "MSI-K8T-Neo2Fir",  		.matches = { @@ -378,7 +378,7 @@ static const struct dmi_system_id __devinitconst msi_k8t_dmi_table[] = {   * The soundcard is only enabled, if the mainborad is identified   * via DMI-tables and the soundcard is detected to be off.   */ -static void __devinit pci_fixup_msi_k8t_onboard_sound(struct pci_dev *dev) +static void pci_fixup_msi_k8t_onboard_sound(struct pci_dev *dev)  {  	unsigned char val;  	if (!dmi_check_system(msi_k8t_dmi_table)) @@ -414,7 +414,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237,   */  static u16 toshiba_line_size; -static const struct dmi_system_id __devinitconst toshiba_ohci1394_dmi_table[] = { +static const struct dmi_system_id toshiba_ohci1394_dmi_table[] = {  	{  		.ident = "Toshiba PS5 based laptop",  		.matches = { @@ -439,7 +439,7 @@ static const struct dmi_system_id __devinitconst toshiba_ohci1394_dmi_table[] =  	{ }  }; -static void __devinit pci_pre_fixup_toshiba_ohci1394(struct pci_dev *dev) +static void pci_pre_fixup_toshiba_ohci1394(struct pci_dev *dev)  {  	if (!dmi_check_system(toshiba_ohci1394_dmi_table))  		return; /* only applies to certain Toshibas (so far) */ @@ -450,7 +450,7 @@ static void __devinit pci_pre_fixup_toshiba_ohci1394(struct pci_dev *dev)  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, 0x8032,  			 pci_pre_fixup_toshiba_ohci1394); -static void __devinit pci_post_fixup_toshiba_ohci1394(struct pci_dev *dev) +static void pci_post_fixup_toshiba_ohci1394(struct pci_dev *dev)  {  	if (!dmi_check_system(toshiba_ohci1394_dmi_table))  		return; /* only applies to certain Toshibas (so far) */ @@ -488,7 +488,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY,   * Siemens Nixdorf AG FSC Multiprocessor Interrupt Controller:   * prevent update of the BAR0, which doesn't look like a normal BAR.   */ -static void __devinit pci_siemens_interrupt_controller(struct pci_dev *dev) +static void pci_siemens_interrupt_controller(struct pci_dev *dev)  {  	dev->resource[0].flags |= IORESOURCE_PCI_FIXED;  } @@ -531,7 +531,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATI, 0x4385, sb600_disable_hpet_bar);   *   * Match off the LPC and svid/sdid (older kernels lose the bridge subvendor)   */ -static void __devinit twinhead_reserve_killing_zone(struct pci_dev *dev) +static void twinhead_reserve_killing_zone(struct pci_dev *dev)  {          if (dev->subsystem_vendor == 0x14FF && dev->subsystem_device == 0xA003) {                  pr_info("Reserving memory on Twinhead H12Y\n"); diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c index a1df191129d..4a2ab9cb365 100644 --- a/arch/x86/pci/legacy.c +++ b/arch/x86/pci/legacy.c @@ -10,7 +10,7 @@   * Discover remaining PCI buses in case there are peer host bridges.   * We use the number of last PCI bus provided by the PCI BIOS.   */ -static void __devinit pcibios_fixup_peer_bridges(void) +static void pcibios_fixup_peer_bridges(void)  {  	int n; @@ -34,7 +34,7 @@ int __init pci_legacy_init(void)  	return 0;  } -void __devinit pcibios_scan_specific_bus(int busn) +void pcibios_scan_specific_bus(int busn)  {  	int devfn;  	long node; diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 704b9ec043d..fb29968a7cd 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c @@ -49,7 +49,7 @@ static __init void free_all_mmcfg(void)  		pci_mmconfig_remove(cfg);  } -static __devinit void list_add_sorted(struct pci_mmcfg_region *new) +static void list_add_sorted(struct pci_mmcfg_region *new)  {  	struct pci_mmcfg_region *cfg; @@ -65,9 +65,8 @@ static __devinit void list_add_sorted(struct pci_mmcfg_region *new)  	list_add_tail_rcu(&new->list, &pci_mmcfg_list);  } -static __devinit struct pci_mmcfg_region *pci_mmconfig_alloc(int segment, -							     int start, -							     int end, u64 addr) +static struct pci_mmcfg_region *pci_mmconfig_alloc(int segment, int start, +						   int end, u64 addr)  {  	struct pci_mmcfg_region *new;  	struct resource *res; @@ -371,8 +370,7 @@ static int __init pci_mmcfg_check_hostbridge(void)  	return !list_empty(&pci_mmcfg_list);  } -static acpi_status __devinit check_mcfg_resource(struct acpi_resource *res, -						 void *data) +static acpi_status check_mcfg_resource(struct acpi_resource *res, void *data)  {  	struct resource *mcfg_res = data;  	struct acpi_resource_address64 address; @@ -408,8 +406,8 @@ static acpi_status __devinit check_mcfg_resource(struct acpi_resource *res,  	return AE_OK;  } -static acpi_status __devinit find_mboard_resource(acpi_handle handle, u32 lvl, -						  void *context, void **rv) +static acpi_status find_mboard_resource(acpi_handle handle, u32 lvl, +					void *context, void **rv)  {  	struct resource *mcfg_res = context; @@ -422,7 +420,7 @@ static acpi_status __devinit find_mboard_resource(acpi_handle handle, u32 lvl,  	return AE_OK;  } -static int __devinit is_acpi_reserved(u64 start, u64 end, unsigned not_used) +static int is_acpi_reserved(u64 start, u64 end, unsigned not_used)  {  	struct resource mcfg_res; @@ -693,9 +691,8 @@ static int __init pci_mmcfg_late_insert_resources(void)  late_initcall(pci_mmcfg_late_insert_resources);  /* Add MMCFG information for host bridges */ -int __devinit pci_mmconfig_insert(struct device *dev, -				  u16 seg, u8 start, u8 end, -				  phys_addr_t addr) +int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end, +			phys_addr_t addr)  {  	int rc;  	struct resource *tmp = NULL; diff --git a/arch/x86/pci/mmconfig_32.c b/arch/x86/pci/mmconfig_32.c index db63ac23e3d..5c90975cdf0 100644 --- a/arch/x86/pci/mmconfig_32.c +++ b/arch/x86/pci/mmconfig_32.c @@ -142,7 +142,7 @@ void __init pci_mmcfg_arch_free(void)  {  } -int __devinit pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg) +int pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg)  {  	return 0;  } diff --git a/arch/x86/pci/mmconfig_64.c b/arch/x86/pci/mmconfig_64.c index d4ebd07c306..bea52496aea 100644 --- a/arch/x86/pci/mmconfig_64.c +++ b/arch/x86/pci/mmconfig_64.c @@ -95,7 +95,7 @@ const struct pci_raw_ops pci_mmcfg = {  	.write =	pci_mmcfg_write,  }; -static void __iomem * __devinit mcfg_ioremap(struct pci_mmcfg_region *cfg) +static void __iomem *mcfg_ioremap(struct pci_mmcfg_region *cfg)  {  	void __iomem *addr;  	u64 start, size; @@ -133,7 +133,7 @@ void __init pci_mmcfg_arch_free(void)  		pci_mmcfg_arch_unmap(cfg);  } -int __devinit pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg) +int pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg)  {  	cfg->virt = mcfg_ioremap(cfg);  	if (!cfg->virt) { diff --git a/arch/x86/pci/mrst.c b/arch/x86/pci/mrst.c index e14a2ff708b..6eb18c42a28 100644 --- a/arch/x86/pci/mrst.c +++ b/arch/x86/pci/mrst.c @@ -247,7 +247,7 @@ int __init pci_mrst_init(void)  /* Langwell devices are not true pci devices, they are not subject to 10 ms   * d3 to d0 delay required by pci spec.   */ -static void __devinit pci_d3delay_fixup(struct pci_dev *dev) +static void pci_d3delay_fixup(struct pci_dev *dev)  {  	/* PCI fixups are effectively decided compile time. If we have a dual  	   SoC/non-SoC kernel we don't want to mangle d3 on non SoC devices */ @@ -262,7 +262,7 @@ static void __devinit pci_d3delay_fixup(struct pci_dev *dev)  }  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_d3delay_fixup); -static void __devinit mrst_power_off_unused_dev(struct pci_dev *dev) +static void mrst_power_off_unused_dev(struct pci_dev *dev)  {  	pci_set_power_state(dev, PCI_D3hot);  } @@ -275,7 +275,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0815, mrst_power_off_unused_dev);  /*   * Langwell devices reside at fixed offsets, don't try to move them.   */ -static void __devinit pci_fixed_bar_fixup(struct pci_dev *dev) +static void pci_fixed_bar_fixup(struct pci_dev *dev)  {  	unsigned long offset;  	u32 size; diff --git a/arch/x86/pci/numaq_32.c b/arch/x86/pci/numaq_32.c index 83e125b95ca..b96b14c250b 100644 --- a/arch/x86/pci/numaq_32.c +++ b/arch/x86/pci/numaq_32.c @@ -116,7 +116,7 @@ static const struct pci_raw_ops pci_direct_conf1_mq = {  }; -static void __devinit pci_fixup_i450nx(struct pci_dev *d) +static void pci_fixup_i450nx(struct pci_dev *d)  {  	/*  	 * i450NX -- Find and scan all secondary buses on all PXB's. diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c index da8fe0535ff..c77b24a8b2d 100644 --- a/arch/x86/pci/pcbios.c +++ b/arch/x86/pci/pcbios.c @@ -124,7 +124,7 @@ static struct {  static int pci_bios_present; -static int __devinit check_pcibios(void) +static int check_pcibios(void)  {  	u32 signature, eax, ebx, ecx;  	u8 status, major_ver, minor_ver, hw_mech; @@ -312,7 +312,7 @@ static const struct pci_raw_ops pci_bios_access = {   * Try to find PCI BIOS.   */ -static const struct pci_raw_ops * __devinit pci_find_bios(void) +static const struct pci_raw_ops *pci_find_bios(void)  {  	union bios32 *check;  	unsigned char sum; diff --git a/arch/x86/platform/iris/iris.c b/arch/x86/platform/iris/iris.c index 5917eb56b31..e6cb80f620a 100644 --- a/arch/x86/platform/iris/iris.c +++ b/arch/x86/platform/iris/iris.c @@ -23,6 +23,7 @@  #include <linux/moduleparam.h>  #include <linux/module.h> +#include <linux/platform_device.h>  #include <linux/kernel.h>  #include <linux/errno.h>  #include <linux/delay.h> @@ -62,29 +63,75 @@ static void iris_power_off(void)   * by reading its input port and seeing whether the read value is   * meaningful.   */ -static int iris_init(void) +static int iris_probe(struct platform_device *pdev)  { -	unsigned char status; -	if (force != 1) { -		printk(KERN_ERR "The force parameter has not been set to 1 so the Iris poweroff handler will not be installed.\n"); -		return -ENODEV; -	} -	status = inb(IRIS_GIO_INPUT); +	unsigned char status = inb(IRIS_GIO_INPUT);  	if (status == IRIS_GIO_NODEV) { -		printk(KERN_ERR "This machine does not seem to be an Iris. Power_off handler not installed.\n"); +		printk(KERN_ERR "This machine does not seem to be an Iris. " +			"Power off handler not installed.\n");  		return -ENODEV;  	}  	old_pm_power_off = pm_power_off;  	pm_power_off = &iris_power_off;  	printk(KERN_INFO "Iris power_off handler installed.\n"); -  	return 0;  } -static void iris_exit(void) +static int iris_remove(struct platform_device *pdev)  {  	pm_power_off = old_pm_power_off;  	printk(KERN_INFO "Iris power_off handler uninstalled.\n"); +	return 0; +} + +static struct platform_driver iris_driver = { +	.driver		= { +		.name   = "iris", +		.owner  = THIS_MODULE, +	}, +	.probe          = iris_probe, +	.remove         = iris_remove, +}; + +static struct resource iris_resources[] = { +	{ +		.start  = IRIS_GIO_BASE, +		.end    = IRIS_GIO_OUTPUT, +		.flags  = IORESOURCE_IO, +		.name   = "address" +	} +}; + +static struct platform_device *iris_device; + +static int iris_init(void) +{ +	int ret; +	if (force != 1) { +		printk(KERN_ERR "The force parameter has not been set to 1." +			" The Iris poweroff handler will not be installed.\n"); +		return -ENODEV; +	} +	ret = platform_driver_register(&iris_driver); +	if (ret < 0) { +		printk(KERN_ERR "Failed to register iris platform driver: %d\n", +			ret); +		return ret; +	} +	iris_device = platform_device_register_simple("iris", (-1), +				iris_resources, ARRAY_SIZE(iris_resources)); +	if (IS_ERR(iris_device)) { +		printk(KERN_ERR "Failed to register iris platform device\n"); +		platform_driver_unregister(&iris_driver); +		return PTR_ERR(iris_device); +	} +	return 0; +} + +static void iris_exit(void) +{ +	platform_device_unregister(iris_device); +	platform_driver_unregister(&iris_driver);  }  module_init(iris_init); diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c index fd41a9262d6..e31bcd8f2ee 100644 --- a/arch/x86/platform/mrst/mrst.c +++ b/arch/x86/platform/mrst/mrst.c @@ -782,7 +782,7 @@ BLOCKING_NOTIFIER_HEAD(intel_scu_notifier);  EXPORT_SYMBOL_GPL(intel_scu_notifier);  /* Called by IPC driver */ -void __devinit intel_scu_devices_create(void) +void intel_scu_devices_create(void)  {  	int i; diff --git a/arch/x86/platform/olpc/olpc-xo1-pm.c b/arch/x86/platform/olpc/olpc-xo1-pm.c index d75582d1aa5..ff0174dda81 100644 --- a/arch/x86/platform/olpc/olpc-xo1-pm.c +++ b/arch/x86/platform/olpc/olpc-xo1-pm.c @@ -121,7 +121,7 @@ static const struct platform_suspend_ops xo1_suspend_ops = {  	.enter = xo1_power_state_enter,  }; -static int __devinit xo1_pm_probe(struct platform_device *pdev) +static int xo1_pm_probe(struct platform_device *pdev)  {  	struct resource *res;  	int err; @@ -154,7 +154,7 @@ static int __devinit xo1_pm_probe(struct platform_device *pdev)  	return 0;  } -static int __devexit xo1_pm_remove(struct platform_device *pdev) +static int xo1_pm_remove(struct platform_device *pdev)  {  	mfd_cell_disable(pdev); @@ -173,7 +173,7 @@ static struct platform_driver cs5535_pms_driver = {  		.owner = THIS_MODULE,  	},  	.probe = xo1_pm_probe, -	.remove = __devexit_p(xo1_pm_remove), +	.remove = xo1_pm_remove,  };  static struct platform_driver cs5535_acpi_driver = { @@ -182,7 +182,7 @@ static struct platform_driver cs5535_acpi_driver = {  		.owner = THIS_MODULE,  	},  	.probe = xo1_pm_probe, -	.remove = __devexit_p(xo1_pm_remove), +	.remove = xo1_pm_remove,  };  static int __init xo1_pm_init(void) diff --git a/arch/x86/platform/olpc/olpc-xo1-sci.c b/arch/x86/platform/olpc/olpc-xo1-sci.c index 63d4aa40956..74704be7b1f 100644 --- a/arch/x86/platform/olpc/olpc-xo1-sci.c +++ b/arch/x86/platform/olpc/olpc-xo1-sci.c @@ -309,7 +309,7 @@ static int xo1_sci_resume(struct platform_device *pdev)  	return 0;  } -static int __devinit setup_sci_interrupt(struct platform_device *pdev) +static int setup_sci_interrupt(struct platform_device *pdev)  {  	u32 lo, hi;  	u32 sts; @@ -351,7 +351,7 @@ static int __devinit setup_sci_interrupt(struct platform_device *pdev)  	return r;  } -static int __devinit setup_ec_sci(void) +static int setup_ec_sci(void)  {  	int r; @@ -395,7 +395,7 @@ static void free_ec_sci(void)  	gpio_free(OLPC_GPIO_ECSCI);  } -static int __devinit setup_lid_events(void) +static int setup_lid_events(void)  {  	int r; @@ -432,7 +432,7 @@ static void free_lid_events(void)  	gpio_free(OLPC_GPIO_LID);  } -static int __devinit setup_power_button(struct platform_device *pdev) +static int setup_power_button(struct platform_device *pdev)  {  	int r; @@ -463,7 +463,7 @@ static void free_power_button(void)  	input_free_device(power_button_idev);  } -static int __devinit setup_ebook_switch(struct platform_device *pdev) +static int setup_ebook_switch(struct platform_device *pdev)  {  	int r; @@ -494,7 +494,7 @@ static void free_ebook_switch(void)  	input_free_device(ebook_switch_idev);  } -static int __devinit setup_lid_switch(struct platform_device *pdev) +static int setup_lid_switch(struct platform_device *pdev)  {  	int r; @@ -538,7 +538,7 @@ static void free_lid_switch(void)  	input_free_device(lid_switch_idev);  } -static int __devinit xo1_sci_probe(struct platform_device *pdev) +static int xo1_sci_probe(struct platform_device *pdev)  {  	struct resource *res;  	int r; @@ -613,7 +613,7 @@ err_ebook:  	return r;  } -static int __devexit xo1_sci_remove(struct platform_device *pdev) +static int xo1_sci_remove(struct platform_device *pdev)  {  	mfd_cell_disable(pdev);  	free_irq(sci_irq, pdev); @@ -632,7 +632,7 @@ static struct platform_driver xo1_sci_driver = {  		.name = "olpc-xo1-sci-acpi",  	},  	.probe = xo1_sci_probe, -	.remove = __devexit_p(xo1_sci_remove), +	.remove = xo1_sci_remove,  	.suspend = xo1_sci_suspend,  	.resume = xo1_sci_resume,  }; diff --git a/arch/x86/platform/scx200/scx200_32.c b/arch/x86/platform/scx200/scx200_32.c index 7a9ad30d6c9..3dc9aee41d9 100644 --- a/arch/x86/platform/scx200/scx200_32.c +++ b/arch/x86/platform/scx200/scx200_32.c @@ -35,7 +35,7 @@ static struct pci_device_id scx200_tbl[] = {  };  MODULE_DEVICE_TABLE(pci,scx200_tbl); -static int __devinit scx200_probe(struct pci_dev *, const struct pci_device_id *); +static int scx200_probe(struct pci_dev *, const struct pci_device_id *);  static struct pci_driver scx200_pci_driver = {  	.name = "scx200", @@ -45,7 +45,7 @@ static struct pci_driver scx200_pci_driver = {  static DEFINE_MUTEX(scx200_gpio_config_lock); -static void __devinit scx200_init_shadow(void) +static void scx200_init_shadow(void)  {  	int bank; @@ -54,7 +54,7 @@ static void __devinit scx200_init_shadow(void)  		scx200_gpio_shadow[bank] = inl(scx200_gpio_base + 0x10 * bank);  } -static int __devinit scx200_probe(struct pci_dev *pdev, const struct pci_device_id *ent) +static int scx200_probe(struct pci_dev *pdev, const struct pci_device_id *ent)  {  	unsigned base; diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl index ee3c220ee50..28e3fa9056e 100644 --- a/arch/x86/syscalls/syscall_32.tbl +++ b/arch/x86/syscalls/syscall_32.tbl @@ -192,7 +192,7 @@  183	i386	getcwd			sys_getcwd  184	i386	capget			sys_capget  185	i386	capset			sys_capset -186	i386	sigaltstack		ptregs_sigaltstack		stub32_sigaltstack +186	i386	sigaltstack		sys_sigaltstack			compat_sys_sigaltstack  187	i386	sendfile		sys_sendfile			sys32_sendfile  188	i386	getpmsg  189	i386	putpmsg @@ -356,3 +356,4 @@  347	i386	process_vm_readv	sys_process_vm_readv		compat_sys_process_vm_readv  348	i386	process_vm_writev	sys_process_vm_writev		compat_sys_process_vm_writev  349	i386	kcmp			sys_kcmp +350	i386	finit_module		sys_finit_module diff --git a/arch/x86/syscalls/syscall_64.tbl b/arch/x86/syscalls/syscall_64.tbl index a582bfed95b..dc97328bd90 100644 --- a/arch/x86/syscalls/syscall_64.tbl +++ b/arch/x86/syscalls/syscall_64.tbl @@ -137,7 +137,7 @@  128	64	rt_sigtimedwait		sys_rt_sigtimedwait  129	64	rt_sigqueueinfo		sys_rt_sigqueueinfo  130	common	rt_sigsuspend		sys_rt_sigsuspend -131	64	sigaltstack		stub_sigaltstack +131	64	sigaltstack		sys_sigaltstack  132	common	utime			sys_utime  133	common	mknod			sys_mknod  134	64	uselib @@ -319,6 +319,7 @@  310	64	process_vm_readv	sys_process_vm_readv  311	64	process_vm_writev	sys_process_vm_writev  312	common	kcmp			sys_kcmp +313	common	finit_module		sys_finit_module  #  # x32-specific system call numbers start at 512 to avoid cache impact @@ -337,7 +338,7 @@  522	x32	rt_sigpending		sys32_rt_sigpending  523	x32	rt_sigtimedwait		compat_sys_rt_sigtimedwait  524	x32	rt_sigqueueinfo		sys32_rt_sigqueueinfo -525	x32	sigaltstack		stub_x32_sigaltstack +525	x32	sigaltstack		compat_sys_sigaltstack  526	x32	timer_create		compat_sys_timer_create  527	x32	mq_notify		compat_sys_mq_notify  528	x32	kexec_load		compat_sys_kexec_load diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig index 98399704196..53c90fd412d 100644 --- a/arch/x86/um/Kconfig +++ b/arch/x86/um/Kconfig @@ -13,8 +13,7 @@ endmenu  config UML_X86  	def_bool y  	select GENERIC_FIND_FIRST_BIT -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE +	select GENERIC_SIGALTSTACK  config 64BIT  	bool "64-bit kernel" if SUBARCH = "x86" diff --git a/arch/x86/um/asm/ptrace.h b/arch/x86/um/asm/ptrace.h index 755133258c4..54f8102ccde 100644 --- a/arch/x86/um/asm/ptrace.h +++ b/arch/x86/um/asm/ptrace.h @@ -86,4 +86,5 @@ extern long arch_prctl(struct task_struct *task, int code,  		       unsigned long __user *addr);  #endif +#define user_stack_pointer(regs) PT_REGS_SP(regs)  #endif /* __UM_X86_PTRACE_H */ diff --git a/arch/x86/um/signal.c b/arch/x86/um/signal.c index bdaa08cfbcf..71cef48ea5c 100644 --- a/arch/x86/um/signal.c +++ b/arch/x86/um/signal.c @@ -342,9 +342,7 @@ static int copy_ucontext_to_user(struct ucontext __user *uc,  {  	int err = 0; -	err |= put_user(current->sas_ss_sp, &uc->uc_stack.ss_sp); -	err |= put_user(sas_ss_flags(sp), &uc->uc_stack.ss_flags); -	err |= put_user(current->sas_ss_size, &uc->uc_stack.ss_size); +	err |= __save_altstack(&uc->uc_stack, sp);  	err |= copy_sc_to_user(&uc->uc_mcontext, fp, ¤t->thread.regs, 0);  	err |= copy_to_user(&uc->uc_sigmask, set, sizeof(*set));  	return err; @@ -529,10 +527,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,  	/* Create the ucontext.  */  	err |= __put_user(0, &frame->uc.uc_flags);  	err |= __put_user(0, &frame->uc.uc_link); -	err |= __put_user(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp); -	err |= __put_user(sas_ss_flags(PT_REGS_SP(regs)), -			  &frame->uc.uc_stack.ss_flags); -	err |= __put_user(me->sas_ss_size, &frame->uc.uc_stack.ss_size); +	err |= __save_altstack(&frame->uc.uc_stack, PT_REGS_SP(regs));  	err |= copy_sc_to_user(&frame->uc.uc_mcontext, &frame->fpstate, regs,  			       set->sig[0]);  	err |= __put_user(&frame->fpstate, &frame->uc.uc_mcontext.fpstate); diff --git a/arch/x86/um/sys_call_table_32.c b/arch/x86/um/sys_call_table_32.c index 812e98c098e..a0c3b0d1a12 100644 --- a/arch/x86/um/sys_call_table_32.c +++ b/arch/x86/um/sys_call_table_32.c @@ -27,7 +27,6 @@  #define ptregs_iopl sys_iopl  #define ptregs_vm86old sys_vm86old  #define ptregs_vm86 sys_vm86 -#define ptregs_sigaltstack sys_sigaltstack  #define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void sym(void) ;  #include <asm/syscalls_32.h> diff --git a/arch/x86/um/sys_call_table_64.c b/arch/x86/um/sys_call_table_64.c index 170bd926a69..f2f0723070c 100644 --- a/arch/x86/um/sys_call_table_64.c +++ b/arch/x86/um/sys_call_table_64.c @@ -31,7 +31,6 @@  #define stub_fork sys_fork  #define stub_vfork sys_vfork  #define stub_execve sys_execve -#define stub_sigaltstack sys_sigaltstack  #define stub_rt_sigreturn sys_rt_sigreturn  #define __SYSCALL_COMMON(nr, sym, compat) __SYSCALL_64(nr, sym, compat) diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 3aeaa933b52..138e5667409 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -193,10 +193,11 @@ void xen_vcpu_restore(void)  {  	int cpu; -	for_each_online_cpu(cpu) { +	for_each_possible_cpu(cpu) {  		bool other_cpu = (cpu != smp_processor_id()); +		bool is_up = HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL); -		if (other_cpu && +		if (other_cpu && is_up &&  		    HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL))  			BUG(); @@ -205,7 +206,7 @@ void xen_vcpu_restore(void)  		if (have_vcpu_info_placement)  			xen_vcpu_setup(cpu); -		if (other_cpu && +		if (other_cpu && is_up &&  		    HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL))  			BUG();  	} diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 353c50f1870..34bc4cee888 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c @@ -254,7 +254,7 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus)  	}  	xen_init_lock_cpu(0); -	smp_store_cpu_info(0); +	smp_store_boot_cpu_info();  	cpu_data(0).x86_max_cores = 1;  	for_each_possible_cpu(i) { @@ -432,13 +432,6 @@ static void __cpuinit xen_play_dead(void) /* used only with HOTPLUG_CPU */  	play_dead_common();  	HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);  	cpu_bringup(); -	/* -	 * Balance out the preempt calls - as we are running in cpu_idle -	 * loop which has been called at bootup from cpu_bringup_and_idle. -	 * The cpucpu_bringup_and_idle called cpu_bringup which made a -	 * preempt_disable() So this preempt_enable will balance it out. -	 */ -	preempt_enable();  }  #else /* !CONFIG_HOTPLUG_CPU */ diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 2481f267be2..5aab1acabf1 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -13,10 +13,9 @@ config XTENSA  	select GENERIC_CPU_DEVICES  	select MODULES_USE_ELF_RELA  	select GENERIC_PCI_IOMAP -	select GENERIC_KERNEL_THREAD -	select GENERIC_KERNEL_EXECVE  	select ARCH_WANT_OPTIONAL_GPIOLIB  	select CLONE_BACKWARDS +	select IRQ_DOMAIN  	help  	  Xtensa processors are 32-bit RISC machines designed by Tensilica  	  primarily for embedded systems.  These processors are both @@ -150,6 +149,15 @@ config XTENSA_PLATFORM_S6105  	select SERIAL_CONSOLE  	select NO_IOPORT +config XTENSA_PLATFORM_XTFPGA +	bool "XTFPGA" +	select SERIAL_CONSOLE +	select ETHOC +	select XTENSA_CALIBRATE_CCOUNT +	help +	  XTFPGA is the name of Tensilica board family (LX60, LX110, LX200, ML605). +	  This hardware is capable of running a full Linux distribution. +  endchoice @@ -177,6 +185,17 @@ config CMDLINE  	  time by entering them here. As a minimum, you should specify the  	  memory size and the root device (e.g., mem=64M root=/dev/nfs). +config USE_OF +	bool "Flattened Device Tree support" +	select OF +	select OF_EARLY_FLATTREE +	help +	  Include support for flattened device tree machine descriptions. + +config BUILTIN_DTB +	string "DTB to build into the kernel image" +	depends on OF +  source "mm/Kconfig"  source "drivers/pcmcia/Kconfig" diff --git a/arch/xtensa/Kconfig.debug b/arch/xtensa/Kconfig.debug index 11c585295dd..a34010e0e51 100644 --- a/arch/xtensa/Kconfig.debug +++ b/arch/xtensa/Kconfig.debug @@ -2,6 +2,26 @@ menu "Kernel hacking"  source "lib/Kconfig.debug" -endmenu +config LD_NO_RELAX +	bool "Disable linker relaxation" +	default n +	help +	  Enable this function to disable link-time optimizations. +	  The default linker behavior is to combine identical literal +	  values to reduce code size and remove unnecessary overhead from +	  assembler-generated 'longcall' sequences. +	  Enabling this option improves the link time but increases the +	  code size, and possibly execution time. + +config S32C1I_SELFTEST +	bool "Perform S32C1I instruction self-test at boot" +	default y +	help +	  Enable this option to test S32C1I instruction behavior at boot. +	  Correct operation of this instruction requires some cooperation from hardware +	  external to the processor (such as bus bridge, bus fabric, or memory controller). +	  It is easy to make wrong hardware configuration, this test should catch it early. +	  Say 'N' on stable hardware. +endmenu diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile index bb5ba61723f..0aa72702f17 100644 --- a/arch/xtensa/Makefile +++ b/arch/xtensa/Makefile @@ -38,6 +38,7 @@ endif  platform-$(CONFIG_XTENSA_PLATFORM_XT2000)	:= xt2000  platform-$(CONFIG_XTENSA_PLATFORM_ISS)		:= iss  platform-$(CONFIG_XTENSA_PLATFORM_S6105)	:= s6105 +platform-$(CONFIG_XTENSA_PLATFORM_XTFPGA)	:= xtfpga  PLATFORM = $(platform-y)  export PLATFORM @@ -49,6 +50,17 @@ KBUILD_CFLAGS += -pipe -mlongcalls  KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,) +ifneq ($(CONFIG_LD_NO_RELAX),) +LDFLAGS := --no-relax +endif + +ifeq ($(shell echo -e __XTENSA_EB__ | $(CC) -E - | grep -v "\#"),1) +CHECKFLAGS += -D__XTENSA_EB__ +endif +ifeq ($(shell echo -e __XTENSA_EL__ | $(CC) -E - | grep -v "\#"),1) +CHECKFLAGS += -D__XTENSA_EL__ +endif +  vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))  plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y)) @@ -75,6 +87,10 @@ core-y		+= $(buildvar) $(buildplf)  libs-y		+= arch/xtensa/lib/ $(LIBGCC) +ifneq ($(CONFIG_BUILTIN_DTB),"") +core-$(CONFIG_OF) += arch/xtensa/boot/ +endif +  boot		:= arch/xtensa/boot  all: zImage @@ -84,7 +100,9 @@ bzImage : zImage  zImage: vmlinux  	$(Q)$(MAKE) $(build)=$(boot) $@ +%.dtb: +	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ +  define archhelp    @echo '* zImage      - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'  endef - diff --git a/arch/xtensa/boot/Makefile b/arch/xtensa/boot/Makefile index 4018f899419..818647e815d 100644 --- a/arch/xtensa/boot/Makefile +++ b/arch/xtensa/boot/Makefile @@ -22,12 +22,35 @@ subdir-y	:= lib  # Subdirs for the boot loader(s)  bootdir-$(CONFIG_XTENSA_PLATFORM_ISS)	 += boot-elf -bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf +bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf boot-uboot +bootdir-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += boot-redboot boot-elf boot-uboot +BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB)).dtb.o +ifneq ($(CONFIG_BUILTIN_DTB),"") +obj-$(CONFIG_OF) += $(BUILTIN_DTB) +endif + +# Rule to build device tree blobs +$(obj)/%.dtb: $(src)/dts/%.dts FORCE +	$(call if_changed_dep,dtc) + +clean-files := *.dtb.S +  zImage Image: $(bootdir-y)  $(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \  	      $(addprefix $(obj)/,$(host-progs))  	$(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS) +OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary + +vmlinux.bin: vmlinux FORCE +	$(call if_changed,objcopy) + +vmlinux.bin.gz: vmlinux.bin FORCE +	$(call if_changed,gzip) + +boot-elf: vmlinux.bin +boot-redboot: vmlinux.bin.gz +boot-uboot: vmlinux.bin.gz diff --git a/arch/xtensa/boot/boot-elf/Makefile b/arch/xtensa/boot/boot-elf/Makefile index f10992b8902..1fe01b78c12 100644 --- a/arch/xtensa/boot/boot-elf/Makefile +++ b/arch/xtensa/boot/boot-elf/Makefile @@ -4,9 +4,6 @@  # for more details.  # -GZIP = gzip -GZIP_FLAGS = -v9fc -  ifeq ($(BIG_ENDIAN),1)  OBJCOPY_ARGS    := -O elf32-xtensa-be  else @@ -20,18 +17,17 @@ boot-y		:= bootstrap.o  OBJS		:= $(addprefix $(obj)/,$(boot-y)) -vmlinux.tmp: vmlinux -	$(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \ -		$^ $@ - -Image:	vmlinux.tmp $(OBJS) arch/$(ARCH)/boot/boot-elf/boot.lds -	$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ -		--add-section image=vmlinux.tmp \ +$(obj)/Image.o: vmlinux.bin $(OBJS) +	$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ +		--add-section image=vmlinux.bin \  		--set-section-flags image=contents,alloc,load,load,data \ -		$(OBJS) $@.tmp -	$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \ -		-T arch/$(ARCH)/boot/boot-elf/boot.lds \ -		-o arch/$(ARCH)/boot/$@.elf $@.tmp +		$(OBJS) $@ -zImage:	Image +$(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds +	$(Q)$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \ +		-T $(obj)/boot.lds \ +		--build-id=none \ +		-o $@ $(obj)/Image.o +	$(Q)$(kecho) '  Kernel: $@ is ready' +zImage:	$(obj)/../Image.elf diff --git a/arch/xtensa/boot/boot-redboot/Makefile b/arch/xtensa/boot/boot-redboot/Makefile index 25a78c6b153..8be8b943698 100644 --- a/arch/xtensa/boot/boot-redboot/Makefile +++ b/arch/xtensa/boot/boot-redboot/Makefile @@ -4,8 +4,6 @@  # for more details.  # -GZIP = gzip -GZIP_FLAGS = -v9fc  ifeq ($(BIG_ENDIAN),1)  OBJCOPY_ARGS 	:= -O elf32-xtensa-be  else @@ -21,17 +19,17 @@ LIBS	:= arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a  LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) -vmlinux.tmp: vmlinux -	$(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \ -		$^ $@ +$(obj)/zImage.o: vmlinux.bin.gz $(OBJS) +	$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ +		--add-section image=vmlinux.bin.gz \ +		--set-section-flags image=contents,alloc,load,load,data \ +		$(OBJS) $@ -vmlinux.tmp.gz: vmlinux.tmp -	$(GZIP) $(GZIP_FLAGS) $^ > $@ +$(obj)/zImage.elf: $(obj)/zImage.o $(LIBS) +	$(Q)$(LD) $(LD_ARGS) -o $@ $^ -L/xtensa-elf/lib $(LIBGCC) -zImage: vmlinux.tmp.gz $(OBJS) $(LIBS) -	$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ -		--add-section image=vmlinux.tmp.gz \ -		--set-section-flags image=contents,alloc,load,load,data \ -		$(OBJS) $@.tmp -	$(LD) $(LD_ARGS) -o $@.elf $@.tmp $(LIBS) -L/xtensa-elf/lib $(LIBGCC) -	$(OBJCOPY) -S -O binary $@.elf arch/$(ARCH)/boot/$@.redboot +$(obj)/../zImage.redboot: $(obj)/zImage.elf +	$(Q)$(OBJCOPY) -S -O binary $< $@ +	$(Q)$(kecho) '  Kernel: $@ is ready' + +zImage: $(obj)/../zImage.redboot diff --git a/arch/xtensa/boot/boot-uboot/Makefile b/arch/xtensa/boot/boot-uboot/Makefile new file mode 100644 index 00000000000..bfbf8af582f --- /dev/null +++ b/arch/xtensa/boot/boot-uboot/Makefile @@ -0,0 +1,14 @@ +# +# This file is subject to the terms and conditions of the GNU General Public +# License.  See the file "COPYING" in the main directory of this archive +# for more details. +# + +UIMAGE_LOADADDR = 0xd0001000 +UIMAGE_COMPRESSION = gzip + +$(obj)/../uImage: vmlinux.bin.gz FORCE +	$(call if_changed,uimage) +	$(Q)$(kecho) '  Kernel: $@ is ready' + +zImage: $(obj)/../uImage diff --git a/arch/xtensa/boot/dts/lx60.dts b/arch/xtensa/boot/dts/lx60.dts new file mode 100644 index 00000000000..2eab3658e1b --- /dev/null +++ b/arch/xtensa/boot/dts/lx60.dts @@ -0,0 +1,11 @@ +/dts-v1/; +/include/ "xtfpga.dtsi" +/include/ "xtfpga-flash-4m.dtsi" + +/ { +	compatible = "xtensa,lx60"; +	memory@0 { +		device_type = "memory"; +		reg = <0x00000000 0x04000000>; +	}; +}; diff --git a/arch/xtensa/boot/dts/ml605.dts b/arch/xtensa/boot/dts/ml605.dts new file mode 100644 index 00000000000..6ed51d6554e --- /dev/null +++ b/arch/xtensa/boot/dts/ml605.dts @@ -0,0 +1,11 @@ +/dts-v1/; +/include/ "xtfpga.dtsi" +/include/ "xtfpga-flash-16m.dtsi" + +/ { +	compatible = "xtensa,ml605"; +	memory@0 { +		device_type = "memory"; +		reg = <0x00000000 0x08000000>; +	}; +}; diff --git a/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi b/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi new file mode 100644 index 00000000000..e5703c7beeb --- /dev/null +++ b/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi @@ -0,0 +1,26 @@ +/ { +	flash: flash@f8000000 { +		#address-cells = <1>; +		#size-cells = <1>; +		compatible = "cfi-flash"; +		reg = <0xf8000000 0x01000000>; +		bank-width = <2>; +		device-width = <2>; +		partition@0x0 { +			label = "boot loader area"; +			reg = <0x00000000 0x00400000>; +		}; +		partition@0x400000 { +			label = "kernel image"; +			reg = <0x00400000 0x00600000>; +		}; +		partition@0xa00000 { +			label = "data"; +			reg = <0x00a00000 0x005e0000>; +		}; +		partition@0xfe0000 { +			label = "boot environment"; +			reg = <0x00fe0000 0x00020000>; +		}; +        }; +}; diff --git a/arch/xtensa/boot/dts/xtfpga-flash-4m.dtsi b/arch/xtensa/boot/dts/xtfpga-flash-4m.dtsi new file mode 100644 index 00000000000..6f9c10d6b68 --- /dev/null +++ b/arch/xtensa/boot/dts/xtfpga-flash-4m.dtsi @@ -0,0 +1,18 @@ +/ { +	flash: flash@f8000000 { +		#address-cells = <1>; +		#size-cells = <1>; +		compatible = "cfi-flash"; +		reg = <0xf8000000 0x00400000>; +		bank-width = <2>; +		device-width = <2>; +		partition@0x0 { +			label = "boot loader area"; +			reg = <0x00000000 0x003f0000>; +		}; +		partition@0x3f0000 { +			label = "boot environment"; +			reg = <0x003f0000 0x00010000>; +		}; +        }; +}; diff --git a/arch/xtensa/boot/dts/xtfpga.dtsi b/arch/xtensa/boot/dts/xtfpga.dtsi new file mode 100644 index 00000000000..7eda6ecf7ee --- /dev/null +++ b/arch/xtensa/boot/dts/xtfpga.dtsi @@ -0,0 +1,56 @@ +/ { +	compatible = "xtensa,xtfpga"; +	#address-cells = <1>; +	#size-cells = <1>; +	interrupt-parent = <&pic>; + +	chosen { +		bootargs = "earlycon=uart8250,mmio32,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug"; +	}; + +	memory@0 { +		device_type = "memory"; +		reg = <0x00000000 0x06000000>; +	}; + +	cpus { +		#address-cells = <1>; +		#size-cells = <0>; +		cpu@0 { +			compatible = "xtensa,cpu"; +			reg = <0>; +			/* Filled in by platform_setup from FPGA register +			 * clock-frequency = <100000000>; +			 */ +		}; +	}; + +	pic: pic { +		compatible = "xtensa,pic"; +		/* one cell: internal irq number, +		 * two cells: second cell == 0: internal irq number +		 *            second cell == 1: external irq number +		 */ +		#interrupt-cells = <2>; +		interrupt-controller; +	}; + +	serial0: serial@fd050020 { +		device_type = "serial"; +		compatible = "ns16550a"; +		no-loopback-test; +		reg = <0xfd050020 0x20>; +		reg-shift = <2>; +		interrupts = <0 1>; /* external irq 0 */ +		/* Filled in by platform_setup from FPGA register +		 * clock-frequency = <100000000>; +		 */ +	}; + +	enet0: ethoc@fd030000 { +		compatible = "opencores,ethoc"; +		reg = <0xfd030000 0x4000 0xfd800000 0x4000>; +		interrupts = <1 1>; /* external irq 1 */ +		local-mac-address = [00 50 c2 13 6f 00]; +	}; +}; diff --git a/arch/xtensa/include/asm/atomic.h b/arch/xtensa/include/asm/atomic.h index 24f50cada70..c3f289174c1 100644 --- a/arch/xtensa/include/asm/atomic.h +++ b/arch/xtensa/include/asm/atomic.h @@ -66,19 +66,35 @@   */  static inline void atomic_add(int i, atomic_t * v)  { -    unsigned int vval; +#if XCHAL_HAVE_S32C1I +	unsigned long tmp; +	int result; -    __asm__ __volatile__( -	"rsil    a15, "__stringify(LOCKLEVEL)"\n\t" -	"l32i    %0, %2, 0              \n\t" -	"add     %0, %0, %1             \n\t" -	"s32i    %0, %2, 0              \n\t" -	"wsr     a15, ps                \n\t" -	"rsync                          \n" -	: "=&a" (vval) -	: "a" (i), "a" (v) -	: "a15", "memory" -	); +	__asm__ __volatile__( +			"1:     l32i    %1, %3, 0\n" +			"       wsr     %1, scompare1\n" +			"       add     %0, %1, %2\n" +			"       s32c1i  %0, %3, 0\n" +			"       bne     %0, %1, 1b\n" +			: "=&a" (result), "=&a" (tmp) +			: "a" (i), "a" (v) +			: "memory" +			); +#else +	unsigned int vval; + +	__asm__ __volatile__( +			"       rsil    a15, "__stringify(LOCKLEVEL)"\n" +			"       l32i    %0, %2, 0\n" +			"       add     %0, %0, %1\n" +			"       s32i    %0, %2, 0\n" +			"       wsr     a15, ps\n" +			"       rsync\n" +			: "=&a" (vval) +			: "a" (i), "a" (v) +			: "a15", "memory" +			); +#endif  }  /** @@ -90,19 +106,35 @@ static inline void atomic_add(int i, atomic_t * v)   */  static inline void atomic_sub(int i, atomic_t *v)  { -    unsigned int vval; +#if XCHAL_HAVE_S32C1I +	unsigned long tmp; +	int result; + +	__asm__ __volatile__( +			"1:     l32i    %1, %3, 0\n" +			"       wsr     %1, scompare1\n" +			"       sub     %0, %1, %2\n" +			"       s32c1i  %0, %3, 0\n" +			"       bne     %0, %1, 1b\n" +			: "=&a" (result), "=&a" (tmp) +			: "a" (i), "a" (v) +			: "memory" +			); +#else +	unsigned int vval; -    __asm__ __volatile__( -	"rsil    a15, "__stringify(LOCKLEVEL)"\n\t" -	"l32i    %0, %2, 0              \n\t" -	"sub     %0, %0, %1             \n\t" -	"s32i    %0, %2, 0              \n\t" -	"wsr     a15, ps                \n\t" -	"rsync                          \n" -	: "=&a" (vval) -	: "a" (i), "a" (v) -	: "a15", "memory" -	); +	__asm__ __volatile__( +			"       rsil    a15, "__stringify(LOCKLEVEL)"\n" +			"       l32i    %0, %2, 0\n" +			"       sub     %0, %0, %1\n" +			"       s32i    %0, %2, 0\n" +			"       wsr     a15, ps\n" +			"       rsync\n" +			: "=&a" (vval) +			: "a" (i), "a" (v) +			: "a15", "memory" +			); +#endif  }  /* @@ -111,40 +143,78 @@ static inline void atomic_sub(int i, atomic_t *v)  static inline int atomic_add_return(int i, atomic_t * v)  { -     unsigned int vval; +#if XCHAL_HAVE_S32C1I +	unsigned long tmp; +	int result; + +	__asm__ __volatile__( +			"1:     l32i    %1, %3, 0\n" +			"       wsr     %1, scompare1\n" +			"       add     %0, %1, %2\n" +			"       s32c1i  %0, %3, 0\n" +			"       bne     %0, %1, 1b\n" +			"       add     %0, %0, %2\n" +			: "=&a" (result), "=&a" (tmp) +			: "a" (i), "a" (v) +			: "memory" +			); -    __asm__ __volatile__( -	"rsil    a15,"__stringify(LOCKLEVEL)"\n\t" -	"l32i    %0, %2, 0             \n\t" -	"add     %0, %0, %1            \n\t" -	"s32i    %0, %2, 0             \n\t" -	"wsr     a15, ps               \n\t" -	"rsync                         \n" -	: "=&a" (vval) -	: "a" (i), "a" (v) -	: "a15", "memory" -	); +	return result; +#else +	unsigned int vval; -    return vval; +	__asm__ __volatile__( +			"       rsil    a15,"__stringify(LOCKLEVEL)"\n" +			"       l32i    %0, %2, 0\n" +			"       add     %0, %0, %1\n" +			"       s32i    %0, %2, 0\n" +			"       wsr     a15, ps\n" +			"       rsync\n" +			: "=&a" (vval) +			: "a" (i), "a" (v) +			: "a15", "memory" +			); + +	return vval; +#endif  }  static inline int atomic_sub_return(int i, atomic_t * v)  { -    unsigned int vval; +#if XCHAL_HAVE_S32C1I +	unsigned long tmp; +	int result; + +	__asm__ __volatile__( +			"1:     l32i    %1, %3, 0\n" +			"       wsr     %1, scompare1\n" +			"       sub     %0, %1, %2\n" +			"       s32c1i  %0, %3, 0\n" +			"       bne     %0, %1, 1b\n" +			"       sub     %0, %0, %2\n" +			: "=&a" (result), "=&a" (tmp) +			: "a" (i), "a" (v) +			: "memory" +			); -    __asm__ __volatile__( -	"rsil    a15,"__stringify(LOCKLEVEL)"\n\t" -	"l32i    %0, %2, 0             \n\t" -	"sub     %0, %0, %1            \n\t" -	"s32i    %0, %2, 0             \n\t" -	"wsr     a15, ps               \n\t" -	"rsync                         \n" -	: "=&a" (vval) -	: "a" (i), "a" (v) -	: "a15", "memory" -	); +	return result; +#else +	unsigned int vval; -    return vval; +	__asm__ __volatile__( +			"       rsil    a15,"__stringify(LOCKLEVEL)"\n" +			"       l32i    %0, %2, 0\n" +			"       sub     %0, %0, %1\n" +			"       s32i    %0, %2, 0\n" +			"       wsr     a15, ps\n" +			"       rsync\n" +			: "=&a" (vval) +			: "a" (i), "a" (v) +			: "a15", "memory" +			); + +	return vval; +#endif  }  /** @@ -251,38 +321,70 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)  static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)  { -    unsigned int all_f = -1; -    unsigned int vval; +#if XCHAL_HAVE_S32C1I +	unsigned long tmp; +	int result; + +	__asm__ __volatile__( +			"1:     l32i    %1, %3, 0\n" +			"       wsr     %1, scompare1\n" +			"       and     %0, %1, %2\n" +			"       s32c1i  %0, %3, 0\n" +			"       bne     %0, %1, 1b\n" +			: "=&a" (result), "=&a" (tmp) +			: "a" (~mask), "a" (v) +			: "memory" +			); +#else +	unsigned int all_f = -1; +	unsigned int vval; -    __asm__ __volatile__( -	"rsil    a15,"__stringify(LOCKLEVEL)"\n\t" -	"l32i    %0, %2, 0             \n\t" -	"xor     %1, %4, %3            \n\t" -	"and     %0, %0, %4            \n\t" -	"s32i    %0, %2, 0             \n\t" -	"wsr     a15, ps               \n\t" -	"rsync                         \n" -	: "=&a" (vval), "=a" (mask) -	: "a" (v), "a" (all_f), "1" (mask) -	: "a15", "memory" -	); +	__asm__ __volatile__( +			"       rsil    a15,"__stringify(LOCKLEVEL)"\n" +			"       l32i    %0, %2, 0\n" +			"       xor     %1, %4, %3\n" +			"       and     %0, %0, %4\n" +			"       s32i    %0, %2, 0\n" +			"       wsr     a15, ps\n" +			"       rsync\n" +			: "=&a" (vval), "=a" (mask) +			: "a" (v), "a" (all_f), "1" (mask) +			: "a15", "memory" +			); +#endif  }  static inline void atomic_set_mask(unsigned int mask, atomic_t *v)  { -    unsigned int vval; +#if XCHAL_HAVE_S32C1I +	unsigned long tmp; +	int result; -    __asm__ __volatile__( -	"rsil    a15,"__stringify(LOCKLEVEL)"\n\t" -	"l32i    %0, %2, 0             \n\t" -	"or      %0, %0, %1            \n\t" -	"s32i    %0, %2, 0             \n\t" -	"wsr     a15, ps               \n\t" -	"rsync                         \n" -	: "=&a" (vval) -	: "a" (mask), "a" (v) -	: "a15", "memory" -	); +	__asm__ __volatile__( +			"1:     l32i    %1, %3, 0\n" +			"       wsr     %1, scompare1\n" +			"       or      %0, %1, %2\n" +			"       s32c1i  %0, %3, 0\n" +			"       bne     %0, %1, 1b\n" +			: "=&a" (result), "=&a" (tmp) +			: "a" (mask), "a" (v) +			: "memory" +			); +#else +	unsigned int vval; + +	__asm__ __volatile__( +			"       rsil    a15,"__stringify(LOCKLEVEL)"\n" +			"       l32i    %0, %2, 0\n" +			"       or      %0, %0, %1\n" +			"       s32i    %0, %2, 0\n" +			"       wsr     a15, ps\n" +			"       rsync\n" +			: "=&a" (vval) +			: "a" (mask), "a" (v) +			: "a15", "memory" +			); +#endif  }  /* Atomic operations are already serializing */ @@ -294,4 +396,3 @@ static inline void atomic_set_mask(unsigned int mask, atomic_t *v)  #endif /* __KERNEL__ */  #endif /* _XTENSA_ATOMIC_H */ - diff --git a/arch/xtensa/include/asm/barrier.h b/arch/xtensa/include/asm/barrier.h index 55707a8009d..ef021677d53 100644 --- a/arch/xtensa/include/asm/barrier.h +++ b/arch/xtensa/include/asm/barrier.h @@ -3,7 +3,7 @@   * License.  See the file "COPYING" in the main directory of this archive   * for more details.   * - * Copyright (C) 2001 - 2005 Tensilica Inc. + * Copyright (C) 2001 - 2012 Tensilica Inc.   */  #ifndef _XTENSA_SYSTEM_H @@ -12,8 +12,8 @@  #define smp_read_barrier_depends() do { } while(0)  #define read_barrier_depends() do { } while(0) -#define mb()  barrier() -#define rmb() mb() +#define mb()  ({ __asm__ __volatile__("memw" : : : "memory"); }) +#define rmb() barrier()  #define wmb() mb()  #ifdef CONFIG_SMP diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h index 5270197ddd3..84afe58d5d3 100644 --- a/arch/xtensa/include/asm/bitops.h +++ b/arch/xtensa/include/asm/bitops.h @@ -29,7 +29,6 @@  #define smp_mb__before_clear_bit()	barrier()  #define smp_mb__after_clear_bit()	barrier() -#include <asm-generic/bitops/atomic.h>  #include <asm-generic/bitops/non-atomic.h>  #if XCHAL_HAVE_NSA @@ -104,6 +103,132 @@ static inline unsigned long __fls(unsigned long word)  #endif  #include <asm-generic/bitops/fls64.h> + +#if XCHAL_HAVE_S32C1I + +static inline void set_bit(unsigned int bit, volatile unsigned long *p) +{ +	unsigned long tmp, value; +	unsigned long mask = 1UL << (bit & 31); + +	p += bit >> 5; + +	__asm__ __volatile__( +			"1:     l32i    %1, %3, 0\n" +			"       wsr     %1, scompare1\n" +			"       or      %0, %1, %2\n" +			"       s32c1i  %0, %3, 0\n" +			"       bne     %0, %1, 1b\n" +			: "=&a" (tmp), "=&a" (value) +			: "a" (mask), "a" (p) +			: "memory"); +} + +static inline void clear_bit(unsigned int bit, volatile unsigned long *p) +{ +	unsigned long tmp, value; +	unsigned long mask = 1UL << (bit & 31); + +	p += bit >> 5; + +	__asm__ __volatile__( +			"1:     l32i    %1, %3, 0\n" +			"       wsr     %1, scompare1\n" +			"       and     %0, %1, %2\n" +			"       s32c1i  %0, %3, 0\n" +			"       bne     %0, %1, 1b\n" +			: "=&a" (tmp), "=&a" (value) +			: "a" (~mask), "a" (p) +			: "memory"); +} + +static inline void change_bit(unsigned int bit, volatile unsigned long *p) +{ +	unsigned long tmp, value; +	unsigned long mask = 1UL << (bit & 31); + +	p += bit >> 5; + +	__asm__ __volatile__( +			"1:     l32i    %1, %3, 0\n" +			"       wsr     %1, scompare1\n" +			"       xor     %0, %1, %2\n" +			"       s32c1i  %0, %3, 0\n" +			"       bne     %0, %1, 1b\n" +			: "=&a" (tmp), "=&a" (value) +			: "a" (mask), "a" (p) +			: "memory"); +} + +static inline int +test_and_set_bit(unsigned int bit, volatile unsigned long *p) +{ +	unsigned long tmp, value; +	unsigned long mask = 1UL << (bit & 31); + +	p += bit >> 5; + +	__asm__ __volatile__( +			"1:     l32i    %1, %3, 0\n" +			"       wsr     %1, scompare1\n" +			"       or      %0, %1, %2\n" +			"       s32c1i  %0, %3, 0\n" +			"       bne     %0, %1, 1b\n" +			: "=&a" (tmp), "=&a" (value) +			: "a" (mask), "a" (p) +			: "memory"); + +	return tmp & mask; +} + +static inline int +test_and_clear_bit(unsigned int bit, volatile unsigned long *p) +{ +	unsigned long tmp, value; +	unsigned long mask = 1UL << (bit & 31); + +	p += bit >> 5; + +	__asm__ __volatile__( +			"1:     l32i    %1, %3, 0\n" +			"       wsr     %1, scompare1\n" +			"       and     %0, %1, %2\n" +			"       s32c1i  %0, %3, 0\n" +			"       bne     %0, %1, 1b\n" +			: "=&a" (tmp), "=&a" (value) +			: "a" (~mask), "a" (p) +			: "memory"); + +	return tmp & mask; +} + +static inline int +test_and_change_bit(unsigned int bit, volatile unsigned long *p) +{ +	unsigned long tmp, value; +	unsigned long mask = 1UL << (bit & 31); + +	p += bit >> 5; + +	__asm__ __volatile__( +			"1:     l32i    %1, %3, 0\n" +			"       wsr     %1, scompare1\n" +			"       xor     %0, %1, %2\n" +			"       s32c1i  %0, %3, 0\n" +			"       bne     %0, %1, 1b\n" +			: "=&a" (tmp), "=&a" (value) +			: "a" (mask), "a" (p) +			: "memory"); + +	return tmp & mask; +} + +#else + +#include <asm-generic/bitops/atomic.h> + +#endif /* XCHAL_HAVE_S32C1I */ +  #include <asm-generic/bitops/find.h>  #include <asm-generic/bitops/le.h> diff --git a/arch/xtensa/include/asm/bootparam.h b/arch/xtensa/include/asm/bootparam.h index 9983f2c1b7e..0c25799faca 100644 --- a/arch/xtensa/include/asm/bootparam.h +++ b/arch/xtensa/include/asm/bootparam.h @@ -22,6 +22,7 @@  #define BP_TAG_MEMORY		0x1003	/* memory addr and size (bp_meminfo) */  #define BP_TAG_SERIAL_BAUSRATE	0x1004	/* baud rate of current console. */  #define BP_TAG_SERIAL_PORT	0x1005	/* serial device of current console */ +#define BP_TAG_FDT		0x1006	/* flat device tree addr */  #define BP_TAG_FIRST		0x7B0B  /* first tag with a version number */  #define BP_TAG_LAST 		0x7E0B	/* last tag */ @@ -31,15 +32,15 @@  /* All records are aligned to 4 bytes */  typedef struct bp_tag { -  unsigned short id;		/* tag id */ -  unsigned short size;		/* size of this record excluding the structure*/ -  unsigned long data[0];	/* data */ +	unsigned short id;	/* tag id */ +	unsigned short size;	/* size of this record excluding the structure*/ +	unsigned long data[0];	/* data */  } bp_tag_t;  typedef struct meminfo { -  unsigned long type; -  unsigned long start; -  unsigned long end; +	unsigned long type; +	unsigned long start; +	unsigned long end;  } meminfo_t;  #define SYSMEM_BANKS_MAX 5 @@ -48,14 +49,11 @@ typedef struct meminfo {  #define MEMORY_TYPE_NONE		0x2000  typedef struct sysmem_info { -  int nr_banks; -  meminfo_t bank[SYSMEM_BANKS_MAX]; +	int nr_banks; +	meminfo_t bank[SYSMEM_BANKS_MAX];  } sysmem_info_t;  extern sysmem_info_t sysmem;  #endif  #endif - - - diff --git a/arch/xtensa/include/asm/cacheasm.h b/arch/xtensa/include/asm/cacheasm.h index 2c20a58f94c..60e18773ecb 100644 --- a/arch/xtensa/include/asm/cacheasm.h +++ b/arch/xtensa/include/asm/cacheasm.h @@ -174,4 +174,3 @@  	__loop_cache_page \ar \as ihi XCHAL_ICACHE_LINEWIDTH  	.endm - diff --git a/arch/xtensa/include/asm/cacheflush.h b/arch/xtensa/include/asm/cacheflush.h index 569fec4f9a2..127cd48883c 100644 --- a/arch/xtensa/include/asm/cacheflush.h +++ b/arch/xtensa/include/asm/cacheflush.h @@ -104,7 +104,8 @@ static inline void __invalidate_icache_page_alias(unsigned long virt,  #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1  extern void flush_dcache_page(struct page*);  extern void flush_cache_range(struct vm_area_struct*, ulong, ulong); -extern void flush_cache_page(struct vm_area_struct*, unsigned long, unsigned long); +extern void flush_cache_page(struct vm_area_struct*, +			     unsigned long, unsigned long);  #else diff --git a/arch/xtensa/include/asm/checksum.h b/arch/xtensa/include/asm/checksum.h index e4d831a3077..aed7ad68ca4 100644 --- a/arch/xtensa/include/asm/checksum.h +++ b/arch/xtensa/include/asm/checksum.h @@ -36,8 +36,9 @@ asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum);   * better 64-bit) boundary   */ -asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst, int len, __wsum sum, -						   int *src_err_ptr, int *dst_err_ptr); +asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst, +					    int len, __wsum sum, +					    int *src_err_ptr, int *dst_err_ptr);  /*   *	Note: when you get a NULL pointer exception here this means someone @@ -54,7 +55,7 @@ __wsum csum_partial_copy_nocheck(const void *src, void *dst,  static inline  __wsum csum_partial_copy_from_user(const void __user *src, void *dst, -						int len, __wsum sum, int *err_ptr) +				   int len, __wsum sum, int *err_ptr)  {  	return csum_partial_copy_generic((__force const void *)src, dst,  					len, sum, err_ptr, NULL); @@ -112,7 +113,8 @@ static __inline__ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)  	/* Since the input registers which are loaded with iph and ihl  	   are modified, we must also specify them as outputs, or gcc  	   will assume they contain their original values. */ -		: "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmp), "=&r" (endaddr) +		: "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmp), +		  "=&r" (endaddr)  		: "1" (iph), "2" (ihl)  		: "memory"); @@ -168,7 +170,7 @@ static __inline__ __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,  static __inline__ __sum16 ip_compute_csum(const void *buff, int len)  { -    return csum_fold (csum_partial(buff, len, 0)); +	return csum_fold (csum_partial(buff, len, 0));  }  #define _HAVE_ARCH_IPV6_CSUM @@ -238,11 +240,12 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,   *	Copy and checksum to user   */  #define HAVE_CSUM_COPY_USER -static __inline__ __wsum csum_and_copy_to_user(const void *src, void __user *dst, -				    int len, __wsum sum, int *err_ptr) +static __inline__ __wsum csum_and_copy_to_user(const void *src, +					       void __user *dst, int len, +					       __wsum sum, int *err_ptr)  {  	if (access_ok(VERIFY_WRITE, dst, len)) -		return csum_partial_copy_generic(src, dst, len, sum, NULL, err_ptr); +		return csum_partial_copy_generic(src,dst,len,sum,NULL,err_ptr);  	if (len)  		*err_ptr = -EFAULT; diff --git a/arch/xtensa/include/asm/cmpxchg.h b/arch/xtensa/include/asm/cmpxchg.h index 64dad04a9d2..d9ab131bc1a 100644 --- a/arch/xtensa/include/asm/cmpxchg.h +++ b/arch/xtensa/include/asm/cmpxchg.h @@ -22,17 +22,30 @@  static inline unsigned long  __cmpxchg_u32(volatile int *p, int old, int new)  { -  __asm__ __volatile__("rsil    a15, "__stringify(LOCKLEVEL)"\n\t" -		       "l32i    %0, %1, 0              \n\t" -		       "bne	%0, %2, 1f             \n\t" -		       "s32i    %3, %1, 0              \n\t" -		       "1:                             \n\t" -		       "wsr     a15, ps                \n\t" -		       "rsync                          \n\t" -		       : "=&a" (old) -		       : "a" (p), "a" (old), "r" (new) -		       : "a15", "memory"); -  return old; +#if XCHAL_HAVE_S32C1I +	__asm__ __volatile__( +			"       wsr     %2, scompare1\n" +			"       s32c1i  %0, %1, 0\n" +			: "+a" (new) +			: "a" (p), "a" (old) +			: "memory" +			); + +	return new; +#else +	__asm__ __volatile__( +			"       rsil    a15, "__stringify(LOCKLEVEL)"\n" +			"       l32i    %0, %1, 0\n" +			"       bne     %0, %2, 1f\n" +			"       s32i    %3, %1, 0\n" +			"1:\n" +			"       wsr     a15, ps\n" +			"       rsync\n" +			: "=&a" (old) +			: "a" (p), "a" (old), "r" (new) +			: "a15", "memory"); +	return old; +#endif  }  /* This function doesn't exist, so you'll get a linker error   * if something tries to do an invalid cmpxchg(). */ @@ -93,19 +106,36 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,  static inline unsigned long xchg_u32(volatile int * m, unsigned long val)  { -  unsigned long tmp; -  __asm__ __volatile__("rsil    a15, "__stringify(LOCKLEVEL)"\n\t" -		       "l32i    %0, %1, 0              \n\t" -		       "s32i    %2, %1, 0              \n\t" -		       "wsr     a15, ps                \n\t" -		       "rsync                          \n\t" -		       : "=&a" (tmp) -		       : "a" (m), "a" (val) -		       : "a15", "memory"); -  return tmp; +#if XCHAL_HAVE_S32C1I +	unsigned long tmp, result; +	__asm__ __volatile__( +			"1:     l32i    %1, %2, 0\n" +			"       mov     %0, %3\n" +			"       wsr     %1, scompare1\n" +			"       s32c1i  %0, %2, 0\n" +			"       bne     %0, %1, 1b\n" +			: "=&a" (result), "=&a" (tmp) +			: "a" (m), "a" (val) +			: "memory" +			); +	return result; +#else +	unsigned long tmp; +	__asm__ __volatile__( +			"       rsil    a15, "__stringify(LOCKLEVEL)"\n" +			"       l32i    %0, %1, 0\n" +			"       s32i    %2, %1, 0\n" +			"       wsr     a15, ps\n" +			"       rsync\n" +			: "=&a" (tmp) +			: "a" (m), "a" (val) +			: "a15", "memory"); +	return tmp; +#endif  } -#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) +#define xchg(ptr,x) \ +	((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))  /*   * This only works if the compiler isn't horribly bad at optimizing. diff --git a/arch/xtensa/include/asm/current.h b/arch/xtensa/include/asm/current.h index 8d1eb5d7864..47e46dcf5d4 100644 --- a/arch/xtensa/include/asm/current.h +++ b/arch/xtensa/include/asm/current.h @@ -30,7 +30,7 @@ static inline struct task_struct *get_current(void)  #define GET_CURRENT(reg,sp)		\  	GET_THREAD_INFO(reg,sp);	\ -  	l32i reg, reg, TI_TASK		\ +	l32i reg, reg, TI_TASK		\  #endif diff --git a/arch/xtensa/include/asm/delay.h b/arch/xtensa/include/asm/delay.h index 58c0a4fd400..61fc5faeb46 100644 --- a/arch/xtensa/include/asm/delay.h +++ b/arch/xtensa/include/asm/delay.h @@ -19,9 +19,9 @@ extern unsigned long loops_per_jiffy;  static inline void __delay(unsigned long loops)  { -  /* 2 cycles per loop. */ -  __asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 2, 1b" -			: "=r" (loops) : "0" (loops)); +	/* 2 cycles per loop. */ +	__asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 2, 1b" +			      : "=r" (loops) : "0" (loops));  }  static __inline__ u32 xtensa_get_ccount(void) @@ -46,4 +46,3 @@ static __inline__ void udelay (unsigned long usecs)  }  #endif - diff --git a/arch/xtensa/include/asm/dma-mapping.h b/arch/xtensa/include/asm/dma-mapping.h index 492c95790ad..4acb5feba1f 100644 --- a/arch/xtensa/include/asm/dma-mapping.h +++ b/arch/xtensa/include/asm/dma-mapping.h @@ -16,6 +16,8 @@  #include <linux/mm.h>  #include <linux/scatterlist.h> +#define DMA_ERROR_CODE		(~(dma_addr_t)0x0) +  /*   * DMA-consistent mapping functions.   */ @@ -98,8 +100,8 @@ dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,  }  static inline void -dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, -		enum dma_data_direction direction) +dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, +		           size_t size, enum dma_data_direction direction)  {  	consistent_sync((void *)bus_to_virt(dma_handle), size, direction);  } diff --git a/arch/xtensa/include/asm/elf.h b/arch/xtensa/include/asm/elf.h index 5293312bc6a..264d5fa450d 100644 --- a/arch/xtensa/include/asm/elf.h +++ b/arch/xtensa/include/asm/elf.h @@ -168,11 +168,11 @@ extern void xtensa_elf_core_copy_regs (xtensa_gregset_t *, struct pt_regs *);   */  #define ELF_PLAT_INIT(_r, load_addr) \ -  do { _r->areg[0]=0; /*_r->areg[1]=0;*/ _r->areg[2]=0;  _r->areg[3]=0;  \ -       _r->areg[4]=0;  _r->areg[5]=0;    _r->areg[6]=0;  _r->areg[7]=0;  \ -       _r->areg[8]=0;  _r->areg[9]=0;    _r->areg[10]=0; _r->areg[11]=0; \ -       _r->areg[12]=0; _r->areg[13]=0;   _r->areg[14]=0; _r->areg[15]=0; \ -  } while (0) +	do { _r->areg[0]=0; /*_r->areg[1]=0;*/ _r->areg[2]=0;  _r->areg[3]=0;  \ +	     _r->areg[4]=0;  _r->areg[5]=0;    _r->areg[6]=0;  _r->areg[7]=0;  \ +	     _r->areg[8]=0;  _r->areg[9]=0;    _r->areg[10]=0; _r->areg[11]=0; \ +	     _r->areg[12]=0; _r->areg[13]=0;   _r->areg[14]=0; _r->areg[15]=0; \ +	} while (0)  typedef struct {  	xtregs_opt_t	opt; diff --git a/arch/xtensa/include/asm/highmem.h b/arch/xtensa/include/asm/highmem.h index 0a046ca5a68..80be1512469 100644 --- a/arch/xtensa/include/asm/highmem.h +++ b/arch/xtensa/include/asm/highmem.h @@ -14,4 +14,3 @@  extern void flush_cache_kmaps(void);  #endif - diff --git a/arch/xtensa/include/asm/initialize_mmu.h b/arch/xtensa/include/asm/initialize_mmu.h new file mode 100644 index 00000000000..e1f8ba4061e --- /dev/null +++ b/arch/xtensa/include/asm/initialize_mmu.h @@ -0,0 +1,55 @@ +/* + * arch/xtensa/include/asm/initialize_mmu.h + * + * Initializes MMU: + * + *      For the new V3 MMU we remap the TLB from virtual == physical + *      to the standard Linux mapping used in earlier MMU's. + * + *      The the MMU we also support a new configuration register that + *      specifies how the S32C1I instruction operates with the cache + *      controller. + * + * This file is subject to the terms and conditions of the GNU General + * Public License.  See the file "COPYING" in the main directory of + * this archive for more details. + * + * Copyright (C) 2008 - 2012 Tensilica, Inc. + * + *   Marc Gauthier <marc@tensilica.com> + *   Pete Delaney <piet@tensilica.com> + */ + +#ifndef _XTENSA_INITIALIZE_MMU_H +#define _XTENSA_INITIALIZE_MMU_H + +#ifdef __ASSEMBLY__ + +#define XTENSA_HWVERSION_RC_2009_0 230000 + +	.macro	initialize_mmu + +#if XCHAL_HAVE_S32C1I && (XCHAL_HW_MIN_VERSION >= XTENSA_HWVERSION_RC_2009_0) +/* + * We Have Atomic Operation Control (ATOMCTL) Register; Initialize it. + * For details see Documentation/xtensa/atomctl.txt + */ +#if XCHAL_DCACHE_IS_COHERENT +	movi	a3, 0x25	/* For SMP/MX -- internal for writeback, +				 * RCW otherwise +				 */ +#else +	movi	a3, 0x29	/* non-MX -- Most cores use Std Memory +				 * Controlers which usually can't use RCW +				 */ +#endif +	wsr	a3, atomctl +#endif  /* XCHAL_HAVE_S32C1I && +	 * (XCHAL_HW_MIN_VERSION >= XTENSA_HWVERSION_RC_2009_0) +	 */ + +	.endm + +#endif /*__ASSEMBLY__*/ + +#endif /* _XTENSA_INITIALIZE_MMU_H */ diff --git a/arch/xtensa/include/asm/mmu.h b/arch/xtensa/include/asm/mmu.h index 04890d6e233..8554b2c8b17 100644 --- a/arch/xtensa/include/asm/mmu.h +++ b/arch/xtensa/include/asm/mmu.h @@ -12,7 +12,7 @@  #define _XTENSA_MMU_H  #ifndef CONFIG_MMU -#include <asm/nommu.h> +#include <asm-generic/mmu.h>  #else  /* Default "unsigned long" context */ diff --git a/arch/xtensa/include/asm/mmu_context.h b/arch/xtensa/include/asm/mmu_context.h index feb10af9651..d43525a286b 100644 --- a/arch/xtensa/include/asm/mmu_context.h +++ b/arch/xtensa/include/asm/mmu_context.h @@ -107,7 +107,7 @@ activate_mm(struct mm_struct *prev, struct mm_struct *next)  static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, -                             struct task_struct *tsk) +			     struct task_struct *tsk)  {  	unsigned long asid = asid_cache; diff --git a/arch/xtensa/include/asm/nommu.h b/arch/xtensa/include/asm/nommu.h deleted file mode 100644 index dce2c438c5b..00000000000 --- a/arch/xtensa/include/asm/nommu.h +++ /dev/null @@ -1,3 +0,0 @@ -typedef struct { -	unsigned long end_brk; -} mm_context_t; diff --git a/arch/xtensa/include/asm/nommu_context.h b/arch/xtensa/include/asm/nommu_context.h index 599e7a2e729..3407cf7989b 100644 --- a/arch/xtensa/include/asm/nommu_context.h +++ b/arch/xtensa/include/asm/nommu_context.h @@ -2,7 +2,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)  {  } -static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) +static inline int init_new_context(struct task_struct *tsk,struct mm_struct *mm)  {  	return 0;  } diff --git a/arch/xtensa/include/asm/page.h b/arch/xtensa/include/asm/page.h index 7a5591a71f8..47f582333f6 100644 --- a/arch/xtensa/include/asm/page.h +++ b/arch/xtensa/include/asm/page.h @@ -29,19 +29,19 @@   * PAGE_SHIFT determines the page size   */ -#define PAGE_SHIFT		12 -#define PAGE_SIZE		(__XTENSA_UL_CONST(1) << PAGE_SHIFT) -#define PAGE_MASK		(~(PAGE_SIZE-1)) +#define PAGE_SHIFT	12 +#define PAGE_SIZE	(__XTENSA_UL_CONST(1) << PAGE_SHIFT) +#define PAGE_MASK	(~(PAGE_SIZE-1))  #ifdef CONFIG_MMU -#define PAGE_OFFSET		XCHAL_KSEG_CACHED_VADDR -#define MAX_MEM_PFN		XCHAL_KSEG_SIZE +#define PAGE_OFFSET	XCHAL_KSEG_CACHED_VADDR +#define MAX_MEM_PFN	XCHAL_KSEG_SIZE  #else -#define PAGE_OFFSET		0 -#define MAX_MEM_PFN		(PLATFORM_DEFAULT_MEM_START + PLATFORM_DEFAULT_MEM_SIZE) +#define PAGE_OFFSET	0 +#define MAX_MEM_PFN	(PLATFORM_DEFAULT_MEM_START + PLATFORM_DEFAULT_MEM_SIZE)  #endif -#define PGTABLE_START		0x80000000 +#define PGTABLE_START	0x80000000  /*   * Cache aliasing: @@ -161,7 +161,9 @@ extern void copy_user_page(void*, void*, unsigned long, struct page*);  #define __pa(x)			((unsigned long) (x) - PAGE_OFFSET)  #define __va(x)			((void *)((unsigned long) (x) + PAGE_OFFSET)) -#define pfn_valid(pfn)		((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr) +#define pfn_valid(pfn) \ +	((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr) +  #ifdef CONFIG_DISCONTIGMEM  # error CONFIG_DISCONTIGMEM not supported  #endif diff --git a/arch/xtensa/include/asm/pci-bridge.h b/arch/xtensa/include/asm/pci-bridge.h index 00fcbd7c534..0b68c76ec1e 100644 --- a/arch/xtensa/include/asm/pci-bridge.h +++ b/arch/xtensa/include/asm/pci-bridge.h @@ -35,7 +35,7 @@ struct pci_space {  struct pci_controller {  	int index;			/* used for pci_controller_num */  	struct pci_controller *next; -        struct pci_bus *bus; +	struct pci_bus *bus;  	void *arch_data;  	int first_busno; diff --git a/arch/xtensa/include/asm/pci.h b/arch/xtensa/include/asm/pci.h index 05244f07dd3..614be031a79 100644 --- a/arch/xtensa/include/asm/pci.h +++ b/arch/xtensa/include/asm/pci.h @@ -53,7 +53,7 @@ struct pci_dev;  /* Map a range of PCI memory or I/O space for a device into user space */  int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, -                        enum pci_mmap_state mmap_state, int write_combine); +			enum pci_mmap_state mmap_state, int write_combine);  /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */  #define HAVE_PCI_MMAP	1 diff --git a/arch/xtensa/include/asm/pgalloc.h b/arch/xtensa/include/asm/pgalloc.h index 40cf9bceda2..cf914c8c249 100644 --- a/arch/xtensa/include/asm/pgalloc.h +++ b/arch/xtensa/include/asm/pgalloc.h @@ -42,7 +42,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)  extern struct kmem_cache *pgtable_cache; -static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,  +static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,  					 unsigned long address)  {  	return kmem_cache_alloc(pgtable_cache, GFP_KERNEL|__GFP_REPEAT); diff --git a/arch/xtensa/include/asm/pgtable.h b/arch/xtensa/include/asm/pgtable.h index b03c043ce75..c90ea5bfa1b 100644 --- a/arch/xtensa/include/asm/pgtable.h +++ b/arch/xtensa/include/asm/pgtable.h @@ -284,7 +284,7 @@ struct vm_area_struct;  static inline int  ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, -    			  pte_t *ptep) +			  pte_t *ptep)  {  	pte_t pte = *ptep;  	if (!pte_young(pte)) @@ -304,8 +304,8 @@ ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)  static inline void  ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)  { -  	pte_t pte = *ptep; -  	update_pte(ptep, pte_wrprotect(pte)); +	pte_t pte = *ptep; +	update_pte(ptep, pte_wrprotect(pte));  }  /* to find an entry in a kernel page-table-directory */ @@ -399,7 +399,7 @@ extern  void update_mmu_cache(struct vm_area_struct * vma,   */  #define io_remap_pfn_range(vma,from,pfn,size,prot) \ -                remap_pfn_range(vma, from, pfn, size, prot) +	remap_pfn_range(vma, from, pfn, size, prot)  typedef pte_t *pte_addr_t; diff --git a/arch/xtensa/include/asm/platform.h b/arch/xtensa/include/asm/platform.h index 7d936e58e9b..ec098b68fb9 100644 --- a/arch/xtensa/include/asm/platform.h +++ b/arch/xtensa/include/asm/platform.h @@ -75,4 +75,3 @@ extern int platform_pcibios_fixup (void);  extern void platform_calibrate_ccount (void);  #endif	/* _XTENSA_PLATFORM_H */ - diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h index 2d630e7399c..e5fb6b0abdf 100644 --- a/arch/xtensa/include/asm/processor.h +++ b/arch/xtensa/include/asm/processor.h @@ -89,7 +89,7 @@  #define MAKE_PC_FROM_RA(ra,sp)    (((ra) & 0x3fffffff) | ((sp) & 0xc0000000))  typedef struct { -    unsigned long seg; +	unsigned long seg;  } mm_segment_t;  struct thread_struct { @@ -145,10 +145,10 @@ struct thread_struct {   *       set_thread_state in signal.c depends on it.   */  #define USER_PS_VALUE ((1 << PS_WOE_BIT) |				\ -                       (1 << PS_CALLINC_SHIFT) |			\ -                       (USER_RING << PS_RING_SHIFT) |			\ -                       (1 << PS_UM_BIT) |				\ -                       (1 << PS_EXCM_BIT)) +		       (1 << PS_CALLINC_SHIFT) |			\ +		       (USER_RING << PS_RING_SHIFT) |			\ +		       (1 << PS_UM_BIT) |				\ +		       (1 << PS_EXCM_BIT))  /* Clearing a0 terminates the backtrace. */  #define start_thread(regs, new_pc, new_sp) \ diff --git a/arch/xtensa/include/asm/prom.h b/arch/xtensa/include/asm/prom.h new file mode 100644 index 00000000000..f3d7cd2c0de --- /dev/null +++ b/arch/xtensa/include/asm/prom.h @@ -0,0 +1,6 @@ +#ifndef _XTENSA_ASM_PROM_H +#define _XTENSA_ASM_PROM_H + +#define HAVE_ARCH_DEVTREE_FIXUPS + +#endif /* _XTENSA_ASM_PROM_H */ diff --git a/arch/xtensa/include/asm/ptrace.h b/arch/xtensa/include/asm/ptrace.h index da21c17f23a..682b1deac1f 100644 --- a/arch/xtensa/include/asm/ptrace.h +++ b/arch/xtensa/include/asm/ptrace.h @@ -37,7 +37,7 @@ struct pt_regs {  	unsigned long windowstart;	/*  52 */  	unsigned long syscall;		/*  56 */  	unsigned long icountlevel;	/*  60 */ -	int reserved[1];		/*  64 */ +	unsigned long scompare1;	/*  64 */  	/* Additional configurable registers that are used by the compiler. */  	xtregs_opt_t xtregs_opt; @@ -55,7 +55,7 @@ struct pt_regs {  # define arch_has_single_step()	(1)  # define task_pt_regs(tsk) ((struct pt_regs*) \ -  (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1) +	(task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1)  # define user_mode(regs) (((regs)->ps & 0x00000020)!=0)  # define instruction_pointer(regs) ((regs)->pc) @@ -63,6 +63,8 @@ struct pt_regs {  #  define profile_pc(regs) instruction_pointer(regs)  # endif +#define user_stack_pointer(regs) ((regs)->areg[1]) +  #else	/* __ASSEMBLY__ */  # include <asm/asm-offsets.h> diff --git a/arch/xtensa/include/asm/regs.h b/arch/xtensa/include/asm/regs.h index 8a8aa61ccc8..76096a4e5b8 100644 --- a/arch/xtensa/include/asm/regs.h +++ b/arch/xtensa/include/asm/regs.h @@ -52,6 +52,10 @@  #define EXCCAUSE_SPECULATION			7  #define EXCCAUSE_PRIVILEGED			8  #define EXCCAUSE_UNALIGNED			9 +#define EXCCAUSE_INSTR_DATA_ERROR		12 +#define EXCCAUSE_LOAD_STORE_DATA_ERROR		13 +#define EXCCAUSE_INSTR_ADDR_ERROR		14 +#define EXCCAUSE_LOAD_STORE_ADDR_ERROR		15  #define EXCCAUSE_ITLB_MISS			16  #define EXCCAUSE_ITLB_MULTIHIT			17  #define EXCCAUSE_ITLB_PRIVILEGE			18 @@ -105,4 +109,3 @@  #define DEBUGCAUSE_ICOUNT_BIT		0	/* ICOUNT would incr. to zero */  #endif /* _XTENSA_SPECREG_H */ - diff --git a/arch/xtensa/include/asm/spinlock.h b/arch/xtensa/include/asm/spinlock.h index 8ff23649581..03975906b36 100644 --- a/arch/xtensa/include/asm/spinlock.h +++ b/arch/xtensa/include/asm/spinlock.h @@ -11,6 +11,192 @@  #ifndef _XTENSA_SPINLOCK_H  #define _XTENSA_SPINLOCK_H -#include <linux/spinlock.h> +/* + * spinlock + * + * There is at most one owner of a spinlock.  There are not different + * types of spinlock owners like there are for rwlocks (see below). + * + * When trying to obtain a spinlock, the function "spins" forever, or busy- + * waits, until the lock is obtained.  When spinning, presumably some other + * owner will soon give up the spinlock making it available to others.  Use + * the trylock functions to avoid spinning forever. + * + * possible values: + * + *    0         nobody owns the spinlock + *    1         somebody owns the spinlock + */ + +#define __raw_spin_is_locked(x) ((x)->slock != 0) +#define __raw_spin_unlock_wait(lock) \ +	do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) + +#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) + +static inline void __raw_spin_lock(raw_spinlock_t *lock) +{ +	unsigned long tmp; + +	__asm__ __volatile__( +			"       movi    %0, 0\n" +			"       wsr     %0, scompare1\n" +			"1:     movi    %0, 1\n" +			"       s32c1i  %0, %1, 0\n" +			"       bnez    %0, 1b\n" +			: "=&a" (tmp) +			: "a" (&lock->slock) +			: "memory"); +} + +/* Returns 1 if the lock is obtained, 0 otherwise. */ + +static inline int __raw_spin_trylock(raw_spinlock_t *lock) +{ +	unsigned long tmp; + +	__asm__ __volatile__( +			"       movi    %0, 0\n" +			"       wsr     %0, scompare1\n" +			"       movi    %0, 1\n" +			"       s32c1i  %0, %1, 0\n" +			: "=&a" (tmp) +			: "a" (&lock->slock) +			: "memory"); + +	return tmp == 0 ? 1 : 0; +} + +static inline void __raw_spin_unlock(raw_spinlock_t *lock) +{ +	unsigned long tmp; + +	__asm__ __volatile__( +			"       movi    %0, 0\n" +			"       s32ri   %0, %1, 0\n" +			: "=&a" (tmp) +			: "a" (&lock->slock) +			: "memory"); +} + +/* + * rwlock + * + * Read-write locks are really a more flexible spinlock.  They allow + * multiple readers but only one writer.  Write ownership is exclusive + * (i.e., all other readers and writers are blocked from ownership while + * there is a write owner).  These rwlocks are unfair to writers.  Writers + * can be starved for an indefinite time by readers. + * + * possible values: + * + *   0          nobody owns the rwlock + *  >0          one or more readers own the rwlock + *                (the positive value is the actual number of readers) + *  0x80000000  one writer owns the rwlock, no other writers, no readers + */ + +#define __raw_write_can_lock(x)  ((x)->lock == 0) + +static inline void __raw_write_lock(raw_rwlock_t *rw) +{ +	unsigned long tmp; + +	__asm__ __volatile__( +			"       movi    %0, 0\n" +			"       wsr     %0, scompare1\n" +			"1:     movi    %0, 1\n" +			"       slli    %0, %0, 31\n" +			"       s32c1i  %0, %1, 0\n" +			"       bnez    %0, 1b\n" +			: "=&a" (tmp) +			: "a" (&rw->lock) +			: "memory"); +} + +/* Returns 1 if the lock is obtained, 0 otherwise. */ + +static inline int __raw_write_trylock(raw_rwlock_t *rw) +{ +	unsigned long tmp; + +	__asm__ __volatile__( +			"       movi    %0, 0\n" +			"       wsr     %0, scompare1\n" +			"       movi    %0, 1\n" +			"       slli    %0, %0, 31\n" +			"       s32c1i  %0, %1, 0\n" +			: "=&a" (tmp) +			: "a" (&rw->lock) +			: "memory"); + +	return tmp == 0 ? 1 : 0; +} + +static inline void __raw_write_unlock(raw_rwlock_t *rw) +{ +	unsigned long tmp; + +	__asm__ __volatile__( +			"       movi    %0, 0\n" +			"       s32ri   %0, %1, 0\n" +			: "=&a" (tmp) +			: "a" (&rw->lock) +			: "memory"); +} + +static inline void __raw_read_lock(raw_rwlock_t *rw) +{ +	unsigned long tmp; +	unsigned long result; + +	__asm__ __volatile__( +			"1:     l32i    %1, %2, 0\n" +			"       bltz    %1, 1b\n" +			"       wsr     %1, scompare1\n" +			"       addi    %0, %1, 1\n" +			"       s32c1i  %0, %2, 0\n" +			"       bne     %0, %1, 1b\n" +			: "=&a" (result), "=&a" (tmp) +			: "a" (&rw->lock) +			: "memory"); +} + +/* Returns 1 if the lock is obtained, 0 otherwise. */ + +static inline int __raw_read_trylock(raw_rwlock_t *rw) +{ +	unsigned long result; +	unsigned long tmp; + +	__asm__ __volatile__( +			"       l32i    %1, %2, 0\n" +			"       addi    %0, %1, 1\n" +			"       bltz    %0, 1f\n" +			"       wsr     %1, scompare1\n" +			"       s32c1i  %0, %2, 0\n" +			"       sub     %0, %0, %1\n" +			"1:\n" +			: "=&a" (result), "=&a" (tmp) +			: "a" (&rw->lock) +			: "memory"); + +	return result == 0; +} + +static inline void __raw_read_unlock(raw_rwlock_t *rw) +{ +	unsigned long tmp1, tmp2; + +	__asm__ __volatile__( +			"1:     l32i    %1, %2, 0\n" +			"       addi    %0, %1, -1\n" +			"       wsr     %1, scompare1\n" +			"       s32c1i  %0, %2, 0\n" +			"       bne     %0, %1, 1b\n" +			: "=&a" (tmp1), "=&a" (tmp2) +			: "a" (&rw->lock) +			: "memory"); +}  #endif	/* _XTENSA_SPINLOCK_H */ diff --git a/arch/xtensa/include/asm/syscall.h b/arch/xtensa/include/asm/syscall.h index b00c928d4cc..8d5e47fad09 100644 --- a/arch/xtensa/include/asm/syscall.h +++ b/arch/xtensa/include/asm/syscall.h @@ -25,9 +25,10 @@ asmlinkage long xtensa_fadvise64_64(int, int,  /* Should probably move to linux/syscalls.h */  struct pollfd;  asmlinkage long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp, -	fd_set __user *exp, struct timespec __user *tsp, void __user *sig); +			     fd_set __user *exp, struct timespec __user *tsp, +			     void __user *sig);  asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds, -	struct timespec __user *tsp, const sigset_t __user *sigmask, -	size_t sigsetsize); -asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, -		size_t sigsetsize); +			  struct timespec __user *tsp, +			  const sigset_t __user *sigmask, +			  size_t sigsetsize); +asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize); diff --git a/arch/xtensa/include/asm/traps.h b/arch/xtensa/include/asm/traps.h new file mode 100644 index 00000000000..54f70440185 --- /dev/null +++ b/arch/xtensa/include/asm/traps.h @@ -0,0 +1,23 @@ +/* + * arch/xtensa/include/asm/traps.h + * + * This file is subject to the terms and conditions of the GNU General Public + * License.  See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2012 Tensilica Inc. + */ +#ifndef _XTENSA_TRAPS_H +#define _XTENSA_TRAPS_H + +#include <asm/ptrace.h> + +/* + * handler must be either of the following: + *  void (*)(struct pt_regs *regs); + *  void (*)(struct pt_regs *regs, unsigned long exccause); + */ +extern void * __init trap_set_handler(int cause, void *handler); +extern void do_unhandled(struct pt_regs *regs, unsigned long exccause); + +#endif /* _XTENSA_TRAPS_H */ diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h index 6e4bb3b791a..fd686dc45d1 100644 --- a/arch/xtensa/include/asm/uaccess.h +++ b/arch/xtensa/include/asm/uaccess.h @@ -180,7 +180,8 @@  #define segment_eq(a,b)	((a).seg == (b).seg)  #define __kernel_ok (segment_eq(get_fs(), KERNEL_DS)) -#define __user_ok(addr,size) (((size) <= TASK_SIZE)&&((addr) <= TASK_SIZE-(size))) +#define __user_ok(addr,size) \ +		(((size) <= TASK_SIZE)&&((addr) <= TASK_SIZE-(size)))  #define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size)))  #define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) @@ -234,10 +235,10 @@ do {									\  	int __cb;							\  	retval = 0;							\  	switch (size) {							\ -        case 1: __put_user_asm(x,ptr,retval,1,"s8i",__cb);  break;	\ -        case 2: __put_user_asm(x,ptr,retval,2,"s16i",__cb); break;	\ -        case 4: __put_user_asm(x,ptr,retval,4,"s32i",__cb); break;	\ -        case 8: {							\ +	case 1: __put_user_asm(x,ptr,retval,1,"s8i",__cb);  break;	\ +	case 2: __put_user_asm(x,ptr,retval,2,"s16i",__cb); break;	\ +	case 4: __put_user_asm(x,ptr,retval,4,"s32i",__cb); break;	\ +	case 8: {							\  		     __typeof__(*ptr) __v64 = x;			\  		     retval = __copy_to_user(ptr,&__v64,8);		\  		     break;						\ @@ -291,7 +292,7 @@ do {									\   * __check_align_* macros still work.   */  #define __put_user_asm(x, addr, err, align, insn, cb)	\ -   __asm__ __volatile__(				\ +__asm__ __volatile__(					\  	__check_align_##align				\  	"1: "insn"  %2, %3, 0		\n"		\  	"2:				\n"		\ @@ -301,8 +302,8 @@ do {									\  	"   .long  2b			\n"		\  	"5:				\n"		\  	"   l32r   %1, 4b		\n"		\ -        "   movi   %0, %4		\n"		\ -        "   jx     %1			\n"		\ +	"   movi   %0, %4		\n"		\ +	"   jx     %1			\n"		\  	"   .previous			\n"		\  	"   .section  __ex_table,\"a\"	\n"		\  	"   .long	1b, 5b		\n"		\ @@ -334,13 +335,13 @@ extern long __get_user_bad(void);  do {									\  	int __cb;							\  	retval = 0;							\ -        switch (size) {							\ -          case 1: __get_user_asm(x,ptr,retval,1,"l8ui",__cb);  break;	\ -          case 2: __get_user_asm(x,ptr,retval,2,"l16ui",__cb); break;	\ -          case 4: __get_user_asm(x,ptr,retval,4,"l32i",__cb);  break;	\ -          case 8: retval = __copy_from_user(&x,ptr,8);    break;	\ -          default: (x) = __get_user_bad();				\ -        }								\ +	switch (size) {							\ +	case 1: __get_user_asm(x,ptr,retval,1,"l8ui",__cb);  break;	\ +	case 2: __get_user_asm(x,ptr,retval,2,"l16ui",__cb); break;	\ +	case 4: __get_user_asm(x,ptr,retval,4,"l32i",__cb);  break;	\ +	case 8: retval = __copy_from_user(&x,ptr,8);    break;	\ +	default: (x) = __get_user_bad();				\ +	}								\  } while (0) @@ -349,7 +350,7 @@ do {									\   * __check_align_* macros still work.   */  #define __get_user_asm(x, addr, err, align, insn, cb) \ -   __asm__ __volatile__(			\ +__asm__ __volatile__(			\  	__check_align_##align			\  	"1: "insn"  %2, %3, 0		\n"	\  	"2:				\n"	\ @@ -360,8 +361,8 @@ do {									\  	"5:				\n"	\  	"   l32r   %1, 4b		\n"	\  	"   movi   %2, 0		\n"	\ -        "   movi   %0, %4		\n"	\ -        "   jx     %1			\n"	\ +	"   movi   %0, %4		\n"	\ +	"   jx     %1			\n"	\  	"   .previous			\n"	\  	"   .section  __ex_table,\"a\"	\n"	\  	"   .long	1b, 5b		\n"	\ @@ -421,8 +422,10 @@ __generic_copy_from_user(void *to, const void *from, unsigned long n)  #define copy_to_user(to,from,n) __generic_copy_to_user((to),(from),(n))  #define copy_from_user(to,from,n) __generic_copy_from_user((to),(from),(n)) -#define __copy_to_user(to,from,n) __generic_copy_to_user_nocheck((to),(from),(n)) -#define __copy_from_user(to,from,n) __generic_copy_from_user_nocheck((to),(from),(n)) +#define __copy_to_user(to,from,n) \ +	__generic_copy_to_user_nocheck((to),(from),(n)) +#define __copy_from_user(to,from,n) \ +	__generic_copy_from_user_nocheck((to),(from),(n))  #define __copy_to_user_inatomic __copy_to_user  #define __copy_from_user_inatomic __copy_from_user diff --git a/arch/xtensa/include/asm/unistd.h b/arch/xtensa/include/asm/unistd.h index e002dbcc88b..eb63ea87815 100644 --- a/arch/xtensa/include/asm/unistd.h +++ b/arch/xtensa/include/asm/unistd.h @@ -1,7 +1,6 @@  #ifndef _XTENSA_UNISTD_H  #define _XTENSA_UNISTD_H -#define __ARCH_WANT_SYS_EXECVE  #define __ARCH_WANT_SYS_CLONE  #include <uapi/asm/unistd.h> diff --git a/arch/xtensa/include/uapi/asm/signal.h b/arch/xtensa/include/uapi/asm/signal.h index b88ce96f2af..dacf716dd3e 100644 --- a/arch/xtensa/include/uapi/asm/signal.h +++ b/arch/xtensa/include/uapi/asm/signal.h @@ -97,12 +97,6 @@ typedef struct {  #define SA_RESTORER	0x04000000 -/* - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 -  #define MINSIGSTKSZ	2048  #define SIGSTKSZ	8192 diff --git a/arch/xtensa/kernel/Makefile b/arch/xtensa/kernel/Makefile index f36cef5a62f..c3a59d992ac 100644 --- a/arch/xtensa/kernel/Makefile +++ b/arch/xtensa/kernel/Makefile @@ -23,13 +23,13 @@ obj-$(CONFIG_MODULES) += xtensa_ksyms.o module.o  #  # Replicate rules in scripts/Makefile.build -sed-y = -e 's/\*(\(\.[a-z]*it\|\.ref\|\)\.text)/*(\1.literal \1.text)/g'    \ -	-e 's/\.text\.unlikely/.literal.unlikely .text.unlikely/g' \ +sed-y = -e 's/\*(\(\.[a-z]*it\|\.ref\|\)\.text)/*(\1.literal \1.text)/g' \ +	-e 's/\.text\.unlikely/.literal.unlikely .text.unlikely/g'	 \  	-e 's/\*(\(\.text\.[a-z]*\))/*(\1.literal \1)/g'  quiet_cmd__cpp_lds_S = LDS     $@ -      cmd__cpp_lds_S = $(CPP) $(cpp_flags) -P -C -Uxtensa -D__ASSEMBLY__ $< \ -                       | sed $(sed-y) >$@ +cmd__cpp_lds_S = $(CPP) $(cpp_flags) -P -C -Uxtensa -D__ASSEMBLY__ $<    \ +                 | sed $(sed-y) >$@  $(obj)/vmlinux.lds: $(src)/vmlinux.lds.S FORCE  	$(call if_changed_dep,_cpp_lds_S) diff --git a/arch/xtensa/kernel/align.S b/arch/xtensa/kernel/align.S index 934ae58e2c7..aa2e87b8566 100644 --- a/arch/xtensa/kernel/align.S +++ b/arch/xtensa/kernel/align.S @@ -442,7 +442,7 @@ ENTRY(fast_unaligned)  	mov	a1, a2  	rsr	a0, ps -        bbsi.l  a2, PS_UM_BIT, 1f     # jump if user mode +	bbsi.l  a2, PS_UM_BIT, 1f     # jump if user mode  	movi	a0, _kernel_exception  	jx	a0 @@ -450,6 +450,6 @@ ENTRY(fast_unaligned)  1:	movi	a0, _user_exception  	jx	a0 +ENDPROC(fast_unaligned)  #endif /* XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION */ - diff --git a/arch/xtensa/kernel/asm-offsets.c b/arch/xtensa/kernel/asm-offsets.c index 7dc3f915718..0701fad170d 100644 --- a/arch/xtensa/kernel/asm-offsets.c +++ b/arch/xtensa/kernel/asm-offsets.c @@ -41,6 +41,7 @@ int main(void)  	DEFINE(PT_SAR, offsetof (struct pt_regs, sar));  	DEFINE(PT_ICOUNTLEVEL, offsetof (struct pt_regs, icountlevel));  	DEFINE(PT_SYSCALL, offsetof (struct pt_regs, syscall)); +	DEFINE(PT_SCOMPARE1, offsetof(struct pt_regs, scompare1));  	DEFINE(PT_AREG, offsetof (struct pt_regs, areg[0]));  	DEFINE(PT_AREG0, offsetof (struct pt_regs, areg[0]));  	DEFINE(PT_AREG1, offsetof (struct pt_regs, areg[1])); @@ -91,7 +92,8 @@ int main(void)  #endif  	DEFINE(THREAD_XTREGS_USER, offsetof (struct thread_info, xtregs_user));  	DEFINE(XTREGS_USER_SIZE, sizeof(xtregs_user_t)); -	DEFINE(THREAD_CURRENT_DS, offsetof (struct task_struct, thread.current_ds)); +	DEFINE(THREAD_CURRENT_DS, offsetof (struct task_struct, \ +	       thread.current_ds));  	/* struct mm_struct */  	DEFINE(MM_USERS, offsetof(struct mm_struct, mm_users)); @@ -108,4 +110,3 @@ int main(void)  	return 0;  } - diff --git a/arch/xtensa/kernel/coprocessor.S b/arch/xtensa/kernel/coprocessor.S index 54c3be313bf..64765748486 100644 --- a/arch/xtensa/kernel/coprocessor.S +++ b/arch/xtensa/kernel/coprocessor.S @@ -43,10 +43,13 @@  /* IO protection is currently unsupported. */  ENTRY(fast_io_protect) +  	wsr	a0, excsave1  	movi	a0, unrecoverable_exception  	callx0	a0 +ENDPROC(fast_io_protect) +  #if XTENSA_HAVE_COPROCESSORS  /* @@ -139,6 +142,7 @@ ENTRY(fast_io_protect)   */  ENTRY(coprocessor_save) +  	entry	a1, 32  	s32i	a0, a1, 0  	movi	a0, .Lsave_cp_regs_jump_table @@ -150,7 +154,10 @@ ENTRY(coprocessor_save)  1:	l32i	a0, a1, 0  	retw +ENDPROC(coprocessor_save) +  ENTRY(coprocessor_load) +  	entry	a1, 32  	s32i	a0, a1, 0  	movi	a0, .Lload_cp_regs_jump_table @@ -162,8 +169,10 @@ ENTRY(coprocessor_load)  1:	l32i	a0, a1, 0  	retw +ENDPROC(coprocessor_load) +  /* - * coprocessor_flush(struct task_info*, index)  + * coprocessor_flush(struct task_info*, index)   *                             a2        a3   * coprocessor_restore(struct task_info*, index)   *                              a2         a3 @@ -178,6 +187,7 @@ ENTRY(coprocessor_load)  ENTRY(coprocessor_flush) +  	entry	a1, 32  	s32i	a0, a1, 0  	movi	a0, .Lsave_cp_regs_jump_table @@ -191,6 +201,8 @@ ENTRY(coprocessor_flush)  1:	l32i	a0, a1, 0  	retw +ENDPROC(coprocessor_flush) +  ENTRY(coprocessor_restore)  	entry	a1, 32  	s32i	a0, a1, 0 @@ -205,6 +217,8 @@ ENTRY(coprocessor_restore)  1:	l32i	a0, a1, 0  	retw +ENDPROC(coprocessor_restore) +  /*   * Entry condition:   * @@ -220,10 +234,12 @@ ENTRY(coprocessor_restore)   */  ENTRY(fast_coprocessor_double) +  	wsr	a0, excsave1  	movi	a0, unrecoverable_exception  	callx0	a0 +ENDPROC(fast_coprocessor_double)  ENTRY(fast_coprocessor) @@ -327,9 +343,14 @@ ENTRY(fast_coprocessor)  	rfe +ENDPROC(fast_coprocessor) +  	.data +  ENTRY(coprocessor_owner) +  	.fill XCHAL_CP_MAX, 4, 0 -#endif /* XTENSA_HAVE_COPROCESSORS */ +END(coprocessor_owner) +#endif /* XTENSA_HAVE_COPROCESSORS */ diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index 90bfc1dbc13..3777fec85e7 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S @@ -219,6 +219,7 @@ _user_exception:  	j	common_exception +ENDPROC(user_exception)  /*   * First-level exit handler for kernel exceptions @@ -371,6 +372,13 @@ common_exception:  	s32i	a2, a1, PT_LBEG  	s32i	a3, a1, PT_LEND +	/* Save SCOMPARE1 */ + +#if XCHAL_HAVE_S32C1I +	rsr     a2, scompare1 +	s32i    a2, a1, PT_SCOMPARE1 +#endif +  	/* Save optional registers. */  	save_xtregs_opt a1 a2 a4 a5 a6 a7 PT_XTREGS_OPT @@ -432,6 +440,12 @@ common_exception_return:  	load_xtregs_opt a1 a2 a4 a5 a6 a7 PT_XTREGS_OPT +	/* Restore SCOMPARE1 */ + +#if XCHAL_HAVE_S32C1I +	l32i    a2, a1, PT_SCOMPARE1 +	wsr     a2, scompare1 +#endif  	wsr	a3, ps		/* disable interrupts */  	_bbci.l	a3, PS_UM_BIT, kernel_exception_exit @@ -641,6 +655,8 @@ common_exception_exit:  	l32i	a1, a1, PT_AREG1  	rfde +ENDPROC(kernel_exception) +  /*   * Debug exception handler.   * @@ -701,6 +717,7 @@ ENTRY(debug_exception)  	/* Debug exception while in exception mode. */  1:	j	1b	// FIXME!! +ENDPROC(debug_exception)  /*   * We get here in case of an unrecoverable exception. @@ -751,6 +768,7 @@ ENTRY(unrecoverable_exception)  1:	j	1b +ENDPROC(unrecoverable_exception)  /* -------------------------- FAST EXCEPTION HANDLERS ----------------------- */ @@ -856,7 +874,7 @@ ENTRY(fast_alloca)  	_bnei	a0, 1, 1f		# no 'movsp a1, ax': jump -        /* Move the save area. This implies the use of the L32E +	/* Move the save area. This implies the use of the L32E  	 * and S32E instructions, because this move must be done with  	 * the user's PS.RING privilege levels, not with ring 0  	 * (kernel's) privileges currently active with PS.EXCM @@ -929,6 +947,7 @@ ENTRY(fast_alloca)  	l32i	a2, a2, PT_AREG2  	rfe +ENDPROC(fast_alloca)  /*   * fast system calls. @@ -966,6 +985,8 @@ ENTRY(fast_syscall_kernel)  	j	kernel_exception +ENDPROC(fast_syscall_kernel) +  ENTRY(fast_syscall_user)  	/* Skip syscall. */ @@ -983,19 +1004,21 @@ ENTRY(fast_syscall_user)  	j	user_exception -ENTRY(fast_syscall_unrecoverable) +ENDPROC(fast_syscall_user) -        /* Restore all states. */ +ENTRY(fast_syscall_unrecoverable) -        l32i    a0, a2, PT_AREG0        # restore a0 -        xsr     a2, depc                # restore a2, depc -        rsr     a3, excsave1 +	/* Restore all states. */ -        wsr     a0, excsave1 -        movi    a0, unrecoverable_exception -        callx0  a0 +	l32i    a0, a2, PT_AREG0        # restore a0 +	xsr     a2, depc                # restore a2, depc +	rsr     a3, excsave1 +	wsr     a0, excsave1 +	movi    a0, unrecoverable_exception +	callx0  a0 +ENDPROC(fast_syscall_unrecoverable)  /*   * sysxtensa syscall handler @@ -1101,7 +1124,7 @@ CATCH  	movi	a2, -EINVAL  	rfe - +ENDPROC(fast_syscall_xtensa)  /* fast_syscall_spill_registers. @@ -1160,6 +1183,8 @@ ENTRY(fast_syscall_spill_registers)  	movi	a2, 0  	rfe +ENDPROC(fast_syscall_spill_registers) +  /* Fixup handler.   *   * We get here if the spill routine causes an exception, e.g. tlb miss. @@ -1228,9 +1253,9 @@ fast_syscall_spill_registers_fixup:  	movi	a3, exc_table  	rsr	a0, exccause -        addx4	a0, a0, a3              	# find entry in table -        l32i	a0, a0, EXC_TABLE_FAST_USER     # load handler -        jx	a0 +	addx4	a0, a0, a3              	# find entry in table +	l32i	a0, a0, EXC_TABLE_FAST_USER     # load handler +	jx	a0  fast_syscall_spill_registers_fixup_return: @@ -1432,7 +1457,7 @@ ENTRY(_spill_registers)  	rsr	a0, ps  	_bbci.l	a0, PS_UM_BIT, 1f - 	/* User space: Setup a dummy frame and kill application. +	/* User space: Setup a dummy frame and kill application.  	 * Note: We assume EXC_TABLE_KSTK contains a valid stack pointer.  	 */ @@ -1464,6 +1489,8 @@ ENTRY(_spill_registers)  	callx0	a0		# should not return  1:	j	1b +ENDPROC(_spill_registers) +  #ifdef CONFIG_MMU  /*   * We should never get here. Bail out! @@ -1475,6 +1502,8 @@ ENTRY(fast_second_level_miss_double_kernel)  	callx0	a0		# should not return  1:	j	1b +ENDPROC(fast_second_level_miss_double_kernel) +  /* First-level entry handler for user, kernel, and double 2nd-level   * TLB miss exceptions.  Note that for now, user and kernel miss   * exceptions share the same entry point and are handled identically. @@ -1682,6 +1711,7 @@ ENTRY(fast_second_level_miss)  	j	_kernel_exception  1:	j	_user_exception +ENDPROC(fast_second_level_miss)  /*   * StoreProhibitedException @@ -1777,6 +1807,9 @@ ENTRY(fast_store_prohibited)  	bbsi.l	a2, PS_UM_BIT, 1f  	j	_kernel_exception  1:	j	_user_exception + +ENDPROC(fast_store_prohibited) +  #endif /* CONFIG_MMU */  /* @@ -1787,6 +1820,7 @@ ENTRY(fast_store_prohibited)   */  ENTRY(system_call) +  	entry	a1, 32  	/* regs->syscall = regs->areg[2] */ @@ -1831,6 +1865,8 @@ ENTRY(system_call)  	callx4	a4  	retw +ENDPROC(system_call) +  /*   * Task switch. @@ -1899,6 +1935,7 @@ ENTRY(_switch_to)  	retw +ENDPROC(_switch_to)  ENTRY(ret_from_fork) @@ -1914,6 +1951,8 @@ ENTRY(ret_from_fork)  	j	common_exception_return +ENDPROC(ret_from_fork) +  /*   * Kernel thread creation helper   * On entry, set up by copy_thread: a2 = thread_fn, a3 = thread_fn arg diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S index bdc50788f35..91d9095284d 100644 --- a/arch/xtensa/kernel/head.S +++ b/arch/xtensa/kernel/head.S @@ -18,6 +18,7 @@  #include <asm/processor.h>  #include <asm/page.h>  #include <asm/cacheasm.h> +#include <asm/initialize_mmu.h>  #include <linux/init.h>  #include <linux/linkage.h> @@ -47,16 +48,19 @@  	 */  	__HEAD -	.globl _start -_start:	_j	2f +ENTRY(_start) + +	_j	2f  	.align	4  1:	.word	_startup  2:	l32r	a0, 1b  	jx	a0 +ENDPROC(_start) +  	.section .init.text, "ax" -	.align 4 -_startup: + +ENTRY(_startup)  	/* Disable interrupts and exceptions. */ @@ -107,7 +111,7 @@ _startup:  	/* Disable all timers. */  	.set	_index, 0 -	.rept	XCHAL_NUM_TIMERS - 1 +	.rept	XCHAL_NUM_TIMERS  	wsr	a0, SREG_CCOMPARE + _index  	.set	_index, _index + 1  	.endr @@ -120,7 +124,7 @@ _startup:  	/* Disable coprocessors. */ -#if XCHAL_CP_NUM > 0 +#if XCHAL_HAVE_CP  	wsr	a0, cpenable  #endif @@ -152,6 +156,8 @@ _startup:  	isync +	initialize_mmu +  	/* Unpack data sections  	 *  	 * The linker script used to build the Linux kernel image @@ -230,6 +236,7 @@ _startup:  should_never_return:  	j	should_never_return +ENDPROC(_startup)  /*   * BSS section @@ -239,6 +246,8 @@ __PAGE_ALIGNED_BSS  #ifdef CONFIG_MMU  ENTRY(swapper_pg_dir)  	.fill	PAGE_SIZE, 1, 0 +END(swapper_pg_dir)  #endif  ENTRY(empty_zero_page)  	.fill	PAGE_SIZE, 1, 0 +END(empty_zero_page) diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c index a6ce3e56373..6f4f9749cff 100644 --- a/arch/xtensa/kernel/irq.c +++ b/arch/xtensa/kernel/irq.c @@ -18,6 +18,8 @@  #include <linux/interrupt.h>  #include <linux/irq.h>  #include <linux/kernel_stat.h> +#include <linux/irqdomain.h> +#include <linux/of.h>  #include <asm/uaccess.h>  #include <asm/platform.h> @@ -26,19 +28,22 @@ static unsigned int cached_irq_mask;  atomic_t irq_err_count; +static struct irq_domain *root_domain; +  /*   * do_IRQ handles all normal device IRQ's (the special   * SMP cross-CPU interrupts have their own specific   * handlers).   */ -asmlinkage void do_IRQ(int irq, struct pt_regs *regs) +asmlinkage void do_IRQ(int hwirq, struct pt_regs *regs)  {  	struct pt_regs *old_regs = set_irq_regs(regs); +	int irq = irq_find_mapping(root_domain, hwirq); -	if (irq >= NR_IRQS) { +	if (hwirq >= NR_IRQS) {  		printk(KERN_EMERG "%s: cannot handle IRQ %d\n", -				__func__, irq); +				__func__, hwirq);  	}  	irq_enter(); @@ -71,40 +76,39 @@ int arch_show_interrupts(struct seq_file *p, int prec)  static void xtensa_irq_mask(struct irq_data *d)  { -	cached_irq_mask &= ~(1 << d->irq); +	cached_irq_mask &= ~(1 << d->hwirq);  	set_sr (cached_irq_mask, intenable);  }  static void xtensa_irq_unmask(struct irq_data *d)  { -	cached_irq_mask |= 1 << d->irq; +	cached_irq_mask |= 1 << d->hwirq;  	set_sr (cached_irq_mask, intenable);  }  static void xtensa_irq_enable(struct irq_data *d)  { -	variant_irq_enable(d->irq); +	variant_irq_enable(d->hwirq);  	xtensa_irq_unmask(d);  }  static void xtensa_irq_disable(struct irq_data *d)  {  	xtensa_irq_mask(d); -	variant_irq_disable(d->irq); +	variant_irq_disable(d->hwirq);  }  static void xtensa_irq_ack(struct irq_data *d)  { -	set_sr(1 << d->irq, intclear); +	set_sr(1 << d->hwirq, intclear);  }  static int xtensa_irq_retrigger(struct irq_data *d)  { -	set_sr (1 << d->irq, INTSET); +	set_sr(1 << d->hwirq, intset);  	return 1;  } -  static struct irq_chip xtensa_irq_chip = {  	.name		= "xtensa",  	.irq_enable	= xtensa_irq_enable, @@ -115,37 +119,99 @@ static struct irq_chip xtensa_irq_chip = {  	.irq_retrigger	= xtensa_irq_retrigger,  }; -void __init init_IRQ(void) +static int xtensa_irq_map(struct irq_domain *d, unsigned int irq, +		irq_hw_number_t hw)  { -	int index; +	u32 mask = 1 << hw; -	for (index = 0; index < XTENSA_NR_IRQS; index++) { -		int mask = 1 << index; +	if (mask & XCHAL_INTTYPE_MASK_SOFTWARE) { +		irq_set_chip_and_handler_name(irq, &xtensa_irq_chip, +				handle_simple_irq, "level"); +		irq_set_status_flags(irq, IRQ_LEVEL); +	} else if (mask & XCHAL_INTTYPE_MASK_EXTERN_EDGE) { +		irq_set_chip_and_handler_name(irq, &xtensa_irq_chip, +				handle_edge_irq, "edge"); +		irq_clear_status_flags(irq, IRQ_LEVEL); +	} else if (mask & XCHAL_INTTYPE_MASK_EXTERN_LEVEL) { +		irq_set_chip_and_handler_name(irq, &xtensa_irq_chip, +				handle_level_irq, "level"); +		irq_set_status_flags(irq, IRQ_LEVEL); +	} else if (mask & XCHAL_INTTYPE_MASK_TIMER) { +		irq_set_chip_and_handler_name(irq, &xtensa_irq_chip, +				handle_edge_irq, "edge"); +		irq_clear_status_flags(irq, IRQ_LEVEL); +	} else {/* XCHAL_INTTYPE_MASK_WRITE_ERROR */ +		/* XCHAL_INTTYPE_MASK_NMI */ -		if (mask & XCHAL_INTTYPE_MASK_SOFTWARE) -			irq_set_chip_and_handler(index, &xtensa_irq_chip, -						 handle_simple_irq); +		irq_set_chip_and_handler_name(irq, &xtensa_irq_chip, +				handle_level_irq, "level"); +		irq_set_status_flags(irq, IRQ_LEVEL); +	} +	return 0; +} -		else if (mask & XCHAL_INTTYPE_MASK_EXTERN_EDGE) -			irq_set_chip_and_handler(index, &xtensa_irq_chip, -						 handle_edge_irq); +static unsigned map_ext_irq(unsigned ext_irq) +{ +	unsigned mask = XCHAL_INTTYPE_MASK_EXTERN_EDGE | +		XCHAL_INTTYPE_MASK_EXTERN_LEVEL; +	unsigned i; -		else if (mask & XCHAL_INTTYPE_MASK_EXTERN_LEVEL) -			irq_set_chip_and_handler(index, &xtensa_irq_chip, -						 handle_level_irq); +	for (i = 0; mask; ++i, mask >>= 1) { +		if ((mask & 1) && ext_irq-- == 0) +			return i; +	} +	return XCHAL_NUM_INTERRUPTS; +} -		else if (mask & XCHAL_INTTYPE_MASK_TIMER) -			irq_set_chip_and_handler(index, &xtensa_irq_chip, -						 handle_edge_irq); +/* + * Device Tree IRQ specifier translation function which works with one or + * two cell bindings. First cell value maps directly to the hwirq number. + * Second cell if present specifies whether hwirq number is external (1) or + * internal (0). + */ +int xtensa_irq_domain_xlate(struct irq_domain *d, struct device_node *ctrlr, +		const u32 *intspec, unsigned int intsize, +		unsigned long *out_hwirq, unsigned int *out_type) +{ +	if (WARN_ON(intsize < 1 || intsize > 2)) +		return -EINVAL; +	if (intsize == 2 && intspec[1] == 1) { +		unsigned int_irq = map_ext_irq(intspec[0]); +		if (int_irq < XCHAL_NUM_INTERRUPTS) +			*out_hwirq = int_irq; +		else +			return -EINVAL; +	} else { +		*out_hwirq = intspec[0]; +	} +	*out_type = IRQ_TYPE_NONE; +	return 0; +} -		else	/* XCHAL_INTTYPE_MASK_WRITE_ERROR */ -			/* XCHAL_INTTYPE_MASK_NMI */ +static const struct irq_domain_ops xtensa_irq_domain_ops = { +	.xlate = xtensa_irq_domain_xlate, +	.map = xtensa_irq_map, +}; -			irq_set_chip_and_handler(index, &xtensa_irq_chip, -						 handle_level_irq); -	} +void __init init_IRQ(void) +{ +	struct device_node *intc = NULL;  	cached_irq_mask = 0; +	set_sr(~0, intclear); + +#ifdef CONFIG_OF +	/* The interrupt controller device node is mandatory */ +	intc = of_find_compatible_node(NULL, NULL, "xtensa,pic"); +	BUG_ON(!intc); + +	root_domain = irq_domain_add_linear(intc, NR_IRQS, +			&xtensa_irq_domain_ops, NULL); +#else +	root_domain = irq_domain_add_legacy(intc, NR_IRQS, 0, 0, +			&xtensa_irq_domain_ops, NULL); +#endif +	irq_set_default_host(root_domain);  	variant_init_irq();  } diff --git a/arch/xtensa/kernel/module.c b/arch/xtensa/kernel/module.c index 451dda928c9..b715237bae6 100644 --- a/arch/xtensa/kernel/module.c +++ b/arch/xtensa/kernel/module.c @@ -53,7 +53,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,  		       struct module *mod)  {  	unsigned int i; -        Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; +	Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr;  	Elf32_Sym *sym;  	unsigned char *location;  	uint32_t value; diff --git a/arch/xtensa/kernel/platform.c b/arch/xtensa/kernel/platform.c index 97230e46cbe..44bf21c3769 100644 --- a/arch/xtensa/kernel/platform.c +++ b/arch/xtensa/kernel/platform.c @@ -44,4 +44,3 @@ _F(void, calibrate_ccount, (void),  	ccount_per_jiffy = 10 * (1000000UL/HZ);  });  #endif - diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c index 1accf28da5f..0dd5784416d 100644 --- a/arch/xtensa/kernel/process.c +++ b/arch/xtensa/kernel/process.c @@ -108,7 +108,7 @@ void coprocessor_flush_all(struct thread_info *ti)  void cpu_idle(void)  { -  	local_irq_enable(); +	local_irq_enable();  	/* endless idle loop with no priority at all */  	while (1) { diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c index 33eea4c16f1..61fb2e9e903 100644 --- a/arch/xtensa/kernel/ptrace.c +++ b/arch/xtensa/kernel/ptrace.c @@ -154,7 +154,7 @@ int ptrace_setxregs(struct task_struct *child, void __user *uregs)  	coprocessor_flush_all(ti);  	coprocessor_release_all(ti); -	ret |= __copy_from_user(&ti->xtregs_cp, &xtregs->cp0,  +	ret |= __copy_from_user(&ti->xtregs_cp, &xtregs->cp0,  				sizeof(xtregs_coprocessor_t));  #endif  	ret |= __copy_from_user(®s->xtregs_opt, &xtregs->opt, @@ -343,4 +343,3 @@ void do_syscall_trace_leave(struct pt_regs *regs)  			&& (current->ptrace & PT_PTRACED))  		do_syscall_trace();  } - diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index b237988ba6d..24c1a57abb4 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c @@ -22,6 +22,11 @@  #include <linux/bootmem.h>  #include <linux/kernel.h> +#ifdef CONFIG_OF +#include <linux/of_fdt.h> +#include <linux/of_platform.h> +#endif +  #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)  # include <linux/console.h>  #endif @@ -42,6 +47,7 @@  #include <asm/page.h>  #include <asm/setup.h>  #include <asm/param.h> +#include <asm/traps.h>  #include <platform/hardware.h> @@ -64,6 +70,11 @@ int initrd_is_mapped = 0;  extern int initrd_below_start_ok;  #endif +#ifdef CONFIG_OF +extern u32 __dtb_start[]; +void *dtb_start = __dtb_start; +#endif +  unsigned char aux_device_present;  extern unsigned long loops_per_jiffy; @@ -83,6 +94,8 @@ extern void init_mmu(void);  static inline void init_mmu(void) { }  #endif +extern int mem_reserve(unsigned long, unsigned long, int); +extern void bootmem_init(void);  extern void zones_init(void);  /* @@ -104,28 +117,33 @@ typedef struct tagtable {  /* parse current tag */ -static int __init parse_tag_mem(const bp_tag_t *tag) +static int __init add_sysmem_bank(unsigned long type, unsigned long start, +		unsigned long end)  { -	meminfo_t *mi = (meminfo_t*)(tag->data); - -	if (mi->type != MEMORY_TYPE_CONVENTIONAL) -		return -1; -  	if (sysmem.nr_banks >= SYSMEM_BANKS_MAX) {  		printk(KERN_WARNING -		       "Ignoring memory bank 0x%08lx size %ldKB\n", -		       (unsigned long)mi->start, -		       (unsigned long)mi->end - (unsigned long)mi->start); +				"Ignoring memory bank 0x%08lx size %ldKB\n", +				start, end - start);  		return -EINVAL;  	} -	sysmem.bank[sysmem.nr_banks].type  = mi->type; -	sysmem.bank[sysmem.nr_banks].start = PAGE_ALIGN(mi->start); -	sysmem.bank[sysmem.nr_banks].end   = mi->end & PAGE_MASK; +	sysmem.bank[sysmem.nr_banks].type  = type; +	sysmem.bank[sysmem.nr_banks].start = PAGE_ALIGN(start); +	sysmem.bank[sysmem.nr_banks].end   = end & PAGE_MASK;  	sysmem.nr_banks++;  	return 0;  } +static int __init parse_tag_mem(const bp_tag_t *tag) +{ +	meminfo_t *mi = (meminfo_t *)(tag->data); + +	if (mi->type != MEMORY_TYPE_CONVENTIONAL) +		return -1; + +	return add_sysmem_bank(mi->type, mi->start, mi->end); +} +  __tagtable(BP_TAG_MEMORY, parse_tag_mem);  #ifdef CONFIG_BLK_DEV_INITRD @@ -142,12 +160,31 @@ static int __init parse_tag_initrd(const bp_tag_t* tag)  __tagtable(BP_TAG_INITRD, parse_tag_initrd); +#ifdef CONFIG_OF + +static int __init parse_tag_fdt(const bp_tag_t *tag) +{ +	dtb_start = (void *)(tag->data[0]); +	return 0; +} + +__tagtable(BP_TAG_FDT, parse_tag_fdt); + +void __init early_init_dt_setup_initrd_arch(unsigned long start, +		unsigned long end) +{ +	initrd_start = (void *)__va(start); +	initrd_end = (void *)__va(end); +	initrd_below_start_ok = 1; +} + +#endif /* CONFIG_OF */ +  #endif /* CONFIG_BLK_DEV_INITRD */  static int __init parse_tag_cmdline(const bp_tag_t* tag)  { -	strncpy(command_line, (char*)(tag->data), COMMAND_LINE_SIZE); -	command_line[COMMAND_LINE_SIZE - 1] = '\0'; +	strlcpy(command_line, (char *)(tag->data), COMMAND_LINE_SIZE);  	return 0;  } @@ -185,6 +222,58 @@ static int __init parse_bootparam(const bp_tag_t* tag)  	return 0;  } +#ifdef CONFIG_OF + +void __init early_init_dt_add_memory_arch(u64 base, u64 size) +{ +	size &= PAGE_MASK; +	add_sysmem_bank(MEMORY_TYPE_CONVENTIONAL, base, base + size); +} + +void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) +{ +	return __alloc_bootmem(size, align, 0); +} + +void __init early_init_devtree(void *params) +{ +	/* Setup flat device-tree pointer */ +	initial_boot_params = params; + +	/* Retrieve various informations from the /chosen node of the +	 * device-tree, including the platform type, initrd location and +	 * size, TCE reserve, and more ... +	 */ +	if (!command_line[0]) +		of_scan_flat_dt(early_init_dt_scan_chosen, command_line); + +	/* Scan memory nodes and rebuild MEMBLOCKs */ +	of_scan_flat_dt(early_init_dt_scan_root, NULL); +	if (sysmem.nr_banks == 0) +		of_scan_flat_dt(early_init_dt_scan_memory, NULL); +} + +static void __init copy_devtree(void) +{ +	void *alloc = early_init_dt_alloc_memory_arch( +			be32_to_cpu(initial_boot_params->totalsize), 0); +	if (alloc) { +		memcpy(alloc, initial_boot_params, +				be32_to_cpu(initial_boot_params->totalsize)); +		initial_boot_params = alloc; +	} +} + +static int __init xtensa_device_probe(void) +{ +	of_platform_populate(NULL, NULL, NULL, NULL); +	return 0; +} + +device_initcall(xtensa_device_probe); + +#endif /* CONFIG_OF */ +  /*   * Initialize architecture. (Early stage)   */ @@ -193,14 +282,14 @@ void __init init_arch(bp_tag_t *bp_start)  {  	sysmem.nr_banks = 0; -#ifdef CONFIG_CMDLINE_BOOL -	strcpy(command_line, default_command_line); -#endif -  	/* Parse boot parameters */ -        if (bp_start) -	  parse_bootparam(bp_start); +	if (bp_start) +		parse_bootparam(bp_start); + +#ifdef CONFIG_OF +	early_init_devtree(dtb_start); +#endif  	if (sysmem.nr_banks == 0) {  		sysmem.nr_banks = 1; @@ -209,6 +298,11 @@ void __init init_arch(bp_tag_t *bp_start)  				     + PLATFORM_DEFAULT_MEM_SIZE;  	} +#ifdef CONFIG_CMDLINE_BOOL +	if (!command_line[0]) +		strlcpy(command_line, default_command_line, COMMAND_LINE_SIZE); +#endif +  	/* Early hook for platforms */  	platform_init(bp_start); @@ -235,15 +329,130 @@ extern char _UserExceptionVector_text_end;  extern char _DoubleExceptionVector_literal_start;  extern char _DoubleExceptionVector_text_end; -void __init setup_arch(char **cmdline_p) + +#ifdef CONFIG_S32C1I_SELFTEST +#if XCHAL_HAVE_S32C1I + +static int __initdata rcw_word, rcw_probe_pc, rcw_exc; + +/* + * Basic atomic compare-and-swap, that records PC of S32C1I for probing. + * + * If *v == cmp, set *v = set.  Return previous *v. + */ +static inline int probed_compare_swap(int *v, int cmp, int set) +{ +	int tmp; + +	__asm__ __volatile__( +			"	movi	%1, 1f\n" +			"	s32i	%1, %4, 0\n" +			"	wsr	%2, scompare1\n" +			"1:	s32c1i	%0, %3, 0\n" +			: "=a" (set), "=&a" (tmp) +			: "a" (cmp), "a" (v), "a" (&rcw_probe_pc), "0" (set) +			: "memory" +			); +	return set; +} + +/* Handle probed exception */ + +void __init do_probed_exception(struct pt_regs *regs, unsigned long exccause)  { -	extern int mem_reserve(unsigned long, unsigned long, int); -	extern void bootmem_init(void); +	if (regs->pc == rcw_probe_pc) {	/* exception on s32c1i ? */ +		regs->pc += 3;		/* skip the s32c1i instruction */ +		rcw_exc = exccause; +	} else { +		do_unhandled(regs, exccause); +	} +} + +/* Simple test of S32C1I (soc bringup assist) */ + +void __init check_s32c1i(void) +{ +	int n, cause1, cause2; +	void *handbus, *handdata, *handaddr; /* temporarily saved handlers */ + +	rcw_probe_pc = 0; +	handbus  = trap_set_handler(EXCCAUSE_LOAD_STORE_ERROR, +			do_probed_exception); +	handdata = trap_set_handler(EXCCAUSE_LOAD_STORE_DATA_ERROR, +			do_probed_exception); +	handaddr = trap_set_handler(EXCCAUSE_LOAD_STORE_ADDR_ERROR, +			do_probed_exception); + +	/* First try an S32C1I that does not store: */ +	rcw_exc = 0; +	rcw_word = 1; +	n = probed_compare_swap(&rcw_word, 0, 2); +	cause1 = rcw_exc; + +	/* took exception? */ +	if (cause1 != 0) { +		/* unclean exception? */ +		if (n != 2 || rcw_word != 1) +			panic("S32C1I exception error"); +	} else if (rcw_word != 1 || n != 1) { +		panic("S32C1I compare error"); +	} -	memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); -	boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; +	/* Then an S32C1I that stores: */ +	rcw_exc = 0; +	rcw_word = 0x1234567; +	n = probed_compare_swap(&rcw_word, 0x1234567, 0xabcde); +	cause2 = rcw_exc; + +	if (cause2 != 0) { +		/* unclean exception? */ +		if (n != 0xabcde || rcw_word != 0x1234567) +			panic("S32C1I exception error (b)"); +	} else if (rcw_word != 0xabcde || n != 0x1234567) { +		panic("S32C1I store error"); +	} + +	/* Verify consistency of exceptions: */ +	if (cause1 || cause2) { +		pr_warn("S32C1I took exception %d, %d\n", cause1, cause2); +		/* If emulation of S32C1I upon bus error gets implemented, +		   we can get rid of this panic for single core (not SMP) */ +		panic("S32C1I exceptions not currently supported"); +	} +	if (cause1 != cause2) +		panic("inconsistent S32C1I exceptions"); + +	trap_set_handler(EXCCAUSE_LOAD_STORE_ERROR, handbus); +	trap_set_handler(EXCCAUSE_LOAD_STORE_DATA_ERROR, handdata); +	trap_set_handler(EXCCAUSE_LOAD_STORE_ADDR_ERROR, handaddr); +} + +#else /* XCHAL_HAVE_S32C1I */ + +/* This condition should not occur with a commercially deployed processor. +   Display reminder for early engr test or demo chips / FPGA bitstreams */ +void __init check_s32c1i(void) +{ +	pr_warn("Processor configuration lacks atomic compare-and-swap support!\n"); +} + +#endif /* XCHAL_HAVE_S32C1I */ +#else /* CONFIG_S32C1I_SELFTEST */ + +void __init check_s32c1i(void) +{ +} + +#endif /* CONFIG_S32C1I_SELFTEST */ + + +void __init setup_arch(char **cmdline_p) +{ +	strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);  	*cmdline_p = command_line; +	check_s32c1i(); +  	/* Reserve some memory regions */  #ifdef CONFIG_BLK_DEV_INITRD @@ -251,7 +460,7 @@ void __init setup_arch(char **cmdline_p)  		initrd_is_mapped = mem_reserve(__pa(initrd_start),  					       __pa(initrd_end), 0);  		initrd_below_start_ok = 1; - 	} else { +	} else {  		initrd_start = 0;  	}  #endif @@ -275,8 +484,12 @@ void __init setup_arch(char **cmdline_p)  	bootmem_init(); -	platform_setup(cmdline_p); +#ifdef CONFIG_OF +	copy_devtree(); +	unflatten_device_tree(); +#endif +	platform_setup(cmdline_p);  	paging_init();  	zones_init(); @@ -326,7 +539,7 @@ c_show(struct seq_file *f, void *slot)  		     "core ID\t\t: " XCHAL_CORE_ID "\n"  		     "build ID\t: 0x%x\n"  		     "byte order\t: %s\n" - 		     "cpu MHz\t\t: %lu.%02lu\n" +		     "cpu MHz\t\t: %lu.%02lu\n"  		     "bogomips\t: %lu.%02lu\n",  		     XCHAL_BUILD_UNIQUE_ID,  		     XCHAL_HAVE_BE ?  "big" : "little", @@ -381,6 +594,9 @@ c_show(struct seq_file *f, void *slot)  #if XCHAL_HAVE_FP  		     "fpu "  #endif +#if XCHAL_HAVE_S32C1I +		     "s32c1i " +#endif  		     "\n");  	/* Registers. */ @@ -412,7 +628,7 @@ c_show(struct seq_file *f, void *slot)  		     "icache size\t: %d\n"  		     "icache flags\t: "  #if XCHAL_ICACHE_LINE_LOCKABLE -		     "lock" +		     "lock "  #endif  		     "\n"  		     "dcache line size: %d\n" @@ -420,10 +636,10 @@ c_show(struct seq_file *f, void *slot)  		     "dcache size\t: %d\n"  		     "dcache flags\t: "  #if XCHAL_DCACHE_IS_WRITEBACK -		     "writeback" +		     "writeback "  #endif  #if XCHAL_DCACHE_LINE_LOCKABLE -		     "lock" +		     "lock "  #endif  		     "\n",  		     XCHAL_ICACHE_LINESIZE, @@ -465,4 +681,3 @@ const struct seq_operations cpuinfo_op =  };  #endif /* CONFIG_PROC_FS */ - diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c index 63c566f627b..de34d6be91c 100644 --- a/arch/xtensa/kernel/signal.c +++ b/arch/xtensa/kernel/signal.c @@ -212,7 +212,7 @@ restore_sigcontext(struct pt_regs *regs, struct rt_sigframe __user *frame)  	if (err)  		return err; - 	/* The signal handler may have used coprocessors in which +	/* The signal handler may have used coprocessors in which  	 * case they are still enabled.  We disable them to force a  	 * reloading of the original task's CP state by the lazy  	 * context-switching mechanisms of CP exception handling. @@ -396,7 +396,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, siginfo_t *info,  	 */  	/* Set up registers for signal handler */ -	start_thread(regs, (unsigned long) ka->sa.sa_handler,  +	start_thread(regs, (unsigned long) ka->sa.sa_handler,  		     (unsigned long) frame);  	/* Set up a stack frame for a call4 @@ -424,9 +424,9 @@ give_sigsegv:  	return -EFAULT;  } -asmlinkage long xtensa_sigaltstack(const stack_t __user *uss,  +asmlinkage long xtensa_sigaltstack(const stack_t __user *uss,  				   stack_t __user *uoss, -    				   long a2, long a3, long a4, long a5, +				   long a2, long a3, long a4, long a5,  				   struct pt_regs *regs)  {  	return do_sigaltstack(uss, uoss, regs->areg[1]); diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c index 5702065f472..54fa8425cee 100644 --- a/arch/xtensa/kernel/syscall.c +++ b/arch/xtensa/kernel/syscall.c @@ -52,4 +52,3 @@ asmlinkage long xtensa_fadvise64_64(int fd, int advice,  {  	return sys_fadvise64_64(fd, offset, len, advice);  } - diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c index ac62f9cf1e1..ffb47410431 100644 --- a/arch/xtensa/kernel/time.c +++ b/arch/xtensa/kernel/time.c @@ -22,6 +22,7 @@  #include <linux/irq.h>  #include <linux/profile.h>  #include <linux/delay.h> +#include <linux/irqdomain.h>  #include <asm/timex.h>  #include <asm/platform.h> @@ -31,7 +32,7 @@ unsigned long ccount_per_jiffy;		/* per 1/HZ */  unsigned long nsec_per_ccount;		/* nsec per ccount increment */  #endif -static cycle_t ccount_read(void) +static cycle_t ccount_read(struct clocksource *cs)  {  	return (cycle_t)get_ccount();  } @@ -52,6 +53,7 @@ static struct irqaction timer_irqaction = {  void __init time_init(void)  { +	unsigned int irq;  #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT  	printk("Calibrating CPU frequency ");  	platform_calibrate_ccount(); @@ -62,7 +64,8 @@ void __init time_init(void)  	/* Initialize the linux timer interrupt. */ -	setup_irq(LINUX_TIMER_INT, &timer_irqaction); +	irq = irq_create_mapping(NULL, LINUX_TIMER_INT); +	setup_irq(irq, &timer_irqaction);  	set_linux_timer(get_ccount() + CCOUNT_PER_JIFFY);  } diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c index 5caf2b64d43..01e0111bf78 100644 --- a/arch/xtensa/kernel/traps.c +++ b/arch/xtensa/kernel/traps.c @@ -293,6 +293,17 @@ do_debug(struct pt_regs *regs)  } +/* Set exception C handler - for temporary use when probing exceptions */ + +void * __init trap_set_handler(int cause, void *handler) +{ +	unsigned long *entry = &exc_table[EXC_TABLE_DEFAULT / 4 + cause]; +	void *previous = (void *)*entry; +	*entry = (unsigned long)handler; +	return previous; +} + +  /*   * Initialize dispatch tables.   * @@ -397,7 +408,8 @@ static inline void spill_registers(void)  		"wsr	a13, sar\n\t"  		"wsr	a14, ps\n\t"  		:: "a" (&a0), "a" (&ps) -		: "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15", "memory"); +		: "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15", +		  "memory");  }  void show_trace(struct task_struct *task, unsigned long *sp) @@ -452,7 +464,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)  	if (!sp)  		sp = stack_pointer(task); - 	stack = sp; +	stack = sp;  	printk("\nStack: "); @@ -523,5 +535,3 @@ void die(const char * str, struct pt_regs * regs, long err)  	do_exit(err);  } - - diff --git a/arch/xtensa/kernel/vectors.S b/arch/xtensa/kernel/vectors.S index 4462c1e595c..68df35f66ce 100644 --- a/arch/xtensa/kernel/vectors.S +++ b/arch/xtensa/kernel/vectors.S @@ -79,6 +79,8 @@ ENTRY(_UserExceptionVector)  	l32i	a0, a0, EXC_TABLE_FAST_USER	# load handler  	jx	a0 +ENDPROC(_UserExceptionVector) +  /*   * Kernel exception vector. (Exceptions with PS.UM == 0, PS.EXCM == 0)   * @@ -103,6 +105,7 @@ ENTRY(_KernelExceptionVector)  	l32i	a0, a0, EXC_TABLE_FAST_KERNEL	# load handler address  	jx	a0 +ENDPROC(_KernelExceptionVector)  /*   * Double exception vector (Exceptions with PS.EXCM == 1) @@ -225,7 +228,13 @@ ENTRY(_DoubleExceptionVector)  	/* Window overflow/underflow exception. Get stack pointer. */  	mov	a3, a2 -	movi	a2, exc_table +	/* This explicit literal and the following references to it are made +	 * in order to fit DoubleExceptionVector.literals into the available +	 * 16-byte gap before DoubleExceptionVector.text in the absence of +	 * link time relaxation. See kernel/vmlinux.lds.S +	 */ +	.literal .Lexc_table, exc_table +	l32r	a2, .Lexc_table  	l32i	a2, a2, EXC_TABLE_KSTK  	/* Check for overflow/underflow exception, jump if overflow. */ @@ -255,7 +264,7 @@ ENTRY(_DoubleExceptionVector)  	s32i	a0, a2, PT_AREG0  	wsr	a3, excsave1		# save a3 -	movi	a3, exc_table +	l32r	a3, .Lexc_table  	rsr	a0, exccause  	s32i	a0, a2, PT_DEPC		# mark it as a regular exception @@ -267,7 +276,7 @@ ENTRY(_DoubleExceptionVector)  	/* a0: depc, a1: a1, a2: a2, a3: trashed, depc: a0, excsave1: a3 */ -	movi	a3, exc_table +	l32r	a3, .Lexc_table  	s32i	a2, a3, EXC_TABLE_DOUBLE_SAVE	# temporary variable  	/* Enter critical section. */ @@ -296,7 +305,7 @@ ENTRY(_DoubleExceptionVector)  	/* a0: avail, a1: a1, a2: kstk, a3: avail, depc: a2, excsave: a3 */ -	movi	a3, exc_table +	l32r	a3, .Lexc_table  	rsr	a0, exccause  	addx4	a0, a0, a3  	l32i	a0, a0, EXC_TABLE_FAST_USER @@ -338,6 +347,7 @@ ENTRY(_DoubleExceptionVector)  	.end literal_prefix +ENDPROC(_DoubleExceptionVector)  /*   * Debug interrupt vector @@ -349,9 +359,11 @@ ENTRY(_DoubleExceptionVector)  	.section .DebugInterruptVector.text, "ax"  ENTRY(_DebugInterruptVector) +  	xsr	a0, SREG_EXCSAVE + XCHAL_DEBUGLEVEL  	jx	a0 +ENDPROC(_DebugInterruptVector)  /* Window overflow and underflow handlers. @@ -363,38 +375,43 @@ ENTRY(_DebugInterruptVector)   *	 we try to access any page that would cause a page fault early.   */ +#define ENTRY_ALIGN64(name)	\ +	.globl name;		\ +	.align 64;		\ +	name: +  	.section		.WindowVectors.text, "ax"  /* 4-Register Window Overflow Vector (Handler) */ -	.align 64 -.global _WindowOverflow4 -_WindowOverflow4: +ENTRY_ALIGN64(_WindowOverflow4) +  	s32e	a0, a5, -16  	s32e	a1, a5, -12  	s32e	a2, a5,  -8  	s32e	a3, a5,  -4  	rfwo +ENDPROC(_WindowOverflow4) +  /* 4-Register Window Underflow Vector (Handler) */ -	.align 64 -.global _WindowUnderflow4 -_WindowUnderflow4: +ENTRY_ALIGN64(_WindowUnderflow4) +  	l32e	a0, a5, -16  	l32e	a1, a5, -12  	l32e	a2, a5,  -8  	l32e	a3, a5,  -4  	rfwu +ENDPROC(_WindowUnderflow4)  /* 8-Register Window Overflow Vector (Handler) */ -	.align 64 -.global _WindowOverflow8 -_WindowOverflow8: +ENTRY_ALIGN64(_WindowOverflow8) +  	s32e	a0, a9, -16  	l32e	a0, a1, -12  	s32e	a2, a9,  -8 @@ -406,11 +423,12 @@ _WindowOverflow8:  	s32e	a7, a0, -20  	rfwo +ENDPROC(_WindowOverflow8) +  /* 8-Register Window Underflow Vector (Handler) */ -	.align 64 -.global _WindowUnderflow8 -_WindowUnderflow8: +ENTRY_ALIGN64(_WindowUnderflow8) +  	l32e	a1, a9, -12  	l32e	a0, a9, -16  	l32e	a7, a1, -12 @@ -422,12 +440,12 @@ _WindowUnderflow8:  	l32e	a7, a7, -20  	rfwu +ENDPROC(_WindowUnderflow8)  /* 12-Register Window Overflow Vector (Handler) */ -	.align 64 -.global _WindowOverflow12 -_WindowOverflow12: +ENTRY_ALIGN64(_WindowOverflow12) +  	s32e	a0,  a13, -16  	l32e	a0,  a1,  -12  	s32e	a1,  a13, -12 @@ -443,11 +461,12 @@ _WindowOverflow12:  	s32e	a11, a0,  -20  	rfwo +ENDPROC(_WindowOverflow12) +  /* 12-Register Window Underflow Vector (Handler) */ -	.align 64 -.global _WindowUnderflow12 -_WindowUnderflow12: +ENTRY_ALIGN64(_WindowUnderflow12) +  	l32e	a1,  a13, -12  	l32e	a0,  a13, -16  	l32e	a11, a1,  -12 @@ -463,6 +482,6 @@ _WindowUnderflow12:  	l32e	a11, a11, -20  	rfwu -	.text - +ENDPROC(_WindowUnderflow12) +	.text diff --git a/arch/xtensa/lib/checksum.S b/arch/xtensa/lib/checksum.S index df397f932d0..4eb573d2720 100644 --- a/arch/xtensa/lib/checksum.S +++ b/arch/xtensa/lib/checksum.S @@ -41,10 +41,11 @@  .text  ENTRY(csum_partial) -	  /* -	   * Experiments with Ethernet and SLIP connections show that buf -	   * is aligned on either a 2-byte or 4-byte boundary. -	   */ + +	/* +	 * Experiments with Ethernet and SLIP connections show that buf +	 * is aligned on either a 2-byte or 4-byte boundary. +	 */  	entry	sp, 32  	extui	a5, a2, 0, 2  	bnez	a5, 8f		/* branch if 2-byte aligned */ @@ -170,7 +171,7 @@ ENTRY(csum_partial)  3:  	j	5b		/* branch to handle the remaining byte */ - +ENDPROC(csum_partial)  /*   * Copy from ds while checksumming, otherwise like csum_partial @@ -211,6 +212,7 @@ unsigned int csum_partial_copy_generic (const char *src, char *dst, int len,   */  ENTRY(csum_partial_copy_generic) +  	entry	sp, 32  	mov	a12, a3  	mov	a11, a4 @@ -367,6 +369,8 @@ DST(	s8i	a8, a3, 1	)  6:  	j	4b		/* process the possible trailing odd byte */ +ENDPROC(csum_partial_copy_generic) +  # Exception handler:  .section .fixup, "ax" @@ -406,4 +410,3 @@ DST(	s8i	a8, a3, 1	)  	retw  .previous - diff --git a/arch/xtensa/lib/memcopy.S b/arch/xtensa/lib/memcopy.S index c48b80acb5f..b1c219acabe 100644 --- a/arch/xtensa/lib/memcopy.S +++ b/arch/xtensa/lib/memcopy.S @@ -210,8 +210,10 @@ memcpy:  	_beqz	a4, .Ldone	# avoid loading anything for zero-length copies  	# copy 16 bytes per iteration for word-aligned dst and unaligned src  	ssa8	a3		# set shift amount from byte offset -#define SIM_CHECKS_ALIGNMENT	1	/* set to 1 when running on ISS (simulator) with the -					   lint or ferret client, or 0 to save a few cycles */ + +/* set to 1 when running on ISS (simulator) with the +   lint or ferret client, or 0 to save a few cycles */ +#define SIM_CHECKS_ALIGNMENT	1  #if XCHAL_UNALIGNED_LOAD_EXCEPTION || SIM_CHECKS_ALIGNMENT  	and	a11, a3, a8	# save unalignment offset for below  	sub	a3, a3, a11	# align a3 diff --git a/arch/xtensa/lib/pci-auto.c b/arch/xtensa/lib/pci-auto.c index a71733ae119..34d05abbd92 100644 --- a/arch/xtensa/lib/pci-auto.c +++ b/arch/xtensa/lib/pci-auto.c @@ -241,8 +241,8 @@ int __init pciauto_bus_scan(struct pci_controller *pci_ctrl, int current_bus)  	unsigned char header_type;  	struct pci_dev *dev = &pciauto_dev; -        pciauto_dev.bus = &pciauto_bus; -        pciauto_dev.sysdata = pci_ctrl; +	pciauto_dev.bus = &pciauto_bus; +	pciauto_dev.sysdata = pci_ctrl;  	pciauto_bus.ops = pci_ctrl->ops;  	/* @@ -345,8 +345,3 @@ int __init pciauto_bus_scan(struct pci_controller *pci_ctrl, int current_bus)  	}  	return sub_bus;  } - - - - - diff --git a/arch/xtensa/lib/strncpy_user.S b/arch/xtensa/lib/strncpy_user.S index 9f603cdaaa6..1ad0ecf4536 100644 --- a/arch/xtensa/lib/strncpy_user.S +++ b/arch/xtensa/lib/strncpy_user.S @@ -166,7 +166,7 @@ __strncpy_user:  	retw  .Lz1:	# byte 1 is zero  #ifdef __XTENSA_EB__ -        extui   a9, a9, 16, 16 +	extui   a9, a9, 16, 16  #endif /* __XTENSA_EB__ */  	EX(s16i, a9, a11, 0, fixup_s)  	addi	a11, a11, 1		# advance dst pointer @@ -174,7 +174,7 @@ __strncpy_user:  	retw  .Lz2:	# byte 2 is zero  #ifdef __XTENSA_EB__ -        extui   a9, a9, 16, 16 +	extui   a9, a9, 16, 16  #endif /* __XTENSA_EB__ */  	EX(s16i, a9, a11, 0, fixup_s)  	movi	a9, 0 diff --git a/arch/xtensa/lib/strnlen_user.S b/arch/xtensa/lib/strnlen_user.S index 23f2a89816a..4c03b1e581e 100644 --- a/arch/xtensa/lib/strnlen_user.S +++ b/arch/xtensa/lib/strnlen_user.S @@ -145,4 +145,3 @@ __strnlen_user:  lenfixup:  	movi	a2, 0  	retw - diff --git a/arch/xtensa/lib/usercopy.S b/arch/xtensa/lib/usercopy.S index 46d60314bb1..ace1892a875 100644 --- a/arch/xtensa/lib/usercopy.S +++ b/arch/xtensa/lib/usercopy.S @@ -318,4 +318,3 @@ l_fixup:  	/* Ignore memset return value in a6. */  	/* a2 still contains bytes not copied. */  	retw - diff --git a/arch/xtensa/mm/cache.c b/arch/xtensa/mm/cache.c index 85df4655d32..81edeab82d1 100644 --- a/arch/xtensa/mm/cache.c +++ b/arch/xtensa/mm/cache.c @@ -118,7 +118,7 @@ void flush_dcache_page(struct page *page)   * For now, flush the whole cache. FIXME??   */ -void flush_cache_range(struct vm_area_struct* vma,  +void flush_cache_range(struct vm_area_struct* vma,  		       unsigned long start, unsigned long end)  {  	__flush_invalidate_dcache_all(); @@ -133,7 +133,7 @@ void flush_cache_range(struct vm_area_struct* vma,   */  void flush_cache_page(struct vm_area_struct* vma, unsigned long address, -    		      unsigned long pfn) +		      unsigned long pfn)  {  	/* Note that we have to use the 'alias' address to avoid multi-hit */ @@ -166,14 +166,14 @@ update_mmu_cache(struct vm_area_struct * vma, unsigned long addr, pte_t *ptep)  	if (!PageReserved(page) && test_bit(PG_arch_1, &page->flags)) { -		unsigned long vaddr = TLBTEMP_BASE_1 + (addr & DCACHE_ALIAS_MASK);  		unsigned long paddr = (unsigned long) page_address(page);  		unsigned long phys = page_to_phys(page); +		unsigned long tmp = TLBTEMP_BASE_1 + (addr & DCACHE_ALIAS_MASK);  		__flush_invalidate_dcache_page(paddr); -		__flush_invalidate_dcache_page_alias(vaddr, phys); -		__invalidate_icache_page_alias(vaddr, phys); +		__flush_invalidate_dcache_page_alias(tmp, phys); +		__invalidate_icache_page_alias(tmp, phys);  		clear_bit(PG_arch_1, &page->flags);  	} @@ -195,7 +195,7 @@ update_mmu_cache(struct vm_area_struct * vma, unsigned long addr, pte_t *ptep)  #if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK -void copy_to_user_page(struct vm_area_struct *vma, struct page *page,  +void copy_to_user_page(struct vm_area_struct *vma, struct page *page,  		unsigned long vaddr, void *dst, const void *src,  		unsigned long len)  { @@ -205,8 +205,8 @@ void copy_to_user_page(struct vm_area_struct *vma, struct page *page,  	/* Flush and invalidate user page if aliased. */  	if (alias) { -		unsigned long temp = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK); -		__flush_invalidate_dcache_page_alias(temp, phys); +		unsigned long t = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK); +		__flush_invalidate_dcache_page_alias(t, phys);  	}  	/* Copy data */ @@ -219,12 +219,11 @@ void copy_to_user_page(struct vm_area_struct *vma, struct page *page,  	 */  	if (alias) { -		unsigned long temp = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK); +		unsigned long t = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK);  		__flush_invalidate_dcache_range((unsigned long) dst, len); -		if ((vma->vm_flags & VM_EXEC) != 0) { -			__invalidate_icache_page_alias(temp, phys); -		} +		if ((vma->vm_flags & VM_EXEC) != 0) +			__invalidate_icache_page_alias(t, phys);  	} else if ((vma->vm_flags & VM_EXEC) != 0) {  		__flush_dcache_range((unsigned long)dst,len); @@ -245,8 +244,8 @@ extern void copy_from_user_page(struct vm_area_struct *vma, struct page *page,  	 */  	if (alias) { -		unsigned long temp = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK); -		__flush_invalidate_dcache_page_alias(temp, phys); +		unsigned long t = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK); +		__flush_invalidate_dcache_page_alias(t, phys);  	}  	memcpy(dst, src, len); diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c index 245b08f7eaf..4b7bc8db170 100644 --- a/arch/xtensa/mm/fault.c +++ b/arch/xtensa/mm/fault.c @@ -254,4 +254,3 @@ bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)  	die("Oops", regs, sig);  	do_exit(sig);  } - diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c index db955179da2..7a5156ffebb 100644 --- a/arch/xtensa/mm/init.c +++ b/arch/xtensa/mm/init.c @@ -75,15 +75,15 @@ int __init mem_reserve(unsigned long start, unsigned long end, int must_exist)  			sysmem.nr_banks++;  		}  		sysmem.bank[i].end = start; + +	} else if (end < sysmem.bank[i].end) { +		sysmem.bank[i].start = end; +  	} else { -		if (end < sysmem.bank[i].end) -			sysmem.bank[i].start = end; -		else { -			/* remove entry */ -			sysmem.nr_banks--; -			sysmem.bank[i].start = sysmem.bank[sysmem.nr_banks].start; -			sysmem.bank[i].end   = sysmem.bank[sysmem.nr_banks].end; -		} +		/* remove entry */ +		sysmem.nr_banks--; +		sysmem.bank[i].start = sysmem.bank[sysmem.nr_banks].start; +		sysmem.bank[i].end   = sysmem.bank[sysmem.nr_banks].end;  	}  	return -1;  } diff --git a/arch/xtensa/mm/misc.S b/arch/xtensa/mm/misc.S index b048406d875..d97ed1ba7b0 100644 --- a/arch/xtensa/mm/misc.S +++ b/arch/xtensa/mm/misc.S @@ -29,6 +29,7 @@   */  ENTRY(clear_page) +  	entry	a1, 16  	movi	a3, 0 @@ -45,6 +46,8 @@ ENTRY(clear_page)  	retw +ENDPROC(clear_page) +  /*   * copy_page and copy_user_page are the same for non-cache-aliased configs.   * @@ -53,6 +56,7 @@ ENTRY(clear_page)   */  ENTRY(copy_page) +  	entry	a1, 16  	__loopi a2, a4, PAGE_SIZE, 32 @@ -84,6 +88,8 @@ ENTRY(copy_page)  	retw +ENDPROC(copy_page) +  #ifdef CONFIG_MMU  /*   * If we have to deal with cache aliasing, we use temporary memory mappings @@ -109,6 +115,7 @@ ENTRY(__tlbtemp_mapping_start)   */  ENTRY(clear_user_page) +  	entry	a1, 32  	/* Mark page dirty and determine alias. */ @@ -164,6 +171,8 @@ ENTRY(clear_user_page)  	retw +ENDPROC(clear_user_page) +  /*   * copy_page_user (void *to, void *from, unsigned long vaddr, struct page *page)   *                    a2          a3	        a4		    a5 @@ -171,7 +180,7 @@ ENTRY(clear_user_page)  ENTRY(copy_user_page) -	entry	a1, 32  +	entry	a1, 32  	/* Mark page dirty and determine alias for destination. */ @@ -262,6 +271,8 @@ ENTRY(copy_user_page)  	retw +ENDPROC(copy_user_page) +  #endif  #if (DCACHE_WAY_SIZE > PAGE_SIZE) @@ -272,6 +283,7 @@ ENTRY(copy_user_page)   */  ENTRY(__flush_invalidate_dcache_page_alias) +  	entry	sp, 16  	movi	a7, 0			# required for exception handler @@ -287,6 +299,7 @@ ENTRY(__flush_invalidate_dcache_page_alias)  	retw +ENDPROC(__flush_invalidate_dcache_page_alias)  #endif  ENTRY(__tlbtemp_mapping_itlb) @@ -294,6 +307,7 @@ ENTRY(__tlbtemp_mapping_itlb)  #if (ICACHE_WAY_SIZE > PAGE_SIZE)  ENTRY(__invalidate_icache_page_alias) +  	entry	sp, 16  	addi	a6, a3, (PAGE_KERNEL_EXEC | _PAGE_HW_WRITE) @@ -307,11 +321,14 @@ ENTRY(__invalidate_icache_page_alias)  	isync  	retw +ENDPROC(__invalidate_icache_page_alias) +  #endif  /* End of special treatment in tlb miss exception */  ENTRY(__tlbtemp_mapping_end) +  #endif /* CONFIG_MMU  /* @@ -319,6 +336,7 @@ ENTRY(__tlbtemp_mapping_end)   */  ENTRY(__invalidate_icache_page) +  	entry	sp, 16  	___invalidate_icache_page a2 a3 @@ -326,11 +344,14 @@ ENTRY(__invalidate_icache_page)  	retw +ENDPROC(__invalidate_icache_page) +  /*   * void __invalidate_dcache_page(ulong start)   */  ENTRY(__invalidate_dcache_page) +  	entry	sp, 16  	___invalidate_dcache_page a2 a3 @@ -338,11 +359,14 @@ ENTRY(__invalidate_dcache_page)  	retw +ENDPROC(__invalidate_dcache_page) +  /*   * void __flush_invalidate_dcache_page(ulong start)   */  ENTRY(__flush_invalidate_dcache_page) +  	entry	sp, 16  	___flush_invalidate_dcache_page a2 a3 @@ -350,11 +374,14 @@ ENTRY(__flush_invalidate_dcache_page)  	dsync  	retw +ENDPROC(__flush_invalidate_dcache_page) +  /*   * void __flush_dcache_page(ulong start)   */  ENTRY(__flush_dcache_page) +  	entry	sp, 16  	___flush_dcache_page a2 a3 @@ -362,11 +389,14 @@ ENTRY(__flush_dcache_page)  	dsync  	retw +ENDPROC(__flush_dcache_page) +  /*   * void __invalidate_icache_range(ulong start, ulong size)   */  ENTRY(__invalidate_icache_range) +  	entry	sp, 16  	___invalidate_icache_range a2 a3 a4 @@ -374,11 +404,14 @@ ENTRY(__invalidate_icache_range)  	retw +ENDPROC(__invalidate_icache_range) +  /*   * void __flush_invalidate_dcache_range(ulong start, ulong size)   */  ENTRY(__flush_invalidate_dcache_range) +  	entry	sp, 16  	___flush_invalidate_dcache_range a2 a3 a4 @@ -386,11 +419,14 @@ ENTRY(__flush_invalidate_dcache_range)  	retw +ENDPROC(__flush_invalidate_dcache_range) +  /*   * void _flush_dcache_range(ulong start, ulong size)   */  ENTRY(__flush_dcache_range) +  	entry	sp, 16  	___flush_dcache_range a2 a3 a4 @@ -398,22 +434,28 @@ ENTRY(__flush_dcache_range)  	retw +ENDPROC(__flush_dcache_range) +  /*   * void _invalidate_dcache_range(ulong start, ulong size)   */  ENTRY(__invalidate_dcache_range) +  	entry	sp, 16  	___invalidate_dcache_range a2 a3 a4  	retw +ENDPROC(__invalidate_dcache_range) +  /*   * void _invalidate_icache_all(void)   */  ENTRY(__invalidate_icache_all) +  	entry	sp, 16  	___invalidate_icache_all a2 a3 @@ -421,11 +463,14 @@ ENTRY(__invalidate_icache_all)  	retw +ENDPROC(__invalidate_icache_all) +  /*   * void _flush_invalidate_dcache_all(void)   */  ENTRY(__flush_invalidate_dcache_all) +  	entry	sp, 16  	___flush_invalidate_dcache_all a2 a3 @@ -433,11 +478,14 @@ ENTRY(__flush_invalidate_dcache_all)  	retw +ENDPROC(__flush_invalidate_dcache_all) +  /*   * void _invalidate_dcache_all(void)   */  ENTRY(__invalidate_dcache_all) +  	entry	sp, 16  	___invalidate_dcache_all a2 a3 @@ -445,3 +493,4 @@ ENTRY(__invalidate_dcache_all)  	retw +ENDPROC(__invalidate_dcache_all) diff --git a/arch/xtensa/mm/mmu.c b/arch/xtensa/mm/mmu.c index ca81654f3ec..0f77f9d3bb8 100644 --- a/arch/xtensa/mm/mmu.c +++ b/arch/xtensa/mm/mmu.c @@ -37,7 +37,7 @@ void __init init_mmu(void)  	/* Set rasid register to a known value. */ -	set_rasid_register(ASID_USER_FIRST); +	set_rasid_register(ASID_INSERT(ASID_USER_FIRST));  	/* Set PTEVADDR special register to the start of the page  	 * table, which is in kernel mappable space (ie. not diff --git a/arch/xtensa/mm/tlb.c b/arch/xtensa/mm/tlb.c index e2700b21395..5411aa67c68 100644 --- a/arch/xtensa/mm/tlb.c +++ b/arch/xtensa/mm/tlb.c @@ -63,7 +63,7 @@ void flush_tlb_all (void)  void flush_tlb_mm(struct mm_struct *mm)  {  	if (mm == current->active_mm) { -		int flags; +		unsigned long flags;  		local_save_flags(flags);  		__get_new_mmu_context(mm);  		__load_mmu_context(mm); @@ -82,7 +82,7 @@ void flush_tlb_mm(struct mm_struct *mm)  #endif  void flush_tlb_range (struct vm_area_struct *vma, -    		      unsigned long start, unsigned long end) +		      unsigned long start, unsigned long end)  {  	struct mm_struct *mm = vma->vm_mm;  	unsigned long flags; @@ -100,7 +100,7 @@ void flush_tlb_range (struct vm_area_struct *vma,  		int oldpid = get_rasid_register();  		set_rasid_register (ASID_INSERT(mm->context));  		start &= PAGE_MASK; - 		if (vma->vm_flags & VM_EXEC) +		if (vma->vm_flags & VM_EXEC)  			while(start < end) {  				invalidate_itlb_mapping(start);  				invalidate_dtlb_mapping(start); @@ -130,7 +130,7 @@ void flush_tlb_page (struct vm_area_struct *vma, unsigned long page)  	local_save_flags(flags); -       	oldpid = get_rasid_register(); +	oldpid = get_rasid_register();  	if (vma->vm_flags & VM_EXEC)  		invalidate_itlb_mapping(page); @@ -140,4 +140,3 @@ void flush_tlb_page (struct vm_area_struct *vma, unsigned long page)  	local_irq_restore(flags);  } - diff --git a/arch/xtensa/platforms/iss/include/platform/serial.h b/arch/xtensa/platforms/iss/include/platform/serial.h index e69de29bb2d..16aec542d43 100644 --- a/arch/xtensa/platforms/iss/include/platform/serial.h +++ b/arch/xtensa/platforms/iss/include/platform/serial.h @@ -0,0 +1,15 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License.  See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2012 Tensilica Inc. + */ + +#ifndef __ASM_XTENSA_ISS_SERIAL_H +#define __ASM_XTENSA_ISS_SERIAL_H + +/* Have no meaning on ISS, but needed for 8250_early.c */ +#define BASE_BAUD 0 + +#endif /* __ASM_XTENSA_ISS_SERIAL_H */ diff --git a/arch/xtensa/platforms/iss/include/platform/simcall.h b/arch/xtensa/platforms/iss/include/platform/simcall.h index bd78192e2fc..b5a4edf02d7 100644 --- a/arch/xtensa/platforms/iss/include/platform/simcall.h +++ b/arch/xtensa/platforms/iss/include/platform/simcall.h @@ -74,13 +74,12 @@ static inline int __simc(int a, int b, int c, int d, int e, int f)  			"mov %1, a3\n"  			: "=a" (ret), "=a" (errno), "+r"(a1), "+r"(b1)  			: "r"(c1), "r"(d1), "r"(e1), "r"(f1) -			: ); +			: "memory");  	return ret;  }  static inline int simc_open(const char *file, int flags, int mode)  { -	wmb();  	return __simc(SYS_open, (int) file, flags, mode, 0, 0);  } @@ -91,19 +90,16 @@ static inline int simc_close(int fd)  static inline int simc_ioctl(int fd, int request, void *arg)  { -	wmb();  	return __simc(SYS_ioctl, fd, request, (int) arg, 0, 0);  }  static inline int simc_read(int fd, void *buf, size_t count)  { -	rmb();  	return __simc(SYS_read, fd, (int) buf, count, 0, 0);  }  static inline int simc_write(int fd, const void *buf, size_t count)  { -	wmb();  	return __simc(SYS_write, fd, (int) buf, count, 0, 0);  } @@ -111,7 +107,6 @@ static inline int simc_poll(int fd)  {  	struct timeval tv = { .tv_sec = 0, .tv_usec = 0 }; -	wmb();  	return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&tv,  			0, 0);  } diff --git a/arch/xtensa/platforms/xtfpga/Makefile b/arch/xtensa/platforms/xtfpga/Makefile new file mode 100644 index 00000000000..b9ae206340c --- /dev/null +++ b/arch/xtensa/platforms/xtfpga/Makefile @@ -0,0 +1,9 @@ +# Makefile for the Tensilica xtavnet Emulation Board +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# +# Note 2! The CFLAGS definitions are in the main makefile... + +obj-y			= setup.o lcd.o diff --git a/arch/xtensa/platforms/xtfpga/include/platform/hardware.h b/arch/xtensa/platforms/xtfpga/include/platform/hardware.h new file mode 100644 index 00000000000..4416773cbde --- /dev/null +++ b/arch/xtensa/platforms/xtfpga/include/platform/hardware.h @@ -0,0 +1,69 @@ +/* + * arch/xtensa/platform/xtavnet/include/platform/hardware.h + * + * This file is subject to the terms and conditions of the GNU General Public + * License.  See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2006 Tensilica Inc. + */ + +/* + * This file contains the hardware configuration of the XTAVNET boards. + */ + +#ifndef __XTENSA_XTAVNET_HARDWARE_H +#define __XTENSA_XTAVNET_HARDWARE_H + +/* By default NO_IRQ is defined to 0 in Linux, but we use the +   interrupt 0 for UART... */ +#define NO_IRQ                 -1 + +/* Memory configuration. */ + +#define PLATFORM_DEFAULT_MEM_START 0x00000000 +#define PLATFORM_DEFAULT_MEM_SIZE  0x04000000 + +/* Interrupt configuration. */ + +#define PLATFORM_NR_IRQS	10 + +/* Default assignment of LX60 devices to external interrupts. */ + +#ifdef CONFIG_ARCH_HAS_SMP +#define DUART16552_INTNUM	XCHAL_EXTINT3_NUM +#define OETH_IRQ		XCHAL_EXTINT4_NUM +#else +#define DUART16552_INTNUM	XCHAL_EXTINT0_NUM +#define OETH_IRQ		XCHAL_EXTINT1_NUM +#endif + +/* + *  Device addresses and parameters. + */ + +/* UART */ +#define DUART16552_PADDR	(XCHAL_KIO_PADDR + 0x0D050020) +/* LCD instruction and data addresses. */ +#define LCD_INSTR_ADDR		((char *)IOADDR(0x0D040000)) +#define LCD_DATA_ADDR		((char *)IOADDR(0x0D040004)) + +/* Misc. */ +#define XTFPGA_FPGAREGS_VADDR	IOADDR(0x0D020000) +/* Clock frequency in Hz (read-only):  */ +#define XTFPGA_CLKFRQ_VADDR	(XTFPGA_FPGAREGS_VADDR + 0x04) +/* Setting of 8 DIP switches:  */ +#define DIP_SWITCHES_VADDR	(XTFPGA_FPGAREGS_VADDR + 0x0C) +/* Software reset (write 0xdead):  */ +#define XTFPGA_SWRST_VADDR	(XTFPGA_FPGAREGS_VADDR + 0x10) + +/*  OpenCores Ethernet controller:  */ +				/* regs + RX/TX descriptors */ +#define OETH_REGS_PADDR		(XCHAL_KIO_PADDR + 0x0D030000) +#define OETH_REGS_SIZE		0x1000 +#define OETH_SRAMBUFF_PADDR	(XCHAL_KIO_PADDR + 0x0D800000) + +				/* 5*rx buffs + 5*tx buffs */ +#define OETH_SRAMBUFF_SIZE	(5 * 0x600 + 5 * 0x600) + +#endif /* __XTENSA_XTAVNET_HARDWARE_H */ diff --git a/arch/xtensa/platforms/xtfpga/include/platform/lcd.h b/arch/xtensa/platforms/xtfpga/include/platform/lcd.h new file mode 100644 index 00000000000..0e435645af5 --- /dev/null +++ b/arch/xtensa/platforms/xtfpga/include/platform/lcd.h @@ -0,0 +1,20 @@ +/* + * arch/xtensa/platform/xtavnet/include/platform/lcd.h + * + * This file is subject to the terms and conditions of the GNU General Public + * License.  See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001, 2006 Tensilica Inc. + */ + +#ifndef __XTENSA_XTAVNET_LCD_H +#define __XTENSA_XTAVNET_LCD_H + +/* Display string STR at position POS on the LCD. */ +void lcd_disp_at_pos(char *str, unsigned char pos); + +/* Shift the contents of the LCD display left or right. */ +void lcd_shiftleft(void); +void lcd_shiftright(void); +#endif diff --git a/arch/xtensa/platforms/xtfpga/include/platform/serial.h b/arch/xtensa/platforms/xtfpga/include/platform/serial.h new file mode 100644 index 00000000000..14d8f7beebf --- /dev/null +++ b/arch/xtensa/platforms/xtfpga/include/platform/serial.h @@ -0,0 +1,18 @@ +/* + * arch/xtensa/platform/xtavnet/include/platform/serial.h + * + * This file is subject to the terms and conditions of the GNU General Public + * License.  See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001, 2006 Tensilica Inc. + */ + +#ifndef __ASM_XTENSA_XTAVNET_SERIAL_H +#define __ASM_XTENSA_XTAVNET_SERIAL_H + +#include <platform/hardware.h> + +#define BASE_BAUD (*(long *)XTFPGA_CLKFRQ_VADDR / 16) + +#endif /* __ASM_XTENSA_XTAVNET_SERIAL_H */ diff --git a/arch/xtensa/platforms/xtfpga/lcd.c b/arch/xtensa/platforms/xtfpga/lcd.c new file mode 100644 index 00000000000..2872301598d --- /dev/null +++ b/arch/xtensa/platforms/xtfpga/lcd.c @@ -0,0 +1,76 @@ +/* + * Driver for the LCD display on the Tensilica LX60 Board. + * + * This file is subject to the terms and conditions of the GNU General Public + * License.  See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2001, 2006 Tensilica Inc. + */ + +/* + * + * FIXME: this code is from the examples from the LX60 user guide. + * + * The lcd_pause function does busy waiting, which is probably not + * great. Maybe the code could be changed to use kernel timers, or + * change the hardware to not need to wait. + */ + +#include <linux/init.h> +#include <linux/io.h> + +#include <platform/hardware.h> +#include <platform/lcd.h> +#include <linux/delay.h> + +#define LCD_PAUSE_ITERATIONS	4000 +#define LCD_CLEAR		0x1 +#define LCD_DISPLAY_ON		0xc + +/* 8bit and 2 lines display */ +#define LCD_DISPLAY_MODE8BIT	0x38 +#define LCD_DISPLAY_POS		0x80 +#define LCD_SHIFT_LEFT		0x18 +#define LCD_SHIFT_RIGHT		0x1c + +static int __init lcd_init(void) +{ +	*LCD_INSTR_ADDR = LCD_DISPLAY_MODE8BIT; +	mdelay(5); +	*LCD_INSTR_ADDR = LCD_DISPLAY_MODE8BIT; +	udelay(200); +	*LCD_INSTR_ADDR = LCD_DISPLAY_MODE8BIT; +	udelay(50); +	*LCD_INSTR_ADDR = LCD_DISPLAY_ON; +	udelay(50); +	*LCD_INSTR_ADDR = LCD_CLEAR; +	mdelay(10); +	lcd_disp_at_pos("XTENSA LINUX", 0); +	return 0; +} + +void lcd_disp_at_pos(char *str, unsigned char pos) +{ +	*LCD_INSTR_ADDR = LCD_DISPLAY_POS | pos; +	udelay(100); +	while (*str != 0) { +		*LCD_DATA_ADDR = *str; +		udelay(200); +		str++; +	} +} + +void lcd_shiftleft(void) +{ +	*LCD_INSTR_ADDR = LCD_SHIFT_LEFT; +	udelay(50); +} + +void lcd_shiftright(void) +{ +	*LCD_INSTR_ADDR = LCD_SHIFT_RIGHT; +	udelay(50); +} + +arch_initcall(lcd_init); diff --git a/arch/xtensa/platforms/xtfpga/setup.c b/arch/xtensa/platforms/xtfpga/setup.c new file mode 100644 index 00000000000..4b9951a4569 --- /dev/null +++ b/arch/xtensa/platforms/xtfpga/setup.c @@ -0,0 +1,301 @@ +/* + * + * arch/xtensa/platform/xtavnet/setup.c + * + * ... + * + * Authors:	Chris Zankel <chris@zankel.net> + *		Joe Taylor <joe@tensilica.com> + * + * Copyright 2001 - 2006 Tensilica Inc. + * + * This program is free software; you can redistribute  it and/or modify it + * under  the terms of  the GNU General  Public License as published by the + * Free Software Foundation;  either version 2 of the  License, or (at your + * option) any later version. + * + */ +#include <linux/stddef.h> +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/errno.h> +#include <linux/reboot.h> +#include <linux/kdev_t.h> +#include <linux/types.h> +#include <linux/major.h> +#include <linux/console.h> +#include <linux/delay.h> +#include <linux/of.h> + +#include <asm/timex.h> +#include <asm/processor.h> +#include <asm/platform.h> +#include <asm/bootparam.h> +#include <platform/lcd.h> +#include <platform/hardware.h> + +void platform_halt(void) +{ +	lcd_disp_at_pos(" HALT ", 0); +	local_irq_disable(); +	while (1) +		cpu_relax(); +} + +void platform_power_off(void) +{ +	lcd_disp_at_pos("POWEROFF", 0); +	local_irq_disable(); +	while (1) +		cpu_relax(); +} + +void platform_restart(void) +{ +	/* Flush and reset the mmu, simulate a processor reset, and +	 * jump to the reset vector. */ + + +	__asm__ __volatile__ ("movi	a2, 15\n\t" +			      "wsr	a2, icountlevel\n\t" +			      "movi	a2, 0\n\t" +			      "wsr	a2, icount\n\t" +			      "wsr	a2, ibreakenable\n\t" +			      "wsr	a2, lcount\n\t" +			      "movi	a2, 0x1f\n\t" +			      "wsr	a2, ps\n\t" +			      "isync\n\t" +			      "jx	%0\n\t" +			      : +			      : "a" (XCHAL_RESET_VECTOR_VADDR) +			      : "a2" +			      ); + +	/* control never gets here */ +} + +void __init platform_setup(char **cmdline) +{ +} + +#ifdef CONFIG_OF + +static void __init update_clock_frequency(struct device_node *node) +{ +	struct property *newfreq; +	u32 freq; + +	if (!of_property_read_u32(node, "clock-frequency", &freq) && freq != 0) +		return; + +	newfreq = kzalloc(sizeof(*newfreq) + sizeof(u32), GFP_KERNEL); +	if (!newfreq) +		return; +	newfreq->value = newfreq + 1; +	newfreq->length = sizeof(freq); +	newfreq->name = kstrdup("clock-frequency", GFP_KERNEL); +	if (!newfreq->name) { +		kfree(newfreq); +		return; +	} + +	*(u32 *)newfreq->value = cpu_to_be32(*(u32 *)XTFPGA_CLKFRQ_VADDR); +	prom_update_property(node, newfreq); +} + +#define MAC_LEN 6 +static void __init update_local_mac(struct device_node *node) +{ +	struct property *newmac; +	const u8* macaddr; +	int prop_len; + +	macaddr = of_get_property(node, "local-mac-address", &prop_len); +	if (macaddr == NULL || prop_len != MAC_LEN) +		return; + +	newmac = kzalloc(sizeof(*newmac) + MAC_LEN, GFP_KERNEL); +	if (newmac == NULL) +		return; + +	newmac->value = newmac + 1; +	newmac->length = MAC_LEN; +	newmac->name = kstrdup("local-mac-address", GFP_KERNEL); +	if (newmac->name == NULL) { +		kfree(newmac); +		return; +	} + +	memcpy(newmac->value, macaddr, MAC_LEN); +	((u8*)newmac->value)[5] = (*(u32*)DIP_SWITCHES_VADDR) & 0x3f; +	prom_update_property(node, newmac); +} + +static int __init machine_setup(void) +{ +	struct device_node *serial; +	struct device_node *eth = NULL; + +	for_each_compatible_node(serial, NULL, "ns16550a") +		update_clock_frequency(serial); + +	if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc"))) +		update_local_mac(eth); +	return 0; +} +arch_initcall(machine_setup); + +#endif + +/* early initialization */ + +void __init platform_init(bp_tag_t *first) +{ +} + +/* Heartbeat. */ + +void platform_heartbeat(void) +{ +} + +#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT + +void platform_calibrate_ccount(void) +{ +	long clk_freq = 0; +#ifdef CONFIG_OF +	struct device_node *cpu = +		of_find_compatible_node(NULL, NULL, "xtensa,cpu"); +	if (cpu) { +		u32 freq; +		update_clock_frequency(cpu); +		if (!of_property_read_u32(cpu, "clock-frequency", &freq)) +			clk_freq = freq; +	} +#endif +	if (!clk_freq) +		clk_freq = *(long *)XTFPGA_CLKFRQ_VADDR; + +	ccount_per_jiffy = clk_freq / HZ; +	nsec_per_ccount = 1000000000UL / clk_freq; +} + +#endif + +#ifndef CONFIG_OF + +#include <linux/serial_8250.h> +#include <linux/if.h> +#include <net/ethoc.h> + +/*---------------------------------------------------------------------------- + *  Ethernet -- OpenCores Ethernet MAC (ethoc driver) + */ + +static struct resource ethoc_res[] __initdata = { +	[0] = { /* register space */ +		.start = OETH_REGS_PADDR, +		.end   = OETH_REGS_PADDR + OETH_REGS_SIZE - 1, +		.flags = IORESOURCE_MEM, +	}, +	[1] = { /* buffer space */ +		.start = OETH_SRAMBUFF_PADDR, +		.end   = OETH_SRAMBUFF_PADDR + OETH_SRAMBUFF_SIZE - 1, +		.flags = IORESOURCE_MEM, +	}, +	[2] = { /* IRQ number */ +		.start = OETH_IRQ, +		.end   = OETH_IRQ, +		.flags = IORESOURCE_IRQ, +	}, +}; + +static struct ethoc_platform_data ethoc_pdata __initdata = { +	/* +	 * The MAC address for these boards is 00:50:c2:13:6f:xx. +	 * The last byte (here as zero) is read from the DIP switches on the +	 * board. +	 */ +	.hwaddr = { 0x00, 0x50, 0xc2, 0x13, 0x6f, 0 }, +	.phy_id = -1, +}; + +static struct platform_device ethoc_device __initdata = { +	.name = "ethoc", +	.id = -1, +	.num_resources = ARRAY_SIZE(ethoc_res), +	.resource = ethoc_res, +	.dev = { +		.platform_data = ðoc_pdata, +	}, +}; + +/*---------------------------------------------------------------------------- + *  UART + */ + +static struct resource serial_resource __initdata = { +	.start	= DUART16552_PADDR, +	.end	= DUART16552_PADDR + 0x1f, +	.flags	= IORESOURCE_MEM, +}; + +static struct plat_serial8250_port serial_platform_data[] __initdata = { +	[0] = { +		.mapbase	= DUART16552_PADDR, +		.irq		= DUART16552_INTNUM, +		.flags		= UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | +				  UPF_IOREMAP, +		.iotype		= UPIO_MEM32, +		.regshift	= 2, +		.uartclk	= 0,    /* set in xtavnet_init() */ +	}, +	{ }, +}; + +static struct platform_device xtavnet_uart __initdata = { +	.name		= "serial8250", +	.id		= PLAT8250_DEV_PLATFORM, +	.dev		= { +		.platform_data	= serial_platform_data, +	}, +	.num_resources	= 1, +	.resource	= &serial_resource, +}; + +/* platform devices */ +static struct platform_device *platform_devices[] __initdata = { +	ðoc_device, +	&xtavnet_uart, +}; + + +static int __init xtavnet_init(void) +{ +	/* Ethernet MAC address.  */ +	ethoc_pdata.hwaddr[5] = *(u32 *)DIP_SWITCHES_VADDR; + +	/* Clock rate varies among FPGA bitstreams; board specific FPGA register +	 * reports the actual clock rate. +	 */ +	serial_platform_data[0].uartclk = *(long *)XTFPGA_CLKFRQ_VADDR; + + +	/* register platform devices */ +	platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); + +	/* ETHOC driver is a bit quiet; at least display Ethernet MAC, so user +	 * knows whether they set it correctly on the DIP switches. +	 */ +	pr_info("XTFPGA: Ethernet MAC %pM\n", ethoc_pdata.hwaddr); + +	return 0; +} + +/* + * Register to be done during do_initcalls(). + */ +arch_initcall(xtavnet_init); + +#endif /* CONFIG_OF */ diff --git a/arch/xtensa/variants/s6000/gpio.c b/arch/xtensa/variants/s6000/gpio.c index b89541ba39a..da9e85c13b0 100644 --- a/arch/xtensa/variants/s6000/gpio.c +++ b/arch/xtensa/variants/s6000/gpio.c @@ -164,7 +164,7 @@ static void demux_irqs(unsigned int irq, struct irq_desc *desc)  	int cirq;  	chip->irq_mask(&desc->irq_data); -	chip->irq_ack(&desc->irq_data)); +	chip->irq_ack(&desc->irq_data);  	pending = readb(S6_REG_GPIO + S6_GPIO_BANK(0) + S6_GPIO_MIS) & *mask;  	cirq = IRQ_BASE - 1;  	while (pending) { @@ -173,7 +173,7 @@ static void demux_irqs(unsigned int irq, struct irq_desc *desc)  		pending >>= n;  		generic_handle_irq(cirq);  	} -	chip->irq_unmask(&desc->irq_data)); +	chip->irq_unmask(&desc->irq_data);  }  extern const signed char *platform_irq_mappings[XTENSA_NR_IRQS];  |