Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752326AbaFDQlb (ORCPT ); Wed, 4 Jun 2014 12:41:31 -0400 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:53003 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752139AbaFDQl2 (ORCPT ); Wed, 4 Jun 2014 12:41:28 -0400 Date: Wed, 4 Jun 2014 17:41:32 +0100 From: Will Deacon To: Thierry Reding Cc: Dave P Martin , Arnd Bergmann , "linux-arm-kernel@lists.infradead.org" , Mark Rutland , "devicetree@vger.kernel.org" , "linux-samsung-soc@vger.kernel.org" , Pawel Moll , Ian Campbell , Grant Grundler , Joerg Roedel , Stephen Warren , "linux-kernel@vger.kernel.org" , Marc Zyngier , Linux IOMMU , Rob Herring , Kumar Gala , "linux-tegra@vger.kernel.org" , Cho KyongHo , Hiroshi Doyu Subject: Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings Message-ID: <20140604164132.GF6644@arm.com> References: <1400877218-4113-1-git-send-email-thierry.reding@gmail.com> <4545972.cM7IP1qTXQ@wuerfel> <5288123.eXagyPAxNq@wuerfel> <20140602104104.GD3855@e103592.cambridge.arm.com> <20140604143509.GF28484@ulmo> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140604143509.GF28484@ulmo> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 04, 2014 at 03:35:10PM +0100, Thierry Reding wrote: > On Mon, Jun 02, 2014 at 11:41:04AM +0100, Dave Martin wrote: > > In the strictest sense, no. > > > > But for a large set of sane configurations, this probably works. > > > > Small sets of randomly-assigned IDs can just be enumerated one by one. > > > > We wouldn't be able to describe folding and bit shuffling, but we > > probably don't want to encourage that anyway. > > I'm having some difficulty understanding this. You make it sound like > there's a fairly arbitrary number of IDs that the SMMU can handle. So > how is the mapping to devices defined? If you say encourage that does > make it sound like the assignment of IDs is purely defined by some > mechanism in software rather than in hardware. Or they are more or less > randomly picked by someone. If that's the case, is that not something > that should be dynamically allocated by the kernel rather than put into > the device tree? The set of StreamIDs that can be generated by a master is fixed in the hardware. The SMMU can then be programmed to map these incoming IDs onto a context ID (or a set of context IDs), which are the IDs used internally by the SMMU to find the page tables etc. The StreamID -> ContextID mapping is dynamic and controlled by software. The Master -> StreamIDs mapping is fixed in the hardware. Will -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/