From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A41FDC47096 for ; Thu, 3 Jun 2021 12:49:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 74ED3613E7 for ; Thu, 3 Jun 2021 12:49:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74ED3613E7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cWGEoRSYoO+Yq217A2MOjiEuMtIW1j0oyTnSAf+VVn8=; b=i9h0GetIVsKQ5aVCdyxyA7l/Us bHv/wLM/IMuaz88X14KDEAZtq2YZFL7UYLWvFRvB44/v5aW+w/Cs4I21Kpmm3R64AndN2jSzs8Nl/ JM+Dp224AllQMcpcEvRYUIeNyDBJk8uf+VG+ZKg5NkRrg952SP0X3pV8nOrgRCYgj/M7J+qJdNrN/ whAPoS/yy0VdBcANar3LGqSCgmOCbrD1/8E2Pd1aUXi16bfFfa5+MLjXmHvTg9jURiHrykIaZPEed VcMNeywcOUHX9ZLppex00cZ8kQXAEQs0h0/w/I+CL7xPHdi3ogigr7WxTCL1D6J5dmqGEqx9aM5rS 9oW/88SA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lomn0-008kjW-2B; Thu, 03 Jun 2021 12:49:34 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lommw-008khx-DA for linux-rockchip@lists.infradead.org; Thu, 03 Jun 2021 12:49:32 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5D04D1063; Thu, 3 Jun 2021 05:49:27 -0700 (PDT) Received: from [10.57.73.64] (unknown [10.57.73.64]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1ED163F774; Thu, 3 Jun 2021 05:49:25 -0700 (PDT) Subject: Re: Different type iommus integrated in a SoC To: Peter Geis Cc: "xxm@rock-chips.com" , hch , joro , will , iommu , linux-rockchip References: <2021052710373173260118@rock-chips.com> <5d7127d5-b73c-2002-1734-98aab2295c8e@arm.com> From: Robin Murphy Message-ID: <144e1c48-96f2-3596-3354-4c023bf6ccc0@arm.com> Date: Thu, 3 Jun 2021 13:49:20 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210603_054930_529396_89BE53BA X-CRM114-Status: GOOD ( 20.47 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On 2021-06-03 13:24, Peter Geis wrote: > On Thu, Jun 3, 2021 at 8:07 AM Robin Murphy wrote: >> >> On 2021-05-27 03:37, xxm@rock-chips.com wrote: >>> Hi all, >>> >>> I have a SoC integrate with two different types of iommus, one is ARM SMMU, serves the PCIe/SATA/USB, >>> the others are vendor specific iommus, serves display device and multimedia device. >>> >>> In the current linux kernel, the iommu framework seems only support one type iommu at runtime, if enable both types iommu, only one type can work. >>> Is there any way to support this kind of SoC? >> >> Hooray! I've been forecasting this for years, but the cases we regularly >> hit with internal FPGA prototyping (nor the secret unused MMU-400 I >> found on RK3288) have never really been a strong enough argument to >> stand behind. >> >> Based on what I remember from looking into this a few years ago, >> converting *most* of the API to per-device ops (now via dev->iommu) is >> trivial; the main challenge will be getting the per-device data >> bootstrapped in iommu_probe_device(), which would probably need to rely >> on the fwspec and/or list of registered IOMMU instances. >> >> The other notable thing which will need to change is the domain >> allocation interface, but in practice I think everyone who calls >> iommu_domain_alloc() today is in fact doing so for a specific device, so >> I don't think it's as big a problem as it might first appear. >> >> Robin. >> > > Good Morning Robin, > > I think the Tegra group would also be interested in this work. > AFAIK they have the smmu and the tegra gart and have been trying to > figure out the runtime handover from the bootloader to the kernel > without smashing everything and starting over. No, handoff of live DMA from the bootlader is an entirely unrelated issue, and there are already several patchsets in flight to address various parts of that. My understanding of Tegras is that they *either* use tegra-gart, tegra-smmu, or arm-smmu depending on the SoC generation, but they aren't mixed within any single SoC. Robin. _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip