Skip to content

Commit 786b71f

Browse files
committed
Merge tag 'nds32-for-linus-4.17-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/greentime/linux
Pull nds32 fixes from Greentime Hu: "Bug fixes and build error fixes for nds32" * tag 'nds32-for-linus-4.17-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/greentime/linux: nds32: Fix compiler warning, Wstringop-overflow, in vdso.c nds32: Disable local irq before calling cpu_dcache_wb_page in copy_user_highpage nds32: Flush the cache of the page at vmaddr instead of kaddr in flush_anon_page nds32: Correct flush_dcache_page function nds32: Fix the unaligned access handler nds32: Renaming the file for unaligned access nds32: To fix a cache inconsistency issue by setting correct cacheability of NTC nds32: To refine readability of INT_MASK_INITAIAL_VAL nds32: Fix the virtual address may map too much range by tlbop issue. nds32: Fix the allmodconfig build. To make sure CONFIG_CPU_LITTLE_ENDIAN is default y nds32: Fix build failed because arch_trace_hardirqs_off is changed to trace_hardirqs_off. nds32: Fix the unknown type u8 issue. nds32: Fix the symbols undefined issue by exporting them. nds32: Fix xfs_buf built failed by export invalidate_kernel_vmap_range and flush_kernel_vmap_range nds32: Fix drivers/gpu/drm/udl/udl_fb.c building error by defining PAGE_SHARED nds32: Fix building error of crypto/xor.c by adding xor.h nds32: Fix building error when CONFIG_FREEZE is enabled. nds32: lib: To use generic lib instead of libgcc to prevent the symbol undefined issue.
2 parents b04e217 + a30e7d1 commit 786b71f

File tree

18 files changed

+130
-34
lines changed

18 files changed

+130
-34
lines changed

arch/nds32/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ config NDS32
99
select CLKSRC_MMIO
1010
select CLONE_BACKWARDS
1111
select COMMON_CLK
12+
select GENERIC_ASHLDI3
13+
select GENERIC_ASHRDI3
14+
select GENERIC_LSHRDI3
15+
select GENERIC_CMPDI2
16+
select GENERIC_MULDI3
17+
select GENERIC_UCMPDI2
1218
select GENERIC_ATOMIC64
1319
select GENERIC_CPU_DEVICES
1420
select GENERIC_CLOCKEVENTS
@@ -82,6 +88,7 @@ endmenu
8288

8389
menu "Kernel Features"
8490
source "kernel/Kconfig.preempt"
91+
source "kernel/Kconfig.freezer"
8592
source "mm/Kconfig"
8693
source "kernel/Kconfig.hz"
8794
endmenu

arch/nds32/Kconfig.cpu

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
comment "Processor Features"
22

33
config CPU_BIG_ENDIAN
4-
bool "Big endian"
4+
def_bool !CPU_LITTLE_ENDIAN
55

66
config CPU_LITTLE_ENDIAN
7-
def_bool !CPU_BIG_ENDIAN
7+
bool "Little endian"
8+
default y
89

910
config HWZOL
1011
bool "hardware zero overhead loop support"

