1
0
mirror of git://projects.qi-hardware.com/iris.git synced 2025-04-21 12:27:27 +03:00

working boot loader

This commit is contained in:
Bas Wijnen
2010-08-23 23:55:51 +02:00
parent 04ed743042
commit aef83317c9
11 changed files with 380 additions and 124 deletions

View File

@@ -19,10 +19,15 @@
#define ARCH
#include "../kernel.hh"
typedef unsigned cacheline[8]
void arch_flush_cache ():
for cacheline *line = (cacheline *)0x80000000; line < (cacheline *)0x80008000; ++line:
__asm__ volatile ("lw $k0, %0; cache 0, 0($k0); cache 1, 0($k0)" :: "m"(line))
__asm__ volatile ("\t.set noreorder\n"
"\tlui $k0, 0x8000\n"
"\tori $k1, $k0, 0x4000 - 0x20\n"
"1:\tcache 0, 0($k0)\n"
"\tcache 1, 0($k0)\n"
"\tbne $k0, $k1, 1b\n"
"\taddiu $k0, $k0, 0x20\n"
"\t.set reorder\n")
static kThread *handle_exit ():
dbg_check ()

View File

@@ -26,7 +26,7 @@ udc_boot_programs = udc
sd_boot_programs = sd+mmc partition fat
standard_boot_programs = bootinit
programs = init gpio lcd bsquare ball buzzer metronome elfrun alarm rtc gui nand test $(udc_boot_programs) $(sd_boot_programs) $(standard_boot_programs)
programs = init gpio lcd bsquare ball buzzer metronome elfrun alarm rtc gui nand test boot booter $(udc_boot_programs) $(sd_boot_programs) $(standard_boot_programs)
ARCH_CPPFLAGS = -I. -Imips -Imips/nanonote -Wa,-mips32 -DNANONOTE -DUSE_SERIAL
CROSS = mipsel-linux-gnu-

View File

@@ -118,8 +118,8 @@ void arch_poweroff ():
kdebug ("Power down failed! Rebooting instead.\n")
arch_reboot ()
void arch_boot (unsigned address):
// Boot into another kernel.
void arch_boot (unsigned address, unsigned arg):
sync_serial ()
// Boot into another kernel.
arch_flush_cache ()
return ((void (*)())address) ()
((void (*)(unsigned))address) (arg)