Changeset 1420
- Timestamp:
- 08/26/11 00:44:11 (9 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
82802ab.c (modified) (1 diff)
-
chipdrivers.h (modified) (1 diff)
-
flashchips.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/82802ab.c
r1397 r1420 209 209 return 0; 210 210 } 211 212 int unlock_lh28f008bjt(struct flashchip *flash) 213 { 214 chipaddr bios = flash->virtual_memory; 215 uint8_t mcfg, bcfg; 216 uint8_t need_unlock = 0, can_unlock = 0; 217 int i; 218 219 /* Wait if chip is busy */ 220 wait_82802ab(flash); 221 222 /* Read identifier codes */ 223 chip_writeb(0x90, bios); 224 225 /* Read master lock-bit */ 226 mcfg = chip_readb(bios + 0x3); 227 msg_cdbg("master lock is "); 228 if (mcfg) { 229 msg_cdbg("locked!\n"); 230 } else { 231 msg_cdbg("unlocked!\n"); 232 can_unlock = 1; 233 } 234 235 /* Read block lock-bits, 8 * 8 KB + 15 * 64 KB */ 236 for (i = 0; i < flash->total_size * 1024; 237 i += (i >= (64 * 1024) ? 64 * 1024 : 8 * 1024)) { 238 bcfg = chip_readb(bios + i + 2); /* read block lock config */ 239 msg_cdbg("block lock at %06x is %slocked!\n", i, 240 bcfg ? "" : "un"); 241 if (bcfg) 242 need_unlock = 1; 243 } 244 245 /* Reset chip */ 246 chip_writeb(0xFF, bios); 247 248 /* Unlock: clear block lock-bits, if needed */ 249 if (can_unlock && need_unlock) { 250 msg_cdbg("Unlock: "); 251 chip_writeb(0x60, bios); 252 chip_writeb(0xD0, bios); 253 chip_writeb(0xFF, bios); 254 wait_82802ab(flash); 255 msg_cdbg("Done!\n"); 256 } 257 258 /* Error: master locked or a block is locked */ 259 if (!can_unlock && need_unlock) { 260 msg_cerr("At least one block is locked and lockdown is active!\n"); 261 return -1; 262 } 263 264 return 0; 265 } -
trunk/chipdrivers.h
r1414 r1420 86 86 int unlock_82802ab(struct flashchip *flash); 87 87 int unlock_28f004s5(struct flashchip *flash); 88 int unlock_lh28f008bjt(struct flashchip *flash); 88 89 89 90 /* jedec.c */ -
trunk/flashchips.c
r1415 r1420 5380 5380 { 5381 5381 .vendor = "Sharp", 5382 .name = "LH28F008BJT-BTLZ1", 5383 .bustype = BUS_PARALLEL, 5384 .manufacture_id = SHARP_ID, 5385 .model_id = SHARP_LH28F008BJxxPB, 5386 .total_size = 1024, 5387 .page_size = 64 * 1024, 5388 .tested = TEST_OK_PREW, 5389 .probe = probe_82802ab, 5390 .probe_timing = TIMING_ZERO, 5391 .block_erasers = 5392 { 5393 { 5394 .eraseblocks = { 5395 {8 * 1024, 8}, 5396 {64 * 1024, 15} 5397 }, 5398 .block_erase = erase_block_82802ab, 5399 }, { 5400 .eraseblocks = { {1024 * 1024, 1} }, 5401 .block_erase = erase_sector_49lfxxxc, 5402 } 5403 }, 5404 .unlock = unlock_lh28f008bjt, 5405 .write = write_82802ab, 5406 .read = read_memmapped, 5407 .voltage = {2700, 3600}, 5408 }, 5409 5410 { 5411 .vendor = "Sharp", 5382 5412 .name = "LHF00L04", 5383 5413 .bustype = BUS_FWH, /* A/A Mux */
Note: See TracChangeset
for help on using the changeset viewer.
