Subversion Repositories Kolibri OS

Rev

Rev 2916 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2916 Rev 2918
Line 303... Line 303...
303
        else
303
        else
304
        mov     eax, 0x80000000 + (RegAddr shl 16) + value
304
        mov     eax, 0x80000000 + (RegAddr shl 16) + value
305
        end if
305
        end if
306
        out     dx, eax
306
        out     dx, eax
Line 307... Line 307...
307
 
307
 
308
        call    PHY_WAIT
308
        call    PHY_WAIT_WRITE
Line 309... Line 309...
309
}
309
}
Line 310... Line 310...
310
 
310
 
Line 311... Line 311...
311
macro   READ_GMII_REG  RegAddr {
311
macro   READ_GMII_REG  RegAddr {
312
 
312
 
313
local   .error, .done
313
local   .error, .done
Line 314... Line 314...
314
 
314
 
315
        set_io  REG_PHYAR
315
        set_io  REG_PHYAR
Line 316... Line 316...
316
        mov     eax, RegAddr shl 16
316
        mov     eax, RegAddr shl 16
317
        out     dx, eax
317
        out     dx, eax
318
 
318
 
Line 327... Line 327...
327
        or      eax, -1
327
        or      eax, -1
328
  .done:
328
  .done:
329
}
329
}
Line 330... Line 330...
330
 
330
 
331
align 4
331
align 4
-
 
332
PHY_WAIT_READ:       ; io addr must already be set to REG_PHYAR
-
 
333
 
-
 
334
        udelay  1        ;;;1000
-
 
335
 
-
 
336
        push    ecx
-
 
337
        mov     ecx, 2000
-
 
338
        ; Check if the RTL8169 has completed writing/reading to the specified MII register
-
 
339
    @@:
-
 
340
        in      eax, dx
-
 
341
        test    eax, 0x80000000
-
 
342
        jnz     .exit
-
 
343
        udelay  1        ;;;100
-
 
344
        loop    @b
-
 
345
  .exit:
-
 
346
        pop     ecx
-
 
347
        ret
-
 
348
 
-
 
349
align 4
Line 332... Line 350...
332
PHY_WAIT:       ; io addr must already be set to REG_PHYAR
350
PHY_WAIT_WRITE:       ; io addr must already be set to REG_PHYAR
Line 333... Line 351...
333
 
351
 
334
        udelay  1        ;;;1000
352
        udelay  1        ;;;1000