Re: [PATCH v2] tplink-safeloader: Add support for Deco M4R V4

2023-01-29 Thread Sander Vanheule
Hi Mark,

On Sun, 2023-01-29 at 15:28 +0100, Mark Ceeha wrote:
> Software version:
>   soft_ver:1.0.0 Build 20211202 Rel. 69482
> 
> Partition table:
>    0004 fs-uboot
>   0004 0040 os-image
>   0044 00b6 file-system
>   00fa 0300 default-mac
>   00fa0300 0100 device-id
>   00fa0400 fc00 product-info
>   00fb 4000 group-info
>   00fb4000 c000 user-config
>   00fc 0001 device-config
>   00fd 0001 default-config
>   00fe 0800 partition-table
>   00fe0800 0100 soft-version
>   00fe0900 0200 support-list
>   00fe0b00 3000 profile
>   00fe3b00 0100 extra-para
>   00ff 0001 radio
> 
> `os-image` and `file-system` have been merged into `firmware`.
> 
> Signed-off-by: Mark Ceeha 
> ---
> v2:
> - Change `soft_ver` to 1.0.0; while the TP-Link stock firmware cares
>   about the version and if it's not older than the current `soft_ver`,
>   it will not allow you to flash OpenWrt anyway as the image is not signed.
>   U-Boot accepts unsigned images, and does not care about the `soft_ver`,
>   so we'll just make it consistent with the initial firmware release
>   this partition table was checked against.
> - Fix style issues pointed out by Sander.

Thanks for the update. I applied this v2 to the firmware-utils repository.

Best,
Sander

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2] tplink-safeloader: Add support for Deco M4R V4

2023-01-29 Thread Mark Ceeha via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
Software version:
  soft_ver:1.0.0 Build 20211202 Rel. 69482

Partition table:
   0004 fs-uboot
  0004 0040 os-image
  0044 00b6 file-system
  00fa 0300 default-mac
  00fa0300 0100 device-id
  00fa0400 fc00 product-info
  00fb 4000 group-info
  00fb4000 c000 user-config
  00fc 0001 device-config
  00fd 0001 default-config
  00fe 0800 partition-table
  00fe0800 0100 soft-version
  00fe0900 0200 support-list
  00fe0b00 3000 profile
  00fe3b00 0100 extra-para
  00ff 0001 radio

`os-image` and `file-system` have been merged into `firmware`.

Signed-off-by: Mark Ceeha 
---
v2:
- Change `soft_ver` to 1.0.0; while the TP-Link stock firmware cares
  about the version and if it's not older than the current `soft_ver`,
  it will not allow you to flash OpenWrt anyway as the image is not signed.
  U-Boot accepts unsigned images, and does not care about the `soft_ver`,
  so we'll just make it consistent with the initial firmware release
  this partition table was checked against.
- Fix style issues pointed out by Sander.
---
 src/tplink-safeloader.c | 37 +
 1 file changed, 37 insertions(+)

diff --git a/src/tplink-safeloader.c b/src/tplink-safeloader.c
index ddb5dff..d9e1605 100644
--- a/src/tplink-safeloader.c
+++ b/src/tplink-safeloader.c
@@ -1612,6 +1612,42 @@ static struct device_info boards[] = {
.last_sysupgrade_partition = "file-system",
},
 
+   /** Firmware layout for the Deco M4R v4 */
+   {
+   .id = "DECO-M4R-V4",
+   .vendor = "",
+   .support_list =
+   "SupportList:\n"
+   
"{product_name:M4R,product_ver:4.0.0,special_id:5553}\n"
+   
"{product_name:M4R,product_ver:4.0.0,special_id:4555}\n"
+   
"{product_name:M4R,product_ver:4.0.0,special_id:4A50}\n"
+   
"{product_name:M4R,product_ver:4.0.0,special_id:4234}\n"
+   
"{product_name:M4R,product_ver:4.0.0,special_id:5A47}\n",
+   .part_trail = 0x00,
+   .soft_ver = SOFT_VER_TEXT("soft_ver:1.0.0\n"),
+
+   .partitions = {
+   {"fs-uboot", 0x0, 0x4},
+   {"firmware", 0x4, 0xf6},
+   {"default-mac", 0xfa, 0x00300},
+   {"device-id", 0xfa0300, 0x00100},
+   {"product-info", 0xfa0400, 0x0fc00},
+   {"group-info", 0xfb, 0x04000},
+   {"user-config", 0xfb4000, 0x0c000},
+   {"device-config", 0xfc, 0x1},
+   {"default-config", 0xfd, 0x1},
+   {"partition-table", 0xfe, 0x00800},
+   {"soft-version", 0xfe0800, 0x00100},
+   {"support-list", 0xfe0900, 0x00200},
+   {"profile", 0xfe0b00, 0x03000},
+   {"extra-para", 0xfe3b00, 0x00100},
+   {"radio", 0xff, 0x1},
+   {NULL, 0, 0}
+   },
+   .first_sysupgrade_partition = "os-image",
+   .last_sysupgrade_partition = "file-system",
+   },
+
/** Firmware layout for the Deco S4 v2 */
{
.id = "DECO-S4-V2",
@@ -3525,6 +3561,7 @@ static void build_image(const char *output,
strcasecmp(info->id, "ARCHER-C60-V3") == 0 ||
strcasecmp(info->id, "ARCHER-C6U-V1") == 0 ||
strcasecmp(info->id, "ARCHER-C6-V3") == 0 ||
+   strcasecmp(info->id, "DECO-M4R-V4") == 0 ||
strcasecmp(info->id, "MR70X") == 0 ||
strcasecmp(info->id, "TLWR1043NV5") == 0) {
const uint8_t extra_para[2] = {0x01, 0x00};
-- 
2.39.0


--- End Message ---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel