From: Naresh Bhat naresh.bhat@linaro.org
The ASL code for SMB, FPGA, AMBA bus and the devices on the bus. The SMB and FPGA are represented as Module device. The container object that acts as a bus node in a namespace. It may contain child objects that are devices or buses. The module device is declared using the ACPI0004 hardware identifier (HID). The AMBA is represented as a separate device along with UART.
This patch is applied and tested on v8 model along with "Hanjun Guo" - Convert the fixed clock to ACPI and "Brandon Anderson" - ARM AMBA bus connector resource changes. The sample output logs on v8 model as below
root@genericarmv8:/sys# find . -name LINA* ./bus/acpi/devices/LINA0003:00 ./bus/acpi/devices/LINA0005:00 ./bus/acpi/devices/LINA0007:00 ./bus/acpi/devices/LINA0008:00 ./bus/acpi/devices/LINA0008:01 ./bus/acpi/devices/LINA0008:02 ./bus/acpi/devices/LINA0009:00 ./bus/platform/devices/LINA0003:00 ./bus/platform/devices/LINA0005:00 ./bus/platform/devices/LINA0007:00 ./bus/platform/devices/LINA0008:00 ./bus/platform/devices/LINA0008:01 ./bus/platform/devices/LINA0008:02 ./bus/platform/drivers/smc91x/LINA0003:00 ./bus/platform/drivers/fixed-clk/LINA0008:00 ./bus/platform/drivers/fixed-clk/LINA0008:01 ./bus/platform/drivers/fixed-clk/LINA0008:02 ./bus/platform/drivers/arm-pmu/LINA0007:00 ./bus/platform/drivers/virtio-mmio/LINA0005:00 ./devices/platform/LINA0003:00 ./devices/platform/LINA0005:00 ./devices/platform/LINA0007:00 ./devices/platform/LINA0008:00 ./devices/platform/LINA0008:01 ./devices/platform/LINA0008:02 ./devices/LNXSYSTM:00/device:00/LINA0007:00 ./devices/LNXSYSTM:00/device:00/ACPI0004:01/LINA0003:00 ./devices/LNXSYSTM:00/device:00/ACPI0004:01/LINA0008:00 ./devices/LNXSYSTM:00/device:00/ACPI0004:01/LINA0008:01 ./devices/LNXSYSTM:00/device:00/ACPI0004:01/LINA0008:02 ./devices/LNXSYSTM:00/device:00/ACPI0004:01/ACPI0004:02/LINA0005:00 ./devices/LNXSYSTM:00/device:00/ACPI0004:01/ACPI0004:02/LINA0009:00 root@genericarmv8:/sys# root@genericarmv8:/sys# find . -name AMBA* ./bus/acpi/devices/AMBA0000:00 ./bus/platform/devices/AMBA0000:00 ./bus/platform/drivers/amba-acpi/AMBA0000:00 ./devices/platform/AMBA0000:00 ./devices/LNXSYSTM:00/device:00/AMBA0000:00 root@genericarmv8:/sys# root@genericarmv8:/sys/bus/amba/devices# ls device:01 device:02 device:03 device:04 root@genericarmv8:/sys/bus/amba/devices#
Naresh Bhat (1): foundation: Add ASL for bus, devices enumeration
platforms/foundation-v8.acpi/dsdt.asl | 181 +++++++++++++++++++++++++++++++-- 1 file changed, 175 insertions(+), 6 deletions(-)
From: Naresh Bhat naresh.bhat@linaro.org
Add ASL for SMB, FPGA, AMBA along with the devices like CLK, SYSREG, ..etc on the bus.
Signed-off-by: Naresh Bhat naresh.bhat@linaro.org Signed-off-by: Hanjun Guo hanjun.guo@linaro.org --- platforms/foundation-v8.acpi/dsdt.asl | 181 +++++++++++++++++++++++++++++++-- 1 file changed, 175 insertions(+), 6 deletions(-)
diff --git a/platforms/foundation-v8.acpi/dsdt.asl b/platforms/foundation-v8.acpi/dsdt.asl index 39b4886..5c3225a 100644 --- a/platforms/foundation-v8.acpi/dsdt.asl +++ b/platforms/foundation-v8.acpi/dsdt.asl @@ -240,6 +240,74 @@ DefinitionBlock ( } }
+ Device (PMU0) { + Name (_HID, "LINA0007") + Name (_UID, 0) + + Method (_CRS, 0x0, Serialized) { + Name (RBUF, ResourceTemplate () { + Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {92, 93, 94, 95} + }) + Return (RBUF) + } + } + + Device (SMB) { + Name (_HID, "ACPI0004") + Name (_UID, 0) + + Name (_CRS, ResourceTemplate () { + + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite, + 0x00000000, // Address Space Granularity + 0x08000000, // Address Range Minimum (base address in FDT) + 0x0BFFFFFF, // Address Range Maximum (base + (len-1)) + 0x00000000, // Address Translation Offset + 0x04000000, // Address Length (len in FDT) + ,, , AddressRangeMemory, TypeStatic) + + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite, + 0x00000000, // Address Space Granularity + 0x14000000, // Address Range Minimum (base address in FDT) + 0x17FFFFFF, // Address Range Maximum (base + (len-1)) + 0x00000000, // Address Translation Offset + 0x04000000, // Address Length (len in FDT) + ,, , AddressRangeMemory, TypeStatic) + + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite, + 0x00000000, // Address Space Granularity + 0x18000000, // Address Range Minimum (base address in FDT) + 0x1BFFFFFF, // Address Range Maximum (base + (len-1)) + 0x00000000, // Address Translation Offset + 0x04000000, // Address Length (len in FDT) + ,, , AddressRangeMemory, TypeStatic) + + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite, + 0x00000000, // Address Space Granularity + 0x1C000000, // Address Range Minimum (base address in FDT) + 0x1FFFFFFF, // Address Range Maximum (base + (len -1)) + 0x00000000, // Address Translation Offset + 0x04000000, // Address Length (len in FDT) + ,, , AddressRangeMemory, TypeStatic) + + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite, + 0x00000000, // Address Space Granularity + 0x0C000000, // Address Range Minimum (base address in FDT) + 0x0FFFFFFF, // Address Range Maximum (base + (len-1)) + 0x00000000, // Address Translation Offset + 0x04000000, // Address Length (len in FDT) + ,, , AddressRangeMemory, TypeStatic) + + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite, + 0x00000000, // Address Space Granularity + 0x10000000, // Address Range Minimum (base address in FDT) + 0x13FFFFFF, // Address Range Maximum (base + (len-1)) + 0x00000000, // Address Translation Offset + 0x04000000, // Address Length (len in FDT) + ,, , AddressRangeMemory, TypeStatic) + + }) + Device (NET0) { Name (_HID, "LINA0003") Name (_UID, 0) @@ -253,6 +321,60 @@ DefinitionBlock ( } }
+ Device (CLK0) { + Name (_HID, "LINA0008") + Name (_UID, 0) + + Method (FREQ, 0x0, NotSerialized) { + Return (24000000) + } + } + + Device (CLK1) { + Name (_HID, "LINA0008") + Name (_UID, 1) + + Method (FREQ, 0x0, NotSerialized) { + Return (1000000) + } + } + + Device (CLK2) { + Name (_HID, "LINA0008") + Name (_UID, 2) + + Method (FREQ, 0x0, NotSerialized) { + Return (32768) + } + } + + Device (FPGA) { + Name (_HID, "ACPI0004") + Name (_UID, 0) + + Name (_CRS, ResourceTemplate () { + + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite, + 0x00000000, // Address Space Granularity + 0x1C000000, // Address Range Minimum (base address in FDT) + 0x1C1FFFFF, // Address Range Maximum (base + (len-1)) + 0x00000000, // Address Translation Offset + 0x00200000, // Address Length (len in FDT) + ,, , AddressRangeMemory, TypeStatic) + }) + + Device (SREG) { + Name (_HID, "LINA0009") + Name (_UID, 0) + + Method (_CRS, 0x0, Serialized) { + Name (RBUF, ResourceTemplate() { + Memory32Fixed (ReadWrite, 0x1c010000, 0x1000) + }) + Return (RBUF) + } + } + Device (VIRT) { Name (_HID, "LINA0005") Name (_UID, 0) @@ -265,17 +387,64 @@ DefinitionBlock ( Return (RBUF) } } + } // End of FPGA + } // End SMB
- Device (PMU0) { - Name (_HID, "LINA0007") - Name (_UID, 0) + Device (AMBA) { + Name (_HID, "AMBA0000") + Name (_UID, 0) + + Device (SER0) { + Name (_ADR, 0x1c090000) + Name (_UID, 0)
Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate () { - Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {92, 93, 94, 95} + Name (RBUF, ResourceTemplate() { + Memory32Fixed (ReadWrite, 0x1c090000, 0x1000) + Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x25} }) - Return (RBUF) + Return (RBUF) + } + } + + Device (SER1) { + Name (_ADR, 0x1c0a0000) + Name (_UID, 1) + + Method (_CRS, 0x0, Serialized) { + Name (RBUF, ResourceTemplate() { + Memory32Fixed (ReadWrite, 0x1c0a0000, 0x1000) + Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x26} + }) + Return (RBUF) + } + } + + Device (SER2) { + Name (_ADR, 0x1c0b0000) + Name (_UID, 2) + + Method (_CRS, 0x0, Serialized) { + Name (RBUF, ResourceTemplate() { + Memory32Fixed (ReadWrite, 0x1c0b0000, 0x1000) + Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x27} + }) + Return (RBUF) + } + } + + Device (SER3) { + Name (_ADR, 0x1c0c0000) + Name (_UID, 3) + + Method (_CRS, 0x0, Serialized) { + Name (RBUF, ResourceTemplate() { + Memory32Fixed (ReadWrite, 0x1c0c0000, 0x1000) + Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x28} + }) + Return (RBUF) } } + } // End of AMBA } }
This looks like an excellent start!
Acked-by: Graeme Gregory graeme.gregory@linaro.org
On Wed, Oct 23, 2013 at 02:26:33PM +0530, naresh.bhat@linaro.org wrote:
From: Naresh Bhat naresh.bhat@linaro.org
Add ASL for SMB, FPGA, AMBA along with the devices like CLK, SYSREG, ..etc on the bus.
Signed-off-by: Naresh Bhat naresh.bhat@linaro.org Signed-off-by: Hanjun Guo hanjun.guo@linaro.org
platforms/foundation-v8.acpi/dsdt.asl | 181 +++++++++++++++++++++++++++++++-- 1 file changed, 175 insertions(+), 6 deletions(-)
diff --git a/platforms/foundation-v8.acpi/dsdt.asl b/platforms/foundation-v8.acpi/dsdt.asl index 39b4886..5c3225a 100644 --- a/platforms/foundation-v8.acpi/dsdt.asl +++ b/platforms/foundation-v8.acpi/dsdt.asl @@ -240,6 +240,74 @@ DefinitionBlock ( } }
Device (PMU0) {
Name (_HID, "LINA0007")
Name (_UID, 0)
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate () {
Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {92, 93, 94, 95}
})
Return (RBUF)
}
}
Device (SMB) {
Name (_HID, "ACPI0004")
Name (_UID, 0)
Name (_CRS, ResourceTemplate () {
DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
0x00000000, // Address Space Granularity
0x08000000, // Address Range Minimum (base address in FDT)
0x0BFFFFFF, // Address Range Maximum (base + (len-1))
0x00000000, // Address Translation Offset
0x04000000, // Address Length (len in FDT)
,, , AddressRangeMemory, TypeStatic)
DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
0x00000000, // Address Space Granularity
0x14000000, // Address Range Minimum (base address in FDT)
0x17FFFFFF, // Address Range Maximum (base + (len-1))
0x00000000, // Address Translation Offset
0x04000000, // Address Length (len in FDT)
,, , AddressRangeMemory, TypeStatic)
DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
0x00000000, // Address Space Granularity
0x18000000, // Address Range Minimum (base address in FDT)
0x1BFFFFFF, // Address Range Maximum (base + (len-1))
0x00000000, // Address Translation Offset
0x04000000, // Address Length (len in FDT)
,, , AddressRangeMemory, TypeStatic)
DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
0x00000000, // Address Space Granularity
0x1C000000, // Address Range Minimum (base address in FDT)
0x1FFFFFFF, // Address Range Maximum (base + (len -1))
0x00000000, // Address Translation Offset
0x04000000, // Address Length (len in FDT)
,, , AddressRangeMemory, TypeStatic)
DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
0x00000000, // Address Space Granularity
0x0C000000, // Address Range Minimum (base address in FDT)
0x0FFFFFFF, // Address Range Maximum (base + (len-1))
0x00000000, // Address Translation Offset
0x04000000, // Address Length (len in FDT)
,, , AddressRangeMemory, TypeStatic)
DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
0x00000000, // Address Space Granularity
0x10000000, // Address Range Minimum (base address in FDT)
0x13FFFFFF, // Address Range Maximum (base + (len-1))
0x00000000, // Address Translation Offset
0x04000000, // Address Length (len in FDT)
,, , AddressRangeMemory, TypeStatic)
})
- Device (NET0) { Name (_HID, "LINA0003") Name (_UID, 0)
@@ -253,6 +321,60 @@ DefinitionBlock ( } }
Device (CLK0) {
Name (_HID, "LINA0008")
Name (_UID, 0)
Method (FREQ, 0x0, NotSerialized) {
Return (24000000)
}
}
Device (CLK1) {
Name (_HID, "LINA0008")
Name (_UID, 1)
Method (FREQ, 0x0, NotSerialized) {
Return (1000000)
}
}
Device (CLK2) {
Name (_HID, "LINA0008")
Name (_UID, 2)
Method (FREQ, 0x0, NotSerialized) {
Return (32768)
}
}
Device (FPGA) {
Name (_HID, "ACPI0004")
Name (_UID, 0)
Name (_CRS, ResourceTemplate () {
DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
0x00000000, // Address Space Granularity
0x1C000000, // Address Range Minimum (base address in FDT)
0x1C1FFFFF, // Address Range Maximum (base + (len-1))
0x00000000, // Address Translation Offset
0x00200000, // Address Length (len in FDT)
,, , AddressRangeMemory, TypeStatic)
})
Device (SREG) {
Name (_HID, "LINA0009")
Name (_UID, 0)
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate() {
Memory32Fixed (ReadWrite, 0x1c010000, 0x1000)
})
Return (RBUF)
}
}
- Device (VIRT) { Name (_HID, "LINA0005") Name (_UID, 0)
@@ -265,17 +387,64 @@ DefinitionBlock ( Return (RBUF) } }
- } // End of FPGA
- } // End SMB
Device (PMU0) {
Name (_HID, "LINA0007")
Name (_UID, 0)
- Device (AMBA) {
Name (_HID, "AMBA0000")
Name (_UID, 0)
Device (SER0) {
Name (_ADR, 0x1c090000)
Name (_UID, 0)
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate () {
Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {92, 93, 94, 95}
Name (RBUF, ResourceTemplate() {
Memory32Fixed (ReadWrite, 0x1c090000, 0x1000)
Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x25} })
Return (RBUF)
Return (RBUF)
}
}
Device (SER1) {
Name (_ADR, 0x1c0a0000)
Name (_UID, 1)
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate() {
Memory32Fixed (ReadWrite, 0x1c0a0000, 0x1000)
Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x26}
})
Return (RBUF)
}
}
Device (SER2) {
Name (_ADR, 0x1c0b0000)
Name (_UID, 2)
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate() {
Memory32Fixed (ReadWrite, 0x1c0b0000, 0x1000)
Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x27}
})
Return (RBUF)
}
}
Device (SER3) {
Name (_ADR, 0x1c0c0000)
Name (_UID, 3)
Method (_CRS, 0x0, Serialized) {
Name (RBUF, ResourceTemplate() {
Memory32Fixed (ReadWrite, 0x1c0c0000, 0x1000)
Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x28}
})
}Return (RBUF) }
- } // End of AMBA }
}
1.7.9.5
Linaro-acpi mailing list Linaro-acpi@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-acpi
On 10/23/2013 03:09 AM, Graeme Gregory wrote:
This looks like an excellent start!
Acked-by: Graeme Gregory graeme.gregory@linaro.org
On Wed, Oct 23, 2013 at 02:26:33PM +0530, naresh.bhat@linaro.org wrote:
From: Naresh Bhat naresh.bhat@linaro.org
Add ASL for SMB, FPGA, AMBA along with the devices like CLK, SYSREG, ..etc on the bus.
Signed-off-by: Naresh Bhat naresh.bhat@linaro.org Signed-off-by: Hanjun Guo hanjun.guo@linaro.org
platforms/foundation-v8.acpi/dsdt.asl | 181 +++++++++++++++++++++++++++++++-- 1 file changed, 175 insertions(+), 6 deletions(-)
Wow! Agreed -- nicely done!