From patchwork Sun May 28 22:04:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1786920 X-Patchwork-Delegate: ynezz@true.cz 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=DTN7CZuW; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=b7mIpPzf; 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 4QTt9X5lXBz20Q9 for ; Mon, 29 May 2023 08:09:20 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=VMIBaMHSMOaon7y/Ck7kNFhKlFin9FViDZVAqgRS+yE=; b=DTN7CZuWY9qBSs Oot0LgUa43Jr8x4V2TtxQIVhQTOQ27dMkPG3nTm343NOiVA4UIETxigUVdqLMSKOKUgDOSX1OKOqo CHceRq+DMiPZpu5aY4wQmRiBj6rj8TknpsBvpy5SOpqLSZoQLid5BjdvMZYibirsYd0HCCinJpCzi iPV9JRfYmibRSmEzw/NWlOAggaA/8qK/wAe/G+ZAqzbu0TH6dAWnQTsyTooWPIo/w7AyAuIk+euaW MXHqP+OwViaKWqClgsHiq4N9ge1YTOV8AFd8HpbKDjHuWASYlOoYnY1RHoBrqvITbLsQk2cDvwj/k fxUVYuQntsaGIjIjJ3sg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q3OVI-008Tan-1G; Sun, 28 May 2023 22:04:44 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q3OVE-008TZ4-2q for openwrt-devel@lists.openwrt.org; Sun, 28 May 2023 22:04:42 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f4f3ac389eso1428539e87.1 for ; Sun, 28 May 2023 15:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685311478; x=1687903478; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PIFfsOVeJ+JDA2ak2HLZO2Ulxc3FRD74Wq4+RsgegSw=; b=b7mIpPzfS7PkObsCD6TD/3X0lhTNsCoPVBZ59kBoXsZQLA7RjDg8oAAWVdl+4MS6So GXNXB6l2NWPeSYoXA4Wp5haa+qDce1tZjyM10cA5rJsrl1iANvNDRyyyl6STn6IJQOwf xYmujR7hZSjXRHm8W9PwbwKjvKYbR621j8vTQ2x5s+O5ffLhD4IuHUASWnBl5LMJFLfS HiRITfflQuTrQPU6MUPOmcW7ouGcKi1VKKVNvxeybeBK3DE7Gxs8utVEmvUbyupO+Dyf d7qVtIMlp/nxVuoR+S8O76eZv+yNODwv3HOMGD8RChmUK04wRQH/kWquWZVEYnM1GgqY gJ+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685311478; x=1687903478; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PIFfsOVeJ+JDA2ak2HLZO2Ulxc3FRD74Wq4+RsgegSw=; b=TsrUUk4ZEnchT7giMvkBcOItI2s08iZmX2dDwxy0Y1N8ogm+ibzx+Tb7rodX6kV4oK S1xqt/l2g04IFMAyEXRgSMpEmqFym34IyIgD5+IRz8EcEHiuL0l1huLVu+o4xTUwBYeh dmWemjZ/kwNCIz9OcayLyyyUTqcMXwuUikK0noxFcEyx1NIImOGOQYW9Lojr3DBddK1l NSOZN18GHYoFSP9+9Q+C14ZPRzTSmEjc3BK6kLRq/wKD/FhCqIwvLhym7rn5eOWiy9yb 7ZHf8dQCPG11ME4mxN/cM0cCtwFF2NR/IzAaLYTa4R5QiKww7tF3WEZLNPp8o1XnZIkj YN5A== X-Gm-Message-State: AC+VfDzwKTw7+72rRq8HzkekB259Y4QPv/2bWomEbJUucOp9JjPzP2RF CQrVJQfbLheHYlvEywsxq60dlCmYZ8NkW1QGzFE= X-Google-Smtp-Source: ACHHUZ5AaYGkP6ZArH95FdXc7l3wnaqKqexL3hQz+yiQYLMceJxQ00sECzMovUZKHKwLwMeZbOu0ew== X-Received: by 2002:a05:6512:79:b0:4e9:bafc:88d0 with SMTP id i25-20020a056512007900b004e9bafc88d0mr2948073lfo.23.1685311478779; Sun, 28 May 2023 15:04:38 -0700 (PDT) Received: from Fecusia.lan (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id r13-20020ac25a4d000000b004f4b0493749sm1735306lfn.303.2023.05.28.15.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 15:04:38 -0700 (PDT) From: Linus Walleij To: openwrt-devel@lists.openwrt.org Cc: Christian Lamparter , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Linus Walleij Subject: [PATCH v2 2/4] bcm53xx: Add support for D-Link DIR-890L Date: Mon, 29 May 2023 00:04:30 +0200 Message-Id: <20230528220432.2975450-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230528220432.2975450-1-linus.walleij@linaro.org> References: <20230528220432.2975450-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230528_150440_914559_152CD2BF X-CRM114-Status: GOOD ( 15.80 ) 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 DIR-890L is very similar to DIR-885L, but has both USB2 and USB3. The signature for the wrgac36 board was copied from DD-Wrt. The DIR-890L bootstrap will only load the first 2 MB after the SEAMA header in the NAND flash, uncompress it with LZMA and execute it. Since the compressed kernel will not fit in 2 MB we have a proble [...] 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:136 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.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 DIR-890L is very similar to DIR-885L, but has both USB2 and USB3. The signature for the wrgac36 board was copied from DD-Wrt. The DIR-890L bootstrap will only load the first 2 MB after the SEAMA header in the NAND flash, uncompress it with LZMA and execute it. Since the compressed kernel will not fit in 2 MB we have a problem. Solve this by putting a LZMA compressed U-Boot into the first 128 KB of the flash followed by the kernel. The bootstrap will then uncompress and execute U-Boot and then we let U-Boot read the kernel from flash and execute it. Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Rebased on master --- .../base-files/etc/uci-defaults/09_fix_crc | 3 ++- .../base-files/lib/upgrade/platform.sh | 1 + target/linux/bcm53xx/image/Makefile | 21 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/target/linux/bcm53xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/bcm53xx/base-files/etc/uci-defaults/09_fix_crc index 89ce8970d75a..c39625b86536 100644 --- a/target/linux/bcm53xx/base-files/etc/uci-defaults/09_fix_crc +++ b/target/linux/bcm53xx/base-files/etc/uci-defaults/09_fix_crc @@ -13,7 +13,8 @@ fixseama() { } case "$board" in -dlink,dir-885l) +dlink,dir-885l | \ +dlink,dir-890l) fixseama ;; *) diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh index 3ebde77d3f94..958a9fd247ab 100644 --- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh @@ -37,6 +37,7 @@ platform_expected_image() { case "$machine" in "dlink,dir-885l") echo "seamaseal wrgac42_dlink.2015_dir885l"; return;; + "dlink,dir-890l") echo "seamaseal wrgac36_dlink.2013gui_dir890"; return;; "luxul,abr-4500-v1") echo "lxl ABR-4500"; return;; "luxul,xap-810-v1") echo "lxl XAP-810"; return;; "luxul,xap-1410v1") echo "lxl XAP-1410"; return;; diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index defa68e59f98..eb9f27c91eb5 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -88,6 +88,12 @@ define Build/luxul-lxl mv $@.new $@ endef +# Outputs a lzma compressed U-Boot that start at 0x00008000 +# just like the D-Link boot loaders expect +define Build/dlink-uboot-bin + $(STAGING_DIR_HOST)/bin/lzma e $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-u-boot.bin -d16 $@ +endef + define Build/seama-nand # Seama entity $(STAGING_DIR_HOST)/bin/oseama \ @@ -266,6 +272,21 @@ define Device/dlink_dir-885l endef TARGET_DEVICES += dlink_dir-885l +define Device/dlink_dir-890l + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-890L + DEVICE_PACKAGES := $(BRCMFMAC_43602A1) $(USB2_PACKAGES) $(USB3_PACKAGES) + # Layout: U-boot (128kb max) followed by kernel and appended DTB. + # This is done because the boot loader will only read the first 2 MB + # from the flash and decompress the LZMA it finds there after the + # SEAMA header. Since the compressed kernel will not fit in 2 MB, + # we put U-Boot there and let U-Boot read and execute the kernel. + KERNEL := dlink-uboot-bin | pad-to 128k | append-kernel | append-dtb + $(Device/dlink) + SIGNATURE := wrgac36_dlink.2013gui_dir890 +endef +TARGET_DEVICES += dlink_dir-890l + define Device/dlink_dwl-8610ap DEVICE_VENDOR := D-Link DEVICE_MODEL := DWL-8610AP