【龙芯固件】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,
      }
    })
  }

二、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"
                }
            }
        })
    }

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"
              }
          }
      })
  }
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大、猫

感谢支持!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值