summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2011-06-13 21:46:29 +0000
committerAmaury Pouly <pamaury@rockbox.org>2011-06-13 21:46:29 +0000
commit50be1a8c4ce38d97b7ae76cb4dccf961065f9d94 (patch)
treedfaf27cf76d2a7b7b2c0d15ca4d88dc626bf06d6 /utils
parentdfeab73f55b4ae4308031b55c93b00c4e5ef31ca (diff)
downloadrockbox-50be1a8c4ce38d97b7ae76cb4dccf961065f9d94.tar.gz
rockbox-50be1a8c4ce38d97b7ae76cb4dccf961065f9d94.tar.bz2
rockbox-50be1a8c4ce38d97b7ae76cb4dccf961065f9d94.zip
sbtools: add support for the mode command (rarely used) and explicit env variable to skip version check
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30003 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils')
-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
uint32_t pattern;
} __attribute__((packed));
+struct sb_instruction_mode_t
+{
+ struct sb_instruction_header_t hdr;
+ uint32_t zero1;
+ uint32_t zero2;
+ uint32_t mode;
+} __attribute__((packed));
+
struct sb_instruction_call_t
{
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
// fixme: useless as pos is a multiple of 16 and call struct is 4-bytes wide ?
pos = ROUND_UP(pos, 16);
}
+ else if(hdr->opcode == SB_INST_MODE)
+ {
+ struct sb_instruction_mode_t *mode = (struct sb_instruction_mode_t *)hdr;
+ color(RED);
+ printf("MODE");
+ color(OFF);printf(" | ");
+ color(BLUE);
+ printf("mod=0x%08x\n", mode->mode);
+ color(OFF);
+ pos += sizeof(struct sb_instruction_mode_t);
+ }
else
{
color(RED);
@@ -705,6 +716,7 @@ int main(int argc, const char **argv)
{
printf("Usage: %s <firmware> <key file> [<out prefix>]\n",*argv);
printf("To use raw command mode, set environment variable SB_RAW_CMD to YES\n");
+ printf("To ignore the file version check, set environment variable SB_IGNORE_VER to YES\n");
return 1;
}