summaryrefslogtreecommitdiffstats
path: root/sys/dev/ofw
Commit message (Collapse)AuthorAgeFilesLines
* Set the wrong softc size when defining the ofw_iicbus class. Change it tonwhitehorn2009-01-201-2/+2
| | | | the correct value.
* Import an Open Firmware I2C bus module. This attaches firmware device treenwhitehorn2009-01-151-0/+183
| | | | | | | | indicated I2C devices, and provides an ofw_bus interface for driver probing. This should be MI, but is currently provided only on PowerPC due to lack of sparc64 hardware with an I2C controller. Discussed on: freebsd-arch
* Fix the OFW interrupt map parser to use its own idea of the number of interruptnwhitehorn2009-01-033-18/+24
| | | | | | | | | cells in the map, instead of using a value passed to it and then panicing if it disagrees. This fixes interrupt map parsing for PCI bridges on some Apple Uninorth PCI controllers. Reported by: marcel Tested on: G4 iBook, Sun Ultra 5
* Modularize the Open Firmware client interface to allow run-time switchingnwhitehorn2008-12-207-585/+1375
| | | | | | | | | | | | of OFW access semantics, in order to allow future support for real-mode OF access and flattened device frees. OF client interface modules are implemented using KOBJ, in a similar way to the PPC PMAP modules. Because we need Open Firmware to be available before mutexes can be used on sparc64, changes are also included to allow KOBJ to be used very early in the boot process by only using the mutex once we know it has been initialized. Reviewed by: marius, grehan
* Unbreak ofwdump build by moving the pcell_t definition to after the kernelnwhitehorn2008-12-151-6/+6
| | | | | | types headers, and inside the _KERNEL ifdef. Pointy hat to: me
* Adapt parts of the sparc64 Open Firmware bus enumeration code (in particular,nwhitehorn2008-12-153-0/+178
| | | | | | | | | | | | | | | the code for parsing interrupt maps) to PowerPC and reflect their new MI status by moving them to the shared dev/ofw directory. This commit also modifies the OFW PCI enumeration procedure on PowerPC to allow the bus to find non-firmware-enumerated devices that Apple likes to add, and adds some useful Open Firmware properties (compat and name) to the pnpinfo string of children on OFW SBus, EBus, PCI, and MacIO links. Because of the change to PCI enumeration on PowerPC, X has started working again on PPC machines with Grackle hostbridges. Reviewed by: marius Obtained from: sparc64
* Remove unused consdev structure fields.ed2008-10-271-3/+1
| | | | | | The cn_unit and cn_tp fields don't seem to be used anywhere. Some drivers set them, while others don't. Just remove them, in an attempt to make our consdev code a little easier to understand.
* Integrate the new MPSAFE TTY layer to the FreeBSD operating system.ed2008-08-201-111/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve the following: - Improved driver model: The old TTY layer has a driver model that is not abstract enough to make it friendly to use. A good example is the output path, where the device drivers directly access the output buffers. This means that an in-kernel PPP implementation must always convert network buffers into TTY buffers. If a PPP implementation would be built on top of the new TTY layer (still needs a hooks layer, though), it would allow the PPP implementation to directly hand the data to the TTY driver. - Improved hotplugging: With the old TTY layer, it isn't entirely safe to destroy TTY's from the system. This implementation has a two-step destructing design, where the driver first abandons the TTY. After all threads have left the TTY, the TTY layer calls a routine in the driver, which can be used to free resources (unit numbers, etc). The pts(4) driver also implements this feature, which means posix_openpt() will now return PTY's that are created on the fly. - Improved performance: One of the major improvements is the per-TTY mutex, which is expected to improve scalability when compared to the old Giant locking. Another change is the unbuffered copying to userspace, which is both used on TTY device nodes and PTY masters. Upgrading should be quite straightforward. Unlike previous versions, existing kernel configuration files do not need to be changed, except when they reference device drivers that are listed in UPDATING. Obtained from: //depot/projects/mpsafetty/... Approved by: philip (ex-mentor) Discussed: on the lists, at BSDCan, at the DevSummit Sponsored by: Snow B.V., the Netherlands dcons(4) fixed by: kan
* Expand kdb_alt_break a little, most commonly used with the optionpeter2008-05-041-2/+17
| | | | | | | | | | | | | | | | | | | ALT_BREAK_TO_DEBUGGER. In addition to "Enter ~ ctrl-B" (to enter the debugger), there is now "Enter ~ ctrl-P" (force panic) and "Enter ~ ctrl-R" (request clean reboot, ala ctrl-alt-del on syscons). We've used variations of this at work. The force panic sequence is best used with KDB_UNATTENDED for when you just want it to dump and get on with it. The reboot request is a safer way of getting into single user than a power cycle. eg: you've hosed the ability to log in (pam, rtld, etc). It gives init the reboot signal, which causes an orderly reboot. I've taken my best guess at what the !x86 and non-sio code changes should be. This also makes sio release its spinlock before calling KDB/DDB.
* In keeping with style(9)'s recommendations on macros, use a ';'rwatson2008-03-161-1/+1
| | | | | | | | | after each SYSINIT() macro invocation. This makes a number of lightweight C parsers much happier with the FreeBSD kernel source, including cflow's prcc and lxr. MFC after: 1 month Discussed with: imp, rink
* Add a new 'why' argument to kdb_enter(), and a set of constants to userwatson2007-12-251-1/+1
| | | | | | | | | for that argument. This will allow DDB to detect the broad category of reason why the debugger has been entered, which it can use for the purposes of deciding which DDB script to run. Assign approximate why values to all current consumers of the kdb_enter() interface.
* In openprom_ioctl() ensure appropriate permissions and that data isn'tmarius2007-12-201-1/+9
| | | | | | | | NULL and doesn't point to a NULL pointer before dereferencing it. This fixes a panic triggered by Xorg 7.3. Reported and tested by: Bill Green MFC after: 3 days
* Rename the kthread_xxx (e.g. kthread_create()) callsjulian2007-10-201-1/+1
| | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
* Fix warnings.peter2007-07-061-1/+1
| | | | | | | | | nxge: cast page size fragments down to (int). If the vm's demand paging PAGE_SIZE is ever too big for that, we've got far bigger problems. ofw: move va_start() a little earlier. gcc-4.2 doesn't like us modifying the last arg before the va_start(). Approved by: re (rwatson)
* In OF_init() check the return value of OF_getprop().marius2007-06-161-1/+2
| | | | | Found with: Coverity Prevent(tm) CID: 679
* - Restore the machine independency of sys/dev/ofw/openfirm.{c,h} bymarius2007-06-162-62/+0
| | | | | | | moving OF_set_mmfsa_traptable() (SUNW,set-trap-table with the two arguments used here is specific to sun4v) to MD code. - In sys/dev/ofw/openfirm.h remove prototypes for unimplemented functions and unused Solaris compatibility macros.
* Sync the styles of sys/boot/ofw/libofw/openfirm.c andmarius2007-06-161-272/+263
| | | | | sys/dev/ofw/openfirm.c with themselves, with each-other and with style(9).
* Add missing includes of priv.h.rwatson2006-11-061-0/+1
|
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-061-1/+2
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Using the ptr defines broke the powerpc build - convert set_mmfsa to the samekmacy2006-10-111-2/+2
| | | | convention as the rest of openfirm.c
* kernel clean up to make the sun4v kernel buildkmacy2006-10-092-0/+59
| | | | | Reviewed by: jmg Approved by: rwatson (mentor)
* Fix spelling and wording in a comment.marius2006-09-011-2/+2
|
* Fix various typos and brainos in last commit.phk2006-05-301-5/+4
| | | | Submmited by: Andrew Turner <andrew@fubar.geek.nz>
* Update to new console api.phk2006-05-261-28/+11
|
* - Add a new method ofw_bus_default_get_devinfo() that allows to retrievemarius2005-11-223-2/+213
| | | | | | | | | | | | | | | | a newly introduced struct ofw_bus_devinfo which can hold the OFW info of a device recallable via the ofw_bus KOBJ interface. Introduce a set of functions ofw_bus_gen_get_*() which use ofw_bus_default_get_devinfo() to provide generic subroutines for implementing the rest of the ofw_bus KOBJ interface in a bus driver. This is inspired by bus_get_resource_list() and bus_generic_rl_*_resource() and allows to reduce code duplication in bus drivers as they only have to provide an ofw_bus_default_get_devinfo() implementation in order to provide the ofw_bus KOBJ interface via ofw_bus_gen_get_*(). - While here add a comment to ofw_bus_if.m describing the intention of the ofw_bus KOBJ interface. Reviewed by: marcel
* Remove unused function and variables.marius2005-11-221-19/+0
|
* The mediasize shouldn't be multipled by the sector size when it wasgrehan2005-10-311-1/+2
| | | | | | | | | in bytes to start off with. This caused the GPT geom sniffer to attempt a seek just back from the end of the 'disk', which resulted in a > 4G seek, causing gdb psim to exit since it only supports 32-bit seeks. The size of the disk should really be specified in the psim device tree, but for now do the minimal amount of work to get psim to run again.
* Make ttyconsolemode() call ttsetwater() so that drivers don't have to.phk2005-10-161-1/+0
|
* Sync with openfirm(4) and check the return value of malloc() althoughmarius2005-05-191-2/+15
| | | | this isn't exactly necessary with M_WAITOK.
* Update the names of some member variables in comments to refect reality.marius2005-05-191-2/+2
| | | | | Apparently this was forgotten when this code was derived from the BSD openprom(4).
* Merge revision 1.5 from NetBSD: Fix a typo in a comment.marius2005-02-121-2/+2
| | | | | NetBSD rev. 1.4 (addition of the OFW_PCI_PHYS_HI_BUS macro) had already been merged prior to adding this file to FreeBSD (with the 1.3 tag though).
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-067-7/+8
|
* Don't probe for a disk unless explicitly enabled by a tunable.grehan2004-12-281-0/+6
| | | | | | | | | This allows boot to proceed on a real system until the issue of calling back into certain OpenFirmware calls (e.g. finddevice) in thread context is understood. (this commit only affects psim users, of which I think I am the only one...)
* GEOMify the OFW disk driver. Code taken unashamedly fromgrehan2004-12-211-147/+126
| | | | the preload case in dev/md/md.c.
* Add new function ttyinitmode() which sets our systemwide defaultphk2004-10-181-6/+1
| | | | | | | | | | | | | | modes on a tty structure. Both the ".init" and the current settings are initialized allowing the function to be used both at attach and open time. The function takes an argument to decide if echoing should be enabled. Echoing should not be enabled for regular physical serial ports unless they are consoles, in which case they should be configured by ttyconsolemode() instead. Use the new function throughout.
* Add a couple of XXX comments and fix a couple of fine points.phk2004-10-121-2/+14
| | | | I have not tried to make this a "canonical tty driver".
* Instead of "OpenFirmware", "openfirmware", etc. use the official spellingmarius2004-08-165-12/+12
| | | | | | "Open Firmware" from IEEE 1275 and OpenFirmware.org (no pun intended). Ok'ed by: tmm
* - Introduce an ofw_bus kobj-interface for retrieving the OFW node and amarius2004-08-122-0/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subset ("compatible", "device_type", "model" and "name") of the standard properties in drivers for devices on Open Firmware supported busses. The standard properties "reg", "interrupts" und "address" are not covered by this interface because they are only of interest in the respective bridge code. There's a remaining standard property "status" which is unclear how to support properly but which also isn't used in FreeBSD at present. This ofw_bus kobj-interface allows to replace the various (ebus_get_node(), ofw_pci_get_node(), etc.) and partially inconsistent (central_get_type() vs. sbus_get_device_type(), etc.) existing IVAR ones with a common one. This in turn allows to simplify and remove code-duplication in drivers for devices that can hang off of more than one OFW supported bus. - Convert the sparc64 Central, EBus, FHC, PCI and SBus bus drivers and the drivers for their children to use the ofw_bus kobj-interface. The IVAR- interfaces of the Central, EBus and FHC are entirely replaced by this. The PCI bus driver used its own kobj-interface and now also uses the ofw_bus one. The IVARs special to the SBus, e.g. for retrieving the burst size, remain. Beware: this causes an ABI-breakage for modules of drivers which used the IVAR-interfaces, i.e. esp(4), hme(4), isp(4) and uart(4), which need to be recompiled. The style-inconsistencies introduced in some of the bus drivers will be fixed by tmm@ in a generic clean-up of the respective drivers later (he requested to add the changes in the "new" style). - Convert the powerpc MacIO bus driver and the drivers for its children to use the ofw_bus kobj-interface. This invloves removing the IVARs related to the "reg" property which were unused and a leftover from the NetBSD origini of the code. There's no ABI-breakage caused by this because none of these driver are currently built as modules. There are other powerpc bus drivers which can be converted to the ofw_bus kobj-interface, e.g. the PCI bus driver, which should be done together with converting powerpc to use the OFW PCI code from sparc64. - Make the SBus and FHC front-end of zs(4) and the sparc64 eeprom(4) take advantage of the ofw_bus kobj-interface and simplify them a bit. Reviewed by: grehan, tmm Approved by: re (scottl) Discussed with: tmm Tested with: Sun AX1105, AXe, Ultra 2, Ultra 60; PPC cross-build on i386
* Fix problems with the OFW console which happen when the system goesgad2004-08-041-1/+1
| | | | | | | | into single-user mode (as seen on sparc64 and PPC). Problems were due to a minor oversight in the changes committed in revision 1.25. Submitted by: grehan Tested by: gad & yongari
* Preparation commit for the tty cleanups that will follow in the nearphk2004-07-151-1/+1
| | | | | | | | | future: rename ttyopen() -> tty_open() and ttyclose() -> tty_close(). We need the ttyopen() and ttyclose() for the new generic cdevsw functions for tty devices in order to have consistent naming.
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPphk2004-07-151-1/+1
| | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
* Update for the KDB framework:marcel2004-07-101-8/+8
| | | | | | o Make debugging code conditional upon KDB instead of DDB. o Call kdb_alt_break() instead of db_alt_break(). o Call kdb_enter() instead of breakpoint().
* - set resid correctly so that a failed seek (e.g. end of file) returnsgrehan2004-06-251-1/+3
| | | | | correctly - included required <sys/module.h>
* Better OFW console support on Sun Ultra2 machines.obrien2004-06-241-9/+17
| | | | | | | | | Ultra2 users may want to set OFWCONS_POLL_HZ to a value of '20'. I have left default value at '4' as higher values can consume a more than is acceptable amount of CPU, and we don't have a consensus yet what is an optimal value. Submitted by: Pyun YongHyeon <yongari@kt-is.co.kr>
* Do the dreaded s/dev_t/struct cdev */phk2004-06-163-9/+9
| | | | Bump __FreeBSD_version accordingly.
* Remove second <sys/cdefs.h> and __FBSDID.marius2004-06-101-3/+0
|
* Machine generated patch which changes linedisc calls from accessingphk2004-06-041-3/+3
| | | | | | linesw[] directly to using the ttyld...() functions The ttyld...() functions ar inline so there is no performance hit.
* Gainfully employ the new ttyioctl in the trivial cases.phk2004-06-011-28/+0
|
* - Rearrange a comment to fit in 80 chars per line, like the rest of thismarius2004-05-221-4/+4
| | | | | file. - Remove a superfluous ';'.
* - Move OFW_NAME_MAX, used as a limit for OFW property names and devicemarius2004-05-222-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | identifiers, to openfirmio.h as OFIOCMAXNAME, so programs can use it for buffer sizes etc. Note: Although this is only a rough upper limit to make the code more robust and to prevent the allocation of ridiculous amounts of memory, the current limit of one page (8191 + '\0' in openfirm_getstr()) still appears a bit high. The maximum length of OFW property names is 31. I didn't find a maximum length for the device identifiers in the OFW documentation but it certainly is much smaller than 8191, too. - Enable the OFIOCSET ioctl, i.e. move it out from under #if 0. - Don't use openfirm_getstr() for the property value in OFIOCSET, there are also properties whose values aren't strings and it makes sense to use a different maximum length for property values than OFW_NAME_MAX/ OFIOCMAXNAME. The maximum accepted property value is defined in openfirmio.h as OFIOCMAXVALUE (currently the maximum size of the value of the nvramrc property). - Make OFIOCSET not return EINVAL when OF_setprop() returns a different length for the written value than it was told to write, this is normal for the text string values of the properties in the OFW /options node. Instead, only return EINVAL if OF_setprop() returned -1 (value could not be written or property could not be created). Add a comment about the specialty of the OFW /options node. - Make OFIOCSET return the length of the written value returned by OF_setprop(), just like OF_getprop() does. Quite useful, at least for debugging. Reviewed by: tmm
OpenPOWER on IntegriCloud