blob: cfac901574100efb5176af8e1812656a09b9f6ab [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*******************************************************************************
2 * Copyright (C) 2016, ZXIC Corporation.
3 *
4 * File Name:
5 * File Mark:
6 * Description:
7 * Others:
8 * Version: v1.0
9 * Author: zhouqi
10 * Date: 2013-8-21
11 * History 1:
12 * Date:
13 * Version:
14 * Author:
15 * Modification:
16 * History 2:
17 ********************************************************************************/
18
19#ifndef _ZX297520_NAND_H_
20#define _ZX297520_NAND_H_
21
22#define BAD_BLOCK 0x11
23#define BBT_SIZE 128
24
25
26#define NAND_MFR_TOSHIBA 0x98
27#define NAND_MFR_SAMSUNG 0xec
28#define NAND_MFR_MICRON 0x2C
29#define NAND_MFR_GIGADEVICE 0xC8
30#define NAND_MFR_WINBOND 0xEF
31#define NAND_MFR_PARAGON 0xA1
32#define NAND_MFR_HEYANGTEK 0xC9
33#define NAND_MFR_ZETTA 0xBA
34#define NAND_MFR_DOSILICON 0xE5
35#define NAND_MFR_FUDANWEI 0xA1
36
37#define NAND_DEVID_FDANWEI_1G 0xA5
38
39
40#define BBT_INFO_OOB_OFFSET_PARAGON 64
41#define BBT_INFO_OOB_VER_OFFSET_PARAGON 68
42#define BBT_INFO_OOB_OFFSET_HEYANGTEK 32
43#define BBT_INFO_OOB_VER_OFFSET_HEYANGTEK 64
44
45
46struct nand_bbt_descr {
47 int page;
48 int offs;
49 int len;
50 int veroffs;
51 uint8_t version;
52 int maxblocks;
53 uint8_t *pattern;
54};
55
56
57int nand_creat_bbt( void );
58uint32_t nand_block_isbad(uint32_t offset);
59
60
61#endif/*_ZX297520_NAND_H_*/
62
63