Specifications

2012 Advanced Micro Devices, Inc.
Appendix A: Sample Codes for BIOS Workarounds
Page 71
mov ah, 0c4h
call read_pci_dword_far
or ebx, 03h ; Set to D3 state
call write_pci_dword_far
; Enabled EHCI1 & BAR
mov dx, (19 shl 3) + 2 ; EHCI 1
mov ah, 0c4h
call read_pci_dword_far ; Set back to D0 state
and ebx, 0fffffff0h
call write_pci_dword_far
mov ah, 004h ;
call read_pci_dword_far
or ebx, 07h
; Enabled IO/Memory/Bus
call write_pci_dword_far
mov dx, (19 shl 3) + 2 ;
mov ah, 10h ; Get Bar address
call read_pci_dword_far ; in EBX
call USBWorkaroundForConnected
mov dx, (19 shl 3) + 2 ;
mov ah, 0c4h
call read_pci_dword_far
or ebx, 03h ; Set to D3 state
call write_pci_dword_far
popad
ret
USBConnectWorkaround ENDP
USBWorkaroundForConnected PROC NEAR
push es
push 0
pop es
add ebx, 64h ; Get first USB port
mov cx, 6
@@:
mov eax, es:[ebx]
test eax, BIT13 + BIT0 ; Check port empty or not
jnz SkipWR
or eax, BIT13 ; Set to OHCI
SkipWR:
or eax, BIT21+ BIT22 ; Enabled wake by connected/disconnect
or es:[ebx], eax
add
ebx, 4
loop @b
pop es
ret
USBWorkaroundForConnected ENDP
End of Sample code (Erratum # 23)