Home | History | Annotate | Download | only in pci
History log of /src/sys/arch/alpha/pci/pci_machdep.c
RevisionDateAuthorComments
 1.34  04-Oct-2025  thorpej Use device_{get,set}prop_bool() for "is_console".
 1.33  16-Sep-2021  andvar fix various typos, mainly in comments.
 1.32  04-Jul-2021  thorpej Reduce code duplication when setting up the interrupt handler data
structures:
- alpha_shared_intr_alloc() no longer takes a "string length" argument,
and just uses kmem_asprintf() to create an "irq %u" string by default.
This is suitable for nearly every caller.
- Add a alpha_shared_intr_set_string() that allows callers to override
the default IRQ description string.
- Related: make alpha_shared_intr_string() return a const char *, since
no callers should need to modify the string directly now.
- Re-factor PCI shared interrupt structure allocation / initialization
into a new alpha_pci_intr_alloc(), which is suitable for nearly every
Alpha PCI platform. Callers are expected to first have initialized
the interrupt hardware to the quiescent state.

Adjust various call sites of above functions to account for changes,
even if they are not able to use the newly re-factored code.
 1.31  25-Jun-2021  thorpej Tweak how the IRQ description strings are generated to enable additional
duplicated code re-factoring.
 1.30  25-Jun-2021  thorpej Make the following PCI chipset functions optional:
- attach_hook()
- bus_maxdevs()
- make_tag()
- decompose_tag()
...and provide a default implementation for each.
 1.29  19-Jun-2021  thorpej Don't use a bunch of switch() statements in the core logic drivers to select
the PCI interrupt initialization routine. Instead, register said routines
by systype in a link set, and look them up and invoke them in a new function
alpha_pci_intr_init().
 1.28  26-Sep-2020  thorpej branches: 1.28.6;
Implement cpu_intr_redistribute() for Tusnami/Titan systems.
 1.27  26-Sep-2020  thorpej Add support for CPU interrupt affinity for PCI interrupts:
- Keep a bitmap of eligible interrupt-handling CPUs in the pci_chipset_tag_t.
If this bitmap is 0, then we assume that all PCI interrupts should be
routed to the primary CPU.
- Add an optional PCI chipset callback for setting the CPU affinity of
an interrupt.
- When an establishing an interrupt handler, select the CPU that will
handle this irq using the following algorithm:
==> If the irq already has a CPU assignment, keep it.
==> Otherwise, find the CPU with the fewest registered handlers that
is eligible from both a hardware (based on the pci_chipset_tag_t)
and software (based on cpu_info::ci_schedstate.spc_flags) perspectives.
==> Fall back to the primary CPU failing all else.
 1.26  25-Sep-2020  thorpej Changes to make interrupt {,dis}establish MP-safe on Alpha:
- Protect all of the system interrupt linkage with the cpu_lock mutex.
- Re-order some of the stores to the SCB vector table to make it safe
in the face of lockless interrupt dispatch.
- Add a framework for routing interrupts to specific CPUs. Interrupts
are still funneled only to the primary CPU, but that will change for
some systems soon. Ensure that interrupt handler lists are manipulated
only on the CPUs that handle that specific interrupt source. This required
a re-factor of the alpha_shared_intr_*() family of functions.
- Enable __HAVE_INTR_CONTROL, although interrupt redistribution is still
a no-op.
- Reduce code duplication in the Jenson direct-SCB interrupt handlers.
 1.25  22-Sep-2020  thorpej Changes to make MPSAFE interrupts work on Alpha:

- Remove the ipl argument to scb_set() and the associated array of
"mpsafe" booleans initialized based on the ipl. It was bogus
anyway; all IPL_{BIO,NET,TTY}, etc. values are aliases of IPL_VM,
and for all practical purposes, there is really only one device
interrrupt level on Alpha anyway. Intead, we now treat all dispatches
from the SCB vector table as MP-safe, and it is now the handler for
that vector who is responsible for acquiring the KERNEL_LOCK if needed.

- Update the direct interrupt vector handlers in jensenio and TURBOchannel
to acquire the KERNEL_LOCK.

- Introduce a new ALPHA_INTR_MPSAFE flag, and add a flags argument to
alpha_shared_intr_establish(). When it is set, indicate that the
handler is MP-safe. Update alpha_shared_intr_dispatch() to pay
attention and acquire the KERNEL_LOCK (or not) as indicated.

- Re-factor all of the PCI interrupt handling, providing "generic PCI"
"PCI interrupts through ISA IRQs" implementations to significantly
reduce code duplication. Supplement the PCI chipset tag with more
info to facilitate this, and make the PCI interrupt-related routines
take a pci_chipset_tag_t argument rather than a void * argument.

- Because PCI interrupts on KN8AE are dispatched directly from the
SCB, provide a wrapper for non-MPSAFE interrupt handlers that
acquires the KERNEL_LOCK.

- Change the pci_intr_handle_t type to be a struct rather than an
integer type in order to catch any direct use of it as a value.
Add a set of functions to interact with pci_intr_handle_t, including
setting interrupt flags.

- Implement pci_intr_setattr() so that the PCI_INTR_MPSAFE attribute
can be set on a pci_intr_handle_t.

- While I'm here, make all of the MI PCI back-end operations call
through real functions rather than hopping directly through function
pointers in the chipset tag.

This change looks a lot bigger than it really is because of the re-factor
in the plethora of model-specific PCI interrupt back-ends. The KN8AE,
KN300, and T2/T3/T4 (Sable) are largely un-changed.
 1.24  09-Aug-2019  rin Fix build without vga at pci.
 1.23  17-Oct-2014  uebayasi branches: 1.23.20;
PCI controller doesn't rely on (depend on) AGP bus, but provide it. If one
specific architecture is known to have some specific AGP implementation, such
suggestion must be done in the "selection" part, not the "definition" part.

This is also an indirect (across bus attachment), circular dependency.
 1.22  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.21  21-Mar-2014  christos gc sprintf; reduce local static usage of interrupt strings that are only
used once for autoconf printing.
 1.20  20-Jan-2014  tsutsui Check and set "is_console" property to PCI displays for framebuffer drivers.

Tested on DS15 with radeonfb(4) and XP1000 with vga(4)
by Naruaki Etomi in PR/48431.
 1.19  06-Feb-2012  matt branches: 1.19.6; 1.19.10;
Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c
 1.18  15-Dec-2010  matt branches: 1.18.8; 1.18.12;
Remove unneeded includes of <uvm/uvm_extern.h>
 1.17  14-Mar-2009  dsl branches: 1.17.4;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.16  14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.15  16-Jul-2001  elric branches: 1.15.2; 1.15.128; 1.15.136; 1.15.142;
So, the PowerStorm 4d20 a.k.a. 32bit TGA2 w/ IBM RGB561 RAMDAC was causing
the kernel to panic since it is recognised as a TGA and the TGA driver
doesn't [yet] know what to do with it.

This patch fixes that by:
o making tgamatch() try to actually figure out what kind
of TGA card is there, rather than simply relying on the
vendor/product ids.
o creating a tga_cnmatch() so that the console code in
arch/alpha/pci/pci_machdep.c can cause the same to occur.
o breaking up some of tga_getdevconfig() into a few different
functions to re-use code that would have been duplicated.
o changed arch/alpha/pci/pci_machdep.c so that it calls out
to tga_cnmatch() if DEVICE_IS_TGA() matches before it decides
to attach the console as a TGA.

Addresses PR: port-alpha/12923
 1.14  29-Jun-2000  mrg branches: 1.14.4;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.13  28-May-1998  drochner branches: 1.13.14;
pull in new PC display headers
 1.12  15-Apr-1998  drochner Adapt PCI console selection to new mi drivers.
 1.11  02-Sep-1997  thorpej Nuke the idea of <machine/options.h>. It completely defeats the purpose
of fine-grain option dependencies.
 1.10  07-Apr-1997  cgd branches: 1.10.4;
by default, provide RCS IDs for NetBSD/alpha kernel files in kernel binaries.
This can be disabled (to save a bit of space) with the NO_KERNEL_RCSIDS
options, which is present but commented out in the ALPHA config file.
In ELF-format kernels, these strings are present in the kernel binary but
are not loaded into memory. (In ECOFF-format kernels, there's no easy way
to keep them from being loaded, so they _are_ loaded into memory.)
 1.9  07-Apr-1997  cgd clean up NetBSD RCS ID strings, include machine/options.h
 1.8  08-Mar-1997  cgd fix problem compiling if neither PCI VGA nor TGA frame buffers were
configured. Pointed out by Matt Jacob.
 1.7  19-Nov-1996  cgd branches: 1.7.2; 1.7.8;
update for VGA-related changes
 1.6  23-Oct-1996  cgd update for new bus.h macros. bus_io_* and bus_mem_* integrated into
single bus_space_* framework. Unfortunately, bus_space_{read,write}_*
operations still imply barriers. That will change soon.
 1.5  12-Apr-1996  cgd clean up copyrights and RCS IDs
 1.4  12-Apr-1996  cgd update for new PCI, etc., interfaces.
 1.3  23-Nov-1995  cgd wholesale update from my NetBSD/Alpha source tree. Includes:
Support for AXPpci CPUs,
Support for AlphaStation 600 CPUs,
new boot block structure, which requires an 'installboot'
program and works a lot like the NetBSD/sparc boot blocks.
 1.2  03-Aug-1995  cgd i/o map function dispatch, console picker function
 1.1  28-Jun-1995  cgd ISA and PCI support for DEC AlphaStations
 1.7.8.1  11-Mar-1997  is Merge in latest Trunk.
 1.7.2.2  01-Jun-1997  cgd sync the nwscons branch up with yesterday's version of the trunk.
Lots of conflicts/changes because of the RCS Id format changes.
Also, a few cleanups and corrections.
 1.7.2.1  07-Dec-1996  cgd snapshot of work in progress (on private branch): first checkin of
reimplemented 'wscons' interfaces.
 1.10.4.1  04-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.14.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.14.4.1  03-Aug-2001  lukem update to -current
 1.15.142.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.15.136.1  28-Apr-2009  skrll Sync with HEAD.
 1.15.128.1  04-May-2009  yamt sync with head.
 1.15.2.2  16-Jul-2001  elric So, the PowerStorm 4d20 a.k.a. 32bit TGA2 w/ IBM RGB561 RAMDAC was causing
the kernel to panic since it is recognised as a TGA and the TGA driver
doesn't [yet] know what to do with it.

This patch fixes that by:
o making tgamatch() try to actually figure out what kind
of TGA card is there, rather than simply relying on the
vendor/product ids.
o creating a tga_cnmatch() so that the console code in
arch/alpha/pci/pci_machdep.c can cause the same to occur.
o breaking up some of tga_getdevconfig() into a few different
functions to re-use code that would have been duplicated.
o changed arch/alpha/pci/pci_machdep.c so that it calls out
to tga_cnmatch() if DEVICE_IS_TGA() matches before it decides
to attach the console as a TGA.

Addresses PR: port-alpha/12923
 1.15.2.1  16-Jul-2001  elric file pci_machdep.c was added on branch nathanw_sa on 2001-07-16 00:55:18 +0000
 1.17.4.1  05-Mar-2011  rmind sync with head
 1.18.12.1  18-Feb-2012  mrg merge to -current.
 1.18.8.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.18.8.1  17-Apr-2012  yamt sync with head
 1.19.10.1  18-May-2014  rmind sync with head
 1.19.6.2  03-Dec-2017  jdolecek update from HEAD
 1.19.6.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.23.20.1  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.28.6.1  01-Aug-2021  thorpej Sync with HEAD.

RSS XML Feed