• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

BitSequence.cH A D18-Nov-20195.3 KiB19098

BlowFuse.cH A D18-Nov-20192.6 KiB8327

BlowFuseFram.cH A D18-Nov-20192.7 KiB8727

BlowFuseXv2.cH A D18-Nov-20193.7 KiB11349

Configure.cH A D18-Nov-20196 KiB217132

DisableDebugArm.cH A D18-Nov-20192.4 KiB7525

DummyHal430.cH A D18-Nov-20197.4 KiB12583

DummyHal432.cH A D18-Nov-20192.9 KiB6221

EemDataExchange.cH A D18-Nov-20193.2 KiB10235

EemDataExchangeAFE2xx.cH A D18-Nov-20191.9 KiB495

EemDataExchangeX.cH A D18-Nov-20193 KiB9534

EemDataExchangeXv2.cH A D18-Nov-20193.7 KiB11650

EnableDebugArm.cH A D18-Nov-20192.7 KiB8030

ExecuteFunclet.cH A D18-Nov-201912.9 KiB370230

ExecuteFuncletJtag.cH A D18-Nov-201912.8 KiB391249

ExecuteFuncletX.cH A D18-Nov-201912.5 KiB355216

ExecuteFuncletXv2.cH A D18-Nov-20199.6 KiB307203

GetCpuIdArm.cH A D18-Nov-20193.2 KiB10955

GetDcoFrequency.cH A D18-Nov-201915.6 KiB541393

GetDeviceIdPtr.cH A D18-Nov-20193.1 KiB9745

GetInterfaceMode.cH A D18-Nov-20193.8 KiB12769

GetInterfaceModeArm.cH A D18-Nov-20193.3 KiB11053

GetJtagId.cH A D18-Nov-20192.4 KiB7223

GetJtagIdCodeArm.cH A D18-Nov-20192.2 KiB6318

GetNumOfDevices.cH A D18-Nov-20192.3 KiB7117

HaltArm.cH A D18-Nov-20192.9 KiB9743

HilCommand.cH A D18-Nov-20199.2 KiB298215

IsJtagFuseBlown.cH A D18-Nov-20192.7 KiB8027

LeaSyncConditional.cH A D18-Nov-20192.9 KiB9644

MagicPattern.cH A D18-Nov-20196.9 KiB244145

MemApTransactionArm.cH A D18-Nov-201915.5 KiB542410

PollJStateReg.cH A D18-Nov-201914.3 KiB490354

PollJStateReg430I.cH A D18-Nov-20193.1 KiB9436

PollJStateRegFR57xx.cH A D18-Nov-20195.4 KiB169103

Psa.cH A D18-Nov-20194 KiB13664

PsaX.cH A D18-Nov-20193.3 KiB10448

PsaXv2.cH A D18-Nov-20194.1 KiB12854

ReadAllCpuRegs.cH A D18-Nov-20192.4 KiB7321

ReadAllCpuRegsArm.cH A D18-Nov-20193.5 KiB12160

ReadAllCpuRegsNon1377Xv2.cH A D18-Nov-20192.7 KiB8425

ReadAllCpuRegsX.cH A D18-Nov-20192.2 KiB6621

ReadAllCpuRegsXv2.cH A D18-Nov-20193.1 KiB9333

ReadMemBytes.cH A D18-Nov-20192.9 KiB9640

ReadMemBytesX.cH A D18-Nov-20192.6 KiB8840

ReadMemBytesXv2.cH A D18-Nov-20192.3 KiB6712

ReadMemQuick.cH A D18-Nov-20192.7 KiB9431

ReadMemQuickX.cH A D18-Nov-20192.3 KiB7827

ReadMemQuickXv2.cH A D18-Nov-20193.5 KiB11448

ReadMemWords.cH A D18-Nov-20192.8 KiB9638

ReadMemWordsX.cH A D18-Nov-20192.5 KiB8335

ReadMemWordsXv2.cH A D18-Nov-20192.6 KiB8526

Reset430I.cH A D18-Nov-20192.7 KiB8224

ResetArm.cH A D18-Nov-20192.7 KiB8436

ResetXv2.cH A D18-Nov-20193.7 KiB13068

RestoreContext_ReleaseJtag.cH A D18-Nov-20196.4 KiB200116

RestoreContext_ReleaseJtagX.cH A D18-Nov-20194.2 KiB14583

RestoreContext_ReleaseJtagXv2.cH A D18-Nov-20196.1 KiB197106

RunArm.cH A D18-Nov-20196.5 KiB231146

ScanApArm.cH A D18-Nov-20192.9 KiB8834

SendJtagMailboxXv2.cH A D18-Nov-20193.2 KiB11051

SetChainConfiguration.cH A D18-Nov-20191.9 KiB519

SetDeviceChainInfo.cH A D18-Nov-20191.9 KiB518

SingleStep.cH A D18-Nov-20197.5 KiB213114

SingleStepArm.cH A D18-Nov-20193.5 KiB12159

SingleStepJState.cH A D18-Nov-20195.7 KiB164100

SingleStepX.cH A D18-Nov-20197.3 KiB211115

SingleStepXv2.cH A D18-Nov-20195.6 KiB165103

StartJtag.cH A D18-Nov-20193.6 KiB12664

StartJtagActivationCode.cH A D18-Nov-20193.8 KiB12560

StopJtag.cH A D18-Nov-20192 KiB6110

SyncJtag_AssertPor_SaveContext.cH A D18-Nov-20199.4 KiB264159

SyncJtag_AssertPor_SaveContextX.cH A D18-Nov-20199 KiB251151

SyncJtag_AssertPor_SaveContextXv2.cH A D18-Nov-20197.5 KiB229128

SyncJtag_Conditional_SaveContext.cH A D18-Nov-201912.7 KiB367229

SyncJtag_Conditional_SaveContextX.cH A D18-Nov-201910.5 KiB323188

SyncJtag_Conditional_SaveContextXv2.cH A D18-Nov-201910.8 KiB330186

UnlockC092.cH A D18-Nov-20193.9 KiB11859

UnlockDeviceXv2.cH A D18-Nov-20194.6 KiB12959

UssSyncConditional.cH A D18-Nov-20192.5 KiB7929

WaitForDebugHaltArm.cH A D18-Nov-20193.5 KiB12263

WaitForEem.cH A D18-Nov-20193.2 KiB11251

WaitForStorage.cH A D18-Nov-20195.8 KiB18895

WaitForStorageX.cH A D18-Nov-20195.8 KiB18793

WriteAllCpuRegs.cH A D18-Nov-20192.8 KiB8527

WriteAllCpuRegsArm.cH A D18-Nov-20193.5 KiB11460

WriteAllCpuRegsX.cH A D18-Nov-20192.5 KiB7327

WriteAllCpuRegsXv2.cH A D18-Nov-20192.8 KiB8732

WriteFramQuickXv2.cH A D18-Nov-20194.6 KiB15688

WriteMemBytes.cH A D18-Nov-20193.3 KiB11153

WriteMemBytesX.cH A D18-Nov-20193.1 KiB10356

WriteMemBytesXv2.cH A D18-Nov-20192.2 KiB6612

WriteMemWords.cH A D18-Nov-20193.3 KiB11154

WriteMemWordsX.cH A D18-Nov-20193 KiB9852

WriteMemWordsXv2.cH A D18-Nov-20193.3 KiB10546

ReadMemBytes.c

1 /**
2 * \ingroup MODULMACROS
3 *
4 * \file ReadMemBytes.c
5 *
6 * \brief Read bytes from a memory mapped location
7 *
8 */
9 /*
10  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
11  *
12  *
13  *  Redistribution and use in source and binary forms, with or without
14  *  modification, are permitted provided that the following conditions
15  *  are met:
16  *
17  *    Redistributions of source code must retain the above copyright
18  *    notice, this list of conditions and the following disclaimer.
19  *
20  *    Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in the
22  *    documentation and/or other materials provided with the
23  *    distribution.
24  *
25  *    Neither the name of Texas Instruments Incorporated nor the names of
26  *    its contributors may be used to endorse or promote products derived
27  *    from this software without specific prior written permission.
28  *
29  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #include "error_def.h"
43 #include "arch.h"
44 #include "edt.h"
45 #include "hal.h"
46 #include "stream.h"
47 
48 /**
49   ReadMemBytes
50   Read bytes from a memory mapped location.
51   inData:  <addr(32)> <length(32)>
52   outData: <data(8)>{*}
53   addr: the address to start reading from
54   length: number of bytes to read
55   data: requested data
56 */
57 
HAL_FUNCTION(_hal_ReadMemBytes)58 HAL_FUNCTION(_hal_ReadMemBytes)
59 {
60     short ret_value = 0;
61     unsigned long i;
62     unsigned long lAddr;
63     unsigned long lLen;
64 
65     if(STREAM_get_long(&lAddr) != 0)
66     {
67         ret_value = HALERR_READ_MEM_BYTES_NO_ADDRESS;
68         goto exit;
69     }
70     if(STREAM_get_long(&lLen) < 0)
71     {
72         ret_value = HALERR_READ_MEM_BYTES_NO_SIZE;
73         goto exit;
74     }
75     halt_cpu();
76     IHIL_Tclk(0);
77     cntrl_sig_16bit();
78     SetReg_16Bits(0x2419);
79 
80     lLen *= 2; //DLL always sends size in word
81     for(i = 0; i < lLen; i++)
82     {
83         addr_16bit();
84         SetReg_16Bits((unsigned short)lAddr);
85         data_to_addr();
86         IHIL_Tclk(1);
87         IHIL_Tclk(0);
88         STREAM_put_byte((unsigned char)(SetReg_16Bits(0) & 0xFF));
89         lAddr += 1;
90     }
91     release_cpu();
92 exit:
93     return(ret_value);
94 }
95 
96 

ReadMemBytesX.c

1 /**
2 * \ingroup MODULMACROSX
3 *
4 * \file ReadMemBytesX.c
5 *
6 * \brief Read bytes from a memory mapped location
7 *
8 */
9 /*
10  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
11  *
12  *
13  *  Redistribution and use in source and binary forms, with or without
14  *  modification, are permitted provided that the following conditions
15  *  are met:
16  *
17  *    Redistributions of source code must retain the above copyright
18  *    notice, this list of conditions and the following disclaimer.
19  *
20  *    Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in the
22  *    documentation and/or other materials provided with the
23  *    distribution.
24  *
25  *    Neither the name of Texas Instruments Incorporated nor the names of
26  *    its contributors may be used to endorse or promote products derived
27  *    from this software without specific prior written permission.
28  *
29  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #include "error_def.h"
43 #include "arch.h"
44 #include "edt.h"
45 #include "hal.h"
46 #include "stream.h"
47 #ifdef DB_PRINT
48 #include "debug.h"
49 #endif
50 
HAL_FUNCTION(_hal_ReadMemBytesX)51 HAL_FUNCTION(_hal_ReadMemBytesX)
52 {
53     unsigned long i;
54     unsigned long lAddr;
55     unsigned long lLen;
56 
57     if(STREAM_get_long(&lAddr) != 0)
58     {
59         return HALERR_READ_MEM_WORD_NO_ADDRESS;
60     }
61     if(STREAM_get_long(&lLen) < 0)
62     {
63         return HALERR_READ_MEM_WORD_NO_SIZE;
64     }
65 
66     halt_cpu();
67     IHIL_Tclk(0);
68     cntrl_sig_low_byte();
69     SetReg_16Bits(0x19);
70 
71     lLen *= 2; //DLL always sends size in word
72     for(i = 0; i < lLen; i++)
73     {
74         addr_16bit();
75         SetReg_20Bits(lAddr);
76         data_to_addr();
77         IHIL_Tclk(1);
78         IHIL_Tclk(0);
79         STREAM_put_byte((unsigned char)(SetReg_16Bits(0) & 0xFF));
80         lAddr += 1;
81     }
82     IHIL_Tclk(1);
83 
84     release_cpu();
85     return 0;
86 }
87 
88 

ReadMemBytesXv2.c

1 /**
2 * \ingroup MODULMACROSXV2
3 *
4 * \file ReadMemBytesXv2.c
5 *
6 * \brief Read bytes from a memory mapped location
7 *
8 */
9 /*
10  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
11  *
12  *
13  *  Redistribution and use in source and binary forms, with or without
14  *  modification, are permitted provided that the following conditions
15  *  are met:
16  *
17  *    Redistributions of source code must retain the above copyright
18  *    notice, this list of conditions and the following disclaimer.
19  *
20  *    Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in the
22  *    documentation and/or other materials provided with the
23  *    distribution.
24  *
25  *    Neither the name of Texas Instruments Incorporated nor the names of
26  *    its contributors may be used to endorse or promote products derived
27  *    from this software without specific prior written permission.
28  *
29  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #include "arch.h"
43 #include "edt.h"
44 #include "hal.h"
45 #include "stream.h"
46 #include "error_def.h"
47 #ifdef DB_PRINT
48 #include "debug.h"
49 #endif
50 
51 /**
52   ReadMemBytesXv2
53   Read bytes from a memory mapped location.
54   inData:  <addr(32)> <length(32)>
55   outData: <data(8)>{*}
56   addr: the address to start reading from
57   length: number of bytes to read
58   data: requested data
59 */
60 
HAL_FUNCTION(_hal_ReadMemBytesXv2)61 HAL_FUNCTION(_hal_ReadMemBytesXv2)
62 {
63   //! \todo not supported for Xv2
64   return HALERR_UNDEFINED_ERROR;
65 }
66 
67 

ReadMemQuick.c

1 /**
2 * \ingroup <FILEGROUP>
3 *
4 * \file ReadMemQuick.c
5 *
6 * \brief Read words (16bit values) from a memory mapped location in data quick mode
7 *
8 */
9 /*
10  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
11  *
12  *
13  *  Redistribution and use in source and binary forms, with or without
14  *  modification, are permitted provided that the following conditions
15  *  are met:
16  *
17  *    Redistributions of source code must retain the above copyright
18  *    notice, this list of conditions and the following disclaimer.
19  *
20  *    Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in the
22  *    documentation and/or other materials provided with the
23  *    distribution.
24  *
25  *    Neither the name of Texas Instruments Incorporated nor the names of
26  *    its contributors may be used to endorse or promote products derived
27  *    from this software without specific prior written permission.
28  *
29  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #include "error_def.h"
43 #include "arch.h"
44 #include "edt.h"
45 #include "hal.h"
46 #include "stream.h"
47 #ifdef DB_PRINT
48 #include "debug.h"
49 #endif
50 
51 /**
52   ReadMemQuick
53   Read words (16bit values) from a memory mapped location in data quick mode.
54   inData:  <addr(32)> <length(32)>
55   outData: <data(16)>{*}
56   addr: the address to start reading from
57   length: number of words to read
58   data: requested data
59 */
60 
61 
HAL_FUNCTION(_hal_ReadMemQuick)62 HAL_FUNCTION(_hal_ReadMemQuick)
63 {
64     unsigned long i;
65     unsigned long lAddr;
66     unsigned long lLen;
67     unsigned short Pc;
68 
69     STREAM_get_long(&lAddr);
70     STREAM_get_long(&lLen);
71 
72     Pc  = (unsigned short)((lAddr-2 & 0xFFFF));
73 
74     instrLoad();
75 
76     SetPc(Pc);
77 
78     halt_cpu();
79 
80     data_quick();
81 
82     for (i = 0; i < lLen; i++)
83     {
84         IHIL_Tclk(1);
85         IHIL_Tclk(0);
86         STREAM_put_word(SetReg_16Bits(0));
87     }
88     IHIL_Tclk(1);
89 
90     release_cpu();
91 
92     return 0;
93 }
94 

ReadMemQuickX.c

1 /**
2 * \ingroup MODULMACROSX
3 *
4 * \file ReadMemQuickX.c
5 *
6 * \brief Read words (16bit values) from a memory mapped location in data quick mode
7 *
8 */
9 /*
10  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
11  *
12  *
13  *  Redistribution and use in source and binary forms, with or without
14  *  modification, are permitted provided that the following conditions
15  *  are met:
16  *
17  *    Redistributions of source code must retain the above copyright
18  *    notice, this list of conditions and the following disclaimer.
19  *
20  *    Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in the
22  *    documentation and/or other materials provided with the
23  *    distribution.
24  *
25  *    Neither the name of Texas Instruments Incorporated nor the names of
26  *    its contributors may be used to endorse or promote products derived
27  *    from this software without specific prior written permission.
28  *
29  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #include "error_def.h"
43 #include "arch.h"
44 #include "edt.h"
45 #include "hal.h"
46 #include "hal_ref.h"
47 #include "stream.h"
48 
HAL_FUNCTION(_hal_ReadMemQuickX)49 HAL_FUNCTION(_hal_ReadMemQuickX)
50 {
51     unsigned long i;
52     unsigned long lAddr;
53     unsigned long lLen;
54 
55     STREAM_get_long(&lAddr);
56     STREAM_get_long(&lLen);
57 
58     instrLoad();
59 
60     SetPcX(lAddr - 2);
61 
62     halt_cpu();
63 
64     data_quick();
65 
66     for (i = 0; i < lLen; i++)
67     {
68         IHIL_Tclk(1);
69         IHIL_Tclk(0);
70         STREAM_put_word(SetReg_16Bits(0));
71     }
72     IHIL_Tclk(1);
73 
74     release_cpu();
75 
76     return 0;
77 }
78 

ReadMemQuickXv2.c

1 /**
2 * \ingroup MODULMACROSXV2
3 *
4 * \file ReadMemQuickXv2.c
5 *
6 * \brief Read words (16bit values) from a memory mapped location in data quick mode
7 *
8 */
9 /*
10  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
11  *
12  *
13  *  Redistribution and use in source and binary forms, with or without
14  *  modification, are permitted provided that the following conditions
15  *  are met:
16  *
17  *    Redistributions of source code must retain the above copyright
18  *    notice, this list of conditions and the following disclaimer.
19  *
20  *    Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in the
22  *    documentation and/or other materials provided with the
23  *    distribution.
24  *
25  *    Neither the name of Texas Instruments Incorporated nor the names of
26  *    its contributors may be used to endorse or promote products derived
27  *    from this software without specific prior written permission.
28  *
29  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #include "arch.h"
43 #include "edt.h"
44 #include "hal.h"
45 #include "hal_ref.h"
46 #include "stream.h"
47 
48 /**
49   ReadMemQuickXv2
50   Read words (16bit values) from a memory mapped location in data quick mode.
51   inData:  <addr(32)> <length(32)>
52   outData: <data(16)>{*}
53   addr: the address to start reading from
54   length: number of words to read
55   data: requested data
56 */
57 
HAL_FUNCTION(_hal_ReadMemQuickXv2)58 HAL_FUNCTION(_hal_ReadMemQuickXv2)
59 {
60     unsigned long i;
61     unsigned long lAddr;
62     unsigned long lLen;
63     unsigned long lPc;
64     unsigned short Mova;
65     unsigned short Pc_l;
66     unsigned short id = cntrl_sig_capture();
67 
68     STREAM_get_long(&lAddr);
69     STREAM_get_long(&lLen);
70     STREAM_get_long(&lPc);
71     if(id == JTAGVERSION91 || id == JTAGVERSION99 || id == JTAGVERSION98)
72     { // Set PC to "safe" address
73         lPc = SAFE_PC_ADDRESS;
74     }
75 
76     Mova  = 0x0080;
77     Mova += (unsigned short)((lAddr>>8) & 0x00000F00);
78     Pc_l  = (unsigned short)((lAddr & 0xFFFF));
79 
80     // SET PROGRAM COUNTER for QUICK ACCESS
81     SetPcXv2(Mova, Pc_l);
82     cntrl_sig_16bit();
83     SetReg_16Bits(0x0501);
84     IHIL_Tclk(1);
85     addr_capture();
86     // END OF SETTING THE PROGRAM COUNTER
87     data_quick();
88 
89     // DATA QUICK LOOP
90     for (i = 0; i < lLen; i++)
91     {
92         IHIL_Tclk(1);
93         IHIL_Tclk(0);
94         STREAM_put_word( SetReg_16Bits(0));
95     }
96     // Check save State
97     cntrl_sig_capture();
98     SetReg_16Bits(0x0000);
99 
100     // Restore PC
101     Mova  = 0x0080;
102     Mova += (unsigned short)((lPc>>8) & 0x00000F00);
103     Pc_l  = (unsigned short)((lPc & 0xFFFF));
104 
105     // SET PROGRAM COUNTER for Backup
106     SetPcXv2(Mova, Pc_l);
107     cntrl_sig_16bit();
108     SetReg_16Bits(0x0501);
109     IHIL_Tclk(1);
110     addr_capture();
111 
112     return 0;
113 }
114 

