drivers: usb: mcux: Restructure driver for SDK updates
1. Move the defines from usb_dc_mcux.h to usb_device_config.h and fsl_os_abstraction.h. These headers are used by the SDK USB driver. usb_dc_mcux.h header file is not longer needed and hence deleted. 2. Delete the Zephyr implementation of the usb_device_struct driver and use the one implemented inside the SDK USB driver. This requires updating the references to usb_device_struct inside the USB driver 3. Move defines and structures used by the driver out of the header file that is included by the SDK and into the MCUX USB driver. 4. Use end point defines provided by Zephyr instead of adding them locally. 5. Add a Kconfig to set the thread stack size 6. Move code to enable interrupts back to usb_attach function. Interrupts should be enabled after the init is successful, else we see errors of the ISR getting called before the init is complete causing Faults 6. Update west.yml to update the NXP HAL to get the updated SDK USB driver. Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
This commit is contained in:
parent
c5f44f94f8
commit
9966181510
|
@ -156,6 +156,11 @@ config USB_DC_MSG_QUEUE_LEN
|
|||
Maximum number of messages USB device controller interrupt can queue
|
||||
for callback thread
|
||||
|
||||
config USB_MCUX_THREAD_STACK_SIZE
|
||||
int "Stack size for the USB driver"
|
||||
default 1024
|
||||
help
|
||||
Size of the stack used for the internal USB thread.
|
||||
|
||||
endif # USB_MCUX
|
||||
|
||||
|
|
|
@ -13,7 +13,11 @@
|
|||
#include <zephyr/usb/usb_device.h>
|
||||
#include <soc.h>
|
||||
#include <zephyr/device.h>
|
||||
#include "usb_dc_mcux.h"
|
||||
#include "usb.h"
|
||||
#include "usb_device.h"
|
||||
#include "usb_device_config.h"
|
||||
#include "usb_device_dci.h"
|
||||
|
||||
#ifdef CONFIG_USB_DC_NXP_EHCI
|
||||
#include "usb_device_ehci.h"
|
||||
#endif
|
||||
|
@ -74,8 +78,31 @@ K_HEAP_DEFINE_NOCACHE(ep_buf_pool, 1024 * EP_BUF_NUMOF_BLOCKS);
|
|||
K_HEAP_DEFINE(ep_buf_pool, 1024 * EP_BUF_NUMOF_BLOCKS);
|
||||
#endif
|
||||
|
||||
struct usb_ep_ctrl_data {
|
||||
usb_device_callback_message_struct_t transfer_message;
|
||||
struct k_mem_block block;
|
||||
usb_dc_ep_callback callback;
|
||||
uint16_t ep_mps;
|
||||
uint8_t ep_type;
|
||||
uint8_t ep_enabled : 1;
|
||||
uint8_t ep_occupied : 1;
|
||||
};
|
||||
|
||||
struct usb_dc_state {
|
||||
usb_device_struct_t dev_struct;
|
||||
/* Controller handle */
|
||||
usb_dc_status_callback status_cb;
|
||||
struct usb_ep_ctrl_data *eps;
|
||||
bool attached;
|
||||
uint8_t setup_data_stage;
|
||||
|
||||
K_KERNEL_STACK_MEMBER(thread_stack, CONFIG_USB_MCUX_THREAD_STACK_SIZE);
|
||||
|
||||
struct k_thread thread;
|
||||
};
|
||||
|
||||
static struct usb_ep_ctrl_data s_ep_ctrl[NUM_OF_EP_MAX];
|
||||
static struct usb_device_struct dev_data;
|
||||
static struct usb_dc_state dev_state;
|
||||
|
||||
/* Message queue for the usb thread */
|
||||
K_MSGQ_DEFINE(usb_dc_msgq, sizeof(usb_device_callback_message_struct_t),
|
||||
|
@ -103,11 +130,13 @@ extern void USB_DeviceLpcIp3511IsrFunction(void *deviceHandle);
|
|||
|
||||
int usb_dc_reset(void)
|
||||
{
|
||||
if (dev_data.controllerHandle != NULL) {
|
||||
dev_data.interface->deviceControl(dev_data.controllerHandle,
|
||||
kUSB_DeviceControlStop, NULL);
|
||||
dev_data.interface->deviceDeinit(dev_data.controllerHandle);
|
||||
dev_data.controllerHandle = NULL;
|
||||
if (dev_state.dev_struct.controllerHandle != NULL) {
|
||||
dev_state.dev_struct.controllerInterface->deviceControl(
|
||||
dev_state.dev_struct.controllerHandle,
|
||||
kUSB_DeviceControlStop, NULL);
|
||||
dev_state.dev_struct.controllerInterface->deviceDeinit(
|
||||
dev_state.dev_struct.controllerHandle);
|
||||
dev_state.dev_struct.controllerHandle = NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -117,22 +146,27 @@ int usb_dc_attach(void)
|
|||
{
|
||||
usb_status_t status;
|
||||
|
||||
dev_data.eps = &s_ep_ctrl[0];
|
||||
if (dev_data.attached) {
|
||||
dev_state.eps = &s_ep_ctrl[0];
|
||||
if (dev_state.attached) {
|
||||
LOG_WRN("Already attached");
|
||||
return 0;
|
||||
}
|
||||
|
||||
dev_data.interface = &mcux_usb_iface;
|
||||
status = dev_data.interface->deviceInit(CONTROLLER_ID, &dev_data,
|
||||
&dev_data.controllerHandle);
|
||||
dev_state.dev_struct.controllerInterface = &mcux_usb_iface;
|
||||
status = dev_state.dev_struct.controllerInterface->deviceInit(CONTROLLER_ID,
|
||||
&dev_state.dev_struct,
|
||||
&dev_state.dev_struct.controllerHandle);
|
||||
if (kStatus_USB_Success != status) {
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
dev_data.attached = true;
|
||||
status = dev_data.interface->deviceControl(dev_data.controllerHandle,
|
||||
kUSB_DeviceControlRun, NULL);
|
||||
IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority),
|
||||
usb_isr_handler, 0, 0);
|
||||
irq_enable(DT_INST_IRQN(0));
|
||||
dev_state.attached = true;
|
||||
status = dev_state.dev_struct.controllerInterface->deviceControl(
|
||||
dev_state.dev_struct.controllerHandle,
|
||||
kUSB_DeviceControlRun, NULL);
|
||||
|
||||
LOG_DBG("Attached");
|
||||
|
||||
|
@ -143,25 +177,27 @@ int usb_dc_detach(void)
|
|||
{
|
||||
usb_status_t status;
|
||||
|
||||
if (dev_data.controllerHandle == NULL) {
|
||||
if (dev_state.dev_struct.controllerHandle == NULL) {
|
||||
LOG_WRN("Device not attached");
|
||||
return 0;
|
||||
}
|
||||
|
||||
status = dev_data.interface->deviceControl(dev_data.controllerHandle,
|
||||
status = dev_state.dev_struct.controllerInterface->deviceControl(
|
||||
dev_state.dev_struct.controllerHandle,
|
||||
kUSB_DeviceControlStop,
|
||||
NULL);
|
||||
if (kStatus_USB_Success != status) {
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
status = dev_data.interface->deviceDeinit(dev_data.controllerHandle);
|
||||
status = dev_state.dev_struct.controllerInterface->deviceDeinit(
|
||||
dev_state.dev_struct.controllerHandle);
|
||||
if (kStatus_USB_Success != status) {
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
dev_data.controllerHandle = NULL;
|
||||
dev_data.attached = false;
|
||||
dev_state.dev_struct.controllerHandle = NULL;
|
||||
dev_state.attached = false;
|
||||
LOG_DBG("Detached");
|
||||
|
||||
return 0;
|
||||
|
@ -171,11 +207,11 @@ int usb_dc_set_address(const uint8_t addr)
|
|||
{
|
||||
usb_status_t status;
|
||||
|
||||
dev_data.address = addr;
|
||||
status = dev_data.interface->deviceControl(
|
||||
dev_data.controllerHandle,
|
||||
dev_state.dev_struct.deviceAddress = addr;
|
||||
status = dev_state.dev_struct.controllerInterface->deviceControl(
|
||||
dev_state.dev_struct.controllerHandle,
|
||||
kUSB_DeviceControlPreSetDeviceAddress,
|
||||
&dev_data.address);
|
||||
&dev_state.dev_struct.deviceAddress);
|
||||
if (kStatus_USB_Success != status) {
|
||||
LOG_ERR("Failed to set device address");
|
||||
return -EINVAL;
|
||||
|
@ -206,21 +242,21 @@ int usb_dc_ep_configure(const struct usb_dc_ep_cfg_data *const cfg)
|
|||
uint8_t ep_abs_idx = EP_ABS_IDX(cfg->ep_addr);
|
||||
usb_device_endpoint_init_struct_t ep_init;
|
||||
struct k_mem_block *block;
|
||||
struct usb_ep_ctrl_data *eps = &dev_data.eps[ep_abs_idx];
|
||||
struct usb_ep_ctrl_data *eps = &dev_state.eps[ep_abs_idx];
|
||||
usb_status_t status;
|
||||
|
||||
ep_init.zlt = 0U;
|
||||
ep_init.endpointAddress = cfg->ep_addr;
|
||||
ep_init.maxPacketSize = cfg->ep_mps;
|
||||
ep_init.transferType = cfg->ep_type;
|
||||
dev_data.eps[ep_abs_idx].ep_type = cfg->ep_type;
|
||||
dev_state.eps[ep_abs_idx].ep_type = cfg->ep_type;
|
||||
|
||||
if (ep_abs_idx >= NUM_OF_EP_MAX) {
|
||||
LOG_ERR("Wrong endpoint index/address");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (dev_data.eps[ep_abs_idx].ep_enabled) {
|
||||
if (dev_state.eps[ep_abs_idx].ep_enabled) {
|
||||
LOG_WRN("Endpoint already configured");
|
||||
return 0;
|
||||
}
|
||||
|
@ -238,8 +274,9 @@ int usb_dc_ep_configure(const struct usb_dc_ep_cfg_data *const cfg)
|
|||
}
|
||||
|
||||
memset(block->data, 0, cfg->ep_mps);
|
||||
dev_data.eps[ep_abs_idx].ep_mps = cfg->ep_mps;
|
||||
status = dev_data.interface->deviceControl(dev_data.controllerHandle,
|
||||
dev_state.eps[ep_abs_idx].ep_mps = cfg->ep_mps;
|
||||
status = dev_state.dev_struct.controllerInterface->deviceControl(
|
||||
dev_state.dev_struct.controllerHandle,
|
||||
kUSB_DeviceControlEndpointInit, &ep_init);
|
||||
if (kStatus_USB_Success != status) {
|
||||
LOG_ERR("Failed to initialize endpoint");
|
||||
|
@ -252,9 +289,9 @@ int usb_dc_ep_configure(const struct usb_dc_ep_cfg_data *const cfg)
|
|||
*/
|
||||
if ((USB_EP_GET_IDX(cfg->ep_addr) == USB_CONTROL_ENDPOINT) &&
|
||||
(USB_EP_DIR_IS_OUT(cfg->ep_addr))) {
|
||||
dev_data.eps[ep_abs_idx].ep_occupied = true;
|
||||
dev_state.eps[ep_abs_idx].ep_occupied = true;
|
||||
}
|
||||
dev_data.eps[ep_abs_idx].ep_enabled = true;
|
||||
dev_state.eps[ep_abs_idx].ep_enabled = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -270,7 +307,8 @@ int usb_dc_ep_set_stall(const uint8_t ep)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = dev_data.interface->deviceControl(dev_data.controllerHandle,
|
||||
status = dev_state.dev_struct.controllerInterface->deviceControl(
|
||||
dev_state.dev_struct.controllerHandle,
|
||||
kUSB_DeviceControlEndpointStall, &endpoint);
|
||||
if (kStatus_USB_Success != status) {
|
||||
LOG_ERR("Failed to stall endpoint");
|
||||
|
@ -291,7 +329,8 @@ int usb_dc_ep_clear_stall(const uint8_t ep)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = dev_data.interface->deviceControl(dev_data.controllerHandle,
|
||||
status = dev_state.dev_struct.controllerInterface->deviceControl(
|
||||
dev_state.dev_struct.controllerHandle,
|
||||
kUSB_DeviceControlEndpointUnstall, &endpoint);
|
||||
if (kStatus_USB_Success != status) {
|
||||
LOG_ERR("Failed to clear stall");
|
||||
|
@ -300,16 +339,16 @@ int usb_dc_ep_clear_stall(const uint8_t ep)
|
|||
|
||||
if ((USB_EP_GET_IDX(ep) != USB_CONTROL_ENDPOINT) &&
|
||||
(USB_EP_DIR_IS_OUT(ep))) {
|
||||
status = dev_data.interface->deviceRecv(
|
||||
dev_data.controllerHandle, ep,
|
||||
(uint8_t *)dev_data.eps[ep_abs_idx].block.data,
|
||||
(uint32_t)dev_data.eps[ep_abs_idx].ep_mps);
|
||||
status = dev_state.dev_struct.controllerInterface->deviceRecv(
|
||||
dev_state.dev_struct.controllerHandle, ep,
|
||||
(uint8_t *)dev_state.eps[ep_abs_idx].block.data,
|
||||
(uint32_t)dev_state.eps[ep_abs_idx].ep_mps);
|
||||
if (kStatus_USB_Success != status) {
|
||||
LOG_ERR("Failed to enable reception on 0x%02x", ep);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
dev_data.eps[ep_abs_idx].ep_occupied = true;
|
||||
dev_state.eps[ep_abs_idx].ep_occupied = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -333,7 +372,8 @@ int usb_dc_ep_is_stalled(const uint8_t ep, uint8_t *const stalled)
|
|||
*stalled = 0;
|
||||
ep_status.endpointAddress = ep;
|
||||
ep_status.endpointStatus = kUSB_DeviceEndpointStateIdle;
|
||||
status = dev_data.interface->deviceControl(dev_data.controllerHandle,
|
||||
status = dev_state.dev_struct.controllerInterface->deviceControl(
|
||||
dev_state.dev_struct.controllerHandle,
|
||||
kUSB_DeviceControlGetEndpointStatus, &ep_status);
|
||||
if (kStatus_USB_Success != status) {
|
||||
LOG_ERR("Failed to get endpoint status");
|
||||
|
@ -368,29 +408,29 @@ int usb_dc_ep_enable(const uint8_t ep)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (dev_data.eps[ep_abs_idx].ep_occupied) {
|
||||
if (dev_state.eps[ep_abs_idx].ep_occupied) {
|
||||
LOG_WRN("endpoint 0x%x already enabled", ep);
|
||||
return -EALREADY;
|
||||
}
|
||||
|
||||
if ((USB_EP_GET_IDX(ep) != USB_CONTROL_ENDPOINT) &&
|
||||
(USB_EP_DIR_IS_OUT(ep))) {
|
||||
status = dev_data.interface->deviceRecv(
|
||||
dev_data.controllerHandle, ep,
|
||||
(uint8_t *)dev_data.eps[ep_abs_idx].block.data,
|
||||
(uint32_t)dev_data.eps[ep_abs_idx].ep_mps);
|
||||
status = dev_state.dev_struct.controllerInterface->deviceRecv(
|
||||
dev_state.dev_struct.controllerHandle, ep,
|
||||
(uint8_t *)dev_state.eps[ep_abs_idx].block.data,
|
||||
(uint32_t)dev_state.eps[ep_abs_idx].ep_mps);
|
||||
if (kStatus_USB_Success != status) {
|
||||
LOG_ERR("Failed to enable reception on 0x%02x", ep);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
dev_data.eps[ep_abs_idx].ep_occupied = true;
|
||||
dev_state.eps[ep_abs_idx].ep_occupied = true;
|
||||
} else {
|
||||
/*
|
||||
* control endpoint just be enabled before enumeration,
|
||||
* when running here, setup has been primed.
|
||||
*/
|
||||
dev_data.eps[ep_abs_idx].ep_occupied = true;
|
||||
dev_state.eps[ep_abs_idx].ep_occupied = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -406,14 +446,15 @@ int usb_dc_ep_disable(const uint8_t ep)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = dev_data.interface->deviceCancel(dev_data.controllerHandle,
|
||||
status = dev_state.dev_struct.controllerInterface->deviceCancel(
|
||||
dev_state.dev_struct.controllerHandle,
|
||||
ep);
|
||||
if (kStatus_USB_Success != status) {
|
||||
LOG_ERR("Failed to disable ep 0x%02x", ep);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
dev_data.eps[ep_abs_idx].ep_enabled = false;
|
||||
dev_state.eps[ep_abs_idx].ep_enabled = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -436,7 +477,7 @@ int usb_dc_ep_write(const uint8_t ep, const uint8_t *const data,
|
|||
const uint32_t data_len, uint32_t *const ret_bytes)
|
||||
{
|
||||
uint8_t ep_abs_idx = EP_ABS_IDX(ep);
|
||||
uint8_t *buffer = (uint8_t *)dev_data.eps[ep_abs_idx].block.data;
|
||||
uint8_t *buffer = (uint8_t *)dev_state.eps[ep_abs_idx].block.data;
|
||||
uint32_t len_to_send;
|
||||
usb_status_t status;
|
||||
|
||||
|
@ -445,8 +486,8 @@ int usb_dc_ep_write(const uint8_t ep, const uint8_t *const data,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (data_len > dev_data.eps[ep_abs_idx].ep_mps) {
|
||||
len_to_send = dev_data.eps[ep_abs_idx].ep_mps;
|
||||
if (data_len > dev_state.eps[ep_abs_idx].ep_mps) {
|
||||
len_to_send = dev_state.eps[ep_abs_idx].ep_mps;
|
||||
} else {
|
||||
len_to_send = data_len;
|
||||
}
|
||||
|
@ -458,7 +499,8 @@ int usb_dc_ep_write(const uint8_t ep, const uint8_t *const data,
|
|||
#if defined(CONFIG_HAS_MCUX_CACHE) && !defined(EP_BUF_NONCACHED)
|
||||
DCACHE_CleanByRange((uint32_t)buffer, len_to_send);
|
||||
#endif
|
||||
status = dev_data.interface->deviceSend(dev_data.controllerHandle,
|
||||
status = dev_state.dev_struct.controllerInterface->deviceSend(
|
||||
dev_state.dev_struct.controllerHandle,
|
||||
ep, buffer, len_to_send);
|
||||
if (kStatus_USB_Success != status) {
|
||||
LOG_ERR("Failed to fill ep 0x%02x buffer", ep);
|
||||
|
@ -481,17 +523,17 @@ static void update_control_stage(usb_device_callback_message_struct_t *cb_msg,
|
|||
|
||||
if (cb_msg->isSetup) {
|
||||
if (usbd_setup->wLength == 0) {
|
||||
dev_data.setupDataStage = SETUP_DATA_STAGE_DONE;
|
||||
dev_state.setup_data_stage = SETUP_DATA_STAGE_DONE;
|
||||
} else if (usb_reqtype_is_to_host(usbd_setup)) {
|
||||
dev_data.setupDataStage = SETUP_DATA_STAGE_IN;
|
||||
dev_state.setup_data_stage = SETUP_DATA_STAGE_IN;
|
||||
} else {
|
||||
dev_data.setupDataStage = SETUP_DATA_STAGE_OUT;
|
||||
dev_state.setup_data_stage = SETUP_DATA_STAGE_OUT;
|
||||
}
|
||||
} else {
|
||||
if (dev_data.setupDataStage != SETUP_DATA_STAGE_DONE) {
|
||||
if (dev_state.setup_data_stage != SETUP_DATA_STAGE_DONE) {
|
||||
if ((data_len >= max_data_len) ||
|
||||
(data_len < dev_data.eps[0].ep_mps)) {
|
||||
dev_data.setupDataStage = SETUP_DATA_STAGE_DONE;
|
||||
(data_len < dev_state.eps[0].ep_mps)) {
|
||||
dev_state.setup_data_stage = SETUP_DATA_STAGE_DONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -504,7 +546,7 @@ int usb_dc_ep_read_wait(uint8_t ep, uint8_t *data, uint32_t max_data_len,
|
|||
uint32_t data_len;
|
||||
uint8_t *bufp = NULL;
|
||||
|
||||
while (dev_data.eps[ep_abs_idx].ep_occupied) {
|
||||
while (dev_state.eps[ep_abs_idx].ep_occupied) {
|
||||
LOG_ERR("Endpoint is occupied by the controller");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
@ -525,8 +567,8 @@ int usb_dc_ep_read_wait(uint8_t ep, uint8_t *data, uint32_t max_data_len,
|
|||
* It is control setup, we should use message.buffer,
|
||||
* this buffer is from internal setup array.
|
||||
*/
|
||||
bufp = dev_data.eps[ep_abs_idx].transfer_message.buffer;
|
||||
data_len = dev_data.eps[ep_abs_idx].transfer_message.length;
|
||||
bufp = dev_state.eps[ep_abs_idx].transfer_message.buffer;
|
||||
data_len = dev_state.eps[ep_abs_idx].transfer_message.length;
|
||||
if (data_len == USB_UNINITIALIZED_VAL_32) {
|
||||
if (read_bytes) {
|
||||
*read_bytes = 0;
|
||||
|
@ -560,7 +602,7 @@ int usb_dc_ep_read_wait(uint8_t ep, uint8_t *data, uint32_t max_data_len,
|
|||
}
|
||||
|
||||
if (USB_EP_GET_IDX(ep) == USB_ENDPOINT_CONTROL) {
|
||||
update_control_stage(&dev_data.eps[0].transfer_message,
|
||||
update_control_stage(&dev_state.eps[0].transfer_message,
|
||||
data_len, max_data_len);
|
||||
}
|
||||
|
||||
|
@ -577,30 +619,31 @@ int usb_dc_ep_read_continue(uint8_t ep)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (dev_data.eps[ep_abs_idx].ep_occupied) {
|
||||
if (dev_state.eps[ep_abs_idx].ep_occupied) {
|
||||
LOG_WRN("endpoint 0x%x already occupied", ep);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
if (USB_EP_GET_IDX(ep) == USB_ENDPOINT_CONTROL) {
|
||||
if (dev_data.setupDataStage == SETUP_DATA_STAGE_DONE) {
|
||||
if (dev_state.setup_data_stage == SETUP_DATA_STAGE_DONE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (dev_data.setupDataStage == SETUP_DATA_STAGE_IN) {
|
||||
dev_data.setupDataStage = SETUP_DATA_STAGE_DONE;
|
||||
if (dev_state.setup_data_stage == SETUP_DATA_STAGE_IN) {
|
||||
dev_state.setup_data_stage = SETUP_DATA_STAGE_DONE;
|
||||
}
|
||||
}
|
||||
|
||||
status = dev_data.interface->deviceRecv(dev_data.controllerHandle, ep,
|
||||
(uint8_t *)dev_data.eps[ep_abs_idx].block.data,
|
||||
dev_data.eps[ep_abs_idx].ep_mps);
|
||||
status = dev_state.dev_struct.controllerInterface->deviceRecv(
|
||||
dev_state.dev_struct.controllerHandle, ep,
|
||||
(uint8_t *)dev_state.eps[ep_abs_idx].block.data,
|
||||
dev_state.eps[ep_abs_idx].ep_mps);
|
||||
if (kStatus_USB_Success != status) {
|
||||
LOG_ERR("Failed to enable reception on ep 0x%02x", ep);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
dev_data.eps[ep_abs_idx].ep_occupied = true;
|
||||
dev_state.eps[ep_abs_idx].ep_occupied = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -634,17 +677,17 @@ int usb_dc_ep_set_callback(const uint8_t ep, const usb_dc_ep_callback cb)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!dev_data.attached) {
|
||||
if (!dev_state.attached) {
|
||||
return -EINVAL;
|
||||
}
|
||||
dev_data.eps[ep_abs_idx].callback = cb;
|
||||
dev_state.eps[ep_abs_idx].callback = cb;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void usb_dc_set_status_callback(const usb_dc_status_callback cb)
|
||||
{
|
||||
dev_data.status_callback = cb;
|
||||
dev_state.status_cb = cb;
|
||||
}
|
||||
|
||||
int usb_dc_ep_mps(const uint8_t ep)
|
||||
|
@ -656,7 +699,7 @@ int usb_dc_ep_mps(const uint8_t ep)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
return dev_data.eps[ep_abs_idx].ep_mps;
|
||||
return dev_state.eps[ep_abs_idx].ep_mps;
|
||||
}
|
||||
|
||||
static void handle_bus_reset(void)
|
||||
|
@ -665,46 +708,49 @@ static void handle_bus_reset(void)
|
|||
uint8_t ep_abs_idx = 0;
|
||||
usb_status_t status;
|
||||
|
||||
dev_data.address = 0;
|
||||
status = dev_data.interface->deviceControl(dev_data.controllerHandle,
|
||||
dev_state.dev_struct.deviceAddress = 0;
|
||||
status = dev_state.dev_struct.controllerInterface->deviceControl(
|
||||
dev_state.dev_struct.controllerHandle,
|
||||
kUSB_DeviceControlSetDefaultStatus, NULL);
|
||||
if (kStatus_USB_Success != status) {
|
||||
LOG_ERR("Failed to set default status");
|
||||
}
|
||||
|
||||
for (int i = 0; i < NUM_OF_EP_MAX; i++) {
|
||||
dev_data.eps[i].ep_occupied = false;
|
||||
dev_data.eps[i].ep_enabled = false;
|
||||
dev_state.eps[i].ep_occupied = false;
|
||||
dev_state.eps[i].ep_enabled = false;
|
||||
}
|
||||
|
||||
ep_init.zlt = 0U;
|
||||
ep_init.transferType = USB_ENDPOINT_CONTROL;
|
||||
ep_init.maxPacketSize = EP0_MAX_PACKET_SIZE;
|
||||
ep_init.endpointAddress = EP0_OUT;
|
||||
ep_init.maxPacketSize = USB_CONTROL_EP_MPS;
|
||||
ep_init.endpointAddress = USB_CONTROL_EP_OUT;
|
||||
|
||||
ep_abs_idx = EP_ABS_IDX(ep_init.endpointAddress);
|
||||
dev_data.eps[ep_abs_idx].ep_mps = EP0_MAX_PACKET_SIZE;
|
||||
dev_state.eps[ep_abs_idx].ep_mps = USB_CONTROL_EP_MPS;
|
||||
|
||||
status = dev_data.interface->deviceControl(dev_data.controllerHandle,
|
||||
status = dev_state.dev_struct.controllerInterface->deviceControl(
|
||||
dev_state.dev_struct.controllerHandle,
|
||||
kUSB_DeviceControlEndpointInit, &ep_init);
|
||||
if (kStatus_USB_Success != status) {
|
||||
LOG_ERR("Failed to initialize control OUT endpoint");
|
||||
}
|
||||
|
||||
dev_data.eps[ep_abs_idx].ep_occupied = false;
|
||||
dev_data.eps[ep_abs_idx].ep_enabled = true;
|
||||
dev_state.eps[ep_abs_idx].ep_occupied = false;
|
||||
dev_state.eps[ep_abs_idx].ep_enabled = true;
|
||||
|
||||
ep_init.endpointAddress = EP0_IN;
|
||||
ep_init.endpointAddress = USB_CONTROL_EP_IN;
|
||||
ep_abs_idx = EP_ABS_IDX(ep_init.endpointAddress);
|
||||
dev_data.eps[ep_abs_idx].ep_mps = EP0_MAX_PACKET_SIZE;
|
||||
status = dev_data.interface->deviceControl(dev_data.controllerHandle,
|
||||
dev_state.eps[ep_abs_idx].ep_mps = USB_CONTROL_EP_MPS;
|
||||
status = dev_state.dev_struct.controllerInterface->deviceControl(
|
||||
dev_state.dev_struct.controllerHandle,
|
||||
kUSB_DeviceControlEndpointInit, &ep_init);
|
||||
if (kStatus_USB_Success != status) {
|
||||
LOG_ERR("Failed to initialize control IN endpoint");
|
||||
}
|
||||
|
||||
dev_data.eps[ep_abs_idx].ep_occupied = false;
|
||||
dev_data.eps[ep_abs_idx].ep_enabled = true;
|
||||
dev_state.eps[ep_abs_idx].ep_occupied = false;
|
||||
dev_state.eps[ep_abs_idx].ep_enabled = true;
|
||||
}
|
||||
|
||||
static void handle_transfer_msg(usb_device_callback_message_struct_t *cb_msg)
|
||||
|
@ -714,7 +760,7 @@ static void handle_transfer_msg(usb_device_callback_message_struct_t *cb_msg)
|
|||
uint8_t ep_abs_idx = EP_ABS_IDX(ep);
|
||||
usb_status_t status;
|
||||
|
||||
dev_data.eps[ep_abs_idx].ep_occupied = false;
|
||||
dev_state.eps[ep_abs_idx].ep_occupied = false;
|
||||
|
||||
if (cb_msg->length == UINT32_MAX) {
|
||||
/*
|
||||
|
@ -729,20 +775,20 @@ static void handle_transfer_msg(usb_device_callback_message_struct_t *cb_msg)
|
|||
} else {
|
||||
/* IN TOKEN */
|
||||
if (USB_EP_DIR_IS_IN(ep)) {
|
||||
if ((dev_data.address != 0) && (ep_abs_idx == 1)) {
|
||||
if ((dev_state.dev_struct.deviceAddress != 0) && (ep_abs_idx == 1)) {
|
||||
/*
|
||||
* Set Address in the status stage in
|
||||
* the IN transfer.
|
||||
*/
|
||||
status = dev_data.interface->deviceControl(
|
||||
dev_data.controllerHandle,
|
||||
status = dev_state.dev_struct.controllerInterface->deviceControl(
|
||||
dev_state.dev_struct.controllerHandle,
|
||||
kUSB_DeviceControlSetDeviceAddress,
|
||||
&dev_data.address);
|
||||
&dev_state.dev_struct.deviceAddress);
|
||||
if (kStatus_USB_Success != status) {
|
||||
LOG_ERR("Failed to set device address");
|
||||
return;
|
||||
}
|
||||
dev_data.address = 0;
|
||||
dev_state.dev_struct.deviceAddress = 0;
|
||||
}
|
||||
ep_status_code = USB_DC_EP_DATA_IN;
|
||||
}
|
||||
|
@ -752,14 +798,14 @@ static void handle_transfer_msg(usb_device_callback_message_struct_t *cb_msg)
|
|||
}
|
||||
}
|
||||
|
||||
if (dev_data.eps[ep_abs_idx].callback) {
|
||||
if (dev_state.eps[ep_abs_idx].callback) {
|
||||
#if defined(CONFIG_HAS_MCUX_CACHE) && !defined(EP_BUF_NONCACHED)
|
||||
if (cb_msg->length) {
|
||||
DCACHE_InvalidateByRange((uint32_t)cb_msg->buffer,
|
||||
cb_msg->length);
|
||||
}
|
||||
#endif
|
||||
dev_data.eps[ep_abs_idx].callback(ep, ep_status_code);
|
||||
dev_state.eps[ep_abs_idx].callback(ep, ep_status_code);
|
||||
} else {
|
||||
LOG_ERR("No cb pointer for endpoint 0x%02x", ep);
|
||||
}
|
||||
|
@ -785,16 +831,16 @@ static void usb_mcux_thread_main(void *arg1, void *arg2, void *arg3)
|
|||
switch (msg.code) {
|
||||
case kUSB_DeviceNotifyBusReset:
|
||||
handle_bus_reset();
|
||||
dev_data.status_callback(USB_DC_RESET, NULL);
|
||||
dev_state.status_cb(USB_DC_RESET, NULL);
|
||||
break;
|
||||
case kUSB_DeviceNotifyError:
|
||||
dev_data.status_callback(USB_DC_ERROR, NULL);
|
||||
dev_state.status_cb(USB_DC_ERROR, NULL);
|
||||
break;
|
||||
case kUSB_DeviceNotifySuspend:
|
||||
dev_data.status_callback(USB_DC_SUSPEND, NULL);
|
||||
dev_state.status_cb(USB_DC_SUSPEND, NULL);
|
||||
break;
|
||||
case kUSB_DeviceNotifyResume:
|
||||
dev_data.status_callback(USB_DC_RESUME, NULL);
|
||||
dev_state.status_cb(USB_DC_RESUME, NULL);
|
||||
break;
|
||||
default:
|
||||
ep_abs_idx = EP_ABS_IDX(msg.code);
|
||||
|
@ -804,9 +850,9 @@ static void usb_mcux_thread_main(void *arg1, void *arg2, void *arg3)
|
|||
return;
|
||||
}
|
||||
|
||||
memcpy(&dev_data.eps[ep_abs_idx].transfer_message, &msg,
|
||||
memcpy(&dev_state.eps[ep_abs_idx].transfer_message, &msg,
|
||||
sizeof(usb_device_callback_message_struct_t));
|
||||
handle_transfer_msg(&dev_data.eps[ep_abs_idx].transfer_message);
|
||||
handle_transfer_msg(&dev_state.eps[ep_abs_idx].transfer_message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -823,9 +869,9 @@ usb_status_t USB_DeviceNotificationTrigger(void *handle, void *msg)
|
|||
static void usb_isr_handler(void)
|
||||
{
|
||||
#if defined(CONFIG_USB_DC_NXP_EHCI)
|
||||
USB_DeviceEhciIsrFunction(&dev_data);
|
||||
USB_DeviceEhciIsrFunction(&dev_state);
|
||||
#elif defined(CONFIG_USB_DC_NXP_LPCIP3511)
|
||||
USB_DeviceLpcIp3511IsrFunction(&dev_data);
|
||||
USB_DeviceLpcIp3511IsrFunction(&dev_state);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -833,15 +879,11 @@ static int usb_mcux_init(const struct device *dev)
|
|||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
k_thread_create(&dev_data.thread, dev_data.thread_stack,
|
||||
USBD_MCUX_THREAD_STACK_SIZE,
|
||||
k_thread_create(&dev_state.thread, dev_state.thread_stack,
|
||||
CONFIG_USB_MCUX_THREAD_STACK_SIZE,
|
||||
usb_mcux_thread_main, NULL, NULL, NULL,
|
||||
K_PRIO_COOP(2), 0, K_NO_WAIT);
|
||||
k_thread_name_set(&dev_data.thread, "usb_mcux");
|
||||
|
||||
IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority),
|
||||
usb_isr_handler, 0, 0);
|
||||
irq_enable(DT_INST_IRQN(0));
|
||||
k_thread_name_set(&dev_state.thread, "usb_mcux");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -6,3 +6,5 @@
|
|||
|
||||
add_subdirectory(${ZEPHYR_CURRENT_MODULE_DIR} hal_nxp)
|
||||
add_subdirectory_ifdef(CONFIG_USB_DEVICE_DRIVER usb)
|
||||
|
||||
zephyr_include_directories(.)
|
||||
|
|
17
modules/hal_nxp/fsl_os_abstraction.h
Normal file
17
modules/hal_nxp/fsl_os_abstraction.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* Copyright 2022 NXP
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef __FSL_OS_ABSTRACTION__
|
||||
#define __FSL_OS_ABSTRACTION__
|
||||
|
||||
#include <zephyr/irq.h>
|
||||
|
||||
/* enter critical macros */
|
||||
#define OSA_SR_ALLOC() int osa_current_sr
|
||||
#define OSA_ENTER_CRITICAL() osa_current_sr = irq_lock()
|
||||
#define OSA_EXIT_CRITICAL() irq_unlock(osa_current_sr)
|
||||
|
||||
#endif /* __FSL_OS_ABSTRACTION__ */
|
|
@ -1,144 +0,0 @@
|
|||
/*
|
||||
* Copyright 2018 - 2021 NXP
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef __USB_DC_MCUX_H__
|
||||
#define __USB_DC_MCUX_H__
|
||||
|
||||
#include <zephyr/drivers/usb/usb_dc.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include "usb_spec.h"
|
||||
#include "usb.h"
|
||||
#include "usb_device_dci.h"
|
||||
#include "usb_device.h"
|
||||
|
||||
/******************************************************************************
|
||||
* Definitions
|
||||
*****************************************************************************/
|
||||
/* EHCI instance count */
|
||||
#ifdef CONFIG_USB_DC_NXP_EHCI
|
||||
#define USB_DEVICE_CONFIG_EHCI (1U)
|
||||
/* How many the DTD are supported. */
|
||||
#define USB_DEVICE_CONFIG_EHCI_MAX_DTD (16U)
|
||||
/* Whether device is self power. 1U supported, 0U not supported */
|
||||
#define USB_DEVICE_CONFIG_SELF_POWER (1U)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_DC_NXP_LPCIP3511
|
||||
|
||||
#ifdef USBHSD_BASE_ADDRS
|
||||
#define USB_DEVICE_CONFIG_LPCIP3511HS (1U)
|
||||
#else
|
||||
#define USB_DEVICE_CONFIG_LPCIP3511HS (0U)
|
||||
#endif
|
||||
|
||||
#ifdef USB_BASE_ADDRS
|
||||
#define USB_DEVICE_CONFIG_LPCIP3511FS (1U)
|
||||
#else
|
||||
#define USB_DEVICE_CONFIG_LPCIP3511FS (0U)
|
||||
#endif
|
||||
|
||||
/* Whether device is self power. 1U supported, 0U not supported */
|
||||
#define USB_DEVICE_CONFIG_SELF_POWER (1U)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BIG_ENDIAN)
|
||||
#define USB_SHORT_FROM_LITTLE_ENDIAN(n) __bswap_16(n)
|
||||
#else
|
||||
#define USB_SHORT_FROM_LITTLE_ENDIAN(n) (n)
|
||||
#endif
|
||||
|
||||
#if (((defined(USB_DEVICE_CONFIG_LPCIP3511FS)) && (USB_DEVICE_CONFIG_LPCIP3511FS > 0U)) || \
|
||||
((defined(USB_DEVICE_CONFIG_LPCIP3511HS)) && (USB_DEVICE_CONFIG_LPCIP3511HS > 0U)))
|
||||
#define USB_DATA_ALIGN_SIZE 64U
|
||||
#else
|
||||
#define USB_DATA_ALIGN_SIZE 4U
|
||||
#endif
|
||||
|
||||
#define USB_DATA_ALIGN_SIZE_MULTIPLE(n) (((n) + USB_DATA_ALIGN_SIZE - 1U) & \
|
||||
(~(USB_DATA_ALIGN_SIZE - 1U)))
|
||||
|
||||
/* Number of endpoints supported */
|
||||
#define USB_DEVICE_CONFIG_ENDPOINTS (DT_INST_PROP(0, num_bidir_endpoints))
|
||||
|
||||
/* controller driver do the ZLP for controller transfer automatically or not */
|
||||
#define USB_DEVICE_CONTROLLER_AUTO_CONTROL_TRANSFER_ZLP (0)
|
||||
|
||||
/* endpoint related macros */
|
||||
#define EP0_MAX_PACKET_SIZE 64
|
||||
#define EP0_OUT 0
|
||||
#define EP0_IN 0x80
|
||||
|
||||
/* enter critical macros */
|
||||
#define OSA_SR_ALLOC() int usbOsaCurrentSr
|
||||
#define OSA_ENTER_CRITICAL() usbOsaCurrentSr = irq_lock()
|
||||
#define OSA_EXIT_CRITICAL() irq_unlock(usbOsaCurrentSr)
|
||||
|
||||
/* NXP SDK USB controller driver configuration macros */
|
||||
#if defined(CONFIG_USB_DEDICATED_MEMORY)
|
||||
#define USB_BDT __attribute__((section("m_usb_bdt, \"aw\", %nobits @")))
|
||||
#define USB_GLOBAL __attribute__((section("m_usb_global, \"aw\", %nobits @")))
|
||||
#else
|
||||
#define USB_BDT
|
||||
#define USB_GLOBAL
|
||||
#endif
|
||||
|
||||
#define USB_RAM_ADDRESS_ALIGNMENT(n) __aligned(n)
|
||||
|
||||
/* EHCI */
|
||||
#if defined(CONFIG_NOCACHE_MEMORY)
|
||||
#define USB_CONTROLLER_DATA __nocache
|
||||
#elif defined(CONFIG_USB_DEDICATED_MEMORY)
|
||||
#define USB_CONTROLLER_DATA __attribute__((section("m_usb_global, \"aw\", %nobits @")))
|
||||
#else
|
||||
#define USB_CONTROLLER_DATA
|
||||
#endif
|
||||
|
||||
struct usb_ep_ctrl_data {
|
||||
usb_device_callback_message_struct_t transfer_message;
|
||||
struct k_mem_block block;
|
||||
usb_dc_ep_callback callback;
|
||||
uint16_t ep_mps;
|
||||
uint8_t ep_type;
|
||||
uint8_t ep_enabled : 1;
|
||||
uint8_t ep_occupied : 1;
|
||||
};
|
||||
|
||||
#define USBD_MCUX_THREAD_STACK_SIZE 1024
|
||||
|
||||
struct usb_device_struct {
|
||||
#if ((defined(USB_DEVICE_CONFIG_REMOTE_WAKEUP)) && \
|
||||
(USB_DEVICE_CONFIG_REMOTE_WAKEUP > 0U)) || \
|
||||
(defined(FSL_FEATURE_SOC_USB_ANALOG_COUNT) && \
|
||||
(FSL_FEATURE_SOC_USB_ANALOG_COUNT > 0U))
|
||||
/* Current hw tick(ms)*/
|
||||
volatile uint64_t hwTick;
|
||||
#endif
|
||||
/* Controller handle */
|
||||
usb_device_controller_handle controllerHandle;
|
||||
/* Controller interface handle */
|
||||
const usb_device_controller_interface_struct_t *interface;
|
||||
usb_dc_status_callback status_callback;
|
||||
struct usb_ep_ctrl_data *eps;
|
||||
bool attached;
|
||||
/* Current device address */
|
||||
uint8_t address;
|
||||
/* Controller ID */
|
||||
uint8_t controllerId;
|
||||
/* Current device state */
|
||||
uint8_t state;
|
||||
#if ((defined(USB_DEVICE_CONFIG_REMOTE_WAKEUP)) && (USB_DEVICE_CONFIG_REMOTE_WAKEUP > 0U))
|
||||
/* Remote wakeup is enabled or not */
|
||||
uint8_t remotewakeup;
|
||||
#endif
|
||||
/* Is doing device reset or not */
|
||||
uint8_t isResetting;
|
||||
uint8_t setupDataStage;
|
||||
K_KERNEL_STACK_MEMBER(thread_stack, USBD_MCUX_THREAD_STACK_SIZE);
|
||||
struct k_thread thread;
|
||||
};
|
||||
|
||||
#endif /* __USB_DC_MCUX_H__ */
|
47
modules/hal_nxp/usb/usb_device_config.h
Normal file
47
modules/hal_nxp/usb/usb_device_config.h
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright 2018 - 2022 NXP
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef __USB_DEVICE_CONFIG_H__
|
||||
#define __USB_DEVICE_CONFIG_H__
|
||||
|
||||
#include <zephyr/devicetree.h>
|
||||
#include "usb.h"
|
||||
|
||||
/******************************************************************************
|
||||
* Definitions
|
||||
*****************************************************************************/
|
||||
/* EHCI instance count */
|
||||
#ifdef CONFIG_USB_DC_NXP_EHCI
|
||||
#define USB_DEVICE_CONFIG_EHCI (1U)
|
||||
/* How many the DTD are supported. */
|
||||
#define USB_DEVICE_CONFIG_EHCI_MAX_DTD (16U)
|
||||
#endif /* CONFIG_USB_DC_NXP_EHCI */
|
||||
|
||||
#ifdef CONFIG_USB_DC_NXP_LPCIP3511
|
||||
|
||||
#ifdef USBHSD_BASE_ADDRS
|
||||
#define USB_DEVICE_CONFIG_LPCIP3511HS (1U)
|
||||
#else
|
||||
#define USB_DEVICE_CONFIG_LPCIP3511HS (0U)
|
||||
#endif
|
||||
|
||||
#ifdef USB_BASE_ADDRS
|
||||
#define USB_DEVICE_CONFIG_LPCIP3511FS (1U)
|
||||
#else
|
||||
#define USB_DEVICE_CONFIG_LPCIP3511FS (0U)
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_USB_DC_NXP_LPCIP3511 */
|
||||
|
||||
/* Whether device is self power. 1U supported, 0U not supported */
|
||||
#define USB_DEVICE_CONFIG_SELF_POWER (1U)
|
||||
|
||||
#define DT_DRV_COMPAT nxp_mcux_usbd
|
||||
|
||||
/* Number of endpoints supported */
|
||||
#define USB_DEVICE_CONFIG_ENDPOINTS (DT_INST_PROP(0, num_bidir_endpoints))
|
||||
|
||||
#endif /* __USB_DEVICE_CONFIG_H__ */
|
|
@ -18,7 +18,7 @@
|
|||
#include <fsl_iomuxc.h>
|
||||
#if CONFIG_USB_DC_NXP_EHCI
|
||||
#include "usb_phy.h"
|
||||
#include "usb_dc_mcux.h"
|
||||
#include "usb.h"
|
||||
#endif
|
||||
|
||||
#define CCM_NODE DT_INST(0, nxp_imx_ccm)
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <zephyr/dt-bindings/clock/imx_ccm_rev2.h>
|
||||
#if CONFIG_USB_DC_NXP_EHCI
|
||||
#include "usb_phy.h"
|
||||
#include "usb_dc_mcux.h"
|
||||
#include "usb.h"
|
||||
#endif
|
||||
|
||||
#if CONFIG_USB_DC_NXP_EHCI /* USB PHY configuration */
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#if CONFIG_USB_DC_NXP_LPCIP3511
|
||||
#include "usb_phy.h"
|
||||
#include "usb_dc_mcux.h"
|
||||
#include "usb.h"
|
||||
#endif
|
||||
|
||||
/* Board System oscillator settling time in us */
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#if CONFIG_USB_DC_NXP_LPCIP3511
|
||||
#include "usb_phy.h"
|
||||
#include "usb_dc_mcux.h"
|
||||
#include "usb.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#endif
|
||||
#if CONFIG_USB_DC_NXP_LPCIP3511
|
||||
#include "usb_phy.h"
|
||||
#include "usb_dc_mcux.h"
|
||||
#include "usb.h"
|
||||
#endif
|
||||
|
||||
#define CTIMER_CLOCK_SOURCE(node_id) \
|
||||
|
|
Loading…
Reference in a new issue