devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v9 0/5] iommu: Support mappings/reservations in reserved-memory regions
@ 2022-09-23 12:35 Thierry Reding
  2022-09-23 12:35 ` [PATCH v9 1/5] dt-bindings: reserved-memory: Document iommu-addresses Thierry Reding
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Thierry Reding @ 2022-09-23 12:35 UTC (permalink / raw)
  To: Rob Herring, Joerg Roedel
  Cc: Will Deacon, Robin Murphy, Nicolin Chen, Krishna Reddy,
	Dmitry Osipenko, Alyssa Rosenzweig, Janne Grunau, Sameer Pujar,
	devicetree, iommu, linux-tegra, asahi

From: Thierry Reding <treding@nvidia.com>

Hi,

This version has several fixes over the previous v8, which can be found
here:

  https://lore.kernel.org/all/20220905170833.396892-1-thierry.reding@gmail.com/

An example is included in the DT bindings, but here is an extract of
what I've used to test this:

        reserved-memory {
                #address-cells = <2>;
                #size-cells = <2>;
                ranges;

                /*
                 * Creates an identity mapping for the framebuffer that
                 * the firmware has setup to scan out a bootsplash from.
                 */
                fb: framebuffer@92cb2000 {
                        reg = <0x0 0x92cb2000 0x0 0x00800000>;
                        iommu-addresses = <&dc0 0x0 0x92cb2000 0x0 0x00800000>;
                };

                /*
                 * Creates a reservation in the IOVA space to prevent
                 * any buffers from being mapped to that region. Note
                 * that on Tegra the range is actually quite different
                 * from this, but it would conflict with the display
                 * driver that I tested this against, so this is just
                 * a dummy region for testing.
                 */
                adsp: reservation-adsp {
                        iommu-addresses = <&dc0 0x0 0x90000000 0x0 0x00010000>;
                };
        };

        host1x@50000000 {
                dc@54200000 {
                        memory-region = <&fb>, <&adsp>;
                };
        };

This is abbreviated a little to focus on the essentials. Note also that
the ADSP reservation is not actually used on this device and the driver
for this doesn't exist yet, but I wanted to include this variant for
testing, because we'll want to use these bindings for the reservation
use-case as well at some point.

I've also been able to make use of this binding and the IOMMU code in
conjunction with the simple-framebuffer driver to hand over a display
configuration set up by UEFI to the Linux kernel.

Janne has confirmed[0] this to be suitable for indirect mappings as
well, though these patches don't implement that feature yet. Potential
extensions to this have been discussed but are not yet included at this
time to not further complicate things.

Thierry

[0]: https://lore.kernel.org/all/20220909144504.GA4024@jannau.net/

Navneet Kumar (1):
  iommu/tegra-smmu: Support managed domains

Thierry Reding (4):
  dt-bindings: reserved-memory: Document iommu-addresses
  iommu: Implement of_iommu_get_resv_regions()
  iommu: dma: Use of_iommu_get_resv_regions()
  iommu/tegra-smmu: Add support for reserved regions

 .../reserved-memory/reserved-memory.yaml      |  70 ++++++++++++
 drivers/iommu/dma-iommu.c                     |   3 +
 drivers/iommu/of_iommu.c                      | 104 ++++++++++++++++++
 drivers/iommu/tegra-smmu.c                    |  86 ++++++++++++---
 include/linux/of_iommu.h                      |   8 ++
 5 files changed, 254 insertions(+), 17 deletions(-)

-- 
2.37.3


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-10-20 14:34 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-23 12:35 [PATCH v9 0/5] iommu: Support mappings/reservations in reserved-memory regions Thierry Reding
2022-09-23 12:35 ` [PATCH v9 1/5] dt-bindings: reserved-memory: Document iommu-addresses Thierry Reding
2022-10-07 13:45   ` Robin Murphy
2022-10-07 13:54     ` Thierry Reding
2022-10-07 14:21       ` Robin Murphy
2022-10-07 15:22         ` Thierry Reding
2022-10-07 16:25           ` Robin Murphy
2022-09-23 12:35 ` [PATCH v9 2/5] iommu: Implement of_iommu_get_resv_regions() Thierry Reding
2022-10-07 13:47   ` Robin Murphy
2022-10-07 15:28     ` Thierry Reding
2022-10-07 16:35       ` Robin Murphy
2022-10-19 18:03   ` Thierry Reding
2022-10-20 14:34     ` Thierry Reding
2022-09-23 12:35 ` [PATCH v9 3/5] iommu: dma: Use of_iommu_get_resv_regions() Thierry Reding
2022-09-23 12:35 ` [PATCH v9 4/5] iommu/tegra-smmu: Add support for reserved regions Thierry Reding
2022-09-23 12:35 ` [PATCH v9 5/5] iommu/tegra-smmu: Support managed domains Thierry Reding
2022-10-07 13:48   ` Robin Murphy
2022-10-07 15:40     ` Thierry Reding
2022-10-07 12:51 ` [PATCH v9 0/5] iommu: Support mappings/reservations in reserved-memory regions Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).