From 254e04102f497a0895a1ea6ac9d425429e7f4dc7 Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Mon, 16 Dec 2024 11:39:47 +0100 Subject: [PATCH] include: drivers: clock_control stm32 bus clock index can exceed 256 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 512 in the .bus of the clock info structure. Signed-off-by: Francois Ramu --- include/zephyr/drivers/clock_control/stm32_clock_control.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/zephyr/drivers/clock_control/stm32_clock_control.h b/include/zephyr/drivers/clock_control/stm32_clock_control.h index 753aa0eafdbb10c..ffc882d9467cf13 100644 --- a/include/zephyr/drivers/clock_control/stm32_clock_control.h +++ b/include/zephyr/drivers/clock_control/stm32_clock_control.h @@ -444,7 +444,7 @@ 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) & 0x1ff, \ .div = DT_CLOCKS_CELL_BY_IDX(node_id, clk_index, bus) >> \ STM32_CLOCK_DIV_SHIFT, \ }