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 86700C77B7D for ; Sat, 13 May 2023 05:59:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D8CA084705; Sat, 13 May 2023 07:59:55 +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="dVM5OANj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B2BF48470D; Sat, 13 May 2023 07:59:54 +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 123AF846AF for ; Sat, 13 May 2023 07:59:52 +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 4D54D60DCA; Sat, 13 May 2023 05:59:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEA62C433D2; Sat, 13 May 2023 05:59:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683957589; bh=Z3dVC6TfsiRMoqjWhD0dlygb6OZrsYsbo/DI1NYu+XY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dVM5OANjUdCkp1PfaKLnSktDw9iMKh8w57R9OOe6EnuYa4uWHubir7AJhdshkhMgJ gOoUoKzJQFuJS80HOYJhzDZdrsB6KEdOd0zFjEEWFY9pbKBx3mMRbdwv/pr8CZjPwS ezKqkfHeUV6SjfrxH7Lf9IP3gEkPaLSDFfTroxGoJzPBjezEGXBqybuB7ZMHEEUx8B vRwKWUtUhIJ5RiEaXAPBVkjbpxBDUnGMDcbsM2xXCjA2CH2kkozkGEsqaLFZ16TCsM Kx1ZhCL6wC8vyG1+nRPz4Ebpgjc8b78Nzgo5LwEIHSb2TcukR+TKQyeWm1Nscoiake IXjCxDJRpZd8A== Message-ID: <3c74211f-e801-7ab3-c66f-a31b8b2a3c43@kernel.org> Date: Sat, 13 May 2023 08:59:46 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.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> 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 On 12/05/2023 19:05, Colin Foster wrote: > Hi Roger, > > On Fri, May 12, 2023 at 02:53:07PM +0300, Roger Quadros wrote: >> >> >> On 10/05/2023 18:38, Colin Foster wrote: >>> >>> This is still out-of-U-Boot. I have an include/configs/our_product.h >>> file with this: >>> >>> """ >>> #define CFG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \ >>> 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, \ >>> 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, \ >>> 33, 34, 35, 36, 37, 38, 39, 40, 41, \ >>> 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, \ >>> 52, 53, 54, 55, 56, 57} >>> >>> #define CFG_SYS_NAND_ECCBYTES 14 >>> #define CFG_SYS_NAND_MAX_ECCPOS 57 >> >> This should be 56 i.e. (57 - 2 + 1) >> But it won't fix the issue you are facing. :P > > Oh, good catch. I know when I was trying to get this working I had to > play with these values quite a bit. I must have missed changing this at > one point. > >> >>> #define CFG_SYS_NAND_ECCSIZE 512 >>> #define CFG_SYS_NAND_MAX_OOBFREE 2 >>> """ >>> >>> >>>> Can you please point me to the Linux device tree file if it exists? >>> >>> This is the latest submission. Still not accepted - I need to find time >>> to button everything up and resubmit. My plan of attack was Kernel >>> Acceptance, then U-Boot. Unfortunately my company lets the pesky >>> "Shipping products" step get in the way :-) >>> >>> https://lkml.org/lkml/2023/2/22/939 >>> >>> Or if you just want the ECC part: >>> >>> + nandflash: nand@0,0 { >>> + compatible = "ti,omap2-nand"; >>> + reg = <0 0 4>; >>> + interrupt-parent = <&gpmc>; >>> + >>> + nand-bus-width = <16>; >>> + ti,nand-ecc-opt = "bch8"; >>> + ti,elm-id=<&elm>; >>> + linux,mtd-name = "micron,nand"; >>> >>> >>> I think that's all the info you're looking for. Let me know if I missed >>> something. >> >> Yes this is all I was looking for. >> >> Is CONFIG_NAND_OMAP_ECCSCHEME_BCH8_CODE_HW set in your u-boot config? > > Yes, it is set. I've attached our .config file. I just made a change to > CONFIG_NAND_OMAP_GPMC_PREFETCH as a test, which didn't fix the issue. > > And as another sanity check, I reverted the patch and have functionality > again: > > > """ > U-Boot SPL 2023.04-00029-g316faf4c46-dirty (May 12 2023 - 09:02:58 -0700) > OMAP4460-GP ES1.1 > Trying to boot from NAND > > > U-Boot 2023.04-00029-g316faf4c46-dirty (May 12 2023 - 09:02:58 -0700) > > CPU : OMAP4460-GP ES1.1 > """ > > OK. next step is to dump calculated ECC values while reading a block and see if it is different in failing case and then debug why. Let me prepare a patch for that. -- cheers, -roger