mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00

RK3528 is a cost down SoC with high CPU performance. However, it has poor PCIe performance (same for RK3576). Also CPU 0/1 can't get any rest due to rkbin limitation. Some code references: https://github.com/warpme/minimyth2
62 lines
1.7 KiB
Diff
62 lines
1.7 KiB
Diff
From 54d4b6b3014f3122a2235533e6511b0d6ca2cd45 Mon Sep 17 00:00:00 2001
|
|
From: Finley Xiao <finley.xiao@rock-chips.com>
|
|
Date: Wed, 12 Oct 2022 19:25:38 +0800
|
|
Subject: [PATCH] soc: rockchip: power-domain: Add always on configuration for
|
|
power domain
|
|
|
|
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
|
|
Change-Id: Ic57f7f3a564f7d71b680e3c435d0460474b5a4a0
|
|
---
|
|
drivers/soc/rockchip/pm_domains.c | 41 +++++++++++++++++++++++--------
|
|
1 file changed, 31 insertions(+), 10 deletions(-)
|
|
|
|
--- a/drivers/soc/rockchip/pm_domains.c
|
|
+++ b/drivers/soc/rockchip/pm_domains.c
|
|
@@ -44,6 +44,7 @@ struct rockchip_domain_info {
|
|
int pwr_w_mask;
|
|
int req_w_mask;
|
|
int repair_status_mask;
|
|
+ bool always_on;
|
|
u32 pwr_offset;
|
|
u32 req_offset;
|
|
};
|
|
@@ -527,6 +528,26 @@ static void rockchip_pd_detach_dev(struc
|
|
pm_clk_destroy(dev);
|
|
}
|
|
|
|
+static int rockchip_pd_add_alwasy_on_flag(struct rockchip_pm_domain *pd)
|
|
+{
|
|
+ int error;
|
|
+
|
|
+ if (pd->genpd.flags & GENPD_FLAG_ALWAYS_ON)
|
|
+ return 0;
|
|
+ pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON;
|
|
+ if (!rockchip_pmu_domain_is_on(pd)) {
|
|
+ error = rockchip_pd_power(pd, true);
|
|
+ if (error) {
|
|
+ dev_err(pd->pmu->dev,
|
|
+ "failed to power on domain '%s': %d\n",
|
|
+ pd->genpd.name, error);
|
|
+ return error;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
|
|
struct device_node *node)
|
|
{
|
|
@@ -645,6 +666,11 @@ static int rockchip_pm_add_one_domain(st
|
|
pd->genpd.flags = GENPD_FLAG_PM_CLK;
|
|
if (pd_info->active_wakeup)
|
|
pd->genpd.flags |= GENPD_FLAG_ACTIVE_WAKEUP;
|
|
+ if (pd_info->always_on) {
|
|
+ error = rockchip_pd_add_alwasy_on_flag(pd);
|
|
+ if (error)
|
|
+ goto err_unprepare_clocks;
|
|
+ }
|
|
pm_genpd_init(&pd->genpd, NULL, !rockchip_pmu_domain_is_on(pd));
|
|
|
|
pmu->genpd_data.domains[id] = &pd->genpd;
|