From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:ac9:4144:0:0:0:0:0 with SMTP id u4csp2513554ocg; Mon, 10 Oct 2022 08:26:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6vMSgFpv0rwJ/ymESdQePiSXa6N07M5h75ONAXdgFjf3YVFNKQ0mwDTpxFx3G/2MtZiYUW X-Received: by 2002:a0c:ac02:0:b0:4af:a3b1:3167 with SMTP id l2-20020a0cac02000000b004afa3b13167mr14977336qvb.66.1665415609627; Mon, 10 Oct 2022 08:26:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665415609; cv=none; d=google.com; s=arc-20160816; b=f5vYQTS2P2prifxgPsDzhX/rHBZudZ6ZAiXHDfZFQDxKOqeVCm2c724Q/kpAEXx/ED prIAisNoU/A6KHZ/hGYsMXQRGgCqC3be5LJkQj1zlgfmxnOKUXpaqpaeH3kLPEVPL75e gLQUDaGSIfNxItfDtwMoxWnt+DcMJXibxa4M/FUk8icNW3GDlDk1L2UlCjuVyN6rgso/ SxiMfq8trSQ14vlHAwhD94k1Sps8gFIOWPdS3FmyL9HJaa66ZgtL9Fqcq76FD2FDbFgL 9oUi4lfLCgw6YMuPLmBLCeULIl5Uz7e8hP7uv/5XsEPF5mZfI45UdidSuOEvI0EGyJbs GZbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id; bh=OasP5bsEkGYFf6Eohlldu4drSmEQqFRz0Y2RQH/HoFA=; b=CtZ+KPs6fh62ZCM6Aqr19BiZBMW/R60dIYIVp0YHAC5lcb7HT4thVwuXkJxbIk4GpC RJjZdZAMmz0S7OP27T6IhiKQOQTgxwQGl8BCgRxhfbLgyGcIbdZgU2ELL0RyKX3APC1w f5p4lcZBWMnIX4Bdvpc7pHt6TGSCQz/9T9jjY3KDs5ayPsrNC1XlvoOk75Xp6ZMs905V 5AhkKyZl4iL8VIIlhLINZNwfmA/pjwe6RayCU040xbtp5rI8x0WXe66GeRlSqrssWh3l qgqXwdlS7LRefty5hFQBkuHB4M7mDVuGDgRtR3b0Q2wXK5s9B0h/gPcYDyyGKW7Vjksn I8Tw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gv11-20020a056214262b00b004af9cebeeedsi5331945qvb.215.2022.10.10.08.26.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Oct 2022 08:26:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org" Received: from localhost ([::1]:55362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohug5-0005uD-5B for alex.bennee@linaro.org; Mon, 10 Oct 2022 11:26:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohuQw-0004Lo-MV; Mon, 10 Oct 2022 11:11:10 -0400 Received: from smtpout3.mo529.mail-out.ovh.net ([46.105.54.81]:43277) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohuQu-0003no-QS; Mon, 10 Oct 2022 11:11:10 -0400 Received: from mxplan5.mail.ovh.net (unknown [10.109.156.148]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 88A93130FE308; Mon, 10 Oct 2022 17:11:02 +0200 (CEST) Received: from kaod.org (37.59.142.104) by DAG4EX2.mxp5.local (172.16.2.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Mon, 10 Oct 2022 17:11:01 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-104R0052322d493-305b-47ac-9133-413b70511c08, 8F9D85B4748BB0730094C5680DDBB13DC71FBC21) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Message-ID: <2ef00fda-ee4f-38b1-e1b1-f182c1640c7b@kaod.org> Date: Mon, 10 Oct 2022 17:11:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v3 4/8] m25p80: Add the mx25l25635f SFPD table Content-Language: en-US To: Francisco Iglesias , Michael Walle CC: , , , Peter Maydell , Joel Stanley , Andrew Jeffery , Alistair Francis , Iris Chen References: <20220722063602.128144-1-clg@kaod.org> <20220722063602.128144-5-clg@kaod.org> <20221007144431.GE20384@fralle-msi> <6726971b-b862-2959-5e7e-c059be2bb07d@kaod.org> <20221010105120.GA30024@fralle-msi> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <20221010105120.GA30024@fralle-msi> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.104] X-ClientProxiedBy: DAG5EX2.mxp5.local (172.16.2.42) To DAG4EX2.mxp5.local (172.16.2.32) X-Ovh-Tracer-GUID: 96501a66-d026-4a98-8ead-fbf5b46c8bca X-Ovh-Tracer-Id: 3892798931107941298 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrfeejgedgkedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgihesthekredttdefjeenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeekteejtdelkeejvdevffduhfetteelieefgeefffeugffhfeekheffueefledujeenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddruddtgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehirhhishgthhgvnhhljhesfhgsrdgtohhmpdfovfetjfhoshhtpehmohehvdel Received-SPF: pass client-ip=46.105.54.81; envelope-from=clg@kaod.org; helo=smtpout3.mo529.mail-out.ovh.net X-Spam_score_int: -38 X-Spam_score: -3.9 X-Spam_bar: --- X-Spam_report: (-3.9 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-2.007, 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+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-devel" X-TUID: hpF2m4hBowJq On 10/10/22 12:51, Francisco Iglesias wrote: > Hi Cedric, > > On [2022 Oct 10] Mon 11:58:40, Michael Walle wrote: >> Am 2022-10-10 08:23, schrieb Cédric Le Goater: >>> On 10/7/22 16:44, Francisco Iglesias wrote: >> >>>>> --- a/hw/block/m25p80.c >>>>> +++ b/hw/block/m25p80.c >>>>> @@ -234,6 +234,8 @@ static const FlashPartInfo known_devices[] = { >>>>> { INFO("mx25l12855e", 0xc22618, 0, 64 << 10, 256, 0) }, >>>>> { INFO6("mx25l25635e", 0xc22019, 0xc22019, 64 << 10, >>>>> 512, 0), >>>>> .sfdp_read = m25p80_sfdp_mx25l25635e }, >>>>> + { INFO6("mx25l25635f", 0xc22019, 0xc22019, 64 << 10, >>>>> 512, 0), > > I think I missed the (ER_4K | ER_32K) flags above (in case we go for a v4 we > can add it in). sure. >>>> >>>> I think I'm not seeing the extended id part in the datasheet I've >>>> found so >>>> might be that you can switch to just INFO and _ext_id 0 above >>> >>> This was added by commit 6bbe036f32dc ("m25p80: Return the JEDEC ID >>> twice for >>> mx25l25635e") to fix a real breakage on HW. >> >> From my experience, the ID has a particular length, at least three bytes >> and if you read past that length for some (all?) devices the id bytes just >> get repeated. I.e. the counter in the device will just wrap to offset 0 >> again. If you want to emulate the hardware correctly, you would have to >> take that into consideration. > > If we decide to go with Michael's proposal above you can use '0' on the > 'extended_id' and enable 's->data_read_loop = true' when reading the ID. This part : for (; i < SPI_NOR_MAX_ID_LEN; i++) { s->data[i] = 0; } will fill the remaining JEDEC ID bytes with zeros which is not what we want for the mx25l25635e chip. Thanks, C. > Best regards, > Francisco > >> But I don't think it's worth it, OTOH there seems to be some broken >> software which rely on that (undefined?) behavior. >> >> -michael >