From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Fri, 7 Dec 2018 12:48:09 +0100 Subject: [U-Boot] [PATCH v2] pcm058: fix NAND flash not using badblock table In-Reply-To: <1544174376.2518.2.camel@denx.de> References: <955e2a76-d21d-cec8-f3ce-f0e6613b52f6@denx.de> <1544174376.2518.2.camel@denx.de> Message-ID: <0d8ac7c3-a4da-786b-65eb-287fd40370b6@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 12/07/2018 10:19 AM, Harald Seiler wrote: > Currently, U-Boot ignores the BBT stored in the last 4 blocks of NAND > flash because the NAND_BBT_USE_FLASH flag is not set. This leads to > two issues: > > * U-Boot silently uses a memory-only BBT which is initialized with all > blocks marked as good. This means, actual bad blocks are marked good > and U-Boot might try writing to or reading from them. > * The BBT in flash, which will be created once Linux boots up, is not > off limits for a driver ontop, like UBI. While it does not seem to > consistently produce an error, sometimes UBI will fail to attach > because the BBT blocks obviously don't contain valid UBI data. > > To fix this, this patch sets the CONFIG_SYS_NAND_USE_FLASH_BBT option, > which is used in ./drivers/mtd/nand/raw/mxs_nand.c to decide whether > a BBT in flash is used. > > Signed-off-by: Harald Seiler V2 Changelog is missing. > --- > include/configs/pcm058.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/configs/pcm058.h b/include/configs/pcm058.h > index 49048c163f..b9bc08b388 100644 > --- a/include/configs/pcm058.h > +++ b/include/configs/pcm058.h > @@ -55,6 +55,7 @@ > #define CONFIG_SYS_NAND_BASE 0x40000000 > #define CONFIG_SYS_NAND_5_ADDR_CYCLE > #define CONFIG_SYS_NAND_ONFI_DETECTION > +#define CONFIG_SYS_NAND_USE_FLASH_BBT Shouldn't this be enabled on all boards with GPMI NAND ? > #endif > > /* DMA stuff, needed for GPMI/MXS NAND support */ > -- Best regards, Marek Vasut