mirror of
https://gitee.com/Vancouver2017/luban-lite.git
synced 2025-12-28 15:08:55 +00:00
enable blk cache for spinand fatfs read
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023, ArtInChip Technology Co., Ltd
|
||||
* Copyright (c) 2023-2024, ArtInChip Technology Co., Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
@@ -13,6 +13,23 @@
|
||||
#include <rtdevice.h>
|
||||
#include "spinand_parts.h"
|
||||
|
||||
#ifndef AIC_SPINAND_BLOCK_CACHE_SIZE
|
||||
#define BLOCK_CACHE_SIZE 512
|
||||
#else
|
||||
#define BLOCK_CACHE_SIZE AIC_SPINAND_BLOCK_CACHE_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef AIC_SPINAND_BLOCK_CACHE_NUM
|
||||
#define BLOCK_CACHE_NUM 4
|
||||
#else
|
||||
#define BLOCK_CACHE_NUM AIC_SPINAND_BLOCK_CACHE_NUM
|
||||
#endif
|
||||
|
||||
struct blk_cache {
|
||||
u32 pos;
|
||||
char buf[BLOCK_CACHE_SIZE];
|
||||
};
|
||||
|
||||
struct spinand_blk_device {
|
||||
struct rt_device parent;
|
||||
struct rt_device_blk_geometry geometry;
|
||||
@@ -23,6 +40,7 @@ struct spinand_blk_device {
|
||||
char name[32];
|
||||
enum part_attr attr;
|
||||
u8 *pagebuf;
|
||||
struct blk_cache blk_cache[BLOCK_CACHE_NUM];
|
||||
};
|
||||
|
||||
int rt_blk_nand_register_device(const char *name, struct rt_mtd_nand_device *mtd_device);
|
||||
|
||||
Reference in New Issue
Block a user