[U-Boot-Users] DCR register read/write for PPC440EP

Leonid Leonid at a-k-a.net
Thu Sep 28 18:58:36 CEST 2006


On Thursday 28 September 2006 5:55, Stefan wrote:
> I seems to be overwritten in the meantime. 
[Leonid] That what I was guessing... since when I get this register
immediately after setting and print it out, register's value looks OK.

> A look at the 440EP manual shows, 
> that DCR reg 0x20 is the CPR0_CLKUPD register, which is most likely 
> accessed each ms in the 440 timer interrupt (didn't check though).

[Leonid] This is not important for our subject, but I tried to work with
DCR register 0xE (not 0x20!) which is System DCS address register
SDR0_CFGADDR (not CPR0_CLKUPD) and offset 0x20 we see there corresponds
to SDR0_SDSTP0 (Serial Device Strap Register 0). Anyway you most likely
right - somebody access this Strap register frequently and set/get back
to back combination is required to read the registers with indirect
access via DCR.
 
> What you really need, is an U-Boot command to set/get SDR registers, 
> indirectly accessed via the DCR 0x0e/0x0f registers. Something 
> like "setsdr/getsdr". 

[Leonid] I thought rather of some generic function, allowing indirect
access to DCR-related registers since 0xE/0xF is not only combination of
address/data - for EBC they use 0x12/0x13 for instance. To that end, GET
command must receive 3 "address" arguments - DCR address register, DCR
data register and offset while SET will also need a value. Please advice
on command's name. Something like that I guess:

getidcr e f 0x40
setidcr e f 40 0xbadd

where "i" in the middle stays for "indirect". What do you think? 

Now regarding implementation. Simplest way is to call
set_dcr()/get_dcr() from C code but that actually doesn't ensure that
the register under consideration was not overwritten in between. I can
disable interrupts, do you think it's OK? This is debug monitor function
after all, nobody cares regarding performance here...

> It would be best, if you could supply a proper patch 
> with such additional commands.

[Leonid] It will be quite a honor for me to serve this community. Can
you refer me to proper link how I do proceed with patch submission:
review, help information, actual sources delivering, etc... 

Thanks.

Best regards,
Leonid.




More information about the U-Boot mailing list