Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9bdf401b authored by Finley Xiao's avatar Finley Xiao Committed by Heiko Stuebner
Browse files

soc: rockchip: power-domain: add power domain support for px30



This driver is modified to support PX30 SoC.

Signed-off-by: default avatarFinley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: default avatarElaine Zhang <zhangqing@rock-chips.com>
Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
parent 3adf9db5
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/clk.h>
#include <linux/regmap.h>
#include <linux/mfd/syscon.h>
#include <dt-bindings/power/px30-power.h>
#include <dt-bindings/power/rk3036-power.h>
#include <dt-bindings/power/rk3128-power.h>
#include <dt-bindings/power/rk3228-power.h>
@@ -115,6 +116,9 @@ struct rockchip_pmu {
	.active_wakeup = wakeup,			\
}

#define DOMAIN_PX30(pwr, status, req, wakeup)		\
	DOMAIN_M(pwr, status, req, (req) + 16, req, wakeup)

#define DOMAIN_RK3288(pwr, status, req, wakeup)		\
	DOMAIN(pwr, status, req, req, (req) + 16, wakeup)

@@ -713,6 +717,17 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
	return error;
}

static const struct rockchip_domain_info px30_pm_domains[] = {
	[PX30_PD_USB]		= DOMAIN_PX30(5, 5, 10, false),
	[PX30_PD_SDCARD]	= DOMAIN_PX30(8, 8, 9, false),
	[PX30_PD_GMAC]		= DOMAIN_PX30(10, 10, 6, false),
	[PX30_PD_MMC_NAND]	= DOMAIN_PX30(11, 11, 5, false),
	[PX30_PD_VPU]		= DOMAIN_PX30(12, 12, 14, false),
	[PX30_PD_VO]		= DOMAIN_PX30(13, 13, 7, false),
	[PX30_PD_VI]		= DOMAIN_PX30(14, 14, 8, false),
	[PX30_PD_GPU]		= DOMAIN_PX30(15, 15, 2, false),
};

static const struct rockchip_domain_info rk3036_pm_domains[] = {
	[RK3036_PD_MSCH]	= DOMAIN_RK3036(14, 23, 30, true),
	[RK3036_PD_CORE]	= DOMAIN_RK3036(13, 17, 24, false),
@@ -812,6 +827,17 @@ static const struct rockchip_domain_info rk3399_pm_domains[] = {
	[RK3399_PD_SDIOAUDIO]	= DOMAIN_RK3399(31, 31, 29, true),
};

static const struct rockchip_pmu_info px30_pmu = {
	.pwr_offset = 0x18,
	.status_offset = 0x20,
	.req_offset = 0x64,
	.idle_offset = 0x6c,
	.ack_offset = 0x6c,

	.num_domains = ARRAY_SIZE(px30_pm_domains),
	.domain_info = px30_pm_domains,
};

static const struct rockchip_pmu_info rk3036_pmu = {
	.req_offset = 0x148,
	.idle_offset = 0x14c,
@@ -915,6 +941,10 @@ static const struct rockchip_pmu_info rk3399_pmu = {
};

static const struct of_device_id rockchip_pm_domain_dt_match[] = {
	{
		.compatible = "rockchip,px30-power-controller",
		.data = (void *)&px30_pmu,
	},
	{
		.compatible = "rockchip,rk3036-power-controller",
		.data = (void *)&rk3036_pmu,