您尚未登录。

楼主 #1 2020-07-20 15:35:31

BugActiveDaughter
会员
注册时间: 2017-10-17
已发帖子: 118
积分: 117.5

新唐NUC972 显示进度条,一直闪烁

开机进度条,一直闪烁,切换到图片就不会,液晶几个重要寄存器都配置各种数据,验证几次还是不行,这种一般会是哪里引起?

void lcd_ctrl_init(void *lcdbase)
{
	long  vid[4];

        writel((readl(REG_AHBIPRST) | (1 << 9)), REG_AHBIPRST);
        writel((readl(REG_AHBIPRST) & ~(1 << 9)), REG_AHBIPRST);

        // VPOST clk
        writel(readl(REG_HCLKEN) | 0x02000000, REG_HCLKEN); // LCD

        writel((readl(REG_CLKDIVCTL1) & ~0xffff) | 0xe18, REG_CLKDIVCTL1); // Set VPOST clock source from UCLKOUT

	//GPG6 (CLK), GPG7 (HSYNC)
        writel((readl(REG_MFP_GPG_L) & ~0xFF000000) | 0x22000000, REG_MFP_GPG_L); // LCD_CLK LCD_HSYNC
	//GPG8 (VSYNC), GPG9 (DEN) 
        writel((readl(REG_MFP_GPG_H) & ~0xFF) | 0x22, REG_MFP_GPG_H); // LCD_VSYNC LCD_DEN

        // GPIO
        writel(0x22222222, REG_MFP_GPA_L); // LCD_DATA0~7
        writel(0x22222222, REG_MFP_GPA_H); // LCD_DATA8~15
// @ysc        writel(0x22222222, REG_MFP_GPD_H); // LCD_DATA16~23

// { @ysc
		gpio_request(GPIO_PF11, "LCD_RESET");
		gpio_direction_output(GPIO_PF11, 1);
		mdelay(10);
		gpio_set_value(GPIO_PF11, 0);
		mdelay(10);
		gpio_set_value(GPIO_PF11, 1);
		mdelay(10);

		MPULCM_RegIndexWrite_16Bits( 0xD3 );
		vid[0] = MPULCM_RegRead_16Bits();
		vid[1] = MPULCM_RegRead_16Bits();
		vid[2] = MPULCM_RegRead_16Bits();
		vid[3] = MPULCM_RegRead_16Bits();
		printf("LCD Type : %x%x\n\r", vid[2], vid[3] );

		//ILI9341_Init();

		gpio_request(GPIO_PF12, "LCD_BK");//GPIO_PF12
// 		gpio_direction_output(GPIO_PF12, 1);
// } @ysc

	//LCD register    
        writel(vpost_cfg.devctl, REG_LCM_DEV_CTRL);  //(1<<31) | (1<<28) | (1<<24) | (7<<5)
        writel(0x00000000, REG_LCM_MPU_CMD);
        writel(0x80000001, REG_LCM_INT_CS);

        writel(0x012E0240, REG_LCM_CRTC_SIZE);  
        writel(0x011001E0, REG_LCM_CRTC_DEND);
        writel(0x01E501E1, REG_LCM_CRTC_HR);
        writel(0x021D021B, REG_LCM_CRTC_HSYNC);
	    writel(0x01240122, REG_LCM_CRTC_VR);
	/*
	writel(0x01230209, REG_LCM_CRTC_SIZE);  //0x01240209,
        writel(0x011001E0, REG_LCM_CRTC_DEND);
        writel(0x01EC01E7, REG_LCM_CRTC_HR);
        writel(0x01F101E7, REG_LCM_CRTC_HSYNC);
	writel(0x0122011A, REG_LCM_CRTC_VR);//0x0124011A,
	*/
        writel((unsigned int)lcdbase, REG_LCM_VA_BADDR0);

		//writel(readl(REG_LCM_VA_FBCTRL) &~0x7ff07ff | (240<<16) | 240,REG_LCM_VA_FBCTRL);
		//printf("%08x",readl(REG_LCM_VA_FBCTRL));
        writel(vpost_cfg.fbctrl, REG_LCM_VA_FBCTRL);
		printf("REG_LCM_VA_FBCTRL = %08x\n",readl(REG_LCM_VA_FBCTRL));
        writel(vpost_cfg.scale, REG_LCM_VA_SCALE);
        writel(0x000107FF, REG_LCM_VA_WIN);

        writel(vpost_cfg.dccs, REG_LCM_DCCS);  //enable vpost, rgb565

// {
// 	u32 addr = LCM_BASE;
// 	for(; addr < (LCM_BASE + 0x8C); addr += 4 ) {
// 		printf("LCD%x=%x\n", addr, readl(addr));
// 	}
// }
        return;
}

最近编辑记录 BugActiveDaughter (2020-07-20 15:36:00)

离线

楼主 #2 2020-07-20 15:36:11

BugActiveDaughter
会员
注册时间: 2017-10-17
已发帖子: 118
积分: 117.5

Re: 新唐NUC972 显示进度条,一直闪烁

writel(0x012E0240, REG_LCM_CRTC_SIZE);  
        writel(0x011001E0, REG_LCM_CRTC_DEND);
        writel(0x01E501E1, REG_LCM_CRTC_HR);
        writel(0x021D021B, REG_LCM_CRTC_HSYNC);
	    writel(0x01240122, REG_LCM_CRTC_VR);

主要是这几个寄存器

离线

楼主 #3 2020-07-20 15:36:52

BugActiveDaughter
会员
注册时间: 2017-10-17
已发帖子: 118
积分: 117.5

Re: 新唐NUC972 显示进度条,一直闪烁

弱弱问一下,谁有972 linux的液晶驱动文件,我参考一下

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn