Hi,
I'm flashing U-Boot using the official U-Boot source from:
git://git.denx.de/u-boot.git
(U-Boot version: 2024.04+gen7+g1df7bf535+dirty-wip)
However, during boot, I'm encountering the following errors:
Loading Environment from SPIFlash... fsl_qspi spi@21e0000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19
SF: Detected w25q512jveiq with page size 256 Bytes, erase size 64 KiB, total 64 MiB
Could not find a valid device for 21e0000.qspi
Partition ubi-partition not found!
Error, no UBI device selected!
UBIFS error (pid: 1): cannot open "ubi0:", error -22
Error reading superblock on volume 'ubi0:' errno=-22!
It seems the QSPI flash is partially detected, but then not properly assigned to a device, and UBI fails to mount. I'm unsure if this is a device tree issue, misconfiguration in U-Boot, or something else.
I’ve tried the following to fix the issue:
Ensured the correct device tree is used.
Verified the CONFIG_SPI_FLASH and CONFIG_UBIFS settings in the .config.
Any advice on how to resolve this issue or areas to look further into would be greatly appreciated!
Thanks in advance!
Hello @LoKi
Could you please share the device tree related to the QSPI?
Also, be sure there is configured well in your .config the below parameters:
CONFIG_SPI_FLASH=y
CONFIG_SPI_FLASH_WINBOND=y
CONFIG_MTD=y
CONFIG_MTD_SPI_NOR=y
CONFIG_CMD_SF=y
CONFIG_CMD_MTDPARTS=y
CONFIG_CMD_UBI=y
CONFIG_CMD_UBIFS=y
CONFIG_UBIFS_SILENCE_MSG=y
Also, be sure the driver compatibility for the QSPI.
Best regards,
Salas.
Thanks for the details.
Here is the QSPI-related device tree configuration from imx6ul-14x14-evk.dtsi:
&qspi {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_qspi>;
status = "okay";
ddrsmp = <0>;
num-cs = <1>;
flash0: w25q512jveiq@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "winbond,w25q512jveiq", "jedec,spi-nor";
spi-max-frequency = <50000000>;
spi-nor,ddr-quad-read-dummy = <6>;
spi-rx-bus-width = <4>;
spi-tx-bus-width = <1>;
reg = <0>;
};
};
Pin configuration:
pinctrl_qspi: qspigrp {
fsl,pins = <
MX6UL_PAD_NAND_WP_B__QSPI_A_SCLK 0x70a1
MX6UL_PAD_NAND_READY_B__QSPI_A_DATA00 0x70a1
MX6UL_PAD_NAND_CE0_B__QSPI_A_DATA01 0x70a1
MX6UL_PAD_NAND_CE1_B__QSPI_A_DATA02 0x70a1
MX6UL_PAD_NAND_CLE__QSPI_A_DATA03 0x70a1
MX6UL_PAD_NAND_DQS__QSPI_A_SS0_B 0x70a1
>;
};
QSPI controller from imx6ul.dtsi:
qspi: spi@21e0000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,imx6ul-qspi";
reg = <0x021e0000 0x4000>, <0x60000000 0x10000000>;
reg-names = "QuadSPI", "QuadSPI-memory";
interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX6UL_CLK_QSPI>, <&clks IMX6UL_CLK_QSPI>;
clock-names = "qspi_en", "qspi";
status = "okay";
};
Also, in the alias section:
spi0 = &qspi;
spi1 = &ecspi1;
spi2 = &ecspi2;
spi3 = &ecspi3;
spi4 = &ecspi4;
Regarding kernel configuration, the following options are already enabled:
CONFIG_SPI_FLASH=y
CONFIG_SPI_FLASH_WINBOND=y
CONFIG_MTD=y
CONFIG_CMD_SF=y
CONFIG_CMD_MTDPARTS=y
CONFIG_CMD_UBI=y
CONFIG_CMD_UBIFS=y
The following two are currently not enabled:
CONFIG_MTD_SPI_NOR
CONFIG_UBIFS_SILENCE_MSG
Let me know if you'd like me to enable these as well or if anything else needs reviewing.
Best regards,
Loki