summaryrefslogtreecommitdiffstats
path: root/sys/arch/sparc64/dev (follow)
Commit message (Collapse)AuthorAgeFilesLines
* spellingjsg2021-03-119-23/+23
|
* timecounting: use C99-style initialization for all timecounter structscheloha2021-02-231-2/+9
| | | | | | | | | | | | | | | | | | The timecounter struct is large and I think it may change in the future. Changing it later will be easier if we use C99-style initialization for all timecounter structs. It also makes reading the code a bit easier. For reasons I cannot explain, switching to C99-style initialization sometimes changes the hash of the resulting object file, even though the resulting struct should be the same. So there is a binary change here, but only sometimes. No behavior should change in either case. I can't compile-test this everywhere but I have been staring at the diff for days now and I'm relatively confident this will not break compilation. Fingers crossed. ok gnezdo@
* blacklist com on m3000s. our com code causes faults somehow.dlg2021-01-191-1/+20
| | | | | | | | console i/o still happens using ofw routines, which is Good Enough(tm) for now. having a working machine means i can better test changes now though. ok deraadt@
* Refactor klist insertion and removalvisa2020-12-251-4/+4
| | | | | | | | | | | | Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists. Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification. OK mpi@
* Rename the macro MCLGETI to MCLGETL and removes the dead parameter ifp.jan2020-12-121-2/+2
| | | | | | OK dlg@, bluhm@ No Opinion mpi@ Not against it claudio@
* If Open Firmware doesn't provide an interrupt mapping, use the swizzledkettenis2020-10-271-3/+11
| | | | | interrupt pin as the devino. Fixes ohci(4) and ehci(4) interrupts on the Fujitsu M10-1.
* If the #msi-eqs property says there are no event queues, don't try to setjmatthew2020-10-241-1/+3
| | | | | | | up MSI support. stsp@ and bluhm@ ran into this on T5220s ok stsp@ kettenis@ patrick@
* unbreak buildjsg2020-10-161-2/+2
|
* Replace simple one-line bcopy()/memcpy() of faked data into scsi_xfer with callkrw2020-10-151-2/+2
| | | | | to scsi_copy_internal_data(). Thus getting xs->resid properly set and adding the usual uio/size sanity checks.
* fix indentationjsg2020-10-011-2/+2
|
* Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'krw2020-09-221-9/+9
| | | | | | | | | | | | member of 'struct scsi_xfer' has always been pointed at the 'struct scsi_generic cmdstore' member of the same instance. So nuke 'cmdstore' and remove the '*' from cmd. Take the address of cmd as required by the various casts. No intentional functional change. luna88k test by aoyama@, sparc64 test by jmatthew@ Identification of 2009's last *cmd use and ok jmatthew@
* Replace '32' with SID_SCSI2_ALEN (a.k.a. 31) when building emulated INQUIRYkrw2020-09-051-2/+2
| | | | | responses. This is what the SCSI specifications say is the correct value and already used in several cases.
* Replace '.response_format = 2' with '.response_format = SID_SCSI2_RESPONSE'.krw2020-09-031-2/+2
|
* When building emulated INQUIRY results use the SCSI_REV_* #define's tokrw2020-09-021-2/+2
| | | | initialize the 'version' field. Not numbers.
* Rename [READ|WRITE]_BIG to [READ|WRITE]_10. Rename struct scsi_rw_big tokrw2020-09-011-9/+9
| | | | | | struct scsi_rw_10. ok gnezdo@ jmatthew@ (who also did sparc64 compile test)
* Nuke unused struct scsi_link member of vdsk_softc.krw2020-07-221-2/+1
| | | | sparc64 compile test by jmatthew@
* console marker should be after :deraadt2020-07-221-2/+2
|
* It's saa_flags, not flags.krw2020-07-211-2/+2
| | | | Encountered by deraadt@
* saa.ssa.wwpn is not the same as saa.saa_wwpn.krw2020-07-201-2/+2
| | | | Typo broke miod's luna88k build. Would have broken next sparc64 build.
* Move remaining scsi bus initialization info from "prototype scsi link"krw2020-07-201-4/+5
| | | | | | | fields to struct scsibus_attach_args. Nuke the struct scsi_link * (saa_sc_link) in scaibus_attach_args. Explicitly initialize each field in scsibus_attach_args variables.
* Move the adapter related items (luns, adapter, adapter_target,krw2020-07-191-6/+6
| | | | | | | adapter_buswidth, adapter_softc) from struct scsi_link to struct scsibus_attach_args. Additional compile tests by jmatthew@ (sparc64) and aoyam@ (luna88k).
* Access adapter softc via link->bus->sb_adapter_softc.krw2020-07-161-7/+7
| | | | | | | | In sparc64 autoconf access 'luns' via sb_luns and 'adapter_buswidth' via sb_adapter_buswidth. Removes last post-config uses of the copies of bus related information in scsi_link.
* Expunge some Captain Obvious comments, tweak whitespace a bit, move a debugkrw2020-07-111-2/+2
| | | | statement. All to make upcoming diff(s) smaller and easier to read.
* Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.patrick2020-07-101-3/+3
| | | | ok dlg@ tobhe@
* Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use thepatrick2020-07-101-3/+3
| | | | | | "new" API. ok dlg@ tobhe@
* Add support for timeconting in userland.pirofti2020-07-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@
* No need to bzero()/memset() 'struct scsibus_attach_args' variableskrw2020-06-271-2/+1
| | | | immediately before initializing the only field in the struct.
* Fix variable shadowing that caused us to map the entire range (manyjmatthew2020-06-251-5/+5
| | | | | | | | gigabytes) instead of just the amount the caller asked for. This resulted in a noticeable delay while attaching devices using multiple msi-x vectors as we map and unmap the msi-x table for each vector. ok kettenis@
* Use SDEV_NO_ADAPTER_TARGET instead of the value of adapter_buswidth tokrw2020-06-241-2/+2
| | | | | | indicate the adapter is not a target on the bus. ok dlg@ as part of a larger diff.
* Nuke some pointless *_dev_probe() and *_dev_free() functions andkrw2020-06-241-23/+6
| | | | | | | set/trust the scsiconf.c probing limits. Same as was done to vioblk(4). ok dlg@
* remove ifdeffed out code for redistributing pyro eq interrupts over cpus.dlg2020-06-241-75/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when sparc64 attaches cpus early during boot, it really just allocates the software state for them (ie, the devices and the cpu_info structs) and fills them in with information from openfirmware, but it doesnt actually spin them up in a physical sense until just before root is mounted. in between that, we now set up pyro with an msi event queue per cpu, and target the interrupts for those event queues at the different cpus. if a device generates an msi interrupt before the cpus are spun up, pyro will fire an interrupt at those cpus, but cos they're not running yet, they don't handle the interrupt, and the event queue never gets processed. because the msi interrupt state is never cleared by the pyro interrupt handler because the cpu didn't run it, any further msi interrupts from that pci device don't cause the eq interrupt to fire again, so it gets stuck. one approach to dealing with this is to target all the event queues that pyro sets up at the boot cpu, and once the other cpus are running we go through and retarget the event queue interrupts at the different cpus. this means the boot cpu works on the other cpus behalf until they're running, and it avoids the eq interrupts being ignored before the other cpus are running. another approach is to spin the cpus up when they're attached, so they'll be set up to process early pyro interrupts, even if they sit at splhigh until after autoconf has run. i had a quick go at this and it didn't go well. the approach we went with was to avoid having the device in question generate interrupts early. i left the redistributing code in the tree so people might discover it if needed, or at least see this description of what's happening. kettenis@ seemed ok with leaving the code in jmatthew@s pci_intr_establish_cpu commit, but removing it after. this is that removal.
* Implement pci_intr_establish_cpu() for pyro(4) and vpci(4) based sparc64jmatthew2020-06-236-108/+363
| | | | | | | | | | | | | | | | | systems. MSIs on these systems are delivered to event queues, which trigger interrupts when non-empty. The interrupt handler dequeues the MSIs and converts them into soft interrupts, which run on the same cpu as the event queue interrupt. To target pci device interrupts to different cpus, we set up an event queue per cpu in the system, or as many as we can, if there are fewer event queues available. For now, we don't have a way to feed this information back to intrmap, so instead we just map interrupts for cpus that don't have an event queue to another cpu that does have one. Tested on V215 (pyro), T5120, T4-1, S7-2 (vpci). dlg@ got the pyro side of it working for me. ok dlg@ kettenis@
* sparc64 should define __HAVE_PCI_MSIXdlg2020-06-171-1/+41
|
* dev/rndvar.h no longer has statistical interfaces (removed during variousderaadt2020-05-291-2/+1
| | | | | | conversion steps). it only contains kernel prototypes for 4 interfaces, all of which legitimately belong in sys/systm.h, which are already included by all enqueue_randomness() users.
* change wsdisplay attribute type from long to uint32_tjsg2020-05-258-47/+47
| | | | | | | | miod explained it was initially a long as it was thought drivers may need to allocate storage but in practice they don't need more than 32 bits for an attribute. suggested and reviewed by miod@
* rename wsdisplay alloc_attr() to pack_attr()jsg2020-05-252-7/+7
| | | | | | | | Suggested by John Carmack. miod agrees a rename would make sense and explained it was initially thought drivers may need to allocate storage but in practice they don't need more than 32 bits for an attribute. ok mpi@
* Implement kqueue(2) support.mpi2020-05-231-1/+124
| | | | inputs & ok kettenis@
* fdc(4/sparc64): timeout_add(9) -> timeout_add_msec(9)cheloha2020-02-201-2/+2
| | | | Copy a change from dev/isa/fd.c to sparc64's floppy driver.
* Flip vdsk to 'normal' scsi_adapter idiom.krw2020-02-181-11/+10
| | | | Compile testing by kurt@ and jca@.
* Cleanup <sys/kthread.h> and <sys/proc.h> includes.mpi2020-02-181-2/+1
| | | | | | | Do not include <sys/kthread.h> where it is not needed and stop including <sys/proc.h> in it. ok visa@, anton@
* Nuke unnecessary abstraction 'scsi_minphys()' which just callskrw2020-02-051-2/+2
| | | | | | 'minphys()'. Just use & check for NULL instead, since 'minphys()' is always called on the code path ([cd|sd|st]minphys) that calls physio().
* vsdk -> vdsk in a panic messagetedu2020-01-261-2/+2
|
* Shuffle some names around to make reading the code less headachekrw2020-01-261-2/+2
| | | | | | | | inducing. Rename scsi_adapter member 'scsi_minphys' to 'dev_minphys' to reflect what it is supposed to do. Use consistent naming convention (<dev>_minphys) for the actual device functions. No functional change.
* Convert to tsleep_nsec(9).mpi2020-01-161-2/+3
| | | | Tested by kn@, ok kettenis@, kn@
* Unbreak DEBUG build: use %x not %lx with intkn2020-01-011-2/+2
|
* Unbreak DEBUG build: do not use undefined pakn2020-01-011-3/+3
| | | | | introduced iommu_dvmamap_insert() using an undefined paddr_t pa under DEBUG; since it cannot be introduced it (easily), remove it from the printf().
* Unbreak DEBUG build: Format bus_{addr,size}_t as longkn2020-01-011-8/+8
|
* Unbreak DEBUG build: format time_t as long longkn2020-01-011-2/+2
| | | | Feedback guenther
* poll handlers must return a poll(2) revents value, not errno(2) values.reyk2019-12-191-2/+2
| | | | | | | | | Some drivers have returned ENXIO (6) if the device is not available which incorrectly translates into POLLPRI|POLLOUT (2|4) in userland. Change it to POLLERR for now, but it might as well be POLLHUP. OK mpi@
* Remove clause #3 from mrg@NetBSD license.mpi2019-12-0510-30/+10
| | | | | | | In May 29 2008, Matthew R. Green removed it in NetBSD: github.com/IIJ-NetBSD/netbsd-src/commit/7ea20401d535da9996394136ef ok deraadt@