Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2863C433F5 for ; Fri, 8 Oct 2021 19:57:38 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DB98261073 for ; Fri, 8 Oct 2021 19:57:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DB98261073 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F12AA8362D; Fri, 8 Oct 2021 21:57:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="i9HqvgRE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2EB93833D4; Fri, 8 Oct 2021 21:57:10 +0200 (CEST) Received: from mail-oo1-xc2c.google.com (mail-oo1-xc2c.google.com [IPv6:2607:f8b0:4864:20::c2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 09FB7833D4 for ; Fri, 8 Oct 2021 21:57:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mr.nuke.me@gmail.com Received: by mail-oo1-xc2c.google.com with SMTP id u5-20020a4ab5c5000000b002b6a2a05065so2109699ooo.0 for ; Fri, 08 Oct 2021 12:57:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0JdfSbgr9U20G5C5Z+VGkGDDdIeG6Do3l95a2qSROEc=; b=i9HqvgREKHMgsWGMafmf8+z3PJe8LAoD+E0PeDknxT97ie2ZM5vLRGeTk0xnv0CXV/ QVLkTR8WG5Scxx6R5tj4DwDnWzPNAKu+xnJRhvvKNiqv48xAgnq5XHL76ce/88iwwUmy Y8rrL23N5woy52X8l+78AhQ0jcjI7j6wAQEucBg//TqijjL/hillQ+8d2CfYq1RDxIzV +zPUxu597lomOP2JV47QiLl/69DEtcXw2i42lRuYrp9NAe2HqP9vasCuEsFl0FBOEp7O Tdtni5l8fWFURlwKTJ62Mu8weRFDpKqzgidsOvdrnvCct/IvFhf40JieyrYD68JW0TR8 mnrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0JdfSbgr9U20G5C5Z+VGkGDDdIeG6Do3l95a2qSROEc=; b=IORYRjrz/0J6aiCOpBNtdPSSDxVl9twmuuy7/RNYKkB8zOsdevNuCout6T0LAJh2bb sbNMYG2UA4fYL6HEuvYH6o2fNV/zSFN4y1ounMtt0ojFTJtZRuQ+cvMRAIf8kmpfYnIB 8VRrY+o6l3IqvIZELb2rKf2sBa8b7VtGno7sfJHK1NwFlLXOBtZ99aOB4+J8ctH8Y+rR 6ukoTKI9InLi0O/kKq/DuF3hAKghgHjaqXq2bsP3calnt2rLQVTuLjCEuV0APpGyApF6 pSNVhLcZYGBr3roVnaqezIhcMvJLkzuqulmkyNg+JqC3jD1UHFsITQLZV+cyiEg5NE2l /QJw== X-Gm-Message-State: AOAM531EjgBG0VyyOy4r8iwGWnuqZibyMvWMn+ncFaZgVirGm5bly7HN LL1NQ6D81yvO/0B6tA0MjbjjzfiOdHU= X-Google-Smtp-Source: ABdhPJxr9mZG9PIyF1KfA5CVa1Dt5waJrQ803Uu5mylabfcU9aupOv7cSEzHYQpeFx+IATrlmSDInA== X-Received: by 2002:a05:6820:44f:: with SMTP id p15mr9372478oou.51.1633723024429; Fri, 08 Oct 2021 12:57:04 -0700 (PDT) Received: from nuclearis3.lan (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id x8sm67409otg.31.2021.10.08.12.57.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 12:57:03 -0700 (PDT) From: Alexandru Gagniuc To: u-boot@lists.denx.de, uboot-stm32@st-md-mailman.stormreply.com, patrick.delaunay@foss.st.com Cc: Alexandru Gagniuc , patrice.chotard@foss.st.com, etienne.carriere@linaro.org Subject: [PATCH v3 05/13] board: stm32mp1: Implement board_fit_config_name_match() for SPL Date: Fri, 8 Oct 2021 14:56:47 -0500 Message-Id: <20211008195655.46046-6-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211008195655.46046-1-mr.nuke.me@gmail.com> References: <20211008195655.46046-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This function is needed when loading a FIT image from SPL. It selects the correct configuration node for the current board. Implement it. Signed-off-by: Alexandru Gagniuc --- board/st/stm32mp1/spl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/board/st/stm32mp1/spl.c b/board/st/stm32mp1/spl.c index ea2f809245..01aa5e51c5 100644 --- a/board/st/stm32mp1/spl.c +++ b/board/st/stm32mp1/spl.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -82,3 +83,16 @@ void board_debug_uart_init(void) #endif } #endif + +int board_fit_config_name_match(const char *name) +{ + const void *compatible; + + compatible = fdt_getprop(gd->fdt_blob, 0, "compatible", NULL); + + /* only STM boards are supported (currently) */ + if (strncmp(compatible, "st,", 3) != 0) + return 1; + + return !strstr(name, compatible + 3); +} -- 2.31.1