Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274884
b: refs/heads/master
c: e1c1024
h: refs/heads/master
v: v3
  • Loading branch information
Kyungmin Park authored and Artem Bityutskiy committed Sep 11, 2011
1 parent 7c4443f commit 373a93e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b2a5a4878e97119e3b64d4646fd138820d513c28
refs/heads/master: e1c10243df92822954b9b5e04d12dd2f23a39652
15 changes: 15 additions & 0 deletions trunk/drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -3429,6 +3429,19 @@ static void onenand_check_features(struct mtd_info *mtd)
else if (numbufs == 1) {
this->options |= ONENAND_HAS_4KB_PAGE;
this->options |= ONENAND_HAS_CACHE_PROGRAM;
/*
* There are two different 4KiB pagesize chips
* and no way to detect it by H/W config values.
*
* To detect the correct NOP for each chips,
* It should check the version ID as workaround.
*
* Now it has as following
* KFM4G16Q4M has NOP 4 with version ID 0x0131
* KFM4G16Q5M has NOP 1 with versoin ID 0x013e
*/
if ((this->version_id & 0xf) == 0xe)
this->options |= ONENAND_HAS_NOP_1;
}

case ONENAND_DEVICE_DENSITY_2Gb:
Expand Down Expand Up @@ -4054,6 +4067,8 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
this->ecclayout = &onenand_oob_128;
mtd->subpage_sft = 2;
}
if (ONENAND_IS_NOP_1(this))
mtd->subpage_sft = 0;
break;
case 64:
this->ecclayout = &onenand_oob_64;
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/mtd/onenand.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ struct onenand_chip {
#define ONENAND_IS_CACHE_PROGRAM(this) \
(this->options & ONENAND_HAS_CACHE_PROGRAM)

#define ONENAND_IS_NOP_1(this) \
(this->options & ONENAND_HAS_NOP_1)

/* Check byte access in OneNAND */
#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)

Expand All @@ -195,6 +198,7 @@ struct onenand_chip {
#define ONENAND_HAS_2PLANE (0x0004)
#define ONENAND_HAS_4KB_PAGE (0x0008)
#define ONENAND_HAS_CACHE_PROGRAM (0x0010)
#define ONENAND_HAS_NOP_1 (0x0020)
#define ONENAND_SKIP_UNLOCK_CHECK (0x0100)
#define ONENAND_PAGEBUF_ALLOC (0x1000)
#define ONENAND_OOBBUF_ALLOC (0x2000)
Expand Down

0 comments on commit 373a93e

Please sign in to comment.