From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 427FEC433EF for ; Tue, 4 Jan 2022 14:47:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YKkRCkTeKs+OMcKCDFf5ifUcK/SFMrfsOmgcowYKEqs=; b=XJJfyA2OP3wHoS ZAD6evAMqLOwJXshoFDIceP4lwOd9E73CplTa/aZfOZc4L3lHqF9WlCleuaMHKmVjxCMKAYCBaygb +da9bzc5+ssKGwDE8lP4xGT2Q/lzesAHq2tGppScchi2egadTQxEexncCBqqGrNLEZc2bnzVZ5S7O yHU/Ji/QAJedVApSv6CTbE25Dmp/PoYiSD+YubosgADFHvjz8x+eAJJFJNh5/R/3XmGXsLQPVxglp TfxkAm0uJXg3DOunKHc5jHR/m3iJ+7nvY9rNNE0fYsc4HTOEYeetPbfRygFCkWKEoykVBS7g29w84 cUyGU4DxA76TbFSg8G/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4l52-00Blqs-9Q; Tue, 04 Jan 2022 14:46:28 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4l4y-00BlqG-Tn for linux-arm-kernel@lists.infradead.org; Tue, 04 Jan 2022 14:46:26 +0000 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=Ud2jEnjGhrKvClBdA1a2WDyh6jHKcxWAWDDYyIRsGk0=; b=tQqzpviI6bB84IlZ0GaWEC7Sc+ URKX2jrs31pTvEouEzWKbnvJvWgmaEeHEWXOdsuVXhZ82O+Gjijch0fOp1JBwttwZd49SYT6onwDT EYok7dm9PHLBeD5J4liIOKv+Ce1nXQQ9TGAhMZbc1qntHqeok9AX35FoG+Qnb8OJ1/dI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1n4l4t-000TOh-5U; Tue, 04 Jan 2022 15:46:19 +0100 Date: Tue, 4 Jan 2022 15:46:19 +0100 From: Andrew Lunn To: "Russell King (Oracle)" Cc: Corentin Labbe , linus.walleij@linaro.org, ulli.kroll@googlemail.com, kuba@kernel.org, davem@davemloft.net, hkallweit1@gmail.com, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: net: phy: marvell: network working with generic PHY and not with marvell PHY Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220104_064624_988239_42C54464 X-CRM114-Status: UNSURE ( 9.79 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > @@ -1227,16 +1227,18 @@ static int m88e1118_config_init(struct phy_device *phydev) > { > int err; > > - /* Change address */ > - err = marvell_set_page(phydev, MII_MARVELL_MSCR_PAGE); > - if (err < 0) > - return err; > - > /* Enable 1000 Mbit */ > - err = phy_write(phydev, 0x15, 0x1070); > + err = phy_write_paged(phydev, MII_MARVELL_MSCR_PAGE, > + MII_88E1121_PHY_MSCR_REG, 0x1070); Ah, yes, keeping this makes it more backwards compatible. It would be nice to replace the 0x1070 with #defines. We already have: #define MII_88E1121_PHY_MSCR_RX_DELAY BIT(5) #define MII_88E1121_PHY_MSCR_TX_DELAY BIT(4) #define MII_88E1121_PHY_MSCR_DELAY_MASK (BIT(5) | BIT(4)) Bits 6 is the MSB of the default MAC speed. Bit 13 is the LSB of the default MAC speed. These two should default to 10b = 1000Mbps Bit 12 is reserved, and should be written 1. Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 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 74E57C433F5 for ; Tue, 4 Jan 2022 14:46:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234361AbiADOq1 (ORCPT ); Tue, 4 Jan 2022 09:46:27 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:50896 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231519AbiADOqY (ORCPT ); Tue, 4 Jan 2022 09:46:24 -0500 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=Ud2jEnjGhrKvClBdA1a2WDyh6jHKcxWAWDDYyIRsGk0=; b=tQqzpviI6bB84IlZ0GaWEC7Sc+ URKX2jrs31pTvEouEzWKbnvJvWgmaEeHEWXOdsuVXhZ82O+Gjijch0fOp1JBwttwZd49SYT6onwDT EYok7dm9PHLBeD5J4liIOKv+Ce1nXQQ9TGAhMZbc1qntHqeok9AX35FoG+Qnb8OJ1/dI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1n4l4t-000TOh-5U; Tue, 04 Jan 2022 15:46:19 +0100 Date: Tue, 4 Jan 2022 15:46:19 +0100 From: Andrew Lunn To: "Russell King (Oracle)" Cc: Corentin Labbe , linus.walleij@linaro.org, ulli.kroll@googlemail.com, kuba@kernel.org, davem@davemloft.net, hkallweit1@gmail.com, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: net: phy: marvell: network working with generic PHY and not with marvell PHY Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -1227,16 +1227,18 @@ static int m88e1118_config_init(struct phy_device *phydev) > { > int err; > > - /* Change address */ > - err = marvell_set_page(phydev, MII_MARVELL_MSCR_PAGE); > - if (err < 0) > - return err; > - > /* Enable 1000 Mbit */ > - err = phy_write(phydev, 0x15, 0x1070); > + err = phy_write_paged(phydev, MII_MARVELL_MSCR_PAGE, > + MII_88E1121_PHY_MSCR_REG, 0x1070); Ah, yes, keeping this makes it more backwards compatible. It would be nice to replace the 0x1070 with #defines. We already have: #define MII_88E1121_PHY_MSCR_RX_DELAY BIT(5) #define MII_88E1121_PHY_MSCR_TX_DELAY BIT(4) #define MII_88E1121_PHY_MSCR_DELAY_MASK (BIT(5) | BIT(4)) Bits 6 is the MSB of the default MAC speed. Bit 13 is the LSB of the default MAC speed. These two should default to 10b = 1000Mbps Bit 12 is reserved, and should be written 1. Andrew