From patchwork Thu Mar 28 17:07:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1068470 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=o2.pl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TDe1aAH7"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.b="SxOjbA6r"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44VWV21RmHz9sNq for ; Fri, 29 Mar 2019 04:06:02 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=IKEdRws6Sj0X4YvUKnRzqCYegsj1cAHRzJLIgb7LWNI=; b=TDe1aAH7bC1g/Ls2rK7wR3pIdV M0c/hU61Z/Usxz87Fydd/m7LBnXw+ACk+HJlZdNtGxSjXT/6X9ck07gXwKc0rILH/Ze40NGUe1poZ NC6/ZekVIiqYovDPKpgN3cvPYL3KikubuUQQE9tmA+H+fhQQc40zfSWAhUsez6atX6IPMzv/pOkGZ UgueDF9+/obFOlgF/mu4Xu5CxRRYsC2qZ//BFpkLS+XLNPS9n0u8fBh1YI22bj+9fDus5fIzPlUo6 S7KGd5i2AcMoMmE6SEyyJ+NPGZOd76B+A6FH2dRIXyh6sCA3c9X23wYJOoqcKnooAuzev0ENyutJg +JU4dvAg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YTH-0000ts-L5; Thu, 28 Mar 2019 17:05:43 +0000 Received: from mx-out.tlen.pl ([193.222.135.158]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YT2-0000fa-Lj for openwrt-devel@lists.openwrt.org; Thu, 28 Mar 2019 17:05:32 +0000 Received: (wp-smtpd smtp.tlen.pl 18960 invoked from network); 28 Mar 2019 18:05:26 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1553792726; bh=MqnicftRN1gr8UacJyyBbd0TgV2GTXsuh7DHRB2JqpY=; h=From:To:Subject; b=SxOjbA6r4rRszQD72c20H1O0KsxGcKiqpgxXZi9HEJqfVOpoqFL2ZHKcSDFvAIuAq cdIA/cCgcwJ0dHI2Emllpglpj0az8AcOCWnAxMX86vYmuUiYDMA4M6v1pU2WOerXLD L5Im5V4Yia/MBdMyig/TRNgAFTfYZW4+91ugyHcY= Received: from 131.ip-164-132-48.eu (HELO localhost.localdomain) (tomek_n@o2.pl@[164.132.48.131]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 28 Mar 2019 18:05:26 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Thu, 28 Mar 2019 18:07:05 +0100 Message-Id: <20190328170711.3564-2-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190328170711.3564-1-tomek_n@o2.pl> References: <20190321185727.3239-1-tomek_n@o2.pl> <20190328170711.3564-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: 4024e456cbe9711ef7d488b960523a1d X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [YRNE] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190328_100528_872048_3D5D2CA8 X-CRM114-Status: UNSURE ( 7.02 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tomek_n[at]o2.pl) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 Subject: [OpenWrt-Devel] [PATCH v2 1/7] mvebu: make bootfs size for sdcard image configurable X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: 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 Let's take this oportunity to implement boot-part and rootfs-part feature flags. Signed-off-by: Tomasz Maciej Nowak --- config/Config-images.in | 2 +- target/linux/mvebu/Makefile | 2 +- target/linux/mvebu/image/Makefile | 16 ++++++---------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/config/Config-images.in b/config/Config-images.in index 6610601d55..9daaf74915 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -272,7 +272,7 @@ menu "Target Images" config TARGET_ROOTFS_PARTSIZE int "Root filesystem partition size (in MB)" - depends on GRUB_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_mvebu || TARGET_omap || TARGET_rb532 || TARGET_sunxi || TARGET_uml + depends on GRUB_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_omap || TARGET_rb532 || TARGET_sunxi || TARGET_uml default 256 help Select the root filesystem partition size. diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile index ee76c0b776..a920f6db7d 100644 --- a/target/linux/mvebu/Makefile +++ b/target/linux/mvebu/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk BOARD:=mvebu BOARDNAME:=Marvell EBU Armada -FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk +FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk boot-part rootfs-part SUBTARGETS:=cortexa9 cortexa53 cortexa72 MAINTAINER:=Imre Kaloz diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile index be01623e86..88790777d9 100644 --- a/target/linux/mvebu/image/Makefile +++ b/target/linux/mvebu/image/Makefile @@ -19,12 +19,6 @@ define Build/dtb $(call Image/BuildDTB,$(DTS_DIR)/$(DEVICE_DTS).dts,$@.dtb) endef -# SD-Card Images: -# these values are optimized for a 4GB labeled sdcard that actually holds 7744512 sectors of 512 byte -# MBR: 2048 sectors -# Partition 1: 32768 sectors -# Partition 2: 98304 sectors (configurable) - define Build/boot-scr rm -f $@-boot.scr sed -e 's#@ROOT@#$(SIGNATURE)#g' \ @@ -34,7 +28,7 @@ endef define Build/boot-img rm -f $@.boot - mkfs.fat -C $@.boot 16384 + mkfs.fat -C $@.boot $$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 )) $(foreach dts,$(DEVICE_DTS), mcopy -i $@.boot $(DTS_DIR)/$(dts).dtb ::$(dts).dtb;) mcopy -i $@.boot $(IMAGE_KERNEL) ::$(KERNEL_NAME) -mcopy -i $@.boot $@-boot.scr ::boot.scr @@ -46,26 +40,28 @@ define Build/boot-img-ext4 $(foreach dts,$(DEVICE_DTS), $(CP) $(DTS_DIR)/$(dts).dtb $@.boot;) $(CP) $(IMAGE_KERNEL) $@.boot/$(KERNEL_NAME) -$(CP) $@-boot.scr $@.boot/boot.scr - make_ext4fs -J -l 16384K $@.bootimg $@.boot + make_ext4fs -J -l $(CONFIG_TARGET_KERNEL_PARTSIZE)M $@.bootimg $@.boot endef define Build/sdcard-img if [ -n "$(UBOOT)" ]; then UBOOT="$(STAGING_DIR_IMAGE)/$(UBOOT)"; fi; \ + BOOTFS_SIZE=$$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 * 2 )); \ ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \ SIGNATURE="$(SIGNATURE)" \ ./gen_mvebu_sdcard_img.sh $@ \ $$UBOOT \ - c 32768 $@.boot \ + c $$BOOTFS_SIZE $@.boot \ 83 $$ROOTFS_SIZE $(IMAGE_ROOTFS) endef define Build/sdcard-img-ext4 if [ -n "$(UBOOT)" ]; then UBOOT="$(STAGING_DIR_IMAGE)/$(UBOOT)"; fi; \ + BOOTFS_SIZE=$$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 * 2 )); \ ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \ SIGNATURE="$(SIGNATURE)" \ ./gen_mvebu_sdcard_img.sh $@ \ $$UBOOT \ - 83 32768 $@.bootimg \ + 83 $$BOOTFS_SIZE $@.bootimg \ 83 $$ROOTFS_SIZE $(IMAGE_ROOTFS) endef From patchwork Thu Mar 28 17:07:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1068469 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=o2.pl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iDBLEQd3"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.b="OiMsiRD7"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44VWTt41lhz9sNq for ; Fri, 29 Mar 2019 04:05:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OL47b3rPx7SHhVd/haUtwN/+x6aEOvIUIS0rUGYcM5M=; b=iDBLEQd3Qw5EL4 fkG5a4EKP/IuVC1J13YQkS+jyd2mH+ZPvcr44qX+CkBZaoXp/5x1D3S1nWlx461OM0W9jdWm85Q7+ B6lkGoRhGvYzJ5EhiMIK9/nof7nXDrmRSMuqYRLCSST5ZjUYi71OFGTHTmduy1XgIoKZE/x26UP7N MPKCDqnbCR7xwN6jXufYlB8l8KUXeYkiQO0Nk870yqg3837VRfZdiXEg4aCfvLd1OgEu72IBJdbxn WRUcO1U4Vss2c34OfSF2flWARHosHuiuylf/4kuR449G9zXv0WclKh2t4cIBSIvSUiHGlkvoAxvQN ymy5OhZKnMgUuBOkqofA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YT7-0000gz-U1; Thu, 28 Mar 2019 17:05:33 +0000 Received: from mx-out.tlen.pl ([193.222.135.158]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YT4-0000g3-Gj for openwrt-devel@lists.openwrt.org; Thu, 28 Mar 2019 17:05:32 +0000 Received: (wp-smtpd smtp.tlen.pl 20320 invoked from network); 28 Mar 2019 18:05:27 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1553792727; bh=ps2M26i35xGbaAniPPiBSiLuQbMMBbhSxT7IlVocGYg=; h=From:To:Cc:Subject; b=OiMsiRD7pYtVXt39Nqd44XqDgtQJ37JnSaXO5K/8flwquOh4GfjZ29FyXKmpgiE12 f65Q1B6kXoN7WV58PUmlOPobDs3+yrOexrpXzRLV8CsrAxI43bU7Yiq13x0ztR1lj3 bQIZ2+QJz6onIu5ZLan//RRp8kB2w/xIvTX/Vem0= Received: from 131.ip-164-132-48.eu (HELO localhost.localdomain) (tomek_n@o2.pl@[164.132.48.131]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 28 Mar 2019 18:05:27 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Thu, 28 Mar 2019 18:07:06 +0100 Message-Id: <20190328170711.3564-3-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190328170711.3564-1-tomek_n@o2.pl> References: <20190321185727.3239-1-tomek_n@o2.pl> <20190328170711.3564-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: c9a642b8bdc99a8a60ad852f9246d1bd X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [8ePU] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190328_100530_724829_661A25E7 X-CRM114-Status: UNSURE ( 6.51 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tomek_n[at]o2.pl) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 Subject: [OpenWrt-Devel] [PATCH v2 2/7] mvebu: use ext4 for clearfog image bootfs X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jonas Gorski Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This will allow to drop additional packages and shrink image size. Cc: Jonas Gorski Signed-off-by: Tomasz Maciej Nowak --- target/linux/mvebu/image/cortex-a9.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/mvebu/image/cortex-a9.mk b/target/linux/mvebu/image/cortex-a9.mk index 79c3bc7bdb..610ce36cd7 100644 --- a/target/linux/mvebu/image/cortex-a9.mk +++ b/target/linux/mvebu/image/cortex-a9.mk @@ -128,7 +128,7 @@ define Device/armada-388-clearfog-pro DEVICE_TITLE := SolidRun ClearFog Pro DEVICE_PACKAGES := mkf2fs e2fsprogs swconfig kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 IMAGES := sdcard.img.gz - IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip | append-metadata + IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base SUPPORTED_DEVICES := armada-388-clearfog-pro armada-388-clearfog UBOOT := clearfog-u-boot-spl.kwb @@ -141,7 +141,7 @@ define Device/armada-388-clearfog-base DEVICE_TITLE := SolidRun ClearFog Base DEVICE_PACKAGES := mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 IMAGES := sdcard.img.gz - IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip | append-metadata + IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base UBOOT := clearfog-u-boot-spl.kwb endef From patchwork Thu Mar 28 17:07:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1068472 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=o2.pl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KmWu7xAo"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.b="KFqZnZBm"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44VWVH0Msvz9sNq for ; Fri, 29 Mar 2019 04:06:15 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=HHw3TFFowKmYTq7Hg0xdIbMPiPhZ9CKPc3NRoo0vPi0=; b=KmWu7xAo9fnWiOSXwhjQzq2Pap I3FvxcuNcKGQg1pSRIFjW49lSQOFsDYQUacBhtKepxHO325m64PKs8JSIHmBifRQXAUCg7De8zu6e mJMefqZ+/MPvgh3/9UujUNetAG6z7idlxj3uhvMsBQyPOq9487LhKa611d4pHR70r/UZMWJBrTzNJ 53HwEa23YtwFwixqHVvPVw57+fJkhvG+EN4CjY/n2l0uikPyCQ/a2SrrVLQiXTaweMaiS5lIsn3hT RuwEJEXvvvtsqc2pjVH7mmCsJuEDMshROlXm1kD9JAWg+4tgdszkkVXJZx1hZO0Hk3d2A4K9tMH2H yMGLG7xw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YTa-0001Mo-GU; Thu, 28 Mar 2019 17:06:02 +0000 Received: from mx-out.tlen.pl ([193.222.135.158]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YT5-0000g6-HN for openwrt-devel@lists.openwrt.org; Thu, 28 Mar 2019 17:05:35 +0000 Received: (wp-smtpd smtp.tlen.pl 24182 invoked from network); 28 Mar 2019 18:05:29 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1553792729; bh=PpwHtfdKR52h2MM9niDgi8M3zhm+KF6615+DMDlZ9Ug=; h=From:To:Subject; b=KFqZnZBmm/PzpPETZTRDXc9dlDXvvwcWX3QTSUizyeNBirW+9z2Lx3NVCuqQ2aECX bJC9BXUjkztVlOECqodpZ/IRXP7PU8D2tiqBt2tvREdjo/h87bzwlULPNmE65rFk4P LSnlm/0eNfRYXDoYCIvx49YiCsPfnKQJdEkNJTJY= Received: from 131.ip-164-132-48.eu (HELO localhost.localdomain) (tomek_n@o2.pl@[164.132.48.131]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 28 Mar 2019 18:05:29 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Thu, 28 Mar 2019 18:07:07 +0100 Message-Id: <20190328170711.3564-4-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190328170711.3564-1-tomek_n@o2.pl> References: <20190321185727.3239-1-tomek_n@o2.pl> <20190328170711.3564-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: 2bd08c82d5e23a5d1b432915d31247e8 X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [IQOk] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190328_100531_736013_A0966A94 X-CRM114-Status: UNSURE ( 8.29 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tomek_n[at]o2.pl) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 Subject: [OpenWrt-Devel] [PATCH v2 3/7] mvebu: shrink amount of packages and reorganize them X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: 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 Since most of devices using SD card image to boot, use ext4 as boot files system we can drop fat fs related packages. Also move packages which are added repeatedly across subtargets to their default packages, with droping the ones that are enabled in target kernel configugation. Signed-off-by: Tomasz Maciej Nowak --- .../mvebu/base-files/lib/preinit/79_move_config | 14 ++++++++++---- target/linux/mvebu/cortexa53/target.mk | 1 + target/linux/mvebu/cortexa72/target.mk | 1 + target/linux/mvebu/image/cortex-a53.mk | 2 -- target/linux/mvebu/image/cortex-a72.mk | 4 +--- target/linux/mvebu/image/cortex-a9.mk | 4 ++-- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/target/linux/mvebu/base-files/lib/preinit/79_move_config b/target/linux/mvebu/base-files/lib/preinit/79_move_config index 1735ad8849..73ddf09155 100644 --- a/target/linux/mvebu/base-files/lib/preinit/79_move_config +++ b/target/linux/mvebu/base-files/lib/preinit/79_move_config @@ -3,12 +3,18 @@ BOOTPART=/dev/mmcblk0p1 +. /lib/functions.sh + move_config() { if [ -b $BOOTPART ]; then - insmod nls_cp437 - insmod nls_iso8859-1 - insmod fat - insmod vfat + case $(board_name) in + turris-omnia) + insmod nls_cp437 + insmod nls_iso8859-1 + insmod fat + insmod vfat + ;; + esac mkdir -p /boot mount -o rw,noatime $BOOTPART /boot [ -f /boot/sysupgrade.tgz ] && mv -f /boot/sysupgrade.tgz / diff --git a/target/linux/mvebu/cortexa53/target.mk b/target/linux/mvebu/cortexa53/target.mk index acc18d3454..d420fd9f59 100644 --- a/target/linux/mvebu/cortexa53/target.mk +++ b/target/linux/mvebu/cortexa53/target.mk @@ -11,5 +11,6 @@ ARCH:=aarch64 BOARDNAME:=Marvell Armada 3700LP (ARM64) CPU_TYPE:=cortex-a53 FEATURES+=ext4 +DEFAULT_PACKAGES+=e2fsprogs ethtool mkf2fs KERNELNAME:=Image dtbs diff --git a/target/linux/mvebu/cortexa72/target.mk b/target/linux/mvebu/cortexa72/target.mk index 670c402a56..a9384f3fa6 100644 --- a/target/linux/mvebu/cortexa72/target.mk +++ b/target/linux/mvebu/cortexa72/target.mk @@ -11,5 +11,6 @@ ARCH:=aarch64 BOARDNAME:=Marvell Armada 7k/8k (ARM64) CPU_TYPE:=cortex-a72 FEATURES+=ext4 +DEFAULT_PACKAGES+=e2fsprogs ethtool mkf2fs KERNELNAME:=Image dtbs diff --git a/target/linux/mvebu/image/cortex-a53.mk b/target/linux/mvebu/image/cortex-a53.mk index 89c3363448..dd6176100b 100644 --- a/target/linux/mvebu/image/cortex-a53.mk +++ b/target/linux/mvebu/image/cortex-a53.mk @@ -4,7 +4,6 @@ define Device/globalscale-espressobin KERNEL_NAME := Image KERNEL := kernel-bin DEVICE_TITLE := ESPRESSObin (Marvell Armada 3700 Community Board) - DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-usb2 kmod-usb3 kmod-usb-storage IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata DEVICE_DTS := armada-3720-espressobin @@ -17,7 +16,6 @@ define Device/armada-3720-db KERNEL_NAME := Image KERNEL := kernel-bin DEVICE_TITLE := Marvell Armada 3720 Development Board DB-88F3720-DDR3 - DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-usb2 kmod-usb3 kmod-usb-storage IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata DEVICE_DTS := armada-3720-db diff --git a/target/linux/mvebu/image/cortex-a72.mk b/target/linux/mvebu/image/cortex-a72.mk index df0ace120d..25bcf534bc 100644 --- a/target/linux/mvebu/image/cortex-a72.mk +++ b/target/linux/mvebu/image/cortex-a72.mk @@ -4,7 +4,7 @@ define Device/armada-macchiatobin KERNEL_NAME := Image KERNEL := kernel-bin DEVICE_TITLE := MACCHIATObin (SolidRun Armada 8040 Community Board) - DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc kmod-i2c-core kmod-i2c-mux kmod-i2c-mux-pca954x + DEVICE_PACKAGES += kmod-i2c-core kmod-i2c-mux kmod-i2c-mux-pca954x IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata DEVICE_DTS := armada-8040-mcbin @@ -17,7 +17,6 @@ define Device/armada-8040-db KERNEL_NAME := Image KERNEL := kernel-bin DEVICE_TITLE := Marvell Armada 8040 DB board - DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata DEVICE_DTS := armada-8040-db @@ -30,7 +29,6 @@ define Device/armada-7040-db KERNEL_NAME := Image KERNEL := kernel-bin DEVICE_TITLE := Marvell Armada 7040 DB board - DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata DEVICE_DTS := armada-7040-db diff --git a/target/linux/mvebu/image/cortex-a9.mk b/target/linux/mvebu/image/cortex-a9.mk index 610ce36cd7..9d84283525 100644 --- a/target/linux/mvebu/image/cortex-a9.mk +++ b/target/linux/mvebu/image/cortex-a9.mk @@ -126,7 +126,7 @@ define Device/armada-388-clearfog-pro KERNEL_INSTALL := 1 KERNEL := kernel-bin DEVICE_TITLE := SolidRun ClearFog Pro - DEVICE_PACKAGES := mkf2fs e2fsprogs swconfig kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 + DEVICE_PACKAGES := mkf2fs e2fsprogs swconfig IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base @@ -139,7 +139,7 @@ define Device/armada-388-clearfog-base KERNEL_INSTALL := 1 KERNEL := kernel-bin DEVICE_TITLE := SolidRun ClearFog Base - DEVICE_PACKAGES := mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 + DEVICE_PACKAGES := mkf2fs e2fsprogs IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base From patchwork Thu Mar 28 17:07:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1068473 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=o2.pl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SJuGw9Sx"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.b="RkrQbpFV"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44VWVQ4b27z9sNq for ; Fri, 29 Mar 2019 04:06:22 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=5T2DrDV16pVtKrQ3/x58P6bMTq7F5qpeP9vH0rMkJiQ=; b=SJuGw9Sx/P0g38jq1TlfIH8ng9 GJH1S2e2RxJszNzve7aGFnXYcHpYjfw/SvKPmmL6CyOoIvHMwPkFtDKSeDtIqcoV7ky9eD89hmJkE XkuCBJfg5vPH82CeLsoeECgeYwVuBQP/ufzqu1ypU5LZZaN9AY4mhalU94lA8UvSiueg/tS9D8HbF tyMN5cf3z06PzyR90QhuKbyvNrVyNVVCIRKk8sKX1SVNuXro/Jr36Jy4YwNSAznCDHnuseIZ24OXX 8FBz9BZEHa6p0PcA9wCUSwpEtrNmPLpExgOBJAKNRNFAIHXD2nkLCfBAE70rL3ZirH7nJLxplAx32 p3qPev7A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YTk-0001dK-T8; Thu, 28 Mar 2019 17:06:12 +0000 Received: from mx-out.tlen.pl ([193.222.135.158]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YT7-0000gU-8j for openwrt-devel@lists.openwrt.org; Thu, 28 Mar 2019 17:05:37 +0000 Received: (wp-smtpd smtp.tlen.pl 26562 invoked from network); 28 Mar 2019 18:05:30 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1553792730; bh=rdazD3wnDK1k+zq7aoj6OAcav4DcPpGErHTufx0j7m0=; h=From:To:Subject; b=RkrQbpFVQtipWg5vVcjnlCwJ6gpMzAZUDD4GC01ccFP/f6jjh0sVSiF5fXCp1S/Iv drkwhHFHkq1jBu9YlzXCAafKEhD45poJ4JXTFBxeiwOLCwzvMBDHGa+ME4k9l0CRI+ AyuPBDITCizmwDYHY/AHTN9gdyqtrLCInd+mKkHA= Received: from 131.ip-164-132-48.eu (HELO localhost.localdomain) (tomek_n@o2.pl@[164.132.48.131]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 28 Mar 2019 18:05:30 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Thu, 28 Mar 2019 18:07:08 +0100 Message-Id: <20190328170711.3564-5-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190328170711.3564-1-tomek_n@o2.pl> References: <20190321185727.3239-1-tomek_n@o2.pl> <20190328170711.3564-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: de34d0efa4e2487f03cc3691cc1ea8ff X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [AbPk] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190328_100533_465219_00279D1E X-CRM114-Status: UNSURE ( 7.86 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tomek_n[at]o2.pl) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 Subject: [OpenWrt-Devel] [PATCH v2 4/7] mvebu: base-files: autodetect upgrade device X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: 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 Since some boards could be also booted from other mediums than SD card, lets make the upgrade block device autodetected. Signed-off-by: Tomasz Maciej Nowak --- .../base-files/lib/preinit/79_move_config | 9 +++++---- .../mvebu/base-files/lib/upgrade/sdcard.sh | 19 +++++++++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/target/linux/mvebu/base-files/lib/preinit/79_move_config b/target/linux/mvebu/base-files/lib/preinit/79_move_config index 73ddf09155..64c0cc0eea 100644 --- a/target/linux/mvebu/base-files/lib/preinit/79_move_config +++ b/target/linux/mvebu/base-files/lib/preinit/79_move_config @@ -1,12 +1,13 @@ #!/bin/sh # Copyright (C) 2015 OpenWrt.org -BOOTPART=/dev/mmcblk0p1 - . /lib/functions.sh +. /lib/upgrade/common.sh move_config() { - if [ -b $BOOTPART ]; then + local partdev + + if export_bootdevice && export_partdevice partdev 1; then case $(board_name) in turris-omnia) insmod nls_cp437 @@ -16,7 +17,7 @@ move_config() { ;; esac mkdir -p /boot - mount -o rw,noatime $BOOTPART /boot + mount -o rw,noatime "/dev/$partdev" /boot [ -f /boot/sysupgrade.tgz ] && mv -f /boot/sysupgrade.tgz / umount /boot fi diff --git a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh index a05df834ba..7aa91f463c 100644 --- a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh +++ b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh @@ -19,9 +19,12 @@ platform_check_image_sdcard() { platform_do_upgrade_sdcard() { local board=$(board_name) + local diskdev sync - get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync + if export_bootdevice && export_partdevice diskdev 0; then + get_image "$1" | dd of=/dev/$diskdev bs=2M conv=fsync + fi case "$board" in armada-385-turris-omnia) @@ -36,9 +39,13 @@ platform_do_upgrade_sdcard() { } platform_copy_config_sdcard() { - mkdir -p /boot - [ -f /boot/kernel.img ] || mount -o rw,noatime /dev/mmcblk0p1 /boot - cp -af "$CONF_TAR" /boot/ - sync - umount /boot + local partdev + + if export_partdevice partdev 1; then + mkdir -p /boot + [ -f /boot/kernel.img ] || mount -o rw,noatime /dev/$partdev /boot + cp -af "$CONF_TAR" /boot/ + sync + umount /boot + fi } From patchwork Thu Mar 28 17:07:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1068474 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=o2.pl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WLMglZq1"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.b="i5d3fU3e"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44VWVn2B6Qz9sSp for ; Fri, 29 Mar 2019 04:06:41 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=YD2CP8jitBazKn1JglsQJtEcm30S/kvf0czvZaeKgCs=; b=WLMglZq15XKPsJ5GE2CK5mfYHg CDi3zni7jFCUe74/iscuOnXe5nvzf6oa3V4/E/hOf+N68qVRjCUyDLMb0wNXIZRE0GFHR6CwpbTud fNksPSSZhzJNvrSmvVn+lcMLgDYaqz+9EttJ6q3xyJSTGkPi5OR4vcPcYM96fZ8QU04e1fShiuqcD R2YnN9rAzBGobbDZMSkDf5DMniF+ZlBuUVue8UFeUowQzshIsAHQl2rTB9H9A/ux+DexhOIhrc4CP tkGMQW7McvMwoVqXrd2O51TZ7XVKXBn+KEO0gB5dXplZz/Kw41qNv48kX3PCCF+qPuW6N9mSRtn7R 2MHfkPyw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YTt-0001pq-VG; Thu, 28 Mar 2019 17:06:22 +0000 Received: from mx-out.tlen.pl ([193.222.135.158]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YT8-0000gf-4Y for openwrt-devel@lists.openwrt.org; Thu, 28 Mar 2019 17:05:38 +0000 Received: (wp-smtpd smtp.tlen.pl 30361 invoked from network); 28 Mar 2019 18:05:31 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1553792732; bh=lkl16udCEZ4iqlYk1k4/Af4UpecTuC32B74WLP95bZ4=; h=From:To:Subject; b=i5d3fU3eaHTljBj6hO3rAzKHcK5XVq72VR5or0GWZNqs8Tlx+xqygTz/FtgiqvUze zQP2bk2baRrp238SuDEibiftL1Q0qrl5JpE2oKBpdSzNm+Bqpf8zO7egbdz6HXSYVQ G8zwKOfhP/ZvrS6prWEp7E79nPQk3Ct9edStudzk= Received: from 131.ip-164-132-48.eu (HELO localhost.localdomain) (tomek_n@o2.pl@[164.132.48.131]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 28 Mar 2019 18:05:31 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Thu, 28 Mar 2019 18:07:09 +0100 Message-Id: <20190328170711.3564-6-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190328170711.3564-1-tomek_n@o2.pl> References: <20190321185727.3239-1-tomek_n@o2.pl> <20190328170711.3564-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: a104237c8e933ef8b762962dfbdb8ef2 X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [YRME] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190328_100534_524277_C21B7C4C X-CRM114-Status: GOOD ( 10.64 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tomek_n[at]o2.pl) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 Subject: [OpenWrt-Devel] [PATCH v2 5/7] mvebu: sysupgrade: sdcard: keep user added partitons X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: 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 Currently sysupgrade overwrites whole disk and destroys partitions added by user. Sync the sysupgrade code with the one present in x86 target to remedy this behaviour. Signed-off-by: Tomasz Maciej Nowak --- .../mvebu/base-files/lib/upgrade/platform.sh | 9 ++- .../mvebu/base-files/lib/upgrade/sdcard.sh | 74 +++++++++++++++++-- target/linux/mvebu/cortexa53/target.mk | 2 +- target/linux/mvebu/cortexa72/target.mk | 2 +- target/linux/mvebu/image/cortex-a9.mk | 7 +- 5 files changed, 83 insertions(+), 11 deletions(-) diff --git a/target/linux/mvebu/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/base-files/lib/upgrade/platform.sh index e4ccf9d7f2..57b2f00a4c 100755 --- a/target/linux/mvebu/base-files/lib/upgrade/platform.sh +++ b/target/linux/mvebu/base-files/lib/upgrade/platform.sh @@ -8,7 +8,14 @@ RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' REQUIRE_IMAGE_METADATA=1 platform_check_image() { - return 0 + case "$(board_name)" in + armada-385-turris-omnia|armada-388-clearfog-base|armada-388-clearfog-pro|globalscale,espressobin|marvell,armada8040-mcbin) + platform_check_image_sdcard "$ARGV" + ;; + *) + return 0 + ;; + esac } platform_do_upgrade() { diff --git a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh index 7aa91f463c..28fad31757 100644 --- a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh +++ b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh @@ -6,7 +6,7 @@ get_magic_at() { platform_check_image_sdcard() { local file="$1" - local magic + local magic diskdev partdev diff magic=$(get_magic_at "$file" 510) [ "$magic" != "55aa" ] && { @@ -14,18 +14,82 @@ platform_check_image_sdcard() { return 1 } - return 0; + export_bootdevice && export_partdevice diskdev 0 || { + echo "Unable to determine upgrade device" + return 1 + } + + get_partitions "/dev/$diskdev" bootdisk + + #extract the boot sector from the image + get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b 2>/dev/null + + get_partitions /tmp/image.bs image + + #compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + + rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image + + if [ -n "$diff" ]; then + echo "Partition layout has changed. Full image will be written." + ask_bool 0 "Abort" && exit 1 + return 0 + fi } platform_do_upgrade_sdcard() { local board=$(board_name) - local diskdev + local diskdev partdev diff + + export_bootdevice && export_partdevice diskdev 0 || { + echo "Unable to determine upgrade device" + return 1 + } sync - if export_bootdevice && export_partdevice diskdev 0; then - get_image "$1" | dd of=/dev/$diskdev bs=2M conv=fsync + + if [ "$SAVE_PARTITIONS" = "1" ]; then + get_partitions "/dev/$diskdev" bootdisk + + #extract the boot sector from the image + get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b + + get_partitions /tmp/image.bs image + + #compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + else + diff=1 + fi + + if [ -n "$diff" ]; then + get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync + + # Separate removal and addtion is necessary; otherwise, partition 1 + # will be missing if it overlaps with the old partition 2 + partx -d - "/dev/$diskdev" + partx -a - "/dev/$diskdev" + + return 0 fi + #write uboot image + get_image "$@" | dd of="$diskdev" bs=512 skip=1 seek=1 count=2048 conv=fsync + #iterate over each partition from the image and write it to the boot disk + while read part start size; do + if export_partdevice partdev $part; then + echo "Writing image to /dev/$partdev..." + get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync + else + echo "Unable to find partition $part device, skipped." + fi + done < /tmp/partmap.image + + #copy partition uuid + echo "Writing new UUID to /dev/$diskdev..." + get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync + case "$board" in armada-385-turris-omnia) fw_setenv openwrt_bootargs 'earlyprintk console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=auto rootwait' diff --git a/target/linux/mvebu/cortexa53/target.mk b/target/linux/mvebu/cortexa53/target.mk index d420fd9f59..fe89d08ffa 100644 --- a/target/linux/mvebu/cortexa53/target.mk +++ b/target/linux/mvebu/cortexa53/target.mk @@ -11,6 +11,6 @@ ARCH:=aarch64 BOARDNAME:=Marvell Armada 3700LP (ARM64) CPU_TYPE:=cortex-a53 FEATURES+=ext4 -DEFAULT_PACKAGES+=e2fsprogs ethtool mkf2fs +DEFAULT_PACKAGES+=e2fsprogs ethtool mkf2fs partx-utils KERNELNAME:=Image dtbs diff --git a/target/linux/mvebu/cortexa72/target.mk b/target/linux/mvebu/cortexa72/target.mk index a9384f3fa6..540ef1104f 100644 --- a/target/linux/mvebu/cortexa72/target.mk +++ b/target/linux/mvebu/cortexa72/target.mk @@ -11,6 +11,6 @@ ARCH:=aarch64 BOARDNAME:=Marvell Armada 7k/8k (ARM64) CPU_TYPE:=cortex-a72 FEATURES+=ext4 -DEFAULT_PACKAGES+=e2fsprogs ethtool mkf2fs +DEFAULT_PACKAGES+=e2fsprogs ethtool mkf2fs partx-utils KERNELNAME:=Image dtbs diff --git a/target/linux/mvebu/image/cortex-a9.mk b/target/linux/mvebu/image/cortex-a9.mk index 9d84283525..66cf54f9c5 100644 --- a/target/linux/mvebu/image/cortex-a9.mk +++ b/target/linux/mvebu/image/cortex-a9.mk @@ -126,7 +126,7 @@ define Device/armada-388-clearfog-pro KERNEL_INSTALL := 1 KERNEL := kernel-bin DEVICE_TITLE := SolidRun ClearFog Pro - DEVICE_PACKAGES := mkf2fs e2fsprogs swconfig + DEVICE_PACKAGES := mkf2fs e2fsprogs partx-utils swconfig IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base @@ -139,7 +139,7 @@ define Device/armada-388-clearfog-base KERNEL_INSTALL := 1 KERNEL := kernel-bin DEVICE_TITLE := SolidRun ClearFog Base - DEVICE_PACKAGES := mkf2fs e2fsprogs + DEVICE_PACKAGES := mkf2fs e2fsprogs partx-utils IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base @@ -162,7 +162,8 @@ define Device/turris-omnia DEVICE_TITLE := Turris Omnia DEVICE_PACKAGES := \ mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \ - wpad-basic kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct + wpad-basic kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \ + partx-utils IMAGES := $$(IMAGE_PREFIX)-sysupgrade.img.gz omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz IMAGE/$$(IMAGE_PREFIX)-sysupgrade.img.gz := boot-img | sdcard-img | gzip | append-metadata IMAGE/omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz := omnia-medkit-initramfs | gzip From patchwork Thu Mar 28 17:07:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1068483 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=o2.pl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="X48HjU7Z"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="QQ6AB7CJ"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.b="fVAde+9A"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44VWWB33dZz9sP6 for ; Fri, 29 Mar 2019 04:07:02 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=v508WD0pSq1IAoWlC37jIqoHzWRQVwMjjIVXdpMzmTQ=; b=X48HjU7ZKgJ3Bd5OJlCLP4PO/N 254QkuEJs8NLonDCWt1elkAWYUGRQtzLD71bg0X6qkrms6xcz4RZbSD/rH2svxVukIyNA8LUjD91t 5kWzR8CYDGHnIbQsmjdlrXLHbraZb+uNzVr6/GciJcTtvQKXXtrW6ky9qv5yCM7bC4oiwQd2GFDfo 67beb8lyGQTuvs7Ib5y6Zlu6heO/jlllW74dsYtOKFU0d9mmeelkhUyugtWq9dTFvx9JpGEQm50Q6 YlPPJwbQ2EChN9I/xbXfFIMm2KWV1jsqzrPK+P7HAHbPVp4AWNfDYLoFcJNdn2tnOrfLF3ptKXjR5 m9p+bcMA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YUG-0002QI-9E; Thu, 28 Mar 2019 17:06:44 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YTj-0001av-Pu for openwrt-devel@bombadil.infradead.org; Thu, 28 Mar 2019 17:06:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VifoH4ee2nisXbXoooqvW9OrapTGjxjxaR5GWxeb6b0=; b=QQ6AB7CJ0+pBpRxuN9yzHMIhl/ 2GpH4kxcYmncFg/hfLpCsKRv/21//3avUhDB+KrL4ePg3Nm9ydEi1L4a/YbaWEOquFobJha0o/KnI c1KTFWJslgjR+HFiePQOL8N3dkbg9SOT+QplyICkkFltx30RGG1JP4asCpGzC95OtLYQ5tMT26yUK FMQslFMVFtfZ6Bpx5SJWGO3WvF4pOQuOc/yXjNcu/+E7xuVftuRvFLT2/Bgp0qV4jxuWSwAWdA1Mw udW8vjOrgD8oN2zrq41TLn5k2y/l3w0xFiF0KI1b5gBHv4XlvbWdPOrAr2cilDYRgxbEkuFG+XCx3 cDqUOrbQ==; Received: from mx-out.tlen.pl ([193.222.135.158]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YTe-0006p0-2s for openwrt-devel@lists.openwrt.org; Thu, 28 Mar 2019 17:06:10 +0000 Received: (wp-smtpd smtp.tlen.pl 32297 invoked from network); 28 Mar 2019 18:05:32 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1553792732; bh=VifoH4ee2nisXbXoooqvW9OrapTGjxjxaR5GWxeb6b0=; h=From:To:Subject; b=fVAde+9AH9cpkHVpLKUGnZDELs7vfJm0aFIhV0lGAJBMP7efZRpfs4PDdzse5gcUg OSF3neTu3aiCZiKIiSeumNPoHQrmJ3wYA12EC2VAFlE61qqBg9oWZhswcCjQnSoHLF NAJubpOwGqYTPy1U+bAdsy/AYnzdBN6b3m1pix+I= Received: from 131.ip-164-132-48.eu (HELO localhost.localdomain) (tomek_n@o2.pl@[164.132.48.131]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 28 Mar 2019 18:05:32 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Thu, 28 Mar 2019 18:07:10 +0100 Message-Id: <20190328170711.3564-7-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190328170711.3564-1-tomek_n@o2.pl> References: <20190321185727.3239-1-tomek_n@o2.pl> <20190328170711.3564-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: f8fac4b00ccc126555ba5304daca11d2 X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [oWPU] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190328_170606_270921_8191B6D2 X-CRM114-Status: GOOD ( 18.80 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on casper.infradead.org summary: Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tomek_n[at]o2.pl) 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 -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 Subject: [OpenWrt-Devel] [PATCH v2 6/7] mvebu: espressobin: add node for eMMC in dts X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: 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 Some ESPRESSObin boards come with soldered eMMC flash, backport upstream patches adding this device and add patch to sync sdhci nodes order with U-Boot. Signed-off-by: Tomasz Maciej Nowak --- ...l-armada37xx-Add-emmc-sdio-pinctrl-d.patch | 40 +++++++ ...l-armada-37xx-Enable-emmc-on-espress.patch | 49 ++++++++ ...da-3720-espressobin-correct-spi-node.patch | 2 +- ...x-re-arrange-SDHCI-controllers-order.patch | 105 ++++++++++++++++++ 4 files changed, 195 insertions(+), 1 deletion(-) create mode 100644 target/linux/mvebu/patches-4.14/513-arm64-dts-marvell-armada37xx-Add-emmc-sdio-pinctrl-d.patch create mode 100644 target/linux/mvebu/patches-4.14/514-arm64-dts-marvell-armada-37xx-Enable-emmc-on-espress.patch create mode 100644 target/linux/mvebu/patches-4.14/522-arm64-dts-a37xx-re-arrange-SDHCI-controllers-order.patch diff --git a/target/linux/mvebu/patches-4.14/513-arm64-dts-marvell-armada37xx-Add-emmc-sdio-pinctrl-d.patch b/target/linux/mvebu/patches-4.14/513-arm64-dts-marvell-armada37xx-Add-emmc-sdio-pinctrl-d.patch new file mode 100644 index 0000000000..19702a61ed --- /dev/null +++ b/target/linux/mvebu/patches-4.14/513-arm64-dts-marvell-armada37xx-Add-emmc-sdio-pinctrl-d.patch @@ -0,0 +1,40 @@ +From eefe328439642101774f0f5c4ea0dc6ba1cfb687 Mon Sep 17 00:00:00 2001 +From: Ding Tao +Date: Fri, 26 Oct 2018 11:50:27 +0000 +Subject: [PATCH] arm64: dts: marvell: armada37xx: Add emmc/sdio pinctrl + definition + +Add emmc/sdio pinctrl definition for marvell armada37xx SoCs. + +Signed-off-by: Ding Tao +Signed-off-by: Gregory CLEMENT +--- + arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi ++++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi +@@ -218,6 +218,11 @@ + groups = "uart2"; + function = "uart"; + }; ++ ++ mmc_pins: mmc-pins { ++ groups = "emmc_nb"; ++ function = "emmc"; ++ }; + }; + + nb_pm: syscon@14000 { +@@ -247,6 +252,11 @@ + function = "mii"; + }; + ++ sdio_pins: sdio-pins { ++ groups = "sdio_sb"; ++ function = "sdio"; ++ }; ++ + }; + + eth0: ethernet@30000 { diff --git a/target/linux/mvebu/patches-4.14/514-arm64-dts-marvell-armada-37xx-Enable-emmc-on-espress.patch b/target/linux/mvebu/patches-4.14/514-arm64-dts-marvell-armada-37xx-Enable-emmc-on-espress.patch new file mode 100644 index 0000000000..26d090f050 --- /dev/null +++ b/target/linux/mvebu/patches-4.14/514-arm64-dts-marvell-armada-37xx-Enable-emmc-on-espress.patch @@ -0,0 +1,49 @@ +From 43ebc7c1b3ed8198b9acf3019eca16e722f7331c Mon Sep 17 00:00:00 2001 +From: Ding Tao +Date: Fri, 26 Oct 2018 11:50:28 +0000 +Subject: [PATCH] arm64: dts: marvell: armada-37xx: Enable emmc on espressobin + +The ESPRESSObin board has a emmc interface available on U11: declare it +and let the bootloader enable it if the emmc is present. + +[gregory.clement@bootlin.com: disable the emmc by default] +Signed-off-by: Ding Tao +Signed-off-by: Gregory CLEMENT +--- + .../dts/marvell/armada-3720-espressobin.dts | 22 +++++++++++++++++++ + 1 file changed, 22 insertions(+) + +--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts +@@ -93,9 +93,31 @@ + cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>; + marvell,pad-type = "sd"; + vqmmc-supply = <&vcc_sd_reg1>; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdio_pins>; + status = "okay"; + }; + ++/* U11 */ ++&sdhci0 { ++ non-removable; ++ bus-width = <8>; ++ mmc-ddr-1_8v; ++ mmc-hs400-1_8v; ++ marvell,xenon-emmc; ++ marvell,xenon-tun-count = <9>; ++ marvell,pad-type = "fixed-1-8v"; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc_pins>; ++/* ++ * This eMMC is not populated on all boards, so disable it by ++ * default and let the bootloader enable it, if it is present ++ */ ++ status = "disabled"; ++}; ++ + &spi0 { + status = "okay"; + diff --git a/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch b/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch index 1d2bdfca75..fc7cb2af1e 100644 --- a/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch +++ b/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch @@ -29,7 +29,7 @@ Signed-off-by: Tomasz Maciej Nowak --- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts +++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts -@@ -101,25 +101,9 @@ +@@ -123,25 +123,9 @@ flash@0 { reg = <0>; diff --git a/target/linux/mvebu/patches-4.14/522-arm64-dts-a37xx-re-arrange-SDHCI-controllers-order.patch b/target/linux/mvebu/patches-4.14/522-arm64-dts-a37xx-re-arrange-SDHCI-controllers-order.patch new file mode 100644 index 0000000000..58962baeb7 --- /dev/null +++ b/target/linux/mvebu/patches-4.14/522-arm64-dts-a37xx-re-arrange-SDHCI-controllers-order.patch @@ -0,0 +1,105 @@ +From 9e34242f8817294ec1c2bef7f0c513417cac965e Mon Sep 17 00:00:00 2001 +From: Konstantin Porotchkin +Date: Sun, 25 Nov 2018 18:38:26 +0200 +Subject: [PATCH] arm64: dts: a37xx: re-arrange SDHCI controllers order + +Sync the controllers order with uboot settings: +sdhci-0 is @ 0xd000, sdhci-1 is @ 0xd800. + +Signed-off-by: Konstantin Porotchkin +Reviewed-by: Stefan Chulski +[adapt patch to mainline state] +Signed-off-by: Tomasz Maciej Nowak +--- + arch/arm64/boot/dts/marvell/armada-3720-db.dts | 10 +++++----- + .../boot/dts/marvell/armada-3720-espressobin.dts | 8 ++++---- + arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 4 ++-- + 3 files changed, 11 insertions(+), 11 deletions(-) + +--- a/arch/arm64/boot/dts/marvell/armada-3720-db.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-db.dts +@@ -81,9 +81,9 @@ + vcc-supply = <&exp_usb3_vbus>; + }; + +- vcc_sd_reg1: regulator { ++ vcc_sd_reg0: regulator { + compatible = "regulator-gpio"; +- regulator-name = "vcc_sd1"; ++ regulator-name = "vcc_sd0"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; +@@ -163,7 +163,7 @@ + status = "okay"; + }; + +-&sdhci0 { ++&sdhci1 { + non-removable; + bus-width = <8>; + mmc-ddr-1_8v; +@@ -173,12 +173,12 @@ + }; + + /* SD slot module on CON14(V2.0)/CON15(V1.4) */ +-&sdhci1 { ++&sdhci0 { + wp-inverted; + cd-gpios = <&gpiosb 2 GPIO_ACTIVE_LOW>; + bus-width = <4>; + marvell,pad-type = "sd"; +- vqmmc-supply = <&vcc_sd_reg1>; ++ vqmmc-supply = <&vcc_sd_reg0>; + status = "okay"; + }; + +--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts +@@ -61,9 +61,9 @@ + reg = <0x00000000 0x00000000 0x00000000 0x20000000>; + }; + +- vcc_sd_reg1: regulator { ++ vcc_sd_reg0: regulator { + compatible = "regulator-gpio"; +- regulator-name = "vcc_sd1"; ++ regulator-name = "vcc_sd0"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; +@@ -87,12 +87,12 @@ + }; + + /* J1 */ +-&sdhci1 { ++&sdhci0 { + wp-inverted; + bus-width = <4>; + cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>; + marvell,pad-type = "sd"; +- vqmmc-supply = <&vcc_sd_reg1>; ++ vqmmc-supply = <&vcc_sd_reg0>; + + pinctrl-names = "default"; + pinctrl-0 = <&sdio_pins>; +--- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi ++++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi +@@ -312,7 +312,7 @@ + }; + }; + +- sdhci1: sdhci@d0000 { ++ sdhci0: sdhci@d0000 { + compatible = "marvell,armada-3700-sdhci", + "marvell,sdhci-xenon"; + reg = <0xd0000 0x300>, +@@ -323,7 +323,7 @@ + status = "disabled"; + }; + +- sdhci0: sdhci@d8000 { ++ sdhci1: sdhci@d8000 { + compatible = "marvell,armada-3700-sdhci", + "marvell,sdhci-xenon"; + reg = <0xd8000 0x300>, From patchwork Thu Mar 28 17:07:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1068475 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=o2.pl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="h8Eg8ADN"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.b="pPD8uvia"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44VWVv1Wkjz9sNq for ; Fri, 29 Mar 2019 04:06:47 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=YLs9zODJo3u66ju/MNa+x9IAsznrnUQEK7SFC4qZ1sc=; b=h8Eg8ADNEh/XV93RRcgQvrR/Zp LltfjBPcqTR2I03IBypFhaE5r3efC4IC2Sr3ghgHLeo1jK8Y/kyqm1QmWGwpfN23MrJDZBOa56Njh /uQXCAvmZwwOGOKseAqnZZxXPBgWLoKpbv/ggq7zlkbIgtgVMJohtcOtyn6tGlDW/t19YHi2WalLL vjVC/dsvu5HhEl2kq90D5MP+baNkwg5K33D11t7WJTmu/D0oGzAReY2Vu/oXGV1CbMCRax9XwPgIE tThnNTJTiFjt3W+/xq9LKXjtdNmfImXwiMHREEu9lZDUcz1ufqnqhSOlahdaxogjLe4rH6vpk7PcR W4ge1HYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YU4-000274-3A; Thu, 28 Mar 2019 17:06:32 +0000 Received: from mx-out.tlen.pl ([193.222.135.158]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YTA-0000ir-RY for openwrt-devel@lists.openwrt.org; Thu, 28 Mar 2019 17:05:43 +0000 Received: (wp-smtpd smtp.tlen.pl 34741 invoked from network); 28 Mar 2019 18:05:33 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1553792734; bh=X5v0c8ABbmDGh6JS/z3IkNkjHrAmuBqR8/DjFvq5hw0=; h=From:To:Subject; b=pPD8uviacFkrhWpWuHbYjxYi/hoCM7dvOp72uHzVk7Lg/ine45086cjt7gsi98Uhc aMSN0sUejI5XQJeCnkzpuMjH+ZUGVkXuIdaBeD9bje1j0ZAmBRVivTKsHu16TzJjuu zFU1WWtDUVBdponK5M6onQ0d3IKNshWXn0cTEXJA= Received: from 131.ip-164-132-48.eu (HELO localhost.localdomain) (tomek_n@o2.pl@[164.132.48.131]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 28 Mar 2019 18:05:33 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Thu, 28 Mar 2019 18:07:11 +0100 Message-Id: <20190328170711.3564-8-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190328170711.3564-1-tomek_n@o2.pl> References: <20190321185727.3239-1-tomek_n@o2.pl> <20190328170711.3564-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: 7448c6453a1d08351274317050d645cb X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [8RO0] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190328_100537_634522_6DB8C752 X-CRM114-Status: GOOD ( 10.33 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tomek_n[at]o2.pl) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 Subject: [OpenWrt-Devel] [PATCH v2 7/7] mvebu: espressobin: add u-boot environment X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: 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 commit adds U-Boot environment defaults which extend the bootloader to automatically boot the ESPRESSObin board from other connected mediums i.e. SATA disk or USB disk. The assigned boot probe order is as follows: 1. USB (usb0), 2. SATA (scsi0), 3. µSD (mmc0), 4. eMMC (mmc1). U-Boot will iterate through them utill it'll find on one of devices the uEnv.txt file. If not found, it'll fall back to loading using boot.scr (loading from boot.scr is compatible only with U-Boot version 2017.03 or later). There is also self update mechanism implemented which will trigger if the variable 'owrt_uenv_ver' is changed. This commit also adds compatibility with newer U-Boot versions in which kernel_addr and fdt_addr environment variables changed names to kernel_addr_r and fdt_addr_r. The bootloader environment preparation needs to be done for every new deployment and for every board with U-Boot 2015.01 version. 1. Connect/insert boot device with OpenWrt, 2. Power on the board and enter U-Boot command line, 3. Execute following commands: usb start scsi scan ext4load mmc 0:1 $loadaddr uEnv.txt || ext4load scsi 0:1 $loadaddr uEnv.txt || ext4load usb 0:1 $loadaddr uEnv.txt env import -t $loadaddr env delete $old_or_temp_vars saveenv reset 4. Now board should automatically find boot medium with OpenWrt installation and boot it. Signed-off-by: Tomasz Maciej Nowak --- target/linux/mvebu/image/Makefile | 10 ++++++++ target/linux/mvebu/image/cortex-a53.mk | 2 +- .../image/globalscale-espressobin.bootscript | 14 ++++++++--- .../mvebu/image/globalscale-espressobin.uenv | 25 +++++++++++++++++++ 4 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 target/linux/mvebu/image/globalscale-espressobin.uenv diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile index 88790777d9..126136dc6a 100644 --- a/target/linux/mvebu/image/Makefile +++ b/target/linux/mvebu/image/Makefile @@ -26,6 +26,15 @@ define Build/boot-scr mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d $@-new.bootscript $@-boot.scr endef +define Build/uenv-txt + rm -f $@-uEnv.txt + sed \ + -e 's#@ROOT@#$(SIGNATURE)#g' \ + -e 's#@DTB@#$(DEVICE_DTS)#g' \ + -e 's#@KERNEL@#$(KERNEL_NAME)#g' \ + $(DEVICE_NAME).uenv > $@-uEnv.txt +endef + define Build/boot-img rm -f $@.boot mkfs.fat -C $@.boot $$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 )) @@ -40,6 +49,7 @@ define Build/boot-img-ext4 $(foreach dts,$(DEVICE_DTS), $(CP) $(DTS_DIR)/$(dts).dtb $@.boot;) $(CP) $(IMAGE_KERNEL) $@.boot/$(KERNEL_NAME) -$(CP) $@-boot.scr $@.boot/boot.scr + -$(CP) $@-uEnv.txt $@.boot/uEnv.txt make_ext4fs -J -l $(CONFIG_TARGET_KERNEL_PARTSIZE)M $@.bootimg $@.boot endef diff --git a/target/linux/mvebu/image/cortex-a53.mk b/target/linux/mvebu/image/cortex-a53.mk index dd6176100b..338c29c7f9 100644 --- a/target/linux/mvebu/image/cortex-a53.mk +++ b/target/linux/mvebu/image/cortex-a53.mk @@ -5,7 +5,7 @@ define Device/globalscale-espressobin KERNEL := kernel-bin DEVICE_TITLE := ESPRESSObin (Marvell Armada 3700 Community Board) IMAGES := sdcard.img.gz - IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata + IMAGE/sdcard.img.gz := uenv-txt | boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata DEVICE_DTS := armada-3720-espressobin DTS_DIR := $(DTS_DIR)/marvell SUPPORTED_DEVICES := globalscale,espressobin diff --git a/target/linux/mvebu/image/globalscale-espressobin.bootscript b/target/linux/mvebu/image/globalscale-espressobin.bootscript index 0d03ac8513..d2a9653613 100644 --- a/target/linux/mvebu/image/globalscale-espressobin.bootscript +++ b/target/linux/mvebu/image/globalscale-espressobin.bootscript @@ -1,10 +1,18 @@ +if test -z "${owrt_uenv_ver}"; then + load mmc 0:1 ${loadaddr} uEnv.txt + env import -t ${loadaddr} + env delete ${old_or_temp_vars} + saveenv + boot +fi + setenv bootargs "root=PARTUUID=@ROOT@-02 rw rootwait" if test -n "${console}"; then setenv bootargs "${bootargs} ${console}" fi -load mmc 0:1 ${fdt_addr} armada-3720-espressobin.dtb -load mmc 0:1 ${kernel_addr} Image +load mmc 0:1 ${fdt_addr}${fdt_addr_r} armada-3720-espressobin.dtb +load mmc 0:1 ${kernel_addr}${kernel_addr_r} Image -booti ${kernel_addr} - ${fdt_addr} +booti ${kernel_addr}${kernel_addr_r} - ${fdt_addr}${fdt_addr_r} diff --git a/target/linux/mvebu/image/globalscale-espressobin.uenv b/target/linux/mvebu/image/globalscale-espressobin.uenv new file mode 100644 index 0000000000..986db9884b --- /dev/null +++ b/target/linux/mvebu/image/globalscale-espressobin.uenv @@ -0,0 +1,25 @@ +owrt_uenv_ver=1 +old_or_temp_vars=devnum devtype fileaddr filesize root uenv_ver old_or_temp_vars +boot_a_script=ext4load ${devtype} ${devnum}:${distro_bootpart} ${loadaddr} ${prefix}${script}; run set_owrt_uenv_ver; if test "${script}" = "uEnv.txt"; then env import -t ${loadaddr}; elif test "${script}" = "boot.scr"; then source ${loadaddr}; fi; run upg_owrt_uenv; run boot_owrt +boot_owrt=setenv bootargs "${console} ${root} rw rootwait ${extra_params}"; ext4load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr}${fdt_addr_r} ${fdt_name}; ext4load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr}${kernel_addr_r} ${image_name}; booti ${kernel_addr}${kernel_addr_r} - ${fdt_addr}${fdt_addr_r} +boot_prefixes=/ /boot/ +boot_scripts=uEnv.txt boot.scr +boot_targets=usb0 scsi0 mmc0 mmc1 +bootcmd=run distro_bootcmd +bootcmd_mmc0=setenv devnum 0; run mmc_boot +bootcmd_mmc1=setenv devnum 1; run mmc_boot +bootcmd_scsi0=setenv devnum 0; run scsi_boot +bootcmd_usb0=setenv devnum 0; run usb_boot +distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done +distro_bootpart=1 +extra_params=pci=pcie_bus_safe +fdt_name=@DTB@.dtb +image_name=@KERNEL@ +mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot; fi +root=root=PARTUUID=@ROOT@-02 +scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_scripts; done; +scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done +scsi_boot=scsi scan; if scsi dev ${devnum}; then setenv devtype scsi; run scan_dev_for_boot; fi +set_owrt_uenv_ver=if test -n ${owrt_uenv_ver}; then setenv uenv_ver ${owrt_uenv_ver}; fi +upg_owrt_uenv=if test ${uenv_ver} != ${owrt_uenv_ver}; then env delete ${old_or_temp_vars}; saveenv; echo U-Boot environment changed to version ${owrt_uenv_ver}; boot; fi +usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot; fi