From 7fc09245825fc3a8a577390fb62b87f8afe199fc Mon Sep 17 00:00:00 2001 From: "hongyu.chen1" Date: Thu, 18 Apr 2024 17:02:50 +0800 Subject: [PATCH] T6D: add power domain config. [3/3] PD#SWPL-164469 Problem: t6d need power domain support. Solution: add power domain config in kernel. Verify: pxp Change-Id: Idbafb1d0d68e444d846dfb07440c99f0d3cfeca7 Signed-off-by: hongyu.chen1 --- arch/arm/boot/dts/amlogic/mesont6d.dtsi | 5 +++-- drivers/power/sec_power_domain.c | 22 ++++++++++++++++++++++ include/dt-bindings/power/t6d-pd.h | 11 +++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 include/dt-bindings/power/t6d-pd.h diff --git a/arch/arm/boot/dts/amlogic/mesont6d.dtsi b/arch/arm/boot/dts/amlogic/mesont6d.dtsi index 142ce9198..f35783be0 100644 --- a/arch/arm/boot/dts/amlogic/mesont6d.dtsi +++ b/arch/arm/boot/dts/amlogic/mesont6d.dtsi @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -288,9 +289,9 @@ }; pwrdm: power-domains { - compatible = "amlogic,t5m-power-domain"; + compatible = "amlogic,t6d-power-domain"; #power-domain-cells = <1>; - status = "disabled"; + status = "okay"; }; galcore { diff --git a/drivers/power/sec_power_domain.c b/drivers/power/sec_power_domain.c index 6c7660807..7d2a68d32 100644 --- a/drivers/power/sec_power_domain.c +++ b/drivers/power/sec_power_domain.c @@ -26,6 +26,7 @@ #include #include #include +#include #include struct sec_pm_private_domain { @@ -806,6 +807,23 @@ static struct sec_pm_domain_data s6_pm_domain_data __initdata = { .domains_count = ARRAY_SIZE(s6_pm_domains), }; +static struct sec_pm_private_domain t6d_pm_domains[] __initdata = { + [PDID_T6D_AMFC] = POWER_DOMAIN(amfc, PDID_T6D_AMFC, + DOMAIN_INIT_ON, GENPD_FLAG_ALWAYS_ON), + [PDID_T6D_DOS_HEVC] = POWER_DOMAIN(hevc, PDID_T6D_DOS_HEVC, + DOMAIN_INIT_ON, GENPD_FLAG_ALWAYS_ON), + [PDID_T6D_GE2D] = POWER_DOMAIN(ge2d, PDID_T6D_GE2D, + DOMAIN_INIT_ON, GENPD_FLAG_ALWAYS_ON), + [PDID_T6D_VPU_HDMI] = POWER_DOMAIN(vpu, PDID_T6D_VPU_HDMI, + DOMAIN_INIT_ON, GENPD_FLAG_ALWAYS_ON), + [PDID_T6D_DEMOD] = POWER_DOMAIN(demod, PDID_T6D_DEMOD, + DOMAIN_INIT_ON, GENPD_FLAG_ALWAYS_ON), +}; + +static struct sec_pm_domain_data t6d_pm_domain_data __initdata = { + .domains = t6d_pm_domains, + .domains_count = ARRAY_SIZE(t6d_pm_domains), +}; #endif static struct sec_pm_private_domain s1a_pm_domains[] __initdata = { @@ -1038,6 +1056,10 @@ static const struct of_device_id pd_match_table[] = { .compatible = "amlogic,s6-power-domain", .data = &s6_pm_domain_data, }, + { + .compatible = "amlogic,t6d-power-domain", + .data = &t6d_pm_domain_data, + }, #endif { .compatible = "amlogic,s1a-power-domain", diff --git a/include/dt-bindings/power/t6d-pd.h b/include/dt-bindings/power/t6d-pd.h new file mode 100644 index 000000000..1c7bfe3eb --- /dev/null +++ b/include/dt-bindings/power/t6d-pd.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */ +/* + * Copyright (c) 2019 Amlogic, Inc. All rights reserved. + */ + +#define PDID_T6D_AMFC 0 +#define PDID_T6D_DOS_HEVC 1 +#define PDID_T6D_GE2D 2 +#define PDID_T6D_VPU_HDMI 3 +#define PDID_T6D_DEMOD 4 +