MTD-Partitioning during buildroot build

  • Good day,


    i am trying to configure the mtdparts of my PicoModA9 during the Buildroot procedure.

    In theory the partitons should be set from DeviceTree. Correct?


    But I can't seem to find the definition in the DeviceTree files.


    The files used for the DeviceTree should be:

    picomoda9dl.dts

    picomoda9qdl.dtsi

    imx6dl.dtsi

    imx6qdl.dtsi


    But I do not find any references to the standard mtd partitions, like described here:

    https://linux-sunxi.org/Mainli…D_Howto#Booting_from_NAND


    Best regards

  • Hi,


    I´m not sure if there is a possibility to setup the mtdparts within device-tree. The virtual nand partitions are pre-configured in U-Boot source code. If you want to change something you have to take a look at U-Boot/include/configs/fsimx6.h.


    But take attention the layout of N-Boot and U-Boot should not be changed, otherwise you may break your board.


    Your F&S support team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • There is a command mtdparts in U-Boot that allows to add and remove MTD partitions. But in fact this command only modifies the environment variable that is also called mtdparts. So you may modify the variable directly, if you want. The list of MTD partitions is automatically added to the device tree after it is loaded to RAM before Linux is started. This is why you don't find any entries in the device tree source, but actually Linux sees appropriate entries after they are added by U-Boot. So you don't have to care about that, it will magically work by itself.


    When changing the MTD partitions, make sure that nothing at the beginning of the NAND is changed up to and including U-Boot and the U-Boot environment. Especially if your intention is to resize the UserDef partition, sorry, this is not possible. The starting block number of U-Boot is hard-coded in NBoot, so if you move anything to a different place, the system will not start anymore. But behind U-Boot, you are free to rename, resize, delete and add partitions as you like. On the other hand if you want to have wear leveling and automatic block refreshs, you should consider adding more volumes to the UBI on top of TargetFS instead of adding new MTD partitions.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.