⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hi_vouout.c

📁 华为 HI3510 BOOTLOADER HIBOOT 源码包
💻 C
字号:
#include <config.h>#if defined(CONFIG_HI3510_LOGO)#include "hi_common/hi.h"#include "hi_inc.h"#include "hi_video.h"#include "hi_i2c.h"#include "hi_vda.h"#include "hi_vou.h"#define Display_JPEG#define  vou_writew(addr,value)      ((*(volatile unsigned int *)(addr)) = (value))/* #define OSD_MEM 		0x64000000 */#ifdef Display_JPEG		extern UINT32 LoadJpegFile(void *pImg);	extern UINT32 ImgWidth, ImgHeight;#endif/*void * pData=NULL;*/#ifdef Display_BMP	#define OSD_STRIDE 		1408		#define OSD_WIDTH		704	#define OSD_HEIGHT		288#endif#if 0void initVOU(void){	VIDEO_RECT_t LayerRect; VIDEO_DATA_BASE=0x63000000;	VOU_Init();	VOU_SetOutputMode(VIDEO_OUTPUT_MODE_BT656, VIDEO_NORM_PAL, VOU_CONTROL_MODE_MASTER);	VOU_SetTvClip(		TRUE,		0x10,		0xf0,		0x10,		0xeb);	VOU_LayerDefaultSetting(VIDEO_VOU_LAYER_OVER2);	VOU_LayerSetDataType(		VIDEO_VOU_LAYER_OVER2,		PIXEL_FORMAT_RGB555 );	VOU_LayerSetAlpha(VIDEO_VOU_LAYER_OVER2, 0x80, 0x80);	LayerRect.x = 0;	LayerRect.y = 0;#ifdef Display_JPEG			LayerRect.w = ImgWidth;	LayerRect.h = ImgHeight;#endif#ifdef Display_BMP	LayerRect.w = OSD_WIDTH;	LayerRect.h = OSD_HEIGHT;#endif	VOU_LayerSetRect(VIDEO_VOU_LAYER_OVER2, LayerRect);	VOU_LayerEnable(VIDEO_VOU_LAYER_OVER2);#ifdef Display_JPEG		VOU_LayerSetAddrAndStride(			VIDEO_VOU_LAYER_OVER2,			(unsigned long)VIDEO_DATA_BASE,			0,			ImgWidth * 2,			0			);#endif#ifdef Display_BMP	VOU_LayerSetAddrAndStride(			VIDEO_VOU_LAYER_OVER2,			(unsigned long)VIDEO_DATA_BASE,			0,			OSD_STRIDE,			0			);	#endif		}#endifint Vou_OutImage(void){ 	int size;	int stride;		int loop;#if 0	 		unsigned long i;#define C1_DC		(1<<2)		/* dcache off/on */#define C1_IC		(1<<12)		/* icache off/on */		asm ("mrc p15, 0, %0, c1, c0, 0":"=r" (i));	/* i &= ~(C1_DC | C1_IC); */	/*i |= (C1_DC | C1_IC);*/	i |= (C1_IC);	asm ("mcr p15, 0, %0, c1, c0, 0": :"r" (i));	i = 0;	asm ("mcr p15, 0, %0, c7, c7, 0": :"r" (i));#endif		init_mmu(0x60000000, 0x60010000);	start_mmu();#ifdef  Display_BMP	HW_Bmp2Video((unsigned long)VIDEO_DATA_BASE, OSD_STRIDE); #endif#ifdef Display_JPEG		LoadJpegFile((void *)VIDEO_DATA_BASE);#endif	stop_mmu();	I2C_Init();	VDA_Init(VIDEO_MODE_CCIR656, VIDEO_NORM_PAL, VIDEO_MODE_SLAVER);	//printf("VIDEO_DATA_BASE = %x\n",VIDEO_DATA_BASE);	//printf("ImgWidth = %d\n",ImgWidth);	//printf("ImgHeight = %d\n",ImgHeight); 	#if 0 	VOU_Init();		 	VOU_Disable();	 	//memset((void *)VIDEO_DATA_BASE, 0, 0x100000);	 	/* fill your image here *//*	HW_Bmp2Video(VIDEO_DATA_BASE, OSD_STRIDE); */ 	/*	LoadJpegFile((void *)VIDEO_DATA_BASE);*/	 	initVOU();	 	VOU_Enable();#endif	//初始化系统寄存器	(*(volatile unsigned int *)0x101e001c) |=  0x00000028;	(*(volatile unsigned int *)0x101e0020) |=  0x0000002d;	//vou disable	(*(volatile unsigned int *)0x10120000) &=  0x7fffffff;	//	vou_writew(0x10120000,0x030388f0); 	//中断屏蔽 	vou_writew(0x10120004,0x00000000);	// 垂直同步寄存器1 	vou_writew(0x10120010,0x1501511f);	//垂直同步寄存器2 	vou_writew(0x10120014,0x1601811f); 	//水平同步寄存器 	vou_writew(0x10120018,0x41d7059f);  	 	//vou_writew(0x10120024,0x0023f2cf); 	//叠加图像2  大小 	size = (ImgHeight-1)&0xfff; 	size <<= 12; 	size |= (ImgWidth-1)&0xfff; 	vou_writew(0x10120024,size);       //vou_writew(0x1012001c,size);       //叠加图像2起始位置       vou_writew(0x10120058,0x00000000);	//背景颜色设置 	vou_writew(0x10120030,0x00808080);	//YUV clip 	vou_writew(0x10120034,0xeb10f010);	//图像1 a值 	vou_writew(0x10120060,0x00008080);	//图像2 a值 	vou_writew(0x10120064,0x00008080);	//叠加图像2 起始地址 	vou_writew(0x10120078,VIDEO_DATA_BASE); 	 	//vou_writew(0x10120084,0x05A00000); 	//stride  设置 	stride = (ImgWidth*2)<<16; 	vou_writew(0x10120084, stride);       //图像2使能 	(*(volatile unsigned int *)(0x10120000)) |= (0x10000000); 	//vou使能 	(*(volatile unsigned int *)(0x10120000)) |= (0x80000000);/*	for(loop=0; loop<1000; loop++)	{		udelay(100);	}*/	return 0;}const char hilogo_magic_str[] = "HISILICON LOGO MAGIC";unsigned char hilogo[64*1024];unsigned long VIDEO_DATA_BASE=0;static void *init_logo_data(const char *p_logo){	long logo_size=0;	long check=0;	char *s=NULL;	char *t=NULL;	long u=0;	s = getenv("vobuf");	if(s)		VIDEO_DATA_BASE = simple_strtol(s,NULL,0);	else	{		printf("LOGO disabled.\n");		return 0;	}	if(VIDEO_DATA_BASE == 0)	{		printf("Invalid VOU buffer address 0x%08X\n",VIDEO_DATA_BASE); 		return 0;	}      t = getenv("jpegpic");	if(t)		{		u=  simple_strtol(t,NULL,0);		memcpy(hilogo, u,(64*1024));           		return hilogo;	       }	else	{	if(strncmp(p_logo, hilogo_magic_str, strlen(hilogo_magic_str)))	{		printf("Invalid logo magic string.\n");		return 0;	}	p_logo += strlen(hilogo_magic_str);	logo_size = simple_strtol(p_logo, NULL, 0);	p_logo += 8;	check     = simple_strtol(p_logo+logo_size, NULL, 0);	if( logo_size!=check || strncmp(p_logo+logo_size+8, hilogo_magic_str, strlen(hilogo_magic_str)))	{		printf("Load logo failed, check error.\n");		return 0;	}	memcpy(hilogo, p_logo, logo_size);	return hilogo;		}}void show_hisilicon_logo(void * p_boot_end){     if(init_logo_data(p_boot_end))		Vou_OutImage();}#endif

⌨️ 快捷键说明

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