aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Gmelin <grembo@FreeBSD.org>2022-12-29 15:59:08 +0000
committerMichael Gmelin <grembo@FreeBSD.org>2023-01-06 19:11:56 +0000
commit638937d466648a9e5733225aef62eeae02db4f03 (patch)
treeb17e84a7dfb2bda89bd648c7b285e93432e2c452
parent29bfaf1c6d8bc0a06aaa7e09363544769eade3c0 (diff)
downloadsrc-638937d466648a9e5733225aef62eeae02db4f03.tar.gz
src-638937d466648a9e5733225aef62eeae02db4f03.zip
asmc: Add support for MacBook5,5
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
-rw-r--r--sys/dev/asmc/asmc.c14
-rw-r--r--sys/dev/asmc/asmcvar.h31
2 files changed, 38 insertions, 7 deletions
diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c
index cd35c35cd9ce..bec0054e2dd7 100644
--- a/sys/dev/asmc/asmc.c
+++ b/sys/dev/asmc/asmc.c
@@ -223,7 +223,13 @@ static const struct asmc_model asmc_models[] = {
{
"MacBookPro5,1", "Apple SMC MacBook Pro Core 2 Duo (2008/2009)",
ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS,
- ASMC_MBP5_TEMPS, ASMC_MBP5_TEMPNAMES, ASMC_MBP5_TEMPDESCS
+ ASMC_MBP51_TEMPS, ASMC_MBP51_TEMPNAMES, ASMC_MBP51_TEMPDESCS
+ },
+
+ {
+ "MacBookPro5,5", "Apple SMC MacBook Pro Core 2 Duo (Mid 2009)",
+ ASMC_SMS_FUNCS, ASMC_FAN_FUNCS2, ASMC_LIGHT_FUNCS,
+ ASMC_MBP55_TEMPS, ASMC_MBP55_TEMPNAMES, ASMC_MBP55_TEMPDESCS
},
{
@@ -1397,10 +1403,10 @@ asmc_sms_printintr(device_t dev, uint8_t type)
case ASMC_ALSL_INT2A:
/*
* This suppresses console and log messages for the ambient
- * light sensor for the only model known to generate this
- * interrupt.
+ * light sensor for models known to generate this interrupt.
*/
- if (strcmp(sc->sc_model->smc_model, "MacBookPro6,2") == 0)
+ if (strcmp(sc->sc_model->smc_model, "MacBookPro5,5") == 0 ||
+ strcmp(sc->sc_model->smc_model, "MacBookPro6,2") == 0)
break;
/* FALLTHROUGH */
default:
diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h
index 769903701a99..a594710f1cbe 100644
--- a/sys/dev/asmc/asmcvar.h
+++ b/sys/dev/asmc/asmcvar.h
@@ -209,13 +209,13 @@ struct asmc_softc {
"Unknown", "Unknown", \
"Wireless Module", }
-#define ASMC_MBP5_TEMPS { "TB0T", "TB1T", "TB2T", "TB3T", "TC0D", \
+#define ASMC_MBP51_TEMPS { "TB0T", "TB1T", "TB2T", "TB3T", "TC0D", \
"TC0F", "TC0P", "TG0D", "TG0F", "TG0H", \
"TG0P", "TG0T", "TG1H", "TN0D", "TN0P", \
"TTF0", "Th2H", "Tm0P", "Ts0P", "Ts0S", \
NULL }
-#define ASMC_MBP5_TEMPNAMES { "enclosure_bottom_0", "enclosure_bottom_1", \
+#define ASMC_MBP51_TEMPNAMES { "enclosure_bottom_0", "enclosure_bottom_1", \
"enclosure_bottom_2", "enclosure_bottom_3", \
"cpu_diode", "cpu", \
"cpu_pin", "gpu_diode", \
@@ -226,7 +226,7 @@ struct asmc_softc {
"heatsink_2", "memory_controller", \
"pci_express_slot_pin", "pci_express_slot_unk" }
-#define ASMC_MBP5_TEMPDESCS { "Enclosure Bottom 0", "Enclosure Bottom 1", \
+#define ASMC_MBP51_TEMPDESCS { "Enclosure Bottom 0", "Enclosure Bottom 1", \
"Enclosure Bottom 2", "Enclosure Bottom 3", \
"CPU Diode", "CPU ???", \
"CPU Pin", "GPU Diode", \
@@ -264,6 +264,31 @@ struct asmc_softc {
"Heat Sink 2", "Memory Controller", \
"Palm Rest", "Memory Proximity" }
+#define ASMC_MBP55_TEMPS { "TB0T", "TB1T", \
+ "TB2T", "TB3T", \
+ "TC0D", "TC0P", \
+ "TN0D", "TN0P", \
+ "TTF0", \
+ "Th0H", "Th1H", "ThFH", \
+ "Ts0P", "Ts0S", \
+ NULL }
+
+#define ASMC_MBP55_TEMPNAMES { "enclosure_bottom_0", "enclosure_bottom_1", \
+ "enclosure_bottom_2", "enclosure_bottom_3", \
+ "cpu_diode", "cpu_pin", \
+ "northbridge_diode", "northbridge_pin", \
+ "unknown", \
+ "heatsink_0", "heatsink_1", "heatsink_2", \
+ "pci_express_slot_pin", "pci_express_slot_unk" }
+
+#define ASMC_MBP55_TEMPDESCS { "Enclosure Bottom 0", "Enclosure Bottom 1", \
+ "Enclosure Bottom 2", "Enclosure Bottom 3", \
+ "CPU Diode", "CPU Pin", \
+ "Northbridge Diode", "Northbridge Pin", \
+ "Unknown", \
+ "Heatsink 0", "Heatsink 1", "Heatsink 2", \
+ "PCI Express Slot Pin", "PCI Express Slot (unk)" }
+
#define ASMC_MBP81_TEMPS { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \
"TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
"TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \