Lines Matching +full:eeprom +full:- +full:name

2 	drivers/net/ethernet/dec/tulip/eeprom.c
5 Written/copyright 1994-2001 by Donald Becker.
20 /* Serial EEPROM section. */
27 /* Known cards that have old-style EEPROMs. */
33 0x0004, 0x009E, /* 10baseT-FD */
35 0x0905, 0x006D, /* 100baseTx-FD */ }},
38 0x0108, 0x8021, /* 100baseFx-FD */
40 0x0104, 0x009E, /* 10baseT-FD */
42 0x0105, 0x006D, /* 100baseTx-FD */ }},
43 {"Maxtech NX-110", 0, 0, 0xE8, { 0x1e00, 0x0000, 0x0800, 0x0513,
46 0x0004, 0x009E, /* 10baseT-FD */
48 0x0305, 0x006D, /* 100baseTx-FD CSR12 0x03 */}},
52 0x0B04, 0x009E, /* 10baseT-FD,CSR12 0x0B */
54 0x1B05, 0x006D, /* 100baseTx-FD CSR12 0x1B */
82 "21140 non-MII",
92 * tulip_build_fake_mediatable - Build a fake mediatable entry.
100 * Since this is currently a parisc-linux specific function, the
102 * non-parisc hardware.
107 if (tp->flags & NEEDS_FAKE_MEDIA_TABLE) { in tulip_build_fake_mediatable()
120 tp->mtable = devm_kmalloc(&tp->pdev->dev, sizeof(struct mediatable) + in tulip_build_fake_mediatable()
123 if (tp->mtable == NULL) in tulip_build_fake_mediatable()
126 tp->mtable->defaultmedia = 0x800; in tulip_build_fake_mediatable()
127 tp->mtable->leafcount = 1; in tulip_build_fake_mediatable()
128 tp->mtable->csr12dir = 0x3f; /* inputs on bit7 for hsc-pci, bit6 for pci-fx */ in tulip_build_fake_mediatable()
129 tp->mtable->has_nonmii = 0; in tulip_build_fake_mediatable()
130 tp->mtable->has_reset = 0; in tulip_build_fake_mediatable()
131 tp->mtable->has_mii = 1; in tulip_build_fake_mediatable()
132 tp->mtable->csr15dir = tp->mtable->csr15val = 0; in tulip_build_fake_mediatable()
133 tp->mtable->mleaf[0].type = 1; in tulip_build_fake_mediatable()
134 tp->mtable->mleaf[0].media = 11; in tulip_build_fake_mediatable()
135 tp->mtable->mleaf[0].leafdata = &leafdata[0]; in tulip_build_fake_mediatable()
136 tp->flags |= HAS_PHY_IRQ; in tulip_build_fake_mediatable()
137 tp->csr12_shadow = -1; in tulip_build_fake_mediatable()
146 use dev_<level> or netdev_<level> but dev->name is good via a in tulip_parse_eeprom()
155 unsigned char *ee_data = tp->eeprom; in tulip_parse_eeprom()
158 tp->mtable = NULL; in tulip_parse_eeprom()
159 /* Detect an old-style (SA only) EEPROM layout: in tulip_parse_eeprom()
169 dev->name, controller_index); in tulip_parse_eeprom()
170 tp->mtable = last_mediatable; in tulip_parse_eeprom()
174 pr_info("%s: Missing EEPROM, this interface may not work correctly!\n", in tulip_parse_eeprom()
175 dev->name); in tulip_parse_eeprom()
178 /* Do a fix-up based on the vendor half of the station address prefix. */ in tulip_parse_eeprom()
179 for (i = 0; eeprom_fixups[i].name; i++) { in tulip_parse_eeprom()
180 if (dev->dev_addr[0] == eeprom_fixups[i].addr0 && in tulip_parse_eeprom()
181 dev->dev_addr[1] == eeprom_fixups[i].addr1 && in tulip_parse_eeprom()
182 dev->dev_addr[2] == eeprom_fixups[i].addr2) { in tulip_parse_eeprom()
183 if (dev->dev_addr[2] == 0xE8 && ee_data[0x1a] == 0x55) in tulip_parse_eeprom()
187 pr_info("%s: Old format EEPROM on '%s' board. Using substitute media control info\n", in tulip_parse_eeprom()
188 dev->name, eeprom_fixups[i].name); in tulip_parse_eeprom()
192 if (eeprom_fixups[i].name == NULL) { /* No fixup found. */ in tulip_parse_eeprom()
193 pr_info("%s: Old style EEPROM with no media selection information\n", in tulip_parse_eeprom()
194 dev->name); in tulip_parse_eeprom()
215 if (tp->flags & CSR12_IN_SROM) in tulip_parse_eeprom()
223 dev->name); in tulip_parse_eeprom()
227 mtable = devm_kmalloc(&tp->pdev->dev, struct_size(mtable, mleaf, count), in tulip_parse_eeprom()
231 last_mediatable = tp->mtable = mtable; in tulip_parse_eeprom()
232 mtable->defaultmedia = media; in tulip_parse_eeprom()
233 mtable->leafcount = count; in tulip_parse_eeprom()
234 mtable->csr12dir = csr12dir; in tulip_parse_eeprom()
235 mtable->has_nonmii = mtable->has_mii = mtable->has_reset = 0; in tulip_parse_eeprom()
236 mtable->csr15dir = mtable->csr15val = 0; in tulip_parse_eeprom()
238 pr_info("%s: EEPROM default media type %s\n", in tulip_parse_eeprom()
239 dev->name, in tulip_parse_eeprom()
243 struct medialeaf *leaf = &mtable->mleaf[i]; in tulip_parse_eeprom()
246 leaf->type = 0; in tulip_parse_eeprom()
247 leaf->media = p[0] & 0x3f; in tulip_parse_eeprom()
248 leaf->leafdata = p; in tulip_parse_eeprom()
250 mtable->has_mii = 1; in tulip_parse_eeprom()
253 leaf->type = p[1]; in tulip_parse_eeprom()
255 mtable->has_reset = i; in tulip_parse_eeprom()
256 leaf->media = p[2] & 0x0f; in tulip_parse_eeprom()
257 } else if (tp->chip_id == DM910X && p[1] == 0x80) { in tulip_parse_eeprom()
259 mtable->leafcount--; in tulip_parse_eeprom()
260 count--; in tulip_parse_eeprom()
261 i--; in tulip_parse_eeprom()
262 leaf->leafdata = p + 2; in tulip_parse_eeprom()
268 mtable->has_mii = 1; in tulip_parse_eeprom()
269 leaf->media = 11; in tulip_parse_eeprom()
274 mtable->has_nonmii = 1; in tulip_parse_eeprom()
275 leaf->media = p[2] & MEDIA_MASK; in tulip_parse_eeprom()
277 if (tp->chip_id == DM910X && leaf->media == 1) in tulip_parse_eeprom()
278 leaf->media = 3; in tulip_parse_eeprom()
279 switch (leaf->media) { in tulip_parse_eeprom()
286 if (p[1] == 2 && leaf->media == 0) { in tulip_parse_eeprom()
289 mtable->csr15dir = in tulip_parse_eeprom()
291 mtable->csr15val = in tulip_parse_eeprom()
294 mtable->csr15dir = get_unaligned((u16*)&p[3])<<16; in tulip_parse_eeprom()
295 mtable->csr15val = get_unaligned((u16*)&p[5])<<16; in tulip_parse_eeprom()
299 leaf->leafdata = p + 2; in tulip_parse_eeprom()
302 if (tulip_debug > 1 && leaf->media == 11) { in tulip_parse_eeprom()
303 unsigned char *bp = leaf->leafdata; in tulip_parse_eeprom()
305 dev->name, in tulip_parse_eeprom()
310 pr_info("%s: Index #%d - Media %s (#%d) described by a %s (%d) block\n", in tulip_parse_eeprom()
311 dev->name, in tulip_parse_eeprom()
312 i, medianame[leaf->media & 15], leaf->media, in tulip_parse_eeprom()
313 leaf->type < ARRAY_SIZE(block_name) ? block_name[leaf->type] : "<unknown>", in tulip_parse_eeprom()
314 leaf->type); in tulip_parse_eeprom()
317 tp->sym_advertise = new_advertise; in tulip_parse_eeprom()
320 /* Reading a serial EEPROM is a "bit" grungy, but we work our way through:->.*/
323 #define EE_SHIFT_CLK 0x02 /* EEPROM shift clock. */
324 #define EE_CS 0x01 /* EEPROM chip select. */
325 #define EE_DATA_WRITE 0x04 /* Data from the Tulip to EEPROM. */
328 #define EE_DATA_READ 0x08 /* Data from the EEPROM chip. */
331 /* Delay between EEPROM clock transitions.
332 Even at 33Mhz current PCI implementations don't overrun the EEPROM clock.
333 We add a bus turn-around to insure that this remains true. */
336 /* The EEPROM commands include the alway-set leading bit. */
345 void __iomem *ee_addr = tp->base_addr + CSR9; in tulip_read_eeprom()
351 if (location > (1 << addr_len) - 1) in tulip_read_eeprom()
358 for (i = 4 + addr_len; i >= 0; i--) { in tulip_read_eeprom()
369 for (i = 16; i > 0; i--) { in tulip_read_eeprom()
377 /* Terminate the EEPROM access. */ in tulip_read_eeprom()
379 return (tp->flags & HAS_SWAPPED_SEEPROM) ? swab16(retval) : retval; in tulip_read_eeprom()