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 417DBC77B7A for ; Fri, 19 May 2023 12:41:48 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 94C4386249; Fri, 19 May 2023 14:41: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=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="ESRieykh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 25F8086292; Fri, 19 May 2023 14:41:43 +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 1544984785 for ; Fri, 19 May 2023 14:41:40 +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 8E8D560BEB; Fri, 19 May 2023 12:41:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01193C433D2; Fri, 19 May 2023 12:41:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684500098; bh=b3rFGXAYwiVrNAmTF5ZffTK95k+mTypeKo4PB1bM6LA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ESRieykhV2MDmMs3g89Ndn6yM11WzSZHQD6pNL1hgYE4Gc4CJVvtUFboIpdbGkFr/ XhU4s/o8jllJjKRs0t6bGhjUEt+Gle1EBtkYbYQy22YbPb8Fmp7YQW/B5clKrKhb9I yk+KW4XaPwOyU9TH3HnEB+Ev+maOHAaIxuWrfJoP4uxhjPgeTnUIhTfkCr0XtNF3na 22Tk6KESMP3Rd2VLb84WdVxFBDC1qLQ/g02bVnZUQeomfUeO+Cu3uJHa78denuXsT6 It4ITuVwNzXtb2F+EJbBeyHa+nxGbsEUvvmu7P0x68/JvZGUtlWEba/itiyC5Hgwp3 EawXXKzUrTrvg== Message-ID: Date: Fri, 19 May 2023 15:41:34 +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> <20fbcbd5-056b-407a-c506-c29b4359d669@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 19/05/2023 02:19, Colin Foster wrote: > Hi Roger, > > I really appreciate the help! > > On Thu, May 18, 2023 at 01:55:38PM +0300, Roger Quadros wrote: >> Hi Colin, >> >> On 17/05/2023 22:39, Colin Foster wrote: >>> >>> 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. > > I can "fix" the issue by just commenting out the "ECC uncorrectable > errors" print :-) lol > >> >>> 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. > > Interesting. With the "ecc" prints in U-Boot I also get some non-zero > values: > > ecc: 0 > ecc: 6bff997b > ecc: 6bff997b > ecc: 6bff997b > > > Once I'm booted, I can use nanddump. It seems like everything is correct > from the Linux side of things: > > # nanddump -f mlo_dump /dev/mtd0 > ECC failed: 0 > ECC corrected: 0 > Number of bad blocks: 0 > Number of bbt blocks: 0 > Block size 131072, page size 2048, OOB size 64 > Dumping data starting at 0x00000000 and ending at 0x00020000... > > # nanddump -f uboot1_dump /dev/mtd1 > ECC failed: 0 > ECC corrected: 0 > Number of bad blocks: 0 > Number of bbt blocks: 0 > Block size 131072, page size 2048, OOB size 64 > Dumping data starting at 0x00000000 and ending at 0x00180000... > > # nanddump -f uboot2_dump /dev/mtd2 > ECC failed: 0 > ECC corrected: 0 > Number of bad blocks: 0 > Number of bbt blocks: 0 > Block size 131072, page size 2048, OOB size 64 > Dumping data starting at 0x00000000 and ending at 0x00180000... > > # nanddump -f /dev/null /dev/mtd3 > ECC failed: 0 > ECC corrected: 6 > Number of bad blocks: 0 > Number of bbt blocks: 0 > Block size 131072, page size 2048, OOB size 64 > Dumping data starting at 0x00000000 and ending at 0x1fce0000... > ECC: 1 corrected bitflip(s) at offset 0x0ab30800 > ECC: 1 corrected bitflip(s) at offset 0x0b008800 > ECC: 1 corrected bitflip(s) at offset 0x0deaa000 > ECC: 1 corrected bitflip(s) at offset 0x0ea5b000 > ECC: 1 corrected bitflip(s) at offset 0x0ecbc000 > ECC: 1 corrected bitflip(s) at offset 0x0ed61800 > > >> Can you please share your spl/u-boot.cfg? > > Attached Couple of questions there 1) CONFIG_MTDPARTS_DEFAULT "mtdparts=nandflash:0x20000(xload_raw),0x180000(u-boot),0x180000(u-boot-2),0x1fce0000(main)" Is this correct and matches with what kernel sees? I couldn't see the NAND partition table in the Kernel Device tree patch. 2) #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x20000 #define CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND 0x1a0000 These don't seem to match what you have defined in MTDPARTS_DEFAULT. Which one is correct? How do you flash the MLO and u-boot image to NAND? I tried on AM335x-EVM and it works fine both before and after commit 04fcd25873. Once change I had to do was to increase the u-boot partition size as u-boot image does not fit in original partition size. -----boot log follows----- U-Boot SPL 2023.01-rc4-00381-g04fcd25873-dirty (May 19 2023 - 15:10:15 +0300) Trying to boot from NAND U-Boot 2023.01-rc4-00381-g04fcd25873-dirty (May 19 2023 - 15:10:15 +0300) CPU : AM335X-GP rev 1.0 Model: TI AM335x EVM DRAM: 512 MiB Core: 156 devices, 17 uclasses, devicetree: separate WDT: Started wdt@44e35000 with servicing every 1000ms (60s timeout) NAND: 256 MiB MMC: OMAP SD/MMC: 0 Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... not set. Validating first E-fuse MAC Net: eth2: ethernet@4a100000, eth3: usb_ether Hit any key to stop autoboot: 0 => => mtd device nand0 , # parts = 10 #: name size offset mask_flags 0: NAND.SPL 0x00020000 0x00000000 0 1: NAND.SPL.backup1 0x00020000 0x00020000 0 2: NAND.SPL.backup2 0x00020000 0x00040000 0 3: NAND.SPL.backup3 0x00020000 0x00060000 0 4: NAND.u-boot-spl-os 0x00040000 0x00080000 0 5: NAND.u-boot 0x00200000 0x000c0000 0 6: NAND.u-boot-env 0x00020000 0x002c0000 0 7: NAND.u-boot-env.backup10x00020000 0x002e0000 0 8: NAND.kernel 0x00700000 0x00300000 0 9: NAND.file-system 0x0f600000 0x00a00000 0 -- cheers, -roger