From 006f16de25d5ca42f3225412d8076b8d1598a31b Mon Sep 17 00:00:00 2001 From: Maxime Vincent Date: Thu, 30 Mar 2023 15:46:41 +0200 Subject: [PATCH] USB: NXP LPC55S16 USB-HS support This adds USB-HS support for LPC55S16, much in the same way that LPC55S28 support was added previously. Signed-off-by: Maxime Vincent --- boards/arm/lpcxpresso55s16/lpcxpresso55s16.dts | 4 ++++ boards/arm/lpcxpresso55s16/lpcxpresso55s16.yaml | 1 + dts/arm/nxp/nxp_lpc55S1x_common.dtsi | 14 ++++++++++++-- .../nxp_lpc/lpc55xxx/Kconfig.defconfig.lpc55S16 | 4 ++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/boards/arm/lpcxpresso55s16/lpcxpresso55s16.dts b/boards/arm/lpcxpresso55s16/lpcxpresso55s16.dts index 06811165241..f8646b24f59 100644 --- a/boards/arm/lpcxpresso55s16/lpcxpresso55s16.dts +++ b/boards/arm/lpcxpresso55s16/lpcxpresso55s16.dts @@ -13,3 +13,7 @@ model = "NXP LPCXpresso55S16 board"; compatible = "nxp,lpc55xxx", "nxp,lpc"; }; + +zephyr_udc0: &usbhs { + status = "okay"; +}; diff --git a/boards/arm/lpcxpresso55s16/lpcxpresso55s16.yaml b/boards/arm/lpcxpresso55s16/lpcxpresso55s16.yaml index 660911e650e..8f3d0e47acc 100644 --- a/boards/arm/lpcxpresso55s16/lpcxpresso55s16.yaml +++ b/boards/arm/lpcxpresso55s16/lpcxpresso55s16.yaml @@ -22,3 +22,4 @@ supported: - gpio - i2c - spi + - usb_device diff --git a/dts/arm/nxp/nxp_lpc55S1x_common.dtsi b/dts/arm/nxp/nxp_lpc55S1x_common.dtsi index b392691aa3c..78239a4d166 100644 --- a/dts/arm/nxp/nxp_lpc55S1x_common.dtsi +++ b/dts/arm/nxp/nxp_lpc55S1x_common.dtsi @@ -56,11 +56,12 @@ zephyr,memory-region = "SRAM2"; }; - sram4: memory@20010000 { + usb_sram: memory@20010000 { /* Connected to USB bus*/ compatible = "zephyr,memory-region", "mmio-sram"; reg = <0x20010000 DT_SIZE_K(16)>; - zephyr,memory-region = "SRAM4"; + zephyr,memory-region = "USB_SRAM"; + zephyr,memory-region-mpu = "RAM"; }; }; @@ -232,6 +233,15 @@ reg = <0x3a000 0x1000>; status = "okay"; }; + + usbhs: usbhs@144000 { + compatible = "nxp,mcux-usbd"; + reg = <0x94000 0x1000>; + interrupts = <47 1>; + num-bidir-endpoints = <6>; + usb-controller-index = "LpcIp3511Hs0"; + status = "disabled"; + }; }; &nvic { diff --git a/soc/arm/nxp_lpc/lpc55xxx/Kconfig.defconfig.lpc55S16 b/soc/arm/nxp_lpc/lpc55xxx/Kconfig.defconfig.lpc55S16 index c3b15fa9ef3..4f93fffb586 100644 --- a/soc/arm/nxp_lpc/lpc55xxx/Kconfig.defconfig.lpc55S16 +++ b/soc/arm/nxp_lpc/lpc55xxx/Kconfig.defconfig.lpc55S16 @@ -12,4 +12,8 @@ config CAN_MCUX_MCAN default y depends on CAN +choice USB_MCUX_CONTROLLER_TYPE + default USB_DC_NXP_LPCIP3511 +endchoice + endif # SOC_LPC55S16