boards: imx8mp_evk: add i2c support
Added i2c3 support on imx8mp_evk A53 board. Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
This commit is contained in:
parent
95e7a08570
commit
ab25fdf1a9
3 changed files with 38 additions and 0 deletions
|
@ -66,4 +66,16 @@
|
|||
drive-strength = "x1";
|
||||
};
|
||||
};
|
||||
|
||||
pinmux_i2c3: pinmux_i2c3 {
|
||||
group0 {
|
||||
pinmux = <&iomuxc_i2c3_scl_i2c_scl_i2c3_scl>,
|
||||
<&iomuxc_i2c3_sda_i2c_sda_i2c3_sda>;
|
||||
bias-pull-up;
|
||||
input-schmitt-enable;
|
||||
slew-rate = "slow";
|
||||
drive-strength = "x4";
|
||||
input-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
/dts-v1/;
|
||||
|
||||
#include <zephyr/dt-bindings/i2c/i2c.h>
|
||||
#include <nxp/nxp_mimx8mp_a53.dtsi>
|
||||
#include "imx8mp_evk-pinctrl.dtsi"
|
||||
|
||||
|
@ -69,3 +70,10 @@
|
|||
pinctrl-0 = <&uart4_default>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
&i2c3 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&pinmux_i2c3>;
|
||||
pinctrl-names = "default";
|
||||
clock-frequency = <I2C_BITRATE_STANDARD>;
|
||||
};
|
||||
|
|
|
@ -45,6 +45,12 @@ static void soc_rdc_init(void)
|
|||
periphConfig.policy = RDC_DT_VAL(enet);
|
||||
RDC_SetPeriphAccessConfig(rdc_inst, &periphConfig);
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(i2c3)) && DT_NODE_HAS_PROP(DT_NODELABEL(i2c3), rdc)
|
||||
periphConfig.periph = kRDC_Periph_I2C3;
|
||||
periphConfig.policy = RDC_DT_VAL(i2c3);
|
||||
RDC_SetPeriphAccessConfig(rdc_inst, &periphConfig);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
|
||||
|
@ -52,7 +58,19 @@ static void soc_rdc_init(void)
|
|||
|
||||
#endif
|
||||
|
||||
static void soc_clock_init(void)
|
||||
{
|
||||
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(i2c3))
|
||||
/* Set I2C source to SysPLL1 Div5 160MHZ */
|
||||
CLOCK_SetRootMux(kCLOCK_RootI2c3, kCLOCK_I2cRootmuxSysPll1Div5);
|
||||
/* Set root clock to 160MHZ / 10 = 16MHZ */
|
||||
CLOCK_SetRootDivider(kCLOCK_RootI2c3, 1U, 10U);
|
||||
CLOCK_EnableClock(kCLOCK_I2c3);
|
||||
#endif
|
||||
}
|
||||
|
||||
void soc_prep_hook(void)
|
||||
{
|
||||
soc_rdc_init();
|
||||
soc_clock_init();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue