summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2012-10-31 14:10:33 +0800
committerHuang Shijie <b32955@freescale.com>2012-10-31 18:24:46 +0800
commit711e63c61114c9a692796348e4a54770dec19cc8 (patch)
treeb245db24436b03dbe96a4d0851879407f27a3fd2 /drivers
parent6283d8b65ebcfdbac21afbb040cd4616218f40ea (diff)
downloadu-boot-imx-711e63c61114c9a692796348e4a54770dec19cc8.zip
u-boot-imx-711e63c61114c9a692796348e4a54770dec19cc8.tar.gz
u-boot-imx-711e63c61114c9a692796348e4a54770dec19cc8.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;
/*