ProjectOSX

Welcome Guest!

Returning User? Login here.

Want membership privileges? Register here.

2 Pages V   1 2 >  
Start a new topic Add Reply
> Acpithermal, Development ACPI driver for thermal zones
ThirdSmile
post Sep 12 2011, 07:23 PM
Post #1
Before 10.7 I have used AppleACPIThermal.kext for thermal zones, but I in lion this driver has loosed ability to work with active cooling on my notebook(hp 6720).

So after lot of tries to fix this in DSDT i has decided to develop own driver and see what is going on ...

The problem was in _ALx methods in thermal zone - them returns NULL in lion(in snow they works as expected), but must return fan devices list.
Any ideas about this behavior?

So I have added methods to thermal zone in DSDT:
- EALx - to enable cooling for _ACx
- DALx - to disable cooling for _ACx

(Thermal Zone TZ1 and TZ2 came from SSDT)

And added use of them to my driver.
Now I have tested driver in lion and snow - works good, I have active cooling on my laptop.

The only things implemented in driver at this moment:
1. Check zone temperature.
2. Get _ACx values, and if need enable/disable cooling form them with EACx/DACx methods(_ALx - not used at this moment)
Also thermal zone driver, may be, need to implement some actions for passive cooling(such as cpu throttling) - but i do not know how...

Any suggestions and fixes are welcome =)

Attached File  ACPIThermal.zip ( 23.12K ) Number of downloads: 85

Attached File  dsdt.dsl.zip ( 24.77K ) Number of downloads: 69

Attached File  ACPIThermal.kext.zip ( 18.22K ) Number of downloads: 99


This post has been edited by ThirdSmile: Sep 12 2011, 07:23 PM
MacBook Pro 8,2 (MD318)
10.6.7 P5LD2 VM DH, Pentium 4 631, 3Gb RAM, Intel GMA 950, ALC882
10.6.8 & 10.7.1 hp 6720s (T7250 & GMAX3100 device id 2a12)
tmacyunn1
post Sep 13 2011, 02:00 AM
Post #2
Thank you for the research, but My SSDT tables don't contain the TZ entry, the TZ item in the dsdt is simple can't get something useful. So my case is only by implementing fan control value in the fan register can get it work.
Here is my dsdt.
Attached File  dsdt.aml.zip ( 13K ) Number of downloads: 22
Windows 7 x64 SP1+ Mavericks 10.9.0
CPU : I5-2450m Ram : 8G=4*2G Graphics : HD3000(Disabled AMD6630m BY DSDT) Ethernet: RTL8136 Wireless: AR9280 Audio Card: ALC269 Clover version: 2330
.
ThirdSmile
post Sep 13 2011, 05:26 AM
Post #3
QUOTE (tmacyunn1 @ Sep 13 2011, 02:00 AM) *
Thank you for the research, but My SSDT tables don't contain the TZ entry, the TZ item in the dsdt is simple can't get something useful. So my case is only by implementing fan control value in the fan register can get it work.
Here is my dsdt.
Attached File  dsdt.aml.zip ( 13K ) Number of downloads: 22


Could you post ioreg dump when my driver is loaded - I want see how many AC states is shown in your TZ...

In your dsdt I see only one AC state but without corresponding AL state, so i think now your TZ declaration in dsdt is now correct even for old ACPIThermal values.

And of cource you can add more active cooling states to your TZ like:

CODE

Method (_AC0, 0, Serialized)
{
Return (0xACC+80) // for example 80 C in Kelvins.
}
Method (EAL0)
{
//Here set fan speed for AC0
}
Method (DAL0)
{
//Here set fan speed before AC0
}


Good luck, later I probably write more ..
MacBook Pro 8,2 (MD318)
10.6.7 P5LD2 VM DH, Pentium 4 631, 3Gb RAM, Intel GMA 950, ALC882
10.6.8 & 10.7.1 hp 6720s (T7250 & GMAX3100 device id 2a12)
tmacyunn1
post Sep 13 2011, 06:35 AM
Post #4
QUOTE (ThirdSmile @ Sep 13 2011, 06:26 AM) *
Could you post ioreg dump when my driver is loaded - I want see how many AC states is shown in your TZ...

