aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ppc
Commit message (Collapse)AuthorAgeFilesLines
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-273-3/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-165-10/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-162-4/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-127-7/+7
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* ppbus/ppc: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-066-6/+4
|
* ppc: Fix set but not used warnings on !i386.John Baldwin2022-04-061-3/+3
| | | | | Move fetch of SYS_RES_IOPORT resource and associated variables under existing #ifdef __i386__.
* ppc_detect_fifo: eliminate write only variable ccWarner Losh2022-04-051-2/+2
| | | | Sponsored by: Netflix
* ppc: clean up empty lines in .c and .h filesMateusz Guzik2020-09-015-11/+0
| | | | Notes: svn path=/head/; revision=365175
* i386 4/4G split.Konstantin Belousov2018-04-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change makes the user and kernel address spaces on i386 independent, giving each almost the full 4G of usable virtual addresses except for one PDE at top used for trampoline and per-CPU trampoline stacks, and system structures that must be always mapped, namely IDT, GDT, common TSS and LDT, and process-private TSS and LDT if allocated. By using 1:1 mapping for the kernel text and data, it appeared possible to eliminate assembler part of the locore.S which bootstraps initial page table and KPTmap. The code is rewritten in C and moved into the pmap_cold(). The comment in vmparam.h explains the KVA layout. There is no PCID mechanism available in protected mode, so each kernel/user switch forth and back completely flushes the TLB, except for the trampoline PTD region. The TLB invalidations for userspace becomes trivial, because IPI handlers switch page tables. On the other hand, context switches no longer need to reload %cr3. copyout(9) was rewritten to use vm_fault_quick_hold(). An issue for new copyout(9) is compatibility with wiring user buffers around sysctl handlers. This explains two kind of locks for copyout ptes and accounting of the vslock() calls. The vm_fault_quick_hold() AKA slow path, is only tried after the 'fast path' failed, which temporary changes mapping to the userspace and copies the data to/from small per-cpu buffer in the trampoline. If a page fault occurs during the copy, it is short-circuit by exception.s to not even reach C code. The change was motivated by the need to implement the Meltdown mitigation, but instead of KPTI the full split is done. The i386 architecture already shows the sizing problems, in particular, it is impossible to link clang and lld with debugging. I expect that the issues due to the virtual address space limits would only exaggerate and the split gives more liveness to the platform. Tested by: pho Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D14633 Notes: svn path=/head/; revision=332489
* Create a new ISA_PNP_INFO macro. Use this macro every where we haveWarner Losh2017-12-231-0/+1
| | | | | | | | | | ISA PNP card support (replace by hand version in if_ed). Move module declarations to the end of some files. Fix PCCARD_PNP_INFO to use nitems(). Remove some stale comments about pc98, turns out the comment was simply wrong. Notes: svn path=/head/; revision=327102
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-277-0/+14
| | | | | | | | | | | | | | | 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
* Hide a normal probe warning message under bootverbose, similar to atkbdcScott Long2017-09-181-1/+2
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=323712
* Add PCI Id for MosChip MCS9900.Konstantin Belousov2017-08-271-0/+1
| | | | | | | | | Submitted by: Robert Clausecker <fuz@fuz.su> PR: 214670 MFC after: 1 week Notes: svn path=/head/; revision=322947
* Remove register keyword from sys/ and ANSIfy prototypesEd Maste2017-05-171-5/+5
| | | | | | | | | | | | | | | A long long time ago the register keyword told the compiler to store the corresponding variable in a CPU register, but it is not relevant for any compiler used in the FreeBSD world today. ANSIfy related prototypes while here. Reviewed by: cem, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10193 Notes: svn path=/head/; revision=318389
* sys/dev: Replace zero with NULL for pointers.Pedro F. Giffuni2017-02-201-3/+3
| | | | | | | | | | | Makes things easier to read, plus architectures may set NULL to something different than zero. Found with: devel/coccinelle MFC after: 3 weeks Notes: svn path=/head/; revision=313982
* Remove pc98 support completely.Yoshihiro Takahashi2017-01-282-58/+0
| | | | | | | | | I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
* Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.Justin Hibbits2016-03-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some architectures, u_long isn't large enough for resource definitions. Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but type `long' is only 32-bit. This extends rman's resources to uintmax_t. With this change, any resource can feasibly be placed anywhere in physical memory (within the constraints of the driver). Why uintmax_t and not something machine dependent, or uint64_t? Though it's possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on 32-bit architectures. 64-bit architectures should have plenty of RAM to absorb the increase on resource sizes if and when this occurs, and the number of resources on memory-constrained systems should be sufficiently small as to not pose a drastic overhead. That being said, uintmax_t was chosen for source clarity. If it's specified as uint64_t, all printf()-like calls would either need casts to uintmax_t, or be littered with PRI*64 macros. Casts to uintmax_t aren't horrible, but it would also bake into the API for resource_list_print_type() either a hidden assumption that entries get cast to uintmax_t for printing, or these calls would need the PRI*64 macros. Since source code is meant to be read more often than written, I chose the clearest path of simply using uintmax_t. Tested on a PowerPC p5020-based board, which places all device resources in 0xfxxxxxxxx, and has 8GB RAM. Regression tested on qemu-system-i386 Regression tested on qemu-system-mips (malta profile) Tested PAE and devinfo on virtualbox (live CD) Special thanks to bz for his testing on ARM. Reviewed By: bz, jhb (previous) Relnotes: Yes Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D4544 Notes: svn path=/head/; revision=297000
* Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Justin Hibbits2016-02-271-7/+9
| | | | | | | | | | | 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-3/+3
| | | | | | | | | | | | | | | | | | | | | | | 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
* Add support for SIIG x1 pci-e single parallel port card (JJ-E01211-S1)Eitan Adler2013-11-091-0/+1
| | | | | | | | | PR: kern/182217 Submitted by: Craig Leres <leres@ee.lbl.gov> MFC After: 1 week Notes: svn path=/head/; revision=257883
* Fix build.Gleb Smirnoff2013-02-211-2/+2
| | | | Notes: svn path=/head/; revision=247094
* Replace splhigh() with critical_enter()/leave() to ensure we write theWarner Losh2013-02-211-13/+30
| | | | | | | | config mode unlock sequence quickly enough. This likely isn't too critical, since splhigh() has been a noop for a decade... Notes: svn path=/head/; revision=247066
* No longer need splhigh() since locking was done, delete it andWarner Losh2013-02-211-9/+1
| | | | | | | comments about it. Notes: svn path=/head/; revision=247065
* Rename device_delete_all_children() into device_delete_children().Hans Petter Selasky2011-11-221-1/+1
| | | | | | | | Suggested by: jhb @ and marius @ MFC after: 1 week Notes: svn path=/head/; revision=227849
* Move the device_delete_all_children() function from usb_util.cHans Petter Selasky2011-11-191-8/+1
| | | | | | | | | | | to kern/subr_bus.c. Simplify this function so that it no longer depends on malloc() to execute. Identify a few other places where it makes sense to use device_delete_all_children(). MFC after: 1 week Notes: svn path=/head/; revision=227701
* - Add support for MosChip 9865 Single 1284 Printer portMartin Wilke2011-02-191-0/+1
| | | | | | | | | PR: kern/152663 Submitted by: Jonathan Chen <jonc@chen.org.nz> Approved by: rwatson (mentor) Notes: svn path=/head/; revision=218861
* Add PCI ID for MCS9901's parallel port.Xin LI2010-03-231-0/+1
| | | | | | | | | PR: kern/144713 Submitted by: gcooper MFC after: 2 weeks Notes: svn path=/head/; revision=205534
* Added entries for Lava SP-PCI (1 serial + 1 parallel) PCI card. TheKai Wang2009-02-111-0/+1
| | | | | | | card is a multifunction PCI and report itself as two logical devices. Notes: svn path=/head/; revision=188472
* reset_epp and ecp_sync both return int.Warner Losh2009-02-052-9/+9
| | | | Notes: svn path=/head/; revision=188173
* Add locking to ppc and ppbus and mark the whole lot MPSAFE:John Baldwin2009-01-217-80/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - To avoid having a bunch of locks that end up always getting acquired as a group, give each ppc(4) device a mutex which it shares with all the child devices including ppbus(4), lpt(4), plip(4), etc. This mutex is then used for all the locking. - Rework the interrupt handling stuff yet again. Now ppbus drivers setup their interrupt handler during attach and tear it down during detach like most other drivers. ppbus(4) only invokes the interrupt handler of the device that currently owns the bus (if any) when an interrupt occurs, however. Also, interrupt handlers in general now accept their softc pointers as their argument rather than the device_t. Another feature of the ppbus interrupt handlers is that they are called with the parent ppc device's lock already held. This minimizes the number of lock operations during an interrupt. - Mark plip(4), lpt(4), pcfclock(4), ppi(4), vpo(4) MPSAFE. - lpbb(4) uses the ppc lock instead of Giant. - Other plip(4) changes: - Add a mutex to protect the global tables in plip(4) and free them on module unload. - Add a detach routine. - Split out the init/stop code from the ioctl routine into separate functions. - Other lpt(4) changes: - Use device_printf(). - Use a dedicated callout for the lptout timer. - Allocate the I/O buffers at attach and detach rather than during open and close as this simplifies the locking at the cost of 1024+32 bytes when the driver is attached. - Other ppi(4) changes: - Use an sx lock to serialize open and close. - Remove unused HADBUS flag. - Add a detach routine. - Use a malloc'd buffer for each read and write to avoid races with concurrent read/write. - Other pps(4) changes: - Use a callout rather than a callout handle with timeout(). - Conform to the new ppbus requirements (regular mutex, non-filter interrupt handler). pps(4) is probably going to have to become a standalone driver that doesn't use ppbus(4) to satisfy it's requirements for low latency as a result. - Use an sx lock to serialize open and close. - Other vpo(4) changes: - Use the parent ppc device's lock to create the CAM sim instead of Giant. - Other ppc(4) changes: - Fix ppc_isa's detach method to detach instead of calling attach. Tested by: no one :-( Notes: svn path=/head/; revision=187576
* Various whitespace and style fixes.John Baldwin2008-11-162-62/+62
| | | | Notes: svn path=/head/; revision=185003
* Fix build with PPC_PROBE_CHIPSET enabled.John Baldwin2008-10-221-10/+13
| | | | Notes: svn path=/head/; revision=184176
* Several cleanups to remove the need for explicit unit numbers and a fewJohn Baldwin2008-10-212-26/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | other fixes: - Add pointers back to device_t objects in softc structures instead of storing the unit and using devclass_get_device(). - Add 'lpbb', 'pcf', 'pps', and 'vpo' child devices to every 'ppbus' device instead of just the first one. - Store softc pointers in si_drv1 of character devices instead of pulling the unit number from the minor number and using devclass_get_softc() and devclass_get_device(). - Store the LP_BYPASS flag in si_drv2 instead of encoding it in the minor number. - Destroy character devices for lpt(4) when detaching the device. - Use bus_print_child_footer() instead of duplicating it in ppbus_print_child() and fix ppbus_print_child()'s return value. - Remove unused AVM ivar from ppbus. - Don't store the 'mode' ivar in the ppbus ivars since we always fetch it from the parent anyway. - Try to detach all the child devices before deleting them in ppbus_detach(). - Use pause() instead of a tsleep() on a dummy address when polling the ppbus. - Use if_printf() and device_printf() instead of explicit names with unit numbers. Silence on: current@ Notes: svn path=/head/; revision=184130
* Rework the handling of interrupt handlers for children of ppc and ppbus:John Baldwin2008-09-157-63/+116
| | | | | | | | | | | | | | | | | | | | - Retire IVARs for passing IRQs around. Instead, ppbus and ppc now allow child devices to access the interrupt by via a rid 0 IRQ resource using bus_alloc_resource_any(). - ppc creates its own interrupt event to manage the interrupt handlers of child devices. ppc does not allow child devices to use filters. It could allow this if needed, but none of the current drivers use them and it adds a good bit of complication. It uses intr_event_execute_handlers() to fire the child device interrupt handlers from its threaded interrupt handler. - Remove the ppbus_dummy_intr() hack. Now the ppc device always has an interrupt handler registered and we no longer bounce all the way up to nexus to manage adding/removing ppbus child interrupt handlers. Instead, the child handlers are added and removed to the private interrupt event in the ppc device. Notes: svn path=/head/; revision=183053
* Remove unneeded include.Yoshihiro Takahashi2008-08-291-5/+0
| | | | Notes: svn path=/head/; revision=182441
* Use bus_foo() rather than bus_space_foo() and remove bus handle and tagJohn Baldwin2008-08-223-33/+28
| | | | | | | from softc. Notes: svn path=/head/; revision=182016
* Use ppc_detach() for device_detach instead of ppc_attach().John Baldwin2008-08-221-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=182015
* Don't call bus_deactivate_resource() explicitly before callingYoshihiro Takahashi2007-03-211-8/+0
| | | | | | | | bus_release_resource(). This is needed for pc98 by upcoming nexus related change. Notes: svn path=/head/; revision=167753
* o Wrap ppc_setup_intr() at 80.Paolo Pisati2007-03-061-3/+6
| | | | | | | o Fix a bit the indentation. Notes: svn path=/head/; revision=167264
* Whitespace fix.John Baldwin2007-02-231-1/+1
| | | | Notes: svn path=/head/; revision=166933
* Use 'pause' in several places rather than trying to tsleep() on NULL (whichJohn Baldwin2007-02-231-2/+1
| | | | | | | | | triggers a KASSERT) or local variables. In the case of kern_ndis, the tsleep() actually used a common sleep address (curproc) making it susceptible to a premature wakeup. Notes: svn path=/head/; revision=166909
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-232-5/+5
| | | | | | | | | | | | | | | | 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
* Remove various bits of conditional Alpha code and fixup a few comments.John Baldwin2006-05-121-9/+0
| | | | Notes: svn path=/head/; revision=158471
* Rewrite of puc(4). Significant changes are:Marcel Moolenaar2006-04-281-0/+13
| | | | | | | | | | | | | | | | | | | | | | | o Properly use rman(9) to manage resources. This eliminates the need to puc-specific hacks to rman. It also allows devinfo(8) to be used to find out the specific assignment of resources to serial/parallel ports. o Compress the PCI device "database" by optimizing for the common case and to use a procedural interface to handle the exceptions. The procedural interface also generalizes the need to setup the hardware (program chipsets, program clock frequencies). o Eliminate the need for PUC_FASTINTR. Serdev devices are fast by default and non-serdev devices are handled by the bus. o Use the serdev I/F to collect interrupt status and to handle interrupts across ports in priority order. o Sync the PCI device configuration to include devices found in NetBSD and not yet merged to FreeBSD. o Add support for Quatech 2, 4 and 8 port UARTs. o Add support for a couple dozen Timedia serial cards as found in Linux. Notes: svn path=/head/; revision=158124
* o Use __FBSDIDMarcel Moolenaar2006-04-261-12/+11
| | | | | | | | o Whitespace fixes o Non-K&R functions Notes: svn path=/head/; revision=158057
* o Move ISA specific code from ppc.c to ppc_isa.c -- a bus front-Marcel Moolenaar2006-04-247-240/+585
| | | | | | | | | | | | | | | | | end for isa(4). o Add a seperate bus frontend for acpi(4) and allow ISA DMA for it when ISA is configured in the kernel. This allows acpi(4) attachments in non-ISA configurations, as is possible for ia64. o Add a seperate bus frontend for pci(4) and detect known single port parallel cards. o Merge PC98 specific changes under pc98/cbus into the MI driver. The changes are minor enough for conditional compilation and in this form invites better abstraction. o Have ppc(4) usabled on all platforms, now that ISA specifics are untangled enough. Notes: svn path=/head/; revision=158005
* Import ACPI Dock Station support. Note that this is still very young.Mitsuru IWASAKI2006-04-152-0/+43
| | | | | | | | | | | Additional detach implementaions (or maybe improvement) for other deivce drivers is required. Reviewed by: njl, imp MFC after: 1 week Notes: svn path=/head/; revision=157774
* G/C unused variable.John Baldwin2006-02-221-1/+0
| | | | Notes: svn path=/head/; revision=155927
* - Use bus_setup_intr() and bus_teardown_intr() to register device driverJohn Baldwin2006-02-221-2/+2
| | | | | | | | | | | | | interrupt handlers rather than BUS_SETUP_INTR() and BUS_TEARDOWN_INTR(). Uses of the BUS_*() versions in the implementation of foo_intr methods in bus drivers were not changed. Mostly this just means that some drivers might start printing diagnostic messages like [FAST] when appropriate as well as honoring mpsafenet=0. - Fix two more of the ppbus drivers' identify routines to function correctly in the mythical case of a machine with more than one ppbus. Notes: svn path=/head/; revision=155921
* Add missing MODULE_DEPEND() so that ppbus.ko and these .ko's can beRuslan Ermilov2005-12-211-0/+1
| | | | | | | loaded dynamically. Notes: svn path=/head/; revision=153610