四.调试LT9211输出 MIPI数据
(1)insmod加载ko文件后,ls /dev 查看是否生成新的video节点。
->如果没有生成video节点,查看ko是否加载失败,dts配置是否正确。
(2)查看设备是否成功挂载在IIC上
->i2cdetect -r -y 5 (lt9211在iic1上地址为ox2b)。
(3)查看LT9211_ChipID寄存器值
`void LT9211_ChipID(void)
{
lt8918_write_reg(0xff,0x81);//register bank
pr_info("\r\nLT9211 Chip ID:%x,",lt8918_read_reg(0x00));//18
pr_info("%x, ",lt8918_read_reg(0x01));//1
pr_info("%x, ",lt8918_read_reg(0x02));//e4
}`
(4)检查LT9211打印log
hfp,hbp,hsync,vfp,vbp,vysnc输出正确。
(5)测量mipi信号
MIPI data :1.8V的方波。
图像数据在soc mipi接收过程是需要检测到各个lane的LP11-LP10-LP00的一个状态切换后才会切换
到高速模式准备接收。
(6)确认mipi lane数与硬件连接的是否一致。
五.LT9211MCU程序
/******************************************************************************
* @project: LT9211
* @file: lt9211.c
* @author: zll
* @company: LONTIUM COPYRIGHT and CONFIDENTIAL
* @date: 2019.04.10
/******************************************************************************/
#include "include.h"
u16 hact, vact;
u16 hs, vs;
u16 hbp, vbp;
u16 htotal, vtotal;
u16 hfp, vfp;
u8 VideoFormat=0;
u32 lvds_clk_in = 0;
#define OFFSET 5
struct video_timing *pVideo_Format;
//hfp, hs, hbp, hact, htotal, vfp, vs, vbp, vact, vtotal, pixclk
struct video_timing video_640x480_60Hz ={ 8, 96, 40, 640, 800, 33, 2, 10, 480, 525, 25000};
struct video_timing video_720x480_60Hz ={16, 62, 60, 720, 858, 9, 6, 30, 480, 525, 27000};
struct video_timing video_1280x720_60Hz ={110,40, 220,1280, 1650, 5, 5, 20, 720, 750, 74250};
struct video_timing video_1280x720_30Hz ={110,40, 220,1280, 1650, 5, 5, 20, 720, 750, 74250};
struct video_timing video_1366x768_60Hz ={26, 110,110,1366, 1592, 13, 6, 13, 768, 800, 81000};
struct video_timing video_1920x720_60Hz ={148,44, 88, 1920, 2200, 28, 5, 12, 720, 765, 88000};
struct video_timing video_1920x1080_30Hz ={88, 44, 148,1920, 2200, 4, 5, 36, 1080, 1125, 74250};
struct video_timing video_1920x1080_60Hz ={88, 44, 148,1920, 2200, 4, 5, 36, 1080, 1125, 148500};
struct video_timing video_1920x1200_60Hz ={48, 32, 80,1920, 2080, 3, 6, 26, 1200, 1235, 154000};
struct video_timing video_3840x2160_30Hz ={176,88, 296,3840, 4400, 8, 10, 72, 2160, 2250, 297000};
void LT9211_ChipID(void)
{
HDMI_WriteI2C_Byte(0xff,0x81);//register bank
print("\r\nLT9211 Chip ID:%x,",HDMI_ReadI2C_Byte(0x00));