summaryrefslogtreecommitdiff
path: root/common/tools
diff options
context:
space:
mode:
authorOlivier Dufour2013-01-15 16:54:16 +0100
committerOlivier Dufour2013-01-25 13:40:55 +0100
commit4ecfd07738a0262eb9040c609a6f4f9558c23135 (patch)
tree56d66aac151d10c8a6eef5b2565febbfe9a7359f /common/tools
parent14f0ba0096a0838ce4d52cfafddbd8d8aa4fef69 (diff)
common/tools/mksimage: write clocks speed in header, refs #1325
Diffstat (limited to 'common/tools')
-rw-r--r--common/tools/mksimage/mksimage.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/common/tools/mksimage/mksimage.c b/common/tools/mksimage/mksimage.c
index 9130890c9b..4a8973e2bf 100644
--- a/common/tools/mksimage/mksimage.c
+++ b/common/tools/mksimage/mksimage.c
@@ -69,6 +69,7 @@ static void print_usage(const char *cmd)
printf(" -i, --image=200|300\t set the image version (mandatory)\n"
"\t 200 is used for a SPC200 or a MSE500-200\n"
"\t 300 is used for a SPC300 or a MSE500-300\n");
+ printf(" -c, --sysclk=C\t\t set speed of the system clock to C MHz\n");
printf(" -s, --size=S\t\t set size of the image to S bytes\n");
printf(" -v, --ver=V\t\t set version of the image to V\n");
printf(" -d, --desc=D\t\t set the description of the image to D\n");
@@ -109,6 +110,7 @@ int main(int argc, char **argv)
char description[64] = "SPiDCOM image";
uint8_t md5_sum[16] = { '\0' };
uint32_t plc_ram = SPIDCOM_IMG_DESC_PLC_RAM;
+ uint32_t sysclk = 0;
struct option opt[] =
{
@@ -117,12 +119,13 @@ int main(int argc, char **argv)
{ "desc", required_argument, NULL, 'd' },
{ "md5", required_argument, NULL, 'm' },
{ "plc-ram", required_argument, NULL, 'r' },
+ { "sysclk", required_argument, NULL, 'c' },
{ "help", no_argument, NULL, 'h' },
{ "image", required_argument, NULL, 'i' },
{ 0, 0, 0, 0 }
};
- while((c = getopt_long(argc, argv, "s:v:d:m:r:i:h", opt, &i)) != -1)
+ while((c = getopt_long(argc, argv, "s:v:d:m:r:c:i:h", opt, &i)) != -1)
{
switch(c)
{
@@ -146,6 +149,9 @@ int main(int argc, char **argv)
case 'r' :
plc_ram = atoi(optarg) * 1024 * 1024;
break;
+ case 'c' :
+ sysclk = atoi(optarg);
+ break;
case 'h' :
print_usage(argv[0]);
return 0;
@@ -171,6 +177,7 @@ int main(int argc, char **argv)
strncpy((char *)img_200.md5_sum, (const char *)md5_sum,
sizeof(img_200.md5_sum));
img_200.header.image_type = image_type;
+ img_200.header.sysclk_speed = sysclk;
img_generic = &img_200;
size_generic = sizeof(spidcom_image_desc_200_t);
break;
@@ -183,6 +190,7 @@ int main(int argc, char **argv)
sizeof(img_300.md5_sum));
img_300.plc_ram = plc_ram;
img_300.header.image_type = image_type;
+ img_300.header.sysclk_speed = sysclk;
img_generic = &img_300;
size_generic = sizeof(spidcom_image_desc_300_t);
break;