From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6647CC433FE for ; Wed, 8 Sep 2021 00:00:21 +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 C439761102 for ; Wed, 8 Sep 2021 00:00:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C439761102 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 2E041832CD; Wed, 8 Sep 2021 02:00:00 +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="krWHpz7z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BFA40832E6; Wed, 8 Sep 2021 01:59:47 +0200 (CEST) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (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 9688F82BD6 for ; Wed, 8 Sep 2021 01:59:42 +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-qk1-x729.google.com with SMTP id f22so698908qkm.5 for ; Tue, 07 Sep 2021 16:59:42 -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=MZAQJMoasjYlXXMzi5SrC0kH6PXquC465hHW6vsg/tU=; b=krWHpz7zSdXuNjTAkpJbxT363KRuW7sm9+rgT8LQtquvqs0R8BYEPlxitA7GMw8iC6 JVwcxC/0khtIa+JvSEL02IbJkk10CCsmhwLT+iSHQr4Rbs8EdOSjZWttk0Aj4v9R8CIV xsBrAj8fR19DTcVkPWAddQ5Q+Q8U9b49s2jwJhI+sk1cTlDlpOAhBgLYWDJuiPctmUM+ i+7F6snlve685rs543vh9CMZb+Adz+xkNwuYbdyRp4OR1XtDesdhEdCqxjpsIhGG3Ln+ E6zLploZnQbnvI8gRdugDHxDteyAwiZQuBP4xC23kFWlWwXyvHqy2Cy/rKNxBlwz76f0 /1Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MZAQJMoasjYlXXMzi5SrC0kH6PXquC465hHW6vsg/tU=; b=grEIhe54L4l+6haHZJoHZGTiqUsrRzvHGgh7NnmGOJ9jSTVUz9h+OjT66SYDid3ztM jRgFEN2YMwingndYgWOapAXfkXawKATUDAE9IRUy6jPx89qvn1wPE61uIEEEHTK27lyN rbfRJtP3nETg+pU3u4upx7Q9Ud/0uc3XRI59edLGzWV+gMx1CyylVmg9U1uAD+lRx4+X LRn1eP1YYGB5FwDL9zlroBlHGdovhfspWIlVznLIqqU0JXA21S7ifvTffXc1DdKikQf9 k1f6lzZKbmx5yK5TdudWKIrezPYnhbvFu/Wmi07IHEf40EtzrKKw3HyJwjNkCyRNbmFa ypcw== X-Gm-Message-State: AOAM532ZehWr0ey7AXdcEATeR79GmKfFY042Z886lQotx0+cebeKzM5c 2MD77+cU3ARUazBLikY9GDo5Yo9LVcE= X-Google-Smtp-Source: ABdhPJyYGeoZ3dT/Zu+2lqf5fJGCbZsCG/VvxlBNQF7mcK1H2vteuoF1LAjBy/YzKkBZuqGxKvGRGg== X-Received: by 2002:a37:a58b:: with SMTP id o133mr861141qke.120.1631059181097; Tue, 07 Sep 2021 16:59:41 -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 d78sm460351qkg.92.2021.09.07.16.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 16:59:40 -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 v2 04/11] board: stm32mp1: Implement board_fit_config_name_match() for SPL Date: Tue, 7 Sep 2021 18:59:26 -0500 Message-Id: <20210907235933.2798330-5-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210907235933.2798330-1-mr.nuke.me@gmail.com> References: <20210907235933.2798330-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 921d0190e0..7542ee52c9 100644 --- a/board/st/stm32mp1/spl.c +++ b/board/st/stm32mp1/spl.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -92,3 +93,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