Ignore:
Timestamp:
Jul 4, 2011, 9:26:19 AM (9 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
9f816ad4
Parents:
7032a458
Message:

2011-07-04 Sebastian Huber <sebastian.huber@…>

  • misc/nand-mlc-erase-block-safe.c, misc/nand-mlc-write-blocks.c, include/nand-mlc.h: Fixed write blocks.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/lpc32xx/misc/nand-mlc-write-blocks.c

    r7032a458 r542d350e  
    6464
    6565  for (block = block_begin; block != block_end; ++block) {
    66     uint32_t first_page_of_block = block * pages_per_block;
     66    uint32_t page_begin = block * pages_per_block;
     67    uint32_t page_end = page_begin + pages_per_block;
    6768    uint32_t page = 0;
    6869
    69     sc = lpc32xx_mlc_erase_block_safe_3(
    70       block,
    71       first_page_of_block,
    72       pages_per_block
    73     );
     70    sc = lpc32xx_mlc_erase_block_safe_3(block, page_begin, page_end);
    7471    if (sc != RTEMS_SUCCESSFUL) {
    7572      continue;
    7673    }
    7774
    78     for (page = 0; page < pages_per_block; ++page) {
     75    for (page = page_begin; page < page_end; ++page) {
    7976      uintptr_t remainder = (uintptr_t) end - (uintptr_t) current;
    8077      size_t delta = remainder < page_size ? remainder : page_size;
     
    8380        memcpy(page_data_buffer, current, delta);
    8481        sc = lpc32xx_mlc_write_page_with_ecc(
    85           first_page_of_block + page,
     82          page,
    8683          page_data_buffer,
    8784          ones_spare
    8885        );
    8986        if (sc != RTEMS_SUCCESSFUL) {
    90           erase_block(block, first_page_of_block, pages_per_block);
    91           zero_block(first_page_of_block, pages_per_block);
     87          lpc32xx_mlc_erase_block_safe_3(block, page_begin, page_end);
     88          lpc32xx_mlc_zero_pages(page_begin, page_end);
    9289          current = last;
    9390          continue;
Note: See TracChangeset for help on using the changeset viewer.