Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8100748rwr; Wed, 10 May 2023 18:09:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7EezeGb/VwPWtEg9zmWxbtMFnK9cNEEWz9VMOzr2gQdtgXkIuY/lyxxLE+r0PPQOYV88Vw X-Received: by 2002:a17:903:22cd:b0:1aa:ee36:4095 with SMTP id y13-20020a17090322cd00b001aaee364095mr25287199plg.43.1683767396030; Wed, 10 May 2023 18:09:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683767396; cv=none; d=google.com; s=arc-20160816; b=wDph0LXVRbphQDymXqgip8NmyhKhFxecn7QYpIJ4ZR+xsVyp8Hrc7Bx7e5k8bqlpj4 u7KYrPtUYnst+ENKN8pKys5ktgDZKO/nILIWj4dNuTvGXR+zh1WIBRiEOPHT1sVF80+G UyT+wjjjEKu6QwMM/RtDAemJ1bcqSROaoll5KwBi0H56uW6NEfo1doVl94OK1rp4kjbz AlzhvOl5CH1Zb2iwpdHwor+Eh7n5SJNyO3Up78+phCYfKmoZPekp1LQjMrQEudx/HJJa 6fKzck3pAKOZOc2p/0GUsPhzcsQaPauC/JgpC9Togssx7VdW1Tdu6Via0FMK5xA2fFPg /icw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+BN583I8JA4xBDBDJJI1YSRZLOSYl2nhQFCQHGlsJAI=; b=EY6fSqsZYh9kDVRlHcyV3PqQSgA1+mUTBUzKuGK5qKNMc8sM/8Pz5e1+WZJ5HfwolN 6/8QZzuN5mwCCYfKrfSTEAC8yMRCchw7KxQBjqspXsLpWYQoelWjwjT5dHM27J4x5UbR 28USi7AfBub5SoIzoadWhAUQMd5J2yl5TWbmgVkpT4qTAk9AfBVWgwBttrTgK3KbVlWb VPMg+NUKS2/c9WY3fzHtv58VwU5Rw3zF6jApwgV54LuiBULQkifaOEyeGTOQts316Vue eqZIU8kBoTJXcrxZjBnB/5qFItaeY20O3Pt+JA2YwxSm0uLqe0srPb2ZYr2yzd5YmSFq D6kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=JZxiQgB1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w18-20020a170902a71200b001ac83d28c39si5000350plq.234.2023.05.10.18.09.41; Wed, 10 May 2023 18:09:56 -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=@lunn.ch header.s=20171124 header.b=JZxiQgB1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236731AbjEKAla (ORCPT + 99 others); Wed, 10 May 2023 20:41:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236618AbjEKAlU (ORCPT ); Wed, 10 May 2023 20:41:20 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A381A59E1; Wed, 10 May 2023 17:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=+BN583I8JA4xBDBDJJI1YSRZLOSYl2nhQFCQHGlsJAI=; b=JZxiQgB1wWSDGgPLYsTFeGKp7M VJUbiRuk9Y0L8mqpqggvAjEvMLn60zg+dr0DcvbXivxzjVz6Uz+FhbqLwyvGH0Ko0yyC+nj+W7xCV H9Kw4K7dDw8kpaB70FIQ/8sKWCgOa6OSByL6mFuM0ZcGc7em+7ceYprAZjRZ+EaWehPk=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pwuMl-00CUvb-3c; Thu, 11 May 2023 02:41:07 +0200 Date: Thu, 11 May 2023 02:41:07 +0200 From: Andrew Lunn To: Daniel Golle Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , AngeloGioacchino Del Regno Subject: Re: [PATCH 1/8] net: phy: realtek: rtl8221: allow to configure SERDES mode Message-ID: <81c3f04d-ec48-4ac0-ac16-b69dc6ae72e0@lunn.ch> References: <302d982c5550f10d589735fc2e46cf27386c39f4.1683756691.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <302d982c5550f10d589735fc2e46cf27386c39f4.1683756691.git.daniel@makrotopia.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 > +#define RTL8221B_MMD_SERDES_CTRL MDIO_MMD_VEND1 > +#define RTL8221B_MMD_PHY_CTRL MDIO_MMD_VEND2 I suggest you don't do this. Use MDIO_MMD_VEND[1|2] to make it clear these are vendor registers. > + case RTL8221B_SERDES_OPTION_MODE_2500BASEX_SGMII: > + case RTL8221B_SERDES_OPTION_MODE_2500BASEX: > + phy_write_mmd(phydev, RTL8221B_MMD_SERDES_CTRL, 0x6a04, 0x0503); > + phy_write_mmd(phydev, RTL8221B_MMD_SERDES_CTRL, 0x6f10, 0xd455); > + phy_write_mmd(phydev, RTL8221B_MMD_SERDES_CTRL, 0x6f11, 0x8020); > + break; > + case RTL8221B_SERDES_OPTION_MODE_HISGMII_SGMII: > + case RTL8221B_SERDES_OPTION_MODE_HISGMII: > + phy_write_mmd(phydev, RTL8221B_MMD_SERDES_CTRL, 0x6a04, 0x0503); > + phy_write_mmd(phydev, RTL8221B_MMD_SERDES_CTRL, 0x6f10, 0xd433); > + phy_write_mmd(phydev, RTL8221B_MMD_SERDES_CTRL, 0x6f11, 0x8020); > + break; > + } Is there anything in the datasheet to indicate register names and what the values mean? It would be good to replace these magic values with #defines. Andrew