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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 261B4C7EE43 for ; Mon, 12 Jun 2023 20:45:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232304AbjFLUp4 (ORCPT ); Mon, 12 Jun 2023 16:45:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235620AbjFLUpm (ORCPT ); Mon, 12 Jun 2023 16:45:42 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB44B10C9 for ; Mon, 12 Jun 2023 13:44:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686602576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=a+9OvtK97veHl6+HegxVNiurUYmzQbeChvO9xmQ5r5g=; b=I0R+X/uZrLtGtzAyQYDm9VNqRRCGuGZZ6pawqilQTJyOrTv/2dbXcM8eBri/7jGELwHtkw ZKFJ72U/FaKu6P+VGZuRhrez1f22al6IBxVTPqgfV5l0nExYXCpoQSMpt2FBLfSt9ZVWxA lfqHIjRPiDtj6KEtI0fioEnWwlKRoI4= Received: from mail-yw1-f197.google.com (mail-yw1-f197.google.com [209.85.128.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-315-Re1AajCUOb2BROUycE-THg-1; Mon, 12 Jun 2023 16:42:55 -0400 X-MC-Unique: Re1AajCUOb2BROUycE-THg-1 Received: by mail-yw1-f197.google.com with SMTP id 00721157ae682-565d1b86a63so69925237b3.0 for ; Mon, 12 Jun 2023 13:42:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686602575; x=1689194575; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=a+9OvtK97veHl6+HegxVNiurUYmzQbeChvO9xmQ5r5g=; b=eIR+1QM/BSDL1gSglm+VytMIQXGX3RoGk+u6Z1ShmBhhap01FBuQQjQ1xRCmkwXqEK zI9E/BAjJnmwYtBpsR9FWiKJ1kLDCXDeVfe7+jj5C8dNQjGpdPr5qN9sQEjEabG/9rqT ss4apJvJPaYy4nvoR2lUAqt7F1ermP89E3R6EVJ9DOsZmCHWQdgKpk433xQYt4/O9qGv hx7iR5Wz15OvonTSJoaaYveLH0oCvrEjBDVp3rvEdDQJtxxyKLr9+rMFf3ivgymrjZnW tsKwGOyYyqgPIiODwPlxCK6pxo5bg+RQyH5sVjZnxB7l+5B4mZ2nY2IQOGF3+lybnyUn 61wQ== X-Gm-Message-State: AC+VfDzyI1k1fJ1DJgtiR/+4hNL7fpG7XCN+LoLWbnBQ5wkV888kiUR9 PuYKxWe8ArgOTmN9b+4gdQaUO6Uj5Grd0iQkYULTAldvOpp6LCQR6NmA1gDshZ8azfdeM02bx8C lT3zbTCa/CQx53uqwizVeSQ== X-Received: by 2002:a81:7bc6:0:b0:56d:3372:71c7 with SMTP id w189-20020a817bc6000000b0056d337271c7mr2596033ywc.23.1686602575043; Mon, 12 Jun 2023 13:42:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xUUOwVWCsyVOTXZeMW6GB/UM/A5jZuRMVvmYBzle/O+VHgBsWxsSIEBgDZ0wTd7/cMwI9Mg== X-Received: by 2002:a81:7bc6:0:b0:56d:3372:71c7 with SMTP id w189-20020a817bc6000000b0056d337271c7mr2596001ywc.23.1686602574825; Mon, 12 Jun 2023 13:42:54 -0700 (PDT) Received: from halaney-x13s ([2600:1700:1ff0:d0e0::45]) by smtp.gmail.com with ESMTPSA id x186-20020a817cc3000000b00568cbb028c6sm2769484ywc.85.2023.06.12.13.42.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 13:42:54 -0700 (PDT) Date: Mon, 12 Jun 2023 15:42:52 -0500 From: Andrew Halaney To: Bartosz Golaszewski Cc: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kishon Vijay Abraham I , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Bartosz Golaszewski Subject: Re: [PATCH 14/26] net: stmmac: dwmac-qcom-ethqos: add optional phyaux clock Message-ID: <20230612204252.kb57m72ehazt4bco@halaney-x13s> References: <20230612092355.87937-1-brgl@bgdev.pl> <20230612092355.87937-15-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230612092355.87937-15-brgl@bgdev.pl> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Mon, Jun 12, 2023 at 11:23:43AM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > On sa8775p we don't use the RGMII clock but have an additional PHYAUX > clock so add support for it to the driver. > > Signed-off-by: Bartosz Golaszewski > --- > .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > index 252dca400071..2f6b9b419601 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > @@ -94,6 +94,7 @@ struct qcom_ethqos { > > unsigned int rgmii_clk_rate; > struct clk *rgmii_clk; > + struct clk *phyaux_clk; > struct phy *serdes_phy; > unsigned int speed; > > @@ -604,6 +605,13 @@ static int ethqos_clks_config(void *priv, bool enabled) > return ret; > } > > + ret = clk_prepare_enable(ethqos->phyaux_clk); > + if (ret) { > + clk_disable_unprepare(ethqos->rgmii_clk); > + dev_err(ðqos->pdev->dev, "phyaux enable failed\n"); > + return ret; > + } > + > /* Enable functional clock to prevent DMA reset to timeout due > * to lacking PHY clock after the hardware block has been power > * cycled. The actual configuration will be adjusted once > @@ -611,6 +619,7 @@ static int ethqos_clks_config(void *priv, bool enabled) > */ > ethqos_set_func_clk_en(ethqos); > } else { > + clk_disable_unprepare(ethqos->phyaux_clk); > clk_disable_unprepare(ethqos->rgmii_clk); > } > > @@ -669,6 +678,12 @@ static int qcom_ethqos_probe(struct platform_device *pdev) > goto out_config_dt; > } > > + ethqos->phyaux_clk = devm_clk_get_optional(dev, "phyaux"); > + if (IS_ERR(ethqos->phyaux_clk)) { > + ret = PTR_ERR(ethqos->phyaux_clk); > + goto out_config_dt; > + } > + Similar comment to the prior patch about whether or not this should be optional (or selected via platform compatible and required), otherwise looks good. > ret = ethqos_clks_config(ethqos, true); > if (ret) > goto out_config_dt; > -- > 2.39.2 >