of: Add missing I/O range exception for indirect-IO devices
authorZhichang Yuan <yuanzhichang@hisilicon.com>
Wed, 14 Mar 2018 18:15:54 +0000 (02:15 +0800)
committerBjorn Helgaas <helgaas@kernel.org>
Wed, 4 Apr 2018 13:42:47 +0000 (08:42 -0500)
commit65af618d2c559f8eb19d80d03a23029651a59de4
tree196b7d25862fa5ec74a141965697d594c1448e52
parent5745392e0c2b78e0d73203281d5c42cbd6993194
of: Add missing I/O range exception for indirect-IO devices

There are some special ISA/LPC devices that work on a specific I/O range
where it is not correct to specify a 'ranges' property in the DTS parent
node as CPU addresses translated from DTS node are only for memory space on
some architectures, such as ARM64.  Without the parent 'ranges' property,
of_translate_address() returns an error.

Here we add special handling for this case.

During the OF address translation, some checking will be performed to
identify whether the device node is registered as indirect-IO.  If it is,
the I/O translation will be done in a different way from that one of PCI
MMIO.  In this way, the I/O 'reg' property of the special ISA/LPC devices
will be parsed correctly.

Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Zhichang Yuan <yuanzhichang@hisilicon.com>
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de> # earlier draft
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
drivers/of/address.c