Beispiel #1
0
int MsApiChunkHeader_Init(void)
{
    U32 u32ChunkHeaderOffset = 0;
    int ret = -1;

    UBOOT_TRACE("IN\n");
    raw_io_config_push();
    ret = mboot_raw_io_Config();
    if(ret != 0)
    {
        UBOOT_ERROR("raw_io_config setting fail!\n");
        raw_io_config_pop();
        return ret;
    }

    if(get_raw_status()==E_RAW_DATA_IN_SPI)
    {
        if(IsHouseKeepingBootingMode()==FALSE){
             u32ChunkHeaderOffset = 0x30000;
        }
        else
        {
            #if(CONFIG_MSTAR_RT_PM_IN_SPI==1)
                u32ChunkHeaderOffset = 0x30000;
            #else
#if defined(CONFIG_PM_SIZE_KB_FORCED) && (0!=CONFIG_PM_SIZE_KB_FORCED)
                u32ChunkHeaderOffset = 0x10000+(CONFIG_PM_SIZE_KB_FORCED*0x400);
#else
                u32ChunkHeaderOffset = 0x20000;
#endif
            #endif
        }

        #if(ENABLE_MSTAR_PUMABOOT)
        u32ChunkHeaderOffset = u32ChunkHeaderOffset + CONFIG_PUMABOOT_SIZE;
        #endif
    }
    else
    {
         u32ChunkHeaderOffset = 0;
    }
    ret = raw_read((U32)gu32ChunkHeader,u32ChunkHeaderOffset,(CH_ITEM_LAST+1)*4);
    
    raw_io_config_pop();
 
    if(ret != 0)
    {
         UBOOT_ERROR("raw_read gu8ChunkHeader fail\n");
         return -1;
    }
    
    ChunkHeaderReady = TRUE; 
    UBOOT_TRACE("OK\n");
    return 0;    
}
Beispiel #2
0
int MsApiChunkHeader_Init(void)
{
    U32 u32ChunkHeaderOffset = 0;
    int ret = -1;

    UBOOT_TRACE("IN\n");
    raw_io_config_push();
    ret = mboot_raw_io_Config();
    if(ret != 0)
    {
        UBOOT_ERROR("raw_io_config setting fail!\n");
        raw_io_config_pop();
        return ret;
    }

    if(get_raw_status()==E_RAW_DATA_IN_SPI)
    {
        if(IsHouseKeepingBootingMode()==FALSE){
             u32ChunkHeaderOffset = 0x30000;
        }
        else
        {
            #if(ENABLE_MSTAR_STR_ENABLE==1 ||ENABLE_MSTAR_PM_SWIR==1 )
                u32ChunkHeaderOffset = 0x30000;
            #else
                u32ChunkHeaderOffset = 0x20000;
            #endif
        }
    }
    else
    {
         u32ChunkHeaderOffset = 0;
    }
    ret = raw_read((U32)gu32ChunkHeader,u32ChunkHeaderOffset,(CH_ITEM_LAST+1)*4);
    
    raw_io_config_pop();
 
    if(ret != 0)
    {
         UBOOT_ERROR("raw_read gu8ChunkHeader fail\n");
         return -1;
    }
    
    ChunkHeaderReady = TRUE; 
    UBOOT_TRACE("OK\n");
    return 0;    
}