Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions drivers/flash/flash_stm32.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
#ifndef ZEPHYR_DRIVERS_FLASH_FLASH_STM32_H_
#define ZEPHYR_DRIVERS_FLASH_FLASH_STM32_H_

#if DT_NODE_HAS_PROP(DT_INST(0, st_stm32_flash_controller), clocks)
#if DT_NODE_HAS_PROP(DT_INST(0, st_stm32_flash_controller), clocks) || \
DT_NODE_HAS_PROP(DT_INST(0, st_stm32h7_flash_controller), clocks)
#include <drivers/clock_control.h>
#include <drivers/clock_control/stm32_clock_control.h>
#endif

struct flash_stm32_priv {
FLASH_TypeDef *regs;
#if DT_NODE_HAS_PROP(DT_INST(0, st_stm32_flash_controller), clocks)
#if DT_NODE_HAS_PROP(DT_INST(0, st_stm32_flash_controller), clocks) || \
DT_NODE_HAS_PROP(DT_INST(0, st_stm32h7_flash_controller), clocks)
/* clock subsystem driving this peripheral */
struct stm32_pclken pclken;
#endif
Expand Down
4 changes: 2 additions & 2 deletions drivers/flash/flash_stm32h7x.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ void flash_stm32_page_layout(const struct device *dev,

static struct flash_stm32_priv flash_data = {
.regs = (FLASH_TypeDef *) DT_INST_REG_ADDR(0),
.pclken = { .bus = STM32_CLOCK_BUS_AHB3,
.enr = LL_AHB3_GRP1_PERIPH_FLASH },
.pclken = { .bus = DT_INST_CLOCKS_CELL(0, bus),
.enr = DT_INST_CLOCKS_CELL(0, bits)},
};

static const struct flash_driver_api flash_stm32h7_api = {
Expand Down
1 change: 1 addition & 0 deletions dts/arm/st/h7/stm32h7.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
label = "FLASH_CTRL";
reg = <0x52002000 0x400>;
interrupts = <4 0>;
clocks = <&rcc STM32_CLOCK_BUS_AHB3 0x00000100>;

#address-cells = <1>;
#size-cells = <1>;
Expand Down