| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
Add dev.asmc.0.sil sysctl to control the SIL LED via SMC keys
MSLD (duty/brightness) and MSLS (state latch, must be set
before re-enabling).
MFC After: 1 week
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D58865
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Add dev.asmc.0.system subtree with read-only sysctls for SMC diagnostic
and identity keys: shutdown_cause (MSSD), sleep_cause (MSSP),
thermal_status (MSAL), time_of_day (CLKT), power_state (MSPS),
board_id (RPlt), and chip_gen (RGEN).
Each sysctl is registered only if the key exists on the hardware.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D57853
|
| |
|
|
|
|
|
|
|
|
|
| |
Add hw.asmc.system-state and hw.asmc.board-id read-only sysctls to
expose the T2 system state register and Mac board identifier via SMC.
Try PIO access before MMIO during probe to prevent false T2 detection
on Macs that happen to have something mapped at the T2 BAR address.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D57844
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
T2 Macs (2018+) expose the SMC via memory-mapped registers instead of
I/O ports. Add asmcmmio.c/asmcmmio.h implementing the MMIO transport:
key read/write, getinfo, getbyindex, and a poll-based wait with
exponential backoff.
The driver probes for MMIO at attach time by checking the LDKN firmware
version key; if MMIO is available it is used, otherwise the standard
I/O port backend is used.
T2 fan speeds use IEEE 754 floats instead of fpe2 fixed-point.
Per-fan manual mode uses F%dMd keys instead of the FS! bitmask.
Battery charge limit is exposed via dev.asmc.N.battery_charge_limit.
Tested on:
MacBookPro16,2 (A2251, iBridge2,10)
MacBookPro15,4 (A2159, iBridge2,8)
MacBookAir8,2 (A1932, iBridge2,5)
Mac mini 8,1 (A1993, iBridge2,7)
iMac20,2 (A2115, iBridge2,16)
iMacPro1,1 (A1862, iBridge1,1)
MFC after: 2 weeks
Reviewed by: ngie, adrian
Differential Revision: https://reviews.freebsd.org/D57086
|
| |
|
|
|
|
|
|
|
|
|
| |
Older SMC firmware exposed AUPO as a Wake-on-LAN control. On updated
firmware, the key controls automatic power-on when AC power is restored
after a power loss; WoL is handled by the GBE controller instead.
Rename the sysctl to reflect the current semantics. No compatibility
alias is provided as the sysctl has not appeared in any release.
Reviewed by: ziaee, adrian
Differential Revision: https://reviews.freebsd.org/D56747
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Probe SMC keys at attach time to detect hardware capabilities,
supporting all Intel Apple machines without per-model entries.
Sensors are discovered by scanning sorted SMC key ranges for
known prefixes and types. Capabilities such as SMS, fan safe
speed, and ambient light are detected by key presence.
A global key description table provides human-readable names
for well-known temperature sensors.
Tested on:
- MacBook Pro (Early 2007, Mid 2014, Mid 2015)
- MacBook Air (Early 2015, Mid 2017)
- iMac (Mid 2011, Late 2013)
- Mac mini (Mid 2011)
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D56405
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apple SMCs contain numerous undocumented voltage, current, power,
and ambient light sensors. This change adds automatic detection
and registration of these sensors as sysctls.
New sysctl trees:
dev.asmc.0.voltage.* - Voltage sensors (millivolts)
dev.asmc.0.current.* - Current sensors (milliamps)
dev.asmc.0.power.* - Power sensors (milliwatts)
dev.asmc.0.ambient.* - Ambient light sensors
Implementation:
- Scans all SMC keys at attach time via asmc_key_dump_by_index()
- Identifies sensors by key prefix patterns:
- Voltage: VC*, VD*, VG*, VP*, VI*
- Current: I{C,D,G,M,N,O,H,P,B,A,L}*
- Power: P{C,D,N,S,T,H,F,Z,z}*
- Light: ALV*, ALS*
- Dynamically creates sysctls for detected sensors
- Supports 8 fixed-point SMC data types:
- sp78, sp87, sp4b, sp5a, sp69, sp96, sp2d, ui16
- Auto-converts all values to milli-units (mV, mA, mW)
On Mac Mini 5,1, detects:
- 7 voltage sensors
- 18 current sensors
- 27 power sensors
- 2 ambient light sensors
Enables power consumption monitoring, voltage rail debugging,
and ambient light detection without hardcoding model-specific
sensor lists.
Tested on:
- Mac Mini 5,1 (2011) running FreeBSD 15.0-RELEASE
- 54 sensors auto-detected and exposed via sysctl
- All sensor types verified with multimeter readings
- Fixed-point conversions validated against known values
- Memory management tested (malloc/free on detach)
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D55807
|
| |
|
|
|
| |
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2137
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds support for the MacBookPro13,1 (late 2016, 13-inch). The SMC
keys were collected from https://logi.wiki/index.php/SMC_Sensor_Codes. Two
temperature keys are omitted because they fail to be read: TI0P (IO Proximity)
and Ta0P (Ambient Air).
Note that the with this model the `dev.asmc.0.fan.0.minspeed` setting only
applies when the fans have been activated by the system. In my testing, the fans
did not spin up until CPU temperatures hit about 80C. At lower temperatures, the
fans will happily ignore the minimum speed and remain at 0 rpm.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2137
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds a debugging interface to read and write arbitrary
Apple SMC keys by name through sysctl, enabling hardware exploration
and control of undocumented features.
The interface provides four sysctls under dev.asmc.0.raw.*:
- key - Set the 4-character SMC key name (e.g., "AUPO")
- value - Read/write key value as a hex string
- len - Auto-detected key value length (can be overridden)
- type - Read-only 4-character type string (e.g., "ui8", "flt")
Implementation includes a new asmc_key_getinfo() function using SMC
command 0x13 to query key metadata. The interface automatically
detects key lengths and types, uses hex string encoding for
arbitrary binary values, and is safe for concurrent access via
CTLFLAG_NEEDGIANT.
This interface was essential for discovering that the AUPO key
enables Wake-on-LAN from S5 state, and for mapping all 297 SMC keys
on Mac Mini 5,1.
Reviewed by: ngie, adrian, markj
Differential Revision: https://reviews.freebsd.org/D54441
|
| |
|
|
| |
MFC after: 1 month
|
| |
|
|
|
|
| |
Signed-off-by: tslight <tslight@pm.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1992
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The SMC firmware revision can prove helpful when determining why the
behavior of a given controller varies from the maintainers' expected
behavior.
This should be a sysctl (eventually), but for now dumping out the
information via `device_printf(..)` suffices, given that only one
asmc(4) compatible device can exist in an Apple platform at any
given point in time. This will become a sysctl in the future after
additional improvements are incorporated from OpenBSD and NetBSD.
MFC after: 1 week
Obtained from: https://github.com/openbsd/src/ (sys/dev/acpi/asmc.c @ 142d064)
Differential Revision: https://reviews.freebsd.org/D55577
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apple Mac systems support Wake-on-LAN from powered-off state (S5/G2) via
the AUPO SMC key.
This change adds a convenience sysctl, `dev.asmc.0.wol`. This can be
disabled if set to 0 and enabled if set to 1.
The AUPO key is volatile and resets to 0x00 on every boot, so WoL must
be manually enabled before each shutdown to work from powered-off state.
Users need to run: `sysctl dev.asmc.0.wol=1` before shutting down the
system. The sysctl is best set to persist in `/etc/sysctl.conf`.
MFC after: 1 week
Reviewed By: markj, ngie
Differential Revision: https://reviews.freebsd.org/D54439
|
| |
|
|
|
|
|
| |
Test and verified with Sonicblue7
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D54952
|
| |
|
|
|
|
|
|
|
|
|
| |
Add support for the MacBookPro11,5 (Mid 2015, 15-inch with AMD Radeon R9 M370X GPU)
to the Apple SMC driver.
Debug testing revealed this model lacks several SMC keys present on MacBookPro11,4
(IBLC, ICMC, IC2C), that model-specific sensor definitions.
Differential Revision: https://reviews.freebsd.org/D54665
Reviewed by: adrian
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The asmc_dumpall debug function previously used a hardcoded loop limit
of 0x100 (256) keys with a "XXX magic number" comment.
This change improves asmc_dumpall to:
* Read the actual number of keys from the ASMC_NKEYS SMC key
* Print the key count being dumped for better debugging output
* Loop only up to the actual key count (e.g., 297 on Mac Mini 5,1)
This provides more accurate debug output and removes the magic number.
Tested on Mac Mini 5,1 (FreeBSD 16.0-CURRENT):
* Rebuild kernel with DEBUG enabled in asmc driver
* Boot with new kernel
* Verify dmesg shows "asmc_dumpall: dumping 297 keys" (or actual count)
* Verify all 297 keys are dumped
Differential Revision: https://reviews.freebsd.org/D54436
Reviewed by: markj, adrian
|
| |
|
|
|
|
|
| |
This adds the ASMC support for the macmini 6,1 and 6,2.
PR: kern/268141
Differential Revision: https://reviews.freebsd.org/D49929
|
| |
|
|
|
|
|
| |
Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1366
|
| |
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| |
|
|
|
|
|
|
|
| |
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
|
|
| |
Add in the zones for my MacbookAir6,2, a 2013 Macbook Air.
Tested - said Macbook Air 2013. Thermal Zones and keyboard backlight
control works fine.
Differential Revision: https://reviews.freebsd.org/D38073
Approved by: jrtc27
|
| |
|
|
|
|
|
|
|
|
|
| |
This is a slightly refined version of a patch[0] by FreeBSD Forums
user "tmcclean".
[0]https://forums.freebsd.org/threads/success-installing-freebsd-13-0-on-macbook-pro-5-5.80458/
Reviewed by: adrian, emaste, imp
Differential Revision: https://reviews.freebsd.org/D37900
MFC after: 1 month
|
| |
|
|
|
|
|
|
|
|
| |
Modify asmc_sms_printintr() to be silent when the ambient light sensor
interrupt fires on this model, since the messages can otherwise fill up
the dmesg.
PR: 265005
Reviewed by: markj
MFC after: 2 weeks
|
| |
|
|
|
|
|
|
|
| |
- Make descriptions a bit more human-friendly.
- Don't attempt to probe fan safe speeds, this model does not provide
one.
PR: 260781
MFC after: 2 weeks
|
| |
|
|
|
| |
PR: 262456
MFC after: 2 weeks
|
| |
|
|
| |
MFC after: 2 weeks
|
| |
|
|
|
| |
PR: 261981
MFC after: 2 weeks
|
| |
|
|
|
|
| |
No functional change intended.
MFC after: 2 weeks
|
| |
|
|
|
| |
PR: 260781
MFC after: 2 weeks
|
| |
|
|
|
|
|
| |
PR: 218574
Submitted by: NapoleonWils0n <t43InvisibleMan@gmail.com>
Submitted by: John Hay <john@sanren.ac.za>
MFC after: 2 weeks
|
| |
|
|
| |
Notes:
svn path=/head/; revision=365114
|
| |
|
|
|
|
|
|
|
| |
PR: 248693
Submitted by: gcx61@interia.pl
MFC after: 1 week
Notes:
svn path=/head/; revision=364300
|
| |
|
|
|
|
|
|
|
|
| |
PR: 235798
Submitted by: Trev <fbsdbugs4@sentry.org>
Reported by: Trev <fbsdbugs4@sentry.org>
MFC after: 1 week
Notes:
svn path=/head/; revision=344553
|
| |
|
|
|
|
|
| |
MFC after: 1 week
Notes:
svn path=/head/; revision=342822
|
| |
|
|
|
|
|
|
|
|
| |
PR: 211513
Submitted by: William Theesfeld Jr <wtheesfeld@mailbox.org>
Reported by: William Theesfeld Jr <wtheesfeld@mailbox.org>
MFC after: 1 week
Notes:
svn path=/head/; revision=342770
|
| |
|
|
|
|
|
|
|
|
| |
PR: 203431
Submitted by: jjr@alisa.org & holindho@saunalahti.fi
Reported by: jjr@alisa.org
MFC after: 1 week
Notes:
svn path=/head/; revision=342218
|
| |
|
|
|
|
|
|
|
|
| |
PR: 225911
Submitted by: trev <fbsdbugs4@sentry.org>
Reported by: trev <fbsdbugs4@sentry.org>
MFC after: 1 week
Notes:
svn path=/head/; revision=342171
|
| |
|
|
|
|
|
|
|
|
| |
PR: 217505
Submitted by: John O. Brickley <obryan.brickley@gmail.com>, updated by Maciej Pasternacki <maciej@pasternacki.net>
Reported by: John O. Brickley <obryan.brickley@gmail.com>
MFC after: 1 week
Notes:
svn path=/head/; revision=341988
|
| |
|
|
|
|
|
|
|
|
|
| |
PR: 226172
Submitted by: James Wright <james.wright@jigsawdezign.com>
Reported by: James Wright <james.wright@jigsawdezign.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18396
Notes:
svn path=/head/; revision=341820
|
| |
|
|
|
|
|
|
|
| |
PR: 225911
Submitted by: Trev <fbsdbugs4 at sentry.org>
MFC after: 1 week
Notes:
svn path=/head/; revision=330667
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.
The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
Notes:
svn path=/head/; revision=326255
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch will add support for MacBookPro 11.2.
For the macros, the MBP11_* macros (for the existing MacBookPro11.3) did not
match so they have been renamed to MBP113_* and a new MBP112_* has been
added (modified copy of MBP11_*).
Some trailing whitespaces may have been removed automatically.
PR: kern/214836
Obtained from: Johannes Lundberg <johannes@brilliantservice.co.jp
Notes:
svn path=/head/; revision=313880
|
| |
|
|
|
|
|
|
|
| |
Tested by: Johannes Lundberg <johannes@brilliantservice.co.jp>
PR: kern/209179
Submitted by: Thomas Brierley <tomxor@gmail.com>
Notes:
svn path=/head/; revision=298990
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds support for restoring backlight after resume and adds models
Macbook3,1
MacbookAir5,1
MacbookAir5,2
It also incorporates fixes for bug #175260, bug #203610 and bug #203512
so those can be closed if this patch is applied.
PR: kern/209156
PR: kern/175260
PR: kern/203610
PR: kern/203512
Submitted by: Johannes Lundberg <johannes@brilliantservice.co.jp>
Notes:
svn path=/head/; revision=298937
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. changed the code so that 2**16 keys are supported
2. changed the number of possible fans in a system from 2 to 6
3. added write support for some fan sysctls
4. added a new sysctl which shows the ID of the fan
5. added four more apple models with their temperature keys
6. changed the maxnumber of temperature keys from 36 to 80
7. replaced several fixed buf sizes to sizeof buf
Obtained from: Denis Ahrens denis at h3q.com
MFC after: 4 weeks
Notes:
svn path=/head/; revision=271975
|
| |
|
|
|
|
|
|
|
|
| |
PR: 190195
Submitted by: fbsdbugs2 sentry.org
MFC after: 1 week
Relnotes: yes
Notes:
svn path=/head/; revision=268303
|
| |
|
|
|
|
|
|
|
|
| |
debugging.
Submitted by: Christoph Langguth <christoph at rosenkeller.org>
MFC after: 1 week
Notes:
svn path=/head/; revision=197190
|
| |
|
|
|
|
|
|
|
| |
Submitted by: Christoph Langguth <christoph at rosenkeller.org>
MFC after: 2 weeks
Approved by: re (kib)
Notes:
svn path=/head/; revision=195046
|
| |
|
|
|
|
|
| |
Obtained from: mactel-linux
Notes:
svn path=/head/; revision=182850
|