From patchwork Fri Jan 28 08:11:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aswath Govindraju X-Patchwork-Id: 1585547 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=TvH9rYFm; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JlVbj1hxkz9t25 for ; Fri, 28 Jan 2022 19:14:09 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C15E5838A0; Fri, 28 Jan 2022 09:12:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="TvH9rYFm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 617DC8387F; Fri, 28 Jan 2022 09:12:32 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2C7A283801 for ; Fri, 28 Jan 2022 09:12:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=a-govindraju@ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 20S8CPEr004117; Fri, 28 Jan 2022 02:12:25 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1643357545; bh=kH9gTuDn4DVXXCcyGkTt7M86lKAlln/F+kMqJ0ZD674=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=TvH9rYFmH1q8/Gzt6UV8/xydIr+iSMUc+Gyx/GRsOWL9UxQx8+CkrB8v2V90MTvTf HPVyOTUHT/+exvmkpQYVnLPhWmSaa4qFOw26fA1TcXDi2stSuW9ZjDkTZVeS9fz4Yp HuuFziO64Pi2KqfM3wF2P0Hhy6qjD+qND6qXV1tY= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 20S8CPgX069318 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 28 Jan 2022 02:12:25 -0600 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Fri, 28 Jan 2022 02:12:24 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Fri, 28 Jan 2022 02:12:25 -0600 Received: from gsaswath-HP-ProBook-640-G5.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 20S8BqpH098664; Fri, 28 Jan 2022 02:12:22 -0600 From: Aswath Govindraju To: CC: , Sanket Parmar , Alan Douglas , Swapnil Jakhade , Kishon Vijay Abraham I , Tero Kristo , Vignesh Raghavendra , Aswath Govindraju Subject: [PATCH v2 11/25] board: ti: j721e: evm.c: Add support for probing SerDes0 Date: Fri, 28 Jan 2022 13:41:38 +0530 Message-ID: <20220128081152.14901-12-a-govindraju@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220128081152.14901-1-a-govindraju@ti.com> References: <20220128081152.14901-1-a-govindraju@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean 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 077d83420c9c..ad85b9d50115 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; }