From patchwork Thu Mar 21 18:57:21 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: 1060392 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="cuMlVem3"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.b="UxnTcZWV"; 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 44QGHC52p0z9sQr for ; Fri, 22 Mar 2019 05:56:55 +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=cuMlVem3ma4QW+YQ6WlK9G3vBv e9e+UziqYjh0UYyjiLBnaLDnb/leg9Y83gXgyJ9TDdU+PJPA2SstwL1VgE1QTccDMN1NY5zqhMEPt 9sPhnSFluBOrVa94KCja0ICdzL8EpKngOGl2d0tdUqwdPIpI+nw6vsExafjP0wbc5SETjSDHB70Ot L6X4npCrKNL03MyLvdrEbl+p+CsWxUtpAFVATvRj3q88JOMPhdni1k7TpaEgvk1C8QaxnTZj8Gb7T 1fAnbPk1End44l1zRrvKGx+Rs4feEmYHjIUNaFVcaCk0ZqgmF2o1TfUcKNvlyozaTQmjxVohKXS/6 jY9rskAw==; 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 1h72rq-0003j6-CO; Thu, 21 Mar 2019 18:56:42 +0000 Received: from mx-out.tlen.pl ([193.222.135.175]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h72re-0003Wr-NZ for openwrt-devel@lists.openwrt.org; Thu, 21 Mar 2019 18:56:32 +0000 Received: (wp-smtpd smtp.tlen.pl 15965 invoked from network); 21 Mar 2019 19:56:27 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1553194587; bh=MqnicftRN1gr8UacJyyBbd0TgV2GTXsuh7DHRB2JqpY=; h=From:To:Subject; b=UxnTcZWVok44aACtXCtKhVF5h3DImDy/6ujQwpBynyfDaGvOVeod7ZAyIALnYvMd+ mgjoCcfsFtHQtsRxEQs/bzfwJsrk0UrtUMxsI8TF4tO2rodvodhThYDqRCG5Vv7xwB YmIdymmWDJnSH5Rev3IF5/ICRx7Jf8Vhp023EXc8= 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 ; 21 Mar 2019 19:56:27 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Thu, 21 Mar 2019 19:57:21 +0100 Message-Id: <20190321185727.3239-2-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190321185727.3239-1-tomek_n@o2.pl> References: <20190321185727.3239-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: 3a00b8c1389a79b7ce056bc33f445c1f X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [geM0] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190321_115630_925855_D5EAE8B6 X-CRM114-Status: UNSURE ( 7.10 ) 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 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [193.222.135.175 listed in wl.mailspike.net] -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_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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain Subject: [OpenWrt-Devel] [PATCH 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 21 18:57:22 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: 1060393 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="M+8O1Acp"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.b="lpOBZgkJ"; 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 44QGHS0h6wz9s70 for ; Fri, 22 Mar 2019 05:57:08 +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=CVjETfUP7G5o2c7myffTYytjZ9g9uyNSrMwiVEoF1E8=; b=M+8O1Acpeq3mv+ /MrINz6nKoWH+7EMkT4AOlnCh+1yNN0pxIZpPA83/LBVwA1gnyqkf5VSNbFsiVYFb2Ws6oiQ+/pfV vbZqA1KdxBuqrvNmVOgnHRZ/IJCYv8C2vrc/P5x2+AVHfeuJMDO2oh8BLuTnHshDo4o70EHKvHY+f KrCn12JQkEwYo6IstX0NVkL1AHo8pNP9eRxK0zy8cblSBM5jRGOcw7CmgJJgBuXx/Z0DhPC31IS56 dBhGGpBtiGuhnd1zxFj0e9STKcX3zmkrAMYYOvROGdLREeYQVjBQonOqNWpj0CmNEMSb2azWDJdfL hEgKvR2dGwHQ/+9msPsg==; 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 1h72s1-0003yn-3U; Thu, 21 Mar 2019 18:56:53 +0000 Received: from mx-out.tlen.pl ([193.222.135.175]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h72rg-0003X7-KU for openwrt-devel@lists.openwrt.org; Thu, 21 Mar 2019 18:56:34 +0000 Received: (wp-smtpd smtp.tlen.pl 18255 invoked from network); 21 Mar 2019 19:56:29 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1553194589; bh=FG2ihLRbu0oGq8mXYs6HjSUA0l1J3E/nic0mDP7Ar98=; h=From:To:Cc:Subject; b=lpOBZgkJTKLhX4uaIs1suFage4Ieqoq1jjS25QRLA+abxMlWFfnCXayKKNyNpzwiQ szDGY1IXSMvglvjy0IBe5RYZTOQDfIcOcDrPbC0ozXD9jzll82xNstGvUwX1Ntqa/w EOopZKhE05RlVodG1x7Fzl+GtRdSd21jNkT+cy50= 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 ; 21 Mar 2019 19:56:29 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Thu, 21 Mar 2019 19:57:22 +0100 Message-Id: <20190321185727.3239-3-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190321185727.3239-1-tomek_n@o2.pl> References: <20190321185727.3239-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: 6881247978af789d618f656b43f913f2 X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [kYNU] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190321_115632_840625_3DC6060F X-CRM114-Status: UNSURE ( 6.52 ) 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 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [193.222.135.175 listed in wl.mailspike.net] -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_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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain Subject: [OpenWrt-Devel] [PATCH 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 in result 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 21 18:57:23 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: 1060394 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="YblMC+MN"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.b="w5k1ILel"; 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 44QGHg08xqz9sR9 for ; Fri, 22 Mar 2019 05:57:19 +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=LzGlB3q2z9l02gDxHmZ8mN+2Bnw+GE3TUbqw70UGa+I=; b=YblMC+MNqhqao9B76kiQCVAQmm l5zAeGEOIbgMtFQbvEh+ej+VUq4i5t7c91RwUbgaWN3rRo+feUNRwlmxiLvfvU99IezTJ3wYHhJQK 9D/AWiuTPvyBaPfsiQRQpBFKLhgFVaQuJwwowCgckPPPSnn/smvQdTf9kp04YHBc0btrAt7U0Z7dX VA2M5EXGAQwzup2GLiDsLJXRV+koSxYU2zWxHL3Nk8xJuXo4D9lGR/IxRpPgY2cGjo/lir4yBfQ5g J7wJddpx0zQlCzi0DMfgCgwS54iJ4GavdUs4EbIXSRVgcStGqi0MJG5mLdThU9l0bYn8or1EfiMO/ V1xXXEhQ==; 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 1h72sB-0004EM-LV; Thu, 21 Mar 2019 18:57:03 +0000 Received: from mx-out.tlen.pl ([193.222.135.175]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h72rh-0003XH-3E for openwrt-devel@lists.openwrt.org; Thu, 21 Mar 2019 18:56:35 +0000 Received: (wp-smtpd smtp.tlen.pl 20812 invoked from network); 21 Mar 2019 19:56:30 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1553194591; bh=x2hsaJ6SxGZ/DThMZEls6ZwrvQ5ebWlT7LBo21GYLM4=; h=From:To:Subject; b=w5k1ILelGoywnuwrGQtyjXsl6mj9s1QF0q3Y6KI1yWJTZRwOaMp0c0hwTbMz7W8o0 ZxC8DK4FnvLYtf4r9VBVMHmHnmNy3mZcZtUWzMza+LG0IWySsB/rQ7Nax6X5SMml82 o/pXOwvMSG0Bx7OTdc6KxHoQffn3nOoxSJyRjOk0= 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 ; 21 Mar 2019 19:56:30 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Thu, 21 Mar 2019 19:57:23 +0100 Message-Id: <20190321185727.3239-4-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190321185727.3239-1-tomek_n@o2.pl> References: <20190321185727.3239-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: 34bcd0f832c6a51ee6ea210b46243d5c X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [0QNE] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190321_115633_298317_0E7351BC X-CRM114-Status: UNSURE ( 8.19 ) 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 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [193.222.135.175 listed in wl.mailspike.net] -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_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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain Subject: [OpenWrt-Devel] [PATCH 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 | 3 --- target/linux/mvebu/image/cortex-a9.mk | 4 ++-- 6 files changed, 14 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 ac5b80233b..38099fdd19 100644 --- a/target/linux/mvebu/image/cortex-a72.mk +++ b/target/linux/mvebu/image/cortex-a72.mk @@ -4,7 +4,6 @@ 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 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 +16,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 +28,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 21 18:57:24 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: 1060395 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="fP642Zfa"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.b="vXuo3Y9g"; 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 44QGHk6m4vz9sQr for ; Fri, 22 Mar 2019 05:57: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=fP642ZfaDfwkComf/rG1LRNhus rqEI14MMOtl7XQmo4lHdA/SbIRZZXenHS3vsexdckylzCCo0DgWUYqU1L0r8WU6KjSb/ZasJfjhB9 +03mMal6H0JV0o3XxPNWI1FpNgXLeUcYSlJyz4hUYriOVeR6fvenAUkfi2tbtXnN9TXiviobeU4d9 1S0Am5JC23oQPnmCg50OEmRJ2DfkI2DQhS+qBU9nVwz9aoqOL35/VkpGp8+gHvYn6Up9+f4jaPgTs 8cRcBV5jiTKPVC6eAcF2JKrQvGp9N3xp9F22Uvd2TvTYNcPcaJMTLVstCGC0SG5cOnRjtxaNPdP5z ED1Znzkg==; 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 1h72sL-0004U4-D4; Thu, 21 Mar 2019 18:57:13 +0000 Received: from mx-out.tlen.pl ([193.222.135.175]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h72rj-0003YC-1n for openwrt-devel@lists.openwrt.org; Thu, 21 Mar 2019 18:56:40 +0000 Received: (wp-smtpd smtp.tlen.pl 22206 invoked from network); 21 Mar 2019 19:56:31 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1553194591; bh=rdazD3wnDK1k+zq7aoj6OAcav4DcPpGErHTufx0j7m0=; h=From:To:Subject; b=vXuo3Y9gfkbH1YjYre7i0sQA/1+x1GXJMsCQpOZ0293zpp65Q7WUXVzPD+c05kfZ2 /qA/9kR3Q2IjwewUldPQbRwVZKsFLhh3ZQTtXaQz6tmfXlMWiLzIAUvwoPZtpEy1b2 gxtXUO5buj9G9KU+yvyS6rrGEZd4wakzQ0MuSfDA= 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 ; 21 Mar 2019 19:56:31 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Thu, 21 Mar 2019 19:57:24 +0100 Message-Id: <20190321185727.3239-5-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190321185727.3239-1-tomek_n@o2.pl> References: <20190321185727.3239-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: 96651b439fd3b43bc412f279de9bdbfd X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [IbN0] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190321_115635_527626_F9096186 X-CRM114-Status: UNSURE ( 7.81 ) 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 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [193.222.135.175 listed in wl.mailspike.net] -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_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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain Subject: [OpenWrt-Devel] [PATCH 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 21 18:57:25 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: 1060396 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="UOp750IU"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.b="bxuvWwtF"; 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 44QGHz0Fndz9sQr for ; Fri, 22 Mar 2019 05:57:35 +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=UOp750IUXPjFeHqVsw1ENlpAul HBiEfaWjvN2lMoiyR0jzcv/Ec3g28fa0OqZtFwutGLTQ/Ez28/Zk5BU0HNjQEknfvCEBkihVTwEll dZXsDIp7qtcjYTNB650cGbRSWVDyFvYjHpcYtHheALd83jo91O8BmunMtpeEkzzwbVX17A8zkcHp+ 7psbLSWgwLmKqzbB9Pwg7tFk4xc0tzzm9XPFqkVGCSgddFEIScbhwrOGkIUz98+NgGEzMGFkOWAkZ Cd5g7VXmFnLxj8kQRipD2OxC3C2GwpJzXEH4LFWWb5Us8Wk3IRtfWTY/qbWgZhiB8GUvI+TCFML3y eDBZZUFg==; 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 1h72sW-0004kn-4A; Thu, 21 Mar 2019 18:57:24 +0000 Received: from mx-out.tlen.pl ([193.222.135.175]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h72rk-0003a1-VV for openwrt-devel@lists.openwrt.org; Thu, 21 Mar 2019 18:56:43 +0000 Received: (wp-smtpd smtp.tlen.pl 25043 invoked from network); 21 Mar 2019 19:56:33 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1553194593; bh=lkl16udCEZ4iqlYk1k4/Af4UpecTuC32B74WLP95bZ4=; h=From:To:Subject; b=bxuvWwtFuQ4B4DhYw9u5TFTnLS/c9nFyOhFSUwPlgt91U+dMM0ihk1zM+9D2UuqhV 6KR3rEnIn59yYHlqwmZfbviAKmly8IedIeKeobnlXHxSwLaO4j31+8hueS3wyjtnFJ jqGFd3qESLapynUPq5rguOHmmhxWOyyVk3pgR/MU= 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 ; 21 Mar 2019 19:56:33 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Thu, 21 Mar 2019 19:57:25 +0100 Message-Id: <20190321185727.3239-6-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190321185727.3239-1-tomek_n@o2.pl> References: <20190321185727.3239-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: 351204ccff269c3700999bb09ae737a4 X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [8WO0] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190321_115637_718598_062294F7 X-CRM114-Status: GOOD ( 10.59 ) 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 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [193.222.135.175 listed in wl.mailspike.net] -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_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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain Subject: [OpenWrt-Devel] [PATCH 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 21 18:57:26 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: 1060398 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="HqF5Hpoo"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="GtOGFiCl"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.b="YwSl8qtm"; 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 44QGJP67mjz9sR9 for ; Fri, 22 Mar 2019 05:57:57 +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=HqF5HpoogCQ9s138Sb/dVP9cJ0 kZTNkaBsp9r9SbMo8zhmu+C0Y7C56AdcjeV48LOsXUkaRJGGjS0xsJyJ4qTy/Q7ZRXTNoK0o+3ZnG 9qbk6DW4rWkoJodhU+jUAjBhsEyiLHzmLg0vxjgepcKicLZU8TQe4Cxtau91WPHZvv8GAARaxOCM7 hxRnXYPhyDlHMBrcHxQ8kXY34rNOLNlXFQ+ivo3KVURI5Mt5OmVHuhmci9KicUPVi1kWufLSWD07b PknkCD50bjNehJRjkgUQoTx9WAPJRX5WtAyZh6P/DXaeGaUOXdvg1JhlF0KF/VKkGFb2UkJteaFPH 4q28Ktbw==; 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 1h72sp-0005F5-Oa; Thu, 21 Mar 2019 18:57:43 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h72sc-0004tq-Vu for openwrt-devel@bombadil.infradead.org; Thu, 21 Mar 2019 18:57:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=GtOGFiClacwTN/wcPp3Xibxnl2 b5p+PXA5xBhcs7oeCOy7OXdvBvoVSLXzbulRHHiE0OXBdjFcdzckJjj66Lgb/qZzKa34Eq6DdA/0B fmrvllYhpImjXa0oulj8NUatm9oTJIRlIZi3z9Ti8sBx0GQgeKaF7gKUbQp2MAY9Aa5IBIzZKVBY9 Y4yH5GSD2WHtwZDor/rBfEINmPI1qc+tow1rLH6yBdAuioBgSEnHh1/qc/H6PnjoSibQAKRuVWB7G Wranm9n6FTXUo2j766S/ivT3Op1leLrcoD46bxIwHeazsxCZgUhlUNilU+1dlCSbWMSI+moCu5mK+ neCH2VsA==; Received: from mx-out.tlen.pl ([193.222.135.175]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h72sX-0001mR-UO for openwrt-devel@lists.openwrt.org; Thu, 21 Mar 2019 18:57:28 +0000 Received: (wp-smtpd smtp.tlen.pl 27822 invoked from network); 21 Mar 2019 19:56:35 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1553194595; bh=VifoH4ee2nisXbXoooqvW9OrapTGjxjxaR5GWxeb6b0=; h=From:To:Subject; b=YwSl8qtm50B8PxlvhdZ91Z0+kqq5+s50f5E2wOl56ZT3dKYzY7sHbnQI+lh4UEIGZ CdPpQ0BsCMyO0KM6/UkFtyTQ82DZQHRnILjrJx8/KaZtoeu3bebOyNGiXJej+FNVi3 Gn+2HCOkYxQVv4QnTf7p/yyAQQy4YK8XQB33YS+4= 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 ; 21 Mar 2019 19:56:35 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Thu, 21 Mar 2019 19:57:26 +0100 Message-Id: <20190321185727.3239-7-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190321185727.3239-1-tomek_n@o2.pl> References: <20190321185727.3239-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: 7685f5e6ffde654870292700da735c47 X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [AYNE] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190321_145726_282563_C0237390 X-CRM114-Status: GOOD ( 15.94 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [193.222.135.175 listed in wl.mailspike.net] 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -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_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain Subject: [OpenWrt-Devel] [PATCH 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 21 18:57:27 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: 1060397 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="kLlHbMBO"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.b="XwUukgkp"; 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 44QGJC2DYNz9s70 for ; Fri, 22 Mar 2019 05:57: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=kLlHbMBOujDbLrODK/jxNM0rKJ 9+VZFHZZAM0ou9SxvXAHeZkKtNrtRR+tqe3s05YymvY9hgxnV7WqoxCbkYUHYnhC3qpToNIo3RWOQ GuubF5+sZ2JvbRMFZMXAUcEsG/a+KbiY+kKTA0zzHPmUdZiX7R7R4TOsEqvKUkisi/bsmT+ClBhN1 SPmgM5hFeUt9RzhNzR/qC2mlKz4fRejbmD+NthmwbIdX/tsveYtlD7gdeMHbXxTHEEQGiyp0lHXN+ MuQcg6YJdqW3wrv95WqZidU+fMpdVU0LPYB97dEB2LrY/CBqgEd/vhUqgP39HJ2yaSi4B8YxFDpeA I6S4w5EQ==; 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 1h72sg-00050t-Ec; Thu, 21 Mar 2019 18:57:34 +0000 Received: from mx-out.tlen.pl ([193.222.135.175]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h72rn-0003dW-Fc for openwrt-devel@lists.openwrt.org; Thu, 21 Mar 2019 18:56:47 +0000 Received: (wp-smtpd smtp.tlen.pl 30596 invoked from network); 21 Mar 2019 19:56:37 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1553194597; bh=X5v0c8ABbmDGh6JS/z3IkNkjHrAmuBqR8/DjFvq5hw0=; h=From:To:Subject; b=XwUukgkpqkoadBIgZg8yrvJHH8Yt3tB0oJed8CSCz2sgaSSR/qzPor8Btj1RPisNz SFFeRuo1Guhn5zTjRbRX5QUTqRhiPmNKz+2EOUqpGbE/n5/kbOmQ1rMZFphCUzg/xR 2wCf/67mFQRoo72e0/Ke229rdyEe9D0DqUHEzLaU= 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 ; 21 Mar 2019 19:56:37 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Thu, 21 Mar 2019 19:57:27 +0100 Message-Id: <20190321185727.3239-8-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190321185727.3239-1-tomek_n@o2.pl> References: <20190321185727.3239-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: 352eedc7f8139835faa21c41a2b4905f X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [kbMk] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190321_115639_992794_EA11D6B5 X-CRM114-Status: GOOD ( 10.09 ) 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 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [193.222.135.175 listed in wl.mailspike.net] -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_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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain Subject: [OpenWrt-Devel] [PATCH 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