📄 pmupost.asm
字号:
PM_RAM ENDS
DGROUP GROUP FCODE
FCODE SEGMENT USE16 PARA Public 'CODE'
ASSUME CS:DGROUP
;[]-------------------------------------------------------------------[]
;
; PPPPPPPP AA RRRRRRRR TTTTTTTTTTT 111
; PPPPPPPPP AAAA RRRRRRRRR TTTTTTTTTTT *** 1111
; PPP PPP AAAAAA RRR RRR TTT *** 11111
; PPPPPPPPP AAA AAA RRRRRRRRR TTT 111
; PPPPPPPP AAAAAAAAAA RRRRRRRR TTT *** 111
; PPP AAAAAAAAAAAA RRR RRR TTT *** 111
; PPP AAA AAA RRR RRR TTT 111
;
;
; 1. Standard routines that must be filled in to let the BIOS KERNAL
; to program the PMU registers
; 2. Called during POST & after POST
;
;[]-------------------------------------------------------------------[]
;R38 - start
;[]==============================================================[]
; Disable_E000_ROM_Shadow : (POST 63h)
; Disable E000 ROM Shadow (Direct Access to ISA)
; Input : None
; Output: None
; Save: all
;[]==============================================================[]
public Disable_E000_ROM_Shadow
Disable_E000_ROM_Shadow proc near
;disable E0000 shadow RAM
mov cx,VT692 + 63h
mov bl,NOT 0c0H
call Get_Set_Ct_AND
;disable onboard E0000 ROM
mov cx,VT586 + 43h
mov bl,NOT 30H
call Get_Set_Ct_AND
ret
Disable_E000_ROM_Shadow endp
;R38A ;[]==============================================================[]
;R38A ; Get_Set_Ct_AND(Get_Set_PCI_AND):
;R38A ; AND a value in the chipset register.
;R38A ; Input : CX = Index register to change.
;R38A ; bl = Value to change (AND)
;R38A ; Output : None
;R38A ; Destory: EAX, ECX, DX
;R38A ;
;R38A ;[]==============================================================[]
;R38A Public Get_Set_Ct_AND, Get_Set_PMU_AND
;R38A Get_Set_Ct_AND proc near
;R38A Get_Set_PMU_AND:
;R38A extrn Get_Ct:near
;R38A extrn Set_Ct:near
;R38A call Get_Ct
;R38A and al, bl ;AND data
;R38A call Set_Ct
;R38A ret
;R38A Get_Set_Ct_AND endp
;[]==============================================================[]
;E000_Shadow_R:
; Set video BIOS(E000-E800) shadow readonly
;Input : none
;Output: none
;[]==============================================================[]
Public E000_Shadow_R
E000_Shadow_R proc near
extrn GET_SET_CT:near
mov cx,VT692 + 63h
mov bx,803fh
call GET_SET_CT
ret
E000_Shadow_R endp
Public E000_64k_Shadow_R
E000_64k_Shadow_R proc near
jmp E000_Shadow_R
E000_64k_Shadow_R endp
;R38 - end
;[]========================================================================[]
;Procedure: Get_PM_IRQ
;
;Function : Tell BIOS which IRQ is PMI using
;
;Input : None
;
;Output : NC:
; AL = 1 - PMI using IRQ 15
; AL = 2 - PMI using NMI
; AL = 3 - PMI using SMI
; CF:
; No IRQ or NMI or SMI is available
;
;Preserve : All except AX & FLAG
;
;Note : 1. Stack available
; 2. called from PM_Init
;[]========================================================================[]
Public Get_PM_IRQ
Get_PM_IRQ Proc Near
mov al,03h ;always SMI for PENTIUM CPU
clc
ret
Get_PM_IRQ Endp
;[]========================================================================[]
;Procedure: Check_PM_Using_NMI
;
;Function : To handle the NMI which is caused by a PMU
;
;Input : None
;
;Output : None
;
;Saves : Please save all registers
;
;[Note] : 1. Called every time a NMI is occured
; 2. check to see if this SMI is issue by PMU
;
; if PMI ; Serve the PMI then
;
; sti
; iret
;
; if not PMI : jump back to a external label(near)
; named "NMI_Original" & do nothing!
;
; So if your chip never use NMI, just "jmp NMI_Original"!
;
;[]========================================================================[]
Public Check_PM_Using_NMI
Check_PM_Using_NMI:
PM_Not_NMI:
extrn NMI_Original:near
jmp NMI_Original
;[]-------------------------------------------------------------------[]
;
; PPPPPPPP AA RRRRRRRR TTTTTTTTTTT 2222222
; PPPPPPPPP AAAA RRRRRRRRR TTTTTTTTTTT *** 22222222
; PPP PPP AAAAAA RRR RRR TTT *** 222 222
; PPPPPPPPP AAA AAA RRRRRRRRR TTT 222
; PPPPPPPP AAAAAAAAAA RRRRRRRR TTT *** 222
; PPP AAAAAAAAAAAA RRR RRR TTT *** 2222222
; PPP AAA AAA RRR RRR TTT 22222222
;
;
; Called during POST Only
;
;[]-------------------------------------------------------------------[]
;[]========================================================================[]
;Procedure: Ct_Check_Green_VGA
;
;Function : To tell BIOS kernel that if the VGA adaptor's V/H SYNC
; signal should be turned off or not when video off.
; This should refer to the setup setting.
;
;Input : None
;
;Output : ZF : don't turned off V/H SYNC
; NZ : V/H SYNC can be turned off
;
;Note : 1. Some VGA adaptors use V/H SYNC signals for special
; purpose, e.g. TSENG LAB use them for DRAM refresh.
; Therefore, these signals must never be turn off
; at any time.
; 2. called from POST at POST 82
;[]========================================================================[]
Public Ct_Check_Green_VGA
Ct_Check_Green_VGA Proc Near
pushad
mov si,offset VGA_Type_Item
call GetItem_Value
or al,al
popad
ret
Ct_Check_Green_VGA Endp
;[]==============================================================[]
;Input: None
;Function : To see if it is a SMI
;[]==============================================================[]
Public Ct_Check_SMI_Start
Ct_Check_SMI_Start Proc Near
extrn Not_SMI_Start:near
jmp Not_SMI_Start
Ct_Check_SMI_Start Endp
;[]==============================================================[]
;Procedure: PM_Option_Check
;
;Function : Get PM option
;
;Input : None
;
;Output : 1. ZF - User Defined!
; i.e. use CMOS value to prg PM chip
;
; NZ - Use Pre-defined value to prg PM chip
; AL = PM option
; i.e. DISBLED
; MAX-POWER_SAVING
; MIN-POWERING-SAVING....
; SI = offset of auto-table
; i.e. MIN_PM_SAVING_TABLE
; MAX_PM_SAVING_TABLE
; PM_DISABLE_TABLE in file PFEATURE.ASM
;
; 2. CF - Global Power Management should be disabled
;
; NC - Global Power Management should be enabled
;
;Registers : FLAGS, AX, SI - destroyed
; Others - should be preserved
;[]==============================================================[]
Public PM_Option_Check
PM_Option_Check Proc Near
mov si,offset cs:PM_Option_Item
call GetItem_Value
mov cl,al
xor ch,ch
mov si,offset cs:PM_Auto_Table
shl cx,1
dec cx
add si,cx
mov si,cs:[si]
PM_Option_Check_Exit:
cmp al,1 ;PM disabled?
je short @F ;yes
;if PM option is "user defined" then OEM routine should
;check here for both items disabled
or al,al ;set/clear Zero Flag
clc
ret
@@:
or al,al ;set/clear Zero Flag
ifdef Set_APM_According_PM_Setup
stc ;indicate PM disable
else; Set_APM_According_PM_Setup
clc ;indicate PM disable
endif; Set_APM_According_PM_Setup
ret
PM_Option_Check Endp
;[]==================================================================[]
;Procedure: Ct_Global_PM_Disable
;
;Function : To disable all power management features
;
;Input : None
;Output : None
;
;Registers: all registers preserved
;
;[Note] : called from PM_INIT before PM_RAM is available
;[]==================================================================[]
Public Ct_Global_PM_Disable
Ct_Global_PM_Disable Proc Near
pusha
ifdef USB_SUPPORT
POST_FUNC_CALL Ct_Check_Usb_Disabled
jnc short @f
endif ;USB_SUPPORT
@@:
popa
ret
Ct_Global_PM_Disable Endp
;[]==================================================================[]
;Procedure: Clear_PM_RAM
;
;Function : Clear power management data area (PM_RAM segment)
; This routine is used to clear extended BIOS data area
; in order to provide a clean environment for power
; management code
;
;Input : ES : PM_RAM
;Output : None
;
;Registers: all registers preserved except FLAGS
;
;[Note] : called from PM_INIT
;[]==================================================================[]
Public Clear_PM_RAM
Clear_PM_RAM Proc Near
ASSUME ES:PM_RAM
pusha
mov di,offset PM_RAM:PM_RAM_START
mov cx,PM_RAM_LEN
xor ax,ax
cld
rep stosb
popa
ret
Clear_PM_RAM Endp
;[]========================================================================[]
;Procedure: Ct_PMRAM_Use_SYSRAM
;
;Function : To tell the BIOS kernel that if you are using the SYSRAM
; for PM_RAM
;
;Input : None
;
;Output : AL = Size of PM_RAM that you want to reserved from SYSRAM.
; 0=None, 1=1K, 2=2k etc.
;
;Save : All registers except AL & FLAGS
;
;Note : 1. called before PM_INIT (POST 79)
; 2. simply return AL=0 if PM_RAM is located at shadow RAM
; or SMRAM
; 4. stack available
;[]========================================================================[]
Public Ct_PMRAM_Use_SYSRAM
Ct_PMRAM_Use_SYSRAM Proc Near
xor al,al
ret
Ct_PMRAM_Use_SYSRAM Endp
;[]========================================================================[]
;Procedure: Ct_Early_PM_Init
;
;Function : Early PM chip initializations
;
;Input : None
;
;Output : None
;
;Preserve : All
;
;Note : 1. Call from POST 9
; 2. Stack available
; 3. You can initialize any PM function which is needed
; to be done earlier!
;[]========================================================================[]
Public Ct_Early_PM_Init
Ct_Early_PM_Init Proc Near
Post_Func_Call E000_Ct_Early_PM_Init
ret
Ct_Early_PM_Init Endp
ifndef New_Superio_Led_Function ;R42
ifdef PM_LED_USE_GPIO
F000_Set_PM_LED Proc Far
call Set_PM_LED
retf
F000_Set_PM_LED Endp
endif; PM_LED_USE_GPIO
ifdef LED_Blinking_at_PM
F000_Set_PM_LED_Blinking Proc Far
call Set_PM_LED_Blinking
retf
F000_Set_PM_LED_Blinking Endp
endif; LED_Blinking_at_PM
ifdef POWER_LED_USE
F000_Set_POWER_LED Proc Far
call Set_POWER_LED
retf
F000_Set_POWER_LED Endp
endif; POWER_LED_USE
;R42 - start
else ;New_Superio_Led_Function
ifdef LED_Blinking_at_PM
F000_LED_Flash Proc Far
call Set_POWER_LED
retf
F000_LED_Flash Endp
endif; LED_Blinking_at_PM
endif ;New_Superio_Led_Function
;R42Aifdef Superio_Support_Fan
;R42AF000_Fan_Power_On Proc Far
;R42A call Fan_Power_On
;R42A retf
;R42AF000_Fan_Power_On Endp
;R42A
;R42AF000_Fan_Power_Off Proc Far
;R42A call Fan_Power_Off
;R42A retf
;R42AF000_Fan_Power_Off Endp
;R42Aendif; Superio_Support_Fan
;R42 - end
;[]========================================================================[]
;Input : None
;Output : AL = 0 --> Currently MODEM Ring cannot
; wake up system
; AL = RING_WAKEUP_ENABLED --> Currently MODEM Ring can
; wake up system
;[]========================================================================[]
Public CT_RING_WAKEUP_STATUS
CT_RING_WAKEUP_STATUS Proc Near
mov cx, VT586_ACPI + 44h
call Get_PMU
mov bl,al
mov [WAKE_MODEM0],al
mov cx,VT586_ACPI + 45h
call Get_PMU
mov bh,al
mov [WAKE_MODEM1],al
mov cx, VT586_ACPI + 46h
call Get_PMU
or bl,al
mov cx, VT586_ACPI + 47h
call Get_PMU
mov bh,al
mov word ptr PM_RAM:[DEASSERT_STPCLK_IRQS],bx
extrn Modem_IRQ_Item:near
mov si, offset Modem_IRQ_Item
call GetItem_Value
mov word ptr [APM_Modem_IRQ], 0
or al, al
jz short @F
mov bx, 1
mov cl, al
shl bx, cl
mov word ptr [APM_Modem_IRQ], bx
or word ptr PM_RAM:[DEASSERT_STPCLK_IRQS],bx
or byte ptr [WAKE_MODEM0],bl
or byte ptr [WAKE_MODEM1],bh
test ax,bx
mov al, RING_WAKEUP_ENABLED ;current ON
jnz short @F
xor al, al ;current OFF
@@:
ret
CT_RING_WAKEUP_STATUS Endp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -