Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8728550rwr; Thu, 11 May 2023 05:36:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zxAEnjWNol25xNAuf/Q2jX0dNXFD07YWQVU648xITUsj7dv+Zh8QI9eL+XvPyhKOCpkPk X-Received: by 2002:a17:902:f693:b0:1ac:8148:8c42 with SMTP id l19-20020a170902f69300b001ac81488c42mr15992509plg.62.1683808600287; Thu, 11 May 2023 05:36:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683808600; cv=pass; d=google.com; s=arc-20160816; b=xL31f/kSF4wV8Yt5igLN/Sf6fwAQYfWgF53zIJoBD38zH0p/JmdhpMKkdbVRop4H8Z jjpcWaW4bk+7kYPvf+G8ddOUBoPj71uyn7u3142rfC5YWNxvsfT0kqci0dp5LPVZCv8r HF35tz8BANXNDFSj2OluegSuuC+lGgVrpVonX8XrrtCSx6X6qbLjiv6I6ISmfKyk6C5i /6htDI1N8I0AzmIexwGWjcVfIG0txkgvGH3rSI1CVph/wfMOHCVFTwLMcrZn2KORmL1r eJF9rbBOvAynY/pNMmeY6Wmn7GhVa439Rm2X/PNnL2RLpt7NxQCyymaU415Pso3E6w0k zf2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=E36p7b7JEbKoESAylJNtlQTxXQT6IvaJmRM+O6bxGn0=; b=pB0fas9RtSIJ2xI4U36VI7iKhKRy5tdytVgtx7YBRUBoPedPf2jFaNbIdfauEC42N6 AFKO500V2CKD2WRdFZcQhOpi0fNq2M7FtmFpZUlU/XYL5v3g/DYIYH9CooPtL8f91VyB V7ts+QKJqxU3B7tysocdlp834JLaaVAjAmc4el3UZvH7OXx37dY3PXF8RFVZKqPIP5UF 2XWR3dVRkf2QtxRQrsUOAExZGtzKZygc9k6uJjCIE8oXyITgTX/ymnqifR8F6vDfx/SW GughNnlrhMb/clyC3ywWdmdrylalyHLyMTMXfo/w91cb7HWtkR4DXOsHqwwUMMCkBnhE t3nw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=vztAVVJg; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d23-20020a170902729700b001a637201992si6067077pll.488.2023.05.11.05.36.27; Thu, 11 May 2023 05:36:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=vztAVVJg; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237951AbjEKMPS (ORCPT + 99 others); Thu, 11 May 2023 08:15:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237916AbjEKMPJ (ORCPT ); Thu, 11 May 2023 08:15:09 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2094.outbound.protection.outlook.com [40.107.237.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF1E5D850; Thu, 11 May 2023 05:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A/1HEP/SjyCYIMebMmpIjGwp6ebD/lZ4DELAGoGWa/FPSYUO+7JChPR5tTz98v7spiOr5jqxZxBzEN9Rx+3dHF0prexGj8DNEaW3QEOAwF4OnEE3PeAw8FduARFMNXP330kR1IIQSl1gqqxF0ypHn0ecg6B2/DnTX8efLvNd6gUK2ZlSGFvdgGwzUBdMhq/qpQd8PrRSyIbp4cm6Lc0kZYzoPoJHZeMfNoly5n/W4F3G9gGlkLhSH8hYjjTD4bERCm04jX+6Cxt5+Y8sgERcCLsTHyM6tRotdfaOf3b1stnw00gCrGOR+MSeOc0rmslbngepxrMJtvU1BIZ8bWHKhA== 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=E36p7b7JEbKoESAylJNtlQTxXQT6IvaJmRM+O6bxGn0=; b=nIBGBX8Zr0b4pMGrIJsqqkyA+onzpp49gq1PIH0wY5U04pqrdzjlH2Q8IRF2YoJnLkfcfpNnEgITmBDeZdkn3/Ie0yYPKOunyU+0Wc2LuccnogXSHQVfudZJ0r22u0sNej6lbpIVF88qW46+aVfZqAyyMErIsYKxn+hm+C/PNvxVBEnBYR+LPSSCMzo/RV80XT2zRmq+bF58mcRSCJ1fAeQ9il+4HPERnLfjIrdEBsLOQQYR72PC53ORTHPcfDSDM80rFFCV/kHdKS0IbENqWGU9t+togTyq9RTsmLcvmnuUTZkqV1zzLvkWevwTEIuSc3ymYLx4wsURBituzRYhmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E36p7b7JEbKoESAylJNtlQTxXQT6IvaJmRM+O6bxGn0=; b=vztAVVJgiWAjy6sio0qKFzZMam9/xmh1xvbVC2oBlQ2pY2ziHlspwApLe9u+UQ14QNhNfgw5yAzIf4PvSiKNxbEJs6dFcsRFq25VA56f9qDcqUGoAsTT/kXuOBa7YzIICpGxco9J3kqKP6KWxE+1RH5jmrbw6mLS85L6zqOxr+8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by PH8PR13MB6245.namprd13.prod.outlook.com (2603:10b6:510:25d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.21; Thu, 11 May 2023 12:13:47 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34%5]) with mapi id 15.20.6387.020; Thu, 11 May 2023 12:13:47 +0000 Date: Thu, 11 May 2023 14:13:40 +0200 From: Simon Horman To: Daniel Golle Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Qingfang Deng , SkyLake Huang , Matthias Brugger , AngeloGioacchino Del Regno Subject: Re: [PATCH net-next v3] net: phy: add driver for MediaTek SoC built-in GE PHYs Message-ID: References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: AS4P195CA0029.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:5d6::19) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|PH8PR13MB6245:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f467e58-d4a6-4c1a-7d1a-08db52192c37 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lo0vZAdioYke2zGdlKQB9HMH3dNuj3yD2TWJVLAq9LicV3e1KwCZL/AWXUtWYjkWKn6s7fQ8zDvRy6R3COpQaXqNElTGW4j4yxVoKH+2k6ywVq1YkJkOWIst5rMzPmV9Wq39os35Fe6ECPHTTn6WqE3WpOzTw3KwhYZ5YGsNjF6Cl2j6aP7jmi+e2zl4CIkuIngO/tDYdEOEIUsFBE/ESqbJ+zvIGFK4hBMFkUoYdyHdiP1wvNahn24p25VPpkcisVRKN5nfUXBaTnzAAJCUQ+rIOLGbb2oy54wmck6gJDedsxRA+yzirkwhg09cAyqoIJHZCCUjOt6ZjFLmQwUhnTB70/+dNVQXvcmbyK6zanOMGDirTkdx+sS7g4jvutnQrbYTLRy6MHBcKjj/f8oUgmNVUYBoCfdEkceVot6CN4+S6wPkhperRF3ABEcRX7CE7s6rBYQyrF9UY1yubIJbolbbUnzXN3TStazp16LuqeBc+b494W8+E5dhLUFUo5T7CRkuVjrZDX1BSlLeUE5MNecA9GsXj/x5dcTkT6mKyQ95ShEXmYSIif5I/y1d/ZwcnBj9DKQdsiPungS39zFIsQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(376002)(136003)(39840400004)(396003)(451199021)(38100700002)(2906002)(6512007)(6506007)(41300700001)(2616005)(5660300002)(83380400001)(7416002)(8936002)(8676002)(44832011)(4326008)(6916009)(66556008)(66476007)(36756003)(66946007)(316002)(186003)(86362001)(6666004)(966005)(478600001)(54906003)(6486002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?IKHxoiGSaDV36chD1wbSuHEtXfOciGQxCrGLFsdXi3zD3RNi0qUBTir7KI50?= =?us-ascii?Q?AdEnkqRM6Forfyc5I1lKkSFQvUqXB6FNaHdMzAnom3TDHTaUqOiqAnhAWZRC?= =?us-ascii?Q?Ss+IwnwMrDJEswlkGy5jimSOru9HAyr23cQP0PPGuYaNpcg/Xx7KzPaGIota?= =?us-ascii?Q?4FekkTAwEGZzhw4XhqnoI0Eum90XIQY/TYqZCEsppVlBQXjuyUeh/XkjI9pN?= =?us-ascii?Q?L0lqYvO65S8fe7ta2DK8Hv1WxiWLKiv1axVRtp5jbItDGfNQseeciOAzbIZf?= =?us-ascii?Q?ORi2TNHySUmOAYlOX8eyBDYOSQfdY+0pCtfE8mCjEYH6pf87O7mQ6Lw1lQRo?= =?us-ascii?Q?KDvuDU4/n6S4RukoEvUpsIo11bt1YcMiss2pB64V6TA33DchmX3oHk1Y/7Ee?= =?us-ascii?Q?3qaWd7xjLvS/7z/0bBXP9hs6dGhgffeyZO0R7jiMHqxKcrlRXMPLob7Dhl4o?= =?us-ascii?Q?pZqCxx7wpog1t6PsAMl3Jja4SNFGKrT8ktjgdRribSu2hn7HLxarkmjnVwIs?= =?us-ascii?Q?4j/1bcj7u2wjHXBvWoohIYpXt6wwaIyCZV222RY6oQTobj3BaY+b0eE92LpW?= =?us-ascii?Q?Veqac7I6DmwFlJSTOP56/DWaFGyTl8AaipG89BZwBs3JGJpbPR3YhQWT7RL7?= =?us-ascii?Q?eoZjDtaPuXp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M?= =?us-ascii?Q?jbg3Eowqr4lwA8CEBPUJrFBfRjiYElvKUAWlSfGaBcyLQVDdUokzfu8uOxA3?= =?us-ascii?Q?cpWbnEGbUpPDUqz7Q5ZuHpYtPQFB82J7/uwNIfb9lLc+UaiKTakgi1Qc2GCb?= =?us-ascii?Q?cVMLBA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f467e58-d4a6-4c1a-7d1a-08db52192c37 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 12:13:47.4910 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ah1p6q+vHjaItZyavnU2GDvr2GpCFcON7FgWlqdqCe6Wo+svmyMyM4V/QsmvyaatiwELzjJ4nHNRyQdtyVXX6qUEfc91ej1zS0oNXDNcgQU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR13MB6245 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 11, 2023 at 12:08:02AM +0200, Daniel Golle wrote: > Some of MediaTek's Filogic SoCs come with built-in gigabit Ethernet > PHYs which require calibration data from the SoC's efuse. > Despite the similar design the driver doesn't share any code with the > existing mediatek-ge.c, so add support for these PHYs by introducing a > new driver for only MediaTek's ARM64 SoCs. > > Signed-off-by: Daniel Golle Hi Daniel, some minor nits from my side. ... > diff --git a/drivers/net/phy/mediatek-ge-soc.c b/drivers/net/phy/mediatek-ge-soc.c ... > +#define MTK_PHY_RG_BG_RASEL 0x115 > +#define MTK_PHY_RG_BG_RASEL_MASK GENMASK(2, 0) > + > +/* These macro privides efuse parsing for internal phy. */ nit: s/privides/provides/ Please consider using checkpatch --codespell ... > +static int tx_amp_fill_result(struct phy_device *phydev, u16 *buf) > +{ > + int i; > + int bias[16] = {}; > + const int vals_9461[16] = { 7, 1, 4, 7, > + 7, 1, 4, 7, > + 7, 1, 4, 7, > + 7, 1, 4, 7 }; > + const int vals_9481[16] = { 10, 6, 6, 10, > + 10, 6, 6, 10, > + 10, 6, 6, 10, > + 10, 6, 6, 10 }; nits: Please put a blank line here. Please arrange local variables in networking code in reverse xmas tree order. Link: https://github.com/ecree-solarflare/xmastree > + switch (phydev->drv->phy_id) { > + case MTK_GPHY_ID_MT7981: > + /* We add some calibration to efuse values > + * due to board level influence. > + * GBE: +7, TBT: +1, HBT: +4, TST: +7 > + */ > + memcpy(bias, (const void *)vals_9461, sizeof(bias)); > + break; > + case MTK_GPHY_ID_MT7988: > + memcpy(bias, (const void *)vals_9481, sizeof(bias)); > + break; > + } ...