summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/sbtools/sb.h8
-rw-r--r--utils/sbtools/sbtoelf.c12
2 files changed, 20 insertions, 0 deletions
diff --git a/utils/sbtools/sb.h b/utils/sbtools/sb.h
index fe9ee3f4db..9ffdba9191 100644
--- a/utils/sbtools/sb.h
+++ b/utils/sbtools/sb.h
@@ -123,6 +123,14 @@ struct sb_instruction_fill_t
123 uint32_t pattern; 123 uint32_t pattern;
124} __attribute__((packed)); 124} __attribute__((packed));
125 125
126struct sb_instruction_mode_t
127{
128 struct sb_instruction_header_t hdr;
129 uint32_t zero1;
130 uint32_t zero2;
131 uint32_t mode;
132} __attribute__((packed));
133
126struct sb_instruction_call_t 134struct sb_instruction_call_t
127{ 135{
128 struct sb_instruction_header_t hdr; 136 struct sb_instruction_header_t hdr;
diff --git a/utils/sbtools/sbtoelf.c b/utils/sbtools/sbtoelf.c
index 854af2851e..7e6b77055b 100644
--- a/utils/sbtools/sbtoelf.c
+++ b/utils/sbtools/sbtoelf.c
@@ -307,6 +307,17 @@ static void extract_section(int data_sec, char name[5], byte *buf, int size, con
307 // fixme: useless as pos is a multiple of 16 and call struct is 4-bytes wide ? 307 // fixme: useless as pos is a multiple of 16 and call struct is 4-bytes wide ?
308 pos = ROUND_UP(pos, 16); 308 pos = ROUND_UP(pos, 16);
309 } 309 }
310 else if(hdr->opcode == SB_INST_MODE)
311 {
312 struct sb_instruction_mode_t *mode = (struct sb_instruction_mode_t *)hdr;
313 color(RED);
314 printf("MODE");
315 color(OFF);printf(" | ");
316 color(BLUE);
317 printf("mod=0x%08x\n", mode->mode);
318 color(OFF);
319 pos += sizeof(struct sb_instruction_mode_t);
320 }
310 else 321 else
311 { 322 {
312 color(RED); 323 color(RED);
@@ -705,6 +716,7 @@ int main(int argc, const char **argv)
705 { 716 {
706 printf("Usage: %s <firmware> <key file> [<out prefix>]\n",*argv); 717 printf("Usage: %s <firmware> <key file> [<out prefix>]\n",*argv);
707 printf("To use raw command mode, set environment variable SB_RAW_CMD to YES\n"); 718 printf("To use raw command mode, set environment variable SB_RAW_CMD to YES\n");
719 printf("To ignore the file version check, set environment variable SB_IGNORE_VER to YES\n");
708 return 1; 720 return 1;
709 } 721 }
710 722