Resetting Sun idprom nvram
December 21st, 2017Note to self. Before it disappears from the interwebs. When your Sun idprom nvram battery dies.
The following was tested on a Sun SPARCstation 2 (sun4c) and Ultra 5 (sun4u):
Hit `n’ to get the new openboot prompt (it probably tries network booting):
f idprom@ 1 xor f mkp # this will invalidate the checkum
8 0 20 13 de ad c0ffee mkpl
Hit ctrl-D then ctrl-R, if you do NOT see a Sun Copyright notice, it worked, otherwise it failed.
You can check with:
.idprom
You probably want to set some sane defaults, and disable the diag mode, to skip the excessively long memory test each time you boot:
set-defaults
setenv diag-switch? false
Update: A new clock chip also needs to be started. From what I read the old SunOS might have code in the kernel clock driver to do that, but AFAICS the Linux kernel does not. This (untested) OpenFirmware code sequence supposedly starts a new clock chip on sun4c:
2000000 obio 0 map-page # map NVRAM to page 0
80 7f8 c! # set write bit
0 7f9 c! # reset stop bit
80 7fb c! # set kick start
0 7f8 c! # reset write bit#wait for two seconds
80 7f8 c! # set write bit
0 7fb c! # reset kick start0 7f9 c! # set dummy time and date
0 7fa c! # (if necessary)
0 7fb c!
4 7fc c!
11 7fd c!
1 7fe c!
96 7ff c!0 7f8 c! # reset write bit