Commit f4f3bcae authored by Marek Vasut's avatar Marek Vasut

mxssb: Clean up sb_tag_to_command()

The TAG instruction is wholy filled later and the LOAD instruction
fields need to be updated after a file was loaded. Thus, clean up
bogus assignments into fields of these instructions.
Signed-off-by: Marek Vasut's avatarMarek Vasut <marex@denx.de>
parent e9120dba
......@@ -276,20 +276,6 @@ static int sb_get_boot_list_payload_slot(const int cpu, const int spl)
return 0;
}
static int sb_get_sections_block_size(void)
{
struct sb_source_entry *src = sb_get_boot_list(target_cpu);
unsigned int insts = sb_get_boot_list_size(target_cpu);
unsigned int size = insts * sizeof(struct sb_command);
unsigned int i;
for(i = 0; i < sb_get_boot_list_size(target_cpu); i++, src++)
if(src->tag == ROM_LOAD_CMD)
size += src->length;
return size / SB_BLOCK_SIZE;
}
static time_t sb_get_timestamp(void)
{
struct tm time_2000 = {
......@@ -378,17 +364,11 @@ static int sb_tag_to_command(struct sb_source_entry *src,
case ROM_NOP_CMD: /* UNSUPPORTED */
goto unsupp;
case ROM_TAG_CMD:
/* FIXME ... support multiple sections */
cmd->tag.section_number = 0;
/* FIXME ... copy this from section header! */
cmd->tag.section_length = sb_get_sections_block_size() - 1;
/* FIXME ... copy this from section header! */
cmd->tag.section_flags = SB_SECTION_FLAG_BOOTABLE;
/* TAG instruction is filled later */
break;
case ROM_LOAD_CMD:
cmd->load.address = src->address;
cmd->load.count = src->length;
cmd->load.crc32 = crc32(src->payload, src->length);
/* cmd->load.count and cmd->load.crc32 are filled later */
break;
case ROM_FILL_CMD: /* UNSUPPORTED */
goto unsupp;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment