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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EA680C3DA7A for ; Mon, 2 Jan 2023 17:43:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCOpD-000603-91; Mon, 02 Jan 2023 12:42:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pCOpC-0005zj-1E; Mon, 02 Jan 2023 12:42:14 -0500 Received: from 0001.3ffe.de ([2a01:4f8:c0c:9d57::1] helo=mail.3ffe.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pCOp9-0004R6-GB; Mon, 02 Jan 2023 12:42:13 -0500 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 D19FA89; Mon, 2 Jan 2023 18:42:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1672681323; 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=dAGldSwepF42UzBG1Yyku7wbbLVWS4S2qU8HG6n+MBA=; b=i3DsUX6pObo3B6Zoma9Xg8uWoIDb1nncc2938aKTtbFbBwrSP1hUktqS89FYnGpKsvK9Q+ uyGUxf4FM/TyrG42uu0BbCHuftqjZjF0Vo0cPnwkLhzRV/i0+FqBmpIH66Fo5HFJ1W5Kxd qWzdJzn2MpLkHYlL2DySOsXryXc+ptJgxnAulWQL8sjuttpDbnCtJmQppGKUAwXeXyPkTk Ree4Zq+1RWWjY2AEriRzEvpy7qysIXr7mqs5Cn5RgKcdC0alUdnn3mmEpjyXqkOd2gWFMQ XW5Vg2weOfrf2SHET1ybmeCqlyiCOo53T86ZPbGcv/NU/Lb5s+0+2DUdnrNLHw== MIME-Version: 1.0 Date: Mon, 02 Jan 2023 18:42:03 +0100 From: Michael Walle To: Guenter Roeck Cc: =?UTF-8?Q?C=C3=A9dric_Le_Goater?= , Tudor Ambarus , Ben Dooks , Alistair Francis , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org, qemu-devel@nongnu.org Subject: Re: [PATCH] m25p80: Add the is25wp256 SFPD table In-Reply-To: <20230102162308.GA1138622@roeck-us.net> References: <20221221122213.1458540-1-linux@roeck-us.net> <2236d0ee-4fc6-5e2c-95b4-f97639e0955b@kaod.org> <20221225121850.4bjnskmlhsot54cf@hetzy.fluff.org> <3044e0c174268312d0323d8f9ad43c68@walle.cc> <20230102162308.GA1138622@roeck-us.net> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <50d8282e95bde199ad60411ddfa9b373@walle.cc> X-Sender: michael@walle.cc Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a01:4f8:c0c:9d57::1; envelope-from=michael@walle.cc; helo=mail.3ffe.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Am 2023-01-02 17:23, schrieb Guenter Roeck: > On Mon, Jan 02, 2023 at 04:43:49PM +0100, Michael Walle wrote: >> Am 2023-01-02 14:53, schrieb Cédric Le Goater: >> > On 12/27/22 07:31, Tudor Ambarus wrote: >> > > >> > > >> > > On 25.12.2022 14:18, Ben Dooks wrote: >> > > > On Wed, Dec 21, 2022 at 06:36:02PM +0100, Cédric Le Goater wrote: >> > > > > On 12/21/22 13:22, Guenter Roeck wrote: >> > > > > > Generated from hardware using the following command and >> > > > > > then padding >> > > > > > with 0xff to fill out a power-of-2: >> > > > > >     xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp >> > > > > > >> > > > > > Cc: Michael Walle >> > > > > > Cc: Tudor Ambarus >> > > > > > Signed-off-by: Guenter Roeck >> > > > > >> > > > > Reviewed-by: Cédric Le Goater >> > > > >> > > > If SFDP is a standard, couldn't we have an function to generate >> > > > it from >> > > > the flash parameters? >> > > > >> > > >> > > No, it's not practical as you have to specify all the flash parameters >> > > at flash declaration. >> > >> > Indeed and the definition of flash models in QEMU is far to cover all >> > the SFDP >> > features. The known_devices array of m25p80 would be huge ! However, we >> > could >> > generate some of the SFDP tables if no raw data is provided. It could be >> > useful >> > for testing drivers. >> >> I don't think adding (incomplete) SFDP tables makes sense for any real >> devices. E.g. sometimes our linux driver will look at specific bits in >> SFDP to figure out what particular flash device is attached. For >> example >> when there are different flashes with the same jedec id. >> >> But since the last released kernel, we support a generic SFDP driver, >> which >> is used when there is no matching driver for the flash's jedec id. >> Theoretically, you can build your own flash device (with a unique id) >> and >> generate the sfdp tables for that one. >> > How about older kernels versions ? Would those still support such > (virtual ?) > flash devices ? No with older kernels you'd be out of luck. They will just print "unknown flash id" and skip the device. -michael