Skip to content

Commit 792cae9

Browse files
danieldegrassedleach02
authored andcommitted
dts: sdhc: Add SDHC DTS bindings
Add generic SDHC dts binding, as well as DTS binding for NXP USDHC. Update iMX.RT DTS binding to use USDHC compatible Signed-off-by: Daniel DeGrasse <[email protected]>
1 parent 6aaa2b5 commit 792cae9

File tree

3 files changed

+146
-4
lines changed

3 files changed

+146
-4
lines changed

dts/arm/nxp/nxp_rt.dtsi

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -680,21 +680,29 @@
680680
};
681681

682682
usdhc1: usdhc@402c0000 {
683-
compatible = "nxp,imx-usdhc";
683+
compatible = "nxp,imx-sdhc";
684684
reg = <0x402c0000 0x4000>;
685685
status = "disabled";
686686
interrupts = <110 0>;
687687
clocks = <&ccm IMX_CCM_USDHC1_CLK 0 0>;
688-
label = "USDHC_1";
688+
label = "SDHC_0";
689+
max-current-330 = <1020>;
690+
max-current-180 = <1020>;
691+
max-bus-freq = <208000000>;
692+
min-bus-freq = <400000>;
689693
};
690694

691695
usdhc2: usdhc@402c4000 {
692-
compatible = "nxp,imx-usdhc";
696+
compatible = "nxp,imx-sdhc";
693697
reg = <0x402c4000 0x4000>;
694698
status = "disabled";
695699
interrupts = <111 0>;
696700
clocks = <&ccm IMX_CCM_USDHC2_CLK 0 0>;
697-
label = "USDHC_2";
701+
label = "SDHC_1";
702+
max-current-330 = <120>;
703+
max-current-180 = <45>;
704+
max-bus-freq = <198000000>;
705+
min-bus-freq = <400000>;
698706
};
699707

700708
csi: csi@402bc000 {

dts/bindings/sdhc/nxp,imx-sdhc.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Copyright (c) 2022, NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: NXP imx USDHC controller
5+
6+
compatible: "nxp,imx-sdhc"
7+
8+
include: [sdhc.yaml, pinctrl-device.yaml]
9+
10+
properties:
11+
reg:
12+
required: true
13+
14+
label:
15+
required: true
16+
17+
data-timeout:
18+
type: int
19+
required: false
20+
default: 0xF
21+
description: |
22+
Data timeout, as multiple of the SD clock. See DTOCV field of USDHC
23+
24+
read-watermark:
25+
type: int
26+
required: false
27+
default: 0x80
28+
description: |
29+
Number of words used as read watermark level in FIFO queue for USDHC
30+
31+
write-watermark:
32+
type: int
33+
required: false
34+
default: 0x80
35+
description: |
36+
Number of words used as write watermark level in FIFO queue for USDHC
37+
38+
max_current_330:
39+
type: int
40+
required: false
41+
default: 0
42+
description: |
43+
Max drive current in mA at 3.3V. A value of zero indicates no maximum
44+
is specified by the driver.
45+
clocks:
46+
required: true
47+
48+
pwr-gpios:
49+
type: phandle-array
50+
required: false
51+
description: |
52+
Power pin
53+
This pin defaults to active high when consumed by the SD card. The
54+
property value should ensure the flags properly describe the signal
55+
that is presented to the driver.
56+
57+
cd-gpios:
58+
type: phandle-array
59+
required: false
60+
description: |
61+
Detect pin
62+
This pin defaults to active low when produced by the SD card. The
63+
property value should ensure the flags properly describe the signal
64+
that is presented to the driver.
65+
66+
no-1-8-v:
67+
type: boolean
68+
required: false
69+
description: |
70+
When the external SD card circuit does not support 1.8V, add this
71+
property to disable 1.8v card voltage of SD card controller.
72+
73+
detect-dat3:
74+
type: boolean
75+
required: false
76+
description: |
77+
Enable the host to detect an SD card via the DAT3 line of the SD card
78+
connection. Requires the board to define a function to pull DAT3 low or
79+
high using pullup/pulldown resistors.

dts/bindings/sdhc/sdhc.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright (c) 2022, NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Common fields for SD host controllers
5+
6+
include: base.yaml
7+
8+
properties:
9+
max-current-330:
10+
type: int
11+
required: false
12+
default: 0
13+
description: |
14+
Max drive current in mA at 3.3V. A value of zero indicates no maximum
15+
is specified by the driver.
16+
17+
max-current-300:
18+
type: int
19+
required: false
20+
default: 0
21+
description: |
22+
Max drive current in mA at 3.0V. A value of zero indicates no maximum
23+
is specified by the driver.
24+
25+
max-current-180:
26+
type: int
27+
required: false
28+
default: 0
29+
description: |
30+
Max drive current in mA at 1.8V. A value of zero indicates no maximum
31+
is specified by the driver.
32+
33+
max-bus-freq:
34+
type: int
35+
required: false
36+
default: 400000
37+
description: |
38+
Maximum bus frequency for SD card. This should be the highest frequency
39+
the SDHC is capable of negotiating with cards on the bus.
40+
41+
min-bus-freq:
42+
type: int
43+
required: false
44+
default: 400000
45+
description: |
46+
Minimum bus frequency for SD card. This should be the frequency that
47+
cards first will select when attached to the SDHC bus
48+
49+
power-delay-ms:
50+
type: int
51+
required: false
52+
default: 500
53+
description: |
54+
time in ms for SDHC to delay when toggling power to the SD card. This
55+
delay gives the card time to power up or down fully

0 commit comments

Comments
 (0)