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

📄 oemdsdt.as_

📁 <BIOS研发技术剖析>书的源代码,包括完整的BIOS汇编语言源程序.
💻 AS_
📖 第 1 页 / 共 2 页
字号:
//-----------------------------------------------------------------------
//                      Miscellaneous I/O Ports
//-----------------------------------------------------------------------
// This table should contain any I/O port that is not used by a specific
// device but does not return FFh when read.  Some examples of I/O ports
// that should be reserved here are:
//   The I/O peripheral chip's index/data ports
//   Any I/O port in the range 00 - FF that is not used by any other dev node
//   The IRQ edge/level control ports (4D0/4D1)
//-----------------------------------------------------------------------
// For example:
//      ASL macro "FixedIO"
//      FixedIO( WordConst, // _BAS, Address base
//               ByteConst  // _LEN, Range length
//              )
//      if SuperIO module Index/Data port address allocated in
//      0x3f0 / 0x3f1 we need to update "FixedIO" macro with
//      "Address base" = 0x3f0 and "Range length" = 0x02
//      FixedIO( 0x3f0, 0x02)
//                 ^^^    ^^ fields only to edit
//-----------------------------------------------------------------------
        Device(SYSR) {

                Name(_HID, EISAID("PNP0C02"))

                Method(_STA, 0)
                {
                        If(OSFL)                // If running under Win98?
                        {
                                Return(0x0f)    // Device present
                        }
                        Return(0x0)             // Not present if NT 5.0
                }

                Name(IORG,
                        ResourceTemplate()
                {
                FixedIO(0x10, 0x10)
                FixedIO(0x22, 0x1e)
                FixedIO(0x44, 0x1c)
                FixedIO(0x62, 0x02)
                FixedIO(0x65, 0x0b)
                FixedIO(0x72, 0x0E)
                FixedIO(0x80, 0x01)
                FixedIO(0x84, 0x03)
                FixedIO(0x88, 0x01)
                FixedIO(0x8C, 0x03)
                FixedIO(0x90, 0x10)
                FixedIO(0xa2, 0x1e)
                FixedIO(0xe0, 0x10)
// LM78/79 or W8378x Hardware Monitor ICs
                FixedIO(0x290, 0x8)
// Decoded but not used by FDC
//              IO(Decode16, 0x3f3, 0x3f3, 0, 0x1)
// Abel Wu
// Reserve  480 - 48F for Extended DMA ports  
                IO(Decode16, 0x480, 0x480, 0, 0x10)
// Reserve  4D0 and 4D1 for IRQ edge/level control port
                IO(Decode16, 0x4d0, 0x4d0, 0, 0x2)
// PM base address allocation
                IO(Decode16, 0, 0, 0, 0x0, IO1)
// SMBus base address allocation
                IO(Decode16, 0, 0, 0, 0x0, IO2)
// Index\Data for Super I/O
                IO(Decode16, 0x370, 0x370, 0, 0x2)
// Abel Wu
// Reserve Unknow memory FFEF0000-FFEFFFFF
                Memory32(ReadOnly, 0xffef0000, 0xffef0000, 0, 0x10000)
                    }               // End of ResourceTemplate
                    )               // end of IORG

                    Method(_CRS, 0)
                    {
                                CreateWordField(IORG, \_SB.PCI0.SBRG.SYSR.IO1._MIN, PM00) // PM Base
                                CreateWordField(IORG, \_SB.PCI0.SBRG.SYSR.IO1._MAX, PM01)
                                CreateByteField(IORG, \_SB.PCI0.SBRG.SYSR.IO1._LEN, PMLN) // PM Length

                                CreateWordField(IORG, \_SB.PCI0.SBRG.SYSR.IO2._MIN, SM00) // SMB Base
                                CreateWordField(IORG, \_SB.PCI0.SBRG.SYSR.IO2._MAX, SM01)
                                CreateByteField(IORG, \_SB.PCI0.SBRG.SYSR.IO2._LEN, SMLN) // SMB length

                                Store(\_SB.PCI0.PMU.PMBS(), PM00)
                                Store(PM00, PM01)
                    If(PM00)                                    // If Base <> 0 : set length to 40
                                {                               // Otherwise to 0
// Abel Wu
                                Store(0x40, PMLN)
                                }

                                Store(\_SB.PCI0.PMU.SMBS(), SM00)
                                Store(SM00, SM01)
                    If(SM00)                                    // If Base <> 0 : set length to 10
                                {                               // Otherwise to 0
// Abel Wu
                                Store(0x10, SMLN)
                                }
                                Return(IORG)
                    }

        }                       // End System Resources SYSR
/////////////////////////////////////////////////////////////////////////
// System board extension for ACPI BIOS
// Place that device under \_SB scope, As per Msft the MEM
// Resources should not be declared neither in PCI0 nor in PCI-ISA Bus
/////////////////////////////////////////////////////////////////////////
        Device(\_SB.MEM) {                                      // Memory
                Name(_HID, EISAID("PNP0C01"))                   // Hardware Device ID


                Method (_STA, 0)
                {
                        If(\_SB.PCI0.OSFL)                      // If running under Win98?
                        {
                                Return(0x0f)                    // Device present
                        }
                Return(0x0)                                                             // Not present
                }

                Name(MEM1,

                ResourceTemplate()
                {
//      Base Address 0 - 0x9FFFF , 640k DOS memory
                        Memory32Fixed(ReadWrite, 0x0000, 0xA0000 )//Writeable
//      Base Address F000 - 1M , 64k BIOS
                        Memory32Fixed(ReadOnly, 0xF0000, 0x10000 )//Non-writeable

//      Base Address 1M - Top of system present memory
                        Memory32Fixed(ReadWrite, 0x100000, 0x1FF00000, TOPM)//Writeable
                        Memory32Fixed(ReadOnly, 0xFFFF0000, 0x10000)//Non-Writeable, 64K ROM image
                })

                Method (_CRS, 0)
                {
                        // Top of memory
                        // MDET Control Method returns available system memory

                        CreateDwordField(MEM1, \_SB.MEM.TOPM._LEN, TOP1)
                        // MDET defined in \_SB.PCI0 scope
                        Subtract(\_SB.PCI0.MDET(), 0x100000, TOP1)

                Return(MEM1)
                }                                       // end of _CRS

        }                                               // End Memory
//-----------------------------------------------------------------------
//      ONBOARD I/O Standard peripherals
//      DMA, Keyboard, Timer, Speaker, CMOS...
//-----------------------------------------------------------------------
        Include(".\\oemport\\acpi.asl\\sysstand.asl")
// Resume by key pressed
                    Name(PS2K._PRW, Package(){0x07, 0x01})
/* An example of resume code can be used on particular designs if event handler is needed
                    Method(PS2K._PSW, 1)
                    {
                        If(Arg0){ }      // Enable resume by Keyboard
                        Else
                                { }      // Disable resume
                }
Scope(\_GPE)
        {
                Method(_L07)
                {
                //      OEM ASL code
                        Notify(\_SB.PCI0.SBRG.PS2K, 0x2)        // Wake up event
                }
        }
*/
// Resume by key pressed
                Name(PS2M._PRW, Package(){0x07, 0x01})
// Route and Release I/O, DMA resources to EIO Bus
// Dummy methods
        Method(RRIO, 4) { NoOp }
        Method(RGNR, 4) { NoOp }
        Method(rDMA, 3) { NoOp }
        Name(SPIO, 0x370)       // Super I/O Index/Data base address
//-----------------------------------------------------------------------
// Super IO devices (FDC, UART1,2, LPT, ECP, IR)
//-----------------------------------------------------------------------
        Include(".\\oemport\\acpi.asl\\superio.asl")

        Name(UAR1._PR0, Package(){URP1})        // Reference to PowerResources
// Resume by modem Ring
        Name(UAR1._PRW, Package(){0x01, 0x01})
        }                                       // End of SBRG

//-----------------------------------------------------------------------
// PCI Power Management Unit (PMU)
//-----------------------------------------------------------------------
        Device(PMU) {

                Name(_ADR, 0x010001)
// Contains the PMBS & SMBS control methods to return the PM & SMBus I/O base address
        Method(PMBS,0) {        // Return Power Management I/O base address
                        Or(ShiftLeft(0x004,8), 0x000, Local0)
        Return(Local0)
        }
        Method(SMBS,0) {        // Return SMBus I/O base address
                        Or(ShiftLeft(0x004,8), 0x040, Local0)
        Return(Local0)
        }
// PM controller IO space
      OperationRegion(PWRG, SystemIO, PMBS, 0x40)
   }


        Device(USB) {                       // Device USB

                Name(_ADR, 0x010002)

          }                                             // end USB

        }                                       // End of PCI0 Root Bus


}                                               // End of _SB scope
//----------------------------------------------------------------------
// SYSTEM MANAGEMENT DEVICES
//----------------------------------------------------------------------

        OperationRegion(FNOR, SystemIO, 0x434, 0x04)
        OperationRegion(SIOR, SystemIO, 0x370, 0x02)
        Field ( SIOR, ByteAcc, NoLock, Preserve)
                {
                SIND,8,         //field named INDX is 8 bits wide
                SDTA,8          //field DATA is 8 bits wide
                }
//-----------------------------------------------------------------------
// System indication 1
//-----------------------------------------------------------------------
        IndexField(SIND, SDTA,ByteAcc, NoLock, Preserve)
        {
        ,25,
        LEDW,1,                 // LED control bit 1
        }
        Name(LDON, 1)
        Include(".\\oemport\\acpi.asl\\SI.asl")

//-----------------------------------------------------------------------
//      _PTS METHOD CALLED JUST BEFORE OS GO TO SLEEP
//-----------------------------------------------------------------------
        Method(_PTS, 1){
                Store(Arg0, DBG8)
// Added by Abel Wu at 07/24/98 for Clear Wakeup IRQ Status
        if (LEqual(Arg0,1)){
                While(WAKS)
                {
                        Stall(80)
                        Store(1,WAKS)
                }
        }


        }
//-----------------------------------------------------------------------
//      _WAK METHOD CALLED RIGHT AFTER OS WAKES UP FROM SLEEP
//-----------------------------------------------------------------------
        Method(_WAK, 1) {

                ShiftLeft(Arg0, 4, DBG8)


// Added by Abel Wu at 07/24/98 for Generate SCI
        Store(1,BIOS)


        }

//-----------------------------//
//   For debug purpose only    //
//-----------------------------//

        OperationRegion (WAKP, SystemIO, 0x00414, 1)
        Field (WAKP, ByteAcc,NoLock,Preserve)
                { ,7,WAKS,1}
        OperationRegion (GBLE, SystemIO, 0x00413, 1)
        Field (GBLE, ByteAcc,NoLock,Preserve)
                { ,1,BIOS,1,}
        OperationRegion (TEMP, SystemIO, 0x80, 1)
        Field (TEMP, ByteAcc,NoLock,Preserve)
                { DBG8,8,}
        OperationRegion (DEB0, SystemIO, 0x90, 2)
        Field (DEB0, WordAcc,NoLock,Preserve)
                { DBG9,16,}
}                                               // End of ASL File

⌨️ 快捷键说明

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