Re: [PATCH v2 00/42] ARM: at91: move to common clk framework

2013-07-29 Thread boris brezillon

On 29/07/2013 17:09, Richard Genoud wrote:

2013/7/29 boris brezillon :

On 29/07/2013 16:18, Richard Genoud wrote:

2013/7/29 boris brezillon :

On 29/07/2013 10:00, Richard Genoud wrote:

2013/7/26 boris brezillon :

On 26/07/2013 17:44, boris brezillon wrote:
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.

Hi Boris,

I tested your patch, the clock is not at 0 anymore:
AT91: PIT: mck rate = 833

And it's booting correctly.
There's a small bug I found in the at91sam9x5 dtsi file (ssc id is 28,
not 27). (patch attached)

And yes, I could use your patches for some more tests !

Thanks,

Richard.

Hi Richard,

Thanks for the bug report.

You'll find in attachements the pre-v3 series fixing the detected bugs
(including the ssc clock id bug).

If you need anything else please let me know.

Working on sam9g35ek !
you can add my:
Tested-by: Richard Genoud 


One remark though:
Maybe it would be interesting to keep using the defines in the device
tree for peripheral IDs.
For instance, in arch/arm/boot/dts/at91sam9x5.dtsi : (patch 33)
ssc_clk@28 {
 id = <28>;
};
May be more readable with the SSC id AT91SAM9X5_ID_SSC, as it was
defined in arch/arm/mach-at91/at91sam9x5.c (removed with patch 20)

IMHO, all AT91SAM9X5_ID_xxx in
arch/arm/mach-at91/include/mach/at91sam9x5.h can me moved in
include/dt-bindings/ and used in at91sam9x5.dtsi

This was requested by Jean-Christophe too.
I'll add these macro files and make use of it in next version.

BTW where should I put these macro files
(include/dt-bindings/at91/'soc-name'/peripherals.h) ?

That sounds correct I suppose.

I guess I should do the same for system clks :-).

Should I use macros for address fied of clocks or just for id property (or
drop the address) ?

ssc_clk@AT91SAM9X5_ID_SSC {
 id = ;
};

or

ssc_clk@28 {
 id = ;
};

or

ssc_clk {
 id = ;
};

I would drop the address, since the names are always different (for
instance, dma0_clk and dma1_clk are used).
And the define should also be used here:
ssc0: ssc@f001 { [...]
clocks = <&periph AT91SAM9X5_ID_SSC>;
[...]
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 00/42] ARM: at91: move to common clk framework

2013-07-29 Thread boris brezillon

On 29/07/2013 17:09, Richard Genoud wrote:

2013/7/29 boris brezillon :

On 29/07/2013 16:18, Richard Genoud wrote:

2013/7/29 boris brezillon :

On 29/07/2013 10:00, Richard Genoud wrote:

2013/7/26 boris brezillon :

On 26/07/2013 17:44, boris brezillon wrote:
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.

Hi Boris,

I tested your patch, the clock is not at 0 anymore:
AT91: PIT: mck rate = 833

And it's booting correctly.
There's a small bug I found in the at91sam9x5 dtsi file (ssc id is 28,
not 27). (patch attached)

And yes, I could use your patches for some more tests !

Thanks,

Richard.

Hi Richard,

Thanks for the bug report.

You'll find in attachements the pre-v3 series fixing the detected bugs
(including the ssc clock id bug).

If you need anything else please let me know.

Working on sam9g35ek !
you can add my:
Tested-by: Richard Genoud 


One remark though:
Maybe it would be interesting to keep using the defines in the device
tree for peripheral IDs.
For instance, in arch/arm/boot/dts/at91sam9x5.dtsi : (patch 33)
ssc_clk@28 {
 id = <28>;
};
May be more readable with the SSC id AT91SAM9X5_ID_SSC, as it was
defined in arch/arm/mach-at91/at91sam9x5.c (removed with patch 20)

IMHO, all AT91SAM9X5_ID_xxx in
arch/arm/mach-at91/include/mach/at91sam9x5.h can me moved in
include/dt-bindings/ and used in at91sam9x5.dtsi

This was requested by Jean-Christophe too.
I'll add these macro files and make use of it in next version.

BTW where should I put these macro files
(include/dt-bindings/at91/'soc-name'/peripherals.h) ?

That sounds correct I suppose.

Ok, I will use this path pattern.

Should I use macros for address fied of clocks or just for id property (or
drop the address) ?

ssc_clk@AT91SAM9X5_ID_SSC {
 id = ;
};

or

