DragonFly On-Line Manual Pages

Search: Section:  


APPLE_SMC(4)          DragonFly Kernel Interfaces Manual          APPLE_SMC(4)

NAME

apple_smc - Apple System Management Controller driver

SYNOPSIS

To compile this driver into the kernel, place the following line in your kernel configuration file: device apple_smc Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): apple_smc_load="YES"

DESCRIPTION

The apple_smc driver provides support for the System Management Controller (SMC) found in Apple Macintosh computers. The SMC manages fans, temperature sensors, keyboard backlight, ambient light sensors, the Sudden Motion Sensor (SMS), and various system state keys. The driver supports two hardware backends: * ISA I/O port (port 0x300) on Intel Macs through iMac13,x. * MMIO register window on newer Intel Macs (iMac14,x and later), including those with an Apple T2 security chip. The MMIO backend is probed first. If a memory-mapped BAR is present and responds, the driver uses MMIO; otherwise it falls back to ISA port I/O. T2 Macs are identified by an RGEN key value of 3. All sensor values and controls are exposed through the sysctl(8) interface under dev.apple_smc.0.

SYSCTL VARIABLES

Fan Controls Each fan is exposed under dev.apple_smc.0.fan.<N> where <N> is the fan number starting from 0. dev.apple_smc.0.fan.<N>.id (read-only) Fan model identification string. dev.apple_smc.0.fan.<N>.speed (read-only) Current fan speed in RPM. dev.apple_smc.0.fan.<N>.safespeed (read-only) Fan safe speed in RPM. Only present if the hardware reports a safe speed key. dev.apple_smc.0.fan.<N>.minspeed Minimum fan speed in RPM. dev.apple_smc.0.fan.<N>.maxspeed Maximum fan speed in RPM. dev.apple_smc.0.fan.<N>.targetspeed Target fan speed in RPM. dev.apple_smc.0.fan.<N>.manual Fan manual mode. Set to 1 to disable automatic fan control, 0 to re-enable it. On T2 Macs this uses the per-fan F<N>Md key; on older Macs it uses the global FS! bitmask. Temperature Sensors Temperature sensors are auto-detected at attach time by scanning the SMC key namespace for keys in the `T' range with sp78 type (signed 8.8 fixed- point, millidegrees Celsius). Sensors whose probe read returns a value below -10000 millidegrees are classified as Intel DTS (distance-to-Tj,max) sensors and placed under a separate dts subtree. The sysctl handler converts DTS readings to absolute temperature using the Tj,max value read from MSR 0x1A2 at attach time. Sensors returning -120000 or below are treated as disconnected and are not registered. dev.apple_smc.0.temp.<KEY> (read-only) Absolute temperature in millidegrees Celsius. <KEY> is the 4-character SMC key name, e.g. `TC0D' for CPU die temperature. dev.apple_smc.0.temp.dts.<KEY> (read-only) DTS sensor converted to absolute temperature. Voltage, Current, and Power Sensors Voltage, current, and power sensors are auto-detected by scanning the `V', `I', and `P' key ranges respectively. Values are reported in millivolts, milliamps, or milliwatts. dev.apple_smc.0.voltage.<KEY> (read-only) Voltage in millivolts. dev.apple_smc.0.current.<KEY> (read-only) Current in milliamps. dev.apple_smc.0.power.<KEY> (read-only) Power in milliwatts. Ambient Light Sensors dev.apple_smc.0.ambient.<KEY> (read-only) Ambient light sensor reading. Keys are typically `ALV0', `ALV1', etc. Keyboard Backlight dev.apple_smc.0.light.left (read-only) Left ambient light sensor value used for keyboard backlight. On newer models with 10-byte payloads, a dedicated decoder is used. dev.apple_smc.0.light.right (read-only) Right ambient light sensor value. Only present on models with a separate right sensor and 6-byte payloads. dev.apple_smc.0.light.control Keyboard backlight brightness, 0 (off) to 255 (maximum). The value is cached and restored on resume from suspend. Sudden Motion Sensor (SMS) The SMS provides three-axis accelerometer data. It is only present on MacBook and MacBook Pro models with a built-in hard disk motion sensor. SMS events are delivered to devd(8) with system `ACPI', subsystem `apple_smc', and type `SMS'. The notify value encodes the event type: 0 = shock, 1 = high acceleration, 2 = free fall. dev.apple_smc.0.sms.x (read-only) Accelerometer X axis value. dev.apple_smc.0.sms.y (read-only) Accelerometer Y axis value. dev.apple_smc.0.sms.z (read-only) Accelerometer Z axis value. System State These sysctls are only present if the corresponding SMC key exists on the hardware. dev.apple_smc.0.system.shutdown_cause (read-only) Last shutdown cause as reported by the MSSD key, decoded to a human-readable string where known (e.g. "5 (good-shutdown)"). dev.apple_smc.0.system.sleep_cause (read-only) Last sleep cause (MSSP). dev.apple_smc.0.system.thermal_status (read-only) Thermal subsystem alert flags (MSAL). Decoded bits include TSS, thermal validity, calibration validity, PROCHOT assertion, and power limits. dev.apple_smc.0.system.time_of_day (read-only) SMC clock: seconds since midnight (CLKT). dev.apple_smc.0.system.power_state (read-only) SMC power state index (MSPS). dev.apple_smc.0.system.board_id (read-only) Apple board codename, e.g. `Mac-27ADBB7B4CEE8E61' (RPlt). dev.apple_smc.0.system.chip_gen (read-only) Apple chip generation; a value of 3 indicates a T2 coprocessor (RGEN). Battery Charge Limit (T2 only) dev.apple_smc.0.battery_charge_limit Battery charge limit percentage, 0 to 100 (BCLM). Only present on T2 Macs. Auto Power-On dev.apple_smc.0.auto_poweron Auto power-on after AC power loss. Set to 1 to enable, 0 to disable (AUPO). Debug Interface When the kernel is compiled with APPLE_SMC_DEBUG, a raw key access interface is available under dev.apple_smc.0.raw: dev.apple_smc.0.raw.key Write a 4-character SMC key name to select it. dev.apple_smc.0.raw.value Read or write the selected key's value as a hexadecimal string. dev.apple_smc.0.raw.len (read-only) Length of the selected key's value in bytes. dev.apple_smc.0.raw.type (read-only) 4-character type code of the selected key.

HARDWARE

The apple_smc driver supports any Intel Mac with ACPI device `APP0001'.

EXAMPLES

Read the CPU die temperature: sysctl dev.apple_smc.0.temp.TC0D Set fan 0 to manual mode at 2000 RPM: sysctl dev.apple_smc.0.fan.0.manual=1 sysctl dev.apple_smc.0.fan.0.targetspeed=2000 Check the last shutdown cause: sysctl dev.apple_smc.0.system.shutdown_cause Limit battery charge to 80% on a T2 Mac: sysctl dev.apple_smc.0.battery_charge_limit=80

SEE ALSO

acpi(4), apple_fw(4), sysctl.conf(5), devd(8), sysctl(8)

HISTORY

The apple_smc driver first appeared in DragonFly 6.5.

AUTHORS

The apple_smc driver and this manual page were written by Abdelkader Boudih <dragonflybsd@seuros.com>.

CAVEATS

On headless iMacs with the LCD panel disconnected, the SMC may enter a thermal panic mode due to missing temperature sensors (e.g. TL0P, TL1P), asserting PROCHOT and throttling the CPU to its minimum frequency. The thermal_status sysctl can be used to diagnose this condition. Fan manual mode overrides can be used to manage fan speeds in this scenario. DragonFly 6.5-DEVELOPMENT June 22, 2026 DragonFly 6.5-DEVELOPMENT

Search: Section: