From e867387ca22579c7b1cc35d9ae36f560836b06eb Mon Sep 17 00:00:00 2001 From: Jon Lin Date: Mon, 12 Jul 2021 20:29:43 +0800 Subject: [PATCH] drivers: rkflash: Notice it when the storage device is not support When the related print appears, it means that the SDK is too old and the storage driver needs to be updated. Change-Id: I63f45fba4cf52108c628f225ee23aa0819ca256f Signed-off-by: Jon Lin --- drivers/rkflash/flash.c | 7 ++++++- drivers/rkflash/sfc_nand.c | 7 ++++++- drivers/rkflash/sfc_nor.c | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/rkflash/flash.c b/drivers/rkflash/flash.c index 52be15969cda..276d18a08bd2 100644 --- a/drivers/rkflash/flash.c +++ b/drivers/rkflash/flash.c @@ -2,6 +2,8 @@ /* Copyright (c) 2018 Rockchip Electronics Co. Ltd. */ +#define pr_fmt(fmt) "nandc: " fmt + #include #include #include @@ -450,8 +452,11 @@ u32 nandc_flash_init(void __iomem *nandc_addr) id_byte[0][1] != 0xA1 && id_byte[0][1] != 0xAA && id_byte[0][1] != 0xAC && - id_byte[0][1] != 0x6A) + id_byte[0][1] != 0x6A) { + pr_err("The device not support yet!\n"); + return FTL_UNSUPPORTED_FLASH; + } } } if (id_byte[0][0] == 0x98 && (id_byte[0][4] & 0x80)) diff --git a/drivers/rkflash/sfc_nand.c b/drivers/rkflash/sfc_nand.c index 7a94d97f99fe..08e12a9e7736 100644 --- a/drivers/rkflash/sfc_nand.c +++ b/drivers/rkflash/sfc_nand.c @@ -2,6 +2,8 @@ /* Copyright (c) 2018 Rockchip Electronics Co. Ltd. */ +#define pr_fmt(fmt) "sfc_nand: " fmt + #include #include #include @@ -1037,8 +1039,11 @@ u32 sfc_nand_init(void) p_nand_info = sfc_nand_get_info(id_byte); - if (!p_nand_info) + if (!p_nand_info) { + pr_err("The device not support yet!\n"); + return (u32)FTL_UNSUPPORTED_FLASH; + } sfc_nand_dev.manufacturer = id_byte[0]; sfc_nand_dev.mem_type = id_byte[1]; diff --git a/drivers/rkflash/sfc_nor.c b/drivers/rkflash/sfc_nor.c index f7abe75a5b09..11cb4f31cbac 100644 --- a/drivers/rkflash/sfc_nor.c +++ b/drivers/rkflash/sfc_nor.c @@ -2,6 +2,8 @@ /* Copyright (c) 2018 Rockchip Electronics Co. Ltd. */ +#define pr_fmt(fmt) "sfc_nor: " fmt + #include #include #include @@ -718,6 +720,8 @@ int snor_init(struct SFNOR_DEV *p_dev) if (g_spi_flash_info) { snor_parse_flash_table(p_dev, g_spi_flash_info); } else { + pr_err("The device not support yet!\n"); + p_dev->manufacturer = id_byte[0]; p_dev->mem_type = id_byte[1]; p_dev->capacity = 1 << (id_byte[2] - 9);