I have a SEGV when trying to use nand check_bad_blocks on a DaVinci DM355 , 
OpenOCD version cc5f3c85de7632a32f41b435c54b83487a3aa622 and 4-bit infix ECC 
layout.

This is because nand_build_bbt() calls nand_read_page() with NULL, 0 for data 
pointer and size, the davinci nand code doesn't like that; gdb:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000451a1a in davinci_read_block_data (
    nand=<value optimized out>, data=0x0, data_size=512)
    at davinci.c:199
199                     data[0] = tmp;
(gdb) bt 4
#0  0x0000000000451a1a in davinci_read_block_data (
    nand=<value optimized out>, data=0x0, data_size=512)
    at davinci.c:199
#1  0x0000000000451e90 in davinci_read_page_ecc4infix (nand=0x75a2e0,
    page=<value optimized out>, data=0x0, data_size=0,
    oob=0x7fffffffd090 "", oob_size=<value optimized out>)
    at davinci.c:615
#2  0x000000000041a68f in nand_build_bbt (nand=0x75a2e0,
    first=<value optimized out>, last=8191) at core.c:237
#3  0x000000000041003a in handle_nand_check_bad_blocks_command (
    cmd=0x7fffffffd140) at tcl.c:257

Looking at nand_read_page_raw() for inspiration though, I see that it does this:

        if (data)
                nand_read_data_page(nand, data, data_size);

        if (oob)
                nand_read_data_page(nand, oob, oob_size);

Maybe I'm missing something, but doesn't that mean when called from 
nand_build_bbt(), the data read will be skipped completely and oob will 
actually contain the first data from the page? Shouldn't it do a dummy read 
instead?

Seems like at the moment it will be mis-identifying bad blocks based on in-band 
rather than OOB data.

Mailed to list earlier for comments, but meanwhile I am going to continue code 
spelunking and maybe come up with patches. I need to understand davinci NAND 
stuff thoroughly and make sure it's all working with OpenOCD.

--
Jon Povey
jon.po...@racelogic.co.uk

Racelogic is a limited company registered in England. Registered number 2743719 
.
Registered Office Unit 10, Swan Business Centre, Osier Way, Buckingham, Bucks, 
MK18 1TB .

The information contained in this electronic mail transmission is intended by 
Racelogic Ltd for the use of the named individual or entity to which it is 
directed and may contain information that is confidential or privileged. If you 
have received this electronic mail transmission in error, please delete it from 
your system without copying or forwarding it, and notify the sender of the 
error by reply email so that the sender's address records can be corrected. The 
views expressed by the sender of this communication do not necessarily 
represent those of Racelogic Ltd. Please note that Racelogic reserves the right 
to monitor e-mail communications passing through its network


_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to