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
12 changes: 9 additions & 3 deletions drivers/disk/sdmmc_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,10 +799,16 @@ static struct stm32_sdmmc_priv stm32_sdmmc_priv_1 = {
.irq_config = stm32_sdmmc_irq_config_func,
.hsd = {
.Instance = (MMC_TypeDef *)DT_INST_REG_ADDR(0),
.Init.BusWide = SDMMC_BUS_WIDTH,
#if DT_INST_NODE_HAS_PROP(0, clk_div)
.Init.ClockDiv = DT_INST_PROP(0, clk_div),
.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING,
#ifdef SDMMC_CLOCK_BYPASS_DISABLE
.Init.ClockBypass = DT_INST_PROP(0, clk_bypass)
? SDMMC_CLOCK_BYPASS_ENABLE
: SDMMC_CLOCK_BYPASS_DISABLE,
#endif
.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE,
.Init.BusWide = SDMMC_BUS_WIDTH,
.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE,
.Init.ClockDiv = DT_INST_PROP_OR(0, clk_div, 0),
},
#if DT_INST_NODE_HAS_PROP(0, cd_gpios)
.cd = GPIO_DT_SPEC_INST_GET(0, cd_gpios),
Expand Down
17 changes: 13 additions & 4 deletions dts/bindings/mmc/st,stm32-sdmmc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ properties:
type: int
default: 1
description: |
bus width for SDMMC access, defaults to the minimum necessary
number of bus lines
bus width for SDMMC access, defaults to the minimum necessary
number of bus lines
enum:
- 1
- 4
Expand All @@ -49,8 +49,17 @@ properties:
type: int
default: 0
description: |
Clock division factor for SDMMC. Typically the clock operates at 25MHz so
a division factor of 2 would be 25MHz / 2 = 12.5MHz.
Clock division factor for SDMMC. The relationship between this value
and the output bus frequency is FREQ_BUS = SDMMMC_CLK / [CLKDIV + 2].
Therefore an input clock of 25MHz and a division factor of 0 would
result in a bus frequency of 25MHz / [0 + 2] = 12.5MHz.

clk-bypass:
type: boolean
description: |
Bypass the clock divider configured in `clk-div`, which results in the
output bus frequency matching the input SDMMC_CLK. Not supported on
all part numbers.

idma:
type: boolean
Expand Down