From patchwork Mon Dec 28 12:49:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 352673 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp9789155jai; Mon, 28 Dec 2020 06:30:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzIo023ZyXFKwt7Pv/XW6GF20Tt4n7UNAWGjVRmij0DmHvQ0MQk5vvB9JYIXUwD6aF1616 X-Received: by 2002:a17:906:6a45:: with SMTP id n5mr42559496ejs.514.1609165760415; Mon, 28 Dec 2020 06:29:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165760; cv=none; d=google.com; s=arc-20160816; b=IcIGLEIcdeQPitOeebcDL2NH0joOY0H1uQl5TQjWDbeTT3IM6TfDDJtO3ED1HgT8xz emwuQYhwcdIBprmTS82qX7xENizszvY22j5tXmGLslHpeEiwzlw30ys3F36sknKYMTxG mbcI/aPFJjfhCrhWSez3gb5+e43zzv2Jt7ReOT9IBYSS22WFX8U0Kjto51zrclBUj1jt m/8vgcyPFb7bsooaODqAbgOZsyqKmtQEIn1YNRDVO5/34x9PFkz6GgEJxhxBXzu30lyg ZzJ1TI/ir+nr1Heye88F0de9NyqBWnsZHBNCKYork5Wue6ryfQ9CYoBmrBp1q7D1dsRE HKTQ== 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=EpmT09YmKbZ1lsi3kazfEU5Qu6+ee7M4X+EB7MGgCZI9GlLTKEcfqsj3EIiCzd82dH /kQ/1BmGS1mUY44SWC3EOewcYMgtvi5rGj7VLfoHGg68j0zOkhCyOwmRTCCuan5rluAy C+ISEin4YWylTaoj6eICV4i6khF1WanWX0t/WV70zC7Ag5v+a5TsZzXbZBFaxyDNtO0J fIaJ3mJ+d9FNwhxl5xlJ/Rb8UZZB7ncrjqJ7TLrfctMlLKVZar/a/NAaRctBLazzu6yV kxjRBVpnWDUgwtxyy+SEpUvAUWBv4lKSKUYI7INtLb2iR6MLT0cWyCE+JfO11tfhdnjH 0xyg== 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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 dm6si19153102ejc.159.2020.12.28.06.29.20; Mon, 28 Dec 2020 06:29:20 -0800 (PST) Received-SPF: pass (google.com: domain of stable-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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S2502314AbgL1O1f (ORCPT + 14 others); Mon, 28 Dec 2020 09:27:35 -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 Precedence: bulk List-ID: X-Mailing-List: stable@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, };