From patchwork Tue Sep 20 20:23:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12982598 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6FE4AC6FA82 for ; Tue, 20 Sep 2022 20:28:04 +0000 (UTC) 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=BTqZ/tQG3B47t/M33Uh+wmGGllzupLma8d+X0iSZmGg=; b=N69vjxHwMfUWHM qgqMFWfjnefh5NcHgd4UDDqZkpmRiTtDrOlj20MIbg7UfUnDuP/6yjEBf3NQUk2adnvuQ13z4Hdc2 deMeEUbOMAFDmW4O1J5n6rnkJH7zM9dLmKwGNx5GwtM3zz1AbYrlS77nt6INbXnALx5P9g4CImODS /lfPbayz72rrhzPtFoWP7IbdZ2RlCMKVo2AZBG7/t2jWfdoAHMT772iDyxYZSwtFKJQv13wgfflG8 jrrWRCPHY+mzWIYB2vDAxEdtMstBvd4qAKNM11TrPtCzORJy0gPa8inrWpsn5ZW8t4WL5G4VYz16E aTGH4ekgG+52cBOWrncg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oajqd-006Hka-KT; Tue, 20 Sep 2022 20:28:03 +0000 Received: from mail-db8eur05on2048.outbound.protection.outlook.com ([40.107.20.48] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oajnJ-006FkY-Mc; Tue, 20 Sep 2022 20:24:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KQyjfbBVJhI1egbxzNHXC1h8FyBdZhRMFydzgFitQOHPsxpdlFQlAEA/GccuKIVknnq/yKP8c4T2MrAwgr9pqM4pCBhRQApzC+STS/AeI0jAzBDrpH8WPB1Ogx0uXRMhSEqtafEW5CkOdnT5c7GTrxrOQ+bWSCV7n/S/L1S4fK6d6DZcnsSqeSttRpxCHjQhRCDiKRymvCSuG9Ns9KEjBAVTkCPgeN81Khu7yCeH+lKClsrWxShDQwZl623UtwT8w2WE5VFmPZOTk9i8KY1E0dl5nOqxyQsTV522QT1RQjNI4WBZlQkKfNVcPYCuIFWj64QYMS4LzWA1SGCkTJsz5w== 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=PzaBavZmS5R2zZZqUSeXNj3V8G/JU9dcurXFW62d+v8=; b=ERjKzOmBameDjOfUvF3+SI1DGfl75M5a5jGx8NdeDux4UFxQn5SLzIIlxN5yu0o3Pvr/2JFpWDVWLs5L2WEfiZjbPHe4W5caU590raBw+pCR42IccqniuDmJBhG6pqsVu4waX/J0lejFU66vUTnrYxOKokqPwGCHeu889rUMY2krMZHF3e/HzKNm0FGZr6j9WwGfj+rCEVJIyOH1LW4am5x5C20XbPi13NpeAUcbBUKGrW6DLks06n775juu+hKTLhAharS2TCRYJVprOXH2D8uF4J66cvn4nXhWQS5z9kc6B/ED09kk1V5pLIkS5NUi3xS/S48dWC3xFbf1dcoKuA== 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=PzaBavZmS5R2zZZqUSeXNj3V8G/JU9dcurXFW62d+v8=; b=rCxhvnJ70WEP8xm4QcaTR0ti8ifb2vAWum/28CjkA5xdXOoGBCrGTcN38FWQi0z9l+k/rUPxs30/NDTHDvNWj6c2CqNcjmJp7L1hYLaYvrd8KHGU8ZwB5b20n1ReYrao/ntCJLsoemOziSN9118EroNeUOThzG3biKUPqnvMolm/SQCg6f5Wc26QheDYzGX6xJNv3Wz7R1YqCIPHnbglOCHr5wik9f5GAMEdNUkCyM48eaVR6hbXmXgwmyefC8KCfSAJV5ErCpnb8TmVfWAH9o129f9ZX3Lo975bklTic1j3ipFjZVTaXVprlDLsF0PR6KqJoW0bWqtJDFXo06MmSw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DU0PR03MB9566.eurprd03.prod.outlook.com (2603:10a6:10:41e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21; Tue, 20 Sep 2022 20:24:25 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::204a:de22:b651:f86d]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::204a:de22:b651:f86d%6]) with mapi id 15.20.5654.014; Tue, 20 Sep 2022 20:24:25 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Madalin Bucur , Ioana Ciornei , Krzysztof Kozlowski , devicetree@vger.kernel.org, Camelia Alexandra Groza , Rob Herring , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v6 7/8] arm64: dts: ls1046ardb: Add serdes bindings Date: Tue, 20 Sep 2022 16:23:55 -0400 Message-Id: <20220920202356.1451033-8-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220920202356.1451033-1-sean.anderson@seco.com> References: <20220920202356.1451033-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0014.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::26) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR03MB4972:EE_|DU0PR03MB9566:EE_ X-MS-Office365-Filtering-Correlation-Id: d408b4b4-4601-45ee-f794-08da9b461c63 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7UwtiqTf45Izo4P6PpZ6vVpvGWwntUF6CTj8ESgumjfcn/P74ZHqFP3FuQp8gSmgNWGtVj65T2JtyWiWxjd2vO/3VboyaJTOz+MGWSVedoEf4zsQO8CmJZ6zYof5B2bnSuBQ4pkQ7LN71y692lm/v9SlGAU3b/BiE6ujT7DpwK4R4Iia+zSdwAF2+qoZXZiz/wxunrj8x20im2Je2k/UI4aX/ztwVzHG0+4y3QCMmpEtzRcxYMqjPOd5iAI3WRz9Auag2jeygeYMT643CDwcuPAy6AGxrAFyyp7mUVF4ACHVumEXaWcgReTJ1HFCmBtlSV4iecROYCj+eRWGuXGYWHdWjh4p19Awvj6PjXo7cp9gGdnIMb/OpnbjMygBYDFqFl+IuoogA5bNxlZ2Js1E9y8DIr1Wzdbe3zTnrYMfmVblza+LBYNmvgEHaKt7/sG8yZLOzf+hNtc4ohFdF15Hzd4jTCtZ3Jsys+9r/Bk8qfizVWsotnNjaWFtfE4nerFng5b2AySaKSM3+kEvIaJVqvASKZT9giMqFlBqXcg7hNMupDuHenMQU3Wd4cKf76JXyvR55NbCTdzPCDfeEmtZdxWIMVP/trh/8uVZxGILl8bR9SGSAJuu+F2u1ywHLANkPV4Jzw0awLVnkzSFahiin1XUum2inlR1odHtCgmAosYQCc4fnc9f+fAD0YlFXsiBk6fWIQ0PUAZxg+pzPDOf1fTpncFCMCsjHNP3MYIM8AprLxmV3dSzTYjyf9hDq4XYVEn0CJtsweoUkJaTnTUf5XZTpD5ke8LpV20jtzFVjOSoK/OSN5kW86m15KcfR/9X X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(396003)(366004)(136003)(376002)(39850400004)(346002)(451199015)(41300700001)(38350700002)(7416002)(52116002)(6666004)(83380400001)(36756003)(6506007)(8936002)(5660300002)(110136005)(966005)(54906003)(44832011)(2906002)(86362001)(316002)(478600001)(6486002)(1076003)(38100700002)(186003)(66946007)(66556008)(66476007)(2616005)(26005)(6512007)(8676002)(4326008)(21314003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ozbRWVAUkXkxTTOcZLpDBlv63MULdtwB0esO5D6GtbKthGYRluwNsZPAT5HW5ICudJDJfxKTW9ysdfy2PiBFiV9l7wkW6ZOIHLJkfTuFf9PkkdpDyBfn4ZXPPBfAv3Rx7xApPGAX/17Ho9JIs3KfLkEu38WHnkL2r2fDAsXiJEwivPrQD3ElxNWg6lHTKLFyhxvW5gHekTvFFS+KKcTInAPNcdQ7AzcSzfWP4Ww1X2Mr4XPSXSyfTtGEVtxSCP+uG6gcBSf6H1quLVdBAH3IPXjyIHgm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Wl5cigQFNtXDXETfaoOD08PENhOR6ftcBV3oTo+Nd4eThJ+Qk6gj2Iso5hcgVYw8XLL0OI1pIuXyuTq5YT7wdn1DJj43t9jJwwiQ5iiqrJpNFXtfLuap0SzQlSPg8v14jZoou8f0AngENbRrTGwL7qHzfT78iITD7tL4JsQf+WNaFXtXkrf4TW9gTVYF1CEp+waWcM1TpzaMIYeKT1DD1LvIzKvnm7FvHIfgmqiD1ehTqykGR8ySHIKw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: d408b4b4-4601-45ee-f794-08da9b461c63 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2022 20:24:25.4707 (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: ZFSw3q5YJv8yyoek8w1Vfw2v1tVlVzpnQcvtvvslFp3rpxwRZSPqiOqdGk8jdn0h1FlMrIrChMnUUXlewUPY5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR03MB9566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220920_132438_507086_52D37F44 X-CRM114-Status: GOOD ( 15.28 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org This adds appropriate bindings for the macs which use the SerDes. The 156.25MHz fixed clock is a crystal. The 100MHz clocks (there are actually 3) come from a Renesas 6V49205B at address 69 on i2c0. There is no driver for this device (and as far as I know all you can do with the 100MHz clocks is gate them), so I have chosen to model it as a single fixed clock. Note: the SerDes1 lane numbering for the LS1046A is *reversed*. This means that Lane A (what the driver thinks is lane 0) uses pins SD1_TX3_P/N. Because this will break ethernet if the serdes is not enabled, enable the serdes driver by default on Layerscape. Signed-off-by: Sean Anderson --- This depends on [1]. [1] https://lore.kernel.org/netdev/20220804194705.459670-4-sean.anderson@seco.com/ Changes in v6: - XGI.9 -> XFI.9 Changes in v4: - Convert to new bindings .../boot/dts/freescale/fsl-ls1046a-rdb.dts | 112 ++++++++++++++++++ drivers/phy/freescale/Kconfig | 1 + 2 files changed, 113 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts index 7025aad8ae89..81d725a15e27 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts @@ -10,6 +10,8 @@ /dts-v1/; +#include + #include "fsl-ls1046a.dtsi" / { @@ -26,8 +28,110 @@ aliases { chosen { stdout-path = "serial0:115200n8"; }; + + clocks { + clk_100mhz: clock-100mhz { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + clk_156mhz: clock-156mhz { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <156250000>; + }; + }; }; +&serdes1 { + clocks = <&clk_100mhz>, <&clk_156mhz>; + clock-names = "ref0", "ref1"; + status = "okay"; + + /* + * XXX: Lane A uses pins SD1_RX3_P/N! That is, the lane numbers and pin + * numbers are _reversed_. In addition, the PCCR documentation is + * _inconsistent_ in its usage of these terms! + * + * PCCR "Lane 0" refers to... + * ==== ===================== + * 0 Lane A + * 2 Lane A + * 8 Lane A + * 9 Lane A + * B Lane D! + */ + serdes1_0: phy@0 { + #phy-cells = <0>; + reg = <0>; + + /* SGMII.6 */ + sgmii-0 { + fsl,pccr = <0x8>; + fsl,index = <0>; + fsl,cfg = <0x1>; + phy-type = ; + }; + }; + + serdes1_1: phy@1 { + #phy-cells = <0>; + reg = <1>; + + /* SGMII.5 */ + sgmii-1 { + fsl,pccr = <0x8>; + fsl,index = <1>; + fsl,cfg = <0x1>; + phy-type = ; + }; + }; + + serdes1_2: phy@2 { + #phy-cells = <0>; + reg = <2>; + + /* SGMII.10 */ + sgmii-2 { + fsl,pccr = <0x8>; + fsl,index = <2>; + fsl,cfg = <0x1>; + phy-type = ; + }; + + /* XFI.10 */ + xfi-0 { + fsl,pccr = <0xb>; + fsl,index = <0>; + fsl,cfg = <0x2>; + phy-type = ; + }; + }; + + serdes1_3: phy@3 { + #phy-cells = <0>; + reg = <3>; + + /* SGMII.9 */ + sgmii-3 { + fsl,pccr = <0x8>; + fsl,index = <3>; + fsl,cfg = <0x1>; + phy-type = ; + }; + + /* XFI.9 */ + xfi-9 { + fsl,pccr = <0xb>; + fsl,index = <1>; + fsl,cfg = <0x1>; + phy-type = ; + }; + }; +}; + + &duart0 { status = "okay"; }; @@ -140,21 +244,29 @@ ethernet@e6000 { ethernet@e8000 { phy-handle = <&sgmii_phy1>; phy-connection-type = "sgmii"; + phys = <&serdes1_1>; + phy-names = "serdes"; }; ethernet@ea000 { phy-handle = <&sgmii_phy2>; phy-connection-type = "sgmii"; + phys = <&serdes1_0>; + phy-names = "serdes"; }; ethernet@f0000 { /* 10GEC1 */ phy-handle = <&aqr106_phy>; phy-connection-type = "xgmii"; + phys = <&serdes1_3>; + phy-names = "serdes"; }; ethernet@f2000 { /* 10GEC2 */ fixed-link = <0 1 1000 0 0>; phy-connection-type = "xgmii"; + phys = <&serdes1_2>; + phy-names = "serdes"; }; mdio@fc000 { diff --git a/drivers/phy/freescale/Kconfig b/drivers/phy/freescale/Kconfig index 40d3bfb36076..30fad8dc4fcc 100644 --- a/drivers/phy/freescale/Kconfig +++ b/drivers/phy/freescale/Kconfig @@ -54,6 +54,7 @@ config PHY_FSL_LYNX_10G depends on ARCH_LAYERSCAPE || PPC || COMPILE_TEST select GENERIC_PHY select REGMAP_MMIO + default y if ARCH_LAYERSCAPE help This adds support for the Lynx "SerDes" devices found on various QorIQ SoCs. There may be up to four SerDes devices on each SoC, and each