From patchwork Fri Jun 17 20:32:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1644939 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=seco.com header.i=@seco.com header.a=rsa-sha256 header.s=selector1 header.b=ohAfKwWT; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LPrNW53vTz9sG0 for ; Sat, 18 Jun 2022 06:33:47 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350035AbiFQUdp (ORCPT ); Fri, 17 Jun 2022 16:33:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347978AbiFQUdk (ORCPT ); Fri, 17 Jun 2022 16:33:40 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2075.outbound.protection.outlook.com [40.107.22.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78A3F580DA; Fri, 17 Jun 2022 13:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aE6EUyUoIiz4ef7e47Wk6uKMQEDxLp+PwnyG8y7925grTx3MkAskygB9YloLxcIwk/6/OJ50KbPpT/aU6M1wQjXsIck6H3KGeAt/JtSDabUXx6MFCd3Vm+TEFARE2Z5Luin2EDl9ptu2YSvr0SPVgtchK/WgSI/y4XvC46eCBrQt3iAhF/SYAScS+AKKdy/X3sZyJOURYfq/AXP5/pEI+oPTlGultIV1bGXrdMjXxTK12VrNj+/QRwQiAdAxnXNtfE5wWnYbVgJm8E9j2YKrI0TsqqOAyFD0ggayIJmjlxD+9S1TPwYPl2eh10jmSzwanXAPoYa1WQHGSOZleJFyVg== 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=I9glw3505ujB7LUV7Xvsdgo9XaznzsVSm8YHPcXI1rA=; b=GJv/CMXYatwSob/4hGH+q5wZgKsRMt+Q4e4Nkt2WFHzzREkFOnUsv2rKbDYz3ZxbuzmOlqj1tF88WRhSD9nQf/x3+UHv3XV+MMlRDpPWnauajbTOcZJR9dkY77XOasrMFg1a3mLWY8ZkxFhl/WqCRPuXMXtRFng8XebqWn/osK1EkfMddRl418WkD6iLv6EkW/uAXBS/TECr81YPvuhFBoeE4q+BwHX36rz9CPgeAbKgk/JJZRsU4qlYMKTtk9cWc/MMIlTgvn5SW+VYk3gf/aA0++IhTCHjkkZ+LAjnfyRoJANacbG4x84gDGGRkA581dP6Wa6YDoMPKEFGfYSFfA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I9glw3505ujB7LUV7Xvsdgo9XaznzsVSm8YHPcXI1rA=; b=ohAfKwWTYxKU0rxVrkV5eAA3g09sw+LFpY4MSwW7/8RaLDsVbnLwjkT/nt+fjE8ZNvcXZ99H1UXPk5xgNwcPm7FFtHtLCpf7XyxRdZ4g2KYreOBsXA739Ku6bflsc4BOMbx+gVCC0+teazhdTKql9eA1MfcKnN0PTl2f2waJzDFDohyozCpIAumJxmUjehvQbw8HAO89MTxxglHPEW2TGIJOQjRvCPwXKBboqgVb9z3jdkb7739xaQNNr6LPixYDX4CdDfUJl+z4vxzN0jtCGXm/NTayuZCMRFZN4tFNTYKS6yd8nzGfldSzOsM/cJ4l1aCOPsE3tr8CZ+j7KGBEog== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) by DBAPR03MB6438.eurprd03.prod.outlook.com (2603:10a6:10:19f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.16; Fri, 17 Jun 2022 20:33:36 +0000 Received: from VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::d18f:e481:f1fa:3e8d]) by VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::d18f:e481:f1fa:3e8d%7]) with mapi id 15.20.5353.016; Fri, 17 Jun 2022 20:33:36 +0000 From: Sean Anderson To: "David S . Miller" , Jakub Kicinski , Madalin Bucur , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Paolo Abeni , Russell King , Eric Dumazet , Sean Anderson , Kishon Vijay Abraham I , Krzysztof Kozlowski , Rob Herring , Vinod Koul , devicetree@vger.kernel.org, linux-phy@lists.infradead.org Subject: [PATCH net-next 01/28] dt-bindings: phy: Add QorIQ SerDes binding Date: Fri, 17 Jun 2022 16:32:45 -0400 Message-Id: <20220617203312.3799646-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220617203312.3799646-1-sean.anderson@seco.com> References: <20220617203312.3799646-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1PR13CA0384.namprd13.prod.outlook.com (2603:10b6:208:2c0::29) To VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4d3710a1-781e-4353-a8c8-08da50a0a761 X-MS-TrafficTypeDiagnostic: DBAPR03MB6438:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vIbNy8/kBJTo9a7giHXX0tvji/1Ysgr3qmHIBtohuAwASzKtXzf+0NZGagaJjC+YGn706FcEAN7rAo3nFtI49OZhzI+hsymNcAXpyPyadJ5AoC3ACTI1rGAy7ugsb+1Sw6Yj5GFOY9QV5YZNT1pwC/eF+2d9C/cVM713ZeH6IeHO99smWiIZ5mm1OXxsfMW/rHbF8h4oHCwsHof5JBV2bcw4yhElMmV64of9JZg9Gs3x7zRQ8BLSXL1gitN25YhDtHXsXgPlYcLdwXNMoc5mMeazXeyGW35YTxbOnRQgQ6sVziSexRy3hKtjntHM/A8AtgXe2hzu/WRrOn/DvPhu6nubxRtyrGG06yVXWyHPubZHhL+djbLiGTggBiZMFm/yDg95ayuMVDNBSn0aQ1PtcT7V5kB0GT8xahUDFyNsve8T5cZyPxYkboAAXn4sTP3wrR6qTRhAbOUreaer9Kmhug3uppHiLkLz9FCIlCoO4MJPXN0nxvA2A4MfACiW5aVjujjZGCRP3y//QcDauiZm2ZmQcdHQVYgri3ZSWH33bZeXjbsI2LgjsfoYFHvZhtpt6j76P7ZASqxLPgj7K8yTKSrqpu52HJeavEHJ2dHv4a8HasLyHv7xQ327DqYTWDKZeh8mP7uFDXMXpN1QcydISGWHbxJDQGJAMtWARLaXi0eWaGZUPaZToOC8RXk/4oI9ejkaUH79GmJfJhE0+sl9UXrk5YaBeC4Qh93nFCiTRsFyOyvhMhfQTAS9ZkZ71+anM8u+8bDBPzYtn9YpGmOnGVRPwM0FFCRYKw1gK58o4os= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB4973.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(44832011)(38350700002)(86362001)(7416002)(38100700002)(186003)(2616005)(5660300002)(6512007)(966005)(6486002)(52116002)(2906002)(6506007)(110136005)(8936002)(54906003)(498600001)(316002)(1076003)(66946007)(6666004)(36756003)(8676002)(26005)(83380400001)(4326008)(66556008)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: J57FmXDSS69Z5aLJd+TlMO6Rur22TeZdB2qXYnyIpt8kQLuu6PZMxXx6YJ4OKg2SvGHrt5NkTudWS2mYTACt8YOlUdVD5MdfbRoZmFDKHykxwHIpX5Fs+XvegKWywvo5lDrC6Z83ykpPQWU5b60yynmpBwCNw4jHBdzOC5sVH+JCxx/smSNdSvtwc5SD/kDfBfPQhO5iIwp8l3O1AfPgSxBBm8YeUg21vGWbzE2Tw4dAIsSB1pYsWqiVSpZ0mENVX7mNJ+065q147z67oUe2EgU9mZaPrealy62kf2J1L73ypOLClfLu9LbHisiX0eCkHcN2UPvH6Rdgy7cQBhREda2ceKYmBJBiIXJH3ikrMWcw9+esq4I5kEBfquaGn6vb3lKE3CuXfPdb0+bZ0UkPL6wu6wtemIw3uqmKl3Ztd21bkVy62gm53HQ/InrJQsv3pZb0tpJl61yrqWYd2Ra37+u52dVlD06ACoKBlEDBRhWUyd//Lte5dNRggE3QFlta4UP4z4N1dXtSu5mrL/3Svot2Wzg4YN2h4u454QGyi4bLojh6rVoE0GVhPCDs5syMZ9WeD3ZQ++8m4d+DWCH7NlWyki7n9CJ0LJEd56hAIrN+i2H5UjbNRKW32Os1dvDUxzBpmuiqHG+OWhvJdtl2nRYoMHHob5W1u9eLXia3XgXkuKV8LS2e9GBz5FVc6S0cAiFTqN5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g: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d3710a1-781e-4353-a8c8-08da50a0a761 X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB4973.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2022 20:33:36.1718 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: N3zJE5wkTr16go0/puSO+QpRsOP+IUlq+uDpPAVqR07b0JV50TQ4ai+kSMzzwM5nMzqGF8Bu7RrEMICh/0PxDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR03MB6438 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: devicetree@vger.kernel.org This adds a binding for the SerDes module found on QorIQ processors. The phy reference has two cells, one for the first lane and one for the last. This should allow for good support of multi-lane protocols when (if) they are added. There is no protocol option, because the driver is designed to be able to completely reconfigure lanes at runtime. Generally, the phy consumer can select the appropriate protocol using set_mode. For the most part there is only one protocol controller (consumer) per lane/protocol combination. The exception to this is the B4860 processor, which has some lanes which can be connected to multiple MACs. For that processor, I anticipate the easiest way to resolve this will be to add an additional cell with a "protocol controller instance" property. Each serdes has a unique set of supported protocols (and lanes). The support matrix is stored in the driver and is selected based on the compatible string. It is anticipated that a new compatible string will need to be added for each serdes on each SoC that drivers support is added for. There are two PLLs, each of which can be used as the master clock for each lane. Each PLL has its own reference. For the moment they are required, because it simplifies the driver implementation. Absent reference clocks can be modeled by a fixed-clock with a rate of 0. Signed-off-by: Sean Anderson --- .../bindings/phy/fsl,qoriq-serdes.yaml | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/fsl,qoriq-serdes.yaml diff --git a/Documentation/devicetree/bindings/phy/fsl,qoriq-serdes.yaml b/Documentation/devicetree/bindings/phy/fsl,qoriq-serdes.yaml new file mode 100644 index 000000000000..4b9c1fcdab10 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/fsl,qoriq-serdes.yaml @@ -0,0 +1,78 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/fsl,qoriq-serdes.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP QorIQ SerDes Device Tree Bindings + +maintainers: + - Sean Anderson + +description: | + This binding describes the SerDes devices found in NXP's QorIQ line of + processors. The SerDes provides up to eight lanes. Each lane may be + configured individually, or may be combined with adjacent lanes for a + multi-lane protocol. The SerDes supports a variety of protocols, including up + to 10G Ethernet, PCIe, SATA, and others. The specific protocols supported for + each lane depend on the particular SoC. + +properties: + "#phy-cells": + const: 2 + description: | + The cells contain the following arguments. + + - description: | + The first lane in the group. Lanes are numbered based on the register + offsets, not the I/O ports. This corresponds to the letter-based + ("Lane A") naming scheme, and not the number-based ("Lane 0") naming + scheme. On most SoCs, "Lane A" is "Lane 0", but not always. + minimum: 0 + maximum: 7 + - description: | + Last lane. For single-lane protocols, this should be the same as the + first lane. + minimum: 0 + maximum: 7 + + compatible: + enum: + - fsl,ls1046a-serdes-1 + - fsl,ls1046a-serdes-2 + + clocks: + minItems: 2 + maxItems: 2 + description: | + Clock for each PLL reference clock input. + + clock-names: + minItems: 2 + maxItems: 2 + items: + pattern: "^ref[0-1]$" + + reg: + maxItems: 1 + +required: + - "#phy-cells" + - compatible + - clocks + - clock-names + - reg + +additionalProperties: false + +examples: + - | + serdes1: phy@1ea0000 { + #phy-cells = <2>; + compatible = "fsl,ls1046a-serdes-1"; + reg = <0x0 0x1ea0000 0x0 0x2000>; + clocks = <&clk_100mhz>, <&clk_156mhz>; + clock-names = "ref0", "ref1"; + }; + +... From patchwork Fri Jun 17 20:32:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1644940 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=seco.com header.i=@seco.com header.a=rsa-sha256 header.s=selector1 header.b=wkSSndBu; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LPrNY6mTxz9sG0 for ; Sat, 18 Jun 2022 06:33:49 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241902AbiFQUdr (ORCPT ); Fri, 17 Jun 2022 16:33:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346993AbiFQUdl (ORCPT ); Fri, 17 Jun 2022 16:33:41 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2075.outbound.protection.outlook.com [40.107.22.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90EA95A2E1; Fri, 17 Jun 2022 13:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nvCX7sXoKjmsAsX1Q3urF8cZ6nmotqp2N1uHbUZuMIUR1LtWUpZ8tRbQOFhPz6plkRDbAxOo87+FOhG6oryKULC0evhInWpdL0f8WsH+T+MiqItdeIfM2Vsxq0ubdfIgSNy47a85sTb6kPW1BZWeG0bWoMsveiX53t3I6qKlqvf3/x2JCIDyJkN+q/N9BFf0Cgxr2/veU07vgx83KWsZ5bQLbtrECjn+obyF9Cbrnc13qTwyClPA9XB6+8YrjcMdKlZsfEzr7Y4w8mR3IOjgrn4QExmRqiAW0YFUPsfH2FeE+d+dfH0/QZwVH3A8+rDTn9aOFiMDmWdvuuJjl6vPkg== 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=Zyj/IJmSRlxLfh2wYMw1EwqZzLeNjYFdA+pV4NCu+/I=; b=JSZQNhNMKX+CXUsivSG238r+41YpEZNHr/o7RviY3aJY/iqyqvFlXNJH1ofCuVe0qGSASujO3am0fs0DoWguvlh2xZ2omCxyvLkH96S5fvpDn7JdxP+vGbhUs6l0scwiBQlx7hkGEQ1NDgOnwV9sJbTvVC3JLWnslHKpiQkXkHo70czsW7hs9x3pCEaQB+I07+TsGEFCZJhDB7dLDVIgF5QvRoTRFYRtwbEUJ/rkt8EkgWoxqrxh8YSiUORMX+XTbsrZrvkArBNTDRyxe52mxxEnQFjaokCsQgpUzSJ5U3RxIiN7B1hwvz6ohmemZGpEdTfgQ+ypGHtt52VcWYWbGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zyj/IJmSRlxLfh2wYMw1EwqZzLeNjYFdA+pV4NCu+/I=; b=wkSSndBuQ72Dinsg7lkAw5pR2AffpZ6GpeJWATWf8fpxuhRlYbw0X4P4/N/h2Rzvlmx8aXRokwp6yd8Z8dox7lO2WvpFrLDVEQALYdNP2YYfj82AYulgXnig5kORqhxw7/uzZSbZwh06xaJzcbqbjF4lGMJyuyVl/yt2uWeaYlr/Z5dWqNDBkt8XTvI6YvZ6dFXpTQBdpf3NVccl8FsnD7bwiMpwNhkwxVo5urRuszb5oEkZlv3gEV4zqKLAqWiwcRJTLip8tlpusFSxAwBcIJTwvuQ7T8xPOHO0DX7lYMY0tuRUZBwxp4wLC4CGXh3lEsIwHKlJg0nwxaF+aYh9/A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) by DBAPR03MB6438.eurprd03.prod.outlook.com (2603:10a6:10:19f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.16; Fri, 17 Jun 2022 20:33:38 +0000 Received: from VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::d18f:e481:f1fa:3e8d]) by VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::d18f:e481:f1fa:3e8d%7]) with mapi id 15.20.5353.016; Fri, 17 Jun 2022 20:33:38 +0000 From: Sean Anderson To: "David S . Miller" , Jakub Kicinski , Madalin Bucur , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Paolo Abeni , Russell King , Eric Dumazet , Sean Anderson , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH net-next 02/28] dt-bindings: net: fman: Add additional interface properties Date: Fri, 17 Jun 2022 16:32:46 -0400 Message-Id: <20220617203312.3799646-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220617203312.3799646-1-sean.anderson@seco.com> References: <20220617203312.3799646-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1PR13CA0384.namprd13.prod.outlook.com (2603:10b6:208:2c0::29) To VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 460f1894-8877-4f75-597c-08da50a0a8bb X-MS-TrafficTypeDiagnostic: DBAPR03MB6438:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3QcPa+Wtgd5cFCo7mSMQGgEh0zaJl32pCAy83Vww4Xwvz6xc16pAw7ooCf0dLb6WnaYQEg+r0Z++zY6zbCrxQpYFm7eDSrr+6qCZVOtRRgdOrfdQW9fw7begVfqdu8V2/l6v9PexpcPK9p5CeXcyR6mMrqO1f6ZrVInx+ZSYM8Kr42tJIh3H2wJcq5pQte+a1zqbc57U5xDVKdCTfzVgGIwp/RTp+mjk8emApKmF6EsLiaKmuOjkjO9g16z+qaX8DkHXUb2n11amRvI0jzZ7YwzrWuMSRdzjdj/dNlyPXjUIeNRPzjVuUyiadsTlqSpdffzX5yih2m5TVysP6T2wI4gxyK6o9ihlSYs1vz6lQHSBr6r+4D47vYxDig+7ZK7jOrccQPKheZorbU/dMpsTv5PEY3EaqJfI5pxCKUka/QDW6pdpzJ59nw9tptqAbilbMaYUckTg5Zh7pgqF4nW0Au7BUqWfB52BzD91F0kg19sSuEuk6ItRQl9O02ykbqSPJ59Jz78qAV6Es25cBaqqeBE2nSd4se4mi+eXR/9IGE75j0jXONaSJfP/zontBitabwYXye+SiwImHZzzrmL48XRd6U3YACCXAa2OWgnOHDxPuqVX4Ytv/Ewp8M581ft/iUNQM54PZEsFBmq6ux+0wZZ5x9ePTn+cCQk5zpp0J9UmfPAXEtSVY5D5ODiYvFYmIWXGYx6/hLeP47D9xOnoXw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB4973.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(44832011)(38350700002)(86362001)(7416002)(38100700002)(186003)(2616005)(5660300002)(6512007)(6486002)(52116002)(2906002)(6506007)(110136005)(8936002)(54906003)(498600001)(316002)(1076003)(66946007)(6666004)(36756003)(8676002)(26005)(83380400001)(4326008)(66556008)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eA3YThmNpY6Xs2YWxLue1x4xsz/1PpcZbPzxmdX6PtJlPG33mqpbZG+pp0uJ+a6glojD4t6PGygQcnhDQar0YdUIB8op4EttCmnRN6Zy1l4mZ9G9V8ulYfKn89kDLKLc0xd+3rEb4vTegWUcSIjpQOckOvemJhMVbHSYIxC1zINGYtnpo3znzSnSsVRR3TQ59MIjwMDx0HYZSNVvIBj14aLgAuqQnwJeodSnh8XzlMX4sc6Dc5VV4rttWrJ6HfiI8Gl4PuL0XYStLFTBhfl+jGkXto6vCO5P2S3n6rpi9MBnNZvqC7UNa90Vq9fM3gLUEnE+uXYeIUuPeu21sdor7Kh+qgX016E8twq0KsYJpRAa4jOwmmm7GKJL5xPYV51HTOSFYnox3Dmcq7zmMsyG1Enqze4PHz+9HUfM8cIlG4vo8ZCwQA7ixAy8P4vEYmtqNuGsnwI43vpcBMkYln1KVFb3aPv7j9/G9Kbi6wJfLxp+3oIdyDLoLjSQDZZ0bxMF6ip/du3IuniXmTgc8rtYi9rPsf/nLbPMGzSp9x7CRC6Wqp1tY+ll+r1d6/Kg74m5kaU1nqkt0f/qiClQJQ5cMtjI+9mUFCbX69gYP4l33ZS7+NIyIItceZn8zLQIsWq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RBpZGSWylqIFZP6Xxa4ijhoAsGGFZdrs5ky2hKaulgB8rM7U= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 460f1894-8877-4f75-597c-08da50a0a8bb X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB4973.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2022 20:33:38.3280 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: h0kanxtJ2z37DRnn9KblS5AoQhsztuoJw+VIWbQ/LhioLe1sRjKRpq5/oZ5OMcubhj+ovMxRrdN/S2PlImzrgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR03MB6438 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: devicetree@vger.kernel.org At the moment, MEMACs are configured almost completely based on the phy-connection-type. That is, if the phy interface is RGMII, it assumed that RGMII is supported. For some interfaces, it is assumed that the RCW/bootloader has set up the SerDes properly. The actual link state is never reported. To address these shortcomings, the driver will need additional information. First, it needs to know how to access the PCS/PMAs (in order to configure them and get the link status). The SGMII PCS/PMA is the only currently-described PCS/PMA. Add the XFI and QSGMII PCS/PMAs as well. The XFI (and 1GBase-KR) PCS/PMA is a c45 "phy" which sits on the same MDIO bus as SGMII PCS/PMA. By default they will have conflicting addresses, but they are also not enabled at the same time by default. Therefore, we can let the default address for the XFI PCS/PMA be the same as for SGMII. This will allow for backwards-compatibility. QSGMII, however, cannot work with the current binding. This is because the QSGMII PCS/PMAs are only present on one MAC's MDIO bus. At the moment this is worked around by having every MAC write to the PCS/PMA addresses (without checking if they are present). This only works if each MAC has the same configuration, and only if we don't need to know the status. Because the QSGMII PCS/PMA will typically be located on a different MDIO bus than the MAC's SGMII PCS/PMA, there is no fallback for the QSGMII PCS/PMA. MEMACs (across all SoCs) support the following protocols: - MII - RGMII - SGMII, 1000Base-X, and 1000Base-KX - 2500Base-X (aka 2.5G SGMII) - QSGMII - 10GBase-R (aka XFI) and 10GBase-KR - XAUI and HiGig Each line documents a set of orthogonal protocols (e.g. XAUI is supported if and only if HiGig is supported). Additionally, - XAUI implies support for 10GBase-R - 10GBase-R is supported if and only if RGMII is not supported - 2500Base-X implies support for 1000Base-X - MII implies support for RGMII To switch between different protocols, we must reconfigure the SerDes. This is done by using the standard phys property. We can also use it to validate whether different protocols are supported (e.g. using phy_validate). This will work for serial protocols, but not RGMII or MII. Additionally, we still need to be compatible when there is no SerDes. While we can detect 10G support by examining the port speed (as set by fsl,fman-10g-port), we cannot determine support for any of the other protocols based on the existing binding. In fact, the binding works against us in some respects, because pcsphy-handle is required even if there is no possible PCS/PMA for that MAC. To allow for backwards- compatibility, we use a boolean-style property for RGMII (instead of presence/absence-style). When the property for RGMII is missing, we will assume that it is supported. The exception is MII, since no existing device trees use it (as far as I could tell). Unfortunately, QSGMII support will be broken for old device trees. There is nothing we can do about this because of the PCS/PMA situation (as described above). Signed-off-by: Sean Anderson --- .../devicetree/bindings/net/fsl-fman.txt | 49 +++++++++++++++++-- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/net/fsl-fman.txt b/Documentation/devicetree/bindings/net/fsl-fman.txt index 801efc7d6818..25c7288e1db2 100644 --- a/Documentation/devicetree/bindings/net/fsl-fman.txt +++ b/Documentation/devicetree/bindings/net/fsl-fman.txt @@ -322,10 +322,50 @@ PROPERTIES Value type: Definition: A phandle for 1EEE1588 timer. +- phys + Usage optional for "fsl,fman-memac" MACs + Value type: + Definition: A phandle for the SerDes lanes which should be + used. This property is required if a pcsphy-handle is + specified. + +- phy-names + Usage optional for "fsl,fman-memac" MACs + Value type: + Definition: Should be "serdes". Must be present if phys is. + - pcsphy-handle + Usage optional for "fsl,fman-memac" MACs + Value type: + Definition: An array of phandles for PCS/PMA devices. Without a + pcs-names property (see below) this should contain a phandle + referencing the SGMII PCS/PMA. This property may be absent if + no serial interfaces are supported. + +- pcs-names + Usage optional for "fsl,fman-memac" MACs + Value type: + Definition: The type of each PCS/PMA, corresponding to + pcsphy-handle. Each value may be one of + - "sgmii" + - "qsgmii" + - "xfi" + If "xfi" is absent, it will default to the value of "sgmii". If + this property is absent, the first phandle in pcsphy-handle + will be assumed to be "sgmii". + +- rgmii Usage required for "fsl,fman-memac" MACs - Value type: - Definition: A phandle for pcsphy. + Value type: + Definition: This property should be 1 if RGMII is supported and + 0 otherwise. + +- mii + Usage optional for "fsl,fman-memac" MACs + Value type: + Definition: This property should be present if MII is + supported. rgmii must be enabled for this property to be + effective. - tbi-handle Usage required for "fsl,fman-dtsec" MACs @@ -446,8 +486,9 @@ For internal PHY device on internal mdio bus, a PHY node should be created. See the definition of the PHY node in booting-without-of.txt for an example of how to define a PHY (Internal PHY has no interrupt line). - For "fsl,fman-mdio" compatible internal mdio bus, the PHY is TBI PHY. -- For "fsl,fman-memac-mdio" compatible internal mdio bus, the PHY is PCS PHY, - PCS PHY addr must be '0'. +- For "fsl,fman-memac-mdio" compatible internal mdio bus, the PHY is PCS PHY. + The PCS PHY address should correspond to the value of the appropriate + MDEV_PORT. EXAMPLE