It is nifty,
it is suppose to support 10base-2/5/T and 100base-? in one
chip. I am trying to get it to run against our 10base-2 net.
but the '42 has a different SROM format for the "infoleaf".
Are you interested in looking at the Digital documentation on the
SROM/EEPROM format? (I'm out of town right now, and won't be able to look
at it until next week.)
I found it on the net, I attached a working '42/SROM reading patch
below. It does not run with this patch only only reads the SROM
correctly.
regards,
-- --------------------------------------------------------- Göran Thyni <mailto:goran@kyla.kiruna.se> <http://kyla.kiruna.se/~goran/> #include <stddiscl.h> Jos sepän sälli mie olisin, niin raudasta heilanin takoisin.
---------------------- snip --------------------------------
cd /usr/src/2.0/linuxPP/drivers/net/ diff -c /usr/src/2.0/linuxPP/drivers/net/tulip.c-21140a /usr/src/2.0/linuxPP/drivers/net/tulip.c *** /usr/src/2.0/linuxPP/drivers/net/tulip.c-21140a Tue Nov 19 19:53:13 1996 --- /usr/src/2.0/linuxPP/drivers/net/tulip.c Thu Nov 21 15:40:33 1996 *************** *** 307,313 **** struct mediainfo { struct mediainfo *next; int info_type; ! struct non_mii { char media; unsigned char csr12val; char bitnum, flags;} non_mii; unsigned char *mii; } *mediainfo; struct mediainfo *cur_mediainfo; --- 308,319 ---- struct mediainfo { struct mediainfo *next; int info_type; ! struct non_mii { ! char media; ! unsigned char csr12val; ! char bitnum, flags; ! unsigned short gppc42, gppd42; ! } non_mii; unsigned char *mii; } *mediainfo; struct mediainfo *cur_mediainfo; *************** *** 615,622 **** unsigned char *ee_data = tp->eeprom; struct infoleaf { short media; unsigned char csr12val; char count; } *infoleaf; ! int i, j; ! { static int done_did_that = 0; if (done_did_that++ == 0) --- 622,629 ---- unsigned char *ee_data = tp->eeprom; struct infoleaf { short media; unsigned char csr12val; char count; } *infoleaf; ! struct infoleaf42 { short media; char count; } *infoleaf42; ! int i, j, leafcount; { static int done_did_that = 0; if (done_did_that++ == 0) *************** *** 663,684 **** read_eeprom(ioaddr, i)); } } ! infoleaf = (void *)ee_data + ee_data[27]; tp->csr12 = infoleaf->csr12val; - printk("\n%s: Leaf node at %d, media %4.4x, csr12 %2.2x, %d blocks.\n", - dev->name, ee_data[27], infoleaf->media, tp->csr12, - infoleaf->count); j = ee_data[27] + 4; ! for (i = infoleaf->count; i; i--) { if (ee_data[j] & 0x80) { /* Extended block */ int blk_type = ee_data[j+1]; unsigned char *p = &ee_data[j+2]; ! printk("%s: Extended block for PHY %d, type %d length %d.\n", ! dev->name, blk_type, ee_data[j+2], ee_data[j] & 0x7f); switch (blk_type) { case 0: minfo = kmalloc(sizeof(struct mediainfo), GFP_KERNEL); ! minfo->info_type = 0; minfo->non_mii.media = *p++; minfo->non_mii.csr12val = *p++; minfo->non_mii.bitnum = *p++; --- 670,699 ---- read_eeprom(ioaddr, i)); } } ! infoleaf = infoleaf42 = (void *)ee_data + ee_data[27]; tp->csr12 = infoleaf->csr12val; j = ee_data[27] + 4; ! leafcount = infoleaf->count; ! if (tp->chip_id == DC21142) ! { ! tp->csr12 = 0; ! j = ee_data[27] + 3; ! leafcount = infoleaf42->count; ! } ! printk("\n%s: " ! "Leaf node at %d, media %4.4x, csr12 %2.2x, %d blocks.\n", ! dev->name, ee_data[27], infoleaf->media, tp->csr12, ! leafcount); ! for (i = leafcount; i > 0; i--) { if (ee_data[j] & 0x80) { /* Extended block */ int blk_type = ee_data[j+1]; unsigned char *p = &ee_data[j+2]; ! printk("%s: Extended block for PHY %d, type %d length %d j=%d.\n", ! dev->name, blk_type, ee_data[j+2], ee_data[j] & 0x7f, j); switch (blk_type) { case 0: minfo = kmalloc(sizeof(struct mediainfo), GFP_KERNEL); ! minfo->info_type = blk_type; minfo->non_mii.media = *p++; minfo->non_mii.csr12val = *p++; minfo->non_mii.bitnum = *p++; *************** *** 685,690 **** --- 700,706 ---- minfo->non_mii.flags = *p++; minfo->next = tp->mediainfo; tp->mediainfo = minfo; + j += (ee_data[j] & 0x7f) + 1; printk("%s: Non-MII transceiver with media %d (%s).\n" "%s: Control port setting %2.2x, command %2.2x %2.2x.\n", dev->name, minfo->non_mii.media, *************** *** 694,702 **** printk("%s: Media detection by looking for a %d on bit %d of the" " control port.\n", dev->name, minfo->non_mii.bitnum >= 0, (minfo->non_mii.bitnum >> 1) & 7); case 1: minfo = kmalloc(sizeof(struct mediainfo), GFP_KERNEL); ! minfo->info_type = 1; minfo->mii = p; minfo->next = tp->mediainfo; tp->mediainfo = minfo; --- 710,740 ---- printk("%s: Media detection by looking for a %d on bit %d of the" " control port.\n", dev->name, minfo->non_mii.bitnum >= 0, (minfo->non_mii.bitnum >> 1) & 7); + break; + case 2: + minfo = kmalloc(sizeof(struct mediainfo), GFP_KERNEL); + minfo->info_type = blk_type; + minfo->non_mii.media = *p++; + if (minfo->non_mii.media & 0x40) + { + p += 6; /* just skip media specific data for now */ + } + minfo->non_mii.media &= 0x3F; + minfo->non_mii.gppc42 = *((unsigned short*) p); p += 2; + minfo->non_mii.gppd42 = *((unsigned short*) p); p += 2; + minfo->next = tp->mediainfo; + tp->mediainfo = minfo; + j += (ee_data[j] & 0x7f) + 1; + printk("%s: Non-MII transceiver with media %d (%s).\n" + "%s: Control port setting ctrl: %2.2x / data: %2.2x.\n", + dev->name, minfo->non_mii.media, + medianame[minfo->non_mii.media & 15], + dev->name, minfo->non_mii.gppc42, minfo->non_mii.gppd42); + break; case 1: + case 3: minfo = kmalloc(sizeof(struct mediainfo), GFP_KERNEL); ! minfo->info_type = blk_type; minfo->mii = p; minfo->next = tp->mediainfo; tp->mediainfo = minfo; *************** *** 709,714 **** --- 747,753 ---- printk(" %4.4x", mdio_read(ioaddr,p[0], mii_reg)); printk(".\n"); } + break; } } else { /* Compact block. */ minfo = kmalloc(sizeof(struct mediainfo), GFP_KERNEL);