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 6666 drive-strength = "x1";
6767 };
6868 };
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+ };
6981};
Original file line number Diff line number Diff line change 66
77/dts-v1/;
88
9+ #include <zephyr/dt-bindings/i2c/i2c.h>
910#include <nxp/nxp_mimx8mp_a53.dtsi>
1011#include "imx8mp_evk-pinctrl.dtsi"
1112
6970 pinctrl-0 = <&uart4_default>;
7071 pinctrl-names = "default";
7172};
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)
4545 periphConfig .policy = RDC_DT_VAL (enet );
4646 RDC_SetPeriphAccessConfig (rdc_inst , & periphConfig );
4747#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
4854}
4955#else
5056
5157#define soc_rdc_init () do { } while (false)
5258
5359#endif
5460
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+
5572void soc_prep_hook (void )
5673{
5774 soc_rdc_init ();
75+ soc_clock_init ();
5876}
You can’t perform that action at this time.
0 commit comments