From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4E63C432BE for ; Fri, 27 Aug 2021 04:00:42 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3519E60F42 for ; Fri, 27 Aug 2021 04:00:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3519E60F42 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3ECD383249; Fri, 27 Aug 2021 06:00:40 +0200 (CEST) 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="T7uR+6nN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A304083255; Fri, 27 Aug 2021 06:00:37 +0200 (CEST) Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) (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 18C8B83249 for ; Fri, 27 Aug 2021 06:00:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mibodhi@gmail.com Received: by mail-yb1-xb2d.google.com with SMTP id z5so10070470ybj.2 for ; Thu, 26 Aug 2021 21:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RQA/xSjZE4dd6oYMxvHFaI2i6gznQ10rcLGPlHVqJAQ=; b=T7uR+6nNohm2J8C7l+wYtM+nN7O1ey13bSdTXoO1OSACkVME+bzWRycsxhHFqHmIzo 8X4ypyFzlxiZZvKQrCrrMabrYPj31f8xzHF6NFu4VAzLdM7Cvj5C4gdY8dhB2PaYriUx NcYk1PPVjCvCSJvLm9YE//v4oHt3cYQJBUIDSgOjHvQ94OuVgi65L8jre9sSzEk91IY9 378x7wYpc6W5PwBWJbr+D/hDk9XnGMcTXeUjT8+2HpO/wnquGofQUkSQzIWSlYzhrN78 vZPblTMFl2eN3QDCNPZuGpo5UuwEjQlS3mrCVMnJXQC8aCWILK9ciRAj+qslXT3t7SAO i80g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RQA/xSjZE4dd6oYMxvHFaI2i6gznQ10rcLGPlHVqJAQ=; b=PzVGRqE4RnDIvkybRqrNJyAG+4MpIuF8k4Q06DtaQI1GMjMJr+Hi0a+bSliVytjy8L H1LfzyHRZT2VxwcStVhNFSNxGQPG3knt6nkFUL/ars4K0qMp7vJ0g+AWQQnQAMxvcaNL +9ShJkVAsEP6e6FBi+0BVYrQ6OggJjuetDJWYMjs4iGdb8T3p4olP2brN6fRNUfWIWXB Y1bIBLn1lroFaUAMcUR81U2gKZidcWoY9e2iSkOmlwlpHFgjLD6+g08TbZex3PbM1YQX j1wtPQkICM5TY18rMfr+gupplmAdm/QtNqYwos/vCExGUiMV3+Jb8G1eF/OT+1MqUyw6 qfXA== X-Gm-Message-State: AOAM533KZPIDXff9GOju9GymlYEarIzafqmEfN0MzncUkz3X/+c/beKd CuRggA7kJtO83weItvpVgvir2VO6pED+oQq7o+A= X-Google-Smtp-Source: ABdhPJyG0Att4hL/kti1LGo4YZp3JbiXSDLTeldNWflNpNXcm2vqvLJrS6W2TJune19bgW62WYK1H5k8HiJjhXYI6FA= X-Received: by 2002:a25:afcd:: with SMTP id d13mr2585468ybj.504.1630036831604; Thu, 26 Aug 2021 21:00:31 -0700 (PDT) MIME-Version: 1.0 References: <20210806044910.23500-1-mibodhi@gmail.com> In-Reply-To: From: Tony Dinh Date: Thu, 26 Aug 2021 21:00:19 -0700 Message-ID: Subject: Re: [PATCH 0/3] common: Add fdt network helper To: Simon Glass Cc: U-Boot Mailing List , Stefan Roese , Ramon Fried , Joe Hershberger , Tom Rini Content-Type: text/plain; charset="UTF-8" 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.103.2 at phobos.denx.de X-Virus-Status: Clean Hi Simon, On Tue, Aug 17, 2021 at 9:09 AM Simon Glass wrote: > > Hi Tony, > > On Sun, 15 Aug 2021 at 15:28, Tony Dinh wrote: > > > > Hi Simon, > > > > On Sun, Aug 15, 2021 at 7:10 AM Simon Glass wrote: > > > > > > Hi Tony, > > > > > > On Thu, 5 Aug 2021 at 22:49, Tony Dinh wrote: > > > > > > > > > > > > At the moment, there is no common fdt helper function specific to decoding network related > > > > information from FDTs. This new helper functional group fdt_support_net is intended to be used > > > > by board-specific code within U-Boot for various network related chores. > > > > > > > > In this patch, create the 1st function fdt_get_phy_addr to parse the device tree to find > > > > the PHY addess of a specific ethernet device. > > > > > > > > > > > > Tony Dinh (3): > > > > Add fdt network helper header file > > > > Add fdt network helper functions > > > > Add fdt network helper to Makefile > > > > > > > > common/Makefile | 2 +- > > > > common/fdt_support_net.c | 46 +++++++++++++++++++++++++++++++++++++++ > > > > include/fdt_support_net.h | 39 +++++++++++++++++++++++++++++++++ > > > > 3 files changed, 86 insertions(+), 1 deletion(-) > > > > create mode 100644 common/fdt_support_net.c > > > > create mode 100644 include/fdt_support_net.h > > > > > > Can this use livetre and also have some tests? > > > > I have not enabled livetree for any of the boards I have. So I just > > modeled this using the existing ./common/fdt_support.c! > > > > I do agree we should start using livetree in fdt helpers, if I > > understood it correctly, it should work for both flattree and > > OK good, yes that's right. > > > livetree. Perhaps we could have another patch series after this? I am > > preparing another Kirkwood board support patch that I could hold off > > submitting and enable livetree to use that as a vehicle for testing. > > I think it is better to use livetree in this patch. For testing, you > can use sandbox for testing (see for example test/dm/ofnode.c) > > Regards, > Simon It seems it is too time consuming to implement this using livetree calls (with my limited understanding about livetree). I spent a few hours reading ./include/dm/read.h and ./include/dm/ofnode.h, and it is not apparent to me which functions to use. I see that we have eth_get_dev_by_name(), that's a start. Do you have any objection if I submit this function as a patch to ./common/fdt_support.c? fdt_support.c file is all flatree implementation. And by the way, this new function fdt_get_phy_addr() has been tested with several Kirkwood boards that I have been converting to DM Ethernet. When the time comes that it's mandatory to convert all to livetree calls, I'll be glad to help. Thanks, Tony