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.

66AK2E05: Boot from SPI flash

Part Number: 66AK2E05
Other Parts Discussed in Thread: DRA829J
Hello,
I'm trying to use SPI Boot with the 66AK2E05. I built the SDK with and flashed my on board SPI chip with the u-boot-spi.gph output file. Is that the only file needed to boot?
Thanks,
Mike
  • I am also having trouble reading anything from SPI flash with the K2E. When the device is first powered on with SPI boot configured, MOSI gives the 0x03 command for a normal read. However, it then gives 0x18 before staying low for the remaining SPI transactions. Is the K2E supposed to be looking for an image beginning at this address (0x180000), or have I configured the SPI boot improperly?

    Thanks,

    Mike  

  • Hi Mike,

    I understand, that it is a customized board with 66AK2E05. Please confirm...

    Do you use the processor SDK or the old MCSDK? Please confirm..

    Are you able to get the u-boot prompt first? after when you can load the image !?

    ----------

    If it is a Development board (EVM )of K2E, 

    For Keystone-2 platforms, it is configured to be ARM SPI boot mode using SW1 dip switch setting.

    Please refer to the Hardware Setup of each Keystone-2 EVM.

    ---------

    Note for Keystone-2 (K2H/K/E/L/G) platforms:

    • From the U-Boot build, the u-boot-spi.gph file is the one to be written.
    • We load the file from a tftp server via netowrk in this example.
    • The series commands burns the u-boot image to the SPI NOR flash
    U-Boot # env default -f -a
    U-Boot # setenv serverip <ip address of tftp server>
    U-Boot # setenv tftp_root <tftp root directory>
    U-Boot # setenv name_uboot u-boot-spi.gph
    U-Boot # run get_uboot_net
    U-Boot # run burn_uboot_spi
    --------

    reset

    The EVM now boots with latest version of u-boot image.

    ----------

    To see if current u-boot on EVM support this, do

     >printenv
    

    and check if get_uboot_net and burn_uboot env variables are present. Also name_uboot is set to u-boot-spi-<soc>-evm.gph.

    -----------

    Regards

    Shankari

  • Hi Shankari,

    Yes, I am using a customized board with 66AK2E05.

    I am using the PROCESSOR-SDK-LINUX-K2E, which I built on a native Linux PC (Ubuntu 20.04 LTS).

    I have not gotten to the u-boot prompt. How do I do this? Do I need to have the MLO written to SPI flash instead of the .gph file? Or is it that I need to concatenate these files in some way?

    -------

    I do not have a K2E-EVM development board, and I do not know what the SW1 dip switch setting actually does to configure SPI boot on the EVM. However, I believe I have the DEVSTAT register properly configured for SPI boot on my 66AK2E05:

    -------

    Thanks for your help,

    Mike

  • Hi Rajarajan,

    I am not able to follow these steps as I don't have the u-boot prompt from my custom board, sorry I wasn't clear about that.

    I'd like to know what file needs to be written to SPI flash so that I can access the u-boot prompt.

    Thanks,

    Mike

  • HI Mike,

    OK. The first step for you is to get the u-Boot prompt. 

    To get the U-boot prompt, the u-boot.bin are to be loaded in the MSMC RAM and get it run.

    To load the u-boot.bin,

    1. you can use the CCS plus the XDS2xx USB Emulator_0   { In your customized board, do you have XDS emulator support?? )

    or

    2. you can use the UART .

    When the u-boot.bin runs, you will see the boot logs something like this.

    U-Boot 2014.04-rc1-00201-gc215b5a (Mar 21 2014 - 12:47:59)

    I2C: ready
    Detected SO-DIMM [SQR-SD3T-2G1333SED]
    DRAM: 1.1 GiB
    NAND: 512 MiB
    Net: K2HK_EMAC
    Warning: K2HK_EMAC using MAC address from net device
    , K2HK_EMAC1, K2HK_EMAC2, K2HK_EMAC3
    Hit any key to stop autoboot: 0

    ---.

    The SPI boot mode is used to read the boot image from NOR memory connected to the device through the SPI interface.

    The image read from the NOR memory must be in GP Header format.

    -----

    As it is a customized board, we may not know the list of differences.

    However, will provide information referring to the K2E EVM; So that you can port  u-boot for your customized board.

    ------

    Board configuration:  (With reference to K2E board -- Check for your customized board)
    ====================

    Some of the peripherals that are configured by U-Boot
    +------+-------+-------+-----------+-----------+-------+-------+----+
    | |DDR3 |NAND |MSM SRAM |ETH ports |UART |I2C |SPI |
    +------+-------+-------+-----------+-----------+-------+-------+----+
    | 4        512MB    2MB         8 (2)            2         3     3 |
    +------+-------+-------+-----------+-----------+-------+-------+----+

    There are separate PLLs to drive clocks to Tetris ARM and Peripherals.

    The porting related files can be found at following folders
    keystone2 SoC related files: arch/arm/cpu/armv7/keystone/
    EVMs board files: board/ti/k2s_evm/

    Board configuration files:
    include/configs/k2e_evm.h

    As U-Boot is migrating to Kconfig there is also board defconfig files
    configs/k2e_evm_defconfig

    Supported boot modes: ( Refer this guide https://www.ti.com/lit/ug/spruhj3/spruhj3.pdf  for more Boot modes)
    - SPI NOR boot
    - AEMIF NAND boot
    - UART boot

    Supported image formats:
    - u-boot.bin: for loading and running u-boot.bin through
    Texas Instruments code composure studio (CCS) and for UART boot.
    - u-boot-spi.gph: gpimage for programming SPI NOR flash for SPI NOR boot
    - MLO: gpimage for programming NAND flash for NAND boot, MMC boot. ( Not applicable for K2E)

    Build instructions:
    ===================
    Examples for k2hk, for k2e, k2l and k2g just replace k2hk prefix accordingly.
    Don't forget to add ARCH=arm and CROSS_COMPILE.

    To build u-boot.bin, u-boot-spi.gph, MLO:
    >make k2hk_evm_defconfig
    >make

    Load and Run U-Boot on keystone EVMs using CCS
    =========================================

    Need Code Composer Studio (CCS) installed on a PC to load and run u-boot.bin
    on EVM.

    Start CCS on a Windows machine and Launch Target
    configuration as instructed at 

    https://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Exploring#Loading_and_Running_U-Boot_on_EVM_through_CCS


    The instructions provided in the above link uses a script for
    loading the U-Boot binary on the target EVM. Instead do the following:-

    1. Right click to "Texas Instruments XDS2xx USB Emulator_0/CortexA15_1 core (D
    is connected: Unknown)" at the debug window (This is created once Target
    configuration is launched) and select "Connect Target".
    2. Once target connect is successful, choose Tools->Load Memory option from the
    top level menu. At the Load Memory window, choose the file u-boot.bin
    through "Browse" button and click "next >" button. In the next window, enter
    Start address as 0xc000000, choose Type-size "32 bits" and click "Finish"
    button.
    3. Click View -> Registers from the top level menu to view registers window.
    4. From Registers, window expand "Core Registers" to view PC. Edit PC value
    to be 0xc000000. From the "Run" top level menu, select "Free Run"
    5. The U-Boot prompt is shown at the Tera Term/ Hyper terminal console as
    below and type any key to stop autoboot as instructed :=

    U-Boot 2014.04-rc1-00201-gc215b5a (Mar 21 2014 - 12:47:59)

    I2C: ready
    Detected SO-DIMM [SQR-SD3T-2G1333SED]
    DRAM: 1.1 GiB
    NAND: 512 MiB
    Net: K2HK_EMAC
    Warning: K2HK_EMAC using MAC address from net device
    , K2HK_EMAC1, K2HK_EMAC2, K2HK_EMAC3
    Hit any key to stop autoboot: 0

    SPI NOR Flash programming instructions
    ======================================
    U-Boot image can be flashed to first 512KB of the NOR flash using following
    instructions:

    1. Start CCS and run U-Boot as described above.
    2. Suspend Target. Select Run -> Suspend from top level menu
    CortexA15_1 (Free Running)"
    3. Load u-boot-spi.gph binary from build folder on to DDR address 0x87000000
    through CCS as described in step 2 of "Load and Run U-Boot on K2HK/K2E/K2L
    EVM using CCS", but using address 0x87000000.
    4. Free Run the target as described earlier (step 4) to get U-Boot prompt
    5. At the U-Boot console type following to setup U-Boot environment variables.
    setenv addr_uboot 0x87000000
    setenv filesize <size in hex of u-boot-spi.gph rounded to hex 0x10000>
    run burn_uboot_spi
    Once U-Boot prompt is available, Power OFF the EVM. 
    6. Power ON the EVM. The EVM now boots with U-Boot image on the NOR flash.

    AEMIF NAND Flash programming instructions
    ======================================
    U-Boot image can be flashed to first 1024KB of the NAND flash using following
    instructions:

    1. Start CCS and run U-Boot as described above.
    2. Suspend Target. Select Run -> Suspend from top level menu
    CortexA15_1 (Free Running)"
    3. Load MLO binary from build folder on to DDR address 0x87000000
    through CCS as described in step 2 of "Load and Run U-Boot on K2HK EVM
    using CCS", but using address 0x87000000.
    4. Free Run the target as described earlier (step 4) to get U-Boot prompt
    5. At the U-Boot console type following to setup U-Boot environment variables.
    setenv filesize <size in hex of MLO rounded to hex 0x10000>
    run burn_uboot_nand
    Once U-Boot prompt is available, Power OFF the EVM.
    6. Power ON the EVM. The EVM now boots with U-Boot image on the NAND flash.

    Load and Run U-Boot on keystone EVMs using UART download
    ========================================================

    Open BMC and regular UART terminals.

    1. On the regular UART port start xmodem transfer of the u-boot.bin
    2. Using BMC terminal set the ARM-UART bootmode and reboot the EVM
    BMC> bootmode #4
    MBC> reboot
    3. When xmodem is complete you should see the U-Boot starts on the UART port

    Hope this helps.

    Regards

    Shankari

  • Hi Shankari,

    Thanks to your help I was able to get to the u-boot prompt via CCS and the XDS200. However, I quickly ran in to many issues while attempting to initialize our onboard DDR3L. We have decided to do a complete redesign around the DRA829J processor.

    Thanks again for all the useful advice!

    Kind regards,

    Mike 

  • Hey Mike,

    That's good news. Glad to hear!. You have done it man!!

    Congrats!

    Shankari