Skip to content

Commit

Permalink
drivers: usb: add usb device driver support for NPCM4XX series.
Browse files Browse the repository at this point in the history
1. add npcm4xx usb device driver.
2. add npcm4xx usb device register define in reg_def.h

Signed-off-by: Adrian Chen <[email protected]>
  • Loading branch information
cpchiang committed Aug 24, 2023
1 parent e8272f0 commit 6759286
Show file tree
Hide file tree
Showing 11 changed files with 1,385 additions and 2 deletions.
5 changes: 5 additions & 0 deletions boards/arm/npcm400f_evb/fun_def_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,8 @@ FUN_DEFINE(DT_NODELABEL(pinctrl_vin3_default), VIN3)
FUN_DEFINE(DT_NODELABEL(pinctrl_spip1_default), SPIP1_CS, SPIP1_SCLK, SPIP1_DIO0, SPIP1_DIO1)
FUN_DEFINE(DT_NODELABEL(pinctrl_spip1_quad), SPIP1_DIO2, SPIP1_DIO3)
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(usbd0), okay) && CONFIG_USB_DC_NPCM4XX
FUN_DEFINE(DT_NODELABEL(pinctrl_usbd_phy_iclk), USBD_PHY_ICLK)
FUN_DEFINE(DT_NODELABEL(pinctrl_usbd_phy_xclk), USBD_PHY_XCLK)
#endif
4 changes: 4 additions & 0 deletions boards/arm/npcm400f_evb/npcm400f_evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,7 @@
&spip1 {
status = "okay";
};

&usbd0 {
status = "okay";
};
4 changes: 4 additions & 0 deletions boards/arm/npcm400f_evb/npcm400f_evb_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,7 @@ CONFIG_ADC_NPCM4XX=y
#SPIP Driver
CONFIG_SPI=y
CONFIG_SPIP_NPCM4XX=y

# USB Driver
CONFIG_USB=y
CONFIG_USB_DC_NPCM4XX=y
5 changes: 3 additions & 2 deletions drivers/usb/device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ zephyr_sources_ifdef(CONFIG_USB_NATIVE_POSIX
usb_dc_native_posix.c
usb_dc_native_posix_adapt.c
)
zephyr_sources_ifdef(CONFIG_USB_DC_NXP_EHCI usb_dc_mcux_ehci.c)
zephyr_sources_ifdef(CONFIG_USB_ASPEED usb_dc_aspeed.c)
zephyr_sources_ifdef(CONFIG_USB_DC_NXP_EHCI usb_dc_mcux_ehci.c)
zephyr_sources_ifdef(CONFIG_USB_ASPEED usb_dc_aspeed.c)
zephyr_sources_ifdef(CONFIG_USB_DC_NPCM4XX usb_dc_npcm4xx.c)
8 changes: 8 additions & 0 deletions drivers/usb/device/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,12 @@ config USB_ASPEED
help
ASPEED USB Device Controller Driver

config USB_DC_NPCM4XX
bool "Nuvoton NPCM4XX USB Device Controller Driver"
depends on SOC_FAMILY_NPCM4XX
select USB_DEVICE_DRIVER
help
This option enables the USB device driver for NPCM4XX family of processors.
Say y if you wish to use USB device on NPCM4XX.

endif # USB
Loading

0 comments on commit 6759286

Please sign in to comment.