]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From 61730cd8941daf8520b6170a93e6a2db3727a4f1 Mon Sep 17 00:00:00 2001 |
2 | From: mcarlson <mcarlson@unixgrp-03.broadcom.net> | |
3 | Date: Tue, 30 Sep 2008 08:49:06 -0700 | |
4 | Subject: [PATCH 1/2] tg3: Add 57780 ASIC revision | |
5 | Acked-by: Karsten Keil <kkeil@novell.com> | |
6 | Reference: bnc#434147 | |
7 | ||
8 | This patch adds support for the 57780 device. The patch limits the | |
9 | changes to the MAC portion. | |
10 | --- | |
11 | drivers/net/tg3.c | 28 ++++++++++++++++++++++++++-- | |
12 | drivers/net/tg3.h | 5 +++++ | |
13 | 2 files changed, 31 insertions(+), 2 deletions(-) | |
14 | ||
15 | diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c | |
16 | index 71d2c5c..7188675 100644 | |
17 | --- a/drivers/net/tg3.c | |
18 | +++ b/drivers/net/tg3.c | |
19 | @@ -206,6 +206,10 @@ static struct pci_device_id tg3_pci_tbl[] = { | |
20 | {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5761)}, | |
21 | {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5761E)}, | |
22 | {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5785)}, | |
23 | + {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57780)}, | |
24 | + {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57760)}, | |
25 | + {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57790)}, | |
26 | + {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57720)}, | |
27 | {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)}, | |
28 | {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX)}, | |
29 | {PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000)}, | |
30 | @@ -5812,6 +5816,7 @@ static int tg3_chip_reset(struct tg3 *tp) | |
31 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | |
32 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || | |
33 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | |
34 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
35 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | |
36 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) | |
37 | tw32(GRC_FASTBOOT_PC, 0); | |
38 | @@ -7112,6 +7117,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |
39 | return err; | |
40 | ||
41 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5784 && | |
42 | + GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780 && | |
43 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5761 && | |
44 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785) { | |
45 | /* This value is determined during the probe time DMA | |
46 | @@ -7353,6 +7359,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |
47 | RDMAC_MODE_LNGREAD_ENAB); | |
48 | ||
49 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | |
50 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
51 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) | |
52 | rdmac_mode |= RDMAC_MODE_BD_SBD_CRPT_ENAB | | |
53 | RDMAC_MODE_MBUF_RBD_CRPT_ENAB | | |
54 | @@ -7525,6 +7532,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |
55 | if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755) || | |
56 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) || | |
57 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784) || | |
58 | + (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) || | |
59 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) || | |
60 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785)) | |
61 | val |= WDMAC_MODE_STATUS_TAG_FIX; | |
62 | @@ -7589,6 +7597,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |
63 | tp->rx_mode = RX_MODE_ENABLE; | |
64 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | |
65 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | |
66 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
67 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | |
68 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) | |
69 | tp->rx_mode |= RX_MODE_IPV6_CSUM_ENABLE; | |
70 | @@ -9144,6 +9153,7 @@ static int tg3_set_tso(struct net_device *dev, u32 value) | |
71 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | |
72 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 && | |
73 | GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) || | |
74 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
75 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) | |
76 | dev->features |= NETIF_F_TSO_ECN; | |
77 | } else | |
78 | @@ -9402,6 +9412,7 @@ static int tg3_set_tx_csum(struct net_device *dev, u32 data) | |
79 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | |
80 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || | |
81 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | |
82 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
83 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | |
84 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) | |
85 | ethtool_op_set_tx_ipv6_csum(dev, data); | |
86 | @@ -9924,6 +9935,7 @@ static int tg3_test_memory(struct tg3 *tp) | |
87 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | |
88 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || | |
89 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | |
90 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
91 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | |
92 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) | |
93 | mem_tbl = mem_tbl_5755; | |
94 | @@ -10132,6 +10144,7 @@ static int tg3_test_loopback(struct tg3 *tp) | |
95 | return TG3_LOOPBACK_FAILED; | |
96 | ||
97 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | |
98 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
99 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | |
100 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) { | |
101 | int i; | |
102 | @@ -10161,6 +10174,7 @@ static int tg3_test_loopback(struct tg3 *tp) | |
103 | err |= TG3_MAC_LOOPBACK_FAILED; | |
104 | ||
105 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | |
106 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
107 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | |
108 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) { | |
109 | tw32(TG3_CPMU_CTRL, cpmuctrl); | |
110 | @@ -10811,6 +10825,7 @@ static void __devinit tg3_nvram_init(struct tg3 *tp) | |
111 | tg3_get_5755_nvram_info(tp); | |
112 | else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || | |
113 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | |
114 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
115 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) | |
116 | tg3_get_5787_nvram_info(tp); | |
117 | else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) | |
118 | @@ -11141,6 +11156,7 @@ static int tg3_nvram_write_block_buffered(struct tg3 *tp, u32 offset, u32 len, | |
119 | (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5755) && | |
120 | (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5787) && | |
121 | (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5784) && | |
122 | + (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780) && | |
123 | (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5761) && | |
124 | (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785) && | |
125 | (tp->nvram_jedecnum == JEDEC_ST) && | |
126 | @@ -11903,7 +11919,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |
127 | ||
128 | pci_read_config_dword(tp->pdev, TG3PCI_PRODID_ASICREV, | |
129 | &prod_id_asic_rev); | |
130 | - tp->pci_chip_rev_id = prod_id_asic_rev & PROD_ID_ASIC_REV_MASK; | |
131 | + tp->pci_chip_rev_id = prod_id_asic_rev; | |
132 | } | |
133 | ||
134 | /* Wrong chip ID in 5752 A0. This code can be removed later | |
135 | @@ -12057,6 +12073,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |
136 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | |
137 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || | |
138 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | |
139 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
140 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | |
141 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || | |
142 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906 || | |
143 | @@ -12079,6 +12096,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |
144 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | |
145 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || | |
146 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | |
147 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
148 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | |
149 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || | |
150 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) { | |
151 | @@ -12283,6 +12301,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |
152 | } | |
153 | ||
154 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | |
155 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
156 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | |
157 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) { | |
158 | tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT; | |
159 | @@ -12371,6 +12390,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |
160 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | |
161 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || | |
162 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | |
163 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
164 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) { | |
165 | if (tp->pdev->device != PCI_DEVICE_ID_TIGON3_5756 && | |
166 | tp->pdev->device != PCI_DEVICE_ID_TIGON3_5722) | |
167 | @@ -12399,7 +12419,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |
168 | GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_BX) | |
169 | tp->coalesce_mode |= HOSTCC_MODE_32BYTE; | |
170 | ||
171 | - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) | |
172 | + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || | |
173 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) | |
174 | tp->tg3_flags3 |= TG3_FLG3_USE_PHYLIB; | |
175 | ||
176 | err = tg3_mdio_init(tp); | |
177 | @@ -12539,6 +12560,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |
178 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | |
179 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || | |
180 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | |
181 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
182 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | |
183 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || | |
184 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) | |
185 | @@ -13467,6 +13489,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |
186 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | |
187 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 && | |
188 | GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) || | |
189 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
190 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) | |
191 | dev->features |= NETIF_F_TSO_ECN; | |
192 | } | |
193 | @@ -13533,6 +13556,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |
194 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | |
195 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || | |
196 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | |
197 | + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | |
198 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | |
199 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) | |
200 | dev->features |= NETIF_F_IPV6_CSUM; | |
201 | diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h | |
202 | index f5b8cab..06859d1 100644 | |
203 | --- a/drivers/net/tg3.h | |
204 | +++ b/drivers/net/tg3.h | |
205 | @@ -38,6 +38,10 @@ | |
206 | #define TG3PCI_DEVICE_TIGON3_2 0x1645 /* BCM5701 */ | |
207 | #define TG3PCI_DEVICE_TIGON3_3 0x1646 /* BCM5702 */ | |
208 | #define TG3PCI_DEVICE_TIGON3_4 0x1647 /* BCM5703 */ | |
209 | +#define TG3PCI_DEVICE_TIGON3_57780 0x1692 | |
210 | +#define TG3PCI_DEVICE_TIGON3_57760 0x1690 | |
211 | +#define TG3PCI_DEVICE_TIGON3_57790 0x1694 | |
212 | +#define TG3PCI_DEVICE_TIGON3_57720 0x168c | |
213 | #define TG3PCI_COMMAND 0x00000004 | |
214 | #define TG3PCI_STATUS 0x00000006 | |
215 | #define TG3PCI_CCREVID 0x00000008 | |
216 | @@ -129,6 +133,7 @@ | |
217 | #define ASIC_REV_5784 0x5784 | |
218 | #define ASIC_REV_5761 0x5761 | |
219 | #define ASIC_REV_5785 0x5785 | |
220 | +#define ASIC_REV_57780 0x57780 | |
221 | #define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) | |
222 | #define CHIPREV_5700_AX 0x70 | |
223 | #define CHIPREV_5700_BX 0x71 | |
224 | -- | |
225 | 1.5.6.4 | |
226 |