diff options
author | Maxime Coquelin <mcoquelin.stm32@gmail.com> | 2016-07-22 05:37:48 -0400 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2016-08-24 09:21:27 -0400 |
commit | 57bd63a4934ff5ef6f19a9b87de5e190e91edc80 (patch) | |
tree | dcb5104e5d3dbfaf6d70a047afaa31dc8a38ddad /Documentation | |
parent | ca9f71f05793e8d0972df4c6df30378a073e63c5 (diff) |
dt-bindings: Document the STM32 reset bindings
This adds documentation of device tree bindings for the
STM32 reset controller.
Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/devicetree/bindings/clock/st,stm32-rcc.txt | 42 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/reset/st,stm32-rcc.txt | 6 |
2 files changed, 41 insertions, 7 deletions
diff --git a/Documentation/devicetree/bindings/clock/st,stm32-rcc.txt b/Documentation/devicetree/bindings/clock/st,stm32-rcc.txt index fee3205cdff9..c209de6cfadb 100644 --- a/Documentation/devicetree/bindings/clock/st,stm32-rcc.txt +++ b/Documentation/devicetree/bindings/clock/st,stm32-rcc.txt | |||
@@ -1,16 +1,16 @@ | |||
1 | STMicroelectronics STM32 Reset and Clock Controller | 1 | STMicroelectronics STM32 Reset and Clock Controller |
2 | =================================================== | 2 | =================================================== |
3 | 3 | ||
4 | The RCC IP is both a reset and a clock controller. This documentation only | 4 | The RCC IP is both a reset and a clock controller. |
5 | describes the clock part. | ||
6 | 5 | ||
7 | Please also refer to clock-bindings.txt in this directory for common clock | 6 | Please refer to clock-bindings.txt for common clock controller binding usage. |
8 | controller binding usage. | 7 | Please also refer to reset.txt for common reset controller binding usage. |
9 | 8 | ||
10 | Required properties: | 9 | Required properties: |
11 | - compatible: Should be "st,stm32f42xx-rcc" | 10 | - compatible: Should be "st,stm32f42xx-rcc" |
12 | - reg: should be register base and length as documented in the | 11 | - reg: should be register base and length as documented in the |
13 | datasheet | 12 | datasheet |
13 | - #reset-cells: 1, see below | ||
14 | - #clock-cells: 2, device nodes should specify the clock in their "clocks" | 14 | - #clock-cells: 2, device nodes should specify the clock in their "clocks" |
15 | property, containing a phandle to the clock device node, an index selecting | 15 | property, containing a phandle to the clock device node, an index selecting |
16 | between gated clocks and other clocks and an index specifying the clock to | 16 | between gated clocks and other clocks and an index specifying the clock to |
@@ -19,6 +19,7 @@ Required properties: | |||
19 | Example: | 19 | Example: |
20 | 20 | ||
21 | rcc: rcc@40023800 { | 21 | rcc: rcc@40023800 { |
22 | #reset-cells = <1>; | ||
22 | #clock-cells = <2> | 23 | #clock-cells = <2> |
23 | compatible = "st,stm32f42xx-rcc", "st,stm32-rcc"; | 24 | compatible = "st,stm32f42xx-rcc", "st,stm32-rcc"; |
24 | reg = <0x40023800 0x400>; | 25 | reg = <0x40023800 0x400>; |
@@ -35,16 +36,23 @@ from the first RCC clock enable register (RCC_AHB1ENR, address offset 0x30). | |||
35 | It is calculated as: index = register_offset / 4 * 32 + bit_offset. | 36 | It is calculated as: index = register_offset / 4 * 32 + bit_offset. |
36 | Where bit_offset is the bit offset within the register (LSB is 0, MSB is 31). | 37 | Where bit_offset is the bit offset within the register (LSB is 0, MSB is 31). |
37 | 38 | ||
39 | To simplify the usage and to share bit definition with the reset and clock | ||
40 | drivers of the RCC IP, macros are available to generate the index in | ||
41 | human-readble format. | ||
42 | |||
43 | For STM32F4 series, the macro are available here: | ||
44 | - include/dt-bindings/mfd/stm32f4-rcc.h | ||
45 | |||
38 | Example: | 46 | Example: |
39 | 47 | ||
40 | /* Gated clock, AHB1 bit 0 (GPIOA) */ | 48 | /* Gated clock, AHB1 bit 0 (GPIOA) */ |
41 | ... { | 49 | ... { |
42 | clocks = <&rcc 0 0> | 50 | clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOA)> |
43 | }; | 51 | }; |
44 | 52 | ||
45 | /* Gated clock, AHB2 bit 4 (CRYP) */ | 53 | /* Gated clock, AHB2 bit 4 (CRYP) */ |
46 | ... { | 54 | ... { |
47 | clocks = <&rcc 0 36> | 55 | clocks = <&rcc 0 STM32F4_AHB2_CLOCK(CRYP)> |
48 | }; | 56 | }; |
49 | 57 | ||
50 | Specifying other clocks | 58 | Specifying other clocks |
@@ -61,5 +69,25 @@ Example: | |||
61 | 69 | ||
62 | /* Misc clock, FCLK */ | 70 | /* Misc clock, FCLK */ |
63 | ... { | 71 | ... { |
64 | clocks = <&rcc 1 1> | 72 | clocks = <&rcc 1 STM32F4_APB1_CLOCK(TIM2)> |
73 | }; | ||
74 | |||
75 | |||
76 | Specifying softreset control of devices | ||
77 | ======================================= | ||
78 | |||
79 | Device nodes should specify the reset channel required in their "resets" | ||
80 | property, containing a phandle to the reset device node and an index specifying | ||
81 | which channel to use. | ||
82 | The index is the bit number within the RCC registers bank, starting from RCC | ||
83 | base address. | ||
84 | It is calculated as: index = register_offset / 4 * 32 + bit_offset. | ||
85 | Where bit_offset is the bit offset within the register. | ||
86 | For example, for CRC reset: | ||
87 | crc = AHB1RSTR_offset / 4 * 32 + CRCRST_bit_offset = 0x10 / 4 * 32 + 12 = 140 | ||
88 | |||
89 | example: | ||
90 | |||
91 | timer2 { | ||
92 | resets = <&rcc STM32F4_APB1_RESET(TIM2)>; | ||
65 | }; | 93 | }; |
diff --git a/Documentation/devicetree/bindings/reset/st,stm32-rcc.txt b/Documentation/devicetree/bindings/reset/st,stm32-rcc.txt new file mode 100644 index 000000000000..01db34375192 --- /dev/null +++ b/Documentation/devicetree/bindings/reset/st,stm32-rcc.txt | |||
@@ -0,0 +1,6 @@ | |||
1 | STMicroelectronics STM32 Peripheral Reset Controller | ||
2 | ==================================================== | ||
3 | |||
4 | The RCC IP is both a reset and a clock controller. | ||
5 | |||
6 | Please see Documentation/devicetree/bindings/clock/st,stm32-rcc.txt | ||