mlt_sparc_leon_ram.h

来自「DVB软件,基于CT216软件的开发源程序.」· C头文件 代码 · 共 89 行

H
89
字号
// eCos memory layout - Fri Oct 20 08:18:20 2000

// This is a generated file - do not edit

#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>
#endif

#if 1   // Matt, get dram size from dram configure register.

#define DRAM_2x16MB    0x1f        // 11111: 32Mb, 1Mb x 16 x 2 (1x11x8 cascade)
#define DRAM_64MB      0x1e        // 11110: 64Mb, 4Mb x 16 (2x12x8 dram type)
#define DRAM_128MB     0x1d        // 11101: 128Mb, 8Mb x 16 (2x12x9 dram type)
#define DRAM_256MB     0x1c        // 11100: 256Mb, 16Mb x 16 (2x13x9 dram type)
#define DRAM_16MB      0x1b        // 11011: 16Mb, 1Mb x 16  (1x11x8 dram type)
#define DRAM_32Mb      0x1a        // 11010: 32Mb, 2Mb x 16 (1x12x8 dram type)

#define DRAM_64MB_D1   0x08        // 01000: 64Mb, Downgrade bank 0/1
#define DRAM_64MB_D2   0x09        // 01001: 64Mb, Downgrade bank 2/3
#define DRAM_64MB_D3   0x0a        // 01010: 64Mb, Downgrade bank 0/2
#define DRAM_64MB_D4   0x0b        // 01011: 64Mb, Downgrade bank 1/3
#define DRAM_64MB_D5   0x0c        // 01100: 64Mb, Downgrade bank 0/3
#define DRAM_64MB_D6   0x0d        // 01101: 64Mb, Downgrade bank 1/2

#define DRAM_128MB_D1  0x10        // 10000: 128Mb, Downgrade bank 0/1
#define DRAM_128MB_D2  0x11        // 10001: 128Mb, Downgrade bank 2/3
#define DRAM_128MB_D3  0x12        // 10010: 128Mb, Downgrade bank 0/2
#define DRAM_128MB_D4  0x13        // 10011: 128Mb, Downgrade bank 1/3
#define DRAM_128MB_D5  0x14        // 10100: 128Mb, Downgrade bank 0/3
#define DRAM_128MB_D6  0x15        // 10101: 128Mb, Downgrade bank 1/2

#define REG_PLAT_SYSTEM_CONFIGURATION1  (*(volatile unsigned int*)0x8000031c)

unsigned int _get_dram_size(void)
{
    unsigned int dram_type;
    unsigned int dram_size;
    
    dram_type = REG_PLAT_SYSTEM_CONFIGURATION1&0x1f;

    switch(dram_type)
    {
        case DRAM_16MB:
            dram_size = 0x200000;
            break;
        case DRAM_32Mb:
        case DRAM_2x16MB:
            dram_size = 0x400000;
            break;
        case DRAM_64MB:
        case DRAM_64MB_D1:
        case DRAM_64MB_D2:
        case DRAM_64MB_D3:
        case DRAM_64MB_D4:
        case DRAM_64MB_D5:
        case DRAM_64MB_D6:
            dram_size = 0x800000;
            break;
        case DRAM_128MB:
        case DRAM_128MB_D1:
        case DRAM_128MB_D2:
        case DRAM_128MB_D3:
        case DRAM_128MB_D4:
        case DRAM_128MB_D5:
        case DRAM_128MB_D6:
            dram_size = 0x1000000;
            break;
        case DRAM_256MB:
            dram_size = 0x2000000;
            break;
    }
    
    return dram_size;
}
#endif


#define CYGMEM_REGION_ram (0x40000000)
#define CYGMEM_REGION_ram_SIZE (_get_dram_size())
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__heap1) [];
#endif
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
#define CYGMEM_SECTION_heap1_SIZE ((CYGMEM_REGION_ram+CYGMEM_REGION_ram_SIZE) - (size_t) CYG_LABEL_NAME (__heap1))

#define CYGHWR_HAL_SPARC_MULTIPLE_VECTOR_TRAPPING

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?