From patchwork Tue Mar 2 15:34:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446106 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=fa/zfL+3; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4Dqh6H1kyyz9sS8 for ; Wed, 3 Mar 2021 02:35:35 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B7EE282700; Tue, 2 Mar 2021 16:35:24 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fa/zfL+3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D661B82717; Tue, 2 Mar 2021 16:35:22 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0E577826B9 for ; Tue, 2 Mar 2021 16:35:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pl1-x633.google.com with SMTP id s16so12226623plr.9 for ; Tue, 02 Mar 2021 07:35:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L7Gd8TI5JpnNFf0eKJ3d0TPM0aQ2WZTxqabp+fD6YQ0=; b=fa/zfL+3ei3mWrEOnXZQetkErvZDTqM9bKbwHXPifzukDtYD27yHG91svvRbFBZDQr 707nLTNqMl/eM4N5lmGGKd6YgckIN8WAUzOM+JZkkBV7k81ruRPYyqb0KjJvqwnJx9kl fXc/fkhtuRV2lBF6d8tlBM45l1px3+J/kh3HIQu4iPjyTbgIFeLB+NSn6eJpo/unD/ck LuNs5sKIbpN2NXRg3BiBtfStvt1T/MGUD4IOmH+9bVbt2Cw99xG0wfyvMg6Pg8kzEERf toSM1+xulPQLDhQaaX65A1olZ+OZP25fKIgtLiQmz2fr6Uifpt3QhMD1lWRXvx/kp1Y3 iE9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L7Gd8TI5JpnNFf0eKJ3d0TPM0aQ2WZTxqabp+fD6YQ0=; b=TMQJEtRXkcV9muJzEpUhuzNKsnOdCGJt8DU6wjpuC0veMpxU8xdvaUdelC4XJ7kys4 rqrn13B0RRDGv2HCRvGmQV+034h4VIdZVIFnviv6k559NS4MiRop6ltTilSjbhK5DMgu As9eJTEP3iXon69VFXZmi74clWFPdcPIWiLNjjzZIkl3ldMKE/olvmZGIGnQrANJUrLX o7ABU1atfXNejnus7WV7+lolR5okRhvitVUtj5zLkC15V/XwD4PNewoSksSNkvkKXE/s P4ARe4/zHYEn/Rtza3Bz3nVCan89VfDK2uqNUk242hMs/UJdTXUrkUnXv866ChxOdOpJ DC7g== X-Gm-Message-State: AOAM533yjCoFk2iGQzPAAzxLzS4ZxMOphNOO1ldG3LKhL/r5DtUAQ4N0 FTeMOzdk+wvqOEQsD/n59Ng= X-Google-Smtp-Source: ABdhPJzRslQyfMkaTTidleYkxrGH3BnG50hx5d69esJN5FNckEkawLW+JbRqwTJLt0vmK9jxeG3JZw== X-Received: by 2002:a17:90b:1082:: with SMTP id gj2mr4898957pjb.155.1614699317282; Tue, 02 Mar 2021 07:35:17 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.35.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:35:16 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng , Abbie Chang , Alex Nemirovsky , Amit Singh Tomar , Dan Murphy , Florin Chiculita , Joe Hershberger , Madalin Bucur , Meenakshi Aggarwal , Michal Simek , Ramon Fried , Samuel Mendoza-Jonas , Vladimir Oltean Subject: [PATCH 01/20] net: phy: xilinx: Remove non-DM prototype of phy_connect_gmii2rgmii() Date: Tue, 2 Mar 2021 23:34:32 +0800 Message-Id: <20210302153451.19440-2-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 At present phy_connect_gmii2rgmii() is implemented using a DM API dev_of_offset() hence it cannot support a non-DM configuration. Remove the non-DM version prototype of phy_connect_gmii2rgmii() and make the driver depend on CONFIG_DM_ETH. Signed-off-by: Bin Meng Acked-by: Michal Simek Reviewed-By: Ramon Fried --- drivers/net/phy/Kconfig | 1 + drivers/net/phy/phy.c | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index d69503067d..070ffa82cb 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -292,6 +292,7 @@ config PHY_XILINX config PHY_XILINX_GMII2RGMII bool "Xilinx GMII to RGMII Ethernet PHYs support" + depends on DM_ETH help This adds support for Xilinx GMII to RGMII IP core. This IP acts as bridge between MAC connected over GMII and external phy that diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 89e3076bfd..d9e03baf7b 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -942,15 +942,9 @@ void phy_connect_dev(struct phy_device *phydev, struct eth_device *dev) } #ifdef CONFIG_PHY_XILINX_GMII2RGMII -#ifdef CONFIG_DM_ETH static struct phy_device *phy_connect_gmii2rgmii(struct mii_dev *bus, struct udevice *dev, phy_interface_t interface) -#else -static struct phy_device *phy_connect_gmii2rgmii(struct mii_dev *bus, - struct eth_device *dev, - phy_interface_t interface) -#endif { struct phy_device *phydev = NULL; int sn = dev_of_offset(dev); From patchwork Tue Mar 2 15:34:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446107 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=nNGfYxA3; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4Dqh6T3GDWz9sS8 for ; Wed, 3 Mar 2021 02:35:45 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9E38E82785; Tue, 2 Mar 2021 16:35:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nNGfYxA3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5FACB82777; Tue, 2 Mar 2021 16:35:30 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6EC6482765 for ; Tue, 2 Mar 2021 16:35:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pl1-x636.google.com with SMTP id s16so12226770plr.9 for ; Tue, 02 Mar 2021 07:35:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Sl8AWAp8vrwZjBRJI5qU+GEsjv2XCUGfyAHbm+6V1sU=; b=nNGfYxA3xYZQaNXTD5kiS4liyKODJpCoVXB+r/ywqoS0KdaLdpQ6rL/UWEWB8By7gc LxLO2Wy6SMNnycV+KpQerHw/oMcmhtuMnCpu+8hBz+ZG1zpk1S4E/BXnwh3qG0WbTIMk kXlnRcptQmrkGpP0aLtxH57qcvGFmTxp0oeMCIhm5Cnl/qkXdVVzfGQZE6+K2sUPmb3B Ky03H8oA+HTuTNRJP2RNkFpZeKUfdxke1P4eQIsW/KqCCfbYs2nO4MD62MmHirQknvwN kzQVEK3mw1YN5HrK1TmtnyVUKeqLK5ywyJ39B1xdmVhQOUH6Rd5OiqbDRV/PNtVL6AVc 4PPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Sl8AWAp8vrwZjBRJI5qU+GEsjv2XCUGfyAHbm+6V1sU=; b=UDoLloh4Bxe8DhYZsPSvdWsiijHb0Hee7w+/sT9qwuY4HAWeOVvbTXsszYTKV9gvdi e+9l94iPcKz8nRYPAyjD2qWFDKZMMzFzjME0HIKE/s+TjhCYw2ktZ1IUt03lW0M/EfCb yy5XO3+p+JzYzK3bKQSk1xyCWSBUA3xIzCDBOobASDoSOz+VAZlDKj8CLofKUURFos4c iZv8QVglW6fZ4GpbVgAPeQYp4bIuj4OY+tz1M8jucVqeulMpUksW0kEbG3KE0ooALYD7 9bOy7Md++jG1XE4d8w3pGRectzkoHIFrhKfLucjCArAwF+XkxxsN7iq96b0XZPf88cxC 2Utw== X-Gm-Message-State: AOAM530PPVx/T0ZrSCkx7wu/fIL3uUvKIjWNe7NYuOKtbrS3lvIaqpJh aq80bqcNnizMpobteUBl4uo= X-Google-Smtp-Source: ABdhPJyEViUj6zpfVxn1QkTVhVCUqDfiWnnrLKcFIXRdvvmPeQLnNzZylz8kFlxJ+7TbbvfSZ1diug== X-Received: by 2002:a17:90a:dd45:: with SMTP id u5mr5010873pjv.142.1614699324040; Tue, 02 Mar 2021 07:35:24 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.35.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:35:23 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng , Abbie Chang , Florin Chiculita , Joe Hershberger , Joel Stanley , Ramon Fried , Samuel Mendoza-Jonas , Vladimir Oltean Subject: [PATCH 02/20] net: phy: xilinx: Convert to use APIs which support live DT Date: Tue, 2 Mar 2021 23:34:33 +0800 Message-Id: <20210302153451.19440-3-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 Use ofnode_ APIs instead of fdt_ APIs so that the Xilinx PHY driver can support live DT. Signed-off-by: Bin Meng Reviewed-By: Ramon Fried --- drivers/net/phy/phy.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index d9e03baf7b..f0522fc149 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -947,23 +947,18 @@ static struct phy_device *phy_connect_gmii2rgmii(struct mii_dev *bus, phy_interface_t interface) { struct phy_device *phydev = NULL; - int sn = dev_of_offset(dev); - int off; + ofnode node = dev_ofnode(dev); - while (sn > 0) { - off = fdt_node_offset_by_compatible(gd->fdt_blob, sn, - "xlnx,gmii-to-rgmii-1.0"); - if (off > 0) { - phydev = phy_device_create(bus, off, + while (ofnode_valid(node)) { + node = ofnode_by_compatible(node, "xlnx,gmii-to-rgmii-1.0"); + if (ofnode_valid(node)) { + phydev = phy_device_create(bus, ofnode_to_offset(node), PHY_GMII2RGMII_ID, false, interface); break; } - if (off == -FDT_ERR_NOTFOUND) - sn = fdt_first_subnode(gd->fdt_blob, sn); - else - printf("%s: Error finding compat string:%d\n", - __func__, off); + + node = ofnode_first_subnode(node); } return phydev; From patchwork Tue Mar 2 15:34:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446109 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=c0CV/RnD; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4Dqh6j0HZSz9sVw for ; Wed, 3 Mar 2021 02:35:56 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D7FE18276E; Tue, 2 Mar 2021 16:35:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="c0CV/RnD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6AC82827AA; Tue, 2 Mar 2021 16:35:37 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 418F68276B for ; Tue, 2 Mar 2021 16:35:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pl1-x62a.google.com with SMTP id k22so12236341pll.6 for ; Tue, 02 Mar 2021 07:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BK/VoUT266ldC3Fn7LrdMnRC9QsHTLCdiLI74Ly/8UY=; b=c0CV/RnDqAb+Stm8TXo2FC0AkoxyhAAJZ6jkCTyl9hrGh7eo2nujlsMj/v8NUuHrPe PJSQde15nXs1T7TTgWn//ITb82izZpJzVKTjp7sSdjWBycu9KzvneHp3MsgDn8C7/JIW JQEWkXPewcmnojJ2/HJagB4OgfVW//jHRqckD6Lg9coENeQMqGjZ0HZSf6rmdDqAijfY MSpHOnpGexLM+fL6zyayP1qFLDXy53jMenVE7cUPWtT16BoNXDOhJ8EDZQPsdIpxFLsx ZK+1Gv3BD6kpxsaX1ZQuWZiwe8ckknNYj6eDzi4TZQedPyu0t+kodOioYA6R5Y/CgAVf 0fDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BK/VoUT266ldC3Fn7LrdMnRC9QsHTLCdiLI74Ly/8UY=; b=MEVSPER6B/UqpedVGqWldQCvtDfPS1J6T6wnYA114kTbXBLhJ60o65fkCQwQQR3dFb 4BpQdalkcyf+po1ISr0V7HQr1UIcT9GQrshsUY7Kevbf0QTGhMcYmn+H94Zr18fFbKPh ugBTEr1P/y0k6hXAoO855Q111ZLFoakQSHtwFT1f2IhL6Gwapz0/PG+73Ev1R2Ltei5s uOmyP01TAhCpXA4dsmNWgddOoHpQbgnDVAIr8GyQ9g63XaqYZvJ91kmdAS3SFYxAQm+H ZzL89MN96NQia4GK1zi3wUgXGTAYYSAuAmMZ4SBzx9bcGmAx3MZg3yWEDqPm10ed/gTr mu3w== X-Gm-Message-State: AOAM5331AMo90aYspG5mKS1qVW7VN/efE6wcSVe+c41HsFbY0hFZZPnM Byi/ZKnTzoacewXFytcHZD0= X-Google-Smtp-Source: ABdhPJx3tJljYHS8hCAZZW1SQm3Ev+0Xy83BbdXUMrOElJXhFVMfKA5+vH/CYPffqsjwBowTfjSkUg== X-Received: by 2002:a17:90a:f2d5:: with SMTP id gt21mr5252147pjb.197.1614699330823; Tue, 02 Mar 2021 07:35:30 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.35.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:35:30 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng , Abbie Chang , Andre Przywara , Florin Chiculita , Hou Zhiqiang , Joe Hershberger , Ramon Fried , Samuel Mendoza-Jonas , Vladimir Oltean Subject: [PATCH 03/20] net: phy: fixed: Remove non-DM prototype of phy_connect_fixed() Date: Tue, 2 Mar 2021 23:34:34 +0800 Message-Id: <20210302153451.19440-4-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 CONFIG_PHY_FIXED depends on CONFIG_DM_ETH. Remove the non-DM version prototype of phy_connect_fixed(). Signed-off-by: Bin Meng Reviewed-By: Ramon Fried --- drivers/net/phy/phy.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index f0522fc149..d08e8026ba 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -997,15 +997,9 @@ struct phy_device *fixed_phy_create(ofnode node) false, interface); } -#ifdef CONFIG_DM_ETH static struct phy_device *phy_connect_fixed(struct mii_dev *bus, struct udevice *dev, phy_interface_t interface) -#else -static struct phy_device *phy_connect_fixed(struct mii_dev *bus, - struct eth_device *dev, - phy_interface_t interface) -#endif { struct phy_device *phydev = NULL; int sn; From patchwork Tue Mar 2 15:34:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446110 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=GSfYd4Tx; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 ozlabs.org (Postfix) with ESMTPS id 4Dqh6x3KJfz9sVw for ; Wed, 3 Mar 2021 02:36:09 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0007B827BE; Tue, 2 Mar 2021 16:35:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GSfYd4Tx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B72D9827B1; Tue, 2 Mar 2021 16:35:43 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4756382770 for ; Tue, 2 Mar 2021 16:35:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pj1-x1034.google.com with SMTP id l18so2247488pji.3 for ; Tue, 02 Mar 2021 07:35:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WbbNOx3+YFE6cA6b2SMuDl+VbZTI9VCrj4u/r063gv8=; b=GSfYd4TxU89OxQcbdlfOb+AI6CyS4ulsF5RVH0kyCoK2NszF/XxAZ6LiErM+Iad+xz p4JhEWWxonauajtU5hynkBAz8TSyy7mf4BGrtHPcUOM+SjCUMgNfznpFQCJYdWdIRPqe WgmWEYmCKDX/mLHhxQoQStsiqBJw3QhL6ghGwwqNwpqfA9WdIpFX7e5TTT1ReLeOcBt+ wbp1YovX8R/0zFbOCcUrZ5Hic2qoI7LgMdmet0ljo6+bcBYiKWENZH4bnkCsoG5w6kw5 WnDswgCVhvjIsyXQOIdFw0YycB+TPs9UPhuVPD0LDtHNgaZ0SgLf4vYOAmqrY51AGRN/ paZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WbbNOx3+YFE6cA6b2SMuDl+VbZTI9VCrj4u/r063gv8=; b=Skkmw/v64UThcVEWWkDI/edmW9r9aYLDfm/9X3lYLuUZygQTemtYX+U5l+zM+0DzOS MsUAEnLGE3QfIhmw+FBnRf9Hy7QOFe+1TGHyqSNc35qv2vOwv1IKj2A0CkTmZqAzf01J +Jm4rfKf3Bwl8TdHKOTTzYDiUDH/XwiaAyzQQr2oXqiL0UkvdM2VL0lF5062aGMIc1RU x9qoFd12vgAvvlTGZlZMIeJeucnmyn1ROwggUFaM2MpFNkK6WU1QPSvUCFBD0IPk3pM2 pGG2CMT8fbcgaAcb3PaQ187+UDqNNlGV6qE33tChrJ2DM5ZIfpbyD8bNYpL0xlqEsAfU dxQQ== X-Gm-Message-State: AOAM531i1V4NecuKSWGzjdkV1e5W9p7IRzAyDtxG038gHh3ld0+eiSBP otLdy4LPPbxrhiF82cozyh0= X-Google-Smtp-Source: ABdhPJwEAAaDR1TQd7eM0LyK6hwURsY5PeeBzuasKVoOyyC6GAd/FlbooaCwvDOUEcrBxy2HBAIi2A== X-Received: by 2002:a17:90a:928d:: with SMTP id n13mr5064000pjo.12.1614699335864; Tue, 02 Mar 2021 07:35:35 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.35.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:35:35 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng , Abbie Chang , Andre Przywara , Florin Chiculita , Joe Hershberger , Ramon Fried , Samuel Mendoza-Jonas , Vladimir Oltean Subject: [PATCH 04/20] net: phy: fixed: Convert to use APIs which support live DT Date: Tue, 2 Mar 2021 23:34:35 +0800 Message-Id: <20210302153451.19440-5-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 Use ofnode_ APIs instead of fdt_ APIs so that the fixed PHY driver can support live DT. Signed-off-by: Bin Meng Reviewed-By: Ramon Fried --- drivers/net/phy/phy.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index d08e8026ba..69e02685fa 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -1002,18 +1002,19 @@ static struct phy_device *phy_connect_fixed(struct mii_dev *bus, phy_interface_t interface) { struct phy_device *phydev = NULL; - int sn; + ofnode node = dev_ofnode(dev); const char *name; - sn = fdt_first_subnode(gd->fdt_blob, dev_of_offset(dev)); - while (sn > 0) { - name = fdt_get_name(gd->fdt_blob, sn, NULL); + node = ofnode_first_subnode(node); + while (ofnode_valid(node)) { + name = ofnode_get_name(node); if (name && strcmp(name, "fixed-link") == 0) { - phydev = phy_device_create(bus, sn, PHY_FIXED_ID, false, + phydev = phy_device_create(bus, ofnode_to_offset(node), + PHY_FIXED_ID, false, interface); break; } - sn = fdt_next_subnode(gd->fdt_blob, sn); + node = ofnode_next_subnode(node); } return phydev; From patchwork Tue Mar 2 15:34:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446111 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=rXAd2Y9e; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4Dqh7B1p8Xz9sS8 for ; Wed, 3 Mar 2021 02:36:22 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D5133827CB; Tue, 2 Mar 2021 16:35:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rXAd2Y9e"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 304E1827B8; Tue, 2 Mar 2021 16:35:51 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EC82C82790 for ; Tue, 2 Mar 2021 16:35:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pj1-x1036.google.com with SMTP id i14so2169712pjz.4 for ; Tue, 02 Mar 2021 07:35:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E8gcW10CJoJJOifduhJ3mlVCRVc2l3ini9RJZw9po8o=; b=rXAd2Y9eSJ86/h9aVCKS3sTmTt19FHXquDvlBv+nOU2jerLGnJza6Ayiy4VIg/DTuY 5WxBPd3hL/Nb3h21ae+BqaMusZHaQwNY4SUjY6iGgsNL7X3mvcVIduozjTKmVffmtikT iwG51Z56CKMS0Mh86HnSpBz2jp06chRe3oXexoUAfnqJH6iBAPtSLPvO/W0iovN1YruJ 90+XgetWewO90Tpd/Vca858d6rreamBtLB6ifUn64nNGDFXHBkufmWVUnd1Cvsl3yzqI dd5js2l6cCe11OcqaEtMWWekiPZ/t6gnA8wpU6M2FPoM2FVCrcoMynaUkjrHupNkWy0a m2og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E8gcW10CJoJJOifduhJ3mlVCRVc2l3ini9RJZw9po8o=; b=I3ctTnpXlwahFkXeieoBdbjMa90+Gc9zPX5fXJ6Yo1jrayKe6m5dpt0E3OOqR4hHYh ERxg1NyCm1VgModzk3uI+W2Eqn2xAG14wGDLgfnSvE4Ow+5zp0Jfvc+kBryk55jOsUxg y20Qz1n5j2TyhLXBp5mTjD9hRU30msw9NPMxPzHEyY91tS2a9QXGNc663N5trJOX6Eoh Z1Nwk2ak5WYGN1mS9zMEzLTsIJevWpzNaFypeOyUdhTu92oNYnQeTSC6wNTDJt+Ufv+K Yrr5PUT3DwL/hA5cfYQCURfnYBa/bH38iVgJx4UzkVY6meiXWiDLRqdaVCi7Zkz+mk+2 NIyw== X-Gm-Message-State: AOAM532bnBfbSnDitKhGZOJVePxUiA84DEaFtZdFvNZdSOS6NbRXwzch qn88EKY4e37xJ8b1lNzZkcQ= X-Google-Smtp-Source: ABdhPJzbT4l/WLzjp+0sVmIaPRSd7u0z+UrHhtmEb/SQwGXwph9lvDDZcRP0lEKxnJoDuJN2qIvyWA== X-Received: by 2002:a17:902:24d:b029:e3:cfa7:e308 with SMTP id 71-20020a170902024db02900e3cfa7e308mr4057022plc.82.1614699340410; Tue, 02 Mar 2021 07:35:40 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.35.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:35:40 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng Subject: [PATCH 05/20] dt-bindings: net: Add the old DT bindings for "fixed-link" Date: Tue, 2 Mar 2021 23:34:36 +0800 Message-Id: <20210302153451.19440-6-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 Per the upstream Linux kernel doc: Documentation/devicetree/bindings/net/ethernet-controller.yaml There are two ways to describe a fixed PHY attached to an Ethernet device. This updates our dt-bindings doc to add the old DT bindings. Signed-off-by: Bin Meng Reviewed-By: Ramon Fried --- doc/device-tree-bindings/net/fixed-link.txt | 47 +++++++++++++++------ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/doc/device-tree-bindings/net/fixed-link.txt b/doc/device-tree-bindings/net/fixed-link.txt index 5829bd81a2..71ab480701 100644 --- a/doc/device-tree-bindings/net/fixed-link.txt +++ b/doc/device-tree-bindings/net/fixed-link.txt @@ -5,21 +5,36 @@ Some Ethernet MACs have a "fixed link", and are not connected to a normal MDIO-managed PHY device. For those situations, a Device Tree binding allows to describe a "fixed link". -Such a fixed link situation is described by creating a 'fixed-link' -sub-node of the Ethernet MAC device node, with the following -properties: - -* 'speed' (integer, mandatory), to indicate the link speed. Accepted - values are 10, 100 and 1000 -* 'full-duplex' (boolean, optional), to indicate that full duplex is - used. When absent, half duplex is assumed. -* 'pause' (boolean, optional), to indicate that pause should be - enabled. -* 'asym-pause' (boolean, optional), to indicate that asym_pause should - be enabled. +Note there are two ways to describe a fixed PHY attached to an +Ethernet device: + +- The new DT binding, where 'fixed-link' is a sub-node of the Ethernet + MAC device node, with the following properties: + + * 'speed' (integer, mandatory), to indicate the link speed. Accepted + values are 10, 100 and 1000 + * 'full-duplex' (boolean, optional), to indicate that full duplex is + used. When absent, half duplex is assumed. + * 'pause' (boolean, optional), to indicate that pause should be + enabled. + * 'asym-pause' (boolean, optional), to indicate that asym_pause should + be enabled. + +- The old DT binding, where 'fixed-link' is a property with 5 cells + encoding various information about the fixed PHY, in the form of + . + + * 'phy_id', emulated PHY ID, choose any but unique to the all specified + fixed-links + * 'full-duplex', 0 for half duplex or 1 for full duplex + * 'speed', link speed in Mbits/sec, accepts only 10, 100 and 1000 + * 'pause', 0 for no pause, 1 for pause + * 'asym-pause', 0 for no asymmetric pause, 1 for asymmetric pause Examples: +The new binding: + ethernet@0 { ... fixed-link { @@ -28,3 +43,11 @@ ethernet@0 { }; ... }; + +The old binding: + +ethernet@0 { + ... + fixed-link = <0 1 1000 0 0>; + ... +}; From patchwork Tue Mar 2 15:34:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446112 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=lteN3PaR; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4Dqh7R6sKsz9sS8 for ; Wed, 3 Mar 2021 02:36:35 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AAB27827B1; Tue, 2 Mar 2021 16:35:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lteN3PaR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9053382794; Tue, 2 Mar 2021 16:35:52 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EEFBC82770 for ; Tue, 2 Mar 2021 16:35:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pj1-x102e.google.com with SMTP id t9so2164732pjl.5 for ; Tue, 02 Mar 2021 07:35:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3h0hbwjx7cDmYFxux3JD5zoQ05eGAu4iv9l/U+z4BeM=; b=lteN3PaRsTbjOFbGft0Cf82QuuA+FltJEycUioB2OHANk96jP5ZORbyz3mBDFZQhfK NGm/IDHMAqvArckuJwKlqQ28tNzzlMPvbB8rz6ymDjzpSqz9Z7fM/j+x8nmgYXxfbzeD hJ3FCexT5qkht8aDVSMu5B6fsJI5IySzU/dRnH9bQKPnWi9emkd8JhChXr6J1gJPVOwX rliBdP9r2uiIeQ96CulRe9pAiDSihuO4vK3orjea/ootVJFYJbvnnDa1QOLLnVT7To8q 6Ey7zu6in2s0d4F7YPTLeKwj4TtzMokij0Ga523ti7XZChpCi72m5dii59869xNabDfr RO/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3h0hbwjx7cDmYFxux3JD5zoQ05eGAu4iv9l/U+z4BeM=; b=PMCGrYWcIxF8FayUan4QJZloLAlnsyTHgmbLAamNfry4xFAPbCTgL/75BGncdteJnJ kxh5/3+U4bKHPHbP3ohfZ2HNamWfpyKOgl7JwkVeVcOgyEizwxHn5wAQoTXPoo0hWe4y dTMXYrDCs2AOHKoppLPnCkD7EKwtvFiRx7SF1Gy0hpsDzTIEuibx7kDtLw0gRy3vF0KW zO05dTr34Jnlebg01fCAIcwihFebAbzwt/Mi+MEGLX1JrrnS5feHLcY6osAwR3lQW4s3 ATd1hxtz83ggnwwH6Wrg5BOqBujy1eMx3fR6ZLyUdyo904vbIflT7/oa2rt7sW+jN9v4 J0EQ== X-Gm-Message-State: AOAM530oi7zwkBdUhExu87Ncyf5SGw42gJf4aX7bWegYhpRIVkM2Q/0F 1LWsv48TRb4ETa3K0Jw7sYg= X-Google-Smtp-Source: ABdhPJxMZe9+qfGf1UyrpWRdM2OCSGOzrBKca/i5cy5lD4GvzhGmRJ4SpMprwcifyA3iZF3YdIylyA== X-Received: by 2002:a17:90a:8d84:: with SMTP id d4mr5001856pjo.56.1614699343579; Tue, 02 Mar 2021 07:35:43 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.35.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:35:43 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng Subject: [PATCH 06/20] of: extra: Introduce ofnode_phy_is_fixed_link() API Date: Tue, 2 Mar 2021 23:34:37 +0800 Message-Id: <20210302153451.19440-7-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 Introduce a helper API ofnode_phy_is_fixed_link() to detect whether the ethernet controller connects to a fixed-link pseudo-PHY device. Note there are two ways to describe a fixed PHY attached to an Ethernet device: - the new DT binding, where 'fixed-link' is a sub-node of the Ethernet device - the old DT binding, where 'fixed-link' is a property with 5 cells encoding various information about the fixed PHY Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- drivers/core/of_extra.c | 26 ++++++++++++++++++++++++++ include/dm/of_extra.h | 18 ++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/drivers/core/of_extra.c b/drivers/core/of_extra.c index 653344529e..a16f9a8dc1 100644 --- a/drivers/core/of_extra.c +++ b/drivers/core/of_extra.c @@ -130,3 +130,29 @@ int ofnode_decode_memory_region(ofnode config_node, const char *mem_type, return 0; } + +bool ofnode_phy_is_fixed_link(ofnode eth_node, ofnode *phy_node) +{ + bool found = false; + ofnode node, subnode; + int len; + + /* new binding */ + subnode = ofnode_find_subnode(eth_node, "fixed-link"); + if (ofnode_valid(subnode)) { + node = subnode; + found = true; + } + + /* old binding */ + if (ofnode_get_property(eth_node, "fixed-link", &len) && + len == (5 * sizeof(__be32))) { + node = eth_node; + found = true; + } + + if (found && phy_node) + *phy_node = node; + + return found; +} diff --git a/include/dm/of_extra.h b/include/dm/of_extra.h index ca15df21b0..3641f68fe3 100644 --- a/include/dm/of_extra.h +++ b/include/dm/of_extra.h @@ -86,4 +86,22 @@ int ofnode_decode_memory_region(ofnode config_node, const char *mem_type, const char *suffix, fdt_addr_t *basep, fdt_size_t *sizep); +/** + * ofnode_phy_is_fixed_link() - Detect fixed-link pseudo-PHY device + * + * This function detects whether the ethernet controller connects to a + * fixed-link pseudo-PHY device. + * + * This function supports the following two DT bindings: + * - the new DT binding, where 'fixed-link' is a sub-node of the + * Ethernet device + * - the old DT binding, where 'fixed-link' is a property with 5 + * cells encoding various information about the fixed PHY + * + * @param eth_node ofnode containing the fixed-link subnode/property + * @param phy_node if fixed-link PHY detected, containing the PHY ofnode + * @return true if a fixed-link pseudo-PHY device exists, false otherwise + */ +bool ofnode_phy_is_fixed_link(ofnode eth_node, ofnode *phy_node); + #endif From patchwork Tue Mar 2 15:34:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446113 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=n+bLqrQu; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4Dqh7m17SNz9sS8 for ; Wed, 3 Mar 2021 02:36:52 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6B0CC81F9E; Tue, 2 Mar 2021 16:36:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="n+bLqrQu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EEC67827BF; Tue, 2 Mar 2021 16:35:58 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C64EC827AB for ; Tue, 2 Mar 2021 16:35:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pl1-x635.google.com with SMTP id d8so1819382plg.10 for ; Tue, 02 Mar 2021 07:35:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YrLUKND+mF3wWIx2Meaa6wJwWRHSd4V202Pu7bK1gFE=; b=n+bLqrQuUcyJW+spATLqqOPfqh5q/NCm+f/4x8SLM4EkSaW2E5XCrC2wz9jpUv1qhS 3DcLrDNYX9zl2RcD6IUvNtrn4CBfnWhDlkI8CvTjk2UAVt+qjs/zeJLFCJrFNuSK/Usl YLDxkwZJDXfltqxguU1xPvwTbXfkhT1HyGPqqdi4yHVrADrVeLMkw/WrPvKY22POXoyT 0qr5BxJKCjrv/TF0UcmcotFwpo8RRHF3bRaNo9MO0Q1aXQUs1dBWWpn1ESXA8XlAeWLJ NlJoFoldbtipaK0M2Za2bokivNxYVi+FdgLblqbiVW5H56DFkzukbkwyNTKJZL5KYUKC /8/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YrLUKND+mF3wWIx2Meaa6wJwWRHSd4V202Pu7bK1gFE=; b=I7NlsEknMI6zvB3WEprWB8B0n6YQyjLrmxzIcfDGfUc6jScSw0OswsfdpY0d/76kHG PY/6pafR4tHd58W6DbG5OwnfLhyHFqJ8c2ChdC/MXZuJTSzJmjVJrkuf4DWT/Uejig9u mUaDc5b3w148X9fNkn4ERrFgXbinPm/6OwtfFNMKj8e6gfj04DRRuD/i3IWliEYjopDB ZTpezRDZsEXwFoloidFY8zUalmUhFjOT6F13dd8kjom0qAMZ3/51uGNhiptJhPX8+z5o R9PoFlJCzgJR0WTfCO+ck9Kx6aM0mxS/Vzf9BwutQYadzsNBuV9SDbK6AgtFh6soHzeY VqPg== X-Gm-Message-State: AOAM532NDMey5WOtNJvZb9gNAeo3u8h4uBML1+q8wuoFcHh/FnL/zily 9mjNdfne9EGi8DMzzqhx+MQ= X-Google-Smtp-Source: ABdhPJzWdrVuNFvAgm4dCNaYIgHfaruEi+gD0oVGag/2zF7D8g8NmYKi0gEMBoAY7Ue/4s7gXRO9lg== X-Received: by 2002:a17:90a:d14e:: with SMTP id t14mr4988780pjw.66.1614699349263; Tue, 02 Mar 2021 07:35:49 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.35.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:35:48 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng , Dario Binacchi , Etienne Carriere , Heinrich Schuchardt , Jean-Jacques Hiblot , Patrick Delaunay , Sean Anderson Subject: [PATCH 07/20] test: dm: Add a case to test ofnode_phy_is_fixed_link() Date: Tue, 2 Mar 2021 23:34:38 +0800 Message-Id: <20210302153451.19440-8-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 This adds a test case to test the new ofnode_phy_is_fixed_link() API. Both the new and old DT bindings are covered. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- arch/sandbox/dts/test.dts | 11 +++++++++++ test/dm/of_extra.c | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 2600360224..995c93c95a 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -478,6 +478,17 @@ fake-host-hwaddr = [00 00 66 44 22 22]; }; + fixed-link-test1 { + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + + fixed-link-test2 { + fixed-link = <0 1 1000 0 0>; + }; + firmware { sandbox_firmware: sandbox-firmware { compatible = "sandbox,firmware"; diff --git a/test/dm/of_extra.c b/test/dm/of_extra.c index b19cd3787d..d7c584fa33 100644 --- a/test/dm/of_extra.c +++ b/test/dm/of_extra.c @@ -36,3 +36,21 @@ static int dm_test_ofnode_read_fmap_entry(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_ofnode_read_fmap_entry, 0); + +static int dm_test_ofnode_phy_is_fixed_link(struct unit_test_state *uts) +{ + ofnode eth_node, phy_node, node; + + eth_node = ofnode_path("/fixed-link-test1"); + ut_assert(ofnode_phy_is_fixed_link(eth_node, &phy_node)); + node = ofnode_path("/fixed-link-test1/fixed-link"); + ut_asserteq_mem(&phy_node, &node, sizeof(ofnode)); + + eth_node = ofnode_path("/fixed-link-test2"); + ut_assert(ofnode_phy_is_fixed_link(eth_node, &phy_node)); + node = eth_node; + ut_asserteq_mem(&phy_node, &node, sizeof(ofnode)); + + return 0; +} +DM_TEST(dm_test_ofnode_phy_is_fixed_link, 0); From patchwork Tue Mar 2 15:34:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446114 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=PH9+uORm; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 ozlabs.org (Postfix) with ESMTPS id 4Dqh8140rFz9sS8 for ; Wed, 3 Mar 2021 02:37:05 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D8BB7826B9; Tue, 2 Mar 2021 16:36:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PH9+uORm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 42CA2827FA; Tue, 2 Mar 2021 16:36:04 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D66FF827D2 for ; Tue, 2 Mar 2021 16:35:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pj1-x102f.google.com with SMTP id c19so2176104pjq.3 for ; Tue, 02 Mar 2021 07:35:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+coUmpWPLSJuNDr56B/BLMwFsyNWaQXC228aS0NjHZU=; b=PH9+uORmaB6Ux90QJNDIWbwx4Zs9pyB3W5qeQYzQiO3V8bpoBKlztto8SQxpjQycVZ R3gZG/pSfBidufGbdUkPfz4VpjhjbnmbTD1Q0WFgDB6Kc7BCMC+VsC3GWZKWcXgC8z6F wlUs8kZpXDXFulCPrFkPuzZVp9B6aiPS3cm6hcwjkw7Or7DmNpoLfB4VGiK+gp1UEAin 0uCOdP5S1WsZMQx9bQttZa7mtDjZioNFlR/UkUyxg8jxAdsWfj12v8wzc0R2DieTFHa3 0MZd9XbFEkT3RFot/rscT2DuPTRLW0YYPIgO7wWrgaoxb8Ueo9HvrmMNHwQ6TSwIgS+L VK3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+coUmpWPLSJuNDr56B/BLMwFsyNWaQXC228aS0NjHZU=; b=KZKdx3zpzQ7y5bUl5+9IqVFSIbK1a2WiOvfWd3nyxkzeJ+xm17/35Y1gNLNWpFcsQd Lk+XlsyheVrVOgb0BIJzPJya1k9xd/QJi0efMy8aqsvK6sQESMz/i6uvTI10InbmwcsO 8MZoSdlkdU586oY2/rBtNKbFndjxbHNAoeMyJVqi3Vahh6DnKR0dRzI6o7CZbE9yFtYt 3IR3erV1j1nBVohGJBt4W8dWv1bxaFgByMPGiPm9grXE1/HNAGbwt9LDs468tUSrSyEg yuxz4SIWfSq3I+a6qS0DtHzfLEMuEqZu9JaSqqwrJy5yZftivezTVSwDmtsbugDbbuBP B/Ow== X-Gm-Message-State: AOAM532lSrvGAegCChKIy1S8uhag39jmXmxSTsFHWda1QByYkA4ci+6R ltZXGqoZd87mQIKSsy4LHjg= X-Google-Smtp-Source: ABdhPJzTQ1Z7+uV10udd+QrzXpovSaDNEswvqjdH02hfpRJQW83iwvJ9BkODHxjMJwDIeM1DzbwpWA== X-Received: by 2002:a17:90a:dd45:: with SMTP id u5mr5012892pjv.142.1614699353470; Tue, 02 Mar 2021 07:35:53 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.35.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:35:53 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng , Joe Hershberger , Ramon Fried Subject: [PATCH 08/20] dm: mdio: Use ofnode_phy_is_fixed_link() API Date: Tue, 2 Mar 2021 23:34:39 +0800 Message-Id: <20210302153451.19440-9-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 Switch to use the ofnode_phy_is_fixed_link() API which can support both the new and old DT bindings. Signed-off-by: Bin Meng Reviewed-By: Ramon Fried --- net/mdio-uclass.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mdio-uclass.c b/net/mdio-uclass.c index 5da984ca3f..2a9533c88b 100644 --- a/net/mdio-uclass.c +++ b/net/mdio-uclass.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -140,7 +141,7 @@ static struct phy_device *dm_eth_connect_phy_handle(struct udevice *ethdev, int i; if (CONFIG_IS_ENABLED(PHY_FIXED) && - ofnode_valid(dev_read_subnode(ethdev, "fixed-link"))) { + ofnode_phy_is_fixed_link(dev_ofnode(ethdev), NULL)) { phy = phy_connect(NULL, -1, ethdev, interface); goto out; } From patchwork Tue Mar 2 15:34:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446115 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=K6TktXFJ; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4Dqh8G3Qc0z9sS8 for ; Wed, 3 Mar 2021 02:37:18 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 05EAA8280D; Tue, 2 Mar 2021 16:36:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="K6TktXFJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D0C61827F5; Tue, 2 Mar 2021 16:36:09 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2DFA5827AB for ; Tue, 2 Mar 2021 16:35:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pj1-x1033.google.com with SMTP id c19so2176235pjq.3 for ; Tue, 02 Mar 2021 07:35:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ChfZSu3RbyomlJsvpDff7Gm6SgdruSNgR1ILnStpJKU=; b=K6TktXFJt0PgBZYN1sZSxdRln5hY9o2GMInCFhjC0wqKyGyVbkk1I307u1KGCBTQbK gEFPSgHx1WCDY1WIJFmJszL4Efw7fpWbwS8Y62ciB2ck1fL0g5Xejz8tC/+jU6hrRQ1Y pF4aTcds1RfUAHM7mHnUJWohWF2BMsxh6JlS2MtYyD00Nw75zsFBZjlqHtMTrzX8qG8u X3PjHczbKv6i2RRnZBiDSD0JNXAYXG4OgeTALXNb3C4ltU5yuuUdsX4xvww3CG9KBBRs bJISCsoYvPWNQN+GI5B1IRRhV8mtoHFgbHDBluJ5gUMq3KzwZNyqbyD+JQJZk5OHQb6K U0/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ChfZSu3RbyomlJsvpDff7Gm6SgdruSNgR1ILnStpJKU=; b=ugNlLcPdX8DZXJ/rM1YyLyNw4An1wA7rTiIttF1Npo3zXF5GmoBvcLcmqSXbK+jM8H 0wmYMhImzcLikvPgSF0X3pHpNShDVaraLJKBKKuS7GpWfNYYjt5YDl0U/2murjE4oTyE Fez4xBs6MzPMIMqyLVeT8tDtgO9tBCutfkw2TkPxnLUUNfN4QjtuVfC+YDpuAQ+2SbnT lHVDpZ5oRXWc4Ll+Dlqj1/M16jFTJb9EEknJk3Czc989cMzphWBca/38rkZrkU4Ml1Jk Y9ihUavb4LOI3rExQv+yxDgGYqGkXS2ksU+4QxD8rZEx+g00U1l668nlL0TAkPcxgEJa 4B0g== X-Gm-Message-State: AOAM531LdaZA+o3NfNGUEX9yDwuQU+3t+BuW4ArHuahxDOxdUs3gIMmd Bw7VFWceofhzvVsBTY04IvE= X-Google-Smtp-Source: ABdhPJyk58X2AyvTf3ntCtlxb8Dk5gX8mtlzO4duIVj4V90swOV4zEIf+I4wsCGAqwZMuBEBgPVkPw== X-Received: by 2002:a17:90a:f296:: with SMTP id fs22mr4841937pjb.17.1614699357607; Tue, 02 Mar 2021 07:35:57 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.35.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:35:57 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng , Joe Hershberger , Ramon Fried Subject: [PATCH 09/20] net: tsec: Use ofnode_phy_is_fixed_link() API Date: Tue, 2 Mar 2021 23:34:40 +0800 Message-Id: <20210302153451.19440-10-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 Switch to use the ofnode_phy_is_fixed_link() API which can support both the new and old DT bindings. Signed-off-by: Bin Meng Reviewed-By: Ramon Fried --- drivers/net/tsec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index ec48689372..24f9962b82 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -707,8 +708,7 @@ static int init_phy(struct tsec_private *priv) tsec_configure_serdes(priv); #if defined(CONFIG_DM_ETH) && defined(CONFIG_DM_MDIO) - if (ofnode_valid(ofnode_find_subnode(dev_ofnode(priv->dev), - "fixed-link"))) + if (ofnode_phy_is_fixed_link(dev_ofnode(priv->dev), NULL)) phydev = phy_connect(NULL, 0, priv->dev, priv->interface); else phydev = dm_eth_phy_connect(priv->dev); From patchwork Tue Mar 2 15:34:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446116 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Rg7YTFqS; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 ozlabs.org (Postfix) with ESMTPS id 4Dqh8V41cSz9sS8 for ; Wed, 3 Mar 2021 02:37:30 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 793F2827F5; Tue, 2 Mar 2021 16:36:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Rg7YTFqS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 976C682804; Tue, 2 Mar 2021 16:36:12 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 91A1582790 for ; Tue, 2 Mar 2021 16:36:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pg1-x529.google.com with SMTP id g4so14073051pgj.0 for ; Tue, 02 Mar 2021 07:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9k4/WrKqQ2fK9yiOlZKiLnF2KwRA3J8q9CgaDhOfG9w=; b=Rg7YTFqSRWnrq8v4KVmZJHJf4RB78PLBq8kf05llk30WzIVxyx+dWo4ucD63bBrxto xEA3Gg7LKOkNAy7ie9NryAR+P/nV0FkeZk6qGO0IOjkvqjs9C9y8cWvjnOp1sYIklxXu ELjFSKGgT3zoOVPJ7YrTvs31xePrhIcgT5fDY7K6hkMqWfDo978KCJAFme3SjAP9jRir wncPVXfgyNmV89ghUyE4cXKgedppq43QpKujr3QX8ahPZTX664adSE1LYqKTxnVF6wIA vqYpZn1/iSd/zaD5rz11GvVobUG99aA6gj6mNgLcn2AnNtL2jGDgUlTmT+GJk17MoY8C bWJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9k4/WrKqQ2fK9yiOlZKiLnF2KwRA3J8q9CgaDhOfG9w=; b=eEjjq5yPoHEFb68fKM1Q77RuQ4htyjlnDqW0Mrwu1Qv0f8hnPxFbF7A9qHO22s6Q/8 0YVRIzYv4cVxTTMtTrddwatLQSZUab8utB6sYSD7vJjMmyTEFP90kgIWqOulvQHL5YsQ 7BlkM0FAKvUJOwp2QYJMUVVt69/m6PlRtowO3eS5mANol3lgC2TFDXOU3V5AwG194N6f NSssfDHO2krFjgCbWOv06qMc/XYZvt9iyIIPnr5JrjfPj8cWh+xg7J/AanvBatvAAvkL u8Qx25AVM77fY33G26nrBSpzUC3Mw3dRsqoGhJ3iE0sJ0stEATKWxsCzQ6bvFmpDzF4m VKfA== X-Gm-Message-State: AOAM532UoBJt7R6K1NNpBROTVZEVSpEiSqT882j7vmBD94lvTZ2AIKIw r9g5qkZElLuUmPv6BNxgTZA= X-Google-Smtp-Source: ABdhPJxpVhiOXi80/hwBQlTz4B3/bRiFHMY+WVH1AA8BtNe5TT88S8sq2E+tm5DK8HS+8tP2OY7dPA== X-Received: by 2002:aa7:9d9b:0:b029:1ed:6c08:b93c with SMTP id f27-20020aa79d9b0000b02901ed6c08b93cmr3749643pfq.37.1614699363966; Tue, 02 Mar 2021 07:36:03 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:36:03 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng , Andre Przywara , Florin Chiculita , Joe Hershberger , Ramon Fried , Samuel Mendoza-Jonas , Stefan Roese , Vladimir Oltean Subject: [PATCH 10/20] net: phy: Simplify the logic of phy_connect_fixed() Date: Tue, 2 Mar 2021 23:34:41 +0800 Message-Id: <20210302153451.19440-11-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 Simplify the logic of phy_connect_fixed() by using the new API ofnode_phy_is_fixed_link(), which brings additional bonus of supporting the old DT bindings. Signed-off-by: Bin Meng Reviewed-By: Ramon Fried --- drivers/net/phy/phy.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 69e02685fa..0e85a80761 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -1002,19 +1003,12 @@ static struct phy_device *phy_connect_fixed(struct mii_dev *bus, phy_interface_t interface) { struct phy_device *phydev = NULL; - ofnode node = dev_ofnode(dev); - const char *name; + ofnode eth_node = dev_ofnode(dev); + ofnode phy_node; - node = ofnode_first_subnode(node); - while (ofnode_valid(node)) { - name = ofnode_get_name(node); - if (name && strcmp(name, "fixed-link") == 0) { - phydev = phy_device_create(bus, ofnode_to_offset(node), - PHY_FIXED_ID, false, - interface); - break; - } - node = ofnode_next_subnode(node); + if (ofnode_phy_is_fixed_link(eth_node, &phy_node)) { + phydev = phy_device_create(bus, ofnode_to_offset(phy_node), + PHY_FIXED_ID, false, interface); } return phydev; From patchwork Tue Mar 2 15:34:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446117 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Uc4WTPst; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 ozlabs.org (Postfix) with ESMTPS id 4Dqh8j5WWJz9sS8 for ; Wed, 3 Mar 2021 02:37:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 36025827FA; Tue, 2 Mar 2021 16:36:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Uc4WTPst"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5995682822; Tue, 2 Mar 2021 16:36: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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9827782807 for ; Tue, 2 Mar 2021 16:36:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pl1-x636.google.com with SMTP id u11so12215867plg.13 for ; Tue, 02 Mar 2021 07:36:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3b9DOPuFL+tGvopr7aY+hTbIEURn2Zz0+xAGfjd7BQM=; b=Uc4WTPstHhguraXcg8znX84GK94CpA3VPhCwfdy+uOPfEQUfYkJ5ATFgU37CyDusko GRVPU9MH8ImwxB3+JJrGmAu8KxAHSJS/wxiK3UXXVet7uuabk2VhoTTUBCiH1R9XPu/L NmoIXJ74T6vCXj3aOtjLNjC42MjFqXvtSL3jfRXwJeOPAWNQgTFVOicdwmeVA+3wI1mV pBpiPz32iJDAgbDnaE4JpsG2ksCXS9/VJFTUZUb5zrTW/E7KR6fRipM8qntArB0vO0T0 xbdhXE1o3XF7DaVh3XtquJIgE5GmQTygle1iDbl7SJK2zMQKBPdCedgf5CM03+EGM4Ef evzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3b9DOPuFL+tGvopr7aY+hTbIEURn2Zz0+xAGfjd7BQM=; b=UMHXcutNca6c3YED1AuzdEE6NIUn6pt94LB91QUFjo6od2nYsNIJlf8hZZZ5oP1r+2 f3l2f2WohHbNg0GQk4LCcfo4XgV+IV+o02qc9HQwTkWXoXfSMDed/YY72zXz1h6GiCzF vFwFE9EmoiUVgD/mq26uOgN5q7QHg+YLw9SMoTczmvGyUQcoGH5a9/SlT0b1+AoKPLWX RaUtwWHLcJAWgRn9vzDy0pQkrX8cnF/eSyLSp4mf1hm+mgYKGEYzoI67SJzMo/IEnsuD IlVzH22nfi8nQDRXunlMZ6ZWVS62ILYxiEwzE2N9xhVhSz0eWAUjy/mMJm3xjauzBYC/ r2gQ== X-Gm-Message-State: AOAM533KoVXLZQ8kJCDsy81CDXl6B4DyePMq30wFDhRAH4nYRpgW+gLF VvSvkRf8A0aQHO83isFLMxk= X-Google-Smtp-Source: ABdhPJwm7RVSeLuY2FL1mgJJidz82ciAd2plbFh7k/uvbQWHUhRR4DP6T/t6IoexuqHG900HNcMBNg== X-Received: by 2002:a17:902:124:b029:e3:fe16:fdf5 with SMTP id 33-20020a1709020124b02900e3fe16fdf5mr4216228plb.1.1614699368214; Tue, 02 Mar 2021 07:36:08 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.36.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:36:07 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng , Claudiu Manoil , Joe Hershberger , Ramon Fried , Vladimir Oltean Subject: [PATCH 11/20] net: phy: fixed: Make driver ops static Date: Tue, 2 Mar 2021 23:34:42 +0800 Message-Id: <20210302153451.19440-12-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 The PHY driver ops should be made static. Signed-off-by: Bin Meng Reviewed-By: Ramon Fried --- drivers/net/phy/fixed.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c index 1a38c29469..2a41baf8d7 100644 --- a/drivers/net/phy/fixed.c +++ b/drivers/net/phy/fixed.c @@ -15,7 +15,7 @@ DECLARE_GLOBAL_DATA_PTR; -int fixedphy_probe(struct phy_device *phydev) +static int fixedphy_probe(struct phy_device *phydev) { struct fixed_link *priv; int ofnode = phydev->addr; @@ -48,7 +48,7 @@ int fixedphy_probe(struct phy_device *phydev) return 0; } -int fixedphy_startup(struct phy_device *phydev) +static int fixedphy_startup(struct phy_device *phydev) { struct fixed_link *priv = phydev->priv; @@ -61,7 +61,7 @@ int fixedphy_startup(struct phy_device *phydev) return 0; } -int fixedphy_shutdown(struct phy_device *phydev) +static int fixedphy_shutdown(struct phy_device *phydev) { return 0; } From patchwork Tue Mar 2 15:34:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446118 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=OZPOYO5h; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 ozlabs.org (Postfix) with ESMTPS id 4Dqh8y0hPfz9sS8 for ; Wed, 3 Mar 2021 02:37:53 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B91D48282D; Tue, 2 Mar 2021 16:36:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OZPOYO5h"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B1F4082817; Tue, 2 Mar 2021 16:36:20 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4F1A18280F for ; Tue, 2 Mar 2021 16:36:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pf1-x42f.google.com with SMTP id q20so14056633pfu.8 for ; Tue, 02 Mar 2021 07:36:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6/mN/OwAquXzBcRydha+Z6lVu2zVIFRcImaMhFHpMqs=; b=OZPOYO5heRwhgtYt9SV1SZpdIeKveRePK2dYnmZRp0BMGygxyEwmmr16VTmIdZi1xQ br1fUNv8deVTwfEbyPcI0wIXj9rPL6WW/2sTN1F9RsGDquYR+65EeO4SwGkwbEhcdnwp k74S8uSQt6O5xE84Cj8+986e+Qmn0B6TD9gjN2BBf3fpwzBZXitnhRPi3Saz+wYHMbri gsZhmUmhZwg+RLbsG6W6K+ug9jkNKh0nwpM5+Nn0rRfhp2/btINzIInn95ncVO2MzcMq OoA2OC5MxU7vC/Tkwy9cDGkSxXEvpieTGB05j9KmsNJC/4lRVjQSNY3FmNAWcgtNEOMq IE5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6/mN/OwAquXzBcRydha+Z6lVu2zVIFRcImaMhFHpMqs=; b=gXktJ5JKxF5BV/hwqKAZdJXS4Xx+5U3PVOcbMiIQL7fEw4dfroFVqOoOderyj4zD1T oIbN6elw3OIqVi7alERBczzglYm9078AKnqwFYAm4g6nE676eS2A9m/Ah+pA4QE2aNw5 Q9O62muc55Fb6wzNABPqs3km+jmJyJSFMcyKdN0iG1MP8sC1SJZ2qT+Lrp2Brk3SOFrE uNELmM8Y8VkpC1GhM4+ZXTUjsijPov7p+ce5OPwvTLmMpVwWG1RX5eWh7e2HH1wLxt2y 9clL4ly8avi37+aEKlx+MIQUsHRulE3eWflEiCSretth8eVyO84CqjsXUXDoxEABgVLk KZaQ== X-Gm-Message-State: AOAM533UJvLefFWyqS0V5kVsl/9Upt4Mm1qQLSeCSBtrqHP0zDRuGq+t JZ246RjzazRJTZUDb4+G9e0= X-Google-Smtp-Source: ABdhPJy4tSEb3vCeb0GpmbIgEtWmybY2ebR5d/k8J4GBJzU51PcSMv0mBsChROyO9figJA/wY1h9MA== X-Received: by 2002:a62:cf06:0:b029:1ed:c016:1e7f with SMTP id b6-20020a62cf060000b02901edc0161e7fmr3708007pfg.78.1614699372822; Tue, 02 Mar 2021 07:36:12 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.36.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:36:12 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng , Claudiu Manoil , Joe Hershberger , Ramon Fried , Vladimir Oltean Subject: [PATCH 12/20] net: phy: fixed: Add the missing ending newline Date: Tue, 2 Mar 2021 23:34:43 +0800 Message-Id: <20210302153451.19440-13-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 The printf statement doesn't end with a newline. Add it. Signed-off-by: Bin Meng Reviewed-By: Ramon Fried --- drivers/net/phy/fixed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c index 2a41baf8d7..8fc9c66684 100644 --- a/drivers/net/phy/fixed.c +++ b/drivers/net/phy/fixed.c @@ -26,7 +26,7 @@ static int fixedphy_probe(struct phy_device *phydev) ofnode, 0, "speed", 0); if (val != SPEED_10 && val != SPEED_100 && val != SPEED_1000 && val != SPEED_2500 && val != SPEED_10000) { - printf("ERROR: no/invalid speed given in fixed-link node!"); + printf("ERROR: no/invalid speed given in fixed-link node!\n"); return -EINVAL; } From patchwork Tue Mar 2 15:34:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446119 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=FxnME5nU; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4Dqh985qQ6z9sS8 for ; Wed, 3 Mar 2021 02:38:04 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD21C8276B; Tue, 2 Mar 2021 16:36:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FxnME5nU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4438C82828; Tue, 2 Mar 2021 16:36:25 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D6A1282721 for ; Tue, 2 Mar 2021 16:36:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pg1-x529.google.com with SMTP id h4so14010286pgf.13 for ; Tue, 02 Mar 2021 07:36:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bba47dGjP/lhvg4STnZhgzIDScHZ4X00jHKdi+kyiYU=; b=FxnME5nUm75ovQs9BOUCwNX3TlsNKWiuuqeKY42ZZFp2Y9ZxPxxWFx/0/lvv8sppDv vyWUO7ilwd3YE/OWmc+iDfWs/yS0FRJ0hcjsnB0zk5F6QKXNqzq15tTl0nSS8kkMqFwB KU7bG0kE753fAcKDeTu/KrXP0VDtLHzppSzveShZdeTgXoEOMYmR5V7dXIXgIsby7Q4U Dg9vXlD/kkL6103yH+9mvvn65pHnkQnc4TgM/Cpx9RbT3n6/LNPdeqtYhxTGeHESCbt0 Y8crpJ5SsW/LVA3uSZwGr/36FKtvrtXcBgoMuj47CW7+xaqloQqfuGyiFuENhByX1IJj jU4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bba47dGjP/lhvg4STnZhgzIDScHZ4X00jHKdi+kyiYU=; b=t6hT9WlmGJWacTPqK5Za3aIF/EYtsJWT2NFx/ysG5AbyZqje/whkPnNPthaCzLqUnp LODMZshJXCaA45fUHIaEo+oE3AmpPgR4soX4HSyoPKWxXi81ODJiuB0DLPu5+nneh4w6 XgN7kyXxFX/2GWVFHGS4noUd7VXJAmiGIYc4OJJU5IdtrIYRyft2RhRwgbFKEL4IPNKV 5z5D7jBAAk2B2xOnhFRljZuKfgUpKXrC5aFWZW312JApDHLsev/tefj5ER0Z6j2Y9oIm 63K4FSaLmfwVu7DxUjQ+bJ2tpF4f2JejqbeHhQxgaGcRjKBsYLGx1do/J65wtdkjkUOz 0VSw== X-Gm-Message-State: AOAM53124Lc0876sj1iqilKrL/XicGE5ZJiFtQnzyRaxn7mxw8KcdSlL 9tPIGvPJI+EGdbOoFUTXKXcQWXmQwio= X-Google-Smtp-Source: ABdhPJyEkmjIxfZnbgVk8hn8/v0yx3NCiSbVaeUfLEf1IJfLkXwcR6BvqSw25SC/Jv3oiMW3YHAn6Q== X-Received: by 2002:a05:6a00:847:b029:1b3:b9c3:11fb with SMTP id q7-20020a056a000847b02901b3b9c311fbmr3706960pfk.44.1614699377422; Tue, 02 Mar 2021 07:36:17 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.36.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:36:17 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng , Claudiu Manoil , Joe Hershberger , Ramon Fried , Vladimir Oltean Subject: [PATCH 13/20] net: phy: fixed: Support the old DT binding Date: Tue, 2 Mar 2021 23:34:44 +0800 Message-Id: <20210302153451.19440-14-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 Update fixedphy_probe() to support the old DT binding. Signed-off-by: Bin Meng Reviewed-By: Ramon Fried --- drivers/net/phy/fixed.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c index 8fc9c66684..6b720c7e4e 100644 --- a/drivers/net/phy/fixed.c +++ b/drivers/net/phy/fixed.c @@ -19,11 +19,25 @@ static int fixedphy_probe(struct phy_device *phydev) { struct fixed_link *priv; int ofnode = phydev->addr; + bool old_binding = false; u32 val; + u32 old_val[5]; /* check for mandatory properties within fixed-link node */ val = fdt_getprop_u32_default_node(gd->fdt_blob, ofnode, 0, "speed", 0); + + if (!val) { + /* try old binding */ + old_binding = true; + if (fdtdec_get_int_array(gd->fdt_blob, ofnode, "fixed-link", + old_val, ARRAY_SIZE(old_val))) { + printf("ERROR: no/invalid property!\n"); + return -ENOENT; + } + val = old_val[2]; + } + if (val != SPEED_10 && val != SPEED_100 && val != SPEED_1000 && val != SPEED_2500 && val != SPEED_10000) { printf("ERROR: no/invalid speed given in fixed-link node!\n"); @@ -38,9 +52,18 @@ static int fixedphy_probe(struct phy_device *phydev) phydev->priv = priv; priv->link_speed = val; - priv->duplex = fdtdec_get_bool(gd->fdt_blob, ofnode, "full-duplex"); - priv->pause = fdtdec_get_bool(gd->fdt_blob, ofnode, "pause"); - priv->asym_pause = fdtdec_get_bool(gd->fdt_blob, ofnode, "asym-pause"); + if (!old_binding) { + priv->duplex = fdtdec_get_bool(gd->fdt_blob, ofnode, + "full-duplex"); + priv->pause = fdtdec_get_bool(gd->fdt_blob, ofnode, + "pause"); + priv->asym_pause = fdtdec_get_bool(gd->fdt_blob, ofnode, + "asym-pause"); + } else { + priv->duplex = old_val[1]; + priv->pause = old_val[3]; + priv->asym_pause = old_val[4]; + } /* fixed-link phy must not be reset by core phy code */ phydev->flags |= PHY_FLAG_BROKEN_RESET; From patchwork Tue Mar 2 15:34:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446120 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=YOW2VbgM; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4Dqh9N6T5vz9sS8 for ; Wed, 3 Mar 2021 02:38:16 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D867982821; Tue, 2 Mar 2021 16:36:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YOW2VbgM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1FF6082829; Tue, 2 Mar 2021 16:36:27 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0BB7A8280F for ; Tue, 2 Mar 2021 16:36:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pl1-x62c.google.com with SMTP id k22so12237778pll.6 for ; Tue, 02 Mar 2021 07:36:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0Y2uKj4zgo2oSRkHRlmrmPon6n7d4t5yMDrRE3V0r2c=; b=YOW2VbgMLlNG0IhJ/4fkoNXTPOf8Ww+ZSp0WS1hLmJYoP4Qol/FwjRmHAxlrduBbTI hmJRj2K7zZfWNSY9SWEZjJsbOXUCldgCgEUI5uHW1tzmDbERwTa+TzqOkzB/C1sf6Sz6 tKAidzopmNKKlJBK8y4dedrHMOMx7dJzVv5q7dK+6WcqkefnfmNl3nMZicbWbCVXYKFS vH9fHGqUKfnhjkMyi2M4HEtQ0v9fsFdV1tw4Qb+NNEzsa7P+SnfmkVpSYStaGTzvdwOJ 1CqlTBHe5kxNtscddPgak942gqAsO3/hEajwxz4uXiDJb7HCyAhZRRks72Pk52RwavU2 GdHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0Y2uKj4zgo2oSRkHRlmrmPon6n7d4t5yMDrRE3V0r2c=; b=jWGZLL2irDzrZdcuRSwrxb/B/EZNjRxCdRBR1fJyHP/xzFTZYKwnUKeQK9pvdQK6DC wz7/eVFePZNqc/HLVus1aHIgRmU1C9zFO2Jmg2ALQs9N9H/am+2hemPv7JgdkKH3fZHA V5L1woXVpGCIljpmNqP7YpZaN8/JA5VWALacdBbqTfEOAN19WC97b/vkuRIgC4eNC8Hc Pn0X9WvS1HsbyJ3gJGw0IXNFS3sCuOEkx8OWLLRulRMmvQiKjWcotc+hSBpy3ggHx8a2 IePUR4SHxlnKllCTQLpxmkG7MJLiywNvav/QT9t5axJ4nRdvDeD9A+H7Gmx6tTTvrjSX 1Sfg== X-Gm-Message-State: AOAM532TkIDFon4QwCswoXMXQUezdf5LMaXVjmie0dC0qtu94/uaUEJV QhQAnXTu2PiFNazUMWvIVV8= X-Google-Smtp-Source: ABdhPJyK4ez/n7D8AFY9biteiYEZMkVtIrx4yU7fUIzuuUO89jmHIcKUByKV8Ck7Bn2RQzazxGDMrw== X-Received: by 2002:a17:90a:d3d8:: with SMTP id d24mr1529590pjw.28.1614699381568; Tue, 02 Mar 2021 07:36:21 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:36:21 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng , Hou Zhiqiang , Vladimir Oltean Subject: [PATCH 14/20] dt-bindings: net: Update Freescale TSEC to support "queue-group" Date: Tue, 2 Mar 2021 23:34:45 +0800 Message-Id: <20210302153451.19440-15-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 At present the Freescale TSEC node DT bindings doc requires a property in the TSEC node. But this might not always be the case. In the upstream Linux kernel, there is no DT bindings doc for it but the kernel driver tests a subnode of a name prefixed with "queue-group", as we can see from gfar_of_init(): for_each_available_child_of_node(np, child) { if (!of_node_name_eq(child, "queue-group")) ... in drivers/net/ethernet/freescale/gianfar.c Update our DT bindings to describe this alternate description. Signed-off-by: Bin Meng Reviewed-By: Ramon Fried --- doc/device-tree-bindings/net/fsl-tsec-phy.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/device-tree-bindings/net/fsl-tsec-phy.txt b/doc/device-tree-bindings/net/fsl-tsec-phy.txt index a44c5fd9d9..2f9309839c 100644 --- a/doc/device-tree-bindings/net/fsl-tsec-phy.txt +++ b/doc/device-tree-bindings/net/fsl-tsec-phy.txt @@ -3,7 +3,9 @@ Properties: - compatible : Should be "fsl,etsec2" or "gianfar" - - reg : Offset and length of the register set for the device + - reg : Offset and length of the register set for the device. If this is + missing, a subnode with a name prefix "queue-group" must be provided to + provide the property. - phy-handle : See ethernet.txt file in the same directory. - phy-connection-type : See ethernet.txt file in the same directory. This property is only really needed if the connection is of type "rgmii-id", @@ -18,6 +20,17 @@ Example: phy-connection-type = "sgmii"; }; +An alternate description with "queue-group" subnode example: + ethernet@24000 { + compatible = "fsl,etsec2"; + phy-handle = <&phy0>; + phy-connection-type = "sgmii"; + + queue-group { + reg = <0x24000 0x1000>; + }; + }; + Child nodes of the TSEC controller are typically the individual PHY devices connected via the MDIO bus (sometimes the MDIO bus controller is separate). From patchwork Tue Mar 2 15:34:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446121 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=pWYnlRO8; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 ozlabs.org (Postfix) with ESMTPS id 4Dqh9b0GMtz9sS8 for ; Wed, 3 Mar 2021 02:38:26 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F29C2827BE; Tue, 2 Mar 2021 16:36:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pWYnlRO8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 458D682834; Tue, 2 Mar 2021 16:36:33 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6AAD082828 for ; Tue, 2 Mar 2021 16:36:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pf1-x430.google.com with SMTP id e3so10066411pfj.6 for ; Tue, 02 Mar 2021 07:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dYUrPIM7c44DLntKUmcUGcs2g5P2AQymaF7PKEIYsjY=; b=pWYnlRO8qPoK7oGExjtK/sX5k7DoqbdFAb0PMYukr0bAwG2a2pQISUbxAphTsYhsYE wcdr1kWbxeAo4pq2co2zWs9h/Y2ycl5faDIfsaa24eZLDALIFpAdVDGHHm0xen0zR3JR AiHWk9FdVin9vdSdZz2y5Y/OXPZ3Q3/k/aJqQ7TCqksW7JHPdmlsYW/Coa9zOJJPeIXm QnEyAhcItkJPp9mhqyH/2hGa/Jcme6BFJ7+LPEPLyHzIfcE4QO8fLSlld0EmODla3EK9 yQSBb3flg+KUZWTrfDAzDLScmgQUf9YhLJ50WTz7zBH57vMiHwcMIG1mheUEZShn33PS CkJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dYUrPIM7c44DLntKUmcUGcs2g5P2AQymaF7PKEIYsjY=; b=oGqN9LTUnrqCTIf0nX2aCsSOrpNffXfljgeuYgsEbm7Oepx73ZSbi7pbN6jVIRE1jK xN2k/0TtIhnNX3CJZJZ+dmSVs3LdR8l4uDGgUHWGNCm4kKvfPz4keGk10e/zh3UcUZJp U7YONnxjXLIZEzI1FqfhGRoZznb6jrY7WD55Ggk+jts9sUVBeRLDkv2xgL6AV9xwcaSL /HDA58fXMLuAStIrDd1WvTxVAA1y88l7gqBhkJX7YTQc+FrcIfDdA9yWI814WcAoZuNM dy0wDfwmW7Mjw5Nm52UItmkBHTk2WG3G2dQTmiGktuKM+lV2hzdrTZp5DBI378JZ4yjw oL7w== X-Gm-Message-State: AOAM533P2kXJyGhbaFAnRvj7D058IuAf6Mu18FUKwejsmn8KEr9USF1l gfgoWLHmGk+PtrmOT73mdW4= X-Google-Smtp-Source: ABdhPJwTD97xPeU2912tIE//9nF+YzeyYWjmGjt9OwhqEnM8dzynOdRSwGGOdGEETiY2fb6QphpfDg== X-Received: by 2002:a63:ee4e:: with SMTP id n14mr18493023pgk.422.1614699386018; Tue, 02 Mar 2021 07:36:26 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:36:25 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng , Joe Hershberger , Ramon Fried Subject: [PATCH 15/20] net: tsec: Support property from the subnode "queue-group" Date: Tue, 2 Mar 2021 23:34:46 +0800 Message-Id: <20210302153451.19440-16-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 At present the tsec driver uses a non-standard DT bindings to get its base / size. The upstream Linux kernel seems to require the base / size to be put under a subnode of the eTSEC node with a name prefix "queue-group". This is not documented in the kernel DT bindings, but it looks every dtsi file that contains the eTSEC node was written like this. This commit updates the tsec driver to handle this case. Signed-off-by: Bin Meng Reviewed-By: Ramon Fried --- drivers/net/tsec.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 24f9962b82..5012cd29f1 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -831,13 +831,35 @@ int tsec_probe(struct udevice *dev) struct tsec_data *data; const char *phy_mode; fdt_addr_t reg; - ofnode parent; + ofnode parent, child; int ret; data = (struct tsec_data *)dev_get_driver_data(dev); pdata->iobase = (phys_addr_t)dev_read_addr(dev); - priv->regs = dev_remap_addr(dev); + if (pdata->iobase != FDT_ADDR_T_NONE) { + priv->regs = dev_remap_addr(dev); + } else { + ofnode_for_each_subnode(child, dev_ofnode(dev)) { + if (!strncmp(ofnode_get_name(child), "queue-group", + strlen("queue-group"))) { + reg = ofnode_get_addr(child); + if (reg == FDT_ADDR_T_NONE) { + printf("No 'reg' property of \n"); + return -ENOENT; + } + pdata->iobase = reg; + priv->regs = map_physmem(pdata->iobase, 0, + MAP_NOCACHE); + break; + } + } + + if (!ofnode_valid(child)) { + printf("No child node for ?\n"); + return -ENOENT; + } + } ret = dev_read_phandle_with_args(dev, "tbi-handle", NULL, 0, 0, &phandle_args); From patchwork Tue Mar 2 15:34:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446122 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=aS070sIb; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4Dqh9n5RDZz9sVw for ; Wed, 3 Mar 2021 02:38:37 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 650778284C; Tue, 2 Mar 2021 16:36:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aS070sIb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2427482828; Tue, 2 Mar 2021 16:36:35 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EF4C68281E for ; Tue, 2 Mar 2021 16:36:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pj1-x1036.google.com with SMTP id i14so2171444pjz.4 for ; Tue, 02 Mar 2021 07:36:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iftFm+NOy4IxvfiBuW7uN86a4tTVKR54cArWeANIaPY=; b=aS070sIbNcITUm++6kyYWRf3jXMOVGbRyFdS2PxVzxv/IpXyGAHIjUzc8sgFYEL7nU cXrYibctx+nve9Ndszkolk00bsQTXn0B8oIXoOwNOqpwWlPiTT6Umr+7F6DRS7WIJWOm 66y5KwAJCqphEMH3+fgZT+J8ykA9sejyIMiGVHNaXUVOsUtlENR/+/X8XGlNNJVOQSEW QqFLAxvflUfHzN31Ml/6AZ1o7sRUK+yOVJKCqt+g/J717g3tkLTj3xPA1Ot/BZusdSdI ofVg7HMFIPv9rt0bBViyXSWI6+9e0Nq3hcvpb69mGrOkmP1qLX7/14zyKbk8qGjQRSBl imsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iftFm+NOy4IxvfiBuW7uN86a4tTVKR54cArWeANIaPY=; b=bBUOwBL4PuuUqa6ErfKM1BP5dnWTERJtBovSncDuc+b9gxRt0yNWQoMVza43XfdG8w 6w3tn67EQLH4lfukUQ5TnI8T8+Esj64DEn7QlWGr9dlyfjIB36Faj4TAWNlLWPgjMrqH d/EN0dfBrpckrbPYv9mAwV8W3miOJjjgnpPFI4YYqPAzqE/E3uRPDpxHkI0mhR6Qkner yES4ydk0YgoucI8qQZZOgGHx11f6PNEZcNU1Zy5sSX32X+zl0jm8YbD35mOGzUULMeXS gA3poFip6sXTIfQJwhUqLAuIAwAeG4o891/gy48LGgJO9IY3D+6xOnlHpp1k1idzBPer ovSQ== X-Gm-Message-State: AOAM533cvol7iZ6C2gcFO4qxEp+o0UYIPLufUJpneOb4oO99YVUW65rF Uks6OHXoZqH9Peo717XuKyA= X-Google-Smtp-Source: ABdhPJzytakht6wv/e0/KoGowIRY+ZU+QjPKLRoYhmY28w7STSqbo6nYkhUwK6A2h7nj5JV/EOFOCw== X-Received: by 2002:a17:90a:1a16:: with SMTP id 22mr5211951pjk.34.1614699389616; Tue, 02 Mar 2021 07:36:29 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.36.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:36:29 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng Subject: [PATCH 16/20] dm: core: Correctly read of simple-bus Date: Tue, 2 Mar 2021 23:34:47 +0800 Message-Id: <20210302153451.19440-17-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 At present we decode simple bus using the following assumption: - parent #address-cells 1 - child #address-cells 1 - child #size-cells 1 However this might not always be the case. Update to use fdt_addr_t and fdt_size_t in 'struct simple_bus_plat', and use fdt_read_ranges() to correctly decode it according to the actual parent and child #address-cells / #size-cells. Signed-off-by: Bin Meng --- drivers/core/simple-bus.c | 15 ++++++++++----- include/dm/simple_bus.h | 6 +++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/core/simple-bus.c b/drivers/core/simple-bus.c index b0c2c20958..b5863f2b2c 100644 --- a/drivers/core/simple-bus.c +++ b/drivers/core/simple-bus.c @@ -6,6 +6,9 @@ #include #include #include +#include + +DECLARE_GLOBAL_DATA_PTR; fdt_addr_t simple_bus_translate(struct udevice *dev, fdt_addr_t addr) { @@ -22,16 +25,18 @@ static int simple_bus_post_bind(struct udevice *dev) #if CONFIG_IS_ENABLED(OF_PLATDATA) return 0; #else - u32 cell[3]; + uint64_t caddr, paddr, len; int ret; - ret = dev_read_u32_array(dev, "ranges", cell, ARRAY_SIZE(cell)); + /* only read range index 0 */ + ret = fdt_read_range((void *)gd->fdt_blob, dev_of_offset(dev), 0, + &caddr, &paddr, &len); if (!ret) { struct simple_bus_plat *plat = dev_get_uclass_plat(dev); - plat->base = cell[0]; - plat->target = cell[1]; - plat->size = cell[2]; + plat->base = caddr; + plat->target = paddr; + plat->size = len; } return dm_scan_fdt_dev(dev); diff --git a/include/dm/simple_bus.h b/include/dm/simple_bus.h index 4ad4cc4051..b7104013c0 100644 --- a/include/dm/simple_bus.h +++ b/include/dm/simple_bus.h @@ -7,9 +7,9 @@ #define __DM_SIMPLE_BUS_H struct simple_bus_plat { - u32 base; - u32 size; - u32 target; + fdt_addr_t base; + fdt_size_t size; + fdt_addr_t target; }; #endif From patchwork Tue Mar 2 15:34:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446123 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=CMdBHz+/; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4DqhB023jCz9sS8 for ; Wed, 3 Mar 2021 02:38:48 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E874482858; Tue, 2 Mar 2021 16:36:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CMdBHz+/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 27A908284F; Tue, 2 Mar 2021 16:36:42 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 62B5A827D3 for ; Tue, 2 Mar 2021 16:36:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pg1-x529.google.com with SMTP id o38so14029340pgm.9 for ; Tue, 02 Mar 2021 07:36:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6Jrp2Jrux9BTUv8Yw/6WJGtV1x4Btkc/JG7lrOcXp14=; b=CMdBHz+/alrCZegFqpI/+3e837pd+OW9klYVuNregDVtlIvgoIJdDvlHHnpWSrnCp5 rDrHO4JF74Ah39rDP2QPHRqQl+1+tunUXJxEijZoXgSW4tRjwxJ2Tppgi88B5+bVUcOi DS9DwY50zywaZH+rg86uOXT0K8wbTxK+zVOD4yp/Iqje4wQUXMbUCLCBwIGJuw35MzQV w94pV2p2l0WimpeqRyNJuq1x2d3IRuADRiy+z9/PsmytYDX9sjlpWxcQDN+76FzdJMKk Oe5Gsi5HDNa2G3PvoAEAcn8oIcqObAgU/0ZaiZbpYVQbE0l9fXxm7Ac71CJc7q/8/XSv w+Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6Jrp2Jrux9BTUv8Yw/6WJGtV1x4Btkc/JG7lrOcXp14=; b=TAL6U0nhdEqfSW6PTJRvWSq11KRk06OWCU7RiZSNVOxcuM4oanH8FEL30JI0+z72d5 TPESowP+86QF1cU8SaPDQrvwsbzw/V+NjvVf3Q6KeYLpSS7I+AvoLEjrOSFfx+UO6xUp kzleWmO21fZvbXGrwJxfp57tG0mJfr26Aofdwfi0iP75dhkWLtPk1CMB32m4LPfRqiBC 2inRNOiGgUgdhMDUihnOcbxCgqCcJeFRhWlN0Gx0TXj+IwoT2FUxSzPDkJkugoxdPdwq 7VnarFp0T5OonUzDqL69R84tGBxC/uL+uhF2HyEOl/lsupYLNMc7eDo9dgAvy6MvIXfR 4G8g== X-Gm-Message-State: AOAM532pWKbPTQu5bid9pnAlBsUPBLJniMzt1aSO0nlV2rmIbuW6q9CF 9Va3TmaisjEsrGK1WPTd7hI= X-Google-Smtp-Source: ABdhPJxAe1TFPAmPtv9kZPEFwS1ZW6FJ4yYuQBmTfBjno6+dYzEWdxkhxPVQ/mIbPE8OgvTGTG4ScA== X-Received: by 2002:a05:6a00:2c5:b029:1ee:6ebb:a9a6 with SMTP id b5-20020a056a0002c5b02901ee6ebba9a6mr13148010pft.74.1614699394022; Tue, 02 Mar 2021 07:36:34 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.36.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:36:33 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng Subject: [PATCH 17/20] test: dm: Add a test case for simple-bus Date: Tue, 2 Mar 2021 23:34:48 +0800 Message-Id: <20210302153451.19440-18-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 This adds a test case to verify reading of a simple-bus is working as expected. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- test/dm/Makefile | 1 + test/dm/simple-bus.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 test/dm/simple-bus.c diff --git a/test/dm/Makefile b/test/dm/Makefile index 6275ec56ea..1e92625105 100644 --- a/test/dm/Makefile +++ b/test/dm/Makefile @@ -89,6 +89,7 @@ obj-$(CONFIG_DM_MDIO) += mdio.o obj-$(CONFIG_DM_MDIO_MUX) += mdio_mux.o obj-$(CONFIG_DM_RNG) += rng.o obj-$(CONFIG_CLK_K210_SET_RATE) += k210_pll.o +obj-$(CONFIG_SIMPLE_BUS) += simple-bus.o obj-$(CONFIG_SIMPLE_PM_BUS) += simple-pm-bus.o obj-$(CONFIG_RESET_SYSCON) += syscon-reset.o obj-$(CONFIG_SCMI_FIRMWARE) += scmi.o diff --git a/test/dm/simple-bus.c b/test/dm/simple-bus.c new file mode 100644 index 0000000000..3530b47fac --- /dev/null +++ b/test/dm/simple-bus.c @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2021, Bin Meng + */ + +#include +#include +#include +#include +#include +#include + +static int dm_test_simple_bus(struct unit_test_state *uts) +{ + struct udevice *dev; + struct simple_bus_plat *plat; + + /* locate the dummy device @ translation-test node */ + ut_assertok(uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 0, &dev)); + ut_asserteq_str("dev@0,0", dev->name); + + /* locate the parent node which is a simple-bus */ + ut_assertnonnull(dev = dev_get_parent(dev)); + ut_asserteq_str("translation-test@8000", dev->name); + + ut_assertnonnull(plat = dev_get_uclass_plat(dev)); + ut_asserteq(0, plat->base); + ut_asserteq(0x8000, plat->target); + ut_asserteq(0x1000, plat->size); + + return 0; +} +DM_TEST(dm_test_simple_bus, UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE); From patchwork Tue Mar 2 15:34:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446124 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=fW0w7IEh; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4DqhBC3WBVz9sS8 for ; Wed, 3 Mar 2021 02:38:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4E4C58283B; Tue, 2 Mar 2021 16:36:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fW0w7IEh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EFB7082854; Tue, 2 Mar 2021 16:36:42 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8897E8284A for ; Tue, 2 Mar 2021 16:36:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pf1-x42c.google.com with SMTP id m6so14072589pfk.1 for ; Tue, 02 Mar 2021 07:36:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+3tZ3JHA69KueWR++q4nW/FezkuHFYbLEr6/kEoupi4=; b=fW0w7IEhQH1DKIfEJ5kpgvS72huA0y7KSGwf7V7pBMfxjxbMsMzTAQcCzPQMafMo7Q yYCShJCW0EL5KXT5xR8YE5Uz72RAW8sCsAL52A6tx06bXGtfEx8wo4ZhR/FmVICHEhvF WHtVcGMyUFerVRC4to0UvoeWqJSkdC3Wy8dW+iRiHymEjWAx6ZZfupt54C3DVhcBCzMj CYielF9xhYg0KTQKThRAaDixddUbKJRFzAR2YF5/DpwOfhg6+TKpz7cJiP2sB9nTvkEf tBVywevR/1fPh0IsphH4B+eOjb1Dqz7YzDCLlxx48jqK5IfDbkhB0dZRRDK19HWZ33Eb tR9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+3tZ3JHA69KueWR++q4nW/FezkuHFYbLEr6/kEoupi4=; b=l8o2NuHqnpndBrTAu1T02domepz4gP/+3Ll6YyivtGiH8OgaJsZKwpqBYf8jdOxC4G AB7ffmcqHdzPNrUJ7ZcGqPyMxpcDW0KQT0j0SZBpt15GofwcjHU5SsB2CkEmP8oRYn/4 DYJ2lKTFmMt/dBhwoEFb/UG2zVCdvYUpd4LcJldxLKCj2f1MSCN0w0UaSwaqangyculg 12U+Ok80+SrSRoQdBJmtJ2SGo8zpG0DUB8zc/ihOPkyR2TxH7rzuuk6Wc10+/vRPkqDp OcZfAyfTdxGVgLoi8fb4cUJarOiuEszg4EEC0zKLW1i5yx6ujb77BOSkoQESxpFOFNAp +aDw== X-Gm-Message-State: AOAM531qesWy2hMv6ll3+vRoNJGwJKNZFGVN1/TxvkCWTaTuJ8dGLjYN 6lItBCn9QEggVhUqvdLC9Vw= X-Google-Smtp-Source: ABdhPJwj8guGnvFLKHnYcoqaTG3kUloTmdwSOJojoXmj/rVGEJtYEIbbDV/R2w1em0QM9xvo/5w8BA== X-Received: by 2002:a63:4e08:: with SMTP id c8mr17909712pgb.87.1614699398026; Tue, 02 Mar 2021 07:36:38 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.36.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:36:37 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng Subject: [PATCH 18/20] ppc: qemu: Create a virtual memory mapping of the platform bus Date: Tue, 2 Mar 2021 23:34:49 +0800 Message-Id: <20210302153451.19440-19-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 QEMU ppce500 target can dynamically instantiate an eTSEC device on a platform bus if "-device eTSEC" is given to QEMU. It is presented as a "simple-bus" in the device tree, with an additional compatible string "qemu,platform". Let's create a virtual memory mapping for it in misc_init_r(), in preparation to adding eTSEC support. Signed-off-by: Bin Meng --- board/emulation/qemu-ppce500/Kconfig | 6 ++++++ board/emulation/qemu-ppce500/qemu-ppce500.c | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/board/emulation/qemu-ppce500/Kconfig b/board/emulation/qemu-ppce500/Kconfig index 4312d986d8..1c5aa18aa9 100644 --- a/board/emulation/qemu-ppce500/Kconfig +++ b/board/emulation/qemu-ppce500/Kconfig @@ -9,4 +9,10 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "qemu-ppce500" +config PLATFORM_BUS_MAP_ADDR + hex + default 0xf0000000 + help + The QEMU platform bus base mapped address in the virtual memory space. + endif diff --git a/board/emulation/qemu-ppce500/qemu-ppce500.c b/board/emulation/qemu-ppce500/qemu-ppce500.c index daa103c564..0960dd1f97 100644 --- a/board/emulation/qemu-ppce500/qemu-ppce500.c +++ b/board/emulation/qemu-ppce500/qemu-ppce500.c @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include #include #include @@ -148,6 +150,22 @@ int misc_init_r(void) */ disable_tlb(find_tlb_idx((void *)CONFIG_SYS_TMPVIRT, 1)); + /* + * Detect the presence of the platform bus node, and + * create a virtual memory mapping for it. + */ + for (ret = uclass_find_first_device(UCLASS_SIMPLE_BUS, &dev); + dev; + ret = uclass_find_next_device(&dev)) { + if (device_is_compatible(dev, "qemu,platform")) { + struct simple_bus_plat *plat = dev_get_uclass_plat(dev); + + assert(!tlb_map_range(CONFIG_PLATFORM_BUS_MAP_ADDR, + plat->target, plat->size, + TLB_MAP_IO)); + } + } + return 0; } From patchwork Tue Mar 2 15:34:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446125 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=eLlwhLMQ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 ozlabs.org (Postfix) with ESMTPS id 4DqhBV2tScz9sS8 for ; Wed, 3 Mar 2021 02:39:14 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A54338285E; Tue, 2 Mar 2021 16:36:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eLlwhLMQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3CF5B82828; Tue, 2 Mar 2021 16:36:47 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1875D82828 for ; Tue, 2 Mar 2021 16:36:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pf1-x431.google.com with SMTP id e3so10066815pfj.6 for ; Tue, 02 Mar 2021 07:36:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4UWHoDOcmcL9crGVhSB+zDjE7Ksc+JlBB0aZh6bkkkk=; b=eLlwhLMQYe+x22yf65/FPmekW5c0ec1YFoxdw6ybRbbWjNN+1KphA2AlpVnxWVzBiw V0brruYJ4CQeMwRF2ELwGNa6A2vAP+2LEFP0zZRw9ILN7/X6k80sXnsHRclx7Xbv6XO2 f1LD1J+m4sbZPVTN0JtOTmgOk2NJi8/vMQZBAHO9pLhEotTx9sCgqNVgT1geWXjowZpP l8GzK44lgNExrmKCEXwAQUG4rB8hWg9SrQ0gt98aE74/+DvQBnCyb5E1GWw2YE6i/5MZ N18K+vk6WKyGqMjapEZqCCCs9V5uxvq6A0e08OCtwTIYyrETbYWaAI7Zb5pfogvzFtWY 3XfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4UWHoDOcmcL9crGVhSB+zDjE7Ksc+JlBB0aZh6bkkkk=; b=smh1M0UGc9YQytuS6fTK0OwBtLDnAsK3qJg5pgN3rE5bx9ZebEAdrrfd4lsSPrhfUU BXYEHaPdlINU1IEmjwSTivkwBKf+rlQxsa+YMYf0ffE2zggvogFiM6qtWvX7K5oW3p6Q h4p8tGzj+J+3n5M3bALAn0aasHyR4ou4LtH1B7bn0TR78hggMOjlj9VIEE+8Ag5DJujD TSbriE1HSKr841xa0rhui5XhLsCpB7fgSL+3ggb0eENbx7ftetLH41C5ywIHu12bVZ/T VbwO0yGAkIg5FZLkPwK6A2ERfNfbvyH0h18MUdaK1q4J28Lf9H33FqTPexwJ8giDJdDA 13+A== X-Gm-Message-State: AOAM53267cvvoxvjqdvZskJGJO2WWhxuVyrw5fQv2n0VOiw/1xDgLoSF vAmcsWhMGYBBFdzDdqs0N10= X-Google-Smtp-Source: ABdhPJzYWG6o50O2p0gnVW1+zxJ4hJexZWDxn2c795YwO3lI0157NQpD27wOq6VsRpmI59G2PGIAWA== X-Received: by 2002:a63:2262:: with SMTP id t34mr18825647pgm.303.1614699401706; Tue, 02 Mar 2021 07:36:41 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:36:41 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng Subject: [PATCH 19/20] ppc: qemu: Enable eTSEC support Date: Tue, 2 Mar 2021 23:34:50 +0800 Message-Id: <20210302153451.19440-20-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 QEMU ppce500 target can dynamically instantiate an eTSEC device if "-device eTSEC" is given to QEMU. This commit enables eTSEC driver and the required fixed PHY driver to create a usable network configuration using eTSEC. Unlike a real world 85xx board that usually stores the eTSEC MAC address in an EEPROM, CONFIG_NET_RANDOM_ETHADDR is required for QEMU otherwise U-Boot ethernet initialization complains no valid ethernet address is set. Signed-off-by: Bin Meng --- configs/qemu-ppce500_defconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configs/qemu-ppce500_defconfig b/configs/qemu-ppce500_defconfig index 536fe7d6e1..6d21aa48bc 100644 --- a/configs/qemu-ppce500_defconfig +++ b/configs/qemu-ppce500_defconfig @@ -27,6 +27,7 @@ CONFIG_OF_CONTROL=y CONFIG_OF_BOARD=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DM=y CONFIG_BLK=y CONFIG_HAVE_BLOCK_DEVICE=y @@ -34,8 +35,11 @@ CONFIG_MPC8XXX_GPIO=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_FSL=y # CONFIG_MMC is not set +CONFIG_PHY_FIXED=y CONFIG_DM_ETH=y +CONFIG_DM_MDIO=y CONFIG_E1000=y +CONFIG_TSEC_ENET=y CONFIG_DM_PCI=y CONFIG_PCI_MPC85XX=y CONFIG_DM_RTC=y From patchwork Tue Mar 2 15:34:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1446126 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=HQ0EOqsJ; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4DqhBk32wdz9sS8 for ; Wed, 3 Mar 2021 02:39:26 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8A4C18285A; Tue, 2 Mar 2021 16:36:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HQ0EOqsJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CADB3827CB; Tue, 2 Mar 2021 16:36:50 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6C1EB8285A for ; Tue, 2 Mar 2021 16:36:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pj1-x102b.google.com with SMTP id e9so2262803pjj.0 for ; Tue, 02 Mar 2021 07:36:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Wu8KvXN1WaCm1W22xqRxeGsgLatJv3m8blzihzc21Ic=; b=HQ0EOqsJ76hHLMu9QN/XlHROieVnTQJtmUcIB2zv7k7oEDDxZMDay2uB04qCEgqNnP 4XOGhn/T+tPoHDoAxj7ZH3KQTKh5wXW5vNyVH8WCK40zJjj0L8YkCDFV5gsA6ufsExYn NoaUeHUZEYLg2VCac0PqGKCQoFnBMvUXZrfcP6M9FUg+scHkwTNKpIWwwcoLxJP1f6B2 uoeiP/9xPfyfMGNDrspm2GsiV8zwQ9Ipuyk4c5Z1D9OoNyBKc+yD5OiJzxfbSUCT32qy ADHUo+iJ7Cd+/RzigT/GrWzEsSlnuJ9u/q8QF5GCGdr3vcTQTUbgqtXrTB509CZui6ZH 3uXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Wu8KvXN1WaCm1W22xqRxeGsgLatJv3m8blzihzc21Ic=; b=gnnaVQ2vtZMJl8/iHswTAdRSPMhb0JBrG7S2/sRnkE9h61PE7/hFDmOF4V3xBW5meu L+A8abE2QXg6fHvrEiGNON/fk1K137E69DAfm2W4BJk0sf3OTvoTSeFG1K2Ui5eIM1C2 PJrHpTyMvW45LwToTikOB7IT4/eImLwJLnxunIfJDhygcKJt/xGxGjYo86TM86whGSPk VXfcvk1DZpW15MWXQI2+ak17hPeubeNGdq/zkg1MloAeSKKyzss4N+yHSy6vjXgRCeOh 34vsGTeF95j61KoqPxeox6Ad7ROWMW4puHWChgtYlm+/8kmzIjkV2aZ7WSPEGw4zHkZh 4k5g== X-Gm-Message-State: AOAM532JIo/YhHLR1liWmYKl0Onjleow123MB1O3Pf2xhsuCetVjhlv/ bxN2DX3ozTHhc28STAU91w0= X-Google-Smtp-Source: ABdhPJxxohj0yR31ksVjhJyf+qGe8/wZoIZkWiw7/l7b3A2Zbv4YrDYD4W1ZexeLYKFnTfLUPW4h0w== X-Received: by 2002:a17:90a:5993:: with SMTP id l19mr5026154pji.235.1614699404935; Tue, 02 Mar 2021 07:36:44 -0800 (PST) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id mm12sm3541139pjb.49.2021.03.02.07.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:36:44 -0800 (PST) From: Bin Meng To: Priyanka Jain , Simon Glass , u-boot@lists.denx.de Cc: Tom Rini , Alexander Graf , Bin Meng Subject: [PATCH 20/20] doc: board: qemu-ppce500: Document eTSEC usage Date: Tue, 2 Mar 2021 23:34:51 +0800 Message-Id: <20210302153451.19440-21-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302153451.19440-1-bmeng.cn@gmail.com> References: <20210302153451.19440-1-bmeng.cn@gmail.com> MIME-Version: 1.0 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 Document how to launch a QEMU session with eTSEC as a network device. Signed-off-by: Bin Meng --- doc/board/emulation/qemu-ppce500.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/board/emulation/qemu-ppce500.rst b/doc/board/emulation/qemu-ppce500.rst index 0a5c86c61a..5de0aaf55d 100644 --- a/doc/board/emulation/qemu-ppce500.rst +++ b/doc/board/emulation/qemu-ppce500.rst @@ -70,6 +70,11 @@ interface at PCI address 0.1.0, but we can switch that to an e1000 NIC by:: $ qemu-system-ppc -nographic -machine ppce500 -bios u-boot \ -nic tap,ifname=tap0,script=no,downscript=no,model=e1000 +The QEMU ppce500 machine can also dynamically instantiate an eTSEC device if +"-device eTSEC" is given to QEMU:: + + -netdev tap,ifname=tap0,script=no,downscript=no,id=net0 -device eTSEC,netdev=net0 + VirtIO BLK driver is also enabled to support booting from a disk image where a kernel image is stored. Append the following to QEMU::