S7D: power domain: add support in kernel. [3/3]

PD#SWPL-146595

Problem:
S7D need power domain in kernel.

Solution:
add power domain in kernel.

Verify:
pxp

Change-Id: Ia05ec9960f38388444ae14869576f8cd1d51cf78
Signed-off-by: hongyu.chen1 <hongyu.chen1@amlogic.com>
This commit is contained in:
hongyu.chen1
2023-11-21 09:59:01 +08:00
committed by Luan Yuan
parent b3407b4f91
commit 4e694e2180
3 changed files with 66 additions and 9 deletions
+9 -9
View File
@@ -8,7 +8,7 @@
#include <dt-bindings/clock/g12a-aoclkc.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/power/s7-pd.h>
#include <dt-bindings/power/s7d-pd.h>
#include <dt-bindings/clock/amlogic,sc2-audio-clk.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/gpio/meson-s4-gpio.h>
@@ -308,7 +308,7 @@
};
pwrdm: power-domains {
compatible = "amlogic,s7-power-domain";
compatible = "amlogic,s7d-power-domain";
#power-domain-cells = <1>;
status = "okay";
};
@@ -1594,12 +1594,12 @@
"mailbox_1",
"mailbox_2",
"parser_b";
power-domains = <&pwrdm PDID_S7_DOS_VDEC>,
<&pwrdm PDID_S7_DOS_HEVC>,
<&pwrdm PDID_S7_DOS_HCODEC>;
power-domain-names = "pwrc-vdec",
"pwrc-hevc",
"pwrc-hcodec";
//power-domains = <&pwrdm PDID_S7_DOS_VDEC>,
// <&pwrdm PDID_S7_DOS_HEVC>,
// <&pwrdm PDID_S7_DOS_HCODEC>;
//power-domain-names = "pwrc-vdec",
//"pwrc-hevc",
//"pwrc-hcodec";
};
vcodec_dec {
@@ -2142,7 +2142,7 @@
"clk_ge2d",
"clk_ge2d_gate";
reg = <0x0 0xff040000 0x0 0x100>;
power-domains = <&pwrdm PDID_S7_GE2D>;
//power-domains = <&pwrdm PDID_S7_GE2D>;
};
aml_bt: aml_bt {
+39
View File
@@ -24,6 +24,7 @@
#include <dt-bindings/power/t3x-pd.h>
#include <dt-bindings/power/txhd2-pd.h>
#include <dt-bindings/power/s1a-pd.h>
#include <dt-bindings/power/s7d-pd.h>
#include <linux/kallsyms.h>
struct sec_pm_private_domain {
@@ -768,6 +769,40 @@ static struct sec_pm_domain_data c3_pm_domain_data __initdata = {
#endif
static struct sec_pm_private_domain s7d_pm_domains[] __initdata = {
[PDID_S7_DOS_HCODEC] = POWER_DOMAIN(hcode, PDID_S7_DOS_HCODEC, DOMAIN_INIT_ON,
GENPD_FLAG_ALWAYS_ON),
[PDID_S7_DOS_HEVC] = POWER_DOMAIN(hevc, PDID_S7_DOS_HEVC, DOMAIN_INIT_ON,
GENPD_FLAG_ALWAYS_ON),
[PDID_S7_DOS_VDEC] = POWER_DOMAIN(vdec, PDID_S7_DOS_VDEC, DOMAIN_INIT_ON,
GENPD_FLAG_ALWAYS_ON),
[PDID_S7_VPU_HDMI] = POWER_DOMAIN(hdmi, PDID_S7_VPU_HDMI, DOMAIN_INIT_ON,
GENPD_FLAG_ALWAYS_ON),
[PDID_S7_USB_COMB] = POWER_DOMAIN(usb_comb, PDID_S7_USB_COMB, DOMAIN_INIT_ON,
GENPD_FLAG_ALWAYS_ON),
[PDID_S7_SD_EMMC_C] = POWER_DOMAIN(sd_emmc_c, PDID_S7_SD_EMMC_C, DOMAIN_INIT_ON,
GENPD_FLAG_ALWAYS_ON),
[PDID_S7_GE2D] = POWER_DOMAIN(ge2d, PDID_S7_GE2D, DOMAIN_INIT_ON,
GENPD_FLAG_ALWAYS_ON),
[PDID_S7_SD_EMMC_A] = POWER_DOMAIN(sd_emmc_a, PDID_S7_SD_EMMC_A, DOMAIN_INIT_ON,
GENPD_FLAG_ALWAYS_ON),
[PDID_S7_SD_EMMC_B] = POWER_DOMAIN(sd_emmc_b, PDID_S7_SD_EMMC_B, DOMAIN_INIT_ON,
GENPD_FLAG_ALWAYS_ON),
[PDID_S7_ETH] = POWER_DOMAIN(eth, PDID_S7_ETH, DOMAIN_INIT_ON,
GENPD_FLAG_ALWAYS_ON),
[PDID_S7_AUCPU] = POWER_DOMAIN(aucpu, PDID_S7_AUCPU, DOMAIN_INIT_ON,
GENPD_FLAG_ALWAYS_ON),
[PDID_S7_AUDIO] = POWER_DOMAIN(audio, PDID_S7_AUDIO, DOMAIN_INIT_ON,
GENPD_FLAG_ALWAYS_ON),
[PDID_S7_AMFC] = POWER_DOMAIN(amfc, PDID_S7_AMFC, DOMAIN_INIT_ON,
GENPD_FLAG_ALWAYS_ON),
};
static struct sec_pm_domain_data s7d_pm_domain_data __initdata = {
.domains = s7d_pm_domains,
.domains_count = ARRAY_SIZE(s7d_pm_domains),
};
static int sec_pd_probe(struct platform_device *pdev)
{
int ret, i;
@@ -935,6 +970,10 @@ static const struct of_device_id pd_match_table[] = {
.compatible = "amlogic,s7-power-domain",
.data = &s7_pm_domain_data,
},
{
.compatible = "amlogic,s7d-power-domain",
.data = &s7d_pm_domain_data,
},
#endif
{
.compatible = "amlogic,s1a-power-domain",
+18
View File
@@ -0,0 +1,18 @@
/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
/*
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
*/
#define PDID_S7_DOS_HCODEC 0
#define PDID_S7_DOS_HEVC 1
#define PDID_S7_DOS_VDEC 2
#define PDID_S7_VPU_HDMI 3
#define PDID_S7_USB_COMB 4
#define PDID_S7_SD_EMMC_C 5
#define PDID_S7_GE2D 6
#define PDID_S7_SD_EMMC_A 7
#define PDID_S7_SD_EMMC_B 8
#define PDID_S7_ETH 9
#define PDID_S7_AUCPU 10
#define PDID_S7_AUDIO 11
#define PDID_S7_AMFC 12