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.

AM3352: AM3352: SPI Flash Probe Failure in SPL during U-Boot 2025.01 Migration

Part Number: AM3352

Hi TI Experts,

I am currently migrating a custom AM3352 board from U-Boot 2013.10 to 2025.01. While I have successfully achieved a stable boot via SD card and eMMC, I am encountering persistent issues with SPI Flash initialization during the SPL stage.

The Issue

  • U-Boot Prompt: Once in the full U-Boot environment, the SPI Flash is detected correctly. I can perform sf probe, read, and write operations without issues.

  • SPL Stage: When attempting to boot using MLO.byteswap and u-boot.img from SPI Flash, the SPL fails to probe the device. The console reports a SPI Flash probe failure, preventing the loading of the second-stage bootloader.

Device Tree Challenges

I’ve encountered significant friction with the Device Tree configuration. Specifically:

  1. Node Conflicts: If I reference the &spi0 node directly in my custom-board.dts , the node does not bind correctly.

  2. Workaround: To get it working in the U-Boot prompt, I had to create a separate include file, copy the SPI node from the SoC dtsi, and rename the SPI instance to avoid duplication errors. It seems the default am33xx-l4.dtsi structure is conflicting with my board-level definitions.

Request for Guidance

  • How is SPI Flash initialization explicitly handled in the SPL under the modern Driver Model (DM)?

  • Are there specific u-boot,dm-spl or u-boot,dm-pre-reloc properties required in the AM33xx SPI/Pinmux nodes to ensure the driver is available before relocation?

  • What is the recommended way to override the am33xx-l4.dtsi SPI nodes in a custom board dts to avoid the "duplicate node" or binding errors I'm seeing?

Environment Details:

  • SoC: AM3352

  • SDK :  11.02.05.02
  • U-Boot Version: 2025.01

  • Boot Media: SPI Flash (W25Q )

  • Defconfig: Custom (based on am335x_evm_defconfig)

Any insights on the proper DTS hierarchy for SPI in the SPL would be greatly appreciated.

If i simply call the spi0 node in the custom-board.dts:

&spi0 {
	pinctrl-names = "default";
	pinctrl-0 = <&spi0_pins_default>;
	status = "okay";
	u-boot,dm-spl;
	

	spi_nor: flash@0 {
		 #address-cells = <1>;
		 #size-cells = <1>;
		 //compatible = "winbond,w25q64cv";
		 compatible = "winbond,w25q64cv" , "jedec,spi-nor";
		 //spi-max-frequency = <24000000>;
		 //m25p,fast-read;
		 reg = <0>;
		//clocks = <&l4ls_clkctrl AM3_L4LS_SPI0_CLKCTRL 0>;
		//clock-names = "fck";
		 
		 spi-max-frequency = <25000000>;
   		 spi-tx-bus-width = <1>;
   		 spi-rx-bus-width = <1>;
   		 spi-cpol;
   		 spi-cpha;
		 


		 partition@0 {
			 label = "u-boot-spl";
			 reg = <0x000000 0x80000>;
		 };


		 partition@1 {
			 label = "u-boot";
			 reg = <0x80000 0x100000>;
		 };

		 partition@2 {
			 label = "env1";
			 reg = <0x180000 0x20000>;
		 };

		 partition@3 {
			 label = "env2";
			 reg = <0x1A0000 0x660000>;
		 };
	};
};

it will show:

Hit any key to stop autoboot:  0 
=> sf probe 0
drivers/clk/clk-uclass.c:90-clk_get_by_index_tail() get: returning err=-19
drivers/bus/ti-sysc.c:61-ti_sysc_get_one_clock() ti_sysc target-module@30000: failed to get fck clock
drivers/spi/spi-uclass.c:339-  spi_get_bus_and_cs() Invalid bus 0 (err=-19)
Failed to initialize SPI flash at 0:0 (error -19)

  
the modification made: changed the spi number from spi0 to spi3 to avoid the duplicate error and created a separate include file:

custom-board-include.dtsi

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>
#include <dt-bindings/clock/am3.h>


/ {
	compatible = "ti,am33xx";
	interrupt-parent = <&intc>;
	#address-cells = <1>;
	#size-cells = <1>;
	chosen { };
	
	aliases {
		spi0 = &spi3;
	};
	
		spi3: spi@48030000 {
			compatible = "ti,omap4-mcspi";
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0x48030000 0x400>;
			interrupts = <65>;
			ti,spi-num-cs = <2>;
			ti,hwmods = "spi0";
			dmas = <&edma 16 0
				&edma 17 0
				&edma 18 0
				&edma 19 0>;
			dma-names = "tx0", "rx0", "tx1", "rx1";
			status = "disabled";
		};
		
};

then i called this in the custom-board.dts:

&spi3 {
	pinctrl-names = "default";
	pinctrl-0 = <&spi0_pins_default>;
	status = "okay";
	//u-boot,dm-spl;
	

	spi_nor: flash@0 {
		 #address-cells = <1>;
		 #size-cells = <1>;
		 //compatible = "winbond,w25q64cv";
		 compatible = "winbond,w25q64cv" , "jedec,spi-nor";
		 //spi-max-frequency = <24000000>;
		 //m25p,fast-read;
		 reg = <0>;
		 
		 spi-max-frequency = <25000000>;
   		 spi-tx-bus-width = <1>;
   		 spi-rx-bus-width = <1>;
   		 spi-cpol;
   		 spi-cpha;
		 


		 partition@0 {
			 label = "u-boot-spl";
			 reg = <0x000000 0x80000>;
		 };


		 partition@1 {
			 label = "u-boot";
			 reg = <0x80000 0x100000>;
		 };

		 partition@2 {
			 label = "env1";
			 reg = <0x180000 0x20000>;
		 };

		 partition@3 {
			 label = "env2";
			 reg = <0x1A0000 0x660000>;
		 };
	};
};

Hit any key to stop autoboot:  0 
=> sf probe 0
SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB
=> 

After detection, i can write the SPL and uboot.img

and when i try to load from SPI: i get:

U-Boot SPL 2025.01-g09bee8aeab7a-dirty (Feb 28 2026 - 11:26:38 +0530)
Trying to boot from SPI
SPI probe failed.
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

Also  i have been getting some clock related warning in the starting section also.

U-Boot SPL 2025.01-g09bee8aeab7a-dirty (Feb 28 2026 - 11:34:33 +0530)                  
Trying to boot from MMC1                                                               


U-Boot 2025.01-g09bee8aeab7a-dirty (Feb 28 2026 - 11:34:33 +0530)

CPU  : AM335X-GP rev 2.1
Model: COMPANY AM335x CUSTOM-BOARD_UBOOT
DRAM:  512 MiB
drivers/clk/clk-uclass.c:111-clk_get_by_index_tail() prop: returning err=-2
drivers/clk/clk-uclass.c:90-clk_get_by_index_tail() get: returning err=-19
drivers/bus/ti-sysc.c:61-ti_sysc_get_one_clock() ti_sysc target-module@9000: failed to get fck clock
drivers/clk/clk-uclass.c:111-clk_get_by_index_tail() prop: returning err=-2
Core:  128 devices, 15 uclasses, devicetree: separate
drivers/clk/clk-uclass.c:90-clk_get_by_index_tail() get: returning err=-19
NAND:  0 MiB
MMC:   drivers/clk/clk-uclass.c:90-clk_get_by_index_tail() get: returning err=-19
drivers/bus/ti-sysc.c:61-ti_sysc_get_one_clock() ti_sysc target-module@ae000: failed to get fck clock
OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from nowhere... OK
<ethaddr> not set. Validating first E-fuse MAC
Net:   Updated phy address for CPSW#0, old: 1869574703, new: 0
eth2: ethernet@4a100000
Hit any key to stop autoboot:  0 


I believe these are correlated: 

Any guidance would be helpful.

Regards,

Anandhu S

 
  • Hi Anandhu,

    Your workaround uses U-boot 2013.x era legacy clock mechanisms.

    ti,hwmods = "spi0";

    In the latest U-boot, the ti-sysc target interconnect has completely removed hwmods.

    The legacy properties will be ignored by latest u-boot.

    Also, your workaround skips the ti-sysc parent wrapper node entirely by redeclaring the SPI controller as a root level node, which means the SPI controller has no parent bus driver to provide clock and power. (It's working in u-boot since the clocks are already on by that time)

    The duplicate node error is an actual problem to fix. The conflict arises becuse am33xx-l4.dtsi actually defines spi0 inside a ti-sysc wrapper.

    The correct pattern would be to tag the both the target-module wrapper and spi0 child.

    */ In your custom-board.dtsi */
    &spi0_target {
        bootph-all; /* u-boot,dm-spl is the legacy propoerty */
    };
    
    &spi0 {
        bootph-pre-ram;
        status = "okay";
    
        flash@0 {
            bootph-pre-ram;
            compatible = "winbond,w25q64cv", "jedec,spi-nor";
            reg = <0>;
            spi-max-frequency = <25000000>;
            spi-cpol;
            spi-cpha;
        };
    };

    Also, since u-boot 2025.x comes as default with the SDK, please use it as the base reference, and make required changes than using older 2013.x as reference.

    Regards,
    Vinu