Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1864226rwb; Wed, 5 Oct 2022 06:04:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6QKlLVJi18UZLMp5APDP0M3teelnFs/6vXUEmXPN6BcI1yTv2kBmfSV5R+z8kIco9/+eRH X-Received: by 2002:a17:907:3f0f:b0:782:395f:cd69 with SMTP id hq15-20020a1709073f0f00b00782395fcd69mr23694929ejc.406.1664975045839; Wed, 05 Oct 2022 06:04:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664975045; cv=none; d=google.com; s=arc-20160816; b=m4dtTdxKAVfmfs7HtOWxXNW3ifyF/b66usW/qm0ggK+PY/eUA7o7LYDXVRYvaCjbyy bYR254/igJ1CdmF+azCWLgs3MH233FhqxpUJKk12qkvV5x0z0mjxGWQ04+Di9h+u9APe /t5SoyNfU5UI6nPUVk/yvhvtO6R4re9jGzNTLZpCYUxGkVtQ0rimTL2DNma/eR4M8BCZ Y5ABMsRuHbISOhncbK9RDpP5uL4ZWNdl8rEwagwd+bFHYPlkau1Jl4KTNG25RMFb4jXR VNXod19cbH/Lo16t0ONAso4/gLEVgHyV8KNuS13T5pPPuTGGevHJPWQv893zjUOgYLeO SkMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+/BpHNUiX7JadelGxCPFlNmOoEOJtPwIvuyPjnCDWlw=; b=YL3P9RH38wuU+uvBO7+9IKRhXj5JUkUuNRsMx794IDDKrpmMRsmSbA0bQtGH88cv5f AdOQECc2QNVVpkNx4k+7ZNnXTjkMeIIb4L9Nfiys42ZTFBOQJkeqGLZEQkmNepxtCh/J ov7B8v8r1TDpWckm+vFdzUkP3kDO9gxsLl6+2C3AAE8LgC30tlLiIVyDqGm0e3kVseCO NVsTdfHzNEuFPvu5nu3YOTyUOsH8hiJRqQnNE7/cgQwVwWa08d38KtaWeraMMfJcp/PI 9/2BKqJccKGZSODIU/8TJ9tj6z8409ejynJa8n9I5OoByKx07ifHRuJDBEcuhUm775IC +Oow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=e6fMM1BO; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lg15-20020a170906f88f00b0078cffe5dcdesi4508082ejb.451.2022.10.05.06.03.28; Wed, 05 Oct 2022 06:04:05 -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=@gmail.com header.s=20210112 header.b=e6fMM1BO; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229999AbiJEMyP (ORCPT + 99 others); Wed, 5 Oct 2022 08:54:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229830AbiJEMyN (ORCPT ); Wed, 5 Oct 2022 08:54:13 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E18EB72FCD; Wed, 5 Oct 2022 05:54:12 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id g27so5983411edf.11; Wed, 05 Oct 2022 05:54:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=+/BpHNUiX7JadelGxCPFlNmOoEOJtPwIvuyPjnCDWlw=; b=e6fMM1BObwqE0wCzwzVi+O9wL9KCw6rpt+K5AX6yF1M3XtoO4odTQWR/BN64rJMnLu O+qTNHQH8wGgicBOpPJlk0I2X4fyHJ8K40TB6xXmPWAP77uBxYD5QJusdMe/r8ZBmm+C UkaqYh7sbI/hwmtTzZ482u7hK7qz3ZqsQ9SU5vKT9FbwPzuHKVwMII8q2u4o1TDSzHDi Xz3j+33pbpb/abtNZy14KFzbpmfsCwOtgAIUOi5z3VQuVmPxBQEJdVqOYiyAm9WPRBXq WVc9vhXOcr4vkm+NyMhIdpX+QpCjKKa0U2fLjtSKEQoRT8C53PuERGoAMRKBmDhqp/fH rbfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=+/BpHNUiX7JadelGxCPFlNmOoEOJtPwIvuyPjnCDWlw=; b=xylUQ0rvChdRBE6MBZFOmTPHyGurYLxjbVl1eZOzCskXmfkwEH8+NVnOUL+cPxoXJz BaL/biCna7MpKye11N3xZ+aDF2kzS1XFZFy7Cm5pia4EEq/0OncMUsxHudfwv0LJ2W4H b3oM4tQ4kAadF7zII2xhLIV7IUnPpBGevR7RmOP4vOv28Fp7csS7WigR+W8C0Y3J6GHV Y4KWi2hXC+evEwYhwEDYqSdgG3Ffb1k2HU25vKxt3Ri8cdPQk8iC7e9gIHcCJZyPrhu1 QZOygTqMISt9Tbr3V/l4rMbFm2Rsdwkt82C44sueeZeYE0bAt3X1hQf5RCXaHIBkNHKd cUPw== X-Gm-Message-State: ACrzQf13dWMcHsUbez9ck7PUH2SMN++/kWr5pyFGQe+QJNa0osj0NWlw McBa3SCjPdtzxBfAQ9YH5Y+Kmx1drBMvc+GEaWI= X-Received: by 2002:a05:6402:50d1:b0:452:899e:77c with SMTP id h17-20020a05640250d100b00452899e077cmr28041684edb.0.1664974451331; Wed, 05 Oct 2022 05:54:11 -0700 (PDT) MIME-Version: 1.0 References: <20221003223222.448551-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20221003223222.448551-3-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: From: "Lad, Prabhakar" Date: Wed, 5 Oct 2022 13:53:44 +0100 Message-ID: Subject: Re: [RFC PATCH v2 2/2] soc: renesas: Add L2 cache management for RZ/Five SoC To: Guo Ren Cc: Geert Uytterhoeven , Paul Walmsley , Palmer Dabbelt , Albert Ou , Rob Herring , Krzysztof Kozlowski , Magnus Damm , Heiko Stuebner , Conor Dooley , Philipp Tomsich , Nathan Chancellor , Atish Patra , Anup Patel , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Biju Das , Lad Prabhakar Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Hi Guo, On Wed, Oct 5, 2022 at 2:29 AM Guo Ren wrote: > > On Tue, Oct 4, 2022 at 6:32 AM Prabhakar wrote: > > > > From: Lad Prabhakar > > > > On the AX45MP core, cache coherency is a specification option so it may > > not be supported. In this case DMA will fail. As a workaround, firstly we > > allocate a global dma coherent pool from which DMA allocations are taken > > and marked as non-cacheable + bufferable using the PMA region as specified > > in the device tree. Synchronization callbacks are implemented to > > synchronize when doing DMA transactions. > > > > The Andes AX45MP core has a Programmable Physical Memory Attributes (PMA) > > block that allows dynamic adjustment of memory attributes in the runtime. > > It contains a configurable amount of PMA entries implemented as CSR > > registers to control the attributes of memory locations in interest. > > > > Below are the memory attributes supported: > > * Device, Non-bufferable > > * Device, bufferable > > * Memory, Non-cacheable, Non-bufferable > > * Memory, Non-cacheable, Bufferable > > * Memory, Write-back, No-allocate > > * Memory, Write-back, Read-allocate > > * Memory, Write-back, Write-allocate > > * Memory, Write-back, Read and Write-allocate > Seems Svpbmt's PMA, IO, and NC wouldn't fit your requirements, could > give a map list of the types of Svpbmt? And give out what you needed, > but Svpbmt can't. > Sorry I didn't get what you meant here, could you please elaborate. > Here is the Linux dma type to Svpbmt map: > PMA -> Normal > IO -> ioremap, pgprot_noncached > NC -> pgprot_writecombine > > How about AX45MP? > Svpbmt extension is not supported on AX45MP (reported by riscv_isa_extension_available()) Cheers, Prabhakar