Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
97affa39
Commit
97affa39
authored
Apr 30, 2002
by
Kai Germaschewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ISDN: b1dma cleanup: Use readl/writel directly
parent
4b634098
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
54 deletions
+54
-54
drivers/isdn/hardware/avm/b1dma.c
drivers/isdn/hardware/avm/b1dma.c
+54
-54
No files found.
drivers/isdn/hardware/avm/b1dma.c
View file @
97affa39
...
...
@@ -64,7 +64,7 @@ static void b1dma_dispatch_tx(avmcard *card);
# define AVM_FLAG 0x30000000L
# define ANY_S5933_INT 0x00800000L
# define
READ_TC_INT 0x00080000L
# define
READ_TC_INT 0x00080000L
# define WRITE_TC_INT 0x00040000L
# define TX_TC_INT READ_TC_INT
# define RX_TC_INT WRITE_TC_INT
...
...
@@ -83,12 +83,15 @@ static void b1dma_dispatch_tx(avmcard *card);
/* ------------------------------------------------------------- */
#define b1dmaoutmeml(addr, value) writel(value, addr)
#define b1dmainmeml(addr) readl(addr)
#define b1dmaoutmemw(addr, value) writew(value, addr)
#define b1dmainmemw(addr) readw(addr)
#define b1dmaoutmemb(addr, value) writeb(value, addr)
#define b1dmainmemb(addr) readb(addr)
static
inline
void
b1dma_writel
(
avmcard
*
card
,
u32
value
,
int
off
)
{
writel
(
value
,
card
->
mbase
+
off
);
}
static
inline
u32
b1dma_readl
(
avmcard
*
card
,
int
off
)
{
return
readl
(
card
->
mbase
+
off
);
}
/* ------------------------------------------------------------- */
...
...
@@ -215,19 +218,19 @@ static inline u32 _get_slice(void **pp, unsigned char *dp)
void
b1dma_reset
(
avmcard
*
card
)
{
card
->
csr
=
0x0
;
b1dma
outmeml
(
card
->
mbase
+
AMCC_INTCSR
,
card
->
csr
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_MCSR
,
0
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_RXLEN
,
0
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_TXLEN
,
0
);
b1dma
_writel
(
card
,
card
->
csr
,
AMCC_INTCSR
);
b1dma
_writel
(
card
,
0
,
AMCC_MCSR
);
b1dma
_writel
(
card
,
0
,
AMCC_RXLEN
);
b1dma
_writel
(
card
,
0
,
AMCC_TXLEN
);
t1outp
(
card
->
port
,
0x10
,
0x00
);
t1outp
(
card
->
port
,
0x07
,
0x00
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_MCSR
,
0
);
b1dma
_writel
(
card
,
0
,
AMCC_MCSR
);
mdelay
(
10
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_MCSR
,
0x0f000000
);
/* reset all */
b1dma
_writel
(
card
,
0x0f000000
,
AMCC_MCSR
);
/* reset all */
mdelay
(
10
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_MCSR
,
0
);
b1dma
_writel
(
card
,
0
,
AMCC_MCSR
);
if
(
card
->
cardtype
==
avm_t1pci
)
mdelay
(
42
);
else
...
...
@@ -238,31 +241,31 @@ void b1dma_reset(avmcard *card)
int
b1dma_detect
(
avmcard
*
card
)
{
b1dma
outmeml
(
card
->
mbase
+
AMCC_MCSR
,
0
);
b1dma
_writel
(
card
,
0
,
AMCC_MCSR
);
mdelay
(
10
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_MCSR
,
0x0f000000
);
/* reset all */
b1dma
_writel
(
card
,
0x0f000000
,
AMCC_MCSR
);
/* reset all */
mdelay
(
10
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_MCSR
,
0
);
b1dma
_writel
(
card
,
0
,
AMCC_MCSR
);
mdelay
(
42
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_RXLEN
,
0
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_TXLEN
,
0
);
b1dma
_writel
(
card
,
0
,
AMCC_RXLEN
);
b1dma
_writel
(
card
,
0
,
AMCC_TXLEN
);
card
->
csr
=
0x0
;
b1dma
outmeml
(
card
->
mbase
+
AMCC_INTCSR
,
card
->
csr
);
b1dma
_writel
(
card
,
card
->
csr
,
AMCC_INTCSR
);
if
(
b1dma
inmeml
(
card
->
mbase
+
AMCC_MCSR
)
!=
0x000000E6
)
if
(
b1dma
_readl
(
card
,
AMCC_MCSR
)
!=
0x000000E6
)
return
1
;
b1dma
outmeml
(
card
->
mbase
+
AMCC_RXPTR
,
0xffffffff
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_TXPTR
,
0xffffffff
);
if
(
b1dma
inmeml
(
card
->
mbase
+
AMCC_RXPTR
)
!=
0xfffffffc
||
b1dma
inmeml
(
card
->
mbase
+
AMCC_TXPTR
)
!=
0xfffffffc
)
b1dma
_writel
(
card
,
0xffffffff
,
AMCC_RXPTR
);
b1dma
_writel
(
card
,
0xffffffff
,
AMCC_TXPTR
);
if
(
b1dma
_readl
(
card
,
AMCC_RXPTR
)
!=
0xfffffffc
||
b1dma
_readl
(
card
,
AMCC_TXPTR
)
!=
0xfffffffc
)
return
2
;
b1dma
outmeml
(
card
->
mbase
+
AMCC_RXPTR
,
0x0
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_TXPTR
,
0x0
);
if
(
b1dma
inmeml
(
card
->
mbase
+
AMCC_RXPTR
)
!=
0x0
||
b1dma
inmeml
(
card
->
mbase
+
AMCC_TXPTR
)
!=
0x0
)
b1dma
_writel
(
card
,
0x0
,
AMCC_RXPTR
);
b1dma
_writel
(
card
,
0x0
,
AMCC_TXPTR
);
if
(
b1dma
_readl
(
card
,
AMCC_RXPTR
)
!=
0x0
||
b1dma
_readl
(
card
,
AMCC_TXPTR
)
!=
0x0
)
return
3
;
t1outp
(
card
->
port
,
0x10
,
0x00
);
...
...
@@ -354,7 +357,7 @@ static void b1dma_queue_tx(avmcard *card, struct sk_buff *skb)
if
(
!
(
card
->
csr
&
EN_TX_TC_INT
))
{
b1dma_dispatch_tx
(
card
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_INTCSR
,
card
->
csr
);
b1dma
_writel
(
card
,
card
->
csr
,
AMCC_INTCSR
);
}
spin_unlock_irqrestore
(
&
card
->
lock
,
flags
);
...
...
@@ -412,8 +415,8 @@ static void b1dma_dispatch_tx(avmcard *card)
}
txlen
=
(
txlen
+
3
)
&
~
3
;
b1dma
outmeml
(
card
->
mbase
+
AMCC_TXPTR
,
dma
->
sendbuf
.
dmaaddr
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_TXLEN
,
txlen
);
b1dma
_writel
(
card
,
dma
->
sendbuf
.
dmaaddr
,
AMCC_TXPTR
);
b1dma
_writel
(
card
,
txlen
,
AMCC_TXLEN
);
card
->
csr
|=
EN_TX_TC_INT
;
...
...
@@ -574,7 +577,7 @@ static void b1dma_handle_rx(avmcard *card)
static
void
b1dma_handle_interrupt
(
avmcard
*
card
)
{
u32
status
=
b1dma
inmeml
(
card
->
mbase
+
AMCC_INTCSR
);
u32
status
=
b1dma
_readl
(
card
,
AMCC_INTCSR
);
u32
newcsr
;
if
((
status
&
ANY_S5933_INT
)
==
0
)
...
...
@@ -583,7 +586,7 @@ static void b1dma_handle_interrupt(avmcard *card)
newcsr
=
card
->
csr
|
(
status
&
ALL_INT
);
if
(
status
&
TX_TC_INT
)
newcsr
&=
~
EN_TX_TC_INT
;
if
(
status
&
RX_TC_INT
)
newcsr
&=
~
EN_RX_TC_INT
;
b1dma
outmeml
(
card
->
mbase
+
AMCC_INTCSR
,
newcsr
);
b1dma
_writel
(
card
,
newcsr
,
AMCC_INTCSR
);
if
((
status
&
RX_TC_INT
)
!=
0
)
{
struct
avmcard_dmainfo
*
dma
=
card
->
dma
;
...
...
@@ -591,15 +594,13 @@ static void b1dma_handle_interrupt(avmcard *card)
if
(
card
->
dma
->
recvlen
==
0
)
{
dma
->
recvlen
=
*
((
u32
*
)
dma
->
recvbuf
.
dmabuf
);
rxlen
=
(
dma
->
recvlen
+
3
)
&
~
3
;
b1dmaoutmeml
(
card
->
mbase
+
AMCC_RXPTR
,
dma
->
recvbuf
.
dmaaddr
+
4
);
b1dmaoutmeml
(
card
->
mbase
+
AMCC_RXLEN
,
rxlen
);
b1dma_writel
(
card
,
dma
->
recvbuf
.
dmaaddr
+
4
,
AMCC_RXPTR
);
b1dma_writel
(
card
,
rxlen
,
AMCC_RXLEN
);
}
else
{
b1dma_handle_rx
(
card
);
dma
->
recvlen
=
0
;
b1dmaoutmeml
(
card
->
mbase
+
AMCC_RXPTR
,
dma
->
recvbuf
.
dmaaddr
);
b1dmaoutmeml
(
card
->
mbase
+
AMCC_RXLEN
,
4
);
b1dma_writel
(
card
,
dma
->
recvbuf
.
dmaaddr
,
AMCC_RXPTR
);
b1dma_writel
(
card
,
4
,
AMCC_RXLEN
);
}
}
...
...
@@ -611,7 +612,7 @@ static void b1dma_handle_interrupt(avmcard *card)
else
b1dma_dispatch_tx
(
card
);
}
b1dma
outmeml
(
card
->
mbase
+
AMCC_INTCSR
,
card
->
csr
);
b1dma
_writel
(
card
,
card
->
csr
,
AMCC_INTCSR
);
spin_unlock
(
&
card
->
lock
);
}
...
...
@@ -726,19 +727,18 @@ int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data)
}
card
->
csr
=
AVM_FLAG
;
b1dmaoutmeml
(
card
->
mbase
+
AMCC_INTCSR
,
card
->
csr
);
b1dmaoutmeml
(
card
->
mbase
+
AMCC_MCSR
,
EN_A2P_TRANSFERS
|
EN_P2A_TRANSFERS
|
A2P_HI_PRIORITY
|
P2A_HI_PRIORITY
|
RESET_A2P_FLAGS
|
RESET_P2A_FLAGS
);
b1dma_writel
(
card
,
card
->
csr
,
AMCC_INTCSR
);
b1dma_writel
(
card
,
EN_A2P_TRANSFERS
|
EN_P2A_TRANSFERS
|
A2P_HI_PRIORITY
|
P2A_HI_PRIORITY
|
RESET_A2P_FLAGS
|
RESET_P2A_FLAGS
,
AMCC_MCSR
);
t1outp
(
card
->
port
,
0x07
,
0x30
);
t1outp
(
card
->
port
,
0x10
,
0xF0
);
card
->
dma
->
recvlen
=
0
;
b1dma
outmeml
(
card
->
mbase
+
AMCC_RXPTR
,
card
->
dma
->
recvbuf
.
dmaaddr
);
b1dma
outmeml
(
card
->
mbase
+
AMCC_RXLEN
,
4
);
b1dma
_writel
(
card
,
card
->
dma
->
recvbuf
.
dmaaddr
,
AMCC_RXPTR
);
b1dma
_writel
(
card
,
4
,
AMCC_RXLEN
);
card
->
csr
|=
EN_RX_TC_INT
;
b1dma
outmeml
(
card
->
mbase
+
AMCC_INTCSR
,
card
->
csr
);
b1dma
_writel
(
card
,
card
->
csr
,
AMCC_INTCSR
);
b1dma_send_init
(
card
);
...
...
@@ -896,13 +896,13 @@ int b1dmactl_read_proc(char *page, char **start, off_t off,
}
len
+=
sprintf
(
page
+
len
,
"%-16s %s
\n
"
,
"cardname"
,
cinfo
->
cardname
);
txoff
=
(
dma_addr_t
)
b1dma
inmeml
(
card
->
mbase
+
0x2c
)
-
card
->
dma
->
sendbuf
.
dmaaddr
;
txlen
=
b1dma
inmeml
(
card
->
mbase
+
0x30
);
txoff
=
(
dma_addr_t
)
b1dma
_readl
(
card
,
AMCC_TXPTR
)
-
card
->
dma
->
sendbuf
.
dmaaddr
;
txlen
=
b1dma
_readl
(
card
,
AMCC_TXLEN
);
rxoff
=
(
dma_addr_t
)
b1dma
inmeml
(
card
->
mbase
+
0x24
)
-
card
->
dma
->
recvbuf
.
dmaaddr
;
rxlen
=
b1dma
inmeml
(
card
->
mbase
+
0x28
);
rxoff
=
(
dma_addr_t
)
b1dma
_readl
(
card
,
AMCC_RXPTR
)
-
card
->
dma
->
recvbuf
.
dmaaddr
;
rxlen
=
b1dma
_readl
(
card
,
AMCC_RXLEN
);
csr
=
b1dma
inmeml
(
card
->
mbase
+
AMCC_INTCSR
);
csr
=
b1dma
_readl
(
card
,
AMCC_INTCSR
);
len
+=
sprintf
(
page
+
len
,
"%-16s 0x%lx
\n
"
,
"csr (cached)"
,
(
unsigned
long
)
card
->
csr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment