comparison loadtools/ltflash.c @ 401:7ceeec049be4

fc-loadtool flash: bank configurations for CFI
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 15 Jun 2014 20:24:51 +0000
parents f027c6fbe37e
children
comparison
equal deleted inserted replaced
400:f027c6fbe37e 401:7ceeec049be4
58 static struct flash_bank_desc pl129n_banks[2] = { 58 static struct flash_bank_desc pl129n_banks[2] = {
59 {0x800000, &pl129n_ce1_hardcfi, pl129n_idcheck, 4}, 59 {0x800000, &pl129n_ce1_hardcfi, pl129n_idcheck, 4},
60 {0x800000, &pl129n_ce2_hardcfi, pl129n_idcheck, 4} 60 {0x800000, &pl129n_ce2_hardcfi, pl129n_idcheck, 4}
61 }; 61 };
62 62
63 /* bank configurations for CFI */
64
65 static struct flash_bank_desc cfi_4M_bankdesc = {
66 0x400000, 0, 0, 0
67 };
68
69 static struct flash_bank_desc cfi_8M_bankdesc = {
70 0x800000, 0, 0, 0
71 };
72
63 /* list of supported flash devices */ 73 /* list of supported flash devices */
64 74
65 struct flash_device_desc flash_device_list[] = { 75 struct flash_device_desc flash_device_list[] = {
76 {"cfi-4M", &cfi_4M_bankdesc, 1},
77 {"cfi-8M", &cfi_8M_bankdesc, 1},
66 {"k5a32xx_t", &k5a32xx_topboot_bankdesc, 1}, 78 {"k5a32xx_t", &k5a32xx_topboot_bankdesc, 1},
67 {"pl129n", pl129n_banks, 2}, 79 {"pl129n", pl129n_banks, 2},
68 {0, 0, 0} /* array terminator */ 80 {0, 0, 0} /* array terminator */
69 }; 81 };
70 82
275 if (flash_get_cfi(bank) < 0) 287 if (flash_get_cfi(bank) < 0)
276 return(-1); 288 return(-1);
277 printf("Bank %d total size: %lx\n", bank, (u_long) bi->cfi->total_size); 289 printf("Bank %d total size: %lx\n", bank, (u_long) bi->cfi->total_size);
278 printf("Sectors in bank %d: %u (%u regions)\n", bank, 290 printf("Sectors in bank %d: %u (%u regions)\n", bank,
279 bi->cfi->total_sectors, bi->cfi->nregions); 291 bi->cfi->total_sectors, bi->cfi->nregions);
292 printf("Command set style: %04X\n", bi->cfi->cmdset_style);
280 flash_id_check(bank, 1); 293 flash_id_check(bank, 1);
281 if (selected_flash_device->nbanks == 2 && !bank) 294 if (selected_flash_device->nbanks == 2 && !bank)
282 printf("\nFlash device has 2 banks; flash2 command available\n"); 295 printf("\nFlash device has 2 banks; flash2 command available\n");
283 return(0); 296 return(0);
284 } 297 }