linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: Dong Aisheng
	<aisheng.dong-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	"vinod.koul-VuQAYsv1563Yd54FQh9/CA@public.gmane.org"
	<vinod.koul-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	"s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org"
	<s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	"linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org"
	<rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	Guo Shawn-R65073 <r65073-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	"rdunlap-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org"
	<rdunlap-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org>,
	"kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org"
	<kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	"cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org"
	<cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>,
	"devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v1 1/5] ARM: imx28: add basic dt support
Date: Mon, 19 Mar 2012 15:06:01 +0000	[thread overview]
Message-ID: <20120319150601.B783A3E05A5@localhost> (raw)
In-Reply-To: <20326.55337.249575.289067-VjFSrY7JcPWvSplVBqRQBQ@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 3761 bytes --]

On Mon, 19 Mar 2012 07:54:33 +0100, Lothar Waßmann <LW-bxm8fMRDkQLDiMYJYoSAnRvVK+yQ3ZXh@public.gmane.org> wrote:
> Grant Likely writes:
> > On Fri, 16 Mar 2012 11:01:35 +0800, Dong Aisheng <aisheng.dong-KZfg59tc24xl57MIdRCFDg@public.gmane.org> 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";

> 
> > > > Currently I'm setting up the MAC address for our TX28 from the fuses
> > > > in the platform code passed via platform_data, but that will obviously
> > > > not work with DT.
> > > > 
> > > Non-dt can also use my proposal, then you only need to pass the fixed part of
> > > MAC via platfrom data, the left will be read by fec driver.
> > > 
> > > > The correct way would probably be to pass the MAC from the bootloader
> > > > via a DT blob. But that would require all bootloaders to be updated
> > > > first to support DTS. :(
> > > > 
> > > But uboot will face the same problem that can not define a valid MAC
> > > in dts, did i undertand correctly?
> > > 
> > > > An intermediate solution could be using OF_DEV_AUXDATA to pass a
> > > > platform_data struct that may contain a MAC address set up by the
> > > > platform code.
> > > > 
> > > Yes, it's a way but i'm afraid will not get accepted by dt people.
> > 
> > The problem remains; where does the platform code get the MAC address
> > from?  The kernel has to devise it from *somewhere* and the best place
> > for that should be in the MAC driver itself.
> > 
> The platform code knows how and where the MAC is stored on a specific
> platform. The driver has no business in knowing platform details like
> this. Thus only platform code (or the bootloader) can provide the MAC
> to the driver.

Okay, if so then it would be wise to have a reliable function for the
MAC driver to call to lookup it's address as determined by platform
code.  Alternately, the platform code can write the correct mac
address into the device tree node at init time (see
prom_update_property() and prom_add_property()).

BTW, prom_update_property() currently fails if the property doesn't
actually exist yet which isn't what we want I think.  Also, there are
only two users so it would be easy to change to make it add-or-update
instead of update-only.

> > I've got no problem with the idea of only specifying the OUI in the DT
> > and the driver extracting the remaining 3 bytes from the hardware.
> > 
> > In principle, that's the design intent for DT systems anyway; it
> > describes things which cannot be probed from the hardware, or tells
> > the OS how the data is encoded in the hardware.
> > 
> If all bootloaders were aware of DT this wouldn't be a problem,
> because they could place the correct MAC inside the DT blob right
> away.
> But in the mean time (AKA forever) we need some other solution.

You'll notice I haven't disputed that.

g.


[-- Attachment #2: Type: text/plain, Size: 192 bytes --]

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

  parent reply	other threads:[~2012-03-19 15:06 UTC|newest]

Thread overview: 65+ 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
     [not found]               ` <20120315105927.GE13022-Fb7DQEYuewWctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
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]                     ` <20120316030134.GA5161-Fb7DQEYuewWctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-03-18 18:47                       ` Grant Likely
2012-03-19  6:54                         ` Lothar Waßmann
     [not found]                           ` <20326.55337.249575.289067-VjFSrY7JcPWvSplVBqRQBQ@public.gmane.org>
2012-03-19 15:06                             ` Grant Likely [this message]
2012-03-19 16:49                               ` Lothar Waßmann
     [not found]                                 ` <20327.25470.723875.916422-VjFSrY7JcPWvSplVBqRQBQ@public.gmane.org>
2012-03-19 22:02                                   ` Grant Likely
2012-03-20 12:49                                     ` Dong Aisheng
2012-03-20 13:17                                       ` Lothar Waßmann
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
     [not found]       ` <20120314080939.GA1180-Fb7DQEYuewWctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
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=20120319150601.B783A3E05A5@localhost \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=aisheng.dong-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=r65073-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=rdunlap-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=vinod.koul-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    /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).