Skip to content

Add Tegra238 BPMP support and fix stale EMC clock rate

Johnny Liu linux-clk linux-devicetree linux-tegra lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 4 repliesIn review
  2. v24 patches 3 repliesSuperseded
  3. v15 patches 4 repliesSuperseded

Changes in v3 from the cover letter

- Move the TEGRA186_BPMP_SOC_COMMON refactoring out of the Tegra238 support patch and into the "Add per-SoC EMC clock ID" patch, as the refactoring only makes sense together with the per-SoC emc_clk_id.
- Keep all Tegra238 specific changes (Makefile, CONFIG_ARCH_TEGRA_238_SOC guards, clock ID header include, tegra238_soc data and compatible match) in a single "Add Tegra238 support" patch, and reorder it after the per-SoC EMC clock ID patch.
- Reword the "Add per-SoC EMC clock ID" commit message to describe the intended use of emc_clk_id: the BPMP clock provider sets CLK_GET_RATE_NOCACHE on that clock, as it is completely managed by the firmware and the common clock framework must pass rate queries through to get the latest rate.
- No changes to patches 1 and 4 apart from the patch numbering.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4dt-bindings: firmware: tegra186-bpmp: Add Tegra238 BPMPDocumentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml include/dt-bindings/clock/nvidia,tegra238.h+280 -01 reply
2/4firmware: tegra: bpmp: Add per-SoC EMC clock IDdrivers/firmware/tegra/bpmp.c include/soc/tegra/bpmp.h+36 -170 replies
3/4firmware: tegra: bpmp: Add Tegra238 supportdrivers/firmware/tegra/Makefile drivers/firmware/tegra/bpmp.c+10 -00 replies
4/4clk: tegra: bpmp: Do not cache the EMC clock ratedrivers/clk/tegra/clk-bpmp.c+3 -01 reply

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMikko PerttunenBrian Masney
SeriesR-b
1/4
2/4
3/4
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/4] Add Tegra238 BPMP support and fix stale EMC clock rate

EMC clock scaling is handled by the BPMP firmware without kernel involvement, so clk_get_rate() on the EMC clock can return a stale value cached by the common clock framework. This series makes the EMC clock rate uncached on Tegra234, Tegra238 and Tegra264, and adds the pieces needed to identify the EMC clock on each of these chips.

The EMC clock ID differs per chip (TEGRA234_CLK_EMC=31, TEGRA238_CLK_EMC=43, TEGRA264_CLK_EMC=290), while the "nvidia,tegra186-bpmp" fallback compatible and the tegra186_soc data are shared across several chips. To avoid detecting the chip at runtime, the EMC clock ID is carried in per-SoC BPMP data selected by the device tree compatible.

Patch 1 adds the "nvidia,tegra238-bpmp" compatible to the binding, together with the Tegra238 clock ID header. Patch 2 adds an emc_clk_id field to struct tegra_bpmp_soc, together with dedicated SoC data for Tegra234 and Tegra264 built on a common TEGRA186_BPMP_SOC_COMMON initializer. Patch 3 adds Tegra238 support to the BPMP driver, including its own SoC data and EMC clock ID. Patch 4 then sets CLK_GET_RATE_NOCACHE on the clock matching that ID, so that the common clock framework forwards rate queries to the BPMP instead of returning a stale cached rate.

The series touches both the clock and the firmware code. Patch 4 depends on patch 2, and patch 3 depends on patches 1 and 2, so I would suggest taking the whole series through the Tegra tree with an Acked-by from the clock maintainers.

Changes in v3:
- Move the TEGRA186_BPMP_SOC_COMMON refactoring out of the Tegra238 support patch and into the "Add per-SoC EMC clock ID" patch, as the refactoring only makes sense together with the per-SoC emc_clk_id.
- Keep all Tegra238 specific changes (Makefile, CONFIG_ARCH_TEGRA_238_SOC guards, clock ID header include, tegra238_soc data and compatible match) in a single "Add Tegra238 support" patch, and reorder it after the per-SoC EMC clock ID patch.
- Reword the "Add per-SoC EMC clock ID" commit message to describe the intended use of emc_clk_id: the BPMP clock provider sets CLK_GET_RATE_NOCACHE on that clock, as it is completely managed by the firmware and the common clock framework must pass rate queries through to get the latest rate.
- No changes to patches 1 and 4 apart from the patch numbering.

Changes in v2:
- Squash "dt-bindings: clock: Add Tegra238 BPMP clock IDs" into "dt-bindings: firmware: tegra186-bpmp: Add Tegra238 compatible".
- Reword the binding commit message to state that the Tegra238 SoC is fully compatible with the Tegra186 BPMP.

v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/

Johnny Liu (4):
dt-bindings: firmware: tegra186-bpmp: Add Tegra238 BPMP
firmware: tegra: bpmp: Add per-SoC EMC clock ID
firmware: tegra: bpmp: Add Tegra238 support
clk: tegra: bpmp: Do not cache the EMC clock rate

 .../firmware/nvidia,tegra186-bpmp.yaml        |   1 +
 drivers/clk/tegra/clk-bpmp.c                  |   3 +
 drivers/firmware/tegra/Makefile               |   1 +
 drivers/firmware/tegra/bpmp.c                 |  61 ++--
 include/dt-bindings/clock/nvidia,tegra238.h   | 279 ++++++++++++++++++
 include/soc/tegra/bpmp.h                      |   1 +
 6 files changed, 329 insertions(+), 17 deletions(-)
 create mode 100644 include/dt-bindings/clock/nvidia,tegra238.h
Signature · 1 line
2.43.0