On Wed, Dec 13, 2017 at 01:45:02PM +0800, Greentime Hu wrote:
> I think it should be fine if an interruption between mtsr_dsb and
> tlbop_rwr because this is a optimization by sw.
Fine? When there is an unexpected vaddr in SR_TLB_VPN, tlbop_rwr(*pte) will
break that vaddr's pfn in the CPU
On Wed, Dec 13, 2017 at 04:30:41PM +0800, Greentime Hu wrote:
> 2017-12-13 16:19 GMT+08:00 Guo Ren <ren_...@c-sky.com>:
> > On Wed, Dec 13, 2017 at 01:45:02PM +0800, Greentime Hu wrote:
> >
> >> I think it should be fine if an interruption between mtsr_
PN is in a invalid state, no operation happen on
tlbop_rwr.
Then they are atomic safe ,no spin_lock_irq need.
:)
Guo Ren
map(page1) // Mostly vaddr1 = vaddr0
val = vaddr1; //No tlb-miss and it will get page0's val not page1, because
last expired vaddr0's entry is left in CPU-MMU-tlb.
Best Regards
Guo Ren
On Mon, Dec 18, 2017 at 07:21:30PM +0800, Greentime Hu wrote:
> Hi, Guo Ren:
>
> 2017-12-18 17:08 GMT+08:00 Guo Ren <ren_...@c-sky.com>:
> > Hi Greentime,
> >
> > On Fri, Dec 08, 2017 at 05:11:50PM +0800, Greentime Hu wrote:
> > [...]
> >>
> >
rruption between "mtsr_dsb" and "tlbop_rwr" and a
update_mmu_cache() is invoked again, then an error page mapping is
set up in your tlb-buffer when tlbop_rwr is excuted from interrupt.
Because it's another addr in NDS32_SR_TLB_VPN.
It seems that tlb-hardrefill can help build tlb-buffer mapping, why you
update it in this software way?
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
...
Pkmap: 0xff80 – 0xffc0 (4 MB)PTR_PER_PTE = 1024
Vmalloc : 0xf020 – 0xff00 (238 MB) max: 238MB +
256MB + 1GB
Lowmem : 0x8000 – 0xf000 (1G + 768 MB)
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.
e 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
ption.
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
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
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
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
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
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
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
4fe 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
csky: System Call
csky: Cache and TLB routi
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
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
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
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
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
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
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
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
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
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
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
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
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
amp; Technology Co.,Ltd.
>
> See above
Ok, stick an empty newline
> > + writel_relaxed(expand_byte_to_word(i) + 0x03020100,
>
> This magic number is the reverse of the above magic. Is that intentional.
>
> > + reg_base + INTC_SOURCE + i);
> > + }
>
> See above.
No magic number and use inline func.
> > +static int __init
> > +intc_init(struct device_node *node, struct device_node *parent)
> > +{
> > + u32 clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
> > + int ret;
>
> Aside of that the whole thing might share the code with the other one, but
> it might not be worth it. At least this wants to be documented in the
> changelog why sharing the code is not useful...
Do you mean merge irq-csky-v1.c irq-csky-v2.c irq-nationalchip.c into
one file eg: irq-csky.c?
Guo Ren
On Wed, Sep 05, 2018 at 07:45:12PM -0500, Rob Herring wrote:
> On Wed, Sep 5, 2018 at 7:09 AM Guo Ren wrote:
> >
> > Signed-off-by: Guo Ren
> > ---
> > .../bindings/interrupt-controller/csky,mpintc.txt | 40
> > ++
> > 1 file cha
On Wed, Sep 05, 2018 at 07:43:10PM -0500, Rob Herring wrote:
> On Wed, Sep 5, 2018 at 7:10 AM Guo Ren wrote:
> >
> > Signed-off-by: Guo Ren
> > ---
> > .../interrupt-controller/csky,apb-intc.txt | 45
> > ++
> > 1 file cha
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
On Wed, Sep 05, 2018 at 07:47:29PM -0500, Rob Herring wrote:
> On Wed, Sep 5, 2018 at 7:09 AM Guo Ren wrote:
> >
> > Signed-off-by: Guo Ren
> > ---
> > .../bindings/timer/csky,gx6605s-timer.txt | 46
> > ++
> > 1 file cha
On Thu, Sep 06, 2018 at 04:31:16PM +0200, Arnd Bergmann wrote:
> On Wed, Sep 5, 2018 at 2:08 PM Guo Ren wrote:
>
> > diff --git a/arch/csky/include/asm/io.h b/arch/csky/include/asm/io.h
> > new file mode 100644
> > index 000..fcb2142
> > --- /dev/null
> &
On Thu, Sep 06, 2018 at 04:02:42PM +0200, Arnd Bergmann wrote:
> On Wed, Sep 5, 2018 at 2:08 PM Guo Ren wrote:
>
> > +
> > + /*
> > +* __NR_rt_sigreturn must be 173
> > +* Because gcc/config/csky/linux-unwind.h use hard
On Thu, Sep 06, 2018 at 03:58:51PM +0200, Arnd Bergmann wrote:
> On Wed, Sep 5, 2018 at 2:08 PM Guo Ren wrote:
> >
> > Signed-off-by: Guo Ren
> > ---
> > arch/csky/configs/defconfig | 76
> > +
> > +CONFIG_USEL
On Thu, Sep 06, 2018 at 04:10:49PM +0200, Arnd Bergmann wrote:
> On Wed, Sep 5, 2018 at 2:08 PM Guo Ren wrote:
>
> > +SYSCALL_DEFINE6(mmap2,
> > + unsigned long, addr,
> > + unsigned long, len,
> > + unsigned long, prot,
> > + unsign
On Thu, Sep 06, 2018 at 07:08:18PM -0700, Guenter Roeck wrote:
> Hi,
>
> On Wed, Sep 05, 2018 at 08:07:39PM +0800, Guo Ren wrote:
> > This is the 3th version patchset to add the Linux kernel port for
> > C-SKY(csky).
> > Thanks to everyone who provided feedb
On Thu, Sep 06, 2018 at 10:02:29AM +0800, Guo Ren wrote:
> On Wed, Sep 05, 2018 at 07:47:29PM -0500, Rob Herring wrote:
> > On Wed, Sep 5, 2018 at 7:09 AM Guo Ren wrote:
> > >
> > > Signed-off-by: Guo Ren
> > > ---
> > > .../bindin
On Fri, Sep 07, 2018 at 10:14:38AM +0200, Arnd Bergmann wrote:
> On Fri, Sep 7, 2018 at 5:04 AM Guo Ren wrote:
> >
> > On Thu, Sep 06, 2018 at 04:31:16PM +0200, Arnd Bergmann wrote:
> > > On Wed, Sep 5, 2018 at 2:08 PM Guo Ren wrote:
> > >
> > > Can
On Fri, Sep 07, 2018 at 10:01:03AM +0200, Arnd Bergmann wrote:
> On Fri, Sep 7, 2018 at 7:17 AM Guo Ren wrote:
> >
> > On Thu, Sep 06, 2018 at 04:16:30PM +0200, Arnd Bergmann wrote:
> > > On Wed, Sep 5, 2018 at 2:08 PM Guo Ren wrote:
> > >
> > > > di
On Thu, Sep 06, 2018 at 04:24:59PM +0200, Arnd Bergmann wrote:
> On Wed, Sep 5, 2018 at 2:08 PM Guo Ren wrote:
>
> > --- /dev/null
> > +++ b/arch/csky/abiv1/memset.c
> > @@ -0,0 +1,38 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +// Copyright (C) 2018
On Thu, Sep 06, 2018 at 05:50:02PM +0200, Geert Uytterhoeven wrote:
> On Thu, Sep 6, 2018 at 4:25 PM Arnd Bergmann wrote:
> > On Wed, Sep 5, 2018 at 2:08 PM Guo Ren wrote:
> > > --- /dev/null
> > > +++ b/arch/csky/abiv1/memset.c
> > > @@ -0,0 +1,38
On Thu, Sep 06, 2018 at 04:16:30PM +0200, Arnd Bergmann wrote:
> On Wed, Sep 5, 2018 at 2:08 PM Guo Ren wrote:
>
> > diff --git a/arch/csky/boot/dts/qemu.dts b/arch/csky/boot/dts/qemu.dts
> > new file mode 100644
> > index 000..d36e4cd
> > --- /dev/null
> &g
On Thu, Sep 06, 2018 at 03:05:38PM +0200, Arnd Bergmann wrote:
> On Thu, Sep 6, 2018 at 4:13 AM Guo Ren wrote:
> >
> > On Wed, Sep 05, 2018 at 07:43:10PM -0500, Rob Herring wrote:
> > > On Wed, Sep 5, 2018 at 7:10 AM Guo Ren wrote:
> > >
er, but in some
> cases the SoC integrator put the wrong address in there, so we need to
> look up the address in DT anyway.
Yes, it's reliable. This interrupt is combined with CPU and not on AXI
or APB. Soc just give a hole in the address space and tell the CPU where
the address is with 20 wire-signals.
Guo Ren
On Thu, Sep 06, 2018 at 03:39:01PM +0200, Thomas Gleixner wrote:
> On Wed, 5 Sep 2018, Guo Ren wrote:
>
> > +static void (*handle_arch_irq)(struct pt_regs *regs) = NULL;
> > +
> > +void __init set_handle_irq(void (*handle_irq)(struct pt_regs *))
> >
On Fri, Sep 07, 2018 at 10:13:13AM -0500, Rob Herring wrote:
> On Thu, Sep 6, 2018 at 8:05 AM Arnd Bergmann wrote:
> >
> > On Thu, Sep 6, 2018 at 4:13 AM Guo Ren wrote:
> > >
> > > On Wed, Sep 05, 2018 at 07:43:10PM -0500, Rob Herring wrote:
> > > >
On Fri, Sep 07, 2018 at 04:13:35PM +0200, Arnd Bergmann wrote:
> On Fri, Sep 7, 2018 at 2:55 PM Guo Ren wrote:
> >
> > On Fri, Sep 07, 2018 at 10:14:38AM +0200, Arnd Bergmann wrote:
> > > On Fri, Sep 7, 2018 at 5:04 AM Guo Ren wrote:
> > > > On Thu, Se
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
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
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
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
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
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
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
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
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 +++
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
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
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
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
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
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
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
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
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
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
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
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
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
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
: 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
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
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
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
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)
> > > > +{
> > > > +
call_table.c:
>
> #define sys_fadvise64_64 csky_fadvise64_64
Thx for the tip :)
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
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
On Tue, Jul 03, 2018 at 10:04:57PM +0200, Arnd Bergmann wrote:
> It's better to avoid relying on libgcc here. Please use the
> CONFIG_GENERIC_LIB_ASHLDI3/ASHRDI3/LSHRDI3/etc
> helpers that we already have in the kernel.
Ok, I'll try
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
; > +generic-y += auxvec.h
>
> You should not need asm/auxvec.h or uapi/asm/auxvec.h
Ok.
> > +generic-y += bug.h
>
> providing your own bug.h might be helpful too.
> Have a look
Ok.
> > +generic-y += cputime.h
>
> asm-generic/cputime.h no loinger exists
Ok, remove it.
> > +generic-y += kvm_para.h
>
> Do you support KVM?
No, remove it, thx.
> > +generic-y += sizes.h
>
> Deprecated and should not be needed
Ok, remove it.
Guo Ren
csky_timer_dying_cpu);
>
> Oh no. Just picking a random hotplug event is not how it works. Add your
> own please and make sure it's at the proper place.
like this?
include/linux/cpuhotplug.h:
CPUHP_AP_KVM_ARM_TIMER_STARTING,
+ CPUHP_AP_CSKY_TIMER_STARTING,
/* Must be the last timer callback */
CPUHP_AP_DUMMY_TIMER_STARTING,
> > + struct clock_event_device *ce = (struct clock_event_device *) dev;
>
> Pointless type cast.
Ok.
struct clock_event_device *ce = dev;
> > + .flags = IRQF_TIMER | IRQF_IRQPOLL,
> > + },
>
> See above
Ok, tabular
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
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
> > +
> >
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
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
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.
> >
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:
> > > >
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
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
(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
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
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
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
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
1 - 100 of 1253 matches
Mail list logo