Thread (8 messages) 8 messages, 2 authors, 2018-10-29

Re: [PATCH V3 3/5] misc/pvpanic: add MMIO support

From: Andy Shevchenko <hidden>
Date: 2018-10-29 10:30:37
Also in: lkml, platform-driver-x86

On Mon, Oct 29, 2018 at 5:22 AM Peng Hao [off-list ref] wrote:
On some architectures (e.g. arm64), it's preferable to use MMIO, since
this can be used standalone. Add MMIO support to the pvpanic driver.
 pvpanic_walk_resources(struct acpi_resource *res, void *context)
 {
+       struct acpi_resource_fixed_memory32 *fixmem32;
+
        switch (res->type) {
        case ACPI_RESOURCE_TYPE_END_TAG:
                return AE_OK;

        case ACPI_RESOURCE_TYPE_IO:
-               port = res->data.io.minimum;
+               base = (void __iomem *) ioport_map(res->data.io.minimum, 1);
+               return AE_OK;
+
+       case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
+               fixmem32 = &res->data.fixed_memory32;
+               base = ioremap(fixmem32->address, fixmem32->address_length);
                return AE_OK;
Ouch. Sorry, I forgot to look at this previously.

This should be converted to use
acpi_dev_resource_io()
acpi_dev_resource_memory()

-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help