Home | History | Annotate | only in /src/sys/arch/evbarm/iq80310
History log of /src/sys/arch/evbarm/iq80310
RevisionDateAuthorComments
 1.15 08-Dec-2018  thorpej Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.14 01-Jul-2011  dyoung branches: 1.14.52; 1.14.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.13 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.12 14-Mar-2008  cube branches: 1.12.2; 1.12.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.11 13-Jul-2006  gdamore branches: 1.11.34; 1.11.54; 1.11.58;
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.10 11-Dec-2005  christos branches: 1.10.4; 1.10.8; 1.10.16;
merge ktrace-lwp.
 1.9 15-Jul-2003  lukem branches: 1.9.16;
__KERNEL_RCSID()
 1.8 03-Oct-2002  thorpej branches: 1.8.6;
Use indirect configuration for on-board devices (i.e. those things
attached to "obio") on the IQ80310 and IQ80321. It makes more sense
to do it this way for this type of system (the goal being to encapsulate
as much information about the board as possible into one file).
 1.7 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.6 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.5 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.4 12-Apr-2002  thorpej branches: 1.4.6;
* Add a new hwflag, COM_HW_NO_TXPRELOAD, which tells comstart() to
not pre-load the chip's Tx buffer, but instead waits for the Tx Ready
interrupt to transmit the first chunk of data.
* On the IOP310, set COM_HW_NO_TXPRELOAD, rather than COM_HW_TXFIFO_DISABLE.

This solves the "UART hangs" problem on the Npwr in a nicer way (i.e. we
get to use the FIFO, whee). The COM_HW_NO_TXPRELOAD happens to match the
Linux 16550 driver's Tx algorithm, and the "UART hang" was never observed
on the Npwr running Linux.

Eventually, we might want to eliminate the COM_HW_NO_TXPRELOAD, and simply
always use its algorithm. But it should be tested on more 16x50 variants
before we do that.

Kudos to Valeriy Ushakov <uwe@netbsd.org> for pointing out this solution
(which also happens to fix the stray UART interrupt issue on the Krups
Javastation), and to Allen Briggs <briggs@netbsd.org> for experimenting
with various methods of fixing this.
 1.3 12-Apr-2002  briggs Disable TXFIFO on npwr. There is some sort of serial interrupt lossage that
seems to be greatly alleviated by this change.
 1.2 07-Nov-2001  thorpej branches: 1.2.2;
Rework and fleshing out of Intel IQ80310 XScale eval board support.
More work to do -- this is a snapshot of work-in-progress.
 1.1 02-Sep-2001  matt branches: 1.1.4;
com (16550) attachment for iq80310
 1.1.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.2.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.2 17-Apr-2002  nathanw Catch up to -current.
 1.2.2.1 07-Nov-2001  nathanw file com_obio.c was added on branch nathanw_sa on 2002-04-17 00:02:57 +0000
 1.4.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.4.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.6.1 12-Apr-2002  jdolecek file com_obio.c was added on branch kqueue on 2002-06-23 17:35:41 +0000
 1.8.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.2 17-Mar-2008  yamt sync with head.
 1.9.16.1 30-Dec-2006  yamt sync with head.
 1.10.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.10.8.1 11-Aug-2006  yamt sync with head
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.11.58.2 02-Jun-2008  mjf Sync with HEAD.
 1.11.58.1 03-Apr-2008  mjf Sync with HEAD.
 1.11.54.1 24-Mar-2008  keiichi sync with head.
 1.11.34.1 23-Mar-2008  matt sync with HEAD
 1.12.4.1 16-May-2008  yamt sync with head.
 1.12.2.1 18-May-2008  yamt sync with head.
 1.14.54.1 10-Jun-2019  christos Sync with HEAD
 1.14.52.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.3 30-Jan-2002  thorpej 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 20-Dec-2001  thorpej branches: 1.2.2; 1.2.4;
* Share a common vector page between arm26 and arm32.
* Use a common set of exception handlers for all arm32 platforms.
* New FIQ framework based on discussions with Ben Harris, shared
between arm26 and arm32.
 1.1 27-Nov-2001  thorpej Move interrupt-related stuff out of the generic 32-bit ARM genassym.cf
and into platform-specific genassym.cf files.
 1.2.4.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.2.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 20-Dec-2001  thorpej file genassym.cf was added on branch kqueue on 2002-01-10 19:42:35 +0000
 1.2.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.2.1 20-Dec-2001  nathanw file genassym.cf was added on branch nathanw_sa on 2002-01-08 00:24:27 +0000
 1.16 14-Oct-2012  msaitoh struct device * -> device_t change.
Not tested though.
 1.15 03-Oct-2012  chs defer evcnt attachment correctly.
 1.14 01-Jul-2011  dyoung branches: 1.14.2; 1.14.8; 1.14.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.13 11-Dec-2005  christos merge ktrace-lwp.
 1.12 23-Apr-2004  simonb s/the the/the/ (only in sources that aren't regularly imported from
elsewhere).
 1.11 15-Jul-2003  lukem __KERNEL_RCSID()
 1.10 03-Oct-2002  thorpej branches: 1.10.6;
Fix script-o.
 1.9 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.8 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.7 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 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 08-Feb-2002  thorpej No point in setting the ATU Subsys vendor/dev ID on boards that
can't plug into a PCI host.
 1.4 07-Feb-2002  thorpej Add support for the Team ASA Npwr IOP310-based server appliance.
 1.3 09-Nov-2001  thorpej branches: 1.3.2; 1.3.4; 1.3.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.2 09-Nov-2001  thorpej PCI interrupt mapping support for the IQ80310.
 1.1 09-Nov-2001  thorpej IQ80310-specific setup for the i80312 Companion I/O chip driver.
 1.3.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.3.6.3 16-Mar-2002  jdolecek Catch up with -current.
 1.3.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.6.1 09-Nov-2001  thorpej file i80312_mainbus.c was added on branch kqueue on 2002-01-10 19:42:35 +0000
 1.3.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.3.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.4.1 09-Nov-2001  nathanw file i80312_mainbus.c was added on branch nathanw_sa on 2002-02-28 04:09:13 +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_mainbus.c was added on branch thorpej-mips-cache on 2001-11-12 21:16:52 +0000
 1.10.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.6.1 03-Aug-2004  skrll Sync with HEAD
 1.14.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.14.8.1 17-Oct-2012  riz Pull up following revision(s) (requested by chs in ticket #591):
sys/arch/evbarm/iq80310/i80312_mainbus.c: revision 1.15
sys/arch/evbarm/iq80310/iq80310var.h: revision 1.8
sys/arch/evbarm/iq80310/iq80310_intr.c: revision 1.32
defer evcnt attachment correctly.
 1.14.2.1 30-Oct-2012  yamt sync with head
 1.10 01-Jul-2011  dyoung #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 14-May-2003  thorpej branches: 1.7.2;
Move the 7-segment display definitions into the C file.
 1.6 12-Apr-2002  thorpej * Add the ability to display .'s on the 7seg display.
* Display . . when halted.
 1.5 20-Jan-2002  thorpej Some prototype cleanup.
 1.4 01-Dec-2001  thorpej branches: 1.4.2;
Make the snake slither in a slightly more interesting pattern that
also happens to have 8 positions (and thus has a slightly more efficient
implementation).
 1.3 01-Dec-2001  thorpej Implement a "snake" for the 7-segment display.
 1.2 07-Nov-2001  thorpej branches: 1.2.2; 1.2.4;
We were already cheating w/ CPLD register access, so cheat all the
way and use pointer derefs rather than bus_space to access them.
 1.1 07-Nov-2001  thorpej Rework and fleshing out of Intel IQ80310 XScale eval board support.
More work to do -- this is a snapshot of work-in-progress.
 1.2.4.4 17-Apr-2002  nathanw Catch up to -current.
 1.2.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.4.1 07-Nov-2001  nathanw file iq80310_7seg.c was added on branch nathanw_sa on 2002-01-08 00:24:27 +0000
 1.2.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.2.2.1 07-Nov-2001  thorpej file iq80310_7seg.c was added on branch thorpej-mips-cache on 2001-11-12 21:16:53 +0000
 1.4.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 01-Dec-2001  thorpej file iq80310_7seg.c was added on branch kqueue on 2002-01-10 19:42:35 +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.36 21-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.35 10-Nov-2019  chs branches: 1.35.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.34 26-Mar-2014  christos branches: 1.34.30;
kill sprintf.
 1.33 28-Jan-2014  martin Unused variable police
 1.32 03-Oct-2012  chs branches: 1.32.2;
defer evcnt attachment correctly.
 1.31 14-Aug-2012  chs branches: 1.31.2;
move evcnt_attach_dynamic() calls later to avoid assertions.
 1.30 02-Aug-2012  skrll Remove irqframe and replace with identical trapframe.
 1.29 01-Jul-2011  dyoung branches: 1.29.2; 1.29.8;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.28 31-Jan-2011  jakllsch Correct __HAVE_FAST_SOFTINTRS typos, use only __HAVE_FAST_SOFTINTS.
 1.27 20-Dec-2010  matt branches: 1.27.2; 1.27.4;
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.26 27-Apr-2008  matt branches: 1.26.22;
Merge kernel changes in matt-armv6 to HEAD.
 1.25 06-Jan-2008  matt branches: 1.25.6; 1.25.8; 1.25.10;
Cleanup softint lossage.
 1.24 24-Nov-2006  wiz branches: 1.24.24; 1.24.28; 1.24.34; 1.24.42;
s/heirarchy/hierarchy/, from Zafer.
 1.23 24-Dec-2005  perry branches: 1.23.20; 1.23.22;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.22 11-Dec-2005  christos merge ktrace-lwp.
 1.21 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.20 15-Jul-2003  lukem branches: 1.20.16;
__KERNEL_RCSID()
 1.19 16-Jun-2003  thorpej branches: 1.19.2;
Rename IPL_IMP -> IPL_VM.
 1.18 09-Oct-2002  thorpej Clean up some bad interaction between the spl inlining stuff and
strict-prototypes.
 1.17 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.16 14-Aug-2002  thorpej Don't need to frob CPSR in _splraise().
 1.15 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.14 04-Aug-2002  thorpej #if 0 the stray interrupt messages -- we tend to get them "a lot"
during normal activity on some IOP310-based designs.
 1.13 26-Jun-2002  thorpej Report stray interrupts.
 1.12 14-Apr-2002  thorpej branches: 1.12.2; 1.12.4;
Fix typo in last (luckily, search/replace makes the same typo everywhere).
 1.11 14-Apr-2002  thorpej iq80310_do_pending -> iq80310_do_soft, to accurately describe what's
actually going on there.
 1.10 12-Apr-2002  briggs Processing pending interrupts before reenabling external interrupts in splx().
 1.9 09-Feb-2002  thorpej branches: 1.9.4;
* The Npwr only has 5 interrupt sources, all in XINT3, so don't bother
reading XINT0 (which isn't even implemented by the CPLD on Npwr).
* Adjust the mask of valid IRQ bits for the Npwr.
 1.8 30-Jan-2002  thorpej 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.7 20-Jan-2002  thorpej Some prototype cleanup.
 1.6 01-Dec-2001  thorpej branches: 1.6.2;
- Don't enable FIQs; nothing uses them (yet).
- Steer i80200 PMU and BCU interrupts to IRQ# (for lack of a better
place, at the moment).
- Disable all interrupts other than external-IRQ# in the i80200 ICU;
we don't deal with any of the others, yet.
 1.5 23-Nov-2001  thorpej Use <arm/cpufunc.h>, not <machine/cpufunc.h>.
 1.4 07-Nov-2001  thorpej branches: 1.4.2; 1.4.4;
When we read the interrupt status bits, mask it with the shadow copy
of the "currently enabled interrupts" -- the CPLD appears to light
up the status bit even if it doesn't cause the CPU IRQ line to be
asserted.
 1.3 07-Nov-2001  thorpej We were already cheating w/ CPLD register access, so cheat all the
way and use pointer derefs rather than bus_space to access them.
 1.2 07-Nov-2001  thorpej * Pass the IRQ number to stray_irqhandler() and display it in
the panic message.
* Mask off undefined bits from the XINT3 and XINT0 registers in the CPLD.
 1.1 07-Nov-2001  thorpej Rework and fleshing out of Intel IQ80310 XScale eval board support.
More work to do -- this is a snapshot of work-in-progress.
 1.4.4.8 18-Oct-2002  nathanw Catch up to -current.
 1.4.4.7 19-Aug-2002  thorpej Partial (ARM only) sync with trunk -- significant performance improvements
for XScale-based systems.
 1.4.4.6 13-Aug-2002  nathanw Catch up to -current.
 1.4.4.5 01-Aug-2002  nathanw Catch up to -current.
 1.4.4.4 17-Apr-2002  nathanw Catch up to -current.
 1.4.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.4.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.4.4.1 07-Nov-2001  nathanw file iq80310_intr.c was added on branch nathanw_sa on 2002-01-08 00:24:27 +0000
 1.4.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.4.2.1 07-Nov-2001  thorpej file iq80310_intr.c was added on branch thorpej-mips-cache on 2001-11-12 21:16:53 +0000
 1.6.2.6 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.6.2.5 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.6.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.1 01-Dec-2001  thorpej file iq80310_intr.c was added on branch kqueue on 2002-01-10 19:42:35 +0000
 1.9.4.1 17-Mar-2002  thorpej IPL_IMP -> IPL_VM
 1.12.4.1 18-Nov-2002  he Pull up revision 1.16 (requested by thorpej in ticket #680):
Don't need to frob CPSR in _splraise().
 1.12.2.2 30-Aug-2002  gehenna catch up with -current.
 1.12.2.1 16-Jul-2002  gehenna catch up with -current.
 1.19.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.19.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.19.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.19.2.1 03-Aug-2004  skrll Sync with HEAD
 1.20.16.3 21-Jan-2008  yamt sync with head
 1.20.16.2 30-Dec-2006  yamt sync with head.
 1.20.16.1 21-Jun-2006  yamt sync with head.
 1.23.22.1 10-Dec-2006  yamt sync with head.
 1.23.20.1 12-Jan-2007  ad Sync with head.
 1.24.42.1 08-Jan-2008  bouyer Sync with HEAD
 1.24.34.1 18-Feb-2008  mjf Sync with HEAD.
 1.24.28.1 09-Jan-2008  matt sync with HEAD
 1.24.24.1 28-Feb-2008  rjs Sync with HEAD.
 1.25.10.1 16-May-2008  yamt sync with head.
 1.25.8.1 18-May-2008  yamt sync with head.
 1.25.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.26.22.1 05-Mar-2011  rmind sync with head
 1.27.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.27.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.29.8.2 17-Oct-2012  riz Pull up following revision(s) (requested by chs in ticket #591):
sys/arch/evbarm/iq80310/i80312_mainbus.c: revision 1.15
sys/arch/evbarm/iq80310/iq80310var.h: revision 1.8
sys/arch/evbarm/iq80310/iq80310_intr.c: revision 1.32
defer evcnt attachment correctly.
 1.29.8.1 20-Aug-2012  riz Pull up following revision(s) (requested by chs in ticket #509):
sys/arch/evbarm/iq80310/iq80310_intr.c: revision 1.31
move evcnt_attach_dynamic() calls later to avoid assertions.
 1.29.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.29.2.1 30-Oct-2012  yamt sync with head
 1.31.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.31.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.32.2.1 18-May-2014  rmind sync with head
 1.34.30.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.35.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.9 28-Jan-2014  martin Unused variable police
 1.8 14-Feb-2009  he branches: 1.8.12; 1.8.22; 1.8.26;
Also include <arm/cpu.h> here for the required definitions of
curcpl() and set_curcpl(), so that kern_ssp.c builds here as well.
 1.7 27-Apr-2008  matt branches: 1.7.8; 1.7.10; 1.7.14;
Merge kernel changes in matt-armv6 to HEAD.
 1.6 06-Jan-2008  matt branches: 1.6.6; 1.6.8; 1.6.10;
Cleanup softint lossage.
 1.5 24-Dec-2005  perry branches: 1.5.46; 1.5.50; 1.5.56; 1.5.64;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 13-Jan-2004  he branches: 1.3.16;
Copy code from iq80321 / ixp425:
Use __insn_barrier() to prevent the compiler reordering splx/splraise
relative to the code they're supposed to protect.
 1.2 09-Oct-2002  thorpej branches: 1.2.6;
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 iq80310_intr.h was added on branch kqueue on 2002-09-06 08:34:08 +0000
 1.1.4.2 30-Aug-2002  gehenna catch up with -current.
 1.1.4.1 17-Aug-2002  gehenna file iq80310_intr.h was added on branch gehenna-devsw on 2002-08-30 00:19:34 +0000
 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 iq80310_intr.h was added on branch nathanw_sa on 2002-08-19 21:39:36 +0000
 1.2.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.6.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.2 21-Jan-2008  yamt sync with head
 1.3.16.1 21-Jun-2006  yamt sync with head.
 1.5.64.1 08-Jan-2008  bouyer Sync with HEAD
 1.5.56.1 18-Feb-2008  mjf Sync with HEAD.
 1.5.50.1 09-Jan-2008  matt sync with HEAD
 1.5.46.1 28-Feb-2008  rjs Sync with HEAD.
 1.6.10.2 04-May-2009  yamt sync with head.
 1.6.10.1 16-May-2008  yamt sync with head.
 1.6.8.1 18-May-2008  yamt sync with head.
 1.6.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.7.10.1 15-Mar-2009  snj Pull up following revision(s) (requested by chrost in ticket #458):
sys/arch/evbarm/iq80310/iq80310_intr.h: revision 1.8
Also include <arm/cpu.h> here for the required definitions of
curcpl() and set_curcpl(), so that kern_ssp.c builds here as well.
 1.7.8.1 03-Mar-2009  skrll Sync with HEAD.
 1.8.26.1 18-May-2014  rmind sync with head
 1.8.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.12.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4 30-Jan-2002  thorpej 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.3 28-Nov-2001  thorpej branches: 1.3.2;
When processing ASTs:
- Loop until astpending is clear upon return from ast().
- Clear astpending *before* re-enabling interrupts.
 1.2 07-Nov-2001  thorpej branches: 1.2.2; 1.2.4;
* Pass the IRQ number to stray_irqhandler() and display it in
the panic message.
* Mask off undefined bits from the XINT3 and XINT0 registers in the CPLD.
 1.1 07-Nov-2001  thorpej Rework and fleshing out of Intel IQ80310 XScale eval board support.
More work to do -- this is a snapshot of work-in-progress.
 1.2.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.4.1 07-Nov-2001  nathanw file iq80310_irq.S was added on branch nathanw_sa on 2002-01-08 00:24:27 +0000
 1.2.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.2.2.1 07-Nov-2001  thorpej file iq80310_irq.S was added on branch thorpej-mips-cache on 2001-11-12 21:16:53 +0000
 1.3.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 28-Nov-2001  thorpej file iq80310_irq.S was added on branch kqueue on 2002-01-10 19:42:36 +0000
 1.97 20-Feb-2024  andvar Fix format specifier for physmem from %d to 0x%"PRIxPSIZE" in multiple places.

Should fix VERBOSE_INIT_ARM for various evbarm kernel configs.
Also add 0x prefix in few previously fixed places to improve readability.
 1.96 12-Oct-2023  skrll Fix non-DIAGNOSTIC builds
 1.95 20-Apr-2023  skrll Provide a shared pmap_devmap implementation and convert all pmap_devmap
arrays to use DEVMAP_ENTRY{,_END}
 1.94 17-Aug-2021  andvar branches: 1.94.4;
fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected.
 1.93 18-Apr-2020  skrll PMAP_DEBUG has been deleted on arm
 1.92 18-Apr-2020  skrll Trailing whitespace
 1.91 16-Jul-2019  skrll branches: 1.91.8;
Consistently use vaddr_t as initarm and friends return type.

Makes no difference to binaries except for aarch64 where it's required
 1.90 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.89 28-Oct-2018  skrll Fix a commit
 1.88 21-Sep-2018  skrll Centralise defparam CONSADDR, CONSPEED, CONMODE and CONADDR into
opt_console.h and adjust.
 1.87 31-Jul-2018  skrll Sprinkle #include "opt_arm_debug.h" where VERBOSE_INIT_ARM is used
 1.86 22-Dec-2016  cherry branches: 1.86.14; 1.86.16;
switch all ports to use uvm_init.c:uvm_md_init()

uvm_setpagesize() is now subsumed within this funciton.
 1.85 13-Sep-2014  matt branches: 1.85.2; 1.85.4;
Replace more vm_offset_t, vm_size_t with vaddr_t, vsize_t
Use paddr_t for msgbufphys
 1.84 18-Aug-2013  matt <arm/locore.h> fallout (fixes some include ordering errors)
 1.83 22-Sep-2012  matt branches: 1.83.2;
Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.
 1.82 16-Aug-2012  matt branches: 1.82.2;
Move the standard definitions of the {UND,IRQ,FIQ,ABT}_STACK_SIZE to
<arm32/machdep.h>
Move the extern for cpu_reset_address to the same file.
Add cpu_reset_address_paddr.
Kill cpu_reset_v4_MMU_disable.
if cpu_reset_address is NULL, then the MMU will be disabled.
 1.81 29-Jul-2012  matt Fix more -fno-common fallout.
Move more variables to common locations.
 1.80 01-Jul-2011  dyoung branches: 1.80.2;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.79 30-Jun-2011  wiz dependant -> dependent
 1.78 26-Dec-2009  uebayasi Use cpu_* prefix to call cpu_* functions (setttb() -> cpu_setttb()); no
functional changes.
 1.77 26-Dec-2009  uebayasi Garbage collect an unused global, vm_offset_t pagetables_start.
 1.76 27-Nov-2009  rmind - Use uvm_lwp_setuarea() instead of directly setting address to lwp_t::l_addr.
- Replace most remaining uses of l_addr with uvm_lwp_getuarea() or lwp_getpcb().
- Amend assembly in ports where it accesses PCB via struct user.
- Rename L_ADDR to L_PCB in few places. Reduce sys/user.h inclusions.
 1.75 26-Nov-2009  matt Kill proc0paddr. Use lwp0.l_addr instead.
 1.74 11-Aug-2009  matt Remove all declarations of physmem from sys/arch. Add an include of
<sys/systm.h> to the one file that did not already contain it.
This now means that physmem can be changed by updating systm.h and uvm_page.c
(excluding fixing printfs)
 1.73 30-Nov-2008  martin As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.
 1.72 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

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

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

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

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.
 1.70 27-Apr-2008  matt branches: 1.70.6; 1.70.8;
Merge kernel changes in matt-armv6 to HEAD.
 1.69 19-Jan-2008  chris branches: 1.69.6; 1.69.8; 1.69.10;
Remove arm support for IPKDB.

It hasn't worked since arm was broken out from arm32 in Jan 2001, and
no-one has noticed or cared to fix it.
 1.68 24-Nov-2006  wiz branches: 1.68.24; 1.68.28; 1.68.34; 1.68.42;
s/independant/independent/, from Zafer.
 1.67 17-May-2006  mrg branches: 1.67.8; 1.67.10;
in initarm(), initialise kernel_l1pt.pv_va as well as kernel_l1pt.pv_pa.
 1.66 11-Dec-2005  christos branches: 1.66.4; 1.66.6; 1.66.8; 1.66.12;
merge ktrace-lwp.
 1.65 12-Dec-2004  abs branches: 1.65.10;
Fix comments regarding configration bounaries
 1.64 12-Dec-2004  abs Fix comments slighly
 1.63 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.62 09-Sep-2003  thorpej Bump initial kernel PTs to 4.
 1.61 15-Jul-2003  lukem __KERNEL_RCSID()
 1.60 15-Jun-2003  thorpej branches: 1.60.2;
Use the new pmap_devmap facility in the on-board device mapping code.
 1.59 15-Jun-2003  thorpej Replace the ad-hoc "section mapping table" for static device mappings
with a more generic "devmap" structure that can also handle mappings
made with large and small pages. Add new pmap routines to enter these
mappings during bootstrap (and "remember" the devmap), and routines to
look up the static mappings once the kernel is running.
 1.58 14-Jun-2003  thorpej Also pass a type argument to comcnattach() and com_kgdb_attach().
comspeed() (and thus cominit()) may need this information.
 1.57 22-May-2003  thorpej Move KERNEL_VM_SIZE into the C files where its used.
 1.56 21-May-2003  thorpej Move KERNEL_VM_BASE inside where it is used (it won't be there for long).
 1.55 17-May-2003  thorpej Decrease the verbosity level unless VERBOSE_INIT_ARM is defiend.
 1.54 03-May-2003  thorpej Don't expose KERNEL_TEXT_BASE outside of board-specific code. This gives
individual board start-up code more flexibility about where the kernel
starts in the kernel address space.
 1.53 03-May-2003  thorpej Reduce differences between ARM32_NEW_VM_LAYOUT and not; always pass
the start and end of the kernel managed virtual address space to
pmap_bootstrap() in the new pmap.
 1.52 03-May-2003  thorpej Remove old pmap support for platforms which have fully switched over.
 1.51 02-May-2003  thorpej Eliminate PTE_BASE and the PT-PT completely in the ARM32_PMAP_NEW case.
Also in the ARM32_PMAP_NEW case, reclaim the USPACE-bytes of wasted space
at the top of the user address that hasn't been needed for a very very
long time.
 1.50 26-Apr-2003  ragge Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)
 1.49 22-Apr-2003  thorpej Use high vectors on IQ80321 and IQ80310.
 1.48 19-Apr-2003  thorpej Adapt to ARM32_PMAP_NEW.
 1.47 02-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.46 17-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.45 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.44 24-Aug-2002  thorpej Enable caching on kernel and user page tables. This saves having
to do uncached memory access during VM operations (which can be
quite expensive on some CPUs).

We currently write-back PTEs as soon as they're modified; there is
some room for optimization (to write them back in larger chunks).
For PTEs in the APTE space (i.e. PTEs for pmaps that describe another
process's address space), PTEs must also be evicted from the cache
complete (PTEs in PTE space will be evicted durint a context switch).
 1.43 21-Aug-2002  thorpej Do cached memory access to L1 tables, making sure to write-back the
cache after any L1 table modifications.
 1.42 31-Jul-2002  thorpej Move the calls to uvm_page_physload() out of pmap_bootstrap() and
into platform-specific initialization code, giving platform-specific
code control over which free list a given chunk of memory gets put
onto.

Changes are essentially mechanical. Test compiled for all ARM
platforms, test booted on Intel IQ80321 and Shark.

Discussed some time ago on port-arm.
 1.41 30-Jul-2002  thorpej Move the uvm_setpagesize() call to platform-dependent code in preparation
for other changes to pmap_bootstrap().
 1.40 12-Apr-2002  thorpej branches: 1.40.2; 1.40.4;
* Add the ability to display .'s on the 7seg display.
* Display . . when halted.
 1.39 12-Apr-2002  briggs Remove exception for CONSPEED on NPWR -- current redboot uses 115200, too.
 1.38 09-Apr-2002  thorpej * Move the code that cleans the XScale mini-data cache into its
own function.
* Add a new function which sets up the mini-data cache clean area
properly.
 1.37 05-Apr-2002  thorpej * Rewrite the 32-bit ARM pte.h based on the ARM architecture manual.
Significant cleanup, here, including better PTE bit names.
* Add XScale PTE extensions (ECC enable, write-allocate cache mode).
* Mechanical changes everywhere else to update for new pte.h. While
doing this, two bugs (as a result of typos) were fixed in

arm/arm32/bus_dma.c
evbarm/integrator/int_bus_dma.c
 1.36 03-Apr-2002  thorpej Clean up handling of the vector page on 32-bit ARM systems:
* Don't refer to VA 0, instead refer to a new variable: vector_page
* Delete the old zero_page_*() functions, replacing them with a new
one: vector_page_setprot().
* When manipulating vector page mappings in user pmaps, only do so if
the vector page is below KERNEL_BASE (if it's above KERNEL_BASE, the
vector page is mapped by the kernel pmap).
* Add a new function, arm32_vector_init(), which takes the virtual
address of the vector page (which MUST be valid when the function
is called) and a bitmask of vectors the kernel is going to take
over, and performs all vector page initialization, including setting
the V bit in the CPU Control register ("relocate vectors to high
address"), if necessary.
 1.35 25-Mar-2002  thorpej * Fix use of pmap_curmaxkvaddr.
* Use the PTP hint in the pmap.
 1.34 23-Mar-2002  thorpej * Rename PROCESS_PAGE_TBLS_BASE -> PTE_BASE
* Rename ALT_PAGE_TBLS_BASE -> APTE_BASE
* Garbage-collect PAGE_TABLE_SPACE_START
 1.33 03-Mar-2002  thorpej * Add support for running the IQ80310 kernel where KERNEL_BASE !=
physical memory start. Garbage-collect some cruft while here.
* Move the kernel up to 0xc0000000, giving a 1G/3G kernel/user split.
* Adjust the Integrator startup code accordingly.
 1.32 03-Mar-2002  chris Implement pmap_growkernel for arm32 based ports.
Note that this has been compiled on some systems, cats, IQ80310, IPAQ, netwinder and shark (note that shark's build is currently broken due to other reasons), but only actually run on cats.
Shark doesn't make use of the functionality as I believe there has to be a correlation between OFW and the kernel tables so that calls into OFW work.
 1.31 23-Feb-2002  thorpej Add some nops after we enable the MMU, for good measure (enough for
the nops to be the prefetch'd insns when the MMU switch occurs).
 1.30 23-Feb-2002  thorpej Make sure the MMU is enabled after we switch to the new kernel
page tables (gzboot disables the MMU before it does its work).
 1.29 22-Feb-2002  thorpej Fix the "va" argument to pmap_map_entry() when mapping kernel_ptpt.
This happened to work in the IOP310 because the kernel runs VA==PA.
 1.28 22-Feb-2002  thorpej Change pmap_map_entry() to work like pmap_map_chunk(): take a pointer
to the L1 table and a virtual address, and no pointer to the L2 table.
The L2 table will be looked up by pmap_map_entry(), which will panic
if the there is no L2 table for the requested VA.

NOTE: IT IS EXTREMELY IMPORTANT THAT THE CORRECT VIRTUAL ADDRESS
BE PROVIDED TO pmap_map_entry()! Notably, the code that mapped
the kernel L2 tables into the kernel PT mapping L2 table were not
passing actual virtual addresses, but rather offsets into the range
mapped by the L2 table. I have fixed up all of these call sites,
and tested the resulting kernel on both an IQ80310 and a Shark.
Other portmasters should examine their pmap_map_entry() calls if
their new kernels fail.
 1.27 21-Feb-2002  thorpej Keep track of which kernel PTs are available during bootstrap,
and let pmap_map_chunk() lookup the correct one to use for the
current VA. Eliminate the "l2table" argument to pmap_map_chunk().

Add a second L2 table for mapping kernel text/data/bss on the
IQ80310 (fixes booting kernels with ramdisks).
 1.26 21-Feb-2002  thorpej Always pass the L1 table to pmap_map_chunk(). This allows pmap_map_chunk()
to perform some error checking.
 1.25 21-Feb-2002  thorpej map_chunk() -> pmap_map_chunk(), and move it to pmap.c
 1.24 20-Feb-2002  skrll Fix typo in comment.
 1.23 20-Feb-2002  thorpej map_pagetable() -> pmap_link_l2pt(), and move it to pmap.c
 1.22 20-Feb-2002  thorpej Collapse map_entry{,ro,nc}() into a single pmap_map_entry() that
takes a prot and a "cacheable" indicator.
 1.21 20-Feb-2002  thorpej Rename map_section() to pmap_map_section(), move it to pmap.c, and give it
an extra argument (prot - specifies protection of the mapping).
 1.20 08-Feb-2002  thorpej branches: 1.20.2;
Default the console to the correct speed on the Npwr (so that
it doesn't have to be set in the kernel config file).
 1.19 07-Feb-2002  thorpej Don't hard-code the console address in error messages.
 1.18 30-Jan-2002  thorpej irq_init() -> iq80310_intr_init()
 1.17 25-Jan-2002  thorpej Overhaul of the ARM cache code. This is mostly a simplification
pass. Rather than providing a whole slew of cache operations that
aren't ever used, distill them down to some useful primitives:

icache_sync_all Synchronize I-cache
icache_sync_range Synchronize I-cache range

dcache_wbinv_all Write-back and Invalidate D-cache
dcache_wbinv_range Write-back and Invalidate D-cache range
dcache_inv_range Invalidate D-cache range
dcache_wb_range Write-back D-cache range

idcache_wbinv_all Write-back and Invalidate D-cache,
Invalidate I-cache
idcache_wbinv_range Write-back and Invalidate D-cache,
Invalidate I-cache range

Note: This does not yet include an overhaul of the actual asm files
that implement the primitives. Instead, we've provided a safe default
for each CPU type, and the individual CPU types can now be optimized
one at a time.
 1.16 20-Jan-2002  thorpej Some prototype cleanup.
 1.15 18-Jan-2002  thorpej Allow the console unit to be overridden with the CONUNIT configuration
option.
 1.14 16-Jan-2002  thorpej When mapping the kernel text/data/bss:
* Round the text size up the next page, don't truncate it.
* Pass the kernel L1 table to map_chunk() so that it can try
to use section mappings.
 1.13 04-Jan-2002  briggs If we're attaching UART2, then use UART2 in failure-case panic()s.
 1.12 27-Nov-2001  thorpej Update copyright notice.
 1.11 27-Nov-2001  thorpej Don't need to include <machine/irqhandler.h>
 1.10 23-Nov-2001  thorpej Use <arm/undefined.h> instead of <machine/undefined.h>.
 1.9 23-Nov-2001  thorpej No need to pull in <machine/pte.h> directly.
 1.8 11-Nov-2001  thorpej branches: 1.8.2;
Allocate the appropriate space for the XScale global cache clean code.
 1.7 09-Nov-2001  thorpej Add some rudimentary support for ELF symbols in DDB on the ARM ports.
On platforms which load the kernel sans symbols directly from firmware
(possibly in e.g. S-Record format), call ddb_init() with empty arguments,
so that it will search any compiled in SYMTAB_SPACE. On all other platforms,
if __ELF__, also call ddb_init() with empty arguments until ELF bootloaders
which pass symbol information are ready.
 1.6 09-Nov-2001  thorpej Remove unneeded declarations of the db_machine_init() function. The
ARM ports are the only ones that actually have one, and it is about
to change.
 1.5 09-Nov-2001  thorpej Remove unnecessary prototypes for zero_page_read{only,write}().
 1.4 08-Nov-2001  thorpej Correct a comment.
 1.3 08-Nov-2001  thorpej * Define fixed virtual addresses for the Primary and Secondary
PCI I/O spaces, as well as the i80312 PMMRs. Map these regions
in early bootstrap along with the on-board device address space.
* Adjust call to i80312_sdram_bounds() for the new way the PMMRs
are defined in i80312reg.h
* Word around some serious braindamage in RedBoot -- RedBoot uses
the on-board Ethernet to TFTP the kernel image. However, it does
not stop the Ethernet before transferring control to the loaded
program. This means that if it happens to receive another packet
(broadcast/multicast/unicast), it will happily scribble over the
memory of the new running program. Work around this problem by
performing a secondary-bus-reset on the i80312's PPB. XXX This
could be problematic if we ever encounter an application where
the i80312's PPB is actually used as a passthrough PPB.
 1.2 07-Nov-2001  thorpej Rework and fleshing out of Intel IQ80310 XScale eval board support.
More work to do -- this is a snapshot of work-in-progress.
 1.1 05-Sep-2001  matt branches: 1.1.4;
more evbarm files (very incomplete).
 1.1.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.8.2.11 11-Dec-2002  thorpej Sync with HEAD.
 1.8.2.10 18-Oct-2002  nathanw Catch up to -current.
 1.8.2.9 27-Aug-2002  thorpej Sync with -current.
 1.8.2.8 01-Aug-2002  nathanw Catch up to -current.
 1.8.2.7 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.8.2.6 17-Apr-2002  nathanw Catch up to -current.
 1.8.2.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.8.2.4 28-Feb-2002  nathanw Catch up to -current.
 1.8.2.3 11-Jan-2002  nathanw More catchup.
 1.8.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.8.2.1 11-Nov-2001  nathanw file iq80310_machdep.c was added on branch nathanw_sa on 2002-01-08 00:24:28 +0000
 1.20.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.20.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.20.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.20.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.20.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.20.2.1 08-Feb-2002  jdolecek file iq80310_machdep.c was added on branch kqueue on 2002-02-11 20:07:45 +0000
 1.40.4.2 14-Feb-2003  he Revert pull-up of revision 1.43 (requested by rearnsha in ticket #1170):
Revert cached memory access to L1 tables, this causes instability
on the release branch.
 1.40.4.1 21-Nov-2002  he Pull up revision 1.43 (requested by thorpej in ticket #712):
Do cached memory access to L1 tables, making sure to
write-back the cache after any L1 table modifications.
 1.40.2.1 30-Aug-2002  gehenna catch up with -current.
 1.60.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.60.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.60.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.60.2.1 03-Aug-2004  skrll Sync with HEAD
 1.65.10.3 21-Jan-2008  yamt sync with head
 1.65.10.2 30-Dec-2006  yamt sync with head.
 1.65.10.1 21-Jun-2006  yamt sync with head.
 1.66.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.66.8.1 24-May-2006  yamt sync with head.
 1.66.6.1 01-Jun-2006  kardel Sync with head.
 1.66.4.1 09-Sep-2006  rpaulo sync with head
 1.67.10.1 10-Dec-2006  yamt sync with head.
 1.67.8.1 12-Jan-2007  ad Sync with head.
 1.68.42.1 20-Jan-2008  bouyer Sync with HEAD
 1.68.34.1 18-Feb-2008  mjf Sync with HEAD.
 1.68.28.2 23-Mar-2008  matt sync with HEAD
 1.68.28.1 09-Nov-2007  matt Make all the evbarm kernels build again. Fix lossage from rebase.
 1.68.24.1 28-Feb-2008  rjs Sync with HEAD.
 1.69.10.4 11-Mar-2010  yamt sync with head
 1.69.10.3 19-Aug-2009  yamt sync with head.
 1.69.10.2 04-May-2009  yamt sync with head.
 1.69.10.1 16-May-2008  yamt sync with head.
 1.69.8.1 18-May-2008  yamt sync with head.
 1.69.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.69.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.70.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.70.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.80.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.80.2.1 30-Oct-2012  yamt sync with head
 1.82.2.3 03-Dec-2017  jdolecek update from HEAD
 1.82.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.82.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.83.2.1 28-Aug-2013  rmind sync with head
 1.85.4.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.85.2.1 05-Feb-2017  skrll Sync with HEAD
 1.86.16.3 21-Apr-2020  martin Sync with HEAD
 1.86.16.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.86.16.1 10-Jun-2019  christos Sync with HEAD
 1.86.14.3 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.86.14.2 30-Sep-2018  pgoyette Ssync with HEAD
 1.86.14.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.91.8.1 20-Apr-2020  bouyer Sync with HEAD
 1.94.4.1 14-Oct-2023  martin Pull up following revision(s) (requested by skrll in ticket #411):

sys/arch/evbarm/nslu2/nslu2_machdep.c: revision 1.41
sys/arch/evbarm/gumstix/gumstix_machdep.c: revision 1.75
sys/arch/evbarm/iq80321/iq80321_machdep.c: revision 1.66
sys/arch/iyonix/iyonix/iyonix_machdep.c: revision 1.34
sys/arch/zaurus/zaurus/machdep.c: revision 1.52
sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c: revision 1.41
sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c: revision 1.33
sys/arch/evbarm/iq80310/iq80310_machdep.c: revision 1.96
sys/arch/evbarm/adi_brh/brh_machdep.c: revision 1.53
sys/arch/arm/include/arm32/pmap.h: revision 1.177
sys/arch/evbarm/viper/viper_machdep.c: revision 1.34
sys/arch/evbarm/iyonix/iyonix_machdep.c: revision 1.5
sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c: revision 1.30
sys/arch/evbarm/hdl_g/hdlg_machdep.c: revision 1.35
sys/arch/arm/arm32/pmap.c: revision 1.440
sys/arch/evbarm/lubbock/lubbock_machdep.c: revision 1.45
sys/arch/evbarm/ixdp425/ixdp425_machdep.c: revision 1.47

Fix non-DIAGNOSTIC builds
 1.16 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.15 16-Nov-2018  jmcneill Add intr_establish_xname support to arm and expose it to intrctl
 1.14 23-Oct-2018  jmcneill Fix printf format strings - pci_intr_handle_t is uint64_t now on arm
 1.13 29-Mar-2014  christos branches: 1.13.28; 1.13.30;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.12 26-Mar-2014  christos kill sprintf.
 1.11 01-Jul-2011  dyoung branches: 1.11.2; 1.11.12; 1.11.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.10 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.9 11-Dec-2005  christos branches: 1.9.100; 1.9.106;
merge ktrace-lwp.
 1.8 15-Jul-2003  lukem __KERNEL_RCSID()
 1.7 08-Feb-2002  briggs branches: 1.7.16;
Wire the internal devices to the right interrupts on NPWR.
 1.6 08-Feb-2002  briggs Let this compile with the IOP310_TEAMASA_NPWR option.
 1.5 07-Feb-2002  thorpej Add support for the Team ASA Npwr IOP310-based server appliance.
 1.4 30-Jan-2002  thorpej 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.3 24-Jan-2002  thorpej s/CPLD/iq80310/g
 1.2 09-Nov-2001  thorpej branches: 1.2.2; 1.2.4; 1.2.6;
Fix typos in determing the ATU and PPB bus numbers.
 1.1 09-Nov-2001  thorpej PCI interrupt mapping support for the IQ80310.
 1.2.6.4 16-Mar-2002  jdolecek Catch up with -current.
 1.2.6.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.2.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.6.1 09-Nov-2001  thorpej file iq80310_pci.c was added on branch kqueue on 2002-01-10 19:42:36 +0000
 1.2.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.1 09-Nov-2001  nathanw file iq80310_pci.c was added on branch nathanw_sa on 2002-02-28 04:09:15 +0000
 1.2.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.2.2.1 09-Nov-2001  thorpej file iq80310_pci.c was added on branch thorpej-mips-cache on 2001-11-12 21:16:54 +0000
 1.7.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.16.1 03-Aug-2004  skrll Sync with HEAD
 1.9.106.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.100.1 21-Apr-2011  rmind sync with head
 1.11.16.1 18-May-2014  rmind sync with head
 1.11.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.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.13.30.1 10-Jun-2019  christos Sync with HEAD
 1.13.28.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.5 31-Jan-2011  matt Add RCSID when needed.
Don't include pmap.h or pte.h, include "assym.h" instead.
Use assym.h provided values.
 1.4 14-Oct-2002  bjh21 branches: 1.4.134; 1.4.140; 1.4.142;
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.3 26-Apr-2002  thorpej Issue a CPWAIT sequence after enabling the MMU to make sure
it's really enabled.
 1.2 05-Apr-2002  thorpej * Rewrite the 32-bit ARM pte.h based on the ARM architecture manual.
Significant cleanup, here, including better PTE bit names.
* Add XScale PTE extensions (ECC enable, write-allocate cache mode).
* Mechanical changes everywhere else to update for new pte.h. While
doing this, two bugs (as a result of typos) were fixed in

arm/arm32/bus_dma.c
evbarm/integrator/int_bus_dma.c
 1.1 03-Mar-2002  thorpej branches: 1.1.4; 1.1.8;
* Add support for running the IQ80310 kernel where KERNEL_BASE !=
physical memory start. Garbage-collect some cruft while here.
* Move the kernel up to 0xc0000000, giving a 1G/3G kernel/user split.
* Adjust the Integrator startup code accordingly.
 1.1.8.5 18-Oct-2002  nathanw Catch up to -current.
 1.1.8.4 20-Jun-2002  nathanw Catch up to -current.
 1.1.8.3 17-Apr-2002  nathanw Catch up to -current.
 1.1.8.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.8.1 03-Mar-2002  nathanw file iq80310_start.S was added on branch nathanw_sa on 2002-04-01 07:39:47 +0000
 1.1.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.4.1 03-Mar-2002  jdolecek file iq80310_start.S was added on branch kqueue on 2002-03-16 15:57:28 +0000
 1.4.142.1 08-Feb-2011  bouyer Sync with HEAD
 1.4.140.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.134.1 05-Mar-2011  rmind sync with head
 1.24 20-Jul-2024  andvar fix typos in comments, mainly s/harware/hardware/.
 1.23 29-May-2020  rin branches: 1.23.26;
For struct timecounter, use C99 initializers.
Compile tested. No functional changes intended.
 1.22 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.21 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.20 19-Feb-2007  briggs branches: 1.20.18; 1.20.22; 1.20.28; 1.20.34;
Convert evbarm to __HAVE_GENERIC_TODR.
 1.19 24-Dec-2005  perry branches: 1.19.24; 1.19.26;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.18 11-Dec-2005  christos merge ktrace-lwp.
 1.17 04-Jun-2005  he branches: 1.17.2;
Rename an (unused) argument to appease -Wshadow.
 1.16 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.15 26-Feb-2005  simonb Watch out for those unexpected tains.
 1.14 27-Jul-2003  thorpej branches: 1.14.8; 1.14.10;
Fix think'o in last. Pointed out by Izumi Tsutsui.
 1.13 26-Jul-2003  thorpej Flesh out inittodr() and resettodr().
 1.12 15-Jul-2003  lukem __KERNEL_RCSID()
 1.11 14-Apr-2002  thorpej branches: 1.11.10;
* Delcare COUNTER_MASK properly.
* Restructure timer_read() so that the compiler generates better code.
 1.10 13-Apr-2002  thorpej Gah, correct editor mistake in last.
 1.9 13-Apr-2002  thorpej * Eliminate some redundant masking.
* Don't run the snake if the board doesn't have a 7-segment display.
 1.8 03-Mar-2002  thorpej inittodr(): Actually initialize time from the file system time.
 1.7 08-Feb-2002  thorpej The Npwr has a 19-bit timer. Make sure values programmed into
the counter fit.
 1.6 01-Dec-2001  thorpej branches: 1.6.2;
Implement a "snake" for the 7-segment display.
 1.5 26-Nov-2001  thorpej Fix brain'o in handling of schedhz and profhz. Also, make sure to
compute tickfix after computing tick (not that tickfix should ever
be non-zero, but there for completeness).
 1.4 23-Nov-2001  thorpej Use <arm/cpufunc.h>, not <machine/cpufunc.h>.
 1.3 08-Nov-2001  thorpej branches: 1.3.2; 1.3.4;
Fix delay().
 1.2 07-Nov-2001  thorpej We were already cheating w/ CPLD register access, so cheat all the
way and use pointer derefs rather than bus_space to access them.
 1.1 07-Nov-2001  thorpej Rework and fleshing out of Intel IQ80310 XScale eval board support.
More work to do -- this is a snapshot of work-in-progress.
 1.3.4.5 17-Apr-2002  nathanw Catch up to -current.
 1.3.4.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.3.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.4.1 08-Nov-2001  nathanw file iq80310_timer.c was added on branch nathanw_sa on 2002-01-08 00:24:28 +0000
 1.3.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.3.2.1 08-Nov-2001  thorpej file iq80310_timer.c was added on branch thorpej-mips-cache on 2001-11-12 21:16:54 +0000
 1.6.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.6.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.1 01-Dec-2001  thorpej file iq80310_timer.c was added on branch kqueue on 2002-01-10 19:42:36 +0000
 1.11.10.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.10.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.11.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.10.1 03-Aug-2004  skrll Sync with HEAD
 1.14.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.14.8.1 29-Apr-2005  kent sync with -current
 1.17.2.3 21-Jan-2008  yamt sync with head
 1.17.2.2 26-Feb-2007  yamt sync with head.
 1.17.2.1 21-Jun-2006  yamt sync with head.
 1.19.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.19.24.1 04-Mar-2007  bouyer Pull up following revision(s) (requested by matt in ticket #470):
sys/arch/evbarm/iq80310/iq80310_timer.c: revision 1.20
sys/arch/evbarm/ifpga/pl030_rtc.c: revision 1.8
sys/arch/evbarm/include/types.h: revision 1.7
sys/arch/arm/arm32/genassym.cf: revision 1.30
sys/arch/arm/arm32/cpuswitch.S: revision 1.46
Get DOMAIN_CLIENT directly from arm/arm32/pte.h instead of from genassym
to avoid redefinition when both assymh and pte.h are included (as in
INTEGRATOR's intmmu.S, which uses more macros from pte.h).
Convert evbarm to __HAVE_GENERIC_TODR.
 1.20.34.1 20-Jan-2008  bouyer Sync with HEAD
 1.20.28.1 18-Feb-2008  mjf Sync with HEAD.
 1.20.22.1 23-Mar-2008  matt sync with HEAD
 1.20.18.1 28-Feb-2008  rjs Sync with HEAD.
 1.23.26.1 02-Aug-2025  perseant Sync with HEAD
 1.2 07-Nov-2001  thorpej branches: 1.2.2;
Rework and fleshing out of Intel IQ80310 XScale eval board support.
More work to do -- this is a snapshot of work-in-progress.
 1.1 05-Sep-2001  matt branches: 1.1.4;
more evbarm files (very incomplete).
 1.1.4.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.2.2.1 08-Jan-2002  nathanw Catch up to -current.
 1.7 20-Oct-2016  skrll Fix regisers typo
 1.6 24-Dec-2005  perry branches: 1.6.122; 1.6.142; 1.6.146;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.5 14-May-2003  thorpej branches: 1.5.18;
Move the 7-segment display definitions into the C file.
 1.4 01-Dec-2001  thorpej branches: 1.4.2;
Remove U from the display seg constants.
 1.3 08-Nov-2001  thorpej branches: 1.3.2; 1.3.4;
* Define fixed virtual addresses for the Primary and Secondary
PCI I/O spaces, as well as the i80312 PMMRs. Map these regions
in early bootstrap along with the on-board device address space.
* Adjust call to i80312_sdram_bounds() for the new way the PMMRs
are defined in i80312reg.h
* Word around some serious braindamage in RedBoot -- RedBoot uses
the on-board Ethernet to TFTP the kernel image. However, it does
not stop the Ethernet before transferring control to the loaded
program. This means that if it happens to receive another packet
(broadcast/multicast/unicast), it will happily scribble over the
memory of the new running program. Work around this problem by
performing a secondary-bus-reset on the i80312's PPB. XXX This
could be problematic if we ever encounter an application where
the i80312's PPB is actually used as a passthrough PPB.
 1.2 07-Nov-2001  thorpej We were already cheating w/ CPLD register access, so cheat all the
way and use pointer derefs rather than bus_space to access them.
 1.1 07-Nov-2001  thorpej Rework and fleshing out of Intel IQ80310 XScale eval board support.
More work to do -- this is a snapshot of work-in-progress.
 1.3.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.3.4.1 08-Nov-2001  nathanw file iq80310reg.h was added on branch nathanw_sa on 2002-01-08 00:24:28 +0000
 1.3.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.3.2.1 08-Nov-2001  thorpej file iq80310reg.h was added on branch thorpej-mips-cache on 2001-11-12 21:16:54 +0000
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 01-Dec-2001  thorpej file iq80310reg.h was added on branch kqueue on 2002-01-10 19:42:37 +0000
 1.5.18.1 21-Jun-2006  yamt sync with head.
 1.6.146.1 04-Nov-2016  pgoyette Sync with HEAD
 1.6.142.1 05-Dec-2016  skrll Sync with HEAD
 1.6.122.1 03-Dec-2017  jdolecek update from HEAD
 1.8 03-Oct-2012  chs defer evcnt attachment correctly.
 1.7 08-Oct-2002  thorpej branches: 1.7.146; 1.7.152; 1.7.156;
Fix a typo.
 1.6 03-Oct-2002  thorpej Add macros to convert an "IRQ" number to its respective XINT3/XINT0 bit.
 1.5 07-Feb-2002  thorpej Add support for the Team ASA Npwr IOP310-based server appliance.
 1.4 30-Jan-2002  thorpej 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.3 01-Dec-2001  thorpej branches: 1.3.2;
Implement a "snake" for the 7-segment display.
 1.2 09-Nov-2001  thorpej branches: 1.2.2; 1.2.4;
PCI interrupt mapping support for the IQ80310.
 1.1 07-Nov-2001  thorpej Rework and fleshing out of Intel IQ80310 XScale eval board support.
More work to do -- this is a snapshot of work-in-progress.
 1.2.4.4 18-Oct-2002  nathanw Catch up to -current.
 1.2.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.4.1 09-Nov-2001  nathanw file iq80310var.h was added on branch nathanw_sa on 2002-01-08 00:24:28 +0000
 1.2.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.2.2.1 09-Nov-2001  thorpej file iq80310var.h was added on branch thorpej-mips-cache on 2001-11-12 21:16:54 +0000
 1.3.2.4 16-Mar-2002  jdolecek Catch up with -current.
 1.3.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 01-Dec-2001  thorpej file iq80310var.h was added on branch kqueue on 2002-01-10 19:42:37 +0000
 1.7.156.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.7.152.1 17-Oct-2012  riz Pull up following revision(s) (requested by chs in ticket #591):
sys/arch/evbarm/iq80310/i80312_mainbus.c: revision 1.15
sys/arch/evbarm/iq80310/iq80310var.h: revision 1.8
sys/arch/evbarm/iq80310/iq80310_intr.c: revision 1.32
defer evcnt attachment correctly.
 1.7.146.1 30-Oct-2012  yamt sync with head
 1.22 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.21 24-Apr-2021  thorpej branches: 1.21.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.20 01-Jul-2011  dyoung branches: 1.20.68;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.19 06-Jun-2011  matt Some more device_t, cfdata_t, CFATTACH_DECL_NEW cleanup.
 1.18 11-Dec-2005  christos branches: 1.18.100; 1.18.110;
merge ktrace-lwp.
 1.17 26-Aug-2005  drochner s/locdesc_t/int/g
 1.16 30-Jun-2005  drochner branches: 1.16.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.15 15-Jul-2003  lukem __KERNEL_RCSID()
 1.14 16-Jun-2003  thorpej branches: 1.14.2;
Give every obio implementation a size and width locator.
 1.13 15-Jun-2003  thorpej Add an optional "width" locator to the obio bus, specifying the
bus width of the device.
 1.12 01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.11 03-Oct-2002  thorpej Use indirect configuration for on-board devices (i.e. those things
attached to "obio") on the IQ80310 and IQ80321. It makes more sense
to do it this way for this type of system (the goal being to encapsulate
as much information about the board as possible into one file).
 1.10 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.9 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.8 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.7 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.6 08-Feb-2002  thorpej The Npwr doesn't have the board_rev/cpld_rev/backplane_det registers,
do don't bother reading them.
 1.5 08-Feb-2002  briggs finish conversion from TEAMASA_NPWR to IOP310_TEAMASA_NPWR
 1.4 07-Feb-2002  thorpej Add support for the Team ASA Npwr IOP310-based server appliance.
 1.3 19-Nov-2001  thorpej branches: 1.3.2;
Reorder the device table to make the UART at J9 attach before the
UART at J10 (this is the same ordering the RedBoot uses, and also
is intuitive).
 1.2 07-Nov-2001  thorpej branches: 1.2.2; 1.2.4;
We were already cheating w/ CPLD register access, so cheat all the
way and use pointer derefs rather than bus_space to access them.
 1.1 07-Nov-2001  thorpej Rework and fleshing out of Intel IQ80310 XScale eval board support.
More work to do -- this is a snapshot of work-in-progress.
 1.2.4.5 03-Jan-2003  thorpej Sync with HEAD.
 1.2.4.4 18-Oct-2002  nathanw Catch up to -current.
 1.2.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.4.1 07-Nov-2001  nathanw file obio.c was added on branch nathanw_sa on 2002-01-08 00:24:28 +0000
 1.2.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.2.2.1 07-Nov-2001  thorpej file obio.c was added on branch thorpej-mips-cache on 2001-11-12 21:16:54 +0000
 1.3.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.3.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.3.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 19-Nov-2001  thorpej file obio.c was added on branch kqueue on 2002-01-10 19:42:37 +0000
 1.14.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.2.1 21-Jun-2006  yamt sync with head.
 1.18.110.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.18.100.1 12-Jun-2011  rmind sync with head
 1.20.68.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.20.68.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.20.68.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.20.68.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.20.68.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.20.68.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.21.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.17 21-Apr-2023  skrll Trailing whitespace.
 1.16 16-Mar-2018  ryo use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
 1.15 22-Feb-2014  matt branches: 1.15.28;
Don't manipulate the pte to get uncached memory, use PMAP_NOCACHE instead.
Convert footbring to kenter_pa/kremove
 1.14 01-Jul-2011  dyoung branches: 1.14.2; 1.14.12; 1.14.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.13 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.12 24-Nov-2005  yamt branches: 1.12.78;
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.11 01-Apr-2005  yamt branches: 1.11.2; 1.11.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.10 15-Jul-2003  lukem branches: 1.10.8; 1.10.10;
__KERNEL_RCSID()
 1.9 15-Jun-2003  thorpej branches: 1.9.2;
Use the new pmap_devmap facility in the on-board device mapping code.
 1.8 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.7 22-Aug-2002  thorpej * Add PTE_SYNC() and PTE_SYNC_RANGE() macros. These don't actually do
anything yet.
* Use PTE_SYNC() and PTE_SYNC_RANGE() in some obvious places, i.e.
where vtopte() is used.
 1.6 12-Apr-2002  thorpej branches: 1.6.2;
Use the bus_space_generic bus space ops.
 1.5 09-Apr-2002  thorpej * Split pte_cache_mode into pte_l1_s_cache_mode, pte_l2_l_cache_mode,
and pte_l2_s_cache_mode. The cache-meaningful bits are different
for these descriptor types on some processor models.
* Add pte_*_cache_mask, corresponding to each above, which has a mask
of the cache-meangful bits, and define those for generic and XScale
MMU classes. Note, the L2_S_CACHE_MASK_xscale definition requires
use of the Extended Small Page L2 descriptor (the "X" bit overlaps
with AP bits otherwise).
 1.4 05-Apr-2002  thorpej Use pte_cache_mode instead of PT_CACHEABLE;
 1.3 24-Mar-2002  thorpej Use vtopte() instead of pmap_pte().
 1.2 19-Mar-2002  briggs Use obio_bs_rr_1.
In obio_bs_map(): Create a mapping for regions that are not in the
standard on-board I/O space.
 1.1 07-Nov-2001  thorpej branches: 1.1.2; 1.1.4; 1.1.6;
Rework and fleshing out of Intel IQ80310 XScale eval board support.
More work to do -- this is a snapshot of work-in-progress.
 1.1.6.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.1.6.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 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 07-Nov-2001  thorpej file obio_space.c was added on branch kqueue on 2002-01-10 19:42:38 +0000
 1.1.4.5 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.4 27-Aug-2002  thorpej Sync with -current.
 1.1.4.3 17-Apr-2002  nathanw Catch up to -current.
 1.1.4.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.4.1 07-Nov-2001  nathanw file obio_space.c was added on branch nathanw_sa on 2002-04-01 07:39:48 +0000
 1.1.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.1 07-Nov-2001  thorpej file obio_space.c was added on branch thorpej-mips-cache on 2001-11-12 21:16:55 +0000
 1.6.2.1 30-Aug-2002  gehenna catch up with -current.
 1.9.2.5 11-Dec-2005  christos Sync with head.
 1.9.2.4 01-Apr-2005  skrll Sync with HEAD.
 1.9.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.2.1 03-Aug-2004  skrll Sync with HEAD
 1.10.10.1 13-Feb-2005  yamt use new apis.
 1.10.8.1 29-Apr-2005  kent sync with -current
 1.11.8.1 29-Nov-2005  yamt sync with head.
 1.11.2.1 21-Jun-2006  yamt sync with head.
 1.12.78.1 11-Mar-2010  yamt sync with head
 1.14.16.1 18-May-2014  rmind sync with head
 1.14.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.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.15.28.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.3 12-Apr-2002  thorpej Use the bus_space_generic bus space ops.
 1.2 23-Feb-2002  briggs Implement obio_bs_rr_1.
 1.1 07-Nov-2001  thorpej branches: 1.1.2; 1.1.4; 1.1.6;
Rework and fleshing out of Intel IQ80310 XScale eval board support.
More work to do -- this is a snapshot of work-in-progress.
 1.1.6.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.3 16-Mar-2002  jdolecek Catch up with -current.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 07-Nov-2001  thorpej file obio_space_asm.S was added on branch kqueue on 2002-01-10 19:42:38 +0000
 1.1.4.3 17-Apr-2002  nathanw Catch up to -current.
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 07-Nov-2001  nathanw file obio_space_asm.S was added on branch nathanw_sa on 2002-02-28 04:09:15 +0000
 1.1.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.1 07-Nov-2001  thorpej file obio_space_asm.S was added on branch thorpej-mips-cache on 2001-11-12 21:16:55 +0000
 1.4 16-Jun-2003  thorpej Give every obio implementation a size and width locator.
 1.3 15-Jun-2003  thorpej Add an optional "width" locator to the obio bus, specifying the
bus width of the device.
 1.2 03-Oct-2002  thorpej Use indirect configuration for on-board devices (i.e. those things
attached to "obio") on the IQ80310 and IQ80321. It makes more sense
to do it this way for this type of system (the goal being to encapsulate
as much information about the board as possible into one file).
 1.1 07-Nov-2001  thorpej branches: 1.1.2; 1.1.4; 1.1.6;
Rework and fleshing out of Intel IQ80310 XScale eval board support.
More work to do -- this is a snapshot of work-in-progress.
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 07-Nov-2001  thorpej file obiovar.h was added on branch kqueue on 2002-01-10 19:42:38 +0000
 1.1.4.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.1 07-Nov-2001  nathanw file obiovar.h was added on branch nathanw_sa on 2002-10-18 02:36:32 +0000
 1.1.2.2 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.2.1 07-Nov-2001  thorpej file obiovar.h was added on branch thorpej-mips-cache on 2001-11-12 21:16:55 +0000

RSS XML Feed