Kernel version 0.9 : UTHERNET, Rewritten driver optimized for speed

This commit is contained in:
Rémy GIBERT 2017-03-17 17:50:32 +01:00
parent 97da1b9d5e
commit e61879d840
5 changed files with 51 additions and 42 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -59,12 +59,12 @@ Dev.Detect >STYA ARGS
lda #PP.ID lda #PP.ID
sta PacketPagePTR,x sta PacketPagePTR,x
lda PacketPageDATA,x lda PacketPageDATA+1,x
ldy PacketPageDATA,x
cmp /DEVID cmp /DEVID
bne .2 bne .2
lda PacketPageDATA+1,x cpy #DEVID
cmp #DEVID
beq .3 beq .3
.2 dec DEV.HEADER.NAME+4 .2 dec DEV.HEADER.NAME+4
@ -91,15 +91,15 @@ Dev.Detect >STYA ARGS
lda #A2osX.SLOTS.NET lda #A2osX.SLOTS.NET
sta A2osX.SLOTS,y sta A2osX.SLOTS,y
lda /PP.ID+2 Get Revision# of ths chip... lda /PP.REVISION Get Revision# of ths chip...
sta PacketPagePTR+1,x sta PacketPagePTR+1,x
lda #PP.ID+2 lda #PP.REVISION
sta PacketPagePTR,x sta PacketPagePTR,x
lda PacketPageDATA,x
sta DEVSTAT+S.DEVSTAT.VERSION
lda PacketPageDATA+1,x lda PacketPageDATA+1,x
sta DEVSTAT+S.DEVSTAT.VERSION+1 set Hardware version sta DEVSTAT+S.DEVSTAT.VERSION+1 set Hardware version
lda PacketPageDATA,x
sta DEVSTAT+S.DEVSTAT.VERSION
>LDYA ARGS >LDYA ARGS
>STYA ZPTmpPTR >STYA ZPTmpPTR
@ -178,6 +178,7 @@ STATUS lda #S.DEVSTAT.NET.STATUS.10
lda #PP.LineST lda #PP.LineST
sta PacketPagePTR,x sta PacketPagePTR,x
lda PacketPageDATA+1,x
lda PacketPageDATA,x lda PacketPageDATA,x
and #PP.LineST.LinkOK and #PP.LineST.LinkOK
beq .1 beq .1
@ -192,6 +193,7 @@ STATUS lda #S.DEVSTAT.NET.STATUS.10
sta PacketPagePTR,x sta PacketPagePTR,x
lda PacketPageDATA+1,x lda PacketPageDATA+1,x
ldy PacketPageDATA,x
and /PP.TestCTL.FDX and /PP.TestCTL.FDX
beq .2 beq .2
@ -215,7 +217,7 @@ READBLOCK php
lda PacketPageDATA+1,x lda PacketPageDATA+1,x
ldy PacketPageDATA,x ldy PacketPageDATA,x
and /PP.RxEvent.RxOK+PP.RxEvent.Brdcast+PP.RxEvent.IA and /PP.RxEvent.RxOK+PP.RxEvent.IA+PP.RxEvent.Brdcast+PP.RxEvent.Runt
beq .9 beq .9
lda RTDATA+1,x discard RxStatus lda RTDATA+1,x discard RxStatus
@ -228,11 +230,9 @@ READBLOCK php
sta Size sta Size
clc clc
adc #2 adc #2
bcc .1 >PUSHA Size+2
iny
.1 >PUSHA Size+2
tya tya
adc #0
>PUSHA >PUSHA
>PUSHBI 0 >PUSHBI 0
>SYSCALL GetMem >SYSCALL GetMem
@ -307,16 +307,6 @@ WRITEBLOCK php
dex dex
bpl .10 bpl .10
lda (ZPTmpPTR)
sta Size
eor #$ff
sta Counter
ldy #1
lda (ZPTmpPTR),y
sta Size+1
eor #$ff
sta Counter+1
ldx DEVSLOTx0 ldx DEVSLOTx0
lda /PP.TxCMD.LID+PP.TxCMD.TxStartFULL lda /PP.TxCMD.LID+PP.TxCMD.TxStartFULL
@ -324,10 +314,16 @@ WRITEBLOCK php
lda #PP.TxCMD.LID+PP.TxCMD.TxStartFULL lda #PP.TxCMD.LID+PP.TxCMD.TxStartFULL
sta TxCMD,x sta TxCMD,x
lda Size+1 ldy #1
lda (ZPTmpPTR),y
sta TxLength+1,x sta TxLength+1,x
lda Size eor #$ff
sta Counter+1
lda (ZPTmpPTR)
sta TxLength,x sta TxLength,x
eor #$ff
sta Counter
lda /PP.BusST lda /PP.BusST
sta PacketPagePTR+1,x sta PacketPagePTR+1,x
@ -336,14 +332,14 @@ WRITEBLOCK php
ldy #16 ldy #16
.1 lda PacketPageDATA,x .1 lda PacketPageDATA+1,x
and #PP.BusST.TxBidErr
bne .9
lda PacketPageDATA+1,x
and /PP.BusST.Rdy4TxNOW and /PP.BusST.Rdy4TxNOW
bne WRITEBLOCK.1 bne WRITEBLOCK.1
lda PacketPageDATA,x
and #PP.BusST.TxBidErr
bne .9
dey dey
bne .1 bne .1
@ -382,10 +378,16 @@ WRITEBLOCK.1 ldy #2
rts rts
*-------------------------------------- *--------------------------------------
OPEN jsr CLOSE OPEN jsr CLOSE
>LDYAI PP.RxCTL
>STYA PacketPagePTR,x lda /PP.RxCTL
>LDYAI PP.RxCTL.LID+PP.RxCTL.RxOKA+PP.RxCTL.IA+PP.RxCTL.BroadcastA+PP.RxCTL.RuntA sta PacketPagePTR+1,x
>STYA PacketPageDATA,x lda #PP.RxCTL
sta PacketPagePTR,x
lda /PP.RxCTL.LID+PP.RxCTL.RxOKA+PP.RxCTL.IA+PP.RxCTL.BroadcastA+PP.RxCTL.RuntA
sta PacketPageDATA+1,x
lda #PP.RxCTL.LID+PP.RxCTL.RxOKA+PP.RxCTL.IA+PP.RxCTL.BroadcastA+PP.RxCTL.RuntA
sta PacketPageDATA,x
>LDYAI PP.MAC >LDYAI PP.MAC
>STYA PacketPagePTR,x >STYA PacketPagePTR,x
@ -400,10 +402,16 @@ OPEN jsr CLOSE
>LDYA MAC+4 >LDYA MAC+4
>STYA PacketPageDATA,x >STYA PacketPageDATA,x
>LDYAI PP.LineCTL lda /PP.LineCTL
>STYA PacketPagePTR,x sta PacketPagePTR+1,x
>LDYAI PP.LineCTL.LID+PP.LineCTL.SerRxOn+PP.LineCTL.SerTxOn+PP.LineCTL.10BaseT lda #PP.LineCTL
>STYA PacketPageDATA,x sta PacketPagePTR,x
lda /PP.LineCTL.LID+PP.LineCTL.SerRxOn+PP.LineCTL.SerTxOn+PP.LineCTL.10BaseT
sta PacketPageDATA+1,x
lda #PP.LineCTL.LID+PP.LineCTL.SerRxOn+PP.LineCTL.SerTxOn+PP.LineCTL.10BaseT
sta PacketPageDATA,x
clc clc
rts rts
*-------------------------------------- *--------------------------------------

