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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 638BEC61DA3 for ; Tue, 21 Feb 2023 11:19:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2A9A985870; Tue, 21 Feb 2023 12:19:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=walle.cc 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; secure) header.d=walle.cc header.i=@walle.cc header.b="TR57LL6Y"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CDCCF85905; Tue, 21 Feb 2023 12:19:07 +0100 (CET) Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C302785870 for ; Tue, 21 Feb 2023 12:19:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@walle.cc Received: from 3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 630EE124; Tue, 21 Feb 2023 12:19:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1676978342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oTk4bMOOOOouPVRBb7oaICJpOk6q3SpP/xcZjLu635U=; b=TR57LL6Y3BxEBPxM8zmqf+vO9UVwE9o20C9UBKu/9mAmmJWqw0YXejNvjchI8iEvCnSdLA 2uEZ04/zOB5kmSsBf4x5yW9u4U3fjTMJMIeXtCwjV+9dsI+8HbQcGNXEBUcWyfRJtvI6op bALnH7whj3Qyuacwj4jLBAonYkSkPUuRP2dtvZqBfg0AkB1c/W18muFQNdkMwQzQnSEYgq PFOj6UGieeR4tx8NPq+H701TLy0k2cn9M8w4bhqTAO2zaZ8ejPlcuTrukBUaa3JPpTK02/ pXf3aeZQbbs47yiYWdp3NE8R2+GYBlcvdK5V7TNqs9+eBfzGD+ia0o/5W0Uz3A== MIME-Version: 1.0 Date: Tue, 21 Feb 2023 12:19:02 +0100 From: Michael Walle To: ulf@emagii.com Cc: marex@denx.de, miquel.raynal@bootlin.com, monstr@monstr.eu, sjg@chromium.org, u-boot@emagii.com, u-boot@lists.denx.de Subject: Re: [PATCH 3/4] mtd/fpga: add fpga directory to mtd (with Cyclone 10) In-Reply-To: References: <20230221090816.3913072-1-michael@walle.cc> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <1bd42930274456ce40480126c251b070@walle.cc> X-Sender: michael@walle.cc Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit 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 Am 2023-02-21 11:42, schrieb Ulf Samuelsson: > Den 2023-02-21 kl. 10:08, skrev Michael Walle: >>>> If it is right or wrong to use that as an MTD is a matter of >>>> opinion. >>> I am still hoping the MTD maintainer would provide input here. >> I might be missing something, but what is the reasoning here, to add >> this >> to the mtd subsystem? One is saving space, but I agree with Marek, >> this >> isn't a valid argument to just put any (unrelated) stuff into the MTD >> subsystem. >> >> Also, as Marek pointed out, there are many different 'programming' >> solutions for CPLDs/FPGAs and most of them don't share anything with >> MTD. You seem to be just focusing on the "passive serial" one. > Yes, the passive serial is very different from the other ways of > configuring an FPGA. > > It is write only. You cannot read back the configuration and no > partial reconfiguration. > > You do not have to go through AXI/PCIe busses. > > You access through an SPI device, but todays solution does not support > using the SPI driver. I can't follow you here. >> Now, I saw you mentioned that >> >> | the current passive serial solutions does not use the existing SPI >> | drivers. >> >> What do you mean with SPI drivers? SPI flash drivers or SPI controller >> drivers? Does the "passive serial solution" expose an SPI bus and you >> can access the SPI flash on it in a generic way? Then the solution >> should be to write a SPI (controller) driver, the flash should then >> be automatically be detected. > > The proposed solution is similar to an SPI flash driver. > > The FPGA bitstream is typically stored in the CPU boot flash. > > The CPU reads the bitstream and does an SPI transfer to the FPGA. > > The FPGA is not connected to any flash memory. Ah I missed that. So you don't want to program the SPI flash behind the FPGA, but the FPGA directly. You are loading a bitstream from somewhere and configure the FPGA. Using a SPI like interface, i.e. it is write only as it lacks the DO. > The FPGA chip exposes (in SPI terms) SCK, nCS and MOSI, but not MISO > so you cannot read back anything. it should read "This FPGA chip". I expect there are much more variants how to configure an FPGA. Would these also use your proposed solution? > The driver will return an empty block on read. > > The SPI transfer to configure the FPGA is doing > > * toggle a GPIO signal (nCONFIG) > > * Do an SPI write (using the SPI controller driver) > > * After the SPI transfer complete, you check the status of some GPIO > (nSTATUS etc.). > > This is all hidden from the MTD. > > What the MTD subsystem sees is a "write-only memory" that has to be > written with exactly 'n' bytes. MTD is mainly around erasable blocks, although there are some exotic things like mtdram. I fail to see how this would apply to your FPGA. > The additional features of MTD simplifies the user interaction by > exposing a device and > providing info on the device. Which would that be? What are the features of MTD which you need here? You've mentioned MTD partitions, but I'm not sure these really apply to partial reconfigurations. I know that Linux has a different device tree binding for it. So making u-boot use mtd partitions (if thats possible at all) and not the linux bindings means they'll diverge, which is something we want to avoid. > The only difference the MTD subsystem would see is > that there is a new subdirectory "fpga" with drivers > and the Kconfig + Makefile changes to support the directory. > Otherwise it plugs right in. From a user point of view this is really confusing. Why would you sometimes configure an fpga with the mtd command and sometimes with the fpga command depening whether it is using this passive programming thingy. > The current solutions for passive serial cannot use the SPI controller > driver > so each board implements SPI controller inside their 'board' files. > You cannot reuse this code in practice, so every one that wants to > have passive serial has to write their own SPI access routines. Sorry, I didn't follow this too closely. Do you have some pointers? -michael > ==== > The FPGA manager does not support device tree, and I will not > be able to spend time on introducing this, as Marek advices. > > Best Regards > Ulf Samuelsson > >> >> -michael