diff --git a/arch/arm64/boot/dts/rockchip/rk3566-radxa-zero-3w.dts b/arch/arm64/boot/dts/rockchip/rk3566-radxa-zero-3w.dts index b8d1921ee026e8..8ffed183761adb 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-radxa-zero-3w.dts +++ b/arch/arm64/boot/dts/rockchip/rk3566-radxa-zero-3w.dts @@ -177,7 +177,7 @@ regulator-name = "vdd_cpu"; regulator-min-microvolt = <712500>; regulator-max-microvolt = <1390000>; - regulator-init-microvolt = <900000>; + regulator-init-microvolt = <1000000>; regulator-ramp-delay = <2300>; fcs,suspend-voltage-selector = <1>; regulator-boot-on; diff --git a/arch/arm64/boot/dts/rockchip/rk3566-rock-3c.dts b/arch/arm64/boot/dts/rockchip/rk3566-rock-3c.dts index e8794d4316e6fe..c4a93bfe2d8978 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-rock-3c.dts +++ b/arch/arm64/boot/dts/rockchip/rk3566-rock-3c.dts @@ -274,7 +274,7 @@ regulator-name = "vdd_cpu"; regulator-min-microvolt = <712500>; regulator-max-microvolt = <1390000>; - regulator-init-microvolt = <900000>; + regulator-init-microvolt = <1000000>; regulator-ramp-delay = <2300>; fcs,suspend-voltage-selector = <1>; regulator-boot-on; diff --git a/arch/arm64/boot/dts/rockchip/rk3568.dtsi b/arch/arm64/boot/dts/rockchip/rk3568.dtsi index d2cbc29354a487..ee4f54ddcfeaa5 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi @@ -169,16 +169,19 @@ opp-408000000 { opp-hz = /bits/ 64 <408000000>; opp-microvolt = <850000 850000 1150000>; + opp-microvolt-L3 = <900000 900000 1150000>; clock-latency-ns = <40000>; }; opp-600000000 { opp-hz = /bits/ 64 <600000000>; opp-microvolt = <850000 850000 1150000>; + opp-microvolt-L3 = <900000 900000 1150000>; clock-latency-ns = <40000>; }; opp-816000000 { opp-hz = /bits/ 64 <816000000>; opp-microvolt = <850000 850000 1150000>; + opp-microvolt-L3 = <900000 900000 1150000>; clock-latency-ns = <40000>; opp-suspend; }; @@ -188,7 +191,7 @@ opp-microvolt-L0 = <900000 900000 1150000>; opp-microvolt-L1 = <850000 850000 1150000>; opp-microvolt-L2 = <850000 850000 1150000>; - opp-microvolt-L3 = <850000 850000 1150000>; + opp-microvolt-L3 = <900000 900000 1150000>; clock-latency-ns = <40000>; }; opp-1416000000 { @@ -197,7 +200,7 @@ opp-microvolt-L0 = <1025000 1025000 1150000>; opp-microvolt-L1 = <975000 975000 1150000>; opp-microvolt-L2 = <950000 950000 1150000>; - opp-microvolt-L3 = <925000 925000 1150000>; + opp-microvolt-L3 = <1000000 1000000 1150000>; clock-latency-ns = <40000>; }; opp-1608000000 { @@ -240,8 +243,8 @@ cpuinfo { compatible = "rockchip,cpuinfo"; - nvmem-cells = <&otp_id>, <&otp_cpu_version>, <&cpu_code>; - nvmem-cell-names = "id", "cpu-version", "cpu-code"; + nvmem-cells = <&otp_id>, <&otp_cpu_version>, <&cpu_code>, <&performance>; + nvmem-cell-names = "id", "cpu-version", "cpu-code", "performance"; }; display_subsystem: display-subsystem { @@ -1296,14 +1299,17 @@ opp-200000000 { opp-hz = /bits/ 64 <200000000>; opp-microvolt = <850000 850000 1000000>; + opp-microvolt-L3 = <900000 900000 1000000>; }; opp-300000000 { opp-hz = /bits/ 64 <300000000>; opp-microvolt = <850000 850000 1000000>; + opp-microvolt-L3 = <900000 900000 1000000>; }; opp-400000000 { opp-hz = /bits/ 64 <400000000>; opp-microvolt = <850000 850000 1000000>; + opp-microvolt-L3 = <900000 900000 1000000>; }; opp-600000000 { opp-hz = /bits/ 64 <600000000>; @@ -1553,6 +1559,7 @@ opp-microvolt-L0 = <900000>; opp-microvolt-L1 = <875000>; opp-microvolt-L2 = <875000>; + opp-microvolt-L3 = <900000>; }; opp-400000000 { opp-hz = /bits/ 64 <400000000>; @@ -2722,6 +2729,10 @@ core_pvtm:core-pvtm@2a { reg = <0x2a 0x2>; }; + performance:performance@22 { + reg = <0x22 0x1>; + bits = <0 4>; + }; cpu_tsadc_trim_l: cpu-tsadc-trim-l@2e { reg = <0x2e 0x1>; }; diff --git a/drivers/soc/rockchip/rockchip-cpuinfo.c b/drivers/soc/rockchip/rockchip-cpuinfo.c index 9eea6f32a57631..061695cb1ddbc7 100644 --- a/drivers/soc/rockchip/rockchip-cpuinfo.c +++ b/drivers/soc/rockchip/rockchip-cpuinfo.c @@ -23,6 +23,7 @@ unsigned long rockchip_soc_id; EXPORT_SYMBOL(rockchip_soc_id); +extern u32 soc_is_rk3566t; static int rockchip_cpuinfo_probe(struct platform_device *pdev) { @@ -91,6 +92,18 @@ static int rockchip_cpuinfo_probe(struct platform_device *pdev) system_serial_high, system_serial_low); #endif + cell = nvmem_cell_get(dev, "performance"); + if (!IS_ERR(cell)) { + efuse_buf = nvmem_cell_read(cell, &len); + nvmem_cell_put(cell); + if (IS_ERR(efuse_buf)) + return PTR_ERR(efuse_buf); + + soc_is_rk3566t = efuse_buf[0]; + dev_info(dev, "soc_is_rk3566t: %08x\n", soc_is_rk3566t); + kfree(efuse_buf); + } + return 0; } diff --git a/drivers/soc/rockchip/rockchip_opp_select.c b/drivers/soc/rockchip/rockchip_opp_select.c index 82559daad5fb1b..551558da85d2eb 100644 --- a/drivers/soc/rockchip/rockchip_opp_select.c +++ b/drivers/soc/rockchip/rockchip_opp_select.c @@ -82,6 +82,7 @@ struct otp_opp_info { static int pvtm_value[PVTM_CH_MAX][PVTM_SUB_CH_MAX]; static int lkg_version; +u32 soc_is_rk3566t; /* * temp = temp * 10 @@ -1322,6 +1323,9 @@ void rockchip_get_scale_volt_sel(struct device *dev, char *lkg_name, *volt_sel = bin_volt_sel; else *volt_sel = max(lkg_volt_sel, pvtm_volt_sel); + + if (soc_is_rk3566t) + *volt_sel = 3; } of_node_put(np); @@ -1605,6 +1609,21 @@ int rockchip_adjust_power_scale(struct device *dev, int scale) out_np: of_node_put(np); + if (soc_is_rk3566t) { + if (!strcmp(dev_name(dev), "cpu0")) { + dev_pm_opp_remove(dev, 1608000000); + dev_pm_opp_remove(dev, 1800000000); + dev_pm_opp_remove(dev, 1992000000); + } + if (!strcmp(dev_name(dev), "fde60000.gpu")) { + dev_pm_opp_remove(dev, 600000000); + dev_pm_opp_remove(dev, 700000000); + } + if (!strcmp(dev_name(dev), "fdf40000.rkvenc")) { + dev_pm_opp_remove(dev, 400000000); + } + } + return ret; } EXPORT_SYMBOL(rockchip_adjust_power_scale);