From patchwork Thu Apr 7 18:43:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Gordziejewski X-Patchwork-Id: 1614621 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=EL7pKNM9; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KZ9Mq2tC8z9sBJ for ; Fri, 8 Apr 2022 04:46:47 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type:List-Help: Reply-To:List-Archive:List-Unsubscribe:List-Subscribe:From:List-Post:List-Id: Message-ID:MIME-Version:Date:Subject:To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=q4Z3bA8IqtVRRZ3Duk8PlQclFktBqXPbGNydMxwKNxU=; b=EL7pKNM9wLUgA8CRzLarvhFzSn +V2cbaABUpvkyK2E9KUo68FbRlyVivG/0Q9VIenftSPt7M+5PzC+FzvpzLjJUQvjGW9ePFgRQRGvu UD1YQaM2T80ln6+Xtl+NbsULzFovHg8aUSgm3VwuETc4oCnks7+vuSbSK6XrjyVInoZ0wNfKGyAAx 4uBJL3VDKoR5DAy543EQIe9vbUMmLGvwDmx6WOsQW3wP7tcXhpIyhGp0wJ0vr9aXPV0c90B0dBXzC JAosgcpS+D0o4iweHa5zTVcqKewEoq2HW/OPy0ESm1i5zjZpGXcmX5qSwBDPWEsHODcRPHKU7xYw1 NUQgOpIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncX6w-00DZbE-LW; Thu, 07 Apr 2022 18:44:02 +0000 To: openwrt-devel@lists.openwrt.org Subject: [PATCH firmware-utils] tplink-safeloader: TP-Link RE650 v2 support Date: Thu, 7 Apr 2022 20:43:25 +0200 MIME-Version: 1.0 Message-ID: List-Id: OpenWrt Development List List-Post: X-Patchwork-Original-From: Marcin Gordziejewski via openwrt-devel From: Marcin Gordziejewski Precedence: list X-Mailman-Version: 2.1.34 X-BeenThere: openwrt-devel@lists.openwrt.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Marcin Gordziejewski List-Help: Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org 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. Support creating images for TP-Link RE650 v2. Partition table pulled from OEM firmware on the device: partition fs-uboot base 0x00000 size 0x20000 partition os-image base 0x20000 size 0x330000 partition file-system base 0x350000 size 0x470000 partition partition-table base 0x7c0000 size 0x02000 partition default-mac base 0x7c2000 size 0x00020 partition pin base 0x7c2100 size 0x00020 partition product-info base 0x7c3100 size 0x01000 partition soft-version base 0x7c4200 size 0x01000 partition support-list base 0x7c5200 size 0x01000 partition profile base 0x7c6200 size 0x08000 partition config-info base 0x7ce200 size 0x00400 partition user-config base 0x7d0000 size 0x10000 partition default-config base 0x7e0000 size 0x10000 partition radio base 0x7f0000 size 0x10000 One notable difference from v1 in terms of safeloader, is that it requires soft_ver to be defined for device to accept the firmware, otherwise it otherwise it denies the firmware file. Version v1 has also 16MB of Flash instead of 8MB that v2 has, so the paritions had to be shrinked accordingly. In OpenWRT "firmware" partition is merged into one, it's made out of os-image and file-system partitions. Signed-off-by: Marcin Gordziejewski --- src/tplink-safeloader.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/tplink-safeloader.c b/src/tplink-safeloader.c index c4727df..e4021a9 100644 --- a/src/tplink-safeloader.c +++ b/src/tplink-safeloader.c @@ -2807,6 +2807,45 @@ static struct device_info boards[] = { .first_sysupgrade_partition = "os-image", .last_sysupgrade_partition = "file-system" }, + /** Firmware layout for the RE650 V2 (8MB Flash)*/ + { + .id = "RE650-V2", + .vendor = "", + .support_list = + "SupportList:\n" + "{product_name:RE650,product_ver:2.0.0,special_id:00000000}\n" + "{product_name:RE650,product_ver:2.0.0,special_id:45550000}\n" + "{product_name:RE650,product_ver:2.0.0,special_id:4A500000}\n" + "{product_name:RE650,product_ver:2.0.0,special_id:41550000}\n" + "{product_name:RE650,product_ver:2.0.0,special_id:43410000}\n" + "{product_name:RE650,product_ver:2.0.0,special_id:41530000}\n" + "{product_name:RE650,product_ver:2.0.0,special_id:55530000}\n", + .part_trail = 0x00, + /* For RE650 v2, soft ver is required, otherwise OEM install doesn't work */ + .soft_ver = SOFT_VER_TEXT("soft_ver:2.0.0\n"), + + /* We're using a dynamic kernel/rootfs split here */ + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"firmware", 0x20000, 0x7a0000}, + {"partition-table", 0x7c0000, 0x02000}, + {"default-mac", 0x7c2000, 0x00020}, + {"pin", 0x7c2100, 0x00020}, + {"product-info", 0x7c3100, 0x01000}, + {"soft-version", 0x7c4200, 0x01000}, + {"support-list", 0x7c5200, 0x01000}, + {"profile", 0x7c6200, 0x08000}, + {"config-info", 0x7ce200, 0x00400}, + {"user-config", 0x7d0000, 0x10000}, + {"default-config", 0x7e0000, 0x10000}, + {"radio", 0x7f0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "file-system" + }, + {} };