From patchwork Thu Oct 27 19:11:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13022596 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 EB261FA3740 for ; Thu, 27 Oct 2022 19:13:12 +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=PisXNYv6xniXk9Jmud945X7uxBbkoUklMIuqXBgdBTk=; b=DvCXICCpdO+gXj 0snISUQ9zeadxXvx5YhhESX+4ThwyxQGfgDKvd3YaUwxUfSqNZNAGF19yIWOK5+hUdAzhZzWapLup k6nxCiErpd2uOdMPxC2is8+6NOdARrA7a49RS5/U7YSigRKbkInuyx9HVMeRqWjIEqF/sVXOz5V4e x6vZgXAUzAS3W1fDoL/zeoFRlrbIPJ5Z8m/IXGR65FklKhtl1ElEO8qVEu91QEeHRuJKOa42/2EOx X8p+TIk8bAROMaaX//TenI2UjRhUYkMWSseJRbNyrxY70OFzjkJEzOJf2X31djzuqiZubT3CPsh6f bzTnLoFlbgeU4JnM+JMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8JU-00EbiA-7K; Thu, 27 Oct 2022 19:13:12 +0000 Received: from mail-eopbgr80073.outbound.protection.outlook.com ([40.107.8.73] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8ID-00EbB5-AI; Thu, 27 Oct 2022 19:11:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YI5yLOUbHmbMRUl0X7ipsqgZjUhYDDCwu0D4KURzXj71c0MtNSW0qsShfRcuCaJSOuOTN7LipEo5fuhmgBcaJZFs/9lrUTFTi1nLPoauNBapbKPSjNtyShu1diWu6xewWZ/0fhrCNjcS7ZQhr5+LBtkKCWZJzkjTxZDrRokzfDmMa0UVKyYYJiq3JogdXqDmmEGtYMr9ym97q+dfGZYGuzJk485nxfW/LnORWPMq+uo5YsQpsjSaaIIO727uapW8CLT79YVzvbGojgLjps7+YSQ+KtgBnvdSg52tyFOFCbkbGFtDegTEfWMprbvnYBmssqOl5kavcpYrMbGhYwgcaw== 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=QfKRLCkOnut2UMtJ1c3REsws88CvoWWuf0yaWQN/++c=; b=lPZxuX7yTB9i9prk0R5NztV5l1RLFqgNTMBO6XnVIzKoRMZGF2Q4DRr4yR85/iFmtudhqtcDLnGV8S3Zlz+zOvu+VwtgloYftSETOdp5EQTRpRNMP7si/v2Wkn8sRKFOQjK+QADzezTES+4LKUURIEWyDCYXfHJ3ZkIIGz5mTfKhAUx9ehDg1MmMhGHjjoPaxfkHqKb1lcRU2d3UTf9btWY/87THW6f8Rlqb3uUMGrTbVsQf3A/qcsLWKHB0heG1h9gfQFuEFv0HGx4wZkcujGPi3qv7WYjITbqDwMTDS5RmPI2GTlzkd6xJXiyCdBhSIM6ygjtV5JQPBnz3YRsbtQ== 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=QfKRLCkOnut2UMtJ1c3REsws88CvoWWuf0yaWQN/++c=; b=OsLJPF5YZgdGrbM0oD9/zVsj5HxCAhyy1w/6yEQ3E1MdCFH1HNswL3k+nb4gjZtiyhP42pfEOcR6QINspEtczyUTv0Gc+7kDD7GxWYfm24enMeEVZdY3rybbeJRtJFsHKyo0vxViEf0bbeP3Pqhhx68WLycZtbT5UAS/lIBxoccHfVhDRkBUoGtjDAqbZES65C7QuRpP/KuhbaSun727P34dUcnZOoO7Az93ln3qmevCDOajgXZjlzO467Vj4Bc0CRLlKhSXPPaL553MGVDvtkEC2O2kyC0T8CoSuNeaN3Zhw7rqTQatK7TFA7LvQb/Dj5S8ZaCzRhpoyAQ0xhnnIA== 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 AS2PR03MB9648.eurprd03.prod.outlook.com (2603:10a6:20b:5e8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Thu, 27 Oct 2022 19:11:42 +0000 Received: from VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::3d5c:1e59:4df8:975d]) by VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::3d5c:1e59:4df8:975d%6]) with mapi id 15.20.5769.014; Thu, 27 Oct 2022 19:11:42 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Rob Herring , Bagas Sanjaya , devicetree@vger.kernel.org, Krzysztof Kozlowski , linuxppc-dev@lists.ozlabs.org, Ioana Ciornei , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , Madalin Bucur , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v8 6/9] arm64: dts: ls1046ardb: Add serdes bindings Date: Thu, 27 Oct 2022 15:11:10 -0400 Message-Id: <20221027191113.403712-7-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20221027191113.403712-1-sean.anderson@seco.com> References: <20221027191113.403712-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1PR13CA0218.namprd13.prod.outlook.com (2603:10b6:208:2bf::13) To VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR03MB4973:EE_|AS2PR03MB9648:EE_ X-MS-Office365-Filtering-Correlation-Id: dcc772a6-6069-4f99-cc65-08dab84f152b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q7YRK0stDMv0lkX7jCbmekDx2TZo2kAewAs3lH2lqJdZc/YE43O7HM3jynPMM4CGVKgTkUv4NLwYwjB0R5kb3Dwr8cgbAhz80rp9mA9metkO5EhYSkEBoZH9we/NbU7dXsl9KYCFG0Tud/qBJXwMPkWufQ4L2D2u873P7O2Ps4tYYpo2MNmNq02pZ5QijnFRiXViAfdJxfBMxaFRRqy8y0jEbmKIbOcbTnaUItbkAR/IzVZtBMBs7+DAuEdcDhEcsLa58y2aVoeNz3gqtcpEd9+BolBclXFgOvmfCq5M+IWz1fHYQZkA8/dHcDvQZYqqyRwo7rtGD5j820xS9DWIO2NMB+NOz4NX4nnYdUj0KIXDr54rLREO3jHAH1njpMT7hEIPFKA7K/e3CGZWuXkFuTtFBRXWgCSnpQNFC0nauZyZy8vkOFbfBuwAM/drtfG07DvRu0KLV0x7BeesZROVCN00SdVwiuTeRZ0JEkSUKvLNgZ3jlOXwjNyEim/k2y22GANDmlcyC26SuHOdpfYQB8WEhQY46ofPED7VF5C1D7++gJlsHvXe1t73TGuuQOj+QLMv4wgTSAQZmtJGKZfxwl5Zg0xahW2Fw2WoDrLBec9pdDxUPqTN5LZh1rT71n53515Mg3c9msoWLTWcaR29Pdls+heaYuKNSQPz4Bl42GCS2epnuIY0sNwtLTwkjsv0XPG1gjoE7TTkqXweg83HeY8vnF8jxtwWihmQ1JNkFHu9huQELNRPlWJhfdKCjjdS5GBWsL6UqBLmlve5tBhNGyC5+C9r+Y5jqkwCmpXjPzEAjXd4uE/Q/Is4bjrG+6xb 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:(13230022)(39850400004)(366004)(396003)(376002)(346002)(136003)(451199015)(110136005)(478600001)(5660300002)(966005)(54906003)(83380400001)(38100700002)(6486002)(7416002)(2906002)(44832011)(36756003)(66556008)(66946007)(8676002)(41300700001)(66476007)(316002)(4326008)(8936002)(6512007)(1076003)(186003)(2616005)(6666004)(86362001)(38350700002)(26005)(52116002)(6506007)(21314003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: x30kKA6wgoyy9VQO/0W+85MbJgcA1BeAZ/7PqanqMWqkbeqpN+LdYN64kjcpL0SYy9f7VQAkc4dttXNXFRaInks4sZGIzbrzRam4tHM6WQNJSvUsDYVtG79zzJwBzyE//CspExCekALhmVf9j4+B1AE56IJgCnSxJXmRo1qATltMU15Ap3v4cUXaI74TLaL0WTdrcrge56aNoZ0kKQoZBKCLQnYGr5QPmMyI5N8iRmxIQTT8h2FNAAX1c1ZHqqvI1TiUaf/vrRgy2EnwxiTmrwN9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OEhbSz96zhlZwz9v5A/Yw8nsvxY07APsQx2nBXMScXDHeqONOS1Vmf8eFZVLK3YatTjC7j1B5BilEwZMnJhblNCDidij7WEtvfDGL7aXKepMPB2IgVGv36LZ+EjrvP9MtoQBBu39BZ3qBfRHz5PNpskhv0SwtCMQfiC14G+of65F/jSns3RRm1tbBxOAZPmGyBQnDjs4S/WlqYZ4iJRh8W4wJID7Ka6rNXoYhGzxGdbR/eKhn5rLZrWXVhhg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcc772a6-6069-4f99-cc65-08dab84f152b X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB4973.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2022 19:11:42.6278 (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: XTfBVr9Ic7jejHPpl4BGMoD0fdUyyohc3ttQnNec9Flj1fihWH6kSocKJ9dnaSVn0EJnVT0RfRSYRRy3zOmYYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9648 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221027_121153_421527_10B633CA X-CRM114-Status: GOOD ( 15.08 ) 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 v8: - Rename serdes phy handles to use _A, _B, etc. instead of _0, _1, etc. This should help remind readers that the numbering corresponds to the physical layout of the registers, and not the lane (pin) number. 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..50bc310ac31d 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_A: phy@0 { + #phy-cells = <0>; + reg = <0>; + + /* SGMII.6 */ + sgmii-0 { + fsl,pccr = <0x8>; + fsl,index = <0>; + fsl,cfg = <0x1>; + phy-type = ; + }; + }; + + serdes1_B: phy@1 { + #phy-cells = <0>; + reg = <1>; + + /* SGMII.5 */ + sgmii-1 { + fsl,pccr = <0x8>; + fsl,index = <1>; + fsl,cfg = <0x1>; + phy-type = ; + }; + }; + + serdes1_C: 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_D: 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_B>; + phy-names = "serdes"; }; ethernet@ea000 { phy-handle = <&sgmii_phy2>; phy-connection-type = "sgmii"; + phys = <&serdes1_A>; + phy-names = "serdes"; }; ethernet@f0000 { /* 10GEC1 */ phy-handle = <&aqr106_phy>; phy-connection-type = "xgmii"; + phys = <&serdes1_D>; + phy-names = "serdes"; }; ethernet@f2000 { /* 10GEC2 */ fixed-link = <0 1 1000 0 0>; phy-connection-type = "xgmii"; + phys = <&serdes1_C>; + phy-names = "serdes"; }; mdio@fc000 { diff --git a/drivers/phy/freescale/Kconfig b/drivers/phy/freescale/Kconfig index a6ccccf9e39b..bcecbea72d31 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