SSD202D-logo分区添加dtb_旋风旋风的博客-CSDN博客
可以参考该博客,当然我为了兼容以前的固件又优化了该思路:
直接把对应的包添加在logo_202d的尾部,这样就不会影响原来的包
这两张就是修改之后的结构,只在尾部追加DTB
其中ABC结构体
//A结构体- (12 size)
typedef struct
{
u8 au8Tittle[8];
u32 u32DataInfoCnt;
}SS_HEADER_Desc_t;
//B结构体- (56 size)
typedef struct
{
SS_SHEADER_DataInfo_t stDataInfo;
u32 u32FirstUseOffset;
u32 u32DispBufSize;
u32 u32DispBufStart;
}SS_SHEADER_DispInfo_t;
//C结构体- (44 size)
typedef struct
{
u8 au8DataInfoName[32];
u32 u32DataTotalSize;
u32 u32SubHeadSize;
u32 u32SubNodeCount;
}SS_SHEADER_DataInfo_t;
具体可以参考下图
这些不细说,就是在kernel中先多保存一份kernel.dtb出来放到对应打包路径等待使用
diff --git a/kernel/arch/arm/boot/Makefile b/kernel/arch/arm/boot/Makefile
index ce2fcb6a2..ec6124f49 100755
--- a/kernel/arch/arm/boot/Makefile
+++ b/kernel/arch/arm/boot/Makefile
@@ -28,6 +28,7 @@ _BUILTIN_DTB_NAME=$(strip $(shell echo ${CONFIG_SS_DTB_NAME}))
ifneq ($(_BUILTIN_DTB_NAME),)
ifneq ($(wildcard arch/arm/boot/dts/$(_BUILTIN_DTB_NAME).dts),)
SS_DTB_NAME=arch/arm/boot/dts/$(_BUILTIN_DTB_NAME).dtb
+KERNEL_DTB_NAME=arch/arm/boot/kernel.dtb
endif
endif
@@ -88,6 +89,7 @@ ifeq ($(CONFIG_SS_BUILTIN_DTB), y)
echo " IMAGE $(obj)/Image"; \
echo " BNDTB ${SS_DTB_NAME}"; \
python scripts/ms_builtin_dtb_update.py $(obj)/Image ${SS_DTB_NAME}; \
+ cp -rvf ${SS_DTB_NAME} ${KERNEL_DTB_NAME}; \
echo; \
fi;
#update Image-fpga DTB
然后再project中将检查是否有dtb,如果有就把dtb放进尾部
diff --git a/project/image/image.mk b/project/image/image.mk
index 174f8dddc..81040db12 100755
--- a/project/image/image.mk
+++ b/project/image/image.mk
@@ -7,6 +7,8 @@ BOOT_TARGET_FSIMAGE:=$(foreach n,$(BOOT_FSIMAGE_LIST),$(n)_$(FLASH_TYPE)_$($(n)$
BOOT_TARGET_NOFSIMAGE:=$(foreach n,$(filter-out $(BOOT_FSIMAGE_LIST), $(BOOT_IMAGE_LIST)),$(n)_nofsimage)
MKYAFFS2IMAGE=/work/projects/build/linux/sbin/mkyaffs2image610
MKCRAMFS=$(shell which mkcramfs || which mkfs.cramfs)
+KERNEL_DTB_FILE:=$(PROJ_ROOT)/../kernel/arch/arm/boot/kernel.dtb
+KERNEL_DTB_BIT:=$(shell test -f $(KERNEL_DTB_FILE) && echo yes)
ifneq ($(shell id -u),0)
FAKEROOT:=fakeroot
@@ -149,6 +151,9 @@ logo_nofsimage:
$(PROJ_ROOT)/image/makefiletools/bin/dispcfggen -c -o $(logo$(RESOUCE))_202d -p $(LOGO_ADDR) -s $(BOOTLOGO_BUFSIZE) -d $(DISP_OUT_NAME)
$(PROJ_ROOT)/image/makefiletools/bin/logogen -a -i $(PROJ_ROOT)/board/ini/misc/$(BOOTLOGO_FILE) -o $(logo$(RESOUCE))_202d
$(PROJ_ROOT)/image/makefiletools/bin/logogen -a -i $(PROJ_ROOT)/board/ini/misc/upgrade.jpg -o $(logo$(RESOUCE))_202d
+ifeq ($(KERNEL_DTB_BIT),yes)
+ $(PROJ_ROOT)/image/makefiletools/bin/logogen -d -i $(KERNEL_DTB_FILE) -o $(PROJ_ROOT)/image/output/images/logo_202d
+endif
%_$(FLASH_TYPE)_ramfs_fsimage:
@echo [[$@]]
用到logogen这个工具,于是我加了点逻辑
diff --git a/project/image/makefiletools/src/rawgenerator/logo_data_main.c b/project/image/makefiletools/src/rawgenerator/logo_data_main.c
index 8782fe19d..7156b83dc 100755
--- a/project/image/makefiletools/src/rawgenerator/logo_data_main.c
+++ b/project/image/makefiletools/src/rawgenerator/logo_data_main.c
@@ -39,6 +39,7 @@ typedef struct
#ifndef ALIGN_DOWN
#define ALIGN_DOWN(val, alignment) (( (val)/(alignment))*(alignment))
#endif
+u32 u32Flag;
static s32 _FileSize(const s8* ps8Name)
{
@@ -59,7 +60,10 @@ static s32 SS_SHEADER_InsertPictureData(FILE *fp, const s8 *ps8SrcFile)
printf("Ready to open logo file %s\n", ps8SrcFile);
memset(&stPictureInfo, 0, sizeof(SS_SHEADER_P