summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSivaraj R2019-05-20 02:53:08 -0500
committerSivaraj R2019-05-20 02:53:08 -0500
commitd51b663723ded0b8f1392009746348d2a03cafd6 (patch)
treef9caad389df4471fb9e1bf399189fe12eb8ccdd4
parente0fb64a0152ccc8ff8de2d9fec6436a3be0a85ea (diff)
downloadi2c-lld-d51b663723ded0b8f1392009746348d2a03cafd6.tar.gz
i2c-lld-d51b663723ded0b8f1392009746348d2a03cafd6.tar.xz
i2c-lld-d51b663723ded0b8f1392009746348d2a03cafd6.zip
Use common OSAL MMU init fxn
Signed-off-by: Sivaraj R <sivaraj@ti.com>
-rw-r--r--test/eeprom_read/am65xx/i2cEepromTest_a53.cfg20
-rw-r--r--test/eeprom_read/j721e/i2cEepromTest_a72.cfg20
-rw-r--r--test/eeprom_read/src/main_test.c148
3 files changed, 20 insertions, 168 deletions
diff --git a/test/eeprom_read/am65xx/i2cEepromTest_a53.cfg b/test/eeprom_read/am65xx/i2cEepromTest_a53.cfg
index ba5c415..99f67c1 100644
--- a/test/eeprom_read/am65xx/i2cEepromTest_a53.cfg
+++ b/test/eeprom_read/am65xx/i2cEepromTest_a53.cfg
@@ -52,7 +52,7 @@ var Cache = xdc.module("ti.sysbios.hal.Cache");
52Cache.CacheProxy = xdc.useModule("ti.sysbios.family.arm.v8a.Cache"); 52Cache.CacheProxy = xdc.useModule("ti.sysbios.family.arm.v8a.Cache");
53 53
54var Mmu = xdc.useModule('ti.sysbios.family.arm.v8a.Mmu'); 54var Mmu = xdc.useModule('ti.sysbios.family.arm.v8a.Mmu');
55Mmu.initFunc = "&InitMmu"; 55Mmu.initFunc = "&Osal_initMmuDefault";
56Mmu.tableArrayLen = 24; 56Mmu.tableArrayLen = 24;
57 57
58 58
@@ -75,8 +75,8 @@ for (var i = 0; i < 12; i++) {
75/* System.SupportProxy = SysUart; */ 75/* System.SupportProxy = SysUart; */
76System.SupportProxy = SysMin; 76System.SupportProxy = SysMin;
77 77
78/* 78/*
79 * Program.argSize sets the size of the .args section. 79 * Program.argSize sets the size of the .args section.
80 * The examples don't use command line args so argSize is set to 0. 80 * The examples don't use command line args so argSize is set to 0.
81 */ 81 */
82Program.argSize = 0x0; 82Program.argSize = 0x0;
@@ -84,7 +84,7 @@ Program.argSize = 0x0;
84/* 84/*
85 * Uncomment this line to globally disable Asserts. 85 * Uncomment this line to globally disable Asserts.
86 * All modules inherit the default from the 'Defaults' module. You 86 * All modules inherit the default from the 'Defaults' module. You
87 * can override these defaults on a per-module basis using Module.common$. 87 * can override these defaults on a per-module basis using Module.common$.
88 * Disabling Asserts will save code space and improve runtime performance. 88 * Disabling Asserts will save code space and improve runtime performance.
89Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; 89Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
90 */ 90 */
@@ -110,10 +110,10 @@ Memory.defaultHeapInstance = heap0;
110 * an array of functions that are registered with System_atexit() to be 110 * an array of functions that are registered with System_atexit() to be
111 * called by System_exit(). 111 * called by System_exit().
112 */ 112 */
113System.maxAtexitHandlers = 4; 113System.maxAtexitHandlers = 4;
114 114
115/* 115/*
116 * Uncomment this line to disable the Error print function. 116 * Uncomment this line to disable the Error print function.
117 * We lose error information when this is disabled since the errors are 117 * We lose error information when this is disabled since the errors are
118 * not printed. Disabling the raiseHook will save some code space if 118 * not printed. Disabling the raiseHook will save some code space if
119 * your app is not using System_printf() since the Error_print() function 119 * your app is not using System_printf() since the Error_print() function
@@ -121,7 +121,7 @@ System.maxAtexitHandlers = 4;
121Error.raiseHook = null; 121Error.raiseHook = null;
122 */ 122 */
123 123
124/* 124/*
125 * Uncomment this line to keep Error, Assert, and Log strings from being 125 * Uncomment this line to keep Error, Assert, and Log strings from being
126 * loaded on the target. These strings are placed in the .const section. 126 * loaded on the target. These strings are placed in the .const section.
127 * Setting this parameter to false will save space in the .const section. 127 * Setting this parameter to false will save space in the .const section.
@@ -137,7 +137,7 @@ Text.isLoaded = false;
137SysMin.flushAtExit = false; 137SysMin.flushAtExit = false;
138 */ 138 */
139 139
140/* 140/*
141 * The BIOS module will create the default heap for the system. 141 * The BIOS module will create the default heap for the system.
142 * Specify the size of this default heap. 142 * Specify the size of this default heap.
143 * 143 *
@@ -153,7 +153,7 @@ var task0Params = new Task.Params();
153task0Params.instance.name = "echo"; 153task0Params.instance.name = "echo";
154task0Params.stackSize = 0x1000; 154task0Params.stackSize = 0x1000;
155Program.global.echo = Task.create("&i2c_test", task0Params); 155Program.global.echo = Task.create("&i2c_test", task0Params);
156/* 156/*
157 * Create and install logger for the whole system 157 * Create and install logger for the whole system
158 */ 158 */
159var loggerBufParams = new LoggerBuf.Params(); 159var loggerBufParams = new LoggerBuf.Params();
diff --git a/test/eeprom_read/j721e/i2cEepromTest_a72.cfg b/test/eeprom_read/j721e/i2cEepromTest_a72.cfg
index ba5c415..99f67c1 100644
--- a/test/eeprom_read/j721e/i2cEepromTest_a72.cfg
+++ b/test/eeprom_read/j721e/i2cEepromTest_a72.cfg
@@ -52,7 +52,7 @@ var Cache = xdc.module("ti.sysbios.hal.Cache");
52Cache.CacheProxy = xdc.useModule("ti.sysbios.family.arm.v8a.Cache"); 52Cache.CacheProxy = xdc.useModule("ti.sysbios.family.arm.v8a.Cache");
53 53
54var Mmu = xdc.useModule('ti.sysbios.family.arm.v8a.Mmu'); 54var Mmu = xdc.useModule('ti.sysbios.family.arm.v8a.Mmu');
55Mmu.initFunc = "&InitMmu"; 55Mmu.initFunc = "&Osal_initMmuDefault";
56Mmu.tableArrayLen = 24; 56Mmu.tableArrayLen = 24;
57 57
58 58
@@ -75,8 +75,8 @@ for (var i = 0; i < 12; i++) {
75/* System.SupportProxy = SysUart; */ 75/* System.SupportProxy = SysUart; */
76System.SupportProxy = SysMin; 76System.SupportProxy = SysMin;
77 77
78/* 78/*
79 * Program.argSize sets the size of the .args section. 79 * Program.argSize sets the size of the .args section.
80 * The examples don't use command line args so argSize is set to 0. 80 * The examples don't use command line args so argSize is set to 0.
81 */ 81 */
82Program.argSize = 0x0; 82Program.argSize = 0x0;
@@ -84,7 +84,7 @@ Program.argSize = 0x0;
84/* 84/*
85 * Uncomment this line to globally disable Asserts. 85 * Uncomment this line to globally disable Asserts.
86 * All modules inherit the default from the 'Defaults' module. You 86 * All modules inherit the default from the 'Defaults' module. You
87 * can override these defaults on a per-module basis using Module.common$. 87 * can override these defaults on a per-module basis using Module.common$.
88 * Disabling Asserts will save code space and improve runtime performance. 88 * Disabling Asserts will save code space and improve runtime performance.
89Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; 89Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
90 */ 90 */
@@ -110,10 +110,10 @@ Memory.defaultHeapInstance = heap0;
110 * an array of functions that are registered with System_atexit() to be 110 * an array of functions that are registered with System_atexit() to be
111 * called by System_exit(). 111 * called by System_exit().
112 */ 112 */
113System.maxAtexitHandlers = 4; 113System.maxAtexitHandlers = 4;
114 114
115/* 115/*
116 * Uncomment this line to disable the Error print function. 116 * Uncomment this line to disable the Error print function.
117 * We lose error information when this is disabled since the errors are 117 * We lose error information when this is disabled since the errors are
118 * not printed. Disabling the raiseHook will save some code space if 118 * not printed. Disabling the raiseHook will save some code space if
119 * your app is not using System_printf() since the Error_print() function 119 * your app is not using System_printf() since the Error_print() function
@@ -121,7 +121,7 @@ System.maxAtexitHandlers = 4;
121Error.raiseHook = null; 121Error.raiseHook = null;
122 */ 122 */
123 123
124/* 124/*
125 * Uncomment this line to keep Error, Assert, and Log strings from being 125 * Uncomment this line to keep Error, Assert, and Log strings from being
126 * loaded on the target. These strings are placed in the .const section. 126 * loaded on the target. These strings are placed in the .const section.
127 * Setting this parameter to false will save space in the .const section. 127 * Setting this parameter to false will save space in the .const section.
@@ -137,7 +137,7 @@ Text.isLoaded = false;
137SysMin.flushAtExit = false; 137SysMin.flushAtExit = false;
138 */ 138 */
139 139
140/* 140/*
141 * The BIOS module will create the default heap for the system. 141 * The BIOS module will create the default heap for the system.
142 * Specify the size of this default heap. 142 * Specify the size of this default heap.
143 * 143 *
@@ -153,7 +153,7 @@ var task0Params = new Task.Params();
153task0Params.instance.name = "echo"; 153task0Params.instance.name = "echo";
154task0Params.stackSize = 0x1000; 154task0Params.stackSize = 0x1000;
155Program.global.echo = Task.create("&i2c_test", task0Params); 155Program.global.echo = Task.create("&i2c_test", task0Params);
156/* 156/*
157 * Create and install logger for the whole system 157 * Create and install logger for the whole system
158 */ 158 */
159var loggerBufParams = new LoggerBuf.Params(); 159var loggerBufParams = new LoggerBuf.Params();
diff --git a/test/eeprom_read/src/main_test.c b/test/eeprom_read/src/main_test.c
index a51160b..dbfbe7e 100644
--- a/test/eeprom_read/src/main_test.c
+++ b/test/eeprom_read/src/main_test.c
@@ -48,11 +48,6 @@
48/* BIOS Header files */ 48/* BIOS Header files */
49#include <ti/sysbios/BIOS.h> 49#include <ti/sysbios/BIOS.h>
50#include <ti/sysbios/knl/Task.h> 50#include <ti/sysbios/knl/Task.h>
51#if defined(SOC_AM65XX) || defined(SOC_J721E)
52#if defined (__aarch64__)
53#include <ti/sysbios/family/arm/v8a/Mmu.h>
54#endif
55#endif
56#endif /* #ifdef USE_BIOS */ 51#endif /* #ifdef USE_BIOS */
57 52
58#include <stdio.h> 53#include <stdio.h>
@@ -119,149 +114,6 @@ extern char eepromData[I2C_EEPROM_RX_LENGTH];
119/********************************************************************** 114/**********************************************************************
120 ************************** Global Variables ************************** 115 ************************** Global Variables **************************
121 **********************************************************************/ 116 **********************************************************************/
122#if defined(SOC_AM65XX) || defined (SOC_J721E)
123#ifdef USE_BIOS
124#if defined (__aarch64__)
125Void InitMmu()
126{
127 Mmu_MapAttrs attrs;
128 Bool retVal;
129 uint32_t mapIdx = 0;
130
131 Mmu_initMapAttrs(&attrs);
132
133 attrs.attrIndx = 0;
134 retVal = Mmu_map(0x00100000, 0x00100000, 0x00900000, &attrs); /* Main MMR0 cfg */
135 if(retVal == FALSE)
136 {
137 goto mmu_exit;
138 }
139
140 mapIdx++;
141 retVal = Mmu_map(0x00400000, 0x00400000, 0x00001000, &attrs); /* PSC0 */
142 if(retVal == FALSE)
143 {
144 goto mmu_exit;
145 }
146
147 mapIdx++;
148 retVal = Mmu_map(0x01800000, 0x01800000, 0x00200000, &attrs); /* gicv3 */
149 if(retVal == FALSE)
150 {
151 goto mmu_exit;
152 }
153
154 mapIdx++;
155 retVal = Mmu_map(0x02400000, 0x02400000, 0x000c0000, &attrs); /* dmtimer */
156 if(retVal == FALSE)
157 {
158 goto mmu_exit;
159 }
160
161 mapIdx++;
162 retVal = Mmu_map(0x02800000, 0x02800000, 0x00040000, &attrs); /* uart */
163 if(retVal == FALSE)
164 {
165 goto mmu_exit;
166 }
167
168 mapIdx++;
169 retVal = Mmu_map(0x02000000, 0x02000000, 0x00100000, &attrs); /* main I2C */
170 if(retVal == FALSE)
171 {
172 goto mmu_exit;
173 }
174
175 mapIdx++;
176 retVal = Mmu_map(0x42120000, 0x42120000, 0x00001000, &attrs); /* Wkup I2C0 */
177 if(retVal == FALSE)
178 {
179 goto mmu_exit;
180 }
181
182 mapIdx++;
183 retVal = Mmu_map(0x02100000, 0x02100000, 0x00080000, &attrs); /* McSPI */
184 if(retVal == FALSE)
185 {
186 goto mmu_exit;
187 }
188
189 mapIdx++;
190 retVal = Mmu_map(0x40f00000, 0x40f00000, 0x00020000, &attrs); /* MCU MMR0 CFG */
191 if(retVal == FALSE)
192 {
193 goto mmu_exit;
194 }
195
196 mapIdx++;
197 retVal = Mmu_map(0x40d00000, 0x40d00000, 0x00002000, &attrs); /* PLL0 CFG */
198 if(retVal == FALSE)
199 {
200 goto mmu_exit;
201 }
202
203 mapIdx++;
204 retVal = Mmu_map(0x43000000, 0x43000000, 0x00020000, &attrs); /* WKUP MMR0 cfg */
205 if(retVal == FALSE)
206 {
207 goto mmu_exit;
208 }
209
210 mapIdx++;
211 retVal = Mmu_map(0x02C40000, 0x02C40000, 0x00100000, &attrs); /* pinmux ctrl */
212 if(retVal == FALSE)
213 {
214 goto mmu_exit;
215 }
216
217 mapIdx++;
218 retVal = Mmu_map(0x2A430000, 0x2A430000, 0x00001000, &attrs); /* ctrcontrol0 */
219 if(retVal == FALSE)
220 {
221 goto mmu_exit;
222 }
223
224 mapIdx++;
225 retVal = Mmu_map(0x30800000, 0x30800000, 0x0C000000, &attrs); /* navss */
226 if(retVal == FALSE)
227 {
228 goto mmu_exit;
229 }
230
231 mapIdx++;
232 retVal = Mmu_map(0x42000000, 0x42000000, 0x00001000, &attrs); /* PSC WKUP*/
233 if (retVal == FALSE)
234 {
235 goto mmu_exit;
236 }
237
238 attrs.attrIndx = 7;
239 mapIdx++;
240 retVal = Mmu_map(0x80000000, 0x80000000, 0x03000000, &attrs); /* ddr */
241 if(retVal == FALSE)
242 {
243 goto mmu_exit;
244 }
245
246 mapIdx++;
247 retVal = Mmu_map(0x70000000, 0x70000000, 0x04000000, &attrs); /* msmc */
248 if(retVal == FALSE)
249 {
250 goto mmu_exit;
251 }
252
253mmu_exit:
254 if(retVal == FALSE)
255 {
256 System_printf("Mmu_map idx %d returned error %d", mapIdx, retVal);
257 while(1);
258 }
259
260 return;
261}
262#endif /* #if defined (__aarch64__) */
263#endif /* #ifdef USE_BIOS */
264#endif /* #if defined(SOC_AM65XX) || defined (SOC_J721E) */
265 117
266#if defined (idkAM572x) 118#if defined (idkAM572x)
267char eepromData[I2C_EEPROM_TEST_LENGTH] = {0x55, 0x33, 0xEE, 0x41, 0x4D, 0x35, 0x37, 0x32, 119char eepromData[I2C_EEPROM_TEST_LENGTH] = {0x55, 0x33, 0xEE, 0x41, 0x4D, 0x35, 0x37, 0x32,