netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] ne: DeviceTree support.
Date: Mon, 18 Jan 2016 16:08:34 +0100	[thread overview]
Message-ID: <20160118150834.GC923@lunn.ch> (raw)
In-Reply-To: <87d1szmki3.wl-ysato@users.sourceforge.jp>

On Mon, Jan 18, 2016 at 04:09:40PM +0900, Yoshinori Sato wrote:
> On Sun, 17 Jan 2016 02:22:26 +0900,
> Andrew Lunn wrote:
> > 
> > On Sat, Jan 16, 2016 at 01:19:45AM +0900, Yoshinori Sato wrote:
> > > Add basic device tree support.
> > > 
> > > Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> > > ---
> > >  Documentation/devicetree/bindings/net/ne2000.txt | 17 +++++++++++++++++
> > >  drivers/net/ethernet/8390/ne.c                   | 20 +++++++++++++++++++-
> > >  2 files changed, 36 insertions(+), 1 deletion(-)
> > >  create mode 100644 Documentation/devicetree/bindings/net/ne2000.txt
> > > 
> > > diff --git a/Documentation/devicetree/bindings/net/ne2000.txt b/Documentation/devicetree/bindings/net/ne2000.txt
> > > new file mode 100644
> > > index 0000000..8b0dfbf
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/net/ne2000.txt
> > > @@ -0,0 +1,17 @@
> > > +NE2000 compatible network controller
> > > +
> > > +Required properties:
> > > +- compatible: "national,ne2000"
> > > +- reg: base address and length of NE2000.
> > > +- interrupts: interrupt specifier for the sole interrupt.
> > > +- national,dcr: DCR setting value.
> > 
> > You say here that national,dcr is required, yet the code to read it is
> > not returning an error if it is missing.
> 
> Yes. This value required. Missing error check.
> 
> > Also, what is DCR?
> 
> This is chip configuration.
> It value depend on target design.

It needs to be described in detail what it is. Device tree bindings
generally don't list values to be poked into registers. They describe
something, and from that, the value to be poked into a register is
derived.

> > So there is a single DCR value, for all instances of the device?
> > The last device to probe wins?
> 
> Yes. It'll be usually the same value by all devices.

There is no 'usually' about it. You implementation forces them all to
be the same. You need to add error checking. If different DT instances
have different values, you need to issue an error and fail one or more
probes.

You also need to document this in the device tree binding.

	Andrew

  reply	other threads:[~2016-01-18 15:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15 16:19 [PATCH 1/2] ne: DeviceTree support Yoshinori Sato
2016-01-15 16:19 ` [PATCH 2/2] ne: Add h8300 support Yoshinori Sato
2016-01-16 17:22 ` [PATCH 1/2] ne: DeviceTree support Andrew Lunn
2016-01-18  7:09   ` Yoshinori Sato
2016-01-18 15:08     ` Andrew Lunn [this message]
2016-01-18 16:51       ` David Miller
2016-01-18 13:32 ` [PATCH v2 " Yoshinori Sato
2016-01-18 13:32   ` [PATCH v2 2/2] ne: Add h8300 support Yoshinori Sato
2016-01-18 16:51   ` [PATCH v2 1/2] ne: DeviceTree support David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160118150834.GC923@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).