From 73a086b4dcbb52c52d1a42f3e705cc85b455fc2d Mon Sep 17 00:00:00 2001 From: Neil Chen Date: Thu, 12 Dec 2024 15:55:21 +0800 Subject: [PATCH] boards: nxp: frdm_mcxa156: Support usb for NXP frdm_mcxa156 board Support usb for NXP frdm_mcxa156 board. Test it using samples/subsys/usb/console and tests/drivers/udc Signed-off-by: Neil Chen --- boards/nxp/frdm_mcxa156/board.c | 5 +++++ boards/nxp/frdm_mcxa156/doc/index.rst | 2 ++ boards/nxp/frdm_mcxa156/frdm_mcxa156.dts | 5 +++++ boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml | 2 ++ 4 files changed, 14 insertions(+) diff --git a/boards/nxp/frdm_mcxa156/board.c b/boards/nxp/frdm_mcxa156/board.c index 648d017592229fe..f950245e78de6e8 100644 --- a/boards/nxp/frdm_mcxa156/board.c +++ b/boards/nxp/frdm_mcxa156/board.c @@ -154,6 +154,11 @@ static int frdm_mcxa156_init(void) CLOCK_AttachClk(kFRO12M_to_LPTMR0); #endif /* DT_PROP(DT_NODELABEL(lptmr0), clk_source) */ +#endif + +#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(usb)) + RESET_PeripheralReset(kUSB0_RST_SHIFT_RSTn); + CLOCK_EnableUsbfsClock(); #endif /* Set SystemCoreClock variable. */ diff --git a/boards/nxp/frdm_mcxa156/doc/index.rst b/boards/nxp/frdm_mcxa156/doc/index.rst index 0ee1c41ef77a774..89e5df55557d4e7 100644 --- a/boards/nxp/frdm_mcxa156/doc/index.rst +++ b/boards/nxp/frdm_mcxa156/doc/index.rst @@ -64,6 +64,8 @@ The FRDM-MCXA156 board configuration supports the following hardware features: +-----------+------------+-------------------------------------+ | PWM | on-chip | pwm | +-----------+------------+-------------------------------------+ +| USB | on-chip | USB device | ++-----------+------------+-------------------------------------+ Targets available ================== diff --git a/boards/nxp/frdm_mcxa156/frdm_mcxa156.dts b/boards/nxp/frdm_mcxa156/frdm_mcxa156.dts index 2e6160c59fd82d0..c9d4ca50b40a039 100644 --- a/boards/nxp/frdm_mcxa156/frdm_mcxa156.dts +++ b/boards/nxp/frdm_mcxa156/frdm_mcxa156.dts @@ -117,3 +117,8 @@ &lptmr0 { status = "okay"; }; + +zephyr_udc0: &usb { + status = "okay"; + num-bidir-endpoints = <8>; +}; diff --git a/boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml b/boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml index edbe6c4a32a4d21..eebbbab4e5d249e 100644 --- a/boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml +++ b/boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml @@ -21,4 +21,6 @@ supported: - counter - dac - pwm + - usb_device + - usbd vendor: nxp