summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>2018-05-09 15:35:40 +0200
committerJakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>2018-05-14 16:31:14 +0200
commit2218a1c837a42d9eee5348111b5e7df2b6a8ee4f (patch)
tree1dff148aaa9622347538608ca00b93b631adec99
parent15cc2de21248025822bae7e3aafb0ab6cbbbb1ad (diff)
arm64: rockchip: rk3399-puma: enable memory frequency scaling
DDR memory frequency scaling is called DMC (dynamic memory controller) in the RK3399 SoC. Enable it in the DTS and in the defconfig. To improve the reaction time of the rockchip_dmc governor, CONFIG_HZ_PERIODIC is enabled, at the cost of a 3% idle power increase. I see worst case reaction times of tens of seconds without it, because devfreq_dmc_ondemand_func does not get to run. The upthreshold and downdifferential values in the DTS are more aggressive than what rockchip uses. This improves U-Boot make -j6 compile time by 8%. Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
-rw-r--r--arch/arm64/boot/dts/rockchip/rk3399-puma.dts30
-rw-r--r--arch/arm64/configs/puma-rk3399_defconfig3
2 files changed, 32 insertions, 1 deletions
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma.dts
index 6973e5d90c21..58f91de211cd 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dts
@@ -1010,6 +1010,36 @@
operating-points-v2 = <&gpu_opp_table>;
};
+/* DDR PHY Interface (DFI) for bus load monitoring*/
+&dfi {
+ status = "okay";
+};
+
+/* Dynamic Memory Controller */
&dmc {
operating-points-v2 = <&dmc_opp_table>;
+ status = "okay";
+ center-supply = <&vdd_center>;
+ upthreshold = <20>;
+ downdifferential = <10>;
+ system-status-freq = <
+ /*system status freq(KHz)*/
+ SYS_STATUS_NORMAL 800000
+ SYS_STATUS_REBOOT 528000
+ SYS_STATUS_SUSPEND 200000
+ SYS_STATUS_VIDEO_1080P 200000
+ SYS_STATUS_VIDEO_4K 600000
+ SYS_STATUS_VIDEO_4K_10B 800000
+ SYS_STATUS_PERFORMANCE 800000
+ SYS_STATUS_BOOST 400000
+ SYS_STATUS_DUALVIEW 600000
+ SYS_STATUS_ISP 600000
+ >;
+ vop-bw-dmc-freq = <
+ /* min_bw(MB/s) max_bw(MB/s) freq(KHz) */
+ 0 577 200000
+ 578 1701 300000
+ 1702 99999 400000
+ >;
+ auto-min-freq = <200000>;
};
diff --git a/arch/arm64/configs/puma-rk3399_defconfig b/arch/arm64/configs/puma-rk3399_defconfig
index 9a844fb79152..b2488aa77dfd 100644
--- a/arch/arm64/configs/puma-rk3399_defconfig
+++ b/arch/arm64/configs/puma-rk3399_defconfig
@@ -1,6 +1,7 @@
CONFIG_DEFAULT_HOSTNAME="localhost"
CONFIG_SYSVIPC=y
CONFIG_FHANDLE=y
+CONFIG_HZ_PERIODIC=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_TASKSTATS=y
@@ -487,10 +488,10 @@ CONFIG_MAILBOX=y
CONFIG_ROCKCHIP_IOMMU=y
CONFIG_ROCKCHIP_PM_DOMAINS=y
CONFIG_PM_DEVFREQ=y
-CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y
CONFIG_DEVFREQ_GOV_PERFORMANCE=y
CONFIG_DEVFREQ_GOV_POWERSAVE=y
CONFIG_DEVFREQ_GOV_USERSPACE=y
+CONFIG_ARM_ROCKCHIP_DMC_DEVFREQ=y
CONFIG_PM_DEVFREQ_EVENT=y
CONFIG_MEMORY=y
CONFIG_IIO=y