Home | History | Annotate | only in /src/sys/arch/evbmips/malta
History log of /src/sys/arch/evbmips/malta
RevisionDateAuthorComments
 1.17 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.16 29-Jul-2012  mlelstv branches: 1.16.2;
Do not call setroot() from MD code and from MI code, which has
unwanted sideeffects in the RB_ASKNAME case. This fixes PR/46732.

No longer wrap MD cpu_rootconf(), as hp300 port stores reboot information
as a side effect. Instead call MI rootconf() from MD code which makes
rootconf() now a wrapper to setroot().

Adjust several MD routines to set the global booted_device,booted_partition
variables instead of passing partial information to setroot().

Make cpu_rootconf(9) describe the calling order.
 1.15 05-Nov-2009  dyoung branches: 1.15.12; 1.15.18;
Use deviter(9) instead of accessing alldevs directly. Test-compiled,
only.
 1.14 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.13 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.12 04-Jan-2008  ad branches: 1.12.10; 1.12.18; 1.12.24;
Fix headers.
 1.11 05-Dec-2007  tsutsui branches: 1.11.4;
Use TAILQ_FIRST(3) and TAILQ_NEXT(3) macro.
 1.10 17-Nov-2006  tsutsui branches: 1.10.26; 1.10.28; 1.10.34; 1.10.38;
Defer _spl0() or _splnone() calls (which enable hardware interrupts)
from cpu_configure(9) to cpu_initclocks(9) on mips ports which use
mips3_clockintr.c:mips3_clockintr() (i.e. CPU INT5 clock) to avoid
hardclock(9) before softclock interrupt is initialized in initclocks().
This should be harmless because initclocks() is a part of configure()
in these days and there is no MI function which expects hardware
interrupts between cpu_configure(9) and cpu_initclocks(9).

Disccussed on tech-kern and port-mips.
 1.9 26-Feb-2006  thorpej branches: 1.9.14; 1.9.16;
Use device_is_a()
 1.8 21-Feb-2006  thorpej Use device_class() instead of accessing dv_class directly.
 1.7 11-Dec-2005  christos branches: 1.7.2; 1.7.4; 1.7.6;
merge ktrace-lwp.
 1.6 09-Jun-2005  he branches: 1.6.2;
Change the second argument of config_rootfound() from a string to NULL,
so that we compile with -Wcast-qual.
 1.5 23-Oct-2004  thorpej Centralize the declaration of booted_device and booted_partition.
 1.4 15-Jul-2003  lukem __KERNEL_RCSID()
 1.3 27-Sep-2002  thorpej branches: 1.3.6;
Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.2 08-Apr-2002  simonb branches: 1.2.6; 1.2.8;
Make clock/time handling more accurate:
- Use the CPU count register for more accurate microtime (from
sbmips) and delay (based on an evbmips delay function) functions.
- Schedule the next hardclock interrupt more accurately (from
an sgimips patch by Rafal Boni). Clock drift on one board is
now ~7ppm instead of ~330ppm.
- Purge old pmax-based mcclock code.
- Correctly round off some clock-derived variable calculations.
XXX: Some of this code should be migrated to sys/arch/mips.
 1.1 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.2.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.8.1 08-Apr-2002  nathanw file autoconf.c was added on branch nathanw_sa on 2002-10-18 02:36:38 +0000
 1.2.6.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.6.1 08-Apr-2002  jdolecek file autoconf.c was added on branch kqueue on 2002-06-23 17:35:57 +0000
 1.3.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.6.4 02-Nov-2004  skrll Sync with HEAD.
 1.3.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.6.1 03-Aug-2004  skrll Sync with HEAD
 1.6.2.4 21-Jan-2008  yamt sync with head
 1.6.2.3 07-Dec-2007  yamt sync with head
 1.6.2.2 30-Dec-2006  yamt sync with head.
 1.6.2.1 21-Jun-2006  yamt sync with head.
 1.7.6.1 22-Apr-2006  simonb Sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.7.2.1 01-Mar-2006  yamt sync with head.
 1.9.16.1 10-Dec-2006  yamt sync with head.
 1.9.14.1 12-Jan-2007  ad Sync with head.
 1.10.38.1 08-Dec-2007  ad Sync with head.
 1.10.34.2 18-Feb-2008  mjf Sync with HEAD.
 1.10.34.1 08-Dec-2007  mjf Sync with HEAD.
 1.10.28.1 09-Jan-2008  matt sync with HEAD
 1.10.26.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.11.4.1 08-Jan-2008  bouyer Sync with HEAD
 1.12.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.12.18.1 28-Apr-2009  skrll Sync with HEAD.
 1.12.10.2 11-Mar-2010  yamt sync with head
 1.12.10.1 04-May-2009  yamt sync with head.
 1.15.18.1 08-Aug-2012  martin Pull up following revision(s) (requested by mlelstv in ticket #466):
sys/arch/amiga/amiga/autoconf.c: revision 1.113
sys/arch/rs6000/rs6000/autoconf.c: revision 1.4
sys/arch/emips/emips/autoconf.c: revision 1.6
sys/arch/sandpoint/sandpoint/autoconf.c: revision 1.27
sys/arch/evbmips/alchemy/autoconf.c: revision 1.18
sys/arch/sgimips/sgimips/autoconf.c: revision 1.43
sys/arch/atari/atari/autoconf.c: revision 1.63
sys/arch/powerpc/oea/ofw_autoconf.c: revision 1.17
sys/arch/mmeye/mmeye/autoconf.c: revision 1.9
distrib/sets/lists/comp/mi: revision 1.1771
sys/arch/mipsco/mipsco/autoconf.c: revision 1.25
sys/arch/iyonix/iyonix/autoconf.c: revision 1.14
sys/arch/hp300/hp300/autoconf.c: revision 1.100
sys/kern/init_main.c: revision 1.445
sys/arch/pmax/pmax/autoconf.c: revision 1.79
sys/arch/netwinder/netwinder/autoconf.c: revision 1.11
sys/arch/dreamcast/dreamcast/autoconf.c: revision 1.10
sys/arch/ibmnws/ibmnws/autoconf.c: revision 1.12
sys/arch/evbppc/ev64260/autoconf.c: revision 1.17
sys/arch/evbmips/gdium/autoconf.c: revision 1.5
sys/arch/algor/algor/autoconf.c: revision 1.21
share/man/man9/Makefile: revision 1.367
sys/arch/ews4800mips/ews4800mips/autoconf.c: revision 1.9
sys/arch/amigappc/amigappc/autoconf.c: revision 1.5
sys/arch/x86/x86/x86_autoconf.c: revision 1.65
sys/arch/acorn26/acorn26/autoconf.c: revision 1.9
sys/arch/mvmeppc/mvmeppc/autoconf.c: revision 1.13
sys/arch/vax/vax/autoconf.c: revision 1.94
sys/arch/usermode/dev/cpu.c: revision 1.72
sys/arch/evbppc/virtex/autoconf.c: revision 1.5
sys/arch/next68k/next68k/autoconf.c: revision 1.26
sys/arch/mac68k/mac68k/autoconf.c: revision 1.73
sys/arch/ia64/ia64/autoconf.c: revision 1.6
sys/arch/evbppc/obs405/obs405_autoconf.c: revision 1.6
share/man/man9/cpu_rootconf.9: revision 1.7
sys/arch/landisk/landisk/autoconf.c: revision 1.6
sys/arch/evbmips/malta/autoconf.c: revision 1.16
sys/arch/sun3/sun3/autoconf.c: revision 1.76
sys/arch/evbppc/explora/autoconf.c: revision 1.13
sys/arch/sun3/sun3/autoconf.c: revision 1.77
sys/arch/evbmips/loongson/autoconf.c: revision 1.3
sys/arch/evbmips/atheros/autoconf.c: revision 1.11
sys/arch/sparc64/sparc64/autoconf.c: revision 1.188
sys/arch/acorn32/acorn32/autoconf.c: revision 1.18
sys/arch/evbarm/evbarm/autoconf.c: revision 1.13
sys/arch/cobalt/cobalt/autoconf.c: revision 1.30
sys/arch/mvme68k/mvme68k/autoconf.c: revision 1.46
sys/arch/hp700/hp700/autoconf.c: revision 1.48
sys/arch/evbmips/adm5120/autoconf.c: revision 1.5
sys/arch/hpcmips/hpcmips/autoconf.c: revision 1.25
sys/arch/alpha/alpha/autoconf.c: revision 1.52
sys/arch/sparc/sparc/autoconf.c: revision 1.244
sys/arch/evbppc/pmppc/autoconf.c: revision 1.7
sys/arch/bebox/bebox/autoconf.c: revision 1.25
sys/arch/luna68k/luna68k/autoconf.c: revision 1.13
sys/arch/hpcarm/hpcarm/autoconf.c: revision 1.20
sys/arch/evbppc/walnut/autoconf.c: revision 1.21
sys/arch/cesfic/cesfic/autoconf.c: revision 1.26
sys/arch/cats/cats/autoconf.c: revision 1.17
sys/arch/x68k/x68k/autoconf.c: revision 1.67
sys/arch/news68k/news68k/autoconf.c: revision 1.21
sys/arch/arc/arc/autoconf.c: revision 1.34
sys/arch/evbsh3/evbsh3/autoconf.c: revision 1.11
sys/sys/conf.h: revision 1.143
sys/arch/evbmips/rasoc/autoconf.c: revision 1.3
sys/arch/hpcsh/hpcsh/autoconf.c: revision 1.26
sys/arch/sun68k/sun68k/autoconf.c: revision 1.29
sys/arch/evbmips/rmixl/autoconf.c: revision 1.6
sys/arch/zaurus/zaurus/autoconf.c: revision 1.12
sys/arch/xen/x86/autoconf.c: revision 1.15
sys/arch/evbppc/mpc85xx/autoconf.c: revision 1.6
sys/arch/shark/shark/autoconf.c: revision 1.18
sys/arch/prep/prep/autoconf.c: revision 1.25
sys/arch/newsmips/newsmips/autoconf.c: revision 1.36
sys/arch/sbmips/sbmips/autoconf.c: revision 1.8
Do not call setroot() from MD code and from MI code, which has
unwanted sideeffects in the RB_ASKNAME case. This fixes PR/46732.
No longer wrap MD cpu_rootconf(), as hp300 port stores reboot information
as a side effect. Instead call MI rootconf() from MD code which makes
rootconf() now a wrapper to setroot().
Adjust several MD routines to set the global booted_device,booted_partition
variables instead of passing partial information to setroot().
Make cpu_rootconf(9) describe the calling order.
add rootconf(9) as a link to cpu_rootconf(9)
make this compile again
 1.15.12.1 30-Oct-2012  yamt sync with head
 1.16.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.1 07-Mar-2002  simonb branches: 1.1.10; 1.1.12;
A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.1.12.2 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.1.12.1 07-Mar-2002  simonb file autoconf.h was added on branch nathanw_sa on 2002-03-07 14:44:04 +0000
 1.1.10.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.10.1 07-Mar-2002  jdolecek file autoconf.h was added on branch kqueue on 2002-06-23 17:35:57 +0000
 1.7 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.6 31-Jul-2002  simonb branches: 1.6.2;
Add kttcp, sysmon and broadcom/sibyte devices.
 1.5 26-Jul-2002  simonb Split out the {b,c}dev to a separate file, which many devices declared
conditionally so that other eval boards (say without PCI support) can
share the basic "conf.c".
 1.4 19-Jul-2002  thorpej Rename cdev_systrace_init() to cdev_clonemisc_init(), so it can
be properly used by any misc. cloning device. While here, correct
a comment to indicate that "open" is the only entry point and that
everything else is handled with fileops.
 1.3 17-Jun-2002  christos branches: 1.3.2;
MD systrace gluons.
 1.2 16-Mar-2002  martin branches: 1.2.4;
Rename ISDN devices, per discussion on tech-kern. The network devices
become ippp (ISDN ppp) and irip (ISDN raw IP). The character device now
are called: /dev/isdn (isdnd <-> kernel communication), /dev/isdnctl (dialing
and other control), /dev/isdntrc* (tracing), /dev/isdnbchan* (raw B channel
access, i.e. for user land PPP) and /dev/isdntel* (telephone devices, i.e.
for answering machines).
 1.1 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.2.4.5 30-Aug-2002  gehenna Add generic major list for evbmips. It's shared with alchemy and malta.
 1.2.4.4 30-Aug-2002  gehenna catch up with -current.
 1.2.4.3 21-Jul-2002  gehenna catch up with -current.
 1.2.4.2 14-Jul-2002  gehenna catch up with -current.
 1.2.4.1 16-May-2002  gehenna Bye block/character device swicth tables.
 1.3.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.3.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.2.1 17-Jun-2002  jdolecek file conf.c was added on branch kqueue on 2002-06-23 17:35:57 +0000
 1.6.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.6.2.1 31-Jul-2002  nathanw file conf.c was added on branch nathanw_sa on 2002-09-17 21:14:22 +0000
 1.8 02-Aug-2009  matt Use a common version of cpu.c (mmm removing identical code).
 1.7 17-Oct-2007  garbled branches: 1.7.20; 1.7.34; 1.7.38;
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 17-May-2007  yamt branches: 1.6.10;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.
 1.5 11-Dec-2005  christos branches: 1.5.26; 1.5.30; 1.5.32; 1.5.38;
merge ktrace-lwp.
 1.4 15-Jul-2003  lukem branches: 1.4.16;
__KERNEL_RCSID()
 1.3 02-Oct-2002  thorpej branches: 1.3.6;
Use CFATTACH_DECL().
 1.2 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.1 07-Mar-2002  simonb branches: 1.1.10; 1.1.12;
A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.1.12.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.12.1 07-Mar-2002  nathanw file cpu.c was added on branch nathanw_sa on 2002-10-18 02:36:38 +0000
 1.1.10.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.10.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.10.1 07-Mar-2002  jdolecek file cpu.c was added on branch kqueue on 2002-06-23 17:35:57 +0000
 1.3.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.6.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.1 03-Sep-2007  yamt sync with head.
 1.5.38.1 22-May-2007  matt Update to HEAD.
 1.5.32.1 11-Jul-2007  mjf Sync with head.
 1.5.30.1 27-May-2007  ad Sync with head.
 1.5.26.1 18-Apr-2007  ad Pull in sys/cpu.h.
 1.6.10.1 06-Nov-2007  matt sync with HEAD
 1.7.38.1 13-Jan-2010  matt Use a common cpu.c for evbmips single cpu machines
 1.7.34.1 24-Oct-2010  jym Sync with HEAD
 1.7.20.1 19-Aug-2009  yamt sync with head.
 1.3 09-Sep-2002  simonb Share disksubr.c across all evbmips "ports" (it was identical).
 1.2 09-Sep-2002  simonb Remove some unused code.
 1.1 07-Mar-2002  simonb branches: 1.1.10; 1.1.12;
A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.1.12.2 17-Sep-2002  nathanw Catch up to -current.
 1.1.12.1 07-Mar-2002  nathanw file disksubr.c was added on branch nathanw_sa on 2002-09-17 21:14:22 +0000
 1.1.10.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.10.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.10.1 07-Mar-2002  jdolecek file disksubr.c was added on branch kqueue on 2002-06-23 17:35:58 +0000
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 15-Jul-2003  lukem __KERNEL_RCSID()
 1.1 07-Mar-2002  simonb branches: 1.1.10; 1.1.12; 1.1.18;
A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.1.18.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.18.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.18.1 03-Aug-2004  skrll Sync with HEAD
 1.1.12.2 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.1.12.1 07-Mar-2002  simonb file leds.c was added on branch nathanw_sa on 2002-03-07 14:44:04 +0000
 1.1.10.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.10.1 07-Mar-2002  jdolecek file leds.c was added on branch kqueue on 2002-06-23 17:35:58 +0000
 1.47 05-Mar-2024  thorpej Move the at-shutdown call to resettodr() from cpu_reboot() to kern_reboot().

It's a small step, but it's a step.
 1.46 22-Dec-2016  cherry switch all ports to use uvm_init.c:uvm_md_init()

uvm_setpagesize() is now subsumed within this funciton.
 1.45 11-Jul-2016  matt branches: 1.45.2;
Use pmap_kenter flags to create cached/uncached entries.
#include <mips/locore.h> when appropriate
 1.44 01-Jun-2015  matt Rework cavium support in preparation for MULTIPROCESSOR support
 1.43 24-Mar-2014  christos branches: 1.43.6;
use cpu_{g,s}etmodel
 1.42 02-Mar-2012  matt branches: 1.42.2; 1.42.4;
Remove reduntant/conflicting common declarations.
 1.41 10-Jul-2011  matt branches: 1.41.2; 1.41.6;
CLeanup machine includes
 1.40 20-Feb-2011  matt Merge forward from matt-nb5-mips64.
 1.39 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.38 08-Feb-2010  joerg branches: 1.38.2; 1.38.4; 1.38.6;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.
 1.37 14-Dec-2009  matt branches: 1.37.2;
Merge from matt-nb5-mips64
Merge mips-specific arch files.
 1.36 27-Nov-2009  rmind - Use uvm_lwp_setuarea() instead of directly setting address to lwp_t::l_addr.
- Replace most remaining uses of l_addr with uvm_lwp_getuarea() or lwp_getpcb().
- Amend assembly in ports where it accesses PCB via struct user.
- Rename L_ADDR to L_PCB in few places. Reduce sys/user.h inclusions.
 1.35 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.34 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.33 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.32 13-Feb-2009  apb Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.
 1.31 30-Nov-2008  martin branches: 1.31.4;
As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.
 1.30 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.29 11-Nov-2008  dyoung It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled. So I have made two changes:

1 Do not call pmf_system_shutdown() from doshutdownhooks(). Instead,
change every call to doshutdownhooks() to a call to doshutdownhooks()
followed by a call to pmf_system_shutdown(). No functional change
is intended by this change.

2 Make i386 re-enable interrupts briefly while it calls
pmf_system_shutdown(). I leave it to others either to fix the
other ports, or to factor out some MI shutdown code, as joerg@
suggests, and fix that. Note that a functional change *is* intended
by this change.

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.
 1.28 02-Jul-2008  ad branches: 1.28.2; 1.28.4; 1.28.10;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.
 1.27 17-Oct-2007  garbled branches: 1.27.16; 1.27.20; 1.27.22; 1.27.24;
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.26 17-May-2007  yamt branches: 1.26.10;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.
 1.25 06-Mar-2007  simonb branches: 1.25.2; 1.25.4; 1.25.10;
Fix some caddr_t rototill fallout.
 1.24 05-Mar-2007  dogcow semimechanically convert 'void foo' -> 'void *foo', as part of the continuing
caddr_t fallout.
 1.23 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.22 24-Dec-2005  perry branches: 1.22.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.21 11-Dec-2005  christos merge ktrace-lwp.
 1.20 25-Apr-2005  lukem branches: 1.20.2;
Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.
 1.19 03-Apr-2004  simonb branches: 1.19.4;
Copy Izumi Tsutsui's total/avail memory message tidy up.
sgimips is a little different, that is left as is.
 1.18 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.17 30-Dec-2003  pk Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.
 1.16 27-Oct-2003  simonb Set the CPU frequency parameters from YAMON if available, and fall back
to the timer/RTC based calibration loops otherwise.
 1.15 27-Oct-2003  simonb Remove useless call to consinit().
 1.14 26-Sep-2003  simonb Cast through (void *) to appease gcc3.
XXX1 - why does this "type-punned pointer" warning only affect little-
endian MIPS and not big-endian MIPS?!
XXX2 - too much duplicated code.
 1.13 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.12 15-Jul-2003  lukem __KERNEL_RCSID()
 1.11 14-Jun-2003  thorpej branches: 1.11.2;
Also pass a type argument to comcnattach() and com_kgdb_attach().
comspeed() (and thus cominit()) may need this information.
 1.10 26-Apr-2003  ragge Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)
 1.9 02-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.8 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.7 25-Aug-2002  thorpej Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.
 1.6 05-Aug-2002  simonb branches: 1.6.2;
