summaryrefslogtreecommitdiffstats
path: root/sys/dev/ofw
Commit message (Collapse)AuthorAgeFilesLines
* - 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
* Remove advertising clause from University of California Regent'simp2004-04-072-13/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Device megapatch 4/6:phk2004-02-213-2/+6
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Device megapatch 3/6:phk2004-02-211-3/+1
| | | | | | | | | | | | Add missing D_TTY flags to various drivers. Complete asserts that dev_t's passed to ttyread(), ttywrite(), ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty pointer. Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default cdevsw methods for D_TTY drivers and remove the explicit initializations in various drivers cdevsw structures.
* Device megapatch 1/6:phk2004-02-211-3/+1
| | | | | | | Free approx 86 major numbers with a mostly automatically generated patch. A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number.
* Change the disk(9) API in order to make device removal more robust.phk2004-02-181-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | Previously the "struct disk" were owned by the device driver and this gave us problems when the device disappared and the users of that device were not immediately disappearing. Now the struct disk is allocate with a new call, disk_alloc() and owned by geom_disk and just abandonned by the device driver when disk_create() is called. Unfortunately, this results in a ton of "s/\./->/" changes to device drivers. Since I'm doing the sweep anyway, a couple of other API improvements have been carried out at the same time: The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to DISKFLAG_NEEDSGIANT A version number have been added to disk_create() so that we can detect, report and ignore binary drivers with old ABI in the future. Manual page update to follow shortly.
* - add an identify method, since the disk device used to be pickedgrehan2004-02-041-3/+29
| | | | | | up in the recursive OpenFirmware node walk. Rely on the psim config file to have a "ofwdisk" device alias - minor white space nits
* - The last change conflicted with disks on a live system, as opposed togrehan2003-12-151-3/+9
| | | | | | | the psim simulator. Look for the "file" property which only exists on psim disks, and as a bonus, print the contents of this at boot-time, which is the host file being used for the disk image. - remove remaining warnings.
* - accept device_type of "block", which is how psim/gdb6.0 definesgrehan2003-12-121-7/+2
| | | | | disks. continue to accept "disk" for psim/gdb5.x users. - remove unneeded ofwd_identify
* Use bio_offset instead of bio_blknophk2003-10-181-2/+1
|
* Only create the ofwcons device nodes if it has been initialized, notjake2003-09-281-1/+2
| | | | just probed.
* Make ofw_console a low priority console device, so that uart will bejake2003-09-281-1/+1
| | | | preferred in all cases, even if the "remote" bit is not set.
* The present defaults for the open and close for device drivers whichphk2003-09-271-2/+0
| | | | | | | | | | | | | | provide no methods does not make any sense, and is not used by any driver. It is a pretty hard to come up with even a theoretical concept of a device driver which would always fail open and close with ENODEV. Change the defaults to be nullopen() and nullclose() which simply does nothing. Remove explicit initializations to these from the drivers which already used them.
* OK, I messed up /dev/console with what I had hoped would be compatphk2003-09-261-4/+4
| | | | code. Convert remaining console drivers and hope for the best.
* Initialize the cn_name instead of the cn_devphk2003-09-261-1/+2
|
* Use __FBSDID().obrien2003-08-245-4/+15
| | | | Also some minor style cleanups.
* Add a solaris compatible ofw interface for third party software thatjake2003-06-192-0/+264
| | | | | | | expects one to use. Only the functions used by XFree86 are actually implemented. Glanced at by: tmm
* - Add an OFIOCGETPROPLEN ioctl() to get the length of a property.tmm2003-06-112-13/+12
| | | | | - Do not use a fixed major. - Minor cleanups.
* Implement OF_interpret.jake2003-06-072-2/+34
| | | | Obtained from: netbsd
* Use __FBSDID rather than rcsid[].obrien2003-04-031-4/+2
|
* <sys/disk.h> -> <geom/geom_disk.h>des2003-04-031-1/+1
|
* Centralize the devstat handling for all GEOM disk device driversphk2003-03-081-1/+1
| | | | | | | | in geom_disk.c. As a side effect this makes a lot of #include <sys/devicestat.h> lines not needed and some biofinish() calls can be reduced to biodone() again.
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-032-27/+13
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* NO_GEOM cleanup:phk2003-02-231-91/+27
| | | | | | Move to "struct disk *" centered API. Fix some minor nits.
* Change the console interface to pass a "struct consdev *" instead of aphk2003-02-201-5/+5
| | | | | | | | | dev_t to the method functions. The dev_t can still be found at struct consdev *->cn_dev. Add a void *cn_arg element to struct consdev which the drivers can use for retrieving their softc.
* Back out M_* changes, per decision of the TRB.imp2003-02-192-4/+4
| | | | Approved by: trb
* Implement the ALT_BREAK_TO_DEBUGGER option for the ofw console. This is veryharti2003-02-071-0/+18
| | | | | | | | | | handy if the machine is on another floor. A minor issue with this is that these functions are also used by the debugger, so its possible to break into the debugger from the debugger. PR: sparc64/47143 Reviewed by: benno Approved by: jake (mentor)
* Change ofwcons to use the output-device property from the firmware for thejake2003-01-271-2/+3
| | | | | | | | | | name of the device that it creates. Update /etc/ttys accordingly. An alias is created for the old name so that old /etc/ttys will continue to work, but due to aliases being implemented as symlinks in devfs you cannot login as root when using the alias device. Discussed with: grehan
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-212-4/+4
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Create the ofwcons device at SI_SUB_CONFIGURE instead of SI_SUB_DRIVERS,jake2002-11-181-6/+15
| | | | | | after configure() has run. Only create the device if ofwcons is the highest priority console. Make a dev alias with the same name as the firmware output-device property.
* Add a pseudo device which allows to access the OpenFirmware device treetmm2002-10-182-0/+389
| | | | | via ioctl()s. This was ported from NetBSD and adapted a bit to better match our OpenFirmware support code.
* Add an #ifdef _KERNEL to make it possible to include this file fromtmm2002-10-181-5/+7
| | | | userland (to get the typedefs).
* Add missing semicolongrehan2002-09-201-1/+1
|
* (This commit touches about 15 disk device drivers in a very consistentphk2002-09-201-13/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and predictable way, and I apologize if I have gotten it wrong anywhere, getting prior review on a patch like this is not feasible, considering the number of people involved and hardware availability etc.) If struct disklabel is the messenger: kill the messenger. Inside struct disk we had a struct disklabel which disk drivers used to communicate certain metrics to the disklayer above (GEOM or the disk mini-layer). This commit changes this communication to use four explicit fields instead. Amongst the benefits is that the fields do not get overwritten by wrong or bogus on-disk disklabels. Once that is clear, <sys/disk.h> which is included in the drivers no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in, the few places that needs them, have gotten explicit #includes for them. The disklabel inside struct disk is now only for internal use in the disk mini-layer, so instead of embedding it, we malloc it as we need it. This concludes (modulus any mistakes) the series of disklabel related commits. I belive it all amounts to a NOP for all the rest of you :-) Sponsored by: DARPA & NAI Labs.
* Basic OpenFirmware disk driver. It will attach to anything in OpenFirmwarebenno2002-04-151-0/+261
| | | | | | | that declares itself to be a disk, which may be the wrong thing to do in the long term but it works well enough to attach to emulated disks in the PowerPC simulator in gdb now that they have the proper device_type property.
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-1/+1
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Move the make_dev call from the cn_probe to a sysinit that runs atjake2002-01-091-1/+9
| | | | SI_SUB_DRIVERS. cnprobe is too early.
* 1. Lower the poll timeout for the ofw console driver from hz / 50 to hz / 4.jake2002-01-011-2/+2
| | | | | | | | | | This gives a bit of a sluggish console, but it prevents the console from getting stuck if we poll too fast, as well as other badness on certain machines. 2. Fix a test for != 0 that should have been > 0. Noticed by: Jamey Wood <Jamey.Wood@Sun.COM> and myself Submitted by: tmm (2)
OpenPOWER on IntegriCloud