1 |
786 |
skrzyp |
#ifndef CYGONCE_DEVS_FLASH_AM29xxxxx_dev_V2_H
|
2 |
|
|
# define CYGONCE_DEVS_FLASH_AM29xxxxx_dev_V2_H
|
3 |
|
|
//==========================================================================
|
4 |
|
|
//
|
5 |
|
|
// am29xxxxx_dev.h
|
6 |
|
|
//
|
7 |
|
|
// Flash driver for the AMD family - driver details
|
8 |
|
|
//
|
9 |
|
|
//==========================================================================
|
10 |
|
|
// ####ECOSGPLCOPYRIGHTBEGIN####
|
11 |
|
|
// -------------------------------------------
|
12 |
|
|
// This file is part of eCos, the Embedded Configurable Operating System.
|
13 |
|
|
// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
14 |
|
|
//
|
15 |
|
|
// eCos is free software; you can redistribute it and/or modify it under
|
16 |
|
|
// the terms of the GNU General Public License as published by the Free
|
17 |
|
|
// Software Foundation; either version 2 or (at your option) any later
|
18 |
|
|
// version.
|
19 |
|
|
//
|
20 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT
|
21 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
22 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
23 |
|
|
// for more details.
|
24 |
|
|
//
|
25 |
|
|
// You should have received a copy of the GNU General Public License
|
26 |
|
|
// along with eCos; if not, write to the Free Software Foundation, Inc.,
|
27 |
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
28 |
|
|
//
|
29 |
|
|
// As a special exception, if other files instantiate templates or use
|
30 |
|
|
// macros or inline functions from this file, or you compile this file
|
31 |
|
|
// and link it with other works to produce a work based on this file,
|
32 |
|
|
// this file does not by itself cause the resulting work to be covered by
|
33 |
|
|
// the GNU General Public License. However the source code for this file
|
34 |
|
|
// must still be made available in accordance with section (3) of the GNU
|
35 |
|
|
// General Public License v2.
|
36 |
|
|
//
|
37 |
|
|
// This exception does not invalidate any other reasons why a work based
|
38 |
|
|
// on this file might be covered by the GNU General Public License.
|
39 |
|
|
// -------------------------------------------
|
40 |
|
|
// ####ECOSGPLCOPYRIGHTEND####
|
41 |
|
|
//==========================================================================
|
42 |
|
|
//#####DESCRIPTIONBEGIN####
|
43 |
|
|
//
|
44 |
|
|
// Author(s): bartv
|
45 |
|
|
// Contributors:
|
46 |
|
|
// Date: 2004-11-05
|
47 |
|
|
//
|
48 |
|
|
//####DESCRIPTIONEND####
|
49 |
|
|
//
|
50 |
|
|
//==========================================================================
|
51 |
|
|
|
52 |
|
|
#include <pkgconf/devs_flash_amd_am29xxxxx_v2.h>
|
53 |
|
|
#include <cyg/infra/cyg_type.h>
|
54 |
|
|
#include <cyg/io/flash.h>
|
55 |
|
|
#include <cyg/io/flash_dev.h>
|
56 |
|
|
|
57 |
|
|
externC int cyg_am29xxxxx_read_devid_8( struct cyg_flash_dev*);
|
58 |
|
|
externC int cyg_am29xxxxx_read_devid_16( struct cyg_flash_dev*);
|
59 |
|
|
externC int cyg_am29xxxxx_read_devid_32( struct cyg_flash_dev*);
|
60 |
|
|
externC int cyg_am29xxxxx_read_devid_88( struct cyg_flash_dev*);
|
61 |
|
|
externC int cyg_am29xxxxx_read_devid_8888( struct cyg_flash_dev*);
|
62 |
|
|
externC int cyg_am29xxxxx_read_devid_1616( struct cyg_flash_dev*);
|
63 |
|
|
externC int cyg_am29xxxxx_read_devid_16as8( struct cyg_flash_dev*);
|
64 |
|
|
|
65 |
|
|
externC int cyg_am29xxxxx_init_check_devid_8( struct cyg_flash_dev*);
|
66 |
|
|
externC int cyg_am29xxxxx_init_check_devid_16( struct cyg_flash_dev*);
|
67 |
|
|
externC int cyg_am29xxxxx_init_check_devid_32( struct cyg_flash_dev*);
|
68 |
|
|
externC int cyg_am29xxxxx_init_check_devid_88( struct cyg_flash_dev*);
|
69 |
|
|
externC int cyg_am29xxxxx_init_check_devid_8888( struct cyg_flash_dev*);
|
70 |
|
|
externC int cyg_am29xxxxx_init_check_devid_1616( struct cyg_flash_dev*);
|
71 |
|
|
externC int cyg_am29xxxxx_init_check_devid_16as8( struct cyg_flash_dev*);
|
72 |
|
|
|
73 |
|
|
externC int cyg_am29xxxxx_init_cfi_8( struct cyg_flash_dev*);
|
74 |
|
|
externC int cyg_am29xxxxx_init_cfi_16( struct cyg_flash_dev*);
|
75 |
|
|
externC int cyg_am29xxxxx_init_cfi_32( struct cyg_flash_dev*);
|
76 |
|
|
externC int cyg_am29xxxxx_init_cfi_88( struct cyg_flash_dev*);
|
77 |
|
|
externC int cyg_am29xxxxx_init_cfi_8888( struct cyg_flash_dev*);
|
78 |
|
|
externC int cyg_am29xxxxx_init_cfi_1616( struct cyg_flash_dev*);
|
79 |
|
|
externC int cyg_am29xxxxx_init_cfi_16as8( struct cyg_flash_dev*);
|
80 |
|
|
|
81 |
|
|
externC int cyg_am29xxxxx_erase_8( struct cyg_flash_dev*, cyg_flashaddr_t);
|
82 |
|
|
externC int cyg_am29xxxxx_erase_16( struct cyg_flash_dev*, cyg_flashaddr_t);
|
83 |
|
|
externC int cyg_am29xxxxx_erase_32( struct cyg_flash_dev*, cyg_flashaddr_t);
|
84 |
|
|
externC int cyg_am29xxxxx_erase_88( struct cyg_flash_dev*, cyg_flashaddr_t);
|
85 |
|
|
externC int cyg_am29xxxxx_erase_8888( struct cyg_flash_dev*, cyg_flashaddr_t);
|
86 |
|
|
externC int cyg_am29xxxxx_erase_1616( struct cyg_flash_dev*, cyg_flashaddr_t);
|
87 |
|
|
externC int cyg_am29xxxxx_erase_16as8( struct cyg_flash_dev*, cyg_flashaddr_t);
|
88 |
|
|
|
89 |
|
|
externC int cyg_am29xxxxx_program_8( struct cyg_flash_dev*, cyg_flashaddr_t, const void*, size_t);
|
90 |
|
|
externC int cyg_am29xxxxx_program_16( struct cyg_flash_dev*, cyg_flashaddr_t, const void*, size_t);
|
91 |
|
|
externC int cyg_am29xxxxx_program_32( struct cyg_flash_dev*, cyg_flashaddr_t, const void*, size_t);
|
92 |
|
|
externC int cyg_am29xxxxx_program_88( struct cyg_flash_dev*, cyg_flashaddr_t, const void*, size_t);
|
93 |
|
|
externC int cyg_am29xxxxx_program_8888( struct cyg_flash_dev*, cyg_flashaddr_t, const void*, size_t);
|
94 |
|
|
externC int cyg_am29xxxxx_program_1616( struct cyg_flash_dev*, cyg_flashaddr_t, const void*, size_t);
|
95 |
|
|
externC int cyg_am29xxxxx_program_16as8( struct cyg_flash_dev*, cyg_flashaddr_t, const void*, size_t);
|
96 |
|
|
|
97 |
|
|
externC int cyg_at49xxxx_softlock_8( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
98 |
|
|
externC int cyg_at49xxxx_softlock_16( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
99 |
|
|
externC int cyg_at49xxxx_softlock_32( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
100 |
|
|
externC int cyg_at49xxxx_softlock_88( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
101 |
|
|
externC int cyg_at49xxxx_softlock_8888( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
102 |
|
|
externC int cyg_at49xxxx_softlock_1616( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
103 |
|
|
externC int cyg_at49xxxx_softlock_16as8( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
104 |
|
|
|
105 |
|
|
externC int cyg_at49xxxx_hardlock_8( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
106 |
|
|
externC int cyg_at49xxxx_hardlock_16( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
107 |
|
|
externC int cyg_at49xxxx_hardlock_32( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
108 |
|
|
externC int cyg_at49xxxx_hardlock_88( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
109 |
|
|
externC int cyg_at49xxxx_hardlock_8888( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
110 |
|
|
externC int cyg_at49xxxx_hardlock_1616( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
111 |
|
|
externC int cyg_at49xxxx_hardlock_16as8( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
112 |
|
|
|
113 |
|
|
externC int cyg_at49xxxx_unlock_8( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
114 |
|
|
externC int cyg_at49xxxx_unlock_16( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
115 |
|
|
externC int cyg_at49xxxx_unlock_32( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
116 |
|
|
externC int cyg_at49xxxx_unlock_88( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
117 |
|
|
externC int cyg_at49xxxx_unlock_8888( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
118 |
|
|
externC int cyg_at49xxxx_unlock_1616( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
119 |
|
|
externC int cyg_at49xxxx_unlock_16as8( struct cyg_flash_dev*, const cyg_flashaddr_t );
|
120 |
|
|
|
121 |
|
|
// FIXME: add program_buffered() support as per e.g. the AM29LV128
|
122 |
|
|
// FIXME: add software lock/unlock support as per e.g. the AM29BDS640
|
123 |
|
|
|
124 |
|
|
// The driver-specific data, pointed at by the priv field in a
|
125 |
|
|
// a cyg_flash_dev structure.
|
126 |
|
|
typedef struct cyg_am29xxxxx_dev {
|
127 |
|
|
// The device id, mainly for use by the init_check_devid() routines
|
128 |
|
|
cyg_uint32 devid;
|
129 |
|
|
// Space for the block_info fields needed for the cyg_flash_dev.
|
130 |
|
|
// These can be statically initialized, or dynamically via
|
131 |
|
|
// init_cfi().
|
132 |
|
|
cyg_flash_block_info_t block_info[CYGNUM_DEVS_FLASH_AMD_AM29XXXXX_V2_ERASE_REGIONS];
|
133 |
|
|
} cyg_am29xxxxx_dev;
|
134 |
|
|
|
135 |
|
|
// TODO: An AM29 specific macro could optimise the common case of CYG_FLASH_FUNS.
|
136 |
|
|
// Bart and Jifl discussed this in mid July/start Aug 2005.
|
137 |
|
|
|
138 |
|
|
#endif // CYGONCE_DEVS_FLASH_AM29xxxxx_dev_V2_H
|