diff --git a/arch/arm64/boot/dts/amlogic/meson-s7d.dtsi b/arch/arm64/boot/dts/amlogic/meson-s7d.dtsi index 2eddcfc2e..192d651ed 100644 --- a/arch/arm64/boot/dts/amlogic/meson-s7d.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-s7d.dtsi @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -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 { diff --git a/drivers/power/sec_power_domain.c b/drivers/power/sec_power_domain.c index eaf37ded7..ff2e85be1 100644 --- a/drivers/power/sec_power_domain.c +++ b/drivers/power/sec_power_domain.c @@ -24,6 +24,7 @@ #include #include #include +#include #include 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", diff --git a/include/dt-bindings/power/s7d-pd.h b/include/dt-bindings/power/s7d-pd.h new file mode 100644 index 000000000..12e9bb6a5 --- /dev/null +++ b/include/dt-bindings/power/s7d-pd.h @@ -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