From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 B44251DD527 for ; Mon, 28 Oct 2024 13:43:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730123010; cv=none; b=e8SYXsnAMhvdC6NwWDh9oN8yYA9s9DKzXzi2xPgn4yRGnXGgvmULi4k+SwE0Jsgv5jSHNYB5EVIVPdbIfBkLiLxm1LQVj37o0+mg57rJpmMYPLPIfZ2/kJo1jSquP8W4WVtUb9QIyDNRj6Wl+bCuAFRQ94y51v6jx+v2kwnWh/8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730123010; c=relaxed/simple; bh=XjkxwnG5qWOvNS8h3k0ZgKe8C6m+oboJq5TSRUggfhU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QUpd7G68gPzJDFPtPnh7GbXjKNe5pDeOP8ewKz4MW5fzFZ1OfZRTj3dAMQFTUQQhKjQGnzMxLvmq7bBquLyXTsL7VK/7Kt25t2T4/oL6jCROWbWCl8c/KxG+cvHdQPZFQLS23x0ow5Vb5G4XQJ/A6Kg/YHuvJK6HGsn4W2z554g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t5Q1V-0007ns-10; Mon, 28 Oct 2024 14:43:09 +0100 Received: from pty.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::c5]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1t5Q1T-000rZ5-1f; Mon, 28 Oct 2024 14:43:07 +0100 Received: from ore by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1t5Q1T-000lon-1I; Mon, 28 Oct 2024 14:43:07 +0100 Date: Mon, 28 Oct 2024 14:43:07 +0100 From: Oleksij Rempel To: Andrew Lunn Cc: "David S. Miller" , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , Woojung Huh , Arun Ramadoss , Conor Dooley , Krzysztof Kozlowski , Rob Herring , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com, "Russell King (Oracle)" , devicetree@vger.kernel.org Subject: Re: [PATCH net-next v1 5/5] net: dsa: microchip: add support for side MDIO interface in LAN937x Message-ID: References: <20241026063538.2506143-1-o.rempel@pengutronix.de> <20241026063538.2506143-6-o.rempel@pengutronix.de> <20c0ed0f-712d-46d4-8a49-e92835f47f9e@lunn.ch> 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=utf-8 Content-Disposition: inline In-Reply-To: <20c0ed0f-712d-46d4-8a49-e92835f47f9e@lunn.ch> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Mon, Oct 28, 2024 at 01:15:42PM +0100, Andrew Lunn wrote: > > +static const u8 lan9370_phy_addr[] = { > > + [0] = 2, /* Port 1, T1 AFE0 */ > > + [1] = 3, /* Port 2, T1 AFE1 */ > > + [2] = 5, /* Port 3, T1 AFE3 */ > > + [3] = 6, /* Port 4, T1 AFE4 */ > > + [4] = U8_MAX, /* Port 5, RGMII 2 */ > > +}; > > I think it would be good to add a #define for U8_MAX which gives a > hint at its meaning. ack > > + for (i = 0; i < dev->info->port_cnt; i++) { > > + if (phy_addr_map[i] == U8_MAX) > > + dev->phy_addr_map[i] = phy_addr_map[i]; > > + else > > + dev->phy_addr_map[i] = phy_addr_map[i] + offset; > > + } > > My first guess was that U8_MAX means the PHY is external, so could be > on any address depending on strapping. Looking at this code, i'm not > sure it does actually mean that. Yes, the U8_MAX for ports without integrated PHYs. This code calculates address for integrated PHYs, which can be different depending on strap configuration. I'll use some different define. -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |