From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 15/17] clk: at91: add PMC clk device tree binding doc.
Date: Thu, 17 Oct 2013 18:37:45 +0200 [thread overview]
Message-ID: <52601259.2010308@atmel.com> (raw)
In-Reply-To: <1381491532-14738-1-git-send-email-b.brezillon@overkiz.com>
On 11/10/2013 13:38, Boris BREZILLON :
> This patch adds new at91 clks dt bindings documentation.
>
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
It seems good
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> .../devicetree/bindings/clock/at91-clock.txt | 328 ++++++++++++++++++++
> 1 file changed, 328 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/clock/at91-clock.txt
>
> diff --git a/Documentation/devicetree/bindings/clock/at91-clock.txt b/Documentation/devicetree/bindings/clock/at91-clock.txt
> new file mode 100644
> index 0000000..360d8fe
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/at91-clock.txt
> @@ -0,0 +1,328 @@
> +Device Tree Clock bindings for arch-at91
> +
> +This binding uses the common clock binding[1].
> +
> +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
> +
> +Required properties:
> +- compatible : shall be one of the following:
> + "atmel,at91rm9200-pmc" or
> + "atmel,at91sam9g45-pmc" or
> + "atmel,at91sam9n12-pmc" or
> + "atmel,at91sam9x5-pmc" or
> + "atmel,sama5d3-pmc":
> + at91 PMC (Power Management Controller)
> + All at91 specific clocks (clocks defined below) must be child
> + node of the PMC node.
> +
> + "atmel,at91rm9200-clk-main":
> + at91 main oscillator
> +
> + "atmel,at91rm9200-clk-master" or
> + "atmel,at91sam9x5-clk-master":
> + at91 master clock
> +
> + "atmel,at91sam9x5-clk-peripheral" or
> + "atmel,at91rm9200-clk-peripheral":
> + at91 peripheral clocks
> +
> + "atmel,at91rm9200-clk-pll" or
> + "atmel,at91sam9g45-clk-pll" or
> + "atmel,at91sam9g20-clk-pllb" or
> + "atmel,sama5d3-clk-pll":
> + at91 pll clocks
> +
> + "atmel,at91sam9x5-clk-plldiv":
> + at91 plla divisor
> +
> + "atmel,at91rm9200-clk-programmable" or
> + "atmel,at91sam9g45-clk-programmable" or
> + "atmel,at91sam9x5-clk-programmable":
> + at91 programmable clocks
> +
> + "atmel,at91sam9x5-clk-smd":
> + at91 SMD (Soft Modem) clock
> +
> + "atmel,at91rm9200-clk-system":
> + at91 system clocks
> +
> + "atmel,at91rm9200-clk-usb" or
> + "atmel,at91sam9x5-clk-usb" or
> + "atmel,at91sam9n12-clk-usb":
> + at91 usb clock
> +
> + "atmel,at91sam9x5-clk-utmi":
> + at91 utmi clock
> +
> +Required properties for PMC node:
> +- reg : defines the IO memory reserved for the PMC.
> +- interrupts : shall be set to PMC interrupt line.
> +- interrupt-controller : tell that the PMC is an interrupt controller.
> +- #interrupt-cells : must be set to 1. The first cell encodes the interrupt id,
> + and reflect the bit position in the PMC_ER/DR/SR registers.
> + You can use the dt macros defined in dt-bindings/clk/at91.h.
> + 0 (AT91_PMC_MOSCS) -> main oscillator ready
> + 1 (AT91_PMC_LOCKA) -> PLL A ready
> + 2 (AT91_PMC_LOCKB) -> PLL B ready
> + 3 (AT91_PMC_MCKRDY) -> master clock ready
> + 6 (AT91_PMC_LOCKU) -> UTMI PLL clock ready
> + 8 .. 15 (AT91_PMC_PCKRDY(id)) -> programmable clock ready
> + 16 (AT91_PMC_MOSCSELS) -> main oscillator selected
> + 17 (AT91_PMC_MOSCRCS) -> RC main oscillator stabilized
> + 18 (AT91_PMC_CFDEV) -> clock failure detected
> +
> +For example:
> + pmc: pmc at fffffc00 {
> + compatible = "atmel,sama5d3-pmc";
> + interrupts = <1 4 7>;
> + interrupt-controller;
> + #interrupt-cells = <2>;
> +
> + /* put at91 clocks here */
> + };
> +
> +Required properties for main clock:
> +- interrupt-parent : must reference the PMC node.
> +- interrupts : shall be set to "<0>".
> +- #clock-cells : from common clock binding; shall be set to 0.
> +- clocks (optional if clock-frequency is provided) : shall be the slow clock
> + phandle. This clock is used to calculate the main clock rate if
> + "clock-frequency" is not provided.
> +- clock-frequency : the main oscillator frequency.Prefer the use of
> + "clock-frequency" over automatic clock rate calculation.
> +
> +For example:
> + main: mainck {
> + compatible = "atmel,at91rm9200-clk-main";
> + interrupt-parent = <&pmc>;
> + interrupts = <0>;
> + #clock-cells = <0>;
> + clocks = <&ck32k>;
> + clock-frequency = <18432000>;
> + };
> +
> +Required properties for master clock:
> +- interrupt-parent : must reference the PMC node.
> +- interrupts : shall be set to "<3>".
> +- #clock-cells : from common clock binding; shall be set to 0.
> +- clocks : shall be the master clock sources (see atmel datasheet) phandles.
> + e.g. "<&ck32k>, <&main>, <&plla>, <&pllb>".
> +- atmel,clk-output-range : minimum and maximum clock frequency (two u32
> + fields).
> + e.g. output = <0 133000000>; <=> 0 to 133MHz.
> +- atmel,clk-divisors : master clock divisors table (four u32 fields).
> + 0 <=> reserved value.
> + e.g. divisors = <1 2 4 6>;
> +- atmel,master-clk-have-div3-pres : some SoC use the reserved value 7 in the
> + PRES field as CLOCK_DIV3 (e.g sam9x5).
> +
> +For example:
> + mck: mck {
> + compatible = "atmel,at91rm9200-clk-master";
> + interrupt-parent = <&pmc>;
> + interrupts = <3>;
> + #clock-cells = <0>;
> + atmel,clk-output-range = <0 133000000>;
> + atmel,clk-divisors = <1 2 4 0>;
> + };
> +
> +Required properties for peripheral clocks:
> +- #clock-cells : from common clock binding; shall be set to 1. The second cell
> + is used to encode the peripheral id. Peripheral ids are defined in
> + atmel's SoC datasheets.
> +- clocks : shall be the master clock phandle.
> + e.g. clocks = <&mck>;
> +- name: device tree node describing a specific system clock.
> + * atmel,clk-id: peripheral id. See Atmel's datasheets to get a full
> + list of peripheral ids.
> + * atmel,clk-default-divisor (optional, only available for
> + "atmel,at91sam9x5-clk-peripheral"): sam9x5 and sama5d3 SoC provides
> + configurable peripheral clock divisor. If you define this property
> + (u32), the default divisor will be applied when enabling
> + peripheral clock. If not provided the peripheral clock is not
> + divided.
> +
> +For example:
> + periph: periphck {
> + compatible = "atmel,at91sam9x5-clk-peripheral";
> + #clock-cells = <1>;
> + clocks = <&mck>;
> +
> + pioAB_clk {
> + atmel,clk-id = <2>;
> + atmel,clk-default-divisor = <1>;
> + };
> +
> + pioCD_clk {
> + atmel,clk-id = <3>;
> + atmel,clk-default-divisor = <2>;
> + };
> + };
> +
> +
> +Required properties for pll clocks:
> +- interrupt-parent : must reference the PMC node.
> +- interrupts : shall be set to "<1>".
> +- #clock-cells : from common clock binding; shall be set to 0.
> +- clocks : shall be the main clock phandle.
> +- atmel,clk-id : pll id.
> + 0 -> PLL A
> + 1 -> PLL B
> +- atmel,clk-input-range : minimum and maximum source clock frequency (two u32
> + fields).
> + e.g. input = <1 32000000>; <=> 1 to 32MHz.
> +- #atmel,pll-clk-output-range-cells : number of cells reserved for pll output
> + range description. Sould be set to 2, 3
> + or 4.
> + * 1st and 2nd cells represent the frequency range (min-max).
> + * 3rd cell is optional and represents the OUT field value for the given
> + range.
> + * 4th cell is optional and represents the ICPLL field (PLLICPR
> + register)
> +- atmel,pll-clk-output-ranges : pll output frequency ranges + optional parameter
> + depending on #atmel,pll-output-range-cells
> + property value.
> +
> +For example:
> + plla: pllack {
> + compatible = "atmel,at91sam9g45-clk-pll";
> + interrupt-parent = <&pmc>;
> + interrupts = <1>;
> + #clock-cells = <0>;
> + clocks = <&main>;
> + atmel,clk-id = <0>;
> + atmel,clk-input-range = <2000000 32000000>;
> + #atmel,pll-clk-output-range-cells = <4>;
> + atmel,pll-clk-output-ranges = <74500000 800000000 0 0
> + 69500000 750000000 1 0
> + 64500000 700000000 2 0
> + 59500000 650000000 3 0
> + 54500000 600000000 0 1
> + 49500000 550000000 1 1
> + 44500000 500000000 2 1
> + 40000000 450000000 3 1>;
> + };
> +
> +Required properties for plldiv clocks (plldiv = pll / 2):
> +- #clock-cells : from common clock binding; shall be set to 0.
> +- clocks : shall be the plla clock phandle.
> +
> +The pll divisor is equal to 2 and cannot be changed.
> +
> +For example:
> + plladiv: plladivck {
> + compatible = "atmel,at91sam9x5-clk-plldiv";
> + #clock-cells = <0>;
> + clocks = <&plla>;
> + };
> +
> +Required properties for programmable clocks:
> +- interrupt-parent : must reference the PMC node.
> +- #clock-cells : from common clock binding; shall be set to 1. The second cell
> + is used to encode the programmable clock id.
> + Peripheral ids are in atmel's SoC
> + datasheets.
> +- clocks : shall be the programmable clock source phandles.
> + e.g. clocks = <&clk32k>, <&main>, <&plla>, <&pllb>;
> +- name: device tree node describing a specific prog clock.
> + * atmel,clk-id : programmable clock id (register offset from PCKx
> + register).
> + * interrupts : shall be set to "<(8 + id)>".
> +
> +For example:
> + prog: progck {
> + compatible = "atmel,at91sam9g45-clk-programmable";
> + interrupt-parent = <&pmc>;
> + #clock-cells = <1>;
> + clocks = <&clk32k>, <&main>, <&plladiv>, <&utmi>, <&mck>;
> +
> + prog0 {
> + atmel,clk-id = <0>;
> + interrupts = <8>;
> + };
> +
> + prog1 {
> + atmel,clk-id = <1>;
> + interrupts = <9>;
> + };
> + };
> +
> +
> +Required properties for smd clock:
> +- #clock-cells : from common clock binding; shall be set to 0.
> +- clocks : shall be the smd clock source phandles.
> + e.g. clocks = <&plladiv>, <&utmi>;
> +
> +For example:
> + smd: smdck {
> + compatible = "atmel,at91sam9x5-clk-smd";
> + #clock-cells = <0>;
> + clocks = <&plladiv>, <&utmi>;
> + };
> +
> +Required properties for system clocks:
> +- #clock-cells : from common clock binding; shall be set to 1. The second cell
> + is used to encode the system clock id (bit used in SCER/SCDR register).
> +- name: device tree node describing a specific system clock.
> + * id: system clock id (bit position in SCER/SCDR/SCSR registers).
> + See Atmel's datasheet to get a full list of system clock ids.
> +
> +For example:
> + system: systemck {
> + compatible = "atmel,at91rm9200-clk-system";
> + #clock-cells = <1>;
> +
> + ddrck {
> + atmel,clk-id = <2>;
> + clocks = <&mck>;
> + };
> +
> + uhpck {
> + atmel,clk-id = <6>;
> + clocks = <&usb>;
> + };
> +
> + udpck {
> + atmel,clk-id = <7>;
> + clocks = <&usb>;
> + };
> + };
> +
> +
> +Required properties for usb clock:
> +- #clock-cells : from common clock binding; shall be set to 0.
> +- clocks : shall be the smd clock source phandles.
> + e.g. clocks = <&pllb>;
> +- atmel,clk-divisors (only available for "atmel,at91rm9200-clk-usb"):
> + usb clock divisor table.
> + e.g. divisors = <1 2 4 0>;
> +
> +For example:
> + usb: usbck {
> + compatible = "atmel,at91sam9x5-clk-usb";
> + #clock-cells = <0>;
> + clocks = <&plladiv>, <&utmi>;
> + };
> +
> + usb: usbck {
> + compatible = "atmel,at91rm9200-clk-usb";
> + #clock-cells = <0>;
> + clocks = <&pllb>;
> + atmel,clk-divisors = <1 2 4 0>;
> + };
> +
> +
> +Required properties for utmi clock:
> +- interrupt-parent : must reference the PMC node.
> +- interrupts : shall be set to "<AT91_PMC_LOCKU IRQ_TYPE_LEVEL_HIGH>".
> +- #clock-cells : from common clock binding; shall be set to 0.
> +- clocks : shall be the main clock source phandle.
> +
> +For example:
> + utmi: utmick {
> + compatible = "atmel,at91sam9x5-clk-utmi";
> + interrupt-parent = <&pmc>;
> + interrupts = <AT91_PMC_LOCKU IRQ_TYPE_LEVEL_HIGH>;
> + #clock-cells = <0>;
> + clocks = <&main>;
> + };
>
--
Nicolas Ferre
next prev parent reply other threads:[~2013-10-17 16:37 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-11 7:37 [PATCH v4 00/17] ARM: at91: move to common clk framework Boris BREZILLON
2013-10-11 7:37 ` [PATCH v4 01/17] ARM: at91: move at91_pmc.h to include/linux/clk/at91_pmc.h Boris BREZILLON
2013-10-11 16:05 ` Felipe Balbi
2013-10-16 15:29 ` Nicolas Ferre
2013-10-11 7:37 ` [PATCH v4 02/17] ARM: at91: add Kconfig options for common clk support Boris BREZILLON
2013-10-16 15:33 ` Nicolas Ferre
2013-10-11 7:37 ` [PATCH v4 03/17] clk: at91: add PMC base support Boris BREZILLON
2013-10-17 15:46 ` Nicolas Ferre
2013-10-11 8:41 ` [PATCH v4 04/17] clk: at91: add PMC macro file for dt definitions Boris BREZILLON
2013-10-17 15:47 ` Nicolas Ferre
2013-10-11 8:44 ` [PATCH v4 05/17] clk: at91: add PMC main clock Boris BREZILLON
2013-10-17 15:58 ` Nicolas Ferre
2013-10-11 8:48 ` [PATCH v4 06/17] clk: at91: add PMC pll clocks Boris BREZILLON
2013-10-17 15:59 ` Nicolas Ferre
2013-10-11 8:51 ` [PATCH v4 07/17] clk: at91: add PMC master clock Boris BREZILLON
2013-10-17 15:59 ` Nicolas Ferre
2013-10-11 9:41 ` [PATCH v4 08/17] clk: at91: add PMC system clocks Boris BREZILLON
2013-10-17 15:59 ` Nicolas Ferre
2013-10-11 9:44 ` [PATCH v4 09/17] clk: at91: add PMC peripheral clocks Boris BREZILLON
2013-10-17 16:02 ` Nicolas Ferre
2013-10-11 9:53 ` [PATCH v4 10/17] clk: at91: add peripheral clk macros for peripheral clk dt bindings Boris BREZILLON
2013-10-17 16:03 ` Nicolas Ferre
2013-10-11 9:57 ` [PATCH v4 11/17] clk: at91: add PMC programmable clocks Boris BREZILLON
2013-10-17 16:08 ` Nicolas Ferre
2013-10-11 10:22 ` [PATCH v4 12/17] clk: at91: add PMC utmi clock Boris BREZILLON
2013-10-17 16:10 ` Nicolas Ferre
2013-10-11 11:15 ` [PATCH v4 13/17] clk: at91: add PMC usb clock Boris BREZILLON
2013-10-17 16:18 ` Nicolas Ferre
2013-10-11 11:27 ` [PATCH v4 14/17] clk: at91: add PMC smd clock Boris BREZILLON
2013-10-17 16:27 ` Nicolas Ferre
2013-10-17 16:55 ` [PATCH v5 13/17] clk: at91: add PMC usb clock Boris BREZILLON
2013-10-18 7:53 ` Nicolas Ferre
2013-10-11 11:38 ` [PATCH v4 15/17] clk: at91: add PMC clk device tree binding doc Boris BREZILLON
2013-10-17 16:37 ` Nicolas Ferre [this message]
2013-10-11 11:46 ` [PATCH v4 16/17] ARM: at91: move pit timer to common clk framework Boris BREZILLON
2013-10-11 11:49 ` [PATCH v4 17/17] ARM: at91: add new compatible strings for pmc driver Boris BREZILLON
2013-10-18 8:18 ` [PATCH v4 00/17] ARM: at91: move to common clk framework Nicolas Ferre
2013-11-07 23:29 ` Mike Turquette
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=52601259.2010308@atmel.com \
--to=nicolas.ferre@atmel.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).