Skip to content

Commit e863e45

Browse files
committed
Merge tag 'amlogic-drivers' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into arm/drivers
soc: amlogic: driver updates for v5.10 - misc. pm-domain updates * tag 'amlogic-drivers' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: soc: amlogic: pm-domains: use always-on flag soc: amlogic: meson-ee-pwrc: add support for the Meson AXG SoCs dt-bindings: power: amlogic, meson-ee-pwrc: add Amlogic AXG power controller bindings Link: https://lore.kernel.org/r/7hblhukjzx.fsf@baylibre.com Signed-off-by: Olof Johansson <olof@lixom.net>
2 parents f8e8755 + 5aabf11 commit e863e45

4 files changed

Lines changed: 65 additions & 6 deletions

File tree

Documentation/devicetree/bindings/power/amlogic,meson-ee-pwrc.yaml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ properties:
2727
- amlogic,meson8b-pwrc
2828
- amlogic,meson8m2-pwrc
2929
- amlogic,meson-gxbb-pwrc
30+
- amlogic,meson-axg-pwrc
3031
- amlogic,meson-g12a-pwrc
3132
- amlogic,meson-sm1-pwrc
3233

@@ -42,11 +43,11 @@ properties:
4243
- const: vapb
4344

4445
resets:
45-
minItems: 11
46+
minItems: 5
4647
maxItems: 12
4748

4849
reset-names:
49-
minItems: 11
50+
minItems: 5
5051
maxItems: 12
5152

5253
"#power-domain-cells":
@@ -107,6 +108,24 @@ allOf:
107108
- resets
108109
- reset-names
109110

111+
- if:
112+
properties:
113+
compatible:
114+
enum:
115+
- amlogic,meson-axg-pwrc
116+
then:
117+
properties:
118+
reset-names:
119+
items:
120+
- const: viu
121+
- const: venc
122+
- const: vcbus
123+
- const: vencl
124+
- const: vid_lock
125+
required:
126+
- resets
127+
- reset-names
128+
110129
- if:
111130
properties:
112131
compatible:

drivers/soc/amlogic/meson-ee-pwrc.c

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/reset.h>
1616
#include <linux/clk.h>
1717
#include <dt-bindings/power/meson8-power.h>
18+
#include <dt-bindings/power/meson-axg-power.h>
1819
#include <dt-bindings/power/meson-g12a-power.h>
1920
#include <dt-bindings/power/meson-gxbb-power.h>
2021
#include <dt-bindings/power/meson-sm1-power.h>
@@ -134,6 +135,11 @@ static struct meson_ee_pwrc_top_domain sm1_pwrc_ge2d = SM1_EE_PD(19);
134135
{ __reg, BIT(14) }, \
135136
{ __reg, BIT(15) }
136137

138+
static struct meson_ee_pwrc_mem_domain axg_pwrc_mem_vpu[] = {
139+
VPU_MEMPD(HHI_VPU_MEM_PD_REG0),
140+
VPU_HHI_MEMPD(HHI_MEM_PD_REG0),
141+
};
142+
137143
static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_vpu[] = {
138144
VPU_MEMPD(HHI_VPU_MEM_PD_REG0),
139145
VPU_MEMPD(HHI_VPU_MEM_PD_REG1),
@@ -190,6 +196,10 @@ static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_ge2d[] = {
190196
{ HHI_MEM_PD_REG0, GENMASK(25, 18) },
191197
};
192198

199+
static struct meson_ee_pwrc_mem_domain axg_pwrc_mem_audio[] = {
200+
{ HHI_MEM_PD_REG0, GENMASK(5, 4) },
201+
};
202+
193203
static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_audio[] = {
194204
{ HHI_MEM_PD_REG0, GENMASK(5, 4) },
195205
{ HHI_AUDIO_MEM_PD_REG0, GENMASK(1, 0) },
@@ -231,6 +241,13 @@ static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_audio[] = {
231241

232242
static bool pwrc_ee_get_power(struct meson_ee_pwrc_domain *pwrc_domain);
233243

244+
static struct meson_ee_pwrc_domain_desc axg_pwrc_domains[] = {
245+
[PWRC_AXG_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, axg_pwrc_mem_vpu,
246+
pwrc_ee_get_power, 5, 2),
247+
[PWRC_AXG_ETHERNET_MEM_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
248+
[PWRC_AXG_AUDIO_ID] = MEM_PD("AUDIO", axg_pwrc_mem_audio),
249+
};
250+
234251
static struct meson_ee_pwrc_domain_desc g12a_pwrc_domains[] = {
235252
[PWRC_G12A_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, g12a_pwrc_mem_vpu,
236253
pwrc_ee_get_power, 11, 2),
@@ -433,8 +450,8 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev,
433450
if (ret)
434451
return ret;
435452

436-
ret = pm_genpd_init(&dom->base, &pm_domain_always_on_gov,
437-
false);
453+
dom->base.flags = GENPD_FLAG_ALWAYS_ON;
454+
ret = pm_genpd_init(&dom->base, NULL, false);
438455
if (ret)
439456
return ret;
440457
} else {
@@ -529,6 +546,11 @@ static struct meson_ee_pwrc_domain_data meson_ee_g12a_pwrc_data = {
529546
.domains = g12a_pwrc_domains,
530547
};
531548

549+
static struct meson_ee_pwrc_domain_data meson_ee_axg_pwrc_data = {
550+
.count = ARRAY_SIZE(axg_pwrc_domains),
551+
.domains = axg_pwrc_domains,
552+
};
553+
532554
static struct meson_ee_pwrc_domain_data meson_ee_gxbb_pwrc_data = {
533555
.count = ARRAY_SIZE(gxbb_pwrc_domains),
534556
.domains = gxbb_pwrc_domains,
@@ -562,6 +584,10 @@ static const struct of_device_id meson_ee_pwrc_match_table[] = {
562584
.compatible = "amlogic,meson8m2-pwrc",
563585
.data = &meson_ee_m8b_pwrc_data,
564586
},
587+
{
588+
.compatible = "amlogic,meson-axg-pwrc",
589+
.data = &meson_ee_axg_pwrc_data,
590+
},
565591
{
566592
.compatible = "amlogic,meson-gxbb-pwrc",
567593
.data = &meson_ee_gxbb_pwrc_data,

drivers/soc/amlogic/meson-gx-pwrc-vpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ static int meson_gx_pwrc_vpu_probe(struct platform_device *pdev)
339339
return ret;
340340
}
341341

342-
pm_genpd_init(&vpu_pd->genpd, &pm_domain_always_on_gov,
343-
powered_off);
342+
vpu_pd->genpd.flags = GENPD_FLAG_ALWAYS_ON;
343+
pm_genpd_init(&vpu_pd->genpd, NULL, powered_off);
344344

345345
return of_genpd_add_provider_simple(pdev->dev.of_node,
346346
&vpu_pd->genpd);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */
2+
/*
3+
* Copyright (c) 2020 BayLibre, SAS
4+
* Author: Neil Armstrong <narmstrong@baylibre.com>
5+
*/
6+
7+
#ifndef _DT_BINDINGS_MESON_AXG_POWER_H
8+
#define _DT_BINDINGS_MESON_AXG_POWER_H
9+
10+
#define PWRC_AXG_VPU_ID 0
11+
#define PWRC_AXG_ETHERNET_MEM_ID 1
12+
#define PWRC_AXG_AUDIO_ID 2
13+
14+
#endif

0 commit comments

Comments
 (0)