Home | History | Annotate | only in /src/sys/arch/cobalt/stand/boot
History log of /src/sys/arch/cobalt/stand/boot
RevisionDateAuthorComments
 1.32 08-Apr-2017  christos centralize vers.c building for standalone programs.
 1.31 08-Sep-2016  christos branches: 1.31.2;
Avoid the PIE
 1.30 23-Jun-2015  matt branches: 1.30.2;
Always build for mips3. Use -Os instead -O2 for smallest code size.
text goes from 74608 to 63020
 1.29 05-Aug-2014  apb branches: 1.29.4;
Use ${TOOL_GZIP_N} instead of ${TOOL_GZIP} -n, and similarly
use ${TOOL_GZIP_N} -9 instead of ${TOOL_GZIP} -9n, etc.

This will pass -nT instead of just -n if the gzip program is
actually pigz.
 1.28 27-Jan-2014  apb branches: 1.28.2;
Pass the -n flag to gzip invocations.

This prevents it from embedding a timestamp in the output. We pass
"-n" unconditionally, not conditional on MKREPRO, because many other
invocations of gzip already passed the -n flag unconditionally.
 1.27 16-Jan-2014  christos eliminate use of bsd.sys.mk from Makefiles
 1.26 12-Jan-2014  tsutsui Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.

XXX: probabry we should have bsd.saprog.mk or something.
 1.25 10-Jul-2011  mrg branches: 1.25.2; 1.25.12; 1.25.16;
don't set MACHINE_ARCH. the CPUFLAGS/etc. is enough, and otherwise this
doesn't work with an isolated $TOOLDIR from the mipse[lb] toolchain.
 1.24 09-Jul-2011  matt Use TOOL_GZIP
 1.23 20-Feb-2011  matt Merge forward from matt-nb5-mips64.
(XXX generic kernels on raq2 die after interrupts are enabled but gxemul
works fine).
 1.22 22-Jan-2011  joerg Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh. Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.
 1.21 27-May-2010  dholland branches: 1.21.2; 1.21.4;
Introduce .WAIT into the cleandir rule for blasting the libsa/libkern/etc.
trees, because it can race with the libsa/libkern/etc. makefiles' own
cleandir rules. I think I've found all of the uses of the offending idiom...
Closes PR 43360.
 1.20 19-Jan-2010  tsutsui branches: 1.20.2; 1.20.4;
Use -DLIBSA_PRINTF_LONGLONG_SUPPORT -DLIBSA_PRINTF_WIDTH_SUPPORT
in debug printf()s.
 1.19 15-Mar-2009  tsutsui Use <bsd.klinks.mk> for MD include dir symlinks.
 1.18 28-May-2008  tsutsui branches: 1.18.6; 1.18.12;
Print boot banner and a loading kernel name onto LCD,
for users who don't have serial console. Bump version.
 1.17 23-Mar-2008  tsutsui branches: 1.17.2; 1.17.4; 1.17.6;
Use macro defined in <machine/cpu.h> for cobalt_id and device addresses etc.
since <machine/leds.h> has been removed.
Also remove redundant address definitions in Makefile and local headers.
Pointed out by dieter roelants.
 1.16 16-Mar-2008  tsutsui Add support for optional Z85C30 serial console on Cobalt Qube 2700.
Bump version.
 1.15 02-Mar-2008  tsutsui WARNSfy
 1.14 01-Mar-2008  tsutsui Split out a PCI configuration space read function into a separate file
so that we could use it in other sources.
 1.13 01-Mar-2008  tsutsui - print cobalt model names in boot banner
- bump version.
 1.12 30-Oct-2007  tsutsui branches: 1.12.12; 1.12.16;
Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.
 1.11 12-Aug-2006  uwe branches: 1.11.6; 1.11.12; 1.11.22; 1.11.30; 1.11.32; 1.11.36;
Link libkern last. It contains functions normally found in libgcc, so
other libraries might have references to them.

Makes this compile with gcc4 (that emits calls to __ash[rl]di3 in libsa).
 1.10 11-Dec-2005  christos branches: 1.10.4; 1.10.8; 1.10.18;
merge ktrace-lwp.
 1.9 01-Jan-2005  simonb branches: 1.9.10;
Don't specify the object format to pick the right endianness - the
linker already knows if it is big- or little-endian.
 1.8 21-Jun-2004  jmc Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022
 1.7 10-Apr-2004  tsutsui Add a prompt to specify a kernel filename to be loaded on bootloader.
 1.6 27-Jan-2004  cdi branches: 1.6.2;
Load the boot program at 0x80F00000 to give the boxes with just 16Mb of
RAM a chance to boot. Discussed with soren@, tested on customer's board.

NB: While acceptable as a temporary workaround since most (all?) Cobalt
hardware comes with no less than 16Megs on board, changing a kernel load
address or making a boot loader relocatable could be a better solution.
 1.5 07-Jan-2004  cdi Pass some info from the boot loader to the kernel:

- Kernel image name
- Symbol table
- A flag indicating console presence (could be clobbered if not passed)

Add _rtt() entry to the boot loader code.
 1.4 14-Dec-2003  tsutsui Include <bsd.own.mk> at the top so that machine-links are also created
on "make depend". Tested on my RaQ2, and fixes port-cobalt/23711.
While here, two more cosmetics:
- remove redundant definitions
- use NOMAN rather than setting MAN empty
 1.3 26-Oct-2003  lukem Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
 1.2 08-Oct-2003  simonb Define LIB{CRT0,C,CRTBEGIN,CRTEND} as nothing, we don't need to link
