mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johnny Liu <johnliu@nvidia.com>
To: Mikko Perttunen <mperttunen@nvidia.com>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Thierry Reding <thierry.reding@kernel.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	"Prashant Gaikwad" <pgaikwad@nvidia.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	"Douglas Anderson" <dianders@chromium.org>,
	Aniruddha Rao <anrao@nvidia.com>, <devicetree@vger.kernel.org>,
	<linux-tegra@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-clk@vger.kernel.org>, Johnny Liu <johnliu@nvidia.com>
Subject: Re: [PATCH v2 2/4] firmware: tegra: bpmp: Add Tegra238 support
Date: Mon, 2 Nov 2026 11:32:08 +0000	[thread overview]
Message-ID: <20261102113224.2404743-1-johnliu@nvidia.com> (raw)
In-Reply-To: <2Hw2_7rkSLKRLbLEfioCFA@nvidia.com>

On 2026/11/02 08:48, Mikko Perttunen wrote:

> On Thursday, October 29, 2026 12:49 AM Johnny Liu wrote:
> > The "nvidia,tegra186-bpmp" compatible and tegra186_soc data are shared by
> > Tegra186, Tegra194, Tegra234 and Tegra264. Tegra238 has its own BPMP
> > compatible, so give Tegra234, Tegra238 and Tegra264 dedicated SoC data
> > selected through their specific compatibles, built on top of a common
> > TEGRA186_BPMP_SOC_COMMON initializer. This allows chip specific
> > properties to be described in the SoC data. Tegra186 and Tegra194 keep
> > using tegra186_soc.
> > 
> > Also build bpmp-tegra186.o and the shared match table for
> > CONFIG_ARCH_TEGRA_238_SOC, so that a Tegra238-only configuration binds
> > the driver.
> > 
> > Signed-off-by: Johnny Liu <johnliu@nvidia.com>
> > ---
> >  drivers/firmware/tegra/Makefile |  1 +
> >  drivers/firmware/tegra/bpmp.c   | 54 ++++++++++++++++++++++-----------
> >  2 files changed, 38 insertions(+), 17 deletions(-)
>
> This refactoring in this patch makes no sense unless you first read the 
> next patch, plus it has the unrelated factor of adding Tegra238 support, 
> which makes it quite confusing.

Yes, I agree with you. This patch makes sense only after reading the next
patch in the patch series.

> Can you move the TEGRA186_BPMP_SOC_COMMON refactoring into the 'per-SoC 
> EMC clock ID' patch, and have the Tegra238 addition as a separate patch 
> before or after it?

Ack, I will move this refactor in the 'per-SoC EMC clock ID' patch.

[...]

Best Regards,
Johnny Liu

> > diff --git a/drivers/firmware/tegra/Makefile b/drivers/firmware/tegra/Makefile
> > index 97f7a5db9d0a..21e87f3afffe 100644
> > --- a/drivers/firmware/tegra/Makefile
> > +++ b/drivers/firmware/tegra/Makefile
> > @@ -4,6 +4,7 @@ tegra-bpmp-$(CONFIG_ARCH_TEGRA_210_SOC)	+= bpmp-tegra210.o
> >  tegra-bpmp-$(CONFIG_ARCH_TEGRA_186_SOC)	+= bpmp-tegra186.o
> >  tegra-bpmp-$(CONFIG_ARCH_TEGRA_194_SOC)	+= bpmp-tegra186.o
> >  tegra-bpmp-$(CONFIG_ARCH_TEGRA_234_SOC)	+= bpmp-tegra186.o
> > +tegra-bpmp-$(CONFIG_ARCH_TEGRA_238_SOC)	+= bpmp-tegra186.o
> >  tegra-bpmp-$(CONFIG_ARCH_TEGRA_264_SOC)	+= bpmp-tegra186.o
> >  tegra-bpmp-$(CONFIG_DEBUG_FS)	+= bpmp-debugfs.o
> >  tegra-bpmp-$(CONFIG_SYSFS)	+= bpmp-sysfs.o
> > diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c
> > index d3508e98e338..beeb385870f5 100644
> > --- a/drivers/firmware/tegra/bpmp.c
> > +++ b/drivers/firmware/tegra/bpmp.c
> > @@ -1131,25 +1131,41 @@ static const struct dev_pm_ops tegra_bpmp_pm_ops = {
> >  #if IS_ENABLED(CONFIG_ARCH_TEGRA_186_SOC) || \
> >      IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \
> >      IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC) || \
> > +    IS_ENABLED(CONFIG_ARCH_TEGRA_238_SOC) || \
> >      IS_ENABLED(CONFIG_ARCH_TEGRA_264_SOC)
> > +#define TEGRA186_BPMP_SOC_COMMON					\
> > +	.channels = {							\
> > +		.cpu_tx = {						\
> > +			.offset = 3,					\
> > +			.timeout = 60 * USEC_PER_SEC,			\
> > +		},							\
> > +		.thread = {						\
> > +			.offset = 0,					\
> > +			.count = 3,					\
> > +			.timeout = 600 * USEC_PER_SEC,			\
> > +		},							\
> > +		.cpu_rx = {						\
> > +			.offset = 13,					\
> > +			.timeout = 0,					\
> > +		},							\
> > +	},								\
> > +	.ops = &tegra186_bpmp_ops,					\
> > +	.num_resets = 193
> > +
> >  static const struct tegra_bpmp_soc tegra186_soc = {
> > -	.channels = {
> > -		.cpu_tx = {
> > -			.offset = 3,
> > -			.timeout = 60 * USEC_PER_SEC,
> > -		},
> > -		.thread = {
> > -			.offset = 0,
> > -			.count = 3,
> > -			.timeout = 600 * USEC_PER_SEC,
> > -		},
> > -		.cpu_rx = {
> > -			.offset = 13,
> > -			.timeout = 0,
> > -		},
> > -	},
> > -	.ops = &tegra186_bpmp_ops,
> > -	.num_resets = 193,
> > +	TEGRA186_BPMP_SOC_COMMON,
> > +};
> > +
> > +static const struct tegra_bpmp_soc tegra234_soc = {
> > +	TEGRA186_BPMP_SOC_COMMON,
> > +};
> > +
> > +static const struct tegra_bpmp_soc tegra238_soc = {
> > +	TEGRA186_BPMP_SOC_COMMON,
> > +};
> > +
> > +static const struct tegra_bpmp_soc tegra264_soc = {
> > +	TEGRA186_BPMP_SOC_COMMON,
> >  };
> >  #endif
> >  
> > @@ -1180,8 +1196,12 @@ static const struct of_device_id tegra_bpmp_match[] = {
> >  #if IS_ENABLED(CONFIG_ARCH_TEGRA_186_SOC) || \
> >      IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \
> >      IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC) || \
> > +    IS_ENABLED(CONFIG_ARCH_TEGRA_238_SOC) || \
> >      IS_ENABLED(CONFIG_ARCH_TEGRA_264_SOC)
> >  	{ .compatible = "nvidia,tegra186-bpmp", .data = &tegra186_soc },
> > +	{ .compatible = "nvidia,tegra234-bpmp", .data = &tegra234_soc },
> > +	{ .compatible = "nvidia,tegra238-bpmp", .data = &tegra238_soc },
> > +	{ .compatible = "nvidia,tegra264-bpmp", .data = &tegra264_soc },
> >  #endif
> >  #if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC)
> >  	{ .compatible = "nvidia,tegra210-bpmp", .data = &tegra210_soc },
> > -- 
> > 2.43.0
> > 
> > 
>
>
>
>

  reply	other threads:[~2026-11-02 11:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 15:49 [PATCH v2 0/4] Add Tegra238 BPMP support and fix stale EMC clock rate Johnny Liu
2026-10-28 15:49 ` [PATCH v2 1/4] dt-bindings: firmware: tegra186-bpmp: Add Tegra238 BPMP Johnny Liu
2026-10-29  8:56   ` Krzysztof Kozlowski
2026-10-28 15:49 ` [PATCH v2 2/4] firmware: tegra: bpmp: Add Tegra238 support Johnny Liu
2026-11-02  8:48   ` Mikko Perttunen
2026-11-02 11:32     ` Johnny Liu [this message]
2026-10-28 15:49 ` [PATCH v2 3/4] firmware: tegra: bpmp: Add per-SoC EMC clock ID Johnny Liu
2026-10-28 15:50 ` [PATCH v2 4/4] clk: tegra: bpmp: Do not cache the EMC clock rate Johnny Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261102113224.2404743-1-johnliu@nvidia.com \
    --to=johnliu@nvidia.com \
    --cc=anrao@nvidia.com \
    --cc=bmasney+clk@redhat.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=jbrunet+clk@baylibre.com \
    --cc=jonathanh@nvidia.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mperttunen@nvidia.com \
    --cc=pgaikwad@nvidia.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=thierry.reding@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®