From 4877b60cdf3f32281af0a241c7514167e1a0cd01 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Thu, 13 Mar 2014 21:27:12 +0800 Subject: arch/unicore32/kernel/ksyms.c: remove several undefined exported symbols For 'csum_partial_copy_nocheck()', it has default definition in 'asm-generic'. For '__raw_reads?()' and '__raw_writes?()' are used by the drivers which no relationship with allmodconfig for unicode32, the related modules are: drivers/mmc/host/omap.c drivers/mtd/nand/atmel_nand.c drivers/mtd/nand/pxa3xx_nand.c drivers/usb/gadget/at91_udc.c Others are only within some architectures (not kernel wide). The related error with allmodconfig for unicode32: CC arch/unicore32/kernel/ksyms.o arch/unicore32/kernel/ksyms.c:29: error: ._backtrace. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:29: error: type defaults to .nt. in declaration of ._backtrace. arch/unicore32/kernel/ksyms.c:38: error: .sum_partial_copy_nocheck. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:38: error: type defaults to .nt. in declaration of .sum_partial_copy_nocheck. arch/unicore32/kernel/ksyms.c:39: error: ._csum_ipv6_magic. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:39: error: type defaults to .nt. in declaration of ._csum_ipv6_magic. arch/unicore32/kernel/ksyms.c:43: error: ._raw_readsb. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:43: error: type defaults to .nt. in declaration of ._raw_readsb. arch/unicore32/kernel/ksyms.c:46: error: ._raw_readsw. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:46: error: type defaults to .nt. in declaration of ._raw_readsw. arch/unicore32/kernel/ksyms.c:49: error: ._raw_readsl. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:49: error: type defaults to .nt. in declaration of ._raw_readsl. arch/unicore32/kernel/ksyms.c:52: error: ._raw_writesb. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:52: error: type defaults to .nt. in declaration of ._raw_writesb. arch/unicore32/kernel/ksyms.c:55: error: ._raw_writesw. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:55: error: type defaults to .nt. in declaration of ._raw_writesw. arch/unicore32/kernel/ksyms.c:58: error: ._raw_writesl. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:58: error: type defaults to .nt. in declaration of ._raw_writesl. arch/unicore32/kernel/ksyms.c:79: error: ._get_user_1. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:79: error: type defaults to .nt. in declaration of ._get_user_1. arch/unicore32/kernel/ksyms.c:80: error: ._get_user_2. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:80: error: type defaults to .nt. in declaration of ._get_user_2. arch/unicore32/kernel/ksyms.c:81: error: ._get_user_4. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:81: error: type defaults to .nt. in declaration of ._get_user_4. arch/unicore32/kernel/ksyms.c:83: error: ._put_user_1. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:83: error: type defaults to .nt. in declaration of ._put_user_1. arch/unicore32/kernel/ksyms.c:84: error: ._put_user_2. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:84: error: type defaults to .nt. in declaration of ._put_user_2. arch/unicore32/kernel/ksyms.c:85: error: ._put_user_4. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:85: error: type defaults to .nt. in declaration of ._put_user_4. arch/unicore32/kernel/ksyms.c:86: error: ._put_user_8. undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:86: error: type defaults to .nt. in declaration of ._put_user_8. Signed-off-by: Chen Gang Acked-by: Xuetao Guan Signed-off-by: Xuetao Guan --- arch/unicore32/kernel/ksyms.c | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'arch') diff --git a/arch/unicore32/kernel/ksyms.c b/arch/unicore32/kernel/ksyms.c index d285d71cbe35..63afc7f5da2c 100644 --- a/arch/unicore32/kernel/ksyms.c +++ b/arch/unicore32/kernel/ksyms.c @@ -26,8 +26,6 @@ EXPORT_SYMBOL(find_next_zero_bit); EXPORT_SYMBOL(find_next_bit); -EXPORT_SYMBOL(__backtrace); - /* platform dependent support */ EXPORT_SYMBOL(__udelay); EXPORT_SYMBOL(__const_udelay); @@ -35,28 +33,6 @@ EXPORT_SYMBOL(__const_udelay); /* networking */ EXPORT_SYMBOL(csum_partial); EXPORT_SYMBOL(csum_partial_copy_from_user); -EXPORT_SYMBOL(csum_partial_copy_nocheck); -EXPORT_SYMBOL(__csum_ipv6_magic); - - /* io */ -#ifndef __raw_readsb -EXPORT_SYMBOL(__raw_readsb); -#endif -#ifndef __raw_readsw -EXPORT_SYMBOL(__raw_readsw); -#endif -#ifndef __raw_readsl -EXPORT_SYMBOL(__raw_readsl); -#endif -#ifndef __raw_writesb -EXPORT_SYMBOL(__raw_writesb); -#endif -#ifndef __raw_writesw -EXPORT_SYMBOL(__raw_writesw); -#endif -#ifndef __raw_writesl -EXPORT_SYMBOL(__raw_writesl); -#endif /* string / mem functions */ EXPORT_SYMBOL(strchr); @@ -76,15 +52,6 @@ EXPORT_SYMBOL(__copy_from_user); EXPORT_SYMBOL(__copy_to_user); EXPORT_SYMBOL(__clear_user); -EXPORT_SYMBOL(__get_user_1); -EXPORT_SYMBOL(__get_user_2); -EXPORT_SYMBOL(__get_user_4); - -EXPORT_SYMBOL(__put_user_1); -EXPORT_SYMBOL(__put_user_2); -EXPORT_SYMBOL(__put_user_4); -EXPORT_SYMBOL(__put_user_8); - EXPORT_SYMBOL(__ashldi3); EXPORT_SYMBOL(__ashrdi3); EXPORT_SYMBOL(__divsi3); -- cgit v1.2.3-55-g7522 From df8e4c7d8d756d93da676b532c39f8d1d9ceab77 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Fri, 14 Mar 2014 08:49:27 +0800 Subject: arch/unicore32/kernel/module.c: use __vmalloc_node_range() instead of __vmalloc_area() __vmalloc_area() has already been removed from upstream kernel, need use __vmalloc_node_range() instead of. The related commit: "d0a2126 mm: unify module_alloc code for vmalloc". The related error (allmodconfig for unicore32): CC arch/unicore32/kernel/module.o arch/unicore32/kernel/module.c: In function 'module_alloc' : arch/unicore32/kernel/module.c:34: error: implicit declaration of function '__vmalloc_area' arch/unicore32/kernel/module.c:34: warning: return makes pointer from integer without a cast make[1]: *** [arch/unicore32/kernel/module.o] Error 1 make: *** [arch/unicore32/kernel] Error 2 Signed-off-by: Chen Gang Acked-by: Xuetao Guan Signed-off-by: Xuetao Guan --- arch/unicore32/kernel/module.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'arch') diff --git a/arch/unicore32/kernel/module.c b/arch/unicore32/kernel/module.c index 16bd1495b934..dc41f6dfedb6 100644 --- a/arch/unicore32/kernel/module.c +++ b/arch/unicore32/kernel/module.c @@ -24,14 +24,9 @@ void *module_alloc(unsigned long size) { - struct vm_struct *area; - - size = PAGE_ALIGN(size); - area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END); - if (!area) - return NULL; - - return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL_EXEC); + return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, + GFP_KERNEL, PAGE_KERNEL_EXEC, NUMA_NO_NODE, + __builtin_return_address(0)); } int -- cgit v1.2.3-55-g7522 From db7ef289a2f6a4a72c7715076dfd44e9f393b29c Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Fri, 14 Mar 2014 09:19:39 +0800 Subject: arch/unicore32/kernel/clock.c: add readl() and writel() for 'PM_' macros Add readl() and writel() for 'PM_' macros, just like another areas have done within unicored32, or will cause compiling issue. The related error (allmodconfig for unicored32): CC arch/unicore32/kernel/clock.o arch/unicore32/kernel/clock.c: In function 'clk_set_rate': arch/unicore32/kernel/clock.c:182: warning: initialization makes integer from pointer without a cast arch/unicore32/kernel/clock.c:204: error: lvalue required as left operand of assignment arch/unicore32/kernel/clock.c:206: error: lvalue required as left operand of assignment arch/unicore32/kernel/clock.c:207: error: invalid operands to binary & (have 'void *' and 'long unsigned int') make[1]: *** [arch/unicore32/kernel/clock.o] Error 1 make: *** [arch/unicore32/kernel] Error 2 Signed-off-by: Chen Gang Acked-by: Xuetao Guan Signed-off-by: Xuetao Guan --- arch/unicore32/kernel/clock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'arch') diff --git a/arch/unicore32/kernel/clock.c b/arch/unicore32/kernel/clock.c index 18d4563e6fa5..b1ca775f6f6e 100644 --- a/arch/unicore32/kernel/clock.c +++ b/arch/unicore32/kernel/clock.c @@ -179,7 +179,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate) } #ifdef CONFIG_CPU_FREQ if (clk == &clk_mclk_clk) { - u32 pll_rate, divstatus = PM_DIVSTATUS; + u32 pll_rate, divstatus = readl(PM_DIVSTATUS); int ret, i; /* lookup mclk_clk_table */ @@ -201,10 +201,10 @@ int clk_set_rate(struct clk *clk, unsigned long rate) / (((divstatus & 0x0000f000) >> 12) + 1); /* set pll sys cfg reg. */ - PM_PLLSYSCFG = pll_rate; + writel(pll_rate, PM_PLLSYSCFG); - PM_PMCR = PM_PMCR_CFBSYS; - while ((PM_PLLDFCDONE & PM_PLLDFCDONE_SYSDFC) + writel(PM_PMCR_CFBSYS, PM_PMCR); + while ((readl(PM_PLLDFCDONE) & PM_PLLDFCDONE_SYSDFC) != PM_PLLDFCDONE_SYSDFC) udelay(100); /* about 1ms */ -- cgit v1.2.3-55-g7522 From 1ff38c56cbd095c4c0dfa581a859ba3557830f78 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Mon, 24 Mar 2014 20:17:44 +0800 Subject: arch/unicore32/mm/alignment.c: include "asm/pgtable.h" to avoid compiling error Need include "asm/pgtable.h" to include "asm-generic/pgtable-nopmd.h", so can let 'pmd_t' defined. The related error with allmodconfig: CC arch/unicore32/mm/alignment.o In file included from arch/unicore32/mm/alignment.c:24: arch/unicore32/include/asm/tlbflush.h:135: error: expected .). before .*. token arch/unicore32/include/asm/tlbflush.h:154: error: expected .). before .*. token In file included from arch/unicore32/mm/alignment.c:27: arch/unicore32/mm/mm.h:15: error: expected .=., .,., .;., .sm. or ._attribute__. before .*. token arch/unicore32/mm/mm.h:20: error: expected .=., .,., .;., .sm. or ._attribute__. before .*. token arch/unicore32/mm/mm.h:25: error: expected .=., .,., .;., .sm. or ._attribute__. before .*. token make[1]: *** [arch/unicore32/mm/alignment.o] Error 1 make: *** [arch/unicore32/mm] Error 2 Signed-off-by: Chen Gang Acked-by: Xuetao Guan Signed-off-by: Xuetao Guan --- arch/unicore32/mm/alignment.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch') diff --git a/arch/unicore32/mm/alignment.c b/arch/unicore32/mm/alignment.c index de7dc5fdd58b..24e836023e6c 100644 --- a/arch/unicore32/mm/alignment.c +++ b/arch/unicore32/mm/alignment.c @@ -21,6 +21,7 @@ #include #include +#include #include #include -- cgit v1.2.3-55-g7522 From 1febf615142bc319f2e3bfa612094186cb1d32c9 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Mon, 24 Mar 2014 20:54:11 +0800 Subject: arch/unicore32/include/asm/ptrace.h: add generic definition for profile_pc() Add generic definition just like another architectures have done, or can not pass compiling with allmodconfig, the related error: CC kernel/profile.o kernel/profile.c: In function 'profile_tick': kernel/profile.c:419: error: implicit declaration of function 'profile_pc' make[1]: *** [kernel/profile.o] Error 1 make: *** [kernel] Error 2 Signed-off-by: Chen Gang Acked-by: Xuetao Guan Signed-off-by: Xuetao Guan --- arch/unicore32/include/asm/ptrace.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch') diff --git a/arch/unicore32/include/asm/ptrace.h b/arch/unicore32/include/asm/ptrace.h index 9df53d991c78..02bf5a415bf5 100644 --- a/arch/unicore32/include/asm/ptrace.h +++ b/arch/unicore32/include/asm/ptrace.h @@ -55,6 +55,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) +#define profile_pc(regs) instruction_pointer(regs) #endif /* __ASSEMBLY__ */ #endif -- cgit v1.2.3-55-g7522 From 312c6df40354e81d052d96c9d0c68cca82a65053 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Sat, 3 May 2014 09:06:28 +0800 Subject: arch/unicore32/include/asm/io.h: add readl_relaxed() generic definition Need generic definition for readl_relaxed(), like other architectures have done. Or can not pass compiling with allmodconfig, the related error: CC [M] drivers/message/fusion/mptbase.o drivers/message/fusion/mptbase.c: In function 'mpt_send_handshake_request': drivers/message/fusion/mptbase.c:1224: error: implicit declaration of function 'readl_relaxed' Signed-off-by: Chen Gang Acked-by: Xuetao Guan Signed-off-by: Xuetao Guan --- arch/unicore32/include/asm/io.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch') diff --git a/arch/unicore32/include/asm/io.h b/arch/unicore32/include/asm/io.h index 39decb6e6f57..d6920301465a 100644 --- a/arch/unicore32/include/asm/io.h +++ b/arch/unicore32/include/asm/io.h @@ -39,6 +39,10 @@ extern void __uc32_iounmap(volatile void __iomem *addr); #define ioremap_nocache(cookie, size) __uc32_ioremap(cookie, size) #define iounmap(cookie) __uc32_iounmap(cookie) +#define readb_relaxed readb +#define readw_relaxed readw +#define readl_relaxed readl + #define HAVE_ARCH_PIO_SIZE #define PIO_OFFSET (unsigned int)(PCI_IOBASE) #define PIO_MASK (unsigned int)(IO_SPACE_LIMIT) -- cgit v1.2.3-55-g7522 From 5a5ffc991edaf5d1c24a01db62c3d203df53dec7 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Wed, 21 May 2014 08:57:53 +0800 Subject: arch/unicore32/kernel/ksyms.c: remove 2 export symbols to avoid compiling failure 'csum_partial' and 'csum_partial_copy_from_user' have already been exported in "lib/", so need not export them again, or it will cause compiling error. The related error (with allmodconfig under unicore32): LD vmlinux.o lib/built-in.o:(___ksymtab+csum_partial+0x0): multiple definition of `__ksymtab_csum_partial' arch/unicore32/kernel/built-in.o:(___ksymtab+csum_partial+0x0): first defined here lib/built-in.o:(___ksymtab+csum_partial_copy_from_user+0x0): multiple definition of `__ksymtab_csum_partial_copy_from_user' arch/unicore32/kernel/built-in.o:(___ksymtab+csum_partial_copy_from_user+0x0): first defined here make: *** [vmlinux] Error 1 Signed-off-by: Chen Gang Acked-by: Xuetao Guan Signed-off-by: Xuetao Guan --- arch/unicore32/kernel/ksyms.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'arch') diff --git a/arch/unicore32/kernel/ksyms.c b/arch/unicore32/kernel/ksyms.c index 63afc7f5da2c..bc061407f6eb 100644 --- a/arch/unicore32/kernel/ksyms.c +++ b/arch/unicore32/kernel/ksyms.c @@ -30,10 +30,6 @@ EXPORT_SYMBOL(find_next_bit); EXPORT_SYMBOL(__udelay); EXPORT_SYMBOL(__const_udelay); - /* networking */ -EXPORT_SYMBOL(csum_partial); -EXPORT_SYMBOL(csum_partial_copy_from_user); - /* string / mem functions */ EXPORT_SYMBOL(strchr); EXPORT_SYMBOL(strrchr); -- cgit v1.2.3-55-g7522 From 8065042279df8e53c31e555b1330a2f05f1655b3 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Wed, 21 May 2014 09:37:08 +0800 Subject: arch: unicore32: kernel: ksyms: remove 'bswapsi2' and 'muldi3' to avoid compiling failure After check the code, 'bswapsi2' and 'muldi3' are useless for unicore32, so can remove them to avoid compiling failure. The related error (with allmodconfig under unicore32): LD init/built-in.o arch/unicore32/kernel/built-in.o:(___ksymtab+__muldi3+0x0): undefined reference to `__muldi3' arch/unicore32/kernel/built-in.o:(___ksymtab+__bswapsi2+0x0): undefined reference to `__bswapsi2' Signed-off-by: Chen Gang Acked-by: Xuetao Guan Signed-off-by: Xuetao Guan --- arch/unicore32/kernel/ksyms.c | 2 -- arch/unicore32/kernel/ksyms.h | 2 -- 2 files changed, 4 deletions(-) (limited to 'arch') diff --git a/arch/unicore32/kernel/ksyms.c b/arch/unicore32/kernel/ksyms.c index bc061407f6eb..e78911aefb13 100644 --- a/arch/unicore32/kernel/ksyms.c +++ b/arch/unicore32/kernel/ksyms.c @@ -53,9 +53,7 @@ EXPORT_SYMBOL(__ashrdi3); EXPORT_SYMBOL(__divsi3); EXPORT_SYMBOL(__lshrdi3); EXPORT_SYMBOL(__modsi3); -EXPORT_SYMBOL(__muldi3); EXPORT_SYMBOL(__ucmpdi2); EXPORT_SYMBOL(__udivsi3); EXPORT_SYMBOL(__umodsi3); -EXPORT_SYMBOL(__bswapsi2); diff --git a/arch/unicore32/kernel/ksyms.h b/arch/unicore32/kernel/ksyms.h index 185cdc712d03..31472ad9467a 100644 --- a/arch/unicore32/kernel/ksyms.h +++ b/arch/unicore32/kernel/ksyms.h @@ -8,8 +8,6 @@ extern void __ashrdi3(void); extern void __divsi3(void); extern void __lshrdi3(void); extern void __modsi3(void); -extern void __muldi3(void); extern void __ucmpdi2(void); extern void __udivsi3(void); extern void __umodsi3(void); -extern void __bswapsi2(void); -- cgit v1.2.3-55-g7522 From f80561e4d1f95c5e0b8fe4782fcd53618d80a959 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Thu, 22 May 2014 07:08:23 +0800 Subject: arch/unicore32/kernel/setup.c: add generic 'screen_info' to avoid compiling failure Add generic 'screen_info' just like another architectures have done (e.g. tile, sh, score, ia64, hexagon, and cris). The related error (with allmodconfig under unicore32): LD init/built-in.o drivers/built-in.o: In function `vgacon_save_screen': powercap_sys.c:(.text+0x21788): undefined reference to `screen_info' drivers/built-in.o: In function `vgacon_resize': powercap_sys.c:(.text+0x21b54): undefined reference to `screen_info' drivers/built-in.o: In function `vgacon_switch': powercap_sys.c:(.text+0x21cb4): undefined reference to `screen_info' drivers/built-in.o: In function `vgacon_init': powercap_sys.c:(.text+0x2296c): undefined reference to `screen_info' drivers/built-in.o: In function `vgacon_startup': powercap_sys.c:(.text+0x22e80): undefined reference to `screen_info' Signed-off-by: Chen Gang Acked-by: Xuetao Guan Signed-off-by: Xuetao Guan --- arch/unicore32/kernel/setup.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch') diff --git a/arch/unicore32/kernel/setup.c b/arch/unicore32/kernel/setup.c index 87adbf5ebfe0..3fa317f96122 100644 --- a/arch/unicore32/kernel/setup.c +++ b/arch/unicore32/kernel/setup.c @@ -53,6 +53,10 @@ struct stack { static struct stack stacks[NR_CPUS]; +#ifdef CONFIG_VGA_CONSOLE +struct screen_info screen_info; +#endif + char elf_platform[ELF_PLATFORM_SIZE]; EXPORT_SYMBOL(elf_platform); -- cgit v1.2.3-55-g7522 From aaad61838242469b0f9724a6057ea74ab4e87369 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Tue, 15 Apr 2014 09:49:48 +0800 Subject: unicore32: include: asm: add missing ')' for PAGE_* macros in pgtable.h Missing related ')', the related compiling error: CC [M] drivers/gpu/drm/udl/udl_fb.o drivers/gpu/drm/udl/udl_fb.c: In function ‘udl_fb_mmapÂ’: drivers/gpu/drm/udl/udl_fb.c:273: error: expected ‘)Â’ before ‘returnÂ’ drivers/gpu/drm/udl/udl_fb.c:281: error: expected expression before ‘}Â’ token make[4]: *** [drivers/gpu/drm/udl/udl_fb.o] Error 1 make[3]: *** [drivers/gpu/drm/udl] Error 2 make[2]: *** [drivers/gpu/drm] Error 2 make[1]: *** [drivers/gpu] Error 2 make: *** [drivers] Error 2 Signed-off-by: Chen Gang Acked-by: Xuetao Guan Signed-off-by: Xuetao Guan --- arch/unicore32/include/asm/pgtable.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'arch') diff --git a/arch/unicore32/include/asm/pgtable.h b/arch/unicore32/include/asm/pgtable.h index 233c25880df4..ed6f7d000fba 100644 --- a/arch/unicore32/include/asm/pgtable.h +++ b/arch/unicore32/include/asm/pgtable.h @@ -87,16 +87,16 @@ extern pgprot_t pgprot_kernel; #define PAGE_NONE pgprot_user #define PAGE_SHARED __pgprot(pgprot_val(pgprot_user | PTE_READ \ - | PTE_WRITE) + | PTE_WRITE)) #define PAGE_SHARED_EXEC __pgprot(pgprot_val(pgprot_user | PTE_READ \ | PTE_WRITE \ - | PTE_EXEC) + | PTE_EXEC)) #define PAGE_COPY __pgprot(pgprot_val(pgprot_user | PTE_READ) #define PAGE_COPY_EXEC __pgprot(pgprot_val(pgprot_user | PTE_READ \ - | PTE_EXEC) -#define PAGE_READONLY __pgprot(pgprot_val(pgprot_user | PTE_READ) + | PTE_EXEC)) +#define PAGE_READONLY __pgprot(pgprot_val(pgprot_user | PTE_READ)) #define PAGE_READONLY_EXEC __pgprot(pgprot_val(pgprot_user | PTE_READ \ - | PTE_EXEC) + | PTE_EXEC)) #define PAGE_KERNEL pgprot_kernel #define PAGE_KERNEL_EXEC __pgprot(pgprot_val(pgprot_kernel | PTE_EXEC)) -- cgit v1.2.3-55-g7522 From 8a016596a56282f1414cf90e575040cffdabe68e Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Tue, 15 Apr 2014 09:21:30 +0800 Subject: arch:unicore32:mm: add devmem_is_allowed() to support STRICT_DEVMEM unicore32 supports STRICT_DEVMEM, so it needs devmem_is_allowed(), like some of other architectures have done (e.g. arm, powerpc, x86 ...). The related error with allmodconfig: CC drivers/char/mem.o drivers/char/mem.c: In function ‘range_is_allowed’: drivers/char/mem.c:69: error: implicit declaration of function ‘devmem_is_allowed’ make[2]: *** [drivers/char/mem.o] Error 1 make[1]: *** [drivers/char] Error 2 make: *** [drivers] Error 2 Signed-off-by: Chen Gang Acked-by: Xuetao Guan Signed-off-by: Xuetao Guan --- arch/unicore32/include/asm/io.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'arch') diff --git a/arch/unicore32/include/asm/io.h b/arch/unicore32/include/asm/io.h index d6920301465a..cb1d8fd2b16b 100644 --- a/arch/unicore32/include/asm/io.h +++ b/arch/unicore32/include/asm/io.h @@ -48,5 +48,28 @@ extern void __uc32_iounmap(volatile void __iomem *addr); #define PIO_MASK (unsigned int)(IO_SPACE_LIMIT) #define PIO_RESERVED (PIO_OFFSET + PIO_MASK + 1) +#ifdef CONFIG_STRICT_DEVMEM + +#include +#include + +/* + * devmem_is_allowed() checks to see if /dev/mem access to a certain + * address is valid. The argument is a physical page number. + * We mimic x86 here by disallowing access to system RAM as well as + * device-exclusive MMIO regions. This effectively disable read()/write() + * on /dev/mem. + */ +static inline int devmem_is_allowed(unsigned long pfn) +{ + if (iomem_is_exclusive(pfn << PAGE_SHIFT)) + return 0; + if (!page_is_ram(pfn)) + return 1; + return 0; +} + +#endif /* CONFIG_STRICT_DEVMEM */ + #endif /* __KERNEL__ */ #endif /* __UNICORE_IO_H__ */ -- cgit v1.2.3-55-g7522 From 40ad2a6741452ae63907a9779e534f4a9d26d1bd Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Tue, 27 May 2014 08:03:19 +0800 Subject: arch: unicore32: ksyms: export additional find_first_*() to avoid compiling failure Some modules need find_first_bit() and find_first_zero_bit(), so export them. The related error (with allmodconfig under unicore32): MODPOST 4039 modules ERROR: "find_first_bit" [sound/soc/codecs/snd-soc-uda1380.ko] undefined! ERROR: "find_first_zero_bit" [net/sctp/sctp.ko] undefined! ... Signed-off-by: Chen Gang Acked-by: Xuetao Guan Signed-off-by: Xuetao Guan --- arch/unicore32/kernel/ksyms.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch') diff --git a/arch/unicore32/kernel/ksyms.c b/arch/unicore32/kernel/ksyms.c index e78911aefb13..0323528a80fd 100644 --- a/arch/unicore32/kernel/ksyms.c +++ b/arch/unicore32/kernel/ksyms.c @@ -23,6 +23,8 @@ #include "ksyms.h" +EXPORT_SYMBOL(find_first_bit); +EXPORT_SYMBOL(find_first_zero_bit); EXPORT_SYMBOL(find_next_zero_bit); EXPORT_SYMBOL(find_next_bit); -- cgit v1.2.3-55-g7522 From 3420d49dd3f22a3342bec16dc0bd2b64eaf061a5 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Tue, 27 May 2014 08:04:24 +0800 Subject: arch: unicore32: ksyms: export 'pm_power_off' to avoid compiling failure. Two driver modules need 'pm_power_off', so export it. The related error (with allmodconfig under unicore32): MODPOST 4039 modules ERROR: "pm_power_off" [drivers/mfd/retu-mfd.ko] undefined! ERROR: "pm_power_off" [drivers/char/ipmi/ipmi_poweroff.ko] undefined! Signed-off-by: Chen Gang Acked-by: Xuetao Guan Signed-off-by: Xuetao Guan --- arch/unicore32/kernel/process.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch') diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c index 778ebba80827..b008e9961465 100644 --- a/arch/unicore32/kernel/process.c +++ b/arch/unicore32/kernel/process.c @@ -60,6 +60,7 @@ void machine_halt(void) * Function pointers to optional machine specific functions */ void (*pm_power_off)(void) = NULL; +EXPORT_SYMBOL(pm_power_off); void machine_power_off(void) { -- cgit v1.2.3-55-g7522 From 92543fd756cca554a37e343616a212c435168967 Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Tue, 27 May 2014 08:08:06 +0800 Subject: arch: unicore32: ksyms: export '__cpuc_coherent_kern_range' to avoid compiling failure flush_icache_range() is '__cpuc_coherent_kern_range' under unicore32, and lkdtm.ko needs it. At present, '__cpuc_coherent_kern_range' is still used by unicore32, so export it to avoid compiling failure. The related error (with allmodconfig under unicore32): ERROR: "__cpuc_coherent_kern_range" [drivers/misc/lkdtm.ko] undefined! Signed-off-by: Chen Gang Acked-by: Xuetao Guan Signed-off-by: Xuetao Guan --- arch/unicore32/mm/proc-syms.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch') diff --git a/arch/unicore32/mm/proc-syms.c b/arch/unicore32/mm/proc-syms.c index f30071e3665d..21c00fc85c99 100644 --- a/arch/unicore32/mm/proc-syms.c +++ b/arch/unicore32/mm/proc-syms.c @@ -19,5 +19,7 @@ EXPORT_SYMBOL(cpu_dcache_clean_area); EXPORT_SYMBOL(cpu_set_pte); +EXPORT_SYMBOL(__cpuc_coherent_kern_range); + EXPORT_SYMBOL(__cpuc_dma_flush_range); EXPORT_SYMBOL(__cpuc_dma_clean_range); -- cgit v1.2.3-55-g7522 From d670878e2c9adb86b37e42b0937b2d4825bd2b39 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Tue, 3 Jun 2014 11:30:03 -0700 Subject: unicore32: Remove ARCH_HAS_CPUFREQ config option This config exists entirely to hide the cpufreq menu from the kernel configuration unless a platform has selected it. Nothing is actually built if this config is 'Y' and it just leads to more patches that add a select under a platform Kconfig so that some other CPUfreq option can be chosen. Let's remove the option so that we can always enable CPUfreq drivers on unicore32 platforms. Cc: Viresh Kumar Signed-off-by: Stephen Boyd Reviewed-by: Viresh Kumar Signed-off-by: Xuetao Guan --- arch/unicore32/Kconfig | 6 ------ 1 file changed, 6 deletions(-) (limited to 'arch') diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig index aafad6fa1667..928237a7b9ca 100644 --- a/arch/unicore32/Kconfig +++ b/arch/unicore32/Kconfig @@ -51,9 +51,6 @@ config ARCH_HAS_ILOG2_U32 config ARCH_HAS_ILOG2_U64 bool -config ARCH_HAS_CPUFREQ - bool - config GENERIC_HWEIGHT def_bool y @@ -87,7 +84,6 @@ config ARCH_PUV3 select GENERIC_CLOCKEVENTS select HAVE_CLK select ARCH_REQUIRE_GPIOLIB - select ARCH_HAS_CPUFREQ # CONFIGs for ARCH_PUV3 @@ -198,9 +194,7 @@ menu "Power management options" source "kernel/power/Kconfig" -if ARCH_HAS_CPUFREQ source "drivers/cpufreq/Kconfig" -endif config ARCH_SUSPEND_POSSIBLE def_bool y if !ARCH_FPGA -- cgit v1.2.3-55-g7522