public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] set up stack before board_init_f() on ppc440 core?
@ 2005-02-25 18:42 Shawn Jin
  2005-02-25 21:45 ` Wolfgang Denk
  0 siblings, 1 reply; 5+ messages in thread
From: Shawn Jin @ 2005-02-25 18:42 UTC (permalink / raw)
  To: u-boot

Hi,

Before board_init_f() is called, which is C code, a stack must be set
up. The stack is usually set up in internal SRAM. Where shall I put
stack in if I don't have an internal SRAM?

I read through cpu/ppc4xx/start.S and found some set up the temporary
stack in DCACHE (Walnut 405 is an example). But the CFG_INIT_RAM_ADDR
is 0x40000000, which is inside SDRAM. Why was it commented that the
stack was set in DCACHE? I don't quite understand how a cache acts
like RAM, i.e., a cache can be accessed by address xxxx_xxxx. Is a
cache only accessible by special cache instructions? The following
code is extracted from ppc4xx/start.S

#ifdef CFG_INIT_DCACHE_CS
	/*----------------------------------------------------------------------- */
	/* Memory Bank x (nothingness) initialization 1GB+64MEG */
	/* used as temporary stack pointer for stage0  */
	/*----------------------------------------------------------------------- */
	li	r4,PBxAP
	mtdcr	ebccfga,r4
	lis	r4,0x0380
	ori	r4,r4,0x0480
	mtdcr	ebccfgd,r4

	addi	r4,0,PBxCR
	mtdcr	ebccfga,r4
	lis	r4,0x400D
	ori	r4,r4,0xa000
	mtdcr	ebccfgd,r4

	/* turn on data chache for this region */
	lis	r4,0x0080
	mtdccr	r4

Thanks,
-Shawn.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-03-04  3:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-25 18:42 [U-Boot-Users] set up stack before board_init_f() on ppc440 core? Shawn Jin
2005-02-25 21:45 ` Wolfgang Denk
2005-02-25 22:56   ` Shawn Jin
2005-02-26 16:23     ` Grant Likely
2005-03-04  3:29       ` Shawn Jin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox