www.pudn.com > nandflash_1G08U0A.rar > drv_nandflash.ps
.file "..\src\drv_nandflash.c" ; GNU C 2.7.2 [AL 1.1, MM 40] RISC NEWS-OS compiled by CC ; Cc1 defaults: ; -mmemcpy ; Cc1 arguments (-G value = 0, Cpu = 3000, ISA = 1): ; -quiet -dumpbase -g -O -fno-builtin -o gcc2_compiled.: __gnu_compiled_c: .code .def _tag_nand_fls, scl 10, type 0x8, size 4, endef .def maker_code, val 0, scl 8, type 0xc, endef .def device_code, val 1, scl 8, type 0xc, endef .def rev1, val 2, scl 8, type 0xc, endef .def mutiplane_code, val 3, scl 8, type 0xc, endef .def _tag_nand_fls, val 4, scl 102, tag _tag_nand_fls, size 4, endef .def t_nand_fls_id, scl 13, tag _tag_nand_fls, size 4, type 0x8, endef .align 1 .def nand_fls_init, val nand_fls_init, scl 2, type 0x24, endef .global nand_fls_init .loc 32 .def ent, scl 101, type 0x0, endef nand_fls_init: ; .frame %sp,4,$31 # vars= 0, regs= 1/0, args= 0, extra= 0 ; .mask 0x80000000,-4 ; .fmask 0x00000000,0 .loc 33 .def begin, scl 100, type 0x0, endef .def i, val 11, scl 4, type 0xd, endef .loc 35 xld.w %r12,this_nand_fls_id xld.w [p_nand_fls_id],%r12 .loc 36 ld.w %r13,0x0 xld.w %r14,0x00000004 ; 4 xcall memset .loc 41 xld.w %r12,0x000402d9 ; 262873 xbclr [%r12],0x5 .loc 42 xld.w %r11,0x000402da ; 262874 xbset [%r11],0x5 .loc 43 xbclr [%r12],0x4 .loc 44 xbset [%r11],0x4 .loc 47 xld.w %r12,0x00300022 ; 3145762 xbset [%r12],0x1 .loc 50 xld.w %r11,0x0030004a ; 3145802 ;.set volatile xld.ub %r10,[%r11] ;.set novolatile xand %r10,%r10,0x000000f3 ;.set volatile xld.b [%r11],%r10 ;.set novolatile .loc 53 xld.w %r11,0x00300023 ; 3145763 xbset [%r11],0x1 .loc 56 xld.w %r11,0x00300103 ; 3145987 xbclr [%r11],0x0 .loc 59 xld.w %r10,0x00300100 ; 3145984 ld.w %r15,0x0 ;.set volatile xld.b [%r10],%r15 ;.set novolatile .loc 63 xld.w %r11,0x00300047 ; 3145799 xbset [%r11],0x0 .loc 64 xbset [%r11],0x2 .loc 67 xld.w %r11,0x00300f47 ; 3149639 xbclr [%r11],0x5 .loc 70 xld.w %r11,0x00300020 ; 3145760 xbset [%r11],0x0 .loc 71 xld.w %r11,0x00300048 ; 3145800 xbset [%r11],0x0 .loc 74 xld.w %r11,0x00300021 ; 3145761 xbset [%r11],0x0 .loc 77 xbclr [%r12],0x1 .loc 79 ; APP nop ; NO_APP .loc 81 ld.w %r11,0x0 xld.w %r12,0x0000270f ; 9999 __L5: .loc 82 ; APP nop ; NO_APP .loc 81 xadd %r11,%r11,1 ld.uh %r10,%r11 cmp %r10,%r12 xjrule __L5 .loc 87 xld.w %r11,0x000402d9 ; 262873 xbset [%r11],0x4 .loc 88 xld.w %r12,0x04000004 ; 67108868 xld.w %r10,0x00000090 ; 144 ;.set volatile xld.b [%r12],%r10 ;.set novolatile .loc 89 xbclr [%r11],0x4 .loc 91 xbset [%r11],0x5 .loc 92 xld.w %r10,0x04000008 ; 67108872 ld.w %r15,0x0 ;.set volatile xld.b [%r10],%r15 ;.set novolatile .loc 93 xbclr [%r11],0x5 .loc 96 xld.w %r12,[p_nand_fls_id] xld.w %r11,0x04000000 ; 67108864 ;.set volatile xld.ub %r10,[%r11] ;.set novolatile xld.b [%r12],%r10 .loc 97 xld.w %r12,[p_nand_fls_id] ;.set volatile xld.ub %r10,[%r11] ;.set novolatile xld.b [%r12+1],%r10 .loc 98 xld.w %r12,[p_nand_fls_id] ;.set volatile xld.ub %r10,[%r11] ;.set novolatile xld.b [%r12+2],%r10 .loc 99 xld.w %r12,[p_nand_fls_id] ;.set volatile xld.ub %r10,[%r11] ;.set novolatile xld.b [%r12+3],%r10 .loc 101 xld.w %r11,0x00300022 ; 3145762 xbset [%r11],0x1 .loc 102 ; APP nop ; NO_APP .loc 103 xld.w %r12,[p_nand_fls_id] xld.ub %r11,[%r12] .loc 106 xld.w %r10,0x00000001 ; 1 .loc 103 xcmp %r11,236 xjrne __L7 xld.ub %r11,[%r12+1] xcmp %r11,241 xjrne __L7 xld.ub %r11,[%r12+3] xxor %r11,%r11,0x00000015 not %r10,%r11 add %r10,1 or %r10,%r11 xsrl %r10,31 __L7: .loc 106 .loc 109 .def bend, scl 110, type 0x0, endef ret .def end, scl 111, type 0x0, endef .align 1 .def nand_fls_Reset, val nand_fls_Reset, scl 2, type 0x21, endef .global nand_fls_Reset .loc 112 .def ent, scl 101, type 0x0, endef nand_fls_Reset: ; .frame %sp,4,$31 # vars= 0, regs= 1/0, args= 0, extra= 0 ; .mask 0x80000000,-4 ; .fmask 0x00000000,0 .loc 114 .def begin, scl 100, type 0x0, endef .def i, val 10, scl 4, type 0x4, endef .loc 116 xld.w %r11,0x000402d9 ; 262873 xbset [%r11],0x4 .loc 118 xld.w %r12,0x04000000 ; 67108864 xld.w %r10,0x000000ff ; 255 ;.set volatile xld.h [%r12],%r10 ;.set novolatile .loc 120 xbclr [%r11],0x4 .loc 123 ld.w %r10,0x0 xld.w %r11,0x0000031f ; 799 __L13: .loc 124 ; APP nop ; NO_APP .loc 123 xadd %r10,%r10,1 cmp %r10,%r11 xjrle __L13 .loc 128 .def bend, scl 110, type 0x0, endef ret .def end, scl 111, type 0x0, endef .align 1 .def nand_fls_erase_block, val nand_fls_erase_block, scl 2, type 0x24, endef .global nand_fls_erase_block .loc 136 .def ent, scl 101, type 0x0, endef nand_fls_erase_block: ; .frame %sp,4,$31 # vars= 0, regs= 1/0, args= 0, extra= 0 ; .mask 0x80000000,-4 ; .fmask 0x00000000,0 .def Block_Number, val 12, scl 17, type 0xe, endef .loc 138 .def begin, scl 100, type 0x0, endef .loc 140 xld.w %r11,0x00300022 ; 3145762 xbclr [%r11],0x1 .loc 141 ; APP nop ; NO_APP .loc 144 xld.w %r11,0x000402d9 ; 262873 xbset [%r11],0x4 .loc 145 xld.w %r14,0x04000004 ; 67108868 xld.w %r10,0x00000060 ; 96 ;.set volatile xld.b [%r14],%r10 ;.set novolatile .loc 146 xbclr [%r11],0x4 .loc 149 xbset [%r11],0x5 .loc 152 xld.w %r13,0x04000008 ; 67108872 xsll %r12,6 ld.w %r10,%r12 xand %r10,%r10,0x000000ff ;.set volatile xld.h [%r13],%r10 ;.set novolatile .loc 155 xand %r12,%r12,0x0000ff00 xsrl %r12,8 ;.set volatile xld.h [%r13],%r12 ;.set novolatile .loc 157 xbclr [%r11],0x5 .loc 160 xbset [%r11],0x4 .loc 161 xld.w %r10,0x000000d0 ; 208 ;.set volatile xld.b [%r14],%r10 ;.set novolatile .loc 162 xbclr [%r11],0x4 .loc 164 ; APP nop ; NO_APP .loc 165 ; APP nop ; NO_APP .loc 166 ; APP nop ; NO_APP .loc 167 ; APP nop ; NO_APP .loc 168 ; APP nop ; NO_APP .loc 169 ; APP nop ; NO_APP .loc 170 ; APP nop ; NO_APP .loc 171 ; APP nop ; NO_APP .loc 172 ; APP nop ; NO_APP .loc 173 ; APP nop ; NO_APP .loc 174 ; APP nop ; NO_APP .loc 175 ; APP nop ; NO_APP .loc 176 ; APP nop ; NO_APP .loc 177 ; APP nop ; NO_APP .loc 178 ; APP nop ; NO_APP .loc 179 ; APP nop ; NO_APP .loc 180 ; APP nop ; NO_APP .loc 181 ; APP nop ; NO_APP .loc 182 ; APP nop ; NO_APP .loc 183 ; APP nop ; NO_APP .loc 184 ; APP nop ; NO_APP .loc 186 xld.w %r12,0x00300f46 ; 3149638 xld.w %r11,0x00000020 ; 32 __L18: .loc 187 ;.set volatile xld.ub %r10,[%r12] ;.set novolatile and %r10,%r11 ld.ub %r10,%r10 cmp %r10,0x0 xjreq __L18 .loc 190 xld.w %r11,0x000402d9 ; 262873 xbset [%r11],0x4 .loc 191 xld.w %r12,0x04000004 ; 67108868 xld.w %r10,0x00000070 ; 112 ;.set volatile xld.b [%r12],%r10 ;.set novolatile .loc 192 xbclr [%r11],0x4 .loc 193 xld.w %r10,0x04000000 ; 67108864 ;.set volatile xld.ub %r10,[%r10] ;.set novolatile ld.w %r12,%r10 xand %r12,%r12,0x00000001 xjrne __L20 .loc 201 xld.w %r11,0x00300022 ; 3145762 xbset [%r11],0x1 .loc 202 ld.w %r15,0x0 xld.b [ret],%r15 .loc 203 ld.w %r10,%r12 xjp __L22 __L20: .loc 195 xld.w %r10,0x00300022 ; 3145762 xbset [%r10],0x1 .loc 196 xld.w %r10,0x00000001 ; 1 xld.b [ret],%r10 .loc 197 xld.w %r10,-1 ; 0xffffffff __L22: .loc 206 .def bend, scl 110, type 0x0, endef ret .def end, scl 111, type 0x0, endef .align 1 .def nand_fls_write_page, val nand_fls_write_page, scl 2, type 0x24, endef .global nand_fls_write_page .loc 211 .def ent, scl 101, type 0x0, endef nand_fls_write_page: ; .frame %sp,4,$31 # vars= 0, regs= 1/0, args= 0, extra= 0 ; .mask 0x80000000,-4 ; .fmask 0x00000000,0 ld.w %r15,%r12 .def data, val 15, scl 17, type 0x1c, endef .def page_num, val 13, scl 17, type 0xe, endef .def block_num, val 14, scl 17, type 0xe, endef .loc 212 .def begin, scl 100, type 0x0, endef .def sWriteCount, val 11, scl 4, type 0xd, endef .loc 215 xld.w %r11,0x00300022 ; 3145762 xbclr [%r11],0x1 .loc 216 ; APP nop ; NO_APP .loc 219 xld.w %r12,0x000402d9 ; 262873 xbset [%r12],0x4 .loc 220 xld.w %r11,0x04000004 ; 67108868 xld.w %r10,0x00000080 ; 128 ;.set volatile xld.b [%r11],%r10 ;.set novolatile .loc 221 xbclr [%r12],0x4 .loc 224 xbset [%r12],0x5 .loc 227 xld.w %r11,0x04000008 ; 67108872 ld.w %r4,0x0 ;.set volatile xld.h [%r11],%r4 ;.set novolatile .loc 230 ;.set volatile xld.h [%r11],%r4 ;.set novolatile .loc 233 xsll %r14,6 add %r14,%r13 ld.w %r10,%r14 xand %r10,%r10,0x000000ff ;.set volatile xld.h [%r11],%r10 ;.set novolatile .loc 236 xand %r14,%r14,0x0000ff00 xsrl %r14,8 ;.set volatile xld.h [%r11],%r14 ;.set novolatile .loc 238 xbclr [%r12],0x5 .loc 241 ld.w %r11,0x0 xld.w %r13,0x04000000 ; 67108864 xld.w %r12,0x0000083f ; 2111 __L27: .loc 244 ld.uh %r10,%r11 ld.w %r4,%r15 add %r4,%r10 ld.w %r10,%r4 ;.set volatile xld.ub %r10,[%r10] ;.set novolatile ;.set volatile xld.b [%r13],%r10 ;.set novolatile .loc 241 xadd %r11,%r11,1 ld.uh %r10,%r11 cmp %r10,%r12 xjrule __L27 .loc 248 xld.w %r11,0x000402d9 ; 262873 xbset [%r11],0x4 .loc 249 xld.w %r12,0x04000004 ; 67108868 xld.w %r10,0x00000010 ; 16 ;.set volatile xld.b [%r12],%r10 ;.set novolatile .loc 250 xbclr [%r11],0x4 .loc 252 ; APP nop ; NO_APP .loc 253 ; APP nop ; NO_APP .loc 254 ; APP nop ; NO_APP .loc 255 ; APP nop ; NO_APP .loc 256 ; APP nop ; NO_APP .loc 257 ; APP nop ; NO_APP .loc 258 ; APP nop ; NO_APP .loc 259 ; APP nop ; NO_APP .loc 260 ; APP nop ; NO_APP .loc 261 ; APP nop ; NO_APP .loc 262 ; APP nop ; NO_APP .loc 263 ; APP nop ; NO_APP .loc 264 ; APP nop ; NO_APP .loc 265 ; APP nop ; NO_APP .loc 266 ; APP nop ; NO_APP .loc 267 ; APP nop ; NO_APP .loc 268 ; APP nop ; NO_APP .loc 269 ; APP nop ; NO_APP .loc 270 ; APP nop ; NO_APP .loc 271 ; APP nop ; NO_APP .loc 272 ; APP nop ; NO_APP .loc 274 xld.w %r12,0x00300f46 ; 3149638 xld.w %r11,0x00000020 ; 32 __L31: .loc 275 ;.set volatile xld.ub %r10,[%r12] ;.set novolatile and %r10,%r11 ld.ub %r10,%r10 cmp %r10,0x0 xjreq __L31 .loc 277 xld.w %r11,0x000402d9 ; 262873 xbset [%r11],0x4 .loc 278 xld.w %r12,0x04000004 ; 67108868 xld.w %r10,0x00000070 ; 112 ;.set volatile xld.b [%r12],%r10 ;.set novolatile .loc 279 xbclr [%r11],0x4 .loc 280 xld.w %r10,0x04000000 ; 67108864 ;.set volatile xld.ub %r10,[%r10] ;.set novolatile ld.w %r12,%r10 xand %r12,%r12,0x00000001 xjrne __L33 .loc 285 xld.w %r11,0x00300022 ; 3145762 xbset [%r11],0x1 .loc 286 ld.w %r10,%r12 xjp __L35 __L33: .loc 282 xld.w %r11,0x00300022 ; 3145762 xbset [%r11],0x1 .loc 283 xld.w %r10,-1 ; 0xffffffff __L35: .loc 290 .def bend, scl 110, type 0x0, endef ret .def end, scl 111, type 0x0, endef .align 1 .def nand_fls_read_page, val nand_fls_read_page, scl 2, type 0x24, endef .global nand_fls_read_page .loc 294 .def ent, scl 101, type 0x0, endef nand_fls_read_page: ; .frame %sp,4,$31 # vars= 0, regs= 1/0, args= 0, extra= 0 ; .mask 0x80000000,-4 ; .fmask 0x00000000,0 ld.w %r4,%r12 .def data, val 4, scl 17, type 0x1c, endef .def page_num, val 13, scl 17, type 0xe, endef .def block_num, val 14, scl 17, type 0xe, endef .loc 295 .def begin, scl 100, type 0x0, endef .def i, val 12, scl 4, type 0xd, endef .loc 298 xld.w %r11,0x00300022 ; 3145762 xbclr [%r11],0x1 .loc 299 ; APP nop ; NO_APP .loc 302 xld.w %r11,0x000402d9 ; 262873 xbset [%r11],0x4 .loc 303 xld.w %r15,0x04000004 ; 67108868 ld.w %r5,0x0 ;.set volatile xld.b [%r15],%r5 ;.set novolatile .loc 304 xbclr [%r11],0x4 .loc 307 xbset [%r11],0x5 .loc 309 xld.w %r12,0x04000008 ; 67108872 ld.w %r5,0x0 ;.set volatile xld.h [%r12],%r5 ;.set novolatile .loc 311 ;.set volatile xld.h [%r12],%r5 ;.set novolatile .loc 313 xsll %r14,6 add %r14,%r13 ld.w %r10,%r14 xand %r10,%r10,0x000000ff ;.set volatile xld.h [%r12],%r10 ;.set novolatile .loc 315 xand %r14,%r14,0x0000ff00 xsrl %r14,8 ;.set volatile xld.h [%r12],%r14 ;.set novolatile .loc 317 xbclr [%r11],0x5 .loc 320 xbset [%r11],0x4 .loc 321 xld.w %r10,0x00000030 ; 48 ;.set volatile xld.b [%r15],%r10 ;.set novolatile .loc 322 xbclr [%r11],0x4 .loc 323 ; APP nop ; NO_APP .loc 324 ; APP nop ; NO_APP .loc 325 ; APP nop ; NO_APP .loc 326 ; APP nop ; NO_APP .loc 327 ; APP nop ; NO_APP .loc 328 ; APP nop ; NO_APP .loc 329 ; APP nop ; NO_APP .loc 330 ; APP nop ; NO_APP .loc 331 ; APP nop ; NO_APP .loc 332 ; APP nop ; NO_APP .loc 333 ; APP nop ; NO_APP .loc 334 ; APP nop ; NO_APP .loc 335 ; APP nop ; NO_APP .loc 336 ; APP nop ; NO_APP .loc 337 ; APP nop ; NO_APP .loc 338 ; APP nop ; NO_APP .loc 339 ; APP nop ; NO_APP .loc 340 ; APP nop ; NO_APP .loc 341 ; APP nop ; NO_APP .loc 342 xld.w %r12,0x00300f46 ; 3149638 xld.w %r11,0x00000020 ; 32 __L39: .loc 343 ;.set volatile xld.ub %r10,[%r12] ;.set novolatile and %r10,%r11 ld.ub %r10,%r10 cmp %r10,0x0 xjreq __L39 .loc 344 ; APP nop ; NO_APP .loc 345 ; APP nop ; NO_APP .loc 346 ; APP nop ; NO_APP .loc 347 ; APP nop ; NO_APP .loc 348 ; APP nop ; NO_APP .loc 349 ld.w %r12,0x0 xld.w %r14,0x04000000 ; 67108864 xld.w %r13,0x0000083f ; 2111 __L44: .loc 350 ld.uh %r10,%r12 ld.w %r5,%r4 add %r5,%r10 ld.w %r10,%r5 ;.set volatile xld.ub %r11,[%r14] ;.set novolatile xld.b [%r10],%r11 .loc 349 xadd %r12,%r12,1 ld.uh %r10,%r12 cmp %r10,%r13 xjrule __L44 .loc 352 xld.w %r11,0x00300022 ; 3145762 xbset [%r11],0x1 .loc 353 ; APP nop ; NO_APP .loc 354 xld.w %r10,0x00000200 ; 512 .loc 356 .def bend, scl 110, type 0x0, endef ret .def end, scl 111, type 0x0, endef .align 1 .def nand_fls_tst_all, val nand_fls_tst_all, scl 2, type 0x21, endef .global nand_fls_tst_all .loc 361 .def ent, scl 101, type 0x0, endef nand_fls_tst_all: ; .frame %sp,20,$31 # vars= 0, regs= 5/0, args= 0, extra= 0 ; .mask 0x800f0000,-4 ; .fmask 0x00000000,0 pushn %r3 .loc 362 .def begin, scl 100, type 0x0, endef .def i, val 0, scl 4, type 0x4, endef .def k, val 11, scl 4, type 0x4, endef .def j, val 1, scl 4, type 0x4, endef .loc 365 xcall nand_fls_init .loc 369 xcall nand_fls_Reset .loc 370 ld.w %r0,0x0 __L50: .loc 371 ld.w %r12,%r0 xcall nand_fls_erase_block xcmp %r10,1 xjreq __L74 .loc 370 xadd %r0,%r0,1 xcmp %r0,1023 xjrle __L50 .loc 379 ld.w %r0,0x0 .loc 380 ld.w %r1,%r0 xld.w %r2,Test_Nand_Fls_Buf __L57: .loc 381 .def begin, scl 100, type 0x0, endef ld.w %r12,%r2 ld.w %r13,%r1 xld.w %r14,0x00000840 ; 2112 xcall memset .loc 382 xadd %r1,%r1,1 .loc 383 ld.w %r12,%r2 ld.w %r13,%r0 xld.w %r14,0x00000400 ; 1024 xcall nand_fls_write_page xcmp %r10,1 xjreq __L75 .loc 387 xld.w %r12,Test_Nand_Fls_Buf ld.w %r13,%r0 xld.w %r14,0x00000400 ; 1024 xcall nand_fls_read_page .loc 388 .def bend, scl 110, type 0x0, endef .loc 380 xadd %r0,%r0,1 xcmp %r0,63 xjrle __L57 .loc 391 ld.w %r0,0x0 .loc 392 ld.w %r1,%r0 xld.w %r3,Test_Nand_Fls_Buf xld.w %r2,0x0000083f ; 2111 __L64: .loc 393 .def begin, scl 100, type 0x0, endef ld.w %r12,%r3 xadd %r13,%r0,1 xld.w %r14,0x00000840 ; 2112 xcall memset .loc 395 ld.w %r12,%r3 ld.w %r13,%r0 xld.w %r14,0x00000400 ; 1024 xcall nand_fls_read_page .loc 397 ld.w %r11,0x0 __L68: .loc 398 xld.ub %r10,[%r11+Test_Nand_Fls_Buf] cmp %r1,%r10 xjrne __L70 .loc 397 xadd %r11,%r11,1 cmp %r11,%r2 xjrle __L68 .loc 402 xadd %r1,%r1,1 .loc 403 .def bend, scl 110, type 0x0, endef .loc 392 xadd %r0,%r0,1 xcmp %r0,63 xjrle __L64 .def Tst_NFS_All, val __L73, scl 6, type 0x0, endef __L73: .loc 407 ; APP nop ; NO_APP .loc 408 xjp __L73 __L74: .loc 372 ; APP nop ; NO_APP .loc 373 .loc 412 xjp __L74 __L75: .loc 384 ; APP nop ; NO_APP .loc 385 .loc 416 xjp __L75 .def Read_Error, val __L70, scl 6, type 0x0, endef __L70: .loc 419 ; APP nop ; NO_APP .loc 420 xjp __L70 .loc 423 .def bend, scl 110, type 0x0, endef popn %r3 ret .def end, scl 111, type 0x0, endef .def this_nand_fls_id, val this_nand_fls_id, scl 2, tag _tag_nand_fls, size 4, type 0x8, endef .comm this_nand_fls_id 4 .def p_nand_fls_id, val p_nand_fls_id, scl 2, tag _tag_nand_fls, size 4, type 0x18, endef .comm p_nand_fls_id 4 .def ret, val ret, scl 2, type 0xc, endef .comm ret 1 .def Test_Nand_Fls_Buf, val Test_Nand_Fls_Buf, scl 2, dim 2112, size 2112, type 0x3c, endef .comm Test_Nand_Fls_Buf 2112 .endfile