This series patches supported the mail in devicetree and used the thermal IPA by default.
Verified with kernel is based on Linus's master branch and Heiko's v4.14-armsoc-tmp/dts64 branch. ( The Linux version 4.12.0 for now).
The most rockchip SoCs will be supported with IPA mode for thermal in later.
---
History version: 1. The first version found on https://www.spinics.net/lists/arm-kernel/msg593118.html
Tested on Kevin board with bringing up ChromeOS. OS VERSION: CHROMEOS_RELEASE_DESCRIPTION=9693.1.0 (Official Build) dev-channel kevin test
BIOS VERSION: Google_Kevin.8785.211.2017_06_20_1043
EC VERSION: Build info: kevin_v1.10.217-24514961d 2017-07-03 07:46:36 wxt@nb
With the ARM's lastest mali driver TX011-SW-99002-r18p0-01rel0 on https://developer.arm.com/products/software/mali-drivers/midgard-kernel
From the bootup log:
localhost devfreq0 # dmesg |grep mali [ 0.933334] mali ff9a0000.gpu: GPU identified as 0x0860 r2p0 status 0 [ 0.940830] mali ff9a0000.gpu: Protected mode not available [ 0.947334] mali ff9a0000.gpu: Using configured power model mali-simple-power-model, and fallback mali-simple-power-model [ 0.960083] mali ff9a0000.gpu: Probed as mali0
localhost devfreq0 # pwd /sys/devices/platform/ff9a0000.gpu/devfreq/devfreq0 localhost devfreq0 # ls available_frequencies device min_freq subsystem uevent available_governors governor polling_interval target_freq userspace cur_freq max_freq power trans_stat
localhost ff9a0000.gpu # ls core_availability_policy gpuinfo modalias soft_job_timeout core_mask js_scheduling_period of_node subsystem devfreq js_timeouts pm_poweroff uevent driver mem_pool_max_size power driver_override mem_pool_size power_policy dvfs_period misc reset_timeout ---
And for thermal with IPA. Try to run 'md5sum /dev/zero &' and octane/benchmark scripts to go up the temperature.
From the scripts to have a look at the actual control.
" while true; do grep "" /sys/class/thermal/thermal_zone[0-1]/temp /sys/devices/system/cpu/cpu[0-5]/cpufreq/scaling_cur_freq /sys/devices/platform/ff9a0000.gpu/devfreq/devfreq0/cur_freq;date;sleep .5; done & "
-Caesar
Changes in v2: As Heiko comments on https://patchwork.kernel.org/patch/9835939/ - interrupt-name use the lower case. - use the correct compatible "arm,mali-t860" - remove the clock name, since the mali only have one input clock. - foo@ will produce warnings when used without reg property. - update the commit to explain the two passive trip points changed.
Caesar Wang (5): dt-bindings: gpu: add the RK3399 mali for rockchip specifics dt-bindings: gpu: add a power_model optional properties for MALI arm64: dts: rockchip: add ARM Mali GPU node for RK3399 SoCs arm64: dts: rockchip: enable the GPU for RK3399-GRU arm64: dts: rockchip: update the thermal zones for RK3399 SoCs
.../devicetree/bindings/gpu/arm,mali-midgard.txt | 13 ++++ arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 5 ++ arch/arm64/boot/dts/rockchip/rk3399-op1-opp.dtsi | 33 ++++++++++ arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi | 33 ++++++++++ arch/arm64/boot/dts/rockchip/rk3399.dtsi | 74 ++++++++++++---------- 5 files changed, 125 insertions(+), 33 deletions(-)
RK3399's GPU uses the quad-core Mali-T860, which is the new generation of high-end graphics processors from ARM.
This patch added "rockchip,rk3399-mali" for dt-bindings, in order to support IPA of gpu thermal in later.
Signed-off-by: Caesar Wang wxt@rock-chips.com ---
Changes in v2: None
Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt | 1 + 1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt index d3b6e1a4..a461e47 100644 --- a/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt +++ b/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt @@ -17,6 +17,7 @@ Required properties: * which must be preceded by one of the following vendor specifics: + "amlogic,meson-gxm-mali" + "rockchip,rk3288-mali" + + "rockchip,rk3399-mali"
- reg : Physical base address of the device and length of the register area.
On Mon, Jul 17, 2017 at 04:14:27PM +0800, Caesar Wang wrote:
RK3399's GPU uses the quad-core Mali-T860, which is the new generation of high-end graphics processors from ARM.
This patch added "rockchip,rk3399-mali" for dt-bindings, in order to support IPA of gpu thermal in later.
Signed-off-by: Caesar Wang wxt@rock-chips.com
Changes in v2: None
Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt | 1 + 1 file changed, 1 insertion(+)
Acked-by: Rob Herring robh@kernel.org
Am Montag, 17. Juli 2017, 16:14:27 CEST schrieb Caesar Wang:
RK3399's GPU uses the quad-core Mali-T860, which is the new generation of high-end graphics processors from ARM.
This patch added "rockchip,rk3399-mali" for dt-bindings, in order to support IPA of gpu thermal in later.
Signed-off-by: Caesar Wang wxt@rock-chips.com
applied for 4.14 with Rob's Ack
Heiko
This patch adds the MALI's power-model to set the IPA model to be used for power management.
Signed-off-by: Caesar Wang wxt@rock-chips.com ---
Changes in v2: None
Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt index a461e47..b616e6b 100644 --- a/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt +++ b/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt @@ -37,6 +37,18 @@ Optional properties: - operating-points-v2 : Refer to Documentation/devicetree/bindings/power/opp.txt for details.
+- power_model : Sets power model parameters. Note that this model was designed for the Juno + platform, and may not be suitable for other platforms. A structure containing : + - compatible: Should be arm,mali-simple-power-model + - dynamic-coefficient: Coefficient, in pW/(Hz V^2), which is multiplied + by v^2*f to calculate the dynamic power consumption. + - static-coefficient: Coefficient, in uW/V^3, which is multiplied by + v^3 to calculate the static power consumption. + - ts: An array containing coefficients for the temperature scaling + factor. This is used to scale the static power by a factor of + tsf/1000000, where tsf = ts[3]*T^3 + ts[2]*T^2 + ts[1]*T + ts[0], + and T = temperature in degrees. + - thermal-zone: A string identifying the thermal zone used for the GPU
Example for a Mali-T760:
On Mon, Jul 17, 2017 at 04:14:28PM +0800, Caesar Wang wrote:
This patch adds the MALI's power-model to set the IPA model to be used for power management.
What's IPA? India Pale Ale or Intermediate Physical Address?
Signed-off-by: Caesar Wang wxt@rock-chips.com
Changes in v2: None
Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt index a461e47..b616e6b 100644 --- a/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt +++ b/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt @@ -37,6 +37,18 @@ Optional properties:
- operating-points-v2 : Refer to Documentation/devicetree/bindings/power/opp.txt for details.
+- power_model : Sets power model parameters. Note that this model was designed for the Juno
platform, and may not be suitable for other platforms. A structure containing :
- compatible: Should be arm,mali-simple-power-model
- dynamic-coefficient: Coefficient, in pW/(Hz V^2), which is multiplied
by v^2*f to calculate the dynamic power consumption.
- static-coefficient: Coefficient, in uW/V^3, which is multiplied by
v^3 to calculate the static power consumption.
- ts: An array containing coefficients for the temperature scaling
factor. This is used to scale the static power by a factor of
tsf/1000000, where tsf = ts[3]*T^3 + ts[2]*T^2 + ts[1]*T + ts[0],
and T = temperature in degrees.
- thermal-zone: A string identifying the thermal zone used for the GPU
This can all easily be implied by the compatible string. I'm not inclined to accept something Mali specific here.
This looks *very* precise, but I'd be surprised if these values are any more than magic values (at least the dynamic coef) adjusted until the desired power/performance requirements are achieved. To put it another way, why don't we have similar values for CPUs?
Rob
Rob,
在 2017年07月18日 04:07, Rob Herring 写道:
On Mon, Jul 17, 2017 at 04:14:28PM +0800, Caesar Wang wrote:
This patch adds the MALI's power-model to set the IPA model to be used for power management.
What's IPA? India Pale Ale or Intermediate Physical Address?
IPA is intelligent Power Allocator. (As the ARM introduced on https://developer.arm.com/open-source/intelligent-power-allocation)
Signed-off-by: Caesar Wang wxt@rock-chips.com
Changes in v2: None
Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt index a461e47..b616e6b 100644 --- a/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt +++ b/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt @@ -37,6 +37,18 @@ Optional properties:
- operating-points-v2 : Refer to Documentation/devicetree/bindings/power/opp.txt for details.
+- power_model : Sets power model parameters. Note that this model was designed for the Juno
platform, and may not be suitable for other platforms. A structure containing :
- compatible: Should be arm,mali-simple-power-model
- dynamic-coefficient: Coefficient, in pW/(Hz V^2), which is multiplied
by v^2*f to calculate the dynamic power consumption.
- static-coefficient: Coefficient, in uW/V^3, which is multiplied by
v^3 to calculate the static power consumption.
- ts: An array containing coefficients for the temperature scaling
factor. This is used to scale the static power by a factor of
tsf/1000000, where tsf = ts[3]*T^3 + ts[2]*T^2 + ts[1]*T + ts[0],
and T = temperature in degrees.
- thermal-zone: A string identifying the thermal zone used for the GPU
This can all easily be implied by the compatible string. I'm not inclined to accept something Mali specific here.
Isn't arm,mali-midgard.txt document suit for Mali specific? :-)
This looks *very* precise, but I'd be surprised if these values are any more than magic values (at least the dynamic coef) adjusted until the desired power/performance requirements are achieved. To put it another way, why don't we have similar values for CPUs?
These value was calculated by running full GPU process.
CPU had the similar value for dtsi.
Say: arch/arm64/boot/dts/rockchip/rk3399.dtsi cpu_b0: cpu@100 { ... dynamic-power-coefficient = <436>; ... };
-Caesar
Rob
On Tue, Jul 18, 2017 at 08:58:50AM +0800, Caesar Wang wrote:
Rob,
在 2017年07月18日 04:07, Rob Herring 写道:
On Mon, Jul 17, 2017 at 04:14:28PM +0800, Caesar Wang wrote:
This patch adds the MALI's power-model to set the IPA model to be used for power management.
What's IPA? India Pale Ale or Intermediate Physical Address?
IPA is intelligent Power Allocator. (As the ARM introduced on https://developer.arm.com/open-source/intelligent-power-allocation)
Signed-off-by: Caesar Wang wxt@rock-chips.com
Changes in v2: None
Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt b/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt index a461e47..b616e6b 100644 --- a/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt +++ b/Documentation/devicetree/bindings/gpu/arm,mali-midgard.txt @@ -37,6 +37,18 @@ Optional properties:
- operating-points-v2 : Refer to Documentation/devicetree/bindings/power/opp.txt for details.
+- power_model : Sets power model parameters. Note that this model was designed for the Juno
platform, and may not be suitable for other platforms. A structure containing :
- compatible: Should be arm,mali-simple-power-model
- dynamic-coefficient: Coefficient, in pW/(Hz V^2), which is multiplied
by v^2*f to calculate the dynamic power consumption.
- static-coefficient: Coefficient, in uW/V^3, which is multiplied by
v^3 to calculate the static power consumption.
- ts: An array containing coefficients for the temperature scaling
factor. This is used to scale the static power by a factor of
tsf/1000000, where tsf = ts[3]*T^3 + ts[2]*T^2 + ts[1]*T + ts[0],
and T = temperature in degrees.
- thermal-zone: A string identifying the thermal zone used for the GPU
This can all easily be implied by the compatible string. I'm not inclined to accept something Mali specific here.
Isn't arm,mali-midgard.txt document suit for Mali specific? :-)
It is, but I'm saying we shouldn't have something Mali specific here. It should be something that works across different GPUs at least. IOW, get some agreement with say adreno folks that these properties are useful and I'll be more receptive.
This looks *very* precise, but I'd be surprised if these values are any more than magic values (at least the dynamic coef) adjusted until the desired power/performance requirements are achieved. To put it another way, why don't we have similar values for CPUs?
These value was calculated by running full GPU process.
CPU had the similar value for dtsi.
Say: arch/arm64/boot/dts/rockchip/rk3399.dtsi cpu_b0: cpu@100 { ... dynamic-power-coefficient = <436>; ... };
Indeed. While it is documented for ARM CPUs, I don't see that it is widely used as only the hi6220 dts defines it. So either support for platforms is just missing, or upstream is not really using this property.
And if we are going to use this, then it needs to be documented in a common location and moved out of arm/cpus.txt.
Rob
Hi Rob & Heiko,
Do we have the chance to merge these patches?
I'm try to bring up the display and run webgl for testing with my github on https://github.com/Caesar-github/rockchip/commits/gru/next-stable-chromeos
I believe the Rocky@RK will post patches to support the other SoCs after.
-Caesar
在 2017年07月17日 16:14, Caesar Wang 写道:
This series patches supported the mail in devicetree and used the thermal IPA by default.
Verified with kernel is based on Linus's master branch and Heiko's v4.14-armsoc-tmp/dts64 branch. ( The Linux version 4.12.0 for now).
The most rockchip SoCs will be supported with IPA mode for thermal in later.
History version:
- The first version found on
https://www.spinics.net/lists/arm-kernel/msg593118.html
Tested on Kevin board with bringing up ChromeOS. OS VERSION: CHROMEOS_RELEASE_DESCRIPTION=9693.1.0 (Official Build) dev-channel kevin test
BIOS VERSION: Google_Kevin.8785.211.2017_06_20_1043
EC VERSION: Build info: kevin_v1.10.217-24514961d 2017-07-03 07:46:36 wxt@nb
With the ARM's lastest mali driver TX011-SW-99002-r18p0-01rel0 on https://developer.arm.com/products/software/mali-drivers/midgard-kernel
From the bootup log: localhost devfreq0 # dmesg |grep mali [ 0.933334] mali ff9a0000.gpu: GPU identified as 0x0860 r2p0 status 0 [ 0.940830] mali ff9a0000.gpu: Protected mode not available [ 0.947334] mali ff9a0000.gpu: Using configured power model mali-simple-power-model, and fallback mali-simple-power-model [ 0.960083] mali ff9a0000.gpu: Probed as mali0
localhost devfreq0 # pwd /sys/devices/platform/ff9a0000.gpu/devfreq/devfreq0 localhost devfreq0 # ls available_frequencies device min_freq subsystem uevent available_governors governor polling_interval target_freq userspace cur_freq max_freq power trans_stat localhost ff9a0000.gpu # ls core_availability_policy gpuinfo modalias soft_job_timeout core_mask js_scheduling_period of_node subsystem devfreq js_timeouts pm_poweroff uevent driver mem_pool_max_size power driver_override mem_pool_size power_policy dvfs_period misc reset_timeout
And for thermal with IPA. Try to run 'md5sum /dev/zero &' and octane/benchmark scripts to go up the temperature. From the scripts to have a look at the actual control. " while true; do grep "" /sys/class/thermal/thermal_zone[0-1]/temp /sys/devices/system/cpu/cpu[0-5]/cpufreq/scaling_cur_freq /sys/devices/platform/ff9a0000.gpu/devfreq/devfreq0/cur_freq;date;sleep .5; done & "
-Caesar
Changes in v2: As Heiko comments on https://patchwork.kernel.org/patch/9835939/
- interrupt-name use the lower case.
- use the correct compatible "arm,mali-t860"
- remove the clock name, since the mali only have one input clock.
- foo@ will produce warnings when used without reg property.
- update the commit to explain the two passive trip points changed.
Caesar Wang (5): dt-bindings: gpu: add the RK3399 mali for rockchip specifics dt-bindings: gpu: add a power_model optional properties for MALI arm64: dts: rockchip: add ARM Mali GPU node for RK3399 SoCs arm64: dts: rockchip: enable the GPU for RK3399-GRU arm64: dts: rockchip: update the thermal zones for RK3399 SoCs
.../devicetree/bindings/gpu/arm,mali-midgard.txt | 13 ++++ arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 5 ++ arch/arm64/boot/dts/rockchip/rk3399-op1-opp.dtsi | 33 ++++++++++ arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi | 33 ++++++++++ arch/arm64/boot/dts/rockchip/rk3399.dtsi | 74 ++++++++++++---------- 5 files changed, 125 insertions(+), 33 deletions(-)
Am Mittwoch, 19. Juli 2017, 17:06:59 CEST schrieb Caesar Wang:
Hi Rob & Heiko,
Do we have the chance to merge these patches?
From the mali-thermal thingy, it doesn't look like Rob likes that IPA stuff.
So I'll most likely pick the other patches that rely on approved bindings after I return from my vacation and leave the thermal issue until it can be resolved.
Heiko
I'm try to bring up the display and run webgl for testing with my github on https://github.com/Caesar-github/rockchip/commits/gru/next-stable-chromeos
I believe the Rocky@RK will post patches to support the other SoCs after.
-Caesar
在 2017年07月17日 16:14, Caesar Wang 写道:
This series patches supported the mail in devicetree and used the thermal IPA by default.
Verified with kernel is based on Linus's master branch and Heiko's v4.14-armsoc-tmp/dts64 branch. ( The Linux version 4.12.0 for now).
The most rockchip SoCs will be supported with IPA mode for thermal in later.
History version:
- The first version found on
https://www.spinics.net/lists/arm-kernel/msg593118.html
Tested on Kevin board with bringing up ChromeOS. OS VERSION: CHROMEOS_RELEASE_DESCRIPTION=9693.1.0 (Official Build) dev-channel kevin test
BIOS VERSION: Google_Kevin.8785.211.2017_06_20_1043
EC VERSION: Build info: kevin_v1.10.217-24514961d 2017-07-03 07:46:36 wxt@nb
With the ARM's lastest mali driver TX011-SW-99002-r18p0-01rel0 on https://developer.arm.com/products/software/mali-drivers/midgard-kernel
From the bootup log: localhost devfreq0 # dmesg |grep mali [ 0.933334] mali ff9a0000.gpu: GPU identified as 0x0860 r2p0 status 0 [ 0.940830] mali ff9a0000.gpu: Protected mode not available [ 0.947334] mali ff9a0000.gpu: Using configured power model mali-simple-power-model, and fallback mali-simple-power-model [ 0.960083] mali ff9a0000.gpu: Probed as mali0
localhost devfreq0 # pwd /sys/devices/platform/ff9a0000.gpu/devfreq/devfreq0 localhost devfreq0 # ls available_frequencies device min_freq subsystem uevent available_governors governor polling_interval target_freq userspace cur_freq max_freq power trans_stat localhost ff9a0000.gpu # ls core_availability_policy gpuinfo modalias soft_job_timeout core_mask js_scheduling_period of_node subsystem devfreq js_timeouts pm_poweroff uevent driver mem_pool_max_size power driver_override mem_pool_size power_policy dvfs_period misc reset_timeout
And for thermal with IPA. Try to run 'md5sum /dev/zero &' and octane/benchmark scripts to go up the temperature. From the scripts to have a look at the actual control. " while true; do grep "" /sys/class/thermal/thermal_zone[0-1]/temp /sys/devices/system/cpu/cpu[0-5]/cpufreq/scaling_cur_freq /sys/devices/platform/ff9a0000.gpu/devfreq/devfreq0/cur_freq;date;sleep .5; done & "
-Caesar
Changes in v2: As Heiko comments on https://patchwork.kernel.org/patch/9835939/
- interrupt-name use the lower case.
- use the correct compatible "arm,mali-t860"
- remove the clock name, since the mali only have one input clock.
- foo@ will produce warnings when used without reg property.
- update the commit to explain the two passive trip points changed.
Caesar Wang (5): dt-bindings: gpu: add the RK3399 mali for rockchip specifics dt-bindings: gpu: add a power_model optional properties for MALI arm64: dts: rockchip: add ARM Mali GPU node for RK3399 SoCs arm64: dts: rockchip: enable the GPU for RK3399-GRU arm64: dts: rockchip: update the thermal zones for RK3399 SoCs
.../devicetree/bindings/gpu/arm,mali-midgard.txt | 13 ++++ arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 5 ++ arch/arm64/boot/dts/rockchip/rk3399-op1-opp.dtsi | 33 ++++++++++ arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi | 33 ++++++++++ arch/arm64/boot/dts/rockchip/rk3399.dtsi | 74 ++++++++++++---------- 5 files changed, 125 insertions(+), 33 deletions(-)
dri-devel@lists.freedesktop.org