diff options
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/nand_id.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/firmware/drivers/nand_id.c b/firmware/drivers/nand_id.c index 4dc1ec1ceb..dfb96c8820 100644 --- a/firmware/drivers/nand_id.c +++ b/firmware/drivers/nand_id.c | |||
@@ -24,35 +24,38 @@ | |||
24 | 24 | ||
25 | struct nand_manufacturer | 25 | struct nand_manufacturer |
26 | { | 26 | { |
27 | unsigned char id; | 27 | unsigned char id; |
28 | struct nand_info* info; | 28 | struct nand_info* info; |
29 | unsigned short total; | 29 | unsigned short total; |
30 | }; | 30 | }; |
31 | 31 | ||
32 | /* { pages_per_block, blocks_per_bank, page_size, spare_size, col_cycles, row_cycles } */ | ||
33 | |||
34 | static const struct nand_info samsung[] = | 32 | static const struct nand_info samsung[] = |
35 | { | 33 | { |
36 | /* K9F4G08UOM */ | 34 | /* { id1, id2, pages_per_block, blocks_per_bank, page_size, spare_size, col_cycles, row_cycles } */ |
37 | {0xDC, 0x10, 64, 4096, 2048, 64, 2, 3}, | 35 | |
38 | /* K9K8G08UOM */ | 36 | /* K9F4G08UOM */ |
39 | {0xD3, 0x51, 64, 8192, 2048, 64, 2, 3}, | 37 | {0xDC, 0x10, 64, 4096, 2048, 64, 2, 3 }, |
40 | /* K9LAG08UOM */ | 38 | /* K9K8G08UOM */ |
41 | {0xD5, 0x55, 128, 8192, 2048, 64, 2, 3}, | 39 | {0xD3, 0x51, 64, 8192, 2048, 64, 2, 3 }, |
42 | /* K9LBG08UOM, K9HBG08U1M, K9MCG08U5M */ | 40 | /* K9LAG08UOM */ |
43 | {0xD7, 0x55, 128, 8192, 4096, 128, 2, 3} | 41 | {0xD5, 0x55, 128, 8192, 2048, 64, 2, 3 }, |
42 | /* K9LBG08UOM, K9HBG08U1M, K9MCG08U5M */ | ||
43 | {0xD7, 0x55, 128, 8192, 4096, 128, 2, 3 }, | ||
44 | }; | 44 | }; |
45 | 45 | ||
46 | #define M(id, x) {id, (struct nand_info*)x, (sizeof(x)/sizeof(struct nand_info))} | 46 | #define NI(id, x) {id, (struct nand_info*)x, (sizeof(x)/sizeof(struct nand_info))} |
47 | static const struct nand_manufacturer all[] = | 47 | static const struct nand_manufacturer all[] = |
48 | { | 48 | { |
49 | M(0xEC, samsung), | 49 | NI(0xEC, samsung), |
50 | }; | 50 | }; |
51 | 51 | ||
52 | // -------------------------------------------------------------------------------------------------- | ||
53 | |||
52 | struct nand_info* nand_identify(unsigned char data[5]) | 54 | struct nand_info* nand_identify(unsigned char data[5]) |
53 | { | 55 | { |
54 | unsigned int i; | 56 | unsigned int i; |
55 | int found = -1; | 57 | int found = -1; |
58 | |||
56 | for(i = 0; i < (sizeof(all)/sizeof(struct nand_manufacturer)); i++) | 59 | for(i = 0; i < (sizeof(all)/sizeof(struct nand_manufacturer)); i++) |
57 | { | 60 | { |
58 | if(data[0] == all[i].id) | 61 | if(data[0] == all[i].id) |
@@ -61,6 +64,7 @@ struct nand_info* nand_identify(unsigned char data[5]) | |||
61 | break; | 64 | break; |
62 | } | 65 | } |
63 | } | 66 | } |
67 | |||
64 | if(found < 0) | 68 | if(found < 0) |
65 | return NULL; | 69 | return NULL; |
66 | 70 | ||