|
1739
|
1 #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 eCosCentric Ltd |
|
|
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 version. |
|
|
18 // |
|
|
19 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY |
|
|
20 // WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
|
21 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
|
22 // for more details. |
|
|
23 // |
|
|
24 // You should have received a copy of the GNU General Public License along |
|
|
25 // with eCos; if not, write to the Free Software Foundation, Inc., |
|
|
26 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
|
|
27 // |
|
|
28 // As a special exception, if other files instantiate templates or use macros |
|
|
29 // or inline functions from this file, or you compile this file and link it |
|
|
30 // with other works to produce a work based on this file, this file does not |
|
|
31 // by itself cause the resulting work to be covered by the GNU General Public |
|
|
32 // License. However the source code for this file must still be made available |
|
|
33 // in accordance with section (3) of the GNU General Public License. |
|
|
34 // |
|
|
35 // This exception does not invalidate any other reasons why a work based on |
|
|
36 // this file might be covered by the GNU General Public License. |
|
|
37 // ------------------------------------------- |
|
|
38 //####ECOSGPLCOPYRIGHTEND#### |
|
|
39 //========================================================================== |
|
|
40 //#####DESCRIPTIONBEGIN#### |
|
|
41 // |
|
|
42 // Author(s): bartv |
|
|
43 // Contributors: |
|
|
44 // Date: 2004-11-05 |
|
|
45 // |
|
|
46 //####DESCRIPTIONEND#### |
|
|
47 // |
|
|
48 //========================================================================== |
|
|
49 |
|
|
50 #include <pkgconf/devs_flash_amd_am29xxxxx_v2.h> |
|
|
51 #include <cyg/infra/cyg_type.h> |
|
|
52 #include <cyg/io/flash.h> |
|
|
53 #include <cyg/io/flash_priv.h> |
|
|
54 |
|
|
55 externC int cyg_am29xxxxx_init_nop(struct cyg_flash_dev*); |
|
|
56 externC size_t cyg_am29xxxxx_query_nop(struct cyg_flash_dev*, void*, const size_t); |
|
|
57 externC int cyg_am29xxxxx_hwr_map_error_nop(struct cyg_flash_dev*, int); |
|
|
58 externC int cyg_am29xxxxx_lock_nop(struct cyg_flash_dev*, const cyg_flashaddr_t); |
|
|
59 externC int cyg_am29xxxxx_unlock_nop(struct cyg_flash_dev*, const cyg_flashaddr_t); |
|
|
60 |
|
|
61 externC int cyg_am29xxxxx_read_devid_8( struct cyg_flash_dev*); |
|
|
62 externC int cyg_am29xxxxx_read_devid_16( struct cyg_flash_dev*); |
|
|
63 externC int cyg_am29xxxxx_read_devid_32( struct cyg_flash_dev*); |
|
|
64 externC int cyg_am29xxxxx_read_devid_88( struct cyg_flash_dev*); |
|
|
65 externC int cyg_am29xxxxx_read_devid_8888( struct cyg_flash_dev*); |
|
|
66 externC int cyg_am29xxxxx_read_devid_1616( struct cyg_flash_dev*); |
|
|
67 externC int cyg_am29xxxxx_read_devid_16as8( struct cyg_flash_dev*); |
|
|
68 |
|
|
69 externC int cyg_am29xxxxx_init_check_devid_8( struct cyg_flash_dev*); |
|
|
70 externC int cyg_am29xxxxx_init_check_devid_16( struct cyg_flash_dev*); |
|
|
71 externC int cyg_am29xxxxx_init_check_devid_32( struct cyg_flash_dev*); |
|
|
72 externC int cyg_am29xxxxx_init_check_devid_88( struct cyg_flash_dev*); |
|
|
73 externC int cyg_am29xxxxx_init_check_devid_8888( struct cyg_flash_dev*); |
|
|
74 externC int cyg_am29xxxxx_init_check_devid_1616( struct cyg_flash_dev*); |
|
|
75 externC int cyg_am29xxxxx_init_check_devid_16as8( struct cyg_flash_dev*); |
|
|
76 |
|
|
77 externC int cyg_am29xxxxx_init_cfi_8( struct cyg_flash_dev*); |
|
|
78 externC int cyg_am29xxxxx_init_cfi_16( struct cyg_flash_dev*); |
|
|
79 externC int cyg_am29xxxxx_init_cfi_32( struct cyg_flash_dev*); |
|
|
80 externC int cyg_am29xxxxx_init_cfi_88( struct cyg_flash_dev*); |
|
|
81 externC int cyg_am29xxxxx_init_cfi_8888( struct cyg_flash_dev*); |
|
|
82 externC int cyg_am29xxxxx_init_cfi_1616( struct cyg_flash_dev*); |
|
|
83 externC int cyg_am29xxxxx_init_cfi_16as8( struct cyg_flash_dev*); |
|
|
84 |
|
|
85 externC int cyg_am29xxxxx_erase_8( struct cyg_flash_dev*, const cyg_flashaddr_t); |
|
|
86 externC int cyg_am29xxxxx_erase_16( struct cyg_flash_dev*, const cyg_flashaddr_t); |
|
|
87 externC int cyg_am29xxxxx_erase_32( struct cyg_flash_dev*, const cyg_flashaddr_t); |
|
|
88 externC int cyg_am29xxxxx_erase_88( struct cyg_flash_dev*, const cyg_flashaddr_t); |
|
|
89 externC int cyg_am29xxxxx_erase_8888( struct cyg_flash_dev*, const cyg_flashaddr_t); |
|
|
90 externC int cyg_am29xxxxx_erase_1616( struct cyg_flash_dev*, const cyg_flashaddr_t); |
|
|
91 externC int cyg_am29xxxxx_erase_16as8( struct cyg_flash_dev*, const cyg_flashaddr_t); |
|
|
92 |
|
|
93 externC int cyg_am29xxxxx_program_8( struct cyg_flash_dev*, const cyg_flashaddr_t, const void*, const size_t); |
|
|
94 externC int cyg_am29xxxxx_program_16( struct cyg_flash_dev*, const cyg_flashaddr_t, const void*, const size_t); |
|
|
95 externC int cyg_am29xxxxx_program_32( struct cyg_flash_dev*, const cyg_flashaddr_t, const void*, const size_t); |
|
|
96 externC int cyg_am29xxxxx_program_88( struct cyg_flash_dev*, const cyg_flashaddr_t, const void*, const size_t); |
|
|
97 externC int cyg_am29xxxxx_program_8888( struct cyg_flash_dev*, const cyg_flashaddr_t, const void*, const size_t); |
|
|
98 externC int cyg_am29xxxxx_program_1616( struct cyg_flash_dev*, const cyg_flashaddr_t, const void*, const size_t); |
|
|
99 externC int cyg_am29xxxxx_program_16as8( struct cyg_flash_dev*, const cyg_flashaddr_t, const void*, const size_t); |
|
|
100 |
|
|
101 // FIXME: add program_buffered() support as per e.g. the AM29LV128 |
|
|
102 // FIXME: add software lock/unlock support as per e.g. the AM29BDS640 |
|
|
103 |
|
|
104 // The driver-specific data, pointed at by the priv field in a |
|
|
105 // a cyg_flash_dev structure. |
|
|
106 typedef struct cyg_am29xxxxx_dev { |
|
|
107 // The device id, mainly for use by the init_check_devid() routines |
|
|
108 cyg_uint32 devid; |
|
|
109 // Space for the block_info fields needed for the cyg_flash_dev. |
|
|
110 // These can be statically initialized, or dynamically via |
|
|
111 // init_cfi(). |
|
|
112 cyg_block_info_t block_info[CYGNUM_DEVS_FLASH_AMD_AM29XXXXX_V2_ERASE_REGIONS]; |
|
|
113 } cyg_am29xxxxx_dev; |
|
|
114 |
|
|
115 #endif // CYGONCE_DEVS_FLASH_AM29xxxxx_dev_V2_H |