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.

66AK2H14: SPI NOR flash read/write speed issue.

Part Number: 66AK2H14

Hi,

We are currently working on an home-made board using 66AK2H14 SoC. Everything works fine until now. We are using U-boot and Linux that we featured for our board. 

Our base was what is provided in ti-processor-sdk-linux-k2hk-evm-05.00.00.15.

Until now, we focused on making everything working to meet our needs in terms of functionality.

However, it is now the time to work on optimisation and particularly on the boot time. 

What we saw for already 2 years is that we have very poor SPI NOR flash read/write performances.

What we observed in Linux (looks to be the same in U-boot):

Read: 610kB/s

Write:420kB/s

On a baremetal test done by our hardware team, it has been observed a reading speed of around 5,2MB/s while we have a theorical value around 6MB/s. It is closer to what we expect.

We also compared a READ_ID command treated in baremetal and in U-boot. While in baremetal, it takes 2 us to send the command READ_ID and read the 6 first bytes (time between the reading of a byte = 33ns), in U-boot, it takes 39us ( there is some big timing between the reading of 2 successive bytes => about microseconds or ten us). 

You can see it on the blue curve below. 

The reading speed particularly impacts our boot time. We really need to fix that.

Do you have any idea about this?

 

Some more information:

We already played with delay register (wdelay). It doesn't change anything and it is currently fixed to 0.

Our SPI frequency is 50 MHz. 

Thank you in advance for your help.

Best regards,

K.Luong

  • HI,

    Try increasing the core frequency... What is the current core frequency? 1 GHz or 800 MHz?

    Regards

    Shankari G

  • Hi,

    The ARM core frequency is 1.4 GHz.

    Best regards,

    K.Luong

  • K.Luong,

    If you have 66AK2H14 - TI-EVM, do the same test with u-boot/Linux and compare the speed with your custom board.

    This comparison will help you in narrow down if there are any differences. Check whether it takes 33 ns or 39 us.

    If it takes 39 ns, compare the configuration portion of the baremetal code and the u-boot/Linux source.

    If it takes 33 ns, compare the differences between the TI-EVM and the custom board , interms of NOR chip memory selected and used etc...

    We also compared a READ_ID command treated in baremetal and in U-boot. While in baremetal, it takes 2 us to send the command READ_ID and read the 6 first bytes (time between the reading of a byte = 33ns), in U-boot, it takes 39us ( there is some big timing between the reading of 2 successive bytes => about microseconds or ten us). 

    You can see it on the blue curve be

    It is good that you compared the READ_ID command using baremetal code. It indicates that your custom board is capable of reading in 33 ns.

    If it takes 2 us in baremetal and 39 us in U-boot, compare the code of the baremetal vs the u-boot particularly on the SPI-NOR configuration.

    Most likely the configuration might be different.....

    Regards

    Shankari G

  • Hi Luong,

    Please change the "spi-max-frequency" in,

    1. U-Boot : /home/${USER}/ti-processor-sdk-linux-k2hk-evm-06.03.00.106/board-support/u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3/arch/arm/dts/keystone-k2hk-evm.dts 
    2. Kernel : /home/${USER}/ti-processor-sdk-linux-k2hk-evm-06.03.00.106/board-support/u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3/arch/arm/dts/keystone-k2hk-evm.dts

    &spi0 {
    	status = "okay";
    	nor_flash: n25q128a11@0 {
    		#address-cells = <1>;
    		#size-cells = <1>;
    		compatible = "Micron,n25q128a11", "spi-flash";
    		spi-max-frequency = <54000000>;
    		m25p,fast-read;
    		reg = <0>;
    
    		partition@0 {
    			label = "u-boot-spl";
    			reg = <0x0 0x80000>;
    			read-only;
    		};
    
    		partition@1 {
    			label = "misc";
    			reg = <0x80000 0xf80000>;
    		};
    	};
    };
    

    By default, for K2H EVM with "Micron N25Q128A11", this Device tree binding is applicable. Kindly check with the NOR flash that you were using.

    For documentation of DTB bindings, kindly refer to the following location,

    1. U-Boot : /home/${USER}/ti-processor-sdk-linux-k2hk-evm-06.03.00.106/board-support/linux-4.19.94+gitAUTOINC+be5389fd85-gbe5389fd85/Documentation/devicetree/bindings/spi/spi-bus.txt
    2. Kernel : /home/${USER}/ti-processor-sdk-linux-k2hk-evm-06.03.00.106/board-support/u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3/doc/device-tree-bindings/spi/spi-bus.txt

    Thanks,

    Rajarajan U

  • Hi,

    Thank you for your answers.

    I will work on this read/write speed issue on december.

    @ My frequency is already set to what is expected for our board in the device tree sources.

    @ I will check what is done by our hardware team. They did simple things for their test. I expect Linux and U-boot to do many things that are not necessary and then cause the slow read/write speed issues.

    I will come back to you later to let you know if I have found something.

    Best Regards,

    K.LUONG

  • K.LUONG,

    Thanks for your update.

    Take your convenient time.

    We will keep waiting.

    Meanwhile, I have experimented on the C66x core with 1.2 GHz core frequency and could drive the SPI peripheral at 200 MHz.

    Regards

    Shankari G