From patchwork Sat Jun 8 10:53:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gary Bisson X-Patchwork-Id: 1112411 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SsPYCEks"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45LbqR2pQ6z9s6w for ; Sat, 8 Jun 2019 20:53:55 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 45E002152C; Sat, 8 Jun 2019 10:53:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tDyy39uWwPeq; Sat, 8 Jun 2019 10:53:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id C26D3204D5; Sat, 8 Jun 2019 10:53:50 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id E3AA31BF47E for ; Sat, 8 Jun 2019 10:53:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E067C85FE4 for ; Sat, 8 Jun 2019 10:53:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RT8JMZeHgTNe for ; Sat, 8 Jun 2019 10:53:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by fraxinus.osuosl.org (Postfix) with ESMTPS id E556385FDE for ; Sat, 8 Jun 2019 10:53:47 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id w9so5722763wmd.1 for ; Sat, 08 Jun 2019 03:53:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BEWuGDcfCmDDxr42xOmoXCvRMDv0djKadjBe5mLwLu0=; b=SsPYCEksVXMFV6E+OuXE6KpKdXsZeV+9YwmSHKG5vGhw/0L9LQEMPr1sQbLMtMW7c5 r2VIZADfUUf6jjpDj/FmBj6F5c9ZgtRPvHPAxdIwJMBFzLFuN15jOALGZpCNYqJF0CKe /CifwJ91n4rPthbF0AWhT0AukBCst7yw1w6NDjmoLTozCPhbmvKGIekYKrXThypyBCNi hHEFXtB0FifsIZ6tYxSBIRCgttj4X/bT+n1d9YXDhUeo8xPpYSP9xTzZnEiPFxLXQEol fphRWLBmm6DlnsxbsKgWZrW0+K21fVppUektebfLiJqppJr18bwGZssupy0lrjJHOZ98 1iyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BEWuGDcfCmDDxr42xOmoXCvRMDv0djKadjBe5mLwLu0=; b=PsTTZKpkT0VpfQ4LhJckXltqVNQ/KNSzLCtwS4TM5jel3xfI0RDDNP/812qjE8l3PC Rq5dWfDXivgt1j0KrID8ib9vYEVo11S0K5tkVv3AF9lLoBDj/ENRLeuYesDXnqOKh9mY 9eqjWCPp68i/oTlVGinVJP0/gkjVhPqw73D3q7OaXRzAmnXyInsJNIPbcEdDG3d8K0Ui 8ayIdvgPGiNgob5uBnvdNEg7fdVhsVF3nRpXB70M4NDVM41Oxb/xj1L9n+Fudn8C2yEC /79g9FBxWwXMd9eAv9ZnuoKW/8QtyXWvU04bo8wCacCalUDqo3eKHhvOmVvk/TasLdAK iY7g== X-Gm-Message-State: APjAAAWXsQL5HABxhXmw3hZkPQxmTHifLa0+Y/fg13SBEjL27UVAx5LF EpGJPIdiFBy9phV2ydqGxWdJR2EH X-Google-Smtp-Source: APXvYqyTFLpWia1dBySWUGK2qfJsHNGou7ERsqpi7n9eQZCdq9ZFfq+XG85xn0cbmnVTp8m+UUkR+Q== X-Received: by 2002:a7b:cb06:: with SMTP id u6mr6752069wmj.170.1559991225792; Sat, 08 Jun 2019 03:53:45 -0700 (PDT) Received: from t450s.home (2a01cb040a7dd5006380533a214e9bc8.ipv6.abo.wanadoo.fr. [2a01:cb04:a7d:d500:6380:533a:214e:9bc8]) by smtp.gmail.com with ESMTPSA id y12sm3356706wrr.3.2019.06.08.03.53.44 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 08 Jun 2019 03:53:44 -0700 (PDT) From: Gary Bisson To: buildroot@buildroot.org Date: Sat, 8 Jun 2019 12:53:37 +0200 Message-Id: <20190608105337.19879-1-bisson.gary@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3] mfgtools: bump revision to latest uuu version X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gary Bisson , thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" NXP deprecated the old mfgtools code, also called mfgtools v2 although the releases were named v0.xx. It has been replaced by the Universal Update Utility (uuu), also called mfgtools v3.0 although the releases are named v1.x.yy. This new tool actually resides in the same repository in the master branch whereas the old one is now in a 'linux' branch. Since the old tool has issues building lately, let's switch to the new one. Note that uuu seems to be cleaner, supports much more features (i.MX8/8M/8QXP boot, fastboot etc..) and has a better documentation: https://github.com/NXPmicro/mfgtools/wiki [from Jorg's patch] Note, that mfgtools uses git to define a version string `GIT_VERSION`. It does so even when building from a source tarball (automatically generated by github). The problem is, that git provides the version information of Buildroot and mfgtools uses this version information to do a runtime check to detect outdated command list scripts. To fix this, we overwrite gen_ver.sh with something that simply prints a define for `GIT_VERSION` with the mfgtools version string (preceeded by "lib", as done in the original gen_ver.sh). Signed-off-by: Gary Bisson Signed-off-by: Jörg Krause --- Changelog v3: - inclue Jörg's version fix into this patch - use git rev instead of tag to have the fix to Thomas' build issue included: https://github.com/NXPmicro/mfgtools/commit/646e4d70 Changelog v2: - update Config.in help text to mention tool version - update project URL (codeauroraforum doesn't apply to NXP repositories now that the Qualcomm merger isn't happening) - add README.md to license files (like before) --- package/mfgtools/Config.in.host | 10 ++++---- package/mfgtools/mfgtools.hash | 6 ++--- package/mfgtools/mfgtools.mk | 38 ++++++++++------------------ package/mfgtools/readme.txt | 45 +++++---------------------------- 4 files changed, 29 insertions(+), 70 deletions(-) diff --git a/package/mfgtools/Config.in.host b/package/mfgtools/Config.in.host index 4bbdde38e2..dd4f037b6c 100644 --- a/package/mfgtools/Config.in.host +++ b/package/mfgtools/Config.in.host @@ -6,9 +6,9 @@ config BR2_PACKAGE_HOST_MFGTOOLS depends on BR2_arm depends on BR2_HOST_GCC_AT_LEAST_4_8 # needs C++11 help - This package contains the Freescale manufacturing tool. - It is designed to program firmware to i.MX boards during - production. The communication is done over USB using the - Freescale UTP protocol. + This package contains the NXP Universal Update Utility + (MFGTools v3) for i.MX boards. + It allows to load a bootloader/kernel/ramdisk over USB SDP + protocol as well as sending commands to flash a storage. - https://github.com/codeauroraforum/mfgtools + https://github.com/NXPmicro/mfgtools diff --git a/package/mfgtools/mfgtools.hash b/package/mfgtools/mfgtools.hash index 4932a80dba..6b3771d178 100644 --- a/package/mfgtools/mfgtools.hash +++ b/package/mfgtools/mfgtools.hash @@ -1,4 +1,4 @@ # locally computed -sha256 055d71227d18883d6e8bc9e854c076015f9a7749820a94272e19071bf0b25c89 mfgtools-v0.02.tar.gz -sha256 2655559a6bb1179eae514f5c7166f4ede4f2453efa9cf4dc3c045cab5d57dede LICENSE -sha256 0963b6e5086bf454265b0f57821a02b681d1211e40ad74c310231cb4d94815c9 README.txt +sha256 4ac9fcbcd0df430afaaa2d520da2a434cfa102a8f7cbf1db831e2c345f9a8642 mfgtools-9360b9c2c7342f1972894cdb14eb3adcc09a47e4.tar.gz +sha256 cc8d47f7b9260f6669ecd41c24554c552f17581d81ee8fc602c6d23edb8bf495 LICENSE +sha256 01a4b15843de543b01fb0600eba02248273182bcf11da60d2d7736440f0995b6 README.md diff --git a/package/mfgtools/mfgtools.mk b/package/mfgtools/mfgtools.mk index e4663a8af9..fbcca08749 100644 --- a/package/mfgtools/mfgtools.mk +++ b/package/mfgtools/mfgtools.mk @@ -4,31 +4,21 @@ # ################################################################################ -MFGTOOLS_VERSION = v0.02 -MFGTOOLS_SITE = $(call github,codeauroraforum,mfgtools,$(MFGTOOLS_VERSION)) -MFGTOOLS_SUBDIR = MfgToolLib -MFGTOOLS_LICENSE = BSD-3-Clause or CPOL -MFGTOOLS_LICENSE_FILES = LICENSE README.txt -HOST_MFGTOOLS_DEPENDENCIES = host-libusb +MFGTOOLS_VERSION = 9360b9c2c7342f1972894cdb14eb3adcc09a47e4 +MFGTOOLS_SITE = $(call github,NXPmicro,mfgtools,$(MFGTOOLS_VERSION)) +MFGTOOLS_LICENSE = BSD-3-Clause +MFGTOOLS_LICENSE_FILES = LICENSE README.md +HOST_MFGTOOLS_DEPENDENCIES = host-libusb host-bzip2 host-libzip host-zlib -HOST_MFGTOOLS_CFLAGS = \ - $(HOST_CFLAGS) $(HOST_LDFLAGS) -std=c++11 -lpthread \ - -L$(@D)/MfgToolLib -lMfgToolLib -I$(@D)/MfgToolLib \ - -lusb-1.0 -I$(HOST_DIR)/include/libusb-1.0 \ - -fpermissive -Wno-write-strings - -define HOST_MFGTOOLS_CLI_BUILD - $(HOST_CONFIGURE_OPTS) $(MAKE) CC="$(HOSTCXX)" \ - CFLAGS="$(HOST_MFGTOOLS_CFLAGS)" -C $(@D)/TestPrgm -endef - -HOST_MFGTOOLS_POST_BUILD_HOOKS += HOST_MFGTOOLS_CLI_BUILD - -define HOST_MFGTOOLS_INSTALL_CMDS - $(INSTALL) -D -m 755 $(@D)/MfgToolLib/libMfgToolLib.so \ - $(HOST_DIR)/lib/libMfgToolLib.so - $(INSTALL) -D -m 755 $(@D)/TestPrgm/mfgtoolcli \ - $(HOST_DIR)/bin/mfgtoolcli +# Version string generation is broken in mfgtools as it relies on git, even +# when building from a source tarball. The version string is used by mfgtools +# do a runtime check to detect outdated command list scripts. We overwrite +# gen_ver.sh with something that simply prints a define for GIT_VERSION with +# the mfgtools version (preceeded by "lib", as done in the original gen_ver.sh). +define HOST_MFGTOOLS_OVERWRITE_GEN_VER_SH + echo '#!/bin/sh' > $(@D)/libuuu/gen_ver.sh + echo 'echo "#define GIT_VERSION \"lib$(MFGTOOLS_VERSION)\"" > $$1' >> $(@D)/libuuu/gen_ver.sh endef +HOST_MFGTOOLS_POST_PATCH_HOOKS += HOST_MFGTOOLS_OVERWRITE_GEN_VER_SH $(eval $(host-cmake-package)) diff --git a/package/mfgtools/readme.txt b/package/mfgtools/readme.txt index 320e6ec493..8a916d1cae 100644 --- a/package/mfgtools/readme.txt +++ b/package/mfgtools/readme.txt @@ -18,45 +18,16 @@ CONFIG_USB_MASS_STORAGE=y CONFIG_FSL_UTP=y CONFIG_MMC_BLOCK_MINORS=16 -2. Go into the output and create the necessary folders +2. Run the MfgTools (now called uuu) client to boot the board from USB: -$ cd output -$ mkdir -p "Profiles/Linux/OS Firmware/firmware" +$ ./output/host/bin/uuu output/images/u-boot.imx -3. Create your XML update script named ucl2.xml +At this point you can either flash your kernel and rootfs image directly from +U-Boot or use commands in order to load your ramdisk and execute commands from +Linux OS. -You can find a sample XML at: - -$ wget https://storage.googleapis.com/boundarydevices.com/ucl2.xml \ - -O Profiles/Linux/OS\ Firmware/ucl2.xml - -4. Copy the U-Boot, Kernel and initramfs images to the appropriate -folder - -$ cp images/u-boot.imx images/zImage images/imx6q-sabrelite.dtb \ - images/rootfs.cpio.uboot Profiles/Linux/OS\ Firmware/firmware/ - -5. Copy the prebuilt binaries to be flashed - -Depending on your ucl2.xml file, the sample doesn't flash anything. - -6. Run the MfgTools client: - -$ ./host/bin/mfgtoolcli -l mmc -s uboot_defconfig=imx \ - -s dtbname=imx6q-sabrelite.dtb -s initramfs=rootfs.cpio.uboot \ - -s mmc=1 -p 1 - -For more information about the tools options, please read the -"Manufacturing Tool V2 Quick Start Guide.docx" documentation contained -in every mfgtools package from NXP website[1]. - -Note: All the above commands require your Linux host user to have -permissions to access the USB devices. Please make sure to have udev -rules that allow the user to communicate with the BootROM IDs -(Freescale USB recovery) as well as the one used for the UTP Linux -image (0x066F:0x37FF). Using 'sudo' in front of the mfgtoolcli -command would also grant you the necessary permission but it is *not* -recommended. +For more information about the tools options, please read this wiki: +https://github.com/NXPmicro/mfgtools/wiki Also, if your U-Boot environment doesn't include mfgtools bootargs, make sure to set the following: @@ -65,5 +36,3 @@ setenv bootargs "console=${console},${baudrate} g_mass_storage.stall=0 \ g_mass_storage.removable=1 g_mass_storage.idVendor=0x066F \ g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber=\"\" \ g_mass_storage.file=/fat" - -[1] http://www.nxp.com/products/software-and-tools/software-development-tools/i.mx-software-and-tools/i.mx-6-series-software-and-development-tool-resources:IMX6_SW