Fix tyop.
 1.5 04-Aug-2002  gmcgarry Merge cpu_sysctl() for all mips ports, based on powerpc and m68k precedent.

For now, only pmax implements CPU_BOOTED_KERNEL. Need to revisit.
 1.4 12-Jul-2002  simonb Add a comment; fix white-space niggle.
 1.3 09-Apr-2002  simonb branches: 1.3.2; 1.3.6;
- Calibrate the timer before the first call to delay.
- Don't use a magic number for the com port address.
 1.2 08-Apr-2002  simonb - Call mips_vector_init() before setting up the serial console, but
after setting up the prom-based console. If more than one cpu class
is enabled, the wbflush() handler (needed indirectly by com.c) won't
be set up.
- Purge some old pmax mcclock-based code.
- Remove a '#if 1/#endif' pair.
 1.1 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.3.6.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.6.1 09-Apr-2002  jdolecek file machdep.c was added on branch kqueue on 2002-06-23 17:35:58 +0000
 1.3.2.2 30-Aug-2002  gehenna catch up with -current.
 1.3.2.1 16-Jul-2002  gehenna catch up with -current.
 1.6.2.3 27-Aug-2002  nathanw Catch up to -current.
 1.6.2.2 13-Aug-2002  simonb LWP'ify the evbmips port.
 1.6.2.1 05-Aug-2002  simonb file machdep.c was added on branch nathanw_sa on 2002-08-13 04:21:57 +0000
 1.11.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.2.1 03-Aug-2004  skrll Sync with HEAD
 1.19.4.1 29-Apr-2005  kent sync with -current
 1.20.2.2 03-Sep-2007  yamt sync with head.
 1.20.2.1 21-Jun-2006  yamt sync with head.
 1.22.26.2 18-Apr-2007  ad - Further adaptations to MIPS for the yamt-idlelwp branch.
- Make curlwp a register variable on MIPS.
 1.22.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.25.10.1 22-May-2007  matt Update to HEAD.
 1.25.4.1 11-Jul-2007  mjf Sync with head.
 1.25.2.1 27-May-2007  ad Sync with head.
 1.26.10.1 06-Nov-2007  matt sync with HEAD
 1.27.24.1 03-Jul-2008  simonb Sync with head.
 1.27.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.27.20.2 11-Mar-2010  yamt sync with head
 1.27.20.1 04-May-2009  yamt sync with head.
 1.27.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.27.16.1 02-Jul-2008  mjf Sync with HEAD.
 1.28.10.10 14-Feb-2012  matt mem_cluster_cnt on mips is now a u_int.
 1.28.10.9 29-Apr-2011  matt Major merge to/from current.
Adds MIPS32/MIPS64 R2 support (24k, 74k, etc.) including COP0_USERLOCAL
Adds support for emulation of rdhwr $3,$29 instruction.
Major cleanup of SMP code. (stable on multi-core / single thread per core)
llsc locking code only used in MP capable kernels.
 1.28.10.8 21-Mar-2010  cliff mips_vector_init now takes an argument to specify splsw.
NULL specifies use the default 'std_splsw'
 1.28.10.7 28-Feb-2010  matt Use cpu_startup_common.
 1.28.10.6 27-Feb-2010  snj Fix gimplish.
 1.28.10.5 27-Feb-2010  matt For MULTIPROCESSOR kernels, enable exception fixups.
 1.28.10.4 01-Feb-2010  matt fix fallout from frame/trapframe merger.
 1.28.10.3 31-Dec-2009  matt Use mips_page_physload and mips_init_lwp0_uarea.
 1.28.10.2 07-Sep-2009  matt Update to deal with pcb_context being a label_t (this should be a common
routine).
 1.28.10.1 21-Aug-2009  matt Make MALTA LP64 capable.
 1.28.4.3 28-Apr-2009  skrll Sync with HEAD.
 1.28.4.2 03-Mar-2009  skrll Sync with HEAD.
 1.28.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.28.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.31.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.37.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.38.6.2 05-Mar-2011  bouyer Sync with HEAD
 1.38.6.1 17-Feb-2011  bouyer Sync with HEAD
 1.38.4.1 06-Jun-2011  jruoho Sync with HEAD.
 1.38.2.1 05-Mar-2011  rmind sync with head
 1.41.6.3 06-Mar-2012  mrg sync to -current
 1.41.6.2 06-Mar-2012  mrg sync to -current
 1.41.6.1 04-Mar-2012  mrg sync to latest -current.
 1.41.2.2 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.41.2.1 17-Apr-2012  yamt sync with head
 1.42.4.1 18-May-2014  rmind sync with head
 1.42.2.2 03-Dec-2017  jdolecek update from HEAD
 1.42.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.43.6.3 05-Feb-2017  skrll Sync with HEAD
 1.43.6.2 05-Oct-2016  skrll Sync with HEAD
 1.43.6.1 06-Jun-2015  skrll Sync with HEAD
 1.45.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.6 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5 11-Dec-2005  christos branches: 1.5.74; 1.5.76; 1.5.78;
merge ktrace-lwp.
 1.4 15-Jul-2003  lukem __KERNEL_RCSID()
 1.3 12-Jul-2002  simonb branches: 1.3.2; 1.3.8;
Don't need to include <sys/malloc.h>, <machine/locore.h> or
<uvm/uvm_extern.h> here.
 1.2 23-Mar-2002  simonb branches: 1.2.2; 1.2.6;
Convert evbmips to use mips/mips/bus_space_alignstride_chipdep.c.
 1.1 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.2.6.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.6.1 23-Mar-2002  jdolecek file malta_bus_io.c was added on branch kqueue on 2002-06-23 17:35:58 +0000
 1.2.2.1 16-Jul-2002  gehenna catch up with -current.
 1.3.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.8.1 03-Aug-2004  skrll Sync with HEAD
 1.3.2.2 12-Jul-2002  simonb Don't need to include <sys/malloc.h>, <machine/locore.h> or
<uvm/uvm_extern.h> here.
 1.3.2.1 12-Jul-2002  simonb file malta_bus_io.c was added on branch nathanw_sa on 2002-07-12 00:27:19 +0000
 1.5.78.1 16-May-2008  yamt sync with head.
 1.5.76.1 18-May-2008  yamt sync with head.
 1.5.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.7 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6 11-Dec-2005  christos branches: 1.6.74; 1.6.76; 1.6.78;
merge ktrace-lwp.
 1.5 15-Jul-2003  lukem __KERNEL_RCSID()
 1.4 12-Jul-2002  simonb branches: 1.4.2; 1.4.8;
Don't need to include <sys/malloc.h>, <machine/locore.h> or
<uvm/uvm_extern.h> here.
 1.3 09-Apr-2002  simonb branches: 1.3.2; 1.3.6;
Remove a few more magic numbers.
 1.2 23-Mar-2002  simonb Convert evbmips to use mips/mips/bus_space_alignstride_chipdep.c.
 1.1 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.3.6.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.6.1 09-Apr-2002  jdolecek file malta_bus_mem.c was added on branch kqueue on 2002-06-23 17:35:58 +0000
 1.3.2.1 16-Jul-2002  gehenna catch up with -current.
 1.4.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.8.1 03-Aug-2004  skrll Sync with HEAD
 1.4.2.2 12-Jul-2002  simonb Don't need to include <sys/malloc.h>, <machine/locore.h> or
<uvm/uvm_extern.h> here.
 1.4.2.1 12-Jul-2002  simonb file malta_bus_mem.c was added on branch nathanw_sa on 2002-07-12 00:27:20 +0000
 1.6.78.1 16-May-2008  yamt sync with head.
 1.6.76.1 18-May-2008  yamt sync with head.
 1.6.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.9 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.8 20-Feb-2011  matt Merge forward from matt-nb5-mips64.
 1.7 28-Apr-2008  martin branches: 1.7.18; 1.7.22; 1.7.28; 1.7.30;
Remove clause 3 and 4 from TNF licenses
 1.6 08-Jan-2008  dogcow branches: 1.6.6; 1.6.8; 1.6.10;
explicitly include <sys/device.h>
 1.5 11-Dec-2005  christos branches: 1.5.50; 1.5.56; 1.5.64;
merge ktrace-lwp.
 1.4 15-Jul-2003  lukem branches: 1.4.16;
__KERNEL_RCSID()
 1.3 12-Jul-2002  simonb branches: 1.3.2; 1.3.8;
Fix a typo in a comment.
 1.2 18-Mar-2002  simonb branches: 1.2.4; 1.2.8;
Convert to use <mips/bus_*.h>.
 1.1 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.2.8.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.8.1 18-Mar-2002  jdolecek file malta_dma.c was added on branch kqueue on 2002-06-23 17:35:58 +0000
 1.2.4.1 16-Jul-2002  gehenna catch up with -current.
 1.3.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.8.1 03-Aug-2004  skrll Sync with HEAD
 1.3.2.2 12-Jul-2002  simonb Fix a typo in a comment.
 1.3.2.1 12-Jul-2002  simonb file malta_dma.c was added on branch nathanw_sa on 2002-07-12 00:23:05 +0000
 1.4.16.1 21-Jan-2008  yamt sync with head
 1.5.64.1 08-Jan-2008  bouyer Sync with HEAD
 1.5.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.5.50.1 09-Jan-2008  matt sync with HEAD
 1.6.10.1 16-May-2008  yamt sync with head.
 1.6.8.1 18-May-2008  yamt sync with head.
 1.6.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.30.1 05-Mar-2011  bouyer Sync with HEAD
 1.7.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7.22.1 05-Mar-2011  rmind sync with head
 1.7.18.1 10-Jan-2010  matt Add generic support for DMA bounce buffers and real version of
bus_dmatag_subregion. MALTA uses it for ISADMA. Make RMIXL use
for creating 32bit and 29bit subregions.
 1.27 21-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.26 10-Nov-2019  chs branches: 1.26.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.25 26-Aug-2016  skrll branches: 1.25.16;
Adjust evbmips_iointr to pass a clockframe pointer and use it for
pwmclock @ voyager.

Suggested by matt@

Hi macallan!
 1.24 31-Mar-2014  christos branches: 1.24.6;
fix typo
 1.23 29-Mar-2014  christos make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.22 27-Oct-2012  chs branches: 1.22.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.21 04-Apr-2011  dyoung branches: 1.21.4; 1.21.14;
Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args. Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:

Xen: according to Manuel Bouyer, writing to pci_attach_args in
pci_intr_map() was a leftover from Xen 2. Probably a bug. I
stopped writing it. I have not tested this change.

siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
Probably a bug. I use a temporary variable. I have not tested this
change.

slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
Probably a bug. Use a local pci_attach_args. I have not tested
this change.

viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
caller's pci_attach_args. Probably a bug. Make a local copy of the
caller's pci_attach_args and modify the copy. I have not tested
this change.

While I'm here, make pci_mapreg_submap() static.

With these changes in place, I have tested the compilation of these
kernels:

alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC

As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:

### evbmips-el GDIUM

nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop

### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'

### ia64 GENERIC

/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
 1.20 20-Feb-2011  matt Merge forward from matt-nb5-mips64.
 1.19 26-May-2008  tsutsui branches: 1.19.16; 1.19.20; 1.19.26; 1.19.28;
Remove all initialization of obsolete ci_divisor_recip in
mips struct cpu_info and related macroes.
The member was prepared for a hack in MD microtime(9) implementation
but it has been superseded by MI timecounter(9).
 1.18 09-Jan-2008  wiz branches: 1.18.6; 1.18.8; 1.18.10; 1.18.12;
Fix typo in macro name and comments.
 1.17 08-Jan-2008  tsutsui Set proper mask values for ipl_sr_bits[] and
use C99 initializer to avoid confusion.
Tested on gxemul.
 1.16 08-Jan-2008  dogcow I'm not positive that the mips_ipl_si_to_sr assignments are correct - but
at least the thing compiles now.
 1.15 17-Oct-2007  garbled branches: 1.15.2; 1.15.8;
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.14 17-May-2007  yamt branches: 1.14.10;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.
 1.13 21-Dec-2006  yamt branches: 1.13.2; 1.13.6; 1.13.8; 1.13.14;
merge yamt-splraiseipl branch.

- finish implementing splraiseipl (and makeiplcookie).
http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
- complete workqueue(9) and fix its ipl problem, which is reported
to cause audio skipping.
- fix netbt (at least compilation problems) for some ports.
- fix PR/33218.
 1.12 02-Sep-2006  gdamore branches: 1.12.2; 1.12.4;
Remove pointless reference to evbmips/clockvar.h.
 1.11 09-Feb-2006  gdamore branches: 1.11.2;
au_icu.c is in mips/ and should not depend on evbmips intr handler struct.
convert various u_int32_t to preferred uint32_t.
 1.10 25-Nov-2005  simonb branches: 1.10.2; 1.10.4; 1.10.6;
Include <sys/systm.h> if we use printf(), instead of relying on some
other random header pulling <sys/systm.h> in for us.
 1.9 15-Jul-2003  lukem branches: 1.9.16; 1.9.24;
__KERNEL_RCSID()
 1.8 25-May-2003  tsutsui branches: 1.8.2;
Use common mips/softintr.c for softintr(9) on evbmips.
Ok'ed by simonb.
 1.7 06-Dec-2002  simonb Fix a typo in the PCI map array (no functionality changes in practice).
 1.6 10-Nov-2002  simonb Keep the knowledge of the H/W interrupt 5 event counter local to
interrupt.c. This change also unmasked the fact that the Alchemy
boards did not initialise this counter.
 1.5 29-Aug-2002  simonb It's the gt64120, not the gt62140.
 1.4 29-Jul-2002  simonb branches: 1.4.2;
Move the soft interrupts IPL masks from port-specific code to
board-specific code.
Change a u_long to a uint32_t in the timer calibration routines.
 1.3 04-Jun-2002  simonb branches: 1.3.2;
3 ports are now using the reciprocal count divisor code now, move it
to <mips/cpu.h>, and add MIPS_SET_CI_RECIPRICAL and MIPS_COUNT_TO_MHZ
macros to use it.
 1.2 08-Apr-2002  simonb branches: 1.2.2;
Make clock/time handling more accurate:
- Use the CPU count register for more accurate microtime (from
sbmips) and delay (based on an evbmips delay function) functions.
- Schedule the next hardclock interrupt more accurately (from
an sgimips patch by Rafal Boni). Clock drift on one board is
now ~7ppm instead of ~330ppm.
- Purge old pmax-based mcclock code.
- Correctly round off some clock-derived variable calculations.
XXX: Some of this code should be migrated to sys/arch/mips.
 1.1 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.2.2.3 31-Aug-2002  gehenna catch up with -current.
 1.2.2.2 30-Aug-2002  gehenna catch up with -current.
 1.2.2.1 14-Jul-2002  gehenna catch up with -current.
 1.3.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.2.1 04-Jun-2002  jdolecek file malta_intr.c was added on branch kqueue on 2002-06-23 17:35:59 +0000
 1.4.2.4 11-Dec-2002  thorpej Sync with HEAD.
 1.4.2.3 11-Nov-2002  nathanw Catch up to -current
 1.4.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.4.2.1 29-Jul-2002  nathanw file malta_intr.c was added on branch nathanw_sa on 2002-09-17 21:14:23 +0000
 1.8.2.4 11-Dec-2005  christos Sync with head.
 1.8.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.9.24.1 29-Nov-2005  yamt sync with head.
 1.9.16.4 21-Jan-2008  yamt sync with head
 1.9.16.3 03-Sep-2007  yamt sync with head.
 1.9.16.2 30-Dec-2006  yamt sync with head.
 1.9.16.1 21-Jun-2006  yamt sync with head.
 1.10.6.1 22-Apr-2006  simonb Sync with head.
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.10.2.1 18-Feb-2006  yamt sync with head.
 1.11.2.1 03-Sep-2006  yamt sync with head.
 1.12.4.1 22-Sep-2006  yamt fix softintr for following ports. (hopefully)
hpcmips
evbmips
algor
arc
ews4800mips
newsmips
 1.12.2.1 12-Jan-2007  ad Sync with head.
 1.13.14.1 22-May-2007  matt Update to HEAD.
 1.13.8.1 11-Jul-2007  mjf Sync with head.
 1.13.6.1 27-May-2007  ad Sync with head.
 1.13.2.1 18-Apr-2007  ad Pull in sys/cpu.h.
 1.14.10.3 23-Mar-2008  matt sync with HEAD
 1.14.10.2 09-Jan-2008  matt sync with HEAD
 1.14.10.1 06-Nov-2007  matt sync with HEAD
 1.15.8.2 10-Jan-2008  bouyer Sync with HEAD
 1.15.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.15.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.18.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.18.10.1 04-May-2009  yamt sync with head.
 1.18.8.1 04-Jun-2008  yamt sync with head
 1.18.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.19.28.1 05-Mar-2011  bouyer Sync with HEAD
 1.19.26.1 06-Jun-2011  jruoho Sync with HEAD.
 1.19.20.2 21-Apr-2011  rmind sync with head
 1.19.20.1 05-Mar-2011  rmind sync with head
 1.19.16.7 16-May-2010  matt Add IPL_DDB. This is needed for watchdog on sbmips and for IPIs used by DDB.
It's above IPL_SCHED but below IPL_HIGH.
 1.19.16.6 28-Feb-2010  matt #define __INTR_PRIVATE
 1.19.16.5 23-Feb-2010  matt Instead of a read-only ipl_sr_bits, define a ipl_sr_map struct and fill that
in the interrupt init routine. There's a default ipl_sr_map will operate
correctly, but isn't performant.
 1.19.16.4 16-Feb-2010  matt Add __HAVE_PREEMPTION support for NetBSD/mips. Kill IPL_PREEMPT since it
isn't needed.
 1.19.16.3 15-Feb-2010  matt Adapt to the new interrupt framework for NetBSD/mips.
 1.19.16.2 06-Feb-2010  matt A little constification and remove some old softintr cruft.
 1.19.16.1 20-Jan-2010  matt Adjust things to the new world order.
 1.21.14.3 03-Dec-2017  jdolecek update from HEAD
 1.21.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.21.4.2 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.21.4.1 30-Oct-2012  yamt sync with head
 1.22.2.1 18-May-2014  rmind sync with head
 1.24.6.1 05-Oct-2016  skrll Sync with HEAD
 1.25.16.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.26.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.1 07-Mar-2002  simonb branches: 1.1.10; 1.1.12;
A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.1.12.2 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.1.12.1 07-Mar-2002  simonb file maltareg.h was added on branch nathanw_sa on 2002-03-07 14:44:05 +0000
 1.1.10.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.10.1 07-Mar-2002  jdolecek file maltareg.h was added on branch kqueue on 2002-06-23 17:35:59 +0000
 1.6 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.5 20-Feb-2011  matt Merge forward from matt-nb5-mips64.
 1.4 28-Apr-2008  martin branches: 1.4.18; 1.4.22; 1.4.28; 1.4.30;
Remove clause 3 and 4 from TNF licenses
 1.3 18-Mar-2002  simonb branches: 1.3.8; 1.3.10; 1.3.118; 1.3.120; 1.3.122;
Use <mips/isa_machdep.h> and <mips/pci_machdep.h>.
 1.2 18-Mar-2002  simonb Convert to use <mips/bus_*.h>.
 1.1 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.3.122.1 16-May-2008  yamt sync with head.
 1.3.120.1 18-May-2008  yamt sync with head.
 1.3.118.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.10.2 18-Mar-2002  simonb Use <mips/isa_machdep.h> and <mips/pci_machdep.h>.
 1.3.10.1 18-Mar-2002  simonb file maltavar.h was added on branch nathanw_sa on 2002-03-18 10:10:17 +0000
 1.3.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.8.1 18-Mar-2002  jdolecek file maltavar.h was added on branch kqueue on 2002-06-23 17:35:59 +0000
 1.4.30.1 05-Mar-2011  bouyer Sync with HEAD
 1.4.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.22.1 05-Mar-2011  rmind sync with head
 1.4.18.1 10-Jan-2010  matt Add generic support for DMA bounce buffers and real version of
bus_dmatag_subregion. MALTA uses it for ISADMA. Make RMIXL use
for creating 32bit and 29bit subregions.
 1.2 13-Mar-2002  simonb Remove bogus file that shouldn't have been added in the first place.
 1.1 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.17 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.16 24-Apr-2021  thorpej branches: 1.16.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.15 02-Oct-2015  msaitoh branches: 1.15.32;
PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific
 1.14 07-Jun-2015  matt #include <mips/cpuregs.h>
 1.13 06-Jun-2011  matt branches: 1.13.12; 1.13.30;
