Blame view
drivers/net/ax88796.h
2.22 KB
83d290c56 SPDX: Convert all... |
1 |
/* SPDX-License-Identifier: GPL-2.0+ */ |
6a8a5dc47 net: Add support ... |
2 3 4 5 |
/* * AX88796L(NE2000) support * * (c) 2007 Nobuhiro Iwamatsu <iwamatsu@nigauri.org> |
6a8a5dc47 net: Add support ... |
6 7 8 9 |
*/ #ifndef __DRIVERS_AX88796L_H__ #define __DRIVERS_AX88796L_H__ |
4acbc6c7f NE2000: coding st... |
10 11 12 13 14 15 16 |
#define DP_DATA (0x10 << 1) #define START_PG 0x40 /* First page of TX buffer */ #define START_PG2 0x48 #define STOP_PG 0x80 /* Last page +1 of RX ring */ #define TX_PAGES 12 #define RX_START (START_PG+TX_PAGES) #define RX_END STOP_PG |
6a8a5dc47 net: Add support ... |
17 18 |
#define AX88796L_BASE_ADDRESS CONFIG_DRIVER_NE2000_BASE |
4acbc6c7f NE2000: coding st... |
19 20 21 |
#define AX88796L_BYTE_ACCESS 0x00001000 #define AX88796L_OFFSET 0x00000400 #define AX88796L_ADDRESS_BYTE AX88796L_BASE_ADDRESS + \ |
6a8a5dc47 net: Add support ... |
22 |
AX88796L_BYTE_ACCESS + AX88796L_OFFSET |
4acbc6c7f NE2000: coding st... |
23 24 |
#define AX88796L_REG_MEMR AX88796L_ADDRESS_BYTE + (0x14<<1) #define AX88796L_REG_CR AX88796L_ADDRESS_BYTE + (0x00<<1) |
6a8a5dc47 net: Add support ... |
25 26 |
#define AX88796L_CR (*(vu_short *)(AX88796L_REG_CR)) |
4acbc6c7f NE2000: coding st... |
27 |
#define AX88796L_MEMR (*(vu_short *)(AX88796L_REG_MEMR)) |
6a8a5dc47 net: Add support ... |
28 29 30 31 32 33 34 35 36 37 38 |
#define EECS_HIGH (AX88796L_MEMR |= 0x10) #define EECS_LOW (AX88796L_MEMR &= 0xef) #define EECLK_HIGH (AX88796L_MEMR |= 0x80) #define EECLK_LOW (AX88796L_MEMR &= 0x7f) #define EEDI_HIGH (AX88796L_MEMR |= 0x20) #define EEDI_LOW (AX88796L_MEMR &= 0xdf) #define EEDO ((AX88796L_MEMR & 0x40)>>6) #define PAGE0_SET (AX88796L_CR &= 0x3f) #define PAGE1_SET (AX88796L_CR = (AX88796L_CR & 0x3f) | 0x40) |
4acbc6c7f NE2000: coding st... |
39 |
#define BIT_DUMMY 0 |
6a8a5dc47 net: Add support ... |
40 41 42 43 44 45 46 47 |
#define MAC_EEP_READ 1 #define MAC_EEP_WRITE 2 #define MAC_EEP_ERACE 3 #define MAC_EEP_EWEN 4 #define MAC_EEP_EWDS 5 /* R7780MP Specific code */ #if defined(CONFIG_R7780MP) |
4acbc6c7f NE2000: coding st... |
48 49 |
#define ISA_OFFSET 0x1400 #define DP_IN(_b_, _o_, _d_) (_d_) = \ |
6a8a5dc47 net: Add support ... |
50 51 52 |
*( (vu_short *) ((_b_) + ((_o_) * 2) + ISA_OFFSET)) #define DP_OUT(_b_, _o_, _d_) \ *((vu_short *)((_b_) + ((_o_) * 2) + ISA_OFFSET)) = (_d_) |
4acbc6c7f NE2000: coding st... |
53 54 |
#define DP_IN_DATA(_b_, _d_) (_d_) = *( (vu_short *) ((_b_) + ISA_OFFSET)) #define DP_OUT_DATA(_b_, _d_) *( (vu_short *) ((_b_)+ISA_OFFSET)) = (_d_) |
6a8a5dc47 net: Add support ... |
55 56 |
#else /* Please change for your target boards */ |
4acbc6c7f NE2000: coding st... |
57 58 59 60 61 |
#define ISA_OFFSET 0x0000 #define DP_IN(_b_, _o_, _d_) (_d_) = *( (vu_short *)((_b_)+(_o_ )+ISA_OFFSET)) #define DP_OUT(_b_, _o_, _d_) *((vu_short *)((_b_)+(_o_)+ISA_OFFSET)) = (_d_) #define DP_IN_DATA(_b_, _d_) (_d_) = *( (vu_short *) ((_b_)+ISA_OFFSET)) #define DP_OUT_DATA(_b_, _d_) *( (vu_short *) ((_b_)+ISA_OFFSET)) = (_d_) |
6a8a5dc47 net: Add support ... |
62 |
#endif |
6a8a5dc47 net: Add support ... |
63 |
#endif /* __DRIVERS_AX88796L_H__ */ |