From: J. William Campbell <jwilliamcampbell@comcast.net>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Atmel DataFlash hooks.
Date: Sat, 27 Jan 2007 17:47:05 -0800 [thread overview]
Message-ID: <45BC0099.3070706@comcast.net> (raw)
In-Reply-To: <528646bc0701271419l8069e56nb06bb328cf85b8b7@mail.gmail.com>
Hello All,
Grant Likely wrote:
>On 1/26/07, Wolfgang Denk <wd@denx.de> wrote:
>
>
>>In message <528646bc0701261111i6f0dcb0i96f81259b3a4311d@mail.gmail.com> you wrote:
>>
>>
>>>My vote is to treat DataFlash like a block device, and make sure that
>>>it supports byte-wide access.
>>>
>>>
>>Treat DataFlash like a block device? That sounds wrong to me.
>>
>>
>
>I've been thinking about this some more, and I'm not sure I agree.
>
>
>Just for the moment; forget the term 'block device' and forget about
>the current implementation of u-boot. How significant are the
>difference between the following devices? mmc, CF, IDE HD, SCSI HD,
>DataFlash, memmapped flash, NAND flash, i2c eeprom, USB storage.
>
>
<snip>
>It's a well established abstraction, so why not here too?
>
>I think this is a reasonable approach to provide a common interface
>without making device specific side cases too complex to deal with.
>Adding new device support to all commands becomes pretty trivial this
>way.
>
>Thoughts? Feel free to tell me if I'm flying too high in the
>stratosphere on this one.
>g.
>
>
>
I think Grant has a good point. The discussion about abstractions used
to read/write devices and memory is
really a discussion about a memory hierarchy. If we treat it this way,
it is possible to optionally give everybody
what they want while still allowing a "minimal" u-boot configuration for
people who do not desire a particular
feature of the "storage hierarchy". Suppose we have an abstraction that
treats CF, IDE HD, DataFlash,
memmapped flash etc. as a device. We also have a set of commands that
read/write to these devices. There
will be a protect command that does nothing on devices that do not
understand this command. This way, it
is possible to read/write from any "device" to system ram. A driver to
treat system ram as a device could also
be compiled into u-boot.
As Grant discussed in an earlier part of this thread, we can also modify
the current memory commands such that
there is a table of what I will call "mmapped address". If the mmapped
support is enabled, all memory commands
will pass through a routine that splits them up into sub-commands that
operate on addresses in single parts of the
mmapped address table for both source and destination. This would
include breaking the commands into "sector-sized"
operations based on an entry for the sector size in the table.
Non-sectored devices can use all 1s for the sector size.
The memory commands now would consist of a seek/read from one "device"
followed by seek and read or write
from another device. If necessary, buffering would be provided by two
dedicated buffers in the memory command
subsystem.
This "mmapped" table already basically exists in the current memory
access system, with almost the right things in it.
Ram/Rom/Flash that has CPU memory bus addresses appears at the
"natural" addresses in this table that are
actually occupied by the "media". Unoccupied memory bus addresses are
assigned to media that does not actually
appear on the bus. This is presently done manually The memory commands
would then be executed by calling routines
from the mmapped table to do the reads and writes. These routines should
use the same I/O routines as are used for
device-mode access.
If the user wants to maintain the ability to operate with memory
commands on bus-addressed memory of any kind,
it is simple to initialize the mmapped address table appropriately.
u-boot can also add entries to this table at start-up
if some kind of flash is dynamically detected. This feature also
provides a natural way to extend this type of support
to any device that can read/write/seek. The user can either build-in
address ranges/device mappings at u-boot
compile time, they can be dynamically detected, and/or a console command
(mmap?) could be optionally added to do
dynamically. If the user does not want this type of support, it can be
completely omitted from the u-boot build and all
memory type commands will be executed using the CPU ram read/write
routines and addresses.
I think this approach gives everybody what they want. In cases where
"normal" ram and device access to a few devices
is all that is desired, u-boot would probably be slightly smaller than
it is now. If mmapped support is included, it might be very
slightly larger, but probably not by much. The mmapped table would
contain more information than it does at present,
but only a "few" more items per entry.
Comments welcome. I don't think this is really a big change from the
current system, it is just a formalization of what
has always been desired.
Best Regards,
Bill Campbell
next prev parent reply other threads:[~2007-01-28 1:47 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-26 16:45 [U-Boot-Users] Atmel DataFlash hooks Peter.Pearse
2007-01-26 19:11 ` Grant Likely
2007-01-26 21:25 ` Wolfgang Denk
2007-01-26 22:34 ` Grant Likely
2007-01-27 0:42 ` Wolfgang Denk
2007-01-27 1:52 ` Grant Likely
2007-01-27 4:11 ` [U-Boot-Users] Arm-linux-gcc malloc get failure while arm-elf-gcc ok Rui.Zhou at nokia.com
2007-01-27 11:46 ` Rui.Zhou at nokia.com
2007-01-27 13:34 ` [U-Boot-Users] Atmel DataFlash hooks Andreas Schweigstill
2007-01-27 16:36 ` Wolfgang Denk
2007-01-27 17:04 ` Andreas Schweigstill
2007-01-27 17:17 ` Ulf Samuelsson
2007-01-28 14:39 ` Wolfgang Denk
2007-01-29 1:32 ` Andreas Schweigstill
2007-01-29 12:52 ` Wolfgang Denk
2007-01-27 22:19 ` Grant Likely
2007-01-28 1:47 ` J. William Campbell [this message]
2007-01-28 15:17 ` Wolfgang Denk
2007-01-28 22:21 ` J. William Campbell
2007-01-28 22:50 ` Wolfgang Denk
2007-01-29 2:50 ` Grant Likely
2007-01-29 13:07 ` Wolfgang Denk
2007-01-29 21:06 ` Haavard Skinnemoen
2007-01-29 22:57 ` Ulf Samuelsson
2007-01-29 23:55 ` Wolfgang Denk
2007-01-30 0:28 ` Haavard Skinnemoen
2007-01-30 1:03 ` Wolfgang Denk
2007-01-30 1:16 ` Haavard Skinnemoen
2007-01-30 22:23 ` Wolfgang Denk
2007-01-30 6:52 ` Ulf Samuelsson
2007-01-31 7:44 ` Tolunay Orkun
2007-01-29 3:17 ` J. William Campbell
2007-01-29 7:35 ` Ulf Samuelsson
2007-01-29 13:36 ` Wolfgang Denk
2007-01-29 13:29 ` Wolfgang Denk
2007-01-29 20:45 ` J. William Campbell
2007-01-29 21:48 ` Wolfgang Denk
2007-01-29 23:03 ` J. William Campbell
2007-01-30 0:01 ` Wolfgang Denk
2007-01-29 23:08 ` Ulf Samuelsson
2007-01-30 0:48 ` J. William Campbell
2007-01-30 1:06 ` Wolfgang Denk
2007-01-30 6:55 ` Ulf Samuelsson
2007-01-31 17:11 ` Grant Likely
2007-01-31 17:37 ` Ulf Samuelsson
2007-01-31 21:55 ` Wolfgang Denk
2007-01-31 23:13 ` Ulf Samuelsson
2007-01-31 23:50 ` Grant Likely
2007-02-01 0:06 ` Wolfgang Denk
2007-02-01 2:46 ` Tolunay Orkun
2007-01-29 11:10 ` Stefan Roese
2007-01-29 2:27 ` Grant Likely
2007-01-28 15:01 ` Wolfgang Denk
2007-01-29 2:33 ` Grant Likely
2007-01-29 7:49 ` Ulf Samuelsson
2007-01-29 13:38 ` Wolfgang Denk
[not found] ` <528646bc0701310848x4c63cf53gd228f860c0fd0444@mail.gmail.com>
2007-01-31 16:50 ` Grant Likely
2007-02-01 12:40 ` Andreas Schweigstill
2007-01-29 12:56 ` Wolfgang Denk
2007-01-29 10:43 ` Stefan Roese
-- strict thread matches above, loose matches on Subject: below --
2007-01-26 8:44 Grant Likely
2007-01-26 9:42 ` Peter.Pearse
2007-01-26 13:53 ` Wolfgang Denk
2007-01-26 19:24 ` Grant Likely
2007-01-26 21:27 ` Wolfgang Denk
2007-01-26 22:35 ` Grant Likely
[not found] ` <000001c7416f$fa61fed0$01c4af0a@atmel.com>
2007-01-26 19:02 ` Grant Likely
[not found] ` <02eb01c74180$c4911410$01c4af0a@atmel.com>
2007-01-26 20:27 ` Grant Likely
2007-01-26 21:21 ` Ulf Samuelsson
2007-01-26 22:40 ` Grant Likely
2007-01-26 23:01 ` Ulf Samuelsson
2007-01-26 23:46 ` Grant Likely
2007-01-27 9:44 ` Ulf Samuelsson
2007-01-29 10:49 ` Stefan Roese
2007-01-29 13:44 ` Peter.Pearse
2007-01-29 14:47 ` Stefan Roese
2007-01-29 16:03 ` Wolfgang Denk
2007-01-29 10:33 ` Stefan Roese
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=45BC0099.3070706@comcast.net \
--to=jwilliamcampbell@comcast.net \
--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