aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2008-06-06 09:03:35 +0000
committerGabor Juhos <juhosg@openwrt.org>2008-06-06 09:03:35 +0000
commit8ffb975163f347b9c880cd547b55bbf294ab2553 (patch)
treef76c2fbb47f0ea3c947d6587e8057b669b92bfb4 /target
parentab145704b313a4b7e122a9eb3e1eeb00088ac3fe (diff)
downloadupstream-8ffb975163f347b9c880cd547b55bbf294ab2553.tar.gz
upstream-8ffb975163f347b9c880cd547b55bbf294ab2553.tar.bz2
upstream-8ffb975163f347b9c880cd547b55bbf294ab2553.zip
[adm5120] make use the chip_fixup function of the plat_nand driver
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11376 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c b/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c
index 48ea92f22b..48a7272afd 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c
@@ -213,6 +213,16 @@ static void __init rb1xx_mac_setup(void)
}
}
+static int rb1xx_nand_fixup(struct mtd_info *mtd)
+{
+ struct nand_chip *chip = mtd->priv;
+
+ if (mtd->writesize == 512)
+ chip->ecc.layout = &rb1xx_nand_ecclayout;
+
+ return 0;
+}
+
static void __init rb1xx_flash_setup(void)
{
/* setup data for flash0 device */
@@ -223,9 +233,10 @@ static void __init rb1xx_flash_setup(void)
adm5120_nand_data.chip.nr_chips = 1;
adm5120_nand_data.chip.nr_partitions = ARRAY_SIZE(rb1xx_nand_parts);
adm5120_nand_data.chip.partitions = rb1xx_nand_parts;
- adm5120_nand_data.chip.ecclayout = &rb1xx_nand_ecclayout;
adm5120_nand_data.chip.chip_delay = RB1XX_NAND_CHIP_DELAY;
adm5120_nand_data.chip.options = NAND_NO_AUTOINCR;
+
+ adm5120_nand_data.chip.chip_fixup = &rb1xx_nand_fixup;
}
static void __init rb1xx_setup(void)