Skip to content

Commit acaa52b

Browse files
committed
Merge tag 'samsung-drivers-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/drivers
Samsung SoC driver changes for v6.5 1. Re-introduce Exynos4212: Exynos PMU driver. 2. Convert S5P/Exynos Multi Format Codec bindings to DT schema. * tag 'samsung-drivers-6.5' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: dt-bindings: media: s5p-mfc: convert bindings to json-schema soc: samsung: exynos-pmu: Re-introduce Exynos4212 support dt-bindings: soc: samsung: exynos-pmu: add Exynos4212 compatible Link: https://lore.kernel.org/r/20230602091501.15178-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents c6a5181 + 538af6e commit acaa52b

6 files changed

Lines changed: 211 additions & 80 deletions

File tree

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +0,0 @@
1-
* Samsung Multi Format Codec (MFC)
2-
3-
Multi Format Codec (MFC) is the IP present in Samsung SoCs which
4-
supports high resolution decoding and encoding functionalities.
5-
The MFC device driver is a v4l2 driver which can encode/decode
6-
video raw/elementary streams and has support for all popular
7-
video codecs.
8-
9-
Required properties:
10-
- compatible : value should be either one among the following
11-
(a) "samsung,mfc-v5" for MFC v5 present in Exynos4 SoCs
12-
(b) "samsung,mfc-v6" for MFC v6 present in Exynos5 SoCs
13-
(c) "samsung,exynos3250-mfc", "samsung,mfc-v7" for MFC v7
14-
present in Exynos3250 SoC
15-
(d) "samsung,mfc-v7" for MFC v7 present in Exynos5420 SoC
16-
(e) "samsung,mfc-v8" for MFC v8 present in Exynos5800 SoC
17-
(f) "samsung,exynos5433-mfc" for MFC v8 present in Exynos5433 SoC
18-
(g) "samsung,mfc-v10" for MFC v10 present in Exynos7880 SoC
19-
20-
- reg : Physical base address of the IP registers and length of memory
21-
mapped region.
22-
23-
- interrupts : MFC interrupt number to the CPU.
24-
- clocks : from common clock binding: handle to mfc clock.
25-
- clock-names : from common clock binding: must contain "mfc",
26-
corresponding to entry in the clocks property.
27-
28-
Optional properties:
29-
- power-domains : power-domain property defined with a phandle
30-
to respective power domain.
31-
- memory-region : from reserved memory binding: phandles to two reserved
32-
memory regions, first is for "left" mfc memory bus interfaces,
33-
second if for the "right" mfc memory bus, used when no SYSMMU
34-
support is available; used only by MFC v5 present in Exynos4 SoCs
35-
36-
Obsolete properties:
37-
- samsung,mfc-r, samsung,mfc-l : support removed, please use memory-region
38-
property instead
39-
40-
41-
Example:
42-
SoC specific DT entry:
43-
44-
mfc: codec@13400000 {
45-
compatible = "samsung,mfc-v5";
46-
reg = <0x13400000 0x10000>;
47-
interrupts = <0 94 0>;
48-
power-domains = <&pd_mfc>;
49-
clocks = <&clock 273>;
50-
clock-names = "mfc";
51-
};
52-
53-
Reserved memory specific DT entry for given board (see reserved memory binding
54-
for more information):
55-
56-
reserved-memory {
57-
#address-cells = <1>;
58-
#size-cells = <1>;
59-
ranges;
60-
61-
mfc_left: region@51000000 {
62-
compatible = "shared-dma-pool";
63-
no-map;
64-
reg = <0x51000000 0x800000>;
65-
};
66-
67-
mfc_right: region@43000000 {
68-
compatible = "shared-dma-pool";
69-
no-map;
70-
reg = <0x43000000 0x800000>;
71-
};
72-
};
73-
74-
Board specific DT entry:
75-
76-
codec@13400000 {
77-
memory-region = <&mfc_left>, <&mfc_right>;
78-
};
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/media/samsung,s5p-mfc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Samsung Exynos Multi Format Codec (MFC)
8+
9+
maintainers:
10+
- Marek Szyprowski <m.szyprowski@samsung.com>
11+
- Aakarsh Jain <aakarsh.jain@samsung.com>
12+
13+
description:
14+
Multi Format Codec (MFC) is the IP present in Samsung SoCs which
15+
supports high resolution decoding and encoding functionalities.
16+
17+
properties:
18+
compatible:
19+
oneOf:
20+
- enum:
21+
- samsung,exynos5433-mfc # Exynos5433
22+
- samsung,mfc-v5 # Exynos4
23+
- samsung,mfc-v6 # Exynos5
24+
- samsung,mfc-v7 # Exynos5420
25+
- samsung,mfc-v8 # Exynos5800
26+
- samsung,mfc-v10 # Exynos7880
27+
- items:
28+
- enum:
29+
- samsung,exynos3250-mfc # Exynos3250
30+
- const: samsung,mfc-v7 # Fall back for Exynos3250
31+
32+
reg:
33+
maxItems: 1
34+
35+
clocks:
36+
minItems: 1
37+
maxItems: 3
38+
39+
clock-names:
40+
minItems: 1
41+
maxItems: 3
42+
43+
interrupts:
44+
maxItems: 1
45+
46+
iommus:
47+
minItems: 1
48+
maxItems: 2
49+
50+
iommu-names:
51+
minItems: 1
52+
maxItems: 2
53+
54+
power-domains:
55+
maxItems: 1
56+
57+
memory-region:
58+
minItems: 1
59+
maxItems: 2
60+
61+
required:
62+
- compatible
63+
- reg
64+
- clocks
65+
- clock-names
66+
- interrupts
67+
68+
additionalProperties: false
69+
70+
allOf:
71+
- if:
72+
properties:
73+
compatible:
74+
contains:
75+
enum:
76+
- samsung,exynos3250-mfc
77+
then:
78+
properties:
79+
clocks:
80+
maxItems: 2
81+
clock-names:
82+
items:
83+
- const: mfc
84+
- const: sclk_mfc
85+
iommus:
86+
maxItems: 1
87+
iommus-names: false
88+
89+
- if:
90+
properties:
91+
compatible:
92+
contains:
93+
enum:
94+
- samsung,exynos5433-mfc
95+
then:
96+
properties:
97+
clocks:
98+
maxItems: 3
99+
clock-names:
100+
items:
101+
- const: pclk
102+
- const: aclk
103+
- const: aclk_xiu
104+
iommus:
105+
maxItems: 2
106+
iommus-names:
107+
items:
108+
- const: left
109+
- const: right
110+
111+
- if:
112+
properties:
113+
compatible:
114+
contains:
115+
enum:
116+
- samsung,mfc-v5
117+
then:
118+
properties:
119+
clocks:
120+
maxItems: 2
121+
clock-names:
122+
items:
123+
- const: mfc
124+
- const: sclk_mfc
125+
iommus:
126+
maxItems: 2
127+
iommus-names:
128+
items:
129+
- const: left
130+
- const: right
131+
132+
- if:
133+
properties:
134+
compatible:
135+
contains:
136+
enum:
137+
- samsung,mfc-v6
138+
- samsung,mfc-v8
139+
then:
140+
properties:
141+
clocks:
142+
maxItems: 1
143+
clock-names:
144+
items:
145+
- const: mfc
146+
iommus:
147+
maxItems: 2
148+
iommus-names:
149+
items:
150+
- const: left
151+
- const: right
152+
153+
- if:
154+
properties:
155+
compatible:
156+
contains:
157+
enum:
158+
- samsung,mfc-v7
159+
then:
160+
properties:
161+
clocks:
162+
minItems: 1
163+
maxItems: 2
164+
iommus:
165+
minItems: 1
166+
maxItems: 2
167+
168+
examples:
169+
- |
170+
#include <dt-bindings/clock/exynos4.h>
171+
#include <dt-bindings/clock/exynos-audss-clk.h>
172+
#include <dt-bindings/interrupt-controller/arm-gic.h>
173+
#include <dt-bindings/interrupt-controller/irq.h>
174+
175+
codec@13400000 {
176+
compatible = "samsung,mfc-v5";
177+
reg = <0x13400000 0x10000>;
178+
interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
179+
power-domains = <&pd_mfc>;
180+
clocks = <&clock CLK_MFC>, <&clock CLK_SCLK_MFC>;
181+
clock-names = "mfc", "sclk_mfc";
182+
iommus = <&sysmmu_mfc_l>, <&sysmmu_mfc_r>;
183+
iommu-names = "left", "right";
184+
};

Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ select:
1717
enum:
1818
- samsung,exynos3250-pmu
1919
- samsung,exynos4210-pmu
20+
- samsung,exynos4212-pmu
2021
- samsung,exynos4412-pmu
2122
- samsung,exynos5250-pmu
2223
- samsung,exynos5260-pmu
@@ -36,6 +37,7 @@ properties:
3637
- enum:
3738
- samsung,exynos3250-pmu
3839
- samsung,exynos4210-pmu
40+
- samsung,exynos4212-pmu
3941
- samsung,exynos4412-pmu
4042
- samsung,exynos5250-pmu
4143
- samsung,exynos5260-pmu
@@ -50,6 +52,7 @@ properties:
5052
- enum:
5153
- samsung,exynos3250-pmu
5254
- samsung,exynos4210-pmu
55+
- samsung,exynos4212-pmu
5356
- samsung,exynos4412-pmu
5457
- samsung,exynos5250-pmu
5558
- samsung,exynos5420-pmu
@@ -125,6 +128,7 @@ allOf:
125128
enum:
126129
- samsung,exynos3250-pmu
127130
- samsung,exynos4210-pmu
131+
- samsung,exynos4212-pmu
128132
- samsung,exynos4412-pmu
129133
- samsung,exynos5250-pmu
130134
- samsung,exynos5410-pmu
@@ -143,6 +147,7 @@ allOf:
143147
enum:
144148
- samsung,exynos3250-pmu
145149
- samsung,exynos4210-pmu
150+
- samsung,exynos4212-pmu
146151
- samsung,exynos4412-pmu
147152
- samsung,exynos5250-pmu
148153
- samsung,exynos5420-pmu

drivers/soc/samsung/exynos-pmu.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode)
5757

5858
if (pmu_data->powerdown_conf_extra)
5959
pmu_data->powerdown_conf_extra(mode);
60+
61+
if (pmu_data->pmu_config_extra) {
62+
for (i = 0; pmu_data->pmu_config_extra[i].offset != PMU_TABLE_END; i++)
63+
pmu_raw_writel(pmu_data->pmu_config_extra[i].val[mode],
64+
pmu_data->pmu_config_extra[i].offset);
65+
}
6066
}
6167

6268
/*
@@ -79,6 +85,9 @@ static const struct of_device_id exynos_pmu_of_device_ids[] = {
7985
}, {
8086
.compatible = "samsung,exynos4210-pmu",
8187
.data = exynos_pmu_data_arm_ptr(exynos4210_pmu_data),
88+
}, {
89+
.compatible = "samsung,exynos4212-pmu",
90+
.data = exynos_pmu_data_arm_ptr(exynos4212_pmu_data),
8291
}, {
8392
.compatible = "samsung,exynos4412-pmu",
8493
.data = exynos_pmu_data_arm_ptr(exynos4412_pmu_data),

drivers/soc/samsung/exynos-pmu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ struct exynos_pmu_conf {
2020

2121
struct exynos_pmu_data {
2222
const struct exynos_pmu_conf *pmu_config;
23+
const struct exynos_pmu_conf *pmu_config_extra;
2324

2425
void (*pmu_init)(void);
2526
void (*powerdown_conf)(enum sys_powerdown);
@@ -32,6 +33,7 @@ extern void __iomem *pmu_base_addr;
3233
/* list of all exported SoC specific data */
3334
extern const struct exynos_pmu_data exynos3250_pmu_data;
3435
extern const struct exynos_pmu_data exynos4210_pmu_data;
36+
extern const struct exynos_pmu_data exynos4212_pmu_data;
3537
extern const struct exynos_pmu_data exynos4412_pmu_data;
3638
extern const struct exynos_pmu_data exynos5250_pmu_data;
3739
extern const struct exynos_pmu_data exynos5420_pmu_data;

drivers/soc/samsung/exynos4-pmu.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static const struct exynos_pmu_conf exynos4210_pmu_config[] = {
8686
{ PMU_TABLE_END,},
8787
};
8888

89-
static const struct exynos_pmu_conf exynos4412_pmu_config[] = {
89+
static const struct exynos_pmu_conf exynos4x12_pmu_config[] = {
9090
{ S5P_ARM_CORE0_LOWPWR, { 0x0, 0x0, 0x2 } },
9191
{ S5P_DIS_IRQ_CORE0, { 0x0, 0x0, 0x0 } },
9292
{ S5P_DIS_IRQ_CENTRAL0, { 0x0, 0x0, 0x0 } },
@@ -191,6 +191,10 @@ static const struct exynos_pmu_conf exynos4412_pmu_config[] = {
191191
{ S5P_GPS_ALIVE_LOWPWR, { 0x7, 0x0, 0x0 } },
192192
{ S5P_CMU_SYSCLK_ISP_LOWPWR, { 0x1, 0x0, 0x0 } },
193193
{ S5P_CMU_SYSCLK_GPS_LOWPWR, { 0x1, 0x0, 0x0 } },
194+
{ PMU_TABLE_END,},
195+
};
196+
197+
static const struct exynos_pmu_conf exynos4412_pmu_config[] = {
194198
{ S5P_ARM_CORE2_LOWPWR, { 0x0, 0x0, 0x2 } },
195199
{ S5P_DIS_IRQ_CORE2, { 0x0, 0x0, 0x0 } },
196200
{ S5P_DIS_IRQ_CENTRAL2, { 0x0, 0x0, 0x0 } },
@@ -204,6 +208,11 @@ const struct exynos_pmu_data exynos4210_pmu_data = {
204208
.pmu_config = exynos4210_pmu_config,
205209
};
206210

211+
const struct exynos_pmu_data exynos4212_pmu_data = {
212+
.pmu_config = exynos4x12_pmu_config,
213+
};
214+
207215
const struct exynos_pmu_data exynos4412_pmu_data = {
208-
.pmu_config = exynos4412_pmu_config,
216+
.pmu_config = exynos4x12_pmu_config,
217+
.pmu_config_extra = exynos4412_pmu_config,
209218
};

0 commit comments

Comments
 (0)