Skip to content

Commit 9593bdf

Browse files
committed
Merge tag 'samsung-drivers-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/drivers
Samsung SoC drivers changes for v5.17 1. Exynos ChipID: add Exynos7885 support. 2. Exynos PMU: add Exynos850 support. 3. Minor bindings cleanup. 4. Add Exynos USIv2 (Universal Serial Interface) driver. The USI block is a shared IP block between I2C, UART/serial and SPI. Basically one has to choose which feature the USI block will support and later the regular I2C/serial/SPI driver will bind and work. This merges also one commit with dt-binding headers from my dts64 pull request. Together with a future serial driver change, this will break the ABI. Affected: Serial on ExynosAutov9 SADK and out-of-tree ExynosAutov9 boards Why: To properly and efficiently support the USI with new hierarchy of USI-{serial,SPI,I2C} devicetree nodes. Rationale: Recently added serial and USI support was short-sighted and did not allow to smooth support of other features (SPI and I2C). Adding support for USI-SPI and USI-I2C would effect in code duplication. Adding support for different USI versions (currently supported is USIv2 but support for v1 is planned) would cause even more code duplication and create a solution difficult to maintain. Since USI-serial and ExynosAutov9 have been added recently, are considered fresh development features and there are no supported products using them, the code/solution is being refactored in non-backwards compatible way. The compatibility is not broken yet. It will be when serial driver changes are accepted. The ABI break was discussed with only known users of ExynosAutov9 and received their permission. * tag 'samsung-drivers-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: dt-bindings: soc: samsung: keep SoC driver bindings together soc: samsung: Add USI driver dt-bindings: soc: samsung: Add Exynos USI bindings soc: samsung: exynos-pmu: Add Exynos850 support dt-bindings: samsung: pmu: Document Exynos850 soc: samsung: exynos-chipid: add Exynos7885 SoC support soc: samsung: exynos-chipid: describe which SoCs go with compatibles Link: https://lore.kernel.org/r/20211220115405.30434-2-krzysztof.kozlowski@canonical.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 87e1287 + 96c8bdd commit 9593bdf

10 files changed

Lines changed: 487 additions & 2 deletions

File tree

Documentation/devicetree/bindings/arm/samsung/exynos-chipid.yaml renamed to Documentation/devicetree/bindings/soc/samsung/exynos-chipid.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
%YAML 1.2
33
---
4-
$id: http://devicetree.org/schemas/arm/samsung/exynos-chipid.yaml#
4+
$id: http://devicetree.org/schemas/soc/samsung/exynos-chipid.yaml#
55
$schema: http://devicetree.org/meta-schemas/core.yaml#
66

77
title: Samsung Exynos SoC series Chipid driver

Documentation/devicetree/bindings/arm/samsung/pmu.yaml renamed to Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
%YAML 1.2
33
---
4-
$id: http://devicetree.org/schemas/arm/samsung/pmu.yaml#
4+
$id: http://devicetree.org/schemas/soc/samsung/exynos-pmu.yaml#
55
$schema: http://devicetree.org/meta-schemas/core.yaml#
66

77
title: Samsung Exynos SoC series Power Management Unit (PMU)
@@ -24,6 +24,7 @@ select:
2424
- samsung,exynos5420-pmu
2525
- samsung,exynos5433-pmu
2626
- samsung,exynos7-pmu
27+
- samsung,exynos850-pmu
2728
- samsung-s5pv210-pmu
2829
required:
2930
- compatible
@@ -41,6 +42,7 @@ properties:
4142
- samsung,exynos5420-pmu
4243
- samsung,exynos5433-pmu
4344
- samsung,exynos7-pmu
45+
- samsung,exynos850-pmu
4446
- samsung-s5pv210-pmu
4547
- const: syscon
4648

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/soc/samsung/exynos-usi.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Samsung's Exynos USI (Universal Serial Interface) binding
8+
9+
maintainers:
10+
- Sam Protsenko <semen.protsenko@linaro.org>
11+
- Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
12+
13+
description: |
14+
USI IP-core provides selectable serial protocol (UART, SPI or High-Speed I2C).
15+
USI shares almost all internal circuits within each protocol, so only one
16+
protocol can be chosen at a time. USI is modeled as a node with zero or more
17+
child nodes, each representing a serial sub-node device. The mode setting
18+
selects which particular function will be used.
19+
20+
Refer to next bindings documentation for information on protocol subnodes that
21+
can exist under USI node:
22+
23+
[1] Documentation/devicetree/bindings/serial/samsung_uart.yaml
24+
[2] Documentation/devicetree/bindings/i2c/i2c-exynos5.txt
25+
[3] Documentation/devicetree/bindings/spi/spi-samsung.txt
26+
27+
properties:
28+
$nodename:
29+
pattern: "^usi@[0-9a-f]+$"
30+
31+
compatible:
32+
enum:
33+
- samsung,exynos850-usi # for USIv2 (Exynos850, ExynosAutoV9)
34+
35+
reg: true
36+
37+
clocks: true
38+
39+
clock-names: true
40+
41+
ranges: true
42+
43+
"#address-cells":
44+
const: 1
45+
46+
"#size-cells":
47+
const: 1
48+
49+
samsung,sysreg:
50+
$ref: /schemas/types.yaml#/definitions/phandle-array
51+
description:
52+
Should be phandle/offset pair. The phandle to System Register syscon node
53+
(for the same domain where this USI controller resides) and the offset
54+
of SW_CONF register for this USI controller.
55+
56+
samsung,mode:
57+
$ref: /schemas/types.yaml#/definitions/uint32
58+
description:
59+
Selects USI function (which serial protocol to use). Refer to
60+
<include/dt-bindings/soc/samsung,exynos-usi.h> for valid USI mode values.
61+
62+
samsung,clkreq-on:
63+
type: boolean
64+
description:
65+
Enable this property if underlying protocol requires the clock to be
66+
continuously provided without automatic gating. As suggested by SoC
67+
manual, it should be set in case of SPI/I2C slave, UART Rx and I2C
68+
multi-master mode. Usually this property is needed if USI mode is set
69+
to "UART".
70+
71+
This property is optional.
72+
73+
patternProperties:
74+
# All other properties should be child nodes
75+
"^(serial|spi|i2c)@[0-9a-f]+$":
76+
type: object
77+
description: Child node describing underlying USI serial protocol
78+
79+
required:
80+
- compatible
81+
- ranges
82+
- "#address-cells"
83+
- "#size-cells"
84+
- samsung,sysreg
85+
- samsung,mode
86+
87+
if:
88+
properties:
89+
compatible:
90+
contains:
91+
enum:
92+
- samsung,exynos850-usi
93+
94+
then:
95+
properties:
96+
reg:
97+
maxItems: 1
98+
99+
clocks:
100+
items:
101+
- description: Bus (APB) clock
102+
- description: Operating clock for UART/SPI/I2C protocol
103+
104+
clock-names:
105+
items:
106+
- const: pclk
107+
- const: ipclk
108+
109+
required:
110+
- reg
111+
- clocks
112+
- clock-names
113+
114+
else:
115+
properties:
116+
reg: false
117+
clocks: false
118+
clock-names: false
119+
samsung,clkreq-on: false
120+
121+
additionalProperties: false
122+
123+
examples:
124+
- |
125+
#include <dt-bindings/interrupt-controller/arm-gic.h>
126+
#include <dt-bindings/soc/samsung,exynos-usi.h>
127+
128+
usi0: usi@138200c0 {
129+
compatible = "samsung,exynos850-usi";
130+
reg = <0x138200c0 0x20>;
131+
samsung,sysreg = <&sysreg_peri 0x1010>;
132+
samsung,mode = <USI_V2_UART>;
133+
samsung,clkreq-on; /* needed for UART mode */
134+
#address-cells = <1>;
135+
#size-cells = <1>;
136+
ranges;
137+
clocks = <&cmu_peri 32>, <&cmu_peri 31>;
138+
clock-names = "pclk", "ipclk";
139+
140+
serial_0: serial@13820000 {
141+
compatible = "samsung,exynos850-uart";
142+
reg = <0x13820000 0xc0>;
143+
interrupts = <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>;
144+
clocks = <&cmu_peri 32>, <&cmu_peri 31>;
145+
clock-names = "uart", "clk_uart_baud0";
146+
status = "disabled";
147+
};
148+
149+
hsi2c_0: i2c@13820000 {
150+
compatible = "samsung,exynosautov9-hsi2c";
151+
reg = <0x13820000 0xc0>;
152+
interrupts = <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>;
153+
#address-cells = <1>;
154+
#size-cells = <0>;
155+
clocks = <&cmu_peri 32>, <&cmu_peri 31>;
156+
clock-names = "hsi2c_pclk", "hsi2c";
157+
status = "disabled";
158+
};
159+
};

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,6 +2542,7 @@ Q: https://patchwork.kernel.org/project/linux-samsung-soc/list/
25422542
F: Documentation/arm/samsung/
25432543
F: Documentation/devicetree/bindings/arm/samsung/
25442544
F: Documentation/devicetree/bindings/power/pd-samsung.yaml
2545+
F: Documentation/devicetree/bindings/soc/samsung/
25452546
F: arch/arm/boot/dts/exynos*
25462547
F: arch/arm/boot/dts/s3c*
25472548
F: arch/arm/boot/dts/s5p*

drivers/soc/samsung/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ config EXYNOS_CHIPID
2323
Support for Samsung Exynos SoC ChipID and Adaptive Supply Voltage.
2424
This driver can also be built as module (exynos_chipid).
2525

26+
config EXYNOS_USI
27+
tristate "Exynos USI (Universal Serial Interface) driver"
28+
default ARCH_EXYNOS && ARM64
29+
depends on ARCH_EXYNOS || COMPILE_TEST
30+
select MFD_SYSCON
31+
help
32+
Enable support for USI block. USI (Universal Serial Interface) is an
33+
IP-core found in modern Samsung Exynos SoCs, like Exynos850 and
34+
ExynosAutoV0. USI block can be configured to provide one of the
35+
following serial protocols: UART, SPI or High Speed I2C.
36+
37+
This driver allows one to configure USI for desired protocol, which
38+
is usually done in USI node in Device Tree.
39+
2640
config EXYNOS_PMU
2741
bool "Exynos PMU controller driver" if COMPILE_TEST
2842
depends on ARCH_EXYNOS || ((ARM || ARM64) && COMPILE_TEST)

drivers/soc/samsung/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ obj-$(CONFIG_EXYNOS_ASV_ARM) += exynos5422-asv.o
44
obj-$(CONFIG_EXYNOS_CHIPID) += exynos_chipid.o
55
exynos_chipid-y += exynos-chipid.o exynos-asv.o
66

7+
obj-$(CONFIG_EXYNOS_USI) += exynos-usi.o
8+
79
obj-$(CONFIG_EXYNOS_PMU) += exynos-pmu.o
810

911
obj-$(CONFIG_EXYNOS_PMU_ARM_DRIVERS) += exynos3250-pmu.o exynos4-pmu.o \

drivers/soc/samsung/exynos-chipid.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ static const struct exynos_soc_id {
4242
unsigned int id;
4343
} soc_ids[] = {
4444
/* List ordered by SoC name */
45+
/* Compatible with: samsung,exynos4210-chipid */
4546
{ "EXYNOS3250", 0xE3472000 },
4647
{ "EXYNOS4210", 0x43200000 }, /* EVT0 revision */
4748
{ "EXYNOS4210", 0x43210000 },
@@ -55,6 +56,8 @@ static const struct exynos_soc_id {
5556
{ "EXYNOS5440", 0xE5440000 },
5657
{ "EXYNOS5800", 0xE5422000 },
5758
{ "EXYNOS7420", 0xE7420000 },
59+
/* Compatible with: samsung,exynos850-chipid */
60+
{ "EXYNOS7885", 0xE7885000 },
5861
{ "EXYNOS850", 0xE3830000 },
5962
{ "EXYNOSAUTOV9", 0xAAA80000 },
6063
};

drivers/soc/samsung/exynos-pmu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ static const struct of_device_id exynos_pmu_of_device_ids[] = {
9494
.compatible = "samsung,exynos5433-pmu",
9595
}, {
9696
.compatible = "samsung,exynos7-pmu",
97+
}, {
98+
.compatible = "samsung,exynos850-pmu",
9799
},
98100
{ /*sentinel*/ },
99101
};

0 commit comments

Comments
 (0)