Home | History | Annotate | only in /src/sys/arch/arm/xscale
History log of /src/sys/arch/arm/xscale
RevisionDateAuthorComments
 1.18 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.17 24-Apr-2021  thorpej branches: 1.17.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.16 14-Oct-2012  msaitoh branches: 1.16.52;
struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.15 18-Sep-2012  matt Add bounce buffer support for ARM bus_dma(9). Add macros to help initialize
bus_dma_tag structures.
 1.14 01-Jul-2011  dyoung branches: 1.14.2; 1.14.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.13 17-May-2011  dyoung 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.12 24-Dec-2005  perry branches: 1.12.102; 1.12.108;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 26-Aug-2005  drochner s/locdesc_t/int/g
 1.9 30-Jun-2005  drochner branches: 1.9.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.8 30-Aug-2004  drochner 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 30-May-2003  thorpej Make big-endian mode a little closer to working on the BRH. I can talk
to both the EEPROM *and* the PHY on the Ethernet interface now, at least,
though it is still not completely working.

Many thanks to Stephen Goadhouse at ADI for some hints.
 1.4 23-May-2003  briggs Sprinkle a few aprint_normal()s in place of printf().
 1.3 20-Apr-2003  thorpej Fix a typo that prevented the large inbound PCI memory window from
being programmed (guess RedBoot allowed us to get lucky).
 1.2 25-Mar-2003  thorpej Add support for attaching on-chip peripherals to the BECC using
indirect configuration (because the BECC is a soft-core, it could
have a variety of peripherals in the FPGA). Also add support for
local untranslated DMA.
 1.1 25-Jan-2003  thorpej Support for ADI Engineering's Big Endian Companion Chip for the
Intel i80200 XScale processor. Despite its name, the BECC can
run in both big- and little-endian modes.
 1.6.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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.9.2.1 21-Jun-2006  yamt sync with head.
 1.12.108.1 06-Jun-2011  jruoho Sync with HEAD.
 1.12.102.1 31-May-2011  rmind sync with head
 1.14.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.14.2.1 30-Oct-2012  yamt sync with head
 1.16.52.7 18-Apr-2021  thorpej Need to be explicit about the interface attribute when attaching the
PCI bus instance because "becc" carries 2 interface attributes.
 1.16.52.6 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.16.52.5 05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.16.52.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.16.52.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.16.52.2 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.52.1 20-Mar-2021  thorpej The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.17.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.4 12-Feb-2012  matt Change old-stlye-defintions to C89 prototypes.
Switch to CFATTACH_DECL_NEW/device_t/cfdata_t
Defer attaching interrupt evcnts.

Approved by releng.
 1.3 11-Dec-2005  christos branches: 1.3.114; 1.3.118;
merge ktrace-lwp.
 1.2 15-Jul-2003  lukem __KERNEL_RCSID()
 1.1 20-Apr-2003  thorpej branches: 1.1.2;
Add a driver for the reset button on the ADI BECC.
 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.118.1 18-Feb-2012  mrg merge to -current.
 1.3.114.1 17-Apr-2012  yamt sync with head
 1.3 27-Apr-2008  matt Merge kernel changes in matt-armv6 to HEAD.
 1.2 24-Dec-2005  perry branches: 1.2.52; 1.2.76; 1.2.78; 1.2.80;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.1 25-Jan-2003  thorpej branches: 1.1.18;
Support for ADI Engineering's Big Endian Companion Chip for the
Intel i80200 XScale processor. Despite its name, the BECC can
run in both big- and little-endian modes.
 1.1.18.1 21-Jun-2006  yamt sync with head.
 1.2.80.1 16-May-2008  yamt sync with head.
 1.2.78.1 18-May-2008  yamt sync with head.
 1.2.76.1 02-Jun-2008  mjf Sync with HEAD.
 1.2.52.1 28-Jan-2008  matt Given the that there are only 4 IPLs (ignoring soft IPLs), a number of
cleanups can be done:
Remove _SPL_* aliases.
Don't store irqmasks in ci_cpl, just make it an ipl level.
Add fast softint switching support.
 1.15 20-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.14 10-Nov-2019  chs branches: 1.14.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.13 02-Aug-2012  skrll branches: 1.13.40;
Remove irqframe and replace with identical trapframe.
 1.12 20-Dec-2010  matt branches: 1.12.8;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.11 27-Apr-2008  matt branches: 1.11.22;
Merge kernel changes in matt-armv6 to HEAD.
 1.10 06-Jan-2008  matt branches: 1.10.6; 1.10.8; 1.10.10;
Cleanup softint lossage.
 1.9 11-Dec-2007  ad And you, be ye fruitful, and multiply; bring forth abundantly in the earth,
and multiply therein. (Genesis 9:6-8)
 1.8 11-Dec-2007  ad Make it compile.
 1.7 24-Nov-2006  wiz branches: 1.7.24; 1.7.28; 1.7.30; 1.7.36; 1.7.40; 1.7.42; 1.7.44;
s/heirarchy/hierarchy/, from Zafer.
 1.6 24-Dec-2005  perry branches: 1.6.20; 1.6.22;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 14-Aug-2005  he Follow up the type change of i80200_extirq_dispatch which now takes
an irqframe* and not a clockframe* as argument.
 1.3 15-Jul-2003  lukem branches: 1.3.16;
__KERNEL_RCSID()
 1.2 16-Jun-2003  thorpej branches: 1.2.2;
Rename IPL_IMP -> IPL_VM.
 1.1 25-Jan-2003  thorpej Support for ADI Engineering's Big Endian Companion Chip for the
Intel i80200 XScale processor. Despite its name, the BECC can
run in both big- and little-endian modes.
 1.2.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.3 21-Jan-2008  yamt sync with head
 1.3.16.2 30-Dec-2006  yamt sync with head.
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.6.22.1 10-Dec-2006  yamt sync with head.
 1.6.20.1 12-Jan-2007  ad Sync with head.
 1.7.44.2 08-Jan-2008  bouyer Sync with HEAD
 1.7.44.1 13-Dec-2007  bouyer Sync with HEAD
 1.7.42.1 13-Dec-2007  yamt sync with head.
 1.7.40.1 26-Dec-2007  ad Sync with head.
 1.7.36.1 18-Feb-2008  mjf Sync with HEAD.
 1.7.30.2 28-Jan-2008  matt Given the that there are only 4 IPLs (ignoring soft IPLs), a number of
cleanups can be done:
Remove _SPL_* aliases.
Don't store irqmasks in ci_cpl, just make it an ipl level.
Add fast softint switching support.
 1.7.30.1 09-Jan-2008  matt sync with HEAD
 1.7.28.2 20-Jan-2008  chris Sync to HEAD.
 1.7.28.1 01-Jan-2008  chris Sync with HEAD.
 1.7.24.2 28-Feb-2008  rjs Sync with HEAD.
 1.7.24.1 26-Dec-2007  rjs Sync with HEAD.
 1.10.10.1 16-May-2008  yamt sync with head.
 1.10.8.1 18-May-2008  yamt sync with head.
 1.10.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.11.22.1 05-Mar-2011  rmind sync with head
 1.12.8.1 30-Oct-2012  yamt sync with head
 1.13.40.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.14.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.7 24-Jan-2018  skrll Remove port-acorn26

OK core@
 1.6 05-Feb-2014  christos put back line accidentally deleted before (hi matt)
 1.5 04-Feb-2014  matt _setsoftintr is long dead. reap any leftovers from arm.
 1.4 27-Apr-2008  matt branches: 1.4.34; 1.4.44; 1.4.50;
Merge kernel changes in matt-armv6 to HEAD.
 1.3 06-Jan-2008  matt branches: 1.3.6; 1.3.8; 1.3.10;
Cleanup softint lossage.
 1.2 24-Dec-2005  perry branches: 1.2.46; 1.2.50; 1.2.52; 1.2.58; 1.2.66;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.1 25-Jan-2003  thorpej branches: 1.1.18;
Support for ADI Engineering's Big Endian Companion Chip for the
Intel i80200 XScale processor. Despite its name, the BECC can
run in both big- and little-endian modes.
 1.1.18.2 21-Jan-2008  yamt sync with head
 1.1.18.1 21-Jun-2006  yamt sync with head.
 1.2.66.1 08-Jan-2008  bouyer Sync with HEAD
 1.2.58.1 18-Feb-2008  mjf Sync with HEAD.
 1.2.52.2 09-Jan-2008  matt sync with HEAD
 1.2.52.1 09-Nov-2007  matt Make all the evbarm kernels build again. Fix lossage from rebase.
 1.2.50.1 20-Jan-2008  chris Sync to HEAD.
 1.2.46.1 28-Feb-2008  rjs Sync with HEAD.
 1.3.10.1 16-May-2008  yamt sync with head.
 1.3.8.1 18-May-2008  yamt sync with head.
 1.3.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.50.1 18-May-2014  rmind sync with head
 1.4.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.34.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.22 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.21 07-Jul-2020  thorpej 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.20 14-Jun-2020  chs replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.19 16-Nov-2018  jmcneill Add intr_establish_xname support to arm and expose it to intrctl
 1.18 02-Oct-2015  msaitoh branches: 1.18.16; 1.18.18;
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.17 30-Mar-2014  htodd branches: 1.17.6;
Fix typo.
 1.16 30-Mar-2014  christos wrap a few lines
 1.15 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.14 18-Aug-2013  matt <arm/locore.h> fallout (fixes some include ordering errors)
 1.13 14-Oct-2012  msaitoh branches: 1.13.2;
struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.12 07-Sep-2012  matt branches: 1.12.2;
Fix pci_conf_interrupt fallout.
 1.11 27-Jan-2012  para converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.10 01-Jul-2011  dyoung branches: 1.10.2; 1.10.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.9 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.8 24-Dec-2005  perry branches: 1.8.102; 1.8.108;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 31-Oct-2003  thorpej branches: 1.6.16;
"bogus pin" -> "bogus device" in last change.
 1.5 30-Oct-2003  matt Fix (real) uninitialized error. (Someone familiar with this should see
if is really an error).
 1.4 15-Jul-2003  lukem __KERNEL_RCSID()
 1.3 23-May-2003  briggs branches: 1.3.2;
Sprinkle a few aprint_normal()s in place of printf().
 1.2 29-Jan-2003  briggs Get the interrupt mappings right for the slot.
 1.1 25-Jan-2003  thorpej Support for ADI Engineering's Big Endian Companion Chip for the
Intel i80200 XScale processor. Despite its name, the BECC can
run in both big- and little-endian modes.
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.8.108.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.102.1 21-Apr-2011  rmind sync with head
 1.10.6.1 18-Feb-2012  mrg merge to -current.
 1.10.2.3 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.10.2.2 30-Oct-2012  yamt sync with head
 1.10.2.1 17-Apr-2012  yamt sync with head
 1.12.2.3 03-Dec-2017  jdolecek update from HEAD
 1.12.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.13.2.2 18-May-2014  rmind sync with head
 1.13.2.1 28-Aug-2013  rmind sync with head
 1.17.6.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.18.18.1 10-Jun-2019  christos Sync with HEAD
 1.18.16.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.1 30-May-2003  thorpej Make big-endian mode a little closer to working on the BRH. I can talk
to both the EEPROM *and* the PHY on the Ethernet interface now, at least,
though it is still not completely working.

Many thanks to Stephen Goadhouse at ADI for some hints.
 1.6 16-Mar-2018  ryo use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
 1.5 01-Jul-2011  dyoung branches: 1.5.52;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 15-Jul-2003  lukem __KERNEL_RCSID()
 1.2 30-May-2003  thorpej branches: 1.2.2;
Make big-endian mode a little closer to working on the BRH. I can talk
to both the EEPROM *and* the PHY on the Ethernet interface now, at least,
though it is still not completely working.

Many thanks to Stephen Goadhouse at ADI for some hints.
 1.1 25-Jan-2003  thorpej Support for ADI Engineering's Big Endian Companion Chip for the
Intel i80200 XScale processor. Despite its name, the BECC can
run in both big- and little-endian modes.
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.5.52.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.16 29-May-2020  rin For struct timecounter, use C99 initializers.
Compile tested. No functional changes intended.
 1.15 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.14 20-Jan-2008  joerg Convert evbarm to timecounter. Only one of the systems was tested, the
rest of the patch is compile-time tested only.
 1.13 06-Jan-2008  matt Cleanup softint lossage.
 1.12 11-Dec-2007  ad Make it compile.
 1.11 06-Jan-2007  christos branches: 1.11.20; 1.11.24; 1.11.26; 1.11.32; 1.11.34; 1.11.36; 1.11.38;
Add generic TOD support. From Bucky Katz.
 1.10 10-Sep-2006  gdamore branches: 1.10.4;
First pass at enabling a lot of ARM ports to convert swiftly to
__HAVE_GENERIC_TODR. Just put #define __HAVE_GENERIC_TODR in types.h
if your port uses one of these files.
 1.9 11-Dec-2005  christos branches: 1.9.8; 1.9.20;
merge ktrace-lwp.
 1.8 04-Jun-2005  he branches: 1.8.2;
Fix the various todr_gettime() and todr_settime() fallouts from
-Wcast-qual differently, by instead changing the signatore of those
"functions" to take a "volatile struct timeval*" instead of a
"struct timeval*". Many places, these functions are called with
&time, and time is declared as volatile in <sys/kernel.h>. This
way we can get rid of all the ugly casts which now also triggered
warnings, and caused more code to be added to work around the
problem.

Reviewed by thorpej.
 1.7 04-Jun-2005  rearnsha Fix shadowed use of hz, and attempts to cast away volatile on time.
 1.6 26-Feb-2005  simonb Watch out for those unexpected tains.
 1.5 27-Jul-2003  thorpej branches: 1.5.8; 1.5.10;
Fix think'o in last. Pointed out by Izumi Tsutsui.
 1.4 26-Jul-2003  thorpej Flesh out inittodr() and resettodr().
 1.3 15-Jul-2003  lukem __KERNEL_RCSID()
 1.2 23-May-2003  briggs branches: 1.2.2;
Sprinkle a few aprint_normal()s in place of printf().
 1.1 25-Jan-2003  thorpej Support for ADI Engineering's Big Endian Companion Chip for the
Intel i80200 XScale processor. Despite its name, the BECC can
run in both big- and little-endian modes.
 1.2.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.5.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.8.1 29-Apr-2005  kent sync with -current
 1.8.2.3 21-Jan-2008  yamt sync with head
 1.8.2.2 26-Feb-2007  yamt sync with head.
 1.8.2.1 30-Dec-2006  yamt sync with head.
 1.9.20.2 12-Jan-2007  ad Sync with head.
 1.9.20.1 18-Nov-2006  ad Sync with head.
 1.9.8.1 14-Sep-2006  yamt sync with head.
 1.10.4.1 30-Apr-2007  bouyer Pull up following revision(s) (requested by rearnsha in ticket #592):
sys/arch/arm/footbridge/footbridgevar.h: revision 1.5
sys/arch/arm/ep93xx/epclk.c: revision 1.10
sys/arch/arm/ixp12x0/ixp12x0_clk.c: revision 1.11
sys/arch/arm/footbridge/footbridge.c: revision 1.17
sys/arch/arm/footbridge/isa/dsrtc.c: revision 1.10
sys/arch/arm/s3c2xx0/s3c2800_clk.c: revision 1.10
sys/arch/arm/xscale/ixp425_timer.c: revision 1.13
sys/arch/arm/xscale/becc_timer.c: revision 1.11
sys/arch/arm/xscale/i80321_timer.c: revision 1.16
sys/arch/arm/s3c2xx0/s3c24x0_clk.c: revision 1.7
Add generic TOD support. From Bucky Katz.
 1.11.38.3 20-Jan-2008  bouyer Sync with HEAD
 1.11.38.2 08-Jan-2008  bouyer Sync with HEAD
 1.11.38.1 13-Dec-2007  bouyer Sync with HEAD
 1.11.36.1 13-Dec-2007  yamt sync with head.
 1.11.34.1 26-Dec-2007  ad Sync with head.
 1.11.32.1 18-Feb-2008  mjf Sync with HEAD.
 1.11.26.2 23-Mar-2008  matt sync with HEAD
 1.11.26.1 09-Jan-2008  matt sync with HEAD
 1.11.24.3 27-Jan-2008  chris Sync to HEAD.
 1.11.24.2 20-Jan-2008  chris Sync to HEAD.
 1.11.24.1 01-Jan-2008  chris Sync with HEAD.
 1.11.20.2 28-Feb-2008  rjs Sync with HEAD.
 1.11.20.1 26-Dec-2007  rjs Sync with HEAD.
 1.2 05-Apr-2003  briggs Channel active is bit 10, not 9.
 1.1 25-Jan-2003  thorpej Support for ADI Engineering's Big Endian Companion Chip for the
Intel i80200 XScale processor. Despite its name, the BECC can
run in both big- and little-endian modes.
 1.4 14-Oct-2012  msaitoh struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.3 25-Mar-2003  thorpej branches: 1.3.144; 1.3.154;
Bump copyright date for last.
 1.2 25-Mar-2003  thorpej Add support for attaching on-chip peripherals to the BECC using
indirect configuration (because the BECC is a soft-core, it could
have a variety of peripherals in the FPGA). Also add support for
local untranslated DMA.
 1.1 25-Jan-2003  thorpej Support for ADI Engineering's Big Endian Companion Chip for the
Intel i80200 XScale processor. Despite its name, the BECC can
run in both big- and little-endian modes.
 1.3.154.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3.144.1 30-Oct-2012  yamt sync with head
 1.3 30-May-2003  thorpej Make big-endian mode a little closer to working on the BRH. I can talk
to both the EEPROM *and* the PHY on the Ethernet interface now, at least,
though it is still not completely working.

Many thanks to Stephen Goadhouse at ADI for some hints.
 1.2 20-Apr-2003  thorpej Add a driver for the reset button on the ADI BECC.
 1.1 25-Jan-2003  thorpej Support for ADI Engineering's Big Endian Companion Chip for the
Intel i80200 XScale processor. Despite its name, the BECC can
run in both big- and little-endian modes.
 1.5 12-Jul-2018  maxv Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.
 1.4 07-Aug-2002  briggs branches: 1.4.200; 1.4.202;
Implement pmc(9) -- An interface to hardware performance monitoring
counters. These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.3 30-Jan-2002  thorpej branches: 1.3.2; 1.3.4; 1.3.12;
New interrupt framework for NetBSD/evbarm, and accompanying new
interrupt code for the IQ80310 board support package.

XXX The Integrator board support package still uses the old-style
arm32 interrupt code, so some compatibility hacks have been added
for it. When the Integrator uses new-style interrupts, those hacks
can go away.
 1.2 24-Jan-2002  thorpej Fix a typo (thanks Allen).
 1.1 23-Jan-2002  thorpej Add generic code to manipulate the i80200 ICU.
 1.3.12.1 30-Aug-2002  gehenna catch up with -current.
 1.3.4.3 13-Aug-2002  nathanw Catch up to -current.
 1.3.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.4.1 30-Jan-2002  nathanw file files.i80200 was added on branch nathanw_sa on 2002-02-28 04:07:43 +0000
 1.3.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.2.1 30-Jan-2002  jdolecek file files.i80200 was added on branch kqueue on 2002-02-11 20:07:22 +0000
 1.4.202.1 10-Jun-2019  christos Sync with HEAD
 1.4.200.1 28-Jul-2018  pgoyette Sync with HEAD
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 06-Oct-2003  thorpej Add support for the i80312 and i80321 I2C controllers.
 1.6 01-Aug-2002  thorpej branches: 1.6.8;
Move the DMA tag initialization functions into i80312.c.
 1.5 12-Apr-2002  thorpej branches: 1.5.2;
Use the bus_space_generic bus space ops.
 1.4 29-Nov-2001  thorpej branches: 1.4.2;
Add routines for accessing the general purpose I/O facility of
the i80312 Companion I/O chip.
 1.3 09-Nov-2001  thorpej branches: 1.3.2; 1.3.4;
Add support for PCI DMA on the i80312. We currently just do
DMA via the Secondary Inbound window, for now. Will probably
need to revisit this at some point.

Require that the board-specific i80312 front-end slice off a
subregion for the memory controller before calling i80312_attach(),
and fix a bug in the IQ80310 front-end that caused the Secondary
Inbound window to be configured incorrectly.
 1.2 09-Nov-2001  thorpej Snapshot of work-in-progress for Intel i80312 Companion I/O chip;
just basic Inbound and Outbound window setup is done, PCI configuration
space access (not quite working yet), and I/O and Memory space routines
so far.
 1.1 05-Nov-2001  thorpej Config info for the i80312 XScale companion I/O chip.
 1.3.4.4 13-Aug-2002  nathanw Catch up to -current.
 1.3.4.3 17-Apr-2002  nathanw Catch up to -current.
 1.3.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.4.1 09-Nov-2001  nathanw file files.i80312 was added on branch nathanw_sa on 2002-01-08 00:23:18 +0000
 1.3.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.3.2.1 09-Nov-2001  thorpej file files.i80312 was added on branch thorpej-mips-cache on 2001-11-12 21:16:34 +0000
 1.4.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.4.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 29-Nov-2001  thorpej file files.i80312 was added on branch kqueue on 2002-01-10 19:38:32 +0000
 1.5.2.1 30-Aug-2002  gehenna catch up with -current.
 1.6.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.8.1 03-Aug-2004  skrll Sync with HEAD
 1.17 12-Jul-2018  maxv Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.
 1.16 17-Oct-2007  garbled branches: 1.16.106; 1.16.108;
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.15 12-May-2007  gavan branches: 1.15.10; 1.15.12;
Implement ATU Direct Window in order to increase available PCI address
space.
 1.14 11-Dec-2005  christos branches: 1.14.26; 1.14.30; 1.14.32; 1.14.38;
merge ktrace-lwp.
 1.13 12-Feb-2005  rearnsha branches: 1.13.6;
Permit the counter frequency to be overridden by a board configuration
 1.12 06-Oct-2003  thorpej branches: 1.12.8; 1.12.10;
Add support for the i80312 and i80321 I2C controllers.
 1.11 25-Jan-2003  thorpej branches: 1.11.2;
Back out unintentional commit.
 1.10 25-Jan-2003  thorpej Support for ADI Engineering's Big Endian Companion Chip for the
Intel i80200 XScale processor. Despite its name, the BECC can
run in both big- and little-endian modes.
 1.9 03-Jan-2003  thorpej Use the generic irq_dispatch.S
 1.8 07-Aug-2002  briggs Implement pmc(9) -- An interface to hardware performance monitoring
counters. These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.7 02-Aug-2002  thorpej Add support for the Intel i80321 I/O Processor's Application Accelerator
Unit. The AAU provides block fill, block copy, XOR, and XOR-parity-check
operations. We currently provide dmover(9) functions for "zero", "fill8",
and "copy".

Much of this code can be shared with the i80312 Companion I/O AAU, and
will be when support for the older chip is implemented.
 1.6 01-Aug-2002  thorpej Move the DMA tag initialization functions into i80321.c.
 1.5 29-Jul-2002  thorpej Add support for the i80321 watchdog timer.
 1.4 29-Jul-2002  thorpej Add support for attaching IOP built-in sub-devices (aau, dma, ssp,
watchdog, etc.)
 1.3 25-Jul-2002  thorpej Add support for DMA to/from the on-chip devices of the i80321 (no
PCI window translation).

XXX This would be better done by overhauling the shared ARM bus_dma code.
 1.2 12-Apr-2002  thorpej branches: 1.2.2; 1.2.4; 1.2.6;
Use the bus_space_generic bus space ops.
 1.1 27-Mar-2002  thorpej branches: 1.1.2;
Basic support for the Intel i80321 I/O Processor (Xscale core).

Note: This is a snapshot of work-in-progress; there are still some
bugs to be shaken out.
 1.1.2.6 03-Jan-2003  thorpej Sync with HEAD.
 1.1.2.5 13-Aug-2002  nathanw Catch up to -current.
 1.1.2.4 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 27-Mar-2002  nathanw file files.i80321 was added on branch nathanw_sa on 2002-04-01 07:39:15 +0000
 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 12-Apr-2002  jdolecek file files.i80321 was added on branch kqueue on 2002-06-23 17:34:57 +0000
 1.2.4.3 07-Dec-2002  he Pull up revision 1.3 (requested by thorpej in ticket #568):
Add support for DMA to/from the on-chip devices of the
i80321.
 1.2.4.2 11-Nov-2002  he Pull up revision 1.5 (via patch, requested by thorpej in ticket #575):
Add support for the i80321 watchdog timer.
 1.2.4.1 11-Nov-2002  he Pull up revision 1.4 (requested by thorpej in ticket #571):
Add support for attaching IOP built-in sub-devices (aau,
dma, ssp, watchdog, etc.)
 1.2.2.1 30-Aug-2002  gehenna catch up with -current.
 1.11.2.4 15-Feb-2005  skrll Sync with HEAD.
 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.12.10.1 12-Feb-2005  yamt sync with head.
 1.12.8.1 29-Apr-2005  kent sync with -current
 1.13.6.1 03-Sep-2007  yamt sync with head.
 1.14.38.1 22-May-2007  matt Update to HEAD.
 1.14.32.1 11-Jul-2007  mjf Sync with head.
 1.14.30.1 27-May-2007  ad Sync with head.
 1.14.26.1 17-May-2007  yamt sync with head.
 1.15.12.1 06-Nov-2007  matt sync with HEAD
 1.15.10.1 01-Jan-2008  chris Sync with HEAD.
 1.16.108.1 10-Jun-2019  christos Sync with HEAD
 1.16.106.1 28-Jul-2018  pgoyette Sync with HEAD
 1.13 17-Jun-2023  rin Rework microcode for IXP425 npe(4).

Instead of using objcopy(1), which cannot handle EABI version
embedded in e_flags of ELF header, add a dedicated asm file.

If proprietary microcode binary is present, it is incbin'ed
from that asm file.
 1.12 12-Jul-2018  maxv Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.
 1.11 10-Dec-2006  scw branches: 1.11.136; 1.11.138;
Support the IXP425 watchdog timer.
 1.10 10-Dec-2006  scw Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.9 04-Mar-2006  scw branches: 1.9.14; 1.9.16;
Allow the kernel config file to override the default timer frequency
using "options IXP425_CLOCK_FREQ".
 1.8 11-Dec-2005  christos branches: 1.8.4; 1.8.6;
merge ktrace-lwp.
 1.7 01-May-2004  thorpej branches: 1.7.12;
COM_PXA2X0 is now defflag'd in sys/conf/files
 1.6 08-Dec-2003  scw Add support for picking up the size of SDRAM by reading the memory
controller's config register.
 1.5 16-Nov-2003  scw - Remove ixpsip_bs_tag (ixp425_sip_io.c). It just duplicated some of
the functionality of ixp425_bs_tag.
- Add missing stream_{read,write}_1 ops to ixp425_bs_tag.
- Re-work the delay() implementation to use the free-running Time-
Stamp counter. This removes the need to bootstrap TMR0 early on.
 1.4 08-Oct-2003  scw Make it easier to support different types of IXP425 board:

- Move board-specific PCI/GPIO initialisation to its rightful place.

- Handle clearing down latched GPIO interrupts in a board-independent way.

- Use MI com(4) driver for on-chip UARTs.

- Misc. tidying up.

Tested on IXDP425.
 1.3 25-Sep-2003  ichiro pci bus support
 1.2 01-Jun-2003  ichiro branches: 1.2.2;
add console unit number to configuration parameter.
move structure of uart information
 1.1 23-May-2003  ichiro support IXP425 Intel Network Processor
running on BigEndian
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll 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.6.1 22-Apr-2006  simonb Sync with head.
 1.8.4.1 09-Sep-2006  rpaulo sync with head
 1.9.16.1 18-Dec-2006  yamt sync with head.
 1.9.14.1 12-Jan-2007  ad Sync with head.
 1.11.138.1 10-Jun-2019  christos Sync with HEAD
 1.11.136.1 28-Jul-2018  pgoyette Sync with HEAD
 1.21 08-May-2019  isaki Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c
 1.20 09-Mar-2018  christos branches: 1.20.2; 1.20.4;
fix device attributes
 1.19 16-Jun-2017  pgoyette branches: 1.19.4;
Add gpio support for Xscale

From Stephan Meisenger in PR/52163
 1.18 06-Jun-2012  skrll branches: 1.18.2; 1.18.16;
Provide generic a[24]x bus_space methods (aNx is normal access, offset
multipled by N).

Use the generic method and delete the other versions.

Discussed with matt@
 1.17 14-May-2011  nonaka branches: 1.17.4; 1.17.10;
PXA2X0_LCD_WRITETHROUGH is defflag'd.
 1.16 21-Apr-2009  nonaka branches: 1.16.4; 1.16.6;
Added SD/MMC support from OpenBSD.
tested on i386, amd64 at current-users ML by pgoyette@.
tested on zaurus by myself.
 1.15 03-Dec-2007  ad branches: 1.15.18; 1.15.26; 1.15.32;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.14 25-Feb-2007  nonaka branches: 1.14.4; 1.14.18; 1.14.20; 1.14.22; 1.14.24; 1.14.30;
Add PXA2x0 RTC driver.
 1.13 02-Feb-2007  ober branches: 1.13.2;
Updates to allow Zaurus screen to rotate 90 degrees to a usable state with the keyboard. Patch from peter@ copied from OpenBSD. Feedback and OK from matt@
 1.12 17-Dec-2006  peter Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.11 16-Dec-2006  ober Zaurus Port from OpenBSD by Nonaka Kimihiro
OK gimpy
 1.10 10-Dec-2006  kiyohara Add definition the HWUART (and NSSP).
 1.9 11-Dec-2005  christos branches: 1.9.20; 1.9.22;
merge ktrace-lwp.
 1.8 04-Jul-2005  bsh branches: 1.8.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.
 1.7 13-Apr-2005  scw Add support for the DMA and AC97 controllers on PXA2x0, and enable them
on the Lubbock evaluation board.

Many thanks to Hiroyuki Bessho for testing this driver with the new
aurateconv interface, as I no longer have access to the hardware.

Contributed by Wasabi Systems, Inc.
 1.6 01-May-2004  thorpej branches: 1.6.4;
COM_PXA2X0 is now defflag'd in sys/conf/files
 1.5 06-Jun-2003  scw branches: 1.5.2;
Gah, fix previous. s/defopt/defflag/
 1.4 05-Jun-2003  scw - Rearrange the PXA2x0 support code to better support attaching
child drivers such as interrupt and gpio controllers.
- Add a function to probe SDRAM size at boot time.
- Add a function to configure the Clock Manager's CKEN settings.
- Add an INTC driver.
- Add a GPIO driver.
- Add attach glue for the PXA2x0's "almost" 16550-compatible uarts.
- Tweak the LCD driver to use the GPIO driver's services for setting
up GPIO pin function.
 1.3 03-Jan-2003  thorpej Use the generic irq_dispatch.S
 1.2 20-Dec-2002  bsh comment out a file that is not in the tree yet.
 1.1 18-Dec-2002  bsh branches: 1.1.2;
Config information for Intel PXA2xx application processors.
 1.1.2.4 03-Jan-2003  thorpej Sync with HEAD.
 1.1.2.3 29-Dec-2002  thorpej Sync with HEAD.
 1.1.2.2 19-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1 18-Dec-2002  thorpej file files.pxa2x0 was added on branch nathanw_sa on 2002-12-19 00:30:46 +0000
 1.5.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.4.1 29-Apr-2005  kent sync with -current
 1.8.2.3 07-Dec-2007  yamt sync with head
 1.8.2.2 26-Feb-2007  yamt sync with head.
 1.8.2.1 30-Dec-2006  yamt sync with head.
 1.9.22.1 18-Dec-2006  yamt sync with head.
 1.9.20.2 09-Feb-2007  ad Sync with HEAD.
 1.9.20.1 12-Jan-2007  ad Sync with head.
 1.13.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.14.30.1 08-Dec-2007  mjf Sync with HEAD.
 1.14.24.1 09-Jan-2008  matt sync with HEAD
 1.14.22.1 01-Jan-2008  chris Sync with HEAD.
 1.14.20.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.14.18.1 26-Dec-2007  rjs Sync with HEAD.
 1.14.4.1 03-Dec-2007  ad Sync with HEAD.
 1.15.32.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.15.26.1 28-Apr-2009  skrll Sync with HEAD.
 1.15.18.1 04-May-2009  yamt sync with head.
 1.16.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.16.4.1 31-May-2011  rmind sync with head
 1.17.10.1 10-Aug-2012  jdc Pull up revisions:
src/sys/arch/arm/arm/bus_space_a2x.S revision 1.1
src/sys/arch/arm/arm/bus_space_a4x.S revision 1.1
src/sys/arch/arm/gemini/files.gemini revision 1.12
src/sys/arch/arm/mpcore/files.mpcore revision 1.2
src/sys/arch/arm/mpcore/mpcore_a2x_io.S delete
src/sys/arch/arm/mpcore/mpcore_a4x_io.S delete
src/sys/arch/arm/omap/files.omap revision 1.6
src/sys/arch/arm/omap/files.omap2 revision 1.9
src/sys/arch/arm/omap/omap_a2x_io.S delete
src/sys/arch/arm/xscale/files.pxa2x0 revision 1.18
src/sys/arch/arm/xscale/pxa2x0_a4x_io.S delete
(requested by skrll to fix ticket #454).

Provide generic a[24]x bus_space methods (aNx is normal access, offset
multipled by N).

Use the generic method and delete the other versions.

Discussed with matt@
 1.17.4.1 30-Oct-2012  yamt sync with head
 1.18.16.1 28-Aug-2017  skrll Sync with HEAD
 1.18.2.1 03-Dec-2017  jdolecek update from HEAD
 1.19.4.1 15-Mar-2018  pgoyette Synch with HEAD
 1.20.4.1 05-May-2019  isaki Remove obsoleted au{,rate,vol}conv and mulaw attributes.
audio provides the equivalent of them inseparably.
 1.20.2.1 10-Jun-2019  christos Sync with HEAD
 1.10 02-Aug-2012  skrll Remove irqframe and replace with identical trapframe.
 1.9 24-Dec-2005  perry branches: 1.9.114;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 14-Aug-2005  he Follow up the type change of i80200_extirq_dispatch which now takes
an irqframe* and not a clockframe* as argument.
 1.6 15-Jul-2003  lukem branches: 1.6.16;
__KERNEL_RCSID()
 1.5 25-Jun-2002  thorpej branches: 1.5.8;
Interrupt steering register is cp13.8, not cp13.2 (D'oh!).
 1.4 26-Mar-2002  thorpej branches: 1.4.2; 1.4.4;
Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.
 1.3 25-Jan-2002  thorpej branches: 1.3.2; 1.3.4;
Make the software copy of INTCTL volatile.
 1.2 24-Jan-2002  thorpej Add an IRQ vector to be shared by all i80200 applications. This
consults the interrupt source bits in the i80200 ICU and calls
a board-specific external IRQ dispatcher if an external IRQ is
pending.
 1.1 23-Jan-2002  thorpej Add generic code to manipulate the i80200 ICU.
 1.3.4.4 01-Aug-2002  nathanw Catch up to -current.
 1.3.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.4.1 25-Jan-2002  nathanw file i80200_icu.c was added on branch nathanw_sa on 2002-02-28 04:07:44 +0000
 1.3.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.2.1 25-Jan-2002  jdolecek file i80200_icu.c was added on branch kqueue on 2002-02-11 20:07:22 +0000
 1.4.4.1 25-Jun-2002  lukem Pull up revision 1.5 (requested by thorpej in ticket #363):
Interrupt steering register is cp13.8, not cp13.2 (D'oh!).
 1.4.2.1 16-Jul-2002  gehenna catch up with -current.
 1.5.8.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.8.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.9.114.1 30-Oct-2012  yamt sync with head
 1.19 21-Nov-2020  skrll Adjust egister usage so that r4 and r5 are preserved as cur{cpu,lwp}
respectively as required by the change to make ASTs operate per-LWP
rather than per-CPU. DO_AST_AND_RESTORE_ALIGNMENT_FAULTS expects this.

XXX untested
 1.18 12-Jul-2018  maxv branches: 1.18.12;
Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.
 1.17 18-Aug-2013  matt branches: 1.17.28; 1.17.30;
Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>
 1.16 27-Apr-2008  matt branches: 1.16.34; 1.16.44; 1.16.50;
Merge kernel changes in matt-armv6 to HEAD.
 1.15 06-Jan-2008  matt branches: 1.15.6; 1.15.8; 1.15.10;
Truly kill current_intr_depth once and for all.
 1.14 09-Mar-2007  thorpej branches: 1.14.8; 1.14.16; 1.14.20; 1.14.22; 1.14.28; 1.14.34;
Rewrite the ARM mutex implementation to be of the simple-mutex variety.
Because pre-v6 ARM lacks support for an atomic compare-and-swap, we
implement _lock_cas() as a restartable atomic squence that is checked
in the IRQ handler right before AST processing. (This is safe because,
for all practical purposes, there are no SMP pre-v6 ARM systems.)

This can serve as a model for other non-MP platforms that lack the
necessary atomic operations for mutexes (SuperH, for example).

Upshots of this change:
- kmutex_t is now down to 8 bytes on ARM; about as good as we can get.
- ARM2 systems don't have to trap and emulate SWP or SWPB for mutexes.

The acorn26 port is not updated by this commit to do the LOCK_CAS_CHECK.
That is left as an exercise for the port maintainer.

Reviewed and tested by Matt Thomas.
 1.13 11-Dec-2005  christos branches: 1.13.26;
merge ktrace-lwp.
 1.12 31-May-2005  chs branches: 1.12.2;
remove vestigal {,e}intr{names,cnt} symbols now that vmstat doesn't need them.
 1.11 05-Nov-2003  scw Enable/Restore alignment fault state on interrupt handler entry/exit.
 1.10 02-Jan-2003  thorpej branches: 1.10.2;
Garbage-collect prev_intr_depth; nothing uses it.
 1.9 25-Oct-2002  briggs Restore .Lpmc_intr_return -- ben only removed one of two references to it.
 1.8 21-Oct-2002  bjh21 Pull down rev 1.7.2.1 [must be careful which branch I commit to!]:
Reinstate .Lextirq_return: it was used in two places, and I only removed one
of them.
 1.7 14-Oct-2002  bjh21 branches: 1.7.2;
Continue the " - . - 8" purge. Specifically:

add rd, pc, #foo - . - 8 -> adr rd, foo
ldr rd, [pc, #foo - . - 8] -> ldr rd, foo

Also, when saving the return address for a function pointer call, use
"mov lr, pc" just before the call unless the return address is somewhere
other than just after the call site.

Finally, a few obvious little micro-optimisations like using LDR directly
rather than ADR followed by LDR, and loading directly into PC rather than
bouncing via R0.
 1.6 17-Aug-2002  thorpej Use correct-for-ELF local labels.
 1.5 14-Aug-2002  thorpej Use cpsr_c rather then cpsr_all where appropriate.
 1.4 07-Aug-2002  briggs Implement pmc(9) -- An interface to hardware performance monitoring
counters. These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.3 29-Jul-2002  thorpej Clean up some comments.
 1.2 25-Jun-2002  thorpej * Interrupt status is in cp13.4, not cp13.1 (D'oh!)
* Fix an inverted test.
 1.1 24-Jan-2002  thorpej branches: 1.1.2; 1.1.4; 1.1.12; 1.1.14;
Add an IRQ vector to be shared by all i80200 applications. This
consults the interrupt source bits in the i80200 ICU and calls
a board-specific external IRQ dispatcher if an external IRQ is
pending.
 1.1.14.2 11-Nov-2002  he Pull up revision 1.3 (requested by thorpej in ticket #579):
Clean up some comments.
 1.1.14.1 25-Jun-2002  lukem Pull up revision 1.2 (requested by thorpej in ticket #364):
* Interrupt status is in cp13.4, not cp13.1 (D'oh!)
* Fix an inverted test.
 1.1.12.2 30-Aug-2002  gehenna catch up with -current.
 1.1.12.1 16-Jul-2002  gehenna catch up with -current.
 1.1.4.9 03-Jan-2003  thorpej Sync with HEAD.
 1.1.4.8 25-Oct-2002  thorpej Sync with HEAD.
 1.1.4.7 22-Oct-2002  thorpej Sync with HEAD.
 1.1.4.6 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.5 19-Aug-2002  thorpej Partial (ARM only) sync with trunk -- significant performance improvements
for XScale-based systems.
 1.1.4.4 13-Aug-2002  nathanw Catch up to -current.
 1.1.4.3 01-Aug-2002  nathanw Catch up to -current.
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 24-Jan-2002  nathanw file i80200_irq.S was added on branch nathanw_sa on 2002-02-28 04:07:44 +0000
 1.1.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 24-Jan-2002  jdolecek file i80200_irq.S was added on branch kqueue on 2002-02-11 20:07:22 +0000
 1.7.2.1 21-Oct-2002  bjh21 Reinstate .Lextirq_return: it was used in two places, and I only removed one
of them.
 1.10.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.2.1 03-Aug-2004  skrll Sync with HEAD
 1.12.2.2 21-Jan-2008  yamt sync with head
 1.12.2.1 03-Sep-2007  yamt sync with head.
 1.13.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.14.34.1 08-Jan-2008  bouyer Sync with HEAD
 1.14.28.1 18-Feb-2008  mjf Sync with HEAD.
 1.14.22.3 09-Jan-2008  matt sync with HEAD
 1.14.22.2 09-Nov-2007  matt Make all the evbarm kernels build again. Fix lossage from rebase.
 1.14.22.1 29-Aug-2007  matt Adapt to everything in cpu_info
 1.14.20.1 20-Jan-2008  chris Sync to HEAD.
 1.14.16.1 28-Feb-2008  rjs Sync with HEAD.
 1.14.8.1 18-Apr-2007  thorpej Remove _lock_cas() in favor of atomic_cas_32().
 1.15.10.1 16-May-2008  yamt sync with head.
 1.15.8.1 18-May-2008  yamt sync with head.
 1.15.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.16.50.1 28-Aug-2013  rmind sync with head
 1.16.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.34.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.17.30.1 10-Jun-2019  christos Sync with HEAD
 1.17.28.1 28-Jul-2018  pgoyette Sync with HEAD
 1.18.12.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.4 25-Jun-2002  thorpej Correct a comment.
 1.3 26-Mar-2002  thorpej branches: 1.3.2; 1.3.4;
Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.
 1.2 23-Jan-2002  thorpej Make this usable directly by assembly code.
 1.1 01-Dec-2001  thorpej branches: 1.1.2; 1.1.4;
Add register definitions for the i80200 Interrupt Controller Unit,
Bus Controller Unit, and Performance Monitoring Unit.
 1.1.4.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.4.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 01-Dec-2001  thorpej file i80200reg.h was added on branch kqueue on 2002-01-10 19:38:32 +0000
 1.1.2.5 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 01-Dec-2001  nathanw file i80200reg.h was added on branch nathanw_sa on 2002-01-08 00:23:18 +0000
 1.3.4.1 25-Jun-2002  lukem Pull up revision 1.4 (requested by thorpej in ticket #365):
Correct a comment.
 1.3.2.1 16-Jul-2002  gehenna catch up with -current.
 1.6 02-Aug-2012  skrll Remove irqframe and replace with identical trapframe.
 1.5 29-Jul-2012  matt Fix more -fno-common fallout.
Move more variables to common locations.
 1.4 16-Aug-2002  briggs branches: 1.4.150;
i80200_extirq_dispatch takes a struct irqframe * now.
 1.3 26-Mar-2002  thorpej branches: 1.3.2;
Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.
 1.2 24-Jan-2002  thorpej branches: 1.2.2; 1.2.4;
Add an IRQ vector to be shared by all i80200 applications. This
consults the interrupt source bits in the i80200 ICU and calls
a board-specific external IRQ dispatcher if an external IRQ is
pending.
 1.1 23-Jan-2002  thorpej Add generic code to manipulate the i80200 ICU.
 1.2.4.4 19-Aug-2002  thorpej Partial (ARM only) sync with trunk -- significant performance improvements
for XScale-based systems.
 1.2.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.1 24-Jan-2002  nathanw file i80200var.h was added on branch nathanw_sa on 2002-02-28 04:07:44 +0000
 1.2.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.2.2.1 24-Jan-2002  jdolecek file i80200var.h was added on branch kqueue on 2002-02-11 20:07:22 +0000
 1.3.2.1 30-Aug-2002  gehenna catch up with -current.
 1.4.150.1 30-Oct-2012  yamt sync with head
 1.26 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.25 24-Apr-2021  thorpej branches: 1.25.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.24 01-Mar-2019  msaitoh branches: 1.24.14;
- Almost all ppbreg.h's definitions are also in pcireg.h. Remove duplicated
definitions from ppbreg.h and move some definitions from ppbreg.h to
pcireg.h.
- Change fast back-to-back "capable" to "enable" in pci_subr.c.
- Print Primary Discard Timer, Secondary Discard Timer, Discard Timer Status
and Discard Timer SERR# Enable bit in pci_subr.c.
- PCI_BRIDGE_PREFETCHBASE32_REG and PCI_BRIDGE_PREFETCHLIMIT32_REG are
"upper" 32bit registers, rename to *UP32_REG to avoid confusion.
- Use macro.
 1.23 14-Oct-2012  msaitoh branches: 1.23.38;
struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.22 18-Sep-2012  matt Add bounce buffer support for ARM bus_dma(9). Add macros to help initialize
bus_dma_tag structures.
 1.21 01-Jul-2011  dyoung branches: 1.21.2; 1.21.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.20 17-May-2011  dyoung 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.19 25-Feb-2006  wiz branches: 1.19.96; 1.19.102;
Fix some typos.
 1.18 11-Dec-2005  christos branches: 1.18.2; 1.18.4; 1.18.6;
merge ktrace-lwp.
 1.17 30-Aug-2004  drochner branches: 1.17.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.16 06-Oct-2003  thorpej Add support for the i80312 and i80321 I2C controllers.
 1.15 15-Jul-2003  lukem __KERNEL_RCSID()
 1.14 15-Jun-2003  fvdl branches: 1.14.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.13 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.12 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.11 17-Aug-2002  thorpej Use separate function pointers for dmamap_sync pre- vs post- operations.
Change the bus_dmamap_sync() macro to test the ops argument against pre-
and post- constants. The compiler will optimize out dead code because
of the constants. Since post- operations are not needed on ARM (except
for ISA bounce buffers), this eliminate a large number of function calls
which are noops, each of which cost at least 6 cycles just in the call
and return overhead (not to mention whatever other useless work the
compiler decides to do in the callee).
 1.10 01-Aug-2002  thorpej Move the DMA tag initialization functions into i80312.c.
 1.9 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.8 14-Feb-2002  briggs branches: 1.8.8;
Actually set the i80312_softc global.
 1.7 04-Jan-2002  briggs branches: 1.7.2;
Initialize pba_intrswiz and pba_intrtag before configuring PCI bus.
 1.6 30-Nov-2001  thorpej Clarify a comment to state that it is intentional that we attach
only the Secondary PCI bus (it's the only bus which can have a
device space hidden from any PCI host on the Primary bus).

Also, use the bus number from the PPB businfo register seecondary bus
field rather than hard-coding "1".
 1.5 29-Nov-2001  thorpej Add routines for accessing the general purpose I/O facility of
the i80312 Companion I/O chip.
 1.4 28-Nov-2001  thorpej Disable MRL, MRM, and MWI for now.
 1.3 10-Nov-2001  thorpej branches: 1.3.2; 1.3.4;
Add a comment explaining that we expect the memory controller
registers to already be subregion'd off, and actually init
the PCI DMA tag.
 1.2 09-Nov-2001  thorpej Disable the ATU interrupt sources (i.e. interrupts that occur when
we get Master or Target aborts).
 1.1 09-Nov-2001  thorpej Snapshot of work-in-progress for Intel i80312 Companion I/O chip;
just basic Inbound and Outbound window setup is done, PCI configuration
space access (not quite working yet), and I/O and Memory space routines
so far.
 1.3.4.9 03-Jan-2003  thorpej Sync with HEAD.
 1.3.4.8 18-Oct-2002  nathanw Catch up to -current.
 1.3.4.7 19-Aug-2002  thorpej Partial (ARM only) sync with trunk -- significant performance improvements
for XScale-based systems.
 1.3.4.6 13-Aug-2002  nathanw Catch up to -current.
 1.3.4.5 20-Jun-2002  nathanw Catch up to -current.
 1.3.4.4 28-Feb-2002  nathanw Catch up to -current.
 1.3.4.3 11-Jan-2002  nathanw More catchup.
 1.3.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.4.1 10-Nov-2001  nathanw file i80312.c was added on branch nathanw_sa on 2002-01-08 00:23:19 +0000
 1.3.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.3.2.1 10-Nov-2001  thorpej file i80312.c was added on branch thorpej-mips-cache on 2001-11-12 21:16:34 +0000
 1.7.2.6 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.7.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.7.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.7.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.2.1 04-Jan-2002  thorpej file i80312.c was added on branch kqueue on 2002-01-10 19:38:32 +0000
 1.8.8.2 30-Aug-2002  gehenna catch up with -current.
 1.8.8.1 30-May-2002  gehenna Catch up with -current.
 1.14.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.2 03-Sep-2004  skrll Sync with HEAD
 1.14.2.1 03-Aug-2004  skrll Sync with HEAD
 1.17.12.1 21-Jun-2006  yamt sync with head.
 1.18.6.1 22-Apr-2006  simonb Sync with head.
 1.18.4.1 09-Sep-2006  rpaulo sync with head
 1.18.2.1 01-Mar-2006  yamt sync with head.
 1.19.102.1 06-Jun-2011  jruoho Sync with HEAD.
 1.19.96.1 31-May-2011  rmind sync with head
 1.21.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.21.2.1 30-Oct-2012  yamt sync with head
 1.23.38.1 10-Jun-2019  christos Sync with HEAD
 1.24.14.1 02-Apr-2021  thorpej config_found_ia() -> config_found() w/ CFARG_IATTR.
 1.25.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.4 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 15-Jul-2003  lukem __KERNEL_RCSID()
 1.1 29-Nov-2001  thorpej branches: 1.1.2; 1.1.4; 1.1.22;
Add routines for accessing the general purpose I/O facility of
the i80312 Companion I/O chip.
 1.1.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.22.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 29-Nov-2001  thorpej file i80312_gpio.c was added on branch kqueue on 2002-01-10 19:38:32 +0000
 1.1.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.1 29-Nov-2001  nathanw file i80312_gpio.c was added on branch nathanw_sa on 2002-01-08 00:23:19 +0000
 1.7 22-Dec-2019  thorpej Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus(). "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().
 1.6 10-Jan-2012  jakllsch branches: 1.6.48;
split iopi2c(4) device/softc
 1.5 01-Jul-2011  dyoung branches: 1.5.2; 1.5.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.4 06-Dec-2007  ad lockmgr -> mutex
 1.3 08-Mar-2006  lukem branches: 1.3.24; 1.3.36; 1.3.38; 1.3.40; 1.3.42; 1.3.48; 1.3.52;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.2 11-Dec-2005  christos branches: 1.2.4; 1.2.6; 1.2.8; 1.2.10;
merge ktrace-lwp.
 1.1 06-Oct-2003  thorpej branches: 1.1.4; 1.1.18;
Add support for the i80312 and i80321 I2C controllers.
 1.1.18.2 07-Dec-2007  yamt sync with head
 1.1.18.1 21-Jun-2006  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 06-Oct-2003  skrll file i80312_i2c.c was added on branch ktrace-lwp on 2004-08-03 10:32:58 +0000
 1.2.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.2.8.1 13-Mar-2006  yamt sync with head.
 1.2.6.1 22-Apr-2006  simonb Sync with head.
 1.2.4.1 09-Sep-2006  rpaulo sync with head
 1.3.52.1 08-Dec-2007  ad Sync with head.
 1.3.48.1 08-Dec-2007  mjf Sync with HEAD.
 1.3.42.1 09-Jan-2008  matt sync with HEAD
 1.3.40.1 01-Jan-2008  chris Sync with HEAD.
 1.3.38.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.3.36.1 26-Dec-2007  rjs Sync with HEAD.
 1.3.24.1 09-Dec-2007  reinoud Pullup to HEAD
 1.5.6.1 18-Feb-2012  mrg merge to -current.
 1.5.2.1 17-Apr-2012  yamt sync with head
 1.6.48.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.6 31-Jul-2018  skrll Sprinkle #include "opt_arm_debug.h" where VERBOSE_INIT_ARM is used
 1.5 01-Jul-2011  dyoung branches: 1.5.52; 1.5.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 15-Jul-2003  lukem __KERNEL_RCSID()
 1.2 18-Dec-2001  thorpej branches: 1.2.2; 1.2.20;
Change some #if 0 to #ifdef VERBOSE_INIT_ARM.
 1.1 05-Nov-2001  thorpej branches: 1.1.2; 1.1.4;
Routines for handling the i80312 memory controller for XScale.
Currently includes a routine to determine memory size from the
SDRAM configuration registers.
 1.1.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.4.1 05-Nov-2001  nathanw file i80312_mem.c was added on branch nathanw_sa on 2002-01-08 00:23:19 +0000
 1.1.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.1 05-Nov-2001  thorpej file i80312_mem.c was added on branch thorpej-mips-cache on 2001-11-12 21:16:34 +0000
 1.2.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.20.1 03-Aug-2004  skrll Sync with HEAD
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 18-Dec-2001  thorpej file i80312_mem.c was added on branch kqueue on 2002-01-10 19:38:33 +0000
 1.5.54.1 10-Jun-2019  christos Sync with HEAD
 1.5.52.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.20 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.19 07-Jul-2020  thorpej 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.18 14-Jun-2020  chs replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.17 01-Mar-2019  msaitoh - Almost all ppbreg.h's definitions are also in pcireg.h. Remove duplicated
definitions from ppbreg.h and move some definitions from ppbreg.h to
pcireg.h.
- Change fast back-to-back "capable" to "enable" in pci_subr.c.
- Print Primary Discard Timer, Secondary Discard Timer, Discard Timer Status
and Discard Timer SERR# Enable bit in pci_subr.c.
- PCI_BRIDGE_PREFETCHBASE32_REG and PCI_BRIDGE_PREFETCHLIMIT32_REG are
"upper" 32bit registers, rename to *UP32_REG to avoid confusion.
- Use macro.
 1.16 02-Oct-2015  msaitoh branches: 1.16.18;
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.15 28-Jan-2014  martin branches: 1.15.6;
Remove an unused variable
 1.14 18-Aug-2013  matt <arm/locore.h> fallout (fixes some include ordering errors)
 1.13 14-Oct-2012  msaitoh branches: 1.13.2;
struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.12 07-Sep-2012  matt branches: 1.12.2;
Fix more pci_conf_interrupt/pci_conf_hook problems
 1.11 27-Jan-2012  para converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.10 01-Jul-2011  dyoung branches: 1.10.2; 1.10.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 15-Jul-2003  lukem __KERNEL_RCSID()
 1.7 23-May-2003  briggs branches: 1.7.2;
Sprinkle a few aprint_normal()s in place of printf().
 1.6 30-Nov-2001  thorpej branches: 1.6.2;
Clarify a comment.
 1.5 29-Nov-2001  thorpej Use the new arm_dcache_align variable to set the PCI device BHLC
register.
 1.4 28-Nov-2001  thorpej Add a "cacheline_size" argument to pci_configure_bus(). It is used
to set the cacheline size in the BHLC register. This should be the
size of the largest D-cache line on a system.
 1.3 09-Nov-2001  thorpej branches: 1.3.2; 1.3.4;
Add support for configuring the PCI bus (starting with the Secondary
bus only, for now).

XXX Some cleanup wrt. pci_conf_interrupt() needs to happen.
 1.2 09-Nov-2001  thorpej Clear the Master Abort after reading config space for a non-existent
PCI device. Disable debugging messages, as PCI config space works now.
 1.1 09-Nov-2001  thorpej Snapshot of work-in-progress for Intel i80312 Companion I/O chip;
just basic Inbound and Outbound window setup is done, PCI configuration
space access (not quite working yet), and I/O and Memory space routines
so far.
 1.3.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.4.1 09-Nov-2001  nathanw file i80312_pci.c was added on branch nathanw_sa on 2002-01-08 00:23:19 +0000
 1.3.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.3.2.1 09-Nov-2001  thorpej file i80312_pci.c was added on branch thorpej-mips-cache on 2001-11-12 21:16:34 +0000
 1.6.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.1 30-Nov-2001  thorpej file i80312_pci.c was added on branch kqueue on 2002-01-10 19:38:33 +0000
 1.7.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.10.6.1 18-Feb-2012  mrg merge to -current.
 1.10.2.3 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.10.2.2 30-Oct-2012  yamt sync with head
 1.10.2.1 17-Apr-2012  yamt sync with head
 1.12.2.3 03-Dec-2017  jdolecek update from HEAD
 1.12.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.13.2.2 18-May-2014  rmind sync with head
 1.13.2.1 28-Aug-2013  rmind sync with head
 1.15.6.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.16.18.1 10-Jun-2019  christos Sync with HEAD
 1.6 01-Aug-2002  thorpej Move the DMA tag initialization functions into i80312.c.
 1.5 31-Jul-2002  thorpej Overhaul how DMA ranges work in the ARM bus_dma implementation.

A new "arm32_dma_range" structure now describes a DMA window, with
a system address base, bus address base, and length. In addition to
providing info about which memory regions are legal for DMA, the new
structure provides address translation support, as well.

As before, if a tag does not list any ranges, then all addresses are
considered valid, and no DMA address translation is performed.

This allows us to remove a large chunk of code which was duplicated and
tweaked slightly (to do the address translation) from the stock ARM
bus_dma in the XScale IOP and ARM Integrator ports.

Test compiled on all ARM platforms, test booted on Intel IQ80321 and Shark.
 1.4 28-Jul-2002  thorpej Change the way that DMA map syncs are done. Instead of remembering
the virtual address for each DMA segment, just cache a pointer to the
original buffer/buftype used to load the DMA map, and use that. This
lets us shrink the bus_dma_segment_t down from 12 bytes to 8, and the
cache flushing is also more efficient.

Tested on an i80321 -- changes to others are mechanical.
 1.3 02-May-2002  thorpej branches: 1.3.2; 1.3.4;
Fix error reporting in the bus_dmamap_load_mbuf() routines.
 1.2 25-Jan-2002  thorpej Overhaul bus_dmamap_sync for the ARM:
* Track which process (XXX really, vmspace) owns the mapping. When
we sync the map, if the mapping doesn't belong to the kernel or to
the current process (XXX really, vmspace), then no cache fobbing
is necessary, since the cache is Wb-Inv'd on context switch (XXX need
to revisit this when we support FCSE).
* Be smarter about which cache operation we do when sync'ing the map:
- PREREAD -- Invalidate D$ (XXX right now, we actually do Wb-Inv)
- PREWRITE -- Write-back D$ (note, we do NOT invalidate here)
- PREREAD|PREWRITE -- Wb-Inv D$

More work is needed here. In particular, a version for CPUs
with write-through caches should be provided, to eliminate
the write-back steps (which are noops on such CPUs, but skipping
two branches would be nice).
 1.1 09-Nov-2001  thorpej branches: 1.1.2; 1.1.4; 1.1.6;
Add support for PCI DMA on the i80312. We currently just do
DMA via the Secondary Inbound window, for now. Will probably
need to revisit this at some point.

Require that the board-specific i80312 front-end slice off a
subregion for the memory controller before calling i80312_attach(),
and fix a bug in the IQ80310 front-end that caused the Secondary
Inbound window to be configured incorrectly.
 1.1.6.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 09-Nov-2001  thorpej file i80312_pci_dma.c was added on branch kqueue on 2002-01-10 19:38:33 +0000
 1.1.4.5 13-Aug-2002  nathanw Catch up to -current.
 1.1.4.4 01-Aug-2002  nathanw Catch up to -current.
 1.1.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 09-Nov-2001  nathanw file i80312_pci_dma.c was added on branch nathanw_sa on 2002-02-28 04:07:45 +0000
 1.1.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.1 09-Nov-2001  thorpej file i80312_pci_dma.c was added on branch thorpej-mips-cache on 2001-11-12 21:16:35 +0000
 1.3.4.1 07-Dec-2002  he Pull up revision 1.4 (requested by thorpej in ticket #568):
Change the way DMA map syncs are done. Instead of remembering
the virtual address for each DMA segment, just cache a
pointer to the original buffer/buftype used to load the
DMA map, and use that. Shrinks bus_dma_segment_t from 12
to 8 bytes, and the cache flushing is also more efficient.
 1.3.2.1 30-Aug-2002  gehenna catch up with -current.
 1.12 16-Mar-2018  ryo use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
 1.11 01-Jul-2011  dyoung branches: 1.11.52;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.10 24-Feb-2010  skrll Typo in comment.
 1.9 24-Nov-2005  yamt branches: 1.9.80; 1.9.100;
bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
 1.8 01-Apr-2005  yamt branches: 1.8.2; 1.8.8;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.7 06-Oct-2003  thorpej branches: 1.7.8; 1.7.10;
Make sure to pass mod/ref seeds with PMAP_WIRED.
 1.6 15-Jul-2003  lukem __KERNEL_RCSID()
 1.5 27-Sep-2002  provos branches: 1.5.8;
remove trailing \n in panic(). approved perry.
 1.4 29-Aug-2002  briggs Use generic_bs_sr_4 for bus_space_set_region_4.
 1.3 12-Apr-2002  thorpej branches: 1.3.2; 1.3.4;
Use the bus_space_generic bus space ops.
 1.2 28-Nov-2001  thorpej branches: 1.2.2;
Oops, make sure to add in the physical base of the PCI memory
window when mapping PCI mem space. (Whee, I can take out my
local hack, now).
 1.1 09-Nov-2001  thorpej branches: 1.1.2; 1.1.4;
Snapshot of work-in-progress for Intel i80312 Companion I/O chip;
just basic Inbound and Outbound window setup is done, PCI configuration
space access (not quite working yet), and I/O and Memory space routines
so far.
 1.1.4.5 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.4 29-Aug-2002  briggs Sync with head.
 1.1.4.3 17-Apr-2002  nathanw Catch up to -current.
 1.1.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.4.1 09-Nov-2001  nathanw file i80312_space.c was added on branch nathanw_sa on 2002-01-08 00:23:19 +0000
 1.1.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.1 09-Nov-2001  thorpej file i80312_space.c was added on branch thorpej-mips-cache on 2001-11-12 21:16:35 +0000
 1.2.2.5 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.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1 28-Nov-2001  thorpej file i80312_space.c was added on branch kqueue on 2002-01-10 19:38:33 +0000
 1.3.4.1 07-Dec-2002  he Pull up revision 1.4 (requested by briggs in ticket #749):
Use generic_bs_sr_4 for bus_space_set_region_4.
 1.3.2.1 31-Aug-2002  gehenna catch up with -current.
 1.5.8.5 11-Dec-2005  christos Sync with head.
 1.5.8.4 01-Apr-2005  skrll Sync with HEAD.
 1.5.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.8.1 03-Aug-2004  skrll Sync with HEAD
 1.7.10.1 28-Jan-2005  yamt convert arch/arm to new apis.
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.8.8.1 29-Nov-2005  yamt sync with head.
 1.8.2.1 21-Jun-2006  yamt sync with head.
 1.9.100.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.9.80.1 11-Mar-2010  yamt sync with head
 1.11.52.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.2 12-Apr-2002  thorpej Use the bus_space_generic bus space ops.
 1.1 09-Nov-2001  thorpej branches: 1.1.2; 1.1.4; 1.1.6;
Snapshot of work-in-progress for Intel i80312 Companion I/O chip;
just basic Inbound and Outbound window setup is done, PCI configuration
space access (not quite working yet), and I/O and Memory space routines
so far.
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 09-Nov-2001  thorpej file i80312_space_asm.S was added on branch kqueue on 2002-01-10 19:38:33 +0000
 1.1.4.2 17-Apr-2002  nathanw Catch up to -current.
 1.1.4.1 09-Nov-2001  nathanw file i80312_space_asm.S was added on branch nathanw_sa on 2002-04-17 00:02:36 +0000
 1.1.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.1 09-Nov-2001  thorpej file i80312_space_asm.S was added on branch thorpej-mips-cache on 2001-11-12 21:16:35 +0000
 1.12 08-Feb-2018  dholland Typos.
 1.11 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.10 24-Jan-2002  thorpej branches: 1.10.2; 1.10.124; 1.10.126; 1.10.128;
Clean up the i80312 PMU definitions.
 1.9 29-Nov-2001  thorpej Update copyright.
 1.8 09-Nov-2001  thorpej branches: 1.8.2;
Disable the ATU interrupt sources (i.e. interrupts that occur when
we get Master or Target aborts).
 1.7 09-Nov-2001  thorpej Snapshot of work-in-progress for Intel i80312 Companion I/O chip;
just basic Inbound and Outbound window setup is done, PCI configuration
space access (not quite working yet), and I/O and Memory space routines
so far.
 1.6 08-Nov-2001  thorpej Adjust the way the PMMRs are defined -- offsets from a base, not
absolutes. Also, add PPB and more ATU registers.
 1.5 04-Nov-2001  thorpej Add PCI window addresses.
 1.4 04-Nov-2001  thorpej Add a comment describing what this file is.
 1.3 04-Nov-2001  thorpej Add missing RCS ID, add missing name.
 1.2 05-Sep-2001  matt branches: 1.2.4;
Fix some register definitions.
 1.1 26-Aug-2001  matt Add i80312 register definitions (just registers for now).
 1.2.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.8.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.8.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.8.2.1 09-Nov-2001  nathanw file i80312reg.h was added on branch nathanw_sa on 2002-01-08 00:23:19 +0000
 1.10.128.1 16-May-2008  yamt sync with head.
 1.10.126.1 18-May-2008  yamt sync with head.
 1.10.124.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.10.2.1 24-Jan-2002  jdolecek file i80312reg.h was added on branch kqueue on 2002-02-11 20:07:22 +0000
 1.11 14-Oct-2012  msaitoh struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.10 01-Jul-2011  dyoung branches: 1.10.2; 1.10.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 06-Oct-2003  thorpej Add support for the i80312 and i80321 I2C controllers.
 1.7 01-Aug-2002  thorpej branches: 1.7.8;
Move the DMA tag initialization functions into i80312.c.
 1.6 31-Jul-2002  thorpej Overhaul how DMA ranges work in the ARM bus_dma implementation.

A new "arm32_dma_range" structure now describes a DMA window, with
a system address base, bus address base, and length. In addition to
providing info about which memory regions are legal for DMA, the new
structure provides address translation support, as well.

As before, if a tag does not list any ranges, then all addresses are
considered valid, and no DMA address translation is performed.

This allows us to remove a large chunk of code which was duplicated and
tweaked slightly (to do the address translation) from the stock ARM
bus_dma in the XScale IOP and ARM Integrator ports.

Test compiled on all ARM platforms, test booted on Intel IQ80321 and Shark.
 1.5 29-Nov-2001  thorpej branches: 1.5.2; 1.5.10;
Add routines for accessing the general purpose I/O facility of
the i80312 Companion I/O chip.
 1.4 09-Nov-2001  thorpej branches: 1.4.2; 1.4.4;
Add support for PCI DMA on the i80312. We currently just do
DMA via the Secondary Inbound window, for now. Will probably
need to revisit this at some point.

Require that the board-specific i80312 front-end slice off a
subregion for the memory controller before calling i80312_attach(),
and fix a bug in the IQ80310 front-end that caused the Secondary
Inbound window to be configured incorrectly.
 1.3 09-Nov-2001  thorpej Snapshot of work-in-progress for Intel i80312 Companion I/O chip;
just basic Inbound and Outbound window setup is done, PCI configuration
space access (not quite working yet), and I/O and Memory space routines
so far.
 1.2 05-Nov-2001  thorpej RCS ID.
 1.1 05-Nov-2001  thorpej Prototypes for i80312 routines.
 1.4.4.4 13-Aug-2002  nathanw Catch up to -current.
 1.4.4.3 01-Aug-2002  nathanw Catch up to -current.
 1.4.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.4.4.1 09-Nov-2001  nathanw file i80312var.h was added on branch nathanw_sa on 2002-01-08 00:23:19 +0000
 1.4.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.4.2.1 09-Nov-2001  thorpej file i80312var.h was added on branch thorpej-mips-cache on 2001-11-12 21:16:35 +0000
 1.5.10.1 30-Aug-2002  gehenna catch up with -current.
 1.5.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.5.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.1 29-Nov-2001  thorpej file i80312var.h was added on branch kqueue on 2002-01-10 19:38:33 +0000
 1.7.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.8.1 03-Aug-2004  skrll 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.26 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.25 24-Apr-2021  thorpej branches: 1.25.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.24 18-Sep-2012  matt branches: 1.24.52;
Add bounce buffer support for ARM bus_dma(9). Add macros to help initialize
bus_dma_tag structures.
 1.23 12-Feb-2012  matt branches: 1.23.6;
Change old-stlye-defintions to C89 prototypes.
Switch to CFATTACH_DECL_NEW/device_t/cfdata_t
Defer attaching interrupt evcnts.

Approved by releng.
 1.22 01-Jul-2011  dyoung branches: 1.22.2; 1.22.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.21 17-May-2011  dyoung 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.20 17-Oct-2007  garbled branches: 1.20.42; 1.20.48;
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.19 12-May-2007  gavan branches: 1.19.10; 1.19.12;
Implement ATU Direct Window in order to increase available PCI address
space.
 1.18 25-Feb-2006  wiz branches: 1.18.20; 1.18.24; 1.18.26; 1.18.32;
Fix some typos.
 1.17 11-Dec-2005  christos branches: 1.17.2; 1.17.4; 1.17.6;
merge ktrace-lwp.
 1.16 30-Aug-2004  drochner branches: 1.16.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.15 06-Oct-2003  thorpej Add support for the i80312 and i80321 I2C controllers.
 1.14 15-Jul-2003  lukem __KERNEL_RCSID()
 1.13 15-Jun-2003  fvdl branches: 1.13.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.12 06-Feb-2003  briggs Define the iopmu (even though it's not being used yet).
Export i80321_local_dma_init().
Make !sc->sc_is_host configuration a little more friendly.
Go back to using IABAR2 instead of IABAR3 for inbound SDRAM access.
 1.11 23-Jan-2003  briggs Use iwin[3] instead of iwin[2] for RAM access and leave iwin[2] unused.
 1.10 23-Jan-2003  briggs Program the BARs after the limit regs. When the BARs are written, the
value actually stored in the BAR is masked by the limit register.
 1.9 01-Jan-2003  thorpej * Use a device node for each DMA channel.
* Use aprint_normal() for cfprint routines.
 1.8 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.7 17-Aug-2002  thorpej Use separate function pointers for dmamap_sync pre- vs post- operations.
Change the bus_dmamap_sync() macro to test the ops argument against pre-
and post- constants. The compiler will optimize out dead code because
of the constants. Since post- operations are not needed on ARM (except
for ISA bounce buffers), this eliminate a large number of function calls
which are noops, each of which cost at least 6 cycles just in the call
and return overhead (not to mention whatever other useless work the
compiler decides to do in the callee).
 1.6 01-Aug-2002  thorpej Move the DMA tag initialization functions into i80321.c.
 1.5 31-Jul-2002  thorpej Overhaul how DMA ranges work in the ARM bus_dma implementation.

A new "arm32_dma_range" structure now describes a DMA window, with
a system address base, bus address base, and length. In addition to
providing info about which memory regions are legal for DMA, the new
structure provides address translation support, as well.

As before, if a tag does not list any ranges, then all addresses are
considered valid, and no DMA address translation is performed.

This allows us to remove a large chunk of code which was duplicated and
tweaked slightly (to do the address translation) from the stock ARM
bus_dma in the XScale IOP and ARM Integrator ports.

Test compiled on all ARM platforms, test booted on Intel IQ80321 and Shark.
 1.4 29-Jul-2002  thorpej Add support for attaching IOP built-in sub-devices (aau, dma, ssp,
watchdog, etc.)
 1.3 25-Jul-2002  thorpej Add support for DMA to/from the on-chip devices of the i80321 (no
PCI window translation).

XXX This would be better done by overhauling the shared ARM bus_dma code.
 1.2 16-May-2002  thorpej branches: 1.2.2; 1.2.4;
* 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 27-Mar-2002  thorpej branches: 1.1.2; 1.1.4;
Basic support for the Intel i80321 I/O Processor (Xscale core).

Note: This is a snapshot of work-in-progress; there are still some
bugs to be shaken out.
 1.1.4.2 30-Aug-2002  gehenna catch up with -current.
 1.1.4.1 30-May-2002  gehenna Catch up with -current.
 1.1.2.8 03-Jan-2003  thorpej Sync with HEAD.
 1.1.2.7 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.6 19-Aug-2002  thorpej Partial (ARM only) sync with trunk -- significant performance improvements
for XScale-based systems.
 1.1.2.5 13-Aug-2002  nathanw Catch up to -current.
 1.1.2.4 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 27-Mar-2002  nathanw file i80321.c was added on branch nathanw_sa on 2002-04-01 07:39:16 +0000
 1.2.4.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.2.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.4.1 16-May-2002  jdolecek file i80321.c was added on branch kqueue on 2002-06-23 17:34:57 +0000
 1.2.2.2 07-Dec-2002  he Pull up revision 1.3 (requested by thorpej in ticket #568):
Add support for DMA to/from the on-chip devices of the
i80321.
 1.2.2.1 11-Nov-2002  he Pull up revision 1.4 (requested by thorpej in ticket #571):
Add support for attaching IOP built-in sub-devices (aau,
dma, ssp, watchdog, etc.)
 1.13.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.13.2.2 03-Sep-2004  skrll Sync with HEAD
 1.13.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.12.2 03-Sep-2007  yamt sync with head.
 1.16.12.1 21-Jun-2006  yamt sync with head.
 1.17.6.1 22-Apr-2006  simonb Sync with head.
 1.17.4.1 09-Sep-2006  rpaulo sync with head
 1.17.2.1 01-Mar-2006  yamt sync with head.
 1.18.32.1 22-May-2007  matt Update to HEAD.
 1.18.26.1 11-Jul-2007  mjf Sync with head.
 1.18.24.1 27-May-2007  ad Sync with head.
 1.18.20.1 17-May-2007  yamt sync with head.
 1.19.12.1 06-Nov-2007  matt sync with HEAD
 1.19.10.1 01-Jan-2008  chris Sync with HEAD.
 1.20.48.1 06-Jun-2011  jruoho Sync with HEAD.
 1.20.42.1 31-May-2011  rmind sync with head
 1.22.6.1 18-Feb-2012  mrg merge to -current.
 1.22.2.2 30-Oct-2012  yamt sync with head
 1.22.2.1 17-Apr-2012  yamt sync with head
 1.23.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.24.52.1 02-Apr-2021  thorpej config_found_ia() -> config_found() w/ CFARG_IATTR.
 1.25.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.15 12-Feb-2012  matt Change old-stlye-defintions to C89 prototypes.
Switch to CFATTACH_DECL_NEW/device_t/cfdata_t
Defer attaching interrupt evcnts.

Approved by releng.
 1.14 05-Jan-2009  briggs branches: 1.14.14; 1.14.18;
Don't try to use iopaau_desc_4/8_cache before they're initialized.
 1.13 27-Apr-2008  matt branches: 1.13.8; 1.13.10;
Merge kernel changes in matt-armv6 to HEAD.
 1.12 05-Jan-2008  ad branches: 1.12.6; 1.12.8; 1.12.10;
Fix includes.
 1.11 20-Nov-2007  ad branches: 1.11.6;
For the last time, compile!
 1.10 17-Nov-2007  ad Make it compile.
 1.9 29-Apr-2003  thorpej branches: 1.9.18; 1.9.60; 1.9.76; 1.9.78; 1.9.80; 1.9.82; 1.9.86; 1.9.88;
Use aprint*().
 1.8 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.7 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.6 27-Sep-2002  thorpej 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.5 04-Aug-2002  thorpej branches: 1.5.2; 1.5.4; 1.5.6;
Add support for "xor5", "xor6", "xor7", and "xor8".
 1.4 03-Aug-2002  thorpej Restructure the iopaau_function slightly to provide greater
flexibility when using different descriptor formats.
 1.3 02-Aug-2002  thorpej Add support for xor2, xor3, and xor4. Fix inverted direction
indications in some bus_dma operations.
 1.2 02-Aug-2002  thorpej Grr, RCS ID tag typo.
 1.1 02-Aug-2002  thorpej Add support for the Intel i80321 I/O Processor's Application Accelerator
Unit. The AAU provides block fill, block copy, XOR, and XOR-parity-check
operations. We currently provide dmover(9) functions for "zero", "fill8",
and "copy".

Much of this code can be shared with the i80312 Companion I/O AAU, and
will be when support for the older chip is implemented.
 1.5.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.5.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.5.6.1 04-Aug-2002  jdolecek file i80321_aau.c was added on branch kqueue on 2002-09-06 08:33:08 +0000
 1.5.4.2 30-Aug-2002  gehenna catch up with -current.
 1.5.4.1 04-Aug-2002  gehenna file i80321_aau.c was added on branch gehenna-devsw on 2002-08-30 00:19:18 +0000
 1.5.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.5.2.2 13-Aug-2002  nathanw Catch up to -current.
 1.5.2.1 04-Aug-2002  nathanw file i80321_aau.c was added on branch nathanw_sa on 2002-08-13 02:17:58 +0000
 1.9.88.3 18-Feb-2008  mjf Sync with HEAD.
 1.9.88.2 08-Dec-2007  mjf Sync with HEAD.
 1.9.88.1 19-Nov-2007  mjf Sync with HEAD.
 1.9.86.2 21-Nov-2007  bouyer Sync with HEAD
 1.9.86.1 18-Nov-2007  bouyer Sync with HEAD
 1.9.82.2 09-Jan-2008  matt sync with HEAD
 1.9.82.1 09-Nov-2007  matt Make all the evbarm kernels build again. Fix lossage from rebase.
 1.9.80.2 20-Jan-2008  chris Sync to HEAD.
 1.9.80.1 01-Jan-2008  chris Sync with HEAD.
 1.9.78.1 21-Nov-2007  joerg Sync with HEAD.
 1.9.76.2 28-Feb-2008  rjs Sync with HEAD.
 1.9.76.1 26-Dec-2007  rjs Sync with HEAD.
 1.9.60.1 03-Dec-2007  ad Sync with HEAD.
 1.9.18.2 21-Jan-2008  yamt sync with head
 1.9.18.1 07-Dec-2007  yamt sync with head
 1.11.6.1 08-Jan-2008  bouyer Sync with HEAD
 1.12.10.2 04-May-2009  yamt sync with head.
 1.12.10.1 16-May-2008  yamt sync with head.
 1.12.8.1 18-May-2008  yamt sync with head.
 1.12.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.12.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.13.10.1 09-Jan-2009  snj Pull up following revision(s) (requested by briggs in ticket #237):
sys/arch/arm/xscale/i80321_aau.c: revision 1.14
Don't try to use iopaau_desc_4/8_cache before they're initialized.
 1.13.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.14.18.1 18-Feb-2012  mrg merge to -current.
 1.14.14.1 17-Apr-2012  yamt sync with head
 1.3 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 06-Oct-2003  thorpej branches: 1.1.4;
Add support for the i80312 and i80321 I2C controllers.
 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 06-Oct-2003  skrll file i80321_gpio.c was added on branch ktrace-lwp on 2004-08-03 10:32:58 +0000
 1.6 22-Dec-2019  thorpej Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus(). "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().
 1.5 10-Jan-2012  jakllsch branches: 1.5.48;
split iopi2c(4) device/softc
 1.4 01-Jul-2011  dyoung branches: 1.4.2; 1.4.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.3 06-Dec-2007  ad lockmgr -> mutex
 1.2 11-Dec-2005  christos branches: 1.2.34; 1.2.46; 1.2.48; 1.2.50; 1.2.52; 1.2.58; 1.2.62;
merge ktrace-lwp.
 1.1 06-Oct-2003  thorpej branches: 1.1.4; 1.1.18;
Add support for the i80312 and i80321 I2C controllers.
 1.1.18.1 07-Dec-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 06-Oct-2003  skrll file i80321_i2c.c was added on branch ktrace-lwp on 2004-08-03 10:32:58 +0000
 1.2.62.1 08-Dec-2007  ad Sync with head.
 1.2.58.1 08-Dec-2007  mjf Sync with HEAD.
 1.2.52.1 09-Jan-2008  matt sync with HEAD
 1.2.50.1 01-Jan-2008  chris Sync with HEAD.
 1.2.48.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.2.46.1 26-Dec-2007  rjs Sync with HEAD.
 1.2.34.1 09-Dec-2007  reinoud Pullup to HEAD
 1.4.6.1 18-Feb-2012  mrg merge to -current.
 1.4.2.1 17-Apr-2012  yamt sync with head
 1.5.48.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.27 06-Aug-2021  rin Simplify i80321_intr_calculate_masks().

G/C unused members of struct intrq.

No functional changes intended.
 1.26 20-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.25 10-Nov-2019  chs branches: 1.25.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.24 02-Aug-2012  skrll branches: 1.24.40;
Remove irqframe and replace with identical trapframe.
 1.23 12-Feb-2012  matt Change old-stlye-defintions to C89 prototypes.
Switch to CFATTACH_DECL_NEW/device_t/cfdata_t
Defer attaching interrupt evcnts.

Approved by releng.
 1.22 01-Jul-2011  dyoung branches: 1.22.2; 1.22.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.21 20-Dec-2010  matt Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.20 13-Jun-2010  tsutsui Apply fixes for PR port-arm/43339:
Set proper IPL_SOFTfoo values even in !FAST_SOFTINTS case.
Some assertions in MI code expect they have unique values,
per comments from rmind@.

Also cleanup various "interrupt hierarchy" code since IPL_NONE and
IPL_SOFTfoo should not be set by any hardware interrupt establish functions.

Ok'ed by mrg@, tested on shark and hpcarm.
 1.19 05-Jan-2009  briggs branches: 1.19.4; 1.19.6;
Ifdef out and comment a KASSERT() that's a bit too aggressive. There
are never any interrupts masked at IPL_VM before any interrupts have
been registered.
 1.18 27-Apr-2008  matt branches: 1.18.8; 1.18.10;
Merge kernel changes in matt-armv6 to HEAD.
 1.17 06-Jan-2008  matt branches: 1.17.6; 1.17.8; 1.17.10;
Cleanup softint lossage.
 1.16 11-Dec-2007  ad And you, be ye fruitful, and multiply; bring forth abundantly in the earth,
and multiply therein. (Genesis 9:6-8)
 1.15 03-Dec-2007  ad branches: 1.15.2; 1.15.4; 1.15.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.14 24-Nov-2006  wiz branches: 1.14.8; 1.14.24; 1.14.26; 1.14.28; 1.14.30; 1.14.36;
s/heirarchy/hierarchy/, from Zafer.
 1.13 08-Nov-2006  scw If I80321_HPI_ENABLED is defined, add support for handling interrupts from
devices hooked up to the HPI pin.

HPIs cannot be masked at the interrupt controller; they can only be masked
by disabling IRQs in the XScale core. To deal with this, we tweak the
interrupt frame so that IRQs are disabled when the interrupt dispatcher
returns due to a masked HPI interrupt. IRQs will be re-enabled by a
subsequent splx(9).

Fortunately the only instance where HPI is used is for the console UART
on a couple of boards, so this hack does not adversely affect performance.

Contributed by Wasabi Systems.
 1.12 17-May-2006  mrg branches: 1.12.8; 1.12.10;
remove 'inline' from the xxx_do_pending() function that is called from
external sources, and conflicts with it's prototype.
 1.11 24-Dec-2005  perry branches: 1.11.4; 1.11.6; 1.11.8; 1.11.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 03-Dec-2003  scw branches: 1.9.16;
As per the recent ixp425 fix (which is based on this code):

In the interrupt dispatch loop, make sure to handle any pending interrupts
which came in while we were dealing with the first interrupt(s), and which
are enabled at the current spl.

This fixes a problem where the intr_enabled/hw mask is not updated to
allow pending interrupts through until the next splx(). In some case,
interrupts could be delayed until the next clock tick.
 1.8 15-Jul-2003  lukem __KERNEL_RCSID()
 1.7 16-Jun-2003  thorpej branches: 1.7.2;
Rename IPL_IMP -> IPL_VM.
 1.6 09-Oct-2002  thorpej Clean up some bad interaction between the spl inlining stuff and
strict-prototypes.
 1.5 17-Aug-2002  briggs Add a new option EVBARM_BOARDTYPE to differentiate between different
evbarm ports. Inline _splraise/_spllower/splx for i80321 and iq80310
for more performance.
 1.4 14-Aug-2002  thorpej Don't need to frob CPSR in _splraise().
 1.3 30-Jul-2002  thorpej Use more descriptive interrupt names.
 1.2 28-Mar-2002  thorpej branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
Fix soft interrupts.
 1.1 27-Mar-2002  thorpej Basic support for the Intel i80321 I/O Processor (Xscale core).

Note: This is a snapshot of work-in-progress; there are still some
bugs to be shaken out.
 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 28-Mar-2002  jdolecek file i80321_icu.c was added on branch kqueue on 2002-06-23 17:34:57 +0000
 1.2.6.2 18-Nov-2002  he Pull up revision 1.4 (requested by thorpej in ticket #679):
Don't need to frob CPSR in _splraise().
 1.2.6.1 11-Nov-2002  he Pull up revision 1.3 (requested by thorpej in ticket #583):
Use more descriptive interrupt names.
 1.2.4.1 30-Aug-2002  gehenna catch up with -current.
 1.2.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.4 19-Aug-2002  thorpej Partial (ARM only) sync with trunk -- significant performance improvements
for XScale-based systems.
 1.2.2.3 01-Aug-2002  nathanw Catch up to -current.
 1.2.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.1 28-Mar-2002  nathanw file i80321_icu.c was added on branch nathanw_sa on 2002-04-01 07:39:16 +0000
 1.7.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.4 21-Jan-2008  yamt sync with head
 1.9.16.3 07-Dec-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.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.10.1 10-Dec-2006  yamt sync with head.
 1.12.8.2 12-Jan-2007  ad Sync with head.
 1.12.8.1 18-Nov-2006  ad Sync with head.
 1.14.36.3 18-Feb-2008  mjf Sync with HEAD.
 1.14.36.2 27-Dec-2007  mjf Sync with HEAD.
 1.14.36.1 08-Dec-2007  mjf Sync with HEAD.
 1.14.30.3 28-Jan-2008  matt Given the that there are only 4 IPLs (ignoring soft IPLs), a number of
cleanups can be done:
Remove _SPL_* aliases.
Don't store irqmasks in ci_cpl, just make it an ipl level.
Add fast softint switching support.
 1.14.30.2 09-Jan-2008  matt sync with HEAD
 1.14.30.1 09-Nov-2007  matt Make all the evbarm kernels build again. Fix lossage from rebase.
 1.14.28.2 20-Jan-2008  chris Sync to HEAD.
 1.14.28.1 01-Jan-2008  chris Sync with HEAD.
 1.14.26.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.14.24.2 28-Feb-2008  rjs Sync with HEAD.
 1.14.24.1 26-Dec-2007  rjs Sync with HEAD.
 1.14.8.2 03-Dec-2007  ad Sync with HEAD.
 1.14.8.1 03-Dec-2007  ad Sync with HEAD.
 1.15.6.2 08-Jan-2008  bouyer Sync with HEAD
 1.15.6.1 13-Dec-2007  bouyer Sync with HEAD
 1.15.4.1 13-Dec-2007  yamt sync with head.
 1.15.2.1 26-Dec-2007  ad Sync with head.
 1.17.10.3 11-Aug-2010  yamt sync with head.
 1.17.10.2 04-May-2009  yamt sync with head.
 1.17.10.1 16-May-2008  yamt sync with head.
 1.17.8.1 18-May-2008  yamt sync with head.
 1.17.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.17.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.18.10.1 09-Jan-2009  snj Pull up following revision(s) (requested by briggs in ticket #237):
sys/arch/arm/xscale/i80321_icu.c: revision 1.19
Ifdef out and comment a KASSERT() that's a bit too aggressive. There
are never any interrupts masked at IPL_VM before any interrupts have
been registered.
 1.18.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.19.6.2 05-Mar-2011  rmind sync with head
 1.19.6.1 03-Jul-2010  rmind sync with head
 1.19.4.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.22.6.1 18-Feb-2012  mrg merge to -current.
 1.22.2.2 30-Oct-2012  yamt sync with head
 1.22.2.1 17-Apr-2012  yamt sync with head
 1.24.40.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.25.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.13 06-Aug-2021  rin Do *NOT* lower IPL in i80321_splraise().

Fix various strange crashes for DIAGNOSTIC kernel on evbarm/HDL_G,
including one worked around by if_wm.c rev 1.706:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/pci/if_wm.c#rev1.706
 1.12 24-Jan-2018  skrll Remove port-acorn26

OK core@
 1.11 04-Feb-2014  matt _setsoftintr is long dead. reap any leftovers from arm.
 1.10 27-Apr-2008  matt branches: 1.10.34; 1.10.44; 1.10.50;
Merge kernel changes in matt-armv6 to HEAD.
 1.9 08-Nov-2006  scw branches: 1.9.30; 1.9.54; 1.9.56; 1.9.58;
If I80321_HPI_ENABLED is defined, add support for handling interrupts from
devices hooked up to the HPI pin.

HPIs cannot be masked at the interrupt controller; they can only be masked
by disabling IRQs in the XScale core. To deal with this, we tweak the
interrupt frame so that IRQs are disabled when the interrupt dispatcher
returns due to a masked HPI interrupt. IRQs will be re-enabled by a
subsequent splx(9).

Fortunately the only instance where HPI is used is for the console UART
on a couple of boards, so this hack does not adversely affect performance.

Contributed by Wasabi Systems.
 1.8 10-Apr-2006  simonb branches: 1.8.8; 1.8.10;
Tab Police.
 1.7 24-Dec-2005  perry branches: 1.7.4; 1.7.6; 1.7.8; 1.7.10; 1.7.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 12-Jan-2004  scw branches: 1.5.16;
Use __insn_barrier() to prevent the compiler reordering splx/splraise
relative to the code they're supposed to protect.
 1.4 21-Sep-2003  matt Fix GCC 3.3.1 nits.
 1.3 03-Jan-2003  thorpej branches: 1.3.2;
Use the generic irq_dispatch.S
 1.2 09-Oct-2002  thorpej Clean up some bad interaction between the spl inlining stuff and
strict-prototypes.
 1.1 17-Aug-2002  briggs branches: 1.1.2; 1.1.4; 1.1.6;
Add a new option EVBARM_BOARDTYPE to differentiate between different
evbarm ports. Inline _splraise/_spllower/splx for i80321 and iq80310
for more performance.
 1.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 17-Aug-2002  jdolecek file i80321_intr.h was added on branch kqueue on 2002-09-06 08:33:09 +0000
 1.1.4.2 30-Aug-2002  gehenna catch up with -current.
 1.1.4.1 17-Aug-2002  gehenna file i80321_intr.h was added on branch gehenna-devsw on 2002-08-30 00:19:18 +0000
 1.1.2.4 03-Jan-2003  thorpej Sync with HEAD.
 1.1.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.2 19-Aug-2002  thorpej Partial (ARM only) sync with trunk -- significant performance improvements
for XScale-based systems.
 1.1.2.1 17-Aug-2002  thorpej file i80321_intr.h was added on branch nathanw_sa on 2002-08-19 21:39:22 +0000
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.5.16.2 30-Dec-2006  yamt sync with head.
 1.5.16.1 21-Jun-2006  yamt sync with head.
 1.7.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.7.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.7.8.1 11-Apr-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.8.10.1 10-Dec-2006  yamt sync with head.
 1.8.8.1 18-Nov-2006  ad Sync with head.
 1.9.58.1 16-May-2008  yamt sync with head.
 1.9.56.1 18-May-2008  yamt sync with head.
 1.9.54.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.30.2 28-Jan-2008  matt Given the that there are only 4 IPLs (ignoring soft IPLs), a number of
cleanups can be done:
Remove _SPL_* aliases.
Don't store irqmasks in ci_cpl, just make it an ipl level.
Add fast softint switching support.
 1.9.30.1 09-Nov-2007  matt Make all the evbarm kernels build again. Fix lossage from rebase.
 1.10.50.1 18-May-2014  rmind sync with head
 1.10.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.34.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.7 03-Jan-2003  thorpej Use the generic irq_dispatch.S
 1.6 02-Jan-2003  thorpej Garbage-collect prev_intr_depth; nothing uses it.
 1.5 14-Oct-2002  bjh21 Continue the " - . - 8" purge. Specifically:

add rd, pc, #foo - . - 8 -> adr rd, foo
ldr rd, [pc, #foo - . - 8] -> ldr rd, foo

Also, when saving the return address for a function pointer call, use
"mov lr, pc" just before the call unless the return address is somewhere
other than just after the call site.

Finally, a few obvious little micro-optimisations like using LDR directly
rather than ADR followed by LDR, and loading directly into PC rather than
bouncing via R0.
 1.4 17-Aug-2002  thorpej Use correct-for-ELF local labels.
 1.3 14-Aug-2002  thorpej Use cpsr_c rather then cpsr_all where appropriate.
 1.2 29-Jul-2002  thorpej Clean up some comments.
 1.1 27-Mar-2002  thorpej branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Basic support for the Intel i80321 I/O Processor (Xscale core).

Note: This is a snapshot of work-in-progress; there are still some
bugs to be shaken out.
 1.1.8.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 27-Mar-2002  jdolecek file i80321_irq.S was added on branch kqueue on 2002-06-23 17:34:58 +0000
 1.1.6.1 11-Nov-2002  he Pull up revision 1.2 (requested by thorpej in ticket #579):
Clean up some comments.
 1.1.4.1 30-Aug-2002  gehenna catch up with -current.
 1.1.2.6 03-Jan-2003  thorpej Sync with HEAD.
 1.1.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.4 19-Aug-2002  thorpej Partial (ARM only) sync with trunk -- significant performance improvements
for XScale-based systems.
 1.1.2.3 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 27-Mar-2002  nathanw file i80321_irq.S was added on branch nathanw_sa on 2002-04-01 07:39:16 +0000
 1.4 01-Aug-2002  thorpej branches: 1.4.4;
Move the DMA tag initialization functions into i80321.c.
 1.3 31-Jul-2002  thorpej branches: 1.3.2;
Overhaul how DMA ranges work in the ARM bus_dma implementation.

A new "arm32_dma_range" structure now describes a DMA window, with
a system address base, bus address base, and length. In addition to
providing info about which memory regions are legal for DMA, the new
structure provides address translation support, as well.

As before, if a tag does not list any ranges, then all addresses are
considered valid, and no DMA address translation is performed.

This allows us to remove a large chunk of code which was duplicated and
tweaked slightly (to do the address translation) from the stock ARM
bus_dma in the XScale IOP and ARM Integrator ports.

Test compiled on all ARM platforms, test booted on Intel IQ80321 and Shark.
 1.2 28-Jul-2002  thorpej Change the way that DMA map syncs are done. Instead of remembering
the virtual address for each DMA segment, just cache a pointer to the
original buffer/buftype used to load the DMA map, and use that. This
lets us shrink the bus_dma_segment_t down from 12 bytes to 8, and the
cache flushing is also more efficient.

Tested on an i80321 -- changes to others are mechanical.
 1.1 25-Jul-2002  thorpej Add support for DMA to/from the on-chip devices of the i80321 (no
PCI window translation).

XXX This would be better done by overhauling the shared ARM bus_dma code.
 1.3.2.3 13-Aug-2002  nathanw Catch up to -current.
 1.3.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.3.2.1 31-Jul-2002  nathanw file i80321_local_dma.c was added on branch nathanw_sa on 2002-08-01 02:41:21 +0000
 1.4.4.2 07-Dec-2002  he Pull up revision 1.2 (requested by thorpej in ticket #568):
Change the way DMA map syncs are done. Instead of remembering
the virtual address for each DMA segment, just cache a
pointer to the original buffer/buftype used to load the
DMA map, and use that. Shrinks bus_dma_segment_t from 12
to 8 bytes, and the cache flushing is also more efficient.
 1.4.4.1 07-Dec-2002  he Pull up revision 1.1 (new, requested by thorpej in ticket #568):
Add support for DMA to/from the on-chip devices of the
i80321.
 1.4 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 15-Jul-2003  lukem __KERNEL_RCSID()
 1.1 27-Mar-2002  thorpej branches: 1.1.2; 1.1.8; 1.1.16;
Basic support for the Intel i80321 I/O Processor (Xscale core).

Note: This is a snapshot of work-in-progress; there are still some
bugs to be shaken out.
 1.1.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.16.1 03-Aug-2004  skrll Sync with HEAD
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 27-Mar-2002  jdolecek file i80321_mcu.c was added on branch kqueue on 2002-06-23 17:34:58 +0000
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 27-Mar-2002  nathanw file i80321_mcu.c was added on branch nathanw_sa on 2002-04-01 07:39:16 +0000
 1.19 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.18 07-Jul-2020  thorpej 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.17 14-Jun-2020  chs replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.16 02-Oct-2015  msaitoh 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.15 18-Aug-2013  matt branches: 1.15.6;
<arm/locore.h> fallout (fixes some include ordering errors)
 1.14 14-Oct-2012  msaitoh branches: 1.14.2;
struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.13 07-Sep-2012  matt branches: 1.13.2;
Fix more pci_conf_interrupt/pci_conf_hook problems
 1.12 12-Feb-2012  matt Change old-stlye-defintions to C89 prototypes.
Switch to CFATTACH_DECL_NEW/device_t/cfdata_t
Defer attaching interrupt evcnts.

Approved by releng.
 1.11 27-Jan-2012  para converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.10 01-Jul-2011  dyoung branches: 1.10.2; 1.10.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 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 12-May-2007  gavan branches: 1.8.10; 1.8.12;
Implement ATU Direct Window in order to increase available PCI address
space.
 1.7 15-Dec-2005  briggs branches: 1.7.26; 1.7.30; 1.7.32; 1.7.38;
Add an offset to the I/O port translations. This allows IQ80321
and others to avoid providing PCI I/O space at address 0.
Iyonix, however, needs to provide PCI I/O space at 0.
The others require I/O space to be offset in part due to a bug
work-around in wm(4) which requires that I/O space access be used
to reset the controllers. If I/O space is mapped at zero, the card
claims, but ignores, the transactions, and the controller doesn't
get reset properly and can't then be used.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 09-Dec-2004  briggs branches: 1.5.10;
Start I/O range at base+0x1000 to avoid 0.
 1.4 15-Jul-2003  lukem branches: 1.4.6;
__KERNEL_RCSID()
 1.3 30-Jun-2003  thorpej branches: 1.3.2;
PCI-X requires that that devices updated their PCIXSR on every
config write with the device number specified in AD[15:11]. If
we don't set this field when issuing a Type 0 cycle, each device
could end of thinking it is at device 0, which can cause a number
of problems. Doing this unconditionally should be OK when only
PCI devices are present.
 1.2 29-Apr-2003  thorpej Use aprint*().
 1.1 27-Mar-2002  thorpej branches: 1.1.2; 1.1.8;
Basic support for the Intel i80321 I/O Processor (Xscale core).

Note: This is a snapshot of work-in-progress; there are still some
bugs to be shaken out.
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 27-Mar-2002  jdolecek file i80321_pci.c was added on branch kqueue on 2002-06-23 17:34:58 +0000
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 27-Mar-2002  nathanw file i80321_pci.c was added on branch nathanw_sa on 2002-04-01 07:39:16 +0000
 1.3.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.6.1 16-Apr-2005  tron Pull up revision 1.5 (requested by briggs in ticket #1092):
Start I/O range at base+0x1000 to avoid 0.
 1.5.10.2 03-Sep-2007  yamt sync with head.
 1.5.10.1 21-Jun-2006  yamt sync with head.
 1.7.38.1 22-May-2007  matt Update to HEAD.
 1.7.32.1 11-Jul-2007  mjf Sync with head.
 1.7.30.1 27-May-2007  ad Sync with head.
 1.7.26.1 17-May-2007  yamt sync with head.
 1.8.12.1 06-Nov-2007  matt sync with HEAD
 1.8.10.1 01-Jan-2008  chris Sync with HEAD.
 1.10.6.1 18-Feb-2012  mrg merge to -current.
 1.10.2.3 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.10.2.2 30-Oct-2012  yamt sync with head
 1.10.2.1 17-Apr-2012  yamt sync with head
 1.13.2.3 03-Dec-2017  jdolecek update from HEAD
 1.13.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.14.2.1 28-Aug-2013  rmind sync with head
 1.15.6.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.6 01-Aug-2002  thorpej Move the DMA tag initialization functions into i80321.c.
 1.5 31-Jul-2002  thorpej Overhaul how DMA ranges work in the ARM bus_dma implementation.

A new "arm32_dma_range" structure now describes a DMA window, with
a system address base, bus address base, and length. In addition to
providing info about which memory regions are legal for DMA, the new
structure provides address translation support, as well.

As before, if a tag does not list any ranges, then all addresses are
considered valid, and no DMA address translation is performed.

This allows us to remove a large chunk of code which was duplicated and
tweaked slightly (to do the address translation) from the stock ARM
bus_dma in the XScale IOP and ARM Integrator ports.

Test compiled on all ARM platforms, test booted on Intel IQ80321 and Shark.
 1.4 28-Jul-2002  thorpej Change the way that DMA map syncs are done. Instead of remembering
the virtual address for each DMA segment, just cache a pointer to the
original buffer/buftype used to load the DMA map, and use that. This
lets us shrink the bus_dma_segment_t down from 12 bytes to 8, and the
cache flushing is also more efficient.

Tested on an i80321 -- changes to others are mechanical.
 1.3 02-May-2002  thorpej branches: 1.3.2; 1.3.4; 1.3.6;
Fix error reporting in the bus_dmamap_load_mbuf() routines.
 1.2 27-Mar-2002  thorpej branches: 1.2.2;
iwin_base_lo is a BAR value; make sure to mask off the non-address
bits when using it.
 1.1 27-Mar-2002  thorpej Basic support for the Intel i80321 I/O Processor (Xscale core).

Note: This is a snapshot of work-in-progress; there are still some
bugs to be shaken out.
 1.2.2.5 13-Aug-2002  nathanw Catch up to -current.
 1.2.2.4 01-Aug-2002  nathanw Catch up to -current.
 1.2.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.2.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.1 27-Mar-2002  nathanw file i80321_pci_dma.c was added on branch nathanw_sa on 2002-04-01 07:39:16 +0000
 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 02-May-2002  jdolecek file i80321_pci_dma.c was added on branch kqueue on 2002-06-23 17:34:58 +0000
 1.3.4.1 07-Dec-2002  he Pull up revision 1.4 (requested by thorpej in ticket #568):
Change the way DMA map syncs are done. Instead of remembering
the virtual address for each DMA segment, just cache a
pointer to the original buffer/buftype used to load the
DMA map, and use that. Shrinks bus_dma_segment_t from 12
to 8 bytes, and the cache flushing is also more efficient.
 1.3.2.1 30-Aug-2002  gehenna catch up with -current.
 1.18 21-Nov-2018  macallan further de-cargocult the new mmap() methods
 1.17 21-Nov-2018  thorpej EINVAL (22) is a valid return value for ARM mmap routines; we need to
return -1 for invalid mmap attempts.
 1.16 18-Nov-2018  macallan - support *_mmap()
- support BUS_SPACE_MAP_PREFETCHABLE for memory spaces
- fill in *_stream methods if needed
With this Xorg with wsfb works on iyonix. The nv driver still crashes ( and
needs options INSECURE ), something seems to be wrong with accessing IO space.
But, progress.
 1.15 16-Mar-2018  ryo branches: 1.15.2;
use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
 1.14 02-Mar-2014  joerg branches: 1.14.28;
Skip a tautologic check if we know it is one.
 1.13 01-Jul-2011  dyoung branches: 1.13.2; 1.13.12; 1.13.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.12 24-Feb-2010  skrll Typo in comment.
 1.11 17-Oct-2007  garbled branches: 1.11.20; 1.11.40;
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.10 12-May-2007  gavan branches: 1.10.10; 1.10.12;
Implement ATU Direct Window in order to increase available PCI address
space.
 1.9 24-Nov-2005  yamt branches: 1.9.26; 1.9.30; 1.9.32; 1.9.38;
bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
 1.8 01-Apr-2005  yamt branches: 1.8.2; 1.8.8;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.7 17-May-2004  thorpej branches: 1.7.4; 1.7.6;
Supply rr_1 and wr_1.
 1.6 06-Oct-2003  thorpej Make sure to pass mod/ref seeds with PMAP_WIRED.
 1.5 15-Jul-2003  lukem __KERNEL_RCSID()
 1.4 27-Sep-2002  provos branches: 1.4.8;
remove trailing \n in panic(). approved perry.
 1.3 29-Aug-2002  briggs Use generic_bs_sr_4 for bus_space_set_region_4.
 1.2 12-Apr-2002  thorpej branches: 1.2.2; 1.2.4; 1.2.6;
Use the bus_space_generic bus space ops.
 1.1 27-Mar-2002  thorpej branches: 1.1.2;
Basic support for the Intel i80321 I/O Processor (Xscale core).

Note: This is a snapshot of work-in-progress; there are still some
bugs to be shaken out.
 1.1.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.4 29-Aug-2002  briggs Sync with head.
 1.1.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 27-Mar-2002  nathanw file i80321_space.c was added on branch nathanw_sa on 2002-04-01 07:39:16 +0000
 1.2.6.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.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 12-Apr-2002  jdolecek file i80321_space.c was added on branch kqueue on 2002-06-23 17:34:58 +0000
 1.2.4.1 07-Dec-2002  he Pull up revision 1.3 (requested by briggs in ticket #749):
Use generic_bs_sr_4 for bus_space_set_region_4.
 1.2.2.1 31-Aug-2002  gehenna catch up with -current.
 1.4.8.5 11-Dec-2005  christos Sync with head.
 1.4.8.4 01-Apr-2005  skrll Sync with HEAD.
 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.7.6.1 28-Jan-2005  yamt convert arch/arm to new apis.
 1.7.4.1 29-Apr-2005  kent sync with -current
 1.8.8.1 29-Nov-2005  yamt sync with head.
 1.8.2.2 03-Sep-2007  yamt sync with head.
 1.8.2.1 21-Jun-2006  yamt sync with head.
 1.9.38.1 22-May-2007  matt Update to HEAD.
 1.9.32.1 11-Jul-2007  mjf Sync with head.
 1.9.30.1 27-May-2007  ad Sync with head.
 1.9.26.1 17-May-2007  yamt sync with head.
 1.10.12.1 06-Nov-2007  matt sync with HEAD
 1.10.10.1 01-Jan-2008  chris Sync with HEAD.
 1.11.40.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.11.20.1 11-Mar-2010  yamt sync with head
 1.13.16.1 18-May-2014  rmind sync with head
 1.13.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.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.14.28.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.14.28.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.15.2.1 10-Jun-2019  christos Sync with HEAD
 1.2 12-Apr-2002  thorpej Use the bus_space_generic bus space ops.
 1.1 27-Mar-2002  thorpej branches: 1.1.2;
Basic support for the Intel i80321 I/O Processor (Xscale core).

Note: This is a snapshot of work-in-progress; there are still some
bugs to be shaken out.
 1.1.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 27-Mar-2002  nathanw file i80321_space_asm.S was added on branch nathanw_sa on 2002-04-01 07:39:16 +0000
 1.22 12-Jul-2018  maxv Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.
 1.21 17-Dec-2013  joerg branches: 1.21.28; 1.21.30;
Mark tmr0_read and tmr1_read as unused.
 1.20 01-Jul-2011  dyoung branches: 1.20.2; 1.20.12; 1.20.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.19 27-Apr-2008  matt Merge kernel changes in matt-armv6 to HEAD.
 1.18 20-Jan-2008  joerg branches: 1.18.6; 1.18.8; 1.18.10;
Convert evbarm to timecounter. Only one of the systems was tested, the
rest of the patch is compile-time tested only.
 1.17 03-Dec-2007  ad branches: 1.17.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.16 06-Jan-2007  christos branches: 1.16.6; 1.16.20; 1.16.22; 1.16.24; 1.16.26; 1.16.32;
Add generic TOD support. From Bucky Katz.
 1.15 10-Sep-2006  gavan branches: 1.15.4;
i80321 timecounter support.

Patch from Garrett D'Amore, tested by me.
 1.14 10-Sep-2006  gdamore Do not supply our own versions of inittodr, etc. if a port declares
__HAVE_GENERIC_TODR.
 1.13 24-Dec-2005  perry branches: 1.13.8; 1.13.20;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.12 11-Dec-2005  christos merge ktrace-lwp.
 1.11 04-Jun-2005  he branches: 1.11.2;
Rename an (unused) argument to avoid shadowing.
 1.10 04-Jun-2005  he Fix the various todr_gettime() and todr_settime() fallouts from
-Wcast-qual differently, by instead changing the signatore of those
"functions" to take a "volatile struct timeval*" instead of a
"struct timeval*". Many places, these functions are called with
&time, and time is declared as volatile in <sys/kernel.h>. This
way we can get rid of all the ugly casts which now also triggered
warnings, and caused more code to be added to work around the
problem.

Reviewed by thorpej.
 1.9 26-Feb-2005  simonb Watch out for those unexpected tains.
 1.8 12-Feb-2005  rearnsha Permit the counter frequency to be overridden by a board configuration
 1.7 27-Jul-2003  thorpej branches: 1.7.8; 1.7.10;
Fix think'o in last. Pointed out by Izumi Tsutsui.
 1.6 26-Jul-2003  thorpej Flesh out inittodr() and resettodr().
 1.5 15-Jul-2003  lukem __KERNEL_RCSID()
 1.4 29-Apr-2003  thorpej branches: 1.4.2;
Use aprint*().
 1.3 08-Oct-2002  thorpej Move XScale common prototypes to xscalevar.h. Add xscale_pmc_dispatch()
prototype. Include xscalevar.h has necessary to being prototypes into
scope.
 1.2 07-Aug-2002  briggs Implement pmc(9) -- An interface to hardware performance monitoring
counters. These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.1 27-Mar-2002  thorpej branches: 1.1.2; 1.1.4; 1.1.8;
Basic support for the Intel i80321 I/O Processor (Xscale core).

Note: This is a snapshot of work-in-progress; there are still some
bugs to be shaken out.
 1.1.8.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 27-Mar-2002  jdolecek file i80321_timer.c was added on branch kqueue on 2002-06-23 17:34:58 +0000
 1.1.4.1 30-Aug-2002  gehenna catch up with -current.
 1.1.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.3 13-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 27-Mar-2002  nathanw file i80321_timer.c was added on branch nathanw_sa on 2002-04-01 07:39:16 +0000
 1.4.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.2.4 15-Feb-2005  skrll Sync with HEAD.
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.10.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.10.1 12-Feb-2005  yamt sync with head.
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.11.2.5 21-Jan-2008  yamt sync with head
 1.11.2.4 07-Dec-2007  yamt sync with head
 1.11.2.3 26-Feb-2007  yamt sync with head.
 1.11.2.2 30-Dec-2006  yamt sync with head.
 1.11.2.1 21-Jun-2006  yamt sync with head.
 1.13.20.2 12-Jan-2007  ad Sync with head.
 1.13.20.1 18-Nov-2006  ad Sync with head.
 1.13.8.1 14-Sep-2006  yamt sync with head.
 1.15.4.1 30-Apr-2007  bouyer Pull up following revision(s) (requested by rearnsha in ticket #592):
sys/arch/arm/footbridge/footbridgevar.h: revision 1.5
sys/arch/arm/ep93xx/epclk.c: revision 1.10
sys/arch/arm/ixp12x0/ixp12x0_clk.c: revision 1.11
sys/arch/arm/footbridge/footbridge.c: revision 1.17
sys/arch/arm/footbridge/isa/dsrtc.c: revision 1.10
sys/arch/arm/s3c2xx0/s3c2800_clk.c: revision 1.10
sys/arch/arm/xscale/ixp425_timer.c: revision 1.13
sys/arch/arm/xscale/becc_timer.c: revision 1.11
sys/arch/arm/xscale/i80321_timer.c: revision 1.16
sys/arch/arm/s3c2xx0/s3c24x0_clk.c: revision 1.7
Add generic TOD support. From Bucky Katz.
 1.16.32.2 18-Feb-2008  mjf Sync with HEAD.
 1.16.32.1 08-Dec-2007  mjf Sync with HEAD.
 1.16.26.2 23-Mar-2008  matt sync with HEAD
 1.16.26.1 09-Jan-2008  matt sync with HEAD
 1.16.24.2 27-Jan-2008  chris Sync to HEAD.
 1.16.24.1 01-Jan-2008  chris Sync with HEAD.
 1.16.22.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.16.20.2 28-Feb-2008  rjs Sync with HEAD.
 1.16.20.1 26-Dec-2007  rjs Sync with HEAD.
 1.16.6.1 03-Dec-2007  ad Sync with HEAD.
 1.17.6.1 20-Jan-2008  bouyer Sync with HEAD
 1.18.10.1 16-May-2008  yamt sync with head.
 1.18.8.1 18-May-2008  yamt sync with head.
 1.18.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.20.16.1 18-May-2014  rmind sync with head
 1.20.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.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.21.30.1 10-Jun-2019  christos Sync with HEAD
 1.21.28.1 28-Jul-2018  pgoyette Sync with HEAD
 1.10 12-Feb-2012  matt Change old-stlye-defintions to C89 prototypes.
Switch to CFATTACH_DECL_NEW/device_t/cfdata_t
Defer attaching interrupt evcnts.

Approved by releng.
 1.9 01-Jul-2011  dyoung branches: 1.9.2; 1.9.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.8 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 15-Jul-2003  lukem branches: 1.6.16;
__KERNEL_RCSID()
 1.5 29-Apr-2003  thorpej branches: 1.5.2;
Use aprint*().
 1.4 02-Oct-2002  thorpej branches: 1.4.4;
Use CFATTACH_DECL().
 1.3 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.2 27-Sep-2002  thorpej 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.1 29-Jul-2002  thorpej branches: 1.1.2; 1.1.4; 1.1.6;
Add support for the i80321 watchdog timer.
 1.1.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.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 29-Jul-2002  jdolecek file i80321_wdog.c was added on branch kqueue on 2002-09-06 08:33:11 +0000
 1.1.4.2 30-Aug-2002  gehenna catch up with -current.
 1.1.4.1 29-Jul-2002  gehenna file i80321_wdog.c was added on branch gehenna-devsw on 2002-08-30 00:19:19 +0000
 1.1.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.1 29-Jul-2002  nathanw file i80321_wdog.c was added on branch nathanw_sa on 2002-08-01 02:41:21 +0000
 1.4.4.2 11-Nov-2002  he Pull up revision 1.1 (new, requested by thorpej in ticket #575):
Add support for the i80321 watchdog timer.
 1.4.4.1 02-Oct-2002  he file i80321_wdog.c was added on branch netbsd-1-6 on 2002-11-11 23:03:47 +0000
 1.5.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.9.6.1 18-Feb-2012  mrg merge to -current.
 1.9.2.1 17-Apr-2012  yamt sync with head
 1.17 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.16 12-May-2007  gavan branches: 1.16.10; 1.16.12;
Implement ATU Direct Window in order to increase available PCI address
space.
 1.15 11-Dec-2005  christos branches: 1.15.26; 1.15.30; 1.15.32; 1.15.38;
merge ktrace-lwp.
 1.14 19-Dec-2003  gavan branches: 1.14.16;
Correct masks for PCIXSR decomposition
 1.13 16-Dec-2003  gavan The PIRSR is at location 0xffffe1ec, not 0xffffe2ec.

Source: Intel(R) 80321 I/O Processor Developer's Manual, page 578
 1.12 06-Oct-2003  thorpej Add support for the i80312 and i80321 I2C controllers.
 1.11 28-Jul-2003  thorpej Add PBIU register bits.
 1.10 06-Feb-2003  briggs branches: 1.10.2;
Add some more register definitions.
 1.9 06-Feb-2003  thorpej Remove the DMA controller register defns from this file (much like
the AAU registers are not in this file) -- iopdma is not specific to
i80321.
 1.8 06-Feb-2003  briggs Actually make a bitmask for ICU_INT_HWMASK.
 1.7 01-Jan-2003  thorpej Define a base for each DMA channel.
 1.6 03-Oct-2002  thorpej Add a symbolic constant for where external interrupts start.
 1.5 02-Aug-2002  thorpej Delete all the AAU register definitions; they are moved to a separate
file in a future commit.
 1.4 29-Jul-2002  thorpej * Remove some AAU definitions -- they will be defined elsewhere in
a future commit.
* Fix a typo in the watchdog enable names.
* Add SSP (synchronous serial port, for SPI, Microwire, etc.) definitions.
 1.3 16-Apr-2002  thorpej branches: 1.3.2; 1.3.4; 1.3.6;
Add Application Accelerator Unit registers.
 1.2 16-Apr-2002  thorpej Add i80321 DMA controller registers.
 1.1 27-Mar-2002  thorpej branches: 1.1.2;
Basic support for the Intel i80321 I/O Processor (Xscale core).

Note: This is a snapshot of work-in-progress; there are still some
bugs to be shaken out.
 1.1.2.8 03-Jan-2003  thorpej Sync with HEAD.
 1.1.2.7 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.6 13-Aug-2002  nathanw Catch up to -current.
 1.1.2.5 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.1.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 27-Mar-2002  nathanw file i80321reg.h was added on branch nathanw_sa on 2002-04-01 07:39:17 +0000
 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 16-Apr-2002  jdolecek file i80321reg.h was added on branch kqueue on 2002-06-23 17:34:58 +0000
 1.3.4.1 11-Nov-2002  he Pull up revision 1.4 (requested by thorpej in ticket #570):
Several changes:
o Remove some AAU definitions, will be defined elsewhere
in a future commit.
o Fix a typo in the watchdog enable names.
o Add SSP (synchronous serial port, for SPI, Microwire, etc.)
definitions.
 1.3.2.1 30-Aug-2002  gehenna catch up with -current.
 1.10.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.2.1 03-Aug-2004  skrll Sync with HEAD
 1.14.16.1 03-Sep-2007  yamt sync with head.
 1.15.38.1 22-May-2007  matt Update to HEAD.
 1.15.32.1 11-Jul-2007  mjf Sync with head.
 1.15.30.1 27-May-2007  ad Sync with head.
 1.15.26.1 17-May-2007  yamt sync with head.
 1.16.12.1 06-Nov-2007  matt sync with HEAD
 1.16.10.1 01-Jan-2008  chris Sync with HEAD.
 1.14 06-Aug-2021  rin Simplify i80321_intr_calculate_masks().

G/C unused members of struct intrq.

No functional changes intended.
 1.13 12-Feb-2012  matt Change old-stlye-defintions to C89 prototypes.
Switch to CFATTACH_DECL_NEW/device_t/cfdata_t
Defer attaching interrupt evcnts.

Approved by releng.
 1.12 27-Apr-2008  matt branches: 1.12.34; 1.12.38;
Merge kernel changes in matt-armv6 to HEAD.
 1.11 10-Apr-2006  simonb branches: 1.11.40; 1.11.64; 1.11.66; 1.11.68;
Tab Police.
 1.10 15-Dec-2005  briggs branches: 1.10.4; 1.10.6; 1.10.8; 1.10.10; 1.10.12;
Add an offset to the I/O port translations. This allows IQ80321
and others to avoid providing PCI I/O space at address 0.
Iyonix, however, needs to provide PCI I/O space at 0.
The others require I/O space to be offset in part due to a bug
work-around in wm(4) which requires that I/O space access be used
to reset the controllers. If I/O space is mapped at zero, the card
claims, but ignores, the transactions, and the controller doesn't
get reset properly and can't then be used.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 06-Oct-2003  thorpej branches: 1.8.16;
Add support for the i80312 and i80321 I2C controllers.
 1.7 06-Feb-2003  briggs branches: 1.7.2;
Define the iopmu (even though it's not being used yet).
Export i80321_local_dma_init().
Make !sc->sc_is_host configuration a little more friendly.
Go back to using IABAR2 instead of IABAR3 for inbound SDRAM access.
 1.6 01-Aug-2002  thorpej Move the DMA tag initialization functions into i80321.c.
 1.5 31-Jul-2002  thorpej Overhaul how DMA ranges work in the ARM bus_dma implementation.

A new "arm32_dma_range" structure now describes a DMA window, with
a system address base, bus address base, and length. In addition to
providing info about which memory regions are legal for DMA, the new
structure provides address translation support, as well.

As before, if a tag does not list any ranges, then all addresses are
considered valid, and no DMA address translation is performed.

This allows us to remove a large chunk of code which was duplicated and
tweaked slightly (to do the address translation) from the stock ARM
bus_dma in the XScale IOP and ARM Integrator ports.

Test compiled on all ARM platforms, test booted on Intel IQ80321 and Shark.
 1.4 30-Jul-2002  thorpej Use more descriptive interrupt names.
 1.3 29-Jul-2002  thorpej Add support for attaching IOP built-in sub-devices (aau, dma, ssp,
watchdog, etc.)
 1.2 25-Jul-2002  thorpej Add support for DMA to/from the on-chip devices of the i80321 (no
PCI window translation).

XXX This would be better done by overhauling the shared ARM bus_dma code.
 1.1 27-Mar-2002  thorpej branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Basic support for the Intel i80321 I/O Processor (Xscale core).

Note: This is a snapshot of work-in-progress; there are still some
bugs to be shaken out.
 1.1.8.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 27-Mar-2002  jdolecek file i80321var.h was added on branch kqueue on 2002-06-23 17:34:58 +0000
 1.1.6.3 07-Dec-2002  he Pull up revision 1.2 (requested by thorpej in ticket #568):
Add support for DMA to/from the on-chip devices of the
i80321.
 1.1.6.2 11-Nov-2002  he Pull up revision 1.4 (requested by thorpej in ticket #583):
Use more descriptive interrupt names.
 1.1.6.1 11-Nov-2002  he Pull up revision 1.3 (requested by thorpej in ticket #571):
Add support for attaching IOP built-in sub-devices (aau,
dma, ssp, watchdog, etc.)
 1.1.4.1 30-Aug-2002  gehenna catch up with -current.
 1.1.2.4 13-Aug-2002  nathanw Catch up to -current.
 1.1.2.3 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 27-Mar-2002  nathanw file i80321var.h was added on branch nathanw_sa on 2002-04-01 07:39:17 +0000
 1.7.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.1 21-Jun-2006  yamt sync with head.
 1.10.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.10.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.10.8.1 11-Apr-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.11.68.1 16-May-2008  yamt sync with head.
 1.11.66.1 18-May-2008  yamt sync with head.
 1.11.64.1 02-Jun-2008  mjf Sync with HEAD.
 1.11.40.1 28-Jan-2008  matt Given the that there are only 4 IPLs (ignoring soft IPLs), a number of
cleanups can be done:
Remove _SPL_* aliases.
Don't store irqmasks in ci_cpl, just make it an ipl level.
Add fast softint switching support.
 1.12.38.1 18-Feb-2012  mrg merge to -current.
 1.12.34.1 17-Apr-2012  yamt sync with head
 1.18 17-Mar-2019  maxv Hard-align the fields of the structures with __aligned(32), and pass ioff=0
in the pool cache.
 1.17 12-Feb-2012  matt branches: 1.17.48;
Change old-stlye-defintions to C89 prototypes.
Switch to CFATTACH_DECL_NEW/device_t/cfdata_t
Defer attaching interrupt evcnts.

Approved by releng.
 1.16 05-Jan-2008  ad branches: 1.16.44; 1.16.48;
Fix includes.
 1.15 13-Nov-2007  ad branches: 1.15.6;
Make it build again.
 1.14 07-Nov-2007  ad Merge from vmlocking:

- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.
 1.13 12-Mar-2007  ad branches: 1.13.14; 1.13.16; 1.13.18; 1.13.20; 1.13.24; 1.13.26;
Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
 1.12 11-Dec-2005  christos branches: 1.12.26; 1.12.30;
merge ktrace-lwp.
 1.11 30-Oct-2003  matt branches: 1.11.16;
Stop some (bogus) gcc unitialized variable warning.
 1.10 29-Apr-2003  thorpej branches: 1.10.2;
Use aprint*().
 1.9 04-Mar-2003  thorpej Cast the argument passed to vtophys() to a vaddr_t.
 1.8 10-Dec-2002  thorpej Error out if we get an unexpected buffer type.
 1.7 04-Aug-2002  thorpej branches: 1.7.2; 1.7.4; 1.7.6;
Add support for "xor5", "xor6", "xor7", and "xor8".
 1.6 03-Aug-2002  thorpej * Define the 8-input, 16-input, and 32-input descriptors.
* Adjust descriptor sync'ing to work with the additional descriptor
formats.
 1.5 03-Aug-2002  thorpej Restructure the iopaau_function slightly to provide greater
flexibility when using different descriptor formats.
 1.4 02-Aug-2002  thorpej Add support for xor2, xor3, and xor4. Fix inverted direction
indications in some bus_dma operations.
 1.3 02-Aug-2002  thorpej Let the "zero" and "fill8" functions share a bunch of code.
 1.2 02-Aug-2002  thorpej Grr, RCS ID tag typo.
 1.1 02-Aug-2002  thorpej Add support for the Intel i80321 I/O Processor's Application Accelerator
Unit. The AAU provides block fill, block copy, XOR, and XOR-parity-check
operations. We currently provide dmover(9) functions for "zero", "fill8",
and "copy".

Much of this code can be shared with the i80312 Companion I/O AAU, and
will be when support for the older chip is implemented.
 1.7.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.7.6.1 04-Aug-2002  jdolecek file iopaau.c was added on branch kqueue on 2002-09-06 08:33:13 +0000
 1.7.4.2 30-Aug-2002  gehenna catch up with -current.
 1.7.4.1 04-Aug-2002  gehenna file iopaau.c was added on branch gehenna-devsw on 2002-08-30 00:19:20 +0000
 1.7.2.3 11-Dec-2002  thorpej Sync with HEAD.
 1.7.2.2 13-Aug-2002  nathanw Catch up to -current.
 1.7.2.1 04-Aug-2002  nathanw file iopaau.c was added on branch nathanw_sa on 2002-08-13 02:17:59 +0000
 1.10.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.2.1 03-Aug-2004  skrll Sync with HEAD
 1.11.16.3 21-Jan-2008  yamt sync with head
 1.11.16.2 15-Nov-2007  yamt sync with head.
 1.11.16.1 03-Sep-2007  yamt sync with head.
 1.12.30.2 03-Dec-2007  ad Sync with HEAD.
 1.12.30.1 13-Mar-2007  ad Sync with head.
 1.12.26.1 24-Mar-2007  yamt sync with head.
 1.13.26.2 18-Feb-2008  mjf Sync with HEAD.
 1.13.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.13.24.2 18-Nov-2007  bouyer Sync with HEAD
 1.13.24.1 13-Nov-2007  bouyer Sync with HEAD
 1.13.20.3 09-Jan-2008  matt sync with HEAD
 1.13.20.2 09-Nov-2007  matt Make all the evbarm kernels build again. Fix lossage from rebase.
 1.13.20.1 08-Nov-2007  matt sync with -HEAD
 1.13.18.2 20-Jan-2008  chris Sync to HEAD.
 1.13.18.1 01-Jan-2008  chris Sync with HEAD.
 1.13.16.2 14-Nov-2007  joerg Sync with HEAD.
 1.13.16.1 11-Nov-2007  joerg Sync with HEAD.
 1.13.14.2 28-Feb-2008  rjs Sync with HEAD.
 1.13.14.1 26-Dec-2007  rjs Sync with HEAD.
 1.15.6.1 08-Jan-2008  bouyer Sync with HEAD
 1.16.48.1 18-Feb-2012  mrg merge to -current.
 1.16.44.1 17-Apr-2012  yamt sync with head
 1.17.48.1 10-Jun-2019  christos Sync with HEAD
 1.4 17-Mar-2019  maxv Hard-align the fields of the structures with __aligned(32), and pass ioff=0
in the pool cache.
 1.3 03-Aug-2002  thorpej branches: 1.3.2; 1.3.4; 1.3.6; 1.3.208;
* Define the 8-input, 16-input, and 32-input descriptors.
* Adjust descriptor sync'ing to work with the additional descriptor
formats.
 1.2 02-Aug-2002  thorpej Add support for xor2, xor3, and xor4. Fix inverted direction
indications in some bus_dma operations.
 1.1 02-Aug-2002  thorpej Add support for the Intel i80321 I/O Processor's Application Accelerator
Unit. The AAU provides block fill, block copy, XOR, and XOR-parity-check
operations. We currently provide dmover(9) functions for "zero", "fill8",
and "copy".

Much of this code can be shared with the i80312 Companion I/O AAU, and
will be when support for the older chip is implemented.
 1.3.208.1 10-Jun-2019  christos Sync with HEAD
 1.3.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.6.1 03-Aug-2002  jdolecek file iopaaureg.h was added on branch kqueue on 2002-09-06 08:33:13 +0000
 1.3.4.2 30-Aug-2002  gehenna catch up with -current.
 1.3.4.1 03-Aug-2002  gehenna file iopaaureg.h was added on branch gehenna-devsw on 2002-08-30 00:19:21 +0000
 1.3.2.2 13-Aug-2002  nathanw Catch up to -current.
 1.3.2.1 03-Aug-2002  nathanw file iopaaureg.h was added on branch nathanw_sa on 2002-08-13 02:18:00 +0000
 1.8 12-Feb-2012  matt Change old-stlye-defintions to C89 prototypes.
Switch to CFATTACH_DECL_NEW/device_t/cfdata_t
Defer attaching interrupt evcnts.

Approved by releng.
 1.7 27-Apr-2008  matt branches: 1.7.34; 1.7.38;
Merge kernel changes in matt-armv6 to HEAD.
 1.6 17-Nov-2007  ad branches: 1.6.14; 1.6.16; 1.6.18;
Make it compile.
 1.5 13-Nov-2007  ad Make it build again.
 1.4 04-Aug-2002  thorpej branches: 1.4.2; 1.4.4; 1.4.6; 1.4.30; 1.4.72; 1.4.88; 1.4.90; 1.4.92; 1.4.94; 1.4.98; 1.4.100;
Add support for "xor5", "xor6", "xor7", and "xor8".
 1.3 03-Aug-2002  thorpej Restructure the iopaau_function slightly to provide greater
flexibility when using different descriptor formats.
 1.2 02-Aug-2002  thorpej Add support for xor2, xor3, and xor4. Fix inverted direction
indications in some bus_dma operations.
 1.1 02-Aug-2002  thorpej Add support for the Intel i80321 I/O Processor's Application Accelerator
Unit. The AAU provides block fill, block copy, XOR, and XOR-parity-check
operations. We currently provide dmover(9) functions for "zero", "fill8",
and "copy".

Much of this code can be shared with the i80312 Companion I/O AAU, and
will be when support for the older chip is implemented.
 1.4.100.1 19-Nov-2007  mjf Sync with HEAD.
 1.4.98.1 18-Nov-2007  bouyer Sync with HEAD
 1.4.94.1 09-Nov-2007  matt Make all the evbarm kernels build again. Fix lossage from rebase.
 1.4.92.1 01-Jan-2008  chris Sync with HEAD.
 1.4.90.2 21-Nov-2007  joerg Sync with HEAD.
 1.4.90.1 14-Nov-2007  joerg Sync with HEAD.
 1.4.88.1 26-Dec-2007  rjs Sync with HEAD.
 1.4.72.1 03-Dec-2007  ad Sync with HEAD.
 1.4.30.2 07-Dec-2007  yamt sync with head
 1.4.30.1 15-Nov-2007  yamt sync with head.
 1.4.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.4.6.1 04-Aug-2002  jdolecek file iopaauvar.h was added on branch kqueue on 2002-09-06 08:33:14 +0000
 1.4.4.2 30-Aug-2002  gehenna catch up with -current.
 1.4.4.1 04-Aug-2002  gehenna file iopaauvar.h was added on branch gehenna-devsw on 2002-08-30 00:19:21 +0000
 1.4.2.2 13-Aug-2002  nathanw Catch up to -current.
 1.4.2.1 04-Aug-2002  nathanw file iopaauvar.h was added on branch nathanw_sa on 2002-08-13 02:18:00 +0000
 1.6.18.1 16-May-2008  yamt sync with head.
 1.6.16.1 18-May-2008  yamt sync with head.
 1.6.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.38.1 18-Feb-2012  mrg merge to -current.
 1.7.34.1 17-Apr-2012  yamt sync with head
 1.12 15-Sep-2025  thorpej Encapsulate what's needed to attach an I2C bus into a iicbus_attach()
inline.
 1.11 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.10 24-Apr-2021  thorpej branches: 1.10.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.9 22-Dec-2019  thorpej branches: 1.9.10;
Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus(). "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().
 1.8 14-Feb-2016  chs branches: 1.8.18;
zero the i2c_attach_args structure before filling it in.
fixes occasional crashes in iic_attach().
 1.7 10-Jan-2012  jakllsch branches: 1.7.6; 1.7.24;
split iopi2c(4) device/softc
 1.6 01-Jul-2011  dyoung branches: 1.6.2; 1.6.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.5 06-Dec-2007  ad lockmgr -> mutex
 1.4 26-Jun-2006  drochner branches: 1.4.18; 1.4.30; 1.4.32; 1.4.34; 1.4.36; 1.4.42; 1.4.46;
use the "i2cbus" interface attribute rather than putting a string name
into the i2cbus attach args
 1.3 11-Dec-2005  christos branches: 1.3.4; 1.3.8; 1.3.16;
merge ktrace-lwp.
 1.2 06-Jan-2005  scw branches: 1.2.10;
In iopiic_wait(), latched status bits in the ISR is cleared by writing
ones to the appropriate bits, not zeroes. In this case, just write the
value from a previous read of the register.
 1.1 06-Oct-2003  thorpej branches: 1.1.4;
Add support for the i80312 and i80321 I2C controllers.
 1.1.4.5 17-Jan-2005  skrll 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 06-Oct-2003  skrll file iopi2c.c was added on branch ktrace-lwp on 2004-08-03 10:32:58 +0000
 1.2.10.2 07-Dec-2007  yamt sync with head
 1.2.10.1 30-Dec-2006  yamt sync with head.
 1.3.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.3.8.1 11-Aug-2006  yamt sync with head
 1.3.4.1 09-Sep-2006  rpaulo sync with head
 1.4.46.1 08-Dec-2007  ad Sync with head.
 1.4.42.1 08-Dec-2007  mjf Sync with HEAD.
 1.4.36.1 09-Jan-2008  matt sync with HEAD
 1.4.34.1 01-Jan-2008  chris Sync with HEAD.
 1.4.32.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.4.30.1 26-Dec-2007  rjs Sync with HEAD.
 1.4.18.1 09-Dec-2007  reinoud Pullup to HEAD
 1.6.6.1 18-Feb-2012  mrg merge to -current.
 1.6.2.1 17-Apr-2012  yamt sync with head
 1.7.24.1 19-Mar-2016  skrll Sync with HEAD
 1.7.6.1 03-Dec-2017  jdolecek update from HEAD
 1.8.18.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.9.10.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.10.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 06-Oct-2003  thorpej branches: 1.1.4;
Add support for the i80312 and i80321 I2C controllers.
 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 06-Oct-2003  skrll file iopi2creg.h was added on branch ktrace-lwp on 2004-08-03 10:32:58 +0000
 1.5 22-Dec-2019  thorpej Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus(). "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().
 1.4 10-Jan-2012  jakllsch branches: 1.4.48;
split iopi2c(4) device/softc
 1.3 08-Dec-2007  ad branches: 1.3.50; 1.3.54;
struct lock -> kmutex_t
 1.2 11-Dec-2005  christos branches: 1.2.34; 1.2.46; 1.2.48; 1.2.50; 1.2.52; 1.2.62;
merge ktrace-lwp.
 1.1 06-Oct-2003  thorpej branches: 1.1.4; 1.1.18;
Add support for the i80312 and i80321 I2C controllers.
 1.1.18.1 21-Jan-2008  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 06-Oct-2003  skrll file iopi2cvar.h was added on branch ktrace-lwp on 2004-08-03 10:32:58 +0000
 1.2.62.1 08-Dec-2007  ad Sync with head.
 1.2.52.1 09-Jan-2008  matt sync with HEAD
 1.2.50.1 01-Jan-2008  chris Sync with HEAD.
 1.2.48.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.2.46.1 26-Dec-2007  rjs Sync with HEAD.
 1.2.34.1 09-Dec-2007  reinoud Pullup to HEAD
 1.3.54.1 18-Feb-2012  mrg merge to -current.
 1.3.50.1 17-Apr-2012  yamt sync with head
 1.4.48.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.7 18-Jun-2023  gutteridge ixp425-fw.README: fix spelling: s/Cypto/Crypto/
 1.6 19-Sep-2021  andvar fix various typos in comments, messages and documentation.
 1.5 30-Jan-2020  thorpej Update the URL for IPL_ixp400NpeLibrary-2_4.zip. Note the URL For
IPL_ixp400NpeLibraryWithCrypto-2_4.zip for reference purposes.
 1.4 10-Feb-2017  tnn branches: 1.4.14; 1.4.20;
remove misleading comment about version 3.0 microcode

The last known microcode to work is 2.4. Version 3.0 changes
the header signature and fails with "block too big for NPE memory".
Provide a backup download URL since intel removed version < 3.0.
 1.3 10-Feb-2017  tnn update firmware download URL
 1.2 24-Mar-2010  scw branches: 1.2.18; 1.2.36; 1.2.40; 1.2.44;
Update with new download link provided by Marcin M. Jessa in
http://mail-index.netbsd.org/port-arm/2010/03/24/msg000912.html.

Add a note about version 3.0 microcode.
 1.1 10-Dec-2006  scw branches: 1.1.2; 1.1.4; 1.1.6; 1.1.56; 1.1.76; 1.1.78;
Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.1.78.1 30-May-2010  rmind sync with head
 1.1.76.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.1.56.1 11-Aug-2010  yamt sync with head.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 10-Dec-2006  ad file ixp425-fw.README was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 10-Dec-2006  yamt file ixp425-fw.README was added on branch yamt-lazymbuf on 2006-12-30 20:45:37 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 10-Dec-2006  yamt file ixp425-fw.README was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.2.44.1 21-Apr-2017  bouyer Sync with HEAD
 1.2.40.1 20-Mar-2017  pgoyette Sync with HEAD
 1.2.36.1 28-Aug-2017  skrll Sync with HEAD
 1.2.18.1 03-Dec-2017  jdolecek update from HEAD
 1.4.20.1 29-Feb-2020  ad Sync with head.
 1.4.14.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.4 17-Jun-2023  rin Fix typo...
 1.3 17-Jun-2023  rin Rework microcode for IXP425 npe(4).

Instead of using objcopy(1), which cannot handle EABI version
embedded in e_flags of ELF header, add a dedicated asm file.

If proprietary microcode binary is present, it is incbin'ed
from that asm file.
 1.2 26-Mar-2010  jakllsch Use objcopy rather than ld to copy Intel NPE firmware blob into ELF.
Avoids internal error in newer binutils ld.
Should fix PR/42864 and PR/43057.
 1.1 10-Dec-2006  scw branches: 1.1.2; 1.1.4; 1.1.6; 1.1.56; 1.1.76; 1.1.78;
Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.1.78.1 30-May-2010  rmind sync with head
 1.1.76.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.1.56.1 11-Aug-2010  yamt sync with head.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 10-Dec-2006  ad file ixp425-fw.mk was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 10-Dec-2006  yamt file ixp425-fw.mk was added on branch yamt-lazymbuf on 2006-12-30 20:45:37 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 10-Dec-2006  yamt file ixp425-fw.mk was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.18 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.17 24-Apr-2021  thorpej branches: 1.17.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.16 14-Oct-2012  msaitoh branches: 1.16.52;
struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.15 01-Jul-2011  dyoung branches: 1.15.2; 1.15.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.14 17-May-2011  dyoung 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.13 21-Oct-2009  rmind branches: 1.13.4; 1.13.6;
Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.12 17-Mar-2009  msaitoh Make it compile without PCI.
 1.11 10-Dec-2006  scw branches: 1.11.50; 1.11.58; 1.11.64;
Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.10 11-Dec-2005  christos branches: 1.10.20; 1.10.22;
merge ktrace-lwp.
 1.9 30-Aug-2004  drochner branches: 1.9.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.8 02-Nov-2003  scw It makes more sense to map the expansion bus registers in ixpsip
instead of the pci bridge driver.
 1.7 23-Oct-2003  scw Map the expansion bus registers.
 1.6 08-Oct-2003  scw Make it easier to support different types of IXP425 board:

- Move board-specific PCI/GPIO initialisation to its rightful place.

- Handle clearing down latched GPIO interrupts in a board-independent way.

- Use MI com(4) driver for on-chip UARTs.

- Misc. tidying up.

Tested on IXDP425.
 1.5 25-Sep-2003  ichiro pci bus support
 1.4 02-Jul-2003  ichiro use struct pmap_devmap
 1.3 24-May-2003  ichiro branches: 1.3.2;
add IXDP425 PCI interrupt
fix some typo
 1.2 23-May-2003  ichiro hide debug messages(mapping)
 1.1 23-May-2003  ichiro support IXP425 Intel Network Processor
running on BigEndian
 1.3.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.2 03-Sep-2004  skrll Sync with HEAD
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.9.12.1 30-Dec-2006  yamt sync with head.
 1.10.22.1 18-Dec-2006  yamt sync with head.
 1.10.20.1 12-Jan-2007  ad Sync with head.
 1.11.64.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.11.58.1 28-Apr-2009  skrll Sync with HEAD.
 1.11.50.2 11-Mar-2010  yamt sync with head
 1.11.50.1 04-May-2009  yamt sync with head.
 1.13.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.13.4.1 31-May-2011  rmind sync with head
 1.15.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.15.2.1 30-Oct-2012  yamt sync with head
 1.16.52.1 02-Apr-2021  thorpej config_found_ia() -> config_found() w/ CFARG_IATTR.
 1.17.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 08-Oct-2003  scw branches: 1.1.4;
Make it easier to support different types of IXP425 board:

- Move board-specific PCI/GPIO initialisation to its rightful place.

- Handle clearing down latched GPIO interrupts in a board-independent way.

- Use MI com(4) driver for on-chip UARTs.

- Misc. tidying up.

Tested on IXDP425.
 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 08-Oct-2003  skrll file ixp425_a4x_io.S was added on branch ktrace-lwp on 2004-08-03 10:32:58 +0000
 1.4 16-Mar-2018  ryo use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
 1.3 01-Jul-2011  dyoung branches: 1.3.52;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 08-Oct-2003  scw branches: 1.1.4;
Make it easier to support different types of IXP425 board:

- Move board-specific PCI/GPIO initialisation to its rightful place.

- Handle clearing down latched GPIO interrupts in a board-independent way.

- Use MI com(4) driver for on-chip UARTs.

- Misc. tidying up.

Tested on IXDP425.
 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 08-Oct-2003  skrll file ixp425_a4x_space.c was added on branch ktrace-lwp on 2004-08-03 10:32:58 +0000
 1.3.52.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.19 08-Dec-2018  thorpej Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.18 01-Jul-2011  dyoung branches: 1.18.52; 1.18.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.17 14-Mar-2008  cube Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend). Use proper types and ansify where appropriate.
 1.16 13-Jul-2006  gdamore branches: 1.16.34; 1.16.36; 1.16.56; 1.16.60;
Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@. Fixes PR port-evbmips/32362.
 1.15 11-Dec-2005  christos branches: 1.15.4; 1.15.8; 1.15.16;
merge ktrace-lwp.
 1.14 08-Oct-2003  scw branches: 1.14.16;
Make it easier to support different types of IXP425 board:

- Move board-specific PCI/GPIO initialisation to its rightful place.

- Handle clearing down latched GPIO interrupts in a board-independent way.

- Use MI com(4) driver for on-chip UARTs.

- Misc. tidying up.

Tested on IXDP425.
 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 07-Aug-2003  ichiro fix dont reset register when every interrupt.
pointed by Shoichi Miyake port-arm/22392
 1.11 02-Jul-2003  ichiro backout to recent changes w/o lwp changes
 1.10 29-Jun-2003  fvdl branches: 1.10.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.9 29-Jun-2003  ichiro struct proc * -> struct lwp *

ixp425_com:
add some status flags
 1.8 03-Jun-2003  ichiro delete unneed bit for uart initialize.
and bug fix mistaken function
 1.7 01-Jun-2003  ichiro change into the form KNF
 1.6 01-Jun-2003  ichiro add console unit number to configuration parameter.
move structure of uart information
 1.5 31-May-2003  ichiro print description of Console and enable ixpcom0/1 in configuration
 1.4 31-May-2003  ichiro cosmetic change & some bugfix
 1.3 31-May-2003  ichiro some bug fix
 1.2 23-May-2003  ichiro delete definition (DEBUG)
 1.1 23-May-2003  ichiro support IXP425 Intel Network Processor
running on BigEndian
 1.10.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.2.1 03-Aug-2004  skrll Sync with HEAD
 1.14.16.2 17-Mar-2008  yamt sync with head.
 1.14.16.1 30-Dec-2006  yamt sync with head.
 1.15.16.1 20-Jun-2006  gdamore Add support for pretty much all ARM com(4) variants. There are a few ARM
serial devices that are not com(4)-like enough to be supported under com(4).
 1.15.8.1 11-Aug-2006  yamt sync with head
 1.15.4.1 09-Sep-2006  rpaulo sync with head
 1.16.60.1 03-Apr-2008  mjf Sync with HEAD.
 1.16.56.1 24-Mar-2008  keiichi sync with head.
 1.16.36.1 23-Mar-2008  matt sync with HEAD
 1.16.34.1 21-Mar-2008  chris Sync with head.
 1.18.54.1 10-Jun-2019  christos Sync with HEAD
 1.18.52.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.7 08-Oct-2003  scw Make it easier to support different types of IXP425 board:

- Move board-specific PCI/GPIO initialisation to its rightful place.

- Handle clearing down latched GPIO interrupts in a board-independent way.

- Use MI com(4) driver for on-chip UARTs.

- Misc. tidying up.

Tested on IXDP425.
 1.6 02-Jul-2003  ichiro backout to recent changes w/o lwp changes
 1.5 29-Jun-2003  fvdl branches: 1.5.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.4 29-Jun-2003  ichiro struct proc * -> struct lwp *

ixp425_com:
add some status flags
 1.3 01-Jun-2003  ichiro add console unit number to configuration parameter.
move structure of uart information
 1.2 31-May-2003  ichiro print description of Console and enable ixpcom0/1 in configuration
 1.1 23-May-2003  ichiro support IXP425 Intel Network Processor
running on BigEndian
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.54 29-Jun-2024  riastradh if_stats(9): Add ifp argument to if_stat..._ref.

This will enable us to pass the ifp through to a dtrace probe inside.

No functional change intended in this change, but this is an API
change visible to modules so it shouldn't be pulled up.

PR kern/58377
 1.53 27-Sep-2022  skrll malloc -> kmem
 1.52 18-Sep-2022  thorpej Eliminate use of IFF_OACTIVE.
 1.51 22-May-2022  andvar fix various small typos, mainly in comments.
 1.50 31-Dec-2021  riastradh sys: Use if_init wrapper function.

Exception: Not in kern_pmf.c, for the kind of silly reason that it
avoids having kern_pmf.c refer to symbols defined only in net; this
avoids a pain in the rump.
 1.49 31-Dec-2021  riastradh sys: Use if_stop wrapper function.

Exception: Not in kern_pmf.c, for the kind of silly reason that it
avoids having kern_pmf.c refer to symbols defined only in net; this
avoids a pain in the rump.
 1.48 19-Sep-2021  andvar fix various typos in comments, messages and documentation.
 1.47 18-Feb-2020  thorpej Use ether_mediastatus().
 1.46 04-Feb-2020  thorpej Add a comment that ifmedia_fini() should be used here someday.
 1.45 29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.44 27-Dec-2019  msaitoh branches: 1.44.2;
s/recive/receive/ in comment.
 1.43 10-Nov-2019  chs 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.42 13-Sep-2019  msaitoh if_flags is neither int nor short. It's unsigned short.
 1.41 28-May-2019  msaitoh Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.40 23-May-2019  msaitoh -No functional change:
- Simplify struct ethercom's pointer near ETHER_FIRST_MULTI().
- Simplify MII structure initialization.
- u_int*_t -> uint*_t.
- KNF
 1.39 26-Apr-2019  msaitoh No functional change:
- u_int_{8,16,32}_t -> uint_{8,16,32}_t
- KNF.
- Tabify.
- Remove extra space.
 1.38 24-Apr-2019  msaitoh This driver uses MII(4) and have hook SIOCGIFMEDIA which just pass to
ifmedia_ioctl(), the hook is not required because ether_ioctl has it
(if_ethersubr.c rev. 1.160). This driver might require some additional fixes
for SIOCSIFMTU and other ioctl()s.
 1.37 05-Mar-2019  msaitoh Centralize ETHER_ALIGN into net/if_ether.h. Note that this commit also changes
if_upgt.c's ETHER_ALIGN from 0 to 2.
 1.36 22-Jan-2019  msaitoh Change MII PHY read/write API from:

int (*mii_readreg_t)(device_t, int, int);
void (*mii_writereg_t)(device_t, int, int, int);
to:

int (*mii_readreg_t)(device_t, int, int, uint16_t *);
int (*mii_writereg_t)(device_t, int, int, uint16_t);

Now we can test if a read/write operation failed or not by the return value.

In 802.3 spec says that the PHY shall not respond to read/write transaction
to the unimplemented register(22.2.4.3). Detecting timeout can be used to
check whether a register is implemented or not (if the register conforms to
the spec). ukphy(4) can be used this for MII_MMDACR and MII_MMDAADR.

Note that I noticed that the following code do infinite loop in the
read/wirte function. If it accesses unimplemented PHY register, it will hang.
It should be fixed:

arm/at91/at91emac.c
arm/ep93xx/epe.c
arm/omap/omapl1x_emac.c
mips/ralink/ralink_eth.c
arch/powerpc/booke/dev/pq3etsec.c(read)
dev/cadence/if_cemac.c <- hkenken
dev/ic/lan9118.c


Tested with the following device:

axe+ukphy
axe+rgephy
axen+rgephy (tested by Andrius V)
wm+atphy
wm+ukphy
wm+igphy
wm+ihphy
wm+makphy
sk+makphy
sk+brgphy
sk+gentbi
msk+makphy
sip+icsphy
sip+ukphy
re+rgephy
bge+brgphy
bnx+brgphy
gsip+gphyter
rtk+rlphy
fxp+inphy (tested by Andrius V)
tlp+acphy
ex+exphy
epic+qsphy
vge+ciphy (tested by Andrius V)
vr+ukphy (tested by Andrius V)
vte+ukphy (tested by Andrius V)

Not tested (MAC):
arm:at91emac
arm:cemac
arm:epe
arm:geminigmac
arm:enet
arm:cpsw
arm:emac(omac)
arm:emac(sunxi)
arm:npe
evbppc:temac
macppc:bm
macppc:gm
mips:aumac
mips:ae
mips:cnmac
mips:reth
mips:sbmac
playstation2:smap
powerpc:tsec
powerpc:emac(ibm4xx)
sgimips:mec
sparc:be
sf
ne(ax88190, dl10019)
awge
ep
gem
hme
smsh
mtd
sm
age
alc
ale
bce
cas
et
jme
lii
nfe
pcn
ste
stge
tl
xi
aue
mue
smsc
udav
url

Not tested (PHY):
amhphy
bmtphy
dmphy
etphy
glxtphy
ikphy
iophy
lxtphy
nsphyter
pnaphy
rdcphy
sqphy
tlphy
tqphy
urlphy
 1.35 22-Dec-2018  maxv Replace: M_COPY_PKTHDR -> m_copy_pkthdr. No functional change, since the
former is a macro to the latter.
 1.34 26-Jun-2018  msaitoh branches: 1.34.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.33 22-Feb-2017  nonaka branches: 1.33.12;
Apply deferred if_start to more MD drivers.
 1.32 15-Dec-2016  ozaki-r branches: 1.32.2;
Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
- Where/When if_ipackets is counted up
- Note that some drivers still update packet statistics in their own
way (periodical update)
- Moved bpf_mtap run in softint
- This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
 1.31 10-Jun-2016  ozaki-r branches: 1.31.2;
Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
 1.30 09-Feb-2016  ozaki-r Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.29 28-Jun-2015  maxv Initialize 'error'.

Can't test, but obvious enough apparently.

Found by Brainy.
 1.28 13-Apr-2015  riastradh MD rnd.h cleanups. Please let me know if I broke anything!
 1.27 18-Oct-2014  snj branches: 1.27.2;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.26 10-Aug-2014  tls branches: 1.26.2;
Merge tls-earlyentropy branch into HEAD.
 1.25 20-Mar-2014  skrll branches: 1.25.2;
Mechanically replace simplelock with kmutex_t.
 1.24 24-Feb-2014  martin Explicitly include <sys/simplelock.h> for now (untill Nick kills it
for real), to make it compile.
 1.23 22-Jul-2012  matt branches: 1.23.2;
Fix mii_statchg to take a 'struct ifnet *' instead of device_t. This fixes
problem with a common MDIO bus used for multiple interfaces.
Some drivers converted to CFATTACL_DECL_NEW.
 1.22 02-Feb-2012  tls Entropy-pool implementation move and cleanup.

1) Move core entropy-pool code and source/sink/sample management code
to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
avoid expensive operations on disabled entropy sources; make the
rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
system events, and skew between clocks, with a sample implementation
for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.21 19-Nov-2011  tls branches: 1.21.2;
First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>. This change includes
the following:

An initial cleanup and minor reorganization of the entropy pool
code in sys/dev/rnd.c and sys/dev/rndpool.c. Several bugs are
fixed. Some effort is made to accumulate entropy more quickly at
boot time.

A generic interface, "rndsink", is added, for stream generators to
request that they be re-keyed with good quality entropy from the pool
as soon as it is available.

The arc4random()/arc4randbytes() implementation in libkern is
adjusted to use the rndsink interface for rekeying, which helps
address the problem of low-quality keys at boot time.

An implementation of the FIPS 140-2 statistical tests for random
number generator quality is provided (libkern/rngtest.c). This
is based on Greg Rose's implementation from Qualcomm.

A new random stream generator, nist_ctr_drbg, is provided. It is
based on an implementation of the NIST SP800-90 CTR_DRBG by
Henric Jungheim. This generator users AES in a modified counter
mode to generate a backtracking-resistant random stream.

An abstraction layer, "cprng", is provided for in-kernel consumers
of randomness. The arc4random/arc4randbytes API is deprecated for
in-kernel use. It is replaced by "cprng_strong". The current
cprng_fast implementation wraps the existing arc4random
implementation. The current cprng_strong implementation wraps the
new CTR_DRBG implementation. Both interfaces are rekeyed from
the entropy pool automatically at intervals justifiable from best
current cryptographic practice.

In some quick tests, cprng_fast() is about the same speed as
the old arc4randbytes(), and cprng_strong() is about 20% faster
than rnd_extract_data(). Performance is expected to improve.

The AES code in src/crypto/rijndael is no longer an optional
kernel component, as it is required by cprng_strong, which is
not an optional kernel component.

The entropy pool output is subjected to the rngtest tests at
startup time; if it fails, the system will reboot. There is
approximately a 3/10000 chance of a false positive from these
tests. Entropy pool _input_ from hardware random numbers is
subjected to the rngtest tests at attach time, as well as the
FIPS continuous-output test, to detect bad or stuck hardware
RNGs; if any are detected, they are detached, but the system
continues to run.

A problem with rndctl(8) is fixed -- datastructures with
pointers in arrays are no longer passed to userspace (this
was not a security problem, but rather a major issue for
compat32). A new kernel will require a new rndctl.

The sysctl kern.arandom() and kern.urandom() nodes are hooked
up to the new generators, but the /dev/*random pseudodevices
are not, yet.

Manual pages for the new kernel interfaces are forthcoming.
 1.20 01-Jul-2011  dyoung branches: 1.20.2;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.19 05-Apr-2010  joerg Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.
 1.18 19-Jan-2010  pooka branches: 1.18.2; 1.18.4;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.17 12-Mar-2009  msaitoh Add rnd stuff.
 1.16 11-Mar-2009  msaitoh Bug fixes phase5.

- Catch NPE_NOTIFYMACRECOVERYDONE from NPE, reset MAC and send
NPE_MACRECOVERYSTART to NPE. This sequence is very important :-|
(It's easy to reproduce)

- Don't call tsleep() in interrupt context.

- Add randomness of the transmit deferwhen a collision occured (like CSR)

- fix DPRINTFn() in npe_cpu_reset()
 1.15 11-Mar-2009  msaitoh Make MII stuff more generic.
Use macro.
 1.14 11-Mar-2009  msaitoh Read MAC address register before reset (to get IPL(e.g. redboot)'s setting).
 1.13 11-Mar-2009  msaitoh Bug fixes phase 3 (and one enhancement).

- fix if_init(), if_stop(), if_start() and ifioctl().
Some of these bugfixes are required to use multicast filter's fix(rev. 1.11)

- Prevent linkdown when only the promisc flag changed.
 1.12 11-Mar-2009  msaitoh Change TX threshold from 0x08 to 0x18. This value is the same as CSR 2.4.
Use macro.
 1.11 10-Mar-2009  msaitoh some bug fixes

- Set the flag to use multicast filter...
Without this flag and with a shared hub, the MAC gets ALL packets and the
packets will be forwarded if the forwarding is enabled. It results in DUP!

- Workaround for "Non-Intel XScale Technology Eratta" No. 29.
AA:BB:CC:DD:EE:xF's packet (the 2nd nibble from LSB is the same as the
MAC's one) had matched the filter (both unicast and multicast).

- Check if too {short,long} frame.

- Add the MD hook to get MAC address
 1.10 10-Mar-2009  msaitoh some bugfixes

- Fix incorrect memset from FreeBSD CVS rev. 1.10 (SVN rev 183886)

- Fix the bus_dmamap_create() call to prevent extra npe_defrag() call.
Fixed by Hikaru Abe.

- Add missing bpf_mtap() call in RX.

- Add ETHERCAP_VLAN_MTU flag
 1.9 27-Apr-2008  matt branches: 1.9.8; 1.9.14;
Merge kernel changes in matt-armv6 to HEAD.
 1.8 26-Jan-2008  scw branches: 1.8.6; 1.8.8; 1.8.10;
g/c an unused variable.

From Donald T Hayford on port-arm@
 1.7 19-Jan-2008  dyoung Make many ethernet drivers share the common code for MII media
handling, ether_mediastatus() and ether_mediachange(). Check for
a non-ENXIO error return from mii_mediachg(). (ENXIO indicates
that a PHY is suspended.)

This patch shrinks the source code size by 979 lines. There was
a 5100-byte savings on the NetBSD/i386 kernel configuration, ALL.

I have made a few miscellaneous changes, too:

gem(4): use LIST_EMPTY(), LIST_FOREACH().
mtd(4): handle media ioctls, for a change!
axe(4): do not track link status in sc->axe_link any longer
nfe(4), aue(4), axe(4), udav(4), url(4): do not reset all PHYs
on a change of media

Except for the change to mtd(4), no functional changes are intended.

XXX This patch affects more architectures than I can feasibly
XXX compile and run. I have compiled macppc, sparc64, i386. I
XXX have run the patches on i386 boxen with bnx(4) and sip(4).
XXX Compiling and running on evbmips (MERAKI, ADM5120) is in
XXX progress.
 1.6 08-Jan-2008  matt As of this commit, all arm32 kernel now build.
 1.5 17-Oct-2007  garbled branches: 1.5.2; 1.5.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.4 09-Jul-2007  ad branches: 1.4.6; 1.4.10; 1.4.12;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.3 04-Mar-2007  christos branches: 1.3.2; 1.3.4; 1.3.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.2 10-Dec-2006  scw branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
Repeat after me: Compile/Test before commit.
 1.1 10-Dec-2006  scw Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.2.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.2.6.2 12-Jan-2007  ad Sync with head.
 1.2.6.1 10-Dec-2006  ad file ixp425_if_npe.c was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.2.4.5 04-Feb-2008  yamt sync with head.
 1.2.4.4 21-Jan-2008  yamt sync with head
 1.2.4.3 03-Sep-2007  yamt sync with head.
 1.2.4.2 30-Dec-2006  yamt sync with head.
 1.2.4.1 10-Dec-2006  yamt file ixp425_if_npe.c was added on branch yamt-lazymbuf on 2006-12-30 20:45:37 +0000
 1.2.2.2 18-Dec-2006  yamt sync with head.
 1.2.2.1 10-Dec-2006  yamt file ixp425_if_npe.c was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.3.10.1 03-Oct-2007  garbled Sync with HEAD
 1.3.4.1 11-Jul-2007  mjf Sync with head.
 1.3.2.1 15-Jul-2007  ad Sync with head.
 1.4.12.3 23-Mar-2008  matt sync with HEAD
 1.4.12.2 09-Jan-2008  matt sync with HEAD
 1.4.12.1 06-Nov-2007  matt sync with HEAD
 1.4.10.3 27-Jan-2008  chris Sync to HEAD.
 1.4.10.2 20-Jan-2008  chris Sync to HEAD.
 1.4.10.1 01-Jan-2008  chris Sync with HEAD.
 1.4.6.1 28-Feb-2008  rjs Sync with HEAD.
 1.5.8.2 20-Jan-2008  bouyer Sync with HEAD
 1.5.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.5.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.8.10.4 11-Aug-2010  yamt sync with head.
 1.8.10.3 11-Mar-2010  yamt sync with head
 1.8.10.2 04-May-2009  yamt sync with head.
 1.8.10.1 16-May-2008  yamt sync with head.
 1.8.8.1 18-May-2008  yamt sync with head.
 1.8.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.18.4.1 30-May-2010  rmind sync with head
 1.18.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.20.2.2 30-Oct-2012  yamt sync with head
 1.20.2.1 17-Apr-2012  yamt sync with head
 1.21.2.1 18-Feb-2012  mrg merge to -current.
 1.23.2.2 03-Dec-2017  jdolecek update from HEAD
 1.23.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.25.2.1 07-Apr-2014  tls Be a little more clear and consistent about harvesting entropy from devices:

1) deprecate RND_FLAG_NO_ESTIMATE

2) define RND_FLAG_COLLECT_TIME, RND_FLAG_COLLECT_VALUE

3) define RND_FLAG_ESTIMATE_TIME, RND_FLAG_ESTIMATE_VALUE

4) define RND_FLAG_DEFAULT: RND_FLAG_COLLECT_TIME|
RND_FLAG_COLLECT_VALUE|RND_FLAG_ESTIMATE_TIME

5) Make entropy harvesting from environmental sensors a little more generic
and remove it from individual sensor drivers.

6) Remove individual open-coded delta-estimators for values from a few
places in the tree (uvm, environmental drivers).

7) 0 -> RND_FLAG_DEFAULT, actually gather entropy from various drivers
that had stubbed out code, other minor cleanups.
 1.26.2.1 05-Jul-2015  snj Pull up following revision(s) (requested by maxv in ticket #857):
sys/arch/arm/xscale/ixp425_if_npe.c: revision 1.29
Initialize 'error'.
Can't test, but obvious enough apparently.
Found by Brainy.
 1.27.2.6 28-Aug-2017  skrll Sync with HEAD
 1.27.2.5 05-Feb-2017  skrll Sync with HEAD
 1.27.2.4 09-Jul-2016  skrll Sync with HEAD
 1.27.2.3 19-Mar-2016  skrll Sync with HEAD
 1.27.2.2 22-Sep-2015  skrll Sync with HEAD
 1.27.2.1 06-Jun-2015  skrll Sync with HEAD
 1.31.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.31.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.32.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.33.12.3 26-Jan-2019  pgoyette Sync with HEAD
 1.33.12.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.33.12.1 28-Jul-2018  pgoyette Sync with HEAD
 1.34.2.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.34.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.34.2.1 10-Jun-2019  christos Sync with HEAD
 1.44.2.1 29-Feb-2020  ad Sync with head.
 1.3 11-Mar-2009  msaitoh Bug fixes phase5.

- Catch NPE_NOTIFYMACRECOVERYDONE from NPE, reset MAC and send
NPE_MACRECOVERYSTART to NPE. This sequence is very important :-|
(It's easy to reproduce)

- Don't call tsleep() in interrupt context.

- Add randomness of the transmit deferwhen a collision occured (like CSR)

- fix DPRINTFn() in npe_cpu_reset()
 1.2 11-Mar-2009  msaitoh Change TX threshold from 0x08 to 0x18. This value is the same as CSR 2.4.
Use macro.
 1.1 10-Dec-2006  scw branches: 1.1.2; 1.1.4; 1.1.6; 1.1.56; 1.1.64; 1.1.70;
Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.1.70.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.64.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.56.1 04-May-2009  yamt sync with head.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 10-Dec-2006  ad file ixp425_if_npereg.h was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 10-Dec-2006  yamt file ixp425_if_npereg.h was added on branch yamt-lazymbuf on 2006-12-30 20:45:37 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 10-Dec-2006  yamt file ixp425_if_npereg.h was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.28 20-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.27 10-Nov-2019  chs branches: 1.27.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.26 26-Mar-2014  christos branches: 1.26.30;
kill sprintf
 1.25 12-Nov-2012  skrll branches: 1.25.2;
C99 types
 1.24 28-Sep-2012  ryo Defer attaching interrupt evcnts in the same way as i80321.c by matt@
 1.23 01-Jul-2011  dyoung branches: 1.23.2; 1.23.8; 1.23.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.22 20-Dec-2010  matt Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.21 13-Jun-2010  tsutsui Apply fixes for PR port-arm/43339:
Set proper IPL_SOFTfoo values even in !FAST_SOFTINTS case.
Some assertions in MI code expect they have unique values,
per comments from rmind@.

Also cleanup various "interrupt hierarchy" code since IPL_NONE and
IPL_SOFTfoo should not be set by any hardware interrupt establish functions.

Ok'ed by mrg@, tested on shark and hpcarm.
 1.20 21-Oct-2009  rmind branches: 1.20.2; 1.20.4;
Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.19 27-Apr-2008  matt Merge kernel changes in matt-armv6 to HEAD.
 1.18 08-Jan-2008  matt branches: 1.18.6; 1.18.8; 1.18.10;
As of this commit, all arm32 kernel now build.
 1.17 11-Dec-2007  ad And you, be ye fruitful, and multiply; bring forth abundantly in the earth,
and multiply therein. (Genesis 9:6-8)
 1.16 03-Dec-2007  ad branches: 1.16.2; 1.16.4; 1.16.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.15 24-Nov-2006  wiz branches: 1.15.8; 1.15.24; 1.15.26; 1.15.28; 1.15.30; 1.15.36;
s/heirarchy/hierarchy/, from Zafer.
 1.14 17-May-2006  mrg branches: 1.14.8; 1.14.10;
remove 'inline' from the xxx_do_pending() function that is called from
external sources, and conflicts with it's prototype.
 1.13 10-Apr-2006  simonb Tab Police.
 1.12 24-Dec-2005  perry branches: 1.12.4; 1.12.6; 1.12.8; 1.12.10; 1.12.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.11 11-Dec-2005  christos merge ktrace-lwp.
 1.10 27-Feb-2004  scw branches: 1.10.16;
Must Test Before Committing...
 1.9 13-Feb-2004  scw Avoid using two 'GPIO' bits of the interrupt mask to signify soft
interrupts; some boards actually use those GPIO pins as external
interrupt sources.

Instead, assign soft interrupt bits to on-chip sources which are
not used by the IXP425 port.
 1.8 03-Dec-2003  scw In the interrupt dispatch loop, make sure to handle any pending interrupts
which came in while we were dealing with the first interrupt(s), and which
are enabled at the current spl.

This fixes a problem where the intr_enabled/hw mask is not updated to
allow pending interrupts through until the next splx(). In some case,
interrupts could be delayed until the next clock tick.
 1.7 08-Oct-2003  scw Ok, I give up for now. There's no easy/reliable way to deal with
these spurious interrupts.
 1.6 08-Oct-2003  scw Simplify the last change to just check for spurious GPIO interrupts.
 1.5 08-Oct-2003  scw If no interrupt handler claims to have dealt with a level-triggered
GPIO interrupt, check the GPIO interrupt status register after clearing
it down to see if the interrupt source has disappeared. If it does,
assume it was a spurious event. Otherwise, panic.
 1.4 08-Oct-2003  scw Make it easier to support different types of IXP425 board:

- Move board-specific PCI/GPIO initialisation to its rightful place.

- Handle clearing down latched GPIO interrupts in a board-independent way.

- Use MI com(4) driver for on-chip UARTs.

- Misc. tidying up.

Tested on IXDP425.
 1.3 25-Sep-2003  ichiro pci bus support
 1.2 16-Jun-2003  thorpej branches: 1.2.2;
Rename IPL_IMP -> IPL_VM.
 1.1 23-May-2003  ichiro support IXP425 Intel Network Processor
running on BigEndian
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.10.16.4 21-Jan-2008  yamt sync with head
 1.10.16.3 07-Dec-2007  yamt sync with head
 1.10.16.2 30-Dec-2006  yamt sync with head.
 1.10.16.1 21-Jun-2006  yamt sync with head.
 1.12.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.12.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.12.8.2 24-May-2006  yamt sync with head.
 1.12.8.1 11-Apr-2006  yamt sync with head
 1.12.6.2 01-Jun-2006  kardel Sync with head.
 1.12.6.1 22-Apr-2006  simonb Sync with head.
 1.12.4.1 09-Sep-2006  rpaulo sync with head
 1.14.10.1 10-Dec-2006  yamt sync with head.
 1.14.8.1 12-Jan-2007  ad Sync with head.
 1.15.36.3 18-Feb-2008  mjf Sync with HEAD.
 1.15.36.2 27-Dec-2007  mjf Sync with HEAD.
 1.15.36.1 08-Dec-2007  mjf Sync with HEAD.
 1.15.30.3 28-Jan-2008  matt Given the that there are only 4 IPLs (ignoring soft IPLs), a number of
cleanups can be done:
Remove _SPL_* aliases.
Don't store irqmasks in ci_cpl, just make it an ipl level.
Add fast softint switching support.
 1.15.30.2 09-Jan-2008  matt sync with HEAD
 1.15.30.1 09-Nov-2007  matt Make all the evbarm kernels build again. Fix lossage from rebase.
 1.15.28.2 20-Jan-2008  chris Sync to HEAD.
 1.15.28.1 01-Jan-2008  chris Sync with HEAD.
 1.15.26.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.15.24.2 28-Feb-2008  rjs Sync with HEAD.
 1.15.24.1 26-Dec-2007  rjs Sync with HEAD.
 1.15.8.2 03-Dec-2007  ad Sync with HEAD.
 1.15.8.1 03-Dec-2007  ad Sync with HEAD.
 1.16.6.2 08-Jan-2008  bouyer Sync with HEAD
 1.16.6.1 13-Dec-2007  bouyer Sync with HEAD
 1.16.4.1 13-Dec-2007  yamt sync with head.
 1.16.2.1 26-Dec-2007  ad Sync with head.
 1.18.10.3 11-Aug-2010  yamt sync with head.
 1.18.10.2 11-Mar-2010  yamt sync with head
 1.18.10.1 16-May-2008  yamt sync with head.
 1.18.8.1 18-May-2008  yamt sync with head.
 1.18.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.20.4.2 05-Mar-2011  rmind sync with head
 1.20.4.1 03-Jul-2010  rmind sync with head
 1.20.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.23.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.23.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.23.8.1 17-Oct-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #600):
sys/arch/arm/xscale/ixp425_intr.c: revision 1.24
sys/arch/evbarm/ixdp425/ixdp425_mainbus.c: revision 1.8
sys/arch/evbarm/nslu2/nslu2_mainbus.c: revision 1.3
sys/arch/arm/xscale/ixp425var.h: revision 1.14
Defer attaching interrupt evcnts in the same way as i80321.c by matt@
 1.23.2.3 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.23.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.23.2.1 30-Oct-2012  yamt sync with head
 1.25.2.1 18-May-2014  rmind sync with head
 1.26.30.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.27.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.11 01-Aug-2023  rin arm/xscale: Do not lower IPL by splraise(9)

XXX
I have fixed similar bug for xscale/i80321.
There should be more in codes written at that time...
 1.10 12-Nov-2012  skrll C99 types
 1.9 27-Feb-2009  msaitoh branches: 1.9.12; 1.9.22;
add missing <arm/cpu.h> to compile
 1.8 27-Apr-2008  matt branches: 1.8.8; 1.8.14;
Merge kernel changes in matt-armv6 to HEAD.
 1.7 08-Jan-2008  matt branches: 1.7.6; 1.7.8; 1.7.10;
As of this commit, all arm32 kernel now build.
 1.6 24-Dec-2005  perry branches: 1.6.46; 1.6.50; 1.6.52; 1.6.58; 1.6.66;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 13-Feb-2004  scw branches: 1.4.16;
Avoid using two 'GPIO' bits of the interrupt mask to signify soft
interrupts; some boards actually use those GPIO pins as external
interrupt sources.

Instead, assign soft interrupt bits to on-chip sources which are
not used by the IXP425 port.
 1.3 12-Jan-2004  scw Use __insn_barrier() to prevent the compiler reordering splx/splraise
relative to the code they're supposed to protect.
 1.2 21-Sep-2003  matt Fix GCC 3.3.1 nits.
 1.1 23-May-2003  ichiro branches: 1.1.2;
support IXP425 Intel Network Processor
running on BigEndian
 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 21-Jan-2008  yamt sync with head
 1.4.16.1 21-Jun-2006  yamt sync with head.
 1.6.66.1 08-Jan-2008  bouyer Sync with HEAD
 1.6.58.1 18-Feb-2008  mjf Sync with HEAD.
 1.6.52.3 28-Jan-2008  matt Given the that there are only 4 IPLs (ignoring soft IPLs), a number of
cleanups can be done:
Remove _SPL_* aliases.
Don't store irqmasks in ci_cpl, just make it an ipl level.
Add fast softint switching support.
 1.6.52.2 09-Jan-2008  matt sync with HEAD
 1.6.52.1 09-Nov-2007  matt Make all the evbarm kernels build again. Fix lossage from rebase.
 1.6.50.1 20-Jan-2008  chris Sync to HEAD.
 1.6.46.1 28-Feb-2008  rjs Sync with HEAD.
 1.7.10.2 04-May-2009  yamt sync with head.
 1.7.10.1 16-May-2008  yamt sync with head.
 1.7.8.1 18-May-2008  yamt sync with head.
 1.7.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.8.8.1 03-Mar-2009  skrll Sync with HEAD.
 1.9.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.9.12.1 16-Jan-2013  yamt sync with (a bit old) head
 1.3 25-Sep-2003  ichiro pci bus support
 1.2 01-Jun-2003  ichiro branches: 1.2.2;
change into the form KNF
 1.1 23-May-2003  ichiro support IXP425 Intel Network Processor
running on BigEndian
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.6 24-Apr-2021  thorpej branches: 1.6.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.5 14-Oct-2012  msaitoh branches: 1.5.52;
struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.4 18-Sep-2012  matt Add bounce buffer support for ARM bus_dma(9). Add macros to help initialize
bus_dma_tag structures.
 1.3 01-Jul-2011  dyoung branches: 1.3.2; 1.3.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 10-Dec-2006  scw branches: 1.1.2; 1.1.4; 1.1.6; 1.1.52; 1.1.54; 1.1.56;
Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.1.56.1 16-May-2008  yamt sync with head.
 1.1.54.1 18-May-2008  yamt sync with head.
 1.1.52.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 10-Dec-2006  ad file ixp425_ixme.c was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 10-Dec-2006  yamt file ixp425_ixme.c was added on branch yamt-lazymbuf on 2006-12-30 20:45:37 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 10-Dec-2006  yamt file ixp425_ixme.c was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.3.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3.2.1 30-Oct-2012  yamt sync with head
 1.5.52.6 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.5.52.5 05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.5.52.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.5.52.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.5.52.2 21-Mar-2021  thorpej CFARG_IATTR usage audit:

If a device carries only one interface attribute, there is no need
to specify it when calling config_search(); that specification is
meant only to disambiguate which interface attribute (which is a
proxy for "what kind of attach args are being used") is having
children attached. cfparent_match() will take care of ensuring that
any potential children can attach to one of the parent's iterface
attributes, and if the parent only carries one, no disambiguation is
necessary.
 1.5.52.1 20-Mar-2021  thorpej The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.6.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 10-Dec-2006  scw branches: 1.1.2; 1.1.4; 1.1.6; 1.1.52; 1.1.54; 1.1.56;
Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.1.56.1 16-May-2008  yamt sync with head.
 1.1.54.1 18-May-2008  yamt sync with head.
 1.1.52.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 10-Dec-2006  ad file ixp425_ixmevar.h was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 10-Dec-2006  yamt file ixp425_ixmevar.h was added on branch yamt-lazymbuf on 2006-12-30 20:45:37 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 10-Dec-2006  yamt file ixp425_ixmevar.h was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.3 24-Jun-2023  msaitoh Fix typo in error message.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 08-Dec-2003  scw branches: 1.1.4;
Add support for picking up the size of SDRAM by reading the memory
controller's config register.
 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 08-Dec-2003  skrll file ixp425_mem.c was added on branch ktrace-lwp on 2004-08-03 10:32:58 +0000
 1.17 17-Jun-2023  rin Rework microcode for IXP425 npe(4).

Instead of using objcopy(1), which cannot handle EABI version
embedded in e_flags of ELF header, add a dedicated asm file.

If proprietary microcode binary is present, it is incbin'ed
from that asm file.
 1.16 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.15 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.14 02-Aug-2021  andvar fix various typos in comments and log messages.
 1.13 24-Jul-2021  andvar branches: 1.13.2;
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.12 24-Apr-2021  thorpej branches: 1.12.2;
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.11 14-Aug-2014  joerg branches: 1.11.34;
Remove tautologies.
 1.10 20-Mar-2014  skrll Mechanically replace simplelock with kmutex_t.
 1.9 14-Oct-2012  msaitoh branches: 1.9.2;
struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.8 01-Jul-2011  dyoung branches: 1.8.2; 1.8.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.7 13-May-2011  rmind Eliminate few references to ltsleep.
 1.6 26-Oct-2009  cegger branches: 1.6.4; 1.6.6;
kill extra whitespaces
reviewed by tsutsui@
 1.5 18-Mar-2009  cegger bcopy -> memcpy
 1.4 11-Mar-2009  msaitoh Bug fixes phase5.

- Catch NPE_NOTIFYMACRECOVERYDONE from NPE, reset MAC and send
NPE_MACRECOVERYSTART to NPE. This sequence is very important :-|
(It's easy to reproduce)

- Don't call tsleep() in interrupt context.

- Add randomness of the transmit deferwhen a collision occured (like CSR)

- fix DPRINTFn() in npe_cpu_reset()
 1.3 08-Jan-2008  matt branches: 1.3.10; 1.3.18; 1.3.24;
As of this commit, all arm32 kernel now build.
 1.2 22-Feb-2007  thorpej branches: 1.2.18; 1.2.22; 1.2.24; 1.2.30; 1.2.36;
TRUE -> true, FALSE -> false
 1.1 10-Dec-2006  scw branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.1.8.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 10-Dec-2006  ad file ixp425_npe.c was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.4 21-Jan-2008  yamt sync with head
 1.1.4.3 26-Feb-2007  yamt sync with head.
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 10-Dec-2006  yamt file ixp425_npe.c was added on branch yamt-lazymbuf on 2006-12-30 20:45:37 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 10-Dec-2006  yamt file ixp425_npe.c was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.2.36.1 08-Jan-2008  bouyer Sync with HEAD
 1.2.30.1 18-Feb-2008  mjf Sync with HEAD.
 1.2.24.1 09-Jan-2008  matt sync with HEAD
 1.2.22.1 20-Jan-2008  chris Sync to HEAD.
 1.2.18.1 28-Feb-2008  rjs Sync with HEAD.
 1.3.24.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.18.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.10.2 11-Mar-2010  yamt sync with head
 1.3.10.1 04-May-2009  yamt sync with head.
 1.6.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.4.1 31-May-2011  rmind sync with head
 1.8.12.3 03-Dec-2017  jdolecek update from HEAD
 1.8.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.8.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.8.2.1 30-Oct-2012  yamt sync with head
 1.9.2.1 18-May-2014  rmind sync with head
 1.11.34.6 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.11.34.5 05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.11.34.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.11.34.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.11.34.2 21-Mar-2021  thorpej CFARG_IATTR usage audit:

If a device carries only one interface attribute, there is no need
to specify it when calling config_search(); that specification is
meant only to disambiguate which interface attribute (which is a
proxy for "what kind of attach args are being used") is having
children attached. cfparent_match() will take care of ensuring that
any potential children can attach to one of the parent's iterface
attributes, and if the parent only carries one, no disambiguation is
necessary.
 1.11.34.1 20-Mar-2021  thorpej The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.12.2.1 01-Aug-2021  thorpej Sync with HEAD.
 1.13.2.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.1 17-Jun-2023  rin Rework microcode for IXP425 npe(4).

Instead of using objcopy(1), which cannot handle EABI version
embedded in e_flags of ELF header, add a dedicated asm file.

If proprietary microcode binary is present, it is incbin'ed
from that asm file.
 1.2 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.1 10-Dec-2006  scw branches: 1.1.2; 1.1.4; 1.1.6; 1.1.160;
Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.1.160.1 01-Aug-2021  thorpej Sync with HEAD.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 10-Dec-2006  ad file ixp425_npereg.h was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 10-Dec-2006  yamt file ixp425_npereg.h was added on branch yamt-lazymbuf on 2006-12-30 20:45:37 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 10-Dec-2006  yamt file ixp425_npereg.h was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.5 20-Mar-2014  skrll Mechanically replace simplelock with kmutex_t.
 1.4 14-Oct-2012  msaitoh branches: 1.4.2;
struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.3 11-Mar-2009  msaitoh branches: 1.3.12; 1.3.22;
Bug fixes phase5.

- Catch NPE_NOTIFYMACRECOVERYDONE from NPE, reset MAC and send
NPE_MACRECOVERYSTART to NPE. This sequence is very important :-|
(It's easy to reproduce)

- Don't call tsleep() in interrupt context.

- Add randomness of the transmit deferwhen a collision occured (like CSR)

- fix DPRINTFn() in npe_cpu_reset()
 1.2 10-Mar-2009  msaitoh some bug fixes

- Set the flag to use multicast filter...
Without this flag and with a shared hub, the MAC gets ALL packets and the
packets will be forwarded if the forwarding is enabled. It results in DUP!

- Workaround for "Non-Intel XScale Technology Eratta" No. 29.
AA:BB:CC:DD:EE:xF's packet (the 2nd nibble from LSB is the same as the
MAC's one) had matched the filter (both unicast and multicast).

- Check if too {short,long} frame.

- Add the MD hook to get MAC address
 1.1 10-Dec-2006  scw branches: 1.1.2; 1.1.4; 1.1.6; 1.1.56; 1.1.64; 1.1.70;
Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.1.70.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.64.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.56.1 04-May-2009  yamt sync with head.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 10-Dec-2006  ad file ixp425_npevar.h was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 10-Dec-2006  yamt file ixp425_npevar.h was added on branch yamt-lazymbuf on 2006-12-30 20:45:37 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 10-Dec-2006  yamt file ixp425_npevar.h was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.3.22.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3.12.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.3.12.1 30-Oct-2012  yamt sync with head
 1.4.2.1 18-May-2014  rmind sync with head
 1.15 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.14 07-Jul-2020  thorpej 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.13 14-Jun-2020  chs replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.12 02-Oct-2015  msaitoh 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.11 12-Nov-2012  skrll branches: 1.11.14;
C99 types
 1.10 14-Oct-2012  msaitoh struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.9 07-Sep-2012  matt branches: 1.9.2;
Fix more pci_conf_interrupt/pci_conf_hook problems
 1.8 27-Jan-2012  para converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.7 01-Jul-2011  dyoung branches: 1.7.2; 1.7.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.6 21-Oct-2009  rmind Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.5 10-Apr-2006  simonb branches: 1.5.68;
Tab Police.
 1.4 11-Dec-2005  christos branches: 1.4.4; 1.4.6; 1.4.8; 1.4.10; 1.4.12;
merge ktrace-lwp.
 1.3 08-Dec-2003  scw branches: 1.3.4; 1.3.18;
Oops, map PCI memory space at VA 0xf8000000 instead of in the middle
of user VM space at 0x48000000.
 1.2 08-Oct-2003  scw Make it easier to support different types of IXP425 board:

- Move board-specific PCI/GPIO initialisation to its rightful place.

- Handle clearing down latched GPIO interrupts in a board-independent way.

- Use MI com(4) driver for on-chip UARTs.

- Misc. tidying up.

Tested on IXDP425.
 1.1 25-Sep-2003  ichiro pci bus support
 1.3.18.1 21-Jun-2006  yamt sync with head.
 1.3.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.3.4.2 03-Aug-2004  skrll Sync with HEAD
 1.3.4.1 08-Dec-2003  skrll file ixp425_pci.c was added on branch ktrace-lwp on 2004-08-03 10:32:58 +0000
 1.4.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.4.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.4.8.1 11-Apr-2006  yamt sync with head
 1.4.6.1 22-Apr-2006  simonb Sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.5.68.1 11-Mar-2010  yamt sync with head
 1.7.6.1 18-Feb-2012  mrg merge to -current.
 1.7.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.7.2.2 30-Oct-2012  yamt sync with head
 1.7.2.1 17-Apr-2012  yamt sync with head
 1.9.2.2 03-Dec-2017  jdolecek update from HEAD
 1.9.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.11.14.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 25-Sep-2003  ichiro branches: 1.1.4;
pci bus support
 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 25-Sep-2003  skrll file ixp425_pci_asm.S was added on branch ktrace-lwp on 2004-08-03 10:32:58 +0000
 1.7 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.6 18-Sep-2012  matt Add bounce buffer support for ARM bus_dma(9). Add macros to help initialize
bus_dma_tag structures.
 1.5 01-Jul-2011  dyoung branches: 1.5.2; 1.5.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.4 21-Oct-2009  rmind Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.3 11-Dec-2005  christos branches: 1.3.80;
merge ktrace-lwp.
 1.2 08-Oct-2003  scw branches: 1.2.4;
Make it easier to support different types of IXP425 board:

- Move board-specific PCI/GPIO initialisation to its rightful place.

- Handle clearing down latched GPIO interrupts in a board-independent way.

- Use MI com(4) driver for on-chip UARTs.

- Misc. tidying up.

Tested on IXDP425.
 1.1 25-Sep-2003  ichiro pci bus support
 1.2.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.2.4.2 03-Aug-2004  skrll Sync with HEAD
 1.2.4.1 08-Oct-2003  skrll file ixp425_pci_dma.c was added on branch ktrace-lwp on 2004-08-03 10:32:58 +0000
 1.3.80.1 11-Mar-2010  yamt sync with head
 1.5.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.2.1 30-Oct-2012  yamt sync with head
 1.15 21-Apr-2023  skrll Trailing whitespace
 1.14 16-Mar-2018  ryo use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
 1.13 24-Feb-2014  martin branches: 1.13.28;
Fix compilation
 1.12 22-Feb-2014  matt Don't manipulate the pte to get uncached memory, use PMAP_NOCACHE instead.
Convert footbring to kenter_pa/kremove
 1.11 12-Nov-2012  skrll branches: 1.11.2;
C99 types
 1.10 11-Jul-2011  matt branches: 1.10.2; 1.10.12;
Remove inline from global routines
 1.9 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.8 07-Nov-2009  cegger Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.
 1.7 21-Oct-2009  rmind Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.6 10-Apr-2006  simonb branches: 1.6.68;
Tab Police.
 1.5 24-Dec-2005  perry branches: 1.5.4; 1.5.6; 1.5.8; 1.5.10; 1.5.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.4 24-Nov-2005  yamt bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
 1.3 01-Apr-2005  yamt branches: 1.3.2; 1.3.8;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.2 25-Sep-2003  ichiro branches: 1.2.4; 1.2.10; 1.2.12;
add comment and delete unused definition
 1.1 25-Sep-2003  ichiro pci bus support
 1.2.12.1 28-Jan-2005  yamt convert arch/arm to new apis.
 1.2.10.1 29-Apr-2005  kent sync with -current
 1.2.4.6 11-Dec-2005  christos Sync with head.
 1.2.4.5 01-Apr-2005  skrll Sync with HEAD.
 1.2.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.2.4.2 03-Aug-2004  skrll Sync with HEAD
 1.2.4.1 25-Sep-2003  skrll file ixp425_pci_space.c was added on branch ktrace-lwp on 2004-08-03 10:32:58 +0000
 1.3.8.1 29-Nov-2005  yamt sync with head.
 1.3.2.1 21-Jun-2006  yamt sync with head.
 1.5.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.5.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.5.8.1 11-Apr-2006  yamt sync with head
 1.5.6.1 22-Apr-2006  simonb Sync with head.
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.6.68.1 11-Mar-2010  yamt sync with head
 1.10.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.10.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.10.2.1 16-Jan-2013  yamt sync with (a bit old) head
 1.11.2.1 18-May-2014  rmind sync with head
 1.13.28.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.12 27-Sep-2022  skrll malloc -> kmem
 1.11 10-Dec-2021  andvar s/occured/occurred/ in comments, log messages and man pages.
 1.10 27-Dec-2019  msaitoh s/inital/initial/
 1.9 10-Nov-2019  chs 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.8 03-Jun-2019  msaitoh Fix typo in comment (s/seperate/separate/).
 1.7 01-Jul-2011  dyoung branches: 1.7.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.6 05-Mar-2009  msaitoh Fix typo(s/interupt/interrupt/)
 1.5 05-Mar-2009  msaitoh Fix typo(s/interupt/interrupt/)
 1.4 17-Oct-2007  garbled branches: 1.4.20; 1.4.28; 1.4.34;
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 21-Jun-2007  scw branches: 1.3.10; 1.3.12;
Apply the patch, with some minor modifications, provided in:

http://mail-index.netbsd.org/port-arm/2007/06/04/0000.html

Addresses:
- an array index overflow in ixpqmgr_intr().
- ixpqmgr_sc must be initialised before calling ixp425_intr_establish().
 1.2 22-Feb-2007  thorpej branches: 1.2.4; 1.2.6; 1.2.12;
TRUE -> true, FALSE -> false
 1.1 10-Dec-2006  scw branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.1.8.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 10-Dec-2006  ad file ixp425_qmgr.c was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.4 03-Sep-2007  yamt sync with head.
 1.1.4.3 26-Feb-2007  yamt sync with head.
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 10-Dec-2006  yamt file ixp425_qmgr.c was added on branch yamt-lazymbuf on 2006-12-30 20:45:38 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 10-Dec-2006  yamt file ixp425_qmgr.c was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.2.12.1 26-Jun-2007  garbled Sync with HEAD.
 1.2.6.1 11-Jul-2007  mjf Sync with head.
 1.2.4.1 15-Jul-2007  ad Sync with head.
 1.3.12.1 06-Nov-2007  matt sync with HEAD
 1.3.10.1 01-Jan-2008  chris Sync with HEAD.
 1.4.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.4.20.1 04-May-2009  yamt sync with head.
 1.7.54.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.7.54.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.7.54.1 10-Jun-2019  christos Sync with HEAD
 1.1 10-Dec-2006  scw branches: 1.1.2; 1.1.4; 1.1.6;
Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 10-Dec-2006  ad file ixp425_qmgr.h was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 10-Dec-2006  yamt file ixp425_qmgr.h was added on branch yamt-lazymbuf on 2006-12-30 20:45:38 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 10-Dec-2006  yamt file ixp425_qmgr.h was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.15 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.14 24-Apr-2021  thorpej branches: 1.14.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.13 14-Oct-2012  msaitoh branches: 1.13.52;
struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.12 01-Jul-2011  dyoung branches: 1.12.2; 1.12.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.11 21-Oct-2009  rmind Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.10 10-Apr-2006  simonb branches: 1.10.68;
Tab Police.
 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 26-Aug-2005  drochner s/locdesc_t/int/g
 1.7 30-Jun-2005  drochner branches: 1.7.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.6 16-Nov-2003  scw - Remove ixpsip_bs_tag (ixp425_sip_io.c). It just duplicated some of
the functionality of ixp425_bs_tag.
- Add missing stream_{read,write}_1 ops to ixp425_bs_tag.
- Re-work the delay() implementation to use the free-running Time-
Stamp counter. This removes the need to bootstrap TMR0 early on.
 1.5 02-Nov-2003  scw It makes more sense to map the expansion bus registers in ixpsip
instead of the pci bridge driver.
 1.4 08-Oct-2003  scw Make it easier to support different types of IXP425 board:

- Move board-specific PCI/GPIO initialisation to its rightful place.

- Handle clearing down latched GPIO interrupts in a board-independent way.

- Use MI com(4) driver for on-chip UARTs.

- Misc. tidying up.

Tested on IXDP425.
 1.3 01-Jun-2003  ichiro branches: 1.3.2;
change into the form KNF
 1.2 01-Jun-2003  ichiro add console unit number to configuration parameter.
move structure of uart information
 1.1 23-May-2003  ichiro support IXP425 Intel Network Processor
running on BigEndian
 1.3.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.2.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.68.1 11-Mar-2010  yamt sync with head
 1.12.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.12.2.1 30-Oct-2012  yamt sync with head
 1.13.52.6 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.13.52.5 05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.13.52.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.13.52.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.13.52.2 21-Mar-2021  thorpej CFARG_IATTR usage audit:

If a device carries only one interface attribute, there is no need
to specify it when calling config_search(); that specification is
meant only to disambiguate which interface attribute (which is a
proxy for "what kind of attach args are being used") is having
children attached. cfparent_match() will take care of ensuring that
any potential children can attach to one of the parent's iterface
attributes, and if the parent only carries one, no disambiguation is
necessary.
 1.13.52.1 20-Mar-2021  thorpej The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.14.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.4 16-Nov-2003  scw - Remove ixpsip_bs_tag (ixp425_sip_io.c). It just duplicated some of
the functionality of ixp425_bs_tag.
- Add missing stream_{read,write}_1 ops to ixp425_bs_tag.
- Re-work the delay() implementation to use the free-running Time-
Stamp counter. This removes the need to bootstrap TMR0 early on.
 1.3 02-Nov-2003  scw Add generic read/write region 1 ops.
 1.2 01-Jun-2003  ichiro branches: 1.2.2;
change into the form KNF
 1.1 23-May-2003  ichiro support IXP425 Intel Network Processor
running on BigEndian
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7 14-Oct-2012  msaitoh struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.6 01-Jul-2011  dyoung branches: 1.6.2; 1.6.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.5 21-Oct-2009  rmind Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.4 11-Dec-2005  christos branches: 1.4.80;
merge ktrace-lwp.
 1.3 02-Nov-2003  scw It makes more sense to map the expansion bus registers in ixpsip
instead of the pci bridge driver.
 1.2 01-Jun-2003  ichiro branches: 1.2.2;
add console unit number to configuration parameter.
move structure of uart information
 1.1 23-May-2003  ichiro support IXP425 Intel Network Processor
running on BigEndian
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.80.1 11-Mar-2010  yamt sync with head
 1.6.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.6.2.1 30-Oct-2012  yamt sync with head
 1.10 21-Apr-2023  skrll Trailing whitespace
 1.9 16-Mar-2018  ryo use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
 1.8 01-Jul-2011  dyoung branches: 1.8.52;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.7 21-Oct-2009  rmind Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.6 10-Apr-2006  simonb branches: 1.6.68;
Tab Police.
 1.5 24-Nov-2005  yamt branches: 1.5.4; 1.5.6; 1.5.8; 1.5.10; 1.5.12;
bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
 1.4 01-Apr-2005  yamt branches: 1.4.2; 1.4.8;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.3 16-Nov-2003  scw branches: 1.3.4; 1.3.10; 1.3.12;
- Remove ixpsip_bs_tag (ixp425_sip_io.c). It just duplicated some of
the functionality of ixp425_bs_tag.
- Add missing stream_{read,write}_1 ops to ixp425_bs_tag.
- Re-work the delay() implementation to use the free-running Time-
Stamp counter. This removes the need to bootstrap TMR0 early on.
 1.2 23-Oct-2003  scw Use pmap_enter() instead of pmap_kenter_pa() as the former automatically
ensures the mapping is cache-inhibited, so we don't have to frob the PTE
directly.
 1.1 25-Sep-2003  ichiro pci bus support
 1.3.12.1 28-Jan-2005  yamt convert arch/arm to new apis.
 1.3.10.1 29-Apr-2005  kent sync with -current
 1.3.4.6 11-Dec-2005  christos Sync with head.
 1.3.4.5 01-Apr-2005  skrll Sync with HEAD.
 1.3.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.3.4.2 03-Aug-2004  skrll Sync with HEAD
 1.3.4.1 16-Nov-2003  skrll file ixp425_space.c was added on branch ktrace-lwp on 2004-08-03 10:32:58 +0000
 1.4.8.1 29-Nov-2005  yamt sync with head.
 1.4.2.1 21-Jun-2006  yamt sync with head.
 1.5.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.5.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.5.8.1 11-Apr-2006  yamt sync with head
 1.5.6.1 22-Apr-2006  simonb Sync with head.
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.6.68.1 11-Mar-2010  yamt sync with head
 1.8.52.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.20 29-May-2020  rin For struct timecounter, use C99 initializers.
Compile tested. No functional changes intended.
 1.19 12-Jul-2018  maxv Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.
 1.18 12-Nov-2012  skrll branches: 1.18.36; 1.18.38;
C99 types
 1.17 14-Oct-2012  msaitoh struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.16 01-Jul-2011  dyoung branches: 1.16.2; 1.16.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.15 21-Oct-2009  rmind Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.14 20-Jan-2008  joerg branches: 1.14.10;
Convert evbarm to timecounter. Only one of the systems was tested, the
rest of the patch is compile-time tested only.
 1.13 06-Jan-2007  christos branches: 1.13.20; 1.13.24; 1.13.26; 1.13.32; 1.13.38;
Add generic TOD support. From Bucky Katz.
 1.12 10-Sep-2006  gdamore branches: 1.12.4;
First pass at enabling a lot of ARM ports to convert swiftly to
__HAVE_GENERIC_TODR. Just put #define __HAVE_GENERIC_TODR in types.h
if your port uses one of these files.
 1.11 10-Apr-2006  simonb branches: 1.11.8;
Tab Police.
 1.10 04-Mar-2006  scw branches: 1.10.2; 1.10.4; 1.10.6;
Allow the kernel config file to override the default timer frequency
using "options IXP425_CLOCK_FREQ".
 1.9 11-Dec-2005  christos branches: 1.9.4; 1.9.6;
merge ktrace-lwp.
 1.8 04-Jun-2005  he branches: 1.8.2;
Fix shadowing warning.
 1.7 04-Jun-2005  he Fix the various todr_gettime() and todr_settime() fallouts from
-Wcast-qual differently, by instead changing the signatore of those
"functions" to take a "volatile struct timeval*" instead of a
"struct timeval*". Many places, these functions are called with
&time, and time is declared as volatile in <sys/kernel.h>. This
way we can get rid of all the ugly casts which now also triggered
warnings, and caused more code to be added to work around the
problem.

Reviewed by thorpej.
 1.6 26-Feb-2005  simonb Watch out for those unexpected tains.
 1.5 16-Nov-2003  scw branches: 1.5.8; 1.5.10;
- Remove ixpsip_bs_tag (ixp425_sip_io.c). It just duplicated some of
the functionality of ixp425_bs_tag.
- Add missing stream_{read,write}_1 ops to ixp425_bs_tag.
- Re-work the delay() implementation to use the free-running Time-
Stamp counter. This removes the need to bootstrap TMR0 early on.
 1.4 08-Oct-2003  scw Make it easier to support different types of IXP425 board:

- Move board-specific PCI/GPIO initialisation to its rightful place.

- Handle clearing down latched GPIO interrupts in a board-independent way.

- Use MI com(4) driver for on-chip UARTs.

- Misc. tidying up.

Tested on IXDP425.
 1.3 27-Jul-2003  thorpej Fix think'o in last. Pointed out by Izumi Tsutsui.
 1.2 26-Jul-2003  thorpej Flesh out inittodr() and resettodr().
 1.1 23-May-2003  ichiro branches: 1.1.2;
support IXP425 Intel Network Processor
running on BigEndian
 1.1.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 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.5.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.8.1 29-Apr-2005  kent sync with -current
 1.8.2.4 21-Jan-2008  yamt sync with head
 1.8.2.3 26-Feb-2007  yamt sync with head.
 1.8.2.2 30-Dec-2006  yamt sync with head.
 1.8.2.1 21-Jun-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.6.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.10.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.10.2.2 14-Sep-2006  yamt sync with head.
 1.10.2.1 11-Apr-2006  yamt sync with head
 1.11.8.2 12-Jan-2007  ad Sync with head.
 1.11.8.1 18-Nov-2006  ad Sync with head.
 1.12.4.1 30-Apr-2007  bouyer Pull up following revision(s) (requested by rearnsha in ticket #592):
sys/arch/arm/footbridge/footbridgevar.h: revision 1.5
sys/arch/arm/ep93xx/epclk.c: revision 1.10
sys/arch/arm/ixp12x0/ixp12x0_clk.c: revision 1.11
sys/arch/arm/footbridge/footbridge.c: revision 1.17
sys/arch/arm/footbridge/isa/dsrtc.c: revision 1.10
sys/arch/arm/s3c2xx0/s3c2800_clk.c: revision 1.10
sys/arch/arm/xscale/ixp425_timer.c: revision 1.13
sys/arch/arm/xscale/becc_timer.c: revision 1.11
sys/arch/arm/xscale/i80321_timer.c: revision 1.16
sys/arch/arm/s3c2xx0/s3c24x0_clk.c: revision 1.7
Add generic TOD support. From Bucky Katz.
 1.13.38.1 20-Jan-2008  bouyer Sync with HEAD
 1.13.32.1 18-Feb-2008  mjf Sync with HEAD.
 1.13.26.1 23-Mar-2008  matt sync with HEAD
 1.13.24.1 27-Jan-2008  chris Sync to HEAD.
 1.13.20.1 28-Feb-2008  rjs Sync with HEAD.
 1.14.10.1 11-Mar-2010  yamt sync with head
 1.16.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.16.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.16.2.1 30-Oct-2012  yamt sync with head
 1.18.38.1 10-Jun-2019  christos Sync with HEAD
 1.18.36.1 28-Jul-2018  pgoyette Sync with HEAD
 1.4 14-Oct-2012  msaitoh struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.3 01-Jul-2011  dyoung branches: 1.3.2; 1.3.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 10-Dec-2006  scw branches: 1.1.2; 1.1.4; 1.1.6; 1.1.52; 1.1.54; 1.1.56;
Support the IXP425 watchdog timer.
 1.1.56.1 16-May-2008  yamt sync with head.
 1.1.54.1 18-May-2008  yamt sync with head.
 1.1.52.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 10-Dec-2006  ad file ixp425_wdog.c was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 10-Dec-2006  yamt file ixp425_wdog.c was added on branch yamt-lazymbuf on 2006-12-30 20:45:38 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 10-Dec-2006  yamt file ixp425_wdog.c was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.3.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3.2.1 30-Oct-2012  yamt sync with head
 1.23 12-Feb-2020  thorpej Correct the location of SDRAM in the comment describing the IXP425
memory map. SDRAM is located at 0x00000000 and has aliases at 0x10000000,
0x20000000, and 0x30000000.
 1.22 12-Nov-2012  skrll branches: 1.22.38; 1.22.44;
C99 types
 1.21 21-Oct-2009  rmind branches: 1.21.12; 1.21.22;
Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.20 10-Dec-2006  scw branches: 1.20.50;
Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.19 11-Dec-2005  christos branches: 1.19.20; 1.19.22;
merge ktrace-lwp.
 1.18 13-Feb-2004  scw branches: 1.18.16;
Avoid using two 'GPIO' bits of the interrupt mask to signify soft
interrupts; some boards actually use those GPIO pins as external
interrupt sources.

Instead, assign soft interrupt bits to on-chip sources which are
not used by the IXP425 port.
 1.17 08-Dec-2003  scw Scoot the SDRAM controller's mapping forward to the next 1MB boundary
so it can be mapped easily at startup.
 1.16 08-Dec-2003  scw Add support for picking up the size of SDRAM by reading the memory
controller's config register.
 1.15 08-Dec-2003  scw Oops, map PCI memory space at VA 0xf8000000 instead of in the middle
of user VM space at 0x48000000.
 1.14 16-Nov-2003  scw - Remove ixpsip_bs_tag (ixp425_sip_io.c). It just duplicated some of
the functionality of ixp425_bs_tag.
- Add missing stream_{read,write}_1 ops to ixp425_bs_tag.
- Re-work the delay() implementation to use the free-running Time-
Stamp counter. This removes the need to bootstrap TMR0 early on.
 1.13 23-Oct-2003  scw Add a few more register definitions.
 1.12 08-Oct-2003  scw Make it easier to support different types of IXP425 board:

- Move board-specific PCI/GPIO initialisation to its rightful place.

- Handle clearing down latched GPIO interrupts in a board-independent way.

- Use MI com(4) driver for on-chip UARTs.

- Misc. tidying up.

Tested on IXDP425.
 1.11 25-Sep-2003  ichiro add comment and delete unused definition
 1.10 25-Sep-2003  ichiro pci bus support
 1.9 02-Jul-2003  ichiro add sdram configration register
 1.8 02-Jul-2003  ichiro backout to recent changes w/o lwp changes
 1.7 29-Jun-2003  fvdl branches: 1.7.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.6 29-Jun-2003  ichiro struct proc * -> struct lwp *

ixp425_com:
add some status flags
 1.5 03-Jun-2003  ichiro fix interrupt number
swap uart0 and uart1
 1.4 02-Jun-2003  ichiro add pci configuration register and commands
 1.3 31-May-2003  ichiro bug fix
 1.2 24-May-2003  ichiro add registers
Performance Monitoring Unit - Coprocessor14
 1.1 23-May-2003  ichiro support IXP425 Intel Network Processor
running on BigEndian
 1.7.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.18.16.1 30-Dec-2006  yamt sync with head.
 1.19.22.1 18-Dec-2006  yamt sync with head.
 1.19.20.1 12-Jan-2007  ad Sync with head.
 1.20.50.1 11-Mar-2010  yamt sync with head
 1.21.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.21.12.1 16-Jan-2013  yamt sync with (a bit old) head
 1.22.44.1 29-Feb-2020  ad Sync with head.
 1.22.38.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.16 12-Nov-2012  skrll C99 types
 1.15 14-Oct-2012  msaitoh struct device * -> device_t for IXP4xx (and nslu2).
Tested with my NSLU2.
 1.14 28-Sep-2012  ryo Defer attaching interrupt evcnts in the same way as i80321.c by matt@
 1.13 01-Jul-2011  dyoung branches: 1.13.2; 1.13.8; 1.13.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.12 21-Oct-2009  rmind Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.11 10-Dec-2006  scw branches: 1.11.50;
Add a port of Sam Leffler's IXP425 micro-engine support (from FreeBSD).

This is very much a work in progress. At the present time, only Ethernet
is supported.
 1.10 10-Apr-2006  simonb branches: 1.10.8; 1.10.10;
Tab Police.
 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 08-Dec-2003  scw branches: 1.8.16;
Add support for picking up the size of SDRAM by reading the memory
controller's config register.
 1.7 02-Nov-2003  scw It makes more sense to map the expansion bus registers in ixpsip
instead of the pci bridge driver.
 1.6 23-Oct-2003  scw Map the expansion bus registers.
 1.5 08-Oct-2003  scw Make it easier to support different types of IXP425 board:

- Move board-specific PCI/GPIO initialisation to its rightful place.

- Handle clearing down latched GPIO interrupts in a board-independent way.

- Use MI com(4) driver for on-chip UARTs.

- Misc. tidying up.

Tested on IXDP425.
 1.4 25-Sep-2003  ichiro pci bus support
 1.3 02-Jul-2003  ichiro use struct pmap_devmap
 1.2 24-May-2003  ichiro branches: 1.2.2;
add IXDP425 PCI interrupt
fix some typo
 1.1 23-May-2003  ichiro support IXP425 Intel Network Processor
running on BigEndian
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8.16.2 30-Dec-2006  yamt sync with head.
 1.8.16.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.10.1 18-Dec-2006  yamt sync with head.
 1.10.8.1 12-Jan-2007  ad Sync with head.
 1.11.50.1 11-Mar-2010  yamt sync with head
 1.13.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.13.8.1 17-Oct-2012  riz Pull up following revision(s) (requested by tsutsui in ticket #600):
sys/arch/arm/xscale/ixp425_intr.c: revision 1.24
sys/arch/evbarm/ixdp425/ixdp425_mainbus.c: revision 1.8
sys/arch/evbarm/nslu2/nslu2_mainbus.c: revision 1.3
sys/arch/arm/xscale/ixp425var.h: revision 1.14
Defer attaching interrupt evcnts in the same way as i80321.c by matt@
 1.13.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.13.2.1 30-Oct-2012  yamt sync with head
 1.24 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.23 24-Apr-2021  thorpej branches: 1.23.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.22 12-Nov-2012  skrll branches: 1.22.52;
C99 types
 1.21 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.20 01-Jul-2011  dyoung branches: 1.20.2; 1.20.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.19 09-Jun-2011  nonaka - device_t/softc split.
- use aprint_* function.
 1.18 09-Aug-2009  kiyohara branches: 1.18.4; 1.18.10;
Fix matching by improper driver.
see http://mail-index.netbsd.org/port-arm/2009/07/08/msg000807.html

And remove some white-spaces.
 1.17 03-May-2008  martin Move TNF license to standard 2 clause variant
 1.16 21-Feb-2007  thorpej branches: 1.16.44; 1.16.46; 1.16.48;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
 1.15 17-Dec-2006  peter branches: 1.15.2;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.14 16-Dec-2006  ober Zaurus Port from OpenBSD by Nonaka Kimihiro
OK gimpy
 1.13 14-May-2006  elad branches: 1.13.8; 1.13.10;
integrate kauth.
 1.12 10-Apr-2006  simonb Tab Police.
 1.11 24-Dec-2005  perry branches: 1.11.4; 1.11.6; 1.11.8; 1.11.10; 1.11.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.10 11-Dec-2005  christos merge ktrace-lwp.
 1.9 26-Aug-2005  drochner s/locdesc_t/int/g
 1.8 04-Jul-2005  bsh branches: 1.8.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.
 1.7 03-Jul-2005  bsh + use constants defined in xscalereg.h instead of 0x0001.
+ clear CPU cycle counter in pxaip_measure_cpuclock()
+ style.
 1.6 30-Jun-2005  drochner adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.5 12-Dec-2003  thorpej Add a default case to avoid an uninitialized variable warning.
 1.4 15-Jul-2003  lukem __KERNEL_RCSID()
 1.3 05-Jun-2003  scw branches: 1.3.2;
- Rearrange the PXA2x0 support code to better support attaching
child drivers such as interrupt and gpio controllers.
- Add a function to probe SDRAM size at boot time.
- Add a function to configure the Clock Manager's CKEN settings.
- Add an INTC driver.
- Add a GPIO driver.
- Add attach glue for the PXA2x0's "almost" 16550-compatible uarts.
- Tweak the LCD driver to use the GPIO driver's services for setting
up GPIO pin function.
 1.2 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.1 19-Oct-2002  bsh branches: 1.1.2;
Support Intel PXA250 and PXA210 application processors.
 1.1.2.3 03-Jan-2003  thorpej Sync with HEAD.
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 19-Oct-2002  nathanw file pxa2x0.c was added on branch nathanw_sa on 2002-11-11 21:56:54 +0000
 1.3.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8.2.3 26-Feb-2007  yamt sync with head.
 1.8.2.2 30-Dec-2006  yamt sync with head.
 1.8.2.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.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.11.8.1 11-Apr-2006  yamt sync with head
 1.11.6.1 22-Apr-2006  simonb Sync with head.
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.13.10.1 18-Dec-2006  yamt sync with head.
 1.13.8.1 12-Jan-2007  ad Sync with head.
 1.15.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.16.48.2 19-Aug-2009  yamt sync with head.
 1.16.48.1 16-May-2008  yamt sync with head.
 1.16.46.1 18-May-2008  yamt sync with head.
 1.16.44.1 02-Jun-2008  mjf Sync with HEAD.
 1.18.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.18.4.1 12-Jun-2011  rmind sync with head
 1.20.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.20.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.20.2.1 30-Oct-2012  yamt sync with head
 1.22.52.7 05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.22.52.6 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.22.52.5 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.22.52.4 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.22.52.3 21-Mar-2021  thorpej CFARG_IATTR usage audit:

If a device carries only one interface attribute, there is no need
to specify it when calling config_search(); that specification is
meant only to disambiguate which interface attribute (which is a
proxy for "what kind of attach args are being used") is having
children attached. cfparent_match() will take care of ensuring that
any potential children can attach to one of the parent's iterface
attributes, and if the parent only carries one, no disambiguation is
necessary.
 1.22.52.2 20-Mar-2021  thorpej No need to pass the parent softc down to the indirect submatch routine;
it's available from the parent device_t there.
 1.22.52.1 20-Mar-2021  thorpej The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.23.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 06-Jun-2012  skrll Provide generic a[24]x bus_space methods (aNx is normal access, offset
multipled by N).

Use the generic method and delete the other versions.

Discussed with matt@
 1.1 19-Oct-2002  bsh branches: 1.1.2; 1.1.150; 1.1.156;
Support Intel PXA250 and PXA210 application processors.
 1.1.156.1 10-Aug-2012  jdc Pull up revisions:
src/sys/arch/arm/arm/bus_space_a2x.S revision 1.1
src/sys/arch/arm/arm/bus_space_a4x.S revision 1.1
src/sys/arch/arm/gemini/files.gemini revision 1.12
src/sys/arch/arm/mpcore/files.mpcore revision 1.2
src/sys/arch/arm/mpcore/mpcore_a2x_io.S delete
src/sys/arch/arm/mpcore/mpcore_a4x_io.S delete
src/sys/arch/arm/omap/files.omap revision 1.6
src/sys/arch/arm/omap/files.omap2 revision 1.9
src/sys/arch/arm/omap/omap_a2x_io.S delete
src/sys/arch/arm/xscale/files.pxa2x0 revision 1.18
src/sys/arch/arm/xscale/pxa2x0_a4x_io.S delete
(requested by skrll to fix ticket #454).

Provide generic a[24]x bus_space methods (aNx is normal access, offset
multipled by N).

Use the generic method and delete the other versions.

Discussed with matt@
 1.1.150.1 30-Oct-2012  yamt sync with head
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 19-Oct-2002  nathanw file pxa2x0_a4x_io.S was added on branch nathanw_sa on 2002-11-11 21:56:55 +0000
 1.6 16-Mar-2018  ryo use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
 1.5 01-Jul-2011  dyoung branches: 1.5.52;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.4 28-Jul-2006  simonb Remove a few trailing blank lines.
 1.3 11-Dec-2005  christos branches: 1.3.4; 1.3.8;
merge ktrace-lwp.
 1.2 15-Jul-2003  lukem branches: 1.2.16;
__KERNEL_RCSID()
 1.1 19-Oct-2002  bsh branches: 1.1.2; 1.1.8;
Support Intel PXA250 and PXA210 application processors.
 1.1.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.8.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 19-Oct-2002  nathanw file pxa2x0_a4x_space.c was added on branch nathanw_sa on 2002-11-11 21:56:56 +0000
 1.2.16.1 30-Dec-2006  yamt sync with head.
 1.3.8.1 11-Aug-2006  yamt sync with head
 1.3.4.1 09-Sep-2006  rpaulo sync with head
 1.5.52.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.21 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.20 06-Feb-2021  isaki Fix "locking against myself".
halt_{input,output} will be called with sc_intr_lock held.
 1.19 06-Feb-2021  isaki Calling halt_{input,output} is done by the MI audio layer if necessary.
 1.18 19-Apr-2020  isaki branches: 1.18.2;
Fix round_blocksize not to return 0.
 1.17 08-Jun-2019  isaki branches: 1.17.8;
Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.
 1.16 08-May-2019  isaki Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c
 1.15 16-Mar-2019  isaki branches: 1.15.2;
Use C99 style struct initializer to audio_hw_if.
 1.14 01-Jun-2017  chs branches: 1.14.10;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.13 12-Nov-2012  skrll branches: 1.13.14;
C99 types
 1.12 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.11 24-Nov-2011  mrg branches: 1.11.8;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.
 1.10 23-Nov-2011  jmcneill Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.
 1.9 01-Jul-2011  dyoung branches: 1.9.2; 1.9.4;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.8 09-Jun-2011  nonaka - device_t/softc split.
- use aprint_* function.
 1.7 17-Oct-2007  garbled branches: 1.7.42; 1.7.52;
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 21-Aug-2007  kiyohara branches: 1.6.2;
The initarm() should initialize GPIO. We must not initialize GPIO in
foo_attach() of the each drivers. And, it is necessary to confirm whether
to be initialized in foo_match(). To avoid a dangerous configuring on the
evaluation boards.
 1.5 04-Mar-2007  christos branches: 1.5.2; 1.5.10; 1.5.14; 1.5.16; 1.5.18; 1.5.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4 22-Feb-2007  thorpej branches: 1.4.2;
TRUE -> true, FALSE -> false
 1.3 24-Dec-2005  perry branches: 1.3.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 13-Apr-2005  scw branches: 1.1.2; 1.1.4; 1.1.10;
Add support for the DMA and AC97 controllers on PXA2x0, and enable them
on the Lubbock evaluation board.

Many thanks to Hiroyuki Bessho for testing this driver with the new
aurateconv interface, as I no longer have access to the hardware.

Contributed by Wasabi Systems, Inc.
 1.1.10.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.10.1 13-Apr-2005  skrll file pxa2x0_ac97.c was added on branch ktrace-lwp on 2005-11-10 13:55:27 +0000
 1.1.4.3 03-Sep-2007  yamt sync with head.
 1.1.4.2 26-Feb-2007  yamt sync with head.
 1.1.4.1 21-Jun-2006  yamt sync with head.
 1.1.2.2 29-Apr-2005  kent sync with -current
 1.1.2.1 13-Apr-2005  kent file pxa2x0_ac97.c was added on branch kent-audio2 on 2005-04-29 11:28:05 +0000
 1.3.26.2 12-Mar-2007  rmind Sync with HEAD.
 1.3.26.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.4.2.1 27-Feb-2007  ad Add MP locking for audio drivers.
 1.5.20.1 01-Jan-2008  chris Sync with HEAD.
 1.5.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.5.16.1 01-Nov-2007  rjs Sync with HEAD.
 1.5.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.5.10.1 03-Oct-2007  garbled Sync with HEAD
 1.5.2.1 09-Oct-2007  ad Sync with head.
 1.6.2.1 06-Nov-2007  matt sync with HEAD
 1.7.52.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.7.42.1 12-Jun-2011  rmind sync with head
 1.9.4.3 22-Nov-2011  jmcneill get rid of unused 'powerstate' callback in audio_hw_if
 1.9.4.2 20-Nov-2011  jmcneill port zaudio to audiomp api changes for real this time
 1.9.4.1 20-Nov-2011  mrg port to audiomp: alloc/free changes, get_locks support, no more IPL_AUDIO,
convert splaudio() -> sc_intr_lock usage, take sc_intr_lock in acu_intr().
 1.9.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.9.2.2 30-Oct-2012  yamt sync with head
 1.9.2.1 17-Apr-2012  yamt sync with head
 1.11.8.2 03-Dec-2017  jdolecek update from HEAD
 1.11.8.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.13.14.1 28-Aug-2017  skrll Sync with HEAD
 1.14.10.2 21-Apr-2020  martin Sync with HEAD
 1.14.10.1 10-Jun-2019  christos Sync with HEAD
 1.15.2.4 04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.15.2.3 03-May-2019  isaki Remove unnecessary header file.
 1.15.2.2 23-Apr-2019  isaki Adapt to audio2.
- XXX Need an accurate list of supported frequencies.
 1.15.2.1 21-Apr-2019  isaki Use C99 style struct initializer to audio_format.
 1.17.8.1 20-Apr-2020  bouyer Sync with HEAD
 1.18.2.1 03-Apr-2021  thorpej Sync with HEAD.
 1.9 31-Oct-2022  andvar fix various typos in comments and one output message.
 1.8 12-Feb-2022  thorpej Add inline functions to manipulate the klists that link up knotes
via kn_selnext:

- klist_init()
- klist_fini()
- klist_insert()
- klist_remove()

These provide some API insulation from the implementation details of these
lists (but not completely; see vn_knote_attach() and vn_knote_detach()).
Currently just a wrapper around SLIST(9).

This will make it significantly easier to switch kn_selnext linkage
to a different kind of list.
 1.7 26-Sep-2021  thorpej Driver "kqfilter" entry points return an error code, so if an invalid
filter is requested, return EINVAL rather than 1.
 1.6 26-Sep-2021  thorpej Change the kqueue filterops::f_isfd field to filterops::f_flags, and
define a flag FILTEROP_ISFD that has the meaning of the prior f_isfd.
Field and flag name aligned with OpenBSD.

This does not constitute a functional or ABI change, as the field location
and size, and the value placed in that field, are the same as the previous
code, but we're bumping __NetBSD_Version__ so 3rd-party module source code
can adapt, as needed.

NetBSD 9.99.89
 1.5 30-Oct-2020  christos c99 struct initializers
 1.4 12-Nov-2012  skrll C99 types
 1.3 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.2 05-Dec-2009  pooka branches: 1.2.12; 1.2.22;
Convert tsleep(&lbolt) to kpause(). Make ltsleep/mtsleep on lbolt
illegal. I examined all places where lbolt is referenced to make
sure there were pointer aliases of it passed to tsleep, but put a
KASSERT in m/ltsleep() just to be sure.
 1.1 06-Dec-2008  ober branches: 1.1.4; 1.1.6; 1.1.8; 1.1.12;
Initial apm support for Zaurus. Ported from OpenBSD by mjf@.
 1.1.12.3 11-Mar-2010  yamt sync with head
 1.1.12.2 04-May-2009  yamt sync with head.
 1.1.12.1 06-Dec-2008  yamt file pxa2x0_apm.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:45 +0000
 1.1.8.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.8.1 06-Dec-2008  skrll file pxa2x0_apm.c was added on branch nick-hppapmap on 2009-01-19 13:16:00 +0000
 1.1.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.6.1 06-Dec-2008  mjf file pxa2x0_apm.c was added on branch mjf-devfs2 on 2009-01-17 13:27:54 +0000
 1.1.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.1.4.1 06-Dec-2008  haad file pxa2x0_apm.c was added on branch haad-dm on 2008-12-13 01:13:03 +0000
 1.2.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.12.2 16-Jan-2013  yamt sync with (a bit old) head
 1.2.12.1 30-Oct-2012  yamt sync with head
 1.3 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.2 01-Jul-2011  dyoung branches: 1.2.2; 1.2.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.1 06-Dec-2008  ober branches: 1.1.4; 1.1.6; 1.1.8; 1.1.12;
Initial APM support for Zaurus. Ported from OpenBSD by mjf@
 1.1.12.2 04-May-2009  yamt sync with head.
 1.1.12.1 06-Dec-2008  yamt file pxa2x0_apm.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:45 +0000
 1.1.8.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.8.1 06-Dec-2008  skrll file pxa2x0_apm.h was added on branch nick-hppapmap on 2009-01-19 13:16:00 +0000
 1.1.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.6.1 06-Dec-2008  mjf file pxa2x0_apm.h was added on branch mjf-devfs2 on 2009-01-17 13:27:54 +0000
 1.1.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.1.4.1 06-Dec-2008  haad file pxa2x0_apm.h was added on branch haad-dm on 2008-12-13 01:13:03 +0000
 1.2.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.2.1 30-Oct-2012  yamt sync with head
 1.3 18-Aug-2013  matt Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>
 1.2 12-Nov-2012  skrll branches: 1.2.2;
C99 types
 1.1 06-Dec-2008  ober branches: 1.1.4; 1.1.6; 1.1.8; 1.1.12; 1.1.24; 1.1.34;
Initial APM support for Zaurus. Ported from OpenBSD by mjf@
 1.1.34.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.34.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.24.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.1.24.1 16-Jan-2013  yamt sync with (a bit old) head
 1.1.12.2 04-May-2009  yamt sync with head.
 1.1.12.1 06-Dec-2008  yamt file pxa2x0_apm_asm.S was added on branch yamt-nfs-mp on 2009-05-04 08:10:45 +0000
 1.1.8.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.8.1 06-Dec-2008  skrll file pxa2x0_apm_asm.S was added on branch nick-hppapmap on 2009-01-19 13:16:00 +0000
 1.1.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.6.1 06-Dec-2008  mjf file pxa2x0_apm_asm.S was added on branch mjf-devfs2 on 2009-01-17 13:27:54 +0000
 1.1.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.1.4.1 06-Dec-2008  haad file pxa2x0_apm_asm.S was added on branch haad-dm on 2008-12-13 01:13:03 +0000
 1.2.2.1 28-Aug-2013  rmind sync with head
 1.14 08-Dec-2018  thorpej Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.13 01-Jul-2011  dyoung branches: 1.13.52; 1.13.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.12 06-Dec-2009  kiyohara Enable UART clock in pxauart_attach().
 1.11 04-Aug-2009  kiyohara Fix GPIO configurations.
http://mail-index.netbsd.org/port-arm/2009/07/08/msg000807.html
3. I misstake sinse 2007/08/21.
:

Details:
Remove hwuart_gpioconf. PXA270 not have HWUART.
Add ohci_gpioconf. However all selectable.
Fix pSKTSEL of pcic is selectable.
Fix MMDAT<1-3> of mci is optional.
 1.10 14-Mar-2008  cube branches: 1.10.4;
Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend). Use proper types and ansify where appropriate.
 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 21-Aug-2007  kiyohara branches: 1.8.2;
The initarm() should initialize GPIO. We must not initialize GPIO in
foo_attach() of the each drivers. And, it is necessary to confirm whether
to be initialized in foo_match(). To avoid a dangerous configuring on the
evaluation boards.
 1.7 10-Dec-2006  kiyohara branches: 1.7.6; 1.7.14; 1.7.18; 1.7.20; 1.7.22; 1.7.24;
Add definition the HWUART (and NSSP).
 1.6 13-Jul-2006  gdamore branches: 1.6.4; 1.6.6;
Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@. Fixes PR port-evbmips/32362.
 1.5 11-Dec-2005  christos branches: 1.5.4; 1.5.8; 1.5.16;
merge ktrace-lwp.
 1.4 15-Jul-2003  lukem branches: 1.4.16;
__KERNEL_RCSID()
 1.3 18-Jun-2003  bsh branches: 1.3.2;
enable BTUART
 1.2 14-Jun-2003  thorpej Introduce a new "type" field in the softc which is used to indicate
the general UART type. Currently, we have "normal", "hayesp" and
"pxa2x0" types. Replace the corresponding hw flags with the new type
values.
 1.1 05-Jun-2003  scw - Rearrange the PXA2x0 support code to better support attaching
child drivers such as interrupt and gpio controllers.
- Add a function to probe SDRAM size at boot time.
- Add a function to configure the Clock Manager's CKEN settings.
- Add an INTC driver.
- Add a GPIO driver.
- Add attach glue for the PXA2x0's "almost" 16550-compatible uarts.
- Tweak the LCD driver to use the GPIO driver's services for setting
up GPIO pin function.
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.16.3 17-Mar-2008  yamt sync with head.
 1.4.16.2 03-Sep-2007  yamt sync with head.
 1.4.16.1 30-Dec-2006  yamt sync with head.
 1.5.16.1 20-Jun-2006  gdamore Add support for pretty much all ARM com(4) variants. There are a few ARM
serial devices that are not com(4)-like enough to be supported under com(4).
 1.5.8.1 11-Aug-2006  yamt sync with head
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.6.6.1 18-Dec-2006  yamt sync with head.
 1.6.4.1 12-Jan-2007  ad Sync with head.
 1.7.24.2 21-Mar-2008  chris Sync with head.
 1.7.24.1 01-Jan-2008  chris Sync with HEAD.
 1.7.22.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.7.20.1 01-Nov-2007  rjs Sync with HEAD.
 1.7.18.1 03-Sep-2007  skrll Sync with HEAD.
 1.7.14.1 03-Oct-2007  garbled Sync with HEAD
 1.7.6.1 09-Oct-2007  ad 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.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 19-Aug-2009  yamt sync with head.
 1.13.54.1 10-Jun-2019  christos Sync with HEAD
 1.13.52.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.7 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.6 18-Sep-2012  matt Add bounce buffer support for ARM bus_dma(9). Add macros to help initialize
bus_dma_tag structures.
 1.5 01-Jul-2011  dyoung branches: 1.5.2; 1.5.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 07-Aug-2003  bsh make this compile again. (arm32_bus_dma_tag._cookie)
 1.2 15-Jul-2003  lukem __KERNEL_RCSID()
 1.1 19-Oct-2002  bsh branches: 1.1.2; 1.1.8;
Support Intel PXA250 and PXA210 application processors.
 1.1.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.8.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 19-Oct-2002  nathanw file pxa2x0_dma.c was added on branch nathanw_sa on 2002-11-11 21:56:56 +0000
 1.5.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.2.1 30-Oct-2012  yamt sync with head
 1.14 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.13 05-Feb-2015  nonaka branches: 1.13.16; 1.13.18;
Don't write DMAC_DINT register on PXA270, because read-only register.
 1.12 12-Nov-2012  skrll branches: 1.12.14;
C99 types
 1.11 07-Sep-2012  matt branches: 1.11.2;
Forgot to commit this.
 1.10 29-Jan-2012  tsutsui Handle PXA25x specific DMAC constraints. From kiyohara@.
 1.9 23-Nov-2011  jmcneill branches: 1.9.2;
Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.
 1.8 01-Jul-2011  dyoung branches: 1.8.2; 1.8.4;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.7 09-Jun-2011  nonaka - device_t/softc split.
- use aprint_* function.
 1.6 16-Mar-2009  nonaka branches: 1.6.4; 1.6.10;
set DALGN register when address is misaligned (PXA27x only).
 1.5 04-Mar-2007  christos branches: 1.5.46; 1.5.54; 1.5.60;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.3 24-Dec-2005  perry branches: 1.3.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 13-Apr-2005  scw branches: 1.1.2; 1.1.4; 1.1.10;
Add support for the DMA and AC97 controllers on PXA2x0, and enable them
on the Lubbock evaluation board.

Many thanks to Hiroyuki Bessho for testing this driver with the new
aurateconv interface, as I no longer have access to the hardware.

Contributed by Wasabi Systems, Inc.
 1.1.10.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.10.1 13-Apr-2005  skrll file pxa2x0_dmac.c was added on branch ktrace-lwp on 2005-11-10 13:55:27 +0000
 1.1.4.3 03-Sep-2007  yamt sync with head.
 1.1.4.2 26-Feb-2007  yamt sync with head.
 1.1.4.1 21-Jun-2006  yamt sync with head.
 1.1.2.2 29-Apr-2005  kent sync with -current
 1.1.2.1 13-Apr-2005  kent file pxa2x0_dmac.c was added on branch kent-audio2 on 2005-04-29 11:28:05 +0000
 1.3.26.2 12-Mar-2007  rmind Sync with HEAD.
 1.3.26.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.5.60.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.54.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.46.1 04-May-2009  yamt sync with head.
 1.6.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.6.4.1 12-Jun-2011  rmind sync with head
 1.8.4.1 20-Nov-2011  jmcneill port zaudio to audiomp api changes for real this time
 1.8.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.8.2.2 30-Oct-2012  yamt sync with head
 1.8.2.1 17-Apr-2012  yamt sync with head
 1.9.2.1 18-Feb-2012  mrg merge to -current.
 1.11.2.2 03-Dec-2017  jdolecek update from HEAD
 1.11.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.12.14.1 06-Apr-2015  skrll Sync with HEAD
 1.13.18.1 10-Jun-2019  christos Sync with HEAD
 1.13.16.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4 23-Nov-2011  jmcneill Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.
 1.3 21-Feb-2007  thorpej branches: 1.3.82; 1.3.84;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
 1.2 11-Dec-2005  christos branches: 1.2.26;
merge ktrace-lwp.
 1.1 13-Apr-2005  scw branches: 1.1.2; 1.1.4; 1.1.10;
Add support for the DMA and AC97 controllers on PXA2x0, and enable them
on the Lubbock evaluation board.

Many thanks to Hiroyuki Bessho for testing this driver with the new
aurateconv interface, as I no longer have access to the hardware.

Contributed by Wasabi Systems, Inc.
 1.1.10.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.10.1 13-Apr-2005  skrll file pxa2x0_dmac.h was added on branch ktrace-lwp on 2005-11-10 13:55:27 +0000
 1.1.4.1 26-Feb-2007  yamt sync with head.
 1.1.2.2 29-Apr-2005  kent sync with -current
 1.1.2.1 13-Apr-2005  kent file pxa2x0_dmac.h was added on branch kent-audio2 on 2005-04-29 11:28:05 +0000
 1.2.26.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.3.84.1 20-Nov-2011  jmcneill port zaudio to audiomp api changes for real this time
 1.3.82.1 17-Apr-2012  yamt sync with head
 1.21 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.20 24-Apr-2021  thorpej branches: 1.20.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.19 20-Nov-2020  thorpej branches: 1.19.2;
malloc(9) -> kmem(9)
 1.18 10-Nov-2019  chs branches: 1.18.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.17 16-Jun-2017  pgoyette branches: 1.17.6;
Add gpio support for Xscale

From Stephan Meisenger in PR/52163
 1.16 12-Nov-2012  skrll branches: 1.16.14;
C99 types
 1.15 01-Jul-2011  dyoung branches: 1.15.2; 1.15.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.14 09-Jun-2011  nonaka - device_t/softc split.
- use aprint_* function.
 1.13 04-Aug-2009  kiyohara branches: 1.13.4; 1.13.10;
Fix GPIO configurations.
http://mail-index.netbsd.org/port-arm/2009/07/08/msg000807.html
3. I misstake sinse 2007/08/21.
:

Details:
Remove hwuart_gpioconf. PXA270 not have HWUART.
Add ohci_gpioconf. However all selectable.
Fix pSKTSEL of pcic is selectable.
Fix MMDAT<1-3> of mci is optional.
 1.12 17-Dec-2008  cegger kill MALLOC and FREE macros.
 1.11 07-Nov-2008  rafal Remove parameter checks from under DEBUG; bad gpio pin numbers will cause
the kernel to fall over rather quickly anyway with memory faults, so a panic
with a hint as to what's wrong seems much better.
 1.10 24-Apr-2008  nonaka branches: 1.10.2; 1.10.8; 1.10.10;
fix typo.
 1.9 17-Oct-2007  garbled branches: 1.9.16; 1.9.18;
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 21-Aug-2007  kiyohara branches: 1.8.2;
The initarm() should initialize GPIO. We must not initialize GPIO in
foo_attach() of the each drivers. And, it is necessary to confirm whether
to be initialized in foo_match(). To avoid a dangerous configuring on the
evaluation boards.
 1.7 17-Dec-2006  peter branches: 1.7.6; 1.7.14; 1.7.18; 1.7.20; 1.7.22; 1.7.24;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.6 16-Dec-2006  ober Zaurus Port from OpenBSD by Nonaka Kimihiro
OK gimpy
 1.5 24-Dec-2005  perry branches: 1.5.20; 1.5.22;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 04-Jul-2005  bsh branches: 1.3.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.
 1.2 15-Jul-2003  lukem __KERNEL_RCSID()
 1.1 05-Jun-2003  scw branches: 1.1.2;
- Rearrange the PXA2x0 support code to better support attaching
child drivers such as interrupt and gpio controllers.
- Add a function to probe SDRAM size at boot time.
- Add a function to configure the Clock Manager's CKEN settings.
- Add an INTC driver.
- Add a GPIO driver.
- Add attach glue for the PXA2x0's "almost" 16550-compatible uarts.
- Tweak the LCD driver to use the GPIO driver's services for setting
up GPIO pin function.
 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.3 03-Sep-2007  yamt sync with head.
 1.3.2.2 30-Dec-2006  yamt sync with head.
 1.3.2.1 21-Jun-2006  yamt sync with head.
 1.5.22.1 18-Dec-2006  yamt sync with head.
 1.5.20.1 12-Jan-2007  ad Sync with head.
 1.7.24.1 01-Jan-2008  chris Sync with HEAD.
 1.7.22.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.7.20.1 01-Nov-2007  rjs Sync with HEAD.
 1.7.18.1 03-Sep-2007  skrll Sync with HEAD.
 1.7.14.1 03-Oct-2007  garbled Sync with HEAD
 1.7.6.1 09-Oct-2007  ad Sync with head.
 1.8.2.1 06-Nov-2007  matt sync with HEAD
 1.9.18.1 18-May-2008  yamt sync with head.
 1.9.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.9.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.10.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.10.2.2 19-Aug-2009  yamt sync with head.
 1.10.2.1 04-May-2009  yamt sync with head.
 1.13.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.13.4.1 12-Jun-2011  rmind sync with head
 1.15.12.2 03-Dec-2017  jdolecek update from HEAD
 1.15.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.15.2.1 16-Jan-2013  yamt sync with (a bit old) head
 1.16.14.1 28-Aug-2017  skrll Sync with HEAD
 1.17.6.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.18.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.19.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.20.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.5 04-Aug-2009  kiyohara Fix GPIO configurations.
http://mail-index.netbsd.org/port-arm/2009/07/08/msg000807.html
3. I misstake sinse 2007/08/21.
:

Details:
Remove hwuart_gpioconf. PXA270 not have HWUART.
Add ohci_gpioconf. However all selectable.
Fix pSKTSEL of pcic is selectable.
Fix MMDAT<1-3> of mci is optional.
 1.4 24-Jun-2008  chris Change $wasabi$ to $NetBSD$ so that we get version info into the file.
 1.3 21-Aug-2007  kiyohara branches: 1.3.22; 1.3.26; 1.3.28; 1.3.30;
The initarm() should initialize GPIO. We must not initialize GPIO in
foo_attach() of the each drivers. And, it is necessary to confirm whether
to be initialized in foo_match(). To avoid a dangerous configuring on the
evaluation boards.
 1.2 16-Dec-2006  ober branches: 1.2.6; 1.2.14; 1.2.18; 1.2.20; 1.2.22; 1.2.24;
Zaurus Port from OpenBSD by Nonaka Kimihiro
OK gimpy
 1.1 05-Jun-2003  scw branches: 1.1.18; 1.1.48; 1.1.50;
- Rearrange the PXA2x0 support code to better support attaching
child drivers such as interrupt and gpio controllers.
- Add a function to probe SDRAM size at boot time.
- Add a function to configure the Clock Manager's CKEN settings.
- Add an INTC driver.
- Add a GPIO driver.
- Add attach glue for the PXA2x0's "almost" 16550-compatible uarts.
- Tweak the LCD driver to use the GPIO driver's services for setting
up GPIO pin function.
 1.1.50.1 18-Dec-2006  yamt sync with head.
 1.1.48.1 12-Jan-2007  ad Sync with head.
 1.1.18.2 03-Sep-2007  yamt sync with head.
 1.1.18.1 30-Dec-2006  yamt sync with head.
 1.2.24.1 01-Jan-2008  chris Sync with HEAD.
 1.2.22.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.2.20.1 01-Nov-2007  rjs Sync with HEAD.
 1.2.18.1 03-Sep-2007  skrll Sync with HEAD.
 1.2.14.1 03-Oct-2007  garbled Sync with HEAD
 1.2.6.1 09-Oct-2007  ad Sync with head.
 1.3.30.1 27-Jun-2008  simonb Sync with head.
 1.3.28.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.26.2 19-Aug-2009  yamt sync with head.
 1.3.26.1 04-May-2009  yamt sync with head.
 1.3.22.1 29-Jun-2008  mjf Sync with HEAD.
 1.9 12-Dec-2021  andvar fix typos in word "operation(s)".
 1.8 06-Aug-2011  kiyohara Support slave mode for PXA2x0 I2C.
 1.7 23-Jun-2011  kiyohara Fix bit name ISR_UB. Not _UE.
And add comments for bit names from datasheet of PXA255.
 1.6 22-Jun-2011  kiyohara Add member sc_addr to struct pxa2x0_i2c_softc.
And use sc_addr to bus_space_map() instead of macro-directly.
 1.5 19-Jun-2011  nonaka - Split device_t/softc.
- Added some functions for i2c framework.
 1.4 20-Apr-2009  pgoyette branches: 1.4.10;
One more i2c quick_{read,write} update.
 1.3 17-Oct-2007  garbled branches: 1.3.20; 1.3.28; 1.3.34;
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 21-Aug-2007  kiyohara branches: 1.2.2;
The initarm() should initialize GPIO. We must not initialize GPIO in
foo_attach() of the each drivers. And, it is necessary to confirm whether
to be initialized in foo_match(). To avoid a dangerous configuring on the
evaluation boards.
 1.1 17-Dec-2006  peter branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.20; 1.1.24; 1.1.26; 1.1.28; 1.1.30;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.1.30.1 01-Jan-2008  chris Sync with HEAD.
 1.1.28.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.1.26.1 01-Nov-2007  rjs Sync with HEAD.
 1.1.24.1 03-Sep-2007  skrll Sync with HEAD.
 1.1.20.1 03-Oct-2007  garbled Sync with HEAD
 1.1.12.1 09-Oct-2007  ad Sync with head.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 17-Dec-2006  ad file pxa2x0_i2c.c was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.3 03-Sep-2007  yamt sync with head.
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 17-Dec-2006  yamt file pxa2x0_i2c.c was added on branch yamt-lazymbuf on 2006-12-30 20:45:38 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 17-Dec-2006  yamt file pxa2x0_i2c.c was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.2.2.1 06-Nov-2007  matt sync with HEAD
 1.3.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.20.1 04-May-2009  yamt sync with head.
 1.4.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.5 06-Aug-2011  kiyohara Support slave mode for PXA2x0 I2C.
 1.4 22-Jun-2011  kiyohara Add member sc_addr to struct pxa2x0_i2c_softc.
And use sc_addr to bus_space_map() instead of macro-directly.
 1.3 19-Jun-2011  nonaka - Split device_t/softc.
- Added some functions for i2c framework.
 1.2 20-Apr-2009  pgoyette branches: 1.2.10;
One more i2c quick_{read,write} update.
 1.1 17-Dec-2006  peter branches: 1.1.2; 1.1.4; 1.1.6; 1.1.56; 1.1.64; 1.1.70;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.1.70.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.64.1 28-Apr-2009  skrll Sync with HEAD.
 1.1.56.1 04-May-2009  yamt sync with head.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 17-Dec-2006  ad file pxa2x0_i2c.h was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 17-Dec-2006  yamt file pxa2x0_i2c.h was added on branch yamt-lazymbuf on 2006-12-30 20:45:38 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 17-Dec-2006  yamt file pxa2x0_i2c.h was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.2.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.13 08-May-2019  isaki Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c
 1.12 01-Jun-2017  chs branches: 1.12.10; 1.12.12;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.11 15-Jan-2012  nonaka branches: 1.11.6; 1.11.24;
Don't lock sc->sc_intr_lock at halt_output(), halt_input().
sc->sc_intr_lock is already locked by audio_close().
 1.10 23-Nov-2011  jmcneill branches: 1.10.2;
Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.
 1.9 01-Jul-2011  dyoung branches: 1.9.2; 1.9.4;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.8 13-Mar-2009  nonaka zaudio(4) works now.
 1.7 17-Oct-2007  garbled branches: 1.7.20; 1.7.28; 1.7.34;
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 21-Aug-2007  kiyohara branches: 1.6.2;
The initarm() should initialize GPIO. We must not initialize GPIO in
foo_attach() of the each drivers. And, it is necessary to confirm whether
to be initialized in foo_match(). To avoid a dangerous configuring on the
evaluation boards.
 1.5 26-Jun-2007  nonaka branches: 1.5.4; 1.5.6; 1.5.8; 1.5.10;
s/const const/const/
 1.4 05-Mar-2007  nonaka branches: 1.4.2; 1.4.4; 1.4.10;
Use (char *) on pointer arith.
 1.3 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.2 22-Feb-2007  thorpej TRUE -> true, FALSE -> false
 1.1 17-Dec-2006  peter branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.1.8.2 12-Mar-2007  rmind Sync with HEAD.
 1.1.8.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 17-Dec-2006  ad file pxa2x0_i2s.c was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.4 03-Sep-2007  yamt sync with head.
 1.1.4.3 26-Feb-2007  yamt sync with head.
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 17-Dec-2006  yamt file pxa2x0_i2s.c was added on branch yamt-lazymbuf on 2006-12-30 20:45:38 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 17-Dec-2006  yamt file pxa2x0_i2s.c was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.4.10.2 03-Oct-2007  garbled Sync with HEAD
 1.4.10.1 26-Jun-2007  garbled Sync with HEAD.
 1.4.4.1 11-Jul-2007  mjf Sync with head.
 1.4.2.2 09-Oct-2007  ad Sync with head.
 1.4.2.1 15-Jul-2007  ad Sync with head.
 1.5.10.1 01-Jan-2008  chris Sync with HEAD.
 1.5.8.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.5.6.1 01-Nov-2007  rjs Sync with HEAD.
 1.5.4.1 03-Sep-2007  skrll Sync with HEAD.
 1.6.2.1 06-Nov-2007  matt sync with HEAD
 1.7.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.7.20.1 04-May-2009  yamt sync with head.
 1.9.4.1 20-Nov-2011  jmcneill port zaudio to audiomp api changes for real this time
 1.9.2.1 17-Apr-2012  yamt sync with head
 1.10.2.1 18-Feb-2012  mrg merge to -current.
 1.11.24.1 28-Aug-2017  skrll Sync with HEAD
 1.11.6.1 03-Dec-2017  jdolecek update from HEAD
 1.12.12.1 24-Apr-2019  isaki Adapt zaudio family to audio2.
- wm8731 and wm8750 can share zaudio_formats[].
- Drop INDEPENDENT property. These share sample rate in play and rec.
- pxa2x0_i2s_setspeed() no longer needs to writeback sample rate.
 1.12.10.1 10-Jun-2019  christos Sync with HEAD
 1.6 08-May-2019  isaki Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c
 1.5 12-Nov-2012  skrll branches: 1.5.38; 1.5.40;
C99 types
 1.4 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.3 23-Nov-2011  jmcneill branches: 1.3.8;
Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.
 1.2 01-Jul-2011  dyoung branches: 1.2.2; 1.2.4;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.1 17-Dec-2006  peter branches: 1.1.2; 1.1.4; 1.1.6;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 17-Dec-2006  ad file pxa2x0_i2s.h was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 17-Dec-2006  yamt file pxa2x0_i2s.h was added on branch yamt-lazymbuf on 2006-12-30 20:45:38 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 17-Dec-2006  yamt file pxa2x0_i2s.h was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.2.4.1 20-Nov-2011  jmcneill port zaudio to audiomp api changes for real this time
 1.2.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.2.2.2 30-Oct-2012  yamt sync with head
 1.2.2.1 17-Apr-2012  yamt sync with head
 1.3.8.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.40.1 24-Apr-2019  isaki Adapt zaudio family to audio2.
- wm8731 and wm8750 can share zaudio_formats[].
- Drop INDEPENDENT property. These share sample rate in play and rec.
- pxa2x0_i2s_setspeed() no longer needs to writeback sample rate.
 1.5.38.1 10-Jun-2019  christos Sync with HEAD
 1.26 13-Jul-2023  riastradh arm/xscale: Use sys/bitops.h fls32 - 1 instead of 31 - __builtin_clz.

Sidesteps namespace collision with `#define bits ...' in net/zlib.c.
 1.25 31-Oct-2022  andvar branches: 1.25.2;
fix various typos in comments and one output message.
 1.24 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.23 04-Jan-2021  skrll Trailing whitespace
 1.22 04-Jan-2021  skrll Spell interrupts correctly
 1.21 17-Dec-2013  joerg branches: 1.21.42;
Nuke __raise.
 1.20 29-Jul-2012  matt branches: 1.20.2; 1.20.4;
Fix more -fno-common fallout.
Move more variables to common locations.
 1.19 01-Jul-2011  dyoung branches: 1.19.2;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.18 06-Jun-2011  matt Some more device_t, cfdata_t, CFATTACH_DECL_NEW cleanup.
 1.17 13-Jun-2010  tsutsui branches: 1.17.6;
Apply fixes for PR port-arm/43339:
Set proper IPL_SOFTfoo values even in !FAST_SOFTINTS case.
Some assertions in MI code expect they have unique values,
per comments from rmind@.

Also cleanup various "interrupt hierarchy" code since IPL_NONE and
IPL_SOFTfoo should not be set by any hardware interrupt establish functions.

Ok'ed by mrg@, tested on shark and hpcarm.
 1.16 05-Sep-2009  bsh branches: 1.16.2; 1.16.4;
correct the initial value of interrupt masks. 0 is to disable.
This fixes stray interrupt from LCD controller when lcd driver is not configured in the kernel.
 1.15 07-Nov-2008  rafal Make stray interrupt handler get the minimum IRQ number based on the current
CPU type vs. hardcoding it for pxa270.
 1.14 27-Apr-2008  matt branches: 1.14.6; 1.14.8;
Merge kernel changes in matt-armv6 to HEAD.
 1.13 11-Dec-2007  ad branches: 1.13.8; 1.13.10; 1.13.12;
And you, be ye fruitful, and multiply; bring forth abundantly in the earth,
and multiply therein. (Genesis 9:6-8)
 1.12 03-Dec-2007  ad branches: 1.12.2; 1.12.4; 1.12.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.11 17-Dec-2006  peter branches: 1.11.6; 1.11.20; 1.11.22; 1.11.24; 1.11.26; 1.11.32;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.10 24-Nov-2006  wiz s/heirarchy/hierarchy/, from Zafer.
 1.9 10-Apr-2006  simonb branches: 1.9.8; 1.9.10;
Tab Police.
 1.8 24-Dec-2005  perry branches: 1.8.4; 1.8.6; 1.8.8; 1.8.10; 1.8.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 04-Jul-2005  bsh branches: 1.6.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.
 1.5 15-Jul-2003  lukem __KERNEL_RCSID()
 1.4 16-Jun-2003  thorpej branches: 1.4.2;
Rename IPL_IMP -> IPL_VM.
 1.3 05-Jun-2003  scw - Rearrange the PXA2x0 support code to better support attaching
child drivers such as interrupt and gpio controllers.
- Add a function to probe SDRAM size at boot time.
- Add a function to configure the Clock Manager's CKEN settings.
- Add an INTC driver.
- Add a GPIO driver.
- Add attach glue for the PXA2x0's "almost" 16550-compatible uarts.
- Tweak the LCD driver to use the GPIO driver's services for setting
up GPIO pin function.
 1.2 03-Jan-2003  thorpej Use the generic irq_dispatch.S
 1.1 19-Oct-2002  bsh branches: 1.1.2;
Support Intel PXA250 and PXA210 application processors.
 1.1.2.3 03-Jan-2003  thorpej Sync with HEAD.
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 19-Oct-2002  nathanw file pxa2x0_intr.c was added on branch nathanw_sa on 2002-11-11 21:56:57 +0000
 1.4.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.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.8.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.8.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.8.8.1 11-Apr-2006  yamt sync with head
 1.8.6.1 22-Apr-2006  simonb Sync with head.
 1.8.4.1 09-Sep-2006  rpaulo sync with head
 1.9.10.2 18-Dec-2006  yamt sync with head.
 1.9.10.1 10-Dec-2006  yamt sync with head.
 1.9.8.1 12-Jan-2007  ad Sync with head.
 1.11.32.2 27-Dec-2007  mjf Sync with HEAD.
 1.11.32.1 08-Dec-2007  mjf Sync with HEAD.
 1.11.26.3 28-Jan-2008  matt Given the that there are only 4 IPLs (ignoring soft IPLs), a number of
cleanups can be done:
Remove _SPL_* aliases.
Don't store irqmasks in ci_cpl, just make it an ipl level.
Add fast softint switching support.
 1.11.26.2 09-Jan-2008  matt sync with HEAD
 1.11.26.1 06-Nov-2007  matt Nuke use of current_spl_level and use curcup()->ci_cpl instead
 1.11.24.1 01-Jan-2008  chris Sync with HEAD.
 1.11.22.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.11.20.2 26-Dec-2007  rjs Sync with HEAD.
 1.11.20.1 06-Oct-2007  rjs Switch to new interrupt code.
 1.11.6.1 03-Dec-2007  ad Sync with HEAD.
 1.12.6.1 13-Dec-2007  bouyer Sync with HEAD
 1.12.4.1 13-Dec-2007  yamt sync with head.
 1.12.2.1 26-Dec-2007  ad Sync with head.
 1.13.12.4 11-Aug-2010  yamt sync with head.
 1.13.12.3 16-Sep-2009  yamt sync with head
 1.13.12.2 04-May-2009  yamt sync with head.
 1.13.12.1 16-May-2008  yamt sync with head.
 1.13.10.1 18-May-2008  yamt sync with head.
 1.13.8.2 17-Jan-2009  mjf Sync with HEAD.
 1.13.8.1 02-Jun-2008  mjf Sync with HEAD.
 1.14.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.14.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.16.4.2 12-Jun-2011  rmind sync with head
 1.16.4.1 03-Jul-2010  rmind sync with head
 1.16.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.17.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.19.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.19.2.1 30-Oct-2012  yamt sync with head
 1.20.4.1 18-May-2014  rmind sync with head
 1.20.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.42.1 03-Apr-2021  thorpej Sync with HEAD.
 1.25.2.1 09-Aug-2023  martin Pull up following revision(s) (requested by maya in ticket #316):

sys/arch/m68k/include/mutex.h: revision 1.13
sys/arch/arm/include/cpu.h: revision 1.125
sys/arch/sun68k/include/intr.h: revision 1.21
sys/arch/arm/include/mutex.h: revision 1.28
sys/sys/rwlock.h: revision 1.18
sys/arch/powerpc/include/mutex.h: revision 1.7
sys/arch/arm/include/mutex.h: revision 1.29
sys/arch/powerpc/include/mutex.h: revision 1.8
sys/uvm/uvm_param.h: revision 1.42
sys/sys/ksem.h: revision 1.16
sys/arch/x86/include/mutex.h: revision 1.10
sys/sys/proc.h: revision 1.372
sys/sys/ksem.h: revision 1.17
sys/arch/ia64/include/mutex.h: revision 1.8
sys/arch/evbarm/include/intr.h: revision 1.29
sys/sys/lua.h: revision 1.9
sys/arch/next68k/include/intr.h: revision 1.23
sys/arch/ia64/include/mutex.h: revision 1.9
sys/arch/hp300/include/intr.h: revision 1.35
sys/arch/hp300/include/intr.h: revision 1.36
sys/arch/sparc/include/cpu.h: revision 1.111
sys/arch/hppa/include/mutex.h: revision 1.16
sys/arch/vax/include/intr.h: revision 1.31
sys/arch/hppa/include/mutex.h: revision 1.17
sys/arch/news68k/include/intr.h: revision 1.28
sys/arch/hppa/include/mutex.h: revision 1.18
sys/arch/hppa/include/intr.h: revision 1.3
sys/arch/hppa/include/mutex.h: revision 1.19
sys/arch/hppa/include/intr.h: revision 1.4
sys/sys/sched.h: revision 1.92
sys/opencrypto/cryptodev.h: revision 1.51
sys/arch/vax/include/mutex.h: revision 1.20
sys/arch/sparc64/include/mutex.h: revision 1.10
sys/arch/ia64/include/sapicvar.h: revision 1.2
sys/arch/riscv/include/mutex.h: revision 1.5
sys/arch/amiga/dev/grfabs_cc.c: revision 1.39
sys/external/bsd/drm2/include/linux/idr.h: revision 1.11
sys/arch/riscv/include/mutex.h: revision 1.6
sys/ddb/files.ddb: revision 1.16
sys/arch/mac68k/include/intr.h: revision 1.32
share/man/man4/ddb.4: revision 1.203
sys/ddb/db_command.c: revision 1.183
sys/arch/mips/include/mutex.h: revision 1.10
sys/ddb/db_command.c: revision 1.184
sys/arch/x68k/include/intr.h: revision 1.22
sys/arch/sparc/include/psl.h: revision 1.51
sys/arch/or1k/include/mutex.h: revision 1.4
sys/arch/mips/include/mutex.h: revision 1.11
sys/arch/arm/xscale/pxa2x0_intr.h: revision 1.16
sys/arch/sparc64/include/cpu.h: revision 1.134
sys/arch/sparc/include/psl.h: revision 1.52
sys/arch/or1k/include/mutex.h: revision 1.5
sys/arch/mvme68k/include/intr.h: revision 1.22
sys/arch/luna68k/include/intr.h: revision 1.16
external/cddl/osnet/sys/sys/kcondvar.h: revision 1.6
sys/arch/sparc/include/mutex.h: revision 1.12
sys/arch/sparc/include/mutex.h: revision 1.13
sys/arch/usermode/include/mutex.h: revision 1.5
sys/arch/usermode/include/mutex.h: revision 1.6
sys/kern/kern_core.c: revision 1.38
usr.sbin/crash/Makefile: revision 1.49
sys/arch/amiga/include/intr.h: revision 1.23
sys/arch/alpha/include/mutex.h: revision 1.12
sys/arch/alpha/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.16
sys/ddb/ddb.h: revision 1.6
sys/arch/sparc64/include/mutex.h: revision 1.8
sys/arch/sh3/include/mutex.h: revision 1.12
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.17
sys/ddb/db_syncobj.c: revision 1.1
sys/arch/vax/include/mutex.h: revision 1.18
sys/arch/sparc64/include/psl.h: revision 1.63
sys/arch/sparc64/include/mutex.h: revision 1.9
sys/arch/sh3/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/obio.c: revision 1.13
sys/arch/atari/include/intr.h: revision 1.23
sys/ddb/db_syncobj.c: revision 1.2
sys/arch/vax/include/mutex.h: revision 1.19
sys/arch/evbarm/g42xxeb/obio.c: revision 1.14
sys/arch/evbarm/g42xxeb/obio.c: revision 1.15
sys/arch/cesfic/include/intr.h: revision 1.14
sys/ddb/db_syncobj.h: revision 1.1
sys/arch/x86/include/cpu.h: revision 1.134
sys/arch/evbarm/g42xxeb/obio.c: revision 1.16
sys/arch/cesfic/include/intr.h: revision 1.15
sys/arch/arm/xscale/pxa2x0_intr.c: revision 1.26
sys/sys/cpu_data.h: revision 1.54
sys/arch/m68k/include/mutex.h: revision 1.12
sys/arch/ia64/acpi/madt.c: revision 1.6

sys/rwlock.h: Make this more self-contained for bool.

machine/mutex.h: Sprinkle includes so this can be used by crash(8).

ddb: New `show all tstiles' command.
Shows who's waiting for which locks and what the owner is up to.

Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE

sys: Rip <sys/resourcevar.h> out of <uvm/uvm_param.h>.

And thus out of <sys/param.h>, which is exceedingly overused and
fragile and delenda est.

Should fix (some) issues with the recent inclusion of machine/lock.h
in various machine/mutex.h files.

arm/mutex.h: Need machine/intr.h, machine/lock.h.

For ipl_cookie_t and __cpu_simple_lock_t.
evbarm/intr.h: Define ipl_cookie_t before including ARM_INTR_IMPL.

Otherwise arm/mutex.h doesn't work, due to a cyclic dependency which
should really be fixed.
opencrypto/cryptodev.h: Fix includes.
- Move sys/condvar.h under #ifdef _KERNEL.
- Add some other necessary includes and forward declarations.
- Sort.

hp300/intr.h: Fix missing includes.
linux/idr.h: Need <sys/mutex.h> for kmutex_t.
amiga/intr.h: Don't define spl*() functions if !_KERNEL.

This is used by crash(8) now, and what's important is ipl_cookie_t.
cesfic/intr.h: Expose ipl_cookie_t to userland for crash(8).
cesfic/intr.h: Expose ipl_cookie_t to userland only with _KMEMUSER.

Probably not necessary but let's be a little more cautious about
this.

atari/intr.h: Expose ipl_cookie_t with _KMEMUSER for crash(8).

arm/cpu.h: Need sys/param.h for COHERENCY_UNIT.

Nix machine/param.h -- not meant to be used directly, pulled in by
sys/param.h.

Move the definition of ipl_cookie_t out of the kernel-only sections,
some _KMEMUSER applications need it.

ddb: Cast pointer to uintptr_t first before db_expr_t.

hppa/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

luna68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

mvme68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

news68k/intr.h: Fix includes. Put some definitions under _KERNEL.

next68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

sys/ksem.h: Hack around fstat(8) abuse of _KERNEL.

sun68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

vax/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

x68k/intr.h: Put functions under _KERNEL so crash(8) can use this.

Make ipl_cookie_t visible for _KMEMUSER userland applications.

fix editor mishap in previous

Explicitly include <sys/mutex.h> for kmutex_t.

Replace kmutex_t * (which may be undefined here) with struct kmutex *,
suggested by Taylor.

hp300/intr.h: Put most of this under #ifdef _KERNEL.
Only ipl_cookie_t really needs to be exposed now, for crash(8).

mac68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).
Make inclusion of sys/intr.h explicit for spl*.

fix hppa and vax builds.

machine/lock.h isn't necessary for __cpu_simple_lock_t, it's in
sys/types.h. avoids cpu_data.h vs sched.h include order issues.

move the hppa ipl_t typedef with the moved usage of it.
machine/mutex.h: Sprinkle sys/types.h, omit machine/lock.h.

Turns out machine/lock.h is not needed for __cpu_simple_lock_t, which
always comes from sys/types.h. And, really, sys/types.h (or at least
sys/stdint.h) is needed for uintN_t and uintptr_t.

ddb: Cast pointer to uintptr_t, then to db_expr_t.
Avoids warnings about conversion between pointer and integer of
different size on some architectures.

re-fix hppa builds.

this file uses __cpu_simple_lock(), not just the underlying type,
so it does need machine/lock.h.

Break cycle by using `struct kmutex *' instead of `kmutex_t *'.
sys/sched.h included sys/mutex.h
which includes sys/intr.h
which includes machine/intr.h
which on cats includes arm/footbridge/footbridge_intr.h
which includes arm/cpu.h
which includes sys/cpu_data.h
which includes sys/sched.h

But there was never any real need for sys/mutex.h in sys/sched.h,
because it only uses pointers to the opaque struct kmutex. Cycle
broken by using `struct kmutex *' instead of pulling in sys/mutex.h
for the definition of kmutex_t.

Side effect: This revealed that sys/cpu_data.h needed sys/intr.h
(which was pulled in accidentally by sys/mutex.h via sys/sched.h) for
SOFTINT_COUNT. Also revealed some other machine/cpu.h header files
were missing includes of sys/mutex.h for kmutex_t.

ia64: Need sys/types.h for u_int, vaddr_t; sys/mutex.h for kmutex_t.

explicitly include no longer implicitly included sys/mutex.h.

arm/xscale: Use sys/bitops.h fls32 - 1 instead of 31 - __builtin_clz.
Sidesteps namespace collision with `#define bits ...' in net/zlib.c.

complete the previous - there were two calls to find_first_bit() to fix.

arm/xscale: Missed a spot with previous find_first_bit commit.

evbarm/g42xxeb: Fix off-by-one in previous.

The original find_first_bit(x) was 31 - __builtin_clz((uint32_t)x),
which is equivalent to fls32(x) - 1, not to fls32(x).

Note that fls32 is 1-based and returns 0 for x=0.
 1.16 13-Jul-2023  riastradh arm/xscale: Use sys/bitops.h fls32 - 1 instead of 31 - __builtin_clz.

Sidesteps namespace collision with `#define bits ...' in net/zlib.c.
 1.15 24-Jan-2018  skrll branches: 1.15.34;
Remove port-acorn26

OK core@
 1.14 04-Feb-2014  matt _setsoftintr is long dead. reap any leftovers from arm.
 1.13 29-Jul-2012  matt branches: 1.13.2; 1.13.4;
Fix more -fno-common fallout.
Move more variables to common locations.
 1.12 19-Nov-2008  matt branches: 1.12.16;
Don't include <machine/atomic.h> anymore.
 1.11 27-Apr-2008  matt branches: 1.11.6; 1.11.8;
Merge kernel changes in matt-armv6 to HEAD.
 1.10 28-Feb-2007  bjh21 branches: 1.10.8; 1.10.22; 1.10.42; 1.10.44; 1.10.46;
KNF
(waiting for a test kernel to compile...)
 1.9 17-Dec-2006  peter branches: 1.9.2;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.8 24-Dec-2005  perry branches: 1.8.20; 1.8.22;
bare asm -> __asm
 1.7 24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 05-Jun-2005  he branches: 1.5.2;
Work around -Wcast-qual by adding another __UNVOLATILE() when using
atomic_set_bit().
 1.4 05-Jul-2003  dogcow gcc 3.2 complained about the missing __volatile and extra tokens after #endif.
 1.3 05-Jun-2003  scw branches: 1.3.2;
- Rearrange the PXA2x0 support code to better support attaching
child drivers such as interrupt and gpio controllers.
- Add a function to probe SDRAM size at boot time.
- Add a function to configure the Clock Manager's CKEN settings.
- Add an INTC driver.
- Add a GPIO driver.
- Add attach glue for the PXA2x0's "almost" 16550-compatible uarts.
- Tweak the LCD driver to use the GPIO driver's services for setting
up GPIO pin function.
 1.2 03-Jan-2003  thorpej Use the generic irq_dispatch.S
 1.1 19-Oct-2002  bsh branches: 1.1.2;
Support Intel PXA250 and PXA210 application processors.
 1.1.2.3 03-Jan-2003  thorpej Sync with HEAD.
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 19-Oct-2002  nathanw file pxa2x0_intr.h was added on branch nathanw_sa on 2002-11-11 21:56:58 +0000
 1.3.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.5.2.3 03-Sep-2007  yamt sync with head.
 1.5.2.2 30-Dec-2006  yamt sync with head.
 1.5.2.1 21-Jun-2006  yamt sync with head.
 1.8.22.1 18-Dec-2006  yamt sync with head.
 1.8.20.1 12-Jan-2007  ad Sync with head.
 1.9.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.10.46.2 04-May-2009  yamt sync with head.
 1.10.46.1 16-May-2008  yamt sync with head.
 1.10.44.1 18-May-2008  yamt sync with head.
 1.10.42.2 17-Jan-2009  mjf Sync with HEAD.
 1.10.42.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.22.4 28-Jan-2008  matt Given the that there are only 4 IPLs (ignoring soft IPLs), a number of
cleanups can be done:
Remove _SPL_* aliases.
Don't store irqmasks in ci_cpl, just make it an ipl level.
Add fast softint switching support.
 1.10.22.3 09-Jan-2008  matt sync with HEAD
 1.10.22.2 09-Nov-2007  matt Make all the evbarm kernels build again. Fix lossage from rebase.
 1.10.22.1 06-Nov-2007  matt Nuke use of current_spl_level and use curcup()->ci_cpl instead
 1.10.8.1 19-Apr-2007  thorpej Convert to the new atomic ops API.
 1.11.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.11.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.12.16.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.12.16.1 30-Oct-2012  yamt sync with head
 1.13.4.1 18-May-2014  rmind sync with head
 1.13.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.34.1 09-Aug-2023  martin Pull up following revision(s) (requested by maya in ticket #316):

sys/arch/m68k/include/mutex.h: revision 1.13
sys/arch/arm/include/cpu.h: revision 1.125
sys/arch/sun68k/include/intr.h: revision 1.21
sys/arch/arm/include/mutex.h: revision 1.28
sys/sys/rwlock.h: revision 1.18
sys/arch/powerpc/include/mutex.h: revision 1.7
sys/arch/arm/include/mutex.h: revision 1.29
sys/arch/powerpc/include/mutex.h: revision 1.8
sys/uvm/uvm_param.h: revision 1.42
sys/sys/ksem.h: revision 1.16
sys/arch/x86/include/mutex.h: revision 1.10
sys/sys/proc.h: revision 1.372
sys/sys/ksem.h: revision 1.17
sys/arch/ia64/include/mutex.h: revision 1.8
sys/arch/evbarm/include/intr.h: revision 1.29
sys/sys/lua.h: revision 1.9
sys/arch/next68k/include/intr.h: revision 1.23
sys/arch/ia64/include/mutex.h: revision 1.9
sys/arch/hp300/include/intr.h: revision 1.35
sys/arch/hp300/include/intr.h: revision 1.36
sys/arch/sparc/include/cpu.h: revision 1.111
sys/arch/hppa/include/mutex.h: revision 1.16
sys/arch/vax/include/intr.h: revision 1.31
sys/arch/hppa/include/mutex.h: revision 1.17
sys/arch/news68k/include/intr.h: revision 1.28
sys/arch/hppa/include/mutex.h: revision 1.18
sys/arch/hppa/include/intr.h: revision 1.3
sys/arch/hppa/include/mutex.h: revision 1.19
sys/arch/hppa/include/intr.h: revision 1.4
sys/sys/sched.h: revision 1.92
sys/opencrypto/cryptodev.h: revision 1.51
sys/arch/vax/include/mutex.h: revision 1.20
sys/arch/sparc64/include/mutex.h: revision 1.10
sys/arch/ia64/include/sapicvar.h: revision 1.2
sys/arch/riscv/include/mutex.h: revision 1.5
sys/arch/amiga/dev/grfabs_cc.c: revision 1.39
sys/external/bsd/drm2/include/linux/idr.h: revision 1.11
sys/arch/riscv/include/mutex.h: revision 1.6
sys/ddb/files.ddb: revision 1.16
sys/arch/mac68k/include/intr.h: revision 1.32
share/man/man4/ddb.4: revision 1.203
sys/ddb/db_command.c: revision 1.183
sys/arch/mips/include/mutex.h: revision 1.10
sys/ddb/db_command.c: revision 1.184
sys/arch/x68k/include/intr.h: revision 1.22
sys/arch/sparc/include/psl.h: revision 1.51
sys/arch/or1k/include/mutex.h: revision 1.4
sys/arch/mips/include/mutex.h: revision 1.11
sys/arch/arm/xscale/pxa2x0_intr.h: revision 1.16
sys/arch/sparc64/include/cpu.h: revision 1.134
sys/arch/sparc/include/psl.h: revision 1.52
sys/arch/or1k/include/mutex.h: revision 1.5
sys/arch/mvme68k/include/intr.h: revision 1.22
sys/arch/luna68k/include/intr.h: revision 1.16
external/cddl/osnet/sys/sys/kcondvar.h: revision 1.6
sys/arch/sparc/include/mutex.h: revision 1.12
sys/arch/sparc/include/mutex.h: revision 1.13
sys/arch/usermode/include/mutex.h: revision 1.5
sys/arch/usermode/include/mutex.h: revision 1.6
sys/kern/kern_core.c: revision 1.38
usr.sbin/crash/Makefile: revision 1.49
sys/arch/amiga/include/intr.h: revision 1.23
sys/arch/alpha/include/mutex.h: revision 1.12
sys/arch/alpha/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.16
sys/ddb/ddb.h: revision 1.6
sys/arch/sparc64/include/mutex.h: revision 1.8
sys/arch/sh3/include/mutex.h: revision 1.12
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.17
sys/ddb/db_syncobj.c: revision 1.1
sys/arch/vax/include/mutex.h: revision 1.18
sys/arch/sparc64/include/psl.h: revision 1.63
sys/arch/sparc64/include/mutex.h: revision 1.9
sys/arch/sh3/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/obio.c: revision 1.13
sys/arch/atari/include/intr.h: revision 1.23
sys/ddb/db_syncobj.c: revision 1.2
sys/arch/vax/include/mutex.h: revision 1.19
sys/arch/evbarm/g42xxeb/obio.c: revision 1.14
sys/arch/evbarm/g42xxeb/obio.c: revision 1.15
sys/arch/cesfic/include/intr.h: revision 1.14
sys/ddb/db_syncobj.h: revision 1.1
sys/arch/x86/include/cpu.h: revision 1.134
sys/arch/evbarm/g42xxeb/obio.c: revision 1.16
sys/arch/cesfic/include/intr.h: revision 1.15
sys/arch/arm/xscale/pxa2x0_intr.c: revision 1.26
sys/sys/cpu_data.h: revision 1.54
sys/arch/m68k/include/mutex.h: revision 1.12
sys/arch/ia64/acpi/madt.c: revision 1.6

sys/rwlock.h: Make this more self-contained for bool.

machine/mutex.h: Sprinkle includes so this can be used by crash(8).

ddb: New `show all tstiles' command.
Shows who's waiting for which locks and what the owner is up to.

Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE

sys: Rip <sys/resourcevar.h> out of <uvm/uvm_param.h>.

And thus out of <sys/param.h>, which is exceedingly overused and
fragile and delenda est.

Should fix (some) issues with the recent inclusion of machine/lock.h
in various machine/mutex.h files.

arm/mutex.h: Need machine/intr.h, machine/lock.h.

For ipl_cookie_t and __cpu_simple_lock_t.
evbarm/intr.h: Define ipl_cookie_t before including ARM_INTR_IMPL.

Otherwise arm/mutex.h doesn't work, due to a cyclic dependency which
should really be fixed.
opencrypto/cryptodev.h: Fix includes.
- Move sys/condvar.h under #ifdef _KERNEL.
- Add some other necessary includes and forward declarations.
- Sort.

hp300/intr.h: Fix missing includes.
linux/idr.h: Need <sys/mutex.h> for kmutex_t.
amiga/intr.h: Don't define spl*() functions if !_KERNEL.

This is used by crash(8) now, and what's important is ipl_cookie_t.
cesfic/intr.h: Expose ipl_cookie_t to userland for crash(8).
cesfic/intr.h: Expose ipl_cookie_t to userland only with _KMEMUSER.

Probably not necessary but let's be a little more cautious about
this.

atari/intr.h: Expose ipl_cookie_t with _KMEMUSER for crash(8).

arm/cpu.h: Need sys/param.h for COHERENCY_UNIT.

Nix machine/param.h -- not meant to be used directly, pulled in by
sys/param.h.

Move the definition of ipl_cookie_t out of the kernel-only sections,
some _KMEMUSER applications need it.

ddb: Cast pointer to uintptr_t first before db_expr_t.

hppa/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

luna68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

mvme68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

news68k/intr.h: Fix includes. Put some definitions under _KERNEL.

next68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

sys/ksem.h: Hack around fstat(8) abuse of _KERNEL.

sun68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

vax/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

x68k/intr.h: Put functions under _KERNEL so crash(8) can use this.

Make ipl_cookie_t visible for _KMEMUSER userland applications.

fix editor mishap in previous

Explicitly include <sys/mutex.h> for kmutex_t.

Replace kmutex_t * (which may be undefined here) with struct kmutex *,
suggested by Taylor.

hp300/intr.h: Put most of this under #ifdef _KERNEL.
Only ipl_cookie_t really needs to be exposed now, for crash(8).

mac68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).
Make inclusion of sys/intr.h explicit for spl*.

fix hppa and vax builds.

machine/lock.h isn't necessary for __cpu_simple_lock_t, it's in
sys/types.h. avoids cpu_data.h vs sched.h include order issues.

move the hppa ipl_t typedef with the moved usage of it.
machine/mutex.h: Sprinkle sys/types.h, omit machine/lock.h.

Turns out machine/lock.h is not needed for __cpu_simple_lock_t, which
always comes from sys/types.h. And, really, sys/types.h (or at least
sys/stdint.h) is needed for uintN_t and uintptr_t.

ddb: Cast pointer to uintptr_t, then to db_expr_t.
Avoids warnings about conversion between pointer and integer of
different size on some architectures.

re-fix hppa builds.

this file uses __cpu_simple_lock(), not just the underlying type,
so it does need machine/lock.h.

Break cycle by using `struct kmutex *' instead of `kmutex_t *'.
sys/sched.h included sys/mutex.h
which includes sys/intr.h
which includes machine/intr.h
which on cats includes arm/footbridge/footbridge_intr.h
which includes arm/cpu.h
which includes sys/cpu_data.h
which includes sys/sched.h

But there was never any real need for sys/mutex.h in sys/sched.h,
because it only uses pointers to the opaque struct kmutex. Cycle
broken by using `struct kmutex *' instead of pulling in sys/mutex.h
for the definition of kmutex_t.

Side effect: This revealed that sys/cpu_data.h needed sys/intr.h
(which was pulled in accidentally by sys/mutex.h via sys/sched.h) for
SOFTINT_COUNT. Also revealed some other machine/cpu.h header files
were missing includes of sys/mutex.h for kmutex_t.

ia64: Need sys/types.h for u_int, vaddr_t; sys/mutex.h for kmutex_t.

explicitly include no longer implicitly included sys/mutex.h.

arm/xscale: Use sys/bitops.h fls32 - 1 instead of 31 - __builtin_clz.
Sidesteps namespace collision with `#define bits ...' in net/zlib.c.

complete the previous - there were two calls to find_first_bit() to fix.

arm/xscale: Missed a spot with previous find_first_bit commit.

evbarm/g42xxeb: Fix off-by-one in previous.

The original find_first_bit(x) was 31 - __builtin_clz((uint32_t)x),
which is equivalent to fls32(x) - 1, not to fls32(x).

Note that fls32 is 1-based and returns 0 for x=0.
 1.2 03-Jan-2003  thorpej Use the generic irq_dispatch.S
 1.1 19-Oct-2002  bsh branches: 1.1.2;
Support Intel PXA250 and PXA210 application processors.
 1.1.2.3 03-Jan-2003  thorpej Sync with HEAD.
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 19-Oct-2002  nathanw file pxa2x0_irq.S was added on branch nathanw_sa on 2002-11-11 21:56:59 +0000
 1.39 20-Nov-2021  rin Accept anti-aliased fonts; they are supported by rotated screen found on
hpcarm/WZERO3 and PXA270-based zaurus.
 1.38 20-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.37 10-Nov-2019  chs branches: 1.37.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.36 17-Oct-2015  jmcneill branches: 1.36.18;
remove tlb_flush define and change callers to use cpu_tlb_flushID directly, ok matt@
 1.35 22-Feb-2014  matt branches: 1.35.6;
Deal with non-4KB page sizes
 1.34 28-Jan-2014  martin Remove unused variables
 1.33 11-Jan-2012  macallan branches: 1.33.6; 1.33.10;
adjust wsfont_find()
 1.32 01-Jul-2011  dyoung branches: 1.32.2; 1.32.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.31 14-May-2011  nonaka PXA2X0_LCD_WRITETHROUGH is defflag'd.
 1.30 08-Aug-2010  tsutsui branches: 1.30.2;
Allow pxa2x0_lcd driver mapping screen buffer memory cachable with
write-through map (i.e. map it without BUS_DMA_COHERENT) since
currently all DMA data transfers are memory to device only.

Disabled by default, but enabled by "options PXA2X0_LCD_WRITETHROUGH"
or setting pxa2x0_lcd_writethrough = 1 in a kernel binary.

Tested on WS003SH by me and on WS011SH by jun@, and console output speed
is improved ~three times faster than coherent (uncached) mapping.

XXX: should we have a flag like BUS_DMA_WRITETHROUGH in MI bus_dma(9)?
 1.29 08-Aug-2010  kiyohara Must disable LCD Controller in pxa2x0_lcd_attach_sub(), if already enabled.
We wait to become disable LCD in pxa2x0_lcd_initialize().
 1.28 13-Mar-2010  bsh branches: 1.28.2;
fix LCD drivers for Lubbock and Twintail.
- pass correct attach args to pxa2x0_lcd_attach_sub()
- make this driver compile without wsdisplay again.
 1.27 29-Jan-2009  nonaka branches: 1.27.4;
- device_t/softc split.
- use aprint_* function.
 1.26 17-Oct-2007  garbled branches: 1.26.20; 1.26.28;
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.25 26-Jul-2007  nonaka branches: 1.25.6; 1.25.8;
use WSDISPLAY_TYPE_PXALCD.
 1.24 28-Jun-2007  nonaka branches: 1.24.2; 1.24.4;
cosmetic
 1.23 28-Jun-2007  nonaka use LCCR3_BPP3 instead of magic number.
 1.22 28-Jun-2007  nonaka Mask more interrupts.
 1.21 28-Jun-2007  nonaka Added support ioctl(WSDISPLAYIO_LINEBYTES).
(XFree86 wsfb driver uses it.)
 1.20 28-Jun-2007  nonaka pxa2x0_lcd_mmap():
- Check offset parameter.
 1.19 26-Jun-2007  nonaka Don't setup GP[87:86] to LDD[17:16] at pxa2x0_lcd_initialize().
Because zaurus uses GP[87:86] as SSP2.
 1.18 05-Mar-2007  nonaka branches: 1.18.2; 1.18.4; 1.18.10;
Use (char *) on pointer arith.
 1.17 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.16 18-Dec-2006  nonaka branches: 1.16.2;
Fix evbarm compile again.
 1.15 17-Dec-2006  peter Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.14 16-Dec-2006  ober Zaurus Port from OpenBSD by Nonaka Kimihiro
OK gimpy
 1.13 12-Apr-2006  jmmv branches: 1.13.8; 1.13.10;
Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called. The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place. There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
 1.12 10-Apr-2006  simonb Tab Police.
 1.11 11-Dec-2005  christos branches: 1.11.4; 1.11.6; 1.11.8; 1.11.10; 1.11.12;
merge ktrace-lwp.
 1.10 04-Jul-2005  bsh branches: 1.10.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.
 1.9 05-Jun-2005  he Remove an unneeded cast and add some consts.
 1.8 03-Oct-2003  bsh avoid compile error with GCC3, and add some comments.
 1.7 23-Jul-2003  bsh $Id$ -> $NetBSD$
 1.6 15-Jul-2003  lukem __KERNEL_RCSID()
 1.5 17-Jun-2003  bsh branches: 1.5.2;
make this compile again:
+ we don't have struct pxa2x0_softc anymore.
+ call pxa2x0_clkman_config() to provide clock to LCDC block.
 1.4 17-Jun-2003  bsh white space nit.
 1.3 05-Jun-2003  scw - Rearrange the PXA2x0 support code to better support attaching
child drivers such as interrupt and gpio controllers.
- Add a function to probe SDRAM size at boot time.
- Add a function to configure the Clock Manager's CKEN settings.
- Add an INTC driver.
- Add a GPIO driver.
- Add attach glue for the PXA2x0's "almost" 16550-compatible uarts.
- Tweak the LCD driver to use the GPIO driver's services for setting
up GPIO pin function.
 1.2 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.1 19-Oct-2002  bsh branches: 1.1.2;
Support Intel PXA250 and PXA210 application processors.
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 19-Oct-2002  nathanw file pxa2x0_lcd.c was added on branch nathanw_sa on 2002-11-11 21:57:00 +0000
 1.5.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.2.4 17-Jan-2005  skrll Adapt to branch.
 1.5.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.10.2.3 03-Sep-2007  yamt sync with head.
 1.10.2.2 30-Dec-2006  yamt sync with head.
 1.10.2.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.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.11.8.2 24-May-2006  yamt sync with head.
 1.11.8.1 11-Apr-2006  yamt sync with head
 1.11.6.1 22-Apr-2006  simonb Sync with head.
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.13.10.2 21-Dec-2006  yamt sync with head.
 1.13.10.1 18-Dec-2006  yamt sync with head.
 1.13.8.1 12-Jan-2007  ad Sync with head.
 1.16.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.18.10.2 03-Oct-2007  garbled Sync with HEAD
 1.18.10.1 26-Jun-2007  garbled Sync with HEAD.
 1.18.4.1 11-Jul-2007  mjf Sync with head.
 1.18.2.2 20-Aug-2007  ad Sync with HEAD.
 1.18.2.1 15-Jul-2007  ad Sync with head.
 1.24.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.24.2.1 07-Aug-2007  matt Sync with HEAD.
 1.25.8.1 06-Nov-2007  matt sync with HEAD
 1.25.6.1 01-Jan-2008  chris Sync with HEAD.
 1.26.28.1 03-Mar-2009  skrll Sync with HEAD.
 1.26.20.2 11-Aug-2010  yamt sync with head.
 1.26.20.1 04-May-2009  yamt sync with head.
 1.27.4.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.27.4.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.28.2.2 31-May-2011  rmind sync with head
 1.28.2.1 05-Mar-2011  rmind sync with head
 1.30.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.32.6.1 18-Feb-2012  mrg merge to -current.
 1.32.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.32.2.1 17-Apr-2012  yamt sync with head
 1.33.10.1 18-May-2014  rmind sync with head
 1.33.6.2 03-Dec-2017  jdolecek update from HEAD
 1.33.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.35.6.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.36.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.37.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.11 09-Mar-2022  andvar s/Horizontao/Horizontal/ in comment and removing misplaced "pxel" word.
 1.10 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.9 29-Jan-2009  nonaka - device_t/softc split.
- use aprint_* function.
 1.8 04-Mar-2007  christos branches: 1.8.46; 1.8.54;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.7 18-Dec-2006  nonaka branches: 1.7.2;
Fix evbarm compile again.
 1.6 17-Dec-2006  peter Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.5 16-Dec-2006  ober Zaurus Port from OpenBSD by Nonaka Kimihiro
OK gimpy
 1.4 12-Apr-2006  jmmv branches: 1.4.8; 1.4.10;
Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called. The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place. There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
 1.3 11-Dec-2005  christos branches: 1.3.4; 1.3.6; 1.3.8; 1.3.10; 1.3.12;
merge ktrace-lwp.
 1.2 17-Jun-2003  bsh branches: 1.2.2; 1.2.18;
make this compile again:
+ we don't have struct pxa2x0_softc anymore.
+ call pxa2x0_clkman_config() to provide clock to LCDC block.
 1.1 19-Oct-2002  bsh branches: 1.1.2;
Support Intel PXA250 and PXA210 application processors.
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 19-Oct-2002  nathanw file pxa2x0_lcd.h was added on branch nathanw_sa on 2002-11-11 21:57:01 +0000
 1.2.18.3 03-Sep-2007  yamt sync with head.
 1.2.18.2 30-Dec-2006  yamt sync with head.
 1.2.18.1 21-Jun-2006  yamt sync with head.
 1.2.2.1 17-Jan-2005  skrll Adapt to branch.
 1.3.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.3.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.3.8.1 24-May-2006  yamt sync with head.
 1.3.6.1 22-Apr-2006  simonb Sync with head.
 1.3.4.1 09-Sep-2006  rpaulo sync with head
 1.4.10.2 21-Dec-2006  yamt sync with head.
 1.4.10.1 18-Dec-2006  yamt sync with head.
 1.4.8.1 12-Jan-2007  ad Sync with head.
 1.7.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.8.54.1 03-Mar-2009  skrll Sync with HEAD.
 1.8.46.1 04-May-2009  yamt sync with head.
 1.14 28-Mar-2023  andvar s/interrput/interrupt/ and s/accesss/access/ in comments.
 1.13 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.12 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.11 24-Apr-2021  thorpej branches: 1.11.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.10 21-Jan-2012  nonaka branches: 1.10.62;
fix my license notice.
 1.9 23-Nov-2011  jmcneill branches: 1.9.2;
Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.
 1.8 05-Feb-2011  nonaka branches: 1.8.4; 1.8.6;
do pxamci_intr_done() after pxa2x0_dmac_abort_xfer().
 1.7 07-Oct-2010  kiyohara branches: 1.7.2; 1.7.4;
Support change Open-drain/Push-pull by bus_rod().
 1.6 01-Oct-2010  kiyohara Add capacity SMC_CAPS_MULTI_SEG_DMA. pxamci uses pxadmac for DMA.
 1.5 06-Apr-2010  nonaka Enable DMA transfer.
 1.4 13-Mar-2010  nonaka branches: 1.4.2;
fix compile failure when PXAMCI_DEBUG is defined.
 1.3 05-Dec-2009  nonaka branches: 1.3.2;
sync with OpenBSD.
 1.2 11-May-2009  nonaka branches: 1.2.2;
Don't touch dma data when PMC_CAPS_NO_DMA is set.
 1.1 21-Apr-2009  nonaka branches: 1.1.2; 1.1.4;
Added SD/MMC support from OpenBSD.
tested on i386, amd64 at current-users ML by pgoyette@.
tested on zaurus by myself.
 1.1.4.6 09-Oct-2010  yamt sync with head
 1.1.4.5 11-Aug-2010  yamt sync with head.
 1.1.4.4 11-Mar-2010  yamt sync with head
 1.1.4.3 16-May-2009  yamt sync with head
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 21-Apr-2009  yamt file pxa2x0_mci.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:45 +0000
 1.1.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.1.2.1 21-Apr-2009  skrll file pxa2x0_mci.c was added on branch nick-hppapmap on 2009-04-28 07:33:46 +0000
 1.2.2.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.2.1 11-May-2009  jym file pxa2x0_mci.c was added on branch jym-xensuspend on 2009-05-13 17:16:18 +0000
 1.3.2.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.3.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.4.2.2 05-Mar-2011  rmind sync with head
 1.4.2.1 30-May-2010  rmind sync with head
 1.7.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.7.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.6.1 20-Nov-2011  jmcneill port zaudio to audiomp api changes for real this time
 1.8.4.1 17-Apr-2012  yamt sync with head
 1.9.2.1 18-Feb-2012  mrg merge to -current.
 1.10.62.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.11.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 21-Jan-2012  nonaka fix my license notice.
 1.1 21-Apr-2009  nonaka branches: 1.1.2; 1.1.4; 1.1.6; 1.1.18; 1.1.22;
Added SD/MMC support from OpenBSD.
tested on i386, amd64 at current-users ML by pgoyette@.
tested on zaurus by myself.
 1.1.22.1 18-Feb-2012  mrg merge to -current.
 1.1.18.1 17-Apr-2012  yamt sync with head
 1.1.6.2 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.6.1 21-Apr-2009  jym file pxa2x0_mci.h was added on branch jym-xensuspend on 2009-05-13 17:16:19 +0000
 1.1.4.2 04-May-2009  yamt sync with head.
 1.1.4.1 21-Apr-2009  yamt file pxa2x0_mci.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:45 +0000
 1.1.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.1.2.1 21-Apr-2009  skrll file pxa2x0_mci.h was added on branch nick-hppapmap on 2009-04-28 07:33:46 +0000
 1.14 31-Mar-2025  riastradh ohci(4): Rework detach logic and justify the ordering.

Handle failed attach when we detach.

This changes the signature of the ohci_detach function, but it is
only ever used by statically linked ohci bus attachments, never by
modules so far, so no kernel revbump.

PR port-amd64/59180: System reboots instead of shutting down
 1.13 07-Aug-2021  thorpej branches: 1.13.12;
Merge thorpej-cfargs2.
 1.12 24-Apr-2021  thorpej branches: 1.12.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.11 09-Apr-2018  jakllsch branches: 1.11.16;
Stop potential misuse of vendor names and USB vendor IDs in root hub
device and string descriptors.

Firstly: Few vendors have identical PCI-SIG vendor IDs and USB-IF vendor
IDs. As such, using the PCI vendor ID as a USB vendor ID may trample
on whomever is allocated that USB vendor ID.

Secondly: The vendor of the host controller hardware implementation has
little to nothing to do with our usbroothub implementation. Thus we
should not potentially associate any problems therewith to such third
party.

This change will result in root hubs being identified by USB Vendor ID
0x0000. Root hub vendor string will now be "NetBSD" (or, specifically:
ostype). Product ID (0x0000) and product strings remain unchanged.
 1.10 23-Apr-2016  skrll branches: 1.10.16;
Merge nick-nhusb

- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
 1.9 27-Oct-2012  chs branches: 1.9.12; 1.9.14; 1.9.18;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.8 01-Jul-2011  dyoung branches: 1.8.2; 1.8.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.7 10-Aug-2009  kiyohara Remove unused variable powman_ioh.
It is used in GUMSTIX ohci patch.
 1.6 09-Aug-2009  kiyohara Fix matching by improper driver.
see http://mail-index.netbsd.org/port-arm/2009/07/08/msg000807.html

And remove some white-spaces.
 1.5 29-Jan-2009  nonaka fix compiler failure.
 1.4 29-Jan-2009  nonaka need newline.
> ohci0 at pxaip0 addr 0x40d00000-0x40d0000fohci0: OHCI version 1.0
 1.3 04-Apr-2008  drochner branches: 1.3.4; 1.3.12;
add some missing softc initialisation necessary after the device/softc
split, approved by Chris Gilbert
 1.2 31-Mar-2008  chris Update pxa2x0 ohci support to match recent device_t/softc splitting on
ohci.

Also remove powerhooks (eventually it'll be pmf'd)

This is enough for host usb to work sometimes on a zaurus.
 1.1 17-Dec-2006  peter branches: 1.1.2; 1.1.4; 1.1.6; 1.1.52;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.1.52.2 02-Jun-2008  mjf Sync with HEAD.
 1.1.52.1 03-Apr-2008  mjf Sync with HEAD.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 17-Dec-2006  ad file pxa2x0_ohci.c was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 17-Dec-2006  yamt file pxa2x0_ohci.c was added on branch yamt-lazymbuf on 2006-12-30 20:45:38 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 17-Dec-2006  yamt file pxa2x0_ohci.c was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.3.12.1 03-Mar-2009  skrll Sync with HEAD.
 1.3.4.2 19-Aug-2009  yamt sync with head.
 1.3.4.1 04-May-2009  yamt sync with head.
 1.8.12.2 03-Dec-2017  jdolecek update from HEAD
 1.8.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.8.2.1 30-Oct-2012  yamt sync with head
 1.9.18.1 06-Sep-2016  skrll First pass at netbsd-7 updated with USB code from HEAD
 1.9.14.2 05-Dec-2014  skrll Use int for return type for [eou]chi_init and motg_init.
 1.9.14.1 03-Dec-2014  skrll The grand renaming of structure members.

No functional change.
 1.9.12.1 05-Apr-2017  snj Pull up following revision(s) (requested by skrll in ticket #1395):
share/man/man4/axe.4: netbsd-7-nhusb
share/man/man4/axen.4: netbsd-7-nhusb
share/man/man4/cdce.4: netbsd-7-nhusb
share/man/man4/uaudio.4: netbsd-7-nhusb
share/man/man4/ucom.4: netbsd-7-nhusb
share/man/man4/uep.4: netbsd-7-nhusb
share/man/man4/urtw.4: netbsd-7-nhusb
share/man/man4/usb.4: netbsd-7-nhusb
share/man/man4/uyap.4: netbsd-7-nhusb
share/man/man4/xhci.4: netbsd-7-nhusb
share/man/man9/usbdi.9: netbsd-7-nhusb
sys/arch/amd64/conf/ALL: netbsd-7-nhusb
sys/arch/amd64/conf/GENERIC: netbsd-7-nhusb
sys/arch/amiga/dev/slhci_zbus.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_otg.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_usb.c: netbsd-7-nhusb
sys/arch/arm/amlogic/amlogic_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/at91/at91ohci.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm2835_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm53xx_usb.c: netbsd-7-nhusb
sys/arch/arm/ep93xx/epohci.c: netbsd-7-nhusb
sys/arch/arm/gemini/obio_ehci.c: netbsd-7-nhusb
sys/arch/arm/imx/files.imx23: netbsd-7-nhusb
sys/arch/arm/imx/imxusb.c: netbsd-7-nhusb
sys/arch/arm/imx/imxusbreg.h: netbsd-7-nhusb
sys/arch/arm/omap/obio_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/omap3_ehci.c: netbsd-7-nhusb
sys/arch/arm/omap/omapl1x_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/tiotg.c: netbsd-7-nhusb
sys/arch/arm/s3c2xx0/ohci_s3c24x0.c: netbsd-7-nhusb
sys/arch/arm/samsung/exynos_usb.c: netbsd-7-nhusb
sys/arch/arm/xscale/pxa2x0_ohci.c: netbsd-7-nhusb
sys/arch/arm/zynq/zynq_usb.c: netbsd-7-nhusb
sys/arch/hpcarm/dev/nbp_slhci.c: netbsd-7-nhusb
sys/arch/hpcmips/dev/plumohci.c: netbsd-7-nhusb
sys/arch/i386/conf/ALL: netbsd-7-nhusb
sys/arch/i386/conf/GENERIC: netbsd-7-nhusb
sys/arch/i386/pci/gcscehci.c: netbsd-7-nhusb
sys/arch/luna68k/conf/GENERIC: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahci.c: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahcivar.h: netbsd-7-nhusb
sys/arch/mips/alchemy/dev/ohci_aubus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ehci_arbus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ohci_arbus.c: netbsd-7-nhusb
sys/arch/mips/conf/files.adm5120: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ehci.c: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ohci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ehci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ohci.c: netbsd-7-nhusb
sys/arch/playstation2/dev/ohci_sbus.c: netbsd-7-nhusb
sys/arch/powerpc/booke/dev/pq3ehci.c: netbsd-7-nhusb
sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c: netbsd-7-nhusb
sys/arch/x68k/dev/slhci_intio.c: netbsd-7-nhusb
sys/conf/files: netbsd-7-nhusb
sys/dev/cardbus/ehci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/ohci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/uhci_cardbus.c: netbsd-7-nhusb
sys/dev/ic/sl811hs.c: netbsd-7-nhusb
sys/dev/ic/sl811hsvar.h: netbsd-7-nhusb
sys/dev/isa/slhci_isa.c: netbsd-7-nhusb
sys/dev/marvell/ehci_mv.c: netbsd-7-nhusb
sys/dev/pci/ehci_pci.c: netbsd-7-nhusb
sys/dev/pci/ohci_pci.c: netbsd-7-nhusb
sys/dev/pci/uhci_pci.c: netbsd-7-nhusb
sys/dev/pci/xhci_pci.c: netbsd-7-nhusb
sys/dev/pcmcia/slhci_pcmcia.c: netbsd-7-nhusb
sys/dev/usb/Makefile.usbdevs: netbsd-7-nhusb
sys/dev/usb/TODO: netbsd-7-nhusb
sys/dev/usb/TODO.usbmp: netbsd-7-nhusb
sys/dev/usb/aubtfwl.c: netbsd-7-nhusb
sys/dev/usb/auvitek.c: netbsd-7-nhusb
sys/dev/usb/auvitek_audio.c: netbsd-7-nhusb
sys/dev/usb/auvitek_dtv.c: netbsd-7-nhusb
sys/dev/usb/auvitek_i2c.c: netbsd-7-nhusb
sys/dev/usb/auvitek_video.c: netbsd-7-nhusb
sys/dev/usb/auvitekvar.h: netbsd-7-nhusb
sys/dev/usb/ehci.c: netbsd-7-nhusb
sys/dev/usb/ehcireg.h: netbsd-7-nhusb
sys/dev/usb/ehcivar.h: netbsd-7-nhusb
sys/dev/usb/emdtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_dtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_ir.c: netbsd-7-nhusb
sys/dev/usb/emdtvvar.h: netbsd-7-nhusb
sys/dev/usb/ezload.c: netbsd-7-nhusb
sys/dev/usb/ezload.h: netbsd-7-nhusb
sys/dev/usb/files.usb: netbsd-7-nhusb
sys/dev/usb/hid.c: netbsd-7-nhusb
sys/dev/usb/hid.h: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.c: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.h: netbsd-7-nhusb
sys/dev/usb/if_atu.c: netbsd-7-nhusb
sys/dev/usb/if_atureg.h: netbsd-7-nhusb
sys/dev/usb/if_aue.c: netbsd-7-nhusb
sys/dev/usb/if_auereg.h: netbsd-7-nhusb
sys/dev/usb/if_axe.c: netbsd-7-nhusb
sys/dev/usb/if_axen.c: netbsd-7-nhusb
sys/dev/usb/if_axenreg.h: netbsd-7-nhusb
sys/dev/usb/if_axereg.h: netbsd-7-nhusb
sys/dev/usb/if_cdce.c: netbsd-7-nhusb
sys/dev/usb/if_cdcereg.h: netbsd-7-nhusb
sys/dev/usb/if_cue.c: netbsd-7-nhusb
sys/dev/usb/if_cuereg.h: netbsd-7-nhusb
sys/dev/usb/if_kue.c: netbsd-7-nhusb
sys/dev/usb/if_kuereg.h: netbsd-7-nhusb
sys/dev/usb/if_otus.c: netbsd-7-nhusb
sys/dev/usb/if_otusvar.h: netbsd-7-nhusb
sys/dev/usb/if_rum.c: netbsd-7-nhusb
sys/dev/usb/if_rumreg.h: netbsd-7-nhusb
sys/dev/usb/if_rumvar.h: netbsd-7-nhusb
sys/dev/usb/if_run.c: netbsd-7-nhusb
sys/dev/usb/if_runvar.h: netbsd-7-nhusb
sys/dev/usb/if_smsc.c: netbsd-7-nhusb
sys/dev/usb/if_smscreg.h: netbsd-7-nhusb
sys/dev/usb/if_smscvar.h: netbsd-7-nhusb
sys/dev/usb/if_udav.c: netbsd-7-nhusb
sys/dev/usb/if_udavreg.h: netbsd-7-nhusb
sys/dev/usb/if_upgt.c: netbsd-7-nhusb
sys/dev/usb/if_upgtvar.h: netbsd-7-nhusb
sys/dev/usb/if_upl.c: netbsd-7-nhusb
sys/dev/usb/if_ural.c: netbsd-7-nhusb
sys/dev/usb/if_uralreg.h: netbsd-7-nhusb
sys/dev/usb/if_uralvar.h: netbsd-7-nhusb
sys/dev/usb/if_url.c: netbsd-7-nhusb
sys/dev/usb/if_urlreg.h: netbsd-7-nhusb
sys/dev/usb/if_urndis.c: netbsd-7-nhusb
sys/dev/usb/if_urndisreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtw.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn_data.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnvar.h: netbsd-7-nhusb
sys/dev/usb/if_urtwreg.h: netbsd-7-nhusb
sys/dev/usb/if_zyd.c: netbsd-7-nhusb
sys/dev/usb/if_zydreg.h: netbsd-7-nhusb
sys/dev/usb/irmce.c: netbsd-7-nhusb
sys/dev/usb/moscom.c: netbsd-7-nhusb
sys/dev/usb/motg.c: netbsd-7-nhusb
sys/dev/usb/motgvar.h: netbsd-7-nhusb
sys/dev/usb/ohci.c: netbsd-7-nhusb
sys/dev/usb/ohcireg.h: netbsd-7-nhusb
sys/dev/usb/ohcivar.h: netbsd-7-nhusb
sys/dev/usb/pseye.c: netbsd-7-nhusb
sys/dev/usb/slurm.c: netbsd-7-nhusb
sys/dev/usb/stuirda.c: netbsd-7-nhusb
sys/dev/usb/u3g.c: netbsd-7-nhusb
sys/dev/usb/uark.c: netbsd-7-nhusb
sys/dev/usb/uatp.c: netbsd-7-nhusb
sys/dev/usb/uaudio.c: netbsd-7-nhusb
sys/dev/usb/uberry.c: netbsd-7-nhusb
sys/dev/usb/ubsa.c: netbsd-7-nhusb
sys/dev/usb/ubsa_common.c: netbsd-7-nhusb
sys/dev/usb/ubsavar.h: netbsd-7-nhusb
sys/dev/usb/ubt.c: netbsd-7-nhusb
sys/dev/usb/uchcom.c: netbsd-7-nhusb
sys/dev/usb/ucom.c: netbsd-7-nhusb
sys/dev/usb/ucomvar.h: netbsd-7-nhusb
sys/dev/usb/ucycom.c: netbsd-7-nhusb
sys/dev/usb/udl.c: netbsd-7-nhusb
sys/dev/usb/udl.h: netbsd-7-nhusb
sys/dev/usb/udsbr.c: netbsd-7-nhusb
sys/dev/usb/udsir.c: netbsd-7-nhusb
sys/dev/usb/uep.c: netbsd-7-nhusb
sys/dev/usb/uftdi.c: netbsd-7-nhusb
sys/dev/usb/uftdireg.h: netbsd-7-nhusb
sys/dev/usb/ugen.c: netbsd-7-nhusb
sys/dev/usb/ugensa.c: netbsd-7-nhusb
sys/dev/usb/uhci.c: netbsd-7-nhusb
sys/dev/usb/uhcireg.h: netbsd-7-nhusb
sys/dev/usb/uhcivar.h: netbsd-7-nhusb
sys/dev/usb/uhid.c: netbsd-7-nhusb
sys/dev/usb/uhidev.c: netbsd-7-nhusb
sys/dev/usb/uhidev.h: netbsd-7-nhusb
sys/dev/usb/uhmodem.c: netbsd-7-nhusb
sys/dev/usb/uhso.c: netbsd-7-nhusb
sys/dev/usb/uhub.c: netbsd-7-nhusb
sys/dev/usb/uipad.c: netbsd-7-nhusb
sys/dev/usb/uipaq.c: netbsd-7-nhusb
sys/dev/usb/uirda.c: netbsd-7-nhusb
sys/dev/usb/uirdavar.h: netbsd-7-nhusb
sys/dev/usb/ukbd.c: netbsd-7-nhusb
sys/dev/usb/ukbdmap.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.h: netbsd-7-nhusb
sys/dev/usb/ulpt.c: netbsd-7-nhusb
sys/dev/usb/umass.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.h: netbsd-7-nhusb
sys/dev/usb/umass_quirks.c: netbsd-7-nhusb
sys/dev/usb/umass_quirks.h: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.c: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.h: netbsd-7-nhusb
sys/dev/usb/umassvar.h: netbsd-7-nhusb
sys/dev/usb/umcs.c: netbsd-7-nhusb
sys/dev/usb/umct.c: netbsd-7-nhusb
sys/dev/usb/umidi.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.h: netbsd-7-nhusb
sys/dev/usb/umodem.c: netbsd-7-nhusb
sys/dev/usb/umodem_common.c: netbsd-7-nhusb
sys/dev/usb/umodemvar.h: netbsd-7-nhusb
sys/dev/usb/ums.c: netbsd-7-nhusb
sys/dev/usb/uplcom.c: netbsd-7-nhusb
sys/dev/usb/urio.c: netbsd-7-nhusb
sys/dev/usb/urio.h: netbsd-7-nhusb
sys/dev/usb/usb.c: netbsd-7-nhusb
sys/dev/usb/usb.h: netbsd-7-nhusb
sys/dev/usb/usb_mem.c: netbsd-7-nhusb
sys/dev/usb/usb_mem.h: netbsd-7-nhusb
sys/dev/usb/usb_quirks.c: netbsd-7-nhusb
sys/dev/usb/usb_quirks.h: netbsd-7-nhusb
sys/dev/usb/usb_subr.c: netbsd-7-nhusb
sys/dev/usb/usbdevices.config: netbsd-7-nhusb
sys/dev/usb/usbdevs: netbsd-7-nhusb
sys/dev/usb/usbdevs.h: netbsd-7-nhusb
sys/dev/usb/usbdevs_data.h: netbsd-7-nhusb
sys/dev/usb/usbdi.c: netbsd-7-nhusb
sys/dev/usb/usbdi.h: netbsd-7-nhusb
sys/dev/usb/usbdi_util.c: netbsd-7-nhusb
sys/dev/usb/usbdi_util.h: netbsd-7-nhusb
sys/dev/usb/usbdivar.h: netbsd-7-nhusb
sys/dev/usb/usbhid.h: netbsd-7-nhusb
sys/dev/usb/usbhist.h: netbsd-7-nhusb
sys/dev/usb/usbroothub.c: netbsd-7-nhusb
sys/dev/usb/usbroothub.h: netbsd-7-nhusb
sys/dev/usb/usbroothub_subr.c: delete
sys/dev/usb/usbroothub_subr.h: delete
sys/dev/usb/uscanner.c: netbsd-7-nhusb
sys/dev/usb/uslsa.c: netbsd-7-nhusb
sys/dev/usb/usscanner.c: netbsd-7-nhusb
sys/dev/usb/ustir.c: netbsd-7-nhusb
sys/dev/usb/uthum.c: netbsd-7-nhusb
sys/dev/usb/utoppy.c: netbsd-7-nhusb
sys/dev/usb/uts.c: netbsd-7-nhusb
sys/dev/usb/uvideo.c: netbsd-7-nhusb
sys/dev/usb/uvisor.c: netbsd-7-nhusb
sys/dev/usb/uvscom.c: netbsd-7-nhusb
sys/dev/usb/uyap.c: netbsd-7-nhusb
sys/dev/usb/uyap_firmware.h: netbsd-7-nhusb
sys/dev/usb/uyurex.c: netbsd-7-nhusb
sys/dev/usb/x1input_rdesc.h: netbsd-7-nhusb
sys/dev/usb/xhci.c: netbsd-7-nhusb
sys/dev/usb/xhcireg.h: netbsd-7-nhusb
sys/dev/usb/xhcivar.h: netbsd-7-nhusb
sys/dev/usb/xinput_rdesc.h: netbsd-7-nhusb
sys/external/bsd/common/conf/files.linux: netbsd-7-nhusb
sys/external/bsd/common/include/linux/err.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/kernel.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/workqueue.h: netbsd-7-nhusb
sys/external/bsd/common/linux/linux_work.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/atombios_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/drm/files.drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/i915drm/files.i915drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/include/linux/err.h: delete
sys/external/bsd/drm2/include/linux/workqueue.h: delete
sys/external/bsd/drm2/linux/files.drmkms_linux: netbsd-7-nhusb
sys/external/bsd/drm2/linux/linux_work.c: delete
sys/external/bsd/dwc2/dwc2.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2var.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwctwo2netbsd: netbsd-7-nhusb
sys/external/bsd/dwc2/conf/files.dwc2: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_coreintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdddma.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hw.h: netbsd-7-nhusb
sys/modules/drmkms_linux/Makefile: netbsd-7-nhusb
sys/modules/i915drmkms/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libugenhc/ugenhc.c: netbsd-7-nhusb
sys/rump/dev/lib/libusb/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libusb/USB.ioconf: netbsd-7-nhusb
sys/rump/dev/lib/libusb/usb_at_ugenhc.c: delete
sys/rump/dev/lib/libusb/opt/opt_usb.h: delete
sys/rump/dev/lib/libusb/opt/opt_usbverbose.h: delete
sys/sys/mbuf.h: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.8: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.c: netbsd-7-nhusb
Merge netbsd-7-nhusb:
- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
- Change the SOFTINT level from NET to SERIAL for the USB softint handler.
This gives the callback a chance of running when another softint handler
at SOFTINT_NET has blocked holding a lock, e.g. softnet_lock and most of
the network stack.
- kern/49065 - ifconfig tun0 ... sequence locks up system / lockup:
softnet_lock held across usb xfr
- kern/50491 - unkillable wait in usbd_transfer while using usmsc0
on raspberry pi 2
- kern/51395 - USB Ethernet makes xhci hang
- Various improvements to slhci(4)
- Various improvements to dwc2(4)
 1.10.16.1 16-Apr-2018  pgoyette Sync with HEAD, resolve some conflicts
 1.11.16.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.12.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.13.12.1 02-Aug-2025  perseant Sync with HEAD
 1.15 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.14 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.13 24-Apr-2021  thorpej branches: 1.13.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.12 13-Oct-2013  riz branches: 1.12.44;
Catch up to recent changes in config_pending_{incr,decr}().
 1.11 27-Oct-2012  chs branches: 1.11.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.10 26-Jul-2011  dyoung branches: 1.10.2; 1.10.12;
Don't set the iobase and iosize members of pcmciabus_attach_args because
they're not used in any meaningful way.
 1.9 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.8 02-Mar-2009  nonaka Add missing config_pending_incr()/config_pending_incr().
 1.7 27-Feb-2009  nonaka Fix for the display of attach not to mix.

Before:
atabus0 at wdc0 channel 0
wd0 at atabus0 drive 0uhub0 at usb0: PXA27x OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
: <SILICON POWER>
wd0: drive supports 1-sector PIO transfers, LBA addressing
wd0: 7775 MB, 15798 cyl, 16 head, 63 sec, 512 bytes/sect x 15924384 sectors
wd0: drive supports PIO mode 4

After:
uhub0 at usb0: PXA27x OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
atabus0 at wdc0 channel 0
wdc1 at pcmcia1 function 0: <128MB, >
wdc1: i/o mapped mode
wd0 at atabus0 drive 0: <SILICON POWER>
wd0: drive supports 1-sector PIO transfers, LBA addressing
wd0: 7775 MB, 15798 cyl, 16 head, 63 sec, 512 bytes/sect x 15924384 sectors
wd0: drive supports PIO mode 4
 1.6 12-Feb-2009  nonaka Processing that installed the card first was moved from pxapcic_attach_common()
to the head of pxapcic_event_thread().
As a result, the problem that built-in CF card is not detected is solved.
This problem occurred because of the fix of kern/40531.
 1.5 29-Jan-2009  nonaka branches: 1.5.2;
- device_t/softc split.
- use aprint_* function.
 1.4 17-Oct-2007  garbled branches: 1.4.20; 1.4.28; 1.4.30;
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 09-Jul-2007  ad branches: 1.3.10; 1.3.12;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.2 04-Mar-2007  christos branches: 1.2.2; 1.2.4; 1.2.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.1 17-Dec-2006  peter branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.1.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 17-Dec-2006  ad file pxa2x0_pcic.c was added on branch newlock2 on 2007-01-12 01:00:42 +0000
 1.1.4.3 03-Sep-2007  yamt sync with head.
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 17-Dec-2006  yamt file pxa2x0_pcic.c was added on branch yamt-lazymbuf on 2006-12-30 20:45:38 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 17-Dec-2006  yamt file pxa2x0_pcic.c was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.2.10.1 03-Oct-2007  garbled Sync with HEAD
 1.2.4.1 11-Jul-2007  mjf Sync with head.
 1.2.2.1 15-Jul-2007  ad Sync with head.
 1.3.12.1 06-Nov-2007  matt sync with HEAD
 1.3.10.1 01-Jan-2008  chris Sync with HEAD.
 1.4.30.1 19-Feb-2009  snj Pull up following revision(s) (requested by nonaka in ticket #457):
sys/arch/arm/xscale/pxa2x0_pcic.c: revision 1.6
Processing that installed the card first was moved from pxapcic_attach_common()
to the head of pxapcic_event_thread().
As a result, the problem that built-in CF card is not detected is solved.
This problem occurred because of the fix of kern/40531.
 1.4.28.1 03-Mar-2009  skrll Sync with HEAD.
 1.4.20.1 04-May-2009  yamt sync with head.
 1.5.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.10.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.10.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.10.2.1 30-Oct-2012  yamt sync with head
 1.11.2.1 18-May-2014  rmind sync with head
 1.12.44.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.13.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.5 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.4 29-Jan-2009  nonaka branches: 1.4.14; 1.4.24;
- device_t/softc split.
- use aprint_* function.
 1.3 17-Oct-2007  garbled branches: 1.3.20; 1.3.28;
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 10-Jul-2007  nonaka branches: 1.2.10; 1.2.12;
Fix compile failure occured kthread API changes.
 1.1 17-Dec-2006  peter branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.14; 1.1.20;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.1.20.1 03-Oct-2007  garbled Sync with HEAD
 1.1.14.1 11-Jul-2007  mjf Sync with head.
 1.1.12.1 15-Jul-2007  ad Sync with head.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 17-Dec-2006  ad file pxa2x0_pcic.h was added on branch newlock2 on 2007-01-12 01:00:43 +0000
 1.1.4.3 03-Sep-2007  yamt sync with head.
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 17-Dec-2006  yamt file pxa2x0_pcic.h was added on branch yamt-lazymbuf on 2006-12-30 20:45:38 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 17-Dec-2006  yamt file pxa2x0_pcic.h was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.2.12.1 06-Nov-2007  matt sync with HEAD
 1.2.10.1 01-Jan-2008  chris Sync with HEAD.
 1.3.28.1 03-Mar-2009  skrll Sync with HEAD.
 1.3.20.1 04-May-2009  yamt sync with head.
 1.4.24.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.14.1 30-Oct-2012  yamt sync with head
 1.2 18-Dec-2006  nonaka Remove unused files.
 1.1 17-Dec-2006  peter branches: 1.1.2;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.1.2.3 21-Dec-2006  yamt sync with head.
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 17-Dec-2006  yamt file pxa2x0_pcicvar.h was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.9 07-Sep-2025  thorpej Change todr_chip_handle::cookie -> todr_chip_handle::todr_dev, and
make it a device_t. Upcoming functional changes will require the
device_t associated with a TODR device.

Change todr_chip_handle::bus_cookie -> todr_chip_handle::todr_devaux.
Nothing was using the old field, but I decided to keep it around just
in cause something needs it in the future.

And with these largely mechanical yet semantically meaningful changes,
thus spake the Oracle: "Welcome to NetBSD 11.99.2."
 1.8 24-Feb-2024  andvar Declare dt variable in PXARTC_DEBUG guarded blocks, since declarations were
removed in general one (likely as unused).

Fix dt.dt_year format specifier from %02d to expected %02lld.

Pass ch (todr_chip_handle_t), not sc (pxartc_softc) to rtc_wristwatch_gettime().

Fixes PXARTC_DEBUG enabled build (tested on zaurus).
 1.7 02-Jan-2020  thorpej In the wristwatch case, use todr_gettime_ymdhms / todr_settime_ymdhms.
 1.6 27-Oct-2012  chs branches: 1.6.38;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.5 01-Jul-2011  dyoung branches: 1.5.2; 1.5.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.4 14-May-2011  nonaka - Only when pxa_size isn't set, pxa_size is set.
- Split device_t/softc.
 1.3 12-Dec-2009  tsutsui branches: 1.3.4; 1.3.6;
Remove `volatile' qualifier from argument types of
struct timeval passed to todr_gettime(9) and todr_settime(9).
We no longer have an ancient and volatile struct timeval `time'
global since we have switched to MI timercounter(9) on all port.

XXX1: some of these RTC drivers still assume 32bit time_t
XXX2: some of these should be rewritten to use todr_[gs]ettime_ymdhms()
XXX3: todr(9) man page doesn't mention todr_[gs]ettime_ymdhms()
 1.2 09-Aug-2009  kiyohara Fix matching by improper driver.
see http://mail-index.netbsd.org/port-arm/2009/07/08/msg000807.html

And remove some white-spaces.
 1.1 25-Feb-2007  nonaka branches: 1.1.2; 1.1.6; 1.1.52;
Add PXA2x0 RTC driver.
 1.1.52.2 11-Mar-2010  yamt sync with head
 1.1.52.1 19-Aug-2009  yamt sync with head.
 1.1.6.2 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.1.6.1 25-Feb-2007  yamt file pxa2x0_rtc.c was added on branch yamt-idlelwp on 2007-02-27 16:49:41 +0000
 1.1.2.2 26-Feb-2007  yamt sync with head.
 1.1.2.1 25-Feb-2007  yamt file pxa2x0_rtc.c was added on branch yamt-lazymbuf on 2007-02-26 09:06:07 +0000
 1.3.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.3.4.1 31-May-2011  rmind sync with head
 1.5.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.2.1 30-Oct-2012  yamt sync with head
 1.6.38.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.14 21-Apr-2023  skrll Trailing whitespace
 1.13 16-Mar-2018  ryo use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
 1.12 24-Feb-2014  msaitoh branches: 1.12.28;
Remove unused variable. Fixes compile error.
 1.11 22-Feb-2014  matt Don't manipulate the pte to get uncached memory, use PMAP_NOCACHE instead.
Convert footbring to kenter_pa/kremove
 1.10 01-Jul-2011  dyoung branches: 1.10.2; 1.10.12; 1.10.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.9 07-Nov-2009  cegger Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.
 1.8 24-Nov-2005  yamt branches: 1.8.80;
bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
 1.7 01-Apr-2005  yamt branches: 1.7.2; 1.7.8;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.6 17-Mar-2005  bsh Switch kernels for Lubbock and TwinTail to use pmap_devmap to map
I/O registers that are used in early start-up stage. Also stop using
special bootstrap-time-only bus_space_map function in {lubbock,g42xxeb}_machdep.c.

This makes initarm() for them a bit simpler, and gives us smaller diffs
to other evbarm platforms.
 1.5 07-Jun-2004  nathanw branches: 1.5.4; 1.5.6;
pxa2x0_bs_unmap(): KVA allocated in pxa2x0_bs_map() needs to be freed.
 1.4 15-Jul-2003  lukem __KERNEL_RCSID()
 1.3 06-Jun-2003  scw branches: 1.3.2;
Add entries for byte-wide {read,write,set} region.
 1.2 24-Mar-2003  bsh + fix a crash when write-back cache is used, by calling PTE_SYNC()
after tweaking page table entry.

+ 4th argument of bus_space_map() is not only for BUS_SPACE_MAP_CACHEABLE.
 1.1 19-Oct-2002  bsh branches: 1.1.2;
Support Intel PXA250 and PXA210 application processors.
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 19-Oct-2002  nathanw file pxa2x0_space.c was added on branch nathanw_sa on 2002-11-11 21:57:02 +0000
 1.3.2.5 11-Dec-2005  christos Sync with head.
 1.3.2.4 01-Apr-2005  skrll Sync with HEAD.
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.5.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.6.1 28-Jan-2005  yamt convert arch/arm to new apis.
 1.5.4.1 29-Apr-2005  kent sync with -current
 1.7.8.1 29-Nov-2005  yamt sync with head.
 1.7.2.1 21-Jun-2006  yamt sync with head.
 1.8.80.1 11-Mar-2010  yamt sync with head
 1.10.16.1 18-May-2014  rmind sync with head
 1.10.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.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.12.28.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.5 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.4 09-Jun-2011  nonaka - device_t/softc split.
- use aprint_* function.
 1.3 09-Aug-2009  kiyohara branches: 1.3.4; 1.3.10;
Remove GPIO configuration for board dependently.
 1.2 09-Aug-2009  kiyohara Fix matching by improper driver.
see http://mail-index.netbsd.org/port-arm/2009/07/08/msg000807.html

And remove some white-spaces.
 1.1 17-Dec-2006  peter branches: 1.1.2; 1.1.4; 1.1.6; 1.1.56;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.1.56.1 19-Aug-2009  yamt sync with head.
 1.1.6.2 12-Jan-2007  ad Sync with head.
 1.1.6.1 17-Dec-2006  ad file pxa2x0_udc.c was added on branch newlock2 on 2007-01-12 01:00:43 +0000
 1.1.4.2 30-Dec-2006  yamt sync with head.
 1.1.4.1 17-Dec-2006  yamt file pxa2x0_udc.c was added on branch yamt-lazymbuf on 2006-12-30 20:45:38 +0000
 1.1.2.2 18-Dec-2006  yamt sync with head.
 1.1.2.1 17-Dec-2006  yamt file pxa2x0_udc.c was added on branch yamt-splraiseipl on 2006-12-18 11:42:04 +0000
 1.3.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.3.4.1 12-Jun-2011  rmind sync with head
 1.4 25-Feb-2007  nonaka Add PXA2x0 RTC driver.
 1.3 17-Dec-2006  peter branches: 1.3.2;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.2 11-Dec-2005  christos branches: 1.2.20; 1.2.22;
merge ktrace-lwp.
 1.1 04-Jul-2005  bsh branches: 1.1.2; 1.1.8;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 04-Jul-2005  skrll file pxa2x0cpu.h was added on branch ktrace-lwp on 2005-11-10 13:55:27 +0000
 1.1.2.2 26-Feb-2007  yamt sync with head.
 1.1.2.1 30-Dec-2006  yamt sync with head.
 1.2.22.1 18-Dec-2006  yamt sync with head.
 1.2.20.1 12-Jan-2007  ad Sync with head.
 1.3.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.28 09-Dec-2024  andvar s/autio/audio/ in comment.
 1.27 10-Feb-2024  andvar branches: 1.27.2;
fix various typos in comments and log messages.
 1.26 26-Dec-2021  andvar fix various typos, mainly in comments.
 1.25 05-Dec-2021  msaitoh s/stauts/status/
 1.24 10-Nov-2021  msaitoh s/Asychronous/Asynchronous/ in comment.
 1.23 23-Jun-2011  kiyohara Fix bit name ISR_UB. Not _UE.
And add comments for bit names from datasheet of PXA255.
 1.22 18-Jun-2011  nonaka Added some I2C register definition.
 1.21 15-May-2010  kiyohara branches: 1.21.6;
Add definitions for Power Manager Registers.
Add some fields for USBHC_UHCRHDB.
 1.20 11-May-2010  nonaka Add SSP SSSR register definitions.
 1.19 11-May-2010  nonaka Added some CKEN_* definition for pxa270.
 1.18 16-Mar-2009  nonaka branches: 1.18.2; 1.18.4;
Added DMA Alignment register definition.
 1.17 17-Oct-2007  garbled branches: 1.17.20; 1.17.28; 1.17.34;
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.16 28-Jun-2007  nonaka branches: 1.16.10; 1.16.12;
Added more LCD Controller register definition.
 1.15 26-Jun-2007  nonaka fix typo.
 1.14 25-Feb-2007  nonaka branches: 1.14.4; 1.14.6; 1.14.12;
Add PXA2x0 RTC driver.
 1.13 17-Dec-2006  peter branches: 1.13.2;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.12 16-Dec-2006  ober Zaurus Port from OpenBSD by Nonaka Kimihiro
OK gimpy
 1.11 10-Dec-2006  kiyohara Add definition the HWUART (and NSSP).
 1.10 25-Nov-2006  christos spell precede; from Zafer
 1.9 10-Apr-2006  simonb branches: 1.9.8; 1.9.10;
Fix a couple of typos in some comments.
 1.8 08-Mar-2006  lukem branches: 1.8.2;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.7 11-Dec-2005  christos branches: 1.7.4; 1.7.6; 1.7.8; 1.7.10;
merge ktrace-lwp.
 1.6 04-Jul-2005  bsh branches: 1.6.2;
add register definitions for PXA270, including those for USB host controller.

rename some constants from PXA2X0_* to PXA2[57]0_* since they have different values for PXA270.
 1.5 24-Sep-2004  nathanw PXA255 has 85 GPIO pins, not 81.
(The first revision of the manual listed the wrong number, although it had
all 85 in the table).
 1.4 11-Jun-2003  scw branches: 1.4.2;
- Correct a couple of comments.
- Set AC97_MODR to the right value.
- Add AC97_FEFIE.
 1.3 05-Jun-2003  scw - Rearrange the PXA2x0 support code to better support attaching
child drivers such as interrupt and gpio controllers.
- Add a function to probe SDRAM size at boot time.
- Add a function to configure the Clock Manager's CKEN settings.
- Add an INTC driver.
- Add a GPIO driver.
- Add attach glue for the PXA2x0's "almost" 16550-compatible uarts.
- Tweak the LCD driver to use the GPIO driver's services for setting
up GPIO pin function.
 1.2 18-Mar-2003  bsh add interrupt numbers for built-in peripherals.
add register definitions for DMA, AC97, and USB.
 1.1 19-Oct-2002  bsh branches: 1.1.2;
Support Intel PXA250 and PXA210 application processors.
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 19-Oct-2002  nathanw file pxa2x0reg.h was added on branch nathanw_sa on 2002-11-11 21:57:02 +0000
 1.4.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.1 19-Oct-2004  skrll Sync with HEAD
 1.6.2.4 03-Sep-2007  yamt sync with head.
 1.6.2.3 26-Feb-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.10.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.7.8.2 11-Apr-2006  yamt sync with head
 1.7.8.1 13-Mar-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.8.2.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.9.10.2 18-Dec-2006  yamt sync with head.
 1.9.10.1 10-Dec-2006  yamt sync with head.
 1.9.8.1 12-Jan-2007  ad Sync with head.
 1.13.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.14.12.2 03-Oct-2007  garbled Sync with HEAD
 1.14.12.1 26-Jun-2007  garbled Sync with HEAD.
 1.14.6.1 11-Jul-2007  mjf Sync with head.
 1.14.4.1 15-Jul-2007  ad Sync with head.
 1.16.12.1 06-Nov-2007  matt sync with HEAD
 1.16.10.1 01-Jan-2008  chris Sync with HEAD.
 1.17.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.17.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.17.20.2 11-Aug-2010  yamt sync with head.
 1.17.20.1 04-May-2009  yamt sync with head.
 1.18.4.1 30-May-2010  rmind sync with head
 1.18.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.21.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.27.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 09-Aug-2009  kiyohara Fix matching by improper driver.
see http://mail-index.netbsd.org/port-arm/2009/07/08/msg000807.html

And remove some white-spaces.
 1.5 21-Feb-2007  thorpej branches: 1.5.48;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
 1.4 17-Dec-2006  peter branches: 1.4.2;
Update from the latest Zaurus source from NONAKA Kimihiro.

Includes drivers for I2C, I2S, PCMCIA controller, USB device controller,
OHCI USB controller (from OpenBSD) and some improvements to the LCD
controller driver.
 1.3 16-Dec-2006  ober Zaurus Port from OpenBSD by Nonaka Kimihiro
OK gimpy
 1.2 05-Jun-2003  scw branches: 1.2.18; 1.2.48; 1.2.50;
- Rearrange the PXA2x0 support code to better support attaching
child drivers such as interrupt and gpio controllers.
- Add a function to probe SDRAM size at boot time.
- Add a function to configure the Clock Manager's CKEN settings.
- Add an INTC driver.
- Add a GPIO driver.
- Add attach glue for the PXA2x0's "almost" 16550-compatible uarts.
- Tweak the LCD driver to use the GPIO driver's services for setting
up GPIO pin function.
 1.1 19-Oct-2002  bsh branches: 1.1.2;
Support Intel PXA250 and PXA210 application processors.
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 19-Oct-2002  nathanw file pxa2x0var.h was added on branch nathanw_sa on 2002-11-11 21:57:03 +0000
 1.2.50.1 18-Dec-2006  yamt sync with head.
 1.2.48.1 12-Jan-2007  ad Sync with head.
 1.2.18.2 26-Feb-2007  yamt sync with head.
 1.2.18.1 30-Dec-2006  yamt sync with head.
 1.4.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.5.48.1 19-Aug-2009  yamt sync with head.
 1.14 12-Jul-2018  maxv Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.
 1.13 16-Apr-2009  rmind branches: 1.13.62; 1.13.64;
- Manage pid_table with kmem(9).
- Remove M_PROC and unused M_SESSION.
 1.12 17-Oct-2007  garbled branches: 1.12.20; 1.12.28; 1.12.34;
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.11 09-Oct-2007  ad splstatclock -> splhigh
 1.10 17-May-2006  mrg branches: 1.10.18; 1.10.26; 1.10.34; 1.10.36; 1.10.38; 1.10.40; 1.10.42;
make xscale_pmnc_write() return void, rather than returning an
uninitialised value that is not used by any caller.
 1.9 24-Dec-2005  perry branches: 1.9.4; 1.9.6; 1.9.8; 1.9.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 28-Oct-2003  chs branches: 1.7.16;
uninitialized variable.
 1.6 17-Jan-2003  thorpej branches: 1.6.2;
Merge the nathanw_sa branch.
 1.5 08-Oct-2002  thorpej Move XScale common prototypes to xscalevar.h. Add xscale_pmc_dispatch()
prototype. Include xscalevar.h has necessary to being prototypes into
scope.
 1.4 09-Aug-2002  thorpej branches: 1.4.2; 1.4.4; 1.4.6;
* PMC_TYPE_I80200 -> PMC_CLASS_I80200 to reflect the terminology
used in pmc(3).
* Some minor namespace cleanup.
 1.3 08-Aug-2002  briggs When configuring a counter, do not assume that it's not been configured in
this process (mask off the register field before setting it).
 1.2 07-Aug-2002  thorpej * XSCALE_PMC_TYPE_I80200 -> PMC_TYPE_I80200
* XSCALE_PMC_TYPE_CCNT -> PMC_TYPE_I80200_CCNT
* XSCALE_PMC_TYPE_PMCx -> PMC_TYPE_I80200_PMCx

Per discussion with Allen Briggs.
 1.1 07-Aug-2002  briggs Implement pmc(9) -- An interface to hardware performance monitoring
counters. These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.4.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.4.6.1 09-Aug-2002  jdolecek file xscale_pmc.c was added on branch kqueue on 2002-09-06 08:33:15 +0000
 1.4.4.2 30-Aug-2002  gehenna catch up with -current.
 1.4.4.1 09-Aug-2002  gehenna file xscale_pmc.c was added on branch gehenna-devsw on 2002-08-30 00:19:21 +0000
 1.4.2.4 31-Dec-2002  thorpej Tidy up use of curproc in the LWP universe.
 1.4.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.4.2.2 13-Aug-2002  nathanw Catch up to -current.
 1.4.2.1 09-Aug-2002  nathanw file xscale_pmc.c was added on branch nathanw_sa on 2002-08-13 02:18:00 +0000
 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.7.16.2 27-Oct-2007  yamt sync with head.
 1.7.16.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.8.1 24-May-2006  yamt sync with head.
 1.9.6.1 01-Jun-2006  kardel Sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.10.42.1 14-Oct-2007  yamt sync with head.
 1.10.40.1 06-Nov-2007  matt sync with HEAD
 1.10.38.1 01-Jan-2008  chris Sync with HEAD.
 1.10.36.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.10.34.1 01-Nov-2007  rjs Sync with HEAD.
 1.10.26.1 16-Oct-2007  garbled Sync with HEAD
 1.10.18.1 19-Oct-2007  ad Sync with head.
 1.12.34.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.12.28.1 28-Apr-2009  skrll Sync with HEAD.
 1.12.20.1 04-May-2009  yamt sync with head.
 1.13.64.1 10-Jun-2019  christos Sync with HEAD
 1.13.62.1 28-Jul-2018  pgoyette Sync with HEAD
 1.2 07-Aug-2002  briggs Implement pmc(9) -- An interface to hardware performance monitoring
counters. These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface. Initially, the Intel XScale
counters are the only ones supported.
 1.1 26-Mar-2002  thorpej branches: 1.1.2; 1.1.4; 1.1.8;
Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.
 1.1.8.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 26-Mar-2002  jdolecek file xscalereg.h was added on branch kqueue on 2002-06-23 17:34:59 +0000
 1.1.4.1 30-Aug-2002  gehenna catch up with -current.
 1.1.2.3 13-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 26-Mar-2002  nathanw file xscalereg.h was added on branch nathanw_sa on 2002-04-01 07:39:17 +0000
 1.2 12-Jul-2018  maxv Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.
 1.1 08-Oct-2002  thorpej branches: 1.1.2; 1.1.202; 1.1.204;
Move XScale common prototypes to xscalevar.h. Add xscale_pmc_dispatch()
prototype. Include xscalevar.h has necessary to being prototypes into
scope.
 1.1.204.1 10-Jun-2019  christos Sync with HEAD
 1.1.202.1 28-Jul-2018  pgoyette Sync with HEAD
 1.1.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.1 08-Oct-2002  nathanw file xscalevar.h was added on branch nathanw_sa on 2002-10-18 02:35:45 +0000

RSS XML Feed