From patchwork Mon Mar 6 19:15:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13162230 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 DA1B5C64EC4 for ; Mon, 6 Mar 2023 19:18:54 +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=CmRRGofRiigFR/ u47wU1p7S0druUrSFHaz88HPwaqckJ7VyEi9D98w3EV3xJy3Dzvc9FmL3827zFUF6yvkeh4tkoCRr qhTMw9lyG90IFL3wcQiAzt8y6oEdemftLryGfp3fV++eO3UCB3981jwnEw61wZQy0Q7Lw97UqZggm h6GtENXTEAzT5JM78slD+S3uRuVIFcW9Y9iHN+aJ4aV4EJZfVfNNlwaNbwhVDiwUUrMT1dJl4ajIi /PFYvNbMIUfvg/h0qzLfXEYzz2tX6CXDdZb9FJ5JS82udw1/puXA1vUE7Kgip26NZeH1CsuEdKevm s5jpUdoKpVL05Lm1Lmig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGMI-00EXCU-3x; Mon, 06 Mar 2023 19:18:54 +0000 Received: from mail-vi1eur04hn030c.outbound.protection.outlook.com ([2a01:111:f400:fe0e::30c] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGJs-00EWEC-FV; Mon, 06 Mar 2023 19:16:26 +0000 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=VNLE0NriW85lgqnNA8sqpuI0dxh4CsdVTVakJ0O+Wm445p5zdc0A7Q5ifScoNaDhCLEBCXtcSkolZGA2+hOVoqOpek0aIDf/bpn2OtV9+Ut04kEOPc4U/I6ghdBFWwIl4sMuYSIjIB7vwCMKxBul57p79wmnm1usKjeMtYZBEgjlxFcNEdXHi8b63EJGhx/JYFohCiGHDgX4CALm1XehbpjsKDfmq+nYO/+YxZPf16fCNUElOaNUseVNdpI29dpXk1Nssw8lFtcYWapf/SqH/nqeIi7RqD7Q8WXK60AW3RBdnoN+weEwNJra2CXzznYlu7eHT4wEzUBEnMD/B7/GMg== Received: from FR3P281CA0103.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a1::19) by PA4PR03MB7280.eurprd03.prod.outlook.com (2603:10a6:102:bd::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:17 +0000 Received: from VI1EUR05FT040.eop-eur05.prod.protection.outlook.com (2603:10a6:d10:a1:cafe::70) by FR3P281CA0103.outlook.office365.com (2603:10a6:d10:a1::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15 via Frontend Transport; Mon, 6 Mar 2023 19:16:17 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 20.160.56.85) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Fail (protection.outlook.com: domain of seco.com does not designate 20.160.56.85 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.85; helo=inpost-eu.tmcas.trendmicro.com; Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.85) by VI1EUR05FT040.mail.protection.outlook.com (10.233.243.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15 via Frontend Transport; Mon, 6 Mar 2023 19:16:17 +0000 Received: from outmta (unknown [192.168.82.140]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 37F732008026C; Mon, 6 Mar 2023 19:16:17 +0000 (UTC) Received: from EUR03-VI1-obe.outbound.protection.outlook.com (unknown [104.47.30.106]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id CF4DD20080077; Mon, 6 Mar 2023 19:14:27 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kQ0OuDtBa1wnc05hxpKEUaUa+e5xnosIGiiZuhRt5+WBwxU66AoFtQtksM6ZK4JwiQmw1DRTwerqKjfmu4uLHcDnDN9Oi8X1zBCIIdmqwVitVY0J7CqEsNSKiiYzcNuGpV83AaX2McLdj5MC4cIRFA/oedlqfTV842Kts94Pzf4JJ51DKOSzG/Q/FOuvooMLzCjGdcrHLwHWckuei/gCE2Wv+FxY9RHd6rM2wz3i0RdwIdLebSpb1lRyUpCqpzEuJ3yxk/WVfo74sEqD4WG5hs8j5FPAsV/52Cm/o8LLkbLMUMK0tAhjo3ak9mnmMpUct+uAyvQlMiegsv7OL+Uqig== 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=PMvgHJ+2AKalOJu6uLVLWn6d+W+aq4bHni1qI8TWRf7KYVjoCFyC989n3OH/q3eadtRSzhBKn4TLnTIhmCr9tGb6LkiydeQ0Gsk0AKeQOywmoZNN3FHdh5RZdi7fVsXpynD5YC6wi9fMk/xIZ6WAkwMVAoeaOK2pmwuO5w6oOp7d2n5hYWdI5i8o0TMICT8orVtmwb2a7NcO5M5twxeMdhmHIO0uPAWJ8jSs5iSmW80M+YK+Kqwe/oTSLAQEv3n24v276CQdF5S0RLUILOzRg2PxdPaoKujvksPlgn5WQClBywsRRzWtIzmPiOpJUAE2Lz4xhU5cubYWniBv4PId8A== 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=VNLE0NriW85lgqnNA8sqpuI0dxh4CsdVTVakJ0O+Wm445p5zdc0A7Q5ifScoNaDhCLEBCXtcSkolZGA2+hOVoqOpek0aIDf/bpn2OtV9+Ut04kEOPc4U/I6ghdBFWwIl4sMuYSIjIB7vwCMKxBul57p79wmnm1usKjeMtYZBEgjlxFcNEdXHi8b63EJGhx/JYFohCiGHDgX4CALm1XehbpjsKDfmq+nYO/+YxZPf16fCNUElOaNUseVNdpI29dpXk1Nssw8lFtcYWapf/SqH/nqeIi7RqD7Q8WXK60AW3RBdnoN+weEwNJra2CXzznYlu7eHT4wEzUBEnMD/B7/GMg== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by AS8PR03MB8394.eurprd03.prod.outlook.com (2603:10a6:20b:526::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.23; Mon, 6 Mar 2023 19:15:56 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e%5]) with mapi id 15.20.6156.027; Mon, 6 Mar 2023 19:15:56 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, Ioana Ciornei , Rob Herring , Camelia Alexandra Groza , linux-arm-kernel@lists.infradead.org, Bagas Sanjaya , Krzysztof Kozlowski , Sean Anderson , Rob Herring Subject: [PATCH v10 01/13] dt-bindings: phy: Add 2500BASE-X and 10GBASE-R Date: Mon, 6 Mar 2023 14:15:23 -0500 Message-Id: <20230306191535.1917656-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230306191535.1917656-1-sean.anderson@seco.com> References: <20230306191535.1917656-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:208:23b::20) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS8PR03MB8394:EE_|VI1EUR05FT040:EE_|PA4PR03MB7280:EE_ X-MS-Office365-Filtering-Correlation-Id: 2eb05bde-4c61-42ed-1670-08db1e7742f3 X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: D47ouEvu/teCiOhlOJKU3Aenak69bJUoBL9dhilU5nL3H0QQzLijqp5TyOrP5sNnN1482iy7o0z+UYuKxsN+Et0Jcrgdqp9b9rvtmgJKrsvWFxgFB0nFptxhkMe8Ge8KTYpPqIbrEuhcFHgLqNDykt4N96cLBgeu3jfsi8fqgZhvOY/mGG8D0L7NGsfRytwLC9JqYShQ+Q5BHuphyht2M/Ty85U/FQIjCfS8Qutcxscwh/BqOPCCsoxl5mqxyO1Lc57ZhqFxKJ4so1Zhp+2nOhKmwIq2r19q3rrQ3yl0cqPz/T5Fl/jMDTRcQUns+e9ypbJbv3rfRgf8dhkMjBjqDymu2kZ2RNK3tOud3bw2JScfZvx1qM5bzEjLzARgWahF8vV65moVYUy7NgAEl2EgSf8FqH0C58T27S0hfoNeAQMMNR9+u9bWBcrggS4ymm/3C1VQBGRNdoj0HEc4VpADezUk43zAhKSkDiu/ZI2zGMeAIRvhcLD2zLzLJ5uWjAgPPHVb/iyEfip3HYJ8Ws8mxrkh59+qwv0r+DbvqKdXLtEszImXYyirztJT8ERDvNwTobd4+gSu5XACs9pu7rNQLJdoUV0+NKifDRb6QwrF7JiI0EyYJ807wNxI6DdQXbC3ld81G5nNLGNFoRRnO4RcIbuotBeRu67L6CV6DCvTuTErb/XbVCFaESY5DbhGD8tn X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(136003)(346002)(376002)(396003)(366004)(39850400004)(451199018)(36756003)(6666004)(110136005)(478600001)(83380400001)(52116002)(1076003)(6486002)(966005)(6506007)(26005)(186003)(6512007)(66556008)(41300700001)(2616005)(8936002)(66476007)(4326008)(8676002)(5660300002)(66946007)(44832011)(7416002)(86362001)(2906002)(54906003)(38100700002)(316002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB8394 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR05FT040.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4ce95df6-fd9e-4601-0d87-08db1e7735f7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YNHE1ZCtmIJ/uz7GhQjlP1rJYBIa+JguihSGVpjVKiau4k7R6XQB5gE/sUcOiFhcQ9/fe06q7g6ZTe6cfhRF7WVpbUvvNlNTYX59/KllymbeMjVk+4JZJVtPqYd7Mw+1kmyJE9STcgY2hF60kFyGl4PQiZTET4kmlKWSSM5RybYEi8swcc+UATL46jjxDBMgw8ujiY/zFIAUIF8jm2u1N4n3DlKj84t0xbSEbI0USlJFuyIJA7IoMcDTCsrDvbmicBnNGEPKh8KNVxMH+aTfJZtUvX2thaaqvNfEpLTSK/zAcWsRb7qWWR3nEYkTvG+yE+1mctMXwAoZH0And9MVxwqfWQrl0AKL1UNQmE+w52LluOWdPNolgR41Y1nUVSCWiP5uPvUjZY2AbNCYUexEWef7fhVnx6JjFn0IxTU6XJeMsvzqXMjVtjLWDnWwCi2Yxg2fOr0arLx1Dz3J01H6QiJBW4l82YvMmc5dCumATpV0M1Qaw+8tX+ul5xcb3OrmqncewcZtjGHImhH0dHOYismRdGyLB6b4nN38c6p5fiSagGmDYp5/StlcBHyrsVhjO8RB6Td7P/AC47K0qIuu1R1xXp8MmgNXmHrVjIdr4Zt3w4JY943f0ECSSgn5DA9KvaioHpUYBdcrRl1zgRdZUYpsHqsLpNf0eEGoysz1MBBiY2sfzohCaZnYSmYW1J1vmbB787Jt4LqQOdXLlRC4D++zx9epkw22OqGEM0iRZ/aDm6vhxsW2SpbVJ5guXATu X-Forefront-Antispam-Report: CIP:20.160.56.85;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:inpost-eu.tmcas.trendmicro.com;PTR:inpost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230025)(136003)(346002)(376002)(396003)(39850400004)(5400799012)(451199018)(40470700004)(36840700001)(46966006)(36756003)(4326008)(70586007)(70206006)(40480700001)(7416002)(41300700001)(8676002)(8936002)(44832011)(2906002)(5660300002)(7636003)(356005)(86362001)(82740400003)(7596003)(34020700004)(36860700001)(6666004)(1076003)(6486002)(966005)(478600001)(110136005)(54906003)(316002)(82310400005)(47076005)(6512007)(83380400001)(40460700003)(6506007)(2616005)(336012)(186003)(26005)(12100799021);DIR:OUT;SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 19:16:17.5444 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2eb05bde-4c61-42ed-1670-08db1e7742f3 X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.85];Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR05FT040.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB7280 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230306_111624_548524_5598F764 X-CRM114-Status: UNSURE ( 7.16 ) 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 Mon Mar 6 19:15:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13162224 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 1FB18C61DA4 for ; Mon, 6 Mar 2023 19:17:22 +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=2Ol9EsUTSOtruCBraqeBsMETmhmfu2IlwLW+2THFk6Q=; b=m4IcFFG0oLufPy Ntus+1Ai2ZUsyp/w2mkcHKQnIXWrNRXUYBC9MlRp5BDJYHX4sJEEyeYJywY8HMBIDAiSvAw2xlRUD OQDef2yp3k/H3IYsAefwIL19pBMMhS29NvwsiKW5ynK/q33gEuD+Fqme1J/Q6gfDo1Cfy5wwiIFZ8 oqO3Th9KSJPzj4hFOiLPR3YsAfmGhuxR+AGLQovqrlymx7W9kaSgdklHKPnFDmjg4WL43S9y4wPeT t8zIevxupZl4ZXDy37tmoviBiXCpJ4R9PwJfvmzjfHjdvXmyI4uzqcPKen67uu+F73jxyad1rSKD2 dWNgFTyG0a90rZa7GX0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGKn-00EWaj-GP; Mon, 06 Mar 2023 19:17:21 +0000 Received: from mail-db3eur04hn0324.outbound.protection.outlook.com ([2a01:111:f400:fe0c::324] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGJq-00EWDS-8F; Mon, 06 Mar 2023 19:16:24 +0000 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=dY3VxoAyiXo2Scf45jx887ZDlZVBcL3U87Bk4rRlg2o=; b=fMGXo9X0kYL9eMMdVL9vQd0PlEBwCvveVBn16uY1z1atPjPHjFzLiP6A9OYJnvTbNerBTJAtqOlPjl86M9JqK5a1jlzB3/bjfJ5eddDsw/QPCUIOw54xZHPyLtsUu9rVS48PWn0m4/KG8v9SdGcoCHyfOCmahCgH6wStTuZ9/2aLPlotdv8k/cv02duEkNVK8LKZJ6uE05AvjnbXuoDbp6Ik15QYsXvOSUX9F3CVKhUhF6FTa8vl1jNELP/8qxLwxBw1k8WTkWkDSDL4Wh3/xBhOYFBGujOTWILlwla6CNOtRXdZtOXV8C3W312yiCIoBtcfQ6pHkuf/yPCtM7mIEQ== Received: from DB8PR09CA0032.eurprd09.prod.outlook.com (2603:10a6:10:a0::45) by DB8PR03MB6187.eurprd03.prod.outlook.com (2603:10a6:10:133::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:15 +0000 Received: from DB8EUR05FT004.eop-eur05.prod.protection.outlook.com (2603:10a6:10:a0:cafe::8c) by DB8PR09CA0032.outlook.office365.com (2603:10a6:10:a0::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28 via Frontend Transport; Mon, 6 Mar 2023 19:16:15 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 20.160.56.85) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Fail (protection.outlook.com: domain of seco.com does not designate 20.160.56.85 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.85; helo=inpost-eu.tmcas.trendmicro.com; Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.85) by DB8EUR05FT004.mail.protection.outlook.com (10.233.238.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15 via Frontend Transport; Mon, 6 Mar 2023 19:16:15 +0000 Received: from outmta (unknown [192.168.82.133]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 37CD32008088D; Mon, 6 Mar 2023 19:16:15 +0000 (UTC) Received: from EUR03-VI1-obe.outbound.protection.outlook.com (unknown [104.47.30.106]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 38C5D2008006F; Mon, 6 Mar 2023 19:14:37 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i+czY/cGywuy8fWlUHU2juLxEvRb6STLpcp8z0P64hToGtzW/j9x2Tiv3wHYJHUVF3w8S6+gWnujIhuaWgXs0L8CUq6OUoLOTRF0d9jSQMpGo+AtCq7lhFt9K/5fshDjWB2aFN07ussjZ223/KRlRrcE1lmCOwW3FlqszVVnLmdIQGVfcosZghHBfq/Xr0oYf4XcniKN1GQmSJvCIvR06zc3VH9H4A0h4dHseITpARnnVteiXtZ8LvbRViljtjJMGt4kj+YFswndcoHPPJEK9zgDxDMwtGBkuUo6kzs7OVwft2RKiMrVzA7eDOHbTG39lUjquYBXOmQohZPICovUyw== 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=dY3VxoAyiXo2Scf45jx887ZDlZVBcL3U87Bk4rRlg2o=; b=nEUzcvoEZk2gUX4uQRhvrIIZMCta1h+v9nBciysuOgunN/t1+NyxPJKK3mgoiJShltsnzIeOUc/5j6UaTyiprKNNNW3apTEgswfomk31ELlznRblPGAlkM8QYP1OxgHfthKFJmLtxpspSYZ0iEmbKg/REQ3qpCpu3k4Y8A5fMVWCm3v9ijr4Sz+X8z72nP/nER/vLNA4kShGjZIRNIEbUjLOErA6JS+Vuibg1QQYyMqXhAjcpNsuSA4lFT3MmxcDBcur/neIArSSIIZX9jRjJp8GqBPrJ+B6DxW95X///QvLFrOZQOcPl5r85YrCHgxIMM2wuRS4HtYo0qwoFQ8dnQ== 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=dY3VxoAyiXo2Scf45jx887ZDlZVBcL3U87Bk4rRlg2o=; b=fMGXo9X0kYL9eMMdVL9vQd0PlEBwCvveVBn16uY1z1atPjPHjFzLiP6A9OYJnvTbNerBTJAtqOlPjl86M9JqK5a1jlzB3/bjfJ5eddDsw/QPCUIOw54xZHPyLtsUu9rVS48PWn0m4/KG8v9SdGcoCHyfOCmahCgH6wStTuZ9/2aLPlotdv8k/cv02duEkNVK8LKZJ6uE05AvjnbXuoDbp6Ik15QYsXvOSUX9F3CVKhUhF6FTa8vl1jNELP/8qxLwxBw1k8WTkWkDSDL4Wh3/xBhOYFBGujOTWILlwla6CNOtRXdZtOXV8C3W312yiCIoBtcfQ6pHkuf/yPCtM7mIEQ== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by AS8PR03MB8394.eurprd03.prod.outlook.com (2603:10a6:20b:526::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.23; Mon, 6 Mar 2023 19:15:57 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e%5]) with mapi id 15.20.6156.027; Mon, 6 Mar 2023 19:15:57 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, Ioana Ciornei , Rob Herring , Camelia Alexandra Groza , linux-arm-kernel@lists.infradead.org, Bagas Sanjaya , Krzysztof Kozlowski , Sean Anderson , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org Subject: [PATCH v10 02/13] dt-bindings: phy: Add Lynx 10G phy binding Date: Mon, 6 Mar 2023 14:15:24 -0500 Message-Id: <20230306191535.1917656-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230306191535.1917656-1-sean.anderson@seco.com> References: <20230306191535.1917656-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:208:23b::20) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS8PR03MB8394:EE_|DB8EUR05FT004:EE_|DB8PR03MB6187:EE_ X-MS-Office365-Filtering-Correlation-Id: 8789e5e4-4214-4903-2034-08db1e7741bd X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ZQ7TSl+ggsnBJx6im2Q7PHtz17waaoPlhe6OpRRYThAhHDSH0RuSROcjv0df2np9Ki6N1QF+EmkoZH6C7wZxp73uJIShIrXZHFEPa3LWzI8SwcBvFbmXwiD0lDZ+4kMpjILTrj9B3nPhzl9yff1ieDHyXz0ryQk1M3MnO6xv9R0SU/Is2Y9t/bgYWVTa0iiglPMxh58JMxQhtttCQ2UYRESkrMPzDX41151PwicpZkRyGHn1RdjWaaFVAi9CWpO5JUQ4tC0rWJNvEWh4lgpP2oTTc5u4QEyWhsLzsXy6p3/SzepKy193DhwrnIcOo2vl512zGuMkcq/PuoQBzIpfyrTirhNYNrOrjUUgk1Wop4q31n2YD8pAMUu4iCPRhkO9Mwjg+KyP84LdxG1mTP+C0/ap5mt4j847rJAWBuqslwd809l/q0nwaNIQxAMziMEDlZs8rrU7/ztT7IiwvYPMJ6FXOC0uHHDDp+jGfjAjLvDTKQxILW1uMsEXpFZ1/jbXdj5ePW/IdTcKfGTXS296MW++M13IlREjn7DLBBAyge3934ZU5Z4nDM9KUvUzfQYvEMtRvCW6uwKQH6mlWbiE2rIwHP1CgqrzF8rfMvJcVPh5WBhlsf1pcNZ9cSXPHNJWbETajAp/aZfStA5bZec3HDPt5mAqFXTVDyLIEjWo0e8uYdtKys7V/bACV5QKO19I X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(136003)(346002)(376002)(396003)(366004)(39850400004)(451199018)(36756003)(6666004)(110136005)(478600001)(83380400001)(52116002)(1076003)(6486002)(966005)(6506007)(26005)(186003)(6512007)(66556008)(41300700001)(2616005)(8936002)(66476007)(4326008)(8676002)(5660300002)(66946007)(44832011)(7416002)(86362001)(2906002)(54906003)(38100700002)(316002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB8394 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB8EUR05FT004.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 27fbc34c-92ce-459a-35c9-08db1e773702 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UaiLB5IOmi/00Sh7DNRK7uXqN1g6/ceYrlagE21XuH75QUwn0SZVNHZF369nblglgP1vWK0lA4Nsm4T4+V6MKmw4HHfANuWsSYaBWxDMp9yFX+Of42kvjr+VH8CDPksWB+Us/zv90GxqtkGh6dDEuQUS63Z6RlJSo+rrGv9rEPdMvaNB0BagTr5pj/L2FrXYds9dCvRm5dz4iOU1ULIVlJs6BMpkvYe+GKcg1fzIB09gE44Ww4uZ16UtPAnqMA/jslfWqHmfpLJqf7RHnxriRWoBzjN9obMKFeJmbf0aOeUhejqqi/XJxTkinzkWz8IvzsA3iwAeuSJsbZGyWH548jvJZ4MccbueGeVjXGL16th8vFNaweVuEF61TcEKXqIY2l/BBCyo2UvmStBVdJrFYdI/wzkasRoVYl9PeC5+Xe5CzC1JrfeUMSZ6BJ5+Jpcc3MgSE+kCR11GKpYE1iQEPGy79hruWePb4rXVUDbX7Y66bJkzoftvXP08xgPflPBo8A4o3PowV92gt44+qgrieReIla0XwJWseHiDj9uusjTLPYSwVwYWzzQ8T7xS32dl8gTDRpAAEFrVJ5XA7wmkiau0AUpfwTaKzC7NN36e0Psvlmh9noro8u9dImfRB4HTDjMzb0vV1CQbNBtRybc07uf2aJ76OisEpWO1YadZ44IFqL/peNKwhQesjfe0b2SqzBzTkCGsZXRtQUgtyFE5/uj/jU8RoUBiZD/gJlhKyibueueUpSFJL/RsJtPKnuAh X-Forefront-Antispam-Report: CIP:20.160.56.85;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:inpost-eu.tmcas.trendmicro.com;PTR:inpost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230025)(346002)(376002)(39850400004)(396003)(136003)(5400799012)(451199018)(36840700001)(40470700004)(46966006)(110136005)(54906003)(6486002)(36756003)(316002)(83380400001)(40480700001)(82310400005)(86362001)(966005)(336012)(6506007)(40460700003)(186003)(2906002)(82740400003)(5660300002)(4326008)(70206006)(70586007)(34020700004)(8936002)(36860700001)(41300700001)(8676002)(478600001)(47076005)(44832011)(26005)(6512007)(1076003)(2616005)(7416002)(6666004)(7596003)(356005)(7636003)(12100799021);DIR:OUT;SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 19:16:15.4974 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8789e5e4-4214-4903-2034-08db1e7741bd X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.85];Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT004.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR03MB6187 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230306_111622_482252_074CA587 X-CRM114-Status: GOOD ( 22.19 ) 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 --- (no changes since v9) Changes in v9: - Add fsl,unused-lanes-reserved to allow for a gradual transition between firmware and Linux control of the SerDes - Change phy-type back to fsl,type, as I was getting the error '#phy-cells' is a dependency of 'phy-type' 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 | 248 ++++++++++++++++++ 1 file changed, 248 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..7c364f7de85c --- /dev/null +++ b/Documentation/devicetree/bindings/phy/fsl,lynx-10g.yaml @@ -0,0 +1,248 @@ +# 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 + + fsl,unused-lanes-reserved: + $ref: /schemas/types.yaml#/definitions/flag + description: | + Unused lanes are reserved for firmware use, and should not be disabled. + Normally, groups containing unused lanes may be reconfigured or disabled + to save power. However, when this property is present, unused lanes will + not be touched until they are used by another driver. This allows + migrating from firmware control of lanes to driver control. + + Lanes not present in any group will never be modified, regardless of the + presence of this property. + + 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. + + fsl,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 + - fsl,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>; + fsl,type = ; + }; + }; + + serdes1_1: phy@1 { + #phy-cells = <0>; + reg = <1>; + + /* SGMII.5 */ + sgmii-1 { + fsl,pccr = <0x8>; + fsl,index = <1>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + }; + + serdes1_2: phy@2 { + #phy-cells = <0>; + reg = <2>; + + /* SGMII.10 */ + sgmii-2 { + fsl,pccr = <0x8>; + fsl,index = <2>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + + /* XFI.10 */ + xfi-0 { + fsl,pccr = <0xb>; + fsl,index = <0>; + fsl,cfg = <0x2>; + fsl,type = ; + }; + }; + + serdes1_3: phy@3 { + #phy-cells = <0>; + reg = <3>; + + /* SGMII.9 */ + sgmii-3 { + fsl,pccr = <0x8>; + fsl,index = <3>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + + /* XFI.9 */ + xfi-1 { + fsl,pccr = <0xb>; + fsl,index = <1>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + }; + }; +... From patchwork Mon Mar 6 19:15:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13162225 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 2EC12C64EC4 for ; Mon, 6 Mar 2023 19:17:23 +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=wJl0VlLdShS/8vyVO/lRUf8nAb6hYltnjL9RjLNSFFQ=; b=DmY7otSRbOC4nn DTeUVDBEIzxhDEdB6LdpPCZNhiQUVld3XwmWX/5+vswrN+V68pvj9z+XWWiLDTOAi3eMkWQUFnh9s tFaM+egfAKFE1w83juyT1UVWnvLvEaNnvfaEobY4zoBalbq/auxdo3FhMmfEfXan5Z4DvmvGX8RWD zpf7TQ1TBl8+1XbSy3kX245QXJJJ6IZ/GNO+9sW44+4yJa/UNT7CTpGHPmZiHcFTn8IVrAPxRnKM4 3GnLP8wvJxrSao+TYRXPCizQsFCx7rBZPOetUDTVgIqQxMbnINLAjxqh/lSHvsr7gEcDpyOOJfMUR vLrzIURMKRgPNzY2dbtg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGKo-00EWbZ-HQ; Mon, 06 Mar 2023 19:17:22 +0000 Received: from mail-db8eur05hn2032a.outbound.protection.outlook.com ([2a01:111:f400:7e1a::32a] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGJq-00EWDe-Na; Mon, 06 Mar 2023 19:16:26 +0000 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=bjIdJbt11Em2nNDRR1WPmSPj/HkLDoM613BeTOUdsHY=; b=BZKVsLlRSnPDCs8kiou/3eigngkNaYw8Y2n+JXjvDvt4dWA31d6oGB1u//5ZGZ3AJM6GUMM7lk4vxHr8XquQLgBiL0GWWWYftiTtIlgf6PpvmoHtAAUihdRURwc/4T5Lzjj56TalnOgb82CrUflWqXdRd/5FQt0wRrLIBkLEJ69IccXMKWcvkVKVzGgETiyFJKYWAdylNGgGDdGkqe7IfyH3nQapuwhyKRGdOANOoLC+5oGJ9cpYRFad90RDdVyW+VfbLqgTNf1A7+Alq4XlmAuePbmX/LTkHuEGlNg9pX26ZI/gDH2VCn2Zd5M0I950k2Zx36Q1Xi5+Bs3Z+Q06Zw== Received: from DB6PR0202CA0013.eurprd02.prod.outlook.com (2603:10a6:4:29::23) by PAWPR03MB9010.eurprd03.prod.outlook.com (2603:10a6:102:338::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.23; Mon, 6 Mar 2023 19:16:17 +0000 Received: from DB8EUR05FT033.eop-eur05.prod.protection.outlook.com (2603:10a6:4:29:cafe::de) by DB6PR0202CA0013.outlook.office365.com (2603:10a6:4:29::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28 via Frontend Transport; Mon, 6 Mar 2023 19:16:17 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 20.160.56.82) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Fail (protection.outlook.com: domain of seco.com does not designate 20.160.56.82 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.82; helo=inpost-eu.tmcas.trendmicro.com; Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.82) by DB8EUR05FT033.mail.protection.outlook.com (10.233.238.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.16 via Frontend Transport; Mon, 6 Mar 2023 19:16:17 +0000 Received: from outmta (unknown [192.168.82.133]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 38A902008088E; Mon, 6 Mar 2023 19:16:17 +0000 (UTC) Received: from EUR03-VI1-obe.outbound.protection.outlook.com (unknown [104.47.30.106]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 0FD682008006F; Mon, 6 Mar 2023 19:14:38 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ULxrQxHmh7L0hc6Z0rsnniAICdLNI9GhbqFDHbNl9uNHzE7trmJQ1klK1ynv+yjTQlBFh+zJ9LMtpwsZnRi055YiIN0sKytQZ4wO8HaqXSreh4Q7FKexhTW0Vt2ccGDdeIbiDopfSjJ2oBJQeNbgLVWTS/sXfxzbnXtMHFRUouQlie7aI840d1yAyWPSzGOA3lUzYuIgbSAunjILDlPUuTZ8t4mUyO/UBcrRMH9mjnzJBnozUq06gqJl4rqrGGo9FYZKTqA6lhxzZ5rRRcp31WXAmZAxHI6W3OMKsPabOHdhrGladZGIZge90TP8VXB+IV9OsB2WqwMPyKKhhiXyGw== 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=bjIdJbt11Em2nNDRR1WPmSPj/HkLDoM613BeTOUdsHY=; b=fm8rU1Kugp0eFg8bYqz5o/YDjyJgauRAAPu0quuNVQx/7vLuRi/+AvH9iO4jxj/cNE39mgGzkulp2dU0Nhm/Xvb3iwqlau26DVsuZJ7F9fjmNrwA2xVb8wdTqiEJFgW6aQ/0YS4IUEfuR3+07nrJRXc5i7m+Y+Ie267XtgOrX+lf9dKjKkBOVvJ0027xsmqEAhpB5HCO4hMqsn61b1Vzv4nZpWwsFrF1ZWqZY3X0I6vf0eSnyPjQaQlvKcHcHRmrU1PETAO9Sze5rHA3h4/Yh1B+n1+8XRIofkRcJ7LmG+x+ZuNvw77zLWLFW783iPJIrs5vmJySOWG8GlPaTzD+Yg== 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=bjIdJbt11Em2nNDRR1WPmSPj/HkLDoM613BeTOUdsHY=; b=BZKVsLlRSnPDCs8kiou/3eigngkNaYw8Y2n+JXjvDvt4dWA31d6oGB1u//5ZGZ3AJM6GUMM7lk4vxHr8XquQLgBiL0GWWWYftiTtIlgf6PpvmoHtAAUihdRURwc/4T5Lzjj56TalnOgb82CrUflWqXdRd/5FQt0wRrLIBkLEJ69IccXMKWcvkVKVzGgETiyFJKYWAdylNGgGDdGkqe7IfyH3nQapuwhyKRGdOANOoLC+5oGJ9cpYRFad90RDdVyW+VfbLqgTNf1A7+Alq4XlmAuePbmX/LTkHuEGlNg9pX26ZI/gDH2VCn2Zd5M0I950k2Zx36Q1Xi5+Bs3Z+Q06Zw== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by AS8PR03MB8394.eurprd03.prod.outlook.com (2603:10a6:20b:526::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.23; Mon, 6 Mar 2023 19:15:59 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e%5]) with mapi id 15.20.6156.027; Mon, 6 Mar 2023 19:15:59 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, Ioana Ciornei , Rob Herring , Camelia Alexandra Groza , linux-arm-kernel@lists.infradead.org, Bagas Sanjaya , Krzysztof Kozlowski , Sean Anderson , Bartosz Golaszewski , =?utf-8?q?Fern=C3=A1ndez_Rojas?= , Jonas Gorski , Linus Walleij , linux-gpio@vger.kernel.org Subject: [PATCH v10 03/13] dt-bindings: Convert gpio-mmio to yaml Date: Mon, 6 Mar 2023 14:15:25 -0500 Message-Id: <20230306191535.1917656-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230306191535.1917656-1-sean.anderson@seco.com> References: <20230306191535.1917656-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:208:23b::20) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS8PR03MB8394:EE_|DB8EUR05FT033:EE_|PAWPR03MB9010:EE_ X-MS-Office365-Filtering-Correlation-Id: cf954745-d480-4379-b8e6-08db1e7742ea X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: nO+5skHtvAbW7MfNMdsEZbAGZD9Hb/uxF3jDA0H0t33Tt4FH8ZOgpJeIOKEk+SeS1P/rozAlODA7Dc/ISUO4kvNK9HO1m5jwRHcn6AR7vBe8G4WStsEgrrZjESkqYKWJuB/2CRYAjLYNxW1OHatXemNGsq9sQwCWX9Bsw331ggzwWJfim/MNi9hKaSZRchBDc5hrnLsmn0z1kpr0jQ8UMVTVUST00CDlZD+DnmerxzD+SaTZ5hk0fYM4QxxnYGug95mxO3je2mFlza0Sr6/o1IDkK1p+M1+R3fWB4UzgFPfnO6rodSYVVmuSPSYrI3OkMFb1wDzXd3NjYp21DBWIl0ugEocv4HJPGTrBQR8Tb8yRV9tMBhyrbjb4S8Et1YqiIgY8U7tHkCnVLj2C7dPFRQLqlj5pRZ4USysRLPR4Cnsrz86yYWRMCdaZkt25XOFZ0n1kphIBxWnCM1apZZ4iQpBxxNJW6n0JxcC56sly4SCBWoUyAMBJHFgcasL3uZd3Apcu4i39vtVXZ2mv60DjKxtAFQbuid750V43Edk+MbtJ3R4DJHfB4IR8mow6iVGuxK73aotw52PsHUVav0I8GE+eqo/tloW75aub3ih2qHUwa8skqWfgEB7bnXRzmrJjgCAMnvdg24oXbUHOdApfGPX7riX+cYwplNFpXXSG//izJlKbnRMiVWOVXRCUhteo X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(136003)(346002)(376002)(396003)(366004)(39850400004)(451199018)(36756003)(6666004)(66574015)(110136005)(478600001)(83380400001)(52116002)(1076003)(6486002)(966005)(6506007)(26005)(186003)(6512007)(66556008)(41300700001)(2616005)(8936002)(66476007)(4326008)(8676002)(5660300002)(66946007)(44832011)(7416002)(86362001)(2906002)(54906003)(38100700002)(316002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB8394 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB8EUR05FT033.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 628ae3f9-8f68-4728-4ece-08db1e773820 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nW+oX1KY+ExbYUHZCBoeThp+Ivn0OvnmzmV+Qx+NaZYGkn7ga2rD7p1MSu/nbDkGpxNVI3WFWKhk9pRVKCJygCvE3UzEvvbu2DzeFbZPHQFqXUhT1JA+hsrLccKkofVhBTDcEVo5ydz9QuhzY2emgdGNKMcoIXIUGrY7tk70WyJ8PzTJynYxRPJpALh7nGxQ3+gjwik6M9qkAjNlqzfu43HJBlyLbUD0Pfh1UK28eV9vOYNhirLbFBbJR+z1Law7guzJ6kWifGhgbSeoIuXxLwslSkfB32TYvurU9//eLsb6iyl3w4plSYunJX75YMwq89EGTCTeRoF4MFIPYFJnPnfKkFSKn7MMNpKDngp7dSUJ2USpiQpwTsjtz/F4wnzcHw/zs5Yy6JVxy77JkPQUXh5ESI/CegTRSzYHXkk6/T2NVrS1VKchVT5394TDj+e1U4ONI0dTy68XC3fQNrIgTLwIUxq8dEEQsgl8AjsdQ6+URAHgHEquuDHD73Ugd3taJZuEJaJZVaYP/V2uS/Vwx8eq2aV31/WhEayEdaSI9sU+S5689kZvJ6pNb6pq1gNI8xTL0Crqn3RlXAdJ7pVvN2RcYd55GDYn1Wy95EOJG17q321uooFwLCjb/V6Er8tzh0xJCgjgh2hmTc57uotijlVXMeeYvyh3PKl5sS1EAQoWxqAj9hIDJd+1BGoobO4CrjLD8mOyafVZl+65Wc0p76QjjJpWiOYoowgtXMtlm1LEoC+TKOwsKOM1IVkFHzxX X-Forefront-Antispam-Report: CIP:20.160.56.82;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:inpost-eu.tmcas.trendmicro.com;PTR:inpost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230025)(346002)(396003)(376002)(136003)(39850400004)(451199018)(5400799012)(46966006)(40470700004)(36840700001)(110136005)(54906003)(36756003)(316002)(40480700001)(82310400005)(86362001)(83380400001)(26005)(6486002)(336012)(966005)(186003)(40460700003)(70206006)(5660300002)(44832011)(2906002)(70586007)(7416002)(8936002)(41300700001)(8676002)(34020700004)(82740400003)(36860700001)(4326008)(66574015)(2616005)(478600001)(6666004)(6512007)(1076003)(47076005)(6506007)(7596003)(356005)(7636003)(12100799021);DIR:OUT;SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 19:16:17.4740 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf954745-d480-4379-b8e6-08db1e7742ea X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.82];Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT033.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR03MB9010 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230306_111622_950385_63A2784E X-CRM114-Status: GOOD ( 18.23 ) 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 is a generic binding for simple MMIO GPIO controllers. Although we have a single driver for these controllers, they were previously spread over several files. Consolidate them. The register descriptions are adapted from the comments in the source. There is no set order for the registers, so I have not specified one. Signed-off-by: Sean Anderson Reviewed-by: Linus Walleij --- Changes in v10: - New .../bindings/gpio/brcm,bcm6345-gpio.yaml | 16 +-- .../devicetree/bindings/gpio/gpio-mmio.yaml | 136 ++++++++++++++++++ .../bindings/gpio/ni,169445-nand-gpio.txt | 38 ----- .../devicetree/bindings/gpio/wd,mbl-gpio.txt | 38 ----- 4 files changed, 137 insertions(+), 91 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-mmio.yaml delete mode 100644 Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt delete mode 100644 Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt diff --git a/Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml b/Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml index 4d69f79df859..e11f4af49c52 100644 --- a/Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml +++ b/Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml @@ -4,7 +4,7 @@ $id: http://devicetree.org/schemas/gpio/brcm,bcm6345-gpio.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Broadcom BCM6345 GPIO controller +title: Broadcom BCM63xx GPIO controller maintainers: - Álvaro Fernández Rojas @@ -18,8 +18,6 @@ description: |+ BCM6338 have 8-bit data and dirout registers, where GPIO state can be read and/or written, and the direction changed from input to output. - BCM6345 have 16-bit data and dirout registers, where GPIO state can be read - and/or written, and the direction changed from input to output. BCM6318, BCM6328, BCM6358, BCM6362, BCM6368 and BCM63268 have 32-bit data and dirout registers, where GPIO state can be read and/or written, and the direction changed from input to output. @@ -29,7 +27,6 @@ properties: enum: - brcm,bcm6318-gpio - brcm,bcm6328-gpio - - brcm,bcm6345-gpio - brcm,bcm6358-gpio - brcm,bcm6362-gpio - brcm,bcm6368-gpio @@ -63,17 +60,6 @@ required: additionalProperties: false examples: - - | - gpio@fffe0406 { - compatible = "brcm,bcm6345-gpio"; - reg-names = "dirout", "dat"; - reg = <0xfffe0406 2>, <0xfffe040a 2>; - native-endian; - - gpio-controller; - #gpio-cells = <2>; - }; - - | gpio@0 { compatible = "brcm,bcm63268-gpio"; diff --git a/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml b/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml new file mode 100644 index 000000000000..fd5c7055d542 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml @@ -0,0 +1,136 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/gpio-mmio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic MMIO GPIO + +maintainers: + - Linus Walleij + - Bartosz Golaszewski + +description: | + Some simple GPIO controllers may consist of a single data register or a pair + of set/clear-bit registers. Such controllers are common for glue logic in + FPGAs or ASICs. Commonly, these controllers are accessed over memory-mapped + NAND-style parallel busses. + +properties: + big-endian: + true + + compatible: + enum: + - brcm,bcm6345-gpio # Broadcom BCM6345 GPIO controller + - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller + - ni,169445-nand-gpio # National Instruments 169445 GPIO NAND controller + + '#gpio-cells': + const: 2 + + gpio-controller: + true + + reg: + minItems: 1 + description: | + A list of registers in the controller. The width of each register is + determined by its size. All registers must have the same width. The number + of GPIOs is set by the width, with bit 0 corresponding to GPIO 0. + items: + - description: | + Register to READ the value of the GPIO lines. If GPIO line is high, + the bit will be set. If the GPIO line is low, the bit will be cleared. + This register may also be used to drive GPIOs if the SET register is + omitted. + - description: | + Register to SET the value of the GPIO lines. Setting a bit in this + register will drive the GPIO line high. + - description: | + Register to CLEAR the value of the GPIO lines. Setting a bit in this + register will drive the GPIO line low. If this register is omitted, + the SET register will be used to clear the GPIO lines as well, by + actively writing the line with 0. + - description: | + Register to set the line as OUTPUT. Setting a bit in this register + will turn that line into an output line. Conversely, clearing a bit + will turn that line into an input. + - description: | + Register to set this line as INPUT. Setting a bit in this register + will turn that line into an input line. Conversely, clearing a bit + will turn that line into an output. + + reg-names: + minItems: 1 + maxItems: 5 + items: + enum: + - dat + - set + - clr + - dirout + - dirin + + native-endian: + true + + no-output: + $ref: /schemas/types.yaml#/definitions/flag + description: | + If this property is present, the controller cannot drive the GPIO lines. + +required: + - compatible + - reg + - reg-names + - '#gpio-cells' + - gpio-controller + +additionalProperties: false + +examples: + - | + nand-gpio-out@1f300010 { + compatible = "ni,169445-nand-gpio"; + reg = <0x1f300010 0x4>; + reg-names = "dat"; + gpio-controller; + #gpio-cells = <2>; + }; + + nand-gpio-in@1f300014 { + compatible = "ni,169445-nand-gpio"; + reg = <0x1f300014 0x4>; + reg-names = "dat"; + gpio-controller; + #gpio-cells = <2>; + no-output; + }; + + gpio0@e0000000 { + compatible = "wd,mbl-gpio"; + reg-names = "dat"; + reg = <0xe0000000 0x1>; + #gpio-cells = <2>; + gpio-controller; + }; + + gpio1@e0100000 { + compatible = "wd,mbl-gpio"; + reg-names = "dat"; + reg = <0xe0100000 0x1>; + #gpio-cells = <2>; + gpio-controller; + no-output; + }; + + gpio@fffe0406 { + compatible = "brcm,bcm6345-gpio"; + reg-names = "dirout", "dat"; + reg = <0xfffe0406 2>, <0xfffe040a 2>; + native-endian; + + gpio-controller; + #gpio-cells = <2>; + }; diff --git a/Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt b/Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt deleted file mode 100644 index ca2f8c745a27..000000000000 --- a/Documentation/devicetree/bindings/gpio/ni,169445-nand-gpio.txt +++ /dev/null @@ -1,38 +0,0 @@ -Bindings for the National Instruments 169445 GPIO NAND controller - -The 169445 GPIO NAND controller has two memory mapped GPIO registers, one -for input (the ready signal) and one for output (control signals). It is -intended to be used with the GPIO NAND driver. - -Required properties: - - compatible: should be "ni,169445-nand-gpio" - - reg-names: must contain - "dat" - data register - - reg: address + size pairs describing the GPIO register sets; - order must correspond with the order of entries in reg-names - - #gpio-cells: must be set to 2. The first cell is the pin number and - the second cell is used to specify the gpio polarity: - 0 = active high - 1 = active low - - gpio-controller: Marks the device node as a gpio controller. - -Optional properties: - - no-output: disables driving output on the pins - -Examples: - gpio1: nand-gpio-out@1f300010 { - compatible = "ni,169445-nand-gpio"; - reg = <0x1f300010 0x4>; - reg-names = "dat"; - gpio-controller; - #gpio-cells = <2>; - }; - - gpio2: nand-gpio-in@1f300014 { - compatible = "ni,169445-nand-gpio"; - reg = <0x1f300014 0x4>; - reg-names = "dat"; - gpio-controller; - #gpio-cells = <2>; - no-output; - }; diff --git a/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt b/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt deleted file mode 100644 index 038c3a6a1f4d..000000000000 --- a/Documentation/devicetree/bindings/gpio/wd,mbl-gpio.txt +++ /dev/null @@ -1,38 +0,0 @@ -Bindings for the Western Digital's MyBook Live memory-mapped GPIO controllers. - -The Western Digital MyBook Live has two memory-mapped GPIO controllers. -Both GPIO controller only have a single 8-bit data register, where GPIO -state can be read and/or written. - -Required properties: - - compatible: should be "wd,mbl-gpio" - - reg-names: must contain - "dat" - data register - - reg: address + size pairs describing the GPIO register sets; - order must correspond with the order of entries in reg-names - - #gpio-cells: must be set to 2. The first cell is the pin number and - the second cell is used to specify the gpio polarity: - 0 = active high - 1 = active low - - gpio-controller: Marks the device node as a gpio controller. - -Optional properties: - - no-output: GPIOs are read-only. - -Examples: - gpio0: gpio0@e0000000 { - compatible = "wd,mbl-gpio"; - reg-names = "dat"; - reg = <0xe0000000 0x1>; - #gpio-cells = <2>; - gpio-controller; - }; - - gpio1: gpio1@e0100000 { - compatible = "wd,mbl-gpio"; - reg-names = "dat"; - reg = <0xe0100000 0x1>; - #gpio-cells = <2>; - gpio-controller; - no-output; - }; From patchwork Mon Mar 6 19:15:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13162223 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 53CA3C61DA4 for ; Mon, 6 Mar 2023 19:16: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=AXSDZKB7rFsBEmROPLwJmAo2QoKl0gfpIX2lYh/2mEU=; b=UbQ1d5pTPR1NXa XOCv5Q+rYRmGPdSWIGBPV4W40jlWbFkETz7ZWBBryoHDeOYoMFGa/D+f18eURNMo3rrX1BVenXRH3 hYK4XJpkSY6n+gYsfK73y8gBu1lev8uOb58I2lv6qFqiSLYPkrCFuA9CYDXuIbJeP+kqkf6FUr0cG aBOC/MysMEj+xbn98gFCHAJgPDW5sUT3dVg+Q20NS5W3HOpdPI2jVeE2Od0BcAQZWjpicNGNJxBmR mJMlicW1vV9O6cULOv76BqIKJEonoAn5Hb7w6zIS+HEyZg8douaLkymj1BSrzcp1/L/WPfWbWz54N jtfSfdu+KLAnyF3g0eIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGKQ-00EWTu-Nh; Mon, 06 Mar 2023 19:16:58 +0000 Received: from mail-vi1eur04hn0303.outbound.protection.outlook.com ([2a01:111:f400:fe0e::303] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGJq-00EWEF-6D; Mon, 06 Mar 2023 19:16:23 +0000 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=DHGBWgkv88UgVz7sgwlz/8/wpwKwriY5+ucBim+GBZQ=; b=Bm/BMtu6LpmLUKIwSmXZ7jyjtyzGwia7SrXXjPvoVKwBZd3MIA1Xh2QuiRfbpNr7UbOS4ZyLPsWlXsJlwrwIsVou6+iuBd75raHL8+CJ8TkTd41gGbsaX6qsahn9iELngAiws6LZpp+pOcfxiuqOklKDSlXDrh/wohL0zRMZRurjWOTH9UoGtsMI1qoR3SwvW40p1kX1+urNucTVJcEGY77Eabh6yfLl9xK8DBW7Z/4nY3Mm6NQ0NNEcoU84z96TbDp42zi+GGUO0EnaTGlonXxu7ntKmp/8hqHEnZzFhhnD5ab5qJnT/siphWqAZX7cF5cJokknKFzw8+QDnAps3Q== Received: from DUZPR01CA0210.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b6::24) by DB3PR0302MB8943.eurprd03.prod.outlook.com (2603:10a6:10:432::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.25; Mon, 6 Mar 2023 19:16:17 +0000 Received: from DB8EUR05FT052.eop-eur05.prod.protection.outlook.com (2603:10a6:10:4b6:cafe::ad) by DUZPR01CA0210.outlook.office365.com (2603:10a6:10:4b6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28 via Frontend Transport; Mon, 6 Mar 2023 19:16:17 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 20.160.56.86) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Fail (protection.outlook.com: domain of seco.com does not designate 20.160.56.86 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.86; helo=inpost-eu.tmcas.trendmicro.com; Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.86) by DB8EUR05FT052.mail.protection.outlook.com (10.233.238.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.19 via Frontend Transport; Mon, 6 Mar 2023 19:16:17 +0000 Received: from outmta (unknown [192.168.82.135]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 37AC62008088D; Mon, 6 Mar 2023 19:16:17 +0000 (UTC) Received: from EUR03-VI1-obe.outbound.protection.outlook.com (unknown [104.47.30.106]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id DDA372008006F; Mon, 6 Mar 2023 19:14:38 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fNYm8vDQYTIQA4gjtsCSwcztpVVG9vfZjyY/EwisKJpBm4wdB/CVzWKSEHmAWpcUfYSU8p3IHzDVrQKvG+cBhzyfnYpXSzOKfywSjp8IaLFLksbVJMi/bg94uAYIvx0EjzCbfLHzxm6mFsIJ4DDnexS3bOg0bAdrTPpdrGCfz7jXRLZafmVwefcRVuJavKbAFphTlXHjlojIQGy6l6BtNNWrnstPLtgM2LjKvUm0/rsqDv1DDD27k7ma+zC2tjbDkI/KI3+EYj249K5ISY5bChgzcuXbtVY+lEYXUZak+4v79I0giV5uJ7Wn9A96BV907/739M1tiZzt+W0mF3+PqA== 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=DHGBWgkv88UgVz7sgwlz/8/wpwKwriY5+ucBim+GBZQ=; b=Y44NgtDTkZqt5QbEeG5m60YZay+p4dSEAdoNI7DgX2CAtB3odTVQuc3IxNlwukBChCft1c1cs9D497Wk+0LP5NCaUUJFTLgdFin5gaP8aNlgVAznlqhKmj3oqd200lWmCBbAEFfyTqgmXE4Nb5bStXUATCN1psy2bmR4wYy6efUwpUhQ4E0VG04L5aiwu/6mDLUvFqMbPh4rsOZa8AiVla3vHyTBO5gDdtMzjdjzP9lDPJ50+VZK6ASZ9+yfw5mr9B7n1xENBggs3gGSpBVmd8zjZIYDLyk0szsoeawQiZsa9hFQGEAkF2+n7PFt/Q5V/+h5SeShh3SP4TxlzZXgQw== 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=DHGBWgkv88UgVz7sgwlz/8/wpwKwriY5+ucBim+GBZQ=; b=Bm/BMtu6LpmLUKIwSmXZ7jyjtyzGwia7SrXXjPvoVKwBZd3MIA1Xh2QuiRfbpNr7UbOS4ZyLPsWlXsJlwrwIsVou6+iuBd75raHL8+CJ8TkTd41gGbsaX6qsahn9iELngAiws6LZpp+pOcfxiuqOklKDSlXDrh/wohL0zRMZRurjWOTH9UoGtsMI1qoR3SwvW40p1kX1+urNucTVJcEGY77Eabh6yfLl9xK8DBW7Z/4nY3Mm6NQ0NNEcoU84z96TbDp42zi+GGUO0EnaTGlonXxu7ntKmp/8hqHEnZzFhhnD5ab5qJnT/siphWqAZX7cF5cJokknKFzw8+QDnAps3Q== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by AS8PR03MB8394.eurprd03.prod.outlook.com (2603:10a6:20b:526::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.23; Mon, 6 Mar 2023 19:16:01 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e%5]) with mapi id 15.20.6156.027; Mon, 6 Mar 2023 19:16:01 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, Ioana Ciornei , Rob Herring , Camelia Alexandra Groza , linux-arm-kernel@lists.infradead.org, Bagas Sanjaya , Krzysztof Kozlowski , Sean Anderson Subject: [PATCH v10 04/13] dt-bindings: gpio-mmio: Add compatible for QIXIS Date: Mon, 6 Mar 2023 14:15:26 -0500 Message-Id: <20230306191535.1917656-5-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230306191535.1917656-1-sean.anderson@seco.com> References: <20230306191535.1917656-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:208:23b::20) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS8PR03MB8394:EE_|DB8EUR05FT052:EE_|DB3PR0302MB8943:EE_ X-MS-Office365-Filtering-Correlation-Id: 57faa098-f965-4cb4-12ae-08db1e774308 X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ar4yQ2OeuSwpC1ANgLbwGndKWSZOKE2I7jgom6O84MhTu5t7LSdbFmEuGu3rxVTViLNSLTg0elugghRx863pQYhtn74N8NJ3wGWqXKthgGPdznViqf0/DfODBsTp5n4c+725IdDIE8QABAUwHeSNtRRSe4hf1R6Aul9yCaIy4iWzYBAEs2E+xGmWx6v2h95y/bmid9E2X5dDSr0hTpzKRhAEGWIlnZsbb3JIt1F5+vD3L9K4Q18o80HJY2rVsKpWFLTPT6KkHnsUoarv/bQkdvheBUSarTBn8MTwovOkxISkbxPK16A33difnNBqvU/oGc2UxUKx0S1OiviF7wFoEoqOjrVhUOh+ReIWL8gDVEWecHDvyu8Akk+jmzH1goo0HL1XT0i3CwGOQ3z0Y7YtIFjGiHmDKWLRdLE4Fh99+QiHeU9g8S5ctuuD65PJsxi0t91XdGdyiM2sYbsX+h03EbHI6xXlMU9dcZdrPf9nZJh3mCJdtx5amNqijay3Djta6KMCzNLUe3qs2u6dMSwpRZduWtU+1SxmhOfLwRBkv347/wiw0mmnTltNnNh0m6tGJQsrr3YEuqWYcKs2WW36HRk9EW6aACDQTnl6LgTA4obbiqA6A58JnxM1pL7o0t3SG7geFK5XDJLC3hre7DPg8+sJmhBcRrhVYJMD26RaIwwNjraw+zUOuEw8e5Fy/qGFla1LrZMPE8qLJ3vBoCRFdQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(136003)(346002)(376002)(396003)(366004)(39850400004)(451199018)(36756003)(6666004)(107886003)(110136005)(478600001)(83380400001)(52116002)(1076003)(6486002)(6506007)(26005)(186003)(6512007)(66556008)(41300700001)(2616005)(8936002)(66476007)(4326008)(8676002)(5660300002)(66946007)(44832011)(7416002)(86362001)(2906002)(54906003)(38100700002)(316002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB8394 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB8EUR05FT052.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a1563191-338c-49c8-7257-08db1e773913 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f6/XxQlAel08HHIi53oR4vO23C2La0qaD61keHgkkkaqC8kVbEOUNLseHE32fVcPTzEJFpwLbyD1oGy+ap4Zg3TOXQVyXFrcYIbJ2VkhL3gUpptMCRvyVlErgA5swiUKa+6GIfemjt+mPC4C+HoWq7YDnyLj/mf56KbeEoN/UMqvNRRl0o5C+QB3MHio+T7PZIn+ig4EPa590xFAofktwRNZEt/1hZL4hIliu/Wnos/u2699wOwTS9F0GOMo3WTE18ep50i3xcAPmEIWC5UU+mPKCDoQsiQjySTiNMNbvsUHuIejPJ/djvhAECCbrvo21U+FmT+k01zAmkfgle9CVixnhHSPXYrewytu8IeCmbXxiWA8HBi2WN1JxfDT/XUgUW3C2VQhVARJaeY/HKC/KAcQZcJLUiLsTJbNluBjoAuYbppaOkFknUPBs7T9LqPpOtLb7vD6AK60iPbVuF7+0ssRd7+kQeIpPDUedCWadoI+5qR8CprK0CkmTJG2DUUqxTEocRFvXpfgwWXQrHHo/MW07n8GPXmafOOMjC1RWAQ7gktgiABKZqDBs1FYZtw2qjdt/PV7x5/UEbctBZiF7Zw2eSy7kMUWV57BSkQn9Fm2uINWoYTNc0HAs9hRjWKPjLNuAkBg/0I219BEphroK+Tn9Z8UsB0KN2SIvonyxDX306xGIfkmXaLAAqjIcXdQsusAILnueuZc2JVY9bIBZtJfbt6ugoFVtmHz1gnH914= X-Forefront-Antispam-Report: CIP:20.160.56.86;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:inpost-eu.tmcas.trendmicro.com;PTR:inpost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230025)(136003)(39850400004)(396003)(346002)(376002)(451199018)(5400799012)(36840700001)(46966006)(186003)(82740400003)(6666004)(356005)(7596003)(7636003)(8936002)(41300700001)(34020700004)(8676002)(36860700001)(70586007)(2906002)(5660300002)(44832011)(70206006)(1076003)(26005)(7416002)(478600001)(47076005)(6506007)(6512007)(107886003)(4326008)(2616005)(6486002)(86362001)(36756003)(316002)(110136005)(54906003)(40480700001)(82310400005)(83380400001)(336012)(12100799021);DIR:OUT;SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 19:16:17.6663 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57faa098-f965-4cb4-12ae-08db1e774308 X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.86];Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT052.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB8943 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230306_111622_359038_EA95C064 X-CRM114-Status: UNSURE ( 6.01 ) 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 NXP has a "QIXIS" FPGA on several of their reference design boards. On the LS1088ARDB there are several registers which control GPIOs. These can be modeled with the MMIO GPIO driver. Signed-off-by: Sean Anderson Reviewed-by: Rob Herring --- Changes in v10: - New .../devicetree/bindings/gpio/gpio-mmio.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml b/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml index fd5c7055d542..a00a249e17cb 100644 --- a/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml +++ b/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml @@ -21,10 +21,16 @@ properties: true compatible: - enum: - - brcm,bcm6345-gpio # Broadcom BCM6345 GPIO controller - - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller - - ni,169445-nand-gpio # National Instruments 169445 GPIO NAND controller + oneOf: + - enum: + - brcm,bcm6345-gpio # Broadcom BCM6345 GPIO controller + - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller + - ni,169445-nand-gpio # National Instruments 169445 GPIO NAND controller + - items: + - enum: + - fsl,fpga-qixis-los-stat + - fsl,fpga-qixis-brdcfg9 + - const: ni,169445-nand-gpio '#gpio-cells': const: 2 From patchwork Mon Mar 6 19:15:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13162221 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 7A473C6FD1D for ; Mon, 6 Mar 2023 19:16: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=OILcQGnJNIYL3R5ubpVCCemczVkIiMa3PbNAaDL+UdA=; b=4omy8L4ocQdDAJ zSAsgedN1QcyZqWTRfzFkUQmpixADqTTe0zOvm3nMSaeDcrGttDpRZ+sa7Wk73BdU+732YW+WYDNL 8sMs4bHh9hWUyCiSww1Z2XuB/WDdEMVaswezXm82zgQal47sADSBaJp/9m4OuIcBO8dylPoH5zzhT ypYhwz6dPV5bHJy56Gl7W/zXcVRmVB/H95azanFP8x7TIf0AoP0Gv1pkt9zgPLuIqDS1Ap8vKP0vL gPF1iwk0dqQoOguk130AiE8LS3Cm+W1dKdJJnECVcJG/eIjl5N7oiAsN8tIcMxP6+je5s/78iFuxx bIOOavTBWt6okQ2Ix79Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGK5-00EWM3-RZ; Mon, 06 Mar 2023 19:16:37 +0000 Received: from mail-vi1eur05hn20305.outbound.protection.outlook.com ([2a01:111:f400:7d00::305] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGJn-00EWDF-80; Mon, 06 Mar 2023 19:16:21 +0000 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=VJTwDkzk0UwCeNUB9U1vfq9kLn2UP5Gr4TXAbLhjnW/6UMyyPguGV4qqFQw8S1qq01J9a9IDOfaj+LFDcx1iBuUtYFLelQ8aLmeB6z974KOHmm9R1GN1qbH3jDkL0M55vwzD+puDcSYgoAw6u0jp6pXbV1/XHR/xeOfF5ys6hmPLvfiShWxM+3XI0ymqM8tPL8xY+FXhoJ0oA3x6dCHHm6YOV045EZ6CmOioz20XT786Ja0/MehpS1kBtkMLVs3U8fVa1GzZUGFGSTtmbwIvFMBgSC7jBxFN/LlVO0TT5GAC5ZSdZJ/Mbl3dXr3TfA72cOw3a53EYbcoRplGNQGEvA== Received: from AM6P192CA0072.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:82::49) by PA4PR03MB8224.eurprd03.prod.outlook.com (2603:10a6:102:26e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:13 +0000 Received: from AM6EUR05FT006.eop-eur05.prod.protection.outlook.com (2603:10a6:209:82:cafe::9) by AM6P192CA0072.outlook.office365.com (2603:10a6:209:82::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28 via Frontend Transport; Mon, 6 Mar 2023 19:16:13 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 20.160.56.83) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Fail (protection.outlook.com: domain of seco.com does not designate 20.160.56.83 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.83; helo=inpost-eu.tmcas.trendmicro.com; Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.83) by AM6EUR05FT006.mail.protection.outlook.com (10.233.241.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.16 via Frontend Transport; Mon, 6 Mar 2023 19:16:13 +0000 Received: from outmta (unknown [192.168.82.132]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id EAAC82008026C; Mon, 6 Mar 2023 19:16:12 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [104.47.17.177]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 9D0D62008006F; Mon, 6 Mar 2023 19:15:13 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XiK5d2GtXaSoZ07NB2xysc4rCsLG3ldOSU0BVo4jk5m9iUdGPswnxSUHejOAFAqpuUsdp0dTh7Rmbm/dFiwTodysfXTs6qMW9mifAUK5yxM4MnLmbbTvajpPE+WIQMvFM1SGmwWmfekz16PDZEBUO2ltPl2UFhfsKSDM3fSLBPKq/0HVoD2WE8+cLPewBqFPQ4rOFYId2+q9QSVt6urXlOEjsNEVbaUiH0dbX3dnqt7JkK93MJXlaze46ZImc0G3H61hk0UWBZPAizTP+tYVKU01hHMhXHmQpIHP5Q2K6euTPYCJsKTpaZl7KOnqlY85o/l/lKTxidgu4k23fMFlMg== 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=P2cHHyiXGmCMuAhSyCcjtYqFSlCAwaIGVkIruXnzDfo5DIDgrjvuVc+zGnWQ4IDVBMkqi/urWONaH+WZVWYh9fjNONiAes+EuM42W/w2ZoNQqZNG+S+h7uc0iDI+wTJfwui13ycIwmiK8M0al+ODFa9vd/XVhy2bZSZOHRiJQjFXKRcdNEPX/NSMWhQR88V3BWBohwh0DTfTp77qjvBYkSTxPBd8VrV8vhqpGMwd2ODQtQrp3ziZ6V1axntAJoKsGhPTmB7tuLWPwHqzGkHHCkeHbcSYKXFvyHWt7/1yfYu6XrEJ4ct6oknr5XaHwAK/hOcnjM/W0TEItv4bdEOrSw== 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=VJTwDkzk0UwCeNUB9U1vfq9kLn2UP5Gr4TXAbLhjnW/6UMyyPguGV4qqFQw8S1qq01J9a9IDOfaj+LFDcx1iBuUtYFLelQ8aLmeB6z974KOHmm9R1GN1qbH3jDkL0M55vwzD+puDcSYgoAw6u0jp6pXbV1/XHR/xeOfF5ys6hmPLvfiShWxM+3XI0ymqM8tPL8xY+FXhoJ0oA3x6dCHHm6YOV045EZ6CmOioz20XT786Ja0/MehpS1kBtkMLVs3U8fVa1GzZUGFGSTtmbwIvFMBgSC7jBxFN/LlVO0TT5GAC5ZSdZJ/Mbl3dXr3TfA72cOw3a53EYbcoRplGNQGEvA== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by AS8PR03MB9511.eurprd03.prod.outlook.com (2603:10a6:20b:5a6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:03 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e%5]) with mapi id 15.20.6156.027; Mon, 6 Mar 2023 19:16:03 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, Ioana Ciornei , Rob Herring , Camelia Alexandra Groza , linux-arm-kernel@lists.infradead.org, Bagas Sanjaya , Krzysztof Kozlowski , Sean Anderson , Rob Herring , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org Subject: [PATCH v10 05/13] dt-bindings: clock: Add ids for Lynx 10g PLLs Date: Mon, 6 Mar 2023 14:15:27 -0500 Message-Id: <20230306191535.1917656-6-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230306191535.1917656-1-sean.anderson@seco.com> References: <20230306191535.1917656-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:208:23b::20) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS8PR03MB9511:EE_|AM6EUR05FT006:EE_|PA4PR03MB8224:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a8c0b28-95e9-45e8-c3d6-08db1e774042 X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: /kOnJjo4mIs7IotZ5j7wse/uABanvMLHKvVsLwWYLrjufQrxadeg+0rEkfePgxu3wAm9MVeUfHz7kh/m6f8xFYU0UwsH2o9UDDAojU1afFqusxz7xtfmrZxS1lZay8DNxujHH6ExYYwYGxL7XiqL4FexsdDpGt+vmIyolPZgJW9D6RTbraGWR6q1sMYNoifd0J9OkJvPZVnJWCvKj7sOO1Vt6kaNicAvv8K0RsZ5PXHeoJRXjr5too/RTNO5sfIlpyzweootMlqvutxkICo2RHMqJLD51gWfUpJ20/pkL8rFXmhVSrwHfubS1B/+vfrnZlrbPbLi7kD+61YqrvoXW7slQT9fbSDtHcJS5ZsA5bPYgV0gbO5HjaDSrf0OEuuzElPapNnfzFEgUx/d8w5vCNFzbQo+hdLMx+MBiRQvKg5KR5F73t9ip0jSJofDWRivrRSd7oF9MWHP2IACooE6K36iheyHygfYvamlA3IKd7UGAMMu02TfjwdnZgK+Nyt2Ml5RQvK2RHyYwsod9/yQ8rsHpokK/PG3joOksAxBrR2a54yXzxCqwtj+hHgFzUDzHZ9Pgj2M8KifaYDwPFpdLvJ6wyrPdj5rRsgMrg2/zmqYl9hZmAYcXIV1rZRDoA3grzE3GDgeG0kYEwS2fmuYoLutgaUBwE+I509sCogBeNKVWT2G5y0LTX7qXpP4SBNQwWu8G0oyjkii+cSFxYn3JA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(346002)(376002)(39850400004)(396003)(136003)(366004)(451199018)(110136005)(54906003)(36756003)(316002)(83380400001)(86362001)(6486002)(6506007)(186003)(2906002)(5660300002)(66476007)(4326008)(8936002)(66946007)(41300700001)(8676002)(478600001)(44832011)(26005)(6512007)(1076003)(2616005)(7416002)(52116002)(66556008)(6666004)(38100700002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9511 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM6EUR05FT006.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 12d1f6bc-a45c-4cbd-4374-08db1e773a2a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0FJDGNsiuKWewzLykns0u7jA0SqHv3AnaVrIstmylST4NNt4nyqdosH8731nCC5iGimInG5Hn42KpaGgY1O2jRNl7qvKYif1F0mbA9q8CfxM+DXusAgkBteD2J/0drfzdW4zturkdG+HSEBd6Kqp6oiafC3CjHvSyKUyQ5J8Vfrpp88GG3ZHdK2NFsMs+zO72Mj+87KM1EzHEryqZR2CzVwCYWlRHcOPrkK9h0QwsIr/Xu/p3F9Gn62vRNoDpXoygUfSidqCz5LXHYkDfLjdRFIpCM4uJPWcpzZOJhrMMUfDgB1XvlFDaB8KxAWzECJxHUPW5H4ZroORe0MYX0KsBfzhaJlp7N0CSG60X0fy2jIMEquNrwUpc8Deln2Qo4yq/6z/LH4WRCAgrN/PN8EESQPtbsVMs+2zb7sxXcZw7L2eyHEOWK1wRvrpLeunDvoYWWoRjSxqQdCzlU6ZLs1CEYvAsPv7nDWjtvVyXuYUlzi4SO61M8XWBwz6aKjHCD6rzRsesIqIpYCpGIsjEjpHUrqckVRUGDrdNst86cYVv9kEuA4dOee0/LQda5QZKd/Z/gR4bBtqIoy2I8mTXzDw1ONHq3FrlM6WLYKSHMbyjv2o102qqncynG8o2pyidbwWCnNe+sa/zJ77hmL74VGVM9oziOnUiHhNyliqx6RFMB9OZI2mXBDz/n6pLX5tmJUZz9VgssAOACL9yBPggeYzZvxinzPRBGJUoyMfyyl1oFYSf7ew1YdnNZyjxcgCxGn9e5FMNSR9RMPa5Q5MGZR76w== X-Forefront-Antispam-Report: CIP:20.160.56.83;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:inpost-eu.tmcas.trendmicro.com;PTR:inpost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230025)(39850400004)(396003)(376002)(136003)(346002)(451199018)(5400799012)(46966006)(40470700004)(36840700001)(36860700001)(34020700004)(7636003)(356005)(86362001)(7596003)(82740400003)(36756003)(7416002)(2906002)(44832011)(5660300002)(4326008)(70586007)(70206006)(40480700001)(8936002)(8676002)(41300700001)(82310400005)(40460700003)(336012)(2616005)(186003)(26005)(47076005)(6506007)(6512007)(83380400001)(110136005)(478600001)(316002)(6666004)(6486002)(1076003)(54906003)(12100799021);DIR:OUT;SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 19:16:13.0647 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2a8c0b28-95e9-45e8-c3d6-08db1e774042 X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.83];Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: AM6EUR05FT006.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB8224 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230306_111619_852611_A7BD0BE8 X-CRM114-Status: GOOD ( 11.53 ) 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 --- (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 Mon Mar 6 19:15:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13162231 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 37F95C6FD1B for ; Mon, 6 Mar 2023 19:19:26 +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=8uWmWk2tba0UdEdtgdMAsPLL9bLRR87cvu6K7f9we/A=; b=gCeMCv4tj76f6G gxusJkYNeqFQssq4tInsiAc4MK3brkvN93eWD/iK2cBiX+5TYaJmLxqHfhcI6IIn6xdSbVI4/LEnk gmZur8XLyrRpp7IHGUcPy9yjvPnO3fgcghsNjYr6PJNY6ZLDzFPTa6WKgV46DIh8PXwE/0C3lAsxP +SEJpZqHVFVmF+l8ER/6cp//i47tzYSOMVSTWptvTXcHkoBH2OmPY3loL2qgU1sjA0UvW+Ed/yRfX Q/knWtzzSbua1qR5gEApeCoz6scldAKNAmdlcRkCgWvJSFA0ACofADIJ51eHWF3bL45VZzqSjF3oO bpGj/cdZlhZHvJzTFN0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGMn-00EXQ3-5L; Mon, 06 Mar 2023 19:19:25 +0000 Received: from mail-am6eur05hn2031a.outbound.protection.outlook.com ([2a01:111:f400:7e1b::31a] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGJr-00EWEA-Gs; Mon, 06 Mar 2023 19:16:27 +0000 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=kaiK1l+eWgfWwM0AJjH2lG+S83FCq+JF1QqFDPdMW24=; b=rhpPnw17KGZbuqgf8wD200OQqZ8rzotNyILc4Hzeeitgn5QripcRJog9H1xPxFy22PcgQaZXoX+O1nyNhkUgpGEYt2LaVnSENpC5vwaInFOqghPyV5oGmHfxjIRIwicgz4k7B5ZKQIW9DRQAyCj9ItQSPKZ+qFB+9jK03zkX2ZroK3P/bz/F9lpmn5g9Uuiz0rScEacJrnK8OMl9wqVfJ0aR2zyjH06rFFtRAyAw6PXRpewMEXQphLLWW/+yVCViuCRruBqdj5+94U5Mg4bdS5QxwUsearYQiNQ6jQMVDo46E82vylhZpS3B1tf6T2r+uelVjPaTLN2rOScQNwN10g== Received: from AM5PR0602CA0006.eurprd06.prod.outlook.com (2603:10a6:203:a3::16) by AM7PR03MB6277.eurprd03.prod.outlook.com (2603:10a6:20b:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Mon, 6 Mar 2023 19:16:18 +0000 Received: from AM6EUR05FT058.eop-eur05.prod.protection.outlook.com (2603:10a6:203:a3:cafe::75) by AM5PR0602CA0006.outlook.office365.com (2603:10a6:203:a3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28 via Frontend Transport; Mon, 6 Mar 2023 19:16:18 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 20.160.56.86) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Fail (protection.outlook.com: domain of seco.com does not designate 20.160.56.86 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.86; helo=inpost-eu.tmcas.trendmicro.com; Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.86) by AM6EUR05FT058.mail.protection.outlook.com (10.233.240.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.16 via Frontend Transport; Mon, 6 Mar 2023 19:16:18 +0000 Received: from outmta (unknown [192.168.82.132]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 01CBC20080270; Mon, 6 Mar 2023 19:16:18 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [104.47.17.177]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 6361920080074; Mon, 6 Mar 2023 19:15:15 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fAMAHR//F35YzHh4HMHE4wAR1sOzd6qBlnCXHeVJxZ1CGUVOiGb/+DLR6FbzGUVImlBEiF+zoD0jAkjaY9MqekrygUZ1tDb85jtXoYmprQA9nS8zCa3JKmG8agJxqH0vvAyVYdbVBNp8sgZnL3gXCQrnnY8Uv8iohj1v4y8/HuTuB3SyMomXZRvpmvU6M/NQGkaik5zjDQeZPl0ADG2yKHwUwGdwSjpXFP4wB3vHaOsf+IL+YplwKNOkHGRWPORTzVTFVRA8i8kdcG0YI9jwYiZGq7FRm+Uh34UxK192jQVIzzGycProwkzGKNCNH0EW8uLzEMIE1TcacH1a7QFr+w== 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=kaiK1l+eWgfWwM0AJjH2lG+S83FCq+JF1QqFDPdMW24=; b=nXCwgpJid2P4jDc28EPLhs+iOvGiNGYMVBsxF7J9WtmYG53euPPTlSJYG7IejZe44483ZSr4WqLagRV+LUHIbi6Z7OjrOXuiJ3ugIlL+TLmb7qo6MqYxbORXva9Or2hmmrWzYQJQggav9IA6hdKjctvsiDIwCdmcq+lFIexxRVYf21D3aAIy4yzfvFgYIRQgGd6qtaTJ/cEjpCZHfXNVwHahl+fNumVyNWqS48rgf9ODbq04mV436iROi74FhBPG3lV5bXneBsVHvUMPuSMRufmGg3opcRhepVt5ApZBbkhxHAsvDiepyoOF+u0Eer+M7UnOvL9zIAYpIhsaKaJXkg== 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=kaiK1l+eWgfWwM0AJjH2lG+S83FCq+JF1QqFDPdMW24=; b=rhpPnw17KGZbuqgf8wD200OQqZ8rzotNyILc4Hzeeitgn5QripcRJog9H1xPxFy22PcgQaZXoX+O1nyNhkUgpGEYt2LaVnSENpC5vwaInFOqghPyV5oGmHfxjIRIwicgz4k7B5ZKQIW9DRQAyCj9ItQSPKZ+qFB+9jK03zkX2ZroK3P/bz/F9lpmn5g9Uuiz0rScEacJrnK8OMl9wqVfJ0aR2zyjH06rFFtRAyAw6PXRpewMEXQphLLWW/+yVCViuCRruBqdj5+94U5Mg4bdS5QxwUsearYQiNQ6jQMVDo46E82vylhZpS3B1tf6T2r+uelVjPaTLN2rOScQNwN10g== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by AS8PR03MB9511.eurprd03.prod.outlook.com (2603:10a6:20b:5a6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:04 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e%5]) with mapi id 15.20.6156.027; Mon, 6 Mar 2023 19:16:04 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, Ioana Ciornei , Rob Herring , Camelia Alexandra Groza , linux-arm-kernel@lists.infradead.org, Bagas Sanjaya , Krzysztof Kozlowski , Sean Anderson , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org Subject: [PATCH v10 06/13] clk: Add Lynx 10G SerDes PLL driver Date: Mon, 6 Mar 2023 14:15:28 -0500 Message-Id: <20230306191535.1917656-7-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230306191535.1917656-1-sean.anderson@seco.com> References: <20230306191535.1917656-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:208:23b::20) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS8PR03MB9511:EE_|AM6EUR05FT058:EE_|AM7PR03MB6277:EE_ X-MS-Office365-Filtering-Correlation-Id: f41a3575-7a09-43d0-624e-08db1e774346 X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: UnbpdiJuVqPg+ClPIKKj8gSPHEkjbIYcJIR7wsubHH8IuTitqGqqEUVyKOP2HhUNV31EWBu845+f8yRfh90U4ZcoB/C5XIPWV15tCB/CTSUsUEXBHvK+Xw8TlQmPjvxt03UQ99ELokD5ph7N+cPiALD6nLpYPwaSkwcCWPqvqlxNa15+k29uUiGs8yrNIjVXaaDGTwqVAEzLarjpHTKxb6WfTsSPk5pESAOPUGQfmLWKBT5iii0VTVmxUnPO3BqhuB+bHxlqmWw1ZVFcMDOYl5LUC39gnsUmzvqsyufamRYURNy2dFi0chbjTZNJYc/GkJt/qG2UoEPiMT1FvuQKmh6ookpWFIj8dIctB9v+KLx6Zxu3aB5pMJ9d4kcp4GXdefsrH4Pni2a6pMgNl2X027SNfjZ/7HEfVD3SSd0UYwp6c7UO3lGtG+dHz2Cl0PLXl3epWnyeo+NIEtOhmYNFZNRGvdgtsEm6len+JGMT49t9myKfZjvLzg4puDo8dahFC2Gt+633U6OzXuDumZVO1suM4/BeZN2r2b4D4IwsxXOxHkivZknrXdydb+aRdgSD+kgXMCIEI9t4Kc+A9jFK8L85D3rRyZ+3i+hMLymu6UFSDsvqgBOaBOR8h4jwbNgjg457E7coiE7UebMLM1gipkcZiRUTVVk7349KO5hCUJUAMQt93/k9+GW5hzLbtw6GwwUzeKtjwYgRWoYCeP/s/Q== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(346002)(376002)(39850400004)(396003)(136003)(366004)(451199018)(66899018)(110136005)(54906003)(966005)(36756003)(316002)(83380400001)(86362001)(6486002)(6506007)(186003)(2906002)(5660300002)(66476007)(4326008)(30864003)(8936002)(66946007)(41300700001)(8676002)(478600001)(44832011)(26005)(6512007)(1076003)(2616005)(7416002)(52116002)(66556008)(6666004)(38100700002)(38350700002)(21314003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9511 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM6EUR05FT058.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d223b684-8dd2-48d6-6a3f-08db1e773b35 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9VlADSEOqxBVl1/EshM6xUhVvDtHNwiQ7Jzmv/aJav4VLudHooeRmETDyWA8K/MhxOd67SIedKG/IBq2AhanxIn79ap80qaGCsKp4RTMzT4rw9Xg+FLgOIG5DrLsUnNIJs6+P+bopO9m8tdJpGjhe+JMO38z2UgGBwbh5tIGl/cKUGhwJf4K0SlvS7QoGYImcehNd8RHXjQv0tDvHbNzlJK9vqvyZBnCpb12T6ssPBjmkEWMWvetI9bQ7CIsqQIa99eWf6RURH/sADGJgWCU7XjaQPz4IJCnJkUwqZ9TZC37HsnF1DxHT7RogGj5fvmH80kBl/k39wgtlClIJTSZ9kSSK3nuvxXnShFONQjyogfSvSD+giLE/loI33jOXQNvUU1HP5oGKnVrgonMdXQmPUqLuDfyF9+K1BpP78tYO8uiisGl4lYNLs0cM7vOpKGRSQSvLCI0PBsEWzG7Nu50QyO30Q81IS+4qrQoebL+hHNuZhbHY5kEkcAZj74sVCeFAa/7w4PLqEGMaE9GDvdrMIpXc7qIuDpYwwnBQoEbECO6kmir7N+kvJeK+1jg5QPO7VeL+iyZLA6abH2/CpDf/NBf5gl1k94yRPAy8dyQeHZRwYnm5/dwItbEPqlu0y+ctpCRpLQ64YCaGxM4EzI+66PL4DW0pxGKm20yAigUxqkjnE3Lzem3gsoMFWhN+c5aN829YSNjPVHdNnvJFVbIl5EUfigzzoDbTYsfmg/CfR3Y5ECDRDbSNEJ0RgJsDs14 X-Forefront-Antispam-Report: CIP:20.160.56.86;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:inpost-eu.tmcas.trendmicro.com;PTR:inpost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230025)(136003)(396003)(39850400004)(346002)(376002)(451199018)(5400799012)(46966006)(36840700001)(66899018)(36756003)(4326008)(70586007)(70206006)(41300700001)(40480700001)(8676002)(8936002)(44832011)(6506007)(5660300002)(7416002)(30864003)(2906002)(356005)(86362001)(36860700001)(7636003)(7596003)(82740400003)(34020700004)(6666004)(1076003)(26005)(6486002)(966005)(478600001)(54906003)(110136005)(6512007)(316002)(82310400005)(83380400001)(47076005)(336012)(2616005)(186003)(21314003)(12100799021);DIR:OUT;SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 19:16:18.1059 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f41a3575-7a09-43d0-624e-08db1e774346 X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.86];Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: AM6EUR05FT058.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR03MB6277 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230306_111623_755463_1FB629FB X-CRM114-Status: GOOD ( 25.69 ) 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 PLLs found in Lynx 10G "SerDes" devices found on various NXP QorIQ SoCs. There are two PLLs in each SerDes. This driver has been split from the main PHY driver to allow for better review, even though these PLLs are not present anywhere else besides the SerDes. An auxiliary device is not used as it offers no benefits over a function call (and there is no need to have a separate device). The PLLs are modeled as clocks proper to let 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. Signed-off-by: Sean Anderson --- Changes in v10: - Remove unnecessary inclusion of clk.h - Don't gate clocks in compatibility mode Changes in v9: - Convert some u32s to unsigned long to match arguments - Switch from round_rate to determine_rate - Drop explicit reference to reference clock - Use .parent_names when requesting parents - Use devm_clk_hw_get_clk to pass clocks back to serdes - Fix indentation - Split off from following patch to allow for better review MAINTAINERS | 7 + drivers/clk/Makefile | 1 + drivers/clk/clk-fsl-lynx-10g.c | 510 +++++++++++++++++++++++++++++++++ drivers/phy/freescale/Kconfig | 6 + include/linux/phy/lynx-10g.h | 16 ++ 5 files changed, 540 insertions(+) create mode 100644 drivers/clk/clk-fsl-lynx-10g.c create mode 100644 include/linux/phy/lynx-10g.h diff --git a/MAINTAINERS b/MAINTAINERS index edd3d562beee..e964fac26a05 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12207,6 +12207,13 @@ S: Maintained W: http://linux-test-project.github.io/ T: git https://github.com/linux-test-project/ltp.git +LYNX 10G SERDES DRIVER +M: Sean Anderson +S: Maintained +F: drivers/clk/clk-fsl-lynx-10g.c +F: include/dt-bindings/clock/fsl,lynx-10g.h +F: include/linux/phy/lynx-10g.h + LYNX 28G SERDES PHY DRIVER M: Ioana Ciornei L: netdev@vger.kernel.org diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index e3ca0d058a25..eebed69f6c58 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -33,6 +33,7 @@ obj-$(CONFIG_ARCH_SPARX5) += clk-sparx5.o obj-$(CONFIG_COMMON_CLK_EN7523) += clk-en7523.o obj-$(CONFIG_COMMON_CLK_FIXED_MMIO) += clk-fixed-mmio.o obj-$(CONFIG_COMMON_CLK_FSL_FLEXSPI) += clk-fsl-flexspi.o +obj-$(CONFIG_PHY_FSL_LYNX_10G) += clk-fsl-lynx-10g.o obj-$(CONFIG_COMMON_CLK_FSL_SAI) += clk-fsl-sai.o obj-$(CONFIG_COMMON_CLK_GEMINI) += clk-gemini.o obj-$(CONFIG_COMMON_CLK_ASPEED) += clk-aspeed.o diff --git a/drivers/clk/clk-fsl-lynx-10g.c b/drivers/clk/clk-fsl-lynx-10g.c new file mode 100644 index 000000000000..78357303b578 --- /dev/null +++ b/drivers/clk/clk-fsl-lynx-10g.c @@ -0,0 +1,510 @@ +// 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 + +#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 + * @dev: The serdes device + * @regmap: Our registers + * @idx: Which PLL this clock is for + */ +struct lynx_clk { + struct clk_hw pll, ex_dly; + 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 unsigned long 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(unsigned long rate) +{ + int ret; + + for (ret = 0; ret < ARRAY_SIZE(rfclk_sel_map); ret++) { + unsigned long rfclk_rate = rfclk_sel_map[ret]; + /* Allow an error of 100ppm */ + unsigned long error = rfclk_rate / 10000; + + if (abs(rate - rfclk_rate) < error) + return ret; + } + + return -EINVAL; +} + +static const unsigned long 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(unsigned long 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 int lynx_pll_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) +{ + 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)req->rate * HZ_PER_KHZ, req->best_parent_rate); + + frate_sel = lynx_frate_to_sel(req->rate); + if (frate_sel < 0) + return frate_sel; + + /* Try the current parent rate */ + rfclk_sel = lynx_rfclk_to_sel(req->best_parent_rate); + if (rfclk_sel >= 0) { + ratio = lynx_pll_ratio(frate_sel, rfclk_sel); + if (ratio) { + req->rate = mult_frac(req->best_parent_rate, ratio, + HZ_PER_KHZ); + return 0; + } + } + + /* 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(req->best_parent_hw, + new_parent_rate); + if (rfclk_sel != lynx_rfclk_to_sel(new_parent_rate)) + continue; + + req->rate = mult_frac(new_parent_rate, ratio, HZ_PER_KHZ); + req->best_parent_rate = new_parent_rate; + return 0; + } + + 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, + .determine_rate = lynx_pll_determine_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, bool compat) +{ + const struct clk_hw *ex_dly_parents; + struct clk_parent_data pll_parents[1] = { }; + struct clk_init_data pll_init = { + .ops = &lynx_pll_clk_ops, + .parent_data = 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 lynx_clk *clk; + int ret; + + clk = devm_kzalloc(dev, sizeof(*clk), GFP_KERNEL); + if (!clk) + return -ENOMEM; + + clk->dev = dev; + clk->regmap = regmap; + clk->idx = index; + + pll_parents[0].fw_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 (!pll_parents[0].fw_name || !pll_init.name || !ex_dly_init.name) { + ret = -ENOMEM; + goto out; + } + + if (compat) + pll_init.flags |= CLK_IGNORE_UNUSED; + 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(pll_parents[0].fw_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], bool compat) +{ + 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, compat); + if (ret) + return ret; + + plls[i] = devm_clk_hw_get_clk(dev, + hw_data->hws[LYNX10G_PLLa(i)], + NULL); + if (IS_ERR(plls[i])) + return PTR_ERR(plls[i]); + + ex_dlys[i] = devm_clk_hw_get_clk(dev, + hw_data->hws[LYNX10G_PLLa_EX_DLY(i)], + NULL); + if (IS_ERR(ex_dlys[i])) + return PTR_ERR(plls[i]); + } + + 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; +} +EXPORT_SYMBOL_GPL(lynx_clks_init); + +MODULE_AUTHOR("Sean Anderson "); +MODULE_DESCRIPTION("Lynx 10G PLL driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/phy/freescale/Kconfig b/drivers/phy/freescale/Kconfig index 853958fb2c06..5d461232276f 100644 --- a/drivers/phy/freescale/Kconfig +++ b/drivers/phy/freescale/Kconfig @@ -47,3 +47,9 @@ 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 + depends on COMMON_CLK + depends on ARCH_LAYERSCAPE || PPC || COMPILE_TEST + select REGMAP_MMIO diff --git a/include/linux/phy/lynx-10g.h b/include/linux/phy/lynx-10g.h new file mode 100644 index 000000000000..b7b80b3ee988 --- /dev/null +++ b/include/linux/phy/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], bool compat); + +#endif /* LYNX 10G */ From patchwork Mon Mar 6 19:15:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13162252 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 0528DC61DA4 for ; Mon, 6 Mar 2023 19:24:52 +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=0FG3i+bu2BUWlOwnjilS1cNx9xk/RdeG9GgvuDKYAjA=; b=oM3dvBfpOJf1IQ NZp+CoUrOa4SslPzS8FoJygofaIYZ3BSVnJXyqsKQhTa9oI4IH6TfN8FZCvwcXAZvsx6nAQVjG2C7 7gVISbwO60zkEEGHHNO+yzJzp6nL/a7rtuqGr2Ose42NfQ1KnBjEhB2XxEQJj5NfuZEo4igb8RGZn uK7Sq8N3iAuHb0GfLcYtUJDlfufGqCdkxzhkYN/aXmwCqOrrG2mhPL+PJPz4hxqTz9fThEfBlyr6J +tM0dVZgJWp2VD1uZyIINRp/9EOj72y1j4I7WYbINnhuELfDXTHYDSSHZO6mcDK8cH6DlYgSUt686 LceWVLWhyXFRQ/Jk4JEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGS2-00EZT0-Ga; Mon, 06 Mar 2023 19:24:50 +0000 Received: from mail-db3eur04hn030a.outbound.protection.outlook.com ([2a01:111:f400:fe0c::30a] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGJy-00EWIw-Rx; Mon, 06 Mar 2023 19:16:36 +0000 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=6dHIpB/8WVXsQOODoEDgbVD8+eB7wIf2wE4foKuw1b4=; b=CGhLTcsqpkbLV24V+hTvifhG+sFvOEVpsv7QqCHGod7hsFndLjM5JKbLmF0MP+e4xH+p6b3PRskPG6J3drMFLUktwzmSl6rYU/9oqQ3Y+cElmqRlhIpXK+2hPYVLGZc+Lp5/L1ybqjCxPF7bUs/kO1eXxV72bbFfYtHqw1+UhVNLFCzTn5m6OMrbr0YgwjnKRcTuBRRm5Y/iUwL+ttivrf4ZGODoBucNotMX2dT1DC5TBBQ7O7yHlxmi6dBDlZHIfMbVFvRpNg7bQ95M77trQPdqmYmjJSQxuIAu/Hwkwks6vq4fIy9zdw1LhLHc2qJiv26niywHxQjGuqtTdbcVxA== Received: from AS9P250CA0022.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:532::28) by DU0PR03MB9374.eurprd03.prod.outlook.com (2603:10a6:10:416::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:26 +0000 Received: from AM6EUR05FT032.eop-eur05.prod.protection.outlook.com (2603:10a6:20b:532:cafe::50) by AS9P250CA0022.outlook.office365.com (2603:10a6:20b:532::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28 via Frontend Transport; Mon, 6 Mar 2023 19:16:26 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 20.160.56.80) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Fail (protection.outlook.com: domain of seco.com does not designate 20.160.56.80 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.80; helo=inpost-eu.tmcas.trendmicro.com; Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.80) by AM6EUR05FT032.mail.protection.outlook.com (10.233.240.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15 via Frontend Transport; Mon, 6 Mar 2023 19:16:25 +0000 Received: from outmta (unknown [192.168.82.135]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 1C8152008088D; Mon, 6 Mar 2023 19:16:25 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [104.47.17.177]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id C68E820080075; Mon, 6 Mar 2023 19:15:16 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BR+3zv3FqY4LcIhRW+oqdQwWByZ43rEpt3FERQ83FCLq1/w/pGWaPxVVKhUFwes4Mn8INtsRx1iZINGkGVUEvfjXhZiAFb6kKQ3TXQ5yrjm6SL6U8OOLdyhYA4Jw2ku959QtkeRpExrXdH2l/xF92RLAySAq/WNfN52jA+dj0S0T6ojNGxEO6tAiPrDNFssIFKjytArQpyRZVHuUF2h3BShYZnrtdWncIBiHmyQa0/eiY9CBSlSGPi9zhtciHWMp8QesfpFml8gg4XtygrZ8L4h18grT6/JhimpnQ0wuzJDAmi4sjBv0myFEnjvDbCTvF75DeU2SmmsCVuovAEUmlA== 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=6dHIpB/8WVXsQOODoEDgbVD8+eB7wIf2wE4foKuw1b4=; b=YcZN71XCAugQH42CoXeELayez52PtdlOlPEzrLRQYPKWQNvpAsXhQ65419RKTAvUcS9VoPCuOC1sRqvh3Uu+IxqwdJhRC/bf0jWHpgs4nfcWIC2T4bZH3D0k2ARpi9/viU+fU6QRdAMgNOA1MJakScUXieM4DNVznEMHQ6x7BCdSLZ0BHFhM+AfAWQxjPpupZgzQS/L50mEUEnGSch2rVF43ok9y11wI394/wJw258fAouEFd+q7BR6pvNxM86KDtmQuTdjEBFwX7W0eNXoziEWRusSQt1YW102+tnNVHWGaHSky5sX1XJ6Jpw1begjI6+Wzo7nVA2naaSHRI0wTQQ== 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=6dHIpB/8WVXsQOODoEDgbVD8+eB7wIf2wE4foKuw1b4=; b=CGhLTcsqpkbLV24V+hTvifhG+sFvOEVpsv7QqCHGod7hsFndLjM5JKbLmF0MP+e4xH+p6b3PRskPG6J3drMFLUktwzmSl6rYU/9oqQ3Y+cElmqRlhIpXK+2hPYVLGZc+Lp5/L1ybqjCxPF7bUs/kO1eXxV72bbFfYtHqw1+UhVNLFCzTn5m6OMrbr0YgwjnKRcTuBRRm5Y/iUwL+ttivrf4ZGODoBucNotMX2dT1DC5TBBQ7O7yHlxmi6dBDlZHIfMbVFvRpNg7bQ95M77trQPdqmYmjJSQxuIAu/Hwkwks6vq4fIy9zdw1LhLHc2qJiv26niywHxQjGuqtTdbcVxA== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by AS8PR03MB9511.eurprd03.prod.outlook.com (2603:10a6:20b:5a6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:06 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e%5]) with mapi id 15.20.6156.027; Mon, 6 Mar 2023 19:16:06 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, Ioana Ciornei , Rob Herring , Camelia Alexandra Groza , linux-arm-kernel@lists.infradead.org, Bagas Sanjaya , Krzysztof Kozlowski , Sean Anderson , Jonathan Corbet , linux-doc@vger.kernel.org Subject: [PATCH v10 07/13] phy: fsl: Add Lynx 10G SerDes driver Date: Mon, 6 Mar 2023 14:15:29 -0500 Message-Id: <20230306191535.1917656-8-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230306191535.1917656-1-sean.anderson@seco.com> References: <20230306191535.1917656-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:208:23b::20) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS8PR03MB9511:EE_|AM6EUR05FT032:EE_|DU0PR03MB9374:EE_ X-MS-Office365-Filtering-Correlation-Id: 5492ac42-9ffb-49ee-11a6-08db1e774780 X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: V/FsuRibJc6hSNXnRkYloqo4PBAl7AbLpz1p6exYIqfs3CAghBMowtbcc8YcIZWpCQ/qlanBxa9meNNimFwZkVy7+gAIQdvJqEIIbTG/L15v+/wUy0awVp8loG7nXQbIwfSV5mEOS171MDi9zV6T0zYVO5aF/8PFvvgAbat1SyyjoLUExn6c/ynXV5CxN5aZeYYdtnLWaCsezPO6x0wpr+8teUxrz4B5ne98c8aEiFUlGHonR7qmEHoEMa+y67jxl7DQYAW0spCLKg9FSacaUxkE1MB+sDYCs1kmR1+ti8jhXwNHEVfEinAjk5b+0NDronPGlMSKHdUccw3IobZeEPo9D1S2gefbjS2DcXRTFeQExGsmDLDYP+4ZzIbShNuYKs2qwLTx1yRtVF8WlHiqWHE2AWFDrMD2lFmWwepNGR2CbwgV+73scYToOYAUe495xxxPme6BAEUV/PbyL993bR6PYNAieed6/ND/VbV+Y4yGbyqmz7+tKk9V+IUnciulXwihk5f8S+c+V4Ba1rYvYsHtU3aBG77sEM5CmxMFkcyAfk9XNnaCY2NXZbmia4uCDQ5n0gZiKIx7hPgtUTUnX5FphhcB0wNo8VMmNZQBHD4i8timyd0UTR1kaVVva0XP+N7Cm7SnibzA0enOsthP1stIVXhHQQeSDwhnofxTuVG+2UD0D8Rzq70K8aTU/Fwt X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(346002)(376002)(39850400004)(396003)(136003)(366004)(451199018)(110136005)(54906003)(966005)(36756003)(316002)(83380400001)(86362001)(6486002)(6506007)(186003)(2906002)(5660300002)(66476007)(4326008)(30864003)(8936002)(66946007)(41300700001)(8676002)(478600001)(44832011)(26005)(6512007)(1076003)(2616005)(7416002)(52116002)(66556008)(6666004)(38100700002)(38350700002)(579004);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9511 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM6EUR05FT032.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 915353cd-d13d-44f6-717f-08db1e773c39 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ex4TDASL02ktFjI2JbUczs8qu7pa22isXkYcBHyMtOiQ/WARscpytE9drgIQ6MPCOaC/xyJGtBxIjnbohwmxPGrgCnZfiC5DzvJ9iFnJCaug9RBg+MSDJq5ffzp7iNqIId6Oe9Op4OwCPtGoM0nLtadgsYLPSumaFq/UU/dwFk3E6pglm7oHjwPOJbc8V2FBkbZhdHYhweJ7pjk8zUkeCpExYbatSvmMJykbnZVCdNyfR1fUXRvaYD3O9ofcdIJ2gPN0tNtkVO+s5zmjnDIow1OWVxt2KZ+bMBHubzRXAqTPoFFzG2fLJu0VPDCAHrNr/t+aoZF7KtuO9vJFwA2wJyJbkbnZWeWTnHcv7NP0mIEX8OF5TmMp75E4B/xFfdvwHaVU2TG8qztPPKWGpjcQAXEUufHdHuve0c9QWHi9Hn9CdTXxMJlCohMKsKBo1Zwi/mcPPSIJjNFWFf0Gu3OELab5zRTBljkoy/aIr4jzItWoRoRRt++Tk/rnyZrnLxoAChdjoWxzjgx5GjbyUnFZe9JxfFht5S/d3uMDWHuhwPEN8DLPPrGEBdICsbnPQihQFzCpguFWso3Xqc1hhbXROPvKSvqKEf4uriC1MIiDVjs3V/IHRf5Za2rLLOkmzVYStjrCawj9j4qLBmBDanbzDh2y1mlxO6aeix6gDJGv8ZUWSNKQkHcYjm8aPc6/duPlp+qYZiz+TpHoIavceMgX/8SleJtu5RUgksSUIalIuIMOpUbBLwwIXSw/3gDLrs2Y X-Forefront-Antispam-Report: CIP:20.160.56.80;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:inpost-eu.tmcas.trendmicro.com;PTR:inpost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230025)(136003)(346002)(39850400004)(376002)(396003)(451199018)(5400799012)(46966006)(36840700001)(40470700004)(36860700001)(34020700004)(82740400003)(7596003)(7636003)(356005)(86362001)(36756003)(44832011)(7416002)(2906002)(30864003)(5660300002)(70206006)(4326008)(70586007)(40480700001)(8676002)(8936002)(41300700001)(82310400005)(40460700003)(2616005)(336012)(186003)(83380400001)(47076005)(6512007)(110136005)(54906003)(478600001)(6506007)(316002)(1076003)(26005)(6666004)(6486002)(966005)(12100799021)(579004);DIR:OUT;SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 19:16:25.2105 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5492ac42-9ffb-49ee-11a6-08db1e774780 X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.80];Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: AM6EUR05FT032.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR03MB9374 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230306_111631_299545_0E724CBC X-CRM114-Status: GOOD ( 24.99 ) 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. 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 v10: - Fix debugging print with incorrect error variable Changes in v9: - Split off clock "driver" into its own patch to allow for better review. - Add ability to defer lane initialization to phy_init. This allows for easier transitioning between firmware-managed serdes and Linux- managed serdes, as the consumer (such as dpaa2, which knows what the firmware is doing) has the last say on who gets control. - phy-type -> fsl,phy 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 | 2 + drivers/phy/freescale/Kconfig | 18 +- drivers/phy/freescale/Makefile | 1 + drivers/phy/freescale/phy-fsl-lynx-10g.c | 1224 +++++++++++++++++++++ 6 files changed, 1303 insertions(+), 1 deletion(-) create mode 100644 Documentation/driver-api/phy/lynx_10g.rst 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..17f9a9580e24 --- /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 `. Finally, +update the ``mode_conflict``, ``mode_apply``, and ``mode_init`` helpers 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 e964fac26a05..7047785ec161 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12210,7 +12210,9 @@ T: git https://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/clk/clk-fsl-lynx-10g.c +F: drivers/phy/freescale/phy-fsl-lynx-10g.c F: include/dt-bindings/clock/fsl,lynx-10g.h F: include/linux/phy/lynx-10g.h diff --git a/drivers/phy/freescale/Kconfig b/drivers/phy/freescale/Kconfig index 5d461232276f..6bebe00f5889 100644 --- a/drivers/phy/freescale/Kconfig +++ b/drivers/phy/freescale/Kconfig @@ -49,7 +49,23 @@ config PHY_FSL_LYNX_28G Only useful for a restricted set of Ethernet protocols. config PHY_FSL_LYNX_10G - tristate + 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 and clk-fsl-lynx-10g. diff --git a/drivers/phy/freescale/Makefile b/drivers/phy/freescale/Makefile index cedb328bc4d2..32ad795be7c6 100644 --- a/drivers/phy/freescale/Makefile +++ b/drivers/phy/freescale/Makefile @@ -3,4 +3,5 @@ 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 +obj-$(CONFIG_PHY_FSL_LYNX_10G) += phy-fsl-lynx-10g.o obj-$(CONFIG_PHY_FSL_LYNX_28G) += phy-fsl-lynx-28g.o 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..880f718b387f --- /dev/null +++ b/drivers/phy/freescale/phy-fsl-lynx-10g.c @@ -0,0 +1,1224 @@ +// 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 + +#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_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 + * @initialized: Whether the complete state of @modes has been set + * @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; + bool initialized; + u8 prots; +}; + +/** + * 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 + * @groups: Groups in the serdes + * @group_count: Number of groups in @groups + * @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]; + struct lynx_group *groups; + unsigned int group_count; + unsigned int used_lanes; +}; + +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)); +} + +/* + * 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_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); +} + +/** + * 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; +} + +/** + * lynx_init_late() - Initialize group modes after probe() + * @group: The group of lanes to initialize + * + * Disable all modes for a group, taking care not to disable other groups' + * current modes. This ensures that whenever we select a mode, nothing else is + * interfering. Then, turn off the group. + * + * Return: 0 on success, or -%ENOMEM + */ +static int lynx_init_late(struct lynx_group *group) +{ + int i, j; + struct lynx_priv *serdes = group->serdes; + const struct lynx_mode **modes; + + modes = kcalloc(serdes->group_count, sizeof(*modes), GFP_KERNEL); + if (!modes) + return -ENOMEM; + + for (i = 0; i < serdes->group_count; i++) + modes[i] = lynx_lookup_mode(&serdes->groups[i], + serdes->groups[i].proto); + + for (i = 0; i < group->mode_count; i++) { + for (j = 0; j < serdes->group_count; j++) { + if (!modes[j]) + continue; + + if (group->modes[i].pccr == modes[j]->pccr && + group->modes[i].idx == modes[j]->idx) + goto skip; + } + + serdes->cfg->mode_apply(serdes, &group->modes[i], + LYNX_PROTO_NONE); +skip: ; + } + + kfree(modes); + lynx_power_off_group(group); + group->initialized = true; + return 0; +} + +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 { + if (!group->initialized) + ret = lynx_init_late(group); + + if (!ret) + 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; +} + +/** + * 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; + } +} + +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 lynx_group *group, + struct fwnode_handle *fwnode, bool initialize) +{ + int i, lane_count, ret; + struct device *dev = serdes->dev; + struct fwnode_handle *mode_node; + struct lynx_mode *modes; + struct phy *phy; + u32 *lanes = NULL; + + 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, lane_count); + 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, "fsl,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; + + if (initialize) { + /* 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); + group->initialized = true; + } + + 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) +{ + bool compat; + int ret, i = 0; + 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; + } + + compat = device_property_present(dev, "fsl,unused-lanes-reserved"); + ret = lynx_clks_init(dev, serdes->regmap, serdes->plls, + serdes->ex_dlys, compat); + if (ret) + return ret; + + serdes->group_count = device_get_child_node_count(dev); + serdes->groups = devm_kcalloc(dev, serdes->group_count, + sizeof(*serdes->groups), GFP_KERNEL); + if (!serdes->groups) + return -ENOMEM; + + device_for_each_child_node(dev, group_node) { + ret = lynx_probe_group(serdes, &serdes->groups[i++], + group_node, !compat); + if (ret) + return ret; + } + WARN_ON(i != serdes->group_count); + + 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 %u lanes and %u groups\n", + serdes->cfg->lanes, serdes->group_count); + 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 Mon Mar 6 19:15:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13162232 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 4B397C64EC4 for ; Mon, 6 Mar 2023 19:20: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=lIBhTo8E1iJ9l76m7YDdApXoZsPlBjDqp+eFNIWP698=; b=VP4nylNARbv4Du nT0M0NGK+uCN5/mPtFe6eCsWgF9vLh2Ni6Bp29zmvWaWaqQGKHaaPdjXtRbnu/kSHCPwhKNs4KFlr kW/e0tiUMEuwIAfGVTmLVqFUarfe8QEHFQ/ydPE2paTExfKeQsmcTSnfOb/NoQ43DkODI1FOrDUOG vjjUqYXScmaewGSEpZXdgwbaMl086R+5qr8kKlNSwBGN1LWvT6coblvSi+7/a1Aetu+63CIxsRpS8 lg1ixl0gFc14GduOl61Yr7diRGh8eF7nE4tv1REFNFRwIa4fsLuUSm15+7xJHTUFY2ybGAE/mrO2m DxTRZX7754tD4adb4T9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGNQ-00EXiV-2C; Mon, 06 Mar 2023 19:20:04 +0000 Received: from mail-vi1eur05hn2030e.outbound.protection.outlook.com ([2a01:111:f400:7d00::30e] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGJu-00EWFp-Ok; Mon, 06 Mar 2023 19:16:28 +0000 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=b+4DT+77QX1L328n7nwn3k+fYZX2Afa6/enjg3r5K3w=; b=MazKoeBsDx6mubD3c3Sn9+8HYEx+Lcu4UG6W5dsKqUHVCAwUlIB17BbtWXNcrA3J6e+CvsvhmR+JKUUSt5rgR+cMkHbQnNbfmaAZESOnglrRkrWLyr/bd54vdGtwt6X/c7sPW09SxnAy3i8di4/goa5A89qYdxq+EDqrvj1K6j9ubC2h/Ooh58iZW9MB20wW02KFg+Ire996/SFk9yGINSaBLc3eO6vXIORaH8gbzjDEFaeg8mC3Kxdwj6AWE62PxvotxnCpApg7bWvdLfdH8rRALVbsh35CmI90r71HFvxLjDW+miwuLvK2dKw3oHruK2nAF4mXSOpTIJLo+1ESoQ== Received: from AM6P193CA0040.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::17) by AS2PR03MB10086.eurprd03.prod.outlook.com (2603:10a6:20b:64c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:21 +0000 Received: from AM6EUR05FT014.eop-eur05.prod.protection.outlook.com (2603:10a6:209:8e:cafe::d0) by AM6P193CA0040.outlook.office365.com (2603:10a6:209:8e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28 via Frontend Transport; Mon, 6 Mar 2023 19:16:21 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 20.160.56.83) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Fail (protection.outlook.com: domain of seco.com does not designate 20.160.56.83 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.83; helo=inpost-eu.tmcas.trendmicro.com; Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.83) by AM6EUR05FT014.mail.protection.outlook.com (10.233.240.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15 via Frontend Transport; Mon, 6 Mar 2023 19:16:21 +0000 Received: from outmta (unknown [192.168.82.132]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 453FB2008026C; Mon, 6 Mar 2023 19:16:21 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [104.47.17.177]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 67DD02008006F; Mon, 6 Mar 2023 19:15:21 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DHI+8Ua7slK/WWNXIavVRhMJrtU44yRvSGvQzO7vTL7iwgVOrjUpwulHwCeh4raG6WV0/BU/jPfZsfEkcSZKc/x6JvvDBVR76eBZd4SdGhLcLfPrNb0YuKTZIrRUDjH9ETAYLt+W1rLQrdWAL6c4G7WwfAFZpVAUCmJtTiDGa7UGDTfxFtzAnfqjdRwmD/LNzwxS6qeOFixCJ4cJeIl8BicLGr92YTa+/IKJEmrtw6bqyQv0EO/7cF+lB2Ps85zq/xgkAXZ+SW6DrLZEDyHooR8syXWXgfjCW9ZY4E8OE5HOofINiimA3aMat+RzmheMTTCWeVyW3JxzhOhqENaDng== 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=b+4DT+77QX1L328n7nwn3k+fYZX2Afa6/enjg3r5K3w=; b=Ronep5L6K+W2Pe4bHxoBqh5xeroWqZCS4TalT2cN3YJe17F8GzGwq5dS0SfdGZSqlDuuiKjgb6ytYrnneSuz/o5SCLaUR0XyUhM+Xn1IlsbBnumfXt54uAOKNSj0RhVFSQSClJQtGP7IIeYgENC2e0bnRIyp7Uoidj25o9NHbLwPwTKxncbMAAmK4SojfGvJUTCuUgkiEhKQRFRClc4jZgV1X1+hM7oKqclQEKWSKcY/dMM/9Jr9SjmmUOJHZdzTlpSm0POn1q6BPrfnHyW5oU2X35St/1ORvtMLZbkRxepiWOOWZfRt0S4zDOtlVjvKimqpgr+SAJqGh0DFH7iGuA== 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=b+4DT+77QX1L328n7nwn3k+fYZX2Afa6/enjg3r5K3w=; b=MazKoeBsDx6mubD3c3Sn9+8HYEx+Lcu4UG6W5dsKqUHVCAwUlIB17BbtWXNcrA3J6e+CvsvhmR+JKUUSt5rgR+cMkHbQnNbfmaAZESOnglrRkrWLyr/bd54vdGtwt6X/c7sPW09SxnAy3i8di4/goa5A89qYdxq+EDqrvj1K6j9ubC2h/Ooh58iZW9MB20wW02KFg+Ire996/SFk9yGINSaBLc3eO6vXIORaH8gbzjDEFaeg8mC3Kxdwj6AWE62PxvotxnCpApg7bWvdLfdH8rRALVbsh35CmI90r71HFvxLjDW+miwuLvK2dKw3oHruK2nAF4mXSOpTIJLo+1ESoQ== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by AS8PR03MB9511.eurprd03.prod.outlook.com (2603:10a6:20b:5a6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:08 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e%5]) with mapi id 15.20.6156.027; Mon, 6 Mar 2023 19:16:08 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, Ioana Ciornei , Rob Herring , Camelia Alexandra Groza , linux-arm-kernel@lists.infradead.org, Bagas Sanjaya , Krzysztof Kozlowski , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v10 08/13] phy: lynx10g: Enable by default on Layerscape Date: Mon, 6 Mar 2023 14:15:30 -0500 Message-Id: <20230306191535.1917656-9-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230306191535.1917656-1-sean.anderson@seco.com> References: <20230306191535.1917656-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:208:23b::20) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS8PR03MB9511:EE_|AM6EUR05FT014:EE_|AS2PR03MB10086:EE_ X-MS-Office365-Filtering-Correlation-Id: 162cec68-62f5-47af-ee3e-08db1e774533 X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: U+UJztSU6dnfmo/ZljjHA1vi1hH1hAmhGuWtWAP9IDluNZFbDLqblJKsC+UdOKa7N2aVUH/GRFHmnebXvnuhK0MClB8Si0LrSPvr5r9USO8YdCxd4Fph6J+vkU4pqX24CnKXhUZC6H6zM+LkwS1O9+JjtEK85MKBGwpSMLrx7JggMupP4zpjPxLtnkpYhvvy81LwzUhX+sGqgWkUVfh+ejPZKlgv56msukW3Hc579fjJXboaUqTXf/8ge0c6DoRWHRQHPOTswXfn71XIaJPlFesBjtImhzU45ujt4tP7lt6VDG3sBUSvWoJEqthLv/g6grgNdiGGxbJRE2mvGskyWYnxyHNM0Mq9xJiwJxrh89+Di5jvxiP8Lh/cGNU5eFpg1AkmMlQauLPQkMR+f1sugK72eomUicbZ7YHfiLnygMjHH7UZTiONfcEuc/54Ezi6tg9SpJ0XADB+dGsSMvRO/mxrz3xWMDnrULaYkDm4FEDbFNIyt87LrTwgW6Aa5Wv8IJq1nHZLPsWc2KSRp/UlXzlUuVt+L2ZLDGf+yJuly0UTZW/lyKYRwZsVwmJnLhPD5yhHwUCL/ea5/P161lUWaZrJ6NUqdOykK9Od86XkD41qYcHuWwoVbpwDiAI9FDu89U/f6nlyzDaPkrAigV7L+EeQt3eFtmqLYALKS2pKKCBWj3HO6lyJ1LgqbUFQZyAJ9uCwWXrUvEKE/9s3s0asWQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(346002)(376002)(39850400004)(396003)(136003)(366004)(451199018)(110136005)(54906003)(36756003)(316002)(86362001)(6486002)(6506007)(186003)(2906002)(5660300002)(4744005)(66476007)(4326008)(8936002)(66946007)(41300700001)(8676002)(478600001)(44832011)(26005)(6512007)(1076003)(2616005)(7416002)(52116002)(66556008)(6666004)(38100700002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9511 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM6EUR05FT014.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 8f2f7b48-5d13-4135-8fd9-08db1e773d3f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5b92Wq9WKBngqVOE1Vv42j0bHdgJt5fCCNqbA2RD/0FouFlydW20UCMSjJOkJIS3WbGdzAjrqnzMdvUp7Tu2ZAO1wxVwDkpU6e5MSHvdKccof3aaRlqAXwlY9VxOLws9gUmOTBqYPbeiMZqIHNpy93LeoWMc1LglYWDl6ctTqw2TUkFn2SmCeagCpPjaIzKJZCjQxFwKaFXc9SWaVeMYEshyZwv3IuOee1p2i2z1gt8UFwxEhRCU+KNrJ7G3sRs/LYkc5lNdW1jvAaXS07ja13Y2Cgg5fsDcPu/aqE3Wwkk20NwGNRianGskipROWhGTy85HLQx71Kae1y4kKEohXSLfUcxhLHNiL8ITsBxJd806T7n6wcfPVog9qzm8+fYiMF0I2PaNv0nW+kbQePaI7+peDNnW0loUV+OhqdZg6XwMDgBW4EzCRKTUC9L9jLsiJSbobY9VYsjcofQ7gVZgeckEKAWT8+Y5W2WsgiUt4g7bIe7oGK5axUVS8ggCFmGrmRmU3VBgj7x5rdSq2zLVp6uGjbHLljGn7TXdacbo+8CkxZalfoStNjHLUSv/vVdMQUuyl4N3dSMNZHCAxQ69gsrmWa1l4pgSpSsl1bgWPKErgZ86ib6EYrWJQ/N933x2B71v7aLPA6jRaENW7gLsk5zC9yaes5gioh7it7rMCCcL+DGeAqctboJfjt98dLATaGt+xT2X7IDhK/22qSpIg6D3u/FD+lwRNq7buApZV+lhqytsDKeS+GkUQPlDhbO7UonEjWUOQlXEVyQDHkSbPg== X-Forefront-Antispam-Report: CIP:20.160.56.83;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:inpost-eu.tmcas.trendmicro.com;PTR:inpost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230025)(396003)(376002)(136003)(346002)(39850400004)(5400799012)(451199018)(40470700004)(46966006)(36840700001)(36756003)(4326008)(70586007)(70206006)(40480700001)(7416002)(41300700001)(8676002)(8936002)(44832011)(4744005)(2906002)(5660300002)(82740400003)(7636003)(7596003)(356005)(36860700001)(34020700004)(86362001)(6666004)(1076003)(6486002)(478600001)(110136005)(54906003)(316002)(82310400005)(47076005)(6512007)(40460700003)(6506007)(2616005)(336012)(186003)(26005)(12100799021);DIR:OUT;SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 19:16:21.3561 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 162cec68-62f5-47af-ee3e-08db1e774533 X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.83];Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: AM6EUR05FT014.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB10086 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230306_111626_864058_F907B75B X-CRM114-Status: UNSURE ( 7.39 ) 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 next few patches will break ethernet if the serdes is not enabled, so enable the serdes driver by default on Layerscape. Signed-off-by: Sean Anderson --- Changes in v10: - New drivers/phy/freescale/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/phy/freescale/Kconfig b/drivers/phy/freescale/Kconfig index 6bebe00f5889..b396162dc859 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 Mon Mar 6 19:15:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13162234 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 B4C13C61DA4 for ; Mon, 6 Mar 2023 19:21:19 +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=fiyX4jOpNhylVhunXGgu9ejEf3KgWayo7ZasD0cJbXA=; b=1yO6EInDrIxwvX 5mUg5Bf94TrbEsG5OMZEyJuewm+ZW6yfc6AjszRoCsGb0xD3Ex2ag+WimF0VzimJjJ4gFa7W6vb1X iexQAeHBc9dcaV3+YOR72grIsnD9GaPBjtLwBH3n/UE1A3WeZ3+tRNkBOWdUb7yojh9RbjTNRY2gT eNSqJPmYqH0EySCLy/tOmoavh8a749fesFxsqiZw3ZeaiYgwRcdTQ6euV9B9AJTMLOUX/fuEoKhfl WK2lyunXqOZCOw+MvScrarE1YwUKRxf0HUIHAf6dGI8jbP0Fav+NV6QM05ikHHd6nSrimI076qsr6 EEC8PQhxpt+jA8pR2XJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGOc-00EYAG-Go; Mon, 06 Mar 2023 19:21:18 +0000 Received: from mail-vi1eur05hn20304.outbound.protection.outlook.com ([2a01:111:f400:7d00::304] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGJv-00EWFu-E8; Mon, 06 Mar 2023 19:16:29 +0000 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=M9GGq6XJV4t12CLbwma++7CQnOz5UXXTjYOEliMCg7c=; b=qkR5w38nlzb8jmcePajJWj27iP3POKUPRUmZyJtR3dqPwBxmFwLXRN3WBxyQJUXTpTn9JUizkSzNbotfQIE9FQOrMV9OnEMmMFW0KlDlyu+45xxHElfgQ5sBRnwvWXmgDu3VrO4qvPqZkHO0AOrLv65R/mxStVyv6dWgTVTszJ0D4xqK6XmFLLvdhK1wdZKxwsKSnYG5a116bkIby/pifXEcvKsAu4bhKjhzwVTBBYy6174M+oZ/rN4XxG4ineiibYyKmLQ5G3WJkVggDdX9u/zS6Z6j7PsPiPCofCanHtpUIhkwAvWW+bigOKyGGP3mRqY7qhZxfvxg92lJCjWc4Q== Received: from AM5PR0201CA0012.eurprd02.prod.outlook.com (2603:10a6:203:3d::22) by AS2PR03MB9146.eurprd03.prod.outlook.com (2603:10a6:20b:5fa::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.27; Mon, 6 Mar 2023 19:16:21 +0000 Received: from AM6EUR05FT046.eop-eur05.prod.protection.outlook.com (2603:10a6:203:3d:cafe::dd) by AM5PR0201CA0012.outlook.office365.com (2603:10a6:203:3d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28 via Frontend Transport; Mon, 6 Mar 2023 19:16:21 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 20.160.56.86) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Fail (protection.outlook.com: domain of seco.com does not designate 20.160.56.86 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.86; helo=inpost-eu.tmcas.trendmicro.com; Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.86) by AM6EUR05FT046.mail.protection.outlook.com (10.233.241.175) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.14 via Frontend Transport; Mon, 6 Mar 2023 19:16:21 +0000 Received: from outmta (unknown [192.168.82.140]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 48B2020080270; Mon, 6 Mar 2023 19:16:21 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [104.47.17.177]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id EC4D42008006F; Mon, 6 Mar 2023 19:15:21 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a/htDj17lImiYvNMnGRUHS7GWVjqxz4MzGNRV7HEfdyKjNNUx+wnPYaRNASu4Rj5vhVDCu8r30ZlHzo/6FQ9U2/v7MvR4o0c7C7iH5X2g1fw+9BPDiYpQEviNZ+KjRvboCFPFEx3SACFsOk0OSjE8ZDLWB/PZYYjHOlfjHuvsbqiReoMQ28FZQT3BTZwzx85LbclQzbz382UWv+qyLMK3Jg3Tx5WGhZA4Cd9ZTQjPMAvqd72P7F8+pEIZkBEKMnDuFjEgyMiWM6c3lwAuXNtNE62Xc8dbWJ5hkQJHsfYL5iKZcdQZh/9RP9hpkgFszVkFqRolX9w/Wywcl5Vj0GeeQ== 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=M9GGq6XJV4t12CLbwma++7CQnOz5UXXTjYOEliMCg7c=; b=Wz2G6qmHIImMx/5maDzmUVB8Nl6P6l0Hb10X2+V7YDefp2wKcAwqilwul5YEgyyAWtkGYDIY11DmYwAcdr3BgObNSQplVNe8Pm+yEQ3/iCE59DzLW+u+TDf+0GCQMGS81x8xppKu5rj8ndxa5J3CMBY9/GOumWfXG4H50flWtQGf3ZL6g5fReQADX6jMzVchQBZowPRaB+RBRUktiGaG0tYFzuwj1F1N0uTdtwfveyeAQ255nPXb+Rhu2NdlNrGaZ98xP5YCjZwNk9r09zUhOikLa6S90NbIWUEgMylLzLVpZVm2Km8wEwlNYTtVgCFY+bxPoF5/s7+yVCsEbuTKKg== 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=M9GGq6XJV4t12CLbwma++7CQnOz5UXXTjYOEliMCg7c=; b=qkR5w38nlzb8jmcePajJWj27iP3POKUPRUmZyJtR3dqPwBxmFwLXRN3WBxyQJUXTpTn9JUizkSzNbotfQIE9FQOrMV9OnEMmMFW0KlDlyu+45xxHElfgQ5sBRnwvWXmgDu3VrO4qvPqZkHO0AOrLv65R/mxStVyv6dWgTVTszJ0D4xqK6XmFLLvdhK1wdZKxwsKSnYG5a116bkIby/pifXEcvKsAu4bhKjhzwVTBBYy6174M+oZ/rN4XxG4ineiibYyKmLQ5G3WJkVggDdX9u/zS6Z6j7PsPiPCofCanHtpUIhkwAvWW+bigOKyGGP3mRqY7qhZxfvxg92lJCjWc4Q== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by AS8PR03MB9511.eurprd03.prod.outlook.com (2603:10a6:20b:5a6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:10 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e%5]) with mapi id 15.20.6156.027; Mon, 6 Mar 2023 19:16:10 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, Ioana Ciornei , Rob Herring , Camelia Alexandra Groza , linux-arm-kernel@lists.infradead.org, Bagas Sanjaya , Krzysztof Kozlowski , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v10 09/13] arm64: dts: ls1046a: Add serdes nodes Date: Mon, 6 Mar 2023 14:15:31 -0500 Message-Id: <20230306191535.1917656-10-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230306191535.1917656-1-sean.anderson@seco.com> References: <20230306191535.1917656-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:208:23b::20) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS8PR03MB9511:EE_|AM6EUR05FT046:EE_|AS2PR03MB9146:EE_ X-MS-Office365-Filtering-Correlation-Id: f0424e71-dfeb-4a4a-4a30-08db1e774536 X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: U+xTsRqzoQfJKdlrAnYphZOfpFxH8YhUFQMo8BSDnf9vDQdtbYXRtBGz9KaG440FKaPFuc/XULNSZZ2bY/E7mXkUqV0u6nlMcxxBs57wxQCU/JHnObby+Ci9Key+af6pCJ2m8Fdo5NrvbJdGDUbTJ1npDbUJD9nSuOLdCoQevV/IWn+XVvcsz8oRvJFNE4gXyRpG7wOdPSgpsa8bTRc3o0IetB5W38vqO86G7Nui0WmaMsJ9qBb76N3s1x/y8r9C59m9OZMsY900bT0oIeTc/UG7Dg7rFs2+VKE+71ScUrA4Jxd1ZFbNtaHV3Opg2A08HW5Y5U2Nex68kiZi5DeYYGfrPnaC+F/HIGagGkQl68GkQW/+XZPno1incvcP0AkovwJApeNe6zsLDiFT5VcbgUNPI9uyhe/EIzidVjVQ5Ig6YPoiAk0U71CPGMKXepljM6utiB5yW4/CaGKyCroInfZh/hTBr78QYU9jetUCfH9p3YoK6k7eBMr+eWf7ReVbot7H+8ySXRo/SA6KUjZgNQV3i2TWNKa1GQV1tNCaGtQ3H9awNSzCudRPWkyZQe6VeunnOTiGvwd0mtA1bQgNoNj2lL4nKsavuHhhAv/TqUbf9A0UE0kQ3yxDGZg5al7KAitpLIXyFYtvrElcSqQnHsaeWZbvFcIfbrB5gf7/oRObj9FZioeSslDipoBKFfGYXqDilBGgWOsJkeKGPvzgOQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(346002)(376002)(39850400004)(396003)(136003)(366004)(451199018)(110136005)(54906003)(36756003)(316002)(83380400001)(86362001)(6486002)(6506007)(186003)(2906002)(5660300002)(66476007)(4326008)(8936002)(66946007)(41300700001)(8676002)(478600001)(44832011)(26005)(6512007)(1076003)(2616005)(7416002)(52116002)(66556008)(6666004)(38100700002)(38350700002)(21314003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9511 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM6EUR05FT046.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0804670e-20ce-4c49-b1a9-08db1e773e4f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D71X8Ux7AJ8JfL3ubIbbZCY4+Ibqarz6+uSpdz7xTm2aOOJPshZ5TECg1Hvhgfwq0bT/238S2+8HtZ6Y7+D98BO0UU8jNlOgRInnEWn6tTsyA2wzWsaTkVzfjWZuWWLTWDBIKpTGMMJnvA/fHTeIu/IVuwWM98rQUFjwZJGBuL6nC3d1RTe6kBVooWhqeZDbGXAuchZMwvmbMwb5ddcipeak2H0NhvmKyzg4eG58pdB4oYx+7rRExgq5aHO3SfFba8PosgXAdY3nsRQs1EsPHxH7SehwyePvLxuSqg0ytQ1jrDNR4e+mMdrSmTUip3sWskcLlM18KBybt4x2xc8468lwVrmuyi67EkQq1dYQ9VrghtnncyO2lxjnSNLdTKwDhKQIxwp3VaPLhcrV3bVthuk4kbV6LH+kzV/4X2dhi8XIFdBqk1rzaDko8cnymgCaY/RDLOIkR2h3EX/YAwST1sfFAJLzHOElZvhRWItk3o5tWhOf3soQJFXz3UieuxG7HxAQx6vrErjKGKdLE8w4kVkRtS8qQ4a+N8cIqdYE81qHY14plGYvfsQtX+/bp/8h+axnvsWNLQvQ4AdBh1OmT55r6ffwb9Qe4rLIrDVWzi0O8DS19wedkyZDm+93hpBEmI7LdXUJ4oDjlSbnHKkdO0MEi96L/YZiFcW4u+gxExHlYw/Cl0JC/F0gylwR3wQ4bln9JxpWALz+F4r7pkOcpEBAJbP59FJ23eDxDJFnt12DXZOwtkOnUWsKFCQ4Yq8q5CkNNMU2m1sLnc0PZkwLBQ== X-Forefront-Antispam-Report: CIP:20.160.56.86;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:inpost-eu.tmcas.trendmicro.com;PTR:inpost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230025)(136003)(346002)(39850400004)(396003)(376002)(5400799012)(451199018)(36840700001)(40470700004)(46966006)(6666004)(478600001)(34020700004)(83380400001)(47076005)(36860700001)(36756003)(82310400005)(316002)(356005)(82740400003)(54906003)(110136005)(26005)(336012)(2616005)(186003)(6512007)(40460700003)(1076003)(6486002)(6506007)(7596003)(7636003)(4326008)(86362001)(7416002)(44832011)(5660300002)(8676002)(41300700001)(70586007)(8936002)(40480700001)(70206006)(2906002)(21314003)(12100799021);DIR:OUT;SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 19:16:21.3872 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f0424e71-dfeb-4a4a-4a30-08db1e774536 X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.86];Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: AM6EUR05FT046.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9146 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230306_111627_556644_B7534330 X-CRM114-Status: GOOD ( 10.54 ) 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 nodes for the SerDes devices. They are disabled by default to prevent any breakage on existing boards. Signed-off-by: Sean Anderson --- Changes in v10: - Move serdes bindings to SoC dtsi - Add support for all (ethernet) serdes modes - Refer to "nodes" instead of "bindings" - Move compatible/reg first 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. .../arm64/boot/dts/freescale/fsl-ls1046a.dtsi | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi index a01e3cfec77f..f6361fafaef7 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi @@ -12,6 +12,7 @@ #include #include #include +#include / { compatible = "fsl,ls1046a"; @@ -424,6 +425,116 @@ sfp: efuse@1e80000 { clock-names = "sfp"; }; + serdes1: serdes@1ea0000 { + compatible = "fsl,ls1046a-serdes", "fsl,lynx-10g"; + reg = <0x0 0x1ea0000 0x0 0x2000>; + #address-cells = <1>; + #size-cells = <0>; + #clock-cells = <1>; + status = "disabled"; + + /* + * 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>; + fsl,type = ; + }; + }; + + serdes1_B: phy@1 { + #phy-cells = <0>; + reg = <1>; + + /* SGMII.5 */ + sgmii-1 { + fsl,pccr = <0x8>; + fsl,index = <1>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + + /* QSGMII.6,5,10,1 */ + qsgmii-1 { + fsl,pccr = <0x9>; + fsl,index = <1>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + + /* TODO: PCIe.1 */ + }; + + serdes1_C: phy@2 { + #phy-cells = <0>; + reg = <2>; + + /* SGMII.10 */ + sgmii-2 { + fsl,pccr = <0x8>; + fsl,index = <2>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + + /* XFI.10 */ + xfi-0 { + fsl,pccr = <0xb>; + fsl,index = <0>; + fsl,cfg = <0x2>; + fsl,type = ; + }; + }; + + serdes1_D: phy@3 { + #phy-cells = <0>; + reg = <3>; + + /* SGMII.9 */ + sgmii-3 { + fsl,pccr = <0x8>; + fsl,index = <3>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + + /* XFI.9 */ + xfi-1 { + fsl,pccr = <0xb>; + fsl,index = <1>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + }; + }; + + serdes2: serdes@1eb0000 { + compatible = "fsl,ls1046a-serdes", "fsl,lynx-10g"; + reg = <0x0 0x1eb0000 0x0 0x2000>; + #address-cells = <1>; + #size-cells = <0>; + #clock-cells = <1>; + status = "disabled"; + }; + dcfg: dcfg@1ee0000 { compatible = "fsl,ls1046a-dcfg", "syscon"; reg = <0x0 0x1ee0000 0x0 0x1000>; From patchwork Mon Mar 6 19:15:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13162235 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 64C31C61DA4 for ; Mon, 6 Mar 2023 19:22:20 +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=CtOYV8/EmCcooeOi2A3zDJttqi/mkov6bxALvn7xS5s=; b=ZLHLEd05vbta+Y BbVdBXviJwfmNG8noC6nxnv3Yv3esljZ5jozK4u1prkrfCucWyRvVjej5s3PzY46P2wpIzVdFHGOy jNBBnR0GNOk1lWgFsdxHMZRVWCZJxpizAoEZw0pzf982/823tIVYTY8VF/sMeiD1aRzJ19DGc2nCf WhFCGT1I/joeUaw5n9pVnqoiUtSfN8jAsMjWw8lOUHLr9eZwGES8PSCa5pAPhZUAzD+X1zfwyCgj/ WblnnXE0KyB30Nlico7jpKpkOmUhm2F/DN+xns0zpXJw2eJmqNa21Tc6UzE5AUy+1qy90S/QCqUHZ g3v4oCiw5oSQeNnLYw4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGPb-00EYYu-JX; Mon, 06 Mar 2023 19:22:19 +0000 Received: from mail-db8eur05hn20316.outbound.protection.outlook.com ([2a01:111:f400:7e1a::316] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGJv-00EWGJ-Hy; Mon, 06 Mar 2023 19:16:30 +0000 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=u438zab4qoiJJtVGpcxRtVtryvOv9pQB4X3GQpbIQHE=; b=kclXiq+/FswDQIZR+oX3kDktbxTh1t2qRuqlfkW9m19phOvpYVJur+HBDWeMTp2OZ6GpsB1Sv05kB4G2l87EcnTSogFryWks9o6c5E2rwoh1PVu/HkEvhCtUL9ZJ+DK2w/Vw9XMEe+H39W/DtIq2CDUI4rCrRTXxI4tahQIlp2MEFpPc0h9VpJxowGV0co46mQgCFRYXeVNVaZepvh8AiQPVK//WGr9tazgApgER63AMq/d3w7YIQ96URAemi7e8PoKQQljEZuQWhhXWEtUkxifKE/GJtvfKbC9oeZJn5NFL4dr/vZmO31iMjUvDVz0rTo+OnMDeRgXNVH+SfNkH5A== Received: from AS9PR04CA0174.eurprd04.prod.outlook.com (2603:10a6:20b:530::15) by AM9PR03MB8010.eurprd03.prod.outlook.com (2603:10a6:20b:43d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:21 +0000 Received: from AM6EUR05FT020.eop-eur05.prod.protection.outlook.com (2603:10a6:20b:530:cafe::c4) by AS9PR04CA0174.outlook.office365.com (2603:10a6:20b:530::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28 via Frontend Transport; Mon, 6 Mar 2023 19:16:21 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 20.160.56.87) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Fail (protection.outlook.com: domain of seco.com does not designate 20.160.56.87 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.87; helo=inpost-eu.tmcas.trendmicro.com; Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.87) by AM6EUR05FT020.mail.protection.outlook.com (10.233.241.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15 via Frontend Transport; Mon, 6 Mar 2023 19:16:21 +0000 Received: from outmta (unknown [192.168.82.140]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 5EE4020080271; Mon, 6 Mar 2023 19:16:21 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [104.47.17.177]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 392DA2008006F; Mon, 6 Mar 2023 19:15:26 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lsmh/4U93hv6gSsvaZ/9rN3PYoIrfOsreonAQGIHC5KIHwSbHaey6lyQMYTROj4l1JLBd2RAm+1amDmtdc9Xf5n5zCIL9tQO3/u9XCb2FC5tv5EmLkyeS5bqoLaePZb1xFqc2RefFFv+WkRz/JCNwWdo5nk0TL/t/kDy60ELyse1zgwo46kQHbD2+w1JZUb7u6SytUImhyP8PQRbG7yAKcC/3kd1mTjrWPWK/cBBWE9VIEIfHjVwhoz4+I4xR24DpMr/G8qilpQ5FoA5SYuSqN2SlnO5jCLwhxf1uyYEmC7k8I0FlJ1XjZXV5U+EEhJvxO7Svd395yqpKr6mGIK2Fw== 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=u438zab4qoiJJtVGpcxRtVtryvOv9pQB4X3GQpbIQHE=; b=A/IphMyDkFkwds3kJEJode79yw5JJR8ZA/gPnJ1QezvbCjNe8PJ4dXCJ5gOa5KAIK/FjGbgvswWRgexu8g/nM66Vged6gmxgS0iDSGFgbDk+CYdE7Mt68ogpfh2nCkdq/WS6O5Mbzxnhs9d4caBcKwQ8eK5bdJaRSgfIyOgEUTRRG+nhmv1HHm8ni+qHi0d74kk4KjJzN8YgddWZRIQw44ZcxH0yODvwEkebFuRTPRZjRK2t998p930dM1rn4gElCGC03uxHuzMWldh3mmz7oEwAgx0vVUZkzrKMxpS6185SHSZ6bebOrOhoaqo3146ZQDnsP18oFfgIYuuNJcgBzg== 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=u438zab4qoiJJtVGpcxRtVtryvOv9pQB4X3GQpbIQHE=; b=kclXiq+/FswDQIZR+oX3kDktbxTh1t2qRuqlfkW9m19phOvpYVJur+HBDWeMTp2OZ6GpsB1Sv05kB4G2l87EcnTSogFryWks9o6c5E2rwoh1PVu/HkEvhCtUL9ZJ+DK2w/Vw9XMEe+H39W/DtIq2CDUI4rCrRTXxI4tahQIlp2MEFpPc0h9VpJxowGV0co46mQgCFRYXeVNVaZepvh8AiQPVK//WGr9tazgApgER63AMq/d3w7YIQ96URAemi7e8PoKQQljEZuQWhhXWEtUkxifKE/GJtvfKbC9oeZJn5NFL4dr/vZmO31iMjUvDVz0rTo+OnMDeRgXNVH+SfNkH5A== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by AS8PR03MB9511.eurprd03.prod.outlook.com (2603:10a6:20b:5a6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:11 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e%5]) with mapi id 15.20.6156.027; Mon, 6 Mar 2023 19:16:11 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, Ioana Ciornei , Rob Herring , Camelia Alexandra Groza , linux-arm-kernel@lists.infradead.org, Bagas Sanjaya , Krzysztof Kozlowski , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v10 10/13] arm64: dts: ls1046ardb: Add serdes descriptions Date: Mon, 6 Mar 2023 14:15:32 -0500 Message-Id: <20230306191535.1917656-11-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230306191535.1917656-1-sean.anderson@seco.com> References: <20230306191535.1917656-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:208:23b::20) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS8PR03MB9511:EE_|AM6EUR05FT020:EE_|AM9PR03MB8010:EE_ X-MS-Office365-Filtering-Correlation-Id: 28b3ca3a-5b3f-4fa8-1364-08db1e774561 X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: IOBRuoxeuLe45whN/JMyizILEVErRhMxz/xr7oGTDgjKkNNboqQ2luBEQ4IJ5KRszSXSvokaHBXqDD3qa4j73UgELbqL57BhXAPQ8NGpHvuTpcoETtXNld0r6i+Swd4+HoD024zecUWHdyjYzMRpIzs38vt4TTdSzZIl28lrnYf6t2LW7zqkj7M7vzg4eobYPyhNMv5VMyteIEVrzvxlZ70iG9eWkpX4/vH9UsBgeuGhWZQgYMpb3C5HJ6joTiymMmxV2c0vVVJYkCZqIye8BVf5MQoNBarpp/ixJrdjAvJR60ZoT5zmWQ1vFnpBO/+cLCUoeJ5x6XL7Gt2i8XQkwKZnCL/d2VIHgCseMSpDbhNP2fIBCdb9xodPysOaUcGwKvXe13Tk3O9tF1kMcS2yclrgMEmI2eMpqNX7spP1xIecVW1GQkufwQUqEj5ueSTmX+wRxPcvocNEf5JnkB0UORi4H/MBbvdIIP0srkIO1V9e+dFC302XmHEFn7GiWdjoOqVqfdJmUNRPB0XrUs5tDNk9IEco4Q3JrmFDHHlHbVgz/U7xqasBTrjsqa5d1QNw/XtsOO3RcLrshYpEQDsY59I+SLoUH+DNf793cXQHrLFtWBL58HBY5DmO7fol5Y8/TexRYF604B/ew6H2DTWXoVlWSvqREYk3aYTLIowQJUIgasM4wYpevw9lJOHedqYUhsN/ODlCFG03EqkcUf1KgQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(346002)(376002)(39850400004)(396003)(136003)(366004)(451199018)(110136005)(54906003)(36756003)(316002)(83380400001)(86362001)(6486002)(6506007)(186003)(2906002)(5660300002)(66476007)(4326008)(8936002)(66946007)(41300700001)(8676002)(478600001)(44832011)(26005)(6512007)(1076003)(2616005)(7416002)(52116002)(66556008)(6666004)(38100700002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9511 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM6EUR05FT020.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 90a40a6a-b3f8-4694-7bf8-08db1e773f58 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o3M8bk41dK7KN0nMwK9l1wJ1MvseOgXSJZe8Y6pye6sf75IudPOjxhDdaqNYDfzudAJ7lEe6Ftqgw/zKfwhcqNWQmJl9KMtiWnkl9OYU0E6VtekPSE+bNFkXysMmOZ/7JTEtwx4eCaagzicaem/3IqNDzLSCcKfWC21aVCSa9jzx7POyB3vv9uOE58ZeH6zyQDnmirQDRkC3PGHnweGae8N8eUbP9UJwlxmth3SAX/4y/diXl+2wlM7mznarWr1UvXx51O5iQ7DP/F+CgVVLR1EEFedwwupGtpY2mHjCJD35C+m9mTQMMKJ//g/eokDTxWBXpbp3Vme+faQErp6K4bnkgA7YDXgPDibl12zqkFMbk5IP1gtiL73ivWtbaZRxRR7bJExlK5md0cHkPqTc/JkrT3KFMUuFLd75qQmbhB8Az8N7bv4Qut1kbiB/g3CbsPS7TF8CrJ4ONuHE9WRZrKX1bnpd1glO7PSYCCA9avsN0IxAjhg51xnSXNqlqC5YFl7OcclluToMRnZlWQ3ZOzSIK+2l6yfvlfClD1SXkOdX5UeyUHkLqbnHxgjrcBxWGRn+gqGHI+x/J9ueabgKsHtGtjO6W6+p/SMA7Px7s+XmwrfHhIwcwt3sKaTKki0zKfpe67pfETe4GtR9lf4TunvmOYt5M/oQ+R1FCnNBoNBzMpXlA8hSDVHlJUkJgcL9kzMzNk788GS7Qdhe1k1DOE4L6uRnIs3hffQM1eBvZZy/AyqAcRI6Mrmt6HalePeG4h6OSO38oSMV/yDviOQ06w== X-Forefront-Antispam-Report: CIP:20.160.56.87;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:inpost-eu.tmcas.trendmicro.com;PTR:inpost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230025)(376002)(136003)(346002)(39850400004)(396003)(5400799012)(451199018)(46966006)(36840700001)(40470700004)(36756003)(4326008)(70206006)(70586007)(41300700001)(7416002)(40480700001)(8936002)(8676002)(44832011)(1076003)(2906002)(5660300002)(7596003)(82740400003)(7636003)(36860700001)(356005)(86362001)(34020700004)(6666004)(6486002)(478600001)(110136005)(54906003)(316002)(82310400005)(47076005)(83380400001)(40460700003)(6506007)(2616005)(336012)(186003)(6512007)(26005)(12100799021);DIR:OUT;SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 19:16:21.6519 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 28b3ca3a-5b3f-4fa8-1364-08db1e774561 X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.87];Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: AM6EUR05FT020.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB8010 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230306_111627_656002_426C3414 X-CRM114-Status: GOOD ( 10.28 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org This adds appropriate descriptions 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. Signed-off-by: Sean Anderson --- Changes in v10: - Move serdes descriptions to SoC dtsi - Don't use /clocks - Use "descriptions" instead of "bindings" - Split off defconfig change into separate patch Changes in v9: - Fix name of phy mode node - phy-type -> fsl,phy 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 | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts index 07f6cc6e354a..0d6dcfd1630a 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts @@ -26,6 +26,24 @@ aliases { chosen { stdout-path = "serial0:115200n8"; }; + + 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"; }; &duart0 { @@ -140,21 +158,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 */ phy-connection-type = "10gbase-r"; managed = "in-band-status"; + phys = <&serdes1_C>; + phy-names = "serdes"; }; mdio@fc000 { From patchwork Mon Mar 6 19:15:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13162233 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 0AB90C64EC4 for ; Mon, 6 Mar 2023 19:21:19 +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=Xz36uGBaYFD8cYlPWpT87+E0PoqK0PnSuZ9+lhEJRl0=; b=jCAGM7+hY+3WF1 19zoFwt/8HKeEGZr/Ooud+IKPYxBqOZwUce4dR/xC1TGh4mu7eQh/Ft+2PA2/bY+1mR/KqzT6tExa 9rLohRwZNUiZjmevMhSxxJSYunYUvoiUHnbXmMVjfCj0r9tKYDTytEzSmgRRyo1SqyXTfL0bEJTXF PnoUW4vTAlGFNwfmm2fyBQvLFRYVGTGkWh4b1HVOWjov9NaQ1MZQ4g6CJNCMOdDlmxBWmdUwt+XlA G0QSZQwdt3QmGZZH5cxsqmYS7eTiGiK0psmzjugmr4cM1/HJCDwwGcl6oS6/enxTuIMSCu/qDUUbS v+esRh7cnzZEsAzffhFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGOc-00EYA8-5S; Mon, 06 Mar 2023 19:21:18 +0000 Received: from mail-db5eur02hn20315.outbound.protection.outlook.com ([2a01:111:f400:fe12::315] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGJu-00EWGk-U4; Mon, 06 Mar 2023 19:16:29 +0000 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=LRoDDvinI3bzAhNZtEHDnCdEHKTE8WBoLmSiBtr9wwc=; b=dGx4DioS7IHNY0VnESET17XGkCF+mpUrozXGQR/E9vgCTq08Y9srToFNVZ0LG2vwl5M93aW3PTMcm+ocHM35FuilYS0BiVcyjEZ18LPnoxXsJDYy7qLJfw9Q3o36M2Efh6wVmlFcp+rGIHzzLCEZ5hwBQgoAGPPdZ6WHXthmXXFYdq1oGPDo3C2/M41kDIA3mG8s84ZZ0glxPnOrCjAw1zRa+6NHQJAQkcqGAe1eIfJXnouDzdvAzyMrI877sZCZ/v0Re4iSec+CVVx/zgcmsuehKkKhzS1jl1+Lay9opeOQFHXFwNHcbLLfrVMuD1VWMrBzq4qDrq3vzTp5Z3YG6Q== Received: from FR3P281CA0078.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::19) by DU0PR03MB9615.eurprd03.prod.outlook.com (2603:10a6:10:422::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:23 +0000 Received: from VI1EUR05FT006.eop-eur05.prod.protection.outlook.com (2603:10a6:d10:1f:cafe::7a) by FR3P281CA0078.outlook.office365.com (2603:10a6:d10:1f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.16 via Frontend Transport; Mon, 6 Mar 2023 19:16:22 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 20.160.56.82) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Fail (protection.outlook.com: domain of seco.com does not designate 20.160.56.82 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.82; helo=inpost-eu.tmcas.trendmicro.com; Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.82) by VI1EUR05FT006.mail.protection.outlook.com (10.233.242.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15 via Frontend Transport; Mon, 6 Mar 2023 19:16:22 +0000 Received: from outmta (unknown [192.168.82.133]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 42EFD2008088E; Mon, 6 Mar 2023 19:16:22 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [104.47.17.177]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 1470A2008006F; Mon, 6 Mar 2023 19:15:27 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RUqnvXe6mUH1bBpjIasxEMdHbBP/iAKAVzpT8jmM+SmYfJ67yChiasxueS1AFD+NhH7g4b8J4FX44/7ANPfibddXlFHzszohaBUiU+1kJqOBUBCveG00nmubs9ef1FI5p1XvFQDGN/UFGsSMu2FuPrI1aKF1Vk5ilRw71J2re+9B+5EoXJiXjZCTHGwnc9nn3rrOo0tBmIb1XE0DtAZqyHz+/GBP+Qrr3KWwicdTqyMH1JBI7jabRQ2XOtbygmYLw29RymBDmoSGIPD7xQho4Ro5X5cw1cK2zO2Wo3yB8Kn37O/Txm/sLv94+E0t+kZjXAaUif33S1xeZNr8rcdAMQ== 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=LRoDDvinI3bzAhNZtEHDnCdEHKTE8WBoLmSiBtr9wwc=; b=DXlRqM5mrvAlU/qT9O6MlC1dnjVotbsaYYhe3MSzbmdzujx4uXndjNQY1mVjL3AilRRnaaODzKwMTeK6mu1kJtzb0IuKsxHXB8zeKAX7KQ1wrJtpMef7VDqlQuZU3RjUQLjVoHQBRD5StlcWrTfX1uIe6hHx91KPNwB3WzfzjkqopzxrsfgRspPNdt0xSnB0zWJY39br1rdJ3aacQdzZjiTSbpjNDf3vlF7J1eXuw8hwjubEebJzBMiDRJC/wUEwCnsfFc+7PUpGMo6FJNx/XRYJj2vlC23OOnyv5IT3xRtU0szC7Rm473sFfuOZsWbigG6BEYj4Xai9JJkFp5Kemg== 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=LRoDDvinI3bzAhNZtEHDnCdEHKTE8WBoLmSiBtr9wwc=; b=dGx4DioS7IHNY0VnESET17XGkCF+mpUrozXGQR/E9vgCTq08Y9srToFNVZ0LG2vwl5M93aW3PTMcm+ocHM35FuilYS0BiVcyjEZ18LPnoxXsJDYy7qLJfw9Q3o36M2Efh6wVmlFcp+rGIHzzLCEZ5hwBQgoAGPPdZ6WHXthmXXFYdq1oGPDo3C2/M41kDIA3mG8s84ZZ0glxPnOrCjAw1zRa+6NHQJAQkcqGAe1eIfJXnouDzdvAzyMrI877sZCZ/v0Re4iSec+CVVx/zgcmsuehKkKhzS1jl1+Lay9opeOQFHXFwNHcbLLfrVMuD1VWMrBzq4qDrq3vzTp5Z3YG6Q== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by AS8PR03MB9511.eurprd03.prod.outlook.com (2603:10a6:20b:5a6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:13 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e%5]) with mapi id 15.20.6156.027; Mon, 6 Mar 2023 19:16:13 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, Ioana Ciornei , Rob Herring , Camelia Alexandra Groza , linux-arm-kernel@lists.infradead.org, Bagas Sanjaya , Krzysztof Kozlowski , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v10 11/13] arm64: dts: ls1088a: Add serdes nodes Date: Mon, 6 Mar 2023 14:15:33 -0500 Message-Id: <20230306191535.1917656-12-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230306191535.1917656-1-sean.anderson@seco.com> References: <20230306191535.1917656-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:208:23b::20) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS8PR03MB9511:EE_|VI1EUR05FT006:EE_|DU0PR03MB9615:EE_ X-MS-Office365-Filtering-Correlation-Id: 851a1cb8-f598-457f-8b1f-08db1e7745ed X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: nXGYLsktqeGC96m5Vn8yLHYG9AwVl9vbwAvlbs1O1g5ZJukJgtDOGtz1qSL/sMqbVaDvQUxyY7/qWLqtKnuNMtXhcAFZsY4pn5bZBl/0IHRN2g+inq3hhBlO7uXsqqJ9ebcbxl+HzpiIjScWw/cMU6p+R4uHyPC8xlf73n9n4aIRLXNOYkJxCNmn32uqCiKiSgbqVn0T3hS2ERVf+BHaWeWMU3V9p1wHLNKLzGcAH8pyTuy2PXD4YphEHKyMZiuLqc8etsWQb7/bawEJPHCgjw89y9uvoC5I7v+DR9E9nOFMhupP3Sll15GRhFRR98d8PNj8KqvB1l7y7c7HxyxgX/93fEC5hoX+xByUl/Yqq09okTgjXUTdYqZgke6Ns73RHDEMRfB7Sr9cgiYCZMahIRVyGaLpcVP17WhnSlWMntlFm5WXXRM78ZzxWkU/mCAabn1X7SJJ2jV/Lf7HYpk7AG4Bw6cBqyDkqXB5CWao3khjqrmfrq7JJBuI8fhd2MeCSTxat+V0kR0+VzLRjaSo4fGEe8fGz0i6b4TNw2hJtG1gpJtZVM12OLZYcyHfFT0flds79EXPEXplz5jxHM+p2b08uj2R9dGYlHZjRlBuXgrSgXlP7IN1YDfUP2JSzIGcul+HQq/9aIjmFLwTNiyFmiqnzNfcfHONIO86H372wt1bEhhnxYUD1h0t1sqt9YdTpQBkhpj0gIWPXKxvYCY1Ug== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(346002)(376002)(39850400004)(396003)(136003)(366004)(451199018)(110136005)(54906003)(36756003)(316002)(83380400001)(86362001)(6486002)(6506007)(186003)(2906002)(5660300002)(66476007)(4326008)(8936002)(66946007)(41300700001)(8676002)(478600001)(44832011)(26005)(6512007)(1076003)(2616005)(7416002)(52116002)(66556008)(6666004)(38100700002)(38350700002)(21314003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9511 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR05FT006.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3e764f3a-1712-4bf7-ca84-08db1e774065 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bLDTcmUU9MNdurVUK+AR34We/UQM25YFzP1toA/l8IWmQxdR+6/hKUDk40Gjd1DXFLI09fsERIdGu/Ttlad2zZjGDkb8OHftFORa1Srkd/hNX3C95VfNiy1sNZZKlzLaP/xCDFqFz0P4JdO+rDCMGa7/FCnLFd87yHwu03uzMyD+oYs0EwDVuiZpq+jt1ZHZuEEquW41vUPA+217kIljOuUtpjhTwIzfvthkPKGq+/CxNMEw5Vn1DChp6ld0SQZpjfZ/dXyyDJu/FIWobKSQ+VYtDvlSO6ip2Qb0NBe0HJHfsC4wItsdi6UXy8A4YWRWFKUIIq/bDGIaUuvSfDqH0xNBgi7Ff6DRJgHaeBxz2i2/RVGDUHaCUJ40MJp4dcx1wg5g3Re2s2f5f3e8l9COsMD2BvmtVSSO/BCvOhnzds8+Tt55IWAytXg+f11K/ki2p/12gvVuVh0JOk3RFBDKmmuBtf8G3t7JoeB7NL+TQXP+H6NU27ueMqPmTT49V4NYa6/YdSSZ1+yDa6YB+ByPLAtfTVFoa5oMXuxRRFShhwuIpMk9CzCZ1X9W78UJMVBosicHh4EirOcaxB0NSMd2MWE261/ekmm7SU1Ijorsbok3neKTgVgaFU6ycwojtJSt6qAPiZrX7Mkn/BORbsNOoFgI61wHuv18uT8VZGKBllemplSZlgRPmbrIl0Mj86RzYSfDlrD+KWW0ix7jYsxMXd8CJYynlGgKDO06uNsUeMSg8AnDOX4tGhnsD7svbpc7CIkbJAKpCoAS7xs5rQ8Cvw== X-Forefront-Antispam-Report: CIP:20.160.56.82;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:inpost-eu.tmcas.trendmicro.com;PTR:inpost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230025)(39850400004)(376002)(396003)(136003)(346002)(451199018)(5400799012)(46966006)(36840700001)(40470700004)(8936002)(5660300002)(7416002)(44832011)(70586007)(70206006)(2906002)(8676002)(4326008)(54906003)(110136005)(316002)(478600001)(6666004)(34020700004)(36756003)(47076005)(36860700001)(6512007)(6506007)(1076003)(6486002)(26005)(2616005)(41300700001)(7596003)(40480700001)(82740400003)(86362001)(83380400001)(82310400005)(7636003)(356005)(40460700003)(186003)(336012)(21314003)(12100799021);DIR:OUT;SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 19:16:22.5412 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 851a1cb8-f598-457f-8b1f-08db1e7745ed X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.82];Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR05FT006.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR03MB9615 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230306_111627_069549_C7BDCD3F X-CRM114-Status: GOOD ( 10.69 ) 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 nodes for the SerDes devices. They are disabled by default to prevent any breakage on existing boards. Signed-off-by: Sean Anderson --- Changes in v10: - Move serdes bindings to SoC dtsi - Add support for all (ethernet) serdes modes - Refer to "nodes" instead of "bindings" - Move compatible/reg first Changes in v4: - Convert to new bindings Changes in v3: - New .../arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi index e5fb137ac02b..59b401daad4d 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi @@ -9,6 +9,7 @@ */ #include #include +#include #include / { @@ -238,6 +239,131 @@ reset: syscon@1e60000 { reg = <0x0 0x1e60000 0x0 0x10000>; }; + serdes1: serdes@1ea0000 { + compatible = "fsl,ls1088a-serdes", "fsl,lynx-10g"; + reg = <0x0 0x1ea0000 0x0 0x2000>; + #address-cells = <1>; + #size-cells = <0>; + #clock-cells = <1>; + status = "disabled"; + + /* + * 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>; + + /* SG3 */ + sgmii-0 { + fsl,pccr = <0x8>; + fsl,index = <0>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + + /* QSGb */ + qsgmii-0 { + fsl,pccr = <0x9>; + fsl,index = <0>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + }; + + serdes1_B: phy@1 { + #phy-cells = <0>; + reg = <1>; + + /* SG7 */ + sgmii-1 { + fsl,pccr = <0x8>; + fsl,index = <1>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + + /* QSGa */ + qsgmii-1 { + fsl,pccr = <0x9>; + fsl,index = <1>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + + /* TODO: PCIe1 */ + }; + + serdes1_C: phy@2 { + #phy-cells = <0>; + reg = <2>; + + /* SG1 */ + sgmii-2 { + fsl,pccr = <0x8>; + fsl,index = <2>; + fsl,cfg = <0x1>; + fsl,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>; + fsl,type = ; + }; + }; + + serdes1_D: phy@3 { + #phy-cells = <0>; + reg = <3>; + + /* SG2 */ + sgmii-3 { + fsl,pccr = <0x8>; + fsl,index = <3>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + + /* QSGb */ + qsgmii-0 { + fsl,pccr = <0x9>; + fsl,index = <0>; + fsl,cfg = <0x2>; + fsl,type = ; + }; + + /* XFI2 */ + xfi-1 { + fsl,pccr = <0xb>; + fsl,index = <1>; + fsl,cfg = <0x1>; + fsl,type = ; + }; + }; + + }; + + serdes2: serdes@1eb0000 { + compatible = "fsl,ls1088a-serdes", "fsl,lynx-10g"; + reg = <0x0 0x1eb0000 0x0 0x2000>; + #address-cells = <1>; + #size-cells = <0>; + #clock-cells = <1>; + status = "disabled"; + }; + isc: syscon@1f70000 { compatible = "fsl,ls1088a-isc", "syscon"; reg = <0x0 0x1f70000 0x0 0x10000>; From patchwork Mon Mar 6 19:15:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13162251 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 5B81AC64EC4 for ; Mon, 6 Mar 2023 19:24:50 +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=NFVS7vTirK5AbEwpWkk+j7R2REZGErD2/QojExyKF1I=; b=N67lB/1v6+5mYe bkAd0Py2maVk+Q7RKiJ4PQLvrRXaDe7P9RNLRWWO3Jt2sc3ywRPjm1mCTnTrmAZ0t7EblDJgjHTdf 65+NAKha3zo79uxfTIu1RhB2dxRsJw6RI16YbwfBoxPPPhzngrLMuT0sS6jQQt52F1LSO/eQMBOgf IzL2dovNB3UZxix4WPgs5f7zj+/8hQS0XjBmJ3UxIXkvp1MJj6GnidnNLuEnxpS9wni6NWR/swE54 Y1J3bYvvIb4hjc4uV05TvNUa8GdhtkD33rR6/xqRhdPwSpM0PuUgJPeqptj6H9ygRBEtW6sj0nfLv 7i6piQbF6bXYZS4OQ50Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGS0-00EZSM-BF; Mon, 06 Mar 2023 19:24:49 +0000 Received: from mail-db3eur04hn031d.outbound.protection.outlook.com ([2a01:111:f400:fe0c::31d] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGK0-00EWIa-4x; Mon, 06 Mar 2023 19:16:33 +0000 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=vpZmh4r7VLUlTccmB8UP7KLEKxBYPMGpEwwLMpgpm6E=; b=gR89kiXYnP+Gbtr6MSn1u3c+3nFvsv3KHs9PNGwGoIPSumJoYZ2bpPhrmMDlBnX5Bx5mD92coShLFYum/4VqoFdvzpShuf51eWZdoFMO8DM27K+rpGkBtLNf1gyMQxh4Xt/+dEWbwkesOLFJ1Z1jV+zC30A2A0pSJc3+SeHwp8N0Tzv1IQFlQ9h71OHzw7v2oJFhL/QjDJ5SPimE3hyTph/LDyAVZQUVkQXob24m6gByyTlCPsQe2e+qqUl4m3T2OHk+QD7Mgk1nyDwvuWZs4vTBckltDAziiIUZxeSXvvdUdDc4dLdbJhyodhpgTq43BOFn5LrV5OJIwig2s4aIqQ== Received: from FR3P281CA0093.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a1::13) by VI1PR03MB9986.eurprd03.prod.outlook.com (2603:10a6:800:1c8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.25; Mon, 6 Mar 2023 19:16:26 +0000 Received: from VI1EUR05FT048.eop-eur05.prod.protection.outlook.com (2603:10a6:d10:a1:cafe::b3) by FR3P281CA0093.outlook.office365.com (2603:10a6:d10:a1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15 via Frontend Transport; Mon, 6 Mar 2023 19:16:25 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 20.160.56.86) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Fail (protection.outlook.com: domain of seco.com does not designate 20.160.56.86 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.86; helo=inpost-eu.tmcas.trendmicro.com; Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.86) by VI1EUR05FT048.mail.protection.outlook.com (10.233.243.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15 via Frontend Transport; Mon, 6 Mar 2023 19:16:25 +0000 Received: from outmta (unknown [192.168.82.132]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 45FB420080270; Mon, 6 Mar 2023 19:16:25 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [104.47.17.177]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 184602008006F; Mon, 6 Mar 2023 19:15:28 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WnO8WHh0L9oCcYvWTEFpkNbVPaVP4zMqUPZF3qGrnnLLSKUqmtc/l1+JrF1XJhYJ50FW02AysNsTJP8zqlaNCqnm+fWMNvzUw9amEx++AEQ8n2TtcteaFLsRpFXq/nLSvSjCKIAxuuNxWvG4x7AcOFJMnp6SPh5AyPb89fRrRU8gQ352vM3Aaap9PBHxrAQTHXbhytNdAAM+ttScf69Jr0Cp3iOYxOGYrnBeeetjkoHukBvBjKDAvJKDpHH+7aODKA9qzl+ns09aynjpYbgIoHEnYWhtAQJn4QmT10cfxxM1ONr0lnC6235yhAtboHq7ecS4ANIjVHsm0KmDNHaehw== 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=vpZmh4r7VLUlTccmB8UP7KLEKxBYPMGpEwwLMpgpm6E=; b=mhZG/9FqHoqd/oU+jzuBdR+1reso5n0tnBlqPdnDhRv6okqv6Zkb/T7bcg8TuhMz+SK9WjPYHbUAP9SHh8x+phkZmFzH7Whq2Zp4KuhEfQtzbBfyZlUKHuZSDWwl3e1xJ5rGxT06E82mWSIgTjnpi0luTyNlqGSWdT101m/RE4WqKj0cHg7cFDNWvnh9ZITa18Z/qWFG5brYfsjQHSCJe/d922eyB3bYNmkXBpxE/YjD41RxN5N/Y2rMC1/dpX6CX3B9LjLN94dKbds10+wvdW2oCVNMuoEO03p39/0elxq4N2XzpWyVSMrAR1f0ja4zc2DraZWdcjNl+9vKC6aotg== 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=vpZmh4r7VLUlTccmB8UP7KLEKxBYPMGpEwwLMpgpm6E=; b=gR89kiXYnP+Gbtr6MSn1u3c+3nFvsv3KHs9PNGwGoIPSumJoYZ2bpPhrmMDlBnX5Bx5mD92coShLFYum/4VqoFdvzpShuf51eWZdoFMO8DM27K+rpGkBtLNf1gyMQxh4Xt/+dEWbwkesOLFJ1Z1jV+zC30A2A0pSJc3+SeHwp8N0Tzv1IQFlQ9h71OHzw7v2oJFhL/QjDJ5SPimE3hyTph/LDyAVZQUVkQXob24m6gByyTlCPsQe2e+qqUl4m3T2OHk+QD7Mgk1nyDwvuWZs4vTBckltDAziiIUZxeSXvvdUdDc4dLdbJhyodhpgTq43BOFn5LrV5OJIwig2s4aIqQ== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by AS8PR03MB9511.eurprd03.prod.outlook.com (2603:10a6:20b:5a6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:15 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e%5]) with mapi id 15.20.6156.027; Mon, 6 Mar 2023 19:16:15 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, Ioana Ciornei , Rob Herring , Camelia Alexandra Groza , linux-arm-kernel@lists.infradead.org, Bagas Sanjaya , Krzysztof Kozlowski , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v10 12/13] arm64: dts: ls1088a: Prevent PCSs from probing as phys Date: Mon, 6 Mar 2023 14:15:34 -0500 Message-Id: <20230306191535.1917656-13-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230306191535.1917656-1-sean.anderson@seco.com> References: <20230306191535.1917656-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:208:23b::20) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS8PR03MB9511:EE_|VI1EUR05FT048:EE_|VI1PR03MB9986:EE_ X-MS-Office365-Filtering-Correlation-Id: e510b069-a73c-4007-6c1a-08db1e7747ba X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: TzFwa/1eww9rLl16I/0cCaqd9iFGqAjLdhdD9jEK6GQHWsWHe3HicuDNt1yifl3jCppLfkxqCLomViab0suS34/8qQWRH7pQnmIz/ZsFyOy9XO6Lw/MXv3WM8q+O0/GrEH/8WaSpeZJr5RgQMhH728gtSegT7vQpn8c13TXag0ekwv4Rg1m4g3pO5CvsHiW5cvRz3gpQegdVRKKfk9r21Ueyo1o4Wm+H0j5a3qU7pTuUDR41KsvXsoNgLTBYBVIrZzX0tjDuTnB8QcdzhhharC1c/S52obzWtalD45WTRrLkJoxvJ/Cj+jP7kF1hFP1D6WZmxvXMUOK8lpKix5rYeYKrf4giGztJ5FeVTxowbaUGD4xgkSlr1O2KqLuE7LHRTv4lkBJAmO0s+uLU0a5Ti0IG7IV4AzVN1+/fHoepOfb0fPLPiJvYbHtfbpJrrRSuRRV8qCsH+NF66WutmHLbPPxUUqJPeoh6apOHYhJC0/U/sbQMIvc/+gJxZTiplB6ugB+up8NojljLBG6pCySNmkdnLhB0r8CBnpqstLH/NNL1TfPzADs+cCWCewgkQWKI+leNC4vbQFKnAyL45vQUmj3GkcOP4YTYsXmADrj50bCUN52MsCiWI15BdbOo9pQ6I3MUooLFqnk78LCItW7m2abPeued7MMkhfUvx4haKeKujrDxp8xvD53LACPSJ6MpkC+svIUTaEFmSWew6xVXJA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(346002)(376002)(39850400004)(396003)(136003)(366004)(451199018)(110136005)(54906003)(36756003)(316002)(83380400001)(86362001)(6486002)(6506007)(186003)(2906002)(5660300002)(66476007)(4326008)(8936002)(66946007)(41300700001)(8676002)(478600001)(44832011)(26005)(6512007)(1076003)(2616005)(7416002)(52116002)(66556008)(6666004)(38100700002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9511 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR05FT048.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2c9ed15e-1f6c-4fb3-6232-08db1e77416e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: REEHpX1gZlbo24lL52MbOwSEdeYCnJpFUg+7vLlBuIpYHS3leL40n0VUjhx1OCVxNV29uUF5l8alUMSKYeMR69mZ167CwNSU6QdGQ3+6IzGqC2HouYyGvjsKxZ4qkWTt33BolSNBryDnbvyN3b9StW7hqu6+utdFfHDK9wrRnw0SIgsqiljI1CpO70qZs6wiDJPevbveUy6DP88R87HOtNKLTpPK3PplBBH/Lwh2d5oKl+6kw0S0obid+6hbBADeUpmKvxLy5b2MNw11/FH/rS4z9NqzVoZVBftTOon+8YXvEfRoqY9I8jbIsk/odr0ZGFzGqBhSfYY0FBhNRdLEWRrJYMDZKhxDyR8Pt6XfLZ1tWaSUXEcp+gz/1OQyc0jI5nF9qvmOO43eeIRfZGeOxu1FDco0UxAtiqBPmmS+dVAegEJL7i2LN2kZBiO4V0hLWww9GV+dpUrj/mG0o8uDzBoerlWGEGl9v2TSWzBfrsF1KnSP3gdXlkVqL86/PDK4nVBjGKR2cjHoyJQ1jOaC/o04wlAsG3kZK32fjqiCGbEN2ecdpTaG8F5GIQlvKDoLkvWLuMU1V+EF67p3L3O5+5JlUnEsnAX4Kix6GTkfN0jwkkudh4OPVCM30GAgxBa5TH3SfhwjG1zBrxAv6fTba2/9mqg+tzz4qwN3UxMlTq1H6uUOvz0Qt45AsGSVrsVrs790bE+NoAPZHXPycJ04b4DpIpnQFZUHteiHSD88pPM= X-Forefront-Antispam-Report: CIP:20.160.56.86;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:inpost-eu.tmcas.trendmicro.com;PTR:inpost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230025)(136003)(396003)(346002)(39850400004)(376002)(451199018)(5400799012)(36840700001)(46966006)(478600001)(34020700004)(83380400001)(47076005)(36860700001)(6666004)(36756003)(82310400005)(316002)(82740400003)(110136005)(356005)(54906003)(7636003)(7596003)(6506007)(6512007)(26005)(1076003)(2616005)(336012)(186003)(6486002)(41300700001)(86362001)(5660300002)(44832011)(8936002)(7416002)(2906002)(70586007)(8676002)(70206006)(40480700001)(4326008)(12100799021);DIR:OUT;SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 19:16:25.5460 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e510b069-a73c-4007-6c1a-08db1e7747ba X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.86];Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR05FT048.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB9986 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230306_111632_244253_4034E8CE X-CRM114-Status: UNSURE ( 6.11 ) 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 --- (no changes since v8) 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 59b401daad4d..bbc714f84577 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi @@ -932,7 +932,8 @@ pcs_mdio1: mdio@8c07000 { #size-cells = <0>; status = "disabled"; - pcs1: ethernet-phy@0 { + pcs1: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -945,7 +946,8 @@ pcs_mdio2: mdio@8c0b000 { #size-cells = <0>; status = "disabled"; - pcs2: ethernet-phy@0 { + pcs2: ethernet-pcs@0 { + compatible = "fsl,lynx-pcs"; reg = <0>; }; }; @@ -958,19 +960,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>; }; }; @@ -983,19 +989,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 Mon Mar 6 19:15:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13162236 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 027F4C64EC4 for ; Mon, 6 Mar 2023 19:23:14 +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=cWmunR7XGIUrsOZegzP/uvT6PW2F3VrmaMwKoDjW7yg=; b=djF5PwEBKw/ohh qWisMKW6G//3OMdhkpZbxLAHzuMSYcbhQyOcJ0meZU8dUG8Ky+Zlv9eyoNqjFr5Q7XLaNNpskypNe IH/fmT8zt/iCFZ3IcwgB6E+qNPVh9O3eogTZxqSQ6rwZ4brGpl6QtCSIZ0sV/vxa6UO0SjkQOiKcw KTAJmxHWjJ95bfAWfgJpDWlT1pCQM8quNjb1gtOsxe5lLUkJSggpdBsMZvHcAzLURl4qmGY2D1Bxi RVI8hHevU/jqG0Ef6mrpBXP4oJu0JcGjCzMmi+k/DfOjBKzMgrSs35z4X4S7gyWGPL/FfiGswkOY2 77tB9TDHGmrq6XEImD9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGQU-00EYts-3s; Mon, 06 Mar 2023 19:23:14 +0000 Received: from mail-he1eur04hn031e.outbound.protection.outlook.com ([2a01:111:f400:fe0d::31e] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZGJx-00EWHD-Ma; Mon, 06 Mar 2023 19:16:31 +0000 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=x0k1dBOnRRIZ0foq6DkXCs+MwrGvcfVRbv933nJMvXk=; b=TT/M78C9OONHEAW49HtawRenD36fiycUbKhpHAXWdIZf7OWyyW0C2rBwOpujQ/kda8J51Hm+mmNE23phqtH82et9bjocc2HLh/crPWkD6HnBghsPlhaeMGy0IrmfntQsaf4sT5JOQNvC1A8Qzr5Yz2tCyVDdM0DG3x1oU8jkL45Ibc8+f7fl9ioZwnHAR+YU43cSigANzCWcoWGXQBwIEjZ+CnEnH9GRbwO5QFnIpwIHc91WoAg3iPADPOg4XMm2cFpz+S+XV2Tq16sG5fBQjqPHvra/pHAKn+ke5j1eCQCX75t46slibd0BbBvjpu0OZMoXBDr9EuHu9Q1HAc3Vgg== Received: from FR3P281CA0184.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a4::19) by AM9PR03MB7557.eurprd03.prod.outlook.com (2603:10a6:20b:414::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:23 +0000 Received: from VI1EUR05FT046.eop-eur05.prod.protection.outlook.com (2603:10a6:d10:a4:cafe::89) by FR3P281CA0184.outlook.office365.com (2603:10a6:d10:a4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15 via Frontend Transport; Mon, 6 Mar 2023 19:16:23 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 20.160.56.81) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Fail (protection.outlook.com: domain of seco.com does not designate 20.160.56.81 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.81; helo=inpost-eu.tmcas.trendmicro.com; Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.81) by VI1EUR05FT046.mail.protection.outlook.com (10.233.243.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15 via Frontend Transport; Mon, 6 Mar 2023 19:16:23 +0000 Received: from outmta (unknown [192.168.82.132]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 10CE42008026C; Mon, 6 Mar 2023 19:16:23 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [104.47.17.177]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id D7AF320080074; Mon, 6 Mar 2023 19:15:28 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MnMsa/Z1AAkLxR5D22CbQtuRfQVRNEK2ZM4E6O1qFAnxt8DlInu0TRwxB4By/pKFjgs0iggCdn+rI9HhJL0TlKnXM+wAENiNq/BJU1k/y2LNCFuhaSw/22PC9PoKO5TOWYDp2axSXhfnmBQNSjnFmrVH7K6lqDYv4bQJoHxLaEVB35RLzpzV3wVaVxhFvd48lOEw9qxWzEgPvRST/Jtp8PkZkztGIeBplMEUhQlGtDq5WxpKFqxXIdIDMdagiOVP+FAFJ3LpByAu0sIQcE3BuQSKfliJ62Ky2v+2QLArgsXEZVhpl7dYJkyxDapz4pYAfNSQ0rz+9WG2KbjFL6lG8A== 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=x0k1dBOnRRIZ0foq6DkXCs+MwrGvcfVRbv933nJMvXk=; b=UhcrPYUg5S/yNRQ6DDIAPMCpuxgHPCCh3k/UBzhqVY2PsqY4Qt8TGfx1v+WHTqKhBljzDCgarRpIeX/SeG2b+i/d+6mxVqyAn356yLIK3UQmfIPG8NrkfkvNktRSYBGhp8ORnAU7QlHrpEuFIMM0s13Ps9ytIrhoi3L/OuVh5wAfDfvEMIH2ejHIvjslf71w8uPNNS7Db4H1QOQyhGD0kVPDvAJBuedZCAiujIrpP5+hg51hNf6htjIjBwdoDU1eRRRcIWuJ6gQ/XQSd0jt8u/wsQYItXy6tuafjR6KXkGCqZM7ArU0EvPScGWqCVmUKUqIXSZghD1m4AtaL+H530A== 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=x0k1dBOnRRIZ0foq6DkXCs+MwrGvcfVRbv933nJMvXk=; b=TT/M78C9OONHEAW49HtawRenD36fiycUbKhpHAXWdIZf7OWyyW0C2rBwOpujQ/kda8J51Hm+mmNE23phqtH82et9bjocc2HLh/crPWkD6HnBghsPlhaeMGy0IrmfntQsaf4sT5JOQNvC1A8Qzr5Yz2tCyVDdM0DG3x1oU8jkL45Ibc8+f7fl9ioZwnHAR+YU43cSigANzCWcoWGXQBwIEjZ+CnEnH9GRbwO5QFnIpwIHc91WoAg3iPADPOg4XMm2cFpz+S+XV2Tq16sG5fBQjqPHvra/pHAKn+ke5j1eCQCX75t46slibd0BbBvjpu0OZMoXBDr9EuHu9Q1HAc3Vgg== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by AS8PR03MB9511.eurprd03.prod.outlook.com (2603:10a6:20b:5a6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Mon, 6 Mar 2023 19:16:16 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::dbcf:1089:3242:614e%5]) with mapi id 15.20.6156.027; Mon, 6 Mar 2023 19:16:16 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, Ioana Ciornei , Rob Herring , Camelia Alexandra Groza , linux-arm-kernel@lists.infradead.org, Bagas Sanjaya , Krzysztof Kozlowski , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v10 13/13] arm64: dts: ls1088ardb: Add serdes descriptions Date: Mon, 6 Mar 2023 14:15:35 -0500 Message-Id: <20230306191535.1917656-14-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230306191535.1917656-1-sean.anderson@seco.com> References: <20230306191535.1917656-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:208:23b::20) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS8PR03MB9511:EE_|VI1EUR05FT046:EE_|AM9PR03MB7557:EE_ X-MS-Office365-Filtering-Correlation-Id: dbdfe894-192e-476f-12d0-08db1e774668 X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Rp2c2fXDAmSnqTQQ/uswtk/OGLo88oIoch7XQnbAghsOomc87VHkQSx+vXi+n2o9Bv7RT8bPahKFjviwer7hq92kDtIIqkhUJ6DQPvGS9KGNjZw6Jpg1VgWm9TbLdK9UeIwX+eqSvp7U2GPweJxZjyuASMF/4jvsHuZWAoTDwk/4cRcRnmiu+eR5xLXSd9b/g6MCJvcnFoJMtpTDITsazyh1mRIdqGRp2vKk9fpJk0GOqrHygm1rgFW8UOtm/FDi0iO9UkA6U0ND0eBvSECDW2VF6Asl3hMjWO9vrJi1S1EV44c29iuCMNNPemHVPVqraChseHllVtZ8bkWgLodjqq4Ep7us/DR0p4EfhGWDAEMJUV0vr4j/mJKt9xit1+XXnesqOmC1074DpDsupyhSUvQyfGkZ1U4mFIokSSJeL7qtf0/4kJ7tMsMkY8+ENS+kyoW6dc8iXpvEqldoZryLw5CQOIuAby7i1QWAJ3885dTLCdrP4uECSjIWS7qqokae/RZzlj7LraTUjnObRsbN9I2VMu0nPj5fCqoEddtbDpFnd5tkcR8g6svOXNvNTyqG1sqwouvGXZnFm+23lNnHSiZHWn7KlKwN/XpxjapwJ7mXyfolj51gShBwzO0KN/2HMZGFBqRt2stCqkGjJgiTOAYXez2/SlY5L/L/7q7Ix3OJ+S8rXSMVtwv3J18AdrXs X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(346002)(376002)(39850400004)(396003)(136003)(366004)(451199018)(110136005)(54906003)(36756003)(316002)(83380400001)(86362001)(6486002)(6506007)(186003)(2906002)(5660300002)(66476007)(4326008)(8936002)(66946007)(41300700001)(8676002)(478600001)(44832011)(26005)(6512007)(1076003)(2616005)(7416002)(52116002)(66556008)(6666004)(38100700002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9511 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR05FT046.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 35a6dd7f-9666-4139-3f34-08db1e77426b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zCze0Uq1/X+IASUfsi6Mg3+VzQxNIa3Xfjj0SYB4mvaOjbQ+H8lz0nRN7i/CdRWbNSGS3ZH5K9JLcdGk1ZwcfblH6cFk2hmc8VX9vSK2VSXpFxZWCjnwMseeedTVMKe/SUL5sIOzKdq6SlRun9Lq09FQDrYQP5SAFpTCiQ5dXUVsVbPU1LzJvSx7PrQMKRGhL8VZfQFF7vUwZdVEQBlY+1oe3TtUFwwQDxYEIVQEzvP2XZHho/DOGy3vRjKpVw2Bp79rfqsZJNifCq1wuKULZrd8psSr4FXOeNpGTd2xDZzpimRoihB2zJ+ApE9+tAa/V4XdYQSW2yOKnxBqmohiDRJGbsB4zjymBnn4yDndw6ITHp3W3LqXvHtzoFxpt3MgtDK7cbjeag0LgKzOceJj5Up9J+TwLaCk9fZ+jwRhxoWnv681Ckcmo3qC+yN9ykRlVfsvq57+qiiE+Xtu1kSjkkhNiD0+nszNMK/TFxLEP0FTVSSlod6BSz28mChzUxXcuAOwS1t2ZXyGy8DoaNfaUMg/mQDdZFNxdEWahk+Gxcw+8+AfS7FNcmWtsjFTpc2Kpq6nVHAkdabKYmKa0V6eDj2BbyfWIQSnAJ5w63DRaFxnfzK6uI8tccnN9I4Tcyyt3SoGTqhlvgmdqKbR7zq4l1rADr+iV6faC49JMQ3DkHIzMiAbTwWz6EypobgCtmFnGZbDEXnf9Eu/grv42e/C59HB+/v3/l9m7LNJLTBYmAHDrS8fna1M2BWX+eqMOlqx X-Forefront-Antispam-Report: CIP:20.160.56.81;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:inpost-eu.tmcas.trendmicro.com;PTR:inpost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230025)(376002)(346002)(39850400004)(396003)(136003)(5400799012)(451199018)(40470700004)(46966006)(36840700001)(5660300002)(7416002)(8936002)(44832011)(70586007)(70206006)(2906002)(8676002)(4326008)(54906003)(110136005)(316002)(478600001)(34020700004)(47076005)(6666004)(36860700001)(6506007)(6512007)(1076003)(6486002)(36756003)(26005)(2616005)(41300700001)(40480700001)(82740400003)(86362001)(83380400001)(82310400005)(7596003)(356005)(40460700003)(186003)(7636003)(336012)(12100799021);DIR:OUT;SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 19:16:23.3130 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dbdfe894-192e-476f-12d0-08db1e774668 X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.81];Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR05FT046.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7557 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230306_111629_948908_B73CA3DB X-CRM114-Status: GOOD ( 15.40 ) 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. To enable serdes support, the DPC needs to set the macs to MAC_LINK_TYPE_BACKPLANE. All MACs using the same QSGMII should be converted at once. Additionally, in order to change interface types, the MC firmware must support DPAA2_MAC_FEATURE_PROTOCOL_CHANGE. Signed-off-by: Sean Anderson --- Changes in v10: - Move serdes bindings to SoC dtsi - Use "descriptions" instead of "bindings" - Don't use /clocks - Add missing gpio-controller properties Changes in v9: - Add fsl,unused-lanes-reserved to allow a gradual transition, depending on the mac link type. - Remove unused clocks - Fix some phy mode node names - phy-type -> fsl,phy 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 | 82 ++++++++++++++++++- 1 file changed, 80 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 ee8e932628d1..ede537b644e8 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts @@ -10,17 +10,55 @@ /dts-v1/; +#include + #include "fsl-ls1088a.dtsi" / { model = "LS1088A RDB Board"; compatible = "fsl,ls1088a-rdb", "fsl,ls1088a"; + + 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 = <&clk_100mhz>, <&clk_156mhz>; + clock-names = "ref0", "ref1"; + fsl,unused-lanes-reserved; + status = "okay"; +}; + +&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 +66,7 @@ &dpmac3 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs3_0>; + phys = <&serdes1_A>; }; &dpmac4 { @@ -35,6 +74,7 @@ &dpmac4 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs3_1>; + phys = <&serdes1_A>; }; &dpmac5 { @@ -42,6 +82,7 @@ &dpmac5 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs3_2>; + phys = <&serdes1_A>; }; &dpmac6 { @@ -49,6 +90,7 @@ &dpmac6 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs3_3>; + phys = <&serdes1_A>; }; &dpmac7 { @@ -56,6 +98,7 @@ &dpmac7 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs7_0>; + phys = <&serdes1_B>; }; &dpmac8 { @@ -63,6 +106,7 @@ &dpmac8 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs7_1>; + phys = <&serdes1_B>; }; &dpmac9 { @@ -70,6 +114,7 @@ &dpmac9 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs7_2>; + phys = <&serdes1_B>; }; &dpmac10 { @@ -77,6 +122,7 @@ &dpmac10 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs7_3>; + phys = <&serdes1_B>; }; &emdio1 { @@ -128,7 +174,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 +216,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 +236,31 @@ 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"; + gpio-controller; + no-output; + }; + + brdcfg9: gpio-controller@59 { + #gpio-cells = <2>; + compatible = "fsl,fpga-qixis-brdcfg9", + "ni,169445-nand-gpio"; + reg = <0x59 0x1>; + reg-names = "dat"; + gpio-controller; + }; }; }; @@ -203,6 +277,10 @@ &esdhc { status = "okay"; }; +&pcs_mdio1 { + status = "okay"; +}; + &pcs_mdio2 { status = "okay"; };