Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp918234ybl; Fri, 10 Jan 2020 08:54:24 -0800 (PST) X-Google-Smtp-Source: APXvYqzFsSFLVodyqPXsjdCaGLuC/4mxaSwoJVBFAr2U1E5AjtDV8U0/+hL98rXPLXcZy9Kn2gsM X-Received: by 2002:aca:c493:: with SMTP id u141mr3013729oif.62.1578675264471; Fri, 10 Jan 2020 08:54:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578675264; cv=none; d=google.com; s=arc-20160816; b=UZfIj3z39Pj2XoEcWInu+3pnMHiDrFhCjPSRYEg6u3jBjCqOEtY0s4WqLJk32z+heu EYIwqtsSqiWsgDGiG4Emn6PlY7WbfHOZys0Tx78h6amIfPNq+/VjqjtAP5bRYcl83+FS K1K4Edqk5S5nQsn9di3KIVJLzqrRQOun8csBz87Fmfx/+rDco2cYPX3xEMelqNmoKMyR HFWx/cvOydEcsixhgsrorGZCpy9+BnYQtU9CMO87Q9pS2nbjWNY3SydHtRUMv6ialEwV CpFtkOOoP0UaWAG3qBZct5LA+zQsGe8FXjloeRhxogStQ9wK3V6l6a6FkWWu2hgX8LN7 S6Vw== 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:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from; bh=qR9hU+XaDpR59UhgKkd1IGjVZgmn2Le4LTd+qN00DG8=; b=goEz8XY/JuftqHRI9mrLq3aSFivyMcYUXCzeD226S3I+ZAvYOAi9bYlO7V0/oKgfcT FLwnsc+d+Ri/J5jM1n3QbUJMd/4fGMaCZ1h4LnMaiindDBUtRbZn3wJTAVY3tfTXcZ2Y laeGq6s6c8GQ117FrvTvP6RhNJ9N9fhF/oNgYI4alNRmKxHtXL+JOfbn0D+L2Tg2cXoH 0HkyPzS/OkX2OukKOCZE24pi7m7hU7mKaOMjXahtPRlGvj/rdTWUQg73w3Y+BLDF5KIa 4HltR3SDxl38QJS835Ack2iUQ+fHybiyCs5Um2qIC1ndD0XXocM3lhZUu/rgaDV8i1YR tosg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x16si1451680otp.184.2020.01.10.08.54.12; Fri, 10 Jan 2020 08:54:24 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728729AbgAJQxK (ORCPT + 99 others); Fri, 10 Jan 2020 11:53:10 -0500 Received: from krieglstein.org ([188.68.35.71]:49986 "EHLO krieglstein.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728492AbgAJQxK (ORCPT ); Fri, 10 Jan 2020 11:53:10 -0500 X-Greylist: delayed 389 seconds by postgrey-1.27 at vger.kernel.org; Fri, 10 Jan 2020 11:53:08 EST Received: from dabox.localnet (gateway.hbm.com [213.157.30.2]) by krieglstein.org (Postfix) with ESMTPSA id E68BD4009B; Fri, 10 Jan 2020 17:46:37 +0100 (CET) From: Tim Sander To: Masahiro Yamada Cc: Dinh Nguyen , Vignesh Raghavendra , Richard Weinberger , Linux Kernel Mailing List , Marek Vasut , linux-mtd , Miquel Raynal , Brian Norris , David Woodhouse Subject: Re: mtd raw nand denali.c broken for Intel/Altera Cyclone V Date: Fri, 10 Jan 2020 17:46:37 +0100 Message-ID: <2827587.laNcgWlGab@dabox> Organization: Sander and Lightning In-Reply-To: References: <5143724.5TqzkYX0oI@dabox> <23083624.r2bJSIadJk@dabox> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masahiro Yamada Sorry for the large delay. I have seen the patches at https://lists.infradead.org/pipermail/linux-mtd/2019-December/092852.html Seem to resolve the question about the spare_area_skip_bytes register. I have now set the register to 2 which seems to be the right choice on an Intel SocFPGA. But still i am out of luck trying to boot 5.4.5-rt3 or 5.5-rc5. I get the following messages during bootup booting: [ 1.825590] denali-nand-dt ff900000.nand: timeout while waiting for irq 0x1000 [ 1.832936] denali-nand-dt: probe of ff900000.nand failed with error -5 But the commit c19e31d0a32dd 2017-06-13 22:45:38 predates the 4.19 kernel release (Mon Oct 22 07:37:37 2018). So it seems there is not an obvious commit which is causing the problem. Looking at the changes it might be that the timing calculations in the driver changed which might also lead to a similar error. I am booting via NFS the bootloader is placed in NOR flash. The corresponding nand dts entry is updated to the new format and looks like this: nand@ff900000 { #address-cells = <0x1>; #size-cells = <0x0>; compatible = "altr,socfpga-denali-nand"; reg = <0xff900000 0x100000 0xffb80000 0x10000>; reg-names = "nand_data", "denali_reg"; interrupts = <0x0 0x90 0x4>; clocks = <0x2d 0x1e 0x2e>; clock-names = "nand", "nand_x", "ecc"; resets = <0x6 0x24>; status = "okay"; nand@0 { reg = <0x0>; #address-cells = <0x1>; #size-cells = <0x1>; partition@0 { label = "work"; reg = <0x0 0x10000000>; }; }; }; The last kernel i am able to boot is 4.19.10. I have tried booting: 5.1.21, 5.2.9, 5.3-rc8, 5.4.5-rt3 and 5.5-rc5. They all failed. Unfortunately the range is quite large for bisecting the problem. It also occurred to me that all the platforms with Intel Cyclone V in mainline are development boards which boot from SD-card not exhibiting this problem on their default boot path. Best regards Tim PS: Here is some snippet from an older mail i didn't sent to the list yet which might be superseded by now: To get into this matter i started reading the "Intel Cyclone V HPS TRM" Section 13-20 Preserving Bad Block Markers: "You can configure the NAND flash controller to skip over a specified number of bytes when it writes the last sector in a page to the spare area. This option write the desired offset to the spare_area_skip_bytes register in the config group. For example, if the device page size is 2 KB, and the device area, set the spare_area_skip_bytes register to 2. When the flash controller writes the last sector of the page that overlaps with the spare area, it spare_area_skip_bytes must be an even number. For example, if the bad block marker is a single byte, set spare_area_skip_bytes to 2."