summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/boot.lds32
-rw-r--r--firmware/crt0.S5
-rw-r--r--firmware/kernel.c19
3 files changed, 55 insertions, 1 deletions
diff --git a/firmware/boot.lds b/firmware/boot.lds
index 78dd40bf92..56383d7723 100644
--- a/firmware/boot.lds
+++ b/firmware/boot.lds
@@ -69,7 +69,7 @@ INPUT(crt0.o)
#define FLASHSIZE 256K - ROM_START
#endif
-#ifndef CPU_PP
+#if !defined(CPU_PP) && (CONFIG_CPU!=S3C2440)
MEMORY
{
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
@@ -117,6 +117,36 @@ SECTIONS
_end = .;
}
}
+#elif (CONFIG_CPU==S3C2440)
+{
+ . = DRAMORIG + 0x8000;
+ .text : {
+ *(.init.text)
+ *(.text)
+ }
+ .data : {
+ *(.icode)
+ *(.irodata)
+ *(.idata)
+ *(.data)
+ _dataend = . ;
+ }
+ .stack :
+ {
+ *(.stack)
+ _stackbegin = .;
+ stackbegin = .;
+ . += 0x2000;
+ _stackend = .;
+ stackend = .;
+ }
+ .bss : {
+ _edata = .;
+ *(.bss);
+ *(.ibss);
+ _end = .;
+ }
+}
#else
{
.vectors :
diff --git a/firmware/crt0.S b/firmware/crt0.S
index 1c52658c7c..96e08be9f1 100644
--- a/firmware/crt0.S
+++ b/firmware/crt0.S
@@ -303,6 +303,11 @@ boot_table:
.space 400
#endif /* PP specific */
/* Code for ARM bootloader targets other than iPod go here */
+
+#if CONFIG_CPU == S3C2440
+ bl main
+#endif
+
#else /* BOOTLOADER */
/* Set up stack for IRQ mode */
diff --git a/firmware/kernel.c b/firmware/kernel.c
index 7c5c74c662..1c8bf9dd81 100644
--- a/firmware/kernel.c
+++ b/firmware/kernel.c
@@ -56,6 +56,21 @@ void kernel_init(void)
void sleep(int ticks)
{
+#if CONFIG_CPU == S3C2440 && defined(BOOTLOADER)
+ int counter;
+ TCON &= ~(1 << 20); // stop timer 4
+ // TODO: this constant depends on dividers settings inherited from
+ // firmware. Set them explicitly somwhere.
+ TCNTB4 = 12193 * ticks / HZ;
+ TCON |= 1 << 21; // set manual bit
+ TCON &= ~(1 << 21); // reset manual bit
+ TCON &= ~(1 << 22); //autoreload Off
+ TCON |= (1 << 20); // start timer 4
+ do {
+ counter = TCNTO4;
+ } while(counter > 0);
+
+#else
/* Always sleep at least 1 tick */
int timeout = current_tick + ticks + 1;
@@ -63,12 +78,16 @@ void sleep(int ticks)
sleep_thread();
}
wake_up_thread();
+#endif
}
void yield(void)
{
+#if CONFIG_CPU == S3C2440 && defined(BOOTLOADER)
+#else
switch_thread();
wake_up_thread();
+#endif
}
/****************************************************************************