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

📄 pcipost.asm

📁 AWARD BIOS源代码,支持的CHIPSET请看文件,有同型号的板子烧上去就可以跑
💻 ASM
📖 第 1 页 / 共 5 页
字号:
;			successfully while the PS/2 mouse is not plugging,
;			the card will set to disable automatically while
;			without PS/2 mouse.PS/2 mouse plugging flag isn't
;			config_table+5 ,so change to SYSTEM1_BYTE(bit 2).
;			Config_Table+5 is EBDA flag. See atorgs.asm
;R13A	12/24/97 STV	Release Added LAN card Support by cbrom /lan
;			& Fixed LAN card boot ENABLE/DISABLE
;R18	12/24/97 RCH	Fixed error coding that cause system RAM 40:BA become
;	 	        always 0FFH and system always boot from LAN even LAN
;		        is not first boot priority.
;R17	12/23/97 RAY	Problem:
;
;			  Some onboard VGA will hang up randomly if the
;			  onboard VGA ROM is not plugged and at the same
;			  time the ROM image is added to the BIOS using
;			  CBROM.EXE.
;
;			  This occurs in Quantas's LX M/B with ATI-RAGE
;
;			Solution:
;
;			   We should disable the ROM completely(write 0 to
;			   register location 30h) when we do not find any
;			   valid ROM images both from high address & from
;			   C000:0000h
;
;R16	12/23/97 RAY	Add [BP] for current class code
;R15	12/23/97 RCH	Fixed S3/868 hang up while working on AGP platform
;			with 16Mb Aperture size selected. It is caused by
;			this VGA requesting 32Mb memory space but actually
;			decode 64Mb space.
;R14	12/23/97 RAY	Fix Adaptec's ROM which support all 78x0 devices
;			cannot be invoked by the new CBROM algorithm
;R13	12/18/97 STV	Added LAN card Support by cbrom /lan
;R12	12/16/97 RAY	To record the assigned PCI IRQs in F000 shadow RAM
;			for the IRQ routing table(both INT 1Ah & MS IRQ
;			Routing table) to reference.
;			This is to to fix the ICU hang up problem
;R11	12/16/97 RAY	Some PCI device report a value of FFFFFFFFh at 30h
;			This version of BIOS will treat it as "ROM required"
;R10	12/16/97 RCH	Fixed system hang up while initial PCI/VGA ROM if
;			Rendition Verite V2200 is installed and Cyrix M1 or
;			M2 is used with VIA/VPX chipset.
;R09	12/05/97 PAL	Added Trend_AntiVirus Support by cbrom /vrs
;R08	12/05/97 TNY	Set IRQ9 to be the last of IRQ_Order table.
;			To fix some PCI card behaving abnormally in Win95 if
;			IRQ9 assigned.
;R07	12/01/97 RAY	Some VGA ROM images don't includes the PCI Vendor ID
;			& Device ID. Thus when we seek for VGA image, we have
;			a default image that points to the first image that
;			added with "CBROM /VGA"
;
;R02B	11/17/97 RAY	Fix "CBROM /PCI" does not work with 1M BIOS
;R06	11/15/97 RAY	Symtom:
;
;			  Some PCI devices do not decode address A8. When we
;			  assign I/O space to these kind of devices at address
;			  using A8, they will fail to decode the correct
;			  address.
;
;			Solution:
;
;			  No matter it is in bus 0 or not, we assign I/O
;			  space with 1K alignment.
;
;R05	11/14/97 RAY	Add Open_IDE_2nd_Channel
;
;R04	11/14/97 RAY	Move Routine: Reserve_Irq_For_PciBootDev to XGROUP
;
;R03	11/14/97 RAY	Modify the algorithm for searching combined NCR SCSI
;			ROM
;
;R02A	11/14/97 RAY	Problem fixed:
;			When apply both /NCR & /AHA to old CBROM.EXE, NCR SCSI
;			ROM is not loaded
;
;R02	11/13/97 RAY	Add new CBROM.EXE support
;		 STEVEN	Since this function is very code is complicated,
;			I clear all the Rxx for easy debugging. From now on,
;			any changes to this file should add Rxx.

ifdef	MASM611
.MODEL  SMALL, BASIC
OPTION	PROC: PRIVATE
endif	;MASM611

.386P

		PAGE	56, 132
;.XLIST
		INCLUDE BIOS.CFG
		include	COMMON.EQU
		INCLUDE COMMON.MAC
		include	bsetup.inc
		include	fshadow.equ

ifndef	NO_PNP_PCI_AUTO
ifdef	PNP_BIOS
		PNP_PCI_AUTO	EQU	1
endif	;PNP_BIOS
endif;	NO_PNP_PCI_AUTO

ifdef	PCI_BUS

;R59 - start
  PATCH_ONBOARD_CT_6XXXX_VGA	=	0
 ifdef	NO_SCAN_ONBOARD_VGA_ROM
  PATCH_ONBOARD_CT_6XXXX_VGA	=	1
 endif;	NO_SCAN_ONBOARD_VGA_ROM
;R59 - end

IRQ12_LAST_FOR_PCI	EQU	1
SET_MPIRQ_TBL	=	0

ifdef	MP_SUPPORT
ifdef	NEW_INTEL_IOAPIC
SET_MPIRQ_TBL	=	1
endif;	NEW_INTEL_IOAPIC
endif;	MP_SUPPORT

endif;	PCI_BUS
;R13A start
ifdef	LAN_BOOT_SUPPORT
		extrn	LanBoot_Item:near
endif	;LAN_BOOT_SUPPORT
;R13A end


ifdef	PNP_BIOS
		include	PNP.EQU
endif	;PNP_BIOS

		Public	NCR_810_FOUND

PUSH_ALL	MACRO
		push	ds
		push	es
		pushad
		ENDM

POP_ALL		MACRO
		popad
		pop	es
		pop	ds
		ENDM

;[]================================================================[]
;			EQUATES
;[]================================================================[]

TEMP_AREA		EQU	3000H

CLASS_VGA		EQU	03h
ALT_CLASS_VGA		EQU	0001h
CLASS_IDE		EQU	0101h
CLASS_SCSI		EQU	0100h
CLASS_PP_BRIDGE		EQU	0604H

CLASS_USB		EQU	0C03h

PCI_VGA_CLASS		EQU	03H
NORMAL_VGA_CLASS	EQU	0001H

CIRRUS_VENDOR_ID	EQU	1013H
NCR_VENDOR_ID		EQU	1000h
DEVICE_NCR810		EQU	0001h
DEVICE_NCR860		EQU	0006h
ADAPTEC_VENDOR_ID	EQU	9004h

DEVICE_AHA7850		EQU	5078h
DEVICE_AHA7860		EQU	6078h
DEVICE_AHA7870		EQU	7078h
DEVICE_AHA7880		EQU	8078h
DEVICE_AHA7895		EQU	7895H

BusLogic_VENDOR_ID	EQU	104bh
DEVICE_BA81C15		EQU	8130h

ACARD_VENDOR_ID		EQU	1191h
DEVICE_ACARD6710	EQU	8002h

AMD_VENDOR_ID		EQU	1022h
DEVICE_AMD974_SCSI	EQU	2020h

;[]================================================================[]
;		BP definitions
;[]================================================================[]

STACK_LOC	=	ITEMSTAT_BUF
DEFINE_STACK	MACRO	VAR_NAME, VAR_LEN
		Public	VAR_NAME
	VAR_NAME  = STACK_LOC
	STACK_LOC = STACK_LOC + VAR_LEN
		ENDM

DEFINE_STACK	START_PCI_DEV		, 1
DEFINE_STACK	END_PCI_DEV		, 1

DEFINE_STACK	AVAILABLE_PREFET_START	, 4
DEFINE_STACK	AVAILABLE_MEM_START	, 4
DEFINE_STACK	AVAILABLE_IO_START	, 4

DEFINE_STACK	PREFET_MEM_BUF_PTR	, 2
DEFINE_STACK	HMEM_BUF_PTR		, 2
DEFINE_STACK	IO_BUF_PTR		, 2
DEFINE_STACK	LMEM_BUF_PTR		, 2
DEFINE_STACK	BASE_REQ_BUF_PTR	, 2
DEFINE_STACK	PCI_VGA_DEVICE_BUF_PTR	, 2

DEFINE_STACK	CURRENT_DEVICE_ID	, 2
DEFINE_STACK	CURRENT_VENDOR_ID	, 2
DEFINE_STACK	CURRENT_CLASS_CODE	, 2
DEFINE_STACK	CURRENT_SLOT		, 1
DEFINE_STACK	CURRENT_BUS_NO		, 1
DEFINE_STACK	TOTAL_BUS_NO		, 1
DEFINE_STACK	DEVICE_CLASS_FLAG 	, 1	;R35
LAN_NOW		EQU	080H		      	;R35
LAN_FOUND	EQU	040H		       	;R35
RAID_FIRST	EQU	020H			;R36

;------------------------------------------------------------
;
;	LMEM_RESOURCE[bp]
;
;each bit describes 4K ROM(Shadow RAM) area
;  starting from C8000h - DF000h
;  i.e. bit 0 = 1 means C8000h-C8FFFh is occupied
;	    1 = 1	C9000h-C9FFFh is occupied
;	.
;	.
;	.
;
;------------------------------------------------------------

DEFINE_STACK	LMEM_RESOURCE		, 4
DEFINE_STACK	AVAIL_LMEM_ADDR		, 4
DEFINE_STACK	TARGET_AVAIL_LMEM	, 4
DEFINE_STACK	LMEM_FOR_ROM_FLG	, 1
DEFINE_STACK	NEED_ASSIGN_LMEM_FLAG	, 1
DEFINE_STACK	LMEM_BEFORE_ROM		, 4
DEFINE_STACK	LMEM_RESERVED		, 4

DEFINE_STACK	PCI_VGA_INFO		, 2		;bus/dev+Fun No.
DEFINE_STACK	PCI_VGA_FOUND		, 1
		VGA_DEVICE_EXIST	EQU	0AAh
DEFINE_STACK	VGA_BIOS_LENGTH		, 1
;R38 - starts
;-------------------------------------------------------------
;for Ct_PCI_VGA_IDSEL to report a onboard VGA P2P device no.
;Just fill ONBOARD_VGA_P2P[BP] with the P2P bridge's device(func)
;number to inform the PCI kernel.
;-------------------------------------------------------------
DEFINE_STACK	ONBOARD_VGA_P2P		, 1
;R38 - ends

DEFINE_STACK	NCR_810_FOUND		, 1
		NCR_SCSI_FOUND		EQU	0BBh
		INVOKE_NCR_CBROM	EQU	0AAh
DEFINE_STACK	COMBINED_PCI_ROM_NEED	, 1
DEFINE_STACK	CBROM_BP_START		, 2
DEFINE_STACK	CBROM_BP_END		, 2
DEFINE_STACK	CBROM_BUF_START		, 4
DEFINE_STACK	CBROM_BUF_END		, 4
DEFINE_STACK	PCI_CBROM_TEMP		, 1
DEFINE_STACK	PCI_CBROM_ADDR		, 4

DEFINE_STACK	RESERVE_PCIIRQ		, 1
DEFINE_STACK	PCI_IRQ_ASSIGNED	, 2
DEFINE_STACK	PCI_IRQ_MAP		, 2
DEFINE_STACK	PCIIRQ  		, 32		;need 16*2 bytes
							;PCI available IRQ no. 1,2,4,4
							;low byte = IRQ No. 0-15
							;high byte = INT No. 1-16
DEFINE_STACK	PCI_IDE_EXIST		, 1
DEFINE_STACK	PCI_IDE_FOUND		, 1
		IDE_EXIST		EQU	0AAH	;flag for PCI/IDE found

DEFINE_STACK	ESCD_IRQ		, 2
DEFINE_STACK	ESCD_DMA		, 1

;R13 start
;R13A	ifdef	LAN_BOOT_SUPPORT
;R13A	DEFINE_STACK	LAN_ROM_NEED		, 1
;R13A	DEFINE_STACK	LAN_CARD_ID		, 4
;R13A	endif	;LAN_BOOT_SUPPORT
;R13 end
;[]================================================================[]
;[]================================================================[]

MAX_SUB_BUS		EQU	16
BUS_TREE_STRUC		STRUC
  Host_Slot		db	?
  P2PB_BusNo		db	?
  P2PB_DevFucNo		db	?
  Sub_Buses		db	MAX_SUB_BUS dup (?)
  TotalMemReq		dd	?
  TotalPfMemReq		dd	?
  TotalIOReq		dd	?
  TotalLMemReq		dd	?
  Bus_IO_Start		dd	?
  Bus_Mem_Start		dd	?
  Bus_PfMem_Start	dd	?
BUS_TREE_STRUC		ENDS
SIZE_BUS_TREE_STRUC	EQU	(SIZE BUS_TREE_STRUC)

VGA_INFO_STRUC		STRUC
	VGA_DevNum	db	?
	VGA_BusNum	db	?
	OnboardVGA	db	?
			db	?	;dummy byte
	VGA_ID		dd	?
VGA_INFO_STRUC		ENDS
SIZE_VGA_INFO_STRUC	EQU	(SIZE VGA_INFO_STRUC)

IRQ_REQ_STRUC		STRUC
	IntPin		db	?
	IrqReqDevNum	db	?
	IrqReqBusNum	db	?
	HostSlot	db	?
			dd	?	;dummy dword
IRQ_REQ_STRUC		ENDS
SIZE_IRQ_REQ_STRUC	EQU	(SIZE IRQ_REQ_STRUC)

TEMP_PCI_REQ_BUF	SEGMENT USE16 AT 5000h
P2P_TREE_INFO		Label	Byte
			db	(MAX_SUB_BUS * SIZE_BUS_TREE_STRUC) dup (?)
PCI_VGA_DEVICE_BUF	Label	Byte
			db	16*SIZE_VGA_INFO_STRUC dup (?)
TEMP_BASE_REQ_BUF	Label	Byte
TEMP_PCI_REQ_BUF	ENDS

MEMIO_BUF		STRUC
	MemIO_Req	dd	0
	Cfg_Loc		dw	0
	MemIo_Info	db	0
	Bus_Num		db	0
MEMIO_BUF		ENDS
SIZE_MEMIO_BUF		EQU	SIZE MEMIO_BUF

PCI_REQ_BUF	SEGMENT USE16 AT 4000h
BUF_SIZE	EQU	6*8*32		;max 32 devices
					;each device has max 8 functions
					;each function request max 6 Mem base
IO_BUF		db	(BUF_SIZE * SIZE_MEMIO_BUF) dup (?)
HMEM_BUF	db	(BUF_SIZE * SIZE_MEMIO_BUF) dup (?)
LMEM_BUF	db	(BUF_SIZE * SIZE_MEMIO_BUF) dup (?)
PREFET_MEM_BUF	db	(BUF_SIZE * SIZE_MEMIO_BUF) dup (?)

PCI_REQ_BUF	ENDS

VIRTUAL_HMEM_BASE	EQU	0A0h
VIRTUAL_PFMEM_BASE	EQU	0A8h
VIRTUAL_BUS0_PFMEM_BASE	EQU	0B0h
VIRTUAL_IO_BASE		EQU	0A1h

G_RAM		SEGMENT USE16 AT 0

		ORG	04H*4
		INCLUDE SEG_0.INC

		ORG	400H
		INCLUDE G_RAM.INC
ifdef	PNP_BIOS
		ORG	2000h
		INCLUDE PNPDATA.INC
endif	;PNP_BIOS

G_RAM		ENDS

		extrn	xcall_proc:near
		extrn	X_GetItem_Value:Near

.LIST

IFE	COMPILE_FOR_E0 EQ 1

;R33ifdef	Trend_AntiVirus				;R09
;R33		extrn	F000_Shadow_R:near	;R09
;R33		extrn	F000_Shadow_W:near	;R09
;R33		extrn	Virus_Used_Shadow:near	;R09
;R33		extrn	Virus_Item:near		;R09A
;R33endif;	Trend_AntiVirus				;R09

ifdef	PCI_BUS

	ifdef	PNP_BIOS
		extrn	Build_OnboardRomNode:near
	 ifdef	COMBINE_ISA_ROM
		extrn	Build_OtherRomNode:near
	 endif;	COMBINE_ISA_ROM
	 ifndef	NEW_PNP_SETUP
	 ifdef	PNP_PCI_AUTO
		extrn	PnP_Auto_Item:near
	 endif	;PNP_PCI_AUTO
	 endif	;NEW_PNP_SETUP
	endif;	PNP_BIOS

	ifdef	Cardbus_support
		extrn	Cardbus_Init:near
	endif	;Cardbus_support

	IF	SET_MPIRQ_TBL
		extrn	IO_Int_Entry16:near
	ENDIF	;SET_MPIRQ_TBL

		extrn	Pci_Class_Code:near
IF	BIOS_SUPPORT_586				;R99
		extrn	Check_M1_Cpu:near
ENDIF	;BIOS_SUPPORT_586				;R99
		extrn	Unlock_Cyrix:near
		extrn	lock_Cyrix:near
		extrn	F000_Set_Cyrix:near

		extrn	F000_call_proc:near
		extrn	Post_call_proc:near
		extrn	POST_func_end:Near
		extrn	POST_VECT:Near

		extrn	Vga_Snoop_Item:near

		extrn	Ct_OnChip_IDE_Chk:near
	ifdef	ONBOARD_NCR_SETUPABLE
		extrn	Scsi_Item:near
	endif	;ONBOARD_NCR_SETUPABLE

		extrn	AGet_CfgSpace_Byte:near
		extrn	AGet_CfgSpace_Word:near
		extrn	AGet_CfgSpace_Dword:near
		extrn	ASet_CfgSpace_Byte:near
		extrn	ASet_CfgSpace_Word:near
		extrn	ASet_CfgSpace_Dword:near
		extrn	Move_Codes:Near
		extrn	GetItem_Value:Near
		extrn	F000_GetItem_Value:near

		extrn	F000_Shadow_W:near
		extrn	F000_Shadow_R:near
		extrn	E000_64k_Shadow_RW:Near

⌨️ 快捷键说明

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