Chinaunix首页 | 论坛 | 博客
  • 博客访问: 955520
  • 博文数量: 116
  • 博客积分: 3923
  • 博客等级: 中校
  • 技术积分: 1337
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-23 01:22
文章分类

全部博文(116)

文章存档

2013年(1)

2012年(17)

2011年(69)

2009年(29)

分类: LINUX

2009-04-30 16:55:55

project     :  MMU Initial In ViVi
instruction :  (None)

--  _________________________________0x3400_0000 ( total: 64 M )
--  |  ViVi (1M)                |
--  |___________________________|____0x33F0_0000 ( ViViRAM_BASE)
--  |  Heap (1M)                |
--  |___________________________|____0x33E0_0000 ( Heap_BASE )
--  |  MMU Table (16K)          |
--  |___________________________|____0x33DF_C000 ( MMU_Table_BASE )
--  |  Priviate Data(16K x 3)   |
--  |___________________________|____0x33DF_0000 ( ViVi_Priv_RAM_BASE )
--  |  Stack (32K)              | 
--  |___________________________|____0x33DE_8000 ( STACK_BASE )
--  |                           |
--  |  61.90625 (M)             |
--  |                           |
--  |___________________________|____0x3000_0000 ( RAM_BASE )


MMU Table Initial Chart:

--  |___________________________|____0x33E0_0000 ( Heap_BASE )
--  |  MMU Table (16K)          |
--  |       ... ...             |
--  |       ... ...             |
--  |___________________________|____0x33DF_C368
--  | 64 | MMU_SECDESC          |
--  |___________________________|____0x33DF_C364
--  |63|MMU_SECDESC|MMU_CACHEABLE|
--  |___________________________|____0x33DF_C363
--  |        ... ...            |
--  |        ... ...            |
--  |___________________________|____0x33DF_C303
--  |1|MMU_SECDESC|MMU_CACHEABLE|
--  |___________________________|____0x33DF_C302
--  |0|MMU_SECDESC|MMU_CACHEABLE|
--  |___________________________|____0x33DF_C301
--  |        ... ...            |
--  |        ... ...            |
--  |___________________________|____0x33DF_C008
--  | 1 | MMU_SECDESC           |
--  |___________________________|____0x33DF_C004
--  | 0 | MMU_SECDESC           |
--  |___________________________|____0x33DF_C000 ( MMU_Table_BASE )

-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
code :
static inline void mem_mapping_linear(void)
{
    unsigned long pageoffset, sectionNumber;
    putstr_hex("MMU table base address = 0x", (unsigned long)mmu_tlb_base);
    for (sectionNumber = 0; sectionNumber < 4096; sectionNumber++) {
        pageoffset = (sectionNumber << 20);
        *(mmu_tlb_base + (pageoffset >> 20)) = pageoffset | MMU_SECDESC;
    }

    /* make dram cacheable */
    for (pageoffset = DRAM_BASE; pageoffset < (DRAM_BASE+DRAM_SIZE); pageoffset += SZ_1M) {
        //DPRINTK(3, "Make DRAM section cacheable: 0x%08lx\n", pageoffset);
        *(mmu_tlb_base + (pageoffset >> 20)) = pageoffset | MMU_SECDESC | MMU_CACHEABLE;
    }
}
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

阅读(1102) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~