diff options
-rw-r--r-- | drivers/mtd/nand/fsl_elbc_nand.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index 7db573e9bf78..d29479abe504 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c | |||
@@ -166,15 +166,22 @@ static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob) | |||
166 | 166 | ||
167 | elbc_fcm_ctrl->page = page_addr; | 167 | elbc_fcm_ctrl->page = page_addr; |
168 | 168 | ||
169 | out_be32(&lbc->fbar, | ||
170 | page_addr >> (chip->phys_erase_shift - chip->page_shift)); | ||
171 | |||
172 | if (priv->page_size) { | 169 | if (priv->page_size) { |
170 | /* | ||
171 | * large page size chip : FPAR[PI] save the lowest 6 bits, | ||
172 | * FBAR[BLK] save the other bits. | ||
173 | */ | ||
174 | out_be32(&lbc->fbar, page_addr >> 6); | ||
173 | out_be32(&lbc->fpar, | 175 | out_be32(&lbc->fpar, |
174 | ((page_addr << FPAR_LP_PI_SHIFT) & FPAR_LP_PI) | | 176 | ((page_addr << FPAR_LP_PI_SHIFT) & FPAR_LP_PI) | |
175 | (oob ? FPAR_LP_MS : 0) | column); | 177 | (oob ? FPAR_LP_MS : 0) | column); |
176 | buf_num = (page_addr & 1) << 2; | 178 | buf_num = (page_addr & 1) << 2; |
177 | } else { | 179 | } else { |
180 | /* | ||
181 | * small page size chip : FPAR[PI] save the lowest 5 bits, | ||
182 | * FBAR[BLK] save the other bits. | ||
183 | */ | ||
184 | out_be32(&lbc->fbar, page_addr >> 5); | ||
178 | out_be32(&lbc->fpar, | 185 | out_be32(&lbc->fpar, |
179 | ((page_addr << FPAR_SP_PI_SHIFT) & FPAR_SP_PI) | | 186 | ((page_addr << FPAR_SP_PI_SHIFT) & FPAR_SP_PI) | |
180 | (oob ? FPAR_SP_MS : 0) | column); | 187 | (oob ? FPAR_SP_MS : 0) | column); |