johnnynunez / Xiaomi-Notebook-Air-1Gen

Xiaomi Notebook Air 1rst Gen
175 stars 35 forks source link

many questions #6

Closed sakoula closed 5 years ago

sakoula commented 5 years ago

Hi there, Thanks for your updated version of the files! Unfortunately I am having some issues

  1. VoodooI2C

I cannot make your patch work. I cannot even see the i2c devices in the ioregistry explorer as it is shown here. Can you please explain a bit more on the logic on the patch

  1. change EC0 to EC patch

The DSDT have many more instances other than just EC0 like this SEC0, 32,. This patch will simply break the DSDT. I think it is safer to use RehabMan's SSDT-EC.dsl as it is described here

  1. change MATH to XATH patch

Why are you using this? Is it required?

  1. Lid wake patch

You have patched the framebuffer with Enable lid wake for 0x19260004 credit syscl/lighting/Yating Zhou. Can you please point me to the reference? I am really trying to learn more on this.

  1. AppleIntelCPUPM

Is this required? I am not using it and I think the power management is registering.

  1. SSDT-PNP0C14.aml

What is this and why are you using it?

Thanks for your help!!!!

PS: I am curious do you have a Xiaomi-Notebook-Air-6200u or a different model?

bianyingshan commented 5 years ago

Can you provide a mirror version of the system? My installation here always fails due to automatic reboot?

finner commented 5 years ago

@bianyingshan use 2.8 filepack instead of the latest commits on the repo. You can find the link on the releases tab. It works fine

johnnynunez commented 5 years ago

@sakoula first of all, I don't have this laptopt. The most of the information is obtained from windows 10 with drivers installed correctly. You should use https://www.pci-z.com/ (Windows) and dcpi-manager and ioreg in macOS to see all devices.

  1. I use LPC because this laptop is not compatible with this. https://voodooi2c.github.io/ read this guide to understand this kext. Trackpad is patch correctly. The problem is ELAN0501 not support multitouch. Contact with for questions https://gitter.im/alexandred/VoodooI2C.

  2. if the PC has an EC, name it 'EC' and AppleBusPowerController will load. https://www.tonymacx86.com/threads/guide-usb-power-property-injection-for-sierra-and-later.222266/ Use extract patchmatic if you don't have any error, the patches are well.

3.This fix have all xiaomi laptops.

  1. I don't use this. Where? I patch framebuffer with automatically config.plist rehabman repository and with intel fb patcher. https://www.tonymacx86.com/threads/guide-intel-framebuffer-patching-using-whatevergreen.256490/

  2. It is automatically fix in config.plist rehabman https://github.com/RehabMan/OS-X-Clover-Laptop-Config

  3. There are a lot of EFI with a lot hotpatches. I only use common patches because I don't know acpi code. The book has 1000 pages. https://acpica.org/ I'm computer engineer student, and I don't have a lot of time.

Finally, I can say that I am not expert on hackintosh I hope it is. I only use my little experience to function hackintosh.

I use this for understand more and read a lot of post in tonymacx86 guides and insanelymac. http://blog.daliansky.net/

I'm trying to sell my 4gen Air. i7-8550u y Because wifi not works by nvme. I have 12,5 that use my mother. First I would like to introduce me to learn bios mod to remove whitelist to use apple wifi in m.2 nvme but it is very hard. https://www.hackintosh-forum.de/forum/thread/37088-mod-bios-via-programmer-flashen/?pageNo=1 https://item.taobao.com/item.htm?spm=2013.1.20141002.4.10ab4903Kjwrvj&scm=1007.10009.70205.100200300000001&id=532197802538&pvid=acf31863-86e5-496b-8eac-41be004559df&spm=2013.1.20141002.4.10ab4903Kjwrvj&scm=1007.10009.70205.100200300000001&pvid=acf31863-86e5-496b-8eac-41be004559df

In Xiaomi Pro and Xiaomi notebook air 12,5 works. In Xiaomi 13 first gen I don't know and 4gen not works

I want to use https://www.insanelymac.com/forum/files/file/675-xiaomi-notebook-air-13-filespack/ to see the shutdown solution

@daliansky @stevezhengshiqi They know more than me

johnnynunez commented 5 years ago

@sakoula i add you like collaborator

finner commented 5 years ago

@johnnyc13 according to windows the trackpad is Synaptics, not Elan. I think they switched to ELAN on the 2nd Gen laptop that has fingerprint scanner

johnnynunez commented 5 years ago

@finner Use voodooi2cSYNAPTICS AND put in config.plist SYN1B7F

sakoula commented 5 years ago

@johnnync13 I have little experience and I am trying also to learn :) Thanks for adding be as a collaborator.

I have the laptop and I have installed macOS on a different drive on the second M.2 port.

I have created a repository with a very detailed guide on how to configure your system in order to run High Sierra and Mojave. I tried to keep the configuration lean and clean and justify everything that I have been doing and document everything as much as I could. It is located at sakoula/XiaoMi-Air-6200U

@bianyingshan you can find my configuration that I currently use to run my laptop at that link.

stevezhengshiqi commented 5 years ago

@sakoula Hi, I think change EC0 to EC patch is quite safe, because this patch actually change EC0_ to EC__. Don't worry about variables like SEC0. Also according to Rehabman's post,

We can see that it matches on an ACPI device named 'EC'. Some PCs use EC for the Embedded Controller, but most use EC0 or H_EC. With that knowledge, we can simply rename H_EC->EC, or EC0->EC, and then AppleBusPowerController will load

Maybe using the rename patch instead of creating a new SSDT-EC is better if this device has EC0. Two embedded control devices may confuse system.

sakoula commented 5 years ago

@stevezhengshiqi In the DSDT.dsl the EC0 instances are

    External (_SB_.PCI0.LPCB.EC0_.CHRG, UnknownObj)    // Warning: Unknown object
        SEC0,   32,
        Name (BUF0, ResourceTemplate ()
        {
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0x000EC000,         // Range Minimum
                    0x000EFFFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0x00004000,         // Length        \_SB.PCI0.LPCB.EC0.ECPS (Arg0)
        }
        \_SB.PCI0.LPCB.EC0.ECWK (Arg0)
                If (CondRefOf (\_SB.PCI0.LPCB.EC0.CHRG))
                    Notify (\_SB.PCI0.LPCB.EC0.CHRG, 0x80)
                            Store (Zero, \_SB.PCI0.LPCB.EC0.EOSS)
                        Store (0x08, \_SB.PCI0.LPCB.EC0.ECSS)
            ^LPCB.EC0.OSIN ()
                                Store (SEC0, Index (BUFX, Zero))
        Device (EC0)
    Scope (_SB.PCI0.LPCB.EC0)
    Scope (_SB.PCI0.LPCB.EC0)
    Scope (_SB.PCI0.LPCB.EC0)
    Scope (_SB.PCI0.LPCB.EC0)
    Scope (_SB.PCI0.LPCB.EC0)
                Store (\_SB.PCI0.LPCB.EC0.MS0T, Local0)
                Store (\_SB.PCI0.LPCB.EC0.MCSS, Local1)
                Store (\_SB.PCI0.LPCB.EC0.MOSD, Local2)
                Store (\_SB.PCI0.LPCB.EC0.MSC0, Local0)
                    Store (Arg0, \_SB.PCI0.LPCB.EC0.SCPM)
                Store (\_SB.PCI0.LPCB.EC0.MSP0, Local0)
                Store (\_SB.PCI0.LPCB.EC0.MS1T, Local0)
                Store (\_SB.PCI0.LPCB.EC0.MSC1, Local0)
    Scope (_SB.PCI0.LPCB.EC0)
                Store (^^PCI0.LPCB.EC0.MLID, Local0)
    Scope (_SB.PCI0.LPCB.EC0)
    Scope (_SB.PCI0.LPCB.EC0)
        Scope (_SB.PCI0.LPCB.EC0)
                            If (LEqual (^^^LPCB.EC0.TPTP (), 0x02))
                            If (LEqual (^^^LPCB.EC0.TPTP (), One))
                If (LEqual (^^^^^LPCB.EC0.WAEX (), One))
    Scope (_SB.PCI0.LPCB.EC0)
                If (LEqual (^^LPCB.EC0.WAEX (), One))
                ^^LPCB.EC0.WAEN (One)
                ^^LPCB.EC0.WAEN (Zero)

@stevezhengshiqi I never understood the notation on dsl files:

Scope (_SB.PCI0.LPCB.EC0)
Store (\_SB.PCI0.LPCB.EC0.MS0T, Local0)
External (_SB_.PCI0.LPCB.EC0_.CHRG, UnknownObj) 
Scope (\_GPE) (from a SSDT)

When should I use a\ and an _ after the symbol? Is Scope (_SB.PCI0.LPCB.EC0) the same as Scope (_SB_.PCI0.LPCB.EC0), Scope (\_SB_.PCI0.LPCB.EC0) and Scope (\_SB.PCI0.LPCB.EC0) ?

Thanks!

PS: BTW I will do the rename and report any changes in behaviour

stevezhengshiqi commented 5 years ago

At first, according to ACPI standard, devices' names have to be exactly in four characters; if not, the compiler will use _ to fill the blank. Therefore, some statements like Store (\_SB.PCI0.LPCB.EC0.MSC0, Local0) is actually Store (\_SB_.PCI0.LPCB.EC0_.MSC0, Local0) when the machine is processing the code. Then, the change EC0_ to EC__ patch will rename these EC0_s. In addition, because SEC0 doesn't contain EC0_, it won't be changed by the patch.

In my understanding, \ is for absolute address, meaning that the address after \ is under root tree. _ is needed when the device name is not in four characters. MaciASL is flexible and sometimes you don't really need to follow the standard strictly.

BTW, http://www.acpi.info is highly recommended to read. Just start your coding and testing, and practice will make perfect!

sakoula commented 5 years ago

@stevezhengshiqi thanks for the information. I had no idea about this! And thanks for the link!!! I really appreciate your time to explain me. This information is very valuable and it is quite difficult to figure it out myself!

sakoula commented 5 years ago

@stevezhengshiqi @johnnync13 , I have included the EC0 to EC patch on my edits @ sakoula/XiaoMi-Air-6200U. Thanks!!!

The computer does not shutdown completely (the power button stays on). I have noticed that the SSDT-PTSWAK.dsl include the following lines that are not currently used

                If (\RMCF.SHUT & 2)
                {
                    OperationRegion(PMRS, SystemIO, 0x1830, 1)
                    Field(PMRS, ByteAcc, NoLock, Preserve)
                    {
                        ,4,
                        SLPE, 1,
                    }
                    // alternate shutdown fix using SLPE (mostly provided as an example)
                    // likely very specific to certain motherboards
                    Store(0, SLPE)
                    Sleep(16)
                }

Also JahStories at insanelymac using a totally different _PTS function (that still does not shutdown the computer completely):

    Method (_PTS, 1, NotSerialized)  // _PTS: Prepare To Sleep
    {
        Store (0x99, SMIP)
        Store (Zero, \_SB.PCI0.LPCB.AG3E)
        If (LEqual (Arg0, 0x05))
        {
            Store (Zero, SLPE)
            Sleep (0x10)
        }
        Else
        {
            If (CondRefOf (\_SB.PCI0.RP01.PXSX._ON))
            {
                \_SB.PCI0.RP01.PXSX._ON ()
            }

            Store (Zero, P80D)
            P8XH (Zero, Arg0)
            \_SB.PCI0.LPCB.EC0.ECPS (Arg0)
            If (LEqual (Arg0, One))
            {
                H2OP (0x51)
            }

            If (LEqual (Arg0, 0x03))
            {
                H2OP (0x53)
            }

            If (LEqual (Arg0, 0x04))
            {
                H2OP (0x54)
            }

            ADBG (Concatenate ("_PTS=", ToHexString (Arg0)))
            If (LEqual (TBTS, One))
            {
                If (LAnd (LEqual (FFTB (), One), LEqual (AICS, One)))
                {
                    SXTB ()
                }

                Reset (WFEV)
            }

            If (LEqual (Arg0, 0x03))
            {
                If (CondRefOf (\_PR.DTSE))
                {
                    If (LAnd (\_PR.DTSE, LGreater (TCNT, One)))
                    {
                        TRAP (0x02, 0x1E)
                    }
                }
            }

            If (LEqual (DBGS, Zero)){}
            If (CondRefOf (\_SB.TPM.PTS))
            {
                \_SB.TPM.PTS (Arg0)
            }
        }
    }

I am not sure how to debug it though.

Thanks!

johnnynunez commented 5 years ago

@sakoula In my v2.16 works shutdown. The problem is with usb 3.0 SS0X in USBPorts.kext

sakoula commented 5 years ago

thanks @johnnync13 . I have tried your USBPorts.kext and I can shutdown!!!! Great work!!!

However as you mentioned USB3 is not working. Some information related to the computer:

This is what I have. I tried also various combinations (e.g. removing the type-c ports) but as you said it is all the USB3 ports that are causing the issue.

Quick question: Why are you using the SSDT-UIAC.dsl file? And also which version of yours supports multitouch gestures?

Thanks! keep up the great work!

johnnynunez commented 5 years ago

@sakoula HS02 and SS02 is not used. HS03 and SS03 is type C.

sakoula commented 5 years ago

@johnnync13 since I do not have a USB-C device to test the USB-C port I relied on the JahStories for the USB-C ports (which are HS02/HS03 and SS02/SS03).

According to @Rehabman in the [Guide] Creating a Custom SSDT for USBInjectAll.kext it mentions:

USB type C ports can be either 9 or 10, which depends on how the hardware deals with the two possible orientations of a USB type C device/cable.
If a USB-C uses the same SSxx in both orientations, then it has an internal switch (UsbConnector=9).
If a USB-C uses a different SSxx in each orientation, then it has no switch (UsbConnector=10).

I assumed that it uses two devices based on the orientation.

Why do you think that only HS03/SS03 are used? Has anyone tried it on a physical device?

Thanks!

johnnynunez commented 5 years ago

I use with air 4gen I only see HS03 with iphone xs and SS03 with pen usb 3.0

johnnynunez commented 5 years ago

@sakoula patch usb with https://www.tonymacx86.com/threads/release-hackintool-v1-8-0.254559/ and export to usbports.kext

sakoula commented 5 years ago

@johnnync13 will it make a difference by using hackintool?

johnnynunez commented 5 years ago

Yes, See the last changelog

sakoula commented 5 years ago

Hi is this what do you mean?

1.8.0 - Improved USB power export (corpnewt), other fixes, new icon
johnnynunez commented 5 years ago

Yes. Now the current options is in usbports not in ssdt

sakoula commented 5 years ago

cool thanks!!! will do

sakoula commented 5 years ago

Does this fix the shutdown as well?