From patchwork Mon Jan 20 12:20:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 1225912 X-Patchwork-Delegate: sr@denx.de 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tkos.co.il 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 481W4t2R9bz9sRf for ; Mon, 20 Jan 2020 23:22:06 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 99CF3819B9; Mon, 20 Jan 2020 13:20:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tkos.co.il 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 99CD381997; Mon, 20 Jan 2020 13:20:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=KHOP_HELO_FCRDNS, SPF_HELO_NONE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from mx.tkos.co.il (guitar.tcltek.co.il [192.115.133.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 56C5981861 for ; Mon, 20 Jan 2020 13:20:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tkos.co.il Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=baruch@tkos.co.il Received: from tarshish.tkos.co.il (unknown [10.0.8.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPS id 5E7A94408BD; Mon, 20 Jan 2020 14:20:30 +0200 (IST) From: Baruch Siach To: u-boot@lists.denx.de, Stefan Roese Subject: [PATCH v2 08/10] ARM: mvebu: clearfog: run-time selection of DT file Date: Mon, 20 Jan 2020 14:20:13 +0200 Message-Id: X-Mailer: git-send-email 2.24.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Baruch Siach , Dennis Gilmore , Chris Packham Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean Set the kernel device-tree file (fdtfile environment variable) based on run-time detection of the platform. Reviewed-by: Stefan Roese Signed-off-by: Baruch Siach --- arch/arm/mach-mvebu/Kconfig | 1 + board/solidrun/clearfog/clearfog.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig index fdd39685b75d..bc5eaa5a7679 100644 --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig @@ -91,6 +91,7 @@ choice config TARGET_CLEARFOG bool "Support ClearFog" select 88F6820 + select BOARD_LATE_INIT config TARGET_HELIOS4 bool "Support Helios4" diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c index 8050cca55ab7..e178b06cd34d 100644 --- a/board/solidrun/clearfog/clearfog.c +++ b/board/solidrun/clearfog/clearfog.c @@ -175,3 +175,17 @@ int board_eth_init(bd_t *bis) cpu_eth_init(bis); /* Built in controller(s) come first */ return pci_eth_init(bis); } + +int board_late_init(void) +{ + cf_read_tlv_data(); + + if (sr_product_is(&cf_tlv_data, "Clearfog Base")) + env_set("fdtfile", "armada-388-clearfog-base.dtb"); + else if (sr_product_is(&cf_tlv_data, "Clearfog GTR S4")) + env_set("fdtfile", "armada-385-clearfog-gtr-s4.dtb"); + else if (sr_product_is(&cf_tlv_data, "Clearfog GTR L8")) + env_set("fdtfile", "armada-385-clearfog-gtr-l8.dtb"); + + return 0; +}