nand_bbt.h revision 1.2.6.2 1 1.2.6.2 matt /* $NetBSD: nand_bbt.h,v 1.2.6.2 2011/07/26 03:22:27 matt Exp $ */
2 1.2.6.2 matt
3 1.2.6.2 matt /*-
4 1.2.6.2 matt * Copyright (c) 2010 Department of Software Engineering,
5 1.2.6.2 matt * University of Szeged, Hungary
6 1.2.6.2 matt * Copyright (c) 2010 Adam Hoka <ahoka (at) NetBSD.org>
7 1.2.6.2 matt * All rights reserved.
8 1.2.6.2 matt *
9 1.2.6.2 matt * This code is derived from software contributed to The NetBSD Foundation
10 1.2.6.2 matt * by the Department of Software Engineering, University of Szeged, Hungary
11 1.2.6.2 matt *
12 1.2.6.2 matt * Redistribution and use in source and binary forms, with or without
13 1.2.6.2 matt * modification, are permitted provided that the following conditions
14 1.2.6.2 matt * are met:
15 1.2.6.2 matt * 1. Redistributions of source code must retain the above copyright
16 1.2.6.2 matt * notice, this list of conditions and the following disclaimer.
17 1.2.6.2 matt * 2. Redistributions in binary form must reproduce the above copyright
18 1.2.6.2 matt * notice, this list of conditions and the following disclaimer in the
19 1.2.6.2 matt * documentation and/or other materials provided with the distribution.
20 1.2.6.2 matt *
21 1.2.6.2 matt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 1.2.6.2 matt * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 1.2.6.2 matt * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 1.2.6.2 matt * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 1.2.6.2 matt * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 1.2.6.2 matt * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 1.2.6.2 matt * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28 1.2.6.2 matt * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 1.2.6.2 matt * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 1.2.6.2 matt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 1.2.6.2 matt * SUCH DAMAGE.
32 1.2.6.2 matt */
33 1.2.6.2 matt
34 1.2.6.2 matt #ifndef _NAND_BBT_H_
35 1.2.6.2 matt #define _NAND_BBT_H_
36 1.2.6.2 matt
37 1.2.6.2 matt enum {
38 1.2.6.2 matt NAND_BBT_MARKER_FACTORY_BAD = 0x00, /* 00 */
39 1.2.6.2 matt NAND_BBT_MARKER_WORNOUT_BAD = 0x01, /* 01 */
40 1.2.6.2 matt NAND_BBT_MARKER_RESERVED = 0x02, /* 10 */
41 1.2.6.2 matt NAND_BBT_MARKER_GOOD = 0x03 /* 11 */
42 1.2.6.2 matt };
43 1.2.6.2 matt
44 1.2.6.2 matt enum {
45 1.2.6.2 matt NAND_BBT_OFFSET = 0x0e
46 1.2.6.2 matt };
47 1.2.6.2 matt
48 1.2.6.2 matt void nand_bbt_init(device_t);
49 1.2.6.2 matt void nand_bbt_detach(device_t);
50 1.2.6.2 matt void nand_bbt_scan(device_t);
51 1.2.6.2 matt bool nand_bbt_update(device_t);
52 1.2.6.2 matt bool nand_bbt_load(device_t);
53 1.2.6.2 matt void nand_bbt_block_mark(device_t, flash_off_t, uint8_t);
54 1.2.6.2 matt void nand_bbt_block_markbad(device_t, flash_off_t);
55 1.2.6.2 matt void nand_bbt_block_markfactorybad(device_t, flash_off_t);
56 1.2.6.2 matt bool nand_bbt_block_isbad(device_t, flash_off_t);
57 1.2.6.2 matt
58 1.2.6.2 matt #endif
59