arch/nds32/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ export TEXTADDR
2323
# If we have a machine-specific directory, then include it in the build.
2424
core-y += arch/nds32/kernel/ arch/nds32/mm/
2525
libs-y += arch/nds32/lib/
26-
LIBGCC_PATH := \
27-
$(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
28-
libs-y += $(LIBGCC_PATH)
2926

3027
ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""'
3128
BUILTIN_DTB := y
@@ -35,8 +32,12 @@ endif
3532

3633
ifdef CONFIG_CPU_LITTLE_ENDIAN
3734
KBUILD_CFLAGS += $(call cc-option, -EL)
35+
KBUILD_AFLAGS += $(call cc-option, -EL)
36+
LDFLAGS += $(call cc-option, -EL)
3837
else
3938
KBUILD_CFLAGS += $(call cc-option, -EB)
39+
KBUILD_AFLAGS += $(call cc-option, -EB)
40+
LDFLAGS += $(call cc-option, -EB)
4041
endif
4142

4243
boot := arch/nds32/boot

arch/nds32/include/asm/Kbuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ generic-y += dma.h
1616
generic-y += emergency-restart.h
1717
generic-y += errno.h
1818
generic-y += exec.h
19+
generic-y += export.h
1920
generic-y += fb.h
2021
generic-y += fcntl.h
2122
generic-y += ftrace.h
@@ -49,6 +50,7 @@ generic-y += switch_to.h
4950
generic-y += timex.h
5051
generic-y += topology.h
5152
generic-y += trace_clock.h
53+
generic-y += xor.h
5254
generic-y += unaligned.h
5355
generic-y += user.h
5456
generic-y += vga.h

arch/nds32/include/asm/bitfield.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@
336336
#define INT_MASK_mskIDIVZE ( 0x1 << INT_MASK_offIDIVZE )
337337
#define INT_MASK_mskDSSIM ( 0x1 << INT_MASK_offDSSIM )
338338

339-
#define INT_MASK_INITAIAL_VAL 0x10003
339+
#define INT_MASK_INITAIAL_VAL (INT_MASK_mskDSSIM|INT_MASK_mskIDIVZE)
340340

341341
/******************************************************************************
342342
* ir15: INT_PEND (Interrupt Pending Register)
@@ -396,6 +396,7 @@
396396
#define MMU_CTL_D8KB 1
397397
#define MMU_CTL_UNA ( 0x1 << MMU_CTL_offUNA )
398398

399+
#define MMU_CTL_CACHEABLE_NON 0
399400
#define MMU_CTL_CACHEABLE_WB 2
400401
#define MMU_CTL_CACHEABLE_WT 3
401402

arch/nds32/include/asm/cacheflush.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ void flush_anon_page(struct vm_area_struct *vma,
3232

3333
#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
3434
void flush_kernel_dcache_page(struct page *page);
35+
void flush_kernel_vmap_range(void *addr, int size);
36+
void invalidate_kernel_vmap_range(void *addr, int size);
3537
void flush_icache_range(unsigned long start, unsigned long end);
3638
void flush_icache_page(struct vm_area_struct *vma, struct page *page);
3739
#define flush_dcache_mmap_lock(mapping) xa_lock_irq(&(mapping)->i_pages)

arch/nds32/include/asm/io.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#ifndef __ASM_NDS32_IO_H
55
#define __ASM_NDS32_IO_H
66

7+
#include <linux/types.h>
8+
79
extern void iounmap(volatile void __iomem *addr);
810
#define __raw_writeb __raw_writeb
911
static inline void __raw_writeb(u8 val, volatile void __iomem *addr)

arch/nds32/include/asm/page.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ extern void copy_user_highpage(struct page *to, struct page *from,
2727
unsigned long vaddr, struct vm_area_struct *vma);
2828
extern void clear_user_highpage(struct page *page, unsigned long vaddr);
2929

30+
void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
31+
struct page *to);
32+
void clear_user_page(void *addr, unsigned long vaddr, struct page *page);
3033
#define __HAVE_ARCH_COPY_USER_HIGHPAGE
3134
#define clear_user_highpage clear_user_highpage
3235
#else

arch/nds32/include/asm/pgtable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val);
152152
#define PAGE_CACHE_L1 __pgprot(_HAVE_PAGE_L | _PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_E | _PAGE_G | _PAGE_CACHE)
153153
#define PAGE_MEMORY __pgprot(_HAVE_PAGE_L | _PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_E | _PAGE_G | _PAGE_CACHE_SHRD)
154154
#define PAGE_KERNEL __pgprot(_PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_E | _PAGE_G | _PAGE_CACHE_SHRD)
155+
#define PAGE_SHARED __pgprot(_PAGE_V | _PAGE_M_URW_KRW | _PAGE_D | _PAGE_CACHE_SHRD)
155156
#define PAGE_DEVICE __pgprot(_PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_G | _PAGE_C_DEV)
156157
#endif /* __ASSEMBLY__ */
157158

arch/nds32/kernel/ex-entry.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ common_exception_handler:
118118
/* interrupt */
119119
2:
120120
#ifdef CONFIG_TRACE_IRQFLAGS
121-
jal arch_trace_hardirqs_off
121+
jal trace_hardirqs_off
122122
#endif
123123
move $r0, $sp
124124
sethi $lp, hi20(ret_from_intr)

0 commit comments

Comments
 (0)