From patchwork Wed Mar 2 11:05:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 12765746 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 5CA0CC433FE for ; Wed, 2 Mar 2022 11:05:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241205AbiCBLGU (ORCPT ); Wed, 2 Mar 2022 06:06:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241185AbiCBLGS (ORCPT ); Wed, 2 Mar 2022 06:06:18 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67D803EF0F for ; Wed, 2 Mar 2022 03:05:35 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id z4so1308039pgh.12 for ; Wed, 02 Mar 2022 03:05:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vNsqVoa00YCDeFZ4I2281SG6Ep4/CfQvbPK2hEihXH8=; b=FTqF9Zk8PEtqxa1Y6ShcNKAUf699DnxgjudKfbS4zE3S4KGBzID4J1wXuLTbV0ggHm RJaxOXHmjAn8bsatW/GUJYsM8T6YS0rbNdB80qaf5qg7ZZ5BKxu3HmcXnv2aSktp+1bE IffGJmdZpDmdbkgxEghfbsQRX0rbJuvWrTlpOfX4kIlSYYenkd3+rBelSC3a199VzeVQ 11fthqtauTIl5vUPOk0POZ+Rh+8ljiafPx/aoZe7Ccd4Ve7+czolkW2oMz2YXVZ7u15j khUjfaArSN6/hXH89Xt1jg8+nU9GVA0FUaJ14WSrbMCYIK07MSey+bTyS7p9n54DB8QS Nkyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vNsqVoa00YCDeFZ4I2281SG6Ep4/CfQvbPK2hEihXH8=; b=2ljSkpN0tTF14GkcCVTrzAuqV+aHv8KplN5muy020vATnxFkNaSz/jQPI0cUeSegCO h/0bqg59yltbphVdxFaFHUbSis8QJUaTLwZNV/7TgrEHhgv+rsTISbd56g7DG/nsyzag I0d/yOUNh511+gQSZqpRaYN5NHXlmc1dQYSzullEdwU/YDXtTUfIjYs72/NR3dxncCBx kAAOvFAbPUBomEHLF5xbtqSvQ9CSbhw9c1qLicIezDea58Yx7XwetgDhP4EogE3yZW73 w84yIStXeeQb4jwfIAqGCWtsaGn+7Gub2kHxTGiAF9wlPVF2EFXPbOsPnTn96JAMfr8B 92oA== X-Gm-Message-State: AOAM532K9AaVEG6OUmZl4oVBRynwSDN8b/OAuHZjUKIDHSz7MZSM4EUD wUhfYLRO8IconxdiuH7Sd/76rMVN42Fq/w== X-Google-Smtp-Source: ABdhPJxaJAV0tcgV60jZPuUhPhAM+kBk7DrSLOC/sNdq/5HT5rxfHOCWAK9nQxO/9mQTmTTqCPherA== X-Received: by 2002:a05:6a00:1a09:b0:4e1:67a7:2c87 with SMTP id g9-20020a056a001a0900b004e167a72c87mr32533882pfv.37.1646219134666; Wed, 02 Mar 2022 03:05:34 -0800 (PST) Received: from localhost.localdomain ([171.50.175.145]) by smtp.gmail.com with ESMTPSA id hk1-20020a17090b224100b001b8cff17f89sm5049186pjb.12.2022.03.02.03.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 03:05:34 -0800 (PST) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org Cc: bhupesh.sharma@linaro.org, bhupesh.linux@gmail.com, agross@kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, sboyd@kernel.org, tdas@codeaurora.org, mturquette@baylibre.com, linux-clk@vger.kernel.org, robh+dt@kernel.org, Vinod Koul , Rob Herring Subject: [PATCH v2 1/5] dt-bindings: net: qcom,ethqos: Document SM8150 SoC compatible Date: Wed, 2 Mar 2022 16:35:04 +0530 Message-Id: <20220302110508.69053-2-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220302110508.69053-1-bhupesh.sharma@linaro.org> References: <20220302110508.69053-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Vinod Koul SM8150 has a ethernet controller and needs a different configuration so add a new compatible for this Acked-by: Rob Herring Signed-off-by: Vinod Koul --- Documentation/devicetree/bindings/net/qcom,ethqos.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos.txt b/Documentation/devicetree/bindings/net/qcom,ethqos.txt index fcf5035810b5..1f5746849a71 100644 --- a/Documentation/devicetree/bindings/net/qcom,ethqos.txt +++ b/Documentation/devicetree/bindings/net/qcom,ethqos.txt @@ -7,7 +7,9 @@ This device has following properties: Required properties: -- compatible: Should be qcom,qcs404-ethqos" +- compatible: Should be one of: + "qcom,qcs404-ethqos" + "qcom,sm8150-ethqos" - reg: Address and length of the register set for the device From patchwork Wed Mar 2 11:05:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 12765747 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 F1FD1C433F5 for ; Wed, 2 Mar 2022 11:05:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241230AbiCBLG0 (ORCPT ); Wed, 2 Mar 2022 06:06:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241220AbiCBLGX (ORCPT ); Wed, 2 Mar 2022 06:06:23 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90A8C4D273 for ; Wed, 2 Mar 2022 03:05:39 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id 15-20020a17090a098f00b001bef0376d5cso1465946pjo.5 for ; Wed, 02 Mar 2022 03:05:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GBQoREQeTbmDxGp575UEke733214jz66JUBFcdmxOO0=; b=XPc1jQUAv0qn6kIZ+n2Wk2fRjUpXTLK/E3E+R1hhxlnMkio6OSmRSr1mSz9wqSWTFU ePxDTabTXEUTT+CyqEEE9XC8Wx4jDu41rJXG8rL7O8QNf0fPWjmrC9p8qZlTibscmG5s ocfAMvt8sYU7ZyUKKaf8rCP0snCW5BGNxXWIIgCSDdd72CYzBBy0eW7OuHd1+enOPT0I ntlRd96iHJ6q/B5DWIFLCSLD/r33z3TAobtEYHs0Hzafn5wrvx5jY/n9hRwlnlspt4jS 1zY18O4uMrp5kGCgGpnDv2szcbU3ZIKlFTtk6boHbOmgNkoSmLTkbPI/uAl6sZQBt2GN lAFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GBQoREQeTbmDxGp575UEke733214jz66JUBFcdmxOO0=; b=xeO8iDltz8MZXSW5K4DS/Fw4a5AjAZByc15gh9nSA2xWvZ+YCyl06Fq3+weFeGzqwx zqnT/ecO/c/R2VmwbTWW0cSIRvSuSrM2zpTyEfj3aLbpOGTEOrs12D6jwSpaDdkJGRO1 uCaoe15YL89ft/9fllFRwAlUyHpZMSIklzNKJbTv2IkkqknuUrSCJnHbJDfQfjOxhLjM +TrwRMSViKIX/eB6BWpN57BrmqH2jgstPv94OGIDoHHYxkQGojYo5TkdBGHxUIDKz2vw yhuMKm2bBRitELnTEzM4x2k1LHi/wP1yN0ua4mrRvkcVky23k2ENk1y45SdP9HIWga9W AquQ== X-Gm-Message-State: AOAM531ZFfGZQ55h2hUqAv3oRMP0Gdniusv6ocKq8VD6mjvulveOi1/e bOkIxj3JBSR3BiB3GQ6kLfde2EOA+/e4ZA== X-Google-Smtp-Source: ABdhPJxW9I58ByWFSkIjzaInrqS2x1W8zDYYj3hHPEy54tphpEVvT64oo9Dl2pM/jOfSW/3gMfglew== X-Received: by 2002:a17:90a:f02:b0:1bd:ab6:42ec with SMTP id 2-20020a17090a0f0200b001bd0ab642ecmr22831010pjy.18.1646219138899; Wed, 02 Mar 2022 03:05:38 -0800 (PST) Received: from localhost.localdomain ([171.50.175.145]) by smtp.gmail.com with ESMTPSA id hk1-20020a17090b224100b001b8cff17f89sm5049186pjb.12.2022.03.02.03.05.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 03:05:38 -0800 (PST) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org Cc: bhupesh.sharma@linaro.org, bhupesh.linux@gmail.com, agross@kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, sboyd@kernel.org, tdas@codeaurora.org, mturquette@baylibre.com, linux-clk@vger.kernel.org, robh+dt@kernel.org, Bjorn Andersson Subject: [PATCH v2 2/5] clk: qcom: gcc: Add emac GDSC support for SM8150 Date: Wed, 2 Mar 2022 16:35:05 +0530 Message-Id: <20220302110508.69053-3-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220302110508.69053-1-bhupesh.sharma@linaro.org> References: <20220302110508.69053-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add the EMAC GDSC defines and driver structures for SM8150. Cc: Stephen Boyd Cc: Bjorn Andersson Signed-off-by: Bhupesh Sharma --- drivers/clk/qcom/gcc-sm8150.c | 34 +++++++++++++-------- include/dt-bindings/clock/qcom,gcc-sm8150.h | 1 + 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c index 245794485719..08ba29e3a835 100644 --- a/drivers/clk/qcom/gcc-sm8150.c +++ b/drivers/clk/qcom/gcc-sm8150.c @@ -3448,22 +3448,31 @@ static struct clk_branch gcc_video_xo_clk = { }, }; +static struct gdsc emac_gdsc = { + .gdscr = 0x6004, + .pd = { + .name = "emac_gdsc", + }, + .pwrsts = PWRSTS_OFF_ON, + .flags = POLL_CFG_GDSCR, +}; + static struct gdsc usb30_prim_gdsc = { - .gdscr = 0xf004, - .pd = { - .name = "usb30_prim_gdsc", - }, - .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR, + .gdscr = 0xf004, + .pd = { + .name = "usb30_prim_gdsc", + }, + .pwrsts = PWRSTS_OFF_ON, + .flags = POLL_CFG_GDSCR, }; static struct gdsc usb30_sec_gdsc = { - .gdscr = 0x10004, - .pd = { - .name = "usb30_sec_gdsc", - }, - .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR, + .gdscr = 0x10004, + .pd = { + .name = "usb30_sec_gdsc", + }, + .pwrsts = PWRSTS_OFF_ON, + .flags = POLL_CFG_GDSCR, }; static struct clk_regmap *gcc_sm8150_clocks[] = { @@ -3714,6 +3723,7 @@ static const struct qcom_reset_map gcc_sm8150_resets[] = { }; static struct gdsc *gcc_sm8150_gdscs[] = { + [EMAC_GDSC] = &emac_gdsc, [USB30_PRIM_GDSC] = &usb30_prim_gdsc, [USB30_SEC_GDSC] = &usb30_sec_gdsc, }; diff --git a/include/dt-bindings/clock/qcom,gcc-sm8150.h b/include/dt-bindings/clock/qcom,gcc-sm8150.h index 3e1a91876610..40596b9ded06 100644 --- a/include/dt-bindings/clock/qcom,gcc-sm8150.h +++ b/include/dt-bindings/clock/qcom,gcc-sm8150.h @@ -243,5 +243,6 @@ /* GCC GDSCRs */ #define USB30_PRIM_GDSC 4 #define USB30_SEC_GDSC 5 +#define EMAC_GDSC 6 #endif From patchwork Wed Mar 2 11:05:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 12765748 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 C4218C433FE for ; Wed, 2 Mar 2022 11:05:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241229AbiCBLGf (ORCPT ); Wed, 2 Mar 2022 06:06:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241224AbiCBLGd (ORCPT ); Wed, 2 Mar 2022 06:06:33 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F7E06F4BF for ; Wed, 2 Mar 2022 03:05:44 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id gj15-20020a17090b108f00b001bef86c67c1so1342615pjb.3 for ; Wed, 02 Mar 2022 03:05:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=20eucF22WnDJBIef+XBNRtcVtRBLlgGa2MbsKG7djtE=; b=GxpzHF9vAhlw5dsZA6dVrtQJDEW1mDu0I9prpCSyYQGnxxptQXt0B120lBo5QArybe K49QanJd8cVqrNO5F0PwdUp3GVO74lgbHjRrb95VZSOavtRL5r6noTM0vjEvAV020mSR cdfNyE+vHqEDWnRCo+fE6Y08NhEOlpJzuKjL+aRoCaHEqEjgw6Va54k5jwrejtGQdj80 QOpBSIzEafWNCEWFxL7mNbNwv04udkL6fJXuPChUcBdengvGVgIJXkV6cONoRrKZsQOD /AxhoieozYtXwda1q9Otnwdfhw0Qf4crGsIcIf3nskViTWO7kQqdCvKwQQ6OcuUFqTjB XbNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=20eucF22WnDJBIef+XBNRtcVtRBLlgGa2MbsKG7djtE=; b=rN8TcHUMB9vk6GUZt/LpAnFe+VG9mDkAAqb6pjWk/h7FgSALzWy7sTAeYU56BnO2GT TXF/iHtxChivFibC7xmrxOEo+1g7fpskiNQGF6P8+00SI7NCenF4H7tQTQEe3EzHfFtO cSaBxBD4FTgJk+ndlGl1oT6jAa7YWjTmuESgNTgh607N/NqIxkFuP7SlC3FGFyvVKBIr mog8vidmqKa6dRDF6Snlu5foju4FX6r0jHCdq0kGZgtAfEt1beQtoFyTVSR9RHeQ/t+V NKy5qopAZsCpCcOUwaiv31IPi30FnSL3RKToOcnWhq5eVJB7eYPQXO1tEs1lSe+Co5Vb 7X1w== X-Gm-Message-State: AOAM530S/lYdUXPs0i53sr9cjqK7NvKpcPMtTnPpENsZMrBaYa4HlY6Q 2N3op0jKITJZhUVnE3wVnKma+kXNUDg+cg== X-Google-Smtp-Source: ABdhPJzPnPURDL5k7XnfU89eVXyIfxS/JHhGyxe5U0Hzv/k46xPO8cv2uY4Cxl94DNAQ/LQz/cAM4A== X-Received: by 2002:a17:902:ec88:b0:14f:d5fb:7a8c with SMTP id x8-20020a170902ec8800b0014fd5fb7a8cmr29734753plg.5.1646219143349; Wed, 02 Mar 2022 03:05:43 -0800 (PST) Received: from localhost.localdomain ([171.50.175.145]) by smtp.gmail.com with ESMTPSA id hk1-20020a17090b224100b001b8cff17f89sm5049186pjb.12.2022.03.02.03.05.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 03:05:43 -0800 (PST) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org Cc: bhupesh.sharma@linaro.org, bhupesh.linux@gmail.com, agross@kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, sboyd@kernel.org, tdas@codeaurora.org, mturquette@baylibre.com, linux-clk@vger.kernel.org, robh+dt@kernel.org, Bjorn Andersson Subject: [PATCH v2 3/5] clk: qcom: gcc-sm8150: Use ALWAYS_ON flag as a workaround for emac gdsc Date: Wed, 2 Mar 2022 16:35:06 +0530 Message-Id: <20220302110508.69053-4-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220302110508.69053-1-bhupesh.sharma@linaro.org> References: <20220302110508.69053-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org emac GDSC currently has issues (seen on SA8155p-ADP) when its turn'ed ON, once its already in OFF state. So when the 'eth' interface is turned up, it fails (as RGMII CLK is unavailable, which is gated by emac GDSC) with the following logs: qcom-ethqos 20000.ethernet eth0: PHY [stmmac-0:07] driver [Micrel KSZ9031 Gigabit PHY] (irq=150) <..snip..> qcom-ethqos 20000.ethernet: Failed to reset the dma qcom-ethqos 20000.ethernet eth0: stmmac_hw_setup: DMA engine initialization failed qcom-ethqos 20000.ethernet eth0: stmmac_open: Hw setup failed So, use the 'ALWAYS_ON' flag as a workaround to describe emac GDSC for now. Cc: Bjorn Andersson Cc: Stephen Boyd Signed-off-by: Bhupesh Sharma --- drivers/clk/qcom/gcc-sm8150.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c index 08ba29e3a835..76485bff7240 100644 --- a/drivers/clk/qcom/gcc-sm8150.c +++ b/drivers/clk/qcom/gcc-sm8150.c @@ -3454,7 +3454,13 @@ static struct gdsc emac_gdsc = { .name = "emac_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = POLL_CFG_GDSCR, + /* + * FIXME: emac GDSC cannot resume after GDSC power off: + * qcom-ethqos 20000.ethernet: Failed to reset the dma + * + * So use ALWAYS_ON flag as a workaround. + */ + .flags = ALWAYS_ON, }; static struct gdsc usb30_prim_gdsc = { From patchwork Wed Mar 2 11:05:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 12765749 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 38852C433FE for ; Wed, 2 Mar 2022 11:06:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241294AbiCBLGr (ORCPT ); Wed, 2 Mar 2022 06:06:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241266AbiCBLGf (ORCPT ); Wed, 2 Mar 2022 06:06:35 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26E9791AEB for ; Wed, 2 Mar 2022 03:05:49 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id e13so1265489plh.3 for ; Wed, 02 Mar 2022 03:05:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vmDFo76a8otWYPkle6/ziOHDKrQe2qvu7laZ0IuPxgk=; b=IzpfZk50nXuiVWgNMU72JSSGrmI9Qt1iKGALVQkGV8dBZJpTQUW0eOWvJ5Stmxgo93 rdAZG/lvGUdWsKuepZ3mR7eQYZav1EoB4LjL0OyxAIRB04RI+uf5Qm/rMXYhJelVMmzA pBHGuT5c1wZ7QYFVvIaiVWX8utoBS9RgPkJPpPwkQCWJRNnktAN3PvHrjAuXsgyomg2/ lCzI1yuS0s7RVQFcqUcntBVJGBy4QG4S7BitPN4HXwnDqcotd2f2s4Cf9Kna4J7DCU78 JPlMAk6yEKY1TIUaq9KlVPXlz4v9qcOsprprhKG5DuFt8SfZkAoyOEjAc7XlHsc7VN0z +qbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vmDFo76a8otWYPkle6/ziOHDKrQe2qvu7laZ0IuPxgk=; b=7bZj96vp0U3SAzqBfiASzXCd4vP4liaPJEPcW/Vz+rd9budiNeKdOcu4CW0pCU8s8h Jyz/a5TtMUFO+Z0YJGMsIYJbBdptzTaS0BIH8wZ0Q4VPBHM3L/F7k+mxMl0/139INHsw PbwJHkAsgPblY9Hx1AZHLHuf4bsjwlxudI6xKfqrCurnySOLa39kz74C/HdtIyOhr18X PacUMttdzj3cfCHYlS56VBP5J4+OeKbWA+1pp6LDaQP1TNvb47sqME02S1edUS1KScm2 Hh2hKP9jA+RyuZ5Kjr5fRqzQzvzvqfo00tSDZX+PbC7uAkV+k2xOEtQQLDzaDtI3QMEG L2rw== X-Gm-Message-State: AOAM532fCzLEvmKOYHXlCJI08Z5vfzlDiGwrBYCmps61ZTaKzg4jx02n UoxH1b6I2O4vp/sfESyiPDGIFW3IX7WgfQ== X-Google-Smtp-Source: ABdhPJxoUZGbwWKrd44OrQlUtT7O1K8fuDhbVMyfeMvTHmOKBbYfk2J0LIulRhny4EvTsNQ1UAv1Wg== X-Received: by 2002:a17:90a:4b45:b0:1be:da4b:a56a with SMTP id o5-20020a17090a4b4500b001beda4ba56amr8115077pjl.82.1646219148073; Wed, 02 Mar 2022 03:05:48 -0800 (PST) Received: from localhost.localdomain ([171.50.175.145]) by smtp.gmail.com with ESMTPSA id hk1-20020a17090b224100b001b8cff17f89sm5049186pjb.12.2022.03.02.03.05.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 03:05:47 -0800 (PST) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org Cc: bhupesh.sharma@linaro.org, bhupesh.linux@gmail.com, agross@kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, sboyd@kernel.org, tdas@codeaurora.org, mturquette@baylibre.com, linux-clk@vger.kernel.org, robh+dt@kernel.org, Vinod Koul , Bjorn Andersson Subject: [PATCH v2 4/5] arm64: dts: qcom: sm8150: add ethernet node Date: Wed, 2 Mar 2022 16:35:07 +0530 Message-Id: <20220302110508.69053-5-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220302110508.69053-1-bhupesh.sharma@linaro.org> References: <20220302110508.69053-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Vinod Koul SM8150 SoC supports ethqos ethernet controller so add the node for it Cc: Bjorn Andersson Signed-off-by: Vinod Koul [bhsharma: Correct ethernet interrupt numbers and add power-domain] Signed-off-by: Bhupesh Sharma --- arch/arm64/boot/dts/qcom/sm8150.dtsi | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi index 6012322a5984..2ed231767535 100644 --- a/arch/arm64/boot/dts/qcom/sm8150.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi @@ -915,6 +915,33 @@ gpi_dma0: dma-controller@800000 { status = "disabled"; }; + ethernet: ethernet@20000 { + compatible = "qcom,sm8150-ethqos"; + reg = <0x0 0x00020000 0x0 0x10000>, + <0x0 0x00036000 0x0 0x100>; + reg-names = "stmmaceth", "rgmii"; + clock-names = "stmmaceth", "pclk", "ptp_ref", "rgmii"; + clocks = <&gcc GCC_EMAC_AXI_CLK>, + <&gcc GCC_EMAC_SLV_AHB_CLK>, + <&gcc GCC_EMAC_PTP_CLK>, + <&gcc GCC_EMAC_RGMII_CLK>; + interrupts = , + ; + interrupt-names = "macirq", "eth_lpi"; + + power-domains = <&gcc EMAC_GDSC>; + resets = <&gcc GCC_EMAC_BCR>; + + iommus = <&apps_smmu 0x3C0 0x0>; + + snps,tso; + rx-fifo-depth = <4096>; + tx-fifo-depth = <4096>; + + status = "disabled"; + }; + + qupv3_id_0: geniqup@8c0000 { compatible = "qcom,geni-se-qup"; reg = <0x0 0x008c0000 0x0 0x6000>; From patchwork Wed Mar 2 11:05:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 12765750 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 85B50C433FE for ; Wed, 2 Mar 2022 11:06:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241226AbiCBLGv (ORCPT ); Wed, 2 Mar 2022 06:06:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241246AbiCBLGm (ORCPT ); Wed, 2 Mar 2022 06:06:42 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 755FD6E8C5 for ; Wed, 2 Mar 2022 03:05:53 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id z2-20020a17090a6d0200b001bef22367dbso2120233pjj.4 for ; Wed, 02 Mar 2022 03:05:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=31oR/5R8uiOoYLaqojfd9sfVOvx41Qx3BFeK4/Ytd84=; b=At4zU4shHEmJqgXsvdpIlpcNKb/1D5xR+vm2ACNKVXjaecQc51lvkgMGU7RJe7P4IQ 7TpGTETBaFOEaYnf5fMcZd5DeECI2tZr2PEsL9A0ljMbw8EFIppR2ogsrf2IqbAoJ/IO RoKxXM24uFcdNc1ws28Nn0NkXW91PJd5FZMzZsT/1irCiBI8dXsQ2ShSu3ecKlAm58U/ y09E9p9MvKt1kvx1szrqD+oE4hxBnKzlGNeZaWmQivYHE1bx25EUPydjTveDKicysD6B VEoCYh8I6/s4L7qtGVFgKey6R7lFIP2ZksRmyPuYQFdBPKCIONz+pQWGfhxWi4ttyJ6I a65Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=31oR/5R8uiOoYLaqojfd9sfVOvx41Qx3BFeK4/Ytd84=; b=Ct38bE4rL75nuEPf/XDvmNYUKfqqQXSq3HW0j/uo+XAPjoeQjeG6oT4EjHp5kx46dm pf3GpQXb8Xtk8TrfuFVnP81hghApnoIh2rh3Q/3a/MOIsxJgg0A/SiCCujx983JVw7Gs /ndhyNJzKbiYP4i8yu9KiHRQxZKgjQg/ls+jiw+D9gN8/Fr8W0am671P4s19qArtRdp3 KTrvNmX+DB7O+jWs3FHo6fECb7lGSdhvZLKQrrHFaPDlL9ejKF840yhgOdNd/5r+2t67 nztHUKj/sVcROkw4ywB1or31wuaOPQGkl7SdHvd7a8az4oM65K9GYkpcsZMm2TDHn79j m4qw== X-Gm-Message-State: AOAM5307DSM0IxifBzHLaQDZBsvoZAtOeVfPs5TY0LHOGwHbK6grapT/ zGRcr7rol9V94ZK4e0vlE8ylSLo+6uZhNw== X-Google-Smtp-Source: ABdhPJxSbxvCb0rvr3EAZIz1KY6zF0rK1ThfoOP2vyrgJijNdBkpiwk/lGAKFU73doZnK2Z8RpsDGg== X-Received: by 2002:a17:90a:dc81:b0:1bd:2d28:4bf4 with SMTP id j1-20020a17090adc8100b001bd2d284bf4mr18701085pjv.206.1646219152594; Wed, 02 Mar 2022 03:05:52 -0800 (PST) Received: from localhost.localdomain ([171.50.175.145]) by smtp.gmail.com with ESMTPSA id hk1-20020a17090b224100b001b8cff17f89sm5049186pjb.12.2022.03.02.03.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 03:05:52 -0800 (PST) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org Cc: bhupesh.sharma@linaro.org, bhupesh.linux@gmail.com, agross@kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, sboyd@kernel.org, tdas@codeaurora.org, mturquette@baylibre.com, linux-clk@vger.kernel.org, robh+dt@kernel.org, Vinod Koul , Bjorn Andersson Subject: [PATCH v2 5/5] arm64: dts: qcom: sa8155p-adp: Enable ethernet node Date: Wed, 2 Mar 2022 16:35:08 +0530 Message-Id: <20220302110508.69053-6-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220302110508.69053-1-bhupesh.sharma@linaro.org> References: <20220302110508.69053-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Vinod Koul Enable the etheret node, add the phy node and pinctrl for ethernet. Cc: Bjorn Andersson Signed-off-by: Vinod Koul [bhsharma: Correct ethernet/rgmii related pinmuxs, specify multi-queues and plug in the PHY interrupt for WOL] Signed-off-by: Bhupesh Sharma --- arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 144 +++++++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts index 8756c2b25c7e..474f688f14a2 100644 --- a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts +++ b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts @@ -47,6 +47,65 @@ vreg_s4a_1p8: smps4 { vin-supply = <&vreg_3p3>; }; + + mtl_rx_setup: rx-queues-config { + snps,rx-queues-to-use = <4>; + snps,rx-sched-sp; + + queue0 { + snps,dcb-algorithm; + snps,map-to-dma-channel = <0x0>; + snps,route-up; + snps,priority = <0x1>; + }; + + queue1 { + snps,dcb-algorithm; + snps,map-to-dma-channel = <0x1>; + snps,route-ptp; + }; + + queue2 { + snps,avb-algorithm; + snps,map-to-dma-channel = <0x2>; + snps,route-avcp; + }; + + queue3 { + snps,avb-algorithm; + snps,map-to-dma-channel = <0x3>; + snps,priority = <0xC>; + }; + }; + + mtl_tx_setup: tx-queues-config { + snps,tx-queues-to-use = <4>; + snps,tx-sched-wrr; + + queue0 { + snps,weight = <0x10>; + snps,dcb-algorithm; + snps,priority = <0x0>; + }; + + queue1 { + snps,weight = <0x11>; + snps,dcb-algorithm; + snps,priority = <0x1>; + }; + + queue2 { + snps,weight = <0x12>; + snps,dcb-algorithm; + snps,priority = <0x2>; + }; + + queue3 { + snps,weight = <0x13>; + snps,dcb-algorithm; + snps,priority = <0x3>; + }; + }; }; &apps_rsc { @@ -317,6 +376,42 @@ &remoteproc_cdsp { firmware-name = "qcom/sa8155p/cdsp.mdt"; }; +ðernet { + status = "okay"; + + snps,reset-gpio = <&tlmm 79 GPIO_ACTIVE_LOW>; + snps,reset-active-low; + snps,reset-delays-us = <0 11000 70000>; + + snps,ptp-ref-clk-rate = <250000000>; + snps,ptp-req-clk-rate = <96000000>; + + snps,mtl-rx-config = <&mtl_rx_setup>; + snps,mtl-tx-config = <&mtl_tx_setup>; + + pinctrl-names = "default"; + pinctrl-0 = <ðernet_defaults>; + + phy-handle = <&rgmii_phy>; + phy-mode = "rgmii"; + mdio { + #address-cells = <0x1>; + #size-cells = <0x0>; + + compatible = "snps,dwmac-mdio"; + + /* Micrel KSZ9031RNZ PHY */ + rgmii_phy: phy@7 { + reg = <0x7>; + + interrupt-parent = <&tlmm>; + interrupts-extended = <&tlmm 124 IRQ_TYPE_EDGE_FALLING>; /* phy intr */ + device_type = "ethernet-phy"; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + }; +}; + &uart2 { status = "okay"; }; @@ -407,4 +502,53 @@ mux { drive-strength = <2>; }; }; + + ethernet_defaults: ethernet-defaults { + mdc { + pins = "gpio7"; + function = "rgmii"; + bias-pull-up; + }; + + mdio { + pins = "gpio59"; + function = "rgmii"; + bias-pull-up; + }; + + rgmii-rx { + pins = "gpio117", "gpio118", "gpio119", "gpio120", "gpio115", "gpio116"; + function = "rgmii"; + bias-disable; + drive-strength = <2>; + }; + + rgmii-tx { + pins = "gpio122", "gpio4", "gpio5", "gpio6", "gpio114", "gpio121"; + function = "rgmii"; + bias-pull-up; + drive-strength = <16>; + }; + + phy-intr { + pins = "gpio124"; + function = "emac_phy"; + bias-disable; + drive-strength = <8>; + }; + + pps { + pins = "gpio81"; + function = "emac_pps"; + bias-disable; + drive-strength = <8>; + }; + + phy-reset { + pins = "gpio79"; + function = "gpio"; + bias-pull-up; + drive-strength = <16>; + }; + }; };