This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Address Translation macros !!


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]