- fixed data types

git-svn-id: http://moon:8086/svn/mips@12 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
2015-05-15 14:08:12 +00:00
parent 520e122253
commit 784dd70472
13 changed files with 6651 additions and 6512 deletions
+14 -14
View File
@@ -2,10 +2,10 @@
typedef struct _ssrec_t
{
UINT32 addr;
UINT32 size;
UINT32 type;
UINT8 *data;
uint32_t addr;
uint32_t size;
uint32_t type;
uint8_t *data;
} srec_t;
@@ -14,10 +14,10 @@ enum srec_type
srec_err, srec_sob, srec_data, srec_rec, srec_eob
};
UINT8 h2i(UINT8 *c)
uint8_t h2i(uint8_t *c)
{
int i;
UINT8 t, b = 0;
uint8_t t, b = 0;
for (i=0; i < 2; i++)
{
@@ -32,9 +32,9 @@ UINT8 h2i(UINT8 *c)
return b;
}
int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
int decode_srec(srec_t *pRec, uint8_t *pBuf, int buflen)
{
UINT8 chksum, byte;
uint8_t chksum, byte;
int alen, i;
if (!buflen)
@@ -71,7 +71,7 @@ int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
}
pRec->size -= (alen+1);
pRec->data = (UINT8*) &pBuf[4 + 2*alen];
pRec->data = (uint8_t*) &pBuf[4 + 2*alen];
for (i=0; i < (int)pRec->size; i++)
{
byte = h2i(&pRec->data[2*i]);
@@ -86,7 +86,7 @@ int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
return pRec->type;
}
int srec_getline(UINT8 *pLine)
int srec_getline(uint8_t *pLine)
{
char c;
int i = 0;
@@ -191,11 +191,11 @@ void PrintCPUinfo(void)
int main(int argc, char *argv[])
{
UINT8 buf[256];
uint8_t buf[256];
srec_t srec;
int result, srec_state, i;
UINT32 haddr;
volatile UINT8 *pMem;
uint32_t haddr;
volatile uint8_t *pMem;
haddr = 0;
// ----------------------------------------------------------
@@ -216,7 +216,7 @@ int main(int argc, char *argv[])
if ((srec.addr + srec.size) > haddr)
haddr = srec.addr + srec.size;
pMem = (UINT8*)srec.addr;
pMem = (uint8_t*)srec.addr;
for (i=0; i < srec.size; i++)
*pMem++ = srec.data[i];
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.
+56 -56
View File
@@ -49,7 +49,7 @@ Linker script and memory map
*(.ktext)
.ktext 0x00000000bfc00180 0x48 kernel.o
.text 0x00000000bfc001c8 0xea8
.text 0x00000000bfc001c8 0xecc
*(.text)
.text 0x00000000bfc001c8 0x0 startup.o
.text 0x00000000bfc001c8 0x0 init.o
@@ -68,7 +68,7 @@ Linker script and memory map
0x00000000bfc00340 print_word
0x00000000bfc00380 memdump
0x00000000bfc004f8 PrintBuffer8
.text 0x00000000bfc0050c 0x7ac cfiflash.o
.text 0x00000000bfc0050c 0x7d0 cfiflash.o
0x00000000bfc0050c cfi_get_status
0x00000000bfc00534 cfi_init
0x00000000bfc00560 cfi_find
@@ -78,36 +78,36 @@ Linker script and memory map
0x00000000bfc00810 cfi_block_unlock
0x00000000bfc008b0 cfi_program_single
0x00000000bfc00930 cfi_program_multi
0x00000000bfc00aec flash_find
0x00000000bfc00b14 flash_erase
0x00000000bfc00bc0 flash_program
0x00000000bfc00be4 flash_verify
0x00000000bfc00c30 flash_get_blocknum_by_offset
0x00000000bfc00c58 flash_get_offset_by_blocknum
0x00000000bfc00c88 flash_get_offset_blockaligned
.text 0x00000000bfc00cb8 0x2c8 bootloader_with_flash.o
0x00000000bfc00cb8 h2i
0x00000000bfc00d10 decode_srec
0x00000000bfc00e94 srec_getline
0x00000000bfc00f28 Jump_to
0x00000000bfc00f38 Exec_at
0x00000000bfc00f54 Exec_RE_at
.text 0x00000000bfc00f80 0x20 test.o
0x00000000bfc00f80 test
.text 0x00000000bfc00fa0 0xd0 /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
0x00000000bfc00fa0 memset
0x00000000bfc00afc flash_find
0x00000000bfc00b24 flash_erase
0x00000000bfc00be4 flash_program
0x00000000bfc00c08 flash_verify
0x00000000bfc00c54 flash_get_blocknum_by_offset
0x00000000bfc00c7c flash_get_offset_by_blocknum
0x00000000bfc00cac flash_get_offset_blockaligned
.text 0x00000000bfc00cdc 0x2c8 bootloader_with_flash.o
0x00000000bfc00cdc h2i
0x00000000bfc00d34 decode_srec
0x00000000bfc00eb8 srec_getline
0x00000000bfc00f4c Jump_to
0x00000000bfc00f5c Exec_at
0x00000000bfc00f78 Exec_RE_at
.text 0x00000000bfc00fa4 0x20 test.o
0x00000000bfc00fa4 test
.text 0x00000000bfc00fc4 0xd0 /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
0x00000000bfc00fc4 memset
.text.startup 0x00000000bfc01070 0x42c
.text.startup 0x00000000bfc01070 0x42c bootloader_with_flash.o
0x00000000bfc01070 main
.text.startup 0x00000000bfc01094 0x42c
.text.startup 0x00000000bfc01094 0x42c bootloader_with_flash.o
0x00000000bfc01094 main
.rodata 0x00000000bfc0149c 0x15c
.rodata 0x00000000bfc014c0 0x15c
*(.rodata*)
.rodata.str1.4
0x00000000bfc0149c 0x8 libsys.o
0x00000000bfc014c0 0x8 libsys.o
0x10 (size before relaxing)
.rodata.str1.4
0x00000000bfc014a4 0x154 bootloader_with_flash.o
0x00000000bfc014c8 0x154 bootloader_with_flash.o
0x15c (size before relaxing)
.data 0x0000000040000000 0x0
@@ -186,22 +186,22 @@ OUTPUT(bootloader_flash.elf elf32-bigmips)
.gnu.attributes
0x0000000000000040 0x10 /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
.debug_info 0x0000000000000000 0x1484
.debug_info 0x0000000000000000 0x895 cfiflash.o
.debug_info 0x0000000000000895 0xa44 bootloader_with_flash.o
.debug_info 0x00000000000012d9 0x6e test.o
.debug_info 0x0000000000001347 0x13d /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
.debug_info 0x0000000000000000 0x1536
.debug_info 0x0000000000000000 0x8b6 cfiflash.o
.debug_info 0x00000000000008b6 0xa8b bootloader_with_flash.o
.debug_info 0x0000000000001341 0xb8 test.o
.debug_info 0x00000000000013f9 0x13d /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
.debug_abbrev 0x0000000000000000 0x512
.debug_abbrev 0x0000000000000000 0x52a
.debug_abbrev 0x0000000000000000 0x1f6 cfiflash.o
.debug_abbrev 0x00000000000001f6 0x215 bootloader_with_flash.o
.debug_abbrev 0x000000000000040b 0x56 test.o
.debug_abbrev 0x0000000000000461 0xb1 /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
.debug_abbrev 0x000000000000040b 0x6e test.o
.debug_abbrev 0x0000000000000479 0xb1 /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
.debug_loc 0x0000000000000000 0x122d
.debug_loc 0x0000000000000000 0xa81 cfiflash.o
.debug_loc 0x0000000000000a81 0x5a8 bootloader_with_flash.o
.debug_loc 0x0000000000001029 0x204 /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
.debug_loc 0x0000000000000000 0x1238
.debug_loc 0x0000000000000000 0xa8c cfiflash.o
.debug_loc 0x0000000000000a8c 0x5a8 bootloader_with_flash.o
.debug_loc 0x0000000000001034 0x204 /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
.debug_aranges 0x0000000000000000 0x88
.debug_aranges
@@ -213,27 +213,27 @@ OUTPUT(bootloader_flash.elf elf32-bigmips)
.debug_aranges
0x0000000000000068 0x20 /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
.debug_line 0x0000000000000000 0x531
.debug_line 0x0000000000000000 0x1e0 cfiflash.o
.debug_line 0x00000000000001e0 0x1db bootloader_with_flash.o
.debug_line 0x00000000000003bb 0x36 test.o
.debug_line 0x00000000000003f1 0x140 /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
.debug_line 0x0000000000000000 0x615
.debug_line 0x0000000000000000 0x22c cfiflash.o
.debug_line 0x000000000000022c 0x227 bootloader_with_flash.o
.debug_line 0x0000000000000453 0x82 test.o
.debug_line 0x00000000000004d5 0x140 /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
.debug_str 0x0000000000000000 0x591
.debug_str 0x0000000000000000 0x2cb cfiflash.o
0x33a (size before relaxing)
.debug_str 0x00000000000002cb 0x1a7 bootloader_with_flash.o
0x346 (size before relaxing)
.debug_str 0x0000000000000472 0x1b test.o
0x89 (size before relaxing)
.debug_str 0x000000000000048d 0x104 /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
.debug_str 0x0000000000000000 0x5ab
.debug_str 0x0000000000000000 0x2e5 cfiflash.o
0x354 (size before relaxing)
.debug_str 0x00000000000002e5 0x1a7 bootloader_with_flash.o
0x3bb (size before relaxing)
.debug_str 0x000000000000048c 0x1b test.o
0x104 (size before relaxing)
.debug_str 0x00000000000004a7 0x104 /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
0x19d (size before relaxing)
.debug_frame 0x0000000000000000 0x2ac
.debug_frame 0x0000000000000000 0x188 cfiflash.o
.debug_frame 0x0000000000000188 0xe4 bootloader_with_flash.o
.debug_frame 0x000000000000026c 0x20 test.o
.debug_frame 0x000000000000028c 0x20 /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
.debug_frame 0x0000000000000000 0x2b8
.debug_frame 0x0000000000000000 0x194 cfiflash.o
.debug_frame 0x0000000000000194 0xe4 bootloader_with_flash.o
.debug_frame 0x0000000000000278 0x20 test.o
.debug_frame 0x0000000000000298 0x20 /home/jens/work/repos/mips/toolchain/install/mipsel-elf/lib/eb/libc.a(lib_a-memset.o)
.debug_ranges 0x0000000000000000 0x30
.debug_ranges 0x0000000000000000 0x18 bootloader_with_flash.o
+212 -210
View File
@@ -3,9 +3,9 @@ S315BFC000003C1D800027BDEFF03C1A1040375A000C8C
S315BFC00010409A6000241A0000409A6800401A7800CF
S315BFC0002000000000409AF8004200002042000022B3
S315BFC000303C1ABFC0275A005C0340F8090000000045
S315BFC000403C1ABFC0275A10700340F8090000000011
S315BFC000403C1ABFC0275A10940340F80900000000ED
S315BFC00050000000000BF00014000000003C1ABFC037
S315BFC00060275A0F8003400008000000003C1AA001B9
S315BFC00060275A0FA403400008000000003C1AA00195
S315BFC00070275A0008241B000DAF5B000003E0000831
S315BFC00180401A68003C1BC000001AD082335A000F09
S315BFC00190035BD0253C1BA000277B0000AF7A0000C5
@@ -44,8 +44,8 @@ S315BFC00388AFB40028AFB30024AFBF003CAFBE003880
S315BFC00398AFB70034AFB60030AFB20020AFB1001CA4
S315BFC003A8AFB000180080982100C0A02114A00002D9
S315BFC003B80000A8210080A8213C1EBFC03C16BFC0F4
S315BFC003C83C17BFC00260802100E0902127DE149C85
S315BFC003D826D6157426F714A002B320230090202171
S315BFC003C83C17BFC00260802100E0902127DE14C061
S315BFC003D826D6159826F714C402B320230090202129
S315BFC003E80FF000D0AFA700140FF000A503C020219F
S315BFC003F8000018218FA700140074102A1040000FE0
S315BFC0040800E388231067000A020310218044000056
@@ -57,7 +57,7 @@ S315BFC00458024218231052000D0202182190640000F0
S315BFC00468000000002483FFE02C6300601460000214
S315BFC00478000000002404002E0FF00097AFA20010A2
S315BFC004888FA200100BF00114244200010FF000A583
S315BFC0049802C02021000018213C04BFC0248414C850
S315BFC0049802C02021000018213C04BFC0248414EC2C
S315BFC004A8AFA300100FF000A5021480218FA30010C0
S315BFC004B812200003006090210BF000F802203821FB
S315BFC004C88FBF003C8FBE00388FB700348FB60030A1
@@ -131,209 +131,211 @@ S315BFC008F82484001A0064202410800003000010213D
S315BFC009083C029010006210253C0300FF246300FF21
S315BFC00918ACA3000003E00008000000003C02801042
S315BFC0092803E00008244200028C8300088C8C0000B8
S315BFC009380003188200A3182B1060005D3C0A008014
S315BFC009488C98001027BDFFE02718FFFFAFB200087D
S315BFC00958AFB10004AFB000003C0D001A3C1000E8B0
S315BFC009683C1100D03C1200FFAFB7001CAFB6001891
S315BFC00978AFB50014AFB40010AFB3000C0018C400B5
S315BFC00988000058213C190001261000E8254A0080FE
S315BFC0099825AD001A263100D0265200FF3C0E901056
S315BFC009A810E0004600B8782401E51823007918215D
S315BFC009B800E3402B110000020000000000E0182130
S315BFC009C8000F7880018F4021106000320000000000
S315BFC009D8AD1000008D02000000000000004A482488
S315BFC009E8152AFFFC004D482415200025000000002D
S315BFC009F88C89001400000000000948820123982B87
S315BFC00A081260000200601021012010212449FFFF97
S315BFC00A1800099C00026948250005A880000BA08074
S315BFC00A28AD090000000298800195A82100D4A02175
S315BFC00A3800004821113300060289B8218EF700008D
S315BFC00A480135B021AED700000BF0028F25290004AF
S315BFC00A580162582100A228210062182300E2382368
S315BFC00A68AD1100008D02000000000000004A4824F6
S315BFC00A78152AFFFC004D48241120000300000000C2
S315BFC00A880BF002A7004E1025AD1200000BF0027482
S315BFC00A98000010210441FFC23C0300FF018F602143
S315BFC00AA8246300FFAD8300000BF002B10000000055
S315BFC00AB83C02801003E00008244200028FB7001C26
S315BFC00AC88FB600188FB500148FB400108FB3000C43
S315BFC00AD88FB200088FB100048FB0000003E00008D2
S315BFC00AE827BD002027BDFFE8AFB00010AFBF0014B9
S315BFC00AF80FF0014D008080218FBF00140200202156
S315BFC00B088FB000100BF0015827BD001827BDFFD8FE
S315BFC00B1830C30003AFB10018AFBF0024AFB30020C6
S315BFC00B28AFB2001CAFB000141060000400808821AB
S315BFC00B380006308224C600010006308000C5982151
S315BFC00B4800A080210213182B10600014001097C391
S315BFC00B580012978202509021001290830220202152
S315BFC00B680FF0019702402821144000080220202117
S315BFC00B780FF001B40240282104400008000000005D
S315BFC00B888E23000C0BF002D3020380210FF00204A0
S315BFC00B98024028210441FFF6022020218FBF00242E
S315BFC00BA88FB300208FB2001C8FB100188FB000144E
S315BFC00BB803E0000827BD002830E200031040000448
S315BFC00BC8000000000007388224E70001000738800C
S315BFC00BD8000528820BF0024C000738828C820000C1
S315BFC00BE80000000000452821000010211047000959
S315BFC00BF800A2202100C21821908400009063000083
S315BFC00C080000000014830005000000000BF002FDC1
S315BFC00C182442000103E00008000010213C028010F6
S315BFC00C2803E00008244200038C82000C00000000C9
S315BFC00C381440000200A2001B0007000D00002810C8
S315BFC00C480005182B0000101203E00008004310214E
S315BFC00C588C8200100000000000A2182B146000028E
S315BFC00C68000000002445FFFF8C82000C0000000076
S315BFC00C7800A200180000101203E000080000000020
S315BFC00C8827BDFFE8AFB00010AFBF00140FF0030C0D
S315BFC00C98008080218E03000C8FBF0014004300184C
S315BFC00CA88FB000100000101203E0000827BD00185F
S315BFC00CB890820000000000002C4300411060000372
S315BFC00CC8000000000BF003362442FFD02442FFC900
S315BFC00CD8304500FF90820001000000002C43004150
S315BFC00CE814600003000000000BF0033F2442FFC995
S315BFC00CF82442FFD0304300FF000511000062102513
S315BFC00D0803E00008304200FF10C0005E00000000CC
S315BFC00D1827BDFFD024020003AFB3001CAFB000107D
S315BFC00D28AFBF002CAFB60028AFB50024AFB4002004
S315BFC00D38AFB20018AFB10014AC82000890A20001D0
S315BFC00D48008080212443FFCF2C63000310600004BA
S315BFC00D5800A098212452FFD10BF0036124020002E0
S315BFC00D682443FFC92C630003106000062403003068
S315BFC00D782412003B02429023240200040BF00368EE
S315BFC00D88AE020008144300040000902124020001EB
S315BFC00D98AC820008241200020FF0032E266400029C
S315BFC00DA8004088210040B021AE020004AE0000005A
S315BFC00DB8267500040000A0210292102A1040000C1C
S315BFC00DC8000000000FF0032E02A020218E030000F2
S315BFC00DD80051882100031A0000431825AE0300003E
S315BFC00DE8323100FF269400010BF0037026B500020E
S315BFC00DF826D6FFFF02D2B023265200020012904069
S315BFC00E0802729821AE160004AE13000C00009021E2
S315BFC00E188E0200048E13000C001220400242102A14
S315BFC00E2810400008026420210FF0032E02729821D9
S315BFC00E3800518821A2620000323100FF0BF0038641
S315BFC00E48265200010FF0032E00118827323100FF4A
S315BFC00E5816220002000010218E0200088FBF002C88
S315BFC00E688FB600288FB500248FB400208FB3001C5F
S315BFC00E788FB200188FB100148FB0001003E00008FE
S315BFC00E8827BD003003E000080000102127BDFFD8EA
S315BFC00E98AFB2001CAFB10018AFB00014AFBF0024CB
S315BFC00EA8AFB30020008088212412007324100053DA
S315BFC00EB80FF00081000000001452000500000000BA
S315BFC00EC8000080212413000D0BF003BC2412000AB6
S315BFC00ED81450FFF7000000000BF003B300008021D9
S315BFC00EE8105200070000000026100001023018216A
S315BFC00EF80FF00081A062FFFF1453FFF90000000086
S315BFC00F088FBF0024020010218FB300208FB2001CF0
S315BFC00F188FB100188FB0001403E0000827BD0028A2
S315BFC00F28008000080000000003E0000800000000C1
S315BFC00F383C1A1000375A000A409A60000080000861
S315BFC00F484200001003E0000800000000401A60001D
S315BFC00F583C1BFFBF377BFFFF035BD0243C1B020094
S315BFC00F68035BD025409A600000800008420000108D
S315BFC00F7803E00008000000003C0360003C02A0007C
S315BFC00F883463B1FFAC43000424030001AC43000083
S315BFC00F9803E00008000000002CC300101460002B3B
S315BFC00FA800801021308900032523FFFF2C6300036F
S315BFC00FB81060000A000546000089202300084603C2
S315BFC00FC8248400040040382124E7000114E4FFFE4E
S315BFC00FD8A0E8FFFF24C6FFFC00C9302130A500FF2B
S315BFC00FE814A0001C00A04821000618C200604021FA
S315BFC00FF830C60007008038212508FFFFACE90000CE
S315BFC01008ACE900041500FFFC24E70008000318C0BC
S315BFC010182CC7000414E0000400831821AC69000083
S315BFC0102824C6FFFC2463000410C0000600052E00BA
S315BFC0103800052E0300663021246300011466FFFE37
S315BFC01048A065FFFF03E00008000000000BF0040C1A
S315BFC010580080182100051A000065182500034C003A
S30DBFC010680BF003FC0123482570
S315BFC0107027BDFD9827A40010000028212406010023
S315BFC01080AFB10248AFB00244AFBF0264AFB70260F0
S315BFC01090AFB6025CAFB50258AFB40254AFB30250DD
S315BFC010A00FF003E8AFB2024C3C0260003C10A00098
S315BFC010B03442B1FFAE0200043C02200024421000FD
S315BFC010C0AE0200008E11000027A4021000118C02D0
S315BFC010D03C05A4000FF002BB3231007F04410004BF
S315BFC010E0022028213C04BFC00BF00459248414A499
S315BFC010F00FF0031627A402108E03000000408821FC
S315BFC011003C020800006210241440003F3C12BFC01E
S315BFC011103C10A400023080210FF000A5264415580C
S315BFC011203C0331498E0200002463464A1043001176
S315BFC011303C034A46246349311043000E00000000F9
S315BFC011400FF000A5264415583C04BFC00FF000A53C
S315BFC01150248414CC0FF000D0022020213C04BFC091
S315BFC01160248414E40FF000A5000000000BF0051C9A
S315BFC01170240200013C04BFC00FF000A5248414F0B4
S315BFC011800FF000D0022020213C04BFC00FF000A545
S315BFC01190248415148E1100048E04000C8E02000820
S315BFC011A000042082000018210222282310640007F1
S315BFC011B0000000008C47000000A23021ACC7000071
S315BFC011C0246300010BF0046B244200043C04BFC07F
S315BFC011D00FF000A52484151C3C04BFC00FF000A5AA
S315BFC011E0248415248E0400040FF000D00000000034
S315BFC011F00FF000A5264415580FF003CE02202021BC
S315BFC012000BF0051C000010210FF000A52644155891
S315BFC012103C04BFC00FF000A5248415303C0240007B
S315BFC012203C034010AC400000244200041443FFFD01
S315BFC012303C15BFC03C16BFC03C17BFC00000902105
S315BFC0124026B5155026D6155426F7155C0FF000A542
S315BFC0125002A020213C13BFC00FF003A527A40110D5
S315BFC012600040302127A4023027A501100FF0034448
S315BFC01270004080212403000210430005240300045C
S315BFC0128010430019000000000BF0049300000000DB
S315BFC012908FA202308FA30234000000000043182182
S315BFC012A00243202B10800002000000000060902186
S315BFC012B0000018218FA40234000000000064202B58
S315BFC012C010800067006228218FA4023C0000000086
S315BFC012D0008320219084000024630001A0A40000E5
S315BFC012E00BF004AD000000000FF000A502C0202126
S315BFC012F08FA502303C024A4624424931AFA20010F4
S315BFC01300AFA500142622010002452823AFA5001CA5
S315BFC0131027A4021000A228210FF00322AFA20018F3
S315BFC0132002E020210FF000A5AFA200208FA4001CB1
S315BFC013300FF000D0000000000FF000A5266414C84F
S315BFC013403C04BFC00FF000A5248415780FF000D0B1
S315BFC01350022020210FF000A5266414C83C04BFC0DC
S315BFC013600FF000A5248415948FA400200FF000D0E1
S315BFC01370000000000FF000A5266414C83C04BFC01F
S315BFC013800FF000A5248415B08FA6001C27A4021099
S315BFC01390022028210FF002C524C601000440002147
S315BFC013A0004080213C14BFC00FF000A52684151C89
S315BFC013B03C04BFC00FF000A5248415D027A40210DB
S315BFC013C00220282127A600100FF002F02407010033
S315BFC013D004400014004080218FA500188FA60014BA
S315BFC013E08FA7001C0FF002F027A402100440000D07
S315BFC013F0004080210FF000A52684151C3C04BFC049
S315BFC014000FF000A5248415E08FA500188FA6001481
S315BFC014108FA7001C0FF002F927A402100441000BCE
S315BFC01420004080213C04BFC00FF000A5248415C076
S315BFC014300FF000D0020020213C04BFC00FF000A5B2
S315BFC01440248415CC0BF00518000000003C04BFC0B7
S315BFC014500FF000A5248415F00FF003CA3C04BFC02B
S315BFC014600601FF7D000000000BF0049300000000E2
S315BFC014708FBF02648FB702608FB6025C8FB502584A
S315BFC014808FB402548FB302508FB2024C8FB1024891
S311BFC014908FB0024403E0000827BD02680D
S315BFC0149C3A2000002020200043616E6E6F74206618
S315BFC014AC696E6420666C61736820646576696365B2
S315BFC014BC2E2045786974206E6F77210A0A0000000A
S315BFC014CC496E76616C696420696D61676520666FAC
S315BFC014DC756E6420617420002E2041626F72742EAB
S315BFC014EC0A000000426F6F74696E67206170706CC2
S315BFC014FC69636174696F6E2066726F6D20666C614D
S315BFC0150C7368202800000000292E2E2E0000000074
S315BFC0151C646F6E650A000000457865637574652097
S315BFC0152C6174200052656164696E67204845582D49
S315BFC0153C5265636F72642066726F6D20554152548B
S315BFC0154C2E2E00002E000000646F6E650A0A0000C6
S315BFC0155C53697A65206F66206170706C69636174FC
S315BFC0156C696F6E202020203A2000000050726F6732
S315BFC0157C72616D6D696E6720666C617368206174CC
S315BFC0158C2020203A200000004E6578742066726514
S315BFC0159C6520666C617368206F6666736574203A26
S315BFC015AC20000000466C6173682065726173652E3E
S315BFC015BC2E2E00006661696C656420280000000091
S315BFC015CC290A0000466C6173682077726974652EF0
S315BFC015DC2E2E0000466C617368207665726966797B
S311BFC015EC2E2E2E007061737365640A005A
S315BFC009380003188200A3182B106000603C0A008011
S315BFC009488C99001027BDFFD82739FFFFAFB300105A
S315BFC00958AFB2000CAFB100083C0D001A3C1100E89D
S315BFC009683C1200D03C1300FFAFB00004AFBE00249A
S315BFC00978AFB70020AFB6001CAFB50018AFB40014F0
S315BFC009880019CC00000058213C100001263100E8F0
S315BFC00998254A008025AD001A265200D0267300FF0F
S315BFC009A83C0E90103C0F801010E0004700B9C02421
S315BFC009B8030518230070182100E3402B110000025D
S315BFC009C80000000000E018210018C080019840212F
S315BFC009D81060003200000000AD1100008D0200009B
S315BFC009E800000000004A4824152AFFFC004D4824D1
S315BFC009F815200025000000008C89001400000000E7
S315BFC00A08000948820123A02B128000020060102172
S315BFC00A18012010212449FFFF0009A40002894825E7
S315BFC00A280005B080000BA880AD0900000002A080F9
S315BFC00A380196B02100D5A82100004821113400066F
S315BFC00A4802A9F0218FDE00000136B821AEFE000034
S315BFC00A580BF00291252900040162582100A2282162
S315BFC00A680062182300E23823AD1200008D020000D1
S315BFC00A7800000000004A4824152AFFFC004D482440
S315BFC00A8811200003000000000BF002A9004E10257C
S315BFC00A98AD1300000BF0027600001021004F1824DA
S315BFC00AA8146FFFC13C0300FF01986021246300FF98
S315BFC00AB8AD8300000BF002B4000000003C028010FA
S315BFC00AC803E00008244200028FBE00248FB700206F
S315BFC00AD88FB6001C8FB500188FB400148FB3001023
S315BFC00AE88FB2000C8FB100088FB0000403E00008B6
S315BFC00AF827BD002827BDFFE8AFB00010AFBF0014A1
S315BFC00B080FF0014D008080218FBF00140200202145
S315BFC00B188FB000100BF0015827BD001827BDFFD8EE
S315BFC00B2830C30003AFB20018AFBF0024AFB40020B4
S315BFC00B38AFB3001CAFB10014AFB000101060000453
S315BFC00B48008090210006308224C60001000630808E
S315BFC00B5800C5A02100A080213C1180100214182B0B
S315BFC00B681060001600109FC300139F8202709821A1
S315BFC00B7800139883024020210FF0019702602821F5
S315BFC00B8814400009024020210FF001B40260282199
S315BFC00B980051182410710009000000008E43000CD4
S315BFC00BA80BF002D9020380210FF00204026028218C
S315BFC00BB8005118241471FFF4024020218FBF0024AE
S315BFC00BC88FB400208FB3001C8FB200188FB100142A
S315BFC00BD88FB0001003E0000827BD002830E200032D
S315BFC00BE810400004000000000007388224E7000157
S315BFC00BF800073880000528820BF0024C00073882F0
S315BFC00C088C8200000000000000452821000010218A
S315BFC00C181047000900A2202100C2182190840000F5
S315BFC00C2890630000000000001483000500000000A8
S315BFC00C380BF003062442000103E0000800001021A0
S315BFC00C483C02801003E00008244200038C82000CDB
S315BFC00C58000000001440000200A2001B0007000DE0
S315BFC00C68000028100005182B0000101203E000086A
S315BFC00C78004310218C8200100000000000A2182B70
S315BFC00C8814600002000000002445FFFF8C82000CE0
S315BFC00C980000000000A200180000101203E0000800
S315BFC00CA80000000027BDFFE8AFB00010AFBF0014FB
S315BFC00CB80FF00315008080218E03000C8FBF001470
S315BFC00CC8004300188FB000100000101203E00008E0
S315BFC00CD827BD001890820000000000002C430041C9
S315BFC00CE810600003000000000BF0033F2442FFD092
S315BFC00CF82442FFC9304500FF9082000100000000B2
S315BFC00D082C43004114600003000000000BF00348E9
S315BFC00D182442FFC92442FFD0304300FF000511005B
S315BFC00D280062102503E00008304200FF10C0005E15
S315BFC00D380000000027BDFFD024020003AFB3001CCC
S315BFC00D48AFB00010AFBF002CAFB60028AFB50024F8
S315BFC00D58AFB40020AFB20018AFB10014AC82000860
S315BFC00D6890A20001008080212443FFCF2C630003DB
S315BFC00D781060000400A098212452FFD10BF0036A6B
S315BFC00D88240200022443FFC92C6300031060000677
S315BFC00D98240300302412003B0242902324020004DD
S315BFC00DA80BF00371AE020008144300040000902183
S315BFC00DB824020001AC820008241200020FF00337D8
S315BFC00DC826640002004088210040B021AE0200045C
S315BFC00DD8AE000000267500040000A0210292102AAA
S315BFC00DE81040000C000000000FF0033702A02021FE
S315BFC00DF88E0300000051882100031A00004318253E
S315BFC00E08AE030000323100FF269400010BF0037910
S315BFC00E1826B5000226D6FFFF02D2B023265200024D
S315BFC00E280012904002729821AE160004AE13000C91
S315BFC00E38000090218E0200048E13000C00122040C1
S315BFC00E480242102A10400008026420210FF003375F
S315BFC00E580272982100518821A2620000323100FF78
S315BFC00E680BF0038F265200010FF0033700118827F6
S315BFC00E78323100FF16220002000010218E02000880
S315BFC00E888FBF002C8FB600288FB500248FB4002023
S315BFC00E988FB3001C8FB200188FB100148FB000106B
S315BFC00EA803E0000827BD003003E00008000010219A
S315BFC00EB827BDFFD8AFB2001CAFB10018AFB0001482
S315BFC00EC8AFBF0024AFB300200080882124120073AF
S315BFC00ED8241000530FF00081000000001452000513
S315BFC00EE800000000000080212413000D0BF003C5CD
S315BFC00EF82412000A1450FFF7000000000BF003BC11
S315BFC00F080000802110520007000000002610000113
S315BFC00F18023018210FF00081A062FFFF1453FFF9FA
S315BFC00F28000000008FBF0024020010218FB300202D
S315BFC00F388FB2001C8FB100188FB0001403E0000831
S315BFC00F4827BD0028008000080000000003E0000895
S315BFC00F58000000003C1A1000375A000A409A6000C9
S315BFC00F68008000084200001003E00008000000002F
S315BFC00F78401A60003C1BFFBF377BFFFF035BD02413
S315BFC00F883C1B0200035BD025409A60000080000866
S315BFC00F984200001003E00008000000003C036000E8
S315BFC00FA83C02A0003463B1FFAC4300042403000174
S315BFC00FB8AC43000003E00008000000002CC30010CB
S315BFC00FC81460002B00801021308900032523FFFF42
S315BFC00FD82C6300031060000A000546000089202361
S315BFC00FE800084603248400040040382124E70001D2
S315BFC00FF814E4FFFEA0E8FFFF24C6FFFC00C93021EA
S315BFC0100830A500FF14A0001C00A04821000618C2C6
S315BFC010180060402130C60007008038212508FFFF81
S315BFC01028ACE90000ACE900041500FFFC24E70008E2
S315BFC01038000318C02CC7000414E00004008318219D
S315BFC01048AC69000024C6FFFC2463000410C00006B8
S315BFC0105800052E0000052E0300663021246300015B
S315BFC010681466FFFEA065FFFF03E00008000000008E
S315BFC010780BF004150080182100051A000065182555
S311BFC0108800034C000BF0040501234825F3
S315BFC0109427BDFD9827A400100000282124060100FF
S315BFC010A4AFB10248AFB00244AFBF0264AFB70260CC
S315BFC010B4AFB6025CAFB50258AFB40254AFB30250B9
S315BFC010C40FF003F1AFB2024C3C0260003C10A0006B
S315BFC010D43442B1FFAE0200043C02200024421000D9
S315BFC010E4AE0200008E11000027A4021000118C02AC
S315BFC010F43C05A4000FF002BF3231007F0441000497
S315BFC01104022028213C04BFC00BF00462248414C847
S315BFC011140FF0031F27A402108E03000000408821CE
S315BFC011243C020800006210241440003F3C12BFC0FA
S315BFC011343C10A400023080210FF000A52644157CC4
S315BFC011443C0331498E0200002463464A1043001152
S315BFC011543C034A46246349311043000E00000000D5
S315BFC011640FF000A52644157C3C04BFC00FF000A5F4
S315BFC01174248414F00FF000D0022020213C04BFC049
S315BFC01184248415080FF000A5000000000BF0052548
S315BFC01194240200013C04BFC00FF000A5248415146B
S315BFC011A40FF000D0022020213C04BFC00FF000A521
S315BFC011B4248415388E1100048E04000C8E020008D8
S315BFC011C400042082000018210222282310640007CD
S315BFC011D4000000008C47000000A23021ACC700004D
S315BFC011E4246300010BF00474244200043C04BFC052
S315BFC011F40FF000A5248415403C04BFC00FF000A562
S315BFC01204248415488E0400040FF000D000000000EB
S315BFC012140FF000A52644157C0FF003D7022020216A
S315BFC012240BF00525000010210FF000A52644157C40
S315BFC012343C04BFC00FF000A5248415543C02400033
S315BFC012443C034010AC400000244200041443FFFDDD
S315BFC012543C15BFC03C16BFC03C17BFC000009021E1
S315BFC0126426B5157426D6157826F715800FF000A5B2
S315BFC0127402A020213C13BFC00FF003AE27A40110A8
S315BFC012840040302127A4023027A501100FF0034D1B
S315BFC012940040802124030002104300052403000438
S315BFC012A410430019000000000BF0049C00000000AE
S315BFC012B48FA202308FA3023400000000004318215E
S315BFC012C40243202B10800002000000000060902162
S315BFC012D4000018218FA40234000000000064202B34
S315BFC012E410800067006228218FA4023C0000000062
S315BFC012F4008320219084000024630001A0A40000C1
S315BFC013040BF004B6000000000FF000A502C02021F8
S315BFC013148FA502303C024A4624424931AFA20010CF
S315BFC01324AFA500142622010002452823AFA5001C81
S315BFC0133427A4021000A228210FF0032BAFA20018C6
S315BFC0134402E020210FF000A5AFA200208FA4001C8D
S315BFC013540FF000D0000000000FF000A5266414EC07
S315BFC013643C04BFC00FF000A52484159C0FF000D069
S315BFC01374022020210FF000A5266414EC3C04BFC094
S315BFC013840FF000A5248415B88FA400200FF000D099
S315BFC01394000000000FF000A5266414EC3C04BFC0D7
S315BFC013A40FF000A5248415D48FA6001C27A4021051
S315BFC013B4022028210FF002C924C60100044000211F
S315BFC013C4004080213C14BFC00FF000A52684154041
S315BFC013D43C04BFC00FF000A5248415F427A4021093
S315BFC013E40220282127A600100FF002F92407010006
S315BFC013F404400014004080218FA500188FA6001496
S315BFC014048FA7001C0FF002F927A402100440000DD9
S315BFC01414004080210FF000A5268415403C04BFC000
S315BFC014240FF000A5248416048FA500188FA6001438
S315BFC014348FA7001C0FF0030227A402100441000BA0
S315BFC01444004080213C04BFC00FF000A5248415E42E
S315BFC014540FF000D0020020213C04BFC00FF000A58E
S315BFC01464248415F00BF00521000000003C04BFC066
S315BFC014740FF000A5248416140FF003D33C04BFC0D9
S315BFC014840601FF7D000000000BF0049C00000000B5
S315BFC014948FBF02648FB702608FB6025C8FB5025826
S315BFC014A48FB402548FB302508FB2024C8FB102486D
S311BFC014B48FB0024403E0000827BD0268E9
S315BFC014C03A2000002020200043616E6E6F742066F4
S315BFC014D0696E6420666C617368206465766963658E
S315BFC014E02E2045786974206E6F77210A0A000000E6
S315BFC014F0496E76616C696420696D61676520666F88
S315BFC01500756E6420617420002E2041626F72742E86
S315BFC015100A000000426F6F74696E67206170706C9D
S315BFC0152069636174696F6E2066726F6D20666C6128
S315BFC015307368202800000000292E2E2E0000000050
S315BFC01540646F6E650A000000457865637574652073
S315BFC015506174200052656164696E67204845582D25
S315BFC015605265636F72642066726F6D205541525467
S315BFC015702E2E00002E000000646F6E650A0A0000A2
S315BFC0158053697A65206F66206170706C69636174D8
S315BFC01590696F6E202020203A2000000050726F670E
S315BFC015A072616D6D696E6720666C617368206174A8
S315BFC015B02020203A200000004E65787420667265F0
S315BFC015C06520666C617368206F6666736574203A02
S315BFC015D020000000466C6173682065726173652E1A
S315BFC015E02E2E00006661696C65642028000000006D
S315BFC015F0290A0000466C6173682077726974652ECC
S315BFC016002E2E0000466C6173682076657269667956
S311BFC016102E2E2E007061737365640A0035
S705BFC000007B
+37 -37
View File
@@ -6,27 +6,27 @@
typedef struct _ssrec_t
{
UINT32 addr;
UINT32 size;
UINT32 type;
UINT8 *data;
uint32_t addr;
uint32_t size;
uint32_t type;
uint8_t *data;
} srec_t;
typedef struct _sflash_alloc_tbl_t
{
UINT32 images[16];
uint32_t 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];
uint32_t magic;
uint32_t target_base;
uint32_t img_base;
uint32_t img_size;
uint32_t hdr_next;
uint8_t img_name[128];
uint8_t res[108];
} flash_img_hdr_t;
@@ -35,10 +35,10 @@ enum srec_type
srec_err, srec_sob, srec_data, srec_rec, srec_eob
};
UINT8 h2i(UINT8 *c)
uint8_t h2i(uint8_t *c)
{
int i;
UINT8 t, b = 0;
uint8_t t, b = 0;
for (i=0; i < 2; i++)
{
@@ -53,9 +53,9 @@ UINT8 h2i(UINT8 *c)
return b;
}
int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
int decode_srec(srec_t *pRec, uint8_t *pBuf, int buflen)
{
UINT8 chksum, byte;
uint8_t chksum, byte;
int alen, i;
if (!buflen)
@@ -92,7 +92,7 @@ int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
}
pRec->size -= (alen+1);
pRec->data = (UINT8*) &pBuf[4 + 2*alen];
pRec->data = (uint8_t*) &pBuf[4 + 2*alen];
for (i=0; i < (int)pRec->size; i++)
{
byte = h2i(&pRec->data[2*i]);
@@ -107,7 +107,7 @@ int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
return pRec->type;
}
int srec_getline(UINT8 *pLine)
int srec_getline(uint8_t *pLine)
{
char c;
int i = 0;
@@ -220,27 +220,27 @@ void Exec_RE_at(void *pEntry)
int main(int argc, char *argv[])
{
UINT8 buf[256];
uint8_t buf[256];
srec_t srec;
int srec_state, i;
UINT32 haddr, result;
uint32_t haddr, result;
flash_t flash;
flash_img_hdr_t img_hdr = {0};
flash_img_hdr_t *pImg_hdr;
UINT32 img_size, block_sel;
uint32_t 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;
volatile uint32_t *pGPIO_DATA = (uint32_t*)SYS_GPIO_0_DATA;
volatile uint32_t *pGPIO_DIR = (uint32_t*)SYS_GPIO_0_DIR;
volatile uint8_t *pMem;
volatile uint32_t *pFlashIO = (uint32_t*)FLASH_BASE_IO; // Flash in uncached area
volatile uint32_t *pFlashMem = (uint32_t*)FLASH_BASE_MEM; // Flash in cached area
volatile uint32_t *ram32 = (uint32_t*)SDRAM_BASE;
uint32_t 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);
block_sel = 0x7F & (uint32_t)((*pGPIO_DATA & GPIO_0_DIP) >> GPIO_0_ALIGN_DIP);
// ----------------------------------------------------------
if (IS_ERROR(flash_find(&flash, SYS_FLASH_IO)))
@@ -252,8 +252,8 @@ int main(int argc, char *argv[])
// 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);
ram32 = (uint32_t*)(SDRAM_BASE);
pFlashIO = (uint32_t*)(SYS_FLASH_IO + flash_offset);
if (!(((*pGPIO_DATA & GPIO_0_BTN) >> GPIO_0_ALIGN_BTN) & 8))
{
@@ -268,12 +268,12 @@ int main(int argc, char *argv[])
sputs("Booting application from flash (");print_word(flash_offset);sputs(")...");
ram32 = (UINT32*)pImg_hdr->target_base;
ram32 = (uint32_t*)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;
pFlashMem = (uint32_t*)pImg_hdr->img_base;
for (i=0; i < img_size/4; i++)
ram32[i] = pFlashMem[i];
@@ -308,7 +308,7 @@ int main(int argc, char *argv[])
if ((srec.addr + srec.size) > haddr)
haddr = srec.addr + srec.size;
pMem = (UINT8*)srec.addr;
pMem = (uint8_t*)srec.addr;
for (i=0; i < srec.size; i++)
*pMem++ = srec.data[i];
@@ -335,13 +335,13 @@ int main(int argc, char *argv[])
sputs("done\n");
sputs("Flash write...");
result = flash_program(&flash, flash_offset, (UINT8*)&img_hdr, sizeof(flash_img_hdr_t));
result = flash_program(&flash, flash_offset, (uint8_t*)&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);
result = flash_program(&flash, img_hdr.img_base, (uint8_t*)img_hdr.target_base, img_hdr.img_size);
if (IS_ERROR(result))
{
sputs("failed (");print_word(result);sputs(")\n");
@@ -350,7 +350,7 @@ int main(int argc, char *argv[])
sputs("done\n");
sputs("Flash verify...");
result = flash_verify(&flash, img_hdr.img_base, (UINT8*)img_hdr.target_base, img_hdr.img_size);
result = flash_verify(&flash, img_hdr.img_base, (uint8_t*)img_hdr.target_base, img_hdr.img_size);
if (IS_ERROR(result))
{
sputs("failed (");print_word(result);sputs(")\n");
+15 -15
View File
@@ -8,9 +8,9 @@
// ---------------------------------------------------------------------------------
// MIPS specific
UINT32 CP0_SR_read(void)
uint32_t CP0_SR_read(void)
{
UINT32 result;
uint32_t result;
__asm
(
@@ -21,7 +21,7 @@ UINT32 CP0_SR_read(void)
return result;
}
void CP0_SR_write(UINT32 val)
void CP0_SR_write(uint32_t val)
{
__asm
(
@@ -31,9 +31,9 @@ void CP0_SR_write(UINT32 val)
);
}
UINT32 CP0_CR_read(void)
uint32_t CP0_CR_read(void)
{
UINT32 result;
uint32_t result;
__asm
(
@@ -44,7 +44,7 @@ UINT32 CP0_CR_read(void)
return result;
}
void CP0_CR_write(UINT32 val)
void CP0_CR_write(uint32_t val)
{
__asm
(
@@ -54,9 +54,9 @@ void CP0_CR_write(UINT32 val)
);
}
UINT32 CP0_PRID_read(void)
uint32_t CP0_PRID_read(void)
{
UINT32 result;
uint32_t result;
__asm
(
@@ -70,8 +70,8 @@ UINT32 CP0_PRID_read(void)
// ---------------------------------------------------------------------------------
char readchar(void)
{
volatile UINT32 *pUART_stat = (UINT32*)SYS_UART_STAT;
volatile UINT32 *pUART_data = (UINT32*)SYS_UART_DATA;
volatile uint32_t *pUART_stat = (uint32_t*)SYS_UART_STAT;
volatile uint32_t *pUART_data = (uint32_t*)SYS_UART_DATA;
while(!(0x10 & *pUART_stat));
@@ -80,12 +80,12 @@ char readchar(void)
void writechar(char c)
{
volatile UINT32 *pUART_stat = (UINT32*)SYS_UART_STAT;
volatile UINT32 *pUART_data = (UINT32*)SYS_UART_DATA;
volatile uint32_t *pUART_stat = (uint32_t*)SYS_UART_STAT;
volatile uint32_t *pUART_data = (uint32_t*)SYS_UART_DATA;
while((0x02 & *pUART_stat) != 0);
*pUART_data = (UINT32)c;
*pUART_data = (uint32_t)c;
}
void _putchar(char c)
@@ -151,12 +151,12 @@ void print_word(int word)
// _Return: none
//
// ---------------------------------------------------------------------------
void PrintBuffer8(UINT8 *pBuf, int nbpr, int len)
void PrintBuffer8(uint8_t *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)
void memdump(uint8_t *pBuf, int print_offset_only, int num_bytes_per_row, int len)
{
int i, j, cnt_hex, cnt_asc, base;
unsigned char c;
+11 -19
View File
@@ -1,21 +1,13 @@
#ifndef LIBSYS_H
#define LIBSYS_H
#include <stdint.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)
#define LSYS_ERR_BASE 0x80000000
#define IS_ERROR(e) ((e & LSYS_ERR_BASE) == LSYS_ERR_BASE)
#ifndef SYS_IO_BASE
#define SYS_IO_BASE 0xA0000000
@@ -62,11 +54,11 @@
#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);
uint32_t CP0_SR_read(void);
void CP0_SR_write(uint32_t val);
uint32_t CP0_CR_read(void);
void CP0_CR_write(uint32_t val);
uint32_t CP0_PRID_read(void);
// General
char readchar(void);
@@ -75,8 +67,8 @@ 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);
void PrintBuffer8(uint8_t *pBuf, int nbpr, int len);
void memdump(uint8_t *pBuf, int print_offset_only, int num_bytes_per_row, int len);
#endif // LIBSYS_H
+11
View File
@@ -0,0 +1,11 @@
#include "libsys_boot.h"
void test()
{
volatile uint32_t *pGPIO = (uint32_t*)SYS_GPIO_0_DATA;
volatile uint32_t *pGPIODIR = (uint32_t*)SYS_GPIO_0_DIR;
*pGPIODIR = GPIO_0_DFLT_DIR;
*pGPIO = 1;
}