Mercurial > flash_v2
annotate packages/io/flash/current/src/flash_legacy.h @ 1760:9abe5ac74a1a
Correctly handle scenario where there are multiple flash devices but
only one initialized successfully
| author | bartv |
|---|---|
| date | Sun, 28 Nov 2004 19:10:03 +0000 |
| parents | fac0499dabd6 |
| children | 8667859d61ab |
| rev | line source |
|---|---|
|
1750
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
1 //========================================================================== |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
2 // |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
3 // flash_legacy.h |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
4 // |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
5 // Flash programming - some internal implementation details. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
6 // |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
7 //========================================================================== |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
8 //####ECOSGPLCOPYRIGHTBEGIN#### |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
9 // ------------------------------------------- |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
10 // This file is part of eCos, the Embedded Configurable Operating System. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
11 // copyright (C) 2004 Andrew Lunn |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
12 // Copyright (C) 2003 Gary Thomas |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
13 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
14 // |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
15 // eCos is free software; you can redistribute it and/or modify it under |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
16 // the terms of the GNU General Public License as published by the Free |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
17 // Software Foundation; either version 2 or (at your option) any later version. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
18 // |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
19 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
20 // WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
21 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
22 // for more details. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
23 // |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
24 // You should have received a copy of the GNU General Public License along |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
25 // with eCos; if not, write to the Free Software Foundation, Inc., |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
26 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
27 // |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
28 // As a special exception, if other files instantiate templates or use macros |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
29 // or inline functions from this file, or you compile this file and link it |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
30 // with other works to produce a work based on this file, this file does not |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
31 // by itself cause the resulting work to be covered by the GNU General Public |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
32 // License. However the source code for this file must still be made available |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
33 // in accordance with section (3) of the GNU General Public License. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
34 // |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
35 // This exception does not invalidate any other reasons why a work based on |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
36 // this file might be covered by the GNU General Public License. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
37 // |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
38 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
39 // at http://sources.redhat.com/ecos/ecos-license/ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
40 // ------------------------------------------- |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
41 //####ECOSGPLCOPYRIGHTEND#### |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
42 //========================================================================== |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
43 //#####DESCRIPTIONBEGIN#### |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
44 // |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
45 // Author(s): gthomas |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
46 // Contributors: gthomas, Andrew Lunn |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
47 // Date: 2000-07-14 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
48 // Purpose: |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
49 // Description: |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
50 // |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
51 //####DESCRIPTIONEND#### |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
52 // |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
53 //========================================================================== |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
54 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
55 #include <pkgconf/system.h> |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
56 #include <pkgconf/io_flash.h> |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
57 #include <cyg/infra/cyg_type.h> |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
58 #include <cyg/hal/hal_arch.h> |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
59 #include <cyg/hal/hal_cache.h> |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
60 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
61 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
62 // Some FLASH devices may require additional support, e.g. to turn on |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
63 // appropriate voltage drivers, before any operation. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
64 #ifdef CYGIMP_FLASH_ENABLE |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
65 # define FLASH_Enable CYGIMP_FLASH_ENABLE |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
66 extern void CYGIMP_FLASH_ENABLE(void *, void *); |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
67 #else |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
68 # define FLASH_Enable(_start_, _end_) CYG_EMPTY_STATEMENT |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
69 #endif |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
70 #ifdef CYGIMP_FLASH_DISABLE |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
71 # define FLASH_Disable CYGIMP_FLASH_DISABLE |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
72 extern void CYGIMP_FLASH_DISABLE(void *, void *); |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
73 #else |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
74 # define FLASH_Disable(_start_, _end_) CYG_EMPTY_STATEMENT |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
75 #endif |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
76 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
77 // |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
78 // Some platforms have a DIP switch or jumper that tells the software that |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
79 // the flash is write protected. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
80 // |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
81 #ifdef CYGSEM_IO_FLASH_SOFT_WRITE_PROTECT |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
82 externC cyg_bool plf_flash_query_soft_wp(void *addr, int len); |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
83 #endif |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
84 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
85 //--------------------------------------------------------------------------- |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
86 // Execution of flash code must be done inside a |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
87 // HAL_FLASH_CACHES_OFF/HAL_FLASH_CACHES_ON region - disabling the |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
88 // cache on unified cache systems is necessary to prevent burst access |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
89 // to the flash area being programmed. With Harvard style caches, only |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
90 // the data cache needs to be disabled, but the instruction cache is |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
91 // disabled for consistency. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
92 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
93 // Targets may provide alternative implementations for these macros in |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
94 // the hal_cache.h (or var/plf) files. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
95 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
96 // The first part below is a generic, optimal implementation. The |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
97 // second part is the old implementation that has been tested to work |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
98 // on some targets - but it is not be suitable for targets that would |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
99 // do burst access to the flash (it does not disable the data cache). |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
100 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
101 // Both implementations must be called with interrupts disabled. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
102 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
103 // NOTE: Do _not_ change any of the below macros without checking that |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
104 // the changed code still works on _all_ platforms that rely on these |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
105 // macros. There is no such thing as logical and correct when dealing |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
106 // with different cache and IO models, so _do not_ mess with this code |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
107 // unless you test it properly afterwards. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
108 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
109 #ifndef HAL_FLASH_CACHES_OFF |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
110 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
111 // Some drivers have only been tested with the old macros below. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
112 #ifndef HAL_FLASH_CACHES_OLD_MACROS |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
113 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
114 #ifdef HAL_CACHE_UNIFIED |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
115 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
116 // Note: the ucache code has not been tested yet on any target. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
117 #define HAL_FLASH_CACHES_OFF(_d_, _i_) \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
118 CYG_MACRO_START \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
119 _i_ = 0; /* avoids warning */ \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
120 HAL_UCACHE_IS_ENABLED(_d_); \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
121 HAL_UCACHE_SYNC(); \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
122 HAL_UCACHE_INVALIDATE_ALL(); \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
123 HAL_UCACHE_DISABLE(); \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
124 CYG_MACRO_END |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
125 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
126 #define HAL_FLASH_CACHES_ON(_d_, _i_) \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
127 CYG_MACRO_START \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
128 if (_d_) HAL_UCACHE_ENABLE(); \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
129 CYG_MACRO_END |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
130 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
131 #else // HAL_CACHE_UNIFIED |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
132 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
133 #define HAL_FLASH_CACHES_OFF(_d_, _i_) \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
134 CYG_MACRO_START \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
135 _i_ = 0; /* avoids warning */ \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
136 HAL_DCACHE_IS_ENABLED(_d_); \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
137 HAL_DCACHE_SYNC(); \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
138 HAL_DCACHE_INVALIDATE_ALL(); \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
139 HAL_DCACHE_DISABLE(); \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
140 HAL_ICACHE_INVALIDATE_ALL(); \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
141 CYG_MACRO_END |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
142 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
143 #define HAL_FLASH_CACHES_ON(_d_, _i_) \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
144 CYG_MACRO_START \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
145 if (_d_) HAL_DCACHE_ENABLE(); \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
146 CYG_MACRO_END |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
147 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
148 #endif // HAL_CACHE_UNIFIED |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
149 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
150 #else // HAL_FLASH_CACHES_OLD_MACROS |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
151 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
152 // Note: This implementation is broken as it will always enable the i-cache |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
153 // even if it was not enabled before. It also doesn't work if the |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
154 // target uses burst access to flash since the d-cache is left enabled. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
155 // However, this does not mean you can change this code! Leave it as |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
156 // is - if you want a different implementation, provide it in the |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
157 // arch/var/platform cache header file. |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
158 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
159 #define HAL_FLASH_CACHES_OFF(_d_, _i_) \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
160 _d_ = 0; /* avoids warning */ \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
161 _i_ = 0; /* avoids warning */ \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
162 HAL_DCACHE_SYNC(); \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
163 HAL_ICACHE_DISABLE(); |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
164 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
165 #define HAL_FLASH_CACHES_ON(_d_, _i_) \ |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
166 HAL_ICACHE_ENABLE(); |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
167 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
168 #endif // HAL_FLASH_CACHES_OLD_MACROS |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
169 |
|
fac0499dabd6
Move legacy macros from a public to an internal header file, to
bartv
parents:
diff
changeset
|
170 #endif // HAL_FLASH_CACHES_OFF |
