0

I am working on an embedded Linux system, which uses kernel-5.10.24.
There is a NAND FLASH used as storage in system, and it has 4 partitons. When the kernel boots up, there shows 4 partitions as follows,

[    0.499555] Creating 4 MTD partitions on "spi_nand":
[    0.499564] 0x000000000000-0x000000080000 : "uboot"
[    0.501099] 0x000000080000-0x000000900000 : "kernel"
[    0.510556] 0x000000900000-0x000007000000 : "filesys"
[    0.580413] 0x000007000000-0x000008000000 : "app"

How does the kernel know the NAND FLASH's MTD partions?

My main purpose is to speed up kernel booting by removing MTD partion scanning.

I found there is NAND partition definition in the device tree, but the layout is different from the real system.

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

            /* spi nand flash partition */
            partition@0 {
                label = "uboot";
                reg = <0x0000000 0xE0000>;
                /*read-only;*/
            };

            partition@E0000 {
                label = "kernel";
                reg = <0xE0000 0x900000>;
            };

            partition@900000 {
                label = "filesys";
                reg = <0x900000 0x8000000>;
            };
        };
    };

Is it possible to ask kernel to parse/get the partition infor from the device tree? If so, how to do that?
Is it possible to speed kernel booting up by using the hard-coded partition info in device tree?

1 Answer 1

0

By reading the code of parsing NAND partitions through device tree, I found it is a bug in vendor's code to do partition probing and parsing. By fixing the bug it worked as expected.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .