Skip to content

Commit 0913d09

Browse files
talih0carlescufi
authored andcommitted
dts: arm: xmc4xxx: Add extra pinctrl nodes for i2c
The existing i2c sda/slc pinctrl nodes serve as an input and output for the USIC. This limits the number of pins that can be used for i2c since the pin must be internally connected to both DOUT0 and DX0 signals on the USIC (for the sda signal for example). It is also possible to use separate pins to DOUT0 and DX0, but connect the pins externally. Add these extra pinctrl nodes and document their use in infineon,xmc4xxx-i2c.yaml. Signed-off-by: Andriy Gelman <[email protected]>
1 parent f345698 commit 0913d09

File tree

3 files changed

+180
-1
lines changed

3 files changed

+180
-1
lines changed

dts/arm/infineon/xmc4500_F100x1024-pinctrl.dtsi

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,4 +388,41 @@
388388
/omit-if-no-ref/ i2c_scl_p0_8_u0c0: i2c_scl_p0_8_u0c0 {
389389
pinmux = <XMC4XXX_PINMUX_SET(0, 8, 2)>; /* USIC scl-src = DX1B */
390390
};
391+
392+
/omit-if-no-ref/ i2c_sda_dx0_p0_4_u1c0: i2c_sda_dx0_p0_4_u1c0 {
393+
pinmux = <XMC4XXX_PINMUX_SET(0, 4, 0)>; /* USIC sda-src = DX0A */
394+
};
395+
/omit-if-no-ref/ i2c_sda_dx0_p3_4_u2c1: i2c_sda_dx0_p3_4_u2c1 {
396+
pinmux = <XMC4XXX_PINMUX_SET(3, 4, 0)>; /* USIC sda-src = DX0B */
397+
};
398+
/omit-if-no-ref/ i2c_sda_dx0_p0_0_u1c1: i2c_sda_dx0_p0_0_u1c1 {
399+
pinmux = <XMC4XXX_PINMUX_SET(0, 0, 0)>; /* USIC sda-src = DX0D */
400+
};
401+
/omit-if-no-ref/ i2c_sda_dx0_p4_0_u2c1: i2c_sda_dx0_p4_0_u2c1 {
402+
pinmux = <XMC4XXX_PINMUX_SET(4, 0, 0)>; /* USIC sda-src = DX0C */
403+
};
404+
/omit-if-no-ref/ i2c_sda_dx0_p2_15_u1c0: i2c_sda_dx0_p2_15_u1c0 {
405+
pinmux = <XMC4XXX_PINMUX_SET(2, 15, 0)>; /* USIC sda-src = DX0C */
406+
};
407+
/omit-if-no-ref/ i2c_sda_dx0_p1_4_u0c0: i2c_sda_dx0_p1_4_u0c0 {
408+
pinmux = <XMC4XXX_PINMUX_SET(1, 4, 0)>; /* USIC sda-src = DX0B */
409+
};
410+
/omit-if-no-ref/ i2c_sda_dx0_p2_2_u0c1: i2c_sda_dx0_p2_2_u0c1 {
411+
pinmux = <XMC4XXX_PINMUX_SET(2, 2, 0)>; /* USIC sda-src = DX0A */
412+
};
413+
/omit-if-no-ref/ i2c_sda_dout0_p0_1_u1c1: i2c_sda_dout0_p0_1_u1c1 {
414+
pinmux = <XMC4XXX_PINMUX_SET(0, 1, 2)>;
415+
};
416+
/omit-if-no-ref/ i2c_sda_dout0_p1_7_u0c0: i2c_sda_dout0_p1_7_u0c0 {
417+
pinmux = <XMC4XXX_PINMUX_SET(1, 7, 2)>;
418+
};
419+
/omit-if-no-ref/ i2c_scl_dx1_p4_0_u1c1: i2c_scl_dx1_p4_0_u1c1 {
420+
pinmux = <XMC4XXX_PINMUX_SET(4, 0, 0)>; /* USIC scl-src = DX1C */
421+
};
422+
/omit-if-no-ref/ i2c_scl_dout1_p1_6_u0c0: i2c_scl_dout1_p1_6_u0c0 {
423+
pinmux = <XMC4XXX_PINMUX_SET(1, 6, 2)>;
424+
};
425+
/omit-if-no-ref/ i2c_scl_dout1_p1_10_u0c0: i2c_scl_dout1_p1_10_u0c0 {
426+
pinmux = <XMC4XXX_PINMUX_SET(1, 10, 2)>;
427+
};
391428
};

dts/arm/infineon/xmc4700_F144x2048-pinctrl.dtsi

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,4 +900,89 @@
900900
/omit-if-no-ref/ pwm_out_p6_1_ccu81_ch6_high: pwm_out_p6_1_ccu81_ch6_high {
901901
pinmux = <XMC4XXX_PINMUX_SET(6, 1, 3)>;
902902
};
903+
/omit-if-no-ref/ i2c_sda_dx0_p3_12_u2c1: i2c_sda_dx0_p3_12_u2c1 {
904+
pinmux = <XMC4XXX_PINMUX_SET(3, 12, 0)>; /* USIC sda-src = DX0D */
905+
};
906+
/omit-if-no-ref/ i2c_sda_dx0_p4_0_u2c1: i2c_sda_dx0_p4_0_u2c1 {
907+
pinmux = <XMC4XXX_PINMUX_SET(4, 0, 0)>; /* USIC sda-src = DX0C */
908+
};
909+
/omit-if-no-ref/ i2c_sda_dx0_p0_0_u1c1: i2c_sda_dx0_p0_0_u1c1 {
910+
pinmux = <XMC4XXX_PINMUX_SET(0, 0, 0)>; /* USIC sda-src = DX0D */
911+
};
912+
/omit-if-no-ref/ i2c_sda_dx0_p4_6_u2c1: i2c_sda_dx0_p4_6_u2c1 {
913+
pinmux = <XMC4XXX_PINMUX_SET(4, 6, 0)>; /* USIC sda-src = DX0E */
914+
};
915+
/omit-if-no-ref/ i2c_sda_dx0_p2_2_u0c1: i2c_sda_dx0_p2_2_u0c1 {
916+
pinmux = <XMC4XXX_PINMUX_SET(2, 2, 0)>; /* USIC sda-src = DX0A */
917+
};
918+
/omit-if-no-ref/ i2c_sda_dx0_p6_3_u0c1: i2c_sda_dx0_p6_3_u0c1 {
919+
pinmux = <XMC4XXX_PINMUX_SET(6, 3, 0)>; /* USIC sda-src = DX0C */
920+
};
921+
/omit-if-no-ref/ i2c_sda_dx0_p3_7_u2c0: i2c_sda_dx0_p3_7_u2c0 {
922+
pinmux = <XMC4XXX_PINMUX_SET(3, 7, 0)>; /* USIC sda-src = DX0C */
923+
};
924+
/omit-if-no-ref/ i2c_sda_dx0_p3_14_u1c1: i2c_sda_dx0_p3_14_u1c1 {
925+
pinmux = <XMC4XXX_PINMUX_SET(3, 14, 0)>; /* USIC sda-src = DX0B */
926+
};
927+
/omit-if-no-ref/ i2c_sda_dx0_p2_15_u1c0: i2c_sda_dx0_p2_15_u1c0 {
928+
pinmux = <XMC4XXX_PINMUX_SET(2, 15, 0)>; /* USIC sda-src = DX0C */
929+
};
930+
/omit-if-no-ref/ i2c_sda_dx0_p0_4_u1c0: i2c_sda_dx0_p0_4_u1c0 {
931+
pinmux = <XMC4XXX_PINMUX_SET(0, 4, 0)>; /* USIC sda-src = DX0A */
932+
};
933+
/omit-if-no-ref/ i2c_sda_dx0_p6_5_u2c0: i2c_sda_dx0_p6_5_u2c0 {
934+
pinmux = <XMC4XXX_PINMUX_SET(6, 5, 0)>; /* USIC sda-src = DX0D */
935+
};
936+
/omit-if-no-ref/ i2c_sda_dx0_p1_14_u1c0: i2c_sda_dx0_p1_14_u1c0 {
937+
pinmux = <XMC4XXX_PINMUX_SET(1, 14, 0)>; /* USIC sda-src = DX0E */
938+
};
939+
/omit-if-no-ref/ i2c_sda_dx0_p3_4_u2c1: i2c_sda_dx0_p3_4_u2c1 {
940+
pinmux = <XMC4XXX_PINMUX_SET(3, 4, 0)>; /* USIC sda-src = DX0B */
941+
};
942+
/omit-if-no-ref/ i2c_sda_dx0_p1_4_u0c0: i2c_sda_dx0_p1_4_u0c0 {
943+
pinmux = <XMC4XXX_PINMUX_SET(1, 4, 0)>; /* USIC sda-src = DX0B */
944+
};
945+
946+
/omit-if-no-ref/ i2c_sda_dout0_p3_8_u2c0: i2c_sda_dout0_p3_8_u2c0 {
947+
pinmux = <XMC4XXX_PINMUX_SET(3, 8, 1)>;
948+
};
949+
/omit-if-no-ref/ i2c_sda_dout0_p1_9_u1c1: i2c_sda_dout0_p1_9_u1c1 {
950+
pinmux = <XMC4XXX_PINMUX_SET(1, 9, 4)>;
951+
};
952+
/omit-if-no-ref/ i2c_sda_dout0_p6_4_u0c1: i2c_sda_dout0_p6_4_u0c1 {
953+
pinmux = <XMC4XXX_PINMUX_SET(6, 4, 2)>;
954+
};
955+
/omit-if-no-ref/ i2c_sda_dout0_p1_15_u1c0: i2c_sda_dout0_p1_15_u1c0 {
956+
pinmux = <XMC4XXX_PINMUX_SET(1, 15, 4)>;
957+
};
958+
/omit-if-no-ref/ i2c_sda_dout0_p3_11_u2c1: i2c_sda_dout0_p3_11_u2c1 {
959+
pinmux = <XMC4XXX_PINMUX_SET(3, 11, 1)>;
960+
};
961+
/omit-if-no-ref/ i2c_sda_dout0_p0_1_u1c1: i2c_sda_dout0_p0_1_u1c1 {
962+
pinmux = <XMC4XXX_PINMUX_SET(0, 1, 2)>;
963+
};
964+
/omit-if-no-ref/ i2c_sda_dout0_p1_7_u0c0: i2c_sda_dout0_p1_7_u0c0 {
965+
pinmux = <XMC4XXX_PINMUX_SET(1, 7, 2)>;
966+
};
967+
/omit-if-no-ref/ i2c_sda_dout0_p6_6_u2c0: i2c_sda_dout0_p6_6_u2c0 {
968+
pinmux = <XMC4XXX_PINMUX_SET(6, 6, 1)>;
969+
};
970+
/omit-if-no-ref/ i2c_scl_dout1_p1_8_u1c1: i2c_scl_dout1_p1_8_u1c1 {
971+
pinmux = <XMC4XXX_PINMUX_SET(1, 8, 4)>;
972+
};
973+
/omit-if-no-ref/ i2c_scl_dout1_p3_13_u2c1: i2c_scl_dout1_p3_13_u2c1 {
974+
pinmux = <XMC4XXX_PINMUX_SET(3, 13, 1)>;
975+
};
976+
/omit-if-no-ref/ i2c_scl_dout1_p1_6_u0c0: i2c_scl_dout1_p1_6_u0c0 {
977+
pinmux = <XMC4XXX_PINMUX_SET(1, 6, 2)>;
978+
};
979+
/omit-if-no-ref/ i2c_scl_dout1_p1_9_u0c0: i2c_scl_dout1_p1_9_u0c0 {
980+
pinmux = <XMC4XXX_PINMUX_SET(1, 9, 1)>;
981+
};
982+
/omit-if-no-ref/ i2c_scl_dout1_p1_10_u0c0: i2c_scl_dout1_p1_10_u0c0 {
983+
pinmux = <XMC4XXX_PINMUX_SET(1, 10, 2)>;
984+
};
985+
/omit-if-no-ref/ i2c_scl_dout1_p3_9_u2c0: i2c_scl_dout1_p3_9_u2c0 {
986+
pinmux = <XMC4XXX_PINMUX_SET(3, 9, 1)>;
987+
};
903988
};