ssc_clk@28 {
 id = ;
};

or

ssc_clk {
 id = ;
};

I would drop the address, since the names are always different (for
instance, dma0_clk and dma1_clk are used).

Ok, I'll drop the address.

And the define should also be used here:
ssc0: ssc@f001 { [...]
clocks = <&periph AT91SAM9X5_ID_SSC>;
[...]
}
Yes of course, and it should be used for interrupt ids too (but this 
will not be part of this series :)).


Thanks for your review.

Best Regards,

Boris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 00/42] ARM: at91: move to common clk framework

2013-07-29 Thread Richard Genoud
2013/7/29 boris brezillon :
> On 29/07/2013 16:18, Richard Genoud wrote:
>>
>> 2013/7/29 boris brezillon :
>>>
>>> On 29/07/2013 10:00, Richard Genoud wrote:

 2013/7/26 boris brezillon :
>
> On 26/07/2013 17:44, boris brezillon wrote:
> 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.

 Hi Boris,

 I tested your patch, the clock is not at 0 anymore:
 AT91: PIT: mck rate = 833

 And it's booting correctly.
 There's a small bug I found in the at91sam9x5 dtsi file (ssc id is 28,
 not 27). (patch attached)

 And yes, I could use your patches for some more tests !

 Thanks,

 Richard.
>>>
>>> Hi Richard,
>>>
>>> Thanks for the bug report.
>>>
>>> You'll find in attachements the pre-v3 series fixing the detected bugs
>>> (including the ssc clock id bug).
>>>
>>> If you need anything else please let me know.
>>
>> Working on sam9g35ek !
>> you can add my:
>> Tested-by: Richard Genoud 
>>
>>
>> One remark though:
>> Maybe it would be interesting to keep using the defines in the device
>> tree for peripheral IDs.
>> For instance, in arch/arm/boot/dts/at91sam9x5.dtsi : (patch 33)
>> ssc_clk@28 {
>> id = <28>;
>> };
>> May be more readable with the SSC id AT91SAM9X5_ID_SSC, as it was
>> defined in arch/arm/mach-at91/at91sam9x5.c (removed with patch 20)
>>
>> IMHO, all AT91SAM9X5_ID_xxx in
>> arch/arm/mach-at91/include/mach/at91sam9x5.h can me moved in
>> include/dt-bindings/ and used in at91sam9x5.dtsi
>
> This was requested by Jean-Christophe too.
> I'll add these macro files and make use of it in next version.
>
> BTW where should I put these macro files
> (include/dt-bindings/at91/'soc-name'/peripherals.h) ?
That sounds correct I suppose.
> Should I use macros for address fied of clocks or just for id property (or
> drop the address) ?
>
> ssc_clk@AT91SAM9X5_ID_SSC {
> id = ;
> };
>
> or
>
> ssc_clk@28 {
> id = ;
> };
>
> or
>
> ssc_clk {
> id = ;
> };
I would drop the address, since the names are always different (for
instance, dma0_clk and dma1_clk are used).
And the define should also be used here:
ssc0: ssc@f001 { [...]
clocks = <&periph AT91SAM9X5_ID_SSC>;
[...]
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 00/42] ARM: at91: move to common clk framework

2013-07-29 Thread boris brezillon

On 29/07/2013 16:18, Richard Genoud wrote:

2013/7/29 boris brezillon :

On 29/07/2013 10:00, Richard Genoud wrote:

2013/7/26 boris brezillon :

On 26/07/2013 17:44, boris brezillon wrote:
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.

Hi Boris,

I tested your patch, the clock is not at 0 anymore:
AT91: PIT: mck rate = 833

And it's booting correctly.
There's a small bug I found in the at91sam9x5 dtsi file (ssc id is 28,
not 27). (patch attached)

And yes, I could use your patches for some more tests !

Thanks,

Richard.

Hi Richard,

Thanks for the bug report.

You'll find in attachements the pre-v3 series fixing the detected bugs
(including the ssc clock id bug).

If you need anything else please let me know.

Working on sam9g35ek !
you can add my:
Tested-by: Richard Genoud 


One remark though:
Maybe it would be interesting to keep using the defines in the device
tree for peripheral IDs.
For instance, in arch/arm/boot/dts/at91sam9x5.dtsi : (patch 33)
ssc_clk@28 {
id = <28>;
};
May be more readable with the SSC id AT91SAM9X5_ID_SSC, as it was
defined in arch/arm/mach-at91/at91sam9x5.c (removed with patch 20)

IMHO, all AT91SAM9X5_ID_xxx in
arch/arm/mach-at91/include/mach/at91sam9x5.h can me moved in
include/dt-bindings/ and used in at91sam9x5.dtsi

This was requested by Jean-Christophe too.
I'll add these macro files and make use of it in next version.

BTW where should I put these macro files 
(include/dt-bindings/at91/'soc-name'/peripherals.h) ?
Should I use macros for address fied of clocks or just for id property 
(or drop the address) ?


ssc_clk@AT91SAM9X5_ID_SSC {
id = ;
};

or

ssc_clk@28 {
id = ;
};

or

ssc_clk {
id = ;
};


Best regards,
Richard.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 00/42] ARM: at91: move to common clk framework

2013-07-29 Thread Richard Genoud
2013/7/29 boris brezillon :
> On 29/07/2013 10:00, Richard Genoud wrote:
>>
>> 2013/7/26 boris brezillon :
>>>
>>> On 26/07/2013 17:44, boris brezillon wrote:
>>> 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.
>>
>> Hi Boris,
>>
>> I tested your patch, the clock is not at 0 anymore:
>> AT91: PIT: mck rate = 833
>>
>> And it's booting correctly.
>> There's a small bug I found in the at91sam9x5 dtsi file (ssc id is 28,
>> not 27). (patch attached)
>>
>> And yes, I could use your patches for some more tests !
>>
>> Thanks,
>>
>> Richard.
>
> Hi Richard,
>
> Thanks for the bug report.
>
> You'll find in attachements the pre-v3 series fixing the detected bugs
> (including the ssc clock id bug).
>
> If you need anything else please let me know.

Working on sam9g35ek !
you can add my:
Tested-by: Richard Genoud 


One remark though:
Maybe it would be interesting to keep using the defines in the device
tree for peripheral IDs.
For instance, in arch/arm/boot/dts/at91sam9x5.dtsi : (patch 33)
ssc_clk@28 {
id = <28>;
};
May be more readable with the SSC id AT91SAM9X5_ID_SSC, as it was
defined in arch/arm/mach-at91/at91sam9x5.c (removed with patch 20)

IMHO, all AT91SAM9X5_ID_xxx in
arch/arm/mach-at91/include/mach/at91sam9x5.h can me moved in
include/dt-bindings/ and used in at91sam9x5.dtsi

Best regards,
Richard.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 00/42] ARM: at91: move to common clk framework

2013-07-29 Thread Richard Genoud
2013/7/26 boris brezillon :
> On 26/07/2013 17:44, boris brezillon wrote:
> 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.

Hi Boris,

I tested your patch, the clock is not at 0 anymore:
AT91: PIT: mck rate = 833

And it's booting correctly.
There's a small bug I found in the at91sam9x5 dtsi file (ssc id is 28,
not 27). (patch attached)

And yes, I could use your patches for some more tests !

Thanks,

Richard.


0001-ARM-at91-dt-at91sam9x5-fix-wrong-SSC-clock-ID.patch
Description: Binary data


Re: [PATCH v2 00/42] ARM: at91: move to common clk framework

2013-07-26 Thread boris brezillon

Hello,

This email is a feedback on the discussion I had with Jean-Christophe 
last Wednesday.


As discussed with him, I will try to split this patch series in order to

1) limit the number of patches to review
2) limit the number of SoCs/boards to test

The new at91 clk support on non-dt boards was also discussed, and 
Jean-Christophe thinks this is not mandatory (and should be dropped). 
Does anyone see an interest in keeping this support in the next version 
of the patch series ?


Here is how he though this patch series could be splitted:
1) at91 common clk implemenations + 1 SoC and the associated dt boards
2) 1 SoC and the associated dt boards
...)1 SoC and the associated dt boards

I tried to prepare the first new patch series by including only 
at91sam9260/9g20 SoCs and boards but I failed. In fact I succeed but it 
breaks multi-soc support (using dt) because we can't use both the common 
clk framework and the at91 specific clk framework (they both provides 
the same set of functions and structures definitions).


Should I break the multi-soc support to add at91 common clk ?

The only SoC that could be added without breaking multi-soc support is 
the sama5 as it uses a different arm architecture (ARMv7) and thus 
cannot be compiled in the same kernel as other at91 socs.


Should I choose the sama5 for the next patch series ?

Jean-Christophe, could you at least review the 11 first patches of this 
series ?
I won't send any new version until I get some feedback from you on the 
clk implementations and dt bindings...


Berst Regards,

Boris


Le 17/07/2013 15:34, Boris BREZILLON a écrit :

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

