From fb124d337214e0c2e82431026f23846ac4916976 Mon Sep 17 00:00:00 2001 From: Punnaiah Choudary Kalluri Date: Tue, 28 Jul 2015 17:15:11 +0530 Subject: [PATCH] nandpsu: Decrease the XNANDPSU_MAX_BLOCKS value This change is to reduce the size of the static bbt table size from 8KB to 4KB because so far we have not identified the flash part that has more than 16K blocks and also it will reduce the bsp size. Driver warns if the device has more number of blocks than the defined value so that this can be incremented in future and if there is a part available. Signed-off-by: Punnaiah Choudary Kalluri Acked-by: Anirudha Sarangi --- XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.c | 2 ++ XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.c b/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.c index 9ff1b300..ee2db55b 100644 --- a/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.c +++ b/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.c @@ -533,6 +533,8 @@ static void XNandPsu_InitGeometry(XNandPsu *InstancePtr, OnfiParamPage *Param) (u64)Param->PagesPerBlock * (u64)Param->BytesPerPage); InstancePtr->Geometry.EccCodeWordSize = 9U; /* 2 power of 9 = 512 */ + if (InstancePtr->Geometry.NumTargetBlocks > XNANDPSU_MAX_BLOCKS) + xil_printf("!!! Device contains more blocks than the max defined blocks in driver\r\n"); #ifdef XNANDPSU_DEBUG xil_printf("Manufacturer: %s\r\n", Param->DeviceManufacturer); diff --git a/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.h b/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.h index 9379598b..6a54706f 100644 --- a/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.h +++ b/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.h @@ -195,7 +195,7 @@ extern "C" { #define XNANDPSU_HAMMING 0x1U /**< Hamming Flash */ #define XNANDPSU_BCH 0x2U /**< BCH Flash */ -#define XNANDPSU_MAX_BLOCKS 32768U /**< Max number of Blocks */ +#define XNANDPSU_MAX_BLOCKS 16384U /**< Max number of Blocks */ #define XNANDPSU_MAX_SPARE_SIZE 0x800U /**< Max spare bytes of a NAND flash page of 16K */