Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp10618463rwb; Fri, 25 Nov 2022 06:19:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf4CPkv+m5180MqG6g0mwbiP/WwX/TKTOFINx5YZ7sLTgHeEr6sVkuYay2cU7KHUbZGrH7U+ X-Received: by 2002:a17:906:8d86:b0:78d:4742:bb62 with SMTP id ry6-20020a1709068d8600b0078d4742bb62mr20972571ejc.43.1669385958893; Fri, 25 Nov 2022 06:19:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669385958; cv=none; d=google.com; s=arc-20160816; b=eFhgx3lL+DcU9cCDErpD6gb+62q5vUtlay0XkYCMZASmVFrvcqvpn0q//fb5Q7CUjD 6LrseengNcQJFpWutomnr1RCiC1XKl93Le8/+35GwhApQuV7ssSPmJ4Ez4ToRrmlbA3R 7Niu+e9YoS+94666NAb/peuvo8zf9y1lKUBaR5AUoJh4i5JgslkHUfOCIN5XNtFom3rX bDSeQggfyv5JP8DJ8mBWlWas9+CiIK56unprHRvqCgHo9Of0Bxgt88+kHj2UYoWWUjV9 P9cRvcs6MaroidDGn6M/PyBCuuJGEuvDncyJMUVsbuQsMb+7qkS58e42+/hYrQGnNpEF jG0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+hGQyhDCH3/GI1JkcTGHaimVi3zDurDFF0eqQa4ic54=; b=qXS2rmotBkzo3Uds5obmd/Ctn7+S1vOJfHXcfN3rIOTPRcyrpy9vxZ/JlHfGeQ3oMD s1irUugkv6V31g6dOusQVCl1oMCV9zfJyX4R/yyUNvokX4UdWHsh8jGTU6lbY/OFiiGQ YfryJ0gel9yTzWeSYbug004fIVKBxKEXgWZQlC/BuX7NMuAHOISPEsUzAKabRXIkelm6 9YiOljiirN+hN8Acec8LJ/04tsRXYGpQ/m1tVXjZBDckEbN5K2rTzLU8E8LlX+DiBCpZ /IFDi3QE/Gd6yLpU5pSm0IfG1V+kXBq32QW/SPHcqOs4AI9SxTaBKT4NrSDtGT1OI9pk HSfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=cmuqZwNh; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xe14-20020a170907318e00b00781df60a2c8si3561205ejb.342.2022.11.25.06.18.54; Fri, 25 Nov 2022 06:19:18 -0800 (PST) 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=@microchip.com header.s=mchp header.b=cmuqZwNh; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229688AbiKYNZS (ORCPT + 86 others); Fri, 25 Nov 2022 08:25:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbiKYNZR (ORCPT ); Fri, 25 Nov 2022 08:25:17 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B33CC41987; Fri, 25 Nov 2022 05:25:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1669382716; x=1700918716; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=PlRGf5S5JExBVvpK167qlrreMpp4yW3JD4H5Kt6/TWw=; b=cmuqZwNh9XSTBvkb2fi9PBkgN29tdOxGiXOtd/D38avFAKx/sIvM3hU+ jNWDME7kmI49tD/xX290Egim/71rVRKnZ1FM2qBVxo3kws5X22NC2NMX/ t2f90OedayFZdJbIDHEIn+OY9/aSQhXkQqlIer2zXIhMClyNBTsNhXEzl VdU+kbcAxdDJjK5wrWtTAmMRvmCVfJ0Zil6IRRKJZCe9APGB2a0XlOZuc XnoBQSryEezYTgo6al7bckCyV3n65Z3lBnHLH8ePbHnmKSJQm3Uknz92S MV9DDob0jZ8xVrFQs159SiHLYWvkOLYiKCoAO46nWi+5WsZePUW0hpwxn w==; X-IronPort-AV: E=Sophos;i="5.96,193,1665471600"; d="scan'208";a="188665806" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Nov 2022 06:25:15 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 25 Nov 2022 06:25:13 -0700 Received: from wendy (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12 via Frontend Transport; Fri, 25 Nov 2022 06:25:10 -0700 Date: Fri, 25 Nov 2022 13:24:52 +0000 From: Conor Dooley To: "Lad, Prabhakar" CC: Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Geert Uytterhoeven , Magnus Damm , Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Guo Ren , Jisheng Zhang , Atish Patra , Anup Patel , Andrew Jones , Nathan Chancellor , Philipp Tomsich , , , , , Biju Das , Lad Prabhakar Subject: Re: [PATCH v4 6/7] dt-bindings: cache: r9a07g043f-l2-cache: Add DT binding documentation for L2 cache controller Message-ID: References: <20221124172207.153718-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20221124172207.153718-7-prabhakar.mahadev-lad.rj@bp.renesas.com> <70d1bfde-f57f-1741-08d3-23e362793595@linaro.org> <9b0f8312-2caa-b9f3-edf3-1b720532f559@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,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 On Fri, Nov 25, 2022 at 12:51:34PM +0000, Lad, Prabhakar wrote: > Hi Conor, > > On Fri, Nov 25, 2022 at 12:25 PM Conor Dooley > wrote: > > > > On Fri, Nov 25, 2022 at 01:12:18PM +0100, Krzysztof Kozlowski wrote: > > > On 25/11/2022 11:34, Lad, Prabhakar wrote: > > > >>> +/* Device, Non-bufferable */ > > > >>> +#define AX45MP_PMACFG_MTYP_DEV_NON_BUF (0 << 2) > > > >>> +/* Device, bufferable */ > > > >>> +#define AX45MP_PMACFG_MTYP_DEV_BUF (1 << 2) > > > >>> +/* Memory, Non-cacheable, Non-bufferable */ > > > >>> +#define AX45MP_PMACFG_MTYP_MEM_NON_CACHE_NON_BUF (2 << 2) > > > >>> +/* Memory, Non-cacheable, Bufferable */ > > > >>> +#define AX45MP_PMACFG_MTYP_MEM_NON_CACHE_BUF (3 << 2) > > > >> > > > >> What are all these? They don't look like flags, because 3 = 1 | 2... > > > >> they don't look like constants, because we do not use shifts in > > > >> constants. Are these some register values? I also do not see the header > > > >> being used in the code, so why having a bindings header if it is not > > > >> used (DTS is not usage...)? > > > >> > > > > These are register bit values for the MTYP[5:2] field. The DTS example > > > > in the binding doc (above) uses these macros. I haven't included the > > > > DTS/I patches with this patchset yet do think I should? > > > > > > Then why storing it as bindings? Bindings headers describe the interface > > > implemented by drivers and used by DTS, but this is not implemented by > > > drivers. > > > > IIUC, some of these properties are non-discoverable attributes of the > > cache controller. I see two things that could be done here that are > > "better" than #defining bits: > > - add an RZ/Five specific compatible and use match data to set the > > attributes which is only possible if the pma-regions are set on a > > per SoC basis > > - make pma-regions into a child node, in which andestech,non-cacheable > > andestech,non-bufferable etc are properties of the child node > > > For now the only way to get DMA working without IOCP is to have > AX45MP_PMACFG_MTYP_MEM_NON_CACHE_BUF. But for future purposes I have > introduced the other available flags. > > So maybe for now we could just have this flag > andestech,mem-non-cacheable-bufferable in the binding doc. > > cache-controller@2010000 { > reg = <0x13400000 0x100000>; > compatible = "andestech,ax45mp-cache", "cache"; > interrupts = <508 IRQ_TYPE_LEVEL_HIGH>; > cache-line-size = <64>; > cache-level = <2>; > cache-sets = <1024>; > cache-size = <262144>; > cache-unified; > andestech,pma-region@0x58000000 { > reg = <0x58000000 0x08000000>; > andestech,mem-non-cacheable-bufferable; Yah, that's about what I would expect - except splitting the properties up. I think split up makes more sense from a property description point of view, rather than needing some sort of oneOf: - non-cacheable-bufferable - cacheable-non-bufferable - non-cacheable-non-bufferable > }; > andestech,pma-region@0xdeadbeef { > reg = <0xdeadbeef 0x08000000>; > andestech,mem-non-cacheable-bufferable; > }; > .... > };