summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Lin <jon.lin@rock-chips.com>2019-03-12 15:25:41 +0800
committerTao Huang <huangtao@rock-chips.com>2019-03-20 18:48:57 +0800
commit0f2800842e71bee4999377d3010ed296ac3c1fd4 (patch)
tree30609a328dfad288a4fdc42635fc738632913af6
parent6c10c70bb972b2f6e70af31335db3c819694197a (diff)
drivers: rkflash: use physical continuous memory for flash stress test
otherwise cache flush will cause test fail Change-Id: I6d4a4be405998bfe68eac0004b5fee407ed62a70 Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
-rw-r--r--drivers/rkflash/flash.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/rkflash/flash.c b/drivers/rkflash/flash.c
index 9f674069861d..40625cd84e85 100644
--- a/drivers/rkflash/flash.c
+++ b/drivers/rkflash/flash.c
@@ -4,6 +4,7 @@
#include <linux/delay.h>
#include <linux/kernel.h>
+#include <linux/slab.h>
#include "flash.h"
#include "flash_com.h"
@@ -315,8 +316,8 @@ static s32 get_bad_blk_list(u16 *table, u32 die)
#define FLASH_SPARE_SIZE 8
static u16 bad_blk_list[1024];
-static u32 pwrite[FLASH_PAGE_SIZE / 4];
-static u32 pread[FLASH_PAGE_SIZE / 4];
+static u32 *pwrite;
+static u32 *pread;
static u32 pspare_write[FLASH_SPARE_SIZE / 4];
static u32 pspare_read[FLASH_SPARE_SIZE / 4];
static u32 bad_blk_num;
@@ -330,6 +331,9 @@ static void flash_test(void)
u32 blk_addr = 64;
u32 is_bad_blk = 0;
+ pwrite = kzalloc(FLASH_PAGE_SIZE, GFP_KERNEL | GFP_DMA);
+ pread = kzalloc(FLASH_PAGE_SIZE, GFP_KERNEL | GFP_DMA);
+
PRINT_NANDC_E("%s\n", __func__);
bad_blk_num = 0;
bad_page_num = 0;
@@ -375,8 +379,12 @@ static void flash_test(void)
PRINT_NANDC_E("ERR:page %x, ret= %x\n",
page_addr,
ret);
- PRINT_NANDC_HEX("data:", pread, 4, 8);
- PRINT_NANDC_HEX("spare:", pspare_read, 4, 2);
+ PRINT_NANDC_HEX("w data:", pwrite, 4, 512);
+ PRINT_NANDC_HEX("w spare:", pspare_write, 4, 4);
+ PRINT_NANDC_HEX("r data:", pread, 4, 512);
+ PRINT_NANDC_HEX("r spare:", pspare_read, 4, 5);
+ while (1)
+ ;
}
}
flash_erase_block(0, blk * blk_addr);
@@ -387,6 +395,8 @@ static void flash_test(void)
bad_blk_num, bad_page_num);
PRINT_NANDC_E("Flash Test Finish!!!\n");
+ kfree(pwrite);
+ kfree(pread);
while (1)
;
}