linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: Dong Aisheng <dongas86@gmail.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Dong Aisheng <aisheng.dong@freescale.com>,
	"vinod.koul\@linux.intel.com" <vinod.koul@linux.intel.com>,
	"s.hauer\@pengutronix.de" <s.hauer@pengutronix.de>,
	"linux-mmc\@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"rob.herring\@calxeda.com" <rob.herring@calxeda.com>,
	Guo Shawn-R65073 <r65073@freescale.com>,
	"rdunlap\@xenotime.net" <rdunlap@xenotime.net>,
	"kernel\@pengutronix.de" <kernel@pengutronix.de>,
	"cjb\@laptop.org" <cjb@laptop.org>,
	Dong Aisheng-B29396 <B29396@freescale.com>,
	"devicetree-discuss\@lists.ozlabs.org" 
	<devicetree-discuss@lists.ozlabs.org>,
	"linux-arm-kernel\@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v1 1/5] ARM: imx28: add basic dt support
Date: Tue, 20 Mar 2012 14:17:48 +0100	[thread overview]
Message-ID: <20328.33660.472382.117901@ipc1.ka-ro> (raw)
In-Reply-To: <CAA+hA=R8hLZMyRASRim28MNzX4jyE3nsaJ3DPzgxDtUmqtH62w@mail.gmail.com>

Hi,

Dong Aisheng writes:
> On Mon, Mar 19, 2012 at 3:02 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> > On Mon, 19 Mar 2012 17:49:02 +0100, Lothar Waßmann <LW@KARO-electronics.de> wrote:
> >> Hi,
> >>
> >> Grant Likely writes:
> >> > On Mon, 19 Mar 2012 07:54:33 +0100, Lothar Waßmann <LW@KARO-electronics.de> wrote:
> >> > > Grant Likely writes:
> >> > > > On Fri, 16 Mar 2012 11:01:35 +0800, Dong Aisheng <aisheng.dong@freescale.com> wrote:
> >> > > > > On Thu, Mar 15, 2012 at 07:22:04PM +0800, Lothar Waßmann wrote:
> >> > > > > > Dong Aisheng writes:
> >> > > > > > > On Thu, Mar 15, 2012 at 02:53:29PM +0800, Lothar Waßmann wrote:
> >> > > > > > Anyway there is no definite spec how the MAC address(es) are stored
> >> > > > > > in the fuse map. Thus reading the MAC from there is more or less
> >> > > > > > platform specific.
> >> > > > > >
> >> > > > > It's just provide one more option since there are customers storing the MAC
> >> > > > > in the fuse map.
> >> > > >
> >> > > > That should be straight forward to support; have a property that
> >> > > > specifies the method used for fetching/calculating the MAC.
> >> > > >
> >> > > Executable code stored inside a DT blob? ;)
> >> >
> >> > I know you're joking here, but I'm going to answer seriously
> >> > anyway... Absolutely not.  What I'm suggesting is a property that
> >> > specifies the method used to determine the mac address.  Something
> >> > like (off the top of my head):
> >> >
> >> >     local-mac-address = [01 02 03 00 00 00];
> >> >     local-mac-mask = [0xff 0xff 0xff 0 0 0];
> >> >     mac-encoding = "append-serial-number";
> >> >
> >> That still does not specify where the remaining part of the MAC is
> >> stored and how it should be retrieved.
> >
> > I'm suggesting that you define a string that means something specific;
> > that hopefully can be shared by multiple platforms.  For example,
> > "append-serial-number" might mean start with the values selected by
> > AND of local-mac-address and local-mac-mask, and OR in the board's
> > serial number.  You would need to define something that worked if this
> > was the solution you used.
> >
> I'm intend to Grant's this suggestion.
> This can be shared by all other imx platforms which stores mac address in
> fuse map and this is commonly used by customer.
> Then we do not need keep writing repeat code for different platforms
> via platform
> data.
> 
> For Lothar's question, we can add a property fuse_mac_offset to indicate
> read mac from fuse map and where to read it.
>
That's not really enough. The format (big-endian vs. little-endian)
may also differ. But it's not really necessary, if the solution with
prom_update_property() works, since then platform code has full
control over the MAC.

> For how many bytes to read, we can calculate it from the local-mac-mask.
> For example, local-mac-mask = [0xff 0xff 0xff 0 0 0], we can get the size
> as 3 bypes.
> 
> Then we have three properties:
> local-mac-address = [01 02 03 00 00 00];
> local-mac-mask = [0xff 0xff 0xff 0 0 0];
> fuse_mac_offset = <1>;
> 
> In fec driver, the final mac address can be got by:
> local-mac-address & local-mac-mask | (read_fuse(1) & 0xffffff)
> 
> Lathar,
> Do you think if this is ok?
>
No. IMO the FEC driver itself should not read any fuses.
Reading fuses is a SoC specific thing and the FEC driver should not
depend on the idiosyncrasies of some SoC wrt. anything else but the
implementation of the FEC itself.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

  reply	other threads:[~2012-03-20 13:18 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13  8:47 [PATCH v1 0/5] dt: add basic imx28 support Dong Aisheng
2012-03-13  8:47 ` [PATCH v1 1/5] ARM: imx28: add basic dt support Dong Aisheng
2012-03-13 14:35   ` Rob Herring
2012-03-13 14:59     ` Zach Sadecki
2012-03-13 17:28       ` Grant Likely
2012-03-14  5:38         ` Shawn Guo
2012-03-14  6:23     ` Dong Aisheng
2012-03-14  6:51       ` Marek Vasut
2012-03-14 13:05       ` Rob Herring
2012-03-15  2:57         ` Dong Aisheng
2012-03-13 17:23   ` Grant Likely
2012-03-14  5:41     ` Shawn Guo
2012-03-14  5:56       ` Marek Vasut
2012-03-14  6:30       ` Dong Aisheng
2012-03-14 12:45     ` Dong Aisheng
2012-03-14 14:16       ` s.hauer
2012-03-15  3:02         ` Dong Aisheng
2012-03-15  6:53           ` Lothar Waßmann
2012-03-15 10:59             ` Dong Aisheng
2012-03-15 11:22               ` Lothar Waßmann
2012-03-16  3:01                 ` Dong Aisheng
2012-03-16  7:48                   ` Lothar Waßmann
2012-03-16  8:22                     ` Dong Aisheng
     [not found]                   ` <20120318184749.BB15D3E07BF@localhost>
2012-03-19  6:54                     ` Lothar Waßmann
     [not found]                       ` <20120319150601.B783A3E05A5@localhost>
2012-03-19 16:49                         ` Lothar Waßmann
     [not found]                           ` <20120319220224.ABF5A3E0A04@localhost>
2012-03-20 12:49                             ` Dong Aisheng
2012-03-20 13:17                               ` Lothar Waßmann [this message]
2012-03-21 11:06                                 ` Dong Aisheng
2012-03-16  8:49                 ` Shawn Guo
2012-03-15 11:24               ` s.hauer
2012-03-16  3:05                 ` Dong Aisheng
2012-03-14 19:41   ` Sascha Hauer
2012-03-15  3:05     ` Dong Aisheng
2012-03-13  8:47 ` [PATCH v1 2/5] mmc: mxs-mmc: add dt probe support Dong Aisheng
2012-03-13 17:42   ` Grant Likely
2012-03-14  6:42     ` Dong Aisheng
2012-03-14  5:58   ` Marek Vasut
2012-03-14  6:55     ` Dong Aisheng
2012-03-14  7:09       ` Marek Vasut
2012-03-14  7:13         ` s.hauer
2012-03-14  7:26         ` Dong Aisheng
2012-03-14 11:17           ` Marek Vasut
2012-03-14  7:23   ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-14  8:09     ` Dong Aisheng
2012-03-14  8:52       ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-13  8:47 ` [PATCH v1 3/5] ARM: imx28evk: add mmc dt support Dong Aisheng
2012-03-13 14:39   ` Rob Herring
2012-03-13 16:52     ` Sascha Hauer
2012-03-13 17:45       ` Rob Herring
2012-03-14  7:30         ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-14  8:20           ` Dong Aisheng
2012-03-14  8:54             ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-14  7:28   ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-13  8:47 ` [PATCH v1 4/5] dma: mxs-dma: add dt probe support Dong Aisheng
2012-03-14  7:54   ` Huang Shijie
2012-03-14  8:23     ` Dong Aisheng
2012-03-13  8:47 ` [PATCH v1 5/5] ARM: mxs: add mxs dma dt support Dong Aisheng
2012-03-14  7:58   ` Huang Shijie
2012-03-14  8:30     ` Dong Aisheng
2012-03-14  8:43       ` Huang Shijie
2012-03-14  6:01 ` [PATCH v1 0/5] dt: add basic imx28 support Marek Vasut
2012-03-14  7:34   ` Dong Aisheng

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=20328.33660.472382.117901@ipc1.ka-ro \
    --to=lw@karo-electronics.de \
    --cc=B29396@freescale.com \
    --cc=aisheng.dong@freescale.com \
    --cc=cjb@laptop.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=dongas86@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=r65073@freescale.com \
    --cc=rdunlap@xenotime.net \
    --cc=rob.herring@calxeda.com \
    --cc=s.hauer@pengutronix.de \
    --cc=vinod.koul@linux.intel.com \
    /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).