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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71F2BC4332F for ; Tue, 28 Sep 2021 13:38:36 +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 E81D660FC2 for ; Tue, 28 Sep 2021 13:38:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E81D660FC2 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 574E883340; Tue, 28 Sep 2021 15:37:01 +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="FFr9PsaD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 72F2383130; Tue, 28 Sep 2021 15:36:28 +0200 (CEST) Received: from mail-oo1-xc30.google.com (mail-oo1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) (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 C95EA83340 for ; Tue, 28 Sep 2021 15:35:11 +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=rfried.dev@gmail.com Received: by mail-oo1-xc30.google.com with SMTP id i26-20020a4ad09a000000b002a9d58c24f5so7165723oor.0 for ; Tue, 28 Sep 2021 06:35:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jdTPkbVZIjUeqbbaAr9jrDSeryHlvNoxvD89iwIsW5Y=; b=FFr9PsaDqVSrDRzE2MG521AbAeiILayjSyt+aWHpXYkz82syYF4boWo7uHkBkaAic1 akDxfU+tmN9tSlNtjWF1bZkFJ85mQXGPXtJY1+DxNPNSW/tsGpGPJl+QvHmGSXgFGUBh PYlBds5xH3HrGG0uN6GMOFB5+Z4q4W3HP0AQG7hVFUSfyWaj8PzXnib0Clq/dJ1Yamxp 1n8C40lIB4j2QcWg2R0J3MJs1bRME/eYgK62AfLsTrhkHosZDshaS/C50/MIps1930SU 5Pe3txHuWAf06NqknfCp271kt1D6bUhSLW5V1xoNuYXaOn4rZFHWEzsFT0Hh2txDG+E7 hu/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jdTPkbVZIjUeqbbaAr9jrDSeryHlvNoxvD89iwIsW5Y=; b=iohguJ+0al6wRulYsMJSXnbZsXR/BHTvGD8NsxJBJkjvlwZEIAPTMhV5LvpYe1EyUs OkghWB8jM9wcT/5wOWj93X2tKS39O4IoJoXdniAD1DCmwN3BZnYSLNgP+kObbEhy+JxF 38SZH9TmSZVBUowEcbq+5zuaibkEZCafRkLlRhtSfFyps3Bdkk6/E0tTEIAocAelgci1 gL545xHCyhvqscyMTOHM0YXxmbaHPOvy9gRNHm3ScOWdeC+MkhFpNvA68UJIIUr8NBAf R2i2SRqXfQl1GB0MtJK0ZWbeiSnhu76VCQjhKnuCL2B+8ob/KEbICCzgo66Fom1PwFvX DjiA== X-Gm-Message-State: AOAM530pcII1vQHCxcPaMcRDX/RjyEnHMkQ46YAWfrMoziuLx2wpXSF/ dDWTu9vsKRx+6NZM6J14rpxK3A3EXDwpD/81VnugfbHTU6QGnw== X-Google-Smtp-Source: ABdhPJylvQGVS89y0dGnr882RdwKQQ8fOvKPgoG6t+Ds9GcFqDhqV33Hs8+Af6a0eouH3AgmkrHn6wfPmWWj7/Km4MM= X-Received: by 2002:a4a:b543:: with SMTP id s3mr4939417ooo.94.1632836110548; Tue, 28 Sep 2021 06:35:10 -0700 (PDT) MIME-Version: 1.0 References: <20210927234825.823582-1-vladimir.oltean@nxp.com> <20210927234825.823582-6-vladimir.oltean@nxp.com> In-Reply-To: <20210927234825.823582-6-vladimir.oltean@nxp.com> From: Ramon Fried Date: Tue, 28 Sep 2021 16:34:58 +0300 Message-ID: Subject: Re: [PATCH 5/9] net: dsa: felix: configure the in-band autoneg property based on OF node info To: Vladimir Oltean Cc: U-Boot Mailing List , Joe Hershberger , Priyanka Jain 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 On Tue, Sep 28, 2021 at 2:48 AM Vladimir Oltean wrote: > > Instead of trying to guess which operating modes need in-band > negotiation to be active and which ones don't, parse the available > information from the device tree. That will be correct in the cases we > can already guess, and more. > > Signed-off-by: Vladimir Oltean > --- > drivers/net/mscc_eswitch/felix_switch.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/mscc_eswitch/felix_switch.c b/drivers/net/mscc_eswitch/felix_switch.c > index 6aa79784460d..1df7d03fc40c 100644 > --- a/drivers/net/mscc_eswitch/felix_switch.c > +++ b/drivers/net/mscc_eswitch/felix_switch.c > @@ -16,6 +16,7 @@ > */ > > #include > +#include > #include > #include > #include > @@ -210,17 +211,14 @@ static int felix_init_sxgmii(struct mii_dev *imdio, int pidx) > static void felix_start_pcs(struct udevice *dev, int port, > struct phy_device *phy, struct mii_dev *imdio) > { > - bool autoneg = true; > - > - if (phy->phy_id == PHY_FIXED_ID || > - phy->interface == PHY_INTERFACE_MODE_SGMII_2500) > - autoneg = false; > + ofnode node = dsa_port_get_ofnode(dev, port); > + bool inband_an = ofnode_eth_uses_inband_aneg(node); > > switch (phy->interface) { > case PHY_INTERFACE_MODE_SGMII: > case PHY_INTERFACE_MODE_SGMII_2500: > case PHY_INTERFACE_MODE_QSGMII: > - felix_init_sgmii(imdio, port, autoneg); > + felix_init_sgmii(imdio, port, inband_an); > break; > case PHY_INTERFACE_MODE_XGMII: > case PHY_INTERFACE_MODE_XFI: > -- > 2.25.1 > Reviewed-by: Ramon Fried