-
Notifications
You must be signed in to change notification settings - Fork 8.2k
nxp: usb: zephyr support on imx93 frdm Cortex-A Core #97320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
nxp: usb: zephyr support on imx93 frdm Cortex-A Core #97320
Conversation
|
Hello @JonyZhang7, and thank you very much for your first pull request to the Zephyr project! |
| } | ||
|
|
||
| LOG_DBG("wLength %u, bLength %u, tailroom %u", | ||
| LOG_DBG("wLength %u, bLength %u, tailroom %zu", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this commit should go in its own PR. Can you also provide better PR title so it is immediately clear that this adds support for new target?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this commit should go in its own PR. Can you also provide better PR title so it is immediately clear that this adds support for new target?
Hi @tmon-nordic sorry for late, I modified PR title. tomorrow is feature freeze, there is no time left for me to submit a new PR for this patch. terribly sorry. Could you help review again, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JonyZhang7 Please move this commit to own PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JonyZhang7 Please move this commit to own PR.
Hi @jfischer-no add to PR: #98245
2849c1f to
0b7ef09
Compare
|
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
| struct udc_ep_config *ep_cfg_in; | ||
| struct udc_ep_config *ep_cfg_out; | ||
| uintptr_t base; | ||
| DEVICE_MMIO_NAMED_ROM(reg_base); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable support on i.MX93.
Nothing justifies your changes in the commit message. Please add meaningful commit message and fix commit title.
Also, it looks like this commit should be reworked in two smaller, one with MMIO changes and one about clock.
drivers/usb/udc/udc_mcux_ehci.c
Outdated
| const struct device *usb_clock_dev; | ||
| clock_control_subsys_t usb_clock_subsys; | ||
| clock_control_subsys_rate_t usb_clock_rate; | ||
| const struct device *usbphy_clock_dev; | ||
| clock_control_subsys_t usbphy_clock_subsys; | ||
| clock_control_subsys_rate_t usbphy_clock_rate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove usb_ and usb prefixes.
drivers/usb/udc/udc_mcux_ehci.c
Outdated
| #define UDC_MCUX_CLK0_DEFINE(n) \ | ||
| .usb_clock_dev = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR_BY_IDX(n, 0)), \ | ||
| .usb_clock_subsys = (clock_control_subsys_t) \ | ||
| DT_INST_CLOCKS_CELL_BY_IDX(n, 0, name), \ | ||
| .usb_clock_rate = (void *)(uintptr_t)DT_INST_PROP_BY_IDX(n, clock_rates, 0), | ||
|
|
||
| #define UDC_MCUX_CLK0_DEFINE_NULL \ | ||
| .usb_clock_dev = NULL, \ | ||
| .usb_clock_subsys = NULL, \ | ||
| .usb_clock_rate = NULL, | ||
|
|
||
| #define UDC_MCUX_CLK0_DEFINE_OR(n) \ | ||
| COND_CODE_1(DT_INST_CLOCKS_HAS_IDX(n, 0), \ | ||
| (COND_CODE_1(DT_INST_PROP_HAS_IDX(n, clock_rates, 0), \ | ||
| (UDC_MCUX_CLK0_DEFINE(n)), \ | ||
| (UDC_MCUX_CLK0_DEFINE_NULL))), \ | ||
| (UDC_MCUX_CLK0_DEFINE_NULL)) | ||
|
|
||
| #define UDC_MCUX_CLK1_DEFINE(n) \ | ||
| .usbphy_clock_dev = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR_BY_IDX(n, 1)), \ | ||
| .usbphy_clock_subsys = (clock_control_subsys_t) \ | ||
| DT_INST_CLOCKS_CELL_BY_IDX(n, 1, name), \ | ||
| .usbphy_clock_rate = (void *)(uintptr_t)DT_INST_PROP_BY_IDX(n, clock_rates, 1), | ||
|
|
||
| #define UDC_MCUX_CLK1_DEFINE_NULL \ | ||
| .usbphy_clock_dev = NULL, \ | ||
| .usbphy_clock_subsys = NULL, \ | ||
| .usbphy_clock_rate = NULL, | ||
|
|
||
| #define UDC_MCUX_CLK1_DEFINE_OR(n) \ | ||
| COND_CODE_1(DT_INST_CLOCKS_HAS_IDX(n, 1), \ | ||
| (COND_CODE_1(DT_INST_PROP_HAS_IDX(n, clock_rates, 1), \ | ||
| (UDC_MCUX_CLK1_DEFINE(n)), \ | ||
| (UDC_MCUX_CLK1_DEFINE_NULL))), \ | ||
| (UDC_MCUX_CLK1_DEFINE_NULL)) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to fix style in all these new macros first.
| zephyr,shell-uart = &lpuart2; | ||
| zephyr,sram = &dram; | ||
| zephyr,canbus = &flexcan2; | ||
| zephyr,usb-device = &usb1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line, we do not use chosen node zephyr,usb-device property.
| - can | ||
| - net | ||
| - watchdog | ||
| - usb_device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace it with - usbd.
|
|
||
| # USB Except | ||
| CONFIG_UDC_WORKQUEUE=n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
@JiafeiPan do we need close udc workqueue?
23596c0 to
958e77e
Compare
12c278c to
449dfc4
Compare
c1e4363 to
3998cbc
Compare
Add usb clock support. Signed-off-by: Jason He <jason.he_1@nxp.com> Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com> Signed-off-by: Jony Zhang <jony.zhang@nxp.com>
As middleware.cmake could be included by mcux-sdk's CMakeLists.txt, so use CMAKE_CURRENT_LIST_DIR to make sure the directory is correct. Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com> Signed-off-by: Jony Zhang <jony.zhang@nxp.com>
3998cbc to
f9bac94
Compare
|
Use zu% format for size_t type. Use d% format for int type. Use u% format for uint32_t type. Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com> Signed-off-by: Jony Zhang <jony.zhang@nxp.com>
1013 | void sys_trace_socket_accept_exit(int sock, const struct sockaddr *addr, const size_t *addrlen,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /__w/zephyr/zephyr/include/zephyr/tracing/tracing.h:22,
from /__w/zephyr/zephyr/include/zephyr/kernel.h:6679,
from /__w/zephyr/zephyr/subsys/tracing/ctf/ctf_top.c:7:
/__w/zephyr/zephyr/subsys/tracing/ctf/./tracing_ctf.h:707:6: note: previous declaration of 'sys_trace_socket_accept_exit' with type 'void(int, const struct sockaddr *, const uint32_t *, int)' {aka 'void(int, const struct sockaddr *, const unsigned int *, int)'}
707 | void sys_trace_socket_accept_exit(int sock, const struct sockaddr *addr, const uint32_t *addrlen,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
Signed-off-by: Jony Zhang <jony.zhang@nxp.com>
frdm_imx93 dosen't include the comlilation of usb.uvc.encoder, disable bellow samples to make sure twister build. - sample.subsys.usb.uvc.encoder.h264 - sample.subsys.usb.uvc.encoder.jpeg Signed-off-by: Jony Zhang <jony.zhang@nxp.com>
Enable i.MX93 support with dynamic clock and MMIO configuration. Signed-off-by: Jason He <jason.he_1@nxp.com> Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com> Signed-off-by: Jony Zhang <jony.zhang@nxp.com>
Enable USB support on i.MX93 FRDM. Signed-off-by: Jason He <jason.he_1@nxp.com> Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com> Signed-off-by: Jony Zhang <jony.zhang@nxp.com>



nxp: add usb support on frdm-imx93
Depends on zephyrproject-rtos/hal_nxp#615 (has been merged)