drivers: rkflash: add rkflash proc info

Change-Id: I7316c628d79cdee8fb513e144b6c365a142d4ecb
Signed-off-by: Dingqiang Lin <jon.lin@rock-chips.com>
This commit is contained in:
Dingqiang Lin 2018-08-17 13:41:39 +08:00 committed by Tao Huang
parent 9d39940c43
commit 057b63a64f
5 changed files with 8264 additions and 8131 deletions

View File

@ -14,6 +14,15 @@ u32 sftl_get_density(void);
s32 sftl_gc(void);
int sftl_vendor_read(u32 index, u32 count, u8 *buf);
int sftl_vendor_write(u32 index, u32 count, u8 *buf);
/*
* rknand_proc_ftlread() Read FTL info which's about 2KB size
*
* @size: buf size(>= 2KB)
* @buf: buf for caching ftl info
* @return real size of caching ftl info
*/
int rknand_proc_ftlread(int size, char *buf);
int rk_sftl_vendor_read(u32 id, u8 *buf, u32 size);
int rk_sftl_vendor_write(u32 id, u8 *buf, u32 size);
int rk_sftl_vendor_register(void);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -188,10 +188,17 @@ static unsigned int rk_partition_init(struct flash_part *part)
static int rkflash_proc_show(struct seq_file *m, void *v)
{
int real_size = 0;
char *ftl_buf = kzalloc(4096, GFP_KERNEL);
real_size = rknand_proc_ftlread(4096, ftl_buf);
if (real_size > 0)
seq_printf(m, "%s", ftl_buf);
seq_printf(m, "Totle Read %ld KB\n", totle_read_data >> 1);
seq_printf(m, "Totle Write %ld KB\n", totle_write_data >> 1);
seq_printf(m, "totle_write_count %ld\n", totle_write_count);
seq_printf(m, "totle_read_count %ld\n", totle_read_count);
kfree(ftl_buf);
return 0;
}