Boris BREZILLON (42):
   ARM: at91: move at91_pmc.h to include/linux/clk/at91.h
   ARM: at91: add PMC main clock
   ARM: at91: add PMC pll clocks
   ARM: at91: add PMC master clock
   ARM: at91: add PMC system clocks
   ARM: at91: add PMC peripheral clocks
   ARM: at91: add PMC programmable clocks
   ARM: at91: add PMC utmi clock
   ARM: at91: add PMC usb clock
   ARM: at91: add PMC smd clock
   ARM: at91: add PMC clk device tree binding doc.
   ARM: at91: move to common clk framework
   ARM: at91: move at91rm9200 SoC to new at91 clk implem
   ARM: at91: move at91sam9260 SoC to new at91 clk implem
   ARM: at91: move at91sam9261 SoC to new at91 clk implem
   ARM: at91: move at91sam9263 SoC to new at91 clk implem
   ARM: at91: move at91sam9g45 SoC to new at91 clk implem
   ARM: at91: move at91sam9n12 SoC to new at91 clk implem
   ARM: at91: move at91sam9rl SoC to new at91 clk implem
   ARM: at91: move at91sam9x5 SoCs to new at91 clk implem
   ARM: at91: move at91sam9 SoCs to new at91 clk implem
   ARM: at91: move sama5d3 SoCs to new at91 clk implem
   ARM: at91: move at91rm9200 boards to new at91 clk implem
   ARM: at91: move at91sam9 boards to new at91 clk implem
   ARM: at91: move pit timer to common clk framework
   USB: ohci-at91: add usb_clk for transition to common clk framework
   usb: gadget: at91_udc: add usb_clk for transition to common clk
 framework
   ARM: at91/dt: move at91rm9200 SoC to new at91 clk implem
   ARM: at91/dt: move at91sam9260 SoC to new at91 clk implem
   ARM: at91/dt: move at91sam9263 SoC to new at91 clk implem
   ARM: at91/dt: move at91sam9g45 SoC to new at91 clk implem
   ARM: at91/dt: move at91sam9n12 SoC to new at91 clk implem
   ARM: at91/dt: move at91sam9x5 SoCs to new at91 clk implem
   ARM: at91/dt: move at91sam9g20 SoC to new at91 clk implem
   ARM: at91/dt: move sama5d3 SoCs to new at

Re: [PATCH v2 00/42] ARM: at91: move to common clk framework

2013-07-26 Thread boris brezillon

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.00] Booting Linux on physical CPU 0x0
[0.00] Linux version 3.11.0-rc2-next-20130725+
(rgenoud@lnx-rg) (gcc version 4.7.3 (Buildroot
2013.05-00157-g6d1e60b-dirty) ) #61 Fri Jul 26 15:30:13 CEST 2013
[0.00] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ),
cr=00053177
[0.00] CPU: VIVT data cache, VIVT instruction cache
[0.00] Machine: Atmel AT91SAM (Device Tree), model: Atmel
AT91SAM9G35-EK
[0.00] bootconsole [earlycon0] enabled
[0.00] Memory policy: ECC disabled, Data cache writeback
[0.00] AT91: Detected soc type: at91sam9x5
[0.00] AT91: Detected soc subtype: at91sam9g35
[0.00] AT91: sram at 0x30 of 0x8000 mapped at 0xfef7
[0.00] On node 0 totalpages: 32768
[0.00] free_area_init_node: node 0, pgdat c039d208,
node_mem_map c03b5000
[0.00]   Normal zone: 256 pages used for memmap
[0.00]   Normal zone: 0 pages reserved
[0.00]   Normal zone: 32768 pages, LIFO batch:7
[0.00] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[0.00] pcpu-alloc: [0] 0
[0.00] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 32512
[0.00] Kernel command line: console=ttyS0,115200 loglevel=8
ip=dhcp root=/dev/nfs nfsroot=10.128.0.9:/nfsroot,v3 rw earlyprintk
[0.00] PID hash table entries: 512 (order: -1, 2048 bytes)
[0.00] Dentry cache hash table entries: 16384 (order: 4, 65536
bytes)
[0.00] Inode-cache hash table entries: 8192 (order: 3, 32768
bytes)
[0.00] Memory: 126044K/131072K available (2804K kernel code,
126K rwdata, 592K rodata, 141K init, 93K bss, 5028K reserved)
[0.00] Virtual kernel memory layout:
[0.00] vector  : 0x - 0x1000   (   4 kB)
[0.00] fixmap  : 0xfff0 - 0xfffe   ( 896 kB)
[0.00] vmalloc : 0xc880 - 0xff00   ( 872 MB)
[0.00] lowmem  : 0xc000 - 0xc800   ( 128 MB)
[0.00]   .text : 0xc0008000 - 0xc0359550   (3398 kB)
[0.00]   .init : 0xc035a000 - 0xc037d61c   ( 142 kB)
[0.00]   .data : 0xc037e000 - 0xc039d920   ( 127 kB)
[0.00].bss : 0xc039d920 - 0xc03b4ff4   (  94 kB)
[0.00] NR_IRQS:16 nr_irqs:16 16
[0.00] AT91: PIT: mck rate = 0
[0.00] [ cut here ]
[0.00] WARNING: CPU: 0 PID: 0 at
arch/arm/mach-at91/at91sam926x_time.c:259
at91sam926x_pit_init+0x114/0x234()
[0.00] CPU: 0 PID: 0 Comm: swapper Not tainted
3.11.0-rc2-next-20130725+ #61
[0.00] [] (unwind_backtrace+0x0/0xe0) from
[] (show_stack+0x10/0x14)
[0.00] [] (show_stack+0x10/0x14) from []
(warn_slowpath_common+0x5c/0x7c)
[0.00] [] (warn_slowpath_common+0x5c/0x7c) from
[] (warn_slowpath_null+0x18/0x1c)
[0.00] [] (warn_slowpath_null+0x18/0x1c) from
[] (at91sam926x_pit_init+0x114/0x234)
[0.00] [] (at91sam926x_pit_init+0x114/0x234) from
[] (time_init+0x1c/0x24)
[0.00] [] (time_init+0x1c/0x24) from

