public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] flread: new command for reading indirect mapped flashes
Date: Sun, 5 Jul 2009 15:03:43 -0400	[thread overview]
Message-ID: <200907051503.44391.vapier@gentoo.org> (raw)
In-Reply-To: <20090705175513.599A4832E416@gemini.denx.de>

On Sunday 05 July 2009 13:55:13 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > They _would_ be useful if they could be used like in Linux, but this
> > > requires at least a memory controller setup that traps of accesses to
> > > certain address ranges - but we don't have virtual memory or the linke
> > > in U-Boot. At least not yet ;-)
> >
> > the mapping drivers dont have any direct dependency on the memory
> > controller in any way.  the input to the mapping driver is the mtd and
> > desired offset to access.  here you can do any crazy magic you want,
> > including but not limited to, memory controller tricks.  in the case of
> > gpio flashes, the gpio pins are taken from the address and the real
> > address is accessed.
>
> You are missing the point that we are talking about flash _memory_
> here, which is accessed using an address in the CPU's address space.
> If you  have N banks of flash _memory_, each of these banks must be
> assigned it's own, unique region in the CPU's address space.
>
> What you are talking about is not flash _memory_ but a flash based
> storage _device_.

i dont see much point in distinguishing the two, but i understand what you're 
going for now

> Memory is required to be directly adressable from  the  CPU;  if  you
> need to perform additional operations like toggeling GPIO pins to map
> the  required bank in, this probably needs memory controller support.
> At least I cannot think of another solution.

i dont really know what you mean.  in my gpio flash example, there is 
literally no other software or hardware changes necessary.  the fact that one 
or two address lines is handled by GPIOs makes no difference at all to the 
rest of the hardware.

> If you had an implementation that supported 4  MiB  of  flash  memory
> mapped  at  0x20000000, then this flash memory would be accessable by
> driving the address lines  to  any  address  in  the  0x20000000  ...
> 0x203FFFFF  range. The fact that you need a driver (MTD) even to read
> the device is a clear indication that it is not memory.

the lower two megs that are physically mapped are fully usable today without 
any changes.  in other words, if i configured the board to lie and treat it as 
a 2 meg CFI flash at 0x20000000, it'd work the same way as any other CFI flash 
device.  all the commands you refer to work fine.

> Please note that I do not say that support for such a configuration is
> not useful - it definitely _is_ useful. But then be honest to yourself
> and don't try to disguise this as memory - as suggested by you, it is
> a storage device, and I will not accept attempts to access storage
> devices of any kinds through a memory interface.

my purpose is clear -- to maximize device support with as little 
changes/overhead as possible and get merged into mainline.

> Please see the archive, we had similar discussions  several  times  a
> long  time  ago. Ulf can tell you a thing or two about it.

i'll try searching ... any keywords to look for ?

> For me one
> important decision criterion is whether I can do the same actions  in
> U-Boot  and in a JTAG debugger; in your case, running "md 0x201FFF80"
> in U-Boot and at the BDI3000's telnet prompt would NOT show the  very
> same  results,  which they have to if there is memory mapped at these
> addresses.

u-boot and jtag would always show the exact same results in this case.  they 
just may not do what you expect them.  i.e. if the GPIO line is high, then 
reading 0x20000000 - 0x20200000 will access the top half of the flash, not the 
bottom half.

> > the downside here is that anything between 0x20200000 and 0x20400000 is
> > not actually physically mapped to the flash device, but any flash related
> > command will think it is.  so it'd be a problem if you tried to hook up
> > two flashes
>
> Gotcha. This is not the characteristics of memory, but  a storage
> device. Use a storage device driver for such a setup.

i dont mind creating a dedicated command like "fl" that would act like "sf" in 
terms of reading/writing/erasing, but it still must be able to leverage the 
CFI code which means using the weak GPIO accessor functions.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090705/34ad569c/attachment-0001.pgp 

  reply	other threads:[~2009-07-05 19:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30 18:44 [U-Boot] [PATCH] flread: new command for reading indirect mapped flashes Mike Frysinger
2009-06-30 19:01 ` Mike Frysinger
2009-07-04 23:39 ` Wolfgang Denk
2009-07-05  3:07   ` Mike Frysinger
2009-07-05 15:15     ` Wolfgang Denk
2009-07-05 17:12       ` Mike Frysinger
2009-07-05 17:55         ` Wolfgang Denk
2009-07-05 19:03           ` Mike Frysinger [this message]
2009-07-05 20:34             ` Wolfgang Denk
2009-07-06  5:10               ` Stefan Roese
2009-07-06  5:59                 ` Mike Frysinger
2009-07-06  6:24                   ` Stefan Roese
2009-07-06  7:04                 ` Mike Frysinger
2009-07-06  7:25                   ` Stefan Roese
2009-07-06  8:37                     ` Mike Frysinger
2009-07-06  8:47                       ` Stefan Roese
2009-07-10 14:27                         ` Stefan Roese
2009-07-10 14:31                         ` Mike Frysinger
2009-07-06  6:42               ` Mike Frysinger
2009-07-06  8:03                 ` Wolfgang Denk

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=200907051503.44391.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /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