summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tms320dm320
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/tms320dm320')
-rwxr-xr-xfirmware/target/arm/tms320dm320/crt0.S18
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c1
-rw-r--r--firmware/target/arm/tms320dm320/system-dm320.c15
-rw-r--r--firmware/target/arm/tms320dm320/uart-dm320.c3
4 files changed, 25 insertions, 12 deletions
diff --git a/firmware/target/arm/tms320dm320/crt0.S b/firmware/target/arm/tms320dm320/crt0.S
index 68c0d9e1c5..8c747f7a51 100755
--- a/firmware/target/arm/tms320dm320/crt0.S
+++ b/firmware/target/arm/tms320dm320/crt0.S
@@ -48,14 +48,19 @@ start:
str r0, [r1, #28]
#endif
- /* Disable high vectors (at 0xffff0000 instead of 0x00000000) */
- mrc p15, 0, r0, c1, c0
- and r0, r0, #~(1<<13)
- mcr p15, 0, r0, c1, c0
+ /* Disable data and instruction cache, high vectors (at 0xffff0000 instead of 0x00000000) */
+ mrc p15, 0, r0, c1, c0, 0
+ /* clear bits 13, 9:8 (--VI --RS) */
+ bic r0, r0, #0x00003300
+ /* clear bits 7, 2:0 (B--- -C-M) */
+ bic r0, r0, #0x00000085
+ /* make sure bit 2 (A) Align is set */
+ orr r0, r0, #0x00000002
+ mcr p15, 0, r0, c1, c0, 0
#if !defined(BOOTLOADER)
-#if 0//!defined(STUB)
+#if !defined(STUB)
/* Zero out IBSS */
ldr r2, =_iedata
ldr r3, =_iend
@@ -64,8 +69,7 @@ start:
cmp r3, r2
strhi r4, [r2], #4
bhi 1b
-#endif
-#if 1
+
/* Copy the IRAM */
ldr r2, =_iramcopy
ldr r3, =_iramstart
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
index 37286bffc4..bc1439762d 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
@@ -82,7 +82,6 @@ void lcd_init_device(void)
void lcd_update_rect(int x, int y, int width, int height)
{
fb_data *dst, *src;
- int yc;
if (!lcd_on)
return;
diff --git a/firmware/target/arm/tms320dm320/system-dm320.c b/firmware/target/arm/tms320dm320/system-dm320.c
index 8a50ba7f08..f3f8dcea26 100644
--- a/firmware/target/arm/tms320dm320/system-dm320.c
+++ b/firmware/target/arm/tms320dm320/system-dm320.c
@@ -16,7 +16,8 @@
* KIND, either express or implied.
*
****************************************************************************/
-
+#include "cpu.h"
+#include "mmu-arm.h"
#include "kernel.h"
#include "system.h"
#include "panic.h"
@@ -26,6 +27,9 @@
#define default_interrupt(name) \
extern __attribute__((weak,alias("UIRQ"))) void name (void)
+void irq_handler(void) __attribute__((interrupt ("IRQ"), naked));
+void fiq_handler(void) __attribute__((interrupt ("FIQ"), naked));
+
default_interrupt(TIMER0);
default_interrupt(TIMER1);
default_interrupt(TIMER2);
@@ -101,7 +105,6 @@ static void UIRQ(void)
panicf("Unhandled IRQ %02X: %s", offset, irqname[offset]);
}
-void irq_handler(void) __attribute__((interrupt ("IRQ"), naked));
void irq_handler(void)
{
/*
@@ -116,7 +119,6 @@ void irq_handler(void)
"subs pc, lr, #4 \n"); /* Return from FIQ */
}
-void fiq_handler(void) __attribute__((interrupt ("FIQ"), naked));
void fiq_handler(void)
{
/*
@@ -179,6 +181,13 @@ void system_init(void)
enable_interrupts();
uart_init();
spi_init();
+
+ /* MMU initialization (Starts data and instruction cache) */
+ ttb_init();
+ map_section(0, 0, 0x1000, CACHE_NONE); /* Make sure everything is mapped on itself */
+ map_section(0x00900000, 0x00900000, 64, CACHE_ALL); /* Enable caching for RAM */
+ map_section((int)FRAME, (int)FRAME, 2, BUFFERED); /* enable buffered writing for the framebuffer */
+ enable_mmu();
}
int system_memory_guard(int newmode)
diff --git a/firmware/target/arm/tms320dm320/uart-dm320.c b/firmware/target/arm/tms320dm320/uart-dm320.c
index 6425b75960..5168cb11c6 100644
--- a/firmware/target/arm/tms320dm320/uart-dm320.c
+++ b/firmware/target/arm/tms320dm320/uart-dm320.c
@@ -24,7 +24,8 @@
#define CONFIG_UART_BRSR 87
#define MAX_UART_BUFFER 31
-unsigned char uart1buffer[MAX_UART_BUFFER];
+unsigned char uart1buffer[MAX_UART_BUFFER], uart1_send_buffer_ring[512];
+int uart1_send_count=0,uart1_send_point=0;
int uart1read = 0, uart1write = 0, uart1count = 0;
/*