Some platforms may require limiting the maximum frequency used in SD
High-Speed (HS) mode due to board-level hardware constraints. For
example, certain boards may include level shifters or other components
that cannot reliably operate at the default 50 MHz HS frequency.
Introduce a new optional device tree property max-sd-hs-frequency to
limit the maximum frequency (in Hz) used for SD cards operating in
High-Speed (HS) mode.
Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com>
---
.../devicetree/bindings/mmc/mmc-controller-common.yaml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml
index 9a7235439759..d6b785cb2bd9 100644
--- a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml
+++ b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml
@@ -93,6 +93,14 @@ properties:
minimum: 400000
maximum: 384000000
+ max-sd-hs-hz:
+ description: |
+ Maximum frequency (in Hz) to be used for SD cards operating in
+ High-Speed (HS) mode. This is useful for board-specific limitations,
+ such as level shifters or others where the card cannot reliably
+ operate at the default 50 MHz HS frequency.
+ default: 50000000
+
disable-wp:
$ref: /schemas/types.yaml#/definitions/flag
description:
--
2.34.1
On Wed, Sep 03, 2025 at 01:34:02PM +0530, Sarthak Garg wrote: > Some platforms may require limiting the maximum frequency used in SD > High-Speed (HS) mode due to board-level hardware constraints. For > example, certain boards may include level shifters or other components > that cannot reliably operate at the default 50 MHz HS frequency. > > Introduce a new optional device tree property max-sd-hs-frequency to > limit the maximum frequency (in Hz) used for SD cards operating in > High-Speed (HS) mode. > > Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com> > --- > .../devicetree/bindings/mmc/mmc-controller-common.yaml | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml > index 9a7235439759..d6b785cb2bd9 100644 > --- a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml > +++ b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml > @@ -93,6 +93,14 @@ properties: > minimum: 400000 > maximum: 384000000 > > + max-sd-hs-hz: > + description: | > + Maximum frequency (in Hz) to be used for SD cards operating in > + High-Speed (HS) mode. This is useful for board-specific limitations, > + such as level shifters or others where the card cannot reliably > + operate at the default 50 MHz HS frequency. > + default: 50000000 Why doesn't max-frequency work for you? I would think frequency limits wouldn't really depend on the mode. > + > disable-wp: > $ref: /schemas/types.yaml#/definitions/flag > description: > -- > 2.34.1 >
On 9/4/2025 2:09 AM, Rob Herring wrote: > On Wed, Sep 03, 2025 at 01:34:02PM +0530, Sarthak Garg wrote: >> Some platforms may require limiting the maximum frequency used in SD >> High-Speed (HS) mode due to board-level hardware constraints. For >> example, certain boards may include level shifters or other components >> that cannot reliably operate at the default 50 MHz HS frequency. >> >> Introduce a new optional device tree property max-sd-hs-frequency to >> limit the maximum frequency (in Hz) used for SD cards operating in >> High-Speed (HS) mode. >> >> Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com> >> --- >> .../devicetree/bindings/mmc/mmc-controller-common.yaml | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml >> index 9a7235439759..d6b785cb2bd9 100644 >> --- a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml >> +++ b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml >> @@ -93,6 +93,14 @@ properties: >> minimum: 400000 >> maximum: 384000000 >> >> + max-sd-hs-hz: >> + description: | >> + Maximum frequency (in Hz) to be used for SD cards operating in >> + High-Speed (HS) mode. This is useful for board-specific limitations, >> + such as level shifters or others where the card cannot reliably >> + operate at the default 50 MHz HS frequency. >> + default: 50000000 > > Why doesn't max-frequency work for you? I would think frequency limits > wouldn't really depend on the mode. > The reason max-frequency isn't sufficient in this case is that it applies globally across all operating modes of the SD card interface. However, the constraint we're trying to address is specific to High-Speed (HS) mode where the default frequency is 50 MHz.By introducing a mode-specific property like max-sd-hs-frequency, we can target only HS mode without affecting the capabilities of other modes. This provides more granular control and avoids performance degradation for other modes. >> + >> disable-wp: >> $ref: /schemas/types.yaml#/definitions/flag >> description: >> -- >> 2.34.1 >>
On 03/09/2025 10:04, Sarthak Garg wrote: > Some platforms may require limiting the maximum frequency used in SD > High-Speed (HS) mode due to board-level hardware constraints. For > example, certain boards may include level shifters or other components > that cannot reliably operate at the default 50 MHz HS frequency. > > Introduce a new optional device tree property max-sd-hs-frequency to > limit the maximum frequency (in Hz) used for SD cards operating in > High-Speed (HS) mode. > > Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com> > --- > .../devicetree/bindings/mmc/mmc-controller-common.yaml | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml > index 9a7235439759..d6b785cb2bd9 100644 > --- a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml > +++ b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml > @@ -93,6 +93,14 @@ properties: > minimum: 400000 > maximum: 384000000 > > + max-sd-hs-hz: > + description: | > + Maximum frequency (in Hz) to be used for SD cards operating in > + High-Speed (HS) mode. This is useful for board-specific limitations, > + such as level shifters or others where the card cannot reliably > + operate at the default 50 MHz HS frequency. > + default: 50000000 no minimum/maximum? If 50 MHz is default, isn't it also an actual max? Best regards, Krzysztof
On 9/3/2025 1:52 PM, Krzysztof Kozlowski wrote: > On 03/09/2025 10:04, Sarthak Garg wrote: >> Some platforms may require limiting the maximum frequency used in SD >> High-Speed (HS) mode due to board-level hardware constraints. For >> example, certain boards may include level shifters or other components >> that cannot reliably operate at the default 50 MHz HS frequency. >> >> Introduce a new optional device tree property max-sd-hs-frequency to >> limit the maximum frequency (in Hz) used for SD cards operating in >> High-Speed (HS) mode. >> >> Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com> >> --- >> .../devicetree/bindings/mmc/mmc-controller-common.yaml | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml >> index 9a7235439759..d6b785cb2bd9 100644 >> --- a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml >> +++ b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml >> @@ -93,6 +93,14 @@ properties: >> minimum: 400000 >> maximum: 384000000 >> >> + max-sd-hs-hz: >> + description: | >> + Maximum frequency (in Hz) to be used for SD cards operating in >> + High-Speed (HS) mode. This is useful for board-specific limitations, >> + such as level shifters or others where the card cannot reliably >> + operate at the default 50 MHz HS frequency. >> + default: 50000000 > > no minimum/maximum? If 50 MHz is default, isn't it also an actual max? > > Best regards, > Krzysztof I realized I had misinterpreted your earlier comment, which led to the removal of min/max. I’ll reintroduce them with the following values: + minimum: 400000 + maximum: 50000000 + default: 50000000 Regarding your comment on V4 — "Don't repeat constraints in free form text" — just to clarify: are you suggesting that I remove the sentence: "This is useful for board-specific limitations, such as level shifters or others where the card cannot reliably operate at the default 50 MHz HS frequency." If so, I’ll go ahead and remove it from the bindings. Best regards, Sarthak
© 2016 - 2025 Red Hat, Inc.