This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Address Translation macros !!
- From: Gary Thomas <gary at mlbassoc dot com>
- To: mohanlal jangir <mohanlaljangir at hotmail dot com>
- Cc: eCos Discussion <ecos-discuss at sources dot redhat dot com>
- Date: 26 Aug 2003 06:58:56 -0600
- Subject: Re: [ECOS] Address Translation macros !!
- Organization: MLB Associates
- References: <LAW11-OE33A5ISwoRRM0000213b@hotmail.com>
On Tue, 2003-08-26 at 06:32, mohanlal jangir wrote:
> I have question regarding address translation macros described in eCos
> documention file hal-architecture-characterization.html. I am little
> confused about CYGARC_UNCACHED_ADDRESS( ). Which addess is returned by this
> macro? Which memory is called uncached? And how it differs from
> CYGARC_PHYSICAL_ADDRESS( ) ?
>
You have to set up cached vs. uncached memory mappings yourself.
Not all platforms will need this - it depends on whether the caches
are always coherent (if there are multiple bus masters that can
modify memory which might be cached, do they all see changes made
by other masters without special code)
eCos likes to have main memory run cacheable for performance. However,
if there are other bus masters in the system, this can be cumbersome
as the cache is often not coherent. In this case, one way to handle
this is to map main memory into two virtual segments - one which can
be cached and one which is not. Then just make sure that all accesses
to that space are via the uncached address (if you mix & match, you're
sure to have trouble).
CYGARC_UNCACHED_ADDRESS(p) - returns a virtual address p' which
corresponds to the address p.
CYGARC_PHYSICAL_ADDRESS(p) - returns the physical address p' which
corresponds to the address p.
For example, I have an ARM system set up like this (the iPAQ):
SDRAM - Physical = 0xC0000000
Virtual cached = 0x00000000
Virtual uncached = 0xC0000000
note: the virtual uncached could just as well be 0xD0000000, it
all depends on the MMU mappings and does not have to correspond
at all to the physical address. The main instance where one might
need to know the physical address is if you need to give an address
to another bus master (peripheral). That bus master will need the
physical address as it does not share the memory mapping used by
the CPU.
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss