From patchwork Thu Dec 1 20:22:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_Gonz=C3=A1lez_Cabanelas?= X-Patchwork-Id: 1711142 X-Patchwork-Delegate: noltari@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.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=iEP0R9pF; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=S6Rjg/om; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NNSN26NK9z23nC for ; Fri, 2 Dec 2022 07:29:06 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=sB+X2TbsD2ZcJ0WJMQvsNxMhthzOHDmCOTNmD31HqbY=; b=iEP0R9pF89exgp CdCCRGEkvgd6PQelrfeHPKDrbua/n/wfOV8oaSU2eywnYX7vqYcaDfSFhH4Q9kfDuFG/bcuQKL7vc efapH9PQBZipiPln0ICuayr5hFWOD7j7B3KW+TWmAxEbZ6S43Kfb47MQicy0eCAFF6JYkjM1klR2Q 03tS6USheDFJqKxc8Pgx55l+MEw8Jz4vN8jBtU1Ym0kaZKlmIRrrLIqYrQURCci3eew8Fpfu3x+B4 uI9N1Na5gj9861vVtf51vCg2aNwA5qYWYi70rJbPSVAXl8Wi87IAmJzvT4u4jem6KN7YW+1uhxpBG V6fVfGc+zyDrU3wAoEnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0q98-00Ao79-Nr; Thu, 01 Dec 2022 20:27:02 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0q5J-00An4Y-Gu for openwrt-devel@lists.openwrt.org; Thu, 01 Dec 2022 20:23:06 +0000 Received: by mail-wm1-x334.google.com with SMTP id m19so2057051wms.5 for ; Thu, 01 Dec 2022 12:23:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QLT6+u8lmUk/o9DGDiXogrmBnHxOto5CrChtmDOOL/E=; b=S6Rjg/omi2WWH0Tpp9Ux6ySapDTA+a7t0UIjF0+bJuVVtdGsQa3HkNbEEjSxw5MkZi osgBMchbum7FSHJtgPVFeM9ZGmrYUGa1LZl2OBQpRYmpDt0xjxJvW4emT9DBreyOQdCt JWPd13olp1RAIXv1XCkwP9VJsFjB1YhcxR9PsE9RV7XJs6atUsk1iYbEhhtYCuu2xRrT iRzWSjIrBDEkB6b1Pvc55l+XArst8NKKdO/Tk4PWr1QPpslmCY24BZmdJXeKbCkBrZoT s9kmCuoYcvLQeiYxnmnaUySK1VGT9TQkFr9vU0hnQY2lVSIFxMoo/zvfnssL3VgQoHWk Ymcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QLT6+u8lmUk/o9DGDiXogrmBnHxOto5CrChtmDOOL/E=; b=0XFQlI21CnoibaOU0U29QKpfDGamF6FBx82GEOirAcQz2yeRHoWwBDOG+2EhvmCMef x6JuwKdiF46uZH1UTyabpQzNVjKrgL4H/htCSb4cNOFOFrDCoX9sQj66aFyE8vDzO/EP oVARi9ZYiIlJwkFdG48y+oqmWOHRm7Dmy6gc/7FSZ6nNWBspCrWi0dvrR93I9dlVUQuO F1cZyvUZ9+vcdDJ93oPWX0KdISus15gr/lTNCtDQ/Na4/4aodiHfsFZmqlkxQL0zS+md 7sNM3T1/gz13XiJ8WlMjjURde4bbZnDsXk8kpX71s3I0inTyvqpxLNOUl4xMB5N8CsOZ XVrA== X-Gm-Message-State: ANoB5plWNRB2kJ1HuLz44XceL3x9jOpITOSa/kdf+wJrOpqiaLiiihJb 2r51yQWrJ15NwUdaawv3HQrGeDNdmA8= X-Google-Smtp-Source: AA0mqf5rGYnZ2//ze1MIOcjH/4ZK8/i1mngn1+cbJjR6juEbhfKUa6iLNBVJWMtvArJJ2uEZ1FYERg== X-Received: by 2002:a05:600c:1e0f:b0:3cf:e9a4:3261 with SMTP id ay15-20020a05600c1e0f00b003cfe9a43261mr54412524wmb.41.1669926180528; Thu, 01 Dec 2022 12:23:00 -0800 (PST) Received: from tool.localnet ([94.73.57.218]) by smtp.gmail.com with ESMTPSA id d8-20020a05600c34c800b003cf4eac8e80sm7920192wmq.23.2022.12.01.12.22.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 12:22:59 -0800 (PST) From: Daniel =?iso-8859-1?q?Gonz=E1lez?= Cabanelas To: openwrt-devel@lists.openwrt.org Cc: noltari@gmail.com Subject: [PATCH v4 1/3] bcm63xx: kernel: enable the tplink image parser Date: Thu, 01 Dec 2022 21:22:22 +0100 Message-ID: <13173061.uLZWGnKmhe@tool> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221201_122305_578552_BA2A82F7 X-CRM114-Status: UNSURE ( 5.62 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__Enable_the_tplink_mtd_firmware_splitte?= =?unknown-8bit?q?r_to_allow_booting_images?= =?unknown-8bit?q?_with_tplink_headers=2E_Since_known_devices_with_these_head?= =?unknown-8bit?q?ers_are_dual_core=2C?= =?unknown-8bit?q?_only_enable_this_driver_in_the_SMP_subtarget=2E_Signed-off?= =?unknown-8bit?q?-by=3A_Daniel_Gonz=C3=A1lez?= =?unknown-8bit?q?_Cabanelas_---_Changes_in_v2=3A_no_changes_Changes_in_v3=3A?= =?unknown-8bit?q?_cosmetic_Changes_in?= =?unknown-8bit?q?_v4=3A_no_changes_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=28-0=2E2_points=2C_5=2E0_re?= =?unknown-8bit?q?quired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C?= =?unknown-8bit?q?_no_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDozMzQgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail?= =?unknown-8bit?q?_provider?= =?unknown-8bit?b?IFtkZ2NidWV1W2F0XWdtYWlsLmNvbV0=?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_author=27s_domain?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily?= =?unknown-8bit?q?_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Enable the tplink mtd firmware splitter to allow booting images with tplink headers. Since known devices with these headers are dual core, only enable this driver in the SMP subtarget. Signed-off-by: Daniel González Cabanelas --- Changes in v2: no changes Changes in v3: cosmetic Changes in v4: no changes target/linux/bcm63xx/smp/config-default | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/bcm63xx/smp/config-default b/target/linux/bcm63xx/smp/config-default index a6eae6e41d..15135f01a6 100644 --- a/target/linux/bcm63xx/smp/config-default +++ b/target/linux/bcm63xx/smp/config-default @@ -19,6 +19,7 @@ CONFIG_MTD_NAND_CORE=y CONFIG_MTD_NAND_ECC_SW_HAMMING=y CONFIG_MTD_RAW_NAND=y CONFIG_MTD_SPLIT_BCM_WFI_FW=y +CONFIG_MTD_SPLIT_TPLINK_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y From patchwork Thu Dec 1 20:23:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_Gonz=C3=A1lez_Cabanelas?= X-Patchwork-Id: 1711141 X-Patchwork-Delegate: noltari@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.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=XIj6SkKy; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=WAjnv2yr; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NNSN05RCqz23nC for ; Fri, 2 Dec 2022 07:29:04 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=NATJPy/qvQPZcovgLRsQ73p6/A7ZJyF6di96eTXToKE=; b=XIj6SkKyGCsTEj HRdm4Giwzno1inv/4SdyOxaas1gs3H8iDzcxw4yzVaUuJgQU0g98VVx03O85NY+QVeNnlzj9KR3IB xyP2RbhW1qaCg95OroiWLPq08RNRnuKhJvmaQBNZAtcwrXGhUs/rNVW2RJUMag0GJ5JofKGfMrOT8 H+/8okz2epXSoIIo/0II4iFZc61cfo1up3EtVrb21q5TWdaI4FXQgpgAAlPRMtVz88i9oBWBjDr/2 axuaoKVRYdUFoImi3yXWzXTfH2FMXYxD6psDEHl0VS0lTUBllHxBVhWYWZTqEQxIekzELaFCKUMsZ UrS9BgextlmTvxf/d4+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0q9K-00Ao9L-Oc; Thu, 01 Dec 2022 20:27:14 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0q5e-00AnDM-34 for openwrt-devel@lists.openwrt.org; Thu, 01 Dec 2022 20:23:27 +0000 Received: by mail-wm1-x32d.google.com with SMTP id t1so2046398wmi.4 for ; Thu, 01 Dec 2022 12:23:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=4wAxWgK5goJxJFJqj9LC9K60Dgx95iONwkRAJkkqQqU=; b=WAjnv2yrd/IxhRZbKpAWsiXyzP4xySIzmBfNI5Aovf6rH3djZbWinLMe+vMxy0SwlR 56npobAeWr/ccyOpanpq7XWmz1ZdIZIrbyqtm414W35xmj9GtBypgjau2yXJfd4io2Th Mm23pBscqQURFUpmM/DAehyYcsoz34UrWvvpu8vKSWzR5CdzGJFust/jWtpGvOVVLk8J qZthwld72NHi90YEfgqpyld24oQ9bq/gIPWBXYO6QXDkkDYokh5hDBt9ZK2IhAY6/S+W ybKIZbqo+v2GUBQwzIpha92s7q+OUMzQCVc565LM9aXtMlXFJaYXBb/JC8qy1MPY+5GQ EaUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4wAxWgK5goJxJFJqj9LC9K60Dgx95iONwkRAJkkqQqU=; b=VOUyGbDvjybZIfZos8H6M+edR2mk3K0+iGwe8Jf+wv5RJkepm71DbONFADX7CTddll Q9yVhuSg/W24EkbVYclUwgpy4FHsMSRVtEJI+8ij3cMbSa1fb/Q0uzE0QttZrjDToQa7 uxq0L90pQS5cOBgYWuUND2o856hB2zK/vnUjZhZOo40eirGYXqIOyCiv4ptPDvoFzwea w6jchVNB83hhnoYHl1oPmqvRmabeHwTKoArA6p+5eQwxAMbchlvDY8qERFBjFMbur8ei 4IXAehM2mbUaLs4ZCc/IPJL2pemXssBq147p/8YdQ44pKCgmxXH6yS2mRPLWCv4gD678 t/qQ== X-Gm-Message-State: ANoB5pnNZUJeYP4x0OBBSm/+iFhRohAew5uAwQQtiW/CbqW5S4xOX836 0055QI645M8i1dmyGNk0n39KbGL85fU= X-Google-Smtp-Source: AA0mqf6kDsN9A/NNgBhTKBS4dh34/oKyvzDS9vkm5tCrkvLjj9zcY1f2cD8wsofKpE+u1NRheOMhFA== X-Received: by 2002:a05:600c:500f:b0:3c7:135a:2e4f with SMTP id n15-20020a05600c500f00b003c7135a2e4fmr54033338wmr.30.1669926202130; Thu, 01 Dec 2022 12:23:22 -0800 (PST) Received: from tool.localnet ([94.73.57.218]) by smtp.gmail.com with ESMTPSA id ba16-20020a0560001c1000b002365254ea42sm5972183wrb.1.2022.12.01.12.23.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 12:23:21 -0800 (PST) From: Daniel =?iso-8859-1?q?Gonz=E1lez?= Cabanelas To: openwrt-devel@lists.openwrt.org Cc: noltari@gmail.com Subject: [PATCH v4 2/3] bcm63xx: build tplink images Date: Thu, 01 Dec 2022 21:23:04 +0100 Message-ID: <2878611.e9J7NaK4W3@tool> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221201_122326_153663_1F68B76B X-CRM114-Status: GOOD ( 11.17 ) X-Spam-Score: -0.2 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__Add_macros_and_a_python_script_to_buil?= =?unknown-8bit?q?d_images_compatible?= =?unknown-8bit?q?_with_tplink_CFE_bootloaders=2E_Signed-off-by=3A_Daniel_Gon?= =?unknown-8bit?q?z=C3=A1lez_Cabanelas_---?= =?unknown-8bit?q?_Changes_in_v2=3A_-_factory_image_fixed=2E_=28cfe-tplink-cr?= =?unknown-8bit?q?cfix=2Epy_doesn=27t_work?= =?unknown-8bit?q?_if_CFE_already_prepended=29_Changes_in_v3=3A_-_fixed_name_?= =?unknown-8bit?q?in_temp_files_for_prepend?= =?unknown-8bit?b?IFsuLi5dIA==?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=28-0=2E2_points=2C_5=2E0_re?= =?unknown-8bit?q?quired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C?= =?unknown-8bit?q?_no_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDozMmQgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail?= =?unknown-8bit?q?_provider?= =?unknown-8bit?b?IFtkZ2NidWV1W2F0XWdtYWlsLmNvbV0=?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_author=27s_domain?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily?= =?unknown-8bit?q?_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Add macros and a python script to build images compatible with tplink CFE bootloaders. Signed-off-by: Daniel González Cabanelas --- Changes in v2: - factory image fixed. (cfe-tplink-crcfix.py doesn't work if CFE already prepended) Changes in v3: - fixed name in temp files for prepending CFE to be safer. Changes in v4: - no changes scripts/cfe-tplink-crcfix.py | 48 +++++++++++++++++++++++++++ target/linux/bcm63xx/image/Makefile | 23 +++++++++++++ target/linux/bcm63xx/image/bcm63xx.mk | 19 +++++++++++ 3 files changed, 90 insertions(+) create mode 100755 scripts/cfe-tplink-crcfix.py diff --git a/scripts/cfe-tplink-crcfix.py b/scripts/cfe-tplink-crcfix.py new file mode 100755 index 0000000000..2db6d6cce9 --- /dev/null +++ b/scripts/cfe-tplink-crcfix.py @@ -0,0 +1,48 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Copyright (C) 2022 OpenWrt.org, based on cameo-tag.py +# +# this tool fixes the CRC32 (kernel+rootfs) found in CFE headers from +# Tp-Link bcm63xx devices. It doesn't recalculate header checksums +# since CFE doesn't make any header integrity verification to boot OpenWrt. + +import argparse +import os +import struct +import zlib + +READ_UNTIL_EOF = -1 +CFE_HEADER_SIZE = 512 + +def read_buffer(offset, count): + args.cfeimage_file.seek(offset) + return bytearray(args.cfeimage_file.read(count)) + +def write_buffer(whence, buf): + args.cfeimage_file.seek(0, whence) + args.cfeimage_file.write(buf) + +def invertcrc(buf): + return (zlib.crc32(buf) ^ 0xffffffff).to_bytes(4, 'big') + +def checksum_header(buf): + BINCRC32 = args.crc_offset + ROOTFSADDRESS = buf[124:128] + ROOTFSLEN = buf[128:132] + IMLEN = struct.unpack('>i', ROOTFSADDRESS)[0] + struct.unpack('>i', ROOTFSLEN)[0] + CFE_HEADER_SIZE + buf[BINCRC32:BINCRC32+4] = invertcrc(buf[CFE_HEADER_SIZE:IMLEN]) + return buf + +parser = argparse.ArgumentParser(description='Insert CRC in tplink CFE firmware tags.') +parser.add_argument('cfeimage_file', type=argparse.FileType('r+b')) +# crc_offset should be 148 or 152 +parser.add_argument('crc_offset', type=int) +args = parser.parse_args() + +args.cfeimage_file.seek(0, os.SEEK_END) +if args.cfeimage_file.tell() <= CFE_HEADER_SIZE: + raise ValueError(f"CFE image must be larger than {CFE_HEADER_SIZE} bytes") + +buf = checksum_header(read_buffer(0, READ_UNTIL_EOF)) +write_buffer(os.SEEK_SET, buf) diff --git a/target/linux/bcm63xx/image/Makefile b/target/linux/bcm63xx/image/Makefile index f35358173c..019596e004 100644 --- a/target/linux/bcm63xx/image/Makefile +++ b/target/linux/bcm63xx/image/Makefile @@ -143,6 +143,15 @@ define Build/cfe-jffs2-cferam rm -f $@.kernel endef +define Build/cfe-kernel-header + $(TOPDIR)/scripts/cfe-bin-header.py \ + --input-file $@ \ + --output-file $@-tmp \ + --load-addr $(if $(DEVICE_LOADADDR),$(DEVICE_LOADADDR),$(LOADER_ENTRY)) \ + --entry-addr $(if $(DEVICE_LOADADDR),$(DEVICE_LOADADDR),$(LOADER_ENTRY)) + mv $@-tmp $@ +endef + define Build/cfe-jffs2-kernel rm -rf $@-kernel mkdir -p $@-kernel @@ -274,6 +283,20 @@ define Build/zyxel-bin mv $@.zyxel $@ endef +define Build/tplink-prepend-cfe + dd if=$(KDIR)/bcm63xx-cfe/$(CFE_BIN_FILE) bs=128k conv=sync of=$@.cfeprepend + dd if=$@ >> $@.cfeprepend + mv $@.cfeprepend $@ +endef + +define Build/tplink-sysupgrade + # append 512 bytes to avoid computing CRC for data beyond jffs2 EOF mark + dd if=/dev/null bs=512 count=1 >> $(IMAGE_ROOTFS) + $(call Build/tplink-v2-image, -v 0.9.1 -s) + # insert ~CRC32 (rootfs+kernel) to allow CFE booting Openwrt + $(TOPDIR)/scripts/cfe-tplink-crcfix.py $@ $(TPLINK_CRC_OFFSET) +endef + define Build/redboot-bin # Prepare kernel and rootfs dd if=$(IMAGE_KERNEL) of=$(BIN_DIR)/$(REDBOOT_PREFIX)-vmlinux.gz bs=65536 conv=sync diff --git a/target/linux/bcm63xx/image/bcm63xx.mk b/target/linux/bcm63xx/image/bcm63xx.mk index 97959d7819..bbf4da6505 100644 --- a/target/linux/bcm63xx/image/bcm63xx.mk +++ b/target/linux/bcm63xx/image/bcm63xx.mk @@ -5,9 +5,12 @@ DEVICE_VARS += HCS_MAGIC_BYTES HCS_REV_MIN HCS_REV_MAJ DEVICE_VARS += BLOCK_SIZE FLASH_MB IMAGE_OFFSET +DEVICE_VARS += CFE_BIN_FILE DEVICE_VARS += CFE_BOARD_ID CFE_EXTRAS DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_REGION DEVICE_VARS += REDBOOT_PREFIX +DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT +DEVICE_VARS += TPLINK_HWREVADD TPLINK_HVERSION TPLINK_CRC_OFFSET define Device/bcm33xx KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-lzma bin | hcs-initramfs @@ -59,6 +62,22 @@ define Device/bcm63xx_redboot REDBOOT_PREFIX := $$(DEVICE_IMG_PREFIX) endef +define Device/bcm63xx_tplink + FILESYSTEMS := squashfs + DEVICE_VENDOR := TP-Link + TPLINK_HWID := 0x0 + TPLINK_HWREV := 0x1 + TPLINK_HWREVADD := 0x0 + TPLINK_HVERSION := 3 + TPLINK_FLASHLAYOUT := + TPLINK_CRC_OFFSET := 152 + CFE_BIN_FILE := + KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | cfe-kernel-header + IMAGES := factory.bin sysupgrade.bin + IMAGE/sysupgrade.bin := tplink-sysupgrade + IMAGE/factory.bin := tplink-sysupgrade | tplink-prepend-cfe +endef + ### Generic ### define Device/brcm_bcm963281tan $(Device/bcm63xx) From patchwork Thu Dec 1 20:23:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_Gonz=C3=A1lez_Cabanelas?= X-Patchwork-Id: 1711143 X-Patchwork-Delegate: noltari@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.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=BBtIC1O6; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=pOZ//oFX; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NNSNB5CwLz23nC for ; Fri, 2 Dec 2022 07:29:14 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=lW1u9Z8wtM5kw3IphrsMsomzn0gvdr3pew765KpAGeg=; b=BBtIC1O6r5L9WI 9mDLClBsoxyggYx6UsxqbQuNB+Q5xgm6qjs6/0879ktgVy4hMQgmjOwVPtmHFwJQcGXgOgsUYKzv6 zHrEanikmyt6s8r5s3sur+qrrqzSFYRohJWQcK8LCf1AoNKKSuxn08hCbV1CAcz/qF3r6WxFMsoTM yAfJlk6KOypUXURzNIg+340IsH3Edp1AD9UdJA0NGIKHvt5+K37jTuOClLnT9S82a0UlWhy5jB5AD jD4OfE7RBe1PyQHkSNJaLlLxIDxB2Vl0uJ+TJYJ5JjK3vPlaciLGufQ9fCg48noix4BIO0ZykyTrp JmevudxYoOyLxi0AGSmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0q9X-00AoEe-2x; Thu, 01 Dec 2022 20:27:27 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0q6O-00AnNr-KJ for openwrt-devel@lists.openwrt.org; Thu, 01 Dec 2022 20:24:14 +0000 Received: by mail-wm1-x329.google.com with SMTP id v7so2082114wmn.0 for ; Thu, 01 Dec 2022 12:24:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=bCcQmBdGucaKXWBUyP74zlELDVQ25AYiuAi3NYZPfWU=; b=pOZ//oFXZRU1QHs8dcL1x7Mp85ecC9SXSxQTqYuHZWnvMrWZ36aZc/Yt8csOJa+rDu RKV2lcuOOuxSnTlhAuXtatGucbv2JJXLIK6k1La/NgwSkAzLQ2JN5q9tcF/7BTrnBrmk 1CXiCZr+mf3iZQq/V2j8lpmEqdsjgSkzrUl8sL7gmlwaQzCFJHgstUy9FGUYfjR6oVp7 Skh1GQreubMGljlU2Nwm/4Y0NzfO52B9KBfdvgDbKuvLFPf+L7bEMRWqOTDuIZ4+gkqQ FTGWW7j9rJf3nK8plJa2aHVH8EbkIjOZIUIErQGV/EtRswRuLw5qFJEEgR4CTsYm8Lcq zl5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bCcQmBdGucaKXWBUyP74zlELDVQ25AYiuAi3NYZPfWU=; b=1j7A+aDfPLCOd3YYe4YfSVtdjgJssqD2zqkWIPE3jhR+7cLNIP+/Pk7NQTiwrjRiC1 XLtZOZ6BLJ3MDRclVMIOfW3XeShVWlwx99iNNCaICKf3ZVL3xgHXFlua2QyGQO/EdRUN OXOaN9jgRJuDjfFd8niZcHThdPEwe16uPGlB4rvQWyKHOzlK5McCT12Ue4KPBfZAfp3p 2s/XpezDPH3v090blP3e0lwqq6iG8Rgvg2x7a/gffsYopCzFSbxGqD7RCyZ8KQkfC7Qk a21ho66vvxSBMgYjcva2CzEQXC+i790Cz2RFF8aVHm2m4izbHwD/WKQGOJ3ZmpHIYj2u I/Ew== X-Gm-Message-State: ANoB5plLFCamLHecSfQb5fmxgNDd5J+x2KxfiFgJubwlUOFbg8Y9/pk+ eRVvuaQjT1tCoc/AFnytzssMMsmN+lI= X-Google-Smtp-Source: AA0mqf4jyv3ucGN5NSc0T6ZjMLBiLRdONfTdgt93DZeIR8VFG2wQwGjnsKJvu5dd5PkufXGITKXqSw== X-Received: by 2002:a1c:f617:0:b0:3cf:5584:7730 with SMTP id w23-20020a1cf617000000b003cf55847730mr54317003wmc.187.1669926246844; Thu, 01 Dec 2022 12:24:06 -0800 (PST) Received: from tool.localnet ([94.73.57.218]) by smtp.gmail.com with ESMTPSA id r8-20020a05600c424800b003c5571c27a1sm7461629wmm.32.2022.12.01.12.24.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 12:24:06 -0800 (PST) From: Daniel =?iso-8859-1?q?Gonz=E1lez?= Cabanelas To: openwrt-devel@lists.openwrt.org Cc: noltari@gmail.com Subject: [PATCH v4 3/3] bcm63xx: add support for Tp-Link Archer VR400 v1 Date: Thu, 01 Dec 2022 21:23:39 +0100 Message-ID: <3223129.aeNJFYEL58@tool> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221201_122412_701554_339A9BEA X-CRM114-Status: GOOD ( 17.43 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The Archer VR400 v1 is an EOL xDSL router with 802.11bgn/802.11ac wifi. Hardware: - SoC: Broadcom BCM63167 - CPU: dual core BMIPS4350 V8.0 @400MHz - RAM: 128 MB DDR2 - Flash: 16 MB SPI NOR - Ethernet LAN: 3x 100Mbit - Ethernet WAN: 1x GbE - Wifi 2.4 GHz: SoC integrated BC [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:329 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [dgcbueu[at]gmail.com] 0.0 NUMERIC_HTTP_ADDR URI: Uses a numeric IP address in URL -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The Archer VR400 v1 is an EOL xDSL router with 802.11bgn/802.11ac wifi. Hardware: - SoC: Broadcom BCM63167 - CPU: dual core BMIPS4350 V8.0 @400MHz - RAM: 128 MB DDR2 - Flash: 16 MB SPI NOR - Ethernet LAN: 3x 100Mbit - Ethernet WAN: 1x GbE - Wifi 2.4 GHz: SoC integrated BCM435F 802.11b/g/n - WiFi 5 GHz: onboard BCM4352 802.11ac - USB: 1x 2.0 - Buttons: 3x, 1 reset - LEDs: 10x, all green Installation via UART serial console and TFTP: - Configure a static IP on the computer e.g: 192.168.1.7 - Put the openwrt-factory.bin in a TFTP server in the computer - Power on the router with the serial console connected - While initializing the bootloader press any key to reach the CLI - At the CFE command line, execute the command: f 192.168.1.7:openwrt-factory.bin image - Wait until it finish. Back to OEM firmware: - Stop the bootloader with the serial console - Flash the OEM firmware using the CFE web UI: http://192.168.1.1 Unsupported: - xDSL - Wifi 2.4 GHz - WiFi 5 GHz, BCM4352, might eventually get basic support. Signed-off-by: Daniel González Cabanelas Signed-off-by: Artemii Karavashkin --- Changes in v2: - added USB packages. Changes in v3: - no changes Changes in v4: - fixed linux node name partition in dts to match the offset .../bcm63xx/base-files/etc/board.d/01_leds | 4 + .../bcm63xx/base-files/etc/board.d/02_network | 4 + .../dts/bcm63167-tplink-archer-vr400-v1.dts | 177 ++++++++++++++++++ target/linux/bcm63xx/image/bcm63xx.mk | 14 ++ .../patches-5.10/519-board_bcm63268.patch | 52 ++++- ...31-board_bcm6348-bt-voyager-2500v-bb.patch | 2 +- .../patches-5.15/519-board_bcm63268.patch | 52 ++++- ...31-board_bcm6348-bt-voyager-2500v-bb.patch | 2 +- 8 files changed, 299 insertions(+), 8 deletions(-) create mode 100644 target/linux/bcm63xx/dts/bcm63167-tplink-archer-vr400-v1.dts diff --git a/target/linux/bcm63xx/base-files/etc/board.d/01_leds b/target/linux/bcm63xx/base-files/etc/board.d/01_leds index 75e8afef9d..92fb1bc408 100644 --- a/target/linux/bcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/bcm63xx/base-files/etc/board.d/01_leds @@ -94,6 +94,10 @@ sercomm,h500-s-vfes) telsey,cpva502plus) ucidef_set_led_netdev "lan" "LAN" "amber:link" "eth0" ;; +tplink,archer-vr400-v1) + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0.2" + ucidef_set_led_usbdev "usb" "USB" "green:usb" "1-1" + ;; esac board_config_flush diff --git a/target/linux/bcm63xx/base-files/etc/board.d/02_network b/target/linux/bcm63xx/base-files/etc/board.d/02_network index b48aa57d2e..32547bf448 100644 --- a/target/linux/bcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm63xx/base-files/etc/board.d/02_network @@ -159,6 +159,10 @@ sky,sr102) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:wan" "8t@eth0" ;; +tplink,archer-vr400-v1) + ucidef_add_switch "switch0" \ + "0:lan:3" "1:lan:2" "2:lan:1" "3:wan" "8t@eth0" + ;; *) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; diff --git a/target/linux/bcm63xx/dts/bcm63167-tplink-archer-vr400-v1.dts b/target/linux/bcm63xx/dts/bcm63167-tplink-archer-vr400-v1.dts new file mode 100644 index 0000000000..a3dbca7d78 --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm63167-tplink-archer-vr400-v1.dts @@ -0,0 +1,177 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Device Tree file for TP-Link Archer VR400 v1 + * + * Copyright (C) 2022 Daniel González Cabanelas + * Copyright (C) 2022 Artemii Karavashkin + */ + +#include "bcm63268.dtsi" + +#include +#include + +/ { + model = "TP-Link Archer VR400 v1"; + compatible = "tplink,archer-vr400-v1", "brcm,bcm63167", "brcm,bcm63268"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&pinctrl 32 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&pinctrl 33 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + rfkill { + label = "rfkill"; + gpios = <&pinctrl 35 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + wifi2g_green { + label = "green:wifi2g"; + gpios = <&pinctrl 36 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds>; + + usb_green { + reg = <1>; + active-low; + label = "green:usb"; + }; + + wan_green { + reg = <8>; + active-low; + label = "green:wan"; + }; + + ephy0_act { + reg = <9>; + brcm,hardware-controlled; + }; + + ephy1_act { + reg = <10>; + brcm,hardware-controlled; + }; + + ephy2_act { + reg = <11>; + brcm,hardware-controlled; + }; + + gphy0_act { + reg = <12>; + brcm,hardware-controlled; + }; + + wifi5g_green { + reg = <14>; + active-low; + label = "green:wifi5g"; + }; + + led_power_green: power_green { + reg = <18>; + active-low; + label = "green:power"; + default-state = "on"; + }; + + dsl_green { + reg = <20>; + active-low; + label = "green:dsl"; + }; + + wps_green { + reg = <22>; + active-low; + label = "green:wps"; + }; +}; + +&hsspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <20000000>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cfe@0 { + reg = <0x000000 0x020000>; + label = "cfe"; + read-only; + }; + + linux@20000 { + reg = <0x020000 0xfa0000>; + label = "linux"; + compatible = "tplink,firmware"; + }; + + nvram@fc0000 { + reg = <0xfc0000 0x040000>; + label = "nvram"; + }; + }; + }; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio1", "gpio8", + "gpio9", "gpio10", + "gpio11", "gpio12", + "gpio14", "gpio18", + "gpio20", "gpio22"; + }; +}; + +&uart0 { + status = "okay"; +}; diff --git a/target/linux/bcm63xx/image/bcm63xx.mk b/target/linux/bcm63xx/image/bcm63xx.mk index bbf4da6505..2fe4831ca5 100644 --- a/target/linux/bcm63xx/image/bcm63xx.mk +++ b/target/linux/bcm63xx/image/bcm63xx.mk @@ -1219,6 +1219,20 @@ endef TARGET_DEVICES += telsey_magic ### TP-Link ### +define Device/tplink_archer-vr400-v1 + $(Device/bcm63xx_tplink) + DEVICE_MODEL := Archer VR400 + DEVICE_VARIANT := v1 + TPLINK_HWID := 0x491dfa01 + TPLINK_HWREV := 0x70 + TPLINK_HWREVADD := 0x0 + TPLINK_FLASHLAYOUT := 16Mqca + CHIP_ID := 63167 + CFE_BIN_FILE := tplink,archer-vr400-v1/cfe63268.bin + DEVICE_PACKAGES := $(USB2_PACKAGES) +endef +TARGET_DEVICES += tplink_archer-vr400-v1 + define Device/tp-link_td-w8900gb $(Device/bcm63xx-legacy) DEVICE_VENDOR := TP-Link diff --git a/target/linux/bcm63xx/patches-5.10/519-board_bcm63268.patch b/target/linux/bcm63xx/patches-5.10/519-board_bcm63268.patch index 9693b4d3b0..1e49f17839 100644 --- a/target/linux/bcm63xx/patches-5.10/519-board_bcm63268.patch +++ b/target/linux/bcm63xx/patches-5.10/519-board_bcm63268.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2697,6 +2697,273 @@ static struct board_info __initdata boar +@@ -2697,6 +2697,317 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6368 */ /* @@ -227,6 +227,50 @@ + }, +}; + ++static struct board_info __initdata board_VR400 = { ++ .name = "963167TP", ++ .expected_cpu_id = 0x63268, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "LAN3", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "LAN2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "LAN1", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "LAN4/WAN", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++ .fallback_sprom = { ++ /* BCM4352 not supported */ ++ //.type = SPROM_BCM4352, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, ++}; ++ +static struct board_info __initdata board_vw6339gu = { + .name = "VW6339GU", + .expected_cpu_id = 0x63268, @@ -274,7 +318,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -2801,6 +3068,15 @@ static const struct board_info __initcon +@@ -2801,6 +3112,16 @@ static const struct board_info __initcon &board_VR3026e, &board_WAP5813n, #endif /* CONFIG_BCM63XX_CPU_6368 */ @@ -285,12 +329,13 @@ + &board_H500s, + &board_VG8050, + &board_VR3032u, ++ &board_VR400, + &board_vw6339gu, +#endif /* CONFIG_BCM63XX_CPU_63268 */ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2918,6 +3194,14 @@ static struct of_device_id const bcm963x +@@ -2918,6 +3239,15 @@ static struct of_device_id const bcm963x { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 @@ -302,6 +347,7 @@ + { .compatible = "sercomm,h500-s-lowi", .data = &board_H500s, }, + { .compatible = "sercomm,h500-s-vfes", .data = &board_H500s, }, + { .compatible = "sky,sr102", .data = &board_BSKYB_63168, }, ++ { .compatible = "tplink,archer-vr400-v1", .data = &board_VR400, }, #endif /* CONFIG_BCM63XX_CPU_63268 */ #endif /* CONFIG_OF */ { }, diff --git a/target/linux/bcm63xx/patches-5.10/531-board_bcm6348-bt-voyager-2500v-bb.patch b/target/linux/bcm63xx/patches-5.10/531-board_bcm6348-bt-voyager-2500v-bb.patch index 39728c45e4..b995b87626 100644 --- a/target/linux/bcm63xx/patches-5.10/531-board_bcm6348-bt-voyager-2500v-bb.patch +++ b/target/linux/bcm63xx/patches-5.10/531-board_bcm6348-bt-voyager-2500v-bb.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -3230,6 +3230,22 @@ void __init board_bcm963xx_init(void) +@@ -3276,6 +3276,22 @@ void __init board_bcm963xx_init(void) val &= MPI_CSBASE_BASE_MASK; } boot_addr = (u8 *)KSEG1ADDR(val); diff --git a/target/linux/bcm63xx/patches-5.15/519-board_bcm63268.patch b/target/linux/bcm63xx/patches-5.15/519-board_bcm63268.patch index 9693b4d3b0..1e49f17839 100644 --- a/target/linux/bcm63xx/patches-5.15/519-board_bcm63268.patch +++ b/target/linux/bcm63xx/patches-5.15/519-board_bcm63268.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2697,6 +2697,273 @@ static struct board_info __initdata boar +@@ -2697,6 +2697,317 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6368 */ /* @@ -227,6 +227,50 @@ + }, +}; + ++static struct board_info __initdata board_VR400 = { ++ .name = "963167TP", ++ .expected_cpu_id = 0x63268, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "LAN3", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "LAN2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "LAN1", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "LAN4/WAN", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++ .fallback_sprom = { ++ /* BCM4352 not supported */ ++ //.type = SPROM_BCM4352, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, ++}; ++ +static struct board_info __initdata board_vw6339gu = { + .name = "VW6339GU", + .expected_cpu_id = 0x63268, @@ -274,7 +318,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -2801,6 +3068,15 @@ static const struct board_info __initcon +@@ -2801,6 +3112,16 @@ static const struct board_info __initcon &board_VR3026e, &board_WAP5813n, #endif /* CONFIG_BCM63XX_CPU_6368 */ @@ -285,12 +329,13 @@ + &board_H500s, + &board_VG8050, + &board_VR3032u, ++ &board_VR400, + &board_vw6339gu, +#endif /* CONFIG_BCM63XX_CPU_63268 */ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2918,6 +3194,14 @@ static struct of_device_id const bcm963x +@@ -2918,6 +3239,15 @@ static struct of_device_id const bcm963x { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 @@ -302,6 +347,7 @@ + { .compatible = "sercomm,h500-s-lowi", .data = &board_H500s, }, + { .compatible = "sercomm,h500-s-vfes", .data = &board_H500s, }, + { .compatible = "sky,sr102", .data = &board_BSKYB_63168, }, ++ { .compatible = "tplink,archer-vr400-v1", .data = &board_VR400, }, #endif /* CONFIG_BCM63XX_CPU_63268 */ #endif /* CONFIG_OF */ { }, diff --git a/target/linux/bcm63xx/patches-5.15/531-board_bcm6348-bt-voyager-2500v-bb.patch b/target/linux/bcm63xx/patches-5.15/531-board_bcm6348-bt-voyager-2500v-bb.patch index 39728c45e4..b995b87626 100644 --- a/target/linux/bcm63xx/patches-5.15/531-board_bcm6348-bt-voyager-2500v-bb.patch +++ b/target/linux/bcm63xx/patches-5.15/531-board_bcm6348-bt-voyager-2500v-bb.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -3230,6 +3230,22 @@ void __init board_bcm963xx_init(void) +@@ -3276,6 +3276,22 @@ void __init board_bcm963xx_init(void) val &= MPI_CSBASE_BASE_MASK; } boot_addr = (u8 *)KSEG1ADDR(val);