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

📄 w977lpt.asl

📁 AWARD BIOS源代码,支持的CHIPSET请看文件,有同型号的板子烧上去就可以跑
💻 ASL
字号:



Device(LPT) 	{
        Name (_HID, EISAID("PNP0400")) 	// PnP ID for W839x7AF LPT Port
        Method (_STA, 0){		// LPT Device Status
                ENFG() 			// Config Mode
                Store (0x01, LDN_) 	// Select PRN Device (LDN_ = 01)
                And(OPT1,0x2,Local0) 	//R01 Extract mode bits
                If (LNotEqual(Local0, 0x2)) {
                        If (ACTR) {	
                                EXFG()
                                Return(0x0F)
                                }	// Device present and active
                        Else	{
                                If (LOr(IOAH,IOAL)) {
                                        EXFG()

                                        Return(0x0D)
                                        }
                                Else {
                                        EXFG()

                                        Return(0x00)  // code = Device not even Present
                                        }
                                }
                        }
                Else	{
                        EXFG()
                        Return(0x00) 	//Not present
                        }
                } 			// end of _STA method

        Method (_DIS,0)	{ 		// LPT Device Disable
                ENFG()
                Store (0x01, LDN_) 	// Select PRN Device (LDN_ = 01)
                Store (Zero, ACTR) 	// Set Activate Reg = 0
                EXFG()
                } 			// 	End of _DIS Method

        Method (_CRS,0) 	{ 		// LPT Current Resources
                Name(BUF5, Buffer ()
                        { 		//13*8 Length of Buffer
                        0x47, 		// IO port descriptor
                        0x01, 		// 16 bit decode
                        0x00, 		// LPT1 @ 0x278h
                        0x00,
                        0x00,
                        0x00,
                        0x00, 		//R01 alignment
                        0x00, 		//number of ports

                        0x22, 		// IRQ Descriptor
                        0x00, 		// IRQ7 (Bit15=IRQ15....Bit0=IRQ0)
                        0x00,
                        0x79, 		//end tag
                        0x00,
                        } 		// end of Buffer
                ) 			// end _CRS method

                CreateByteField (BUF5, 0x02, IOLO)
                CreateByteField (BUF5, 0x03, IOHI)
                CreateByteField (BUF5, 0x04, IORL) 	// IO Port Low
                CreateByteField (BUF5, 0x05, IORH) 	// IO Port HI
                CreateByteField (BUF5, 0x07, IOLE)
                CreateByteField (BUF5, 0x09, IRQL)

                ENFG()
                Store (0x01, LDN_) 	//Select Logical Device 1 (LPT)


                Store (IOAL, IOLO)		//R01
                Store (IOLO, IORL)
                Store (IOAH, IOHI)		//R01
                Store (IOHI, IORH)

                If (Lequal(IOLO,0xBC)) {
                        Store (0x04,IOLE)
                        }
                Else	{
                        Store (0x08,IOLE)
                        }

                Store(One,Local0)
                Store(INTR,Local5)

                ShiftLeft(Local0,Local5,IRQL) 	// (src, shiftcount, result)
                Store (One,ACTR)
                EXFG()

                Return(BUF5) 		// return BUF5 filled with Current Resources
        } 			// end _CRS method

        Name(_PRS, Buffer()
                { 			//13*8
                0x30, 			// Start Dependent Function

                0x47, 			// IO port descriptor
                0x01, 			// 16 bit decode
                0x78, 			// LPT1 @ 0x278h
                0x03,
                0x78,
                0x03,
                0x00, 			//R01 alignment
                0x08, 			// number of ports

                0x22, 			// IRQ Descriptor
                0xB8, 			//R01 IRQ5, IRQ7(Bit15=IRQ15....Bit0=IRQ0)
                0x00,
                0x30, 			// Start Dependent Function

                0x47, 			// IO port descriptor
                0x01, 			// 16 bit decode
                0x78, 			// LPT1 @ 0x278h
                0x02,
                0x78,
                0x02,
                0x00, 			//R01 alignment
                0x08, 			// number of ports

                0x22, 			// IRQ Descriptor
                0xB8, 			//R01 IRQ5, IRQ7(Bit15=IRQ15....Bit0=IRQ0)
                0x00,
                0x30, 			// Start Dependent Function

                0x47, 			// IO port descriptor
                0x01, 			// 16 bit decode
                0xBC, 			// LPT1 @ 0x278h
                0x03,
                0xBC,
                0x03,
                0x00, 			//R01 alignment
                0x04, 			// number of ports

                0x22, 			// IRQ Descriptor
                0xB8, 			//R01 IRQ5, IRQ7(Bit15=IRQ15....Bit0=IRQ0)
                0x00,

                0x38,			// DMA
                0x79, 			//end tag
                0x00,
                } 			// end of Buffer
        ) 				// end _PRS method

        Method (_SRS,1 )	{ 	// LPT Set Resources & Enables the Device

                CreateByteField (Arg0, 0x02, IOLO) 	// IO Port Low
                CreateByteField (Arg0, 0x03, IOHI) 	// IO Port HI
                CreateByteField (Arg0, 0x04, IORL) 	// IO Port Low
                CreateByteField (Arg0, 0x05, IORH) 	// IO Port HI
                CreateByteField (Arg0, 0x09, IRQL) 	// IRQ MASK
                ENFG()

                Store(0x01, LDN_)
                Store(One, ACTR) 	//R01 Active (ie Enable) the Device

                Store(IOLO, IOAL) 	// Write IO Port LOW to dev cfg reg
                Store(IOHI, IOAH)


                FindSetLeftBit(IRQL, Local0)
                Subtract(Local0, 0x01, Local0)
                Store (Local0, INTR)
                EXFG()
                } 			// end of _SRS Method
        } 				// end LPT device


Device(ECP) {
        Name (_HID, EISAID("PNP0401")) 	// PnP ID for W839x7 ECP Port
        Method (_STA, 0){ 		// ECP Device Status
                ENFG()
                Store(0x01, LDN_) 	// Select LDN_ #1 (ECP)
                And(OPT1, 0x2, Local0)

                If (LEqual(Local0, 0x2)) {
                        If (ACTR) {	
                                EXFG()
                                Return(0x0F)
                                }	// Device present and active
                        Else	{
                                If (LOr(IOAH,IOAL)) {
                                        EXFG()

                                        Return(0x0D)
                                        }
                                Else {
                                        EXFG()

                                        Return(0x00)  // code = Device not even Present
                                        }
                                }
                        }
                Else	{
                        EXFG()
                        Return(0x00) 	//Not present
                        }
                } 			// end of _STA method

        Method (_DIS,0) { 		// ECP Device Disable
                ENFG()
                Store (0x01,LDN_) 	// Select PRN Device (LDN_ = 01)
                Store (Zero, ACTR) 	// Set Activate Reg = 0
                EXFG()
                } 			// end of _DIS method

        Method (_CRS,0) 	{ 		// EPP Current Resources
                Name(BUF6, Buffer()
                        { 		// 16*8
                        0x47, 		// IO port descriptor
                        0x01, 		// 16 bit decode
                        0x00, 		// LPT1 @ 0x278h
                        0x00,
                        0x00,
                        0x00,
                        0x00, 		// alignment
                        0x04, 		// number of ports

                        0x47, 		// IO port descriptor
                        0x01, 		// 16 bit decode
                        0x00,
                        0x00,
                        0x00,
                        0x00,
                        0x00, 		// alignment
                        0x04, 		// number of ports

                        0x22, 		// IRQ Descriptor
                        0x00, 		// IRQ7 (Bit15=IRQ15....Bit0=IRQ0)
                        0x00,

                        0x2A, 		// DMA Descriptor
                        0x00, 		// DMA3 (Bit7=DMA7....Bit0=DMA0)
                        0x00, 		// 8-bit, not a Bus Master, compatibility mode chn speed

                        0x79, 		// end tag
                        0x00,
                        }
                )

                CreateByteField (BUF6, 0x02, IOLO)
                CreateByteField (BUF6, 0x03, IOHI)
                CreateByteField (BUF6, 0x04, IORL) 	// IO Port Low
                CreateByteField (BUF6, 0x05, IORH) 	// IO Port HI
                CreateByteField (BUF6, 0x0A, IOEL)
                CreateByteField (BUF6, 0x0B, IOEH)
                CreateByteField (BUF6, 0x0C, IOML) 	// IO Port Low
                CreateByteField (BUF6, 0x0D, IOMH) 	// IO Port HI
                CreateByteField (BUF6, 0x11, IRQL)
                CreateByteField (BUF6, 0x14, DMAC)

                ENFG()
                Store (0x01, LDN_) 	// Select Logical Device 1 (LPT)
                Store (One, ACTR)	//R01

                Store (IOAL, Local2)
                Store (Local2, IOLO)
                Store (IOAH, Local3)
                Store (Local3, IOHI) 	// Write IO Port High to dev cfg buffer
                Or (Local3,0x04, Local3)
                Store (Local3, IOEH)
                Store (Local3, IOMH)
                Store (IOLO, IORL)
                Store (IOLO, IOEL)
                Store (IOLO, IOML)
                Store (IOHI, IORH)

                Store(One,Local0)
                Store(INTR,Local5)
                ShiftLeft(Local0,Local5,IRQL) 	// (src, shiftcount, result)

                Store(One,Local0)
                Store(DMCH,Local5)
                ShiftLeft(Local0,Local5,DMAC)
                EXFG()
                Return(BUF6) 		// return BUF6 filled with Current Resources
        } 				// end _CRS method
        

        Name(_PRS, Buffer()
                {			// 16*8
                0x30,

                0x47,
                0x01,
                0x78,
                0x03,
                0x78,
                0x03,
                0x00,
                0x08,

                0x47,
                0x01,
                0x78,
                0x07,
                0x78,
                0x07,
                0x00,
                0x04,

                0x22,
                0xB0,
                0x00,
                
                0x2A,
                0x0B,
                0x00,
                
                0x30,

                0x47,
                0x01,
                0x78,
                0x02,
                0x78,
                0x02,
                0x00,
                0x08,

                0x47,
                0x01,
                0x78,
                0x06,
                0x78,
                0x06,
                0x00,
                0x04,

                0x22,
                0xB8,
                0x00,

                0x2A,
                0x0B,
                0x00,
                
                0x30,

                0x47,
                0x01,
                0xBC,
                0x03,
                0xBC,
                0x03,
                0x00,
                0x04,

                0x47,
                0x01,
                0xBC,
                0x07,
                0xBC,
                0x07,
                0x00,
                0x04,

                0x22,
                0xB0,
                0x00,

                0x2A,
                0x0B,
                0x00,
                
                0x38,

                0x79,
                0x00,
                } 			// end Buffer
        ) 				// end _PRS method		

        Method (_SRS,1 ) { 	// ECP Set Resources & ENABLES the Device
                CreateByteField (ARG0, 0x02, IOLO) 	// IO Port Low
                CreateByteField (ARG0, 0x03, IOHI) 	// IO Port HI
                CreateByteField (ARG0, 0x11, IRQL)
                CreateByteField (ARG0, 0x14, DMAC) 	// DMA Channel to assign
                ENFG()

                Store(0x01, LDN_) 	// Select LDN_ #3 (LPT)
                Store(One, ACTR) 	//R01 Active (ie Enable) the Device
                Store(IOLO, IOAL) 	// Write IO Port LOW to dev cfg reg
                Store(IOHI, IOAH)

                FindSetLeftBit(IRQL, Local0)
                Subtract(Local0, 0x01, Local0)
                Store (Local0, INTR)

                FindSetLeftBit(DMAC, Local1)	
                Subtract(Local1, 0x01, DMCH)	
                EXFG()
                } 			// end of _SRS method
        } 				// end ECP device

⌨️ 快捷键说明

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