1 |
786 |
skrzyp |
# ====================================================================
|
2 |
|
|
#
|
3 |
|
|
# flash_am29xxxxx_v2.cdl
|
4 |
|
|
#
|
5 |
|
|
# Device driver for AMD am29xxxxx flash chips and compatibles
|
6 |
|
|
#
|
7 |
|
|
# ====================================================================
|
8 |
|
|
## ####ECOSGPLCOPYRIGHTBEGIN####
|
9 |
|
|
## -------------------------------------------
|
10 |
|
|
## This file is part of eCos, the Embedded Configurable Operating System.
|
11 |
|
|
## Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
12 |
|
|
##
|
13 |
|
|
## eCos is free software; you can redistribute it and/or modify it under
|
14 |
|
|
## the terms of the GNU General Public License as published by the Free
|
15 |
|
|
## Software Foundation; either version 2 or (at your option) any later
|
16 |
|
|
## version.
|
17 |
|
|
##
|
18 |
|
|
## eCos is distributed in the hope that it will be useful, but WITHOUT
|
19 |
|
|
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
20 |
|
|
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
21 |
|
|
## for more details.
|
22 |
|
|
##
|
23 |
|
|
## You should have received a copy of the GNU General Public License
|
24 |
|
|
## along with eCos; if not, write to the Free Software Foundation, Inc.,
|
25 |
|
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
26 |
|
|
##
|
27 |
|
|
## As a special exception, if other files instantiate templates or use
|
28 |
|
|
## macros or inline functions from this file, or you compile this file
|
29 |
|
|
## and link it with other works to produce a work based on this file,
|
30 |
|
|
## this file does not by itself cause the resulting work to be covered by
|
31 |
|
|
## the GNU General Public License. However the source code for this file
|
32 |
|
|
## must still be made available in accordance with section (3) of the GNU
|
33 |
|
|
## General Public License v2.
|
34 |
|
|
##
|
35 |
|
|
## This exception does not invalidate any other reasons why a work based
|
36 |
|
|
## on 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 |
|
|
cdl_package CYGPKG_DEVS_FLASH_AMD_AM29XXXXX_V2 {
|
50 |
|
|
display "AMD am29xxxxx flash memory support"
|
51 |
|
|
doc ref/devs-flash-am29xxxxx.html
|
52 |
|
|
parent CYGPKG_IO_FLASH
|
53 |
|
|
active_if CYGPKG_IO_FLASH
|
54 |
|
|
implements CYGHWR_IO_FLASH_DEVICE
|
55 |
|
|
include_dir cyg/io
|
56 |
|
|
compile am29xxxxx.c
|
57 |
|
|
|
58 |
|
|
description "
|
59 |
|
|
Flash memory support for AMD AM29xxxxx devices and compatibles.
|
60 |
|
|
This driver implements the V2 flash driver API"
|
61 |
|
|
|
62 |
|
|
cdl_option CYGNUM_DEVS_FLASH_AMD_AM29XXXXX_V2_PROGRAM_TIMEOUT {
|
63 |
|
|
display "Maximum number of iterations during a write"
|
64 |
|
|
flavor data
|
65 |
|
|
default_value 100000000
|
66 |
|
|
legal_values 1024 to 0x7fffffff
|
67 |
|
|
description "
|
68 |
|
|
Flash program operations may take a long time, and the driver
|
69 |
|
|
needs to poll the device to detect when the operation has
|
70 |
|
|
completed. This option controls the maximum number of iterations
|
71 |
|
|
of the polling loop, before the driver will give up. The timeout
|
72 |
|
|
should never actually trigger, as long as the hardware is
|
73 |
|
|
functioning correctly. If a timeout does occur the flash device
|
74 |
|
|
may be left in an inconsistent state. If very slow flash devices
|
75 |
|
|
are used then the platform HAL may require a larger timeout."
|
76 |
|
|
}
|
77 |
|
|
|
78 |
|
|
cdl_option CYGNUM_DEVS_FLASH_AMD_AM29XXXXX_V2_PROGRAM_DELAY {
|
79 |
|
|
display "Delay between words while programming"
|
80 |
|
|
flavor data
|
81 |
|
|
default_value 0
|
82 |
|
|
legal_values 0 to 0x7fffffff
|
83 |
|
|
description "The timings of certain processors and flash devices mean that
|
84 |
|
|
a short delay may be required between each word as it is programmed.
|
85 |
|
|
This option defines that delay in terms of iterations of a delay
|
86 |
|
|
loop."
|
87 |
|
|
}
|
88 |
|
|
|
89 |
|
|
cdl_option CYGNUM_DEVS_FLASH_AMD_AM29XXXXX_V2_ERASE_TIMEOUT {
|
90 |
|
|
display "Maximum number of iterations during a block erase"
|
91 |
|
|
flavor data
|
92 |
|
|
default_value 100000000
|
93 |
|
|
legal_values 1024 to 0x7fffffff
|
94 |
|
|
description "
|
95 |
|
|
The driver needs to poll the flash device during a block erase
|
96 |
|
|
to detect when the operation has completed. This option controls
|
97 |
|
|
the maximum number of iterations of the polling loop, before the
|
98 |
|
|
driver will give up. The timeout should never actually trigger,
|
99 |
|
|
as long as the hardware is functioning correctly. If a timeout
|
100 |
|
|
does occur the flash device may be left in an inconsistent state.
|
101 |
|
|
If very slow flash devices are used then the platform HAL may
|
102 |
|
|
require a larger timeout."
|
103 |
|
|
}
|
104 |
|
|
|
105 |
|
|
cdl_option CYGIMP_DEVS_FLASH_AMD_AM29XXXXX_V2_LEAVE_INTERRUPTS_ENABLED {
|
106 |
|
|
display "Leave interrupts enabled during flash operations"
|
107 |
|
|
active_if { ! CYGHWR_DEVS_FLASH_AMD_AM29XXXXX_V2_CACHED_ONLY }
|
108 |
|
|
default_value 0
|
109 |
|
|
description "
|
110 |
|
|
On typical hardware erasing or programming a flash block requires
|
111 |
|
|
disabling interrupts and possibly the cache. During these operations
|
112 |
|
|
some or all of the flash hardware will be unusable, and disabling
|
113 |
|
|
interrupts is the only reliable way of ensuring that no interrupt
|
114 |
|
|
handler or other thread will try to access the flash in the middle
|
115 |
|
|
of the operation. This can have a major impact on the real-time
|
116 |
|
|
responsiveness of typical applications.
|
117 |
|
|
|
118 |
|
|
In some circumstances it is possible to leave interrupts enabled.
|
119 |
|
|
The application must run in RAM, not in flash. There must be some
|
120 |
|
|
way of accessing the flash which bypasses the cache. The application
|
121 |
|
|
must only access the flash using the proper API, for example
|
122 |
|
|
cyg_flash_read(), which ensures that only one thread at a time can
|
123 |
|
|
access a flash device. Finally there must be no possibility of
|
124 |
|
|
entering a ROM monitor running in flash. This can happen if RedBoot
|
125 |
|
|
is used as the ROM monitor and virtual vectors are enabled. It can
|
126 |
|
|
also happen when debugging the application via RedBoot or gdb stubs.
|
127 |
|
|
|
128 |
|
|
If the application can absolutely guarantee that the flash will not be
|
129 |
|
|
accessed during a flash operation then it is possible to enable this option,
|
130 |
|
|
improving interrupt latency. Any unexpected flash accesses are likely
|
131 |
|
|
to cause a system crash. If in doubt leave this option disabled."
|
132 |
|
|
}
|
133 |
|
|
|
134 |
|
|
cdl_interface CYGHWR_DEVS_FLASH_AMD_AM29XXXXX_V2_CACHED_ONLY {
|
135 |
|
|
display "Flash memory accesses are always cached"
|
136 |
|
|
flavor bool
|
137 |
|
|
description "
|
138 |
|
|
Flash memory devices are usually accessed via the cache to achieve
|
139 |
|
|
acceptable performance. However erase and program operations need
|
140 |
|
|
to access the flash directly, bypassing the cache. On some targets
|
141 |
|
|
it is possible to access the flash in an uncached part of the
|
142 |
|
|
address space, for example by suitable MMU settings. On other
|
143 |
|
|
targets it is necessary to disable the cache while erasing or
|
144 |
|
|
programming blocks of flash. In the latter case the platform HAL
|
145 |
|
|
will implement this interface."
|
146 |
|
|
}
|
147 |
|
|
|
148 |
|
|
cdl_interface CYGHWR_DEVS_FLASH_AMD_AM29XXXXX_V2_CFI_BOGOSITY {
|
149 |
|
|
display "Include support for unusual CFI implementation"
|
150 |
|
|
flavor bool
|
151 |
|
|
description "
|
152 |
|
|
CFI, Common Flash Interface, is a standard allowing device drivers
|
153 |
|
|
to query the hardware for characteristics such as the erase region
|
154 |
|
|
layout. Some flash chips have a somewhat strange implementation of CFI,
|
155 |
|
|
requiring extra code within the device driver. If CFI is used for device
|
156 |
|
|
initialization and if the platform may come with one of these flash chips
|
157 |
|
|
then the platform HAL will implement this interface."
|
158 |
|
|
}
|
159 |
|
|
|
160 |
|
|
cdl_interface CYGHWR_DEVS_FLASH_AMD_AM29XXXXX_V2_RESET_NEEDS_RESUME {
|
161 |
|
|
display "Erase/program resume is needed after reset"
|
162 |
|
|
flavor bool
|
163 |
|
|
description "
|
164 |
|
|
With true AMD-compatible flash parts, a reset command will also
|
165 |
|
|
abort any suspended erase or program operations. But on some
|
166 |
|
|
parts which are nearly but not quite compatible, such as AT49xxxxx,
|
167 |
|
|
this does not happen, and so an erase/program resume command is
|
168 |
|
|
needed after a soft reset in order to be able to use the chip."
|
169 |
|
|
}
|
170 |
|
|
|
171 |
|
|
cdl_option CYGNUM_DEVS_FLASH_AMD_AM29XXXXX_V2_ERASE_REGIONS {
|
172 |
|
|
display "Number of different erase regions"
|
173 |
|
|
flavor data
|
174 |
|
|
default_value 4
|
175 |
|
|
legal_values 1 to 64
|
176 |
|
|
description "
|
177 |
|
|
Flash devices vary widely in the way the various flash blocks are
|
178 |
|
|
laid out. In uniform devices all flash blocks are the same size,
|
179 |
|
|
for example 64 blocks of 64K each. Other devices have a boot block,
|
180 |
|
|
where one of the big blocks is subdivided into a number of smaller
|
181 |
|
|
ones. For example there could be a 16K block, followed by two 8K blocks,
|
182 |
|
|
then a 32K block, and finally 63 64K blocks. Each sequence of blocks
|
183 |
|
|
of a given size is known as an erase region, so a uniform device has
|
184 |
|
|
a single erase region and the above boot block device has four
|
185 |
|
|
erase regions. The driver needs to know the maximum number of erase
|
186 |
|
|
regions that may be present, especially if CFI is used to determine
|
187 |
|
|
the block details at run-time. Typically this option is controlled
|
188 |
|
|
by a requires property in the platform HAL, so users do not need
|
189 |
|
|
to edit it."
|
190 |
|
|
}
|
191 |
|
|
|
192 |
|
|
cdl_component CYGPKG_DEVS_FLASH_AMD_AM29XXXXX_V2_OPTIONS {
|
193 |
|
|
display "AMD AM29xxxxx driver build options"
|
194 |
|
|
flavor none
|
195 |
|
|
description "
|
196 |
|
|
Package specific build options including control over
|
197 |
|
|
compiler flags used only in building the AMD am29xxxxx
|
198 |
|
|
flash driver, and details of which tests are built."
|
199 |
|
|
|
200 |
|
|
cdl_option CYGPKG_DEVS_FLASH_AMD_AM29XXXXX_V2_CFLAGS_ADD {
|
201 |
|
|
display "Additional compiler flags"
|
202 |
|
|
flavor data
|
203 |
|
|
no_define
|
204 |
|
|
default_value { "" }
|
205 |
|
|
description "
|
206 |
|
|
This option modifies the set of compiler flags for
|
207 |
|
|
building the AMD am29xxxxx flash driver. These flags
|
208 |
|
|
are used in addition to the set of global flags."
|
209 |
|
|
}
|
210 |
|
|
|
211 |
|
|
cdl_option CYGPKG_DEVS_FLASH_AMD_AM29XXXXX_V2_CFLAGS_REMOVE {
|
212 |
|
|
display "Suppressed compiler flags"
|
213 |
|
|
flavor data
|
214 |
|
|
no_define
|
215 |
|
|
default_value { "" }
|
216 |
|
|
description "
|
217 |
|
|
This option modifies the set of compiler flags for
|
218 |
|
|
building the AMD am29xxxxx flash driver. These flags
|
219 |
|
|
are removed from the set of global flags if present."
|
220 |
|
|
}
|
221 |
|
|
}
|
222 |
|
|
}
|