[PATCH V9 07/21] csky: MMU and page table management

2018-10-15 Thread Guo Ren
2100.armlinux.org.uk/ Signed-off-by: Guo Ren Cc: Christoph Hellwig Cc: Arnd Bergmann --- Changelog: - fixup pfn_valid(pfn) compile error for modules. - fixup compile warning for CONFIG_DEBUG_HIGHMEM. - fixup module compile error for EXPORT_SYMBOL(empty_zero_page). - dma-mapping: fix up dma_map

[PATCH V9 12/21] csky: ELF and module probe

2018-10-15 Thread Guo Ren
This patch adds ELF definition and module relocate codes. Signed-off-by: Guo Ren Cc: Arnd Bergmann --- arch/csky/abiv1/inc/abi/elf.h | 26 arch/csky/abiv2/inc/abi/elf.h | 43 arch/csky/include/asm/elf.h | 85 +++ arch/csky

[PATCH V9 13/21] csky: Library functions

2018-10-15 Thread Guo Ren
This patch adds string optimize codes and some auxiliary codes. Signed-off-by: Chen Linfei Signed-off-by: Mao Han Signed-off-by: Guo Ren Cc: Arnd Bergmann --- Changelog: - Use bt instead of jbt in asm, jbt will cause relocation problem. - remove kernel/platform.c --- --- arch/csky/abiv1

[PATCH V9 14/21] csky: User access

2018-10-15 Thread Guo Ren
The patch adds "user access from kernel" codes. Signed-off-by: Guo Ren Cc: Arnd Bergmann --- arch/csky/include/asm/uaccess.h | 416 arch/csky/lib/usercopy.c| 262 + 2 files changed, 678 insertions(+) create m

[PATCH V9 15/21] csky: Debug and Ptrace GDB

2018-10-15 Thread Guo Ren
This patch adds arch ptrace implementation, stack dump and bug.h. Signed-off-by: Guo Ren Cc: Arnd Bergmann --- arch/csky/include/asm/bug.h | 26 +++ arch/csky/include/uapi/asm/ptrace.h | 104 arch/csky/kernel/dumpstack.c| 66 arch/csky/kernel/ptrace.c

[PATCH V9 16/21] csky: SMP support

2018-10-15 Thread Guo Ren
This patch adds boot, ipi, hotplug codes for SMP. Signed-off-by: Guo Ren Cc: Marc Zyngier Cc: Mark Rutland Cc: Peter Zijlstra Cc: Arnd Bergmann --- Changelog: - Use PER_CPU_DEFINE for ipi_data. - Remove unused variable and add static for enable_smp_ipi(). - Add comment to explain pass

[PATCH V9 17/21] csky: Misc headers

2018-10-15 Thread Guo Ren
This patch adds csky registers' definition, bitops, byteorder, asm-offsets codes. Signed-off-by: Guo Ren Cc: Arnd Bergmann --- arch/csky/abiv1/inc/abi/reg_ops.h | 27 +++ arch/csky/abiv1/inc/abi/regdef.h | 26 ++ arch/csky/abiv2/inc/abi/reg_ops.h | 17

[PATCH V9 18/21] dt-bindings: csky CPU Bindings

2018-10-15 Thread Guo Ren
This patch adds the documentation to describe that how to add cpu nodes in dts for SMP. Signed-off-by: Guo Ren Cc: Rob Herring --- Changelog: - Add compatible. - Remove status part. --- --- Documentation/devicetree/bindings/csky/cpus.txt | 73 + 1 file changed, 73

[PATCH V9 19/21] dt-bindings: Add vendor prefix for csky

2018-10-15 Thread Guo Ren
Add csky vendor definition. Signed-off-by: Guo Ren Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor

[PATCH V9 20/21] MAINTAINERS: Add csky

2018-10-15 Thread Guo Ren
Add a maintainer information for the csky(C-SKY) architecture. Signed-off-by: Guo Ren --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d870cb5..9dac20e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3211,6 +3211,15 @@ T: git git

[PATCH V9 21/21] csky: support dword access for get_user_size()

2018-10-15 Thread Guo Ren
ow abiv2 gcc ABI for dword access. abiv1 couldn't support __get_user_dword now. Signed-off-by: Guo Ren Cc: Arnd Bergmann --- arch/csky/include/asm/uaccess.h | 140 1 file changed, 56 insertions(+), 84 deletions(-) diff --git a/arch/csky/include/asm/uaccess

[PATCH V13 0/4] C-SKY(csky) Linux Intc Driver

2018-10-16 Thread Guo Ren
changelog. Hope it could be merged into linux-4.20 and I'm very grateful to any help. Guo Ren (4): irqchip: add C-SKY SMP interrupt controller dt-bindings: interrupt-controller: C-SKY SMP intc irqchip: add C-SKY APB bus interrupt controller dt-bindings: interrupt-controller: C-SK

[PATCH V13 3/4] irqchip: add C-SKY APB bus interrupt controller

2018-10-16 Thread Guo Ren
The driver is for C-SKY APB bus interrupt controller. It's a simple interrupt controller which use pending reg to detect the irq and use enable/disable reg to mask/unmask interrupt sources. A lot of SOCs based on C-SKY CPU use the interrupt controller as root controller. Signed-off-by: Guo Ren

[PATCH V13 1/4] irqchip: add C-SKY SMP interrupt controller

2018-10-16 Thread Guo Ren
The driver is for C-SKY SMP interrupt controller. It support 16 soft-irqs, 16 private-irqs, and 992 max external-irqs, a total of 1024 interrupts. C-SKY CPU 807/810/860 SMP/non-SMP could use it. Signed-off-by: Guo Ren Cc: Thomas Gleixner Cc: Marc Zyngier --- Changelog: - Remove

[PATCH V13 4/4] dt-bindings: interrupt-controller: C-SKY APB intc

2018-10-16 Thread Guo Ren
- Dt-bindings doc about C-SKY apb bus interrupt controller. Signed-off-by: Guo Ren Reviewed-by: Rob Herring --- .../interrupt-controller/csky,apb-intc.txt | 62 ++ 1 file changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt

[PATCH V13 2/4] dt-bindings: interrupt-controller: C-SKY SMP intc

2018-10-16 Thread Guo Ren
Dt-bindings doc about C-SKY Multi-processors interrupt controller. Changelog: - Should be: '#interrupt-cells' not 'interrupt-cells' Signed-off-by: Guo Ren Reviewed-by: Rob Herring --- .../bindings/interrupt-controller/csky,mpintc.txt | 40 ++ 1 file changed, 40

Re: [PATCH V8 1/2] clocksource: add gx6605s SOC system timer

2018-09-20 Thread Guo Ren
On Thu, Sep 20, 2018 at 06:06:19PM +0200, Daniel Lezcano wrote: > On 20/09/2018 10:03, Guo Ren wrote: > > Changelog: > > - Add License and Copyright > > - Use timer-of framework > > - Change name with upstream feedback > > - Use clksource_mmio framewor

Re: [PATCH V8 1/2] clocksource: add gx6605s SOC system timer

2018-09-21 Thread Guo Ren
On Fri, Sep 21, 2018 at 01:57:27AM +0200, Daniel Lezcano wrote: > On 21/09/2018 01:31, Guo Ren wrote: > > On Thu, Sep 20, 2018 at 06:06:19PM +0200, Daniel Lezcano wrote: > >> On 20/09/2018 10:03, Guo Ren wrote: > >>> Changelog: > >>> - Add License and

Re: [PATCH V4 00/27] C-SKY(csky) Linux Kernel Port

2018-09-21 Thread Guo Ren
; >> On Wed, Sep 12, 2018 at 3:25 PM Guo Ren wrote: > > I don't want to hijack this thread, but in RISC-V land we were hoping to > > have a > > user ABI free of 32-bit time_t. Our 32-bit glibc ABI hasn't been finalized > > yet, and when I talked to the glibc guys a fe

[PATCH V5 00/30] C-SKY(csky) Linux Kernel Port

2018-09-24 Thread Guo Ren
ky: cancel subdirectories cae2af4 csky: use asm-generic/fcntl.h Guo Ren (30): csky: Build infrastructure csky: defconfig csky: Kernel booting csky: Exception handling and mm-fault csky: System Call csky: Cache and TLB routines csky: MMU and page table management csky: Proc

[PATCH V5 02/30] csky: defconfig

2018-09-24 Thread Guo Ren
This patch adds csky defconfig. Signed-off-by: Guo Ren --- arch/csky/configs/defconfig | 61 + 1 file changed, 61 insertions(+) create mode 100644 arch/csky/configs/defconfig diff --git a/arch/csky/configs/defconfig b/arch/csky/configs/defconfig new

[PATCH V5 05/30] csky: System Call

2018-09-24 Thread Guo Ren
This patch adds files related to syscall. Signed-off-by: Guo Ren --- arch/csky/include/asm/syscall.h | 69 + arch/csky/include/asm/syscalls.h| 15 arch/csky/include/uapi/asm/unistd.h | 10 ++ arch/csky/kernel/syscall.c | 42

[PATCH V5 04/30] csky: Exception handling and mm-fault

2018-09-24 Thread Guo Ren
This patch adds exception handling code, cpuinfo and mm-fault code. Signed-off-by: Guo Ren --- arch/csky/abiv1/alignment.c | 332 + arch/csky/abiv1/inc/abi/entry.h | 160 arch/csky/abiv2/inc/abi/entry.h | 157 arch/csky

[PATCH V5 06/30] csky: Cache and TLB routines

2018-09-24 Thread Guo Ren
This patch adds cache and tlb sync codes for abiv1 & abiv2. Signed-off-by: Guo Ren --- arch/csky/abiv1/cacheflush.c | 51 arch/csky/abiv1/inc/abi/cacheflush.h | 43 +++ arch/csky/abiv1/inc/abi/tlb.h | 12 ++ arch/csky/abiv2/cacheflush.c |

[PATCH V5 03/30] csky: Kernel booting

2018-09-24 Thread Guo Ren
This patch add boot code. Thx boot params is all in dtb and it's the only way to let kernel get bootloader param information. Signed-off-by: Guo Ren --- arch/csky/kernel/head.S| 78 + arch/csky/kernel/setup.c | 151

[PATCH V5 01/30] csky: Build infrastructure

2018-09-24 Thread Guo Ren
This patch adds Makefile, Kconfig for build infrastructure. Signed-off-by: Guo Ren --- arch/csky/Kconfig | 204 + arch/csky/Kconfig.debug| 8 ++ arch/csky/Makefile | 92 +++ arch/csky/abiv1

[PATCH V5 12/30] csky: ELF and module probe

2018-09-24 Thread Guo Ren
This patch adds ELF definition and module relocate codes. Signed-off-by: Guo Ren --- arch/csky/include/asm/elf.h | 150 arch/csky/kernel/module.c | 83 2 files changed, 233 insertions(+) create mode 100644 arch/csky

[PATCH V5 08/30] csky: Process management and Signal

2018-09-24 Thread Guo Ren
This patch adds files related to task_switch, sigcontext, signal. Signed-off-by: Guo Ren --- arch/csky/abiv2/fpu.c | 281 + arch/csky/abiv2/inc/abi/fpu.h | 66 ++ arch/csky/include/asm/mmu_context.h | 149 ++ arch/csky

[PATCH V5 13/30] csky: Library functions

2018-09-24 Thread Guo Ren
This patch adds string optimize codes and some auxiliary code. Signed-off-by: Chen Linfei Signed-off-by: Mao Han Signed-off-by: Guo Ren --- arch/csky/abiv1/bswapdi.c| 19 +++ arch/csky/abiv1/bswapsi.c| 15 ++ arch/csky/abiv1/inc/abi/string.h | 13 ++ arch/csky/abiv1

[PATCH V5 11/30] csky: Atomic operations

2018-09-24 Thread Guo Ren
This patch adds atomic, cmpxchg, spinlock files. - SMP supported - ticklock supported - queue-rwlock supported Signed-off-by: Guo Ren --- arch/csky/include/asm/atomic.h | 213 ++ arch/csky/include/asm/cmpxchg.h| 70 + arch/csky/include/asm

[PATCH V5 10/30] csky: IRQ handling

2018-09-24 Thread Guo Ren
This patch adds IRQ handling files. Signed-off-by: Guo Ren --- arch/csky/include/asm/irq.h | 9 arch/csky/include/asm/irqflags.h | 50 arch/csky/kernel/irq.c | 22 ++ 3 files changed, 81 insertions(+) create mode

[PATCH V5 14/30] csky: User access

2018-09-24 Thread Guo Ren
This patch adds "user access from kernel" codes. Signed-off-by: Guo Ren --- arch/csky/include/asm/uaccess.h | 399 arch/csky/lib/usercopy.c| 271 +++ 2 files changed, 670 insertions(+) create mode 100644 arch/cs

[PATCH V5 09/30] csky: VDSO and rt_sigreturn

2018-09-24 Thread Guo Ren
This patch adds files related to VDSO and our VDSO only support rt_sigreturn. Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/vdso.h | 18 + arch/csky/abiv2/inc/abi/vdso.h | 24 arch/csky/include/asm/vdso.h | 13 +++ arch/csky/kernel/vdso.c| 85

[PATCH V5 07/30] csky: MMU and page table management

2018-09-24 Thread Guo Ren
(1GB) - abiv1 CPU (CK610) is VIPT cache and it doesn't support highmem. - abiv2 CPUs are all PIPT cache and they could support highmem. Lowmem is directly mapped by msa0 & msa1 reg, and we needn't setup memory page table for it. Signed-off-by: Guo Ren --- arch/csky/abiv1/inc

[PATCH V6 26/33] MAINTAINERS: Add csky

2018-09-27 Thread Guo Ren
Add a maintainer information for the csky(C-SKY) architecture. Signed-off-by: Guo Ren --- MAINTAINERS | 16 1 file changed, 16 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d870cb5..6b7c1be 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3211,6 +3211,22 @@ T

[PATCH V6 18/33] dt-bindings: csky CPU Bindings

2018-09-27 Thread Guo Ren
This patch adds the documentation to describe that how to add cpu nodes in dts for SMP. Signed-off-by: Guo Ren --- Documentation/devicetree/bindings/csky/cpus.txt | 70 + 1 file changed, 70 insertions(+) create mode 100644 Documentation/devicetree/bindings/csky/cpus.txt

[PATCH V6 20/33] csky/dma: fix up dma_mapping error

2018-09-27 Thread Guo Ren
TO_DEV writeback nonewriteback none TO_CPU invalidate invalidate* invalidate invalidate* BIDIR writeback invalidate writeback invalidate Link: https://lore.kernel.org/lkml/20180518215548.gh17...@n2100.armlinux.org.uk/ Signed-off-by: Guo

[PATCH V6 22/33] irqchip: add C-SKY SMP interrupt controller

2018-09-27 Thread Guo Ren
irq map, reserve soft_irq & private_irq space - Add License and Copyright - Support set_affinity for irq balance in SMP Signed-off-by: Guo Ren --- drivers/irqchip/Kconfig | 8 ++ drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-csky-mpintc.c |

[PATCH V6 28/33] irqchip: add C-SKY APB bus interrupt controller

2018-09-27 Thread Guo Ren
rq-pending - remove CSKY_VECIRQ_LEGENCY - change to generic irq chip framework - add License and Copyright - use irq_domain_add_linear instead of leagcy Signed-off-by: Guo Ren --- drivers/irqchip/Kconfig | 8 ++ drivers/irqchip/Makefile| 1 + drivers/irqchip/irq-c

[PATCH V6 33/33] csky: use asm-generic/bitops/atomic.h for all

2018-09-27 Thread Guo Ren
Specific implementation do not improve the performance, fall back to asm-generic/bitops/atomic.h. Signed-off-by: Guo Ren --- arch/csky/include/asm/bitops.h | 201 - 1 file changed, 201 deletions(-) diff --git a/arch/csky/include/asm/bitops.h b/arch/csky

