- bootloader_with_flash: fixed apperent bug with GPIO alignmentand masking git-svn-id: http://moon:8086/svn/mips@134 a8ebac50-d88d-4704-bea3-6648445a41b3
67 lines
1.1 KiB
C
67 lines
1.1 KiB
C
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
|
|
#include <stddef.h>
|
|
#include <board.h>
|
|
#include "../../../libsys/uart.h"
|
|
#include "../../../libsys/irq.h"
|
|
#include "../../../libsys/uart.h"
|
|
|
|
#ifdef WITH_DEBUGGER
|
|
extern uart_if_t uart_if[];
|
|
|
|
#ifdef WITH_GDB_STUB
|
|
extern void handle_exception (unsigned long *registers);
|
|
#else
|
|
extern int dbg_handler(struct xcptcontext * xcp);
|
|
#endif
|
|
|
|
int dbg_stub(struct xcptcontext * xcp) __attribute__ ((section (".dbg_stub"))) __attribute__ ((used));
|
|
int dbg_stub(struct xcptcontext * xcp)
|
|
{
|
|
#ifdef WITH_GDB_STUB
|
|
handle_exception((unsigned long *)xcp);
|
|
return 0;
|
|
#else
|
|
return dbg_handler(xcp);
|
|
#endif
|
|
|
|
}
|
|
|
|
void dbg_putchar(char c)
|
|
{
|
|
if (c == 0x0A)
|
|
{
|
|
UART_writechar(&uart_if[UART_DEBUGGER], 0x0D);
|
|
}
|
|
UART_writechar(&uart_if[UART_DEBUGGER], c);
|
|
}
|
|
|
|
char dbg_getchar()
|
|
{
|
|
int c;
|
|
|
|
// busy read
|
|
do
|
|
{
|
|
c = UART_readchar(&uart_if[UART_DEBUGGER]);
|
|
|
|
} while(c < 0);
|
|
|
|
return (char)c;
|
|
}
|
|
#endif
|
|
|
|
uint32_t getBootOffset(uint32_t sel)
|
|
{
|
|
return 0x100000 *(1+sel);
|
|
}
|
|
|
|
void board_init(void)
|
|
{
|
|
|
|
}
|