of/address: Add infrastructure to declare MMIO as non-posted
authorHector Martin <marcan@marcan.st>
Thu, 11 Feb 2021 12:41:56 +0000 (21:41 +0900)
committerHector Martin <marcan@marcan.st>
Thu, 8 Apr 2021 11:18:41 +0000 (20:18 +0900)
commit89897f739d7b5e8d572909efc3c2ba7583b8aaba
tree384e91b402a52f0e89cae60d889c42eaf4b7730f
parentb10eb2d50911f98a8f1cacf00b1b677339593f4c
of/address: Add infrastructure to declare MMIO as non-posted

This implements the 'nonposted-mmio' boolean property. Placing this
property in a bus marks all direct child devices as requiring
non-posted MMIO mappings. If no such property is found, the default
is posted MMIO.

of_mmio_is_nonposted() performs this check to determine if a given
device has requested non-posted MMIO.

of_address_to_resource() uses this to set the IORESOURCE_MEM_NONPOSTED
flag on resources that require non-posted MMIO.

of_iomap() and of_io_request_and_map() then use this flag to pick the
correct ioremap() variant.

This mechanism is currently restricted to builds that support Apple ARM
platforms, as an optimization.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hector Martin <marcan@marcan.st>
drivers/of/address.c