comparison src/cs/drivers/drv_core/armio/armio.c @ 117:e67bbb9b1fb9

src/cs sync with Magnetite: C155 support
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 07 Nov 2018 06:03:02 +0000
parents b6a5e36de839
children b0a18d9f99f4
comparison
equal deleted inserted replaced
116:258bfecc22b1 117:e67bbb9b1fb9
205 205
206 // ARMIO_OUT register configuration : 206 // ARMIO_OUT register configuration :
207 // set IOs 8,9,10,11,12 and 13 as high 207 // set IOs 8,9,10,11,12 and 13 as high
208 // set IOs 0 to 7 as low 208 // set IOs 0 to 7 as low
209 209
210 #if defined(CONFIG_TARGET_C139) || defined(CONFIG_TARGET_C11X) 210 #ifdef CONFIG_TARGET_C11X
211 /* C11x GPIO configuration mimics what the original fw sets */
212
213 /* GPIO out all zeros */
214 *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x0000;
215
216 /* setting of GPIOs as outputs: register setting from the original fw */
217 *((volatile SYS_UWORD16 *) ARMIO_IO_CNTL) = 0x2209;
218
219 #elif defined(CONFIG_TARGET_C139)
211 /* C139 GPIO configuration mimics what the original fw sets */ 220 /* C139 GPIO configuration mimics what the original fw sets */
212 221
213 /* GPIO out all zeros - the LCD backlight is OFF */ 222 /* GPIO out all zeros - the LCD backlight is OFF */
214 *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x0000; 223 *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x0000;
215 224
216 /* setting of GPIOs as outputs also mimics what the original fw sets */ 225 /* setting of GPIOs as outputs: register setting from the original fw */
217 *((volatile SYS_UWORD16 *) ARMIO_IO_CNTL) = 0x2A09; 226 *((volatile SYS_UWORD16 *) ARMIO_IO_CNTL) = 0x2A09;
227
228 #elif defined(CONFIG_TARGET_C155)
229 /* C155 GPIO config based on the available schematics */
230
231 /* GPIO out all zeros - the LCD backlight is OFF */
232 *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x0000;
233
234 AI_ConfigBitAsOutput(1); /* LCD backlight control */
235 AI_ConfigBitAsOutput(2); /* headset jack switch */
236 AI_ConfigBitAsOutput(3); /* LCDA0 (?) */
237 AI_ConfigBitAsOutput(8); /* MUSIC_A0 */
238 AI_ConfigBitAsOutput(12); /* MUSIC_ON */
239
218 #elif defined(CONFIG_TARGET_PIRELLI) 240 #elif defined(CONFIG_TARGET_PIRELLI)
241
219 *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x0000; 242 *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x0000;
220 243
221 AI_ConfigBitAsOutput(1); 244 AI_ConfigBitAsOutput(1);
222 AI_ConfigBitAsOutput(4); 245 AI_ConfigBitAsOutput(4);
223 AI_ConfigBitAsOutput(7); 246 AI_ConfigBitAsOutput(7);
247
224 #else /* classic TI/Openmoko/FreeCalypso targets */ 248 #else /* classic TI/Openmoko/FreeCalypso targets */
225 // set IOs 1 and 8 to 13 as high 249 // set IOs 1 and 8 to 13 as high
226 // set IOs 0 and 2 to 7 as low 250 // set IOs 0 and 2 to 7 as low
227 // On D-Sample GPIO 1 must be set to high to enable the audio amplifier, 251 // On D-Sample GPIO 1 must be set to high to enable the audio amplifier,
228 // but on Openmoko's modem it is the interrupt to the AP. 252 // but on Openmoko's modem it is the interrupt to the AP.
234 *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x3F02; 258 *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x3F02;
235 #endif 259 #endif
236 260
237 // ARMIO_CNTL_REG register configuration : 261 // ARMIO_CNTL_REG register configuration :
238 // set IOs 1,2,5,7,9,14 and 15 as ouputs. 262 // set IOs 1,2,5,7,9,14 and 15 as ouputs.
239 #ifndef CONFIG_TARGET_DSAMPLE 263 // bits conditionalized on CONFIG_TARGET_GTAMODEM or CONFIG_TARGET_FCDEV3B
240 AI_ConfigBitAsOutput(0); /* FreeCalypso addition */ 264 // are FreeCalypso additions
241 #endif 265 #if defined(CONFIG_TARGET_GTAMODEM) || defined(CONFIG_TARGET_FCDEV3B)
242 AI_ConfigBitAsOutput(1); 266 AI_ConfigBitAsOutput(0);
267 #endif
268 AI_ConfigBitAsOutput(1);
243 AI_ConfigBitAsOutput(2); 269 AI_ConfigBitAsOutput(2);
244 #ifdef CONFIG_TARGET_GTAMODEM 270 #ifdef CONFIG_TARGET_GTAMODEM
245 AI_ConfigBitAsOutput(3); 271 AI_ConfigBitAsOutput(3);
246 #endif 272 #endif
247 #ifndef CONFIG_TARGET_DSAMPLE 273 #if defined(CONFIG_TARGET_GTAMODEM) || defined(CONFIG_TARGET_FCDEV3B)
248 AI_ConfigBitAsOutput(4); /* FreeCalypso addition */ 274 AI_ConfigBitAsOutput(4);
249 #endif 275 #endif
250 AI_ConfigBitAsOutput(5); 276 AI_ConfigBitAsOutput(5);
251 #ifndef CONFIG_TARGET_DSAMPLE 277 #if defined(CONFIG_TARGET_GTAMODEM) || defined(CONFIG_TARGET_FCDEV3B)
252 AI_ConfigBitAsOutput(6); /* FreeCalypso addition */ 278 AI_ConfigBitAsOutput(6);
253 #endif 279 #endif
254 AI_ConfigBitAsOutput(7); 280 AI_ConfigBitAsOutput(7);
255 #ifndef CONFIG_TARGET_DSAMPLE 281 #if defined(CONFIG_TARGET_GTAMODEM) || defined(CONFIG_TARGET_FCDEV3B)
256 AI_ConfigBitAsOutput(8); /* FreeCalypso addition */ 282 AI_ConfigBitAsOutput(8);
257 #endif 283 #endif
258 AI_ConfigBitAsOutput(9); 284 AI_ConfigBitAsOutput(9);
259 #ifdef CONFIG_TARGET_GTAMODEM 285 #ifdef CONFIG_TARGET_GTAMODEM
260 AI_ConfigBitAsOutput(10); 286 AI_ConfigBitAsOutput(10);
261 AI_ConfigBitAsOutput(11); 287 AI_ConfigBitAsOutput(11);
262 AI_ConfigBitAsOutput(12); 288 AI_ConfigBitAsOutput(12);
263 #endif 289 #endif
264 #ifndef CONFIG_TARGET_DSAMPLE 290 #if defined(CONFIG_TARGET_GTAMODEM) || defined(CONFIG_TARGET_FCDEV3B)
265 AI_ConfigBitAsOutput(13); /* FreeCalypso addition */ 291 AI_ConfigBitAsOutput(13);
266 #endif 292 #endif
267 AI_ConfigBitAsOutput(14); 293 AI_ConfigBitAsOutput(14);
268 AI_ConfigBitAsOutput(15); 294 AI_ConfigBitAsOutput(15);
269 #endif 295 #endif
270 } 296 }