| #
6ef8929c |
| 30-Dec-2021 |
Alper Nebi Yasak <alpernebiyasak@gmail.com> |
UPSTREAM: phy: Track power-on and init counts in uclass
On boards using the RK3399 SoC, the USB OHCI and EHCI controllers share the same PHY device instance. While these controllers are being stoppe
UPSTREAM: phy: Track power-on and init counts in uclass
On boards using the RK3399 SoC, the USB OHCI and EHCI controllers share the same PHY device instance. While these controllers are being stopped they both attempt to power-off and deinitialize it, but trying to power-off the deinitialized PHY device results in a hang. This usually happens just before booting an OS, and can be explicitly triggered by running "usb start; usb stop" in the U-Boot shell.
Implement a uclass-wide counting mechanism for PHY initialization and power state change requests, so that we don't power-off/deinitialize a PHY instance until all of its users want it done. The Allwinner A10 USB PHY driver does this counting in-driver, remove those parts in favour of this in-uclass implementation.
The sandbox PHY operations test needs some changes since the uclass will no longer call into the drivers for actions matching its tracked state (e.g. powering-off a powered-off PHY). Update that test, and add a new one which simulates multiple users of a single PHY.
The major complication here is that PHY handles aren't deduplicated per instance, so the obvious idea of putting the counts in the PHY handles don't immediately work. It seems possible to bind a child udevice per PHY instance to the PHY provider and deduplicate the handles in each child's uclass-private areas, like in the CLK framework. An alternative approach could be to use those bound child udevices themselves as the PHY handles. Instead, to avoid the architectural changes those would require, this patch solves things by dynamically allocating a list of structs (one per instance) in the provider's uclass-private area.
Change-Id: If25109d441b4d93638b450f9137eccd159935aa8 Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Peter Robinson <pbrobinson@gmail.com> - Rock960 Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 226fce6108fe364e35f3eb9a84ff1a7ec93727ce)
show more ...
|
| #
e9c6c0e2 |
| 11-Nov-2021 |
Wyon Bi <bivvy.bi@rock-chips.com> |
phy: Add set_mode callback
The initial use for this is for PHYs that have a mode related to USB OTG. There are several SoCs (e.g. TI OMAP and DA8xx) that have a mode setting in the USB PHY to overri
phy: Add set_mode callback
The initial use for this is for PHYs that have a mode related to USB OTG. There are several SoCs (e.g. TI OMAP and DA8xx) that have a mode setting in the USB PHY to override OTG VBUS and ID signals.
Of course, the enum can be expaned in the future to include modes for other types of PHYs as well.
Change-Id: Ic8b5f33f928341a88132cb203b65f156f75d18b6 Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
show more ...
|
| #
4ef09685 |
| 10-Dec-2020 |
Wyon Bi <bivvy.bi@rock-chips.com> |
phy: Add configuration interface
The phy framework is only allowing to configure the power state of thePHY using the init and power_on hooks, and their power_off and exit counterparts.
While it wor
phy: Add configuration interface
The phy framework is only allowing to configure the power state of thePHY using the init and power_on hooks, and their power_off and exit counterparts.
While it works for most, simple, PHYs supported so far, some more advanced PHYs need some configuration depending on runtime parameters. These PHYs have been supported by a number of means already, often by using ad-hoc drivers in their consumer drivers.
That doesn't work too well however, when a consumer device needs to deal with multiple PHYs, or when multiple consumers need to deal with the same PHY (a DSI driver and a CSI driver for example).
So we'll add a new interface, through two funtions, phy_validate and phy_configure. The first one will allow to check that a current configuration, for a given mode, is applicable. It will also allow the PHY driver to tune the settings given as parameters as it sees fit.
phy_configure will actually apply that configuration in the phy itself.
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com> Change-Id: Icd170eaef9a1dbe21e0c7664b797a27877c703b5
show more ...
|
| #
37a5e4d8 |
| 20-May-2020 |
Vignesh Raghavendra <vigneshr@ti.com> |
UPSTREAM: phy: Fix possible NULL pointer deference
It is possible that users of generic_phy_*() APIs may pass a valid struct phy pointer but phy->dev can be NULL, leading to NULL pointer deference i
UPSTREAM: phy: Fix possible NULL pointer deference
It is possible that users of generic_phy_*() APIs may pass a valid struct phy pointer but phy->dev can be NULL, leading to NULL pointer deference in phy_dev_ops().
So call generic_phy_valid() to verify that phy and phy->dev are both valid.
Change-Id: I0d19180ae8524eb240f4afd6ea55d5d0f2907798 Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com> (cherry picked from commit 64b69f8c89352975c25730bcca4bf8af2296297f)
show more ...
|
| #
1bac1f39 |
| 01-Oct-2019 |
Jean-Jacques Hiblot <jjhiblot@ti.com> |
UPSTREAM: drivers: phy: Handle gracefully NULL pointers
For some controllers PHYs can be optional. Handling NULL pointers without crashing nor failing, makes it easy to handle optional PHYs.
Change
UPSTREAM: drivers: phy: Handle gracefully NULL pointers
For some controllers PHYs can be optional. Handling NULL pointers without crashing nor failing, makes it easy to handle optional PHYs.
Change-Id: I11c95af8c1b54f2dad41891f6d0edb8d9fac6606 Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com> (cherry picked from commit 4e1842988364446ba0cf2171d1eebb53c15bc44e)
show more ...
|
| #
211aaf30 |
| 29-Jul-2017 |
Tom Rini <trini@konsulko.com> |
Merge git://git.denx.de/u-boot-usb
|
| #
b9688df3 |
| 18-Jul-2017 |
Patrice Chotard <patrice.chotard@st.com> |
drivers: phy: Set phy->dev to NULL when generic_phy_get_by_index() fails
phy->dev need to be set to NULL in case of generic_phy_get_by_index() fails. Then phy->dev can be used to check if the phy is
drivers: phy: Set phy->dev to NULL when generic_phy_get_by_index() fails
phy->dev need to be set to NULL in case of generic_phy_get_by_index() fails. Then phy->dev can be used to check if the phy is valid
Reported-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
23558bb6 |
| 19-May-2017 |
Simon Glass <sjg@chromium.org> |
dm: phy: Update uclass to support livetree
Update the phy uclass to support livetree. Fix the xlate() method which has no callers.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
| #
dd9999d5 |
| 09-May-2017 |
Tom Rini <trini@konsulko.com> |
Merge git://git.denx.de/u-boot-dm
|
| #
72e5016f |
| 24-Apr-2017 |
Jean-Jacques Hiblot <jjhiblot@ti.com> |
drivers: phy: add generic PHY framework
The PHY framework provides a set of APIs to control a PHY. This API is derived from the linux version of the generic PHY framework. Currently the API supports
drivers: phy: add generic PHY framework
The PHY framework provides a set of APIs to control a PHY. This API is derived from the linux version of the generic PHY framework. Currently the API supports init(), deinit(), power_on, power_off() and reset(). The framework provides a way to get a reference to a phy from the device-tree.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|