From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 066E4C4707A for ; Sun, 23 May 2021 06:09:53 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6E846611CB for ; Sun, 23 May 2021 06:09:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E846611CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wnFh4iWTn+TfFmUNWUFP+zRD8Goup17ivPx1aFI9GMk=; b=f3tkga3hLPzr0MukQJsNQbnz7l lxJZEvAVH90ro5X3ny4GDSreHYrizLYkZ5Olnw1bz6u8jKRtgT2lfc+Zt1B94pF1qCA3/0n4tj5sR iDpVaMjzh7Ju4aNXspfdjVnoixSD70hm834Qjc9QKhhg+y5fdMcCysFEMP33KrMGO8enfDDmJfSOW kXGkKMHEYX7sk5ija7cu2ek6l3xrwdWLt1VhCbGzjVdqJdHmq1SrYLRrZvYm41J3rrdFi6RhCb9EN /fOinWinbjNtA/QXh9/V302jsFY/J2bTNhNMVIUGi7e20n6Oz+mx2QFYj4tHxo0a9LRF1M8bFz6or Xb9PilRg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkhEu-003sGE-Hw; Sun, 23 May 2021 06:05:28 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkhEj-003sFh-OQ for linux-arm-kernel@desiato.infradead.org; Sun, 23 May 2021 06:05:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=csGLr+TPRSaesVp+pLDCPAxv5f52IL07+7qSuKKfT4U=; b=rSxAb2XpAlNri604uiQUS+hrqb 5Z615bHU3vqqjya46NzsDDoGJS2gCdwr3D//6/PbyZ4Vl3/laXZnOni0WA7jK4/msUoP/WABpMSjt OQSFCexkyfM0s18SLmwQ+9c+dbmnDBqvBz3JrQ9c09wH0+M7m7BSrBSEjGfOcQ+DOLojJyb51lTRE UsBcqui33WWd13o5xodbCWB0+QWVvolkR38K0JyvpeXmABnrRvmDEaG0arpnOx6KySUDAlGzDotFq NF/en3vlxNUnzPElNMKJC08Fg5vq0WkHDwh6E4qihzKkgHIPueClUAJsz1bqmcmd9fuWL0CSbQMKp nqEFHBzw==; Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lkhEg-000Krg-Ng for linux-arm-kernel@lists.infradead.org; Sun, 23 May 2021 06:05:16 +0000 Received: by mail-pf1-x432.google.com with SMTP id c12so6578082pfl.3 for ; Sat, 22 May 2021 23:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=csGLr+TPRSaesVp+pLDCPAxv5f52IL07+7qSuKKfT4U=; b=hl/Cc7/o3SbtJXsvK2IDLrJvO7F4/vCDVugF/rngNU6CA/j5AwJc/se12THbzFaciV 4h5JX/YxcebPocf6BumqT8oM1TG9rwmSsrH5XcI19PjrIJgGRP3AzdjAW7qAv4uP9VlU v1AHUXMm/IouPKjifulK30MlDKG0NklOo/TtU/08WqIGADkuJuEwrzWjnqSZY9xjIh+m /uPvis8rJxf0rsngO7A5+lia4Tbb1vrmQCQkHfaqyOIGTF+GPA4jgtA3ENyi6lglmXXb N7LkiKaGBdU6dZKwgIrtrIR6VpxiFq3vy7j8Iddw0k37xyQhQbYkxLj/f+nYGpP5zEeB YWSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=csGLr+TPRSaesVp+pLDCPAxv5f52IL07+7qSuKKfT4U=; b=n993goDpx1aUOUpjbEAJvj7NcLOsi6u+RvD+HPguRcd7ZuAfD/ksmzPzI8eFKuASin PWTbdGOmk1qKRWEc/YoK1E0lEkj8BcLzYtZlfjentTTMC5XIwc78mTTPai8ow9Ua3ARG zyllS0KD35hOXF2d1l0AcZ9DMkOnm2QQMkMuu0RyLy0/9ay3OzoNecyHFs2L3GGVhOoz gNipwcp6ym+uEKs2wYCpgMEiSwLWQ8u8LuHTHfuCafZlB9RzpqX1fyiKqfTNcmZFpp/v t57JZzTghXI7hVZEfFKlV4FB1TPCpgtfz9Svx7juyFT/QTen5/VOQi2WLNfEKM/6y7EW g53g== X-Gm-Message-State: AOAM532xDNAvLrZp8i87bUUg3y25MwcgguPSVb/OBKMEulHWFOB/lqbc bk8Pu6bTl0xMx9xMZSzUn++3ug== X-Google-Smtp-Source: ABdhPJwi3UqwjLuznY5enwHu8cfXccUM/d95Nyw4XH7+A0EGAQ94i92P7B5eDHF7uRi2IzA7GA45bg== X-Received: by 2002:a63:5a5d:: with SMTP id k29mr7270030pgm.215.1621749911778; Sat, 22 May 2021 23:05:11 -0700 (PDT) Received: from dragon (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id g72sm7828495pfb.33.2021.05.22.23.05.09 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 May 2021 23:05:11 -0700 (PDT) Date: Sun, 23 May 2021 14:05:06 +0800 From: Shawn Guo To: Will Deacon , Robin Murphy Cc: Bjorn Andersson , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v3] iommu/arm-smmu-qcom: hook up qcom_smmu_impl for ACPI boot Message-ID: <20210523060505.GB29015@dragon> References: <20210509022607.17534-1-shawn.guo@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210509022607.17534-1-shawn.guo@linaro.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210522_230514_830729_B2844E33 X-CRM114-Status: GOOD ( 25.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, May 09, 2021 at 10:26:07AM +0800, Shawn Guo wrote: > The hookup with qcom_smmu_impl is required to do ACPI boot on SC8180X > based devices like Lenovo Flex 5G laptop and Microsoft Surface Pro X. > Define acpi_platform_list for these platforms and match them using > acpi_match_platform_list() call, and create qcom_smmu_impl accordingly. > > (np == NULL) is used to check ACPI boot, because fwnode of SMMU device > is a static allocation and thus helpers like has_acpi_companion() don't > work here. > > Signed-off-by: Shawn Guo > --- > Changes for v3: > - Call acpi_match_platform_list() to match platform in qcom smmu > driver rather than IORT code. Hi Robin, How does this version look? Shawn > > Changes for v2: > - Rather than using asl_compiler_id in IORT table, follow suggestion > from Robin Murphy to use acpi_match_platform_list() to match platform. > > drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > index 98b3a1c2a181..f7e187f3fa66 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > @@ -3,6 +3,7 @@ > * Copyright (c) 2019, The Linux Foundation. All rights reserved. > */ > > +#include > #include > #include > #include > @@ -339,10 +340,22 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { > { } > }; > > +static struct acpi_platform_list qcom_acpi_platlist[] = { > + { "LENOVO", "CB-01 ", 0x8180, ACPI_SIG_IORT, equal, "QCOM SMMU" }, > + { "QCOM ", "QCOMEDK2", 0x8180, ACPI_SIG_IORT, equal, "QCOM SMMU" }, > + { } > +}; > + > struct arm_smmu_device *qcom_smmu_impl_init(struct arm_smmu_device *smmu) > { > const struct device_node *np = smmu->dev->of_node; > > + if (np == NULL) { > + /* Match platform for ACPI boot */ > + if (acpi_match_platform_list(qcom_acpi_platlist) >= 0) > + return qcom_smmu_create(smmu, &qcom_smmu_impl); > + } > + > if (of_match_node(qcom_smmu_impl_of_match, np)) > return qcom_smmu_create(smmu, &qcom_smmu_impl); > > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel