From b361443154fe13ebc2cf1586a26bdef04ac30ad0 Mon Sep 17 00:00:00 2001 From: Aswath Govindraju Date: Fri, 28 Jan 2022 13:41:38 +0530 Subject: [PATCH] board: ti: j721e: evm.c: Add support for probing SerDes0 Add support for probing, initializing and powering, SerDes0 instance. Signed-off-by: Aswath Govindraju --- board/ti/j721e/evm.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index 077d83420c..ad85b9d501 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -413,6 +413,40 @@ void configure_serdes_torrent(void) printf("phy_power_on failed !!\n"); } +void configure_serdes_sierra(void) +{ + struct udevice *dev, *lnk_dev; + struct phy serdes; + int ret, count, i; + + if (!IS_ENABLED(CONFIG_PHY_CADENCE_SIERRA)) + return; + + ret = uclass_get_device_by_driver(UCLASS_PHY, + DM_DRIVER_GET(sierra_phy_provider), + &dev); + if (ret) + printf("Sierra init failed:%d\n", ret); + + serdes.dev = dev; + serdes.id = 0; + + count = device_get_child_count(dev); + for (i = 0; i < count; i++) { + ret = device_get_child(dev, i, &lnk_dev); + if (ret) + printf("probe of sierra child node %d failed\n", i); + } + + ret = generic_phy_init(&serdes); + if (ret) + printf("phy_init failed!!\n"); + + ret = generic_phy_power_on(&serdes); + if (ret) + printf("phy_power_on failed !!\n"); +} + int board_late_init(void) { if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) { @@ -426,6 +460,9 @@ int board_late_init(void) if (board_is_j7200_som()) configure_serdes_torrent(); + if (board_is_j721e_som()) + configure_serdes_sierra(); + return 0; } -- 2.39.5