Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1531890

Re: [RFC PATCH 1/2] net: macb: Add MDIO driver for accessing multiple PHY devices

Path csiph.com!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Harini Katakam <harinikatakamlinux@gmail.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 1/2] net: macb: Add MDIO driver for accessing multiple PHY devices
Date Tue, 29 Nov 2016 05:20:01 +0100
Message-ID <sII3D-3lf-5@gated-at.bofh.it> (permalink)
References <sIx8e-4rl-59@gated-at.bofh.it> <sIx8e-4rl-57@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GzFFJnTu5e4nl8X8pkEtUOp5eF9ayJTtz2qMGMkXYJU=; b=wnAIroL7bvRxbvAwSl3XhoTcdj0FfxV2yufA0YSZYlji1sxxDWcMT3ICX2MK2FP7wK X57V4SgGDuyI9ebLvTNS4AoEWVlvHnN6Tsk8h19ZQdy7dzQnOJw/yObqO9JOwlD2mxsx /xanZ9ib0uuQws2lwOli0dmGRpVnikOvqI9VqlPTEqP+L3Q0ebhNtiiQaQEhlBfqom48 MAcWPf/QM5fThHqydo9B2CYyMLg3EJXLarYea7S6xviYZI7EECoJX/bJIMLdAwhLpphU mE3DI7kMmt1hH0SB/11S7ofoY3rNuIvxyNmo3BOM40WbXY+QbsMfrWcfmcWvzVOSFWHy x8Kg==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GzFFJnTu5e4nl8X8pkEtUOp5eF9ayJTtz2qMGMkXYJU=; b=K2ZBOb/6jzf1Z9SNg77QiLujJTOmGGl/MZHtn6KCzV+EAhWfPKCgKMgzUh4+RCaHqN 01Npa9pmKZsgWg+khloWZmPuxKxG4reApr+DE74aj2X/ZApY/FlsH2vtiETt/XzvLK0a kvILtMVoGNnWxg2+jWpIXQ8z1eKJPG0Vdd7rHJ6OfssKOHzSzKGdc2tQVYEOX/rBqh+s xSqEb0FXCvT6TWDJ9ONX0GjaCUa1YahwSbVsMsyqqjt12R5kAu9bzDU19P5xY0I3GE2M 0R4F1JzlU5bpASCTIDzDu8TjlfuVazcVi0i4urruybdJjEg3J1dlhSeH4cZqMW+ejH2K Zg+A==
X-Gm-Message-State AKaTC01mwq5wdQEjytm9mbb5zd9uDtoKc0qvEWikPmSH9Gf6yu+ECefC5kk76TwpiBtJTGjUWDWEUlMGl1dNFw==
X-Received by 10.28.153.10 with SMTP id b10mr21183929wme.103.1480392696875; Mon, 28 Nov 2016 20:11:36 -0800 (PST)
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 50
Organization linux.* mail to news gateway
X-Original-Cc Harini Katakam <harini.katakam@xilinx.com>, Nicolas Ferre <nicolas.ferre@atmel.com>, davem@davemloft.net, Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>, Mark Rutland <mark.rutland@arm.com>, "ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>, Kumar Gala <galak@codeaurora.org>, Boris Brezillon <boris.brezillon@free-electrons.com>, alexandre.belloni@free-electrons.com, netdev@vger.kernel.org, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>, "michals@xilinx.com" <michals@xilinx.com>, Punnaiah Choudary Kalluri <punnaia@xilinx.com>
X-Original-Date Tue, 29 Nov 2016 09:41:36 +0530
X-Original-Message-ID <CAFcVECJ-wNwmuVWb4AAL19UQtrB70+S6W0X+jvdOzkrR0ggJBg@mail.gmail.com>
X-Original-References <1480326554-6041-1-git-send-email-harinik@xilinx.com> <20161128163356.GJ17704@lunn.ch>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1531890

Show key headers only | View raw


Hi Andrew,

On Mon, Nov 28, 2016 at 10:03 PM, Andrew Lunn <andrew@lunn.ch> wrote:
> On Mon, Nov 28, 2016 at 03:19:14PM +0530, Harini Katakam wrote:
>> This patch is to add support for the hardware with multiple ethernet
>> MAC controllers and a single MDIO bus connected to multiple PHY devices.
>> MDIO lines are connected to any one of the ethernet MAC controllers and
>> all the PHY devices will be accessed using the PHY maintenance interface
>> in that MAC controller. This handling along with PHY functionality is
>> moved to macb_mdio.c
>>
>> Signed-off-by: Punnaiah Choudary Kalluri <punnaia@xilinx.com>
>> Signed-off-by: Harini Katakam <harinik@xilinx.com>
>> ---
>>  drivers/net/ethernet/cadence/Makefile    |   2 +-
>>  drivers/net/ethernet/cadence/macb.c      | 169 +++-----------------
>>  drivers/net/ethernet/cadence/macb.h      |   2 +
>>  drivers/net/ethernet/cadence/macb_mdio.c | 266 +++++++++++++++++++++++++++++++
>>  4 files changed, 294 insertions(+), 145 deletions(-)
>>  create mode 100644 drivers/net/ethernet/cadence/macb_mdio.c
>>
<snip>
>> +     bus->irq = devm_kzalloc(&pdev->dev, sizeof(int) * PHY_MAX_ADDR,
>> +                             GFP_KERNEL);
>
> This looks wrong, or at least old. It used to be a pointer to an array,
> but it is now an actual array.

Sorry, this was a mistake.
I changed this after rebase, will update in next version.

>
>> +static const struct of_device_id macb_mdio_dt_ids[] = {
>> +     { .compatible = "cdns,macb-mdio" },
>> +
>> +};
>
>
> I've not looked hard enough to know, but can you keep backwards
> compatibility? Won't old device tree's assume the mdio bus is always
> present? Now you need an explicit node otherwise there will not be an
> mdio bus?

Yes, an explicit MDIO bus is required. But I'm not sure
how to maintain backward compatibility (without using this separate
macb_mdio) and have different MACs use the same MDIO bus
with separate PHYs.

Regards,
Harini

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [RFC PATCH 1/2] net: macb: Add MDIO driver for accessing  multiple PHY devices Andrew Lunn <andrew@lunn.ch> - 2016-11-28 17:40 +0100
  Re: [RFC PATCH 1/2] net: macb: Add MDIO driver for accessing multiple  PHY devices Harini Katakam <harinikatakamlinux@gmail.com> - 2016-11-29 05:20 +0100

csiph-web