annotate packages/io/nand/current/include/nand_internal.h @ 3391:46870ac5c312

io/nand: Create internal nandi_write_page_raw_explicit_ecc interface for use by test programs.
author Ross Younger <wry@ecoscentric.com>
date Mon, 20 Oct 2014 21:06:39 +1300
parents 77f93339ffd8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3388
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
1 #ifndef CYGONCE_NAND_INTERNAL_H
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
2 # define CYGONCE_NAND_INTERNAL_H
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
3 //=============================================================================
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
4 //
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
5 // nand_internal.h
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
6 //
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
7 // NAND library internal calls, for use by drivers and the BBT.
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
8 // This file should not be included by application code.
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
9 //
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
10 //=============================================================================
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
11 // ####ECOSGPLCOPYRIGHTBEGIN####
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
12 // -------------------------------------------
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
13 // This file is part of eCos, the Embedded Configurable Operating System.
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
14 // Copyright (C) 2009 eCosCentric Limited.
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
15 //
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
16 // eCos is free software; you can redistribute it and/or modify it under
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
17 // the terms of the GNU General Public License as published by the Free
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
18 // Software Foundation; either version 2 or (at your option) any later
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
19 // version.
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
20 //
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
21 // eCos is distributed in the hope that it will be useful, but WITHOUT
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
22 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
23 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
24 // for more details.
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
25 //
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
26 // You should have received a copy of the GNU General Public License
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
27 // along with eCos; if not, write to the Free Software Foundation, Inc.,
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
28 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
29 //
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
30 // As a special exception, if other files instantiate templates or use
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
31 // macros or inline functions from this file, or you compile this file
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
32 // and link it with other works to produce a work based on this file,
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
33 // this file does not by itself cause the resulting work to be covered by
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
34 // the GNU General Public License. However the source code for this file
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
35 // must still be made available in accordance with section (3) of the GNU
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
36 // General Public License v2.
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
37 //
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
38 // This exception does not invalidate any other reasons why a work based
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
39 // on this file might be covered by the GNU General Public License.
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
40 // -------------------------------------------
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
41 // ####ECOSGPLCOPYRIGHTEND####
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
42 //=============================================================================
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
43 //#####DESCRIPTIONBEGIN####
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
44 //
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
45 // Author(s): wry
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
46 // Date: 2009-03-11
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
47 //
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
48 //####DESCRIPTIONEND####
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
49 //=============================================================================
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
50
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
51 #ifndef CYG_NAND_ALLOW_INTERNALS
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
52 /* BEWARE!
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
53 *
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
54 * Applications should not include this file.
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
55 * All the contents are internal interfaces and subject to
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
56 * change without notice.
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
57 */
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
58 #error "Applications should not include this file directly."
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
59 #endif
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
60
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
61
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
62 #include <cyg/nand/nand_device.h>
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
63 #include <cyg/nand/nand.h>
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
64 #include <pkgconf/io_nand.h>
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
65
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
66 /* Raw unchecked NAND access, for use by the BBT and drivers ========= */
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
67
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
68 /* Takes a DEVICE address. Caller must hold the devlock! */
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
69 int nandi_read_whole_page_raw(cyg_nand_device *dev, cyg_nand_page_addr page,
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
70 CYG_BYTE * dest,
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
71 CYG_BYTE * spare, size_t spare_size,
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
72 int check_ecc);
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
73
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
74 /* Takes a DEVICE address. Caller must hold the devlock! */
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
75 int nandi_write_page_raw(cyg_nand_device *dev, cyg_nand_page_addr page,
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
76 const CYG_BYTE * src,
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
77 const CYG_BYTE * spare, size_t spare_size);
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
78
3391
46870ac5c312 io/nand: Create internal nandi_write_page_raw_explicit_ecc interface for use by test programs.
Ross Younger <wry@ecoscentric.com>
parents: 3388
diff changeset
79 /* Takes a DEVICE address. Caller must hold the devlock!
46870ac5c312 io/nand: Create internal nandi_write_page_raw_explicit_ecc interface for use by test programs.
Ross Younger <wry@ecoscentric.com>
parents: 3388
diff changeset
80 * 'ecc' overrides the ECC read from the algorithm.
46870ac5c312 io/nand: Create internal nandi_write_page_raw_explicit_ecc interface for use by test programs.
Ross Younger <wry@ecoscentric.com>
parents: 3388
diff changeset
81 * This is for use by code which tests how well the ECC algorithm
46870ac5c312 io/nand: Create internal nandi_write_page_raw_explicit_ecc interface for use by test programs.
Ross Younger <wry@ecoscentric.com>
parents: 3388
diff changeset
82 * is performing.
46870ac5c312 io/nand: Create internal nandi_write_page_raw_explicit_ecc interface for use by test programs.
Ross Younger <wry@ecoscentric.com>
parents: 3388
diff changeset
83 * 'ecc_size' must match CYG_NAND_ECCPERPAGE(dev).
46870ac5c312 io/nand: Create internal nandi_write_page_raw_explicit_ecc interface for use by test programs.
Ross Younger <wry@ecoscentric.com>
parents: 3388
diff changeset
84 */
46870ac5c312 io/nand: Create internal nandi_write_page_raw_explicit_ecc interface for use by test programs.
Ross Younger <wry@ecoscentric.com>
parents: 3388
diff changeset
85 int nandi_write_page_raw_explicit_ecc(
46870ac5c312 io/nand: Create internal nandi_write_page_raw_explicit_ecc interface for use by test programs.
Ross Younger <wry@ecoscentric.com>
parents: 3388
diff changeset
86 cyg_nand_device *dev, cyg_nand_page_addr page,
46870ac5c312 io/nand: Create internal nandi_write_page_raw_explicit_ecc interface for use by test programs.
Ross Younger <wry@ecoscentric.com>
parents: 3388
diff changeset
87 const CYG_BYTE * src,
46870ac5c312 io/nand: Create internal nandi_write_page_raw_explicit_ecc interface for use by test programs.
Ross Younger <wry@ecoscentric.com>
parents: 3388
diff changeset
88 const CYG_BYTE * spare, size_t spare_size,
46870ac5c312 io/nand: Create internal nandi_write_page_raw_explicit_ecc interface for use by test programs.
Ross Younger <wry@ecoscentric.com>
parents: 3388
diff changeset
89 const CYG_BYTE * ecc, size_t ecc_size);
46870ac5c312 io/nand: Create internal nandi_write_page_raw_explicit_ecc interface for use by test programs.
Ross Younger <wry@ecoscentric.com>
parents: 3388
diff changeset
90
3388
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
91 /* NOTE for driver authors:
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
92 * If calling these functions from within a plf_partition_setup function,
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
93 * i.e. within the cyg_nand_lookup call chain, the device lock is
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
94 * irrelevant as it has not yet been set up. */
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
95
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
96 /* Code outside of the BBT can use the pagebuffer ==================== */
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
97 CYG_BYTE* nandi_grab_pagebuf(void);
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
98 void nandi_release_pagebuf(void);
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
99
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
100 /* =================================================================== */
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
101
77f93339ffd8 io/nand include/nand_internal.h: Create header to expose internal functions to NAND drivers.
Ross Younger <wry@ecoscentric.com>
parents:
diff changeset
102 #endif