aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ofw
Commit message (Collapse)AuthorAgeFilesLines
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-067-7/+8
| | | | Notes: svn path=/head/; revision=139749
* Don't probe for a disk unless explicitly enabled by a tunable.Peter 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...) Notes: svn path=/head/; revision=139372
* GEOMify the OFW disk driver. Code taken unashamedly fromPeter Grehan2004-12-211-143/+122
| | | | | | | the preload case in dev/md/md.c. Notes: svn path=/head/; revision=139100
* Add new function ttyinitmode() which sets our systemwide defaultPoul-Henning Kamp2004-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. Notes: svn path=/head/; revision=136680
* Add a couple of XXX comments and fix a couple of fine points.Poul-Henning Kamp2004-10-121-2/+14
| | | | | | | I have not tried to make this a "canonical tty driver". Notes: svn path=/head/; revision=136454
* Instead of "OpenFirmware", "openfirmware", etc. use the official spellingMarius Strobl2004-08-165-12/+12
| | | | | | | | | "Open Firmware" from IEEE 1275 and OpenFirmware.org (no pun intended). Ok'ed by: tmm Notes: svn path=/head/; revision=133862
* - Introduce an ofw_bus kobj-interface for retrieving the OFW node and aMarius Strobl2004-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 Notes: svn path=/head/; revision=133589
* Fix problems with the OFW console which happen when the system goesGarance A Drosehn2004-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 Notes: svn path=/head/; revision=133096
* Preparation commit for the tty cleanups that will follow in the nearPoul-Henning Kamp2004-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. Notes: svn path=/head/; revision=132226
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPPoul-Henning Kamp2004-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". Notes: svn path=/head/; revision=132199
* Update for the KDB framework:Marcel Moolenaar2004-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(). Notes: svn path=/head/; revision=131916
* - set resid correctly so that a failed seek (e.g. end of file) returnsPeter Grehan2004-06-251-1/+3
| | | | | | | | correctly - included required <sys/module.h> Notes: svn path=/head/; revision=131103
* Better OFW console support on Sun Ultra2 machines.David E. O'Brien2004-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> Notes: svn path=/head/; revision=131016
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-163-9/+9
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Remove second <sys/cdefs.h> and __FBSDID.Marius Strobl2004-06-101-3/+0
| | | | Notes: svn path=/head/; revision=130323
* Machine generated patch which changes linedisc calls from accessingPoul-Henning Kamp2004-06-041-3/+3
| | | | | | | | | linesw[] directly to using the ttyld...() functions The ttyld...() functions ar inline so there is no performance hit. Notes: svn path=/head/; revision=130077
* Gainfully employ the new ttyioctl in the trivial cases.Poul-Henning Kamp2004-06-011-28/+0
| | | | Notes: svn path=/head/; revision=129944
* - Rearrange a comment to fit in 80 chars per line, like the rest of thisMarius Strobl2004-05-221-4/+4
| | | | | | | | file. - Remove a superfluous ';'. Notes: svn path=/head/; revision=129588
* - Move OFW_NAME_MAX, used as a limit for OFW property names and deviceMarius Strobl2004-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 Notes: svn path=/head/; revision=129587
* Remove advertising clause from University of California Regent'sWarner Losh2004-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 Notes: svn path=/head/; revision=128019
* Device megapatch 4/6:Poul-Henning Kamp2004-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. Notes: svn path=/head/; revision=126080
* Device megapatch 3/6:Poul-Henning Kamp2004-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. Notes: svn path=/head/; revision=126078
* Device megapatch 1/6:Poul-Henning Kamp2004-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. Notes: svn path=/head/; revision=126076
* Change the disk(9) API in order to make device removal more robust.Poul-Henning Kamp2004-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. Notes: svn path=/head/; revision=125975
* - add an identify method, since the disk device used to be pickedPeter Grehan2004-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 Notes: svn path=/head/; revision=125435
* - The last change conflicted with disks on a live system, as opposed toPeter Grehan2003-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. Notes: svn path=/head/; revision=123543
* - accept device_type of "block", which is how psim/gdb6.0 definesPeter Grehan2003-12-121-7/+2
| | | | | | | | disks. continue to accept "disk" for psim/gdb5.x users. - remove unneeded ofwd_identify Notes: svn path=/head/; revision=123490
* Use bio_offset instead of bio_blknoPoul-Henning Kamp2003-10-181-2/+1
| | | | Notes: svn path=/head/; revision=121209
* Only create the ofwcons device nodes if it has been initialized, notJake Burkholder2003-09-281-1/+2
| | | | | | | just probed. Notes: svn path=/head/; revision=120544
* Make ofw_console a low priority console device, so that uart will beJake Burkholder2003-09-281-1/+1
| | | | | | | preferred in all cases, even if the "remote" bit is not set. Notes: svn path=/head/; revision=120542
* The present defaults for the open and close for device drivers whichPoul-Henning Kamp2003-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. Notes: svn path=/head/; revision=120506
* OK, I messed up /dev/console with what I had hoped would be compatPoul-Henning Kamp2003-09-261-4/+4
| | | | | | | code. Convert remaining console drivers and hope for the best. Notes: svn path=/head/; revision=120491
* Initialize the cn_name instead of the cn_devPoul-Henning Kamp2003-09-261-1/+2
| | | | Notes: svn path=/head/; revision=120467
* Use __FBSDID().David E. O'Brien2003-08-245-4/+15
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* Add a solaris compatible ofw interface for third party software thatJake Burkholder2003-06-192-0/+264
| | | | | | | | | | expects one to use. Only the functions used by XFree86 are actually implemented. Glanced at by: tmm Notes: svn path=/head/; revision=116551
* - Add an OFIOCGETPROPLEN ioctl() to get the length of a property.Thomas Moestl2003-06-112-13/+12
| | | | | | | | - Do not use a fixed major. - Minor cleanups. Notes: svn path=/head/; revision=116210
* Implement OF_interpret.Jake Burkholder2003-06-072-2/+34
| | | | | | | Obtained from: netbsd Notes: svn path=/head/; revision=115973
* Use __FBSDID rather than rcsid[].David E. O'Brien2003-04-031-4/+2
| | | | Notes: svn path=/head/; revision=113038
* <sys/disk.h> -> <geom/geom_disk.h>Dag-Erling Smørgrav2003-04-031-1/+1
| | | | Notes: svn path=/head/; revision=113020
* Centralize the devstat handling for all GEOM disk device driversPoul-Henning Kamp2003-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. Notes: svn path=/head/; revision=111979
* Gigacommit to improve device-driver source compatibility betweenPoul-Henning Kamp2003-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) Notes: svn path=/head/; revision=111815
* NO_GEOM cleanup:Poul-Henning Kamp2003-02-231-91/+27
| | | | | | | | | Move to "struct disk *" centered API. Fix some minor nits. Notes: svn path=/head/; revision=111340
* Change the console interface to pass a "struct consdev *" instead of aPoul-Henning Kamp2003-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. Notes: svn path=/head/; revision=111194
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-192-4/+4
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Implement the ALT_BREAK_TO_DEBUGGER option for the ofw console. This is veryHartmut Brandt2003-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) Notes: svn path=/head/; revision=110509
* Change ofwcons to use the output-device property from the firmware for theJake Burkholder2003-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 Notes: svn path=/head/; revision=109921
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-212-4/+4
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Create the ofwcons device at SI_SUB_CONFIGURE instead of SI_SUB_DRIVERS,Jake Burkholder2002-11-181-5/+14
| | | | | | | | | 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. Notes: svn path=/head/; revision=107044
* Add a pseudo device which allows to access the OpenFirmware device treeThomas Moestl2002-10-182-0/+389
| | | | | | | | via ioctl()s. This was ported from NetBSD and adapted a bit to better match our OpenFirmware support code. Notes: svn path=/head/; revision=105398
* Add an #ifdef _KERNEL to make it possible to include this file fromThomas Moestl2002-10-181-5/+7
| | | | | | | userland (to get the typedefs). Notes: svn path=/head/; revision=105397