overdue-scratch

Author Topic: [PATCH] restart fix Removed !  (Read 18118 times)

0 Members and 1 Guest are viewing this topic.

JrCs

  • VoodooLabs
  • Posts: 49
[PATCH] restart fix Removed !
« on: January 01, 2010, 03:16:50 PM »
Hi,

it's the patch that modify the facp table to fix the restart of our hack (no need kext like openhaltrestart anymore).
Credit goes to duvel300. I have refactored the code to simplify it.

A new boolean entry (RestartFix) must be add to com.apple.boot.plist to activate the fix.


Removing the patch because:
 - only work for specific chipset
 - not fully ACPI compliant

JrCs
« Last Edit: January 06, 2010, 10:10:36 AM by JrCs »

18seven

  • Observer
  • Posts: 14
Re: [PATCH] restart fix Removed !
« Reply #1 on: January 21, 2010, 03:34:33 PM »
The new and improved version is in the repo, correct?

JrCs

  • VoodooLabs
  • Posts: 49
Re: [PATCH] restart fix Removed !
« Reply #2 on: January 21, 2010, 08:31:10 PM »
In my branch YES. Not in the trunk.

18seven

  • Observer
  • Posts: 14
Re: [PATCH] restart fix Removed !
« Reply #3 on: January 22, 2010, 02:55:55 PM »
Good stuff. I know this is related to fadt, so does your branch also include the tables override patch?

prasys

  • Entrant
  • Posts: 7
Re: [PATCH] restart fix Removed !
« Reply #4 on: January 22, 2010, 03:46:15 PM »
It seems to be not working for non-Intel processors at this moment. It seems to be specific to Intel (just to let you know)

andyvand

  • VoodooLabs
  • Posts: 51
Re: [PATCH] restart fix Removed !
« Reply #5 on: March 02, 2010, 08:04:52 PM »
Yeah... we should make it possible to override some of the addresses / values...
For example my previous laptop (Packard Bell EasyNote MZ-35 200) used restart register value 4 instead of 6...
But 0xCF9 address seems to be correct for any Intel CPU.

Slice

  • VoodooLabs
  • Posts: 52
Re: [PATCH] restart fix Removed !
« Reply #6 on: January 15, 2011, 08:30:31 PM »
Any news here?
Even having Intel Core2Duo and 965GM chipset I have no good restart with or without this patch.

toine44

  • Entrant
  • Posts: 1
Re: [PATCH] restart fix Removed !
« Reply #7 on: May 07, 2011, 03:29:52 PM »
I don't understand why you remove it.
  • It works on my intel desktop computer
  • I've modified it to make it works in my laptop : using keyboard controller reset (see below)

Code: [Select]
// Patch FADT to fix restart
if (fix_restart)
{
/*
fadt_mod->Flags|= 0x400;
fadt_mod->Reset_SpaceID = 0x01; // System I/O
fadt_mod->Reset_BitWidth = 0x08; // 1 byte
fadt_mod->Reset_BitOffset = 0x00; // Offset 0
fadt_mod->Reset_AccessWidth = 0x01; // Byte access
fadt_mod->Reset_Address = 0x0cf9; // Address of the register
fadt_mod->Reset_Value = 0x06; // Value to write to reset the system
*/
fadt_mod->Flags|= 0x400;
fadt_mod->Reset_SpaceID = 0x01; // System I/O
fadt_mod->Reset_BitWidth = 0x08; // 1 byte
fadt_mod->Reset_BitOffset = 0x00; // Offset 0
fadt_mod->Reset_AccessWidth = 0x01; // Byte access
fadt_mod->Reset_Address = 0x64; // Address of the register
fadt_mod->Reset_Value = 0xfe; // Value to write to reset the system

verbose("FADT: Restart Fix applied!\n");
}

After looking in linux sources and this http://smackerelofopinion.blogspot.com/2009/06/rebooting-pc.html and http://smackerelofopinion.blogspot.com/2011/02/resetting-pc-using-reset-control.html
I think these patchs could become an optional feature in com.apple.Boot.plist:
  • reset fix=keyboard
  • reset fix=pci

I've noticed that apple hardware use the pci reset in their FADT and they have no ps/2 keyboard controller.
My laptop, asus 1201N, use MCP79 chipset like macbook6,1 but I have ps/2 keyboard. Unlike the mac, pci reset didn't work but keyboard reset works (before I was using evoReboot with does the same keyboard reset).
« Last Edit: May 07, 2011, 03:50:48 PM by toine44 »

oldnapalm

  • Member
  • Posts: 45
Re: [PATCH] restart fix Removed !
« Reply #8 on: May 07, 2011, 08:07:36 PM »
Thanks toine44.

Finally restart works in my Acer Aspire 5920.

Loureiro

  • Entrant
  • Posts: 2
Re: [PATCH] restart fix Removed !
« Reply #9 on: May 17, 2011, 07:49:51 PM »
Can someone help me with this fix? I don't know which file I need to edit.

Thanks
« Last Edit: May 17, 2011, 07:51:53 PM by Loureiro »

Gringo Vermelho

  • Forum Moderator
  • Posts: 611
  • The gray monster energy hat
Re: [PATCH] restart fix Removed !
« Reply #10 on: May 18, 2011, 01:09:19 AM »
acpi_patcher.c, line 657
10.9.5 - ASUS P8Z77-V Pro - i5 3570K - GTX 660 - Chameleon 2.3 svn-r2xxx
How to...
Install Chameleon: http://forum.voodooprojects.org/index.php/topic,649
Make your own Chameleon boot CD: http://forum.voodooprojects.org/index.php/topic,484.msg2131.html#msg2131

Loureiro

  • Entrant
  • Posts: 2
Re: [PATCH] restart fix Removed !
« Reply #11 on: May 23, 2011, 02:51:43 AM »
Thanks!  ;D
« Last Edit: May 24, 2011, 02:02:31 AM by Gringo Vermelho »

Slice

  • VoodooLabs
  • Posts: 52
Re: [PATCH] restart fix Removed !
« Reply #12 on: July 22, 2011, 08:05:14 AM »
I don't understand why you remove it.
  • It works on my intel desktop computer
  • I've modified it to make it works in my laptop : using keyboard controller reset (see below)

Code: [Select]
// Patch FADT to fix restart
if (fix_restart)
{
/*
fadt_mod->Flags|= 0x400;
fadt_mod->Reset_SpaceID = 0x01; // System I/O
fadt_mod->Reset_BitWidth = 0x08; // 1 byte
fadt_mod->Reset_BitOffset = 0x00; // Offset 0
fadt_mod->Reset_AccessWidth = 0x01; // Byte access
fadt_mod->Reset_Address = 0x0cf9; // Address of the register
fadt_mod->Reset_Value = 0x06; // Value to write to reset the system
*/
fadt_mod->Flags|= 0x400;
fadt_mod->Reset_SpaceID = 0x01; // System I/O
fadt_mod->Reset_BitWidth = 0x08; // 1 byte
fadt_mod->Reset_BitOffset = 0x00; // Offset 0
fadt_mod->Reset_AccessWidth = 0x01; // Byte access
fadt_mod->Reset_Address = 0x64; // Address of the register
fadt_mod->Reset_Value = 0xfe; // Value to write to reset the system

verbose("FADT: Restart Fix applied!\n");
}

After looking in linux sources and this http://smackerelofopinion.blogspot.com/2009/06/rebooting-pc.html and http://smackerelofopinion.blogspot.com/2011/02/resetting-pc-using-reset-control.html
I think these patchs could become an optional feature in com.apple.Boot.plist:
  • reset fix=keyboard
  • reset fix=pci

I've noticed that apple hardware use the pci reset in their FADT and they have no ps/2 keyboard controller.
My laptop, asus 1201N, use MCP79 chipset like macbook6,1 but I have ps/2 keyboard. Unlike the mac, pci reset didn't work but keyboard reset works (before I was using evoReboot with does the same keyboard reset).
I accepted this patch into my branch of Chameleon since rev1200.

cosmo1t

  • VoodooLabs
  • Posts: 25
Re: [PATCH] restart fix Removed !
« Reply #13 on: July 22, 2011, 02:51:04 PM »
slice can u attach the diff please either to the issue or here so we can get it merged to the trunk
thanks

Slice

  • VoodooLabs
  • Posts: 52
Re: [PATCH] restart fix Removed !
« Reply #14 on: July 22, 2011, 10:14:00 PM »
According to the patch I made the follow: user can choise RestartFix=ACPI | PS2 | NO
My choice
Code: [Select]
<key>RestartFix</key>
<string>PS2</string>
The patch is located in acpi_patcher as usual
Code: [Select]
// Restart Fix
- if (Platform.CPU.Vendor == 0x756E6547) { /* Intel */
+// if (Platform->CPU.Vendor == 0x756E6547) { /* Intel */
  fix_restart = true;
- getBoolForKey(kRestartFix, &fix_restart, &bootInfo->chameleonConfig);
+ value = getStringForKey(kRestartFix, &bootInfo->chameleonConfig);
+ if (value[0] == 'A') {
+ fix_restart_acpi = true;
+ } else if (value[0] == 'P') {
+ fix_restart_acpi = false;
+ } else {
+ fix_restart = false;
+ }
+/*
  } else {
- verbose ("Not an Intel platform: Restart Fix not applied !!!\n");
+ DBG ("Not an Intel platform: Restart Fix not applied !!!\n");
  fix_restart = false;
  }
-
+*/
.........
  if (fix_restart)
  {
+ if (fix_restart_acpi) {
+ fadt_mod->Flags|= 0x400;
+ fadt_mod->Reset_SpaceID = 0x01;   // System I/O
+ fadt_mod->Reset_BitWidth = 0x08;   // 1 byte
+ fadt_mod->Reset_BitOffset = 0x00;   // Offset 0
+ fadt_mod->Reset_AccessWidth = 0x01;   // Byte access
+ fadt_mod->Reset_Address = 0x0cf9; // Address of the register
+ fadt_mod->Reset_Value = 0x06;   // Value to write to reset the system
+ msglog("FADT: ACPI Restart Fix applied!\n");
+ } else {
+ fadt_mod->Flags|= 0x400;
+ fadt_mod->Reset_SpaceID = 0x01;   // System I/O
+ fadt_mod->Reset_BitWidth = 0x08;   // 1 byte
+ fadt_mod->Reset_BitOffset = 0x00;   // Offset 0
+ fadt_mod->Reset_AccessWidth = 0x01;   // Byte access
+ fadt_mod->Reset_Address = 0x64; // Address of the register
+ fadt_mod->Reset_Value = 0xfe;   // Value to write to reset the system
+ msglog("FADT: PS2 Restart Fix applied!\n");
+ }
  }

If you want to see other my diffs look here http://www.projectosx.com/forum/index.php?showtopic=1106&view=findpost&p=15446