So under the "target/xxx/dts/" folder of the OpenWRT source code, there are alot of hardware configuration file for each type of the router. Anyone have experience writing that file? Espeically in the spi memory partition section, how is one to decide what is the "starting" "reg" value for a memory? This one is a working example for a 256Mbits "Winbond" W25Q256FV. But I don't see from the documentation as to how you derive the 0x40000? The reason I ask is because I am doing it for another memory chip W25Q64BV
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <50000000>;
m25p,fast-read;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x40000>;
read-only;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0xf70000>;
};
/* Those next partitions for downgrade support */
partition@fc0000 {
label = "config2";
reg = <0xfc0000 0x10000>;
read-only;
};
partition@fd0000 {
label = "config";
reg = <0xfd0000 0x10000>;
read-only;
};
partition@fe0000 {
label = "nvram2";
reg = <0xfe0000 0x10000>;
read-only;
};
partition@ff0000 {
label = "nvram";
reg = <0xff0000 0x10000>;
read-only;
};
};
};
};