FreeCalypso > hg > freecalypso-tools
comparison loadtools/fldevs.c @ 976:ff4ce8d5ece4
fc-loadtool flash: definitions for AMD sector lock architecture
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 01 Dec 2023 06:43:21 +0000 |
parents | 7c18eac91457 |
children | a400bb4a1620 |
comparison
equal
deleted
inserted
replaced
975:343552c6c621 | 976:ff4ce8d5ece4 |
---|---|
314 {0x40, 'P'}, | 314 {0x40, 'P'}, |
315 {0x41, 'R'}, | 315 {0x41, 'R'}, |
316 {0x42, 'I'}, | 316 {0x42, 'I'}, |
317 {0x43, '1'}, | 317 {0x43, '1'}, |
318 {0x44, '3'}, | 318 {0x44, '3'}, |
319 {-1, 0} | 319 {0x49, 0x04}, |
320 {-1, 0} | |
321 }; | |
322 | |
323 static struct amd_lock_info Am29DL640G_lock_info = { | |
324 .ngroups = 8, | |
325 .groups = { | |
326 {0x2000, 8, 0, 1, 0}, | |
327 {0x10000, 3, 0, 0, 0}, | |
328 {0x40000, 3, 1, 0, 1}, | |
329 {0x40000, 12, 1, 1, 1}, | |
330 {0x40000, 12, 1, 1, 1}, | |
331 {0x40000, 3, 1, 1, 0}, | |
332 {0x10000, 3, 0, 0, 0}, | |
333 {0x2000, 8, 0, 0, 1}}, | |
334 .have_status_word_3 = 1, | |
320 }; | 335 }; |
321 | 336 |
322 struct flash_device flashdev_Am29DL640G = { | 337 struct flash_device flashdev_Am29DL640G = { |
323 .name = "Am29DL640G", | 338 .name = "Am29DL640G", |
324 .cfi_table = Am29DL640G_cfi, | 339 .cfi_table = Am29DL640G_cfi, |
325 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_8M, | 340 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_8M, |
326 .bank_geom = {&geom_8M_bothends, 0}, | 341 .bank_geom = {&geom_8M_bothends, 0}, |
327 .cmdset = &flash_cmdset_amd, | 342 .cmdset = &flash_cmdset_amd, |
343 .lock_info = {&Am29DL640G_lock_info, 0}, | |
328 }; | 344 }; |
329 | 345 |
330 /* Spansion S71PL-J and S71PL-N flash */ | 346 /* Spansion S71PL-J and S71PL-N flash */ |
331 | 347 |
332 static struct cfi_check spansion_PL032J_cfi[] = { | 348 static struct cfi_check spansion_PL032J_cfi[] = { |
365 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_4M, | 381 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_4M, |
366 .bank_geom = {&geom_4M_bothends, 0}, | 382 .bank_geom = {&geom_4M_bothends, 0}, |
367 .cmdset = &flash_cmdset_amd, | 383 .cmdset = &flash_cmdset_amd, |
368 }; | 384 }; |
369 | 385 |
370 /* S29PL064J/S71PL064J is identical to Am29DL640G covered above */ | 386 /* |
371 | 387 * For our purposes, S29PL064J/S71PL064J differs from Am29DL640G only |
372 static struct cfi_check spansion_PL129J_cfi[] = { | 388 * in terms of lock status retrieval and manipulation: the older chip |
389 * lacks persistent/password mode lock bits and in-system lock/unlock | |
390 * operations. We distinguish them by one byte in CFI. | |
391 */ | |
392 | |
393 static struct cfi_check spansion_PL064J_cfi[] = { | |
373 {0x10, 'Q'}, | 394 {0x10, 'Q'}, |
374 {0x11, 'R'}, | 395 {0x11, 'R'}, |
375 {0x12, 'Y'}, | 396 {0x12, 'Y'}, |
376 {0x13, 0x02}, | 397 {0x13, 0x02}, |
377 {0x14, 0x00}, | 398 {0x14, 0x00}, |
378 {0x15, 0x40}, | 399 {0x15, 0x40}, |
379 {0x16, 0x00}, | 400 {0x16, 0x00}, |
380 {0x27, 0x18}, | 401 {0x27, 0x17}, |
381 {0x2C, 0x03}, | 402 {0x2C, 0x03}, |
382 {0x2D, 0x07}, | 403 {0x2D, 0x07}, |
383 {0x2E, 0x00}, | 404 {0x2E, 0x00}, |
384 {0x2F, 0x20}, | 405 {0x2F, 0x20}, |
385 {0x30, 0x00}, | 406 {0x30, 0x00}, |
386 {0x31, 0xFD}, | 407 {0x31, 0x7D}, |
387 {0x32, 0x00}, | 408 {0x32, 0x00}, |
388 {0x33, 0x00}, | 409 {0x33, 0x00}, |
389 {0x34, 0x01}, | 410 {0x34, 0x01}, |
390 {0x35, 0x07}, | 411 {0x35, 0x07}, |
391 {0x36, 0x00}, | 412 {0x36, 0x00}, |
394 {0x40, 'P'}, | 415 {0x40, 'P'}, |
395 {0x41, 'R'}, | 416 {0x41, 'R'}, |
396 {0x42, 'I'}, | 417 {0x42, 'I'}, |
397 {0x43, '1'}, | 418 {0x43, '1'}, |
398 {0x44, '3'}, | 419 {0x44, '3'}, |
399 {-1, 0} | 420 {0x49, 0x07}, |
421 {-1, 0} | |
422 }; | |
423 | |
424 static struct amd_lock_info PL064J_lock_info = { | |
425 .ngroups = 8, | |
426 .groups = { | |
427 {0x2000, 8, 0, 1, 0}, | |
428 {0x10000, 3, 0, 0, 0}, | |
429 {0x40000, 3, 1, 0, 1}, | |
430 {0x40000, 12, 1, 1, 1}, | |
431 {0x40000, 12, 1, 1, 1}, | |
432 {0x40000, 3, 1, 1, 0}, | |
433 {0x10000, 3, 0, 0, 0}, | |
434 {0x2000, 8, 0, 0, 1}}, | |
435 .have_status_word_3 = 1, | |
436 .have_mode_lock_bits = 1, | |
437 }; | |
438 | |
439 struct flash_device flashdev_PL064J = { | |
440 .name = "Spansion S29PL064J", | |
441 .cfi_table = spansion_PL064J_cfi, | |
442 .required_global_config = FLASH_GLOBAL_CFG_SINGLE_8M, | |
443 .bank_geom = {&geom_8M_bothends, 0}, | |
444 .cmdset = &flash_cmdset_amd, | |
445 .lock_info = {&PL064J_lock_info, 0}, | |
446 }; | |
447 | |
448 static struct cfi_check spansion_PL129J_cfi[] = { | |
449 {0x10, 'Q'}, | |
450 {0x11, 'R'}, | |
451 {0x12, 'Y'}, | |
452 {0x13, 0x02}, | |
453 {0x14, 0x00}, | |
454 {0x15, 0x40}, | |
455 {0x16, 0x00}, | |
456 {0x27, 0x18}, | |
457 {0x2C, 0x03}, | |
458 {0x2D, 0x07}, | |
459 {0x2E, 0x00}, | |
460 {0x2F, 0x20}, | |
461 {0x30, 0x00}, | |
462 {0x31, 0xFD}, | |
463 {0x32, 0x00}, | |
464 {0x33, 0x00}, | |
465 {0x34, 0x01}, | |
466 {0x35, 0x07}, | |
467 {0x36, 0x00}, | |
468 {0x37, 0x20}, | |
469 {0x38, 0x00}, | |
470 {0x40, 'P'}, | |
471 {0x41, 'R'}, | |
472 {0x42, 'I'}, | |
473 {0x43, '1'}, | |
474 {0x44, '3'}, | |
475 {-1, 0} | |
476 }; | |
477 | |
478 static struct amd_lock_info PL129J_lock_info_0 = { | |
479 .ngroups = 4, | |
480 .groups = { | |
481 {0x2000, 8, 0, 1, 0}, | |
482 {0x10000, 3, 0, 0, 0}, | |
483 {0x40000, 7, 1, 0, 1}, | |
484 {0x40000, 24, 1, 1, 1}}, | |
485 .have_status_word_3 = 1, | |
486 .have_mode_lock_bits = 1, | |
487 }; | |
488 | |
489 static struct amd_lock_info PL129J_lock_info_1 = { | |
490 .ngroups = 4, | |
491 .groups = { | |
492 {0x40000, 24, 1, 1, 1}, | |
493 {0x40000, 7, 1, 1, 0}, | |
494 {0x10000, 3, 0, 0, 0}, | |
495 {0x2000, 8, 0, 0, 1}}, | |
496 .have_status_word_3 = 1, | |
497 .have_mode_lock_bits = 1, | |
400 }; | 498 }; |
401 | 499 |
402 struct flash_device flashdev_PL129J = { | 500 struct flash_device flashdev_PL129J = { |
403 .name = "Spansion S29PL129J", | 501 .name = "Spansion S29PL129J", |
404 .cfi_table = spansion_PL129J_cfi, | 502 .cfi_table = spansion_PL129J_cfi, |
405 .required_global_config = FLASH_GLOBAL_CFG_DUAL_8M, | 503 .required_global_config = FLASH_GLOBAL_CFG_DUAL_8M, |
406 .bank_geom = {&geom_8M_bottomboot, &geom_8M_topboot}, | 504 .bank_geom = {&geom_8M_bottomboot, &geom_8M_topboot}, |
407 .cmdset = &flash_cmdset_amd, | 505 .cmdset = &flash_cmdset_amd, |
506 .lock_info = {&PL129J_lock_info_0, &PL129J_lock_info_1}, | |
408 }; | 507 }; |
409 | 508 |
410 static struct cfi_check spansion_PL129N_cfi[] = { | 509 static struct cfi_check spansion_PL129N_cfi[] = { |
411 {0x10, 'Q'}, | 510 {0x10, 'Q'}, |
412 {0x11, 'R'}, | 511 {0x11, 'R'}, |
435 {0x43, '1'}, | 534 {0x43, '1'}, |
436 {0x44, '4'}, | 535 {0x44, '4'}, |
437 {-1, 0} | 536 {-1, 0} |
438 }; | 537 }; |
439 | 538 |
539 static struct amd_lock_info PL129N_lock_info_0 = { | |
540 .ngroups = 3, | |
541 .groups = { | |
542 {0x10000, 4, 0, 1, 0}, | |
543 {0x40000, 7, 1, 0, 1}, | |
544 {0x40000, 24, 1, 1, 1}}, | |
545 .have_status_word_3 = 1, | |
546 .have_pln_lock_reg = 1, | |
547 }; | |
548 | |
549 static struct amd_lock_info PL129N_lock_info_1 = { | |
550 .ngroups = 3, | |
551 .groups = { | |
552 {0x40000, 24, 1, 1, 1}, | |
553 {0x40000, 7, 1, 1, 0}, | |
554 {0x10000, 4, 0, 0, 1}}, | |
555 .have_status_word_3 = 1, | |
556 .have_pln_lock_reg = 1, | |
557 }; | |
558 | |
440 struct flash_device flashdev_PL129N = { | 559 struct flash_device flashdev_PL129N = { |
441 .name = "Spansion S29PL129N", | 560 .name = "Spansion S29PL129N", |
442 .cfi_table = spansion_PL129N_cfi, | 561 .cfi_table = spansion_PL129N_cfi, |
443 .required_global_config = FLASH_GLOBAL_CFG_DUAL_8M, | 562 .required_global_config = FLASH_GLOBAL_CFG_DUAL_8M, |
444 .bank_geom = {&geom_8M_bottomboot_big, | 563 .bank_geom = {&geom_8M_bottomboot_big, |
445 &geom_8M_topboot_big}, | 564 &geom_8M_topboot_big}, |
446 .cmdset = &flash_cmdset_amd, | 565 .cmdset = &flash_cmdset_amd, |
566 .lock_info = {&PL129N_lock_info_0, &PL129N_lock_info_1}, | |
447 }; | 567 }; |
448 | 568 |
449 /* Samsung K5A32xxCTM introduced onto the scene by Openmoko */ | 569 /* Samsung K5A32xxCTM introduced onto the scene by Openmoko */ |
450 | 570 |
451 static struct cfi_check samsung_4M_topboot_cfi[] = { | 571 static struct cfi_check samsung_4M_topboot_cfi[] = { |
555 {0x44, '0'}, | 675 {0x44, '0'}, |
556 {0x4F, 0x04}, | 676 {0x4F, 0x04}, |
557 {-1, 0} | 677 {-1, 0} |
558 }; | 678 }; |
559 | 679 |
680 static struct amd_lock_info K5L29_lock_info_0 = { | |
681 .ngroups = 4, | |
682 .groups = { | |
683 {0x2000, 8, 0, 1, 0}, | |
684 {0x10000, 3, 0, 0, 0}, | |
685 {0x40000, 7, 1, 0, 1}, | |
686 {0x40000, 24, 1, 1, 1}}, | |
687 .have_status_word_3 = 1, | |
688 .have_status_word_7 = 1, | |
689 .have_mode_lock_bits = 1, | |
690 }; | |
691 | |
692 static struct amd_lock_info K5L29_lock_info_1 = { | |
693 .ngroups = 4, | |
694 .groups = { | |
695 {0x40000, 24, 1, 1, 1}, | |
696 {0x40000, 7, 1, 1, 0}, | |
697 {0x10000, 3, 0, 0, 0}, | |
698 {0x2000, 8, 0, 0, 1}}, | |
699 .have_status_word_3 = 1, | |
700 .have_status_word_7 = 1, | |
701 .have_mode_lock_bits = 1, | |
702 }; | |
703 | |
560 struct flash_device flashdev_K5L29xx_A = { | 704 struct flash_device flashdev_K5L29xx_A = { |
561 .name = "Samsung K5L29xx_A", | 705 .name = "Samsung K5L29xx_A", |
562 .cfi_table = samsung_PL129J_equiv_cfi, | 706 .cfi_table = samsung_PL129J_equiv_cfi, |
563 .required_global_config = FLASH_GLOBAL_CFG_DUAL_8M, | 707 .required_global_config = FLASH_GLOBAL_CFG_DUAL_8M, |
564 .bank_geom = {&geom_8M_bottomboot, &geom_8M_topboot}, | 708 .bank_geom = {&geom_8M_bottomboot, &geom_8M_topboot}, |
565 .cmdset = &flash_cmdset_amd, | 709 .cmdset = &flash_cmdset_amd, |
566 }; | 710 .lock_info = {&K5L29_lock_info_0, &K5L29_lock_info_1}, |
711 }; |