Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp855215pxb; Wed, 13 Apr 2022 14:06:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRBI7EcZLIIUec8fKca7Touot/OZVLGT3jp6RONh9yxMbgfKd/hor4okjvGqHiGblFdNDD X-Received: by 2002:a17:907:3f10:b0:6da:818d:4525 with SMTP id hq16-20020a1709073f1000b006da818d4525mr39535985ejc.47.1649883968625; Wed, 13 Apr 2022 14:06:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649883968; cv=none; d=google.com; s=arc-20160816; b=p1B5DKvbcd+OKjSIEilarOnqm4189udNiSJoynpvsXZiM1Zade9iR2u/F3vV3myPQm SOeMNOAYOJtfJB/43/uMPNvkAbGbhDNr0MNCc4lMEqS/oNbmcRkfnRLD/h3s9YQYc7sD EvdYlrxjQXclWXJwzMbRY4E3pqsK31Wu506t/GJbq3ji4sg3GPd3gL4FLUNn0Eb8nq7R scet0OjHc82gggJSv22VVD1Y8qRyUws0fXCTvA5OZCpmGJ56/EtR/lcEoc39gCuXLRxG Q62Jb7uyTm3bDtQZhDxaeYb7KMRqFLs55n5/bGPwmIXHdQAPfeyrCIhyEnaKn90On1W5 mjQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=yYPxXhzIOwcFr39JoTlL6JU7Z9Y1QMWumfqp0c3xUfs=; b=q8cZtatoeKuWdqL1K5Ojifc6bywKntOtlTRP7CbefnKFjYBWFGUDM+nJNGG7suiMXS VZPM0XkN+onm9arfHxHMwS8pFaZQuJbKvfxpSCXKAI8W4AqmDmVNhBp7a4jQlEkO+Abg csWk5Qd9b8J6j0IjLWgjHdD3OxdqB9mG3C1P6OF+FuXYi2zx0gY+eLK0wFQrGgsVGGl5 MpGqCAHpznNMzSP6mY8SJF7d1Tvf/tNSHLhkW5RIXGL8FLzWwHB+du5cRWylTIlPnaKZ NlL1Me3W76PTaXpGBDlCVtykradzCXVCWvzeljQMb+XduxU3pgQhKxkJuqeue5yCEcZc MR+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=KJLcF6Fu; 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=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v12-20020a50a44c000000b0041cdc198f9csi2386084edb.593.2022.04.13.14.05.40; Wed, 13 Apr 2022 14:06:08 -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=@collabora.com header.s=mail header.b=KJLcF6Fu; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231608AbiDMOGs (ORCPT + 99 others); Wed, 13 Apr 2022 10:06:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235996AbiDMOGp (ORCPT ); Wed, 13 Apr 2022 10:06:45 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EC45C3F; Wed, 13 Apr 2022 07:04:22 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 6132B1F45755 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1649858660; bh=+Sdn444MXOXX+FqFQqg2u1NRK2dOFaGDrORKtiAFIdo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=KJLcF6FuhieJivpSA1iCfs8nTFb4VbkZsgYeo4PY6Hyse8qMzDlc6ypp7jAwYiWpL P9ikHIKv9kIJtwE2WUZ/mMVzc8CA3pW64pDlKkcSDEm5MAEb+6Mh03KlvpuNAwjLP6 duU7SGyXa+JAlh+dX7oQ0ui3ONeQdqF3AlHcPggngHYZkmjqemkcc5VDZvu687uwc1 FpYXLx7bHYXwm+zQkthAM0CkjsDdfbOjUbcWffQpH47TGZt+0u/Z2f8ctVfEQ+mkOF 8YtfuhkBbMKlJ4/emTd+IboUAX5TgBpSFgYH4wzmp+lxhBqeZ9E3jeCaBM4KCZCdGw OJ9xibnqNjcyQ== Message-ID: Date: Wed, 13 Apr 2022 17:04:16 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [Patch v7 3/4] dt-bindings: memory: Update reg/reg-names validation Content-Language: en-US To: Rob Herring , Ashish Mhetre Cc: digetx@gmail.com, krzysztof.kozlowski@linaro.org, thierry.reding@gmail.com, jonathanh@nvidia.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, vdumpa@nvidia.com, Snikam@nvidia.com References: <20220413094012.13589-1-amhetre@nvidia.com> <20220413094012.13589-4-amhetre@nvidia.com> From: Dmitry Osipenko In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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 4/13/22 16:37, Rob Herring wrote: > On Wed, Apr 13, 2022 at 03:10:11PM +0530, Ashish Mhetre wrote: >> From tegra186 onwards, memory controller support multiple channels. >> Reg items are updated with address and size of these channels. >> Tegra186 has overall 5 memory controller channels. Tegra194 and tegra234 >> have overall 17 memory controller channels each. >> There is 1 reg item for memory controller stream-id registers. >> So update the reg maxItems to 18 in tegra186 devicetree documentation. >> Also update validation for reg-names added for these corresponding reg >> items. > > Somehow your subject should indicate this is for Tegra. > >> >> Signed-off-by: Ashish Mhetre >> --- >> .../nvidia,tegra186-mc.yaml | 80 +++++++++++++++++-- >> 1 file changed, 74 insertions(+), 6 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml >> index 13c4c82fd0d3..c7cfa6c2cd81 100644 >> --- a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml >> +++ b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml >> @@ -34,8 +34,12 @@ properties: >> - nvidia,tegra234-mc >> >> reg: >> - minItems: 1 >> - maxItems: 3 >> + minItems: 6 > > You just broke current users. > >> + maxItems: 18 >> + >> + reg-names: >> + minItems: 6 >> + maxItems: 18 >> >> interrupts: >> items: >> @@ -142,7 +146,18 @@ allOf: >> then: >> properties: >> reg: >> - maxItems: 1 >> + maxItems: 6 >> + description: 5 memory controller channels and 1 for stream-id registers >> + >> + reg-names: >> + maxItems: 6 >> + items: >> + - const: sid >> + - const: broadcast >> + - const: ch0 >> + - const: ch1 >> + - const: ch2 >> + - const: ch3 >> >> - if: >> properties: >> @@ -151,7 +166,30 @@ allOf: >> then: >> properties: >> reg: >> - minItems: 3 >> + minItems: 18 >> + description: 17 memory controller channels and 1 for stream-id registers >> + >> + reg-names: >> + minItems: 18 >> + items: >> + - const: sid >> + - const: broadcast >> + - const: ch0 >> + - const: ch1 >> + - const: ch2 >> + - const: ch3 >> + - const: ch4 >> + - const: ch5 >> + - const: ch6 >> + - const: ch7 >> + - const: ch8 >> + - const: ch9 >> + - const: ch10 >> + - const: ch11 >> + - const: ch12 >> + - const: ch13 >> + - const: ch14 >> + - const: ch15 >> >> - if: >> properties: >> @@ -160,13 +198,37 @@ allOf: >> then: >> properties: >> reg: >> - minItems: 3 >> + minItems: 18 >> + description: 17 memory controller channels and 1 for stream-id registers >> + >> + reg-names: >> + minItems: 18 >> + items: >> + - const: sid >> + - const: broadcast >> + - const: ch0 >> + - const: ch1 >> + - const: ch2 >> + - const: ch3 >> + - const: ch4 >> + - const: ch5 >> + - const: ch6 >> + - const: ch7 >> + - const: ch8 >> + - const: ch9 >> + - const: ch10 >> + - const: ch11 >> + - const: ch12 >> + - const: ch13 >> + - const: ch14 >> + - const: ch15 >> >> additionalProperties: false >> >> required: >> - compatible >> - reg >> + - reg-names > > New, added properties cannot be required. That's an ABI break. > >> - interrupts >> - "#address-cells" >> - "#size-cells" >> @@ -182,7 +244,13 @@ examples: >> >> memory-controller@2c00000 { >> compatible = "nvidia,tegra186-mc"; >> - reg = <0x0 0x02c00000 0x0 0xb0000>; >> + reg = <0x0 0x02c00000 0x0 0x10000>, /* MC-SID */ >> + <0x0 0x02c10000 0x0 0x10000>, /* Broadcast channel */ >> + <0x0 0x02c20000 0x0 0x10000>, /* MC0 */ >> + <0x0 0x02c30000 0x0 0x10000>, /* MC1 */ >> + <0x0 0x02c40000 0x0 0x10000>, /* MC2 */ >> + <0x0 0x02c50000 0x0 0x10000>; /* MC3 */ >> + reg-names = "sid", "broadcast", "ch0", "ch1", "ch2", "ch3"; >> interrupts = ; >> >> #address-cells = <2>; >> -- >> 2.17.1 >> Oh, wait.. I didn't notice that the new reg ranges are only splitting up the old ranges. Previously it appeared to me that these are the new ranges. Ashish, in this case you don't need to change the regs in the DT at all. Instead, you need to specify the per-channel reg-base offsets in the driver code.