Home | History | Annotate | only in /src/sys/arch/arm/gemini
History log of /src/sys/arch/arm/gemini
RevisionDateAuthorComments
 1.13 21-Sep-2018  skrll Centralise defparam CONSADDR, CONSPEED, CONMODE and CONADDR into
opt_console.h and adjust.
 1.12 06-Jun-2012  skrll branches: 1.12.38; 1.12.40;
Provide generic a[24]x bus_space methods (aNx is normal access, offset
multipled by N).

Use the generic method and delete the other versions.

Discussed with matt@
 1.11 11-Mar-2011  bsh branches: 1.11.4; 1.11.10;
split arch/arm/pic/pic.c so that we can implement more efficient version of splfoo() while using pic framework.
 1.10 14-Dec-2008  matt branches: 1.10.2; 1.10.6; 1.10.10; 1.10.12;
Add the beginning of a driver which supports the on-chip gmac (gigabit)
ethernet port. It's still being debugged but it attaches and does some
things right. And a lot wrong. That's what debugging is for.
 1.9 06-Dec-2008  cliff add gemini pseudo-nic and support code.
 1.8 26-Nov-2008  matt Add children of geminiipi
 1.7 20-Nov-2008  cliff add GPIO driver for Gemini
 1.6 20-Nov-2008  cliff add driver for low level inter-processor-interrupt
provides functions for establish/disestablish IPI ISR,
and function to signal IPI to the other CPU.
 1.5 13-Nov-2008  cliff add option GEMINI_BUSBASE to define kernel offset between
kernel physical addr and (DMA master) bus addr
 1.4 11-Nov-2008  cliff - add option GEMINI_SINGLE for single-core system model
- add "re" interface to GEMINI configuration
 1.3 09-Nov-2008  cliff - add autoconfig support for wdc at Gemini obio
- add autoconfig support for com type UART on IT8712 superio chip
attached at lpc bus at lpc host controller at Gemini obio.
 1.2 24-Oct-2008  matt branches: 1.2.2;
Add EHCI attachment for GEMINI port.
 1.1 24-Oct-2008  matt Add support for Cortina Systems SL3516 eval board.
 1.2.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.10.12.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10.10.1 21-Apr-2011  rmind sync with head
 1.10.6.2 04-May-2009  yamt sync with head.
 1.10.6.1 14-Dec-2008  yamt file files.gemini was added on branch yamt-nfs-mp on 2009-05-04 08:10:40 +0000
 1.10.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.10.2.1 14-Dec-2008  mjf file files.gemini was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.11.10.1 10-Aug-2012  jdc Pull up revisions:
src/sys/arch/arm/arm/bus_space_a2x.S revision 1.1
src/sys/arch/arm/arm/bus_space_a4x.S revision 1.1
src/sys/arch/arm/gemini/files.gemini revision 1.12
src/sys/arch/arm/mpcore/files.mpcore revision 1.2
src/sys/arch/arm/mpcore/mpcore_a2x_io.S delete
src/sys/arch/arm/mpcore/mpcore_a4x_io.S delete
src/sys/arch/arm/omap/files.omap revision 1.6
src/sys/arch/arm/omap/files.omap2 revision 1.9
src/sys/arch/arm/omap/omap_a2x_io.S delete
src/sys/arch/arm/xscale/files.pxa2x0 revision 1.18
src/sys/arch/arm/xscale/pxa2x0_a4x_io.S delete
(requested by skrll to fix ticket #454).

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

Use the generic method and delete the other versions.

Discussed with matt@
 1.11.4.1 30-Oct-2012  yamt sync with head
 1.12.40.1 10-Jun-2019  christos Sync with HEAD
 1.12.38.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.3 16-Mar-2018  ryo use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
 1.2 01-Jul-2011  dyoung branches: 1.2.52;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.1 24-Oct-2008  matt branches: 1.1.8; 1.1.14;
Add support for Cortina Systems SL3516 eval board.
 1.1.14.2 04-May-2009  yamt sync with head.
 1.1.14.1 24-Oct-2008  yamt file gemini_a4x_space.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:40 +0000
 1.1.8.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.8.1 24-Oct-2008  mjf file gemini_a4x_space.c was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.2.52.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.4 08-Dec-2018  thorpej Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.3 01-Jul-2011  dyoung branches: 1.3.52; 1.3.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.2 08-Nov-2008  cliff branches: 1.2.4; 1.2.8;
on-chip gemini uart is a COM_TYPE_16550_NOERS
 1.1 24-Oct-2008  matt branches: 1.1.2;
Add support for Cortina Systems SL3516 eval board.
 1.1.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.2.8.2 04-May-2009  yamt sync with head.
 1.2.8.1 08-Nov-2008  yamt file gemini_com.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:40 +0000
 1.2.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.4.1 08-Nov-2008  mjf file gemini_com.c was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.3.54.1 10-Jun-2019  christos Sync with HEAD
 1.3.52.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.1 24-Oct-2008  matt branches: 1.1.8; 1.1.14;
Add support for Cortina Systems SL3516 eval board.
 1.1.14.2 04-May-2009  yamt sync with head.
 1.1.14.1 24-Oct-2008  yamt file gemini_com.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:40 +0000
 1.1.8.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.8.1 24-Oct-2008  mjf file gemini_com.h was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.4 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.3 18-Sep-2012  matt Add bounce buffer support for ARM bus_dma(9). Add macros to help initialize
bus_dma_tag structures.
 1.2 01-Jul-2011  dyoung branches: 1.2.2; 1.2.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.1 24-Oct-2008  matt branches: 1.1.8; 1.1.14;
Add support for Cortina Systems SL3516 eval board.
 1.1.14.2 04-May-2009  yamt sync with head.
 1.1.14.1 24-Oct-2008  yamt file gemini_dma.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.1.8.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.8.1 24-Oct-2008  mjf file gemini_dma.c was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.2.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.2.1 30-Oct-2012  yamt sync with head
 1.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 04-Feb-2020  skrll branches: 1.20.8;
Trailing whitespace
 1.19 04-Feb-2020  skrll Adopt <net/if_stats.h>
 1.18 30-Oct-2019  msaitoh branches: 1.18.2;
ether_input() automatically add input bytes to if_ibytes, so it's not
required to do in the driver who use ether_input().
 1.17 22-Jan-2019  msaitoh branches: 1.17.4;
Change MII PHY read/write API from:

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

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

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

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

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

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


Tested with the following device:

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

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

Not tested (PHY):
amhphy
bmtphy
dmphy
etphy
glxtphy
ikphy
iophy
lxtphy
nsphyter
pnaphy
rdcphy
sqphy
tlphy
tqphy
urlphy
 1.16 26-Jun-2018  msaitoh branches: 1.16.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.15 09-May-2018  maxv Remove nonsensical KASSERT.
 1.14 26-Apr-2018  maxv Fix inverted arguments in m_gethdr().
 1.13 01-Jun-2017  chs branches: 1.13.2; 1.13.8;
remove checks for failure after memory allocation calls that cannot fail:

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

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.12 28-Mar-2017  ozaki-r Avoid touching a mbuf after enqueuing it
 1.11 15-Dec-2016  ozaki-r branches: 1.11.2;
Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

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

Proposed on tech-kern and tech-net
 1.10 06-Dec-2016  ozaki-r Use if_percpuq_enqueue, not if_input

Because gmac_hwqueue_rxconsume is called in hardware interrupt.
 1.9 10-Jun-2016  ozaki-r branches: 1.9.2;
Introduce m_set_rcvif and m_reset_rcvif

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

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

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

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

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

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

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.7 01-Jul-2011  dyoung branches: 1.7.12; 1.7.30;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.6 05-Apr-2010  joerg Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.
 1.5 19-Jan-2010  pooka branches: 1.5.2; 1.5.4;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

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

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.4 18-Jan-2010  pooka Pass correct pointer to bpf_mtap() and most likely avoid a crash
if bpf is activated.

not even compile-tested, since i can't find any config in the tree
which uses this(?)
 1.3 23-Dec-2008  matt branches: 1.3.2; 1.3.4; 1.3.8;
Baby steps to a working driver. transmit works. receive sometimes works
but the h/w is doing really weird shit.
 1.2 15-Dec-2008  matt Get the gmac driver close to working.
 1.1 14-Dec-2008  matt Add the beginning of a driver which supports the on-chip gmac (gigabit)
ethernet port. It's still being debugged but it attaches and does some
things right. And a lot wrong. That's what debugging is for.
 1.3.8.4 11-Aug-2010  yamt sync with head.
 1.3.8.3 11-Mar-2010  yamt sync with head
 1.3.8.2 04-May-2009  yamt sync with head.
 1.3.8.1 23-Dec-2008  yamt file gemini_gmac.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.3.4.2 19-Jan-2009  skrll Sync with HEAD.
 1.3.4.1 23-Dec-2008  skrll file gemini_gmac.c was added on branch nick-hppapmap on 2009-01-19 13:15:57 +0000
 1.3.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.2.1 23-Dec-2008  mjf file gemini_gmac.c was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.5.4.1 30-May-2010  rmind sync with head
 1.5.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.7.30.4 28-Aug-2017  skrll Sync with HEAD
 1.7.30.3 05-Feb-2017  skrll Sync with HEAD
 1.7.30.2 09-Jul-2016  skrll Sync with HEAD
 1.7.30.1 19-Mar-2016  skrll Sync with HEAD
 1.7.12.1 03-Dec-2017  jdolecek update from HEAD
 1.9.2.2 26-Apr-2017  pgoyette Sync with HEAD
 1.9.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.11.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.13.8.4 26-Jan-2019  pgoyette Sync with HEAD
 1.13.8.3 28-Jul-2018  pgoyette Sync with HEAD
 1.13.8.2 21-May-2018  pgoyette Sync with HEAD
 1.13.8.1 02-May-2018  pgoyette Synch with HEAD
 1.13.2.1 06-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1427):

