FreeCalypso > hg > fc-magnetite
comparison src/cs/drivers/drv_core/armio/armio.c @ 84:42d766231c46
armio.c: support for C139 and Pirelli targets
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 02 Oct 2016 07:44:36 +0000 |
parents | cff89030b634 |
children | a6360ee05c47 |
comparison
equal
deleted
inserted
replaced
83:cff89030b634 | 84:42d766231c46 |
---|---|
137 * Reset all default IO configurations | 137 * Reset all default IO configurations |
138 * | 138 * |
139 */ | 139 */ |
140 void AI_ResetIoConfig(void) | 140 void AI_ResetIoConfig(void) |
141 { | 141 { |
142 *((volatile SYS_UWORD16 *) ARMIO_IO_CNTL) = 0xFFFF; // all bits are inputs | 142 *((volatile SYS_UWORD16 *) ARMIO_IO_CNTL) = 0xFFFF; // all bits are inputs |
143 #if (CHIPSET != 12) | 143 #if (CHIPSET != 12) |
144 *((volatile SYS_UWORD16 *) CLKM_IO_CNTL) = 0; // default config | 144 *((volatile SYS_UWORD16 *) CLKM_IO_CNTL) = 0; // default config |
145 #endif /* CHIPSET != 12 */ | 145 #endif /* CHIPSET != 12 */ |
146 } | 146 } |
147 | 147 |
148 | 148 |
149 /* | 149 /* |
176 // select IOs 6,8,9,10,11,12 and 13 on the pins instead of MCSI and MCUEN signals. | 176 // select IOs 6,8,9,10,11,12 and 13 on the pins instead of MCSI and MCUEN signals. |
177 AI_EnableBit(0); /* FreeCalypso addition */ | 177 AI_EnableBit(0); /* FreeCalypso addition */ |
178 AI_EnableBit(2); | 178 AI_EnableBit(2); |
179 AI_EnableBit(4); | 179 AI_EnableBit(4); |
180 | 180 |
181 #ifdef CONFIG_TARGET_PIRELLI | |
182 AI_EnableBit(1); | |
183 AI_EnableBit(3); | |
184 #endif | |
185 | |
181 /* Bits 5,6,7,8 are used to output I/O 9,10,11,12 or MCSI pins */ | 186 /* Bits 5,6,7,8 are used to output I/O 9,10,11,12 or MCSI pins */ |
182 /* If Bluetooth, IO should be disabled, outputting MCSI used for Bluetooth voice */ | 187 /* If Bluetooth, IO should be disabled, outputting MCSI used for Bluetooth voice */ |
183 #ifdef BTEMOBILE | 188 #if defined(BTEMOBILE) || defined(CONFIG_TARGET_PIRELLI) |
184 AI_DisableBit(5); | 189 AI_DisableBit(5); |
185 AI_DisableBit(6); | 190 AI_DisableBit(6); |
186 AI_DisableBit(7); | 191 AI_DisableBit(7); |
187 AI_DisableBit(8); | 192 AI_DisableBit(8); |
188 #else | 193 #else |
195 AI_EnableBit(9); | 200 AI_EnableBit(9); |
196 | 201 |
197 // ARMIO_OUT register configuration : | 202 // ARMIO_OUT register configuration : |
198 // set IOs 8,9,10,11,12 and 13 as high | 203 // set IOs 8,9,10,11,12 and 13 as high |
199 // set IOs 0 to 7 as low | 204 // set IOs 0 to 7 as low |
200 #if ((BOARD == 8) || (BOARD == 9)) | 205 |
201 *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x3F00; | 206 #ifdef CONFIG_TARGET_C139 |
202 | 207 /* C139 GPIO configuration mimics what the original fw sets */ |
203 // ARMIO_CNTL_REG register configuration : | 208 |
204 // set IOs 0,1,6,8,9,10,11,12 and 13 as ouputs. | 209 /* GPIO out all zeros - the LCD backlight is OFF */ |
205 AI_ConfigBitAsOutput(0); | 210 *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x0000; |
206 AI_ConfigBitAsOutput(1); | 211 |
207 AI_ConfigBitAsOutput(6); | 212 /* setting of GPIOs as outputs also mimics what the original fw sets */ |
208 AI_ConfigBitAsOutput(8); | 213 *((volatile SYS_UWORD16 *) ARMIO_IO_CNTL) = 0x2A09; |
209 AI_ConfigBitAsOutput(9); | 214 #elif defined(CONFIG_TARGET_PIRELLI) |
210 AI_ConfigBitAsOutput(10); | 215 *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x0000; |
211 AI_ConfigBitAsOutput(11); | 216 |
212 AI_ConfigBitAsOutput(12); | 217 AI_ConfigBitAsOutput(1); |
213 AI_ConfigBitAsOutput(13); | 218 AI_ConfigBitAsOutput(4); |
214 #elif ((BOARD == 40) || (BOARD == 41) || (BOARD == 42) || (BOARD == 43) || (BOARD == 45)) | 219 AI_ConfigBitAsOutput(7); |
220 #else /* classic TI/Openmoko/FreeCalypso targets */ | |
215 // set IOs 1 and 8 to 13 as high | 221 // set IOs 1 and 8 to 13 as high |
216 // set IOs 0 and 2 to 7 as low | 222 // set IOs 0 and 2 to 7 as low |
217 // On D-Sample GPIO 1 must be set to high to enable the audio amplifier. | 223 // On D-Sample GPIO 1 must be set to high to enable the audio amplifier. |
218 #if (OP_L1_STANDALONE == 0) | 224 #if (OP_L1_STANDALONE == 0) |
219 // CC test | 225 // CC test |