From patchwork Sat Jun 11 22:06:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Suvorov X-Patchwork-Id: 1642478 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=QR6OhmwK; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4LLBm14SyBz9s07 for ; Sun, 12 Jun 2022 08:08:01 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9DC7C84425; Sun, 12 Jun 2022 00:07:18 +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="QR6OhmwK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CC20D84417; Sun, 12 Jun 2022 00:07:07 +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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) (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 3C51F84418 for ; Sun, 12 Jun 2022 00:07:05 +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-lf1-x136.google.com with SMTP id a2so3549831lfg.5 for ; Sat, 11 Jun 2022 15:07:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G3Va15sY4w2Le+oWEUdJwwU5A9z5Cml6ukBkaA+45pc=; b=QR6OhmwKy+krxugvxx5pveqie502kt6znV/nr2s8vR8fvZT9vWmDf/Qdu+8mSSczi3 EEtqCjCpNGwt+LzoDUurCvIc7FmomGmRu1zlqFpOUslXhnRwroewDDjt7d+XgaDxeYoN mSiTi3HQQXtw1MhoqCOoc1VwQuEOG70QuT2hplR7ECEqvQ5SzfO+QPrJvRjj6j0sut3S M6SFr7D6U5lQfQ7xZnUdDKAdj8/5kBuzTscEWvvpT1u372YyTPd1mZPxYmLvN/hr6gr/ ylrNqubfzWtVecWeSqMp8jsZL39dERyHJbahuV5aFfXKaTyTAkXgWm+r63i96vRw4ySi 0+Pw== 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=G3Va15sY4w2Le+oWEUdJwwU5A9z5Cml6ukBkaA+45pc=; b=bNL6cjg8H18mE5fCgiORucofj+O7W00DHK5/C+x34ktmtLLVkEY74OqaR3vAibkqLq e6odaI0YHdIEpNqVFPYzzdlcPLQ8PcWzzmIpMedYCBNo+q+b6bAVEamkB6cV7uqoXAi/ UOlzY8p9roLGX0yL3wOvoSceFmGTkrC3PAvIDyDce/Oj69aKWzHXa+R8zsCJya1Kow6G U1dXWo1NRD9o+s1cE2tPo/1emCpRes4dzAEwPj5dUQ8u0diJdtFs5DW5HsT07Y4aPtzw Se02ScARuUBj6x7aXr9Bps//NEH8joxzNbuOoEuKuj6lC7pVD1pOV7FaCQAiFTLgm7cc 8DfA== X-Gm-Message-State: AOAM5323WhK+2mtjIC2V9dAo6WIykAXzugGXgptExM/4eRlJFW9m8pjp f9ADzC1Jt1rq6scI25r1aL1T6kL4roE3dA== X-Google-Smtp-Source: ABdhPJynCPhlCEjcU3223ZPYip34fNU/fv9g1qCu2qiJdHEolbjWu2BLMNJ1tfMhnwjXKxmdc0d6PQ== X-Received: by 2002:a05:6512:130c:b0:477:e2ea:396e with SMTP id x12-20020a056512130c00b00477e2ea396emr74986722lfu.489.1654985224261; Sat, 11 Jun 2022 15:07:04 -0700 (PDT) Received: from cryobook.. ([93.188.34.55]) by smtp.gmail.com with ESMTPSA id c30-20020a2ebf1e000000b0025583eb9becsm433623ljr.69.2022.06.11.15.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jun 2022 15:07:03 -0700 (PDT) From: Oleksandr Suvorov To: u-boot@lists.denx.de Cc: Adrian Fiergolski , Ricardo Salveti , Jorge Ramirez-Ortiz , Michal Simek , Igor Opaniuk , Oleksandr Suvorov , Michal Simek Subject: [PATCH v10 04/13] fpga: zynqmp: add str2flags call Date: Sun, 12 Jun 2022 01:06:45 +0300 Message-Id: <20220611220654.103236-5-oleksandr.suvorov@foundries.io> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220611220654.103236-4-oleksandr.suvorov@foundries.io> References: <20220611220654.103236-1-oleksandr.suvorov@foundries.io> <20220611220654.103236-2-oleksandr.suvorov@foundries.io> <20220611220654.103236-3-oleksandr.suvorov@foundries.io> <20220611220654.103236-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.5 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 --- (no changes since v1) drivers/fpga/zynqmppl.c | 9 +++++++++ include/xilinx.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/fpga/zynqmppl.c b/drivers/fpga/zynqmppl.c index 8ff12bf50a0..0ffcff0c148 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 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, #if CONFIG_IS_ENABLED(FPGA_LOAD_SECURE) .loads = zynqmp_loads, #endif .info = zynqmp_pcap_info, + .str2flag = zynqmp_str2flag, }; diff --git a/include/xilinx.h b/include/xilinx.h index d9e4b8da968..91179abe31f 100644 --- a/include/xilinx.h +++ b/include/xilinx.h @@ -60,6 +60,7 @@ 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); + int (*str2flag)(xilinx_desc *desc, const char *string); }; /* Generic Xilinx Functions