Probe the mux device early in the SERDES configuration flow to ensure
proper lane routing before PHY initialization. This is required for SoCs
where SERDES lanes can be muxed between different controllers
(PCIe, USB, etc), and different mux configurations are required between
different boot phases.
Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
static int pcie_cdns_config_serdes(struct udevice *dev)
{
+ int ret;
+
+ if (CONFIG_IS_ENABLED(MUX_MMIO)) {
+ struct udevice *mux;
+
+ ret = uclass_get_device_by_seq(UCLASS_MUX, 0, &mux);
+ if (ret) {
+ dev_err(dev, "unable to get mux\n");
+ return ret;
+ }
+ }
+
if (CONFIG_IS_ENABLED(PHY_CADENCE_TORRENT)) {
struct phy serdes;
- int ret = 7;
ret = generic_phy_get_by_name(dev, "pcie-phy", &serdes);
if (ret != 0 && ret != -EBUSY) {