From patchwork Tue Jun 13 05:43:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Somisetty, Pranavi" X-Patchwork-Id: 107096 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp324793vqr; Mon, 12 Jun 2023 22:53:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6q0kZstcI/ATY4zhH0pQm6uObHc/b7o8UmYL0POgkJ0zyX1uK6LgsJCEWB8Um64s46EIHM X-Received: by 2002:a05:6a00:80d:b0:64c:aa98:a69f with SMTP id m13-20020a056a00080d00b0064caa98a69fmr14364357pfk.1.1686635622510; Mon, 12 Jun 2023 22:53:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686635622; cv=pass; d=google.com; s=arc-20160816; b=wuqw3PPNS4/lp3tem+UMD0klWWL45s4Ol+4rzGpIJ3Zj2cpAgofvNwPHd/kkOaW+rQ oo+90mUYu2XzwWBev8UwrPNpdtYNoRFf64bjl1GsEhU+X2n2y8LD9K51hipGMrGTUk1S mLUJ/EVJHaklpoRlvXQrhtuC2cgM6ObuR13prSOlvJwCQXyIAdrZp9i0TH972I2sSQ0I 4Ri062dJ6QBymws9n6WUs/GcEUqzWVgPLTu7kTgGk4JEDIl90EaN5RY1+WYunrB1a9kZ UVT8vUwYm4dfA9jSZtKK/aMUwxKf8j7RNEHfxNP3oofR20JTseAnRUkDJAtzGC9fP0rz wz7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dYLTxX0l/jxO8pwuVApuh76rSCUtE8Nn5+Qauar02ls=; b=cpmgObJm2QzRv5reCepuJJCeawHdtDk4rNuZCTOUSXSkuUogS20xo3/23mbqGa4yxR MesfrFp92Zg/DFbgRNN/jWGMplWVOCUaWHVMm7CTWAYqCUVB1tLu41DDT4+9Ny32x0XN dY8oDlfMPK6JhTpXWvoCtS5/8BtkhKZDmzWKl8boBs1srPhj0uA4UXnKii9w4x1oHGx6 OS5aKzghg7t3BnfLzEq5mTCqoaASDXqT/PRw8WwGTKmLnZCIA/MkLPaOBxPW8iq1T5HE vUQjmZ0EpWjGw/JK2shkN/NekyBK/2QXd77OcRGe5KJGxlyjIlyTIwdJphkH2+LuoONI APnQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=GOm6kYJU; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020aa78bca000000b00661397beb62si7990533pfd.171.2023.06.12.22.53.30; Mon, 12 Jun 2023 22:53:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=GOm6kYJU; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238434AbjFMFoA (ORCPT + 99 others); Tue, 13 Jun 2023 01:44:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234713AbjFMFn4 (ORCPT ); Tue, 13 Jun 2023 01:43:56 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2078.outbound.protection.outlook.com [40.107.212.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C491610B; Mon, 12 Jun 2023 22:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e0KEW9bDfeUf+ni6Z6iMT01jE+NW8lyh8FQ1xiqi9iknc01Beu7zmXcL/qZCPilCvJDzwFSI+oVGBPGGxJ24ADtc4rVm2jmXQRq39w1BTF2cyjWy0OeJWnfqPs9t4NJteVLqdsP1DkQSRagVl/zpTfsb9MkH8jZCybYKHqLg+zDXwqSajH5vx6WlZmncGz2O/g5CGd9b+65TNEG0oS8bjdj6Vtt6lMh0nZa+5bvYbFST6TcLQOPeQYMsVG4EUezyizXKq9xb5uF2+6+LepAqJiM4NYxS9/BdJpzsrwY9EGpXJ5sjAxI0pTB93SMUm7tRCmnkojmRxRvksePXJSzutA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dYLTxX0l/jxO8pwuVApuh76rSCUtE8Nn5+Qauar02ls=; b=jJjqFQANfyRyXbXnYaWo5fs9m1bJrTYnV1+8XtlrwM5nfmu8UFgGXzngBwImu+RFETFfe66dsPhAiqTi2r/WNa+rlf7xkTmOs+QSxOZUvYMCkpN1ts/aGLdGft0gYSpvsA3F6AaWbCbbj+9eFpdzd/iQiUuI9QQ1DqcOA0+Zu4yWBZfKROa/eZ+nLTaYZfMatJKK2e53nJjFAbPPJOuwzmvzejWUmHXso8GcVNpN36qJn/7xtm2jyoZeZWAVjeN8j3Dh61d+uCKu+ZPKuL63Kp4CqS7hhwlKDFKlr4pXoVbATwFFxRXZAh2jLV+Vco0c5qm73MX5ULvd+X/2xomXKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dYLTxX0l/jxO8pwuVApuh76rSCUtE8Nn5+Qauar02ls=; b=GOm6kYJUN0twJm2UR9aBmbHdN95L09HqWyML54CtfAHwyGJQYW6YHxumVqvuXMvbGHyDDjUYDRBnGm7SlRSVihWoSLwipVarwDdmysEOkmCzPpxPSA0tRpsNWBwLg+ZPpRyd7Fsa7IUegYqyY2s8T8GdvzIoS1iIa8ucHRY3+M8= Received: from DM6PR03CA0044.namprd03.prod.outlook.com (2603:10b6:5:100::21) by PH0PR12MB7906.namprd12.prod.outlook.com (2603:10b6:510:26c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Tue, 13 Jun 2023 05:43:52 +0000 Received: from CY4PEPF0000E9D7.namprd05.prod.outlook.com (2603:10b6:5:100:cafe::7e) by DM6PR03CA0044.outlook.office365.com (2603:10b6:5:100::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.35 via Frontend Transport; Tue, 13 Jun 2023 05:43:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000E9D7.mail.protection.outlook.com (10.167.241.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6500.22 via Frontend Transport; Tue, 13 Jun 2023 05:43:50 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 13 Jun 2023 00:43:50 -0500 Received: from xhdpranavis40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Tue, 13 Jun 2023 00:43:46 -0500 From: Pranavi Somisetty To: , , , , , , , CC: , , , , , , , Subject: [PATCH net-next v4 1/2] dt-bindings: net: cdns,macb: Add rx-watermark property Date: Mon, 12 Jun 2023 23:43:39 -0600 Message-ID: <20230613054340.12837-2-pranavi.somisetty@amd.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20230613054340.12837-1-pranavi.somisetty@amd.com> References: <20230613054340.12837-1-pranavi.somisetty@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D7:EE_|PH0PR12MB7906:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d1d4a7a-0363-447c-21e3-08db6bd12aa0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qerAZaiCEwPjBvhuz9ypoaW6PZKz0GU/oVWnud/a57r3zhKTMCdJQLnG1LCv1355eL6mt5KYLH9C5a0jiX3ofhjWpBCPvcWBHwpThYCRncjOJQ1FPXn0YnzD0HqUfXzSkhoYqAK87uYPZJlspAR6z1WpGP/l6H2bjP7MyLWoabeIlOONHJ55IJNHfzAAAK/QDxqQ9ZOtw3mQ1DY4hwR28eWc9yLRxIFVSOMk6duyN2D0RShc05/5mF9W9OGSrJDlqVlTM1KkyOkFSWKWz/2AXA4lg+BT325ks5TSiZQx1wq+wmsiKbaudKkNbZEB6AN9tEPOmxb4PXlvkP6wSuxrTpWsvwbWZkKUIdz21JL9CCTOMOWKFNPE0zFxjJ3mDrAM/Yc5HwN0ApFzmiv/MavtiG8xuYYVzSiLeQ5/A6B6mVFFe3IeJN1cbvwVBLgOj/kCMFRrR+a/whtOb2GVUYqutEiv1/2lqGQqt2aMY3SxBuI1suYcHvB4Tkrb0oz3krlC13ks5u+NG7lQ6bPbKlSeNHLEkmSmwgbSivUpfUrMq/ohrk6PUIYWuQH/aSPs9jD4eDV5yZvVOhQaQuATiVU3U0VcZGSBsx5Pn/xAeQoXWkEvkDDXbQwqx7pAz3pK7GuuKKVdw29ltGK+WrOH9fkUqI1/iOywcgVJCJB5II6VCc4GV02OE3MAZ4+/xYglGAw1R0kuias8LzdngZ8LD612JWrXD1Edq4dkN+CyOCGwmkfhgPaSa8la0HQh+UrKs+svp8X4CLAhf7/JKSN+7VaBHA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(396003)(39860400002)(136003)(451199021)(46966006)(36840700001)(40470700004)(40480700001)(40460700003)(110136005)(54906003)(82740400003)(81166007)(356005)(478600001)(70586007)(5660300002)(8936002)(41300700001)(8676002)(70206006)(4326008)(316002)(186003)(336012)(36860700001)(83380400001)(47076005)(6666004)(26005)(426003)(1076003)(2616005)(82310400005)(7416002)(44832011)(2906002)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2023 05:43:50.9594 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d1d4a7a-0363-447c-21e3-08db6bd12aa0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9D7.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7906 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768565634528247253?= X-GMAIL-MSGID: =?utf-8?q?1768565634528247253?= watermark value is the minimum amount of packet data required to activate the forwarding process. The watermark implementation and maximum size is dependent on the device where Cadence MACB/GEM is used. Signed-off-by: Pranavi Somisetty Acked-by: Krzysztof Kozlowski Acked-by: Nicolas Ferre --- Changes v2: None (patch added in v2) Changes v3: 1. Fixed DT schema error: "scalar properties shouldn't have array keywords". 2. Modified description of rx-watermark to include units of the watermark value. 3. Modified the DT property name corresponding to rx_watermark in pbuf_rxcutthru to "cdns,rx-watermark". 4. Modified commit description to remove references to Xilinx platforms, since the changes aren't platform specific. Changes v4: 1. Modified description for "rx-watermark" property in the DT bindings. 2. Changed the width of the rx-watermark property to uint32. --- Documentation/devicetree/bindings/net/cdns,macb.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml index bef5e0f895be..bf8894a0257e 100644 --- a/Documentation/devicetree/bindings/net/cdns,macb.yaml +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml @@ -109,6 +109,16 @@ properties: power-domains: maxItems: 1 + cdns,rx-watermark: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + When the receive partial store and forward mode is activated, + the receiver will only begin to forward the packet to the external + AHB or AXI slave when enough packet data is stored in the SRAM packet buffer. + rx-watermark corresponds to the number of SRAM buffer locations, + that need to be filled, before the forwarding process is activated. + Width of the SRAM is platform dependent, and can be 4, 8 or 16 bytes. + '#address-cells': const: 1 @@ -166,6 +176,7 @@ examples: compatible = "cdns,macb"; reg = <0xfffc4000 0x4000>; interrupts = <21>; + cdns,rx-watermark = <0x44>; phy-mode = "rmii"; local-mac-address = [3a 0e 03 04 05 06]; clock-names = "pclk", "hclk", "tx_clk"; From patchwork Tue Jun 13 05:43:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Somisetty, Pranavi" X-Patchwork-Id: 107106 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp344665vqr; Mon, 12 Jun 2023 23:46:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6W0/OfF5jPEsY4dNYmtjaQBYcRJIBgtlAVACuVNQC4sc6yvI5CjHw0DjyzxerCu9N+YuGS X-Received: by 2002:a05:6a20:7d94:b0:11a:ce33:563a with SMTP id v20-20020a056a207d9400b0011ace33563amr6908687pzj.15.1686638786255; Mon, 12 Jun 2023 23:46:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686638786; cv=pass; d=google.com; s=arc-20160816; b=MJ1JRzQ04/sGzkjYDdzwE3XB6jj6NdgMeuXIzuwSoGswfpco5ucdfn59LEzmyjQLCU RpUNAxuBjtgzrKn86pR652WgmrCJx3VdbUtUGe9fxGfV7d5Mur9wyTtlixEKoqJHqCbw yjvEvQdLiAhzac+6+Tt0D9hzSxzr98oahU6iROe/antGm4FOGvNxKHm/AbudH+47tS0y 5BA/WhFl9hGinj5FGmNvHOi921QTY4BK6eJYiUlJ1NX/iB+1buknminFOISmwVcSacbk nkJq/D7rCTMW0dU1R0CAcP+FTEx2xeNwRKcjWDRVH8SVtMdj7CNz9d0SOc8oa66+ZHGv MGgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SdJwUsmiQHPxWhFrxGvSpVWxbw+DO65eVEH0CjIqn04=; b=HRM+DHHi+oCNh7ZVX6DP+5e02zXgVua4+8cG5AsKewohOH/u/9aEPkVaFA/UoaXl6E EiHQr+fTfDdOnCBmNjxggajlVVenVIdmGm9gx3JDGR4ABp7L9z3JjydSLuCrXZKSKdbz t/1soNmh8Rqojl60mzxQbCXgnQc89Mz/c78eOXmEH9+eaHN02xIFLqy+n6DnDv3vrMls KPzg3P+zowpLsv1qw1Bs3G/vIPzz47v3d5KACvid6Z16y9uTck3Eb0Y1in8+1/3dD0eS +Q6cals6+PwYj6/bLWLhIS7/nWCPUWcnXOpDIkoBlTcfDG8gmJ159x1/HAGiqw0PJ/ug 8RYQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=tH6t01RV; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l69-20020a638848000000b0053fbe7c8d3dsi8155531pgd.632.2023.06.12.23.46.12; Mon, 12 Jun 2023 23:46:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=tH6t01RV; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240032AbjFMFoN (ORCPT + 99 others); Tue, 13 Jun 2023 01:44:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239996AbjFMFoI (ORCPT ); Tue, 13 Jun 2023 01:44:08 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2086.outbound.protection.outlook.com [40.107.243.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB99CE4E; Mon, 12 Jun 2023 22:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oM7z80IZqRaYyQp2YI1JOHMAmvtGCZn5fMIVH+UXz3GIQWCV+dLcBbQytk/IFddq+u35ag4SvT+H9SHLujCGjJeG4Ln78LuKRF1xZoa5JgpWcgtGJCejUv8zP+30BH49M2KmtvhnWoRp9RrAL9QvGgYGfEyUrQM9jbTBPQ+p2ja8FTS3BE99JRTq2JMK0qyTPRvzqR5ZKMX3ZV74quy9i4XZsqO7/rvgOxwdVfKgQT6g929pWN/6KOgOzF9Dc9bo2adN43PayOYeHd2sW3BfH3FkNwH2VuauhXuOJy0DHHytdGs9EHDCBuz7ewfvWKiC8ZCwSgg/87M8bWocw2qw/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SdJwUsmiQHPxWhFrxGvSpVWxbw+DO65eVEH0CjIqn04=; b=C88vzFRcY2tMR35R+LssDEYiFBFitRKLnFOZM8Mt2mCXNy8J6Yojm1wK1WwDaYyBo5a+HKKyiPuBMYib6uGPzpwjnyph6Rr5B7EY48RtulX0AiQQxo1j7WMuD8o9F7LMWrwOaV6ordOLmdqSuq8K0ev35CB9S17Oxi1K9SBB/9/4ZPhAkZCuYc+zzYoLozTmXhCz67PvL7QDNkUZJfvK+3iNQ8vrUXLjpjBHJX1VFpVEQHNEJUmU3mjSGVXH35j7OO4p6GK2vV2+c7GovjA7TpFsCEeHYdlFHteetoowBPJ1ZBkm5TwnH/TeZSoZzdp/QQ5U297y/psX15Vbxrmpow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=davemloft.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SdJwUsmiQHPxWhFrxGvSpVWxbw+DO65eVEH0CjIqn04=; b=tH6t01RVKRP6dH7tIhlfXT8uAKyVPRd3fC2AphGHt2FCJeuHRwz7BePoOW+WPUEzV78yIkWV2TNF50Vluzj4XOjgF3TA5GAKzA2lWQp3dtJR54tXr+Q2lDQJIzwH6jWHbO6FcOuS9Wfb6pR56ihuVIf25PlZhG6759MRhsjcP6o= Received: from MW4PR03CA0161.namprd03.prod.outlook.com (2603:10b6:303:8d::16) by CH0PR12MB8508.namprd12.prod.outlook.com (2603:10b6:610:18c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.29; Tue, 13 Jun 2023 05:43:56 +0000 Received: from CO1PEPF000044F2.namprd05.prod.outlook.com (2603:10b6:303:8d:cafe::53) by MW4PR03CA0161.outlook.office365.com (2603:10b6:303:8d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.35 via Frontend Transport; Tue, 13 Jun 2023 05:43:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1PEPF000044F2.mail.protection.outlook.com (10.167.241.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6500.23 via Frontend Transport; Tue, 13 Jun 2023 05:43:55 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 13 Jun 2023 00:43:54 -0500 Received: from xhdpranavis40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Tue, 13 Jun 2023 00:43:50 -0500 From: Pranavi Somisetty To: , , , , , , , CC: , , , , , , , Subject: [PATCH net-next v4 2/2] net: macb: Add support for partial store and forward Date: Mon, 12 Jun 2023 23:43:40 -0600 Message-ID: <20230613054340.12837-3-pranavi.somisetty@amd.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20230613054340.12837-1-pranavi.somisetty@amd.com> References: <20230613054340.12837-1-pranavi.somisetty@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F2:EE_|CH0PR12MB8508:EE_ X-MS-Office365-Filtering-Correlation-Id: be0d22d6-7a94-4e2d-4a83-08db6bd12d91 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /w2vRK35tUqkFMtwns8rew5QZ035k2XnAsNI/sgX25j9/ovNaisrVLrbPcMKP7PtoUPUqfDDmZ+s7pCZihv7lVonNAEp9XxX/RMhdtWUnTJUpcp6oeR5SHqpR96gra72fE27UsvUBKyrD1pS161QEQyZm1vbKHij+RM+XDE7reeTix497dXD+kTLW2uuXYkRy57/8HJIZArP2CfTB1SC/r7gpssX44t7emF+zV8cQKW17H1/cQBJdCs8RpcgeArOj7ipjSdrVqiRLLzKjUR98oLCZYDsMnIaZfstrKj6BeLZ/0lOC1OQMN4yboxkWLMruwK4bhE+C+NKkwUZ/jadRh/R+jZFeF43SPyQYJyMXx0jGx6FbvjJAcj18HQ+q2/WTEvxLGUoI8AzulKEhBKNxhM1YSiuxGiKsRKxhtrX5LQq9JY3ENL9ZOQQvyFfskPhHovH/hebcw7eXZiBtOUxbUHIZVOA+AXXihrnVuGmaGm8bTZzuh7jvra3Wa89dgaFhHrbM8QniG6Ybvz1591WsYMK8B0wO6zGnZwM1T5JKhoSfHxb+MZF3Va1IfWJyfQpMevZCuk30vczXtU3FQgpC0x02C2MMvjH5KJerrAFm9V50Z/UxKE8duk5UeYo8LSHHHd9ciY/ocVn5F3uVG53qpcyk0iYDokQVncj7Rcaopj1nPtxTfvEVgueGx4caPnfKkyMe0PDGtE9tNKwyzULkp27CPi/2Ule3KZ9zsl/YB6mdcIsUYIoHM4u/z8ExU4+K3qArOviE6/pXWz3SpSV1w== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(39860400002)(136003)(396003)(451199021)(36840700001)(40470700004)(46966006)(4326008)(44832011)(316002)(7416002)(41300700001)(70206006)(70586007)(186003)(2906002)(54906003)(110136005)(8676002)(8936002)(5660300002)(478600001)(6666004)(40460700003)(1076003)(82740400003)(81166007)(40480700001)(36860700001)(26005)(356005)(336012)(83380400001)(47076005)(426003)(36756003)(82310400005)(2616005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2023 05:43:55.8484 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: be0d22d6-7a94-4e2d-4a83-08db6bd12d91 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000044F2.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8508 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768568952250032495?= X-GMAIL-MSGID: =?utf-8?q?1768568952250032495?= From: Maulik Jodhani When the receive partial store and forward mode is activated, the receiver will only begin to forward the packet to the external AHB or AXI slave when enough packet data is stored in the packet buffer. The amount of packet data required to activate the forwarding process is programmable via watermark registers which are located at the same address as the partial store and forward enable bits. Adding support to read this rx-watermark value from device-tree, to program the watermark registers and enable partial store and forwarding. Signed-off-by: Maulik Jodhani Signed-off-by: Pranavi Somisetty Reviewed-by: Claudiu Beznea Acked-by: Nicolas Ferre --- Changes v2: 1. Removed all the changes related to validating FCS when Rx checksum offload is disabled. 2. Instead of using a platform dependent number (0xFFF) for the reset value of rx watermark, derive it from designcfg_debug2 register. 3. Added a check to see if partial s/f is supported, by reading the designcfg_debug6 register. Changes v3: 1. Followed reverse christmas tree pattern in declaring variables. 2. Return -EINVAL when an invalid watermark value is set. 3. Removed netdev_info when partial store and forward is not enabled. 4. Validating the rx-watermark value in probe itself and only write to the register in init. 5. Writing a reset value to the pbuf_cuthru register before disabing partial store and forward is redundant. So removing it. 6. Removed the platform caps flag. 7. Instead of reading rx-watermark from DT in macb_configure_caps, reading it in probe. 8. Changed Signed-Off-By and author names on this patch. Changes v4: 1. Removed redundant code and unused variables. 2. When the rx-watermark value is invalid, instead of returning EINVAL, do not enable partial store and forward. 3. Change rx-watermark variable's size to u32 instead of u16. --- drivers/net/ethernet/cadence/macb.h | 12 +++++++++++ drivers/net/ethernet/cadence/macb_main.c | 27 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 14dfec4db8f9..39d53117a8ce 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -82,6 +82,7 @@ #define GEM_NCFGR 0x0004 /* Network Config */ #define GEM_USRIO 0x000c /* User IO */ #define GEM_DMACFG 0x0010 /* DMA Configuration */ +#define GEM_PBUFRXCUT 0x0044 /* RX Partial Store and Forward */ #define GEM_JML 0x0048 /* Jumbo Max Length */ #define GEM_HS_MAC_CONFIG 0x0050 /* GEM high speed config */ #define GEM_HRB 0x0080 /* Hash Bottom */ @@ -343,6 +344,10 @@ #define GEM_ADDR64_SIZE 1 +/* Bitfields in PBUFRXCUT */ +#define GEM_ENCUTTHRU_OFFSET 31 /* Enable RX partial store and forward */ +#define GEM_ENCUTTHRU_SIZE 1 + /* Bitfields in NSR */ #define MACB_NSR_LINK_OFFSET 0 /* pcs_link_state */ #define MACB_NSR_LINK_SIZE 1 @@ -509,6 +514,8 @@ #define GEM_TX_PKT_BUFF_OFFSET 21 #define GEM_TX_PKT_BUFF_SIZE 1 +#define GEM_RX_PBUF_ADDR_OFFSET 22 +#define GEM_RX_PBUF_ADDR_SIZE 4 /* Bitfields in DCFG5. */ #define GEM_TSU_OFFSET 8 @@ -517,6 +524,8 @@ /* Bitfields in DCFG6. */ #define GEM_PBUF_LSO_OFFSET 27 #define GEM_PBUF_LSO_SIZE 1 +#define GEM_PBUF_CUTTHRU_OFFSET 25 +#define GEM_PBUF_CUTTHRU_SIZE 1 #define GEM_DAW64_OFFSET 23 #define GEM_DAW64_SIZE 1 @@ -1283,6 +1292,9 @@ struct macb { u32 wol; + /* holds value of rx watermark value for pbuf_rxcutthru register */ + u32 rx_watermark; + struct macb_ptp_info *ptp_info; /* macb-ptp interface */ struct phy *sgmii_phy; /* for ZynqMP SGMII mode */ diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 41964fd02452..7d023b92b169 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -2617,6 +2617,9 @@ static void macb_reset_hw(struct macb *bp) macb_writel(bp, TSR, -1); macb_writel(bp, RSR, -1); + /* Disable RX partial store and forward and reset watermark value */ + gem_writel(bp, PBUFRXCUT, 0); + /* Disable all interrupts */ for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) { queue_writel(queue, IDR, -1); @@ -2770,6 +2773,10 @@ static void macb_init_hw(struct macb *bp) bp->rx_frm_len_mask = MACB_RX_JFRMLEN_MASK; macb_configure_dma(bp); + + /* Enable RX partial store and forward and set watermark */ + if (bp->rx_watermark) + gem_writel(bp, PBUFRXCUT, (bp->rx_watermark | GEM_BIT(ENCUTTHRU))); } /* The hash address register is 64 bits long and takes up two @@ -4923,6 +4930,7 @@ static int macb_probe(struct platform_device *pdev) phy_interface_t interface; struct net_device *dev; struct resource *regs; + u32 wtrmrk_rst_val; void __iomem *mem; struct macb *bp; int err, val; @@ -4995,6 +5003,25 @@ static int macb_probe(struct platform_device *pdev) bp->usrio = macb_config->usrio; + /* By default we set to partial store and forward mode for zynqmp. + * Disable if not set in devicetree. + */ + if (GEM_BFEXT(PBUF_CUTTHRU, gem_readl(bp, DCFG6))) { + err = of_property_read_u32(bp->pdev->dev.of_node, + "cdns,rx-watermark", + &bp->rx_watermark); + + if (!err) { + /* Disable partial store and forward in case of error or + * invalid watermark value + */ + wtrmrk_rst_val = (1 << (GEM_BFEXT(RX_PBUF_ADDR, gem_readl(bp, DCFG2)))) - 1; + if (bp->rx_watermark > wtrmrk_rst_val || !bp->rx_watermark) { + dev_info(&bp->pdev->dev, "Invalid watermark value\n"); + bp->rx_watermark = 0; + } + } + } spin_lock_init(&bp->lock); /* setup capabilities */