Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp451560rwl; Wed, 29 Mar 2023 04:25:07 -0700 (PDT) X-Google-Smtp-Source: AK7set8lzzHMn7MsffwpdOTaIxz+dGKoOltGtRmmCEA0bG+7WTmqv+vOMQfz3Dq23GcZ8rNp+CzC X-Received: by 2002:a05:6a20:3008:b0:d9:b820:10a4 with SMTP id d8-20020a056a20300800b000d9b82010a4mr14944118pzd.8.1680089107293; Wed, 29 Mar 2023 04:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680089107; cv=none; d=google.com; s=arc-20160816; b=oOJEsg9ZBYYdHH6dHoRCtb9uIZzCDSFcCnfBm+yNy++ePQ5UbZnAZKcbU163w0J0GG iInsjRSI5a42uq5gGpx/zE1pL+6oX5ocm6cZSZI/iiWBdOJ2WEXZQbHLJ1y5AlLr6u6D KqCIOo1L/V7RBvD/c64Lulhrp1wF6aaHUcxdceUy+2vGZ4wmvLcSvgZTk+MnIcVedabI VlJOVV8akR4fM+8dt/PUfHSwBdxFAORQRTISSvdH0eWa5h+qI0+uq+gGjYkLxkDYMwT+ /sTysGVestxG74qw/7z2Lm+9lMcnPF/uD6Tvlvl2Mj29+YYom6jxSQCV7SOI0cYHt3Er HfbA== 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=YE63NidFx/yTtTPvk37Lal5nBv6wxm6QBZTGRvkCvTg=; b=rgHbNHnCrlaRP7G0DhprcUgutTnVWv4Ple4vQOz7+j9WuBbzoxnS6K9XbJdu13mgDL QBpBIBPLEY8Z9QIRT32lyvXuAuYqi0NeH1oCpOjjlwK5FueT4OC8eGc1VoB1a/lJiMLw /74JsAV7Ax/sC0aA7mVyJJ7H4/96pldEcfh+mtdHCwaxABQGypi2u3xjsfi/8M8EkP46 gl3uLCh08FA/8v2Oco8g7MINW7YlgwU0Ell10iz0qpLIfQjWgm12Kzm3nTp+2ZS4uAa/ EBqaTrTe1v2x8UYNnlcPDvgmnkk0jNzdcMycilRaYxnbg6LcdY9/vQuPUOLrj77RLb2R bnDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kqKLm9hE; 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 v16-20020a63d550000000b005136ea8b484si4463873pgi.161.2023.03.29.04.24.54; Wed, 29 Mar 2023 04:25:07 -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=kqKLm9hE; 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 S229770AbjC2LSn (ORCPT + 99 others); Wed, 29 Mar 2023 07:18:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbjC2LSg (ORCPT ); Wed, 29 Mar 2023 07:18:36 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 553C13C04 for ; Wed, 29 Mar 2023 04:18:31 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id c29so19658922lfv.3 for ; Wed, 29 Mar 2023 04:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680088709; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=YE63NidFx/yTtTPvk37Lal5nBv6wxm6QBZTGRvkCvTg=; b=kqKLm9hEPjbAaiMW/vA3n3rLJ4Yz9F+d0e3MQudZxAzG/W4VgSnqhaz0X/s9K5TF4w UYLkkCjhgdGeVNkJdwjmm49QMobU9w4KviYlUkmeuOCFn1edv8IUtWaZnMgwVsYvV46m yL+14ogo6UGTe/FOm1IRJBkJnYUm3dZ0YvMKaW3qbs96QKFdn7z6IRjgJCdrtIFPNdKM 9tHz/nxfmTKu+Pk8sQ0Xi/Rgi2u8zvkBrnHFXqqgyJRd+QZ3h4irDYNK1NGM/FrUkY5q HYuXvyoIucRt7lVfsE9s1db9UzBfSUvJWDURujO/pWCoqR1PgHNvEDsgyxSC2UoYDBwo Zwzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680088709; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YE63NidFx/yTtTPvk37Lal5nBv6wxm6QBZTGRvkCvTg=; b=Z2fnIczAFlqE4w3A7RVH75N1Q+VYAeDlFl+eP4EGNk28nj+WiXQflroaSsyjL0I9N8 8mEdmvZNC7l6FW5tLU//vfluW3ux0AtFniHCP15u3Bhbjj1UPEH1JZBrOxmF3gES+qUN C/VUlRT1IRiDJWH9gxmfhN8FeWyjud8pdhK883EFQXqaFxaE+afspiee2OfJR3JmRHo6 7WZHoiyiMMwthLVjYkWhceCA7p/nz0eK7l54I4Lv3L9CUg5Jlz7Pj0CzDzhkAh9ci9kG ClfuJ4eRgG1KimInEwvGYWbCO+ssREQ2oAmjm76a7vP/2EOBAdWkTj9O7d53UjsOJbCj 6Kog== X-Gm-Message-State: AAQBX9etxbNilOT8IluvISRtr5sdd6WkYIfg1bt0bJC0L4SwnfpnXFWO zLjOlgxbOEt2ZvJJph7lb/AFow== X-Received: by 2002:ac2:5a4c:0:b0:4dd:a7ab:b148 with SMTP id r12-20020ac25a4c000000b004dda7abb148mr4794210lfn.49.1680088709555; Wed, 29 Mar 2023 04:18:29 -0700 (PDT) Received: from [192.168.1.101] (abxj225.neoplus.adsl.tpnet.pl. [83.9.3.225]) by smtp.gmail.com with ESMTPSA id n27-20020ac2491b000000b00498f67cbfa9sm5449770lfi.22.2023.03.29.04.18.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Mar 2023 04:18:29 -0700 (PDT) Message-ID: <203a4b25-05ab-e12d-9fba-8bda385dda1b@linaro.org> Date: Wed, 29 Mar 2023 13:18:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 0/2] Resolve MPM register space situation Content-Language: en-US To: Shawn Guo Cc: Andy Gross , Bjorn Andersson , Thomas Gleixner , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20230328-topic-msgram_mpm-v1-0-1b788a5f5a33@linaro.org> <20230329035859.GD3554086@dragon> From: Konrad Dybcio In-Reply-To: <20230329035859.GD3554086@dragon> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 29.03.2023 05:58, Shawn Guo wrote: > On Tue, Mar 28, 2023 at 12:02:51PM +0200, Konrad Dybcio wrote: >> The MPM (and some other things, irrelevant to this patchset) resides >> (as far as the ARM cores are concerned, anyway) in a MMIO-mapped region >> that's a portion of the RPM (low-power management core)'s RAM, known >> as the RPM Message RAM. Representing this relation in the Device Tree >> creates some challenges, as one would either have to treat a memory >> region as a bus, map nodes in a way such that their reg-s would be >> overlapping, or supply the nodes with a slice of that region. >> >> This series implements the third option, by adding a qcom,rpm-msg-ram >> property, which has been used for some drivers poking into this region >> before. Bindings ABI compatibility is preserved through keeping the >> "normal" (a.k.a read the reg property and map that region) way of >> passing the register space. >> >> Example representation with this patchset: >> >> / { >> [...] >> >> mpm: interrupt-controller { >> compatible = "qcom,mpm"; >> qcom,rpm-msg-ram = <&apss_mpm>; >> [...] >> }; >> >> [...] >> >> soc: soc@0 { >> [...] >> >> rpm_msg_ram: sram@45f0000 { >> compatible = "qcom,rpm-msg-ram", "mmio-sram"; >> reg = <0 0x045f0000 0 0x7000>; >> #address-cells = <1>; >> #size-cells = <1>; >> ranges = <0 0x0 0x045f0000 0x7000>; >> >> apss_mpm: sram@1b8 { >> reg = <0x1b8 0x48>; > > Per "vMPM register map" in the driver, the slice size should be 0x44 > instead of 0x48. Is there one register missing from the driver > comment? Yeah we should be using 0x44.. > > PS. It seems the "n" formula in the driver comment should be corrected > as below. > > n = DIV_ROUND_UP(pin_cnt, 32) - 1 Or since we're counting from zero, the ENABLEn should become ENABLE(n-1) etc. Konrad > > Shawn > >> }; >> }; >> }; >> };