This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Dual Port RAM on MPC8xx
- From: Gary Thomas <gary at mlbassoc dot com>
- To: Will Wagner <will_wagner at carallon dot com>
- Cc: eCos Discussion <ecos-discuss at ecos dot sourceware dot org>
- Date: Wed, 20 Apr 2005 04:50:24 -0600
- Subject: Re: [ECOS] Dual Port RAM on MPC8xx
- Organization: MLB Associates
- References: <42663119.306@carallon.com>
On Wed, 2005-04-20 at 11:38 +0100, Will Wagner wrote:
> I'm trying to understand how the allocation of DPRAM is done in the
> function _mpc8xx_allocBd in cpm.c.
>
> Can someone explain why nextBD is initialised as:
>
> static short *nextBd = (short *)(CYGHWR_HAL_VSR_TABLE + 0x1F0);
>
> Presumably this is so that redboot and an application can cooperate when
> using the DPRAM? Why is this address chosen and when is it's contents
> ever initialised?
>
> Presumably it may not have been initialised as in _mpc8xx_allocBd there
> is this code:
>
> if ((bd < QUICC_BD_BASE) || (bd > QUICC_BD_END)) {
> // Most likely not set up - make a guess :-(
> bd = *nextBd = QUICC_BD_BASE+0x400;
> }
>
> I guess this is starting 0x400 into the DPRAM so that an apllication
> doesn't reuse any DPRAM used by redboot? Is this correct? I can find
> where redboot ever initialises this memory so I can't see how it works.
>
> Any help in understanding this is much appreciated.
Look about 10 lines below the "static short" line you quoted :-)
This value gets set when the CPM has been reset.
The point is to keep track [minimally] of what DPRAM is in use
and, yes, one wants applications to know and respect the allocations
that RedBoot has already made.
The choice was just an unused place in memory. This region of
memory already holds similar data that is shared between RedBoot
and applications.
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss