1cfgadm_sdcard(1M) System Administration Commands cfgadm_sdcard(1M)
2
3
4
6 cfgadm_sdcard - SD/MMC hardware-specific commands for cfgadm
7
9 /usr/sbin/cfgadm [-f] [-y | -n] [-o hardware_options]
10 -c function ap_id[...]
11
12
13 /usr/sbin/cfgadm [-f] [-y | -n] [-o hardware_options]
14 -c hardware_function ap_id[...]
15
16
17 /usr/sbin/cfgadm [-v] [-a] [-s listing_options]
18 [-o hardware_options] [-l [ap_id | ap_type[...]]]
19
20
21 /usr/sbin/cfgadm [-v] [-o hardware_options] -h [ap_id[...]]
22
23
25 The Secure Digital (SD) and MultiMediaCard (MMC) hardware specific
26 library, /usr/lib/cfgadm/sdcard.so.1, provides the functionality for
27 SD/MMC hot-plugging through the cfgadm(1M) command. The cfgadm command
28 operates on attachment points, which are locations in the system where
29 hardware resources can be dynamically reconfigured. See cfgadm(1M)
30 for information on attachment points.
31
32
33 Each SD/MMC slot is represented by an attachment point in the device
34 tree. Card devices that are connected and configured in the system are
35 shown as attachment point name extensions. The terms "attachment point"
36 and "SD/MMC slot" are used interchangeably throughout this manpage.
37
38
39 Attachment points are named through ap_ids. All SD/MMC attachment
40 points consist of a string in the following form:
41
42 sdcardX/[S][::dsk/cXtYd0]
43
44
45
46 Where:
47
48
49 X is the SD/MMC controller number.
50
51
52 S is the slot number on the controller (0 to 8).
53
54
55 dev/cXtYd0 identifies the inserted memory card.
56
57
58 Y is a target number.
59
60
61 In general, the device identifier is derived from the corresponding
62 logical link for the device in /dev. Because only one LUN (LUN 0) is
63 supported by the SD/MMC device, the "d" component of the device string
64 will always have number 0 (zero). For example, the logical ap_id of
65 slot 4 of SD/MMC controller 2 would be sdcard2/4. If the SD/MMC media
66 card is inserted in this attachment point and the device is configured,
67 the ap_id might be sdcard2/4::dsk/c2t0d0.
68
69
70 The cXtYd0 string identifying a device has one-to-one correspondence
71 to the device attachment point.
72
73
74 A simple listing of attachment points in the system includes all SD/MMC
75 device slots and attached devices. For example:
76
77 #cfgadm -l
78 Ap_Id Type Receptacle Occupant Condition
79 sdcard0/0::dev/c2t0d0 sdcard connected configured ok
80 sata0/1::dev/c0t1d0 disk connected configured ok
81 sata0/2::dev/c0t2d0 cd-dvd connected configured ok
82 sata0/3 sata-port empty unconfigured ok
83 usb0/1 unknown empty unconfigured ok
84 usb0/2 unknown empty unconfigured ok
85
86
87
88 See cfgadm(1M) for more information regarding listing of attachment
89 points.
90
91
92 The receptacle state for an attachment point at the SD/MMC slot has
93 the following meanings:
94
95 empty
96
97 The SD/MMC slot is powered-on and enabled. No device presence was
98 detected for this slot.
99
100
101 disconnected
102
103 The SD/MMC slot is not enabled, or the SD/MMC device presence was
104 detected but no communication with the device was established, or
105 the slot has failed.
106
107
108 connected
109
110 The SD/MMC device is detected in the slot and device communication
111 is established.
112
113
114
115 The occupant (device inserted in the SD/MMC slot) state has the follow‐
116 ing meanings:
117
118 configured
119
120 The attached SD/MMC device is configured and ready to use by the
121 operating system.
122
123
124 unconfigured
125
126 No device is attached, or the SD/MMC device inserted in the SD/MMC
127 slot is not yet configured. To configure, run
128 the command cfgadm -c configure ap_id.
129
130
131
132 The attachment point (SD/MMC slot) condition has the following mean‐
133 ings:
134
135 ok
136
137 The SD/MMC slot is powered-on, enabled and ready for use.
138
139
140 failed
141
142 The SD/MMC slot failed. It may be disabled and/or powered-off by
143 the system. It is unusable and its condition is
144 unknown. The failure may be due to the device inserted in the
145 slot.
146
147
148 unknown
149
150 The SD/MMC slot is disabled and its condition is unknown.
151
152
154 The cfgadm command defines several types of operations besides listing
155 (-l). These operations include invoking configuration state changes
156 (-c), invoking hardware specific functions (-x), and obtaining con‐
157 figuration administration help messages (-h).
158
159
160 -c: For SD/MMC slot attachment points, the following configuration
161 state change operations are supported:
162
163 connect
164
165 Enable (activate) the SD/MMC slot and establish the communication
166 with an attached device. This operation implies powering-on the
167 slot if necessary.
168
169
170 disconnect
171
172 Unconfigure the inserted device if it is not already unconfigured
173 and disable (deactivate) the SD/MMC slot. A subsequent "connect"
174 command enables SD/MMC slot operation but does not bring a device
175 to the "configured" state.
176
177
178
179 The following state change operations are supported for an SD/MMC card
180 inserted in to the SD/MMC slot:
181
182 configure
183
184 Configure new device for use by the operating system if it is
185 not already configured. This command also implies connect opera‐
186 tion, if necessary.
187
188
189 unconfigure
190
191 Unconfigure the device inserted in the SD/MMC slot if it is not
192 already unconfigured.
193
194
195
196 -f : Not supported.
197
198
199 -h ap_id: SD/MMC specific help can be obtained by using the help
200 option with any SD/MMC attachment point.
201
202
203 -l [-v]: The -l option works as described in cfgadm(1M). When
204 paired with the -v option, the "Information" field contains the fol‐
205 lowing SD/MMC-specific information:
206 Mod: product model string
207 Rev: product revision number (major.minor)
208 Date: month and year of manufacture
209 SN: product serial number (hexadecimal)
210
211
212 -o hardware_options — No hardware specific options are currently
213 defined.
214
215
216 -s listing_options: Attachment points of class SD/MMC can be listed by
217 using the select suboption. See cfgadm(1M).
218
219
220 -t ap_id: Self-test functionality. Not supported by SD/MMC slots.
221
222
223 -x hardware_function: Perform hardware specific function.
224 sdcard_reset_slot ap_idindicates reset of the SD/MMC slot specified by
225 ap_id. If an SD/MMC device is inserted in the slot, it is also reset.
226
227
228 -v: Execute in verbose mode.
229
231 Example 1 - Configuring an SD/MMC card:
232
233
234 The following command configures a card attached to SD/MMC controller
235 0, slot 0. It should be issued only when there is a device inserted in
236 the SD/MMC slot.
237
238 # cfgadm -c configure sdcard0/0
239
240
241
242 Example 2 - Unconfiguring an SD/MMC card:
243
244
245 The following command unconfigures a card inserted in SD/MMC controller
246 0, slot 3:
247
248 # cfgadm -c unconfigure sdcard0/3
249
250
251
252 Example 3 — Encountering a mounted file system while unconfiguring a
253 disk:
254
255
256 The following command illustrates encountering a mounted file system
257 while unconfiguring a disk:
258
259 # cfgadm -c unconfigure sdcard1/5::dsk/c01t35d0
260
261
262
263
264
265 The system responds with the following:
266
267 cfgadm: Component system is busy, try again: failed to offline:
268 /devices/pci@0,0/pci8086,244e@1e/pci1095,3124@1/sd@5,0
269 Resource Information
270 ------------------ --------------------------
271 /dev/dsk/c1t5d0s0 mounted filesystem "/mnt"
272
273
275 /usr/lib/cfgadm/sdcard.so.1
276
277 Hardware specific library for generic SD/MMC hot plugging.
278
279
281 See attributes(5) for descriptions of the following attributes:
282
283
284
285
286 ┌─────────────────────────────┬─────────────────────────────┐
287 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
288 ├─────────────────────────────┼─────────────────────────────┤
289 │Availability │SUNWcsl │
290 └─────────────────────────────┴─────────────────────────────┘
291
293 cfgadm(1M), config_admin(3CFGADM), libcfgadm(3LIB), attributes(5),
294 sda(7D), sdcard(7D), sdhost(7D)
295
297 Under normal operation, SD/MMC media cards are automatically configured
298 when a card is inserted. Most administrators do not find it necessary
299 to use this command under normal use.
300
301
302 Removing an SD/MMC card without first unconfiguring it may result in
303 data loss if the device is being written to when it's being removed.
304 Devices that are mounted read-only can be safely removed at any time.
305
306
307 Devices that have filesystems other than pcfs(7FS) on them should
308 always be explicitly unconfigured before removal.
309
310
311
312SunOS 5.11 28 Feb 2008 cfgadm_sdcard(1M)