mtd: msm_qpic_nand: Use logical unit count in flash density

In an ONFI compliant devices, the flash parameters are calculated
by reading the onfi parameter page of the device.

Existing flash density is calculated based on a single logical
unit(LUN). This shows wrong density information on Multi LUN flashes.
So, always use number of LUNS value in flash density calculations.

Change-Id: Idba4d4e129e7fdcdab1e509bd8c3149f26fc11f2
Signed-off-by: Pradeep P V K <ppvk@codeaurora.org>
This commit is contained in:
Pradeep P V K 2020-08-10 21:03:31 +05:30 • committed by Gerrit - the friendly Code Review server
commit 3fb0bdab95

View file

@ -781,8 +781,9 @@ static int msm_nand_flash_onfi_probe(struct msm_nand_info *info)
flash->blksize = onfi_param_page_ptr->number_of_pages_per_block *
flash->pagesize;
flash->oobsize = onfi_param_page_ptr->number_of_spare_bytes_per_page;
flash->density = onfi_param_page_ptr->number_of_blocks_per_logical_unit
* flash->blksize;
flash->density = onfi_param_page_ptr->number_of_logical_units *
onfi_param_page_ptr->number_of_blocks_per_logical_unit *
flash->blksize;
flash->ecc_correctability =
onfi_param_page_ptr->number_of_bits_ecc_correctability;