Skip to content

Commit

Permalink
include: drivers: clock_control stm32 bus clock index can exceed 256
Browse files Browse the repository at this point in the history
For some stm32 devices, especially the stm32H7RS serie,
the RCC register map is larger that 256 (example  AHB1 is 0x138).
The mask is extended to 0x1ff in the .bus of the clock info structure,
using the GENMASK macro from STM32_CLOCK_DIV_SHIFT

Signed-off-by: Francois Ramu <[email protected]>
  • Loading branch information
FRASTM authored and kartben committed Dec 18, 2024
1 parent b95a9d8 commit 7cbb1dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/zephyr/drivers/clock_control/stm32_clock_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ struct stm32_pclken {
#define STM32_CLOCK_INFO(clk_index, node_id) \
{ \
.enr = DT_CLOCKS_CELL_BY_IDX(node_id, clk_index, bits), \
.bus = DT_CLOCKS_CELL_BY_IDX(node_id, clk_index, bus) & 0xff, \
.bus = DT_CLOCKS_CELL_BY_IDX(node_id, clk_index, bus) & \
GENMASK(STM32_CLOCK_DIV_SHIFT - 1, 0), \
.div = DT_CLOCKS_CELL_BY_IDX(node_id, clk_index, bus) >> \
STM32_CLOCK_DIV_SHIFT, \
}
Expand Down

0 comments on commit 7cbb1dd

Please sign in to comment.