From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753866AbcARHJr (ORCPT ); Mon, 18 Jan 2016 02:09:47 -0500 Received: from mail2.asahi-net.or.jp ([202.224.39.198]:54301 "EHLO mail2.asahi-net.or.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753800AbcARHJm (ORCPT ); Mon, 18 Jan 2016 02:09:42 -0500 Date: Mon, 18 Jan 2016 16:09:40 +0900 Message-ID: <87d1szmki3.wl-ysato@users.sourceforge.jp> From: Yoshinori Sato To: Andrew Lunn Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] ne: DeviceTree support. In-Reply-To: <20160116172226.GB9880@lunn.ch> References: <1452874786-21202-1-git-send-email-ysato@users.sourceforge.jp> <20160116172226.GB9880@lunn.ch> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/24.5 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > --- > > 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. > > > + > > +Example > > + > > + ne2000: ethernet@200000 { > > + compatible = "national,ne2000"; > > + reg = <0x200000 32>; > > + interrupts = <17 0>; > > + national,dcr = <0x48>; > > + }; > > + > > diff --git a/drivers/net/ethernet/8390/ne.c b/drivers/net/ethernet/8390/ne.c > > index c063b41..a9dde5b 100644 > > --- a/drivers/net/ethernet/8390/ne.c > > +++ b/drivers/net/ethernet/8390/ne.c > > @@ -52,6 +52,7 @@ static const char version2[] = > > #include > > #include > > #include > > +#include > > > > #include > > > > @@ -72,6 +73,7 @@ static int io[MAX_NE_CARDS]; > > static int irq[MAX_NE_CARDS]; > > static int bad[MAX_NE_CARDS]; > > static u32 ne_msg_enable; > > +static unsigned int of_dcr_val; > > 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. > > Andrew -- Yoshinori Sato