ramips: tl-wr840n-v5: increase firmware partition for 4Mmtk layot
[openwrt/openwrt.git] / tools / firmware-utils / src / mktplinkfw2.c
index 892c93f10929941e84d438e56e64ea634460287a..dead49e7af8839bac5d1dee7445cf8921208c970 100644 (file)
@@ -123,6 +123,12 @@ char md5salt_boot[MD5SUM_LEN] = {
 
 static struct flash_layout layouts[] = {
        {
+               .id             = "4Mmtk",
+               .fw_max_len     = 0x3d0000,
+               .kernel_la      = 0x80000000,
+               .kernel_ep      = 0x80000000,
+               .rootfs_ofs     = 0x140000,
+       }, {
                .id             = "8Mltq",
                .fw_max_len     = 0x7a0000,
                .kernel_la      = 0x80002000,
@@ -267,10 +273,10 @@ static int check_options(void)
 
                if (rootfs_align) {
                        kernel_len += sizeof(struct fw_header);
-                       kernel_len = ALIGN(kernel_len, rootfs_align);
+                       rootfs_ofs = ALIGN(kernel_len, rootfs_align);
                        kernel_len -= sizeof(struct fw_header);
 
-                       DBG("kernel length aligned to %u", kernel_len);
+                       DBG("rootfs offset aligned to 0x%u", rootfs_ofs);
 
                        if (kernel_len + rootfs_info.file_size >
                            layout->fw_max_len - sizeof(struct fw_header)) {