Re: [PATCH v2 00/42] ARM: at91: move to common clk framework

2013-07-26 Thread boris brezillon

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.00] Booting Linux on physical CPU 0x0
[0.00] Linux version 3.11.0-rc2-next-20130725+ (rgenoud@lnx-rg) (gcc 
version 4.7.3 (Buildroot 2013.05-00157-g6d1e60b-dirty) ) #61 Fri Jul 26 
15:30:13 CEST 2013
[0.00] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
[0.00] CPU: VIVT data cache, VIVT instruction cache
[0.00] Machine: Atmel AT91SAM (Device Tree), model: Atmel AT91SAM9G35-EK
[0.00] bootconsole [earlycon0] enabled
[0.00] Memory policy: ECC disabled, Data cache writeback
[0.00] AT91: Detected soc type: at91sam9x5
[0.00] AT91: Detected soc subtype: at91sam9g35
[0.00] AT91: sram at 0x30 of 0x8000 mapped at 0xfef7
[0.00] On node 0 totalpages: 32768
[0.00] free_area_init_node: node 0, pgdat c039d208, node_mem_map 
c03b5000
[0.00]   Normal zone: 256 pages used for memmap
[0.00]   Normal zone: 0 pages reserved
[0.00]   Normal zone: 32768 pages, LIFO batch:7
[0.00] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[0.00] pcpu-alloc: [0] 0
[0.00] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 32512
[0.00] Kernel command line: console=ttyS0,115200 loglevel=8 ip=dhcp 
root=/dev/nfs nfsroot=10.128.0.9:/nfsroot,v3 rw earlyprintk
[0.00] PID hash table entries: 512 (order: -1, 2048 bytes)
[0.00] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[0.00] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[0.00] Memory: 126044K/131072K available (2804K kernel code, 126K 
rwdata, 592K rodata, 141K init, 93K bss, 5028K reserved)
[0.00] Virtual kernel memory layout:
[0.00] vector  : 0x - 0x1000   (   4 kB)
[0.00] fixmap  : 0xfff0 - 0xfffe   ( 896 kB)
[0.00] vmalloc : 0xc880 - 0xff00   ( 872 MB)
[0.00] lowmem  : 0xc000 - 0xc800   ( 128 MB)
[0.00]   .text : 0xc0008000 - 0xc0359550   (3398 kB)
[0.00]   .init : 0xc035a000 - 0xc037d61c   ( 142 kB)
[0.00]   .data : 0xc037e000 - 0xc039d920   ( 127 kB)
[0.00].bss : 0xc039d920 - 0xc03b4ff4   (  94 kB)
[0.00] NR_IRQS:16 nr_irqs:16 16
[0.00] AT91: PIT: mck rate = 0
[0.00] [ cut here ]
[0.00] WARNING: CPU: 0 PID: 0 at 
arch/arm/mach-at91/at91sam926x_time.c:259 at91sam926x_pit_init+0x114/0x234()
[0.00] CPU: 0 PID: 0 Comm: swapper Not tainted 
3.11.0-rc2-next-20130725+ #61
[0.00] [] (unwind_backtrace+0x0/0xe0) from [] 
(show_stack+0x10/0x14)
[0.00] [] (show_stack+0x10/0x14) from [] 
(warn_slowpath_common+0x5c/0x7c)
[0.00] [] (warn_slowpath_common+0x5c/0x7c) from [] 
(warn_slowpath_null+0x18/0x1c)
[0.00] [] (warn_slowpath_null+0x18/0x1c) from [] 
(at91sam926x_pit_init+0x114/0x234)
[0.00] [] (at91sam926x_pit_init+0x114/0x234) from 
[] (time_init+0x1c/0x24)
[0.00] [] (time_init+0x1c/0x24) from [] 
(start_kernel+0x19c/0x2f

Re: [PATCH v2 00/42] ARM: at91: move to common clk framework

2013-07-26 Thread Richard Genoud
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.00] Booting Linux on physical CPU 0x0
[0.00] Linux version 3.11.0-rc2-next-20130725+ (rgenoud@lnx-rg) (gcc 
version 4.7.3 (Buildroot 2013.05-00157-g6d1e60b-dirty) ) #61 Fri Jul 26 
15:30:13 CEST 2013
[0.00] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
[0.00] CPU: VIVT data cache, VIVT instruction cache
[0.00] Machine: Atmel AT91SAM (Device Tree), model: Atmel AT91SAM9G35-EK
[0.00] bootconsole [earlycon0] enabled
[0.00] Memory policy: ECC disabled, Data cache writeback
[0.00] AT91: Detected soc type: at91sam9x5
[0.00] AT91: Detected soc subtype: at91sam9g35
[0.00] AT91: sram at 0x30 of 0x8000 mapped at 0xfef7
[0.00] On node 0 totalpages: 32768
[0.00] free_area_init_node: node 0, pgdat c039d208, node_mem_map 
c03b5000
[0.00]   Normal zone: 256 pages used for memmap
[0.00]   Normal zone: 0 pages reserved
[0.00]   Normal zone: 32768 pages, LIFO batch:7
[0.00] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[0.00] pcpu-alloc: [0] 0 
[0.00] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 32512
[0.00] Kernel command line: console=ttyS0,115200 loglevel=8 ip=dhcp 
root=/dev/nfs nfsroot=10.128.0.9:/nfsroot,v3 rw earlyprintk
[0.00] PID hash table entries: 512 (order: -1, 2048 bytes)
[0.00] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[0.00] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[0.00] Memory: 126044K/131072K available (2804K kernel code, 126K 
rwdata, 592K rodata, 141K init, 93K bss, 5028K reserved)
[0.00] Virtual kernel memory layout:
[0.00] vector  : 0x - 0x1000   (   4 kB)
[0.00] fixmap  : 0xfff0 - 0xfffe   ( 896 kB)
[0.00] vmalloc : 0xc880 - 0xff00   ( 872 MB)
[0.00] lowmem  : 0xc000 - 0xc800   ( 128 MB)
[0.00]   .text : 0xc0008000 - 0xc0359550   (3398 kB)
[0.00]   .init : 0xc035a000 - 0xc037d61c   ( 142 kB)
[0.00]   .data : 0xc037e000 - 0xc039d920   ( 127 kB)
[0.00].bss : 0xc039d920 - 0xc03b4ff4   (  94 kB)
[0.00] NR_IRQS:16 nr_irqs:16 16
[0.00] AT91: PIT: mck rate = 0
[0.00] [ cut here ]
[0.00] WARNING: CPU: 0 PID: 0 at 
arch/arm/mach-at91/at91sam926x_time.c:259 at91sam926x_pit_init+0x114/0x234()
[0.00] CPU: 0 PID: 0 Comm: swapper Not tainted 
3.11.0-rc2-next-20130725+ #61
[0.00] [] (unwind_backtrace+0x0/0xe0) from [] 
(show_stack+0x10/0x14)
[0.00] [] (show_stack+0x10/0x14) from [] 
(warn_slowpath_common+0x5c/0x7c)
[0.00] [] (warn_slowpath_common+0x5c/0x7c) from [] 
(warn_slowpath_null+0x18/0x1c)
[0.00] [] (warn_slowpath_null+0x18/0x1c) from [] 
(at91sam926x_pit_init+0x114/0x234)
[0.00] [] (at91sam926x_pit_init+0x114/0x234) from 
[] (time_init+0x1c/0x24)
[0.00] [] (time_init+0x1c/0x

Re: [PATCH v2 00/42] ARM: at91: move to common clk framework

2013-07-18 Thread boris brezillon

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.

This was tested on kizbox board too.


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

Boris BREZILLON (42):
   ARM: at91: move at91_pmc.h to include/linux/clk/at91.h
   ARM: at91: add PMC main clock
   ARM: at91: add PMC pll clocks
   ARM: at91: add PMC master clock
   ARM: at91: add PMC system clocks
   ARM: at91: add PMC peripheral clocks
   ARM: at91: add PMC programmable clocks
   ARM: at91: add PMC utmi clock
   ARM: at91: add PMC usb clock
   ARM: at91: add PMC smd clock
   ARM: at91: add PMC clk device tree binding doc.
   ARM: at91: move to common clk framework
   ARM: at91: move at91rm9200 SoC to new at91 clk implem
   ARM: at91: move at91sam9260 SoC to new at91 clk implem
   ARM: at91: move at91sam9261 SoC to new at91 clk implem
   ARM: at91: move at91sam9263 SoC to new at91 clk implem
   ARM: at91: move at91sam9g45 SoC to new at91 clk implem
   ARM: at91: move at91sam9n12 SoC to new at91 clk implem
   ARM: at91: move at91sam9rl SoC to new at91 clk implem
   ARM: at91: move at91sam9x5 SoCs to new at91 clk implem
   ARM: at91: move at91sam9 SoCs to new at91 clk implem
   ARM: at91: move sama5d3 SoCs to new at91 clk implem
   ARM: at91: move at91rm9200 boards to new at91 clk implem
   ARM: at91: move at91sam9 boards to new at91 clk implem
   ARM: at91: move pit timer to common clk framework
   USB: ohci-at91: add usb_clk for transition to common clk framework
   usb: gadget: at91_udc: add usb_clk for transition to common clk
 framework
   ARM: at91/dt: move at91rm9200 SoC to new at91 clk implem
   ARM: at91/dt: move at91sam9260 SoC to new at91 clk implem
   ARM: at91/dt: move at91sam9263 SoC to new at91 clk implem
   ARM: at91/dt: move at91sam9g45 SoC to new at91 clk implem
   ARM: at91/dt: move at91sam9n12 SoC to new at91 clk implem
   ARM: at91/dt: move at91sam9x5 SoCs to new at91 clk implem
   ARM: at91/dt: move at91sam9g20 SoC to new at91 clk implem
   ARM: at91/dt: move sama5d3 SoCs to new at91 clk implem
   ARM: at91/dt: move sam9260/sam9g20 to new at91 clk implem
   ARM: at91/dt: move rm9200 boards to new at91 clk implem
   ARM: at91/dt: move sam9263 boards to new at91 clk implem
   ARM: at91/dt: move sam9g45 boards to new at91 clk implem
   ARM: at91/dt: move sam9n12 boards to new at91 clk implem
   ARM: at91/dt: move sam9x5 boards to new at91 clk implem
   ARM: at91/dt: move sama5d3 boards to new at91 clk implem

  .../devicetree/bindings/clock/at91-clock.txt   |  262 ++
  arch/arm/boot/dts/animeo_ip.dts|   17 +-
  arch/arm/boot/dts/at91-ariag25.dts |   17 +-
  arch/arm/boot/dts/at91rm9200.dtsi  |  231 +
  arch/arm/boot/dts/at91rm9200ek.dts |   17 +-
  arch/arm/boot/dts/at91sam9260.dtsi |  236 +
  arch/arm/boot/dts/at91sam9263.dtsi |  237 +
  arch/arm/boot/dts/at91sam9263ek.dts|   17 +-
  arch/arm/boot/dts/at91sam9g15.dtsi |1 +
  arch/arm/boot/dts/at91sam9g20.dtsi |   37 +
  arch/arm/boot/dts/at91sam9g20ek_common.dtsi|   17 +-
  arch/arm/boot/dts/at91sam9g25.dtsi |3 +
  arch/arm/boot/dts/at91sam9g35.dtsi |2 +
  arch/arm/boot/dts/at91sam9g45.dtsi |  257 +
  arch/arm/boot/dts/at91sam9m10g45ek.dts |   17 +-
  arch/arm/boot/dts/at91sam9n12.dtsi |  251 +
  arch/arm/boot/dts/at91sam9n12ek.dts|   17 +-
  arch/arm/boot/dts/

[PATCH v2 00/42] ARM: at91: move to common clk framework

2013-07-17 Thread Boris BREZILLON
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

Boris BREZILLON (42):
  ARM: at91: move at91_pmc.h to include/linux/clk/at91.h
  ARM: at91: add PMC main clock
  ARM: at91: add PMC pll clocks
  ARM: at91: add PMC master clock
  ARM: at91: add PMC system clocks
  ARM: at91: add PMC peripheral clocks
  ARM: at91: add PMC programmable clocks
  ARM: at91: add PMC utmi clock
  ARM: at91: add PMC usb clock
  ARM: at91: add PMC smd clock
  ARM: at91: add PMC clk device tree binding doc.
  ARM: at91: move to common clk framework
  ARM: at91: move at91rm9200 SoC to new at91 clk implem
  ARM: at91: move at91sam9260 SoC to new at91 clk implem
  ARM: at91: move at91sam9261 SoC to new at91 clk implem
  ARM: at91: move at91sam9263 SoC to new at91 clk implem
  ARM: at91: move at91sam9g45 SoC to new at91 clk implem
  ARM: at91: move at91sam9n12 SoC to new at91 clk implem
  ARM: at91: move at91sam9rl SoC to new at91 clk implem
  ARM: at91: move at91sam9x5 SoCs to new at91 clk implem
  ARM: at91: move at91sam9 SoCs to new at91 clk implem
  ARM: at91: move sama5d3 SoCs to new at91 clk implem
  ARM: at91: move at91rm9200 boards to new at91 clk implem
  ARM: at91: move at91sam9 boards to new at91 clk implem
  ARM: at91: move pit timer to common clk framework
  USB: ohci-at91: add usb_clk for transition to common clk framework
  usb: gadget: at91_udc: add usb_clk for transition to common clk
framework
  ARM: at91/dt: move at91rm9200 SoC to new at91 clk implem
  ARM: at91/dt: move at91sam9260 SoC to new at91 clk implem
  ARM: at91/dt: move at91sam9263 SoC to new at91 clk implem
  ARM: at91/dt: move at91sam9g45 SoC to new at91 clk implem
  ARM: at91/dt: move at91sam9n12 SoC to new at91 clk implem
  ARM: at91/dt: move at91sam9x5 SoCs to new at91 clk implem
  ARM: at91/dt: move at91sam9g20 SoC to new at91 clk implem
  ARM: at91/dt: move sama5d3 SoCs to new at91 clk implem
  ARM: at91/dt: move sam9260/sam9g20 to new at91 clk implem
  ARM: at91/dt: move rm9200 boards to new at91 clk implem
  ARM: at91/dt: move sam9263 boards to new at91 clk implem
  ARM: at91/dt: move sam9g45 boards to new at91 clk implem
  ARM: at91/dt: move sam9n12 boards to new at91 clk implem
  ARM: at91/dt: move sam9x5 boards to new at91 clk implem
  ARM: at91/dt: move sama5d3 boards to new at91 clk implem

 .../devicetree/bindings/clock/at91-clock.txt   |  262 ++
 arch/arm/boot/dts/animeo_ip.dts|   17 +-
 arch/arm/boot/dts/at91-ariag25.dts |   17 +-
 arch/arm/boot/dts/at91rm9200.dtsi  |  231 +
 arch/arm/boot/dts/at91rm9200ek.dts |   17 +-
 arch/arm/boot/dts/at91sam9260.dtsi |  236 +
 arch/arm/boot/dts/at91sam9263.dtsi |  237 +
 arch/arm/boot/dts/at91sam9263ek.dts|   17 +-
 arch/arm/boot/dts/at91sam9g15.dtsi |1 +
 arch/arm/boot/dts/at91sam9g20.dtsi |   37 +
 arch/arm/boot/dts/at91sam9g20ek_common.dtsi|   17 +-
 arch/arm/boot/dts/at91sam9g25.dtsi |3 +
 arch/arm/boot/dts/at91sam9g35.dtsi |2 +
 arch/arm/boot/dts/at91sam9g45.dtsi |  257 +
 arch/arm/boot/dts/at91sam9m10g45ek.dts |   17 +-
 arch/arm/boot/dts/at91sam9n12.dtsi |  251 +
 arch/arm/boot/dts/at91sam9n12ek.dts|   17 +-
 arch/arm/boot/dts/at91sam9x25.dtsi |   25 +-
 arch/arm/boot/dts/at91sam9x35.dtsi |3 +
 arch/arm/boot/dts/at91sam9x5.dtsi