Skip to content

Introduce core voltage scaling for NVIDIA Tegra20/30 SoCs

Dmitry Osipenko dri-devel linux-clk linux-devicetree linux-media linux-tegra lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest48 patches 78 repliesIn review
  2. v130 patches 78 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/48dt-bindings: memory: tegra20: emc: Replace core regulator with power domainDocumentation/devicetree/bindings/memory-controllers/nvidia,tegra20-emc.txt+2 -21 reply
2/48dt-bindings: memory: tegra30: emc: Replace core regulator with power domainDocumentation/devicetree/bindings/memory-controllers/nvidia,tegra30-emc.yaml+3 -32 replies
3/48dt-bindings: memory: tegra124: emc: Replace core regulator with power domainDocumentation/devicetree/bindings/memory-controllers/nvidia,tegra124-emc.yaml+3 -30 replies
4/48dt-bindings: host1x: Document OPP and power domain propertiesDocumentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt+49 -01 reply
5/48media: dt: bindings: tegra-vde: Document OPP and power domain propertiesDocumentation/devicetree/bindings/media/nvidia,tegra-vde.txt+12 -01 reply
6/48dt-bindings: clock: tegra: Document clocks sub-nodeDocumentation/devicetree/bindings/clock/nvidia,tegra20-car.txt Documentation/devicetree/bindings/clock/nvidia,tegra30-car.txt+52 -02 replies
7/48dt-bindings: arm: tegra: Add binding for core power domainDocumentation/devicetree/bindings/arm/tegra/nvidia,tegra20-core-domain.yaml+48 -02 replies
8/48regulator: Make regulator_sync_voltage() usable by coupled regulatorsdrivers/regulator/core.c+6 -00 replies
9/48opp: Add dev_pm_opp_sync_regulators()drivers/opp/core.c include/linux/pm_opp.h+53 -01 reply
10/48opp: Add dev_pm_opp_set_voltage()drivers/opp/core.c include/linux/pm_opp.h+58 -51 reply
11/48opp: Add dev_pm_opp_find_level_ceil()drivers/opp/core.c include/linux/pm_opp.h+57 -010 replies
12/48opp: Add dev_pm_opp_get_required_pstate()drivers/opp/core.c include/linux/pm_opp.h+32 -00 replies
13/48opp: Add resource-managed versions of OPP API functionsdrivers/opp/core.c drivers/opp/of.c include/linux/pm_opp.h+249 -02 replies
14/48opp: Filter out OPPs based on availability of a required-OPPdrivers/opp/core.c+10 -14 replies
15/48opp: Support set_opp() customization without requiring to use regulatorsdrivers/opp/core.c+12 -46 replies
16/48opp: Handle missing OPP table in dev_pm_opp_xlate_performance_state()drivers/opp/core.c+1 -10 replies
17/48opp: Correct debug message in _opp_add_static_v2()drivers/opp/of.c+2 -20 replies
18/48opp: Print OPP level in debug message of _opp_add_static_v2()drivers/opp/of.c+3 -20 replies
19/48opp: Fix adding OPP entries in a wrong order if rate is unavailabledrivers/opp/core.c drivers/opp/opp.h+13 -126 replies
20/48PM: domains: Make set_performance_state() callback optionaldrivers/base/power/domain.c+5 -61 reply
21/48PM: domains: Add "performance" column to debug summarydrivers/base/power/domain.c+17 -52 replies
22/48soc/tegra: pmc: Fix imbalanced clock disabling in error code pathdrivers/soc/tegra/pmc.c+1 -10 replies
23/48soc/tegra: pmc: Pulse resets after removing power clampdrivers/soc/tegra/pmc.c+8 -01 reply
24/48soc/tegra: pmc: Ensure that clock rates aren't too highdrivers/soc/tegra/pmc.c+90 -20 replies
25/48soc/tegra: pmc: Print out domain name when reset fails to acquiredrivers/soc/tegra/pmc.c+2 -10 replies
26/48soc/tegra: Add devm_tegra_core_dev_init_opp_table()drivers/soc/tegra/common.c include/soc/tegra/common.h+172 -00 replies
27/48soc/tegra: Add CONFIG_SOC_TEGRA_COMMON and select PM_OPP by defaultdrivers/soc/tegra/Kconfig+13 -00 replies
28/48soc/tegra: Introduce core power domain driverdrivers/soc/tegra/Kconfig drivers/soc/tegra/Makefile drivers/soc/tegra/core-power-domain.c +1 more+138 -09 replies
29/48soc/tegra: pmc: Link domains to the parent Core domaindrivers/soc/tegra/pmc.c+19 -02 replies
30/48soc/tegra: regulators: Fix locking up when voltage-spread is out of rangedrivers/soc/tegra/regulators-tegra30.c+1 -10 replies
31/48soc/tegra: regulators: Support Core domain state syncingdrivers/soc/tegra/regulators-tegra20.c drivers/soc/tegra/regulators-tegra30.c+35 -21 reply
32/48clk: tegra: Support runtime PM, power domain and OPPdrivers/clk/tegra/Makefile drivers/clk/tegra/clk-device.c drivers/clk/tegra/clk-divider.c +13 more+568 -1640 replies
33/48gpu: host1x: Add host1x_channel_stop()drivers/gpu/host1x/channel.c include/linux/host1x.h+9 -00 replies
34/48gpu: host1x: Support power managementdrivers/gpu/host1x/dev.c+91 -113 replies
35/48drm/tegra: dc: Support OPP and SoC core voltage scalingdrivers/gpu/drm/tegra/dc.c+65 -11 reply
36/48drm/tegra: gr2d: Correct swapped device-tree compatiblesdrivers/gpu/drm/tegra/gr2d.c+2 -20 replies
37/48drm/tegra: gr2d: Support OPP and power managementdrivers/gpu/drm/tegra/gr2d.c+67 -60 replies
38/48drm/tegra: g3d: Support OPP and power managementdrivers/gpu/drm/tegra/gr3d.c+238 -260 replies
39/48drm/tegra: vic: Stop channel before suspendingdrivers/gpu/drm/tegra/vic.c+15 -00 replies
40/48media: staging: tegra-vde: Support OPP and generic power domaindrivers/staging/media/tegra-vde/vde.c+53 -100 replies
41/48memory: tegra20-emc: Use devm_tegra_core_dev_init_opp_table()drivers/memory/tegra/tegra20-emc.c+4 -532 replies
42/48memory: tegra30-emc: Use devm_tegra_core_dev_init_opp_table()drivers/memory/tegra/tegra30-emc.c+4 -530 replies
43/48ARM: tegra: Add OPP tables and power domains to Tegra20 device-treearch/arm/boot/dts/tegra20-acer-a500-picasso.dts arch/arm/boot/dts/tegra20-colibri.dtsi arch/arm/boot/dts/tegra20-harmony.dts +7 more+1241 -122 replies
44/48ARM: tegra: Add OPP tables and power domains to Tegra30 device-treearch/arm/boot/dts/tegra30-asus-nexus7-grouper-common.dtsi arch/arm/boot/dts/tegra30-beaver.dts arch/arm/boot/dts/tegra30-cardhu.dtsi +4 more+1816 -62 replies
45/48ARM: tegra: acer-a500: Enable core voltage scalingarch/arm/boot/dts/tegra20-acer-a500-picasso.dts+2 -20 replies
46/48ARM: tegra: ventana: Enable core voltage scalingarch/arm/boot/dts/tegra20-ventana.dts+24 -80 replies
47/48ARM: tegra: ventana: Support CPU voltage scaling and thermal throttlingarch/arm/boot/dts/tegra20-ventana.dts+39 -16 replies
48/48ARM: tegra: cardhu: Support CPU voltage scaling and thermal throttlingarch/arm/boot/dts/tegra30-cardhu.dtsi+60 -11 reply

Reviews trailers per patch

6 of 48 patches have a Reviewed-by or Acked-by.

PatchPeter GeisNicolas ChauvetRob HerringUlf Hansson
1/48R-b
2/48
3/48
4/48R-b
5/48R-b
6/48
7/48
8/48
9/48
10/48
11/48
12/48
13/48
14/48
15/48
16/48
17/48
18/48
19/48
20/48R-b
21/48R-b
22/48
23/48
24/48
25/48
26/48
27/48
28/48
29/48
30/48T-b
31/48R-b
32/48
33/48
34/48T-b T-b
35/48T-b T-b
36/48T-b T-b
37/48T-b T-b
38/48T-b T-b
39/48
40/48T-b T-b
41/48
42/48
43/48
44/48
45/48
46/48
47/48
48/48

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/48] Introduce core voltage scaling for NVIDIA Tegra20/30 SoCs

Introduce core voltage scaling for NVIDIA Tegra20/30 SoCs, which reduces power consumption and heating of the Tegra chips. Tegra SoC has multiple hardware units which belong to a core power domain of the SoC and share the core voltage. The voltage must be selected in accordance to a minimum requirement of every core hardware unit.

The minimum core voltage requirement depends on:

1. Clock enable state of a hardware unit.
2. Clock frequency.
3. Unit's internal idling/active state.

