aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2007-05-29 17:28:06 +0000
committerFlorian Fainelli <florian@openwrt.org>2007-05-29 17:28:06 +0000
commit5d2d8d76af7809dd74612471edd05a2ff6188d44 (patch)
treea129aaefed8042300e069d3185f8371fe9f678f5 /target
parentc2ee19355b908623ac8f07a9cbb43ef8427af254 (diff)
downloadupstream-5d2d8d76af7809dd74612471edd05a2ff6188d44.tar.gz
upstream-5d2d8d76af7809dd74612471edd05a2ff6188d44.tar.bz2
upstream-5d2d8d76af7809dd74612471edd05a2ff6188d44.zip
Add the rbmipsnand fix from #1778
SVN-Revision: 7388
Diffstat (limited to 'target')
-rw-r--r--target/linux/adm5120-2.6/files/drivers/mtd/nand/rbmipsnand.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/target/linux/adm5120-2.6/files/drivers/mtd/nand/rbmipsnand.c b/target/linux/adm5120-2.6/files/drivers/mtd/nand/rbmipsnand.c
index caecd50659..c687dcdd27 100644
--- a/target/linux/adm5120-2.6/files/drivers/mtd/nand/rbmipsnand.c
+++ b/target/linux/adm5120-2.6/files/drivers/mtd/nand/rbmipsnand.c
@@ -66,7 +66,17 @@ static struct mtd_partition partition_info[] = {
static struct mtd_info rmtd;
static struct nand_chip rnand;
-
+/*========================================================================*/
+/* We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader */
+/* will not be able to find the kernel that we load. So set the oobinfo */
+/* when creating the partitions. */
+/*========================================================================*/
+static struct nand_ecclayout rb_ecclayout = {
+ .eccbytes = 6,
+ .eccpos = { 8, 9, 10, 13, 14, 15 },
+ .oobavail = 9,
+ .oobfree = { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1} }
+};
static unsigned init_ok = 0;
unsigned get_rbnand_block_size(void) {
@@ -93,6 +103,7 @@ int __init rbmips_init(void) {
return -ENXIO;
}
rnand.ecc.mode = NAND_ECC_SOFT;
+ rnand.ecc.layout = &rb_ecclayout;
rnand.chip_delay = 25;
rnand.options |= NAND_NO_AUTOINCR;
rmtd.priv = &rnand;