All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Martin <Dave.Martin-5wv7dgnIgG8@public.gmane.org>
To: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
Cc: Mark Rutland <Mark.Rutland-5wv7dgnIgG8@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
	Pawel Moll <Pawel.Moll-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Grant Grundler <grundler-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Marc Zyngier <Marc.Zyngier-5wv7dgnIgG8@public.gmane.org>,
	"iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Cho KyongHo <pullip.cho-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH] devicetree: Add generic IOMMU device tree bindings
Date: Tue, 20 May 2014 17:39:12 +0100	[thread overview]
Message-ID: <20140520163912.GC5041@e103592.cambridge.arm.com> (raw)
In-Reply-To: <20140520152659.GA30404-5wv7dgnIgG8@public.gmane.org>

On Tue, May 20, 2014 at 04:26:59PM +0100, Will Deacon wrote:
> On Tue, May 20, 2014 at 02:23:47PM +0100, Arnd Bergmann wrote:
> > 	Bit#   33222222 22221111 11111100 00000000
> > 	       10987654 32109876 54321098 76543210
> > phys.hi cell:  npt000ss bbbbbbbb dddddfff rrrrrrrr
> > phys.mid cell: hhhhhhhh hhhhhhhh hhhhhhhh hhhhhhhh
> > phys.lo cell:  llllllll llllllll llllllll llllllll
> > 
> > where:
> > n is 0 if the address is relocatable, 1 otherwise
> > p is 1 if the addressable region is "prefetchable", 0 otherwise
> > t is 1 if the address is aliased (for non-relocatable I/O),
> >  below 1 MB (for Memory), or below 64 KB (for relocatable I/O).
> > ss is the space code, denoting the address space
> > bbbbbbbb is the 8-bit Bus Number
> > ddddd is the 5-bit Device Number
> > fff is the 3-bit Function Number
> > rrrrrrrr is the 8-bit Register Number
> > hh...hh is a 32-bit unsigned number
> > ll...ll is a 32-bit unsigned number
> > 
> > We can ignore n, p, t and r here, and use the same format for a DMA
> > address, then define an empty "dma-ranges" property. That would
> > imply that using b/d/f is sufficient to identify each master at the
> > iommu. Any device outside of the PCI host but connected to the same
> > iommu can use the same notation to list the logical b/d/f that gets
> > sent to the IOMMU in bus master transactions.
> > 
> > Do you think this is sufficient for the ARM SMMU, or do we need
> > something beyond that?
> 
> I think it can define the common-cases for the existing implementations,
> yes. I anticipate Stream-IDs becoming > 16-bit in the near future though,
> so we'd need extra bits if we're describing other devices coming into the
> SMMU.
> 
> Note that we already have a binding for the current SMMU driver, so I'm not
> really in a position to shift over to a new binding until the next version of
> the SMMU architecture comes along...

How much code relies on the meaning of the nptsbdf bits?

Following the general model of concatenating the master ID with the
address bits and trasting that as a single input to the IOMMU seems
reasonable -- maybe we either don't care about the attribute bits and
can replace them with master ID bits, or instead we could extend with
more master ID bits at bit 96 and up.

npts looks like memory type information.  What memory type information
we need to describe for coherent masters on ARM is a bit of an open
question.  Perhaps we can come up with a good ARM-specific interpretation
of these bits, but I wonder whether they are enough.

If there is a real PCI bus in the system of course, then we are fine
once we reach it.  The only problem is for the stuff on AMBA buses etc.

In theory, we could have to describe memory types, cacheability
attributes and coherency domains, but we may be able to squeeze the
possibilities down to a smaller set of sane memory types.

Cheers
---Dave

WARNING: multiple messages have this Message-ID (diff)
From: Dave Martin <Dave.Martin@arm.com>
To: Will Deacon <will.deacon@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Mark Rutland <Mark.Rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-samsung-soc@vger.kernel.org" 
	<linux-samsung-soc@vger.kernel.org>,
	Pawel Moll <Pawel.Moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Grant Grundler <grundler@chromium.org>,
	Joerg Roedel <joro@8bytes.org>,
	Stephen Warren <swarren@wwwdotorg.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Marc Zyngier <Marc.Zyngier@arm.com>,
	"iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Kumar Gala <galak@codeaurora.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	Cho KyongHo <pullip.cho@samsung.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] devicetree: Add generic IOMMU device tree bindings
Date: Tue, 20 May 2014 17:39:12 +0100	[thread overview]
Message-ID: <20140520163912.GC5041@e103592.cambridge.arm.com> (raw)
In-Reply-To: <20140520152659.GA30404@arm.com>

On Tue, May 20, 2014 at 04:26:59PM +0100, Will Deacon wrote:
> On Tue, May 20, 2014 at 02:23:47PM +0100, Arnd Bergmann wrote:
> > 	Bit#   33222222 22221111 11111100 00000000
> > 	       10987654 32109876 54321098 76543210
> > phys.hi cell:  npt000ss bbbbbbbb dddddfff rrrrrrrr
> > phys.mid cell: hhhhhhhh hhhhhhhh hhhhhhhh hhhhhhhh
> > phys.lo cell:  llllllll llllllll llllllll llllllll
> > 
> > where:
> > n is 0 if the address is relocatable, 1 otherwise
> > p is 1 if the addressable region is "prefetchable", 0 otherwise
> > t is 1 if the address is aliased (for non-relocatable I/O),
> >  below 1 MB (for Memory), or below 64 KB (for relocatable I/O).
> > ss is the space code, denoting the address space
> > bbbbbbbb is the 8-bit Bus Number
> > ddddd is the 5-bit Device Number
> > fff is the 3-bit Function Number
> > rrrrrrrr is the 8-bit Register Number
> > hh...hh is a 32-bit unsigned number
> > ll...ll is a 32-bit unsigned number
> > 
> > We can ignore n, p, t and r here, and use the same format for a DMA
> > address, then define an empty "dma-ranges" property. That would
> > imply that using b/d/f is sufficient to identify each master at the
> > iommu. Any device outside of the PCI host but connected to the same
> > iommu can use the same notation to list the logical b/d/f that gets
> > sent to the IOMMU in bus master transactions.
> > 
> > Do you think this is sufficient for the ARM SMMU, or do we need
> > something beyond that?
> 
> I think it can define the common-cases for the existing implementations,
> yes. I anticipate Stream-IDs becoming > 16-bit in the near future though,
> so we'd need extra bits if we're describing other devices coming into the
> SMMU.
> 
> Note that we already have a binding for the current SMMU driver, so I'm not
> really in a position to shift over to a new binding until the next version of
> the SMMU architecture comes along...

How much code relies on the meaning of the nptsbdf bits?

Following the general model of concatenating the master ID with the
address bits and trasting that as a single input to the IOMMU seems
reasonable -- maybe we either don't care about the attribute bits and
can replace them with master ID bits, or instead we could extend with
more master ID bits at bit 96 and up.

npts looks like memory type information.  What memory type information
we need to describe for coherent masters on ARM is a bit of an open
question.  Perhaps we can come up with a good ARM-specific interpretation
of these bits, but I wonder whether they are enough.

If there is a real PCI bus in the system of course, then we are fine
once we reach it.  The only problem is for the stuff on AMBA buses etc.

In theory, we could have to describe memory types, cacheability
attributes and coherency domains, but we may be able to squeeze the
possibilities down to a smaller set of sane memory types.

Cheers
---Dave

WARNING: multiple messages have this Message-ID (diff)
From: Dave.Martin@arm.com (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] devicetree: Add generic IOMMU device tree bindings
Date: Tue, 20 May 2014 17:39:12 +0100	[thread overview]
Message-ID: <20140520163912.GC5041@e103592.cambridge.arm.com> (raw)
In-Reply-To: <20140520152659.GA30404@arm.com>

On Tue, May 20, 2014 at 04:26:59PM +0100, Will Deacon wrote:
> On Tue, May 20, 2014 at 02:23:47PM +0100, Arnd Bergmann wrote:
> > 	Bit#   33222222 22221111 11111100 00000000
> > 	       10987654 32109876 54321098 76543210
> > phys.hi cell:  npt000ss bbbbbbbb dddddfff rrrrrrrr
> > phys.mid cell: hhhhhhhh hhhhhhhh hhhhhhhh hhhhhhhh
> > phys.lo cell:  llllllll llllllll llllllll llllllll
> > 
> > where:
> > n is 0 if the address is relocatable, 1 otherwise
> > p is 1 if the addressable region is "prefetchable", 0 otherwise
> > t is 1 if the address is aliased (for non-relocatable I/O),
> >  below 1 MB (for Memory), or below 64 KB (for relocatable I/O).
> > ss is the space code, denoting the address space
> > bbbbbbbb is the 8-bit Bus Number
> > ddddd is the 5-bit Device Number
> > fff is the 3-bit Function Number
> > rrrrrrrr is the 8-bit Register Number
> > hh...hh is a 32-bit unsigned number
> > ll...ll is a 32-bit unsigned number
> > 
> > We can ignore n, p, t and r here, and use the same format for a DMA
> > address, then define an empty "dma-ranges" property. That would
> > imply that using b/d/f is sufficient to identify each master at the
> > iommu. Any device outside of the PCI host but connected to the same
> > iommu can use the same notation to list the logical b/d/f that gets
> > sent to the IOMMU in bus master transactions.
> > 
> > Do you think this is sufficient for the ARM SMMU, or do we need
> > something beyond that?
> 
> I think it can define the common-cases for the existing implementations,
> yes. I anticipate Stream-IDs becoming > 16-bit in the near future though,
> so we'd need extra bits if we're describing other devices coming into the
> SMMU.
> 
> Note that we already have a binding for the current SMMU driver, so I'm not
> really in a position to shift over to a new binding until the next version of
> the SMMU architecture comes along...