sys/arch/arm/broadcom/bcm53xx_eth.c: revision 1.39
sys/dev/pcmcia/if_xi.c: revision 1.91
sys/dev/ic/aic6915.c: revision 1.40
sys/dev/pci/if_tl.c: revision 1.117
sys/arch/arm/gemini/gemini_gmac.c: revision 1.18
sys/dev/ic/elinkxl.c: revision 1.133
sys/dev/pci/if_ste.c: revision 1.57
sys/dev/pci/if_alc.c: revision 1.43
sys/dev/pci/if_stge.c: revision 1.72
sys/dev/pci/if_ale.c: revision 1.34
sys/dev/pci/if_age.c: revision 1.62
sys/dev/pci/if_txp.c: revision 1.60
sys/dev/ic/i82557.c: revision 1.156
sys/dev/pci/if_vte.c: revision 1.27
sys/arch/powerpc/booke/dev/pq3etsec.c: revision 1.47
sys/arch/arm/gemini/if_gpn.c: revision 1.13

if_percpuq(9) and ether_input() automatically increment if_ipackets, so don't add number of
RX frames from device's statistics counter to if_ipackets to avoid double
count.
 1.16.2.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.16.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.16.2.1 10-Jun-2019  christos Sync with HEAD
 1.17.4.1 06-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #403):

sys/arch/arm/broadcom/bcm53xx_eth.c: revision 1.39
sys/dev/pcmcia/if_xi.c: revision 1.91
sys/dev/ic/aic6915.c: revision 1.40
sys/dev/pci/if_tl.c: revision 1.117
sys/arch/arm/gemini/gemini_gmac.c: revision 1.18
sys/dev/ic/elinkxl.c: revision 1.133
sys/dev/pci/if_ste.c: revision 1.57
sys/dev/pci/if_alc.c: revision 1.43
sys/dev/pci/if_stge.c: revision 1.72
sys/dev/pci/if_ale.c: revision 1.34
sys/dev/pci/if_age.c: revision 1.62
sys/dev/pci/if_txp.c: revision 1.60
sys/dev/ic/i82557.c: revision 1.156
sys/dev/pci/if_vte.c: revision 1.27
sys/arch/powerpc/booke/dev/pq3etsec.c: revision 1.47
sys/arch/arm/gemini/if_gpn.c: revision 1.13

if_percpuq(9) and ether_input() automatically increment if_ipackets, so don't add number of
RX frames from device's statistics counter to if_ipackets to avoid double
count.
 1.18.2.1 29-Feb-2020  ad Sync with head.
 1.20.8.2 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.20.8.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.4 13-May-2024  msaitoh emtpy -> empty in comment.
 1.3 23-Dec-2008  matt branches: 1.3.2; 1.3.4; 1.3.8;
Baby steps to a working driver. transmit works. receive sometimes works
but the h/w is doing really weird shit.
 1.2 15-Dec-2008  matt Get the gmac driver close to working.
 1.1 14-Dec-2008  matt Add the beginning of a driver which supports the on-chip gmac (gigabit)
ethernet port. It's still being debugged but it attaches and does some
things right. And a lot wrong. That's what debugging is for.
 1.3.8.2 04-May-2009  yamt sync with head.
 1.3.8.1 23-Dec-2008  yamt file gemini_gmacreg.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.3.4.2 19-Jan-2009  skrll Sync with HEAD.
 1.3.4.1 23-Dec-2008  skrll file gemini_gmacreg.h was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.3.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.2.1 23-Dec-2008  mjf file gemini_gmacreg.h was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.3 23-Dec-2008  matt branches: 1.3.2; 1.3.4; 1.3.8;
Baby steps to a working driver. transmit works. receive sometimes works
but the h/w is doing really weird shit.
 1.2 15-Dec-2008  matt Get the gmac driver close to working.
 1.1 14-Dec-2008  matt Add the beginning of a driver which supports the on-chip gmac (gigabit)
ethernet port. It's still being debugged but it attaches and does some
things right. And a lot wrong. That's what debugging is for.
 1.3.8.2 04-May-2009  yamt sync with head.
 1.3.8.1 23-Dec-2008  yamt file gemini_gmacvar.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.3.4.2 19-Jan-2009  skrll Sync with HEAD.
 1.3.4.1 23-Dec-2008  skrll file gemini_gmacvar.h was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.3.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.2.1 23-Dec-2008  mjf file gemini_gmacvar.h was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.5 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.4 24-Apr-2021  thorpej branches: 1.4.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.3 01-Jul-2011  dyoung branches: 1.3.68;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.2 14-Dec-2008  matt branches: 1.2.2; 1.2.4; 1.2.8;
Rename gpio.h to gpiovar.h. Make the pin routines usable by others
than the gpio code. (gmac driver needs access to gpio to do mii ops).
 1.1 20-Nov-2008  cliff add GPIO driver for Gemini
 1.2.8.2 04-May-2009  yamt sync with head.
 1.2.8.1 14-Dec-2008  yamt file gemini_gpio.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.2.4.2 19-Jan-2009  skrll Sync with HEAD.
 1.2.4.1 14-Dec-2008  skrll file gemini_gpio.c was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.2.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.2.1 14-Dec-2008  mjf file gemini_gpio.c was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.3.68.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.4.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 14-Dec-2008  matt Rename gpio.h to gpiovar.h. Make the pin routines usable by others
than the gpio code. (gmac driver needs access to gpio to do mii ops).
 1.1 20-Nov-2008  cliff add GPIO driver for Gemini
 1.1 14-Dec-2008  matt branches: 1.1.2; 1.1.4; 1.1.8;
Rename gpio.h to gpiovar.h. Make the pin routines usable by others
than the gpio code. (gmac driver needs access to gpio to do mii ops).
 1.1.8.2 04-May-2009  yamt sync with head.
 1.1.8.1 14-Dec-2008  yamt file gemini_gpiovar.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.1.4.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.4.1 14-Dec-2008  skrll file gemini_gpiovar.h was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.1.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.2.1 14-Dec-2008  mjf file gemini_gpiovar.h was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.7 03-Mar-2022  riastradh arm: Use device_set_private for various drivers.
 1.6 26-Sep-2020  skrll G/C arm/atomic.h
 1.5 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.4 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.3 14-Jun-2009  rjs branches: 1.3.4;
Fix CVS header.
 1.2 24-Oct-2008  matt branches: 1.2.8; 1.2.14;
Add irq source names.
 1.1 24-Oct-2008  matt Add support for Cortina Systems SL3516 eval board.
 1.2.14.3 20-Jun-2009  yamt sync with head
 1.2.14.2 04-May-2009  yamt sync with head.
 1.2.14.1 24-Oct-2008  yamt file gemini_icu.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.2.8.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.8.1 24-Oct-2008  mjf file gemini_icu.c was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.3.4.1 05-Mar-2011  rmind sync with head
 1.4 25-Jun-2022  jmcneill Remove GIC_SPLFUNCS.
 1.3 30-Sep-2021  skrll More catching up with spl changes.
 1.2 24-Oct-2008  matt branches: 1.2.8; 1.2.14;
Make this reflect reality.
 1.1 24-Oct-2008  matt Add support for Cortina Systems SL3516 eval board.
 1.2.14.2 04-May-2009  yamt sync with head.
 1.2.14.1 24-Oct-2008  yamt file gemini_intr.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.2.8.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.8.1 24-Oct-2008  mjf file gemini_intr.h was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.11 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.10 24-Apr-2021  thorpej branches: 1.10.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.9 20-Nov-2020  thorpej branches: 1.9.2;
malloc(9) -> kmem(9)
 1.8 10-Nov-2019  chs branches: 1.8.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.7 30-Aug-2019  riastradh Don't dereference pointer when we're about to panic because it's null.

Reported by Dr Silvio Cesare of InfoSect.
 1.6 27-Oct-2012  chs branches: 1.6.38;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.5 25-Nov-2009  rmind branches: 1.5.12; 1.5.22;
Remove IPL_LPT and IPL_IPI aliases, use the actual IPLs.
Fix some broken comments.
 1.4 06-Dec-2008  cliff branches: 1.4.4; 1.4.6; 1.4.10;
add gemini pseudo-nic and support code.
 1.3 26-Nov-2008  matt gpn, not gnp.
 1.2 26-Nov-2008  matt Add children of geminiipi
 1.1 20-Nov-2008  cliff add driver for low level inter-processor-interrupt
provides functions for establish/disestablish IPI ISR,
and function to signal IPI to the other CPU.
 1.4.10.3 11-Mar-2010  yamt sync with head
 1.4.10.2 04-May-2009  yamt sync with head.
 1.4.10.1 06-Dec-2008  yamt file gemini_ipi.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.4.6.2 19-Jan-2009  skrll Sync with HEAD.
 1.4.6.1 06-Dec-2008  skrll file gemini_ipi.c was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.4.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.4.4.1 06-Dec-2008  mjf file gemini_ipi.c was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.5.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.12.1 30-Oct-2012  yamt sync with head
 1.6.38.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.8.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.9.2.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.10.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 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.1 20-Nov-2008  cliff branches: 1.1.4; 1.1.6; 1.1.10; 1.1.22; 1.1.32;
add driver for low level inter-processor-interrupt
provides functions for establish/disestablish IPI ISR,
and function to signal IPI to the other CPU.
 1.1.32.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.22.1 30-Oct-2012  yamt sync with head
 1.1.10.2 04-May-2009  yamt sync with head.
 1.1.10.1 20-Nov-2008  yamt file gemini_ipivar.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.1.6.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.6.1 20-Nov-2008  skrll file gemini_ipivar.h was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.1.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.4.1 20-Nov-2008  mjf file gemini_ipivar.h was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.7 26-May-2023  andvar include arm/arm32/pte.h to gemini_ipm.c to fix GEMINI_MASTER/SLAVE config builds.
They fail with 'L1_S_SIZE' undeclared error otherwise from gemini.h declarations.
gemini_machdep.c includes it transitively, thus doesn't faili on GEMINI config.
Likely nobody is using them anyway though...
 1.6 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.5 09-Aug-2021  andvar fix various typos in comments and messages.
 1.4 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.3 24-Apr-2021  thorpej branches: 1.3.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.2 27-Oct-2012  chs branches: 1.2.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.1 06-Dec-2008  cliff branches: 1.1.4; 1.1.6; 1.1.10; 1.1.22; 1.1.32;
add gemini pseudo-nic and support code.
 1.1.32.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.22.1 30-Oct-2012  yamt sync with head
 1.1.10.2 04-May-2009  yamt sync with head.
 1.1.10.1 06-Dec-2008  yamt file gemini_ipm.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.1.6.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.6.1 06-Dec-2008  skrll file gemini_ipm.c was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.1.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.4.1 06-Dec-2008  mjf file gemini_ipm.c was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.2.52.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.3.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.2 18-Oct-2014  snj src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.1 06-Dec-2008  cliff branches: 1.1.4; 1.1.6; 1.1.10; 1.1.32;
add gemini pseudo-nic and support code.
 1.1.32.1 03-Dec-2017  jdolecek update from HEAD
 1.1.10.2 04-May-2009  yamt sync with head.
 1.1.10.1 06-Dec-2008  yamt file gemini_ipm.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.1.6.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.6.1 06-Dec-2008  skrll file gemini_ipm.h was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.1.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.4.1 06-Dec-2008  mjf file gemini_ipm.h was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.2 10-Feb-2024  andvar s/indicies/indices/ in comments.
 1.1 06-Dec-2008  cliff branches: 1.1.4; 1.1.6; 1.1.10;
add gemini pseudo-nic and support code.
 1.1.10.2 04-May-2009  yamt sync with head.
 1.1.10.1 06-Dec-2008  yamt file gemini_ipmvar.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.1.6.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.6.1 06-Dec-2008  skrll file gemini_ipmvar.h was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.1.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.4.1 06-Dec-2008  mjf file gemini_ipmvar.h was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.6 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.5 24-Apr-2021  thorpej branches: 1.5.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.4 27-Oct-2012  chs branches: 1.4.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.3 15-Nov-2008  cliff branches: 1.3.4; 1.3.6; 1.3.10; 1.3.22; 1.3.32;
further abstraction of LPC bus
 1.2 10-Nov-2008  cliff gemini_lpc_bus_ops is needed for consinit(), so remove 'static'
 1.1 09-Nov-2008  cliff preliminary support for com type UART in IT8712 superio chip
attached at LPC bus at Gemini LPC Host Controller at obio on Gemini.
 1.3.32.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3.22.1 30-Oct-2012  yamt sync with head
 1.3.10.2 04-May-2009  yamt sync with head.
 1.3.10.1 15-Nov-2008  yamt file gemini_lpc.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.3.6.2 19-Jan-2009  skrll Sync with HEAD.
 1.3.6.1 15-Nov-2008  skrll file gemini_lpc.c was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.3.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.4.1 15-Nov-2008  mjf file gemini_lpc.c was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.4.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.4.52.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.4.52.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.4.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.4.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.5.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.5 20-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.4 10-Nov-2019  chs branches: 1.4.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.3 08-Jan-2019  jdolecek no need to include <machine/param.h> if <sys/param.h> already included
 1.2 01-Jul-2011  dyoung branches: 1.2.52; 1.2.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.1 09-Nov-2008  cliff branches: 1.1.4; 1.1.6; 1.1.10;
preliminary support for com type UART in IT8712 superio chip
attached at LPC bus at Gemini LPC Host Controller at obio on Gemini.
 1.1.10.2 04-May-2009  yamt sync with head.
 1.1.10.1 09-Nov-2008  yamt file gemini_lpchc.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.1.6.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.6.1 09-Nov-2008  skrll file gemini_lpchc.c was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.1.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.4.1 09-Nov-2008  mjf file gemini_lpchc.c was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.2.54.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2.54.1 10-Jun-2019  christos Sync with HEAD
 1.2.52.1 18-Jan-2019  pgoyette Synch with HEAD
 1.4.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.4 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.3 20-Nov-2008  cliff branches: 1.3.4; 1.3.6; 1.3.10;
use CFATTACH_DECL_NEW, make device in softc type device_t, etc.
 1.2 15-Nov-2008  cliff further abstraction of LPC bus
 1.1 09-Nov-2008  cliff preliminary support for com type UART in IT8712 superio chip
attached at LPC bus at Gemini LPC Host Controller at obio on Gemini.
 1.3.10.2 04-May-2009  yamt sync with head.
 1.3.10.1 20-Nov-2008  yamt file gemini_lpchcvar.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.3.6.2 19-Jan-2009  skrll Sync with HEAD.
 1.3.6.1 20-Nov-2008  skrll file gemini_lpchcvar.h was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.3.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.4.1 20-Nov-2008  mjf file gemini_lpchcvar.h was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 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 15-Nov-2008  cliff branches: 1.2.4; 1.2.6; 1.2.10;
further abstraction of LPC bus
 1.1 09-Nov-2008  cliff preliminary support for com type UART in IT8712 superio chip
attached at LPC bus at Gemini LPC Host Controller at obio on Gemini.
 1.2.10.2 04-May-2009  yamt sync with head.
 1.2.10.1 15-Nov-2008  yamt file gemini_lpcvar.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.2.6.2 19-Jan-2009  skrll Sync with HEAD.
 1.2.6.1 15-Nov-2008  skrll file gemini_lpcvar.h was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.2.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.4.1 15-Nov-2008  mjf file gemini_lpcvar.h was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.3.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3.2.1 30-Oct-2012  yamt sync with head
 1.12 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.11 24-Apr-2021  thorpej branches: 1.11.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.10 01-Jul-2011  dyoung branches: 1.10.68;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.9 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.8 05-Jan-2010  mbalmer branches: 1.8.4; 1.8.6;
One semicolon is enough.
 1.7 20-Nov-2008  cliff branches: 1.7.4; 1.7.8;
use CFATTACH_DECL_NEW, make device in softc type device_t, etc.
 1.6 13-Nov-2008  cliff add option GEMINI_BUSBASE to define kernel offset between
kernel physical addr and (DMA master) bus addr
 1.5 13-Nov-2008  cliff on the Slave CPU where memory is remaped, use 'struct arm32_dma_range'
to manage kernel physical address unequal to DMA master bus address.

when Slave CPU configures PCI bus, program PCI memory window
to allow only bus addresses into memory owned by the Slave CPU.

Note: this code assumes that the CPU performing
PCI bus configuration has exclusive use of that bus.
 1.4 11-Nov-2008  cliff - add option GEMINI_SINGLE for single-core system model
- add "re" interface to GEMINI configuration
 1.3 10-Nov-2008  cliff in critical_devs[], master cpu gets com0;
slave cpu gets geminilpchc0 (and children)
 1.2 09-Nov-2008  cliff - use #if NPCI > 0 arond pci stuff so we can compile when pci is not configured
- in critical_devs[], divide up timers attachment between master and slave CPUs
and provide icu#1 attachment for slave cpu
 1.1 24-Oct-2008  matt branches: 1.1.2;
Add support for Cortina Systems SL3516 eval board.
 1.1.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.7.8.3 11-Mar-2010  yamt sync with head
 1.7.8.2 04-May-2009  yamt sync with head.
 1.7.8.1 20-Nov-2008  yamt file gemini_obio.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.7.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.7.4.1 20-Nov-2008  mjf file gemini_obio.c was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.8.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.4.1 31-May-2011  rmind sync with head
 1.10.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.10.68.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.10.68.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.10.68.2 02-Apr-2021  thorpej config_found_ia() -> config_found() w/ CFARG_IATTR.
 1.10.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.11.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.3 20-Nov-2008  cliff branches: 1.3.4; 1.3.8;
use CFATTACH_DECL_NEW, make device in softc type device_t, etc.
 1.2 13-Nov-2008  cliff on the Slave CPU where memory is remaped, use 'struct arm32_dma_range'
to manage kernel physical address unequal to DMA master bus address.

when Slave CPU configures PCI bus, program PCI memory window
to allow only bus addresses into memory owned by the Slave CPU.

Note: this code assumes that the CPU performing
PCI bus configuration has exclusive use of that bus.
 1.1 24-Oct-2008  matt branches: 1.1.2;
Add support for Cortina Systems SL3516 eval board.
 1.1.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.3.8.2 04-May-2009  yamt sync with head.
 1.3.8.1 20-Nov-2008  yamt file gemini_obiovar.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.3.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.4.1 20-Nov-2008  mjf file gemini_obiovar.h was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.23 20-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.22 07-Jul-2020  thorpej branches: 1.22.2;
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.21 14-Jun-2020  chs replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.20 10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.19 16-Nov-2018  jmcneill Add intr_establish_xname support to arm and expose it to intrctl
 1.18 02-Oct-2015  msaitoh branches: 1.18.16; 1.18.18;
PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific
 1.17 30-Mar-2014  christos branches: 1.17.6;
wrap a few lines
 1.16 29-Mar-2014  christos make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.15 18-Aug-2013  matt <arm/locore.h> fallout (fixes some include ordering errors)
 1.14 27-Oct-2012  chs branches: 1.14.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.13 07-Sep-2012  matt branches: 1.13.2;
Fix more pci_conf_interrupt/pci_conf_hook problems
 1.12 06-Sep-2012  matt Change pci_conf_hook to pass pc->conf_v
Add pci_conf_interrupt
 1.11 27-Jan-2012  para converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.10 01-Jul-2011  dyoung branches: 1.10.2; 1.10.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.9 04-Apr-2011  dyoung Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

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

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

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

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

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

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

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

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

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

### evbmips-el GDIUM

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

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

### ia64 GENERIC

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

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
 1.8 05-Jan-2010  mbalmer branches: 1.8.4; 1.8.6;
One semicolon is enough.
 1.7 04-Dec-2008  cliff branches: 1.7.4; 1.7.8;
remove old debug stuff, including Debugger() call that was not #ifdef DDB
 1.6 20-Nov-2008  cliff use CFATTACH_DECL_NEW, make device in softc type device_t, etc.
 1.5 13-Nov-2008  cliff add option GEMINI_BUSBASE to define kernel offset between
kernel physical addr and (DMA master) bus addr
 1.4 13-Nov-2008  cliff on the Slave CPU where memory is remaped, use 'struct arm32_dma_range'
to manage kernel physical address unequal to DMA master bus address.

when Slave CPU configures PCI bus, program PCI memory window
to allow only bus addresses into memory owned by the Slave CPU.

Note: this code assumes that the CPU performing
PCI bus configuration has exclusive use of that bus.
 1.3 28-Oct-2008  cliff set up PCI memory size based on MEMSIZE (actual memory size)
instead of GEMINI_DRAM_SIZE (size of DRAM physical address space).
 1.2 24-Oct-2008  cliff branches: 1.2.2;
fix comment regarding IO extent.
 1.1 24-Oct-2008  matt Add support for Cortina Systems SL3516 eval board.
 1.2.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.7.8.3 11-Mar-2010  yamt sync with head
 1.7.8.2 04-May-2009  yamt sync with head.
 1.7.8.1 04-Dec-2008  yamt file gemini_pci.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.7.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.7.4.1 04-Dec-2008  mjf file gemini_pci.c was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.8.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.4.1 21-Apr-2011  rmind sync with head
 1.10.6.1 18-Feb-2012  mrg merge to -current.
 1.10.2.3 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10.2.2 30-Oct-2012  yamt sync with head
 1.10.2.1 17-Apr-2012  yamt sync with head
 1.13.2.3 03-Dec-2017  jdolecek update from HEAD
 1.13.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.14.2.2 18-May-2014  rmind sync with head
 1.14.2.1 28-Aug-2013  rmind sync with head
 1.17.6.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.18.18.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.18.18.1 10-Jun-2019  christos Sync with HEAD
 1.18.16.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.22.2.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.1 24-Oct-2008  matt branches: 1.1.8; 1.1.14;
Add support for Cortina Systems SL3516 eval board.
 1.1.14.2 04-May-2009  yamt sync with head.
 1.1.14.1 24-Oct-2008  yamt file gemini_pcivar.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.1.8.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.8.1 24-Oct-2008  mjf file gemini_pcivar.h was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.10 19-Nov-2024  andvar fix couple of typos in comments.
 1.9 22-Nov-2009  mbalmer branches: 1.9.100;
more s/the the/the/
 1.8 15-Dec-2008  matt branches: 1.8.2; 1.8.6;
Get the gmac driver close to working.
 1.7 14-Dec-2008  matt Add the beginning of a driver which supports the on-chip gmac (gigabit)
ethernet port. It's still being debugged but it attaches and does some
things right. And a lot wrong. That's what debugging is for.
 1.6 20-Nov-2008  cliff add GPIO driver for Gemini
 1.5 20-Nov-2008  cliff add memory remap and inter-processor-interrupt register defines
 1.4 09-Nov-2008  cliff - GEMINI_LPCP_BASE is renamed GEMINI_LPCIO_BASE
- add some minimal Gemini GLOBAL reg defines
- add Gemini LPC Host Controller reg defines
- add Gemini MIDE Controller reg defines
 1.3 01-Nov-2008  cliff in initarm(), remove some bringup debug stuff, and clean up
progress markers; they are still useful for now.
in cpu_reboot() use Gemini Global Reset Control register to reboot system
geminiwdt_reboot() is no longer needed, removed.
 1.2 28-Oct-2008  cliff GEMINI_DRAM_BASE moved to 0x00000000, a remapped physical address
 1.1 24-Oct-2008  matt branches: 1.1.2;
Add support for Cortina Systems SL3516 eval board.
 1.1.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.6.3 11-Mar-2010  yamt sync with head
 1.8.6.2 04-May-2009  yamt sync with head.
 1.8.6.1 15-Dec-2008  yamt file gemini_reg.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.8.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.8.2.1 15-Dec-2008  mjf file gemini_reg.h was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.9.100.1 02-Aug-2025  perseant Sync with HEAD
 1.6 21-Apr-2023  skrll Trailing whitespace
 1.5 16-Mar-2018  ryo use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
 1.4 22-Feb-2014  matt branches: 1.4.28;
Don't manipulate the pte to get uncached memory, use PMAP_NOCACHE instead.
Convert footbring to kenter_pa/kremove
 1.3 01-Jul-2011  dyoung branches: 1.3.2; 1.3.12; 1.3.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.2 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.1 24-Oct-2008  matt branches: 1.1.8; 1.1.14;
Add support for Cortina Systems SL3516 eval board.
 1.1.14.3 11-Mar-2010  yamt sync with head
 1.1.14.2 04-May-2009  yamt sync with head.
 1.1.14.1 24-Oct-2008  yamt file gemini_space.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.1.8.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.8.1 24-Oct-2008  mjf file gemini_space.c was added on branch mjf-devfs2 on 2009-01-17 13:27:52 +0000
 1.3.16.1 18-May-2014  rmind sync with head
 1.3.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.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.4.28.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.7 18-Mar-2014  martin Bracket timer_init() with disable_interrupts()/restore_interrupts()
properly. Pointed out by Chris Gilbert.
 1.6 09-Mar-2014  martin Remove an unused variable and fix a copy&pasto (I think)
 1.5 01-Jul-2011  dyoung branches: 1.5.2; 1.5.12; 1.5.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.4 05-Jan-2010  mbalmer One semicolon is enough.
 1.3 18-Mar-2009  cegger branches: 1.3.2;
Ansify function definitions w/o arguments. Generated with sed.
 1.2 09-Nov-2008  cliff branches: 1.2.4; 1.2.6;
- we are combining stat and system clocks to use the same timer
the master and slave CPU each get one timer for those functions;
both CPUs can use the free-running ref timer;
it is initialized by CPU#0 and after that all access is read-only
- use correct OBIO_*_DEFAULT locator indicies
 1.1 24-Oct-2008  matt branches: 1.1.2;
Add support for Cortina Systems SL3516 eval board.
 1.1.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.1.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.2.6.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.4.1 09-Nov-2008  mjf file gemini_timer.c was added on branch mjf-devfs2 on 2009-01-17 13:27:53 +0000
 1.3.2.3 11-Mar-2010  yamt sync with head
 1.3.2.2 04-May-2009  yamt sync with head.
 1.3.2.1 18-Mar-2009  yamt file gemini_timer.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.5.16.1 18-May-2014  rmind sync with head
 1.5.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.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.3 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.2 09-Nov-2008  cliff branches: 1.2.4; 1.2.8; 1.2.20; 1.2.30;
- we are combining stat and system clocks, so STATHZ is now HZ
 1.1 24-Oct-2008  matt branches: 1.1.2;
Add support for Cortina Systems SL3516 eval board.
 1.1.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.2.30.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.20.1 30-Oct-2012  yamt sync with head
 1.2.8.2 04-May-2009  yamt sync with head.
 1.2.8.1 09-Nov-2008  yamt file gemini_timervar.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.2.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.4.1 09-Nov-2008  mjf file gemini_timervar.h was added on branch mjf-devfs2 on 2009-01-17 13:27:53 +0000
 1.2 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.1 24-Oct-2008  matt branches: 1.1.8; 1.1.14;
Add support for Cortina Systems SL3516 eval board.
 1.1.14.2 04-May-2009  yamt sync with head.
 1.1.14.1 24-Oct-2008  yamt file gemini_var.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.1.8.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.8.1 24-Oct-2008  mjf file gemini_var.h was added on branch mjf-devfs2 on 2009-01-17 13:27:53 +0000
 1.4 08-Jan-2019  jdolecek no need to include <machine/param.h> if <sys/param.h> already included
 1.3 01-Jul-2011  dyoung branches: 1.3.52; 1.3.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.2 01-Nov-2008  cliff branches: 1.2.4; 1.2.8;
in initarm(), remove some bringup debug stuff, and clean up
progress markers; they are still useful for now.
in cpu_reboot() use Gemini Global Reset Control register to reboot system
geminiwdt_reboot() is no longer needed, removed.
 1.1 24-Oct-2008  matt branches: 1.1.2;
Add support for Cortina Systems SL3516 eval board.
 1.1.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.2.8.2 04-May-2009  yamt sync with head.
 1.2.8.1 01-Nov-2008  yamt file gemini_wdt.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.2.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.4.1 01-Nov-2008  mjf file gemini_wdt.c was added on branch mjf-devfs2 on 2009-01-17 13:27:53 +0000
 1.3.54.1 10-Jun-2019  christos Sync with HEAD
 1.3.52.1 18-Jan-2019  pgoyette Synch with HEAD
 1.4 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.3 20-Nov-2008  cliff branches: 1.3.4; 1.3.8;
use CFATTACH_DECL_NEW, make device in softc type device_t, etc.
 1.2 01-Nov-2008  cliff in initarm(), remove some bringup debug stuff, and clean up
progress markers; they are still useful for now.
in cpu_reboot() use Gemini Global Reset Control register to reboot system
geminiwdt_reboot() is no longer needed, removed.
 1.1 24-Oct-2008  matt branches: 1.1.2;
Add support for Cortina Systems SL3516 eval board.
 1.1.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.3.8.2 04-May-2009  yamt sync with head.
 1.3.8.1 20-Nov-2008  yamt file gemini_wdtvar.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.3.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.4.1 20-Nov-2008  mjf file gemini_wdtvar.h was added on branch mjf-devfs2 on 2009-01-17 13:27:53 +0000
 1.15 17-Sep-2022  thorpej Eliminate use of IFF_OACTIVE. (In this driver, it was set in one
location, and never tested or cleared. &shrug;)
 1.14 20-Aug-2022  thorpej gmc_ifstart(): Replace "IF_DEQUEUE() -> IF_PREPEND() on failure" with
"IF_POLL() -> IF_DEQUEUE() on success".
 1.13 01-Feb-2020  thorpej Adopt <net/if_stats.h>.
 1.12 28-May-2019  msaitoh branches: 1.12.4;
s/recieve/receive/
 1.11 28-May-2019  msaitoh Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.10 23-May-2019  msaitoh Whitespace fix (mainly tabify).
 1.9 23-May-2019  msaitoh No functional change:
- Simplify MII structure initialization and reference.
- u_int*_t -> uint*_t.
- KNF
 1.8 22-Apr-2019  msaitoh On drivers which use MII(4) and have hook SIOC[GS]IFMEDIA which just pass to
ifmedia_ioctl(), the hook is not required because ether_ioctl has it
(if_ethersubr.c rev. 1.160). These drivers don't return ENETRESET in
ifmedia_ioctl(), so no functional change.
 1.7 20-Feb-2017  ozaki-r branches: 1.7.14;
Apply deferred if_start to more drivers...
 1.6 11-Jun-2013  msaitoh branches: 1.6.10; 1.6.14; 1.6.18;
In interrupt function, use mii_pollstat() instead of mii_tick() to update
PHY status.
 1.5 22-Jul-2012  matt branches: 1.5.2;
Fix mii_statchg to take a 'struct ifnet *' instead of device_t. This fixes
problem with a common MDIO bus used for multiple interfaces.
Some drivers converted to CFATTACL_DECL_NEW.
 1.4 01-Jul-2011  dyoung branches: 1.4.2;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.3 23-Dec-2008  matt branches: 1.3.2; 1.3.4; 1.3.8;
Baby steps to a working driver. transmit works. receive sometimes works
but the h/w is doing really weird shit.
 1.2 15-Dec-2008  matt Get the gmac driver close to working.
 1.1 14-Dec-2008  matt Add the beginning of a driver which supports the on-chip gmac (gigabit)
ethernet port. It's still being debugged but it attaches and does some
things right. And a lot wrong. That's what debugging is for.
 1.3.8.2 04-May-2009  yamt sync with head.
 1.3.8.1 23-Dec-2008  yamt file if_gmc.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.3.4.2 19-Jan-2009  skrll Sync with HEAD.
 1.3.4.1 23-Dec-2008  skrll file if_gmc.c was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.3.2.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.2.1 23-Dec-2008  mjf file if_gmc.c was added on branch mjf-devfs2 on 2009-01-17 13:27:53 +0000
 1.4.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.4.2.1 30-Oct-2012  yamt sync with head
 1.5.2.2 03-Dec-2017  jdolecek update from HEAD
 1.5.2.1 23-Jun-2013  tls resync from head
 1.6.18.1 21-Apr-2017  bouyer Sync with HEAD
 1.6.14.1 20-Mar-2017  pgoyette Sync with HEAD
 1.6.10.1 28-Aug-2017  skrll Sync with HEAD
 1.7.14.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.7.14.1 10-Jun-2019  christos Sync with HEAD
 1.12.4.1 29-Feb-2020  ad Sync with head.
 1.18 29-Jun-2024  riastradh if_stats(9): Add ifp argument to if_stat..._ref.

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

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

PR kern/58377
 1.17 26-May-2023  andvar Fix potential null dereference by simply adding last_gd != NULL check
around the code block with last_gd usage after the inner loop.
It may mainly happen on bus_dmamap_load error.
Reported by Mootja _14, 2017.
 1.16 17-Sep-2022  thorpej Eliminate use of IFF_OACTIVE.
 1.15 20-Aug-2022  thorpej gpn_ifstart(): Replace "IF_DEQUEUE() -> IF_PREPEND() on failure" with
"IF_POLL() -> IF_DEQUEUE() on success".
 1.14 01-Feb-2020  thorpej Adopt <net/if_stats.h>.
 1.13 30-Oct-2019  msaitoh branches: 1.13.2;
ether_input() automatically add input bytes to if_ibytes, so it's not
required to do in the driver who use ether_input().
 1.12 29-May-2019  msaitoh branches: 1.12.2;
Even if we don't use MII(4), use the common path of SIOC[GS]IFMEDIA in
sys/net/if_ethersubr.c if we can.
- Add ec_ifmedia into struct ethercom.
- ec_mii in struct ethercom is kept and used as it is. It might be used in
future. Note that some Ethernet drivers which _DOESN'T_ use mii(4) use
ec_mii for keeping the if_media. Those should be changed in future.
 1.11 29-May-2019  msaitoh KNF. No functional change.
 1.10 26-Apr-2019  msaitoh No functional change:
- u_int_{8,16,32}_t -> uint_{8,16,32}_t
- KNF.
- Tabify.
- Remove extra space.
 1.9 26-Jun-2018  msaitoh branches: 1.9.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.8 25-Jun-2017  maxv branches: 1.8.4;
NULL deref, found by Mootja; not sure how to fix it, so just add a big XXX
 1.7 15-Dec-2016  ozaki-r branches: 1.7.8;
Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

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

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

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

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

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

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

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

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

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.4 01-Jul-2011  dyoung branches: 1.4.12; 1.4.30;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.3 05-Apr-2010  joerg Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.
 1.2 19-Jan-2010  pooka branches: 1.2.2; 1.2.4;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

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

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.1 06-Dec-2008  cliff branches: 1.1.4; 1.1.6; 1.1.10;
add gemini pseudo-nic and support code.
 1.1.10.4 11-Aug-2010  yamt sync with head.
 1.1.10.3 11-Mar-2010  yamt sync with head
 1.1.10.2 04-May-2009  yamt sync with head.
 1.1.10.1 06-Dec-2008  yamt file if_gpn.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.1.6.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.6.1 06-Dec-2008  skrll file if_gpn.c was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.1.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.4.1 06-Dec-2008  mjf file if_gpn.c was added on branch mjf-devfs2 on 2009-01-17 13:27:53 +0000
 1.2.4.1 30-May-2010  rmind sync with head
 1.2.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.4.30.4 28-Aug-2017  skrll Sync with HEAD
 1.4.30.3 05-Feb-2017  skrll Sync with HEAD
 1.4.30.2 09-Jul-2016  skrll Sync with HEAD
 1.4.30.1 19-Mar-2016  skrll Sync with HEAD
 1.4.12.1 03-Dec-2017  jdolecek update from HEAD
 1.6.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.7.8.1 06-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1427):

sys/arch/arm/broadcom/bcm53xx_eth.c: revision 1.39
sys/dev/pcmcia/if_xi.c: revision 1.91
sys/dev/ic/aic6915.c: revision 1.40
sys/dev/pci/if_tl.c: revision 1.117
sys/arch/arm/gemini/gemini_gmac.c: revision 1.18
sys/dev/ic/elinkxl.c: revision 1.133
sys/dev/pci/if_ste.c: revision 1.57
sys/dev/pci/if_alc.c: revision 1.43
sys/dev/pci/if_stge.c: revision 1.72
sys/dev/pci/if_ale.c: revision 1.34
sys/dev/pci/if_age.c: revision 1.62
sys/dev/pci/if_txp.c: revision 1.60
sys/dev/ic/i82557.c: revision 1.156
sys/dev/pci/if_vte.c: revision 1.27
sys/arch/powerpc/booke/dev/pq3etsec.c: revision 1.47
sys/arch/arm/gemini/if_gpn.c: revision 1.13

if_percpuq(9) and ether_input() automatically increment if_ipackets, so don't add number of
RX frames from device's statistics counter to if_ipackets to avoid double
count.
 1.8.4.1 28-Jul-2018  pgoyette Sync with HEAD
 1.9.2.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.9.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.9.2.1 10-Jun-2019  christos Sync with HEAD
 1.12.2.1 06-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #403):

sys/arch/arm/broadcom/bcm53xx_eth.c: revision 1.39
sys/dev/pcmcia/if_xi.c: revision 1.91
sys/dev/ic/aic6915.c: revision 1.40
sys/dev/pci/if_tl.c: revision 1.117
sys/arch/arm/gemini/gemini_gmac.c: revision 1.18
sys/dev/ic/elinkxl.c: revision 1.133
sys/dev/pci/if_ste.c: revision 1.57
sys/dev/pci/if_alc.c: revision 1.43
sys/dev/pci/if_stge.c: revision 1.72
sys/dev/pci/if_ale.c: revision 1.34
sys/dev/pci/if_age.c: revision 1.62
sys/dev/pci/if_txp.c: revision 1.60
sys/dev/ic/i82557.c: revision 1.156
sys/dev/pci/if_vte.c: revision 1.27
sys/arch/powerpc/booke/dev/pq3etsec.c: revision 1.47
sys/arch/arm/gemini/if_gpn.c: revision 1.13

if_percpuq(9) and ether_input() automatically increment if_ipackets, so don't add number of
RX frames from device's statistics counter to if_ipackets to avoid double
count.
 1.13.2.1 29-Feb-2020  ad Sync with head.
 1.5 08-Dec-2018  thorpej Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.4 01-Jul-2011  dyoung branches: 1.4.52; 1.4.54;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.3 15-Nov-2008  cliff branches: 1.3.4; 1.3.6; 1.3.10;
further abstraction of LPC bus
 1.2 10-Nov-2008  cliff reduce callout polling period to (hz/16)
once we get serial irq from 8712 uart working
this should become a non-issue
 1.1 09-Nov-2008  cliff preliminary support for com type UART in IT8712 superio chip
attached at LPC bus at Gemini LPC Host Controller at obio on Gemini.
 1.3.10.2 04-May-2009  yamt sync with head.
 1.3.10.1 15-Nov-2008  yamt file lpc_com.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.3.6.2 19-Jan-2009  skrll Sync with HEAD.
 1.3.6.1 15-Nov-2008  skrll file lpc_com.c was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.3.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.4.1 15-Nov-2008  mjf file lpc_com.c was added on branch mjf-devfs2 on 2009-01-17 13:27:53 +0000
 1.4.54.1 10-Jun-2019  christos Sync with HEAD
 1.4.52.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.1 09-Nov-2008  cliff branches: 1.1.4; 1.1.6; 1.1.10;
preliminary support for com type UART in IT8712 superio chip
attached at LPC bus at Gemini LPC Host Controller at obio on Gemini.
 1.1.10.2 04-May-2009  yamt sync with head.
 1.1.10.1 09-Nov-2008  yamt file lpc_com.h was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.1.6.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.6.1 09-Nov-2008  skrll file lpc_com.h was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.1.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.4.1 09-Nov-2008  mjf file lpc_com.h was added on branch mjf-devfs2 on 2009-01-17 13:27:53 +0000
 1.7 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.6 24-Apr-2021  thorpej branches: 1.6.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.5 09-Apr-2018  jakllsch branches: 1.5.16;
Stop potential misuse of vendor names and USB vendor IDs in root hub
device and string descriptors.

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

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

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

- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
 1.3 20-Jul-2012  matt branches: 1.3.2; 1.3.14; 1.3.16; 1.3.20;
EHCI_USBINTR is 4 bytes long so use EOWRITE4
 1.2 24-Oct-2008  matt branches: 1.2.8; 1.2.14; 1.2.32;
Forgot to do the aprint_normal();
 1.1 24-Oct-2008  matt Add EHCI attachment for GEMINI port.
 1.2.32.1 30-Oct-2012  yamt sync with head
 1.2.14.2 04-May-2009  yamt sync with head.
 1.2.14.1 24-Oct-2008  yamt file obio_ehci.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:41 +0000
 1.2.8.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.8.1 24-Oct-2008  mjf file obio_ehci.c was added on branch mjf-devfs2 on 2009-01-17 13:27:53 +0000
 1.3.20.1 06-Sep-2016  skrll First pass at netbsd-7 updated with USB code from HEAD
 1.3.16.2 05-Dec-2014  skrll Use int for return type for [eou]chi_init and motg_init.
 1.3.16.1 03-Dec-2014  skrll The grand renaming of structure members.

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

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.5 08-Jan-2019  jdolecek branches: 1.5.14;
no need to include <machine/param.h> if <sys/param.h> already included
 1.4 27-Oct-2012  chs branches: 1.4.36; 1.4.38;
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 20-Nov-2008  cliff branches: 1.2.4; 1.2.6; 1.2.10;
use CFATTACH_DECL_NEW, make device in softc type device_t, etc.
 1.1 09-Nov-2008  cliff preliminary support for com type UART in IT8712 superio chip
attached at LPC bus at Gemini LPC Host Controller at obio on Gemini.
 1.2.10.2 04-May-2009  yamt sync with head.
 1.2.10.1 20-Nov-2008  yamt file obio_lpchc.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:42 +0000
 1.2.6.2 19-Jan-2009  skrll Sync with HEAD.
 1.2.6.1 20-Nov-2008  skrll file obio_lpchc.c was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.2.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.4.1 20-Nov-2008  mjf file obio_lpchc.c was added on branch mjf-devfs2 on 2009-01-17 13:27:53 +0000
 1.3.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3.2.1 30-Oct-2012  yamt sync with head
 1.4.38.1 10-Jun-2019  christos Sync with HEAD
 1.4.36.1 18-Jan-2019  pgoyette Synch with HEAD
 1.5.14.1 02-Apr-2021  thorpej config_found_ia() -> config_found() w/ CFARG_IATTR.
 1.6.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.5 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.4 04-Dec-2008  cliff branches: 1.4.4; 1.4.8;
avoid initializing controller stuff twice by supressing SLAVE from doing so
 1.3 11-Nov-2008  cliff - add option GEMINI_SINGLE for single-core system model
- add "re" interface to GEMINI configuration
 1.2 09-Nov-2008  cliff - we are combining stat and system clocks to use the same timer
the master and slave CPU each get one timer for those functions;
both CPUs can use the free-running ref timer;
it is initialized by CPU#0 and after that all access is read-only
- use correct OBIO_*_DEFAULT locator indicies
 1.1 24-Oct-2008  matt branches: 1.1.2;
Add support for Cortina Systems SL3516 eval board.
 1.1.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.4.8.2 04-May-2009  yamt sync with head.
 1.4.8.1 04-Dec-2008  yamt file obio_timer.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:42 +0000
 1.4.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.4.4.1 04-Dec-2008  mjf file obio_timer.c was added on branch mjf-devfs2 on 2009-01-17 13:27:53 +0000
 1.12 27-Sep-2022  skrll Remove unnecessary sys/malloc.h include
 1.11 19-Sep-2021  andvar s/Plese/Please/ in comment, and fix an article in obio_wdc.c comment.
 1.10 19-Sep-2021  andvar fix various typos in comments, messages and documentation.
 1.9 03-Jun-2019  msaitoh Fix typo in comment (s/seperate/separate/).
 1.8 20-Oct-2017  jdolecek branches: 1.8.4;
move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606
 1.7 07-Oct-2017  jdolecek adapt the rest of wdc attachments for NCQ branch merge
 1.6 31-Jul-2012  bouyer branches: 1.6.2;
Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.
 1.5 26-Jul-2012  jakllsch Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@
 1.4 02-Jul-2012  bouyer Add sata Port MultiPlier (PMP) support to the ata bus layer,
as described in
http://mail-index.netbsd.org/tech-kern/2012/06/23/msg013442.html
PMP support in integrated to the atabus layer.
struct ata_channel's ch_drive[] is not dynamically allocated, and ch_ndrive
(renamed to ch_ndrives) closely reflects the size of the ch_drive[] array.
Add helper functions atabus_alloc_drives() and atabus_free_drives()
to manage ch_drive[]/ch_ndrives.
Add wdc_maxdrives to struct wdc_softc so that bus front-end can specify
how much drive they really support (master/slave or single).
ata_reset_drive() callback gains a uint32_t *sigp argument which,
when not NULL, will contain the signature of the device being reset.
While there, some cosmetic changes:
- added a drive_type enum to ata_drive_datas, and stop encoding the
probed drive type in drive_flags (we were out of drive flags anyway).
- rename DRIVE_ATAPIST to DRIVE_ATAPIDSCW to better reflect what this
really is
- remove ata_channel->ata_drives, it's redundant with the pointer in
ata_drive_datas
- factor out the interpretation of SATA signatures in sata_interpet_sig()

propagate these changes to the ATA HBA drivers, and add support for PMP
to ahcisata(4) and siisata(4).

Thanks to:
- Protocase (http://www.protocase.com/) which provided a system
with lots of controllers, SATA PMP and drive slots
- Conservation Genomics Laboratory, Department of Biology, New Mexico State
University for hosting the above system
- Brook Milligan, who set up remote access and has been very responsive
when SATA cable move was needed
 1.3 01-Jul-2011  dyoung branches: 1.3.2;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.2 17-Nov-2008  cliff branches: 1.2.4; 1.2.6; 1.2.10;
fix "adapted from" (iq31244) and remove iq31244-specific jumper comment
 1.1 09-Nov-2008  cliff autoconfig glue for wdc at obio on Gemini
 1.2.10.2 04-May-2009  yamt sync with head.
 1.2.10.1 17-Nov-2008  yamt file obio_wdc.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:42 +0000
 1.2.6.2 19-Jan-2009  skrll Sync with HEAD.
 1.2.6.1 17-Nov-2008  skrll file obio_wdc.c was added on branch nick-hppapmap on 2009-01-19 13:15:58 +0000
 1.2.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.4.1 17-Nov-2008  mjf file obio_wdc.c was added on branch mjf-devfs2 on 2009-01-17 13:27:53 +0000
 1.3.2.1 30-Oct-2012  yamt sync with head
 1.6.2.1 03-Dec-2017  jdolecek update from HEAD
 1.8.4.1 10-Jun-2019  christos Sync with HEAD
 1.8 08-Jan-2019  jdolecek no need to include <machine/param.h> if <sys/param.h> already included
 1.7 27-Oct-2012  chs branches: 1.7.36; 1.7.38;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.6 01-Jul-2011  dyoung branches: 1.6.2; 1.6.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.5 20-Nov-2008  cliff branches: 1.5.4; 1.5.8;
use CFATTACH_DECL_NEW, make device in softc type device_t, etc.
 1.4 08-Nov-2008  cliff use correct OBIOCF_*_DEFAULT locator values
 1.3 04-Nov-2008  cliff use device_private(self) instead of cast to get sc
 1.2 31-Oct-2008  cliff in geminiwdt_attach, put watchdog device in known (disabled) state,
then register this driver with sysmon_wdog_register.
rip out temp debug stuff from bringup.
 1.1 24-Oct-2008  matt branches: 1.1.2; 1.1.4;
Add support for Cortina Systems SL3516 eval board.
 1.1.4.1 01-Nov-2008  snj Pull up following revision(s) (requested by cliff in ticket #2):
sys/arch/arm/gemini/obio_wdt.c: revision 1.2
in geminiwdt_attach, put watchdog device in known (disabled) state,
then register this driver with sysmon_wdog_register.
rip out temp debug stuff from bringup.
 1.1.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.5.8.2 04-May-2009  yamt sync with head.
 1.5.8.1 20-Nov-2008  yamt file obio_wdt.c was added on branch yamt-nfs-mp on 2009-05-04 08:10:42 +0000
 1.5.4.2 17-Jan-2009  mjf Sync with HEAD.
 1.5.4.1 20-Nov-2008  mjf file obio_wdt.c was added on branch mjf-devfs2 on 2009-01-17 13:27:53 +0000
 1.6.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.6.2.1 30-Oct-2012  yamt sync with head
 1.7.38.1 10-Jun-2019  christos Sync with HEAD
 1.7.36.1 18-Jan-2019  pgoyette Synch with HEAD

RSS XML Feed