1 --- a/arch/mips/rb532/devices.c
2 +++ b/arch/mips/rb532/devices.c
3 @@ -139,6 +139,19 @@ static struct platform_device cf_slot0 =
6 /* Resources and device for NAND */
9 + * We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader
10 + * will not be able to find the kernel that we load. So set the oobinfo
11 + * when creating the partitions
13 +static struct nand_ecclayout rb532_nand_ecclayout = {
15 + .eccpos = { 8, 9, 10, 13, 14, 15 },
17 + .oobfree = { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } }
20 static int rb532_dev_ready(struct mtd_info *mtd)
22 return gpio_get_value(GPIO_RDY);
23 @@ -280,6 +293,16 @@ static void __init parse_mac_addr(char *
24 /* NAND definitions */
25 #define NAND_CHIP_DELAY 25
27 +static int rb532_nand_fixup(struct mtd_info *mtd)
29 + struct nand_chip *chip = mtd->priv;
31 + if (mtd->writesize == 512)
32 + chip->ecc.layout = &rb532_nand_ecclayout;
37 static void __init rb532_nand_setup(void)
39 switch (mips_machtype) {
40 @@ -299,6 +322,8 @@ static void __init rb532_nand_setup(void
41 rb532_nand_data.chip.partitions = rb532_partition_info;
42 rb532_nand_data.chip.chip_delay = NAND_CHIP_DELAY;
43 rb532_nand_data.chip.options = NAND_NO_AUTOINCR;
45 + rb532_nand_data.chip.chip_fixup = &rb532_nand_fixup;