How much code relies on the meaning of the nptsbdf bits?

Following the general model of concatenating the master ID with the
address bits and trasting that as a single input to the IOMMU seems
reasonable -- maybe we either don't care about the attribute bits and
can replace them with master ID bits, or instead we could extend with
more master ID bits at bit 96 and up.

npts looks like memory type information.  What memory type information
we need to describe for coherent masters on ARM is a bit of an open
question.  Perhaps we can come up with a good ARM-specific interpretation
of these bits, but I wonder whether they are enough.

If there is a real PCI bus in the system of course, then we are fine
once we reach it.  The only problem is for the stuff on AMBA buses etc.

In theory, we could have to describe memory types, cacheability
attributes and coherency domains, but we may be able to squeeze the
possibilities down to a smaller set of sane memory types.

Cheers
---Dave

  parent reply	other threads:[~2014-05-20 16:39 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16 12:23 [PATCH] devicetree: Add generic IOMMU device tree bindings Thierry Reding
2014-05-16 12:23 ` Thierry Reding
2014-05-16 12:23 ` Thierry Reding
     [not found] ` <1400242998-437-1-git-send-email-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-05-17  8:04   ` Cho KyongHo
2014-05-17  8:04     ` Cho KyongHo
2014-05-17  8:04     ` Cho KyongHo
2014-05-17 20:48     ` Thierry Reding
2014-05-17 20:48       ` Thierry Reding
2014-05-19 10:26   ` Arnd Bergmann
2014-05-19 10:26     ` Arnd Bergmann
2014-05-19 10:26     ` Arnd Bergmann
2014-05-19 12:53     ` Thierry Reding
2014-05-19 12:53       ` Thierry Reding
2014-05-19 17:22       ` Dave Martin
2014-05-19 17:22         ` Dave Martin
2014-05-19 17:22         ` Dave Martin
     [not found]         ` <20140519172113.GA13858-M5GwZQ6tE7x5pKCnmE3YQBJ8xKzm50AiAL8bYrjMMd8@public.gmane.org>
2014-05-19 20:32           ` Thierry Reding
2014-05-19 20:32             ` Thierry Reding
2014-05-19 20:32             ` Thierry Reding
2014-05-20 10:08             ` Arnd Bergmann
2014-05-20 10:08               ` Arnd Bergmann
2014-05-20 10:08               ` Arnd Bergmann
2014-05-20 13:07               ` Dave Martin
2014-05-20 13:07                 ` Dave Martin
2014-05-20 13:07                 ` Dave Martin
     [not found]                 ` <20140520130659.GA5041-M5GwZQ6tE7x5pKCnmE3YQBJ8xKzm50AiAL8bYrjMMd8@public.gmane.org>
2014-05-20 13:23                   ` Arnd Bergmann
2014-05-20 13:23                     ` Arnd Bergmann
2014-05-20 13:23                     ` Arnd Bergmann
2014-05-20 15:26                     ` Will Deacon
2014-05-20 15:26                       ` Will Deacon
2014-05-20 15:26                       ` Will Deacon
     [not found]                       ` <20140520152659.GA30404-5wv7dgnIgG8@public.gmane.org>
2014-05-20 16:39                         ` Dave Martin [this message]
2014-05-20 16:39                           ` Dave Martin
2014-05-20 16:39                           ` Dave Martin
     [not found]                           ` <20140520163912.GC5041-M5GwZQ6tE7x5pKCnmE3YQBJ8xKzm50AiAL8bYrjMMd8@public.gmane.org>
2014-05-20 20:40                             ` Arnd Bergmann
2014-05-20 20:40                               ` Arnd Bergmann
2014-05-20 20:40                               ` Arnd Bergmann
2014-05-19 18:34       ` Arnd Bergmann
2014-05-19 18:34         ` Arnd Bergmann
2014-05-19 20:59         ` Thierry Reding
2014-05-19 20:59           ` Thierry Reding
2014-05-19 20:59           ` Thierry Reding
2014-05-20 10:04           ` Arnd Bergmann
2014-05-20 10:04             ` Arnd Bergmann
2014-05-20 11:05             ` Thierry Reding
2014-05-20 11:05               ` Thierry Reding
2014-05-20 11:05               ` Thierry Reding
2014-05-20 11:15               ` Arnd Bergmann
2014-05-20 11:15                 ` Arnd Bergmann
2014-05-20 12:02                 ` Thierry Reding
2014-05-20 12:02                   ` Thierry Reding
2014-05-20 12:02                   ` Thierry Reding
2014-05-20 12:41                   ` Arnd Bergmann
2014-05-20 12:41                     ` Arnd Bergmann
2014-05-20 12:41                     ` Arnd Bergmann
2014-05-20 13:17                     ` Thierry Reding
2014-05-20 13:17                       ` Thierry Reding
2014-05-20 13:17                       ` Thierry Reding
2014-05-20 13:34                       ` Arnd Bergmann
2014-05-20 13:34                         ` Arnd Bergmann
2014-05-20 13:34                         ` Arnd Bergmann
2014-05-20 14:00                         ` Thierry Reding
2014-05-20 14:00                           ` Thierry Reding
2014-05-20 14:00                           ` Thierry Reding
2014-05-20 20:31                           ` Arnd Bergmann
2014-05-20 20:31                             ` Arnd Bergmann
2014-05-21  8:16                             ` Thierry Reding
2014-05-21  8:16                               ` Thierry Reding
2014-05-21  8:16                               ` Thierry Reding
2014-05-21  8:54                               ` Arnd Bergmann
2014-05-21  8:54                                 ` Arnd Bergmann
2014-05-21  8:54                                 ` Arnd Bergmann
2014-05-21  9:02                                 ` Thierry Reding
2014-05-21  9:02                                   ` Thierry Reding
2014-05-21  9:02                                   ` Thierry Reding
2014-05-21  9:32                                   ` Arnd Bergmann
2014-05-21  9:32                                     ` Arnd Bergmann
2014-05-21 15:44                                     ` Grant Grundler
2014-05-21 15:44                                       ` Grant Grundler
2014-05-21 15:44                                       ` Grant Grundler
2014-05-21 16:01                                       ` Arnd Bergmann
2014-05-21 16:01                                         ` Arnd Bergmann
2014-05-21 16:01                                         ` Arnd Bergmann
2014-05-20 15:24                     ` Dave Martin
2014-05-20 15:24                       ` Dave Martin
2014-05-20 15:24                       ` Dave Martin
     [not found]                       ` <20140520152458.GB5041-M5GwZQ6tE7x5pKCnmE3YQBJ8xKzm50AiAL8bYrjMMd8@public.gmane.org>
2014-05-20 20:26                         ` Arnd Bergmann
2014-05-20 20:26                           ` Arnd Bergmann
2014-05-20 20:26                           ` Arnd Bergmann
2014-05-21  8:26                           ` Thierry Reding
2014-05-21  8:26                             ` Thierry Reding
2014-05-21  8:26                             ` Thierry Reding
2014-05-21  8:50                             ` Arnd Bergmann
2014-05-21  8:50                               ` Arnd Bergmann
2014-05-21  8:50                               ` Arnd Bergmann
2014-05-21  9:00                               ` Thierry Reding
2014-05-21  9:00                                 ` Thierry Reding
2014-05-21  9:00                                 ` Thierry Reding
2014-05-21  9:36                                 ` Arnd Bergmann
2014-05-21  9:36                                   ` Arnd Bergmann
2014-05-21  9:36                                   ` Arnd Bergmann
2014-05-21 10:50                                   ` Thierry Reding
2014-05-21 10:50                                     ` Thierry Reding
2014-05-21 10:50                                     ` Thierry Reding
2014-05-21 14:01                                     ` Arnd Bergmann
2014-05-21 14:01                                       ` Arnd Bergmann
2014-05-21 14:01                                       ` Arnd Bergmann
2014-05-21 17:09                                 ` Dave Martin
2014-05-21 17:09                                   ` Dave Martin
2014-05-21 17:09                                   ` Dave Martin
     [not found]                                   ` <20140521170954.GC3830-M5GwZQ6tE7x5pKCnmE3YQBJ8xKzm50AiAL8bYrjMMd8@public.gmane.org>
2014-05-21 18:11                                     ` Arnd Bergmann
2014-05-21 18:11                                       ` Arnd Bergmann
2014-05-21 18:11                                       ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140520163912.GC5041@e103592.cambridge.arm.com \
    --to=dave.martin-5wv7dgnigg8@public.gmane.org \
    --cc=Marc.Zyngier-5wv7dgnIgG8@public.gmane.org \
    --cc=Mark.Rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=Pawel.Moll-5wv7dgnIgG8@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=grundler-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pullip.cho-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.