diff options
author | Nicolas Pitre <nico@cam.org> | 2005-02-04 21:06:19 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-05-23 06:22:37 -0400 |
commit | 72b56a2d7dccd9ea90f34f6ddb653086a3f3bd2e (patch) | |
tree | 262d070609b8aa3cc7be5a3469b3ab54039b5788 | |
parent | 322b12eb57db8cc598ccedfb85fcf2faded08473 (diff) |
[MTD] Add OTP basisc
add structure definition for OTP region info
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0001.c | 8 | ||||
-rw-r--r-- | include/linux/mtd/cfi.h | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index c268bcd71720..c630d7532f7a 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * (C) 2000 Red Hat. GPL'd | 5 | * (C) 2000 Red Hat. GPL'd |
6 | * | 6 | * |
7 | * $Id: cfi_cmdset_0001.c,v 1.164 2004/11/16 18:29:00 dwmw2 Exp $ | 7 | * $Id: cfi_cmdset_0001.c,v 1.165 2005/02/05 02:06:15 nico Exp $ |
8 | * | 8 | * |
9 | * | 9 | * |
10 | * 10/10/2000 Nicolas Pitre <nico@cam.org> | 10 | * 10/10/2000 Nicolas Pitre <nico@cam.org> |
@@ -252,7 +252,8 @@ read_pri_intelext(struct map_info *map, __u16 adr) | |||
252 | int nb_parts, i; | 252 | int nb_parts, i; |
253 | 253 | ||
254 | /* Protection Register info */ | 254 | /* Protection Register info */ |
255 | extra_size += (extp->NumProtectionFields - 1) * (4 + 6); | 255 | extra_size += (extp->NumProtectionFields - 1) * |
256 | sizeof(struct cfi_intelext_otpinfo); | ||
256 | 257 | ||
257 | /* Burst Read info */ | 258 | /* Burst Read info */ |
258 | extra_size += 6; | 259 | extra_size += 6; |
@@ -471,7 +472,8 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd, | |||
471 | int offs, numregions, numparts, partshift, numvirtchips, i, j; | 472 | int offs, numregions, numparts, partshift, numvirtchips, i, j; |
472 | 473 | ||
473 | /* Protection Register info */ | 474 | /* Protection Register info */ |
474 | offs = (extp->NumProtectionFields - 1) * (4 + 6); | 475 | offs = (extp->NumProtectionFields - 1) * |
476 | sizeof(struct cfi_intelext_otpinfo); | ||
475 | 477 | ||
476 | /* Burst Read info */ | 478 | /* Burst Read info */ |
477 | offs += 6; | 479 | offs += 6; |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index 2ed8c585021e..d87dc3fbd4ba 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
@@ -1,7 +1,7 @@ | |||
1 | 1 | ||
2 | /* Common Flash Interface structures | 2 | /* Common Flash Interface structures |
3 | * See http://support.intel.com/design/flash/technote/index.htm | 3 | * See http://support.intel.com/design/flash/technote/index.htm |
4 | * $Id: cfi.h,v 1.50 2004/11/20 12:46:51 dwmw2 Exp $ | 4 | * $Id: cfi.h,v 1.51 2005/02/05 02:06:16 nico Exp $ |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #ifndef __MTD_CFI_H__ | 7 | #ifndef __MTD_CFI_H__ |
@@ -148,6 +148,14 @@ struct cfi_pri_intelext { | |||
148 | uint8_t extra[0]; | 148 | uint8_t extra[0]; |
149 | } __attribute__((packed)); | 149 | } __attribute__((packed)); |
150 | 150 | ||
151 | struct cfi_intelext_otpinfo { | ||
152 | uint32_t ProtRegAddr; | ||
153 | uint16_t FactGroups; | ||
154 | uint8_t FactProtRegSize; | ||
155 | uint16_t UserGroups; | ||
156 | uint8_t UserProtRegSize; | ||
157 | } __attribute__((packed)); | ||
158 | |||
151 | struct cfi_intelext_blockinfo { | 159 | struct cfi_intelext_blockinfo { |
152 | uint16_t NumIdentBlocks; | 160 | uint16_t NumIdentBlocks; |
153 | uint16_t BlockSize; | 161 | uint16_t BlockSize; |