Eboot modify the OK6410A (128M memory + 256MNand) support HDMI high-definition display

        Prior has been used OK6410A (256M memory + 2GNand) (WinCE6.0 system), bought a HDMI high-definition display, with Feiling to the technical data, in accordance with the given information on, after Eboot made changes, you can normally use HDMI high-definition displays. Recently in order to save dozens of pieces of RMB, the boss decided to replace the board to use 128M memory + 256MNand board, ready to get our hands on the HD section added to the list, but found Eboot not the same Yeah, the compiler error. He asked Feiling technology, people tell me they do not plan to use the information on the HDMI on this board. How to do it, only in accordance with previous data to try to solve their own. Fortunately, now resolved, let's look at how it is done.

      First, we should modify the function in main.c to support HDMI choice, because this is not the default option. Two main functions: BOOL MainMenu (PBOOT_CFG pBootCfg) and void InitializeDisplay (void) function.

In the following function in the MainMenu add LCD_VGA1024_RGB options for a switch-case, the

switch(pBootCfg->ConfigFlags&LCD_TYPE_MASK)
{
	case LCD_HUA350_RGB:
        	EdbgOutputDebugString ( "(320x240)\r\n");
		break;
	case LCD_HUA430_RGB:
        	EdbgOutputDebugString ( "(480x272)\r\n");
		break;
	case LCD_HUA560_RGB:
        	EdbgOutputDebugString ( "(640x480)\r\n");
		break;
	case LCD_QUN700_RGB:
        	EdbgOutputDebugString ( "(800x480)\r\n");
		break;
	case LCD_VGA800_RGB:
        	EdbgOutputDebugString ( "(800x600)\r\n");
		break;

	case LCD_VGA1024_RGB:
        	EdbgOutputDebugString ( "(1024x768)\r\n");
		break;

        default:
                EdbgOutputDebugString ( "(unknown)\r\n");
                break;
}


 Continue viewing function, when selecting 'S' that is arranged to select LCD, called SetLcd (pBootCfg) ;, at SetLcd (PBOOT_CFG pBootCfg) function, the following modifications 
 

static void SetLcd(PBOOT_CFG pBootCfg)
{
    USHORT InChar = 0;
	
    EdbgOutputDebugString("\r\n");
    EdbgOutputDebugString("0)3.5'LCD	320X240 \r\n");
    EdbgOutputDebugString("1)4.3'LCD	480X272 \r\n");
    EdbgOutputDebugString("2)5.6'LCD	640X480 \r\n");
    EdbgOutputDebugString("3)7.0'LCD	800X480 \r\n");
    EdbgOutputDebugString("4)VGA 		800X600 \r\n");
    EdbgOutputDebugString("5)HDMI		1024X768 \r\n");
	
    EdbgOutputDebugString("\r\nSelect Lcd Resolution [0-5]: ");
    while(!((InChar == 0x0d) || (InChar == 0x0a)))
    {
        InChar = OEMReadDebugByte();
        if (InChar != OEM_DEBUG_COM_ERROR && InChar != OEM_DEBUG_READ_NODATA)
        {
            // If it's a number or a period, add it to the string.
            //
            if ((InChar >= '0' && InChar <= '5'))
            {
            	OEMWriteDebugByte((BYTE)InChar);
            	pBootCfg->ConfigFlags&=~LCD_TYPE_MASK;
            	switch(InChar){
					case '0':
						pBootCfg->ConfigFlags|=LCD_HUA350_RGB;
						break;
					case '1':
						pBootCfg->ConfigFlags|=LCD_HUA430_RGB;
						break;
					case '2':
						pBootCfg->ConfigFlags|=LCD_HUA560_RGB;
						break;
					case '3':
						pBootCfg->ConfigFlags|=LCD_QUN700_RGB;
						break;
					case '4':
						pBootCfg->ConfigFlags|=LCD_VGA800_RGB;
						break;
					case '5':
						pBootCfg->ConfigFlags|=LCD_VGA1024_RGB;
						break;
					default:
						break;
            	}
				break;
            }
        }
    }

}

The following modified InitializeDisplay () function, in which selected mode LCD switch-case modified as follows:

switch(g_pBootCfg->ConfigFlags&LCD_TYPE_MASK){
		case LCD_HUA350_RGB:
			LcdType = LDI_HUA350_RGB;
			g_dwLcdWidth = 320;
			g_dwLcdHeight = 240;
			g_dwLcdBpp = 16;
			break;
		case LCD_HUA430_RGB:
			LcdType = LDI_HUA430_RGB;
			g_dwLcdWidth = 480;
			g_dwLcdHeight = 272;
			g_dwLcdBpp = 16;
			break;
		case LCD_HUA560_RGB:
			LcdType = LDI_HUA560_RGB;
			g_dwLcdWidth = 640;
			g_dwLcdHeight = 480;
			g_dwLcdBpp = 16;
			break;
		case LCD_QUN700_RGB:
			LcdType = LDI_QUN700_RGB;
			g_dwLcdWidth = 800;
			g_dwLcdHeight = 480;
			g_dwLcdBpp = 16;
			break;
		case LCD_VGA800_RGB:
			LcdType = LDI_VGA800_RGB;
			g_dwLcdWidth = 800;
			g_dwLcdHeight = 600;
			g_dwLcdBpp = 16;
			break;
		case LCD_VGA1024_RGB:
			LcdType = LDI_VGA1024_RGB;
			g_dwLcdWidth = 1024;
			g_dwLcdHeight = 768;
			g_dwLcdBpp = 16;
			break;
		default:
			LcdType = LDI_HUA350_RGB;
			g_dwLcdWidth = 320;
			g_dwLcdHeight = 240;
			g_dwLcdBpp = 16;
			break;
	}

        Here it is basically done to modify, has been selected to support the HDMI, but only support the selection, and can not truly HDMI high-definition display, taking into account a 7033.lib has not been used before in the information given in me than information on the current and main.c main.c EBOOT is found to call a function from 7033.lib of init_7033. Then follow the information in the following modifications main.c main function is to modify the InitializeVGA:

extern void init_7033(void);
//add by phantom
static void InitializeVGA(LDI_LCD_MODULE_TYPE LcdType)
{
	
    unsigned int  i;
	//EdbgOutputDebugString("[Eboot] ++InitializeVGA LcdType %d\r\n",LcdType);
    //IIC_Write   //CH7026 write address = 0xec
    if(LcdType==LDI_HUA560_RGB)	
    {
    	EdbgOutputDebugString("[Eboot] +++InitializeVGA 640X480()\r\n");
    	IIC_Open(2000);
		for (i = 0; i < CH7026_REG_NUM_VGA_640; i++) {
			
			if(!IIC_Write(0xEC, CH7026_REGS_VGA_640[i].subaddr, CH7026_REGS_VGA_640[i].value))
			{
				EdbgOutputDebugString("[Eboot] ---InitializeVGA ERROR!!!\r\n");
				IIC_Close();
				return;
			}
		}
		IIC_Write(0xEC,0x4,0x0);
		IIC_Close();
    	EdbgOutputDebugString("[Eboot] ---InitializeVGA 640X480()\r\n");
    }
	else if(LcdType==LDI_VGA800_RGB)
	{
    	EdbgOutputDebugString("[Eboot] +++InitializeVGA 800X600()\r\n");
		IIC_Open(2000);
		for (i = 0; i < CH7026_REG_NUM_VGA_800; i++) {
			if(!IIC_Write(0xEC, CH7026_REGS_VGA_800[i].subaddr, CH7026_REGS_VGA_800[i].value))
			{
				EdbgOutputDebugString("[Eboot] ---InitializeVGA ERROR!!!\r\n");
				IIC_Close();
				return;			
			}
		}
		IIC_Write(0xEC,0x4,0x0);
		IIC_Close();
    	EdbgOutputDebugString("[Eboot] ---InitializeVGA 800X600()\r\n");
	}
	else if(LcdType==LDI_VGA1024_RGB)
	{
		/* add by alexlee*/
		EdbgOutputDebugString("[Eboot] +++InitializeHDMI 1024X768()\r\n");
		init_7033();
		EdbgOutputDebugString("[Eboot] ---InitializeHDMI 1024X768()\r\n");
	}
	
}
         Then there will 7033.lib added to Eboot link options, are described in this profile, you can follow suit. After completing these tasks, not yet finalized, because the compiler error occurs at compile time Eboot, this is mainly because some of the functions in the library called 7033.lib, whereas these functions yet. Compared the information given usb.h, usb.c, ch7026.h, the file under the current Eboot been modified:

usb.h added:

BOOL IIC_Read(u8 cSlaveAddr,u8 cAddr,u8 *cData);

usb.c added:

void IIC_SetRead(  u8 cSlaveAddr,  u8 *pData, u32 uDataLen)
{
	u32 uTmp2;
	u32 uTmp3;
	
	uTmp2= Input32(rIICSTAT0);
	while(uTmp2&(1<<5))		//	Wait until IIC bus is free.
		uTmp2 = Input32(rIICSTAT0);			

	g_PcIIC_BUFFER	=	pData;
	g_uIIC_PT		=	0;
	g_uIIC_DATALEN	=	uDataLen;

	uTmp3 = Input32(rIICCON0);
	uTmp3 |= (1<<7);
	Outp32(rIICCON0,uTmp3);				//	Ack generation Enable
	Outp32(rIICDS0,cSlaveAddr);
	Outp32(rIICSTAT0,0xB0);				//	Master Rx Start.
}
BOOL IIC_Read(u8 cSlaveAddr,u8 cAddr,u8 *cData)
{
	IIC_SetWrite( cSlaveAddr, &cAddr, 1);			// following EEPROM random address access procedure
	IIC_SetRead( cSlaveAddr, cData, 1);
	IIC_Wait();								//	Waiting for read complete.
}

The ch7026.h copied directly overwrite the existing file ch7026.h, because the information in this document adds a CH7033_RegTable [] [2].

         Thus, to complete the modification work, then recompile, and then generate an image. After selecting the HDMI However, the system starts to intermediate stopped, and the printing DNW follows:

[Eboot] ++InitializeDisplay()

That in this place we can not continue the down. I find this statement, it is () function to print in InitializeDisplay, further search found the following cycle start interrupt cause:

        for (i=0; i<g_dwLcdWidth*g_dwLcdHeight; i++)
            *pFB++ = 0x0000;//0x001F;        // Blue
This cycle is in the initial LOGO in itself this cycle is no problem, I doubt whether it is due to the cross-border leading to it, looked under pFB pointer,

  unsigned short *pFB;
        pFB = (unsigned short *)EBOOT_FRAMEBUFFER_UA_START;
Further searching EBOOT_FRAMEBUFFER_UA_START, image_cfg.h defined as follows:

// Eboot Display Frame Buffer
// 2MB
#define EBOOT_FRAMEBUFFER_OFFSET        (0x07F00000) 
#define EBOOT_FRAMEBUFFER_PA_START      (DRAM_BASE_PA_START+EBOOT_FRAMEBUFFER_OFFSET)
#define EBOOT_FRAMEBUFFER_UA_START      (DRAM_BASE_UA_START+EBOOT_FRAMEBUFFER_OFFSET)
#define EBOOT_FRAMEBUFFER_SIZE          (0x00100000)
The value EBOOT_FRAMEBUFFER_OFFSET changed 0x07E00000.

      Recompiled again to generate images. At this point you can normally choose HDMI high-definition displays. All work completed, has not yet found anything unusual, but needs further study. . . .



 
 
 
Published 37 original articles · won praise 204 · views 440 000 +

Guess you like

Origin blog.csdn.net/zwgdft/article/details/7354893
Recommended