I don't understand why you want to write using flashrom, I compared your file with the stock uboot.img from Vonger's site and they are the same. Your uboot should be working and it is much faster and easier than using flashrom. In any case below are some details on what I did when I messed up my uboot.
The most important thing is to NOT alter the radio calibration data which is kept in the factory partition. This is unique to each and every VoCore and you need it for the wifi to work.
I use a flashrom layout file when writing with flashrom, to write only the uboot partition I use this command:
- Code: Select all
flashrom -p serprog:dev=/dev/ttyACM1:115200 -c W25Q128.V --layout flashromlayout --image uboot -VVw mtdbackups/uboot.padded -o flashlog
man flashrom will explain the details of the options but one bit is the file you give flashrom (mine is called mtdbackups/uboot.padded) has to be the same size as the full flash even if you are only writing one section. The contents of the other sections don't matter since they aren't written if you use a layout.
I don't recommend it but, IF you have a GOOD backup of the factory partition you could pad the uboot.img file with enough zeroes to make it the correct size, write the entire flash with flashrom, use uboot to load a working openwrt image and then use mtd in openwrt to put the factory partition back. You can also assemble the pieces if you figure out the gyrations needed and write the entire flash with it, I think I used a combination of cat and dd to put one together but this is complicated and frustrating to get right.
The my flashromlayout file looks like this:
- Code: Select all
0x000000000000:0x00002FFFF uboot
0x000000030000:0x00003FFFF uboot-env
0x000000040000:0x00004FFFF factory
0x000000050000:0x000FFFFFF firmware
The section of VOCORE.dts Vonger is refering to looks like this, it is the same information in a different syntax:
- Code: Select all
partition@0 {
label = "uboot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "uboot-env";
reg = <0x30000 0x10000>;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
label = "firmware";
reg = <0x50000 0xfb0000>;
};