Hi.
I want to do some tests about loading tifs.bin in SBL.
I am using SDK8.6,Below are my test steps:
1. Burn tifs.bin to OSPI Flash addresses 0x80000U and 0x480000U respectively.
At the 0x80000U, a damaged tifs.bin file is stored.
At the 0x480000U ,, a complete tifs.bin file is stored.
2. Modify lds script.
OCMRAM_SBL_SYSFW (RWIX) : origin=0x41C70000 length=0x28000
OCMRAM_SBL_SYSFW_B (RWIX) : origin=0x41C98000 length=0x28000
.firmware : {} palign(8) > OCMRAM_SBL_SYSFW
.firmware_b : {} palign(8) > OCMRAM_SBL_SYSFW_B
3. Refer to SBL_ReadSysfwImage, Read tifs.bin at two different addresses in OSPI FLASH.
#define OSPI_OFFSET_SYSFW (0x80000U)
#define OSPI_OFFSET_SYSFW_BACK (0x480000U)
ReadSysfwImage_Test(void **pBuffer, void **pBuffer_b,uint32_t num_bytes)
{
................
..............
SBL_SysFwLoad((void *)(*pBuffer), (void *)(ospi_cfg.dataAddr + OSPI_OFFSET_SYSFW), num_bytes);
SBL_SysFwLoad((void *)(*pBuffer_b), (void *)(ospi_cfg.dataAddr + OSPI_OFFSET_SYSFW_BACK), num_bytes);
...............................
}
4. modify SBL_SciClientInit(uint32_t devGroup).
void SBL_SciClientInit(uint32_t devGroup)
{
int32_t status = CSL_EFAIL;
void *sysfw_ptr = gSciclient_firmware;
void *sysfw_ptr_b = gSciclient_firmware_b;
....................
.....................
status = ReadSysfwImage_Test(&sysfw_ptr,&sysfw_ptr_b, SBL_SYSFW_MAX_SIZE);
......................
status = Sciclient_loadFirmware((const uint32_t *) sysfw_ptr);
if (status != CSL_PASS)
{
#if defined(SOC_J721E) || defined(SOC_J7200) || defined(SOC_J721S2) || defined(SOC_J784S4)
SBL_log(SBL_LOG_ERR,"TIFS load...FAILED \n");
#else
SBL_log(SBL_LOG_ERR,"SYSFW load...FAILED \n");
#endif
SBL_log(SBL_LOG_ERR,"Back TIFS load...\n");
status = Sciclient_loadFirmware((const uint32_t *) sysfw_ptr_b);
if (status != CSL_PASS)
{
#if defined(SOC_J721E) || defined(SOC_J7200) || defined(SOC_J721S2) || defined(SOC_J784S4)
SBL_log(SBL_LOG_ERR,"Back TIFS load...FAILED \n");
#else
SBL_log(SBL_LOG_ERR,"SYSFW load...FAILED \n");
#endif
SblErrLoop(__FILE__, __LINE__);
}
}
..................
...................
}
5. Expected result:
Read out the tifs.bin of the two addresses of OSPI FLASH to the specified buffer respectively. Load and verify the tifs.bin of the first buffer, which fails. Then load and verify the tifs.bin of the second buffer. The system starts successfully.
6. Actual result
After loading and verifying the tifs.bin of the first buffer failed, I tried to load and verify the tifs.bin of the second buffer, and the program got stuck in Sciclient_loadFirmware.