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.

AM3359: Unable to load dtb file using flashcp command in mtd nand partition 6 and its showing on /dev/mtd6: Invalid argument.

Part Number: AM3359

Hii Ti support team,

I am able to load zImage in mtd partition 7 using flashcp command in linux.

But when i am loading my dtb file it is showing invalid argument as shown below:.

in dts I have created partition  for NAND flash as shown below;

partition@0 {
label = "NAND.SPL";
reg = <0x00000000 0x00020000>;
};
partition@1 {
label = "NAND.u-boot";
reg = <0x00020000 0x00100000>;
};
partition@2 {
label = "NAND.u-boot-env";
reg = <0x00120000 0x00040000>;
};
partition@3 {
label = "NAND.u-boot-env-redund";
reg = <0x00160000 0x00040000>;
};
partition@4 {
label = "NAND.ftd_file";
reg = <0x001A0000 0x00040000>;
};
partition@5 {
label = "NAND.Kernel_Fs";
reg = <0x001E0000 0x00F00000>;
};
partition@6 {
label = "NAND.user_partition";
reg = <0x010E0000 0x00A00000>;
};
partition@7 {
label = "NAND.test_partition";
reg = <0x01AE0000 0x00A00000>;
};

I am able to see my nand partition while booting linux.

Below is my log file for flashing zImage and dtb:

root@RCU:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00f00000 00010000 "SPI_NOR.fpga_img"
mtd1: 00100000 00010000 "SPI_NOR.test_part"
mtd2: 00020000 00020000 "NAND.SPL"
mtd3: 00100000 00020000 "NAND.u-boot"
mtd4: 00040000 00020000 "NAND.u-boot-env"
mtd5: 00040000 00020000 "NAND.u-boot-env-redund"
mtd6: 00040000 00020000 "NAND.ftd_file"
mtd7: 01400000 00020000 "NAND.Kernel_Fs"
mtd8: 00a00000 00020000 "NAND.user_partition"
mtd9: 00a00000 00020000 "NAND.test_partition"

root@RCU:~# tftp -g 169.254.117.143 -r bdb_2eth_gpio_spiModified_wrkg_production
.dtb
root@RCU:~# flashcp bdb_2eth_gpio_spiModified_wrkg_production.dtb /dev/mtd6 -v
Erasing blocks: 1/1 (100%)
Writing data: 34k/34k (100%)
While writing data to 0x00007800-0x00008931 on /dev/mtd6: Invalid argument
root@RCU:~#
root@RCU:~# tftp -g 169.254.117.143 -r zImage
root@RCU:~# flashcp zImage /dev/mtd7 -v
Erasing blocks: 130/130 (100%)
Writing data: 16516k/16516k (100%)
Verifying data: 16516k/16516k (100%)
root@RCU:~# cat /proc/m
meminfo misc modules mounts mtd
root@RCU:~# tftp -g 169.254.117.143 -r MLO
root@RCU:~# flashcp MLO /dev/mtd2 -v
Erasing blocks: 1/1 (100%)
Writing data: 72k/72k (100%)
While writing data to 0x00011800-0x00012170 on /dev/mtd2: Invalid argument

Please help us to solve this Issue

Regards,

Rakshith 

  • Hi Rakshith,

    I am not sure what causes the error, but I see the mtd partition list from /proc/mtd doesn't match to what defined in your dts. And the list has many entries sharing the same offset, I am not sure that is a good idea.

  • Hi Bin Liu,

    Actually we have one NOR and one NAND flash and we are creating 2 partition for NOR and 8 NAND for NAND flash memory in DTS file but  

    I forgot to mention NOR flash partition in dts so please find the below detail for NOR and nand flash partition in dts: 

    partition@0 {
    label = "SPI_NOR.fpga_img";
    reg = <0x0 0xF00000>;
    };
    partition@1 {
    label = "SPI_NOR.test_part";
    reg = <0xF00000 0x100000>;
    };

    partition@0 {
    label = "NAND.SPL";
    reg = <0x00000000 0x00020000>;
    };
    partition@1 {
    label = "NAND.u-boot";
    reg = <0x00020000 0x00100000>;
    };
    partition@2 {
    label = "NAND.u-boot-env";
    reg = <0x00120000 0x00040000>;
    };
    partition@3 {
    label = "NAND.u-boot-env-redund";
    reg = <0x00160000 0x00040000>;
    };
    partition@4 {
    label = "NAND.ftd_file";
    reg = <0x001A0000 0x00040000>;
    };
    partition@5 {
    label = "NAND.Kernel_Fs";
    reg = <0x001E0000 0x00F00000>;
    };
    partition@6 {
    label = "NAND.user_partition";
    reg = <0x010E0000 0x00A00000>;
    };
    partition@7 {
    label = "NAND.test_partition";
    reg = <0x01AE0000 0x00A00000>;
    };

    According to our Partition in DTS we are getting below partition details after Linux Boot up:

    root@RCU:~# cat /proc/mtd
    dev: size erasesize name
    mtd0: 00f00000 00010000 "SPI_NOR.fpga_img"
    mtd1: 00100000 00010000 "SPI_NOR.test_part"
    mtd2: 00020000 00020000 "NAND.SPL"
    mtd3: 00100000 00020000 "NAND.u-boot"
    mtd4: 00040000 00020000 "NAND.u-boot-env"
    mtd5: 00040000 00020000 "NAND.u-boot-env-redund"
    mtd6: 00040000 00020000 "NAND.ftd_file"
    mtd7: 01400000 00020000 "NAND.Kernel_Fs"
    mtd8: 00a00000 00020000 "NAND.user_partition"
    mtd9: 00a00000 00020000 "NAND.test_partition"

    Waitinf for your reply.

    Regards,

    Rakshit

  • Hi Rakshit,

    Why /proc/mtd shows mtd4 and mtd5 andmtd6 at the same base address and mtd8 and mtd9 are the same too?

  • Hi Bin Liu

    cat /proc/mtd will show detail as show below:

    column 1 Device partition name

    column 2 Size

    column 3 erase size

    column 4 file name we want to load

    as shown in below example

     Syntax     Dev:    size     erase size   name  
    Example: mtd0: 00f00000 00010000 "SPI_NOR.fpga_img"


    So mtd4,mtd5 and mtd6 column2 represent size of partition not the base address.

    Regards
    Rakshith