Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2023397ybt; Thu, 2 Jul 2020 21:43:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpp1DflFiJ4NrPws6DaNz/WvdCcIrKZl0OE65NrBrkz784qEZErxKxqv8eP/1waNxEzFQm X-Received: by 2002:a17:906:d92e:: with SMTP id rn14mr32313956ejb.314.1593751412565; Thu, 02 Jul 2020 21:43:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593751412; cv=none; d=google.com; s=arc-20160816; b=GlfvHLE4QKPWKnHFqYsuOp3aB72HXuUsdak5x6a1usJZfJETQZ/UVQROQY+mj3SSrk LFjBxA2LTPuIUlLA/vcBf9y4c36Y0zY0wD/uxsqtWT2tPROHDXAy6753SwbXZfHrJvGn 8ueSE9kn/hUEUHeUGYpwhW0PMD9z+wLFsqDqvefJDgbaw3joxu9PvWuckK4GQn0S4XPh oCrUjARyC3HqGwE0cNJ5e8dbs4W5VeGN9GJw+6bOAQ6/OKEuSDVU3uAIcasuw5gYUPhf WPHzNeGjlEw6WTgmz3rlF1y0XeUS1bJyy5i9xr1LlbcW1k7C0pKgc5nQ0CYq6kWkIP5P 8T/A== 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=e/bGfH/vs/SEn/d/7v72DL9HP+g5CsFblZIevZXeBhM=; b=eH783/4tyTkhzQxHEv0eiPweBJe88C9sw6XNlFGldgkHZdIJfO4Jdd4pLVINYz0XbO S5siKElbt9pEZ+s0jAz7rdi0m+RtrD/Ttaz8+aG3Zs1ETga34Cz5RTkU7Fq7cHUbCyNQ 7MPDqC9EIbrktpwq7p6aR3zxievTQsUIJ/QCSm6RR62U3poUCaRGkjwbegZV/1/9NfC7 X3YDWYhcKxhC/azxfXjRFAL1/EoVskVO9ahH6AXWBOUpVO6rdaUGvSyxdsDTvHAd2nzU 0ta5ihIiOy5LYTymKRByDmTtNxKHOTw988preeKHFfZyboVxSdr5iIyb4JJPkxZffiVr o0HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=QLgEKSyp; 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 dr4si9733671ejc.239.2020.07.02.21.43.09; Thu, 02 Jul 2020 21:43:32 -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=QLgEKSyp; 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 S1726208AbgGCEmu (ORCPT + 99 others); Fri, 3 Jul 2020 00:42:50 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:18438 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725779AbgGCEmt (ORCPT ); Fri, 3 Jul 2020 00:42:49 -0400 X-UUID: c9b2f040ccb34369906be916612b05f1-20200703 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=e/bGfH/vs/SEn/d/7v72DL9HP+g5CsFblZIevZXeBhM=; b=QLgEKSypB9wm7yPREo8R1GIUyye4Q4Oyve8b391W3a8oyJjAafJpXOHGDUq40Q7BdemmkXpTHkgyCELMz5E3fdQMCVzbQhKnnbMAuG5p7+3CessLX79esLjAUD/QU3HbBIWFz4soQ6YQYUN2Rd/YviiYOYuNeeKcZJacTu8dDZ8=; X-UUID: c9b2f040ccb34369906be916612b05f1-20200703 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 419561045; Fri, 03 Jul 2020 12:42:45 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 3 Jul 2020 12:42:42 +0800 Received: from localhost.localdomain (10.15.20.246) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 3 Jul 2020 12:42:38 +0800 From: Chao Hao To: Joerg Roedel , Rob Herring , Matthias Brugger CC: , , , , , , Chao Hao , FY Yang , Yong Wu , TH Yang Subject: [PATCH v6 03/10] iommu/mediatek: Use a u32 flags to describe different HW features Date: Fri, 3 Jul 2020 12:41:20 +0800 Message-ID: <20200703044127.27438-4-chao.hao@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200703044127.27438-1-chao.hao@mediatek.com> References: <20200703044127.27438-1-chao.hao@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 R2l2ZW4gdGhlIGZhY3QgdGhhdCB3ZSBhcmUgYWRkaW5nIG1vcmUgYW5kIG1vcmUgcGxhdF9kYXRh IGJvb2wgdmFsdWVzLA0KaXQgd291bGQgbWFrZSBzZW5zZSB0byB1c2UgYSB1MzIgZmxhZ3MgcmVn aXN0ZXIgYW5kIGFkZCB0aGUgYXBwcm9wc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