aboutsummaryrefslogtreecommitdiff
path: root/board/ti/j721e/evm.c
diff options
context:
space:
mode:
authorAswath Govindraju2021-07-21 21:28:39 +0530
committerLokesh Vutla2021-07-27 10:57:12 +0530
commit6cfabddc3b803afce94fae1e3916d853668cbd01 (patch)
tree51fe694e7b11bbca9c092a6a90f234a1f60e70e8 /board/ti/j721e/evm.c
parent1a83f9931e052168c225033d9c642112142dab70 (diff)
board: ti: j721e: Add support for probing and configuring Torrent serdes on J7200
Add support for probing and configuring Torrent serdes on J7200. Signed-off-by: Aswath Govindraju <a-govindraju@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Link: https://lore.kernel.org/r/20210721155849.20994-11-kishon@ti.com
Diffstat (limited to 'board/ti/j721e/evm.c')
-rw-r--r--board/ti/j721e/evm.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index b9a9f195522..580f13c3ab1 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <env.h>
#include <fdt_support.h>
+#include <generic-phy.h>
#include <image.h>
#include <init.h>
#include <log.h>
@@ -29,7 +30,8 @@
#define board_is_j721e_som() (board_ti_k3_is("J721EX-PM1-SOM") || \
board_ti_k3_is("J721EX-PM2-SOM"))
-#define board_is_j7200_som() board_ti_k3_is("J7200X-PM1-SOM")
+#define board_is_j7200_som() (board_ti_k3_is("J7200X-PM1-SOM") || \
+ board_ti_k3_is("J7200X-PM2-SOM"))
/* Max number of MAC addresses that are parsed/processed per daughter card */
#define DAUGHTER_CARD_NO_OF_MAC_ADDR 8
@@ -384,6 +386,33 @@ static int probe_daughtercards(void)
}
#endif
+void configure_serdes_torrent(void)
+{
+ struct udevice *dev;
+ struct phy serdes;
+ int ret;
+
+ if (!IS_ENABLED(CONFIG_PHY_CADENCE_TORRENT))
+ return;
+
+ ret = uclass_get_device_by_driver(UCLASS_PHY,
+ DM_DRIVER_GET(torrent_phy_provider),
+ &dev);
+ if (ret)
+ printf("Torrent init failed:%d\n", ret);
+
+ serdes.dev = dev;
+ serdes.id = 0;
+
+ 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)) {
@@ -394,6 +423,9 @@ int board_late_init(void)
probe_daughtercards();
}
+ if (board_is_j7200_som())
+ configure_serdes_torrent();
+
return 0;
}