Jump to content

Latitude E6420: DSDT review


noname33

Recommended Posts

Hi!

 

Excuse my bad English, I try it.

 

Well, I have a Latitude, so, the name of the forum seems like tailored :).

 

Also, that I go to write here, I think 'affect' almost every Dell, at least I found the same 'problem' for Latitude, Vostro, XPS and Inspiron.

 

My original dsdt, (I have BIOS A24) had 100 error. Those error was clearly error, some of them difficult to accept because they were too big errors, but well, anyway I solved that.

 

But, so many errors leaded me to think about the full code, even when it hasn't errors now, I readed shallow the code and easily I saw that code could be very much optimized, and I made willing to at least, give it a review, and due that, I have done a trace of my DSDT functions sequence, and I can't understand utterly.

 

Here is a summary of the DSDT trace from the start of a Latitude:

 

__________________

 

//Running DSDT of Dell e6420 Nvidia i7-2640

 

 Scope (_SB.PCI0)
    {
        Method (_INI, 0, NotSerialized)
        {

           //Here go to ev1, and later to other, but the final point of the redirects is:
            Store (^LPCB.EC.ECR1 (0x06), APRE)
————

Then ECR1:

            Method (ECR1, 1, NotSerialized)
            {
                If (LEqual (ECRD, Zero))
                {
                    Return (EISC (0x80, Arg0, Zero))
————

Then ECRD :

   Scope (\)
    {
        Name (ECRD, Zero)

————

Then, due ECRD=0, ECR1 return  EISC (0x80, Arg0/*arg0=0x06*/, Zero) :

        Method (EISC, 3, NotSerialized)
        {
            Acquire (ECSX, 0xFFFF)
            Name (ECIB, Buffer (0x04) {})
            CreateByteField (ECIB, Zero, ECIC)
            CreateByteField (ECIB, One, ECP1)
            CreateByteField (ECIB, 0x02, ECP2)
            Store (Arg0, ECIC) //<— here ECIB[0]=0x80
            Store (Arg1, ECP1)//<— here ECIB[1]=0x06
            Store (Arg2, ECP2)//<— here ECIB[2]=0x00
            Store (GENS (0x08, ECIB, SizeOf (ECIB)), ECIB)
      
————

Then ECIB  = GENS (0x08, ECIB, SizeOf (ECIB))

     Method (GENS, 3, NotSerialized)
        {
            If (LEqual (ObjectType (Arg1), 0x03)) //<— obj type 3 = buffer, and arg1 is a buffer, so enter here
            {
                Store (SMBF (Arg0, Arg1, Arg2), Local0)
————

Then SMBF:

        Method (SMBF, 3, NotSerialized)
        {
            SNVC (Arg0)
            Divide (Arg2, 0x04, Local0, Local1)
            Store (Zero, Local1)
            While (LLess (Local1, Local0))
            {
                SNWB (Arg1, Local1)
                Increment (Local1)
            }

            While (LLess (Local1, Arg2))
            {
                SNVP (Arg1, Local1)
                Add (Local1, 0x04, Local1)
            }
————
————

Let's go to stop here and repeat more in details SMBF

 

          //1) SNVC (Arg0) means => 
        OperationRegion (WWPR, SystemMemory, SMIB, 0x04);
        Field (WWPR, DWordAcc, Lock, Preserve) {SCDW,   32 };
        Store (Arg0, SCDW) //<-- then SCDW = 00 00 00 08
        //If SMIB == 0x1000 then memory address 0x10000=00, 0x10001=00, 0x10002=00 and 0x10003=08

 

            2) Divide (Arg2, 0x04, Local0, Local1) //=> 4/4 = 1, then local1=1 and local0=0

 

            3) Store (Zero, Local1)//<-- set local1 to 0

 

            4) While (LLess (Local1, Local0))//<— skip this because both, local1 and local0 are equal,
            {
                SNWB (Arg1, Local1)
                Increment (Local1)
            }

 

            5) While (LLess (Local1, Arg2)) //<— enter here, because local1=0 and Arg2=4
            {
               //6) SNVP (Arg1, Local1) means =>
               OperationRegion (WWPR, SystemMemory, Add (Add (SMIB, Arg1), 0x04), 0x04);

               Field (WWPR, ByteAcc, Lock, Preserve) {SDW0,   32};
               CreateDWordField (Arg0, Arg1, SVAL);
               Store (SVAL, SDW0);


                Add (Local1, 0x04, Local1)//<-- add 4, and now local1=4, and there is only one itinerancy for this time, and end here.
            }

__________________


In the point 6, inside of SNVP function, I would say the real value of ECIB in that moment should be: ECIB = Buffer(0x04){0x80, 0x06, 0x00, 0x00}

 

Well, then the SNVP 'while' clause, makes this:

CreateDWordField (ECIB, 0, SVAL) //<— SVAL = 00 00 06 80

 

But, the access is ByteAcc, so, I believe that access force to get only one byte, and after math we will have:

Store (SVAL, SDW0);//<— SDW0 = 00 00 00 80.

 

Then the real value of than buffer, isn't stored in SDW0.

 

I believe that access of ByteAcc for a Dword field with a dword region space, and a dword buffer, and a dword itineration, could be a mistake and perhaps should be dword access (like SNVC at the beginning of SMBF)

 

Even the name 'SDW0' I would say stands for 'Storage Double Word 0', and the buffer have 4 bytes, even the itineration are 4 bytes to 4 bytes. All match for have a Dword access, but what there is written is ByteAcc

 

I think if the field WWPR of SNVP would have a DwordAcc , then I guess in that point SDW0 would be 00 00 06 80 (which is the real buffer value) instead of 00 00 00 80 that is what I believe it will take with the ByteAcc. With a ByteAcc for a DwordField and only one itineration, I can't understand

 

I searched and found DSDTs of other Dell model, but all of them are the same. For all Dell model from the same epoch, the SNVC (Storage Non Volatile Constant), SNVP, SNVG, SNWB, SNRB, are common ACPI functions and are the same functions.

 

But I see those functions and I can't squaring the mean of them in a global manner, and as I said before, when you have some document which contains 100 well-know errors, you ended asking you self, how many more error it will have?, so a would rather ask about it.

 

So I want to die happy, and I beg for help from someone that explain me what going on here.

 

Any case, thank you very much people for so many useful help.

Link to comment
Share on other sites

I have DELL Optiplex 3060 MFF.   I read Your entire post and im not sure what your saying?  I have much experience with DSDT, matter of fact it has become the current life sucking vampire in my life. It takes up most of my time!  But I enjoy it! LOL....

          Speaking about errors upon compilation via "xiASL", "maciASL", or "iNTELS iasl". Whichever You choose to use is personal preference. Me I use all three. Anyhow the best way to fix errors no matter how many You have, is too before you look ata anything else in The DSDT, look at the oldest or at the top of the errors for " the syntax errors" and start accordingly , correct those, because 2 or 3 syntaxerrors you fix will wipe out 50 75 errors in  one lick!.

             Most of the time the errors are due to improper directorys placement or syntax errors . 

What I do is ignore all errors in DSDT and look only at syntax first, and then after correcting those , if i were to still have bunch of errors then I would start the Directorys etc. Seei build alot of DSDT for diff systems i acquire or for friends sometimes. Sp i do alot of from scratch in a text editor and I move directorys alot. If your not doing any of that then rthe syntax should correct your issues fairly well.  You have any questions about DSDT or any advice on DSDT hit me up and lets discuss it.  

               

Link to comment
Share on other sites

×
×
  • Create New...