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.

Customizing U-Boot for AM1802 Based Board

Other Parts Discussed in Thread: AM1808, OMAP-L138, AM1802, OMAPL138

Hello:

I've successfully booted our new board using AISgen to modify a stock u-boot-bin as well as boot a kernel and filesystem. I've followed many Wikis to get to this point and my Host Development PC is a bit of a mess so I wanted to confirm what I should be using. I started with a LogicPD AM1808 eXperimenter board and isntalled those tools but I've run across a few other Wikis that pointed to other SDKs. The most recent I found and used was the OMAP-L138 LCDK. So to begin, I'm hoping to get help to remove unnecessary downloads with the goal to modify u-boot and the kernel to match our board. 

I currently have the following folders on the Host PC:

  • AM1808_OMAP-L138
  • CodeSourcery
  • ti-sdk-am180x-evm-05.05.01.00
  • ti-sdk-omapl138-lcdk-01.00.00
  • mcsdk_1_01_00_02 (and a bunch of other directories from this SDK)

The reason I switched to the OMAP-L138-LCDK is because it matched our board design more closely. Our design has the following:

  • AM1802
  • DDR2 (Micron MT47H64M16HR-25:H)
  • NAND x8 using CS3 (Spansion S34ML04G200TFI000)
  • uSD connected to MMCSD0
  • Ethernet PHY DP83848 using MII
  • USB Port on USB0

So my questions are:

  • Which SDK/sources should I be working with? The most recent work has switched from arago to linaro but I found notes that AM180x should continue to arago.
  • I tried a couple of pre-built u-boot images but neither was able to successfully initialize the phy but I was able to probe using mii in u-boot and get a response. u-boot supports the DP83848 phy but I'm unclear on how to modify the u-boot sources.
  • It also looks like I can add it my configuration settings from AISgen directly into u-boot but I didn't fid any real instructions on doing that so hopefully there's a link that I missed somewhere.

Thanks,

