public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ulf Samuelsson <ulf@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Question about CFG_ENV_ADDR during RAMBOOT
Date: Mon, 28 May 2007 18:56:30 +0200	[thread overview]
Message-ID: <044f01c7a149$27416470$0302a8c0@atmel.com> (raw)
In-Reply-To: 1defaf580705280916p3b327312x52007a1ed94e1649@mail.gmail.com

> On 5/28/07, Ladislav Michl <ladis@linux-mips.org> wrote:
>> Principle described above has few serious drawbacks. Storage is no
>> longer storage, but randomly mapped memory. As a u-boot programer you
>> have to determine such memory map and as a u-boot user you have to
>> remember it.
> 
> Exactly. Giving storage devices which aren't memory mapped a "virtual"
> address is a bad idea. And the database example is crap because it
> depends on hardware paging, which isn't being proposed here (how many
> architectures supported by u-boot can do 64-bit virtual address in
> hardware?)
> 
> That said, I do think Ulf has a point -- being able to compare a block
> of data in nand- or dataflash with something in memory (or other kinds
> of storage) is a pretty neat feature. But it should not be done by
> using "virtual" addresses (due to the problems described above), and
> it should be implemented in a generic way. Pouring #ifdefs all over
> cmd_mem.c is short-sighted and selfish.

My proposal removes all #ifdefs from memory commands.

> I'm not sure if anyone's suggested this before, or whether it was
> well-received or not, but why don't we generalize the cmd_mem syntax a
> little? For example, let every memory address can be prefixed by an
> optional "storage specifier" and a ':' character. The default "storage
> specifier" is "mem", so that if it is omitted everything will work as
> before, but you can also do things like
> 
>  cp.b df0:0x4200 0x85000000
>  cmp.l 0x24000000 nand1.1:0x123456789
> 

Which is 100% compatible with my proposal.

"cp.b df0:0x4200 0x85000000  ${size}"

is decoded by the command parser and the "cp" command is selected.

"cp" sends "df0:0x4200" down the chain of registred memory/storage devices.
The NAND flash driver will not understand "df0" so it ignores the parameter.
The dataflash driver detects that this is a dataflash and decides it is a success
and returns a pointer to a descriptor allowing the "cp" command to read/write dataflash.

Then "cp" sends down the "0x85000000" parameter, and it is decided
that this is located in SDRAM.

"cp" then calls the dataflash specific copy to sdram routine 
(from the descriptor) using 0x85000000 and ${size} as parameters.

The dataflash copy routine will (in the AT91 case) just set
up the initial address and copy chunks of 64 kB using the 
DMA controller (PDC).

No need for any #ifdefs to handle this as far as I see.

> and so on. Whatever comes after ':' is passed to the storage handler
> as a string, so if some storage types need 64-bit offsets, the handler
> can support it without disturbing anything else.
> 
> What do you think about something like that? The actual syntax
> probably needs some work to get right, and we need to take care to
> ensure backwards compatibility of course.
> 
> This does actually come quite close to Ulf's proposal, but instead of
> requiring the user to remember a "virtual address", we instead require
> him to enter a logical device and an offset, ie.. kind of a simple VFS
> without any actual files involved...

I never said that you need to supply an address, you need
to supply a parameter, but the syntax of this can be driver specific.

> 
> Haavard
> 


Best Regards
Ulf Samuelsson

  reply	other threads:[~2007-05-28 16:56 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-26 10:53 [U-Boot-Users] Question about CFG_ENV_ADDR during RAMBOOT Ulf Samuelsson
2007-05-26 13:15 ` Wolfgang Denk
2007-05-28 11:37 ` Ladislav Michl
2007-05-28 14:08   ` Ulf Samuelsson
2007-05-28 15:39     ` Ladislav Michl
2007-05-28 16:16       ` Håvard Skinnemoen
2007-05-28 16:56         ` Ulf Samuelsson [this message]
2007-05-28 19:39           ` Ladislav Michl
2007-05-29  0:10             ` Wolfgang Denk
2007-05-29 22:13               ` Ulf Samuelsson
2007-05-29 22:46                 ` Wolfgang Denk
2007-05-29 23:15                   ` Ulf Samuelsson
2007-05-29 23:39                     ` Wolfgang Denk
2007-05-30  0:46                       ` Ulf Samuelsson
2007-05-30  6:57                         ` Wolfgang Denk
2007-05-30 10:52                           ` Ladislav Michl
2007-05-30 13:43                             ` Wolfgang Denk
2007-05-30 18:11                               ` Ulf Samuelsson
  -- strict thread matches above, loose matches on Subject: below --
2007-05-30 11:34 Ulf Samuelsson
2007-05-30 12:16 ` Ladislav Michl
2007-05-30 13:47 ` Wolfgang Denk
2007-05-30 18:23   ` Ulf Samuelsson
2007-05-30 23:19     ` Wolfgang Denk
2007-05-16 19:58 Timur Tabi
2007-05-22 20:36 ` Timur Tabi
2007-05-22 20:53   ` Jerry Van Baren
2007-05-22 21:04     ` Wolfgang Denk
2007-05-22 21:07       ` Timur Tabi
2007-05-23  0:15         ` Wolfgang Denk
2007-05-23 15:58           ` Timur Tabi
2007-05-22 21:26       ` Jerry Van Baren
2007-05-22 21:20     ` Andy Fleming
2007-05-22 21:22       ` Timur Tabi
2007-05-23  0:17         ` Wolfgang Denk
2007-05-23 14:56           ` Timur Tabi
2007-05-22 21:00   ` Wolfgang Denk
2007-05-22 21:30     ` Andy Fleming
2007-05-23 10:04     ` Ladislav Michl
2007-05-23 10:48       ` Ulf Samuelsson
2007-05-23 11:39         ` Ladislav Michl
2007-05-23 12:52           ` Ulf Samuelsson
2007-05-23 13:57             ` Wolfgang Denk
2007-05-23 16:19               ` Ulf Samuelsson
2007-05-24 12:10                 ` Ladislav Michl
2007-05-24 13:03                   ` Wolfgang Denk
2007-05-24 13:34                     ` Ladislav Michl
2007-05-24 19:08                   ` Ulf Samuelsson
2007-05-24 21:11                     ` Wolfgang Denk
2007-05-24 21:43                       ` Ulf Samuelsson
2007-05-24 23:46                         ` Wolfgang Denk
2007-05-25  5:37                         ` Stefan Roese
2007-05-25  8:50                           ` Ladislav Michl
2007-05-23 12:59           ` Ulf Samuelsson
2007-05-23 13:25             ` Ladislav Michl
2007-05-23 16:05               ` Ulf Samuelsson
2007-05-24 12:29                 ` Ladislav Michl
2007-05-24 18:34                   ` Ulf Samuelsson
2007-05-24 18:35                   ` Ulf Samuelsson
2007-05-23 12:59         ` Wolfgang Denk
2007-05-23 15:44           ` Ulf Samuelsson
2007-05-23 18:08             ` Wolfgang Denk
2007-05-24  9:14             ` Ladislav Michl
2007-05-25  9:06               ` Ladislav Michl

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='044f01c7a149$27416470$0302a8c0@atmel.com' \
    --to=ulf@atmel.com \
    --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