This series is tested on Acer A500 (T20), AC100 (T20), Nexus 7 (T30), Ouya (T30), TK1 (T124) and some others. I also added voltage scaling to the Ventana (T20) and Cardhu (T30) boards which are tested by NVIDIA's CI farm. Tegra30 is now couple degrees cooler on Nexus 7 and stays cool on Ouya (instead of becoming burning hot) while system is idling. It should be possible to improve this further by implementing a more advanced power management features for the kernel drivers.

The DVFS support is opt-in for all boards, meaning that older DTBs will continue to work like they did it before this series. It should be possible to easily add the core voltage scaling support for Tegra114+ SoCs based on this grounding work later on, if anyone will want to implement it.

Changelog:

v2: - Replaced Core voltage regulator with a Core power domain. The voltage
control is now done using GENPD API. This was suggested by Ulf Hansson.

- Added basic runtime PM and GENPD support to 2d, 3d, host1x and clk drivers.

- Added new core-power-domain and clk-device drivers. Some high-freq PLLs and clocks require a higher minimum core voltage and the new clk-device driver manages the voltage for these clocks based on the clock state.

- Moved voltage scaling entirely to the new clk-device driver for devices which don't require advanced power management, like PWM for example.

- Added devm_tegra_core_dev_init_opp_table() common helper which sets up OPP table for Tegra drivers.

- Added resource-managed version for OPP API functions, as it was discussed previously in the comments to v1.

- Added new APIs, features and fixed various bugs related to voltage scaling and power management done via GENPD API.

Dmitry Osipenko (48):
dt-bindings: memory: tegra20: emc: Replace core regulator with power
domain
dt-bindings: memory: tegra30: emc: Replace core regulator with power
domain
dt-bindings: memory: tegra124: emc: Replace core regulator with power
domain
dt-bindings: host1x: Document OPP and power domain properties
media: dt: bindings: tegra-vde: Document OPP and power domain
properties
dt-bindings: clock: tegra: Document clocks sub-node
dt-bindings: arm: tegra: Add binding for core power domain
regulator: Make regulator_sync_voltage() usable by coupled regulators
opp: Add dev_pm_opp_sync_regulators()
opp: Add dev_pm_opp_set_voltage()
opp: Add dev_pm_opp_find_level_ceil()
opp: Add dev_pm_opp_get_required_pstate()
opp: Add resource-managed versions of OPP API functions
opp: Filter out OPPs based on availability of a required-OPP
opp: Support set_opp() customization without requiring to use
regulators
opp: Handle missing OPP table in dev_pm_opp_xlate_performance_state()
opp: Correct debug message in _opp_add_static_v2()
opp: Print OPP level in debug message of _opp_add_static_v2()
opp: Fix adding OPP entries in a wrong order if rate is unavailable
PM: domains: Make set_performance_state() callback optional
PM: domains: Add "performance" column to debug summary soc/tegra: pmc: Fix imbalanced clock disabling in error code path soc/tegra: pmc: Pulse resets after removing power clamp soc/tegra: pmc: Ensure that clock rates aren't too high soc/tegra: pmc: Print out domain name when reset fails to acquire soc/tegra: Add devm_tegra_core_dev_init_opp_table() soc/tegra: Add CONFIG_SOC_TEGRA_COMMON and select PM_OPP by default soc/tegra: Introduce core power domain driver
soc/tegra: pmc: Link domains to the parent Core domain soc/tegra: regulators: Fix locking up when voltage-spread is out of
range
soc/tegra: regulators: Support Core domain state syncing
clk: tegra: Support runtime PM, power domain and OPP
gpu: host1x: Add host1x_channel_stop()
gpu: host1x: Support power management
drm/tegra: dc: Support OPP and SoC core voltage scaling drm/tegra: gr2d: Correct swapped device-tree compatibles drm/tegra: gr2d: Support OPP and power management drm/tegra: g3d: Support OPP and power management drm/tegra: vic: Stop channel before suspending
media: staging: tegra-vde: Support OPP and generic power domain
memory: tegra20-emc: Use devm_tegra_core_dev_init_opp_table()
memory: tegra30-emc: Use devm_tegra_core_dev_init_opp_table()
ARM: tegra: Add OPP tables and power domains to Tegra20 device-tree
ARM: tegra: Add OPP tables and power domains to Tegra30 device-tree
ARM: tegra: acer-a500: Enable core voltage scaling
ARM: tegra: ventana: Enable core voltage scaling
ARM: tegra: ventana: Support CPU voltage scaling and thermal
throttling
ARM: tegra: cardhu: Support CPU voltage scaling and thermal throttling

 .../arm/tegra/nvidia,tegra20-core-domain.yaml |   48 +
 .../bindings/clock/nvidia,tegra20-car.txt     |   26 +
 .../bindings/clock/nvidia,tegra30-car.txt     |   26 +
 .../display/tegra/nvidia,tegra20-host1x.txt   |   49 +
 .../bindings/media/nvidia,tegra-vde.txt       |   12 +
 .../nvidia,tegra124-emc.yaml                  |    6 +-
 .../memory-controllers/nvidia,tegra20-emc.txt |    4 +-
 .../nvidia,tegra30-emc.yaml                   |    6 +-
 .../boot/dts/tegra20-acer-a500-picasso.dts    |    8 +-
 arch/arm/boot/dts/tegra20-colibri.dtsi        |    6 +-
 arch/arm/boot/dts/tegra20-harmony.dts         |    6 +-
 arch/arm/boot/dts/tegra20-paz00.dts           |   46 +-
 .../arm/boot/dts/tegra20-peripherals-opp.dtsi |  941 +++++++++++
 arch/arm/boot/dts/tegra20-seaboard.dts        |    6 +-
 arch/arm/boot/dts/tegra20-tamonten.dtsi       |    6 +-
 arch/arm/boot/dts/tegra20-trimslice.dts       |   12 +
 arch/arm/boot/dts/tegra20-ventana.dts         |   78 +-
 arch/arm/boot/dts/tegra20.dtsi                |  220 +++
 .../tegra30-asus-nexus7-grouper-common.dtsi   |    4 +
 arch/arm/boot/dts/tegra30-beaver.dts          |    4 +
 arch/arm/boot/dts/tegra30-cardhu.dtsi         |   81 +-
 arch/arm/boot/dts/tegra30-colibri.dtsi        |   20 +-
 arch/arm/boot/dts/tegra30-ouya.dts            |    4 +
 .../arm/boot/dts/tegra30-peripherals-opp.dtsi | 1412 +++++++++++++++++
 arch/arm/boot/dts/tegra30.dtsi                |  358 +++++
 drivers/base/power/domain.c                   |   33 +-
 drivers/clk/tegra/Makefile                    |    1 +
 drivers/clk/tegra/clk-device.c                |  222 +++
 drivers/clk/tegra/clk-divider.c               |    2 +-
 drivers/clk/tegra/clk-periph-gate.c           |    2 +-
 drivers/clk/tegra/clk-periph.c                |    2 +-
 drivers/clk/tegra/clk-pll.c                   |    2 +-
 drivers/clk/tegra/clk-super.c                 |    4 +-
 drivers/clk/tegra/clk-tegra-periph.c          |  140 +-
 drivers/clk/tegra/clk-tegra114.c              |    1 +
 drivers/clk/tegra/clk-tegra124.c              |    1 +
 drivers/clk/tegra/clk-tegra20-emc.c           |    2 +-
 drivers/clk/tegra/clk-tegra20.c               |  123 +-
 drivers/clk/tegra/clk-tegra210.c              |    1 +
 drivers/clk/tegra/clk-tegra30.c               |  133 +-
 drivers/clk/tegra/clk.c                       |   89 ++
 drivers/clk/tegra/clk.h                       |    7 +
 drivers/gpu/drm/tegra/dc.c                    |   66 +-
 drivers/gpu/drm/tegra/gr2d.c                  |   77 +-
 drivers/gpu/drm/tegra/gr3d.c                  |  264 ++-
 drivers/gpu/drm/tegra/vic.c                   |   15 +
 drivers/gpu/host1x/channel.c                  |    8 +
 drivers/gpu/host1x/dev.c                      |  102 +-
 drivers/memory/tegra/tegra20-emc.c            |   57 +-
 drivers/memory/tegra/tegra30-emc.c            |   57 +-
 drivers/opp/core.c                            |  390 ++++-
 drivers/opp/of.c                              |   34 +-
 drivers/opp/opp.h                             |    2 +-
 drivers/regulator/core.c                      |    6 +
 drivers/soc/tegra/Kconfig                     |   19 +
 drivers/soc/tegra/Makefile                    |    1 +
 drivers/soc/tegra/common.c                    |  137 ++
 drivers/soc/tegra/core-power-domain.c         |  125 ++
 drivers/soc/tegra/pmc.c                       |  122 +-
 drivers/soc/tegra/regulators-tegra20.c        |   19 +-
 drivers/soc/tegra/regulators-tegra30.c        |   20 +-
 drivers/staging/media/tegra-vde/vde.c         |   63 +-
 include/linux/host1x.h                        |    1 +
 include/linux/pm_opp.h                        |   81 +
 include/soc/tegra/common.h                    |   41 +
 65 files changed, 5458 insertions(+), 403 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-core-domain.yaml
 create mode 100644 drivers/clk/tegra/clk-device.c
 create mode 100644 drivers/soc/tegra/core-power-domain.c
Signature · 1 line
2.29.2