[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211218130014.4037640-1-daniel.lezcano@linaro.org>
Date: Sat, 18 Dec 2021 14:00:08 +0100
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: daniel.lezcano@...aro.org, rjw@...ysocki.net
Cc: lukasz.luba@....com, robh@...nel.org, heiko@...ech.de,
arnd@...aro.org, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org, ulf.hansson@...aro.org
Subject: [PATCH v5 0/6] powercap/drivers/dtpm: Create the dtpm hierarchy
The DTPM hierarchy is the base to build on top of it a power budget
allocator. It reflects the power consumption of the group of devices
and allows to cap their power.
The core code is there but there is no way to describe the desired
hierarchy yet.
A first proposal introduced the description through configfs [1] but
was rejected [2].
A second proposal based on the device tree with a binding similar to
the power domains [3] was proposed but finally rejected [4].
This fifth version delegates the hierarchy creation to the SoC with a
specific and self-encapsulated code using an array to describe the tree. The
SoC DTPM driver defines an array of nodes pointing to their parents. The
hierarchy description can integrate a DT node and in the future a SCMI node,
that means the description can mix different type of nodes.
In addition to the hierarchy creation, the devfreq dtpm support is also
integrated into this series.
This series was tested on a rock960 (revision B - rk3399 based) and a
db845c (Qualcomm sdm845 based).
[1] https://lore.kernel.org/all/20210401183654.27214-1-daniel.lezcano@linaro.org/
[2] https://lore.kernel.org/all/YGYg6ZeZ1181%2FpXk@kroah.com/
[3] https://lore.kernel.org/all/20211205231558.779698-1-daniel.lezcano@linaro.org/
[4] https://lore.kernel.org/all/YbfFapsmsjs4qnsg@robh.at.kernel.org/
Changelog:
V5:
- Remove DT bindings
- Added description with an array
- Added simple description for rk3399 and sdm845
- Moved dtpm table to the data section
V4:
- Added missing powerzone-cells
- Changed powerzone name to comply with the pattern property
V3:
- Remove GPU section as no power is available (yet)
- Remove '#powerzone-cells' conforming to the bindings change
- Removed required property 'compatible'
- Removed powerzone-cells from the topmost node
- Removed powerzone-cells from cpus 'consumers' in example
- Set additionnal property to false
V2:
- Added pattern properties and stick to powerzone-*
- Added required property compatible and powerzone-cells
- Added additionnal property
- Added compatible
- Renamed to 'powerzones'
- Added missing powerzone-cells to the topmost node
- Fixed errors reported by 'make DT_CHECKER_FLAGS=-m dt_binding_check'
- Move description in the SoC dtsi specific file
- Fixed missing prototype warning reported by lkp@
V1: Initial post
Daniel Lezcano (6):
powercap/drivers/dtpm: Move dtpm table from init to data section
powercap/drivers/dtpm: Add hierarchy creation
powercap/drivers/dtpm: Add CPU DT initialization support
powercap/drivers/dtpm: Add dtpm devfreq with energy model support
rockchip/soc/drivers: Add DTPM description for rk3399
qcom/soc/drivers: Add DTPM description for sdm845
drivers/powercap/Kconfig | 8 ++
drivers/powercap/Makefile | 1 +
drivers/powercap/dtpm.c | 155 ++++++++++++++++++++++-
drivers/powercap/dtpm_cpu.c | 37 ++++--
drivers/powercap/dtpm_devfreq.c | 201 ++++++++++++++++++++++++++++++
drivers/soc/qcom/Kconfig | 9 ++
drivers/soc/qcom/Makefile | 1 +
drivers/soc/qcom/dtpm.c | 65 ++++++++++
drivers/soc/rockchip/Kconfig | 8 ++
drivers/soc/rockchip/Makefile | 1 +
drivers/soc/rockchip/dtpm.c | 56 +++++++++
include/asm-generic/vmlinux.lds.h | 4 +-
include/linux/dtpm.h | 21 +++-
13 files changed, 551 insertions(+), 16 deletions(-)
create mode 100644 drivers/powercap/dtpm_devfreq.c
create mode 100644 drivers/soc/qcom/dtpm.c
create mode 100644 drivers/soc/rockchip/dtpm.c
--
2.25.1
Powered by blists - more mailing lists