Skip to content

enable i2c of imx943 #93653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions boards/nxp/imx943_evk/imx943_evk-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@
};
};

lpi2c6_default: lpi2c6_default {
group0 {
pinmux = <&iomuxc_gpio_io28_lpi2c_scl_lpi2c6_scl>,
<&iomuxc_gpio_io29_lpi2c_sda_lpi2c6_sda>;
drive-open-drain;
slew-rate = "slightly_fast";
drive-strength = "x4";
input-enable;
};
};

lpuart1_default: lpuart1_default {
group0 {
pinmux = <&iomuxc_uart1_rxd_lpuart_rx_lpuart1_rx>,
Expand Down
6 changes: 6 additions & 0 deletions boards/nxp/imx943_evk/imx943_evk_mimx94398_m33.dts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@
};
};

&lpi2c6 {
pinctrl-0 = <&lpi2c6_default>;
pinctrl-names = "default";
status = "okay";
};

&lpuart8 {
status = "okay";
current-speed = <115200>;
Expand Down
1 change: 1 addition & 0 deletions boards/nxp/imx943_evk/imx943_evk_mimx94398_m33.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ supported:
- netif:eth
- gpio
- pwm
- i2c
vendor: nxp
89 changes: 89 additions & 0 deletions dts/arm/nxp/nxp_imx943_m33.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <arm/armv8-m.dtsi>
#include <dt-bindings/i2c/i2c.h>
#include <zephyr/dt-bindings/clock/imx943_clock.h>
#include <zephyr/dt-bindings/ethernet/dsa_tag_proto.h>
#include <mem.h>
Expand Down Expand Up @@ -90,6 +91,28 @@
reg = <0x20000000 DT_SIZE_K(256)>;
};

lpi2c3: i2c@42530000 {
compatible = "nxp,lpi2c";
clock-frequency = <I2C_BITRATE_STANDARD>;
#address-cells = <1>;
#size-cells = <0>;
reg = <0x42530000 0x4000>;
interrupts = <67 0>;
clocks = <&scmi_clk IMX943_CLK_LPI2C3>;
status = "disabled";
};

lpi2c4: i2c@42540000 {
compatible = "nxp,lpi2c";
clock-frequency = <I2C_BITRATE_STANDARD>;
#address-cells = <1>;
#size-cells = <0>;
reg = <0x42540000 0x4000>;
interrupts = <68 0>;
clocks = <&scmi_clk IMX943_CLK_LPI2C4>;
status = "disabled";
};

lpuart3: serial@42570000 {
compatible = "nxp,imx-lpuart", "nxp,lpuart";
reg = <0x42570000 DT_SIZE_K(64)>;
Expand Down Expand Up @@ -138,6 +161,50 @@
status = "disabled";
};

lpi2c5: i2c@426b0000 {
compatible = "nxp,lpi2c";
clock-frequency = <I2C_BITRATE_STANDARD>;
#address-cells = <1>;
#size-cells = <0>;
reg = <0x426b0000 0x4000>;
interrupts = <108 0>;
clocks = <&scmi_clk IMX943_CLK_LPI2C5>;
status = "disabled";
};

lpi2c6: i2c@426c0000 {
compatible = "nxp,lpi2c";
clock-frequency = <I2C_BITRATE_STANDARD>;
#address-cells = <1>;
#size-cells = <0>;
reg = <0x426c0000 0x4000>;
interrupts = <109 0>;
clocks = <&scmi_clk IMX943_CLK_LPI2C6>;
status = "disabled";
};

lpi2c7: i2c@426d0000 {
compatible = "nxp,lpi2c";
clock-frequency = <I2C_BITRATE_STANDARD>;
#address-cells = <1>;
#size-cells = <0>;
reg = <0x426d0000 0x4000>;
interrupts = <110 0>;
clocks = <&scmi_clk IMX943_CLK_LPI2C7>;
status = "disabled";
};

lpi2c8: i2c@426e0000 {
compatible = "nxp,lpi2c";
clock-frequency = <I2C_BITRATE_STANDARD>;
#address-cells = <1>;
#size-cells = <0>;
reg = <0x426e0000 0x4000>;
interrupts = <111 0>;
clocks = <&scmi_clk IMX943_CLK_LPI2C8>;
status = "disabled";
};

lpuart9: serial@42a50000 {
compatible = "nxp,imx-lpuart", "nxp,lpuart";
reg = <0x42a50000 DT_SIZE_K(64)>;
Expand Down Expand Up @@ -263,6 +330,28 @@
status = "disabled";
};

lpi2c1: i2c@44340000 {
compatible = "nxp,lpi2c";
clock-frequency = <I2C_BITRATE_STANDARD>;
#address-cells = <1>;
#size-cells = <0>;
reg = <0x44340000 0x4000>;
interrupts = <15 0>;
clocks = <&scmi_clk IMX943_CLK_LPI2C1>;
status = "disabled";
};

lpi2c2: i2c@44350000 {
compatible = "nxp,lpi2c";
clock-frequency = <I2C_BITRATE_STANDARD>;
#address-cells = <1>;
#size-cells = <0>;
reg = <0x44350000 0x4000>;
interrupts = <16 0>;
clocks = <&scmi_clk IMX943_CLK_LPI2C2>;
status = "disabled";
};

lpuart1: serial@44380000 {
compatible = "nxp,imx-lpuart", "nxp,lpuart";
reg = <0x44380000 DT_SIZE_K(64)>;
Expand Down
6 changes: 6 additions & 0 deletions modules/hal_nxp/mcux/mcux-sdk-ng/drivers/drivers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ endif()
set_variable_ifdef(CONFIG_HAS_MCUX_XCACHE CONFIG_MCUX_COMPONENT_driver.cache_xcache)

if((${MCUX_DEVICE} MATCHES "MIMX9596") OR (${MCUX_DEVICE} MATCHES "MIMX8UD7") OR (${MCUX_DEVICE} MATCHES "MIMXRT118") OR (CONFIG_SOC_MIMX94398) OR (CONFIG_SOC_MIMXRT798S))

if(CONFIG_SOC_MIMX94398_M33)
set(CONFIG_MCUX_COMPONENT_driver.irqsteer_1 ON)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change needed if you do not have a dependency on the new irq_steer driver?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change needed if you do not have a dependency on the new irq_steer driver?
This is a irqsteer driver(CONFIG_MCUX_COMPONENT_driver.irqsteer_1) in mcux sdk. It needs to be enabled by default.
The i2c driver(drivers/i2c/i2c_mcux_lpi2c.c) of zephyr will use lpi2c driver(drivers/lpi2c/fsl_lpi2c.c) of mcux sdk,
the lpi2c driver of mcux sdk will can api EnableIRQ(drivers/common/fsl_common_arm.h) of mcux sdk,
EnableIRQ -> IRQSTEER_EnableInterrupt

image

set(CONFIG_MCUX_COMPONENT_driver.irqsteer_1_soc.cm33_core1 ON)
endif()

set_variable_ifdef(CONFIG_IPM_IMX CONFIG_MCUX_COMPONENT_driver.mu1)
set_variable_ifdef(CONFIG_MBOX_NXP_IMX_MU CONFIG_MCUX_COMPONENT_driver.mu1)
else()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_I2C=y
CONFIG_I2C_SHELL=y
Loading