Initial cut of the open ath9k htc firmware.
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / build / magpie_1_1 / sboot / athos / src / xtos / memep-enable.S
1 // memep-enable.S  --  Turn on local memory ECC/parity checking
2 // $Id: //depot/rel/Cottonwood/Xtensa/OS/xtos/memep-enable.S#3 $
3
4 // Copyright (c) 2006-2010 Tensilica Inc.
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining
7 // a copy of this software and associated documentation files (the
8 // "Software"), to deal in the Software without restriction, including
9 // without limitation the rights to use, copy, modify, merge, publish,
10 // distribute, sublicense, and/or sell copies of the Software, and to
11 // permit persons to whom the Software is furnished to do so, subject to
12 // the following conditions:
13 //
14 // The above copyright notice and this permission notice shall be included
15 // in all copies or substantial portions of the Software.
16 //
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
25 #include <xtensa/coreasm.h>
26
27
28         /*
29          *  void  _xtos_memep_enable(int flags);
30          *
31          *  Turn on local memory ECC/parity checking, for both
32          *  data access and instruction fetch.
33          *
34          *  For now, flags are ignored.  Caller is expected to pass zero.
35          *
36          *  _xtos_memep_initrams() must have already been called, if necessary,
37          *  to ensure all ECC/parity bits are valid in any local instruction
38          *  or data RAM.  The normal reset vector sequence already takes care
39          *  of initializing any local cache ECC/parity bits.
40          */
41         .text
42         .align  4
43         .global _xtos_memep_enable
44 _xtos_memep_enable:
45         abi_entry
46
47 #if XCHAL_HAVE_MEM_ECC_PARITY
48
49         // Local Memory ECC/Parity option initialization
50         //
51         //  NOTE:  We turn on exceptions on correctable errors and correct
52         //      them in the memory error handler.
53         movi    a2, MESR_ERRENAB | MESR_DATEXC | MESR_INSEXC
54         wsr     a2, MESR
55         isync
56
57 #endif /* XCHAL_HAVE_MEM_ECC_PARITY */
58
59         movi    a2, 0           // successfully turned on what we could
60         abi_return
61
62         .size   _xtos_memep_enable, . - _xtos_memep_enable
63