1 '\" te 2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved 3 .\" 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. 4 .\" 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. 5 .\" 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] 6 .TH CFGADM_SDCARD 1M "Feb 28, 2008" 7 .SH NAME 8 cfgadm_sdcard \- SD/MMC hardware-specific commands for cfgadm 9 .SH SYNOPSIS 10 .LP 11 .nf 12 \fB/usr/sbin/cfgadm\fR [\fB-f\fR] [\fB-y\fR | \fB-n\fR] [\fB-o\fR \fIhardware_options\fR] 13 \fB-c\fR \fIfunction\fR \fIap_id\fR[...] 14 .fi 15 16 .LP 17 .nf 18 \fB/usr/sbin/cfgadm\fR [\fB-f\fR] [\fB-y\fR | \fB-n\fR] [\fB-o\fR \fIhardware_options\fR] 19 \fB-c\fR \fIhardware_function\fR \fIap_id\fR[...] 20 .fi 21 22 .LP 23 .nf 24 \fB/usr/sbin/cfgadm\fR [\fB-v\fR] [\fB-a\fR] [\fB-s\fR \fIlisting_options\fR] 25 [\fB-o\fR \fIhardware_options\fR] [\fB-l\fR [\fIap_id\fR | \fIap_type\fR[...]]] 26 .fi 27 28 .LP 29 .nf 30 \fB/usr/sbin/cfgadm\fR [\fB-v\fR] [\fB-o\fR \fIhardware_options\fR] \fB-h\fR [\fIap_id\fR[...]] 31 .fi 32 33 .SH DESCRIPTION 34 .sp 35 .LP 36 The Secure Digital (SD) and MultiMediaCard (MMC) hardware specific library, 37 \fB/usr/lib/cfgadm/sdcard.so.1\fR, provides the functionality for SD/MMC 38 hot-plugging through the \fBcfgadm\fR(1M) command. The \fBcfgadm\fR command 39 operates on attachment points, which are locations in the system where 40 hardware resources can be dynamically reconfigured. See \fBcfgadm\fR(1M) for 41 information on attachment points. 42 .sp 43 .LP 44 Each SD/MMC slot is represented by an attachment point in the device tree. Card 45 devices that are connected and configured in the system are shown as attachment 46 point name extensions. The terms "attachment point" and "SD/MMC slot" are used 47 interchangeably throughout this manpage. 48 .sp 49 .LP 50 Attachment points are named through ap_ids. All SD/MMC attachment points 51 consist of a string in the following form: 52 .sp 53 .in +2 54 .nf 55 sdcardX/[S][::dsk/cXtYd0] 56 .fi 57 .in -2 58 59 .sp 60 .LP 61 Where: 62 .sp 63 .LP 64 \fIX\fR is the SD/MMC controller number. 65 .sp 66 .LP 67 \fIS\fR is the slot number on the controller (0 to 8). 68 .sp 69 .LP 70 \fBdev/cXtYd0\fR identifies the inserted memory card. 71 .sp 72 .LP 73 \fIY\fR is a target number. 74 .sp 75 .LP 76 In general, the device identifier is derived from the corresponding logical 77 link for the device in \fB/dev\fR. Because only one LUN (LUN 0) is supported by 78 the SD/MMC device, the "d" component of the device string will always have 79 number 0 (zero). For example, the logical \fIap_id\fR of slot 4 of SD/MMC 80 controller 2 would be \fBsdcard2/4\fR. If the SD/MMC media card is inserted in 81 this attachment point and the device is configured, the \fBap_id\fR might be 82 \fBsdcard2/4::dsk/c2t0d0\fR. 83 .sp 84 .LP 85 The c\fIX\fRt\fIY\fRd\fI0\fR string identifying a device has one-to-one 86 correspondence to the device attachment point. 87 .sp 88 .LP 89 A simple listing of attachment points in the system includes all SD/MMC device 90 slots and attached devices. For example: 91 .sp 92 .in +2 93 .nf 94 #cfgadm -l 95 Ap_Id Type Receptacle Occupant Condition 96 sdcard0/0::dev/c2t0d0 sdcard connected configured ok 97 sata0/1::dev/c0t1d0 disk connected configured ok 98 sata0/2::dev/c0t2d0 cd-dvd connected configured ok 99 sata0/3 sata-port empty unconfigured ok 100 usb0/1 unknown empty unconfigured ok 101 usb0/2 unknown empty unconfigured ok 102 .fi 103 .in -2 104 105 .sp 106 .LP 107 See \fBcfgadm\fR(1M) for more information regarding listing of attachment 108 points. 109 .sp 110 .LP 111 The receptacle state for an attachment point at the SD/MMC slot has the 112 following meanings: 113 .sp 114 .ne 2 115 .na 116 \fBempty\fR 117 .ad 118 .sp .6 119 .RS 4n 120 The SD/MMC slot is powered-on and enabled. No device presence was detected for 121 this slot. 122 .RE 123 124 .sp 125 .ne 2 126 .na 127 \fBdisconnected\fR 128 .ad 129 .sp .6 130 .RS 4n 131 The SD/MMC slot is not enabled, or the SD/MMC device presence was detected but 132 no communication with the device was established, or the slot has failed. 133 .RE 134 135 .sp 136 .ne 2 137 .na 138 \fBconnected\fR 139 .ad 140 .sp .6 141 .RS 4n 142 The SD/MMC device is detected in the slot and device communication is 143 established. 144 .RE 145 146 .sp 147 .LP 148 The occupant (device inserted in the SD/MMC slot) state has the following 149 meanings: 150 .sp 151 .ne 2 152 .na 153 \fBconfigured\fR 154 .ad 155 .sp .6 156 .RS 4n 157 The attached SD/MMC device is configured and ready to use by the operating 158 system. 159 .RE 160 161 .sp 162 .ne 2 163 .na 164 \fBunconfigured\fR 165 .ad 166 .sp .6 167 .RS 4n 168 No device is attached, or the SD/MMC device inserted in the SD/MMC slot is not 169 yet configured. To configure, run the command \fBcfgadm 170 -c configure ap_id\fR. 171 .RE 172 173 .sp 174 .LP 175 The attachment point (SD/MMC slot) condition has the following meanings: 176 .sp 177 .ne 2 178 .na 179 \fBok\fR 180 .ad 181 .sp .6 182 .RS 4n 183 The SD/MMC slot is powered-on, enabled and ready for use. 184 .RE 185 186 .sp 187 .ne 2 188 .na 189 \fBfailed\fR 190 .ad 191 .sp .6 192 .RS 4n 193 The SD/MMC slot failed. It may be disabled and/or powered-off by the system. It 194 is unusable and its condition is unknown. The failure may be 195 due to the device inserted in the slot. 196 .RE 197 198 .sp 199 .ne 2 200 .na 201 \fBunknown\fR 202 .ad 203 .sp .6 204 .RS 4n 205 The SD/MMC slot is disabled and its condition is unknown. 206 .RE 207 208 .SH OPTIONS 209 .sp 210 .LP 211 The \fBcfgadm\fR command defines several types of operations besides listing 212 (\fB-l\fR). These operations include invoking configuration state changes 213 (\fB-c\fR), invoking hardware specific functions (\fB-x\fR), and obtaining 214 configuration administration help messages (\fB-h\fR). 215 .sp 216 .LP 217 \fB-c\fR: For SD/MMC slot attachment points, the following configuration state 218 change operations are supported: 219 .sp 220 .ne 2 221 .na 222 \fBconnect\fR 223 .ad 224 .sp .6 225 .RS 4n 226 Enable (activate) the SD/MMC slot and establish the communication with an 227 attached device. This operation implies powering-on the slot if necessary. 228 .RE 229 230 .sp 231 .ne 2 232 .na 233 \fBdisconnect\fR 234 .ad 235 .sp .6 236 .RS 4n 237 Unconfigure the inserted device if it is not already unconfigured and disable 238 (deactivate) the SD/MMC slot. A subsequent "connect" command enables SD/MMC 239 slot operation but does not bring a device to the "configured" state. 240 .RE 241 242 .sp 243 .LP 244 The following state change operations are supported for an SD/MMC card inserted 245 in to the SD/MMC slot: 246 .sp 247 .ne 2 248 .na 249 \fBconfigure\fR 250 .ad 251 .sp .6 252 .RS 4n 253 Configure new device for use by the operating system if it is not already 254 configured. This command also implies connect operation, if necessary. 255 .RE 256 257 .sp 258 .ne 2 259 .na 260 \fBunconfigure\fR 261 .ad 262 .sp .6 263 .RS 4n 264 Unconfigure the device inserted in the SD/MMC slot if it is not already 265 unconfigured. 266 .RE 267 268 .sp 269 .LP 270 \fB-f \fR: Not supported. 271 .sp 272 .LP 273 \fB-h\fR \fBap_id\fR: SD/MMC specific help can be obtained by using the help 274 option with any SD/MMC attachment point. 275 .sp 276 .LP 277 \fB-l\fR [-v]: The -l option works as described in \fBcfgadm\fR(1M). When 278 paired with the -v option, the "Information" field contains the following 279 SD/MMC-specific information: 280 .br 281 .in +2 282 Mod: product model string 283 .in -2 284 .br 285 .in +2 286 Rev: product revision number (major.minor) 287 .in -2 288 .br 289 .in +2 290 Date: month and year of manufacture 291 .in -2 292 .br 293 .in +2 294 SN: product serial number (hexadecimal) 295 .in -2 296 .sp 297 .LP 298 \fB-o\fR hardware_options \(em No hardware specific options are currently 299 defined. 300 .sp 301 .LP 302 \fB-s\fR listing_options: Attachment points of class SD/MMC can be listed by 303 using the select suboption. See \fBcfgadm\fR(1M). 304 .sp 305 .LP 306 \fB-t\fR \fBap_id\fR: Self-test functionality. Not supported by SD/MMC slots. 307 .sp 308 .LP 309 \fB-x\fR \fBhardware_function\fR: Perform hardware specific function. 310 sdcard_reset_slot \fBap_id\fRindicates reset of the SD/MMC slot specified by 311 \fBap_id\fR. If an SD/MMC device is inserted in the slot, it is also reset. 312 .sp 313 .LP 314 \fB-v\fR: Execute in verbose mode. 315 .SH EXAMPLES 316 .sp 317 .LP 318 Example 1 - Configuring an SD/MMC card: 319 .sp 320 .LP 321 The following command configures a card attached to SD/MMC controller 0, slot 322 0. It should be issued only when there is a device inserted in the SD/MMC slot. 323 .sp 324 .in +2 325 .nf 326 # cfgadm -c configure sdcard0/0 327 .fi 328 .in -2 329 330 .sp 331 .LP 332 Example 2 - Unconfiguring an SD/MMC card: 333 .sp 334 .LP 335 The following command unconfigures a card inserted in SD/MMC controller 0, slot 336 3: 337 .sp 338 .in +2 339 .nf 340 # cfgadm -c unconfigure sdcard0/3 341 .fi 342 .in -2 343 344 .sp 345 .LP 346 Example 3 \(em Encountering a mounted file system while unconfiguring a disk: 347 .sp 348 .LP 349 The following command illustrates encountering a mounted file system while 350 unconfiguring a disk: 351 .sp 352 .in +2 353 .nf 354 # cfgadm -c unconfigure sdcard1/5::dsk/c01t35d0 355 356 357 .fi 358 .in -2 359 360 .sp 361 .LP 362 The system responds with the following: 363 .sp 364 .in +2 365 .nf 366 cfgadm: Component system is busy, try again: failed to offline: 367 /devices/pci@0,0/pci8086,244e@1e/pci1095,3124@1/sd@5,0 368 Resource Information 369 ------------------ -------------------------- 370 /dev/dsk/c1t5d0s0 mounted filesystem "/mnt" 371 .fi 372 .in -2 373 374 .SH FILES 375 .sp 376 .ne 2 377 .na 378 \fB/usr/lib/cfgadm/sdcard.so.1\fR 379 .ad 380 .sp .6 381 .RS 4n 382 Hardware specific library for generic SD/MMC hot plugging. 383 .RE 384 385 .SH SEE ALSO 386 .sp 387 .LP 388 \fBcfgadm\fR(1M), \fBconfig_admin\fR(3CFGADM), \fBlibcfgadm\fR(3LIB), 389 \fBattributes\fR(5), \fBsda\fR(7D), \fBsdcard\fR(7D), \fBsdhost\fR(7D) 390 .SH NOTES 391 .sp 392 .LP 393 Under normal operation, SD/MMC media cards are automatically configured when a 394 card is inserted. Most administrators do not find it necessary to use this 395 command under normal use. 396 .sp 397 .LP 398 Removing an SD/MMC card without first unconfiguring it may result in data loss 399 if the device is being written to when it's being removed. Devices that are 400 mounted read-only can be safely removed at any time. 401 .sp 402 .LP 403 Devices that have filesystems other than \fBpcfs\fR(7FS) on them should always 404 be explicitly unconfigured before removal.