Received: by 10.192.165.148 with SMTP id m20csp436677imm; Wed, 25 Apr 2018 01:53:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+TnAACWZvig05lnXNu4YRL9u+h+VxC86UFj8Xnm89cMds6YOpTL+4Ck/MRWzAx7MZe+aV9 X-Received: by 10.98.202.74 with SMTP id n71mr15488319pfg.149.1524646388749; Wed, 25 Apr 2018 01:53:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524646388; cv=none; d=google.com; s=arc-20160816; b=g+sCvZ+3k4XgpvT4HDn7OIpTU9EeGCFxzYjJYU4F5xXUMKMigPJe2lyYDaBFm42khJ VeqGihzBtbuHyHeQWu8gjfPMyiYNbdZzUwBHZrNdjegS98bEpM7Wfg6WAkKzQMJm+g9/ cNMTxKgBN5lz434HSnzF5fCaSM8TDSYRGnwvRn7p10y3z2aNp7NsuGwO6IQKm8oA2g0m KN7tEVpLRjQYrD6ITxlNCtkSh0mBO0rYtXj8aZpnbkVJXwU/8SU+YxCSnoHCX+51cwoA eBSaDv40Z4nNGVReM24Rjo/m6ZppHZB2bC1+NerbQSYOq98TsphdqAJGKenyEzNA1Nwg uvSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=wcD3j5w0hX5EJ2aFKfPq30vS/a3XjD/rRAz2VGGbZpM=; b=AiSFoX0lhj4cCxMKbGBwXyBFjqnRgg3O5cyQd9pRXDHnlAi8/YG/+1yTqumFUsrR2z nporULE8yZwMpZKV72JwsYXsDvydTUt4cdL6bw1Zd373hLfi+mAj8jXVIs7w2Ds2ZO9l DpDz0MMRpwaMmagMSpOs/IDrfXruVm3GedXz+/FLOBvoGwuIIUEppOL6tzu859OqfYHT y322PobwnfDvGrS2i8MDPmSDJ4ziryMHeodCMZjcarexswpryoyFvgOhJKpIAHtabaUB Q9dufYL5wwkFb/hNdQWJK8y+b2B3Or47o3kx3+95fJ1uFbPNy/prM/8Bl12DUSFi0D6T Gu4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o1grNANF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7si2596858pfe.214.2018.04.25.01.52.54; Wed, 25 Apr 2018 01:53:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o1grNANF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751485AbeDYIvq (ORCPT + 99 others); Wed, 25 Apr 2018 04:51:46 -0400 Received: from mail-wr0-f176.google.com ([209.85.128.176]:45423 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750969AbeDYIvg (ORCPT ); Wed, 25 Apr 2018 04:51:36 -0400 Received: by mail-wr0-f176.google.com with SMTP id p5-v6so24733143wre.12; Wed, 25 Apr 2018 01:51:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=wcD3j5w0hX5EJ2aFKfPq30vS/a3XjD/rRAz2VGGbZpM=; b=o1grNANFJTOUnt3HuqgNT13WS8T7ZawV1gBD4AgK2tBd0TnGuRIu30LGm4jkh3ID9A L34PxnwtwGd2GcsdwoniWjm6ErSDCyxoGZJR9+dOZIBZBIhaVe5YUpbOS+ttoxfi3Gvz ScUhy5I7mge/Vh7EYPTp3inkxbuJZluys2GQylO1rkW9ngMG7yav3/HitBVwJJGykxVg sKEW1WjQdiCz7UeTVli+SFDEo8ztX1OjnU284Yp5wZzHx3LWT7qYAU1rBCAiCAgjOD2p Kvp7N9m0BF9QBqmgivMMtuu5m0ttXlmv2EV5nqw38JX/pyvwaPazhsTW62+tGDczXeTZ Nxkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=wcD3j5w0hX5EJ2aFKfPq30vS/a3XjD/rRAz2VGGbZpM=; b=lqsn3elwxpsdmWtF3V4xV212daUVJ6/cebJMkv+go/nBv4IomsiPvHO9IVYOEs306n 66G7/nFXrq3DlfliBRYHII1nYCLmu4DfZV1QtS5cwtleiJdKlNhNu4Dij3prm8eHLICG TAHvzIWNyu7HYTk47kW5KjhFBqQVuDYeKvVWfAylGn1AV71L9iDyRLKDmO5S9LDyKuyr 4oOcKIcUtpbwRVXDA7ZIWz2cN89cX99IMzbCCOYdxE4pME3LjHeJq3RAqYAZPvL395wS sr5hSDVlZm0nnVUa2D8NKAskmdIO9LJs8xgn5yC6Lq/YSerXT2aGbmHwHfFpuHBu+IvX fmDA== X-Gm-Message-State: ALQs6tBe4vYbfpOzUlFCrDSUpiMU9vwTD0sDxiMOiv9LBEV13XmahNUn 6PlmRCY6BNkzxNcQyWovX9DheHIIg65liHx44/Q= X-Received: by 2002:adf:d1cc:: with SMTP id m12-v6mr22965872wri.214.1524646294696; Wed, 25 Apr 2018 01:51:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.181.1 with HTTP; Wed, 25 Apr 2018 01:51:33 -0700 (PDT) In-Reply-To: <20180311100313.znonhesgh462rz65@osboxes> References: <20180310171244.70299-1-npcomplete13@gmail.com> <20180311100313.znonhesgh462rz65@osboxes> From: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= Date: Wed, 25 Apr 2018 10:51:33 +0200 Message-ID: Subject: Re: [PATCH] ARM: BCM5301X: Fix NAND ECC parameters for Linksys Panamera To: Vivek Unune Cc: florian.fainelli@broadcom.com, Hauke Mehrtens , Jon Mason , bcm-kernel-feedback-list , Rob Herring , Mark Rutland , Russell King , "linux-arm-kernel@lists.infradead.org" , devicetree@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11 March 2018 at 11:03, Vivek Unune wrote: > Hi Rafa=C5=82, > > On Sat, Mar 10, 2018 at 10:41:04PM +0100, Rafa=C5=82 Mi=C5=82ecki wrote: >> On 10 March 2018 at 18:12, Vivek Unune wrote: >> > Using BCH8 gives ecc errors and makes the router unsuable. >> > Switching to BCH1 fixes these errors. >> >> Can you provide CFE's log messages starting with >> "Decompressing...done" and up to the "Press Ctrl+C to stop in CFE" >> please? I'd like to see what NAND info CFE prints there. > > See below. It does say BCH-8, however I can't get it to work. > > CFE log: > > Decompressing...done > Found a Toshiba NAND flash: > Total size: 128MB > Block size: 128KB > Page Size: 2048B > OOB Size: 64B > Sector size: 512B > Spare size: 16B > ECC level: 8 (8-bit) > Device ID: 0x98 0xf1 0x80 0x15 0xf2 0x16 > find_devinfo: devinfo block found at 0x00180000! > > Press Ctrl+C to stop in CFE This means that: 1) Default mode for your NAND controller is BCH8 (setup at hw level) 2) CFE uses BCH8 when programming flash with provided firmware For maximum compatibility DTS should describe ECC as using BCH8 and Linux should use BCH8. I spent whole day yesterday experimenting with BCM47094 and NAND controller to understand your case better. As crazy as it sounds, my NAND controller working in BCH4 mode is reading flash data programmed using BCH8 perfectly fine! I was testing & verifying that behavior multiple times for hours. It really works. I noticed that on my BCM47094 board with CFE working in BCH8: 1) Flashing firmware with CFE results in using BCH8 (expected) 2) Linux with NAND controller in BCH4 can read flash data (unexpected!) 3) Writing flash data results in using BCH4 Above write test proves that NAND controller is really setup into BCH4 mode correctly. How is it possible it reads flash data programmed using BCH8 is out of my imagination. Long story short I believe your patch is wrong. DTS should describe hardware and by default this board uses BCH8 (and so the bootloader). Current DTS is correct. As it happens your patch doesn't break anything directly because of unexpected NAND controller behavior. It's just a matter of "luck" though due to some weird hardware behavior. --=20 Rafa=C5=82