[U-Boot] Need input: Use Virtual address in commands; add translation/physical

Jerry Van Baren gvb.uboot at gmail.com
Wed Nov 26 23:52:04 CET 2008


Hi Becky,

Becky Bruce wrote:
> Folks,
> 
> We're going to be seeing more platforms with larger physical addresses  
> (PA) than virtual addresses (VA) supported in u-boot, and this kind of  
> ruins the current assumption inherent in much of u-boot that VA ==  
> PA.  On ppc, we've begin implementing the ability to actually  
> translate VAs to PAs and vice-versa.  But this brings up the question  
> of, when I type an address on the command line, what exactly am I  
> specifying?  Is that a virtual address, or a physical address?
> 
> Wolfgang and I talked about this on IRC a bit earlier, and what we're  
> proposing is this:

[snip good discussion]

> - Initially, a xlat (or insert better name here) command-line command  
> will be added to give you a PA given a VA, and vice-versa.

How would xlat know which direction it is to translate?

Thoughts:
   vtop(virtual) returns physical
   ptov(physical) returns virtual
or (see below thought on 0v / 0p)
   xlat(0p1234) returns virtual
   xlat(0v1234) returns physical
   xlat(0x1234) returns physical (per convention from snipped discussion)

I'm not wild about xlat doing dual duty (I'm not wild about vtop/ptov 
either but like it a little better).  Shock but no awe.  :-/

Question: Do we need a translation function?

> - Going forward, commands will be extended to take either a VA or PA  
> at the command line, with the syntax for this TBD and per argument  
> (i.e. if a command takes multiple addresses, each one can be either a  
> va or pa, and they can be intermingled).  The default will remain VA  
> if no modifier is specified.

Thought:
   0v6789ABCD is a virtual address (the value is interpreted as hex)
   0p6789ABCD is a physical address

Of course "v" and "p" should be accepted in either case.

Kinda ugly, but fits into the 0x style conventions.

I haven't looked at the number parsing code to see how hard it would be 
to squeeze this into it.

> Note that unless your platform actually has enabled configs with VA !=  
> PA (which is just MPC8641D at the moment, as far as I know), things  
> will look exactly the same as they always have.
> 
> Comments? I'm looking for some consensus here before I spend my  
> weekend writing a whole bunch of code.

Stuff face, write code.  Does it get any better than that?  ;-)

> Cheers,
> Becky

Have a great Thanksgiving,
gvb


More information about the U-Boot mailing list