File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 66
66
drive-strength = "x1";
67
67
};
68
68
};
69
+
70
+ pinmux_i2c3: pinmux_i2c3 {
71
+ group0 {
72
+ pinmux = <&iomuxc_i2c3_scl_i2c_scl_i2c3_scl>,
73
+ <&iomuxc_i2c3_sda_i2c_sda_i2c3_sda>;
74
+ bias-pull-up;
75
+ input-schmitt-enable;
76
+ slew-rate = "slow";
77
+ drive-strength = "x4";
78
+ input-enable;
79
+ };
80
+ };
69
81
};
Original file line number Diff line number Diff line change 6
6
7
7
/dts-v1/;
8
8
9
+ #include <zephyr/dt-bindings/i2c/i2c.h>
9
10
#include <nxp/nxp_mimx8mp_a53.dtsi>
10
11
#include "imx8mp_evk-pinctrl.dtsi"
11
12
69
70
pinctrl-0 = <&uart4_default>;
70
71
pinctrl-names = "default";
71
72
};
73
+
74
+ &i2c3 {
75
+ status = "okay";
76
+ pinctrl-0 = <&pinmux_i2c3>;
77
+ pinctrl-names = "default";
78
+ clock-frequency = <I2C_BITRATE_STANDARD>;
79
+ };
Original file line number Diff line number Diff line change @@ -45,14 +45,32 @@ static void soc_rdc_init(void)
45
45
periphConfig .policy = RDC_DT_VAL (enet );
46
46
RDC_SetPeriphAccessConfig (rdc_inst , & periphConfig );
47
47
#endif
48
+
49
+ #if DT_NODE_HAS_STATUS_OKAY (DT_NODELABEL (i2c3 )) && DT_NODE_HAS_PROP (DT_NODELABEL (i2c3 ), rdc )
50
+ periphConfig .periph = kRDC_Periph_I2C3 ;
51
+ periphConfig .policy = RDC_DT_VAL (i2c3 );
52
+ RDC_SetPeriphAccessConfig (rdc_inst , & periphConfig );
53
+ #endif
48
54
}
49
55
#else
50
56
51
57
#define soc_rdc_init () do { } while (false)
52
58
53
59
#endif
54
60
61
+ static void soc_clock_init (void )
62
+ {
63
+ #if DT_NODE_HAS_STATUS_OKAY (DT_NODELABEL (i2c3 ))
64
+ /* Set I2C source to SysPLL1 Div5 160MHZ */
65
+ CLOCK_SetRootMux (kCLOCK_RootI2c3 , kCLOCK_I2cRootmuxSysPll1Div5 );
66
+ /* Set root clock to 160MHZ / 10 = 16MHZ */
67
+ CLOCK_SetRootDivider (kCLOCK_RootI2c3 , 1U , 10U );
68
+ CLOCK_EnableClock (kCLOCK_I2c3 );
69
+ #endif
70
+ }
71
+
55
72
void soc_prep_hook (void )
56
73
{
57
74
soc_rdc_init ();
75
+ soc_clock_init ();
58
76
}
You can’t perform that action at this time.
0 commit comments