浏览代码

Add the rbmipsnand fix from #1778

SVN-Revision: 7388
Florian Fainelli 19 年之前
父节点
当前提交
5d2d8d76af
共有 1 个文件被更改,包括 12 次插入1 次删除
  1. 12 1
      target/linux/adm5120-2.6/files/drivers/mtd/nand/rbmipsnand.c

+ 12 - 1
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 mtd_info rmtd;
 static struct nand_chip rnand;
 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;
 static unsigned init_ok = 0;
 
 
 unsigned get_rbnand_block_size(void) {
 unsigned get_rbnand_block_size(void) {
@@ -93,6 +103,7 @@ int __init rbmips_init(void) {
 		return -ENXIO;
 		return -ENXIO;
 	}
 	}
 	rnand.ecc.mode = NAND_ECC_SOFT;
 	rnand.ecc.mode = NAND_ECC_SOFT;
+	rnand.ecc.layout = &rb_ecclayout;
 	rnand.chip_delay = 25;
 	rnand.chip_delay = 25;
 	rnand.options |= NAND_NO_AUTOINCR;
 	rnand.options |= NAND_NO_AUTOINCR;
 	rmtd.priv = &rnand;
 	rmtd.priv = &rnand;