November 5, 2024

Sun 3/80 NVRAM

The NVRAM sits next to the bootrom. If you carefully inspect this tall "chip" you can see that it is a battery sitting on top of some chip. The "cap" contains both a battery and a crystal. Of course after 35 years, this battery has long since gone dead.

Mine has a yellow label on top with a bar code and "BA0F" printed on it. These could be a checksum for whatever it once contained. Who knows?

I remove mine from the socket and study it. The underside of this chip is marked "48T02".

The unit is a M48T02, made by ST electronics. A 25 page datasheet is available that covers both this chip and a M48T12. The only difference I can find is that the "12" operates over a slightly wider range of supply voltages.

The unit is a 2K by 8 static ram (with battery backup) along with a time of day (TOD) clock. The datasheet says it is compatible with a DS1642. They say the battery will last at least 10 years.

A 2K static ram goes from 0 to 0x7ff. The clock registers are at the end of the chip and hide the last few bytes of the static ram. They are at 7F8h-7FFh. The control register is first at 0x7f8.

There is possible confused nomenclature. Sometimes this device is refered to as NVRAM, IDPROM, or EEPROM. You have to take care and figure out from context what is being talked about.

The Sun 3/80 uses the following addresses:

EEPROM -- 0x6400_0000  (0xfef0_4000 virtual)
TOD    -- 0x6400_07f8  (0xfef0_6000 virtual)
The bootrom also mentions an IDPROM at the following address. This may be on the Sun 3/470. The bootrom never accesses these addresses and I don't see any chip that relates to this.
IDPROM -- 0x6100_0C00  (0xfef1_cc00 virtual)

Repair

You can see light between the battery and the chip. There is a thin gap. The battery is held only at the ends. There are important wires buried in those tabs, so don't do anything drastic without reading further.

Hopefully you have carefully read some of the links above before going any further. I began cutting the tabs at the end of the unit, then stopped midway along and read some descriptions of how people have done this. If I had continued and detached the cap, I would not have had much chance of fixing the device. I would have cut critical wires that are embedded in the plastic tabs at the ends of the unit. Hopefully I stopped in time.

These are available on Digikey (as of November, 2024) and cost $22.

The crystal is in the end which has a white dot. A good strategy is to leave that entirely alone. What some people do is to saw the battery in half, which leaves the part with the crystal intact. I use a dremel tool with a cutting disk to carefully cut the tabs at each end that hold the battery. Since the battery will be discarded, it do my cutting as high as possible in order not to damage the chip itself. This is a local copy of:

Symptoms

The Symptoms of a failing NVRAM become effective after a= power cycle or power failure: 3D"Picture

Precautions

If your NVRAM is still ok, make a copy to the harddis= k immediately. This will help you to restore the correct value in case of f= ailure.

Enter as root:

# dd if=3D/dev/eeprom of=3D/var/adm/eeprom.contents bs=3D1 count=3D2=
040

Repairing the NVRAM

A new NVRAM is hard to find and expensive. Bu= t it is easy to refurbish the old one, because it's only the battery which = is dead. The battery sits in the plastic top of the chip.

Fetch the following things:

Take out the graphics card. It is fastened with two screws at the P4= connector and with two bigger screws at the rear. Pull out the card by gen= tly tearing near the connector until it pops out. Remove the NVRAM now. Pin= 1 is marked by a white dot.
           1 1 1 0 0 0 0 0 0 0 0 0
           2 1 0 9 8 7 6 5 4 3 2 1=20
          +-----------------------+
front-  > |  +----------------+  o<-- white dot
side    > |  !      XXXX      |   |
to      > |  !  ||||||||||||  |<----- yellow sticker=20
scratch > |  +----------------+   |   with barcode and
          +-----------------------+   four digit
           1 1 1 1 1 1 1 2 2 2 2 2    id-number
           3 4 5 6 7 8 9 0 1 2 3 4
The plastic container for the battery is fastened on top of the real = chip with a plastic mass on both short sides. Scratch that mass away on pin= -1's opposite side (which is the side between pin 12 and 13) until two meta= l stripes become visible. Carefully scratch away more of the mass so you ca= n easlily solder the cables to the metal stripes. One of the stripes is con= nected to pin 12 (GND).

Solder the two cables to the stripes. Of course you can solder the one= cable to pin 12 instead to the corresponding stripe.

3D"Picture

Here is the NVRAM seen from below. One cable is soldered to pin 12 = (red) which we know is connected to the one stripe (red too). The other cab= le needs to be soldered to the other stripe (blue).

Then solder the battery to the wires. - comes to pin 12, + to the othe= r metal stripe. Double check polarity of the battery!!!

Tip:The surface of the battery takes solder much better, if you= scratch it with a sharp tool. Too much heating with the solder iron may ki= ll the battery.

Let the battery cool down and cover it with adhesive tape. Carefully b= end the cables so the battery lies on the NVRAM.

Put the NVRAM back into it's socket (look for the correct direction) a= nd put the graphics card back into the slot. The battery should now be fast= ened between the NVRAM and the graphics card.

Make the machine work again

Now the NVRAM is ok, but empty. The 3= /80 will refuse to work without a properly filled NVRAM.

For your pleasure, you should connect the terminal to serial port A. S= ettings: 9600 baud, 8 bit, no parity. You probably will need a null modem c= able (2x3,4x5,6+8x20,7-7) too. This allows you to watch the diagnosis outpu= t. If you have no terminal handy, you have to wait until the monitor gets b= right. This will last a while. Now enter the PROM monitor by pressing L1-A.=

As long as the IDPROM contains unusable data, the machine refuses to b= oot, neiter from the net (which is a bad idea with a broadcast ethernet add= ress anyway) nor from hard disk. We'll fill it with randomly choosen data. = If you have a copy of the NVRAM contens or at least the ethernet address an= d/or the serial number, you can fix that later.

At the Monitor prompt, enter the following:

> q70b (return)
70b=3D00? 6 (return)
70c=3D00? (Ctrl-C) (return)
> ^t fef04000 (return)
Hint: ^ is ASCII character 0x5e or Shift-6.
You'll get output which includes the following (samples included)
TIA entry =3D 33FA500
TIB entry =3D 33FB80A
PTE =3D 64000049
Write these values down!!!

Change the TIA entry for fedfa000 to match the above

m a fedfa000 (return)
TIA MAP FEDFA000 [...] ? 33FA500 (return)
Hit (Ctrl-C) (return) at next ? prompt

Now change the TIB entry to match the above

> m b fedfa000 (return)
TIB MAP FEDFA000 [...] ? 33FB80A (return)
Hit (Ctrl-C) (return) at next ? prompt

Last, but not least change the pagemap entry to match the above

> p fedfa000 (return)
PageMap FEDFA000 [...] ? 64000049 (return)
Hit (Ctrl-C) (return) at next ? prompt
> o fedfa7d8 (return)
At this point you can enter the new IDPROM values. You need to get th= e checksum right. If you don't, you still won't be able to boot.

byte          contents
fedfa7d8      version number - always 01
fedfa7d9      first byte of hostid (system type, 42 for sun 3/80)
fedfa7da-df   6 byte ethernet address (first three bytes are 08,00,20)
fedfa7e0-e3   date of manufacture. Often all 0s
fedfa7e4      second byte of hostid (high byte of serial number)
fedfa7e5      third byte of hostid (middle byte of serial number)
fedfa7e6      fourth byte of hostid (low byte of serial number)
fedfa7e7      idprom checksum  - xor of contents of bytes d8-e6
Click here = to get some random values and a checksum calculated.

If you power cycle the machine, it shouldn't spit out the diagnosis me= ssages anymore and be able to boot from disk.

Restore the data of the NVRAM

You can praise yourself lucky, if y= ou have made a copy of the NVRAM contens earlier with "dd". The following c= ommand restores the NVRAM data:
# dd if=3D/var/adm/eeprom.contents of=3D/dev/eeprom bs=3D1 count=3D2=
040
# halt
Stop the machine with the "halt" command and power cycle it. Now it s= hould show the correct ethernet address at the start. You're done.

Unlucky people (without a backup copy of the NVRAM) still need suitabl= e data for the 3/80.

Find suitable data for the NVRAM

If you can live with the randoml= y generated values, there should be no problem with this. But if you want t= o restore the original ethernet address or serial number, it is much easier= to fire up SunOS, read out /dev/eeprom, modify it with your favourite hex = editor (i can recommend "beav"; it is in emacs style) and write it back.

Here is the procedure to read the NVRAM again:

# dd if=3D/dev/eeprom of=3D/var/adm/eeprom.contents bs=3D1 count=3D2=
040
It is essential to get the checksum at 0x7e7 correct. If you're not g= ood in computing hex values (like me), you can use this tiny C program:
#include=20
main()
{
        unsigned char x,y;
        int i;

        x=3D0;

        while(1)
        {
                scanf("%x",&i);
                y=3Di;
                x^=3Dy;
                printf("%x\n",x);
        }
}
Save this program as xor.c and compile it:
# gcc xor.c -o xor
Enter the hex values from 0x7d8 to 0x7e6:
# ./xor
01 42 08 00 20 07 ed aa 24 74 ec 43 00 50 18
1
43
4b
4b
6b
6c
81
2b
f
7b
97
d4
d4
84
9c
The last value (0x9c) is the checksum that needs to be placed at 0x7e= 7.

You're almost done now. Write back the contents and stop the machine:<= /p>

# dd if=3D/var/adm/eeprom.new of=3D/dev/eeprom bs=3D1 count=3D2040
# halt
Power cylce the machine and look for the correct ethernet address.

What else?

If the machine complains about "wrong checksum" if you= give the command "eeprom", enter "eeprom -c" to fix this. It's not the che= cksum at 0x7e7 but another one.

If you can't find the ethernet address and/or serial number of your 3/= 80, then there is a last possibility: Sun does have a database of NVRAM con= tents. You need the four alphanumeric characters on the yellow sticker unde= r the barcode and a friendly Sun hotline operator.

Long live the Sun 3/80

I think the NVRAM is a major design fault.= It is a source of grief not only for the 3/80 series but all early SPARC m= achines too.

Disclaimer: If anything breaks, don't blame me.

I hope that my NVRAM repair manual will help you to revive your 3/80. = I have fixed more than 10 NVRAMs now and so some 3/80 can survive some more= years.

Peter Koch