boards: imx93_evk: enable flexcan driver

Add pinctrl for flexcan2
Add EXP_SEL gpio hog for board mux selection during boot.
Add TJA1057 CAN PHY driver.
Update supported features in board document

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
This commit is contained in:
Chekhov Ma 2024-05-24 13:56:16 +08:00 committed by Anas Nashif
commit 07f132b1b5
5 changed files with 61 additions and 2 deletions

View file

@ -0,0 +1,14 @@
# MIMX93 EVK board defconfig
# Copyright 2024 NXP
# SPDX-License-Identifier: Apache-2.0
if BOARD_IMX93_EVK_MIMX9352_A55
if CAN
# CAN Phy must be enabled after mfd0 gpio expander is ready
config CAN_TRANSCEIVER_INIT_PRIORITY
default 75
endif
endif # BOARD_IMX93_EVK_MIMX9352_A55

View file

@ -58,8 +58,16 @@ features:
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| ARM TIMER | on-chip | system clock | | ARM TIMER | on-chip | system clock |
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| GPIO | on-chip | gpio |
+-----------+------------+-------------------------------------+
| UART | on-chip | serial port | | UART | on-chip | serial port |
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| I2C | on-chip | i2c |
+-----------+------------+-------------------------------------+
| SPI | on-chip | spi |
+-----------+------------+-------------------------------------+
| CAN | on-chip | can |
+-----------+------------+-------------------------------------+
Devices Devices
======== ========

View file

@ -83,4 +83,22 @@
}; };
}; };
flexcan1_default: flexcan1_default {
group0 {
pinmux = <&iomuxc1_sai1_txd0_can_tx_can1_tx>,
<&iomuxc1_sai1_txc_can_rx_can1_rx>;
slew-rate = "slightly_fast";
drive-strength = "x5";
};
};
flexcan2_default: flexcan2_default {
group0 {
pinmux = <&iomuxc1_gpio_io25_can_tx_can2_tx>,
<&iomuxc1_gpio_io27_can_rx_can2_rx>;
slew-rate = "slightly_fast";
drive-strength = "x5";
};
};
}; };

View file

@ -17,6 +17,7 @@
zephyr,console = &lpuart2; zephyr,console = &lpuart2;
zephyr,shell-uart = &lpuart2; zephyr,shell-uart = &lpuart2;
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,canbus = &flexcan2;
}; };
cpus { cpus {
@ -64,6 +65,14 @@
gpios = <&gpio2 24 GPIO_ACTIVE_LOW>; gpios = <&gpio2 24 GPIO_ACTIVE_LOW>;
}; };
}; };
can_phy0: can-phy0 {
compatible = "nxp,tja1057", "can-transceiver-gpio";
max-bitrate = <8000000>;
standby-gpios = <&gpio_exp0 8 GPIO_ACTIVE_HIGH>;
#phy-cells = <0>;
status = "okay";
};
}; };
&lpuart1 { &lpuart1 {
@ -91,7 +100,7 @@
}; };
&lpi2c2 { &lpi2c2 {
status = "disabled"; status = "okay";
clock-frequency = <I2C_BITRATE_FAST>; clock-frequency = <I2C_BITRATE_FAST>;
pinctrl-0 = <&i2c2_default>; pinctrl-0 = <&i2c2_default>;
pinctrl-names = "default"; pinctrl-names = "default";
@ -99,7 +108,7 @@
mfd0:adp5585@34 { mfd0:adp5585@34 {
compatible = "adi,adp5585"; compatible = "adi,adp5585";
reg = <0x34>; reg = <0x34>;
status = "disabled"; status = "okay";
gpio_exp0: adp5585_gpio { gpio_exp0: adp5585_gpio {
compatible = "adi,adp5585-gpio"; compatible = "adi,adp5585-gpio";
@ -146,3 +155,12 @@
&gpio4{ &gpio4{
status = "okay"; status = "okay";
}; };
&flexcan2 {
pinctrl-0 = <&flexcan2_default>;
pinctrl-names = "default";
bus-speed = <125000>;
bus-speed-data = <1000000>;
phys = <&can_phy0>;
status = "okay";
};

View file

@ -17,6 +17,7 @@ supported:
- uart - uart
- i2c - i2c
- spi - spi
- can
testing: testing:
ignore_tags: ignore_tags:
- net - net