Re: [PATCH V3 18/26] dt-bindings: csky CPU Bindings

2018-09-05 Thread Guo Ren
On Wed, Sep 05, 2018 at 07:37:50PM -0500, Rob Herring wrote: > On Wed, Sep 5, 2018 at 7:08 AM Guo Ren wrote: > > > > Signed-off-by: Guo Ren > > --- > > Documentation/devicetree/bindings/csky/cpus.txt | 70 > > + > > 1 file cha

[PATCH V3 07/26] csky: MMU and page table management

2018-09-05 Thread Guo Ren
: 0xf020 – 0xff00 (238 MB) Lowmem : 0x8000 – 0xc000 (1GB) Lowmem is directly mapped by msa0 & msa1 reg, and we needn't setup page-table for it. Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/ckmmu.h| 74 arch/csky/abiv1/inc/abi/pa

[PATCH V3 07/26] csky: MMU and page table management

2018-09-05 Thread Guo Ren
: 0xf020 – 0xff00 (238 MB) Lowmem : 0x8000 – 0xc000 (1GB) Lowmem is directly mapped by msa0 & msa1 reg, and we needn't setup page-table for it. Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/ckmmu.h| 74 arch/csky/abiv1/inc/abi/pa

[PATCH V3 06/26] csky: Cache and TLB routines

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/cacheflush.c | 50 arch/csky/abiv1/inc/abi/cacheflush.h | 41 +++ arch/csky/abiv1/inc/abi/tlb.h | 11 ++ arch/csky/abiv2/cacheflush.c | 54 + arch/csky/abiv2/inc/abi/cacheflush.h | 38 ++ arch

[PATCH V3 06/26] csky: Cache and TLB routines

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/cacheflush.c | 50 arch/csky/abiv1/inc/abi/cacheflush.h | 41 +++ arch/csky/abiv1/inc/abi/tlb.h | 11 ++ arch/csky/abiv2/cacheflush.c | 54 + arch/csky/abiv2/inc/abi/cacheflush.h | 38 ++ arch

[PATCH V3 21/26] dt-bindings: interrupt-controller: C-SKY APB intc

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- .../interrupt-controller/csky,apb-intc.txt | 45 ++ 1 file changed, 45 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/csky,apb-intc.txt diff --git a/Documentation/devicetree/bindings/interrupt

[PATCH V3 21/26] dt-bindings: interrupt-controller: C-SKY APB intc

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- .../interrupt-controller/csky,apb-intc.txt | 45 ++ 1 file changed, 45 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/csky,apb-intc.txt diff --git a/Documentation/devicetree/bindings/interrupt

[PATCH V3 23/26] clocksource: add gx6605s SOC system timer

2018-09-05 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/timer-gx6605s.c | 150 1 file changed, 150 insertions(+) create mode

[PATCH V3 10/26] csky: IRQ handling

2018-09-05 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 V3 04/26] csky: Exception handling

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/alignment.c | 331 + arch/csky/abiv1/inc/abi/entry.h | 159 arch/csky/abiv2/inc/abi/entry.h | 157 arch/csky/include/asm/traps.h | 39 arch/csky/include/asm/unistd.h | 3

[PATCH V3 13/26] csky: Library functions

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/bswapdi.c| 18 ++ arch/csky/abiv1/bswapsi.c| 14 ++ arch/csky/abiv1/inc/abi/string.h | 13 ++ arch/csky/abiv1/memcpy.S | 344 +++ arch/csky/abiv1/memset.c | 38 + arch/csky

[PATCH V3 23/26] clocksource: add gx6605s SOC system timer

2018-09-05 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/timer-gx6605s.c | 150 1 file changed, 150 insertions(+) create mode

[PATCH V3 10/26] csky: IRQ handling

2018-09-05 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 V3 04/26] csky: Exception handling

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/alignment.c | 331 + arch/csky/abiv1/inc/abi/entry.h | 159 arch/csky/abiv2/inc/abi/entry.h | 157 arch/csky/include/asm/traps.h | 39 arch/csky/include/asm/unistd.h | 3

[PATCH V3 13/26] csky: Library functions

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/bswapdi.c| 18 ++ arch/csky/abiv1/bswapsi.c| 14 ++ arch/csky/abiv1/inc/abi/string.h | 13 ++ arch/csky/abiv1/memcpy.S | 344 +++ arch/csky/abiv1/memset.c | 38 + arch/csky

[PATCH V3 17/26] csky: Misc headers

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/reg_ops.h | 26 +++ arch/csky/abiv1/inc/abi/regdef.h | 25 +++ arch/csky/abiv2/inc/abi/reg_ops.h | 17 ++ arch/csky/abiv2/inc/abi/regdef.h | 26 +++ arch/csky/boot/dts/qemu.dts| 77 + arch/csky

[PATCH V3 05/26] csky: System Call

2018-09-05 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 | 10 ++ arch/csky/kernel/syscall.c | 63 + arch/csky

[PATCH V3 17/26] csky: Misc headers

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/reg_ops.h | 26 +++ arch/csky/abiv1/inc/abi/regdef.h | 25 +++ arch/csky/abiv2/inc/abi/reg_ops.h | 17 ++ arch/csky/abiv2/inc/abi/regdef.h | 26 +++ arch/csky/boot/dts/qemu.dts| 77 + arch/csky

[PATCH V3 05/26] csky: System Call

2018-09-05 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 | 10 ++ arch/csky/kernel/syscall.c | 63 + arch/csky

[PATCH V3 11/26] csky: Atomic operations

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/asm/atomic.h | 215 + arch/csky/include/asm/cmpxchg.h| 70 arch/csky/include/asm/spinlock.h | 286 + arch/csky/include/asm/spinlock_types.h | 35 arch/csky

[PATCH V3 15/26] csky: Debug and Ptrace GDB

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/asm/bug.h | 26 +++ arch/csky/include/uapi/asm/ptrace.h | 103 arch/csky/kernel/dumpstack.c| 64 arch/csky/kernel/ptrace.c | 317 4 files changed, 510 insertions

[PATCH V3 11/26] csky: Atomic operations

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/asm/atomic.h | 215 + arch/csky/include/asm/cmpxchg.h| 70 arch/csky/include/asm/spinlock.h | 286 + arch/csky/include/asm/spinlock_types.h | 35 arch/csky

[PATCH V3 15/26] csky: Debug and Ptrace GDB

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/asm/bug.h | 26 +++ arch/csky/include/uapi/asm/ptrace.h | 103 arch/csky/kernel/dumpstack.c| 64 arch/csky/kernel/ptrace.c | 317 4 files changed, 510 insertions

[PATCH V3 14/26] csky: User access

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

[PATCH V3 20/26] dt-bindings: timer: C-SKY Multi-processor timer

2018-09-05 Thread Guo Ren
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/devicetree/bindings/timer/csky,mptimer.txt b

[PATCH V3 14/26] csky: User access

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

[PATCH V3 20/26] dt-bindings: timer: C-SKY Multi-processor timer

2018-09-05 Thread Guo Ren
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/devicetree/bindings/timer/csky,mptimer.txt b

[PATCH V3 00/26] C-SKY(csky) Linux Kernel Port

2018-09-05 Thread Guo Ren
k 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 asm-generic/fcntl.h Guo Ren (26): csky: Build i

[PATCH V3 12/26] csky: ELF and module probe

2018-09-05 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 V3 22/26] dt-bindings: interrupt-controller: C-SKY SMP intc

2018-09-05 Thread Guo Ren
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,mpintc.txt diff --git a/Documentation/devicetree/bindings/interrupt

[PATCH V3 12/26] csky: ELF and module probe

2018-09-05 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 V3 22/26] dt-bindings: interrupt-controller: C-SKY SMP intc

2018-09-05 Thread Guo Ren
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,mpintc.txt diff --git a/Documentation/devicetree/bindings/interrupt

[PATCH V3 00/26] C-SKY(csky) Linux Kernel Port

2018-09-05 Thread Guo Ren
k 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 asm-generic/fcntl.h Guo Ren (26): csky: Build i

[PATCH V3 19/26] dt-bindings: timer: gx6605s SOC timer

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- .../bindings/timer/csky,gx6605s-timer.txt | 46 ++ 1 file changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/csky,gx6605s-timer.txt diff --git a/Documentation/devicetree/bindings/timer/csky,gx6605s

[PATCH V3 26/26] irqchip: add C-SKY irqchip drivers

2018-09-05 Thread Guo Ren
instead of leagcy. - add set_handle_irq(), ref from openrisc & arm. Signed-off-by: Guo Ren --- drivers/irqchip/Makefile| 1 + drivers/irqchip/irq-csky-apb-intc.c | 243 drivers/irqchip/irq-csky-mpintc.c | 191 +++

[PATCH V3 25/26] clocksource: add C-SKY timers' build infrastructure

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- drivers/clocksource/Kconfig | 15 +++ drivers/clocksource/Makefile | 2 ++ 2 files changed, 17 insertions(+) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index dec0dd8..6ff0a25 100644 --- a/drivers/clocksource/Kconfig +++ b

[PATCH V3 19/26] dt-bindings: timer: gx6605s SOC timer

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- .../bindings/timer/csky,gx6605s-timer.txt | 46 ++ 1 file changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/csky,gx6605s-timer.txt diff --git a/Documentation/devicetree/bindings/timer/csky,gx6605s

[PATCH V3 26/26] irqchip: add C-SKY irqchip drivers

2018-09-05 Thread Guo Ren
instead of leagcy. - add set_handle_irq(), ref from openrisc & arm. Signed-off-by: Guo Ren --- drivers/irqchip/Makefile| 1 + drivers/irqchip/irq-csky-apb-intc.c | 243 drivers/irqchip/irq-csky-mpintc.c | 191 +++

[PATCH V3 25/26] clocksource: add C-SKY timers' build infrastructure

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- drivers/clocksource/Kconfig | 15 +++ drivers/clocksource/Makefile | 2 ++ 2 files changed, 17 insertions(+) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index dec0dd8..6ff0a25 100644 --- a/drivers/clocksource/Kconfig +++ b

[PATCH V3 09/26] csky: VDSO and rt_sigreturn

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/vdso.h | 17 arch/csky/abiv2/inc/abi/vdso.h | 24 arch/csky/include/asm/vdso.h | 12 ++ arch/csky/kernel/vdso.c| 88 ++ 4 files changed, 141 insertions(+) create mode

[PATCH V3 09/26] csky: VDSO and rt_sigreturn

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/vdso.h | 17 arch/csky/abiv2/inc/abi/vdso.h | 24 arch/csky/include/asm/vdso.h | 12 ++ arch/csky/kernel/vdso.c| 88 ++ 4 files changed, 141 insertions(+) create mode

[PATCH V3 18/26] dt-bindings: csky CPU Bindings

2018-09-05 Thread Guo Ren
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 diff --git a/Documentation/devicetree/bindings/csky/cpus.txt b/Documentation

[PATCH V3 01/26] csky: Build infrastructure

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/Kconfig | 230 + arch/csky/Kconfig.debug| 14 ++ arch/csky/Makefile | 93 + arch/csky/abiv1/Makefile | 8 ++ arch/csky/abiv2/Makefile

[PATCH V3 03/26] csky: Kernel booting

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/kernel/head.S| 78 + arch/csky/kernel/setup.c | 150 + arch/csky/kernel/vmlinux.lds.S | 64 ++ 3 files changed, 292 insertions(+) create mode 100644 arch/csky/kernel

[PATCH V3 18/26] dt-bindings: csky CPU Bindings

2018-09-05 Thread Guo Ren
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 diff --git a/Documentation/devicetree/bindings/csky/cpus.txt b/Documentation

[PATCH V3 01/26] csky: Build infrastructure

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/Kconfig | 230 + arch/csky/Kconfig.debug| 14 ++ arch/csky/Makefile | 93 + arch/csky/abiv1/Makefile | 8 ++ arch/csky/abiv2/Makefile

[PATCH V3 03/26] csky: Kernel booting

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/kernel/head.S| 78 + arch/csky/kernel/setup.c | 150 + arch/csky/kernel/vmlinux.lds.S | 64 ++ 3 files changed, 292 insertions(+) create mode 100644 arch/csky/kernel

[PATCH V3 08/26] csky: Process management and Signal

2018-09-05 Thread Guo Ren
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 | 148 ++ arch/csky/include/asm/processor.h | 120 +++ arch/csky/include/asm

[PATCH V3 02/26] csky: defconfig

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/configs/defconfig | 76 + 1 file changed, 76 insertions(+) create mode 100644 arch/csky/configs/defconfig diff --git a/arch/csky/configs/defconfig b/arch/csky/configs/defconfig new file mode 100644 index 000

[PATCH V3 24/26] clocksource: add C-SKY SMP timer

2018-09-05 Thread Guo Ren
This timer is used by SMP system and use mfcr/mtcr instruction to access the regs. Changelog: - Support csky mp timer alpha version. - Just use low-counter with 32bit width as clocksource. - Coding convention with upstream feed-back. Signed-off-by: Guo Ren --- drivers/clocksource

[PATCH V3 16/26] csky: SMP support

2018-09-05 Thread Guo Ren
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 100644 arch/csky/kernel/smp.c diff --git a/arch

[PATCH V3 02/26] csky: defconfig

2018-09-05 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/configs/defconfig | 76 + 1 file changed, 76 insertions(+) create mode 100644 arch/csky/configs/defconfig diff --git a/arch/csky/configs/defconfig b/arch/csky/configs/defconfig new file mode 100644 index 000

[PATCH V3 24/26] clocksource: add C-SKY SMP timer

2018-09-05 Thread Guo Ren
This timer is used by SMP system and use mfcr/mtcr instruction to access the regs. Changelog: - Support csky mp timer alpha version. - Just use low-counter with 32bit width as clocksource. - Coding convention with upstream feed-back. Signed-off-by: Guo Ren --- drivers/clocksource

[PATCH V3 16/26] csky: SMP support

2018-09-05 Thread Guo Ren
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 100644 arch/csky/kernel/smp.c diff --git a/arch

[PATCH V3 08/26] csky: Process management and Signal

2018-09-05 Thread Guo Ren
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 | 148 ++ arch/csky/include/asm/processor.h | 120 +++ arch/csky/include/asm

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

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

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

2018-07-07 Thread Guo Ren
On Sat, Jul 07, 2018 at 10:10:24PM +0200, Andrea Parri wrote: > On Sat, Jul 07, 2018 at 04:08:47PM +0800, Guo Ren wrote: > > On Fri, Jul 06, 2018 at 02:17:16PM +0200, Peter Zijlstra wrote: > > > CPU0CPU1 > > > > WRITE_ONCE(x, 1)

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

2018-07-07 Thread Guo Ren
On Sat, Jul 07, 2018 at 10:10:24PM +0200, Andrea Parri wrote: > On Sat, Jul 07, 2018 at 04:08:47PM +0800, Guo Ren wrote: > > On Fri, Jul 06, 2018 at 02:17:16PM +0200, Peter Zijlstra wrote: > > > CPU0CPU1 > > > > WRITE_ONCE(x, 1)

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

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

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

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

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

2018-07-07 Thread Guo Ren
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(, 2)r1 = xchg(, 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 11/19] csky: Atomic operations

2018-07-07 Thread Guo Ren
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(, 2)r1 = xchg(, 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 11/19] csky: Atomic operations

2018-07-07 Thread Guo Ren
(x); WRITE_ONCE(y, 1); > r2 = xchg(, 2); smp_store_release(, 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
(x); WRITE_ONCE(y, 1); > r2 = xchg(, 2); smp_store_release(, 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 16/19] csky: SMP support

2018-07-07 Thread Guo Ren
vailable. > > 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 16/19] csky: SMP support

2018-07-07 Thread Guo Ren
vailable. > > 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-06 Thread Guo Ren
tch. > > If you need inspiration, look at: > arch/arm/include/asm/spinlock.h > > Or look at the current version of that file and ignore the LSE version. > > Note that unlock is a store half-word (u16), not having seen your arch > manual yet I don't know if you even have that. Nice tips, thank you very much. Guo Ren

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

2018-07-06 Thread Guo Ren
tch. > > If you need inspiration, look at: > arch/arm/include/asm/spinlock.h > > Or look at the current version of that file and ignore the LSE version. > > Note that unlock is a store half-word (u16), not having seen your arch > manual yet I don't know if you even have that. Nice tips, thank you very much. Guo Ren

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

2018-07-06 Thread Guo Ren
On Fri, Jul 06, 2018 at 02:05:32PM +0200, Peter Zijlstra wrote: > On Fri, Jul 06, 2018 at 07:48:12PM +0800, Guo Ren wrote: > > On Thu, Jul 05, 2018 at 08:00:08PM +0200, Peter Zijlstra wrote: > > > On Mon, Jul 02, 2018 at 01:30:14AM +0800, Guo Ren wrote: > > > >

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

2018-07-06 Thread Guo Ren
On Fri, Jul 06, 2018 at 02:05:32PM +0200, Peter Zijlstra wrote: > On Fri, Jul 06, 2018 at 07:48:12PM +0800, Guo Ren wrote: > > On Thu, Jul 05, 2018 at 08:00:08PM +0200, Peter Zijlstra wrote: > > > On Mon, Jul 02, 2018 at 01:30:14AM +0800, Guo Ren wrote: > > > >

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

2018-07-06 Thread Guo Ren
On Fri, Jul 06, 2018 at 11:39:32AM +0200, Peter Zijlstra wrote: > On Fri, Jul 06, 2018 at 02:07:40PM +0800, Guo Ren wrote: > > > > Please explain those mb()'s... I'm thinking you meant to use smp_mb(). > > Yes, smp_mb(). Current smp_mb()() is the same: sync.is. > >

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

2018-07-06 Thread Guo Ren
On Fri, Jul 06, 2018 at 11:39:32AM +0200, Peter Zijlstra wrote: > On Fri, Jul 06, 2018 at 02:07:40PM +0800, Guo Ren wrote: > > > > Please explain those mb()'s... I'm thinking you meant to use smp_mb(). > > Yes, smp_mb(). Current smp_mb()() is the same: sync.is. > >

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

2018-07-06 Thread Guo Ren
anism architectual for C-SKY SMP. There is no another way in future and SOC vendor couldn't change it. > You probably want to use an enable-method property to describe this. No, thx. Guo Ren

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

2018-07-06 Thread Guo Ren
anism architectual for C-SKY SMP. There is no another way in future and SOC vendor couldn't change it. > You probably want to use an enable-method property to describe this. No, thx. Guo Ren

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

2018-07-06 Thread Guo Ren
On Thu, Jul 05, 2018 at 08:00:08PM +0200, Peter Zijlstra wrote: > On Mon, Jul 02, 2018 at 01:30:14AM +0800, Guo Ren wrote: > > +#ifdef CONFIG_CPU_HAS_LDSTEX > > +ENTRY(csky_cmpxchg) > > + USPTOKSP > > + mfcra3, epc > > + INCTRAP a3 > > + > >

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

2018-07-06 Thread Guo Ren
On Thu, Jul 05, 2018 at 08:00:08PM +0200, Peter Zijlstra wrote: > On Mon, Jul 02, 2018 at 01:30:14AM +0800, Guo Ren wrote: > > +#ifdef CONFIG_CPU_HAS_LDSTEX > > +ENTRY(csky_cmpxchg) > > + USPTOKSP > > + mfcra3, epc > > + INCTRAP a3 > > + > >

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

2018-07-06 Thread Guo Ren
On Thu, Jul 05, 2018 at 07:59:02PM +0200, Peter Zijlstra wrote: > On Mon, Jul 02, 2018 at 01:30:14AM +0800, Guo Ren wrote: > > > +static inline void arch_spin_lock(arch_spinlock_t *lock) > > +{ > > + unsigned int *p = >lock; > > + unsigned in

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

2018-07-06 Thread Guo Ren
On Thu, Jul 05, 2018 at 07:59:02PM +0200, Peter Zijlstra wrote: > On Mon, Jul 02, 2018 at 01:30:14AM +0800, Guo Ren wrote: > > > +static inline void arch_spin_lock(arch_spinlock_t *lock) > > +{ > > + unsigned int *p = >lock; > > + unsigned in

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

2018-07-06 Thread Guo Ren
gt;"); > > + tmp |= 1 << cpu; > > + mtcr("cr<29, 0>", tmp); > > + > > + while (!cpu_online(cpu)); > > + > > + secondary_stack = 0; > > + > > + return 0; > > +} > > I don't see a start address being setup here, so I assume that CPUs branch to > a > fixed address out-of-reset. Does that mean that the kernel has to be loaded at > a particular physical address on a given platform? No, not a fixed address. I put it arch/csky/kernel/traps.c:79-83 trap_init() #ifdef CONFIG_SMP mtcr("cr<28, 0>", virt_to_phys(vec_base)); VEC_INIT(VEC_RESET, (void *)virt_to_phys(_start_smp_secondary)); #endi Guo Ren

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

2018-07-06 Thread Guo Ren
gt;"); > > + tmp |= 1 << cpu; > > + mtcr("cr<29, 0>", tmp); > > + > > + while (!cpu_online(cpu)); > > + > > + secondary_stack = 0; > > + > > + return 0; > > +} > > I don't see a start address being setup here, so I assume that CPUs branch to > a > fixed address out-of-reset. Does that mean that the kernel has to be loaded at > a particular physical address on a given platform? No, not a fixed address. I put it arch/csky/kernel/traps.c:79-83 trap_init() #ifdef CONFIG_SMP mtcr("cr<28, 0>", virt_to_phys(vec_base)); VEC_INIT(VEC_RESET, (void *)virt_to_phys(_start_smp_secondary)); #endi Guo Ren

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

2018-07-06 Thread Guo Ren
On Thu, Jul 05, 2018 at 07:50:59PM +0200, Peter Zijlstra wrote: > On Mon, Jul 02, 2018 at 01:30:14AM +0800, Guo Ren wrote: > > > +#include > > + > > +#defi

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

2018-07-06 Thread Guo Ren
On Thu, Jul 05, 2018 at 07:50:59PM +0200, Peter Zijlstra wrote: > On Mon, Jul 02, 2018 at 01:30:14AM +0800, Guo Ren wrote: > > > +#include > > + > > +#defi

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

2018-07-06 Thread Guo Ren
On Thu, Jul 05, 2018 at 08:05:03PM +0200, Peter Zijlstra wrote: > On Mon, Jul 02, 2018 at 01:30:19AM +0800, Guo Ren wrote: > > +static irqreturn_t handle_ipi(int irq, void *dev) > > +{ > > + unsigned long *pending_ipis = _data[smp_processor_id()].bits; >

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

2018-07-06 Thread Guo Ren
On Thu, Jul 05, 2018 at 08:05:03PM +0200, Peter Zijlstra wrote: > On Mon, Jul 02, 2018 at 01:30:19AM +0800, Guo Ren wrote: > > +static irqreturn_t handle_ipi(int irq, void *dev) > > +{ > > + unsigned long *pending_ipis = _data[smp_processor_id()].bits; >

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

2018-07-05 Thread Guo Ren
c ops is set. Got it, add set_oneshot. > > Thx, I'll modify it like this: > > div = (timer_of_rate() / TIMER_FREQ) - 1; > > I wanted to be sure it wasn't the latter. In this case, you don't need > parenthesis, so just add the spaces around the '/' operator. Ok Guo Ren

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

2018-07-05 Thread Guo Ren
c ops is set. Got it, add set_oneshot. > > Thx, I'll modify it like this: > > div = (timer_of_rate() / TIMER_FREQ) - 1; > > I wanted to be sure it wasn't the latter. In this case, you don't need > parenthesis, so just add the spaces around the '/' operator. Ok Guo Ren

Re: [PATCH V2 05/19] csky: System Call

2018-07-04 Thread Guo Ren
call_table.c: > > #define sys_fadvise64_64 csky_fadvise64_64 Thx for the tip :) Guo Ren

Re: [PATCH V2 05/19] csky: System Call

2018-07-04 Thread Guo Ren
call_table.c: > > #define sys_fadvise64_64 csky_fadvise64_64 Thx for the tip :) Guo Ren

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

2018-07-04 Thread Guo Ren
On Wed, Jul 04, 2018 at 04:35:43PM +0200, Thomas Gleixner wrote: > On Wed, 4 Jul 2018, Guo Ren wrote: > > On Tue, Jul 03, 2018 at 11:39:05AM +0200, Thomas Gleixner wrote: > > > > +static inline u64 get_ccvr(void) > > > > +{ > > > > +

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

2018-07-04 Thread Guo Ren
On Wed, Jul 04, 2018 at 04:35:43PM +0200, Thomas Gleixner wrote: > On Wed, 4 Jul 2018, Guo Ren wrote: > > On Tue, Jul 03, 2018 at 11:39:05AM +0200, Thomas Gleixner wrote: > > > > +static inline u64 get_ccvr(void) > > > > +{ > > > > +

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

2018-07-04 Thread Guo Ren
+ > > +static u64 notrace nc_sched_clock_read(void) > > +{ > > + void __iomem *base; > > + > > + base = timer_of_base() + CLKSRC_OFFSET; > > + > > + return (u64) readl_relaxed(base + TIMER_VALUE); > > +} > > + > > +static void nc_timer_set_div(void __iomem *base) > > +{ > > + unsigned int div; > > + > > + div = timer_of_rate()/TIMER_FREQ - 1; > > space ' / ' > > Is it > (timer_of_rate() / TIMER_FREQ) - 1 > or > timer_of_rate() / (TIMER_FREQ - 1) > > ? Thx, I'll modify it like this: div = (timer_of_rate() / TIMER_FREQ) - 1; > > + clocksource_mmio_init(base + TIMER_VALUE, "nationalchip", TIMER_FREQ, > > 200, 32, > > + clocksource_mmio_readl_up); > > return code check ? Ok, add return code check. > > +TIMER_OF_DECLARE(nc_timer, "nationalchip,timer-v1", nc_timer_init); > > same comment than cksy timer. Ok. Guo Ren

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

2018-07-04 Thread Guo Ren
+ > > +static u64 notrace nc_sched_clock_read(void) > > +{ > > + void __iomem *base; > > + > > + base = timer_of_base() + CLKSRC_OFFSET; > > + > > + return (u64) readl_relaxed(base + TIMER_VALUE); > > +} > > + > > +static void nc_timer_set_div(void __iomem *base) > > +{ > > + unsigned int div; > > + > > + div = timer_of_rate()/TIMER_FREQ - 1; > > space ' / ' > > Is it > (timer_of_rate() / TIMER_FREQ) - 1 > or > timer_of_rate() / (TIMER_FREQ - 1) > > ? Thx, I'll modify it like this: div = (timer_of_rate() / TIMER_FREQ) - 1; > > + clocksource_mmio_init(base + TIMER_VALUE, "nationalchip", TIMER_FREQ, > > 200, 32, > > + clocksource_mmio_readl_up); > > return code check ? Ok, add return code check. > > +TIMER_OF_DECLARE(nc_timer, "nationalchip,timer-v1", nc_timer_init); > > same comment than cksy timer. Ok. Guo Ren

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

2018-07-04 Thread Guo Ren
On Wed, Jul 04, 2018 at 08:43:29AM +0200, Thomas Gleixner wrote: > > Do you mean merge irq-csky-v1.c irq-csky-v2.c irq-nationalchip.c into > > one file eg: irq-csky.c? > > Yes, but only if there is enough code to share without creating an ifdef > mess. But that looks doabl

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

2018-07-04 Thread Guo Ren
On Wed, Jul 04, 2018 at 08:43:29AM +0200, Thomas Gleixner wrote: > > Do you mean merge irq-csky-v1.c irq-csky-v2.c irq-nationalchip.c into > > one file eg: irq-csky.c? > > Yes, but only if there is enough code to share without creating an ifdef > mess. But that looks doabl

Re: [PATCH V2 05/19] csky: System Call

2018-07-04 Thread Guo Ren
g_struct { > > + unsigned long addr; > > + unsigned long len; > > + unsigned long prot; > > + unsigned long flags; > > + unsigned long fd; > > + unsigned long offset; > > +}; > > + > > +SYSCALL_DEFINE1(mmap, > > + struct mmap_arg_struct *, arg) > > +{ > > + struct mmap_arg_struct a; > > + > > + if (copy_from_user(, arg, sizeof(a))) > > + return -EINVAL; > > + > > + if (unlikely(a.offset & ~PAGE_MASK)) > > + return -EINVAL; > > + > > + return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, > > a.offset >> PAGE_SHIFT); > > +} > > This can be removed since there is mmap2() Ok. Guo Ren

<    6   7   8   9   10   11   12   13   >