This document is a voluntary-use recommended practice of the Open Firmware Working Group. The Open Firmware Working Group is an ad hoc committee composed of individuals interested in Open Firmware as defined by IEEE 1275-1994, related standards, and their application to various computer systems.
The Open Firmware Working Group is involved both in IEEE sanctioned standards activities, whose final results are published by IEEE, and in informal recommendations such as this, which are published on the Internet at:
http://playground.sun.com/1275/
Membership in the Open Firmware Working Group is open to all interested parties. The working group meets at regular intervals at various locations. For more information send email to:
p1275-wg@risc.sps.mot.com
Last Changed: 01/05/97 by R. T. Coffin, Technical Editor
Table 1. Revision History --------------------------------------------------------------------------------------------------- Version Date History --------------------------------------------------------------------------------------------------- Revision 0.1 04-05-95 Initial draft, split from the original PReP binding. Revision 0.2 07-05-95 Made some editorial changes. Added aliases node properties. Revision 0.3 08/17/95 Added Sections `Control Sequences for Common Special Keys', `Additional Requirements for SCSI Devices', and `Additional Requirements for Block and Byte Devices. Revision 0.4 11/09/95 Changed NVRAM `open' and `close' methods verbiage. Added require ments for SCSI Devices; properties and methods. Revision 0.5 02/26/96 Changed format for Device Support Extension binding; added `Trademarks', `Revision History' Sections plus `Table-of-Contents'. Modified Sound Device for common data format support. Added NVRAM `size' property and meth od. Revision 0.6 03/11/96 Changed NVRAM Note in Section 7.2 and the differential property definition in Section 9.1. Made several editorial changes. Revision 0.7 08/06/96 Changed document format from binding to recommended practice. Removed keyboard language-specific layout section and device methods scan-codes. Added Serial Device Section 8.0. Changed SCSI to SCSI-2, Section 10.0. Revision 0.8 09/23/96 Moved Section 3.3, keyboard 'abort key sequence', to keyboard/mouse binding. Included proposal #350 to rewrite the "sound" Section, Section 6.0. Removed all properties except the "device_type" for the "serial" device section 8.0. Added new Section 9.0, "network" device. Revision 1.0 01/03/97 Made Version 1.0 an Approved Version. Changed Section 9.2, network device methods, to define optional parameters ---------------------------------------------------------------------------------------------------
"device_type" S
Standard property name to define the device's implemented interface.
The meaning of this property is as defined in the Open Firmware core document [1]. The value for nodes described by this specification shall be "keyboard".
"language" S
property name, that indicates the current scan-code to character conversion.
prop-encoded-string: a string, as encoded with encode-string.
The string indicates the current scan-code to character conversion, based upon the language's keyboard layout. This value indicates the language (i.e., keyboard layout scan-code conversion) to which the keyboard driver is currently set.
---------------------------------------------- Sequence Key Sequence Key legend legend ---------------------------------------------- CSI(a) A up arrow CSI @ insert CSI B down arrow CSI P delete(b) CSI C right arrow CSI K end CSI D left arrow CSI ? page-up CSI H home CSI / page-down CSI O(c) P function 1 CSI O q function 7 CSI O Q function 2 CSI O r function 8 CSI O w function 3 CSI O p function 9 CSI O x function 4 CSI O M function 10 CSI O t function 5 CSI O A function 11 CSI O u function 6 CSI O B function 12 ----------------------------------------------
"device_type" S
Standard property name to define the device's implemented interface.
The meaning of this property is as defined in the Open Firmware core document. The value for nodes described by this specification shall be "mouse".
"#buttons" S
property name, that indicates the number of physical buttons supported by the device.
prop-encoded-int: an integer, as encoded with encode-int.
The property value is an integer that indicates the number of buttons for the pointing device. This property can be used to interpret the buttons value returned by the get-event method.
"absolute-position" S
property name, that indicates the device supplies absolute X,Y coordinates.
prop-encoded-array: <none>
The presence of this property indicates that the device supplies absolute X,Y coordinates (e.g., a graphics tablet). Absence of this property indicates that the device supplies relative X,Y position (e.g., a mouse).
NKNOWN>
get-event ( msec -- pos.x pos.y buttons true|false ) M
This method is used to obtain the next event of the pointing device. msecs is the number of milliseconds to wait for an event before reporting failure; a value of zero (0) implies wait until event pos.x, pos.y return the positioning
information. The pos.x and pos.y values can be interpreted as unsigned or signed
depending upon the presence or absence of the "absolute-position" property. The value for pos.x increases moving to the right direction and the value for pos.y increases
moving in a downward direction. buttons returns a bit-mask (in the low-order bits) representing any buttons that are pressed; the number of significant bits to examine is defined by the "#buttons" property. The top stack result indicates whether
an event was detected within the timeout period.
"device_type" S
Standard property name to define the device's implemented interface.
The meaning of this property is as defined in the Open Firmware core document. The value for nodes described by this specification shall be "rtc".
get-time ( -- n1 n2 n3 n4 n5 n6 ) M
Return the current time as the integers n1 - n6, where n1 is the second {0 - 59}, n2 is the minute {0 - 59}, n3 is the hour {0 - 23}, n4 is the day {1 - 31}, n5 is the month {1 - 12}, and n6 is the year (e.g., 1994).
set-time ( n1 n2 n3 n4 n5 n6 -- ) M
Set the current time from the integers n1 - n6, where n1 is the second {0 - 59}, n2 is the minute {0 - 59}, n3 is the hour {0 - 23}, n4 is the day {1 - 31}, n5 is the month {1 - 12}, and n6 is the year (e.g., 1994).
Note 1: Some implementation of "sound" nodes may need to convert this data into a form acceptable to the audio hardware being supported. It is not anticipated that this is an unreasonable requirement.
Note 2: An implementation may choose to supply additional properties, methods and open arguments so as to support more advanced audio capabilities, so long as a default open results in read and write using the standard format.
"device_type" S
Standard property name to define the device's implemented interface.
The meaning of this property is as defined in the Open Firmware core document. The value for nodes described by this specification shall be "sound".
"#input-channels" S
property name, defines the possible numbers of input channels supported.
prop-encoded-array: Arbitrary number of integers, each encoded with encode-int.
"#output-channels" S
property name, defines the possible numbers of output channels supported.
prop-encoded-array: Arbitrary number of integers, each encoded with encode-int.
"sample-precisions" S
property name, defines the possible sample precisions.
prop-encoded-array: Arbitrary number of integers, each encoded with encode-int.
Specifies the possible numbers of bits required to store one audio sample from one channel.
"sample-frame-size" S
property name defines the possible sample frame sizes.
prop-encoded-array: Arbitrary number of integers, each encoded with encode-int.
Specifies the possible numbers of bits required to store one sample frame - one sample from each channel.
"input-frame-rates" S
property name, defines the possible sample frame rates for audio input.
prop-encoded-array: Arbitrary number of integers, each encoded with encode-int.
Specifies the possible input sampling rates, in sample frames per second.
"output-frame-rates" S
property name, defines the possible sample frame rates for audio output.
prop-encoded-array: Arbitrary number of integers, each encoded with encode-int.
Specifies the possible output sampling rates, in sample frames per second.
"input-encoding-types" S
property name, defines the possible input encoding types.
prop-encoded-array: The concatenation, with encode+, of an arbitrary number of text strings, each encoded with encode-string.
Specifies possible input encodings. Valid values include:
"8bit-u-law"
"8bit-A-law"
"8bit-unsigned-linear"
"8bit-signed-linear"
"16bit-LE-unsigned-linear"
"16bit-BE-unsigned-linear"
"16bit-LE-signed-linear"
"16bit-BE-signed-linear"
"4bit-ADPCM"
"output-encoding-types" S
property name, defines the possible output encoding types.
prop-encoded-array: The concatenation, with encode+, of an arbitrary number of text strings, each encoded with encode-string.
Specifies possible output encodings. Valid values are as for "input-encoding-types".
open ( -- true | false ) M
This standard method prepares the "sound" device for subsequent reads and/or writes.
close ( -- ) M
Standard Open Firmware behavior.
read ( addr size -- actual ) M
Acquire sound data, storing the samples at addr.
write ( addr size -- actual ) M
Output sound samples stored at addr.
"device_type" S
Standard property name to define the device's implemented interface.
The meaning of this property is as defined in the Open Firmware core document. The value for nodes described by this specification shall be "nvram".
"#bytes" S
property name, describes the number of bytes the device is capable of storing.
prop-encoded array: An integer, encoded as with encode-int.
The value is the number of bytes for the physical device. Typical values could be 4K, 8K, 16K or 32K bytes.
read ( addr len -- actual ) M
write ( addr len -- actual ) M
seek ( pos.lo pos.hi -- status ) M
size ( -- size ) M
The returned value, size, is the number of NVRAM bytes available to the client interface.
The following methods have additional behavior depending upon the argument used to open the device.
open ( -- true | false ) M
Standard method used to initiate access to the device
close ( -- ) M
Standard Open Firmware behavior
"device_type" S
Standard property name to define the device's implemented interface.
The meaning of this property is as defined in the Open Firmware core document [1]. The value for nodes described by this specification shall be "serial".
------------- char meaning ------------- n none e even o odd m mark s space -------------stop bits:
---------------- char meaning ---------------- 1 1 stop bit . 1.5 stop bits 2 2 stop bits ----------------handshake:
-------------------------- char meaning -------------------------- - none h hardware (RTS/CTS) s software (XON/XOFF) --------------------------
set-mode ( adr len -- ) M
Sets the device mode according to the string at adr, of length len, which is interpreted the same as the arguments to the open method (see section 8.2.1.1. on page 9).
set-modem-control ( bitmask -- ) M
Sets the device's modem control lines according to the following table:
---------------------------- bitmask Modem control state ---------------------------- 0 RTS off, DTR off 1 RTS off, DTR on 2 RTS on, DTR off 3 RTS on, DTR on ----------------------------The response for other values of bitmask are implementation dependent.
"device_type" S
Standard property name to define the device's implemented interface.
The meaning of this property is as defined in the Open Firmware core document. The value for nodes described by this specification shall be "network".
"supported-network-types" S
property name, reports possible types of "network" the device can support.
prop-encoded-array: a string, as encoded with encode-sting.
The string is chosen from the following set representing <network type>, <speed (Mbps)>, <connector type> and <duplex mode>:
"ethernet,10,rj45,half"
"ethernet,10,rj45,full"
"ethernet,100,rj45,half"
"ethernet,100,rj45,full"
"ethernet,10,aui,half"
"ethernet,10,aui,full"
"ethernet,100,aui,half"
"ethernet,100,aui,full"
"ethernet,10,bnc,half"
"ethernet,10,bnc,full"
"ethernet,100,bnc,half"
"ethernet,100,bnc,full"
"token-ring,4,rj45,half"
"token-ring,4,rj45,full"
"token-ring,16,rj45,half"
"token-ring,16,rj45,full"
"token-ring,4,9pin,half"
"token-ring,4,9pin,full"
"token-ring,16,9pin,half"
"token-ring,16,9pin,full"
"fddi,100,rj45,half"
"fddi,100,sc,half"
"fddi,100,mic,half"
"atm,100,sc,full"
"atm,155,sc,full"
"atm,622,sc,full"
"fcs,1000,sc,full"
"chosen-network-type" S
property name, reports type of "network" this device is supporting.
prop-encoded-array: a string, as encoded with encode-string, that is chosen from one of the values in "supported-network-types" property.
If present, indicates that the firmware or the user has selected one of the "supported-network-types" and the value indicates which one was chosen. The "chosen-network-type" property need not exist if the firmware cannot determine
the "network" type or there is only a single "network" type choice.
promiscuous puts network device in a mode where all addresses are
recognized; e.g., a communication device that snoops the LAN.
speed=n where n indicates the "network" speed in Mbps. Typical
values can be 4, 10, 16, 100, 155, 622 & 1000 Mbps.
duplex=mode where mode values are "half" or "full".
obp-tftp parameters - Reference [6] for additional information.
The device arguments, promiscuous, speed and duplex are optional and may be in any order, but a recommended order is as shown. These three parameters must be the first parameters.
The obp-tftp parameters siaddr, filename, ciaddr, giaddr, bootp-retries, tftp-retries are optional. If any of these parameters are present, then the bootp parameter shall be present and precede the other parameters.
The open method for the network device could have the following parameters, including passing through ones for the obp-tftp package open method:
open network-device:[promiscuous,][speed=n,]
[duplex=mode,][bootp],[siaddr],[filename],[ciaddr],
[giaddr],[bootp-retries],[tftp-retries]
Network device open method parameter examples:
open network-device: promiscuous,speed=100,duplex=full,bootp,
siaddr,filename,ciaddr,giaddr,bootp-retries,tftp-retries
open network-device: duplex=half,,,,,bootp-retries
open network-device: promiscuous,bootp,siaddr,,,,,tftp-retries
Note: Comma's are required for missing open method's positional parameters unless they are at the end of a list.
The following is a defined order of operations for the network device FCode. The network device FCode will look at the following items to determine precedence of operations for initialization/configuration:
1) The network device open method parameters; if none present, then,
2) The value of "chosen-network-type" property; if not present, then,
3) The network device will be implementation specific, depending on the
devices capability.
If the open method does not recognize a value for n or mode (speed or duplex mode) parameters or the network device cannot execute the specified value for n or mode, a failure should result (device should
not open) with a warning message to the user.
"device_type" S
Standard property name to define the device's implemented interface.
The meaning of this property is as defined in the Open Firmware core document. The value for nodes described by this specification shall be "parallel".
open ( -- true | false ) M
close ( -- ) M
write ( addr len -- actual ) M
"wide" S
property name, indicates that the SCSI-2 Node is wide.
prop-encode-array: <none>
This property shall be present if the SCSI-2 controller represented by this node is wide, with SCSI-2 ID ranges 0 through 15, and shall be absent otherwise.
In order to support the wide SCSI-2, the example in Appendix E.6.3 of [1] would be amended as follows:
E.6.3 hacom.fth ... : show-children ( -- ) open 0= if ." Can't open SCSI-2 host adapter" cr exit then " wide" get-my-property if 8 else 2drop d# 16 then 0 do i probe-target if ." Target " i . cr 8 0 do i j show-lun loop then loop ;
"differential"
property name, indicates that the SCSI-2 Node supports differential signaling.
prop-encode-array: <none>
This property may be present if the SCSI-2 controller represented by this node supports differential signaling.
"scsi-initiator-id"
property name, indicating the initiator-id to be used for SCSI-2 transfers by this controller.
prop-encode-array: An integer, encoded as with encode-int.
The integer specifies the value of the initiator-id for subsequent transfers by this controller. If the "wide" property is not present the value is in the range of 0..7. If the "wide" property is present the value is in the range
f 0..15. The initial value of the property is implementation dependent.
open ( -- true ) M
In addition to the standard Open Firmware behavior, the open method shall set the host adapter's own selection ID as follows:
Attempt to locate a "scsi-initiator-id" property by executing "get-inherited-property" with the string "scsi-initiator-id" as its argument. If such a property is found, decode its value as with "decode-int", and use the
decoded value as the host adapter's own selection ID. Otherwise, use the value 7.
Note: The use of "get-inherited-property" to get the "scsi-initiator-id" property makes it possible to choose the set of SCSI-2 host adapters to which the property applies. If the property is in the root node, for example, it applies to all the
SCSI host adapters in the system. If the property is elsewhere in the device tree, it applies only to host adapters in the subtree below and including the location of the property.
size ( -- d ) M
Return the size of the device in bytes.
Return, as a double number "d", the number of bytes of storage associated with the device or instance. If the size cannot be determined, return the double number -1.
Packages of device type block and byte shall implement the following method:
#blocks ( -- u ) M
Return the size of the device in blocks.
Return, as an unsigned number "u", the number of blocks of storage associated with the device or instance, where a block is a unit of storage consisting of the number of bytes returned by the package's block-size method. If the siz
cannot be determined, or if the number of blocks exceeds the range of an unsigned number, return the maximum unsigned integer (which, because of Open Firmware's assumption of two's complement arithmetic is equivalent to the signed number -1).
offset-low ( -- u ) M
Returns the least significant cell of the double number denoting the beginning offset of the disk partition that was specified when the disk-label support package was opened. In general that offset is obtained by executing the
offset method of the "disk-label" support package with an argument of zero. It is permissible for the disk package to execute the disk-label
support package's offset method once after opening that support package, storing the result for later us.
offset-high ( -- u ) M
Returns the most significant cell of the double number denoting the beginning offset of the disk partition that was specified when the disk-label support package was opened. In general that offset is obtained by executing the offsetdisk-label support package with an argument of zero. It is permissible for the disk package to execute the disk-label support package's offset method once after opening that support package, storing the result for late
use.