Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1986740pxb; Mon, 23 Aug 2021 09:15:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6PfK0hjirNwe9D+91zSxF4pE+ao5/qCLAYfyOGQ0ipn2dtBCiwmgT0Le680JIFOW0dMlq X-Received: by 2002:a05:6e02:b4b:: with SMTP id f11mr996756ilu.3.1629735338336; Mon, 23 Aug 2021 09:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629735338; cv=none; d=google.com; s=arc-20160816; b=Pasxy8AQOZAO07zQ6Cnx8iZR6KuFVdHvMs8sDxHHAX8izbzXxbGx2igKLUti0FS858 GxWLC/wAPjNF78GECSF2HN77LPmoC9MXooQSr8IzyDybFi+Zx701IhfK3NtkUwH7Hjqw c1R0LPaXzb5f29JBhjFIWGKIUkmtSe9hYH2oCYhu97LuRZdyEO5hjP576VUQWGEj5kLE ljqAJCH1I7MFyRJCnRbJwv7bkvPRBobI+Z3h+ylSHBq6Omv1PactsyAcYVzw1+dISvqe bXETvePrqspVcsjy6BQiqe9WIzaUShvTxDabDQZBT3o2b9Rp/6/NCMuDeoPChqF1DKGX 4eOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MQYAWXyVXeAmMCmsXp8rKcBE+h+Z0WB7Z2sV5nVbunQ=; b=sm0z2EntFzQybJytultQWWEZKnTG2RDajgjfSn0oH8AQaEf/8pXYDTOoGsDbMIWnYW 8NJMWIcnRFfR+Pwc+cSFiLngx9/bB5ZxbG2wCgFkAivOw+SxoHsfsyUvlVvuMMUQDKIK 70eizjDxeRLnhK2NRChBaEgWTeZq9zgWP0dtWwNGY1zgqTGj6WH5ZiR1LeYBhM4i2hXq /ISj/PieraqJe9cR1QAZtxGCwwyJpsugcvah00k+xRJ/QRM9OEfopYBuov179f7DkVsZ 13WHYMt/deBHGL1E4mwtal9c7PUwddC6DBT2e3sdjrYRFAvobyv/225VfgIBXvj8rALd 2gNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@0x0f.com header.s=google header.b=OXZRLQaa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s20si16631926ioa.93.2021.08.23.09.15.24; Mon, 23 Aug 2021 09:15:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@0x0f.com header.s=google header.b=OXZRLQaa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229887AbhHWQPJ (ORCPT + 99 others); Mon, 23 Aug 2021 12:15:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbhHWQPH (ORCPT ); Mon, 23 Aug 2021 12:15:07 -0400 Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F23AC061575 for ; Mon, 23 Aug 2021 09:14:25 -0700 (PDT) Received: by mail-qk1-x729.google.com with SMTP id t190so19773551qke.7 for ; Mon, 23 Aug 2021 09:14:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0x0f.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MQYAWXyVXeAmMCmsXp8rKcBE+h+Z0WB7Z2sV5nVbunQ=; b=OXZRLQaaHAFk9vl2c5Iqw6BB0HgA9JNnvlQB2uveNK8aIYWLQDdFgYgl1Zyxy9cmuJ 3ijfSGqkCjlPOmCv0trXq+Ahxl5CbKuBWvVZvPsFzTjtttQu4xWAbtlnRhcU/LhXBz80 fv71f5h+F1HHKmU/MnV+XvU69eKa3euEbLE5o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MQYAWXyVXeAmMCmsXp8rKcBE+h+Z0WB7Z2sV5nVbunQ=; b=kHciZDy9N+m1FEulkV6wLSt28rP31o5BCQD0d0DbvYXpuMxTpOydzR9ZLdVLsy99I/ OKX5nhkfRJwF5VBskAJPXVT08cSKcSHIEsqiIydwLL0QC/Q9YWA4dYlGF45yGmwmGqJb ByEbIWxkdNwuaCMj0Xyqsoerq5WS2+oH3xoqJAGQ0YpqJlCF07zr8tz3XnTvTypWowt8 9INCJt5x2QQwnJXs/MlyHCB3eN3xMxCt3b874scmOCcU3pDu/58tTb1+RIZtKMIKnGOJ VQHm3EkwBopQDldx48boZrxIfsaXx0xGbDYRAGEx0EnMYDvkWodWXEHZTL6YoGAbYPUc 0GLg== X-Gm-Message-State: AOAM531BWbiEoOm9aq8Sy1aYPaFNcYC1KX/MkPDOuxgx4ndMgr8W2wG8 YEtfcaCWJqyHKb2N+emKKYORiDHXEduq3Xxrc7pIFg== X-Received: by 2002:ae9:e84a:: with SMTP id a71mr22043868qkg.159.1629735264120; Mon, 23 Aug 2021 09:14:24 -0700 (PDT) MIME-Version: 1.0 References: <20210811084924.52293-1-daniel@0x0f.com> <20210816101143.2a64d7b9@xps13> <20210823162148.35a24183@xps13> <20210823170354.2dccabd5@xps13> In-Reply-To: <20210823170354.2dccabd5@xps13> From: Daniel Palmer Date: Tue, 24 Aug 2021 01:16:58 +0900 Message-ID: Subject: Re: [PATCH v3] mtd: spinand: add support for Foresee FS35ND0*G parts To: Miquel Raynal Cc: linux-mtd@lists.infradead.org, richard@nod.at, Linux Kernel Mailing List , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Miquel, Thank you for your patience on this.. On Tue, 24 Aug 2021 at 00:03, Miquel Raynal wrote: > > ECC: 3 corrected bitflip(s) at offset 0x08000000 > > 0x08000000: fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > > How is this result possible? You are dumping with the ECC engine > enabled, it reports 3 bf (meaning that it is actually running, at least > the software really thinks there is an on-die engine enabled) but the > data has not been corrected. I expect the first byte to be 0xFF after > correction. Only with -n (raw dump) we should see this. I did a bit of searching to see if a newer/more detailed datasheet has come about and found some vendor code I hadn't seen before: https://github.com/100askTeam/NezaD1_u-boot-2018/blob/1f8b282626f0b9f29f96c57d6b1a5d728e523893/drivers/mtd/awnand/spinand/physic/core.c#L46 This says the ECC enable bit is non-standard and in a register that isn't documented at all in the datasheet. I guess the spi nand core isn't able to actually control the ECC on these chips at the moment and flipping the bits is updating the ECC too. Or the ECC isn't enabled at all. I couldn't see an easy way of overriding which register gets updated so I haven't tried it yet. Cheers, Daniel