Home | History | Annotate | Download | only in common
History log of /src/sys/arch/sparc/stand/common/promdev.c
RevisionDateAuthorComments
 1.31  17-Jan-2025  riastradh sparc promdev.c: Nix trailing whitespace. Fix intertoken space.

No functional change intended.
 1.30  13-Jan-2025  jdc Move the check for RAID boot into the strategy routines.
This avoids a Data Access Exception at boot time on older PROM versions.
 1.29  03-Feb-2019  mrg branches: 1.29.36;
don't compare string pointers against \0
 1.28  25-Mar-2017  martin branches: 1.28.14;
Virtio block devices may have a "scsi" device_type instead of "block",
so accept both.
 1.27  30-Dec-2013  martin branches: 1.27.6; 1.27.10; 1.27.14;
Avoid buffer overruns (no practical difference for any sane firmware
properties, but better be safe).
 1.26  02-Sep-2010  uwe branches: 1.26.8; 1.26.18; 1.26.22;
Fix printf formats in -DDEBUG_PROM to make it compile.

XXX: print daddr_t after casting it to int since libsa is not built
with LIBSA_PRINTF_LONGLONG_SUPPORT by default.
 1.25  25-Aug-2010  christos factor out the floppy detection code.
 1.24  25-Aug-2010  christos Don't LOAD_BACKWARDS for floppies.
 1.23  18-Oct-2009  tsutsui branches: 1.23.2; 1.23.4;
Don't try to read disklabel to check FS_RAID on floppy boot since
reopening floppy could cause Data Access Exception later.
Fixes PR port-sparc/42186, ok'ed by mrg@.
 1.22  12-Jan-2009  tsutsui Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.21  05-Apr-2008  tsutsui branches: 1.21.4; 1.21.12; 1.21.14; 1.21.20;
Add support booting from UFS2 partition for sparc.
Tested on tme emulating SS2.

Closes PR port-sparc/36068.
 1.20  13-Jul-2006  uwe branches: 1.20.8; 1.20.24; 1.20.58;
De-__P. ANSIify.

Same object code is generated (except in prf.c, where putchar argument
type was changed to int to match the prototype and one instrcution
changes accordingly).

strategy() in ofdev.c was not ANSIified in this sweep, b/c that
changes code generated at call sites!
 1.19  20-Jun-2006  jdc Add support to the 2nd stage boot loader for booting from RAID
partitions. We do this by checking the NetBSD label to see if the
boot partition is of type RAID. If so, we offset reads from the
disk so that the kernel image can be read.

Note that with this code, sun4 machines (with PROM monitor) will only
boot from RAID if the RAID partition is the first one on the disk.

Tested on a SPARCstation 20, a SPARCstation 2 and a 4/330.
 1.18  20-May-2006  mrg branches: 1.18.2;
struct filesystem is now struct fs_ops, since i don't know when.
 1.17  11-Dec-2005  christos branches: 1.17.4; 1.17.6; 1.17.8; 1.17.12; 1.17.14;
merge ktrace-lwp.
 1.16  27-Apr-2005  martin branches: 1.16.2;
Do not rely on strings to which pointers are returned by promlib functions
to persist accross further promlib calls.
This fixes (at least) bootjs.net.
 1.15  30-Jul-2003  mrg branches: 1.15.6; 1.15.8; 1.15.14;
sprinkle some: libkern.h, some -ffreestanding and some cast-y goodness,
all for the pleasure of the gcc 3 :-)
 1.14  26-Feb-2003  pk branches: 1.14.2;
Move all `ID prom' stuff into the prom library.
 1.13  27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.12  26-Sep-2001  eeh branches: 1.12.4;
getprop* -> PROM_getprop*
 1.11  05-Aug-2001  mrg branches: 1.11.2;
avoid an unused variable warning
 1.10  04-Apr-2001  pk branches: 1.10.2;
* Missing PROM_OPENFIRM: case in getdevtype() and prom_getether().
* In getdevtype(), use prom_instance_to_package() to get to the device node.

From Valeriy E. Ushakov on port-sparc@netbsd.org.
 1.9  18-Jan-2001  pk branches: 1.9.2;
On V0 proms, read the `idprom' property at the root node to get to the
station's ethernet address.
 1.8  28-Apr-1999  christos branches: 1.8.2; 1.8.12;
Include <sys/systm.h> to get prototype for memset.
 1.7  15-Feb-1999  pk branches: 1.7.4;
Use PROMLIB to streamline this code. This also provides the bulk of
Open Firmware boot code.
 1.6  12-Oct-1998  pk Move around a few PTE-manipulating macros.
 1.5  05-Oct-1998  christos rename getprop routine to avoid conflict with the one in bsd_openprom.h
 1.4  15-Sep-1998  pk Can't afford a 1K buffer in the data segment.
 1.3  29-Aug-1998  mrg add support for finding kernels other than `netbsd'. the list is:
netbsd, netbsd.gz, netbsd.old, netbsd.old.gz, onetbsd, onetbsd.gz
and vmunix, in that order. this is used by the bootable `bootfs'
image (suitable for floppies and cdroms), which contains a netbsd.gz
by default.
while i'm here, fix up `boot [device] -s' which got broke when
booting kernels with a - in their name was fixed..
 1.2  27-May-1998  pk Properly split boot spec into file name and arguments.
 1.1  01-Jun-1997  mrg Completely rearrange SPARC boot code, modeling it after alpha and hp300
ports' boot programs. Also added support for loading gzip'd kernels,
useful for booting from floppy. From Jason R. Thorpe <thorpej@nas.nasa.gov>,
tested by Matthew Green <mrg@eterna.com.au> and Erik Fair <fair@clock.org>.
 1.7.4.1  21-Jun-1999  thorpej Sync w/ -current.
 1.8.12.1  03-Feb-2001  he Pull up revision 1.9 (requested by pk):
On V0 proms, read the ``idprom'' property at the root node to
get to the station's ethernet address. Fixes netbooting on some
older SPARCstations where the boot program would otherwise crash.
 1.8.2.2  21-Apr-2001  bouyer Sync with HEAD
 1.8.2.1  11-Feb-2001  bouyer Sync with HEAD.
 1.9.2.1  09-Apr-2001  nathanw Catch up with -current.
 1.10.2.3  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.10.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.2.1  25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.11.2.1  01-Oct-2001  fvdl Catch up with -current.
 1.12.4.2  18-Oct-2002  nathanw Catch up to -current.
 1.12.4.1  26-Sep-2001  nathanw file promdev.c was added on branch nathanw_sa on 2002-10-18 02:40:01 +0000
 1.14.2.4  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1  03-Aug-2004  skrll Sync with HEAD
 1.15.14.3  08-May-2008  jdc Pull up revisions:
src/sys/arch/sparc/stand/common/conf.c 1.2
src/sys/arch/sparc/stand/common/promdev.c 1.21
(requested by tsutsui in ticket #1928).

Add support booting from UFS2 partition for sparc.
Tested on tme emulating SS2.

Closes PR port-sparc/36068.
 1.15.14.2  10-Nov-2006  ghen Pull up following revision(s) (requested by jdc in ticket #1527):
sys/arch/sparc/stand/common/promdev.c: revision 1.19
share/man/man8/man8.sparc/boot.8: revision 1.29 + patch
share/man/man8/man8.sparc/boot.8: revision 1.30
Add support to the 2nd stage boot loader for booting from RAID
partitions. We do this by checking the NetBSD label to see if the
boot partition is of type RAID. If so, we offset reads from the
disk so that the kernel image can be read.
Note that with this code, sun4 machines (with PROM monitor) will only
boot from RAID if the RAID partition is the first one on the disk.
Tested on a SPARCstation 20, a SPARCstation 2 and a 4/330.
Add some PROM monitor and Open Boot PROM boot-related commands and a
BUGS section describing boot limitations.
Drop trailing whitespace.
 1.15.14.1  28-Apr-2005  tron Pull up revision 1.16 (requested by martin in ticket #210):
Do not rely on strings to which pointers are returned by promlib functions
to persist accross further promlib calls.
This fixes (at least) bootjs.net.
 1.15.8.1  29-Apr-2005  kent sync with -current
 1.15.6.1  12-May-2005  riz Pull up revision 1.16 (requested by martin in ticket #1484):
Do not rely on strings to which pointers are returned by promlib functions
to persist accross further promlib calls.
This fixes (at least) bootjs.net.
 1.16.2.2  30-Dec-2006  yamt sync with head.
 1.16.2.1  21-Jun-2006  yamt sync with head.
 1.17.14.1  19-Jun-2006  chap Sync with head.
 1.17.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.17.8.3  11-Aug-2006  yamt sync with head
 1.17.8.2  26-Jun-2006  yamt sync with head.
 1.17.8.1  24-May-2006  yamt sync with head.
 1.17.6.1  01-Jun-2006  kardel Sync with head.
 1.17.4.1  09-Sep-2006  rpaulo sync with head
 1.18.2.1  13-Jul-2006  gdamore Merge from HEAD.
 1.20.58.2  17-Jan-2009  mjf Sync with HEAD.
 1.20.58.1  02-Jun-2008  mjf Sync with HEAD.
 1.20.24.1  03-Jun-2008  skrll Sync with netbsd-4.
 1.20.8.2  27-Jan-2010  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1379):
sys/arch/sparc/sparc/auxreg.h: revision 1.13
distrib/sparc/ramdisk/dot.profile: revision 1.20
sys/arch/sparc/stand/common/promdev.c: revision 1.23
Don't try to read disklabel to check FS_RAID on floppy boot since
reopening floppy could cause Data Access Exception later.
Fixes PR port-sparc/42186, ok'ed by mrg@.
Use /dev/fd0a rather than /dev/rfd0a to read instfs.tgz image from floppy.
It looks newer (appearred after 1.6) gzip tries to read less than DEV_BSIZE
(to check header?) so we can't use raw device directly.
(note sparc bootfs ramdisk doesn't have dd(1))
Workaround for PR port-sparc/42193, and would also fix PR install/28734.
Explicitly clear AUXIO4M_FTC bit in FTC_FLIP macro used on
pseudo-dma for floppy, as well as AUXIO4C_FTC bit for sun4c.
A comment in the macro says AUXIO4M_FTC bit is auto-clear,
but my two SS20s (including compatible) with 150MHz hyperSPARCs
get data_overrun without it, and no bad side effect on SS5
(works with and without this change).
Closes PR port-sparc/42516, which is the last one of a bunch of
floppy issue on NetBSD/sparc since NetBSD 2.0 days. See
http://mail-index.NetBSD.org/port-sparc/2009/12/20/msg000484.html
for details.
 1.20.8.1  08-May-2008  jdc Pull up revisions:
src/sys/arch/sparc/stand/common/conf.c 1.2
src/sys/arch/sparc/stand/common/promdev.c 1.21
(requested by tsutsui in ticket #1132).

Add support booting from UFS2 partition for sparc.
Tested on tme emulating SS2.

Closes PR port-sparc/36068.
 1.21.20.1  21-Apr-2010  matt sync to netbsd-5
 1.21.14.1  23-Jan-2010  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1251):
sys/arch/sparc/sparc/auxreg.h: revision 1.13
distrib/sparc/ramdisk/dot.profile: revision 1.20
sys/arch/sparc/dev/audioamd.c: revision 1.25
sys/arch/sparc/dev/fd.c: revision 1.147
sys/arch/sparc/stand/common/promdev.c: revision 1.23
distrib/sparc/miniroot/Makefile.inc: revision 1.16
Build miniroot binaries for sparc with -Os to shrink instfs.tgz
for the second boot floppy which use miniroot objects.
This is workaround for PR install/42146, and ok'ed by mrg@.
Don't try to read disklabel to check FS_RAID on floppy boot since
reopening floppy could cause Data Access Exception later.
Fixes PR port-sparc/42186, ok'ed by mrg@.
Disable "fast trap" handlers which invoke software interrupts
in sparc/amd7930intr.s and sparc/bsd_fdintr.s until they are
rewritten to adapt new MI softint(9) API.
No particular comments on PR port-sparc/42192, but
this fixes timeout problem on floppy access on my SPARCstation 1+.
XXX: floppy support on sun4m seems to have another problem (data overrun).
Use /dev/fd0a rather than /dev/rfd0a to read instfs.tgz image from floppy.
It looks newer (appearred after 1.6) gzip tries to read less than DEV_BSIZE
(to check header?) so we can't use raw device directly.
(note sparc bootfs ramdisk doesn't have dd(1))
Workaround for PR port-sparc/42193, and would also fix PR install/28734.
Explicitly clear AUXIO4M_FTC bit in FTC_FLIP macro used on
pseudo-dma for floppy, as well as AUXIO4C_FTC bit for sun4c.
A comment in the macro says AUXIO4M_FTC bit is auto-clear,
but my two SS20s (including compatible) with 150MHz hyperSPARCs
get data_overrun without it, and no bad side effect on SS5
(works with and without this change).
Closes PR port-sparc/42516, which is the last one of a bunch of
floppy issue on NetBSD/sparc since NetBSD 2.0 days. See
http://mail-index.NetBSD.org/port-sparc/2009/12/20/msg000484.html
for details.
 1.21.12.1  19-Jan-2009  skrll Sync with HEAD.
 1.21.4.3  09-Oct-2010  yamt sync with head
 1.21.4.2  11-Mar-2010  yamt sync with head
 1.21.4.1  04-May-2009  yamt sync with head.
 1.23.4.1  05-Mar-2011  rmind sync with head
 1.23.2.1  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.26.22.1  18-May-2014  rmind sync with head
 1.26.18.2  03-Dec-2017  jdolecek update from HEAD
 1.26.18.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.26.8.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.27.14.1  21-Apr-2017  bouyer Sync with HEAD
 1.27.10.1  26-Apr-2017  pgoyette Sync with HEAD
 1.27.6.1  28-Aug-2017  skrll Sync with HEAD
 1.28.14.1  10-Jun-2019  christos Sync with HEAD
 1.29.36.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed