Skip to content

Commit

Permalink
tplink-safeloader: Archer C60 v3: relocate version partitions
Browse files Browse the repository at this point in the history
Latest firmwares for the TP-Link Archer C60 v3 contain an updated
partition table. Stock firmware images relocate the following partitions
and simultaneously provide updated contents for them:
    OFFSET   SIZE     NAME              OPERATION
    007d9500 00000100 soft-version      Not moved
    007d9600 00000200 support-list	Not moved, grows by 0x100 bytes
    007d9800 00000100 extra-para	Moved by 0x100
    007d9900 00003000 profile		ibid.
    007dc900 00002900 default-config    ibid., shrunk by 0x100 bytes

This re-partitioning is done to allow for a larger 'support-list'
partition. As noted in commit 2987b53 ("ath79: add support for
TP-Link Archer C60 v3"), the differing partition layout at the start of
flash is due to another reason.

Factory images generated by this tool do not provide the 'profile' and
'default-config' partitions, meaning they cannot safely relocate them.
Between the 'firmware' and 'soft-version' partitions, there is however a
gap of 0x9500 bytes. Instead of moving the partitions following
'support-list' down by 0x100 bytes, we can move the preceding one up.
Since the latest stock firmware image is over 3 years old, this resize
should be sufficient and not needed again in the future.

This should not impact users reverting back from OpenWrt to stock, as
the running firmware will read the partition table to correctly locate
any needed partitions.

Link: openwrt#15
Signed-off-by: Sander Vanheule <[email protected]>
  • Loading branch information
svanheule committed Mar 17, 2024
1 parent 17de365 commit aff1894
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tplink-safeloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -1495,8 +1495,8 @@ static struct device_info boards[] = {
{"device-id", 0x1ff00, 0x00100},
{"fs-uboot", 0x20000, 0x10000},
{"firmware", 0x30000, 0x7a0000},
{"soft-version", 0x7d9500, 0x00100},
{"support-list", 0x7d9600, 0x00100},
{"soft-version", 0x7d9400, 0x00100},
{"support-list", 0x7d9500, 0x00200},
{"extra-para", 0x7d9700, 0x00100},
{"profile", 0x7d9800, 0x03000},
{"default-config", 0x7dc800, 0x03000},
Expand Down

0 comments on commit aff1894

Please sign in to comment.