against them.
 1.1 25-Jun-2003  cdi branches: 1.1.2;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.2.4 17-Jan-2005  skrll Sync with HEAD.
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.2.1 22-Jun-2004  tron branches: 1.6.2.1.2;
Pull up revision 1.8 (requested by jmc in ticket #531):
Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022
 1.6.2.1.2.1 13-Apr-2005  tron Pull up revision 1.7 (requested by tsutsui in ticket #1070):
Add a prompt to specify a kernel filename to be loaded on bootloader.
 1.9.10.4 24-Mar-2008  yamt sync with head.
 1.9.10.3 17-Mar-2008  yamt sync with head.
 1.9.10.2 15-Nov-2007  yamt sync with head.
 1.9.10.1 30-Dec-2006  yamt sync with head.
 1.10.18.1 15-Aug-2006  tron Pull up following revision(s) (requested by uwe in ticket #23):
sys/arch/cobalt/stand/boot/Makefile: revision 1.11
Link libkern last. It contains functions normally found in libgcc, so
other libraries might have references to them.
Makes this compile with gcc4 (that emits calls to __ash[rl]di3 in libsa).
 1.10.8.1 03-Sep-2006  yamt sync with head.
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.11.36.1 13-Nov-2007  bouyer Sync with HEAD
 1.11.32.2 23-Mar-2008  matt sync with HEAD
 1.11.32.1 06-Nov-2007  matt sync with HEAD
 1.11.30.1 31-Oct-2007  joerg Sync with HEAD.
 1.11.22.1 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.11.12.1 03-Dec-2007  ad Sync with HEAD.
 1.11.6.1 04-Nov-2007  pavel Pull up following revisions (requested by tsutsui in ticket #974):
sys/arch/cobalt/cobalt/autoconf.c: revision 1.25-1.26
sys/arch/cobalt/cobalt/machdep.c: revision 1.89
sys/arch/cobalt/stand/boot/Makefile: revision 1.12
sys/arch/cobalt/stand/boot/boot.c: revision 1.10
sys/arch/cobalt/stand/boot/boot.h: revision 1.6
sys/arch/cobalt/stand/boot/cache.c: revision 1.1-1.2
sys/arch/cobalt/stand/boot/clock.c: revision 1.2
sys/arch/cobalt/stand/boot/conf.c: revision 1.5
sys/arch/cobalt/stand/boot/devopen.c: revision 1.4
sys/arch/cobalt/stand/boot/nif_tlp.c: revision 1.1
sys/arch/cobalt/stand/boot/start.S: revision 1.6
sys/arch/cobalt/stand/boot/tlp.c: revision 1.1-1.3
sys/arch/cobalt/stand/boot/version: revision 1.6
sys/lib/libsa/dev_net.h: revision 1.5
Add an extern decl of try_bootp variable here since MD sources could set it.

In device_register(), check booted devices more properly:
- check "tlp" name on netboot
- use ata channel and drive numbers to check wd unit

Assume netboot if "nfsroot=/path" is specified in bootstring.

Use PCI bus/dev/function numbers rather than device unit
to check first tlp in device_register().

Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.

Fix my stupid bug in cache flush code and remove one kludge for it.

- use chaned mode for RX descs and allocate only one desc per each cacheline
to avoid possible race condition between CPU writeback vs DMA write
- remove unnecessary FS and LS bits from RxD->xd0
(sys/dev/ic/tulipvar.h sets them but maybe they are ignored?)
 1.12.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.12.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.12.12.1 24-Mar-2008  keiichi sync with head.
 1.17.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.17.4.3 11-Aug-2010  yamt sync with head.
 1.17.4.2 11-Mar-2010  yamt sync with head
 1.17.4.1 04-May-2009  yamt sync with head.
 1.17.2.1 04-Jun-2008  yamt sync with head
 1.18.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.18.6.1 28-Apr-2009  skrll Sync with HEAD.
 1.20.4.2 05-Mar-2011  rmind sync with head
 1.20.4.1 30-May-2010  rmind sync with head
 1.20.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.21.4.2 05-Mar-2011  bouyer Sync with HEAD
 1.21.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.21.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.25.16.1 18-May-2014  rmind sync with head
 1.25.12.2 03-Dec-2017  jdolecek update from HEAD
 1.25.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.25.2.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.28.2.1 10-Aug-2014  tls Rebase.
 1.29.4.3 28-Aug-2017  skrll Sync with HEAD
 1.29.4.2 05-Oct-2016  skrll Sync with HEAD
 1.29.4.1 22-Sep-2015  skrll Sync with HEAD
 1.30.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.31.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.20 22-Jan-2011  joerg Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh. Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.
 1.19 10-Jan-2010  tsutsui branches: 1.19.4; 1.19.6; 1.19.8;
Make these compile with -D_DEBUG (use proper printf types).
 1.18 16-Dec-2009  matt Make cobalt build again.
 1.17 29-May-2008  tsutsui - also put a boot failure message to LCD
- fix botched (and unused) macro
- use struct lcd_message consistently
 1.16 28-May-2008  tsutsui Print boot banner and a loading kernel name onto LCD,
for users who don't have serial console. Bump version.
 1.15 28-Apr-2008  martin branches: 1.15.2;
Remove clause 3 and 4 from TNF licenses
 1.14 23-Mar-2008  tsutsui branches: 1.14.2; 1.14.4;
Use macro defined in <machine/cpu.h> for cobalt_id and device addresses etc.
since <machine/leds.h> has been removed.
Also remove redundant address definitions in Makefile and local headers.
Pointed out by dieter roelants.
 1.13 02-Mar-2008  tsutsui WARNSfy
 1.12 01-Mar-2008  tsutsui Split out a PCI configuration space read function into a separate file
so that we could use it in other sources.
 1.11 01-Mar-2008  tsutsui - print cobalt model names in boot banner
- bump version.
 1.10 30-Oct-2007  tsutsui branches: 1.10.12; 1.10.16;
Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.
 1.9 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.8 13-Aug-2007  tsutsui branches: 1.8.2; 1.8.6;
Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.7 10-Aug-2007  tsutsui Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.
 1.6 03-Aug-2007  tsutsui branches: 1.6.2;
Misc KNF and cosmetics.
 1.5 25-Nov-2005  tsutsui branches: 1.5.24; 1.5.30; 1.5.38; 1.5.40; 1.5.42; 1.5.44;
No need to include <machine/vmparam.h> here.
 1.4 10-Apr-2004  tsutsui branches: 1.4.12; 1.4.18;
Add a prompt to specify a kernel filename to be loaded on bootloader.
 1.3 07-Jan-2004  cdi branches: 1.3.4;
Pass some info from the boot loader to the kernel:

- Kernel image name
- Symbol table
- A flag indicating console presence (could be clobbered if not passed)

Add _rtt() entry to the boot loader code.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 25-Jun-2003  cdi branches: 1.1.2;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.2.4 11-Dec-2005  christos Sync with head.
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3.4.1 13-Apr-2005  tron Pull up revision 1.4 (requested by tsutsui in ticket #1070):
Add a prompt to specify a kernel filename to be loaded on bootloader.
 1.4.18.1 29-Nov-2005  yamt sync with head.
 1.4.12.5 24-Mar-2008  yamt sync with head.
 1.4.12.4 17-Mar-2008  yamt sync with head.
 1.4.12.3 15-Nov-2007  yamt sync with head.
 1.4.12.2 03-Sep-2007  yamt sync with head.
 1.4.12.1 21-Jun-2006  yamt sync with head.
 1.5.44.1 15-Aug-2007  skrll Sync with HEAD.
 1.5.42.1 07-Aug-2007  matt Sync with HEAD.
 1.5.40.2 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.5.40.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.5.38.1 03-Oct-2007  garbled Sync with HEAD
 1.5.30.3 03-Dec-2007  ad Sync with HEAD.
 1.5.30.2 03-Dec-2007  ad Sync with HEAD.
 1.5.30.1 20-Aug-2007  ad Sync with HEAD.
 1.5.24.2 04-Nov-2007  pavel Pull up following revisions (requested by tsutsui in ticket #974):
sys/arch/cobalt/cobalt/autoconf.c: revision 1.25-1.26
sys/arch/cobalt/cobalt/machdep.c: revision 1.89
sys/arch/cobalt/stand/boot/Makefile: revision 1.12
sys/arch/cobalt/stand/boot/boot.c: revision 1.10
sys/arch/cobalt/stand/boot/boot.h: revision 1.6
sys/arch/cobalt/stand/boot/cache.c: revision 1.1-1.2
sys/arch/cobalt/stand/boot/clock.c: revision 1.2
sys/arch/cobalt/stand/boot/conf.c: revision 1.5
sys/arch/cobalt/stand/boot/devopen.c: revision 1.4
sys/arch/cobalt/stand/boot/nif_tlp.c: revision 1.1
sys/arch/cobalt/stand/boot/start.S: revision 1.6
sys/arch/cobalt/stand/boot/tlp.c: revision 1.1-1.3
sys/arch/cobalt/stand/boot/version: revision 1.6
sys/lib/libsa/dev_net.h: revision 1.5
Add an extern decl of try_bootp variable here since MD sources could set it.

In device_register(), check booted devices more properly:
- check "tlp" name on netboot
- use ata channel and drive numbers to check wd unit

Assume netboot if "nfsroot=/path" is specified in bootstring.

Use PCI bus/dev/function numbers rather than device unit
to check first tlp in device_register().

Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.

Fix my stupid bug in cache flush code and remove one kludge for it.

- use chaned mode for RX descs and allocate only one desc per each cacheline
to avoid possible race condition between CPU writeback vs DMA write
- remove unnecessary FS and LS bits from RxD->xd0
(sys/dev/ic/tulipvar.h sets them but maybe they are ignored?)
 1.5.24.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.6.2.3 31-Oct-2007  joerg Sync with HEAD.
 1.6.2.2 16-Aug-2007  jmcneill Sync with HEAD.
 1.6.2.1 03-Aug-2007  jmcneill file boot.c was added on branch jmcneill-pm on 2007-08-16 11:02:16 +0000
 1.8.6.1 13-Nov-2007  bouyer Sync with HEAD
 1.8.2.2 23-Mar-2008  matt sync with HEAD
 1.8.2.1 06-Nov-2007  matt sync with HEAD
 1.10.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.10.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.10.12.1 24-Mar-2008  keiichi sync with head.
 1.14.4.3 11-Mar-2010  yamt sync with head
 1.14.4.2 04-May-2009  yamt sync with head.
 1.14.4.1 16-May-2008  yamt sync with head.
 1.14.2.2 04-Jun-2008  yamt sync with head
 1.14.2.1 18-May-2008  yamt sync with head.
 1.15.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.19.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.19.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.19.4.1 05-Mar-2011  rmind sync with head
 1.13 23-Jun-2015  matt #include <mips/cpuregs.h>
 1.12 29-May-2008  tsutsui branches: 1.12.42; 1.12.62;
- also put a boot failure message to LCD
- fix botched (and unused) macro
- use struct lcd_message consistently
 1.11 28-May-2008  tsutsui Print boot banner and a loading kernel name onto LCD,
for users who don't have serial console. Bump version.
 1.10 28-Apr-2008  martin branches: 1.10.2;
Remove clause 3 and 4 from TNF licenses
 1.9 23-Mar-2008  tsutsui branches: 1.9.2; 1.9.4;
Use macro defined in <machine/cpu.h> for cobalt_id and device addresses etc.
since <machine/leds.h> has been removed.
Also remove redundant address definitions in Makefile and local headers.
Pointed out by dieter roelants.
 1.8 01-Mar-2008  tsutsui Split out a PCI configuration space read function into a separate file
so that we could use it in other sources.
 1.7 01-Mar-2008  tsutsui - print cobalt model names in boot banner
- bump version.
 1.6 30-Oct-2007  tsutsui branches: 1.6.12; 1.6.16;
Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.
 1.5 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.4 03-Aug-2007  tsutsui branches: 1.4.2; 1.4.4; 1.4.8;
Misc KNF and cosmetics.
 1.3 11-Dec-2005  christos branches: 1.3.24; 1.3.30; 1.3.38; 1.3.40; 1.3.42; 1.3.44;
merge ktrace-lwp.
 1.2 10-Apr-2004  tsutsui branches: 1.2.12;
Add a prompt to specify a kernel filename to be loaded on bootloader.
 1.1 25-Jun-2003  cdi branches: 1.1.2; 1.1.6;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.6.1 13-Apr-2005  tron Pull up revision 1.2 (requested by tsutsui in ticket #1070):
Add a prompt to specify a kernel filename to be loaded on bootloader.
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.2.12.4 24-Mar-2008  yamt sync with head.
 1.2.12.3 17-Mar-2008  yamt sync with head.
 1.2.12.2 15-Nov-2007  yamt sync with head.
 1.2.12.1 03-Sep-2007  yamt sync with head.
 1.3.44.1 15-Aug-2007  skrll Sync with HEAD.
 1.3.42.1 07-Aug-2007  matt Sync with HEAD.
 1.3.40.2 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.3.40.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.3.38.1 03-Oct-2007  garbled Sync with HEAD
 1.3.30.3 03-Dec-2007  ad Sync with HEAD.
 1.3.30.2 03-Dec-2007  ad Sync with HEAD.
 1.3.30.1 20-Aug-2007  ad Sync with HEAD.
 1.3.24.2 04-Nov-2007  pavel Pull up following revisions (requested by tsutsui in ticket #974):
sys/arch/cobalt/cobalt/autoconf.c: revision 1.25-1.26
sys/arch/cobalt/cobalt/machdep.c: revision 1.89
sys/arch/cobalt/stand/boot/Makefile: revision 1.12
sys/arch/cobalt/stand/boot/boot.c: revision 1.10
sys/arch/cobalt/stand/boot/boot.h: revision 1.6
sys/arch/cobalt/stand/boot/cache.c: revision 1.1-1.2
sys/arch/cobalt/stand/boot/clock.c: revision 1.2
sys/arch/cobalt/stand/boot/conf.c: revision 1.5
sys/arch/cobalt/stand/boot/devopen.c: revision 1.4
sys/arch/cobalt/stand/boot/nif_tlp.c: revision 1.1
sys/arch/cobalt/stand/boot/start.S: revision 1.6
sys/arch/cobalt/stand/boot/tlp.c: revision 1.1-1.3
sys/arch/cobalt/stand/boot/version: revision 1.6
sys/lib/libsa/dev_net.h: revision 1.5
Add an extern decl of try_bootp variable here since MD sources could set it.

In device_register(), check booted devices more properly:
- check "tlp" name on netboot
- use ata channel and drive numbers to check wd unit

Assume netboot if "nfsroot=/path" is specified in bootstring.

Use PCI bus/dev/function numbers rather than device unit
to check first tlp in device_register().

Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.

Fix my stupid bug in cache flush code and remove one kludge for it.

- use chaned mode for RX descs and allocate only one desc per each cacheline
to avoid possible race condition between CPU writeback vs DMA write
- remove unnecessary FS and LS bits from RxD->xd0
(sys/dev/ic/tulipvar.h sets them but maybe they are ignored?)
 1.3.24.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.4.8.1 13-Nov-2007  bouyer Sync with HEAD
 1.4.4.2 23-Mar-2008  matt sync with HEAD
 1.4.4.1 06-Nov-2007  matt sync with HEAD
 1.4.2.2 31-Oct-2007  joerg Sync with HEAD.
 1.4.2.1 03-Aug-2007  joerg file boot.h was added on branch jmcneill-pm on 2007-10-31 23:13:56 +0000
 1.6.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.6.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.6.12.1 24-Mar-2008  keiichi sync with head.
 1.9.4.2 04-May-2009  yamt sync with head.
 1.9.4.1 16-May-2008  yamt sync with head.
 1.9.2.2 04-Jun-2008  yamt sync with head
 1.9.2.1 18-May-2008  yamt sync with head.
 1.10.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.12.62.1 22-Sep-2015  skrll Sync with HEAD
 1.12.42.1 03-Dec-2017  jdolecek update from HEAD
 1.7 10-Jan-2010  tsutsui Make these compile with -D_DEBUG (use proper printf types).
 1.6 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5 31-Jan-2008  tsutsui branches: 1.5.6; 1.5.8; 1.5.10;
Account bi_size properly.
 1.4 17-Oct-2007  garbled branches: 1.4.2;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.3 03-Aug-2007  tsutsui branches: 1.3.2; 1.3.4;
Misc KNF and cosmetics.
 1.2 11-Dec-2005  christos branches: 1.2.24; 1.2.30; 1.2.38; 1.2.40; 1.2.42; 1.2.44;
merge ktrace-lwp.
 1.1 07-Jan-2004  cdi branches: 1.1.4; 1.1.18;
Pass some info from the boot loader to the kernel:

- Kernel image name
- Symbol table
- A flag indicating console presence (could be clobbered if not passed)

Add _rtt() entry to the boot loader code.
 1.1.18.2 04-Feb-2008  yamt sync with head.
 1.1.18.1 03-Sep-2007  yamt sync with head.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 07-Jan-2004  skrll file bootinfo.c was added on branch ktrace-lwp on 2004-08-03 10:33:46 +0000
 1.2.44.1 15-Aug-2007  skrll Sync with HEAD.
 1.2.42.1 07-Aug-2007  matt Sync with HEAD.
 1.2.40.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.2.38.1 03-Oct-2007  garbled Sync with HEAD
 1.2.30.1 20-Aug-2007  ad Sync with HEAD.
 1.2.24.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.3.4.2 23-Mar-2008  matt sync with HEAD
 1.3.4.1 06-Nov-2007  matt sync with HEAD
 1.3.2.2 03-Aug-2007  tsutsui Misc KNF and cosmetics.
 1.3.2.1 03-Aug-2007  tsutsui file bootinfo.c was added on branch jmcneill-pm on 2007-08-03 13:15:57 +0000
 1.4.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.5.10.2 11-Mar-2010  yamt sync with head
 1.5.10.1 16-May-2008  yamt sync with head.
 1.5.8.1 18-May-2008  yamt sync with head.
 1.5.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.5 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4 17-Oct-2007  garbled branches: 1.4.16; 1.4.18; 1.4.20;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.3 03-Aug-2007  tsutsui branches: 1.3.2; 1.3.4;
Misc KNF and cosmetics.
 1.2 11-Dec-2005  christos branches: 1.2.24; 1.2.30; 1.2.38; 1.2.40; 1.2.42; 1.2.44;
merge ktrace-lwp.
 1.1 07-Jan-2004  cdi branches: 1.1.4; 1.1.18;
Pass some info from the boot loader to the kernel:

- Kernel image name
- Symbol table
- A flag indicating console presence (could be clobbered if not passed)

Add _rtt() entry to the boot loader code.
 1.1.18.1 03-Sep-2007  yamt sync with head.
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 07-Jan-2004  skrll file bootinfo.h was added on branch ktrace-lwp on 2004-08-03 10:33:46 +0000
 1.2.44.1 15-Aug-2007  skrll Sync with HEAD.
 1.2.42.1 07-Aug-2007  matt Sync with HEAD.
 1.2.40.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.2.38.1 03-Oct-2007  garbled Sync with HEAD
 1.2.30.1 20-Aug-2007  ad Sync with HEAD.
 1.2.24.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.3.4.1 06-Nov-2007  matt sync with HEAD
 1.3.2.2 03-Aug-2007  tsutsui Misc KNF and cosmetics.
 1.3.2.1 03-Aug-2007  tsutsui file bootinfo.h was added on branch jmcneill-pm on 2007-08-03 13:15:57 +0000
 1.4.20.1 16-May-2008  yamt sync with head.
 1.4.18.1 18-May-2008  yamt sync with head.
 1.4.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.2 30-Oct-2007  tsutsui branches: 1.2.2; 1.2.4; 1.2.8; 1.2.10; 1.2.12; 1.2.14; 1.2.24;
Fix my stupid bug in cache flush code and remove one kludge for it.
 1.1 30-Oct-2007  tsutsui Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.
 1.2.24.2 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.2.24.1 30-Oct-2007  wrstuden file cache.c was added on branch wrstuden-fixsa on 2008-01-06 05:00:53 +0000
 1.2.14.2 03-Dec-2007  ad Sync with HEAD.
 1.2.14.1 30-Oct-2007  ad file cache.c was added on branch vmlocking on 2007-12-03 19:03:07 +0000
 1.2.12.2 15-Nov-2007  yamt sync with head.
 1.2.12.1 30-Oct-2007  yamt file cache.c was added on branch yamt-lazymbuf on 2007-11-15 11:42:40 +0000
 1.2.10.2 13-Nov-2007  bouyer Sync with HEAD
 1.2.10.1 30-Oct-2007  bouyer file cache.c was added on branch bouyer-xenamd64 on 2007-11-13 15:58:19 +0000
 1.2.8.2 06-Nov-2007  matt sync with HEAD
 1.2.8.1 30-Oct-2007  matt file cache.c was added on branch matt-armv6 on 2007-11-06 23:15:44 +0000
 1.2.4.2 04-Nov-2007  pavel Pull up following revisions (requested by tsutsui in ticket #974):
sys/arch/cobalt/cobalt/autoconf.c: revision 1.25-1.26
sys/arch/cobalt/cobalt/machdep.c: revision 1.89
sys/arch/cobalt/stand/boot/Makefile: revision 1.12
sys/arch/cobalt/stand/boot/boot.c: revision 1.10
sys/arch/cobalt/stand/boot/boot.h: revision 1.6
sys/arch/cobalt/stand/boot/cache.c: revision 1.1-1.2
sys/arch/cobalt/stand/boot/clock.c: revision 1.2
sys/arch/cobalt/stand/boot/conf.c: revision 1.5
sys/arch/cobalt/stand/boot/devopen.c: revision 1.4
sys/arch/cobalt/stand/boot/nif_tlp.c: revision 1.1
sys/arch/cobalt/stand/boot/start.S: revision 1.6
sys/arch/cobalt/stand/boot/tlp.c: revision 1.1-1.3
sys/arch/cobalt/stand/boot/version: revision 1.6
sys/lib/libsa/dev_net.h: revision 1.5
Add an extern decl of try_bootp variable here since MD sources could set it.

In device_register(), check booted devices more properly:
- check "tlp" name on netboot
- use ata channel and drive numbers to check wd unit

Assume netboot if "nfsroot=/path" is specified in bootstring.

Use PCI bus/dev/function numbers rather than device unit
to check first tlp in device_register().

Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.

Fix my stupid bug in cache flush code and remove one kludge for it.

- use chaned mode for RX descs and allocate only one desc per each cacheline
to avoid possible race condition between CPU writeback vs DMA write
- remove unnecessary FS and LS bits from RxD->xd0
(sys/dev/ic/tulipvar.h sets them but maybe they are ignored?)
 1.2.4.1 30-Oct-2007  pavel file cache.c was added on branch netbsd-4 on 2007-11-04 16:30:54 +0000
 1.2.2.2 31-Oct-2007  joerg Sync with HEAD.
 1.2.2.1 30-Oct-2007  joerg file cache.c was added on branch jmcneill-pm on 2007-10-31 23:13:57 +0000
 1.5 21-Nov-2014  christos need clock_subr.h for bcdtobin()
 1.4 12-Jan-2009  tsutsui branches: 1.4.24;
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.3 28-Apr-2008  martin branches: 1.3.8;
Remove clause 3 and 4 from TNF licenses
 1.2 30-Oct-2007  tsutsui branches: 1.2.16; 1.2.18; 1.2.20;
Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.
 1.1 25-Jun-2003  cdi branches: 1.1.18; 1.1.54; 1.1.60; 1.1.70; 1.1.78; 1.1.80; 1.1.84;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.84.1 13-Nov-2007  bouyer Sync with HEAD
 1.1.80.1 06-Nov-2007  matt sync with HEAD
 1.1.78.1 31-Oct-2007  joerg Sync with HEAD.
 1.1.70.1 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.1.60.2 03-Dec-2007  ad Sync with HEAD.
 1.1.60.1 03-Dec-2007  ad Sync with HEAD.
 1.1.54.1 04-Nov-2007  pavel Pull up following revisions (requested by tsutsui in ticket #974):
sys/arch/cobalt/cobalt/autoconf.c: revision 1.25-1.26
sys/arch/cobalt/cobalt/machdep.c: revision 1.89
sys/arch/cobalt/stand/boot/Makefile: revision 1.12
sys/arch/cobalt/stand/boot/boot.c: revision 1.10
sys/arch/cobalt/stand/boot/boot.h: revision 1.6
sys/arch/cobalt/stand/boot/cache.c: revision 1.1-1.2
sys/arch/cobalt/stand/boot/clock.c: revision 1.2
sys/arch/cobalt/stand/boot/conf.c: revision 1.5
sys/arch/cobalt/stand/boot/devopen.c: revision 1.4
sys/arch/cobalt/stand/boot/nif_tlp.c: revision 1.1
sys/arch/cobalt/stand/boot/start.S: revision 1.6
sys/arch/cobalt/stand/boot/tlp.c: revision 1.1-1.3
sys/arch/cobalt/stand/boot/version: revision 1.6
sys/lib/libsa/dev_net.h: revision 1.5
Add an extern decl of try_bootp variable here since MD sources could set it.

In device_register(), check booted devices more properly:
- check "tlp" name on netboot
- use ata channel and drive numbers to check wd unit

Assume netboot if "nfsroot=/path" is specified in bootstring.

Use PCI bus/dev/function numbers rather than device unit
to check first tlp in device_register().

Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.

Fix my stupid bug in cache flush code and remove one kludge for it.

- use chaned mode for RX descs and allocate only one desc per each cacheline
to avoid possible race condition between CPU writeback vs DMA write
- remove unnecessary FS and LS bits from RxD->xd0
(sys/dev/ic/tulipvar.h sets them but maybe they are ignored?)
 1.1.18.1 15-Nov-2007  yamt sync with head.
 1.2.20.2 04-May-2009  yamt sync with head.
 1.2.20.1 16-May-2008  yamt sync with head.
 1.2.18.1 18-May-2008  yamt sync with head.
 1.2.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.4.24.1 03-Dec-2017  jdolecek update from HEAD
 1.7 02-Mar-2008  tsutsui WARNSfy
 1.6 17-Oct-2007  garbled branches: 1.6.12; 1.6.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.5 03-Aug-2007  tsutsui branches: 1.5.2; 1.5.4;
Misc KNF and cosmetics.
 1.4 11-Dec-2005  christos branches: 1.4.24; 1.4.30; 1.4.38; 1.4.40; 1.4.42; 1.4.44;
merge ktrace-lwp.
 1.3 08-Oct-2003  simonb branches: 1.3.16;
Remove tokens at the end of #undef.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 25-Jun-2003  cdi branches: 1.1.2;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.2 17-Mar-2008  yamt sync with head.
 1.3.16.1 03-Sep-2007  yamt sync with head.
 1.4.44.1 15-Aug-2007  skrll Sync with HEAD.
 1.4.42.1 07-Aug-2007  matt Sync with HEAD.
 1.4.40.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.4.38.1 03-Oct-2007  garbled Sync with HEAD
 1.4.30.1 20-Aug-2007  ad Sync with HEAD.
 1.4.24.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.5.4.2 23-Mar-2008  matt sync with HEAD
 1.5.4.1 06-Nov-2007  matt sync with HEAD
 1.5.2.2 03-Aug-2007  tsutsui Misc KNF and cosmetics.
 1.5.2.1 03-Aug-2007  tsutsui file com.c was added on branch jmcneill-pm on 2007-08-03 13:15:57 +0000
 1.6.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.6.12.1 24-Mar-2008  keiichi sync with head.
 1.3 22-Jan-2011  joerg Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh. Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.
 1.2 28-Apr-2008  martin branches: 1.2.22; 1.2.28; 1.2.30;
Remove clause 3 and 4 from TNF licenses
 1.1 25-Jun-2003  cdi branches: 1.1.104; 1.1.106; 1.1.108;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.108.1 16-May-2008  yamt sync with head.
 1.1.106.1 18-May-2008  yamt sync with head.
 1.1.104.1 02-Jun-2008  mjf Sync with HEAD.
 1.2.30.1 08-Feb-2011  bouyer Sync with HEAD
 1.2.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.22.1 05-Mar-2011  rmind sync with head
 1.10 13-May-2008  tsutsui On netboot specify only FS_OPS(nfs) explicitly for file_system[] fs_ops.
Trying block device fs_ops like ext2fs on netboot could be problematic
on some conditions since not all libsa functions handle errors properly.
 1.9 13-May-2008  tsutsui Remove an unused extern declaration.
 1.8 02-Dec-2007  tsutsui branches: 1.8.14; 1.8.16; 1.8.18; 1.8.20;
Use __arraycount().
 1.7 01-Dec-2007  tsutsui Add ext2fs support.
 1.6 01-Dec-2007  tsutsui Include both ffsv1 and ffsv2 supports.
 1.5 30-Oct-2007  tsutsui branches: 1.5.2;
Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.
 1.4 11-Dec-2005  christos branches: 1.4.24; 1.4.30; 1.4.40; 1.4.48; 1.4.50; 1.4.54;
merge ktrace-lwp.
 1.3 23-Jun-2005  junyoung branches: 1.3.2;
Use FS_OPS() macro.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 25-Jun-2003  cdi branches: 1.1.2;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3.2.2 07-Dec-2007  yamt sync with head
 1.3.2.1 15-Nov-2007  yamt sync with head.
 1.4.54.1 13-Nov-2007  bouyer Sync with HEAD
 1.4.50.2 09-Jan-2008  matt sync with HEAD
 1.4.50.1 06-Nov-2007  matt sync with HEAD
 1.4.48.2 03-Dec-2007  joerg Sync with HEAD.
 1.4.48.1 31-Oct-2007  joerg Sync with HEAD.
 1.4.40.1 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.4.30.1 03-Dec-2007  ad Sync with HEAD.
 1.4.24.1 04-Nov-2007  pavel Pull up following revisions (requested by tsutsui in ticket #974):
sys/arch/cobalt/cobalt/autoconf.c: revision 1.25-1.26
sys/arch/cobalt/cobalt/machdep.c: revision 1.89
sys/arch/cobalt/stand/boot/Makefile: revision 1.12
sys/arch/cobalt/stand/boot/boot.c: revision 1.10
sys/arch/cobalt/stand/boot/boot.h: revision 1.6
sys/arch/cobalt/stand/boot/cache.c: revision 1.1-1.2
sys/arch/cobalt/stand/boot/clock.c: revision 1.2
sys/arch/cobalt/stand/boot/conf.c: revision 1.5
sys/arch/cobalt/stand/boot/devopen.c: revision 1.4
sys/arch/cobalt/stand/boot/nif_tlp.c: revision 1.1
sys/arch/cobalt/stand/boot/start.S: revision 1.6
sys/arch/cobalt/stand/boot/tlp.c: revision 1.1-1.3
sys/arch/cobalt/stand/boot/version: revision 1.6
sys/lib/libsa/dev_net.h: revision 1.5
Add an extern decl of try_bootp variable here since MD sources could set it.

In device_register(), check booted devices more properly:
- check "tlp" name on netboot
- use ata channel and drive numbers to check wd unit

Assume netboot if "nfsroot=/path" is specified in bootstring.

Use PCI bus/dev/function numbers rather than device unit
to check first tlp in device_register().

Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.

Fix my stupid bug in cache flush code and remove one kludge for it.

- use chaned mode for RX descs and allocate only one desc per each cacheline
to avoid possible race condition between CPU writeback vs DMA write
- remove unnecessary FS and LS bits from RxD->xd0
(sys/dev/ic/tulipvar.h sets them but maybe they are ignored?)
 1.5.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.8.20.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.8.18.1 16-May-2008  yamt sync with head.
 1.8.16.1 18-May-2008  yamt sync with head.
 1.8.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.10 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.9 29-Apr-2008  tsutsui branches: 1.9.22; 1.9.28; 1.9.30;
- reorganize com console code
- remove unused functions
 1.8 23-Mar-2008  tsutsui branches: 1.8.2; 1.8.4;
Use macro defined in <machine/cpu.h> for cobalt_id and device addresses etc.
since <machine/leds.h> has been removed.
Also remove redundant address definitions in Makefile and local headers.
Pointed out by dieter roelants.
 1.7 16-Mar-2008  tsutsui Add support for optional Z85C30 serial console on Cobalt Qube 2700.
Bump version.
 1.6 01-Mar-2008  tsutsui cnscan() should return -1 (no input) if there is no console device.
Now wd boot works on Qube2700 (which doesn't have serial console).
 1.5 17-Oct-2007  garbled branches: 1.5.12; 1.5.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.4 03-Aug-2007  tsutsui branches: 1.4.2; 1.4.4;
Misc KNF and cosmetics.
 1.3 11-Dec-2005  christos branches: 1.3.24; 1.3.30; 1.3.38; 1.3.40; 1.3.42; 1.3.44;
merge ktrace-lwp.
 1.2 07-Aug-2003  agc branches: 1.2.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 25-Jun-2003  cdi branches: 1.1.2;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.3 24-Mar-2008  yamt sync with head.
 1.2.16.2 17-Mar-2008  yamt sync with head.
 1.2.16.1 03-Sep-2007  yamt sync with head.
 1.3.44.1 15-Aug-2007  skrll Sync with HEAD.
 1.3.42.1 07-Aug-2007  matt Sync with HEAD.
 1.3.40.2 03-Jun-2008  skrll Sync with netbsd-4.
 1.3.40.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.3.38.1 03-Oct-2007  garbled Sync with HEAD
 1.3.30.1 20-Aug-2007  ad Sync with HEAD.
 1.3.24.2 09-Mar-2008  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1096):
sys/arch/cobalt/pci/pci_machdep.c: revision 1.25
sys/arch/cobalt/stand/boot/cons.c: revision 1.6
According to info from Byron Servies on port-cobalt,
the interrupt line from the primary (and only) tulip Ethernet
on Qube2700 is connected to CPU INT2, so handle it properly
in pci_intr_map(9).
cnscan() should return -1 (no input) if there is no console device.
Now wd boot works on Qube2700 (which doesn't have serial console).
 1.3.24.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.4.4.2 23-Mar-2008  matt sync with HEAD
 1.4.4.1 06-Nov-2007  matt sync with HEAD
 1.4.2.2 03-Aug-2007  tsutsui Misc KNF and cosmetics.
 1.4.2.1 03-Aug-2007  tsutsui file cons.c was added on branch jmcneill-pm on 2007-08-03 13:15:57 +0000
 1.5.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.5.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.5.12.1 24-Mar-2008  keiichi sync with head.
 1.8.4.1 16-May-2008  yamt sync with head.
 1.8.2.1 18-May-2008  yamt sync with head.
 1.9.30.1 17-Feb-2011  bouyer Sync with HEAD
 1.9.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.22.1 05-Mar-2011  rmind sync with head
 1.5 08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.4 14-Mar-2009  dsl branches: 1.4.4; 1.4.6; 1.4.8;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.3 11-Dec-2005  christos branches: 1.3.78; 1.3.86; 1.3.92;
merge ktrace-lwp.
 1.2 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 25-Jun-2003  cdi branches: 1.1.2;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.78.1 04-May-2009  yamt sync with head.
 1.4.8.1 17-Feb-2011  bouyer Sync with HEAD
 1.4.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.4.1 05-Mar-2011  rmind sync with head
 1.7 13-May-2008  tsutsui On netboot specify only FS_OPS(nfs) explicitly for file_system[] fs_ops.
Trying block device fs_ops like ext2fs on netboot could be problematic
on some conditions since not all libsa functions handle errors properly.
 1.6 28-Apr-2008  martin branches: 1.6.2;
Remove clause 3 and 4 from TNF licenses
 1.5 02-Mar-2008  tsutsui branches: 1.5.2; 1.5.4;
WARNSfy
 1.4 30-Oct-2007  tsutsui branches: 1.4.12; 1.4.16;
Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.
 1.3 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.2 03-Aug-2007  tsutsui branches: 1.2.2; 1.2.4; 1.2.8;
Misc KNF and cosmetics.
 1.1 25-Jun-2003  cdi branches: 1.1.18; 1.1.54; 1.1.60; 1.1.68; 1.1.70; 1.1.72; 1.1.74;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.74.1 15-Aug-2007  skrll Sync with HEAD.
 1.1.72.1 07-Aug-2007  matt Sync with HEAD.
 1.1.70.2 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.1.70.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.1.68.1 03-Oct-2007  garbled Sync with HEAD
 1.1.60.2 03-Dec-2007  ad Sync with HEAD.
 1.1.60.1 20-Aug-2007  ad Sync with HEAD.
 1.1.54.2 04-Nov-2007  pavel Pull up following revisions (requested by tsutsui in ticket #974):
sys/arch/cobalt/cobalt/autoconf.c: revision 1.25-1.26
sys/arch/cobalt/cobalt/machdep.c: revision 1.89
sys/arch/cobalt/stand/boot/Makefile: revision 1.12
sys/arch/cobalt/stand/boot/boot.c: revision 1.10
sys/arch/cobalt/stand/boot/boot.h: revision 1.6
sys/arch/cobalt/stand/boot/cache.c: revision 1.1-1.2
sys/arch/cobalt/stand/boot/clock.c: revision 1.2
sys/arch/cobalt/stand/boot/conf.c: revision 1.5
sys/arch/cobalt/stand/boot/devopen.c: revision 1.4
sys/arch/cobalt/stand/boot/nif_tlp.c: revision 1.1
sys/arch/cobalt/stand/boot/start.S: revision 1.6
sys/arch/cobalt/stand/boot/tlp.c: revision 1.1-1.3
sys/arch/cobalt/stand/boot/version: revision 1.6
sys/lib/libsa/dev_net.h: revision 1.5
Add an extern decl of try_bootp variable here since MD sources could set it.

In device_register(), check booted devices more properly:
- check "tlp" name on netboot
- use ata channel and drive numbers to check wd unit

Assume netboot if "nfsroot=/path" is specified in bootstring.

Use PCI bus/dev/function numbers rather than device unit
to check first tlp in device_register().

Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.

Fix my stupid bug in cache flush code and remove one kludge for it.

- use chaned mode for RX descs and allocate only one desc per each cacheline
to avoid possible race condition between CPU writeback vs DMA write
- remove unnecessary FS and LS bits from RxD->xd0
(sys/dev/ic/tulipvar.h sets them but maybe they are ignored?)
 1.1.54.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.1.18.3 17-Mar-2008  yamt sync with head.
 1.1.18.2 15-Nov-2007  yamt sync with head.
 1.1.18.1 03-Sep-2007  yamt sync with head.
 1.2.8.1 13-Nov-2007  bouyer Sync with HEAD
 1.2.4.2 23-Mar-2008  matt sync with HEAD
 1.2.4.1 06-Nov-2007  matt sync with HEAD
 1.2.2.2 31-Oct-2007  joerg Sync with HEAD.
 1.2.2.1 03-Aug-2007  joerg file devopen.c was added on branch jmcneill-pm on 2007-10-31 23:13:57 +0000
 1.4.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.4.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.4.12.1 24-Mar-2008  keiichi sync with head.
 1.5.4.1 16-May-2008  yamt sync with head.
 1.5.2.1 18-May-2008  yamt sync with head.
 1.6.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.3 04-Sep-2018  riastradh Fix some min/max -> uimin/uimax stragglers.

Confirmed by the 2018-09-04T04:40Z autobuild.
 1.2 29-May-2008  tsutsui branches: 1.2.2; 1.2.4; 1.2.8; 1.2.22; 1.2.92; 1.2.94;
- also put a boot failure message to LCD
- fix botched (and unused) macro
- use struct lcd_message consistently
 1.1 28-May-2008  tsutsui Print boot banner and a loading kernel name onto LCD,
for users who don't have serial console. Bump version.
 1.2.94.1 10-Jun-2019  christos Sync with HEAD
 1.2.92.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.2.22.2 04-May-2009  yamt sync with head.
 1.2.22.1 29-May-2008  yamt file lcd.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:54 +0000
 1.2.8.2 23-Jun-2008  wrstuden Add files to branch that were added on -current.

After this, all that's left of update is to merge some changes
that had conflicts.
 1.2.8.1 29-May-2008  wrstuden file lcd.c was added on branch wrstuden-revivesa on 2008-06-23 05:02:12 +0000
 1.2.4.2 04-Jun-2008  yamt sync with head
 1.2.4.1 29-May-2008  yamt file lcd.c was added on branch yamt-pf42 on 2008-06-04 02:04:45 +0000
 1.2.2.2 02-Jun-2008  mjf Sync with HEAD.
 1.2.2.1 29-May-2008  mjf file lcd.c was added on branch mjf-devfs2 on 2008-06-02 13:22:00 +0000
 1.3 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.2 28-Apr-2008  martin branches: 1.2.8;
Remove clause 3 and 4 from TNF licenses
 1.1 30-Oct-2007  tsutsui branches: 1.1.2; 1.1.4; 1.1.8; 1.1.10; 1.1.12; 1.1.14; 1.1.24; 1.1.30; 1.1.32; 1.1.34;
Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.
 1.1.34.2 04-May-2009  yamt sync with head.
 1.1.34.1 16-May-2008  yamt sync with head.
 1.1.32.1 18-May-2008  yamt sync with head.
 1.1.30.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.30.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.24.2 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.1.24.1 30-Oct-2007  wrstuden file nif_tlp.c was added on branch wrstuden-fixsa on 2008-01-06 05:00:53 +0000
 1.1.14.2 03-Dec-2007  ad Sync with HEAD.
 1.1.14.1 30-Oct-2007  ad file nif_tlp.c was added on branch vmlocking on 2007-12-03 19:03:10 +0000
 1.1.12.2 15-Nov-2007  yamt sync with head.
 1.1.12.1 30-Oct-2007  yamt file nif_tlp.c was added on branch yamt-lazymbuf on 2007-11-15 11:42:40 +0000
 1.1.10.2 13-Nov-2007  bouyer Sync with HEAD
 1.1.10.1 30-Oct-2007  bouyer file nif_tlp.c was added on branch bouyer-xenamd64 on 2007-11-13 15:58:20 +0000
 1.1.8.2 06-Nov-2007  matt sync with HEAD
 1.1.8.1 30-Oct-2007  matt file nif_tlp.c was added on branch matt-armv6 on 2007-11-06 23:15:46 +0000
 1.1.4.2 04-Nov-2007  pavel Pull up following revisions (requested by tsutsui in ticket #974):
sys/arch/cobalt/cobalt/autoconf.c: revision 1.25-1.26
sys/arch/cobalt/cobalt/machdep.c: revision 1.89
sys/arch/cobalt/stand/boot/Makefile: revision 1.12
sys/arch/cobalt/stand/boot/boot.c: revision 1.10
sys/arch/cobalt/stand/boot/boot.h: revision 1.6
sys/arch/cobalt/stand/boot/cache.c: revision 1.1-1.2
sys/arch/cobalt/stand/boot/clock.c: revision 1.2
sys/arch/cobalt/stand/boot/conf.c: revision 1.5
sys/arch/cobalt/stand/boot/devopen.c: revision 1.4
sys/arch/cobalt/stand/boot/nif_tlp.c: revision 1.1
sys/arch/cobalt/stand/boot/start.S: revision 1.6
sys/arch/cobalt/stand/boot/tlp.c: revision 1.1-1.3
sys/arch/cobalt/stand/boot/version: revision 1.6
sys/lib/libsa/dev_net.h: revision 1.5
Add an extern decl of try_bootp variable here since MD sources could set it.

In device_register(), check booted devices more properly:
- check "tlp" name on netboot
- use ata channel and drive numbers to check wd unit

Assume netboot if "nfsroot=/path" is specified in bootstring.

Use PCI bus/dev/function numbers rather than device unit
to check first tlp in device_register().

Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.

Fix my stupid bug in cache flush code and remove one kludge for it.

- use chaned mode for RX descs and allocate only one desc per each cacheline
to avoid possible race condition between CPU writeback vs DMA write
- remove unnecessary FS and LS bits from RxD->xd0
(sys/dev/ic/tulipvar.h sets them but maybe they are ignored?)
 1.1.4.1 30-Oct-2007  pavel file nif_tlp.c was added on branch netbsd-4 on 2007-11-04 16:30:53 +0000
 1.1.2.2 31-Oct-2007  joerg Sync with HEAD.
 1.1.2.1 30-Oct-2007  joerg file nif_tlp.c was added on branch jmcneill-pm on 2007-10-31 23:13:57 +0000
 1.2.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.5 29-Apr-2008  tsutsui - reorganize com console code
- remove unused functions
 1.4 23-Mar-2008  tsutsui branches: 1.4.2; 1.4.4;
Use macro defined in <machine/cpu.h> for cobalt_id and device addresses etc.
since <machine/leds.h> has been removed.
Also remove redundant address definitions in Makefile and local headers.
Pointed out by dieter roelants.
 1.3 17-Oct-2007  garbled branches: 1.3.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.2 03-Aug-2007  tsutsui branches: 1.2.2; 1.2.4;
Misc KNF and cosmetics.
 1.1 25-Jun-2003  cdi branches: 1.1.18; 1.1.54; 1.1.60; 1.1.68; 1.1.70; 1.1.72; 1.1.74;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.74.1 15-Aug-2007  skrll Sync with HEAD.
 1.1.72.1 07-Aug-2007  matt Sync with HEAD.
 1.1.70.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.1.68.1 03-Oct-2007  garbled Sync with HEAD
 1.1.60.1 20-Aug-2007  ad Sync with HEAD.
 1.1.54.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.1.18.2 24-Mar-2008  yamt sync with head.
 1.1.18.1 03-Sep-2007  yamt sync with head.
 1.2.4.1 06-Nov-2007  matt sync with HEAD
 1.2.2.2 03-Aug-2007  tsutsui Misc KNF and cosmetics.
 1.2.2.1 03-Aug-2007  tsutsui file ns16550.c was added on branch jmcneill-pm on 2007-08-03 13:15:57 +0000
 1.3.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.3.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.4.4.1 16-May-2008  yamt sync with head.
 1.4.2.1 18-May-2008  yamt sync with head.
 1.6 14-May-2008  tsutsui Normalize my licenses.
 1.5 29-Apr-2008  tsutsui branches: 1.5.2;
- reorganize com console code
- remove unused functions
 1.4 23-Mar-2008  tsutsui branches: 1.4.2; 1.4.4;
Use macro defined in <machine/cpu.h> for cobalt_id and device addresses etc.
since <machine/leds.h> has been removed.
Also remove redundant address definitions in Makefile and local headers.
Pointed out by dieter roelants.
 1.3 17-Oct-2007  garbled branches: 1.3.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.2 03-Aug-2007  tsutsui branches: 1.2.2; 1.2.4;
Misc KNF and cosmetics.
 1.1 25-Jun-2003  cdi branches: 1.1.18; 1.1.54; 1.1.60; 1.1.68; 1.1.70; 1.1.72; 1.1.74;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.74.1 15-Aug-2007  skrll Sync with HEAD.
 1.1.72.1 07-Aug-2007  matt Sync with HEAD.
 1.1.70.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.1.68.1 03-Oct-2007  garbled Sync with HEAD
 1.1.60.1 20-Aug-2007  ad Sync with HEAD.
 1.1.54.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.1.18.2 24-Mar-2008  yamt sync with head.
 1.1.18.1 03-Sep-2007  yamt sync with head.
 1.2.4.1 06-Nov-2007  matt sync with HEAD
 1.2.2.2 03-Aug-2007  tsutsui Misc KNF and cosmetics.
 1.2.2.1 03-Aug-2007  tsutsui file ns16550.h was added on branch jmcneill-pm on 2007-08-03 13:15:57 +0000
 1.3.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.3.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.4.4.1 16-May-2008  yamt sync with head.
 1.4.2.1 18-May-2008  yamt sync with head.
 1.5.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.2 14-May-2008  tsutsui Normalize my licenses.
 1.1 01-Mar-2008  tsutsui branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.10; 1.1.12; 1.1.14;
Split out a PCI configuration space read function into a separate file
so that we could use it in other sources.
 1.1.14.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.1.12.1 16-May-2008  yamt sync with head.
 1.1.10.1 18-May-2008  yamt sync with head.
 1.1.8.3 02-Jun-2008  mjf Sync with HEAD.
 1.1.8.2 03-Apr-2008  mjf Sync with HEAD.
 1.1.8.1 01-Mar-2008  mjf file pci.c was added on branch mjf-devfs2 on 2008-04-03 12:42:13 +0000
 1.1.6.2 24-Mar-2008  keiichi sync with head.
 1.1.6.1 01-Mar-2008  keiichi file pci.c was added on branch keiichi-mipv6 on 2008-03-24 07:14:55 +0000
 1.1.4.2 23-Mar-2008  matt sync with HEAD
 1.1.4.1 01-Mar-2008  matt file pci.c was added on branch matt-armv6 on 2008-03-23 02:03:57 +0000
 1.1.2.2 17-Mar-2008  yamt sync with head.
 1.1.2.1 01-Mar-2008  yamt file pci.c was added on branch yamt-lazymbuf on 2008-03-17 09:14:16 +0000
 1.9 11-Jul-2015  kamil Improve spelling: regsiter -> register

This change is non-functional.

Approved by <riastradh>, <pgoyette>
 1.8 28-Apr-2008  martin branches: 1.8.44; 1.8.64;
Remove clause 3 and 4 from TNF licenses
 1.7 17-Oct-2007  garbled branches: 1.7.16; 1.7.18; 1.7.20;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.6 03-Aug-2007  tsutsui branches: 1.6.2; 1.6.4;
Misc KNF and cosmetics.
 1.5 11-Dec-2005  christos branches: 1.5.24; 1.5.30; 1.5.38; 1.5.40; 1.5.42; 1.5.44;
merge ktrace-lwp.
 1.4 01-Sep-2004  tsutsui branches: 1.4.12;
- Adapt to the MI wdc driver changes which added the notion of
"shadow registers":
http://mail-index.netbsd.org/source-changes/2004/05/25/0048.html
- While here, also fix accesses to CTL regsters to use the correct address.

Now the cobalt bootloader works again.

XXX Maybe we should make this SA wdc driver MI...
 1.3 03-Jan-2004  thorpej Rename "struct channel_softc" to "struct wdc_channel".
 1.2 14-Dec-2003  tsutsui Change unit and part variables for wd from u_int8_t to u_int.
 1.1 25-Jun-2003  cdi branches: 1.1.2;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.2 03-Sep-2004  skrll Sync with HEAD
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.12.1 03-Sep-2007  yamt sync with head.
 1.5.44.1 15-Aug-2007  skrll Sync with HEAD.
 1.5.42.1 07-Aug-2007  matt Sync with HEAD.
 1.5.40.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.5.38.1 03-Oct-2007  garbled Sync with HEAD
 1.5.30.1 20-Aug-2007  ad Sync with HEAD.
 1.5.24.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.6.4.1 06-Nov-2007  matt sync with HEAD
 1.6.2.2 03-Aug-2007  tsutsui Misc KNF and cosmetics.
 1.6.2.1 03-Aug-2007  tsutsui file pciide.c was added on branch jmcneill-pm on 2007-08-03 13:15:57 +0000
 1.7.20.1 16-May-2008  yamt sync with head.
 1.7.18.1 18-May-2008  yamt sync with head.
 1.7.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.64.1 22-Sep-2015  skrll Sync with HEAD
 1.8.44.1 03-Dec-2017  jdolecek update from HEAD
 1.5 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4 02-Mar-2008  tsutsui branches: 1.4.2; 1.4.4;
WARNSfy
 1.3 17-Oct-2007  garbled branches: 1.3.12; 1.3.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.2 03-Aug-2007  tsutsui branches: 1.2.2; 1.2.4;
Misc KNF and cosmetics.
 1.1 25-Jun-2003  cdi branches: 1.1.18; 1.1.54; 1.1.60; 1.1.68; 1.1.70; 1.1.72; 1.1.74;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.74.1 15-Aug-2007  skrll Sync with HEAD.
 1.1.72.1 07-Aug-2007  matt Sync with HEAD.
 1.1.70.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.1.68.1 03-Oct-2007  garbled Sync with HEAD
 1.1.60.1 20-Aug-2007  ad Sync with HEAD.
 1.1.54.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.1.18.2 17-Mar-2008  yamt sync with head.
 1.1.18.1 03-Sep-2007  yamt sync with head.
 1.2.4.2 23-Mar-2008  matt sync with HEAD
 1.2.4.1 06-Nov-2007  matt sync with HEAD
 1.2.2.2 03-Aug-2007  tsutsui Misc KNF and cosmetics.
 1.2.2.1 03-Aug-2007  tsutsui file prf.c was added on branch jmcneill-pm on 2007-08-03 13:15:58 +0000
 1.3.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.3.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.3.12.1 24-Mar-2008  keiichi sync with head.
 1.4.4.1 16-May-2008  yamt sync with head.
 1.4.2.1 18-May-2008  yamt sync with head.
 1.7 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6 30-Oct-2007  tsutsui branches: 1.6.16; 1.6.18; 1.6.20;
Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.
 1.5 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.4 25-Jul-2007  tsutsui branches: 1.4.4; 1.4.6; 1.4.10;
Flush all cache data at the beginning of the bootloader.

Fixes silent hangs after loading 4.0_BETA2 GENERIC kernel
on Qube2 (and RaQ2) with 256MB RAM, reported and tested
by James Hartley on port-cobalt.

Obviously this should be pulled up to netbsd-4.
 1.3 11-Dec-2005  christos branches: 1.3.24; 1.3.30; 1.3.38; 1.3.40; 1.3.42; 1.3.44;
merge ktrace-lwp.
 1.2 07-Jan-2004  cdi branches: 1.2.16;
Pass some info from the boot loader to the kernel:

- Kernel image name
- Symbol table
- A flag indicating console presence (could be clobbered if not passed)

Add _rtt() entry to the boot loader code.
 1.1 25-Jun-2003  cdi branches: 1.1.2;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.2.16.2 15-Nov-2007  yamt sync with head.
 1.2.16.1 03-Sep-2007  yamt sync with head.
 1.3.44.1 15-Aug-2007  skrll Sync with HEAD.
 1.3.42.1 07-Aug-2007  matt Sync with HEAD.
 1.3.40.2 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.3.40.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.3.38.1 03-Oct-2007  garbled Sync with HEAD
 1.3.30.2 03-Dec-2007  ad Sync with HEAD.
 1.3.30.1 20-Aug-2007  ad Sync with HEAD.
 1.3.24.2 04-Nov-2007  pavel Pull up following revisions (requested by tsutsui in ticket #974):
sys/arch/cobalt/cobalt/autoconf.c: revision 1.25-1.26
sys/arch/cobalt/cobalt/machdep.c: revision 1.89
sys/arch/cobalt/stand/boot/Makefile: revision 1.12
sys/arch/cobalt/stand/boot/boot.c: revision 1.10
sys/arch/cobalt/stand/boot/boot.h: revision 1.6
sys/arch/cobalt/stand/boot/cache.c: revision 1.1-1.2
sys/arch/cobalt/stand/boot/clock.c: revision 1.2
sys/arch/cobalt/stand/boot/conf.c: revision 1.5
sys/arch/cobalt/stand/boot/devopen.c: revision 1.4
sys/arch/cobalt/stand/boot/nif_tlp.c: revision 1.1
sys/arch/cobalt/stand/boot/start.S: revision 1.6
sys/arch/cobalt/stand/boot/tlp.c: revision 1.1-1.3
sys/arch/cobalt/stand/boot/version: revision 1.6
sys/lib/libsa/dev_net.h: revision 1.5
Add an extern decl of try_bootp variable here since MD sources could set it.

In device_register(), check booted devices more properly:
- check "tlp" name on netboot
- use ata channel and drive numbers to check wd unit

Assume netboot if "nfsroot=/path" is specified in bootstring.

Use PCI bus/dev/function numbers rather than device unit
to check first tlp in device_register().

Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.

Fix my stupid bug in cache flush code and remove one kludge for it.

- use chaned mode for RX descs and allocate only one desc per each cacheline
to avoid possible race condition between CPU writeback vs DMA write
- remove unnecessary FS and LS bits from RxD->xd0
(sys/dev/ic/tulipvar.h sets them but maybe they are ignored?)
 1.3.24.1 26-Jul-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #793):
sys/arch/cobalt/stand/boot/start.S: revision 1.4
sys/arch/cobalt/stand/boot/version: revision 1.2
Flush all cache data at the beginning of the bootloader.
Fixes silent hangs after loading 4.0_BETA2 GENERIC kernel
on Qube2 (and RaQ2) with 256MB RAM, reported and tested
by James Hartley on port-cobalt.
Obviously this should be pulled up to netbsd-4.
 1.4.10.1 13-Nov-2007  bouyer Sync with HEAD
 1.4.6.1 06-Nov-2007  matt sync with HEAD
 1.4.4.1 31-Oct-2007  joerg Sync with HEAD.
 1.6.20.1 16-May-2008  yamt sync with head.
 1.6.18.1 18-May-2008  yamt sync with head.
 1.6.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.5 29-Apr-2022  rin Fix fallout from libsa change; stand.h includes <sys/param.h> now.

SCANWAIT and PWAIT are renamed to SCANDELAY and SCANWAIT, respectively,
in order not to redefine PWAIT.

XXX
Too many copies for tgets.c...
 1.4 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.3 03-Aug-2007  tsutsui branches: 1.3.2; 1.3.4;
Misc KNF and cosmetics.
 1.2 11-Dec-2005  christos branches: 1.2.24; 1.2.30; 1.2.38; 1.2.40; 1.2.42; 1.2.44;
merge ktrace-lwp.
 1.1 10-Apr-2004  tsutsui branches: 1.1.2; 1.1.14; 1.1.16;
Add a prompt to specify a kernel filename to be loaded on bootloader.
 1.1.16.1 03-Sep-2007  yamt sync with head.
 1.1.14.1 13-Apr-2005  tron Pull up revision 1.1 (requested by tsutsui in ticket #1070):
Add a prompt to specify a kernel filename to be loaded on bootloader.
 1.1.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.2 03-Aug-2004  skrll Sync with HEAD
 1.1.2.1 10-Apr-2004  skrll file tgets.c was added on branch ktrace-lwp on 2004-08-03 10:33:46 +0000
 1.2.44.1 15-Aug-2007  skrll Sync with HEAD.
 1.2.42.1 07-Aug-2007  matt Sync with HEAD.
 1.2.40.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.2.38.1 03-Oct-2007  garbled Sync with HEAD
 1.2.30.1 20-Aug-2007  ad Sync with HEAD.
 1.2.24.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.3.4.1 06-Nov-2007  matt sync with HEAD
 1.3.2.2 03-Aug-2007  tsutsui Misc KNF and cosmetics.
 1.3.2.1 03-Aug-2007  tsutsui file tgets.c was added on branch jmcneill-pm on 2007-08-03 13:15:58 +0000
 1.10 24-Jul-2021  andvar Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
 1.9 19-Jan-2010  tsutsui branches: 1.9.80;
Use -DLIBSA_PRINTF_LONGLONG_SUPPORT -DLIBSA_PRINTF_WIDTH_SUPPORT
in debug printf()s.
 1.8 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.7 23-Mar-2008  tsutsui branches: 1.7.2; 1.7.4;
Use macro defined in <machine/cpu.h> for cobalt_id and device addresses etc.
since <machine/leds.h> has been removed.
Also remove redundant address definitions in Makefile and local headers.
Pointed out by dieter roelants.
 1.6 16-Mar-2008  tsutsui Add more wait after sending a setup packet since
21041 on Qube 2700 seems to require more setup time.
 1.5 01-Mar-2008  tsutsui Misc fixes to support 21041 on Qube2700:
- prepare two TX descriptors to avoid race and also use chaind mode
- use a recently added pcicfgread() function to get tulip I/O address
- use cobalt model id to see if we have 21041 or 21143
(XXX maybe it's better to see PCI product ID)
- add code to reset SIA on 21041
- prepare and send filter setup packet on init
- reduce delay in RX polling
- bump version again

Now netboot works fine on Qube 2700 (even without console). Yay.
 1.4 01-Mar-2008  tsutsui Rename some variables to sync with original sandpoint's one.
 1.3 31-Oct-2007  tsutsui branches: 1.3.2; 1.3.4; 1.3.8; 1.3.10; 1.3.12; 1.3.14; 1.3.24; 1.3.26; 1.3.30;
- use chaned mode for RX descs and allocate only one desc per each cacheline
to avoid possible race condition between CPU writeback vs DMA write
- remove unnecessary FS and LS bits from RxD->xd0
(sys/dev/ic/tulipvar.h sets them but maybe they are ignored?)
 1.2 30-Oct-2007  tsutsui Fix my stupid bug in cache flush code and remove one kludge for it.
 1.1 30-Oct-2007  tsutsui Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.
 1.3.30.2 02-Jun-2008  mjf Sync with HEAD.
 1.3.30.1 03-Apr-2008  mjf Sync with HEAD.
 1.3.26.1 24-Mar-2008  keiichi sync with head.
 1.3.24.2 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.3.24.1 31-Oct-2007  wrstuden file tlp.c was added on branch wrstuden-fixsa on 2008-01-06 05:00:54 +0000
 1.3.14.2 03-Dec-2007  ad Sync with HEAD.
 1.3.14.1 31-Oct-2007  ad file tlp.c was added on branch vmlocking on 2007-12-03 19:03:11 +0000
 1.3.12.4 24-Mar-2008  yamt sync with head.
 1.3.12.3 17-Mar-2008  yamt sync with head.
 1.3.12.2 15-Nov-2007  yamt sync with head.
 1.3.12.1 31-Oct-2007  yamt file tlp.c was added on branch yamt-lazymbuf on 2007-11-15 11:42:41 +0000
 1.3.10.2 13-Nov-2007  bouyer Sync with HEAD
 1.3.10.1 31-Oct-2007  bouyer file tlp.c was added on branch bouyer-xenamd64 on 2007-11-13 15:58:21 +0000
 1.3.8.3 23-Mar-2008  matt sync with HEAD
 1.3.8.2 06-Nov-2007  matt sync with HEAD
 1.3.8.1 31-Oct-2007  matt file tlp.c was added on branch matt-armv6 on 2007-11-06 23:15:49 +0000
 1.3.4.2 04-Nov-2007  pavel Pull up following revisions (requested by tsutsui in ticket #974):
sys/arch/cobalt/cobalt/autoconf.c: revision 1.25-1.26
sys/arch/cobalt/cobalt/machdep.c: revision 1.89
sys/arch/cobalt/stand/boot/Makefile: revision 1.12
sys/arch/cobalt/stand/boot/boot.c: revision 1.10
sys/arch/cobalt/stand/boot/boot.h: revision 1.6
sys/arch/cobalt/stand/boot/cache.c: revision 1.1-1.2
sys/arch/cobalt/stand/boot/clock.c: revision 1.2
sys/arch/cobalt/stand/boot/conf.c: revision 1.5
sys/arch/cobalt/stand/boot/devopen.c: revision 1.4
sys/arch/cobalt/stand/boot/nif_tlp.c: revision 1.1
sys/arch/cobalt/stand/boot/start.S: revision 1.6
sys/arch/cobalt/stand/boot/tlp.c: revision 1.1-1.3
sys/arch/cobalt/stand/boot/version: revision 1.6
sys/lib/libsa/dev_net.h: revision 1.5
Add an extern decl of try_bootp variable here since MD sources could set it.

In device_register(), check booted devices more properly:
- check "tlp" name on netboot
- use ata channel and drive numbers to check wd unit

Assume netboot if "nfsroot=/path" is specified in bootstring.

Use PCI bus/dev/function numbers rather than device unit
to check first tlp in device_register().

Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.

Fix my stupid bug in cache flush code and remove one kludge for it.

- use chaned mode for RX descs and allocate only one desc per each cacheline
to avoid possible race condition between CPU writeback vs DMA write
- remove unnecessary FS and LS bits from RxD->xd0
(sys/dev/ic/tulipvar.h sets them but maybe they are ignored?)
 1.3.4.1 31-Oct-2007  pavel file tlp.c was added on branch netbsd-4 on 2007-11-04 16:30:55 +0000
 1.3.2.2 31-Oct-2007  joerg Sync with HEAD.
 1.3.2.1 31-Oct-2007  joerg file tlp.c was added on branch jmcneill-pm on 2007-10-31 23:13:58 +0000
 1.7.4.2 11-Mar-2010  yamt sync with head
 1.7.4.1 16-May-2008  yamt sync with head.
 1.7.2.1 18-May-2008  yamt sync with head.
 1.9.80.1 01-Aug-2021  thorpej Sync with HEAD.
 1.11 10-Jan-2010  tsutsui Add support for LBA48 read command to standalone wdc/wd driver.
Thanks to bouyer@ for comments about LBA48 boundary checks.

Tested on:
> Cobalt Qube 2700
> wd0 at atabus0 drive 0: <Hitachi HDS721616PLA380>
> wd0: 153 GB, 319120 cyl, 16 head, 63 sec, 512 bytes/sect x 321672960 sectors
via SATA-IDE converter, and NetBSD partition allocated at:
> 1: NetBSD (sysid 169)
> start 293603940, size 28069020 (13706 MB, Cyls 18276-20023/54/63)

Also bump version.
 1.10 28-May-2008  tsutsui Print boot banner and a loading kernel name onto LCD,
for users who don't have serial console. Bump version.
 1.9 16-Mar-2008  tsutsui branches: 1.9.2; 1.9.4; 1.9.6;
Add support for optional Z85C30 serial console on Cobalt Qube 2700.
Bump version.
 1.8 01-Mar-2008  tsutsui Misc fixes to support 21041 on Qube2700:
- prepare two TX descriptors to avoid race and also use chaind mode
- use a recently added pcicfgread() function to get tulip I/O address
- use cobalt model id to see if we have 21041 or 21143
(XXX maybe it's better to see PCI product ID)
- add code to reset SIA on 21041
- prepare and send filter setup packet on init
- reduce delay in RX polling
- bump version again

Now netboot works fine on Qube 2700 (even without console). Yay.
 1.7 01-Mar-2008  tsutsui - print cobalt model names in boot banner
- bump version.
 1.6 30-Oct-2007  tsutsui branches: 1.6.12; 1.6.16;
Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.
 1.5 17-Oct-2007  garbled Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.4 13-Aug-2007  tsutsui branches: 1.4.2; 1.4.6;
Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.3 10-Aug-2007  tsutsui Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.
 1.2 25-Jul-2007  tsutsui branches: 1.2.4;
Flush all cache data at the beginning of the bootloader.

Fixes silent hangs after loading 4.0_BETA2 GENERIC kernel
on Qube2 (and RaQ2) with 256MB RAM, reported and tested
by James Hartley on port-cobalt.

Obviously this should be pulled up to netbsd-4.
 1.1 25-Jun-2003  cdi branches: 1.1.18; 1.1.54; 1.1.60; 1.1.68; 1.1.70; 1.1.72; 1.1.74;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.74.1 15-Aug-2007  skrll Sync with HEAD.
 1.1.72.1 07-Aug-2007  matt Sync with HEAD.
 1.1.70.2 06-Jan-2008  wrstuden Catch up to netbsd-4.0 release.
 1.1.70.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.1.68.1 03-Oct-2007  garbled Sync with HEAD
 1.1.60.3 03-Dec-2007  ad Sync with HEAD.
 1.1.60.2 03-Dec-2007  ad Sync with HEAD.
 1.1.60.1 20-Aug-2007  ad Sync with HEAD.
 1.1.54.3 04-Nov-2007  pavel Pull up following revisions (requested by tsutsui in ticket #974):
sys/arch/cobalt/cobalt/autoconf.c: revision 1.25-1.26
sys/arch/cobalt/cobalt/machdep.c: revision 1.89
sys/arch/cobalt/stand/boot/Makefile: revision 1.12
sys/arch/cobalt/stand/boot/boot.c: revision 1.10
sys/arch/cobalt/stand/boot/boot.h: revision 1.6
sys/arch/cobalt/stand/boot/cache.c: revision 1.1-1.2
sys/arch/cobalt/stand/boot/clock.c: revision 1.2
sys/arch/cobalt/stand/boot/conf.c: revision 1.5
sys/arch/cobalt/stand/boot/devopen.c: revision 1.4
sys/arch/cobalt/stand/boot/nif_tlp.c: revision 1.1
sys/arch/cobalt/stand/boot/start.S: revision 1.6
sys/arch/cobalt/stand/boot/tlp.c: revision 1.1-1.3
sys/arch/cobalt/stand/boot/version: revision 1.6
sys/lib/libsa/dev_net.h: revision 1.5
Add an extern decl of try_bootp variable here since MD sources could set it.

In device_register(), check booted devices more properly:
- check "tlp" name on netboot
- use ata channel and drive numbers to check wd unit

Assume netboot if "nfsroot=/path" is specified in bootstring.

Use PCI bus/dev/function numbers rather than device unit
to check first tlp in device_register().

Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.

Fix my stupid bug in cache flush code and remove one kludge for it.

- use chaned mode for RX descs and allocate only one desc per each cacheline
to avoid possible race condition between CPU writeback vs DMA write
- remove unnecessary FS and LS bits from RxD->xd0
(sys/dev/ic/tulipvar.h sets them but maybe they are ignored?)
 1.1.54.2 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.1.54.1 26-Jul-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #793):
sys/arch/cobalt/stand/boot/start.S: revision 1.4
sys/arch/cobalt/stand/boot/version: revision 1.2
Flush all cache data at the beginning of the bootloader.
Fixes silent hangs after loading 4.0_BETA2 GENERIC kernel
on Qube2 (and RaQ2) with 256MB RAM, reported and tested
by James Hartley on port-cobalt.
Obviously this should be pulled up to netbsd-4.
 1.1.18.3 17-Mar-2008  yamt sync with head.
 1.1.18.2 15-Nov-2007  yamt sync with head.
 1.1.18.1 03-Sep-2007  yamt sync with head.
 1.2.4.2 31-Oct-2007  joerg Sync with HEAD.
 1.2.4.1 16-Aug-2007  jmcneill Sync with HEAD.
 1.4.6.1 13-Nov-2007  bouyer Sync with HEAD
 1.4.2.2 23-Mar-2008  matt sync with HEAD
 1.4.2.1 06-Nov-2007  matt sync with HEAD
 1.6.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.6.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.6.12.1 24-Mar-2008  keiichi sync with head.
 1.9.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.9.4.2 11-Mar-2010  yamt sync with head
 1.9.4.1 04-May-2009  yamt sync with head.
 1.9.2.1 04-Jun-2008  yamt sync with head
 1.18 08-Jan-2019  jdolecek no need to include <machine/param.h> if <sys/param.h> already included
 1.17 02-Jan-2015  christos branches: 1.17.16; 1.17.18;
We have three sets of DTYPE_ constants in the kernel:
altq Drop Type
disklabel Disk Type
file Descriptor Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
 1.16 03-Apr-2014  joerg branches: 1.16.6;
Avoid type pruning.
 1.15 17-Jul-2011  joerg branches: 1.15.2; 1.15.12; 1.15.16;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.14 07-Jul-2011  mrg avoid pointer aliasing issues
 1.13 11-Jul-2010  he Include <sys/param.h> for howmany() definition.
OK'ed by tsutsui@.
 1.12 19-Jan-2010  tsutsui branches: 1.12.2; 1.12.4;
Use -DLIBSA_PRINTF_LONGLONG_SUPPORT -DLIBSA_PRINTF_WIDTH_SUPPORT
in debug printf()s.
 1.11 10-Jan-2010  tsutsui Add support for LBA48 read command to standalone wdc/wd driver.
Thanks to bouyer@ for comments about LBA48 boundary checks.

Tested on:
> Cobalt Qube 2700
> wd0 at atabus0 drive 0: <Hitachi HDS721616PLA380>
> wd0: 153 GB, 319120 cyl, 16 head, 63 sec, 512 bytes/sect x 321672960 sectors
via SATA-IDE converter, and NetBSD partition allocated at:
> 1: NetBSD (sysid 169)
> start 293603940, size 28069020 (13706 MB, Cyls 18276-20023/54/63)

Also bump version.
 1.10 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9 02-Mar-2008  tsutsui branches: 1.9.2; 1.9.4;
WARNSfy
 1.8 17-Oct-2007  garbled branches: 1.8.12; 1.8.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.7 03-Aug-2007  tsutsui branches: 1.7.2; 1.7.4;
Misc KNF and cosmetics.
 1.6 03-Aug-2007  tsutsui Add support for booting off raidframe RAID1 mirrors.

Should close PR port-cobalt/36639, but with a different way
(which is similar with pmax) from a patch in the PR.
 1.5 11-Dec-2005  christos branches: 1.5.24; 1.5.30; 1.5.38; 1.5.40; 1.5.42; 1.5.44;
merge ktrace-lwp.
 1.4 14-Dec-2003  tsutsui branches: 1.4.16;
Change unit and part variables for wd from u_int8_t to u_int.
 1.3 13-Dec-2003  he Adapt to rename of WDC_CAP_LBA48 to ATA_CMD2_LBA48 in atareg.h,
and don't use types which will be promoted when passed as ...,
causing a warning.
 1.2 08-Oct-2003  lukem Overhaul MBR handling (part 1):

<sys/bootblock.h>:
* Added definitions for the Master Boot Record (MBR) used by
a variety of systems (primarily i386), including the format
of the BIOS Parameter Block (BPB).
This information was cribbed from a variety of sources
including <sys/disklabel_mbr.h> which this is a superset of.

As part of this, some data structure elements and #defines
were renamed to be more "namespace friendly" and consistent
with other bootblocks and MBR documentation.
Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
* Deprecated in favor of <sys/bootblock.h> (the latter is more
"host tool" friendly).

amd64 & i386:
* Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
be consistent with the naming convention of the msdosfs tools.

* Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
and it's confusing to have two functionally equivalent bootblocks,
especially given that "ufs" has multiple meanings (it could be
a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

* Rework pbr.S (the first sector of bootxx_*):
+ Ensure that BPB (bytes 11..89) and the partition table
(bytes 446..509) do not contain code.
+ Add support for booting from FAT partitions if BOOT_FROM_FAT
is defined. (Only set for bootxx_msdos).
+ Remove "dummy" partition 3; if people want to installboot(8)
these to the start of the disk they can use fdisk(8) to
create a real MBR partition table...
+ Compile with TERSE_ERROR so it fits because of the above.
Whilst this is less user friendly, I feel it's important
to have a valid partition table and BPB in the MBR/PBR.

* Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
with other platforms.

* Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
we can boot off FAT partitions.

* Crank version of /usr/mdec/boot to 3.1, and fix some of the other
entries in the version file.

installboot(8) (i386):
* Read the existing MBR of the filesystem and retain the BIOS
Parameter Block (BPB) in bytes 11..89 and the MBR partition
table in bytes 446..509. (Previously installboot(8) would
trash those two sections of the MBR.)

mbrlabel(8):
* Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).
 1.1 25-Jun-2003  cdi branches: 1.1.2;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.2 17-Mar-2008  yamt sync with head.
 1.4.16.1 03-Sep-2007  yamt sync with head.
 1.5.44.1 15-Aug-2007  skrll Sync with HEAD.
 1.5.42.1 07-Aug-2007  matt Sync with HEAD.
 1.5.40.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.5.38.1 03-Oct-2007  garbled Sync with HEAD
 1.5.30.1 20-Aug-2007  ad Sync with HEAD.
 1.5.24.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.7.4.2 23-Mar-2008  matt sync with HEAD
 1.7.4.1 06-Nov-2007  matt sync with HEAD
 1.7.2.2 03-Aug-2007  tsutsui Misc KNF and cosmetics.
 1.7.2.1 03-Aug-2007  tsutsui file wd.c was added on branch jmcneill-pm on 2007-08-03 13:15:58 +0000
 1.8.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.8.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.8.12.1 24-Mar-2008  keiichi sync with head.
 1.9.4.3 11-Aug-2010  yamt sync with head.
 1.9.4.2 11-Mar-2010  yamt sync with head
 1.9.4.1 16-May-2008  yamt sync with head.
 1.9.2.1 18-May-2008  yamt sync with head.
 1.12.4.1 05-Mar-2011  rmind sync with head
 1.12.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.15.16.1 18-May-2014  rmind sync with head
 1.15.12.2 03-Dec-2017  jdolecek update from HEAD
 1.15.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.2.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.16.6.1 06-Apr-2015  skrll Sync with HEAD
 1.17.18.1 10-Jun-2019  christos Sync with HEAD
 1.17.16.1 18-Jan-2019  pgoyette Synch with HEAD
 1.16 08-Jan-2019  christos no need for <machine/param.h>
 1.15 08-Jan-2019  christos Someone should merge all the wdc copies.
Include <sys/param.h> for DEV_BSIZE/DEV_BSHIFT
 1.14 03-Apr-2014  joerg branches: 1.14.28; 1.14.30;
GC found.
 1.13 19-Jan-2010  tsutsui branches: 1.13.12; 1.13.22; 1.13.26;
Use -DLIBSA_PRINTF_LONGLONG_SUPPORT -DLIBSA_PRINTF_WIDTH_SUPPORT
in debug printf()s.
 1.12 10-Jan-2010  tsutsui Add support for LBA48 read command to standalone wdc/wd driver.
Thanks to bouyer@ for comments about LBA48 boundary checks.

Tested on:
> Cobalt Qube 2700
> wd0 at atabus0 drive 0: <Hitachi HDS721616PLA380>
> wd0: 153 GB, 319120 cyl, 16 head, 63 sec, 512 bytes/sect x 321672960 sectors
via SATA-IDE converter, and NetBSD partition allocated at:
> 1: NetBSD (sysid 169)
> start 293603940, size 28069020 (13706 MB, Cyls 18276-20023/54/63)

Also bump version.
 1.11 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.10 02-Mar-2008  tsutsui branches: 1.10.2; 1.10.4;
WARNSfy
 1.9 17-Oct-2007  garbled branches: 1.9.12; 1.9.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.8 03-Aug-2007  tsutsui branches: 1.8.2; 1.8.4;
Misc KNF and cosmetics.
 1.7 11-Dec-2005  christos branches: 1.7.24; 1.7.30; 1.7.38; 1.7.40; 1.7.42; 1.7.44;
merge ktrace-lwp.
 1.6 01-Sep-2004  tsutsui branches: 1.6.12;
- Adapt to the MI wdc driver changes which added the notion of
"shadow registers":
http://mail-index.netbsd.org/source-changes/2004/05/25/0048.html
- While here, also fix accesses to CTL regsters to use the correct address.

Now the cobalt bootloader works again.

XXX Maybe we should make this SA wdc driver MI...
 1.5 03-Jan-2004  thorpej Rename "struct channel_softc" to "struct wdc_channel".
 1.4 14-Dec-2003  tsutsui Change unit and part variables for wd from u_int8_t to u_int.
 1.3 10-Nov-2003  wiz Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.2 08-Oct-2003  lukem Overhaul MBR handling (part 1):

<sys/bootblock.h>:
* Added definitions for the Master Boot Record (MBR) used by
a variety of systems (primarily i386), including the format
of the BIOS Parameter Block (BPB).
This information was cribbed from a variety of sources
including <sys/disklabel_mbr.h> which this is a superset of.

As part of this, some data structure elements and #defines
were renamed to be more "namespace friendly" and consistent
with other bootblocks and MBR documentation.
Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
* Deprecated in favor of <sys/bootblock.h> (the latter is more
"host tool" friendly).

amd64 & i386:
* Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
be consistent with the naming convention of the msdosfs tools.

* Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
and it's confusing to have two functionally equivalent bootblocks,
especially given that "ufs" has multiple meanings (it could be
a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

* Rework pbr.S (the first sector of bootxx_*):
+ Ensure that BPB (bytes 11..89) and the partition table
(bytes 446..509) do not contain code.
+ Add support for booting from FAT partitions if BOOT_FROM_FAT
is defined. (Only set for bootxx_msdos).
+ Remove "dummy" partition 3; if people want to installboot(8)
these to the start of the disk they can use fdisk(8) to
create a real MBR partition table...
+ Compile with TERSE_ERROR so it fits because of the above.
Whilst this is less user friendly, I feel it's important
to have a valid partition table and BPB in the MBR/PBR.

* Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
with other platforms.

* Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
we can boot off FAT partitions.

* Crank version of /usr/mdec/boot to 3.1, and fix some of the other
entries in the version file.

installboot(8) (i386):
* Read the existing MBR of the filesystem and retain the BIOS
Parameter Block (BPB) in bytes 11..89 and the MBR partition
table in bytes 446..509. (Previously installboot(8) would
trash those two sections of the MBR.)

mbrlabel(8):
* Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).
 1.1 25-Jun-2003  cdi branches: 1.1.2;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.2 03-Sep-2004  skrll Sync with HEAD
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.12.2 17-Mar-2008  yamt sync with head.
 1.6.12.1 03-Sep-2007  yamt sync with head.
 1.7.44.1 15-Aug-2007  skrll Sync with HEAD.
 1.7.42.1 07-Aug-2007  matt Sync with HEAD.
 1.7.40.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.7.38.1 03-Oct-2007  garbled Sync with HEAD
 1.7.30.1 20-Aug-2007  ad Sync with HEAD.
 1.7.24.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.8.4.2 23-Mar-2008  matt sync with HEAD
 1.8.4.1 06-Nov-2007  matt sync with HEAD
 1.8.2.2 03-Aug-2007  tsutsui Misc KNF and cosmetics.
 1.8.2.1 03-Aug-2007  tsutsui file wdc.c was added on branch jmcneill-pm on 2007-08-03 13:15:58 +0000
 1.9.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.9.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.9.12.1 24-Mar-2008  keiichi sync with head.
 1.10.4.2 11-Mar-2010  yamt sync with head
 1.10.4.1 16-May-2008  yamt sync with head.
 1.10.2.1 18-May-2008  yamt sync with head.
 1.13.26.1 18-May-2014  rmind sync with head
 1.13.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.12.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.14.30.1 10-Jun-2019  christos Sync with HEAD
 1.14.28.1 18-Jan-2019  pgoyette Synch with HEAD
 1.9 10-Jan-2010  tsutsui Add support for LBA48 read command to standalone wdc/wd driver.
Thanks to bouyer@ for comments about LBA48 boundary checks.

Tested on:
> Cobalt Qube 2700
> wd0 at atabus0 drive 0: <Hitachi HDS721616PLA380>
> wd0: 153 GB, 319120 cyl, 16 head, 63 sec, 512 bytes/sect x 321672960 sectors
via SATA-IDE converter, and NetBSD partition allocated at:
> 1: NetBSD (sysid 169)
> start 293603940, size 28069020 (13706 MB, Cyls 18276-20023/54/63)

Also bump version.
 1.8 17-Oct-2007  garbled branches: 1.8.20;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.7 03-Aug-2007  tsutsui branches: 1.7.2; 1.7.4;
Misc KNF and cosmetics.
 1.6 11-Dec-2005  christos branches: 1.6.24; 1.6.30; 1.6.38; 1.6.40; 1.6.42; 1.6.44;
merge ktrace-lwp.
 1.5 01-Sep-2004  tsutsui branches: 1.5.12;
- Adapt to the MI wdc driver changes which added the notion of
"shadow registers":
http://mail-index.netbsd.org/source-changes/2004/05/25/0048.html
- While here, also fix accesses to CTL regsters to use the correct address.

Now the cobalt bootloader works again.

XXX Maybe we should make this SA wdc driver MI...
 1.4 03-Jan-2004  thorpej Rename "struct channel_softc" to "struct wdc_channel".
 1.3 14-Dec-2003  tsutsui Change unit and part variables for wd from u_int8_t to u_int.
 1.2 08-Oct-2003  lukem Overhaul MBR handling (part 1):

<sys/bootblock.h>:
* Added definitions for the Master Boot Record (MBR) used by
a variety of systems (primarily i386), including the format
of the BIOS Parameter Block (BPB).
This information was cribbed from a variety of sources
including <sys/disklabel_mbr.h> which this is a superset of.

As part of this, some data structure elements and #defines
were renamed to be more "namespace friendly" and consistent
with other bootblocks and MBR documentation.
Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
* Deprecated in favor of <sys/bootblock.h> (the latter is more
"host tool" friendly).

amd64 & i386:
* Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
be consistent with the naming convention of the msdosfs tools.

* Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
and it's confusing to have two functionally equivalent bootblocks,
especially given that "ufs" has multiple meanings (it could be
a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

* Rework pbr.S (the first sector of bootxx_*):
+ Ensure that BPB (bytes 11..89) and the partition table
(bytes 446..509) do not contain code.
+ Add support for booting from FAT partitions if BOOT_FROM_FAT
is defined. (Only set for bootxx_msdos).
+ Remove "dummy" partition 3; if people want to installboot(8)
these to the start of the disk they can use fdisk(8) to
create a real MBR partition table...
+ Compile with TERSE_ERROR so it fits because of the above.
Whilst this is less user friendly, I feel it's important
to have a valid partition table and BPB in the MBR/PBR.

* Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
with other platforms.

* Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
we can boot off FAT partitions.

* Crank version of /usr/mdec/boot to 3.1, and fix some of the other
entries in the version file.

installboot(8) (i386):
* Read the existing MBR of the filesystem and retain the BIOS
Parameter Block (BPB) in bytes 11..89 and the MBR partition
table in bytes 446..509. (Previously installboot(8) would
trash those two sections of the MBR.)

mbrlabel(8):
* Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).
 1.1 25-Jun-2003  cdi branches: 1.1.2;
Initial commit of a 1-stage boot loader for NetBSD/cobalt. Only booting off
the hard drive is supported at the moment.
 1.1.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.2 03-Sep-2004  skrll Sync with HEAD
 1.1.2.1 03-Aug-2004  skrll Sync with HEAD
 1.5.12.1 03-Sep-2007  yamt sync with head.
 1.6.44.1 15-Aug-2007  skrll Sync with HEAD.
 1.6.42.1 07-Aug-2007  matt Sync with HEAD.
 1.6.40.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.6.38.1 03-Oct-2007  garbled Sync with HEAD
 1.6.30.1 20-Aug-2007  ad Sync with HEAD.
 1.6.24.1 28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #843):
sys/arch/cobalt/stand/boot/pciide.c: revision 1.6
sys/arch/cobalt/cobalt/machdep.c: revision 1.85
sys/arch/cobalt/stand/boot/com.c: revision 1.5
sys/arch/cobalt/include/bootinfo.h: revision 1.5
sys/arch/cobalt/stand/boot/boot.c: revision 1.6
sys/arch/cobalt/stand/boot/boot.h: revision 1.4
sys/arch/cobalt/stand/boot/boot.c: revision 1.7
sys/arch/cobalt/stand/boot/boot.c: revision 1.8
sys/arch/cobalt/stand/boot/wdvar.h: revision 1.7
sys/arch/cobalt/stand/boot/wd.c: revision 1.6
sys/arch/cobalt/stand/boot/wd.c: revision 1.7
sys/arch/cobalt/stand/boot/prf.c: revision 1.2
sys/arch/cobalt/stand/boot/devopen.c: revision 1.2
sys/arch/cobalt/stand/boot/bootinfo.c: revision 1.3
sys/arch/cobalt/stand/boot/bootinfo.h: revision 1.3
sys/arch/cobalt/stand/boot/wdc.c: revision 1.8
sys/arch/cobalt/stand/boot/version: revision 1.3
sys/arch/cobalt/stand/boot/version: revision 1.4
sys/arch/cobalt/stand/boot/cons.c: revision 1.4
sys/arch/cobalt/stand/boot/ns16550.c: revision 1.2
sys/arch/cobalt/stand/boot/tgets.c: revision 1.3
sys/arch/cobalt/stand/boot/ns16550.h: revision 1.2
Add support for booting off raidframe RAID1 mirrors.

Misc KNF and cosmetics.

Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.

Lookup boothowto flags in bootinfo.

Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
 1.7.4.1 06-Nov-2007  matt sync with HEAD
 1.7.2.2 03-Aug-2007  tsutsui Misc KNF and cosmetics.
 1.7.2.1 03-Aug-2007  tsutsui file wdvar.h was added on branch jmcneill-pm on 2007-08-03 13:15:58 +0000
 1.8.20.1 11-Mar-2010  yamt sync with head
 1.4 03-May-2024  andvar s/inerttupts/interrupts/ in comments.
 1.3 14-May-2008  tsutsui Normalize my licenses.
 1.2 23-Mar-2008  tsutsui branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8; 1.2.10;
Use macro defined in <machine/cpu.h> for cobalt_id and device addresses etc.
since <machine/leds.h> has been removed.
Also remove redundant address definitions in Makefile and local headers.
Pointed out by dieter roelants.
 1.1 16-Mar-2008  tsutsui branches: 1.1.2; 1.1.4;
Add support for optional Z85C30 serial console on Cobalt Qube 2700.
Bump version.
 1.1.4.2 23-Mar-2008  matt sync with HEAD
 1.1.4.1 16-Mar-2008  matt file zs.c was added on branch matt-armv6 on 2008-03-23 02:03:57 +0000
 1.1.2.3 24-Mar-2008  yamt sync with head.
 1.1.2.2 17-Mar-2008  yamt sync with head.
 1.1.2.1 16-Mar-2008  yamt file zs.c was added on branch yamt-lazymbuf on 2008-03-17 09:14:16 +0000
 1.2.10.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.2.8.1 16-May-2008  yamt sync with head.
 1.2.6.1 18-May-2008  yamt sync with head.
 1.2.4.3 02-Jun-2008  mjf Sync with HEAD.
 1.2.4.2 03-Apr-2008  mjf Sync with HEAD.
 1.2.4.1 23-Mar-2008  mjf file zs.c was added on branch mjf-devfs2 on 2008-04-03 12:42:14 +0000
 1.2.2.2 24-Mar-2008  keiichi sync with head.
 1.2.2.1 23-Mar-2008  keiichi file zs.c was added on branch keiichi-mipv6 on 2008-03-24 07:14:55 +0000
 1.3 14-May-2008  tsutsui Normalize my licenses.
 1.2 23-Mar-2008  tsutsui branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8; 1.2.10;
Use macro defined in <machine/cpu.h> for cobalt_id and device addresses etc.
since <machine/leds.h> has been removed.
Also remove redundant address definitions in Makefile and local headers.
Pointed out by dieter roelants.
 1.1 16-Mar-2008  tsutsui branches: 1.1.2; 1.1.4;
Add support for optional Z85C30 serial console on Cobalt Qube 2700.
Bump version.
 1.1.4.2 23-Mar-2008  matt sync with HEAD
 1.1.4.1 16-Mar-2008  matt file zs.h was added on branch matt-armv6 on 2008-03-23 02:03:57 +0000
 1.1.2.3 24-Mar-2008  yamt sync with head.
 1.1.2.2 17-Mar-2008  yamt sync with head.
 1.1.2.1 16-Mar-2008  yamt file zs.h was added on branch yamt-lazymbuf on 2008-03-17 09:14:16 +0000
 1.2.10.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.2.8.1 16-May-2008  yamt sync with head.
 1.2.6.1 18-May-2008  yamt sync with head.
 1.2.4.3 02-Jun-2008  mjf Sync with HEAD.
 1.2.4.2 03-Apr-2008  mjf Sync with HEAD.
 1.2.4.1 23-Mar-2008  mjf file zs.h was added on branch mjf-devfs2 on 2008-04-03 12:42:14 +0000
 1.2.2.2 24-Mar-2008  keiichi sync with head.
 1.2.2.1 23-Mar-2008  keiichi file zs.h was added on branch keiichi-mipv6 on 2008-03-24 07:14:55 +0000

RSS XML Feed