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

2018-07-12 Thread Guo Ren
On Wed, Jul 11, 2018 at 10:51:33AM +0100, David Howells wrote: > Can you say what the --target tuple should be so that I can add the arch to my > collection of Fedora cross-binutils and cross-gcc tools built from upstream > binutils and gcc sources? Metor Graghics are helping us upstream gcc and bi

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

2018-07-12 Thread Guo Ren
On Thu, Jul 12, 2018 at 10:04:10AM -0600, Sandra Loosemore wrote: > On 07/12/2018 06:51 AM, Guo Ren wrote: > >On Wed, Jul 11, 2018 at 10:51:33AM +0100, David Howells wrote: > >>Can you say what the --target tuple should be so that I can add the arch to > >>my >

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

2018-03-26 Thread Guo Ren
d to > contain only the minimum required additions to the asm-generic version. > > Changing the ABI will obviously get in the way of testing, but this should > be over as soon as the port is merged. I entirely agree with you. After modify the unistd.h, we found a lot of ltp-cases failed. We are dealing with them. Best Regards Guo Ren

Re: [PATCH 17/19] csky: defconfig

2018-03-26 Thread Guo Ren
CKLIGHT_CLASS_DEVICE is not set > > +# CONFIG_VGA_CONSOLE is not set > > +CONFIG_FRAMEBUFFER_CONSOLE=y > > +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y > > +CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y > > +CONFIG_LOGO=y > > +# CONFIG_LOGO_LINUX_MONO is not set > > +# CONFIG_LOGO_LINUX_VGA16 is not set > > For new platforms, using the DRM subsystem is the recommend > way to do graphics, it mostly replaces the framebuffer subsystem > here. These used by: https://github.com/c-sky/addons-linux/tree/master/addons/drivers/video/fbdev/nationalchip I'll consider the DRM subsystem. > > +CONFIG_STE_MODEM_RPROC=m > > I think this is no longer there. Yes, remove it. > > +CONFIG_EXT2_FS=y > > +CONFIG_EXT2_FS_XATTR=y > > +CONFIG_EXT2_FS_POSIX_ACL=y > > +CONFIG_EXT2_FS_SECURITY=y > > +CONFIG_EXT3_FS=y > > +CONFIG_EXT3_FS_POSIX_ACL=y > > +CONFIG_EXT3_FS_SECURITY=y > > Better use EXT4 for the defconfig instead. OK. Best Regards Guo Ren

Re: [PATCH 15/19] csky: Build infrastructure

2018-03-26 Thread Guo Ren
k. Just make sure that the DT always has this information as well, > so this can be changed in the future when desired, without having to > make incompatible changes to the devicetree binary files. Ok Best Regards Guo Ren

Re: [PATCH 10/19] csky: Signal handling

2018-03-26 Thread Guo Ren
On Mon, Mar 26, 2018 at 03:04:01PM +0200, Arnd Bergmann wrote: > On Sun, Mar 18, 2018 at 8:51 PM, Guo Ren wrote: > > Signed-off-by: Guo Ren > > --- > > arch/csky/include/uapi/asm/sigcontext.h | 33 +++ > > arch/csky/include/uapi/asm/signal.h | 164 +

Re: [PATCH 06/19] csky: IRQ handling

2018-03-19 Thread Guo Ren
explanation are bad. Yes, you are right. I will fixup them next. PSR is our Processor Status Register and it store the vector number. '10' is our auto-interrupt exception entry and we need get the irqno from the interrupt-controller. The "vector num > 32" is our vector interrupt exception entries, so we can calculate the irq-num by vector-num and no need to access the interrupt-controller's io regs. Best Regards Guo Ren

Re: [PATCH 14/19] csky: Misc headers

2018-03-19 Thread Guo Ren
Hi Arnd, On Tue, Mar 20, 2018 at 12:11:24AM +0800, Arnd Bergmann wrote: > On Mon, Mar 19, 2018 at 3:51 AM, Guo Ren wrote: > > +++ b/arch/csky/include/uapi/asm/fcntl.h > > @@ -0,0 +1,13 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +// Copyright (C) 2018 Hangzhou

Re: [PATCH 15/19] csky: Build infrastructure

2018-03-20 Thread Guo Ren
will mask some warnings :P, and I will remove it. > -fno-tree-dse? This is from "gcc-4.5 compile linux-4.7" and it will cause wrong code without -fno-tree-dse for list.h. Now we use gcc-6.3, so I will try to remove it. > > +++ b/arch/csky/abiv1/Makefile > > @@ -0,0 +1,8 @@ > > +obj-y += src/bswapdi.o > > +obj-y += src/bswapsi.o > > +obj-y += src/cacheflush.o > > +obj-y += src/memcpy.o > > +obj-y += src/mmap.o > > + > > +obj-$(CONFIG_CPU_NEED_SOFTALIGN) +=src/alignment.o > > Better not use subdirectories like that. Ok, I will change them like this: obj-y += bswapdi.o obj-y += bswapsi.o ... > Can you explain why you need the alignement fixups? For abiv1 ck610 couldn't handle the unalignment address access, so we need soft-alignment exception to fixup. There is no problem in abiv2 cpus. Best Regards Guo Ren

Re: [PATCH 14/19] csky: Misc headers

2018-03-20 Thread Guo Ren
On Tue, Mar 20, 2018 at 03:54:53PM +0800, Arnd Bergmann wrote: > We generally assume that any upstream kernel ABI cannot be changed, so this > has to be changed before the code gets merged upstream. > > You can obviously maintain the old and the new ABI in parallel for a while, > until the libc su

Re: [PATCH 16/19] csky: Device tree

2018-03-20 Thread Guo Ren
ng. Ok, I will add them. > > + ohci0: ohci-hcd0 { > The names here should be "usb@...", not "ehci-hcd" Ok > > + chosen { > > + bootargs = "console=ttyS0,115200 rdinit=/sbin/init > > root=/dev/ram0"; > > + }; > > The bootargs should not be in the dts file normally, they should come from the > boot loader. I want to keep bootargs in dts, because the bootloader only pass the dtb to kernel. > For the console, use the "stdout-path" property. Ok Best Regards Guo Ren

Re: [PATCH 19/19] irqchip: add irq-nationalchip.c and irq-csky.c

2018-03-20 Thread Guo Ren
> > + "ff1 %0\n" > > + :"=r"(lo) > > + :"r"(lo) > > + : > > + ); > > So you want to decode the interrupt number from a bitfield. What's wrong > with ffs()? There is no wrong with ffs(). Ok, I will use the ffs(). > > + if( lo != 32 ) > > + result = 31-lo; > > Why is this subtracted? ff1 find from high bit, so we need reverse it to get the right num. > That code makes no sense w/o comments. Sorry, I will add. > > + else if( hi != 32 ) result = 31-hi + 32; > > + else { > > + printk("nc_get_irqno error hi:%x, lo:%x.\n", hi, lo); > > + result = NR_IRQS; > > + } > > Pleas use braces consistently. Ok > > +unsigned int nc_get_irqno(void) > > static? Yes > Same comments as for the other variant. Ok Best Regards Guo Ren

Re: [PATCH 15/19] csky: Build infrastructure

2018-03-21 Thread Guo Ren
need the alignement fixups? > > For abiv1 ck610 couldn't handle the unalignment address access, so we > > need soft-alignment exception to fixup. There is no problem in abiv2 cpus. > > Ok. Generally speaking, architectures that don't allow unaligned access > should have all code built in a way that uses aligned access (gcc normally > falls back to byte access when it encounters an unaligned pointer at > compile time), but if this is just for old CPUs that are not used in future > products, having the fixup does sound simpler, as it allows you to still > run new binaries on the old machines. I haven't looked at the implementation > for the fixup here, but I remember the same thing from the nds32 port. > In that case, we ended up keeping the fixup as an option for old > user space, but disabled to softalign fixups for kernel code. Can you do > the same thing here? Ok. I got it, I'll do the same as nds32. Best Regards Guo Ren

Re: [PATCH] csky: fixups after bootmem removal

2018-09-26 Thread Guo Ren
ky/mm/init.c b/arch/csky/mm/init.c > index fd2791b..46c5aaa 100644 > --- a/arch/csky/mm/init.c > +++ b/arch/csky/mm/init.c > @@ -14,7 +14,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -44,7 +43,7 @@ void __init mem_init(void) > #endif > high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); > > - free_all_bootmem(); > + memblock_free_all(); > > #ifdef CONFIG_HIGHMEM > for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) { The patch looks good for me. Thx Guo Ren

Re: [PATCH V5 17/30] csky: Misc headers

2018-09-26 Thread Guo Ren
; > +static inline void change_bit(int nr, volatile unsigned long *addr) > > > +{ > > > + unsigned long mask = BIT_MASK(nr); > > > + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); > > > + unsigned long tmp; > > > + > > > + /* *p ^= mask; */ > > > + smp_mb(); > > > + asm volatile ( > > > + "1: ldex.w %0, (%2)\n" > > > + " xor32 %0, %0, %1 \n" > > > + " stex.w %0, (%2)\n" > > > + " bez %0, 1b \n" > > > + : "=&r"(tmp) > > > + : "r"(mask), "r"(p) > > > + : "memory"); > > > + smp_mb(); > > > +} > > > > The {set,clear,change}_bit() operations don't have to be ordered: you > > might want to remove the above smp_mb()s (and adjust the comments). I confused it with cmpxchg, seems cmpxchg need smp_mb() before&after. See: https://lkml.org/lkml/2018/7/6/383 > Better yet, you can entirely delete all that and use > asm-generic/bitops/atomic.h instead. Yes, approve. Seems I only need care about asm/atomic.h, it's good for me. Best Regards Guo Ren

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

2018-09-26 Thread Guo Ren
On Tue, Sep 25, 2018 at 09:24:07AM +0200, Peter Zijlstra wrote: > On Mon, Sep 24, 2018 at 10:36:22PM +0800, Guo Ren wrote: > > diff --git a/arch/csky/abiv1/inc/abi/cacheflush.h > > b/arch/csky/abiv1/inc/abi/cacheflush.h > > new file mode 100644 > > index 000

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

2018-09-27 Thread Guo Ren
On Thu, Sep 27, 2018 at 09:08:59AM +0200, Peter Zijlstra wrote: > On Thu, Sep 27, 2018 at 01:27:38PM +0800, Guo Ren wrote: > > On Tue, Sep 25, 2018 at 09:24:07AM +0200, Peter Zijlstra wrote: > > > On Mon, Sep 24, 2018 at 10:36:22PM +0800, Guo Ren wrote: > > > > diff -

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

2018-09-27 Thread Guo Ren
On Thu, Sep 27, 2018 at 11:01:34AM +0200, Peter Zijlstra wrote: > On Thu, Sep 27, 2018 at 04:11:42PM +0800, Guo Ren wrote: > > On Thu, Sep 27, 2018 at 09:08:59AM +0200, Peter Zijlstra wrote: > > > > That's not what I meant; I meant you need something like: > > &g

Re: [PATCH] csky: fixups after bootmem removal

2018-09-27 Thread Guo Ren
t/?id=bc3ec75de5452db59b683487867ba562b950708a Thx! Guo Ren On Wed, Sep 26, 2018 at 02:27:45PM +0300, Mike Rapoport wrote: > Hi, > > The below patch fixes the bootmem leftovers in csky. It is based on the > current mmots and csky build there fails because of undefined reference to > dma_direct_ops: > >

[PATCH V6 02/33] csky: defconfig

2018-09-27 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 V6 01/33] csky: Build infrastructure

2018-09-27 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 V6 00/33] C-SKY(csky) Linux Kernel Port

2018-09-27 Thread Guo Ren
() in asm/reg_ops.h bdcd8f3 csky: revert back Kconfig select. 590c7e6 csky: bugfix compile error with CONFIG_AUDIT 1989292 csky: revert some back with cleanup unistd.h f1454fe csky: cleanup unistd.h 5d2985f csky: cleanup Kconfig and Makefile. 423d97e csky: cancel subdirectories cae2af4 csky: use

[PATCH V6 03/33] csky: Kernel booting

2018-09-27 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

[PATCH V6 06/33] csky: Cache and TLB routines

2018-09-27 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 V6 05/33] csky: System Call

2018-09-27 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 V6 08/33] csky: Process management and Signal

2018-09-27 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 V6 07/33] csky: MMU and page table management

2018-09-27 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

[PATCH V6 09/33] csky: VDSO and rt_sigreturn

2018-09-27 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 V6 04/33] csky: Exception handling and mm-fault

2018-09-27 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 V6 11/33] csky: Atomic operations

2018-09-27 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 V6 12/33] csky: ELF and module probe

2018-09-27 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 V6 15/33] csky: Debug and Ptrace GDB

2018-09-27 Thread Guo Ren
This patch adds arch ptrace implementation, stack dump and bug.h. Signed-off-by: Guo Ren --- arch/csky/include/asm/bug.h | 26 +++ arch/csky/include/uapi/asm/ptrace.h | 104 arch/csky/kernel/dumpstack.c| 65 arch/csky/kernel/ptrace.c | 318

[PATCH V6 13/33] csky: Library functions

2018-09-27 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 V6 14/33] csky: User access

2018-09-27 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 V6 10/33] csky: IRQ handling

2018-09-27 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 V6 16/33] csky: SMP support

2018-09-27 Thread Guo Ren
This patch adds boot, ipi, hotplug code for SMP. Signed-off-by: Guo Ren --- arch/csky/include/asm/smp.h | 26 + arch/csky/kernel/smp.c | 234 2 files changed, 260 insertions(+) create mode 100644 arch/csky/include/asm/smp.h create mode

[PATCH V6 17/33] csky: Misc headers

2018-09-27 Thread Guo Ren
This patch adds csky register definition, byteorder, asm-offsets codes. Signed-off-by: Guo Ren --- 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 ++ arch/csky/abiv2/inc/abi/regdef.h | 26

