- initial import
git-svn-id: http://moon:8086/svn/mips@1 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
ENDIAN='big'
|
||||
|
||||
ifeq ($(ENDIAN), 'big')
|
||||
ENDIAN_FLAGS=-EB
|
||||
LIB_DIRS=-L $(MIPS_TOOLS_PREFIX)/mipsel-elf/lib/eb -L $(MIPS_TOOLS_PREFIX)/lib/gcc/mipsel-elf/$(MIPS_GCC_VER)/eb
|
||||
else
|
||||
ENDIAN_FLAGS=-EL
|
||||
LIB_DIRS=-L $(MIPS_TOOLS_PREFIX)/mipsel-elf/lib -L $(MIPS_TOOLS_PREFIX)/lib/gcc/mipsel-elf/$(MIPS_GCC_VER)
|
||||
endif
|
||||
|
||||
CFLAGS=$(ENDIAN_FLAGS) -Os -I. -I../ -I../libsys -msoft-float -march=r3000
|
||||
LFLAGS=$(ENDIAN_FLAGS) -M
|
||||
|
||||
ifeq ($(TLB),yes)
|
||||
CFLAGS+=-DSYS_IO_BASE=0xAC000000 -DSDRAM_BASE=0x80000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x88000000
|
||||
LFLAGS+=-T bootloader_tlb.ld
|
||||
else
|
||||
CFLAGS+=-DSYS_IO_BASE=0xA0000000 -DSDRAM_BASE=0x40000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x00000000
|
||||
LFLAGS+=-T bootloader.ld
|
||||
endif
|
||||
|
||||
LIBS=-lc -lgcc
|
||||
|
||||
CC=mipsel-elf-gcc
|
||||
LD=mipsel-elf-ld
|
||||
OBJDUMP=mipsel-elf-objdump
|
||||
OBJCOPY=mipsel-elf-objcopy
|
||||
|
||||
.PHONY: libsys
|
||||
|
||||
all: bootloader_flash
|
||||
|
||||
libsys: startup_boot.S init_boot.S kernel_boot.S libsys_boot.c
|
||||
$(CC) $(CFLAGS) -c startup_boot.S -o startup.o
|
||||
$(CC) $(CFLAGS) -c init_boot.S -o init.o
|
||||
$(CC) $(CFLAGS) -c kernel_boot.S -o kernel.o
|
||||
$(CC) $(CFLAGS) -c libsys_boot.c -o libsys.o
|
||||
|
||||
bootloader: libsys bootloader.c
|
||||
$(CC) $(CFLAGS) -g -c bootloader.c
|
||||
$(LD) $(LFLAGS) $(LIB_DIRS) startup.o init.o kernel.o libsys.o bootloader.o -o $@.elf $(LIBS) >$@.map
|
||||
$(OBJDUMP) -d $@.elf > $@.dis
|
||||
$(OBJCOPY) $@.elf -O binary $@.ROM.bin
|
||||
$(OBJCOPY) -O srec $@.elf $@.srec
|
||||
romgen $@.ROM.bin 10 $(ENDIAN_FLAGS)
|
||||
|
||||
bootloader_flash: libsys bootloader_with_flash.c
|
||||
$(CC) $(CFLAGS) -g -c bootloader_with_flash.c
|
||||
$(CC) $(CFLAGS) -g -c ../cfiflash.c
|
||||
$(LD) $(LFLAGS) $(LIB_DIRS) startup.o init.o kernel.o libsys.o cfiflash.o bootloader_with_flash.o -o $@.elf $(LIBS) >$@.map
|
||||
$(OBJDUMP) -d $@.elf > $@.dis
|
||||
$(OBJCOPY) $@.elf -O binary $@.ROM.bin
|
||||
$(OBJCOPY) -O srec $@.elf $@.srec
|
||||
romgen $@.ROM.bin 11 $(ENDIAN_FLAGS)
|
||||
|
||||
clean:
|
||||
rm -rf *.o *.bin *.map *.dis *.srec *.elf *.vhd* *.tcl bootloader > /dev/null
|
||||
@@ -0,0 +1,247 @@
|
||||
#include "libsys_boot.h"
|
||||
|
||||
typedef struct _ssrec_t
|
||||
{
|
||||
UINT32 addr;
|
||||
UINT32 size;
|
||||
UINT32 type;
|
||||
UINT8 *data;
|
||||
|
||||
} srec_t;
|
||||
|
||||
enum srec_type
|
||||
{
|
||||
srec_err, srec_sob, srec_data, srec_rec, srec_eob
|
||||
};
|
||||
|
||||
UINT8 h2i(UINT8 *c)
|
||||
{
|
||||
int i;
|
||||
UINT8 t, b = 0;
|
||||
|
||||
for (i=0; i < 2; i++)
|
||||
{
|
||||
t = c[i];
|
||||
if (t >= 'A')
|
||||
t = t - 'A' + 10;
|
||||
else
|
||||
t -= '0';
|
||||
|
||||
b = (b << 4) | t;
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
|
||||
{
|
||||
UINT8 chksum, byte;
|
||||
int alen, i;
|
||||
|
||||
if (!buflen)
|
||||
return srec_err;
|
||||
|
||||
pRec->type = srec_rec;
|
||||
alen = 0;
|
||||
if ((pBuf[1] > '0') && (pBuf[1] < '4'))
|
||||
{
|
||||
alen = pBuf[1] - '0' + 1;
|
||||
pRec->type = srec_data;
|
||||
}
|
||||
else if ((pBuf[1] >= '7') && (pBuf[1] <= '9'))
|
||||
{
|
||||
alen = 11 - (pBuf[1] - '0');
|
||||
pRec->type = srec_eob;
|
||||
}
|
||||
else if (pBuf[1] == '0')
|
||||
{
|
||||
alen = 2;
|
||||
pRec->type = srec_sob;
|
||||
}
|
||||
|
||||
byte = h2i(&pBuf[2]);
|
||||
pRec->size = byte;
|
||||
chksum = byte;
|
||||
|
||||
pRec->addr = 0;
|
||||
for (i=0; i < alen; i++)
|
||||
{
|
||||
byte = h2i(&pBuf[4+2*i]);
|
||||
pRec->addr = pRec->addr << 8 | byte;
|
||||
chksum += byte;
|
||||
}
|
||||
pRec->size -= (alen+1);
|
||||
|
||||
pRec->data = (UINT8*) &pBuf[4 + 2*alen];
|
||||
for (i=0; i < (int)pRec->size; i++)
|
||||
{
|
||||
byte = h2i(&pRec->data[2*i]);
|
||||
pRec->data[i] = byte;
|
||||
chksum += byte;
|
||||
}
|
||||
chksum = ~chksum;
|
||||
byte = h2i(&pRec->data[2*i]);
|
||||
if (chksum != byte)
|
||||
return 0;
|
||||
|
||||
return pRec->type;
|
||||
}
|
||||
|
||||
int srec_getline(UINT8 *pLine)
|
||||
{
|
||||
char c;
|
||||
int i = 0;
|
||||
|
||||
do
|
||||
{
|
||||
c = readchar();
|
||||
|
||||
} while ((c != 's') && (c != 'S'));
|
||||
|
||||
while(((c != 0x0D) && (c != 0x0A)))
|
||||
{
|
||||
pLine[i++] = c;
|
||||
c = readchar();
|
||||
};
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
void Jump_to(void *pEntry)
|
||||
{
|
||||
__asm
|
||||
(
|
||||
".set noreorder\n"
|
||||
);
|
||||
__asm
|
||||
(
|
||||
"jr %[pEntry]\n" // jump entry
|
||||
:
|
||||
: [pEntry] "r" (pEntry)
|
||||
);
|
||||
__asm
|
||||
(
|
||||
"nop\n"
|
||||
);
|
||||
__asm
|
||||
(
|
||||
".set reorder\n"
|
||||
);
|
||||
}
|
||||
|
||||
void Exec_at(void *pEntry)
|
||||
{
|
||||
__asm
|
||||
(
|
||||
".set noreorder\n"
|
||||
);
|
||||
|
||||
__asm
|
||||
(
|
||||
"mfc0 $26, $12\n" // change exception vector
|
||||
"li $27, 0xFFBFFFFF\n"
|
||||
"and $26, $27\n"
|
||||
"mtc0 $26, $12\n"
|
||||
);
|
||||
|
||||
__asm
|
||||
(
|
||||
"lw $v0, 16($sp)\n"
|
||||
"nop\n"
|
||||
"jr $v0\n" // jump entry
|
||||
"rfe\n"
|
||||
);
|
||||
|
||||
__asm
|
||||
(
|
||||
".set reorder\n"
|
||||
);
|
||||
}
|
||||
void PrintCPUinfo(void)
|
||||
{
|
||||
int result, rev_id;
|
||||
|
||||
char *cpu_type_str[7] = {"invalid", "R2000", "R3000", "R6000", "R4000", "reserved", "R6000A"};
|
||||
|
||||
// Print Status register
|
||||
result = CP0_SR_read();
|
||||
|
||||
sputs("Status : ");
|
||||
print_word(result);
|
||||
sputs("\n");
|
||||
|
||||
// Print Revision
|
||||
result = CP0_PRID_read();
|
||||
rev_id = (result >> 8) & 0xFF;
|
||||
sputs("CPU type: ");
|
||||
if ((rev_id > 0) && (rev_id < 0x07))
|
||||
{
|
||||
sputs(cpu_type_str[rev_id]);
|
||||
sputs(" Rev.");
|
||||
rev_id = result & 0xFF;
|
||||
print_byte((char)rev_id);
|
||||
}
|
||||
else
|
||||
sputs("Unknown");
|
||||
|
||||
sputs("\n");
|
||||
|
||||
}
|
||||
|
||||
#define MAX_IMG_SIZE (1024*1024) // bytes
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
UINT8 buf[256];
|
||||
srec_t srec;
|
||||
int result, srec_state, i;
|
||||
UINT32 haddr;
|
||||
volatile UINT8 *pMem;
|
||||
haddr = 0;
|
||||
|
||||
// ----------------------------------------------------------
|
||||
sputs("\n\n");
|
||||
PrintCPUinfo();
|
||||
sputs("Booting from UART..");
|
||||
|
||||
while(1)
|
||||
{
|
||||
sputs(".");
|
||||
while(1)
|
||||
{
|
||||
result = srec_getline(buf);
|
||||
srec_state = decode_srec(&srec, buf, result);
|
||||
switch (srec_state)
|
||||
{
|
||||
case srec_data:
|
||||
if ((srec.addr + srec.size) > haddr)
|
||||
haddr = srec.addr + srec.size;
|
||||
|
||||
pMem = (UINT8*)srec.addr;
|
||||
for (i=0; i < srec.size; i++)
|
||||
*pMem++ = srec.data[i];
|
||||
|
||||
break;
|
||||
|
||||
case srec_eob:
|
||||
sputs("done\n\n");
|
||||
sputs("Execute program at ");
|
||||
print_word(srec.addr);
|
||||
sputs("\n\n");
|
||||
|
||||
Exec_at((void*)srec.addr);
|
||||
break;
|
||||
|
||||
default:
|
||||
result = -1;
|
||||
break;
|
||||
}
|
||||
if (result < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
MEMORY
|
||||
{
|
||||
rom : ORIGIN = 0xBFC00000, LENGTH = 0x00002000 /* 8K */
|
||||
ram : ORIGIN = 0x40000000, LENGTH = 0x04000000 /* 64M */
|
||||
flash : ORIGIN = 0xA4000000, LENGTH = 0x00800000 /* 8M */
|
||||
io : ORIGIN = 0xA0000000, LENGTH = 0x00800000 /* 8M */
|
||||
}
|
||||
|
||||
OUTPUT_ARCH(mips)
|
||||
SEARCH_DIR(".");
|
||||
SEARCH_DIR("/usr/local/mipsel-elf/lib:/usr/local/mipsel-elf/lib/eb");
|
||||
SEARCH_DIR("/usr/local/lib/gcc/mipsel-elf/4.3.3:/usr/local/lib/gcc/mipsel-elf/4.3.3/eb");
|
||||
|
||||
stack_ptr = 0x7FFFEFF0;
|
||||
baudrate = 0x0D;
|
||||
sys_led_port = 0xA0000000;
|
||||
sys_uart_data = 0xA0010000;
|
||||
sys_uart_stat = 0xA0010004;
|
||||
sys_uart_baud = 0xA0010008;
|
||||
sys_timer_usec = 0xA000008;
|
||||
sys_timer_sec = 0xA000000C;
|
||||
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.init ORIGIN(rom) :
|
||||
{
|
||||
start = ALIGN(4);
|
||||
entry = ALIGN(4);
|
||||
_entry = ALIGN(4);
|
||||
__entry = ALIGN(4);
|
||||
*(.stext)
|
||||
} > rom
|
||||
|
||||
.ktext ORIGIN(rom) + 0x180 :
|
||||
{
|
||||
*(.ktext)
|
||||
} > rom
|
||||
|
||||
.text . :
|
||||
{
|
||||
*(.text)
|
||||
} > rom
|
||||
|
||||
.rodata . :
|
||||
{
|
||||
*(.rodata*)
|
||||
} > rom
|
||||
|
||||
.data ORIGIN(ram) :
|
||||
{
|
||||
_ram_start = ALIGN(4);
|
||||
*(.*data) *(.*bss) *(.*common)
|
||||
} > ram
|
||||
|
||||
.flash ORIGIN(flash) :
|
||||
{
|
||||
_flash_start = ALIGN(4);
|
||||
} > flash
|
||||
|
||||
}
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1,221 @@
|
||||
Archive member included because of file (symbol)
|
||||
|
||||
/usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
bootloader_with_flash.o (memset)
|
||||
|
||||
Discarded input sections
|
||||
|
||||
.reginfo 0x0000000000000000 0x0 init.o
|
||||
.reginfo 0x0000000000000000 0x0 kernel.o
|
||||
.reginfo 0x0000000000000000 0x0 libsys.o
|
||||
.reginfo 0x0000000000000000 0x0 cfiflash.o
|
||||
.reginfo 0x0000000000000000 0x0 bootloader_with_flash.o
|
||||
.reginfo 0x0000000000000000 0x0 /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
|
||||
Memory Configuration
|
||||
|
||||
Name Origin Length Attributes
|
||||
rom 0x000000009fc00000 0x0000000000002000
|
||||
ram 0x0000000080000000 0x0000000004000000
|
||||
flash_u 0x00000000a4000000 0x0000000000800000
|
||||
flash_c 0x0000000088000000 0x0000000000800000
|
||||
io 0x00000000ac000000 0x0000000000800000
|
||||
*default* 0x0000000000000000 0xffffffffffffffff
|
||||
|
||||
Linker script and memory map
|
||||
|
||||
0x0000000083ffeff0 stack_ptr = 0x83ffeff0
|
||||
0x000000000000000d baudrate = 0xd
|
||||
0x00000000ac000000 sys_led_port = 0xac000000
|
||||
0x00000000ac010000 sys_uart_data = 0xac010000
|
||||
0x00000000ac010004 sys_uart_stat = 0xac010004
|
||||
0x00000000ac010008 sys_uart_baud = 0xac010008
|
||||
0x000000000ac00008 sys_timer_usec = 0xac00008
|
||||
0x00000000ac00000c sys_timer_sec = 0xac00000c
|
||||
|
||||
.init 0x000000009fc00000 0x70
|
||||
0x000000009fc00000 start = ALIGN (0x4)
|
||||
0x000000009fc00000 entry = ALIGN (0x4)
|
||||
0x000000009fc00000 _entry = ALIGN (0x4)
|
||||
0x000000009fc00000 __entry = ALIGN (0x4)
|
||||
*(.stext)
|
||||
.init 0x000000009fc00000 0x5c startup.o
|
||||
.init 0x000000009fc0005c 0x14 init.o
|
||||
0x000000009fc0005c _init
|
||||
|
||||
.ktext 0x000000009fc00180 0x48
|
||||
*(.ktext)
|
||||
.ktext 0x000000009fc00180 0x48 kernel.o
|
||||
|
||||
.text 0x000000009fc001c8 0x14d8
|
||||
*(.text)
|
||||
.text 0x000000009fc001c8 0x0 startup.o
|
||||
.text 0x000000009fc001c8 0x0 init.o
|
||||
.text 0x000000009fc001c8 0x0 kernel.o
|
||||
.text 0x000000009fc001c8 0x3f0 libsys.o
|
||||
0x000000009fc00264 _putchar
|
||||
0x000000009fc003ec memdump
|
||||
0x000000009fc003a0 print_word
|
||||
0x000000009fc001c8 CP0_SR_read
|
||||
0x000000009fc001ec CP0_CR_write
|
||||
0x000000009fc002c0 sputs
|
||||
0x000000009fc00204 readchar
|
||||
0x000000009fc00234 writechar
|
||||
0x000000009fc00330 print_byte
|
||||
0x000000009fc001e0 CP0_CR_read
|
||||
0x000000009fc001f8 CP0_PRID_read
|
||||
0x000000009fc005a8 PrintBuffer8
|
||||
0x000000009fc001d4 CP0_SR_write
|
||||
.text 0x000000009fc005b8 0x808 cfiflash.o
|
||||
0x000000009fc00614 cfi_find
|
||||
0x000000009fc008d8 cfi_block_unlock
|
||||
0x000000009fc005e0 cfi_init
|
||||
0x000000009fc00728 cfi_block_is_locked
|
||||
0x000000009fc00c10 flash_erase
|
||||
0x000000009fc00d90 flash_get_offset_blockaligned
|
||||
0x000000009fc00cf0 flash_verify
|
||||
0x000000009fc00d60 flash_get_offset_by_blocknum
|
||||
0x000000009fc00798 cfi_block_erase
|
||||
0x000000009fc00d38 flash_get_blocknum_by_offset
|
||||
0x000000009fc00bac flash_find
|
||||
0x000000009fc00978 cfi_program_single
|
||||
0x000000009fc005b8 cfi_get_status
|
||||
0x000000009fc00cd0 flash_program
|
||||
0x000000009fc00838 cfi_block_lock
|
||||
0x000000009fc009f8 cfi_program_multi
|
||||
.text 0x000000009fc00dc0 0x7f0 bootloader_with_flash.o
|
||||
0x000000009fc00dc0 h2i
|
||||
0x000000009fc01098 Exec_RE_at
|
||||
0x000000009fc0106c Jump_to
|
||||
0x000000009fc010c4 srec_getline
|
||||
0x000000009fc0107c Exec_at
|
||||
0x000000009fc00e10 decode_srec
|
||||
0x000000009fc01150 main
|
||||
.text 0x000000009fc015b0 0xf0 /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
0x000000009fc015b0 memset
|
||||
|
||||
.rodata 0x000000009fc016a0 0x15c
|
||||
*(.rodata*)
|
||||
.rodata.str1.4
|
||||
0x000000009fc016a0 0x8 libsys.o
|
||||
0x10 (size before relaxing)
|
||||
.rodata.str1.4
|
||||
0x000000009fc016a8 0x154 bootloader_with_flash.o
|
||||
0x15c (size before relaxing)
|
||||
|
||||
.data 0x0000000080000000 0x0
|
||||
0x0000000080000000 _ram_start = ALIGN (0x4)
|
||||
*(.*data)
|
||||
.data 0x0000000080000000 0x0 startup.o
|
||||
.data 0x0000000080000000 0x0 init.o
|
||||
.data 0x0000000080000000 0x0 kernel.o
|
||||
.data 0x0000000080000000 0x0 libsys.o
|
||||
.data 0x0000000080000000 0x0 cfiflash.o
|
||||
.data 0x0000000080000000 0x0 bootloader_with_flash.o
|
||||
.data 0x0000000080000000 0x0 /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
*(.*bss)
|
||||
.bss 0x0000000080000000 0x0 startup.o
|
||||
.bss 0x0000000080000000 0x0 init.o
|
||||
.bss 0x0000000080000000 0x0 kernel.o
|
||||
.bss 0x0000000080000000 0x0 libsys.o
|
||||
.bss 0x0000000080000000 0x0 cfiflash.o
|
||||
.bss 0x0000000080000000 0x0 bootloader_with_flash.o
|
||||
.bss 0x0000000080000000 0x0 /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
*(.*common)
|
||||
LOAD startup.o
|
||||
LOAD init.o
|
||||
LOAD kernel.o
|
||||
LOAD libsys.o
|
||||
LOAD cfiflash.o
|
||||
LOAD bootloader_with_flash.o
|
||||
LOAD /usr/local/mipsel-elf/lib/eb/libc.a
|
||||
LOAD /usr/local/lib/gcc/mipsel-elf/4.3.3/eb/libgcc.a
|
||||
OUTPUT(bootloader_flash.elf elf32-bigmips)
|
||||
|
||||
.reginfo 0x0000000000000000 0x18
|
||||
.reginfo 0x0000000000000000 0x18 startup.o
|
||||
|
||||
.pdr 0x0000000000000000 0x4a0
|
||||
.pdr 0x0000000000000000 0x0 startup.o
|
||||
.pdr 0x0000000000000000 0x0 init.o
|
||||
.pdr 0x0000000000000000 0x0 kernel.o
|
||||
.pdr 0x0000000000000000 0x1a0 libsys.o
|
||||
.pdr 0x00000000000001a0 0x200 cfiflash.o
|
||||
.pdr 0x00000000000003a0 0xe0 bootloader_with_flash.o
|
||||
.pdr 0x0000000000000480 0x20 /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
|
||||
.mdebug.abi32 0x0000000000000000 0x0
|
||||
.mdebug.abi32 0x0000000000000000 0x0 libsys.o
|
||||
.mdebug.abi32 0x0000000000000000 0x0 cfiflash.o
|
||||
.mdebug.abi32 0x0000000000000000 0x0 bootloader_with_flash.o
|
||||
.mdebug.abi32 0x0000000000000000 0x0 /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
|
||||
.comment 0x0000000000000000 0x48
|
||||
.comment 0x0000000000000000 0x12 libsys.o
|
||||
.comment 0x0000000000000012 0x12 cfiflash.o
|
||||
.comment 0x0000000000000024 0x12 bootloader_with_flash.o
|
||||
.comment 0x0000000000000036 0x12 /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
|
||||
.gnu.attributes
|
||||
0x0000000000000000 0x10
|
||||
.gnu.attributes
|
||||
0x0000000000000000 0x10 libsys.o
|
||||
.gnu.attributes
|
||||
0x0000000000000010 0x10 cfiflash.o
|
||||
.gnu.attributes
|
||||
0x0000000000000020 0x10 bootloader_with_flash.o
|
||||
.gnu.attributes
|
||||
0x0000000000000030 0x10 /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
|
||||
.debug_abbrev 0x0000000000000000 0x566
|
||||
.debug_abbrev 0x0000000000000000 0x244 cfiflash.o
|
||||
.debug_abbrev 0x0000000000000244 0x257 bootloader_with_flash.o
|
||||
.debug_abbrev 0x000000000000049b 0xcb /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
|
||||
.debug_info 0x0000000000000000 0xff2
|
||||
.debug_info 0x0000000000000000 0x870 cfiflash.o
|
||||
.debug_info 0x0000000000000870 0x643 bootloader_with_flash.o
|
||||
.debug_info 0x0000000000000eb3 0x13f /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
|
||||
.debug_line 0x0000000000000000 0x3d2
|
||||
.debug_line 0x0000000000000000 0x164 cfiflash.o
|
||||
.debug_line 0x0000000000000164 0x19b bootloader_with_flash.o
|
||||
.debug_line 0x00000000000002ff 0xd3 /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
|
||||
.debug_frame 0x0000000000000000 0x210
|
||||
.debug_frame 0x0000000000000000 0x144 cfiflash.o
|
||||
.debug_frame 0x0000000000000144 0xac bootloader_with_flash.o
|
||||
.debug_frame 0x00000000000001f0 0x20 /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
|
||||
.debug_loc 0x0000000000000000 0xa8c
|
||||
.debug_loc 0x0000000000000000 0x548 cfiflash.o
|
||||
.debug_loc 0x0000000000000548 0x443 bootloader_with_flash.o
|
||||
.debug_loc 0x000000000000098b 0x101 /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
|
||||
.debug_pubnames
|
||||
0x0000000000000000 0x1ee
|
||||
.debug_pubnames
|
||||
0x0000000000000000 0x166 cfiflash.o
|
||||
.debug_pubnames
|
||||
0x0000000000000166 0x6b bootloader_with_flash.o
|
||||
.debug_pubnames
|
||||
0x00000000000001d1 0x1d /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
|
||||
.debug_aranges 0x0000000000000000 0x60
|
||||
.debug_aranges
|
||||
0x0000000000000000 0x20 cfiflash.o
|
||||
.debug_aranges
|
||||
0x0000000000000020 0x20 bootloader_with_flash.o
|
||||
.debug_aranges
|
||||
0x0000000000000040 0x20 /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
|
||||
.debug_str 0x0000000000000000 0x4df
|
||||
.debug_str 0x0000000000000000 0x29a cfiflash.o
|
||||
0x304 (size before relaxing)
|
||||
.debug_str 0x000000000000029a 0x186 bootloader_with_flash.o
|
||||
0x282 (size before relaxing)
|
||||
.debug_str 0x0000000000000420 0xbf /usr/local/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
|
||||
0x157 (size before relaxing)
|
||||
|
||||
.debug_ranges 0x0000000000000000 0x30
|
||||
.debug_ranges 0x0000000000000000 0x30 bootloader_with_flash.o
|
||||
@@ -0,0 +1,370 @@
|
||||
S0180000626F6F746C6F616465725F666C6173682E7372656374
|
||||
S3159FC000003C1D840027BDEFF03C1A1040375A000AAA
|
||||
S3159FC00010409A6000241A0000409A6800401A7800EF
|
||||
S3159FC0002000000000409AF8004200002042000022D3
|
||||
S3159FC000303C1A9FC0275A005C0340F8090000000085
|
||||
S3159FC000403C1A9FC0275A11500340F8090000000070
|
||||
S3159FC00050000000000BF00014000000003C1AAC0129
|
||||
S3159FC00060275A0008241B000DAF5B000003E0000861
|
||||
S3159FC00180401A68003C1BC000001AD082335A000F29
|
||||
S3159FC00190035BD0253C1BAC00277B0000AF7A0000D9
|
||||
S3159FC001A0401A680000000000001AD202335A00FFAE
|
||||
S3159FC001B01740FFFB00000000401A700000000000BF
|
||||
S30D9FC001C0034000084200001035
|
||||
S3159FC001C84002600003E00008000000004084600011
|
||||
S3159FC001D803E00008000000004002680003E0000832
|
||||
S3159FC001E8000000004084680003E00008000000008B
|
||||
S3159FC001F84002780003E00008000000003C02AC0102
|
||||
S3159FC00208344300048C620000000000003042001096
|
||||
S3159FC002181040FFFC3C02AC018C420000000000006D
|
||||
S3159FC002280002160003E00008000216030004260019
|
||||
S3159FC002383C02AC0100042603344300048C620000D0
|
||||
S3159FC0024800000000304200021440FFFC3C02AC0193
|
||||
S3159FC00258AC44000003E0000800000000000426002C
|
||||
S3159FC00268000426032402000A1482000A3C02AC0139
|
||||
S3159FC00278344300048C620000000000003042000234
|
||||
S3159FC002881440FFFC3C02AC012403000DAC430000A4
|
||||
S3159FC002983C02AC01344300048C620000000000009D
|
||||
S3159FC002A8304200021440FFFC3C02AC01AC44000043
|
||||
S3159FC002B803E00008000000003C02AC01344700047C
|
||||
S3159FC002C8008028212409000A3C06AC010BF000C611
|
||||
S3159FC002D82408000D14690007000000008CE2000086
|
||||
S3159FC002E800000000304200021440FFFC00000000DE
|
||||
S3159FC002F8ACC800008CE2000000000000304200023B
|
||||
S3159FC003081440FFFC00000000ACC3000024A50001F8
|
||||
S3159FC0031880A30000000000001460FFEE00A4102315
|
||||
S3159FC0032803E0000800000000000426003C02AC0160
|
||||
S3159FC0033800042603344A0004000038213C09AC0156
|
||||
S3159FC0034824080002308200FF00022902000411001F
|
||||
S3159FC00358000226002CA3000A00042603146000028C
|
||||
S3159FC0036824A6003024A600378D4200000000000056
|
||||
S3159FC00378304200021440FFFC000616000002160316
|
||||
S3159FC0038824E70001AD22000014E8FFEF308200FF8A
|
||||
S3159FC0039803E000080000000027BDFFE0AFB20018C9
|
||||
S3159FC003A8AFB10014AFB00010AFBF001C008088214A
|
||||
S3159FC003B80000802124120004001126030FF000CCF0
|
||||
S3159FC003C8261000011612FFFC00118A008FBF001C61
|
||||
S3159FC003D88FB200188FB100148FB0001003E00008C9
|
||||
S3159FC003E827BD002027BDFFC8AFB60028AFBF0034C2
|
||||
S3159FC003F8AFBE0030AFB7002CAFB50024AFB4002056
|
||||
S3159FC00408AFB3001CAFB20018AFB10014AFB00010A5
|
||||
S3159FC004180080102110A0000200C0B021000020213A
|
||||
S3159FC00428004098213C02AC0100E090210080A821A1
|
||||
S3159FC00438345E000400E0A0213C17AC010FF000E831
|
||||
S3159FC0044802A020213C049FC00FF000B0248416A0B0
|
||||
S3159FC00458026088210BF00128000080211240000904
|
||||
S3159FC0046800000000822400000FF000CC2652FFFF38
|
||||
S3159FC004783C049FC00FF000B0248417780BF0012866
|
||||
S3159FC00488263100013C049FC00FF000B0248416A4F7
|
||||
S3159FC004980BF0012C3C049FC00216102A1440FFEF94
|
||||
S3159FC004A8261000013C049FC00FF000B0248416A4F8
|
||||
S3159FC004B8026028210BF00155000020211280001EE2
|
||||
S3159FC004C80000000090A30000000000002462FFE027
|
||||
S3159FC004D8304200FF2C4200601440000300031E00F8
|
||||
S3159FC004E82403002E00031E0000031E032402000AD5
|
||||
S3159FC004F814620007000000008FC2000000000000C1
|
||||
S3159FC00508304200021440FFFC2402000DAEE20000F8
|
||||
S3159FC005188FC2000000000000304200021440FFFC5A
|
||||
S3159FC0052800000000AEE300002694FFFF248400016C
|
||||
S3159FC005380BF0015524A500013C049FC00FF000B0E5
|
||||
S3159FC00548248417780BF001593C049FC00096102A43
|
||||
S3159FC005581440FFDA000000003C049FC00FF000B0B3
|
||||
S3159FC00568248416CC02B6A8211640FFB402769821D9
|
||||
S3159FC005788FBF00348FBE00308FB7002C8FB6002830
|
||||
S3159FC005888FB500248FB400208FB3001C8FB200187C
|
||||
S3159FC005988FB100148FB0001003E0000827BD003844
|
||||
S3159FC005A800C0382100A030210BF000FB24050001B4
|
||||
S3159FC005B88C8400003C020070344200703C0300FFEC
|
||||
S3159FC005C8AC820000346300FF8C820000AC830000BD
|
||||
S3159FC005D803E000080000000027BDFFF8AC850000B7
|
||||
S3159FC005E8248200080BF0017F24830020A0400000CE
|
||||
S3159FC005F8244200011443FFFD0000000024020001AD
|
||||
S3159FC00608AC82000403E0000827BD00088C87000061
|
||||
S3159FC006183C02009834420098ACE200003C0200FFBE
|
||||
S3159FC00628344200FFACE200003C0200903442009086
|
||||
S3159FC00638ACE200000080402194E4009C24030002A1
|
||||
S3159FC0064824020020AD030008AD03001CAD020018AC
|
||||
S3159FC006583084FFFF0BF0019D000018218D02000812
|
||||
S3159FC006680000000000021040AD0200080064102B75
|
||||
S3159FC006781440FFFA2463000194E200AC94E300A8F7
|
||||
S3159FC006883042FFFF8D04001C3063FFFF000212003B
|
||||
S3159FC0069800432825AD0400140BF001AE00001821B5
|
||||
S3159FC006A88D0200140000000000021040AD02001425
|
||||
S3159FC006B80065102B1440FFFA2463000194E300B829
|
||||
S3159FC006C894E600B494E200C094E400BC8D05001C77
|
||||
S3159FC006D83042FFFF3084FFFF0002120000441025FE
|
||||
S3159FC006E800052A0000A200183063FFFF30C6FFFF2F
|
||||
S3159FC006F800031A000066182524630001AD03001085
|
||||
S3159FC007083C0300FF346300FF00001021000028123D
|
||||
S3159FC00718AD05000CACE3000003E000080000000034
|
||||
S3159FC007288C8200088C8600000002108200A2102BC3
|
||||
S3159FC00738144000043C0300903C02801003E000086C
|
||||
S3159FC00748344200028C820010000000002442FFFF42
|
||||
S3159FC007580002140000A210242442000234630090B1
|
||||
S3159FC0076800021080ACC3000000C210218C43000059
|
||||
S3159FC007783C02000134420001006218243C0200FF7B
|
||||
S3159FC00788344200FFACC2000003E000080003102BF0
|
||||
S3159FC007988C82000800A018210002108200A2102B8C
|
||||
S3159FC007A88C850000144000033C0280100BF0020C9D
|
||||
S3159FC007B8344300028C820010000000002442FFFFD1
|
||||
S3159FC007C800021400006210240002108000A220219B
|
||||
S3159FC007D83C02002034420020AC8200003C0200D07C
|
||||
S3159FC007E8344200D0AC8200003C0200803443008073
|
||||
S3159FC007F88C8600000000000000C310241443FFFC31
|
||||
S3159FC008083C02002A3442002A00C21024104000032A
|
||||
S3159FC00818000018213C02901000C218253C0200FF18
|
||||
S3159FC00828344200FFAC82000003E00008006010213C
|
||||
S3159FC008388C82000800A018210002108200A2102BEB
|
||||
S3159FC008488C850000144000033C0280100BF00234D4
|
||||
S3159FC00858344300028C820010000000002442FFFF30
|
||||
S3159FC0086800021400006210240002108000A22021FA
|
||||
S3159FC008783C02006034420060AC8200003C0200012A
|
||||
S3159FC0088834420001AC8200003C02008034430080A1
|
||||
S3159FC008988C8600000000000000C310241443FFFC90
|
||||
S3159FC008A83C0200383442003800C21024104000036E
|
||||
S3159FC008B8000018213C02901000C218253C0200FF78
|
||||
S3159FC008C8344200FFAC82000003E00008006010219C
|
||||
S3159FC008D88C82000800A018210002108200A2102B4B
|
||||
S3159FC008E88C850000144000033C0280100BF0025C0C
|
||||
S3159FC008F8344300028C820010000000002442FFFF90
|
||||
S3159FC0090800021400006210240002108000A2202159
|
||||
S3159FC009183C02006034420060AC8200003C0200D0BA
|
||||
S3159FC00928344200D0AC8200003C0200803443008031
|
||||
S3159FC009388C8600000000000000C310241443FFFCEF
|
||||
S3159FC009483C0200383442003800C2102410400003CD
|
||||
S3159FC00958000018213C02901000C218253C0200FFD7
|
||||
S3159FC00968344200FFAC82000003E0000800601021FB
|
||||
S3159FC009788C8200088C8400000002108200A2102B73
|
||||
S3159FC00988144000033C0280100BF0027C34430002E3
|
||||
S3159FC0099800051080008220213C020040344200405E
|
||||
S3159FC009A8AC8200003C020080AC86000034430080C5
|
||||
S3159FC009B88C8600000000000000C310241443FFFC6F
|
||||
S3159FC009C83C02001A3442001A00C210241040000389
|
||||
S3159FC009D8000018213C02901000C218253C0200FF57
|
||||
S3159FC009E8344200FFAC82000003E00008006010217B
|
||||
S3159FC009F88C82000827BDFFE80002108200A2102B38
|
||||
S3159FC00A08AFB40014AFB30010AFB2000CAFB10008BB
|
||||
S3159FC00A18AFB000040080C0218C8E00001440000433
|
||||
S3159FC00A2800C0A0213C0280100BF002E334440002B0
|
||||
S3159FC00A388C820010000068212442FFFF0002CC0070
|
||||
S3159FC00A483C0200E8345300E83C020080344F0080E3
|
||||
S3159FC00A583C02001A3446001A3C0200D0345200D0D9
|
||||
S3159FC00A683C0200FF345100FF0BF002E13C1000012D
|
||||
S3159FC00A78018510230050502100EA102B1040000218
|
||||
S3159FC00A88000C108000E050210BF002D701C25821FC
|
||||
S3159FC00A98AD7300008D63000000000000006F102436
|
||||
S3159FC00AA8144FFFFC00661024144000263C02901089
|
||||
S3159FC00AB88F0200140000000000021882006A102BE3
|
||||
S3159FC00AC81040000201404021006040212503FFFFDE
|
||||
S3159FC00AD8000314000043102500052080000D1880D0
|
||||
S3159FC00AE802834821AD62000001C420210BF002C3D6
|
||||
S3159FC00AF8000018218D22000025290004AC82000021
|
||||
S3159FC00B08248400040068102B1440FFFA2463000154
|
||||
S3159FC00B1801A8682100A8282100E83823AD720000E3
|
||||
S3159FC00B288D63000000000000006F1024144FFFFC67
|
||||
S3159FC00B3800661024104000050148502301485021E3
|
||||
S3159FC00B483C0290100BF002D900622025AD710000BF
|
||||
S3159FC00B58000020211540FFCE000000000481000739
|
||||
S3159FC00B68000C18803C0200FF01C31821344200FFC5
|
||||
S3159FC00B78AC6200000BF002E40080102114E0FFBCB9
|
||||
S3159FC00B8800B96024008010218FB400148FB3001061
|
||||
S3159FC00B988FB2000C8FB100088FB0000403E0000825
|
||||
S3159FC00BA827BD001827BDFFE0AFBF001CAC8500005E
|
||||
S3159FC00BB8248200080BF002F324830020A040000083
|
||||
S3159FC00BC8244200011443FFFD000000003C0212347A
|
||||
S3159FC00BD83442567800021E02AFA2001024020012A9
|
||||
S3159FC00BE814620003AC80000424020001AC82000496
|
||||
S3159FC00BF80FF00185000000008FBF001C0000000099
|
||||
S3159FC00C0803E0000827BD002027BDFFD830C20003D8
|
||||
S3159FC00C18AFB2001CAFBF0024AFB30020AFB100185E
|
||||
S3159FC00C28AFB00014104000040080902100061082C7
|
||||
S3159FC00C38244200010002308000C598210BF003248E
|
||||
S3159FC00C4800A088210FF001CA0000000002402021A1
|
||||
S3159FC00C5810400005020028210FF002360000000050
|
||||
S3159FC00C680440001100401821020028210FF001E618
|
||||
S3159FC00C78024020210440000C004018218E42000CDF
|
||||
S3159FC00C880000000002228821001117C300021782A4
|
||||
S3159FC00C9800511021000280830233102B024020216D
|
||||
S3159FC00CA81440FFE8020028218FBF0024006010214E
|
||||
S3159FC00CB88FB300208FB2001C8FB100188FB000145D
|
||||
S3159FC00CC803E0000827BD002830E200031040000358
|
||||
S3159FC00CD8000710822442000100023880000528823E
|
||||
S3159FC00CE80BF0027E000738828C820000000020210C
|
||||
S3159FC00CF80BF00347004540219063000090A2000077
|
||||
S3159FC00D0800000000106200033C02801003E0000848
|
||||
S3159FC00D18344200030087102B0104182100C42821E0
|
||||
S3159FC00D281440FFF52484000103E00008000000007A
|
||||
S3159FC00D388C82000C000000001440000200A2001B19
|
||||
S3159FC00D480007000D000010100002102B000028128B
|
||||
S3159FC00D5803E0000800A210218C8300100000000049
|
||||
S3159FC00D6800A3102B14400002000000002465FFFF5B
|
||||
S3159FC00D788C82000C0000000000A200180000101210
|
||||
S3159FC00D8803E000080000000027BDFFE8AFBF0014BE
|
||||
S3159FC00D98AFB000100FF0034E008080218E03000C69
|
||||
S3159FC00DA88FBF0014004300188FB0001000001012A8
|
||||
S3159FC00DB803E0000827BD00189083000000000000CC
|
||||
S3159FC00DC82C620041144000022462FFD02462FFC9EE
|
||||
S3159FC00DD890840001304200FF304300FF2C820041BF
|
||||
S3159FC00DE814400003000000000BF0037F2482FFC954
|
||||
S3159FC00DF82482FFD0304400FF0003110000821025D3
|
||||
S3159FC00E0803E00008304200FF10C0009400805021C4
|
||||
S3159FC00E1824020003AC82000890A4000100000000D1
|
||||
S3159FC00E282482FFCF304200FF2C42000310400005AA
|
||||
S3159FC00E382482FFC924020002AD4200080BF003A119
|
||||
S3159FC00E482489FFD1304200FF2C4200031040000680
|
||||
S3159FC00E58240200302402003B004448232402000495
|
||||
S3159FC00E680BF003A1AD42000814820004000048217C
|
||||
S3159FC00E7824020001AD4200082409000290A3000283
|
||||
S3159FC00E88000000002C6200411040000324A4000209
|
||||
S3159FC00E980BF003A92462FFD02462FFC99083000187
|
||||
S3159FC00EA8304200FF304400FF2C62004110400002D0
|
||||
S3159FC00EB82462FFC92462FFD0304300FF000411009B
|
||||
S3159FC00EC800621025304200FFAD420004AD400000CD
|
||||
S3159FC00ED80040582100A030210BF003D500003821CF
|
||||
S3159FC00EE890C20004000000002443FFC92444FFD0D9
|
||||
S3159FC00EF82C42004110400002306300FF308300FF40
|
||||
S3159FC00F0890C20005306800FF2444FFC92443FFD020
|
||||
S3159FC00F182C42004110400002308400FF306400FF1D
|
||||
S3159FC00F288D4300000008110000821025304200FF43
|
||||
S3159FC00F3800031A00004B202100431025AD42000034
|
||||
S3159FC00F48308B00FF24E7000124C6000200E9102A5F
|
||||
S3159FC00F581440FFE3252200028D440004000210407E
|
||||
S3159FC00F68000918270083202100A21021AD44000440
|
||||
S3159FC00F78AD42000C0BF003F90000302190E200004F
|
||||
S3159FC00F88000000002444FFC92445FFD02C420041DD
|
||||
S3159FC00F9810400002308400FF30A400FF90E2000199
|
||||
S3159FC00FA8308700FF2445FFC92444FFD02C42004107
|
||||
S3159FC00FB814400002308400FF30A400FF00071100D0
|
||||
S3159FC00FC800821025304200FF00661821004B202161
|
||||
S3159FC00FD8A0620000308B00FF24C600018D4200042A
|
||||
S3159FC00FE88D43000C0006204000C2102A1440FFE320
|
||||
S3159FC00FF80064382190E40000000000002C82004164
|
||||
S3159FC010081040000300E018210BF004072482FFD08C
|
||||
S3159FC010182482FFC990630001304200FF304400FF1D
|
||||
S3159FC010282C620041104000022462FFC92462FFD08F
|
||||
S3159FC01038304200FF0004190000431825000B1027F3
|
||||
S3159FC01048304200FF306300FF1443000400000000D5
|
||||
S3159FC010588D42000803E000080000000003E0000876
|
||||
S3159FC0106800001021008000080000000003E000086F
|
||||
S3159FC01078000000003C1A1000375A000A409A6000C8
|
||||
S3159FC01088008000084200001003E00008000000002E
|
||||
S3159FC01098401A60003C1BFFBF377BFFFF035BD02412
|
||||
S3159FC010A83C1B0200035BD025409A60000080000865
|
||||
S3159FC010B84200001003E000080000000027BDFFD8CB
|
||||
S3159FC010C8AFB30020AFB10018AFB00014AFBF0024B4
|
||||
S3159FC010D8AFB2001C008098212411007324100053BE
|
||||
S3159FC010E80FF00081000000001451000500000000A9
|
||||
S3159FC010F8000080212412000A0BF0044A2411000D17
|
||||
S3159FC011081450FFF7000000000BF0043F0000802139
|
||||
S3159FC011180FF00081A0620000105100032610000145
|
||||
S3159FC011281452FFFB027018218FBF002402001021A2
|
||||
S3159FC011388FB300208FB2001C8FB100188FB00014D8
|
||||
S3159FC0114803E0000827BD002827BDFD9827A40140B6
|
||||
S3159FC011580000282124060100AFB20248AFB102445D
|
||||
S3159FC01168AFB002403C11AC00AFBF0264AFBE0260D5
|
||||
S3159FC01178AFB7025CAFB60258AFB50254AFB4025010
|
||||
S3159FC011880FF0056CAFB3024C3C03600036220004D7
|
||||
S3159FC011983463B1FFAC4300003C02200027B2002055
|
||||
S3159FC011A834421000AE220000024020213C05A40014
|
||||
S3159FC011B88E3000000FF002EB0000000004410004CF
|
||||
S3159FC011C800102C023C049FC00BF00494248416A8DC
|
||||
S3159FC011D8024020210FF0035830A5007F0040902180
|
||||
S3159FC011E88E2200003C03080000431024144000458B
|
||||
S3159FC011F83C119FC00FF000B02624175C3C02A40088
|
||||
S3159FC01208024280218E0300003C0231493442464A3D
|
||||
S3159FC01218106200113C024A46344249311062000EA0
|
||||
S3159FC01228000000000FF000B02624175C3C049FC046
|
||||
S3159FC012380FF000B0248416D00FF000E8024020219A
|
||||
S3159FC012483C049FC0248416E80FF000B0000000003D
|
||||
S3159FC012580BF00560240200013C049FC00FF000B04C
|
||||
S3159FC01268248416F40FF000E8024020213C049FC056
|
||||
S3159FC012780FF000B0248417188E02000C8E1100043C
|
||||
S3159FC01288000240828E070008000020210BF004AAA6
|
||||
S3159FC01298000018218CC2000000000000ACA200000C
|
||||
S3159FC012A80088102B006730210071282124840001F3
|
||||
S3159FC012B81440FFF8246300043C049FC00FF000B09D
|
||||
S3159FC012C8248417203C049FC00FF000B0248417289D
|
||||
S3159FC012D88E0400040FF000E8000000003C049FC085
|
||||
S3159FC012E80FF000B02484175C3C1A1000375A000AC6
|
||||
S3159FC012F8409A600002200008420000100BF005606B
|
||||
S3159FC01308000010210FF000B02624175C3C049FC034
|
||||
S3159FC013180FF000B0248417343C0280003C03801031
|
||||
S3159FC01328AC400000244200041443FFFD00009821EE
|
||||
S3159FC013383C029FC0245516CC3C029FC024561720FA
|
||||
S3159FC013483C029FC0245E17D43C029FC0245717F403
|
||||
S3159FC013583C049FC00FF000B0248417543C149FC010
|
||||
S3159FC0136827B000400FF004310200202100403021F1
|
||||
S3159FC013780200282127A400100FF00384004088216B
|
||||
S3159FC0138800401821240200021062000524020004AE
|
||||
S3159FC013981462FFEF000000000BF004FF3C049FC0DF
|
||||
S3159FC013A88FA500108FA600140BF004F40000182117
|
||||
S3159FC013B88FA2001C0000000000431021904200002D
|
||||
S3159FC013C824630001A08200008FA2001400000000C1
|
||||
S3159FC013D80062102B1440FFF60065202100C5182116
|
||||
S3159FC013E80263102B10400060022080210BF0055C21
|
||||
S3159FC013F8006098210FF000B0248417588FA600105C
|
||||
S3159FC01408264701000266182327B100203C024A4698
|
||||
S3159FC0141800E328210220202134424931AFA6014446
|
||||
S3159FC01428AFA3014CAFA701480FF00364AFA2014019
|
||||
S3159FC014383C049FC0248417600FF000B0AFA2015030
|
||||
S3159FC014488FA4014C0FF000E8000000000FF000B019
|
||||
S3159FC0145802A020213C049FC00FF000B02484177CB3
|
||||
S3159FC014680FF000E8024020210FF000B002A0202113
|
||||
S3159FC014783C049FC00FF000B0248417988FA40150D6
|
||||
S3159FC014880FF000E8000000000FF000B002A0202176
|
||||
S3159FC014983C049FC00FF000B0248417B48FA6014C9C
|
||||
S3159FC014A80220202124C601000FF0030402402821F0
|
||||
S3159FC014B80440001F004080210FF000B002C02021C9
|
||||
S3159FC014C80FF000B003C0202102202021024028210E
|
||||
S3159FC014D827A601400FF003342407010004400014D7
|
||||
S3159FC014E8004080218FA501488FA601448FA7014C34
|
||||
S3159FC014F80FF00334022020210440000D00408021B4
|
||||
S3159FC015080FF000B002C020213C049FC00FF000B06E
|
||||
S3159FC01518248417E48FA501488FA601448FA7014C41
|
||||
S3159FC015280FF0033C022020210441000A004080217D
|
||||
S3159FC015380FF000B0268417C40FF000E802002021E0
|
||||
S3159FC015483C049FC00FF000B0248417D00BF0055CF5
|
||||
S3159FC01558000000000FF000B002E020213C02BFC08F
|
||||
S3159FC0156800400008000000000601FF7E27B000402B
|
||||
S3159FC015780BF004D73C049FC08FBF02648FBE026026
|
||||
S3159FC015888FB7025C8FB602588FB502548FB402507C
|
||||
S3159FC015988FB3024C8FB202488FB102448FB00240BC
|
||||
S3159FC015A803E0000827BD02682CC2001000804821AE
|
||||
S3159FC015B81440002D008040213087000310E0000EA4
|
||||
S3159FC015C82482000400052600004710230004260332
|
||||
S3159FC015D801201821A0640000246300011462FFFD46
|
||||
S3159FC015E8000000000007102724C3FFFB2444000502
|
||||
S3159FC015F8006230230124402130A500FF0100382115
|
||||
S3159FC0160810A0000500A0182100051200004510254E
|
||||
S3159FC0161800021C0000621825000610C21040001C5C
|
||||
S3159FC0162830C60007010020210040382124E7FFFF6C
|
||||
S3159FC01638AC830000AC83000414E0FFFC248400083C
|
||||
S3159FC01648000210C00102382100E020212CC20004EC
|
||||
S3159FC016581440000500804021ACE3000024E4000448
|
||||
S3159FC0166824C6FFFC0080402110C000070000000070
|
||||
S3159FC01678000516000002160324C6FFFFA10200003C
|
||||
S3159FC0168814C0FFFD2508000103E0000801201021B2
|
||||
S30D9FC016980BF00595010020210E
|
||||
S3159FC016A03A2000002020200043616E6E6F74206632
|
||||
S3159FC016B0696E6420666C61736820646576696365CC
|
||||
S3159FC016C02E2045786974206E6F77210A0A00000024
|
||||
S3159FC016D0496E76616C696420696D61676520666FC6
|
||||
S3159FC016E0756E6420617420002E2041626F72742EC5
|
||||
S3159FC016F00A000000426F6F74696E67206170706CDC
|
||||
S3159FC0170069636174696F6E2066726F6D20666C6166
|
||||
S3159FC017107368202800000000292E2E2E000000008E
|
||||
S3159FC01720646F6E650A0000004578656375746520B1
|
||||
S3159FC017306174200052656164696E67204845582D63
|
||||
S3159FC017405265636F72642066726F6D2055415254A5
|
||||
S3159FC017502E2E00002E000000646F6E650A0A0000E0
|
||||
S3159FC0176053697A65206F66206170706C6963617416
|
||||
S3159FC01770696F6E202020203A2000000050726F674C
|
||||
S3159FC0178072616D6D696E6720666C617368206174E6
|
||||
S3159FC017902020203A200000004E657874206672652E
|
||||
S3159FC017A06520666C617368206F6666736574203A40
|
||||
S3159FC017B020000000466C6173682065726173652E58
|
||||
S3159FC017C02E2E00006661696C6564202800000000AB
|
||||
S3159FC017D0290A0000466C6173682077726974652E0A
|
||||
S3159FC017E02E2E0000466C6173682076657269667995
|
||||
S3119FC017F02E2E2E007061737365640A0074
|
||||
S7059FC000009B
|
||||
@@ -0,0 +1,57 @@
|
||||
MEMORY
|
||||
{
|
||||
rom : ORIGIN = 0x9FC00000, LENGTH = 0x00002000 /* 8K */
|
||||
ram : ORIGIN = 0x80000000, LENGTH = 0x04000000 /* 64M */
|
||||
flash_u : ORIGIN = 0xA4000000, LENGTH = 0x00800000 /* 8M */
|
||||
flash_c : ORIGIN = 0x88000000, LENGTH = 0x00800000 /* 8M */
|
||||
io : ORIGIN = 0xAC000000, LENGTH = 0x00800000 /* 8M */
|
||||
}
|
||||
|
||||
OUTPUT_ARCH(mips)
|
||||
SEARCH_DIR(".");
|
||||
SEARCH_DIR("/usr/local/mipsel-elf/lib:/usr/local/mipsel-elf/lib/eb");
|
||||
SEARCH_DIR("/usr/local/lib/gcc/mipsel-elf/4.3.3:/usr/local/lib/gcc/mipsel-elf/4.3.3/eb");
|
||||
|
||||
stack_ptr = 0x83FFEFF0;
|
||||
baudrate = 0x0D;
|
||||
sys_led_port = 0xAC000000;
|
||||
sys_uart_data = 0xAC010000;
|
||||
sys_uart_stat = 0xAC010004;
|
||||
sys_uart_baud = 0xAC010008;
|
||||
sys_timer_usec = 0xAC00008;
|
||||
sys_timer_sec = 0xAC00000C;
|
||||
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.init ORIGIN(rom) :
|
||||
{
|
||||
start = ALIGN(4);
|
||||
entry = ALIGN(4);
|
||||
_entry = ALIGN(4);
|
||||
__entry = ALIGN(4);
|
||||
*(.stext)
|
||||
} > rom
|
||||
|
||||
.ktext ORIGIN(rom) + 0x180 :
|
||||
{
|
||||
*(.ktext)
|
||||
} > rom
|
||||
|
||||
.text . :
|
||||
{
|
||||
*(.text)
|
||||
} > rom
|
||||
|
||||
.rodata . :
|
||||
{
|
||||
*(.rodata*)
|
||||
} > rom
|
||||
|
||||
.data ORIGIN(ram) :
|
||||
{
|
||||
_ram_start = ALIGN(4);
|
||||
*(.*data) *(.*bss) *(.*common)
|
||||
} > ram
|
||||
|
||||
}
|
||||
@@ -0,0 +1,380 @@
|
||||
#include "libsys_boot.h"
|
||||
#include "cfiflash.h"
|
||||
|
||||
#define MAGIC_EB 0x4A464931 // "JFI1" in big-endian;
|
||||
#define MAGIC_EL 0x3149464A // "JFI1" in little-endian;
|
||||
|
||||
typedef struct _ssrec_t
|
||||
{
|
||||
UINT32 addr;
|
||||
UINT32 size;
|
||||
UINT32 type;
|
||||
UINT8 *data;
|
||||
|
||||
} srec_t;
|
||||
typedef struct _sflash_alloc_tbl_t
|
||||
{
|
||||
UINT32 images[16];
|
||||
|
||||
} flash_alloc_tbl_t;
|
||||
|
||||
typedef struct _sflash_img_hdr_t
|
||||
{
|
||||
UINT32 magic;
|
||||
UINT32 target_base;
|
||||
UINT32 img_base;
|
||||
UINT32 img_size;
|
||||
UINT32 hdr_next;
|
||||
UINT8 img_name[128];
|
||||
UINT8 res[108];
|
||||
|
||||
} flash_img_hdr_t;
|
||||
|
||||
enum srec_type
|
||||
{
|
||||
srec_err, srec_sob, srec_data, srec_rec, srec_eob
|
||||
};
|
||||
|
||||
UINT8 h2i(UINT8 *c)
|
||||
{
|
||||
int i;
|
||||
UINT8 t, b = 0;
|
||||
|
||||
for (i=0; i < 2; i++)
|
||||
{
|
||||
t = c[i];
|
||||
if (t >= 'A')
|
||||
t = t - 'A' + 10;
|
||||
else
|
||||
t -= '0';
|
||||
|
||||
b = (b << 4) | t;
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
|
||||
{
|
||||
UINT8 chksum, byte;
|
||||
int alen, i;
|
||||
|
||||
if (!buflen)
|
||||
return srec_err;
|
||||
|
||||
pRec->type = srec_rec;
|
||||
alen = 0;
|
||||
if ((pBuf[1] > '0') && (pBuf[1] < '4'))
|
||||
{
|
||||
alen = pBuf[1] - '0' + 1;
|
||||
pRec->type = srec_data;
|
||||
}
|
||||
else if ((pBuf[1] >= '7') && (pBuf[1] <= '9'))
|
||||
{
|
||||
alen = 11 - (pBuf[1] - '0');
|
||||
pRec->type = srec_eob;
|
||||
}
|
||||
else if (pBuf[1] == '0')
|
||||
{
|
||||
alen = 2;
|
||||
pRec->type = srec_sob;
|
||||
}
|
||||
|
||||
byte = h2i(&pBuf[2]);
|
||||
pRec->size = byte;
|
||||
chksum = byte;
|
||||
|
||||
pRec->addr = 0;
|
||||
for (i=0; i < alen; i++)
|
||||
{
|
||||
byte = h2i(&pBuf[4+2*i]);
|
||||
pRec->addr = pRec->addr << 8 | byte;
|
||||
chksum += byte;
|
||||
}
|
||||
pRec->size -= (alen+1);
|
||||
|
||||
pRec->data = (UINT8*) &pBuf[4 + 2*alen];
|
||||
for (i=0; i < (int)pRec->size; i++)
|
||||
{
|
||||
byte = h2i(&pRec->data[2*i]);
|
||||
pRec->data[i] = byte;
|
||||
chksum += byte;
|
||||
}
|
||||
chksum = ~chksum;
|
||||
byte = h2i(&pRec->data[2*i]);
|
||||
if (chksum != byte)
|
||||
return 0;
|
||||
|
||||
return pRec->type;
|
||||
}
|
||||
|
||||
int srec_getline(UINT8 *pLine)
|
||||
{
|
||||
char c;
|
||||
int i = 0;
|
||||
|
||||
do
|
||||
{
|
||||
c = readchar();
|
||||
|
||||
} while ((c != 's') && (c != 'S'));
|
||||
|
||||
while(((c != 0x0D) && (c != 0x0A)))
|
||||
{
|
||||
pLine[i++] = c;
|
||||
c = readchar();
|
||||
};
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
void Jump_to(void *pEntry)
|
||||
{
|
||||
__asm
|
||||
(
|
||||
".set noreorder\n"
|
||||
);
|
||||
__asm
|
||||
(
|
||||
"jr %[pEntry]\n" // jump entry
|
||||
:
|
||||
: [pEntry] "r" (pEntry)
|
||||
);
|
||||
__asm
|
||||
(
|
||||
"nop\n"
|
||||
);
|
||||
__asm
|
||||
(
|
||||
".set reorder\n"
|
||||
);
|
||||
}
|
||||
|
||||
void Exec_at(void *pEntry)
|
||||
{
|
||||
__asm
|
||||
(
|
||||
".set noreorder\n"
|
||||
);
|
||||
|
||||
__asm
|
||||
(
|
||||
"li $26, 0x1000000A\n"
|
||||
"mtc0 $26, $12\n"
|
||||
);
|
||||
|
||||
__asm
|
||||
(
|
||||
"jr %[pEntry]\n" // jump entry
|
||||
:
|
||||
: [pEntry] "r" (pEntry)
|
||||
);
|
||||
|
||||
__asm
|
||||
(
|
||||
"rfe\n"
|
||||
);
|
||||
|
||||
__asm
|
||||
(
|
||||
".set reorder\n"
|
||||
);
|
||||
}
|
||||
|
||||
void Exec_RE_at(void *pEntry)
|
||||
{
|
||||
__asm
|
||||
(
|
||||
".set noreorder\n"
|
||||
);
|
||||
|
||||
__asm
|
||||
(
|
||||
"mfc0 $26, $12\n" // change exception vector
|
||||
"li $27, 0xFFBFFFFF\n"
|
||||
"and $26, $27\n"
|
||||
"li $27, 0x02000000\n" // Reverse Endianess
|
||||
"or $26, $27\n"
|
||||
"mtc0 $26, $12\n"
|
||||
);
|
||||
|
||||
__asm
|
||||
(
|
||||
"jr %[pEntry]\n" // jump entry
|
||||
:
|
||||
: [pEntry] "r" (pEntry)
|
||||
);
|
||||
|
||||
__asm
|
||||
(
|
||||
"rfe\n"
|
||||
);
|
||||
|
||||
__asm
|
||||
(
|
||||
".set reorder\n"
|
||||
);
|
||||
}
|
||||
|
||||
#define MAX_IMG_SIZE (1024*1024) // bytes
|
||||
#define FLASH_USE_BLOCK 1
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
UINT8 buf[256];
|
||||
srec_t srec;
|
||||
int srec_state, i;
|
||||
UINT32 haddr, result;
|
||||
flash_t flash;
|
||||
flash_img_hdr_t img_hdr = {0};
|
||||
flash_img_hdr_t *pImg_hdr;
|
||||
UINT32 img_size, block_sel;
|
||||
|
||||
volatile UINT32 *pGPIO_DATA = (UINT32*)SYS_GPIO_0_DATA;
|
||||
volatile UINT32 *pGPIO_DIR = (UINT32*)SYS_GPIO_0_DIR;
|
||||
volatile UINT8 *pMem;
|
||||
volatile UINT32 *pFlashIO = (UINT32*)FLASH_BASE_IO; // Flash in uncached area
|
||||
volatile UINT32 *pFlashMem = (UINT32*)FLASH_BASE_MEM; // Flash in cached area
|
||||
volatile UINT32 *ram32 = (UINT32*)SDRAM_BASE;
|
||||
UINT32 flash_offset;
|
||||
|
||||
*pGPIO_DIR = GPIO_0_DFLT_DIR;
|
||||
*pGPIO_DATA = GPIO_0_DFLT_DATA;
|
||||
haddr = 0;
|
||||
block_sel = 0x7F & (UINT32)((*pGPIO_DATA & GPIO_0_DIP) >> GPIO_0_ALIGN_DIP);
|
||||
|
||||
// ----------------------------------------------------------
|
||||
if (IS_ERROR(flash_find(&flash, SYS_FLASH_IO)))
|
||||
{
|
||||
sputs("Cannot find flash device. Exit now!\n\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Get flash offset by value of DIP-switch
|
||||
flash_offset = flash_get_offset_by_blocknum(&flash, block_sel);
|
||||
|
||||
ram32 = (UINT32*)(SDRAM_BASE);
|
||||
pFlashIO = (UINT32*)(SYS_FLASH_IO + flash_offset);
|
||||
|
||||
if (!(((*pGPIO_DATA & GPIO_0_BTN) >> GPIO_0_ALIGN_BTN) & 8))
|
||||
{
|
||||
sputs("\n\n");
|
||||
pImg_hdr = (flash_img_hdr_t*)pFlashIO;
|
||||
if ((pImg_hdr->magic != MAGIC_EL) && (pImg_hdr->magic != MAGIC_EB))
|
||||
{
|
||||
sputs("\n\n");
|
||||
sputs("Invalid image found at ");print_word(flash_offset); sputs(". Abort.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
sputs("Booting application from flash (");print_word(flash_offset);sputs(")...");
|
||||
|
||||
ram32 = (UINT32*)pImg_hdr->target_base;
|
||||
img_size = pImg_hdr->img_size;
|
||||
|
||||
// It's safe to use cached Flash,
|
||||
// because D-Cache was invalidated during execution of start code
|
||||
pFlashMem = (UINT32*)pImg_hdr->img_base;
|
||||
|
||||
for (i=0; i < img_size/4; i++)
|
||||
ram32[i] = pFlashMem[i];
|
||||
|
||||
sputs("done\n");
|
||||
|
||||
sputs("Execute at ");print_word(pImg_hdr->target_base); sputs("\n\n");
|
||||
Exec_at((void*)ram32);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
sputs("\n\n");
|
||||
|
||||
sputs("Reading HEX-Record from UART..");
|
||||
|
||||
// Erase SDRAM
|
||||
for (i=0; i < MAX_IMG_SIZE/4; i++)
|
||||
ram32[i] = 0;
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
sputs(".");
|
||||
while(1)
|
||||
{
|
||||
result = srec_getline(buf);
|
||||
srec_state = decode_srec(&srec, buf, result);
|
||||
switch (srec_state)
|
||||
{
|
||||
case srec_data:
|
||||
if ((srec.addr + srec.size) > haddr)
|
||||
haddr = srec.addr + srec.size;
|
||||
|
||||
pMem = (UINT8*)srec.addr;
|
||||
for (i=0; i < srec.size; i++)
|
||||
*pMem++ = srec.data[i];
|
||||
|
||||
break;
|
||||
|
||||
case srec_eob:
|
||||
sputs("done\n\n");
|
||||
img_hdr.magic = MAGIC_EB;
|
||||
img_hdr.target_base = srec.addr;
|
||||
img_hdr.img_size = haddr - srec.addr;
|
||||
img_hdr.img_base = flash_offset + sizeof(flash_img_hdr_t);
|
||||
img_hdr.hdr_next = flash_get_offset_blockaligned(&flash, img_hdr.img_base + img_hdr.img_size);
|
||||
sputs("Size of application : ");print_word(img_hdr.img_size); sputs("\n");
|
||||
sputs("Programming flash at : ");print_word(flash_offset); sputs("\n");
|
||||
sputs("Next free flash offset : ");print_word(img_hdr.hdr_next); sputs("\n");
|
||||
|
||||
sputs("Flash erase...");
|
||||
result = flash_erase(&flash, flash_offset, img_hdr.img_size + sizeof(flash_img_hdr_t));
|
||||
if (IS_ERROR(result))
|
||||
{
|
||||
sputs("failed (");print_word(result);sputs(")\n");
|
||||
break;
|
||||
}
|
||||
sputs("done\n");
|
||||
|
||||
sputs("Flash write...");
|
||||
result = flash_program(&flash, flash_offset, (UINT8*)&img_hdr, sizeof(flash_img_hdr_t));
|
||||
if (IS_ERROR(result))
|
||||
{
|
||||
sputs("failed (");print_word(result);sputs(")\n");
|
||||
break;
|
||||
}
|
||||
result = flash_program(&flash, img_hdr.img_base, (UINT8*)img_hdr.target_base, img_hdr.img_size);
|
||||
if (IS_ERROR(result))
|
||||
{
|
||||
sputs("failed (");print_word(result);sputs(")\n");
|
||||
break;
|
||||
}
|
||||
sputs("done\n");
|
||||
|
||||
sputs("Flash verify...");
|
||||
result = flash_verify(&flash, img_hdr.img_base, (UINT8*)img_hdr.target_base, img_hdr.img_size);
|
||||
if (IS_ERROR(result))
|
||||
{
|
||||
sputs("failed (");print_word(result);sputs(")\n");
|
||||
break;
|
||||
}
|
||||
sputs("passed\n");
|
||||
|
||||
// Jump to reset vector
|
||||
Jump_to((void*)0xBFC00000);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
result = -1;
|
||||
break;
|
||||
}
|
||||
if (IS_ERROR(result))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
.file "init.S"
|
||||
|
||||
.text
|
||||
.section .init,"ax"
|
||||
.align 2
|
||||
.globl _init
|
||||
.extern end
|
||||
|
||||
_init:
|
||||
.set noreorder
|
||||
|
||||
# set uart
|
||||
la $26, sys_uart_baud
|
||||
addiu $27, $0, baudrate
|
||||
sw $27, 0($26)
|
||||
|
||||
jr $ra
|
||||
|
||||
.set reorder
|
||||
@@ -0,0 +1,16 @@
|
||||
@rem
|
||||
@rem Setup Chipscope's TCL JTAG path
|
||||
@rem
|
||||
@rem Usage: cs_xtclsh.bat args...
|
||||
@rem
|
||||
@date /T > c:\date.tmp
|
||||
@date 15.03.2009
|
||||
rem @set CS_PATH=%CS_HOME%\bin\nt
|
||||
@echo %CS_PATH%
|
||||
|
||||
cd %CS_PATH%
|
||||
|
||||
@call cs_xtclsh %1
|
||||
@type c:\date.tmp | date >nul
|
||||
@del c:\date.tmp
|
||||
pause
|
||||
@@ -0,0 +1,46 @@
|
||||
.file "kernel.S"
|
||||
|
||||
.section .ktext,"ax"
|
||||
.align 2
|
||||
|
||||
.macro kpush reg
|
||||
addiu $sp, 4
|
||||
sw \reg, 0($sp)
|
||||
.endm
|
||||
|
||||
.macro kpop reg
|
||||
lw \reg, 0($sp)
|
||||
addiu $sp, -4
|
||||
.endm
|
||||
|
||||
_exc_handler:
|
||||
|
||||
.set noreorder
|
||||
|
||||
# Set Error LED and ExcCode LEDs
|
||||
# Get Cause
|
||||
mfc0 $26, $13
|
||||
li $27, 0xC0000000
|
||||
srl $26, 2
|
||||
andi $26, 0x000F
|
||||
or $26, $27
|
||||
la $27, sys_led_port
|
||||
sw $26, 0($27)
|
||||
|
||||
# wait for all interrupts = 0
|
||||
$w4x: mfc0 $26, $13
|
||||
nop
|
||||
srl $26, 8
|
||||
andi $26, 0xFF
|
||||
bnez $26, $w4x
|
||||
nop
|
||||
|
||||
# Get return address
|
||||
mfc0 $26, $14
|
||||
|
||||
# Return
|
||||
nop
|
||||
jr $26
|
||||
rfe
|
||||
.set reorder
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
#include <sys/times.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include "libsys_boot.h"
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
// MIPS specific
|
||||
UINT32 CP0_SR_read(void)
|
||||
{
|
||||
UINT32 result;
|
||||
|
||||
__asm
|
||||
(
|
||||
"mfc0 %[val], $12\n"
|
||||
: [val] "=r" (result)
|
||||
);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void CP0_SR_write(UINT32 val)
|
||||
{
|
||||
__asm
|
||||
(
|
||||
"mtc0 %[val], $12\n"
|
||||
: /* no output */
|
||||
: [val] "r" (val)
|
||||
);
|
||||
}
|
||||
|
||||
UINT32 CP0_CR_read(void)
|
||||
{
|
||||
UINT32 result;
|
||||
|
||||
__asm
|
||||
(
|
||||
"mfc0 %[val], $13\n"
|
||||
: [val] "=r" (result)
|
||||
);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void CP0_CR_write(UINT32 val)
|
||||
{
|
||||
__asm
|
||||
(
|
||||
"mtc0 %[val], $13\n"
|
||||
:
|
||||
: [val] "r" (val)
|
||||
);
|
||||
}
|
||||
|
||||
UINT32 CP0_PRID_read(void)
|
||||
{
|
||||
UINT32 result;
|
||||
|
||||
__asm
|
||||
(
|
||||
"mfc0 %[val], $15\n"
|
||||
: [val] "=r" (result)
|
||||
);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
char readchar(void)
|
||||
{
|
||||
volatile UINT32 *pUART_stat = (UINT32*)SYS_UART_STAT;
|
||||
volatile UINT32 *pUART_data = (UINT32*)SYS_UART_DATA;
|
||||
|
||||
while(!(0x10 & *pUART_stat));
|
||||
|
||||
return (char)*pUART_data;
|
||||
}
|
||||
|
||||
void writechar(char c)
|
||||
{
|
||||
volatile UINT32 *pUART_stat = (UINT32*)SYS_UART_STAT;
|
||||
volatile UINT32 *pUART_data = (UINT32*)SYS_UART_DATA;
|
||||
|
||||
while((0x02 & *pUART_stat) != 0);
|
||||
|
||||
*pUART_data = (UINT32)c;
|
||||
}
|
||||
|
||||
void _putchar(char c)
|
||||
{
|
||||
if (c == 0x0A)
|
||||
{
|
||||
writechar(0x0D);
|
||||
}
|
||||
writechar(c);
|
||||
}
|
||||
|
||||
int sputs(char *pStr)
|
||||
{
|
||||
char *start;
|
||||
start = pStr;
|
||||
|
||||
while(*pStr)
|
||||
_putchar(*(pStr++));
|
||||
|
||||
return pStr - start;
|
||||
}
|
||||
|
||||
void print_byte(char byte)
|
||||
{
|
||||
int i;
|
||||
unsigned char c, nibble;
|
||||
|
||||
for (i=0; i < 2; i++)
|
||||
{
|
||||
nibble = (char)((byte >> 4) & 0xF);
|
||||
byte <<= 4;
|
||||
|
||||
if (nibble < 10)
|
||||
c = nibble + '0';
|
||||
else
|
||||
c = nibble + 'A' - 10;
|
||||
|
||||
_putchar(c);
|
||||
}
|
||||
}
|
||||
|
||||
void print_word(int word)
|
||||
{
|
||||
int i;
|
||||
unsigned char c, nibble;
|
||||
|
||||
for (i=0; i < 4; i++)
|
||||
{
|
||||
c = (char) (word >> 24);
|
||||
print_byte(c);
|
||||
word <<= 8;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
// PrintBuffer8()
|
||||
// Prints byte buffer as hex and ascii interpretation
|
||||
// ---------------------------------------------------------------------------------
|
||||
// _Parameters :
|
||||
// pBuf: : IN: Buffer to display
|
||||
// nbpr : Number of bytes per row to display
|
||||
// len : Length of input buffer
|
||||
// _Return: none
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
void PrintBuffer8(UINT8 *pBuf, int nbpr, int len)
|
||||
{
|
||||
memdump(pBuf, 1, nbpr, len);
|
||||
}
|
||||
|
||||
void memdump(UINT8 *pBuf, int print_offset_only, int num_bytes_per_row, int len)
|
||||
{
|
||||
int i, j, cnt_hex, cnt_asc, base;
|
||||
unsigned char c;
|
||||
|
||||
i = j = 0;
|
||||
cnt_hex = len;
|
||||
cnt_asc = len;
|
||||
base = 0;
|
||||
if (!print_offset_only)
|
||||
base = (int)pBuf;
|
||||
|
||||
do
|
||||
{
|
||||
print_word(base + i);
|
||||
sputs(": ");
|
||||
for (j=0; j < num_bytes_per_row; j++)
|
||||
{
|
||||
if (cnt_hex)
|
||||
{
|
||||
print_byte(pBuf[i+j]);
|
||||
sputs(" ");
|
||||
cnt_hex--;
|
||||
}
|
||||
else
|
||||
{
|
||||
sputs(" ");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sputs(" ");
|
||||
for (j=0; j < num_bytes_per_row; j++)
|
||||
{
|
||||
if (cnt_asc)
|
||||
{
|
||||
c = pBuf[i+j];
|
||||
if((c < 0x20) || (c > 0x7F))
|
||||
c = '.';
|
||||
|
||||
_putchar(c);
|
||||
cnt_asc--;
|
||||
}
|
||||
else
|
||||
{
|
||||
sputs(" ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
sputs("\n");
|
||||
i += num_bytes_per_row;
|
||||
|
||||
} while (cnt_hex);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
#ifndef LIBSYS_H
|
||||
#define LIBSYS_H
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// Types
|
||||
// ---------------------------------------------------------
|
||||
#define INT8 char
|
||||
#define INT16 short
|
||||
#define INT32 long
|
||||
#define UINT8 unsigned char
|
||||
#define UINT16 unsigned short
|
||||
#define UINT32 unsigned long
|
||||
#define INT int
|
||||
#define UINT unsigned int
|
||||
#define FLOAT32 float
|
||||
#define FLOAT64 double
|
||||
|
||||
#define IS_ERROR(e) ((e & 0x80000000) == 0x80000000)
|
||||
|
||||
#ifndef SYS_IO_BASE
|
||||
#define SYS_IO_BASE 0xA0000000
|
||||
#endif
|
||||
#ifndef SDRAM_BASE
|
||||
#define SDRAM_BASE 0x40000000
|
||||
#endif
|
||||
#ifndef FLASH_BASE_IO
|
||||
#define FLASH_BASE_IO 0xA4000000
|
||||
#endif
|
||||
#ifndef FLASH_BASE_MEM
|
||||
#define FLASH_BASE_MEM 0x00000000
|
||||
#endif
|
||||
|
||||
|
||||
#define SYS_GPIO_0_DATA (SYS_IO_BASE + 0x0)
|
||||
#define SYS_GPIO_0_DIR (SYS_IO_BASE + 0x4)
|
||||
#define GPIO_0_DFLT_DIR (GPIO_0_LED | GPIO_0_USB_RST | GPIO_0_USB_INTEN | GPIO_0_AC97_INTEN | GPIO_0_PHY_RST | GPIO_0_PHY_MDC)
|
||||
#define GPIO_0_DFLT_DATA ((~GPIO_0_LED & GPIO_0_LED) | GPIO_0_USB_RST | (~GPIO_0_USB_INTEN & GPIO_0_USB_INTEN) | (~GPIO_0_AC97_INTEN & GPIO_0_AC97_INTEN) | GPIO_0_PHY_RST | (~GPIO_0_PHY_MDC & GPIO_0_PHY_MDC))
|
||||
#define GPIO_0_LED 0x000001FF
|
||||
#define GPIO_0_BTN 0x1F000000
|
||||
#define GPIO_0_DIP 0x00FF0000
|
||||
#define GPIO_0_USB_RST 0x00001000
|
||||
#define GPIO_0_USB_INTEN 0x00002000
|
||||
#define GPIO_0_AC97_INTEN 0x00008000
|
||||
#define GPIO_0_PHY_RST 0x20000000
|
||||
#define GPIO_0_PHY_MDC 0x40000000
|
||||
#define GPIO_0_PHY_MDIO 0x80000000
|
||||
#define GPIO_0_ALIGN_LED 0
|
||||
#define GPIO_0_ALIGN_DIP 16
|
||||
#define GPIO_0_ALIGN_BTN 24
|
||||
#define GPIO_0_ALIGN_MDIO 31
|
||||
|
||||
#define SYS_TIMER_USEC (SYS_IO_BASE + 0x8)
|
||||
#define SYS_TIMER_SEC (SYS_IO_BASE + 0xC)
|
||||
#define SYS_UART_DATA (SYS_IO_BASE + 0x10000)
|
||||
#define SYS_UART_STAT (SYS_IO_BASE + 0x10004)
|
||||
#define SYS_UART_BAUD (SYS_IO_BASE + 0x10008)
|
||||
#define SYS_USB_DATA (SYS_IO_BASE + 0x20000)
|
||||
#define SYS_USB_MBX (SYS_IO_BASE + 0x20004)
|
||||
#define SYS_USB_ADDR (SYS_IO_BASE + 0x20008)
|
||||
#define SYS_USB_STATUS (SYS_IO_BASE + 0x2000C)
|
||||
#define SYS_FLASH_IO 0xA4000000
|
||||
#define SYS_FLASH_MEM 0x00000000
|
||||
|
||||
// MIPS specific
|
||||
UINT32 CP0_SR_read(void);
|
||||
void CP0_SR_write(UINT32 val);
|
||||
UINT32 CP0_CR_read(void);
|
||||
void CP0_CR_write(UINT32 val);
|
||||
UINT32 CP0_PRID_read(void);
|
||||
|
||||
// General
|
||||
char readchar(void);
|
||||
void writechar(char c);
|
||||
int write(int file, char *ptr, int len);
|
||||
int sputs(char *pStr);
|
||||
void print_byte(char byte);
|
||||
void print_word(int word);
|
||||
void PrintBuffer8(UINT8 *pBuf, int nbpr, int len);
|
||||
void memdump(UINT8 *pBuf, int print_offset_only, int num_bytes_per_row, int len);
|
||||
|
||||
#endif // LIBSYS_H
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
.file "startup.S"
|
||||
|
||||
.text
|
||||
.section .init,"ax"
|
||||
.extern _init
|
||||
.align 2
|
||||
|
||||
_start:
|
||||
.set noreorder
|
||||
|
||||
# set stack pointer
|
||||
la $sp, stack_ptr
|
||||
|
||||
# Set status register
|
||||
# Kernel mode (SR1=1), Int disabled(SR0=0), after RFE into main
|
||||
li $26, 0x1040000A
|
||||
mtc0 $26, $12
|
||||
li $26, 0x00000000
|
||||
mtc0 $26, $13
|
||||
|
||||
mfc0 $26, $15
|
||||
nop
|
||||
mtc0 $26, $31
|
||||
|
||||
# Invalidate I-Cache
|
||||
cop0 32
|
||||
|
||||
# Invalidate D-Cache
|
||||
cop0 34
|
||||
|
||||
# jump init
|
||||
la $26, _init
|
||||
jalr $26
|
||||
nop
|
||||
|
||||
la $26, main
|
||||
|
||||
jalr $26
|
||||
nop
|
||||
_terminate:
|
||||
nop
|
||||
j _terminate
|
||||
nop
|
||||
|
||||
.set reorder
|
||||
Reference in New Issue
Block a user