This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

NAND Flash accessing on DRA7xx using GLSDK 6.10

Other Parts Discussed in Thread: DRA752

Hi,

I am new to linux environment and I am working on DRA7xx rev G board with GLSDK 6.10.

I have been trying to access NAND flash on DRA7xx. I have applied patches and made it accessible.

I am able to write into NAND and read from it at Uboot stage using the following commands.

mw.b 82000000 55 100

nand write 82000000 0 100

mw.b 82000000 0 100

nand read 82000000 0 100

md.b 82000000 100

I am able to what I have written on NAND.

Same way I am able to read this data from user space also(after kernal boot up) either using nanddump command or using some small user application with open, read calls.

And I am able to write and read data to NAND flash at user space uisng write and read calls.(I am taking care of page writing and erasing etc.)

1. But, my problem is when I write into NAND flash at user space using write call and trying to read that data from Uboot(after rebooting) I am unable to access it.

The error I am getting on terminal is as follows.

DRA752 EVM # nand read 82000000 0 100

NAND read: device 0 offset 0x0, size 0x100
NAND READ from offset 0 failed -74
 0 bytes read: ERROR


What could be the reason.? Please help me. Is there any thing wrong with my code?

2. And what is the ECC mechanism that used in Kernal space and Uboot level.? I read that there are several Error checking mechanisms available for NAND flash.

3. I have written Images such as MLO, u-boot.img, boot.scr, dra7xx-evm.dtb,uImage etc to NAND using the commands such as

mmc rescan
nand erase.chip
load mmc 0 0x81000000 MLO
nand write 0x81000000 0 20000
nand write 0x81000000 20000 20000
nand write 0x81000000 40000 20000
nand write 0x81000000 60000 20000

load mmc 0 0x81000000 u-boot.img
nand write 0x81000000 80000 1e0000
load mmc 0 0x81000000 uImage
nand write 0x81000000 280000 500000
load mmc 0 0x81000000 dra7-evm-lcd10.dtb
nand write 0x81000000 780000 f880000

The images were written fine. But if I am trying boot from NAND keeping the sysboot pins as per NAND boot selection, the booting is not happening(not even til uboot.). Please suggest me how to boot from NAND on DRA7xx.

(Ref: processors.wiki.ti.com/.../Linux_Core_U-Boot_User%27s_Guide)

The patches provided by TI are not having full information. I needed to enable lot of other macros in the code.

Please help me.

Thanks in anticipation.

Regards,

Vijaykumar P

  • Hello Vijaykumar,

    In GLSDK DRA7xx 6.10.00.02 - NAND/NOR FS support is not available. This is a known limitation for this release.

    Regards,
    Yanko
  • Hi Yanko,
    Thanks for your response.
    I have gone through the Limitations of glsdk6.10. But I have found some patches on web
    processors.wiki.ti.com/.../Linux_Core_NAND_User%27s_Guide. And I got these patches from TI support also.
    I have applied these to glsdk6.10 and made NAND accessible. I would be thankful if you answer query wise(atlease query 1) and let me know the limitation.
    Please let me know if glsdk6.4.0.2 works fine with dra7xx rev G. and where can I download it from?

    Thanks in anticipation.
    Regards,
    Vijaykumar P
  • Hello Vijaykumar,

    Please let me know if glsdk6.4.0.2 works fine with dra7xx rev G. and where can I download it from? - This release is already not available.
    At first, I suggest you to take a look on processors.wiki.ti.com/.../GLSDK_Datasheet_DRA7xx_6.10.00.02

    Only 4 GiB are physically available within this 8-GiB address range.

    What could be the reason.? Please help me. Is there any thing wrong with my code? - I assume that the reason for your problem is a memory conflict.

    I suggest you to check your GPMC CS (chip select) configurations. Refer to section 15.4.4.12 NAND Access Description in TRM. Follow the configuration described in Table 15-448. Chip-Select Configuration for NAND Interfacing.

    Best regards,
    Yanko
  • Hello Vijaykumar,

    Please, take a look on this guide - http://processors.wiki.ti.com/index.php/Linux_Core_U-Boot_User%27s_Guide#Writing_to_NAND_from_U-Boot

    Could you explain how you built your U-boot?


    Best regards,

    Yanko

  • Hi Yanko,
    If you see, I have shared the same link in my query in the beginning :).

    I have applied the patches given by TI support person, to my glsdk6.10. You can fine the same patches here: processors.wiki.ti.com/.../Linux_Core_NAND_User%27s_Guide

    After applying this I managed some other macros in uboot as while building lot of errors.
    I initialised GPMC cs0 config(gpmc_init) registers for NAND accessing (as on DRA7xx cs0 is connected to NAND) and built the uboot.
    Then onwards I am able to access nand memory as I explained in the beginning.
    While building I used dra7xx_evm_config.
    exort ARCH=arm
    export CROSS_COMPILE=arm-xxxxxxx
    make dra7xx_evm_config
    make all
    This is how I built it.


    I was writing the images in to nand as follows.(As per the link you shared)

    mmc rescan
    nand erase.chip
    load mmc 0 0x81000000 MLO
    nand write 0x81000000 0 20000
    nand write 0x81000000 20000 20000
    nand write 0x81000000 40000 20000
    nand write 0x81000000 60000 20000
    load mmc 0 0x81000000 u-boot.img
    nand write 0x81000000 80000 1e0000
    load mmc 0 0x81000000 uImage
    nand write 0x81000000 280000 500000
    load mmc 0 0x81000000 dra7-evm-lcd10.dtb
    nand write 0x81000000 780000 f880000

    I used addresses and sizes instead of mtd parts as I am unable to see mtdparts command in glsdk6.10-uboot and it is not working if I use the names as shown in the link.
    After all this, I changed the sysboot setting to boot from NAND but it was not working.
    This is how I have tried. Please suggest me if I have done some mistake.

    Thank you.

    Rgds,
    Vijay
  • Hello Vijay,

    I forward your question to SW team. I think that they will help you with this driver issue.

    Best regards,
    Yanko
  • Hello Vijay,

    I got the following answer from GLSDK SW team:

    There is no NAND support as part of the GLSDK releases. The used patches for NAND driver do not work with Rev. G EVMs.
    It is not recommended to use these NAND drivers if you are automotive customer.

    Could you provide more details about your use case? Why does it need to use NAND?

    Best regards,
    Yanko