ReadMemWords.c

1 /**
2 * \ingroup MODULMACROS
3 *
4 * \file ReadMemWords.c
5 *
6 * \brief Read words (16bit values) from a memory mapped location
7 *
8 */
9 /*
10  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
11  *
12  *
13  *  Redistribution and use in source and binary forms, with or without
14  *  modification, are permitted provided that the following conditions
15  *  are met:
16  *
17  *    Redistributions of source code must retain the above copyright
18  *    notice, this list of conditions and the following disclaimer.
19  *
20  *    Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in the
22  *    documentation and/or other materials provided with the
23  *    distribution.
24  *
25  *    Neither the name of Texas Instruments Incorporated nor the names of
26  *    its contributors may be used to endorse or promote products derived
27  *    from this software without specific prior written permission.
28  *
29  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #include "error_def.h"
43 #include "arch.h"
44 #include "edt.h"
45 #include "hal.h"
46 #include "hal_ref.h"
47 #include "stream.h"
48 
49     extern unsigned long lAddr;
50     extern unsigned long lLen;
51 
52 /**
53   ReadMemWords
54   Read words (16bit values) from a memory mapped location.
55   inData:  <addr(32)> <length(32)>
56   outData: <data(16)>{*}
57   addr: the address to start reading from
58   length: number of words to read
59   data: requested data
60 */
61 
HAL_FUNCTION(_hal_ReadMemWords)62 HAL_FUNCTION(_hal_ReadMemWords)
63 {
64     unsigned long i;
65     unsigned long lAddr;
66     unsigned long lLen;
67 
68     if(STREAM_get_long(&lAddr) != 0)
69     {
70         return HALERR_READ_MEM_WORD_NO_ADDRESS;
71     }
72     if(STREAM_get_long(&lLen) < 0)
73     {
74         return HALERR_READ_MEM_WORD_NO_SIZE;
75     }
76 
77     halt_cpu();
78     IHIL_Tclk(0);
79     for(i = 0; i < lLen; i++)
80     {
81         addr_16bit();
82         SetReg_16Bits((unsigned short)lAddr);
83         data_to_addr();
84         IHIL_Tclk(1);
85         IHIL_Tclk(0);
86         STREAM_put_word(SetReg_16Bits(0));
87         lAddr += 2;
88     }
89     IHIL_Tclk(1);
90     release_cpu();
91 
92     instrLoad();
93 
94     return 0;
95 }
96 

ReadMemWordsX.c

1 /**
2 * \ingroup MODULMACROSX
3 *
4 * \file ReadMemWordsX.c
5 *
6 * \brief Read words (16bit values) from a memory mapped location
7 *
8 */
9 /*
10  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
11  *
12  *
13  *  Redistribution and use in source and binary forms, with or without
14  *  modification, are permitted provided that the following conditions
15  *  are met:
16  *
17  *    Redistributions of source code must retain the above copyright
18  *    notice, this list of conditions and the following disclaimer.
19  *
20  *    Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in the
22  *    documentation and/or other materials provided with the
23  *    distribution.
24  *
25  *    Neither the name of Texas Instruments Incorporated nor the names of
26  *    its contributors may be used to endorse or promote products derived
27  *    from this software without specific prior written permission.
28  *
29  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #include "error_def.h"
43 #include "arch.h"
44 #include "edt.h"
45 #include "hal.h"
46 #include "hal_ref.h"
47 #include "stream.h"
48 
HAL_FUNCTION(_hal_ReadMemWordsX)49 HAL_FUNCTION(_hal_ReadMemWordsX)
50 {
51     unsigned long i;
52     unsigned long lAddr;
53     unsigned long lLen;
54 
55     if(STREAM_get_long(&lAddr) != 0)
56     {
57         return HALERR_READ_MEM_WORD_NO_ADDRESS;
58     }
59     if(STREAM_get_long(&lLen) < 0)
60     {
61         return HALERR_READ_MEM_WORD_NO_SIZE;
62     }
63 
64     halt_cpu();
65     IHIL_Tclk(0);
66 
67     for(i = 0; i < lLen; i++)
68     {
69         addr_16bit();
70         SetReg_20Bits(lAddr);
71         data_to_addr();
72         IHIL_Tclk(1);
73         IHIL_Tclk(0);
74         STREAM_put_word(SetReg_16Bits(0));
75         lAddr += 2;
76     }
77     IHIL_Tclk(1);
78 
79     release_cpu();
80     return 0;
81 }
82 
83 

ReadMemWordsXv2.c

1 /**
2 * \ingroup MODULMACROSXV2
3 *
4 * \file ReadMemWordsXv2.c
5 *
6 * \brief Read words (16bit values) from a memory mapped location
7 *
8 */
9 /*
10  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
11  *
12  *
13  *  Redistribution and use in source and binary forms, with or without
14  *  modification, are permitted provided that the following conditions
15  *  are met:
16  *
17  *    Redistributions of source code must retain the above copyright
18  *    notice, this list of conditions and the following disclaimer.
19  *
20  *    Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in the
22  *    documentation and/or other materials provided with the
23  *    distribution.
24  *
25  *    Neither the name of Texas Instruments Incorporated nor the names of
26  *    its contributors may be used to endorse or promote products derived
27  *    from this software without specific prior written permission.
28  *
29  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #include "arch.h"
43 #include "edt.h"
44 #include "hal.h"
45 #include "stream.h"
46 
47 /**
48   ReadMemWordsXv2
49   Read words (16bit values) from a memory mapped location.
50   inData:  <addr(32)> <length(32)>
51   outData: <data(16)>{*}
52   addr: the address to start reading from
53   length: number of words to read
54   data: requested data
55 */
56 
HAL_FUNCTION(_hal_ReadMemWordsXv2)57 HAL_FUNCTION(_hal_ReadMemWordsXv2)
58 {
59   unsigned long i;
60   unsigned long lAddr;
61   unsigned long lLen;
62 
63   STREAM_get_long(&lAddr);
64   STREAM_get_long(&lLen);
65 
66   IHIL_Tclk(0);
67 
68   for(i = 0; i < lLen; i++)
69   {
70     addr_16bit();
71     SetReg_20Bits(lAddr);
72     IHIL_Tclk(1);
73     IHIL_Tclk(0);
74     data_capture();
75     STREAM_put_word(SetReg_16Bits(0));
76     lAddr += 2;
77   }
78   IHIL_Tclk(1);
79   // one or more cycle, so CPU is driving correct MAB
80   IHIL_TCLK();
81 
82   return 0;
83 }
84 
85