Jump to content

Clover Problems and Solutions


ErmaC
3,206 posts in this topic

Recommended Posts

Hello Slice, its me again sir.

 

To fix my display (ivybridge) i had to use FixDisplay_0100 & ReuseFFFF along with AddDTGP_0001 (for sure) & UseIntelHDMI = FALSE (since i want to add all of that properties with my extra SSDT). Even with NoDefaultProperties = TRUE, Clover appear to force injecting "useless" _DSM method into my DSDT, so my own _DSM method from SSDT simply ignored.

 

Would like to propose patch below to FixBiosDsdt.c  (sample for NVidia only) to prevent Clover injecting _DSM method if user has set NoDefaultProperties = TRUE.

--- /Users/x/Desktop/FixBiosDsdt.c  2016-01-22 16:58:31.000000000 
+++ /Users/x/src/edk2/Clover/rEFIt_UEFI/Platform/FixBiosDsdt.c  2016-03-24 22:33:33.000000000 
@@ -2363,18 +2363,18 @@
     aml_add_local0(met);
     aml_add_buffer(met, dtgp_1, sizeof(dtgp_1));
     // finish Method(_DSM,4,NotSerialized)
   }
 
   // NVIDIA
-  if ((DisplayVendor[VCard] == 0x10DE)  && !DsmFound) {
+  if ((DisplayVendor[VCard] == 0x10DE) && !gSettings.NoDefaultProperties && !DsmFound) {
     DBG("Creating DSM for NVIDIA card\n");
     met = aml_add_method(gfx0, "_DSM", 4);
     met2 = aml_add_store(met);
     pack = aml_add_package(met2);
-    if (!gSettings.NoDefaultProperties) {
+    //if (!gSettings.NoDefaultProperties) {
       if (gSettings.FakeNVidia) {
         FakeID = gSettings.FakeNVidia >> 16;
         aml_add_string(pack, "device-id");
         aml_add_byte_buffer(pack, (CHAR8*)&FakeID, 4);
         FakeVen = gSettings.FakeNVidia & 0xFFFF;
         aml_add_string(pack, "vendor-id");
@@ -2385,13 +2385,13 @@
         if (gSettings.UseIntelHDMI) {
           aml_add_string_buffer(pack, "onboard-2");
         } else {
           aml_add_string_buffer(pack, "onboard-1");
         }
       }
-    }
+    //}
     if(!AddProperties(pack, DEV_NVIDIA) &&
        !GFXHDAFIX &&
        !gSettings.FakeNVidia) {
       aml_add_string(pack, "empty");
       aml_add_byte(pack, 0);
     }

Before

Device (PEG0)
{
    Name (_ADR, 0x00010000)  // _ADR: Address
    
    ...

    Device (GFX1)
    {
        Name (_ADR, 0x0000)  // _ADR: Address
        Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
        {
            Store (Package (0x00) {}, Local0)
            DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
            Return (Local0)
        }

        Name (_SUN, 0x00000001)  // _SUN: Slot User Number
    }
}

After

Device (PEG0)
{
    Name (_ADR, 0x00010000)  // _ADR: Address
    
    ...

    Device (GFX1)
    {
        Name (_ADR, 0x0000)  // _ADR: Address
        Name (_SUN, 0x00000001)  // _SUN: Slot User Number
    }
}

Let me know what you think

  • Like 3
Link to comment
Share on other sites

@cecekpawon

OK, I committed this patch, as well extended it for ATI and Intel. Rev 3372.

I don't remember why I did empty _DSM. Will test and collect experience.

 

@voll@

./ebuild.sh -clang

 

Be sure you have

/usr/local/bin/mtoc.NEW

use sudo to copy

sudo cp -v ~/Downloads/mtoc.NEW /usr/local/bin/

 

mtoc.NEW.zip

 

 

@Carmine, this thread is not for questions. Use General Discussion.

  • Like 1
Link to comment
Share on other sites

Skylake systems will see this in the 1st two lines of bdmesg output:

 

0:100 0:100 MemLog inited, TSC freq: 4008553830

0:100 0:000 MemLog was calibrated without ACPI PM Timer: ACPI I/O space is not enabled.

Instead of relying on LPC, the TSC timer for Skylake chipsets relies on SMBUS—see line 71 of /edk2/PerformancePkg/Library/TscTimerLib/TscTimerLibShare.c

 

Thus for Skylake this should be:

 

TimerAddr = ((PciRead16 (PCI_ICH_SMBUS_ADDRESS (R_ICH_SMBUS_ACPI_BASE))) & B_ICH_SMBUS_ACPI_BASE_BAR) + R_ACPI_PM1_TMR;

Would test this right now, but am currently getting build fails w/ CloverGrowerPro.

Link to comment
Share on other sites

Skylake systems will see this in the 1st two lines of bdmesg output:

 

0:100 0:100 MemLog inited, TSC freq: 4008553830

0:100 0:000 MemLog was calibrated without ACPI PM Timer: ACPI I/O space is not enabled.

Instead of relying on LPC, the TSC timer for Skylake chipsets relies on SMBUS—see line 71 of /edk2/PerformancePkg/Library/TscTimerLib/TscTimerLibShare.c

 

Thus for Skylake this should be:

 

TimerAddr = ((PciRead16 (PCI_ICH_SMBUS_ADDRESS (R_ICH_SMBUS_ACPI_BASE))) & B_ICH_SMBUS_ACPI_BASE_BAR) + R_ACPI_PM1_TMR;

Would test this right now, but am currently getting build fails w/ CloverGrowerPro.

 

Can you suggest how to add this to existing codes?

  if ((PciRead16 (PCI_ICH_LPC_ADDRESS (0))) != 0x8086) { // Intel ICH device was not found
    AsciiSPrint(InitError, sizeof(InitError), "Intel ICH device was not found.");
  } else if ((PciRead8 (PCI_ICH_LPC_ADDRESS (R_ICH_LPC_ACPI_CNT)) & B_ICH_LPC_ACPI_CNT_ACPI_EN) == 0) { // ACPI I/O space is not enabled
    AsciiSPrint(InitError, sizeof(InitError), "ACPI I/O space is not enabled.");
  } else if ((TimerAddr = ((PciRead16 (PCI_ICH_LPC_ADDRESS (R_ICH_LPC_ACPI_BASE))) & B_ICH_LPC_ACPI_BASE_BAR) + R_ACPI_PM1_TMR) == 0) { // Timer address can't be obtained
    AsciiSPrint(InitError, sizeof(InitError), "Timer address can't be obtained.");
  } else {
    // Check that Timer is advancing
    AcpiTick0 = IoRead32 (TimerAddr);
    gBS->Stall(1000); // 1ms
    AcpiTick1 = IoRead32(TimerAddr);
    if (AcpiTick0 == AcpiTick1) { // Timer is not advancing
      TimerAddr = 0; // Flag it as not working
      AsciiSPrint(InitError, sizeof(InitError), "Timer is not advancing.");
    }
  }

Link to comment
Share on other sites

Can you suggest how to add this to existing codes?

Perhaps this?

 

  if ((PciRead16 (PCI_ICH_LPC_ADDRESS (0))) != 0x8086) { // Intel ICH device was not found
    AsciiSPrint(InitError, sizeof(InitError), "Intel ICH device was not found.");
  } else if ((PciRead8 (PCI_ICH_LPC_ADDRESS (R_ICH_LPC_ACPI_CNT)) & B_ICH_LPC_ACPI_CNT_ACPI_EN) == 0) { // Check for TSC at LPC (default location)
    if ((PciRead8 (PCI_ICH_SMBUS_ADDRESS (R_ICH_SMBUS_ACPI_CNT)) & B_ICH_SMBUS_ACPI_CNT_ACPI_EN) != 0) { // Check for TSC at SMBUS (Skylake specific)
      TimerAddr = (PciRead16 (PCI_ICH_SMBUS_ADDRESS (R_ICH_SMBUS_ACPI_BASE)) & B_ICH_SMBUS_ACPI_BASE_BAR) + R_ACPI_PM1_TMR;
    } else {
      AsciiSPrint(InitError, sizeof(InitError), "ACPI I/O space is not enabled.");
    }
  } else if ((TimerAddr = ((PciRead16 (PCI_ICH_LPC_ADDRESS (R_ICH_LPC_ACPI_BASE))) & B_ICH_LPC_ACPI_BASE_BAR) + R_ACPI_PM1_TMR) == 0) { // Timer address can't be obtained
    AsciiSPrint(InitError, sizeof(InitError), "Timer address can't be obtained.");
  } else {
    // Check that Timer is advancing
    AcpiTick0 = IoRead32 (TimerAddr);
    gBS->Stall(1000); // 1ms
    AcpiTick1 = IoRead32(TimerAddr);
    if (AcpiTick0 == AcpiTick1) { // Timer is not advancing
      TimerAddr = 0; // Flag it as not working
      AsciiSPrint(InitError, sizeof(InitError), "Timer is not advancing.");
    }
  }
Link to comment
Share on other sites

Perhaps this?

 

  if ((PciRead16 (PCI_ICH_LPC_ADDRESS (0))) != 0x8086) { // Intel ICH device was not found
    AsciiSPrint(InitError, sizeof(InitError), "Intel ICH device was not found.");
  } else if ((PciRead8 (PCI_ICH_LPC_ADDRESS (R_ICH_LPC_ACPI_CNT)) & B_ICH_LPC_ACPI_CNT_ACPI_EN) == 0) { // Check for TSC at LPC (default location)
    if ((PciRead8 (PCI_ICH_SMBUS_ADDRESS (R_ICH_SMBUS_ACPI_CNT)) & B_ICH_SMBUS_ACPI_CNT_ACPI_EN) != 0) { // Check for TSC at SMBUS (Skylake specific)
      TimerAddr = (PciRead16 (PCI_ICH_SMBUS_ADDRESS (R_ICH_SMBUS_ACPI_BASE)) & B_ICH_SMBUS_ACPI_BASE_BAR) + R_ACPI_PM1_TMR;
    } else {
      AsciiSPrint(InitError, sizeof(InitError), "ACPI I/O space is not enabled.");
    }
  } else if ((TimerAddr = ((PciRead16 (PCI_ICH_LPC_ADDRESS (R_ICH_LPC_ACPI_BASE))) & B_ICH_LPC_ACPI_BASE_BAR) + R_ACPI_PM1_TMR) == 0) { // Timer address can't be obtained
    AsciiSPrint(InitError, sizeof(InitError), "Timer address can't be obtained.");
  } else {
    // Check that Timer is advancing
    AcpiTick0 = IoRead32 (TimerAddr);
    gBS->Stall(1000); // 1ms
    AcpiTick1 = IoRead32(TimerAddr);
    if (AcpiTick0 == AcpiTick1) { // Timer is not advancing
      TimerAddr = 0; // Flag it as not working
      AsciiSPrint(InitError, sizeof(InitError), "Timer is not advancing.");
    }
  }

But I think we should first check on chipset if it is skylake or no.

Link to comment
Share on other sites

Thanks. But it looks like that fails as well:

 

error C0DE: Unknown fatal error when processing [/users/zxv/src/edk2/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf]

 

I'm building Clover fine with edk2 reverted to r20307 (admittedly, it is a bit of a random number)

Link to comment
Share on other sites

Thanks. But it looks like that fails as well:

 

error C0DE: Unknown fatal error when processing [/users/zxv/src/edk2/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf]

 

 

idk how the script works, but can you run 'build' in verbose mode and post the full error output?

Link to comment
Share on other sites

idk how the script works, but can you run 'build' in verbose mode and post the full error output?

build.py...
 : error C0DE: Unknown fatal error when processing [/Volumes/Dev/CloverGrowerPro/edk2/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf]
	
(Please send email to edk2-devel@lists.01.org for help, attaching following call stack trace!)

(Python 2.7.10 on darwin) Traceback (most recent call last):
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 2062, in Main
    MyBuild.Launch()
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 1815, in Launch
    self._MultiThreadBuildPlatform()
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 1650, in _MultiThreadBuildPlatform
    Ma.CreateMakeFile(True)
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py", line 3519, in CreateMakeFile
    LibraryAutoGen.CreateMakeFile()
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py", line 3525, in CreateMakeFile
    if Makefile.Generate():
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/GenMake.py", line 184, in Generate
    FileContent = self._TEMPLATE_.Replace(self._TemplateDict)
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/GenMake.py", line 512, in _CreateTemplateDict
    RespDict = self.CommandExceedLimit()
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/GenMake.py", line 716, in CommandExceedLimit
    SingleCommandLength += self._AutoGenObject.IncludePathLength + len(IncPrefix) * len(self._AutoGenObject._IncludePathList)
AttributeError: 'ModuleAutoGen' object has no attribute 'IncludePathLength'

This is the complete error message.

Link to comment
Share on other sites

build.py...
 : error C0DE: Unknown fatal error when processing [/Volumes/Dev/CloverGrowerPro/edk2/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf]
	
(Please send email to edk2-devel@lists.01.org for help, attaching following call stack trace!)

(Python 2.7.10 on darwin) Traceback (most recent call last):
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 2062, in Main
    MyBuild.Launch()
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 1815, in Launch
    self._MultiThreadBuildPlatform()
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 1650, in _MultiThreadBuildPlatform
    Ma.CreateMakeFile(True)
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py", line 3519, in CreateMakeFile
    LibraryAutoGen.CreateMakeFile()
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py", line 3525, in CreateMakeFile
    if Makefile.Generate():
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/GenMake.py", line 184, in Generate
    FileContent = self._TEMPLATE_.Replace(self._TemplateDict)
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/GenMake.py", line 512, in _CreateTemplateDict
    RespDict = self.CommandExceedLimit()
  File "/Volumes/Dev/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/GenMake.py", line 716, in CommandExceedLimit
    SingleCommandLength += self._AutoGenObject.IncludePathLength + len(IncPrefix) * len(self._AutoGenObject._IncludePathList)
AttributeError: 'ModuleAutoGen' object has no attribute 'IncludePathLength'

This is the complete error message.

 

Same 

Link to comment
Share on other sites

Hello i have this error with latest commit

Processing meta-data ........ 


build.py...
 : error C0DE: Unknown fatal error when processing [/Users/alex/CloverGrowerPro/edk2/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf]
	
(Please send email to edk2-devel@lists.01.org for help, attaching following call stack trace!)

(Python 2.7.10 on darwin) Traceback (most recent call last):
  File "/Users/alex/CloverGrowerPro/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 2062, in Main
    MyBuild.Launch()
  File "/Users/alex/CloverGrowerPro/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 1815, in Launch
    self._MultiThreadBuildPlatform()
  File "/Users/alex/CloverGrowerPro/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 1650, in _MultiThreadBuildPlatform
    Ma.CreateMakeFile(True)
  File "/Users/alex/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py", line 3519, in CreateMakeFile
    LibraryAutoGen.CreateMakeFile()
  File "/Users/alex/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py", line 3525, in CreateMakeFile
    if Makefile.Generate():
  File "/Users/alex/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/GenMake.py", line 184, in Generate
    FileContent = self._TEMPLATE_.Replace(self._TemplateDict)
  File "/Users/alex/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/GenMake.py", line 512, in _CreateTemplateDict
    RespDict = self.CommandExceedLimit()
  File "/Users/alex/CloverGrowerPro/edk2/BaseTools/Source/Python/AutoGen/GenMake.py", line 716, in CommandExceedLimit
    SingleCommandLength += self._AutoGenObject.IncludePathLength + len(IncPrefix) * len(self._AutoGenObject._IncludePathList)
AttributeError: 'ModuleAutoGen' object has no attribute 'IncludePathLength'


- Failed -
Build end time: 20:52:13, Mar.25 2016
Build total time: 00:00:08

Cloverx64 release  ERROR!!

Link to comment
Share on other sites

It looks like the relocation block needs increasing again (multiple reports of problems with 10.11.4 update).

 

Initial tests (I made a test version available) indicate an increase to 128mb (from 96mb) is adequate:

 

SPEEDY-OSX:Clover RehabMan$ svn diff
Index: OsxAptioFixDrv/OsxAptioFixDrv.c
===================================================================
--- OsxAptioFixDrv/OsxAptioFixDrv.c	(revision 3371)
+++ OsxAptioFixDrv/OsxAptioFixDrv.c	(working copy)
@@ -51,8 +51,7 @@
 // defines the size of block that will be allocated for kernel image relocation,
 //   without RT and MMIO regions
 // rehabman - Increase the size for ElCapitan to 128Mb 0x8000
-// stinga11 - 0x6000
-#define KERNEL_BLOCK_NO_RT_SIZE_PAGES	0x6000
+#define KERNEL_BLOCK_NO_RT_SIZE_PAGES	0x8000
 
 // TRUE if we are doing hibernate wake
 BOOLEAN gHibernateWake = FALSE;
Link to comment
Share on other sites

I didn't try here, but some guy I let try a 0x8000 reloc block and it was too small as well. I don't have time now to test it through, but once I'm sure, I can report back. ;)

Probably the more stuff in kernel cache, the larger it has to be...

Link to comment
Share on other sites

Reverted edk2 to 20288 and build for Clover r3375 succeeded (thanks @discipline).

 

In terminal, cd to wherever your edk2 dir is (e.g. "~/src/.GitHub/CloverGrowerPro/edk2")

Input "svn update -r 20288"

When conflict prompts appear, input "tc"

Finally, run "cloverpro -n" (to disregard autoupdating edk2)

  • Like 2
Link to comment
Share on other sites

×
×
  • Create New...