Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1884404pxk; Sat, 5 Sep 2020 01:17:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuZRvEjhTyDSXiyzkhoXfUIeQtAVijBCbjHtI+Iuxz4tDNPErQf03SOeD6tSaQnb9PivCr X-Received: by 2002:a17:906:fcc8:: with SMTP id qx8mr11156743ejb.13.1599293826654; Sat, 05 Sep 2020 01:17:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599293826; cv=none; d=google.com; s=arc-20160816; b=mIZoQS2rm5ZKlWDJOH3MSmMlHDi6PfOhcZMLw54Uo0cNChGAORvVtOI4yylH6YQs5H 2emK2tTwOEN+QLm7//T0Yyre9lktehHtk7I727c6lc2GT000tCiLJp56pva/U+SHpct9 TNb3IomdjRw/5Och4hAjDqjUoWK/DskUqz8h+UJyDiJgsArchihNpx5no8fkdOdHLo/d tFktX63UTJ6BrM+zESczcQVtzQA4MULSd7IoRhwBTZgxCDysHWzB4yDHTg3oS0U0UYrw DBGCd26P0d3PWC3sexp1rYi4K6wZlLcHfeTgsg7A1kA1bzrO+xOi1sWdq+H+6PlEp01h mTBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=p4EK5vyv0eeNDaeBp35kTExdjLa8HVmmTDPCf9vXFLA=; b=UP0z0m8tBlpHOW32UW94hZ47Yx99JjKjiL0sjygioYJpfLoZRMJbdpnFqJ93Q2oIpI zEoumOaSZCfk8HqAttqN1caW9dLzUp5VOKcak/JkPQCcrYMSJdQAUCEjAM1qyPPwqEA+ X4LMCRJ2ZKWlUSZuMh0nni91wC6NOF15nkTMo27Esaarf6XAPO+VVG6ByOUz0xRbj8Pe 2BPSnsKguqyA04nCh1j4qU1nSYZoyA/67JfFggT5jpRf1npZI5sM19E53B8hNW+quK9/ eUcS43Rw5lHnsD4pdP9wIjpY8ivXV9TfcAd2cJ4xyIPDKIN990GnJunKi7szQUkN49JJ RcsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=iwrWM31b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n26si5429045edt.334.2020.09.05.01.16.43; Sat, 05 Sep 2020 01:17:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=iwrWM31b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728507AbgIEINY (ORCPT + 99 others); Sat, 5 Sep 2020 04:13:24 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:45021 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728465AbgIEINQ (ORCPT ); Sat, 5 Sep 2020 04:13:16 -0400 X-UUID: 38073dafc12747399c40f46c1441f9d4-20200905 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=p4EK5vyv0eeNDaeBp35kTExdjLa8HVmmTDPCf9vXFLA=; b=iwrWM31bfE5jmgnnGnmTKv+zH+8J1F/iUphulhTGt3RmCpOOyfblndJbTJ51HQEWf2MW4kiyk8JCpX7QrXjOP5YsgLlJPM6raud7Qo1FcBO98dJ8JVm1uSZVGRBhAM4XVn8PWy6pgHQSm6l8ZWwW0v6BEz/aIXW/6RIiTlWFvTE=; X-UUID: 38073dafc12747399c40f46c1441f9d4-20200905 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2081906385; Sat, 05 Sep 2020 16:13:14 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 5 Sep 2020 16:13:11 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 5 Sep 2020 16:13:05 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Rob Herring , Robin Murphy CC: Will Deacon , Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , , Subject: [PATCH v2 13/23] iommu/mediatek: Add device link for smi-common and m4u Date: Sat, 5 Sep 2020 16:09:10 +0800 Message-ID: <20200905080920.13396-14-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200905080920.13396-1-yong.wu@mediatek.com> References: <20200905080920.13396-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SW4gdGhlIGxhc3Rlc3QgU29DLCBNNFUgaGFzIGl0cyBzcGVjaWFsIHBvd2VyIGRvbWFpbi4gdGh1 cywgSWYgdGhlIGVuZ2luZQ0KYmVnaW4gdG8gd29yaywgaXQgc2hvdWxkIGhlbHAgZW5hYmxlIHR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