aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/onenand
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/onenand')
-rw-r--r--drivers/mtd/onenand/onenand_base.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 33e0dbb0a96d..6b3a875647c9 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -3365,18 +3365,19 @@ static int onenand_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
3365static void onenand_check_features(struct mtd_info *mtd) 3365static void onenand_check_features(struct mtd_info *mtd)
3366{ 3366{
3367 struct onenand_chip *this = mtd->priv; 3367 struct onenand_chip *this = mtd->priv;
3368 unsigned int density, process; 3368 unsigned int density, process, numbufs;
3369 3369
3370 /* Lock scheme depends on density and process */ 3370 /* Lock scheme depends on density and process */
3371 density = onenand_get_density(this->device_id); 3371 density = onenand_get_density(this->device_id);
3372 process = this->version_id >> ONENAND_VERSION_PROCESS_SHIFT; 3372 process = this->version_id >> ONENAND_VERSION_PROCESS_SHIFT;
3373 numbufs = this->read_word(this->base + ONENAND_REG_NUM_BUFFERS) >> 8;
3373 3374
3374 /* Lock scheme */ 3375 /* Lock scheme */
3375 switch (density) { 3376 switch (density) {
3376 case ONENAND_DEVICE_DENSITY_4Gb: 3377 case ONENAND_DEVICE_DENSITY_4Gb:
3377 if (ONENAND_IS_DDP(this)) 3378 if (ONENAND_IS_DDP(this))
3378 this->options |= ONENAND_HAS_2PLANE; 3379 this->options |= ONENAND_HAS_2PLANE;
3379 else 3380 else if (numbufs == 1)
3380 this->options |= ONENAND_HAS_4KB_PAGE; 3381 this->options |= ONENAND_HAS_4KB_PAGE;
3381 3382
3382 case ONENAND_DEVICE_DENSITY_2Gb: 3383 case ONENAND_DEVICE_DENSITY_2Gb: