summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tms320dm320/system-dm320.c
diff options
context:
space:
mode:
authorTomasz Moń <desowin@gmail.com>2011-11-16 14:08:01 +0000
committerTomasz Moń <desowin@gmail.com>2011-11-16 14:08:01 +0000
commite8a8a1be43afe63079ae48ce1a9eb3052df3b1a4 (patch)
tree084e1cdf27a339ce58e24cff8fec8c31432b52db /firmware/target/arm/tms320dm320/system-dm320.c
parent992d4eb775cac48e107e18d72783ebfb39c4234f (diff)
downloadrockbox-e8a8a1be43afe63079ae48ce1a9eb3052df3b1a4.tar.gz
rockbox-e8a8a1be43afe63079ae48ce1a9eb3052df3b1a4.zip
Sandisk Sansa Connect port (FS #12363)
Included are drivers for buttons, backlight, lcd, audio and storage. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31000 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/tms320dm320/system-dm320.c')
-rw-r--r--firmware/target/arm/tms320dm320/system-dm320.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/firmware/target/arm/tms320dm320/system-dm320.c b/firmware/target/arm/tms320dm320/system-dm320.c
index f2a4aacb68..528d442ce5 100644
--- a/firmware/target/arm/tms320dm320/system-dm320.c
+++ b/firmware/target/arm/tms320dm320/system-dm320.c
@@ -26,11 +26,16 @@
26#include "uart-target.h" 26#include "uart-target.h"
27#include "system-arm.h" 27#include "system-arm.h"
28#include "spi.h" 28#include "spi.h"
29#include "i2c.h"
29#ifdef CREATIVE_ZVx 30#ifdef CREATIVE_ZVx
30#include "dma-target.h" 31#include "dma-target.h"
31#else 32#endif
33#ifdef MROBE_500
32#include "usb-mr500.h" 34#include "usb-mr500.h"
33#endif 35#endif
36#ifdef SANSA_CONNECT
37#include "avr-sansaconnect.h"
38#endif
34 39
35static unsigned short clock_arm_slow = 0xFFFF; 40static unsigned short clock_arm_slow = 0xFFFF;
36static unsigned short clock_arm_fast = 0xFFFF; 41static unsigned short clock_arm_fast = 0xFFFF;
@@ -182,7 +187,12 @@ void system_exception_wait(void)
182 IO_INTC_EINT0 = 0; 187 IO_INTC_EINT0 = 0;
183 IO_INTC_EINT1 = 0; 188 IO_INTC_EINT1 = 0;
184 IO_INTC_EINT2 = 0; 189 IO_INTC_EINT2 = 0;
190#ifdef MROBE_500
185 while ((IO_GIO_BITSET0&0x01) != 0); /* Wait for power button */ 191 while ((IO_GIO_BITSET0&0x01) != 0); /* Wait for power button */
192#endif
193#ifdef SANSA_CONNECT
194 while (1); /* Holding power button for a while makes avr system reset */
195#endif
186} 196}
187 197
188void system_init(void) 198void system_init(void)
@@ -311,7 +321,7 @@ void system_init(void)
311 clock_arm_slow = (0 << 8) | 3; 321 clock_arm_slow = (0 << 8) | 3;
312 clock_arm_fast = (1 << 8) | 1; 322 clock_arm_fast = (1 << 8) | 1;
313 } 323 }
314 324
315 /* M48XI disabled, USB buffer powerdown */ 325 /* M48XI disabled, USB buffer powerdown */
316 IO_CLK_LPCTL1 = 0x11; /* I2C wodn't work with this disabled */ 326 IO_CLK_LPCTL1 = 0x11; /* I2C wodn't work with this disabled */
317 327
@@ -337,14 +347,22 @@ void system_init(void)
337 uart_init(); 347 uart_init();
338 spi_init(); 348 spi_init();
339 349
350#ifdef MROBE_500
340 /* Initialization is done so shut the front LED off so that the battery 351 /* Initialization is done so shut the front LED off so that the battery
341 * can charge. 352 * can charge.
342 */ 353 */
343 IO_GIO_BITCLR2 = 0x0001; 354 IO_GIO_BITCLR2 = 0x0001;
344 355#endif
356
345#ifdef CREATIVE_ZVx 357#ifdef CREATIVE_ZVx
346 dma_init(); 358 dma_init();
347#endif 359#endif
360
361#ifdef SANSA_CONNECT
362 i2c_init();
363 avr_hid_init();
364 avr_hid_enable_charger();
365#endif
348} 366}
349 367
350int system_memory_guard(int newmode) 368int system_memory_guard(int newmode)
@@ -388,4 +406,13 @@ void udelay(int usec) {
388 } 406 }
389} 407}
390 408
409#ifdef BOOTLOADER
410void system_prepare_fw_start(void)
411{
412 tick_stop();
413 IO_INTC_EINT0 = 0;
414 IO_INTC_EINT1 = 0;
415 IO_INTC_EINT2 = 0;
416}
417#endif
391 418