<div dir="ltr"><span style="font-size:12.8px">I'll try (boldly, unfortunately) to help here... I really admire Kostja's tremendous fight for The Solution of this problem (for The Truth)!</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Since I see/read: GOOGLE and INTEL professionals are basically nowhere with the assessment of this problem (on this list)?!<div><br></div><div>Why it is so, my dear friends??? One million $$ USD question!? Conscious question (my best guess)???</div><div>_______</div><div><br></div><div>Here is something out of deepness of my mind... As I recall!</div><div><br></div><div><div>When HSW enters S3, its system context is retained in DRAM, so components not critical for state retention/waking up the host are turned off.</div><div>One of the systems powered on in S3 is an USB system... As well as RTC system.</div><div><br></div><div>And, after all, searching on these Realities, further down on the open net, here are some useful info:</div><div><a href="https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/4th-gen-core-family-mobile-m-h-processor-lines-vol-1-datasheet.pdf" target="_blank">https://www.intel.com/content/<wbr>dam/www/public/us/en/<wbr>documents/datasheets/4th-gen-<wbr>core-family-mobile-m-h-<wbr>processor-lines-vol-1-<wbr>datasheet.pdf</a><br></div><div><br></div><div>(Chapter 4.0 Power Management)</div><div><br></div></div></div><div style="font-size:12.8px">I hope this can help... Somehow [<b><i><u><font color="#ff0000">this time without attachment, since Coreboot mailer blocked me</font></u></i></b>]</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Zoran</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 27, 2017 at 7:09 PM, Zoran Stojsavljevic <span dir="ltr"><<a href="mailto:zoran.stojsavljevic@gmail.com" target="_blank">zoran.stojsavljevic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'll try (boldly, unfortunately) to help here... I really admire Kostja's tremendous fight for The Solution of this problem (for The Truth)!<div><br></div><div>Since I see/read: GOOGLE and INTEL professionals are basically nowhere with the assessment of this problem (on this list)?!<div><br></div><div>Why it is so, my dear friends??? One million $$ USD question!? Conscious question (my best guess)???</div><div>_______</div><div><br></div><div>Here is something out of deepness of my mind... As I recall!</div><div><br></div><div><div>When HSW enters S3, its system context is retained in DRAM, so components not critical for state retention/waking up the host are turned off.</div><div>One of the systems powered on in S3 is an USB system... As well as RTC system.</div><div><br></div><div>And, after all, searching on these Realities, further down on the open net, here are some useful info:</div><div><a href="https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/4th-gen-core-family-mobile-m-h-processor-lines-vol-1-datasheet.pdf" target="_blank">https://www.intel.com/content/<wbr>dam/www/public/us/en/<wbr>documents/datasheets/4th-gen-<wbr>core-family-mobile-m-h-<wbr>processor-lines-vol-1-<wbr>datasheet.pdf</a><br></div><div><br></div><div>(Chapter 4.0 Power Management)</div><div><br></div></div></div><div>I hope this can help... Somehow!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Zoran</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 27, 2017 at 2:14 PM, Аладышев Константин <span dir="ltr"><<a href="mailto:aladyshev@nicevt.ru" target="_blank">aladyshev@nicevt.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok, I’ve found one more solution: don’t generate ACPI C-state tables.<br>
<br>
In "devicetree.cb" replace all C-states registers with 0, indicating C0 state.<br>
                        register "c1_battery" = "0"        #"2" # ACPI(C1) = MWAIT(C1E)<br>
                        register "c2_battery" = "0"        #"3" # ACPI(C2) = MWAIT(C3)<br>
                        register "c3_battery" = "0"        #"9" # ACPI(C3) = MWAIT(C7S)<br>
<br>
                        register "c1_acpower" = "0"     #"2"    # ACPI(C1) = MWAIT(C1E)<br>
                        register "c2_acpower" = "0"     #"3"    # ACPI(C2) = MWAIT(C3)<br>
                        register "c3_acpower" = "0"     #"9"    # ACPI(C3) = MWAIT(C7S)<br>
<br>
After this change coreboot wouldn't generate _CST tables for ACPI C-states.<br>
<br>
Original BIOSes of two Haswell motherboards that I have, don’t generate _CST tables, so maybe it is not so bad.<br>
<br>
But I don’t quite understand why even without those tables "cpupower idle-info" and "cpupower monitor -m Idle_Stats" shows that CPU enters and exits all supported C-states. Btw, Haswell ULT has a lot of C-states: C0, C1, C1E, C2E, C3, C6, C7, C8, C9, C10.<br>
<br>
There are a lot of MSRs to control C-states + two alternative interfaces in ACPI (_CST and FADT), so it is quite hard for me to check if all of it is done correctly.<br>
<br>
State C3 and lower flush core caches, so maybe this is the reason why commit about EHCI command solves my issue.<br>
<br>
Also I've found interesting part in Haswell BWG:<br>
"<br>
Idle Duration Reporting is the capability for devices to communicate to the processor<br>
about their planned period of activity or idleness. Based on when the device would next<br>
interrupt the core, the PCU can place the core in an appropriate idle state.<br>
• On 4th Generation Intel® Core™ processors, cores are expected to report their Idle<br>
Duration time via the respective APIC timers. Since 4th Generation Intel® Core™<br>
processors support Always running APIC timer (ARAT), the PCU will save this data<br>
when cores are in a deep sleep state and use the closest expiring timer value as the<br>
Device Idle duration.<br>
"<br>
<br>
So, maybe without APIC-timer cores can't report their activity/idleness time and C-states are not supported?? That is why boot with "noapictimer" doesn't have problems.<br>
<br>
Or maybe all problems are from wrong APIC timer. What do you think? What part of ACPI code is responsible for APIC timer setting?<br>
<br>
<br>
One more interesting observation:<br>
<br>
"<br>
On previous processors, the chipset was responsible for actually changing the<br>
processor C-state seen by the package. On 4th Generation Intel® Core™ processors,<br>
this logic moves to the System Agent, and the chipset is no longer responsible for<br>
driving processor package C-state transitions.<br>
"<br>
<br>
Can it be that mrc.bin (System Agent blob) just doesn't configured for C-states?<br>
<br>
<br>
And at the end I want to notice, that according to BWG BIOS should expose different C-states tables to different OSes by reading _PDC method and coreboot doesn't do it at all.<br>
<br>
<br>
P.S.: This issue was also responsible for USB stuck in Windows 7. So this problem is seems more important than support of some old Linux kernels.<br>
<span><br>
<br>
From: Аладышев Константин [mailto:<a href="mailto:aladyshev@nicevt.ru" target="_blank">aladyshev@nicevt.ru</a>]<br>
</span>Sent: Thursday, October 19, 2017 5:57 PM<br>
To: 'ron minnich'; 'Julius Werner'<br>
Cc: 'Coreboot'<br>
Subject: Re: [coreboot] USB problem with Haswell+LynxPointLP motherboards<br>
<span><br>
No, unfortunately this option by itself doesn’t help.<br>
<br>
I guess my minimal hammer is ‘noapictimer’<br>
<br>
But I wonder how these 3 boot parameters (‘noapictimer’ ‘nolapic’ and ‘acpi=off’) separately help to solve my issue.<br>
<br>
What part is wrong in ACPI and correct in MP-table? Maybe the problem is in ACPI MADT table? But it doesn’t really have much info that can be wrong. The one strangeness I found compared to original BIOS is mapping between ProcID and APIC ID in lapic entries.<br>
<br>
Coreboot has straightforward: 0-0, 1-1, 2-2, 3-3.<br>
But original BIOS has: 1-0, 2-2, 3-1, 4-3<br>
<br>
I wonder if it means something?<br>
<br>
<br>
From: ron minnich [mailto:<a href="mailto:rminnich@gmail.com" target="_blank">rminnich@gmail.com</a>]<br>
Sent: Thursday, October 19, 2017 5:29 PM<br>
</span>To: Аладышев Константин; Julius Werner<br>
<div class="m_6071716932590228480HOEnZb"><div class="m_6071716932590228480h5">Cc: Coreboot<br>
Subject: Re: [coreboot] USB problem with Haswell+LynxPointLP motherboards<br>
<br>
we had a similar problem and we set<br>
pci=nocrs<br>
<br>
which means 'ignore what ACPI tells you and probe it again"<br>
<br>
It's much less of a big hammer than 'acpi=off' :-)<br>
<br>
On Thu, Oct 19, 2017 at 7:22 AM Аладышев Константин <<a href="mailto:aladyshev@nicevt.ru" target="_blank">aladyshev@nicevt.ru</a>> wrote:<br>
I've found one more parameter that helps me boot without USB problem: 'noapictimer'<br>
<br>
<br>
-----Original Message-----<br>
From: Аладышев Константин [mailto:<a href="mailto:aladyshev@nicevt.ru" target="_blank">aladyshev@nicevt.ru</a>]<br>
Sent: Wednesday, October 18, 2017 3:58 PM<br>
To: 'Julius Werner'<br>
Cc: 'Coreboot'<br>
Subject: Re: [coreboot] USB problem with Haswell+LynxPointLP motherboards<br>
<br>
Ok, I've done some investigations about what can be the source of my problem:<br>
<br>
1) last value of COMMAND register from BIOS I've dumped all EHCI registers (pci and memory) at the beginning of linux kernel EHCI initialization. And to my surprise pretty all memory registers in original BIOS look like almost uninitialized compared to my coreboot+seabios image. I don't really know how to work with EHCI controller, but seabios do it through periodic and async schedule and their enable bits (in COMMAND register from commit!) aren't active in original BIOS. I've tried to disable ehci initialization in seabios and after that registers dump started to look almost the same, compared to original bios, but it didn't solve my issue. Also without them USB doesn't work in grub. So it doesn't seem like BIOS last value of COMMAND register really matter.<br>
<br>
2) SMI<br>
There are special registers for EHCI controller SMIs in its pci config space:<br>
-USB EHCI Legacy Support Extended<br>
-Intel Specific USB 2.0 SMI<br>
But in both of them SMIs are disabled as in coreboot+seabios image as in original bios.<br>
<br>
3) ACPI<br>
In original BIOS ACPI doesn't do anything to EHCI COMMAND register from commit. It doesn't have a name for it or declare it in some region. Anyway I've copied almost all asl EHCI controller code, but it didn't help.<br>
<br>
BUT! I've provided MP-table and PIRQ table to coreboot and I can say that the problem disappears when I boot with 'acpi=off' parameter!<br>
Also it disappears when I boot with 'nolapic' parameter<br>
<br>
What do they have in common??<br>
<br>
<br>
<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:jwerner@google.com" target="_blank">jwerner@google.com</a> [mailto:<a href="mailto:jwerner@google.com" target="_blank">jwerner@google.com</a>] On Behalf Of Julius Werner<br>
Sent: Tuesday, October 10, 2017 5:56 AM<br>
To: Аладышев Константин<br>
Cc: Coreboot<br>
Subject: Re: [coreboot] USB problem with Haswell+LynxPointLP motherboards<br>
<br>
> And now I'm kinda stuck. The effect of this commit doesn't seem to<br>
> interface with bios for me. So how does original IBASE/DFI bios can<br>
> overcome code error before this commit?<br>
><br>
> What can be the source of my problem? What should I investigate more<br>
> precise based on result that I've got?<br>
<br>
My gut feeling would be to blame ACPI. The Linux patch is about caching a host controller register in the kernel, and in some cases (e.g. ehci_reset()), the patch re-reads the cached version from the hardware whereas the previous code didn't. If some BIOS ACPI mucks with that register, it's possible that this got the kernel's cached copy out of sync before this patch, but with the patch the kernel will re-read it from the hardware at the right time. Maybe only coreboot's ACPI routines touch the register in that path, or maybe the vendor BIOS' routines were more careful to restore the original state afterwards.<br>
<br>
Besides ACPI this could also be in SMM code, I guess (especially if the problem occurs around system suspend/resume, although it sounds like it doesn't for you).<br>
<br>
<br>
--<br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org" target="_blank">coreboot@coreboot.org</a><br>
<a href="https://mail.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">https://mail.coreboot.org/mail<wbr>man/listinfo/coreboot</a><br>
<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>