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.

AM335X disable nand support in u-boot.

Hi, Moving from NAND as storage device to EMMC saves huge trouble for me, but my uboot is still trying to detect a nand device, which cost about 1-2 seconds hang during power on boot process.

Anyway to completely disable nand, or maybe even remove nand code from uboot binary.  

  • Hi,

    Unlike the Linux kernel configuration, the U-Boot configuration is still done with C preprocessor defines. Please read the U-Boot README for more information:

    Software Configuration:
    =======================

    Configuration is usually done using C preprocessor defines; the
    rationale behind that is to avoid dead code whenever possible.

    There are two classes of configuration variables:

    * Configuration _OPTIONS_:
      These are selectable by the user and have names beginning with
      "CONFIG_".

    * Configuration _SETTINGS_:
      These depend on the hardware etc. and should not be meddled with if
      you don't know what you're doing; they have names beginning with
      "CONFIG_SYS_".

    Later we will add a configuration tool - probably similar to or even
    identical to what's used for the Linux kernel. Right now, we have to
    do the configuration by hand, which means creating some symbolic
    links and editing some configuration files.

    The am335x configuration is located inside <u-boot_folder>/include/configs/am335x_evm.h. The NAND support part begins on line 525. I have never done this, but I guess you just have to #undef CONFIG_NAND.

    There are also some SPL specific configurations regarding NAND, that you may want to take a look at, starting on line 395.

    Please share your progress for future references.

    Best regards,
    Miroslav

  • Thanks for your reply.  I have tried this before, it just threw me some errors.

    Can you also mention which version of uboot you are looking at? also from TI EZ-SDK or  vanilia u-boot? So I can refer to the specific lines. thanks!

  • Hi,

    We only support the TI Sitara SDK, so the U-Boot I'm refering to is the one included inside. I'm using the latest SDK v. 06.00.00.00 which can be downloaded from here: http://software-dl.ti.com/sitara_linux/esd/AM335xSDK/latest/index_FDS.html

    Best regards,
    Miroslav

  • Hi, Thanks for your reply, I have tried this before I am asking Qs there, the problem with  #undef CONFIG_NAND is. it will throw compiler error. unable to pass compilation.


     

    arm-linux-gnueabihf-gcc -g -Os -fno-common -ffixed-r8 -msoft-float -mno-unaligned-access -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x80800000 -DCONFIG_SPL_TEXT_BASE=0x402F0400 -I/root/u-boot-2013.01.01-psp06.00.00.00/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3/include -pipe -DCONFIG_ARM -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -march=armv7-a -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security -fstack-usage -o env_common.o env_common.c -c
    env_common.c:35:1: error: expected ‘}’ before ‘MTDIDS_DEFAULT’
    make[2]: *** [env_common.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    make[2]: Leaving directory `/root/u-boot-2013.01.01-psp06.00.00.00/common'
    make[1]: *** [common/libcommon.o] Error 2
    make[1]: Leaving directory `/root/u-boot-2013.01.01-psp06.00.00.00'
    make: *** [am335x_evm] Error 2

    I will look more into it and let you know, thanks!

  • Hi,

    I guess it isn't as simple as I thought.

    Check the am335x related patches about NAND support here: http://arago-project.org/git/projects/?p=u-boot-am33x.git&a=search&h=HEAD&st=commit&s=nand+support

    Try to revert them and see if this disables the NAND support.

    Best regards,
    Miroslav

  • Hi, I'd just like to tag onto this topic as we're having the same issue.

    The major problem is that MTDIDS_DEFAULT is only defined if you have CONFIG_NAND defined - no other bootable resources define this, or a few other necessary #defines. Somehow the Beaglebone leaves CONFIG_NAND defined, even though it has no NAND onboard at all, and it doesn't cause a hang - I haven't figured out how they pulled that one off yet.

    So far the only way I've gotten this to work is by editing u-boot itself, going into arch/arm/lib/board.c and commenting out nand_init().

    I'd really like it if TI's SDK suggested an easy way to remove NAND from the boot config, as it's quite difficult - I would have thought it would be as easy as undefining CONFIG_NAND too.