From patchwork Thu Apr 13 16:05:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 674221 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42AE0C77B61 for ; Thu, 13 Apr 2023 16:06:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229895AbjDMQGw (ORCPT ); Thu, 13 Apr 2023 12:06:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjDMQGv (ORCPT ); Thu, 13 Apr 2023 12:06:51 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04hn2232.outbound.protection.outlook.com [52.100.17.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDD5F9EC9 for ; Thu, 13 Apr 2023 09:06:49 -0700 (PDT) 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=2CH//UUBiMJ6jNJs2fmYAxQuiso9y3L+oPbyOEjbjpo4gO6bGRYHGVUiieckadrE8NxI00HCLjXJ78MgNJBosairfrlpzUWsF5b2ztGIOkKcEw61cp1XwBxzpmoojzKuO6YishmmnviiAZdLbAyYLBf7UjSY2z2FPZo+3GoKjKAtI+qQlSa6liN9RxELffqfJ5ZDhgwXW0W4Kz+vCd9SYmavJ7Uya7oWh9pEH/TFRt8dYsZuHMLUVsY6+xtijPQ7qRZofq+zMjyHI7T4tZvjQIQv4PVkVSwld1jZ5PObQsIIazPLcs+zzZHlN1smdA6sEuQvfFEUYLxGerP+mqK42w== Received: from DB8PR03CA0022.eurprd03.prod.outlook.com (2603:10a6:10:be::35) by DB4PR03MB9505.eurprd03.prod.outlook.com (2603:10a6:10:3f7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 16:06:47 +0000 Received: from DB8EUR05FT067.eop-eur05.prod.protection.outlook.com (2603:10a6:10:be:cafe::1d) by DB8PR03CA0022.outlook.office365.com (2603:10a6:10:be::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 16:06:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.86 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.86; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.86) by DB8EUR05FT067.mail.protection.outlook.com (10.233.238.176) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 16:06:46 +0000 Received: from outmta (unknown [192.168.82.140]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id AC24E2008026E; Thu, 13 Apr 2023 16:06:46 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [104.47.18.109]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 7000820080073; Thu, 13 Apr 2023 16:07:58 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eCqt876Doq84kzg0J+tTvMfPZwc1z+DLmBobonN+Pc94u3UY01fxvkCWmOW9UtBjxWSn0ZnoiW1XTtpmov0brDouVd/Mhs4S7cNO8pafFT7q4oygle5SkkJsyG9kdQcJb0MZt2dmaQ/q3J3sL6Cb+eObzMqQ4dV4zvWw8Wig9zIIMK5TACSBUijJBeNlQ50l4ys9mh61mQna0zekEcW+dl9W+BarWvu/c/CW23ll/UgEgk8K0EJqfkCEZRi5kaGedFBGWFKmE+DSDysKooQiMQIOOsA+BN19+oiaZfmwDSqhnryA6D1bAXgyaPM8beibc2NVCAZS8xjSoc/uxp07qA== 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=hNfRcAy3PtmsKFUrAUJm2zUw/Bs6RW2C7W4wjjf6YMHY7inbsm0tmldk4erYb8tICN7pHMZw6KsIlRkSgSR5PE5f+2Qj0PUyud21TYqzQU0Y6v3KYC8vvqDaP3XlQjUH6uidhgh0bmoCFEgC/H/jW6e91TNwSbFcYmmjKEn69kzpEZimGrLoBgKP0oUwG+7DjLIYBzzKQUq0t/rH9POArdkGGzsrUAwVaz6r5Ej9mC0KVlCUFoPqvumLDFfiEDEp7SX6NrSOTKxYmLDFUWpWNr1d6GfVpRh5O51j7jqi+s14+q/gCM94y5Ao/b7SGwmHGQ+Wg9v0uoWK2wBZ96R9ZA== 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=2CH//UUBiMJ6jNJs2fmYAxQuiso9y3L+oPbyOEjbjpo4gO6bGRYHGVUiieckadrE8NxI00HCLjXJ78MgNJBosairfrlpzUWsF5b2ztGIOkKcEw61cp1XwBxzpmoojzKuO6YishmmnviiAZdLbAyYLBf7UjSY2z2FPZo+3GoKjKAtI+qQlSa6liN9RxELffqfJ5ZDhgwXW0W4Kz+vCd9SYmavJ7Uya7oWh9pEH/TFRt8dYsZuHMLUVsY6+xtijPQ7qRZofq+zMjyHI7T4tZvjQIQv4PVkVSwld1jZ5PObQsIIazPLcs+zzZHlN1smdA6sEuQvfFEUYLxGerP+mqK42w== 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 AS2PR03MB9369.eurprd03.prod.outlook.com (2603:10a6:20b:57b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Thu, 13 Apr 2023 16:06:35 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:35 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Rob Herring Subject: [PATCH v14 01/15] dt-bindings: phy: Add 2500BASE-X and 10GBASE-R Date: Thu, 13 Apr 2023 12:05:53 -0400 Message-Id: <20230413160607.4128315-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS2PR03MB9369:EE_|DB8EUR05FT067:EE_|DB4PR03MB9505:EE_ X-MS-Office365-Filtering-Correlation-Id: 95b21b17-12fa-435a-b371-08db3c391541 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: uznfmbuog7bnkcw91lEg7GBn/rUo5R1Z3QSnSrKII/URV1TePZGRwhRA486/lJRuSiPgmmMgbOCV6evOWe6CJMsFspsfWwXYn0zhTMG7I3fbRCZ74BnGnRrQ8QjaAGMxfIqM/CWP8c/C67JDtQCRaZ9rABTgZHiywe6fMcc1shnz0Xj8bkelwwBXi+1fkWRwJRqdHJ4Fq+t+aTtBRMTqpaZKASYEqMxKKBTli0O18srrOGKzgbYDim8Sr/hzu/Ro4V4a2t3ZbtSI4ePPTnu+IL0f6whTgDlyHAJAwNO/xlwGXWeoR4kXnDOKHRbztAsCT5fvDa6s2GJ70LMbTbdsnHsDHSiUodB7O7anbDN6UAq75UW9wTfz8W/KvMEOwNXjCf9bqLTw2eXsYUrrsGqKS1YF14cYs4INStmWsvyhCKOgP0hCj8LNYcUPPX+MAdkq0bD0HNLWrzg+RWiHxF0EES0A24ZkjZkaLe8x9TWxqf8AcfNxHB0qRRFWa+oGrj8MbIlZVAa0OPjY+vsBh/TVnol5zrIoGQJgwEXvPQm/CaywpMVdXN46ZlovnK5/yPfQxCvpNUkF5Yx7fSlu3luAN83uuphijQH+WwvC9wONgNI= 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:(13230028)(376002)(366004)(346002)(39850400004)(396003)(136003)(451199021)(478600001)(52116002)(6512007)(83380400001)(36756003)(38350700002)(2616005)(86362001)(38100700002)(966005)(2906002)(316002)(6506007)(26005)(110136005)(186003)(1076003)(54906003)(5660300002)(44832011)(66946007)(6486002)(66476007)(6666004)(8936002)(41300700001)(66556008)(7416002)(8676002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9369 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB8EUR05FT067.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 01d280c2-bddb-4f1d-05ac-08db3c390e11 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1BAJOoDfZCPrZBPz8IR+H3Qo669bAcglUSVngZoC6LYn2yvnP2nqef+lriBx78CnyCzAIjOjeJpTJFIsc+aYn73/+zW3rz29bN4f9AWs0z988HoSiojFNupI3FqKGu8PPs0sXm/DpDVklQP1whhQRwqufkSpTvNpRZoc+36TQVbmhcREW74GdHKjC19lQVCaeTH9HLoFujtGKpDeLYjPjFWjoLhZKVQro++WEhwqRXanUnijbbPsuqDdZAQZj0GLSEkZzuJYLY5qrL//mPTqJJOa8gcwfCWnX1b4bP0zx2JJrYdPNku96g6/myjHxx+e5xWsg+dcplB8d7OLYlAveV/RJ89Pt8nkRWhq5WJzyHyhQVYj2QaHldf26EjYRu0WzkPp3ZT1bCw8IPI9Uf5sUppbdHBuMj2QYsgtlppCHLLikiZD6kM52aWZnK11dpxGOm4UcPJucrs8GNnirERHFL1iY8O88MXGdB7eGJB3hwtEovBcuqOlkA9bGznjnz0cb6rwLx4bOYdwVNpTMHlLXQgxQs/5U/t2dDY5a3/wQ7tXv1z0xW/XspzDAvwwohSlnYHieBZg/HlPjY0LDK6x02QnZBxuCFICpntBOqxFSTQl1VJenOMIgek19rphI5V97VTSLjVND+AwgncTBOq4jPphoM5/ZXwIFG+2t9r0ndoeQpMEKDPPAh+WziK7Ba89vOCu/HVxN+9P6X4pbriLYuQV4Au9FLSfLrqCy8lNrEw= X-Forefront-Antispam-Report: CIP:20.160.56.86; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(39850400004)(136003)(346002)(396003)(376002)(5400799015)(451199021)(36840700001)(46966006)(478600001)(47076005)(36756003)(83380400001)(7596003)(356005)(82740400003)(7636003)(86362001)(336012)(2616005)(34070700002)(36860700001)(40480700001)(44832011)(2906002)(966005)(316002)(26005)(5660300002)(6512007)(1076003)(110136005)(6506007)(186003)(6486002)(82310400005)(7416002)(41300700001)(8676002)(8936002)(6666004)(70586007)(4326008)(54906003)(70206006)(12100799027); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:06:46.9549 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 95b21b17-12fa-435a-b371-08db3c391541 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: DB8EUR05FT067.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR03MB9505 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This adds some modes necessary for Lynx 10G support. 2500BASE-X, also known as 2.5G SGMII, is 1000BASE-X/SGMII overclocked to 3.125 GHz, with autonegotiation disabled. 10GBASE-R, also known as XFI, is the protocol spoken between the PMA and PMD ethernet layers for 10GBASE-T and 10GBASE-S/L/E. It is typically used to communicate directly with SFP+ modules, or with 10GBASE-T phys. Signed-off-by: Sean Anderson Acked-by: Rob Herring --- PR increasing phy-type maximum [1]. If this commit could be applied sooner rather than later, I'd appreciate it. This should help avoid another respin if someone else adds another phy type. [1] https://github.com/devicetree-org/dt-schema/pull/85 (no changes since v6) Changes in v6: - Bump PHY_TYPE_2500BASEX to 13, since PHY_TYPE_USXGMII was added in the meantime Changes in v4: - New include/dt-bindings/phy/phy.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/dt-bindings/phy/phy.h b/include/dt-bindings/phy/phy.h index 6b901b342348..5b2b674d8d25 100644 --- a/include/dt-bindings/phy/phy.h +++ b/include/dt-bindings/phy/phy.h @@ -23,5 +23,7 @@ #define PHY_TYPE_DPHY 10 #define PHY_TYPE_CPHY 11 #define PHY_TYPE_USXGMII 12 +#define PHY_TYPE_2500BASEX 13 +#define PHY_TYPE_10GBASER 14 #endif /* _DT_BINDINGS_PHY */ From patchwork Thu Apr 13 16:05:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 672917 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57506C77B71 for ; Thu, 13 Apr 2023 16:06:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229580AbjDMQGv (ORCPT ); Thu, 13 Apr 2023 12:06:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229869AbjDMQGu (ORCPT ); Thu, 13 Apr 2023 12:06:50 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01hn2236.outbound.protection.outlook.com [52.100.7.236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D0389EE3; Thu, 13 Apr 2023 09:06:47 -0700 (PDT) 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=Iie0Bl1raO6MNQbx9dABBRV7HF/h/2HGK/e4/Sj3ooA=; b=SHaGty8Dw93kOt4UlQwURXnHkx+d4fr2lC8X4DWP5Rs+hrjwy1QKV3aqBTDolYGEZzUp1ufpl2RgE7XMlzKHQnGH1OBYgLsvE1HbouUk9mhAZ3Pv8UQxYLDZbPL/FBvmMkRkUlXJCgsoSzTvnnqrfzqkB3lMKS9O3owfWLg2vhNms/kyMEcsF/KPYn9Sk3OKE58Qbf9Hwprcz0F7i6rimhFk8YF+jtkhs2YRG9lZoqJ+9jvmVdoLazxc7nOsK9S519FnJqJCJ9cTWb6QDGUFtIpt/Y7pHmrbMknrxDWbKOxXvFkh9Oz1hToKnQXAv+HLJF2tlSHSvJu8Lcfy0D34XA== Received: from DB9PR06CA0020.eurprd06.prod.outlook.com (2603:10a6:10:1db::25) by DU0PR03MB9256.eurprd03.prod.outlook.com (2603:10a6:10:474::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 16:06:43 +0000 Received: from DB8EUR05FT054.eop-eur05.prod.protection.outlook.com (2603:10a6:10:1db:cafe::5e) by DB9PR06CA0020.outlook.office365.com (2603:10a6:10:1db::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 16:06:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 20.160.56.84) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.84 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.84; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.84) by DB8EUR05FT054.mail.protection.outlook.com (10.233.238.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.33 via Frontend Transport; Thu, 13 Apr 2023 16:06:42 +0000 Received: from outmta (unknown [192.168.82.132]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 9CD262008026E; Thu, 13 Apr 2023 16:06:42 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [104.47.18.109]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 2F30720080074; Thu, 13 Apr 2023 16:07:59 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eTBrs9dKpxpRivW0SdZSKHy6AfhRjBJvywj5Ga67bO3AnHwcvVLCzIJnCYcjPANVmM9y89SpVwjb9IVyBVmkKKl8avw2D8yHL1kmZLBjqAYTfSfd7okQlQqJrsZeOu6u2rJ1OSlxuDszXLjR5XPjD55UzKhMkFB5sJmNgsfM68jXb2DfeNQQK839dil8VCqPC4ebJpb6uSq0VLqdAvWElpxfUK7z+jzcxY/WVfbfcsbh4oxImPd+YldvWEk+bM7FHBG+6f1UYhsihmrSsGoxRVLi1f71JNoKIuMq2gf2zAqUTGOLREs/x2RVOafxTZjKojWMLvm7FvtZsaxoMZyhnw== 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=Iie0Bl1raO6MNQbx9dABBRV7HF/h/2HGK/e4/Sj3ooA=; b=myNywdWrTBgYtjEGBsxv7bmn7KnMuHf7Vz/TBmfim7DJNHczWodMEya5eAlmxOFX1C/8LiMHLZTEnzHTH0XZ8cG2mARc1YqZihETBsgng8W9C0MxrVnw/xE1xec5zWUzwcJ7maCl5xTwOGXe1kIT8t5kFcsLFZH5iXn3AftsFGJ73qEhCZpNQGOolzRtI6jSvzaEDjmUEz1E8k/WuSzaUAlNYmcLLcxBnpZ8WUaqrS7Z5ccJAuVlraOjPtblDjp0XCsuCOhzCxtDm45W7fST5LRaXqNMHKuByKV0zpgidhdBGRjmoWrG9p1tWhtrOLCR0gNcOEYpeVLrxiBA9XXiFw== 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=Iie0Bl1raO6MNQbx9dABBRV7HF/h/2HGK/e4/Sj3ooA=; b=SHaGty8Dw93kOt4UlQwURXnHkx+d4fr2lC8X4DWP5Rs+hrjwy1QKV3aqBTDolYGEZzUp1ufpl2RgE7XMlzKHQnGH1OBYgLsvE1HbouUk9mhAZ3Pv8UQxYLDZbPL/FBvmMkRkUlXJCgsoSzTvnnqrfzqkB3lMKS9O3owfWLg2vhNms/kyMEcsF/KPYn9Sk3OKE58Qbf9Hwprcz0F7i6rimhFk8YF+jtkhs2YRG9lZoqJ+9jvmVdoLazxc7nOsK9S519FnJqJCJ9cTWb6QDGUFtIpt/Y7pHmrbMknrxDWbKOxXvFkh9Oz1hToKnQXAv+HLJF2tlSHSvJu8Lcfy0D34XA== 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 AS2PR03MB9369.eurprd03.prod.outlook.com (2603:10a6:20b:57b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Thu, 13 Apr 2023 16:06:37 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:37 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Rob Herring , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org Subject: [PATCH v14 02/15] dt-bindings: phy: Add Lynx 10G phy binding Date: Thu, 13 Apr 2023 12:05:54 -0400 Message-Id: <20230413160607.4128315-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS2PR03MB9369:EE_|DB8EUR05FT054:EE_|DU0PR03MB9256:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f651e51-5340-4057-e9bf-08db3c3912cf 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: gu1313MhXkCYiTycdnLHnHAMoLN9r/V8eJTEI6BgMwRc0EQwposyTsPLUZp8tr3+d+4cOkmz1p8P6kXB50+IVFq27vAPr02+yoQnpMoSALG6fr9zOM4garz7yijlHHLOJjGyvFP6viTYmuuCAwZY3S4HGGn+O/NX/wBzt+yVf+AOHb8F4RSF0LWKfabZcuVHZjITFM9ddAmSXWmRqrw7zdFWEVkohHx/VnnjwVgFUJAhkfynLM0FwYI3GulMmkA29bEuIHwhAhgIOPsTZ35yKLUuB3WTbPMDPxGF6Fnr+1UsZ+Dy4HMwtW7utGw4UCkKWB0p/xwLQJwY0siRGqzDoS9JGNUs6gvOlW3ycQ3OyyfEMuWqX5v64s135fymg4E33eILYcotVtkXo4Qr/o7sevFiIAw3Zmyjl1M+G2aYqKgH+yX0dmzLDjw+S4IotIJW4+kHf8NOH2iuvAUw+uaI2jWrzI5+6XjSPzpf4fOj4INueMhvcwfQWYzsVllvaTIPWTF1ZDm193QUss6ldZTrk213dOQB7vMPcFHSugBaCFQFRUpk3O3XSTopB0m/xTJUmP1JG22MPEeL0l0q+AyxJZeRkJHpFVMr22Ggrd7DW68= 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:(13230028)(376002)(366004)(346002)(39850400004)(396003)(136003)(451199021)(478600001)(52116002)(6512007)(83380400001)(36756003)(38350700002)(2616005)(86362001)(38100700002)(966005)(2906002)(316002)(6506007)(26005)(110136005)(186003)(1076003)(54906003)(5660300002)(44832011)(66946007)(6486002)(66476007)(6666004)(8936002)(41300700001)(66556008)(7416002)(8676002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9369 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB8EUR05FT054.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c3e00170-c233-48c5-9460-08db3c390f25 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MzhJAaMkHNS9MgtOgZaJIZiW9qbfe8sI7sJz3qHzALw5qs+vYCuTPio4p/Mb2i7GafVuT3E+5foovslipe947v+20hQIiFMYGd8jF9LwzImem1yJL4WcEBzPJawNiKPPHmp5Nyp0IZGv+mYGIQ+2iqEQJtRdKRTK+yL9iXRgi8q68DWuqEQH2vR4DMGb3PSyimyBt7y/KdM1BTDL+rYXRm8tapezIXH8b+kEiNzwD6n5n1nGMzqqe1oQ61MKxtyzahr5oiYcuzAKx7+F0w8v6K71tQJW3P2I2BEjKyUn2DoXs4kqh2W9m7kb/m8S0SW+y5P/I9ClKjzhkYiOEXhBT2+RlukxEuf+ysmcGPZidWS/X7EdEtZqDgS+Ff0FOzlmX/DiIJVsPfK+j9120qM0bmxI1GTY7DoQuLswdBRxhpwqvxkarVt6xgeVwsP6otf+0RO6m0h2qi1v/8hRoZ31/jYERxew3R/rXhB/5jplNd7Nka+IHVHCjh7vHav8NFl6R0Fdfj2M5OoGQjK/tb5TRpYnc7T00j6CoHCI4VcyYuE5AS8uUy/Clh6HVL+rdjbmC6bU3xTD9PoOO0PTAoStRtPdlqBefNEslf0GzPWUIhIVnm0tBDVW/BRQTLyKcsZkn0OqvAck4ZZPCubr3A5txXfQfgsdSab3DSKVr5fkXqRa+wKahWQK+nUaxYKQY27BM8g/v/F8MgFZQeSBKfIYShaqy7DLpAHdPwJjfoZ0xNO+vwiyHezv2p+t7hNO+dsb X-Forefront-Antispam-Report: CIP:20.160.56.84; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(376002)(396003)(346002)(39850400004)(136003)(5400799015)(451199021)(46966006)(36840700001)(40470700004)(40460700003)(47076005)(36756003)(6486002)(4326008)(41300700001)(54906003)(478600001)(8676002)(70206006)(966005)(70586007)(110136005)(316002)(86362001)(336012)(2616005)(6506007)(6512007)(1076003)(83380400001)(6666004)(26005)(44832011)(2906002)(7416002)(7636003)(5660300002)(40480700001)(36860700001)(82310400005)(8936002)(7596003)(82740400003)(186003)(356005)(34070700002)(12100799027); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:06:42.8537 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f651e51-5340-4057-e9bf-08db3c3912cf 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.84]; Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT054.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR03MB9256 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 Thu Apr 13 16:05:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 672915 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5501C77B61 for ; Thu, 13 Apr 2023 16:07:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230247AbjDMQHN (ORCPT ); Thu, 13 Apr 2023 12:07:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230263AbjDMQHK (ORCPT ); Thu, 13 Apr 2023 12:07:10 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05hn2214.outbound.protection.outlook.com [52.100.175.214]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1D47AF35; Thu, 13 Apr 2023 09:06:57 -0700 (PDT) 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=sJb/+504WXHQ0vfm/r2TyP5df7En9eevt1Go5VgD+A0=; b=XJs+KXWAYCOFCTOcjXc3B12UfGqByJf2ThxiiSUq/FswNpJh9zmGvKffY/PHbixeuUZ88xV9u6udVxocHtqFahftT71tGgPus6SkC29BHCr9mPnl28GHVJUvSDPcfhdx+gRQ+VxJg/pSwMpVq6ecS81y0gl0HCntPaKyuT1jQ36dShibAjLffeiEmnDt0XZZ6Qk9O9EtsOgLv5vNYfU71i3VDrEImi6sXdGQH4YbijHvjvDiehMU7JPFCcRsBxVNW4r0ArJbVOroDrrTFxI3gCdnszGs4NseqcEJoUrhqzSj4S0PJ3Wc3sT0qZzMTIlRJi2gzR30NHuxdG9z6/Pv3w== Received: from FR0P281CA0243.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:af::10) by AS8PR03MB9608.eurprd03.prod.outlook.com (2603:10a6:20b:5ab::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 16:06:54 +0000 Received: from VI1EUR05FT068.eop-eur05.prod.protection.outlook.com (2603:10a6:d10:af:cafe::f4) by FR0P281CA0243.outlook.office365.com (2603:10a6:d10:af::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30 via Frontend Transport; Thu, 13 Apr 2023 16:06:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.82 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.82; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.82) by VI1EUR05FT068.mail.protection.outlook.com (10.233.242.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 16:06:54 +0000 Received: from outmta (unknown [192.168.82.132]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id DD79C2008026E; Thu, 13 Apr 2023 16:06:53 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [104.47.18.109]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 0AC9420080073; Thu, 13 Apr 2023 16:07:31 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BGHt5MY/oQ73Ew5UDGWErIg+2tGQb3YZNN42iFnpN6Ol1aYj4AKeTEpoGLtxN0JEG+6MUA3t2wdrAE7KF1B0u9vDWeaiURjpia99RiJMXUrgULU8rXsuC8x1vNUweWKe6EkwLIRt/pwkz/mMo7CEXEAQ8OguKtisC1MjrTJJxQxqgJlREIO3OlZh/5Ns4VHXthl4QrvRKmaOFg/Vshg9WED9Jlsgnm41mAM4SuFMxKziUxukoJR+nnIJyYrr4yUV5/sj6Scm6Sx6VWkuFNpPQ7rdA++4jqTPMy0tHb2FnLTu00Vf7BSPm/BKZFKIfWoq9Tpzva9lLHxhWaccM+OYmw== 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=sJb/+504WXHQ0vfm/r2TyP5df7En9eevt1Go5VgD+A0=; b=SAlJDz36FU2cRnKVopMv6hY5V5N6qNOD3YkIgC2BHuF1mD8lCQHFSlGtHBY/JHBUhlP2GOQo6RlWZK0CMLSNynyTPsgDB4I/MwKRwU7twT7PtzgvndPtn/vP8puvkG7MAmZwaq95w43gI0QVfly/IYAUMca3Kr4Ai8B7CpanxHnPHcBu00J8Ke8CNGYC+SKxMNouLiYynwNCKuIwSTsnLNnuuGaAP/BwIRdtpFlyBAh+FbKdLEtdfaAQB+nv3K62RNSVTXdh0tiyVcnPmTCNcR5nkax3OoFPEt9NlZVoSd13VdNAlCOHEOFdH/30/a20QIrWYiyHxYBRcAzjS4Wfkg== 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=sJb/+504WXHQ0vfm/r2TyP5df7En9eevt1Go5VgD+A0=; b=XJs+KXWAYCOFCTOcjXc3B12UfGqByJf2ThxiiSUq/FswNpJh9zmGvKffY/PHbixeuUZ88xV9u6udVxocHtqFahftT71tGgPus6SkC29BHCr9mPnl28GHVJUvSDPcfhdx+gRQ+VxJg/pSwMpVq6ecS81y0gl0HCntPaKyuT1jQ36dShibAjLffeiEmnDt0XZZ6Qk9O9EtsOgLv5vNYfU71i3VDrEImi6sXdGQH4YbijHvjvDiehMU7JPFCcRsBxVNW4r0ArJbVOroDrrTFxI3gCdnszGs4NseqcEJoUrhqzSj4S0PJ3Wc3sT0qZzMTIlRJi2gzR30NHuxdG9z6/Pv3w== 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 AS2PR03MB9369.eurprd03.prod.outlook.com (2603:10a6:20b:57b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Thu, 13 Apr 2023 16:06:39 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:39 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Linus Walleij , Bartosz Golaszewski , =?utf-8?q?Fern=C3=A1ndez_Rojas?= , Jonas Gorski , linux-gpio@vger.kernel.org Subject: [PATCH v14 03/15] dt-bindings: Convert gpio-mmio to yaml Date: Thu, 13 Apr 2023 12:05:55 -0400 Message-Id: <20230413160607.4128315-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS2PR03MB9369:EE_|VI1EUR05FT068:EE_|AS8PR03MB9608:EE_ X-MS-Office365-Filtering-Correlation-Id: 82bea6f6-8219-4357-f98f-08db3c39199e 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: QgzXOa9K5l/Rb5jYvRg+YhezBOVAYtIImtZ+qE8USOXC2fMcKNNbECKULnMQqMjKGGHo447A6/fAkLlvgduy1ZrEdCIapFUuSgo8PD7Oe8n6Bc/Xu0qXK90fTBUqfOJyGNhwHba6V3dLiZ40auKjZZecN+rTbRVsW3IyRpS4mfBDg/2yTm5b6mEf+TqcfJeBLQ8XlC8B1wSR5tSb6mzwHByMY2HgifP++jSPS6nfsAbdIhc0mghwo8e4JVF+0IntiPayWHubGUPPzrLocl0Vq6EXdTofbNGpKzd8ZC7PwO5FqAsugZhOpm3N3+kgxu+YFVBiEXzEQzcMTL/TDENG7vLK1jBoXoibWY7cnrhMWOeeSHbHXp/cndN+UYi2zoAeXSmBY8HnsckVvUs5VBAMjJ/jyildHV8vWPE7GUc0RkBXT0Mhu91GZNjQglq/215MT5Ub/Oq4Lt3T7Bt5TPck8s9fsoXWVmS8htoq+GsvdC2LMx3hSmKhE+tWMxsl1uL8ocmUGX9ITyYtAD8BeDIWf0jzZ6dO+S+D7XsZ8fHgP1Yx50sEktxwVikPRZx/nqFjTbCsoXey022JMO7g4KcL+Fe7HECbZU0/6UX0qO64+NU= 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:(13230028)(376002)(366004)(346002)(39850400004)(396003)(136003)(451199021)(478600001)(52116002)(6512007)(83380400001)(36756003)(66574015)(38350700002)(2616005)(86362001)(38100700002)(30864003)(966005)(2906002)(316002)(6506007)(26005)(110136005)(186003)(1076003)(54906003)(5660300002)(44832011)(66946007)(6486002)(66476007)(6666004)(8936002)(41300700001)(66556008)(7416002)(8676002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9369 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR05FT068.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 386baa7e-5b21-4665-103d-08db3c39105e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nHTPo9ofgMCjl0R0lCMvTQcf/PEJHywEzDuPppi+RSCNozlakPir+1vZdUGStdvaSwPserqvsjzVaimIqjmR43l/O28szGgk5OVYvd5H0esD3LSGidqcjts7TtytW+lmTtxDQTi8sYBbEvbEcVbwE7mjalRESHJ5sj/OJPLxE4qYjf4jMvrbeJ9GLuoudoC1sBihpuYgrzvLp4iC52Pav/y+ghDFK2XJUXTVUgOieKA4FqcdPoNyTVt98R6iXr651ienLK682D8kTXYiibY3gjab8SlmkvKkZkFgRvphSsxsBw1qtYyEXOHG9UA+V/tIywWbsw/d4xADicuWj8R95mrvLhzfmCVY5XSSSNLhhrypemZ0PW5fwiPN9m/kTzU6PRjCzbJXnzKs7FDVJVRkzynnVxyw24RgSBeAhEZU9RztJf6XaBVdGuTblMNnMsTqgIkko5Hvw7Bdx9f2tjp1FNFCQGMHGlRK+DU3L+QR4uyDys5BIf337vESV3xt8xy7+NsGHkohWIZx8Y+/m/tubhqAtoIvp7UFIWWZvQv4rqoEr+7Vz8uit2WAn0FDE/SAtMuxOksH8urFMEVsgKg3cAoDX0qMW43lFuPsEyiuWeEQgQ6tOgURA2ajckhzl30sZ8CNzDJ73M8O4TN9pJBAkI8+W4txJtuQTKRLg+xpLMojUrIKhxdQDbiM9QwT9yO1HPad4ivUnvT/VzdNjmGaqS58BVfL92aPX454v/+YwMSQSUIHpiktF+R4p3VvUaJX X-Forefront-Antispam-Report: CIP:20.160.56.82; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(136003)(346002)(376002)(39850400004)(396003)(5400799015)(451199021)(36840700001)(46966006)(40470700004)(36860700001)(478600001)(54906003)(34070700002)(47076005)(2616005)(6512007)(966005)(26005)(1076003)(6506007)(6486002)(6666004)(7596003)(356005)(82740400003)(41300700001)(7636003)(316002)(4326008)(70206006)(186003)(66574015)(336012)(83380400001)(70586007)(30864003)(2906002)(5660300002)(7416002)(44832011)(110136005)(36756003)(82310400005)(40460700003)(86362001)(40480700001)(8676002)(8936002)(12100799027); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:06:54.2614 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 82bea6f6-8219-4357-f98f-08db3c39199e 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: VI1EUR05FT068.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9608 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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, and some registers may be omitted. Because of this, reg-names is mandatory, and no order is specified. Rename brcm,bcm6345-gpio to brcm,bcm63xx-gpio to reflect that bcm6345 has moved. Signed-off-by: Sean Anderson Reviewed-by: Linus Walleij Reviewed-by: Rob Herring --- Linus or Bartosz, feel free to pick this up as the rest of this series may not be merged any time soon. Changes in v14: - Fix incorrect $id Changes in v13: - Fix references to brcm,bcm63xx-gpio.yaml (neé brcm,bcm6345-gpio) Changes in v12: - Put compatible first - Keep gpio-controller to one line - Add little-endian property - Alphabetize compatibles - Remove some comments - Remove some examples with insufficient novelty Changes in v11: - Keep empty (or almost-empty) properties on a single line - Don't use | unnecessarily - Use gpio as the node name for examples - Rename brcm,bcm6345-gpio.yaml to brcm,bcm63xx-gpio.yaml Changes in v10: - New ...m6345-gpio.yaml => brcm,bcm63xx-gpio.yaml} | 18 +-- .../devicetree/bindings/gpio/gpio-mmio.yaml | 117 ++++++++++++++++++ .../bindings/gpio/ni,169445-nand-gpio.txt | 38 ------ .../devicetree/bindings/gpio/wd,mbl-gpio.txt | 38 ------ .../mfd/brcm,bcm6318-gpio-sysctl.yaml | 4 +- .../mfd/brcm,bcm63268-gpio-sysctl.yaml | 4 +- .../mfd/brcm,bcm6328-gpio-sysctl.yaml | 4 +- .../mfd/brcm,bcm6358-gpio-sysctl.yaml | 4 +- .../mfd/brcm,bcm6362-gpio-sysctl.yaml | 4 +- .../mfd/brcm,bcm6368-gpio-sysctl.yaml | 4 +- 10 files changed, 131 insertions(+), 104 deletions(-) rename Documentation/devicetree/bindings/gpio/{brcm,bcm6345-gpio.yaml => brcm,bcm63xx-gpio.yaml} (75%) 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,bcm63xx-gpio.yaml similarity index 75% rename from Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml rename to Documentation/devicetree/bindings/gpio/brcm,bcm63xx-gpio.yaml index 4d69f79df859..62fcc2bd5d80 100644 --- a/Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml +++ b/Documentation/devicetree/bindings/gpio/brcm,bcm63xx-gpio.yaml @@ -1,10 +1,10 @@ # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause %YAML 1.2 --- -$id: http://devicetree.org/schemas/gpio/brcm,bcm6345-gpio.yaml# +$id: http://devicetree.org/schemas/gpio/brcm,bcm63xx-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..b394e058256e --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml @@ -0,0 +1,117 @@ +# 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: + compatible: + enum: + - brcm,bcm6345-gpio + - ni,169445-nand-gpio + - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller + + big-endian: true + + '#gpio-cells': + const: 2 + + gpio-controller: true + + little-endian: 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: + - | + gpio@1f300010 { + compatible = "ni,169445-nand-gpio"; + reg = <0x1f300010 0x4>; + reg-names = "dat"; + gpio-controller; + #gpio-cells = <2>; + }; + + gpio@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; - }; diff --git a/Documentation/devicetree/bindings/mfd/brcm,bcm6318-gpio-sysctl.yaml b/Documentation/devicetree/bindings/mfd/brcm,bcm6318-gpio-sysctl.yaml index 148f1da47603..9f9a14af875e 100644 --- a/Documentation/devicetree/bindings/mfd/brcm,bcm6318-gpio-sysctl.yaml +++ b/Documentation/devicetree/bindings/mfd/brcm,bcm6318-gpio-sysctl.yaml @@ -35,11 +35,11 @@ patternProperties: "^gpio@[0-9a-f]+$": # Child node type: object - $ref: "../gpio/brcm,bcm6345-gpio.yaml" + $ref: "../gpio/brcm,bcm63xx-gpio.yaml" description: GPIO controller for the SoC GPIOs. This child node definition should follow the bindings specified in - Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml. + Documentation/devicetree/bindings/gpio/brcm,bcm63xx-gpio.yaml. "^pinctrl@[0-9a-f]+$": # Child node diff --git a/Documentation/devicetree/bindings/mfd/brcm,bcm63268-gpio-sysctl.yaml b/Documentation/devicetree/bindings/mfd/brcm,bcm63268-gpio-sysctl.yaml index 7e582243ea76..803277dd2725 100644 --- a/Documentation/devicetree/bindings/mfd/brcm,bcm63268-gpio-sysctl.yaml +++ b/Documentation/devicetree/bindings/mfd/brcm,bcm63268-gpio-sysctl.yaml @@ -35,11 +35,11 @@ patternProperties: "^gpio@[0-9a-f]+$": # Child node type: object - $ref: "../gpio/brcm,bcm6345-gpio.yaml" + $ref: "../gpio/brcm,bcm63xx-gpio.yaml" description: GPIO controller for the SoC GPIOs. This child node definition should follow the bindings specified in - Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml. + Documentation/devicetree/bindings/gpio/brcm,bcm63xx-gpio.yaml. "^pinctrl@[0-9a-f]+$": # Child node diff --git a/Documentation/devicetree/bindings/mfd/brcm,bcm6328-gpio-sysctl.yaml b/Documentation/devicetree/bindings/mfd/brcm,bcm6328-gpio-sysctl.yaml index 2230848e11c3..b9a6856ce970 100644 --- a/Documentation/devicetree/bindings/mfd/brcm,bcm6328-gpio-sysctl.yaml +++ b/Documentation/devicetree/bindings/mfd/brcm,bcm6328-gpio-sysctl.yaml @@ -35,11 +35,11 @@ patternProperties: "^gpio@[0-9a-f]+$": # Child node type: object - $ref: "../gpio/brcm,bcm6345-gpio.yaml" + $ref: "../gpio/brcm,bcm63xx-gpio.yaml" description: GPIO controller for the SoC GPIOs. This child node definition should follow the bindings specified in - Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml. + Documentation/devicetree/bindings/gpio/brcm,bcm63xx-gpio.yaml. "^pinctrl@[0-9a-f]+$": # Child node diff --git a/Documentation/devicetree/bindings/mfd/brcm,bcm6358-gpio-sysctl.yaml b/Documentation/devicetree/bindings/mfd/brcm,bcm6358-gpio-sysctl.yaml index c06693b6f7aa..4651fe4dde07 100644 --- a/Documentation/devicetree/bindings/mfd/brcm,bcm6358-gpio-sysctl.yaml +++ b/Documentation/devicetree/bindings/mfd/brcm,bcm6358-gpio-sysctl.yaml @@ -35,11 +35,11 @@ patternProperties: "^gpio@[0-9a-f]+$": # Child node type: object - $ref: "../gpio/brcm,bcm6345-gpio.yaml" + $ref: "../gpio/brcm,bcm63xx-gpio.yaml" description: GPIO controller for the SoC GPIOs. This child node definition should follow the bindings specified in - Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml. + Documentation/devicetree/bindings/gpio/brcm,bcm63xx-gpio.yaml. "^pinctrl@[0-9a-f]+$": # Child node diff --git a/Documentation/devicetree/bindings/mfd/brcm,bcm6362-gpio-sysctl.yaml b/Documentation/devicetree/bindings/mfd/brcm,bcm6362-gpio-sysctl.yaml index c560bede0e37..0330b621fd38 100644 --- a/Documentation/devicetree/bindings/mfd/brcm,bcm6362-gpio-sysctl.yaml +++ b/Documentation/devicetree/bindings/mfd/brcm,bcm6362-gpio-sysctl.yaml @@ -35,11 +35,11 @@ patternProperties: "^gpio@[0-9a-f]+$": # Child node type: object - $ref: "../gpio/brcm,bcm6345-gpio.yaml" + $ref: "../gpio/brcm,bcm63xx-gpio.yaml" description: GPIO controller for the SoC GPIOs. This child node definition should follow the bindings specified in - Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml. + Documentation/devicetree/bindings/gpio/brcm,bcm63xx-gpio.yaml. "^pinctrl@[0-9a-f]+$": # Child node diff --git a/Documentation/devicetree/bindings/mfd/brcm,bcm6368-gpio-sysctl.yaml b/Documentation/devicetree/bindings/mfd/brcm,bcm6368-gpio-sysctl.yaml index c534f5f2404e..82d3e4415bda 100644 --- a/Documentation/devicetree/bindings/mfd/brcm,bcm6368-gpio-sysctl.yaml +++ b/Documentation/devicetree/bindings/mfd/brcm,bcm6368-gpio-sysctl.yaml @@ -35,11 +35,11 @@ patternProperties: "^gpio@[0-9a-f]+$": # Child node type: object - $ref: "../gpio/brcm,bcm6345-gpio.yaml" + $ref: "../gpio/brcm,bcm63xx-gpio.yaml" description: GPIO controller for the SoC GPIOs. This child node definition should follow the bindings specified in - Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml. + Documentation/devicetree/bindings/gpio/brcm,bcm63xx-gpio.yaml. "^pinctrl@[0-9a-f]+$": # Child node From patchwork Thu Apr 13 16:05:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 674220 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02643C77B6E for ; Thu, 13 Apr 2023 16:07:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229578AbjDMQHK (ORCPT ); Thu, 13 Apr 2023 12:07:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230095AbjDMQHC (ORCPT ); Thu, 13 Apr 2023 12:07:02 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02hn2202.outbound.protection.outlook.com [52.100.202.202]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 659BBAD12 for ; Thu, 13 Apr 2023 09:06:55 -0700 (PDT) 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=Qv1zXTjvA9ZGaObtt1TjejTod4QaRoQztRWwnCWrZJ4=; b=Y1/f5KdumMZdTEkQs+2y4FELDLC7MgF9YEbp/ZCCpdXmpQ/TzvX4DfpwsqSFn7elAM7iIWt335Yt1AkmUThhOOz7JDyTww1yw25eFBasYQL8qAKcr2JC3nkVPqXxJFS7cNwXhn/XYaTbl6rqFosC1D4Jq++sxX9VZ5xd4jstz24y/n4GVpDeGYaTZizaTbJUyXL8IU9IXXwnmxfwNF0yTHRb6pMJoeHA5jrlt9t0GrVihTZXg6jzd75UFZSDf9WwkKxRoBfdW35yuJ0ZcRJFk4Fae26Vft2OKXIv2gdRcinYCtBvmASjZLImCnQXDxtj/kDF6Il0hjjU4S3tJ9+Z6A== Received: from ZR0P278CA0027.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1c::14) by VI1PR03MB6429.eurprd03.prod.outlook.com (2603:10a6:800:19b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:06:51 +0000 Received: from VI1EUR05FT037.eop-eur05.prod.protection.outlook.com (2603:10a6:910:1c:cafe::41) by ZR0P278CA0027.outlook.office365.com (2603:10a6:910:1c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 16:06:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.81 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.81; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.81) by VI1EUR05FT037.mail.protection.outlook.com (10.233.243.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.33 via Frontend Transport; Thu, 13 Apr 2023 16:06:51 +0000 Received: from outmta (unknown [192.168.82.140]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id DE1A42008026E; Thu, 13 Apr 2023 16:06:50 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [104.47.18.109]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id DCB4D20080074; Thu, 13 Apr 2023 16:07:36 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d0oOoJ9IH2/7/HnHXSDu0uS/AP6DPAVz9+lRH+Z9lvYaxflVT7iZgwD5k8pldMagKGiKMLZKPFBm3ko6OWa4rPAyA/kz5re0ilroGPey2ScY8AAzyOyyJkoZ6pTgTxoJ9vJJBLfENY28cYfIPXmWG0DL55FMFNNBHQSJQgmePKz8WscR11X9MsQRuzIWe3ssa0Fm/ccmjyyUlIix58pA6nYcGb768G7ejpoMIyKZKTXDFkb3o6nS1ygukmDL1FIrA/BlgaqpFyUuIA8ro+5LsEA5z9xVHiSQQROlGGzJ7MEcG76j9MWiZYq6XEg2D68qDgPMAIu98xluD23w2rMXCg== 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=Qv1zXTjvA9ZGaObtt1TjejTod4QaRoQztRWwnCWrZJ4=; b=IPObwcm06dsz1wKx8+0jkxCz7LqK5DpfovUCEfZtAkamYIHp1u9I241HwUYOqEtV6wOroEpBTfoT/CUYjwFD14xmK8xDeooCkxEvKVrlFA7o6taVYYqPn+pJWAw+UqYFjPm0z2Tlb/sD26ib+9+tGI8HJMDLD5c8xQ2Ff+4b0p4WL3whJzLrJ2Wi1ecm/VAP1O+cWvDFP5RXBACxVNnLdI2Ncw1E85fdymyrniGseWEX7Ld4OhoCech/ijpPDoLymUKHkYB3tS4Te9vYow4c5mBRCAKtQnPkpW0/u75d3WZeieiqVFNJQiQXDsPBj0y55JoColCTYkaCS/JiEZ+BhA== 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=Qv1zXTjvA9ZGaObtt1TjejTod4QaRoQztRWwnCWrZJ4=; b=Y1/f5KdumMZdTEkQs+2y4FELDLC7MgF9YEbp/ZCCpdXmpQ/TzvX4DfpwsqSFn7elAM7iIWt335Yt1AkmUThhOOz7JDyTww1yw25eFBasYQL8qAKcr2JC3nkVPqXxJFS7cNwXhn/XYaTbl6rqFosC1D4Jq++sxX9VZ5xd4jstz24y/n4GVpDeGYaTZizaTbJUyXL8IU9IXXwnmxfwNF0yTHRb6pMJoeHA5jrlt9t0GrVihTZXg6jzd75UFZSDf9WwkKxRoBfdW35yuJ0ZcRJFk4Fae26Vft2OKXIv2gdRcinYCtBvmASjZLImCnQXDxtj/kDF6Il0hjjU4S3tJ9+Z6A== 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 AS2PR03MB9369.eurprd03.prod.outlook.com (2603:10a6:20b:57b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Thu, 13 Apr 2023 16:06:40 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:40 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Rob Herring Subject: [PATCH v14 04/15] dt-bindings: gpio-mmio: Add compatible for QIXIS Date: Thu, 13 Apr 2023 12:05:56 -0400 Message-Id: <20230413160607.4128315-5-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS2PR03MB9369:EE_|VI1EUR05FT037:EE_|VI1PR03MB6429:EE_ X-MS-Office365-Filtering-Correlation-Id: 0688fe48-741d-43d4-e10f-08db3c3917c0 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: IA2/0iLOnpsfSZrmrOhMHt3FjobmWZg8e5OZe/wJYeW7GZdDVRbSkyVa2KHZHv4XZ6L8eoj5MIpZMPtVS1a4pjy7dzP34dUS8uaxRZcRNszC+64SEMqjZ9Ki9a9AfggYt7UvgBcTTMRSF7l5Znm/96nNkfS6TaFxV+25/vJXnJbLzPnMeKRX0gFvKE1pbZBAAYJAfiv8kQ3eX89FRt26FD+7kLj20dVRcSLG+I6h6ixiIR3GRwEBcYtmFjCnv/Gdhjt/PmfkYmY8ensvCHktkiaWvvXj+SZPcgT7xga0LU2Bq6zsYn5W7w7xBHeWgZGuv06q2YvA6yxaLZWpexf/5Ogt/8TdIsPdP3iG6tQfetQmLAIkHKc0+pF98S4W166G4HNIcYu8ii3pbYk9wVXvtIAMcadAO30iQWpD+5zxe+sm5Xxm1zkUoVc5Ds839ZFZTZl/5JLWB5ffV5g84Oe1ehNhebN4C3VlrDLDDLDvhHpM+jObWZ3rOa9nKrzadr9CR8BElBxK++uP4+niX/tituz2vtIy4oZCP+NeIiT07QDv0nFGssQepfvc2RevApLckJpUMxSIDj2RLdttgrqDOTgUoDUok1wOfmwbtpu02etA1wW1iHBgST9SU22DU+SU 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:(13230028)(376002)(366004)(346002)(39850400004)(396003)(136003)(451199021)(478600001)(52116002)(6512007)(83380400001)(36756003)(38350700002)(2616005)(86362001)(38100700002)(2906002)(316002)(6506007)(26005)(110136005)(186003)(1076003)(54906003)(5660300002)(44832011)(66946007)(6486002)(66476007)(6666004)(8936002)(41300700001)(66556008)(7416002)(8676002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9369 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR05FT037.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c2c86c40-fe6d-4616-ce73-08db3c391153 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FNwjiZ4gikd/n9zNwy0oXMSQd616x7muu1yDn4AsjHLrr7473ELiAukQ5cfShJWdPrEvjrx7ovnV/uZe09WQOENoUJetmuHq6SbTRcjtvty6tvZfBnQoJ+lyXMwWNtvfEr/s5z95wBxR6JNVCDXj8afLwh26hZz1gks7iq99amZJ+5H9vzHwI3W6zeJmAQqIABTOirPD4aJlgVlXEHM6FKeczDy6E10/0GN5Aikz2XAsZHSKM39XrDYfdcBTxTsZuiIwYQe/LtrFBr83J4yN0qPhItywyHw1fKSTuuyqpiSwRQuMropev7eWSMTUlz8fuk5RjDruKf4R5lsggJ/y4rbpV8f1Es1peaEDZi1WfjLH8Pbxb586phCXQ7cwq+vkYprCVbzOs7HMLbzWJr4nIed6ECOi5KgiwiLYV7ssw6eG69JDlQrrbs+NlVkTOHiU+uIGnVePgHOBCn7g231IuUpXAhv6dJDD2lQY8WtGZ5cCAHkyW3crTtxMPqm/JLNRuuov4x+qLpOTgE8TziSmtfqiHXim+9cgI8PKzncvqkJXdEgKi9kESI0uLcozLGhLja70nxFM111Tj3dE6CxLhOCjCWcOIacifi0t+n3tOsb4Syust8wE1WIfHK6Va4+uLJi4K6gna1ibqzAi9wrRnqG7rbd6tC/67ungIqs59J7qG429EwSLlOxgy0te4khlnIbYyG2ubZUFzVpEco89RUzoFWNK90/fQGpoHOhaAuU= X-Forefront-Antispam-Report: CIP:20.160.56.81; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(39850400004)(136003)(346002)(396003)(376002)(5400799015)(451199021)(36840700001)(46966006)(110136005)(86362001)(478600001)(54906003)(6486002)(34070700002)(36860700001)(47076005)(36756003)(2616005)(336012)(83380400001)(26005)(40480700001)(186003)(1076003)(6512007)(6506007)(82740400003)(6666004)(82310400005)(7636003)(7596003)(316002)(356005)(4326008)(2906002)(70206006)(70586007)(7416002)(8676002)(8936002)(44832011)(5660300002)(41300700001)(12100799027); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:06:51.1594 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0688fe48-741d-43d4-e10f-08db3c3917c0 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: VI1EUR05FT037.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB6429 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 --- (no changes since v10) 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 b394e058256e..5abf3dabcf39 100644 --- a/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml +++ b/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml @@ -18,10 +18,16 @@ description: properties: compatible: - enum: - - brcm,bcm6345-gpio - - ni,169445-nand-gpio - - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller + oneOf: + - enum: + - brcm,bcm6345-gpio + - ni,169445-nand-gpio + - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller + - items: + - enum: + - fsl,fpga-qixis-los-stat + - fsl,fpga-qixis-brdcfg9 + - const: ni,169445-nand-gpio big-endian: true From patchwork Thu Apr 13 16:05:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 672914 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E210C77B73 for ; Thu, 13 Apr 2023 16:07:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229699AbjDMQHT (ORCPT ); Thu, 13 Apr 2023 12:07:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbjDMQHN (ORCPT ); Thu, 13 Apr 2023 12:07:13 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03hn2248.outbound.protection.outlook.com [52.100.14.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23661A5DC; Thu, 13 Apr 2023 09:07:03 -0700 (PDT) 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=gUJ/kme1acvgiE39wCzO0ythXRadDAIXYZ4myCLIie3gBlbNQvAcndV9Q9x7XXewsEPsSQYj5nGtQg8ydBbTqGb7tBMHGWzDoQDJ/9XuTND86+01xsMPJXGBqhttvUyqWzCYWGtqfmgiSikP5winE2ZIZDbwoO7BbVDKDM/WODZQyHKq1jAgcCy5oRmzrUn9z51u1RYfNyWtyU70TprbV2Z+NuNjLGExeWUpN9n3wJB+O0iloroGY/ODxMw2a2Llp8EhPUscgFG291gWBhgEAbXHLfmfFxj5EoB1F5xtKRWXZUWHryipNpzKQVxeodXBqVj3eHy+q5lQltw2SA6Sjw== Received: from AM6P191CA0053.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::30) by PAWPR03MB10043.eurprd03.prod.outlook.com (2603:10a6:102:35d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 16:06:59 +0000 Received: from VI1EUR05FT013.eop-eur05.prod.protection.outlook.com (2603:10a6:209:7f:cafe::c3) by AM6P191CA0053.outlook.office365.com (2603:10a6:209:7f::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 16:06:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.80 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.80; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.80) by VI1EUR05FT013.mail.protection.outlook.com (10.233.242.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.33 via Frontend Transport; Thu, 13 Apr 2023 16:06:59 +0000 Received: from outmta (unknown [192.168.82.140]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 067D02008026F; Thu, 13 Apr 2023 16:06:59 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [104.47.18.109]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 5C41420080073; Thu, 13 Apr 2023 16:07:41 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hHEgl0OqHjF01XqpcOne3xfe7nv6Qsa1mKUmED0vrBJNkh1QMOhObtwQ59HGvfZrNVf8XEavhIoNLtzMT0pWSp+FiXHqFI6LRIX1T7sXcd2gV1LUTbh0JGknJyYVaWpRVq3+5M737dtCv+E2gm/wPYTt45hs1E51M6cfsojjSl2M1kp45LdOCTWNQNX4A75mlJSuOhmxPKrGJ4DUMSDF+r+AVe6LT8+kYmLmMzG+xLgJJ967V18XJVnML0YuJmwPw42lIhWY1iY1X2cs+aFA/mSMdNA8tjZW/MuYodDUwuniqY44/4yg4OWMi5FKJ0Zp1NJX2I7p7nWRrXelGdMvKA== 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=fHr7T022I0TDM5xRP7OPIVMxO1pfdJs6ZLYvz+3dJKqcUf2p5xa9hRDRNZflbjj/EjuL/SuU0QnLzFu0vwPhvvStqs2Lgg7jGy84QL8IzU86+XIpu6ywE+8YsogmGTmB8R4G7+Ub7ANOtTzeCVzDDcfzGMtrPzWq+ptM4e+/zG01Sq75+IG1KjQyUzwAhE3M9azsWkLVZAPolPUh0cfDNoQd4fWOOd077X9GMrxmXmf9z0ST6QYPsw3LNcgd4e06z+64PPfhMB6QGWfACoebMTa2s97K1IJmgXru/q78iuappo2fsk5qec3inoaiaCkvth4HsNbgrYI4bwlp0tkHtg== 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=gUJ/kme1acvgiE39wCzO0ythXRadDAIXYZ4myCLIie3gBlbNQvAcndV9Q9x7XXewsEPsSQYj5nGtQg8ydBbTqGb7tBMHGWzDoQDJ/9XuTND86+01xsMPJXGBqhttvUyqWzCYWGtqfmgiSikP5winE2ZIZDbwoO7BbVDKDM/WODZQyHKq1jAgcCy5oRmzrUn9z51u1RYfNyWtyU70TprbV2Z+NuNjLGExeWUpN9n3wJB+O0iloroGY/ODxMw2a2Llp8EhPUscgFG291gWBhgEAbXHLfmfFxj5EoB1F5xtKRWXZUWHryipNpzKQVxeodXBqVj3eHy+q5lQltw2SA6Sjw== 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 AS2PR03MB9369.eurprd03.prod.outlook.com (2603:10a6:20b:57b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Thu, 13 Apr 2023 16:06:42 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:42 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Rob Herring , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org Subject: [PATCH v14 05/15] dt-bindings: clock: Add ids for Lynx 10g PLLs Date: Thu, 13 Apr 2023 12:05:57 -0400 Message-Id: <20230413160607.4128315-6-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS2PR03MB9369:EE_|VI1EUR05FT013:EE_|PAWPR03MB10043:EE_ X-MS-Office365-Filtering-Correlation-Id: 641395ad-04a6-48d8-5eb8-08db3c391c9e 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: xUMhQtmRZlWbp4rva+FPwQQfKBhHq7n0sIBbDMiNo6NhEqAV7PEBeuaFQWJFN6LS90l0Tuhgo1rTDKc6epo5rVGazj44PpaCq3//8uvsxGW+g9LXB9uwSckzaQL2T9m0LWOTBwqfohHZaEYX5M+7y02/paGJKQPHOJV9lpB5XloHZ30ak04TUGOCi+e+Iika1ek0Z13x29SsWTZdnafCWXqZQPpZvIezsmR0HzqrrO/VbExZo66QQ8o2lKk1BGSIMutPRB5do+Dm34jr118INAuvtkMyXWL/lfOLUTxrvdOLzsW+JGPjn8nAteQ+QGt01TydxXVqgm+folk2d5UZM+wUQM90NDYqEQ0Zx7JxKgZCRdaSlG0P0SI7wi/nazoCj38mSaY1LXWfVl285aLdJr5/HcbqsFkci2qq9L4RRxM27jjqXYvjqfh2+sUVWwBgjnNTEd98bI7ou1XZXN8JGxr2kMUScJA678/xZ99xy4Wdq08Hx6OdynguRFSzbot72svr5DzJFxj5BsHooiQ1K0HjXHZUj6PoZD4eICFPZJExWqYtdTil1hOu2XReMPqEtVSIXYiaHyD7V1w2gfGvHxTBG98fli6ObC2tYjvDa1qWMhk548XwMvIVP2db1rZP 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:(13230028)(376002)(366004)(346002)(39850400004)(396003)(136003)(451199021)(478600001)(52116002)(6512007)(83380400001)(36756003)(38350700002)(2616005)(86362001)(38100700002)(2906002)(316002)(6506007)(26005)(110136005)(186003)(1076003)(54906003)(5660300002)(44832011)(66946007)(6486002)(66476007)(6666004)(8936002)(41300700001)(66556008)(7416002)(8676002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9369 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR05FT013.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 8c8dfde8-c889-4a2c-20c7-08db3c391274 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MTdeOV3sR4OpKntlXc5uUvKiogECE4NKgCZRq6bILCHQ1ymlmdpa/f6i9R2cWsUV6MBWJdspG8kQ5/TFlup94P1UaDB8QyqNTatweMb/i+RQZkex58ODPLukFsHx2a7bzqwU2xwxYY++O4LY9va6nlS7CkEgpmASNcEgaG3P02dWdjK2wUfwmHlX70YkDeL/CpkVXUTW00UTgB87c+7QTCLNKajIJaS/ix3qaTEPoo6Cpz9/mz3J7W/kBO6G3fTZJ199CPRtq5ylgA+7lsGI/+Y1NDbKqoak2Ww6wXZ6rMuv8BGiLkyJWiNTiYwFp1uOtvt6y0xqGsssSnqZ39UUVc8bQDjAoXWseG3uZi3EPCD/f+JbcufVjvRmb4VpkXqp3gpGZRf+QQnkO+Jw3rFcHYXj4Z/A/JgFTsHZmAhIbBLTGo2dh/BhtxQ0uayRmhbo0MlmEEk30lKyrVk/GbFQpFaj5PRljSb5ZzKC3dABzXgsMXGdh97DbDcREQxtAINEVQVCP4heoPMPXGNT4g22YeDvHJU0vqj2IDklVC8SwK24u2Wy3KU/PYBczCkGdYABVTP96mmaEptPhf05/n/V5gtK1z+jkc+nbT7ypR2gcUCpmoZyrIjcS5S7F2srER5XIWAKWYq3+l7//atFQwfV371oPYAfj6F9v4X9SLkf6lkJNIwPmm2fyK8tpeTjYte7gf7wJjfy2Udr79BLJRy7DEWxmSHAwlfUNqmEkG4RCB8euaIKB8GSMEtGrEpAbVDUuHjVrAtXdbyGOG15MMi+6Q== X-Forefront-Antispam-Report: CIP:20.160.56.80; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(396003)(136003)(376002)(346002)(39850400004)(5400799015)(451199021)(46966006)(36840700001)(40470700004)(2906002)(7636003)(356005)(7596003)(40480700001)(86362001)(83380400001)(6506007)(44832011)(26005)(6512007)(336012)(82740400003)(1076003)(186003)(2616005)(316002)(110136005)(5660300002)(54906003)(6666004)(8936002)(40460700003)(41300700001)(6486002)(478600001)(36756003)(82310400005)(8676002)(70206006)(70586007)(4326008)(47076005)(7416002)(36860700001)(34070700002)(12100799027); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:06:59.3063 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 641395ad-04a6-48d8-5eb8-08db3c391c9e 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: VI1EUR05FT013.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR03MB10043 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 Thu Apr 13 16:05:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 674217 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 724EAC77B73 for ; Thu, 13 Apr 2023 16:07:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230010AbjDMQH0 (ORCPT ); Thu, 13 Apr 2023 12:07:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230368AbjDMQHT (ORCPT ); Thu, 13 Apr 2023 12:07:19 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03hn2248.outbound.protection.outlook.com [52.100.14.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F8A9B451; Thu, 13 Apr 2023 09:07:05 -0700 (PDT) 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=DpbNhmXl3FSApAu2zjhBGd6YlvwsQfPiALtEj9OfKss=; b=O8zfWB10G/Q752+XZqdfHaM2cQ0iC1uQybu7UrKX8OXZyBcd5iyvT4lkuKftLGh6VRdG7KtB80Z9N21sYuTRdzWMa2kGByOPFb9w7PH+fkNThE/Wu/vBCuQVjvdhkthRX/iovd+0xuT0N4I7DZAG5CxvRPtICG+yQ1wuU8a9b5Twu/LKn/HiqgMGQzN0gLJYDrizyWJC4LJPTvTTzsZvlIzA8wp2eBcc26Sb6WcasicDCiMl35O/Jl5cVEpPP2iw/McY80FHv9JYSLsF40kMGQGBxSk2TwHh3TVvEowDTYkA4IVkW9aOs2w8B5+Y+jI9kePPlUzBzmhZw/6ILWb+6A== Received: from DB6PR0402CA0022.eurprd04.prod.outlook.com (2603:10a6:4:91::32) by AM9PR03MB7677.eurprd03.prod.outlook.com (2603:10a6:20b:418::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:07:02 +0000 Received: from DB8EUR05FT057.eop-eur05.prod.protection.outlook.com (2603:10a6:4:91:cafe::f6) by DB6PR0402CA0022.outlook.office365.com (2603:10a6:4:91::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 16:07:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.83 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.83; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.83) by DB8EUR05FT057.mail.protection.outlook.com (10.233.239.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 16:07:02 +0000 Received: from outmta (unknown [192.168.82.135]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id BF66B2008026E; Thu, 13 Apr 2023 16:07:01 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [104.47.18.109]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id B922B20080074; Thu, 13 Apr 2023 16:07:42 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=einPZszjnj/WxAcWLJ5zRX0RFX9yKRD7gLa3XtNNYGyw4VELd+ANC0dPCGjrB6ZkEeT+GSuRyyDPkugL/gWxetVEw/tSfaipDOors0PRgxgc9JNWoCHtbC2/GlQqpKZ20jca7qrcG0CXvXZdRMdSicIB4e1oIESTN86mhVCiGWx6GIe7kQr5jtbqZS/mistCD7faZQrgx4QtDRJWpLMG798ExHi8Cneizn1jWpXmAqRxqIFB2F1wjuFc3x+NqCP7LoRnHHu3eLqyW91AlgnSwdmJFEAD4mPIFcXpjRAoLY2kkSIiac8rdDLzNdQfv5n9CgSiTCmDFoSR7kkWiRixbA== 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=DpbNhmXl3FSApAu2zjhBGd6YlvwsQfPiALtEj9OfKss=; b=daR/dD77eVvkWGPUo0OYCzw6VuEIiTr1j6CCYd/U7Ev2U6VocV5paDJuoVzTiXACkZMhfURHqhfcINvTxUTnDZv5gM2m5YSpLhrtUjmm4vjn3bQ+CmkVgDfmz4t76qbzwmLDv5ROhh9keuWL3VwmERPi2d7GU1D7UVuxHttcT+7PIjDldVHZxm2DqS6xjOs7y95/u8y9M3lKqaUPYfgwzoxTWlU7mCKSSF8f7em1fmYmZXLN89yks5D9/2/kdhdI+dwl1eKIAqNVzsBq5wdgV6E3C/Nb8CGT5RRLBZQq57TfQpPHxIf92oEXcNlNPnbKGuFvk6g/w+SSjo8j5Ee/jg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DpbNhmXl3FSApAu2zjhBGd6YlvwsQfPiALtEj9OfKss=; b=O8zfWB10G/Q752+XZqdfHaM2cQ0iC1uQybu7UrKX8OXZyBcd5iyvT4lkuKftLGh6VRdG7KtB80Z9N21sYuTRdzWMa2kGByOPFb9w7PH+fkNThE/Wu/vBCuQVjvdhkthRX/iovd+0xuT0N4I7DZAG5CxvRPtICG+yQ1wuU8a9b5Twu/LKn/HiqgMGQzN0gLJYDrizyWJC4LJPTvTTzsZvlIzA8wp2eBcc26Sb6WcasicDCiMl35O/Jl5cVEpPP2iw/McY80FHv9JYSLsF40kMGQGBxSk2TwHh3TVvEowDTYkA4IVkW9aOs2w8B5+Y+jI9kePPlUzBzmhZw/6ILWb+6A== 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 AS2PR03MB9369.eurprd03.prod.outlook.com (2603:10a6:20b:57b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Thu, 13 Apr 2023 16:06:44 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:44 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org Subject: [PATCH v14 06/15] clk: Add Lynx 10G SerDes PLL driver Date: Thu, 13 Apr 2023 12:05:58 -0400 Message-Id: <20230413160607.4128315-7-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS2PR03MB9369:EE_|DB8EUR05FT057:EE_|AM9PR03MB7677:EE_ X-MS-Office365-Filtering-Correlation-Id: 718da52a-f1df-4e04-f9a1-08db3c391e39 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: 0+zOe48aSFRet9JGS+nwP0IU3amuKtYQD8R5ZzGJNGE5vVeR301lLYMBKPIYbI3uQLDp+B95kOIywzTPyfotMaNFjTOHKv45g2maKeqE90g0Mba0U0U7AgexOHq9gpth1SjT0CXbSvOMjd5tLE8MmLwbtCSATObjvZXNt8niogXITIEcBmGoooDQQGK/7SLp+Xlc5ZWeODAmJHLzH/bLhCw2hdQ9YFXoqa+Mlu+vCbHTV4H/KPhfwapkm1Mqkae6BxVksn6IYvCBu+pLL0lRpzxXXe6YOTAtKBM8lpN1syoEQ5/rxnClAow09JAhwAVfMTRhm/l/pUFW2NDz6hGm5++saBDf7dLLn2P4gLtQQSeP2gehXwcMmmtAL+P8fNAjp4a134O30FgCKKFrSbFoyvndWqFYpCZOfbroJRcGsf8EoETRwLInl9a9zU0x7pzlXWggj08gdIc/QV6B6B80+rLO6wFZzlWzhD/OVoaq82YUsQNjYtt3ZOAfm9jNTnIMiXMEDBhBYzN0TGwgKV29pijST3PYUMla0JNLfz9YIjG1Ks7tnAvTxzDJ7I09uY/jbuTLQjXChNxtYYIEptY3sni5Iug2AORisfHBYmF4A0zgvvvTyABDIPOyj3ep+3Un 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:(13230028)(376002)(366004)(346002)(39850400004)(396003)(136003)(451199021)(66899021)(478600001)(52116002)(6512007)(83380400001)(36756003)(38350700002)(2616005)(86362001)(38100700002)(30864003)(966005)(2906002)(316002)(6506007)(26005)(110136005)(186003)(1076003)(54906003)(5660300002)(44832011)(66946007)(6486002)(66476007)(6666004)(8936002)(41300700001)(66556008)(7416002)(8676002)(4326008)(21314003); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9369 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB8EUR05FT057.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3abbe2cd-317a-45a7-2e9d-08db3c391378 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vOo9hce1MchUQf6o+RuI0TzraojGapB1jr8E2/JGz6r9d8V2EFz2Bqj+VixS8lHA3P4vOErzzl3SFRHIIlUggdoMIo6lnXzokO00uJkf+VCI04N9RiKrdVr36DG+K5ZyDxnWix1IB2Kv/kOJ0mSTkTfNTs+XVoewOMp8JhMLd/bO9V27pXC5rxIjyP7LHE53FHcNF9k/0AhOKVqpsmCcuvHP696F0wWNO8bbAct4YvVaFvzzKvbzYSkZjS0pIJMrIberAcVwNZdseZpb0QS2OZ9qNwEn8qfCdj+Wmz24kpJPT9vneJA+ZTTMl1N+ZmQMrdOhNgqjjulGQHhXzpC1qc845tngc1qhr+8m7fd8aP0QR0VH6I5pKk2AdcRA6942CnMAayegsKhrRENK6YC1pDM0w6LEYvnFB2Q+MLdGYKGhaAzIjNFw9psTsLERE2V0R2uPDDnKWeOa8OsPnB091zkoWOdHbqI+4cdmU5RVKsgzpWt8dL9CZu2+2sJ7T2Dpzx7Ze2MQmFXtZsKM6/9ltYGhiDo08NJQq7a3+IUKzPl9auGdpHrQ9mBZM2dfmZ9G9QYfzRe+UEBZDq14Owj6g09QhtTOMk4NkM1X4EIk6EMyXGu6PHoe0icaO7lpejoIFUJc4PnhfTVRjA9e7VnjhYJKhQ63FxUDank0k4vTZD9yCMvOfEdvBPPDIFkOWgwIpnWCzMRIZFeVsZy2RllPSdcbG3t0+SZ5OPV1czIKPwrMX8Hk5X2l1YXbQyeFR4OxKtx/uHuvH2hKE0cwv+CMbQ== X-Forefront-Antispam-Report: CIP:20.160.56.83; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(346002)(396003)(136003)(376002)(39850400004)(451199021)(5400799015)(46966006)(36840700001)(40470700004)(336012)(1076003)(70586007)(40480700001)(4326008)(70206006)(6506007)(6512007)(36756003)(26005)(2906002)(30864003)(6666004)(966005)(47076005)(82310400005)(6486002)(2616005)(83380400001)(186003)(36860700001)(66899021)(34070700002)(44832011)(54906003)(86362001)(7416002)(110136005)(40460700003)(5660300002)(8936002)(8676002)(7596003)(478600001)(356005)(7636003)(41300700001)(316002)(82740400003)(21314003)(12100799027); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:07:02.0038 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 718da52a-f1df-4e04-f9a1-08db3c391e39 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: DB8EUR05FT057.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7677 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 --- (no changes since v10) 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 fce67b74e4a2..8da893681de6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12195,6 +12195,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 Thu Apr 13 16:05:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 672911 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A991C77B6E for ; Thu, 13 Apr 2023 16:07:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229961AbjDMQHg (ORCPT ); Thu, 13 Apr 2023 12:07:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230095AbjDMQHe (ORCPT ); Thu, 13 Apr 2023 12:07:34 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05hn2238.outbound.protection.outlook.com [52.100.20.238]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A07EBAF0F; Thu, 13 Apr 2023 09:07:08 -0700 (PDT) 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=q+TOvhYduez41a3dRbJXPEKIJxhd6Pr9b+2/afr/aOU=; b=DZHPl5KNQsX0c2hJ89bEPhE+vnbBiZ4KsfaMigQbeEhLOtCfDDspqQtY94xZi2dBznlbjuQBay6SDGg3TIzxsQ0s4HEJyzCai+rX97Pywpa92aSmFPkASyojGBjbnRcbxcBAIo3sUC2s7CF6ONboEjwSCrUnspo8Latby7IPV4gvvhrb7GXOMtonwX8ixjcZ38lUfnyfrTTeDS5MINJILWQlCYoM5lkVObiCHm+2HGdmB70vxeiEhkBRmlaBr5r1lfQktE4iQMVC43qvdQE+hw+RN32KSGyyeuwwdUy+28hR13IQF1Nge75fZyLspSRVKf3FXXTC1OLvxFwDafd9nQ== Received: from AM6P192CA0007.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::20) by AS8PR03MB9192.eurprd03.prod.outlook.com (2603:10a6:20b:5c0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 16:07:03 +0000 Received: from VI1EUR05FT061.eop-eur05.prod.protection.outlook.com (2603:10a6:209:83:cafe::d2) by AM6P192CA0007.outlook.office365.com (2603:10a6:209:83::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 16:07:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.81 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.81; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.81) by VI1EUR05FT061.mail.protection.outlook.com (10.233.242.254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 16:07:03 +0000 Received: from outmta (unknown [192.168.82.135]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 125792008026E; Thu, 13 Apr 2023 16:07:03 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [104.47.18.109]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 444B820080073; Thu, 13 Apr 2023 16:07:47 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rwa1kRSl2kCpeEn99J3SHKxqaXPsqDYivSc24ANhiqgl4X8+ZBuow2FQKIhax8o00vfzwcQms4/gUHw7lLytL+290rPSeohHI/GjdvaYA8VKeHgMmHagbKZADLZehaIjcPMvo3DGmAIG9+u+WaeGCG8TBbakRoMmy/2ZbamwMm51cNvwYS8MrUEzUaHzB/XW27RXTlx4Skpuf0HtKOksPty1H+jD8vr8XbZOxeFcrT0HcI3Qb+joKmXl64ia5OFrfHdHVH9MhzHauBmhNY+yzkOxqLzC63AClQW0XwDeRZPl677hv0Oy2linm201MDs10+ymxGNl4kxCbqCMhsEGag== 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=q+TOvhYduez41a3dRbJXPEKIJxhd6Pr9b+2/afr/aOU=; b=fmQEAloajWO2i/0G7EbQSC1vQ1/ieyvMJzmnf1eFv08vaQt+gOglzObVmfPamLS6oHsO7tFQtFnmnUj1PJ8TRwtDxpeWzRG99S1HQ7F3B5JUOVT57O3fpSUAgXCiDiZ6FmlxdE/lKl88YG8dyBi3JdSC8TEauksMcdWgalOY6ImdEqCZP5IlyF8tkwKt38I7TJdvzmTXxDg8W3lbWDyDKRdX5RbaVlhOyGdVIisxgE1yhBlkxghvZfGxyd3t+KVxGazxeGSGKE3EI84ea8hMZ1qbq+ZrhfhZjMnbNu5kza1TvVSZRoK4bMqbSObePbTxKO3b74Ndo1V4XoV7m6wcQw== 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=q+TOvhYduez41a3dRbJXPEKIJxhd6Pr9b+2/afr/aOU=; b=DZHPl5KNQsX0c2hJ89bEPhE+vnbBiZ4KsfaMigQbeEhLOtCfDDspqQtY94xZi2dBznlbjuQBay6SDGg3TIzxsQ0s4HEJyzCai+rX97Pywpa92aSmFPkASyojGBjbnRcbxcBAIo3sUC2s7CF6ONboEjwSCrUnspo8Latby7IPV4gvvhrb7GXOMtonwX8ixjcZ38lUfnyfrTTeDS5MINJILWQlCYoM5lkVObiCHm+2HGdmB70vxeiEhkBRmlaBr5r1lfQktE4iQMVC43qvdQE+hw+RN32KSGyyeuwwdUy+28hR13IQF1Nge75fZyLspSRVKf3FXXTC1OLvxFwDafd9nQ== 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 AS2PR03MB9369.eurprd03.prod.outlook.com (2603:10a6:20b:57b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Thu, 13 Apr 2023 16:06:46 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:46 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Jonathan Corbet , linux-doc@vger.kernel.org Subject: [PATCH v14 07/15] phy: fsl: Add Lynx 10G SerDes driver Date: Thu, 13 Apr 2023 12:05:59 -0400 Message-Id: <20230413160607.4128315-8-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS2PR03MB9369:EE_|VI1EUR05FT061:EE_|AS8PR03MB9192:EE_ X-MS-Office365-Filtering-Correlation-Id: 7921edf0-367f-4cd6-2b38-08db3c391f05 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: VhRJIzrAlWv0FVgfSECCKtNk8my5KixB3ALdhSPLLTIWb29kG+fcecPMxfM9wcBEcjeNvx+EnogWtI3l9FSkv9A7IGCyKQTQshyGEbX+RhTHRZYF5TbS2uFRIw78lrmaEgsmx7kw5utIzY+YSnncvmxN4fMyURsAA8EdUx5X4nXWYeRuQGp0JPb9Z6C2WaSaut/C2L4K475JKel12b7EYZ91QVg/Szo6PRftiHk7lN6H5J5QB7YMRakBooSG3sX0HofC4tPsfu7W/82FkWJazjxCl4FVYX7y/H/ecXzDMm91LjHuEmu9gPZ5Q8YY7qp8xDa32WFSdybMHLRfvDr15+6fce1qAA+wa+rT0uAlKRcnRLy6K4s7RNGPQnQSHhlwT01zfvNHUxyh6LicnyUKTUJ86ojAAUxE20+2pPhdNAhVxMKtBIQtzX62oSgXb+gsOIEkdde7PhgFet2ewJFYxw7hQ74KancN4MoWg5o+ZRSN2Mz7994AUL8BVYZ2r22c7wj6ij3bghrYZF5/14bq7b4seRGfFLyotSZKnE/jC7v7qo8tvmwdjeoj39RMMkX7y/ARZQMpYfkD0PSWaD2+3/QQ/VUdUGXJ1mrrMy7KLis= 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:(13230028)(376002)(366004)(346002)(39850400004)(396003)(136003)(451199021)(478600001)(52116002)(6512007)(83380400001)(36756003)(38350700002)(2616005)(86362001)(38100700002)(30864003)(966005)(2906002)(316002)(6506007)(26005)(110136005)(186003)(1076003)(54906003)(5660300002)(44832011)(66946007)(6486002)(66476007)(6666004)(8936002)(41300700001)(66556008)(7416002)(8676002)(4326008)(579004); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9369 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR05FT061.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e22033d3-92e4-4622-8d22-08db3c391483 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a1b29I3rWEeL/HdP0bg7scC3cECcD0EukGxDdS0TioMFCkDSedNB9qpIPy+8bKuiotXfxO3cvLN8Dhg/cn7jqlRlMHZuf5foN21TpIVIzPe0TaHhcI2pV/NaVwHHXzo/xg75kDx6HJXnfAmeWxmZYTxHASQokz0bWva8PfbpBML1x9Tjq5dlWt3hSE8focrFaTi8lJfvZNcnTvx2E9zaZ1rhSj0th0VjSFLPEwbaPHM999r4jzxCq0wQrMS1JXgmrL4Loko87yHLIsmc24Ik2GNMigi0uhFMmjnTpWo3hnlIH6H1LVSGczT9Z7PxazWLik6UxwdquhV9lgoTq8Ocx2k9tTEUDAT11M6e+l/rM3kbPvf2+QPIBGRujVn3k/SfO6PKk6D4qStg7dZ6yIe5jTO9MZ7wRXKK7F4sK0Bkz1UFhPl20NpnYvHSyJF6CGmpWxpK+MBxmbp6LOnzBfOkiq1adcFrkKIo9fFsC0WtzzRvOTef7OpYFB1mlWKeXaPfCFvt9hBguMerVpOp/PLLsG1rdaEwIogbeBDZ6P9T+m4qPyjnoSLfhN8zfkb16wKJDrmRQK3YsjSZqIAB/f+A/CAwB+DKrlOd31kRLzJKm7s5Id8OzGFQDAUrOvqDNq7CNK5Cj0KBNq5yjjrz00rZF8VHE7lHmzAwvQ7U2HcNNqjtwvAA7UbLJlQGFN5paFFynidsqgvLvwHjchE1QS1tViwSCxviJl8W00n1JH1p4Kdfd5RGCAEZ4sKrJulZVvO1 X-Forefront-Antispam-Report: CIP:20.160.56.81; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(396003)(376002)(136003)(39850400004)(346002)(5400799015)(451199021)(40470700004)(46966006)(36840700001)(36756003)(86362001)(966005)(41300700001)(110136005)(316002)(6486002)(54906003)(478600001)(4326008)(8676002)(70206006)(70586007)(36860700001)(8936002)(82310400005)(356005)(7596003)(40480700001)(7416002)(82740400003)(5660300002)(44832011)(30864003)(34070700002)(47076005)(2906002)(186003)(7636003)(6512007)(6666004)(83380400001)(6506007)(1076003)(26005)(2616005)(336012)(40460700003)(12100799027)(579004); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:07:03.3354 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7921edf0-367f-4cd6-2b38-08db3c391f05 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: VI1EUR05FT061.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9192 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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." Note that while I have used FIELD_GET/FIELD_PREP where possible, these macros require const values for the field. This is incompatible with dynamicly-generated fields, such as when the field is determined by a variable. In these cases, I have used traditional shift/mask techniques. Signed-off-by: Sean Anderson --- Changes in v14: - Add note about (lack of) use of FIELD_GET/PREP 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 8da893681de6..870014ab14aa 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12198,7 +12198,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 Thu Apr 13 16:06:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 674214 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A70FC77B61 for ; Thu, 13 Apr 2023 16:07:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230095AbjDMQHn (ORCPT ); Thu, 13 Apr 2023 12:07:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230200AbjDMQHm (ORCPT ); Thu, 13 Apr 2023 12:07:42 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03hn2200.outbound.protection.outlook.com [52.100.13.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E3A4AF39 for ; Thu, 13 Apr 2023 09:07:22 -0700 (PDT) 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=T7xV5Io7pBnAgP35FjW3L9tKCIkH6Y1KxJnYWFc56y4=; b=njZFBiulvSEJfRhnWwBfSrBJOZicKgQBFxKu7ji3+itBtNuSpoFUvze2wQxA6QG+fGlUOnWNbjmpxVJLUtxt8AI7DbNVr4nE58PaDmoMaOKlcjpesE0Wn+0pQqNwM1N/aizO1O5Oa6ZkqqBQAwDPsVPu8dZBfRg7+6/clyuk4c17WtQ/CkwwqiDu7v286yyqYBOeGF2vPdBUyGdcenSco9XhjINV2THs4Jk1KeFOSesN7A8PU8mqjDnMzr+YDZ1y0JY+LgcxyHGYYeGF88eSqvEdGp1LJwCElr0ONwEtLmqdTsD4woSTIb4oc1Ct3+lfwn9tcsMSYlRg1y9PwljBqQ== Received: from AM5PR1001CA0056.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:15::33) by AM9PR03MB7899.eurprd03.prod.outlook.com (2603:10a6:20b:436::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:07:19 +0000 Received: from AM6EUR05FT062.eop-eur05.prod.protection.outlook.com (2603:10a6:206:15:cafe::73) by AM5PR1001CA0056.outlook.office365.com (2603:10a6:206:15::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 16:07:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.82 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.82; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.82) by AM6EUR05FT062.mail.protection.outlook.com (10.233.240.254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 16:07:17 +0000 Received: from outmta (unknown [192.168.82.132]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id ED39E2008026E; Thu, 13 Apr 2023 16:07:16 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [104.47.18.113]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 5796020080074; Thu, 13 Apr 2023 16:08:22 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NvVcbGr85vRbh4TZQSYj3HY3S9LUsJLRt+Sp+JePkAcskP9u88uJzIouoG2/XyUwneV8fz5pjnU1Z/Z4c13B3yAknv9yoTEk6xhYWKS2xD0eudnhYHbpwMfv9VrkIZ3hs9VjQZ6pzbUR9fQmiFPTwsVGM+xG76VRSTEKeAeT6qs1PE/FfrBwPLWStvEfTFeV0s0H7j6GUuSsdi8A8WhJE3Ig8vdxrHb3Abc0iXHblsGKUqHUUsOu0C7RQuweZ2HqB3qlRaPvgR58UeoE8VEXAWgd9dcpYFw6Z2irHiQsrfhkLwHmSxiAIoQwxlcZ1wjcTrAR/GGBio1JlIDjOwShcQ== 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=T7xV5Io7pBnAgP35FjW3L9tKCIkH6Y1KxJnYWFc56y4=; b=gUTlWJjoXznurURIh9b4CO328eFd64kroYwe94FAeFGof4ZwlvCszIMqwQ08J+AzhWIH6QKY0aFwrn3ybQvVVkazn44CTyFdHF2pnqyDwBVQTGksVFFwEDG7pm/6z3bZ6deEaGGLwr0E7isZzaWckXaaWS26ebSrkmQHVnHerMojifix1WVUDCn/kx2D0avM0qxmh3IZOQNqOQzYZkQWR4kJDdkp8K0B4fARzTjDQuZJnIuEoq4QXsWrW7Nvs0UZuTjSo8X+ZHVjkxQEKnVlMrZXHk4ruMIPmvt50cI9twKpnYrNoV2nDUl6xqCHU4rd6npGmaF5oAduUmWJ7nnV+A== 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=T7xV5Io7pBnAgP35FjW3L9tKCIkH6Y1KxJnYWFc56y4=; b=njZFBiulvSEJfRhnWwBfSrBJOZicKgQBFxKu7ji3+itBtNuSpoFUvze2wQxA6QG+fGlUOnWNbjmpxVJLUtxt8AI7DbNVr4nE58PaDmoMaOKlcjpesE0Wn+0pQqNwM1N/aizO1O5Oa6ZkqqBQAwDPsVPu8dZBfRg7+6/clyuk4c17WtQ/CkwwqiDu7v286yyqYBOeGF2vPdBUyGdcenSco9XhjINV2THs4Jk1KeFOSesN7A8PU8mqjDnMzr+YDZ1y0JY+LgcxyHGYYeGF88eSqvEdGp1LJwCElr0ONwEtLmqdTsD4woSTIb4oc1Ct3+lfwn9tcsMSYlRg1y9PwljBqQ== 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 AS2PR03MB9369.eurprd03.prod.outlook.com (2603:10a6:20b:57b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Thu, 13 Apr 2023 16:06:47 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:47 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v14 08/15] phy: lynx10g: Enable by default on Layerscape Date: Thu, 13 Apr 2023 12:06:00 -0400 Message-Id: <20230413160607.4128315-9-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS2PR03MB9369:EE_|AM6EUR05FT062:EE_|AM9PR03MB7899:EE_ X-MS-Office365-Filtering-Correlation-Id: a283fb46-756d-4d36-5ad3-08db3c39272b 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: HHpdhUR1KQeJgOomWGMTQKGwqBtLhDmGVx2cI5+5HqgweXuy6M90/nniSIBQ+rRHx0vb5BBX7zaf4yfnyL83cazgcgT+NBbd6gVtPGUwRy4L7bAaQEGt86S5unJ6aNbHe5wzGlSmK6jniA46BAsF4MuOegnQaSrg63Dd8WwJM7RnN0r2XmCt1w1OY2ROJhkBoF7xpSXiEQI1JQ9xp0jxP/BI2FNxldISWiQFy2Fg5HBV0mw/xQcgG4p3QD/ZBBQIV1cVgvGlKpU8TT9mtlae0Cnf/V43aqQXk+A5bzjvRiGLVjUThvMQyP1gsvef5Iahlgs0LXa2h75I18hXGE+vZaVtJCWCPE3++rcrpHmPNDNkhmF1q0vvMH/gtr3Aqg7k3CjG7hzyDWvxFnu2GYB9B6Ospz45xvELE1HWvrQYb9R41N0OhZM/ArrSpn0IZux7rjzAMw/w6/UmsyWFQJZhhp2b45W+j6sa0YMOs6TVmB4EphR3ryzIib2Nr3k8iK7BfDee5Y1aS0XxeB2wkCDI10PdLAFzt8HAPEXNQCcgfVrW0iofC0pecBFrdbO3K3QR71oJOdUCgESqQJZUl7z3menmazOmtEkEgkYgqcJuy8/5RcN3dlAcqTlnZy5V+HkR 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:(13230028)(376002)(366004)(346002)(39850400004)(396003)(136003)(451199021)(478600001)(52116002)(6512007)(36756003)(38350700002)(2616005)(86362001)(38100700002)(4744005)(2906002)(316002)(6506007)(26005)(110136005)(186003)(1076003)(54906003)(5660300002)(44832011)(66946007)(6486002)(66476007)(6666004)(8936002)(41300700001)(66556008)(7416002)(8676002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9369 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM6EUR05FT062.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e9aa2809-233b-4e40-347c-08db3c39158e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Af2JxjVj8eWpCYDTAFm7n3ed/ctRlV/ru+s/Mfq63RwHawLnbS45CZxGQ+E/wyXkJqt/Ufw7ckmyWN+U8y30EGD2jlhCuWDVE01K1BU/eEm2YHfKVaZiCPMLqa21F34kAOCdgDirKpbxR8VW2VQgwkTgt+x+nw2EMEtC7qw/cPFbM5a8vfOXDXBGpyTpzPOgpWGEctPmQEFnAdnhXFZHoyC+YRO1Pvu7JxI3C/ej4NIQ2XwRs8cvIoz+W49CLSnyT+08P9AzHvhGzz+7ntq7Me1JEkqYT0LhNpybs0q9PnLVC02DklTHXxg3GmBshr9k/hf+jxz5rC6y1vbrPGrkxp/fzQwFt3DUzp9kwidFk8IBOoNArbzIrWQRsCu6rCABEX+mQYrl9US9CrLwP6lZ3cR/9wZQoXEa09qunVbwcShNzkN93RP/sIKNNeU3T1aewqaA2W1sGLozV1OXyOPLH6wr1lNGImY3ScvB15drsv9DD+wN7Qd3hvLcglEySmltgXocWZkvHFNUxCzH/EhskEtgeuM7gW492cDEzQ2RXRQjRO0v5qfjyC8zri2kM5AoKORzS2AXf1qkndMSi+wjeDdWvFmaSAZ9VpI727pQOmMZtbOQLTHiZPqnmCLul/f8twN6X8Kfiirx1YwnPfEC5SUWL0tq4OOJSyJpAw98eomcPX2vRgaLc3VNjZYaHk9x6RpzsxF5yJtG6F1RUDNj2Im3KMwbaqiv/f7Cfs59cicQgXSPJp9EpFLO4TpKufXz+qMZXwZki7L8DOvX+hQz8w== X-Forefront-Antispam-Report: CIP:20.160.56.82; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(376002)(136003)(346002)(39850400004)(396003)(5400799015)(451199021)(40470700004)(46966006)(36840700001)(2616005)(36860700001)(316002)(70586007)(70206006)(4326008)(47076005)(336012)(6486002)(478600001)(34070700002)(54906003)(110136005)(8936002)(8676002)(7636003)(7596003)(41300700001)(356005)(6666004)(7416002)(5660300002)(4744005)(2906002)(44832011)(82740400003)(186003)(6512007)(26005)(6506007)(1076003)(86362001)(36756003)(82310400005)(40460700003)(40480700001)(12100799027); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:07:17.0543 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a283fb46-756d-4d36-5ad3-08db3c39272b 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: AM6EUR05FT062.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7899 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 --- (no changes since v10) 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 Thu Apr 13 16:06:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 672912 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3706FC77B61 for ; Thu, 13 Apr 2023 16:07:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229591AbjDMQH2 (ORCPT ); Thu, 13 Apr 2023 12:07:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbjDMQH1 (ORCPT ); Thu, 13 Apr 2023 12:07:27 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01hn2228.outbound.protection.outlook.com [52.100.5.228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAF509ECB for ; Thu, 13 Apr 2023 09:07:07 -0700 (PDT) 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=3Dzi6UE2v9qVmQpqrCtfoOE4ZEKRnVlJ9GnYZynAFGA=; b=1RKF6n2j8nGgHwng6EjaTwhgAe/5Zeh7KvJRNiKrNxZojFJVcUo1mJRMC8VCfGrrHfeH11sRy0UZWWkX6KRcYVnX/huhJmeAkM5bn4Y1DW0MXYIMk0sIDB7BvfRRnqHR0j+atIq++7wgpGxAsBJ42s68jbXWj4Q66WY26iNK9whM50/wbjf/YW9REIk0xLRRYuH4qz6YvpkDODHw5ZMsxW7VdPPnunvAe59/arERXD2URpcx2NLQN13YyI9k1mVahu9p/GHRWen8o5mlmA2uZRS9Ze0IZgO9YeMEQcKiq3IzGAE4Pk0/ubaNvbtgh6L+tR+hHB5iLNM7Sz56uzLJOg== Received: from AM5PR0202CA0013.eurprd02.prod.outlook.com (2603:10a6:203:69::23) by DU0PR03MB9128.eurprd03.prod.outlook.com (2603:10a6:10:467::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:07:04 +0000 Received: from AM6EUR05FT040.eop-eur05.prod.protection.outlook.com (2603:10a6:203:69:cafe::a5) by AM5PR0202CA0013.outlook.office365.com (2603:10a6:203:69::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 16:07:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.81 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.81; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.81) by AM6EUR05FT040.mail.protection.outlook.com (10.233.241.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 16:07:03 +0000 Received: from outmta (unknown [192.168.82.133]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id CD1582008088C; Thu, 13 Apr 2023 16:07:03 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [104.47.18.113]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id ED56320080073; Thu, 13 Apr 2023 16:08:21 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PkEJaVJVsxQ9s9CUEYH9mmn2RLLns/8a5YzNjbMnVx9sxCqwiDC2sq29m/+0ymWeodPnL40BySy6LOTZWKtuujD3ta5N7tf5MShQza/5nbh3ZvbodlG+AEiCHzC5U4zndYsmjmj0K8ASMH5MVksjuCSdhQMf2emhW878JyLlDoaOteAXqywHnQOkTOgmW+maDdgTpD/ztpMUkIaxbNhLjsi5oIXehlN+tPMw4XYEXlMhTq1KIox8S4FmIMwFDzdNqP+SnY53NgTocTTzF6L2hVkCwLwky5Jr2oHaxn+yHDHsVUXLsDR48obhq2fieACRZAB3H3M0/acxzHOANoIvng== 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=3Dzi6UE2v9qVmQpqrCtfoOE4ZEKRnVlJ9GnYZynAFGA=; b=mYv2H5zMP9Pmr8oqdy3cq1Cjul+WIAdg0xu6D156IhRDwb1qLex9AOuiOkPJWud9sYNx/McEur8hR95Gw8O1x13ljZ+8FN6bEmcZIsvYqX9VBRUqCz5g70DRxnxjabTcd4WSaaRbDGv43YtXN9AwUCqzGIvhBEQL1b6EkT5dskFz+g4vdXV74wheyZ+P7DosZhZYNfhXGCDgkU1C5kwqmqWFNxxafkSdQkGryTHFNDA66cswGdsvN+UaohRN0SBSQ2wTkCXWApcDOOx3R5uw9rkFPqjC60PNsV5fa4uvCSEOGvYL/VFRK7s9tMluW27klpO9UGaCpd4Hd7yJxKBrkA== 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=3Dzi6UE2v9qVmQpqrCtfoOE4ZEKRnVlJ9GnYZynAFGA=; b=1RKF6n2j8nGgHwng6EjaTwhgAe/5Zeh7KvJRNiKrNxZojFJVcUo1mJRMC8VCfGrrHfeH11sRy0UZWWkX6KRcYVnX/huhJmeAkM5bn4Y1DW0MXYIMk0sIDB7BvfRRnqHR0j+atIq++7wgpGxAsBJ42s68jbXWj4Q66WY26iNK9whM50/wbjf/YW9REIk0xLRRYuH4qz6YvpkDODHw5ZMsxW7VdPPnunvAe59/arERXD2URpcx2NLQN13YyI9k1mVahu9p/GHRWen8o5mlmA2uZRS9Ze0IZgO9YeMEQcKiq3IzGAE4Pk0/ubaNvbtgh6L+tR+hHB5iLNM7Sz56uzLJOg== 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 AS2PR03MB9369.eurprd03.prod.outlook.com (2603:10a6:20b:57b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Thu, 13 Apr 2023 16:06:49 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:49 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v14 09/15] arm64: dts: ls1046a: Add serdes nodes Date: Thu, 13 Apr 2023 12:06:01 -0400 Message-Id: <20230413160607.4128315-10-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|AS2PR03MB9369:EE_|AM6EUR05FT040:EE_|DU0PR03MB9128:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b979e4e-acab-4271-cfd6-08db3c391f5c 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: avoqzQBv5BAxvwVCO4na5LzUX9AT3b4wKlcCIweV37MI7kO1B42lNao773upDF5Sdj89NTCSgFh7eypmW9a+uzBiu7d56JPR3j5idK9moKe3NMcbFF5QsBfZVB3iAQYC2gs5kh+Bk0UF2REtgxO583h/xEu4Wd7MrX0yHO444/3McPCdvaorFMSTrdZxzCWaKvY8aT4N0mAOXichv+gVr1aXdaED/ZE/eiNFR/5Vey3zLiJxXHC6jLKKSyct2O1tPTHMqUcJ/Kki+VRjTrUg2AFU/AIRfAXsP2a452UOQL/AhcXQDL3LJdpxYCjDSY9hQTV1IiUzxX5CLzm5eE629Vg8aKrE6i4vJcpnwOJ8m2BV7sYjkFa2wsK+adVKe7OuATNF2LiRzPYZ+XSTmOaj3VLKAagZHWv06Zs/ZpvODGTt0ugkeFv2Wm26FCYgQzFM/hneUC5rQZLUN9KYbKupCLGsaq4f/8cKBLsSIBiWlfi131TbQESks15/pt1Of9ShJDrxnrBTPGj6zyp3thEnBgAU1Fg197OQVsli3UkoME6Z4GEFikOZGFpy6avUzEu7g9MopAaJ9eyQ0xAGXUrxAsCixfYpM7IYy4cfHALgfHdXcodIRXdXkZkvNtTEPe1k 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:(13230028)(376002)(366004)(346002)(39850400004)(396003)(136003)(451199021)(478600001)(52116002)(6512007)(83380400001)(36756003)(38350700002)(2616005)(86362001)(38100700002)(2906002)(316002)(6506007)(26005)(110136005)(186003)(1076003)(54906003)(5660300002)(44832011)(66946007)(6486002)(66476007)(6666004)(8936002)(41300700001)(66556008)(7416002)(8676002)(4326008)(21314003); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9369 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM6EUR05FT040.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b8d582bd-f255-43d9-0160-08db3c391697 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: idxBrzrGS1JHa6RJlsWylYnqFGlAPloX7xwtraolcjwNfdamvRsrdwOuVuD2/oMckKpf/6eey8kVvKUbka3JQv/gEAlSEl3AWxM36o3/GaI1BhIKq665FFeyR/1iDbSHP3cajuhX2rvvuh9sPFa3sef3Yiada6dvPkOP2FkG5GTUiQbYKmFnQ2lEEFegjWLCwP2WQR6iSH0ceLPnyJGml4RC6pxqR0s6T9sThlYwjQdZCDwHBog/ay0me+3lLPK/Yl1kfdCjS8ldtQVJPHqYCRSDvh/QUdEsUicXn22y7GjkVNduLDcROo61a/20yOxcuttHExGq5ajIGWSFKRUvu529X04mcygem4qgDERxKDvsdGLb0QZ0wX9L+xmV6PuozVjHPoEq7wvOTyJeKVd4D9K4gPbSuIf/Q0HtRQL/6F6Jz4FKIPdrkBDY/65RUL0MHoH/FYy5XkJtlkgU/xhEdDEDUkkSV865hwFPlxFI7COfa9t3K7OwLHA7EgXAPUAqYsHBdO/KoosV+abPwMjxBD32blVklcvDzjQdlEemmVWq91TIrqxj1gv3QcUON8aiLK/6L0m+iE+Ymvsuit8A6NzKOqYqpgkiJjG/cDIupoS5HoBihkBOM04mN/O0GQxqJcttcTmXfuMtscFBiyR8RMDFBdzzIOZFwJf+IV5QqnrzxYlBLNyrVSutHqoBOawQmBji4CECgfD4P9edFacoDJIfZmUENTpfaDmJUCxViTqfDddRH3pNOxQMLCZTFxdiXXWFTACbMs1jkHV/hyGifw== X-Forefront-Antispam-Report: CIP:20.160.56.81; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(136003)(39850400004)(396003)(376002)(346002)(5400799015)(451199021)(46966006)(36840700001)(40470700004)(110136005)(54906003)(478600001)(83380400001)(336012)(36860700001)(2616005)(6506007)(186003)(1076003)(36756003)(86362001)(6512007)(26005)(7636003)(47076005)(82740400003)(7596003)(40480700001)(82310400005)(34070700002)(356005)(6486002)(6666004)(40460700003)(2906002)(41300700001)(70206006)(316002)(70586007)(4326008)(44832011)(7416002)(8676002)(8936002)(5660300002)(21314003)(12100799027); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:07:03.9567 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b979e4e-acab-4271-cfd6-08db3c391f5c 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: AM6EUR05FT040.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR03MB9128 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 --- (no changes since v10) 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 Thu Apr 13 16:06:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 674218 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7C9EC77B6E for ; Thu, 13 Apr 2023 16:07:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230156AbjDMQHW (ORCPT ); Thu, 13 Apr 2023 12:07:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230299AbjDMQHR (ORCPT ); Thu, 13 Apr 2023 12:07:17 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03hn2237.outbound.protection.outlook.com [52.100.13.237]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9B0EA5FA for ; Thu, 13 Apr 2023 09:07:04 -0700 (PDT) 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=Msa/ApeasZWDyIVGMQqmliC9DhgV10v70JxGPKM6HnM=; b=W+RYWp2+5UIZxObPPKeNxrxaDiLd+L2uIlwVIJFgntkaZUkJzZVFR/q5vji1+TNXpgqGhUB6oc7zu+7glm+XQEtRTUioWAwQdj0YqQcWQc2MYrvizXTwDsziE8m9Pmmif3t8tpORCCuViINr3PGhBUPCHg5dySOXMii7zEPfVMYD0xlhzPNNhUFITltnh/1K9Zk95X72x1iiEWrODyWS2hrPZjD9GYkFMRaRdjriPfwV8Lgd9rJDPzecKk8VarJZ9nuGeNthoE8Q0Gh+tM7JtpkVu99wd/ISRkuMTF9uTBAylOgHrvK2lU/v5B4XP0wpuuAyg5CZKsVzbCMHrIN/Cw== Received: from DU2PR04CA0054.eurprd04.prod.outlook.com (2603:10a6:10:234::29) by DB4PR03MB9506.eurprd03.prod.outlook.com (2603:10a6:10:3f6::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:07:01 +0000 Received: from DB8EUR05FT022.eop-eur05.prod.protection.outlook.com (2603:10a6:10:234:cafe::8c) by DU2PR04CA0054.outlook.office365.com (2603:10a6:10:234::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30 via Frontend Transport; Thu, 13 Apr 2023 16:07:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.81 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.81; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.81) by DB8EUR05FT022.mail.protection.outlook.com (10.233.238.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30 via Frontend Transport; Thu, 13 Apr 2023 16:07:00 +0000 Received: from outmta (unknown [192.168.82.132]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id B7BEB2008026E; Thu, 13 Apr 2023 16:07:00 +0000 (UTC) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (unknown [104.47.51.177]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 112F520080073; Thu, 13 Apr 2023 16:08:14 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pe9gzG7f6IYN7fGQbTO2BGc1TauvbNShFOjHd0RTg6XiGuX/hNm5uuHi5Hnbl2lbVwY9ZoWrBZnvK1POU9LdEkKJ6sbNRgNRpfoMmN6gbE/ToGbGnunhWWkW0URsyo2C17U6zbgqd5bhcjBGyhtg1kZ5R8XazTRuPCkuJm3gqAKl1sm5SaCzKqfJ8OO4udgswfTdI8ybLMKCOpi01LtlklIAaqr2pYBOpIZGrt+ykd/CpBpDLWEluvSAjcwOl+t8PXNsnuIAgzAbpH4l4xDhi2YhIXmDT284pl/sjEPyeBCJ2k6Md/PoYtZAuzIhALAKIvaOEQdIPfJR47HGkFpDNA== 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=Msa/ApeasZWDyIVGMQqmliC9DhgV10v70JxGPKM6HnM=; b=aQRlbD4w82lNhLfnwN6UEoRlBOfybiLxjy3lDUSeSgk9FbYqv6Fn6UAIrpuPPxb0vwtxEaz1FeKXXlDQYKmx/xpPgJRoxI7c6dGhTZfQ/5DqH8kbgkBfD6XfQwL6nbtUMOtIoqPiOPksxj/vu5m4U/JOAedQUEMbdXyxm6XGlyJVVAjk4I/X2+7KcVv5oZW0YtySmNlaYaxWWtkpDKKYxZGD8CqwCcsC7SJEfuHUB9NbnsFYQ5ZSfcyd1xyNaZlrkPi2xzYl4DwGPUZlZQ2Qqev5Nu9iu54fH4Nd6Zck6fqoiR56A06IvGgl5tZ2J8UMUxygdGQFxPyQ2H4xux1p7w== 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=Msa/ApeasZWDyIVGMQqmliC9DhgV10v70JxGPKM6HnM=; b=W+RYWp2+5UIZxObPPKeNxrxaDiLd+L2uIlwVIJFgntkaZUkJzZVFR/q5vji1+TNXpgqGhUB6oc7zu+7glm+XQEtRTUioWAwQdj0YqQcWQc2MYrvizXTwDsziE8m9Pmmif3t8tpORCCuViINr3PGhBUPCHg5dySOXMii7zEPfVMYD0xlhzPNNhUFITltnh/1K9Zk95X72x1iiEWrODyWS2hrPZjD9GYkFMRaRdjriPfwV8Lgd9rJDPzecKk8VarJZ9nuGeNthoE8Q0Gh+tM7JtpkVu99wd/ISRkuMTF9uTBAylOgHrvK2lU/v5B4XP0wpuuAyg5CZKsVzbCMHrIN/Cw== 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 DB9PR03MB8325.eurprd03.prod.outlook.com (2603:10a6:10:37d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:06:51 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:51 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v14 10/15] arm64: dts: ls1046ardb: Add serdes descriptions Date: Thu, 13 Apr 2023 12:06:02 -0400 Message-Id: <20230413160607.4128315-11-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|DB9PR03MB8325:EE_|DB8EUR05FT022:EE_|DB4PR03MB9506:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d283758-1662-417a-22a3-08db3c391d98 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: bIVad8sahONUq2Wd5ii3NGRsZKBWV4Tw26o6Atp+HyFkAYKRBloHSx9F3Ex0jI9nL8sY7g6saWbqlNl/c9wIIBvMExZUVMi1m6c3KjgrIMiFfIaqNSJ/5gVpM6iG076v5ONtofutEWwp5/CA6TMMQQREGBA0tUrGca9c0XjzPNdu1pbjAYRlX+U198PcK1CfZ2E/kcTGc+6rwLPtNGVZ21dEQ/up6E0Qke3zqAN+OHfiIfMRmAOQaNMppNNNL20js8IrEgXsuEAzQ3I1S8zTuMTRtlZwjkCU64hUtYkArMVot4LZv9wYlvHglygrjahwpWPvCf4csSa1rcIR0SKQj0KRHdGH0D7F7827/4fCjL++JVhd+V9N4q8kJt6+csLSHKD8zg2U08G1BXLxXLiVQSQI+39A3rJO5yt2cbOAWZTm2mB69fZGVK8PO25bwfSQSZQTGAtBNmHY9bJCj7tAn5yL0y24qmYfoouPQb0ggtz1cfSmYQ8H8G3Cv8iT1SKL7EdsLyf78zGGVZUGWD4eqjGzJhJSif/WR7vvbSsqy0O70XlucmOY9z9Ny/p2eMKTTScVSY5iJGpK1VqekuPADqHdeujvjrITPAn/+uqzjVESLV6dpFjqNnQqfskCpVGw 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:(13230028)(136003)(396003)(346002)(376002)(39850400004)(366004)(451199021)(6666004)(52116002)(6486002)(66476007)(66556008)(66946007)(4326008)(36756003)(110136005)(2906002)(7416002)(44832011)(86362001)(41300700001)(5660300002)(8676002)(8936002)(316002)(38100700002)(38350700002)(478600001)(54906003)(6512007)(6506007)(1076003)(26005)(2616005)(186003)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR03MB8325 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB8EUR05FT022.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f1bf2396-d911-48b7-0b10-08db3c39179b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8SIWQ7RJX4YQ4GBeWdNzDYuX2TTbkS0w63w7wnL2WIzrqGz+vu/vxwy3QtNP1LHXqRCuuD4rSq2XHb0TKIsvHhpHCY3cJB7sjcMRfZro9QShmJCDuj/4Ed8yd7HKvke4SF7aGLRXG3CNgjaRUDqLGB4mg+mhnHvHLVzTVjhW5TJ1iM4GnzzUpRHitf6tvzCNaJxnIM4N0LOZcReqJOyQ2rBeQoumZIxPwyD8zjSEI8PcCICuLDY+6P5i5nHFFnkDSicCjmMBe7vYx5iaAtQo/gUDqomdBW/CHmMR9swYeKm0iPnSvyPcZvW4WKQOYIiOB+9cjunwzYgObzdpx5PbUU2mwcKipXfwUJHJooD0YwpxYaJP5J0vY8+0YRplNHZ4uRi+YmOxif0vgnzq9Owk/NzP334a90qSV69P89l1R7FmQFjED5yu//QVw5jwxKz+06kajsimXSzZYF5rGAW9pnOJAPHgHHsDYNSB9EyumulPHVwYDYfCMcGi14UFCG54dDFZik2SjsoHl/gmTozNe5QLTE8SScyihJpeYscQpGhv83xIl6rII3sSgm8e9P2Dct4g3aQdxQBQQSorg4bXfjcmgfmhLDfGQTq8hGO+Yiuou2JEE91xJvT2/D3ZAAVm//cMrxfWtL3uJ8WYKKpw3NxctGg6m6uDlRz2VMwOFFugOHj55berW+Cm9jUEGwTB7iElsX5QkyjK1l/NqmMqjYhnRpimuMg1u+1g/Kf2ajw= X-Forefront-Antispam-Report: CIP:20.160.56.81; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(136003)(396003)(39850400004)(376002)(346002)(451199021)(5400799015)(36840700001)(46966006)(316002)(4326008)(82740400003)(70206006)(70586007)(2616005)(47076005)(336012)(5660300002)(41300700001)(34070700002)(44832011)(82310400005)(6666004)(36756003)(86362001)(6486002)(54906003)(40480700001)(6512007)(6506007)(26005)(186003)(1076003)(2906002)(83380400001)(7416002)(8676002)(8936002)(36860700001)(478600001)(356005)(7596003)(7636003)(110136005)(12100799027); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:07:00.9587 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d283758-1662-417a-22a3-08db3c391d98 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: DB8EUR05FT022.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR03MB9506 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 --- (no changes since v10) 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 Thu Apr 13 16:06:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 674219 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAB26C77B61 for ; Thu, 13 Apr 2023 16:07:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230325AbjDMQHS (ORCPT ); Thu, 13 Apr 2023 12:07:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230240AbjDMQHN (ORCPT ); Thu, 13 Apr 2023 12:07:13 -0400 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02hn2221.outbound.protection.outlook.com [52.100.201.221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAA0E9EFF for ; Thu, 13 Apr 2023 09:07:02 -0700 (PDT) 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=zOEtSA60wMXs/yMCjTmhGeYB3RHdSPz2YLllpEhk3Z4=; b=G5f+eRpERpqUzPydooP3WFAO2AJPDN4YtZUlwuOBUSGB0hkb1ASBc7JTJjR+T4Zyz8LnttHTmYFEIJGPQyecCXCkByjelViJOcoSP+bOxVtujbu3lb4dtycv8BYl3pXSt2PHbXrMaCiFNkxoh4ukptUVutxnis2+JImPfl02XuccikUsTU2S+T43J8uOnZu5we697OzEGfarCBipyD71JTtUWEm9fg3giCi9+sktN+tDfg3H79j2HzfgfY3+JTpTlBvGv2pab7Rd0s5v1bumd6IINyQ6OqkVZgLEv7Kg0j9Cp4tojBBsFQGJR7wFftZH4zZRwYS/bvNnT/h8wwKIRg== Received: from DB9PR06CA0020.eurprd06.prod.outlook.com (2603:10a6:10:1db::25) by DB9PR03MB7828.eurprd03.prod.outlook.com (2603:10a6:10:2c8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:06:59 +0000 Received: from DB8EUR05FT054.eop-eur05.prod.protection.outlook.com (2603:10a6:10:1db:cafe::4b) by DB9PR06CA0020.outlook.office365.com (2603:10a6:10:1db::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 16:06:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.81 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.81; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.81) by DB8EUR05FT054.mail.protection.outlook.com (10.233.238.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.33 via Frontend Transport; Thu, 13 Apr 2023 16:06:58 +0000 Received: from outmta (unknown [192.168.82.135]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id B667D2008026E; Thu, 13 Apr 2023 16:06:58 +0000 (UTC) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (unknown [104.47.51.171]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id BC67920080073; Thu, 13 Apr 2023 16:08:14 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MfJk0TLgtQ0FfRWsqPXnTG4DF2eKRnwpcoMCELpYka7t3fLQ8eHs0ErCOSyPose/yUPsakcVOO68VMCTFPbrVzoRrSaoJMrP4k0EjP3Ge9mhBwb3j5axys1fLNuVGZG9tjNJ3UwiBCeh79bsf6BwLLchz3iikd6m8RF98S+MRhM/ZMm3C2JLsoVTv6D4nY7g5dYnU497p0mIdHtSMrlPU8QFVlFKu+/Int50JyLXNqdJQpUTsb1KbQChgNEsNs8b4O0+biblDV65xkeyNj0CGxg7djqhtvyNvZBVZP/UQmII3D/a/4DC5PPoa0qMPvXLoiJc2z5mrKTigkM6cq/3sw== 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=zOEtSA60wMXs/yMCjTmhGeYB3RHdSPz2YLllpEhk3Z4=; b=eXhnddw30EjiBgWQ9DiwXeMnIiIkIwORlDxsWERHdle17qopqkHg8Htut0mg03OWs64JMNdp7sr4tjvDjMnc6t9TybBdFM57qwPZI56cAglf/+mp0LNUXHL/oX+5FrlvY2BdtRB90FPOMc3u0O143sjCTCe3epkrhw+etWWY8BxhKO1UWTTtp8PHVNtSmQMsGuHy3NP2NrwGUXxKrMO/qnQPin/ST54lfBw/euLxtV21hFtGz8vYzaKKXqEEkCtWHmgYHSI7DADuaFhNYKREwWZ+2AqehG2dZQoXqwIrdDl9LbBslUuFTjjqM983lUN5/uT9IDFYJro0PJ9GC1ZiBg== 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=zOEtSA60wMXs/yMCjTmhGeYB3RHdSPz2YLllpEhk3Z4=; b=G5f+eRpERpqUzPydooP3WFAO2AJPDN4YtZUlwuOBUSGB0hkb1ASBc7JTJjR+T4Zyz8LnttHTmYFEIJGPQyecCXCkByjelViJOcoSP+bOxVtujbu3lb4dtycv8BYl3pXSt2PHbXrMaCiFNkxoh4ukptUVutxnis2+JImPfl02XuccikUsTU2S+T43J8uOnZu5we697OzEGfarCBipyD71JTtUWEm9fg3giCi9+sktN+tDfg3H79j2HzfgfY3+JTpTlBvGv2pab7Rd0s5v1bumd6IINyQ6OqkVZgLEv7Kg0j9Cp4tojBBsFQGJR7wFftZH4zZRwYS/bvNnT/h8wwKIRg== 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 DB9PR03MB8325.eurprd03.prod.outlook.com (2603:10a6:10:37d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:06:52 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:52 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v14 11/15] arm64: dts: ls1088a: Add serdes nodes Date: Thu, 13 Apr 2023 12:06:03 -0400 Message-Id: <20230413160607.4128315-12-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|DB9PR03MB8325:EE_|DB8EUR05FT054:EE_|DB9PR03MB7828:EE_ X-MS-Office365-Filtering-Correlation-Id: 365b3753-2141-433e-e541-08db3c391c69 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: MIelGnzHMW2JkH3TA1LghvB26Z0IDcNaF828mnN1iNUP+Dg0kz5LtuWQ67NVFtCdoGZ3gfJhZStSXosuDc5vvOI0qxEa/4sL/bM1463S/fomkUNQsV9kk8Dy94X5GAWoFraNxu2kmIYO6tYE0D3iSn7T+NHFWNSklUU5ZDj+DZQs4EQAxqxHDxzNK+s9Rn/szmZv/y1m+hmnCoI+JJbWRJ3J+13ynlOzFktYwvGZ/Cex1qD3EQpjWZM0WXh+Y8dLwL6SRmfYBy11yLFXolsb0qteYkKLQ0PjRwBW2NDgDnR9+MdNQUCd1BZauJezAiY4lYQPO0JV9nkTg9Aphukv6NSHRSLqflw9cAAF3Lz+hOH4z3u/zm7ogWEXUbV1XUPO6P/6J0yUmfiBkjn0tEkYAiDDlV1Qm6rRMdRMdz0EePjf55Znt9Al2mYO8U3FXIOlHi2Qt1sC7BgkPl2qImGynhsE7AUMtpBXE3eZrUQ/thzXGrQ4ROvPIBkTI2rgUJQqaAiAsflGXphmPOBOZRRRVIC5SfozaG4rx6IDWtNms4216Pd594dcK5CsPlv8QCjGndb01mZGNYgIIkWjPUr6N0JNuyvCT9PO/UiMQ2W+g116UorQAR3fEVsUoJy/rhF0 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:(13230028)(136003)(396003)(346002)(376002)(39850400004)(366004)(451199021)(6666004)(52116002)(6486002)(66476007)(66556008)(66946007)(4326008)(36756003)(110136005)(2906002)(7416002)(44832011)(86362001)(41300700001)(5660300002)(8676002)(8936002)(316002)(38100700002)(38350700002)(478600001)(54906003)(6512007)(6506007)(1076003)(26005)(2616005)(186003)(83380400001)(21314003); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR03MB8325 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB8EUR05FT054.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9f9c900a-de1d-4cc1-26aa-08db3c3918a1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mKd6BYr/V+eEio7g3jgKGT8WSZY9g/hJdvTHgzTNmd+rKvAyHv/SnUrSoDgzI2CPjs+orv/8bODt1RF053s4Rc9gIlYtm1NHbHpwKW9CwtKhyhZi7TypQK9jSn1/ekPy1Det/cWvRwSrLVnMlUfVcfYMsdXkB48O8LT1QNdUGII2hBg4GD8cHeuLBpmCMydhbhObUgPmWw9NNkbvJ7CRdBw6QecGsEenvTMyKLnYSYCql1jkREXF1RMq6a5KtNdHoyKq/b6dsimVE/+6fm8xfyK+WeK2rtFo4ZGiD2oCvqyXfhw8R5QRJ6rJV3KLBKt1U3ohzA5Tlqc0iftoVzOI+3TYoECA006pxriWtNN7uXCaGn8LX3IdwywMiEb70QNTGxQborlvekjGF71v7RCkJ3E425ujSYrmRIsXhQ+SYp3GFXHbkuINGnHDhGQ435CUWtfVd2HTfFaugHKsGXkciT6Q8+RhWueazVRPsRWn2pDL/yI8Fx31Uv/lzqfhpdq/fW75rCECS6e3MPHf8UpN7ByRDKlZftjaAOXB97SEryxhwIciPbkOEHiRSGZBXIFnK16cmT+9xpe7Ynkbf3T9K8Bc/Y9DdrLy/CsaCZeoa4DbrVJUSJaUk+4DzOlO5LiAXeZ7G5wfcGwITU1A/T1DECWJ/JohBUJfLTN9yZhXcd0pUQMoPjQ6fa5NxpSZg9nsF+cTBVQDi13bjMPIUbso6D9iDDc4sIP3o/IpJWTcWXmSjJGjcLuILXyozUwwoWmBFlYI0SDEHSw9aMBJJSCRvg== X-Forefront-Antispam-Report: CIP:20.160.56.81; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(346002)(376002)(396003)(39850400004)(136003)(5400799015)(451199021)(46966006)(36840700001)(40470700004)(7416002)(8676002)(8936002)(41300700001)(5660300002)(44832011)(4326008)(7636003)(7596003)(316002)(356005)(2906002)(70206006)(70586007)(478600001)(54906003)(110136005)(86362001)(6486002)(82740400003)(6666004)(186003)(1076003)(6512007)(6506007)(40460700003)(82310400005)(34070700002)(83380400001)(336012)(26005)(40480700001)(36860700001)(2616005)(36756003)(47076005)(21314003)(12100799027); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:06:58.9780 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 365b3753-2141-433e-e541-08db3c391c69 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: DB8EUR05FT054.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR03MB7828 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 --- (no changes since v10) 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 Thu Apr 13 16:06:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 672913 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 912EAC77B61 for ; Thu, 13 Apr 2023 16:07:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229560AbjDMQHZ (ORCPT ); Thu, 13 Apr 2023 12:07:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230367AbjDMQHT (ORCPT ); Thu, 13 Apr 2023 12:07:19 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-cy1gcc01bn2090.outbound.protection.outlook.com [52.100.19.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B3E1B456 for ; Thu, 13 Apr 2023 09:07:05 -0700 (PDT) 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=nSz8JD2oB9EW7YPFfb0rohANkA7PZl852TCy2tfOmNg6PUliC3xYoRAqBW1fG6hFkyUuEPCJlt+vqWfKKPRhw4CTfX1uMivp0dpRuQ6zem7cHvThNDOFU+tSqUWtn+gfZWVmrNb5tkT6iv34+6aWlTs+V8e9dmMtut7Nt5bpELWD5IiH1ZLEYWUKHtMzc7cw1dBYZgWTMDHTMp9D4QkrQfliZqwMbi6RW/MevU2igYhJiOF5gqHfMh3tgxyESkucHeYosn5mYKKC1RTT0Zkupe0HL/s4PcQXApACuf3s+LIgzQCzue8UDJ95Rhk1/FWHcN8zwDexuP0FZRDvxyzhGQ== Received: from AS9PR06CA0322.eurprd06.prod.outlook.com (2603:10a6:20b:45b::6) by PA4PR03MB7024.eurprd03.prod.outlook.com (2603:10a6:102:e4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:07:02 +0000 Received: from AM6EUR05FT048.eop-eur05.prod.protection.outlook.com (2603:10a6:20b:45b:cafe::dc) by AS9PR06CA0322.outlook.office365.com (2603:10a6:20b:45b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 16:07:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 20.160.56.84) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.84 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.84; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.84) by AM6EUR05FT048.mail.protection.outlook.com (10.233.241.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 16:07:02 +0000 Received: from outmta (unknown [192.168.82.133]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id EAC512008088C; Thu, 13 Apr 2023 16:07:01 +0000 (UTC) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (unknown [104.47.51.171]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id D30462008006F; Thu, 13 Apr 2023 16:08:03 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A44j8PjwpNj2qcQUOmNXr3x6aNy8aEcvqHjK6QOA+CV2rSqO6KJSnpXVrzOWZRKqAZcFpS7l8X4X/O5vJ8C/s+PA6L7L1Vx5UjLDtCghReLReV2YgQHZkHiDw8yUPToKQTZlutwv4dst54ml/tM64WDtZCRExVqV156pvLr+MSRP/fn7Y7c04bjeV5eraxBuB3Kgl/gRVtYaYUibZ3QqbFi6G9l0YOvX8Z8KDnuhgxjX4420DnbmYneBKBFgMd1lxVo8AnunmzXfYZG2Ig9v7YSwTQse6QcnvJaKdRD70HVxsLOzRUTdvF+O6++DnbuWl2gedv167OLhY2DJh1UTgA== 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=aObiZOO4BHfstwqolwg4DIGi5eqtH24hCRJx/LQNZaFd6KRz7wK7ceomhTS2/SGaAEYGJn7g81066F+N5A1vjEQozqgCXY/zroZRs2h+/P6u4U0AbiIZgh9BQ3VvM62Eoqak6fDTRDOG5Cn0/Ck9s2TJWbW6zwQ8LvN+5Ur0T+aOXZn//3OhDzR5Gwox7G1AM13WCmVqp3jow/F2H8HMTXImr0KTCk7H/XPsgOID0PTMOMA3e0a3QodyWvGUOR9ve4FCh7JS6ApzLK330QJ4/cI0lpGqzG1tML8M1dNaVLKgVnpnI9v29BoBkwT8zN63iSyR3/VfVrq0nyJAQWG4KQ== 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=nSz8JD2oB9EW7YPFfb0rohANkA7PZl852TCy2tfOmNg6PUliC3xYoRAqBW1fG6hFkyUuEPCJlt+vqWfKKPRhw4CTfX1uMivp0dpRuQ6zem7cHvThNDOFU+tSqUWtn+gfZWVmrNb5tkT6iv34+6aWlTs+V8e9dmMtut7Nt5bpELWD5IiH1ZLEYWUKHtMzc7cw1dBYZgWTMDHTMp9D4QkrQfliZqwMbi6RW/MevU2igYhJiOF5gqHfMh3tgxyESkucHeYosn5mYKKC1RTT0Zkupe0HL/s4PcQXApACuf3s+LIgzQCzue8UDJ95Rhk1/FWHcN8zwDexuP0FZRDvxyzhGQ== 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 DB9PR03MB8325.eurprd03.prod.outlook.com (2603:10a6:10:37d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:06:54 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:54 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v14 12/15] arm64: dts: ls1088a: Prevent PCSs from probing as phys Date: Thu, 13 Apr 2023 12:06:04 -0400 Message-Id: <20230413160607.4128315-13-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|DB9PR03MB8325:EE_|AM6EUR05FT048:EE_|PA4PR03MB7024:EE_ X-MS-Office365-Filtering-Correlation-Id: 55e73caf-db75-4b20-006a-08db3c391e3e 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: tyUwaGmeEC7mWJkbSFzmP/1MZjhW40+CWn5b+ypngmXQKGfCZqCLf0WFDquWe2WNZsv6JvAL5LMdcdq4r75GWeusKoMCP60akJtUK2VJ2E+L5yE0Cx2xgJCYIMZb/W+cgtCXOOK7rgzQbPzFWtcKXXphKmlfSzq+cPAM1qWcR06TS0F+sEjHLzqfsZteRPj6NuSO/hITTSCAh/d4ydDr74ljqQxcIYcxUNN0idS/XhUV1G6NeIQpAfxtPzKgI+f5QLdoUaithru+W48UobZ9nWsPtpp+hEBoOhWU9BkkUoxT/FHcwAc05hZzlCYmqt7baQbI9/Bo6nRT5P6K+gyC2Ox8XWTzrXaVgY1r7jxLBeDqBvNoIAKQicSQWqlolAgT2AtbEImdTgIDeW30D+KLuBuQkQuzKgGqCuzWeVafkUwMlLs17Mu46mqNimYhRjAmRObQ3ifvHnf1ecTIf5+jkE5HhWYI7WxdA6IjN7QFl0YEFaJA67633eYsRsgACoEOocDOH1t3LwMLG3lmKF3hfAJQJIr4IHUTroiunTB3QeoMpz+MEJt+Ig4vJ0Gv1LLHc5MDk6dTOlWTng6OKe0rXLnQycecpgS2SHvgYrIGKF5ChC95D/BZTsMZ1decX7rq 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:(13230028)(136003)(396003)(346002)(376002)(39850400004)(366004)(451199021)(6666004)(52116002)(6486002)(66476007)(66556008)(66946007)(4326008)(36756003)(110136005)(2906002)(7416002)(44832011)(86362001)(41300700001)(5660300002)(8676002)(8936002)(316002)(38100700002)(38350700002)(478600001)(54906003)(6512007)(6506007)(1076003)(26005)(2616005)(186003)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR03MB8325 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM6EUR05FT048.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2b03afed-a127-4ff4-f6bc-08db3c3919a9 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2Yc4st1Rr8zCXg++UztLUnZFZ8p74UxQspcjt6YxTwrMqozpygyp3qL5VqqobBUT0eNMKjjjKoXn8rvzZcTczdtGBVKTJ+KKGMw7WsK3U7qciUiHLNPCx3xix13W9HKYv60mVG34Xb0kHaCF2ysNjbaNc1KURgbqGvlZFQFjNzlRoeABbxYDtZpdlxO4EsGdqfpG9xcc8Zmg4PY0+rY5vzfzaU7h0ddTN2V3OM5KdN58A19Y+5LdAyVDkJviAMa9hxM77jnXaUUsQTQB9Bc1QMIuQvpTX/9DBPxLIXJvFeoVuOEK30lCY6Pl639a4cinf7NyUb4Z0eQk+mnPTiUjzDvVgIsNoxx4NRutFAQrtdqlqvMa9RFUNo/YAam7DiDhIvO/Wn695A0olb7mufPxrsVFATqRG4feFz4gdsLgtoeOKsQAHgf77GtrwsKqigcGB07ztu43dfkzaxKsB9hRA6ScIUt/HaXNqDaz+F8ejOnUuCwGi+6hgzGJNt+wYm+9kRrcYtlusRzh5BsUl9azk0xEs5y09CegLqOoU3DtsqvjXm47yOed1xeJwXnE66DQnVDQsiaWaLzj5AClXZCD7VsO0wjO7xBCGYDtSgWG4YBa7j5EGpuS9T3UJL3QgrcdAa9rAELozf5HIvYzGk/ey2olKH/bPHWy6Q4OPPNXr3HHKF6+lp/yOXM/LG0Ix8yR2AVoqXCYbbsoJ0TTVzG/zcRZHCFHncBga1q4PHqCf+gMatMit26+HsFKJ8nh5CwGHTJzYwkmid1plPa2HsR9Ig== X-Forefront-Antispam-Report: CIP:20.160.56.84; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(396003)(376002)(136003)(346002)(39850400004)(5400799015)(451199021)(36840700001)(40470700004)(46966006)(316002)(83380400001)(34070700002)(41300700001)(110136005)(54906003)(82310400005)(86362001)(36860700001)(478600001)(336012)(70206006)(2616005)(8676002)(4326008)(70586007)(36756003)(82740400003)(6486002)(47076005)(356005)(2906002)(7636003)(7596003)(8936002)(186003)(44832011)(40460700003)(6512007)(26005)(1076003)(6506007)(5660300002)(40480700001)(6666004)(7416002)(12100799027); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:07:02.0614 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55e73caf-db75-4b20-006a-08db3c391e3e 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.84]; Helo=[inpost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: AM6EUR05FT048.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB7024 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 Thu Apr 13 16:06:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 674216 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2452C77B71 for ; Thu, 13 Apr 2023 16:07:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230160AbjDMQHd (ORCPT ); Thu, 13 Apr 2023 12:07:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbjDMQHc (ORCPT ); Thu, 13 Apr 2023 12:07:32 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04hn2238.outbound.protection.outlook.com [52.100.18.238]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D31069EC7 for ; Thu, 13 Apr 2023 09:07:09 -0700 (PDT) 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=iIRYNtxwnPmwttCJbtIJ0LS3IYPNt+kA5KMteidNF7c=; b=xMv+2SFnuEWpEAgf01hiZyOltSPxgK36S/p5gWaiIgXldK09MV62dhqkGIQ8v33QfPRoRIzDEkjLt5DNfCsIVmv3+ffvydOHHkkcVq5bm3UuNBfLNBj1l9Lmt+CxUP0XWlFtSZzymAnxZwIRz7u13z0LHVbvajMhvbEGqt8fFq2OB1OUGNIIXwMVFoIeil1Vo64l5Iq7AwqvB+86fiBFNcYIr+W6HJWdOdP1DTDYC8HOwfOrvWNscthMCawFE9qlzaKqcNrmoKFQ3KNAY9RDKquHttkqUPLLCeKoBmVD0dQAV1cFNXCoQLespCcBpf19ikZR18FNA98LmA9zvzk+kQ== Received: from FR0P281CA0049.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:48::15) by PA4PR03MB7168.eurprd03.prod.outlook.com (2603:10a6:102:109::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:07:06 +0000 Received: from VI1EUR05FT041.eop-eur05.prod.protection.outlook.com (2603:10a6:d10:48:cafe::8e) by FR0P281CA0049.outlook.office365.com (2603:10a6:d10:48::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.4 via Frontend Transport; Thu, 13 Apr 2023 16:07:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.80 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.80; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.80) by VI1EUR05FT041.mail.protection.outlook.com (10.233.243.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 16:07:05 +0000 Received: from outmta (unknown [192.168.82.135]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id A009E2008026E; Thu, 13 Apr 2023 16:07:05 +0000 (UTC) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (unknown [104.47.51.171]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 6A70220080073; Thu, 13 Apr 2023 16:08:05 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IaKTfZ0QaRXwqmoaCSeelMIBBpmtUEaopJpWyM454ktnpFz+CghPvqsVH+wdmmY/9GQvMEFmKWEWEZ+gr3RekWovZLB4ZVEkHJGkh0bvstG0SxdOjsRn9IOkBfBfaGeeB7HyBPK6y/VKlYcBMbI1Hk+1kur2f5sLhYlTlCD/hyNlAbPj3VowLgjbfTTl0AFZOfLbdWBeRl7YTOBe+73ftJ80CNIHPys3fCZsK8EX5+t5eOEqiM3ZeRSPYFgqSB3aOLG9cu3ULUNgd0yL2Cb4bSL26cHnwi3CWswZeYjQuV0idfdmOv6vwIfA7w/aIRC9KK8v77Q7cotHKD0T3eAvsQ== 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=iIRYNtxwnPmwttCJbtIJ0LS3IYPNt+kA5KMteidNF7c=; b=d5daXipI/eMWi2jasKMrIlfHILtrHwOH/A7tkviQ9PltrTizEcbnKHkEeRtCDeU7o9PIWlTpBMNquyEw4YJghUjA1E/+d1Bei+/Gf93Vt++orFuY8SUiFbyJemuSMLUigHHNTQnpcilwn3MUzCOpPx1qKwOjRl0OdwV4z/LY6gLcd25fDGdguGZ23eIkvW5B6BHL1zoslrPzGOlOdbwGyz9KuSZj2lErdumsL38BVc3/1HNOOBlfrhT/VIkghjI4Dqkm1M9Fo6KGJi+PdnoeDViTi72D+hF0QE56oprivo5Q/rSwmwlvi5atEfBu6up786Z78jQotvHOWVCirPcwVQ== 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=iIRYNtxwnPmwttCJbtIJ0LS3IYPNt+kA5KMteidNF7c=; b=xMv+2SFnuEWpEAgf01hiZyOltSPxgK36S/p5gWaiIgXldK09MV62dhqkGIQ8v33QfPRoRIzDEkjLt5DNfCsIVmv3+ffvydOHHkkcVq5bm3UuNBfLNBj1l9Lmt+CxUP0XWlFtSZzymAnxZwIRz7u13z0LHVbvajMhvbEGqt8fFq2OB1OUGNIIXwMVFoIeil1Vo64l5Iq7AwqvB+86fiBFNcYIr+W6HJWdOdP1DTDYC8HOwfOrvWNscthMCawFE9qlzaKqcNrmoKFQ3KNAY9RDKquHttkqUPLLCeKoBmVD0dQAV1cFNXCoQLespCcBpf19ikZR18FNA98LmA9zvzk+kQ== 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 DB9PR03MB8325.eurprd03.prod.outlook.com (2603:10a6:10:37d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:06:56 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:56 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v14 13/15] arm64: dts: ls1088ardb: Remove aquantia interrupt Date: Thu, 13 Apr 2023 12:06:05 -0400 Message-Id: <20230413160607.4128315-14-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|DB9PR03MB8325:EE_|VI1EUR05FT041:EE_|PA4PR03MB7168:EE_ X-MS-Office365-Filtering-Correlation-Id: a741f2a9-deeb-4d33-b4df-08db3c39209b 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: NccCOcfopo1mbEN7wtTo0wdUsbkRB+uizLj6i3dJnx82buW+X8ioshxLoHg3wL69l7Am72qN18nR8qVjrFUdZKSC0i6Isfa+YepY5UuWOlcRfvp6HeNvp/p05nLHSHIuBdaa9F78++0PKrlmvFx3oCJAC9lJQKbE02S084GITlyWIVt9ztGlNmSTwvJOKqSQOlTEd11ORDZmCzLwnM2Rf7I3JciRRgJ41Vw+/qLQIR7fQNLgTN9bDd9GLalKQ1DRUJN0sKl8B3FUsYMWBh1gvMsEEHo5QJojfYh4Q+tBzwMEmSSJKGb1JKDp672koo0NHZZcxtsXanLUzf2LnRyChLPmNpVUqQlPFu2j+5kj+GkCF1JROG0ab47JUKJfc1VG22/VL8R7Ums2/g3mtvCezj4WzNDZ8jFWmQBnzneyhGlhkrQOF95Eabs50EVszCjK20fJash7s0iWrSvUO3DrNJ6l1Ml4Ed92Ep14HpNodKH/uAFdDAz/rwpgyWs/InC+SJmtnHo8PNyqQfvsUJ+9atd3fFjf0/RnErTVpH2/ocfBh5NIxx6bgLN8FBGWt8vG7D/hwgPBEkpXxBQiqYm/2a9bhTpgW+k/IM6vb7pD8SQ/EqnWjTnM+xhXqlSBaE1r 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:(13230028)(136003)(396003)(346002)(376002)(39850400004)(366004)(451199021)(6666004)(52116002)(6486002)(66476007)(66556008)(66946007)(4326008)(36756003)(110136005)(2906002)(7416002)(44832011)(86362001)(41300700001)(5660300002)(8676002)(8936002)(316002)(38100700002)(38350700002)(478600001)(54906003)(6512007)(6506007)(1076003)(26005)(2616005)(186003)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR03MB8325 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR05FT041.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ca302561-3870-417f-11ae-08db3c391aa7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HVOSAUdELfy1yd3ShNBL3pjp0JqBf5lKbRQrnziFU5AmtWfpOIy5ZrxkPmhOE2qKjGlegDCJrbICnKaCR7tparhQC/EWfX4T3CNe9ipHxSEsjHaT4htyyYUj+dnmM7fsTSDE6Lwhr1hpwKgPDkmYmnXLdQ0w2Y0fGI5V3HxEJwxPyEsfQ7x0YCet9K0aIrb6qvgckPBIX+ShoHLI0o54CIfmnhgsHqIjmu2RKOecbLxuNka9lymIRnSKIOziu0962e8nY7Wz8qvfmoadohZDr7YrVquLXfNEAbFv0fx0zB6ISXw09cEq/n0/2OMNBHwRexIxqT8SY3zTLSri5O1q9dH74h1oZVgmRgH/I9OUxF7oQHFN5q5QdEfd7YbB8mRv/J5w5PJcSTxdxQ6MEqYDICOl7DTc2xuWz3B9+tw5D6VfwODVesKZqgftZIp4+HmgPzQumtPL3aoIuGVimLkJ+QxfMagr6QDkyqG+57eOqqcepqxUuu5uAdU4c7L4ecbaPceUcQ3aFJ8luvRBRGxoLp0Bfb6aJi4F3ho17pty3K0Q26Dnhg2QZk2SyI94wgajNxLB4CFvOnDynP+rGkcOtd3jGemDFBeFzqLwrw3F9zKBRoFl6AotL4sku9VKtSP+dZ069c4qQv9B4pQCNaoFZsLI5s/bAN5YQ8m6anmyX7C0txYC1cslRhSLSPrVJIqOTFJJ11mhDh1kHuFDjDfP0Sx+ZwMws0RERmBItMv5a3PdicaTBCobsHkx1/Wl2p2OG4PRrijUk9iK5y5twkTclQ== X-Forefront-Antispam-Report: CIP:20.160.56.80; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(136003)(396003)(39850400004)(346002)(376002)(451199021)(5400799015)(46966006)(40470700004)(36840700001)(36860700001)(5660300002)(41300700001)(82740400003)(40460700003)(36756003)(7416002)(2906002)(7636003)(8676002)(86362001)(40480700001)(356005)(4326008)(8936002)(44832011)(70586007)(70206006)(82310400005)(7596003)(316002)(1076003)(2616005)(83380400001)(336012)(34070700002)(47076005)(6506007)(54906003)(6512007)(110136005)(26005)(186003)(478600001)(6486002)(6666004)(12100799027); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:07:05.9997 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a741f2a9-deeb-4d33-b4df-08db3c39209b 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: VI1EUR05FT041.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB7168 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On my board I have never been able to get this interrupt to work. As such, the link does not come up. To fix this, remove the interrupt, forcing polling mode. It has been reported that this interrupt works on other boards. However, switching to polling will only result in a modest decrease in link up/down delay (.5s on average). Signed-off-by: Sean Anderson --- (no changes since v13) Changes in v13: - Split interrupt changes off from serdes support arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts index ee8e932628d1..391c2b8afa81 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts @@ -128,7 +128,6 @@ &emdio2 { mdio2_aquantia_phy: ethernet-phy@0 { compatible = "ethernet-phy-ieee802.3-c45"; - interrupts-extended = <&extirq 2 IRQ_TYPE_LEVEL_LOW>; reg = <0x0>; }; }; From patchwork Thu Apr 13 16:06:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 674215 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4366C77B71 for ; Thu, 13 Apr 2023 16:07:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230257AbjDMQHj (ORCPT ); Thu, 13 Apr 2023 12:07:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230094AbjDMQHi (ORCPT ); Thu, 13 Apr 2023 12:07:38 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04hn2219.outbound.protection.outlook.com [52.100.17.219]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B24A8AD35 for ; Thu, 13 Apr 2023 09:07:15 -0700 (PDT) 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=jKdzNvs3L2X690rVL5GbXF5dPwYDopOF4O/ovnvRwNo=; b=n+RCQ+OEzUe967+VQ/eyI6A+GGRsgE1d27uBMETVyiLEbgVTzvWqTIGBTN+b6NCLs+bvq6FUvMEQSKQJMBPzmIXKerXh+rzjBKpuaPKvrJO2JvqhuDbCpAe3ts3paEN0Nwyms3c47oMH2X+KkqOaLxhLAboxC4H12N1lclkK/QQSY8ONWFE2wwiw3qsEX2Ql/uM3wgDUO7TGriJ+F6LmkfvGg7yypJDluJGLk9hm+LyNlF0AHB+a/0FWW8XtMRB4XU1OBjpKYywH5ZHngm2MQT/OFthO7o1H/S0hFRxu2D3hGC5RPBwcwSXVynPkK0cKhfNqlkyhjhLAA6BqHKvmrg== Received: from DB9PR02CA0017.eurprd02.prod.outlook.com (2603:10a6:10:1d9::22) by AS8PR03MB9935.eurprd03.prod.outlook.com (2603:10a6:20b:628::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35; Thu, 13 Apr 2023 16:07:13 +0000 Received: from DB8EUR05FT006.eop-eur05.prod.protection.outlook.com (2603:10a6:10:1d9:cafe::59) by DB9PR02CA0017.outlook.office365.com (2603:10a6:10:1d9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 16:07:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.82 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.82; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.82) by DB8EUR05FT006.mail.protection.outlook.com (10.233.238.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30 via Frontend Transport; Thu, 13 Apr 2023 16:07:13 +0000 Received: from outmta (unknown [192.168.82.135]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 175742008026E; Thu, 13 Apr 2023 16:07:13 +0000 (UTC) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (unknown [104.47.51.171]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 9B5592008006F; Thu, 13 Apr 2023 16:08:09 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bCPNPuvTcZoJ9EhLLqwivtsc7ttcDcE0RXg7M87G2gZKvJFxKZLe3VKhqkZ4skWOjXKoWO1GpjXfFp6LySwJqWY0SiebxUc0cE+2hDDbVLM3Z9cpi5FpyCaCpOuaqjX6f12q+e00d3XL1djkvF0Q1puoFiJ7Qo3JDWZS8/DFyd9M9EFIgyVovW/1L6So8b6LfXuEgdbYVBtrwVU9JSIuw5bmXu5JNj55UKG2ssOzoIUdyMN3sls4FR4lC5qCZ4vUlaH0kjlSXGqQQW2/nX0vfUQX5V3Dy5FsLrNtU+JxaTxmELOLi/gvwULeaIjuJmF1A1/po/Nuueqj50J7Q1jS+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=jKdzNvs3L2X690rVL5GbXF5dPwYDopOF4O/ovnvRwNo=; b=KlsuDgBgWICE+kDb5xOCpnj6PYtxzcdYUD5vjcamjhswSzqaWPXwsfdkEkZNB2ZZVy072EqS8lGs72rJp2yBATYHhw2lnjxIXMv1BcoSxHW49+bTZETTWlRqSVE+hGTIjk9QMBXrFO41+FYGeIjPDrQhES7tSFKyLDnZWVM4vCU2s3VvT1RrwUByjmaPQis/mnuL2f0I9IpL7dvcsdul+sAiCr6Sz3XTJJq1iFCK1zldszI0XHbi3HP5odmtigIog5qDtDE/p1PeRqu7DaJz8soLDjkI+VF03SzFL6Y/1CS+ulvxa4wJ3RcptBeFZeXK2RIkGq2GoFoWWPHXoXueXw== 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=jKdzNvs3L2X690rVL5GbXF5dPwYDopOF4O/ovnvRwNo=; b=n+RCQ+OEzUe967+VQ/eyI6A+GGRsgE1d27uBMETVyiLEbgVTzvWqTIGBTN+b6NCLs+bvq6FUvMEQSKQJMBPzmIXKerXh+rzjBKpuaPKvrJO2JvqhuDbCpAe3ts3paEN0Nwyms3c47oMH2X+KkqOaLxhLAboxC4H12N1lclkK/QQSY8ONWFE2wwiw3qsEX2Ql/uM3wgDUO7TGriJ+F6LmkfvGg7yypJDluJGLk9hm+LyNlF0AHB+a/0FWW8XtMRB4XU1OBjpKYywH5ZHngm2MQT/OFthO7o1H/S0hFRxu2D3hGC5RPBwcwSXVynPkK0cKhfNqlkyhjhLAA6BqHKvmrg== 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 DB9PR03MB8325.eurprd03.prod.outlook.com (2603:10a6:10:37d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:06:58 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:58 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v14 14/15] arm64: dts: ls1088ardb: Add SFP cage Date: Thu, 13 Apr 2023 12:06:06 -0400 Message-Id: <20230413160607.4128315-15-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|DB9PR03MB8325:EE_|DB8EUR05FT006:EE_|AS8PR03MB9935:EE_ X-MS-Office365-Filtering-Correlation-Id: 947ae9fe-7582-48b6-3dcc-08db3c392500 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: kKHT6rWy1lFrYKJRgSxXFpYAj7zhOirJHCiS5bdv4ul3JgRr/i7HFMsWFlJlMSUEwyRkfoumx4KvPFV+wxdVxhpWjn99vcoIvuGt2hDnn8wY3qJWCZPkrjUzI/LVIPTKPPIbKKP8D1aghmhk5KBVf38Kyzm15FqBrDNu3QVtxdpm/f6P6Ts/HI55m4D6zsCAkXGeP8bnJZ/Mg7GzvzrOx9BNy5Rgkx2YUXOOxLANkYY+7mu0RBYofGh2ULqCZci8CbKRAVZiuzwUaRikhLBzyjss1kT7uAw9kuEJlbLHyIjbYg/txEY4pGJE+r+L41flBLJBDQiL3Zta7wU4irR5tEOOFaE5jf700ruePqMHbRZ5o0BtPS2PQ9YkH1ehsb16C425MszyP0RksHehJJLvjbHii8OB7caf2J/+edmP63y+Mv0i5gFMfZelV5LluISqLCI9JfxlfJ0rCvh+QLRHD8dDHDYwCt0uC7O6gRBk7AtTzePFT87QeZeRS0zGsC9XuPgsyQCJhdVltU1a69VogaFfIRhgFv3s2xXg8Qi8ccSg4YrUVWxzXTbLxyeNXSAg9awwnGlO2iuzI/xhDPvwQJZkGkstqLkx/zGB0nQccXSRiWN1d47QsxmebA+LDyOk 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:(13230028)(136003)(396003)(346002)(376002)(39850400004)(366004)(451199021)(6666004)(52116002)(6486002)(66476007)(66556008)(66946007)(4326008)(36756003)(110136005)(2906002)(7416002)(44832011)(86362001)(41300700001)(5660300002)(8676002)(8936002)(316002)(38100700002)(38350700002)(478600001)(54906003)(6512007)(6506007)(1076003)(26005)(2616005)(186003)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR03MB8325 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB8EUR05FT006.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: da772d05-822a-4237-9b16-08db3c391baf X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qaSgxMwp3NIlrc0DDB5LxiL//NnZFOPShCbRRkAu/IYbHtK2QJRqGwBUybK27gzGOantiWL5EgzfKvOubXvvAeRXleogEtv3gitws3i7+4trhxn3PVH2vUdJP72qg67zSm/eb4jdVhJJ6T8zSLf/CxS2vBSilhgXPyhCSa63sbm/pfVH7JtE77UQ5DFRJ/zn0Y1rKDJXzHQK8IfReVLGsdgbU9xK/ML4JMlPYBZ/b+e/oLdgvkKO4sclVO/gGqmL9r4MvXJLQ7rCCv/CnRP4/cjBhC76em2Ch9uGFunFcOEHTW6w3460WFXWDdtNSW3I7Djx9SnDsjp+Nwti8icLWE9fFhjTcOerKbnU4ozbYUQXhaXDj7vFGArYSNCO5swCErM0w0SGTGpEJiIjLhywmMUn7Fz5PkV8PuyXwZ9XuOYVrXvcesprPOcn+/vKk+ECdX1SSXVUmHb3XsUdtK7NU8Kd7YEPEfwrgvi77RqQUkiwce2Z7zXQVFZTliGNeouOE/BPd8MuhJG4qPeQO6dz9EW/i/5yy9ebw9XFJp+hNr4qBlD/iTjWKo4fJvFMi/ROAefDAemy4ZX8OP6zrWCGKxRe7kSaXmunuByBQ2dZTuXOInofNOXD+CBcWddi4ApFVMddIPWbNcbI1Rzuz9qnLBO5kmjNUHZ71pkOSvgjyNEv7NKKjO0sbviL7KZtm9gPOeQUAXnOlQE1lK5OOX0AsZZ4AlVTzyQQaBOpUUWRjPldwrBZ0oZOdktYw2KgceDzqjM4cxsW5a6FMM/99mm+Cw== X-Forefront-Antispam-Report: CIP:20.160.56.82; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(396003)(376002)(39850400004)(346002)(136003)(5400799015)(451199021)(40470700004)(36840700001)(46966006)(40460700003)(36860700001)(34070700002)(478600001)(316002)(110136005)(54906003)(86362001)(5660300002)(7416002)(8676002)(8936002)(2906002)(36756003)(44832011)(4326008)(82310400005)(70586007)(40480700001)(82740400003)(70206006)(6506007)(7636003)(7596003)(41300700001)(356005)(6486002)(186003)(6512007)(2616005)(26005)(47076005)(6666004)(336012)(1076003)(83380400001)(12100799027); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:07:13.3538 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 947ae9fe-7582-48b6-3dcc-08db3c392500 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: DB8EUR05FT006.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9935 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org dpmac1 defaults to a fixed link. However, it has an SFP cage, so we can determine more about the link (such as whether it's up/down) by describing it. The GPIOs are part of the "QIXIS" FPGA. For now, just model them as individual registers. Signed-off-by: Sean Anderson --- (no changes since v13) Changes in v13: - Split off SFP addition from serdes support .../boot/dts/freescale/fsl-ls1088a-rdb.dts | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts index 391c2b8afa81..9fb1960f1258 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts @@ -10,11 +10,27 @@ /dts-v1/; +#include + #include "fsl-ls1088a.dtsi" / { model = "LS1088A RDB Board"; compatible = "fsl,ls1088a-rdb", "fsl,ls1088a"; + + 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>; + }; +}; + +&dpmac1 { + managed = "in-band-status"; + pcs-handle = <&pcs1>; + sfp = <&sfp_slot>; }; &dpmac2 { @@ -170,6 +186,12 @@ rtc@51 { interrupts-extended = <&extirq 0 IRQ_TYPE_LEVEL_LOW>; }; }; + + sfp_i2c: i2c@6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x6>; + }; }; }; @@ -184,8 +206,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; + }; }; }; @@ -202,6 +247,10 @@ &esdhc { status = "okay"; }; +&pcs_mdio1 { + status = "okay"; +}; + &pcs_mdio2 { status = "okay"; }; From patchwork Thu Apr 13 16:06:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 672910 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59660C77B77 for ; Thu, 13 Apr 2023 16:07:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229900AbjDMQHk (ORCPT ); Thu, 13 Apr 2023 12:07:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230229AbjDMQHi (ORCPT ); Thu, 13 Apr 2023 12:07:38 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05hn2207.outbound.protection.outlook.com [52.100.20.207]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E52F4AF0A for ; Thu, 13 Apr 2023 09:07:15 -0700 (PDT) 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=5T5adR62bBzCG/qwyNRKK+xEuguBVkNspTR8LZaD1Xc=; b=f7ZUPuGnb1C3OLIv7W7L0Uh39nF4w7v5E4iIKW9AgvI6jvv9dzBQ3PsVTD7kK8SvuCEL9ze33lfISXuuPRH68jNcAo/q8QfVpiYE2dnD8bIq4bMe4QWV6eKA/M+8iyTz9dM3F4kopsbgv9maIi6jJPsgOa/Q+hYd60oQ8fOoD+kgxC9iFzf6/KduZaEN3WTYXNdv+cr04602Qg73hKBCxLZ7jUKkaGH/JX58flyLw1OXuBfDTJE7Y3gGygwVyRpoyXlPSBIpTadeZsrd4x0G277z6UD9Qik7NH9jmO0ZtR87DuwBHCNCoLhMbZqsWCbTyJcnURU4YBEjcBS/p992yQ== Received: from AM6PR0202CA0062.eurprd02.prod.outlook.com (2603:10a6:20b:3a::39) by VI1PR03MB6430.eurprd03.prod.outlook.com (2603:10a6:800:194::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:07:12 +0000 Received: from AM6EUR05FT065.eop-eur05.prod.protection.outlook.com (2603:10a6:20b:3a:cafe::f8) by AM6PR0202CA0062.outlook.office365.com (2603:10a6:20b:3a::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 16:07:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.80 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.80; helo=inpost-eu.tmcas.trendmicro.com; pr=C Received: from inpost-eu.tmcas.trendmicro.com (20.160.56.80) by AM6EUR05FT065.mail.protection.outlook.com (10.233.240.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.33 via Frontend Transport; Thu, 13 Apr 2023 16:07:12 +0000 Received: from outmta (unknown [192.168.82.140]) by inpost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id DA0BA2008026E; Thu, 13 Apr 2023 16:07:11 +0000 (UTC) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (unknown [104.47.51.171]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id D78C320080073; Thu, 13 Apr 2023 16:08:14 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CVsNL9+AX74XNtEO/B9F5Uhq47PS6IqVSkMaDZRCwE6fCcrLxSXbLfUQWf3vV2dY0+NhwKhDFTyczkFFC2KP1HGXEfg69wiKzOov1QAGSAJ5/hVXq4BcLq3Qv+GsESfV4DEMk2NyEuSY+DwTqjLs9/SoNS/fLDjir4G03fUN46KTMPMmYR5k4thyrU5+P/wSyaMAaXfLwg6RnlQ3JmNwMTEUDPMahZM+1CyhLrsL5xeb/rljTxdpYWhVcXkvuOq77iAJtlAFhWgjLYafkiM2lZr9ATQrYDbpujGYrrTHCpiSzhQUEHwvgdgT15dQHp8rx8WiyDphXm5bofJviIFjHg== 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=5T5adR62bBzCG/qwyNRKK+xEuguBVkNspTR8LZaD1Xc=; b=AHky4Myz2wxjXo9VLoisIaKloIk4VKnlXrnvVNHSOY/y2QjVomzABzyY7SuM0MmuwrdCO5XXDmawfeb4K90cVeCLSDy2Jk+bYNZYpoNlevNXctdUkrpFXMBH5gPZp8J7BfhCTcvet2T5DlEX1fKGWi8jUTvwk2YLn5GH/pmwM057LWroaRYxBotw/OYxX0sebXKh/bNecPf8MCyjEN1n6igdJox9HJfRVUr+Hml/Nu8wOvz54NeEoJ6YiKhwMjAh6RGKkEKOr2gRdfnTq6/ETOUH6pgxDjHZDrpheBHEpVwtdtjtPHyYXot9Hc4g3VHGI3p6IvEcQqW88UYwSnsuOw== 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=5T5adR62bBzCG/qwyNRKK+xEuguBVkNspTR8LZaD1Xc=; b=f7ZUPuGnb1C3OLIv7W7L0Uh39nF4w7v5E4iIKW9AgvI6jvv9dzBQ3PsVTD7kK8SvuCEL9ze33lfISXuuPRH68jNcAo/q8QfVpiYE2dnD8bIq4bMe4QWV6eKA/M+8iyTz9dM3F4kopsbgv9maIi6jJPsgOa/Q+hYd60oQ8fOoD+kgxC9iFzf6/KduZaEN3WTYXNdv+cr04602Qg73hKBCxLZ7jUKkaGH/JX58flyLw1OXuBfDTJE7Y3gGygwVyRpoyXlPSBIpTadeZsrd4x0G277z6UD9Qik7NH9jmO0ZtR87DuwBHCNCoLhMbZqsWCbTyJcnURU4YBEjcBS/p992yQ== 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 DB9PR03MB8325.eurprd03.prod.outlook.com (2603:10a6:10:37d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 16:06:59 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::2226:eb03:a8c:a7e5%2]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 16:06:59 +0000 From: Sean Anderson To: Vinod Koul , Kishon Vijay Abraham I , linux-phy@lists.infradead.org Cc: Madalin Bucur , linux-arm-kernel@lists.infradead.org, Camelia Alexandra Groza , devicetree@vger.kernel.org, Rob Herring , linuxppc-dev@lists.ozlabs.org, Bagas Sanjaya , Krzysztof Kozlowski , Ioana Ciornei , Sean Anderson , Li Yang , Shawn Guo Subject: [PATCH v14 15/15] arm64: dts: ls1088ardb: Add serdes descriptions Date: Thu, 13 Apr 2023 12:06:07 -0400 Message-Id: <20230413160607.4128315-16-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20230413160607.4128315-1-sean.anderson@seco.com> References: <20230413160607.4128315-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::33) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|DB9PR03MB8325:EE_|AM6EUR05FT065:EE_|VI1PR03MB6430:EE_ X-MS-Office365-Filtering-Correlation-Id: a43605ff-2560-4469-5a0a-08db3c39243b 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: cJmAarFb023qgeAOKoy34MGY8ynoZZVzvJ7fjkRDy9RwjeAbxIV7xSkV/YjyG86WTjbNRArqyfnNZCaO3F/s6/lrxKvUgveFIoJ2VsyLHlAgDqOCVSej7Cciw2/eA7W9tU167cR03eZiBQWlHQY4JBI6bhdoc7FV/TZPyK9ZWqJlpC3IA3YvIvt+ZdxYCV+RAELa8OGEz7VEOTEFg+JVOV9u8+Y7UaQdUDldJwxqKeoTY9IFZz9f88LhImdbUbrKK7Uw1jqPeVkwKoS20dh/FJ/N67SnxsIjpN7tYH2rL9HEiP6oDqt4QmZ7lHFqu/vKkIGTMKOBZjn9r2qYdxb0eFWFcoG1YJHfen4n3MtNNA3mNeCDPB5qRfEjQooYLAqU7QMS+XoObpCph3Me61LacjIN/W3rZ5S2wFVZHSDiPZF0euOrfAPZuAUKMV+Z0JWT0aG/Tug4P1gr1ulrPgG77dukHsEoMtTqt1Bp7wPP81R8Ux0ksp/35DQaG/P3VqQCmHna8OVVDv+DROZWk2GJKKdYpKdHAn4cdH4WwuqiaaHtTso4kUq9HHORsDGoOAnEw8EN+apDc9X7PLTKdvkkjqBXzT69C5g1JiZs4KGoCfkfFu6hGM8y/SSE9w6K8UBk 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:(13230028)(136003)(396003)(346002)(376002)(39850400004)(366004)(451199021)(6666004)(52116002)(6486002)(66476007)(66556008)(66946007)(4326008)(36756003)(110136005)(2906002)(7416002)(44832011)(86362001)(41300700001)(5660300002)(8676002)(8936002)(316002)(38100700002)(38350700002)(478600001)(54906003)(6512007)(6506007)(1076003)(26005)(2616005)(186003)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR03MB8325 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM6EUR05FT065.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 341b1742-8993-45b1-22be-08db3c391ca5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RY5Fl+nI83RaT9OAgNgif6anv1aAQoEqFQzFu4JoX7p7Ugbx68Pan87gJhPYWF9S36OM0RxjY55pKhUX9Gsw5iv+AD7+Cd8RqCubHkPU0PY+lOB9rneTz9q3Xp4nc4Xu1eic+dxdPKoeivyfvDPJQiQVwlIMU8zANOJS1F8mkZvbwgiR4sUorLfkVRu1aDF4OA++6qHXPXQM5WErMjLEfn5e6HjSUh4Sw+f7NxMiXKq8tUMOVW/fhjmTgHr6pPVOYHqGqB+QljfF9YQ+l8PyhznHGymcVEzMlGCNXAEtpJGFr2RHSuxrX8WpEzImbCIANOt6LS/XzZnIcnQXKxl8prrzCZHRn9gXyYHOYHDlyirQusFDqv6LbIHlvmewIm3dXVXNPpgv/rTBx0UOPrtlJCcMwmgjIoTNDJb5RWGZNzTmtxSCagpXZvbv+9ofoCp1VpVZc2iAHF0bwXYeIRXmoXnC05f/mrOct/dE8+wbNjMln6BbSZNrbymzMjltvitj89RLBs/LJqTsQDqLNnuC1FJzJfw/CLoyi3Jn3Vn8Xb5hJNATl3vKQCioXHxbq8bbF8tceCM51QPoRQjpJ8RVXktCsLUhYryWSMPrscAOaABwwpqAlT4Hxop892t3+xGoHiC5SggFtcRv4YARf0nypnnI0/H1qOqU/wrO6Y+RAlThKHxj0UWjFJwHM7G1ldy7y9JLisMwxHXunQkWhWzACb1YMjuhDDqKVajP71oorME= X-Forefront-Antispam-Report: CIP:20.160.56.80; CTRY:NL; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:inpost-eu.tmcas.trendmicro.com; PTR:inpost-eu.tmcas.trendmicro.com; CAT:NONE; SFS:(13230028)(136003)(396003)(346002)(376002)(39850400004)(5400799015)(451199021)(36840700001)(46966006)(6666004)(6486002)(70206006)(70586007)(4326008)(36756003)(110136005)(2906002)(7416002)(44832011)(86362001)(7596003)(82740400003)(356005)(41300700001)(7636003)(5660300002)(82310400005)(8676002)(8936002)(316002)(34070700002)(478600001)(40480700001)(54906003)(6512007)(6506007)(1076003)(26005)(336012)(36860700001)(2616005)(186003)(47076005)(83380400001)(12100799027); DIR:OUT; SFP:1501; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 16:07:12.0947 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a43605ff-2560-4469-5a0a-08db3c39243b 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: AM6EUR05FT065.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB6430 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This adds serdes support to the LS1088ARDB. I have tested the QSGMII ports as well as the two 10G ports. 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. 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 --- (no changes since v13) Changes in v13: - Split off interrupt and SFP changes into separate commits 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 | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts index 9fb1960f1258..ede537b644e8 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts @@ -18,6 +18,18 @@ / { 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>; @@ -27,16 +39,26 @@ sfp_slot: sfp { }; }; +&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 { @@ -44,6 +66,7 @@ &dpmac3 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs3_0>; + phys = <&serdes1_A>; }; &dpmac4 { @@ -51,6 +74,7 @@ &dpmac4 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs3_1>; + phys = <&serdes1_A>; }; &dpmac5 { @@ -58,6 +82,7 @@ &dpmac5 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs3_2>; + phys = <&serdes1_A>; }; &dpmac6 { @@ -65,6 +90,7 @@ &dpmac6 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs3_3>; + phys = <&serdes1_A>; }; &dpmac7 { @@ -72,6 +98,7 @@ &dpmac7 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs7_0>; + phys = <&serdes1_B>; }; &dpmac8 { @@ -79,6 +106,7 @@ &dpmac8 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs7_1>; + phys = <&serdes1_B>; }; &dpmac9 { @@ -86,6 +114,7 @@ &dpmac9 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs7_2>; + phys = <&serdes1_B>; }; &dpmac10 { @@ -93,6 +122,7 @@ &dpmac10 { phy-connection-type = "qsgmii"; managed = "in-band-status"; pcs-handle = <&pcs7_3>; + phys = <&serdes1_B>; }; &emdio1 {