dts/bindings/i2c/infineon,xmc4xxx-i2c.yaml

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,67 @@ properties:
103103
We expect that the phandles will reference pinctrl nodes. These
104104
nodes will have a nodelabel that matches the Infineon SoC Pinctrl
105105
defines and have following
106-
format: <signal>_p<port>_<pin>_<peripheral inst>
106+
format: i2c_<signal>_p<port>_<pin>_<peripheral inst>
107107
108108
Examples:
109109
pinctrl-0 = <&i2c_scl_p5_2_u2c0 &i2c_sda_p5_0_u2c0>;
110+
111+
The pins should set to open-drain and hwctrl should be disabled.
112+
113+
&i2c_scl_p5_2_u2c0 {
114+
drive-strength = "strong-sharp-edge";
115+
drive-open-drain;
116+
hwctrl = "disabled";
117+
};
118+
119+
In the above example, the pin is both an input and output (as is
120+
required for I2C setup). It is internally connected to both DX0
121+
and DOUT0 of USIC2 channel 0. (See XMC4700/4800 reference manual
122+
page 18-110, Figure 18-50 for more details).
123+
This limits the number of pins that can be used for the I2C module.
124+
125+
To get around this pin limitation, it is possible to use pins
126+
that do not have this internal connection, and instead connect the
127+
pins externally on the board.
128+
For example, for the SDA line on USIC2 channel 0, P3.8 may be used
129+
for DOUT0 and P6.5 for DX0. These type of pinctrl nodes will have
130+
labels:
131+
i2c_sda_dout0_p3_8_u2c0 and i2c_sda_dx0_p6_5_u2c0.
132+
The generalized format is: i2c_<signal>_<type>_p<port>_<pin>_<peripheral inst>
133+
134+
An example for SCL and SDA signals on the xmc4700:
135+
pinctrl-0 = <&i2c_sda_dout0_p3_8_u2c0 &i2c_sda_dx0_p6_5_u2c0
136+
&i2c_scl_dout1_p3_9_u2c0 &i2c_scl_p5_2_u2c0>;
137+
138+
Externally P3.8 should be connected to P6.5; P3.9 should be connected
139+
to P5.2.
140+
141+
Note that any pins that do not have dout0/dx0 or dout1/dx1 can have either
142+
function. Thus node i2c_scl_p5_0_u2c0 can be both dout1 and dx1.
143+
144+
For the pin configurations, the output pins (dout0 and dout1) should be set
145+
to open-drain while the input pins (dx0 and dx1) should not include this setting.
146+
147+
&i2c_sda_dout0_p3_8_u2c0 {
148+
drive-strength = "strong-sharp-edge";
149+
drive-open-drain;
150+
hwctrl = "disabled";
151+
};
152+
153+
&i2c_scl_dout1_p3_9_u2c0 {
154+
drive-strength = "strong-sharp-edge";
155+
drive-open-drain;
156+
hwctrl = "disabled";
157+
};
158+
159+
&i2c_sda_dx0_p6_5_u2c0 { /* will require USIC setting sda-src = DX0D */
160+
hwctrl = "disabled";
161+
};
162+
163+
&i2c_scl_p5_2_u2c0 { /* will require USIC scl-src = DX1A */
164+
hwctrl = "disabled";
165+
};
166+
110167
required: true
111168

112169
pinctrl-names:

0 commit comments

Comments
 (0)