Subversion Repositories Kolibri OS

Rev

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

Rev 4629 Rev 5004
Line 105... Line 105...
105
        CSR_CHIPID0             = 0x58
105
        CSR_CHIPID0             = 0x58
106
        CSR_CHIPID1             = 0x59
106
        CSR_CHIPID1             = 0x59
Line 107... Line 107...
107
 
107
 
Line 108... Line 108...
108
; Control and Status Register (CSR0)
108
; Control and Status Register (CSR0)
109
 
109
 
110
        CSR_INIT                = 1 shl 0
110
        CSR_INIT                = 0x0001 ;1 shl 0
111
        CSR_START               = 1 shl 1
111
        CSR_START               = 0x0002 ;1 shl 1
112
        CSR_STOP                = 1 shl 2
112
        CSR_STOP                = 0x0004 ;1 shl 2
113
        CSR_TX                  = 1 shl 3
113
        CSR_TX                  = 0x0008 ;1 shl 3
114
        CSR_TXON                = 1 shl 4
114
        CSR_TXON                = 0x0010 ;1 shl 4
115
        CSR_RXON                = 1 shl 5
115
        CSR_RXON                = 0x0020 ;1 shl 5
116
        CSR_INTEN               = 1 shl 6
116
        CSR_INTEN               = 0x0040 ;1 shl 6
117
        CSR_INTR                = 1 shl 7
117
        CSR_INTR                = 0x0080 ;1 shl 7
118
        CSR_IDONE               = 1 shl 8
118
        CSR_IDONE               = 0x0100 ;1 shl 8
119
        CSR_TINT                = 1 shl 9
119
        CSR_TINT                = 0x0200 ;1 shl 9
120
        CSR_RINT                = 1 shl 10
120
        CSR_RINT                = 0x0400 ;1 shl 10
121
        CSR_MERR                = 1 shl 11
121
        CSR_MERR                = 0x0800 ;1 shl 11
Line 122... Line 122...
122
        CSR_MISS                = 1 shl 12
122
        CSR_MISS                = 0x1000 ;1 shl 12
Line 123... Line 123...
123
        CSR_CERR                = 1 shl 13
123
        CSR_CERR                = 0x2000 ;1 shl 13
124
 
124
 
Line 133... Line 133...
133
        IMR_TINT                = 0x0200
133
        IMR_TINT                = 0x0200
134
        IMR_RINT                = 0x0400
134
        IMR_RINT                = 0x0400
135
        IMR_MERR                = 0x0800
135
        IMR_MERR                = 0x0800
136
        IMR_MISS                = 0x1000
136
        IMR_MISS                = 0x1000
Line -... Line 137...
-
 
137
 
137
 
138
        ; Masked interrupts will be disabled.
Line 138... Line 139...
138
        IMR                     = IMR_IDONE ; IMR_TINT + IMR_RINT + IMR_MERR + IMR_MISS ;+ IMR_IDONE
139
        IMR                     = 0 ;IMR_IDONE ;or IMR_TINT or IMR_RINT or IMR_MERR or IMR_MISS
Line 139... Line 140...
139
 
140
 
140
; Test and features control (CSR4)
141
; Test and features control (CSR4)
Line 1073... Line 1074...
1073
        push    ecx
1074
        push    ecx
1074
        xor     ecx, ecx                        ; CSR0
1075
        xor     ecx, ecx                        ; CSR0
1075
        call    [ebx + device.read_csr]         ; get IRQ reason
1076
        call    [ebx + device.read_csr]         ; get IRQ reason
1076
        call    [ebx + device.write_csr]        ; write it back to ACK
1077
        call    [ebx + device.write_csr]        ; write it back to ACK
1077
        pop     ecx
1078
        pop     ecx
1078
        and     ax, CSR_RINT or CSR_TINT
1079
;;;        and     ax, CSR_RINT or CSR_TINT
-
 
1080
        test    ax, ax
1079
        jnz     .got_it
1081
        jnz     .got_it
1080
  .continue:
1082
  .continue:
1081
        add     esi, 4
1083
        add     esi, 4
1082
        dec     ecx
1084
        dec     ecx
1083
        jnz     .nextdevice
1085
        jnz     .nextdevice
Line 1086... Line 1088...
1086
        xor     eax, eax
1088
        xor     eax, eax
Line 1087... Line 1089...
1087
 
1089
 
Line 1088... Line 1090...
1088
        ret
1090
        ret
1089
 
1091
 
Line 1090... Line 1092...
1090
  .got_it:
1092
  .got_it:
1091
        DEBUGF  1,"Device: %x status: %x\n", ebx, eax:4
1093
        DEBUGF  2,"Device: %x status: %x\n", ebx, eax:4
1092
 
1094
 
Line 1511... Line 1513...
1511
 
1513
 
1512
        mov     ecx, BCR_LED0
1514
        mov     ecx, BCR_LED0
1513
        call    [ebx + device.read_bcr]
1515
        call    [ebx + device.read_bcr]
Line 1514... Line 1516...
1514
        cmp     eax, 0xc0
1516
        cmp     eax, 0xc0
Line 1515... Line 1517...
1515
 
1517