summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-11-04 20:30:01 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-11-04 20:30:01 +0000
commit1e8be6f6b05f6cbe64ce47c8d7a7cd93cf1d1c80 (patch)
tree736bcd75cdf193c28a90c1096178b9de015a0299 /firmware/target/mips/ingenic_jz47xx/system-jz4740.c
parent059fff29ec662ffa0b2c2e5ebc91d574007b81a8 (diff)
downloadrockbox-1e8be6f6b05f6cbe64ce47c8d7a7cd93cf1d1c80.tar.gz
rockbox-1e8be6f6b05f6cbe64ce47c8d7a7cd93cf1d1c80.tar.bz2
rockbox-1e8be6f6b05f6cbe64ce47c8d7a7cd93cf1d1c80.zip
Onda VX747:
clean up's, bug fixes and reworks git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19007 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/system-jz4740.c')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/system-jz4740.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/system-jz4740.c b/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
index 1a41723ffc..89011e1baf 100644
--- a/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/system-jz4740.c
@@ -389,6 +389,7 @@ void udelay(unsigned int usec)
: "0" (i)
);
}
+
void mdelay(unsigned int msec)
{
unsigned int i;
@@ -437,7 +438,7 @@ void sti(void)
#define SYNC_WB() __asm__ __volatile__ ("sync")
-#define __CACHE_OP(op, addr) \
+#define __CACHE_OP(op, addr) \
__asm__ __volatile__( \
" .set noreorder \n" \
" .set mips32\n\t \n" \
@@ -632,6 +633,20 @@ static void tlb_call_refill(void)
);
}
+static void dma_init(void)
+{
+ __cpm_start_dmac();
+
+ REG_DMAC_DCCSR(0) = 0;
+ REG_DMAC_DCCSR(1) = 0;
+ REG_DMAC_DCCSR(2) = 0;
+ REG_DMAC_DCCSR(3) = 0;
+ REG_DMAC_DCCSR(4) = 0;
+ REG_DMAC_DCCSR(5) = 0;
+
+ REG_DMAC_DMACR = (DMAC_DMACR_PR_012345 | DMAC_DMACR_DMAE);
+}
+
extern int main(void);
extern void except_common_entry(void);
@@ -660,12 +675,14 @@ void system_main(void)
dis_irq(i);
tlb_init();
+ dma_init();
detect_clock();
+ /* Enable interrupts at core level */
sti();
- main();
+ main(); /* Shouldn't return */
while(1);
}
@@ -686,7 +703,7 @@ void power_off(void)
/* Put system into hibernate mode */
__rtc_clear_alarm_flag();
__rtc_clear_hib_stat_all();
- //__rtc_set_scratch_pattern(0x12345678);
+ /* __rtc_set_scratch_pattern(0x12345678); */
__rtc_enable_alarm_wakeup();
__rtc_set_hrcr_val(0xfe0);
__rtc_set_hwfcr_val((0xFFFF << 4));