Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp5245473rwj; Tue, 20 Dec 2022 23:20:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXuNIvsIk/9eDZ2HzQ2gWuPjCstrpE8t7UiwEGwr3rleMI7Eh0zvYhoSrcGuutYg57rDFOQU X-Received: by 2002:a17:90b:46d3:b0:219:861a:ac10 with SMTP id jx19-20020a17090b46d300b00219861aac10mr1210659pjb.6.1671607201392; Tue, 20 Dec 2022 23:20:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671607201; cv=none; d=google.com; s=arc-20160816; b=bjf/RzDsK1TLcoMchpmbdtQaI6zIVgP9Wy4pl9iFYfK7r0amAY/9dWxhzBVT9vv2UD aN/Xi3m0fyDWbIFflPbnd7pf+nbMY8LJrdOZEnafYMV0eAv+M4vEK2gBZLWVxMdTHfzE ZTT8Cp5miFcOfW74ZXxn6Wl769u33jhfjnauLVXNbTd34b+yX6OUe2Lh+M+I0hZJLvIs BJGxtJt4tD3cDhliMaFpl1u5eXHPoTVii6Ljrg+tX0XpI6boM+nW56qvRuRM6poB1+LN JsD0//PQRXsxaplQDEzSg0J7MDLeTQWXFwzmH4oQdnYbYMLzO/gfr7J9vzqfF5qsj/ma a/jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=eg0WhSchjTvqXeKP426L54VYEv3WuT9Mujc7Ng9EqQk=; b=Brzx385olHRHGjqFLrpvuS+iIWedyQY4pe/vM++12FSg6Yl/7jwVPbEdYEyl764F7A AOSW8XVdcjrJ15FMg2zJwqfxZL3aN0F8t6vQQddwmBS6mgAjXenRhtTSt4xCnhTETsMN qJAzLvljumOnjPn2UgkjknRrzrFI8coAmJJjiDfR3GFPrfyBt6jtvzbXlvWqhjenUn1c Y34RRGWUIFWcSpgExUInue5Xz6C1TGReZntwDaSj2EWMT8bGNgMFGBqPZ3toh9I8SY9t 6iWyqLqdKQtQ6Ayhzuv2jfZN6SaU3RliaYgF/q8S7gCsVQtsJXjA4PsV9nmqzhqUO1kd 1N4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="B6/+mfC8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f5-20020a654005000000b0047895910bd0si16564744pgp.825.2022.12.20.23.19.52; Tue, 20 Dec 2022 23:20:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="B6/+mfC8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234035AbiLUHDP (ORCPT + 69 others); Wed, 21 Dec 2022 02:03:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbiLUHDM (ORCPT ); Wed, 21 Dec 2022 02:03:12 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DB2718B1F for ; Tue, 20 Dec 2022 23:03:10 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id h16so13940983wrz.12 for ; Tue, 20 Dec 2022 23:03:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=eg0WhSchjTvqXeKP426L54VYEv3WuT9Mujc7Ng9EqQk=; b=B6/+mfC87WaDmrKji/kmap+UCJ13c7ySQtXVy061Q8CaXeYfrtmsV12CRBzMes/Xoj 8jXqhRpeOSuNvQkSawR9K+F7E6Xl6YHuHXqFc+YaBaSVJJFJYL2h4SuSaxdVOfm7IRmb Ws644Udaa1jAlQBbJrVSqOfeBgBk4kItqV8rHKsOD8OSo/Ew/4b2hJgMftYjEAEaVrVV wJdNa8BBlGxLxvd/t4M9hZ5ZnqyztTY/6MqPqQMQIZDX6ebaI8dzpXbDujV+5gxOn3oQ K3MG2XmHV1Dv7NhQ2HsZ2FWxdc+KYPAftr4D6T0n3cxlmJkw8fRr/OJmErpOl/90UMa0 qo8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eg0WhSchjTvqXeKP426L54VYEv3WuT9Mujc7Ng9EqQk=; b=hC0+m2KN3dIgvgoasUzzeSfCUN4WgLLZjEQCZX0kAjvlWanRMQ5tIQBMx3VXEPmKq0 k9DdxTb4/VUw+gT3o8gIU57mFcN33vJrxRffdAcuXqHnwwuhv9KIkDessMXp6UZd+EGU a7waoN6nbJqAATPv7c5rNmZdE9mYXlkMW0VKXJebI2nzPUOPQH/EUhLduBASbpUchC04 xhxlS5BFClKtx8YlZsHo+og7wLXpjHAqGbfr4bG22VydiJeqrlhzxVaueE4TjEkl+NKF DV7uX2sth9lDUD1R5lEAlwEoO374w8Qzns9FFMascKn9KDUVyhL1GrlIpRNSBdRFJ411 aBkg== X-Gm-Message-State: AFqh2kodKwlgQ5FWutt9a6VWnkvLcY9n7acFO9Q4uUk8z2Tv6YJXuDlu QY764D+SRdJIvH4phpZbkQ4ssg== X-Received: by 2002:adf:e103:0:b0:26a:6e7d:5782 with SMTP id t3-20020adfe103000000b0026a6e7d5782mr312026wrz.35.1671606188859; Tue, 20 Dec 2022 23:03:08 -0800 (PST) Received: from [192.168.0.173] ([82.77.81.131]) by smtp.gmail.com with ESMTPSA id q9-20020a05600000c900b0024228b0b932sm17074639wrx.27.2022.12.20.23.03.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Dec 2022 23:03:08 -0800 (PST) Message-ID: <96b4574d-8fe1-7662-5029-fc375f7b9ac9@linaro.org> Date: Wed, 21 Dec 2022 09:03:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v3 1/2] mtd: spi-nor: issi: is25wp256: Init flash based on SFDP Content-Language: en-US To: Guenter Roeck , Sudip Mukherjee Cc: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , greentime.hu@sifive.com, jude.onyenegecha@sifive.com, william.salmon@sifive.com, adnan.chowdhury@sifive.com, ben.dooks@sifive.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org References: <20220920184808.44876-1-sudip.mukherjee@sifive.com> <20221221003009.GA280250@roeck-us.net> From: Tudor Ambarus In-Reply-To: <20221221003009.GA280250@roeck-us.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21.12.2022 02:30, Guenter Roeck wrote: > Hi, Hi, Guenter, Thanks for the report. > > On Tue, Sep 20, 2022 at 07:48:07PM +0100, Sudip Mukherjee wrote: >> The datasheet of is25wp256 says it supports SFDP. Get rid of the static >> initialization of the flash parameters and init them when parsing SFDP. >> >> Testing showed the flash using SPINOR_OP_READ_1_1_4_4B 0x6c, >> SPINOR_OP_PP_4B 0x12 and SPINOR_OP_BE_4K_4B 0x21 before enabling SFDP. >> After this patch, it parses the SFDP information and still uses the >> same opcodes. >> >> Signed-off-by: Sudip Mukherjee > > With this patch in place, qemu emulations with is25wp256 fail to > instantiate the flash. Specifically, this affects the qemu sifive_u > emulation. The resulting error message is: > > spi-nor spi0.0: BFPT parsing failed. Please consider using SPI_NOR_SKIP_SFDP when declaring the flash > spi-nor: probe of spi0.0 failed with error -22 > > qemu command line: > > qemu-system-riscv64 -M sifive_u -m 512M \ > -no-reboot -kernel arch/riscv/boot/Image -snapshot \ > -drive file=flash.8Vtb7,format=raw,if=mtd -bios default \ > -append "root=/dev/mtdblock0 mtdparts=spi0.0:- console=ttySIF0,115200 earlycon" \ > -nographic -monitor none > > Reverting this patch fixes the problem. I need some more debug info in order to have both flavors of the flash work correctly. Would you please revert the patch locally and do the tests from below? Thanks! ta --- # dd if=/dev/urandom of=./qspi_test bs=1M count=6 6+0 records in 6+0 records out # mtd_debug write /dev/mtd4 0 6291456 qspi_test Copied 6291456 bytes from qspi_test to address 0x00000000 in flash # mtd_debug erase /dev/mtd4 0 6291456 Erased 6291456 bytes from address 0x00000000 in flash # mtd_debug read /dev/mtd4 0 6291456 qspi_read Copied 6291456 bytes from address 0x00000000 in flash to qspi_read # hexdump qspi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0600000 # mtd_debug write /dev/mtd4 0 6291456 qspi_test Copied 6291456 bytes from qspi_test to address 0x00000000 in flash # mtd_debug read /dev/mtd4 0 6291456 qspi_read Copied 6291456 bytes from address 0x00000000 in flash to qspi_read # sha1sum qspi_test qspi_read 57f8d4fee65622104e24276e865f662844f12242 qspi_test 57f8d4fee65622104e24276e865f662844f12242 qspi_read # cat /sys/bus/spi/devices/spi0.0/spi-nor/partname is25wp256 # cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id 9d7019 # cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer issi # xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450060101ff00060110300000ff9d05010380000002ffffffffffff ffffffffffffffffffffffffffffffffffffe520f9ffffffff0f44eb086b 083b80bbfeffffffffff00ffffff44eb0c200f5210d800ff234ac90082d8 11cecccd68467a757a75f7aed55c4a422cfff030faa9ffffffffffffffff ffffffffffffffff501950169ff9c0648fefffff # md5sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp ba14818b9ec42713f24d94d66bb90ba0 /sys/bus/spi/devices/spi0.0/spi-nor/sfdp