summaryrefslogtreecommitdiff
path: root/sys/dev/scc
Commit message (Collapse)AuthorAgeFilesLines
* [PowerPC] Fix scc z8530 driverBrandon Bergren2020-06-143-5/+29
| | | | | | | | | | | | | | | | | | | | | | | Parts of the z8530 driver were still using the SUN channel spacing. This was invalid on PowerMac and QEMU, where the attachment was to escc, not escc-legacy. This means the driver has apparently NEVER worked properly on Macintosh hardware. Add documentation for the channel spacing details, and change to using driver-specific initialization instead of hardcoded spacing so either spacing can be used. Fixes boot hang in QEMU when using the serial console, and fixes use on Xserve serial (and presumably PowerMacs that have a Stealth Serial port or similar) Reviewed by: jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D24661 Notes: svn path=/head/; revision=362179
* Remove sparc64 kernel supportWarner Losh2020-02-032-195/+0
| | | | | | | | | Remove all sparc64 specific files Remove all sparc64 ifdefs Removee indireeect sparc64 ifdefs Notes: svn path=/head/; revision=357455
* Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer2019-05-204-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2710-0/+20
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Replace some more default range checks with RMAN_IS_DEFAULT_RANGE().Justin Hibbits2016-03-021-1/+1
| | | | | | | This is a follow-on to r295832. Notes: svn path=/head/; revision=296298
* Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Justin Hibbits2016-02-271-6/+6
| | | | | | | | | | | Most calls to bus_alloc_resource() use "anywhere" as the range, with a given count. Migrate these to use the new bus_alloc_resource_anywhere() API. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370 Notes: svn path=/head/; revision=296137
* Convert rman to use rman_res_t instead of u_longJustin Hibbits2016-01-272-5/+5
| | | | | | | | | | | | | | | | | | | | | | | Summary: Migrate to using the semi-opaque type rman_res_t to specify rman resources. For now, this is still compatible with u_long. This is step one in migrating rman to use uintmax_t for resources instead of u_long. Going forward, this could feasibly be used to specify architecture-specific definitions of resource ranges, rather than baking a specific integer type into the API. This change has been broken out to facilitate MFC'ing drivers back to 10 without breaking ABI. Reviewed By: jhb Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5075 Notes: svn path=/head/; revision=294883
* In sys/dev/scc, remove unused static function scc_setmreg(). WhileDimitry Andric2013-12-291-15/+2
| | | | | | | | | | here, invoke scc_getmreg() in two more places where it can be used. Reviewed by: marcel MFC after: 3 days Notes: svn path=/head/; revision=260057
* Make r253899 compile.Marius Strobl2013-08-031-0/+4
| | | | Notes: svn path=/head/; revision=253920
* Const'ify scc_driver_name.Marius Strobl2013-08-022-2/+2
| | | | Notes: svn path=/head/; revision=253902
* - Use NULL instead of 0 for pointers.Marius Strobl2013-08-024-7/+5
| | | | | | | - Remove unnecessary __RMAN_RESOURCE_VISIBLE. Notes: svn path=/head/; revision=253900
* - Implement iclear methods for QUICC and SAB 82532. With r253161 in place,Marius Strobl2013-08-023-24/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | this is is crucial at least for the latter. What happens is that attaching uart(4) to scc(4) causes the SAB 82532 to "receive" something and trigger a SER_INT_RXREADY interrupt, given that at least fast/filter interrupts are already enabled. Prior to r253161, uart_bus_ihand() was set up at this point and handled that condition, i. e. read the RX FIFO and issued a Receive Message Complete. Now, uart_bus_ihand() and uart_intr() are setup after attaching uart(4), leaving the SER_INT_RXREADY interrupt triggered during the latter to be handled by the iclear method. However, with that method not implement, this in turn causes SAB 82532 to not issue any further SER_INT_RXREADY interrupts until the RX FIFO is full again. Thus, 15 received bytes go to nowhere, given that "the other half" of the RX FIFO is used for status information. Hence, implementing sab82532_bfe_iclear() fixes things again. Potentially, the same problem exists for QUICC. - Remove unnecessary __RMAN_RESOURCE_VISIBLE. - Remove a superfluous header. - Use KOBJMETHOD_END. - Mark unused arguments as such. - Remove variables unused after initialization. Reviewed by: marcel (earlier version) Notes: svn path=/head/; revision=253899
* - There's no need to overwrite the default device method with the defaultMarius Strobl2011-11-224-12/+8
| | | | | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID. Notes: svn path=/head/; revision=227843
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.Ed Schouten2011-11-071-1/+1
| | | | | | | This means that their use is restricted to a single C file. Notes: svn path=/head/; revision=227293
* Recognize the SAB 82532 found in Fujitsu PRIMEPOWER650 and 900.Marius Strobl2011-05-151-1/+2
| | | | Notes: svn path=/head/; revision=221960
* Make iclear return int, since that matches all function definitions of it.Warner Losh2009-02-051-1/+1
| | | | Notes: svn path=/head/; revision=188174
* With rev 1.24 of sys/powerpc/powermac/macio.c, we now get aMarcel Moolenaar2008-04-266-7/+44
| | | | | | | | | | | | | | | | | total of 6 interrupt resources for scc(4) on macio(4). This is 3 per channel, of which the 1st of each channel is the interrupt associated with the SCC. The other 2 are for DMA operation. Change scc_bfe_attach() to accept an argument that's the number of interrupts per channel (ipc) and change each bus front-end (bfe) to pass that argument through a wrapper for the device_attach method. For now, we only allocate the 1st interrupt of each channel to perserve behaviour. Notes: svn path=/head/; revision=178600
* Support for Freescale QUad Integrated Communications Controller.Rafal Jaworowski2008-03-034-0/+248
| | | | | | | | | | | | | | | | The QUICC engine is found on various Freescale parts including MPC85xx, and provides multiple generic time-division serial channel resources, which are in turn muxed/demuxed by the Serial Communications Controller (SCC). Along with core QUICC/SCC functionality a uart(4)-compliant device driver is provided which allows for serial ports over QUICC/SCC. Approved by: cognet (mentor) Obtained from: Juniper MFp4: e500 Notes: svn path=/head/; revision=176772
* Add method enabled() to the SCC interface. This method can be usedMarcel Moolenaar2007-03-283-0/+22
| | | | | | | | | | | by driver backends to mark individual channels as enabled or not. The default implementation of this method always mark channels as enabled. This method is currently not used, but is added with the PowerQUICC in mind where the 2nd SCC channel can be disabled. Notes: svn path=/head/; revision=167996
* Allow the range of a SCC class to be 0. This gives all childMarcel Moolenaar2007-03-281-5/+7
| | | | | | | | | devices the same (overlapping) I/O range. This is useful for embedded communications controllers like the CPM of various models of the PowerQUICC. Notes: svn path=/head/; revision=167973
* Pass the RID from the bus frontends to the core probe function.Marcel Moolenaar2007-03-225-7/+7
| | | | | | | | | Currently all RIDs are 0, but for PCI devices this typically isn't the case. This change is made with future PCI support in mind. Notes: svn path=/head/; revision=167822
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-232-13/+15
| | | | | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@ Notes: svn path=/head/; revision=166901
* Fix braino: The cl_range field should not hold the shifted I/OMarcel Moolenaar2006-07-262-3/+3
| | | | | | | | | | space range per channel, but rather the unshifted range. The shifting depends on the bus. The hardcoded shift was specific to the SBus on sparc64. The shifted range is now determined at run-time. This fixes the mac-io attachment. Notes: svn path=/head/; revision=160689
* Revert previous commit. Spinlocks hold interrupts disabled, soMarcel Moolenaar2006-07-251-13/+11
| | | | | | | | | preemption is not possible. Pointed out by: jhb@ Notes: svn path=/head/; revision=160640
* If we have multiple interrupt resources, like for Z8530 clones on theMarcel Moolenaar2006-07-241-11/+13
| | | | | | | | | | | | | mac-io bus, we cannot setup FAST interrupt handlers. This because we use spinlocks to protect the hardware and all interrupt resources are assigned the same interrupt handler. When the interrupt handler is invoked for interrupt X, it could be preempted for interrupt Y while it was holding the lock (where X and Y are the interrupt resources corresponding a single instance of this driver). This is a deadlock. By only using a MPSAFE handler in that case we prevent preemption. Notes: svn path=/head/; revision=160631
* The Z8530 on the MacIO has an interrupt per channel. Deal with thisMarcel Moolenaar2006-04-042-32/+57
| | | | | | | | by having interrupt resource variables per channel. We don't set up different interrupt handlers per channel, though. Notes: svn path=/head/; revision=157492
* Add a MacIO bus attachment. The Z8530 as present in the Mac needsMarcel Moolenaar2006-04-017-18/+101
| | | | | | | | | | | a different register shift and is fed by a different clock than we use for UltraSPARC hardware. To deal with this, the regshft and rclk fields in the class structure are removed and bus frontends now pass the right regshft and rclk to the probe function where they're put in the BAS and passed in to subordinate drivers. Notes: svn path=/head/; revision=157351
* Fix cut-n-paste braino in previous commit: s/puc/scc/gMarcel Moolenaar2006-03-311-1/+1
| | | | | | | Pointy hat: marcel@ Notes: svn path=/head/; revision=157340
* Add a DRIVER_MODULE declaration for fhc(4) as this attachement isMarcel Moolenaar2006-03-311-0/+1
| | | | | | | | | also used for the FHC bus. Pointed out by: marius@ Notes: svn path=/head/; revision=157337
* Add scc(4), a driver for serial communications controllers. TheseMarcel Moolenaar2006-03-308-0/+1333
controllers typically have multiple channels and support a number of serial communications protocols. The scc(4) driver is itself an umbrella driver that delegates the control over each channel and mode to a subordinate driver (like uart(4)). The scc(4) driver supports the Siemens SAB 82532 and the Zilog Z8530 and replaces puc(4) for these devices. Notes: svn path=/head/; revision=157299