[PATCH V6 24/33] clocksource: add C-SKY SMP timer

2018-09-27 Thread Guo Ren
. - Coding convention with upstream feed-back. Signed-off-by: Guo Ren --- drivers/clocksource/Kconfig| 8 ++ drivers/clocksource/Makefile | 1 + drivers/clocksource/csky_mptimer.c | 176 + include/linux/cpuhotplug.h | 1 + 4 files changed

[PATCH V6 23/33] dt-bindings: interrupt-controller: C-SKY SMP intc

2018-09-27 Thread Guo Ren
- Dt-bindings doc about C-SKY Multi-processors interrupt controller. Signed-off-by: Guo Ren --- .../bindings/interrupt-controller/csky,mpintc.txt | 40 ++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/csky

[PATCH V6 21/33] csky: remove irq_mapping from smp.c

2018-09-27 Thread Guo Ren
g return value not directly use IPI_IRQ. The modification also involves csky_mpintc. Signed-off-by: Guo Ren --- arch/csky/include/asm/smp.h | 4 +++- arch/csky/kernel/smp.c | 27 +++ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/arch/csky/inclu

[PATCH V6 27/33] dt-bindings: interrupt-controller: C-SKY APB intc

2018-09-27 Thread Guo Ren
- Dt-bindings doc about C-SKY apb bus interrupt controller. Signed-off-by: Guo Ren --- .../interrupt-controller/csky,apb-intc.txt | 62 ++ 1 file changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/csky,apb-intc.txt

[PATCH V6 19/33] dt-bindings: Add vendor prefix for csky

2018-09-27 Thread Guo Ren
Add csky vendor definition. Signed-off-by: Guo Ren --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 2c3fc51..a728ee3

[PATCH V6 25/33] dt-bindings: timer: C-SKY Multi-processor timer

2018-09-27 Thread Guo Ren
- Dt-bingdings doc for C-SKY SMP system setting. Signed-off-by: Guo Ren --- .../devicetree/bindings/timer/csky,mptimer.txt | 46 ++ 1 file changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/csky,mptimer.txt diff --git a/Documentation

[PATCH V6 31/33] csky: fix compile error in linux/bug.h with SMP enabled

2018-09-27 Thread Guo Ren
, from ./include/linux/rcupdate.h:38, from ./include/linux/init_task.h:5, from init/init_task.c:2: The asm/bitops.h will lose asm/atomic.h for cycle include. Signed-off-by: Guo Ren --- arch/csky/include/asm/cmpxchg.h | 7 --- 1 file changed

[PATCH V6 30/33] clocksource: add gx6605s SOC system timer

2018-09-27 Thread Guo Ren
Changelog: - Add License and Copyright - Use timer-of framework - Change name with upstream feedback - Use clksource_mmio framework Signed-off-by: Guo Ren --- drivers/clocksource/Kconfig | 8 ++ drivers/clocksource/Makefile| 1 + drivers/clocksource/timer-gx6605s.c | 150

[PATCH V6 29/33] dt-bindings: timer: gx6605s SOC timer

2018-09-27 Thread Guo Ren
- Dt-bindings doc for gx6605s SOC's system timer. Signed-off-by: Guo Ren Reviewed-by: Rob Herring --- .../bindings/timer/csky,gx6605s-timer.txt | 42 ++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/csky,gx6605s

[PATCH V6 32/33] csky: fix flush_cache_range and tlb_start_vma

2018-09-27 Thread Guo Ren
In flush_cache_range(vma, ...) cache_wbinv_range() couldn't deal with vma->mm's asid for cache_flush_line. So we use cache_wbinv_all() first and we'll improve with cache_flush(vma, start, end) in future. For tlb_start_vma, we make it the same as other arch. Signed-off-by: Guo Ren --- arch/c

Re: [PATCH V5 18/30] dt-bindings: csky CPU Bindings

2018-09-27 Thread Guo Ren
On Thu, Sep 27, 2018 at 11:43:17AM -0500, Rob Herring wrote: > On Tue, Sep 25, 2018 at 07:39:21AM +0800, Guo Ren wrote: > > This patch adds the documentation to describe that how to add cpu nodes in > > dts for SMP. > > > > Signed-off-by: Guo Ren > > --- >

Re: [PATCH V5 23/30] dt-bindings: interrupt-controller: C-SKY SMP intc

2018-09-27 Thread Guo Ren
On Thu, Sep 27, 2018 at 11:50:44AM -0500, Rob Herring wrote: > On Tue, Sep 25, 2018 at 07:39:26AM +0800, Guo Ren wrote: > > - Dt-bindings doc about C-SKY Multi-processors interrupt controller. > > > > Signed-off-by: Guo Ren > > --- > > .../bindings/interrupt

Re: [PATCH V5 18/30] dt-bindings: csky CPU Bindings

2018-09-28 Thread Guo Ren
On Fri, Sep 28, 2018 at 06:32:34AM -0500, Rob Herring wrote: > On Thu, Sep 27, 2018 at 8:03 PM Guo Ren wrote: > > > > On Thu, Sep 27, 2018 at 11:43:17AM -0500, Rob Herring wrote: > > > On Tue, Sep 25, 2018 at 07:39:21AM +0800, Guo Ren wrote: > > > > This patc

Re: [PATCH V6 07/33] csky: MMU and page table management

