public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: b.brezillon@overkiz•com (boris brezillon)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v2 00/42] ARM: at91: move to common clk framework
Date: Fri, 26 Jul 2013 18:35:34 +0200	[thread overview]
Message-ID: <51F2A556.8020109@overkiz.com> (raw)
In-Reply-To: <51F2996B.6000406@overkiz.com>

On 26/07/2013 17:44, boris brezillon wrote:
> On 26/07/2013 16:10, Richard Genoud wrote:
>> On 17/07/2013 15:34, Boris BREZILLON wrote:
>>> Hello,
>>>
>>> This patch series is a proposal to move at91 clock implementation
>>> to common clk framework.
>>>
>>> Most of the clock provided by the PMC (Power Management Controller) are
>>> implemented :
>>> - main clock (main oscillator)
>>> - pll clocks
>>> - master clock
>>> - programmable clocks
>>> - utmi clock
>>> - peripheral clocks
>>> - system clocks
>>>
>>> This implementation is compatible with device tree: the goal is
>>> to define the whole clock tree in the device tree (all currently
>>> available dt SoCs and boards are patched to support dt clocks).
>>> Please feel free to comment the dt bindinds.
>>>
>>> I removed the register_clocks function in SoC supporting dt boards only:
>>> - at91sam9x5 SoCs
>>> - at91sam9n12 SoC
>>> - sama5d3 SoCs
>>>
>>> This patch series is based on linux-next and has been tested on
>>> sama5d31ek
>>> board using device tree. It compiles for other SoCs and both with and
>>> without
>>> dt support, but it has not been tested.
>>>
>>> BTW could other people test it on other boards (I only have a kizbox and
>>> a sama5d31ek dev kit).
>>>
>>> Best Regards,
>>> Boris
>>>
>>> Changes since v1:
>>>   - fix bugs in pll, programmable and system clock implementations
>>>     (wrong bit position).
>>>   - add usb clock configuration support (ohci and udc drivers +
>>>     clk_lookup for non dt boards)
>>>   - rework of the system clock interfaces (no need to define a parent
>>> clock,
>>>     system clock is a gate with no rate info)
>>>   - change system, peripheral and programmable clk dt bindings (1
>>> master node
>>>     and multiple child nodes each defining a system/peripheral or
>>> prog clock)
>>>   - fix bugs in sama5 dt definition
>>>
>> Hi Boris,
>>
>> First of all: Big thumbs up for this work !
>>
>> Then, I tested the serie on at91sam9g35ek (sam9x5 familly), and I see
>> some problems:
>> kernel is next-20130725 with the v4 serie of "ARM: at91: prepare
>> transition to common clk framework"
>> and v2 serie of "ARM: at91: move to common clk framework"
>>
>> [    0.000000] Booting Linux on physical CPU 0x0
>> [    0.000000] Linux version 3.11.0-rc2-next-20130725+
>> (rgenoud at lnx-rg) (gcc version 4.7.3 (Buildroot
>> 2013.05-00157-g6d1e60b-dirty) ) #61 Fri Jul 26 15:30:13 CEST 2013
>> [    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ),
>> cr=00053177
>> [    0.000000] CPU: VIVT data cache, VIVT instruction cache
>> [    0.000000] Machine: Atmel AT91SAM (Device Tree), model: Atmel
>> AT91SAM9G35-EK
>> [    0.000000] bootconsole [earlycon0] enabled
>> [    0.000000] Memory policy: ECC disabled, Data cache writeback
>> [    0.000000] AT91: Detected soc type: at91sam9x5
>> [    0.000000] AT91: Detected soc subtype: at91sam9g35
>> [    0.000000] AT91: sram at 0x300000 of 0x8000 mapped at 0xfef70000
>> [    0.000000] On node 0 totalpages: 32768
>> [    0.000000] free_area_init_node: node 0, pgdat c039d208,
>> node_mem_map c03b5000
>> [    0.000000]   Normal zone: 256 pages used for memmap
>> [    0.000000]   Normal zone: 0 pages reserved
>> [    0.000000]   Normal zone: 32768 pages, LIFO batch:7
>> [    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
>> [    0.000000] pcpu-alloc: [0] 0
>> [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.
>> Total pages: 32512
>> [    0.000000] Kernel command line: console=ttyS0,115200 loglevel=8
>> ip=dhcp root=/dev/nfs nfsroot=10.128.0.9:/nfsroot,v3 rw earlyprintk
>> [    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
>> [    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536
>> bytes)
>> [    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768
>> bytes)
>> [    0.000000] Memory: 126044K/131072K available (2804K kernel code,
>> 126K rwdata, 592K rodata, 141K init, 93K bss, 5028K reserved)
>> [    0.000000] Virtual kernel memory layout:
>> [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
>> [    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
>> [    0.000000]     vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
>> [    0.000000]     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
>> [    0.000000]       .text : 0xc0008000 - 0xc0359550   (3398 kB)
>> [    0.000000]       .init : 0xc035a000 - 0xc037d61c   ( 142 kB)
>> [    0.000000]       .data : 0xc037e000 - 0xc039d920   ( 127 kB)
>> [    0.000000]        .bss : 0xc039d920 - 0xc03b4ff4   (  94 kB)
>> [    0.000000] NR_IRQS:16 nr_irqs:16 16
>> [    0.000000] AT91: PIT: mck rate = 0
>> [    0.000000] ------------[ cut here ]------------
>> [    0.000000] WARNING: CPU: 0 PID: 0 at
>> arch/arm/mach-at91/at91sam926x_time.c:259
>> at91sam926x_pit_init+0x114/0x234()
>> [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted
>> 3.11.0-rc2-next-20130725+ #61
>> [    0.000000] [<c000ca18>] (unwind_backtrace+0x0/0xe0) from
>> [<c000b0f0>] (show_stack+0x10/0x14)
>> [    0.000000] [<c000b0f0>] (show_stack+0x10/0x14) from [<c00144e0>]
>> (warn_slowpath_common+0x5c/0x7c)
>> [    0.000000] [<c00144e0>] (warn_slowpath_common+0x5c/0x7c) from
>> [<c00145b8>] (warn_slowpath_null+0x18/0x1c)
>> [    0.000000] [<c00145b8>] (warn_slowpath_null+0x18/0x1c) from
>> [<c03607b0>] (at91sam926x_pit_init+0x114/0x234)
>> [    0.000000] [<c03607b0>] (at91sam926x_pit_init+0x114/0x234) from
>> [<c035ca4c>] (time_init+0x1c/0x24)
>> [    0.000000] [<c035ca4c>] (time_init+0x1c/0x24) from [<c035a650>]
>> (start_kernel+0x19c/0x2f4)
>> [    0.000000] [<c035a650>] (start_kernel+0x19c/0x2f4) from
>> [<20008040>] (0x20008040)
>> [    0.000000] ---[ end trace 1b75b31a2719ed1c ]---
>> [    0.000000] Division by zero in kernel.
>> [    0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G        W
>> 3.11.0-rc2-next-20130725+ #61
>> [    0.000000] [<c000ca18>] (unwind_backtrace+0x0/0xe0) from
>> [<c000b0f0>] (show_stack+0x10/0x14)
>> [    0.000000] [<c000b0f0>] (show_stack+0x10/0x14) from [<c013f0a0>]
>> (Ldiv0_64+0x8/0x18)
>> [    0.000000] [<c013f0a0>] (Ldiv0_64+0x8/0x18) from [<c003b864>]
>> (__clocksource_updatefreq_scale+0x30/0x104)
>> [    0.000000] [<c003b864>]
>> (__clocksource_updatefreq_scale+0x30/0x104) from [<c003b944>]
>> (__clocksource_register_scale+0xc/0x48)
>> [    0.000000] [<c003b944>] (__clocksource_register_scale+0xc/0x48)
>> from [<c0360810>] (at91sam926x_pit_init+0x174/0x234)
>> [    0.000000] [<c0360810>] (at91sam926x_pit_init+0x174/0x234) from
>> [<c035ca4c>] (time_init+0x1c/0x24)
>> [    0.000000] [<c035ca4c>] (time_init+0x1c/0x24) from [<c035a650>]
>> (start_kernel+0x19c/0x2f4)
>> [    0.000000] [<c035a650>] (start_kernel+0x19c/0x2f4) from
>> [<20008040>] (0x20008040)
>> [    0.000000] Division by zero in kernel.
>> [    0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G        W
>> 3.11.0-rc2-next-20130725+ #61
>> [    0.000000] [<c000ca18>] (unwind_backtrace+0x0/0xe0) from
>> [<c000b0f0>] (show_stack+0x10/0x14)
>> [    0.000000] [<c000b0f0>] (show_stack+0x10/0x14) from [<c013f0a0>]
>> (Ldiv0_64+0x8/0x18)
>> [    0.000000] [<c013f0a0>] (Ldiv0_64+0x8/0x18) from [<c003b76c>]
>> (clocks_calc_mult_shift+0x70/0xa4)
>> [    0.000000] [<c003b76c>] (clocks_calc_mult_shift+0x70/0xa4) from
>> [<c003b8e4>] (__clocksource_updatefreq_scale+0xb0/0x104)
>> [    0.000000] [<c003b8e4>]
>> (__clocksource_updatefreq_scale+0xb0/0x104) from [<c003b944>]
>> (__clocksource_register_scale+0xc/0x48)
>> [    0.000000] [<c003b944>] (__clocksource_register_scale+0xc/0x48)
>> from [<c0360810>] (at91sam926x_pit_init+0x174/0x234)
>> [    0.000000] [<c0360810>] (at91sam926x_pit_init+0x174/0x234) from
>> [<c035ca4c>] (time_init+0x1c/0x24)
>> [    0.000000] [<c035ca4c>] (time_init+0x1c/0x24) from [<c035a650>]
>> (start_kernel+0x19c/0x2f4)
>> [    0.000000] [<c035a650>] (start_kernel+0x19c/0x2f4) from
>> [<20008040>] (0x20008040)
>> [...]
>>
>> Best regards,
>> Richard
> Hi Richard,
>
> First, I'd like to thank you for your tests.
>
> Regarding your problem, it seems that mck rate is calculated as 0, which
> is either a bug in recalc_rate callback
> of master clock driver or a bug in master clock parent clk (no parent
> found or bug in the current parent clk recalc_rate function).
>
> I checked the dts[i] files and I found a missing clock-frequency
> property for main clock of some
> at91sam9x5 boards (those including at91sam9x5cm.dtsi).
>
> You'll find a patch adding this property in attachments.
> Tell me if this works for you. If not I'll make a patch adding pr_info
> to trace the bug.
>
> Anyway, it should work without this property (main clock rate can be
> computed using slow clock rate and MCFR register).
> I will investigate this bug...
I found 2 bugs:
1) the main frequency ready test in recalc_rate function is wrong
2) the common clk framework uses the first match for dt clk registration
    and main clk has this compatible property:
    compatible = "atmel,at91rm9200-clk-main", "fixed-clock";
    As a result the main clk is always bound to the fixed-clock driver
    which set the clock frequency to 0 if 'clock-frequency' property is
    missing.

These bugs will be fixed in next version.
Tell me if you want need thesse patches for testing purpose.
>
> Best Regards,
> Boris
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

  reply	other threads:[~2013-07-26 16:35 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 13:34 [PATCH v2 00/42] ARM: at91: move to common clk framework Boris BREZILLON
2013-07-17 13:37 ` [PATCH v2 01/42] ARM: at91: move at91_pmc.h to include/linux/clk/at91.h Boris BREZILLON
2013-07-23 18:03   ` Jean-Christophe PLAGNIOL-VILLARD
2013-07-23 22:24     ` boris brezillon
2013-07-17 13:40 ` [PATCH v2 02/42] ARM: at91: add PMC main clock Boris BREZILLON
2013-07-17 16:39   ` boris brezillon
2013-07-26 16:41   ` boris brezillon
2013-07-17 13:42 ` [PATCH v2 03/42] ARM: at91: add PMC pll clocks Boris BREZILLON
2013-07-17 13:44 ` [PATCH v2 04/42] ARM: at91: add PMC master clock Boris BREZILLON
2013-07-17 13:45 ` [PATCH v2 05/42] ARM: at91: add PMC system clocks Boris BREZILLON
2013-07-17 13:46 ` [PATCH v2 06/42] ARM: at91: add PMC peripheral clocks Boris BREZILLON
2013-07-17 13:47 ` [PATCH v2 07/42] ARM: at91: add PMC programmable clocks Boris BREZILLON
2013-07-17 13:50 ` [PATCH v2 08/42] ARM: at91: add PMC utmi clock Boris BREZILLON
2013-07-17 13:52 ` [PATCH v2 09/42] ARM: at91: add PMC usb clock Boris BREZILLON
2013-07-17 13:53 ` [PATCH v2 10/42] ARM: at91: add PMC smd clock Boris BREZILLON
2013-07-17 13:55 ` [PATCH v2 11/42] ARM: at91: add PMC clk device tree binding doc Boris BREZILLON
2013-07-17 14:35 ` [PATCH v2 12/42] ARM: at91: move to common clk framework Boris BREZILLON
2013-07-17 14:41 ` [PATCH v2 13/42] ARM: at91: move at91rm9200 SoC to new at91 clk implem Boris BREZILLON
2013-07-17 14:42 ` [PATCH v2 14/42] ARM: at91: move at91sam9260 " Boris BREZILLON
2013-07-17 14:44 ` [PATCH v2 15/42] ARM: at91: move at91sam9261 " Boris BREZILLON
2013-07-17 14:45 ` [PATCH v2 16/42] ARM: at91: move at91sam9263 " Boris BREZILLON
2013-07-17 14:49 ` [PATCH v2 17/42] ARM: at91: move at91sam9g45 " Boris BREZILLON
2013-07-23 22:29   ` boris brezillon
2013-07-17 14:49 ` [PATCH v2 18/42] ARM: at91: move at91sam9n12 " Boris BREZILLON
2013-07-17 14:52 ` [PATCH v2 19/42] ARM: at91: move at91sam9rl " Boris BREZILLON
2013-07-17 14:53 ` [PATCH v2 20/42] ARM: at91: move at91sam9x5 SoCs " Boris BREZILLON
2013-07-17 14:59 ` [PATCH v2 21/42] ARM: at91: move at91sam9 " Boris BREZILLON
2013-07-17 14:59 ` [PATCH v2 22/42] ARM: at91: move sama5d3 " Boris BREZILLON
2013-07-17 15:00 ` [PATCH v2 23/42] ARM: at91: move at91rm9200 boards " Boris BREZILLON
2013-07-17 15:37 ` [PATCH v2 24/42] ARM: at91: move at91sam9 " Boris BREZILLON
2013-07-17 17:13   ` Russell King - ARM Linux
2013-07-17 20:32     ` boris brezillon
2013-07-17 15:46 ` [PATCH v2 25/42] ARM: at91: move pit timer to common clk framework Boris BREZILLON
2013-07-17 15:47 ` [PATCH v2 26/42] USB: ohci-at91: add usb_clk for transition " Boris BREZILLON
2013-07-31  7:56   ` boris brezillon
2013-07-31 14:32     ` Alan Stern
2013-07-17 15:49 ` [PATCH v2 27/42] usb: gadget: at91_udc: " Boris BREZILLON
2013-07-17 15:51 ` [PATCH v2 28/42] ARM: at91/dt: move at91rm9200 SoC to new at91 clk implem Boris BREZILLON
2013-07-17 15:53 ` [PATCH v2 29/42] ARM: at91/dt: move at91sam9260 " Boris BREZILLON
2013-07-17 15:55 ` [PATCH v2 30/42] ARM: at91/dt: move at91sam9263 " Boris BREZILLON
2013-07-17 16:00 ` [PATCH v2 31/42] ARM: at91/dt: move at91sam9g45 " Boris BREZILLON
2013-07-17 16:02 ` [PATCH v2 32/42] ARM: at91/dt: move at91sam9n12 " Boris BREZILLON
2013-07-17 16:05 ` [PATCH v2 33/42] ARM: at91/dt: move at91sam9x5 SoCs " Boris BREZILLON
2013-07-17 16:45 ` [PATCH v2 34/42] ARM: at91/dt: move at91sam9g20 SoC " Boris BREZILLON
2013-07-17 16:50 ` [PATCH v2 35/42] ARM: at91/dt: move sama5d3 SoCs " Boris BREZILLON
2013-07-17 20:06 ` [PATCH v2 36/42] ARM: at91/dt: move sam9260/sam9g20 " Boris BREZILLON
2013-07-17 20:08 ` [PATCH v2 37/42] ARM: at91/dt: move rm9200 boards " Boris BREZILLON
2013-07-17 20:09 ` [PATCH v2 38/42] ARM: at91/dt: move sam9263 " Boris BREZILLON
2013-07-17 20:17 ` [PATCH v2 39/42] ARM: at91/dt: move sam9g45 " Boris BREZILLON
2013-07-17 20:19 ` [PATCH v2 40/42] ARM: at91/dt: move sam9n12 " Boris BREZILLON
2013-07-17 20:21 ` [PATCH v2 41/42] ARM: at91/dt: move sam9x5 " Boris BREZILLON
2013-07-17 20:32 ` [PATCH v2 42/42] ARM: at91/dt: move sama5d3 " Boris BREZILLON
2013-07-18  8:51 ` [PATCH v2 00/42] ARM: at91: move to common clk framework boris brezillon
2013-07-26 14:10 ` Richard Genoud
2013-07-26 15:44   ` boris brezillon
2013-07-26 16:35     ` boris brezillon [this message]
2013-07-29  8:00       ` Richard Genoud
2013-07-29  9:25         ` boris brezillon
2013-07-29 14:18           ` Richard Genoud
2013-07-29 14:34             ` boris brezillon
2013-07-29 15:09               ` Richard Genoud
2013-07-29 15:14                 ` boris brezillon
2013-07-29 16:44                 ` boris brezillon
2013-07-27  4:41 ` boris brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51F2A556.8020109@overkiz.com \
    --to=b.brezillon@overkiz$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox