summaryrefslogtreecommitdiff
path: root/drivers/phy
AgeCommit message (Collapse)Author
2026-03-02phy: Add MediaTek UFS PHY DriverIgor Belwon
This UFS M-PHY driver can be used on recent MediaTek SoCs as the primary PHY for the UFS controller. Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org> Link: https://patch.msgid.link/20251011-mtk-ufs-uboot-v1-1-a05f991ee150@mentallysanemainliners.org Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-02-25Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-samsungTom Rini
- Assorted platform and video driver updates
2026-02-25phy: samsung: add support for exynos7870 USB PHYKaustabh Chakraborty
The USB PHY used by the Exynos7870 SoC has a single USB 2.0 interface. Add its dedicated variant enum, compatible, and init/exit functions. The PHY enable bit of Exynos7870's PHY is different in contrast to that of Exynos850 and most Exynos PHYs. To allow this change, a simple if condition is added in exynos_usbdrd_phy_isol() which changes the bitmask. Since the variant enum is required, the function argument is changed to accept the driver data itself. Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org> Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2026-02-25phy: samsung: add enum for variants based on SoCsKaustabh Chakraborty
The variant enum is used to uniquely identify which SoC the PHY block belongs to. It is initially set in the match table, along with the compatible string, it gets copied to driver data struct during probe. SoC specific functions must only be called if the respective variant enum is set. Add switch-case blocks wherever required. Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org> Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2026-02-04Merge patch series "arm: k3: j722s: add PCIe support"Tom Rini
George McCollister <george.mccollister@konsulko.com> says: This patch series brings over several changes from Linux that are required to get PCIe working on the j722s and also enables PCIe in j722s_evm_a53_defconfig. This allows Linux to be booted from an NVMe drive. The J722S SoC provides pcie0 (using pcie_cdns_ti) thru serdes1 (using phy-cadence-torrent) thru serdes_wiz1 (using phy-j721e-wiz). Changes to the three drivers needed to be ported from Linux to enable the REFCLK output which is used with this SoC. These changes should be tested on other platforms using these drivers by those with the hardware available to make sure no problems were introduced. The PCIe controller in this SoC relies on the code performing the PCI scan not scanning devices which cannot exist. In Linux this is implemented as only_one_child() in probe.c. If this mechanism is not used, PCI config reads for subsequent functions will return information for device 0 resulting in U-Boot detecting 32 devices when only 1 is present. This change should be tested on other platforms with PCI to ensure the same PCI devices are enumerated before and after the patch is applied. I would like to thank Opto 22 for sponsoring the initial development and anyone that is able to contribute to testing of patches. Link: https://lore.kernel.org/r/20260130153856.2049575-1-george.mccollister@konsulko.com
2026-02-04phy: cadence-torrent: Add support to drive refclk outGeorge McCollister
cmn_refclk_<p/m> lines in Torrent SERDES are used for connecting an external reference clock. cmn_refclk_<p/m> can also be configured to output the reference clock. Model this derived reference clock as a "clock" so that platforms like AM642 EVM can enable it. This is used by PCIe to use the same refclk both in local SERDES and remote device. Add support here to drive refclk out. Based on: https://lore.kernel.org/all/20210310120840.16447-7-kishon@ti.com/ Signed-off-by: George McCollister <george.mccollister@konsulko.com> Tested-by: Bryan Brattlof <bb@ti.com>
2026-02-04phy: ti: j721e-wiz: Enable reference clock output in cmn_refclk_<p/m>George McCollister
cmn_refclk_<p/m> lines in Torrent SERDES are used for an connecting external reference clock. cmn_refclk_<p/m> can also be configured to output the reference clock. In order to drive the refclk out from the SERDES (Cadence Torrent), PHY_EN_REFCLK should be set in SERDES_RST of WIZ. Model PHY_EN_REFCLK as a clock, so that platforms like AM642 EVM can enable it. Based on: https://lore.kernel.org/r/20210310120840.16447-6-kishon@ti.com Signed-off-by: George McCollister <george.mccollister@konsulko.com> Tested-by: Bryan Brattlof <bb@ti.com>
2026-01-19Merge tag 'xilinx-for-v2026.04-rc1-v2' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-microblaze AMD/Xilinx/FPGA changes for v2026.04-rc1 v2 microblaze: - Fix spl_boot_list order versal2: - Fix EMMC distro boot setup - Align distro boot variables with memory layout zynqmp-phy: - Sync with Linux kernel driver zynqmp: - Add verify_auth command - DT sync - Add placing variables to FAT/EXT4 - Enable PCIe driver by default pcie - xilinx-nwl: - Fix Link down crash ufs: - Align clock/reset with DT binding # -----BEGIN PGP SIGNATURE----- # # iHUEABYIAB0WIQSXAixArPbWpRanWW+rB/7wTvUR9QUCaW3p3wAKCRCrB/7wTvUR # 9VkwAP4jPRALpM34VpTimNe/iwigIx8hAHxbvkUU0oJ/DW6W8AEAhCSL+ydgreuv # kKCyNiOF1sm8IrOh4TdtMIFn37d4Dwg= # =AkKK # -----END PGP SIGNATURE----- # gpg: Signature made Mon 19 Jan 2026 02:22:55 AM CST # gpg: using EDDSA key 97022C40ACF6D6A516A7596FAB07FEF04EF511F5 # gpg: Can't check signature: No public key
2026-01-14phy: Add MSM8996 support to Qualcomm QUSB2 phyBiswapriyo Nath
This change is imported from Linux driver and tested with SM6125 SoC. Note, the msm8996_phy_cfg struct is same as sdm660_phy_cfg but qusb2_phy_cfg::se_clk_scheme_default differs only. Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com> Reviewed-by: Casey Connolly <casey.connolly@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://patch.msgid.link/20251207184919.12202-1-nathbappai@gmail.com Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2026-01-14phy: qcom: snps-femto-v2: assert reset in probeCasey Connolly
The power on function for the phy only deasserts the reset, so the phy might be in a weird state that we don't clean up properly. Assert the reset in probe() so that when we power on we will have the phy in a clean state. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patch.msgid.link/20251114144722.173021-2-casey.connolly@linaro.org Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2026-01-12phy: zynqmp: Only wait for PLL lock "primary" instancesSean Anderson
For PCIe and DisplayPort, the phy instance represents the controller's logical lane. Wait for the instance 0 phy's PLL to lock as other instances will never lock. We do this in xpsgtr_wait_pll_lock so callers don't have to determine the correct lane themselves. The original comment is wrong about cumulative wait times. Since we are just polling a bit, all subsequent waiters will finish immediately. Signed-off-by: Sean Anderson <sean.anderson@linux.dev> Link: https://lore.kernel.org/r/20240628205540.3098010-4-sean.anderson@linux.dev Signed-off-by: Vinod Koul <vkoul@kernel.org> [ Linux commit 235d8b663ab9e6cc13f8374abfffa559f50b57b6 ] Link: https://lore.kernel.org/r/20260106215501.727524-5-sean.anderson@linux.dev Signed-off-by: Michal Simek <michal.simek@amd.com>
2026-01-12phy: zynqmp: Store instance instead of typeSean Anderson
The phy "type" is just the combination of protocol and instance, and is never used apart from that. Store the instance directly, instead of converting to a type first. No functional change intended. Signed-off-by: Sean Anderson <sean.anderson@linux.dev> Link: https://lore.kernel.org/r/20240628205540.3098010-3-sean.anderson@linux.dev Signed-off-by: Vinod Koul <vkoul@kernel.org> [ Linux commit 6959d2367bc3503ac4ba3eb4ec6584a43150d6b3 ] Link: https://lore.kernel.org/r/20260106215501.727524-4-sean.anderson@linux.dev Signed-off-by: Michal Simek <michal.simek@amd.com>
2026-01-12phy: zynqmp: Enable reference clock correctlySean Anderson
Lanes can use other lanes' reference clocks, as determined by refclk. Use refclk to determine the clock to enable/disable instead of always using the lane's own reference clock. This ensures the clock selected in xpsgtr_configure_pll is the one enabled. For the other half of the equation, always program REF_CLK_SEL even when we are selecting the lane's own clock. This ensures that Linux's idea of the reference clock matches the hardware. We use the "local" clock mux for this instead of going through the ref clock network. Signed-off-by: Sean Anderson <sean.anderson@linux.dev> Link: https://lore.kernel.org/r/20240628205540.3098010-2-sean.anderson@linux.dev Signed-off-by: Vinod Koul <vkoul@kernel.org> [ Linux commit 687d6bccb28238fcfa65f7c1badfdfeac498c428 ] Fixes: 1d78d683496 ("phy: zynqmp: Add serdes/psgtr driver") Link: https://lore.kernel.org/r/20260106215501.727524-3-sean.anderson@linux.dev Signed-off-by: Michal Simek <michal.simek@amd.com>
2026-01-12phy: zynqmp: Allow variation in refclk rateSean Anderson
Due to limited available frequency ratios, the reference clock rate may not be exactly the same as the required rate. Allow a small (100 ppm) deviation. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Link: https://lore.kernel.org/r/20230711194542.898230-1-sean.anderson@seco.com Signed-off-by: Vinod Koul <vkoul@kernel.org> [ Linux commit 76009ee76e05e30e29aade02e788aebe9ce9ffd2 ] Link: https://lore.kernel.org/r/20260106215501.727524-2-sean.anderson@linux.dev Signed-off-by: Michal Simek <michal.simek@amd.com>
2026-01-09dm: core: Default to using DEVRES outside of xPLTom Rini
The devm alloc functions that we have may follow the Linux kernel model where allocations are (almost always) automatically free()'d. However, quite often we don't enable, in full U-Boot, the tracking and free()'ing functionality. This in turn leads to memory leaks because the driver author expects that since the functions have the same name as in the Linux Kernel they have the same behavior. In turn we then get functionally correct commits such as commit 00e1fed93c8c ("firmware: ti_sci: Fix memory leaks in devm_ti_sci_get_of_resource") that manually add these calls. Rather than manually tracking allocations and implementing free()s, rework things so that we follow expectations by enabling the DEVRES functionality (outside of xPL phases). This turns DEVRES from a prompted symbol to a symbol that must be select'd, and we now remove our non-managed alloc/free functions from outside of xPL builds. Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2025-11-06phy: renesas: Add Multi-Protocol PHY driver for R-Car X5HThanh Quan
Add PHY driver for Multi-Protocol PHY present on Renesas R-Car X5H R8A78000 SoC. Currently, the PHY driver only supports configuring the MPPHY for ethernet operation. Signed-off-by: Thanh Quan <thanh.quan.xn@renesas.com> Signed-off-by: Phong Hoang <phong.hoang.wz@renesas.com> Signed-off-by: Hai Pham <hai.pham.ud@renesas.com> #Fix License-Identifier Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> [Marek: Clean up macros, indent, clock and reset handling in probe, rename the driver and add r8a78000- into compatible string, update commit message.]
2025-11-06phy: renesas: Add PCS driver for Renesas R-Car X5H R8A78000Tam Nguyen
Add support for the Ethernet Physical Coding Sublayer (PCS) controller on R-Car Gen5 SoCs, specifically the Renesas R-Car X5H R8A78000. The controller is based on the SERDES infrastructure used in previous R-Car generations, with updates for Gen5 register layout and features. Because majority of this driver is SoC-specific register programming, the majority of this driver is different enough from R8A779F0 SerDes driver to justify its own driver. Deduplication of the remaining bits of code does not yield any improvement. Signed-off-by: Hai Pham <hai.pham.ud@renesas.com> Signed-off-by: Phong Hoang <phong.hoang.wz@renesas.com> Signed-off-by: Tam Nguyen <tam.nguyen.xa@renesas.com> Signed-off-by: Thanh Quan <thanh.quan.xn@renesas.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> [Marek: Add missing clk_bulk_disable() in fail path. Drop always-true aneg_on setting. Reduce poll delay from 100s to 100ms. Use bulk reset operations to finalize reset handling.]
2025-11-04phy: imx8mq-usb: Add SPL support for i.MX8MQ, i.MX8MP, i.MX95, and i.MX94 ↵Alice Guo
USB3.0 PHY This patch adds SPL Kconfig option (SPL_PHY_IMX8MQ_USB) for the i.MX8MQ, i.MX8MP, i.MX95, and i.MX94 USB3.0 PHY driver, allowing the driver to be compiled and probed in SPL stage. Signed-off-by: Alice Guo <alice.guo@nxp.com>
2025-10-29phy: qcom-qmp-ufs: Import SM7150 tables from LinuxDanila Tikhonov
Import the init sequence for the UFS on SM7150. Signed-off-by: Danila Tikhonov <danila@jiaxyga.com> Signed-off-by: Jens Reidel <adrian@mainlining.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20250831004602.699953-4-adrian@mainlining.org Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
2025-10-29phy: qcom: Add SM6350 to QMP UFS PHY driverLuca Weiss
The UFS on SM6350 can reuse the SDM845 configuration, just like in Linux. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
2025-10-29phy: qcom: Rework Kconfig logic around MSM8916_USB_PHYTom Rini
This PHY driver is required by USB_EHCI_MSM and not useful on its own. Rather than have it be a prompted option, it should (and currently is) select'd by USB_EHCI_MSM. Remove the prompt for this option and then correct the dependency chain (it must select PHY). Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Casey Connolly <casey.connolly@linaro.org> Link: https://lore.kernel.org/r/20251003203927.1030052-1-trini@konsulko.com Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
2025-10-24phy: ti: phy-j721e-wiz: Allow reinitialization when SERDES is pre-configuredHrushikesh Salunke
Move the SERDES configuration check after clock and reset initialization and change it from a hard failure to a skip of WIZ initialization. This allows the driver to probe successfully when the SERDES has been pre-configured by a previous boot stage (e.g., ROM or SPL). This approach aligns with how the Linux kernel handles pre-configured SERDES, where the driver gracefully skips reinitialization rather than failing to probe. Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
2025-10-13phy: marvell: Tighten MVEBU_COMPHY_SUPPORT dependenciesTom Rini
This driver cannot link without access to functions that are defined in files that are only build on some platforms. Express those requirements in Kconfig as well. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Stefan Roese <stefan.roese@mailbox.org>
2025-09-16phy: Reset init count on phy exit failureMarek Vasut
In case the PHY exit callback reports failure, reset init_count to 0 anyway, so the next attempt at PHY initialization might try to reinitialize the PHY and restore it to normal operation. Signed-off-by: Marek Vasut <marek.vasut@mailbox.org> Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
2025-09-08Merge tag 'v2025.10-rc4' into nextTom Rini
Prepare v2025.10-rc4
2025-08-31phy: rockchip: typec: Fix improper use of UCLASS_PHYJonas Karlman
The Rockchip TypeC glue driver improperly present itself as a UCLASS_PHY driver, without ever implementing the required phy_ops. This is something that in special circumstances can lead to a NULL pointer dereference followed by a SError crash. Change the glue driver to use UCLASS_NOP to fix this. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-08-31phy: rockchip: inno-usb2: Fix improper use of UCLASS_PHYJonas Karlman
The Rockchip USB2PHY glue driver improperly present itself as a UCLASS_PHY driver, without ever implementing the required phy_ops. This is something that in special circumstances can lead to a NULL pointer dereference followed by a SError crash. Change the glue driver to use UCLASS_NOP to fix this. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-08-31phy: rockchip: naneng-combphy: Use syscon_regmap_lookup_by_phandleJonas Karlman
Change to use syscon_regmap_lookup_by_phandle() helper instead of finding the syscon udevice and making a call to syscon_get_regmap(). No runtime change is expected with this simplication. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-08-31phy: rockchip: naneng-combphy: Simplify init opsJonas Karlman
The init ops for Rockchip COMBPHY driver is more complex than it needs to be, e.g. declaring multiple init functions that only differ in the error message. Simplify the init ops based on code from the Linux mainline driver. This change also ensure that errors returned from combphy_cfg() and reset_deassert_bulk() is propertly propagated to the caller. No other runtime change is expected with this simplication. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-08-31phy: rockchip: naneng-combphy: Fix Generic PHY reference countingJonas Karlman
Generic PHY reference counting helps ensure driver ops for init/exit and power on/off are called at correct state. For this to work the PHY driver must initialize PHY-id to a persistent value in of_xlate ops. The Rockchip COMBPHY driver does not initialize the PHY-id field, this typically lead to use of unshared reference counting among different struct phy instances. Initialize the PHY-id in of_xlate ops to ensure use of shared reference counting among all struct phy instances. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-08-31phy: rockchip: usbdp: Simplify init opsJonas Karlman
With working shared reference counting for Generic PHY ops there is no need for the Rockchip USBDP PHY driver to keep its own status (reference counting) handling. Simplify the init ops now that shared reference counting is working. This also removes the unused mode_change handling as part of the simplication. No runtime change is expected with this simplication. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-08-31phy: rockchip: usbdp: Fix Generic PHY reference countingJonas Karlman
Generic PHY reference counting helps ensure driver ops for init/exit and power on/off are called at correct state. For this to work the PHY driver must initialize PHY-id to a persistent value in of_xlate ops. The Rockchip USBDP PHY driver does not initialize the PHY-id field, this typically lead to use of unshared reference counting among different struct phy instances. Initialize the PHY-id in of_xlate ops to ensure use of shared reference counting among all struct phy instances. E.g. on a ROCK 5B following could be observed: => usb start starting USB... [...] Bus usb@fc400000: 2 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found => usb reset resetting USB... [...] rockchip_udphy phy@fed90000: cmn ana lcpll lock timeout rockchip_udphy phy@fed90000: failed to init usbdp combophy rockchip_udphy phy@fed90000: PHY: Failed to init phy@fed90000: -110. Can't init PHY1 Bus usb@fc400000: probe failed, error -110 scanning usb for storage devices... 0 Storage Device(s) found With shared reference counting this is fixed: => usb reset resetting USB... [...] Bus usb@fc400000: 2 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-08-30phy: rockchip: naneng-combphy: Add support for RK3528Jianwei Zheng
Add support for the PCIe/USB3 combo PHY used in the RK3528 SoC. Config values are taken from vendor U-Boot linux-6.1-stan-rkr5 tag. Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com> Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-08-30phy: rockchip: naneng-combphy: Add support for RK3576Jon Lin
Add support for the PCIe/USB3/SATA combo PHYs used in the RK3576 SoC. Config values are taken from vendor U-Boot linux-6.1-stan-rkr5 tag. Signed-off-by: Jon Lin <jon.lin@rock-chips.com> Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-08-30phy: rockchip: usbdp: Add support for RK3576Frank Wang
Add support for the USB3.0+DP PHY used in the RK3576 SoC. Config values are taken from vendor U-Boot linux-6.1-stan-rkr5 tag. Signed-off-by: Frank Wang <frank.wang@rock-chips.com> Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-08-30phy: rockchip-inno-usb2: Add support for RK3576Frank Wang
Add support for the USB2.0 PHYs used in the RK3576 SoC. Config values are taken from vendor U-Boot linux-6.1-stan-rkr5 tag. Signed-off-by: Frank Wang <frank.wang@rock-chips.com> Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-08-30rockchip: rockchip-inno-usb2: Fix Synchronous Abort on usb startAlex Shumsky
Fix NULL pointer dereference that happen when rockchip-inno-usb2 clock enabled before device probe. This early clock enable call happen in process of parent clock activation added in ac30d90f3367. Fixes: 229218373c22 ("phy: rockchip-inno-usb2: Add support for clkout_ctl_phy"). Fixes: ac30d90f3367 ("clk: Ensure the parent clocks are enabled while reparenting") Co-authored-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Alex Shumsky <alexthreed@gmail.com> Reviewed-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-08-25Merge tag 'v2025.10-rc3' into nextTom Rini
Prepare v2025.10-rc3
2025-08-23phy: phy-imx8mq-usb: Add support for i.MX95 USB3 PHYTim Harvey
Add initial support for i.MX95 USB.30 PHY, which is similar to the i.MX8MQ and i.MX8MP USB PHY. The i.MX95 USB3 PHY has a Type-C Assist block (TCA) consisting of two functional blocks (XBar assist and VBus assist) and is documented in the i.MX95 RM Chapter 163.3.8 Type-C assist (TCA) block. Instead of relying on an external MUX for Type-C plug orientation the XBar can handle the flip internally. Add initial support for i.MX95 by: - allowing the driver to be enabled i.MX95 - resetting the XBar - configuring the TCA in System Configuration mode (which was determined to be necessary to enable the PHY in device-mode) Follow-on support will need to be added to steer the XBar based on either board design (if only one pair is brought out) or if used with a Type-C controller. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Tested-by: Alice Guo <alice.guo@nxp.com>
2025-08-18phy: cadence: torrent: Set an error code for returnAndrew Goodbody
In cdns_torrent_phy_probe the test for too many lanes configured does not set an error code before taking the error path. This could lead to a silent failure if the calling code does not detect the error. Add the code to return -EINVAL in this case. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18phy: cadence: sierra: Remove variable that is not assigned toAndrew Goodbody
In cdns_sierra_pll_bind_of_clocks the variable 'i' is declared but never assigned to before its value is used in a dev_err. Replace clk_names[i] by the name passed to device_bind(), i.e., "pll_mux_clk". With that, the clk_names[] array is unused and can therefore be removed. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> [jf: update description] Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-08-18phy: marvell: Cannot test unsigned field to be negativeAndrew Goodbody
In comphy_cp110_init_serdes_map in comphy_cp110.c there are two fields in cfg, comphy_lanes_count and comphy_mux_bitcount, which are fetched from the FDT blob with fdtdec_get_int which returns an int. These two fields are then tested for being negative. However the fields are declared as unsigned so those tests must always fail. Change the declaration of those fields to be int instead of u32 and the code will work as expected. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Stefan Roese <stefan.roese@mailbox.org>
2025-08-18phy: marvell: Fix off by 1 limit checksAndrew Goodbody
The limit checks in get_speed_string and get_type_string are off by 1 as they do not account for the maximum index into an array that can be used is 1 less than the number of elements in that array. Adjust the limit checks to allow for this. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Stefan Roese <stefan.roese@mailbox.org>
2025-08-15phy: ti: j721e-wiz: Set error code before gotoAndrew Goodbody
In j721e_wiz_probe the test for too many lanes jumps to the error exit path without assigning an error code which could lead to calling code silently ignoring the failure. Set the error code. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-15phy: keystone-usb: Do not negate return codeAndrew Goodbody
In keystone_usb_init the return code from psc_enable_module should be returned as is rather than being negated. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-13phy: qcom: Fix ret is uninitialisedAndrew Goodbody
In qcom_snps_eusb2_phy_probe after the call to devm_clk_get if an error is found then ret is printed but has not been assigned to by the code. Decode the error from the pointer and assign it to ret. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20250806-phy_qcom_snps-v1-1-5cda830026c7@linaro.org Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2025-07-25phy: samsung: Add Exynos USB DRD PHY driverSam Protsenko
Add DM driver for Exynos USB PHY controllers. For now it only supports Exynos850 SoC. Only UTMI+ (USB 2.0) PHY interface is implemented, as Exynos850 doesn't support USB 3.0. Only two clocks are used for this controller: - phy: bus clock, used for PHY registers access - ref: PHY reference clock (OSCCLK) Ported from Linux kernel: drivers/phy/samsung/phy-exynos5-usbdrd.c Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org> Reviewed-by: Minkyu Kang <mk7.kang@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2025-06-26phy: cadence: torrent: add support for three or more links using 2 protocolsHrushikesh Salunke
This is a port of the corresponding commit in the Linux kernel which adds the same support for the Cadence Torrent driver[0]. The commit message below is taken as-is from the Linux kernel commit being ported. The Torrent SERDES can support at most two different protocols (PHY types). This only mandates that the device-tree sub-nodes used to represent the configuration should describe links with at-most two different protocols. The existing implementation however imposes an artificial constraint that allows only two links (device-tree sub-nodes). As long as at-most two protocols are chosen, using more than two links to describe them in an alternating configuration is still a valid configuration of the Torrent SERDES. A 3-Link 2-Protocol configuration of the 4-Lane SERDES can be: Lane 0 => Protocol 1 => Link 1 Lane 1 => Protocol 1 => Link 1 Lane 2 => Protocol 2 => Link 2 Lane 3 => Protocol 1 => Link 3 A 4-Link 2-Protocol configuration of the 4-Lane SERDES can be: Lane 0 => Protocol 1 => Link 1 Lane 1 => Protocol 2 => Link 2 Lane 2 => Protocol 1 => Link 3 Lane 3 => Protocol 2 => Link 4 [0] https://github.com/torvalds/linux/commit/5b7b83a9839be643410c31d56f17c2d430245813 Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
2025-06-24phy: qcom: Enable QMP UFS PHY driver for QCS615Aswin Murugan
Enable QMP phy for QCS615, referenced from Linux. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com> Link: https://lore.kernel.org/r/20250521035324.1182833-3-aswin.murugan@oss.qualcomm.com Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2025-06-24phy: qcom: Enable QMP UFS PHY driver for QCS8300Balaji Selvanathan
Enable QMP phy for QCS8300, referenced from Linux. Reviewed-by: Casey Connolly <casey.connolly@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com> Link: https://lore.kernel.org/r/20250529154931.1879976-5-quic_bselvana@quicinc.com Signed-off-by: Casey Connolly <casey.connolly@linaro.org>