From patchwork Wed May 15 09:12:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1099902 X-Patchwork-Delegate: eugen.hristev@microchip.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="06dW664V"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 453pjt5Xglz9sDn for ; Wed, 15 May 2019 19:12:50 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 679CDC21DEC; Wed, 15 May 2019 09:12:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 22591C21C38; Wed, 15 May 2019 09:12:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E5159C21C38; Wed, 15 May 2019 09:12:43 +0000 (UTC) Received: from esa4.microchip.iphmx.com (esa4.microchip.iphmx.com [68.232.154.123]) by lists.denx.de (Postfix) with ESMTPS id 075FBC21C27 for ; Wed, 15 May 2019 09:12:42 +0000 (UTC) Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com a:mx1.microchip.iphmx.com a:mx2.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com X-IronPort-AV: E=Sophos;i="5.60,472,1549954800"; d="scan'208";a="33076697" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 15 May 2019 02:12:41 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.49) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 15 May 2019 02:12:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bSIonVWLF8zy6QbMCMv0Sv7q+ZTWAYtNkXA2RNHfg9o=; b=06dW664VpLfZHGa0PdfkzeuE8PwUrbMI6N/q+L1F6LSvq24P6hoeHOBAhPbie4hiLKnvDDpIdiofbsPHJ/MkQYLwbfofe6dUuLWPVuOInL+CXJMIR6kC2/0GNaHLzXOQTI2W+exmG9eXfRWTXe82yGn8EW5I1zZKBDj0KDuf7WA= Received: from BN6PR11MB1842.namprd11.prod.outlook.com (10.175.98.146) by BN6PR11MB1441.namprd11.prod.outlook.com (10.172.21.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.22; Wed, 15 May 2019 09:12:39 +0000 Received: from BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::35b3:7af:7216:8808]) by BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::35b3:7af:7216:8808%10]) with mapi id 15.20.1878.024; Wed, 15 May 2019 09:12:39 +0000 From: To: , Thread-Topic: [U-Boot][PATCH] configs: sama5d2_ptc_ek: fix NAND PMECC_CAP Thread-Index: AQHVCv5YM3ZE2poVvUyryeQPkofZ1Q== Date: Wed, 15 May 2019 09:12:39 +0000 Message-ID: <20190515091228.20017-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR08CA0172.eurprd08.prod.outlook.com (2603:10a6:800:d1::26) To BN6PR11MB1842.namprd11.prod.outlook.com (2603:10b6:404:101::18) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.9.5 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 471ffd0e-2fa4-4512-c9bd-08d6d9157a6f x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:BN6PR11MB1441; x-ms-traffictypediagnostic: BN6PR11MB1441: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:820; x-forefront-prvs: 0038DE95A2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(396003)(39860400002)(136003)(346002)(366004)(199004)(189003)(54906003)(66476007)(6506007)(102836004)(73956011)(305945005)(6116002)(386003)(478600001)(5660300002)(6486002)(2906002)(6512007)(6636002)(186003)(52116002)(26005)(14444005)(72206003)(110136005)(85306007)(14454004)(2616005)(476003)(486006)(71200400001)(64756008)(316002)(81156014)(36756003)(81166006)(7736002)(66946007)(4326008)(66446008)(71190400001)(68736007)(66066001)(99286004)(66556008)(86362001)(256004)(53936002)(8936002)(3846002)(6436002)(25786009)(50226002)(8676002)(107886003)(1076003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR11MB1441; H:BN6PR11MB1842.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 0dMcniX3ivYl9W5PNI2UfjJrhgJO8f+VB+MS57DCzPMPOECYaottBJp9fO8buSlERBEKGbwctrV6M1yIKzf76ZmK2b0Q0V1hJem5RQTsasO5ukE7X3fL+qcOTztCHA+ZFSvvbr1neV6V8A5PW1XwO1xAzV2qfko1VebZFcTlVDyL3ZMej/QPC1q6zek7x9nQ9wtAOwMTycoEyE5GxUzoP/dUJQiMUEBGdCkWKLNVWAZYquH5GSVpYO/xhDYd7cTgspLYQQpdgPdgbJOhI2F/Tev7w6UlMyRDAkjTKOCB8zz9IGyPSk9gT9U3GgBYM3+gmAwXg8QrHkUFPVugHgs2z1XtH2LWO+dkvwppM2poHIsmJBESADwjqSMWLNHwKZttgWJQC4BlfQoCM/wb9P3ja7AD9XhFmdAERm5Ecup/IIw= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 471ffd0e-2fa4-4512-c9bd-08d6d9157a6f X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2019 09:12:39.4974 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1441 X-OriginatorOrg: microchip.com Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH] configs: sama5d2_ptc_ek: fix NAND PMECC_CAP X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" From: Tudor Ambarus CONFIG_PMECC_CAP has a higher priority than its ONFI detected parameter and will overwrite it when defined. As per commit 49ad40298cc5, CONFIG_PMECC_CAP has a default value of 2 if not otherwise stated. This results in the overwriting of the ONFI ECC bits value. The following errors are seen when booting the kernel from the nand flash: Loading Environment from NAND... PMECC: Too many errors NAND read from offset 140000 failed -74 *** Warning - some problems detected reading environment; recovered successfully *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: eth0: ethernet@f8008000 Hit any key to stop autoboot: 0 NAND read: device 0 offset 0x180000, size 0x80000 PMECC: Too many errors NAND read from offset 180000 failed -74 0 bytes read: ERROR NAND read: device 0 offset 0x200000, size 0x600000 PMECC: Too many errors NAND read from offset 200000 failed -74 0 bytes read: ERROR Bad Linux ARM zImage magic! Fix it by setting the right value for ECC bits. Fixes: 49ad40298cc5 ("ARM: at91: Convert SPL_GENERATE_ATMEL_PMECC_HEADER to Kconfig") Signed-off-by: Tudor Ambarus --- configs/sama5d2_ptc_ek_mmc_defconfig | 1 + configs/sama5d2_ptc_ek_nandflash_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/sama5d2_ptc_ek_mmc_defconfig b/configs/sama5d2_ptc_ek_mmc_defconfig index bf2b5584df17..25b3aaf623ed 100644 --- a/configs/sama5d2_ptc_ek_mmc_defconfig +++ b/configs/sama5d2_ptc_ek_mmc_defconfig @@ -51,6 +51,7 @@ CONFIG_MMC_SDHCI_ATMEL=y CONFIG_NAND=y CONFIG_NAND_ATMEL=y CONFIG_ATMEL_NAND_HW_PMECC=y +CONFIG_PMECC_CAP=4 CONFIG_DM_ETH=y CONFIG_MACB=y CONFIG_PINCTRL=y diff --git a/configs/sama5d2_ptc_ek_nandflash_defconfig b/configs/sama5d2_ptc_ek_nandflash_defconfig index 9608ecd0b33f..3f7e6270d0ca 100644 --- a/configs/sama5d2_ptc_ek_nandflash_defconfig +++ b/configs/sama5d2_ptc_ek_nandflash_defconfig @@ -50,6 +50,7 @@ CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ATMEL=y CONFIG_NAND_ATMEL=y CONFIG_ATMEL_NAND_HW_PMECC=y +CONFIG_PMECC_CAP=4 CONFIG_DM_ETH=y CONFIG_MACB=y CONFIG_PINCTRL=y