View File

@ -7,7 +7,7 @@ AUTO 6
*-------------------------------------- *--------------------------------------
* CS8900A IO Registers * CS8900A IO Registers
*-------------------------------------- *--------------------------------------
DEVID .EQ $0E63 DEVID .EQ $630E
*-------------------------------------- *--------------------------------------
RTDATA .EQ $C080 Receive/Transmit Data (DWORD) RTDATA .EQ $C080 Receive/Transmit Data (DWORD)
TxCMD .EQ $C084 Transmit Command TxCMD .EQ $C084 Transmit Command
@ -17,6 +17,7 @@ PacketPagePTR .EQ $C08A PacketPage Pointer
PacketPageDATA .EQ $C08C PacketPage Data (DWORD) PacketPageDATA .EQ $C08C PacketPage Data (DWORD)
*-------------------------------------- *--------------------------------------
PP.ID .EQ $0000 Product ID code (RO) PP.ID .EQ $0000 Product ID code (RO)
PP.REVISION .EQ $0002 Product Revision (RO)
PP.RFBCNT .EQ $0050 Received Frame Byte Counter (RO) PP.RFBCNT .EQ $0050 Received Frame Byte Counter (RO)
PP.RxCFG .EQ $0102 Receiver Configuration (RW) PP.RxCFG .EQ $0102 Receiver Configuration (RW)
PP.RxCFG.LID .EQ %00000000.00000011 PP.RxCFG.LID .EQ %00000000.00000011
@ -34,9 +35,9 @@ PP.RxCTL.RuntA .EQ %00100000.00000000
PP.TxCFG .EQ $0106 Transmit Configuration (RW) PP.TxCFG .EQ $0106 Transmit Configuration (RW)
PP.TxCMD .EQ $0108 Receiver Control (RW) PP.TxCMD .EQ $0108 Receiver Control (RW)
PP.TxCMD.LID .EQ %00000000.00001001 PP.TxCMD.LID .EQ %00000000.00001001
*PP.TxCMD.TxStart5 .EQ %00000000.00000000 PP.TxCMD.TxStart5 .EQ %00000000.00000000
*PP.TxCMD.TxStart381 .EQ %00000000.01000000 PP.TxCMD.TxStart381 .EQ %00000000.01000000
*PP.TxCMD.TxStart1021 .EQ %00000000.10000000 PP.TxCMD.TxStart1021 .EQ %00000000.10000000
PP.TxCMD.TxStartFULL .EQ %00000000.11000000 PP.TxCMD.TxStartFULL .EQ %00000000.11000000
*PP.TxCMD.Force .EQ %00000001.00000000 *PP.TxCMD.Force .EQ %00000001.00000000
*PP.TxCMD.OneColl .EQ %00000010.00000000 *PP.TxCMD.OneColl .EQ %00000010.00000000