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.

Linux/AM5728: Using QSPI and SPI Flash together

Part Number: AM5728

Tool/software: Linux

Hi,

I'm using AM572x custom board

How to use QSPI & MCSPI Flash together in U-BOOT

I want to use SPI & Quad SPI together.

But, I cannot use it. When I use "u-boot sf probe command"......  it doesn't work.

=> sf probe 0:0
SF: Detected S25FL256S_64K with page size 256 Bytes, erase size 64 KiB, total 32 MiB, mapped at 5c000000
=> sf probe 0:1
SF: Unsupported flash IDs: manuf 00, jedec 0000, ext_jedec 0000
Failed to initialize SPI flash at 0:1 (error -93)
=> sf probe 0:2
SF: Unsupported flash IDs: manuf 00, jedec 0000, ext_jedec 0000
Failed to initialize SPI flash at 0:2 (error -93)
=> sf probe 0:3
SF: Unsupported flash IDs: manuf 00, jedec 0000, ext_jedec 0000
Failed to initialize SPI flash at 0:3 (error -93)
=> sf probe 0:4
SF: Detected S25FL256S_64K with page size 256 Bytes, erase size 64 KiB, total 32 MiB, mapped at 5c000000
=> sf probe 1:0
Invalid bus 1 (err=-19)
Failed to initialize SPI flash at 1:0 (error -19)
=> sf probe 1:1
Invalid bus 1 (err=-19)
Failed to initialize SPI flash at 1:1 (error -19)
=> sf probe 1:2
Invalid bus 1 (err=-19)
Failed to initialize SPI flash at 1:2 (error -19)
=> sf probe 1:3
Invalid bus 1 (err=-19)
Failed to initialize SPI flash at 1:3 (error -19)
=> sf probe 2:0
Invalid bus 2 (err=-19)
Failed to initialize SPI flash at 2:0 (error -19)
=> sf probe 2:1
Invalid bus 2 (err=-19)
Failed to initialize SPI flash at 2:1 (error -19)
=> sf probe 2:2
Invalid bus 2 (err=-19)
Failed to initialize SPI flash at 2:2 (error -19)

I want to show your opinion.

Thank you.

Pinmux U-Boot

QSPI:

{GPMC_A13, (M1 | PIN_INPUT_PULLDOWN | MANUAL_MODE)}, /* gpmc_a13.qspi1_rtclk */
{GPMC_A14, (M1 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_a14.qspi1_d3 */
{GPMC_A15, (M1 | PIN_INPUT_PULLUP | MANUAL_MODE)}, /* gpmc_a15.qspi1_d2 */
{GPMC_A16, (M1 | PIN_INPUT_PULLDOWN | MANUAL_MODE)}, /* gpmc_a16.qspi1_d0 */
{GPMC_A17, (M1 | PIN_INPUT_PULLDOWN | MANUAL_MODE)}, /* gpmc_a17.qspi1_d1 */
{GPMC_A18, (M1 | PIN_INPUT_PULLDOWN | MANUAL_MODE)}, /* gpmc_a18.qspi1_sclk */

SPI1

{SPI1_SCLK, (M0 | PIN_INPUT_PULLDOWN | MANUAL_MODE)}, /* gpmc_a18.qspi1_sclk */
{SPI1_D1, (M0 | PIN_INPUT_PULLDOWN)}, /* spi1_d1.gpio7_8 */
{SPI1_D0, (M0 | PIN_INPUT_PULLDOWN)}, /* spi1_d0.gpio7_9 */
{SPI1_CS0, (M0 | PIN_INPUT_PULLDOWN)}, /* spi1_cs0.gpio7_10 */

U-Boot dts file (am572x-idk.dts)

&qspi {
status = "okay";

spi-max-frequency = <76800000>;
m25p80@0 {
compatible = "s25fl256s1","spi-flash";
spi-max-frequency = <76800000>;
reg = <0>;
spi-tx-bus-width = <1>;
spi-rx-bus-width = <4>;
#address-cells = <1>;
#size-cells = <1>;

};

};

&mcspi1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&mcspi1_pins>;
m25p80@1{
compatible = "N25Q256A","spi-flash";
reg = <0>;
};
};

My Development Environment

Host PC OS: Ubuntu 16.04 linux 64bit

AM5728 SDK: u-boot-2016.05 / linux-rt-4.4.19

AM5728 SDK Ver: ti-processor-sdk-linux-rt-am57xx-evm-03.01.00.06

IPC: ipc_3_43_02_04

XDC: xdctools_3_32_00_06_core

Thanks and best regards.

John.

  • The software team have been notified. They will respond here.
  • Thank you for your answers.

    SPI Flash Information.
    QSPI: S25FL256SAGMFIR0 (Quad)
    MCSPI: N25Q256A13ESF40 (SPI)

    QSPI is Working.
    But. MCSPI is not detected from u-boot

    Best Regards
    John
  • Can't use QSPI and SPI together?
    Please advise.
  • Hi,

    You should be able to use both MCSPI & QSPI. Have you enabled the spi driver (drivers/spi/omap3_spi)? It is not enabled by default.
    See the Kconfig file in drivers/spi & add the corresponding defines in include/configs/am57xx_evm.h.

    Best Regards,
    Yordan
  • Hi Yordan,

    I had already tried to define CONFIG_OMAP3_SPI .
    But, QSPI code and SPI codes conflict with each other.

    I think need to combine two codes. Is it correct?
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    spl/drivers/spi/ti_qspi.o: In function `spi_init':
    /sanion/ur_ied/master/board-support/u-boot-2016.05/drivers/spi/ti_qspi.c:329: multiple definition of `spi_init'
    spl/drivers/spi/omap3_spi.o:/sanion/ur_ied/master/board-support/u-boot-2016.05/drivers/spi/omap3_spi.c:466: first defined here
    spl/drivers/spi/ti_qspi.o: In function `spi_flash_copy_mmap':
    /sanion/ur_ied/master/board-support/u-boot-2016.05/drivers/spi/ti_qspi.c:284: multiple definition of `spi_setup_slave'
    spl/drivers/spi/omap3_spi.o:/sanion/ur_ied/master/board-support/u-boot-2016.05/drivers/spi/omap3_spi.c:118: first defined here
    spl/drivers/spi/ti_qspi.o: In function `spi_flash_copy_mmap':
    /sanion/ur_ied/master/board-support/u-boot-2016.05/drivers/spi/ti_qspi.c:284: multiple definition of `spi_free_slave'
    spl/drivers/spi/omap3_spi.o:/sanion/ur_ied/master/board-support/u-boot-2016.05/drivers/spi/omap3_spi.c:118: first defined here
    spl/drivers/spi/ti_qspi.o: In function `spi_flash_copy_mmap':
    /sanion/ur_ied/master/board-support/u-boot-2016.05/drivers/spi/ti_qspi.c:284: multiple definition of `spi_claim_bus'
    spl/drivers/spi/omap3_spi.o:/sanion/ur_ied/master/board-support/u-boot-2016.05/drivers/spi/omap3_spi.c:118: first defined here
    spl/drivers/spi/ti_qspi.o: In function `spi_flash_copy_mmap':
    /sanion/ur_ied/master/board-support/u-boot-2016.05/drivers/spi/ti_qspi.c:284: multiple definition of `spi_release_bus'
    spl/drivers/spi/omap3_spi.o:/sanion/ur_ied/master/board-support/u-boot-2016.05/drivers/spi/omap3_spi.c:118: first defined here
    spl/drivers/spi/ti_qspi.o: In function `spi_flash_copy_mmap':
    /sanion/ur_ied/master/board-support/u-boot-2016.05/drivers/spi/ti_qspi.c:284: multiple definition of `spi_xfer'
    spl/drivers/spi/omap3_spi.o:/sanion/ur_ied/master/board-support/u-boot-2016.05/drivers/spi/omap3_spi.c:118: first defined here
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


    Best Regards,
    John