Re: [PATCH 0/8] clocksource: Generalize Faraday timer

2017-05-18 Thread Daniel Lezcano
On Thu, May 18, 2017 at 02:11:48PM +0200, Linus Walleij wrote:
> On Thu, May 18, 2017 at 12:32 PM, Jonas Jensen  wrote:
> > On 17 May 2017 at 16:05, Linus Walleij  wrote:
> >> The patches can be applied as soon as Jonas Jensen and Joel
> >> Stanley says they work for them.
> >
> > Thanks! fttmr010 seem to work OK!
> >
> > I did the usual test on UC-7112-LX [1] after merging
> > linux-nomadik/fttmr010 into next-20170518.
> 
> Thanks a lot! I'll add your Tested-by tags (if I need to repost, else
> I guess Daniel can add it when applying).

Yes, sure. No problem.

> I'm really curious to see if it also works on Aspeed.
> 
> Yours,
> Linus Walleij

-- 

  Linaro.org │ Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog


Re: [PATCH 0/8] clocksource: Generalize Faraday timer

2017-05-18 Thread Daniel Lezcano
On Thu, May 18, 2017 at 02:11:48PM +0200, Linus Walleij wrote:
> On Thu, May 18, 2017 at 12:32 PM, Jonas Jensen  wrote:
> > On 17 May 2017 at 16:05, Linus Walleij  wrote:
> >> The patches can be applied as soon as Jonas Jensen and Joel
> >> Stanley says they work for them.
> >
> > Thanks! fttmr010 seem to work OK!
> >
> > I did the usual test on UC-7112-LX [1] after merging
> > linux-nomadik/fttmr010 into next-20170518.
> 
> Thanks a lot! I'll add your Tested-by tags (if I need to repost, else
> I guess Daniel can add it when applying).

Yes, sure. No problem.

> I'm really curious to see if it also works on Aspeed.
> 
> Yours,
> Linus Walleij

-- 

  Linaro.org │ Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog


Re: [PATCH 0/8] clocksource: Generalize Faraday timer

2017-05-18 Thread Linus Walleij
On Thu, May 18, 2017 at 12:32 PM, Jonas Jensen  wrote:
> On 17 May 2017 at 16:05, Linus Walleij  wrote:
>> The patches can be applied as soon as Jonas Jensen and Joel
>> Stanley says they work for them.
>
> Thanks! fttmr010 seem to work OK!
>
> I did the usual test on UC-7112-LX [1] after merging
> linux-nomadik/fttmr010 into next-20170518.

Thanks a lot! I'll add your Tested-by tags (if I need to repost, else
I guess Daniel can add it when applying).

I'm really curious to see if it also works on Aspeed.

Yours,
Linus Walleij


Re: [PATCH 0/8] clocksource: Generalize Faraday timer

2017-05-18 Thread Linus Walleij
On Thu, May 18, 2017 at 12:32 PM, Jonas Jensen  wrote:
> On 17 May 2017 at 16:05, Linus Walleij  wrote:
>> The patches can be applied as soon as Jonas Jensen and Joel
>> Stanley says they work for them.
>
> Thanks! fttmr010 seem to work OK!
>
> I did the usual test on UC-7112-LX [1] after merging
> linux-nomadik/fttmr010 into next-20170518.

Thanks a lot! I'll add your Tested-by tags (if I need to repost, else
I guess Daniel can add it when applying).

I'm really curious to see if it also works on Aspeed.

Yours,
Linus Walleij


Re: [PATCH 0/8] clocksource: Generalize Faraday timer

2017-05-18 Thread Jonas Jensen
On 17 May 2017 at 16:05, Linus Walleij  wrote:
> The patches can be applied as soon as Jonas Jensen and Joel
> Stanley says they work for them.

Thanks! fttmr010 seem to work OK!

I did the usual test on UC-7112-LX [1] after merging
linux-nomadik/fttmr010 into next-20170518.

[1] 
https://bitbucket.org/Kasreyn/linux-next/commits/2904b508ad46bd98b09c11e312c396d672fc7e9a
Uncompressing Linux... done, booting the kernel.
[0.00] Booting Linux on physical CPU 0x0
[0.00] Linux version 4.12.0-rc1-next-20170518-00010-g2904b50
(i@ildjarn) (gcc version 4.9.1 (crosstool-NG 1.20.0) ) #4483 PREEMPT
Thu May 18 11:38:28 CEST 2017
[0.00] CPU: FA526 [66015261] revision 1 (ARMv4), cr=397f
[0.00] CPU: VIVT data cache, VIVT instruction cache
[0.00] OF: fdt: Machine model: MOXA UC-7112-LX
[0.00] bootconsole [earlycon0] enabled
[0.00] Memory policy: Data cache writeback
[0.00] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 8128
[0.00] Kernel command line: console=ttyS0,115200n8 earlyprintk
root=/dev/mmcblk0p1 rw rootwait
[0.00] PID hash table entries: 128 (order: -3, 512 bytes)
[0.00] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[0.00] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[0.00] Memory: 19172K/32768K available (3421K kernel code,
156K rwdata, 724K rodata, 192K init, 8587K bss, 13596K reserved, 0K
cma-reserved)
[0.00] Virtual kernel memory layout:
[0.00] vector  : 0x - 0x1000   (   4 kB)
[0.00] fixmap  : 0xffc0 - 0xfff0   (3072 kB)
[0.00] vmalloc : 0xc280 - 0xff80   ( 976 MB)
[0.00] lowmem  : 0xc000 - 0xc200   (  32 MB)
[0.00]   .text : 0xc0008000 - 0xc035f700   (3422 kB)
[0.00]   .init : 0xc043 - 0xc046   ( 192 kB)
[0.00]   .data : 0xc046 - 0xc0487360   ( 157 kB)
[0.00].bss : 0xc048ba40 - 0xc0cee7ec   (8588 kB)
[0.00] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[0.00] Running RCU self tests
[0.00] Preemptible hierarchical RCU implementation.
[0.00] RCU lockdep checking is enabled.
[0.00] NR_IRQS:16 nr_irqs:16 16
[0.00] clocksource: FTTMR010-TIMER2: mask: 0x
max_cycles: 0x, max_idle_ns: 39817925974 ns
[0.87] sched_clock: 32 bits at 48MHz, resolution 20ns, wraps
every 44739242997ns
[0.009487] Lock dependency validator: Copyright (c) 2006 Red Hat,
Inc., Ingo Molnar
[0.017848] ... MAX_LOCKDEP_SUBCLASSES:  8
[0.024640] ... MAX_LOCK_DEPTH:  48
[0.029566] ... MAX_LOCKDEP_KEYS:8191
[0.034261] ... CLASSHASH_SIZE:  4096
[0.039299] ... MAX_LOCKDEP_ENTRIES: 32768
[0.044069] ... MAX_LOCKDEP_CHAINS:  65536
[0.049183] ... CHAINHASH_SIZE:  32768
[0.053969]  memory used by lock dependency info: 5167 kB
[0.060064]  per task-struct memory footprint: 1536 bytes
[0.072855] kmemleak: Kernel memory leak detector disabled
[0.091073] kmemleak: Early log buffer exceeded (1229), please
increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE
[0.101346] Calibrating delay loop... 143.76 BogoMIPS (lpj=718848)
[0.175662] pid_max: default: 4096 minimum: 301
[0.183736] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.191487] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.217924] CPU: Testing write buffer coherency: ok
[0.250678] Setting up static identity map for 0x8200 - 0x8248
[0.262190] Hierarchical SRCU implementation.
[0.327717] devtmpfs: initialized
[0.407364] DMA-API: preallocated 4096 debug entries
[0.413210] DMA-API: debugging enabled by kernel config
[0.445120] clocksource: jiffies: mask: 0x max_cycles:
0x, max_idle_ns: 1911260446275 ns
[0.458278] kworker/u2:0 (14) used greatest stack depth: 6224 bytes left
[0.467584] futex hash table entries: 16 (order: -3, 704 bytes)
[0.498128] NET: Registered protocol family 16
[0.518378] DMA: preallocated 256 KiB pool for atomic coherent allocations
[0.558707] kworker/u2:1 (17) used greatest stack depth: 5856 bytes left
[1.322437] clocksource: Switched to clocksource FTTMR010-TIMER2
[1.426799] NET: Registered protocol family 2
[1.448712] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[1.457909] TCP bind hash table entries: 1024 (order: 3, 36864 bytes)
[1.468402] TCP: Hash tables configured (established 1024 bind 1024)
[1.479267] UDP hash table entries: 128 (order: 1, 10240 bytes)
[1.487244] UDP-Lite hash table entries: 128 (order: 1, 10240 bytes)
[1.501083] NET: Registered protocol family 1
[1.555364] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[2.067555] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[2.209611] io 

Re: [PATCH 0/8] clocksource: Generalize Faraday timer

2017-05-18 Thread Jonas Jensen
On 17 May 2017 at 16:05, Linus Walleij  wrote:
> The patches can be applied as soon as Jonas Jensen and Joel
> Stanley says they work for them.

Thanks! fttmr010 seem to work OK!

I did the usual test on UC-7112-LX [1] after merging
linux-nomadik/fttmr010 into next-20170518.

[1] 
https://bitbucket.org/Kasreyn/linux-next/commits/2904b508ad46bd98b09c11e312c396d672fc7e9a
Uncompressing Linux... done, booting the kernel.
[0.00] Booting Linux on physical CPU 0x0
[0.00] Linux version 4.12.0-rc1-next-20170518-00010-g2904b50
(i@ildjarn) (gcc version 4.9.1 (crosstool-NG 1.20.0) ) #4483 PREEMPT
Thu May 18 11:38:28 CEST 2017
[0.00] CPU: FA526 [66015261] revision 1 (ARMv4), cr=397f
[0.00] CPU: VIVT data cache, VIVT instruction cache
[0.00] OF: fdt: Machine model: MOXA UC-7112-LX
[0.00] bootconsole [earlycon0] enabled
[0.00] Memory policy: Data cache writeback
[0.00] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 8128
[0.00] Kernel command line: console=ttyS0,115200n8 earlyprintk
root=/dev/mmcblk0p1 rw rootwait
[0.00] PID hash table entries: 128 (order: -3, 512 bytes)
[0.00] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[0.00] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[0.00] Memory: 19172K/32768K available (3421K kernel code,
156K rwdata, 724K rodata, 192K init, 8587K bss, 13596K reserved, 0K
cma-reserved)
[0.00] Virtual kernel memory layout:
[0.00] vector  : 0x - 0x1000   (   4 kB)
[0.00] fixmap  : 0xffc0 - 0xfff0   (3072 kB)
[0.00] vmalloc : 0xc280 - 0xff80   ( 976 MB)
[0.00] lowmem  : 0xc000 - 0xc200   (  32 MB)
[0.00]   .text : 0xc0008000 - 0xc035f700   (3422 kB)
[0.00]   .init : 0xc043 - 0xc046   ( 192 kB)
[0.00]   .data : 0xc046 - 0xc0487360   ( 157 kB)
[0.00].bss : 0xc048ba40 - 0xc0cee7ec   (8588 kB)
[0.00] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[0.00] Running RCU self tests
[0.00] Preemptible hierarchical RCU implementation.
[0.00] RCU lockdep checking is enabled.
[0.00] NR_IRQS:16 nr_irqs:16 16
[0.00] clocksource: FTTMR010-TIMER2: mask: 0x
max_cycles: 0x, max_idle_ns: 39817925974 ns
[0.87] sched_clock: 32 bits at 48MHz, resolution 20ns, wraps
every 44739242997ns
[0.009487] Lock dependency validator: Copyright (c) 2006 Red Hat,
Inc., Ingo Molnar
[0.017848] ... MAX_LOCKDEP_SUBCLASSES:  8
[0.024640] ... MAX_LOCK_DEPTH:  48
[0.029566] ... MAX_LOCKDEP_KEYS:8191
[0.034261] ... CLASSHASH_SIZE:  4096
[0.039299] ... MAX_LOCKDEP_ENTRIES: 32768
[0.044069] ... MAX_LOCKDEP_CHAINS:  65536
[0.049183] ... CHAINHASH_SIZE:  32768
[0.053969]  memory used by lock dependency info: 5167 kB
[0.060064]  per task-struct memory footprint: 1536 bytes
[0.072855] kmemleak: Kernel memory leak detector disabled
[0.091073] kmemleak: Early log buffer exceeded (1229), please
increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE
[0.101346] Calibrating delay loop... 143.76 BogoMIPS (lpj=718848)
[0.175662] pid_max: default: 4096 minimum: 301
[0.183736] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.191487] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.217924] CPU: Testing write buffer coherency: ok
[0.250678] Setting up static identity map for 0x8200 - 0x8248
[0.262190] Hierarchical SRCU implementation.
[0.327717] devtmpfs: initialized
[0.407364] DMA-API: preallocated 4096 debug entries
[0.413210] DMA-API: debugging enabled by kernel config
[0.445120] clocksource: jiffies: mask: 0x max_cycles:
0x, max_idle_ns: 1911260446275 ns
[0.458278] kworker/u2:0 (14) used greatest stack depth: 6224 bytes left
[0.467584] futex hash table entries: 16 (order: -3, 704 bytes)
[0.498128] NET: Registered protocol family 16
[0.518378] DMA: preallocated 256 KiB pool for atomic coherent allocations
[0.558707] kworker/u2:1 (17) used greatest stack depth: 5856 bytes left
[1.322437] clocksource: Switched to clocksource FTTMR010-TIMER2
[1.426799] NET: Registered protocol family 2
[1.448712] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[1.457909] TCP bind hash table entries: 1024 (order: 3, 36864 bytes)
[1.468402] TCP: Hash tables configured (established 1024 bind 1024)
[1.479267] UDP hash table entries: 128 (order: 1, 10240 bytes)
[1.487244] UDP-Lite hash table entries: 128 (order: 1, 10240 bytes)
[1.501083] NET: Registered protocol family 1
[1.555364] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[2.067555] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[2.209611] io scheduler noop registered
[   

[PATCH 0/8] clocksource: Generalize Faraday timer

2017-05-17 Thread Linus Walleij
It turns out that the Moxa is using a Faraday IP timer named
FTTMR010. This is also what Aspeed's derivative is based on.

This series attempts to merge these two drivers into one to
get lesser code to maintain. Also it incidentally adds a
sched_clock() implementation to the Moxa and Aspeed, which
is nice.

The patches can also be grabbed from here:
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git/commit/?h=fttmr010

Future ideas include supporting the optional EXTCLK
(32kHz clock) and delay timers. This will then get available
on all three supported platforms = big win.

The patches can be applied as soon as Jonas Jensen and Joel
Stanley says they work for them.

I have chosen to work on this body of code (rather than the
Moxart code) as it is derived from code originally posted
by Faraday themselves here:
https://lwn.net/Articles/447919/

I hope we can get this to work!

Linus Walleij (8):
  clocksource/drivers/fttmr010: Fix the clock handling
  clocksource/drivers/fttmr010: Merge FTTMR010 DT bindings
  clocksource/drivers/fttmr010: Drop Gemini specifics
  clocksource/drivers/fttmr010: Use state container
  clocksource/drivers/fttmr010: Switch to use bitops
  clocksource/drivers/fttmr010: Switch to use TIMER2 src
  clocksource/drivers/fttmr010: Merge Moxa into FTTMR010
  ARM: dts: augment Moxa and Aspeed DTS for FTTMR010

 .../devicetree/bindings/timer/faraday,fttmr010.txt |   4 +-
 .../bindings/timer/moxa,moxart-timer.txt   |  19 --
 arch/arm/boot/dts/aspeed-g4.dtsi   |   7 +-
 arch/arm/boot/dts/aspeed-g5.dtsi   |   6 +-
 arch/arm/boot/dts/moxart.dtsi  |   3 +-
 arch/arm/mach-aspeed/Kconfig   |   2 +-
 arch/arm/mach-moxart/Kconfig   |   2 +-
 drivers/clocksource/Kconfig|   7 -
 drivers/clocksource/Makefile   |   1 -
 drivers/clocksource/moxart_timer.c | 256 --
 drivers/clocksource/timer-fttmr010.c   | 377 +++--
 11 files changed, 214 insertions(+), 470 deletions(-)
 delete mode 100644 
Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt
 delete mode 100644 drivers/clocksource/moxart_timer.c

-- 
2.9.3



[PATCH 0/8] clocksource: Generalize Faraday timer

2017-05-17 Thread Linus Walleij
It turns out that the Moxa is using a Faraday IP timer named
FTTMR010. This is also what Aspeed's derivative is based on.

This series attempts to merge these two drivers into one to
get lesser code to maintain. Also it incidentally adds a
sched_clock() implementation to the Moxa and Aspeed, which
is nice.

The patches can also be grabbed from here:
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git/commit/?h=fttmr010

Future ideas include supporting the optional EXTCLK
(32kHz clock) and delay timers. This will then get available
on all three supported platforms = big win.

The patches can be applied as soon as Jonas Jensen and Joel
Stanley says they work for them.

I have chosen to work on this body of code (rather than the
Moxart code) as it is derived from code originally posted
by Faraday themselves here:
https://lwn.net/Articles/447919/

I hope we can get this to work!

Linus Walleij (8):
  clocksource/drivers/fttmr010: Fix the clock handling
  clocksource/drivers/fttmr010: Merge FTTMR010 DT bindings
  clocksource/drivers/fttmr010: Drop Gemini specifics
  clocksource/drivers/fttmr010: Use state container
  clocksource/drivers/fttmr010: Switch to use bitops
  clocksource/drivers/fttmr010: Switch to use TIMER2 src
  clocksource/drivers/fttmr010: Merge Moxa into FTTMR010
  ARM: dts: augment Moxa and Aspeed DTS for FTTMR010

 .../devicetree/bindings/timer/faraday,fttmr010.txt |   4 +-
 .../bindings/timer/moxa,moxart-timer.txt   |  19 --
 arch/arm/boot/dts/aspeed-g4.dtsi   |   7 +-
 arch/arm/boot/dts/aspeed-g5.dtsi   |   6 +-
 arch/arm/boot/dts/moxart.dtsi  |   3 +-
 arch/arm/mach-aspeed/Kconfig   |   2 +-
 arch/arm/mach-moxart/Kconfig   |   2 +-
 drivers/clocksource/Kconfig|   7 -
 drivers/clocksource/Makefile   |   1 -
 drivers/clocksource/moxart_timer.c | 256 --
 drivers/clocksource/timer-fttmr010.c   | 377 +++--
 11 files changed, 214 insertions(+), 470 deletions(-)
 delete mode 100644 
Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt
 delete mode 100644 drivers/clocksource/moxart_timer.c

-- 
2.9.3