possible nand block erase bug

From OpenSSDWiki
Viewed 4670 times, With a total of 1 Posts
Jump to: navigation, search

Clicked A Few Times
Threads 11
Posts 39
Is this a bug? Should
SETREG(FCP_OPTION, FO_P); // 2-plane erase
be
SETREG(FCP_OPTION, 0); // 1-plane erase

It appears this function is trying to support both 1-plane and 2-plane erases, however if I'm reading this correctly in 2-plane mode it will erase four 1-plane blocks, while in 1-plane mode it will erase two 1-plane blocks.

void nand_block_erase(UINT32 const bank, UINT32 const vblock)
{
    UINT32 row;

    ASSERT(bank < NUM_BANKS);
    ASSERT(vblock < VBLKS_PER_BANK);

    row = vblock * PAGES_PER_BLK;

    SETREG(FCP_CMD, FC_ERASE);
    SETREG(FCP_OPTION, FO_P);
    SETREG(FCP_ROW_H(bank), row);
    SETREG(FCP_ROW_L(bank), row);

    flash_issue_cmd(bank, RETURN_ON_ISSUE);

    #if NAND_SPEC_PLAN == NAND_SPEC_PLANE_2 && OPTION_2_PLANE == TRUE
    {
        SETREG(FCP_CMD, FC_ERASE);
        SETREG(FCP_OPTION, FO_P);
        SETREG(FCP_ROW_H(bank), (row + 1));
        SETREG(FCP_ROW_L(bank), (row + 1));

        flash_issue_cmd(bank, RETURN_ON_ISSUE);
    }
    #endif
}


Perhaps this is a better implementation?

void nand_block_erase(UINT32 const bank, UINT32 const vblock)
{
    UINT32 row;

    ASSERT(bank < NUM_BANKS);
    ASSERT(vblock < VBLKS_PER_BANK);

    row = vblock * PAGES_PER_BLK;
    SETREG(FCP_CMD, FC_ERASE);
    SETREG(FCP_ROW_H(bank), row);
    SETREG(FCP_ROW_L(bank), row);

    #if NAND_SPEC_PLAN == NAND_SPEC_PLANE_2 && OPTION_2_PLANE == TRUE
        SETREG(FCP_OPTION, FO_P); // 2-plane
    #else
        SETREG(FCP_OPTION, 0); // 1-plane
    #endif

    flash_issue_cmd(bank, RETURN_ON_ISSUE);
}
Edited On 6:20:00 PM - Sun, May 15th 2011 by Jeremy Brock
Jeremy Brock

A+ Perfect Computers (http://www.recovermyflashdrive.com)
President / Sr. R&D Engineer
2465 Black Rock Tpke., STE. C
Fairfield, CT 06825, USA
Tel: 203-549-9761
Email: jeremy@recovermyflashdrive.com

Clicked A Few Times
Threads 4
Posts 9
I think you're right.
It's an obvious bug that would be fixed on the next release.
Sang-Phil Lim (M.S. Candidate Student)

VLDB Lab. (http://vldb.skku.ac.kr/)
Department of Embedded Software
Sungkyunkwan Univ., Korea.


Forum >> Jasmine OpenSSD Platform >> Jasmine Firmware



Who's here now Members 0 Guests 0 Bots/Crawler 0


AWC's: 2.5.12 MediaWiki - Stand Alone Forum Extension
Forum theme style by: AWC
Views
Personal tools