From patchwork Wed Mar 7 18:52:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Larsson X-Patchwork-Id: 882716 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.133; helo=hemlock.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="H/RtbGck"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zxN7K0NC9z9sd3 for ; Thu, 8 Mar 2018 05:52:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C077B8996E; Wed, 7 Mar 2018 18:52:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o0SizoMIRZ4J; Wed, 7 Mar 2018 18:52:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 24B2089A67; Wed, 7 Mar 2018 18:52:38 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id ADADA1C00BB for ; Wed, 7 Mar 2018 18:52:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id AA2B9889B0 for ; Wed, 7 Mar 2018 18:52:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7AtbqMUIqOzO for ; Wed, 7 Mar 2018 18:52:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by whitealder.osuosl.org (Postfix) with ESMTPS id 8C610889A9 for ; Wed, 7 Mar 2018 18:52:34 +0000 (UTC) Received: by mail-lf0-f66.google.com with SMTP id q69-v6so4730356lfi.10 for ; Wed, 07 Mar 2018 10:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/gBWNlLTITsJVjlTEqKFOE2n3ff3rOyUAGDvxlGhKGg=; b=H/RtbGckp6asJO7iZBePDvPHyzYNx0V9IluTiVual8L8aniq4IAyV7HtSdXJ/nD6Ah kDMxj+FcrUi94UfA8652YkuuhdYf7eZCa9qDfYprddl6/D2OC5rBj5Sm9iES+ddtxivF uHw57zODT3/l1v72nl2OlqUdanV181sueBwBhVA5TBq9SMJ/fnvjvUHRn0I9WA9/LUDo HanN3bhTXEfSdKuouG3X+Fq9IoZy8I6VVWTpZPFzDBPj00iUP0sFFQLAiY4XB5DXlBUP 0DiRxln7lq0Ku1s+boPa16Vo2xtq75k/F3Kq12Hjut+x7RK8rufKmGUlrNSOjO1d1C6N GPEg== 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:in-reply-to :references; bh=/gBWNlLTITsJVjlTEqKFOE2n3ff3rOyUAGDvxlGhKGg=; b=k9y++IvyezmXuU5/K8eYSE4EuEgoOm+Ivfau8c9GA3Zu+eBlczAHU/zN24N659t3hM q9B5bWjphuYwVw2MtXCaoZ/1IF3wh+aaY6NSoFx3qhB9lJWIxa/9JbxpsvMFhZ8eFBKQ oMsGrDa9xRUbYXF/y4W0B5+tjPdnrXaOWkQuV8L22bU1TIIoWh2YZlaI/Diu/Gbx8Vz6 9uaBgOVz9kdP24rKgk+Az5Yo7I664GdmvYy6uLjJr7UosB0BcPJaIOuxh8IXsbbaQ9f6 AMDUPSI4LsODMj3SHPCKmmI1wXlR9bkJFixUdSrPGPnUADCKKhQaag9wF2wQI8/UTz40 03ig== X-Gm-Message-State: AElRT7E/+UE+c1RwK3XlMxtdtGkPi216P93nLXe4e8fju3TZg9j0f3qL 3CaU8/DYCj7SNIGOe/nuViGVu8Tga0o= X-Google-Smtp-Source: AG47ELvZIq86CDHPgKI84dlsWqsoJzuAcKyjIpkT1mjlZBjj+2ybReBW+NK9YN5PkDHSK9jRgXiE5w== X-Received: by 10.25.170.144 with SMTP id t138mr16100418lfe.71.1520448752266; Wed, 07 Mar 2018 10:52:32 -0800 (PST) Received: from erik-cab.lan (90-230-144-91-no25.tbcn.telia.com. [90.230.144.91]) by smtp.gmail.com with ESMTPSA id q63sm3754355lje.72.2018.03.07.10.52.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Mar 2018 10:52:31 -0800 (PST) From: Erik Larsson To: buildroot@buildroot.org Date: Wed, 7 Mar 2018 19:52:15 +0100 Message-Id: <1520448738-5794-2-git-send-email-karl.erik.larsson@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520448738-5794-1-git-send-email-karl.erik.larsson@gmail.com> References: <1520448738-5794-1-git-send-email-karl.erik.larsson@gmail.com> Subject: [Buildroot] [PATCH v5 1/4] imx-mkimage: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcus Folkesson , Fabio Estevam , Erik Larsson , Christopher Dahlberg , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This package add support for imx-mkimage for iMX8M. Currently the only hardware it's tested for. Signed-off-by: Erik Larsson Signed-off-by: Christopher Dahlberg --- v5: Build with HDMI support Add patch to use host mkimage instead of ./mkimage_uboot in soc.mk Add host dependencies to dtc package Add host configuration options in build Add patch to make use of LDFLAGS in soc.mk (fixes build error with libz) v4: No changes v3: Use BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME in U-Boot so we don't need to copy u-boot.bin to u-boot-nodtb.bin (suggested by Baruch) Update license to GPL-2.0+ (suggested by Marcus F.) v2: Moved package from package/freescale-imx to package (suggested by Thomas P.) Add upstread URL in Config.in (suggested by Thomas P.) Fix install syntax in imx-mkimage.mk (suggested by Thomas P.) Use Makefile in imx-mkimage to build imx-boot-imx8mqevk-sd.bin instead of doing that in the post-script.sh (suggested Baruch) --- package/Config.in.host | 1 + .../imx-mkimage/0001-remove-git-build-info.patch | 29 +++++++++++++++++ .../0002-add-ldflags-to-link-step.patch | 26 ++++++++++++++++ .../0003-remove-use-of-mkimage_uboot.patch | 26 ++++++++++++++++ package/imx-mkimage/Config.in.host | 12 ++++++++ package/imx-mkimage/imx-mkimage.hash | 3 ++ package/imx-mkimage/imx-mkimage.mk | 36 ++++++++++++++++++++++ 7 files changed, 133 insertions(+) create mode 100644 package/imx-mkimage/0001-remove-git-build-info.patch create mode 100644 package/imx-mkimage/0002-add-ldflags-to-link-step.patch create mode 100644 package/imx-mkimage/0003-remove-use-of-mkimage_uboot.patch create mode 100644 package/imx-mkimage/Config.in.host create mode 100644 package/imx-mkimage/imx-mkimage.hash create mode 100644 package/imx-mkimage/imx-mkimage.mk diff --git a/package/Config.in.host b/package/Config.in.host index 199a8e9..06ef5cb 100644 --- a/package/Config.in.host +++ b/package/Config.in.host @@ -24,6 +24,7 @@ menu "Host utilities" source "package/go-bootstrap/Config.in.host" source "package/google-breakpad/Config.in.host" source "package/gptfdisk/Config.in.host" + source "package/imx-mkimage/Config.in.host" source "package/imx-usb-loader/Config.in.host" source "package/jq/Config.in.host" source "package/jsmin/Config.in.host" diff --git a/package/imx-mkimage/0001-remove-git-build-info.patch b/package/imx-mkimage/0001-remove-git-build-info.patch new file mode 100644 index 0000000..9f8da02 --- /dev/null +++ b/package/imx-mkimage/0001-remove-git-build-info.patch @@ -0,0 +1,29 @@ +From d1bb893300b1bd80eaac27fcc8eb4347f56f83b4 Mon Sep 17 00:00:00 2001 +From: Erik Larsson +Date: Thu, 22 Feb 2018 09:56:53 +0100 +Subject: [PATCH] Remove buildinformation step. + +Signed-off-by: Erik Larsson +Signed-off-by: Christopher Dahlberg +--- + Makefile | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index 4b449ad..4042a39 100644 +--- a/Makefile ++++ b/Makefile +@@ -33,9 +33,7 @@ $(MKIMG): buildinfo $(SRCS) + bin: $(MKIMG) + + buildinfo: +- @echo -n '#define MKIMAGE_COMMIT 0x' > src/build_info.h +- @git rev-parse --short=8 HEAD >> src/build_info.h +- @echo '' >> src/build_info.h ++ @echo "#define MKIMAGE_COMMIT 0x0000" > src/build_info.h + + help: + @echo $(CURR_DIR) +-- +2.7.4 + diff --git a/package/imx-mkimage/0002-add-ldflags-to-link-step.patch b/package/imx-mkimage/0002-add-ldflags-to-link-step.patch new file mode 100644 index 0000000..22c6a7d --- /dev/null +++ b/package/imx-mkimage/0002-add-ldflags-to-link-step.patch @@ -0,0 +1,26 @@ +From a73f20fbe921c7ecff3efda23bc506fdd935ee4d Mon Sep 17 00:00:00 2001 +From: Erik Larsson +Date: Tue, 6 Mar 2018 12:28:39 +0100 +Subject: [PATCH 1/2] Add LDFLAGS to link step + +Signed-off-by: Erik Larsson +--- + iMX8M/soc.mak | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/iMX8M/soc.mak b/iMX8M/soc.mak +index 8346769..38a14bb 100644 +--- a/iMX8M/soc.mak ++++ b/iMX8M/soc.mak +@@ -15,7 +15,7 @@ FW_DIR = imx-boot/imx-boot-tools/imx8mq + + $(MKIMG): mkimage_imx8.c + @echo "Compiling mkimage_imx8" +- $(CC) $(CFLAGS) mkimage_imx8.c -o $(MKIMG) -lz ++ $(CC) $(CFLAGS) mkimage_imx8.c -o $(MKIMG) $(LDFLAGS) -lz + + $(DCD_CFG): $(DCD_CFG_SRC) + @echo "Converting iMX8M DCD file" +-- +2.7.4 + diff --git a/package/imx-mkimage/0003-remove-use-of-mkimage_uboot.patch b/package/imx-mkimage/0003-remove-use-of-mkimage_uboot.patch new file mode 100644 index 0000000..86da7dc --- /dev/null +++ b/package/imx-mkimage/0003-remove-use-of-mkimage_uboot.patch @@ -0,0 +1,26 @@ +From fe1e495ca9766277db9505ff0a1736293569a694 Mon Sep 17 00:00:00 2001 +From: Erik Larsson +Date: Tue, 6 Mar 2018 12:29:15 +0100 +Subject: [PATCH 2/2] Remove use of ./mkimage_uboot and use mkimage instead + +Signed-off-by: Erik Larsson +--- + iMX8M/soc.mak | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/iMX8M/soc.mak b/iMX8M/soc.mak +index 38a14bb..b61dc85 100644 +--- a/iMX8M/soc.mak ++++ b/iMX8M/soc.mak +@@ -46,7 +46,7 @@ clean: + dtbs = fsl-imx8mq-evk.dtb + u-boot.itb: $(dtbs) + ./mkimage_fit_atf.sh $(dtbs) > u-boot.its +- ./mkimage_uboot -E -p 0x3000 -f u-boot.its u-boot.itb ++ mkimage -E -p 0x3000 -f u-boot.its u-boot.itb + @rm -f u-boot.its + + flash_hdmi_spl_uboot: $(MKIMG) signed_hdmi_imx8m.bin u-boot-spl-ddr.bin u-boot.itb +-- +2.7.4 + diff --git a/package/imx-mkimage/Config.in.host b/package/imx-mkimage/Config.in.host new file mode 100644 index 0000000..490b514 --- /dev/null +++ b/package/imx-mkimage/Config.in.host @@ -0,0 +1,12 @@ +config BR2_PACKAGE_HOST_IMX_MKIMAGE + bool "host imx-mkimage" + select BR2_PACKAGE_HOST_UBOOT_TOOLS + select BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT + select BR2_PACKAGE_HOST_DTC + depends on BR2_LINUX_KERNEL + depends on BR2_TARGET_UBOOT + help + imx-mkimage is used to combine input images and generate + final boot image with appropriate IVT set. + + https://source.codeaurora.org/external/imx/imx-mkimage diff --git a/package/imx-mkimage/imx-mkimage.hash b/package/imx-mkimage/imx-mkimage.hash new file mode 100644 index 0000000..08d31ce --- /dev/null +++ b/package/imx-mkimage/imx-mkimage.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 4ddb144520001c33baa24493f68ef2ea9434ac36bf3ae223f78d7ec581aa484c imx-mkimage-imx_4.9.51_imx8m_beta.tar.gz +sha256 231f7edcc7352d7734a96eef0b8030f77982678c516876fcb81e25b32d68564c iMX8dv/COPYING diff --git a/package/imx-mkimage/imx-mkimage.mk b/package/imx-mkimage/imx-mkimage.mk new file mode 100644 index 0000000..7272f7f --- /dev/null +++ b/package/imx-mkimage/imx-mkimage.mk @@ -0,0 +1,36 @@ +################################################################################ +# +# imx-mkimage +# +################################################################################ + +IMX_MKIMAGE_VERSION = imx_4.9.51_imx8m_beta +IMX_MKIMAGE_SITE = https://source.codeaurora.org/external/imx/imx-mkimage +IMX_MKIMAGE_SITE_METHOD = git +IMX_MKIMAGE_LICENSE = GPL-2.0+ +IMX_MKIMAGE_LICENSE_FILES = iMX8dv/COPYING +HOST_IMX_MKIMAGE_DEPENDENCIES = uboot linux firmware-imx arm-trusted-firmware host-dtc + +define HOST_IMX_MKIMAGE_BUILD_CMDS + # These files are generated by firmware-imx, uboot and arm-trusted-firmware + # Copy the files into the iMX8M folder to make building of this package simple + # The NXP engineers has constructed to buildprocess with a bunch of hardcoded + # file names and pathes. + + # Currently this only supports iMX8M. When more hardware is available + # this needs to be selectable based on iMX8-version (iMX8M,iMXQ etc). + cp $(BINARIES_DIR)/u-boot-spl.bin $(@D)/iMX8M + cp $(BINARIES_DIR)/lpddr4_pmu_train* $(@D)/iMX8M + cp $(BINARIES_DIR)/fsl-imx8mq-evk.dtb $(@D)/iMX8M + cp $(BINARIES_DIR)/signed_hdmi_imx8m.bin $(@D)/iMX8M + cp $(BINARIES_DIR)/bl31.bin $(@D)/iMX8M + cp ${BINARIES_DIR}/u-boot-nodtb.bin $(@D)/iMX8M + + $(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) SOC=iMX8M flash_hdmi_spl_uboot +endef + +define HOST_IMX_MKIMAGE_INSTALL_CMDS + $(INSTALL) -D -m 755 $(@D)/iMX8M/flash.bin $(BINARIES_DIR)/imx-boot-imx8mqevk-sd.bin +endef + +$(eval $(host-generic-package))