-
Notifications
You must be signed in to change notification settings - Fork 8.1k
drivers: usb: uhc: initial support for UHC driver on Renesas RA family #82730
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?
drivers: usb: uhc: initial support for UHC driver on Renesas RA family #82730
Conversation
|
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. |
9356bc5 to
68f0507
Compare
68f0507 to
00f6cce
Compare
00f6cce to
3ce519d
Compare
|
Last push just to rebase main |
Hello @jfischer-no . Could you please revisit and verify this change? |
drivers/usb/uhc/uhc_renesas_ra.c
Outdated
| return -EINVAL; | ||
| } | ||
|
|
||
| usb_desc_endpoint_t ep0_desc = {.bLength = sizeof(usb_desc_endpoint_t), |
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.
Variable definition should be at the top of a block. Please fix style.
Why is the name ep0_desc?
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.
Done. The name was changed to ep_desc
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.
There is now unnecessary type conversion, please change it to
const struct uhc_renesas_ra_config *config = dev->config;
usb_desc_endpoint_t ep_desc = {
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = ep,
.bmAttributes = {attrib},
.wMaxPacketSize = mps,
.bInterval = 0,
};
fsp_err_t err;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 fixed it
| bus-wait-cycles: | ||
| type: int | ||
| description: Specifies CPU bus access wait cycles | ||
|
|
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.
Stray change? I do not think it is UHC relevant. Where is it used?
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.
It is a setting for this HWIP and being used in the HAL: https://github.com/zephyrproject-rtos/hal_renesas/blob/main/zephyr/ra/ra_cfg/fsp_cfg/r_usb_host_cfg.h#L33
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.
This commit adds a new property that is already exclusively used in the HAL driver configuration. Devicetree should be used to configure drivers in Zephyr. The HAL driver or HAL module must not depend on anything from Zephyr. You have to fix it, see https://github.com/zephyrproject-rtos/zephyr/tree/main/modules, also there is no obligation to use HAL drivers.
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.
Done. Normal use case does not need to change this setting. Removed this property from Zephyr DT link and configure it as fixed in HAL.
drivers/usb/uhc/uhc_renesas_ra.c
Outdated
| static const struct uhc_renesas_ra_config uhc_config_##n = { \ | ||
| .pcfg = PINCTRL_DT_DEV_CONFIG_GET(DT_INST_PARENT(n)), \ | ||
| .make_thread = uhc_renesas_ra_create_thread_##n, \ | ||
| .udev_count = DT_PROP_OR(DT_INST_PARENT(node_id), usb_devices_count, 10), \ |
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 is it a DT property and why does it need to be configured per instance? I see it only used in the shim driver. Why is 10 default value?
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.
This HWIP only support up to 10 devices connected to. So, the 0xb or higher address is invalid for this driver.
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 does it need to be configured per instance? Are there SoC variants where it has a different value?
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.
Updated. Currently all device instances are limited to 5 max. Fixed in source code.
9a10f10 to
dc43286
Compare
dc43286 to
6303874
Compare
|
Hello @jfischer-no . Could you please re-visit this PR and verify the change request? |
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.
Hello all.
Some few practical details which you might be interested in before pursuing.
6303874 to
36ea3e7
Compare
89d3182 to
cb81e85
Compare
|
The failed compliance job is not related to update from this PR, under fixing by #98173 |
|
Thank you for the changes. The CI should not raise this line as not changed by this patch but a small commit "fix coding style" at the beginning should fix it:
In addition:
|
First commit to support UHC driver for Renesas RA family Signed-off-by: Minh Hoang <[email protected]> Signed-off-by: The Nguyen <[email protected]>
Add device node to support UHC on Renesas RA SoCs Signed-off-by: Minh Hoang <[email protected]> Signed-off-by: The Nguyen <[email protected]>
Enable USB host support on Renesas RA boards Signed-off-by: Minh Hoang <[email protected]> Signed-off-by: The Nguyen <[email protected]>
Support USBH shell sample for renesas,ra-uhc Signed-off-by: The Nguyen <[email protected]>
cb81e85 to
8ed3356
Compare
Rebase to get the workflow fix commit |
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.
LGTM. Thanks.
|



This PR to initial support for UHC driver on Renesas RA boards.