In this series I fix a warning that iasl is outputting about DSDT code.
I also conver the virtio device to probe via ACPI. The virtio device is a bus which is probeable and contains the block device that is used as the rootfs in the model.
Thanks
Graeme
iasl says because object are created here the method should be Serialized.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org --- arch/arm64/boot/asl/foundation-v8.acpi/dsdt.asl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/asl/foundation-v8.acpi/dsdt.asl b/arch/arm64/boot/asl/foundation-v8.acpi/dsdt.asl index ccabf13..82136ea 100644 --- a/arch/arm64/boot/asl/foundation-v8.acpi/dsdt.asl +++ b/arch/arm64/boot/asl/foundation-v8.acpi/dsdt.asl @@ -222,7 +222,7 @@ DefinitionBlock ( Name (_HID, "LINA0003") Name (_UID, 0)
- Method (_CRS, 0x0, NotSerialized) { + Method (_CRS, 0x0, Serialized) { Name (RBUF, ResourceTemplate () { Memory32Fixed (ReadWrite, 0x1a000000, 0x00010000) Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x2F}
Added the match table and pointers for ACPI probing to the driver.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org --- drivers/virtio/virtio_mmio.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index 1ba0d68..1bf6bad 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -101,7 +101,9 @@ #include <linux/virtio_mmio.h> #include <linux/virtio_ring.h>
- +#ifdef CONFIG_ACPI +#include <linux/acpi.h> +#endif
/* The alignment to use between consumer and producer parts of vring. * Currently hardcoded to the page size. */ @@ -636,6 +638,15 @@ static struct of_device_id virtio_mmio_match[] = { }; MODULE_DEVICE_TABLE(of, virtio_mmio_match);
+#ifdef CONFIG_ACPI +static const struct acpi_device_id virtio_mmio_acpi_match[] = { + { "LINA0005", }, + { } +}; +MODULE_DEVICE_TABLE(acpi, virtio_mmio_acpi_match); +#endif + + static struct platform_driver virtio_mmio_driver = { .probe = virtio_mmio_probe, .remove = virtio_mmio_remove, @@ -643,6 +654,7 @@ static struct platform_driver virtio_mmio_driver = { .name = "virtio-mmio", .owner = THIS_MODULE, .of_match_table = virtio_mmio_match, + .acpi_match_table = ACPI_PTR(virtio_mmio_acpi_match), }, };
On 07/26/2013 11:07 AM, Graeme Gregory wrote:
Added the match table and pointers for ACPI probing to the driver.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org
drivers/virtio/virtio_mmio.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index 1ba0d68..1bf6bad 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -101,7 +101,9 @@ #include <linux/virtio_mmio.h> #include <linux/virtio_ring.h>
+#ifdef CONFIG_ACPI +#include <linux/acpi.h> +#endif
/* The alignment to use between consumer and producer parts of vring.
- Currently hardcoded to the page size. */
@@ -636,6 +638,15 @@ static struct of_device_id virtio_mmio_match[] = { }; MODULE_DEVICE_TABLE(of, virtio_mmio_match);
+#ifdef CONFIG_ACPI +static const struct acpi_device_id virtio_mmio_acpi_match[] = {
- { "LINA0005", },
- { }
+}; +MODULE_DEVICE_TABLE(acpi, virtio_mmio_acpi_match); +#endif
- static struct platform_driver virtio_mmio_driver = { .probe = virtio_mmio_probe, .remove = virtio_mmio_remove,
@@ -643,6 +654,7 @@ static struct platform_driver virtio_mmio_driver = { .name = "virtio-mmio", .owner = THIS_MODULE, .of_match_table = virtio_mmio_match,
}, };.acpi_match_table = ACPI_PTR(virtio_mmio_acpi_match),
Interesting. There are no other structs or anything to fill in with the data returned by _CRS? Or is that for a later patch?
On 26/07/13 21:23, Al Stone wrote:
On 07/26/2013 11:07 AM, Graeme Gregory wrote:
Added the match table and pointers for ACPI probing to the driver.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org
drivers/virtio/virtio_mmio.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index 1ba0d68..1bf6bad 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -101,7 +101,9 @@ #include <linux/virtio_mmio.h> #include <linux/virtio_ring.h>
+#ifdef CONFIG_ACPI +#include <linux/acpi.h> +#endif
/* The alignment to use between consumer and producer parts of vring.
- Currently hardcoded to the page size. */
@@ -636,6 +638,15 @@ static struct of_device_id virtio_mmio_match[] = { }; MODULE_DEVICE_TABLE(of, virtio_mmio_match);
+#ifdef CONFIG_ACPI +static const struct acpi_device_id virtio_mmio_acpi_match[] = {
- { "LINA0005", },
- { }
+}; +MODULE_DEVICE_TABLE(acpi, virtio_mmio_acpi_match); +#endif
- static struct platform_driver virtio_mmio_driver = { .probe = virtio_mmio_probe, .remove = virtio_mmio_remove,
@@ -643,6 +654,7 @@ static struct platform_driver virtio_mmio_driver = { .name = "virtio-mmio", .owner = THIS_MODULE, .of_match_table = virtio_mmio_match,
};.acpi_match_table = ACPI_PTR(virtio_mmio_acpi_match), },
Interesting. There are no other structs or anything to fill in with the data returned by _CRS? Or is that for a later patch?
It maps exactly to the IO_RESOURCE and is done in drivers/acpi/acpi_platform.c
So probe() is identical in FDT and ACPI case.
Graeme
Whitelist the virtio_mmio ID of LINA0005
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org --- drivers/acpi/acpi_platform.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c index f12870c..c5eed01 100644 --- a/drivers/acpi/acpi_platform.c +++ b/drivers/acpi/acpi_platform.c @@ -32,6 +32,7 @@ static const struct acpi_device_id acpi_platform_device_ids[] = {
/* arm64 platform devices */ { "LINA0003" }, + { "LINA0005" },
{ } };
Create device VIRT with _HID LINA0005 for the virtio_mmio device. This is a probably bus device which for the models contains the block device holding the rootfs.
This binding will need revisted when simple-bus/amba-bus is implented.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org --- arch/arm64/boot/asl/foundation-v8.acpi/dsdt.asl | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/arch/arm64/boot/asl/foundation-v8.acpi/dsdt.asl b/arch/arm64/boot/asl/foundation-v8.acpi/dsdt.asl index 82136ea..d1a9716 100644 --- a/arch/arm64/boot/asl/foundation-v8.acpi/dsdt.asl +++ b/arch/arm64/boot/asl/foundation-v8.acpi/dsdt.asl @@ -230,5 +230,18 @@ DefinitionBlock ( Return (RBUF) } } + + Device (VIRT) { + Name (_HID, "LINA0005") + Name (_UID, 0) + + Method (_CRS, 0x0, Serialized) { + Name (RBUF, ResourceTemplate() { + Memory32Fixed (ReadWrite, 0x1c130000, 0x1000) + Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x4A} + }) + Return (RBUF) + } + } } }
This binding has now been moved to DSDT so remove from here.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org --- arch/arm64/boot/dts/foundation-v8-acpi.dts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/foundation-v8-acpi.dts b/arch/arm64/boot/dts/foundation-v8-acpi.dts index d5bbe53..2d9332c 100644 --- a/arch/arm64/boot/dts/foundation-v8-acpi.dts +++ b/arch/arm64/boot/dts/foundation-v8-acpi.dts @@ -223,12 +223,15 @@ clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; clock-names = "uartclk", "apb_pclk"; }; - + /* + * Removed for ACPI + * virtio_block@0130000 { compatible = "virtio,mmio"; reg = <0x130000 0x1000>; interrupts = <42>; }; + */ }; }; };
On 07/26/2013 11:07 AM, Graeme Gregory wrote:
In this series I fix a warning that iasl is outputting about DSDT code.
I also conver the virtio device to probe via ACPI. The virtio device is a bus which is probeable and contains the block device that is used as the rootfs in the model.
Thanks
Graeme
Linaro-acpi mailing list Linaro-acpi@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-acpi
Patch series looks good. No additional comments from my end.
Acked-by: Al Stone al.stone@linaro.org