From patchwork Fri Oct 22 21:43:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Ziswiler X-Patchwork-Id: 1545111 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HbdDC1VF2z9sSf for ; Sat, 23 Oct 2021 08:44:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8009E834E0; Fri, 22 Oct 2021 23:44:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ziswiler.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 94BE9834C5; Fri, 22 Oct 2021 23:44:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.perfora.net (mout.perfora.net [74.208.4.196]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 72C3683270 for ; Fri, 22 Oct 2021 23:44:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ziswiler.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=marcel@ziswiler.com Received: from toolbox.cardiotech.int ([194.191.235.54]) by mrelay.perfora.net (mreueus003 [74.208.5.2]) with ESMTPSA (Nemesis) id 0LsjTb-1mowTy3hDl-012JfZ; Fri, 22 Oct 2021 23:43:48 +0200 From: Marcel Ziswiler To: u-boot@lists.denx.de Cc: Adam Ford , Marcel Ziswiler , Fabio Estevam , Heiko Schocher , Heiko Thiery , Ilko Iliev , Jaehoon Chung , Jagan Teki , "NXP i.MX U-Boot Team" , Peng Fan , Rick Chen , Simon Glass , Stefano Babic , Teresa Remmet Subject: [PATCH v2] imx8mm_beacon: Switch to binman for generating image Date: Fri, 22 Oct 2021 23:43:40 +0200 Message-Id: <20211022214340.1214793-1-marcel@ziswiler.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:J/gV+CSDaUz0br6ioERrLY60DAnsOEiaOJKjhN4MiuDrMrRGFSF IDXxZCYpmE6YhsOAIL0MCMwqEIkHm64XDEiXICIeaGzNMIQDSN7Y3z2RXcFbVj53MU6Lloa UsR1ewj+dhGNcAmLwfqwGtP1eVPt3DrlH+TblE6c8WPo1LCm0bDc/FfYf4TmokBF5wHNRiO yiSBSF+s71wDmGtkonU0A== X-UI-Out-Filterresults: notjunk:1;V03:K0:02FyGADH/5E=:S/fuFFA2Vtv2S7TMRZQi3M nSiSsLyanVwCItv3ManC3LDf5fNHWVt8HUwkX62IhV/Avu84c5tutuBHRA7xg2TBGSTLqxbYO 3MdD19K6kUN3gPVuA64ZfHlDqs13F/lA4VmloBXFogHY5Ximm+7iEGI1jgoqjOI729IQgeXDr /GKptKRo/sYS8xjjzUZbKZXq0kt1eOXtcR8Zm/zCrK4jY+E78lpiv6keym7vwk2CYBnAkYiHl HzSRdy1JWGBHsIg1jSLpaKJjYpr2B7E/rWIqIwTAkp9f+uAA3S5K9ILD15TUInK5yvjZI01Cm /nFPTq/uO31JVJaGnmunxvcCm8jlPng/13jL047sn4OlrbCFlI4nXwA6w4PTU30Hkc4tAxim3 apB3W+51LzqF9Mrul/H7sw3djqTtUChbjRc7/tFrU3XGGQt+QIC88I4DKd08HpBqvgyEgp6xU /vrQitHbdMgSxPhZQI5WuZ8ObNmFMQh0DYzd75LVNi1xtmyV/Kyc+N8ZKAJblH3NVx9MqqeCv j5TnZAJb7+s+qUaK2xwBz8h7eKV70K1jTIG+UgacLt3k8WGVAdeWpVmXOeyhMnQywr6CgseY+ Gur0dlesS+Z/sr7KK2cNhnWNnVtKy3BLd2RAbh4owfS+95yCeUPRTu7KX26jr9UU7BHS05K6u PC5xAjZvYwaelK+4p37bXbAO7DJ/x2Snhhm5c4/L4tfA5BacAQ8EmFOLLadsgr+u/YcM= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean From: Adam Ford To eliminate a warning when using custom imx tools for generating a binary, use binman to generate flash.bin. Signed-off-by: Adam Ford Signed-off-by: Marcel Ziswiler Reviewed-by: Simon Glass --- Note that this re-base is only compile tested. Changes in v2: - Re-based on top of imx/master. arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi | 122 ++++++++++++++++++++ arch/arm/mach-imx/imx8m/Kconfig | 1 + board/beacon/imx8mm/Kconfig | 2 +- board/beacon/imx8mm/README | 6 +- board/beacon/imx8mm/imximage-8mm-lpddr4.cfg | 9 ++ configs/imx8mm_beacon_defconfig | 2 +- 6 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 board/beacon/imx8mm/imximage-8mm-lpddr4.cfg diff --git a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi index 73ddfdade6a..3c034a85e35 100644 --- a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi @@ -6,6 +6,10 @@ #include "imx8mm-u-boot.dtsi" / { + binman: binman { + multiple-images; + }; + wdt-reboot { compatible = "wdt-reboot"; wdt = <&wdog1>; @@ -100,3 +104,121 @@ &wdog1 { u-boot,dm-spl; }; + +&binman { + u-boot-spl-ddr { + filename = "u-boot-spl-ddr.bin"; + pad-byte = <0xff>; + align-size = <4>; + align = <4>; + + u-boot-spl { + align-end = <4>; + }; + + blob_1: blob-ext@1 { + filename = "lpddr4_pmu_train_1d_imem.bin"; + size = <0x8000>; + }; + + blob_2: blob-ext@2 { + filename = "lpddr4_pmu_train_1d_dmem.bin"; + size = <0x4000>; + }; + + blob_3: blob-ext@3 { + filename = "lpddr4_pmu_train_2d_imem.bin"; + size = <0x8000>; + }; + + blob_4: blob-ext@4 { + filename = "lpddr4_pmu_train_2d_dmem.bin"; + size = <0x4000>; + }; + }; + + spl { + filename = "spl.bin"; + + mkimage { + args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000"; + + blob { + filename = "u-boot-spl-ddr.bin"; + }; + }; + }; + + itb { + filename = "u-boot.itb"; + + fit { + description = "Configuration to load ATF before U-Boot"; + #address-cells = <1>; + fit,external-offset = ; + + images { + uboot { + description = "U-Boot (64-bit)"; + type = "standalone"; + arch = "arm64"; + compression = "none"; + load = ; + + uboot_blob: blob-ext { + filename = "u-boot-nodtb.bin"; + }; + }; + + atf { + description = "ARM Trusted Firmware"; + type = "firmware"; + arch = "arm64"; + compression = "none"; + load = <0x920000>; + entry = <0x920000>; + + atf_blob: blob-ext { + filename = "bl31.bin"; + }; + }; + + fdt { + description = "NAME"; + type = "flat_dt"; + compression = "none"; + + uboot_fdt_blob: blob-ext { + filename = "u-boot.dtb"; + }; + }; + }; + + configurations { + default = "conf"; + + conf { + description = "NAME"; + firmware = "uboot"; + loadables = "atf"; + fdt = "fdt"; + }; + }; + }; + }; + + imx-boot { + filename = "flash.bin"; + pad-byte = <0x00>; + + spl: blob-ext@1 { + offset = <0x0>; + filename = "spl.bin"; + }; + + uboot: blob-ext@2 { + offset = <0x57c00>; + filename = "u-boot.itb"; + }; + }; +}; diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig index 276b8bd9742..a2822f8c28f 100644 --- a/arch/arm/mach-imx/imx8m/Kconfig +++ b/arch/arm/mach-imx/imx8m/Kconfig @@ -117,6 +117,7 @@ config TARGET_VERDIN_IMX8MM config TARGET_IMX8MM_BEACON bool "imx8mm Beacon Embedded devkit" + select BINMAN select IMX8MM select SUPPORT_SPL select IMX8M_LPDDR4 diff --git a/board/beacon/imx8mm/Kconfig b/board/beacon/imx8mm/Kconfig index 58799c1a655..63f064e8cb8 100644 --- a/board/beacon/imx8mm/Kconfig +++ b/board/beacon/imx8mm/Kconfig @@ -10,7 +10,7 @@ config SYS_CONFIG_NAME default "imx8mm_beacon" config IMX_CONFIG - default "arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg" + default "board/beacon/imx8mm/imximage-8mm-lpddr4.cfg" source "board/freescale/common/Kconfig" diff --git a/board/beacon/imx8mm/README b/board/beacon/imx8mm/README index dce176fa0b2..03d9412f0d6 100644 --- a/board/beacon/imx8mm/README +++ b/board/beacon/imx8mm/README @@ -12,8 +12,8 @@ Get and Build the ARM Trusted firmware Note: $(srctree) is U-Boot source directory $ git clone https://source.codeaurora.org/external/imx/imx-atf -$ git checkout imx_4.19.35_1.0.0 -$ make PLAT=imx8mm bl31 ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- +$ git checkout imx_5.4.70_2.3.0 +$ make PLAT=imx8mm bl31 CROSS_COMPILE=aarch64-linux-gnu- $ cp build/imx8mm/release/bl31.bin $(srctree) Get the DDR firmware @@ -26,7 +26,7 @@ $ cp firmware-imx-8.5/firmware/ddr/synopsys/lpddr4*.bin $(srctree) Build U-Boot ============ $ make imx8mm_beacon_defconfig -$ make flash.bin CROSS_COMPILE=aarch64-linux-gnu- ATF_LOAD_ADDR=0x920000 +$ make flash.bin CROSS_COMPILE=aarch64-linux-gnu- Burn U-Boot to microSD Card =========================== diff --git a/board/beacon/imx8mm/imximage-8mm-lpddr4.cfg b/board/beacon/imx8mm/imximage-8mm-lpddr4.cfg new file mode 100644 index 00000000000..90573be5fd9 --- /dev/null +++ b/board/beacon/imx8mm/imximage-8mm-lpddr4.cfg @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2021 NXP + */ + +#define __ASSEMBLY__ + +BOOT_FROM sd +LOADER u-boot-spl-ddr.bin 0x7E1000 diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig index 02cdeda23e5..9d6af69ba15 100644 --- a/configs/imx8mm_beacon_defconfig +++ b/configs/imx8mm_beacon_defconfig @@ -21,7 +21,7 @@ CONFIG_SYS_LOAD_ADDR=0x40480000 CONFIG_FIT=y CONFIG_FIT_EXTERNAL_OFFSET=0x3000 CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_SYSTEM_SETUP=y CONFIG_DEFAULT_FDT_FILE="imx8mm-beacon-kit.dtb" CONFIG_SPL_BOARD_INIT=y