1
0
mirror of git://projects.qi-hardware.com/iris.git synced 2024-11-17 11:36:15 +02:00
iris/mips/nanonote/sdram-setup.ccp
2011-01-15 02:10:46 +01:00

61 lines
1.7 KiB
COBOL

#pypp 0
// Iris: micro-kernel for a capability-based operating system.
// mips/nanonote/sdram-setup.ccp: bootstrapping over usb.
// Copyright 2009 Bas Wijnen <wijnen@debian.org>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// This runs like the kernel. In particular, it doesn't want userspace declarations.
#define __KERNEL__
#define dbg_log_char(x) do {} while (0)
#define dbg_log(x) do {} while (0)
#define dbg_log_num(...) do {} while (0)
#include "jz4740.hh"
void kdebug (unsigned ch):
while !(UART0_LSR & UARTLSR_TDRQ):
UART0_TDR = ch
while !(UART0_LSR & UARTLSR_TEMT):
asm volatile (".set noreorder\n"
"\t.globl __start\n"
"\t.text\n"
"__start:\n"
"\tnop\n"
"__hack_label:\n"
"\tmove $a0, $ra\n"
"\tbal 1f\n"
"\tnop\n"
"\t.word _gp\n"
"1:\n"
"\tlw $gp, 0($ra)\n"
"\tla $sp, stack + 0x100\n"
"\tla $t9, start_cpp\n"
"\tmove $ra, $a0\n"
"\tjr $t9\n"
"\tnop\n"
".set reorder")
extern "C":
void start_cpp ()
char stack[0x100]
void start_cpp ():
//setup_uart ()
//kdebug ('.')
//setup_sdram ()
//kdebug ('!')
// everything is ok now: return to boot loader to load stage 2.