From patchwork Tue Jan 9 21:01:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Spinrath X-Patchwork-Id: 857730 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zGPj03y0Rz9s0g for ; Wed, 10 Jan 2018 08:02:11 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 9EABAC22056; Tue, 9 Jan 2018 21:02:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id DDFB6C21FB1; Tue, 9 Jan 2018 21:01:57 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3DD3BC21F88; Tue, 9 Jan 2018 21:01:56 +0000 (UTC) Received: from mail-out-1.itc.rwth-aachen.de (mail-out-1.itc.rwth-aachen.de [134.130.5.46]) by lists.denx.de (Postfix) with ESMTPS id C73A8C21FA6 for ; Tue, 9 Jan 2018 21:01:55 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BSBwDtLFVa/6EagoZeHAEBAQQBAQoBAYMQMIIBB50CgVsnmUMKhTsChDpDFAEBAQEBAQEBAWsohSQGeRAgMT0aBgENBYoxBLE+ijgBAQEBAQEEAQEBAQEBAQEgCQGEFoIVg2kMhimBN4YzBZImkTmBFqBFh29IliQCAgICCQIagTw2IoFQcIJ7hFh3iGiBNAGBFgEBAQ X-IPAS-Result: A2BSBwDtLFVa/6EagoZeHAEBAQQBAQoBAYMQMIIBB50CgVsnmUMKhTsChDpDFAEBAQEBAQEBAWsohSQGeRAgMT0aBgENBYoxBLE+ijgBAQEBAQEEAQEBAQEBAQEgCQGEFoIVg2kMhimBN4YzBZImkTmBFqBFh29IliQCAgICCQIagTw2IoFQcIJ7hFh3iGiBNAGBFgEBAQ X-IronPort-AV: E=Sophos;i="5.46,336,1511823600"; d="scan'208";a="32844365" Received: from rwthex-s3-b.rwth-ad.de ([134.130.26.161]) by mail-in-1.itc.rwth-aachen.de with ESMTP; 09 Jan 2018 22:01:55 +0100 Received: from snowflake.lan (37.24.154.84) by rwthex-s3-b.rwth-ad.de (2002:8682:1aa1::8682:1aa1) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Tue, 9 Jan 2018 22:01:51 +0100 From: To: , , Date: Tue, 9 Jan 2018 22:01:36 +0100 X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180109210136.561-1-christopher.spinrath@rwth-aachen.de> References: <20180109210136.561-1-christopher.spinrath@rwth-aachen.de> MIME-Version: 1.0 X-Originating-IP: [37.24.154.84] X-ClientProxiedBy: rwthex-s2-a.rwth-ad.de (2002:8682:1a9a::8682:1a9a) To rwthex-s3-b.rwth-ad.de (2002:8682:1aa1::8682:1aa1) Message-ID: Cc: u-boot@lists.denx.de, christopher.spinrath@rwth-aachen.de Subject: [U-Boot] [PATCH 2/2] ARM: imx: cm_fx6: env: try to determine dtb to use X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" From: Christopher Spinrath Some distributions like Fedora expect U-Boot to select a proper devicetree. Since there are several variants of the cm-fx6 module featuring different SoC variants and the module can be paired with several baseboards, it is not viable to hardcode a filename. Instead, follow the lead of other i.MX6 based devices and try to determine the devicetree to use with the help of the board name and the SoC variant exported by the board code, before calling the distro bootcommand. For now, only for the Utilite Pro a proper devicetree filename is known but further variants of the Utilite Computer or other devices based on the cm-fx6 module may be added in the future. Signed-off-by: Christopher Spinrath --- configs/cm_fx6_defconfig | 2 +- include/configs/cm_fx6.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configs/cm_fx6_defconfig b/configs/cm_fx6_defconfig index 33e610ccb4..6b1c0a823c 100644 --- a/configs/cm_fx6_defconfig +++ b/configs/cm_fx6_defconfig @@ -16,7 +16,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" CONFIG_BOOTDELAY=3 -CONFIG_BOOTCOMMAND="run distro_bootcmd; run legacy_bootcmd" +CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd; run legacy_bootcmd" CONFIG_SPL=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x80 CONFIG_SPL_I2C_SUPPORT=y diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h index cb71ea8811..da870b9baa 100644 --- a/include/configs/cm_fx6.h +++ b/include/configs/cm_fx6.h @@ -76,6 +76,7 @@ "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ + "fdtfile=undefined\0" \ "stdin=serial,usbkbd\0" \ "stdout=serial,vga\0" \ "stderr=serial,vga\0" \ @@ -153,6 +154,11 @@ "fi;" \ "run setupnandboot;" \ "run nandboot;\0" \ + "findfdt="\ + "if test $board_name = Utilite && test $board_rev = MX6Q ; then " \ + "setenv fdtfile imx6q-utilite-pro.dtb; fi; " \ + "if test $fdtfile = undefined; then " \ + "echo WARNING: Could not determine dtb to use; fi; \0" \ BOOTENV #define CONFIG_PREBOOT "usb start;sf probe"