i8255x: longer acces timing for eeprom.

git-svn-id: svn://kolibrios.org@5247 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2014-12-19 21:33:05 +00:00
parent 9e74531bdb
commit 5cd0c307f0

View File

@ -187,21 +187,6 @@ struct device ETH_DEVICE
ends ends
macro delay {
push eax
in ax, dx
in ax, dx
in ax, dx
in ax, dx
in ax, dx
in ax, dx
in ax, dx
in ax, dx
in ax, dx
in ax, dx
pop eax
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; ;; ;;
;; proc START ;; ;; proc START ;;
@ -896,7 +881,7 @@ ee_read: ; esi = address to read
mov al, EE_CS mov al, EE_CS
out dx, al out dx, al
delay call udelay
;----------------------- ;-----------------------
; Write this to the chip ; Write this to the chip
@ -908,11 +893,11 @@ ee_read: ; esi = address to read
or al, EE_DI or al, EE_DI
@@: @@:
out dx, al out dx, al
delay call udelay
and al, not EE_SK and al, not EE_SK
out dx, al out dx, al
delay call udelay
loop .loop loop .loop
@ -926,7 +911,7 @@ ee_read: ; esi = address to read
shl esi, 1 shl esi, 1
mov al, EE_CS + EE_SK mov al, EE_CS + EE_SK
out dx, al out dx, al
delay call udelay
in al, dx in al, dx
test al, EE_DO test al, EE_DO
@ -936,7 +921,7 @@ ee_read: ; esi = address to read
mov al, EE_CS mov al, EE_CS
out dx, al out dx, al
delay call udelay
loop .loop2 loop .loop2
@ -985,11 +970,11 @@ ee_write: ; esi = address to write to, di = data
or al, EE_DI or al, EE_DI
@@: @@:
out dx, al out dx, al
delay call udelay
and al, not EE_SK and al, not EE_SK
out dx, al out dx, al
delay call udelay
loop .loop loop .loop
@ -1005,11 +990,11 @@ ee_write: ; esi = address to write to, di = data
or al, EE_DI or al, EE_DI
@@: @@:
out dx, al out dx, al
delay call udelay
and al, not EE_SK and al, not EE_SK
out dx, al out dx, al
delay call udelay
loop .loop2 loop .loop2
@ -1032,7 +1017,7 @@ ee_get_width:
mov al, EE_CS ; activate eeprom mov al, EE_CS ; activate eeprom
out dx, al out dx, al
delay call udelay
mov si, EE_READ shl 13 mov si, EE_READ shl 13
xor ecx, ecx xor ecx, ecx
@ -1043,11 +1028,11 @@ ee_get_width:
or al, EE_DI or al, EE_DI
@@: @@:
out dx, al out dx, al
delay call udelay
and al, not EE_SK and al, not EE_SK
out dx, al out dx, al
delay call udelay
inc ecx inc ecx
@ -1076,6 +1061,16 @@ ee_get_width:
ret ret
; Wait a minimum of 2µs
udelay:
pusha
mov esi, 1
invoke Sleep
popa
ret
; cx = phy addr ; cx = phy addr
; dx = phy reg addr ; dx = phy reg addr
@ -1099,7 +1094,7 @@ mdio_read:
out dx, eax out dx, eax
.wait: .wait:
delay call udelay
in eax, dx in eax, dx
test eax, 1 shl 28 ; ready bit test eax, 1 shl 28 ; ready bit
jz .wait jz .wait
@ -1131,7 +1126,7 @@ mdio_write:
out dx, eax out dx, eax
.wait: .wait:
delay call udelay
in eax, dx in eax, dx
test eax, 1 shl 28 ; ready bit test eax, 1 shl 28 ; ready bit
jz .wait jz .wait