Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9409429pxu; Mon, 28 Dec 2020 15:33:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDuT5rpkpDJhybX7uXR+8gt/T4JfsiU+hLU+94BbeMWDP3V2qXh2s9pijVXsFFTqNe9YTS X-Received: by 2002:a17:907:2123:: with SMTP id qo3mr43703895ejb.543.1609198407975; Mon, 28 Dec 2020 15:33:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609198407; cv=none; d=google.com; s=arc-20160816; b=y7RnnMG+HvjcugzLmtI/N6ayq+DTrnKbOHfyHsaD+E1BrPihDKk2Ce3r0IDv3etPum xQEInn8u+PoJu7+bd6vbE1RQeX1nge0CWa20Yzlr9FhGnU30DQKmDQ9z5bDDKISHdDaB dL/Z2Ioorh0yGRIXcxXDKNh7rhG+imMg73CXwcdoD4Bvy6L5ckzGOpT0ljP0zzcvMzs4 B8nVg2+6QjIx/Nb/wbRw9OnN8DchydTCV74Qumhw+PTg/JoNA2k4vC3CnpXVLiGNVbLi fLBC+EvtVxR6YO9dnRnTh7ox3FFZDxgLYvsH3ydFiKEDw4exKCTZE1iW933FfAYuByX6 B5nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B7jAHy2Z1+aIOoY9MOVbUHydGmSYcK7NSa2XL4NDrDU=; b=XtjFxHrB95lob+lGDrAyRsNlqbudCmRlu7qHsSPm0WF0s3WAH7Zhmct/y47t85itMv yREVvXAykCQQE7G8hnGBx2r7auTCrzV51WXFkZsuQti0q+5e+j+TvV9H56H+Pnd4GihU xf6tqWBgAFeApM/D31Y/c0o9YWR/9/bHg5oZtM/dPFixIhCk4CdzPYapMC+lfTthNJtp 6XT0mZ4dCSN3XTyO4JEGt+vb+pmSVNrqxIMjuh71yM3b/UDnLY5vyv/qCwlZeY1v8KyL 2JwgUVzn2xTPK7ZN+7nvFLaZu4wD4tYZya0uJZcNo2coz2Ycc4ZtzIUgQVNrRJibGMq0 c2Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1CdjNLLy; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp17si18272687ejc.31.2020.12.28.15.33.06; Mon, 28 Dec 2020 15:33:27 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=1CdjNLLy; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503991AbgL1O16 (ORCPT + 99 others); Mon, 28 Dec 2020 09:27:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:34806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502306AbgL1O1b (ORCPT ); Mon, 28 Dec 2020 09:27:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 72B5620715; Mon, 28 Dec 2020 14:27:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165636; bh=ptSUPW+XPQUIYJlWqccpyDhrNgUBftBDXLpMesMCdOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1CdjNLLykAl6q3SByjrLddrpxYPwWKHrgcCTOTTEvveJEG4vWuIeFVyV55S0lCaj0 A4ChTlcL5My7hzMcaB/82zf+v2k/20t+YKXXqSfq/93dRjGiy2PVoCjnuBtNRX/s6s mUn5Xmm6LzJz6PLINdAxuQh0j8v5SqS3rloHp/AA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bjorn Andersson , Steev Klimaszewski , Robin Murphy , Will Deacon Subject: [PATCH 5.10 601/717] iommu/arm-smmu-qcom: Read back stream mappings Date: Mon, 28 Dec 2020 13:49:59 +0100 Message-Id: <20201228125049.697453781@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Andersson commit 07a7f2caaa5a2619934491bab3c47b261c554fb0 upstream. The Qualcomm boot loader configures stream mapping for the peripherals that it accesses and in particular it sets up the stream mapping for the display controller to be allowed to scan out a splash screen or EFI framebuffer. Read back the stream mappings during initialization and make the arm-smmu driver maintain the streams in bypass mode. Cc: Signed-off-by: Bjorn Andersson Tested-by: Steev Klimaszewski Acked-by: Robin Murphy Link: https://lore.kernel.org/r/20201019182323.3162386-3-bjorn.andersson@linaro.org Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c @@ -23,6 +23,28 @@ static const struct of_device_id qcom_sm { } }; +static int qcom_smmu_cfg_probe(struct arm_smmu_device *smmu) +{ + u32 smr; + int i; + + for (i = 0; i < smmu->num_mapping_groups; i++) { + smr = arm_smmu_gr0_read(smmu, ARM_SMMU_GR0_SMR(i)); + + if (FIELD_GET(ARM_SMMU_SMR_VALID, smr)) { + smmu->smrs[i].id = FIELD_GET(ARM_SMMU_SMR_ID, smr); + smmu->smrs[i].mask = FIELD_GET(ARM_SMMU_SMR_MASK, smr); + smmu->smrs[i].valid = true; + + smmu->s2crs[i].type = S2CR_TYPE_BYPASS; + smmu->s2crs[i].privcfg = S2CR_PRIVCFG_DEFAULT; + smmu->s2crs[i].cbndx = 0xff; + } + } + + return 0; +} + static int qcom_smmu_def_domain_type(struct device *dev) { const struct of_device_id *match = @@ -61,6 +83,7 @@ static int qcom_smmu500_reset(struct arm } static const struct arm_smmu_impl qcom_smmu_impl = { + .cfg_probe = qcom_smmu_cfg_probe, .def_domain_type = qcom_smmu_def_domain_type, .reset = qcom_smmu500_reset, };