[vortex] programatically disable PXE?

Donald Becker becker@scyld.com
Sun Apr 21 22:53:01 2002


On Thu, 18 Apr 2002, Jason Verch wrote:

> 	First off, sorry if this list isn't the place to ask about this..

This is the correct list for this question.

> 	I'm looking for a program under linux that can turn PXE booting
> on and off on a 3c905B-TX. I want a way to automate things instead of having
> to go into BIOS while the PC is booting and change it.  Using vortex-diag and
> comparing the registry dumps with it enabled and disabled I think I've found
> the bits that get twidddled, but I'm not sure how to twiddle them.

Which EEPROM bits are you seeing changed?

The option that changes the boot ROM configuration in the EEPROM is
mostly undocumented.  I haven't yet figured out the general case, and
thus some diagnostic programs have ad hoc code.

The code is around line 747, and is triggered with the '-P' option.
You will have to edit vortex-diag.c to have it set the value you wish.
Change the '0x3001' at line 749 to the proper value.

I don't have the datasheet here, but I think the correct value is 0x3000.

I comment on what the code is doing:

	/* If -P is passed. */
	if (set_ee_rom) {
		/* Used for calculating the checksum. */
		unsigned short sum = 0;
		/* We will be working on a copy.  Note that we should be
		   using ee_tbl_offset here and below! */
		memcpy(new_ee_contents, eeprom_contents, eesize << 1);
		/* Set the boot ROM size. */
		new_ee_contents[9] = 0x3001;
		/* Recalculate the checksum: This calculation is valid
	           for the Cyclone only, while we may have a Vortex or
		   Hurricane. */
		for (i = 0; i < 0x1B; i++)
			sum ^= new_ee_contents[i];
		new_ee_contents[0x20] = (sum ^ (sum>>8)) & 0xff;
		printf("Setting the EEPROM BIOS ROM field to %4.4x, new checksum "
			   "%2.2x.\n", new_ee_contents[9], new_ee_contents[0x20]);
		/* Do the write.  Re-read rather than assume that it worked. */
		do_update(ioaddr, eeaddrlen, new_ee_contents, eeprom_contents);
		for (i = 0; i < eesize; i++)
			eeprom_contents[i] = read_eeprom(ioaddr, eeaddrlen, i);
	}

-- 
Donald Becker				becker@scyld.com
Scyld Computing Corporation		http://www.scyld.com
410 Severn Ave. Suite 210		Second Generation Beowulf Clusters
Annapolis MD 21403			410-990-9993