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.

AM572x uboot command sf

Champs

it seems that in SD3.x the command  sf is not there in uboot?? Any ideas as to why not and how to get it back?? Need that command to program the QSPI on the IDK platform

Thanks

Mohsen

  • Hi Mohsen,

    Check weather the CONFIG_CMD_SF is enabled in your u-boot config file.
    There is a TI's tutorial about using SPI in u-boot:
    processors.wiki.ti.com/.../Linux_Core_U-Boot_User's_Guide
    where recommends to use am335x_evm_spiboot_config for u-boot config. This config file refers to am335xevm board and but there is no relevant config for am572x. Therefore I suggest you to enable all SPI related settings from that config file.

    BR
    Tsvetolin Shulev
  • Tsvetolin

    yes i am able to get the   sf command in the uboot. But when i use it with the AM572x IDK the command hangs the uboot and I have  to reboot?? Can you try this with your IDK EVM and let me know what results you get??? The command i use is   sf probe 0   I even tried sf probe 1. I wonder if the QSPI has a different address??

    below is my current configuration file that i use

    CONFIG_ARM=y
    CONFIG_OMAP54XX=y
    CONFIG_TARGET_AM57XX_EVM=y
    CONFIG_DM_SERIAL=y
    CONFIG_DM_GPIO=y
    CONFIG_SPL_STACK_R_ADDR=0x82000000
    CONFIG_DEFAULT_DEVICE_TREE="am572x-idk"
    CONFIG_SPL=y
    CONFIG_SPL_STACK_R=y
    CONFIG_HUSH_PARSER=y
    CONFIG_CMD_BOOTZ=y
    # CONFIG_CMD_IMLS is not set
    CONFIG_CMD_ASKENV=y
    # CONFIG_CMD_FLASH is not set
    CONFIG_CMD_MMC=y
    //mk addition
    CONFIG_CMD_SF=y
    CONFIG_CMD_SPI=y
    CONFIG_CMD_I2C=y
    CONFIG_CMD_USB=y
    CONFIG_CMD_GPIO=y
    # CONFIG_CMD_SETEXPR is not set
    CONFIG_CMD_DHCP=y
    CONFIG_CMD_MII=y
    CONFIG_CMD_PING=y
    CONFIG_CMD_EXT2=y
    CONFIG_CMD_EXT4=y
    CONFIG_CMD_EXT4_WRITE=y
    CONFIG_CMD_FAT=y
    CONFIG_CMD_FS_GENERIC=y
    CONFIG_OF_CONTROL=y
    CONFIG_DM=y
    CONFIG_DM_MMC=y
    CONFIG_SPI_FLASH=y
    CONFIG_SPI_FLASH_BAR=y
    CONFIG_SYS_NS16550=y
    CONFIG_FIT=y
    CONFIG_SPL_OF_LIBFDT=y
    CONFIG_SPL_LOAD_FIT=y
    CONFIG_OF_LIST="am57xx-beagle-x15 am572x-idk am571x-idk"
    CONFIG_OF_BOARD_SETUP=y
    CONFIG_DRA7_DSPEVE_OPP_HIGH=y
    CONFIG_DRA7_IVA_OPP_HIGH=y
    CONFIG_DISK=y
    CONFIG_DWC_AHCI=y
    CONFIG_DM_ETH=y
    CONFIG_CMD_TIME=y

    Also all the sspi  commands hang the uboot, so not sure what is going on.

    Thanks

    Regards

    Mohsen

  • Got more info for you

    I had to add the following to the configuration to get the uboot compiler to compile the ti-spi.c file.

    CONFIG_TI_QSPI=y

    Now i am getting compiler errors so getting more stuff but not sure about the compiler error. Please help.


    make CROSS_COMPILE=arm-linux-gnueabihf- O=am57xx_evm am57xx_evm_defconfig all
    make[1]: Entering directory `/home/mohsen/2nd_drive/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/u-boot-2016.05+gitAUTOINC+b4e185a8c3-gb4e185a8c3/am57xx_evm'
    arch/../configs/am57xx_evm_defconfig:17:warning: unexpected data
    #
    # configuration written to .config
    #
    scripts/kconfig/conf --silentoldconfig Kconfig
    CHK include/config.h
    GEN include/autoconf.mk
    GEN include/autoconf.mk.dep
    GEN spl/include/autoconf.mk
    CHK include/config/uboot.release
    Using .. as source for U-Boot
    CHK include/generated/version_autogenerated.h
    CHK include/generated/timestamp_autogenerated.h
    UPD include/generated/timestamp_autogenerated.h
    CHK include/generated/generic-asm-offsets.h
    CHK include/generated/asm-offsets.h
    HOSTCC tools/mkenvimage.o
    HOSTLD tools/mkenvimage
    HOSTCC tools/fit_image.o
    HOSTCC tools/image-host.o
    HOSTCC tools/dumpimage.o
    HOSTLD tools/dumpimage
    HOSTCC tools/mkimage.o
    HOSTLD tools/mkimage
    CC arch/arm/cpu/armv7/omap5/hw_data.o
    LD arch/arm/cpu/armv7/omap5/built-in.o
    LD arch/arm/cpu/armv7/built-in.o
    CC cmd/version.o
    LD cmd/built-in.o
    CC common/main.o
    CC common/board_f.o
    LD common/built-in.o
    CC drivers/spi/ti_qspi.o
    ../drivers/spi/ti_qspi.c:331:13: warning: 'ti_spi_setup_spi_register' defined but not used [-Wunused-function]
    static void ti_spi_setup_spi_register(struct ti_qspi_priv *priv)
    ^
    LD drivers/spi/built-in.o
    drivers/spi/ti_qspi.o: In function `spi_claim_bus':
    /home/mohsen/2nd_drive/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/u-boot-2016.05+gitAUTOINC+b4e185a8c3-gb4e185a8c3/am57xx_evm/../drivers/spi/ti_qspi.c:327: multiple definition of `spi_init'
    drivers/spi/omap3_spi.o:/home/mohsen/2nd_drive/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/u-boot-2016.05+gitAUTOINC+b4e185a8c3-gb4e185a8c3/am57xx_evm/../drivers/spi/omap3_spi.c:466: first defined here
    drivers/spi/ti_qspi.o: In function `ti_spi_set_speed':
    /home/mohsen/2nd_drive/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/u-boot-2016.05+gitAUTOINC+b4e185a8c3-gb4e185a8c3/am57xx_evm/../drivers/spi/ti_qspi.c:354: multiple definition of `spi_setup_slave'
    drivers/spi/omap3_spi.o:/home/mohsen/2nd_drive/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/u-boot-2016.05+gitAUTOINC+b4e185a8c3-gb4e185a8c3/am57xx_evm/../drivers/spi/omap3_spi.c:499: first defined here
    drivers/spi/ti_qspi.o: In function `spi_free_slave':
    /home/mohsen/2nd_drive/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/u-boot-2016.05+gitAUTOINC+b4e185a8c3-gb4e185a8c3/am57xx_evm/../drivers/spi/ti_qspi.c:389: multiple definition of `spi_free_slave'
    drivers/spi/omap3_spi.o:/home/mohsen/2nd_drive/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/u-boot-2016.05+gitAUTOINC+b4e185a8c3-gb4e185a8c3/am57xx_evm/../drivers/spi/omap3_spi.c:474: first defined here
    drivers/spi/ti_qspi.o: In function `spi_claim_bus':
    /home/mohsen/2nd_drive/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/u-boot-2016.05+gitAUTOINC+b4e185a8c3-gb4e185a8c3/am57xx_evm/../drivers/spi/ti_qspi.c:397: multiple definition of `spi_claim_bus'
    drivers/spi/omap3_spi.o:/home/mohsen/2nd_drive/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/u-boot-2016.05+gitAUTOINC+b4e185a8c3-gb4e185a8c3/am57xx_evm/../drivers/spi/omap3_spi.c:478: first defined here
    drivers/spi/ti_qspi.o: In function `spi_release_bus':
    /home/mohsen/2nd_drive/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/u-boot-2016.05+gitAUTOINC+b4e185a8c3-gb4e185a8c3/am57xx_evm/../drivers/spi/ti_qspi.c:168: multiple definition of `spi_release_bus'
    drivers/spi/omap3_spi.o:/home/mohsen/2nd_drive/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/u-boot-2016.05+gitAUTOINC+b4e185a8c3-gb4e185a8c3/am57xx_evm/../drivers/spi/omap3_spi.c:494: first defined here
    drivers/spi/ti_qspi.o: In function `spi_xfer':
    /home/mohsen/2nd_drive/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/u-boot-2016.05+gitAUTOINC+b4e185a8c3-gb4e185a8c3/am57xx_evm/../drivers/spi/ti_qspi.c:410: multiple definition of `spi_xfer'
    drivers/spi/omap3_spi.o:/home/mohsen/2nd_drive/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/u-boot-2016.05+gitAUTOINC+b4e185a8c3-gb4e185a8c3/am57xx_evm/../drivers/spi/omap3_spi.c:574: first defined here
    make[3]: *** [drivers/spi/built-in.o] Error 1
    make[2]: *** [drivers/spi] Error 2
    make[1]: *** [__build_one_by_one] Error 2
    make[1]: Leaving directory `/home/mohsen/2nd_drive/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/u-boot-2016.05+gitAUTOINC+b4e185a8c3-gb4e185a8c3/am57xx_evm'
    make: *** [sub-make] Error 2

    Thanks

    Mohsen
  • Mohsen,

    What I ended up doing was:

    git clone git://git.ti.com/ti-u-boot/ti-u-boot.git

    git checkout origin/ti-u-boot-2016.05

    git checkout -b qspi

    Then make am57xx_evm_config. Then make. Copy MLO and u-boot.img to an SD Card, boot the board from the SD Card and flash it:

    sf probe

    sf erase 0 0x200000

    load mmc 0 0x82000000 MLO

    sf write 0x82000000 0 0x20000

    load mmc 0 0x82000000 u-boot.img

    sf write 0x82000000 0x40000 <size of image in hex>

    Remove SD Card, since QSPI is already in the boot order, just type in reset at the u-boot command prompt.

    Steve K.

  • Steve
    thanks for the help