CFATTACH_DECL(..., sizeof(struct device), -> CFATTACH_DECL_NEW(..., 0
struct device * -> device_t
struct cfdata * -> cfdata_t
use bool when appropriate
some constification
 1.12 17-May-2011  dyoung branches: 1.12.2;
PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED changed their functional
role in NetBSD (drivers are no longer supposed to write these to
pa_flags) without changing name. Correct that.

Rename PCI_FLAGS_IO_ENABLED to PCI_FLAGS_IO_OKAY and
PCI_FLAGS_MEM_ENABLED to PCI_FLAGS_MEM_OKAY, thus making their names
consistent with the other PCI flags and poisoning 3rd-party driver
sources that use the flags in the old bad way.

This patch produces no binary changes in this set of PCI kernels when
they are compiled w/o 'options DIAGNOSTIC' and w/ -V MKREPRO=yes:

algor P4032 P5064 P6032
alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE
evbarm-el GUMSTIX HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321
evbarm-el IXDP425 IXM1200 KUROBOX_PRO
evbarm-el LUBBOCK MARVELL_NAS NAPPI NSLU2 SHEEVAPLUG SMDK2800 TEAMASA_NPWR
evbarm-el TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
evbppc OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
iyonix GENERIC
landisk GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sbmips-el GENERIC
sgimips GENERIC32_IP2x GENERIC32_IP3x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC
 1.11 14-Mar-2009  dsl branches: 1.11.4; 1.11.6;
Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.10 06-Apr-2006  simonb branches: 1.10.66; 1.10.74; 1.10.80;
Remove "return" at the end of a void function.
 1.9 11-Dec-2005  christos branches: 1.9.4; 1.9.6; 1.9.8; 1.9.10; 1.9.12;
merge ktrace-lwp.
 1.8 30-Aug-2004  drochner branches: 1.8.12;
Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found()
(from a "mainbus" or a bus bridge).
Do it for isa/eisa/mca and pci/agp for now. These buses all attach to
an mi interface attribute "isabus", "eisabus" etc., and the autoconf
framework now allows to specify an interface attribute on config_found()
and config_search(), which limits the search of matching config data
to these which attach to that specific attribute.
So we basically have to call config_found_ia(..., "foobus", ...) where
such a bus is attached.
As a consequence, where a "mainbus" or alike also attaches other
devices (eg CPUs) which do not attach to a specific attribute yet,
we need at least pass an attribute name (different from "foobus") so
that the foo bus is not found at these places. This made some minor
changes necessary which are not obviously related to the mentioned buses.
 1.7 15-Jul-2003  lukem __KERNEL_RCSID()
 1.6 15-Jun-2003  fvdl branches: 1.6.2;
Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
 1.5 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL
 1.4 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.3 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.2 16-May-2002  thorpej branches: 1.2.2; 1.2.6; 1.2.8;
* Add "pcitag_t *pba_bridgetag" to pci_attach_args. This is set to
NULL for root PCI busses. For busses behind a bridge, it points to
a persistent copy of the bridge's pcitag_t. This can be very useful
for machine-dependent PCI bus enumeration code.
* Implement a machine-dependent pci_enumerate_bus() for sparc64 which
uses OFW device nodes to enumerate the bus. When a PCI bus that is
behind a bridge is attached, pci_attach_hook() allocates a new PCI
chipset tag for the new bus and sets it's "curnode" to the OFW node
of the bridge. This is used as a starting point when enumerating
that bus. Root busses get the OFW node of the host bridge (psycho).
* Garbage-collect "ofpci" and "ofppb" from the sparc64 port.
 1.1 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.2.8.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.8.1 16-May-2002  nathanw file gt.c was added on branch nathanw_sa on 2002-10-18 02:36:39 +0000
 1.2.6.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.6.1 16-May-2002  jdolecek file gt.c was added on branch kqueue on 2002-06-23 17:35:59 +0000
 1.2.2.2 16-May-2002  thorpej * Add "pcitag_t *pba_bridgetag" to pci_attach_args. This is set to
NULL for root PCI busses. For busses behind a bridge, it points to
a persistent copy of the bridge's pcitag_t. This can be very useful
for machine-dependent PCI bus enumeration code.
* Implement a machine-dependent pci_enumerate_bus() for sparc64 which
uses OFW device nodes to enumerate the bus. When a PCI bus that is
behind a bridge is attached, pci_attach_hook() allocates a new PCI
chipset tag for the new bus and sets it's "curnode" to the OFW node
of the bridge. This is used as a starting point when enumerating
that bus. Root busses get the OFW node of the host bridge (psycho).
* Garbage-collect "ofpci" and "ofppb" from the sparc64 port.
 1.2.2.1 16-May-2002  thorpej file gt.c was added on branch gehenna-devsw on 2002-05-16 01:01:37 +0000
 1.6.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.2 03-Sep-2004  skrll Sync with HEAD
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8.12.1 21-Jun-2006  yamt sync with head.
 1.9.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.9.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.9.8.1 11-Apr-2006  yamt sync with head
 1.9.6.1 22-Apr-2006  simonb Sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.10.80.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.10.74.1 28-Apr-2009  skrll Sync with HEAD.
 1.10.66.1 04-May-2009  yamt sync with head.
 1.11.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.11.4.2 12-Jun-2011  rmind sync with head
 1.11.4.1 31-May-2011  rmind sync with head
 1.12.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.13.30.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.13.30.1 22-Sep-2015  skrll Sync with HEAD
 1.13.12.1 03-Dec-2017  jdolecek update from HEAD
 1.15.32.1 23-Mar-2021  thorpej Convert config_found_ia() call sites where the device only carries
a single interface attribute to bare config_found() calls.
 1.16.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.1 07-Mar-2002  simonb branches: 1.1.10; 1.1.12; 1.1.34;
A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.1.34.1 21-Jun-2006  yamt sync with head.
 1.1.12.2 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.1.12.1 07-Mar-2002  simonb file gtreg.h was added on branch nathanw_sa on 2002-03-07 14:44:06 +0000
 1.1.10.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.10.1 07-Mar-2002  jdolecek file gtreg.h was added on branch kqueue on 2002-06-23 17:35:59 +0000
 1.1 07-Mar-2002  simonb branches: 1.1.10; 1.1.12;
A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.1.12.2 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.1.12.1 07-Mar-2002  simonb file gtvar.h was added on branch nathanw_sa on 2002-03-07 14:44:06 +0000
 1.1.10.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.10.1 07-Mar-2002  jdolecek file gtvar.h was added on branch kqueue on 2002-06-23 17:36:00 +0000
 1.18 20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.17 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.16 24-Apr-2021  thorpej branches: 1.16.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.15 07-Jul-2020  thorpej branches: 1.15.4;
Overhaul the interface to pci_configure_bus():
- Don't expose how PCI bus configuration resource management is implemented.
Provide a new resource provider API:

==> pciconf_resource_init() -- Initialize a PCI configuration resources
container.
==> pciconf_resource_add() -- Add a PCI configuration resource to the
container (I/O, MEM, or prefetchable MEM). Multiple resources of
each type may be added.
==> pciconf_resource_fini() -- Tear down the PCI configurtation resources
container once the bus has been configured.

This is much easier to use than the previous method of providing an
extent map for each kind of resource, and works better for e.g. ACPI
platforms that provide potentially multiple PCI resources in tables
provided by firmware.

- Re-implement PCI configuration resource management using vmem arenas,
rather than extent maps.
 1.14 14-Jun-2020  chs replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.13 07-Aug-2016  skrll Fix compile for PCI_NETBSD_CONFIGURE
 1.12 06-Jun-2011  matt branches: 1.12.12; 1.12.30;
CFATTACH_DECL(..., sizeof(struct device), -> CFATTACH_DECL_NEW(..., 0
struct device * -> device_t
struct cfdata * -> cfdata_t
use bool when appropriate
some constification
 1.11 14-Mar-2009  dsl branches: 1.11.4; 1.11.10;
Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.10 11-Dec-2005  christos branches: 1.10.78; 1.10.86; 1.10.92;
merge ktrace-lwp.
 1.9 26-Aug-2005  drochner s/locdesc_t/int/g
 1.8 28-Jun-2005  drochner branches: 1.8.2;
convert remaining autoconf bus "submatch" functions to use the new
signature (passing locators), and remove some which obviously don't
serve any purpose
(untested, sorry)
 1.7 15-Jul-2003  lukem __KERNEL_RCSID()
 1.6 01-Jan-2003  thorpej branches: 1.6.2;
Use aprint_normal() for cfprint routines.
 1.5 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL
 1.4 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.3 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.2 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.1 07-Mar-2002  simonb branches: 1.1.10; 1.1.12;
A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.1.12.3 03-Jan-2003  thorpej Sync with HEAD.
 1.1.12.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.12.1 07-Mar-2002  nathanw file mainbus.c was added on branch nathanw_sa on 2002-10-18 02:36:39 +0000
 1.1.10.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.10.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.10.1 07-Mar-2002  jdolecek file mainbus.c was added on branch kqueue on 2002-06-23 17:36:00 +0000
 1.6.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8.2.1 21-Jun-2006  yamt sync with head.
 1.10.92.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.10.86.1 28-Apr-2009  skrll Sync with HEAD.
 1.10.78.1 04-May-2009  yamt sync with head.
 1.11.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.11.4.1 12-Jun-2011  rmind sync with head
 1.12.30.1 05-Oct-2016  skrll Sync with HEAD
 1.12.12.1 03-Dec-2017  jdolecek update from HEAD
 1.15.4.2 22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.15.4.1 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.16.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.11 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.10 06-Jun-2011  matt branches: 1.10.2; 1.10.12;
CFATTACH_DECL(..., sizeof(struct device), -> CFATTACH_DECL_NEW(..., 0
struct device * -> device_t
struct cfdata * -> cfdata_t
use bool when appropriate
some constification
 1.9 22-Aug-2006  riz branches: 1.9.82; 1.9.92;
Vendor GALILEO is now MARVELL.
 1.8 25-Nov-2005  simonb branches: 1.8.4; 1.8.8; 1.8.18;
Include <sys/systm.h> if we use printf(), instead of relying on some
other random header pulling <sys/systm.h> in for us.
 1.7 24-Apr-2004  kleink branches: 1.7.12; 1.7.18;
Update for new pci_devinfo(9) signature.
 1.6 15-Jul-2003  lukem branches: 1.6.4;
__KERNEL_RCSID()
 1.5 03-Oct-2002  thorpej branches: 1.5.6;
Include <sys/param.h> so that we get the defn of NULL.
 1.4 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL
 1.3 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.2 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.1 07-Mar-2002  simonb branches: 1.1.10; 1.1.12;
A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.1.12.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.12.1 07-Mar-2002  nathanw file pchb.c was added on branch nathanw_sa on 2002-10-18 02:36:39 +0000
 1.1.10.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.10.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.10.1 07-Mar-2002  jdolecek file pchb.c was added on branch kqueue on 2002-06-23 17:36:00 +0000
 1.5.6.4 11-Dec-2005  christos Sync with head.
 1.5.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.6.4.1 11-Sep-2006  tron Pull up following revision(s) (requested by riz in ticket #10693):
sys/arch/cobalt/pci/pchb.c: revision 1.9 via patch
sys/dev/pci/if_sk.c: revision 1.30 via patch
sys/arch/evbmips/malta/pci/pchb.c: revision 1.9 via patch
Vendor GALILEO is now MARVELL.
 1.7.18.1 29-Nov-2005  yamt sync with head.
 1.7.12.2 30-Dec-2006  yamt sync with head.
 1.7.12.1 21-Jun-2006  yamt sync with head.
 1.8.18.1 08-Sep-2006  rpaulo Pull up following revision(s) (requested by riz in ticket #139):
sys/arch/cobalt/pci/pchb.c: revision 1.9
sys/dev/pci/if_sk.c: revision 1.30
sys/arch/cobalt/pci/pci_machdep.c: revision 1.24
sys/dev/pci/pcidevs: revision 1.820
sys/arch/evbmips/malta/pci/pchb.c: revision 1.9
Rename vendor GALILEO -> vendor MARVELL . Marvell bought Galileo years
ago, we have little existing stuff in the tree, and this will make it
easier to keep certain network drivers in sync with other OSes.
OK matt@, uwe@
Vendor GALILEO is now MARVELL.
 1.8.8.1 03-Sep-2006  yamt sync with head.
 1.8.4.1 09-Sep-2006  rpaulo sync with head
 1.9.92.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.9.82.1 12-Jun-2011  rmind sync with head
 1.10.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.10.2.1 30-Oct-2012  yamt sync with head
 1.6 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.5 20-Feb-2011  matt Merge forward from matt-nb5-mips64.
 1.4 11-Dec-2005  christos branches: 1.4.96; 1.4.100; 1.4.106; 1.4.108;
merge ktrace-lwp.
 1.3 15-Jul-2003  lukem __KERNEL_RCSID()
 1.2 18-Mar-2002  simonb branches: 1.2.8; 1.2.10; 1.2.16;
Convert to use <mips/bus_*.h>.
 1.1 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.2.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.16.1 03-Aug-2004  skrll Sync with HEAD
 1.2.10.2 18-Mar-2002  simonb Convert to use <mips/bus_*.h>.
 1.2.10.1 18-Mar-2002  simonb file pci_machdep.c was added on branch nathanw_sa on 2002-03-18 01:21:14 +0000
 1.2.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.8.1 18-Mar-2002  jdolecek file pci_machdep.c was added on branch kqueue on 2002-06-23 17:36:00 +0000
 1.4.108.1 05-Mar-2011  bouyer Sync with HEAD
 1.4.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.100.1 05-Mar-2011  rmind sync with head
 1.4.96.1 10-Jan-2010  matt Add generic support for DMA bounce buffers and real version of
bus_dmatag_subregion. MALTA uses it for ISADMA. Make RMIXL use
for creating 32bit and 29bit subregions.
 1.26 19-Oct-2025  thorpej Use {,e}isabus_attach().
 1.25 08-Feb-2024  andvar s/sharable/shareable in comments and documentation.
 1.24 22-Jan-2022  skrll Ensure bus_dmatag_subregion is called with an inclusive max_addr
everywhere.
 1.23 22-Jan-2022  skrll Trailing whitespace
 1.22 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.21 24-Apr-2021  thorpej branches: 1.21.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.20 21-Nov-2020  thorpej branches: 1.20.2;
malloc(9) -> kmem(9)
 1.19 10-Nov-2019  chs branches: 1.19.8;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.18 29-Mar-2014  christos branches: 1.18.30;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.17 26-Mar-2014  christos kill sprintf
 1.16 27-Oct-2012  chs branches: 1.16.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.15 01-Jul-2011  dyoung branches: 1.15.2; 1.15.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.14 20-Feb-2011  matt Merge forward from matt-nb5-mips64.
 1.13 19-Aug-2009  dyoung branches: 1.13.4; 1.13.6; 1.13.8;
Define, and hook into the isa_chipset_tag_t, pcib_isa_detach_hook().
 1.12 12-May-2006  tsutsui branches: 1.12.66; 1.12.84;
According to the i8259 manual, EOI, R, and SL bits belong to OCW2 register
so rename them OCW3_* -> OCW2_*.
 1.11 11-Dec-2005  christos branches: 1.11.4; 1.11.6; 1.11.8; 1.11.12;
merge ktrace-lwp.
 1.10 30-Aug-2004  drochner branches: 1.10.12;
Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found()
(from a "mainbus" or a bus bridge).
Do it for isa/eisa/mca and pci/agp for now. These buses all attach to
an mi interface attribute "isabus", "eisabus" etc., and the autoconf
framework now allows to specify an interface attribute on config_found()
and config_search(), which limits the search of matching config data
to these which attach to that specific attribute.
So we basically have to call config_found_ia(..., "foobus", ...) where
such a bus is attached.
As a consequence, where a "mainbus" or alike also attaches other
devices (eg CPUs) which do not attach to a specific attribute yet,
we need at least pass an attribute name (different from "foobus") so
that the foo bus is not found at these places. This made some minor
changes necessary which are not obviously related to the mentioned buses.
 1.9 24-Apr-2004  kleink Update for new pci_devinfo(9) signature.
 1.8 15-Jul-2003  lukem __KERNEL_RCSID()
 1.7 01-Jan-2003  thorpej branches: 1.7.2;
Use aprint_normal() for cfprint routines.
 1.6 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL
 1.5 01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.4 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.3 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.2 18-Mar-2002  simonb branches: 1.2.8; 1.2.10;
Use <mips/isa_machdep.h> and <mips/pci_machdep.h>.
 1.1 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.2.10.3 03-Jan-2003  thorpej Sync with HEAD.
 1.2.10.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.10.1 18-Mar-2002  nathanw file pcib.c was added on branch nathanw_sa on 2002-10-18 02:36:39 +0000
 1.2.8.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.8.1 18-Mar-2002  jdolecek file pcib.c was added on branch kqueue on 2002-06-23 17:36:01 +0000
 1.7.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.7.2.2 03-Sep-2004  skrll Sync with HEAD
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.10.12.1 21-Jun-2006  yamt sync with head.
 1.11.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.11.8.1 24-May-2006  yamt sync with head.
 1.11.6.1 01-Jun-2006  kardel Sync with head.
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.12.84.1 10-Jan-2010  matt Add generic support for DMA bounce buffers and real version of
bus_dmatag_subregion. MALTA uses it for ISADMA. Make RMIXL use
for creating 32bit and 29bit subregions.
 1.12.66.1 19-Aug-2009  yamt sync with head.
 1.13.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.13.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.13.4.1 05-Mar-2011  rmind sync with head
 1.15.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.15.2.2 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.15.2.1 30-Oct-2012  yamt sync with head
 1.16.2.1 18-May-2014  rmind sync with head
 1.18.30.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.19.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.20.2.1 23-Mar-2021  thorpej Convert config_found_ia() call sites where the device only carries
a single interface attribute to bare config_found() calls.
 1.21.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 18-Mar-2002  simonb branches: 1.2.8; 1.2.10;
Use <mips/isa_machdep.h> and <mips/pci_machdep.h>.
 1.1 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.2.10.2 18-Mar-2002  simonb Use <mips/isa_machdep.h> and <mips/pci_machdep.h>.
 1.2.10.1 18-Mar-2002  simonb file pcibvar.h was added on branch nathanw_sa on 2002-03-18 10:10:18 +0000
 1.2.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.8.1 18-Mar-2002  jdolecek file pcibvar.h was added on branch kqueue on 2002-06-23 17:36:01 +0000
 1.6 09-Jul-2011  matt Allow algor kernels to be built under either algor/algor64 or
evbmips-el/evbmips64-el. Note that MAXMAPARITITONS and majors numbers
differ between the two ports which is why two kernels are still needed.
 1.5 04-Apr-2011  dyoung Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args. Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:

Xen: according to Manuel Bouyer, writing to pci_attach_args in
pci_intr_map() was a leftover from Xen 2. Probably a bug. I
stopped writing it. I have not tested this change.

siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
Probably a bug. I use a temporary variable. I have not tested this
change.

slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
Probably a bug. Use a local pci_attach_args. I have not tested
this change.

viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
caller's pci_attach_args. Probably a bug. Make a local copy of the
caller's pci_attach_args and modify the copy. I have not tested
this change.

While I'm here, make pci_mapreg_submap() static.

With these changes in place, I have tested the compilation of these
kernels:

alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC

As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:

### evbmips-el GDIUM

nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop

### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'

### ia64 GENERIC

/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
 1.4 11-Dec-2005  christos branches: 1.4.100; 1.4.106;
merge ktrace-lwp.
 1.3 15-Jul-2003  lukem __KERNEL_RCSID()
 1.2 18-Mar-2002  simonb branches: 1.2.8; 1.2.10; 1.2.16;
Use <mips/isa_machdep.h> and <mips/pci_machdep.h>.
 1.1 07-Mar-2002  simonb A port to the MIPS Malta evaluation board. Currently supports the
MIPS32 4Kc CPU board, with support for the MIPS64 5Kc and the QED RM5261
CPU boards to follow.

The cs4281 audio hasn't been tested, there are some interrupt problems
with onboard the pciide, but all other on-board peripherals work.

The evbmips port will support more MIPS evaluation boards in the future.
 1.2.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.16.1 03-Aug-2004  skrll Sync with HEAD
 1.2.10.2 18-Mar-2002  simonb Use <mips/isa_machdep.h> and <mips/pci_machdep.h>.
 1.2.10.1 18-Mar-2002  simonb file pciide_machdep.c was added on branch nathanw_sa on 2002-03-18 10:10:18 +0000
 1.2.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.8.1 18-Mar-2002  jdolecek file pciide_machdep.c was added on branch kqueue on 2002-06-23 17:36:01 +0000
 1.4.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.100.1 21-Apr-2011  rmind sync with head

RSS XML Feed