This is the mail archive of the ecos-discuss@sourceware.org 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: Need uncached memory for USB - Redboot IXP435


mukund jampala wrote:

>> Are the cache sizes set properly in the HAL configuration?
> I don't know if this what you are talking about.
> file: hal/arm/xscale/cores/current/include/hal_cache.h
> 
> #define HAL_DCACHE_SIZE                 0x8000 // Size of data cache in bytes

OK, looks fine.

Apropos, when exactly does your controller use data from the
cached region of the memory? Normally the control and status
registers shouldn't be cached and the processor-controlled
DMA data access should take care of the caches in any sane
processor. Is the controller doing DMA on its own?

>> Does anything change if you flush the whole cache and not
>> only the address/size region? Maybe the macros are flawed somehow.
> 
> Exactly, it does work if I flush the whole cache away with following code:
> file: hal/arm/xscale/ixp425/current/src/ixp425_misc.c
> #if 1
>    HAL_DISABLE_INTERRUPTS(oldints);
>    HAL_DCACHE_SYNC();
>    HAL_DCACHE_DISABLE();
>    HAL_DCACHE_SYNC();
>    HAL_DCACHE_INVALIDATE_ALL();
>    HAL_RESTORE_INTERRUPTS(oldints);
> #endif

This disables the cache alltogehter. Does the code work
if you add HAL_DCACHE_ENABLE (i.e. disable, sync
and enable again)?

On some hardware (I don't know xscale) there is also
a way to access the same memory region uncached - e.g.
the ARM processor I am using maps the same RAM from
0x20000000 and from 0x00000000 and the HAL enables
the cache only for the first one. This would be generally
the best way.

> I disabled all my printf in my code and HC which was halting does not
> hal anymore, whcih is a good sign. I have lots of printfs. if I enable
> low DEBUG mode with less printfs, it works fine.
> Is this a bus contention issue?

Well, diag_printf needs time. Sometimes a lot of time (1 ms
for 10 characters written at 115200). Generally, don't do it
in the middle of a transaction with the hardware.

> No ideans what the relation between this behaviou and caching??

It can of course cause another cache lines to be accessed etc.

-- 
                                    Stano

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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