-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
dts: Add initial support of USB PHYs #10359
Conversation
@jli157 FYI |
Codecov Report
@@ Coverage Diff @@
## master #10359 +/- ##
=======================================
Coverage 48.37% 48.37%
=======================================
Files 265 265
Lines 42188 42188
Branches 10137 10137
=======================================
Hits 20408 20408
Misses 17703 17703
Partials 4077 4077 Continue to review full report at Codecov.
|
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.
When phys has multiple handles (like on stm32f723.dtsi) what does that mean?
The available PHYs for the USB controller. In case of stm32f723 the available PHYs are: |
@ydamigos , looks nice, but it is not clear to me what issue this addition is going to solve, and no application is provided to demonstrate. |
Thanks @ydamigos for working on that. I have to say I don't necessary understand all the logic parsing the device tree to produce an header file so I still find a bit difficult to understand how the new DT entries are going to be used in practice. Anyway I already have a few comments/questions:
|
@aurel32 Thanks for the review
You are right. I updated it.
Yes, I should use a different one. It is a different embedded phy in a different controller.
Yes, on board level.
I have seen the warnings and I'll fix them. I thought #phy-cells was used in linux only but it is needed by DT compiler. |
c2bd153
to
0f36059
Compare
0c51f42
to
2df02d0
Compare
I had a better look at linux phy bindings and a controller has multiple phys if it can use simultaneously. |
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.
Great work.
Only adaptation would be to use CONFIG_DT_COMPAT_XX flags instead of CONFIG_XXX_BASE_ADDRESS
drivers/usb/device/usb_dc_stm32.c
Outdated
@@ -258,14 +258,14 @@ static int usb_dc_stm32_clock_enable(void) | |||
#ifdef CONFIG_USB_HS_BASE_ADDRESS | |||
|
|||
|
|||
#ifdef USB_HS_PHYC | |||
#ifdef CONFIG_USBPHYC_BASE_ADDRESS |
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.
We're now generating CONFIG_DT_COMPAT_XXXX flags (more details here: #9406).
These should be used for driver specific implementations/variations. Since you've set the ground with phys nodes it would fit perfectly here.
Please use this instead of 'CONFIG_USBPHYC_BASE_ADDRESS'.
Apply everywhere.
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 changed it to DT_COMPAT_ST_STM32_USBPHYC.
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.
Curious, why the use of "zephyr,usb-nop-xceiv" as a compatible (specifically the 'zephyr' bit?)
@galak I borrowed the idea from linux, where usb-nop-xceiv is used by all the usb transceivers which are built-in with USB IP. I added the 'zephyr' part to highlight that it is a zephyr "implementation". |
what compat does linux use? |
|
Any reason not to use the same, is there some zephyr specific semantic we have? |
Add yaml file for initial support of USB PHYs. It adds also yaml files for STM32 USBPHYC and USB controllers with embedded PHY. PHY refers to the physical layer which is used to connect a device to the physical medium e.g. USB controller. Origin: original Signed-off-by: Yannis Damigos <[email protected]>
Add phys property, which specifies USB PHY provider, to STM32 USB yaml files. Signed-off-by: Yannis Damigos <[email protected]>
Add USB phy nodes and phys property in USB nodes. Signed-off-by: Yannis Damigos <[email protected]>
Use DT to check if SoC has a USBPHYC controller. Signed-off-by: Yannis Damigos <[email protected]>
No, there is nothing zephyr specific. I changed it to |
Add initial support of USB PHYs.