George

  • For now, unless someone else chimes in, I'm using the arago-2011.09 tool chain and the linux-3.3-psp03.22.00.06.sdk from the mcsdk_1_01_00_02 package and I've been able to alter the kernel and still boot so at least the fundamentals seem OK so far.

  • Hi,

    • I tried a couple of pre-built u-boot images but neither was able to successfully initialize the phy but I was able to probe using mii in u-boot and get a response. u-boot supports the DP83848 phy but I'm unclear on how to modify the u-boot sources.

    Change u-boot configuration file located at "include/configs/<ur-board>.h

    ex:

    omapl138_lcdk.h (OMAPL138 LCDK)

    da850evm.h (OMAPL138EVM)

    Change the u-boot configurations (like #define EMAC for ethernet PHY )) as per your board & build it then convert into AIS format

    Do #define for your peripheral and if you dont want just #undef it.

  • Thanks for your reply. I have a few questions which I hope you can answer:

    • I've read some posts where using #undef didn't produce the expected results. I'm not sure if that still applies or not.
    • Is the u-boot-2012.04.01-psp03.22.00.06.sdk the package I should be using or is there some git repository that is now maintained that I should be using?
    • Do you know of a good reference to follow to create my own board config?
    • I currently am booting from the SD card yet I only see SPI, NOR, or NAND at the top of this file so I believe this was written before the D800K008 supported booting from the SD card or are the CONFIG_USE_NAND define at the top just for what is on the board and not what you are booting from?

    Thanks,

    George

  • Hi George,

    • I've read some posts where using #undef didn't produce the expected results. I'm not sure if that still applies or not.

    As per my knowledge & experience,

    No, It will compile as per your config ".h" file only but you have to comment out all dependency,

    Ex:

    If your are not configured EMAC then you need to comment out all the networks stuffs like TFTP, NFS, EMAC_ADDR_IN_SPUI flash etc.,

    You can use #undef or comment out the #define line,

    Is the u-boot-2012.04.01-psp03.22.00.06.sdk the package I should be using or is there some git repository that is now maintained that I should be using?

    You can use u-boot SDK from TI OMAPL138_LCDK, OMAPL138 SDI and OMAPL138 EVM and configure the u-boot source for  your board ( da850_am18xxevm_config ) & build it.

    Do the following commands for building,

    make clean  ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

    make distclean  ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

    make da850_am18xxevm_config  ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- (AM1xx only)

    make all  ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

    I currently am booting from the SD card yet I only see SPI, NOR, or NAND at the top of this file so I believe this was written before the D800K008 supported booting from the SD card or are the CONFIG_USE_NAND define at the top just for what is on the board and not what you are booting from?

    I'm not sure, If you want to boot your board with any of other media (NAND,SPI,NOR) , please give your config ".h" file & i ll check & modify for you if required, because i cant say & i dont know which release are you using and SDK.

  • Hi,

    I currently am booting from the SD card yet I only see SPI, NOR, or NAND at the top of this file so I believe this was written before the D800K008 supported booting from the SD card or are the CONFIG_USE_NAND define at the top just for what is on the board and not what you are booting from?

    Do "#define" like this if you want to boot your board from different media.

    For SPI boot:

    /* check if direct NOR boot config is used */
    #if !defined(CONFIG_DIRECT_NOR_BOOT) && !defined(CONFIG_USE_NAND)
    #define CONFIG_USE_SPIFLASH
    #endif


    For NAND boot:

    /* check if direct NOR boot config is used */

    #define CONFIG_USE_NAND
    #if !defined(CONFIG_DIRECT_NOR_BOOT) && !defined(CONFIG_USE_NAND)
    #define CONFIG_USE_SPIFLASH
    #endif

    For NOR boot:

    /* check if direct NOR boot config is used */

    #define CONFIG_DIRECT_NOR_BOOT
    #if !defined(CONFIG_DIRECT_NOR_BOOT) && !defined(CONFIG_USE_NAND)
    #define CONFIG_USE_SPIFLASH
    #endif

    It will build u-boot source as per your configured boot methods.

  • Yes, I have seen these settings but that does not help if you want to boot from SD Card as is my case. I am booting and have made some progress but I am trying to understand how to eliminate the errors I see during the boot.

    Eventually I would like to boot from NAND but I cannot find any code which supports x8 NAND, only x16 NAND.

    I have another question related to this. I know that you need to configure the boot pins on the board which the ROM code latches during power up. Is there a boor order that happens? For instance if the boot pins are configured to SD Card boot can you configure the system to look at the next boot device if the SD Card is not present? For fail safe operation it would be good to set a boot order (like in a PC BIOS and other ARM boards) so if there is a problem with 1 boot device you have a backup boot option.

  • Hi,

    Yes, I have seen these settings but that does not help if you want to boot from SD Card as is my case. I am booting and have made some progress but I am trying to understand how to eliminate the errors I see during the boot.

    SD boot will support only for the latest RBL version (08).

    What are the errors have been faced when booting from SD ?

    Have you using different CS (chip select) for NAND than EVM used?

    If you are using NOR then you cant boot from MMC as well NAND.

    Refer the below link for boot related queries.

    http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=sprab41&fileType=pdf

  • I know only RBL version 08 is the only version to support booting from SD Card but that ROM was updated years ago.

    I am able to boot from SD card now after much work and effort together with another TI member.

    I am using the same CS as the EVM, CS3.

    My question is how to support 8-bit NAND?

    My other question is I want to know if it is possible to configure for a primary and secondary boot mode. I have read that document and almost every Wiki page but I do not find any information about my questions so I am asking  for your help and support.

    Best Regards,

    George

  • Hi,

    I am using the same CS as the EVM, CS3.

    My question is how to support 8-bit NAND?

    u-boot-psp/board/davinci/da8xxevm/da850evm.c

    You can change the EMIFA parameters here,

    Please refer chapter 20.4.5 of OMAPL138 TRM.

    #ifdef CONFIG_NAND_DAVINCI
        /*
         * NAND CS setup - cycle counts based on da850evm NAND timings in the
         * Linux kernel @ 25MHz EMIFA
         */
        writel((DAVINCI_ABCR_WSETUP(2) |
            DAVINCI_ABCR_WSTROBE(2) |
            DAVINCI_ABCR_WHOLD(1) |
            DAVINCI_ABCR_RSETUP(1) |
            DAVINCI_ABCR_RSTROBE(4) |
            DAVINCI_ABCR_RHOLD(0) |
            DAVINCI_ABCR_TA(1) |
            DAVINCI_ABCR_ASIZE_8BIT),
               &davinci_emif_regs->ab2cr); /* CS3 */
    #endif

  • OK, wow, talk about confusing (or at least to me!). I was looking at omapl138_lcdk.h and on line #109 I found:

    #define	CONFIG_SYS_NAND_BUSWIDTH_16_BIT

    but I couldn't find any code for a BUSWIDTH_8_BIT

    Looking at the section of code that you pointed out but took some deciphering since ASIZE I guess is short for "Asynchronous Data Bus Width" which is controlled by the CEnCFG register, Field=ASIZE (bits 0-1; 0 for 8-bit, 1 for 16-bit).

    I didn't follow the logic to confirm that davinci_emif_regs->ab2cr really is changing CE3CFG which is at offset 0x14

    So what do I do about CONFIG_SYS_NAND_BUSWIDTH_16_BIT and how that ties into everything?

  • Hi,

    1) If you are looking into OMAP L138 LCDK  (Low cost development board with less peripherals) board,

    then,

    i)

    board/davinci/da8xxevm/omapl138_lcdk.c

    #ifdef CONFIG_NAND_DAVINCI
        /*
         * NAND CS setup - cycle counts based on da850evm NAND timings in the
         * Linux kernel @ 25MHz EMIFA
         */
        writel((DAVINCI_ABCR_WSETUP(15) |
            DAVINCI_ABCR_WSTROBE(63) |
            DAVINCI_ABCR_WHOLD(7) |
            DAVINCI_ABCR_RSETUP(15) |
            DAVINCI_ABCR_RSTROBE(63) |
            DAVINCI_ABCR_RHOLD(7) |
            DAVINCI_ABCR_TA(3) |
            DAVINCI_ABCR_ASIZE_16BIT),
               &davinci_emif_regs->ab2cr); /* CS3 */
    #endif

    ii)

    include/configs/omapl138_lcdk.h

    #define    CONFIG_SYS_NAND_BUSWIDTH_16_BIT

    iii)

    drivers/mtd/nand/davinci_nand.c

    #ifdef CONFIG_SYS_NAND_BUSWIDTH_16_BIT
        nand->options      |= NAND_BUSWIDTH_16;
    #endif

    2) If you are looking into OMAP L138 EVM board,

    then,

    board/davinci/da8xxevm/da850evm.c

    #ifdef CONFIG_NAND_DAVINCI
        /*
         * NAND CS setup - cycle counts based on da850evm NAND timings in the
         * Linux kernel @ 25MHz EMIFA
         */
        writel((DAVINCI_ABCR_WSETUP(2) |
            DAVINCI_ABCR_WSTROBE(2) |
            DAVINCI_ABCR_WHOLD(1) |
            DAVINCI_ABCR_RSETUP(1) |
            DAVINCI_ABCR_RSTROBE(4) |
            DAVINCI_ABCR_RHOLD(0) |
            DAVINCI_ABCR_TA(1) |
            DAVINCI_ABCR_ASIZE_8BIT),
               &davinci_emif_regs->ab2cr); /* CS3 */
    #endif

    If you are not declaring "#define    CONFIG_SYS_NAND_BUSWIDTH_16_BIT" then it should be NAND 8 bit data by default.

    Looking those 2 different boards,

    OMAPL138 EVM board supporting 8 bit NAND by default,

    OMAPL138 LCDK board supporting 16 bit NAND by default,