2006-12-18 16:30:04 +00:00
|
|
|
diff -urN linux-2.6.19/drivers/mtd/redboot.c linux-2.6.19.new/drivers/mtd/redboot.c
|
|
|
|
--- linux-2.6.19/drivers/mtd/redboot.c 2006-12-18 17:09:14.000000000 +0100
|
|
|
|
+++ linux-2.6.19.new/drivers/mtd/redboot.c 2006-12-18 17:14:26.000000000 +0100
|
2006-08-03 14:43:03 +00:00
|
|
|
@@ -39,7 +39,7 @@
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int parse_redboot_partitions(struct mtd_info *master,
|
|
|
|
+int parse_redboot_partitions(struct mtd_info *master,
|
|
|
|
struct mtd_partition **pparts,
|
|
|
|
unsigned long fis_origin)
|
|
|
|
{
|
2006-12-18 16:30:04 +00:00
|
|
|
@@ -132,6 +132,14 @@
|
2006-08-03 14:43:03 +00:00
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ if (!fis_origin) {
|
|
|
|
+ for (i = 0; i < numslots; i++) {
|
|
|
|
+ if (!strncmp(buf[i].name, "RedBoot", 8)) {
|
|
|
|
+ fis_origin = (buf[i].flash_base & (master->size << 1) - 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
for (i = 0; i < numslots; i++) {
|
|
|
|
struct fis_list *new_fl, **prev;
|
|
|
|
|
2006-12-18 16:30:04 +00:00
|
|
|
@@ -154,9 +162,8 @@
|
2006-08-03 14:43:03 +00:00
|
|
|
new_fl->img = &buf[i];
|
2006-12-18 16:30:04 +00:00
|
|
|
if (fis_origin) {
|
|
|
|
buf[i].flash_base -= fis_origin;
|
2006-08-03 14:43:03 +00:00
|
|
|
- } else {
|
|
|
|
- buf[i].flash_base &= master->size-1;
|
2006-12-18 16:30:04 +00:00
|
|
|
}
|
2006-08-03 14:43:03 +00:00
|
|
|
+ buf[i].flash_base &= (master->size << 1) - 1;
|
|
|
|
|
|
|
|
/* I'm sure the JFFS2 code has done me permanent damage.
|
|
|
|
* I now think the following is _normal_
|