Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp171007imk; Sat, 2 Jul 2022 15:07:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tiUBQFqUvGY7j+26Ok1TpG5JGVX3qO4hSnK89Cfcg/NzQoKiwSs+icTmJaN+f24juuJRCl X-Received: by 2002:a05:6402:40c3:b0:439:6b72:483e with SMTP id z3-20020a05640240c300b004396b72483emr15265727edb.154.1656799632960; Sat, 02 Jul 2022 15:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656799632; cv=none; d=google.com; s=arc-20160816; b=sbV6rKcWgP041s4dxd4ZYuvdXlNVRkdxtXRIevIJ9eqGRYA8/PZg+39QtGE8h/fMcW cD/UDhkZH2eO+5ylqQot3fMPufq81cNvUr+8CXLHy+IqETXIO7wwAYsTIiMNPHhsP7l9 ShV/zpYTiiibAWI3ew9cX21n0fzJvW/WICmHfvS8Gvljs5RoH7obbGTMOgRcE6gb9uqS bhfR4Nus1AiZmXXjjE+rJC/EyTOD9AljJbbJtLkT1MpN446ksXwchs+mCSeB2jPkcKuT 5FtWrSbj54vTU3aoND/u8KI0CmYREx0c0als8gAM18KrTSeucZkC+tqWNensnO58kG0Q W0Uw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=WV81TTrUzfnxlK8f1IHJz4xXjnSjuTWSu4GCpZi6HEY=; b=f87LDhyWQHKQ3XNqZaTcK3ON0l7DviHPJDxA+XCrirW5y9FTWCPf6WbuosuU2a6WyI RoDXZNM/tFgm1ZVonjnEaDlewNK12JNbHprr0ujzfG9MdE0YBUHc/LfMW/R9H0fO0sNU 1twIudi2fxNhiyzPpsgIT164OtoPXkxBh7sdblgJ8bATiJiiF6J7WIS1/KYzCOCBaCKp oshtgeo0C7j5KEsY5kWn0nwPBGyiqS2jOaaw2wHn5AmRmEltYJdaiUCdUwp0kFYlgHAI KmsvEmrwfBj5J0OKoJ4VoUanJy6VxDgJud9RkpO/vbVSXBaRdoIjsGLbLGdcE5YTRftn 6krw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N6w5oPvP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg16-20020a170907a41000b00726aad6f43dsi8315657ejc.792.2022.07.02.15.06.47; Sat, 02 Jul 2022 15:07:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N6w5oPvP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229955AbiGBVh3 (ORCPT + 99 others); Sat, 2 Jul 2022 17:37:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbiGBVh1 (ORCPT ); Sat, 2 Jul 2022 17:37:27 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3B11BC16 for ; Sat, 2 Jul 2022 14:37:26 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id y8so1224608eda.3 for ; Sat, 02 Jul 2022 14:37:26 -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:mime-version :content-transfer-encoding; bh=WV81TTrUzfnxlK8f1IHJz4xXjnSjuTWSu4GCpZi6HEY=; b=N6w5oPvPqSon53fXnJZtzHnqdoTIeYCV6XuIzoHbJZvZSPSWEzPKieCj19s19eJcwL RcIaTUHdUUNr9nkU6I8AoMl8MYOb93MYMUeA0voFGALhae/V7epsJgesAM52ZRW0dX2Y 4yxMLoOi6DW/mQkOXwh0GbnbaVTBgbdxWiAiCbpqEsBEKg6pEaxcBiNh8KoKto2CQ+5k VSW2p4QdgRIqPwEEj8mBNKB9BzfGyNCD8VAk1JR6fgYaS+Xp/nbzdZvzdg3/YaSn/Kpz IQD+4eisIUTicjTxgNLfA7Ka4wWJVD1nwiy7AQb07DRuKpbj8Tux5G3x0Zq9odNjaYHP u+Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WV81TTrUzfnxlK8f1IHJz4xXjnSjuTWSu4GCpZi6HEY=; b=ynejy7ki6t1BwWpgLg+AD3y4wGV04wpybj0KEkrBYKPONpJGtSuYb+yzg5dipCEZMs bBDROo4ZWGoorIhnImqppwQpCWHThBXDlAbG41abmxvrvsPc/D6S0eSXbPnHyeV8uluy 05RVcnH5dXjXTRR3fxUGtKOSMfbFcTO4erZ9BTGOEtbrdN3+5EZzHdJuvXn891EJT6z+ ItyGzPB5zcjZOd1KYj5qQe1rs6L8vb+8Q2PsFPlJepWyKzhEY3DfXASXN+nSx1iV653w Uqn6qj7JlgKAhhE4ZUNWshgq9A9xBF3af5IURtQHeNFhaqJb5sllwlXeb+vrZ6pNPZvO MnpQ== X-Gm-Message-State: AJIora8qJJCg9hxb/UX8/e7S654tesmN62Rq4q8jCEIlx07AsHwp9cGT bqJtF2MHrqTlzVY1UdcRsfaOWooP8f+79bz6 X-Received: by 2002:aa7:cd91:0:b0:438:33a1:d5aa with SMTP id x17-20020aa7cd91000000b0043833a1d5aamr22690535edv.157.1656797845428; Sat, 02 Jul 2022 14:37:25 -0700 (PDT) Received: from localhost ([31.134.121.151]) by smtp.gmail.com with ESMTPSA id m7-20020a056402050700b004356c0d7436sm17483107edv.42.2022.07.02.14.37.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 14:37:25 -0700 (PDT) From: Sam Protsenko To: Marek Szyprowski , Krzysztof Kozlowski Cc: Joerg Roedel , Will Deacon , Robin Murphy , Janghyuck Kim , Cho KyongHo , Daniel Mentz , Sumit Semwal , iommu@lists.linux-foundation.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/4] iommu/exynos: Add basic support for SysMMU v7 Date: Sun, 3 Jul 2022 00:37:20 +0300 Message-Id: <20220702213724.3949-1-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Existing exynos-iommu driver only supports SysMMU versions up to v5. But it's pretty much ready for basic usage with SysMMU v7, only small changes have to be done. As SysMMU version is tested dynamically (by reading the corresponding register), there is no need to introduce new compatible string. One major change is that SysMMU v7 can have different register layouts: - with Virtual Machine support - without Virtual Machine support That can be checked by reading the capability registers. In case the SysMMU IP-core is VM-capable, the VM registers have to be used, and some additional initialization is needed. That is the case on E850-96 board, which non-secure SysMMU (v7.4) implements VM-capable register set. The patch series was tested on E850-96 board. Because at the moment there are no SysMMU users for that board, the testing was done using so called "Emulated Translation" registers available on SysMMU v7. That allows one to initiate the translation from CPU, by writing to those registers, and then reading the corresponding TLB registers to find out the translation result. The testing driver can be found in [1] tree. [1] https://github.com/joe-skb7/linux/tree/e850-96-mainline-iommu Sam Protsenko (4): iommu/exynos: Set correct dma mask for SysMMU v5+ iommu/exynos: Check if SysMMU v7 has VM registers iommu/exynos: Use lookup based approach to access v7 registers iommu/exynos: Add minimal support for SysMMU v7 with VM registers drivers/iommu/exynos-iommu.c | 112 ++++++++++++++++++++++++++++++++--- 1 file changed, 104 insertions(+), 8 deletions(-) -- 2.30.2