Hello, I found an solution for these problem and have modified the init function with two additional parameters -0 and -1.
The normal init prozess writes Bootstream 0 and 1 as well as FCB and DBBT Block
root@imx28evk ~$ kobs-ng init -v -d /boot/imx28_ivt_linux.sb
Than these only writes Bootstream 0.
root@imx28evk ~$ kobs-ng init -v -d -0 /boot/imx28_ivt_linux.sb
and finaly these only writes Bootstream 1.
root@imx28evk ~$ kobs-ng init -v -d -1 /boot/imx28_ivt_linux.sb
Than the used Bootstream can be selected with the ROM_SECONDARY_BOOT bit using memtools from imx-tests.
root@imx28evk ~$ /unit_tests/memtool 80056070=2
Writing 32-bit value 0x2 to address 0x80056070 => selecting secondary bootstream
or
root@imx28evk ~$ /unit_tests/memtool 80056070=0
Writing 32-bit value 0x0 to address 0x80056070 => selecting primary bootstream
Regards,
Birger
***********************************************************************************************************************************************
diff -rupN kobs-ng-3.0.0.org/src/main.c kobs-ng-3.0.0/src/main.c
--- kobs-ng-3.0.0.org/src/main.c 2012-08-30 08:58:49.000000000 +0200
+++ kobs-ng-3.0.0/src/main.c 2013-09-06 11:55:46.422945623 +0200
@@ -555,6 +555,7 @@ int update_main(int argc, char **argv)
int init_main(int argc, char **argv)
{
+ int mask = UPDATE_ALL;
int i, j, r;
struct mtd_data *md;
int flags, image;
@@ -594,6 +595,12 @@ int init_main(int argc, char **argv)
}
switch (argv[i][1]) {
+ case '0':
+ mask = UPDATE_BS0;
+ break;
+ case '1':
+ mask = UPDATE_BS1;
+ break;
case 'b':
badlist = &argv[i][2];
if (*badlist == '\0') {
@@ -687,7 +694,7 @@ int init_main(int argc, char **argv)
mtd_dump_structure(md);
if (!dryrun) {
- r = plat_config_data->rom_mtd_commit_structures(md, infp, UPDATE_ALL);
+ r = plat_config_data->rom_mtd_commit_structures(md, infp, mask);
if (r < 0) {
fprintf(stderr, "FAILED to commit structures\n");
exit(5);
diff -rupN kobs-ng-3.0.0.org/src/mtd.c kobs-ng-3.0.0/src/mtd.c
--- kobs-ng-3.0.0.org/src/mtd.c 2012-08-30 08:58:49.000000000 +0200
+++ kobs-ng-3.0.0/src/mtd.c 2013-09-06 11:56:35.594944436 +0200
@@ -2289,7 +2289,7 @@ int mtd_commit_bcb(struct mtd_data *md,
return err;
}
-int write_boot_stream(struct mtd_data *md, FILE *fp)
+int write_boot_stream(struct mtd_data *md, FILE *fp, int flags)
{
int startpage, start, size;
loff_t ofs, end;
@@ -2299,7 +2299,7 @@ int write_boot_stream(struct mtd_data *m
vp(md, "---------- Start to write the [ %s ]----\n", (char*)md->private);
for (i = 0; i < 2; i++) {
- if (fp == NULL)
+ if (fp == NULL || (flags & UPDATE_BS(i)) == 0)
continue;
if (i == 0) {
@@ -2562,7 +2562,7 @@ int v1_rom_mtd_commit_structures(struct
mtd_commit_bcb(md, "DBBT", 1, 1, 1, 1, mtd_writesize(md), true);
/* write the boot image. */
- return write_boot_stream(md, fp);
+ return write_boot_stream(md, fp, flags);
}
int v2_rom_mtd_commit_structures(struct mtd_data *md, FILE *fp, int flags)
@@ -2793,7 +2793,7 @@ int v4_rom_mtd_commit_structures(struct
}
/* [3] Write the two boot streams. */
- return write_boot_stream(md, fp);
+ return write_boot_stream(md, fp, flags);
}
#undef ARG