Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9779768ybi; Wed, 24 Jul 2019 09:49:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgx3InIqHdhDLK2GRZkHLLcBYaNsWBSnmqZuEmAnB+eZRJ7MZc53DwptO5wcfS+eZYEFLH X-Received: by 2002:a63:f817:: with SMTP id n23mr82997408pgh.35.1563986943753; Wed, 24 Jul 2019 09:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563986943; cv=none; d=google.com; s=arc-20160816; b=aQrZj2k1FDZkngJFSihzdtahlV994IDPfmP23dNd3bvRMnSIeJmqi01DBfHzN1zy5A EUwGkTzfC/510UrIcs3ffqwrX9EGRzT4PGKUsLHLyzNmGJWZBpbeMmL2H4O5Ub69rmaT iauOLgaQNvnKg0VS3s0jXTDt2/eAUK6zOe+7nFTqFvZfIACFA7k/tfTaSXfQsZCpy5H1 m560LK8UCB3fm/+aFEreWTIxxe5/WHJEKW60ZA1p2tuR91EuLqUX0wIfRCqB2SKXf105 APGnvyOHJXWdQ67ZnRFly7JIVZohn49o2xMnxek34k2K6IpuNjwdvhU6qvglWVG8cLpa dPUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:autocrypt :openpgp:from:references:cc:to:subject:dkim-signature; bh=w04TwcBlrwE0OA2QepWCIyollMUBH4W0M6LcA4jtxc4=; b=Mp9se+3Xl86ZbTeflkZCY5h9hhiI81DUxgBx7xwGDkBuii72GEfU5fWEL4/3GvyuAn 6KUZ4U1ni2tE2wyVg9N/ixWIdgvBXx9N2XJlZ0yrFegERLaB9BctvVh8HBNRzxQ9ZSdd OIty/saOs8YZ7wUjt9uqMyzSyaaeJHaXwaer1ql/75j6lcQGafkkNgQH+JCPjY0L11KK IezR1ZBE7oRfeicI4azC5pWWJ7fZZSW2gLDEduHsX5bjAFAAx/NnouhYuHzfoRXcSuC2 oTNQNCePGvqRUkPUc5ioNKfoY5iv5FKd2ycPT6dHIgmoLFEc+IuTAKEdcobk0uPaT2fI PmgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AjM19knB; 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 v20si15110782pjn.27.2019.07.24.09.48.49; Wed, 24 Jul 2019 09:49:03 -0700 (PDT) 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=AjM19knB; 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 S1728461AbfGXPbE (ORCPT + 99 others); Wed, 24 Jul 2019 11:31:04 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:33872 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727529AbfGXPbE (ORCPT ); Wed, 24 Jul 2019 11:31:04 -0400 Received: by mail-lf1-f66.google.com with SMTP id b29so25022670lfq.1 for ; Wed, 24 Jul 2019 08:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=w04TwcBlrwE0OA2QepWCIyollMUBH4W0M6LcA4jtxc4=; b=AjM19knBV84Dn1ZuV7wNvmsmmirz1UY6xC79pbJYVejpy1o6FJZS/OOfMvWLILrYRI KgCiUyz3E+DJLovwOe2ERKXIcw1Gf04vpzKyUS7E9m0aoUwRb8vVLufVFNZJl46ULvZG T9wQyXEzEETSWc+CzxB4t1aV4BBiC2S2RUl9Ie5q2Q3rawXi+CAQj9USLYUsyGCjdDkc 4IrpjUX5adig8IFh5u2LmPQH/M+zWLJ6T2VFuF4bXaV1XJ4ZAQetoVjtQJgmKLesbJGJ ql2ydeAfHrPkE7C3b51d3j8VAIlhrNQ1ymJAn1uh0WWgg9mXQXZyeG3w5mZvaDij0fIE Un3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=w04TwcBlrwE0OA2QepWCIyollMUBH4W0M6LcA4jtxc4=; b=q7O+gdBVLA5A9/r2oifnuRUtjPm8pElmaIzDZlgURsxPGJ3fOYxPiyvRErqao71L0n 8Wy6m/2bhPNTVERhkCsT5Qhu8cmB6QrW82CtnOy55Jo9eBA9hJ0BUW2IQg8Alj7z17it JO7JZ1lpYVdpMGKi/EqoA1CnEEn73Q+IV3ZKN/hV47ERw4CFlKjYs9Gxvwr99bi3HbrO Io6+3+pP585djlvH078M9KGvT/CM2fTrFCs9upCiZSq6LD/85j5x30ozyRLl+zMVlmhv 2C7ZDS613ub3nqs0vWR1WqC14uAajfzI1x1+iLBd2yHOB9QGMBKJu4DXDTQeclBHAr3r KSsQ== X-Gm-Message-State: APjAAAVajKVKIXGMmhodBaRAwKLqyD4UAaUD7EC33M44J3DLvzYRa7Rc lxVNNZ5kZG3hmnA5wUZsD5lwuA== X-Received: by 2002:a05:6512:1d2:: with SMTP id f18mr37896536lfp.173.1563982260973; Wed, 24 Jul 2019 08:31:00 -0700 (PDT) Received: from [10.44.66.8] ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id q4sm9720175lje.99.2019.07.24.08.30.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jul 2019 08:31:00 -0700 (PDT) Subject: Re: [PATCH] qcom: Add BCM vote macro to TCS header To: Jordan Crouse , freedreno@lists.freedesktop.org Cc: ilina@codeaurora.org, bjorn.andersson@linaro.org, linux-pm@vger.kernel.org, "Raju P.L.S.S.S.N" , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Gross , David Brown References: <1563378793-22023-1-git-send-email-jcrouse@codeaurora.org> From: Georgi Djakov Openpgp: preference=signencrypt Autocrypt: addr=georgi.djakov@linaro.org; prefer-encrypt=mutual; keydata= mQINBFjTuRcBEACyAOVzghvyN19Sa/Nit4LPBWkICi5W20p6bwiZvdjhtuh50H5q4ktyxJtp 1+s8dMSa/j58hAWhrc2SNL3fttOCo+MM1bQWwe8uMBQJP4swgXf5ZUYkSssQlXxGKqBSbWLB uFHOOBTzaQBaNgsdXo+mQ1h8UCgM0zQOmbs2ort8aHnH2i65oLs5/Xgv/Qivde/FcFtvEFaL 0TZ7odM67u+M32VetH5nBVPESmnEDjRBPw/DOPhFBPXtal53ZFiiRr6Bm1qKVu3dOEYXHHDt nF13gB+vBZ6x5pjl02NUEucSHQiuCc2Aaavo6xnuBc3lnd4z/xk6GLBqFP3P/eJ56eJv4d0B 0LLgQ7c1T3fU4/5NDRRCnyk6HJ5+HSxD4KVuluj0jnXW4CKzFkKaTxOp7jE6ZD/9Sh74DM8v etN8uwDjtYsM07I3Szlh/I+iThxe/4zVtUQsvgXjwuoOOBWWc4m4KKg+W4zm8bSCqrd1DUgL f67WiEZgvN7tPXEzi84zT1PiUOM98dOnmREIamSpKOKFereIrKX2IcnZn8jyycE12zMkk+Sc ASMfXhfywB0tXRNmzsywdxQFcJ6jblPNxscnGMh2VlY2rezmqJdcK4G4Lprkc0jOHotV/6oJ mj9h95Ouvbq5TDHx+ERn8uytPyg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ayYJIXFqjl/X0KBcCbiAl4vbdBw1bqFnO4zd1lMXKVoa29UHqby4MPbQhjWNVv9kqp8A39+ E9xw890l1xdERkjVKX6IEJu2hf7X3MMl9tOjBK6MvdOUxvh1bNNmXh7OlBL1MpJYY/ydIm3B KEmKjLDvB0pePJkdTw== Message-ID: <31e9d2c6-edcd-11b8-4c4b-d51ed2d8f7b7@linaro.org> Date: Wed, 24 Jul 2019 18:30:58 +0300 MIME-Version: 1.0 In-Reply-To: <1563378793-22023-1-git-send-email-jcrouse@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jordan, On 7/17/19 18:53, Jordan Crouse wrote: > The A6XX family of Adreno GPUs use a microcontroller to control the > GPU clock independently. The microcontroller also has the capability > to vote for the bus but doesn't currently do so except for one initial > vote that is hard coded [1]. > > Currently there is no good way to construct a valid TCS command outside > of the inner workings of the QCOM interconnect driver which is something > that will need to be addressed for the next generation of GPU drivers. > > To start the process, this change moves the TCS command macros from the > sdm845 interconnect driver into a soc specific header to make it available > for future efforts into this area. I agree that we should move the TCS macros into tsc.h. There is also a similar macro in drivers/clk/qcom/clk-rpmh.c. Maybe we can replace both with a common one? Thanks, Georgi > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/msm/adreno/a6xx_hfi.c#n219 > > Signed-off-by: Jordan Crouse > --- > > drivers/interconnect/qcom/sdm845.c | 17 ----------------- > include/soc/qcom/tcs.h | 17 +++++++++++++++++ > 2 files changed, 17 insertions(+), 17 deletions(-) > > diff --git a/drivers/interconnect/qcom/sdm845.c b/drivers/interconnect/qcom/sdm845.c > index 4915b78..79b6f01 100644 > --- a/drivers/interconnect/qcom/sdm845.c > +++ b/drivers/interconnect/qcom/sdm845.c > @@ -20,23 +20,6 @@ > #include > #include > > -#define BCM_TCS_CMD_COMMIT_SHFT 30 > -#define BCM_TCS_CMD_COMMIT_MASK 0x40000000 > -#define BCM_TCS_CMD_VALID_SHFT 29 > -#define BCM_TCS_CMD_VALID_MASK 0x20000000 > -#define BCM_TCS_CMD_VOTE_X_SHFT 14 > -#define BCM_TCS_CMD_VOTE_MASK 0x3fff > -#define BCM_TCS_CMD_VOTE_Y_SHFT 0 > -#define BCM_TCS_CMD_VOTE_Y_MASK 0xfffc000 > - > -#define BCM_TCS_CMD(commit, valid, vote_x, vote_y) \ > - (((commit) << BCM_TCS_CMD_COMMIT_SHFT) | \ > - ((valid) << BCM_TCS_CMD_VALID_SHFT) | \ > - ((cpu_to_le32(vote_x) & \ > - BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_X_SHFT) | \ > - ((cpu_to_le32(vote_y) & \ > - BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_Y_SHFT)) > - > #define to_qcom_provider(_provider) \ > container_of(_provider, struct qcom_icc_provider, provider) > > diff --git a/include/soc/qcom/tcs.h b/include/soc/qcom/tcs.h > index 262876a..6012a9e 100644 > --- a/include/soc/qcom/tcs.h > +++ b/include/soc/qcom/tcs.h > @@ -53,4 +53,21 @@ struct tcs_request { > struct tcs_cmd *cmds; > }; > > +#define BCM_TCS_CMD_COMMIT_SHFT 30 > +#define BCM_TCS_CMD_COMMIT_MASK 0x40000000 > +#define BCM_TCS_CMD_VALID_SHFT 29 > +#define BCM_TCS_CMD_VALID_MASK 0x20000000 > +#define BCM_TCS_CMD_VOTE_X_SHFT 14 > +#define BCM_TCS_CMD_VOTE_MASK 0x3fff > +#define BCM_TCS_CMD_VOTE_Y_SHFT 0 > +#define BCM_TCS_CMD_VOTE_Y_MASK 0xfffc000 > + > +#define BCM_TCS_CMD(commit, valid, vote_x, vote_y) \ > + (((commit) << BCM_TCS_CMD_COMMIT_SHFT) | \ > + ((valid) << BCM_TCS_CMD_VALID_SHFT) | \ > + ((cpu_to_le32(vote_x) & \ > + BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_X_SHFT) | \ > + ((cpu_to_le32(vote_y) & \ > + BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_Y_SHFT)) > + > #endif /* __SOC_QCOM_TCS_H__ */ >