diff --git a/boards/nxp/frdm_mcxa344/board.c b/boards/nxp/frdm_mcxa344/board.c index aeef915ad35ad..eafb68b705a96 100644 --- a/boards/nxp/frdm_mcxa344/board.c +++ b/boards/nxp/frdm_mcxa344/board.c @@ -119,6 +119,26 @@ void board_early_init_hook(void) CLOCK_EnableClock(kCLOCK_GateGPIO4); #endif +#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpi2c0)) + CLOCK_SetClockDiv(kCLOCK_DivLPI2C0, 1u); + CLOCK_AttachClk(kFRO_LF_DIV_to_LPI2C0); +#endif + +#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpi2c1)) + CLOCK_SetClockDiv(kCLOCK_DivLPI2C1, 1u); + CLOCK_AttachClk(kFRO_LF_DIV_to_LPI2C1); +#endif + +#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpspi0)) + CLOCK_SetClockDiv(kCLOCK_DivLPSPI0, 1u); + CLOCK_AttachClk(kFRO_LF_DIV_to_LPSPI0); +#endif + +#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpspi1)) + CLOCK_SetClockDiv(kCLOCK_DivLPSPI1, 1u); + CLOCK_AttachClk(kFRO_LF_DIV_to_LPSPI1); +#endif + #if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpuart0)) CLOCK_SetClockDiv(kCLOCK_DivLPUART0, 1u); CLOCK_AttachClk(kFRO_LF_DIV_to_LPUART0); @@ -143,6 +163,10 @@ void board_early_init_hook(void) RESET_ReleasePeripheralReset(kLPUART3_RST_SHIFT_RSTn); #endif +#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(wwdt0)) + CLOCK_SetClockDiv(kCLOCK_DivWWDT0, 1u); +#endif + /* Set SystemCoreClock variable. */ SystemCoreClock = CLOCK_INIT_CORE_CLOCK; } diff --git a/boards/nxp/frdm_mcxa344/frdm_mcxa344-pinctrl.dtsi b/boards/nxp/frdm_mcxa344/frdm_mcxa344-pinctrl.dtsi index 0179bb4093d2e..af9224a9ef422 100644 --- a/boards/nxp/frdm_mcxa344/frdm_mcxa344-pinctrl.dtsi +++ b/boards/nxp/frdm_mcxa344/frdm_mcxa344-pinctrl.dtsi @@ -3,14 +3,49 @@ * SPDX-License-Identifier: Apache-2.0 */ - #include &pinctrl { + pinmux_lpi2c0: pinmux_lpi2c0 { + group0 { + pinmux = , + ; + slew-rate = "fast"; + drive-strength = "low"; + input-enable; + bias-pull-up; + drive-open-drain; + }; + }; + + pinmux_lpi2c1: pinmux_lpi2c1 { + group0 { + pinmux = , + ; + slew-rate = "fast"; + drive-strength = "low"; + input-enable; + bias-pull-up; + drive-open-drain; + }; + }; + + pinmux_lpspi0: pinmux_lpspi0 { + group0 { + pinmux = , + , + , + ; + slew-rate = "fast"; + drive-strength = "low"; + input-enable; + }; + }; + pinmux_lpuart2: pinmux_lpuart2 { group0 { pinmux = , - ; + ; drive-strength = "low"; slew-rate = "fast"; input-enable; diff --git a/boards/nxp/frdm_mcxa344/frdm_mcxa344.dts b/boards/nxp/frdm_mcxa344/frdm_mcxa344.dts index 8028d7df658b9..b55eb24122e4b 100644 --- a/boards/nxp/frdm_mcxa344/frdm_mcxa344.dts +++ b/boards/nxp/frdm_mcxa344/frdm_mcxa344.dts @@ -15,12 +15,13 @@ model = "NXP FRDM_MCXA344 board"; compatible = "nxp,mcxa344", "nxp,mcx"; - aliases{ + aliases { led0 = &red_led; led1 = &green_led; led2 = &blue_led; sw0 = &user_button_2; sw1 = &user_button_3; + watchdog0 = &wwdt0; }; chosen { @@ -105,33 +106,6 @@ status = "okay"; }; -&gpio0 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; - -&gpio2 { - status = "okay"; -}; - -&gpio3 { - status = "okay"; -}; - -&gpio4 { - status = "okay"; -}; - -&lpuart2 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&pinmux_lpuart2>; - pinctrl-names = "default"; -}; - &flash { partitions { compatible = "fixed-partitions"; @@ -160,3 +134,52 @@ }; }; }; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&gpio4 { + status = "okay"; +}; + +&lpi2c0 { + status = "okay"; + pinctrl-0 = <&pinmux_lpi2c0>; + pinctrl-names = "default"; +}; + +&lpi2c1 { + status = "okay"; + pinctrl-0 = <&pinmux_lpi2c1>; + pinctrl-names = "default"; +}; + +&lpspi0 { + status = "okay"; + pinctrl-0 = <&pinmux_lpspi0>; + pinctrl-names = "default"; +}; + +&lpuart2 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&pinmux_lpuart2>; + pinctrl-names = "default"; +}; + +&wwdt0 { + status = "okay"; +}; diff --git a/boards/nxp/frdm_mcxa344/frdm_mcxa344.yaml b/boards/nxp/frdm_mcxa344/frdm_mcxa344.yaml index 5adc5c835cb40..7a9e449b25c53 100644 --- a/boards/nxp/frdm_mcxa344/frdm_mcxa344.yaml +++ b/boards/nxp/frdm_mcxa344/frdm_mcxa344.yaml @@ -17,5 +17,8 @@ supported: - arduino_gpio - flash - gpio + - i2c + - spi - uart + - watchdog vendor: nxp diff --git a/tests/drivers/i2c/i2c_target_api/boards/frdm_mcxa344.overlay b/tests/drivers/i2c/i2c_target_api/boards/frdm_mcxa344.overlay new file mode 100644 index 0000000000000..d70dca164dac1 --- /dev/null +++ b/tests/drivers/i2c/i2c_target_api/boards/frdm_mcxa344.overlay @@ -0,0 +1,26 @@ +/* + * Copyright 2025 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* To test this sample, connect + * LPI2C0 SCL(J2-20) --> LPI2C1 SCL(J5-5) + * LPI2C0 SDA(J2-18) --> LPI2C1 SDA(J5-6) + */ + +&lpi2c0 { + eeprom0: eeprom@54 { + compatible = "zephyr,i2c-target-eeprom"; + reg = <0x54>; + size = <256>; + }; +}; + +&lpi2c1 { + eeprom1: eeprom@56 { + compatible = "zephyr,i2c-target-eeprom"; + reg = <0x56>; + size = <256>; + }; +}; diff --git a/tests/drivers/i2c/i2c_target_api/testcase.yaml b/tests/drivers/i2c/i2c_target_api/testcase.yaml index a97331d311c6a..9bcabff8e6178 100644 --- a/tests/drivers/i2c/i2c_target_api/testcase.yaml +++ b/tests/drivers/i2c/i2c_target_api/testcase.yaml @@ -57,6 +57,7 @@ tests: - frdm_mcxa346 - frdm_mcxa266 - frdm_mcxa366 + - frdm_mcxa344 - max32655evkit/max32655/m4 - max32662evkit - max32666evkit/max32666/cpu0 diff --git a/tests/drivers/spi/spi_loopback/boards/frdm_mcxa344.overlay b/tests/drivers/spi/spi_loopback/boards/frdm_mcxa344.overlay new file mode 100644 index 0000000000000..ede8ca68a37b7 --- /dev/null +++ b/tests/drivers/spi/spi_loopback/boards/frdm_mcxa344.overlay @@ -0,0 +1,22 @@ +/* + * Copyright 2025 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* To test this sample, connect + * LPSPI0 MOSI(J6-6, P1_0/LPSPI0_SDO) --> LPSPI0 MISO(J6-5, P1_2/LPSPI0_SDI) + */ +&lpspi0 { + slow@0 { + compatible = "test-spi-loopback-slow"; + reg = <0>; + spi-max-frequency = <500000>; + }; + + fast@0 { + compatible = "test-spi-loopback-fast"; + reg = <0>; + spi-max-frequency = <16000000>; + }; +};