2018-09-28 Thread Guo Ren
ed long vaddr; > > + > > + if (PageHighMem(page)) > > + vaddr = (unsigned long) kmap_atomic(page); > > This isn't going to work as the size might be larger than PAGE_SIZE. Yes, you are right. I must fix it up. Thank you Best Regards Guo Ren

Re: [PATCH V6 10/33] csky: IRQ handling

2018-09-28 Thread Guo Ren
On Thu, Sep 27, 2018 at 08:49:18AM -0700, Christoph Hellwig wrote: > > --- /dev/null > > +++ b/arch/csky/include/asm/irq.h > > @@ -0,0 +1,9 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. > > + > > +#ifndef __ASM_CSKY_IRQ_H > > +#define

Re: [PATCH V6 08/33] csky: Process management and Signal

2018-09-28 Thread Guo Ren
On Thu, Sep 27, 2018 at 09:50:43PM +0200, Eric W. Biederman wrote: > Guo Ren writes: > > > --- /dev/null > > +++ b/arch/csky/abiv2/fpu.c > > +void fpu_fpe(struct pt_regs * regs) > > +{ > > + int sig; > > + unsigned int fesr; > > + si

Re: [PATCH V6 20/33] csky/dma: fix up dma_mapping error

2018-09-29 Thread Guo Ren
On Fri, Sep 28, 2018 at 09:21:16AM -0700, Christoph Hellwig wrote: > On Fri, Sep 28, 2018 at 08:51:17AM +0800, Guo Ren wrote: > > The arch_sync_dma_for_cpu()/arch_sync_dma_for_device() implementation is > > broken for some combinations that end up in a BUG() instead of performing &g

Re: [PATCH V6 13/33] csky: Library functions

2018-09-29 Thread Guo Ren
___constant_swab64(u); > > > +unsigned int notrace __bswapsi2(unsigned int u) > > +{ > > + return (((u) & 0xff00) >> 24) | > > + (((u) & 0x00ff) >> 8) | > > + (((u) & 0xff00) << 8) | > > + (((u) & 0x00ff) << 24); > > +} > > Same here. OK. #include unsigned int notrace __bswapsi2(unsigned int u) { return ___constant_swab32(u); } Thx Guo Ren

Re: [PATCH V6 10/33] csky: IRQ handling

2018-09-29 Thread Guo Ren
On Thu, Sep 27, 2018 at 08:49:18AM -0700, Christoph Hellwig wrote: > > --- /dev/null > > +++ b/arch/csky/include/asm/irq.h > > @@ -0,0 +1,9 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. > > + > > +#ifndef __ASM_CSKY_IRQ_H > > +#define

Re: [PATCH V6 08/33] csky: Process management and Signal

2018-09-29 Thread Guo Ren
On Thu, Sep 27, 2018 at 09:50:43PM +0200, Eric W. Biederman wrote: > Guo Ren writes: > > > --- /dev/null > > +++ b/arch/csky/abiv2/fpu.c > > +void fpu_fpe(struct pt_regs * regs) > > +{ > > + int sig; > > + unsigned int fesr; > > + si

Re: [PATCH V6 07/33] csky: MMU and page table management

2018-09-29 Thread Guo Ren
GE_MASK; > > + unsigned long vaddr; > > + > > + if (PageHighMem(page)) > > + vaddr = (unsigned long) kmap_atomic(page); > > This isn't going to work as the size might be larger than PAGE_SIZE. Ops ... BIG BUG, must be fixed immediately, thank you. Best Regards Guo Ren

Re: [PATCH V6 05/33] csky: System Call

2018-09-29 Thread Guo Ren
On Fri, Sep 28, 2018 at 09:16:09AM -0700, Christoph Hellwig wrote: > > + > > +static inline void > > +syscall_set_arguments(struct task_struct *task, struct pt_regs *regs, > > + unsigned int i, unsigned int n, const unsigned long *args) > > +{ > > + BUG_ON(i + n > 6); > > +

Re: [PATCH V6 04/33] csky: Exception handling and mm-fault

2018-09-29 Thread Guo Ren
mp; address <= VMALLOC_END)) > > + { > > This doesn't fir the kernel style. Please run checkpatch.pl over > your code and fix at least all warnings that don't seem clearly bogus. if (unlikely(address >= VMALLOC_START) && unlikely(address <= VMALLOC_END)) { Ok, use checkpatch.pl. Best Regards Guo Ren

Re: [PATCH V6 03/33] csky: Kernel booting

2018-09-29 Thread Guo Ren
zhole_size[ZONE_NORMAL] = PFN_DOWN(memblock_start_of_REG1()) - max_low_pfn; > > Please brake lines after 80 characters. Ok. > > > + pr_info("C-SKY: https://github.com/c-sky/csky-linux\n;); > > I don't think this belongs into the kernel log. Ok, remove it. Best Regards Guo Ren

Re: [PATCH V6 01/33] csky: Build infrastructure

2018-09-29 Thread Guo Ren
On Fri, Sep 28, 2018 at 09:11:10AM -0700, Christoph Hellwig wrote: > > --- /dev/null > > +++ b/arch/csky/kernel/Makefile > > @@ -0,0 +1,8 @@ > > +extra-y := head.o vmlinux.lds > > + > > +obj-y += entry.o atomic.o signal.o traps.o irq.o time.o vdso.o \ > > +power.o syscall.o platform.o

Re: [PATCH V6 20/33] csky/dma: fix up dma_mapping error

2018-09-30 Thread Guo Ren
On Sat, Sep 29, 2018 at 11:08:41PM +0800, Guo Ren wrote: > On Fri, Sep 28, 2018 at 09:21:16AM -0700, Christoph Hellwig wrote: > > On Fri, Sep 28, 2018 at 08:51:17AM +0800, Guo Ren wrote: > > > The arch_sync_dma_for_cpu()/arch_sync_dma_for_device() implementation is >

[PATCH V7 7/8] dt-bindings: timer: gx6605s SOC timer

2018-09-30 Thread Guo Ren
- Dt-bindings doc for gx6605s SOC's system timer. Signed-off-by: Guo Ren Reviewed-by: Rob Herring --- .../bindings/timer/csky,gx6605s-timer.txt | 42 ++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/csky,gx6605s

[PATCH V7 4/8] dt-bindings: timer: C-SKY Multi-processor timer

2018-09-30 Thread Guo Ren
Dt-bingdings doc for C-SKY SMP system setting. Changelog: - Drop the interrupt-parent. Signed-off-by: Guo Ren --- .../devicetree/bindings/timer/csky,mptimer.txt | 42 ++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/csky

[PATCH V7 5/8] dt-bindings: interrupt-controller: C-SKY APB intc

2018-09-30 Thread Guo Ren
- Dt-bindings doc about C-SKY apb bus interrupt controller. Signed-off-by: Guo Ren Reviewed-by: Rob Herring --- .../interrupt-controller/csky,apb-intc.txt | 62 ++ 1 file changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt

[PATCH V7 2/8] dt-bindings: interrupt-controller: C-SKY SMP intc

2018-09-30 Thread Guo Ren
Dt-bindings doc about C-SKY Multi-processors interrupt controller. Changelog: - Should be: '#interrupt-cells' not 'interrupt-cells' Signed-off-by: Guo Ren --- .../bindings/interrupt-controller/csky,mpintc.txt | 40 ++ 1 file changed, 40 insertions(+) create mode 100644

[PATCH V7 1/8] irqchip: add C-SKY SMP interrupt controller

2018-09-30 Thread Guo Ren
irq map, reserve soft_irq & private_irq space - Add License and Copyright - Support set_affinity for irq balance in SMP Signed-off-by: Guo Ren --- drivers/irqchip/Kconfig | 8 ++ drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-csky-mpintc.c |

[PATCH V7 8/8] clocksource: add gx6605s SOC system timer

2018-09-30 Thread Guo Ren
Changelog: - Add License and Copyright - Use timer-of framework - Change name with upstream feedback - Use clksource_mmio framework Signed-off-by: Guo Ren --- drivers/clocksource/Kconfig | 8 ++ drivers/clocksource/Makefile| 1 + drivers/clocksource/timer-gx6605s.c | 150

[PATCH V7 6/8] irqchip: add C-SKY APB bus interrupt controller

2018-09-30 Thread Guo Ren
rq-pending - remove CSKY_VECIRQ_LEGENCY - change to generic irq chip framework - add License and Copyright - use irq_domain_add_linear instead of leagcy Signed-off-by: Guo Ren --- drivers/irqchip/Kconfig | 8 ++ drivers/irqchip/Makefile| 1 + drivers/irqchip/irq-c

[PATCH V7 3/8] clocksource: add C-SKY SMP timer

2018-09-30 Thread Guo Ren
. - Coding convention with upstream feed-back. Signed-off-by: Guo Ren --- drivers/clocksource/Kconfig| 8 ++ drivers/clocksource/Makefile | 1 + drivers/clocksource/csky_mptimer.c | 176 + include/linux/cpuhotplug.h | 1 + 4 files changed

Re: [PATCH V7 3/8] clocksource: add C-SKY SMP timer

2018-09-30 Thread Guo Ren
On Sun, Sep 30, 2018 at 09:22:30PM +0200, Daniel Lezcano wrote: > On 30/09/2018 18:18, Guo Ren wrote: > > This timer is used by SMP system and use mfcr/mtcr instruction > > to access the regs. > > > > Changelog: > > - Remove #define CPUHP_

[PATCH V9 4/8] dt-bindings: timer: C-SKY Multi-processor timer

2018-09-30 Thread Guo Ren
Dt-bingdings doc for C-SKY SMP system setting. Changelog: - Drop the interrupt-parent. Signed-off-by: Guo Ren --- .../devicetree/bindings/timer/csky,mptimer.txt | 42 ++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/csky

[PATCH V9 6/8] irqchip: add C-SKY APB bus interrupt controller

2018-09-30 Thread Guo Ren
rq-pending - remove CSKY_VECIRQ_LEGENCY - change to generic irq chip framework - add License and Copyright - use irq_domain_add_linear instead of leagcy Signed-off-by: Guo Ren --- drivers/irqchip/Kconfig | 8 ++ drivers/irqchip/Makefile| 1 + drivers/irqchip/irq-c

[PATCH V9 1/8] irqchip: add C-SKY SMP interrupt controller

2018-09-30 Thread Guo Ren
irq map, reserve soft_irq & private_irq space - Add License and Copyright - Support set_affinity for irq balance in SMP Signed-off-by: Guo Ren --- drivers/irqchip/Kconfig | 8 ++ drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-csky-mpintc.c |

[PATCH V9 7/8] dt-bindings: timer: gx6605s SOC timer

2018-09-30 Thread Guo Ren
- Dt-bindings doc for gx6605s SOC's system timer. Signed-off-by: Guo Ren Reviewed-by: Rob Herring --- .../bindings/timer/csky,gx6605s-timer.txt | 42 ++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/csky,gx6605s

[PATCH V9 2/8] dt-bindings: interrupt-controller: C-SKY SMP intc

2018-09-30 Thread Guo Ren
Dt-bindings doc about C-SKY Multi-processors interrupt controller. Changelog: - Should be: '#interrupt-cells' not 'interrupt-cells' Signed-off-by: Guo Ren --- .../bindings/interrupt-controller/csky,mpintc.txt | 40 ++ 1 file changed, 40 insertions(+) create mode 100644

[PATCH V9 5/8] dt-bindings: interrupt-controller: C-SKY APB intc

2018-09-30 Thread Guo Ren
- Dt-bindings doc about C-SKY apb bus interrupt controller. Signed-off-by: Guo Ren Reviewed-by: Rob Herring --- .../interrupt-controller/csky,apb-intc.txt | 62 ++ 1 file changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt

[PATCH V9 0/8] C-SKY(csky) Linux Kernel Drivers

2018-09-30 Thread Guo Ren
big now. Any feedback is welcome, thx for all people review my patchset. Best Regards Guo Ren (8): irqchip: add C-SKY SMP interrupt controller dt-bindings: interrupt-controller: C-SKY SMP intc clocksource: add C-SKY SMP timer dt-bindings: timer: C-SKY Multi-processor timer dt-bindings:

[PATCH V9 3/8] clocksource: add C-SKY SMP timer

2018-09-30 Thread Guo Ren
. - Coding convention with upstream feed-back. Signed-off-by: Guo Ren --- drivers/clocksource/Kconfig| 8 ++ drivers/clocksource/Makefile | 1 + drivers/clocksource/csky_mptimer.c | 176 + include/linux/cpuhotplug.h | 1 + 4 files changed

[PATCH V9 8/8] clocksource: add gx6605s SOC system timer

2018-09-30 Thread Guo Ren
Changelog: - Add COMIPLE_TEST in Kconfig - no cast is needed for "struct clock_event_device *ce = dev" - remove: extra space after (u64) - Add License and Copyright - Use timer-of framework - Change name with upstream feedback - Use clksource_mmio framework Signed-off-b

Re: [GIT PULL] csky fixes for v5.1-rc7

2019-04-26 Thread Guo Ren
Re-send when the merge window opens. Ok. Best Regards Guo Ren

Re: [PATCH] riscv: Support non-coherency memory model

2019-04-26 Thread Guo Ren
etc that need write-combining to get > acceptable performance I agree dma_alloc_wc is necessary, and we need add another more attribute bit in PTE: _PAGE_BUF. Perhaps using _PAGE_BUF + _PAGE_CACHE are better then _PAGE_CONHENCY. > - you need to decide what is supposed to happen when there are > multiple conflicting mappings for the same physical address. ^ What's the mulitple confilcing mappings ? Best Regards Guo Ren

Re: [PATCH V2 4/7] irqchip/irq-csky-mpintc: Add triger type and priority

2019-05-10 Thread Guo Ren
Thx Marc, Sorry for late reply: On Mon, Feb 18, 2019 at 02:38:23PM +, Marc Zyngier wrote: > On Mon, 18 Feb 2019 10:04:40 +0800 > guo...@kernel.org wrote: > > > From: Guo Ren > > > > Support 4 triger types: > > - IRQ_TYPE_LEVEL_HIGH > > - IRQ_TYP

Re: [PATCH V2 5/7] dt-bindings: interrupt-controller: Update csky mpintc

2019-05-10 Thread Guo Ren
Thx Marc, On Mon, Feb 18, 2019 at 02:28:45PM +, Marc Zyngier wrote: > On Mon, 18 Feb 2019 10:04:41 +0800 > guo...@kernel.org wrote: > > > From: Guo Ren > > > > Add trigger type and priority setting for csky,mpintc. > > > > Changelog: > > - c

Re: [PATCH V2 4/7] irqchip/irq-csky-mpintc: Add triger type and priority

2019-05-11 Thread Guo Ren
Thx Marc, On Fri, May 10, 2019 at 07:12:18PM +0100, Marc Zyngier wrote: > On Fri, 10 May 2019 09:25:10 +0100, > Guo Ren wrote: > > > > Thx Marc, > > > > Sorry for late reply: > > > > On Mon, Feb 18, 2019 at 02:38:23PM +, Marc Zyngier wrote

Re: [PATCH 1/1] csky: add page fault perf event support

2019-04-19 Thread Guo Ren
Looks good, nice Job, Maomao On Thu, Apr 18, 2019 at 02:20:40PM +0800, Mao Han wrote: > This patch add support for page fault count, major fault count > and minorfault count. Without this patch page faults are not > sampled for perf event. > > Performance counter stats for

Re: [PATCH V5 0/2] csky: perf callchain dwarf support

2019-04-19 Thread Guo Ren
Nice Job, Maomao Signed-off: Guo Ren On Mon, Apr 15, 2019 at 05:17:28PM +0800, Mao Han wrote: > This patch set add perf DWARF unwinding support for C-SKY. > Including user registers/stack dump API, and libdw support. > > CC: Guo Ren > > Changes since v4: > - remove s

Re: [PATCH] riscv: Support non-coherency memory model

2019-04-22 Thread Guo Ren
> > size_t size, > > */ > > void __iomem *ioremap(phys_addr_t offset, unsigned long size) > > { > > - return __ioremap_caller(offset, size, PAGE_KERNEL, > > + return __ioremap_caller(offset, size, PAGE_KERNEL_COHERENCY, > > __builtin_return_address(0)); > > } > > EXPORT_SYMBOL(ioremap); > > I think ioremap is a different story, and should be a separate patch. Ok Best Regards Guo Ren

Re: [PATCH] riscv: Support non-coherency memory model

2019-04-23 Thread Guo Ren
On Tue, Apr 23, 2019 at 07:55:48AM +0200, Christoph Hellwig wrote: > On Tue, Apr 23, 2019 at 08:13:48AM +0800, Guo Ren wrote: > > > We should probably start a working group for this ASAP unless we can > > > get another working group to help taking care of it. > >

Re: [PATCH] riscv: Support non-coherency memory model

2019-04-23 Thread Guo Ren
very different, but there are only 10 attribute-bits for riscv (In fact we've wasted two bits to support huge RV32-pfn :P). So I think it is time to merge these two bits before hardware supports GLOBAL. Reserve them for future! Best Regards Guo Ren

Re: [PATCH] riscv: Support non-coherency memory model

2019-04-24 Thread Guo Ren
LB translation in hardware and shadow page tables is for stage 2 translation. Shadow page tables care vmid not asid. If hardware don't support H-extension (MMU 2-stages translation), it's hard to accept for virtualization performance. I don't think hypervisor is a real scene for GLOBAL in PTE. Are there other scene for GLOBAL in PTE? Best Regards Guo Ren

Re: [PATCH] riscv: Support non-coherency memory model

2019-04-29 Thread Guo Ren
On Mon, Apr 29, 2019 at 01:11:43PM -0700, Palmer Dabbelt wrote: > On Mon, 22 Apr 2019 08:44:30 PDT (-0700), guo...@kernel.org wrote: > >From: Guo Ren > > > >The current riscv linux implementation requires SOC system to support > >memory coherence between all I/O dev

Re: [PATCH v2 2/2] csky: add support for libdw

2019-04-02 Thread Guo Ren
); \ > + val;\ > +}) > + > + dwarf_regs[0] = REG(R0); > + dwarf_regs[1] = REG(R1); > + dwarf_regs[2] = REG(R2); > + dwarf_regs[3] = REG(R3); > + dwarf_regs[4] = REG(R4); > + dwarf_regs[5] = REG(R5); > + dwarf_regs[6] = REG(R6); > + dwarf_regs[7] = REG(R7); > + dwarf_regs[8] = REG(R8); > + dwarf_regs[9] = REG(R9); > + dwarf_regs[10] = REG(R10); > + dwarf_regs[11] = REG(R11); > + dwarf_regs[12] = REG(R12); > + dwarf_regs[13] = REG(R13); > + dwarf_regs[14] = REG(SP); > + dwarf_regs[15] = REG(LR); > + dwarf_regs[16] = REG(R16); > + dwarf_regs[17] = REG(R17); > + dwarf_regs[18] = REG(R18); > + dwarf_regs[19] = REG(R19); > + dwarf_regs[20] = REG(R20); > + dwarf_regs[21] = REG(R21); > + dwarf_regs[22] = REG(R22); > + dwarf_regs[23] = REG(R23); > + dwarf_regs[24] = REG(R24); > + dwarf_regs[25] = REG(R25); > + dwarf_regs[26] = REG(R26); > + dwarf_regs[27] = REG(R27); > + dwarf_regs[28] = REG(R28); > + dwarf_regs[29] = REG(R29); > + dwarf_regs[30] = REG(R30); > + dwarf_regs[31] = REG(TLS); > + dwarf_regs[32] = REG(PC); > + dwfl_thread_state_register_pc(thread, dwarf_regs[32]); > + > + return dwfl_thread_state_registers(thread, 0, PERF_REG_CSKY_MAX, > +dwarf_regs); > +} Try LIBUNWIND__ARCH_REG_ID, see: tools/perf/arch/arm64/util/unwind-libunwind.c Best Regards Guo Ren

Re: [PATCH v2] RISC-V: Implement ASID allocator

2019-04-08 Thread Guo Ren
SATP CSR > are not implemented on SiFive Unleashed board so we don't see any change > in performance. Can you tell me what is the test case ? Best Regards Guo Ren

Re: [PATCH] riscv: fix syscall_get_arguments() and syscall_set_arguments()

2019-03-29 Thread Guo Ren
oo. > > Yes of course. I mentioned both of these fixes in my reply to Linus. The BUG is from this commit before upstream: https://github.com/c-sky/csky-linux/commit/b167422869e6a76b31bda639413efa2ba7e60432#diff-cdc97efef2ab02d6828fa545698f9311 I reference the riscv code without my mind, thx for all. Best Regards Guo Ren

Re: [PATCH] csky: fix syscall_get_arguments() and syscall_set_arguments()

2019-03-29 Thread Guo Ren
Thx Dmitry, It works for me. Tested-by: Guo Ren Acked-by: Guo Ren On Fri, Mar 29, 2019 at 08:12:30PM +0300, Dmitry V. Levin wrote: > C-SKY syscall arguments are located in orig_a0,a1,a2,a3,regs[0],regs[1] > fields of struct pt_regs. > > Due to an off-by-one bug and a bu

<    4   5   6   7   8   9   10   11   12   13   >