This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how to make part of c6x-linux uncacheable?

hello

we are using ethernet of evmc6678 under c6x-linux to get our system log with simple linux socket programming. but there is lots of problem.

first of all we can't use "write" or "send" command in uclinux-gcc for address out 256 MB that assigned to linux  -->

therefore we used part of that 256 MB as our log holder, but there was a cache coherency problem, because we used EDMA to write log into linux memory and apparently linux can't manage coherency in this mode. also we tried to make some Part of DDR3 uncacheable by use of MAR registers but linux prevent us from such an action -->

so as a work around, we put data out of 256 MB by use of EDMA and then tell linux to copy it inside himself , this way we won't have coherency problem and also "send" and "write" command won't return "Bad Address error" and we receive data at the other side without any problem. but copy process that is done by linux is to slow, it's very slow so we should find another solution, best option is to make some part of linux mem uncacheable which we don't know how.

we also tried some solution that recommended on blackfin(since both of these are uclinux), and it was usage of max_mem command on kernel command line which didn't work. and since uclinux is NOMMU system, none of mmap and mem_sync command works on it. is there any way to make some part of linux memory uncacheable?

  • Hasan

    I assume that you saw the following   http://linux-c6x.org/wiki/index.php/Linux-c6x_2.0_Release  

    I think that the syslink section is configured as non-cache and the LINUX section is cached. 

    Using the instructions in the link above you can add the MAR registers manipulation during BOOT before LINUX starts.

    I may continue looking into the code to see if more information is available

    Ran

  • Hi, Hasan,

    We've not tried it before and don't know what impact it may have. Please look at the code in linux-c6x/arch/c6x/boot/compressed/cache.c in which cache_control() configures MAR being CACHE_ENABLE or CACHE_DISABLE. It is called from decompress_kernel() in misc.c.

    Rex