4 * Config Southbridge USB controller
8 * @xrefitem bom "File Content Label" "Release Content"
11 * @e \$Revision:$ @e \$Date:$
14 /*;********************************************************************************
16 ; Copyright (c) 2011, Advanced Micro Devices, Inc.
17 ; All rights reserved.
19 ; Redistribution and use in source and binary forms, with or without
20 ; modification, are permitted provided that the following conditions are met:
21 ; * Redistributions of source code must retain the above copyright
22 ; notice, this list of conditions and the following disclaimer.
23 ; * Redistributions in binary form must reproduce the above copyright
24 ; notice, this list of conditions and the following disclaimer in the
25 ; documentation and/or other materials provided with the distribution.
26 ; * Neither the name of Advanced Micro Devices, Inc. nor the names of
27 ; its contributors may be used to endorse or promote products derived
28 ; from this software without specific prior written permission.
30 ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
31 ; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
32 ; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
33 ; DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
34 ; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
35 ; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
36 ; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
37 ; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
39 ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 ;*********************************************************************************/
42 #include "SbPlatform.h"
48 // Declaration of local functions
51 usbOverCurrentControl (
62 * EhciInitAfterPciInit - Config USB controller after PCI emulation
64 * @param[in] Value Controller PCI config address (bus# + device# + function#)
65 * @param[in] pConfig Southbridge configuration structure pointer.
67 VOID EhciInitAfterPciInit (IN UINT32 Value, IN AMDSBCFG* pConfig);
70 * OhciInitAfterPciInit - Config USB OHCI controller after PCI emulation
72 * @param[in] Value Controller PCI config address (bus# + device# + function#)
73 * @param[in] pConfig Southbridge configuration structure pointer.
75 VOID OhciInitAfterPciInit (IN UINT32 Value, IN AMDSBCFG* pConfig);
78 VOID XhciInitBeforePciInit (IN AMDSBCFG* pConfig);
79 VOID XhciInitAfterPciInit (IN AMDSBCFG* pConfig);
80 VOID XhciInitLate (IN AMDSBCFG* pConfig);
83 * usbInitBeforePciEnum - Config USB controller before PCI emulation
87 * @param[in] pConfig Southbridge configuration structure pointer.
91 usbInitBeforePciEnum (
96 // add Efuse checking for Xhci enable/disable
97 XhciEfuse = XHCI_EFUSE_LOCATION;
98 TRACE ((DMSG_SB_TRACE, "Entering PreInit Usb \n"));
99 // Disabled All USB controller
100 // RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEF, AccWidthUint8, BIT7, 0);
101 // Clear PM_IO 0x65[4] UsbResetByPciRstEnable, Set this bit so that usb gets reset whenever there is PCIRST.
102 // Enable UsbResumeEnable (USB PME) * Default value
103 // In SB700 USB SleepCtrl set as BIT10+BIT9, but Hudson-2 default is BIT9+BIT8 (6 uframes)
104 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGF0, AccWidthUint16 | S3_SAVE, ~BIT2, BIT2 + BIT7 + BIT8 + BIT9);
105 // Overwrite EHCI bit by OHCI bit
106 pConfig->USBMODE.UsbModeReg = pConfig->USBMODE.UsbMode.Ohci1 \
107 + (pConfig->USBMODE.UsbMode.Ohci1 << 1) \
108 + (pConfig->USBMODE.UsbMode.Ohci2 << 2) \
109 + (pConfig->USBMODE.UsbMode.Ohci2 << 3) \
110 + (pConfig->USBMODE.UsbMode.Ohci3 << 4) \
111 + (pConfig->USBMODE.UsbMode.Ohci3 << 5) \
112 + (pConfig->USBMODE.UsbMode.Ohci4 << 6);
114 // Overwrite EHCI3/OHCI3 by XhciSwitch
115 if (pConfig->XhciSwitch) {
116 pConfig->USBMODE.UsbModeReg &= 0xCF;
117 pConfig->USBMODE.UsbModeReg |= 0x80;
119 pConfig->USBMODE.UsbModeReg &= 0x7F;
120 #ifdef USB_LOGO_SUPPORT
121 if (pConfig->USBMODE.UsbMode.Ohci3) {
122 RWMEM (ACPI_MMIO_BASE + SMI_BASE + SB_SMI_Usbwakup2, AccWidthUint8, 0, 0x0B);
126 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEF, AccWidthUint8, 0, (pConfig->USBMODE.UsbModeReg));
127 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEE, AccWidthUint8, ~(BIT2), 0 );
128 // RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEF, AccWidthUint8, 0, (pConfig->USBMODE.UsbModeReg & ~( 0x15 << 1 )) + (( pConfig->USBMODE.UsbModeReg & 0x15 ) << 1 ) );
130 // if ( pConfig->XhciSwitch == 1 && pConfig->S3Resume == 0 && pConfig->S4Resume == 0 ) {
131 // RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEF, AccWidthUint8, ~(BIT7) , BIT7);
132 // RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEF, AccWidthUint8, ~(BIT4 + BIT5) , 0);
133 // RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEE, AccWidthUint8, ~(BIT0 + BIT1 + BIT2), (BIT1 + BIT0 + BIT2) );
136 // RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEF, AccWidthUint8, ~(BIT7) , ~(BIT7));
138 // RWMEM (ACPI_MMIO_BASE + MISC_BASE + 0x40, AccWidthUint8, ~BIT6, 0);
139 // RWMEM (ACPI_MMIO_BASE + PMIO_BASE + 0xF3, AccWidthUint8, ~BIT4, BIT4);
141 // RWMEM (ACPI_MMIO_BASE + PMIO_BASE + 0xF3, AccWidthUint8, ~BIT4, 0);
144 #ifndef XHCI_INIT_IN_ROM_SUPPORT
145 if ( pConfig->XhciSwitch == 1 ) {
146 if ( pConfig->S3Resume == 0 ) {
147 XhciInitBeforePciInit (pConfig);
149 XhciInitIndirectReg ();
154 // add Efuse checking for Xhci enable/disable
155 getEfuseStatus (&XhciEfuse);
156 if ((XhciEfuse & (BIT0 + BIT1)) != (BIT0 + BIT1)) {
157 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00, AccWidthUint32, 0xF0FFFBFF, 0x0);
166 * usbInitAfterPciInit - Config USB controller after PCI emulation
170 * @param[in] pConfig Southbridge configuration structure pointer.
174 usbInitAfterPciInit (
179 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEF, AccWidthUint8, BIT7, 0x7F);
182 usb1EhciInitAfterPciInit (pConfig);
183 usb2EhciInitAfterPciInit (pConfig);
184 usb3EhciInitAfterPciInit (pConfig);
185 usb3OhciInitAfterPciInit (pConfig);
186 usb1OhciInitAfterPciInit (pConfig);
187 usb2OhciInitAfterPciInit (pConfig);
188 usb4OhciInitAfterPciInit (pConfig);
191 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEF, AccWidthUint8, BIT7, (pConfig->USBMODE.UsbModeReg));
194 if ( pConfig->XhciSwitch == 1 ) {
195 XhciInitAfterPciInit (pConfig);
199 if ( pConfig->UsbPhyPowerDown ) {
200 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGF0, AccWidthUint8, ~BIT0, BIT0);
202 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGF0, AccWidthUint8, ~BIT0, 0);
205 if (IsSbA13Plus ()) {
207 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGB4, AccWidthUint8, ~BIT7, BIT7);
209 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGED, AccWidthUint8, ~BIT2, BIT2);
214 * usbOverCurrentControl - Config USB Over Current Control
218 * @param[in] pConfig Southbridge configuration structure pointer.
222 usbOverCurrentControl (
227 #ifdef SB_USB1_OVER_CURRENT_CONTROL
228 RWPCI ((USB1_OHCI_BUS_DEV_FUN << 16) + SB_OHCI_REG58, AccWidthUint32 | S3_SAVE, 0xfff00000, SB_USB1_OVER_CURRENT_CONTROL & 0x000FFFFF);
231 #ifdef SB_USB2_OVER_CURRENT_CONTROL
232 RWPCI ((USB2_OHCI_BUS_DEV_FUN << 16) + SB_OHCI_REG58, AccWidthUint32 | S3_SAVE, 0xfff00000, SB_USB2_OVER_CURRENT_CONTROL & 0x000FFFFF);
235 #ifdef SB_USB3_OVER_CURRENT_CONTROL
236 RWPCI ((USB3_OHCI_BUS_DEV_FUN << 16) + SB_OHCI_REG58, AccWidthUint32 | S3_SAVE, 0xffff0000, SB_USB3_OVER_CURRENT_CONTROL & 0x0000FFFF);
239 #ifdef SB_USB4_OVER_CURRENT_CONTROL
240 RWPCI ((USB4_OHCI_BUS_DEV_FUN << 16) + SB_OHCI_REG58, AccWidthUint32 | S3_SAVE, 0xffffff00, SB_USB4_OVER_CURRENT_CONTROL & 0x000000FF);
243 #ifdef SB_XHCI0_OVER_CURRENT_CONTROL
244 RWXhci0IndReg ( SB_XHCI_IND_REG04, 0xFF00FFFF, (SB_XHCI0_OVER_CURRENT_CONTROL & 0xFF) << 16);
247 #ifdef SB_XHCI1_OVER_CURRENT_CONTROL
248 RWXhci1IndReg ( SB_XHCI_IND_REG04, 0xFF00FFFF, (SB_XHCI1_OVER_CURRENT_CONTROL & 0xFF) << 16);
254 * usbInitLate - Config USB controller after PCI emulation
258 * @param[in] pConfig Southbridge configuration structure pointer.
266 if (pConfig->S4Resume) {
267 //RWPCI (0x9004, AccWidthUint8, 0, 0x10);
268 //RWPCI (0x9804, AccWidthUint8, 0, 0x10);
269 //RWPCI (0xA504, AccWidthUint8, 0, 0x10);
270 //RWPCI (0xB004, AccWidthUint8, 0, 0x10);
271 //RWPCI (0x903C, AccWidthUint8, 0, 0x12);
272 //RWPCI (0x983C, AccWidthUint8, 0, 0x12);
273 //RWPCI (0xA53C, AccWidthUint8, 0, 0x12);
274 //RWPCI (0xB03C, AccWidthUint8, 0, 0x12);
277 if ( pConfig->XhciSwitch == 1 ) {
278 XhciInitLate (pConfig);
281 SbEnableUsbIrq1Irq12ToPicApic ();
282 usbOverCurrentControl (pConfig);
286 * usb1EhciInitAfterPciInit - Config USB1 EHCI controller after PCI emulation
290 * @param[in] pConfig Southbridge configuration structure pointer.
294 usb1EhciInitAfterPciInit (
299 ddDeviceId = (USB1_EHCI_BUS_DEV_FUN << 16);
300 EhciInitAfterPciInit (ddDeviceId, pConfig);
304 * usb2EhciInitAfterPciInit - Config USB2 EHCI controller after PCI emulation
308 * @param[in] pConfig Southbridge configuration structure pointer.
312 usb2EhciInitAfterPciInit (
317 ddDeviceId = (USB2_EHCI_BUS_DEV_FUN << 16);
318 EhciInitAfterPciInit (ddDeviceId, pConfig);
322 * usb3EhciInitAfterPciInit - Config USB3 EHCI controller after PCI emulation
326 * @param[in] pConfig Southbridge configuration structure pointer.
331 usb3EhciInitAfterPciInit (
336 ddDeviceId = (USB3_EHCI_BUS_DEV_FUN << 16);
337 EhciInitAfterPciInit (ddDeviceId, pConfig);
342 EhciInitAfterPciInit (
349 UINT32 ddDrivingStrength;
350 UINT32 ddPortDrivingStrength;
353 ddDrivingStrength = 0;
356 ReadPCI ((UINT32) Value + SB_EHCI_REG10, AccWidthUint32, &ddBarAddress);
357 if ( (ddBarAddress != - 1) && (ddBarAddress != 0) ) {
358 //Enable Memory access
359 RWPCI ((UINT32) Value + SB_EHCI_REG04, AccWidthUint8, 0, BIT1);
360 if (pConfig->BuildParameters.EhciSsid != NULL ) {
361 RWPCI ((UINT32) Value + SB_EHCI_REG2C, AccWidthUint32 | S3_SAVE, 0x00, pConfig->BuildParameters.EhciSsid);
363 //USB Common PHY CAL & Control Register setting
365 WriteMEM (ddBarAddress + SB_EHCI_BAR_REGC0, AccWidthUint32, &ddVar);
366 // RPR IN AND OUT DATA PACKET FIFO THRESHOLD
367 // EHCI BAR 0xA4 //IN threshold bits[7:0]=0x40 //OUT threshold bits[23:16]=0x40
368 RWMEM (ddBarAddress + SB_EHCI_BAR_REGA4, AccWidthUint32, 0xFF00FF00, 0x00400040);
369 // RPR EHCI Dynamic Clock Gating Feature
370 // RPR Enable Global Clock Gating (BIT14)
371 RWMEM (ddBarAddress + SB_EHCI_BAR_REGBC, AccWidthUint32, ~(BIT12 + BIT14), BIT12 + BIT14);
372 RWMEM (ddBarAddress + SB_EHCI_BAR_REGB0, AccWidthUint32, ~BIT5, BIT5);
373 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGF0, AccWidthUint16, ~BIT12, BIT12);
374 // RPR Enable adding extra flops to PHY rsync path
376 // EHCI_BAR 0xB4 [6] = 1
377 // EHCI_BAR 0xB4 [7] = 0
378 // EHCI_BAR 0xB4 [12] = 0 ("VLoad")
379 // All other bit field untouched
381 // EHCI_BAR 0xB4[12] = 1
382 //RWMEM (ddBarAddress + SB_EHCI_BAR_REGB4, AccWidthUint32, ~(BIT6 + BIT7 + BIT12), 0x00);
383 //RWMEM (ddBarAddress + SB_EHCI_BAR_REGB4, AccWidthUint32, ~BIT12, BIT12);
385 // RPR7.8 USB 2.0 Ports Driving Strength
386 // Step1 is done by default
387 // Add support USBx_EHCI_DRIVING_STRENGTH port4 is at [19:16] and port0 is [3:0]; 4 bits for per port, [3] is enable,[2:0] is driving strength.
388 // For Cobia, USB3_EHCI_DRIVING_STRENGTH = 0x00CC
389 #ifdef USB1_EHCI_DRIVING_STRENGTH
390 if (Value == (USB1_EHCI_BUS_DEV_FUN << 16)) {
391 ddDrivingStrength = USB1_EHCI_DRIVING_STRENGTH;
395 #ifdef USB2_EHCI_DRIVING_STRENGTH
396 if (Value == (USB2_EHCI_BUS_DEV_FUN << 16)) {
397 ddDrivingStrength = USB2_EHCI_DRIVING_STRENGTH;
401 #ifdef USB3_EHCI_DRIVING_STRENGTH
402 if (Value == (USB3_EHCI_BUS_DEV_FUN << 16)) {
403 ddDrivingStrength = USB3_EHCI_DRIVING_STRENGTH;
407 if (portNumber > 0) {
408 for (port = 0; port < portNumber; port ++) {
409 ddPortDrivingStrength = (ddDrivingStrength >> (port * 4)) & 0x0F;
410 if (ddPortDrivingStrength & BIT3) {
411 ddPortDrivingStrength &= 0x7;
412 RWMEM (ddBarAddress + SB_EHCI_BAR_REGB4, AccWidthUint32, ~ (BIT16 + BIT15 + BIT14 + BIT13 + BIT12 + BIT2 + BIT1 + BIT0), (port << 13) + ddPortDrivingStrength);
413 RWMEM (ddBarAddress + SB_EHCI_BAR_REGB4, AccWidthUint32, ~BIT12, BIT12);
418 RWMEM (ddBarAddress + SB_EHCI_BAR_REGB4, AccWidthUint32, ~BIT12, BIT12);
421 RWMEM (ddBarAddress + SB_EHCI_BAR_REGC4, AccWidthUint32, (UINT32) (~ 0x00000f00), 0x00000000);
422 RWMEM (ddBarAddress + SB_EHCI_BAR_REGC0, AccWidthUint32, (UINT32) (~ 0x0000ff00), 0x00001500);
424 RWMEM (ddBarAddress + SB_EHCI_BAR_REGC4, AccWidthUint32, (UINT32) (~ 0x00000f00), 0x00000200);
425 RWMEM (ddBarAddress + SB_EHCI_BAR_REGC0, AccWidthUint32, (UINT32) (~ 0x0000ff00), 0x00000f00);
427 //Set EHCI_pci_configx50[6]='1' to disable EHCI MSI support
428 RWPCI ((UINT32) Value + SB_EHCI_REG50, AccWidthUint32 | S3_SAVE, ~ ((UINT32) (0x01 << 6)), (0x01 << 6));
429 //RPR 7.13 EHCI Async Park Mode
430 //Set EHCI_pci_configx50[11:8]=0x1
431 //Set EHCI_pci_configx50[15:12]=0x1
432 //Set EHCI_pci_configx50[17]=0x1
433 RWPCI ((UINT32) Value + SB_EHCI_REG50, AccWidthUint32 | S3_SAVE, ~ ((UINT32) (0x0F << 8)), (0x01 << 8));
434 RWPCI ((UINT32) Value + SB_EHCI_REG50, AccWidthUint32 | S3_SAVE, ~ ((UINT32) (0x0F << 12)), (0x01 << 12));
435 RWPCI ((UINT32) Value + SB_EHCI_REG50, AccWidthUint32 | S3_SAVE, ~ ((UINT32) (0x01 << 17)), (0x01 << 17));
436 //RPR Enabling EHCI Async Stop Enhancement
437 //Set EHCI_pci_configx50[29]='1' to disableEnabling EHCI Async Stop Enhancement
438 RWPCI ((UINT32) Value + SB_EHCI_REG50, AccWidthUint32 | S3_SAVE, ~ ((UINT32) (0x01 << 29)), (0x01 << 29));
439 //RWPCI ((UINT32) Value + SB_EHCI_REG50, AccWidthUint32 | S3_SAVE, 0xFF7F0FFF, 0x20221140);
440 // RPR recommended setting "EHCI Advance PHY Power Savings"
441 // Set EHCI_pci_configx50[31]='1'
442 // Fix for EHCI controller driver yellow sign issue under device manager
443 // when used in conjunction with HSET tool driver. EHCI PCI config 0x50[20]=1
444 RWPCI ((UINT32) Value + SB_EHCI_REG50 + 2, AccWidthUint16 | S3_SAVE, (UINT16)0xFFFF, BIT15);
445 // ENH246436: Disable USB data cache to resolve USB controller hang issue with Lan adaptor.
446 // EHCI PCI config register 50h bit 26 to `1'.
447 if (pConfig->EhciDataCacheDis) {
448 RWPCI ((UINT32) Value + SB_EHCI_REG50 + 2, AccWidthUint16 | S3_SAVE, (UINT16)0xFFFF, BIT10);
451 if (IsSbA13Plus ()) {
453 RWPCI ((UINT32) Value + SB_EHCI_REG54, AccWidthUint16 | S3_SAVE, (UINT16)0x5FFF, BIT13 + BIT15);
455 RWPCI ((UINT32) Value + SB_EHCI_REG50 + 2, AccWidthUint16 | S3_SAVE, ~ (BIT3), BIT3);
457 RWPCI ((UINT32) Value + SB_EHCI_REG54 + 2, AccWidthUint16 | S3_SAVE, (UINT16)0xFFFC, BIT0 + BIT1);
459 RWPCI ((UINT32) Value + SB_EHCI_REG54 + 2, AccWidthUint16 | S3_SAVE, (UINT16)0xFFFB, BIT2);
461 RWPCI ((UINT32) Value + SB_EHCI_REG54 + 2, AccWidthUint16 | S3_SAVE, (UINT16)0xFFF7, BIT3);
464 // RPR USB Delay A-Link Express L1 State
465 // RPR PING Response Fix Enable EHCI_PCI_Config x54[1] = 1
466 // RPR Enable empty list mode. x54[3]
467 // RPR Enable "L1 Early Exit" functionality. 0x54 [6:5] = 0x3 0x54 [9:7] = 0x4
468 // RPR EHCI PING Response Fix Enable 0x54 [1] = 0x1
469 RWPCI ((UINT32) Value + SB_EHCI_REG54, AccWidthUint32 | S3_SAVE, ~BIT0, 0x0000026b);
470 if ( pConfig->BuildParameters.UsbMsi) {
471 RWPCI ((UINT32) Value + SB_EHCI_REG50, AccWidthUint32 | S3_SAVE, ~BIT6, 0x00);
473 if (IsSbA12Plus ()) {
474 // RPR 7.24 Long Delay on Framelist Read Causing EHCI DMA to Address 0 - Fix
475 // RWPCI ((UINT32) Value + SB_EHCI_REG54, AccWidthUint32 | S3_SAVE, ~BIT13, BIT13);
476 // RPR 7.25 LS connection can't wake up system from S3/S4/S5 when EHCI owns the port - Fix
477 RWPCI ((UINT32) Value + SB_EHCI_REG54, AccWidthUint32 | S3_SAVE, ~BIT4, BIT4);
478 // RPR 7.30 EHCI lMU Hangs when Run/Stop is Set First and PDC is Enabled Near End uFrame 7 - Fix Enable
479 RWPCI ((UINT32) Value + SB_EHCI_REG54, AccWidthUint32 | S3_SAVE, ~BIT11, BIT11);
481 // ENH244924: Platform specific Hudson-2/3 settings for all Sabine Platforms
482 // EHCI_PCI_Config 0x50[21]=1
483 // EHCI_PCI_Config 0x54[9:7] = 0x4
485 RWPCI ((UINT32) Value + SB_EHCI_REG50, AccWidthUint32 | S3_SAVE, ~ ((UINT32) (0x01 << 21)), (0x01 << 21));
486 RWPCI ((UINT32) Value + SB_EHCI_REG54, AccWidthUint32 | S3_SAVE, ~ ((UINT32) (0x07 << 7)), (0x04 << 7));
488 // RWMEM (ddBarAddress + SB_EHCI_BAR_REGB0, AccWidthUint32, ~BIT5, BIT5);
491 ddBarAddress = 0x58830000;
492 WritePCI ((UINT32) Value + SB_EHCI_REG10, AccWidthUint32, &ddBarAddress);
493 //Enable Memory access
494 RWPCI ((UINT32) Value + SB_EHCI_REG04, AccWidthUint8, 0, BIT1);
495 // RPR Enable Global Clock Gating (BIT14)
496 RWMEM (ddBarAddress + SB_EHCI_BAR_REGBC, AccWidthUint32, ~(BIT12 + BIT14), BIT12 + BIT14);
497 RWMEM (ddBarAddress + SB_EHCI_BAR_REGB0, AccWidthUint32, ~BIT5, BIT5);
498 RWPCI ((UINT32) Value + SB_EHCI_REG04, AccWidthUint8, 0, 0);
499 // RWMEM (ddBarAddress + SB_EHCI_BAR_REGB0, AccWidthUint32, ~BIT5, BIT5);
504 * usb1OhciInitAfterPciInit - Config USB1 OHCI controller after PCI emulation
508 * @param[in] pConfig Southbridge configuration structure pointer.
512 usb1OhciInitAfterPciInit (
517 ddDeviceId = (USB1_OHCI_BUS_DEV_FUN << 16);
518 OhciInitAfterPciInit (ddDeviceId, pConfig);
519 RWPCI ((USB1_OHCI_BUS_DEV_FUN << 16) + SB_OHCI_REG78, AccWidthUint32 | S3_SAVE, 0xffffffff, BIT28 + BIT29);
523 * usb2OhciInitAfterPciInit - Config USB2 OHCI controller after PCI emulation
527 * @param[in] pConfig Southbridge configuration structure pointer.
531 usb2OhciInitAfterPciInit (
536 ddDeviceId = (USB2_OHCI_BUS_DEV_FUN << 16);
537 OhciInitAfterPciInit (ddDeviceId, pConfig);
541 * usb3OhciInitAfterPciInit - Config USB3 OHCI controller after PCI emulation
545 * @param[in] pConfig Southbridge configuration structure pointer.
549 usb3OhciInitAfterPciInit (
554 ddDeviceId = (USB3_OHCI_BUS_DEV_FUN << 16);
555 OhciInitAfterPciInit (ddDeviceId, pConfig);
559 * usb4OhciInitAfterPciInit - Config USB4 OHCI controller after PCI emulation
563 * @param[in] pConfig Southbridge configuration structure pointer.
567 usb4OhciInitAfterPciInit (
572 ddDeviceId = (USB4_OHCI_BUS_DEV_FUN << 16);
573 OhciInitAfterPciInit (ddDeviceId, pConfig);
574 if (pConfig->BuildParameters.Ohci4Ssid != NULL ) {
575 RWPCI ((USB4_OHCI_BUS_DEV_FUN << 16) + SB_OHCI_REG2C, AccWidthUint32 | S3_SAVE, 0x00, pConfig->BuildParameters.Ohci4Ssid);
580 OhciInitAfterPciInit (
585 #ifdef SB_USB_BATTERY_CHARGE_SUPPORT
586 RWPCI ((UINT32) Value + SB_OHCI_REG40 + 6, AccWidthUint8 | S3_SAVE, 0xFF, 0x1F);
588 // Disable the MSI capability of USB host controllers
589 RWPCI ((UINT32) Value + SB_OHCI_REG40 + 1, AccWidthUint8 | S3_SAVE, 0xFF, BIT0);
590 if ((IsSbA11 ()) || (IsSbA12 ())) {
591 RWPCI ((UINT32) Value + SB_OHCI_REG50, AccWidthUint8 | S3_SAVE, ~(BIT0 + BIT5 + BIT12), 0);
593 RWPCI ((UINT32) Value + SB_OHCI_REG50, AccWidthUint8 | S3_SAVE, ~(BIT0 + BIT5 + BIT12), BIT0);
595 // RPR USB SMI Handshake
596 RWPCI ((UINT32) Value + SB_OHCI_REG50 + 1, AccWidthUint8 | S3_SAVE, ~BIT4, 0x00);
597 if (Value != (USB4_OHCI_BUS_DEV_FUN << 16)) {
598 if ( pConfig->BuildParameters.OhciSsid != NULL ) {
599 RWPCI ((UINT32) Value + SB_OHCI_REG2C, AccWidthUint32 | S3_SAVE, 0x00, pConfig->BuildParameters.OhciSsid);
602 //RPR recommended setting to, enable fix to cover the corner case S3 wake up issue from some USB 1.1 devices
603 //OHCI 0_PCI_Config 0x50[30] = 1
604 RWPCI ((UINT32) Value + SB_OHCI_REG50 + 3, AccWidthUint8 | S3_SAVE, ~BIT6, BIT6);
606 // RPR Set OHCI Arbiter Mode.
607 // RPR Set Enable Global Clock Gating.
608 RWPCI ((UINT32) Value + SB_OHCI_REG80, AccWidthUint8 | S3_SAVE, ~(BIT0 + BIT4 + BIT5 + BIT6 + BIT7), BIT0 + BIT4 + BIT7);
610 RWPCI ((UINT32) Value + SB_OHCI_REG50, AccWidthUint8 | S3_SAVE, ~BIT0, 0);
611 // RPR 7.21 OHCI Arbiter Mode
612 // A13 Remove Arbitor Reset
613 if ( IsSbA12Plus () ) {
614 RWPCI ((UINT32) Value + SB_OHCI_REG80, AccWidthUint16 | S3_SAVE, ~(BIT4 + BIT5 + BIT8), (BIT4 + BIT5 + BIT8));
616 RWPCI ((UINT32) Value + SB_OHCI_REG80, AccWidthUint16 | S3_SAVE, ~(BIT4 + BIT5), (BIT4));
618 // RPR Enable OHCI SOF Synchronization.
619 // RPR Enable OHCI Periodic List Advance.
620 RWPCI ((UINT32) Value + SB_OHCI_REG50 + 2, AccWidthUint8 | S3_SAVE, ~(BIT3 + BIT4), BIT3 + BIT4);
621 if ( pConfig->BuildParameters.UsbMsi) {
622 RWPCI ((UINT32) Value + SB_OHCI_REG40 + 1, AccWidthUint8 | S3_SAVE, ~BIT0, 0x00);
623 RWPCI ((UINT32) Value + SB_OHCI_REG50, AccWidthUint8 | S3_SAVE, ~BIT5, BIT5);
625 //7.23 USB1.1 full-speed false crc errors detected. Issue - fix enable
626 if ( IsSbA12Plus () ) {
627 RWPCI ((UINT32) Value + SB_OHCI_REG80, AccWidthUint32 | S3_SAVE, (UINT32) (~(0x01 << 10)), (UINT32) (0x01 << 10));
638 UINT32 ddRetureValue;
647 RWPCI ((UINT32) Value + 0xC4, AccWidthUint8, 0xF0, 0x00);
648 RWPCI ((UINT32) Value + 0x04, AccWidthUint8, 0xFF, 0x02);
650 ReadPCI ((UINT32) Value + 0x10, AccWidthUint32, &ddBarAddress);
651 for (portSC = 0x64; portSC < 0x75; portSC += 0x04 ) {
652 // Get OHCI command registers
653 ReadMEM (ddBarAddress + portSC, AccWidthUint16, &dwVar);
654 if ( dwVar & BIT6 ) {
655 ddRetureValue = ddBarAddress + portSC;
656 RWMEM (ddBarAddress + portSC, AccWidthUint16, ~BIT6, 0);
659 ReadMEM (ddBarAddress + portSC, AccWidthUint16, &dwData);
660 if (dwData == 0x1005) break;
665 return ddRetureValue;
671 XhciInitIndirectReg (
674 UINT32 ddDrivingStrength;
676 ddDrivingStrength = 0;
678 #ifdef SB_USB_BATTERY_CHARGE_SUPPORT
679 RWXhciIndReg ( 0x40000018, 0xFFFFFFFF, 0x00000030);
682 // RPR SuperSpeed PHY Configuration (adaptation mode setting)
684 RWXhciIndReg ( SB_XHCI_IND_REG94, 0xFFFFFC00, 0x00000021);
685 RWXhciIndReg ( SB_XHCI_IND_REGD4, 0xFFFFFC00, 0x00000021);
687 // RPR SuperSpeed PHY Configuration (CR phase and frequency filter settings)
689 RWXhciIndReg ( SB_XHCI_IND_REG98, 0xFFFFFFC0, 0x0000000A);
690 RWXhciIndReg ( SB_XHCI_IND_REGD8, 0xFFFFFFC0, 0x0000000A);
695 RWXhciIndReg ( SB_XHCI_IND_REG00, 0xF8FFFFFF, 0x07000000);
697 #ifdef USB3_EHCI_DRIVING_STRENGTH
699 // RPR 8.13 xHCI USB 2.0 PHY Settings
700 // Step 1 is done by hardware default
702 for (port = 0; port < 4; port ++) {
703 ddDrivingStrength = (USB3_EHCI_DRIVING_STRENGTH >> (port * 4)) & 0xF;
704 if (ddDrivingStrength & BIT3) {
705 ddDrivingStrength &= 0x07;
707 RWXhci0IndReg ( SB_XHCI_IND60_REG00, 0xFFFE0E78, (port << 13) + ddDrivingStrength);
708 RWXhci0IndReg ( SB_XHCI_IND60_REG00, 0xFFFFEFFF, 0x00001000);
710 RWXhci1IndReg ( SB_XHCI_IND60_REG00, 0xFFFE0E78, ((port - 2) << 13) + ddDrivingStrength);
711 RWXhci1IndReg ( SB_XHCI_IND60_REG00, 0xFFFFEFFF, 0x00001000);
717 #ifdef USB_LOGO_SUPPORT
718 //for D3 USB LOGO [6:0]= 4; [8:7] = 3; [12] = 0; [16:13] port;
719 for (port = 0; port < 4; port ++) {
721 RWXhci0IndReg ( SB_XHCI_IND60_REG00, 0xFFFE0E00, (port << 13) + 0x184 );
723 RWXhci1IndReg ( SB_XHCI_IND60_REG00, 0xFFFE0E00, ((port - 2) << 13) + 0x184 );
730 RWXhciIndReg ( SB_XHCI_IND60_REG0C, ~ ((UINT32) (0x0f << 8)), ((UINT32) (0x00 << 8)));
731 RWXhciIndReg ( SB_XHCI_IND60_REG08, ~ ((UINT32) (0xff << 8)), ((UINT32) (0x15 << 8)));
733 RWXhciIndReg ( SB_XHCI_IND60_REG0C, ~ ((UINT32) (0x0f << 8)), ((UINT32) (0x02 << 8)));
734 RWXhciIndReg ( SB_XHCI_IND60_REG08, ~ ((UINT32) (0xff << 8)), ((UINT32) (0x0f << 8)));
745 // 8.14 PLUG/UNPLUG of USB 2.0 devices make the XHCI USB 2.0 ports unfunctional - fix enable
746 // ACPI_USB3.0_REG 0x20[12:11] = 2'b11
747 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG20, AccWidthUint32, ~((UINT32) (0x3 << 11)), (UINT32) (0x3 << 11));
749 // 8.15 XHC 2 USB2 ports interactional issue - fix enable
750 // ACPI_USB3.0_REG 0x20[16] = 1'b1
751 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG20, AccWidthUint32, ~((UINT32) (0x1 << 16)), (UINT32) (0x1 << 16));
753 // 8.16 xHCI USB 2.0 Ports Suspend Enhancement
754 // ACPI_USB3.0_REG 0x20[15] = 1'b1
756 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG20, AccWidthUint32, ~((UINT32) (0x1 << 15)), (UINT32) (0x1 << 15));
758 // 8.17 XHC HS/FS IN Data Buffer Underflow issue - fix enable
759 // ACPI_USB3.0_REG 0x20[20:18] = 0x7
761 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG20, AccWidthUint32, ~((UINT32) (0x7 << 18)), (UINT32) (0x7 << 18));
763 // 8.18 Allow XHCI to Resume from S3 Enhancement
764 // ACPI_USB3.0_REG 0x98[19] = 1'b1
766 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG98, AccWidthUint32, ~((UINT32) (0x1 << 19)), (UINT32) (0x1 << 19));
768 // 8.19 Assign xHC1 ( Dev 16 function 1) Interrupt Pin register to INTB#
769 // ACPI_PMIO_F0[18] =1
771 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGF0, AccWidthUint32, ~((UINT32) (0x1 << 18)), (UINT32) (0x1 << 18));
773 // 8.20 Allow B-Link Clock Gating when EHCI3/OHCI3 is only Controller Enabled
774 // ACPI_PMIO_F0[13] =1
776 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGF0, AccWidthUint32, ~((UINT32) (0x1 << 13)), (UINT32) (0x1 << 13));
778 // 8.21 Access register through JTAG fail when switch from XHCI to EHCI/OHCI - Fix enable
779 // ACPI_PMIO_F0[17] =1
781 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGF0, AccWidthUint32, ~((UINT32) (0x1 << 17)), (UINT32) (0x1 << 17));
783 // 8.22 USB leakage current on differential lines when ports are switched to XHCI - Fix enable
784 // ACPI_PMIO_F0[14] =1
786 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGF0, AccWidthUint32, ~((UINT32) (0x1 << 14)), (UINT32) (0x1 << 14));
787 // RWMEM (ACPI_MMIO_BASE + SMI_BASE + SB_SMI_xHC0Pme, AccWidthUint16, 0, 0x0B0B);
789 // 8.26 Fix for Incorrect Gated Signals in xhc_to_s5
790 // ACPI_PMIO_F0[16] =1
792 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGF0, AccWidthUint32, ~((UINT32) (0x1 << 16)), (UINT32) (0x1 << 16));
796 XhciInitBeforePciInit (
806 UINTN XhciFwStarting;
811 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00, AccWidthUint32, 0x00000000, 0x00400700);
814 // Get ROM SIG starting address for USB firmware starting address (offset 0x0C to SIG address)
816 GetRomSigPtr (&XhciFwStarting);
818 if (XhciFwStarting == 0) {
822 XhciFwStarting = ACPIMMIO32 (XhciFwStarting + FW_TO_SIGADDR_OFFSET);
824 //XHCI firmware re-load
825 RWPCI ((LPC_BUS_DEV_FUN << 16) + SB_LPC_REGCC, AccWidthUint32 | S3_SAVE, ~BIT2, (BIT2 + BIT1 + BIT0));
826 RWPCI ((LPC_BUS_DEV_FUN << 16) + SB_LPC_REGCC, AccWidthUint32 | S3_SAVE, 0x00000FFF, (UINT32) (XhciFwStarting));
829 // RPR Enable SuperSpeed receive special error case logic. 0x20 bit8
830 // RPR Enable USB2.0 RX_Valid Synchronization. 0x20 bit9
831 // Enable USB2.0 DIN/SE0 Synchronization. 0x20 bit10
833 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG20, AccWidthUint32, 0xFFFFF8FF, 0x00000700);
835 // RPR SuperSpeed PHY Configuration (adaptation timer setting)
837 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG90, AccWidthUint32, 0xFFF00000, 0x000AAAAA);
838 //RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG90 + 0x40, AccWidthUint32, 0xFFF00000, 0x000AAAAA);
841 // Step 1. to enable Xhci IO and Firmware load mode
843 #ifdef XHCI_SUPPORT_ONE_CONTROLLER
844 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00, AccWidthUint32, 0xF0FFFFFC, 0x00000001);
846 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00, AccWidthUint32, 0xF0FFFFFC, 0x00000003);
848 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00, AccWidthUint32, 0xEFFFFFFF, 0x10000000);
851 // Step 2. to read a portion of the USB3_APPLICATION_CODE from BIOS ROM area and program certain registers.
854 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REGA0, AccWidthUint32, 0x00000000, (SPI_HEAD_LENGTH << 16));
856 BcdAddress = ACPIMMIO16 (XhciFwStarting + BCD_ADDR_OFFSET);
857 BcdSize = ACPIMMIO16 (XhciFwStarting + BCD_SIZE_OFFSET);
858 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REGA4, AccWidthUint16, 0x0000, BcdAddress);
859 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REGA4 + 2, AccWidthUint16, 0x0000, BcdSize);
861 AcdAddress = ACPIMMIO16 (XhciFwStarting + ACD_ADDR_OFFSET);
862 AcdSize = ACPIMMIO16 (XhciFwStarting + ACD_SIZE_OFFSET);
863 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REGA8, AccWidthUint16, 0x0000, AcdAddress);
864 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REGA8 + 2, AccWidthUint16, 0x0000, AcdSize);
866 SpiValidBase = SPI_BASE2 (XhciFwStarting + 4) | SPI_BAR0_VLD | SPI_BASE0 | SPI_BAR1_VLD | SPI_BASE1 | SPI_BAR2_VLD;
867 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REGB0, AccWidthUint32, 0x00000000, SpiValidBase);
870 // Copy Type0/1/2 data block from ROM image to MMIO starting from 0xC0
872 for (i = 0; i < SPI_HEAD_LENGTH; i++) {
873 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REGC0 + i, AccWidthUint8, 0, ACPIMMIO8 (XhciFwStarting + i));
876 for (i = 0; i < BcdSize; i++) {
877 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REGC0 + SPI_HEAD_LENGTH + i, AccWidthUint8, 0, ACPIMMIO8 (XhciFwStarting + BcdAddress + i));
880 for (i = 0; i < AcdSize; i++) {
881 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REGC0 + SPI_HEAD_LENGTH + BcdSize + i, AccWidthUint8, 0, ACPIMMIO8 (XhciFwStarting + AcdAddress + i));
885 // Step 3. to enable the instruction RAM preload functionality.
887 FwAddress = ACPIMMIO16 (XhciFwStarting + FW_ADDR_OFFSET);
888 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REGB4, AccWidthUint16, 0x0000, ACPIMMIO16 (XhciFwStarting + FwAddress));
890 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG04, AccWidthUint16, 0x0000, FwAddress);
892 FwSize = ACPIMMIO16 (XhciFwStarting + FW_SIZE_OFFSET);
893 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG04 + 2, AccWidthUint16, 0x0000, FwSize);
896 // Set the starting address offset for Instruction RAM preload.
898 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG08, AccWidthUint16, 0x0000, 0);
900 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00, AccWidthUint32, ~BIT29, BIT29);
903 ReadMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00 , AccWidthUint32, &RegData);
904 if (RegData & BIT30) break;
906 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00, AccWidthUint32, ~BIT29, 0);
909 // Step 4. to release resets in XHCI_ACPI_MMIO_AMD_REG00. wait for USPLL to lock by polling USPLL lock.
912 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00, AccWidthUint32, ~U3PLL_RESET, 0); //Release U3PLLreset
914 ReadMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00 , AccWidthUint32, &RegData);
915 if (RegData & U3PLL_LOCK) break;
918 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00, AccWidthUint32, ~U3PHY_RESET, 0); //Release U3PHY
919 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00, AccWidthUint32, ~U3CORE_RESET, 0); //Release core reset
921 // RPR 8.8 SuperSpeed PHY Configuration, it is only for A11.
923 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG90, AccWidthUint32, 0xFFF00000, 0x000AAAAA); //
924 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REGD0, AccWidthUint32, 0xFFF00000, 0x000AAAAA); //
927 XhciInitIndirectReg ();
929 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEF, AccWidthUint8, ~(BIT4 + BIT5), 0); // Disable Device 22
930 RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REGEF, AccWidthUint8, ~(BIT7), BIT7); // Enable 2.0 devices
931 if (!(pConfig->S4Resume)) {
932 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00, AccWidthUint32, ~(BIT21), BIT21); //SMI
937 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00, AccWidthUint32, ~(BIT17 + BIT18 + BIT19), BIT17 + BIT18);
940 if (IsSbA12Plus ()) {
943 //8.22 UMI Lane Configuration Information for XHCI Firmware to Calculate the Bandwidth for USB 3.0 ISOC Devices
944 if (!(IsUmiOneLaneGen1Mode ())) {
945 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG20, AccWidthUint32, ~(BIT25 + BIT24), BIT24);
950 XhciInitAfterPciInit (
954 // RPR8.12 Block Write to DID & SID to pass DTM
955 RWXhciIndReg ( SB_XHCI_IND_REG04, ~BIT8, BIT8);
957 if (IsSbA13Plus ()) {
958 //8.23 FS/LS devices not functional after resume from S4 fix enable (SB02699)
959 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG20, AccWidthUint32, ~(BIT22), BIT22);
961 //8.24 XHC USB2.0 Hub disable issue fix enable (SB02702)
962 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REGB4, AccWidthUint32, ~(BIT20), BIT20);
970 //OBS221599: USB 3.0 controller shows bang in Windows Device Manager
974 WriteIO (SB_IOMAP_REGC00, AccWidthUint8, &Data);
976 WriteIO (SB_IOMAP_REGC01, AccWidthUint8, &Data);
978 if (pConfig->S4Resume) {
979 RWMEM (ACPI_MMIO_BASE + XHCI_BASE + XHCI_ACPI_MMIO_AMD_REG00, AccWidthUint32, ~(BIT21), BIT21); //SMI