diff mbox series

[U-Boot] configs: sama5d2_ptc_ek: fix NAND PMECC_CAP

Message ID 20190515091228.20017-1-tudor.ambarus@microchip.com
State Accepted
Commit 1cee54ebf3e2d221213fbb45f0f86798c8979fd6
Delegated to: Eugen Hristev
Headers show
Series [U-Boot] configs: sama5d2_ptc_ek: fix NAND PMECC_CAP | expand

Commit Message

Tudor Ambarus May 15, 2019, 9:12 a.m. UTC
From: Tudor Ambarus <tudor.ambarus@microchip.com>

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 <tudor.ambarus@microchip.com>
---
 configs/sama5d2_ptc_ek_mmc_defconfig       | 1 +
 configs/sama5d2_ptc_ek_nandflash_defconfig | 1 +
 2 files changed, 2 insertions(+)

Comments

Eugen Hristev May 24, 2019, 6:54 a.m. UTC | #1
On 15.05.2019 12:12, Tudor Ambarus - M18064 wrote:
> From: Tudor Ambarus <tudor.ambarus@microchip.com>
> 
> 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 <tudor.ambarus@microchip.com>

Applied to u-boot-atmel/master, thanks !
diff mbox series

Patch

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