Skip to content
Open
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
6 changes: 6 additions & 0 deletions boards/nxp/frdm_mcxaxx6/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ void board_early_init_hook(void)
CLOCK_SetClockDiv(kCLOCK_DivLPTMR0, 1u);
#endif /* DT_PROP(DT_NODELABEL(lptmr0), clk_source) */

#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(flexcan0))
CLOCK_SetClockDiv(kCLOCK_DivFLEXCAN0, 1U);
CLOCK_SetClockDiv(kCLOCK_DivFRO_HF, 1U);
CLOCK_AttachClk(kFRO_HF_DIV_to_FLEXCAN0);
#endif

/* Set SystemCoreClock variable. */
Expand Down
7 changes: 7 additions & 0 deletions boards/nxp/frdm_mcxaxx6/board_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
zephyr,code-partition = &slot0_partition;
zephyr,console = &lpuart2;
zephyr,shell-uart = &lpuart2;
zephyr,canbus = &flexcan0;
};

leds {
Expand Down Expand Up @@ -207,3 +208,9 @@
&lptmr0 {
status = "okay";
};

&flexcan0 {
status = "okay";
pinctrl-0 = <&pinmux_flexcan0>;
pinctrl-names = "default";
};
10 changes: 10 additions & 0 deletions boards/nxp/frdm_mcxaxx6/frdm_mcxa266-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,14 @@
slew-rate = "fast";
};
};

pinmux_flexcan0: pinmux_flexcan0 {
group0 {
pinmux = <CAN0_TXD_P1_2>,
<CAN0_RXD_P1_11>;
slew-rate = "fast";
drive-strength = "low";
input-enable;
};
};
};
1 change: 1 addition & 0 deletions boards/nxp/frdm_mcxaxx6/frdm_mcxa266.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ supported:
- counter
- dma
- i3c
- can
vendor: nxp
10 changes: 10 additions & 0 deletions boards/nxp/frdm_mcxaxx6/frdm_mcxa346-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,14 @@
slew-rate = "fast";
};
};

pinmux_flexcan0: pinmux_flexcan0 {
group0 {
pinmux = <CAN0_TXD_P1_2>,
<CAN0_RXD_P1_11>;
slew-rate = "fast";
drive-strength = "low";
input-enable;
};
};
};
1 change: 1 addition & 0 deletions boards/nxp/frdm_mcxaxx6/frdm_mcxa346.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ supported:
- counter
- dma
- opamp
- can
vendor: nxp
10 changes: 10 additions & 0 deletions boards/nxp/frdm_mcxaxx6/frdm_mcxa366-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,14 @@
slew-rate = "fast";
};
};

pinmux_flexcan0: pinmux_flexcan0 {
group0 {
pinmux = <CAN0_TXD_P1_2>,
<CAN0_RXD_P1_11>;
slew-rate = "fast";
drive-strength = "low";
input-enable;
};
};
};
1 change: 1 addition & 0 deletions boards/nxp/frdm_mcxaxx6/frdm_mcxa366.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ supported:
- dma
- i3c
- opamp
- can
vendor: nxp
10 changes: 8 additions & 2 deletions drivers/clock_control/clock_control_mcux_syscon.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
case MCUX_FLEXCAN0_CLK:
CLOCK_EnableClock(kCLOCK_GateFLEXCAN0);
break;
#if (defined(FSL_FEATURE_SOC_FLEXCAN_COUNT) && (FSL_FEATURE_SOC_FLEXCAN_COUNT > 1))
case MCUX_FLEXCAN1_CLK:
CLOCK_EnableClock(kCLOCK_GateFLEXCAN1);
break;
#endif /* defined(FSL_FEATURE_SOC_FLEXCAN_COUNT) */
#else
case MCUX_FLEXCAN0_CLK:
CLOCK_EnableClock(kCLOCK_Flexcan0);
Expand Down Expand Up @@ -535,7 +540,8 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
#endif /* CONFIG_ADC_MCUX_LPADC */

#if defined(CONFIG_CAN_MCUX_FLEXCAN)
#if defined(CONFIG_SOC_FAMILY_MCXA)
#if (defined(FSL_FEATURE_SOC_FLEXCAN_COUNT) && (FSL_FEATURE_SOC_FLEXCAN_COUNT == 1) && \
!defined(CONFIG_SOC_MCXA346))
case MCUX_FLEXCAN0_CLK:
*rate = CLOCK_GetFlexcanClkFreq();
break;
Expand All @@ -546,7 +552,7 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
case MCUX_FLEXCAN1_CLK:
*rate = CLOCK_GetFlexcanClkFreq(1);
break;
#endif /* defined(CONFIG_SOC_FAMILY_MCXA) */
#endif /* defined(FSL_FEATURE_SOC_FLEXCAN_COUNT) */
#endif /* defined(CONFIG_CAN_MCUX_FLEXCAN) */

#if defined(CONFIG_MCUX_FLEXIO)
Expand Down
1 change: 1 addition & 0 deletions dts/arm/nxp/nxp_mcxa346.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
#include <nxp/nxp_mcxaxx6_common.dtsi>

/delete-node/ &i3c0;
/delete-node/ &flexcan1;
20 changes: 20 additions & 0 deletions dts/arm/nxp/nxp_mcxaxx6_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,26 @@
status = "disabled";
clk-divider = <1>;
};

flexcan0: can@400cc000 {
compatible = "nxp,flexcan";
reg = <0x400cc000 0x1000>;
interrupts = <19 0>;
interrupt-names = "common";
clocks = <&syscon MCUX_FLEXCAN0_CLK>;
clk-source = <0>;
status = "disabled";
};

flexcan1: can@400d0000 {
compatible = "nxp,flexcan";
reg = <0x400d0000 0x1000>;
interrupts = <20 0>;
interrupt-names = "common";
clocks = <&syscon MCUX_FLEXCAN1_CLK>;
clk-source = <0>;
status = "disabled";
};
};
};

Expand Down
1 change: 1 addition & 0 deletions tests/drivers/can/timing/boards/frdm_mcxa266.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_TEST_ALL_BITRATES=y
1 change: 1 addition & 0 deletions tests/drivers/can/timing/boards/frdm_mcxa346.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_TEST_ALL_BITRATES=y
1 change: 1 addition & 0 deletions tests/drivers/can/timing/boards/frdm_mcxa366.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_TEST_ALL_BITRATES=y