Specifications

©
2008 Advanced Micro Devices Inc.
Sample Programs
AMD SB600 BIOS Developer’s Guide (Public Version) Proprietary
Page 90
pushad
; OEM specific CMOS setup option to Auto/Disable/enable HD Audio
mov ax,CMOS_Azalia_Option ; OEM specific
call ReadCMOSOption ; OEM specific
cmp ax,1 ; Is it disable?
je DisableAzaliaController ; Jump for Disable HD Audio
; OEMs may have a CMOS setup option for HD Audio clock source.
; The options may be USB 48 MHz or HD Audio 48 MHz
; Device 14h, function 2, register 43h, bit 0 = 1 for HD Audio clock.
mov ax,CMOS_AZA_CLOCK ; OEM specific
call ReadCMOSOption ; OEM specific
cmp ax,1 ; Is it HD Audio clock at 48 MHz
jne @f ; Jump for USB 48 MHz clock
or Byte PTR es:[ebp+ATI_PCIE_BAR3+ATI_AZALIA_BUS_DEV_FUN shl 12 + 043h], BIT0
; Enable xAz48Mhz pin as clock source of 48Mhz
call ATI_fixed_delay_1ms_far ; Wait 1ms
@@:
; OEM may have CMOS setup for HD Audio snoop (0= Disable, 1=Enable)
; Device 14h, function 2, register 42, bits 1 and 0 control snoop option
mov ax,CMOS_AZA_SNOOP ; OEM specific
call ReadCMOSOption ; OEM specific
cmp ax,1 ; Snoop enabled?
jne @f ; Jump for disabled
or Byte PTR es:[ebp+ATI_PCIE_BAR3+ATI_AZALIA_BUS_DEV_FUN shl 12 + 042h], BIT1
; Enable Snoop
@@:
; Set subsystem ID at device 14h, function 2, register 2ch
mov Dword PTR es:[ebp+ATI_PCIE_BAR3+ATI_AZALIA_BUS_DEV_FUN shl 12 +2Ch], \
ATI_AZALIA_ID ; Write subsystem ID
; Get HD Audio controller’s memory mapped configuration registers in EBX
mov ebx, Dword PTR es:[ebp+ATI_PCIE_BAR3+ATI_AZALIA_BUS_DEV_FUN shl 12 +10h]
; HD Audio port configuration through Extended registers.
; Extended registers are addressed as index/data through SMBUS(Dev 14h, func0) register 0F8h,
; and 0FCh
; Index 0 is Audio port configuration. 2 bit per port for total of 4 ports
mov Dword PTR es:[ebp+ATI_PCIE_BAR3+ATI_SMBUS_BUS_DEV_FUN shl 12 \
+ATI_AZALIA_ExtBlk_Addr], 0 ; Set index to 0
; First declare all the lines as GPIO lines by setting index 00 to all 1's.
; Then read the input status of these line at index 02
; If the line is 1, it is guaranteed not to be HD Audio
; This step is necessary because after S4 resume from ring, the AC-97 gives same status as HD Audio