acpi传参的文件名为/home/loongson/zmd/pmon-loongarch-new/Targets/ls3a5000_7a/acpi/acpi_tables/dsdt/platform.asl
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,
}
})
Device (PCA0)
{
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",
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",
"nst175"
}
}
})
代码中示例为在i2c1总线上添加一个i2c设备,i2c的设备名为 nst175.