dm2dm642.gel File Reference

D.Module2.DM642 GEL File More...

Macros

#define EMIFCLK   133000000
 
#define UARTCLK   48000000
 
#define EMIF_GCTL   0x01800000
 
#define EMIF_CECTL1   0x01800004
 
#define EMIF_CECTL0   0x01800008
 
#define EMIF_CECTL2   0x01800010
 
#define EMIF_CECTL3   0x01800014
 
#define EMIF_SDCTL   0x01800018
 
#define EMIF_SDTIM   0x0180001C
 
#define EMIF_SDEXT   0x01800020
 
#define EMIF_PDTCTL   0x01800040
 
#define EMIF_CESEC1   0x01800044
 
#define EMIF_CESEC0   0x01800048
 
#define EMIF_CESEC2   0x01800050
 
#define EMIF_CESEC3   0x01800054
 
#define EMIF_CCFG   0x01840000
 

Functions

 StartUp ()
 
 OnReset ()
 
 OnRestart ()
 
 OnPreFileLoaded ()
 
 OnFileLoaded (int nErrorCode, int bSymbolsOnly)
 
 OnTargetConnect ()
 
 D2DM642_InitEmif (eclk)
 
 FlushCache ()
 
 MemoryMap ()
 
hotmenu ClearBreakPts_Reset ()
 
hotmenu Flush_Cache ()
 
hotmenu InitializeEMIF ()
 

Variables

menuitem Resets
 
menuitem D Module2 DM642
 

Detailed Description

Author
D.SignT GmbH & Co. KG, A.Klemenz
Date
2012-09-26
Version
1.1
Target Platform:
D.Module2.DM642

This GEL file is to be used with the D.Module2.DM642.

Code Composer Studio supports six reserved GEL functions that automatically get executed if they are defined. They are:

Macro Definition Documentation

#define EMIFCLK   133000000
#define UARTCLK   48000000
#define EMIF_GCTL   0x01800000
#define EMIF_CECTL1   0x01800004
#define EMIF_CECTL0   0x01800008
#define EMIF_CECTL2   0x01800010
#define EMIF_CECTL3   0x01800014
#define EMIF_SDCTL   0x01800018
#define EMIF_SDTIM   0x0180001C
#define EMIF_SDEXT   0x01800020
#define EMIF_PDTCTL   0x01800040
#define EMIF_CESEC1   0x01800044
#define EMIF_CESEC0   0x01800048
#define EMIF_CESEC2   0x01800050
#define EMIF_CESEC3   0x01800054
#define EMIF_CCFG   0x01840000

Function Documentation

StartUp ( )
35 {
36 }
OnReset ( )
43 {
44  D2DM642_InitEmif(EMIFCLK); // Parameter: EMIF Clock 83,100,125,133
45  *(int *)0x3FC = UARTCLK;
46 }
D2DM642_InitEmif(eclk)
Definition: dm2dm642.gel:111
#define EMIFCLK
Definition: dm2dm642.gel:26
#define UARTCLK
Definition: dm2dm642.gel:27
OnRestart ( )
53 {
54 /* CCS will call OnRestart() when you do a Debug->Restart and */
55 /* after you load a new file. Between running interrupt based */
56 /* programs, this function will clear interrupts and help keep */
57 /* the processor from going off into invalid memory. */
58 
59  /* Turn off cache for SDRAM */
60  *(int *)0x1848200 = 0; /* MAR0 */
61  *(int *)0x1848204 = 0; /* MAR1 */
62  *(int *)0x1848208 = 0; /* MAR2 */
63  *(int *)0x184820C = 0; /* MAR3 */
64 
65  /* Disable EDMA events */
66  *(int *)0x01A0FFA8 = 0; /* CIERH */
67  *(int *)0x01A0FFB4 = 0; /* EERH */
68  *(int *)0x01A0FFB8 = 0XFFFFFFFF; /* ECRH */
69 
70  *(int *)0x01A0FFE8 = 0; /* CIERL */
71  *(int *)0x01A0FFF4 = 0; /* EERL */
72  *(int *)0x01A0FFF8 = 0xFFFFFFFF; /* ECRL */
73 
74  /* Disable interrupts */
75  IER = 0;
76  IFR = 0;
77 }
OnPreFileLoaded ( )
84 {
85  GEL_Reset();
86  FlushCache();
87  IER = 0;
88  IFR = 0;
89  D2DM642_InitEmif(EMIFCLK); // Parameter: EMIF Clock 83,100,125,133
90 }
D2DM642_InitEmif(eclk)
Definition: dm2dm642.gel:111
#define EMIFCLK
Definition: dm2dm642.gel:26
FlushCache()
Definition: dm2dm642.gel:172
OnFileLoaded ( int  nErrorCode,
int  bSymbolsOnly 
)
93 {
94  if (!bSymbolsOnly)
95  {
96 // ADC_Cal();
97  }
98 }
OnTargetConnect ( )
101 {
102  MemoryMap();
103  D2DM642_InitEmif(EMIFCLK); // Parameter: EMIF Clock 83,100,125,133
104  GEL_Reset();
105 }
D2DM642_InitEmif(eclk)
Definition: dm2dm642.gel:111
MemoryMap()
Definition: dm2dm642.gel:188
#define EMIFCLK
Definition: dm2dm642.gel:26
D2DM642_InitEmif ( eclk  )
112 {
113  #define EMIF_GCTL 0x01800000
114  #define EMIF_CECTL1 0x01800004
115  #define EMIF_CECTL0 0x01800008
116  #define EMIF_CECTL2 0x01800010
117  #define EMIF_CECTL3 0x01800014
118  #define EMIF_SDCTL 0x01800018
119  #define EMIF_SDTIM 0x0180001C
120  #define EMIF_SDEXT 0x01800020
121  #define EMIF_PDTCTL 0x01800040
122  #define EMIF_CESEC1 0x01800044
123  #define EMIF_CESEC0 0x01800048
124  #define EMIF_CESEC2 0x01800050
125  #define EMIF_CESEC3 0x01800054
126  #define EMIF_CCFG 0x01840000
127 
128  *(int *)EMIF_GCTL = 0x00010020;
129  *(int *)EMIF_CECTL0 = 0x000040D0; // 64-bit SDRAM
130  *(int *)EMIF_CECTL1 = 0x21614511; // 16-bit asynchronous
131  *(int *)EMIF_CECTL2 = 0x11114421; // 32-bit asynchronous
132  *(int *)EMIF_CECTL3 = 0x11114421; // 32-bit asynchronous
133  *(int *)EMIF_CESEC0 = 0x00000000;
134  *(int *)EMIF_CESEC1 = 0x00000040;
135  *(int *)EMIF_CESEC2 = 0x0000007F;
136  *(int *)EMIF_CESEC3 = 0x0000007F;
137 
138  if (eclk == 83000000)
139  {
140  *(int *)EMIF_SDTIM = 0x00516516;
141  *(int *)EMIF_SDEXT = 0x0004B4A6;
142  *(int *)EMIF_SDCTL = 0x53114000;
143  }
144  else if (eclk == 100000000)
145  {
146  *(int *)EMIF_SDTIM = 0x0061A61A;
147  *(int *)EMIF_SDEXT = 0x0004B4A6;
148  *(int *)EMIF_SDCTL = 0x53115000;
149  }
150  else if (eclk == 125000000)
151  {
152  *(int *)EMIF_SDTIM = 0x007A17A1;
153  *(int *)EMIF_SDEXT = 0x0005452B;
154  *(int *)EMIF_SDCTL = 0x53227000;
155  }
156  else if (eclk == 133000000)
157  {
158  *(int *)EMIF_SDTIM = 0x00823823;
159  *(int *)EMIF_SDEXT = 0x0005452B;
160  *(int *)EMIF_SDCTL = 0x53227000;
161  }
162  else
163  {
164  GEL_TextOut(" ERROR! unsupported EMIF Clock ");
165  }
166 }
#define EMIF_GCTL
#define EMIF_CESEC0
#define EMIF_CECTL3
#define EMIF_CESEC1
#define EMIF_CECTL1
#define EMIF_CESEC3
#define EMIF_CESEC2
#define EMIF_SDTIM
#define EMIF_CECTL2
#define EMIF_CECTL0
#define EMIF_SDEXT
#define EMIF_SDCTL
FlushCache ( )
173 {
174  /* Invalidate L1I and L1D */
175  *(int *)0x01840000 = (*(int *)0x01840000 | 0x00000300);
176 
177  /* Clean L2 */
178  *(int *)0x01845004 = 0x1;
179 }
MemoryMap ( )
189 {
190  GEL_MapOn();
191  GEL_MapReset();
192  GEL_MapAdd(0x00000000,0,0x80000000,1,1); // internal RAM and on-chip peripherals
193  GEL_MapAddStr(0x80000000, 0, 0x10000000, "R|W|AS8", 0); // 64 bit RAM
194  GEL_MapAddStr(0x90000000, 0, 0x10000000, "R|W|AS2", 0); // 16 bit RAM
195  GEL_MapAddStr(0xA0000000, 0, 0x10000000, "R|W|AS4", 0); // 32 bit RAM
196  GEL_MapAddStr(0xB0000000, 0, 0x10000000, "R|W|AS4", 0); // 32 bit RAM
197 }
hotmenu ClearBreakPts_Reset ( )
207 {
208  GEL_BreakPtReset();
209  GEL_Reset();
210 }
hotmenu Flush_Cache ( )
213 {
214  FlushCache();
215 }
FlushCache()
Definition: dm2dm642.gel:172
hotmenu InitializeEMIF ( )
221 {
222  D2DM642_InitEmif(EMIFCLK); // Parameter: EMIF Clock 83,100,125,133
223 }
D2DM642_InitEmif(eclk)
Definition: dm2dm642.gel:111
#define EMIFCLK
Definition: dm2dm642.gel:26

Variable Documentation

menuitem Resets
menuitem D Module2 DM642