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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C838C433EF for ; Fri, 15 Oct 2021 08:57:26 +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 A444061053 for ; Fri, 15 Oct 2021 08:57:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A444061053 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=foundries.io 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 4957783692; Fri, 15 Oct 2021 10:57:22 +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="WLXCpC5h"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 152A583689; Fri, 15 Oct 2021 10:57:20 +0200 (CEST) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (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 26BE283689 for ; Fri, 15 Oct 2021 10:57:16 +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=jorge@foundries.io Received: by mail-wr1-x42f.google.com with SMTP id r18so25265007wrg.6 for ; Fri, 15 Oct 2021 01:57:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Pf4nJCk7aA6BHmZNWSVprn8iZxDJFrYktIIRAjNjGkU=; b=WLXCpC5hFVYnZTw3gDBCpszLOokvo0gpDXsUjq9itKIopF5EPiS+a5frnPVoK/IhKT NPlV/wUr48fBygMWhz6oq3oVI5K0G6hQGoZp1Ytv4hSHwQqEbamv6+z6pYfBdBfT6pJN qBwiI2+Pom4zNZWjpKsyBYORbS2dvNwetirxfaHB1YZ6EPPL5Gf11c1MREsp5L+x2MJu 9Ko6PYWiiEZo9KmobcXA9LzEeptSfQ1D72XvfurM1G/6GMaOrruTLOy039hD6rKub1zF cKX3VS84ui6d7QZ/WVPKblK5q067HyZoOjbIOgZ+FbzUsZ6bd36vXWvojumqDtZJRkWn 7FhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Pf4nJCk7aA6BHmZNWSVprn8iZxDJFrYktIIRAjNjGkU=; b=XW0AvLSKrGt0vMjnPSZR0dPOoNNqBxxUZUJaiJXmAx7EW1lym4LBWx92oHN9uPg/lV Z8K84toz5ee+7c4EP/sTlbFeWOEPOJsbCUoiKIcohUaMaBtursVY5H/+otbXwy6DViVi DbczfyOGzR2cWVGnjqEsgofllWUQISroOQOqzWcuwitv3xPUGKpD4ovTwaiE3b9R2m3A MXk3frx+T9ef/NZ1L151PwWksUFkhrYByp0Nyme7/HZu7ek39XFzwCton7evasNCLNoK PaUEajzx0L4CgOf1uyCu7Xgb0U2KXAPX3iRC3UuTIj0AeLaKrHLWFmxlElECLawvC7ws DFiA== X-Gm-Message-State: AOAM532k57RdMzRi0NRZZsXxtpANsZ1J9reUz+qVTqU1fKU/gLbNgVN0 b5dlLHLBLxluhYUU+tHdEFZCnA== X-Google-Smtp-Source: ABdhPJxP4anLh70GPL39lMwwGC8Tbr+3AwdeTesQ3i2qk7hziVbRoPbweLFQC5gOCidtUlMpp77v4w== X-Received: by 2002:adf:8b84:: with SMTP id o4mr12747442wra.108.1634288235702; Fri, 15 Oct 2021 01:57:15 -0700 (PDT) Received: from trex (60.red-83-35-113.dynamicip.rima-tde.net. [83.35.113.60]) by smtp.gmail.com with ESMTPSA id k6sm4586102wri.83.2021.10.15.01.57.14 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Oct 2021 01:57:15 -0700 (PDT) From: "Jorge Ramirez-Ortiz, Foundries" X-Google-Original-From: "Jorge Ramirez-Ortiz, Foundries" Date: Fri, 15 Oct 2021 10:57:13 +0200 To: Simon Glass , oleksandr.suvorov@foundries.io Cc: Jorge Ramirez-Ortiz , Michal Simek , Tom Rini , Alexandru Gagniuc , U-Boot Mailing List , Ricardo Salveti , Michael Scott , Igor Opaniuk Subject: Re: [RFC PATCH 1/2] fpga_load: pass compatible string Message-ID: <20211015085713.GA469@trex> References: <20211005111324.19749-1-jorge@foundries.io> <20211005111324.19749-2-jorge@foundries.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) 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 On 14/10/21, Simon Glass wrote: > Hi Jorge, > > On Tue, 5 Oct 2021 at 05:13, Jorge Ramirez-Ortiz wrote: > > > > Instead of ignoring the mandatory fpga compatible string, let the > > different implementations decide how to handle it > > > > Signed-off-by: Jorge Ramirez-Ortiz > > --- > > cmd/fpga.c | 8 ++++---- > > common/image.c | 4 ++-- > > common/spl/spl_fit.c | 4 +--- > > drivers/fpga/fpga.c | 11 +++++++++-- > > include/fpga.h | 2 +- > > 5 files changed, 17 insertions(+), 12 deletions(-) > > > > Reviewed-by: Simon Glass thanks, I'll add your tag > > diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c > > [..] > > > index f41abca0cc..4db22efd8c 100644 > > --- a/common/spl/spl_fit.c > > +++ b/common/spl/spl_fit.c > > @@ -566,11 +566,9 @@ static int spl_fit_upload_fpga(struct spl_fit_info *ctx, int node, > > compatible = fdt_getprop(ctx->fit, node, "compatible", NULL); > > if (!compatible) > > warn_deprecated("'fpga' image without 'compatible' property"); > > - else if (strcmp(compatible, "u-boot,fpga-legacy")) > > - printf("Ignoring compatible = %s property\n", compatible); > > > > ret = fpga_load(0, (void *)fpga_image->load_addr, fpga_image->size, > > - BIT_FULL); > > + BIT_FULL, compatible); > > if (ret) { > > printf("%s: Cannot load the image to the FPGA\n", __func__); > > return ret; > > diff --git a/drivers/fpga/fpga.c b/drivers/fpga/fpga.c > > index fe3dfa1233..00aa4190b4 100644 > > --- a/drivers/fpga/fpga.c > > +++ b/drivers/fpga/fpga.c > > @@ -252,7 +252,8 @@ int fpga_loads(int devnum, const void *buf, size_t size, > > /* > > * Generic multiplexing code > > */ > > -int fpga_load(int devnum, const void *buf, size_t bsize, bitstream_type bstype) > > +int fpga_load(int devnum, const void *buf, size_t bsize, bitstream_type bstype, > > + const char *compatible) > > { > > int ret_val = FPGA_FAIL; /* assume failure */ > > const fpga_desc *desc = fpga_validate(devnum, buf, bsize, > > @@ -263,13 +264,16 @@ int fpga_load(int devnum, const void *buf, size_t bsize, bitstream_type bstype) > > case fpga_xilinx: > > #if defined(CONFIG_FPGA_XILINX) > > ret_val = xilinx_load(desc->devdesc, buf, bsize, > > - bstype); > > + bstype, compatible); > > #else > > fpga_no_sup((char *)__func__, "Xilinx devices"); > > #endif > > break; > > case fpga_altera: > > #if defined(CONFIG_FPGA_ALTERA) > > + if (strcmp(compatible, "u-boot,fpga-legacy")) > > + printf("Ignoring compatible = %s property\n", > > + compatible); > > ret_val = altera_load(desc->devdesc, buf, bsize); > > #else > > fpga_no_sup((char *)__func__, "Altera devices"); > > @@ -277,6 +281,9 @@ int fpga_load(int devnum, const void *buf, size_t bsize, bitstream_type bstype) > > break; > > case fpga_lattice: > > #if defined(CONFIG_FPGA_LATTICE) > > + if (strcmp(compatible, "u-boot,fpga-legacy")) > > + printf("Ignoring compatible = %s property\n", > > + compatible); > > ret_val = lattice_load(desc->devdesc, buf, bsize); > > #else > > fpga_no_sup((char *)__func__, "Lattice devices"); > > diff --git a/include/fpga.h b/include/fpga.h > > index ec5144334d..d85ef2cf18 100644 > > --- a/include/fpga.h > > +++ b/include/fpga.h > > @@ -64,7 +64,7 @@ int fpga_count(void); > > const fpga_desc *const fpga_get_desc(int devnum); > > int fpga_is_partial_data(int devnum, size_t img_len); > > int fpga_load(int devnum, const void *buf, size_t bsize, > > - bitstream_type bstype); > > + bitstream_type bstype, const char *compatible); > > Please can you add a function comment? ok > > > int fpga_fsload(int devnum, const void *buf, size_t size, > > fpga_fs_info *fpga_fsinfo); > > int fpga_loads(int devnum, const void *buf, size_t size, > > -- > > 2.31.1 > > > > Also the FPGA uclass is missing a sandbox driver/emulator and a test, > if you have time to do that. At present FPGA tests in CI are skipped > (e.g. with make qcheck). I am really short of time ATM with another deadline coming (sorry!) I believe Oleksandr might be willing to pick this up but I'll let him add further. > > Regards, > Simon