On Wed, Dec 2, 2009 at 04:13,  <[email protected]> wrote:
> Revision 7906 Author bhsong Date 2009-12-02 04:13:36 -0500 (Wed, 02 Dec
> 2009)
>
> Log Message
>
> task [#5723], Enable 128/256k/512k uncacheable DMA memory region for small
> memory system
>
> Modified: trunk/arch/blackfin/kernel/cplb-nompu/cplbinit.c (7905 => 7906)
>
> @@ -136,10 +146,22 @@
>       i_i = 0;
>       /* Normal RAM, including MTD FS.  */
>  #ifdef CONFIG_MTD_UCLINUX
> -     icplb_bounds[i_i].eaddr = memory_mtd_start + mtd_size;
> +     /*
> +      * While DMA uncache size is 128/256/512KB, we let icplb cover the whole
> 1MB from normal_memory_end & 0xfffff
> +      * A bad result is the 128/256/512KB becomes be able to fetch
> instrcutions. But in order to protect the area,
> +      * we have to manage the area by page size
> +      */
> +     if (unlikely((memory_mtd_start + mtd_size) & (1 * 1024 * 1024 - 1)))
> +             icplb_bounds[i_i].eaddr = ((memory_mtd_start + mtd_size) & ~(1 
> * 1024 *
> 1024 - 1)) + 1 * 1024 * 1024;
> +     else
> +             icplb_bounds[i_i].eaddr = memory_mtd_start + mtd_size;
>  #else
> -     icplb_bounds[i_i].eaddr = memory_end;
> +     if (unlikely(memory_end & (1 * 1024 * 1024 - 1)))
> +             icplb_bounds[i_i].eaddr = (memory_end & ~(1 * 1024 * 1024 - 1)) 
> + 1 *
> 1024 * 1024;
> +     else
> +             icplb_bounds[i_i].eaddr = memory_end;
>  #endif
> +
>       icplb_bounds[i_i++].data = SDRAM_IGENERIC;
>       /* DMA uncached region.  */
>       if (DMA_UNCACHED_REGION) {

while i can understand the need to change the DCPLB maps, why do we
need this for ICPLBs ?  the dma uncached region is reserved for data
usage ... we're never going to put instructions in there.
-mike
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to