From patchwork Mon Feb 18 20:48:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Zwing?= X-Patchwork-Id: 1044322 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=none (p=none dis=none) header.from=dawncrow.de Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dawncrow.de header.i=@dawncrow.de header.b="G/ao2aog"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.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 443GDH39DKz9sMl for ; Tue, 19 Feb 2019 07:48:31 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 1487686A2E; Mon, 18 Feb 2019 20:48:28 +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 e1x0Hwuio1Kw; Mon, 18 Feb 2019 20:48:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id A97BC86BA1; Mon, 18 Feb 2019 20:48:23 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id CF9B11BF2A0 for ; Mon, 18 Feb 2019 20:48:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id CC8EA20768 for ; Mon, 18 Feb 2019 20:48:19 +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 xQoNchQtK6Yz for ; Mon, 18 Feb 2019 20:48:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [85.215.255.84]) by silver.osuosl.org (Postfix) with ESMTPS id 757542079C for ; Mon, 18 Feb 2019 20:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1550522894; s=strato-dkim-0002; d=dawncrow.de; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=mR9WH/XD0Ze42FlGNslCZvbL04pKx9/T94gE4fvHS+I=; b=G/ao2aogHsKBwpBemaDYzZKeXimCzXIuoT4FhBhBjCL7z/z+w5HA16hZMbH3TjPJzI t792QEG4HfJh/myjmEpISOjksmY2apAaKOUtmPWshAbNAESSYn1zk/SPtNUYyVvIXPdI L20Jc7QNfMAM/Ox/C8apjmoM0++ykWZk1d6pwRj72EsyBonpBel1ZHYZy+pHP/tBGki8 pksU6L9mlho1E/JP4TM0isVskWcst5zUQj/1GpFof22s3yKMcYG5pBQu1F5pHT+QMsh+ /Bi9UxMQotJwB24JPSndHBoQbZ6XbjvK+MykSnhNKzdQ+sgc+J4W2lj9SpBEYObj6w6Y y+mQ== X-RZG-AUTH: ":ImkWY2CseuihIZy6ZWWciR6unPhpN+aXzZGGjY6ptdusOaLnXzr3om3WkRTaB9I=" X-RZG-CLASS-ID: mo00 Received: from tesla.fritz.box by smtp.strato.de (RZmta 44.9 DYNA|AUTH) with ESMTPSA id f00a20v1IKmCjEa (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Mon, 18 Feb 2019 21:48:12 +0100 (CET) From: =?utf-8?q?Andr=C3=A9_Hentschel?= To: buildroot@buildroot.org Date: Mon, 18 Feb 2019 21:48:06 +0100 Message-Id: <20190218204807.16815-6-nerv@dawncrow.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190218204807.16815-1-nerv@dawncrow.de> References: <20190218204807.16815-1-nerv@dawncrow.de> MIME-Version: 1.0 Subject: [Buildroot] [PATCH/next v3 5/6] board/freescale/common/imx: Add support for i.MX8X 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: Erik Larsson , Fabio Estevam , =?utf-8?q?Andr=C3=A9_Hentschel?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: André Hentschel Signed-off-by: André Hentschel --- .../common/imx/genimage.cfg.template_imx8 | 2 +- .../common/imx/imx8-bootloader-prepare.sh | 20 ++++++++++++++----- board/freescale/common/imx/post-image.sh | 13 ++++++++++++ 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/board/freescale/common/imx/genimage.cfg.template_imx8 b/board/freescale/common/imx/genimage.cfg.template_imx8 index 2f8842f8e0..bd5f6cdc73 100644 --- a/board/freescale/common/imx/genimage.cfg.template_imx8 +++ b/board/freescale/common/imx/genimage.cfg.template_imx8 @@ -23,7 +23,7 @@ image sdcard.img { partition imx-boot { in-partition-table = "no" image = "imx8-boot-sd.bin" - offset = 33K + offset = %IMXOFFSET% } partition boot { diff --git a/board/freescale/common/imx/imx8-bootloader-prepare.sh b/board/freescale/common/imx/imx8-bootloader-prepare.sh index cc12666ae6..e98e93a857 100755 --- a/board/freescale/common/imx/imx8-bootloader-prepare.sh +++ b/board/freescale/common/imx/imx8-bootloader-prepare.sh @@ -7,12 +7,22 @@ main () echo "ERROR: couldn't find dtb: $UBOOT_DTB" exit 1 fi - cat ${BINARIES_DIR}/u-boot-spl.bin ${BINARIES_DIR}/lpddr4_pmu_train_fw.bin > ${BINARIES_DIR}/u-boot-spl-ddr.bin - BL31=${BINARIES_DIR}/bl31.bin BL33=${BINARIES_DIR}/u-boot.bin ${HOST_DIR}/bin/mkimage_fit_atf.sh ${UBOOT_DTB} > ${BINARIES_DIR}/u-boot.its - ${HOST_DIR}/bin/mkimage -E -p 0x3000 -f ${BINARIES_DIR}/u-boot.its ${BINARIES_DIR}/u-boot.itb - rm -f ${BINARIES_DIR}/u-boot.its - ${HOST_DIR}/bin/mkimage_imx8 -fit -signed_hdmi ${BINARIES_DIR}/signed_hdmi_imx8m.bin -loader ${BINARIES_DIR}/u-boot-spl-ddr.bin 0x7E1000 -second_loader ${BINARIES_DIR}/u-boot.itb 0x40200000 0x60000 -out ${BINARIES_DIR}/imx8-boot-sd.bin + if grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M=y$" ${BR2_CONFIG}; then + cat ${BINARIES_DIR}/u-boot-spl.bin ${BINARIES_DIR}/lpddr4_pmu_train_fw.bin > ${BINARIES_DIR}/u-boot-spl-ddr.bin + BL31=${BINARIES_DIR}/bl31.bin BL33=${BINARIES_DIR}/u-boot.bin ${HOST_DIR}/bin/mkimage_fit_atf.sh ${UBOOT_DTB} > ${BINARIES_DIR}/u-boot.its + ${HOST_DIR}/bin/mkimage -E -p 0x3000 -f ${BINARIES_DIR}/u-boot.its ${BINARIES_DIR}/u-boot.itb + rm -f ${BINARIES_DIR}/u-boot.its + + ${HOST_DIR}/bin/mkimage_imx8 -fit -signed_hdmi ${BINARIES_DIR}/signed_hdmi_imx8m.bin -loader ${BINARIES_DIR}/u-boot-spl-ddr.bin 0x7E1000 -second_loader ${BINARIES_DIR}/u-boot.itb 0x40200000 0x60000 -out ${BINARIES_DIR}/imx8-boot-sd.bin + else + ${HOST_DIR}/bin/mkimage_imx8 -commit > ${BINARIES_DIR}/mkimg.commit + cat ${BINARIES_DIR}/u-boot.bin ${BINARIES_DIR}/mkimg.commit > ${BINARIES_DIR}/u-boot-hash.bin + cp ${BINARIES_DIR}/bl31.bin ${BINARIES_DIR}/u-boot-atf.bin + dd if=${BINARIES_DIR}/u-boot-hash.bin of=${BINARIES_DIR}/u-boot-atf.bin bs=1K seek=128 + + ${HOST_DIR}/bin/mkimage_imx8 -soc QX -rev B0 -append ${BINARIES_DIR}/ahab-container.img -c -scfw ${BINARIES_DIR}/mx8qx-mek-scfw-tcm.bin -ap ${BINARIES_DIR}/u-boot-atf.bin a35 0x80000000 -out ${BINARIES_DIR}/imx8-boot-sd.bin + fi exit $? } diff --git a/board/freescale/common/imx/post-image.sh b/board/freescale/common/imx/post-image.sh index 6590beda3e..12a5bea73b 100755 --- a/board/freescale/common/imx/post-image.sh +++ b/board/freescale/common/imx/post-image.sh @@ -34,6 +34,8 @@ genimage_type() { if grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M=y$" ${BR2_CONFIG}; then echo "genimage.cfg.template_imx8" + elif grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X=y$" ${BR2_CONFIG}; then + echo "genimage.cfg.template_imx8" elif grep -Eq "^BR2_TARGET_UBOOT_SPL=y$" ${BR2_CONFIG}; then echo "genimage.cfg.template_spl" else @@ -41,6 +43,15 @@ genimage_type() fi } +imx_offset() +{ + if grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M=y$" ${BR2_CONFIG}; then + echo "33K" + else + echo "32K" + fi +} + uboot_image() { if grep -Eq "^BR2_TARGET_UBOOT_FORMAT_DTB_IMX=y$" ${BR2_CONFIG}; then @@ -53,11 +64,13 @@ uboot_image() main() { local FILES="$(dtb_list) $(linux_image)" + local IMXOFFSET="$(imx_offset)" local UBOOTBIN="$(uboot_image)" local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)" local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" sed -e "s/%FILES%/${FILES}/" \ + -e "s/%IMXOFFSET%/${IMXOFFSET}/" \ -e "s/%UBOOTBIN%/${UBOOTBIN}/" \ board/freescale/common/imx/$(genimage_type) > ${GENIMAGE_CFG}