diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-09-02 12:29:04 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2016-09-02 12:29:04 -0400 |
commit | 7d3ef43f1f99d4250ff120c8965b3e5cd81b3c71 (patch) | |
tree | dd9398cd57f54f966b1b8fd66652a487ee226ecf /Documentation | |
parent | 2b97f10b3896f5c155b28f6c733735fd60f4b3f9 (diff) | |
parent | cddb4800162e543c202cbb05795a324f1093d168 (diff) |
Merge tag 'reset-for-4.9' of git://git.pengutronix.de/git/pza/linux into next/drivers
Merge "Reset controller changes for v4.9" from Philipp Zabel:
- add reset controller driver Kconfig options,
allow building drivers with COMPILE_TEST
- add reset controller driver for UniPhier SoCs
- add reset controller driver for STM32 MCUs
- simplify SoCFPGA reset controller driver a bit
* tag 'reset-for-4.9' of git://git.pengutronix.de/git/pza/linux:
reset: hi6220: allow to compile test driver on other architectures
reset: zynq: add driver Kconfig option
reset: sunxi: add driver Kconfig option
reset: stm32: add driver Kconfig option
reset: socfpga: add driver Kconfig option
reset: pistachio: add driver Kconfig option
reset: meson: add driver Kconfig option
reset: lpc18xx: add driver Kconfig option
reset: berlin: add driver Kconfig option
reset: ath79: add driver Kconfig option
reset: ath79: add missing include
reset: warn on invalid input to reset_control_reset/assert/deassert/status
reset: uniphier: add reset controller driver for UniPhier SoCs
ARM: dts: stm32f429: add missing #reset-cells of rcc
drivers: reset: Add STM32 reset driver
dt-bindings: Document the STM32 reset bindings
dt-bindings: mfd: Add STM32F4 RCC numeric constants into DT include file
reset: socfpga: no need to store modrst_offset
Diffstat (limited to 'Documentation')
3 files changed, 134 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 | ||
diff --git a/Documentation/devicetree/bindings/reset/uniphier-reset.txt b/Documentation/devicetree/bindings/reset/uniphier-reset.txt new file mode 100644 index 000000000000..e6bbfccd56c3 --- /dev/null +++ b/Documentation/devicetree/bindings/reset/uniphier-reset.txt | |||
@@ -0,0 +1,93 @@ | |||
1 | UniPhier reset controller | ||
2 | |||
3 | |||
4 | System reset | ||
5 | ------------ | ||
6 | |||
7 | Required properties: | ||
8 | - compatible: should be one of the following: | ||
9 | "socionext,uniphier-sld3-reset" - for PH1-sLD3 SoC. | ||
10 | "socionext,uniphier-ld4-reset" - for PH1-LD4 SoC. | ||
11 | "socionext,uniphier-pro4-reset" - for PH1-Pro4 SoC. | ||
12 | "socionext,uniphier-sld8-reset" - for PH1-sLD8 SoC. | ||
13 | "socionext,uniphier-pro5-reset" - for PH1-Pro5 SoC. | ||
14 | "socionext,uniphier-pxs2-reset" - for ProXstream2/PH1-LD6b SoC. | ||
15 | "socionext,uniphier-ld11-reset" - for PH1-LD11 SoC. | ||
16 | "socionext,uniphier-ld20-reset" - for PH1-LD20 SoC. | ||
17 | - #reset-cells: should be 1. | ||
18 | |||
19 | Example: | ||
20 | |||
21 | sysctrl@61840000 { | ||
22 | compatible = "socionext,uniphier-ld20-sysctrl", | ||
23 | "simple-mfd", "syscon"; | ||
24 | reg = <0x61840000 0x4000>; | ||
25 | |||
26 | reset { | ||
27 | compatible = "socionext,uniphier-ld20-reset"; | ||
28 | #reset-cells = <1>; | ||
29 | }; | ||
30 | |||
31 | other nodes ... | ||
32 | }; | ||
33 | |||
34 | |||
35 | Media I/O (MIO) reset | ||
36 | --------------------- | ||
37 | |||
38 | Required properties: | ||
39 | - compatible: should be one of the following: | ||
40 | "socionext,uniphier-sld3-mio-reset" - for PH1-sLD3 SoC. | ||
41 | "socionext,uniphier-ld4-mio-reset" - for PH1-LD4 SoC. | ||
42 | "socionext,uniphier-pro4-mio-reset" - for PH1-Pro4 SoC. | ||
43 | "socionext,uniphier-sld8-mio-reset" - for PH1-sLD8 SoC. | ||
44 | "socionext,uniphier-pro5-mio-reset" - for PH1-Pro5 SoC. | ||
45 | "socionext,uniphier-pxs2-mio-reset" - for ProXstream2/PH1-LD6b SoC. | ||
46 | "socionext,uniphier-ld11-mio-reset" - for PH1-LD11 SoC. | ||
47 | "socionext,uniphier-ld20-mio-reset" - for PH1-LD20 SoC. | ||
48 | - #reset-cells: should be 1. | ||
49 | |||
50 | Example: | ||
51 | |||
52 | mioctrl@59810000 { | ||
53 | compatible = "socionext,uniphier-ld20-mioctrl", | ||
54 | "simple-mfd", "syscon"; | ||
55 | reg = <0x59810000 0x800>; | ||
56 | |||
57 | reset { | ||
58 | compatible = "socionext,uniphier-ld20-mio-reset"; | ||
59 | #reset-cells = <1>; | ||
60 | }; | ||
61 | |||
62 | other nodes ... | ||
63 | }; | ||
64 | |||
65 | |||
66 | Peripheral reset | ||
67 | ---------------- | ||
68 | |||
69 | Required properties: | ||
70 | - compatible: should be one of the following: | ||
71 | "socionext,uniphier-ld4-peri-reset" - for PH1-LD4 SoC. | ||
72 | "socionext,uniphier-pro4-peri-reset" - for PH1-Pro4 SoC. | ||
73 | "socionext,uniphier-sld8-peri-reset" - for PH1-sLD8 SoC. | ||
74 | "socionext,uniphier-pro5-peri-reset" - for PH1-Pro5 SoC. | ||
75 | "socionext,uniphier-pxs2-peri-reset" - for ProXstream2/PH1-LD6b SoC. | ||
76 | "socionext,uniphier-ld11-peri-reset" - for PH1-LD11 SoC. | ||
77 | "socionext,uniphier-ld20-peri-reset" - for PH1-LD20 SoC. | ||
78 | - #reset-cells: should be 1. | ||
79 | |||
80 | Example: | ||
81 | |||
82 | perictrl@59820000 { | ||
83 | compatible = "socionext,uniphier-ld20-perictrl", | ||
84 | "simple-mfd", "syscon"; | ||
85 | reg = <0x59820000 0x200>; | ||
86 | |||
87 | reset { | ||
88 | compatible = "socionext,uniphier-ld20-peri-reset"; | ||
89 | #reset-cells = <1>; | ||
90 | }; | ||
91 | |||
92 | other nodes ... | ||
93 | }; | ||