修改在main.c中显示的函数。
1、要注意打开tv的电源。6410中tv输出的电源是独立的。
2、在init.c函数中有可能有设置tv的电源(一般是在oeminit函数中),如果有设置可以要做相应修改。由于在eboot阶段已经对电源有设置,可以去掉避免重复初始化。
3、这样修改需要添加一些lib依赖,可以在source中添加。
static void InitializeDisplay(void)
{
tDevInfo RGBDevInfo;
DWORD type;
volatile S3C6410_GPIO_REG *pGPIOReg = (S3C6410_GPIO_REG *)OALPAtoVA(S3C6410_BASE_REG_PA_GPIO, FALSE);
volatile S3C6410_DISPLAY_REG *pDispReg = (S3C6410_DISPLAY_REG *)OALPAtoVA(S3C6410_BASE_REG_PA_DISPLAY, FALSE);
volatile S3C6410_SPI_REG *pSPIReg = (S3C6410_SPI_REG *)OALPAtoVA(S3C6410_BASE_REG_PA_SPI0, FALSE);
volatile S3C6410_MSMIF_REG *pMSMIFReg = (S3C6410_MSMIF_REG *)OALPAtoVA(S3C6410_BASE_REG_PA_MSMIF_SFR, FALSE);
volatile S3C6410_SYSCON_REG *pSysConReg = (S3C6410_SYSCON_REG *)OALPAtoVA(S3C6410_BASE_REG_PA_SYSCON, FALSE);
//tv
volatile S3C6410_POST_REG *pPostReg = (S3C6410_POST_REG *)OALPAtoVA(S3C6410_BASE_REG_PA_POST, FALSE);
volatile S3C6410_ROTATOR_REG *pRotatorReg = (S3C6410_ROTATOR_REG *)OALPAtoVA(S3C6410_BASE_REG_PA_ROTATOR, FALSE);
volatile S3C6410_TVSC_REG *pTVSCReg = (S3C6410_TVSC_REG *)OALPAtoVA(S3C6410_BASE_REG_PA_TVSC, FALSE);
volatile S3C6410_TVENC_REG *pTVEncReg = (S3C6410_TVENC_REG *)OALPAtoVA(S3C6410_BASE_REG_PA_TVENC, FALSE);
EdbgOutputDebugString("[Eboot] ++InitializeDisplay()
");
// Initialize Display Power Gating
// if(!(pSysConReg->BLK_PWR_STAT & (1<<4))) {
// pSysConReg->NORMAL_CFG |= (1<<14);
// while(!(pSysConReg->BLK_PWR_STAT & (1<<4)));
// }
// Initialize tv Power Gating打开tv输出电源
if(!(pSysConReg->BLK_PWR_STAT & (1<<3))) {
pSysConReg->NORMAL_CFG |= (1<<13);
while(!(pSysConReg->BLK_PWR_STAT & (1<<3)));
}
// Initialize Virtual Address
LDI_initialize_register_address((void *)pSPIReg, (void *)pDispReg, (void *)pGPIOReg);
Disp_initialize_register_address((void *)pDispReg, (void *)pMSMIFReg, (void *)pGPIOReg);
//tv
Post_initialize_register_address((void *)pPostReg);
Rotator_initialize_register_address((void *)pRotatorReg);
TVSC_initialize_register_address((void *)pTVSCReg);
TVEnc_initialize_register_address((void *)pTVEncReg, (void *)pGPIOReg);
//add by kreal
//end kreal
// Get RGB Interface Information from LDI Library
LDI_fill_output_device_information(&RGBDevInfo);
// Setup Output Device Information
Disp_set_output_device_information(&RGBDevInfo);
// Initialize Display Controller
//Disp_initialize_output_interface(DISP_VIDOUT_RGBIF);
Disp_set_output_TV_information(720, 480);//初始化diaplay control要用到的一些变量(参数是将tv输出设置成720*480)
Disp_initialize_output_interface(1);//display control的初始化
TVSC_initialize(1, 1, 7, 720, 480, 720, 480, 0, 0, 7, 1440, 480, 1440, 480, 0, 0);//tv scaler的寄存器(参数是见tv输出设置成720*480的)
TVEnc_initialize(0, 0, 720, 480);//初始化tv encode的一些寄存器
TVEnc_output_onoff(1);
TVSC_enable_interrupt();
TVSC_processing_start();
Disp_set_window_mode(3, 5, 720, 480, 0, 0);//设置display的一些信息
//Disp_set_framebuffer(1, 0x56800000);
//Disp_window_onfoff(1, 1);
//Disp_set_frame_interrupt(3);
//Disp_enable_frame_interrupt();
lcd_high = 480;
lcd_width = 720;
#if (LCD_BPP == 16)
Disp_set_window_mode(DISP_WIN1_DMA, DISP_16BPP_565, lcd_width, lcd_high, 0, 0);
#elif (LCD_BPP == 32) // XRGB format (RGB888)
Disp_set_window_mode(DISP_WIN1_DMA, DISP_24BPP_888, lcd_width, lcd_high, 0, 0);
#else
EdbgOutputDebugString("[Eboot:ERR] InitializeDisplay() : Unknown Color Depth %d bpp
", LCD_BPP);
#endif
Disp_set_framebuffer(DISP_WIN1, EBOOT_FRAMEBUFFER_PA_START);
Disp_window_onfoff(DISP_WIN1, DISP_WINDOW_ON);
// Initialize LCD Module
//LDI_initialize_LCD_module();
// LCD Clock Source as MPLL_Dout
pSysConReg->CLK_SRC = (pSysConReg->CLK_SRC & ~(0xFFFFFFF0))
|(0<<31) // TV27_SEL -> 27MHz
|(0<<30) // DAC27 -> 27MHz
|(0<<28) // SCALER_SEL -> MOUT_EPLL
|(1<<26) // LCD_SEL -> Dout_MPLL
|(0<<24) // IRDA_SEL -> MOUT_EPLL
|(0<<22) // MMC2_SEL -> MOUT_EPLL
|(0<<20) // MMC1_SEL -> MOUT_EPLL
|(0<<18) // MMC0_SEL -> MOUT_EPLL
|(0<<16) // SPI1_SEL -> MOUT_EPLL
|(0<<14) // SPI0_SEL -> MOUT_EPLL
|(0<<13) // UART_SEL -> MOUT_EPLL
|(0<<10) // AUDIO1_SEL -> MOUT_EPLL
|(0<<7) // AUDIO0_SEL -> MOUT_EPLL
|(0<<5) // UHOST_SEL -> 48MHz
|(0<<4); // MFCCLK_SEL -> HCLKx2 (0:HCLKx2, 1:MoutEPLL)
// Video Output Enable
Disp_envid_onoff(DISP_ENVID_ON);
// Fill Framebuffer
#if (LCD_BPP == 16)
{
// //去掉图片显示
// unsigned int i;
// unsigned short *pFB,*plogo;
// pFB = (unsigned short *)EBOOT_FRAMEBUFFER_UA_START;
// plogo = (unsigned short *)Logo;
// for (i=0; i
// *pFB++ = 0x0000; //0x001F; // Blue
//int i;
//unsigned int *pFB;
// pFB = (unsigned int *)EBOOT_FRAMEBUFFER_UA_START;
//
// for (i=0; i
// *pFB++ = 0x00000055; // Blue
}
#elif (LCD_BPP == 32)
{
int i;
unsigned int *pFB;
pFB = (unsigned int *)EBOOT_FRAMEBUFFER_UA_START;
for (i=0; i
*pFB++ = 0x000000FF; // Blue
}
#endif
EdbgOutputDebugString("[Eboot] --InitializeDisplay()
");
}