By default, openwrt won’t allow you to write to u-boot partition for safety reason – it might be dangerous if you write non-compatible data to your u-boot. It will definitely brick your router. However if you want to use “advanced” u-boot with web failsafe and NetConsole as described here, and you don’t have a programmer/don’t want to open the case solder down the flash and solder it back. You may compile your own OpenWRT with u-boot writable. But, do remember, it’s always dangerous to write to u-boot partition if you don’t do it properly.
This article is assuming you have working OpenWRT compiling environment. If you don’t have one, build it following this article.
OK, the only file you need to change is target/linux/ar71xx/files/drivers/mtd/tplinkpart.c (for trunk).
Look for the following:
parts.name = "u-boot"; parts.offset = 0; parts.size = offset; parts.mask_flags = MTD_WRITEABLE; parts.name = "kernel"; parts.offset = offset; parts.size = rootfs_offset - offset; parts.name = "rootfs"; parts.offset = rootfs_offset; parts.size = art_offset - rootfs_offset; parts.name = "art"; parts.offset = art_offset; parts.size = TPLINK_ART_LEN; parts.mask_flags = MTD_WRITEABLE; parts.name = "firmware"; parts.offset = offset; parts.size = art_offset - offset;
comment out or delete this line
parts.mask_flags = MTD_WRITEABLE;
Re-compile, and you are all set.
Again, it’s always dangerous writing u-boot partition.
Update On 10/12/2014
If you have ever built any firmware using the same source. You need to run
before build the new one with u-boot write enable.