comparison loadtools/fldevs.c @ 979:c5133c3c11b1

fc-loadtool flash: implement PL-J PPB programming functions
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 02 Dec 2023 04:21:59 +0000
parents a400bb4a1620
children 0a4d19aab608
comparison
equal deleted inserted replaced
978:a400bb4a1620 979:c5133c3c11b1
6 #include "flash.h" 6 #include "flash.h"
7 7
8 extern struct flash_cmdset flash_cmdset_amd; 8 extern struct flash_cmdset flash_cmdset_amd;
9 extern struct flash_cmdset flash_cmdset_intel; 9 extern struct flash_cmdset flash_cmdset_intel;
10 extern struct flash_cmdset flash_cmdset_intel_w30; 10 extern struct flash_cmdset flash_cmdset_intel_w30;
11
12 extern int plj_ppb_program_one();
13 extern int plj_ppb_program_all_single();
14 extern int plj_ppb_program_all_dualbank();
15 extern int plj_ppb_erase_all_single();
16 extern int plj_ppb_erase_all_dualbank();
11 17
12 /* flash bank geometries */ 18 /* flash bank geometries */
13 19
14 static struct flash_geom geom_2M_topboot = { 20 static struct flash_geom geom_2M_topboot = {
15 .total_size = 0x200000, 21 .total_size = 0x200000,
432 {0x40000, 3, 1, 1, 0}, 438 {0x40000, 3, 1, 1, 0},
433 {0x10000, 3, 0, 0, 0}, 439 {0x10000, 3, 0, 0, 0},
434 {0x2000, 8, 0, 0, 1}}, 440 {0x2000, 8, 0, 0, 1}},
435 .have_status_word_3 = 1, 441 .have_status_word_3 = 1,
436 .have_mode_lock_bits = 1, 442 .have_mode_lock_bits = 1,
443 .ppb_program_one = plj_ppb_program_one,
444 .ppb_program_all = plj_ppb_program_all_single,
445 .ppb_erase_all = plj_ppb_erase_all_single,
437 }; 446 };
438 447
439 struct flash_device flashdev_PL064J = { 448 struct flash_device flashdev_PL064J = {
440 .name = "Spansion S29PL064J", 449 .name = "Spansion S29PL064J",
441 .cfi_table = spansion_PL064J_cfi, 450 .cfi_table = spansion_PL064J_cfi,
482 {0x10000, 3, 0, 0, 0}, 491 {0x10000, 3, 0, 0, 0},
483 {0x40000, 7, 1, 0, 1}, 492 {0x40000, 7, 1, 0, 1},
484 {0x40000, 24, 1, 1, 1}}, 493 {0x40000, 24, 1, 1, 1}},
485 .have_status_word_3 = 1, 494 .have_status_word_3 = 1,
486 .have_mode_lock_bits = 1, 495 .have_mode_lock_bits = 1,
496 .ppb_program_one = plj_ppb_program_one,
497 .ppb_program_all = plj_ppb_program_all_dualbank,
498 .ppb_erase_all = plj_ppb_erase_all_dualbank,
487 }; 499 };
488 500
489 static struct amd_lock_info PL129J_lock_info_1 = { 501 static struct amd_lock_info PL129J_lock_info_1 = {
490 .ngroups = 4, 502 .ngroups = 4,
491 .groups = { 503 .groups = {
492 {0x40000, 24, 1, 1, 1}, 504 {0x40000, 24, 1, 1, 1},
493 {0x40000, 7, 1, 1, 0}, 505 {0x40000, 7, 1, 1, 0},
494 {0x10000, 3, 0, 0, 0}, 506 {0x10000, 3, 0, 0, 0},
495 {0x2000, 8, 0, 0, 1}}, 507 {0x2000, 8, 0, 0, 1}},
496 .have_status_word_3 = 1, 508 .have_status_word_3 = 1,
509 .ppb_program_one = plj_ppb_program_one,
510 .ppb_program_all = plj_ppb_program_all_dualbank,
511 .ppb_erase_all = plj_ppb_erase_all_dualbank,
497 }; 512 };
498 513
499 struct flash_device flashdev_PL129J = { 514 struct flash_device flashdev_PL129J = {
500 .name = "Spansion S29PL129J", 515 .name = "Spansion S29PL129J",
501 .cfi_table = spansion_PL129J_cfi, 516 .cfi_table = spansion_PL129J_cfi,
683 {0x40000, 7, 1, 0, 1}, 698 {0x40000, 7, 1, 0, 1},
684 {0x40000, 24, 1, 1, 1}}, 699 {0x40000, 24, 1, 1, 1}},
685 .have_status_word_3 = 1, 700 .have_status_word_3 = 1,
686 .have_status_word_7 = 1, 701 .have_status_word_7 = 1,
687 .have_mode_lock_bits = 1, 702 .have_mode_lock_bits = 1,
703 .ppb_program_one = plj_ppb_program_one,
704 .ppb_program_all = plj_ppb_program_all_dualbank,
705 .ppb_erase_all = plj_ppb_erase_all_dualbank,
688 }; 706 };
689 707
690 static struct amd_lock_info K5L29_lock_info_1 = { 708 static struct amd_lock_info K5L29_lock_info_1 = {
691 .ngroups = 4, 709 .ngroups = 4,
692 .groups = { 710 .groups = {
694 {0x40000, 7, 1, 1, 0}, 712 {0x40000, 7, 1, 1, 0},
695 {0x10000, 3, 0, 0, 0}, 713 {0x10000, 3, 0, 0, 0},
696 {0x2000, 8, 0, 0, 1}}, 714 {0x2000, 8, 0, 0, 1}},
697 .have_status_word_3 = 1, 715 .have_status_word_3 = 1,
698 .have_status_word_7 = 1, 716 .have_status_word_7 = 1,
717 .ppb_program_one = plj_ppb_program_one,
718 .ppb_program_all = plj_ppb_program_all_dualbank,
719 .ppb_erase_all = plj_ppb_erase_all_dualbank,
699 }; 720 };
700 721
701 struct flash_device flashdev_K5L29xx_A = { 722 struct flash_device flashdev_K5L29xx_A = {
702 .name = "Samsung K5L29xx_A", 723 .name = "Samsung K5L29xx_A",
703 .cfi_table = samsung_PL129J_equiv_cfi, 724 .cfi_table = samsung_PL129J_equiv_cfi,