成功解析额外的oem数据 运行正常

This commit is contained in:
2024-10-29 19:29:10 +08:00
parent 85dd5cfa6d
commit c913292f01
3 changed files with 49 additions and 18 deletions

View File

@@ -390,6 +390,7 @@ void board_oem_signal_mtx_binding(iot_board_info_v1_t *rc_info)
extern int32_t sbl_printf(const char *fmt, ...);
uint32_t board_load_oem_cfg()
@@ -418,13 +419,13 @@ uint32_t board_load_oem_cfg()
g_board_cpu_idx = cpu_get_mhartid();
#endif
iot_printf("start load oemcfg\n");
iot_printf("%s:%d\n"__FILE__,__LINE__);
sbl_printf("start load oemcfg\n");
sbl_printf("%s:%d\n",__FILE__,__LINE__);
ret = iot_oem_get_cfg(&oemcfg);
if (ret != ERR_OK) {
goto out;
}
iot_printf("%s:%d\n"__FILE__,__LINE__);
sbl_printf("%s:%d\n",__FILE__,__LINE__);
g_board_info.board_id = oemcfg->board_id;
IOT_ASSERT(oemcfg->board_cfg_ver == IOT_OEM_VER_V1);
@@ -440,21 +441,22 @@ uint32_t board_load_oem_cfg()
goto out;
}
// 读取oem的差分部分
iot_printf("%s:%d\n"__FILE__,__LINE__);
sbl_printf("%s:%d\n",__FILE__,__LINE__);
ret = iot_oem_read_mtd(buf_oem, oem_part_size - oem_diff_offset,
oem_diff_offset);
if (ret != ERR_OK) {
goto out;
}
iot_printf("%s:%d\n"__FILE__,__LINE__);
sbl_printf("%s:%d\n",__FILE__,__LINE__);
ret = ERR_FAIL;
hw_ver_cal = iot_board_hw_version_hex();
/* if hw_version is not written during production test, it defaults to f */
if (hw_ver_cal == 0xffffffff) {
iot_printf("%s:%d\n"__FILE__,__LINE__);
sbl_printf("%s:%d\n",__FILE__,__LINE__);
hw_ver_cal = 0;
}
sbl_printf("board_hw_ver=%08x\n",hw_ver_cal);
// ptr_rc 是 iot_board_info_v1_t 类型的指针
ptr_hdr = &ptr_rc->hdr;
hw_ver_rc = ptr_hdr->hw_version;
@@ -465,6 +467,7 @@ hdr_check:
if (ptr_hdr->have_next == 0) {
if(read_oem_ext_flag ||
iot_oem_read_mtd_ext(&buf_oem[offset],BOARD_OEM_INFO_SIZE_MAX-offset)){
sbl_printf("%s:%d\n",__FILE__,__LINE__);
goto out;
} else {
ptr_hdr->have_next = 1;
@@ -480,6 +483,7 @@ hdr_check:
hw_ver_rc = ptr_hdr->hw_version;
goto hdr_check;
}
sbl_printf("count_rc=%d\n",cnt_rc);
/* prevent array out of bounds */
// 最多只支持63个硬件识别码