1cardbus(4) File Formats cardbus(4)
2
3
4
6 cardbus - configuration files for cardbus device drivers
7
9 The CardBus bus share the same configuration parameters with the PCI
10 bus. CardBus devices are self-identifying, which means that these
11 devices provide configuration parameters to the system that allow the
12 system to identify the device and its driver. The configuration parame‐
13 ters are represented in the form of name-value pairs that can be
14 retrieved using the DDI property interfaces. See ddi_prop_lookup(9F)
15 for details.
16
17
18 The CardBus bus properties of CardBus devices are derived from PCI con‐
19 figuration space. Therefore, driver configuration files are not neces‐
20 sary for these devices.
21
22
23 On some occasions, drivers for CardBus devices can use driver configu‐
24 ration files to provide driver private properties through the global
25 property mechanism. See driver.conf(4) for further details. Driver con‐
26 figuration files can also be used to augment or override properties for
27 a specific instance of a driver.
28
29
30 The CardBus nexus driver recognizes the following properties:
31
32 reg An arbitrary length array where each element of the array
33 consists of a 5-tuple of 32-bit values. Each array ele‐
34 ment describes a logically contiguous mappable resource
35 on the PCI bus.
36
37 The first three values in the 5-tuple describe the PCI
38 address of the mappable resource. The first tuple con‐
39 tains the following information:
40
41
42
43
44 Bits 0 - 7 8-bit register number
45 Bits 8 - 10 3-bit function number
46 Bits 11 - 15 5-bit device number
47 Bits 16 - 23 8-bit bus number
48 Bits 24 - 25 2-bit address space type identifier
49 Bits 31 - 28 Register number extended bits 8:11
50 for extended config space. Zero for
51 conventional configuration space.
52
53 The address space type identifier can be interpreted as
54 follows:
55
56
57
58
59 0x0 configuration space
60 0x1 I/O space
61 0x2 32-bit memory space address
62
63 The bus number is a unique identifying number assigned to
64 each bus within the PCI or PCIe domain.
65
66 The device number is a unique identifying number assigned
67 to each device on a PCI bus, PCIe logical bus, or CardBus
68 bus. A device number is unique only within the set of
69 device numbers for a particular bus or logical bus.
70
71 Each CardBus device can have one to eight logically inde‐
72 pendent functions, each with its own independent set of
73 configuration registers. Each function on a device is
74 assigned a function number. For a device with only one
75 function, the function number must be 0.
76
77 The register number fields select a particular register
78 within the set of configuration registers corresponding
79 to the selected function. When the address space type
80 identifier indicates configuration space, non-zero regis‐
81 ter number extended bits select registers in extended
82 configuration space.
83
84 The second and third values in the reg property 5-tuple
85 specify the 64-bit address of the mappable resource
86 within the PCI or PCIe address domain. Since the CardBus
87 is a 32-bit bus, the second 32-bit tuple is not used. The
88 third 32-bit tuple corresponds to the 32-bit address.
89
90 The fourth and fifth 32-bit values in the 5-tuple reg
91 property specify the size of the mappable resource. The
92 size is a 64-bit value. Since it's a 32-bit bus, only the
93 fifth tuple is used.
94
95 The driver can refer to the elements of this array by
96 index, and construct kernel mappings to these addresses
97 using ddi_regs_map_setup(9F). The index into the array is
98 passed as the rnumber argument of ddi_regs_map_setup(9F).
99
100 At a high-level interrupt context, you can use the
101 ddi_get* and ddi_put* family of functions to access I/O
102 and memory space. However, access to configuration space
103 is not allowed when running at a high-interrupt level.
104
105
106 interrupts This property consists of a single-integer element array.
107 Valid interrupt property values are 1, 2, 3, and 4. This
108 value is derived directly from the contents of the
109 device's configuration-interrupt-pin register.
110
111 A driver should use an index value of 0 when registering
112 its interrupt handler with the DDI interrupt interfaces.
113
114
115
116 All CardBus devices support the reg property. The device number and
117 function number as derived from the reg property are used to construct
118 the address part of the device name under /devices.
119
120
121 Only devices that generate interrupts support an interrupts property.
122
123
124 Occasionally it might be necessary to override or augment the configu‐
125 ration information supplied by a CardBus device. This change can be
126 achieved by writing a driver configuration file that describes a proto‐
127 type device node specification containing the additional properties
128 required.
129
130
131 For the system to merge the prototype node specification into an actual
132 device node, certain conditions must be met.
133
134 o First, the name property must be identical. The value of the
135 name property needs to match the binding name of the device.
136 The binding name is the name chosen by the system to bind a
137 driver to a device and is either an alias associated with
138 the driver or the hardware node name of the device.
139
140 o Second, the parent property must identify the PCI bus or
141 PCIe logical bus.
142
143 o Third, the unit-address property must identify the card. The
144 format of the unit-address property is:
145
146
147 DD[,F]
148
149
150 where DD is the device number and F is the function number. If the
151 function number is 0, only DD is specified.
152
154 Example 1 Sample Configuration File
155
156
157 An example configuration file called ACME,scsi-hba.conf for a CardBus
158 device driver called ACME,scsi-hba follows:
159
160
161 #
162 # Copyright (c) 1995, ACME SCSI Host Bus Adaptor
163 # ident "@(#)ACME,scsi-hba.conf 1.1 96/02/04"
164 name="ACME,scsi-hba" parent="/pci@1,0/pci@1f,4000"
165 unit-address="3" scsi-initiator-id=6;
166 hba-advanced-mode="on";
167 hba-dma-speed=10;
168
169
170
171
172 In this example, a property scsi-initiator-id specifies the SCSI bus
173 initiator id that the adapter should use, for just one particular
174 instance of adapter installed in the machine. The name property identi‐
175 fies the driver and the parent property to identify the particular bus
176 the card is plugged into. This example uses the parent's full path name
177 to identify the bus. The unit-address property identifies the card
178 itself, with device number of 3 and function number of 0.
179
180
181
182 Two global driver properties are also created: hba-advanced-mode (which
183 has the string value on) and hba-dma-speed (which has the value 10 M
184 bit/s). These properties apply to all device nodes of the ACME,scsi-
185 hba.
186
187
189 See attributes(5) for descriptions of the following attributes:
190
191
192
193
194 ┌─────────────────────────────┬─────────────────────────────┐
195 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
196 ├─────────────────────────────┼─────────────────────────────┤
197 │Architecture │SPARC, x86 │
198 └─────────────────────────────┴─────────────────────────────┘
199
201 driver.conf(4), attributes(5), ddi_intr_add_handler(9F),
202 ddi_prop_lookup(9F), ddi_regs_map_setup(9F)
203
204
205 Writing Device Drivers
206
207
208 IEEE 1275 PCI Bus Binding
209
210
211
212SunOS 5.11 11 July 2006 cardbus(4)