From patchwork Thu Oct 27 19:11:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13022592 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 2070FFA3740 for ; Thu, 27 Oct 2022 19:11:51 +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=W09BBUPyVCn2avhawP134YpnzQ15AgZu+7mn9XmiHd4=; b=RL5kd6Kqv/xmAs /JOhvn/NavhJcx06VBPIVVE7h4sGOC2S+AGsAQelJaYuu98Rv4EK12SdIbQNi/6WIBjHRS080zY3o /JH+T+dcmHfJfy0GSzBp1BZ8/f8H3CaR02dQAMmN/LVLvp1wokcgYV+AaDsgIhY6i8BpdQ8TuSsaG aDXunK9ZSKyAWJ1u2xG2x6QWN79FRyg/FN1aG0HcadOQlU/41EYpuk3ARXyyXMBI5FQsWXVfj1tSi Snn5OgEwyTZ9bh9C/+OJvPgjI1lJiiddfJ9r5oO8iHoIhhtr2xQavR4k1ULmEwGqvcjTCBuKBOWLb QfnSXarSff/u7U9lUvzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8IA-00EbEw-Fz; Thu, 27 Oct 2022 19:11:50 +0000 Received: from mail-eopbgr80055.outbound.protection.outlook.com ([40.107.8.55] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8Hy-00Eb7q-10; Thu, 27 Oct 2022 19:11:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A5STmtmow3E/XeGnt505Y6Kocks0q0JmtKNk5UqyGZpl1rDB0q6f0g2i754RBttJV+8sLfGqmf7elogESpUYsumCWljk/tCSctPdt50u3sZu5rOQScCyoktYfDCGGn8WpGv9UJuEwuIjSn28EPemd0Mp6Fz4r+vggCNSou71+I+l+8jIlWoxReCoF36VXXhnkfaLWKaVCyQ3WXx8T61/OpqmTu4kZo5Asx6mi9kez6jq96nonnlV6W011HOs+oHUo/3Tp3T74MZ6zLcG+/wrim4U2nt/ut+vgR9ioxuZ8z9KnlbMp3xCAv+pdn4FPb1fKcRN8B06exavxnvuEW821Q== 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=AV4YSLSWUEa6icuS3ElbSt+yZKjwyRoBMk3Gdh1j9EM=; b=WC2URtugTHuqQ7+vfMzO8dVDcUNGSeG+dBa4y39lG8OT8plNBT03YyrkmVszk3s3ag67NePBlJR/AiufLvZ1nMZKBB5eZjZCe5x4ZF/7a7grzVhM9FYf1q0juC5vdhxH77RCC9oXtn5DluR8bBauDQel/k8fAcB+64/n+L7avWVOh1UjLDFO1jxZUy3zZa3u4SyCxC693GeNDuh3kfHRKq+RtXLIVcQtKrboy6gA+I6kwlxlDLfOFGQSwPCqnUnYIVUaR9OdvmpD8uolhVcFzoELEV/Ou+P2F2GDzD+rovqNvJJ8vrmM414zqEOCeAxDgiFucKE629f+bGOl2G/e3w== 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=AV4YSLSWUEa6icuS3ElbSt+yZKjwyRoBMk3Gdh1j9EM=; b=qId7AJsOlcOpyuRrEb2HKVxcXiylmLxG1ekD5UEhOd1AMLKlhMeIEHiZs8pQuTEhzCoBFYcnhCuBtukew66iVVQy4Y/07yB/dA/Cba3M/SJaAbKAVaY5CCtu2YFu0unVsKi2wml9o+xvLCblUnT9Ig+VqivRz+EiSSrOs1NqC37qfr2QU3GAgZ068ihHS1B4VKjKWzGDKvsAnjAlDCYFV9QSohWx+TLXw/dfCsfLwxVI+ek0Ktxe8p3kPOFl0NkXrPN03nG1+52g7mVWAknRR+OhCvzlHdi/+wZ3KAgSPxl9b7bEoIgWYimPolQXsZ73jaTiOkQDZLfloHTpCqGVRg== 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:29 +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:29 +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 , Rob Herring Subject: [PATCH v8 1/9] dt-bindings: phy: Add 2500BASE-X and 10GBASE-R Date: Thu, 27 Oct 2022 15:11:05 -0400 Message-Id: <20221027191113.403712-2-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: bc388cbd-a1a1-4553-837d-08dab84f0d3c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Zt96spsbhWvuC511s33mWUCC/deGTx02VJP8BJGFSwFVlnTH4XoyZ5Xm4plmNtMvzm2yCgYXwahEJ/jF/HL2xEWNwjEWJoPvJS17NT7wzqHUSphNTCQI5iDsFJ3MARL7X5ioir91EBMcshAa0e1NfnHVz2gO7joBxKIl6yd0DxvtoPa/FS5mEL0IphMMkj+hGl7c+SOvYrcaeZyBPCSMc50jjLt8V30DeOz5zyFFXiEfuiAuTyFZThQVEgVtwqp/tUL3dYzmC3VJCIsdlnDqrAiJW7ZMFLA1FscTt7nH2GpqBqtFpEakkRoeZ+EraoPb/pvZkXPAUe8EK3N6/pT7SBQtE3zA8d/8uw/33bw9Imujxf+/X5IXAMqgJROzQOW19Xcb200EhC8Bm6rZjdehitOxFCFzeEmmzlDMYRZVHssXofC9zXLve0mJN6CqdF5c8zJ1WKe9Q3VzSolXkJU4C6uN37Fs8bo5GUxQEkz34B5L+7q8slX7+OQH9rZOCczuLDa7iHjBoo+Gnts+1MYVKf91QKKxB7+Y5At9a91oXGbQL5TvQt4zfvR9Q2JYul5uZHUmLYZtQGgzkjjJ0AwIUvhqLkFze5ZVlk/nmLw8/tsL1H9b8PXAvgcIrXBsWtVGKsyc0K6h05BzRtRx+0etVXOG4BRr0dCXooXK/xAEnyonMM1kCZ4cuOs+APtNXUX95MJNlA83um0Lq38KEHeI15ESy5yM3BfWeBBqOmTtec0I3bQF0/r5kku5fXPDPsDJb1FqAKsiI9nEWmdYaBKfBcLWN+VZl1I6FV3i7QVGplE= 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);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aMdzyeZYBlltU63Ktq1GjWB1WO/7bI+lkaJN9cDILDDKqkFZwkbzj73CKXvqxCXYFZ733sX2ClXKr8dtjxU8JdZqBcULxybVcFRrN+kwUf/If7ZHM9BMaUFHtwLR/BBGHhXJgoAiQP/mjCJ8in6sc6oWereoJEbjkdYBDubwK9jznuCT9eiUgxwbDJ8ptcm4xA5QvQrEqkEcC+BxgpIEDJIhi5mM/fWgkGm+W7lXGalm2g/vDnXj0jjcMnAvZWwj0xiHiYQ+zrhb054GuE6K7P21yt8/nfGUdn/gLH8c1cHrpQxGrtlsaIA5cA68oTjgm1ELEa1VCv9F9jqHcsqjaVb7BPfzP2liC0FDkw0zNcxbLwsfFnfXGwFa6ZeUXUw3159phMicCwdmqgg6ZAnhcUClh/DT3VqZL3TAhNh1wkdwHqA96XjBz22EDZm/xRFa6A+y2NtobmXpBCQwW/gEm59inZkBNOIXdlj9EKLROi+a9SfNA9AmcDeMUzqNBzVRD0n1i+d5YV+iMxikdyZE1uYTKvW4yxeOcDGPowgslB9v1/nQX9fLAiBnT1/37aJ6h1t/WXNF1D/GgvrNp7iiw+kYKsFFNYArXMLC7cpWrF4LH34kxeyYpd5J+NuVMAaeKnmmsPlRDX+LCQkyylI5/7XBXOUnZ8SZ+E3x72xkbioobPGACX2V7PnJuWU+HJUQzP2qQ3i1bk4eIpnDRI2FgA15avbRSp24QqVT8CLBm/cFA36V7rXwOPaFjKNU9Mq2wIAWu8ryziSr1B2J+461zwUMrLABaBQqAEV9bRJB3+g8GkwgmirKqkC5I2GbKfJwJbpqZM8+o/dD51Oz1zviLxKIflFxaQVNAuMKHmUdEbEL6GvcrY0X3uoLHMALmVt9QdrZaF02EKQTZw9fXI3c0aJZ1pddxvDuvwugdx+dHBCq6saVHGatNBJAFtNgGp2JW40FYC+7ivYkuh+BU0vdHrQfZac5bTkzB4/tNEU9QYmzfZIcy58YgtYSm7t9yk9ZBcCEo7/3HdP/mtCESorpJJArHXnhryMNMb1uhQYzXACmgOPQ9oaUlw+3k5m0grD6gL7LvO1nMXW218YIZAgIeFG+/lcpbx+UkIWDiMVCtZhyrgyD7EqaV/SL3DrR/0F+lVdJ4FDt4Njjk8F37HoaxcAhwEhdDh3iQlMprrOFy3TK4CCdGFygbbh7j6Ws16FmbvFO+aP+iqGlC+h4ohGN5jwHg8/i1BPNWDDUriyaumvxTa5l9HVjUXv3CFLQ+TH8xh8OVN34z6h4OwlpUD3XzUMRgIIEGb51SgF957SDuDI9v+wCKndNDGSbcIFTpOCUD7sJSzZxp1VVU7Ir8Y5WvG01ZCKQVIu4dtz8WEqQtZr0964M71ZcyDqmc8edgiBsu5+zGGrSNoCYxWufescsJ0/h0mTpzhKlyuRsN4aobZKq9E8mxz4sAIAwx4A3ahU76DNMOWPuemWtESjj7hEm/8nOCI3kGGvNyLQTHhm/vPMDng5aN+bk5kWVfuJF/uukHgVFYdglXvz2eL/74lArvB7XUErBlwtkySVEsc/NINBJ0AxaCzRmWbLcaW0QXOjUQ1y3peoGGfHyijZUuNQkZQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc388cbd-a1a1-4553-837d-08dab84f0d3c 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:29.2218 (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: FTJXx/ap9zPycayBSsdpMwOP5tLuZ9OVykRIkzuI5scnKIhEe7iS4+34cvgdEq3qwyJMi6xcK+OPP9IRhiD14w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9648 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221027_121138_112421_2AF373E8 X-CRM114-Status: UNSURE ( 8.58 ) X-CRM114-Notice: Please train this message. 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 some modes necessary for Lynx 10G support. 2500BASE-X, also known as 2.5G SGMII, is 1000BASE-X/SGMII overclocked to 3.125 GHz, with autonegotiation disabled. 10GBASE-R, also known as XFI, is the protocol spoken between the PMA and PMD ethernet layers for 10GBASE-T and 10GBASE-S/L/E. It is typically used to communicate directly with SFP+ modules, or with 10GBASE-T phys. Signed-off-by: Sean Anderson Acked-by: Rob Herring --- PR increasing phy-type maximum [1]. If this commit could be applied sooner rather than later, I'd appreciate it. This should help avoid another respin if someone else adds another phy type. [1] https://github.com/devicetree-org/dt-schema/pull/85 (no changes since v6) Changes in v6: - Bump PHY_TYPE_2500BASEX to 13, since PHY_TYPE_USXGMII was added in the meantime Changes in v4: - New include/dt-bindings/phy/phy.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/dt-bindings/phy/phy.h b/include/dt-bindings/phy/phy.h index 6b901b342348..5b2b674d8d25 100644 --- a/include/dt-bindings/phy/phy.h +++ b/include/dt-bindings/phy/phy.h @@ -23,5 +23,7 @@ #define PHY_TYPE_DPHY 10 #define PHY_TYPE_CPHY 11 #define PHY_TYPE_USXGMII 12 +#define PHY_TYPE_2500BASEX 13 +#define PHY_TYPE_10GBASER 14 #endif /* _DT_BINDINGS_PHY */ From patchwork Thu Oct 27 19:11:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13022595 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 E3E47ECAAA1 for ; Thu, 27 Oct 2022 19:12:48 +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=SR4OVaCfVkdsnWZ4DzuXzSstYwd/EqxYc1Z9OkzC63M=; b=MNRVUFk1VmoMgT S2AYcbYpZALold7PlCzlyZ3QnNmQ/1cmvRsbQTuUH/e8uRelqQ22z/6tIJSmLBQMkqSbPTI87tyNc JBfQpsu2ujvY77l9uM1ZfPniYNzr7cXFy/vTqIwfzIkDn2bhQzWvpuDpKFQSTazymYS+X6P6yMzgw 2D5aRMwmUclGlGGpvG0/Wy5QujbR4kgdd0jHeKVcYRO/J8WqbrxTNXUtK9n8TF11V240MjVYkfAug F5w5DUtCsggC9STrkkQE2yEExlX1ILkOo+WmGR6Vj2bDZ/n3+0uxsNQfWOfV8iEDvzU/3Jnaqfx4s SuJqZlPGD3FNiZ4w62wA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8J6-00EbYK-96; Thu, 27 Oct 2022 19:12:48 +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 1oo8I4-00EbB5-Eq; Thu, 27 Oct 2022 19:11:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jgGEcIH9tBc/CvvpqIsmmrqtkiXxh7tOwIDKRsRPTEpCbc/zSS7OvGp3nCXE0j070W38DMAEwF1QtNB8S7eIBLuC/28H4G2KYR2I8BrIoKAy9UEYy/V5V9yTLD/eQKjYgk8irXpgbyG7qrrzA0JCuFTdFqWsPA8raYUf7jM27f2Z2zZ4ep6J0aaVvtL7SaKRimjGAuRMEW9NY2XIBS0c3HFaCFfw8MoX4wkH7ci6Bm2EAJRopv58Wu6jPdZ1kMp8niuBHCpBQSl35OHpWK+vJ281MhxPRLA5E+fz0ptb2ILSlOY5l4OjQQpZHIDC6bMp+4VOxGjwxCHLUeF7vPHV9w== 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=3wiTzbFoPy1sqZ15B6PO34HC1NVvf1CFwe0TVwHv9Ts=; b=jW8hx33dB3r2/5NIqYqWiBQCBItQsrb87xwz0Z6RjdaiyylE/i4jXHXnkP0K97c+SQ5Mnzs69CAt7jQ7uLF7u+ySUK8yeTISumC2KU/woyh/4PFx6WhYm6083zds7kh8EemccFU9oqCCHb6c2lAgTF8g0q/wSi90Yug4Drp0HnjMTjk8Whkkq6AH3ZbGAxMvf2mJmykXfKuBFaB1uHdGu2KBbCT4gEWBIxE28KaoEY1uzIybM5GI+XS1Wuw+BpazbcORW8GHFaleL4vzIoPWv+7+AnXMrZiTFyAUE/RNAjFuZRipzEN91xKbP1sGnHn1pTloohat2QboAcJKpfb+Jg== 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=3wiTzbFoPy1sqZ15B6PO34HC1NVvf1CFwe0TVwHv9Ts=; b=XPY8AOYxr3Lws5FtkwCPm40dVCYQ5WkU8aRahGvIGYOh45gEW5hkwPL/aGVfhbPqsKAWalikKxxCJku2gunxNrm6vN3cAWqS9TEsXh+Sv6HnHlQCUXVDPGB9xqPfZrs6trSVeLTYBJB7qoSi9s3wSEezmEDrBMVwmflV35zzE8pc3aERNF86zDQOpg7mPo6wODUfcm9iy1OYysRcaKNIDAqHwO3wX0OU8eSIlBvP0x5y5OlHWNu91+8H2AukSClDZvfDLsfz4Dg/jl5ZNkQFkQElGRZvdjhGx5TYJnL+PMFr+VPXXrXgH/FBxhf178cmSWTgF1QqSVe+voL/ZVzOlA== 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:32 +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:32 +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 , Rob Herring , Krzysztof Kozlowski , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org Subject: [PATCH v8 2/9] dt-bindings: phy: Add Lynx 10G phy binding Date: Thu, 27 Oct 2022 15:11:06 -0400 Message-Id: <20221027191113.403712-3-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: c517f41e-2270-404f-58f5-08dab84f0efa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SBiAYAgKe55MUk1000aW9Du+JmpM8VCNkA1Oxwv5i/3khh7NBzu9nPHpYxdIL66Z3fuIimnR0yN5PJBd2iCiDEusXelhMt0+MP+8Rmm2vL6UgxvHhZnTBJkIzaLxi3sGAgWsZMaE9Rgf+deKXy6pe2L63egoFlzHCa/Hbpj5ZvIJsLYqgK+nXwwYGiOIruGiJuxYE+c6l5WsQk/PN0xcaDKs08Bj4Ij40AYL0q/iVaVNs4Ju6eFh3uY3NPX91eBiJcDGOVb1xd+TAzm4r9+HQjpp72hIXTOcbiJtLaWW2B2Bi+2gpmquCX7VD3WjcJQdE67mOI0eKvAsiKWI3qUh7b2eoEaHRSm5alE7WqbtiHvYfZdCzH+6KGRY6poGAFDVVse0pZ9T0s2kWoXdcPHXxdSGNf6ITqtqN3kUaa9F4Jf9/BCC+He1umtUiAKbhTwCvXBq0pz8mz+cOTjQ2MaXi5RwNRwc4hhPStfxIFv8+8NxlYo64Oh0qyOXHPBNZb+lfywQ6SP3Szo1VHYXWlC0fc9ZGTYDZJDmVQZKEZRj/lNDrz+ySXRGhF/yK5EIXGP3L9Jz2GJ5X0b+nm74kGf5Lf7wHdgDBGzbyFAo7Yb15Ivar6Su5VBrYVhb/hyw4Q1MqufugxnDOi3TYd4D1PrqaKhKP6NZ+Y1Nn5XJSM74Cgsh+uxV0pZ0PeG8cHuelZ3Q1IQj8kOcv4d5K5wAv37miZnPsFM+tfov0snhVk6sViBEEicVvoZpQOeMy7urjouyOpx7mjj9Kq2Cl5UCk21r8CI88jC1EKblLjj90hNmiSg= 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);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: q318NFdh9gQRon+O8yX424DPCxyXq/SSRjQFd1xuvoHJ9r0JSWvwK9PQScoMr2hG2jlGlOyIjvL27O6lsW79ZRuay9UlSpOdmaoG2cyJPU3NPaCEFLIdjFmnqrtBoR1cqDrWu1bdmdapPR4uae1QaiN8qpAMeOk9bcQD47RPOuKWAw3j9+m9fZmytU2fktgvUsU/CE/wZIjo5i8139zaIsipL6qIKqjoGiu7qWMuBhdIjnxkKsGG44xLP4jeWcm35c6QDKt07LQYNngM/PbA0Ivy2+Fbfxf+548e/7gNe+nI4z1Sw9+cp6MgjTyYTmhc08oe3my1wCBvaEgozQ+udQTOdCx/37wAp9dzNRI45Jxb6LWTVED/UOSUNpOVPk6KFn8YvgOrk1FX2E6TKzM5XDKpYhYi1CyNOfRC6a65gWAnOvcE1X2//xe6jFs0UKMos7CHGcC3l8RPB29oofLKn9QMMUDTn2OTt7VhIUkLdA/vNVzHWJC/VKnyWw6a5zcB35NFZNeQasmfKxTFbEejI0N/va8+d79eODShJADft6G2o0R1YskAbjl0qM4nc3qZF/RpO5EBM1o0IHYZJQShLgRHpZ67htS4OdkkFss+hYBRAyAkxvpYbUnYaKuY5gkkaOje4r1Pn6qOfC0uQmmH7uED3mM0jMKE+98BcNG8IlHJ5OUfCc6Z68w917i+y4tPEpTVFWcUjohxtDR1HVPLQKz3Em0tsTJddpO6gQuXplB9vrsZGooKhKDocvpHUXFVsdz6i1bd+39yqJrbZi9U2hcHxIiE9EF59UbrJdSASwYzUXXoKb/i1oDbV7nTwiumhMLPY/5wsowWs0uKQVvgG62f4vWVxkUQVjpmWg6km6HCwVQHsdeR3wydUAuZ/3HzvmAUJF47hL7Gwk1vAXULEFpqE/zsH2NYyJ+ncEAP0zgov52pcawmIM2R6WOMe7TJPWd59Dw7Lv/w2vUlJeOAsBGxZoXyaCT935CwBMWEFhwmZ3bgQNUHFm7TIrBfLFWQad1rfT7as14FveZm2fb7k9gdLVim9a3RjDoy60atjWcP5V5ytGGrG1fy/5PRI7CZ4M75W+1GqdnUK3Gvs7QDa28C8SHcGOAuh0W1jWZ5XceJqPtM8sjO9Q0yYcpVrUbxwZddj181P1WXDMVnUzihJJwle7tq6SJPwiGC09Nmu+Ex77xdn02nvrNJ+fUEwhLbV5if6fN6litByU5fKb2UETsrle4BIhQ+oHJCMODmbdqycGHldIaG5+uioLaOOFDTX2kRiStINVJsvfx81sfnA6I6mNqp/+Kp2+2WMXuBejoYQWcPwUKbV38XLub186kU7twFXdidPOtyGItogRzCV5F5AxI+UokZACLPymGW0jNb5z8Ivyysr99nQbrxoizWevuuLQ8FORA1JkZdTh9lU0qSjw+Nt4Q2k0bWophrVqlKrIl84eQHbRODsoxDF6Krf2YAscCEj1dHetHNUYuhUQDb6zyAhcxvoPfhE1V66ju4Mr1D3e3+RwWMNMTyW4bDqFJGSsyCyAMNwx7R0igJHQhAA2zwYLyrLCZSvBzl4KWN/pGkU8IMBgTJuEMFDiIpt+E/fUZPzpkn/eVXGB/H/w== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: c517f41e-2270-404f-58f5-08dab84f0efa 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:32.1748 (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: w7slUdxT5/GEoC0L6hodOnt5biU9pEA0Z6+3cd0cdyEKIiCH0Osg/r8f5xsqZwMyslfjtAnGEseEcugnwumV4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9648 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221027_121144_700157_F42CF77E X-CRM114-Status: GOOD ( 24.26 ) 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 a binding for the SerDes module found on QorIQ processors. Each phy is a subnode of the top-level device, possibly supporting multiple lanes and protocols. This "thick" #phy-cells is used due to allow for better organization of parameters. Note that the particular parameters necessary to select a protocol-controller/lane combination vary across different SoCs, and even within different SerDes on the same SoC. 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. 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 Reviewed-by: Rob Herring Acked-by: Krzysztof Kozlowski --- (no changes since v7) Changes in v7: - Use double quotes everywhere in yaml Changes in v6: - fsl,type -> phy-type Changes in v4: - Use subnodes to describe lane configuration, instead of describing PCCRs. This is the same style used by phy-cadence-sierra et al. Changes in v3: - Manually expand yaml references - Add mode configuration to device tree Changes in v2: - Rename to fsl,lynx-10g.yaml - Refer to the device in the documentation, rather than the binding - Move compatible first - Document phy cells in the description - Allow a value of 1 for phy-cells. This allows for compatibility with the similar (but according to Ioana Ciornei different enough) lynx-28g binding. - Remove minItems - Use list for clock-names - Fix example binding having too many cells in regs - Add #clock-cells. This will allow using assigned-clocks* to configure the PLLs. - Document the structure of the compatible strings .../devicetree/bindings/phy/fsl,lynx-10g.yaml | 236 ++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/fsl,lynx-10g.yaml diff --git a/Documentation/devicetree/bindings/phy/fsl,lynx-10g.yaml b/Documentation/devicetree/bindings/phy/fsl,lynx-10g.yaml new file mode 100644 index 000000000000..f326fdc159c5 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/fsl,lynx-10g.yaml @@ -0,0 +1,236 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/fsl,lynx-10g.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP Lynx 10G SerDes + +maintainers: + - Sean Anderson + +description: | + These Lynx "SerDes" devices are 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: + compatible: + items: + - enum: + - fsl,ls1046a-serdes + - fsl,ls1088a-serdes + - const: fsl,lynx-10g + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + "#clock-cells": + const: 1 + description: | + The cell contains an ID as described in dt-bindings/clock/fsl,lynx-10g.h. + Note that when assigning a rate to a PLL, the PLL's rate is divided by + 1000 to avoid overflow. A rate of 5000000 corresponds to 5GHz. + + clocks: + maxItems: 2 + description: | + Clock for each PLL reference clock input. + + clock-names: + minItems: 2 + maxItems: 2 + items: + enum: + - ref0 + - ref1 + + reg: + maxItems: 1 + +patternProperties: + "^phy@": + type: object + + description: | + A contiguous group of lanes which will be configured together. Each group + corresponds to one phy device. Lanes not described by any group will be + left as-is. + + properties: + "#phy-cells": + const: 0 + + reg: + minItems: 1 + maxItems: 8 + description: + The lanes in the group. These must be listed in order. The first lane + will have the FIRST_LANE bit set in GCR0. The order of lanes also + determines the reset order (TRSTDIR). + + patternProperties: + "^(q?sgmii|xfi)": + type: object + + description: | + A protocol controller which may control the group of lanes. Each + controller is selected through the PCCRs. In addition to protocols + desired for use by the OS, protocols which may have been configured + by the bootloader must also be described. This ensures that only one + protocol controller is attached to a group of lanes at once. + + properties: + fsl,pccr: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + The index of the PCCR which configures this protocol controller. + This is the same as the register name suffix. For example, PCCR8 + would use a value of 8 for an offset of 0x220 (0x200 + 4 * 8). + + fsl,index: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + The index of the protocol controller. This corresponds to the + suffix in the documentation. For example, PEXa would be 0, PEXb + 1, etc. Generally, higher fields occupy lower bits. + + fsl,cfg: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + description: | + The configuration value to program into the protocol controller + field. + + phy-type: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: + - 8 # PHY_TYPE_SGMII + - 9 # PHY_TYPE_QSGMII + - 13 # PHY_TYPE_2500BASEX + - 14 # PHY_TYPE_10GBASER + description: | + The category of protocols supported by this controller. See + "dt-bindings/phy/phy.h" for the relevant definitions. Individual + protocols are selected by the phy consumer. The availability of + 1000BASE-KX and 10GBASE-KR depends on the SoC. + + - PHY_TYPE_SGMII: 1000BASE-X, SGMII, and 1000BASE-KX + - PHY_TYPE_2500BASEX: 2500BASE-X, 1000BASE-X, SGMII, and + 1000BASE-KX + - PHY_TYPE_QSGMII: QSGMII + - PHY_TYPE_10GBASER: 10GBASE-R and 10GBASE-KR + + required: + - fsl,pccr + - fsl,index + - fsl,cfg + - phy-type + + additionalProperties: false + + required: + - "#phy-cells" + - reg + + additionalProperties: false + +required: + - "#address-cells" + - "#clock-cells" + - "#size-cells" + - compatible + - clocks + - clock-names + - reg + +additionalProperties: false + +examples: + - | + #include + + serdes1: serdes@1ea0000 { + #address-cells = <1>; + #size-cells = <0>; + #clock-cells = <1>; + compatible = "fsl,ls1046a-serdes", "fsl,lynx-10g"; + reg = <0x1ea0000 0x2000>; + clocks = <&clk_100mhz>, <&clk_156mhz>; + clock-names = "ref0", "ref1"; + + 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 = ; + }; + }; + }; +... From patchwork Thu Oct 27 19:11:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13022594 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 AB2DEFA3740 for ; Thu, 27 Oct 2022 19:12: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=OILcQGnJNIYL3R5ubpVCCemczVkIiMa3PbNAaDL+UdA=; b=jG/JmmYKZhvm3k oTamC6TBFK+l/6EVI3JDECxrSeSYZwphPJ7uiSWLhXbiawYps/jnqXymLLG/CXUiHX3cADE/bIm+J il8XGPn1nRevZTiatsnZNXQzSdWpy10NjJyjA8KwjEtomSPl54xBwiqe8p/OiLkeXA9r/oILj3Dvq q70h4fPRphl8HUz0MzPRkDAukNElFFtTh/cNzwPTlURxo3IKEqV/K/0VXkoJLnM2bTxhQVBZ3IY2q OrRA5hVbFLXOTfxKHqSKSSN2XqUnECMM9rjLxjitv9fjxZC6njNQ8X8YOJnWQK/uWhMi0N4cCduRT 3gOW4Ou7urWKo8YUykvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8IN-00EbKC-Mq; Thu, 27 Oct 2022 19:12:03 +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 1oo8I2-00EbB5-KE; Thu, 27 Oct 2022 19:11:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j23sbdoAsskjk/iIr9UY+xDL4pOp8PAm3MkxIJaL9lcnJTgZQzO0XBO001MdmErm4vP2KAjUZBsPWsooPnVaL4tCnXAVv38hB3wRj1nLvfwloQhb5ojy4CIQHUwkQOGCaGN4GAwFE65U0BQ6yeaY66c5holBJPRH7fPyY4fSxxjC3NqfDW+nfextbO5ZXG4z++dBnRt1NwaHcqfXygm119VgvuZEtE/OKfi8/PBvydnyyokSgoWIuyJ2+yWFa661g58BWA0JQrpKAjj3YbQiSVF5XH69GVKu8YQ8zZLgRdMjuePxEHFxyeGZBKC3jMtOXt89ToIwzV9GFkvOPu8A4w== 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=nHfrKvIf6uhW+PIvN7eGwoBrowmdKIkqx5wJ0m5ZL2o=; b=Nkbe03CwAmHJY4FOpoJToNWeF8smaJpWPPkFY+KFbWHkggQLfjtOwpWl6g1bjytQNjGu5HnqLnYUU2G4CxDqKV3a1p97Mido2OR6gv9ISCEFodgND2xScUJ6ksRyL6nrb1KzS22wmNmF16fM0GO1qGObWjBAdgGpeFbfxgFFwS6m8PTf0NkhowwnzFOnO9o5jXquxhHaWoFq7ZUoTo3U8P3+UNFc2b1zAJOzxJbt3MiHWOJXFXaG3dD3Ne9MWuY5ifcT+txbZTy56xm57m3eIXe4annIy/rrpDX5AJn9uWWvW/PC35gO/LBK6VQ7+Aw/btK/Pi9BgvJvpU8V6KuPxg== 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=nHfrKvIf6uhW+PIvN7eGwoBrowmdKIkqx5wJ0m5ZL2o=; b=PgzwRG/9ry9JBvju1rWSB3P0CV15tKWLcYzfBAYlFruTzu4sE8HtyFM5oEr4fTQVl3i1Fw7Od26Devr3MRUFoNgQlR4EZxJ5MXBUmqC1eAR0ZI8PE410PpEpylZvgXRUY7GfH06fzEHadMA2u6P+oJiZDzNwngH/lZjP07uDlmMzxXqdGVPxQ7upp4lUtDfK85Hg/RM6A9f4qyeTjUHFyCewtPZbNJhfSm8cbU3kecRQXX2x9kLXiXLj+gbpRYQomhCOyVGxSJA0lEKdo02Dw57Xi/c4QqP2qi1cAB/qfxDwo5mRb43uldUIO7+YLiFK2Y8yFKNyHSrc6IC9bIshLQ== 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:34 +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:34 +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 , Rob Herring , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org Subject: [PATCH v8 3/9] dt-bindings: clock: Add ids for Lynx 10g PLLs Date: Thu, 27 Oct 2022 15:11:07 -0400 Message-Id: <20221027191113.403712-4-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: 0b9c6f79-4a1b-4985-93f0-08dab84f107c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hhuha1gLAFUqGsMsv/OLrvb5az19+g1JvF4H2HQhsbvtGP5re38zf8xUc1S+Hlz8o4Vtj8dfu0uxF3YnX2QUKVoDdq80ZVn8DMnccmmUibN2m7Xbp98PVSHcxYJHqNmlxHuos+3bd7CPKE6EykPr7a9xomZIKFICBtgEZh1hP93dtTD7oGgH0Zwt2+chwddS3shBB2aK4kUd4zkmAlPALrMPe9P1j+LySgn53onQXcA4ofjdjPX6CN8wYw+ZneQqxkmn2iQ/nVRaSVegUjO8dpcHK3f3bJWnZatup71t4/vgyxK00VCzaYhGmqAt3M8DW0zTr8KPBMrBoAO0DOfbTv6LnPI61/zv84voonvlHmbY84/nl96XdqtsHfXAEenFEq4Y5bs8vM3rkRBbwnq3zvPrKZB+KDagRhZj6x0yNiTaqOHjzw9o1T5XNgg5pNBo1Q1xkc67rF9iVWq0CsGcYQ0/67St06bgOZA1z9k2D9sBnUySCemWDLRhuQkzu9o+EUKsz34QeWT83reMOJJqEij72NsbVWK3mzbW50WL8P86u6AFaoe90Prc6D779k2MhIHA8+1972DznKrqt4tB7/9/TSEolf9lwaMCfmSAVcadpUHd8jtmsKz1mb5UkLeXLb/t+6VQePTp6fKEDlxmWwx00TGXZcyuATEpUokDMY7tTP0voZLGyZiSZN7/kd5ngDB5RS8YbArez9YX/ROdoHrYLdPIdQTG1Z6VoJm6akTcuH1Jbh7eV/VLOOguAFr/fn0xNbpM3H1/I4INtu2pxQ== 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)(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);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: w1C7P7+8H2JStgJGPlDjrJDY2jclMy9M2bAoIoeh9BHbmoXClJ9zutGgFPNTGNB4PHGnYtFs618e6EylzoKBdY8qCISXs6wlzmOad+/DVPmslEy5ORdcEqiPlBP0iZSx+z0QBvZgyY+Wj5szr4lawreozj4mv/k/ZiL9H9JqUOW4T9qobdUY8sH/kv9QVB3lbmoybeogTw46XgfGK6UvRGMdZX2Bha3CLM9lrY3rzd82F8CFjVWxW2uLIw65//+hOxfjJTUxqcyt72r1dwshxHbHB8fZrkAUx7t6VYxZikmFqSbJjrWAl6dnck9Bh28gX4vGf47ttzPGuLln0C+5SY3Jr9loR16i5qqaidcKTC/JgylkKrWd3XZCXronwuHRh7aOaw23nIb5tl02hVdQ1PZyX7zepKFTDGSFviU6oPu5OFGi71Wak1nX88OnFssq2kVaeMIQQ6ynZPbkvgUq7q5LrwLVtQRdS1oFna0mnaM5NxLiaUAYscz/ghSdlT2H3hMtoQPf0Xr6is/iaRHSY5+zpClj0tzL9lPGbvTR6J1j3Eha9m/nCdOUC6F/kijVAo8sSXXRpbyIB5H4sFzjlXxG9CXjW3Uxyb4VC5OKIRl6REMRIaYR91RoUpab6ifKMiaCoMkBxIvjwO+lMwnPB3Ge0YigCP5t36qM/5BwzYfjHHu9775Tx80xHiaHHQBCd49T4ZGmbGJuKHX6PzPlPsCezz9xqRExS3C1lVBxBoxK3EwMroSa+grLr1ATYFrL2n5RJ5zMDZ4CpHHoZOfnQkq9tnbjq6hhSw1sHiG7GQEGIdl10nMVKuWBUNlqvz9LbuZZTp/BbKo/L+53oADOnjXlxLJ8F0YsTP7lEm+ycETG+cFUhvb2OK51A1HXFAwuLrK1QNvWTS3QEslqwG5DXrtGUNvsAjOKIv2gGNJwApdeaeBzfPcooRin7qT1h4gjv1EzR1x3ySekgP9we5LNBAmmKFEUxm+gH5U8KTIZPrJmr2jSYF/qGNawrtVUDVgd2fo0bmFEw0ChNvw4YhF1QYAtiMJ5V8n/+VJeGu5c4GKkfSI+pwofNu+FkUJJqYfCVoJPShx+OSpn/4pbhBWyWHHNooZ9qKxqTBTlIMm9zJBOQ6F3gELrylQ/ciBWMG1YX7u3Wr7upo6/i6OGoOwdE0xp0VMU2qUq0qGgw88zWvUiEzRTTVCdC7IQn5C1Nlgomijq3LBdl/Wa8MEq+5OaQ/mYe8dnIAT3V/vfyM8T+/wr5Gzdar6oD9bOW2y0Av1YcTUZawxMvT0ipD5yESQttmgwyZK5Z8qxREZa2N60Wt+wqGFCZUbQ+Jsu9SS1SSDXMgb71ZW51u+yoztN97Vs379Xr8sbBB+A1P7OeG3StOajpkBta3H2yZ908Yp/CpEP5Xddur/FwDCLk4KR3YDTJknrcvcBFd8qhsaqVw3fYN1HCa6lR1W0SJi4hMlyrYMZE9WFW1kpYfCjUjA/sZMSDP7T5vGVFuNkyqkpbUC+9ZUrmc3Ys3k8EnaW/J5gR1vWH34WJ60Cmt4pHiQL9pFR7Ed2A3IBO0rwggjjb3VpyoU8FMnf6QzGE0ZuhkzbrF9OZ47BxyPZkh6Wa5rxRwEijA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b9c6f79-4a1b-4985-93f0-08dab84f107c 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:34.5967 (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: 0NkzkqhUkfZ+kDLcyAE/O5bAGIsJ/zzZnPAI8cNEA0xmerZ+4ySXTrcT85wBFv/PS0mZ+ospwsauO2lxclXyMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9648 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221027_121142_734746_556B1929 X-CRM114-Status: GOOD ( 13.05 ) 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 ids for the Lynx 10g SerDes's internal PLLs. These may be used with assigned-clock* to specify a particular frequency to use. For example, to set the second PLL (at offset 0x20)'s frequency, use LYNX10G_PLLa(1). These are for use only in the device tree, and are not otherwise used by the driver. Signed-off-by: Sean Anderson Acked-by: Rob Herring Acked-by: Stephen Boyd --- (no changes since v6) Changes in v6: - frequence -> frequency Changes in v5: - Update commit description - Dual id header Changes in v4: - New include/dt-bindings/clock/fsl,lynx-10g.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 include/dt-bindings/clock/fsl,lynx-10g.h diff --git a/include/dt-bindings/clock/fsl,lynx-10g.h b/include/dt-bindings/clock/fsl,lynx-10g.h new file mode 100644 index 000000000000..15362ae85304 --- /dev/null +++ b/include/dt-bindings/clock/fsl,lynx-10g.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ +/* + * Copyright (C) 2022 Sean Anderson + */ + +#ifndef __DT_BINDINGS_CLK_LYNX_10G_H +#define __DT_BINDINGS_CLK_LYNX_10G_H + +#define LYNX10G_CLKS_PER_PLL 2 + +#define LYNX10G_PLLa(a) ((a) * LYNX10G_CLKS_PER_PLL) +#define LYNX10G_PLLa_EX_DLY(a) ((a) * LYNX10G_CLKS_PER_PLL + 1) + +#endif /* __DT_BINDINGS_CLK_LYNX_10G_H */ From patchwork Thu Oct 27 19:11:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13022597 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 95FAFECAAA1 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=GUiEg7pilT7GeK2o/0OJ7NAB0XheMck44zRasrgb+04=; b=pF4V+kfmGY6A+A NakanQUR7yjVp38krQHwQfc0TXSn4ZVy2KlqKXnuPHN33lNcQuHUojx/+rZ/fBodXnasl7/k2/nND T/30+nMyfOce+yqF3P3fd1tjxrPDl06fgC0f1uewbp4ihHoEsvIDRGO0uZIhD9VTOD9l2n1Ath6Dd F0RxtKUqXGUyjjHTTHgWZO0w2APZ8V7Zsn8iOM1Ru/D9PSRXHELk8qWrOtQHDmXhowmYNj55VXlGZ wFdjvLEFg+LgJSBb9fxVEHVLYH4xRE+A1mln2OJohJ3lwSS4akT35OzYRHvFN2Eoa1DEjVo+psSXH z40hrJov/thPugKHFwlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8JT-00Ebhr-Tc; Thu, 27 Oct 2022 19:13:11 +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 1oo8I7-00EbB5-3S; Thu, 27 Oct 2022 19:11:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bXPDN2hppYeFX3bDrxvVd403Xd2IKqwnuDQnxJ/3afHDhMifnIkR03zZeAgqBtMIhGVXP+n0MqHGkdoUCHoKH5yEQ6V3NqYXK4JzIZCqZGJhsUMM50hFlE28B/8hyhoLcuq6X4FriqzQnRhdqr37dSccBodJWgg0gny/Dq0l2S6tfXhsK8xkrnqo8tQ13TI4QXsnjLMQr2HyPEVvUjB4p9fnBKCL7ZpdLMpOQE3FCJ9W6QhIM/bMjP3/Y0equCgFlYiUhiE+4Zw+cKja9ELaWZ5meS3SBYGvnhczBxcEOdojJnHvvqKecLm+pjJMlYebSOiX4WQj8WmR5B1s8Rfd+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=AzwHHDvKlECkQoc5UMIoY5chzd5JfyUxf7Dvl9viaUM=; b=oNIByBompUeCyimJPapKPLtkGxT31qwFWR4+TjtQsOimdiR0uxWupcFVKdzwB3S+ALMfonPqNP7D2Oc0BY2KXP4M0+6ZF6GRGKfEssb/2Pbogt+kOXfffu4cJGgIUBzXmSz9/dMooZv5wC1ZETZMMw+q0eX6lwF5U29WSmRWwxsSQy2XXXnR5YAqHNJOK+mKZgmgQCDf7Hcg1LVq5O167MnjDtVxQGLO97wys4Jz2vlZu69N8FKMNB5K0NBBRhxNmne1VslKVsoe0Wmf8dw71nqxQl5Zn5dhUAQW4zU0/U4yB/goV543np15iz4hCnUUdW1N2WyiPRoLb0dhHJxvAg== 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=AzwHHDvKlECkQoc5UMIoY5chzd5JfyUxf7Dvl9viaUM=; b=Rzlt3RiCiEfvECVCP1kF8ON89o5Ullm4OQr392nhpNaGGYNCtvV5rgoRxPJGkSzxymvw/qGypdEkuu7JFXjM4RbWgh5D/LpDWYp7tYTLRFhGAsauQUp5K/4rpRv3+g2wSN+7NaIJ+gou2upJWDWnluRCN0I2w5cBqFpwtCqY7I0yThWJiJ6pWX84C+u2xM6zP1q+GSXPfhB/sZ1MSIhW2ttZ+We2F60nkrZgSmKSKhXlmpBP1EYhhnQ5oocuUbfDuPSSN7STGmC/Xd/fP2unX3dVBAzRHfTjHfzDsCHUt+K4EKtLS1Yjtbk65Bbt4C5urktjOJw2SOXNBfX9xNKeZQ== 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:37 +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:37 +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 , Jonathan Corbet , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH v8 4/9] phy: fsl: Add Lynx 10G SerDes driver Date: Thu, 27 Oct 2022 15:11:08 -0400 Message-Id: <20221027191113.403712-5-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: b8da2f93-defc-4c42-312e-08dab84f1201 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M6AkB/rzQCv2J7SYoI7nyP3s2TaBNc5/OlAwlkIklRD9R+EDGYj1xGgXs/39nTMCk3IopR230UQwP7TLAp+rwcB6EiCBKOPVCxYlGA9dLsaRpvLtzyvxedVBGkyKIMj4vvsg6bc6JB51B0cUJZGkilEeGw/c8kUQ/hwwTnRicQB0Mh+Jd9TOI8RoTvpcNC/ujTaeKPbE8U/z9uxNwD7x+xv/+3cfUJB46kyp5IOwaevKWYRYqJGY5JYzf92+uhIHJ5xoQ6EMZkKE/hkiN27w6YLWzOgbV63V8FC3hKlnLlfeRJpHAVzKZuI3j0MqcOMoBlx3IqL5KxnpMEk3npb6ceIoD2lub6Go9cJ/kiJztOUY5jWTYINGmfiumN4EOh7ENXDZ/wG00PeGbdZ5IS+JfRXBy2Fd2ZTHSgsPVdRwT/OFqnjm2CCYLUAoH1qb6EjX8cD8ntZh/6dg1fNIvRRPCY+k9YqY8qfM5aldn5wi7xzk4uJsYc21bCGWtbU2aHMewwVJeSu5ufrI+UweXbsFLP6bH1XGdaTtU9h9rKwDvLG522gNY7qrPvGwXFsH0IQjXaFKRvn6VOqfhqarqHmbOw3rmK5VfpIcHLo3lhJSt2kRvGyyb4BMGu+vDWzX+ti++GXd9UPX7lLKM4F3sjbXrRtVsnGkySUZINSR3Kihlo1NeiyFB1ZIhE6ZoVgNKT/S3XW9Qodj/l+fg13sqN/kE8GTJhWomuzYB5NEpraB/AkP2d7JkFuomhkZp0G102gFkobggFylKBz2vupETNyBFH26z9PuDQJmGu4/+nM18yy3bYsVF+MnVt+NnvY3nhwS 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)(30864003)(8676002)(41300700001)(66476007)(316002)(4326008)(8936002)(6512007)(1076003)(186003)(2616005)(6666004)(86362001)(38350700002)(26005)(52116002)(6506007)(21314003)(579004)(559001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uzT9xt2cA1eYGvRQWDK/s5X/BMTCeL2pKW5usEr3UZ7iYUPMN7XH3MQQCsn7eHd5Xtz1U+WDbxmR5Ks2B6ZNI9QVYcf4vUfzxWo+obw8d/flBpuPqQG5fWf3XvtD475YCpfQiaUVycPEPoeWUb8RoCqLwq7Pe4knbOIoEI6DPfZeUJsZ6CvEf6cfrJs/RP08ho5EBWC5EuOCYPt9Hdh09OLx7ilDmT+CbdM07RK88St/QCn0TT9kd0c+UJXxLI0zZT/tXRBO5Viv6QVHdgi53Nlq4iRls8UaNHJvg1xDhHDrLgN8fcC2dbUab6CkRQ60E6W9xhvFOeiZt97jqQZTBFS4CgdZA1XIq1CzALOns6f2LAPPHx9ZU67KMSi3oroaviL6KDpDntSY3WXsFqERgJ2gySKCPJVcp3T9e7JKkaZyq9vbM5yxjfDf+NH7Om3szxmTulSydxshZpMIP+9pAfg5AGn+vOLmUwhtVmzvpKvHNDFNDmpzEeNS2byyVcucDwRqmNbSPYzt2+FqqQNuGbF3m/Vd+d2P/FV1AB79dg+8OXorh7YFB/+USSopxeOtd41/ycL0bYgZCtIRfcAvp3t6MFoK+Rz/BjXY2slxp9Z68EPNyToWVpNpIHW4Nmon1+IrySyUnLr0ewzrnFTuiU+6Cm0Zz3cSOdW/FL2p0hfqhIL36xv+QtZ8HLKUd39Pb2r1PeCGPIiKxS8W8nbsttrXScRoIv4FitrkFcKNgSrkDT3M7jmw83lhpi+RgpGgDj35VWggDcVsHuSePpPNgvNzAMFzMEOulNE+eZu27Ysqm0AnFnNFIGbvOIU6tfarUWP6qi0ZcEd2vbZUHVT6QTCnzLtTNDXTZ9oJLss0u6vP3brqdAbT8wGW9XYcnKbaawxUYHzABSEan/PuV+SQJQ4IujCCjqQbsEx+M7CTgL1EbUBDdWfUUTOii3lc70T1cpxis5d0MqKNyv5c+dfiAXdhDhrmEOQA8RvDGl9D+dl/fOONlE8gYNKQudhzVnggOWvOT1qihG6ARGXX7bfeQ1r+AG9mMW92TY+vB94FmEsOcWePwHDD7rfmy/oKcFN56Owczl2E659EokkiL8rgirx4zmd4yA9d4MV311NuC5U0eKK2BVCp6C6fWl/SGakZ33iiNBHvw7kiNHsoEZw60sRg+PHPtmXcyEkZqeWxIjJRKhYbP0Ryb+8xyM5R8i5x0fJThDj84Homt9X8Qko+5T2ROR7O9Zc0td/q9R1iqz2FcFrhf0XWM4HfDPosX2QA7v0UAOCbV80AKcZXMx5ma+3thFUkr+mU+kizlkMAdPonbbTyqN4CyoViBtVLbZUsztMJLj+ZFyX35EKgjUpYiJi89Se13mHWS50V4+lPPZONT4uWttSqjD/Q88dP9zjIoNTOCVvmxlY1AABh+k8OHl1g5NOgfUAtMl7mtORUTQTvND+++b887HL92kpchNdAD4rPd1Ryti/tH6cOr0/jY/yXUCpi0aF4aDguzTZ88DIV5oQ2dpoRtTPYAriQL34VBl8SXm05R4nuyRnyeKU7j2ZfxPr6KZArAmTVOnOU6UBj6MhpYRdSy6Y9pX7H9T55Ysfg1yL0nn2mYO2CTntBvQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8da2f93-defc-4c42-312e-08dab84f1201 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:37.5810 (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: FOuW8kRxs8XLi1/tTvlURUtIDwmEpgZ/KERiDEwetHWKahGprd0zXIdiGZnoEYYvAjabpROl8a75itqmlTMLcQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9648 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221027_121147_424047_52CB27D3 X-CRM114-Status: GOOD ( 34.45 ) 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 support for the Lynx 10G "SerDes" devices found on various NXP QorIQ SoCs. There may be up to four SerDes devices on each SoC, each supporting up to eight lanes. Protocol support for each SerDes is highly heterogeneous, with each SoC typically having a totally different selection of supported protocols for each lane. Additionally, the SerDes devices on each SoC also have differing support. One SerDes will typically support Ethernet on most lanes, while the other will typically support PCIe on most lanes. There is wide hardware support for this SerDes. It is present on QorIQ T-Series and Layerscape processors. Because each SoC typically has specific instructions and exceptions for its SerDes, I have limited the initial scope of this module to just the LS1046A and LS1088A. Additionally, I have only added support for Ethernet protocols. There is not a great need for dynamic reconfiguration for other protocols (except perhaps for M.2 cards), so support for them may never be added. Nevertheless, I have tried to provide an obvious path for adding support for other SoCs as well as other protocols. SATA just needs support for configuring LNmSSCR0. PCIe may need to configure the equalization registers. It also uses multiple lanes. I have tried to write the driver with multi-lane support in mind, so there should not need to be any large changes. Although there are 6 protocols supported, I have only tested SGMII and XFI. The rest have been implemented as described in the datasheet. Most of these protocols should work "as-is", but 10GBASE-KR will need PCS support for link training. The PLLs are modeled as clocks proper. This lets us take advantage of the existing clock infrastructure. I have not given the same treatment to the per-lane clocks because they need to be programmed in-concert with the rest of the lane settings. One tricky thing is that the VCO (PLL) rate exceeds 2^32 (maxing out at around 5GHz). This will be a problem on 32-bit platforms, since clock rates are stored as unsigned longs. To work around this, the pll clock rate is generally treated in units of kHz. The PLLs are configured rather interestingly. Instead of the usual direct programming of the appropriate divisors, the input and output clock rates are selected directly. Generally, the only restriction is that the input and output must be integer multiples of each other. This suggests some kind of internal look-up table. The datasheets generally list out the supported combinations explicitly, and not all input/output combinations are documented. I'm not sure if this is due to lack of support, or due to an oversight. If this becomes an issue, then some combinations can be blacklisted (or whitelisted). This may also be necessary for other SoCs which have more stringent clock requirements. Unlike some other phys where e.g. PCIe x4 will use 4 separate phys all configured for PCIe, this driver uses one phy configured to use 4 lanes. This is because while the individual lanes may be configured individually, the protocol selection acts on all lanes at once. Additionally, the order which lanes should be configured in is specified by the datasheet. To coordinate this, lanes are reserved in phy_init, and released in phy_exit. This driver was written with reference to the LS1046A reference manual. However, it was informed by reference manuals for all processors with mEMACs, especially the T4240 (which appears to have a "maxed-out" configuration). The earlier P-series processors appear to be similar, but have a different overall register layout (using "banks" instead of separate SerDes). Perhaps this those use a "5G Lynx SerDes." Signed-off-by: Sean Anderson --- Changes in v8: - Remove unused variable from lynx_ls_mode_init Changes in v7: - Break out call order into generic documentation - Refuse to switch "major" protocols - Update Kconfig to reflect restrictions - Remove set/clear of "pcs reset" bit, since it doesn't seem to fix anything. Changes in v6: - Update MAINTAINERS to include new files - Include bitfield.h and slab.h to allow compilation on non-arm64 arches. - Depend on COMMON_CLK and either layerscape/ppc Changes in v5: - Remove references to PHY_INTERFACE_MODE_1000BASEKX to allow this series to be applied directly to linux/master. - Add fsl,lynx-10g.h to MAINTAINERS Changes in v4: - Rework all debug statements to remove use of __func__. Additional information has been provided as necessary. - Consider alternative parent rates in round_rate and not in set_rate. Trying to modify out parent's rate in set_rate will deadlock. - Explicitly perform a stop/reset sequence in set_rate. This way we always ensure that the PLL is properly stopped. - Set the power-down bit when disabling the PLL. We can do this now that enable/disable aren't abused during the set rate sequence. - Fix typos in QSGMII_OFFSET and XFI_OFFSET - Rename LNmTECR0_TEQ_TYPE_PRE to LNmTECR0_TEQ_TYPE_POST to better reflect its function (adding post-cursor equalization). - Use of_clk_hw_onecell_get instead of a custom function. - Return struct clks from lynx_clks_init instead of embedding lynx_clk in lynx_priv. - Rework PCCR helper functions; T-series SoCs differ from Layerscape SoCs primarily in the layout and offset of the PCCRs. This will help bring a cleaner abstraction layer. The caps have been removed, since this handles the only current usage. - Convert to use new binding format. As a result of this, we no longer need to have protocols for PCIe or SATA. Additionally, modes now live in lynx_group instead of lynx_priv. - Remove teq from lynx_proto_params, since it can be determined from preq_ratio/postq_ratio. - Fix an early return from lynx_set_mode not releasing serdes->lock. - Rename lynx_priv.conf to .cfg, since I kept mistyping it. Changes in v3: - Rename remaining references to QorIQ SerDes to Lynx 10G - Fix PLL enable sequence by waiting for our reset request to be cleared before continuing. Do the same for the lock, even though it isn't as critical. Because we will delay for 1.5ms on average, use prepare instead of enable so we can sleep. - Document the status of each protocol - Fix offset of several bitfields in RECR0 - Take into account PLLRST_B, SDRST_B, and SDEN when considering whether a PLL is "enabled." - Only power off unused lanes. - Split mode lane mask into first/last lane (like group) - Read modes from device tree - Use caps to determine whether KX/KR are supported - Move modes to lynx_priv - Ensure that the protocol controller is not already in-use when we try to configure a new mode. This should only occur if the device tree is misconfigured (e.g. when QSGMII is selected on two lanes but there is only one QSGMII controller). - Split PLL drivers off into their own file - Add clock for "ext_dly" instead of writing the bit directly (and racing with any clock code). - Use kasprintf instead of open-coding the snprintf dance - Support 1000BASE-KX in lynx_lookup_proto. This still requires PCS support, so nothing is truly "enabled" yet. Changes in v2: - Rename driver to Lynx 10G (etc.) - Fix not clearing group->pll after disabling it - Support 1 and 2 phy-cells - Power off lanes during probe - Clear SGMIIaCR1_PCS_EN during probe - Rename LYNX_PROTO_UNKNOWN to LYNX_PROTO_NONE - Handle 1000BASE-KX in lynx_proto_mode_prep Documentation/driver-api/phy/index.rst | 1 + Documentation/driver-api/phy/lynx_10g.rst | 58 + MAINTAINERS | 7 + drivers/phy/freescale/Kconfig | 22 + drivers/phy/freescale/Makefile | 3 + drivers/phy/freescale/lynx-10g.h | 16 + drivers/phy/freescale/phy-fsl-lynx-10g-clk.c | 503 ++++++++ drivers/phy/freescale/phy-fsl-lynx-10g.c | 1159 ++++++++++++++++++ 8 files changed, 1769 insertions(+) create mode 100644 Documentation/driver-api/phy/lynx_10g.rst create mode 100644 drivers/phy/freescale/lynx-10g.h create mode 100644 drivers/phy/freescale/phy-fsl-lynx-10g-clk.c create mode 100644 drivers/phy/freescale/phy-fsl-lynx-10g.c diff --git a/Documentation/driver-api/phy/index.rst b/Documentation/driver-api/phy/index.rst index 69ba1216de72..c9b7a4698dab 100644 --- a/Documentation/driver-api/phy/index.rst +++ b/Documentation/driver-api/phy/index.rst @@ -7,6 +7,7 @@ Generic PHY Framework .. toctree:: phy + lynx_10g samsung-usb2 .. only:: subproject and html diff --git a/Documentation/driver-api/phy/lynx_10g.rst b/Documentation/driver-api/phy/lynx_10g.rst new file mode 100644 index 000000000000..ebbf4dd86726 --- /dev/null +++ b/Documentation/driver-api/phy/lynx_10g.rst @@ -0,0 +1,58 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=========================== +Lynx 10G Phy (QorIQ SerDes) +=========================== + +Using this phy +-------------- + +:c:func:`phy_get` just gets (or creates) a new :c:type:`phy` with the lanes +described in the phandle. :c:func:`phy_init` is what actually reserves the +lanes for use. Unlike some other drivers, when the phy is created, there is no +default protocol. :c:func:`phy_set_mode ` must be called in +order to set the protocol. + +Supporting SoCs +--------------- + +Each new SoC needs a :c:type:`struct lynx_conf `, containing the +number of lanes in each device, the endianness of the device, and the helper +functions to use when selecting protocol controllers. For example, the +configuration for the LS1046A is:: + + static const struct lynx_cfg ls1046a_cfg = { + .lanes = 4, + .endian = REGMAP_ENDIAN_BIG, + .mode_conflict = lynx_ls_mode_conflict, + .mode_apply = lynx_ls_mode_apply, + .mode_init = lynx_ls_mode_init, + }; + +The ``mode_`` functions will generally be common to all SoCs in a series (e.g. +all Layerscape SoCs or all T-series SoCs). + +In addition, you will need to add a device node as documented in +``Documentation/devicetree/bindings/phy/fsl,lynx-10g.yaml``. This lets the +driver know which lanes are available to configure. + +Supporting Protocols +-------------------- + +Each protocol is a combination of values which must be programmed into the lane +registers. To add a new protocol, first add it to :c:type:`enum lynx_protocol +`. Add a new entry to `lynx_proto_params`, and populate the +appropriate fields. Modify `lynx_lookup_proto` to map the :c:type:`enum +phy_mode ` to :c:type:`enum lynx_protocol `. Update +the ``mode_conflict``, ``mode_apply``, and ``mode_init`` helpers are updated to +support your protocol. + +You may need to modify :c:func:`lynx_set_mode` in order to support your +protocol. This can happen when you have added members to :c:type:`struct +lynx_proto_params `. It can also happen if you have specific +clocking requirements, or protocol-specific registers to program. + +Internal API Reference +---------------------- + +.. kernel-doc:: drivers/phy/freescale/phy-fsl-lynx-10g.c diff --git a/MAINTAINERS b/MAINTAINERS index cf0f18502372..72cb2783fd6c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12083,6 +12083,13 @@ S: Maintained W: http://linux-test-project.github.io/ T: git git://github.com/linux-test-project/ltp.git +LYNX 10G SERDES DRIVER +M: Sean Anderson +S: Maintained +F: Documentation/driver-api/phy/lynx_10g.rst +F: drivers/phy/freescale/*lynx-10g* +F: include/dt-bindings/clock/fsl,lynx-10g.h + LYNX 28G SERDES PHY DRIVER M: Ioana Ciornei L: netdev@vger.kernel.org diff --git a/drivers/phy/freescale/Kconfig b/drivers/phy/freescale/Kconfig index 853958fb2c06..a6ccccf9e39b 100644 --- a/drivers/phy/freescale/Kconfig +++ b/drivers/phy/freescale/Kconfig @@ -47,3 +47,25 @@ config PHY_FSL_LYNX_28G found on NXP's Layerscape platforms such as LX2160A. Used to change the protocol running on SerDes lanes at runtime. Only useful for a restricted set of Ethernet protocols. + +config PHY_FSL_LYNX_10G + tristate "Freescale QorIQ Lynx 10G SerDes support" + depends on COMMON_CLK + depends on ARCH_LAYERSCAPE || PPC || COMPILE_TEST + select GENERIC_PHY + select REGMAP_MMIO + 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 + device supports up to eight lanes. The SerDes is configured by + default by the RCW, but this module is necessary in order to support + some modes (such as 2.5G SGMII or 1000BASE-KX), or clock setups (as + only as subset of clock configurations are supported by the RCW). + The hardware supports a variety of protocols, including Ethernet, + SATA, PCIe, and more exotic links such as Interlaken and Aurora. This + driver only supports Ethernet, but it will try not to touch lanes + configured for other protocols. + + If you have a QorIQ processor and want to dynamically reconfigure your + SerDes, say Y. If this driver is compiled as a module, it will be + named phy-fsl-lynx-10g-drv. diff --git a/drivers/phy/freescale/Makefile b/drivers/phy/freescale/Makefile index cedb328bc4d2..1f18936507e0 100644 --- a/drivers/phy/freescale/Makefile +++ b/drivers/phy/freescale/Makefile @@ -3,4 +3,7 @@ obj-$(CONFIG_PHY_FSL_IMX8MQ_USB) += phy-fsl-imx8mq-usb.o obj-$(CONFIG_PHY_MIXEL_LVDS_PHY) += phy-fsl-imx8qm-lvds-phy.o obj-$(CONFIG_PHY_MIXEL_MIPI_DPHY) += phy-fsl-imx8-mipi-dphy.o obj-$(CONFIG_PHY_FSL_IMX8M_PCIE) += phy-fsl-imx8m-pcie.o +phy-fsl-lynx-10g-drv-y += phy-fsl-lynx-10g.o +phy-fsl-lynx-10g-drv-y += phy-fsl-lynx-10g-clk.o +obj-$(CONFIG_PHY_FSL_LYNX_10G) += phy-fsl-lynx-10g-drv.o obj-$(CONFIG_PHY_FSL_LYNX_28G) += phy-fsl-lynx-28g.o diff --git a/drivers/phy/freescale/lynx-10g.h b/drivers/phy/freescale/lynx-10g.h new file mode 100644 index 000000000000..75d9353a867b --- /dev/null +++ b/drivers/phy/freescale/lynx-10g.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2022 Sean Anderson + */ + +#ifndef LYNX_10G +#define LYNX_10G + +struct clk; +struct device; +struct regmap; + +int lynx_clks_init(struct device *dev, struct regmap *regmap, + struct clk *plls[2], struct clk *ex_dlys[2]); + +#endif /* LYNX 10G */ diff --git a/drivers/phy/freescale/phy-fsl-lynx-10g-clk.c b/drivers/phy/freescale/phy-fsl-lynx-10g-clk.c new file mode 100644 index 000000000000..6ec32bdfb9dd --- /dev/null +++ b/drivers/phy/freescale/phy-fsl-lynx-10g-clk.c @@ -0,0 +1,503 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2022 Sean Anderson + * + * This file contains the implementation for the PLLs found on Lynx 10G phys. + * + * XXX: The VCO rate of the PLLs can exceed ~4GHz, which is the maximum rate + * expressable in an unsigned long. To work around this, rates are specified in + * kHz. This is as if there was a division by 1000 in the PLL. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "lynx-10g.h" + +#define PLL_STRIDE 0x20 +#define PLLa(a, off) ((a) * PLL_STRIDE + (off)) +#define PLLaRSTCTL(a) PLLa(a, 0x00) +#define PLLaCR0(a) PLLa(a, 0x04) + +#define PLLaRSTCTL_RSTREQ BIT(31) +#define PLLaRSTCTL_RST_DONE BIT(30) +#define PLLaRSTCTL_RST_ERR BIT(29) +#define PLLaRSTCTL_PLLRST_B BIT(7) +#define PLLaRSTCTL_SDRST_B BIT(6) +#define PLLaRSTCTL_SDEN BIT(5) + +#define PLLaRSTCTL_ENABLE_SET (PLLaRSTCTL_RST_DONE | PLLaRSTCTL_PLLRST_B | \ + PLLaRSTCTL_SDRST_B | PLLaRSTCTL_SDEN) +#define PLLaRSTCTL_ENABLE_MASK (PLLaRSTCTL_ENABLE_SET | PLLaRSTCTL_RST_ERR) + +#define PLLaCR0_POFF BIT(31) +#define PLLaCR0_RFCLK_SEL GENMASK(30, 28) +#define PLLaCR0_PLL_LCK BIT(23) +#define PLLaCR0_FRATE_SEL GENMASK(19, 16) +#define PLLaCR0_DLYDIV_SEL GENMASK(1, 0) + +#define PLLaCR0_DLYDIV_SEL_16 0b01 + +/** + * struct lynx_clk - Driver data for the PLLs + * @pll: The PLL clock + * @ex_dly: The "PLLa_ex_dly_clk" clock + * @ref: Our reference clock + * @dev: The serdes device + * @regmap: Our registers + * @idx: Which PLL this clock is for + */ +struct lynx_clk { + struct clk_hw pll, ex_dly; + struct clk_hw *ref; + struct device *dev; + struct regmap *regmap; + unsigned int idx; +}; + +static u32 lynx_read(struct lynx_clk *clk, u32 reg) +{ + unsigned int ret = 0; + + WARN_ON_ONCE(regmap_read(clk->regmap, reg, &ret)); + return ret; +} + +static void lynx_write(struct lynx_clk *clk, u32 val, u32 reg) +{ + WARN_ON_ONCE(regmap_write(clk->regmap, reg, val)); +} + +static struct lynx_clk *lynx_pll_to_clk(struct clk_hw *hw) +{ + return container_of(hw, struct lynx_clk, pll); +} + +static struct lynx_clk *lynx_ex_dly_to_clk(struct clk_hw *hw) +{ + return container_of(hw, struct lynx_clk, ex_dly); +} + +static void lynx_pll_stop(struct lynx_clk *clk) +{ + u32 rstctl; + + rstctl = lynx_read(clk, PLLaRSTCTL(clk->idx)); + rstctl &= ~PLLaRSTCTL_SDRST_B; + lynx_write(clk, rstctl, PLLaRSTCTL(clk->idx)); + + ndelay(50); + + rstctl = lynx_read(clk, PLLaRSTCTL(clk->idx)); + rstctl &= ~(PLLaRSTCTL_SDEN | PLLaRSTCTL_PLLRST_B); + lynx_write(clk, rstctl, PLLaRSTCTL(clk->idx)); + + ndelay(100); +} + +static void lynx_pll_disable(struct clk_hw *hw) +{ + struct lynx_clk *clk = lynx_pll_to_clk(hw); + u32 cr0; + + dev_dbg(clk->dev, "disable pll%d\n", clk->idx); + + lynx_pll_stop(clk); + + cr0 = lynx_read(clk, PLLaCR0(clk->idx)); + cr0 |= PLLaCR0_POFF; + lynx_write(clk, cr0, PLLaCR0(clk->idx)); +} + +static int lynx_pll_reset(struct lynx_clk *clk) +{ + int ret; + u32 rstctl = lynx_read(clk, PLLaRSTCTL(clk->idx)); + + rstctl |= PLLaRSTCTL_RSTREQ; + lynx_write(clk, rstctl, PLLaRSTCTL(clk->idx)); + ret = read_poll_timeout(lynx_read, rstctl, + rstctl & (PLLaRSTCTL_RST_DONE | PLLaRSTCTL_RST_ERR), + 100, 5000, true, clk, PLLaRSTCTL(clk->idx)); + if (rstctl & PLLaRSTCTL_RST_ERR) + ret = -EIO; + if (ret) { + dev_err(clk->dev, "pll%d reset failed\n", clk->idx); + return ret; + } + + rstctl |= PLLaRSTCTL_SDEN | PLLaRSTCTL_PLLRST_B | PLLaRSTCTL_SDRST_B; + lynx_write(clk, rstctl, PLLaRSTCTL(clk->idx)); + return 0; +} + +static int lynx_pll_prepare(struct clk_hw *hw) +{ + struct lynx_clk *clk = lynx_pll_to_clk(hw); + u32 rstctl = lynx_read(clk, PLLaRSTCTL(clk->idx)); + u32 cr0 = lynx_read(clk, PLLaCR0(clk->idx)); + + /* + * "Enabling" the PLL involves resetting it (and all attached lanes). + * Avoid doing this if we are already enabled. + */ + if (!(cr0 & PLLaCR0_POFF) && + (rstctl & PLLaRSTCTL_ENABLE_MASK) == PLLaRSTCTL_ENABLE_SET) { + dev_dbg(clk->dev, "pll%d already prepared\n", clk->idx); + return 0; + } + + dev_dbg(clk->dev, "prepare pll%d\n", clk->idx); + + cr0 &= ~PLLaCR0_POFF; + lynx_write(clk, cr0, PLLaCR0(clk->idx)); + + return lynx_pll_reset(clk); +} + +static int lynx_pll_is_enabled(struct clk_hw *hw) +{ + struct lynx_clk *clk = lynx_pll_to_clk(hw); + u32 cr0 = lynx_read(clk, PLLaCR0(clk->idx)); + bool enabled = !(cr0 & PLLaCR0_POFF); + + dev_dbg(clk->dev, "pll%d %s enabled\n", clk->idx, + enabled ? "is" : "is not"); + + return enabled; +} + +static const u32 rfclk_sel_map[8] = { + [0b000] = 100000000, + [0b001] = 125000000, + [0b010] = 156250000, + [0b011] = 150000000, +}; + +/** + * lynx_rfclk_to_sel() - Convert a reference clock rate to a selector + * @rate: The reference clock rate + * + * To allow for some variation in the reference clock rate, up to 100ppm of + * error is allowed. + * + * Return: An appropriate selector for @rate, or -%EINVAL. + */ +static int lynx_rfclk_to_sel(u32 rate) +{ + int ret; + + for (ret = 0; ret < ARRAY_SIZE(rfclk_sel_map); ret++) { + u32 rfclk_rate = rfclk_sel_map[ret]; + /* Allow an error of 100ppm */ + u32 error = rfclk_rate / 10000; + + if (rate > rfclk_rate - error && rate < rfclk_rate + error) + return ret; + } + + return -EINVAL; +} + +static const u32 frate_sel_map[16] = { + [0b0000] = 5000000, + [0b0101] = 3750000, + [0b0110] = 5156250, + [0b0111] = 4000000, + [0b1001] = 3125000, + [0b1010] = 3000000, +}; + +/** + * lynx_frate_to_sel() - Convert a VCO clock rate to a selector + * @rate_khz: The VCO frequency, in kHz + * + * Return: An appropriate selector for @rate_khz, or -%EINVAL. + */ +static int lynx_frate_to_sel(u32 rate_khz) +{ + int ret; + + for (ret = 0; ret < ARRAY_SIZE(frate_sel_map); ret++) + if (frate_sel_map[ret] == rate_khz) + return ret; + + return -EINVAL; +} + +static u32 lynx_pll_ratio(u32 frate_sel, u32 rfclk_sel) +{ + u64 frate; + u32 rfclk, error, ratio; + + frate = frate_sel_map[frate_sel] * (u64)HZ_PER_KHZ; + rfclk = rfclk_sel_map[rfclk_sel]; + + if (!frate || !rfclk) + return 0; + + ratio = div_u64_rem(frate, rfclk, &error); + if (!error) + return ratio; + return 0; +} + +static unsigned long lynx_pll_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct lynx_clk *clk = lynx_pll_to_clk(hw); + u32 cr0 = lynx_read(clk, PLLaCR0(clk->idx)); + u32 frate_sel = FIELD_GET(PLLaCR0_FRATE_SEL, cr0); + u32 rfclk_sel = FIELD_GET(PLLaCR0_RFCLK_SEL, cr0); + u32 ratio = lynx_pll_ratio(frate_sel, rfclk_sel); + unsigned long ret; + + /* Ensure that the parent matches our rfclk selector */ + if (rfclk_sel == lynx_rfclk_to_sel(parent_rate)) + ret = mult_frac(parent_rate, ratio, HZ_PER_KHZ); + else + ret = 0; + + dev_dbg(clk->dev, "recalc pll%d new=%llu parent=%lu\n", clk->idx, + (u64)ret * HZ_PER_KHZ, parent_rate); + return ret; +} + +static long lynx_pll_round_rate(struct clk_hw *hw, unsigned long rate_khz, + unsigned long *parent_rate) +{ + int frate_sel, rfclk_sel; + struct lynx_clk *clk = lynx_pll_to_clk(hw); + u32 ratio; + + dev_dbg(clk->dev, "round pll%d new=%llu parent=%lu\n", clk->idx, + (u64)rate_khz * HZ_PER_KHZ, *parent_rate); + + frate_sel = lynx_frate_to_sel(rate_khz); + if (frate_sel < 0) + return frate_sel; + + /* Try the current parent rate */ + rfclk_sel = lynx_rfclk_to_sel(*parent_rate); + if (rfclk_sel >= 0) { + ratio = lynx_pll_ratio(frate_sel, rfclk_sel); + if (ratio) + return mult_frac(*parent_rate, ratio, HZ_PER_KHZ); + } + + /* Try all possible parent rates */ + for (rfclk_sel = 0; + rfclk_sel < ARRAY_SIZE(rfclk_sel_map); + rfclk_sel++) { + unsigned long new_parent_rate; + + ratio = lynx_pll_ratio(frate_sel, rfclk_sel); + if (!ratio) + continue; + + /* Ensure the reference clock can produce this rate */ + new_parent_rate = rfclk_sel_map[rfclk_sel]; + new_parent_rate = clk_hw_round_rate(clk->ref, new_parent_rate); + if (rfclk_sel != lynx_rfclk_to_sel(new_parent_rate)) + continue; + + *parent_rate = new_parent_rate; + return mult_frac(new_parent_rate, ratio, HZ_PER_KHZ); + } + + return -EINVAL; +} + +static int lynx_pll_set_rate(struct clk_hw *hw, unsigned long rate_khz, + unsigned long parent_rate) +{ + int frate_sel, rfclk_sel; + struct lynx_clk *clk = lynx_pll_to_clk(hw); + u32 ratio, cr0 = lynx_read(clk, PLLaCR0(clk->idx)); + + dev_dbg(clk->dev, "set rate pll%d new=%llu parent=%lu\n", clk->idx, + (u64)rate_khz * HZ_PER_KHZ, parent_rate); + + frate_sel = lynx_frate_to_sel(rate_khz); + if (frate_sel < 0) + return frate_sel; + + rfclk_sel = lynx_rfclk_to_sel(parent_rate); + if (rfclk_sel < 0) + return rfclk_sel; + + ratio = lynx_pll_ratio(frate_sel, rfclk_sel); + if (!ratio) + return -EINVAL; + + lynx_pll_stop(clk); + cr0 &= ~(PLLaCR0_RFCLK_SEL | PLLaCR0_FRATE_SEL); + cr0 |= FIELD_PREP(PLLaCR0_RFCLK_SEL, rfclk_sel); + cr0 |= FIELD_PREP(PLLaCR0_FRATE_SEL, frate_sel); + lynx_write(clk, cr0, PLLaCR0(clk->idx)); + /* Don't bother resetting if it's off */ + if (cr0 & PLLaCR0_POFF) + return 0; + return lynx_pll_reset(clk); +} + +static const struct clk_ops lynx_pll_clk_ops = { + .prepare = lynx_pll_prepare, + .disable = lynx_pll_disable, + .is_enabled = lynx_pll_is_enabled, + .recalc_rate = lynx_pll_recalc_rate, + .round_rate = lynx_pll_round_rate, + .set_rate = lynx_pll_set_rate, +}; + +static void lynx_ex_dly_disable(struct clk_hw *hw) +{ + struct lynx_clk *clk = lynx_ex_dly_to_clk(hw); + u32 cr0 = lynx_read(clk, PLLaCR0(clk->idx)); + + cr0 &= ~PLLaCR0_DLYDIV_SEL; + lynx_write(clk, PLLaCR0(clk->idx), cr0); +} + +static int lynx_ex_dly_enable(struct clk_hw *hw) +{ + struct lynx_clk *clk = lynx_ex_dly_to_clk(hw); + u32 cr0 = lynx_read(clk, PLLaCR0(clk->idx)); + + cr0 &= ~PLLaCR0_DLYDIV_SEL; + cr0 |= FIELD_PREP(PLLaCR0_DLYDIV_SEL, PLLaCR0_DLYDIV_SEL_16); + lynx_write(clk, PLLaCR0(clk->idx), cr0); + return 0; +} + +static int lynx_ex_dly_is_enabled(struct clk_hw *hw) +{ + struct lynx_clk *clk = lynx_ex_dly_to_clk(hw); + + return lynx_read(clk, PLLaCR0(clk->idx)) & PLLaCR0_DLYDIV_SEL; +} + +static unsigned long lynx_ex_dly_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + return parent_rate / 16; +} + +static const struct clk_ops lynx_ex_dly_clk_ops = { + .enable = lynx_ex_dly_enable, + .disable = lynx_ex_dly_disable, + .is_enabled = lynx_ex_dly_is_enabled, + .recalc_rate = lynx_ex_dly_recalc_rate, +}; + +static int lynx_clk_init(struct clk_hw_onecell_data *hw_data, + struct device *dev, struct regmap *regmap, + unsigned int index) +{ + const struct clk_hw *pll_parents, *ex_dly_parents; + struct clk_init_data pll_init = { + .ops = &lynx_pll_clk_ops, + .parent_hws = &pll_parents, + .num_parents = 1, + .flags = CLK_GET_RATE_NOCACHE | CLK_SET_RATE_PARENT | + CLK_OPS_PARENT_ENABLE, + }; + struct clk_init_data ex_dly_init = { + .ops = &lynx_ex_dly_clk_ops, + .parent_hws = &ex_dly_parents, + .num_parents = 1, + }; + struct clk *ref; + struct lynx_clk *clk; + char *ref_name; + int ret; + + clk = devm_kzalloc(dev, sizeof(*clk), GFP_KERNEL); + if (!clk) + return -ENOMEM; + + clk->dev = dev; + clk->regmap = regmap; + clk->idx = index; + + ref_name = kasprintf(GFP_KERNEL, "ref%d", index); + pll_init.name = kasprintf(GFP_KERNEL, "%s.pll%d_khz", dev_name(dev), + index); + ex_dly_init.name = kasprintf(GFP_KERNEL, "%s.pll%d_ex_dly_khz", + dev_name(dev), index); + if (!ref_name || !pll_init.name || !ex_dly_init.name) { + ret = -ENOMEM; + goto out; + } + + ref = devm_clk_get(dev, ref_name); + if (IS_ERR(clk->ref)) { + ret = PTR_ERR(clk->ref); + dev_err_probe(dev, ret, "could not get %s\n", ref_name); + goto out; + } + + clk->ref = __clk_get_hw(ref); + pll_parents = clk->ref; + clk->pll.init = &pll_init; + ret = devm_clk_hw_register(dev, &clk->pll); + if (ret) { + dev_err_probe(dev, ret, "could not register %s\n", + pll_init.name); + goto out; + } + + ex_dly_parents = &clk->pll; + clk->ex_dly.init = &ex_dly_init; + ret = devm_clk_hw_register(dev, &clk->ex_dly); + if (ret) + dev_err_probe(dev, ret, "could not register %s\n", + ex_dly_init.name); + + hw_data->hws[LYNX10G_PLLa(index)] = &clk->pll; + hw_data->hws[LYNX10G_PLLa_EX_DLY(index)] = &clk->ex_dly; + +out: + kfree(ref_name); + kfree(pll_init.name); + kfree(ex_dly_init.name); + return ret; +} + +#define NUM_PLLS 2 +#define NUM_CLKS (NUM_PLLS * LYNX10G_CLKS_PER_PLL) + +int lynx_clks_init(struct device *dev, struct regmap *regmap, + struct clk *plls[2], struct clk *ex_dlys[2]) +{ + int ret, i; + struct clk_hw_onecell_data *hw_data; + + hw_data = devm_kzalloc(dev, struct_size(hw_data, hws, NUM_CLKS), + GFP_KERNEL); + if (!hw_data) + return -ENOMEM; + hw_data->num = NUM_CLKS; + + for (i = 0; i < NUM_PLLS; i++) { + ret = lynx_clk_init(hw_data, dev, regmap, i); + if (ret) + return ret; + + plls[i] = hw_data->hws[LYNX10G_PLLa(i)]->clk; + ex_dlys[i] = hw_data->hws[LYNX10G_PLLa_EX_DLY(i)]->clk; + } + + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, hw_data); + if (ret) + dev_err_probe(dev, ret, "could not register clock provider\n"); + + return ret; +} diff --git a/drivers/phy/freescale/phy-fsl-lynx-10g.c b/drivers/phy/freescale/phy-fsl-lynx-10g.c new file mode 100644 index 000000000000..94840094db54 --- /dev/null +++ b/drivers/phy/freescale/phy-fsl-lynx-10g.c @@ -0,0 +1,1159 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2022 Sean Anderson + * + * This driver is for the Lynx 10G phys found on many QorIQ devices, including + * the Layerscape series. + */ + +#include +#include +#include +#include +#include +#include + +#include "lynx-10g.h" + +#define TCALCR 0x90 +#define TCALCR1 0x94 +#define RCALCR 0xa0 +#define RCALCR1 0xa4 + +#define CALCR_CALRST_B BIT(27) + +#define LS_PCCR_BASE 0x200 +#define PCCR_STRIDE 0x4 + +#define LS_PCCRa(a) (LS_PCCR_BASE + (a) * PCCR_STRIDE) + +#define PCCR8_SGMIIa_KX BIT(3) +#define PCCR8_SGMIIa_MASK GENMASK(3, 0) +#define PCCR8_SGMIIa_SHIFT(a) (28 - (a) * 4) + +#define PCCR9_QSGMIIa_MASK GENMASK(2, 0) +#define PCCR9_QSGMIIa_SHIFT(a) (28 - (a) * 4) + +#define PCCRB_XFIa_MASK GENMASK(2, 0) +#define PCCRB_XFIa_SHIFT(a) (28 - (a) * 4) + +#define LANE_BASE 0x800 +#define LANE_STRIDE 0x40 +#define LNm(m, off) (LANE_BASE + (m) * LANE_STRIDE + (off)) +#define LNmGCR0(m) LNm(m, 0x00) +#define LNmGCR1(m) LNm(m, 0x04) +#define LNmSSCR0(m) LNm(m, 0x0C) +#define LNmRECR0(m) LNm(m, 0x10) +#define LNmRECR1(m) LNm(m, 0x14) +#define LNmTECR0(m) LNm(m, 0x18) +#define LNmSSCR1(m) LNm(m, 0x1C) +#define LNmTTLCR0(m) LNm(m, 0x20) + +#define LNmGCR0_RPLL_LES BIT(31) +#define LNmGCR0_RRAT_SEL GENMASK(29, 28) +#define LNmGCR0_TPLL_LES BIT(27) +#define LNmGCR0_TRAT_SEL GENMASK(25, 24) +#define LNmGCR0_RRST_B BIT(22) +#define LNmGCR0_TRST_B BIT(21) +#define LNmGCR0_RX_PD BIT(20) +#define LNmGCR0_TX_PD BIT(19) +#define LNmGCR0_IF20BIT_EN BIT(18) +#define LNmGCR0_FIRST_LANE BIT(16) +#define LNmGCR0_TTRM_VM_SEL GENMASK(13, 12) +#define LNmGCR0_PROTS GENMASK(11, 7) + +#define LNmGCR0_RAT_SEL_SAME 0b00 +#define LNmGCR0_RAT_SEL_HALF 0b01 +#define LNmGCR0_RAT_SEL_QUARTER 0b10 +#define LNmGCR0_RAT_SEL_DOUBLE 0b11 + +#define LNmGCR0_PROTS_PCIE 0b00000 +#define LNmGCR0_PROTS_SGMII 0b00001 +#define LNmGCR0_PROTS_SATA 0b00010 +#define LNmGCR0_PROTS_XFI 0b01010 + +#define LNmGCR1_RDAT_INV BIT(31) +#define LNmGCR1_TDAT_INV BIT(30) +#define LNmGCR1_OPAD_CTL BIT(26) +#define LNmGCR1_REIDL_TH GENMASK(22, 20) +#define LNmGCR1_REIDL_EX_SEL GENMASK(19, 18) +#define LNmGCR1_REIDL_ET_SEL GENMASK(17, 16) +#define LNmGCR1_REIDL_EX_MSB BIT(15) +#define LNmGCR1_REIDL_ET_MSB BIT(14) +#define LNmGCR1_REQ_CTL_SNP BIT(13) +#define LNmGCR1_REQ_CDR_SNP BIT(12) +#define LNmGCR1_TRSTDIR BIT(7) +#define LNmGCR1_REQ_BIN_SNP BIT(6) +#define LNmGCR1_ISLEW_RCTL GENMASK(5, 4) +#define LNmGCR1_OSLEW_RCTL GENMASK(1, 0) + +#define LNmRECR0_RXEQ_BST BIT(28) +#define LNmRECR0_GK2OVD GENMASK(27, 24) +#define LNmRECR0_GK3OVD GENMASK(19, 16) +#define LNmRECR0_GK2OVD_EN BIT(15) +#define LNmRECR0_GK3OVD_EN BIT(14) +#define LNmRECR0_OSETOVD_EN BIT(13) +#define LNmRECR0_BASE_WAND GENMASK(11, 10) +#define LNmRECR0_OSETOVD GENMASK(6, 0) + +#define LNmRECR0_BASE_WAND_OFF 0b00 +#define LNmRECR0_BASE_WAND_DEFAULT 0b01 +#define LNmRECR0_BASE_WAND_ALTERNATE 0b10 +#define LNmRECR0_BASE_WAND_OSETOVD 0b11 + +#define LNmTECR0_TEQ_TYPE GENMASK(29, 28) +#define LNmTECR0_SGN_PREQ BIT(26) +#define LNmTECR0_RATIO_PREQ GENMASK(25, 22) +#define LNmTECR0_SGN_POST1Q BIT(21) +#define LNmTECR0_RATIO_PST1Q GENMASK(20, 16) +#define LNmTECR0_ADPT_EQ GENMASK(13, 8) +#define LNmTECR0_AMP_RED GENMASK(5, 0) + +#define LNmTECR0_TEQ_TYPE_NONE 0b00 +#define LNmTECR0_TEQ_TYPE_POST 0b01 +#define LNmTECR0_TEQ_TYPE_BOTH 0b10 + +#define LNmTTLCR0_FLT_SEL GENMASK(29, 24) + +#define LS_SGMII_BASE 0x1800 +#define LS_QSGMII_BASE 0x1880 +#define LS_XFI_BASE 0x1980 + +#define PCS_STRIDE 0x10 +#define CR_STRIDE 0x4 +#define PCSa(a, base, cr) (base + (a) * PCS_STRIDE + (cr) * CR_STRIDE) + +#define PCSaCR1_MDEV_PORT GENMASK(31, 27) + +#define LS_SGMIIaCR1(a) PCSa(a, LS_SGMII_BASE, 1) +#define SGMIIaCR1_SGPCS_EN BIT(11) + +enum lynx_protocol { + LYNX_PROTO_NONE = 0, + LYNX_PROTO_SGMII, + LYNX_PROTO_SGMII25, /* Not tested */ + LYNX_PROTO_1000BASEKX, /* Not tested */ + LYNX_PROTO_QSGMII, /* Not tested */ + LYNX_PROTO_XFI, + LYNX_PROTO_10GKR, /* Link training unimplemented */ + LYNX_PROTO_LAST, +}; + +static const char lynx_proto_str[][16] = { + [LYNX_PROTO_NONE] = "unknown", + [LYNX_PROTO_SGMII] = "SGMII", + [LYNX_PROTO_SGMII25] = "2.5G SGMII", + [LYNX_PROTO_1000BASEKX] = "1000BASE-KX", + [LYNX_PROTO_QSGMII] = "QSGMII", + [LYNX_PROTO_XFI] = "XFI", + [LYNX_PROTO_10GKR] = "10GBASE-KR", +}; + +#define PROTO_MASK(proto) BIT(LYNX_PROTO_##proto) + +/** + * struct lynx_proto_params - Parameters for configuring a protocol + * @frate_khz: The PLL rate, in kHz + * @rat_sel: The divider to get the line rate + * @if20bit: Whether the proto is 20 bits or 10 bits + * @prots: Lane protocol select + * @reidl_th: Receiver electrical idle detection threshold + * @reidl_ex: Exit electrical idle filter + * @reidl_et: Enter idle filter + * @slew: Slew control + * @baseline_wander: Enable baseline wander correction + * @gain: Adaptive equalization gain override + * @offset_override: Adaptive equalization offset override + * @preq_ratio: Ratio of full swing transition bit to pre-cursor + * @postq_ratio: Ratio of full swing transition bit to first post-cursor. + * @adpt_eq: Transmitter Adjustments for 8G/10G + * @amp_red: Overall TX Amplitude Reduction + * @flt_sel: TTL configuration selector + */ +struct lynx_proto_params { + u32 frate_khz; + u8 rat_sel; + u8 prots; + u8 reidl_th; + u8 reidl_ex; + u8 reidl_et; + u8 slew; + u8 gain; + u8 baseline_wander; + u8 offset_override; + u8 preq_ratio; + u8 postq_ratio; + u8 adpt_eq; + u8 amp_red; + u8 flt_sel; + bool if20bit; +}; + +static const struct lynx_proto_params lynx_proto_params[] = { + [LYNX_PROTO_SGMII] = { + .frate_khz = 5000000, + .rat_sel = LNmGCR0_RAT_SEL_QUARTER, + .if20bit = false, + .prots = LNmGCR0_PROTS_SGMII, + .reidl_th = 0b001, + .reidl_ex = 0b011, + .reidl_et = 0b100, + .slew = 0b01, + .gain = 0b1111, + .offset_override = 0b0011111, + .adpt_eq = 0b110000, + .amp_red = 0b000110, + .flt_sel = 0b111001, + }, + [LYNX_PROTO_1000BASEKX] = { + .frate_khz = 5000000, + .rat_sel = LNmGCR0_RAT_SEL_QUARTER, + .if20bit = false, + .prots = LNmGCR0_PROTS_SGMII, + .slew = 0b01, + .gain = 0b1111, + .offset_override = 0b0011111, + .adpt_eq = 0b110000, + .flt_sel = 0b111001, + }, + [LYNX_PROTO_SGMII25] = { + .frate_khz = 3125000, + .rat_sel = LNmGCR0_RAT_SEL_SAME, + .if20bit = false, + .prots = LNmGCR0_PROTS_SGMII, + .slew = 0b10, + .offset_override = 0b0011111, + .postq_ratio = 0b00110, + .adpt_eq = 0b110000, + }, + [LYNX_PROTO_QSGMII] = { + .frate_khz = 5000000, + .rat_sel = LNmGCR0_RAT_SEL_SAME, + .if20bit = true, + .prots = LNmGCR0_PROTS_SGMII, + .slew = 0b01, + .offset_override = 0b0011111, + .postq_ratio = 0b00110, + .adpt_eq = 0b110000, + .amp_red = 0b000010, + }, + [LYNX_PROTO_XFI] = { + .frate_khz = 5156250, + .rat_sel = LNmGCR0_RAT_SEL_DOUBLE, + .if20bit = true, + .prots = LNmGCR0_PROTS_XFI, + .slew = 0b01, + .baseline_wander = LNmRECR0_BASE_WAND_DEFAULT, + .offset_override = 0b1011111, + .postq_ratio = 0b00011, + .adpt_eq = 0b110000, + .amp_red = 0b000111, + }, + [LYNX_PROTO_10GKR] = { + .frate_khz = 5156250, + .rat_sel = LNmGCR0_RAT_SEL_DOUBLE, + .if20bit = true, + .prots = LNmGCR0_PROTS_XFI, + .slew = 0b01, + .baseline_wander = LNmRECR0_BASE_WAND_DEFAULT, + .offset_override = 0b1011111, + .preq_ratio = 0b0011, + .postq_ratio = 0b01100, + .adpt_eq = 0b110000, + }, +}; + +/** + * struct lynx_mode - A single configuration of a protocol controller + * @protos: A bitmask of the &enum lynx_protocol this mode supports + * @pccr: The number of the PCCR which contains this mode + * @idx: The index of the protocol controller. For example, SGMIIB would have + * index 1. + * @cfg: The value to program into the controller to select this mode + * + * The serdes has multiple protocol controllers which can be each be selected + * independently. Depending on their configuration, they may use multiple lanes + * at once (e.g. AUI or PCIe x4). Additionally, multiple protocols may be + * supported by a single mode (XFI and 10GKR differ only in their protocol + * parameters). + */ +struct lynx_mode { + u16 protos; + u8 pccr; + u8 idx; + u8 cfg; +}; + +static_assert(LYNX_PROTO_LAST - 1 <= + sizeof_field(struct lynx_mode, protos) * BITS_PER_BYTE); + +struct lynx_priv; + +/** + * struct lynx_cfg - Configuration for a particular serdes + * @lanes: Number of lanes + * @endian: Endianness of the registers + * @mode_conflict: Determine whether a protocol controller is already in use + * (by another group). + * @mode_apply: Apply a given protocol. This includes programming the + * appropriate config into the PCCR, as well as enabling/disabling + * any other registers (such as the enabling MDIO access). + * %LYNX_PROTO_NONE may be used to clear any associated registers. + * @mode_init: Finish initializing a mode. All fields are filled in except for + * protos. Type is one of PHY_TYPE_*. mode->protos should be filled + * in, and the other fields should be sanity-checked. + */ +struct lynx_cfg { + unsigned int lanes; + enum regmap_endian endian; + bool (*mode_conflict)(struct lynx_priv *serdes, + const struct lynx_mode *mode); + void (*mode_apply)(struct lynx_priv *serdes, + const struct lynx_mode *mode, + enum lynx_protocol proto); + int (*mode_init)(struct lynx_priv *serdes, struct lynx_mode *mode, + int type); +}; + +/** + * struct lynx_priv - Driver data for the serdes + * @lock: A lock protecting "common" registers in @regmap, as well as the + * members of this struct. Lane-specific registers are protected by the + * phy's lock. PLL registers are protected by the clock's lock. + * @dev: The serdes device + * @regmap: The backing regmap + * @cfg: SoC-specific configuration + * @plls: The PLLs + * @ex_dlys: The "ex_dly" clocks + * @used_lanes: Bitmap of the lanes currently used by phys + */ +struct lynx_priv { + struct mutex lock; + struct device *dev; + struct regmap *regmap; + const struct lynx_cfg *cfg; + struct clk *plls[2], *ex_dlys[2]; + unsigned int used_lanes; +}; + +/** + * struct lynx_group - Driver data for a group of lanes + * @serdes: The parent serdes + * @pll: The currently-used pll + * @ex_dly: The ex_dly clock, if used + * @modes: Valid protocol controller configurations + * @mode_count: Number of modes in @modes + * @first_lane: The first lane in the group + * @last_lane: The last lane in the group + * @proto: The currently-configured protocol + * @prots: The protocol set up by the RCW + */ +struct lynx_group { + struct lynx_priv *serdes; + struct clk *pll, *ex_dly; + const struct lynx_mode *modes; + size_t mode_count; + unsigned int first_lane; + unsigned int last_lane; + enum lynx_protocol proto; + u8 prots; +}; + +static u32 lynx_read(struct lynx_priv *serdes, u32 reg) +{ + unsigned int ret = 0; + + WARN_ON_ONCE(regmap_read(serdes->regmap, reg, &ret)); + dev_vdbg(serdes->dev, "%.8x <= %.8x\n", ret, reg); + return ret; +} + +static void lynx_write(struct lynx_priv *serdes, u32 val, u32 reg) +{ + dev_vdbg(serdes->dev, "%.8x => %.8x\n", val, reg); + WARN_ON_ONCE(regmap_write(serdes->regmap, reg, val)); +} + +/** + * lynx_lane_bitmap() - Get a bitmap for a group of lanes + * @group: The group of lanes + * + * Return: A mask containing all bits between @group->first and @group->last + */ +static unsigned int lynx_lane_bitmap(struct lynx_group *group) +{ + if (group->first_lane > group->last_lane) + return GENMASK(group->first_lane, group->last_lane); + else + return GENMASK(group->last_lane, group->first_lane); +} + +static int lynx_init(struct phy *phy) +{ + int ret = 0; + struct lynx_group *group = phy_get_drvdata(phy); + struct lynx_priv *serdes = group->serdes; + unsigned int lane_mask = lynx_lane_bitmap(group); + + mutex_lock(&serdes->lock); + if (serdes->used_lanes & lane_mask) + ret = -EBUSY; + else + serdes->used_lanes |= lane_mask; + mutex_unlock(&serdes->lock); + return ret; +} + +static int lynx_exit(struct phy *phy) +{ + struct lynx_group *group = phy_get_drvdata(phy); + struct lynx_priv *serdes = group->serdes; + + clk_disable_unprepare(group->ex_dly); + group->ex_dly = NULL; + + clk_disable_unprepare(group->pll); + clk_rate_exclusive_put(group->pll); + group->pll = NULL; + + mutex_lock(&serdes->lock); + serdes->used_lanes &= ~lynx_lane_bitmap(group); + mutex_unlock(&serdes->lock); + return 0; +} + +/* + * This is tricky. If first_lane=1 and last_lane=0, the condition will see 2, + * 1, 0. But the loop body will see 1, 0. We do this to avoid underflow. We + * can't pull the same trick when incrementing, because then we might have to + * start at -1 if (e.g.) first_lane = 0. + */ +#define for_range(val, start, end) \ + for (val = start < end ? start : start + 1; \ + start < end ? val <= end : val-- > end; \ + start < end ? val++ : 0) +#define for_each_lane(lane, group) \ + for_range(lane, group->first_lane, group->last_lane) +#define for_each_lane_reverse(lane, group) \ + for_range(lane, group->last_lane, group->first_lane) + +static int lynx_power_on(struct phy *phy) +{ + int i; + struct lynx_group *group = phy_get_drvdata(phy); + u32 gcr0; + + for_each_lane(i, group) { + gcr0 = lynx_read(group->serdes, LNmGCR0(i)); + gcr0 &= ~(LNmGCR0_RX_PD | LNmGCR0_TX_PD); + lynx_write(group->serdes, gcr0, LNmGCR0(i)); + + usleep_range(15, 30); + gcr0 |= LNmGCR0_RRST_B | LNmGCR0_TRST_B; + lynx_write(group->serdes, gcr0, LNmGCR0(i)); + } + + return 0; +} + +static void lynx_power_off_group(struct lynx_group *group) +{ + int i; + + for_each_lane_reverse(i, group) { + u32 gcr0 = lynx_read(group->serdes, LNmGCR0(i)); + + gcr0 |= LNmGCR0_RX_PD | LNmGCR0_TX_PD; + gcr0 &= ~(LNmGCR0_RRST_B | LNmGCR0_TRST_B); + lynx_write(group->serdes, gcr0, LNmGCR0(i)); + } +} + +static int lynx_power_off(struct phy *phy) +{ + lynx_power_off_group(phy_get_drvdata(phy)); + return 0; +} + +/** + * lynx_lookup_proto() - Convert a phy-subsystem mode to a protocol + * @mode: The mode to convert + * @submode: The submode of @mode + * + * Return: A corresponding serdes-specific mode + */ +static enum lynx_protocol lynx_lookup_proto(enum phy_mode mode, int submode) +{ + switch (mode) { + case PHY_MODE_ETHERNET: + switch (submode) { + case PHY_INTERFACE_MODE_SGMII: + case PHY_INTERFACE_MODE_1000BASEX: + return LYNX_PROTO_SGMII; + case PHY_INTERFACE_MODE_2500BASEX: + return LYNX_PROTO_SGMII25; + case PHY_INTERFACE_MODE_QSGMII: + return LYNX_PROTO_QSGMII; + case PHY_INTERFACE_MODE_XGMII: + case PHY_INTERFACE_MODE_10GBASER: + return LYNX_PROTO_XFI; + case PHY_INTERFACE_MODE_10GKR: + return LYNX_PROTO_10GKR; + default: + return LYNX_PROTO_NONE; + } + default: + return LYNX_PROTO_NONE; + } +} + +/** + * lynx_lookup_mode() - Get the mode for a group/protocol combination + * @group: The group of lanes to use + * @proto: The protocol to use + * + * Return: An appropriate mode to use, or %NULL if none match. + */ +static const struct lynx_mode *lynx_lookup_mode(struct lynx_group *group, + enum lynx_protocol proto) +{ + int i; + + for (i = 0; i < group->mode_count; i++) { + const struct lynx_mode *mode = &group->modes[i]; + + if (BIT(proto) & mode->protos) + return mode; + } + + return NULL; +} + +static int lynx_validate(struct phy *phy, enum phy_mode phy_mode, int submode, + union phy_configure_opts *opts) +{ + enum lynx_protocol proto; + struct lynx_group *group = phy_get_drvdata(phy); + const struct lynx_mode *mode; + + proto = lynx_lookup_proto(phy_mode, submode); + if (proto == LYNX_PROTO_NONE) + return -EINVAL; + + /* Nothing to do */ + if (proto == group->proto) + return 0; + + /* + * FIXME: At the moment we don't support switching between major + * protocols. From what I can tell, the serdes is working fine, but + * something goes wrong in the PCS. + */ + if (lynx_proto_params[proto].prots != group->prots) + return -EINVAL; + + mode = lynx_lookup_mode(group, proto); + if (!mode) + return -EINVAL; + + return 0; +} + +#define abs_diff(a, b) ({ \ + typeof(a) _a = (a); \ + typeof(b) _b = (b); \ + _a > _b ? _a - _b : _b - _a; \ +}) + +static int lynx_set_mode(struct phy *phy, enum phy_mode phy_mode, int submode) +{ + enum lynx_protocol proto; + const struct lynx_proto_params *params; + const struct lynx_mode *old_mode = NULL, *new_mode; + int i, pll, ret; + struct lynx_group *group = phy_get_drvdata(phy); + struct lynx_priv *serdes = group->serdes; + u32 tmp, teq; + u32 gcr0 = 0, gcr1 = 0, recr0 = 0, tecr0 = 0; + u32 gcr0_mask = 0, gcr1_mask = 0, recr0_mask = 0, tecr0_mask = 0; + + proto = lynx_lookup_proto(phy_mode, submode); + if (proto == LYNX_PROTO_NONE) { + dev_dbg(&phy->dev, "unknown mode/submode %d/%d\n", + phy_mode, submode); + return -EINVAL; + } + + /* Nothing to do */ + if (proto == group->proto) + return 0; + + new_mode = lynx_lookup_mode(group, proto); + if (!new_mode) { + dev_dbg(&phy->dev, "could not find mode for %s on lanes %u to %u\n", + lynx_proto_str[proto], group->first_lane, + group->last_lane); + return -EINVAL; + } + + if (group->proto != LYNX_PROTO_NONE) { + old_mode = lynx_lookup_mode(group, group->proto); + if (!old_mode) { + dev_err(&phy->dev, "could not find mode for %s\n", + lynx_proto_str[group->proto]); + return -EBUSY; + } + } + + mutex_lock(&serdes->lock); + if (serdes->cfg->mode_conflict(serdes, new_mode)) { + dev_dbg(&phy->dev, "%s%c already in use\n", + lynx_proto_str[__ffs(new_mode->protos)], + 'A' + new_mode->idx); + ret = -EBUSY; + goto out; + } + + clk_disable_unprepare(group->ex_dly); + group->ex_dly = NULL; + + clk_disable_unprepare(group->pll); + clk_rate_exclusive_put(group->pll); + group->pll = NULL; + + /* First, try to use a PLL which already has the correct rate */ + params = &lynx_proto_params[proto]; + for (pll = 0; pll < ARRAY_SIZE(serdes->plls); pll++) { + struct clk *clk = serdes->plls[pll]; + unsigned long rate = clk_get_rate(clk); + unsigned long error = abs_diff(rate, params->frate_khz); + + dev_dbg(&phy->dev, "pll%d has rate %lu (error=%lu)\n", pll, + rate, error); + /* Accept up to 100ppm deviation */ + if (error && params->frate_khz / error < 10000) + continue; + + if (!clk_set_rate_exclusive(clk, rate)) + goto got_pll; + /* + * Someone else got a different rate first (or there was some + * other error) + */ + } + + /* If neither PLL has the right rate, try setting it */ + for (pll = 0; pll < 2; pll++) { + ret = clk_set_rate_exclusive(serdes->plls[pll], + params->frate_khz); + if (!ret) + goto got_pll; + } + + dev_dbg(&phy->dev, "could not get a pll at %ukHz\n", + params->frate_khz); + goto out; + +got_pll: + group->pll = serdes->plls[pll]; + ret = clk_prepare_enable(group->pll); + if (ret) + goto out; + + gcr0_mask |= LNmGCR0_RRAT_SEL | LNmGCR0_TRAT_SEL; + gcr0_mask |= LNmGCR0_RPLL_LES | LNmGCR0_TPLL_LES; + gcr0_mask |= LNmGCR0_RRST_B | LNmGCR0_TRST_B; + gcr0_mask |= LNmGCR0_RX_PD | LNmGCR0_TX_PD; + gcr0_mask |= LNmGCR0_IF20BIT_EN | LNmGCR0_PROTS; + gcr0 |= FIELD_PREP(LNmGCR0_RPLL_LES, !pll); + gcr0 |= FIELD_PREP(LNmGCR0_TPLL_LES, !pll); + gcr0 |= FIELD_PREP(LNmGCR0_RRAT_SEL, params->rat_sel); + gcr0 |= FIELD_PREP(LNmGCR0_TRAT_SEL, params->rat_sel); + gcr0 |= FIELD_PREP(LNmGCR0_IF20BIT_EN, params->if20bit); + gcr0 |= FIELD_PREP(LNmGCR0_PROTS, params->prots); + + gcr1_mask |= LNmGCR1_RDAT_INV | LNmGCR1_TDAT_INV; + gcr1_mask |= LNmGCR1_OPAD_CTL | LNmGCR1_REIDL_TH; + gcr1_mask |= LNmGCR1_REIDL_EX_SEL | LNmGCR1_REIDL_ET_SEL; + gcr1_mask |= LNmGCR1_REIDL_EX_MSB | LNmGCR1_REIDL_ET_MSB; + gcr1_mask |= LNmGCR1_REQ_CTL_SNP | LNmGCR1_REQ_CDR_SNP; + gcr1_mask |= LNmGCR1_TRSTDIR | LNmGCR1_REQ_BIN_SNP; + gcr1_mask |= LNmGCR1_ISLEW_RCTL | LNmGCR1_OSLEW_RCTL; + gcr1 |= FIELD_PREP(LNmGCR1_REIDL_TH, params->reidl_th); + gcr1 |= FIELD_PREP(LNmGCR1_REIDL_EX_SEL, params->reidl_ex & 3); + gcr1 |= FIELD_PREP(LNmGCR1_REIDL_ET_SEL, params->reidl_et & 3); + gcr1 |= FIELD_PREP(LNmGCR1_REIDL_EX_MSB, params->reidl_ex >> 2); + gcr1 |= FIELD_PREP(LNmGCR1_REIDL_ET_MSB, params->reidl_et >> 2); + gcr1 |= FIELD_PREP(LNmGCR1_TRSTDIR, + group->first_lane > group->last_lane); + gcr1 |= FIELD_PREP(LNmGCR1_ISLEW_RCTL, params->slew); + gcr1 |= FIELD_PREP(LNmGCR1_OSLEW_RCTL, params->slew); + + recr0_mask |= LNmRECR0_RXEQ_BST | LNmRECR0_BASE_WAND; + recr0_mask |= LNmRECR0_GK2OVD | LNmRECR0_GK3OVD; + recr0_mask |= LNmRECR0_GK2OVD_EN | LNmRECR0_GK3OVD_EN; + recr0_mask |= LNmRECR0_OSETOVD_EN | LNmRECR0_OSETOVD; + if (params->gain) { + recr0 |= FIELD_PREP(LNmRECR0_GK2OVD, params->gain); + recr0 |= FIELD_PREP(LNmRECR0_GK3OVD, params->gain); + recr0 |= LNmRECR0_GK2OVD_EN | LNmRECR0_GK3OVD_EN; + } + recr0 |= FIELD_PREP(LNmRECR0_BASE_WAND, params->baseline_wander); + recr0 |= FIELD_PREP(LNmRECR0_OSETOVD, params->offset_override); + + tecr0_mask |= LNmTECR0_TEQ_TYPE; + tecr0_mask |= LNmTECR0_SGN_PREQ | LNmTECR0_RATIO_PREQ; + tecr0_mask |= LNmTECR0_SGN_POST1Q | LNmTECR0_RATIO_PST1Q; + tecr0_mask |= LNmTECR0_ADPT_EQ | LNmTECR0_AMP_RED; + teq = LNmTECR0_TEQ_TYPE_NONE; + if (params->postq_ratio) { + teq = LNmTECR0_TEQ_TYPE_POST; + tecr0 |= FIELD_PREP(LNmTECR0_SGN_POST1Q, 1); + tecr0 |= FIELD_PREP(LNmTECR0_RATIO_PST1Q, params->postq_ratio); + } + if (params->preq_ratio) { + teq = LNmTECR0_TEQ_TYPE_BOTH; + tecr0 |= FIELD_PREP(LNmTECR0_SGN_PREQ, 1); + tecr0 |= FIELD_PREP(LNmTECR0_RATIO_PREQ, params->preq_ratio); + } + tecr0 |= FIELD_PREP(LNmTECR0_TEQ_TYPE, teq); + tecr0 |= FIELD_PREP(LNmTECR0_ADPT_EQ, params->adpt_eq); + tecr0 |= FIELD_PREP(LNmTECR0_AMP_RED, params->amp_red); + + for_each_lane(i, group) { + tmp = lynx_read(serdes, LNmGCR0(i)); + tmp &= ~(LNmGCR0_RRST_B | LNmGCR0_TRST_B); + lynx_write(serdes, tmp, LNmGCR0(i)); + } + + ndelay(50); + + /* Disable the old controller */ + if (old_mode) + serdes->cfg->mode_apply(serdes, old_mode, LYNX_PROTO_NONE); + + for_each_lane(i, group) { + tmp = lynx_read(serdes, LNmGCR0(i)); + tmp &= ~gcr0_mask; + tmp |= gcr0; + tmp |= FIELD_PREP(LNmGCR0_FIRST_LANE, i == group->first_lane); + lynx_write(serdes, tmp, LNmGCR0(i)); + + tmp = lynx_read(serdes, LNmGCR1(i)); + tmp &= ~gcr1_mask; + tmp |= gcr1; + lynx_write(serdes, tmp, LNmGCR1(i)); + + tmp = lynx_read(serdes, LNmRECR0(i)); + tmp &= ~recr0_mask; + tmp |= recr0; + lynx_write(serdes, tmp, LNmRECR0(i)); + + tmp = lynx_read(serdes, LNmTECR0(i)); + tmp &= ~tecr0_mask; + tmp |= tecr0; + lynx_write(serdes, tmp, LNmTECR0(i)); + + tmp = lynx_read(serdes, LNmTTLCR0(i)); + tmp &= ~LNmTTLCR0_FLT_SEL; + tmp |= FIELD_PREP(LNmTTLCR0_FLT_SEL, params->flt_sel); + lynx_write(serdes, tmp, LNmTTLCR0(i)); + } + + ndelay(120); + + for_each_lane_reverse(i, group) { + tmp = lynx_read(serdes, LNmGCR0(i)); + tmp |= LNmGCR0_RRST_B | LNmGCR0_TRST_B; + lynx_write(serdes, tmp, LNmGCR0(i)); + } + + /* Enable the new controller */ + serdes->cfg->mode_apply(serdes, new_mode, proto); + if (proto == LYNX_PROTO_1000BASEKX) { + group->ex_dly = serdes->ex_dlys[pll]; + /* This should never fail since it's from our internal driver */ + WARN_ON_ONCE(clk_prepare_enable(group->ex_dly)); + } + group->proto = proto; + + dev_dbg(&phy->dev, "set mode to %s on lanes %u to %u\n", + lynx_proto_str[proto], group->first_lane, group->last_lane); + +out: + mutex_unlock(&serdes->lock); + return ret; +} + +static const struct phy_ops lynx_phy_ops = { + .init = lynx_init, + .exit = lynx_exit, + .power_on = lynx_power_on, + .power_off = lynx_power_off, + .set_mode = lynx_set_mode, + .validate = lynx_validate, + .owner = THIS_MODULE, +}; + +static int lynx_read_u32(struct device *dev, struct fwnode_handle *fwnode, + const char *prop, u32 *val) +{ + int ret; + + ret = fwnode_property_read_u32(fwnode, prop, val); + if (ret) + dev_err(dev, "could not read %s from %pfwP: %d\n", prop, + fwnode, ret); + return ret; +} + +static int lynx_probe_group(struct lynx_priv *serdes, + struct fwnode_handle *fwnode) +{ + int i, lane_count, ret; + struct device *dev = serdes->dev; + struct fwnode_handle *mode_node; + struct lynx_group *group; + struct lynx_mode *modes; + struct phy *phy; + u32 *lanes = NULL; + + group = devm_kzalloc(dev, sizeof(*group), GFP_KERNEL); + if (!group) + return -ENOMEM; + group->serdes = serdes; + + lane_count = fwnode_property_count_u32(fwnode, "reg"); + if (lane_count < 0) { + dev_err(dev, "could not read %s from %pfwP: %d\n", + "reg", fwnode, ret); + return lane_count; + } + + lanes = kcalloc(lane_count, sizeof(*lanes), GFP_KERNEL); + if (!lanes) + return -ENOMEM; + + ret = fwnode_property_read_u32_array(fwnode, "reg", lanes, lane_count); + if (ret) { + dev_err(dev, "could not read %s from %pfwP: %d\n", + "reg", fwnode, ret); + goto out; + } + + group->first_lane = lanes[0]; + group->last_lane = lanes[lane_count - 1]; + for (i = 0; i < lane_count; i++) { + u32 prots, gcr0; + + if (lanes[i] > serdes->cfg->lanes) { + ret = -EINVAL; + dev_err(dev, "lane %d not in range 0 to %u\n", + i, serdes->cfg->lanes); + goto out; + } + + if (lanes[i] != group->first_lane + + i * !!(group->last_lane - group->first_lane)) { + ret = -EINVAL; + dev_err(dev, "lane %d is not monotonic\n", i); + goto out; + } + + gcr0 = lynx_read(serdes, LNmGCR0(lanes[i])); + prots = FIELD_GET(LNmGCR0_PROTS, gcr0); + if (i && group->prots != prots) { + ret = -EIO; + dev_err(dev, "lane %d protocol does not match lane 0\n", + lanes[i]); + goto out; + } + group->prots = prots; + } + + fwnode_for_each_child_node(fwnode, mode_node) + group->mode_count++; + + modes = devm_kcalloc(dev, group->mode_count, sizeof(*group->modes), + GFP_KERNEL); + if (!modes) { + ret = -ENOMEM; + goto out; + } + + i = 0; + fwnode_for_each_child_node(fwnode, mode_node) { + struct lynx_mode *mode = &modes[i++]; + u32 val; + + ret = lynx_read_u32(dev, mode_node, "fsl,pccr", &val); + if (ret) + goto out; + mode->pccr = val; + + ret = lynx_read_u32(dev, mode_node, "fsl,index", &val); + if (ret) + goto out; + mode->idx = val; + + ret = lynx_read_u32(dev, mode_node, "fsl,cfg", &val); + if (ret) + goto out; + mode->cfg = val; + + ret = lynx_read_u32(dev, mode_node, "phy-type", &val); + if (ret) + goto out; + + ret = serdes->cfg->mode_init(serdes, mode, val); + if (ret) + goto out; + + dev_dbg(dev, "mode PCCR%X.%s%c_CFG=%x on lanes %u to %u\n", + mode->pccr, lynx_proto_str[__ffs(mode->protos)], + 'A' + mode->idx, mode->cfg, group->first_lane, + group->last_lane); + } + + WARN_ON(i != group->mode_count); + group->modes = modes; + + /* Deselect anything configured by the RCW/bootloader */ + for (i = 0; i < group->mode_count; i++) + serdes->cfg->mode_apply(serdes, &group->modes[i], + LYNX_PROTO_NONE); + + /* Disable the lanes for now */ + lynx_power_off_group(group); + + phy = devm_phy_create(dev, to_of_node(fwnode), &lynx_phy_ops); + ret = PTR_ERR_OR_ZERO(phy); + if (ret) + dev_err_probe(dev, ret, "could not create phy\n"); + else + phy_set_drvdata(phy, group); + +out: + kfree(lanes); + return ret; +} + +static int lynx_probe(struct platform_device *pdev) +{ + int ret; + struct device *dev = &pdev->dev; + struct fwnode_handle *group_node; + struct lynx_priv *serdes; + struct phy_provider *provider; + struct regmap_config regmap_config = { + .reg_bits = 32, + .reg_stride = 4, + .val_bits = 32, + .disable_locking = true, + }; + struct resource *res; + void __iomem *base; + + serdes = devm_kzalloc(dev, sizeof(*serdes), GFP_KERNEL); + if (!serdes) + return -ENOMEM; + + serdes->dev = dev; + platform_set_drvdata(pdev, serdes); + mutex_init(&serdes->lock); + serdes->cfg = device_get_match_data(dev); + + base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); + if (IS_ERR(base)) { + ret = PTR_ERR(base); + dev_err_probe(dev, ret, "could not get/map registers\n"); + return ret; + } + + regmap_config.val_format_endian = serdes->cfg->endian; + regmap_config.max_register = res->end - res->start; + serdes->regmap = devm_regmap_init_mmio(dev, base, ®map_config); + if (IS_ERR(serdes->regmap)) { + ret = PTR_ERR(serdes->regmap); + dev_err_probe(dev, ret, "could not create regmap\n"); + return ret; + } + + ret = lynx_clks_init(dev, serdes->regmap, serdes->plls, + serdes->ex_dlys); + if (ret) + return ret; + + device_for_each_child_node(dev, group_node) { + ret = lynx_probe_group(serdes, group_node); + if (ret) + return ret; + } + + provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); + ret = PTR_ERR_OR_ZERO(provider); + if (ret) + dev_err_probe(dev, ret, "could not register phy provider\n"); + else + dev_info(dev, "probed with %d lanes\n", serdes->cfg->lanes); + return ret; +} + +/* + * These are common helpers for the PCCRs found on (most) Layerscape SoCs. + * There is an earlier layout used on most T-series SoCs, as well as the + * LS1020A/21A/22A. + */ + +static int lynx_ls_pccr_params(const struct lynx_mode *mode, u32 *off, + u32 *shift, u32 *mask) +{ + if (mode->protos & PROTO_MASK(SGMII)) { + *off = LS_PCCRa(0x8); + *mask = PCCR8_SGMIIa_MASK; + *shift = PCCR8_SGMIIa_SHIFT(mode->idx); + } else if (mode->protos & PROTO_MASK(QSGMII)) { + *off = LS_PCCRa(0x9); + *mask = PCCR9_QSGMIIa_MASK; + *shift = PCCR9_QSGMIIa_SHIFT(mode->idx); + } else if (mode->protos & PROTO_MASK(XFI)) { + *off = LS_PCCRa(0xB); + *mask = PCCRB_XFIa_MASK; + *shift = PCCRB_XFIa_SHIFT(mode->idx); + } else { + return -EINVAL; + } + + return 0; +} + +static bool lynx_ls_mode_conflict(struct lynx_priv *serdes, + const struct lynx_mode *mode) +{ + u32 off, shift, mask; + + if (WARN_ON_ONCE(lynx_ls_pccr_params(mode, &off, &shift, &mask))) + return true; + + return (lynx_read(serdes, off) >> shift) & mask; +} + +static void lynx_ls_mode_apply(struct lynx_priv *serdes, + const struct lynx_mode *mode, + enum lynx_protocol proto) +{ + u32 pccr, off, shift, mask; + + if (WARN_ON_ONCE(proto != LYNX_PROTO_NONE && + !(mode->protos & BIT(proto)))) + return; + if (WARN_ON_ONCE(lynx_ls_pccr_params(mode, &off, &shift, &mask))) + return; + + dev_dbg(serdes->dev, "applying %s to PCCR%X.%s%c_CFG\n", + lynx_proto_str[proto], mode->pccr, + lynx_proto_str[__ffs(mode->protos)], 'A' + mode->idx); + + pccr = lynx_read(serdes, off); + pccr &= ~(mask << shift); + if (proto != LYNX_PROTO_NONE) + pccr |= mode->cfg << shift; + + if (proto == LYNX_PROTO_1000BASEKX) + pccr |= PCCR8_SGMIIa_KX << shift; + lynx_write(serdes, pccr, off); + + if (mode->protos & PROTO_MASK(SGMII)) { + u32 cr1 = lynx_read(serdes, LS_SGMIIaCR1(mode->idx)); + + cr1 &= ~SGMIIaCR1_SGPCS_EN; + cr1 |= proto == LYNX_PROTO_NONE ? 0 : SGMIIaCR1_SGPCS_EN; + lynx_write(serdes, cr1, LS_SGMIIaCR1(mode->idx)); + } +} + +static int lynx_ls_mode_init(struct lynx_priv *serdes, struct lynx_mode *mode, + int type) +{ + u32 max = 0, off, shift, mask; + + if (mode->pccr >= 0x10) { + dev_err(serdes->dev, "PCCR index %u too large\n", mode->pccr); + return -EINVAL; + } + + switch (type) { + case PHY_TYPE_2500BASEX: + mode->protos = PROTO_MASK(SGMII25); + fallthrough; + case PHY_TYPE_SGMII: + max = 8; + mode->protos |= PROTO_MASK(SGMII) | PROTO_MASK(1000BASEKX); + break; + case PHY_TYPE_QSGMII: + max = 4; + mode->protos = PROTO_MASK(QSGMII); + break; + case PHY_TYPE_10GBASER: + max = 8; + mode->protos = PROTO_MASK(XFI) | PROTO_MASK(10GKR); + break; + default: + dev_err(serdes->dev, "unknown mode type %d\n", type); + return -EINVAL; + } + + if (mode->idx >= max) { + dev_err(serdes->dev, "%s index %u too large\n", + lynx_proto_str[__ffs(mode->protos)], mode->idx); + return -EINVAL; + } + + if (WARN_ON_ONCE(lynx_ls_pccr_params(mode, &off, &shift, &mask))) + return -EINVAL; + + if (!mode->cfg || mode->cfg & ~mask) { + dev_err(serdes->dev, "bad value %x for %s%c_CFG\n", + mode->cfg, lynx_proto_str[__ffs(mode->protos)], + 'A' + mode->idx); + return -EINVAL; + } + + return 0; +} + +static const struct lynx_cfg ls1046a_cfg = { + .lanes = 4, + .endian = REGMAP_ENDIAN_BIG, + .mode_conflict = lynx_ls_mode_conflict, + .mode_apply = lynx_ls_mode_apply, + .mode_init = lynx_ls_mode_init, +}; + +static const struct lynx_cfg ls1088a_cfg = { + .lanes = 4, + .endian = REGMAP_ENDIAN_LITTLE, + .mode_conflict = lynx_ls_mode_conflict, + .mode_apply = lynx_ls_mode_apply, + .mode_init = lynx_ls_mode_init, +}; + +static const struct of_device_id lynx_of_match[] = { + { .compatible = "fsl,ls1046a-serdes", .data = &ls1046a_cfg }, + { .compatible = "fsl,ls1088a-serdes", .data = &ls1088a_cfg }, + { }, +}; +MODULE_DEVICE_TABLE(of, lynx_of_match); + +static struct platform_driver lynx_driver = { + .probe = lynx_probe, + .driver = { + .name = "lynx_10g", + .of_match_table = lynx_of_match, + }, +}; +module_platform_driver(lynx_driver); + +MODULE_AUTHOR("Sean Anderson "); +MODULE_DESCRIPTION("Lynx 10G SerDes driver"); +MODULE_LICENSE("GPL"); From patchwork Thu Oct 27 19:11:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13022598 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 D0FC4ECAAA1 for ; Thu, 27 Oct 2022 19:13:59 +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=8Kh4sPaPJoRRsvW5y48Rs0Gu6xn6G8JTI1IbyQngwho=; b=0nygSnbqmaSnDm 9lnCgN6ZEH3h7BIxIv2zFpWsnGLTVYn128dbBqt7hxJLprjgctHeFK3zuXc7MOha+MTNc4MdS5yzZ Nvor57ukDZBQPwH1urbRMreG6G9pKyxC6PaR4XZXxejAtQH/4u4J6HPx4IhhUSL76TVmiNBfvQV97 jgu7RzrFx6fhD+NtVp9+aPuj3f1cgT6cJZ8pYE8QlA6UCn1WswXwKg2mDu6JfMGvO0vxxVQQCM3QX FIpwgxqUqR+pcbhTdYwM2uVXHAuRHAouv+GAyYauri43Y6rhexki8pHC0W0Co1BAubrqPqPcEEo41 sgSgvcVuuEH+jXQZip5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8KE-00Ec3a-Rk; Thu, 27 Oct 2022 19:13:58 +0000 Received: from mail-vi1eur05on2084.outbound.protection.outlook.com ([40.107.21.84] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8IF-00EbFa-2j; Thu, 27 Oct 2022 19:11:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qvsv75ZN/fRpReQ3TmNCztxMllEfQBHmFNTlZtU/5295Ln8jZmNA0z1seCeirtiHXJmnU+7F8lvq7YE8+J+57m85ZFTig7gcO2NyHHiE6Tei2l/ZyM1bxbMrKuE6z8KH87hGc2PIHGUts8HF/yjDJBqHHWcmYHotzd0PQlErRWkVlJhyeNI6vZMSuuTbTx03CQSJBN9wqKIQKCSyQvab30Z8PE1swjcDAd1BE6RGNArdE2ZikxsWtmVUqV7ERY3bNTiwoxjRkAitfTimrcRCuF3EKZLN+sqlxVxdU52pg1gVNOOpLxK5PHhgmVszosJwWU59Q169I1CjFNUALS1jwg== 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=Nqu94qYNvf9w4pfsAbSJlc3AqtD97kwBepOGm9ixucs=; b=OcF0WUclUCiVPMNJ/KliTjBlQgHp177YnfRa1IbrEkwUMC74q96ZWAmqxPOIee0G193JehaBOGuqMss+Tpds+y/zIlGbBHYpcVnoIwkMB4fTF5ZA3qG65PSJZxeTobIaK59SyN12IG5N2rvdbA5xbt3y/lJfoVRc8Hu7jL1l+TnF4B0OQhuUgqoaQDV+M4Bje5MW/AvbV1SAT22jM1Q65UZ97FSGQuY/fxBkihLFMF7SypK/zzMfQJ1By0xuOKl0OxQoC0/xJoLF3L8IxrBCyfILG6mwSHmJ/z5NJjmtD/xbNT63dWY//qwCoWdCBv8CxnSThe3X2eVXVfBvyB/SSw== 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=Nqu94qYNvf9w4pfsAbSJlc3AqtD97kwBepOGm9ixucs=; b=yy4aPtiQ3ar4rY7u7JZDohnKMvI2VSzlUf/6ioBaviflIueOXRba/+EdM5UAgQDUhkeR58NUaNweLe61j1XpCaVqlSv5NR/6oeSVBhWYz+OzNz+wOgdCK4AvUCWcgXWazUWwzWOl2Bpst8hFtJuUcuKBNZcvjp5lh3+NgV9ITY7MqXmaVJ2P2/uvbTc7fBWEffP8AnrgpryhKaEQmC7dPw56NC8w+UBENi0kmOx200il+r0BJnnSt9VafhSfALq8V8Y0YxLVkQMh2nwPGMYkgpHdZ7fjDdxclFYWFvYkGoRNZXNEQMP8zb+bpoThGKLFkE7IbeZLv9uhxdxEcRu8aw== 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:40 +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:40 +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 5/9] arm64: dts: ls1046a: Add serdes bindings Date: Thu, 27 Oct 2022 15:11:09 -0400 Message-Id: <20221027191113.403712-6-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: 2276313a-cecc-4770-1c80-08dab84f1394 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Uhs5k7dGt8wUhlE1r0PUM3TLcqp3r2PjG2T9Cas9o+Hr4dB9xuLkQwf83Wv0+qg/Y1praP1jx7eQStxj2FJ9xTz5zhGP+SMR731qzNrBzbjK7oJBmVGHWL+q2CiiiY39QhoDyw9+0eaXsNnspOWU3hcmTn6J1H13Qy2ShBVQEnS66ZR/qAeShJNegY6ZJRjsZLWTXC7IXLKLk0m0nWIKVeVLPChzaReCaLckCCd4MHr11DGWwaLwLgOmILa6/7NdntyxLNrzkGnkbmSDwpdn0fLwsJR64P1af0e1kKNs7vJI3IXMjEgWYwYMa/So3RonSb2iykspgJv9eNbWwlEacCz32CcH3M1mM4gfPn/2c97nt4s0UwSndkwuZHd+TtXNlo1cfskDwNRSm8lvQ227v44NRasFLv2hOyT/AQt77Mfdz/oEA5oT6lEcsmYipBnNts7X0kRPzTRQO6rpKQNKDCZxF2Mj/wVFGajs6FEjN9DnyyXexTmsjQG5MvchA4IzBzGfxjYHMLXV0g7H8RYkDQwKKxjVwjQm7sbuz8bzTPj3X+SthioCClOSpwdBu/ZGonLwdAedZ05loV8aBUi/ammF6OYCDOP+BtetzLzVpdpo+IC3o2KX0yND3vTYHH9S+4KZ7mzitdilsnaxXHhQ6XgmEkKabVqGcX0zxGngIr5jAn53yONQTsN4ozLp8KKb7/sxeZSHYJhGHAE4aeLflWEaEaqzvHzoMR4uaU+JupV37GQRw/jQAesoOykv5shh 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)(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);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7GSwFOeN29wnZRH2eQD6d3CJCXhuOZEUA7mmYwdBfBNikyKus4YyWSR3anaV/S8w8cV2Rc6M6lwSEqCQQl3p96ypzP+ghnxXcntEDczvEmFEXhu5BfvMBBuJ/rIU/Q5LBBckxl3PgyaTWXbQjOYBdYwk7sTKPuUqRhvDE6Kp4phGlxcAKm8qP64RVX11pE2mrTkmo91QD8+S0FhJ4cZljHadHk0Iwo+wdyy3nITtSqVZFzmOKvVNwxajOBpiCfEznTLV3pHaKXEY6BLLo25p2o20o69emu17Pyiw7mMOUWJN/inPGgjghRczz0b3mFXW3c/4LA/Va8XLijbUIVaWRRTouXIz+Aj8L8aklxLx99gjDSLwRUJbRzkg7j6FGqGqBY59SsPcSwYJZJ6HHNiuPWW+C4/BnfcEMnocjc7C4JI//uSvMdj84Mvn65YyvR32DmK5G74ZASJyEwdMeXZau+4/3gcUaHQAv8xuycSYYL5hGH6etOVt7VGt0UYi73qLYP9jol+5JfZwnod0RH+bgWYO1np+EKBdO3kzi7z8jJm+Jw9sMvvfMouPwiYEcqWR/PSyqHXCe1WfMi82T8gq/3MGus334Jee86pFCh9dFRmnBCKM0qsxX+jodSsXEasiqFcNFzTg+SKXbdPc56EqtTHDr6AUx8m5I8lkJPnf97y2C4mV5oF1FABToZzF9T6TCSZ8SiaD29Q+pdMAGxa7snfh9wZL/26TfMz5CO1rzpsbQsPZCz/5ATeN1MTCAwfrS4VIiaein64RGKfnwSEjouG0E11g3dZRPNl3AM/zZZDH1iRllf1FygsZuXVx/LT5fWGrRWijtxaa+MiZiPgTpngkXf2OR+ej2JXzd4jowWWv0kSP0B1xSLl572NB3Nc920H/3se6aFZgAWSWf1q1wmcuxNSbCvISJgdzyp058d26jrDx7aVsSeu9sYqTnB6pPHf7WM6VhgI8E37A7ynS6fGrHarPkyOQcxt8chCm9Qli9FkLfH0rWvLYG2laiUdTfYx6n4P5qItBR3NfHJXiEmn4vhbrxSDR299C2XTFELqfWoaBRKoET/zN792C06EX2+Ljdliwa2WymEqRl8ceebIB3Mi1NLxOeiW2KTdC1E29hAPqI5vJ//itRwD+/jUZUW65Y6Q+v8m2tZNLim1aaKyD2BRrHpSF9hoX0lUtf4E/SOsBGwUyH4TYVxUzYgVMscENoTXJs77dOKohhWaHEHAVxS2vGM9smmrR5uZOzuikXfBEKbej/8MGKi8B1OoUsIjdqmvTeQD4cUYzZgCrGJrtwa+R8Q2py3Rh8xvClgw3npCKy/4nPvEv/g/okSwmS3RJhsCQ9Q4w1om6VUqb07XkjNBjzR+m7SPzRTO/rYXlxRLJ1NCEj49/AEyVHoU9l/G69q5VHx27C2mJTZzYMC6jQsa1mIjAVxZDpKu18vRTsFpvtyYFDyiFvdfXh2APxcLAKfAT11wyHfH+G9HqvGQTnas335ovRoV/m/Yzk0TEXUuO2g3d1P5BLbD56VN66Pw4HSM7la7fu82WzRn6Gs/VefTz53Wsmwuf5q2A2u+8peZSJ1kn+443pjez/+d/21ldDrC4snKUZll3CqzZDw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2276313a-cecc-4770-1c80-08dab84f1394 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:40.0966 (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: 8CflItTMhAQrV8E/lFsLXNEq7WlEKjhvLvM7sNAOpyQdiJeUxDdFTycQ/AOp7Nc37NTJNx5oOMD/2QCiDuWNwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9648 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221027_121155_147528_611F16B1 X-CRM114-Status: UNSURE ( 8.04 ) X-CRM114-Notice: Please train this message. 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 bindings for the SerDes devices. They are disabled by default to prevent any breakage on existing boards. Signed-off-by: Sean Anderson --- (no changes since v4) Changes in v4: - Convert to new bindings Changes in v3: - Describe modes in device tree Changes in v2: - Use one phy cell for SerDes1, since no lanes can be grouped - Disable SerDes by default to prevent breaking boards inadvertently. arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi index 3d9e29824bb2..8f986b4f5efc 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi @@ -423,6 +423,24 @@ sfp: efuse@1e80000 { clock-names = "sfp"; }; + serdes1: serdes@1ea0000 { + #address-cells = <1>; + #size-cells = <0>; + #clock-cells = <1>; + compatible = "fsl,ls1046a-serdes", "fsl,lynx-10g"; + reg = <0x0 0x1ea0000 0x0 0x2000>; + status = "disabled"; + }; + + serdes2: serdes@1eb0000 { + #address-cells = <1>; + #size-cells = <0>; + #clock-cells = <1>; + compatible = "fsl,ls1046a-serdes", "fsl,lynx-10g"; + reg = <0x0 0x1eb0000 0x0 0x2000>; + status = "disabled"; + }; + dcfg: dcfg@1ee0000 { compatible = "fsl,ls1046a-dcfg", "syscon"; reg = <0x0 0x1ee0000 0x0 0x1000>; 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/vrRgy2EnwxiTmrwN9VjbFd1PgCx2knE6gpvsigWcASGcK6sNoUnce1puyL8LjHrwPkD9tRXObEFBFsde0Vqtr1AORFqbjsZh8uxKlEajjhhElmHoM5hS5N5gEqyKi5trOhlrT6EU1JQvGnqdxO5nTyE6Mo1KOEUqOEZPeNSbcGUlcYtwRVipLMC7J+aYK7YTcSJcMJGmdIXjtLnVqPktD3zcwgtaDFHhp7C2elPNgcE95f1rfXPGj7T4J1XUfjkTxMMdrksaNVeuw3TcZa4wS4xmift0AFtJSOs4yS3uzYtv5ISEPMcvC6z2+KSIT/WyuXLjQ/a6bmjoc1Wz46q4LrZ7Kj+rsUmyMhwNboyUcukPiSR7T2cc5o7iMXAthAd9BWiNT2x7rut7zExJKt3CylW2qM5gocrim/Jsjbmcmfh6NNdKlz9hpXzlqNP4uUwHawDuaDm1HcbNio1m8Ap5fmeI0Swz8k3y62EQpB/NyzyW2SejohXbX6cqDkYuHHeVXHb73z1NlYYIthcPnTdWRKOFmQrDH3t376D4c9B3ft87FzdtjpGtF3p0ibKUDQNShH/0PVFlCR20ijOpfDa8traNmL2Ro419VSiffi3ZQAeAxbk9JXarwGhTUzGDaN0j2hPKo7ltzJga3YDjClV43U0JpdBG7BsSr+hpEtqmlVK5OE0/6Ww1RchDqE+QpQFiob32Mso9BKM0QBl5220LpZH1HrQgYshdN052TTHLqftjRmnljVEbohGnPz2Cc3mUkIAi2blu7LC7DRgnoxLgB1RmLHO042F/YiYrX3X/23hxihnXIqiLJwiR/MoARHZSEKh54GESD6iSY5ksLTQgdv0gJosRqcCw20QBGSOq2v5IkaHn1HEWKiChIr+SihfabTSnmBSDAGeYKPjiv3Xi7nxpgn4gUvkPDcjStlQ2ztL8nFGDNU5sBBxPKsk2v8pgIZXWiweZJriy8D9ieiXKHA81LD7vrKPhJY7BCtGOv9Jxk6Z7C0vRaW6yGDuCkggngTgvjVwNo/vbL98VpKu+pr0dIMBvUn15AHXPa4Dx77irV7JeNDslOsPqS3mqdcHK2dndXYTOhFfZ0iYOVDkOEhbSz96zhlZwz9v5A/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 From patchwork Thu Oct 27 19:11:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13022601 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 52DC1FA3740 for ; Thu, 27 Oct 2022 19:16:05 +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=PaYE4cQzWTrKZ4wJes2bLIIYSHzJp1rA5wXguNcRvA0=; b=AYia7PXTfNvaKZ dpPIHL/rQdo6VL0/VCwjav5RsIxYaQdkVE0tP9uqgNltSHe7abgly5tVCUdZ2KGdMDcAw6HN8sJ8x tmgaFKmFk/9CL5JWp1HAUAtg9lmczBJOmfMCNiPXphK0cxAhvlW5qcRd87f6V4OzM0wI5sJXB722m 25PfPHk+QOpd/2M8GYkznVFQ07tG4vskQFE1RADLaaOKlX8Sdt/AUU9wUfIYUvO9lk28jdWs7yDMF 3OK6PmAHJh3UV3HkgqeibszzVmkmH2AuynqtRCOVr+OlZ7ks4olBS+bFbrIzrEb4FNxvbooGLvIZ1 IWYWrA6YcLxR2Fn3tMZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8MG-00Ecrt-G1; Thu, 27 Oct 2022 19:16:04 +0000 Received: from mail-vi1eur05on2084.outbound.protection.outlook.com ([40.107.21.84] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8IN-00EbFa-GB; Thu, 27 Oct 2022 19:12:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TVjmRqnhkGHyKEyjVReqwz0y5/uMjkc+Bnq2nPEt2VpvFA8wnrrvmmcVlXyNqqvz0ETCymf4LVL/GCANkX2WRFD7LRmkqxDq/FUWuddm9e1N3BoiLx4tpkp0uL2awi46VP/AOI0eoZMLrAcRZtlnkc/bMLqxpRpBSblc3kLw1sjQ7QlHIqFXqARKP9Caq4NibZ/8nWYs1+y331QopvaSDVzjV92UyRPpCCu/92sQa22IZet7pYRwsiOSY6hn+Gc+Q8KQr12VoiGX2GasY6aTgy4kKMPqbgHuC+7fMoCPYpuJIcxrfF/Mz3XodcbbM6i8nvr2HCBET24OpVgE8Up3iQ== 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=4rZnDIYRgiOMpogZa0b1T6zno6/ylouqK4NkpBXH1y4=; b=FuClKz+SGRq+SdSEp26NUGAqOuZBWqEhCwRLN7nq1Ss5wXpsOGmINKgv8PGjdtIyeX7DoZ6dVXvWq95VTJ3KD6y5rWiyzlnPZ+LTAuE3+tqEFXpqwF0HkX2wTipleFOssT3UEH7sLWAEqPxx3/SeQrfcmga0WmQ1fk9w5z80T/FwrjeXTDMqkVB3tafh79kzCBLhGoavLz9VDMV2YLpzsnZ0AY1QcBl9t14jVrzd99MzUabzUGSxNCWIx296E3hHT+aaJwl68VOjsOxq/hU68ew6h3ZLiNRr79WqFLLwxbnyPBBficK1LiN2HXsCGfmycAN37lLOV6wDy2tOEeSvJg== 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=4rZnDIYRgiOMpogZa0b1T6zno6/ylouqK4NkpBXH1y4=; b=YhRQrqPw73y09yWHI7EmRHdjfw2tabYeMvrCfknpgoIg1eTGpomDVb5TrkA6sqjKiSOB9qaGbzIfBdpPwvThwynB9NHMsjWxw+ZmZIQxnVB+PJChvhmS1ND5+jjipuvHpZVpKkcSRoGCcNgIKkv8sw5sxhnZ9rEUfdgLM0JVCTG5PZEKnjOQSdI3+Dr7YFAxsIP0Vtv6S7HCq+v6MTZ4ZpJWzPBz/dDS91gBOwJo0NzceULocyuX2RQVPJ5GfWwIzCpIwvm46FO0QYQOOGdQK0Ja4zt+xjytmYuHWfePdRlO0Cim9X9O2tZnj726m2A7XMtCnOfgXJd7mFySg3s/Yg== 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:45 +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:45 +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 7/9] arm64: dts: ls1088a: Add serdes bindings Date: Thu, 27 Oct 2022 15:11:11 -0400 Message-Id: <20221027191113.403712-8-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: dfa51c7b-7138-47e0-cd83-08dab84f1693 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F+jx3qdTt76hQ1BwOtZmhQLBCzjS0OzhapofPye7uPlsAKzVqklpySHsP5GTsj+X+DKwbXpg++c+2NtqOZzranFAzP3jmeqD99zcgci8nkrNDK69is92fV45u6+itkW48yKU27EYCxeSQiOkBFIKR+SX848Ih5GtwNKT6H5Mn7eXUAiNQCDv+dZ0VCHes2mo7TDC/zL5OUKlQl48fgCCG3ic+A+KYSUvoq6sXOoJGBFBSt/nHvkOex95URLBCURbEz36sLpJhpr9OjNkNM1P5lS0+1xWjmy+kyzl73AaJvusxXii7fd28rk4bMWQKeOWENMnTiuqZIjVeO93Pj1sfSlw/+zECLwpX0eAH9+A3ngYbSJmFe5ZX506+y0ltaSRGDk10LQwGl6HcTuNmdso6/d3IEGVv6Ap9Th8yYz/OBuJYh77AWJf4qvABC9kaSXoHHbKBg3Lf7YXH8OWMofU8cTqzD5BYa/jB+7I+9kjc4pJkJ0hfbUA6VNWGEijsSx01IbS+i4wZSamBoAtmjdljU5uWGkokzG/0qdPnBv7NG6Ks/0eJh+AC7NKtC458z07/1t3o6GbIbmkhgpBk4Yb7KAMpVPeSR3VhyMCUga5D7zGmnEOfoHqz9RMoFJ7Yi+lz8AHyIa6rVPhkCK/oTFhmn6nqR7f4/nplLITSnHPW983qpw6tNSmJWO0qgCETiQeXRlT8je5ubqwZkD0zP+g7Y9V6zdLie+Aga8zDuqTZXizNU7oUsqQCmsmOm2KgwU4 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)(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);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EqEUr+Dwpn1ldNxma8wklsiOSirnh8mp6b7ES0XJyiykVx3NgYqjf6pU50eA5e5vIIQ53j7+RNHtPNPWtF+g02yQKukyqqJcAlGGEhbEVTuwC0pS/CZ8m/tNbz6ti7zPkzIhJIE+z73TyMj/GOGcK7f1+zvZ8NsnSUsPzr/cVf3tGAQXxNsUlOyJqfqWCvbj0knhVY5wXz28xsb/CgnPT7dyNpO2WP5ecoWlUOTetFNaqXjeL2csKICpGxp98VdCubMlV1UiwD+0pG8RoJgX+gRpxiSZgpuYQSydJmPOYh/z7UPvr/5EwX/IcnJFVyKqXoJ3ddIptmuc0LCuT1IYzUS54I2JbtzQ3ma8QSCglxJIMfjqwhPbdL588Bg+QgYeB0JL1QrawQ+ddwfqdAMWksAOkuqkavhOt8SLIU09OttAwH9bksm9IDmgbYWSnKclNc/W2LVRl4lOvQMij2FIdR9NOmfTvEYNgNgMYACwDCrHK80sAP17/D++lWkIk8fFKAwfK/FC9/YLfVMYKkEIWgRTiCh26O8O4tw76BacQRcMmA7hwJqnktGswdeHR00PuTzlxFGoBa5qwRWgHyC0ZlXsgCq/iUlkAvGHVk0kvcUrqePHFZYWhnuduW31QF8Rb7SfT9Ujc6ntQRN+aJWB13fC1n4ftKovPAKKz2ltjxOfWH9RLXfiX5/IPzQnro8o5US2Pv4DcH6PwoYlJhchXO7LypoIWW0Ukv465Bp3gWanMFvDSapnNRtm+8B8ctjQJWHtCn3xeauJXKeF0k+fj7vlK5KDDR9GuKKOWmvg/krxyNY3uLuojP9XI1hMjCdwm+YHwjIFFQ/vD3z5ndc0hse/esB18GBa+ZAi4N2mLgfm8fGiPpRYW4zxOittz9vFToTihW4StXLb8CNEeVaVPqQXE5VeCUQIGcGI+iT1Vxn7bux4CxqF7DkH97tEzBnOf+FGMePcfBX0h1H2KfsIFguEvbMBocaGNvfWEtzhXrrTdg9QtwMpTv2cuzwhk/MrkZtW8qEkGZCYxLD9ERwIvRdgSNLY4LyUX1wrnVbAfReHWkrtCDWBL6VMeug8sj5eQy0VKOgDTnp+gWMo2tvtAViDmqvRiINiJ2OK2ELR0pLF7Y/zPSUn5hNuEcss5IvevyPy/FBl4vnxMI7Xv7EGkKz1i+j7aig8hFLDb0hSCEi1EmBXmP/3JpMpLJCiC2L9WJaVdikh0PrTFQ7IAhFMA5g570KawBCcQoV71/iMB100D5GSg6rRo3XuK8Bq8oICQgJE+d6h5C5BUZlSftJKS8Cirs/g68PlAfWLQT1aXKqARcLvJDyyP0Xr/mb7h6N+Y9VN6ij+U2eSi1qQLEuN963m6fgAJdeb2jVeJwgsPsT7pJAdrwG1W4OR1vgFmqji+X1Iqo/pxsrhAzcpa9K4oz164K60+81eyTOzaehUlHOOvngqYQ1vpdDIspa2D6DR00+wSH1S+ibuhj2e3K+gnQPETCb+8LX3o4z/EzB6b6u69E0rUUZZ8MBwt8IayMAnhpIbAslCtURHmGQMF4axNl7/hUFjw79hSWcmxYgCbPyCwF+ZTKWfeLsss6Kn9ckDa+TyZqDCLECd5ZN/W3oxLQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: dfa51c7b-7138-47e0-cd83-08dab84f1693 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:45.0964 (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: JdHz1w9UK30xE2HBBTD1TPe+W23G3PFvp1wcmbvv1IAuGQv+rC9n0egYWD6CVAPIIzRPr3VveAzs/TUUqpkP+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9648 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221027_121203_645704_616BDD77 X-CRM114-Status: UNSURE ( 7.09 ) X-CRM114-Notice: Please train this message. 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 bindings for the SerDes devices. They are disabled by default to prevent any breakage on existing boards. Signed-off-by: Sean Anderson --- (no changes since v4) Changes in v4: - Convert to new bindings Changes in v3: - New arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi index 421d879013d7..3810d66f8725 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi @@ -238,6 +238,24 @@ reset: syscon@1e60000 { reg = <0x0 0x1e60000 0x0 0x10000>; }; + serdes1: serdes@1ea0000 { + #address-cells = <1>; + #size-cells = <0>; + #clock-cells = <1>; + compatible = "fsl,ls1088a-serdes", "fsl,lynx-10g"; + reg = <0x0 0x1ea0000 0x0 0x2000>; + status = "disabled"; + }; + + serdes2: serdes@1eb0000 { + #address-cells = <1>; + #size-cells = <0>; + #clock-cells = <1>; + compatible = "fsl,ls1088a-serdes", "fsl,lynx-10g"; + reg = <0x0 0x1eb0000 0x0 0x2000>; + status = "disabled"; + }; + isc: syscon@1f70000 { compatible = "fsl,ls1088a-isc", "syscon"; reg = <0x0 0x1f70000 0x0 0x10000>; From patchwork Thu Oct 27 19:11:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13022599 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 E8924FA3740 for ; Thu, 27 Oct 2022 19:14:38 +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=3efyhMLlCIb/QHIxk/gSWnwemdJW8clgVO6vHBfmNAQ=; b=FYASZ3MUlwrpRE iKzHuRdfodYgw5b7KjWjiz5bg35O67VIGp2iMcr1fKB+9xouden9MlONSUHV3xdNb22kbzYRRccMT KJLTZ+AKKkBU76qHFZz+jpynh/MevB9wAyAlCxyBlxIItZpUuLv4u+OePTIso6urqyTtS2e+aXloz DWV3yQbIv3gjv9HQHDfrDrCKytiMg2p9UjtjVuSKo50ELF8kDucbRkjeai/L1KKFov+41+lEvCwWB 7wUezp+4uDY08ZJdkzJGg9rbb1KQOJ+HYllbHI1oNcpae2t7PY8t1sNyLgLEWpR2TdWhHLID+wjEu rZtV1WOENwfp7YHSi0wg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8Kr-00EcJT-O8; Thu, 27 Oct 2022 19:14:37 +0000 Received: from mail-vi1eur05on2084.outbound.protection.outlook.com ([40.107.21.84] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8IG-00EbFa-Pn; Thu, 27 Oct 2022 19:11:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lU+vEtcu+vipHs2DSfTPidymrqQtRc+7e2Z1oxH6Bya8lSoLTzq7n4/xnhCRAJHFLv0zlYkiwRbKZ4Pvvy1TuHY3Su2jwrQ+N0CAHsHUJjt0RppXLreDziDKr3PW6wiGuqr2Wvbg1digeUN8VFjEtRetsIHw3BCptvtfjz1PNoExVE2EemmWGoWhIxZLnh0/c/en/HB6vJUt9qM8azXB61WaFSwDVqZBEbyicdYDrJExCm2nMkk1bneSCtHuKlEB++6B0IbMKYmwo3D6YF8+WMLToyuHVMGOvXQbMHuJeCsAmIss7tLufGMkcmRu5nIWTJa4HlsJmcY55wpn4TmN2g== 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=X/uNCDEmTY1zQ8OCTFQCdFu+UG/G+IVl8XhChK8qxqk=; b=JR/GwkiAuMgY7Pv1g9LhuVG9OLSDcbTcVvrUmw6W3lCqkvOZC44ntbW2mGym2N8/8Yek0kDmqCn/4lDzPhRikLCK8ehPFWAEXdCiGVKQ+umNtfBPyF6BX0Fda36P0AhDZW5ZNhGoSvuSTM+fsQlJW3bSTt3p6fwM+C8PezvFmv5365jIP8DfpJifIM37pG5OtADtGdyeQ3X7limTOk0YQ6zc4t8/anUuV7DiKPkJZTKSYwuLOc0BIowbobTDywTLaDsKkSwvtp0aNjPjkSJ4sfgE0S/w6/7DbHLXhCUNAkFA+tObZqb2Oe03ueMBDbVLTEV7kxrWfXux5TZKlH06tg== 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=X/uNCDEmTY1zQ8OCTFQCdFu+UG/G+IVl8XhChK8qxqk=; b=iCHZyOVDrOcolrvgxpnvIrXuE2iJkO8/ECCdoj/mq+EqEkRGs8pFLOSj0dwSuP5+yMECIbYUbxFDoGV43X84InHC0gWifVfX/I2yoxXYHr9xBhx7aENXla3RJA4Ypv7iw+yaYjE/oBrt53sAZFtI8v/Bgv+LJXc9nKN3gP+AqdSPhjXfSVHFrfWUwJ2X8HOEezr38L3Ai80u1OmG6pmVbK0FvWqDl9uxTjB2OlimZcn+/oEZqU7h0tO+34ZmuSQ0krtC8wQ3m8an4PD2Wea1chqDoAC9j8faB5i5sxbdHbX+XFs0ruTxUfXh3JJXZoY1+ywTAXPxnNEyS3HRJrOKxw== 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:47 +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:47 +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 8/9] arm64: dts: ls1088a: Prevent PCSs from probing as phys Date: Thu, 27 Oct 2022 15:11:12 -0400 Message-Id: <20221027191113.403712-9-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: 94de8072-5b26-4f21-b8a8-08dab84f1826 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PI7xiQ+Y+HUxey8h6TdUznZsVpMPuxAkdbOtPVeryHJZbd26sEow1XpzfCHnsSeSvlNeNed3+dZaS1HfZv/j8ptkYXZYaDUUAkncKFR4Kuh5yzGoDh+lt0MNl44nZa2Lt8K2TbGmA7gDRpwAMz3l8NWOAUj3IVwoGhTvAN0AEm9jxaWicsjdEUCd/rO35fdBkOfW0xht5SJpWRWtfSrWIXuV9+057lKdsE8rfI8Y+W2UZhMCwoTAmwBV1ZXPGbrKtCM4g1qdJC4pnrAWUp2EWM4cKz9y7eB8DdgvqrlmEPMTiG4hbRMgZ1G4wmAMy2Cf58033TKDiXLkjC/EaG8r0AYk2q7Ps6mEPA7g8VxLRql+ie9CvApE5Hsyo6+C/SGCoVr+aaALEgE61hTzAkKc/gG7XNPNy2snz1wnZK+aLkKwEtcgZvQXkfcNyToW1CpXkdPniWq1d2hXAHgWCtUl+G36Q0ge5/b/Nqb7wI+kBPhs/Jjat+ENm4OWuaM8GsqV6kc7n5q1jcLETO8l/VCt5P1QVdXAnth/C+dSAM3xo0GNkAzTibz1QqAnwUEjEQO43TZ774GUatl+d6XImWzH9ayNsTRSBNvggR19hmCptk1+taxSp/wyI5OP92VbSYJKTm1NsB3X8QZycNevOEVsUVZfD5QEC73U+mUiZnfCEpkK/+yk8UHjqM30Fbs42VyMNjQJGoTAbXiKN+HCpZWvF8+Wtfq2W6zbPQJPSOj0BvxSmiZtwuBz+P9xXrLe4Tgb6PYevTAzunptzSDvM8clGQ== 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)(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);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GGteZoJZxNw1ZywCX8ocMH9rthlvSWbfngvzosttWjq0CDKvjK/wmYOlJqD7G/M64LI9clFkT3f3trS/VeIQqsgIy6IiZGWmXfM+aV2ZJDtNdblNtVE4h28Ip2ehkLk+WjK5/qXyAg1DzmAlxAbnfTNXI0nnLNfRnOHNSdX2KxPEpErqssd6D6AYBOk6t1Q1JTZ4x5t3TcEZA4ZgXjJO4iD7V8tjN010v+TxeC7yX676WSozT8KMjn7ZYClVR1E6nxiLmMoKCCSwNOz2IPVUm24dKAoeSmY+Ul07Snvv5TX4+xLn/1QV+tb8f20ZoL9yxr8LshHPECowC+dYRksBxj4diQjj2DhfGq95oClajf6/rXpp/+lnYySwh7eC28g4JLa+SE7McWa6A4hRzpre3dttjh7o0O93rzjUYP9Jmw8tdexkSshdXJZRzh7CjBNVVve+J+VGoWncQXLkIzMYL1Vd2JhfRtEj2g9DWr2majXhPCX5JwY3YWAGY4sj6iLWJiAsaStuleDV09q+I3ZtadWMuJ98HjikCVgYwz1i+/BMtLLb9m8QGx+8nAJ1x89L1yrRDroUL7azPEyadgjo5MZ197cwpolqH9OZaODzvfNNCXXB7liQVWAPGLmLFulv4HY7jCcuYlteiFas1gVdl2soklcX/XkWk/NZzj1+eXFQNYZuenrM5Mf7ugIfYWSkaBuA4eulqnN3+7+6fba5aMkFjvxXM8+BZgDlMf1FQsKHoYvR6Tsym+SLYQH9Xfdn7RKnnpaWMzRLf4J5nNLDX+2lk7LJiARch0nCqaBZ3gq+Ogp1H3/yGbMvMcb9Yl7UtSNHyv+SfocuUi3Yc1dVRulGc2NBiBhdVBWfMQiIixxshHQ53ASOp65BbAQtXw9jRw8TfMbrqR7Sanc29BERJX0WcQ8c52CHX53u5V1JFl07sXWR4Kfa/EBrgDSvoXyvOttsUnxbXt/F2/8AGMMtqT049bPZjzLsLbWnFMyZh7jcl8Zg0vakP2mceTrOOvg+gnbXlcKxtwfufDzoSvIPoUYvVhcizrObj9SRm6LbKLr9fFqpcvMzH6JcXL0vbagHK+lFfdzSXtcUuWpbyNJsruDVVzXIKE3wHS4PSHqeXJRH2533q8CjMubofhEj90zzUcnY839gseVw6vIFNaU1CrgCDGRQskS2sf5Pa+65RC5tkllpSl8L3uyKY/GAvQEuhwXH0hn3qB6N/J92PiTXdEWiO6BK1f7lRTGuWl6qPp4HhMgmADsnYjxLbHjliw4F1YD8w4a7bRs3KjBf8D4m5RBM/0XFDTs47KZQGhK6ZKxFfLBq4iQfoM+Otcmu7in+zRfwRmLB8He22/26x+3LuSYxOs48ukMV8N+Cf+6hvd2/iyCIInBbE2f11bMZLm5pc4RZgeY6QNtcQ6EqQGDfWv50AKgwPQcPopdjjxZk8U93ORM04MlGAQvFn0osJWlVGSWIRVojPbNIHOSjGndmSgPPzkk+Lyc68Vws3hSr76V6TJ7yNM4ja6OaHhvnHQEDXb/Cio7Hok2+TeuvihoJ4ipQ3Iq125svG/hlLTnYndXuKw3r0oNKQ+PXKxQcpoOi0srpl4Y7P7BCRgcwwxRrLg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94de8072-5b26-4f21-b8a8-08dab84f1826 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:47.5651 (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: K9pPG99Zh2MMYKJgCLMZHsEJHc4KBxEDfo5mEglxFscb2FLcw855DsfWH03a2hC6yZ4iUle9qVSJKVdTOWUF9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9648 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221027_121156_887881_039DF13E X-CRM114-Status: UNSURE ( 7.73 ) X-CRM114-Notice: Please train this message. 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 The internal PCSs are not always accessible during boot (such as if the serdes has deselected the appropriate link mode). Give them appropriate compatible strings so they don't automatically (fail to) probe as genphys. Signed-off-by: Sean Anderson --- Changes in v8: - New .../arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi index 3810d66f8725..7603ea6328d2 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi @@ -817,7 +817,8 @@ pcs_mdio1: mdio@8c07000 { #size-cells = <0>; status = "disabled"; - pcs1: ethernet-phy@0 { + pcs1: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -830,7 +831,8 @@ pcs_mdio2: mdio@8c0b000 { #size-cells = <0>; status = "disabled"; - pcs2: ethernet-phy@0 { + pcs2: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -843,19 +845,23 @@ pcs_mdio3: mdio@8c0f000 { #size-cells = <0>; status = "disabled"; - pcs3_0: ethernet-phy@0 { + pcs3_0: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; - pcs3_1: ethernet-phy@1 { + pcs3_1: ethernet-pcs@1 { + compatible = "fsl,lynx-pcs"; reg = <1>; }; - pcs3_2: ethernet-phy@2 { + pcs3_2: ethernet-pcs@2 { + compatible = "fsl,lynx-pcs"; reg = <2>; }; - pcs3_3: ethernet-phy@3 { + pcs3_3: ethernet-pcs@3 { + compatible = "fsl,lynx-pcs"; reg = <3>; }; }; @@ -868,19 +874,23 @@ pcs_mdio7: mdio@8c1f000 { #size-cells = <0>; status = "disabled"; - pcs7_0: ethernet-phy@0 { + pcs7_0: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; - pcs7_1: ethernet-phy@1 { + pcs7_1: ethernet-pcs@1 { + compatible = "fsl,lynx-pcs"; reg = <1>; }; - pcs7_2: ethernet-phy@2 { + pcs7_2: ethernet-pcs@2 { + compatible = "fsl,lynx-pcs"; reg = <2>; }; - pcs7_3: ethernet-phy@3 { + pcs7_3: ethernet-pcs@3 { + compatible = "fsl,lynx-pcs"; reg = <3>; }; }; From patchwork Thu Oct 27 19:11:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13022600 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 2D600ECAAA1 for ; Thu, 27 Oct 2022 19:15:16 +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=hO/iky7cghfuT4RaFn2kzVFiJxrTKhajmEmNuw0gWNQ=; b=0GblYzU2G2SUvD yXJwZ15HJ3j5hLWrjd86MhK+Tc37g5M66fWeVzhnLz41RJZWW+klgYNlh6qJqrl7l63UT5lc8bEpj uRyuROAmEdpaEpnQ3kWTW0vw4gJDUNbYtzmx5wxuy+4HOuhCb8wT0YaMq/xT4eie2gj089BsNNauu gzjKlkVbYBjtsIgO8/Lo9qAdquFdL81iE9W5y4N29P5XpAqOuO8mrT6/CIiM6vrulIG5udwY9d5af 751o6t5uyxaB0TPhlDngecyGGIGwIp7eLuwZvQhuO1dJikMNfzFZ9iYfJSXbJV0+f3aUQtxVRKl3D LGrv7e5qKbfw6hHINRcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8LT-00EcZU-DW; Thu, 27 Oct 2022 19:15:15 +0000 Received: from mail-vi1eur05on2084.outbound.protection.outlook.com ([40.107.21.84] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo8II-00EbFa-MB; Thu, 27 Oct 2022 19:12:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SD7XwjQDc74dKGE7x4O9QOowuXUx6jNlH8R1JUuYXF3QyIUYDBu7OfeXMdmDyek10poUSwZaobQ1Vlr+IKP7asc/lLwkMrerNSDvb9cS/wwVrAsjkCQXxC+n/tVeM6sxjQe43O347zzb39COhHp2nl5nrRgwbMHJEJ3yogaiXm2xK2Etm16PtM5rwwR19aYhxnhx4cXBUSMIuu68+Fc4uiwAvPsqwtLn4Lq84VfXFdB/a4vN6FwmdpejRvEUXunE/KsvZNNxnoVPWHMmTSNxioH5u6tatA1NIOEsvzqt3IlsbRCjvG4W0NUFDcJcaxDj1uzTqdQ3ulsk/Ih9Jty+sQ== 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=/pbSw1foLbnuG6kHVdttirTvvrT0y8JYzpNi8EroVDw=; b=bZiX2uer21Zvb2CqqTeqc3S7a+5lSN7saELspYRzRD69s29kSRC/bfFD4feE5bWe5w8kMlNYlPWc22zrcrvI1qV5kkJAVRivh9paz20hpU+bzwuibGWkJ8DVXh95268jmSBNR2JtKr5gKmwjqcMe4XDAW4wxi8FUzIwLS5GZYGZ/6au8Vp3PSfaNwVIPyt7B3xo+ZVVvuK95FlZZ85CE9ZSquRX2VFdT2TywFTgbM+CY3YUV5Cb1hV2yQ4eG3ciOtWRdayY8UTPEE/wfSaQYX3r1yQ8j9ZqjUJYl0XLVNVKTPt9YyArGmroU5G8uFK8R8gHgMpotAZxPa79hTJzJUQ== 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=/pbSw1foLbnuG6kHVdttirTvvrT0y8JYzpNi8EroVDw=; b=B52Nf1KjQQ3aLUcK6s8gD6ZCG2izhA/oB9gNy29NF11aoxOkokDbSwU/rVCAjRufrFIr0X+QkGzRMKNQaYl23g90WNag6kTEs444rtsT5uc8k3vj0LTOrlE/RRNioDj8xrqIj0ydB05PZUzOOxnHouQmjCDt04luBzkTEmqBqF0HvgbP30EFGPw6yS7/ZuiDhC/QJyVlJe5zPIs3DKnGeSOZc0Y2vzK/b4hs0cifEajjgiQTSzqFNat5A8jDJdZ4KSH/eA/8cEW+UqHoqPI+7f7vPl96r+t8dfh85vceQ3RwKETDyZBg6pdt7BlRxX9GIg9pU0hI2GF3J/eXtdiEFQ== 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:50 +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:50 +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 9/9] [DO NOT MERGE] arm64: dts: ls1088ardb: Add serdes bindings Date: Thu, 27 Oct 2022 15:11:13 -0400 Message-Id: <20221027191113.403712-10-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: f3a35663-eb1e-420b-07a4-08dab84f199d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xt599HsB1xRqyHg0e2+MQy7pz4rZHcYsktGCPpBC6mVQofPmminW66uSqBg52WxNA/0hncN8G3iSeiHJLGsyYwfUxRQgcz7mq2LmuO6S7dWqEguZjJdzHmrGHwpp3Hu3RseGk07ikjBd0WtfB67zfVMaEaTj9TDI5NZo57jBVdLpelO0aypiYxv4cCfhcF/Fr3772ui8hpl7vDavZxWRtzK5X5rLIDJ/IjICt/lMeckw9dKBZhzSmwW8BUQJm0S0cYi/ZC1vqUT8BLGIFw5v2ziLc8HSR4CksjWUY+JVyjKa/Uw6+z4jblqRl5ugKn5734P69PU+A3/QIbZR5Mc1AmJnPqlfNfy8QcN13aH1+NuyEreYBu/IBVglW9wmvYi3u591ofE++BI4wZ7Pi2HolXSQGfsPR+rCY84WkZp5s8dit0nYGU9etIBW2/JAvYTQvo6lMmGNA9gFtTbmiBni5TtR165AXPqbDZEkD5Q6WpkpBcl6CmP1rm8x3K6oygeZsDGLNta7cTM3+IpmYz9Vd1VWzguUiDYkLFugu1WffwVBZ4GDlKqom52y/hZyGQ1zqb5ah0zFEA7WjP0E2AblnbJSFKCBfgoA9APJfzYgC9SYNdumwbkVgGEQJ55Bv1wH1liYZM5ZaLe3ZvfgsIIlRLTR8ijTo5yNlUQ+d4B9kpVTiV+Gd0r3dyvd8VFiWCEZPeGJWrS35jibY6L+lM8qp2hLGesq7KovkkEustCiPZEwAESQDkbEORp1FIHDEQH8yNkkCb9RFL2KZGaUmZjMDSgFj/imJDjHhnM55qaXZX8= 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)(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: ORM7fp0I5IY7eWM6H0oig8XN5jDM4eikGPH80qg3fdcYAfvYJQLgExonIzi03SgKO+CqqOehq6XrTgEBQsH6r4UNIpsllBOjPtvH1kAxUvq8WjsCh1gv7JHPEmMN6pz1W4DQwa0UXKMnb5SDIfds0NNyUnJgNoWCML62qV8nVNs6kAcSAicmzylOLp8e69d6mSft509QEPRFBg/nSysWJQZHFJcz2YOUqgov0zxSJ75LTVxQ5P8Gqch+mrLmugnvf6K7cMsedRasT8llGVuLtoYkcINlUGtXeTu4zdbzHeZKiY1u4BgDID96jxnApBQeKQFXdIyzMY3kODYUupCHvSYw3PtdGWGKRInRNiL5zT2SUWWAXAfe98UcoPEbHqT0YoQwRryXCTJ30TqC8EmrlIcbcL4R43rhSL6nVl0QUKoOSAvfhEf07ibvODggVmGjOUeZCCeiD3le9eF0jh9dHUxG9uM3N6KiApSGIwBKDdfeZmw03IOf3DAcavmhBEyejlToUPY3K3NXdH/OoJoDDl63AZ7VdDxne/ncg/3GdHB/bRkb6yvAsYbfiWFTdAnvxgyPdBxj59/3c9fDwElNgjI4YydEfieXq7QCAKGBPBJHb/uAzeFy/gqEPIr4jT4tOxVTWcHcbkKwAVtxT/Z69+1ftyM9wC+LEJi/qQg41PNundmr8SCS3UtAq2/8fWddiDW78A19ObozTRlGrzvuZP28ChCAexpR1q5pup74MMYih6G+z7tr2JLjvFbAS73wb7BJUjeaYgEHw5sB+tmGnHpSyzCyWEPc5JUdSGcx+WQm/E740F1lTTYGk/7UUcrfan/EGesRjtxgfUWKnISNNTLCIIq8eoWllpmCdEt+wcucl0Eq1a+ajAlJmkPV2jgORjGHEkC3EJ8ewDa7/VIEJVg9Vl9dHfFkx2HDhrHwur0c2vndgMuqCgniMdiymukTwSTxAwtPzRq2MEE7LTKJiVhnocR6maTfsV3xlqRSU4xZ0RA4jQqIUAV4xjclIeyKbhcleBZIg/GNkntd3Lk6Y2UroWO8k5XERtcYgT783KDBpMajOHvtTcIsajMYU75I/EOuCeayGFBl/EXwW48VNrWUSfqtf8Bd2E6pdoy183faH4EYmfkjT54yRlelW4kwfXalRy0O22pBus/TN0d46glKgfpyDw2OR38Yr6VJ8CohlCP6RyDsh6GCjDqIAx1jN6nSsGXOsGrqGl0ZDVSRYtSJFLl5r9jdBigSPcujyLiAcTM18gD4fiQz+GEHWSu2sJxpy2mMcYUuSW+cm0vDXeiul2HIQt8kfgkJg+9RleAlfZfRU8dq/b6kuamgrO+byc0gEGF+ZAwqGzPztWJmmMyi/ISAXeFFkL0t4pDMlStoguRAZEtqTwcRdcQYDbkN8fyWUoCgI2CWWoBxnm9xsObK7CgMwWHxay1LfgMfUhB2dTAjc7+7d0H8Lg2+OPXMo9mbtD0yxCy1jypCZqcbodTtTtMfObG7USnjAPfuyLYOl2gjBLxKlw4UJrxoRqRJZKs+3+Mm7LA3kbNYF9F95+Lz6ufuLmQSsi1jrhSwhpNjhOTYn+TJQMwgna17Bzc33r5WwFGWd+Mzob0Te3jr1g== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3a35663-eb1e-420b-07a4-08dab84f199d 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:49.9557 (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: U/JlBrgfEbLV+tbDF/jb1R/BTfp6cqg+bQCjZLD4sbigEs5meFJfdqVASZbnG5xC5XR8INx6ZatU0C+9csF1Eg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9648 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221027_121200_624327_5BB52974 X-CRM114-Status: GOOD ( 19.57 ) 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 serdes support to the LS1088ARDB. I have tested the QSGMII ports as well as the two 10G ports. The SFP slot is now fully supported, instead of being modeled as a fixed-link. Linux hangs around when the serdes is initialized if the si5341 is enabled with the in-tree driver, so I have modeled it as a two fixed clocks instead. There are a few registers in the QIXIS FPGA which control the SFP GPIOs; I have modeled them as discrete GPIO controllers for now. I never saw the AQR105 interrupt fire; not sure what was going on, but I have removed it to force polling. The MC firmware needs to be fairly new (it must support DPAA2_MAC_FEATURE_PROTOCOL_CHANGE), and the DPC needs to set the macs to MAC_LINK_TYPE_BACKPLANE. This will break ethernet if those features are not enabled. I am not sure what the upstreaming plan should be. Signed-off-by: Sean Anderson --- Changes in v8: - Rename serdes phy handles like the LS1046A - Add SFP slot binding - Fix incorrect lane ordering (it's backwards on the LS1088A just like it is in the LS1046A). - Fix duplicated lane 2 (it should have been lane 3). - Fix incorrectly-documented value for XFI1. - Remove interrupt for aquantia phy. It never fired for whatever reason, preventing the link from coming up. - Add GPIOs for QIXIS FPGA. - Enable MAC1 PCS - Remove si5341 binding Changes in v4: - Convert to new bindings .../boot/dts/freescale/fsl-ls1088a-rdb.dts | 168 +++++++++++++++++- 1 file changed, 166 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts index 1bfbce69cc8b..dac3337acbc9 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts @@ -10,17 +10,143 @@ /dts-v1/; +#include +#include + #include "fsl-ls1088a.dtsi" / { model = "LS1088A RDB Board"; compatible = "fsl,ls1088a-rdb", "fsl,ls1088a"; + + clocks { + si5341_xtal: clock-48mhz { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <48000000>; + }; + + 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>; + }; + }; + + sfp_slot: sfp { + compatible = "sff,sfp"; + i2c-bus = <&sfp_i2c>; + los-gpios = <&los_stat 5 GPIO_ACTIVE_HIGH>; + tx-fault-gpios = <&los_stat 4 GPIO_ACTIVE_HIGH>; + tx-disable-gpios = <&brdcfg9 4 GPIO_ACTIVE_HIGH>; + }; +}; + +&serdes1 { + //clocks = <&si5341 0 8>, <&si5341 0 9>; + 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_. + */ + serdes1_A: phy@0 { + #phy-cells = <0>; + reg = <0>; + + /* QSGb */ + qsgmii-0 { + fsl,pccr = <0x9>; + fsl,index = <0>; + fsl,cfg = <0x1>; + phy-type = ; + }; + }; + + serdes1_B: phy@1 { + #phy-cells = <0>; + reg = <1>; + + /* QSGa */ + qsgmii-1 { + fsl,pccr = <0x9>; + fsl,index = <1>; + fsl,cfg = <0x1>; + phy-type = ; + }; + }; + + serdes1_C: phy@2 { + #phy-cells = <0>; + reg = <2>; + + /* SG1 */ + sgmii-1 { + fsl,pccr = <0x8>; + fsl,index = <2>; + fsl,cfg = <0x1>; + phy-type = ; + }; + + /* + * XFI1 + * Table 23-1 and section 23.5.16.4 disagree; this reflects the + * table. + * + * fsl,cfg is documented as 1, but it is set to 2 by the RCW! + * This is the same as the LS1046A. + */ + xfi-0 { + fsl,pccr = <0xb>; + fsl,index = <0>; + fsl,cfg = <0x2>; + phy-type = ; + }; + }; + + serdes1_D: phy@3 { + #phy-cells = <0>; + reg = <3>; + + /* SG2 */ + sgmii-3 { + fsl,pccr = <0x8>; + fsl,index = <3>; + fsl,cfg = <0x1>; + phy-type = ; + }; + + /* XFI2 */ + xfi-1 { + fsl,pccr = <0xb>; + fsl,index = <1>; + fsl,cfg = <0x1>; + phy-type = ; + }; + }; +}; + +&dpmac1 { + managed = "in-band-status"; + pcs-handle = <&pcs1>; + phys = <&serdes1_C>; + sfp = <&sfp_slot>; }; &dpmac2 { phy-handle = <&mdio2_aquantia_phy>; phy-connection-type = "10gbase-r"; + managed = "in-band-status"; pcs-handle = <&pcs2>; + phys = <&serdes1_D>; }; &dpmac3 { @@ -28,6 +154,7 @@ &dpmac3 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs3_0>; + phys = <&serdes1_A>; }; &dpmac4 { @@ -35,6 +162,7 @@ &dpmac4 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs3_1>; + phys = <&serdes1_A>; }; &dpmac5 { @@ -42,6 +170,7 @@ &dpmac5 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs3_2>; + phys = <&serdes1_A>; }; &dpmac6 { @@ -49,6 +178,7 @@ &dpmac6 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs3_3>; + phys = <&serdes1_A>; }; &dpmac7 { @@ -56,6 +186,7 @@ &dpmac7 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs7_0>; + phys = <&serdes1_B>; }; &dpmac8 { @@ -63,6 +194,7 @@ &dpmac8 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs7_1>; + phys = <&serdes1_B>; }; &dpmac9 { @@ -70,6 +202,7 @@ &dpmac9 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs7_2>; + phys = <&serdes1_B>; }; &dpmac10 { @@ -77,6 +210,7 @@ &dpmac10 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs7_3>; + phys = <&serdes1_B>; }; &emdio1 { @@ -128,7 +262,6 @@ &emdio2 { mdio2_aquantia_phy: ethernet-phy@0 { compatible = "ethernet-phy-ieee802.3-c45"; - interrupts-extended = <&extirq 2 IRQ_TYPE_LEVEL_LOW>; reg = <0x0>; }; }; @@ -171,6 +304,12 @@ rtc@51 { interrupts-extended = <&extirq 0 IRQ_TYPE_LEVEL_LOW>; }; }; + + sfp_i2c: i2c@6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x6>; + }; }; }; @@ -185,8 +324,29 @@ nand@0,0 { }; fpga: board-control@2,0 { - compatible = "fsl,ls1088ardb-fpga", "fsl,fpga-qixis"; + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,ls1088ardb-fpga", "fsl,fpga-qixis", + "simple-bus"; reg = <0x2 0x0 0x0000100>; + ranges = <0x0 0x2 0x0 0x0000100>; + + los_stat: gpio-controller@1d { + #gpio-cells = <2>; + compatible = "fsl,fpga-qixis-los-stat", + "ni,169445-nand-gpio"; + reg = <0x1d 0x1>; + reg-names = "dat"; + no-output; + }; + + brdcfg9: gpio-controller@59 { + #gpio-cells = <2>; + compatible = "fsl,fpga-qixis-brdcfg9", + "ni,169445-nand-gpio"; + reg = <0x59 0x1>; + reg-names = "dat"; + }; }; }; @@ -203,6 +363,10 @@ &esdhc { status = "okay"; }; +&pcs_mdio1 { + status = "okay"; +}; + &pcs_mdio2 { status = "okay"; };