Should i modify source code when using different QSPI flash

Hi, I am using Jacinto 6, GLSDK 7.04.03.

If we replace eMMC to "N25Q064A13E12H0F" on DRA742-EVM 577G-02-21-00 board, should i modify any code?

As i see in dra7-evm.dts file, there are description about QSPI like below

&qspi {           

status = "okay";

 spi-max-frequency = <64000000>;
 m25p80@0 {
  compatible = "s25fl256s1";
  spi-max-frequency = <64000000>;

the value of compatible is the original QSPI flash, so i think i should modify here, am i right?

besides, is there any place should i modify too?

  • Hi Shawn,

    Do you work with DRA75x TI EVM or custom board? How exactly you are planning to replace eMMC with N25Q064A13E12H0F?

    On DRA75x TI EVM (J6EVM5777) have four different Flash memories (QSPI, eMMC, NAND and NOR). eMMC flash is connected to DRA75x MMC2 module, QSPI flash is connected to QSPI module, NOR and NAND flashes are connected to GPMC module.

    N25Q064A13E12H0F is serial NOR flash, which should be connected to QSPI module, you can not connect it to MMC module.

    Regards,
    Pavel

    Note:  If this answer solves your question please click the "Verify Answer" button.


  • In reply to Pavel Botev:

    Hi Pavel,

    I work on custom board with DRA74X. Now i try to replace QSPI flash(N25Q064A13E12H0F), and it will connect to QSPI module.
    So, should i modify code? or QSPI module will automatically recognize it?
  • In reply to shawn lin:

    Shawn,

    On DRA75x TI EVM, QSPI NOR flashed used is S25FL256SAGMFV001, attached to QSPI1 module. Do you want to replace S25FL256SAGMFV001 with N25Q064A13E12H0F on your custom board? Do you attach N25Q064A13E12H0F to QSPI1 module?

    And how eMMC is involved here? What exactly you need to know regarding eMMC?

    Regards,
    Pavel

    Note:  If this answer solves your question please click the "Verify Answer" button.


  • In reply to Pavel Botev:

    Shawn,

    Let me know also if you are planning to boot from this QSPI NOR flash. The default u-boot layout might not suit your 64Mbit/8MByte flash, see the below wiki pages for more info:

    processors.wiki.ti.com/.../Linux_Core_U-Boot_User's_Guide
    processors.wiki.ti.com/.../DRA7xx_GLSDK_Software_Developers_Guide

    You might use the "QSPI Development Boot Mode" where only MLO and u-boot.img are stored in QSPI flash.

    Regards,
    Pavel

    Note:  If this answer solves your question please click the "Verify Answer" button.


  • In reply to Pavel Botev:

    Hi Pavel,

    yes, i want to replace S25FL256SAGMFV001 with N25Q064A13E12H0F on our custom board, and still connect to QSPI1 module.
    I just want to know, should i modify code for this change.
    Besides, on our board, eMMC also gonna change, but i already ask at the other post.

    So, if i need too boot from QSPI with this flash, i only can use development boot mode, and only boot to u-boot without kernel, right?

  • In reply to shawn lin:

    Shawn,

    Let we first focus on u-boot.

    I assume you will use the same QSPI1 pins as in TI EVM, right?

    Then you should update the below file only:

    u-boot/arch/arm/dts/dra7-evm.dts

    &qspi {

    status = "okay";

    pinctrl-names = "default";

    pinctrl-0 = <&qspi1_pins>;

    spi-max-frequency = <64000000>;

    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>;

    /* MTD partition table.

    * The ROM checks the first four physical blocks

    * for a valid file to boot and the flash here is

    * 64KiB block size.

    */

    partition@0 {

    label = "QSPI.SPL";

    reg = <0x00000000 0x000010000>;

    };

    partition@1 {

    label = "QSPI.SPL.backup1";

    reg = <0x00010000 0x00010000>;

    };

    partition@2 {

    label = "QSPI.SPL.backup2";

    reg = <0x00020000 0x00010000>;

    };

    partition@3 {

    label = "QSPI.SPL.backup3";

    reg = <0x00030000 0x00010000>;

    };

    partition@4 {

    label = "QSPI.u-boot";

    reg = <0x00040000 0x00100000>;

    };

    partition@5 {

    label = "QSPI.u-boot-spl-os";

    reg = <0x00140000 0x00080000>;

    };

    partition@6 {

    label = "QSPI.u-boot-env";

    reg = <0x001c0000 0x00010000>;

    };

    partition@7 {

    label = "QSPI.u-boot-env.backup1";

    reg = <0x001d0000 0x0010000>;

    };

    partition@8 {

    label = "QSPI.kernel";

    reg = <0x001e0000 0x0800000>;

    };

    partition@9 {

    label = "QSPI.file-system";

    reg = <0x009e0000 0x01620000>;

    };

    };

    };

     

    You should replace the "s25fl256s1" string with n25q64a, see the below file for more info:

    u-boot/drivers/mtd/spi/sf_params.c

    shawn lin
    So, if i need too boot from QSPI with this flash, i only can use development boot mode, and only boot to u-boot without kernel, right?

    This depends on the size of the files (MLO, u-boot.img, DTB blob, u-boot env, uImage) and the QSPI layout. You can adjust the QSPI layout according to your specific needs in dra7-evm.dts file

    Regards,
    Pavel

     

    Note:  If this answer solves your question please click the "Verify Answer" button.


  • In reply to Pavel Botev:

    Hi Pavel,

    Thanks for your recommendation, i already can recognize qspi flash(N25Q128) in our custom board.
    Right now, i try to flash MLO & u-boot.img on it, but fail. I follow the steps from processors.wiki.ti.com/.../DRA7xx_GLSDK_Software_Developers_Guide
    , after i flash MLO.qspi, i read from qspi flash and compare with MLO.qspi file, it seems the data didn't write success.
    Do you have any idea why this happend?

    P.S. I can flash MLO & u-boot.img to qspi flash(S25FL256SAGMFV001) successfully, but i fail on "N25Q128".

    Regards,
    Shawn
  • In reply to shawn lin:

    Shawn,

    Have you made changes only in u-boot/arch/arm/dts/dra7-evm.dts file?

    Are you trying to flash MLO and u-boot.img at u-boot or user space level? Can you provide me full console log with successful flash and failing flash?

    Regards,
    Pavel

    Note:  If this answer solves your question please click the "Verify Answer" button.


  • In reply to Pavel Botev:

    Hi Pavel,

     

    I modify below files,

    1. J6_SDK/board-support/u-boot/boards.cfg   => use "QSPI_BOOT" to replace "ENV_IS_IN_MMC" in our config

    2. J6_SDK/board-support/u-boot/include/configs/xxx.h =>add " #define CONFIG_SPI_FLASH_STMICRO" to replace " #define CONFIG_SPI_FLASH_SPANSION". xxx is our project name

     

    I flash MLO & u-boot.img at u-boot level

     

    The successful flash log=>2425.qspi_flash(S25FL256SAGMFI003).log

    The fail flash log=>3581.qspi_flash(N25Q128).log

    The MLO.qspi file is=>MLO.txt

    I flash MLO.qspi into flash and read 256bytes back to compare with MLO.qspi file. The result in successful one is the same, but is different in N25Q128.

     

    Regards,

    Shawn

  • In reply to shawn lin:

    Shawn,

    shawn lin

    I modify below files,

    1. J6_SDK/board-support/u-boot/boards.cfg   => use "QSPI_BOOT" to replace "ENV_IS_IN_MMC" in our config

    2. J6_SDK/board-support/u-boot/include/configs/xxx.h =>add " #define CONFIG_SPI_FLASH_STMICRO" to replace " #define CONFIG_SPI_FLASH_SPANSION". xxx is our project name

    Do you modify u-boot/arch/arm/dts/dra7-evm.dts file?

    shawn lin
    The fail flash log=>(Please visit the site to view this file)

    You are using the below wiki:

    Can you try with the exact commands:

    uboot# mmc dev 0 (not U-Boot# M mmc dev 0)

    uboot# fatload mmc 0 0x82000000 MLO.qspi (not U-Boot# fatload mmc 0 0x82000000 MLO.Q qspi)

    Can you also try with the below set of commands, will be there any difference?

    http://processors.wiki.ti.com/index.php/Linux_Core_U-Boot_User's_Guide#Writing_to_QSPI_from_U-Boot

    shawn lin
    I flash MLO.qspi into flash and read 256bytes back to compare with MLO.qspi file. The result in successful one is the same, but is different in N25Q128.

    So you have different DDR3 dump every time for N25Q128. Have you verify your DDR3 memory is correct? That might be DDR3 memory issue, not QSPI.

    Regards,
    Pavel

    Note:  If this answer solves your question please click the "Verify Answer" button.