From 9ded2ff78d13723a671b56135a60fe8193da8bcb Mon Sep 17 00:00:00 2001 From: Hanjie Lin Date: Thu, 31 Jan 2019 10:58:01 +0800 Subject: [PATCH] sched: eas: add sched-energy support for gxm [1/1] PD#SWPL-4651 Problem: Kernel 32bit Support for S912(kernel 4.9) Solution: add arm/arm64 sched-energy dts Verify: q201 Change-Id: I13077632b730d5f2b1427b3d9bee9ff24031cfcd Signed-off-by: Hanjie Lin --- .../boot/dts/amlogic/gxm-sched-energy.dtsi | 68 +++++++++++++++++++ arch/arm/boot/dts/amlogic/mesongxm.dtsi | 17 +++++ .../boot/dts/amlogic/gxm-sched-energy.dtsi | 68 +++++++++++++++++++ arch/arm64/boot/dts/amlogic/mesongxm.dtsi | 17 +++++ 4 files changed, 170 insertions(+) create mode 100644 arch/arm/boot/dts/amlogic/gxm-sched-energy.dtsi create mode 100644 arch/arm64/boot/dts/amlogic/gxm-sched-energy.dtsi diff --git a/arch/arm/boot/dts/amlogic/gxm-sched-energy.dtsi b/arch/arm/boot/dts/amlogic/gxm-sched-energy.dtsi new file mode 100644 index 000000000000..30fca0951f28 --- /dev/null +++ b/arch/arm/boot/dts/amlogic/gxm-sched-energy.dtsi @@ -0,0 +1,68 @@ +/ { + energy-costs { + CPU_COST_A53_HS: core-cost0 { + busy-cost-data = < + 33 4 + 83 23 + 166 41 + 221 54 + 332 78 + 399 92 + 503 135 + >; + idle-cost-data = < + 3 + 0 + 0 + >; + }; + + CPU_COST_A53: core-cost1 { + busy-cost-data = < + 33 4 + 83 23 + 166 41 + 221 54 + 332 78 + >; + idle-cost-data = < + 3 + 0 + 0 + >; + }; + + CLUSTER_COST_A53_HS: cluster-cost0 { + busy-cost-data = < + 33 7 + 83 8 + 166 9 + 221 10 + 332 13 + 399 15 + 503 23 + >; + idle-cost-data = < + 6 + 6 + 0 + >; + }; + + CLUSTER_COST_A53: cluster-cost1 { + busy-cost-data = < + 33 7 + 83 8 + 166 9 + 221 10 + 332 13 + >; + idle-cost-data = < + 6 + 6 + 0 + >; + }; + + }; +}; diff --git a/arch/arm/boot/dts/amlogic/mesongxm.dtsi b/arch/arm/boot/dts/amlogic/mesongxm.dtsi index 67cfe9ee38a2..37d28d35e718 100644 --- a/arch/arm/boot/dts/amlogic/mesongxm.dtsi +++ b/arch/arm/boot/dts/amlogic/mesongxm.dtsi @@ -26,6 +26,7 @@ #include #include #include "mesongxm-gpu-t82x.dtsi" +#include "gxm-sched-energy.dtsi" / { cpus:cpus { #address-cells = <1>; @@ -69,6 +70,8 @@ clocks = <&scpi_dvfs 0>; clock-names = "cpu-cluster.0"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53_HS + &CLUSTER_COST_A53_HS>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; @@ -83,6 +86,8 @@ clocks = <&scpi_dvfs 0>; clock-names = "cpu-cluster.0"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53_HS + &CLUSTER_COST_A53_HS>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; @@ -97,6 +102,8 @@ clocks = <&scpi_dvfs 0>; clock-names = "cpu-cluster.0"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53_HS + &CLUSTER_COST_A53_HS>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; @@ -111,6 +118,8 @@ clocks = <&scpi_dvfs 0>; clock-names = "cpu-cluster.0"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53_HS + &CLUSTER_COST_A53_HS>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; @@ -125,6 +134,8 @@ clocks = <&scpi_dvfs 1>; clock-names = "cpu-cluster.1"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53 + &CLUSTER_COST_A53>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; @@ -139,6 +150,8 @@ clocks = <&scpi_dvfs 1>; clock-names = "cpu-cluster.1"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53 + &CLUSTER_COST_A53>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; @@ -152,6 +165,8 @@ clocks = <&scpi_dvfs 1>; clock-names = "cpu-cluster.1"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53 + &CLUSTER_COST_A53>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; @@ -166,6 +181,8 @@ clocks = <&scpi_dvfs 1>; clock-names = "cpu-cluster.1"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53 + &CLUSTER_COST_A53>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; diff --git a/arch/arm64/boot/dts/amlogic/gxm-sched-energy.dtsi b/arch/arm64/boot/dts/amlogic/gxm-sched-energy.dtsi new file mode 100644 index 000000000000..30fca0951f28 --- /dev/null +++ b/arch/arm64/boot/dts/amlogic/gxm-sched-energy.dtsi @@ -0,0 +1,68 @@ +/ { + energy-costs { + CPU_COST_A53_HS: core-cost0 { + busy-cost-data = < + 33 4 + 83 23 + 166 41 + 221 54 + 332 78 + 399 92 + 503 135 + >; + idle-cost-data = < + 3 + 0 + 0 + >; + }; + + CPU_COST_A53: core-cost1 { + busy-cost-data = < + 33 4 + 83 23 + 166 41 + 221 54 + 332 78 + >; + idle-cost-data = < + 3 + 0 + 0 + >; + }; + + CLUSTER_COST_A53_HS: cluster-cost0 { + busy-cost-data = < + 33 7 + 83 8 + 166 9 + 221 10 + 332 13 + 399 15 + 503 23 + >; + idle-cost-data = < + 6 + 6 + 0 + >; + }; + + CLUSTER_COST_A53: cluster-cost1 { + busy-cost-data = < + 33 7 + 83 8 + 166 9 + 221 10 + 332 13 + >; + idle-cost-data = < + 6 + 6 + 0 + >; + }; + + }; +}; diff --git a/arch/arm64/boot/dts/amlogic/mesongxm.dtsi b/arch/arm64/boot/dts/amlogic/mesongxm.dtsi index 8b63ce521da2..92bd78b11daf 100644 --- a/arch/arm64/boot/dts/amlogic/mesongxm.dtsi +++ b/arch/arm64/boot/dts/amlogic/mesongxm.dtsi @@ -26,6 +26,7 @@ #include #include #include "mesongxm-gpu-t82x.dtsi" +#include "gxm-sched-energy.dtsi" / { cpus:cpus { #address-cells = <2>; @@ -69,6 +70,8 @@ clocks = <&scpi_dvfs 0>; clock-names = "cpu-cluster.0"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53_HS + &CLUSTER_COST_A53_HS>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; @@ -83,6 +86,8 @@ clocks = <&scpi_dvfs 0>; clock-names = "cpu-cluster.0"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53_HS + &CLUSTER_COST_A53_HS>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; @@ -97,6 +102,8 @@ clocks = <&scpi_dvfs 0>; clock-names = "cpu-cluster.0"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53_HS + &CLUSTER_COST_A53_HS>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; @@ -111,6 +118,8 @@ clocks = <&scpi_dvfs 0>; clock-names = "cpu-cluster.0"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53_HS + &CLUSTER_COST_A53_HS>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; @@ -125,6 +134,8 @@ clocks = <&scpi_dvfs 1>; clock-names = "cpu-cluster.1"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53 + &CLUSTER_COST_A53>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; @@ -139,6 +150,8 @@ clocks = <&scpi_dvfs 1>; clock-names = "cpu-cluster.1"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53 + &CLUSTER_COST_A53>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; @@ -152,6 +165,8 @@ clocks = <&scpi_dvfs 1>; clock-names = "cpu-cluster.1"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53 + &CLUSTER_COST_A53>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>; @@ -166,6 +181,8 @@ clocks = <&scpi_dvfs 1>; clock-names = "cpu-cluster.1"; cpu-idle-states = <&SYSTEM_SLEEP_0>; + sched-energy-costs = <&CPU_COST_A53 + &CLUSTER_COST_A53>; /* * cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0 * &SYSTEM_SLEEP_0>;