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 on custom AM437x board

Part Number: AM4378

Hi,
I'm currently porting the linux kernel on a custom am437x board (based on am437x-gp-evm).
SDK: ti-processor-sdk-linux-am437x-evm-11.02.05.02-Linux-x86-Install.bin

I am trying to enable QSPI by referring to 'am437x-sk-evm.dts'

Here is my DTS configuration.

/* QSPI */
	qspi1_default: qspi1-default-pins {
		pinctrl-single,pins = <
			AM4372_IOPAD(0x888, PIN_OUTPUT | MUX_MODE2) /* (B12) gpmc_csn3.qspi_clk */
			AM4372_IOPAD(0x87c, PIN_OUTPUT | MUX_MODE3) /* (A8) gpmc_csn0.qspi_csn */
			AM4372_IOPAD(0x890, PIN_INPUT | MUX_MODE3) /* (A9) gpmc_advn_ale.qspi_d0 */
			AM4372_IOPAD(0x894, PIN_INPUT | MUX_MODE3) /* (E10) gpmc_oen_ren.qspi_d1 */
			AM4372_IOPAD(0x898, PIN_INPUT | MUX_MODE3) /* (D10) gpmc_wen.qspi_d2 */
			AM4372_IOPAD(0x89c, PIN_INPUT | MUX_MODE3) /* (C10) gpmc_be0n_cle.qspi_d3 */
		>;
	};
.
.
.
/* Enable qspi, 16MB S25FL128S norflash */
&qspi {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&qspi1_default>;

//	qspi-gpio = <&gpio1 16 GPIO_ACTIVE_LOW>;
	spi-max-frequency = <24000000>;
	flash@0 {
		compatible = "s25fl128s", "IS25LP128";
		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 0x000080000>;
		};
		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 0x0500000>;
		};
		partition@6 {
			label = "QSPI.FILESYSTEM";
			reg = <0x00650000 0x9B0000>;
		};
	};
};

However, after kernel boots,
 - 'cat /proc/mtd' shows nothing
 - Kernel log shows: [    0.806620] spi-nor spi0.0: unrecognized JEDEC id bytes: 00 00 00 00 00 00

Is there anything wrong in my DTS configuration? or Do I need additional configuration for QSPI on AM437x? 

  • Hi Kim,

    Can you share your part number, and configs?

    From where is your U-boot loading?

    Regards,
    Vinu

  • Hi,

    What do you mean by part number and configs?

    If you are referring to the QSPI part number, it is S25FL128SAGNFI00.

    And U-boot is booted from SD card.

    Regards,
    Kim

  • Hi Kim,

    What do you mean by part number and configs?

    I meant the QSPI part number, and the current kernel config.

    Please share the kernel config too.

    Regards,
    Vinu

  • Hi,

    Here's the .config file.

    3223.configs.txt

  • Hi Kim,

    I'll check this and get back to you.

    Regards,
    Vinu

  • Hi Kim,

    Please try the following.

    /* QSPI */
    	qspi1_default: qspi1-default-pins {
    		bootph-all;
    		pinctrl-single,pins = <
    			AM4372_IOPAD(0x888, PIN_OUTPUT | MUX_MODE2) /* (B12) gpmc_csn3.qspi_clk */
    			AM4372_IOPAD(0x87c, PIN_OUTPUT_PULLUP | MUX_MODE3) /* (A8) gpmc_csn0.qspi_csn */
    			AM4372_IOPAD(0x890, PIN_INPUT_PULLUP | MUX_MODE3) /* (A9) gpmc_advn_ale.qspi_d0 */
    			AM4372_IOPAD(0x894, PIN_INPUT_PULLUP | MUX_MODE3) /* (E10) gpmc_oen_ren.qspi_d1 */
    			AM4372_IOPAD(0x898, PIN_INPUT_PULLUP | MUX_MODE3) /* (D10) gpmc_wen.qspi_d2 */
    			AM4372_IOPAD(0x89c, PIN_INPUT_PULLUP | MUX_MODE3) /* (C10) gpmc_be0n_cle.qspi_d3 */
    		>;
    	};
    .
    .
    .
    /* Enable qspi, 16MB S25FL128S norflash */
    &qspi {
    	bootph-all;
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&qspi1_default>;
    
    //	qspi-gpio = <&gpio1 16 GPIO_ACTIVE_LOW>;
    	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 0x000080000>;
    		};
    		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 0x0500000>;
    		};
    		partition@6 {
    			label = "QSPI.FILESYSTEM";
    			reg = <0x00650000 0x9B0000>;
    		};
    	};
    };

    Updated pin-configs with pullups, corrected the compatible strings.

    Please check this and let me know.

    Regards,
    Vinu

  • Hi,

    After modifying the DTS as you instructed, it works well now.

    Thanks,