Commit 982b1592 authored by Gabriel Fernandez's avatar Gabriel Fernandez Committed by Alexandre TORGUE

dt-bindings: mfd: stm32f4: Fix STM32F4_X_CLOCK() macro

Macro to select a clock was not correct.

Offset of enable register starts at 0x30, then calculation to select a bit is:
(@enable_reg - 0x30) / 4 * 32 + bit_to_select
Tested-by: default avatarM'boumba Cedric Madianga <cedric.madianga@gmail.com>
Acked-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Acked-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarGabriel Fernandez <gabriel.fernandez@st.com>
Signed-off-by: default avatarAlexandre TORGUE <alexandre.torgue@st.com>
parent 82da3bbf
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#define STM32F4_RCC_AHB1_OTGHS 29 #define STM32F4_RCC_AHB1_OTGHS 29
#define STM32F4_AHB1_RESET(bit) (STM32F4_RCC_AHB1_##bit + (0x10 * 8)) #define STM32F4_AHB1_RESET(bit) (STM32F4_RCC_AHB1_##bit + (0x10 * 8))
#define STM32F4_AHB1_CLOCK(bit) (STM32F4_RCC_AHB1_##bit + (0x30 * 8)) #define STM32F4_AHB1_CLOCK(bit) (STM32F4_RCC_AHB1_##bit)
/* AHB2 */ /* AHB2 */
...@@ -36,13 +36,13 @@ ...@@ -36,13 +36,13 @@
#define STM32F4_RCC_AHB2_OTGFS 7 #define STM32F4_RCC_AHB2_OTGFS 7
#define STM32F4_AHB2_RESET(bit) (STM32F4_RCC_AHB2_##bit + (0x14 * 8)) #define STM32F4_AHB2_RESET(bit) (STM32F4_RCC_AHB2_##bit + (0x14 * 8))
#define STM32F4_AHB2_CLOCK(bit) (STM32F4_RCC_AHB2_##bit + (0x34 * 8)) #define STM32F4_AHB2_CLOCK(bit) (STM32F4_RCC_AHB2_##bit + 0x20)
/* AHB3 */ /* AHB3 */
#define STM32F4_RCC_AHB3_FMC 0 #define STM32F4_RCC_AHB3_FMC 0
#define STM32F4_AHB3_RESET(bit) (STM32F4_RCC_AHB3_##bit + (0x18 * 8)) #define STM32F4_AHB3_RESET(bit) (STM32F4_RCC_AHB3_##bit + (0x18 * 8))
#define STM32F4_AHB3_CLOCK(bit) (STM32F4_RCC_AHB3_##bit + (0x38 * 8)) #define STM32F4_AHB3_CLOCK(bit) (STM32F4_RCC_AHB3_##bit + 0x40)
/* APB1 */ /* APB1 */
#define STM32F4_RCC_APB1_TIM2 0 #define STM32F4_RCC_APB1_TIM2 0
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
#define STM32F4_RCC_APB1_UART8 31 #define STM32F4_RCC_APB1_UART8 31
#define STM32F4_APB1_RESET(bit) (STM32F4_RCC_APB1_##bit + (0x20 * 8)) #define STM32F4_APB1_RESET(bit) (STM32F4_RCC_APB1_##bit + (0x20 * 8))
#define STM32F4_APB1_CLOCK(bit) (STM32F4_RCC_APB1_##bit + (0x40 * 8)) #define STM32F4_APB1_CLOCK(bit) (STM32F4_RCC_APB1_##bit + 0x80)
/* APB2 */ /* APB2 */
#define STM32F4_RCC_APB2_TIM1 0 #define STM32F4_RCC_APB2_TIM1 0
...@@ -93,6 +93,6 @@ ...@@ -93,6 +93,6 @@
#define STM32F4_RCC_APB2_LTDC 26 #define STM32F4_RCC_APB2_LTDC 26
#define STM32F4_APB2_RESET(bit) (STM32F4_RCC_APB2_##bit + (0x24 * 8)) #define STM32F4_APB2_RESET(bit) (STM32F4_RCC_APB2_##bit + (0x24 * 8))
#define STM32F4_APB2_CLOCK(bit) (STM32F4_RCC_APB2_##bit + (0x44 * 8)) #define STM32F4_APB2_CLOCK(bit) (STM32F4_RCC_APB2_##bit + 0xA0)
#endif /* _DT_BINDINGS_MFD_STM32F4_RCC_H */ #endif /* _DT_BINDINGS_MFD_STM32F4_RCC_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment