OK, due to requests of both owners of l440gx clusters and potential
linuxbios users James Hendricks reopened the "how do you write flash from
Linux" issue.
To sum up, we got it. We think we're going to be able to let people write
440gx flash from user mode programs on Linux. I thought I'd drop a quick
note to this list just to let people who might be interested know about
it.
Here's the sequence.
First, in the PIIX4E function 0, you have to enable XBCS#. This makes the
PIIX4e pass write strobes to flash. Everybody has sent me notes over the
last 18 months telling me this, so it's not news to any of you. But it
was never the whole story, there were other "magic bits" that Intel told
us they were not going to tell us (they charged me $25 to tell me that!).
For completeness, here is the XBCS# setting:
setpci -s 0:12.0 0x4e.w=0x3f4
^ This is XBCS#.
Now for the "magic hidden bits" that Intel refused to tell any of their
customers, including the ones who had 400 machines and had to update each
machine manually for each FLASH upgrade (hi Remy!).
First, you need to enable VPP to flash. This is controlled by a GPIO pin.
These GPIOs are accessed via IO instructions, but the actual IOBASE for
the GPIOs is controlled on the PIIX4e, function 3, register 40. The
standard BIOS sets the IOBASE to 0xc00.
Let's go with that 0xc00 setting. VPP is controlled by bit 0 at IO
address 0xc28 (i.e 0xc00 + 0x28). So you do this:
l = inl(0xc28);
l |= 1;
outl(l, 0xc28);
Then you need to enable write strobes to flash. This is IN ADDITION to
xbcs#. There is a TRIBUF (yes, an actual TTL SSI part, 14 pins!) between
the PIIX4E flash write pin and the flash, and the enable on the TRIBUF is
controlled by a PIIX4E GPIO. James found the TRIBUF that controls this
last summer, and our first gross attempt involved a piece of wire :-). We
just didn't find the GPIO connection.
This is done by clearing bit 0 of byte 0xc37
b = inb(0xc37);
b &= ~1;
outb(b, 0xc37);
Basically, these three simple ops have allowed us for the first time to
issue commands to flash and get results back. We are trying to build Linux
MTD drivers for flash but are hampered by the broken redhat 7.1 gcc; can't
build modules for Linux on 7.1 machine at present :-(. Sigh. We'll have to
upgrade from redhat 7.1 to redhat 6.2, maybe.
That said, by next week we hope to have a way for you 440gx users to
reflash the BIOS from Linux.
For LinuxBIOS users, we still don't have SCSI working with Linux on this
mainboard. Here at LANL we don't care about 440gx any more, that cluster
is obsolete, and has been handed off to another group. I for one have no
intention of buying another Intel motherboard in this lifetime, unless
their attitude changes a bit. It's a shame because Intel chipsets are
incredibly well documented on their web site, but their motherboard
support is terrible.
Anyway more when we get it. But those of you with 440gx might want to look
at this too, you might get to reflashing flash before we do :-)
If you go with MTD kernel support, remember to do it as a module. You will
need to boot the kernel, do those three ops mentioned above, and then when
you insmod the mtd stuff it should find the flash. Don't forget to set the
mtd base and size in the mtd configuration (base 0xfff00000, size
0x100000). I'd be interested to hear any results from anyone reading this
note. In particular, if your insmod of mtd finds the flash, that would be
neat to hear.
Note: as always, you can turn your 440gx into a brick if you screw up
while experimenting with this stuff. You Have Been Warned. If you don't
know what you're doing, you might not want to try this.
ron