Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Maxime Coquelin and committed by
Philipp Zabel
57bd63a4 ca9f71f0

+41 -7
+35 -7
Documentation/devicetree/bindings/clock/st,stm32-rcc.txt
··· 1 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 5 - describes the clock part. 4 + The RCC IP is both a reset and a clock controller. 6 5 7 - Please also refer to clock-bindings.txt in this directory for common clock 8 - controller binding usage. 6 + Please refer to clock-bindings.txt for common clock controller binding usage. 7 + Please also refer to reset.txt for common reset controller binding usage. 9 8 10 9 Required properties: 11 10 - compatible: Should be "st,stm32f42xx-rcc" 12 11 - reg: should be register base and length as documented in the 13 12 datasheet 13 + - #reset-cells: 1, see below 14 14 - #clock-cells: 2, device nodes should specify the clock in their "clocks" 15 15 property, containing a phandle to the clock device node, an index selecting 16 16 between gated clocks and other clocks and an index specifying the clock to ··· 19 19 Example: 20 20 21 21 rcc: rcc@40023800 { 22 + #reset-cells = <1>; 22 23 #clock-cells = <2> 23 24 compatible = "st,stm32f42xx-rcc", "st,stm32-rcc"; 24 25 reg = <0x40023800 0x400>; ··· 36 35 It is calculated as: index = register_offset / 4 * 32 + bit_offset. 37 36 Where bit_offset is the bit offset within the register (LSB is 0, MSB is 31). 38 37 38 + To simplify the usage and to share bit definition with the reset and clock 39 + drivers of the RCC IP, macros are available to generate the index in 40 + human-readble format. 41 + 42 + For STM32F4 series, the macro are available here: 43 + - include/dt-bindings/mfd/stm32f4-rcc.h 44 + 39 45 Example: 40 46 41 47 /* Gated clock, AHB1 bit 0 (GPIOA) */ 42 48 ... { 43 - clocks = <&rcc 0 0> 49 + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOA)> 44 50 }; 45 51 46 52 /* Gated clock, AHB2 bit 4 (CRYP) */ 47 53 ... { 48 - clocks = <&rcc 0 36> 54 + clocks = <&rcc 0 STM32F4_AHB2_CLOCK(CRYP)> 49 55 }; 50 56 51 57 Specifying other clocks ··· 69 61 70 62 /* Misc clock, FCLK */ 71 63 ... { 72 - clocks = <&rcc 1 1> 64 + clocks = <&rcc 1 STM32F4_APB1_CLOCK(TIM2)> 65 + }; 66 + 67 + 68 + Specifying softreset control of devices 69 + ======================================= 70 + 71 + Device nodes should specify the reset channel required in their "resets" 72 + property, containing a phandle to the reset device node and an index specifying 73 + which channel to use. 74 + The index is the bit number within the RCC registers bank, starting from RCC 75 + base address. 76 + It is calculated as: index = register_offset / 4 * 32 + bit_offset. 77 + Where bit_offset is the bit offset within the register. 78 + For example, for CRC reset: 79 + crc = AHB1RSTR_offset / 4 * 32 + CRCRST_bit_offset = 0x10 / 4 * 32 + 12 = 140 80 + 81 + example: 82 + 83 + timer2 { 84 + resets = <&rcc STM32F4_APB1_RESET(TIM2)>; 73 85 };
+6
Documentation/devicetree/bindings/reset/st,stm32-rcc.txt
··· 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