Lines Matching full:bank

35  * the syntax is B:SF[-SL], where B is the bank number, SF is the first
37 * bank numbers start at 1 to be consistent with other specs, sector numbers
45 * or an invalid flash bank.
51 int bank, first, last; in abbrev_spec() local
58 bank = simple_strtoul (str, &ep, 10); in abbrev_spec()
60 bank < 1 || bank > CONFIG_SYS_MAX_FLASH_BANKS || in abbrev_spec()
61 (fp = &flash_info[bank - 1])->flash_id == FLASH_UNKNOWN) in abbrev_spec()
94 ulong bank, sector_end_addr; in flash_sect_roundb() local
100 for (bank = 0; bank < CONFIG_SYS_MAX_FLASH_BANKS && !found; ++bank) { in flash_sect_roundb()
101 info = &flash_info[bank]; in flash_sect_roundb()
118 } /* bank */ in flash_sect_roundb()
193 ulong bank; in flash_fill_sect_ranges() local
198 for (bank=0; bank < CONFIG_SYS_MAX_FLASH_BANKS; ++bank) { in flash_fill_sect_ranges()
199 s_first[bank] = -1; /* first sector to erase */ in flash_fill_sect_ranges()
200 s_last [bank] = -1; /* last sector to erase */ in flash_fill_sect_ranges()
203 for (bank=0,info = &flash_info[0]; in flash_fill_sect_ranges()
204 (bank < CONFIG_SYS_MAX_FLASH_BANKS) && (addr_first <= addr_last); in flash_fill_sect_ranges()
205 ++bank, ++info) { in flash_fill_sect_ranges()
214 b_end = info->start[0] + info->size - 1; /* bank end addr */ in flash_fill_sect_ranges()
229 s_first[bank] = sect; in flash_fill_sect_ranges()
232 s_last[bank] = sect; in flash_fill_sect_ranges()
235 if (s_first[bank] >= 0) { in flash_fill_sect_ranges()
236 if (s_last[bank] < 0) { in flash_fill_sect_ranges()
238 s_last[bank] = s_end; in flash_fill_sect_ranges()
246 if (s_last[bank] < s_first[bank]) { in flash_fill_sect_ranges()
252 sect = s_last[bank]; in flash_fill_sect_ranges()
254 (*s_count) += s_last[bank] - s_first[bank] + 1; in flash_fill_sect_ranges()
259 } else if (s_last[bank] >= 0) { in flash_fill_sect_ranges()
274 ulong bank; in do_flinfo() local
279 for (bank=0; bank <CONFIG_SYS_MAX_FLASH_BANKS; ++bank) { in do_flinfo()
280 printf ("\nBank # %ld: ", bank+1); in do_flinfo()
282 flash_print_info (&flash_info[bank]); in do_flinfo()
287 bank = simple_strtoul(argv[1], NULL, 16); in do_flinfo()
288 if ((bank < 1) || (bank > CONFIG_SYS_MAX_FLASH_BANKS)) { in do_flinfo()
293 printf ("\nBank # %ld: ", bank); in do_flinfo()
294 flash_print_info (&flash_info[bank-1]); in do_flinfo()
303 ulong bank, addr_first, addr_last; in do_flerase() local
316 for (bank=1; bank<=CONFIG_SYS_MAX_FLASH_BANKS; ++bank) { in do_flerase()
317 printf ("Erase Flash Bank # %ld ", bank); in do_flerase()
318 info = &flash_info[bank-1]; in do_flerase()
329 printf ("Erase Flash Sectors %d-%d in Bank # %zu ", in do_flerase()
341 bank = dev->id->num; in do_flerase()
342 info = &flash_info[bank]; in do_flerase()
347 "bank %ld, 0x%08lx - 0x%08lx ", in do_flerase()
348 argv[1], bank, addr_first, in do_flerase()
364 if (strcmp(argv[1], "bank") == 0) { in do_flerase()
365 bank = simple_strtoul(argv[2], NULL, 16); in do_flerase()
366 if ((bank < 1) || (bank > CONFIG_SYS_MAX_FLASH_BANKS)) { in do_flerase()
371 printf ("Erase Flash Bank # %ld ", bank); in do_flerase()
372 info = &flash_info[bank-1]; in do_flerase()
396 ulong bank; in flash_sect_erase() local
406 for (bank=0,info = &flash_info[0]; in flash_sect_erase()
407 (bank < CONFIG_SYS_MAX_FLASH_BANKS) && (rcode == 0); in flash_sect_erase()
408 ++bank, ++info) { in flash_sect_erase()
409 if (s_first[bank]>=0) { in flash_sect_erase()
410 erased += s_last[bank] - s_first[bank] + 1; in flash_sect_erase()
412 "in Bank # %ld ", in flash_sect_erase()
413 info->start[s_first[bank]], in flash_sect_erase()
414 (s_last[bank] == info->sector_count) ? in flash_sect_erase()
416 info->start[s_last[bank]+1] - 1, in flash_sect_erase()
417 bank+1); in flash_sect_erase()
418 rcode = flash_erase (info, s_first[bank], s_last[bank]); in flash_sect_erase()
437 ulong bank; in do_protect() local
464 for (bank=1; bank<=CONFIG_SYS_MAX_FLASH_BANKS; ++bank) { in do_protect()
465 info = &flash_info[bank-1]; in do_protect()
469 printf ("%sProtect Flash Bank # %ld\n", in do_protect()
470 p ? "" : "Un-", bank); in do_protect()
493 printf("%sProtect Flash Sectors %d-%d in Bank # %zu\n", in do_protect()
519 bank = dev->id->num; in do_protect()
520 info = &flash_info[bank]; in do_protect()
525 "bank %ld, 0x%08lx - 0x%08lx\n", in do_protect()
527 bank, addr_first, addr_last); in do_protect()
543 if (strcmp(argv[2], "bank") == 0) { in do_protect()
544 bank = simple_strtoul(argv[3], NULL, 16); in do_protect()
545 if ((bank < 1) || (bank > CONFIG_SYS_MAX_FLASH_BANKS)) { in do_protect()
550 printf ("%sProtect Flash Bank # %ld\n", in do_protect()
551 p ? "" : "Un-", bank); in do_protect()
552 info = &flash_info[bank-1]; in do_protect()
592 ulong bank; in flash_sect_protect() local
603 for (bank=0,info = &flash_info[0]; bank < CONFIG_SYS_MAX_FLASH_BANKS; ++bank, ++info) { in flash_sect_protect()
608 if (s_first[bank]>=0 && s_first[bank]<=s_last[bank]) { in flash_sect_protect()
609 debug ("%sProtecting sectors %d..%d in bank %ld\n", in flash_sect_protect()
611 s_first[bank], s_last[bank], bank+1); in flash_sect_protect()
612 protected += s_last[bank] - s_first[bank] + 1; in flash_sect_protect()
613 for (i=s_first[bank]; i<=s_last[bank]; ++i) { in flash_sect_protect()
655 "flinfo N\n - print information for FLASH memory bank # N"
666 "erase N:SF[-SL]\n - erase sectors SF-SL in FLASH bank # N\n"
667 "erase bank N\n - erase FLASH bank # N\n"
681 " - protect sectors SF-SL in FLASH bank # N\n"
682 "protect on bank N\n - protect FLASH bank # N\n"
691 " - make sectors SF-SL writable in FLASH bank # N\n"
692 "protect off bank N\n - make FLASH bank # N writable\n"