How to activate TLB mapping on m548x ?
Groleo Marius
groleo at gmail.com
Mon May 17 14:16:18 UTC 2010
Hi,
I'm trying to activate the TLB mapping in the m548x linux kernel with
the following patch
arch/m68k/coldfire/head.S
====================
/* ACR0 - System Registers
* 0xF000 0000 ACR_BA Base Address
* 0x000F 0000 ACR_ADMSK Address Mask
* 0x0000 8000 ACR_E Enable the ACR bits
* 0x0000 2000 ACR_S=1 Dont care accesses are supervisor-only
* 0x0000 0000 ACR_AMM Address mode mask
* 0x0000 0040 ACR_CM=2 Cache-inhibited, precise
* 0x0000 0008 ACR_SP Supervisor only
* -----------
* 0xF00F A048
*/
#define ACR0_DEFAULT #0xF00FA048 /* System Regs */
#define ACR1_DEFAULT #0x000FA028 /* SDRAM data chache copy-back */
#define ACR2_DEFAULT #0x00000000 /* Not mapped */
#define ACR3_DEFAULT #0x000FA028 /* SDRAM code cache copy-back */
just before activating the MMU, a TLB zone is created, using 1MB
pages, the maximum size
Coldfire can support.
/* create 8MB dma memory mirror TLB mapping */
mmu_map (CONFIG_DMA_BASE + 0*1024*1024), (CONFIG_SDRAM_BASE +
0*1024*1024), 0, 0, \
MMUTR_SG, MMUDR_SZ1M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, \
MMUDR_W, 0, MMUDR_LK, %d0
Q: Is it O.K. that the mmu_page is MMUDR_DNCP and the ACR is data
chache copy-back ?
include/asm-m68k/cf_pgalloc.h
=======================
-struct page *page = alloc_pages(GFP_DMA|__GFP_REPEAT, 0);
+struct page *page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0);
Q: Is it O.K. to replace GFP_DMA with GFP_KERNEL ? I think it's not since
the kernel will not allocate new PTE entries in the zone created in head.S.
I tried this instead:
+struct page *page = alloc_pages(GFP_DMA|GFP_KERNEL|__GFP_REPEAT, 0);
but the board hanged, and this made me think of a cache de-synchronization.
Can anyone please help ? Freescale doesn't show any willingness in
offering support.
Many thanks
--
Regards!
http://groleo.wordpress.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1257329293_cfV4e-enable-memory-cache.patch
Type: text/x-diff
Size: 13637 bytes
Desc: not available
URL: <http://sourcerytools.com/pipermail/coldfire-gnu-discuss/attachments/20100517/f57cf210/attachment.patch>
More information about the coldfire-gnu-discuss
mailing list