⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chippost.asm

📁 AWARD BIOS源代码,支持的CHIPSET请看文件,有同型号的板子烧上去就可以跑
💻 ASM
📖 第 1 页 / 共 5 页
字号:
		call    X_Set_Ct		;R29
		ret
X_Get_set_ct	endp
;[]==============================================================[]
; X_Get_Set_Ct_OR(Get_Set_PCI_OR):
;	Changes a value in the chipset register.
; Input  :	CX = Index register to change
;		bl = Value to change (OR)
; Output :	None
; Destory:	EAX, ECX, DX
;
;[]==============================================================[]
		Public	X_Get_Set_Ct_OR
X_Get_Set_Ct_OR	proc	near
		call    X_Get_Ct
		or      al, bl			;OR data
		call    X_Set_Ct
		ret
X_Get_Set_Ct_OR	endp

;[]==============================================================[]
; X_Get_Set_Ct_AND(Get_Set_PCI_AND):
;	Changes a value in the chipset register.
; Input  :	CX = Index register to change.
;		bl = Value to change (AND)
; Output :	None
; Destory:	EAX, ECX, DX
;
;[]==============================================================[]
		Public	X_Get_Set_Ct_AND
X_Get_Set_Ct_AND	proc	near
		call    X_Get_Ct
		and     al, bl			;AND data
		call    X_Set_Ct
		ret
X_Get_Set_Ct_AND	endp

;[]==============================================================[]
; X_Set_Ct_Clear(_Set_PCI_Clear):
;	Clear a value in the chipset register.
; Input  :	CX = Index register to change.
; Output :	None
; Destory:	EAX, ECX, DX
;
;[]==============================================================[]
		Public	X_Set_Ct_Clear
X_Set_Ct_Clear	proc	near
		xor	al,al			; Zero
		call	X_Set_Ct			; Clear
		ret
X_Set_Ct_Clear	endp

;[]==============================================================[]
; X_get_PMIO:
;       Reads a value directly from the chipset register.
;
; Input  :      CX = Index value of IO port
; Output :      AL = Value read
; Destory:      EAX
;[]==============================================================[]
		Public	X_Get_PMIO
X_Get_PMIO		proc    near
		F000_call	Get_PMIO
		ret
X_Get_PMIO		endp

;[]==============================================================[]
; X_set_pmio:
;       Changes a value in the chipset register.
; Input  :      CX = Index port to change
;               AL = Value to change
; Output :      None
; Destory:      EAX
;
;[]==============================================================[]

		Public	X_Set_PMIO
X_Set_PMIO		proc    near
		F000_call	Set_PMIO
		ret
X_Set_PMIO		endp
;[]==============================================================[]
; X_Get_set_pmio:
;       Changes a value in the chipset register.
; Input  :      CX = Index port to change
;               AX = Value to change, AL: AND Value, AH : OR value
; Output :      None
; Destory:      EAX
;
;[]==============================================================[]

		Public	X_Set_PMIO
X_Get_Set_PMIO		proc    near
		Post_Func_call	E000_Get_Set_PMIO
		ret
X_Get_Set_PMIO		endp

;[]==============================================================[]
; X_Get_set_pmio_OR:
;       Changes a value in the chipset register.
; Input  :      CX = Index port to change
;               AL : OR value
; Output :      None
; Destory:      EAX
;
;[]==============================================================[]

		Public	X_Get_Set_PMIO
X_Get_Set_PMIO_OR	proc    near
		Post_Func_call	E000_Get_Set_PMIO_OR
		ret
X_Get_Set_PMIO_OR	endp

;[]==============================================================[]
; X_Get_set_pmio_AND:
;       Changes a value in the chipset register.
; Input  :      CX = Index port to change
;               AX = Value to change, AL: AND Value, AH : OR value
; Output :      None
; Destory:      EAX
;
;[]==============================================================[]

		Public	X_Get_Set_PMIO_AND
X_Get_Set_PMIO_AND	proc    near
		Post_Func_call	E000_Get_Set_PMIO_AND
		ret
X_Get_Set_PMIO_AND	endp

ifdef	SMBus_Port
		Public	X_Ct_Get_Row_Map
X_Ct_Get_Row_Map	Proc	Near

                mov     cx,VT692+60h		; AL : bit0/1 bit2/3 bit4/5
                call    X_Get_CT			; Bank :  0/1	 2/3	4/5
						; if '10b' mean SDRAM !
		test	al, 02h
		jnz	short @f
		and	al, not 01h
@@:
		test	al, 08h
		jnz	short @f
		and	al, not 04h
@@:
		test	al, 20h
		jnz	short @f
		and	al, not 10h
@@:
		ret
X_Ct_Get_Row_Map	Endp
endif;	SMBus_Port

ifdef	Boot_Password
;[]===========================================================[]
;[]===========================================================[]
		public	Ct_SAVE_BOOT_PASSWORD
Ct_SAVE_BOOT_PASSWORD	Proc	Near
		pusha

		mov	bx, ax

		mov	al,BOOTPASS_LOC1
		mov	ah,bl
		F000_Call Set_CMOS2

		mov	al,BOOTPASS_LOC2
		mov	ah,bh
		F000_Call Set_CMOS2

		popa
		ret
Ct_SAVE_BOOT_PASSWORD	Endp

Cmp_BootPassword	proc	near

		mov	bx, ax

		ror	ebx,16
		mov	al,BOOTPASS_LOC1
		F000_Call Get_CMOS2
		mov	 bl,al

		mov	al,BOOTPASS_LOC2
		F000_Call Get_CMOS2
		mov	 bh,al

		ror	ebx,16
		mov	ax,bx
		ror	ebx,16

		cmp	ah,bh
		jne	short @F
		cmp	al,bl
	@@:
		ret
Cmp_BootPassword	endp

		public	xVerify_BootPass
xVerify_BootPass	proc	far

		push	word ptr ATTRIBUTE[bp]
		push	word ptr TEMP_YEAR[bp]
		push	ds

		mov	si, SEG DGROUP
		mov	ds, si

		test	byte ptr BOOTPASS_CMOS[bp], BOOTPASS_CMOS_BIT	;booting need pass?
		jz	Verify_Pass_Exit		;no, exit

		mov	ax,3
		int	10h

		extrn	Backup_pass_screen:near
		call	Backup_pass_screen

	Chk_Super_Pass:


		mov	byte ptr CUR_PAGE[bp], 0	; don't update time
		mov	word ptr LAST_KEY[bp], 0	; dummy word
		extrn	Get_Password:near
		call	Get_Password
		call	Cmp_BootPassword
		je	Password_Valid

		extrn	Error_PassWord:near
		Call	Error_PassWord
		jmp	Chk_Super_Pass

Password_Valid:
		extrn	Restore_pass_screen:near
		call	Restore_pass_screen
Verify_Pass_Exit:

		pop	ds
		pop	word ptr TEMP_YEAR[bp]		;use this word
		pop	word ptr ATTRIBUTE[bp]

		retf

xVerify_BootPass	endp

endif;	Boot_Password

X_CT_FINAL_INIT	Proc	Far
ifdef	Have_BankInterleave_Item
ifdef	Have_Page_Mode_Item
		pusha
		;---------------------------------------;
		;          Set DRAM Page Mode 		;
		;---------------------------------------;
		mov     si,offset DRAM_Page_Mode_Item
		call    X_GetItem_Value
		or	al,al
		jz	short Disable_DRAM_Page_Mode

		call	Test_DRAM		;If Fast Page DRAM exist ?
		cmp	al,1			;
		jz	short Disable_DRAM_Page_Mode	;Yes, jmp !

ifdef Disable_Page_When_100MHz
		call	X_If_100MHz_DRAM_Clock		; if 100MHz ?
		jc	short Disable_DRAM_Page_Mode	; Yes, jmp !
endif; Disable_Page_When_100MHz
                mov     cx, VT692+6bh
                mov     bl, 01h                 ;RX6b[0]=1
                call	X_Get_Set_Ct_OR

ifndef	No_Only_EDO_Page_Mode
		call	X_check_sdram	; If SDRAM DRAM exist ?
		jnz	short Only_EDO_Page_Mode	; No, jmp !
endif;	No_Only_EDO_Page_Mode

		mov     si,offset SDRAM_BK_Item
		call    X_GetItem_Value
		or	al,al				; If set Disable?
		jz	short Disable_DRAM_Page_Mode	; Yes, jmp!
		mov	bh, al
		mov	bl, al
		or	bl, 0FCh		; mask bit 1,0

                mov     cx, VT692+60h		;
                call	X_Get_Ct			;
		mov	si,ax			;Save DRAM type to SI.
		
		test	si,02h			; Enable Bank Interleave
		jz	short @f		; according to your setting.
		mov     cx, VT692+64h		;
		call	X_Get_Set_Ct		;
@@:						;
		test	si,08h			;
		jz	short @f		;
		mov     cx, VT692+65h		;
		call	X_Get_Set_Ct		;
@@:						;
		test	si,20h			;
		jz	short @f		;
		mov     cx, VT692+66h		;
		call	X_Get_Set_Ct		;
@@:
Only_EDO_Page_Mode:
		mov     cx, VT692+68h		;
		mov     bl, 0c0h                ; RX68[6,7]=11b
		call	X_Get_Set_Ct_OR		;

Disable_DRAM_Page_Mode:		
		popa
endif;	Have_Page_Mode_Item
endif;	Have_BankInterleave_Item

ifdef	Disable_Page_Mode_When_Over_75MHz
		Call	X_If_100MHz_DRAM_Clock		; if 100MHz ?
		jc	short Disable_DRAM_Page_Mode_	; Yes, jmp !
		jmp	short @f
Disable_DRAM_Page_Mode_:
                mov     cx, VT692+6bh
                mov     bl, not 01h		;RX6b[0]=0
                call	X_Get_Set_Ct_AND
@@:
endif;	Disable_Page_Mode_When_Over_75MHz

                ;-------------------------------;
                ; PCI Master Read Prefetch	;
                ; by enhanced command     	;
                ; VT692_PP RX42[7] =         	;
                ;        VT692 RX74[7]		;
                ;-------------------------------;

                mov     cx, VT692+74h
		call	X_Get_Ct
		and	al,80h
                mov     bh,al
                mov     cx, VT692_PP+42h
                mov     bl,7fh
		call	X_Get_Set_Ct

		;-------------------------------;
		;     Set Delay Transaction	;
		;-------------------------------;
		xor	bx, bx
		mov     si, offset Delay_Trans_Item
		call    X_GetItem_Value
		or	al, al
		jz	short @F
		mov	bh, 46h			; 47[6][2][1]
@@:

		mov	cx, VT586+47h
		call	X_Get_Ct
		and	al, NOT 046h
		or	al, bh
		call	X_Set_Ct

ifdef	Patch_Old_IDE_Driver_When_IDE_Disabled
		;-------------------------------;
		;  Set Register if IDE Disable	;
		;-------------------------------;

;Disable command register if both IDE channel are disabled
		mov	cx,VT586_IDE+40H	;check if both IDE disabled
		call	X_Get_Ct
		test	al,11b			;both channel disabled ?
		jnz	short AtLeast_OneCh

		mov	cx,VT586_IDE+4H		;command register
		call	X_Set_Ct_Clear		;disable I/O & Mem. access

AtLeast_OneCh:
		mov	cx,VT586_IDE+3cH	;set no IRQ required
		call	X_Set_Ct_Clear

		mov	cx,VT586_IDE+45H
		mov	bl, 10h			;lock register 3CH
		call	X_Get_Set_Ct_OR

		mov	ax,VT586_IDE+20H	;Read Bus Master Bus Address  
		mov	dx,0cf8h		;
		out	dx,eax			;
		add	dx,4			;
		in	ax,dx			;
		and	ax, not 03h		;
		mov	dx,ax			;

		add	dx,02h			; Addr + 2 = Channel 0 
		mov	al,60h			; bit 6,5 = 1
		out	dx,al
		add	dx,08h			; Addr + 10 = Channel 1
		out	dx,al
endif;	Patch_Old_IDE_Driver_When_IDE_Disabled

ifdef VT586_USB
    ifdef	USB2_Separate_Control	;R31 - starts
		;-----------------------;
		;   En/Disable USB 1	;
		;-----------------------;
		mov	bx, 00FBh		; Set Enable USB
		mov	si,offset ONBD_USB_Item	
		call	X_Getitem_Value		;R31A
;R31A		call	F000_Getitem_Value	
		or	al,al
		jz	short @f		; if Enable, jmp!
		mov	bx, 04FFh		; Set Disable USB

		mov	cx, VT586_USB+3Ch
		call	X_Set_Ct_Clear		;R31A disable USB IO
;R31A		call	_Set_Ct_Clear		;disable USB IRQ
		mov	cx, VT586_USB+04h
		call	X_Set_Ct_Clear		;R31A disable USB IO
;R31A		call	_Set_Ct_Clear		;disable USB IO
	@@:						
		mov	cx, VT586 + 48h		; Set Onchip USB En/Disable
		call	X_Get_Set_Ct		;R31A
;R31A		call	_Get_Set_Ct		

		;-----------------------;
		;   En/Disable USB 2	;
		;-----------------------;
		mov	bx, 00EFh		; Set Enable USB 2
		mov	si,offset ONBD_USB_2_Item	
		call	X_Getitem_Value		;R31A
;R31A		call	F000_Getitem_Value	
		or	al,al
		jz	short @f		; if Enable, jmp!
		mov	bx, 10FFh		; Set Disable USB 2

		mov	cx, VT586_USB_2+3Ch
		call	X_Set_Ct_Clear		;R31A
;R31A		call	_Set_Ct_Clear		;disable USB 2 IRQ
		mov	cx, VT586_USB_2+04h
		call	X_Set_Ct_Clear		;R31A
;R31A		call	_Set_Ct_Clear		;disable USB 2 IO
	@@:						
		mov	cx, VT586 + 85h		; Set Onchip USB 2 En/Disable
		call	X_Get_Set_Ct		;R31A
;R31A		call	_Get_Set_Ct		;
    else;	USB2_Separate_Control	;R31 - ends
		;-------------------------------;
		; Disable USB IO if USB Disable ;
		;-------------------------------;
		mov	bx, 00FBh		; Set Enable USB
	ifdef	VT586_USB_2			;R28
		mov	di, 00EFh		;R28 Set Enable USB 2
	endif;	VT586_USB_2			;R28
		mov	si,offset ONBD_USB_Item	
		call	X_Getitem_Value	
		or	al,al
		jz	short @f		; if Enable, jmp!
		mov	bx, 04FFh		; Set Disable USB
	ifdef	VT586_USB_2			;R28
		mov	di, 10FFh		;R28 Set Disable USB 2
	endif;	VT586_USB_2			;R28

		mov	cx, VT586_USB+3Ch
		call	X_Set_Ct_Clear		;disable USB IRQ
		mov	cx, VT586_USB+04h
		call	X_Set_Ct_Clear		;disable USB IO
	ifdef	VT586_USB_2			;R28
		mov	cx, VT586_USB_2+3Ch	;R28
		call	X_Set_Ct_Clear		;R28 disable USB 2 IRQ
		mov	cx, VT586_USB_2+04h	;R28
		call	X_Set_Ct_Clear		;R28 disable USB 2 IO
	endif;	VT586_USB_2			;R28
@

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -