summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2012-10-31 14:10:33 +0800
committerJason Liu <r64343@freescale.com>2012-10-31 20:14:28 +0800
commit44f110fbe83b5b3be2981cf988f72a9ec1cf7328 (patch)
tree1479ab49675b1dd3320ec3681287df6da9b313b8 /drivers
parent5549d1ea1ee31e9d20aafd78f01abd7d027cb516 (diff)
downloadu-boot-imx-44f110fbe83b5b3be2981cf988f72a9ec1cf7328.zip
u-boot-imx-44f110fbe83b5b3be2981cf988f72a9ec1cf7328.tar.gz
u-boot-imx-44f110fbe83b5b3be2981cf988f72a9ec1cf7328.tar.bz2
ENGR00231891-1 gpmi: replace the hardcode
We have get the right infomation when we call the set_geometry(). So we replace the hardcode with the proper gpmi_info's values. Signed-off-by: Huang Shijie <b32955@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/gpmi_nfc_hal.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/mtd/nand/gpmi_nfc_hal.c b/drivers/mtd/nand/gpmi_nfc_hal.c
index 5eac818..d4f8c09 100644
--- a/drivers/mtd/nand/gpmi_nfc_hal.c
+++ b/drivers/mtd/nand/gpmi_nfc_hal.c
@@ -225,16 +225,10 @@ static int set_geometry(struct mtd_info *mtd)
MTDDEBUG(MTD_DEBUG_LEVEL3, "%s =>\n", __func__);
/* Translate the abstract choices into register fields. */
- block_count = GPMI_NFC_ECC_CHUNK_CNT(mtd->writesize) - 1;
-#if defined(CONFIG_GPMI_NFC_V2)
- block_size = GPMI_NFC_CHUNK_DATA_CHUNK_SIZE >> 2;
-#else
- block_size = GPMI_NFC_CHUNK_DATA_CHUNK_SIZE;
-#endif
- metadata_size = GPMI_NFC_METADATA_SIZE;
-
+ block_count = gpmi_info->ecc_chunk_count - 1;
+ block_size = gpmi_info->ecc_chunk_size;
+ metadata_size = gpmi_info->metadata_size;
ecc_strength = gpmi_info->ecc_strength >> 1;
-
page_size = mtd->writesize + mtd->oobsize;
/*