Netboot Mailing List (by thread)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IDing the 905c in software?




On 1/24/2000 11:37 AM Robert Thompson robertt@stargate.cs.swau.edu wrote:
>I am more interested in some method of identifying a card, assuming I have
>a base address and can do port-io. I just need something that returns
>different responses on a byte-mode-programmable 3c905 (ie, 905C). I've
>already merged the 905b and 905c prom-programmer utilities, and was trying
>to get away from a commandline of  
>905prom 0x???? [B|C] action

Well, if you're willing to specify the IO address of the card, and you 
are running the 905prom program, you already know you have a 3Com 90x 
card.  That makes your job easier.

If you run the "id" command in cromutil, you should get the vendor_id and 
device_id of the flash unit on the chip.  Here is the table of 
information for some flash memory devices from 
http://cesdis.gsfc.nasa.gov/linux/diag/libflash.c .

struct flash_id_table {
	unsigned char vendor_id, device_id;
	int flags;
	int mem_size, page_size;
	char *part_name;
} static flash_id[] = {
	{ 0x12, 0x34, 0,   8*1024,   1, "Unknown Flash EEPROM", },
	{ 0xBF, 0x07, 0, 128*1024, 128, "Silicon Storage Technology SST29EE010", 
},
	{ 0xBF, 0x08, 0, 128*1024, 128, "Silicon Storage Technology SST29LE010", 
},
	{ 0x1F, 0xDC, 0,  32*1024,  64, "Atmel AT29C256", },
	{ 0x1F, 0xBC, 0,  32*1024,  64, "Atmel AT29LV256", },
	{ 0x1F, 0x5D, 0,  64*1024, 128, "Atmel AT29C512", },
	{ 0x1F, 0x3D, 0,  64*1024, 128, "Atmel AT29LV512", },
	{ 0x1F, 0xD5, 0, 128*1024, 128, "Atmel AT29C010A", },
	{ 0x1F, 0x35, 0, 128*1024, 128, "Atmel AT29LV010A", },
	{ 0x1F, 0xDA, 0, 256*1024, 256, "Atmel AT29C020", },
	{ 0x1F, 0xBA, 0, 256*1024, 256, "Atmel AT29LV020", },
	{ 0x1F, 0x5B, 0, 512*1024, 512, "Atmel AT29C040", },
	{ 0x1F, 0x3B, 0, 512*1024, 512, "Atmel AT29LV040", },
	{ 0x1F, 0xA4, 0, 512*1024, 256, "Atmel AT29C040A", },
	{ 0x1F, 0xC4, 0, 512*1024, 256, "Atmel AT29LV040A", },
	{ 0x1F, 0x03, 0,  64*1024, 1, "Atmel AT49BV512", },
	{ 0,},
};

Note that the 0x1F, 0x03 returned by the flash chip on a 905C tell you 
that it (the flash device) is an Atmel AT49BV512.

So, what you probably want to do is to run the "id" code as a startup 
function, and store the result so that when you do a "prog" command 
later, you can say:

    if (vendor_id == 0x1F && device_id == 0x03) 
      // <byte-program the card>
    else if (vendor_id == 0x1F && device_id == 0x3D)
      // <sector-program the card>
    else
      // print and error message about not knowing how to flash this 
device

You can run the ID command of either cromutil or bromutil on either card, 
of course to find out what kind of flash is on the card to fill in the 
right codes.  And of course you could generalize your program to use a 
structure table like the one above to fill in the sector-size to write. 

>I need the utility to decide whether the card is a B or a C revision. Most
>of the operations are the same, but the B needs some stuff initialized,
>and is programmed in 128-byte sectors. The C doesn't need the
>initialization and is programmed byte-at-a-time. I have a mix of these in
>service, and my automated scripts will not know ahead of time which
>machines have which cards. 

Sounds like a great idea.  Hopefully the hints above will help you out.

Regards,

Marty

---
   Name: Martin D. Connor
US Mail: Entity Cyber, Inc.; P.O. Box 391827; Cambridge, MA 02139; USA
  Voice: (617) 491-6935, Fax: (617) 491-7046 
  Email: mdc@thinguin.org
    Web: http://www.thinguin.org/


===========================================================================
This Mail was sent to netboot mailing list by:
Marty Connor <mdc@thinguin.org>
To get help about this list, send a mail with 'help' as the only string in
it's body to majordomo@baghira.han.de. If you have problems with this list,
send a mail to netboot-owner@baghira.han.de.



For requests or suggestions regarding this mailing list archive please write to netboot@gkminix.han.de.