Home | History | Annotate | Download | only in dev
History log of /src/sys/arch/sparc/dev/vme_machdep.c
RevisionDateAuthorComments
 1.78  13-May-2024  msaitoh s/of of/of/ in comment.
 1.77  01-Dec-2023  thorpej Use vmem(9) rather than extent(9) to manage DVMA mappings.
 1.76  21-Jan-2022  thorpej Don't bother with prom_node_to_devhandle() if we're just forwarding along
our own node; use device_handle(self) instead.
 1.75  05-Dec-2021  msaitoh s/alloction/allocation/
 1.74  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.73  10-May-2021  thorpej branches: 1.73.4;
Associate the OpenBoot / OpenFirmware node with attached devices
at config_found() time.
 1.72  24-Apr-2021  thorpej branches: 1.72.2; 1.72.4;
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.71  22-Nov-2020  thorpej branches: 1.71.2;
malloc(9) -> kmem(9) (easy, straight-forward cases only, for now)
 1.70  14-Jun-2020  chs branches: 1.70.2;
replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
 1.69  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.68  27-Oct-2012  chs branches: 1.68.38;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.67  29-Jul-2012  matt branches: 1.67.2;
Fix more -fno-common fallout.
 1.66  27-Jan-2012  para converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
 1.65  18-Jul-2011  mrg branches: 1.65.2; 1.65.6;
convert the remaining sparc drivers to CFATTACH_DECL_NEW/cfdata_t/device_t.
(cgsix_obio.c was only partially converted with the rest of the cgsix code
when it was changed some time ago.)
 1.64  01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.63  14-Jan-2011  rmind Retire struct user, remove sys/user.h inclusions. Note sys/user.h header
as obsolete. Remove USER_TO_UAREA/UAREA_TO_USER macros.

Various #include fixes and review by matt@.
 1.62  03-Jan-2010  mrg branches: 1.62.4;
add an explicit "bool mpsafe" to intr_establish(). only set it to true
for the sun4m timer/counter interrupts. this gets lev10/14 working again
on SMP systems, where those interrupts started taking the kernel lock and
hanging...
 1.61  21-Nov-2009  rmind Use lwp_getpcb() on sparc{64} and sun2/3 MD code, clean from struct user usage.
 1.60  20-Sep-2009  tsutsui - use device_t and cfdriver_t
- use device_private() and device_xname()
- use proper types or variables for device_t/softc
 1.59  19-Dec-2008  cegger use M_ZERO on malloc() and remove subsequent bzero().
 1.58  16-Dec-2008  christos replace bitmask_snprintf(9) with snprintb(3)
 1.57  28-Apr-2008  martin branches: 1.57.8;
Remove clause 3 and 4 from TNF licenses
 1.56  17-Oct-2007  garbled branches: 1.56.16; 1.56.18; 1.56.20;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.55  17-May-2007  yamt branches: 1.55.10;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.
 1.54  04-Mar-2007  christos branches: 1.54.2; 1.54.4; 1.54.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.53  16-Nov-2005  uwe branches: 1.53.26;
ANSIify function declarations/defintions. Use uint<N>_t.
Propagate "static" to function definitions. Drop trailing whitespace.
Same binary code is produced for GENERIC.MP + KGDB + DDB.
 1.52  04-Jun-2005  tsutsui branches: 1.52.2; 1.52.8;
fkbyte() is in locore.s and accoring to its description it's used
only for work around unexplained transient bus errors when reading
the VME interrupt vector in vmeintr4m(), so change the prototype
declaration of fkbyte() in vmeintr4m() to appease gcc -Wcast-qual.
 1.51  13-Dec-2004  chs for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
 1.50  27-Jun-2004  pk GC unsed sparc_vme_bus_tag.
 1.49  17-Mar-2004  pk Rename PROM_getprop*() => prom_getprop*().
 1.48  27-Aug-2003  mrg change PROM_getprop() from taking a "void **" for the storage, to a
"void *", and do the extra de-reference directly in the function. this
avoids having to cast dozens of different types to "void **", which sets
of GCC3's strict-aliasing. testing by martin@
 1.47  01-Aug-2003  pk Correct some `defined(SUN*)' inconsistencies.
 1.46  15-Jul-2003  lukem __KERNEL_RCSID()
 1.45  18-Jan-2003  thorpej branches: 1.45.2;
Merge the nathanw_sa branch.
 1.44  03-Jan-2003  mrg part one of bus_space(9) fixes to enable bus spaces to override the
bus_space_{read,write}_[1248]() functions, which will allow 16-bit
PCMCIA support to work without additional hacks in MI drivers.
this option is not enabled yet.
 1.43  28-Dec-2002  mrg update the vme bus_space_tag_t to reality.
 1.42  16-Dec-2002  pk The cache flush routines now take a CPU context parameter. This is going
to be necessary in SMP kernels.
 1.41  10-Dec-2002  pk bus_intr_establish() now takes an optional `fast trap' handler argument.
BUS_INTR_ESTABLISH_FASTTRAP and BUS_INTR_ESTABLISH_SOFTINTR are no longer used.
 1.40  06-Dec-2002  pk Pass the `device class interrupt level' on to intr_establish() and use to
raise the ipl in the interrupt handlers to the appropriate level. This avoids
interrupt handler interference if one of the devices actually interrupts at
a lower hardware level than the maximum level assined to a device class.

Based on code from Art Grabowski in openbsd.
 1.39  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.38  01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.37  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.36  23-Aug-2002  thorpej Use the structures defined in bsd_openprom.h for "reg", "range",
and "intr" properties, rather than having identical-except-for-names
sbus_* and iommu_* versions.
 1.35  11-Mar-2002  pk branches: 1.35.4; 1.35.6;
* `bus_type_t' is gone.
* Use BUS_ADDR() where appropriate to encode I/O space and physical
address offset into a `bus_addr_t' value.
* Drop obio_bus_map() since it's now completely equivalent to bus_space_map()
* Use bus_space_map2() to map device space at a fixed virtual address.
* Remove the virtual address argument from sbus_sbus_addr()
 1.34  26-Sep-2001  eeh branches: 1.34.4;
getprop* -> PROM_getprop*
 1.33  24-Sep-2001  eeh Change bus_space_mmap() signature to the official one.
 1.32  10-Sep-2001  chris Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.
 1.31  24-Apr-2001  thorpej branches: 1.31.2; 1.31.4;
Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative. It may be possible to
optimize these a little more.
 1.30  04-Jul-2000  pk branches: 1.30.2;
Report spurious VME interrupts only #ifdef DEBUG for now. The i82586
based `ie1' board seems to cause this for no apparent reason.
 1.29  29-Jun-2000  mrg remove include of <vm/vm.h> and <machine/pmap.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.28  27-Jun-2000  pk VME/IOMMU DMA load must also relocate DVMA addresses to the start of VME space.
 1.27  26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.26  25-Jun-2000  pk Implement vme_dmamap_create/vme_dmamap_destroy, which allows us to
select the appropriate DVMA subrange for VME devices.
 1.25  18-Jun-2000  pk branches: 1.25.2;
vme4_dmamap_[un]load: ensure enough DVMA space is allocated to cover the
buffer and store that amount in the DMA map to avoid re-computation.
Also add a cache flush as the bus_dmamap_sync() don't do that yet.
 1.24  04-Jun-2000  cgd Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.23  09-May-2000  pk branches: 1.23.2;
The bus_dma(9) implementation now allocates DVMA addresses in
bus_dmamap_load_*() routines only. Note that DMA memory buffers
allocated with bus_dmamem_alloc() _must_ be loaded by bus_dmamap_load_raw().
 1.22  11-Jan-2000  pk Remove old-style boot device recognition.
 1.21  13-Nov-1999  thorpej Update for pmap_enter() API change. No functional difference.
 1.20  08-Jul-1999  thorpej branches: 1.20.2; 1.20.4; 1.20.8;
Change the pmap_extract() interface to:
boolean_t pmap_extract(pmap_t, vaddr_t, paddr_t *);
This makes it possible for the pmap to map physical address 0.
 1.19  30-Jun-1999  drochner update for new VME framework
 1.18  14-Apr-1999  pk Initialize the VME bus tag.
 1.17  26-Mar-1999  mycroft branches: 1.17.2;
Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.
 1.16  08-Feb-1999  fvdl Make this compile for SUN4 only.
 1.15  15-Jan-1999  pk Sanity check from Matthias Drochner.
 1.14  19-Sep-1998  pk Provide an error entry point like sbus and memory.
 1.13  30-Aug-1998  pk getpropA() => getprop().
 1.12  23-Aug-1998  pk Move sparc_vme_dmamem_map() outside `#ifdef SUN4M'
 1.11  23-Aug-1998  pk Rename DVMA constants.
 1.10  20-Aug-1998  pk Flesh out more of the sun4 busdma functions.
 1.9  30-Jul-1998  pk Adapt to changes in the base bus_dma* functions.
 1.8  30-Jul-1998  pk Get to DMA map functions through parent tag, instead of calling some base
functions directly.
 1.7  07-Apr-1998  pk branches: 1.7.2;
Use bus space methods to implement the vme bus space functions.
 1.6  21-Mar-1998  pk Account for bus_space(9)-style bus attachment scheme.
 1.5  06-Feb-1998  pk vme_bus_probe() takes an `offset' argument.
 1.4  04-Feb-1998  thorpej Add offset and length parameters to bus_dmamap_sync(), used for specifiying
partial syncs of a DMA mapping.
 1.3  04-Feb-1998  thorpej Change the last argument of bus_dmamap_sync() from bus_dmasync_op_t to int,
and allow more than one synchronization operation to be specified in
a single call. Dissallow mixing of PRE and POST operations.
 1.2  04-Feb-1998  pk sparc_vme_probe(): handle callback argument.
 1.1  25-Jan-1998  pk sparc/VME bus implementation.
 1.7.2.1  08-Aug-1998  eeh Revert cdevsw mmap routines to return int.
 1.17.2.1  14-Apr-1999  pk branches: 1.17.2.1.2;
Pull up rev. 1.18 from trunk.
 1.17.2.1.2.3  02-Aug-1999  thorpej Update from trunk.
 1.17.2.1.2.2  01-Jul-1999  thorpej Sync w/ -current.
 1.17.2.1.2.1  21-Jun-1999  thorpej Sync w/ -current.
 1.20.8.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.20.4.1  15-Nov-1999  fvdl Sync with -current
 1.20.2.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.23.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.25.2.2  22-Jul-2000  pk Pull up revisions 1.26,1.28,1.30.

revision 1.26
Implement vme_dmamap_create/vme_dmamap_destroy, which allows us to
select the appropriate DVMA subrange for VME devices.

revision 1.28
VME/IOMMU DMA load must also relocate DVMA addresses to the start of VME space.

revision 1.30
Report spurious VME interrupts only #ifdef DEBUG for now. The i82586
based `ie1' board seems to cause this for no apparent reason.
 1.25.2.1  30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.30.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.31.4.1  01-Oct-2001  fvdl Catch up with -current.
 1.31.2.5  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.31.2.4  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.31.2.3  16-Mar-2002  jdolecek Catch up with -current.
 1.31.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.31.2.1  13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.34.4.10  03-Jan-2003  thorpej Sync with HEAD (again).
 1.34.4.9  29-Dec-2002  thorpej Sync with HEAD.
 1.34.4.8  19-Dec-2002  thorpej Sync with HEAD.
 1.34.4.7  11-Dec-2002  thorpej Sync with HEAD.
 1.34.4.6  18-Oct-2002  nathanw Catch up to -current.
 1.34.4.5  27-Aug-2002  nathanw Catch up to -current.
 1.34.4.4  24-Jun-2002  nathanw Curproc->curlwp renaming.

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

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.34.4.3  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.34.4.2  20-Nov-2001  pk Convert to SA framework.
 1.34.4.1  26-Sep-2001  pk file vme_machdep.c was added on branch nathanw_sa on 2001-11-20 16:29:52 +0000
 1.35.6.1  22-Nov-2002  tron Pull up revision 1.36 (requested by martin in ticket #948):
Use the structures defined in bsd_openprom.h for "reg", "range",
and "intr" properties, rather than having identical-except-for-names
sbus_* and iommu_* versions.
 1.35.4.1  31-Aug-2002  gehenna catch up with -current.
 1.45.2.6  11-Dec-2005  christos Sync with head.
 1.45.2.5  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.45.2.4  18-Dec-2004  skrll Sync with HEAD.
 1.45.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.45.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.45.2.1  03-Aug-2004  skrll Sync with HEAD
 1.52.8.1  22-Nov-2005  yamt sync with head.
 1.52.2.2  03-Sep-2007  yamt sync with head.
 1.52.2.1  21-Jun-2006  yamt sync with head.
 1.53.26.2  28-Apr-2007  mrg port yamt-idlelwp to sparc. this does not work yet, but others have
asked that i commit this work-in-progress.

currently kernel threads end up running with PSR_S missing from %psr
and end up failing to dump a user corefile.
 1.53.26.1  12-Mar-2007  rmind Sync with HEAD.
 1.54.10.1  22-May-2007  matt Update to HEAD.
 1.54.4.1  11-Jul-2007  mjf Sync with head.
 1.54.2.1  27-May-2007  ad Sync with head.
 1.55.10.1  06-Nov-2007  matt sync with HEAD
 1.56.20.3  11-Mar-2010  yamt sync with head
 1.56.20.2  04-May-2009  yamt sync with head.
 1.56.20.1  16-May-2008  yamt sync with head.
 1.56.18.1  18-May-2008  yamt sync with head.
 1.56.16.2  17-Jan-2009  mjf Sync with HEAD.
 1.56.16.1  02-Jun-2008  mjf Sync with HEAD.
 1.57.8.1  19-Jan-2009  skrll Sync with HEAD.
 1.62.4.1  05-Mar-2011  rmind sync with head
 1.65.6.1  18-Feb-2012  mrg merge to -current.
 1.65.2.2  30-Oct-2012  yamt sync with head
 1.65.2.1  17-Apr-2012  yamt sync with head
 1.67.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.68.38.1  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.70.2.1  14-Dec-2020  thorpej Sync w/ HEAD.
 1.71.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.72.4.1  31-May-2021  cjep sync with head
 1.72.2.1  13-May-2021  thorpej Sync with HEAD.
 1.73.4.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed