Jump to content

Clover Problems and Solutions


ErmaC
3,206 posts in this topic

Recommended Posts

?!?!

XHCI is obviously for USB 3.0...

 

I know.

Without this patch I had 14 porst of USB2.0 + 1 port of USB 3.0, working in one connector only.

With this patch I have 14 ports of USB2.0 + 10 ports of USB 3.0, full working.

  • Like 1
Link to comment
Share on other sites

I know.

Without this patch I had 14 porst of USB2.0 + 1 port of USB 3.0, working in one connector only.

With this patch I have 14 ports of USB2.0 + 10 ports of USB 3.0, full working.

I see.

Yes. 14 + 1 == 15. Which matches the maximum port restrictions. This may because USB3 supports USB2 as well.

Link to comment
Share on other sites

  • 2 weeks later...

Recently, I've been working to fix some minor issues/bugs in Clover. It would be nice if these patches could be upstreamed:

  • Like 5
Link to comment
Share on other sites

Hi.

It seems that CsrActiveConfig = 0xFFFF is broken. It means that SIP fully disabled rather than not set this property...

 

And. The "Family" can be also "Mac Pro". I think both "MacPro" and "Mac Pro" are okay.

So change

if (gSettings.smartUPS == TRUE || (AsciiStrnCmp (gSettings.FamilyName, "MacPro", 6) == 0)

to

if (gSettings.smartUPS == TRUE || (AsciiStrnCmp (gSettings.FamilyName, "MacPro", 6) == 0 || (AsciiStrnCmp (gSettings.FamilyName, "Mac Pro", 6) == 0)

BTW. I saw Revoboot used the "Family" without "spaces" in certain models, but Clover did. (e.g. "MacBookPro" v.s. "MacBook Pro")

Link to comment
Share on other sites

If gSettings.CsrActiveConfig is set to 0xFFFF, Clover shouldn't set the NVRAM variable:

  //Hack for recovery by Asgorath
  if (gSettings.CsrActiveConfig != 0xFFFF) {
    SetNvramVariable(L"csr-active-config", &gAppleBootVariableGuid, Attributes, sizeof(gSettings.CsrActiveConfig), &gSettings.CsrActiveConfig);
  }

As for the Mac Pro family check, we could just compare gSettings.ProductName.

Link to comment
Share on other sites

If gSettings.CsrActiveConfig is set to 0xFFFF, Clover shouldn't set the NVRAM variable:

  //Hack for recovery by Asgorath
  if (gSettings.CsrActiveConfig != 0xFFFF) {
    SetNvramVariable(L"csr-active-config", &gAppleBootVariableGuid, Attributes, sizeof(gSettings.CsrActiveConfig), &gSettings.CsrActiveConfig);
  }

Yep but I dunno why, when I set CsrActiveConfig to 0xFFFF, it shows that SIP is fully disabled. (I didn't set any of this before.) So I think 0xFFFF for  CsrActiveConfig in Clover may be broken.

As for the Mac Pro family check, we could just compare gSettings.ProductName.

Great! Good idea.

Link to comment
Share on other sites

if (gSettings.smartUPS == TRUE || (AsciiStrnCmp (gSettings.FamilyName, "MacPro", 6) == 0 || (AsciiStrnCmp (gSettings.FamilyName, "Mac Pro", 6) == 0)

1) Bools should not be compared to TRUE/FALSE.

2) "MacPro" should be compared to a maximum length of 7 and "Mac Pro" to 8, otherwise you cannot be sure that the name is terminated then. You did not increase the max length in the 2nd check anyway.

  • Like 2
Link to comment
Share on other sites

1) Bools should not be compared to TRUE/FALSE.

2) "MacPro" should be compared to a maximum length of 7 and "Mac Pro" to 8, otherwise you cannot be sure that the name is terminated then. You did not increase the max length in the 2nd check anyway.

Thanks. That boolean was not done by me. Oops. I don't have a look at Clover source code ATM, but I'd like to know that what's that '6' mean in AsciiStrnCmp() $3? It means the maximum length?

Link to comment
Share on other sites

1) Bools should not be compared to TRUE/FALSE.

2) "MacPro" should be compared to a maximum length of 7 and "Mac Pro" to 8, otherwise you cannot be sure that the name is terminated then. You did not increase the max length in the 2nd check anyway.

Good catch, the length shouldn't be 6. I didn't add the boolean comparison (it was already present in Clover's source) but it should be changed.

Link to comment
Share on other sites

Good catch, the length shouldn't be 6. I didn't add the boolean comparison (it was already present in Clover's source) but it should be changed.

BTW could the value smartUPS be a string ('Yes' or 'No') instead of bool? If yes and then in this case we have to add this check as well...

Link to comment
Share on other sites

BTW could the value smartUPS be a string ('Yes' or 'No') instead of bool? If yes and then in this case we have to add this check as well...

 

My 2 cents are to deprecate "Yes"/"No", that adds unnecessary parsing, storage and comparison time for no real benefit. IF you want to keep it, there should be some Clover func to check bools.

  • Like 3
Link to comment
Share on other sites

My 2 cents are to deprecate "Yes"/"No", that adds unnecessary parsing, storage and comparison time for no real benefit. IF you want to keep it, there should be some Clover func to check bools.

.. It seems that almost all bools in config.plist are also supporting str

<string>Yes/No</string>

IMO the same as you. This will only make Clover source code more complicated (to check str besides bool)...

Link to comment
Share on other sites

 

Recently, I've been working to fix some minor issues/bugs in Clover. It would be nice if these patches could be upstreamed:

 

 

Thanks for those patches.

I'm testing them right now.

 

However there is a problem with the patch "Platform/AcpiPatcher: Set FADT PM Profile to 3 for Mac Pro":

error: too many arguments to function call, expected 2, have 3
    if ((gSettings.smartUPS == TRUE) || (AsciiStrCmp (gSettings.FamilyName, "MacPro", 6) == 0)) { 

                                         ~~~~~~~~~~~                                  ^

 
Fix for edk2 version 24109:
    if ((gSettings.smartUPS == TRUE) || (AsciiStrCmp(gSettings.FamilyName, "MacPro") == 0)) {

 

Edit:

About Platform: Fix external clock calculation for quad-pumped FSBs

I now have Busspeed information gone in system information and in clover log I have:

`FSB: 25 MHz` Is this correct? Shouldn't it be 100 MHz?

Before that patch I had 400 MHz.

I have sandy bridge i7 2600k @ 4.3 GHz

 

Edit2:

I just noticed your patch notes:

AppleSMBIOS.kext reads the FSB frequency from SMBIOS table type 132.
If this structure isn't present, it assumes that the processor uses
a quad-pumped FSB (multiplied by four) and reads the external clock
frequency from SMBIOS table type 4. Macs that lack SMBIOS table type
132 (Sandy Bridge/Ivy Bridge/Haswell/Broadwell/Skylake processors) set
the external clock to 25 MHz (one fourth of the FSB frequency). Set the
SMBIOS table type 4 external clock frequency to one fourth of the FSB
frequency and do not inject SMBIOS table type 132 for these processors.

According to that your patch works for me too. My question is: Is that information correct?

 

Edit3:

Apple open sourced the AppleSMBIOS, so I'm assuming you are correct.

  • Like 1
Link to comment
Share on other sites

 

Edit:

About Platform: Fix external clock calculation for quad-pumped FSBs

I now have Busspeed information gone in system information and in clover log I have:

`FSB: 25 MHz` Is this correct? Shouldn't it be 100 MHz?

Before that patch I had 400 MHz.

I have sandy bridge i7 2600k @ 4.3 GHz

 

Edit2:

I just noticed your patch notes:

AppleSMBIOS.kext reads the FSB frequency from SMBIOS table type 132.
If this structure isn't present, it assumes that the processor uses
a quad-pumped FSB (multiplied by four) and reads the external clock
frequency from SMBIOS table type 4. Macs that lack SMBIOS table type
132 (Sandy Bridge/Ivy Bridge/Haswell/Broadwell/Skylake processors) set
the external clock to 25 MHz (one fourth of the FSB frequency). Set the
SMBIOS table type 4 external clock frequency to one fourth of the FSB
frequency and do not inject SMBIOS table type 132 for these processors.

According to that your patch works for me too. My question is: Is that information correct?

 

Edit3:

Apple open sourced the AppleSMBIOS, so I'm assuming you are correct.

Not sure.

This is iMac12,2 with SandyBridge

Handle 0x0000, DMI type 4, 35 bytes
0000: 04 23 00 00 03 03 01 02 a7 06 02 00 ff fb eb bf 
0010: 01 80 00 00 48 0d 7b 0d 41 04 02 00 03 00 04 00 
0020: 00 04 00 

Processor Information
	Socket Designation: U2E1
	Type: Central Processor
	Family: Other
	Manufacturer: Intel(R) Corporation
	ID: A7 06 02 00 FF FB EB BF
	Version: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
	Voltage: 0.0 V
	External Clock: Unknown
	Max Speed: 3400 MHz
	Current Speed: 3451 MHz

MacPro4,1, the dump I have

PM Profile : 01 [Desktop]

BTW could the value smartUPS be a string ('Yes' or 'No') instead of bool? If yes and then in this case we have to add this check as well...

Clover uses procedure IsPropertyTrue

BOOLEAN
IsPropertyTrue (
                TagPtr Prop
                )
{
  return Prop != NULL &&
  ((Prop->type == kTagTypeTrue) ||
   ((Prop->type == kTagTypeString) && Prop->string &&
    ((Prop->string[0] == 'y') || (Prop->string[0] == 'Y'))));
}

  • Like 1
Link to comment
Share on other sites

@slice, sherlocks

 

the  nvram save scripts work good with EmuVariable now included with Clover. however, it was not properly screening out for systems that is does not need to save to a file.

please update Clover with these updated scripts.

 

tested it

 

-------------------------------

DATE: 2017-03-19 TIME: 14:43:15

-------------------------------

>> Begin Script: /etc/rc.shutdown.d/80.save_nvram_plist.local

v1.16.2 © 2017 syscl/lighting/Yating Zhou/tluck/Sherlocks

2017-03-19-14:43:16  disk0: ESP -- Target  -- /Volumes/ESP-01/EFI/CLOVER

2017-03-19-14:43:16  NVRAM: No change since last update in /Volumes/ESP-01/nvram.plist

>> End Script: /etc/rc.shutdown.d/80.save_nvram_plist.local

 

Supreme-MBP:~ supreme$ sudo /etc/rc.shutdown.d/80.save_nvram_plist.local

v1.16.2 © 2017 syscl/lighting/Yating Zhou/tluck/Sherlocks

2017-03-19-14:44:29  disk0: ESP -- Target  -- /Volumes/ESP-01/EFI/CLOVER

2017-03-19-14:44:29  NVRAM: Updated new values in /Volumes/ESP-01/nvram.plist

Supreme-MBP:~ supreme$ 

 

 

-------------------------------

DATE: 2017-03-19 TIME: 14:43:43
-------------------------------
>> Begin Script: /private/etc/rc.boot.d/10.save_and_rotate_boot_log.local
Clover boot messages saved in /Library/Logs/CloverEFI/boot.log
>> End Script: /private/etc/rc.boot.d/10.save_and_rotate_boot_log.local
 
>> Begin Script: /private/etc/rc.boot.d/20.mount_ESP.local
Not auto mounting EFI partition
v1.16.2 © 2017 syscl/lighting/Yating Zhou/tluck/Sherlocks
Registering LogoutHook as /Library/Application Support/Clover/CloverDaemon-stopservice
>> End Script: /private/etc/rc.boot.d/20.mount_ESP.local
 

 

good. no problem.

 

added. 

i added Xserve1,1~3,1 information in platformdata.

i tested build from clover r4044.

 

added

I changed the credit part that cecekpawon gave me.

 

always thanks in advance

Platformdata-added Xserve Series.zip

nvram-logouthook_v1.16.2 edited credit.zip

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

@Slice

 

report one

If the patch is disabled, the disable log will not appear. Also, it does not move down and is displayed strangely.

4:491  0:358  Patching DSDT:
4:491  0:000   - [change APSS to APXX]: - [change _DSM to XDSM]: pattern 5F44534D, patched at: [ (2AAC) (13AA) (8B) (52) (C7B) (111) (64F) (468) (11) (51) (22) (21) (15) (14) (103) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (28A) (1418) (F1) (F1) (F1) (F1) (F1) (DA) (DA) (E8) (131) (131) (2C0) (4A4) (103F) (14A) (B8) (E1E) (4B7) (349F) ]

4:497  0:000  === [ PatchAllSSDT ] ======================================
4:497  0:000  Patch table: SSDT  Tpm2Tabl len=0x4C5
4:497  0:000  0. [change APSS to APXX]:1. [change _DSM to XDSM]: pattern 5F44534D, patched at: [ (427) ]
4:497  0:000  2. [change _OSI to XOSI, pair with SSDT-XOSI.aml]: pattern 5F4F5349, bin not found / already patched!

here is result from fix

4:502  0:352  Patching DSDT:
4:502  0:000   - [change APSS to APXX]: disabled
4:502  0:000   - [change _DSM to XDSM]: pattern 5F44534D, patched at: [ (2AAC) (13AA) (8B) (52) (C7B) (111) (64F) (468) (11) (51) (22) (21) (15) (14) (103) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (379) (28A) (1418) (F1) (F1) (F1) (F1) (F1) (DA) (DA) (E8) (131) (131) (2C0) (4A4) (103F) (14A) (B8) (E1E) (4B7) (349F) ]
4:502  0:000   - [change _OSI to XOSI, pair with SSDT-XOSI.aml]: pattern 5F4F5349, patched at: [ (1157E) (3) (11) (18) (1C) (1C) (1A) (18) (18) (18) (18) (DB9) ]


4:507  0:000  Patch table: SSDT  Tpm2Tabl len=0x4C5
4:507  0:000  0. [change APSS to APXX]: disabled
4:507  0:000  1. [change _DSM to XDSM]: pattern 5F44534D, patched at: [ (427) ]
4:507  0:000  2. [change _OSI to XOSI, pair with SSDT-XOSI.aml]: pattern 5F4F5349, bin not found / already patched!

 

 

i tested build r4046.

 

thanks in advance :)

log fix.zip

Link to comment
Share on other sites

I wish I don't miss something here, if I have, please let me know. 

 

I've seen @Sherlock and @tluck's great work on the script 80.save_nvram_plist.local, nice! 

 

Now, lvs1974 pushed it step forward to add UTC patch for 80.save_nvram_plist.local to support hibernate mode = 3 or hibernate mode = 25 pairing with his hibernatefixup plugin. 

 

Here's the latest 80.save_nvram_plist.local @Slice

 

80.save_nvram_plist.local.zip

 

All the best,

syscl

  • Like 2
Link to comment
Share on other sites

@syscl

 

i dont understand why we need this change? it puts the file stamp into the future for me!?

 

<     gDmpTimeStamp=$(date -u +%Y-%m-%d-%H:%M:%S)
---
>     gDmpTimeStamp=$(date +%Y-%m-%d-%H:%M:%S)
343,344d342
<             gUtcTimeStamp=$(date -u +%Y%m%d%H%M.%S)
<             touch -t "${gUtcTimeStamp}" "${gTarPath}/${gNVRAMf}"
350,351d347
<         gUtcTimeStamp=$(date -u +%Y%m%d%H%M.%S)
<         touch -t "${gUtcTimeStamp}" "${gTarPath}/${gNVRAMf}"

Link to comment
Share on other sites

×
×
  • Create New...