Received: by 10.223.185.116 with SMTP id b49csp5400203wrg; Wed, 7 Mar 2018 11:05:21 -0800 (PST) X-Google-Smtp-Source: AG47ELtTh95lYgTwZfoQAcAzinYvuwgRhH2vTnojkmQXamkOU+5vjk9Q1DyDVgKrTPnnop/hfxaR X-Received: by 2002:a17:902:76c4:: with SMTP id j4-v6mr21983187plt.410.1520449521298; Wed, 07 Mar 2018 11:05:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520449521; cv=none; d=google.com; s=arc-20160816; b=XaKlt7RpVGqC1c2vTwVv8ePOSoyDB+DNEHIhHKXfxqOJWtRYxYNIn7i+s0zNEY4x/D 17Kq+senbouxfENBMZSRoSoV3GyxZA7RfH4sJ9dpzQ/dq8uIvbiQAxrj3JosjwFLi7yX 0FZAThTxAFMuvuI4svCiSnuZA9tlA2ov2PQw2XiVZ8jDQRspRClDPTT213dSvS0kJfmU vVqc8LGznWWvvl4yFeqm9zQ6wXF0XXuiH6sQovMixEa9T/YepPXVx++seZkOUCS2HS66 /eBCwRBAfkmPMV3Zrmh9C4L0RNRjI1Bh49JVFqPhqY9DhlleMfjXSnWihA8RfyS+Nh9L Wpcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=jZPtpSQ+617+cD2owv5npxp5PTikofWOACtBTZvhV9k=; b=EcYfwjAh1DtReiaQTZKrw4pdm01hwEqm5gv3FGvUrGd9GCr0T+otxzWBs4vBo2XLnm 9nMULTrVtk/P/wTMXvifYiVow2GKUblXVqtDAU8uCjP+5l6OLFWxuF43pJi9UV/d/SIf L1tNZ2LmAY/sERsHjRCKRGRXVln+h81sWWWVM4CzvXajUwvrTrbBLBSIwgLhEFlhVLtI iVZblUIMUP/sD8A7mLqDeVHIXbChjDec0uG1/mR/mmGm7dwLBYcX7nc6FytR4vspQwtX Zzk2fZCNAP9W12ar15ecYUATOFzsGAqrJsbUxnTo7u72EM+RdJhmuu2Gkvf5BFDjQPv3 1A/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gqV7P7Hx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si11653323pgu.400.2018.03.07.11.05.06; Wed, 07 Mar 2018 11:05:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gqV7P7Hx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1754719AbeCGTC5 (ORCPT + 99 others); Wed, 7 Mar 2018 14:02:57 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:35507 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754553AbeCGTCy (ORCPT ); Wed, 7 Mar 2018 14:02:54 -0500 Received: by mail-qk0-f193.google.com with SMTP id s188so3953277qkb.2 for ; Wed, 07 Mar 2018 11:02:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jZPtpSQ+617+cD2owv5npxp5PTikofWOACtBTZvhV9k=; b=gqV7P7Hx+dIo1QayyeDc2sbWeuC4IQJ3gQ6WCF7QCZuGKBYjb+kSaLWFR/Mi9eO6aV R+Wpa+qdlJR/DpmgcC1B/06G3LexsS5YocSleL6nzQbU8AwxUYsJEUe5RA5VTAff7CDu 9hQ1ujWSJtXvUVGpYPdo1dGL7ttRUGNpHsb4o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jZPtpSQ+617+cD2owv5npxp5PTikofWOACtBTZvhV9k=; b=Vppe5l/BU0XEUeuFUOJRq9tsMA4Sq4Ft3Xet92JlO62UshnnCAH6uyw4p3+r/B3gaZ QTkg9eg6etTzJPCnveWlTPrys6dj7PGvVAf4SWFMLZqExcPKSGsgjlbJ6wPFyQmyy1sQ q8wR3kh+cvKQUvINGGXWDpLcQWtY9FMdcoL0AF3BGC2ffaWdlrAD09tZ3Dqb9RpQS7yv gIVANEtbgnxe36EziEHw9wbQdCSJV9FlXOyc7t5xpWLME+Gkp2CS7KnpUvsUMj2vHhAG njOEPDfgmlN+Frve23uPlSrQ0IkgUetiG137yUs5G3pmIzijXGweiq4jHpBF9t6iRU4V PXgg== X-Gm-Message-State: AElRT7FMeUY/QXiMo+j0xupyVHx5RMfLSpXp+mgU3c8cZBzR/85Zv3tO SW41APNRnsO5OwU+hOsGigh8Zw== X-Received: by 10.55.33.129 with SMTP id f1mr35581345qki.158.1520449373663; Wed, 07 Mar 2018 11:02:53 -0800 (PST) Received: from bjorns-mbp-2.lan ([8.43.114.254]) by smtp.gmail.com with ESMTPSA id f6sm9313214qth.44.2018.03.07.11.02.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 11:02:52 -0800 (PST) Date: Wed, 7 Mar 2018 11:02:49 -0800 From: Bjorn Andersson To: Lina Iyer Cc: andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, rnayak@codeaurora.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Mahesh Sivasubramanian Subject: Re: [PATCH v4 2/2] dt-bindings: introduce Command DB for QCOM SoCs Message-ID: <20180307190249.GW93895@bjorns-mbp-2.lan> References: <20180226175802.20052-1-ilina@codeaurora.org> <20180226175802.20052-3-ilina@codeaurora.org> <20180305231455.GJ18510@minitux> <20180306155703.GA4930@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180306155703.GA4930@codeaurora.org> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 06 Mar 07:57 PST 2018, Lina Iyer wrote: > On Mon, Mar 05 2018 at 16:15 -0700, Bjorn Andersson wrote: > > On Mon 26 Feb 09:58 PST 2018, Lina Iyer wrote: > > > > > From: Mahesh Sivasubramanian > > > > > > Command DB provides information on shared resources like clocks, > > > regulators etc., probed at boot by the remote subsytem and made > > > available in shared memory. > > > > > > Cc: devicetree@vger.kernel.org > > > Signed-off-by: Mahesh Sivasubramanian > > > Signed-off-by: Lina Iyer > > > --- > > > > > > Changes in v4: > > > - Fix unwanted capitalization > > > - Add reg property > > > --- > > > .../devicetree/bindings/arm/msm/cmd-db.txt | 38 ++++++++++++++++++++++ > > > 1 file changed, 38 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/arm/msm/cmd-db.txt > > > > > > diff --git a/Documentation/devicetree/bindings/arm/msm/cmd-db.txt b/Documentation/devicetree/bindings/arm/msm/cmd-db.txt > > [..] > > > + reserved-memory { > > > + [...] > > > + qcom,cmd-db@c3f000c { > > > + reg = <0x0 0xc3f000c 0x0 0x8>, > > > + <0x0 0x85fe0000 0x0 0x20000>; > > > > I'm still concerned about the use of the redirection mapping here, > > the relocation at 0xc3f000c is used a convenience thing so that the > > command db can be relocated, but because of how Linux will consume any > > non-reserved memory the dts would still need to be manually updated. > > > This location is fixed and it is not expected to change between > different boards. OEMs may change the actual address of the command db > location, but would not change the dictionary location. > Right, dictionary location is fixed. So to pick another range for command db one would update the numbers that goes into the dictionary and expect all software in the system to use this new range. > > As such I think you should just describe only the 0x85fe0000 + 0x20000 > > region here and to support the dynamic aspect of this from a system > > point of view you can have the boot loader read the information at > > 0xc3f000c and adjust the reserved memory. (Or just keep the step of > > manually update the dts without caring about the indirection) > > > It would be incorrect and very board specific to just use the 0x85fe000 > as the address. It is not how the SoC defines the location. Upon request > earlier, this memory location was added in DT and the location is > typical reference platform usage only. > The problem is that as the db resides in a chunk of memory in the middle of what Linux considers System RAM the DTS must specify this region as reserved. Which means that as you, like described above, update the dictionary something (in your scheme a person) has to update the reserved-memory region as well. That's why I'm proposing that the appropriate implementation for this is to have the boot loader to the dictionary part of this and Linux only care about the actual reserved-memory region. This way you would still implement the dictionary lookup on a system level, but the Linux part no longer depend on a human updating the DTS to match the values of the dictionary. But if we stick with the approach of describing both these and hoping that the values in the first region matches the second (or should we add a sanity check in probe?). The memory reserve defined as 0xc3f000c + 8 looks strange, is this system ram as well and what other things resides in that same page? Regards, Bjorn