Change the main partition to be named rootfs so that the scripts mount it
[openwrt.git] / target / linux / adm5120-2.6 / files / drivers / mtd / nand / rbmipsnand.c
index f086552..306b97c 100644 (file)
@@ -58,7 +58,7 @@ static struct mtd_partition partition_info[] = {
        size: 4 * 1024 * 1024
     },
     {
-        name: "RouterBoard NAND Main",
+        name: "rootfs",
        offset: MTDPART_OFS_NXTBLK,
        size: MTDPART_SIZ_FULL
     }
@@ -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) {
@@ -78,7 +88,7 @@ EXPORT_SYMBOL(get_rbnand_block_size);
 int __init rbmips_init(void) {
        memset(&rmtd, 0, sizeof(rmtd));
        memset(&rnand, 0, sizeof(rnand));
-       printk("RB1xx nand\n");
+       printk(KERN_INFO "RB1xx nand\n");
        MEM32(0xB2000064) = 0x100;
        MEM32(0xB2000008) = 0x1;
        SMEM1(NAND_SET_SPn) = 0x01;
@@ -89,16 +99,17 @@ int __init rbmips_init(void) {
        rnand.dev_ready = rb100_dev_ready;
        p_nand = (void __iomem *)ioremap(( unsigned long)SMEM1_BASE, 0x1000);
        if (!p_nand) {
-               printk("RB1xx nand Unable ioremap buffer");
+               printk(KERN_WARNING "RB1xx nand Unable ioremap buffer\n");
                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;
        if (nand_scan(&rmtd, 1) && nand_scan(&rmtd, 1)
            && nand_scan(&rmtd, 1)  && nand_scan(&rmtd, 1)) {
-               printk("RB1xxx nand device not found");
+               printk(KERN_INFO "RB1xxx nand device not found\n");
                iounmap ((void *)p_nand);
                return -ENXIO;
        }
This page took 0.025905 seconds and 4 git commands to generate.