This chip provides the shadow memory function. The memory space from 0x8000_0000 to
0xAFFF_FFFF is the shadow memory space for memory space from 0x0000_0000 to
0x2FFF_FFFF. The memory space from 0xBC00_0000 to 0xBC00_DFFF is the shadow memory
space for memory space from 0x3C00_0000 to 0x3C00_DFFF. If the DMA of On-Chip Controller
wants to access this 56 k-byte embedded SRAM, it’s necessary to use memory space from
0xBC00_0000 to 0xBC00_DFFF
影子内存的作用是什么?我看到LCD裸机实验里面,申请出来的内存特意把地址最高位置1, 那样就变成了影子内存的地址空间了, 为什么这么做呢, 有什么好处? 代码如下:
uint8_t* vpostGetFrameBuffer(void)
{
uint8_t* u8BufPtr;
uint8_t u32BytePerPixel;
if((curDisplayDev.u32DevWidth == 0) || (curDisplayDev.u32DevHeight == 0))
return NULL;
switch(curVADev.ucVASrcFormat) {
case VA_SRC_YUV422:
case VA_SRC_YCBCR422:
case VA_SRC_RGB565:
u32BytePerPixel = 2;
break;
case VA_SRC_RGB666:
case VA_SRC_RGB888:
u32BytePerPixel = 4;
break;
default:
u32BytePerPixel = 2;
}
u8BufPtr = (uint8_t *)malloc((curDisplayDev.u32DevWidth * curDisplayDev.u32DevHeight * u32BytePerPixel)+32);
u8BufPtr = (uint8_t *)shift_pointer((uint32_t)u8BufPtr, 32);
outpw(REG_LCM_VA_BADDR0, (uint32_t)((uint32_t)u8BufPtr | 0x80000000));
outpw(REG_LCM_VA_FBCTRL, inpw(REG_LCM_VA_FBCTRL) & ~(1<<30) & ~VPOSTB_DB_EN);
return (uint8_t *)((uint32_t)u8BufPtr | 0x80000000);
}
|