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.

AM4378: QSPI not detected in U-boot

Part Number: AM4378

Hi,

I have ported U-Boot to a custom AM437x board. I used Ti's SDK: ti-processor-sdk-linux-am437x-evm-11.02.05.02-Linux-x86-Install.bin. 

After modifying U-Boot for my board, I booted the system using a SD card.

However, it seems that QSPI is not being recognized. When I enter 'sf probe' command in the console, the following message appears:

jedec_spi_nor flash@0: unrecognized JEDEC id bytes: 00, 00, 00
Failed to initialize SPI flash at 0:0 (error -2)

Below is the dts file and configuration file.

am437x-upe1.dts.txt 

configs.txt 

I'm not sure whether the issue is caused by the dts file or the configuratoin.

Ultimately, I would like to boot U-Boot from QSPI.

  • Hi Kim,

    Can you try adding bootph-pre-ram for your am43xx_pinmux and qspi nodes?

    Can you try with this modified DTS nodes?

    qspi1_default: qspi1-default-pins {
        bootph-pre-ram;
    	pinctrl-single,pins = <	
    		AM4372_IOPAD(0x87c, PIN_OUTPUT_PULLUP | MUX_MODE3)	/* gpmc_csn0.qspi_csn */
    		AM4372_IOPAD(0x888, PIN_OUTPUT | MUX_MODE2)		/* gpmc_csn3.qspi_clk */
    		AM4372_IOPAD(0x890, PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_advn_ale.qspi_d0 */
    		AM4372_IOPAD(0x894, PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_oen_ren.qspi_d1 */
    		AM4372_IOPAD(0x898, PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_wen.qspi_d2 */
    		AM4372_IOPAD(0x89c, PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_be0n_cle.qspi_d3 */
    	>;
    };

    Pull-ups are enabled.

    &qspi {
        bootph-pre-ram;
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&qspi1_default>;
    
    	spi-max-frequency = <24000000>;
    	flash@0 {
    		compatible = "spansion,s25fl128s", "jedec,spi-nor";
    		spi-max-frequency = <24000000>;
    		reg = <0>;
    		// spi-cpol;
    		// spi-cpha;
    		spi-tx-bus-width = <1>;
    		spi-rx-bus-width = <4>;
    		#address-cells = <1>;
    		#size-cells = <1>;
    
    		/* MTD partition table.
    		 * The ROM checks the first 512KiB
    		 * for a valid file to boot(XIP).
    		 */
    		partition@0 {
    			label = "QSPI.U_BOOT";
    			reg = <0x00000000 0x00080000>;
    		};
    		partition@1 {
    			label = "QSPI.U_BOOT.backup";
    			reg = <0x00080000 0x00080000>;
    		};
    		partition@2 {
    			label = "QSPI.U_BOOT_ENV";
    			reg = <0x00100000 0x00020000>;
    		};
    		partition@3 {
    			label = "QSPI.U-BOOT-ENV.backup";
    			reg = <0x00120000 0x00020000>;
    		};
    		partition@4 {
    			label = "QSPI.U-BOOT-DEVICETREE";
    			reg = <0x00140000 0x00010000>;
    		};
    		partition@5 {
    			label = "QSPI.KERNEL";
    			reg = <0x00150000 0x00500000>;
    		};
    		partition@6 {
    			label = "QSPI.FILESYSTEM";
    			reg = <0x00650000 0x9B0000>;
    		};
    	};
    };

    Removed spi-cpol and spi-cpha, so that the flash is probed in the default mode first (Mode 0).

    Regards,
    Vinu

  • Hi,

    I tried following your instructions, but it is still not recognized.

    like below.

    => sf probe
    jedec_spi_nor flash@0: unrecognized JEDEC id bytes: 00, 00, 00
    Failed to initialize SPI flash at 0:0 (error -2)

  • Hi Kim,

    According to the U-boot proting guide of AM437x, https://software-dl.ti.com/processor-sdk-linux/esd/AM437X/latest/exports/docs/linux/How_to_Guides/Board_Port/U-Boot.html , 

    "Any pinmux settings made in the device tree file are not applicable and not used by U-Boot. The reason those are there is that usually the U-Boot device tree file is a copy of the Linux device tree file as this simplifies keeping those in sync. This does not mean however that all entries such as pinmux are applicable to U-Boot."

    Can you try adding these pinmux configs to the mux.c board file?

    Regards,
    Vinu

  • Hi,

    After modifying the source code based on your guidance, it works properly now.

    I added 'configure_module_pin_mux(qspi_pin_mux);' inside the 'enable_board_pin_mux()' function in mux.c.

    Thanks a lot.

    Regards,

    Kim