From patchwork Tue Mar 9 12:27:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 395977 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2558403jai; Tue, 9 Mar 2021 04:55:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtb9ZagXzcep/AnQpoJ4/PZiKmvhAcRpGbj3HrT9vviFZIV+m80lhtwWZU/kJQo9AMtx0s X-Received: by 2002:a17:906:a157:: with SMTP id bu23mr19480394ejb.491.1615294524028; Tue, 09 Mar 2021 04:55:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615294524; cv=none; d=google.com; s=arc-20160816; b=K7kjohncKxNBdsvd8K1DXd283Rxfqnq0D6u2wN+bUHkhpCwdfLg95An54MXmwNTvOl /J4cP6Q5e9723RQbhnU7c8Gat++n/iICHMe2e30HJZpAyLrHe/d6rrgeatXLiwXsju5r DGGukuC33DOI+szZ4vQfSQ6isBZIKZxhv9I/XPyHRj+jNHABBMx1IASlBR81egwTYdNw iNidlY9du1gUhbqAnPxYY80oAPakJ2dCRDh3InntBVcmlsIE8eaUJRXCwyYwrjrqybEs QDZp30bTeKwFNk+7SeF9+Y8Vjn2Sna/5MJc2/H0Fu+3ah809PnwHxq+ek7AEvU53xdLi c+9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=deu3hB5zOiPAajOptRDLz3qNC1EIg8r3uxKcMDO9qbA=; b=qCAa1VdDlzvSXRuBc4YnAkdzl8lcTgyHvaYfGifjux9Lhv0gAnWIu8VlIDMrKFMCXE TohLGy+BVoi9ZY0I4Z2a5LAmCXHzlKpQcn8qbv7c1VfI9Lskjc2or0nLNzojXT8e4lS+ H0f5jMbXp+gG7iyV/l0yzk+b9LbAEwsmLbTY16Fqv7Kdf7L0y3wTBUMoXivZW4NL+Wod asCboBgkchw7phcFquRsldoEwFmrHdziQwLHDRLBkoRuI8iKhedQehaCx32J3821uJgs yi1U4SdTIJ7/MMhFqZyS036hPIb39jD8CDVcKu55cMnE7r4YG+CESQimCx1BIzfSqpGv CseQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=K3NuZ1JQ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id hc17si5092844ejc.480.2021.03.09.04.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 04:55:24 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=K3NuZ1JQ; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 319518283E; Tue, 9 Mar 2021 13:53:55 +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="K3NuZ1JQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AF652827AA; Tue, 9 Mar 2021 13:28:16 +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.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (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 63E2C827A8 for ; Tue, 9 Mar 2021 13:28:13 +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=kishon@ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 129CSCDw071213; Tue, 9 Mar 2021 06:28:12 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1615292892; bh=deu3hB5zOiPAajOptRDLz3qNC1EIg8r3uxKcMDO9qbA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=K3NuZ1JQe8hHBEtSj7L0QASBrkbKaEXiwqR9t3eAXqE0HPFlNOj2k7yoBzSRk3IIQ 4Ce4FP8pJ1i1OD35DvUnl8v48Fet17+CrkKoDC5TYZ5124CiMPPEbatS8Rkag7GHIi 4JdbtBYa76n4x8ER4A9G6l+Ste12lFSlTgGJEC5I= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 129CSC2q062175 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 9 Mar 2021 06:28:12 -0600 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 9 Mar 2021 06:28:11 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Tue, 9 Mar 2021 06:28:11 -0600 Received: from a0393678-ssd.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 129CRncV119584; Tue, 9 Mar 2021 06:28:09 -0600 From: Kishon Vijay Abraham I To: Lokesh Vutla , Simon Glass , Aswath Govindraju CC: Subject: [PATCH 08/16] board: ti: j721e: Add support for probing and configuring Torrent serdes on J7200 Date: Tue, 9 Mar 2021 17:57:40 +0530 Message-ID: <20210309122748.31842-9-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210309122748.31842-1-kishon@ti.com> References: <20210309122748.31842-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Approved-At: Tue, 09 Mar 2021 13:53:37 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean From: Aswath Govindraju Add support for probing and configuring Torrent serdes on J7200. Signed-off-by: Aswath Govindraju Signed-off-by: Kishon Vijay Abraham I --- board/ti/j721e/evm.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index b9a9f19552..580f13c3ab 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -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; }