6b13f685e
김민수
BSP 최초 추가
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
#include <linux/mtd/blktrans.h>
#include <linux/kfifo.h>
#include <linux/sched.h>
#include <linux/completion.h>
#include <linux/mtd/mtd.h>
struct ftl_zone {
bool initialized;
int16_t *lba_to_phys_table;
struct kfifo free_sectors;
};
struct sm_ftl {
struct mtd_blktrans_dev *trans;
struct mutex mutex;
struct ftl_zone *zones;
int block_size;
int zone_size;
int zone_count;
int max_lba;
int smallpagenand;
bool readonly;
bool unstable;
int cis_block;
int cis_boffset;
int cis_page_offset;
void *cis_buffer;
int cache_block;
int cache_zone;
unsigned char *cache_data;
long unsigned int cache_data_invalid_bitmap;
bool cache_clean;
struct work_struct flush_work;
struct timer_list timer;
struct completion erase_completion;
int heads;
int sectors;
int cylinders;
struct attribute_group *disk_attributes;
};
struct chs_entry {
unsigned long size;
unsigned short cyl;
unsigned char head;
unsigned char sec;
};
#define SM_FTL_PARTN_BITS 3
#define sm_printk(format, ...) \
printk(KERN_WARNING "sm_ftl" ": " format "
", ## __VA_ARGS__)
#define dbg(format, ...) \
if (debug) \
printk(KERN_DEBUG "sm_ftl" ": " format "
", ## __VA_ARGS__)
#define dbg_verbose(format, ...) \
if (debug > 1) \
printk(KERN_DEBUG "sm_ftl" ": " format "
", ## __VA_ARGS__)
static void sm_erase_callback(struct erase_info *self);
static int sm_erase_block(struct sm_ftl *ftl, int zone_num, uint16_t block,
int put_free);
static void sm_mark_block_bad(struct sm_ftl *ftl, int zone_num, int block);
static int sm_recheck_media(struct sm_ftl *ftl);
|