linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Joakim Tjernlund
	<joakim.tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
Cc: kumar.gala-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
	David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	"linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org Mingkai
	Hu" <Mingkai.hu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Subject: Re: [PATCH v2 3/6] mtd: m25p80: add support to parse the SPI flash's partitions
Date: Tue, 10 Aug 2010 12:27:11 -0600	[thread overview]
Message-ID: <AANLkTi=EpjPC8Hf6dM1att8Mjg5vmfQxs2=4aUTYTrUL@mail.gmail.com> (raw)
In-Reply-To: <OFF5EA512A.075E51C6-ONC125777B.005D9750-C125777B.005F8CAF-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>

On Tue, Aug 10, 2010 at 11:23 AM, Joakim Tjernlund
<joakim.tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org> wrote:
> glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org wrote on 2010/08/10 16:56:42:
>>
>> On Tue, Aug 10, 2010 at 2:29 AM, Joakim Tjernlund
>> <joakim.tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org> wrote:
>> >> On Tue, Aug 10, 2010 at 1:14 AM, David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> wrote:
>> >> >
>> >> >
>> >> > --- On Mon, 8/9/10, Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
>> >> >
>> >> >
>> >> >> > +       nr_parts =
>> >> >> of_mtd_parse_partitions(&spi->dev, np, &parts);
>> >> >
>> >> > Let's keep OF-specific logic out of drivers like
>> >> > this one ...  intended to work without OF.
>> >> >
>> >> > NAK on adding dependencies like OF to drivers
>> >> > and other infrastructure that starts generic.
>> >
>> > Agreed.
>> >
>> >>
>> >> The OF hooks compile to no-ops when CONFIG_OF is disabled.  I've been
>> >> very careful about that.
>> >
>> > OF should not be in the drivers, one should be able use some other method
>> > than OF.
>>
>> If a device is described in the device tree, then the code has to live
>> *somewhere* to translate the data from the device tree into a form the
>> driver can use.  If not the driver, then where should that code live?
>>
>> If it is in the machine support code, then that requires foreknowledge
>> about all the device specific data that needs to be translated out of
>> the device tree at device registration time, which also means that the
>> translation code cannot be a module and it nullifies some of the
>> advantages of the device tree.  Not to mention the fact that it is
>> just plain ugly!  :-)
>>
>> Some of it can go into the infrastructure code, but only for parsing
>> common properties like irqs, address ranges, and some common bindings
>> like registering spi and i2c bus child nodes as devices.  (This
>> *particular* case may fall into this category if add_mtd_device() was
>> able to call the OF partition parsing hook if a device node pointer
>> was present; which does make a certain amount of sense, but I defer to
>> dwmw2 in this case).  However, device-specific properties cannot be
>> parsed in the infrastructure code because the infrastructure has no
>> knowledge of device specific bits.
>
> I am no expert at this at all, but I can give you an example what I don't
> want. Look at spi_mpc8xxx.c, earlier it was possible to define your own
> CS functions and register them from board code. After OF:ication one can
> not and the current OF methods aren't expressive enough to do what I need.
> The spi subsystem has a general framework for dealing with SPI devices
> and I think OF should be built on top of the native methods, at the
> very least not disable those methods like spi_mpc8xxx.c does.

You're right and it's a problem.  There wasn't a good way to handle
this when powerpc first moved over to use OF.  I think we've got a
good solution now.  See the use of a bus notifier in
arch/powerpc/platforms/512x/pdm360ng.c in Linus' current tree.  Most
of the time that won't be needed, but when a platform specific
callback is required, this seems to be a clean solution.

g.

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 

  parent reply	other threads:[~2010-08-10 18:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-02  7:51 [PATCH v2 0/6] refactor spi_mpc8xxx.c and add eSPI controller support Mingkai Hu
     [not found] ` <1280735524-17547-1-git-send-email-Mingkai.hu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2010-08-02  7:51   ` [PATCH v2 1/6] spi/mpc8xxx: refactor the common code for SPI/eSPI controller Mingkai Hu
     [not found]     ` <1280735524-17547-2-git-send-email-Mingkai.hu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2010-08-02  7:52       ` [PATCH v2 2/6] eSPI: add eSPI controller support Mingkai Hu
     [not found]         ` <1280735524-17547-3-git-send-email-Mingkai.hu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2010-08-02  7:52           ` [PATCH v2 3/6] mtd: m25p80: add support to parse the SPI flash's partitions Mingkai Hu
     [not found]             ` <1280735524-17547-4-git-send-email-Mingkai.hu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2010-08-02  7:52               ` [PATCH v2 4/6] mtd: m25p80: add a read function to read page by page Mingkai Hu
     [not found]                 ` <1280735524-17547-5-git-send-email-Mingkai.hu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2010-08-02  7:52                   ` [PATCH v2 5/6] powerpc/of: add eSPI controller dts bindings Mingkai Hu
     [not found]                     ` <1280735524-17547-6-git-send-email-Mingkai.hu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2010-08-02  7:52                       ` [PATCH v2 6/6] DTS: add SPI flash(s25fl128p01) support on p4080ds and mpc8536ds board Mingkai Hu
     [not found]                         ` <1280735524-17547-7-git-send-email-Mingkai.hu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2010-08-10  7:10                           ` Grant Likely
     [not found]                             ` <AANLkTinzea7-k3Wd6EsAy+ipThHMhkpMF3pCP7g_6O6J-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-02  8:30                               ` Hu Mingkai-B21284
2010-08-10  7:00                   ` [PATCH v2 4/6] mtd: m25p80: add a read function to read page by page Grant Likely
2010-08-10 13:44                     ` [spi-devel-general] " David Brownell
2010-09-02  9:04                     ` Hu Mingkai-B21284
2010-08-10  6:56               ` [PATCH v2 3/6] mtd: m25p80: add support to parse the SPI flash's partitions Grant Likely
2010-08-10  7:14                 ` [spi-devel-general] " David Brownell
     [not found]                   ` <796604.30863.qm-g47maUHHHF9eqboJWQvT7/u2YVrzzGjVVpNB7YpNyf8@public.gmane.org>
2010-08-10  7:16                     ` Grant Likely
     [not found]                       ` <AANLkTi=FGf9gbWDkO4qs01Z+qkip+Zm11=Jc4wHu3G8b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-10  8:29                         ` Joakim Tjernlund
     [not found]                           ` <OF0D24DC16.E1FE65D2-ONC125777B.002E544A-C125777B.002EA7C2-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
2010-08-10 14:56                             ` Grant Likely
     [not found]                               ` <AANLkTinYYTj+dR6ckPoShHKZTUmENEA1O-DYP9mjnWrs-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-10 16:01                                 ` Anton Vorontsov
2010-09-02  8:57                                   ` [spi-devel-general] " Hu Mingkai-B21284
2010-08-10 17:23                                 ` Joakim Tjernlund
     [not found]                                   ` <OFF5EA512A.075E51C6-ONC125777B.005D9750-C125777B.005F8CAF-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
2010-08-10 18:27                                     ` Grant Likely [this message]
     [not found]                                       ` <AANLkTi=EpjPC8Hf6dM1att8Mjg5vmfQxs2=4aUTYTrUL-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-02  8:46                                         ` Hu Mingkai-B21284
2010-08-10  6:44           ` [PATCH v2 2/6] eSPI: add eSPI controller support Grant Likely
     [not found]             ` <AANLkTin3W4++cAFcksVBX3QxeV8QF3d5T2tGy_KbEkRs-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-02  8:28               ` Hu Mingkai-B21284
2010-08-10  6:40       ` [PATCH v2 1/6] spi/mpc8xxx: refactor the common code for SPI/eSPI controller Grant Likely
2010-09-02  8:27         ` Hu Mingkai-B21284

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='AANLkTi=EpjPC8Hf6dM1att8Mjg5vmfQxs2=4aUTYTrUL@mail.gmail.com' \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=Mingkai.hu-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=joakim.tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org \
    --cc=kumar.gala-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@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).