[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
apping 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/

[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
atomic.h:7, 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 fi

[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,gx

[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 R

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
gned 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
; ~PAGE_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
RT && 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 syscall_t

[PATCH 1/2] csky: bugfix tlb_get_pgd error.

2018-11-21 Thread Guo Ren
. It's wrong and should be 0xa000. Now correct it to: return ((get_pgd() - PHYS_OFFSET) & ~1) + PAGE_OFFSET; Signed-off-by: Guo Ren --- arch/csky/include/asm/mmu_context.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/csky/include/asm/mmu_conte

[GIT PULL] C-SKY update for 4.20-rc6

2018-12-05 Thread Guo Ren
Hi Linus, Please pull. Best Regards Guo Ren --> The following changes since commit 651022382c7f8da46cb4872a545ee1da6d097d2a: Linux 4.20-rc1 (2018-11-04 15:37:52 -0800) are available in the git repository at: g...@github.com:c-sky/csky-linux.

[PATCH V2 07/19] csky: MMU and page table management

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/ckmmu.h| 80 + arch/csky/abiv1/inc/abi/page.h | 26 +++ arch/csky/abiv1/inc/abi/pgtable-bits.h | 36 arch/csky/abiv1/mmap.c | 65 +++ arch/csky/abiv2/inc/abi/ckmmu.h| 88

[PATCH V2 11/19] csky: Atomic operations

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/asm/cmpxchg.h| 68 + arch/csky/include/asm/spinlock.h | 174 + arch/csky/include/asm/spinlock_types.h | 20 arch/csky/kernel/atomic.S | 87 + 4 files

[PATCH V2 16/19] csky: SMP support

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/asm/smp.h | 26 + arch/csky/kernel/smp.c | 256 2 files changed, 282 insertions(+) create mode 100644 arch/csky/include/asm/smp.h create mode 100644 arch/csky/kernel/smp.c diff --git a/arch

[PATCH V2 05/19] csky: System Call

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/asm/syscall.h | 69 + arch/csky/include/asm/syscalls.h| 14 arch/csky/include/uapi/asm/unistd.h | 63 + arch/csky/kernel/syscall.c | 63

[PATCH V2 03/19] csky: Kernel booting

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/kernel/head.S| 81 ++ arch/csky/kernel/setup.c | 148 + arch/csky/kernel/vmlinux.lds.S | 65 ++ 3 files changed, 294 insertions(+) create mode 100644 arch/csky/kernel

[PATCH V2 15/19] csky: Debug and Ptrace GDB

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/uapi/asm/ptrace.h | 105 + arch/csky/kernel/dumpstack.c| 65 arch/csky/kernel/ptrace.c | 288 3 files changed, 458 insertions(+) create mode 100644 arch/csky/include/uapi

[PATCH V2 12/19] csky: ELF and module probe

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/asm/elf.h | 149 arch/csky/kernel/module.c | 82 2 files changed, 231 insertions(+) create mode 100644 arch/csky/include/asm/elf.h create mode 100644 arch/csky/kernel/module.c

[PATCH V2 17/19] csky: Misc headers

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/reg_ops.h | 47 ++ arch/csky/abiv1/inc/abi/regdef.h | 15 ++ arch/csky/abiv2/inc/abi/reg_ops.h | 38 + arch/csky/abiv2/inc/abi/regdef.h | 15 ++ arch/csky/include/asm/bitops.h | 277

[PATCH V2 13/19] csky: Library functions

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/bswapdi.c | 18 +++ arch/csky/abiv1/bswapsi.c | 15 ++ arch/csky/abiv1/memcpy.S | 344 + arch/csky/abiv2/memcpy.c | 43 ++ arch/csky/include/asm/string.h | 19 +++ arch/csky/kernel

[PATCH V2 10/19] csky: IRQ handling

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/asm/irq.h | 10 arch/csky/include/asm/irqflags.h | 49 arch/csky/kernel/irq.c | 31 + 3 files changed, 90 insertions(+) create mode 100644 arch/csky/include/asm

[PATCH V2 18/19] clocksource: add C-SKY clocksource drivers

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-csky-v1.c | 169 +++ drivers/clocksource/timer-nationalchip.c | 165 ++ 3 files changed, 335 insertions(+) create mode 100644

[PATCH V2 02/19] csky: defconfig

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/configs/gx66xx_defconfig | 549 + arch/csky/configs/qemu_ck807_defconfig | 541 2 files changed, 1090 insertions(+) create mode 100644 arch/csky/configs/gx66xx_defconfig create mode 100644

[PATCH V2 06/19] csky: Cache and TLB routines

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/cacheflush.c | 51 + arch/csky/abiv1/inc/abi/cacheflush.h | 42 +++ arch/csky/abiv1/inc/abi/tlb.h | 11 ++ arch/csky/abiv2/cacheflush.c | 55 + arch/csky/abiv2/inc/abi/cacheflush.h | 38 ++ arch

[PATCH V2 19/19] irqchip: add C-SKY irqchip drivers

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-csky-v1.c | 126 drivers/irqchip/irq-csky-v2.c | 191 + drivers/irqchip/irq-nationalchip.c | 131 + 4 files

[PATCH V2 04/19] csky: Exception handling

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/alignment.c | 332 arch/csky/abiv1/inc/abi/entry.h | 152 +++ arch/csky/abiv2/inc/abi/entry.h | 149 +++ arch/csky/include/asm/traps.h | 39 arch/csky/include/asm/unistd.h | 4

[PATCH V2 14/19] csky: User access

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/asm/uaccess.h | 397 arch/csky/lib/usercopy.c| 271 +++ 2 files changed, 668 insertions(+) create mode 100644 arch/csky/include/asm/uaccess.h create mode 100644 arch/csky/lib

[PATCH V2 00/19] C-SKY(csky) Linux Kernel Port

2018-07-01 Thread Guo Ren
sky: revert some back with cleanup unistd.h f1454fe csky: cleanup unistd.h 5d2985f csky: cleanup Kconfig and Makefile. 423d97e csky: cancel subdirectories cae2af4 csky: use asm-generic/fcntl.h Guo Ren (19): csky: Build infrastructure csky: defconfig csky: Kernel booting csky: Exception handling

[PATCH V2 09/19] csky: VDSO and rt_sigreturn

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/vdso.h | 17 arch/csky/abiv2/inc/abi/vdso.h | 18 + arch/csky/include/asm/vdso.h | 12 ++ arch/csky/kernel/vdso.c| 89 ++ 4 files changed, 136 insertions(+) create mode

[PATCH V2 01/19] csky: Build infrastructure

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/Kconfig | 211 + arch/csky/Kconfig.debug| 29 + arch/csky/Makefile | 92 ++ arch/csky/abiv1/Makefile | 8 ++ arch/csky/abiv2/Makefile

[PATCH V2 08/19] csky: Process management and Signal

2018-07-01 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv2/fpu.c | 242 ++ arch/csky/abiv2/inc/abi/fpu.h | 219 arch/csky/include/asm/mmu_context.h | 158 ++ arch/csky/include/asm/processor.h | 123 +++ arch/csky

Re: [PATCH V2 01/19] csky: Build infrastructure

2018-07-01 Thread Guo Ren
Hi Randy, On Sun, Jul 01, 2018 at 02:01:52PM -0700, Randy Dunlap wrote: > Hi, > Just a few comments... > Thx for your review. I'll fixup all of you mentioned and self-check again. Guo Ren

Re: [PATCH V2 07/19] csky: MMU and page table management

2018-07-02 Thread Guo Ren
ic, dma_atomic ... Pkmap: 0xff80 – 0xffc0 (4 MB)PTR_PER_PTE = 1024 Vmalloc : 0xf020 – 0xff00 (238 MB) max: 238MB + 256MB + 1GB Lowmem : 0x8000 – 0xf0000000 (1G + 768 MB) Guo Ren

Re: [PATCH V2 19/19] irqchip: add C-SKY irqchip drivers

2018-07-03 Thread Guo Ren
On Mon, Jul 02, 2018 at 09:27:13PM -0600, Rob Herring wrote: > Commit message needed. Ok > Do you mean "legacy"? Yes, it's from arch/csky/Kconfig.debug, and I'll correct it in next version patch. > It would be better to make this run-time so you can support multiple > platforms in one build. You

Re: [PATCH V2 02/19] csky: defconfig

2018-07-03 Thread Guo Ren
l have lots of options enabled that I wouldn't > expect you to need. Start with something more minimal for what you > need to boot and support upstream. Ok, I'll clean them up in next version patch. > For a full config, you can use allmodconfig at least to build test. Thx for the tip. Guo Ren

Re: [PATCH V2 01/19] csky: Build infrastructure

2018-07-03 Thread Guo Ren
cific option. We want the BUILTIN_DTB for some boards and they don't need change dtb at all. And I just follow other archs BUILTIN_DTB in their Kconfig. eg: xtensa, h8300, mips, nds32, sh, openrisc, arc ... I just keep this in Kconfig.debug and it's not a recommended method. Guo Ren

Re: [PATCH V2 16/19] csky: SMP support

2018-07-06 Thread Guo Ren
are available. > > You probably also want a mapping from Linux logical CPU id to your > physical CPU id, and a sanity check on this. See arm64 for an example. Yes, you are right. Reg property could determine which bit of CPU in cr<0, 29> could be booted. Thx for the tips. Guo Ren

Re: [PATCH V2 11/19] csky: Atomic operations

2018-07-07 Thread Guo Ren
CPU1 > > r1 = READ_ONCE(x); WRITE_ONCE(y, 1); > r2 = xchg(&y, 2); smp_store_release(&x, 1); > > must not allow: r1==1 && r2==0 CPU1 smp_store_release could be finished before WRITE_ONCE, so r1=1 && r2=0? > > > The above implementation suggests LDEX implies a SYNC.IS, is this > > > correct? > > No, ldex doesn't imply a sync.is. > > Right, as per the spinlock emails, then your proposed primitives are > incorrect. Yes, approve. Guo Ren

Re: [PATCH V2 11/19] csky: Atomic operations

2018-07-07 Thread Guo Ren
; > (and you can replace the smp_mb(); r = READ_ONCE(); with r = xchg() to > again see why you need that first smp_mb()). CPU0CPU1 WRITE_ONCE(x, 1) WRITE_ONCE(y, 1) r0 = xchg(&y, 2)r1 = xchg(&x, 2) must not allow: r0==0 && r1==0 So we must add a smp_mb between WRITE_ONCE() and xchg(), right? Guo Ren

Re: [PATCH V2 06/19] csky: Cache and TLB routines

2018-07-07 Thread Guo Ren
On Thu, Jul 05, 2018 at 07:40:25PM +0200, Peter Zijlstra wrote: > > +#ifdef CONFIG_SMP > > +#define mb() asm volatile ("sync.is":::"memory") > > +#else > > +#define mb() asm volatile ("sync":::"memory") > > +#endif > > This is very suspect, please elaborate. > > What I would've expect

Re: [PATCH V2 11/19] csky: Atomic operations

2018-07-07 Thread Guo Ren
On Sat, Jul 07, 2018 at 09:54:37PM +0200, Andrea Parri wrote: > Hi Guo, > > On Sat, Jul 07, 2018 at 03:42:10PM +0800, Guo Ren wrote: > > On Fri, Jul 06, 2018 at 01:56:14PM +0200, Peter Zijlstra wrote: > > > CPU0CPU1 > > > > > >

  1   2   3   4   5   6   7   8   >