PageRenderTime 41ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/usr/src/man/man4/sbus.4

https://bitbucket.org/illumos/illumos-gate/
Forth | 189 lines | 180 code | 9 blank | 0 comment | 10 complexity | 4b1387acd4065ed33c7157fc0a2af356 MD5 | raw file
Possible License(s): LGPL-3.0, LGPL-2.0, BSD-3-Clause-No-Nuclear-License-2014, AGPL-1.0, AGPL-3.0, BSD-3-Clause, GPL-3.0, LGPL-2.1, BSD-2-Clause, MPL-2.0-no-copyleft-exception, GPL-2.0, 0BSD
  1. '\" te
  2. .\" Copyright (c) 1999, Sun Microsystems, Inc.
  3. .\" All Rights Reserved
  4. .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
  5. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
  6. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
  7. .TH SBUS 4 "Dec 31, 1996"
  8. .SH NAME
  9. sbus \- configuration files for SBus device drivers
  10. .SH DESCRIPTION
  11. .sp
  12. .LP
  13. The \fBSBus\fR is a geographically addressed peripheral bus present on many
  14. \fBSPARC\fR hardware platforms. \fBSBus\fR devices are \fIself-identifying\fR
  15. \(em that is to say the \fBSBus\fR card itself provides information to the
  16. system so that it can identify the device driver that needs to be used. The
  17. device usually provides additional information to the system in the form of
  18. name-value pairs that can be retrieved using the \fBDDI\fR property interfaces.
  19. See \fBddi_prop_op\fR(9F) for details.
  20. .sp
  21. .LP
  22. The information is usually derived from a small Forth program stored in the
  23. \fBFCode\fR \fBPROM\fR on the card, so driver configuration files should be
  24. completely unnecessary for these devices. However, on some occasions, drivers
  25. for \fBSBus\fR devices may need to use driver configuration files to augment
  26. the information provided by the \fBSBus\fR card. See \fBdriver.conf\fR(4) for
  27. further details.
  28. .sp
  29. .LP
  30. When they are needed, configuration files for \fBSBus\fR device drivers should
  31. identify the parent bus driver implicitly using the \fIclass\fR keyword. This
  32. removes the dependency on the particular bus driver involved since this may be
  33. named differently on different platforms.
  34. .sp
  35. .LP
  36. All bus drivers of class \fBsbus\fR recognise the following properties:
  37. .sp
  38. .ne 2
  39. .na
  40. \fB\fBreg\fR\fR
  41. .ad
  42. .RS 14n
  43. An arbitrary length array where each element of the array consists of a 3-tuple
  44. of integers. Each array element describes a logically contiguous mappable
  45. resource on the \fBSBus.\fR
  46. .sp
  47. The first integer of each tuple specifies the slot number the card is plugged
  48. into. The second integer of each 3-tuple specifies the offset in the slot
  49. address space identified by the first element. The third integer of each
  50. 3-tuple specifies the size in bytes of the mappable resource.
  51. .sp
  52. The driver can refer to the elements of this array by index, and construct
  53. kernel mappings to these addresses using \fBddi_map_regs\fR(9F). The index into
  54. the array is passed as the \fIrnumber\fR argument of \fBddi_map_regs()\fR.
  55. .sp
  56. You can use the \fBddi_get*\fR and \fBddi_put*\fR family of functions to access
  57. register space from a high-level interrupt context.
  58. .RE
  59. .sp
  60. .ne 2
  61. .na
  62. \fB\fBinterrupts\fR\fR
  63. .ad
  64. .RS 14n
  65. An arbitrary length array where each element of the array consists of a single
  66. integer. Each array element describes a possible \fBSBus\fR interrupt level
  67. that the device might generate.
  68. .sp
  69. The driver can refer to the elements of this array by index, and register
  70. interrupt handlers with the system using \fBddi_add_intr\fR(9F). The index into
  71. the array is passed as the \fIinumber\fR argument of \fBddi_add_intr()\fR.
  72. .RE
  73. .sp
  74. .ne 2
  75. .na
  76. \fB\fBregisters\fR\fR
  77. .ad
  78. .RS 14n
  79. An arbitrary length array where each element of the array consists of a 3-tuple
  80. of integers. Each array element describes a logically contiguous mappable
  81. resource on the \fBSBus.\fR
  82. .sp
  83. The first integer of each tuple should be set to \fB\(mi1\fR, specifying that
  84. any SBus slot may be matched. The second integer of each 3-tuple specifies the
  85. offset in the slot address space identified by the first element. The third
  86. integer of each 3-tuple specifies the size in bytes of the mappable resoure.
  87. .sp
  88. The \fBregisters\fR property can only be used to augment an incompletely
  89. specified \fBreg\fR property with information from a driver configuration file.
  90. It may only be specified in a driver configuration file.
  91. .RE
  92. .sp
  93. .LP
  94. All \fBSBus\fR devices must provide \fBreg\fR properties to the system. The
  95. first two integer elements of the \fBreg\fR property are used to construct the
  96. address part of the device name under \fB/devices\fR.
  97. .sp
  98. .LP
  99. Only devices that generate interrupts need to provide \fBinterrupts\fR
  100. properties.
  101. .sp
  102. .LP
  103. Occasionally, it may be necessary to override or augment the configuration
  104. information supplied by the \fBSBus\fR device. This can be achieved by writing
  105. a driver configuration file that describes a prototype device information
  106. (devinfo) node specification, containing the additional properties required.
  107. .sp
  108. .LP
  109. For the system to merge the information, certain conditions must be met. First,
  110. the \fBname\fR property must be the same. Second, either the first two integers
  111. (slot number and offset) of the two \fBreg\fR properties must be the same, or
  112. the second integer (offset) of the \fBreg\fR and \fBregisters\fR properties
  113. must be the same.
  114. .sp
  115. .LP
  116. In the event that the \fBSBus\fR card has no \fBreg\fR property at all, the
  117. self-identifying information cannot be used, so all the details of the card
  118. must be specified in a driver configuration file.
  119. .SH EXAMPLES
  120. .LP
  121. \fBExample 1 \fRA sample configuration file.
  122. .sp
  123. .LP
  124. Here is a configuration file for an \fBSBus\fR card called \fBSUNW,netboard\fR.
  125. The card already has a simple \fBFCode\fR \fBPROM\fR that creates \fBname\fR
  126. and \fBreg\fR properties, and will have a complete set of properties for normal
  127. use once the driver and firmware is complete.
  128. .sp
  129. .LP
  130. In this example, we want to augment the properties given to us by the firmware.
  131. We use the same \fBname\fR property, and use the \fBregisters\fR property to
  132. match the firmware \fBreg\fR property. That way we don't have to worry about
  133. which slot the card is really plugged into.
  134. .sp
  135. .LP
  136. We want to add an \fBinterrupts\fR property while we are developing the
  137. firmware and driver so that we can start to experiment with interrupts. The
  138. device can generate interrupts at \fBSBus\fR level 3. Additionally, we want to
  139. set a \fBdebug-level\fR property to 4.
  140. .sp
  141. .in +2
  142. .nf
  143. #
  144. # Copyright (c) 1992, by Sun Microsystems, Inc.
  145. #ident "@(#)SUNW,netboard.conf 1.4 92/03/10 SMI"
  146. #
  147. name="SUNW,netboard" class="sbus"
  148. registers=-1,0x40000,64,-1,0x80000,1024
  149. interrupts=3 debug-level=4;
  150. .fi
  151. .in -2
  152. .sp
  153. .SH ATTRIBUTES
  154. .sp
  155. .LP
  156. See \fBattributes\fR(5) for descriptions of the following attributes:
  157. .sp
  158. .sp
  159. .TS
  160. box;
  161. c | c
  162. l | l .
  163. ATTRIBUTE TYPE ATTRIBUTE VALUE
  164. _
  165. Architecture SPARC
  166. .TE
  167. .SH SEE ALSO
  168. .sp
  169. .LP
  170. \fBdriver.conf\fR(4), \fBattributes\fR(5), \fBddi_add_intr\fR(9F),
  171. \fBddi_map_regs\fR(9F), \fBddi_prop_op\fR(9F)
  172. .sp
  173. .LP
  174. \fIWriting Device Drivers\fR
  175. .SH WARNINGS
  176. .sp
  177. .LP
  178. The wildcarding mechanism of the \fBregisters\fR property matches every
  179. instance of the particular device attached to the system. This may not always
  180. be what is wanted.