Chinaunix首页 | 论坛 | 博客
  • 博客访问: 334253
  • 博文数量: 97
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 636
  • 用 户 组: 普通用户
  • 注册时间: 2014-10-12 22:41
文章分类

全部博文(97)

文章存档

2017年(8)

2015年(87)

2014年(2)

我的朋友

分类: 嵌入式

2015-04-16 00:40:55

1、修改工程目录下 src/inc/addrtab_cfg.inc  
2、XLDR中SDRAM的初始化
3、修改 image_cfg.h 中 image大小
4、在OEM_init中,增加如下:
    g_pOemGlobal->pfnEnumExtensionDRAM = OEMEnumExtensionDRAM;

该函数具体实现如下:
/*********************************************************************************************************
** Function name:           OEMEnumExtensionDRAM
**
** Descriptions:            系统内存分配,可以添加多片不连续的内存
**                          1、根据DSP的应用需求,将多余的DSP保留区内存添加到系统内存
                            2、添加另外增加的128MB内存到系统内存
                            注意:
                            1、使用OEMEnumExtensionDRAM函数,在初始化时付给g_pOemGlobal->pfnEnumExtensionDRAM即可
                            2、g_pOemGlobal->pfnEnumExtensionDRAM指针初始化过后,原来的OEMGetExtensionDRAM函数就无效了
** input parameters:       
** output parameters:      
** Returned value:          额外添加的内存片数
*********************************************************************************************************/
DWORD OEMEnumExtensionDRAM(PMEMORY_SECTION pMemSections,DWORD cMemSections)
{

    DWORD cSections = 0;

    RETAILMSG(0, (_T("OEMEnumExtensionDRAM \r\n")));

    if (cSections < cMemSections)
    {
        if(g_pBSPArgs->DSPCodeServer == 0){                             /*选择DSP编解码服务     */
            pMemSections[cSections].dwFlags = 0;
            pMemSections[cSections].dwStart = 0x85800000;
            pMemSections[cSections].dwLen = 0;
        } else if(g_pBSPArgs->DSPCodeServer == 1){                      /*选择DSPlink 服务     */
            pMemSections[cSections].dwFlags = 0;
            pMemSections[cSections].dwStart = 0x85800000;
            pMemSections[cSections].dwLen   = 0x01900000;               /*  15MB                */
        } else if(g_pBSPArgs->DSPCodeServer == 2){                      /*禁止DSP功能           */
            pMemSections[cSections].dwFlags = 0;
            pMemSections[cSections].dwStart = 0x85800000;
            pMemSections[cSections].dwLen   = 0x02800000;
        }
        cSections++;
    }

#ifdef BSP_SDRAM_256MB_ENABLE
    //添加另外128MB内存
    if (cSections < cMemSections) {
        pMemSections[cSections].dwFlags = 0;
        pMemSections[cSections].dwStart = 0x88000000;
        pMemSections[cSections].dwLen =   0x08000000;
        cSections++;
    }
#endif
    RETAILMSG(0, (_T("OEMEnumExtensionDRAM (cSections=%d)\r\n"), cSections));


    return cSections;
}




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