Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1116350ybt; Wed, 8 Jul 2020 22:03:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycsvhZHnLRNsSYIWk9lYZsze9dVYjVMRUsfS6nO4VAh9QNp6TzVNcw8bsM8k4NMJ7RKnjJ X-Received: by 2002:a17:906:abc9:: with SMTP id kq9mr55752788ejb.493.1594270982896; Wed, 08 Jul 2020 22:03:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594270982; cv=none; d=google.com; s=arc-20160816; b=YaUieMle6AKQnpk2o+0xJr/C0NqDilPkidNv0cO5G4OzCKIN2HMe84d1qRQj3HukPk jTw0U6mGWF6YkvLgmbkrl0KqBGKo84+CnLqBCjhapjSWUUr5+YEHp4HHj2sR6bPxB3Rg Q0wxPQboDTEVW04eAwPvT8Kewdox5Sl5tSiV50LUnDmyCShI+BuCLakHWjSTTIXejXJp 7mcxFdEXz6iig/AbvFK6DgiYBd8A4E/cCKGfnDcTqcIwwDLzo00JTtzr90JYO7ABb/Uc gDaI8zVVzd+Z5V8uh8av5fFQE2T29mGjNn0FkzW5uSJwMZYR4htg/HyFGZ6zFpWmVcXR +m/Q== 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=Hqoe1VtzzAa4w0lrTNILxm5TZOFtQ6ZqFKD8K8ft5H8=; b=ARMx9Yn7rx3uRan9MtjnhjdqIapYbXPgKsvm7bsGvR0iybLdHGywcDRa1iBqdJa/pv ougLN3hxJpJwumJB+BRP/4vAzAG4sNs1/Z5FXdOLvxk5w3e9QbDw4dC+bWgFCx88qqnb nJ3qh7VZzRnBZFwTlJdHIyDc1UNz/vgORuofbFC6qb8FfJsh//DJpm51YcJKjZ3yCj70 YLd3VNde55vk7r+HRWzVn2hwNNSDmX1Li2P0d4J9MJYP5qIkSZkVQ4uVA7F3DGnGRrWO vLRcbiPXWHFikJz5IV5nCUuhvqjdwfGrMCfcH23zuj8/pXsy1Wj2tTTNuKzzwLlXu4kE GpMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oi9P502f; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g15si1182407edm.229.2020.07.08.22.02.40; Wed, 08 Jul 2020 22:03:02 -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=@linaro.org header.s=google header.b=oi9P502f; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726272AbgGIFBq (ORCPT + 99 others); Thu, 9 Jul 2020 01:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726119AbgGIFBp (ORCPT ); Thu, 9 Jul 2020 01:01:45 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BA5BC061A0B for ; Wed, 8 Jul 2020 22:01:45 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id gc9so556516pjb.2 for ; Wed, 08 Jul 2020 22:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Hqoe1VtzzAa4w0lrTNILxm5TZOFtQ6ZqFKD8K8ft5H8=; b=oi9P502fvIr5PyRQt5SQntHS3N3rx17AUMRRDrMtGMGII+nqCiGfEZ2jmn+Oitn9pt wlCSE90hhoVr6uoZKD+LbMQ5/Y9+xcLTPqnch8CseRIy2aPJnDwDAeis1HABlWtDOBy7 oKrHCpxZYZ9hLcBNAeQVP+cwUqCU2ANOYryvP9QJm+yNkv9tQahz++BfsI6BXQI+jDxj xTnQFcZxteOYJ5U7JqW918NzOFQnWnQDEbicTDOR+IZkCAeVuIuonOeNa+Cy/Fu/mvWd YPdVIRstiJ4F39m1b+ee9XpFEzYr38DuHaRZUFKsUNdfwzRteCm8CiBS+tK7rDMK18Kv 5ToQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hqoe1VtzzAa4w0lrTNILxm5TZOFtQ6ZqFKD8K8ft5H8=; b=NpkV0NWEzqwGpJEBincKL0WvkwUYSnd4WHHnnqOjftqo/7v79CLrjOTHPdrEtL6P5L oxTxwujyrMie+oDA5Wx+MEABt9EMoqiarbyL/zPACRGYuSAAUlqG22uZKrFTXx6aJBf8 +ZA7d81ERf4v+aXpONpXawsxyxbG8O+ZMvipopfliTZQEtEmUgLVRFafI8nucqDiJeGO mEpyAMKXQOn6jAXi03G5UDXhEkPfBv8Deckc5m92Zp090WlMYmMBq6Xtox3faJhU7Q81 Jho+m1mvhoDJoOlZlz3fnEbM5fRXpyN/P0+T7AKrEwqyn85TUUtRRtzqzacQum+FFED3 oMPg== X-Gm-Message-State: AOAM531nnWO3HYIotcK9wPF8g+/v1pbvVT+BTbBk/bqRXdWKWvPgetzD VtJdWdHiZDL9TRUsHxS22GVd3Q== X-Received: by 2002:a17:90b:1a86:: with SMTP id ng6mr13156196pjb.88.1594270904651; Wed, 08 Jul 2020 22:01:44 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id h15sm999974pjc.14.2020.07.08.22.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 22:01:43 -0700 (PDT) From: Bjorn Andersson To: Will Deacon , Robin Murphy , Joerg Roedel , Thierry Reding , Laurentiu Tudor Cc: linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jonathan Marek , linux-arm-msm@vger.kernel.org Subject: [PATCH 3/5] iommu/arm-smmu: Move SMR and S2CR definitions to header file Date: Wed, 8 Jul 2020 22:01:43 -0700 Message-Id: <20200709050145.3520931-4-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200709050145.3520931-1-bjorn.andersson@linaro.org> References: <20200709050145.3520931-1-bjorn.andersson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Expose the SMR and S2CR structs in the header file, to allow platform specific implementations to populate/initialize the smrs and s2cr arrays. Signed-off-by: Bjorn Andersson --- drivers/iommu/arm-smmu.c | 14 -------------- drivers/iommu/arm-smmu.h | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index f33eda3117fa..e2d6c0aaf1ea 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -68,24 +68,10 @@ module_param(disable_bypass, bool, S_IRUGO); MODULE_PARM_DESC(disable_bypass, "Disable bypass streams such that incoming transactions from devices that are not attached to an iommu domain will report an abort back to the device and will not be allowed to pass through the SMMU."); -struct arm_smmu_s2cr { - struct iommu_group *group; - int count; - enum arm_smmu_s2cr_type type; - enum arm_smmu_s2cr_privcfg privcfg; - u8 cbndx; -}; - #define s2cr_init_val (struct arm_smmu_s2cr){ \ .type = disable_bypass ? S2CR_TYPE_FAULT : S2CR_TYPE_BYPASS, \ } -struct arm_smmu_smr { - u16 mask; - u16 id; - bool valid; -}; - struct arm_smmu_cb { u64 ttbr[2]; u32 tcr[2]; diff --git a/drivers/iommu/arm-smmu.h b/drivers/iommu/arm-smmu.h index a71d193073e4..bcd160d01c53 100644 --- a/drivers/iommu/arm-smmu.h +++ b/drivers/iommu/arm-smmu.h @@ -251,6 +251,21 @@ enum arm_smmu_implementation { QCOM_SMMUV2, }; +struct arm_smmu_s2cr { + struct iommu_group *group; + int count; + enum arm_smmu_s2cr_type type; + enum arm_smmu_s2cr_privcfg privcfg; + u8 cbndx; +}; + +struct arm_smmu_smr { + u16 mask; + u16 id; + bool valid; + bool pinned; +}; + struct arm_smmu_device { struct device *dev; -- 2.26.2