From patchwork Fri Jul 22 14:16:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Suvorov X-Patchwork-Id: 1659598 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=foundries.io header.i=@foundries.io header.a=rsa-sha256 header.s=google header.b=iNQyOHah; dkim-atps=neutral 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 (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LqBN42s2Dz9sGq for ; Sat, 23 Jul 2022 00:17:23 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0B0A483FA1; Fri, 22 Jul 2022 16:16:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io 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=foundries.io header.i=@foundries.io header.b="iNQyOHah"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8F0F383FB2; Fri, 22 Jul 2022 16:16:29 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (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 A0E4E83FA1 for ; Fri, 22 Jul 2022 16:16:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=oleksandr.suvorov@foundries.io Received: by mail-wm1-x32f.google.com with SMTP id b21-20020a05600c4e1500b003a32bc8612fso2584371wmq.3 for ; Fri, 22 Jul 2022 07:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=QEcOZ6UFsohbA3i3FenAAYQDhbJwlbtc2EJCfDW5LjY=; b=iNQyOHahzU1flAzJsEDaYKwwEktpqzwN4U2TayUFLRBIHBdN7xCFsjs0CdpdLk1uVV P99l3j8IQYwxeO8oqwRxTvELevPb45SGSpF9dk9kPWyiUOuAcEKeATAYX2FUxGjskuFW RjmHetRQyFglaxlsBT1QGK7uKDF+B/vHZSmZrGs2wvNhHL1h4IyS2lhKiIFEb3oqshBk uHoDv3dsfterG+of2C5Fq128ufcCGve1tJd8b/+n3f1Y625FENYFMQzJcHjot8R/X0wS mbCZLHViqZ0EXKo8P8jwbce1HNP3indj8L12y+iWIcLLg3WZ2I5qXev5h7aZRzrVytND 089A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=QEcOZ6UFsohbA3i3FenAAYQDhbJwlbtc2EJCfDW5LjY=; b=2cKH/iqO6iDczsIVruBdRbzmuwd3qzFkflKERAlRc4NMfcWVnN2+D1ovhVYQBF1xux Kv8nD4zIrFYNGKDi9F/edZS0BmDV7/Z3iL1astNn4AwEmJDHcRrbBSN5smOAv0bPsC7y YetuJGYpSBhwLEwcbPh/uoRyxRvqFpGVnQkoz2Ev9iCHlg3Zme+I6gBzQMPbuFrhsURh oGSaG2S6vh28ypXvvrU1/do/162usEYkfjhcxunQZrlpLB0hiqiX1trbwXFvb3y64s7g wc1miL7ec7LxaWa26B5CUr16e0gCEy5UoYhKaaaIxp+7sNH7Kax3JpnCfKFzjALAN0KW XDiA== X-Gm-Message-State: AJIora+T4BfwbaQQcwZ/NfHCSKz2jAo5ZtLXExia0KR6NOZj/7l6oYwp XWqwiuU/Jkk95UYOUlQ9dkmZ10PbQchDQA== X-Google-Smtp-Source: AGRyM1t11dhOlU6OIXueNbgb3c/FQIerXA5Ob8AK7ceECRUt44o4B8pQVWPwa4NoEzHSHoCUPVPeyA== X-Received: by 2002:a05:600c:22c2:b0:3a3:19e3:a55 with SMTP id 2-20020a05600c22c200b003a319e30a55mr12771565wmg.53.1658499384770; Fri, 22 Jul 2022 07:16:24 -0700 (PDT) Received: from cryobook.. ([89.105.248.137]) by smtp.gmail.com with ESMTPSA id d13-20020adf9c8d000000b0021e4c3b2967sm4855364wre.65.2022.07.22.07.16.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 07:16:24 -0700 (PDT) From: Oleksandr Suvorov To: u-boot@lists.denx.de Cc: Michal Simek , Adrian Fiergolski , Ricardo Salveti , Jorge Ramirez-Ortiz , Igor Opaniuk , Oleksandr Suvorov , Michal Simek Subject: [PATCH v12 04/13] fpga: zynqmp: add str2flags call Date: Fri, 22 Jul 2022 17:16:05 +0300 Message-Id: <20220722141614.297383-5-oleksandr.suvorov@foundries.io> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220722141614.297383-4-oleksandr.suvorov@foundries.io> References: <20220722141614.297383-1-oleksandr.suvorov@foundries.io> <20220722141614.297383-2-oleksandr.suvorov@foundries.io> <20220722141614.297383-3-oleksandr.suvorov@foundries.io> <20220722141614.297383-4-oleksandr.suvorov@foundries.io> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Add a call to convert FPGA "compatible" string to a binary flag. Signed-off-by: Oleksandr Suvorov Tested-by: Ricardo Salveti Tested-by: Adrian Fiergolski --- (no changes since v1) drivers/fpga/zynqmppl.c | 11 ++++++++++- include/xilinx.h | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/fpga/zynqmppl.c b/drivers/fpga/zynqmppl.c index 8ff12bf50a0..19d079c9d9f 100644 --- a/drivers/fpga/zynqmppl.c +++ b/drivers/fpga/zynqmppl.c @@ -304,10 +304,19 @@ static int zynqmp_pcap_info(xilinx_desc *desc) return ret; } +static int __maybe_unused zynqmp_str2flag(xilinx_desc *desc, const char *str) +{ + if (!strncmp(str, "u-boot,fpga-legacy", 18)) + return FPGA_LEGACY; + + return 0; +} + struct xilinx_fpga_op zynqmp_op = { .load = zynqmp_load, + .info = zynqmp_pcap_info, #if CONFIG_IS_ENABLED(FPGA_LOAD_SECURE) .loads = zynqmp_loads, + .str2flag = zynqmp_str2flag, #endif - .info = zynqmp_pcap_info, }; diff --git a/include/xilinx.h b/include/xilinx.h index d9e4b8da968..ff5486d98a7 100644 --- a/include/xilinx.h +++ b/include/xilinx.h @@ -60,6 +60,9 @@ struct xilinx_fpga_op { struct fpga_secure_info *fpga_sec_info); int (*dump)(xilinx_desc *desc, const void *buf, size_t bsize); int (*info)(xilinx_desc *desc); +#if CONFIG_IS_ENABLED(FPGA_LOAD_SECURE) + int (*str2flag)(xilinx_desc *desc, const char *string); +#endif }; /* Generic Xilinx Functions