Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D6285C77B7D for ; Thu, 18 May 2023 10:55:51 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 812AB85F06; Thu, 18 May 2023 12:55:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="QlP7Tf54"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A12A986101; Thu, 18 May 2023 12:55:47 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1964685DCF for ; Thu, 18 May 2023 12:55:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rogerq@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1EDE064635; Thu, 18 May 2023 10:55:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 863AAC433D2; Thu, 18 May 2023 10:55:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684407342; bh=yYh9fC5GDiZJTL/KR8FrxidPKQrBdTm0RRZFv9t4ZKE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=QlP7Tf54cgGKUVCKXZ8U78JGEykapoJVYZEZMudDbp9R4gcRgct33CKD7pcyau4PE P4itW9nxSYlVU0lG4bpydOKf0oTqSdSbSGDvV+lfP3XxoWQEbjuPeaCPrXriN09yT3 DGwIJE9Dw8fBNIwFa/7ZKwFz0X2h1PFtLaFy+mlzCds/bNNj6Pr0SyQKG2C7HMyLbA 9t3W7m0zq0WqFAVdCm4K3/ZhqPgFIjmTsoBbfQwgIAeDtjY2YSVpxEmBoi3YqVgw/T jxP+CZYcCkIeWMxg8w20Y/7jjtxR6elyYjSljj3K53jSa0iXGMGbFLza2ioH2mJShZ TheUO90vDwiLA== Message-ID: <20fbcbd5-056b-407a-c506-c29b4359d669@kernel.org> Date: Thu, 18 May 2023 13:55:38 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: U-Boot OMAP GPMC ECC change Content-Language: en-US To: Colin Foster Cc: Michael Trimarchi , Dario Binacchi , u-boot@lists.denx.de References: <1944d1d1-399d-dfde-16ae-21a00ff7fbe3@kernel.org> <9ec2a385-a991-c3c1-4bfe-18b79793688d@kernel.org> <5e475f93-bf2c-fa28-f594-e8182e96c0e2@kernel.org> From: Roger Quadros In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Hi Colin, On 17/05/2023 22:39, Colin Foster wrote: > Hi Roger, > > Thanks for the tests. I attached the files and commented in line... but > at the bottom of this email I have some findings... > > On Wed, May 17, 2023 at 04:30:55PM +0300, Roger Quadros wrote: >> Hi Colin, >> >> I just tested this on AM335x EVM which uses BCH8_CODE_HW but 8-bit NAND part. >> I see that you are using 16-bit NAND. >> >> One more difference in u-boot configuration. For me: >> CONFIG_NAND_OMAP_GPMC_PREFETCH=y >> >> Not sure if that matters but let's keep it set for now. >> >> For debug can you please apply the patch (at end) to u-boot at commit a95410696d21 >> (before breakage) and run the test. >> > All are attached. > > However I have some other initial findings: > > I swapped in just U-Boot (not the SPL) with your patch, and everything > seems to work! > > The issue of Uncorrectable ECC errors spam came from the SPL. Here's a > snippet of the boot log with the "ecc" print as well as your patch: > Thanks for the tests. Glad to hear issue is narrowed down to SPL. > U-Boot SPL 2023.04-00029-g26a9ce5314-dirty (May 17 2023 - 12:06:49 -0700) > OMAP4460-GP ES1.1 > Trying to boot from NAND > ecc: 2420106 > ecc: ebd922f6 > ecc: 333f844f > ecc: ab812f72 This is clearly the issue. They should all have been 0. > omap-elm: uncorrectable ECC errors > omap-elm: uncorrectable ECC errors > omap-elm: uncorrectable ECC errors > omap-elm: uncorrectable ECC errors > ecc: 2420106 > ecc: ebd922f6 > ecc: 333f844f > ecc: ab812f72 > omap-elm: uncorrectable ECC errors > omap-elm: uncorrectable ECC errors > omap-elm: uncorrectable ECC errors > omap-elm: uncorrectable ECC errors Can you please share your spl/u-boot.cfg? We have a stripped down driver "am335x_spl_bch.c" that deals with NAND at SPL. I haven't really looked much at that driver but it relies on omap_gpmc.c for ecc.hwctl() read_buf() ecc.calculate() We didn't do any functional change to these functions in commit 04fcd25873 unless something slipped through the cracks. It seems to rely on following config options CFG_SYS_NAND_ECCPOS CONFIG_SYS_NAND_PAGE_COUNT CONFIG_SYS_NAND_PAGE_SIZE CONFIG_SYS_NAND_5_ADDR_CYCLE CFG_SYS_NAND_ECCSIZE CFG_SYS_NAND_ECCBYTES CONFIG_SYS_NAND_OOBSIZE Could you please share what they are set to for your SPL build? Meanwhile, I'll try to reproduce this on AM335x-EVM. -- cheers, -roger