Home | History | Annotate | only in /src/sys/arch/arm/ixp12x0
History log of /src/sys/arch/arm/ixp12x0
RevisionDateAuthorComments
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 13-Jul-2003  igy using common bus_space_tag in ixpsip too
 1.4 17-Feb-2003  ichiro branches: 1.4.2;
files.ixp12x0
no need device ixpcom in evbarm/conf/files.evbarm move it to
arm/ixp12x0/files.ixp12x0

ixp12x0_com.c:
some fix around address handling
1. Do not call bus_space_map() in ixpcominit(). Calling bus_space_map()
is not safe here, because bus_space_map() calls uvm_km_valloc() but
uvm is not yet initialized.
2. Use dv_unit to determine console instead comparering iobase.
Now you can attach ixpcom0 with physical address like this:
ixpcom* at ixpsip? addr 0x90000000 size 0x4000
Statically mapped address (0xf0000000) is still usable.

ixp12x0_clk:
1. access PLL_CFG register via bus_space
2. Make the delay() working correctly. (bug fix)
3. Start the timer device without interrupt on attach time.
Now delay() called before cpu_initclocks() works fine.

ixp12x0_pci:
1.Mapping PCI type0/1 configuration space to the upper address.
2."PCI I/O Cycle Access" mapping to same virtual address(VA==PA)
but size of this mapping increase to 1MByte because fails
cause couldnt set L2 table.
3.use bus_space address handling in ixp12x0_pci.c.
 1.3 03-Jan-2003  thorpej Use the generic irq_dispatch.S
 1.2 20-Jul-2002  ichiro branches: 1.2.2; 1.2.4; 1.2.6;
attach/match separated from ixp12x0_com
Some bug of com driver have been improved.
 1.1 15-Jul-2002  ichiro add support for ixp12x0
 1.2.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.6.1 20-Jul-2002  jdolecek file files.ixp12x0 was added on branch kqueue on 2002-09-06 08:32:48 +0000
 1.2.4.2 03-Jan-2003  thorpej Sync with HEAD.
 1.2.4.1 20-Jul-2002  thorpej file files.ixp12x0 was added on branch nathanw_sa on 2003-01-03 16:41:09 +0000
 1.2.2.2 21-Jul-2002  gehenna catch up with -current.
 1.2.2.1 20-Jul-2002  gehenna file files.ixp12x0 was added on branch gehenna-devsw on 2002-07-21 13:00:29 +0000
 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.22 25-Jun-2025  andvar s/Spase/Space/ in comment.
 1.21 07-Aug-2021  thorpej branches: 1.21.12;
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 27-Oct-2012  chs branches: 1.19.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.18 01-Jul-2011  dyoung branches: 1.18.2; 1.18.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.17 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.16 21-Oct-2009  rmind branches: 1.16.4; 1.16.6;
Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.15 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.14 11-Dec-2005  christos branches: 1.14.80; 1.14.88; 1.14.94;
merge ktrace-lwp.
 1.13 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.12 15-Sep-2003  ichiro fix typo
#if DEBUG -> #ifdef PCI_DEBUG
 1.11 13-Jul-2003  igy mapping pci configuration space (not subregion)
 1.10 13-Jul-2003  igy sharing bus_space_tag among ixpio, pci mem and i/o.
 1.9 13-Jul-2003  igy using devmap for static mapping
 1.8 15-Jun-2003  fvdl branches: 1.8.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.7 25-Mar-2003  igy Add __KERNEL_RCSID tags
 1.6 17-Feb-2003  ichiro files.ixp12x0
no need device ixpcom in evbarm/conf/files.evbarm move it to
arm/ixp12x0/files.ixp12x0

ixp12x0_com.c:
some fix around address handling
1. Do not call bus_space_map() in ixpcominit(). Calling bus_space_map()
is not safe here, because bus_space_map() calls uvm_km_valloc() but
uvm is not yet initialized.
2. Use dv_unit to determine console instead comparering iobase.
Now you can attach ixpcom0 with physical address like this:
ixpcom* at ixpsip? addr 0x90000000 size 0x4000
Statically mapped address (0xf0000000) is still usable.

ixp12x0_clk:
1. access PLL_CFG register via bus_space
2. Make the delay() working correctly. (bug fix)
3. Start the timer device without interrupt on attach time.
Now delay() called before cpu_initclocks() works fine.

ixp12x0_pci:
1.Mapping PCI type0/1 configuration space to the upper address.
2."PCI I/O Cycle Access" mapping to same virtual address(VA==PA)
but size of this mapping increase to 1MByte because fails
cause couldnt set L2 table.
3.use bus_space address handling in ixp12x0_pci.c.
 1.5 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.4 02-Dec-2002  ichiro changes&fix name of mapping registers
 1.3 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.2 21-Jul-2002  ichiro branches: 1.2.2; 1.2.4;
some bug fix and cosmetic changes
 1.1 15-Jul-2002  ichiro branches: 1.1.2;
add support for ixp12x0
 1.1.2.3 30-Aug-2002  gehenna catch up with -current.
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixp12x0.c was added on branch gehenna-devsw on 2002-07-21 13:00:29 +0000
 1.2.4.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.4.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.4.1 21-Jul-2002  jdolecek file ixp12x0.c was added on branch kqueue on 2002-09-06 08:32:48 +0000
 1.2.2.4 03-Jan-2003  thorpej Sync with HEAD.
 1.2.2.3 11-Dec-2002  thorpej Sync with HEAD.
 1.2.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.1 21-Jul-2002  nathanw file ixp12x0.c was added on branch nathanw_sa on 2002-10-18 02:35:36 +0000
 1.8.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.2 03-Sep-2004  skrll Sync with HEAD
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.14.94.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.14.88.1 28-Apr-2009  skrll Sync with HEAD.
 1.14.80.2 11-Mar-2010  yamt sync with head
 1.14.80.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.18.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.18.2.1 30-Oct-2012  yamt sync with head
 1.19.52.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.21.12.1 02-Aug-2025  perseant Sync with HEAD
 1.19 31-Jul-2021  andvar fix more typos in style found one in file - check/fix them all.
 1.18 29-May-2020  rin branches: 1.18.6;
For struct timecounter, use C99 initializers.
Compile tested. No functional changes intended.
 1.17 12-Nov-2012  skrll C99 types
 1.16 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.15 01-Jul-2011  dyoung branches: 1.15.2; 1.15.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.14 10-May-2008  martin Backout previous: the license sweep touched these files in error, so
restore the old license.
 1.13 28-Apr-2008  martin branches: 1.13.2;
Remove clause 3 and 4 from TNF licenses
 1.12 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.11 06-Jan-2007  christos branches: 1.11.20; 1.11.24; 1.11.26; 1.11.32; 1.11.38;
Add generic TOD support. From Bucky Katz.
 1.10 11-Dec-2005  christos branches: 1.10.20; 1.10.24;
merge ktrace-lwp.
 1.9 04-Jun-2005  he branches: 1.9.2;
Fix shadowing warnings by renaming local variables and by
removing parameter names in function prototype.
 1.8 13-Jul-2003  igy KNF
 1.7 25-Mar-2003  igy branches: 1.7.2;
Add __KERNEL_RCSID tags
 1.6 17-Feb-2003  ichiro files.ixp12x0
no need device ixpcom in evbarm/conf/files.evbarm move it to
arm/ixp12x0/files.ixp12x0

ixp12x0_com.c:
some fix around address handling
1. Do not call bus_space_map() in ixpcominit(). Calling bus_space_map()
is not safe here, because bus_space_map() calls uvm_km_valloc() but
uvm is not yet initialized.
2. Use dv_unit to determine console instead comparering iobase.
Now you can attach ixpcom0 with physical address like this:
ixpcom* at ixpsip? addr 0x90000000 size 0x4000
Statically mapped address (0xf0000000) is still usable.

ixp12x0_clk:
1. access PLL_CFG register via bus_space
2. Make the delay() working correctly. (bug fix)
3. Start the timer device without interrupt on attach time.
Now delay() called before cpu_initclocks() works fine.

ixp12x0_pci:
1.Mapping PCI type0/1 configuration space to the upper address.
2."PCI I/O Cycle Access" mapping to same virtual address(VA==PA)
but size of this mapping increase to 1MByte because fails
cause couldnt set L2 table.
3.use bus_space address handling in ixp12x0_pci.c.
 1.5 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.4 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.3 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.2 21-Jul-2002  ichiro branches: 1.2.2; 1.2.4;
some bug fix and cosmetic changes
 1.1 15-Jul-2002  ichiro branches: 1.1.2;
add support for ixp12x0
 1.1.2.3 30-Aug-2002  gehenna catch up with -current.
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixp12x0_clk.c was added on branch gehenna-devsw on 2002-07-21 13:00:29 +0000
 1.2.4.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.4.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.4.1 21-Jul-2002  jdolecek file ixp12x0_clk.c was added on branch kqueue on 2002-09-06 08:32:49 +0000
 1.2.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.1 21-Jul-2002  nathanw file ixp12x0_clk.c was added on branch nathanw_sa on 2002-10-18 02:35:36 +0000
 1.7.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 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.2.2 21-Jan-2008  yamt sync with head
 1.9.2.1 26-Feb-2007  yamt sync with head.
 1.10.24.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.10.20.1 12-Jan-2007  ad Sync with head.
 1.11.38.1 20-Jan-2008  bouyer Sync with HEAD
 1.11.32.1 18-Feb-2008  mjf Sync with HEAD.
 1.11.26.1 23-Mar-2008  matt sync with HEAD
 1.11.24.1 27-Jan-2008  chris Sync to HEAD.
 1.11.20.1 28-Feb-2008  rjs Sync with HEAD.
 1.13.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.15.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.15.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.15.2.1 30-Oct-2012  yamt sync with head
 1.18.6.1 01-Aug-2021  thorpej Sync with HEAD.
 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 06-Mar-2003  igy branches: 1.3.110;
insert macro to protect itself against multiple includion.
 1.2 17-Feb-2003  ichiro files.ixp12x0
no need device ixpcom in evbarm/conf/files.evbarm move it to
arm/ixp12x0/files.ixp12x0

ixp12x0_com.c:
some fix around address handling
1. Do not call bus_space_map() in ixpcominit(). Calling bus_space_map()
is not safe here, because bus_space_map() calls uvm_km_valloc() but
uvm is not yet initialized.
2. Use dv_unit to determine console instead comparering iobase.
Now you can attach ixpcom0 with physical address like this:
ixpcom* at ixpsip? addr 0x90000000 size 0x4000
Statically mapped address (0xf0000000) is still usable.

ixp12x0_clk:
1. access PLL_CFG register via bus_space
2. Make the delay() working correctly. (bug fix)
3. Start the timer device without interrupt on attach time.
Now delay() called before cpu_initclocks() works fine.

ixp12x0_pci:
1.Mapping PCI type0/1 configuration space to the upper address.
2."PCI I/O Cycle Access" mapping to same virtual address(VA==PA)
but size of this mapping increase to 1MByte because fails
cause couldnt set L2 table.
3.use bus_space address handling in ixp12x0_pci.c.
 1.1 15-Jul-2002  ichiro branches: 1.1.2; 1.1.4; 1.1.6;
add support for ixp12x0
 1.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 15-Jul-2002  jdolecek file ixp12x0_clkreg.h was added on branch kqueue on 2002-09-06 08:32:49 +0000
 1.1.4.2 15-Jul-2002  ichiro add support for ixp12x0
 1.1.4.1 15-Jul-2002  ichiro file ixp12x0_clkreg.h was added on branch nathanw_sa on 2002-07-15 16:27:17 +0000
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixp12x0_clkreg.h was added on branch gehenna-devsw on 2002-07-21 13:00:29 +0000
 1.3.110.1 11-Mar-2010  yamt sync with head
 1.50 21-Jul-2022  andvar fix typos in comments and log messages, mainly s/intrrupt/interrupt/.
 1.49 20-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.48 10-Nov-2019  chs branches: 1.48.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.47 13-Apr-2015  riastradh branches: 1.47.18;
MD rnd.h cleanups. Please let me know if I broke anything!
 1.46 15-Nov-2014  christos branches: 1.46.2;
centralize the call unit / dialout macros
 1.45 10-Aug-2014  tls Merge tls-earlyentropy branch into HEAD.
 1.44 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.43 16-Mar-2014  dholland branches: 1.43.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.42 12-Nov-2012  skrll branches: 1.42.2;
C99 types
 1.41 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.40 02-Feb-2012  tls branches: 1.40.6;
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.39 01-Jul-2011  dyoung branches: 1.39.2; 1.39.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.38 24-Apr-2011  rmind Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.37 15-Nov-2010  uebayasi branches: 1.37.2;
struct lwp * deref (for kauth).
 1.36 14-Mar-2009  dsl branches: 1.36.4;
Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.35 14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.34 11-Jun-2008  cegger branches: 1.34.4; 1.34.10;
use device_lookup_private to get softc
 1.33 28-Apr-2008  martin branches: 1.33.2; 1.33.4;
Remove clause 3 and 4 from TNF licenses
 1.32 08-Jan-2008  matt branches: 1.32.6; 1.32.8; 1.32.10;
As of this commit, all arm32 kernel now build.
 1.31 19-Nov-2007  ad branches: 1.31.6;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.30 04-Mar-2007  christos branches: 1.30.2; 1.30.16; 1.30.18; 1.30.20; 1.30.22; 1.30.26; 1.30.28;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.29 01-Oct-2006  elad branches: 1.29.4;
More from Matt Fleming:

Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
 1.28 01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks!
 1.27 23-Jul-2006  ad branches: 1.27.4; 1.27.6;
Use the LWP cached credentials where sane.
 1.26 14-May-2006  elad integrate kauth.
 1.25 26-Mar-2006  thorpej Use device_unit().
 1.24 08-Mar-2006  he branches: 1.24.2;
Remove yet another instance of the macro triplet SET/CLR/ISSET, now
found in <sys/types.h>.
 1.23 20-Feb-2006  thorpej branches: 1.23.2; 1.23.4;
Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
 1.22 11-Dec-2005  christos branches: 1.22.2; 1.22.4; 1.22.6;
merge ktrace-lwp.
 1.21 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.
 1.20 04-Jun-2005  he branches: 1.20.2;
Fix shadowing warnings by renaming local variables and by
removing parameter names in function prototype.
 1.19 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.18 29-Jun-2003  fvdl branches: 1.18.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.17 29-Jun-2003  ichiro struct proc * -> struct lwp *
 1.16 25-Mar-2003  igy Add __KERNEL_RCSID tags
 1.15 06-Mar-2003  igy catch up to consdev update
 1.14 06-Mar-2003  igy Remove #ifdef __HAVE_GENERIC_SOFT_INTERRUPTS switch and old interrupt
support. Ixp12x0 port always uses generic soft interrupt.
 1.13 22-Feb-2003  igy correct physical/virtual address handling

- to identify device instance, using hardware address.
- when console accesses device, using statically mapped address.
- when tty accesses device, using handler given by bus_space_map().
 1.12 21-Feb-2003  igy Don't use dv_unit to determine console. Back to comparing iobase again.
We always assume ixpcom is at statically mapped address (0xf0000000).
 1.11 21-Feb-2003  igy implement ioctl
 1.10 17-Feb-2003  ichiro files.ixp12x0
no need device ixpcom in evbarm/conf/files.evbarm move it to
arm/ixp12x0/files.ixp12x0

ixp12x0_com.c:
some fix around address handling
1. Do not call bus_space_map() in ixpcominit(). Calling bus_space_map()
is not safe here, because bus_space_map() calls uvm_km_valloc() but
uvm is not yet initialized.
2. Use dv_unit to determine console instead comparering iobase.
Now you can attach ixpcom0 with physical address like this:
ixpcom* at ixpsip? addr 0x90000000 size 0x4000
Statically mapped address (0xf0000000) is still usable.

ixp12x0_clk:
1. access PLL_CFG register via bus_space
2. Make the delay() working correctly. (bug fix)
3. Start the timer device without interrupt on attach time.
Now delay() called before cpu_initclocks() works fine.

ixp12x0_pci:
1.Mapping PCI type0/1 configuration space to the upper address.
2."PCI I/O Cycle Access" mapping to same virtual address(VA==PA)
but size of this mapping increase to 1MByte because fails
cause couldnt set L2 table.
3.use bus_space address handling in ixp12x0_pci.c.
 1.9 03-Dec-2002  ichiro initialize ixpcomconsaddr
use splserial()
fix IXPCOM registers
 1.8 02-Dec-2002  ichiro use bus_space map
 1.7 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.6 09-Oct-2002  thorpej branches: 1.6.2;
Make this compile with strict prototypes.
 1.5 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.4 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.3 21-Jul-2002  ichiro branches: 1.3.2; 1.3.4;
some bug fix and cosmetic changes
 1.2 20-Jul-2002  ichiro branches: 1.2.2;
attach/match separated from ixp12x0_com
Some bug of com driver have been improved.
 1.1 15-Jul-2002  ichiro add support for ixp12x0
 1.2.2.3 30-Aug-2002  gehenna catch up with -current.
 1.2.2.2 21-Jul-2002  gehenna Add a character device switch.
 1.2.2.1 20-Jul-2002  gehenna file ixp12x0_com.c was added on branch gehenna-devsw on 2002-07-21 12:02:52 +0000
 1.3.4.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.3.4.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.4.1 21-Jul-2002  jdolecek file ixp12x0_com.c was added on branch kqueue on 2002-09-06 08:32:50 +0000
 1.3.2.5 11-Dec-2002  thorpej Sync with HEAD.
 1.3.2.4 11-Nov-2002  nathanw Catch up to -current
 1.3.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.3.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.3.2.1 21-Jul-2002  nathanw file ixp12x0_com.c was added on branch nathanw_sa on 2002-09-17 21:13:34 +0000
 1.6.2.1 24-Oct-2002  bjh21 Sync with trunk.
 1.18.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.18.2.4 17-Jan-2005  skrll Adapt to branch.
 1.18.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.18.2.1 03-Aug-2004  skrll Sync with HEAD
 1.20.2.5 21-Jan-2008  yamt sync with head
 1.20.2.4 07-Dec-2007  yamt sync with head
 1.20.2.3 03-Sep-2007  yamt sync with head.
 1.20.2.2 30-Dec-2006  yamt sync with head.
 1.20.2.1 21-Jun-2006  yamt sync with head.
 1.22.6.2 01-Jun-2006  kardel Sync with head.
 1.22.6.1 22-Apr-2006  simonb Sync with head.
 1.22.4.1 09-Sep-2006  rpaulo sync with head
 1.22.2.1 01-Mar-2006  yamt sync with head.
 1.23.4.4 13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.23.4.3 19-Apr-2006  elad sync with head - hopefully this will work
 1.23.4.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.23.4.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.23.2.4 11-Aug-2006  yamt sync with head
 1.23.2.3 24-May-2006  yamt sync with head.
 1.23.2.2 01-Apr-2006  yamt sync with head.
 1.23.2.1 13-Mar-2006  yamt sync with head.
 1.24.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.24.2.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.27.6.1 22-Oct-2006  yamt sync with head
 1.27.4.1 18-Nov-2006  ad Sync with head.
 1.29.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.30.28.2 18-Feb-2008  mjf Sync with HEAD.
 1.30.28.1 08-Dec-2007  mjf Sync with HEAD.
 1.30.26.1 21-Nov-2007  bouyer Sync with HEAD
 1.30.22.1 09-Jan-2008  matt sync with HEAD
 1.30.20.2 20-Jan-2008  chris Sync to HEAD.
 1.30.20.1 01-Jan-2008  chris Sync with HEAD.
 1.30.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.30.16.2 28-Feb-2008  rjs Sync with HEAD.
 1.30.16.1 26-Dec-2007  rjs Sync with HEAD.
 1.30.2.1 03-Dec-2007  ad Sync with HEAD.
 1.31.6.1 08-Jan-2008  bouyer Sync with HEAD
 1.32.10.2 04-May-2009  yamt sync with head.
 1.32.10.1 16-May-2008  yamt sync with head.
 1.32.8.2 17-Jun-2008  yamt sync with head.
 1.32.8.1 18-May-2008  yamt sync with head.
 1.32.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.32.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.33.4.1 18-Jun-2008  simonb Sync with head.
 1.33.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.34.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.34.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.36.4.2 31-May-2011  rmind sync with head
 1.36.4.1 05-Mar-2011  rmind sync with head
 1.37.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.39.6.1 18-Feb-2012  mrg merge to -current.
 1.39.2.4 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.39.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.39.2.2 30-Oct-2012  yamt sync with head
 1.39.2.1 17-Apr-2012  yamt sync with head
 1.40.6.3 03-Dec-2017  jdolecek update from HEAD
 1.40.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.40.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.42.2.1 18-May-2014  rmind sync with head
 1.43.2.2 10-Aug-2014  tls Rebase.
 1.43.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.46.2.1 06-Jun-2015  skrll Sync with HEAD
 1.47.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.48.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.3 13-Jul-2003  igy code clean up
 1.2 27-Sep-2002  provos branches: 1.2.8;
remove trailing \n in panic(). approved perry.
 1.1 15-Jul-2002  ichiro branches: 1.1.2; 1.1.4; 1.1.6;
add support for ixp12x0
 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 15-Jul-2002  jdolecek file ixp12x0_com_io.c was added on branch kqueue on 2002-09-06 08:32:51 +0000
 1.1.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.1 15-Jul-2002  nathanw file ixp12x0_com_io.c was added on branch nathanw_sa on 2002-10-18 02:35:36 +0000
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixp12x0_com_io.c was added on branch gehenna-devsw on 2002-07-21 13:00:29 +0000
 1.2.8.1 03-Aug-2004  skrll Sync with HEAD
 1.8 21-Oct-2009  rmind Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.7 06-Mar-2003  igy branches: 1.7.110;
insert macro to protect itself against multiple includion.
 1.6 22-Feb-2003  igy correct physical/virtual address handling

- to identify device instance, using hardware address.
- when console accesses device, using statically mapped address.
- when tty accesses device, using handler given by bus_space_map().
 1.5 17-Feb-2003  ichiro files.ixp12x0
no need device ixpcom in evbarm/conf/files.evbarm move it to
arm/ixp12x0/files.ixp12x0

ixp12x0_com.c:
some fix around address handling
1. Do not call bus_space_map() in ixpcominit(). Calling bus_space_map()
is not safe here, because bus_space_map() calls uvm_km_valloc() but
uvm is not yet initialized.
2. Use dv_unit to determine console instead comparering iobase.
Now you can attach ixpcom0 with physical address like this:
ixpcom* at ixpsip? addr 0x90000000 size 0x4000
Statically mapped address (0xf0000000) is still usable.

ixp12x0_clk:
1. access PLL_CFG register via bus_space
2. Make the delay() working correctly. (bug fix)
3. Start the timer device without interrupt on attach time.
Now delay() called before cpu_initclocks() works fine.

ixp12x0_pci:
1.Mapping PCI type0/1 configuration space to the upper address.
2."PCI I/O Cycle Access" mapping to same virtual address(VA==PA)
but size of this mapping increase to 1MByte because fails
cause couldnt set L2 table.
3.use bus_space address handling in ixp12x0_pci.c.
 1.4 03-Dec-2002  ichiro initialize ixpcomconsaddr
use splserial()
fix IXPCOM registers
 1.3 02-Dec-2002  ichiro use bus_space map
 1.2 20-Jul-2002  ichiro branches: 1.2.2; 1.2.4; 1.2.6;
attach/match separated from ixp12x0_com
Some bug of com driver have been improved.
 1.1 15-Jul-2002  ichiro add support for ixp12x0
 1.2.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.6.1 20-Jul-2002  jdolecek file ixp12x0_comreg.h was added on branch kqueue on 2002-09-06 08:32:52 +0000
 1.2.4.2 11-Dec-2002  thorpej Sync with HEAD.
 1.2.4.1 20-Jul-2002  thorpej file ixp12x0_comreg.h was added on branch nathanw_sa on 2002-12-11 05:53:10 +0000
 1.2.2.2 21-Jul-2002  gehenna catch up with -current.
 1.2.2.1 20-Jul-2002  gehenna file ixp12x0_comreg.h was added on branch gehenna-devsw on 2002-07-21 13:00:30 +0000
 1.7.110.1 11-Mar-2010  yamt sync with head
 1.7 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.6 02-May-2008  martin branches: 1.6.34; 1.6.44;
Use standard 2 clause license
 1.5 06-Mar-2003  igy branches: 1.5.106; 1.5.108; 1.5.110;
Remove #ifdef __HAVE_GENERIC_SOFT_INTERRUPTS switch and old interrupt
support. Ixp12x0 port always uses generic soft interrupt.
 1.4 22-Feb-2003  igy correct physical/virtual address handling

- to identify device instance, using hardware address.
- when console accesses device, using statically mapped address.
- when tty accesses device, using handler given by bus_space_map().
 1.3 02-Dec-2002  ichiro use bus_space map
 1.2 20-Jul-2002  ichiro branches: 1.2.2; 1.2.4; 1.2.6;
attach/match separated from ixp12x0_com
Some bug of com driver have been improved.
 1.1 15-Jul-2002  ichiro add support for ixp12x0
 1.2.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.6.1 20-Jul-2002  jdolecek file ixp12x0_comvar.h was added on branch kqueue on 2002-09-06 08:32:52 +0000
 1.2.4.2 11-Dec-2002  thorpej Sync with HEAD.
 1.2.4.1 20-Jul-2002  thorpej file ixp12x0_comvar.h was added on branch nathanw_sa on 2002-12-11 05:53:10 +0000
 1.2.2.2 21-Jul-2002  gehenna catch up with -current.
 1.2.2.1 20-Jul-2002  gehenna file ixp12x0_comvar.h was added on branch gehenna-devsw on 2002-07-21 13:00:30 +0000
 1.5.110.1 16-May-2008  yamt sync with head.
 1.5.108.1 18-May-2008  yamt sync with head.
 1.5.106.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.44.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.6.34.1 30-Oct-2012  yamt sync with head
 1.33 20-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.32 10-Nov-2019  chs branches: 1.32.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.31 08-Apr-2015  ozaki-r branches: 1.31.18;
Include sys/lwp.h instead of arm/cpu.h

sys/lwp.h is preferred because arm/cpu.h has a dependency on sys/lwp.h.

Suggested by skrll@ and matt@
 1.30 07-Apr-2015  ozaki-r Add missing #include <arm/cpu.h>
 1.29 26-Mar-2014  christos branches: 1.29.6;
kill sprintf
 1.28 20-Mar-2014  skrll Mechanically replace simplelock with kmutex_t.
 1.27 02-Mar-2014  joerg GC ipending.
 1.26 18-Dec-2013  skrll Remove unused variable
 1.25 18-Aug-2013  matt <arm/locore.h> fallout (fixes some include ordering errors)
 1.24 12-Nov-2012  skrll branches: 1.24.2;
C99 types
 1.23 02-Aug-2012  skrll branches: 1.23.2;
Remove irqframe and replace with identical trapframe.
 1.22 01-Jul-2011  dyoung branches: 1.22.2;
#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 28-Apr-2008  martin branches: 1.19.20; 1.19.22;
Remove clause 3 and 4 from TNF licenses
 1.18 27-Apr-2008  matt Merge kernel changes in matt-armv6 to HEAD.
 1.17 08-Jan-2008  matt branches: 1.17.6; 1.17.8; 1.17.10;
As of this commit, all arm32 kernel now build.
 1.16 06-Jan-2008  matt Truly kill current_intr_depth once and for all.
 1.15 24-Nov-2006  wiz branches: 1.15.24; 1.15.28; 1.15.30; 1.15.36; 1.15.44;
s/heirarchy/hierarchy/, from Zafer.
 1.14 24-Dec-2005  perry branches: 1.14.20; 1.14.22;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.13 11-Dec-2005  christos merge ktrace-lwp.
 1.12 14-Aug-2005  he Fix one more missed clockframe -> irqframe transition.
 1.11 21-Sep-2003  matt branches: 1.11.16;
Fix GCC 3.3.1 nits.
 1.10 21-Jul-2003  igy Delaying to mask interrupt by hardware until actually it occurs.

The new code maintains two variables 'current_spl_level' and
'hardware_spl_level'. Variable hardware_spl_level reflects actual
priority level at the hardware's point of view. hardware_spl_level is
always synchronized to hardware.

splraise() just increases current_spl_level. splx() sets
current_spl_level. If (and only if) hardware_spl_level and
current_spl_level is not same, splx() synchronizes interrupt mask
register and hardware_spl_level to current_spl_level.

In most case, splraise() raises current_spl_level and splx() restores
only current_spl_level.

When an interrupt occurs, hardware_spl_level and interrupt mask
register are synchronized to current_spl_level.

In this implementation, during a higher priority interrupt handler is
running, lower priority interrupts never cause intr_dispatch() to run.
It will avoid some race condition.
 1.9 13-Jul-2003  igy code clean up
 1.8 16-Jun-2003  thorpej branches: 1.8.2;
Rename IPL_IMP -> IPL_VM.
 1.7 25-Mar-2003  igy Add __KERNEL_RCSID tags
 1.6 22-Feb-2003  igy fix incorrect interrupt mask handling.
pci_imask[IPL_NET] is incorrectly ORed on imask[IPL_SOFTSERIAL].
imask[IPL_NET] should be ORed.
 1.5 17-Feb-2003  ichiro files.ixp12x0
no need device ixpcom in evbarm/conf/files.evbarm move it to
arm/ixp12x0/files.ixp12x0

ixp12x0_com.c:
some fix around address handling
1. Do not call bus_space_map() in ixpcominit(). Calling bus_space_map()
is not safe here, because bus_space_map() calls uvm_km_valloc() but
uvm is not yet initialized.
2. Use dv_unit to determine console instead comparering iobase.
Now you can attach ixpcom0 with physical address like this:
ixpcom* at ixpsip? addr 0x90000000 size 0x4000
Statically mapped address (0xf0000000) is still usable.

ixp12x0_clk:
1. access PLL_CFG register via bus_space
2. Make the delay() working correctly. (bug fix)
3. Start the timer device without interrupt on attach time.
Now delay() called before cpu_initclocks() works fine.

ixp12x0_pci:
1.Mapping PCI type0/1 configuration space to the upper address.
2."PCI I/O Cycle Access" mapping to same virtual address(VA==PA)
but size of this mapping increase to 1MByte because fails
cause couldnt set L2 table.
3.use bus_space address handling in ixp12x0_pci.c.
 1.4 02-Dec-2002  ichiro use bus_space map
 1.3 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.2 21-Jul-2002  ichiro branches: 1.2.2; 1.2.4;
some bug fix and cosmetic changes
 1.1 15-Jul-2002  ichiro branches: 1.1.2;
add support for ixp12x0
 1.1.2.3 30-Aug-2002  gehenna catch up with -current.
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixp12x0_intr.c was added on branch gehenna-devsw on 2002-07-21 13:00:30 +0000
 1.2.4.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.4.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.4.1 21-Jul-2002  jdolecek file ixp12x0_intr.c was added on branch kqueue on 2002-09-06 08:32:53 +0000
 1.2.2.3 11-Dec-2002  thorpej Sync with HEAD.
 1.2.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.1 21-Jul-2002  nathanw file ixp12x0_intr.c was added on branch nathanw_sa on 2002-10-18 02:35:37 +0000
 1.8.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.11.16.3 21-Jan-2008  yamt sync with head
 1.11.16.2 30-Dec-2006  yamt sync with head.
 1.11.16.1 21-Jun-2006  yamt sync with head.
 1.14.22.1 10-Dec-2006  yamt sync with head.
 1.14.20.1 12-Jan-2007  ad Sync with head.
 1.15.44.1 08-Jan-2008  bouyer Sync with HEAD
 1.15.36.1 18-Feb-2008  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.1 20-Jan-2008  chris Sync to HEAD.
 1.15.24.1 28-Feb-2008  rjs Sync with HEAD.
 1.17.10.2 11-Aug-2010  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.1 02-Jun-2008  mjf Sync with HEAD.
 1.19.22.2 05-Mar-2011  rmind sync with head
 1.19.22.1 03-Jul-2010  rmind sync with head
 1.19.20.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.22.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.22.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.22.2.1 30-Oct-2012  yamt sync with head
 1.23.2.3 03-Dec-2017  jdolecek update from HEAD
 1.23.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.23.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.24.2.2 18-May-2014  rmind sync with head
 1.24.2.1 28-Aug-2013  rmind sync with head
 1.29.6.1 06-Jun-2015  skrll Sync with HEAD
 1.31.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.32.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.3 04-Feb-2014  matt _setsoftintr is long dead. reap any leftovers from arm.
 1.2 08-Jan-2008  matt branches: 1.2.44; 1.2.54; 1.2.60;
As of this commit, all arm32 kernel now build.
 1.1 03-Jan-2003  thorpej branches: 1.1.2; 1.1.20; 1.1.78; 1.1.82; 1.1.84; 1.1.90; 1.1.98;
Use the generic irq_dispatch.S
 1.1.98.1 08-Jan-2008  bouyer Sync with HEAD
 1.1.90.1 18-Feb-2008  mjf Sync with HEAD.
 1.1.84.1 09-Jan-2008  matt sync with HEAD
 1.1.82.1 20-Jan-2008  chris Sync to HEAD.
 1.1.78.1 28-Feb-2008  rjs Sync with HEAD.
 1.1.20.1 21-Jan-2008  yamt sync with head
 1.1.2.2 03-Jan-2003  thorpej Sync with HEAD.
 1.1.2.1 03-Jan-2003  thorpej file ixp12x0_intr.h was added on branch nathanw_sa on 2003-01-03 16:41:09 +0000
 1.2.60.1 18-May-2014  rmind sync with head
 1.2.54.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.44.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.19 21-Apr-2023  skrll Trailing whitespace
 1.18 16-Mar-2018  ryo use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
 1.17 23-Feb-2014  martin branches: 1.17.28;
Fix obvious typo
 1.16 22-Feb-2014  matt Don't manipulate the pte to get uncached memory, use PMAP_NOCACHE instead.
Convert footbring to kenter_pa/kremove
 1.15 01-Jul-2011  dyoung branches: 1.15.2; 1.15.12; 1.15.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.14 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.13 21-Oct-2009  rmind Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.12 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.11 24-Nov-2005  yamt branches: 1.11.80; 1.11.88; 1.11.94;
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.10 01-Apr-2005  yamt branches: 1.10.2; 1.10.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.9 13-Jul-2003  igy branches: 1.9.8; 1.9.10;
mapping pci configuration space (not subregion)
 1.8 13-Jul-2003  igy sharing bus_space_tag among ixpio, pci mem and i/o.
 1.7 25-Mar-2003  igy branches: 1.7.2;
Add __KERNEL_RCSID tags
 1.6 17-Feb-2003  ichiro files.ixp12x0
no need device ixpcom in evbarm/conf/files.evbarm move it to
arm/ixp12x0/files.ixp12x0

ixp12x0_com.c:
some fix around address handling
1. Do not call bus_space_map() in ixpcominit(). Calling bus_space_map()
is not safe here, because bus_space_map() calls uvm_km_valloc() but
uvm is not yet initialized.
2. Use dv_unit to determine console instead comparering iobase.
Now you can attach ixpcom0 with physical address like this:
ixpcom* at ixpsip? addr 0x90000000 size 0x4000
Statically mapped address (0xf0000000) is still usable.

ixp12x0_clk:
1. access PLL_CFG register via bus_space
2. Make the delay() working correctly. (bug fix)
3. Start the timer device without interrupt on attach time.
Now delay() called before cpu_initclocks() works fine.

ixp12x0_pci:
1.Mapping PCI type0/1 configuration space to the upper address.
2."PCI I/O Cycle Access" mapping to same virtual address(VA==PA)
but size of this mapping increase to 1MByte because fails
cause couldnt set L2 table.
3.use bus_space address handling in ixp12x0_pci.c.
 1.5 22-Dec-2002  ichiro Use generic_bs_wr_4 for writing region
 1.4 22-Dec-2002  ichiro Use generic_bs_sr_4
 1.3 08-Dec-2002  ichiro change flags of pmap_enter() in ixp12x0_io.c, ixpsip_io.c
bug fix: ixp12x0_pci.c
 1.2 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.1 15-Jul-2002  ichiro branches: 1.1.2; 1.1.4; 1.1.6;
add support for ixp12x0
 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 15-Jul-2002  jdolecek file ixp12x0_io.c was added on branch kqueue on 2002-09-06 08:32:53 +0000
 1.1.4.4 29-Dec-2002  thorpej Sync with HEAD.
 1.1.4.3 11-Dec-2002  thorpej Sync with HEAD.
 1.1.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.1 15-Jul-2002  nathanw file ixp12x0_io.c was added on branch nathanw_sa on 2002-10-18 02:35:37 +0000
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixp12x0_io.c was added on branch gehenna-devsw on 2002-07-21 13:00:30 +0000
 1.7.2.5 11-Dec-2005  christos Sync with head.
 1.7.2.4 01-Apr-2005  skrll Sync with HEAD.
 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.10.1 28-Jan-2005  yamt convert arch/arm to new apis.
 1.9.8.1 29-Apr-2005  kent sync with -current
 1.10.8.1 29-Nov-2005  yamt sync with head.
 1.10.2.1 21-Jun-2006  yamt sync with head.
 1.11.94.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.11.88.1 28-Apr-2009  skrll Sync with HEAD.
 1.11.80.2 11-Mar-2010  yamt sync with head
 1.11.80.1 04-May-2009  yamt sync with head.
 1.15.16.1 18-May-2014  rmind sync with head
 1.15.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.2.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.17.28.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.5 03-Jan-2003  thorpej Use the generic irq_dispatch.S
 1.4 02-Jan-2003  thorpej Garbage-collect prev_intr_depth; nothing uses it.
 1.3 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.2 14-Aug-2002  thorpej branches: 1.2.2; 1.2.4;
Use cpsr_c rather then cpsr_all where appropriate.
 1.1 15-Jul-2002  ichiro branches: 1.1.2;
add support for ixp12x0
 1.1.2.3 30-Aug-2002  gehenna catch up with -current.
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixp12x0_irq.S was added on branch gehenna-devsw on 2002-07-21 13:00:30 +0000
 1.2.4.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.4.1 14-Aug-2002  jdolecek file ixp12x0_irq.S was added on branch kqueue on 2002-09-06 08:32:54 +0000
 1.2.2.3 03-Jan-2003  thorpej Sync with HEAD.
 1.2.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.1 14-Aug-2002  nathanw file ixp12x0_irq.S was added on branch nathanw_sa on 2002-10-18 02:35:37 +0000
 1.18 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.17 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.16 14-Jun-2020  chs replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.15 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.14 18-Aug-2013  matt branches: 1.14.6;
<arm/locore.h> fallout (fixes some include ordering errors)
 1.13 27-Oct-2012  chs branches: 1.13.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 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 14-Mar-2009  dsl branches: 1.10.12; 1.10.16;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.9 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.8 28-Apr-2008  martin branches: 1.8.8; 1.8.14;
Remove clause 3 and 4 from TNF licenses
 1.7 11-Dec-2005  christos branches: 1.7.76; 1.7.78; 1.7.80;
merge ktrace-lwp.
 1.6 15-Sep-2003  ichiro add address decode of "PCI Configuration type 1"
 1.5 25-Mar-2003  igy branches: 1.5.2;
Add __KERNEL_RCSID tags
 1.4 17-Feb-2003  ichiro files.ixp12x0
no need device ixpcom in evbarm/conf/files.evbarm move it to
arm/ixp12x0/files.ixp12x0

ixp12x0_com.c:
some fix around address handling
1. Do not call bus_space_map() in ixpcominit(). Calling bus_space_map()
is not safe here, because bus_space_map() calls uvm_km_valloc() but
uvm is not yet initialized.
2. Use dv_unit to determine console instead comparering iobase.
Now you can attach ixpcom0 with physical address like this:
ixpcom* at ixpsip? addr 0x90000000 size 0x4000
Statically mapped address (0xf0000000) is still usable.

ixp12x0_clk:
1. access PLL_CFG register via bus_space
2. Make the delay() working correctly. (bug fix)
3. Start the timer device without interrupt on attach time.
Now delay() called before cpu_initclocks() works fine.

ixp12x0_pci:
1.Mapping PCI type0/1 configuration space to the upper address.
2."PCI I/O Cycle Access" mapping to same virtual address(VA==PA)
but size of this mapping increase to 1MByte because fails
cause couldnt set L2 table.
3.use bus_space address handling in ixp12x0_pci.c.
 1.3 08-Dec-2002  ichiro change flags of pmap_enter() in ixp12x0_io.c, ixpsip_io.c
bug fix: ixp12x0_pci.c
 1.2 09-Oct-2002  thorpej Need <dev/pci/pciconf.h>.
 1.1 15-Jul-2002  ichiro branches: 1.1.2; 1.1.4; 1.1.6;
add support for ixp12x0
 1.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 15-Jul-2002  jdolecek file ixp12x0_pci.c was added on branch kqueue on 2002-09-06 08:32:54 +0000
 1.1.4.3 11-Dec-2002  thorpej Sync with HEAD.
 1.1.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.1 15-Jul-2002  nathanw file ixp12x0_pci.c was added on branch nathanw_sa on 2002-10-18 02:35:37 +0000
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixp12x0_pci.c was added on branch gehenna-devsw on 2002-07-21 13:00:30 +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.7.80.2 04-May-2009  yamt sync with head.
 1.7.80.1 16-May-2008  yamt sync with head.
 1.7.78.1 18-May-2008  yamt sync with head.
 1.7.76.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 28-Apr-2009  skrll Sync with HEAD.
 1.10.16.1 18-Feb-2012  mrg merge to -current.
 1.10.12.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.12.2 30-Oct-2012  yamt sync with head
 1.10.12.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.1 28-Aug-2013  rmind sync with head
 1.14.6.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.10 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.9 18-Sep-2012  matt Add bounce buffer support for ARM bus_dma(9). Add macros to help initialize
bus_dma_tag structures.
 1.8 01-Jul-2011  dyoung branches: 1.8.2; 1.8.12;
#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 25-Mar-2003  igy branches: 1.6.110;
Add __KERNEL_RCSID tags
 1.5 17-Feb-2003  ichiro files.ixp12x0
no need device ixpcom in evbarm/conf/files.evbarm move it to
arm/ixp12x0/files.ixp12x0

ixp12x0_com.c:
some fix around address handling
1. Do not call bus_space_map() in ixpcominit(). Calling bus_space_map()
is not safe here, because bus_space_map() calls uvm_km_valloc() but
uvm is not yet initialized.
2. Use dv_unit to determine console instead comparering iobase.
Now you can attach ixpcom0 with physical address like this:
ixpcom* at ixpsip? addr 0x90000000 size 0x4000
Statically mapped address (0xf0000000) is still usable.

ixp12x0_clk:
1. access PLL_CFG register via bus_space
2. Make the delay() working correctly. (bug fix)
3. Start the timer device without interrupt on attach time.
Now delay() called before cpu_initclocks() works fine.

ixp12x0_pci:
1.Mapping PCI type0/1 configuration space to the upper address.
2."PCI I/O Cycle Access" mapping to same virtual address(VA==PA)
but size of this mapping increase to 1MByte because fails
cause couldnt set L2 table.
3.use bus_space address handling in ixp12x0_pci.c.
 1.4 09-Oct-2002  thorpej Need ixp12x0var.h
CVS ----------------------------------------------------------------------
 1.3 17-Aug-2002  thorpej branches: 1.3.2; 1.3.4;
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.2 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.1 15-Jul-2002  ichiro branches: 1.1.2;
add support for ixp12x0
 1.1.2.3 30-Aug-2002  gehenna catch up with -current.
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixp12x0_pci_dma.c was added on branch gehenna-devsw on 2002-07-21 13:00:31 +0000
 1.3.4.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.4.1 17-Aug-2002  jdolecek file ixp12x0_pci_dma.c was added on branch kqueue on 2002-09-06 08:32:55 +0000
 1.3.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.3.2.1 17-Aug-2002  nathanw file ixp12x0_pci_dma.c was added on branch nathanw_sa on 2002-10-18 02:35:37 +0000
 1.6.110.1 11-Mar-2010  yamt sync with 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.3 21-Oct-2009  rmind Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.2 17-Feb-2003  ichiro branches: 1.2.110;
files.ixp12x0
no need device ixpcom in evbarm/conf/files.evbarm move it to
arm/ixp12x0/files.ixp12x0

ixp12x0_com.c:
some fix around address handling
1. Do not call bus_space_map() in ixpcominit(). Calling bus_space_map()
is not safe here, because bus_space_map() calls uvm_km_valloc() but
uvm is not yet initialized.
2. Use dv_unit to determine console instead comparering iobase.
Now you can attach ixpcom0 with physical address like this:
ixpcom* at ixpsip? addr 0x90000000 size 0x4000
Statically mapped address (0xf0000000) is still usable.

ixp12x0_clk:
1. access PLL_CFG register via bus_space
2. Make the delay() working correctly. (bug fix)
3. Start the timer device without interrupt on attach time.
Now delay() called before cpu_initclocks() works fine.

ixp12x0_pci:
1.Mapping PCI type0/1 configuration space to the upper address.
2."PCI I/O Cycle Access" mapping to same virtual address(VA==PA)
but size of this mapping increase to 1MByte because fails
cause couldnt set L2 table.
3.use bus_space address handling in ixp12x0_pci.c.
 1.1 15-Jul-2002  ichiro branches: 1.1.2; 1.1.4; 1.1.6;
add support for ixp12x0
 1.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 15-Jul-2002  jdolecek file ixp12x0_pcireg.h was added on branch kqueue on 2002-09-06 08:32:55 +0000
 1.1.4.2 15-Jul-2002  ichiro add support for ixp12x0
 1.1.4.1 15-Jul-2002  ichiro file ixp12x0_pcireg.h was added on branch nathanw_sa on 2002-07-15 16:27:18 +0000
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixp12x0_pcireg.h was added on branch gehenna-devsw on 2002-07-21 13:00:31 +0000
 1.2.110.1 11-Mar-2010  yamt sync with head
 1.9 17-Sep-2021  andvar some love to double letters (in comments).
 1.8 02-Aug-2021  andvar fix various typos in comments and log messages.
 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 11-Dec-2005  christos branches: 1.6.80;
merge ktrace-lwp.
 1.5 10-Nov-2003  wiz Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.4 13-Jul-2003  igy move window of pci i/o cycle to higher address
 1.3 17-Feb-2003  ichiro branches: 1.3.2;
files.ixp12x0
no need device ixpcom in evbarm/conf/files.evbarm move it to
arm/ixp12x0/files.ixp12x0

ixp12x0_com.c:
some fix around address handling
1. Do not call bus_space_map() in ixpcominit(). Calling bus_space_map()
is not safe here, because bus_space_map() calls uvm_km_valloc() but
uvm is not yet initialized.
2. Use dv_unit to determine console instead comparering iobase.
Now you can attach ixpcom0 with physical address like this:
ixpcom* at ixpsip? addr 0x90000000 size 0x4000
Statically mapped address (0xf0000000) is still usable.

ixp12x0_clk:
1. access PLL_CFG register via bus_space
2. Make the delay() working correctly. (bug fix)
3. Start the timer device without interrupt on attach time.
Now delay() called before cpu_initclocks() works fine.

ixp12x0_pci:
1.Mapping PCI type0/1 configuration space to the upper address.
2."PCI I/O Cycle Access" mapping to same virtual address(VA==PA)
but size of this mapping increase to 1MByte because fails
cause couldnt set L2 table.
3.use bus_space address handling in ixp12x0_pci.c.
 1.2 02-Dec-2002  ichiro changes&fix name of mapping registers
 1.1 15-Jul-2002  ichiro branches: 1.1.2; 1.1.4; 1.1.6;
add support for ixp12x0
 1.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 15-Jul-2002  jdolecek file ixp12x0reg.h was added on branch kqueue on 2002-09-06 08:32:55 +0000
 1.1.4.2 11-Dec-2002  thorpej Sync with HEAD.
 1.1.4.1 15-Jul-2002  thorpej file ixp12x0reg.h was added on branch nathanw_sa on 2002-12-11 05:53:11 +0000
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixp12x0reg.h was added on branch gehenna-devsw on 2002-07-21 13:00:31 +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.6.80.1 11-Mar-2010  yamt sync with head
 1.11 12-Nov-2012  skrll C99 types
 1.10 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.9 01-Jul-2011  dyoung branches: 1.9.2; 1.9.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.8 21-Oct-2009  rmind Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.7 11-Dec-2005  christos branches: 1.7.80;
merge ktrace-lwp.
 1.6 13-Jul-2003  igy code clean up
 1.5 13-Jul-2003  igy mapping pci configuration space (not subregion)
 1.4 13-Jul-2003  igy sharing bus_space_tag among ixpio, pci mem and i/o.
 1.3 17-Feb-2003  ichiro branches: 1.3.2;
files.ixp12x0
no need device ixpcom in evbarm/conf/files.evbarm move it to
arm/ixp12x0/files.ixp12x0

ixp12x0_com.c:
some fix around address handling
1. Do not call bus_space_map() in ixpcominit(). Calling bus_space_map()
is not safe here, because bus_space_map() calls uvm_km_valloc() but
uvm is not yet initialized.
2. Use dv_unit to determine console instead comparering iobase.
Now you can attach ixpcom0 with physical address like this:
ixpcom* at ixpsip? addr 0x90000000 size 0x4000
Statically mapped address (0xf0000000) is still usable.

ixp12x0_clk:
1. access PLL_CFG register via bus_space
2. Make the delay() working correctly. (bug fix)
3. Start the timer device without interrupt on attach time.
Now delay() called before cpu_initclocks() works fine.

ixp12x0_pci:
1.Mapping PCI type0/1 configuration space to the upper address.
2."PCI I/O Cycle Access" mapping to same virtual address(VA==PA)
but size of this mapping increase to 1MByte because fails
cause couldnt set L2 table.
3.use bus_space address handling in ixp12x0_pci.c.
 1.2 09-Oct-2002  thorpej add ixp12x0_reset() prototype.
 1.1 15-Jul-2002  ichiro branches: 1.1.2; 1.1.4; 1.1.6;
add support for ixp12x0
 1.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 15-Jul-2002  jdolecek file ixp12x0var.h was added on branch kqueue on 2002-09-06 08:32:56 +0000
 1.1.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.1 15-Jul-2002  nathanw file ixp12x0var.h was added on branch nathanw_sa on 2002-10-18 02:35:37 +0000
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixp12x0var.h was added on branch gehenna-devsw on 2002-07-21 13:00:31 +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.7.80.1 11-Mar-2010  yamt sync with head
 1.9.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.9.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.9.2.1 30-Oct-2012  yamt sync with head
 1.16 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.15 24-Apr-2021  thorpej branches: 1.15.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.14 27-Oct-2012  chs branches: 1.14.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.13 01-Jul-2011  dyoung branches: 1.13.2; 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 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.10 11-Dec-2005  christos branches: 1.10.80; 1.10.88; 1.10.94;
merge ktrace-lwp.
 1.9 26-Aug-2005  drochner s/locdesc_t/int/g
 1.8 30-Jun-2005  drochner branches: 1.8.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.7 13-Jul-2003  igy using common bus_space_tag in ixpsip too
 1.6 25-Mar-2003  igy branches: 1.6.2;
Add __KERNEL_RCSID tags
 1.5 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.4 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.3 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.2 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.1 15-Jul-2002  ichiro branches: 1.1.2; 1.1.4; 1.1.6;
add support for ixp12x0
 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 15-Jul-2002  jdolecek file ixpsip.c was added on branch kqueue on 2002-09-06 08:32:56 +0000
 1.1.4.3 03-Jan-2003  thorpej Sync with HEAD.
 1.1.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.1 15-Jul-2002  nathanw file ixpsip.c was added on branch nathanw_sa on 2002-10-18 02:35:37 +0000
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixpsip.c was added on branch gehenna-devsw on 2002-07-21 13:00:31 +0000
 1.6.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.8.2.1 21-Jun-2006  yamt sync with head.
 1.10.94.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.10.88.1 28-Apr-2009  skrll Sync with HEAD.
 1.10.80.2 11-Mar-2010  yamt sync with head
 1.10.80.1 04-May-2009  yamt sync with head.
 1.13.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.13.2.1 30-Oct-2012  yamt sync with head
 1.14.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.14.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.14.52.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.14.52.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.14.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.14.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.15.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.5 13-Jul-2003  igy code clean up
 1.4 25-Mar-2003  igy branches: 1.4.2;
Add __KERNEL_RCSID tags
 1.3 08-Dec-2002  ichiro change flags of pmap_enter() in ixp12x0_io.c, ixpsip_io.c
bug fix: ixp12x0_pci.c
 1.2 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.1 15-Jul-2002  ichiro branches: 1.1.2; 1.1.4; 1.1.6;
add support for ixp12x0
 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 15-Jul-2002  jdolecek file ixpsip_io.c was added on branch kqueue on 2002-09-06 08:32:57 +0000
 1.1.4.3 11-Dec-2002  thorpej Sync with HEAD.
 1.1.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.1 15-Jul-2002  nathanw file ixpsip_io.c was added on branch nathanw_sa on 2002-10-18 02:35:38 +0000
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixpsip_io.c was added on branch gehenna-devsw on 2002-07-21 13:00:31 +0000
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 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 01-Jul-2011  dyoung branches: 1.3.2; 1.3.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.2 21-Oct-2009  rmind Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
 1.1 15-Jul-2002  ichiro branches: 1.1.2; 1.1.4; 1.1.6; 1.1.122;
add support for ixp12x0
 1.1.122.1 11-Mar-2010  yamt sync with head
 1.1.6.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.6.1 15-Jul-2002  jdolecek file ixpsipvar.h was added on branch kqueue on 2002-09-06 08:32:57 +0000
 1.1.4.2 15-Jul-2002  ichiro add support for ixp12x0
 1.1.4.1 15-Jul-2002  ichiro file ixpsipvar.h was added on branch nathanw_sa on 2002-07-15 16:27:18 +0000
 1.1.2.2 21-Jul-2002  gehenna catch up with -current.
 1.1.2.1 15-Jul-2002  gehenna file ixpsipvar.h was added on branch gehenna-devsw on 2002-07-21 13:00:31 +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

RSS XML Feed