[U-Boot-Users] How does the stack works in the DCache?

Woodruff, Richard r-woodruff2 at ti.com
Mon May 17 06:13:08 CEST 2004


I'm not familiar with the port in question, but using the d-cache as
temporary memory when external memory is not yet available is a common
trick.  As long as you don't need more temporary memory then the size of
the cache then you can use the cache itself as a temporary store.  The
cache is probably set up as read/write allocate, to make sure what you
write stays in the cache.  Even if its just read allocate you could pre
allocate a range to make sure you get a hit when you attempt to access
that address.

Its likely the 4000000 maps to nothing yet, most any address will do,
just so long as its marked cacheable.  I seem to recall the ppc4xx
series had both block mapping ability (forget their names, ittr/dttr/
perhaps) and per page mapping available (mmu).

Regards,

Richard W.

> -----Original Message-----
> From: u-boot-users-admin at lists.sourceforge.net [mailto:u-boot-users-
> admin at lists.sourceforge.net] On Behalf Of Frank Young
> Sent: Sunday, May 16, 2004 10:38 PM
> To: u-boot-users at lists.sourceforge.net
> Subject: [U-Boot-Users] How does the stack works in the DCache?
> 
> Hello all,
> 
> I am using PPC 405 Walnut with 16M sdram. I got a question regarding
the
> DCache setting in u-boot cpu/ppc4xx/start.S. I wrote the pseudo-code
of
> start.S as below:
> 
> (In File cpu/ppc4xx/start.S)
> .globl _start
> _start:
> _start:
> 	clear and set up registers
> 	invalidate I and D caches
> 	Enable 128M cachable regions
> 	set up temporary stack in DCACHE
> 	sdram_init() (cpu/ppc4xx/sdram.c)
> 
> ..........
> 
> I understand the code is trying to set up a stack in DCache. But I
didn't
> get how the code makes it. Before calling sdram_init(), the stack
pointer
> is
> CFG_INIT_RAM_ADDR = 0x40000000. I suppose this address is not a
physical
> address and it refers to the address in the DCache. Is that right? But
the
> CFG_INIT_RAM_ADDR is located in the address space of sdram. So is
there
> any
> address translator in between DCache and CFG_INIT_RAM_ADDR? Or did I
miss
> anything? I just couldn't figure out how the stack works in DCache...
Can
> someone give me any clue? Thanks!
> 
> Frank
> 
> _________________________________________________________________
> Is your PC infected? Get a FREE online computer virus scan from
McAfee(r)
> Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: SourceForge.net Broadband
> Sign-up now for SourceForge Broadband and get the fastest
> 6.0/768 connection for only $19.95/mo for the first 3 months!
> http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users




More information about the U-Boot mailing list