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

📄 smb_ec.asl

📁 AMI 主板的BIOS源码
💻 ASL
字号:
//**********************************************************************;
//     *****************************************************************;
//     *****************************************************************;
//     **                                                             **;
//     **      (C)Copyright 1985-1996, American Megatrends, Inc.      **;
//     **                                                             **;
//     **                     All Rights Reserved.                    **;
//     **                                                             **;
//     **           6145-F Northbelt Pkwy, Norcross, GA 30071         **;
//     **                                                             **;
//     **                     Phone (770)-246-8600                    **;
//     **                                                             **;
//     *****************************************************************;
//     *****************************************************************;
//**********************************************************************;
//		DON'T CHANGE ANY NAMES UNLESS REQUIRED !!!
//**********************************************************************;
//     ACPI Embedded controller SMBus interface methods
//**********************************************************************;

// SMBR - SMBus read method
//
//	Arg0 - Device address
// 	Arg1 - Command Code
//	Arg2 - Data to write
//	Arg3 - Protocol (basically RDWD, WRWD or RDBL)

        Method(SMBR,4) {
                If (LEqual(Arg3,RDBL)) {Store(0,DATB)}
        	Store(5, Local0)
        	While(Local0) {
        		Store(Arg0, ADDR)	// Set the device address
        		Store(Arg1, SCMD)	// Read Power unit value 0x3 offset
			If (LEqual(Arg3, WRWD))	{Store(Arg2, DAT0)}
        		Store(Arg3, PRTC)       // Set protocol - start SMBus transaction
        		Wait(SMBF, 0xFFF)	// Wait till SMBus transaction completed

        		Reset(SMBF)

// One of known problems - ReadBlock of GLW SmartBattery may return BCNT=3
// and data as FF FF FF with no any SMBus errors. To avoid this:
//        		If(Or(SSTS,And(LEqual(Arg2,RDBL),And(LEqual(BCNT,3),LEqual(DAT0,0xFFFF)))))
			If(SSTS)
				{Decrement(Local0)}  // If any SMBus error

                	Else {
				Return(Ones)	// exit on OK
                        }
        	}
		Return(Zero)			// exit on failure
        }

//**********************************************************************;
//     *****************************************************************;
//     *****************************************************************;
//     **                                                             **;
//     **      (C)Copyright 1985-1996, American Megatrends, Inc.      **;
//     **                                                             **;
//     **                     All Rights Reserved.                    **;
//     **                                                             **;
//     **           6145-F Northbelt Pkwy, Norcross, GA 30071         **;
//     **                                                             **;
//     **                     Phone (770)-246-8600                    **;
//     **                                                             **;
//     *****************************************************************;
//     *****************************************************************;

⌨️ 快捷键说明

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