• 【龙芯固件】ACPI表中I2C资源


    一、I2C控制器

      Device (I2C0)
      {
        Name (_HID, "LOON0004" /* AT Real-Time Clock */)  // _HID: Hardware ID
        Name (_UID, 0x0)  // _UID: Unique ID
        Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
        {
          QWordMemory (ResourceConsumer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
            0x0000000000000000, // Granularity
            0x0000000010090000, // Range Minimum
            0x0000000010090007, // Range Maximum
            0x0000000000000000, // Translation Offset
            0x0000000000000008, // Length
            ,, , AddressRangeMemory, TypeStatic)
          Interrupt (ResourceConsumer, Level, ActiveHigh, Shared, ,, )
          {
            73,
          }
        })
      }
      Device (I2C1)
      {
        Name (_HID, "LOON0004" /* AT Real-Time Clock */)  // _HID: Hardware ID
        Name (_UID, 0x1)  // _UID: Unique ID
        Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
        {
          QWordMemory (ResourceConsumer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
            0x0000000000000000, // Granularity
            0x0000000010090100, // Range Minimum
            0x0000000010090107, // Range Maximum
            0x0000000000000000, // Translation Offset
            0x0000000000000008, // Length
            ,, , AddressRangeMemory, TypeStatic)
          Interrupt (ResourceConsumer, Level, ActiveHigh, Shared, ,, )
          {
            73,
          }
        })
      }
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39

    二、I2C下设备

    2.1 RTC设备

    在I2C0 设备下挂载一个ds1229 rtc设备,设备地址是0x68

        Device (RTC0)
        {   
            Name (_HID, "PRP0001")  // _HID: Hardware ID
            Name (_UID, Zero)  // _UID: Unique ID
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                I2cSerialBusV2 (0x0068, ControllerInitiated, 0x00061A80,
                    AddressingMode7Bit, "\\_SB.I2C0",			//重点:I2C0
                    0x00, ResourceConsumer, , Exclusive,
                    )
            })
            Name (_DSD, Package (0x02)  // _DSD: Device-Specific Data
            {
                ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301") /* Device Properties for _DSD */, 
                Package (0x01)
                {
                    Package (0x02)
                    {
                        "compatible", 
                        "dallas,ds1339"
                    }
                }
            })
        }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24

    2.2 温度采集设备

    在I2C1 设备下挂载一个LM75 温度采集设备,设备地址是0x48

      Device (LM75)
      {
          Name (_HID, "PRP0001")  // _HID: Hardware ID
          Name (_UID, Zero)  // _UID: Unique ID
          Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
          {
              I2cSerialBusV2 (0x0048, ControllerInitiated, 0x00061A80,
                  AddressingMode7Bit, "\\_SB.I2C1",				//重点:I2C1
                  0x00, ResourceConsumer, , Exclusive,
                  )
          })
          Name (_DSD, Package (0x02)  // _DSD: Device-Specific Data
          {
              ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301") /* Device Properties for _DSD */,
              Package (0x01)
              {
                  Package (0x02)
                  {
                      "compatible",
                      "national,lm75"
                  }
              }
          })
      }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
  • 相关阅读:
    OpenCloudOS开源的操作系统
    C++ Qt开发:DateTime日期时间组件
    【C++】单例模式【两种实现方式】
    戏说数据仓库,商业智能BI中数据仓库的本质是什么?
    Netty学习(一)——BIO/伪异步IO/NIO/AIO四种IO模型的演变
    ChatGPT无法登录,提示我们检测到可疑的登录行为,将阻止进一步的尝试。请与管理员联系
    (154)Verilog HDL:设计一个选择器之mux2to1
    IDEA 官宣全新默认 UI,真香
    2022年全球市场先进封装检测系统总体规模、主要生产商、主要地区、产品和应用细分研究报告
    ORB-SLAM3算法学习—Frame构造
  • 原文地址:https://blog.csdn.net/tongxin1101124/article/details/134246375