1 uboot:
1.1 配置:
CONFIG_CMD_BOOTLOGO
CONFIG_SSTAR_DISP
CONFIG_SSTAR_PNL
CONFIG_SSTAR_JPD
1.2 编译
obj-$(CONFIG_CMD_BOOTLOGO) += cmd_bootlogo.oifdef CONFIG_SSTAR_DISP
CFLAGS_cmd_bootlogo.o += -I$(srctree)/drivers/mstar/common
CFLAGS_cmd_bootlogo.o += -I$(srctree)/drivers/mstar/disp/drv/midisp/pub
endififdef CONFIG_SSTAR_PNL
CFLAGS_cmd_bootlogo.o += -I$(srctree)/drivers/mstar/common
CFLAGS_cmd_bootlogo.o += -I$(srctree)/drivers/mstar/panel/drv/mipnl/pub
endififdef CONFIG_SSTAR_JPD
CHIP_NAME := $(subst ",,$(CONFIG_SYS_CONFIG_NAME))
CFLAGS_cmd_bootlogo.o += -I$(srctree)/drivers/mstar/jpd/$(CHIP_NAME)/inc
endif
1.3 cmd_bootlogo.c:
入口 do_display()
ret = find_dev_and_part(strENVName, &dev, &pnum, &part); // 获取LOGO分区序号
start = part->offset; // 数据分区起点
size = part->size; // 数据分区容量
sprintf(cmd_str, “nand read.e 0x%p %s”, pRawData, strENVName); //读取分区数据
//Parsing Header 后续代码分析数据头
1 数据以 “SSTAR” 开始
2 数据紧跟着为 SS_HEADER_Desc_t 内容
3 读取所有的 SS_SHEADER_DataInfo_t 名字为 “DISP” 显示参数数据
4 读取所有的 SS_SHEADER_DataInfo_t – pstPictureInfo 名字为 “LOGO” jpg图像数据
BootJpdYuvCtrl(pstPictureInfo->stDataInfo.u32DataTotalSize, (u32)((s8 *)pstPictureInfo + pstPictureInfo->stDataInfo.u32SubHeadSize),
pDispInfo->u32DispBufSize, pDispInfo->u32DispBufStart, &u16ImgWidth, &u16ImgHeight, (PIC_ROTATION_e)simple_strtoul(argv[5], NULL, 0));
图像解码到 pDispInfo
_BootDispCtrl(puDispPnl, pDispInfo, u32Shift, enAspectRatio, u32X, u32Y, u16ImgWidth, u16ImgHeight);
显示图像
由上面可以看出,它显示和数据都依据LOGO分区里的数据进行显示。
更换屏幕,不需要对uboot做屏幕相关的配置。
注意:买屏幕需要注意,有些屏幕需要上电通过SPI配置后才能正常解析RGBTTL信号。刚好踩中这种少数屏幕。PCB没有设计连线,重新下单。
2 BOOTLOGO 分区
2.1 生成工具和实例
工具源码位于:image/makefiletools/src/rawgenerator/
2.1.1 makefile:
TARGET_DISP := dispcfggen # 用来配置屏幕参数
TARGET_LOGO := logogen # 用来追加显示的图片数据
gcc -m32 -Wall ss_raw_header.c logo_data_main.c -o ../../bin/$(TARGET_LOGO)
gcc -m32 -Wall -I./pnl ss_raw_header.c disp_data_main.c -o ../../bin/$(TARGET_DISP)
2.1.2 实例参考:
/opt/project/image/makefiletools/bin/dispcfggen -c -o /opt/project/image/output/images/logo -p 0x7c00000 -s 0x300000 -d CC0702I50R
----------------- SS_SHEADER_InsertDispTable s8UsedName = CC0702I50R
LOGO header size 56
First use: CC0702I50R
Insert disp name: RM68200
Disp header size (260) mhal pnl para size(148) spi cmd size(842)
Insert disp name: SAT070CP50
Disp header size (260) mhal pnl para size(148) spi cmd size(0)
Insert disp name: ADT07016BR50
Disp header size (260) mhal pnl para size(148) spi cmd size(0)
Insert disp name: CC0702I50R
Disp header size (260) mhal pnl para size(148) spi cmd size(0)
Insert disp name: SAT070BO30I21Y0
Disp header size (260) mhal pnl para size(148) spi cmd size(35)
Data count 5, total size 2180(0x884), first use addr 1692(0x69c)
dipslay_start=0x07c00000
dipslay_size=0x00300000
/opt/project/image/makefiletools/bin/logogen -a -i /opt/project/board/ini/misc/sigmastar1024_600.jpg -o /opt/project/image/output/images/logo
Ready to open logo file /opt/project/board/ini/misc/sigmastar1024_600.jpg
Get file size 25797 sub head size 44
/opt/project/image/makefiletools/bin/logogen -a -i /opt/project/board/ini/misc/upgrade.jpg -o /opt/project/image/output/images/logo
Ready to open logo file /opt/project/board/ini/misc/upgrade.jpg
Get file size 17833 sub head size 44
2.2 LOGO图片:
- board/ini/misc/添加对应文件 hivisi_720_720.jpg
- 同时更新 configs/nvr/i2m/8.2.1/spinand.ram-glibc-squashfs.011a.128
BOOTLOGO_FILE = hivisi_720_720.jpg
2.3 屏参头文件:
- 参考 pnl/CC0702I50R_1024x600.h编制适用的头文件YX40006A_720x720.h
MhalPnlParamConfig_t 为MHAL框架 - 同时把 对应参数添加到 disp_data_main.c 文件里。
#include "YX40006A_720x720.h"
SS_SHEADER_TableHandler_t stTable[] = { {"YX40006A", &stPanel_YX40006A_720x720, NULL}};
- YX40006A_720x720.h
6, //MS_U8 m_ucPanelHSyncWidth; HSYNC 宽度
25, //MS_U8 m_ucPanelHSyncBackPorch; HSYNC 后肩
7, //MS_U8 m_ucPanelVSyncWidth; VSYNC 宽度
17, //MS_U8 m_ucPanelVBackPorch; VSYNC 后肩
31, //MS_U16 m_wPanelHStart; (PANEL_HSYNC_WIDTH + PANEL_HSYNC_BACK_PORCH)
24, //MS_U16 m_wPanelVStart; (PANEL_VSYNC_WIDTH + PANEL_VSYNC_BACK_PORCH)
720, //MS_U16 m_wPanelWidth;
720, //MS_U16 m_wPanelHeight;
776, //MS_U16 m_wPanelHTotal; HSYNC 所有时间
759, //MS_U16 m_wPanelVTotal; VSYNC 所有时间
- 同时修改显示配置configs/nvr/i2m/8.2.1/spinand.ram-glibc-squashfs.011a.128
DISP_OUT_NAME = YX40006A
2.4 制作LOGO分区数据
/opt/project/image/makefiletools/bin/dispcfggen -c -o /opt/project/image/output/images/logo -p 0x7c00000 -s 0x300000 -d YX40006A
/opt/project/image/makefiletools/bin/logogen -a -i /opt/project/board/ini/misc/hivisi_720_720.jpg -o /opt/project/image/output/images/logo
/opt/project/image/makefiletools/bin/logogen -a -i /opt/project/board/ini/misc/upgrade.jpg -o /opt/project/image/output/images/logo
3 应用显示
3.1 fbdev.ini
cat board/i2m/SSC011A-S01A/config/fbdev.ini
# FBDEV 将会根据[FB_DEVICE]项目的定义生成fbdev设备节点
# 可以有多个[FB_DEVICE],并生成多个fbdev设备节点
[FB_DEVICE]
# 该fbdev使用的gop(graphic hardware) ID
FB_HWLAYER_ID = 1
# fbdev的framebuffer使用的gop graphic window ID
FB_HWWIN_ID = 0
# deprecated 舍弃了
FB_HWLAYER_DST = 3
# 该fbdev的framebuffer使用的颜色格式
# RGB565 = 1
# ARGB4444 = 2
# ARGB8888 = 5
# ARGB1555 = 6
# YUV422 = 9
# I8 = 4
# I4 = 13
# I2 = 14
FB_HWWIN_FORMAT = 5
# 修改Output color,0为RGB,1为YUV
FB_HWLAYER_OUTPUTCOLOR = 1
# 该fbdev的framebuffer的初始化xres,yres
FB_WIDTH = 720
FB_HEIGHT = 720
#在自动获取到当前的显示timing之前,使用的初始化gop输出timing 宽高
FB_TIMMING_WIDTH = 1920
FB_TIMMING_HEIGHT = 1080
# 如果系统的mmap “有” layout项目为E_MMAP_ID_FB
# 那么FBDEV的framebuffer 将使用此处的内存
FB_MMAP_NAME = E_MMAP_ID_FB
# 如果系统的mmap “没有” 为FBDEV layout一块内存
# 那么FBDEV的framebuffer将申请如下长度的内存作为framebuffer
FB_BUFFER_LEN = 4096
#unit:Kbyte,4096=4M, fbdev.ko alloc size = FB_BUFFER_LEN*1024
还可以支持鼠标配置,可参考https://wx.comake.online/doc/syg27dk2rkls-SSD20X/customer/development/software/UI/FBDEV.html
3.2 应用显示 disp_init
该APP在sdk目录verify\application\disp_init\src下。
同理参考其它屏幕新建 YX40006A_720x720.h
MI_PANEL_ParamConfig_t 为MI框架
修改 sstardisp.c
添加对应分辨率和头文件
3.3 应用显示 bootanimation
该APP在sdk目录verify\application\bootanimation\src下。
同理参考其它屏幕新建 YX40006A_720x720.h
MI_PANEL_ParamConfig_t 为MI框架
修改 bootanimation.c
添加对应分辨率和头文件
#include “YX40006A_720x720.h”
#define VDEC_OUTPUT_WIDTH 720
#define VDEC_OUTPUT_HEIGHT 720