I'm trying to understand if it's possible to build the DTS NAND by knowing the structure thrown by mtd
in the bootloader and also I would like to learn about the U-Boot commands in case someone could help me out
First, lets say we have this structure
#: name size offset mask_flags
0: u-boot 0x00100000 0x00000000 0
1: u-boot-env 0x00100000 0x00100000 0
2: factory 0x001c0000 0x00200000 0
3: firmware 0x02800000 0x003c0000 0
4: firmware2 0x02800000 0x02bc0000 0
5: other 0x02c40000 0x053c0000 0
Sizes are clear:
u-boot and u-boot-env 1024k
So u-boot starts from 0x00000000 and ends on 0x00100000
u-boot-env starts on 0x10000000 + 0x00100000 = 0x00200000
factory starts on 0x00200000 + 0x001c0000 (1782k) = 0x003c0000
And so on.
Pretty straight forward.
When we run tftpboot 0x8000000 I'm not sure why this is running way away from the memory bindings from this partition tables.
I must understand that since these are memory mappings, and all is relative it doesn't really matter where you start. You could start in 0x80000000 or in 0x20000000, completely irrelevant AFAIK, wherever you like.
Then about the NAND in the DTS. If we take into consideration the previous MTD the right thing would be:
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x100000>;
};
partition@100000 {
label = "u-boot-env";
reg = <0x100000 0x100000>;
};
factory: partition@200000 {
label = "factory";
reg = <0x200000 0x1c0000>;
read-only;
};
partition@3c0000 {
label = "firmware";
reg = <0x3c0000 0x2800000>;
};
partition@2bc0000 {
label = "firmware2";
reg = <0x2bc0000 0x2800000>;
};
partition@53c0000 {
label = "other";
reg = <0x53c0000 0x2c40000>;
};
};
Is all this right or I'm missing something?