diff --git a/boards/arm/ucans32k1sic/Kconfig.defconfig b/boards/arm/ucans32k1sic/Kconfig.defconfig index 88941a6f64a5..044df50c0c59 100644 --- a/boards/arm/ucans32k1sic/Kconfig.defconfig +++ b/boards/arm/ucans32k1sic/Kconfig.defconfig @@ -13,4 +13,11 @@ config UART_CONSOLE endif # SERIAL +if CAN + +config GPIO + default y + +endif # CAN + endif # BOARD_UCANS32K1SIC diff --git a/boards/arm/ucans32k1sic/doc/index.rst b/boards/arm/ucans32k1sic/doc/index.rst index efeb6911d7e5..adceb43de036 100644 --- a/boards/arm/ucans32k1sic/doc/index.rst +++ b/boards/arm/ucans32k1sic/doc/index.rst @@ -50,6 +50,7 @@ LPUART on-chip serial LPI2C on-chip i2c LPSPI on-chip spi FTM on-chip pwm +FlexCAN on-chip can ============ ========== ================================ The default configuration can be found in the Kconfig file diff --git a/boards/arm/ucans32k1sic/ucans32k1sic-pinctrl.dtsi b/boards/arm/ucans32k1sic/ucans32k1sic-pinctrl.dtsi index b1451d26287d..2bb216e63aed 100644 --- a/boards/arm/ucans32k1sic/ucans32k1sic-pinctrl.dtsi +++ b/boards/arm/ucans32k1sic/ucans32k1sic-pinctrl.dtsi @@ -60,4 +60,18 @@ drive-strength = "low"; }; }; + + flexcan0_default: flexcan0_default { + group0 { + pinmux = , ; + drive-strength = "low"; + }; + }; + + flexcan1_default: flexcan1_default { + group0 { + pinmux = , ; + drive-strength = "low"; + }; + }; }; diff --git a/boards/arm/ucans32k1sic/ucans32k1sic.dts b/boards/arm/ucans32k1sic/ucans32k1sic.dts index 23a380b4c449..6996a12d6d00 100644 --- a/boards/arm/ucans32k1sic/ucans32k1sic.dts +++ b/boards/arm/ucans32k1sic/ucans32k1sic.dts @@ -21,6 +21,7 @@ zephyr,console = &lpuart1; zephyr,shell-uart = &lpuart1; zephyr,uart-pipe = &lpuart1; + zephyr,canbus = &flexcan0; }; aliases { @@ -81,6 +82,20 @@ zephyr,code = ; }; }; + + can_phy0: can-phy0 { + compatible = "nxp,tja1463", "nxp,tja1443", "nxp,tja1153", "can-transceiver-gpio"; + enable-gpios = <&gpioa 10 GPIO_ACTIVE_HIGH>; + max-bitrate = <8000000>; + #phy-cells = <0>; + }; + + can_phy1: can-phy1 { + compatible = "nxp,tja1463", "nxp,tja1443", "nxp,tja1153", "can-transceiver-gpio"; + enable-gpios = <&gpioe 2 GPIO_ACTIVE_HIGH>; + max-bitrate = <8000000>; + #phy-cells = <0>; + }; }; &gpioa { @@ -154,3 +169,25 @@ #pwm-cells = <3>; status = "okay"; }; + +&flexcan0 { + pinctrl-0 = <&flexcan0_default>; + pinctrl-names = "default"; + phys = <&can_phy0>; + bus-speed = <125000>; + sample-point = <875>; + bus-speed-data = <1000000>; + sample-point-data = <875>; + status = "okay"; +}; + +&flexcan1 { + pinctrl-0 = <&flexcan1_default>; + pinctrl-names = "default"; + phys = <&can_phy1>; + bus-speed = <125000>; + sample-point = <875>; + bus-speed-data = <1000000>; + sample-point-data = <875>; + status = "okay"; +}; diff --git a/boards/arm/ucans32k1sic/ucans32k1sic.yaml b/boards/arm/ucans32k1sic/ucans32k1sic.yaml index fd0b23a40b9d..d4bf0d5065c5 100644 --- a/boards/arm/ucans32k1sic/ucans32k1sic.yaml +++ b/boards/arm/ucans32k1sic/ucans32k1sic.yaml @@ -18,3 +18,4 @@ supported: - i2c - spi - pwm + - can