From patchwork Wed Oct 13 22:23:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12557431 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 D7C60C433EF for ; Wed, 13 Oct 2021 22:29:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A5B8561152 for ; Wed, 13 Oct 2021 22:29:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A5B8561152 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IXtEj4ZvuyEXvU0/kpoHpQizU+UdXA8PJzvQg9H/Ats=; b=EqiIvYTiOKSasY oEpas09MJgSYOSwkBDXvyaVbPuQipjAfiYo/gk5mF8AkE3Lttx6FnrDOv/Zbg/c+B2ZMQTkWPmpU8 j9zFk+wl7zQmlhPuh12nqimCScRvYpQdeSbZGEogfh9AWCcaZKXSSjAdZq2ghH9E+lAlJM4Rs7No3 ndkjQRAeZb97BondCIc54gPA+TOBatMFZycIO54ne57/9fYFzb3r8SAjIe94xFbwesuFwEfg+VPFR HKLmGUFJscGE9VQP9PajhTiqwi/HndZLWmeN+oOxLxf09mVzDuE7ezKmV7K4pnOCcVZKuRgLoDrY5 keF7I53LEJeaNkhOwSkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mamiK-000qLE-2S; Wed, 13 Oct 2021 22:27:10 +0000 Received: from mail-db8eur05on2046.outbound.protection.outlook.com ([40.107.20.46] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mamfs-000pIr-IV for linux-arm-kernel@lists.infradead.org; Wed, 13 Oct 2021 22:24:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GBLsbaEaknpqFY7sewK3Uvx/mou3FzXgSoV0eRHw3kOYqp9RIwlujZyNtpJfGGCLFpRB5Ie58ilSzyGYGwIUFnPuRWKDI0QTTxtJwwOCJKB2qBEXQxhCoAKdOMJRnSRzq8IHCR+RD2CqZnOZWlkpNqkwKULsMjoo4Bj9gl6ZvnD4XJA4MSeg97gdbuuI1yvuOEiNACzpONH4wWkMXLcSSZ47xj8IpPKptSWd4lAVlXNdBA8Y0VXYQiARQ5cJEStpOn6CKDxpDCralWD56t+caDhfpI6eX0ay6+fFI9LGiVfnN+0euCgDshBqmIKzv3UwSfdrf79H1GahR9OWR2gN3Q== 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=fP2W43y4NZhUeiHwnoOz9f1Gg3lG4GAcNsaDHuu8td8=; b=nP80FVYy3UovL3WFyBOB+PbEENWEBgBZKhpcL3l1PkWI6hnOKZwoCHnPcHUsJw3puEyqVnnGV23fhgukxDvMate6O9eZwqLOSX+ClNcYGkHV0wTjnxXaHG8BivlV2rd1CkooFhaLowuap6UCBBrMEvi1e6XS6Wcadg87hg+WOTyupnNGHKP6Y7vxHb0jOzi8jNr2dkwW2mZfcfQiB+ycKW1WWqTwcj3yKiIoeGWam9oyXbNIlv/HREGDc053oy0mZlu42Yy7E3C42zIEAeZ5kjOhRfIjaa/tcTA9Mmyd+isLGPiIutlC8xM+/ZBk3yoIzmhVdY+qijhSSkO7KKSXUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fP2W43y4NZhUeiHwnoOz9f1Gg3lG4GAcNsaDHuu8td8=; b=g6n44D3F59rmYlKYa0RBcmv3x9fpsDt8pJsMrw/OZwXv0NPfzHKPAe6kHDfpY8i40fkBNXZiVrGgq81QFhUrszW6Zj/4vFDC6rxuKl7r6sEnUfkttrVrklO4wxpQ4tUxyagUqnCoUBXhOklezHYudKS0pDPM1VUdZL80OsVTQ/Y= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by VI1PR04MB4816.eurprd04.prod.outlook.com (2603:10a6:803:5b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15; Wed, 13 Oct 2021 22:24:25 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::e157:3280:7bc3:18c4]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::e157:3280:7bc3:18c4%5]) with mapi id 15.20.4587.026; Wed, 13 Oct 2021 22:24:25 +0000 From: Vladimir Oltean To: "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rob Herring , Shawn Guo , Andrew Lunn , Heiner Kallweit , Russell King , Vivien Didelot , Vladimir Oltean , Florian Fainelli , Prasanna Vengateshan , Ansuel Smith , =?utf-8?q?Alvin_=C5=A0ipraga?= Subject: [PATCH net-next 5/6] dt-bindings: net: dsa: sja1105: add {rx, tx}-internal-delay-ps Date: Thu, 14 Oct 2021 01:23:12 +0300 Message-Id: <20211013222313.3767605-6-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211013222313.3767605-1-vladimir.oltean@nxp.com> References: <20211013222313.3767605-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM3PR05CA0154.eurprd05.prod.outlook.com (2603:10a6:207:3::32) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 Received: from localhost.localdomain (188.26.53.217) by AM3PR05CA0154.eurprd05.prod.outlook.com (2603:10a6:207:3::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16 via Frontend Transport; Wed, 13 Oct 2021 22:24:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5244aee5-9555-41cd-2571-08d98e98366c X-MS-TrafficTypeDiagnostic: VI1PR04MB4816: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +ErV0lFk03rRGOtptc+25nydymfxbTZiexGL5H6lq77ApaVZj14knmt0SVE0udQjug21ZY2bUYf4gaIN5WN53SkhkfC3D6ghRLGfoCv+26VlMMyai4mqGdh4mHTLUba1lYywnB1M84n4NUCfMMiA4c1q+Y5D/Mb227YHwd4MO9XGtkEx1AKWw672WR8dfSpCxJ5D4O30sqjG5j8lCkvql+JU5jO+zCANYqULuD2GYFgKf0xsfcbWNxdP/l2NAHSeRWUyJp2WeK/BT4ZP60OZnYiWdT/t8mTBBL1SWcqQwgCgicqnGCHxh422dJFQWZCxJKOoqXwPZTSOMExud67O+2RAXWhOdM0OYfLQoGgzyZany7YZiiL7aITYpamtJFkfk8hhej1yf2EkX4EaG6lDgNyAb6t3i2nbhSTY448H61/dgypQOgSHYg8+YGS+jh9WCjz/bN5ogQQB9SdMLgaisHxM/8HCrT4YwFxfFWW1HUno6agWQ1+9KoGUonqX8sJrxtM+vl5+T6HAHsVMiQ4yXL00g+KLuO9yqq02wziZlAiIyX+8IZlArnw/jVQGe4TsfMHrS9fynb6jEOZ3Xz7dKGGpZbnG7K9twwjspIdm/ilLMWR6n96NKn8CH0E0osz7xIWTqCySCpl+nEQnFKfbn1+gcBDjQbIn0KtzQKp98F7Y0b0xK+p9KkM8DSJAFa2ArZnVDkDpuzcDCHP8BalIvw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5136.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(7416002)(956004)(38350700002)(1076003)(38100700002)(6666004)(2616005)(6486002)(26005)(316002)(54906003)(110136005)(2906002)(8676002)(6506007)(36756003)(66946007)(6512007)(66556008)(66476007)(8936002)(186003)(4326008)(86362001)(508600001)(44832011)(5660300002)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FtMbOcs8uRORZa77Pd9z/avsBR1m5idoDeaycp1ULDEuzlCnpY/AynuVibAlBL5sv7fFkKZ6JeduL7gIQi3LifMxfwxl2QC2+KFp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UVw8AqxFJGXmlgjS5TYZ4oKW6RMsxON2h4JP4PObUy7r+xcJEYhMZj7s0T6+Sqaixz/f6M/XQOEQ03nWc7++yHFIOrLuBxukdPf7QzgyQRmT9LvGKGpgdbSv5VrfcegI1VTlEhrLsz00sxIT5X5Oh2jjxgYzru0q+lu542 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5244aee5-9555-41cd-2571-08d98e98366c X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2021 22:24:25.0235 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Zu8P/M3oWUIXBada5goXS4rCwr0sH3RLvK6ARsspgBq5wqt1arnrVhe0zwxBdp5jiYNBuRhc9XnMINj2kkeaEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4816 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211013_152436_680064_C01FAC2B X-CRM114-Status: GOOD ( 13.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a schema validator to nxp,sja1105.yaml and to dsa.yaml for explicit MAC-level RGMII delays. These properties must be per port and must be present only for a phy-mode that represents RGMII. We tell dsa.yaml that these port properties might be present, we also define their valid values for SJA1105. We create a common definition for the RX and TX valid range, since it's quite a mouthful. We also modify the example to include the explicit RGMII delay properties. On the fixed-link ports (in the example, port 4), having these explicit delays is actually mandatory, since with the new behavior, the driver shouts that it is interpreting what delays to apply based on phy-mode. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- .../devicetree/bindings/net/dsa/dsa.yaml | 4 ++ .../bindings/net/dsa/nxp,sja1105.yaml | 42 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml index 9cfd08cd31da..2ad7f79ad371 100644 --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml @@ -97,6 +97,10 @@ patternProperties: managed: true + rx-internal-delay-ps: true + + tx-internal-delay-ps: true + required: - reg diff --git a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml index f97a22772e6f..0bbaefacdaba 100644 --- a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml +++ b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml @@ -74,10 +74,42 @@ properties: - compatible - reg +patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-9]+$": + allOf: + - if: + properties: + phy-mode: + contains: + enum: + - rgmii + - rgmii-rxid + - rgmii-txid + - rgmii-id + then: + properties: + rx-internal-delay-ps: + $ref: "#/$defs/internal-delay-ps" + tx-internal-delay-ps: + $ref: "#/$defs/internal-delay-ps" + required: - compatible - reg +$defs: + internal-delay-ps: + description: + Disable tunable delay lines using 0 ps, or enable them and select + the phase between 1640 ps (73.8 degree shift at 1Gbps) and 2260 ps + (101.7 degree shift) in increments of 0.9 degrees (20 ps). + enum: + [0, 1640, 1660, 1680, 1700, 1720, 1740, 1760, 1780, 1800, 1820, + 1840, 1860, 1880, 1900, 1920, 1940, 1960, 1980, 2000, 2020, 2040, + 2060, 2080, 2100, 2120, 2140, 2160, 2180, 2200, 2220, 2240, 2260] + unevaluatedProperties: false examples: @@ -97,30 +129,40 @@ examples: port@0 { phy-handle = <&rgmii_phy6>; phy-mode = "rgmii-id"; + rx-internal-delay-ps = <0>; + tx-internal-delay-ps = <0>; reg = <0>; }; port@1 { phy-handle = <&rgmii_phy3>; phy-mode = "rgmii-id"; + rx-internal-delay-ps = <0>; + tx-internal-delay-ps = <0>; reg = <1>; }; port@2 { phy-handle = <&rgmii_phy4>; phy-mode = "rgmii-id"; + rx-internal-delay-ps = <0>; + tx-internal-delay-ps = <0>; reg = <2>; }; port@3 { phy-handle = <&rgmii_phy4>; phy-mode = "rgmii-id"; + rx-internal-delay-ps = <0>; + tx-internal-delay-ps = <0>; reg = <3>; }; port@4 { ethernet = <&enet2>; phy-mode = "rgmii"; + rx-internal-delay-ps = <0>; + tx-internal-delay-ps = <0>; reg = <4>; fixed-link {