aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/onenand/onenand_base.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index d88c7f7fc619..0ade23749ee1 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/drivers/mtd/onenand/onenand_base.c 2 * linux/drivers/mtd/onenand/onenand_base.c
3 * 3 *
4 * Copyright (C) 2005-2006 Samsung Electronics 4 * Copyright (C) 2005-2007 Samsung Electronics
5 * Kyungmin Park <kyungmin.park@samsung.com> 5 * Kyungmin Park <kyungmin.park@samsung.com>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -581,8 +581,7 @@ static int onenand_check_bufferram(struct mtd_info *mtd, loff_t addr)
581 int i; 581 int i;
582 582
583 block = (int) (addr >> this->erase_shift); 583 block = (int) (addr >> this->erase_shift);
584 page = (int) (addr >> this->page_shift); 584 page = (int) (addr >> this->page_shift) & this->page_mask;
585 page &= this->page_mask;
586 585
587 i = ONENAND_CURRENT_BUFFERRAM(this); 586 i = ONENAND_CURRENT_BUFFERRAM(this);
588 587
@@ -611,8 +610,7 @@ static int onenand_update_bufferram(struct mtd_info *mtd, loff_t addr,
611 int i; 610 int i;
612 611
613 block = (int) (addr >> this->erase_shift); 612 block = (int) (addr >> this->erase_shift);
614 page = (int) (addr >> this->page_shift); 613 page = (int) (addr >> this->page_shift) & this->page_mask;
615 page &= this->page_mask;
616 614
617 /* Invalidate BufferRAM */ 615 /* Invalidate BufferRAM */
618 for (i = 0; i < MAX_BUFFERRAM; i++) { 616 for (i = 0; i < MAX_BUFFERRAM; i++) {
@@ -714,8 +712,6 @@ static int onenand_read(struct mtd_info *mtd, loff_t from, size_t len,
714 /* Grab the lock and see if the device is available */ 712 /* Grab the lock and see if the device is available */
715 onenand_get_device(mtd, FL_READING); 713 onenand_get_device(mtd, FL_READING);
716 714
717 /* TODO handling oob */
718
719 stats = mtd->ecc_stats; 715 stats = mtd->ecc_stats;
720 716
721 /* Read-while-load method */ 717 /* Read-while-load method */
@@ -1812,12 +1808,13 @@ static int onenand_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
1812#endif /* CONFIG_MTD_ONENAND_OTP */ 1808#endif /* CONFIG_MTD_ONENAND_OTP */
1813 1809
1814/** 1810/**
1815 * onenand_lock_scheme - Check and set OneNAND lock scheme 1811 * onenand_check_features - Check and set OneNAND features
1816 * @param mtd MTD data structure 1812 * @param mtd MTD data structure
1817 * 1813 *
1818 * Check and set OneNAND lock scheme 1814 * Check and set OneNAND features
1815 * - lock scheme
1819 */ 1816 */
1820static void onenand_lock_scheme(struct mtd_info *mtd) 1817static void onenand_check_features(struct mtd_info *mtd)
1821{ 1818{
1822 struct onenand_chip *this = mtd->priv; 1819 struct onenand_chip *this = mtd->priv;
1823 unsigned int density, process; 1820 unsigned int density, process;
@@ -1971,8 +1968,8 @@ static int onenand_probe(struct mtd_info *mtd)
1971 1968
1972 mtd->size = this->chipsize; 1969 mtd->size = this->chipsize;
1973 1970
1974 /* Check OneNAND lock scheme */ 1971 /* Check OneNAND features */
1975 onenand_lock_scheme(mtd); 1972 onenand_check_features(mtd);
1976 1973
1977 return 0; 1974 return 0;
1978} 1975}