Merge branch 'master' into renesas-ra
This commit is contained in:
@@ -33,6 +33,18 @@
|
||||
#include "bsp/board.h"
|
||||
#include "board.h"
|
||||
|
||||
#ifdef BOARD_TUD_RHPORT
|
||||
#define PORT_SUPPORT_DEVICE(_n) (BOARD_TUD_RHPORT == _n)
|
||||
#else
|
||||
#define PORT_SUPPORT_DEVICE(_n) 0
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_TUH_RHPORT
|
||||
#define PORT_SUPPORT_HOST(_n) (BOARD_TUH_RHPORT == _n)
|
||||
#else
|
||||
#define PORT_SUPPORT_HOST(_n) 0
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO TYPEDEF CONSTANT ENUM
|
||||
//--------------------------------------------------------------------+
|
||||
@@ -152,14 +164,13 @@ void board_init(void)
|
||||
|
||||
#if defined(FSL_FEATURE_SOC_USBHSD_COUNT) && FSL_FEATURE_SOC_USBHSD_COUNT
|
||||
// LPC546xx and LPC540xx has OTG 1 FS + 1 HS rhports
|
||||
|
||||
#if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
|
||||
#if PORT_SUPPORT_DEVICE(0)
|
||||
// Port0 is Full Speed
|
||||
POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY); /*< Turn on USB Phy */
|
||||
CLOCK_SetClkDiv(kCLOCK_DivUsb0Clk, 1, false);
|
||||
CLOCK_AttachClk(kFRO_HF_to_USB0_CLK);
|
||||
|
||||
/*According to reference mannual, device mode setting has to be set by access usb host register */
|
||||
/*According to reference manual, device mode setting has to be set by access usb host register */
|
||||
CLOCK_EnableClock(kCLOCK_Usbhsl0); /* enable usb0 host clock */
|
||||
USBFSH->PORTMODE |= USBFSH_PORTMODE_DEV_ENABLE_MASK;
|
||||
CLOCK_DisableClock(kCLOCK_Usbhsl0); /* disable usb0 host clock */
|
||||
@@ -167,21 +178,19 @@ void board_init(void)
|
||||
CLOCK_EnableUsbfs0DeviceClock(kCLOCK_UsbSrcFro, CLOCK_GetFroHfFreq());
|
||||
#endif
|
||||
|
||||
#if CFG_TUSB_RHPORT1_MODE & OPT_MODE_DEVICE
|
||||
#if PORT_SUPPORT_DEVICE(1)
|
||||
// Port1 is High Speed
|
||||
POWER_DisablePD(kPDRUNCFG_PD_USB1_PHY);
|
||||
|
||||
/*According to reference mannual, device mode setting has to be set by access usb host register */
|
||||
/*According to reference manual, device mode setting has to be set by access usb host register */
|
||||
CLOCK_EnableClock(kCLOCK_Usbh1); /* enable usb1 host clock */
|
||||
USBHSH->PORTMODE |= USBHSH_PORTMODE_DEV_ENABLE_MASK;
|
||||
CLOCK_DisableClock(kCLOCK_Usbh1); /* enable usb1 host clock */
|
||||
|
||||
CLOCK_EnableUsbhs0DeviceClock(kCLOCK_UsbSrcUsbPll, 0U);
|
||||
#endif
|
||||
|
||||
#else
|
||||
// LPC5411x series only has full speed device
|
||||
|
||||
POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY); // Turn on USB Phy
|
||||
CLOCK_EnableUsbfs0Clock(kCLOCK_UsbSrcFro, CLOCK_GetFreq(kCLOCK_FroHf)); /* enable USB IP clock */
|
||||
#endif
|
||||
|
@@ -15,7 +15,7 @@ CFLAGS += \
|
||||
|
||||
ifeq ($(PORT), 1)
|
||||
$(info "PORT1 High Speed")
|
||||
CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
|
||||
CFLAGS += -DBOARD_TUD_MAX_SPEED=OPT_MODE_HIGH_SPEED
|
||||
|
||||
# LPC55 Highspeed Port1 can only write to USB_SRAM region
|
||||
CFLAGS += -DCFG_TUSB_MEM_SECTION='__attribute__((section("m_usb_global")))'
|
||||
|
Reference in New Issue
Block a user