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;    
}
Beispiel #3
0
int do_draw_jpg (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
    U32 u32LogoAddr=0;
    U32 u32LogoSize=0;
    U32 JPD_InputADDR=0;
    U32 JPD_OUTADDR=0;
    char *PhotoPath=NULL;
    BltConfigParams stConfig;
    UBOOT_TRACE("IN\n");

    get_addr_from_mmap("E_MMAP_ID_JPD_READ", &JPD_InputADDR);
    get_addr_from_mmap("E_MMAP_ID_JPD_WRITE", &JPD_OUTADDR);

	if(JPD_InputADDR==0xFFFF || JPD_OUTADDR==0xFFFF)
	{
		UBOOT_ERROR("Get Mmap for JPD Fail Skip JPD Decode !!! \n");
		return -1;

	}
    if(argc < 6)
    {
#if (CONFIG_BINARY_RELEASE == 1)
    stConfig.u16DispX = DEFAULT_OSD_STRING_X;
    stConfig.u16DispY = DEFAULT_OSD_STRING_Y;
    stConfig.u16DispW = DEFAULT_OSD_LAYER_WIDTH;
    stConfig.u16DispH = DEFAULT_OSD_LAYER_HEIGHT; 
#else
        cmd_usage(cmdtp);
        return 1;
#endif
    }
    else
    {
        stConfig.u16DispX = simple_strtoul(argv[2], NULL, 10);
        stConfig.u16DispY = simple_strtoul(argv[3], NULL, 10);
        stConfig.u16DispW = simple_strtoul(argv[4], NULL, 10);
        stConfig.u16DispH = simple_strtoul(argv[5], NULL, 10);       
    }
    if(IsPanelReady()!=0)
    {
         UBOOT_ERROR("Panle is not ready\n");
        return -1;
    }


    UBOOT_DEBUG("u16DispX=0x%x,u16DispY=0x%x,u16DispW=0x%x,u16DispH=0x%x\n",stConfig.u16DispX,stConfig.u16DispY,stConfig.u16DispW,stConfig.u16DispH);

    if(strncmp(argv[1], "-fs", 3)==0) // jpd from filesystem
    {
        PhotoPath = argv[6];
        UBOOT_DEBUG("PhotoPath=%s\n",PhotoPath);
        u32LogoSize = LoadJpg2Dram(PhotoPath, JPD_InputADDR);
        UBOOT_DEBUG("u32LogoSize : 0x%x \n",u32LogoSize);
        if(u32LogoSize == 0)
        {
            UBOOT_ERROR("Fail: Load_Photo2Dram return size is 0 !!\n");
            return -1;
        }
    }
    else if(strncmp(argv[1], "-s", 2)==0)
    {
        mboot_raw_io_Config();
        u32LogoAddr= simple_strtoul(argv[6],NULL,16);
        u32LogoSize= simple_strtoul(argv[7],NULL,16);;
        raw_read(PA2NVA(JPD_InputADDR),u32LogoAddr,u32LogoSize);
    }
    else
    {
#if (CONFIG_BINARY_RELEASE == 1)
        PhotoPath = DEFAULT_OSD_BACKGROUND_PATH;
        UBOOT_DEBUG("PhotoPath=%s\n",PhotoPath);
        u32LogoSize = LoadJpg2Dram(PhotoPath,LOGO_JPG_DRAM_ADDR);
        UBOOT_DEBUG("u32LogoSize : 0x%x \n",u32LogoSize);
        if(u32LogoSize == 0)
        {
            UBOOT_ERROR("Fail: Load_Photo2Dram return size is 0 !!\n");
            return -1;
        }
#else
        cmd_usage(cmdtp);
        return -1;
#endif
    }    
    MsApi_JPD_Decode(JPD_InputADDR, u32LogoSize);
    draw_jpg(stConfig,JPD_OUTADDR);
    UBOOT_TRACE("OK\n");
    return 0;
}