Jump to content

Help me to rid of the USBLegacyOff=Yes


  • Please log in to reply
14 replies to this topic

#1
Alex Auditore

Alex Auditore

    InsanelyMac Legend

  • Donators
  • 700 posts
  • Gender:Male
To work my sleep I added Method (_DSM, 4, NotSerialized) to EHC1 and EHC2. Without it, my computer couldn't go to sleep even if it would be with UsbBusFix=Yes.
Without USBBusFix=Yes my computer can't wake up
Method (_DSM, 4, NotSerialized)
			 {
				 Store (Package (0x0B)
					 {
						 "AAPL,clock-id",
						 One,
						 "AAPL,current-available",
						 0x05DC,
						 "AAPL,current-extra",
						 0x03E8,
						 "AAPL,current-in-sleep",
						 0x05DC,
						 "AAPL,device-internal",
						 0x02,
						 Buffer (One)
						 {
							 0x00
						 }
					 }, Local0)
				 DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
				 Return (Local0)
			 }
		 Device (EHC1)
		 {
			 Name (_ADR, 0x001D0000)
			 OperationRegion (U1CS, PCI_Config, 0x62, 0x04)
			 Field (U1CS, DWordAcc, NoLock, Preserve)
			 {
					 , 1,
				 E1EN, 8
			 }
			 Method (_DSM, 4, NotSerialized)
			 {
				 Store (Package (0x0B)
					 {
						 "AAPL,clock-id",
						 One,
						 "AAPL,current-available",
						 0x05DC,
						 "AAPL,current-extra",
						 0x03E8,
						 "AAPL,current-in-sleep",
						 0x05DC,
						 "AAPL,device-internal",
						 0x02,
						 Buffer (One)
						 {
							 0x00
						 }
					 }, Local0)
				 DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
				 Return (Local0)
			 }
			 Method (_S3D, 0, NotSerialized)
			 {
				 Return (0x02)
			 }
			 Method (_S4D, 0, NotSerialized)
			 {
				 Return (0x02)
			 }
	 Device (EHC2)
		 {
			 Name (_ADR, 0x001A0000)
			 OperationRegion (U1CS, PCI_Config, 0x62, 0x04)
			 Field (U1CS, DWordAcc, NoLock, Preserve)
			 {
					 , 1,
				 E2EN, 6
			 }
			 Method (_DSM, 4, NotSerialized)
			 {
				 Store (Package (0x0B)
					 {
						 "AAPL,clock-id",
						 Zero,
						 "AAPL,current-available",
						 0x05DC,
						 "AAPL,current-extra",
						 0x03E8,
						 "AAPL,current-in-sleep",
						 0x05DC,
						 "AAPL,device-internal",
						 0x02,
						 Buffer (One)
						 {
							 0x00
						 }
					 }, Local0)
				 DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
				 Return (Local0)
			 }
			 Method (_S3D, 0, NotSerialized)
			 {
				 Return (0x02)
			 }
			 Method (_S4D, 0, NotSerialized)
			 {
				 Return (0x02)
			 }
Give a promt how to do it. Or correct it for me, please. And I'll look in DSDT what you did for me.
Help me, please.
My computer is Acer Aspire 8942g.

Attached Files



#2
Lejenk

Lejenk

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 1,381 posts
  • Gender:Male
  • Location:Netherlands
Add the UHCI patch also. Copy this code, in DSDT Editor: Patch > New, and paste it.


into method label _DSM parent_adr 0x001D0001 remove_entry;
into device name_adr 0x001D0001 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
    Store (Package (0x02)\n
        {\n
            "device-id", \n
            Buffer (0x04)\n
            {\n
                0x27, 0x1c, 0x00, 0x00\n
            }\n
        }, Local0)\n
    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n
    Return (Local0)\n
}
end;
into method label _DSM parent_adr 0x001D0002 remove_entry;
into device name_adr 0x001D0002 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
    Store (Package (0x02)\n
        {\n
            "device-id", \n
            Buffer (0x04)\n
            {\n
                0x2c, 0x1c, 0x00, 0x00\n
            }\n
        }, Local0)\n
    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n
    Return (Local0)\n
}
end;
into method label _DSM parent_adr 0x001D0003 remove_entry;
into device name_adr 0x001D0003 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
    Store (Package (0x02)\n
        {\n
            "device-id", \n
            Buffer (0x04)\n
            {\n
                0x27, 0x1c, 0x00, 0x00\n
            }\n
        }, Local0)\n
    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n
    Return (Local0)\n
}
end;
into method label _DSM parent_adr 0x001D0004 remove_entry;
into device name_adr 0x001D0004 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
    Store (Package (0x02)\n
        {\n
            "device-id", \n
            Buffer (0x04)\n
            {\n
                0x2c, 0x1c, 0x00, 0x00\n
            }\n
        }, Local0)\n
    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n
    Return (Local0)\n
}
end;
into method label _DSM parent_adr 0x001A0001 remove_entry;
into device name_adr 0x001A0001 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
    Store (Package (0x02)\n
        {\n
            "device-id", \n
            Buffer (0x04)\n
            {\n
                0x27, 0x1c, 0x00, 0x00\n
            }\n
        }, Local0)\n
    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n
    Return (Local0)\n
}
end;
into method label _DSM parent_adr 0x001A0002 remove_entry;
into device name_adr 0x001A0002 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
    Store (Package (0x02)\n
        {\n
            "device-id", \n
            Buffer (0x04)\n
            {\n
                0x2c, 0x1c, 0x00, 0x00\n
            }\n
        }, Local0)\n
    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n
    Return (Local0)\n
}
end;
into method label _DSM parent_adr 0x001A0003 remove_entry;
into device name_adr 0x001A0003 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
    Store (Package (0x02)\n
        {\n
            "device-id", \n
            Buffer (0x04)\n
            {\n
                0x27, 0x1c, 0x00, 0x00\n
            }\n
        }, Local0)\n
    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n
    Return (Local0)\n
}
end


#3
Alex Auditore

Alex Auditore

    InsanelyMac Legend

  • Donators
  • 700 posts
  • Gender:Male
Thank you but this method doesn't work for same reason.
Your patch didn't work in DSDT edittor. So that I tryed to have made it in DSDTSE by hands.
I also added to Device (USB1) Device (USB2) Device (USB3) Device (USB3) the method
Method (_DSM, 4, NotSerialized)
			 {
				 Store (Package (0x0B)
					 {
						 "AAPL,clock-id",
						 One,
						 "AAPL,current-available",
						 0x05DC,
						 "AAPL,current-extra",
						 0x03E8,
						 "AAPL,current-in-sleep",
						 0x05DC,
						 "AAPL,device-internal",
						 0x02,
						 Buffer (One)
						 {
							 0x00
						 }
					 }, Local0)
				 DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
				 Return (Local0)
			 }
And removed USBBusFix, but my computer doesn't want waking up.
Maybe it happens because I have 5 usb but see 4 usb in DSDT. Because one of them is eSATS combined with USB.
Would you be so kind so to look my DSDT and told me about any mistakes?

Attached Files



#4
Lejenk

Lejenk

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 1,381 posts
  • Gender:Male
  • Location:Netherlands
Added the UHCI and XHCI patch, don't know if it makes a difference, mind giving some more information on your system?
Thank you.

Attached Files



#5
Alex Auditore

Alex Auditore

    InsanelyMac Legend

  • Donators
  • 700 posts
  • Gender:Male

Added the UHCI and XHCI patch, don't know if it makes a difference, mind giving some more information on your system?
Thank you.

Unfortunately it didn't help to wake up my laptop.
I attached DarwinDumper and ioreg(ver 3.0).
Dumps was taken when competer had been with UsbBusFix and DSDT which is at my first message of this thread.

Attached Files



#6
Alex Auditore

Alex Auditore

    InsanelyMac Legend

  • Donators
  • 700 posts
  • Gender:Male
With these EHC1 and EHC2 methods it also doesn't work
Also tried to remove vendor-id and add this
"AAPL,max-port-current-in-sleep",
													 0x0834,
													 Buffer (One)
													 {
															 0x00
													 }
											 }
I don't see any difference at IORegs between USBFix and without one which was injected by XPC or Chameleon
Help me, please.
		 Device (EHC1)
		 {
			 Name (_ADR, 0x001D0000)
			 OperationRegion (U1CS, PCI_Config, 0x62, 0x04)
			 Field (U1CS, DWordAcc, NoLock, Preserve)
			 {
					 , 1,
				 E1EN, 8
			 }
			 Method (_DSM, 4, NotSerialized)
			 {
				 Store (Package (0x12)
					 {
						 "vendor-id",
						 Buffer (0x04)
						 {
							 0x86, 0x80, 0x00, 0x00
						 },
						 "device-id",
						 Buffer (0x04)
						 {
							 0x34, 0x3B, 0x00, 0x00
						 },
						 "built-in",
						 Buffer (One)
						 {
							 0x00
						 },
						 "AAPL,clock-id",
						 Buffer (One)
						 {
							 0x01
						 },
						 "device_type",
						 Buffer (0x05)
						 {
							 "EHCI"
						 },
						 "AAPL,current-available",
						 0x05DC,
						 "AAPL,current-extra",
						 0x03E8,
						 "AAPL,current-extra-in-sleep",
						 0x05DC,
						 "AAPL,device-internal",
						 0x02
					 }, Local0)
				 DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
				 Return (Local0)
			 }
			 Method (_S3D, 0, NotSerialized)
			 {
				 Return (0x02)
			 }
			 Method (_S4D, 0, NotSerialized)
			 {
				 Return (0x02)
			 }

Device (EHC2)
		 {
			 Name (_ADR, 0x001A0000)
			 OperationRegion (U1CS, PCI_Config, 0x62, 0x04)
			 Field (U1CS, DWordAcc, NoLock, Preserve)
			 {
					 , 1,
				 E2EN, 6
			 }
			 Method (_DSM, 4, NotSerialized)
			 {
				 Store (Package (0x12)
					 {
						 "vendor-id",
						 Buffer (0x04)
						 {
							 0x86, 0x80, 0x00, 0x00
						 },
						 "device-id",
						 Buffer (0x04)
						 {
							 0x3C, 0x3B, 0x00, 0x00
						 },
						 "built-in",
						 Buffer (One)
						 {
							 0x00
						 },
						 "AAPL,clock-id",
						 Buffer (One)
						 {
							 0x02
						 },
						 "device_type",
						 Buffer (0x05)
						 {
							 "EHCI"
						 },
						 "AAPL,current-available",
						 0x05DC,
						 "AAPL,current-extra",
						 0x03E8,
						 "AAPL,current-extra-in-sleep",
						 0x05DC,
						 "AAPL,device-internal",
						 0x02
					 }, Local0)
				 DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
				 Return (Local0)
			 }
			 Method (_S3D, 0, NotSerialized)
			 {
				 Return (0x02)
			 }
			 Method (_S4D, 0, NotSerialized)
			 {
				 Return (0x02)
			 }
Attached File  Screen Shot 2013-03-23 at 12.38.20 PM.png   112.95KB   15 downloads

Attached Files



#7
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary
Try adding this to the USB1 device:
Name (_PRW, Package (0x02)
			 {
				 0x03,
				 0x03
			 })

this to USB2:
Name (_PRW, Package (0x02)
			 {
				 0x04,
				 0x03
			 })

This to USB3:
Name (_PRW, Package (0x02)
			 {
				 0x0C,
				 0x03
			 })

this to USB4:
Name (_PRW, Package (0x02)
			 {
				 0x0E,
				 0x03
			 })

this to: EHC1 and to EHC2 (I don't have EHC2 so don't know if it is the same as for EHC1 or not) it's the same for both:
Name (_PRW, Package (0x02)
			 {
				 0x0D,
				 0x03
			 })


#8
Alex Auditore

Alex Auditore

    InsanelyMac Legend

  • Donators
  • 700 posts
  • Gender:Male
nyolc8 Thanks for you answer.
I have these things at USB1-4 But I didn't have it at EHC1-2(see my DSDT at the first message of this topic, please)
When I make EHC1-2 so. I receive two errors
   Device (EHC2)
		    {
			    Name (_ADR, 0x001A0000)
			    OperationRegion (U1CS, PCI_Config, 0x62, 0x04)
			    Field (U1CS, DWordAcc, NoLock, Preserve)
			    {
					    ,   1,
				    E2EN,   6
			    }
Name (_PRW, Package (0x02)
						 {
								 0x0D,
								 0x03
						 })
			    Method (_DSM, 4, NotSerialized)
			    {
				    Store (Package (0x0B)
					    {
						    "AAPL,clock-id",
						    Zero,
						    "AAPL,current-available",
						    0x05DC,
						    "AAPL,current-extra",
						    0x03E8,
						    "AAPL,current-in-sleep",
						    0x05DC,
						    "AAPL,device-internal",
						    0x02,
						    Buffer (One)
						    {
							    0x00
						    }
					    }, Local0)
				    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
				    Return (Local0)
			    }

Intel ACPI Component Architecture
ASL Optimizing Compiler version 20091214 [Dec 16 2009]
Copyright (C) 2000 - 2009 Intel Corporation
Supports ACPI Specification Revision 4.0
/Users/admin/Library/Application Support/EvOSoftware/DSDT/DSDTFiles/dsdt.dsl 10585:				 Name (_PRW, Package (0x02)
Error    4057 -																 Name already exists in scope ^  (_PRW)
/Users/admin/Library/Application Support/EvOSoftware/DSDT/DSDTFiles/dsdt.dsl 10945:				 Name (_PRW, Package (0x02)
Error    4057 -																 Name already exists in scope ^  (_PRW)
ASL Input:  /Users/admin/Library/Application Support/EvOSoftware/DSDT/DSDTFiles/dsdt.dsl - 22111 lines, 1202974 bytes, 5129 keywords
Compilation complete. 2 Errors, 0 Warnings, 0 Remarks, 6 Optimizations

I found a sample for this affair.
http://www.osx86.net....html#post41330
And I see addressing at USB1-4 what I haven't.
Have no clue where should I get it. I tried to find it at AIDA64, IOReg and DarwinDumper.
But my endeavours weren't successful.
Please help me to fix it

#9
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary
You have _PRW in EHC1-EHC2 too, I just checked your DSDT you attached. First thing I noticed about your DSDT is that it's really big... it's 114kb, my DSDT is only 4kb (maybe too much thing in there and that is the problem...?). Also for me the HUBX devices are in PCI0, not in EHC1-EHC2. I only have the _PRW section in the USB1,USB2,etc... and nothing else. And it works fine.

#10
Alex Auditore

Alex Auditore

    InsanelyMac Legend

  • Donators
  • 700 posts
  • Gender:Male

You have _PRW in EHC1-EHC2 too, I just checked your DSDT you attached. First thing I noticed about your DSDT is that it's really big... it's 114kb, my DSDT is only 4kb (maybe too much thing in there and that is the problem...?). Also for me the HUBX devices are in PCI0, not in EHC1-EHC2. I only have the _PRW section in the USB1,USB2,etc... and nothing else. And it works fine.

What bootloader do you use? Because I am in need of USBFix only chameleon and XPC. In the Clover I used USBInjection=No. Because I think Clover injects something else automatically.
And give me your full DSDT. Maybe I will try it

#11
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary
I'm using chameleon. Here is my DSDT, but don't try it as it because it's made for another board. Maybe try to copy something from it, or remove things from yours that are not present in mine.
Attached File  DSDT.aml.zip   2.1KB   2 downloads

#12
Alex Auditore

Alex Auditore

    InsanelyMac Legend

  • Donators
  • 700 posts
  • Gender:Male
I carried out little experiment, my computer only wakes up with USBLegacyOff=Yes
On the XPC the same situation
<key>DisableLegacyUSB</key>
<integer>1</integer>
Other USBFixes were disabled
Is it possible to fix legacyUSB in DSDT?
Help me, please!

#13
nyolc8

nyolc8

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 802 posts
  • Gender:Male
  • Location:Budapest, Hungary
Check chameleon source for the usb fix code... Maybe then you'll know what to need to be added to the DSDT.


edit: do you have uefi or Bios?



edit:
This is the usblegacy fix source in chameleon:
int legacy_off (pci_dt_t *pci_dev)
107 {
108 // Set usb legacy off modification by Signal64
109 // NOTE: This *must* be called after the last file is loaded from the drive in the event that we are booting form usb.
110 // NOTE2: This should be called after any getc()/getchar() call. (aka, after the Wait=y keyworkd is used)
111 // AKA: Make this run immediatly before the kernel is called
112 uint32_tcapaddr, opaddr;
113 uint8_teecp;
114 uint32_tusbcmd, usbsts, usbintr;
115 uint32_tusblegsup, usblegctlsts;
116
117 int isOSowned;
118 int isBIOSowned;
119
120 verbose("Setting Legacy USB Off on controller [%04x:%04x] at %02x:%2x.%x\n",
121 pci_dev->vendor_id, pci_dev->device_id,
122 pci_dev->dev.bits.bus, pci_dev->dev.bits.dev, pci_dev->dev.bits.func);
123
124
125 // capaddr = Capability Registers = dev.addr + offset stored in dev.addr + 0x10 (USBBASE)
126 capaddr = pci_config_read32(pci_dev->dev.addr, 0x10);
127
128 // opaddr = Operational Registers = capaddr + offset (8bit CAPLENGTH in Capability Registers + offset 0)
129 opaddr = capaddr + *((unsigned char*)(capaddr));
130
131 // eecp = EHCI Extended Capabilities offset = capaddr HCCPARAMS bits 15:8
132 eecp=*((unsigned char*)(capaddr + 9));
133
134 DBG("capaddr=%x opaddr=%x eecp=%x\n", capaddr, opaddr, eecp);
135
136 usbcmd = *((unsigned int*)(opaddr));// Command Register
137 usbsts = *((unsigned int*)(opaddr + 4));// Status Register
138 usbintr = *((unsigned int*)(opaddr + 8));// Interrupt Enable Register
139
140 DBG("usbcmd=%08x usbsts=%08x usbintr=%08x\n", usbcmd, usbsts, usbintr);
141
142 // read PCI Config 32bit USBLEGSUP (eecp+0)
143 usblegsup = pci_config_read32(pci_dev->dev.addr, eecp);
144
145 // informational only
146 isBIOSowned = !!((usblegsup) & (1 << (16)));
147 isOSowned = !!((usblegsup) & (1 << (24)));
148
149 // read PCI Config 32bit USBLEGCTLSTS (eecp+4)
150 usblegctlsts = pci_config_read32(pci_dev->dev.addr, eecp + 4);
151
152 DBG("usblegsup=%08x isOSowned=%d isBIOSowned=%d usblegctlsts=%08x\n", usblegsup, isOSowned, isBIOSowned, usblegctlsts);
153
154 // Reset registers to Legacy OFF
155 DBG("Clearing USBLEGCTLSTS\n");
156 pci_config_write32(pci_dev->dev.addr, eecp + 4, 0);//usblegctlsts
157
158 // if delay value is in milliseconds it doesn't appear to work.
159 // setting value to anything up to 65535 does not add the expected delay here.
160 delay(100);
161
162 usbcmd = *((unsigned int*)(opaddr));
163 usbsts = *((unsigned int*)(opaddr + 4));
164 usbintr = *((unsigned int*)(opaddr + 8));
165
166 DBG("usbcmd=%08x usbsts=%08x usbintr=%08x\n", usbcmd, usbsts, usbintr);
167
168 DBG("Clearing Registers\n");
169
170 // clear registers to default
171 usbcmd = (usbcmd & 0xffffff00);
172 *((unsigned int*)(opaddr)) = usbcmd;
173 *((unsigned int*)(opaddr + 8)) = 0;//usbintr - clear interrupt registers
174 *((unsigned int*)(opaddr + 4)) = 0x1000;//usbsts - clear status registers
175 pci_config_write32(pci_dev->dev.addr, eecp, 1);//usblegsup
176
177 // get the results
178 usbcmd = *((unsigned int*)(opaddr));
179 usbsts = *((unsigned int*)(opaddr + 4));
180 usbintr = *((unsigned int*)(opaddr + 8));
181
182 DBG("usbcmd=%08x usbsts=%08x usbintr=%08x\n", usbcmd, usbsts, usbintr);
183
184 // read 32bit USBLEGSUP (eecp+0)
185 usblegsup = pci_config_read32(pci_dev->dev.addr, eecp);
186
187 // informational only
188 isBIOSowned = !!((usblegsup) & (1 << (16)));
189 isOSowned = !!((usblegsup) & (1 << (24)));
190
191 // read 32bit USBLEGCTLSTS (eecp+4)
192 usblegctlsts = pci_config_read32(pci_dev->dev.addr, eecp + 4);
193
194 DBG("usblegsup=%08x isOSowned=%d isBIOSowned=%d usblegctlsts=%08x\n", usblegsup, isOSowned, isBIOSowned, usblegctlsts);
195
196 verbose("Legacy USB Off Done\n");
197 return 1;
198 }
I can't see much thing, but if I'm right, it's basically resets some addresses. From the code, I think you'll need to do something in the EHCI(ehc1,ehc2) section of the DSDT... but don't know what should you do... :S

#14
Alex Auditore

Alex Auditore

    InsanelyMac Legend

  • Donators
  • 700 posts
  • Gender:Male
I've cleared up that USBBusFix=Yes is better than USBLegacyOFF=yes.
Because with legacyoffer I have inoperative keyboard which begin to work only after slumber.
Phew! I'm so weary with searching DSDT-Fix for USB that have decided to spit on this affair.
Because such bootloaders as Chameleon and XPC does it better rather than my homemade DSDT Fix.

#15
juanerson

juanerson

    InsanelyMac Legend

  • Local Moderators
  • 1,480 posts
  • Gender:Male
  • Location:Tru, Venezuela

Anybody know if there is one working solution for this "USBBusFix (legacyOFF)" in DSDT ?







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy