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.

AM625: Can't boot with ubi filesystem

Part Number: AM625

We are testing boot from nor flash on AM62x Customer Board. We burned the Image, dtb, ubifs to flash, configured uboot parameters and linux device tree. But the following error was reported after startup.

I found that when the kernel starts, the flash is not devided according to the specified partition. It has only two partitions(data0 and data1) , and it's not what we want.

Our configuration in the Linux device tree is like this

&ospi0 {
	spi_nor_flash: flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0x0>;
		spi-tx-bus-width = <4>;
		spi-rx-bus-width = <4>;
		spi-max-frequency = <25000000>;
		cdns,tshsl-ns = <60>;
		cdns,tsd2d-ns = <60>;
		cdns,tchsh-ns = <60>;
		cdns,tslch-ns = <60>;
		cdns,read-delay = <4>;
		cdns,phy-mode;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "tiboot3";
				reg = <0x0 0x80000>;
			};

			partition@80000 {
				label = "tispl";
				reg = <0x80000 0x200000>;
			};

			partition@280000 {
				label = "u-boot";
				reg = <0x280000 0x400000>;
			};

			partition@680000 {
				label = "env";
				reg = <0x680000 0x40000>;
			};

			partition@6c0000 {
				label = "env.backup";
				reg = <0x6c0000 0x40000>;
			};

			partition@700000 {
				label = "fdt";
				reg = <0x700000 0x20000>;
			};

			partition@720000 {
				label = "kernel";
				reg = <0x720000 0x1400000>;
			};

			partition@1b20000 {
				label = "system";
				reg = <0x1b20000 0x5ea0000>;
			};

			partition@79c0000 {
				label = "app";
				reg = <0x79c0000 0x5000000>;
			};

			partition@c9c0000 {
				label = "datalog";
				reg = <0xc9c0000 0x2b00000>;
			};

			partition@f4c0000 {
				label = "syslog";
				reg = <0xf4c0000 0xb00000>;
			};

			partition@ffc0000 {
				label = "phypattern";
				reg = <0xffc0000 0x40000>;
			};
		};
	};
};

the uboot parameters is likes below

Please help to see if this configuration is ok, and how to mount the ubifs ?

Regards, 

Stephen

  • Hi Stephen,

    Which SDK version is this project based on?

    And how does your 'mtdparts' ENV variable look in U-Boot?

    Regards, Andreas

  • Hi Andreas,

    The SDK is ti-processor-sdk-linux-am62xx-evm-08.06.00.42

    linux-5.10.168+gitAUTOINC+2c23e6c538-g2c23e6c538  u-boot-2021.01+gitAUTOINC+1c0d06c606-g1c0d06c606

    the mtdparts env is "env set mtdparts nor0:512K(tiboot3),2M(tispl),4M(u-boot),256K(env),256K(env.backup),128K(fdt),20M(kernel),0x5ea0000(system),80M(app),43M(datalog),11M(syslog),256K(phypattern)"

    We also added ubi support in the configuration

    Uboot config
    CONFIG_CMD_UBI
    CONFIG_CMD_UBIFS
    CONFIG_MTD_UBI=y
    CONFIG_MTD_UBI_WL_THRESHOLD=4096
    CONFIG_MTD_UBI_BEB_LIMIT=20
    
    Kernel config
    CONFIG_MTD_UBI=y
    CONFIG_MTD_UBI_WL_THRESHOLD=4096
    CONFIG_MTD_UBI_BEB_LIMIT=20
    CONFIG_UBIFS_FS=y
    # CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
    CONFIG_UBIFS_FS_LZO=y
    CONFIG_UBIFS_FS_ZLIB=y
    CONFIG_UBIFS_FS_ZSTD=y
    CONFIG_UBIFS_FS_XATTR=y
    CONFIG_UBIFS_FS_SECURITY=y
    

  • Thanks for confirming the details. I wonder how the 'data0' and 'data1' partitions are created/where do they come from, instead of the partitions you really want. Can you please also run the following 3 commands and report back the output (output from my board is just for reference-- please ignore).

    # cat /proc/cmdline
    console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 mtdparts=fc40000.spi.0:1m(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),57088k@8m(ospi.rootfs),256k(ospi.phypattern);omap2-nand.0:2m(NAND.tiboot3),2m(NAND.tispl),2m(NAND.tiboot3.backup),4m(NAND.u-boot),256k(NAND.u-boot-env),256k(NAND.u-boot-env.backup),-(NAND.file-system) root=PARTUUID=00000000-02 rw rootfstype=ext4 rootwait
    # zcat /proc/config.gz | grep CONFIG_MTD_CMDLINE_PARTS
    CONFIG_MTD_CMDLINE_PARTS=y
    # cat /proc/mtd
    dev:    size   erasesize  name
    mtd0: 00100000 00040000 "ospi.tiboot3"
    mtd1: 00200000 00040000 "ospi.tispl"
    mtd2: 00400000 00040000 "ospi.u-boot"
    mtd3: 00040000 00040000 "ospi.env"
    mtd4: 00040000 00040000 "ospi.env.backup"
    mtd5: 037c0000 00040000 "ospi.rootfs"
    mtd6: 00040000 00040000 "ospi.phypattern"

    Regards, Andreas

  • Hi Andreas,

    Sorry for the late response. We had a holiday a few days ago.

    After I change the “nor0” in mtdparts to “fc40000.spi.0”, the mtd partition is normal.

    nor0 can only be used for uboot, fc40000.spi.0 is used for linux.

    Regards,

    Stephen