Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1849447rbb; Tue, 27 Feb 2024 03:17:50 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWNt8UdF/Us+iUAovEgyGqCWjC4qeL24gbWLFdeI2L0IIZY7LIXlt/w60lMJP1O20IURRPTflAvhSlr112TpmEerk8lxBQ4ItUOx1MOuA== X-Google-Smtp-Source: AGHT+IGWxWp6aBEqwpuNv8dpeychzEhG96Um5THkhuTxDZ0swGe8H9KOK3oN7SZG/ncn4Ve1WjHX X-Received: by 2002:a17:902:ec8b:b0:1dc:11f:d946 with SMTP id x11-20020a170902ec8b00b001dc011fd946mr11450552plg.8.1709032670455; Tue, 27 Feb 2024 03:17:50 -0800 (PST) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id lv3-20020a1709032a8300b001dbf3786659si1257412plb.222.2024.02.27.03.17.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 03:17:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83087-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=r+VjwLIs; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-83087-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id F2472B283B8 for ; Tue, 27 Feb 2024 11:01:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C646F13956D; Tue, 27 Feb 2024 11:01:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="r+VjwLIs" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 297DC2A8C1; Tue, 27 Feb 2024 11:01:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709031696; cv=none; b=G9X9dsUfRi0YV8KMrqcAxcCufNsap/DGEVRh7EfH8rBoa1C7FUl+vPyJ608px502+xwUx2hvfMLj1htNSRauThfm2cTWHzdkXTV9V80r18AyIDkyP807ccdpq7KNLce4nBBc9s6f354m8Y/QoFNZZcZZc+fyZ2ORn+719aOYaqY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709031696; c=relaxed/simple; bh=ZTyUOOdI9D1cGi850Kq0719pmJ7x8j7pILQUq+KdEs0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NxRhjiqQ18YR/TRu5acbQ5ar3Ygig9Eg6so+JveEnT3DeVlcuiuKlFWq3ZwXBmbm3tZXZLZKy+pR2BJwCKTEmkgH9Mm1axOFeJ6PqG5IlLcw+UVDqFoUgHZelZDySsG6dN0rCZD3qS/iR5V3gYXAghkXYeRaEc7MIxEq4auSgdw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=r+VjwLIs; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+DaaHFV+R3CLw59EEXA62uKFGD7Wf52WpiZ2P8WI0uY=; b=r+VjwLIsY/7RMcdO/5MqVjxj66 bqMv285lAJ0GkQpN0DxrfTNOm94RquYl6/8BdSas6kacDXR7lmNPmhiAWqgZwjxwXSsDRFtdpkgTc ZuwHQE/EWwEX2o8KdRqD45D9x7oSVy5lelN9gBnvAJCZ2zYrKSodBZOLNrtqmfln4FFjrfPt2obnU YtWyepUT1BT5DaG4kVoIbBnl6TaWswn5lzKjlzZAwkyr+8d7ImMpbXY0KJ+/f0N/aQFqGmMtld9xT bUJ/0Li63j25PPkeLuvC6pFIhCWjUtYP/20Rx/p/MH33kd6SC/HsmodCvEzLtcIFSjeifVPzvhCLp eO9qw+DQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:48690) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1revD4-0007th-1A; Tue, 27 Feb 2024 11:01:18 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1revD2-0007LK-9g; Tue, 27 Feb 2024 11:01:16 +0000 Date: Tue, 27 Feb 2024 11:01:16 +0000 From: "Russell King (Oracle)" To: Bastien Curutchet Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Pavel Machek , Lee Jones , Richard Cochran , Andrew Lunn , Heiner Kallweit , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-leds@vger.kernel.org, Thomas Petazzoni , herve.codina@bootlin.com, maxime.chevallier@bootlin.com, christophercordahi@nanometrics.ca Subject: Re: [PATCH v2 6/6] net: phy: DP83640: Add fiber mode enabling/disabling from device tree Message-ID: References: <20240227093945.21525-1-bastien.curutchet@bootlin.com> <20240227093945.21525-7-bastien.curutchet@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240227093945.21525-7-bastien.curutchet@bootlin.com> Sender: Russell King (Oracle) On Tue, Feb 27, 2024 at 10:39:45AM +0100, Bastien Curutchet wrote: > @@ -1141,6 +1147,17 @@ static int dp83640_config_init(struct phy_device *phydev) > val = phy_read(phydev, PCFCR) & ~PCF_EN; > phy_write(phydev, PCFCR, val); > > + if (dp83640->fiber != FIBER_MODE_DEFAULT) { > + val = phy_read(phydev, PCSR) & ~FX_EN; > + if (dp83640->fiber == FIBER_MODE_ENABLE) > + val |= FX_EN; > + phy_write(phydev, PCSR, val); val = 0; if (dp83640->fiber == FIBER_MODE_ENABLE) val = FX_EN; phy_modify(phydev, PCSR, FX_EN, val); > + > + /* Write SOFT_RESET bit to ensure configuration */ > + val = phy_read(phydev, PHYCR2) | SOFT_RESET; > + phy_write(phydev, PHYCR2, val); phy_set_bits(phydev, PHYCR2, SOFT_RESET); .. > +#else > +static int dp83640_of_init(struct phy_device *phydev) > +{ > + dp83640->fiber = FIBER_MODE_DEFAULT; This hasn't been build tested - dp83640 won't exist here. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!