AM625: SPI0 false detection.

Part Number: AM625

Tool/software:

Hello There,

we have custom board based on AM625.

Which has two flash on main_spi0 with CS0 and CS1.

Issue : I unmounted the flash IC from CS1 and boot device, still it's detecting the flash on CS1. It's showing false detection.

root@sm2s-am6254:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 10000000 00020000 "spi0.0"
mtd1: 00800000 00001000 "spi1.1"  <<< false detection   
mtd2: 00800000 00001000 "spi1.0"
mtd3: 00800000 00001000 "spi2.1"  <<< false detection
mtd4: 00800000 00001000 "spi2.0"
root@sm2s-am6254:~#

 

Device tree given below.

&main_pmx0 {
	main_spi0_pins_default: main-spi0-pins-default {
					pinctrl-single,pins = <
							AM62X_IOPAD(0x1bc, PIN_OUTPUT, 0) /* (A14) SPI0_CLK */
							AM62X_IOPAD(0x1c0, PIN_INPUT, 0) /* (B13) SPI0_D0 */
							AM62X_IOPAD(0x1c4, PIN_INPUT, 0) /* (B14) SPI0_D1 */
							AM62X_IOPAD(0x1b4, PIN_OUTPUT, 0) /* (A13) gpio1.15 SPI0_CS0 */
							AM62X_IOPAD(0x1b8, PIN_OUTPUT, 0) /* (C13) gpio1.16 SPI0_CS1 */
					>;
			};
};

&main_spi0 {
        status="okay";
        pinctrl-names = "default";
        pinctrl-0 = <&main_spi0_pins_default>;
        ti,spi-num-cs = <2>;
        ti,pindir-d0-out-d1-in;
		
		flash1@0 {
                                compatible = "winbond,w25q64dw", "jedec,spi-nor";
                                spi-max-frequency = <24000000>;
                                m25p,fast-read;
                                reg = <0x0>;
                        };
						
		flash2@1 {
                                compatible = "winbond,w25q64dw", "jedec,spi-nor";
                                spi-max-frequency = <24000000>;
                                m25p,fast-read;
                                reg = <0x1>;
                        };
};




We have probed the signals of CS0 and CS1, both pins goes low at a time. Attaching the signal below.




Please guide us what can be the issue ? Is it about chip select time-out ?


Thanks and regards,
Ishan

  • Hi Ishan,

    Are you defining any mtd partitions in the device tree? How does that look like?

    Also, what does your kernel command line look like (`cat /proc/cmdline`)? Usually partitions get passed in that way via `mtdparts`. This mechanism overrides what's in the device tree (can also be controlled via CONFIG_MTD_CMDLINE_PARTS).

    Lastly, (probably nothing to do with the issue you are raising here) but SPI0_CLK should be defined as PIN_INPUT, there's a note in regards to this in the TRM.

    Regards, Andreas