|Skip Navigation Links|
|Exit Print View|
|man pages section 1M: System Administration Commands Oracle Solaris 11 Information Library|
- SD/MMC hardware-specific commands for cfgadm
/usr/sbin/cfgadm [-f] [-y | -n] [-o hardware_options] -c function ap_id[...]
/usr/sbin/cfgadm [-f] [-y | -n] [-o hardware_options] -c hardware_function ap_id[...]
/usr/sbin/cfgadm [-v] [-a] [-s listing_options] [-o hardware_options] [-l [ap_id | ap_type[...]]]
/usr/sbin/cfgadm [-v] [-o hardware_options] -h [ap_id[...]]
The Secure Digital (SD) and MultiMediaCard (MMC) hardware specific library, /usr/lib/cfgadm/sdcard.so.1, provides the functionality for SD/MMC hot-plugging through the cfgadm(1M) command. The cfgadm command operates on attachment points, which are locations in the system where hardware resources can be dynamically reconfigured. See cfgadm(1M) for information on attachment points.
Each SD/MMC slot is represented by an attachment point in the device tree. Card devices that are connected and configured in the system are shown as attachment point name extensions. The terms "attachment point" and "SD/MMC slot" are used interchangeably throughout this manpage.
Attachment points are named through ap_ids. All SD/MMC attachment points consist of a string in the following form:
X is the SD/MMC controller number.
S is the slot number on the controller (0 to 8).
dev/cXtYd0 identifies the inserted memory card.
Y is a target number.
In general, the device identifier is derived from the corresponding logical link for the device in /dev. Because only one LUN (LUN 0) is supported by the SD/MMC device, the "d" component of the device string will always have number 0 (zero). For example, the logical ap_id of slot 4 of SD/MMC controller 2 would be sdcard2/4. If the SD/MMC media card is inserted in this attachment point and the device is configured, the ap_id might be sdcard2/4::dsk/c2t0d0.
The cXtYd0 string identifying a device has one-to-one correspondence to the device attachment point.
A simple listing of attachment points in the system includes all SD/MMC device slots and attached devices. For example:
#cfgadm -l Ap_Id Type Receptacle Occupant Condition sdcard0/0::dev/c2t0d0 sdcard connected configured ok sata0/1::dev/c0t1d0 disk connected configured ok sata0/2::dev/c0t2d0 cd-dvd connected configured ok sata0/3 sata-port empty unconfigured ok usb0/1 unknown empty unconfigured ok usb0/2 unknown empty unconfigured ok
See cfgadm(1M) for more information regarding listing of attachment points.
The receptacle state for an attachment point at the SD/MMC slot has the following meanings:
The SD/MMC slot is powered-on and enabled. No device presence was detected for this slot.
The SD/MMC slot is not enabled, or the SD/MMC device presence was detected but no communication with the device was established, or the slot has failed.
The SD/MMC device is detected in the slot and device communication is established.
The occupant (device inserted in the SD/MMC slot) state has the following meanings:
The attached SD/MMC device is configured and ready to use by the operating system.
No device is attached, or the SD/MMC device inserted in the SD/MMC slot is not yet configured. To configure, run the command cfgadm -c configure ap_id.
The attachment point (SD/MMC slot) condition has the following meanings:
The SD/MMC slot is powered-on, enabled and ready for use.
The SD/MMC slot failed. It may be disabled and/or powered-off by the system. It is unusable and its condition is unknown. The failure may be due to the device inserted in the slot.
The SD/MMC slot is disabled and its condition is unknown.
The cfgadm command defines several types of operations besides listing (-l). These operations include invoking configuration state changes (-c), invoking hardware specific functions (-x), and obtaining configuration administration help messages (-h).
-c: For SD/MMC slot attachment points, the following configuration state change operations are supported:
Enable (activate) the SD/MMC slot and establish the communication with an attached device. This operation implies powering-on the slot if necessary.
Unconfigure the inserted device if it is not already unconfigured and disable (deactivate) the SD/MMC slot. A subsequent "connect" command enables SD/MMC slot operation but does not bring a device to the "configured" state.
The following state change operations are supported for an SD/MMC card inserted in to the SD/MMC slot:
Configure new device for use by the operating system if it is not already configured. This command also implies connect operation, if necessary.
Unconfigure the device inserted in the SD/MMC slot if it is not already unconfigured.
-f : Not supported.
-h ap_id: SD/MMC specific help can be obtained by using the help option with any SD/MMC attachment point.
-l [-v]: The -l option works as described in cfgadm(1M). When paired with the -v option, the "Information" field contains the following SD/MMC-specific information:
-o hardware_options — No hardware specific options are currently defined.
-s listing_options: Attachment points of class SD/MMC can be listed by using the select suboption. See cfgadm(1M).
-t ap_id: Self-test functionality. Not supported by SD/MMC slots.
-x hardware_function: Perform hardware specific function. sdcard_reset_slot ap_idindicates reset of the SD/MMC slot specified by ap_id. If an SD/MMC device is inserted in the slot, it is also reset.
-v: Execute in verbose mode.
Example 1 – Configuring an SD/MMC card:
The following command configures a card attached to SD/MMC controller 0, slot 0. It should be issued only when there is a device inserted in the SD/MMC slot.
# cfgadm -c configure sdcard0/0
Example 2 – Unconfiguring an SD/MMC card:
The following command unconfigures a card inserted in SD/MMC controller 0, slot 3:
# cfgadm -c unconfigure sdcard0/3
Example 3 — Encountering a mounted file system while unconfiguring a disk:
The following command illustrates encountering a mounted file system while unconfiguring a disk:
# cfgadm -c unconfigure sdcard1/5::dsk/c01t35d0
The system responds with the following:
cfgadm: Component system is busy, try again: failed to offline: /devices/pci@0,0/pci8086,244e@1e/pci1095,3124@1/sd@5,0 Resource Information ------------------ -------------------------- /dev/dsk/c1t5d0s0 mounted filesystem "/mnt"
Hardware specific library for generic SD/MMC hot plugging.
See attributes(5) for descriptions of the following attributes:
Under normal operation, SD/MMC media cards are automatically configured when a card is inserted. Most administrators do not find it necessary to use this command under normal use.
Removing an SD/MMC card without first unconfiguring it may result in data loss if the device is being written to when it's being removed. Devices that are mounted read-only can be safely removed at any time.
Devices that have filesystems other than pcfs(7FS) on them should always be explicitly unconfigured before removal.