diff options
-rw-r--r-- | drivers/mtd/onenand/onenand_base.c | 21 | ||||
-rw-r--r-- | include/linux/mtd/onenand.h | 2 | ||||
-rw-r--r-- | include/linux/mtd/onenand_regs.h | 3 |
3 files changed, 12 insertions, 14 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 | */ |
1820 | static void onenand_lock_scheme(struct mtd_info *mtd) | 1817 | static 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 | } |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index a99b2944d26b..60b3534de74d 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/mtd/onenand.h | 2 | * linux/include/linux/mtd/onenand.h |
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 |
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index 5b46cb52d214..af94719890e7 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
@@ -3,7 +3,8 @@ | |||
3 | * | 3 | * |
4 | * OneNAND Register header file | 4 | * OneNAND Register header file |
5 | * | 5 | * |
6 | * Copyright (C) 2005-2006 Samsung Electronics | 6 | * Copyright (C) 2005-2007 Samsung Electronics |
7 | * Kyungmin Park <kyungmin.park@samsung.com> | ||
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |