From patchwork Mon Jun 19 11:31:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1796512 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=PUj/B3YY; 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=I7xCNGyL; 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 4Ql71N1sfQz20XQ for ; Mon, 19 Jun 2023 21:33:12 +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=VNDShEi9rm6UZu8N6tQy+VdtipgZcSiK6wGTo8fcYpA=; b=PUj/B3YYI8dPLv p+aK3k/Y9+qR3w6CdZxCX702dGpKtj/wEYOllUf5VMrn5Wrk2w7H0b7IKCr8DgKySVpITNzXsWKye SFfNY6HBpy2BkABin8xMY25WaGc2Xjz8Rbk6pUKK2ZApVRWD6YIbVfH8z9riAemaAsvwRQIooe8b7 zWSONhAjDYqL/zeBeQg4R3f1HZm6khkwEoDqI/b1UOdBq2jINIRjh+Traajdw/dxRmlVQj0nowcPI qglvlPpuo4S7OhaUbG9AnqVcLOrTOiII8rmhRNyLaa0k1arBUUf1EyG9IGjuaMBFWUXSxASkH871F DdmrRJ4uW6sqVnHcnwcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qBD6Y-008MOo-1D; Mon, 19 Jun 2023 11:31:30 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qBD6U-008MN2-0q for openwrt-devel@lists.openwrt.org; Mon, 19 Jun 2023 11:31:27 +0000 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f63006b4e3so4352421e87.1 for ; Mon, 19 Jun 2023 04:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687174284; x=1689766284; 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=TlU3JDoRqbUBjU/CQviWSUlIsB1BtpzeAP2GPGDnkYc=; b=I7xCNGyLLxB1yZLtOrWQmu5ZVA3W8wXg3Ckgbg8jr/e7toCdSpCa9wteXzyzmb43J/ FU9ZP0uJODzpQitevrEVE4bSEtpvEyW54dY8Obizwih4KUMIwGhYqxfD1Bkdh9li7pkb rKHV1pcV+US4bT+DLGirX+TcgcMSETPJMlUOjnIvVeeJL2t+rVn/tPwk0irBRUd4e768 R4XGC7fgi1QIZFrkpou/X3ApTaTNucud7IjVkBOjKS4NbNW5Vl4asyoOTX5IzUXP3RBq tvuMotEV6DdVxn2e5jdK3xHn4cxQLjhtw8/7UotBzjw5mw0byUqQdccgqqEOi8oBzJdB ljlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687174284; x=1689766284; 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=TlU3JDoRqbUBjU/CQviWSUlIsB1BtpzeAP2GPGDnkYc=; b=akUfTnD1kONQFR25FHUBGiGHycCk1wMpv5MLPoJdUEmj9IjywchNdBshmja5rthCdk tfcC9XKOSSea8T10nvyxw8x+dSz2j+jF5cQbrXLe5zHFuMkHH/B2bX2CAxb0FuHWwPSf ZKPZ04mKimTpGQopGMVugl3OseVfQCLm88yDOF+nidDIB5gGpVIYXi6Exn1MwTc33FBC Lwb/+sRnvLBbFhJBNC2nAxYMvrc+/q0CjaUF0dPvRS/zAgJognO/fn2FdV1RL2h9b50T ltTeJMQm3+34KpwalCkPzV/5BCemjFqxl6XHBotuWStOlPAZ39+dsSFR9zHzEtNLy1b9 /Hsw== X-Gm-Message-State: AC+VfDzD0XBbzXvVamYsA1civit+s9G0xapa3n4Uy0XGThq+VqvoRA5z NoKGbxfKxNA5r36mndigZt0GVQ== X-Google-Smtp-Source: ACHHUZ7mzFyS/yhcxaHLGMI4Hr8jpxmJgW99/VBLO4p1Crxq0MD+gMEhRviF2V7CCqXBUPJgcQC08g== X-Received: by 2002:a19:9211:0:b0:4f8:5b23:5287 with SMTP id u17-20020a199211000000b004f85b235287mr4383913lfd.62.1687174283891; Mon, 19 Jun 2023 04:31:23 -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 i25-20020ac25239000000b004f8571275a4sm1416273lfl.96.2023.06.19.04.31.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 04:31:23 -0700 (PDT) From: Linus Walleij To: Imre Kaloz , Krzysztof Halasa Cc: openwrt-devel@lists.openwrt.org, Linus Walleij Subject: [PATCH 1/5] boot/apex: Restore the APEX boot loader Date: Mon, 19 Jun 2023 13:31:02 +0200 Message-Id: <20230619113106.2653595-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230619113106.2653595-1-linus.walleij@linaro.org> References: <20230619113106.2653595-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-20230619_043126_298168_F3AA87A7 X-CRM114-Status: GOOD ( 15.19 ) 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: This is a partial revert of the deletion of the IXP4xx target: we restore the APEX boot loader so we can use it for the NSLU2 and related targets. The APEX upstream is as dead as it gets so I have applied OpenWrts old patches on top of the never released v1.6.10 version and forked it into an OpenWrt variant on GitHub. If the upstream comes back [...] 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:131 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 This is a partial revert of the deletion of the IXP4xx target: we restore the APEX boot loader so we can use it for the NSLU2 and related targets. The APEX upstream is as dead as it gets so I have applied OpenWrts old patches on top of the never released v1.6.10 version and forked it into an OpenWrt variant on GitHub. If the upstream comes back alive I will happily switch over to it. The file refers to the external GitHub, I suppose when integrating this patch the file should be copied to OpenWrts file repository and the file link changed. Signed-off-by: Linus Walleij --- package/boot/apex/Makefile | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 package/boot/apex/Makefile diff --git a/package/boot/apex/Makefile b/package/boot/apex/Makefile new file mode 100644 index 000000000000..f4ce5811b024 --- /dev/null +++ b/package/boot/apex/Makefile @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2006-2023 OpenWrt.org + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=apex +# This version was created from the stalled and unreleased v1.6.10 +# with some patches on top. +PKG_VERSION:=1.6.10-openwrt +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/linusw/apex/releases/download/v1.6.10-openwrt/ +PKG_HASH:=034baa99574014f4bcb8d36baf830fa942bef816b22e228eabd7c5663612c640 +PKG_TARGETS:=bin + +include $(INCLUDE_DIR)/package.mk + +export GCC_HONOUR_COPTS=s + +define Package/apex + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_ixp4xx + DEFAULT:=y + TITLE:=Boot loader for NSLU2, FSG3, NAS100D and others +endef + +define build_apex + $(MAKE) -C $(PKG_BUILD_DIR) \ + ARCH=arm \ + $(1)_config + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + KBUILD_HAVE_NLS=no \ + ARCH=arm \ + clean all + $(INSTALL_BIN) $(PKG_BUILD_DIR)/apex.bin $(PKG_BUILD_DIR)/out/apex-$(2).bin +endef + +define Build/Compile + $(INSTALL_DIR) $(PKG_BUILD_DIR)/out + $(call build_apex,openwrt-nslu2-armeb,nslu2-armeb) + $(call build_apex,openwrt-nslu2-16mb-armeb,nslu2-16mb-armeb) + $(call build_apex,openwrt-fsg3-armeb,fsg3-armeb) + $(call build_apex,openwrt-nas100d-armeb,nas100d-armeb) +endef + +define Package/apex/install + $(INSTALL_DIR) $(STAGING_DIR)/apex + $(CP) $(PKG_BUILD_DIR)/out/*.bin $(1)/ +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/out/*.bin $(STAGING_DIR_IMAGE)/ +endef + +$(eval $(call BuildPackage,apex)) From patchwork Mon Jun 19 11:31:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1796514 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=IH23BR7z; 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=UOVIBH6d; 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 4Ql71d2J38z20XQ for ; Mon, 19 Jun 2023 21:33:25 +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=8B/VchCOk6jDlr8werkCLdSj+kfPhcuoFjhQ3S1xKik=; b=IH23BR7zxNQg/V g6+BxAaJi8Q1luS3+ZPTEFGmChhXPN0NjKBDwQaneWar7YEVH+Krnregv+JjsZ8SZHD5VowMqnpjV UtFkk214tEESHcOXbOjJxc+E4CF8DG4vkZDuC+6hinhhFjr5Bi8wdcfRaq9dzvcQj1bUG/Gzbogy/ sH584dlN11FlOfdKe+DirC+rLH4wH3VRa/MYZxy/I5kdcByAZhQUehK3mR3vKpBDxUEJZhMEZhUmo gkA1b1GUbzsyS3ClTyy0jsBfu1liZWCocnJjZy5eRJEblHlcAeUhTjVplq2bJifNJvisWiYe5G1c+ ofM4/DKJ76i2UBFUjA9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qBD6a-008MPs-2h; Mon, 19 Jun 2023 11:31:32 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qBD6W-008MNb-1Q for openwrt-devel@lists.openwrt.org; Mon, 19 Jun 2023 11:31:32 +0000 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f867700f36so2080698e87.0 for ; Mon, 19 Jun 2023 04:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687174286; x=1689766286; 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=8UUVMpjNI4FZEUlqBsscwrH4DNZc786/am+yI2gi84o=; b=UOVIBH6ddPCwbH36Ea0SVB+FRrdUF5xDU8Qgf0T1ygbBBEWOm1zYyceVDK81Fx2jdh WaNK9XZdzK6G/EUylA7tBw8vf+ejY4mVQNBGFCltGOkwMdNA7+3N1SBohVvuxvOGlmjo sCdkbW7rIfd3JNiVQkn45go7qCn/BWUnoi7spEHA6tvI4kAycWTTjqqqPcgGBteGYfhd Byh7AMU2pVxryfBxONmRdvRWCRt+HDb0uApINojgjDtj3NGu2P4vfQZBaldgkt1JBoP8 IOUm7gNOpb4kbMslO7W2lLhPAwXhhWwbEuGW7WhBz8ooWwxYRFWCpdEF9Hn3Wm3SiCUH i8jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687174286; x=1689766286; 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=8UUVMpjNI4FZEUlqBsscwrH4DNZc786/am+yI2gi84o=; b=i5ptcJcRF8SImLd6RaQWKyKRqh3WqMXXSNkbX51HgvlPdA+egaZAxL1KC+1IEtk2EO mZI6LuFC6ovEd9mXVusa1rFabR1WFdRO6UO7KqR55iVOrVB7EqTLczSyzEO3ixxrjG2Q yRCMj4IKy0QzXhFG3SwDn9qN27/7HdTHfclhYgbCtApYV1bf/aXt/SV9zNnMtR/Cd7VW EVGMCpngeSpi+NDNh+VIK662BSfHobIcgqckIUqf59AHIoHnYArbAC67WAis3GGrv9Jt riAVOGr8HVv1XHwwNbVVYzs+L6MJjcwi3XouA9P5A0SH6h/TmzjvsDsROnlaxuXEzjAE OLfw== X-Gm-Message-State: AC+VfDyuppjHpRgCDgcvaUIBbdW0qcSJqZHrjSDv+oq8+flTF+rGmgIz zpmu1eddjbqQPrclag1FqMUX1A== X-Google-Smtp-Source: ACHHUZ5+z5RhAtVDGafUuafzXmu2x3D6XdeMSfFALNe/XW6bZewDI0A8gOt8/aJqtCNLTCXPmwinuQ== X-Received: by 2002:a19:ca08:0:b0:4f8:5792:3802 with SMTP id a8-20020a19ca08000000b004f857923802mr4540551lfg.10.1687174286065; Mon, 19 Jun 2023 04:31:26 -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 i25-20020ac25239000000b004f8571275a4sm1416273lfl.96.2023.06.19.04.31.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 04:31:25 -0700 (PDT) From: Linus Walleij To: Imre Kaloz , Krzysztof Halasa Cc: openwrt-devel@lists.openwrt.org, Linus Walleij Subject: [PATCH v1 2/5] ixp4xx: Resurrect IXP4xx support using device tree Date: Mon, 19 Jun 2023 13:31:03 +0200 Message-Id: <20230619113106.2653595-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230619113106.2653595-1-linus.walleij@linaro.org> References: <20230619113106.2653595-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-20230619_043128_486559_5EF90C3F X-CRM114-Status: GOOD ( 28.42 ) 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: This resurrects the support for IXP4xx using device tree rather than the old (deleted) board files. The final pieces of IXP4xx board files were deleted in Linux v5.19. Ext4 root filesystems on CF and USB are supported by the default config. 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:12a 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 This resurrects the support for IXP4xx using device tree rather than the old (deleted) board files. The final pieces of IXP4xx board files were deleted in Linux v5.19. Ext4 root filesystems on CF and USB are supported by the default config. We support these three initial targets: - The Gateworks Avila GW2348 reference design has 64MB of RAM and 32MB of flash and also supports USB and CompactFlash. - The Gateworks Cambria GW2358 reference design has 128MB of RAM and 32MB of flash and also supports USB and CompactFlash. - The old and stable Linksys NSLU2 works fine as well, albeit it only has 32MB of RAM so it has been marked as non-default. The 8MB of flash can only fit the kernel, so it has been patched to boot from exteral media on USB. I have used it successfully as a NAS with ksmbd and LUCI web API, see: https://dflund.se/~triad/krad/ixp4xx/ Signed-off-by: Linus Walleij --- package/firmware/ixp4xx-microcode/Makefile | 59 +++++ .../ixp4xx-microcode/src/IxNpeMicrocode.h | 148 +++++++++++ .../firmware/ixp4xx-microcode/src/LICENSE.IPL | 27 ++ target/linux/ixp4xx/Makefile | 28 ++ .../ixp4xx/base-files/etc/board.d/02_network | 21 ++ .../lib/preinit/05_set_ether_mac_ixp4xx | 45 ++++ target/linux/ixp4xx/config-6.1 | 246 ++++++++++++++++++ target/linux/ixp4xx/image/Makefile | 73 ++++++ ...d-cfi_cmdset_0001-Byte-swap-OTP-info.patch | 74 ++++++ ...dts-ixp4xx-Boot-NSLU2-from-harddrive.patch | 24 ++ 10 files changed, 745 insertions(+) create mode 100644 package/firmware/ixp4xx-microcode/Makefile create mode 100644 package/firmware/ixp4xx-microcode/src/IxNpeMicrocode.h create mode 100644 package/firmware/ixp4xx-microcode/src/LICENSE.IPL create mode 100644 target/linux/ixp4xx/Makefile create mode 100644 target/linux/ixp4xx/base-files/etc/board.d/02_network create mode 100644 target/linux/ixp4xx/base-files/lib/preinit/05_set_ether_mac_ixp4xx create mode 100644 target/linux/ixp4xx/config-6.1 create mode 100644 target/linux/ixp4xx/image/Makefile create mode 100644 target/linux/ixp4xx/patches-6.1/0001-mtd-cfi_cmdset_0001-Byte-swap-OTP-info.patch create mode 100644 target/linux/ixp4xx/patches-6.1/301-ARM-dts-ixp4xx-Boot-NSLU2-from-harddrive.patch diff --git a/package/firmware/ixp4xx-microcode/Makefile b/package/firmware/ixp4xx-microcode/Makefile new file mode 100644 index 000000000000..78fedfd1aaf1 --- /dev/null +++ b/package/firmware/ixp4xx-microcode/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2007 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ixp4xx-microcode +PKG_VERSION:=2.4 +PKG_RELEASE:=2 + +PKG_SOURCE:=IPL_ixp400NpeLibraryWithCrypto-2_4.zip +PKG_SOURCE_URL:=http://downloads.openwrt.org/sources +PKG_HASH:=1b1170d0657847248589d946048c0aeaa9cd671966fc5bec5933283309485eaa + +PKG_FLAGS:=nonshared + +include $(INCLUDE_DIR)/package.mk + +define Package/ixp4xx-microcode + SECTION:=net + CATEGORY:=Network + TITLE:=Microcode for the IXP4xx network engines + DEPENDS:=@TARGET_ixp4xx +endef + +define Package/ixp4xx-microcode/description + This package contains the microcode needed to use the network engines in IXP4xx CPUs +endef + +define Build/Prepare + rm -rf $(PKG_BUILD_DIR) + mkdir -p $(PKG_BUILD_DIR) + unzip -d $(PKG_BUILD_DIR)/ $(DL_DIR)/$(PKG_SOURCE) + mv $(PKG_BUILD_DIR)/ixp400_xscale_sw/src/npeDl/IxNpeMicrocode.c $(PKG_BUILD_DIR)/ + rm -rf $(PKG_BUILD_DIR)/ixp400_xscale_sw + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Build/Compile + (cd $(PKG_BUILD_DIR); \ + $(HOSTCC) -Wall -I$(STAGING_DIR_HOST)/include IxNpeMicrocode.c -o IxNpeMicrocode; \ + ./IxNpeMicrocode -be \ + ) +endef + +define Package/ixp4xx-microcode/install + $(INSTALL_DIR) $(1)/lib/firmware + $(INSTALL_DIR) $(1)/usr/share/doc + $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-A $(1)/lib/firmware/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-A-HSS $(1)/lib/firmware/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-B $(1)/lib/firmware/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-C $(1)/lib/firmware/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/LICENSE.IPL $(1)/usr/share/doc/ +endef + +$(eval $(call BuildPackage,ixp4xx-microcode)) diff --git a/package/firmware/ixp4xx-microcode/src/IxNpeMicrocode.h b/package/firmware/ixp4xx-microcode/src/IxNpeMicrocode.h new file mode 100644 index 000000000000..4a843db104f9 --- /dev/null +++ b/package/firmware/ixp4xx-microcode/src/IxNpeMicrocode.h @@ -0,0 +1,148 @@ +/* + * IxNpeMicrocode.h - Headerfile for compiling the Intel microcode C file + * + * Copyright (C) 2006 Christian Hohnstaedt + * + * This file is released under the GPLv2 + * + * + * compile with + * + * gcc -Wall IxNpeMicrocode.c -o IxNpeMicrocode + * + * Executing the resulting binary on your build-host creates the + * "NPE-[ABC].xxxxxxxx" files containing the selected microcode + * + * fetch the IxNpeMicrocode.c from the Intel Access Library. + * It will include this header. + * + * select Images for every NPE from the following + * (used C++ comments for easy uncommenting ....) + */ + +// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_SPAN_MASK_FIREWALL_VLAN_QOS_HDR_CONV_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_SPAN_VLAN_QOS_HDR_CONV_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_LEARN_FILTER_SPAN_MASK_FIREWALL_VLAN_QOS_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEA_HSS_TSLOT_SWITCH +#define IX_NPEDL_NPEIMAGE_NPEA_ETH_SPAN_FIREWALL_VLAN_QOS_HDR_CONV +// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_LEARN_FILTER_SPAN_FIREWALL_VLAN_QOS +// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_LEARN_FILTER_SPAN_FIREWALL +#define IX_NPEDL_NPEIMAGE_NPEA_HSS_2_PORT +// #define IX_NPEDL_NPEIMAGE_NPEA_DMA +// #define IX_NPEDL_NPEIMAGE_NPEA_ATM_MPHY_12_PORT +// #define IX_NPEDL_NPEIMAGE_NPEA_HSS0_ATM_MPHY_1_PORT +// #define IX_NPEDL_NPEIMAGE_NPEA_HSS0_ATM_SPHY_1_PORT +// #define IX_NPEDL_NPEIMAGE_NPEA_HSS0 +// #define IX_NPEDL_NPEIMAGE_NPEA_WEP + + +// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_SPAN_MASK_FIREWALL_VLAN_QOS_HDR_CONV_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_SPAN_VLAN_QOS_HDR_CONV_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_MASK_FIREWALL_VLAN_QOS_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEB_DMA +#define IX_NPEDL_NPEIMAGE_NPEB_ETH_SPAN_FIREWALL_VLAN_QOS_HDR_CONV +// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_FIREWALL_VLAN_QOS +// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_FIREWALL + + +// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_SPAN_MASK_FIREWALL_VLAN_QOS_HDR_CONV_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_SPAN_VLAN_QOS_HDR_CONV_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_LEARN_FILTER_SPAN_MASK_FIREWALL_VLAN_QOS_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEC_DMA +// #define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_ETH_LEARN_FILTER_SPAN +// #define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_ETH_LEARN_FILTER_FIREWALL +#define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_CCM_ETH +// #define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_CCM_EXTSHA_ETH +// #define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_ETH_LEARN_FILTER_SPAN_FIREWALL +// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_SPAN_FIREWALL_VLAN_QOS_HDR_CONV +// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_LEARN_FILTER_SPAN_FIREWALL_VLAN_QOS +// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_LEARN_FILTER_SPAN_FIREWALL + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define to_le32(x) (x) +#define to_be32(x) bswap_32(x) +#else +#define to_be32(x) (x) +#define to_le32(x) bswap_32(x) +#endif + +struct dl_image { + unsigned magic; + unsigned id; + unsigned size; + unsigned data[0]; +}; + +const unsigned IxNpeMicrocode_array[]; + +int main(int argc, char *argv[]) +{ + struct dl_image *image = (struct dl_image *)IxNpeMicrocode_array; + int imgsiz, i, fd, cnt; + const unsigned *arrayptr = IxNpeMicrocode_array; + const char *names[] = { "IXP425", "IXP465", "unknown" }; + int bigendian = 1; + + if (argc > 1) { + if (!strcmp(argv[1], "-le")) + bigendian = 0; + else if (!strcmp(argv[1], "-be")) + bigendian = 1; + else { + printf("Usage: %s <-le|-be>\n", argv[0]); + return EXIT_FAILURE; + } + } + + for (image = (struct dl_image *)arrayptr, cnt=0; + (image->id != 0xfeedf00d) && (image->magic == 0xfeedf00d); + image = (struct dl_image *)(arrayptr), cnt++) + { + unsigned char field[4]; + imgsiz = image->size + 3; + *(unsigned*)field = to_be32(image->id); + char filename[40], slnk[10]; + + sprintf(filename, "NPE-%c.%08x", (field[0] & 0xf) + 'A', + image->id); + if (image->id == 0x00090000) + sprintf(slnk, "NPE-%c-HSS", (field[0] & 0xf) + 'A'); + else + sprintf(slnk, "NPE-%c", (field[0] & 0xf) + 'A'); + + printf("Writing image: %s.NPE_%c Func: %2x Rev: %02x.%02x " + "Size: %5d to: '%s'\n", + names[field[0] >> 4], (field[0] & 0xf) + 'A', + field[1], field[2], field[3], imgsiz*4, filename); + fd = open(filename, O_CREAT | O_RDWR | O_TRUNC, 0644); + if (fd >= 0) { + for (i=0; i/dev/null | grep -c 00:00:00:00:00:00)" = "1" ]; then + ip link set dev $npe address $(fconfig -s -r -d /dev/$1 -n npe_"$npe"_esa) + fi + done + + # -- Fixup for the WG302v1, need someone with a WAG302v1 to fix that, too + + if [ "$(ifconfig eth0 2>/dev/null | grep -c 00:00:00:00:00:00)" = "1" ]; then + ip link set dev $npe address $(fconfig -s -r -d /dev/$1 -n zcom_npe_esa) + fi + + # Others (*cough*, Tonze) are not handling mac addresses at all + + if [ "$(ifconfig eth0 2>/dev/null | grep -c 00:00:00:00:00:00)" = "1" ]; then + ip link set dev eth0 address 00:11:22:33:44:55 + fi + if [ "$(ifconfig eth1 2>/dev/null | grep -c 00:00:00:00:00:00)" = "1" ]; then + ip link set dev eth0 address 00:11:22:33:44:56 + fi +} + +set_from_sysconf () { + ip link set dev eth0 address $(mtd_get_mac_ascii SysConf hw_addr) +} + +set_ether_mac () { + RBC="$(grep "RedBoot config" /proc/mtd | cut -d: -f1)" + if [ ! -z $RBC ] ; then + set_from_redboot $RBC + else + SYSC="$(grep "SysConf" /proc/mtd | cut -d: -f1)" + if [ ! -z $SYSC ] ; then + set_from_sysconf + fi + fi +} + +boot_hook_add preinit_main set_ether_mac diff --git a/target/linux/ixp4xx/config-6.1 b/target/linux/ixp4xx/config-6.1 new file mode 100644 index 000000000000..ab696fe22ddc --- /dev/null +++ b/target/linux/ixp4xx/config-6.1 @@ -0,0 +1,246 @@ +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_FORCE_MAX_ORDER=11 +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_IXP4XX=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +# CONFIG_ARCH_MULTI_V4 is not set +# CONFIG_ARCH_MULTI_V4T is not set +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_NO_SG_CHAIN=y +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +# CONFIG_ARCH_PRPMC1100 is not set +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARM=y +CONFIG_ARM_APPENDED_DTB=y +# CONFIG_ARM_ATAG_DTB_COMPAT is not set +CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND=y +# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER is not set +CONFIG_ARM_L1_CACHE_SHIFT=5 +CONFIG_ARM_PATCH_PHYS_VIRT=y +CONFIG_ARM_THUMB=y +CONFIG_ARM_UNWIND=y +CONFIG_ATA=y +CONFIG_ATAGS=y +CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BOUNCE=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLONE_BACKWARDS=y +# CONFIG_CMDLINE_FROM_BOOTLOADER is not set +CONFIG_COMMON_CLK=y +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_BIG_ENDIAN=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_ENDIAN_BE32=y +CONFIG_CPU_PABRT_LEGACY=y +CONFIG_CPU_THUMB_CAPABLE=y +CONFIG_CPU_TLB_V4WBI=y +CONFIG_CPU_USE_DOMAINS=y +CONFIG_CPU_XSCALE=y +CONFIG_CRYPTO_DEV_IXP4XX=m +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_RNG2=y +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" +CONFIG_DEBUG_UART_8250=y +CONFIG_DEBUG_UART_8250_SHIFT=2 +CONFIG_DEBUG_UART_PHYS=0xc8000003 +CONFIG_DEBUG_UART_VIRT=0xfec00003 +CONFIG_DMABOUNCE=y +CONFIG_DMA_OPS=y +CONFIG_DMA_REMAP=y +CONFIG_DNOTIFY=y +CONFIG_DTC=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EEPROM_AT24=y +# CONFIG_EEPROM_LEGACY is not set +CONFIG_EXT2_FS=y +CONFIG_EXT2_FS_XATTR=y +CONFIG_EXT2_FS_POSIX_ACL=y +# CONFIG_EXT2_FS_SECURITY is not set +CONFIG_EXT3_FS=y +CONFIG_EXT3_FS_POSIX_ACL=y +# CONFIG_EXT3_FS_SECURITY is not set +CONFIG_EXT4_FS=y +CONFIG_EXT4_FS_POSIX_ACL=y +# CONFIG_EXT4_FS_SECURITY is not set +# CONFIG_FARSYNC is not set +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FORCE_PCI=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GPIOLIB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_GENERIC=y +CONFIG_GPIO_GW_PLD=y +CONFIG_GPIO_IXP4XX=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HDLC=y +CONFIG_HWMON=y +CONFIG_HWMON_VID=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_IXP4XX=y +CONFIG_HZ=100 +CONFIG_HZ_100=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_GPIO=y +CONFIG_I2C_IOP3XX=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INPUT_GPIO_BEEPER=y +CONFIG_INPUT_MISC=y +CONFIG_INTEL_IXP4XX_EB=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +# CONFIG_IWMMXT is not set +CONFIG_IXP4XX_ETH=y +# CONFIG_IXP4XX_INDIRECT_PCI is not set +CONFIG_IXP4XX_HSS=y +CONFIG_IXP4XX_IRQ=y +CONFIG_IXP4XX_NPE=y +# CONFIG_IXP4XX_PCI_LEGACY is not set +CONFIG_IXP4XX_QMGR=y +CONFIG_IXP4XX_TIMER=y +CONFIG_IXP4XX_WATCHDOG=y +CONFIG_LEDS_GPIO=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LIBFDT=y +CONFIG_LLD_VERSION=0 +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_DEVRES=y +CONFIG_MEMFD_CREATE=y +CONFIG_MIGRATION=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MTD_CFI_ADV_OPTIONS=y +# CONFIG_MTD_CFI_GEOMETRY is not set +CONFIG_MTD_IXP4XX=y +CONFIG_MTD_OTP=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_OF=y +CONFIG_MTD_PHYSMAP_IXP4XX=y +CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_SPLIT_FIRMWARE_NAME="linux" +CONFIG_MTD_SPLIT_SQUASHFS_ROOT=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_KUSER_HELPERS=y +CONFIG_NEED_MACH_IO_H=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_PTP_CLASSIFY=y +CONFIG_NET_VENDOR_XSCALE=y +CONFIG_NVMEM=y +CONFIG_NVMEM_SYSFS=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y +CONFIG_OF_MDIO=y +CONFIG_OF_NET=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PATA_IXP4XX_CF=y +CONFIG_PCI=y +CONFIG_PCI_IXP4XX=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PHYS_OFFSET=0 +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_GPIO=y +CONFIG_RATIONAL=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_DS1672=y +CONFIG_RTC_DRV_ISL1208=y +CONFIG_RTC_DRV_PCF8563=y +CONFIG_RTC_DRV_X1205=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RTC_MC146818_LIB=y +CONFIG_SENSORS_AD7418=y +CONFIG_SENSORS_MAX6650=y +CONFIG_SENSORS_W83781D=y +CONFIG_SERIAL_8250_EXAR=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_8250_NR_UARTS=2 +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_PERICOM=y +CONFIG_SERIAL_8250_RUNTIME_UARTS=2 +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPLIT_PTLOCK_CPUS=999999 +CONFIG_SRCU=y +CONFIG_SWPHY=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TINY_SRCU=y +CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h" +CONFIG_UNWINDER_ARM=y +# CONFIG_UNUSED_BOARD_FILES is not set +CONFIG_USB=y +CONFIG_USB_COMMON=y +CONFIG_USB_EHCI_BIG_ENDIAN_DESC=y +CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_PCI=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PCI=y +# CONFIG_USB_OHCI_HCD_PLATFORM is not set +CONFIG_USB_PCI=y +CONFIG_USB_STORAGE=y +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_WAN=y +CONFIG_WATCHDOG_NOWAYOUT=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 diff --git a/target/linux/ixp4xx/image/Makefile b/target/linux/ixp4xx/image/Makefile new file mode 100644 index 000000000000..73e0984f638c --- /dev/null +++ b/target/linux/ixp4xx/image/Makefile @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2006-2021 OpenWrt.org + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/image.mk + +# Cook a Linksys NSLU2 etc image +define Build/linksys-ixp425-image + touch $@.null-initrd + $(TOPDIR)/scripts/slugimage.pl -L $(STAGING_DIR_IMAGE)/apex-$(1)-armeb.bin -k $@ -r $@.null-initrd -p -o $@.new + mv $@.new $@ +endef + +# Build sysupgrade image +define BuildFirmware/Generic + dd if=$(KDIR)/zImage of=$(KDIR)/zImage.pad bs=64k conv=sync; \ + dd if=$(KDIR)/root.$(1) of=$(KDIR)/root.$(1).pad bs=128k conv=sync; \ + sh $(TOPDIR)/scripts/combined-image.sh \ + $(KDIR)/zImage.pad \ + $(KDIR)/root.$(1).pad \ + $(BIN_DIR)/$(IMG_PREFIX)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))-sysupgrade.bin +endef + +define Image/Build + $(call Image/Build/$(1),$(1)) + $(call BuildFirmware/Generic,$(1)) +endef + +define Device/Default + PROFILES := Default + KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) + KERNEL_NAME := zImage + KERNEL := kernel-bin | append-dtb + BLOCKSIZE := 128k +endef + +define Device/avila + DEVICE_VENDOR := Gateway + DEVICE_MODEL := Avila GW2348-4 + DEVICE_DTS := intel-ixp42x-gateworks-gw2348 + KERNEL := kernel-bin | append-dtb + IMAGES := kernel.bin rootfs.bin + IMAGE/kernel.bin := append-kernel + IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k +endef +TARGET_DEVICES += avila + +define Device/cambria + DEVICE_VENDOR := Gateway + DEVICE_MODEL := Cambria GW2358-4 + DEVICE_DTS := intel-ixp43x-gateworks-gw2358 + KERNEL := kernel-bin | append-dtb + IMAGES := kernel.bin rootfs.bin + IMAGE/kernel.bin := append-kernel + IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k +endef +TARGET_DEVICES += cambria + +define Device/nslu2 + DEVICE_VENDOR := Linksys + DEVICE_MODEL := NSLU2 + # Only 32 MB of RAM so not building by default + DEFAULT := n + DEVICE_DTS := intel-ixp42x-linksys-nslu2 + KERNEL := kernel-bin | append-dtb + IMAGES := factory.bin + # This has to boot from harddisk so just append the kernel + IMAGE/factory.bin := append-kernel | linksys-ixp425-image "nslu2" +endef +TARGET_DEVICES += nslu2 + +$(eval $(call BuildImage)) diff --git a/target/linux/ixp4xx/patches-6.1/0001-mtd-cfi_cmdset_0001-Byte-swap-OTP-info.patch b/target/linux/ixp4xx/patches-6.1/0001-mtd-cfi_cmdset_0001-Byte-swap-OTP-info.patch new file mode 100644 index 000000000000..1c5e44bb7240 --- /dev/null +++ b/target/linux/ixp4xx/patches-6.1/0001-mtd-cfi_cmdset_0001-Byte-swap-OTP-info.patch @@ -0,0 +1,74 @@ +From 4e242d6e08ad1d85b832e158cd0eafcb8f3f76a1 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Tue, 30 May 2023 22:40:31 +0200 +Subject: [PATCH v3] mtd: cfi_cmdset_0001: Byte swap OTP info + +Currently the offset into the device when looking for OTP +bits can go outside of the address of the MTD NOR devices, +and if that memory isn't readable, bad things happen +on the IXP4xx (added prints that illustrate the problem before +the crash): + +cfi_intelext_otp_walk walk OTP on chip 0 start at reg_prot_offset 0x00000100 +ixp4xx_copy_from copy from 0x00000100 to 0xc880dd78 +cfi_intelext_otp_walk walk OTP on chip 0 start at reg_prot_offset 0x12000000 +ixp4xx_copy_from copy from 0x12000000 to 0xc880dd78 +8<--- cut here --- +Unable to handle kernel paging request at virtual address db000000 +[db000000] *pgd=00000000 +(...) + +This happens in this case because the IXP4xx is big endian and +the 32- and 16-bit fields in the struct cfi_intelext_otpinfo are not +properly byteswapped. Compare to how the code in read_pri_intelext() +byteswaps the fields in struct cfi_pri_intelext. + +Adding a small byte swapping loop for the OTP in read_pri_intelext() +and the crash goes away. + +The problem went unnoticed for many years until I enabled +CONFIG_MTD_OTP on the IXP4xx as well, triggering the bug. + +Cc: Nicolas Pitre +Cc: stable@vger.kernel.org +Signed-off-by: Linus Walleij +--- +ChangeLog v2->v3: +- Move the byte swapping to a small loop in read_pri_intelext() + so all bytes are swapped as we reach cfi_intelext_otp_walk(). +ChangeLog v1->v2: +- Drill deeper and discover a big endian compatibility issue. +--- + drivers/mtd/chips/cfi_cmdset_0001.c | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +--- a/drivers/mtd/chips/cfi_cmdset_0001.c ++++ b/drivers/mtd/chips/cfi_cmdset_0001.c +@@ -421,9 +421,25 @@ read_pri_intelext(struct map_info *map, + extra_size = 0; + + /* Protection Register info */ +- if (extp->NumProtectionFields) ++ if (extp->NumProtectionFields) { ++ struct cfi_intelext_otpinfo *otp = ++ (struct cfi_intelext_otpinfo *)&extp->extra[0]; ++ + extra_size += (extp->NumProtectionFields - 1) * +- sizeof(struct cfi_intelext_otpinfo); ++ sizeof(struct cfi_intelext_otpinfo); ++ ++ if (extp_size >= sizeof(*extp) + extra_size) { ++ int i; ++ ++ /* Do some byteswapping if necessary */ ++ for (i = 0; i < extp->NumProtectionFields - 1; i++) { ++ otp->ProtRegAddr = le32_to_cpu(otp->ProtRegAddr); ++ otp->FactGroups = le16_to_cpu(otp->FactGroups); ++ otp->UserGroups = le16_to_cpu(otp->UserGroups); ++ otp++; ++ } ++ } ++ } + } + + if (extp->MinorVersion >= '1') { diff --git a/target/linux/ixp4xx/patches-6.1/301-ARM-dts-ixp4xx-Boot-NSLU2-from-harddrive.patch b/target/linux/ixp4xx/patches-6.1/301-ARM-dts-ixp4xx-Boot-NSLU2-from-harddrive.patch new file mode 100644 index 000000000000..ffd69a774c3c --- /dev/null +++ b/target/linux/ixp4xx/patches-6.1/301-ARM-dts-ixp4xx-Boot-NSLU2-from-harddrive.patch @@ -0,0 +1,24 @@ +From 2792791a19f90b0141ed2e781599ba0a42a8cfd5 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Mon, 29 May 2023 23:32:44 +0200 +Subject: [PATCH] ARM: dts: ixp4xx: Boot NSLU2 from harddrive + +This enforces harddrive boot on the NSLU2. The flash is too small +to hold any rootfs these days. + +Signed-off-by: Linus Walleij +--- + arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts ++++ b/arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts +@@ -21,7 +21,7 @@ + }; + + chosen { +- bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rw rootfstype=squashfs,jffs2 rootwait"; ++ bootargs = "console=ttyS0,115200n8 root=/dev/sda1 rw rootwait"; + stdout-path = "uart0:115200n8"; + }; + From patchwork Mon Jun 19 11:31:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1796510 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=ad/Pfh0c; 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=axXg4/La; 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 4Ql71H0Rtrz20XQ for ; Mon, 19 Jun 2023 21:33:07 +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=pv6YupyMQBt+GVambvTIrwfZ8ZlVwUSfe5ohZGNaVUo=; b=ad/Pfh0cxbqsiS rVOG6qwIoEZQDtHd3u3MXqeg+i1hhmYySLBRwZqxYkbGMEwpbE0xrJ553QbD/iXOKGh7ZcRYq3wOG IcWOZ2Gd2gb6qgi8vrRYxuySwEemH1bQiufGiGRTWBO0NDqFIbfX9oCJY0IHKx6i7HYim/6voMqx+ YzY8vWwQhBHp0Y9bPBWglYAn86IHoEYS3QsBgmKzeeaYF+FEqLGSkAfOn3i/zxOJZ3TEU5sEdifyY IKAwfK5cyDWbV5kab2nhq2U/dMR7b1X/8d6jNLwf1Pldg76Bvk6uDPDIGsWn5w4T0iAfxZSDMw456 M8uJp2bGGwbKm9GtdxaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qBD6c-008MQi-38; Mon, 19 Jun 2023 11:31:34 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qBD6X-008MNm-2Y for openwrt-devel@lists.openwrt.org; Mon, 19 Jun 2023 11:31:32 +0000 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f87592eccfso461356e87.2 for ; Mon, 19 Jun 2023 04:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687174288; x=1689766288; 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=lhK4ft/S/nYU2WMl+RfDXPu0obUWGPcuG02UNdtTt5Q=; b=axXg4/Law2NdTJ0DMqj/+jB2YnhKv9sf0UImozCx0J3cFAvJdWNLAyqLSK9VdbAD0B eIXKJ9SLqdBmA3euG/VMus4TKWUkqJra4/v4bLhqocaO8ojb94YyckgZoFmFgEnuoLzC deNs9NEBWkacSSjDqGX0/KCaV//rumbpaXCh1eulS6Eu5jTPTO+p0DVQSPcxfFIS5Kpn g95IGY4WpIbW4Csch3UxDNZdU+OsIxXWdJWmPxu0UieXNW32VeynxXAen9TtgkkfhL8u HTEWS0qOmpAAl6bC3MQmLwZI3ciGeVSIDSLIBH+u2oTK9cRrA7bdILUoBQioLpyhuk1F bGTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687174288; x=1689766288; 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=lhK4ft/S/nYU2WMl+RfDXPu0obUWGPcuG02UNdtTt5Q=; b=LOMhWy1iZ0MVYvO7lMUT1Qh7TqnGuJh5q9QQlmaQR0VMlFghWbNw2vr6ce1HVs0MNE 0HiEzeAP8Z0aH7dgCmISxbRJjIFJ35evpwzEtwap/5/w8PMqcpbviVBx0lcRzhCVGuSD 23gaaCAmUiRuudT4ZRmWfmpXlt6FjT7jQ7RhR6o95fQ9tcdmGf52n6Lp9dl7GyGVU8zu 7yMb8/8I0ArDX04m92giEIuCC3+IFtTV9JepIzKBimdnXRrPy9KR5EFopncLol8sCigp mYrXNn/vv4IV+5TSFpsCWVSFPEn6s0NpPaaZg+QtLWgSy2lIwRBPZrI5yyZHjHSSV8FN 6rdQ== X-Gm-Message-State: AC+VfDz+JCWwyZGzPpyVylMy+a2U78F+P0VZh0Dif/f/QuWApJWrPXeN Rkk0YlHxpI8xcPqRSPyYcHH1Jw== X-Google-Smtp-Source: ACHHUZ4hyqdiy8L3MWXWJELbDgOaaGt1F+SA6fIAagOwZObwuaGv8inyfObuwn56XOkHiAGoSX1UKQ== X-Received: by 2002:ac2:4652:0:b0:4f8:6ef6:e750 with SMTP id s18-20020ac24652000000b004f86ef6e750mr1733918lfo.52.1687174287811; Mon, 19 Jun 2023 04:31:27 -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 i25-20020ac25239000000b004f8571275a4sm1416273lfl.96.2023.06.19.04.31.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 04:31:27 -0700 (PDT) From: Linus Walleij To: Imre Kaloz , Krzysztof Halasa Cc: openwrt-devel@lists.openwrt.org, Linus Walleij Subject: [PATCH v1 3/5] ixp4xx: Add a ixp4xx hardware crypto kernel module Date: Mon, 19 Jun 2023 13:31:04 +0200 Message-Id: <20230619113106.2653595-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230619113106.2653595-1-linus.walleij@linaro.org> References: <20230619113106.2653595-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-20230619_043129_831279_0A042C50 X-CRM114-Status: UNSURE ( 9.11 ) X-CRM114-Notice: Please train this message. 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 IXP4xx crypto module must be loaded after the rootfs is up as it depends on loading some NPE microcode from the file system. Signed-off-by: Linus Walleij --- package/kernel/linux/modules/crypto.mk | 13 +++++++++++++ target/linux/ixp4xx/Makefile | 1 + 2 files changed, 14 insertions(+) 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:12d 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 IXP4xx crypto module must be loaded after the rootfs is up as it depends on loading some NPE microcode from the file system. Signed-off-by: Linus Walleij --- package/kernel/linux/modules/crypto.mk | 13 +++++++++++++ target/linux/ixp4xx/Makefile | 1 + 2 files changed, 14 insertions(+) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index 248b4d68f9e1..1c83f07330a5 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -399,6 +399,19 @@ endef $(eval $(call KernelPackage,crypto-hw-hifn-795x)) +define KernelPackage/crypto-hw-ixp4xx + TITLE:=Intel IXP4xx crypto accelerator + DEPENDS:=@TARGET_ixp4xx +kmod-random-core +kmod-crypto-manager +kmod-crypto-authenc +kmod-crypto-des + KCONFIG:= \ + CONFIG_CRYPTO_HW=y \ + CONFIG_CRYPTO_DEV_IXP4XX + FILES:=$(LINUX_DIR)/drivers/crypto/ixp4xx_crypto.ko + AUTOLOAD:=$(call AutoLoad,09,ixp4xx_crypto) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-hw-ixp4xx)) + define KernelPackage/crypto-hw-padlock TITLE:=VIA PadLock ACE with AES/SHA hw crypto module diff --git a/target/linux/ixp4xx/Makefile b/target/linux/ixp4xx/Makefile index 546964a6a876..080576beb237 100644 --- a/target/linux/ixp4xx/Makefile +++ b/target/linux/ixp4xx/Makefile @@ -22,6 +22,7 @@ include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += ixp4xx-microcode \ fconfig \ + kmod-crypto-hw-ixp4xx \ kmod-usb-ledtrig-usbport \ kmod-leds-gpio From patchwork Mon Jun 19 11:31:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1796509 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=27CycC4j; 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=v8QSih6B; 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 4Ql7184b0Rz20XQ for ; Mon, 19 Jun 2023 21:32:59 +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=TfP2HAGNdVhDqJwg5NYEcWY3+5iuHFYFg6NHNxVkujs=; b=27CycC4jCBgOl1 4fF+UYCPNr5EujHHlcyWh9lQU5NmrieHZ0YGPYsO+k5r8QymZzzA6WP3fDLDxOpa4j6iGTm2wEroF JTGTUgG8fFjlWCMCzDPktSLP5c8LTCB2uGyLRTBWFypPiTj2qwLtzh0tK8JC7KoxKJsPZtwr5gZV/ GhsAAeK5MmIilyga2PhaN1Vc//rRl/OeJmX6AyzBs57WbDt99U5qAkvE3R+144yhCopV+ZARNhnaK jTPJdMPLxhUbyQnZ1kEmympDR7/0fiPdv+2vRsifp9lmULtaAmlADEqNU5hDsXqv0P3ptJmdTXMm/ OYw4+K4UJDYX0dqRNAgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qBD6e-008MR9-0n; Mon, 19 Jun 2023 11:31:36 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qBD6Z-008MOX-2A for openwrt-devel@lists.openwrt.org; Mon, 19 Jun 2023 11:31:33 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f849605df4so4219049e87.3 for ; Mon, 19 Jun 2023 04:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687174289; x=1689766289; 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=k1y9rG4Qmn2r7WY8obapotlWKyNw+qY799TN9c9K7DI=; b=v8QSih6BmX1wMtvKj9dmsIMsiNZEMEwIr56jBGIQqAWqfqjG7egQbrTDygll3gA5r/ VSrGoFEstIekcdWsPVzRXtWAkVl4wOBpWD7whjfR/Vm5yVbRKMP9P72E3uKSqvARcdA8 lbW3aXWl58wfjjfJ47XDXDnMlZTlXdv79PMLLtakYRLpdJvqvElrdcUAZuG9MW5HjxL3 twYTmof5CaMxrN0ZHUC2vH3TsFeVpfEN5qYGsqoaQpMhKGKWxJ9lWNLfSNsutgJFQWP9 PMrh0tluOT/6BMKhvz0b/QLuAAI/bLDa13JYbWo3OnsRgv3uEk+GBWtEnfTe12wxAYD2 U4wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687174289; x=1689766289; 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=k1y9rG4Qmn2r7WY8obapotlWKyNw+qY799TN9c9K7DI=; b=NjSxOrhE0J2PXGkll+/KdSDUSQ+bwrVSezk4Bgx9oWzwQzkKRGHl2QWcrZSKyAPTuv kGNLp1MoiWCMRd6Azv5oTqWqu3cci8WNDMgzyzTpr4C6pK5g76v8B/LnDPlwYl4sr68U niS+Y5nZhnm9xA0eE04AmYVbZ5ct0kWMRfrTnwWqkZvRadJ7lQdD+Y1as2Ealo+4FrHK 3L04pSf96k/6tdha0X3hDXYh0EhJc/iAODBNuUVqYEFAT9lcnXeklMY4Xkk/7j7dhnz7 ZUbEmRefnjwcxqVOQ4GaOIYcied+V/6RpTx9mFZ1gD70wqqpWbZoQuhCNLynL7TgfS7Q EwcQ== X-Gm-Message-State: AC+VfDx2RhCOcysoXc+ymWFJ9fBi+d9h3Gej4FU8+F8HvmwwtmLpKjdA eQIiAkuhYj+rvw8UcorTrfczYY9LwPru3u30fK4= X-Google-Smtp-Source: ACHHUZ4i5p1N7/pS4fxHivymGPsAvRAbdg5iRJ41SRwJXPdKwn0gb0ONFMNOyau/E7anL6DNSqUZMA== X-Received: by 2002:ac2:5b05:0:b0:4f6:2b29:b446 with SMTP id v5-20020ac25b05000000b004f62b29b446mr5032907lfn.21.1687174289315; Mon, 19 Jun 2023 04:31:29 -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 i25-20020ac25239000000b004f8571275a4sm1416273lfl.96.2023.06.19.04.31.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 04:31:28 -0700 (PDT) From: Linus Walleij To: Imre Kaloz , Krzysztof Halasa Cc: openwrt-devel@lists.openwrt.org, Linus Walleij Subject: [PATCH v1 4/5] ixp4xx: Add hdparm script Date: Mon, 19 Jun 2023 13:31:05 +0200 Message-Id: <20230619113106.2653595-5-linus.walleij@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230619113106.2653595-1-linus.walleij@linaro.org> References: <20230619113106.2653595-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-20230619_043131_707670_6973FB6E X-CRM114-Status: GOOD ( 11.00 ) 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: This script will make sure to spin down harddrives on IXP4xx NAS devices such as the NSLU2 and siblings after 1 minute of inactivity. Signed-off-by: Linus Walleij --- .../linux/ixp4xx/base-files/etc/board.d/03_hdparm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 target/linux/ixp4x [...] 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:12b 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 This script will make sure to spin down harddrives on IXP4xx NAS devices such as the NSLU2 and siblings after 1 minute of inactivity. Signed-off-by: Linus Walleij --- .../linux/ixp4xx/base-files/etc/board.d/03_hdparm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 target/linux/ixp4xx/base-files/etc/board.d/03_hdparm diff --git a/target/linux/ixp4xx/base-files/etc/board.d/03_hdparm b/target/linux/ixp4xx/base-files/etc/board.d/03_hdparm new file mode 100644 index 000000000000..27f2b760420e --- /dev/null +++ b/target/linux/ixp4xx/base-files/etc/board.d/03_hdparm @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Spin down drives after one minute if inactive + +if [ ! -n "$(command -v hdparm)" ]; then + exit 0 +fi + +DISKS=$(find /dev/sd[a-z] 2>/dev/null) +for DISK in $DISKS +do + if [ -b $DISK ] ; then + hdparm -S 12 $DISK > /dev/null + fi +done From patchwork Mon Jun 19 11:31:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1796513 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=JTaElYS7; 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=E/LZMwMZ; 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 4Ql71Q1yJ9z20XQ for ; Mon, 19 Jun 2023 21:33:14 +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=d8Ac7Y4/n8r5rgnjP3fKxq9MkDtWVSp5cDwGtmNmGNA=; b=JTaElYS7WmWmk2 F4wXzRGZnVtDCradHW6emnUnG7WlPr7PXKacKFB1Zph/eW28OO5tNAqwj938LFAQHgybTYTONW6+D ktM7YSXoDr2TE5uTs5QACUurR9UazEKh9aFwIwj39dX9XAYnN9PZlh1XnxL2LR4aLXNp8a0b4Tzf2 qOsbWKxS57vLUgyelgOcNS/LjA3JNO5IZFrG8N7AHSjI+ZauQbtWD9SMhnppgf/zWLd5Bbq8cpo52 DMJDCtwBdXldAZODQO/OLNaeFAUD2MW/akumKXqW1bY6SW6xauv5QVEQhVoBBpo01T4by/wrO/Cs2 /7CPf+3sIESb64kfOiGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qBD6f-008MRr-2D; Mon, 19 Jun 2023 11:31:37 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qBD6a-008MP7-0R for openwrt-devel@lists.openwrt.org; Mon, 19 Jun 2023 11:31:33 +0000 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f841b7a697so3833409e87.3 for ; Mon, 19 Jun 2023 04:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687174291; x=1689766291; 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=0O5RCruHuTJnUeWSHmASSxOiJH9OaE7XOGLQF3hr4Ho=; b=E/LZMwMZDvBOrmVY/KRrVLITsodFqbH5rBIFUv6HZSl+3DjpQHAJxBjW5oHF8cab/G FjgarhQlydUsNTamtwbmOlLG83JkyZdWlQTksJ8P+jOL3ybbEEm3d/Xg83T/HO1JWhid 3GV86PzBWQ/8xsHU5HgtMkX1sfWvZJiEl/eSuYMkQ/mJb8o7R3AE0eROc2Pslq9OKv1y NIYnBcJtGWHmNQtzxI5Tn4ZK8IIuOeGOsdapVNhjP19ye/pLvgin9PO5ck1E+g97S8oe SXGKT8X8kF2jVuMcnNoNkiq8Uu5Bh05cL2jOM78sYQTDvzdObBbsnvDJOa6Eu0sucBtA K3+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687174291; x=1689766291; 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=0O5RCruHuTJnUeWSHmASSxOiJH9OaE7XOGLQF3hr4Ho=; b=LFeLLeOeTVtM9RZkcj7DmCIs7N7WZMWE//4gwL8p4I/7UDus83YubYqE1ja56H7rM3 lzz7mlN0MES0vasK1sgHwR/ZR6+aPIWIpfpNTGR18nioQDhb2gI/r2IektB2vTeZrbOl VGMjtvLmzQhYzWKSZqjuq0JvZWlzV7bEaSd9IYgBDKfMnpeihHXMSl3VUjOYu40zVCI4 lbAdSfJuX3DAt9Je/9Vc61LeTBg567d0EFnJpG1ysqXW13OmXFD3wLCG6mm87MR7DiJa 8ulphasDWDUCWvYeuMhWIx16N9ogS6kkF0ng0nFyKwlcqnSMtlURCrNxU5zp85BIZaXN VKYA== X-Gm-Message-State: AC+VfDzyKrNEY++jDG9x5XbVdaCTAGlFN1VZmieYYVRLKLCqOBEDPKQ7 g5LoV+KfDcwd1i8nRV032H1WWg== X-Google-Smtp-Source: ACHHUZ6KSmQUXS5VhfXl0VeEP/0PRJIt3WxzP3h21C+g9xvn8CMexbrhCg4WTNBMGbyOW+diYI4jdA== X-Received: by 2002:a19:7912:0:b0:4f4:dfd4:33e4 with SMTP id u18-20020a197912000000b004f4dfd433e4mr4312215lfc.51.1687174290815; Mon, 19 Jun 2023 04:31:30 -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 i25-20020ac25239000000b004f8571275a4sm1416273lfl.96.2023.06.19.04.31.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 04:31:30 -0700 (PDT) From: Linus Walleij To: Imre Kaloz , Krzysztof Halasa Cc: openwrt-devel@lists.openwrt.org, Linus Walleij Subject: [PATCH v1 5/5] Delete arm-magic script Date: Mon, 19 Jun 2023 13:31:06 +0200 Message-Id: <20230619113106.2653595-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230619113106.2653595-1-linus.walleij@linaro.org> References: <20230619113106.2653595-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-20230619_043132_171805_FBB6F237 X-CRM114-Status: GOOD ( 14.06 ) 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: This script was used to modify the wrong machine type passed from the boot loader to the kernel. The device tree kernels does not use the machine type so this script is no longer needed. Signed-off-by: Linus Walleij --- scripts/arm-magic.sh | 42 1 file changed, 42 deletions(-) delete mode 100755 scripts/arm-magic.sh 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:131 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 This script was used to modify the wrong machine type passed from the boot loader to the kernel. The device tree kernels does not use the machine type so this script is no longer needed. Signed-off-by: Linus Walleij --- scripts/arm-magic.sh | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100755 scripts/arm-magic.sh diff --git a/scripts/arm-magic.sh b/scripts/arm-magic.sh deleted file mode 100755 index b4b0fa94f574..000000000000 --- a/scripts/arm-magic.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# Empty/wrong machtype-workaround generator -# -# Copyright (C) 2006-2012 Imre Kaloz -# based on linux/arch/arm/boot/compressed/head-xscale.S -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -# NOTE: for now it's for only IXP4xx in big endian mode - -# list of supported boards, in "boardname machtypeid" format -for board in "avila 526" "gateway7001 731" "nslu2 597" "nas100d 865" "wg302v1 889" "wg302v2 890" "pronghorn 928" "pronghornmetro 1040" "compex 1273" "wrt300nv2 1077" "loft 849" "dsmg600 964" "fsg3 1091" "ap1000 1543" "tw2662 1658" "tw5334 1664" "ixdpg425 604" "cambria 1468" "sidewinder 1041" "ap42x 4418" -do - set -- $board - hexid=$(printf %x\\n $2) - if [ "$2" -lt "256" ]; then - # we have a low machtypeid, we just need a "mov" (e3a) - printf "\xe3\xa0\x10\x$hexid" > $BIN_DIR/$IMG_PREFIX-$1-zImage - else - # we have a high machtypeid, we need a "mov" (e3a) and an "orr" (e38) - if [ "$2" -lt "4096" ]; then - printf "\xe3\xa0\x10\x$(echo $hexid|cut -b "2 3")\xe3\x81\x1c\x$(echo $hexid|cut -b 1)" > $BIN_DIR/$IMG_PREFIX-$1-zImage - else - printf "\xe3\xa0\x10\x$(echo $hexid|cut -b "3 4")\xe3\x81\x1c\x$(echo $hexid|cut -b "1 2")" > $BIN_DIR/$IMG_PREFIX-$1-zImage - fi - fi - # generate the image - cat $BIN_DIR/$IMG_PREFIX-zImage >> $BIN_DIR/$IMG_PREFIX-$1-zImage -done