In your dsdt I see only one AC state but without corresponding AL state, so i think now your TZ declaration in dsdt is now correct even for old ACPIThermal values.

And of cource you can add more active cooling states to your TZ like:

CODE

Method (_AC0, 0, Serialized)
{
Return (0xACC+80) // for example 80 C in Kelvins.
}
Method (EAL0)
{
//Here set fan speed for AC0
}
Method (DAL0)
{
//Here set fan speed before AC0
}


Good luck, later I probably write more ..

Here is the IOREG dump, with the kext loaded.
Attached File  yun_s_MacBook.zip ( 390.81K ) Number of downloads: 13

Windows 7 x64 SP1+ Mavericks 10.9.0
CPU : I5-2450m Ram : 8G=4*2G Graphics : HD3000(Disabled AMD6630m BY DSDT) Ethernet: RTL8136 Wireless: AR9280 Audio Card: ALC269 Clover version: 2330
.
ThirdSmile
post Sep 13 2011, 12:36 PM
Post #5
QUOTE (tmacyunn1 @ Sep 13 2011, 06:35 AM) *
Here is the IOREG dump, with the kext loaded.
Attached File  yun_s_MacBook.zip ( 390.81K ) Number of downloads: 13


Ok. try to replace _AC0 method in TZ00 by
CODE

Name (FSPD, Package (0x06)
{
0x64, /* 100%*/
0x50, /* 80% */
0x41, /* 65% */
0x32, /* 50% */
0x14, /* 20% */
Zero /* fan off */
})

Name (CSPD, 0x00) //Current fan speed

Method (EALX,1,NotSerialized) {
Store(DerefOf (Index (FSPD, Arg0)),Local0)
If(LLess(CSPD,Local0)){
Store (Local0, \_SB.PCI0.LPCB.EC.SKTA)
Store (Local0, CSPD)
}
}

Method (DALX,1,NotSerialized) {
Add(Arg0,One,Local1)
Store(DerefOf (Index (FSPD, Local1)),Local0)
Store (Local0, \_SB.PCI0.LPCB.EC.SKTA)
}


Method (EAL0) { EALX(0x00) }
Method (DAL0) { DALX(0x00) }
Method (EAL1) { EALX(0x01) }
Method (DAL1) { DALX(0x01) }
Method (EAL2) { EALX(0x02) }
Method (DAL2) { DALX(0x02) }
Method (EAL3) { EALX(0x03) }
Method (DAL3) { DALX(0x03) }
Method (EAL4) { EALX(0x04) }
Method (DAL4) { DALX(0x04) }

Name (TMPS, Package (0x05)
{
0xdcc, // 80 C
0xd7c, // 72 C
0xd36, // 65 C
0xc6e, // 45 C
0xbd8 // 30 C
})

Method (ACXX,1,NotSerialized){
Return (DerefOf (Index (TMPS, Arg0)))
}

Method (_AC0) { Return (ACXX(0x00)) }
Method (_AC1) { Return (ACXX(0x01)) }
Method (_AC2) { Return (ACXX(0x02)) }
Method (_AC3) { Return (ACXX(0x03)) }
Method (_AC4) { Return (ACXX(0x04)) }



With my driver this should give you the same active cooling as on my laptop.

Already patched your dsdt:
Attached File  dsdt.aml.zip ( 13.16K ) Number of downloads: 24


Good luck.
MacBook Pro 8,2 (MD318)
10.6.7 P5LD2 VM DH, Pentium 4 631, 3Gb RAM, Intel GMA 950, ALC882
10.6.8 & 10.7.1 hp 6720s (T7250 & GMAX3100 device id 2a12)
tmacyunn1
post Sep 13 2011, 02:28 PM
Post #6
QUOTE (ThirdSmile @ Sep 13 2011, 12:36 PM) *
Ok. try to replace _AC0 method in TZ00 by
CODE

Name (FSPD, Package (0x06)
{
0x64, /* 100%*/
0x50, /* 80% */
0x41, /* 65% */
0x32, /* 50% */
0x14, /* 20% */
Zero /* fan off */
})

Name (CSPD, 0x00) //Current fan speed

Method (EALX,1,NotSerialized) {
Store(DerefOf (Index (FSPD, Arg0)),Local0)
If(LLess(CSPD,Local0)){
Store (Local0, \_SB.PCI0.LPCB.EC.SKTA)
Store (Local0, CSPD)
}
}

Method (DALX,1,NotSerialized) {
Add(Arg0,One,Local1)
Store(DerefOf (Index (FSPD, Local1)),Local0)
Store (Local0, \_SB.PCI0.LPCB.EC.SKTA)
}


Method (EAL0) { EALX(0x00) }
Method (DAL0) { DALX(0x00) }
Method (EAL1) { EALX(0x01) }
Method (DAL1) { DALX(0x01) }
Method (EAL2) { EALX(0x02) }
Method (DAL2) { DALX(0x02) }
Method (EAL3) { EALX(0x03) }
Method (DAL3) { DALX(0x03) }
Method (EAL4) { EALX(0x04) }
Method (DAL4) { DALX(0x04) }

Name (TMPS, Package (0x05)
{
0xdcc, // 80 C
0xd7c, // 72 C
0xd36, // 65 C
0xc6e, // 45 C
0xbd8 // 30 C
})

Method (ACXX,1,NotSerialized){
Return (DerefOf (Index (TMPS, Arg0)))
}

Method (_AC0) { Return (ACXX(0x00)) }
Method (_AC1) { Return (ACXX(0x01)) }
Method (_AC2) { Return (ACXX(0x02)) }
Method (_AC3) { Return (ACXX(0x03)) }
Method (_AC4) { Return (ACXX(0x04)) }



With my driver this should give you the same active cooling as on my laptop.

Already patched your dsdt:
Attached File  dsdt.aml.zip ( 13.16K ) Number of downloads: 24


Good luck.

Thanks to help this, but it seems make no effect too. I mean i delete the one part of TCPU method which contains fan control value, and reboot. I try to increase the CPU temp see whether it change or not, without good luck, it still run at one speed. I think my laptop is different form yours, the fan control maybe only works with manual setting under the TCPU method. Here is the TZ part by loading you mod dsdt.
Attached File  Screen_shot_2011_09_13_at_10.19.08_PM.png ( 131.98K ) Number of downloads: 82
Windows 7 x64 SP1+ Mavericks 10.9.0
CPU : I5-2450m Ram : 8G=4*2G Graphics : HD3000(Disabled AMD6630m BY DSDT) Ethernet: RTL8136 Wireless: AR9280 Audio Card: ALC269 Clover version: 2330
.
ThirdSmile
post Sep 13 2011, 02:49 PM
Post #7
QUOTE (tmacyunn1 @ Sep 13 2011, 03:28 PM) *
Thanks to help this, but it seems make no effect too. I mean i delete the one part of TCPU method which contains fan control value, and reboot. I try to increase the CPU temp see whether it change or not, without good luck, it still run at one speed. I think my laptop is different form yours, the fan control maybe only works with manual setting under the TCPU method. Here is the TZ part by loading you mod dsdt.
Attached File  Screen_shot_2011_09_13_at_10.19.08_PM.png ( 131.98K ) Number of downloads: 82

Hmm ... It seams to work..

Thermal Zone temperature is 0xc8c (48C) and AL4 and AL3 according to AC0-4 values is active(you can see on IOReg screenshot), and fan speed according to DSDT code written by me should be 50%(Seriously there is no big difference between fan speeds on 20-50% - they are very silent in compare to 100% speed )..

If I correctly understood - \_SB.PCI0.LPCB.EC.SKTA is the control register for fan device, and we can write value in percent to change fan speed.
With ectool (from coreboot) you can check if this registed is changing.

Try to test it on bigger temperatures - 65C - to enable AL2, 72C - to enable AL3 .... - And i think you can notice fan speed changes on this temperatures.

Also, probably my ACx values is not suitable for your notebook - you can change them in DSDT in TMPS. And you can change fan speeds for each cooling level in DSDT in FSPD.

Upd:
Probably there can be bug in _TMP method in TZ00, try to change it to:
CODE
Method (_TMP, 0, Serialized)
{
    If (\_SB.PCI0.LPCB.ECOK ())
    {
        Return (Add (0x0AAC, Multiply (\_SB.PCI0.LPCB.EC.CTMP, 0x0A)))
    }
    Return (0x0BB8)
}


This post has been edited by ThirdSmile: Sep 13 2011, 03:52 PM
MacBook Pro 8,2 (MD318)
10.6.7 P5LD2 VM DH, Pentium 4 631, 3Gb RAM, Intel GMA 950, ALC882
10.6.8 & 10.7.1 hp 6720s (T7250 & GMAX3100 device id 2a12)
tmacyunn1
post Sep 13 2011, 04:09 PM
Post #8
QUOTE (ThirdSmile @ Sep 13 2011, 03:49 PM) *
Hmm ... It seams to work..

Thermal Zone temperature is 0xc8c (48C) and AL4 and AL3 according to AC0-4 values is active(you can see on IOReg screenshot), and fan speed according to DSDT code written by me should be 50%(Seriously there is no big difference between fan speeds on 20-50% - they are very silent in compare to 100% speed )..

If I correctly understood - \_SB.PCI0.LPCB.EC.SKTA is the control register for fan device, and we can write value in percent to change fan speed.
With ectool (from coreboot) you can check if this registed is changing.

Try to test it on bigger temperatures - 65C - to enable AL2, 72C - to enable AL3 .... - And i think you can notice fan speed changes on this temperatures.

Also, probably my ACx values is not suitable for your notebook - you can change them in DSDT in TMPS. And you can change fan speeds for each cooling level in DSDT in FSPD.

Upd:
Probably there can be bug in _TMP method in TZ00, try to change it to:
CODE
Method (_TMP, 0, Serialized)
{
    If (\_SB.PCI0.LPCB.ECOK ())
    {
        Return (Add (0x0AAC, Multiply (\_SB.PCI0.LPCB.EC.CTMP, 0x0A)))
    }
    Return (0x0BB8)
}

Great man, as you suggest that I add the speed value "Name (FSPD, Package ()" and the cpu temp that fan speed change" Name (TMPS, Package ()" , also delete the TCPU method fan control entry, final get it work out of box. Here is the screenshot of IOREG:
Attached File  Screen_shot_2011_09_14_at_12.04.51_AM.png ( 165.72K ) Number of downloads: 66
Windows 7 x64 SP1+ Mavericks 10.9.0
CPU : I5-2450m Ram : 8G=4*2G Graphics : HD3000(Disabled AMD6630m BY DSDT) Ethernet: RTL8136 Wireless: AR9280 Audio Card: ALC269 Clover version: 2330
.
verleihnix
post Oct 21 2011, 01:56 PM
Post #9
I installed Lion 10.7.2 to my HP nc6510b (T8100) notebook.
Two things are missing battery and cooling.
If try to use your new driver I got a kp.
I did not modify my dsdt. Didn't found the place to insert your fixes.
Please help to sort that out.

Attached File  IMG_0158.JPG ( 1.52MB ) Number of downloads: 36

Attached File  dsdt.6510b.zip ( 32.19K ) Number of downloads: 4


This post has been edited by verleihnix: Oct 21 2011, 01:58 PM
ThirdSmile
post Oct 24 2011, 01:21 PM
Post #10
QUOTE
I did not modify my dsdt. Didn't found the place to insert your fixes.

You need to copy TZ1 definition from SSDT.

About KP - Interesting, I will try to fix it..

Post dump of all ACPI tables (I need to see TZ1 definition - probably it is in on of ssdt tables).
You can dump them using script in attachment.

Post your IOReg when driver not loaded.

Also try to load driver in attachment(it will only snow temperatures in Thermal zones) and upload IOReg when it is loaded.

Also probably you can take look to this thread about hp 6720s - our notebooks are very similar and probably many things from that there can be useful to you.

About battery - look here.

QUOTE (verleihnix @ Oct 21 2011, 02:56 PM) *
I installed Lion 10.7.2 to my HP nc6510b (T8100) notebook.
Two things are missing battery and cooling.
If try to use your new driver I got a kp.
I did not modify my dsdt. Didn't found the place to insert your fixes.
Please help to sort that out.

Attached File  IMG_0158.JPG ( 1.52MB ) Number of downloads: 36

Attached File  dsdt.6510b.zip ( 32.19K ) Number of downloads: 4

Attached File  ACPIThermal_test_only.kext.zip ( 15.84K ) Number of downloads: 9

Attached File  dump_acpi_tables.sh.zip ( 1.03K ) Number of downloads: 9


This post has been edited by ThirdSmile: Oct 24 2011, 01:53 PM
MacBook Pro 8,2 (MD318)
10.6.7 P5LD2 VM DH, Pentium 4 631, 3Gb RAM, Intel GMA 950, ALC882
10.6.8 & 10.7.1 hp 6720s (T7250 & GMAX3100 device id 2a12)
verleihnix
post Oct 25 2011, 07:58 PM
Post #11
Thanks for taking time
here are the two tables
Attached File  no_kext_ACPI_tables.zip ( 37.03K ) Number of downloads: 5

Attached File  kext_loaded_ACPI_tables.zip ( 37.03K ) Number of downloads: 6
ThirdSmile
post Oct 26 2011, 01:01 PM
Post #12
Ok, tomorrow I'll patch dsdt(It is vary similar to my own, TZ1 definition is in ssdt-2).

Also about IOReg - I am talking about IRegistry(no ACPI tables - they didn't change), you can save it using IORegistryExplorer, also in IORegistryExplorer you can see State of ACPIThermal driver(for ex. zone themperatures). This is required to make fix- because, seams driver KP is because of incorrect result of _TMP method in some TZ...


QUOTE (verleihnix @ Oct 25 2011, 08:58 PM) *
Thanks for taking time
here are the two tables
Attached File  no_kext_ACPI_tables.zip ( 37.03K ) Number of downloads: 5

Attached File  kext_loaded_ACPI_tables.zip ( 37.03K ) Number of downloads: 6

MacBook Pro 8,2 (MD318)
10.6.7 P5LD2 VM DH, Pentium 4 631, 3Gb RAM, Intel GMA 950, ALC882
10.6.8 & 10.7.1 hp 6720s (T7250 & GMAX3100 device id 2a12)
verleihnix
post Oct 27 2011, 06:01 PM
Post #13
Hey,

here is the ioreg with old acpithermal.kext and 10.6.7 iopcifamaly and appleacpiplatform kext.

Attached File  nc6510.ioreg.zip ( 362.93K ) Number of downloads: 3


Here is a dsdt with modified names (PCI0 instead of CXXX)

Attached File  dsdt_6510b.dsl.zip ( 60.47K ) Number of downloads: 7


This post has been edited by verleihnix: Oct 28 2011, 07:38 AM
ThirdSmile
post Oct 28 2011, 07:12 PM
Post #14
QUOTE (verleihnix @ Oct 27 2011, 07:01 PM) *
Hey,

here is the ioreg with old acpithermal.kext and 10.6.7 iopcifamaly and appleacpiplatform kext.

Attached File  nc6510.ioreg.zip ( 362.93K ) Number of downloads: 3


Here is a dsdt with modified names (PCI0 instead of CXXX)

Attached File  dsdt_6510b.dsl.zip ( 60.47K ) Number of downloads: 7



I was too busy this days ... So I have done patching only now...

In attachment are patched tz1 from ssdt2 and your dsdt(from post above) with it.

Test it with my ACPIThermal.
If it loads without problems post IOReg when it is loaded in Lion(There can be more problems in dsdt - so we need to compare it with ioreg from snow with AppleACPIThermal).
If panics try to load test-ACPIThermal from post above and also post ioreg when it is loaded.

Good luck.
Attached File  6510b.zip ( 61.79K ) Number of downloads: 10


This post has been edited by ThirdSmile: Oct 28 2011, 07:19 PM
MacBook Pro 8,2 (MD318)
10.6.7 P5LD2 VM DH, Pentium 4 631, 3Gb RAM, Intel GMA 950, ALC882
10.6.8 & 10.7.1 hp 6720s (T7250 & GMAX3100 device id 2a12)
verleihnix
post Oct 29 2011, 07:09 AM
Post #15
It panics at boot.

so this are the ioreg files requested.

Attached File  nc6510_10.6.7_kext.ioreg.zip ( 351.39K ) Number of downloads: 1

Attached File  nc6510_test_kext_lion.ioreg.zip ( 348.74K ) Number of downloads: 1
ThirdSmile
post Oct 29 2011, 01:04 PM
Post #16
QUOTE (verleihnix @ Oct 29 2011, 07:09 AM) *
It panics at boot.

so this are the ioreg files requested.

Attached File  nc6510_10.6.7_kext.ioreg.zip ( 351.39K ) Number of downloads: 1

Attached File  nc6510_test_kext_lion.ioreg.zip ( 348.74K ) Number of downloads: 1



Attached File  ACPIThermal.kext.zip ( 17.07K ) Number of downloads: 7

Load this in lion . And post your IOReg.
MacBook Pro 8,2 (MD318)
10.6.7 P5LD2 VM DH, Pentium 4 631, 3Gb RAM, Intel GMA 950, ALC882
10.6.8 & 10.7.1 hp 6720s (T7250 & GMAX3100 device id 2a12)
verleihnix
post Oct 29 2011, 02:19 PM
Post #17
QUOTE (ThirdSmile @ Oct 29 2011, 03:04 PM) *
Load this in lion . And post your IOReg.

Booting fails, or did you mean to kextload it while running lion?

Update: kextloading it in Lion gives also a kp

This post has been edited by verleihnix: Oct 29 2011, 02:27 PM
ThirdSmile
post Oct 29 2011, 03:59 PM
Post #18
QUOTE (verleihnix @ Oct 29 2011, 02:19 PM) *
Booting fails, or did you mean to kextload it while running lion?

Update: kextloading it in Lion gives also a kp

Yes, no need to install it - use kextload.
Try this one, and post your ioreg from lion - I have removed some posible to panic code and added more debug info output.
Attached File  ACPIThermal.kext.zip ( 18.39K ) Number of downloads: 12


This post has been edited by ThirdSmile: Oct 29 2011, 04:19 PM
MacBook Pro 8,2 (MD318)
10.6.7 P5LD2 VM DH, Pentium 4 631, 3Gb RAM, Intel GMA 950, ALC882
10.6.8 & 10.7.1 hp 6720s (T7250 & GMAX3100 device id 2a12)
verleihnix
post Oct 29 2011, 05:53 PM
Post #19
QUOTE (ThirdSmile @ Oct 29 2011, 05:59 PM) *
Yes, no need to install it - use kextload.
Try this one, and post your ioreg from lion - I have removed some posible to panic code and added more debug info output.
Attached File  ACPIThermal.kext.zip ( 18.39K ) Number of downloads: 12



It panics as well
ThirdSmile
post Oct 29 2011, 06:27 PM
Post #20
QUOTE (verleihnix @ Oct 29 2011, 05:53 PM) *
It panics as well

I think the reason of panic is in incorrect return from ACPI, but i did not know where it is ...
MacBook Pro 8,2 (MD318)
10.6.7 P5LD2 VM DH, Pentium 4 631, 3Gb RAM, Intel GMA 950, ALC882
10.6.8 & 10.7.1 hp 6720s (T7250 & GMAX3100 device id 2a12)

2 Pages V   1 2 >
Add Reply Start a new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: