public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Lennert Buytenhek <buytenh@wantstofly.org>
To: Jared Hulbert <jaredeh@gmail.com>
Cc: linux-mtd@lists.infradead.org,
	David Woodhouse <dwmw2@infradead.org>,
	Nicolas Pitre <nico@cam.org>,
	Alexey Korolev <akorolev@infradead.org>
Subject: Re: [RFC/PATCH 8/8] LPDDR extended physmap driver to support LPDDR flash.
Date: Sat, 18 Oct 2008 17:46:44 +0200	[thread overview]
Message-ID: <20081018154644.GD4129@xi.wantstofly.org> (raw)
In-Reply-To: <6934efce0810171954g106c2cb8l3a8166c1f1769a76@mail.gmail.com>

On Fri, Oct 17, 2008 at 07:54:41PM -0700, Jared Hulbert wrote:

> On a x86 system you don't have to hack .c files for every "machine"
> out there.  We don't have to tweak a device-map .c file to use a SATA
> vs a SCSI vs an IDE drive.  Why do we put up with that for Flash?

You are confusing a bunch of orthogonal issues here.


There's a couple of mechanisms to describe/list peripherals in a
system:
1. The peripheral sits on the PCI or USB bus or another type of bus
   that supports autodetection or autoconfiguration.
2. The peripheral isn't autodetectable and is described in an ACPI
   table or in OF or a similar type of mechanism where the bootloader/
   firmware/BIOS/whatever-you-want-to-call-it provides a list of
   peripherals to the kernel so that the kernel can instantiate the
   right drivers.  (x86/ppc?)
3. The kernel has some kind of way of detecting which platform it is
   running on, and contains built-in tables that describe which
   non-autodetectable peripherals are present on a given platform.  (ARM)

ARM is not a platform that supports (2), and I guess the part of the
discussion is whether a flash bus is (1) or not.

I don't think there is enough info to do full reliable autodetection
of flash chips on any random platform, and then there are things like
platforms using partition tables that aren't stored on the flash chip
itself, so I don't think (1) holds and we're stuck with (3) in the
general case.  IOW, I think NOR chips fall in the same category as
AC97 codecs or I2C devices or SPI ROMs.


But (orthogonal to this), the discussion was about instantiating
platform devices in per-platform code versus using .config to describe
peripherals to the kernel.

Both of these methods to describe peripherals to the kernel fall into
category (3) above, and conceptually, using platform data or setting
.config are entirely the same thing.  But in practice, the platform
data approach has a bunch of advantages over the .config approach,
such as that with the platform data approach it's still possible to
build a single kernel image that supports booting on multiple different
boards (which is important e.g. for distributors), whereas with the
.config approach of configuring physmap you're forcing every board
type that you want to support with your kernel image to have a flash
chip at that address.

(In fact, there are no advantages of the .config method over the
platform data method, only disadvantages, which is why I still want
to kill the CONFIG_MTD_PHYSMAP_* options one day.)


What your argument _appears_ to be is that it's okay to use an
inferior method of configuring peripherals (.config) over a superior
method (instantiating platform devices from platform code) because we
should really be using an entirely different third method (autodetect
the device or pass the info in from the firmware) in the first place.
I don't really see how that conclusion follows.


> You can run the same zImage on PXA250/270/320 but if I dare move Flash
> around I have to recompile?

"You can run the same zImage on a Core 2 and an Opteron machine, but
if I take out my soldering iron and re-route my onboard network card's
PCI IRQ line to a different interrupt pin on my southbridge I have to
rebuild my ACPI table??" :-)

Anyway, doesn't changing your .config involve recompiling as well?

If what you are trying to say is that ARM should support a method
such as (2) above, I wouldn't immediately disagree.  But I don't see
what that has to do with platform data versus .config -- they are
conceptually the same thing.

  reply	other threads:[~2008-10-18 15:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-08 21:39 [RFC/PATCH 8/8] LPDDR extended physmap driver to support LPDDR flash Alexey Korolev
2008-10-14 10:20 ` David Woodhouse
2008-10-14 13:10   ` Alexey Korolev
2008-10-17  0:30   ` Jared Hulbert
2008-10-17  1:06     ` Lennert Buytenhek
2008-10-17 17:27       ` Jared Hulbert
2008-10-17 17:43         ` Alexey Korolev
2008-10-17 17:58           ` Jared Hulbert
2008-10-17 17:59             ` David Woodhouse
2008-10-17 18:03               ` Jared Hulbert
2008-10-17 18:06             ` Lennert Buytenhek
2008-10-17 18:12             ` Nicolas Pitre
2008-10-18  2:54               ` Jared Hulbert
2008-10-18 15:46                 ` Lennert Buytenhek [this message]
2008-10-18 18:20                   ` Jared Hulbert
2008-10-18 19:59                     ` Nicolas Pitre
2008-10-19  0:47                       ` Jared Hulbert
2008-10-19  1:38                         ` Nicolas Pitre
2008-10-17 18:01         ` Lennert Buytenhek

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=20081018154644.GD4129@xi.wantstofly.org \
    --to=buytenh@wantstofly.org \
    --cc=akorolev@infradead.org \
    --cc=dwmw2@infradead.org \
    --cc=jaredeh@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=nico@cam.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