* [PATCH v3 0/4] soc: samsung: usi: implement support for USIv1
@ 2025-01-05 16:03 Ivaylo Ivanov
2025-01-05 16:03 ` [PATCH v3 1/4] dt-bindings: soc: samsung: usi: replace USI_V2 in constants with USI_MODE Ivaylo Ivanov
` (3 more replies)
0 siblings, 4 replies; 15+ messages in thread
From: Ivaylo Ivanov @ 2025-01-05 16:03 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
Sam Protsenko, Peter Griffin
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
Hey folks,
This patch series adds support for USIv1 in the existing exynos-usi driver,
as well as dedicated sysreg compatibles for exynos8895.
The USIv1 IP-core is found on some ARM64 Exynos SoCs (like Exynos8895).
It provides selectable serial protocols (one of: HSI2C0, HSI2C1, HSI2C0_1,
SPI, UART, UART_HSI2C1). It's a bit different from USIv2 as it doesn't
have any known MMIO register map and the serial protocols that it
implements share the same register base, hence why the way of modelling it
in device trees will be with ranges, like so:
usi1: usi@10460000 {
compatible = "samsung,exynos8895-usi";
ranges = <0x0 0x10460000 0x11000>;
clocks = <1>, <2>;
clock-names = "pclk", "ipclk";
#address-cells = <1>;
#size-cells = <1>;
samsung,sysreg = <&syscon_peric0 0x1004>;
status = "disabled";
hsi2c_5: i2c@0 {
compatible = "samsung,exynos8895-hsi2c";
reg = <0x0 0x1000>;
...
};
};
This patchset also assumes that [1] and [2] have been merged before it.
Best regards,
Ivaylo
[1]: https://lore.kernel.org/all/20241222145257.31451-1-krzysztof.kozlowski@linaro.org/
[2]: https://lore.kernel.org/all/20250103082549.19419-1-krzysztof.kozlowski@linaro.org/
Changes in v3:
- drop the sysreg patch as it was applied
- add a patch at the beginning of the series for renaming all USI_V2
constants to USI_MODE_ and a patch at the end to rename them in dt
- redo the usi binding support for 8895 to hopefully match all
feedback from Krzysztof
- change the description of the usiv1 and 8895 binding patch in order
to account for the constants changes
- change the subject and description of the usiv1 driver support patch
because we're adding support for exynos8895 in the first place
- make exynos_usi_modes a two dimensional array while also accounting
for the merged usi mode constants
Changes in v2:
- add r-b from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
- restrict the possible ids of samsung,mode with an allOf:if:then
- set the properties samsung,clkreq-on and reg to false for non-usiv2
- only make use of exynos_usi_modes
- make sure pclk and ipclk are enabled
Ivaylo Ivanov (4):
dt-bindings: soc: samsung: usi: replace USI_V2 in constants with
USI_MODE
dt-bindings: soc: samsung: usi: add USIv1 and samsung,exynos8895-usi
soc: samsung: usi: implement support for USIv1 and exynos8895
arm64: dts: exynos: update all samsung,mode constants
.../bindings/soc/samsung/exynos-usi.yaml | 101 ++++++++++++------
arch/arm64/boot/dts/exynos/exynos850.dtsi | 14 +--
arch/arm64/boot/dts/exynos/exynosautov9.dtsi | 48 ++++-----
.../arm64/boot/dts/exynos/exynosautov920.dtsi | 2 +-
.../boot/dts/exynos/google/gs101-oriole.dts | 4 +-
arch/arm64/boot/dts/exynos/google/gs101.dtsi | 2 +-
drivers/soc/samsung/exynos-usi.c | 65 ++++++++---
include/dt-bindings/soc/samsung,exynos-usi.h | 11 +-
8 files changed, 163 insertions(+), 84 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 1/4] dt-bindings: soc: samsung: usi: replace USI_V2 in constants with USI_MODE
2025-01-05 16:03 [PATCH v3 0/4] soc: samsung: usi: implement support for USIv1 Ivaylo Ivanov
@ 2025-01-05 16:03 ` Ivaylo Ivanov
2025-01-06 6:24 ` Krzysztof Kozlowski
2025-01-06 7:36 ` Tudor Ambarus
2025-01-05 16:03 ` [PATCH v3 2/4] dt-bindings: soc: samsung: usi: add USIv1 and samsung,exynos8895-usi Ivaylo Ivanov
` (2 subsequent siblings)
3 siblings, 2 replies; 15+ messages in thread
From: Ivaylo Ivanov @ 2025-01-05 16:03 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
Sam Protsenko, Peter Griffin
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
In the original bindings commit, protocol mode definitions were named
with the version of the supported USI (in this case, V2) with the idea of
leaving enough room in the future for other versions of this block. This,
however, is not how the modes should be modelled. The modes are not
version specific and you should not be able to tell USI which version of
a mode to use - that has to be handled in the driver - thus encoding this
information in the binding is meaningless. Only one constant per mode is
needed, so replace USI_V2_ with USI_MODE_ in all constants in the
bindings.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
---
I wasn't sure if it was appropriate to add a Suggested-by tag for
Krzysztof because I haven't asked for his permission, so I didn't, but
if he wants to add it before merging, please do so!
These changes are a bit tricky to approach. My guess was that this would
be the best way to put it out - one patch for fixing it in the bindings
and trees, then add exynos8895 to the bindings, fiddle with the driver
and finally rename the constants in device trees. This breaks
compilation if the whole series is not applied, because the driver, the
binding and the device trees use the dt-bindings header.
If anyone thinks of a better solution to organising the
patches, let me know.
---
.../devicetree/bindings/soc/samsung/exynos-usi.yaml | 2 +-
include/dt-bindings/soc/samsung,exynos-usi.h | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
index 5b046932f..cc92a06a3 100644
--- a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
+++ b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
@@ -144,7 +144,7 @@ examples:
compatible = "samsung,exynos850-usi";
reg = <0x138200c0 0x20>;
samsung,sysreg = <&sysreg_peri 0x1010>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
samsung,clkreq-on; /* needed for UART mode */
#address-cells = <1>;
#size-cells = <1>;
diff --git a/include/dt-bindings/soc/samsung,exynos-usi.h b/include/dt-bindings/soc/samsung,exynos-usi.h
index a01af169d..b7c1406f3 100644
--- a/include/dt-bindings/soc/samsung,exynos-usi.h
+++ b/include/dt-bindings/soc/samsung,exynos-usi.h
@@ -9,9 +9,9 @@
#ifndef __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H
#define __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H
-#define USI_V2_NONE 0
-#define USI_V2_UART 1
-#define USI_V2_SPI 2
-#define USI_V2_I2C 3
+#define USI_MODE_NONE 0
+#define USI_MODE_UART 1
+#define USI_MODE_SPI 2
+#define USI_MODE_I2C 3
#endif /* __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H */
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v3 2/4] dt-bindings: soc: samsung: usi: add USIv1 and samsung,exynos8895-usi
2025-01-05 16:03 [PATCH v3 0/4] soc: samsung: usi: implement support for USIv1 Ivaylo Ivanov
2025-01-05 16:03 ` [PATCH v3 1/4] dt-bindings: soc: samsung: usi: replace USI_V2 in constants with USI_MODE Ivaylo Ivanov
@ 2025-01-05 16:03 ` Ivaylo Ivanov
2025-01-06 6:31 ` Krzysztof Kozlowski
2025-01-05 16:03 ` [PATCH v3 3/4] soc: samsung: usi: implement support for USIv1 and exynos8895 Ivaylo Ivanov
2025-01-05 16:03 ` [PATCH v3 4/4] arm64: dts: exynos: update all samsung,mode constants Ivaylo Ivanov
3 siblings, 1 reply; 15+ messages in thread
From: Ivaylo Ivanov @ 2025-01-05 16:03 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
Sam Protsenko, Peter Griffin
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
Add new constants for choosing the additional USIv1 configuration modes
in device tree. Those are further used in the USI driver to figure out
which value to write into SW_CONF register. Modify the current USI IP-core
bindings to include information about USIv1 and a compatible for
exynos8895.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
---
.../bindings/soc/samsung/exynos-usi.yaml | 107 ++++++++++++------
include/dt-bindings/soc/samsung,exynos-usi.h | 3 +
2 files changed, 74 insertions(+), 36 deletions(-)
diff --git a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
index cc92a06a3..d6c39c3e3 100644
--- a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
+++ b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
@@ -11,11 +11,21 @@ maintainers:
- Krzysztof Kozlowski <krzk@kernel.org>
description: |
- USI IP-core provides selectable serial protocol (UART, SPI or High-Speed I2C).
- USI shares almost all internal circuits within each protocol, so only one
- protocol can be chosen at a time. USI is modeled as a node with zero or more
- child nodes, each representing a serial sub-node device. The mode setting
- selects which particular function will be used.
+ The USI IP-core provides configurable support for serial protocols, enabling
+ different serial communication modes depending on the version.
+
+ In USIv1, configurations are available to enable either one or two protocols
+ simultaneously in select combinations - High-Speed I2C0, High-Speed
+ I2C1, SPI, UART, High-Speed I2C0 and I2C1 or both High-Speed
+ I2C1 and UART.
+
+ In USIv2, only one protocol can be active at a time, either UART, SPI, or
+ High-Speed I2C.
+
+ The USI core shares internal circuits across protocols, meaning only the
+ selected configuration is active at any given time. USI is modeled as a node
+ with zero or more child nodes, each representing a serial sub-node device. The
+ mode setting selects which particular function will be used.
properties:
$nodename:
@@ -64,7 +74,7 @@ properties:
samsung,mode:
$ref: /schemas/types.yaml#/definitions/uint32
- enum: [0, 1, 2, 3]
+ enum: [0, 1, 2, 3, 4, 5, 6]
description:
Selects USI function (which serial protocol to use). Refer to
<include/dt-bindings/soc/samsung,exynos-usi.h> for valid USI mode values.
@@ -101,37 +111,62 @@ required:
- samsung,sysreg
- samsung,mode
-if:
- properties:
- compatible:
- contains:
- enum:
- - samsung,exynos850-usi
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - google,gs101-usi
+ - samsung,exynos850-usi
+ - samsung,exynosautov9-usi
+ - samsung,exynosautov920-usi
+
+ then:
+ properties:
+ reg:
+ maxItems: 1
+
+ clocks:
+ items:
+ - description: Bus (APB) clock
+ - description: Operating clock for UART/SPI/I2C protocol
+
+ clock-names:
+ maxItems: 2
+
+ samsung,mode:
+ enum: [0, 1, 2, 3]
+
+ required:
+ - reg
+ - clocks
+ - clock-names
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - samsung,exynos8895-usi
+
+ then:
+ properties:
+ reg: false
+
+ clocks:
+ items:
+ - description: Bus (APB) clock
+ - description: Operating clock for UART/SPI protocol
+
+ clock-names:
+ maxItems: 2
+
+ samsung,clkreq-on: false
-then:
- properties:
- reg:
- maxItems: 1
-
- clocks:
- items:
- - description: Bus (APB) clock
- - description: Operating clock for UART/SPI/I2C protocol
-
- clock-names:
- maxItems: 2
-
- required:
- - reg
- - clocks
- - clock-names
-
-else:
- properties:
- reg: false
- clocks: false
- clock-names: false
- samsung,clkreq-on: false
+ required:
+ - clocks
+ - clock-names
additionalProperties: false
diff --git a/include/dt-bindings/soc/samsung,exynos-usi.h b/include/dt-bindings/soc/samsung,exynos-usi.h
index b7c1406f3..aab28176c 100644
--- a/include/dt-bindings/soc/samsung,exynos-usi.h
+++ b/include/dt-bindings/soc/samsung,exynos-usi.h
@@ -13,5 +13,8 @@
#define USI_MODE_UART 1
#define USI_MODE_SPI 2
#define USI_MODE_I2C 3
+#define USI_MODE_I2C1 4
+#define USI_MODE_I2C0_1 5
+#define USI_MODE_UART_I2C1 6
#endif /* __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H */
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v3 3/4] soc: samsung: usi: implement support for USIv1 and exynos8895
2025-01-05 16:03 [PATCH v3 0/4] soc: samsung: usi: implement support for USIv1 Ivaylo Ivanov
2025-01-05 16:03 ` [PATCH v3 1/4] dt-bindings: soc: samsung: usi: replace USI_V2 in constants with USI_MODE Ivaylo Ivanov
2025-01-05 16:03 ` [PATCH v3 2/4] dt-bindings: soc: samsung: usi: add USIv1 and samsung,exynos8895-usi Ivaylo Ivanov
@ 2025-01-05 16:03 ` Ivaylo Ivanov
2025-01-06 7:02 ` Krzysztof Kozlowski
2025-01-05 16:03 ` [PATCH v3 4/4] arm64: dts: exynos: update all samsung,mode constants Ivaylo Ivanov
3 siblings, 1 reply; 15+ messages in thread
From: Ivaylo Ivanov @ 2025-01-05 16:03 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
Sam Protsenko, Peter Griffin
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
USIv1 IP-core is found on some ARM64 Exynos SoCs (like Exynos8895) and
provides selectable serial protocols (one of: HSI2C0, HSI2C1, HSI2C0_1,
SPI, UART, UART_HSI2C1).
USIv1, unlike USIv2, doesn't have any known register map. Underlying
protocols that it implements have no offset, like with Exynos850.
Desired protocol can be chosen via SW_CONF register from System
Register block of the same domain as USI.
In order to select a particular protocol, the protocol has to be
selected via the System Register. Unlike USIv2, there's no need for
any setup before the given protocol becomes accessible apart from
enabling the APB clock and the protocol operating clock.
Modify the existing driver in order to allow USIv1 instances in
Exynos8895 to probe and set their protocol.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
---
drivers/soc/samsung/exynos-usi.c | 65 ++++++++++++++++++++++++++------
1 file changed, 53 insertions(+), 12 deletions(-)
diff --git a/drivers/soc/samsung/exynos-usi.c b/drivers/soc/samsung/exynos-usi.c
index 114352695..3dd8202ef 100644
--- a/drivers/soc/samsung/exynos-usi.c
+++ b/drivers/soc/samsung/exynos-usi.c
@@ -16,6 +16,18 @@
#include <dt-bindings/soc/samsung,exynos-usi.h>
+/* USIv1: System Register: SW_CONF register bits */
+#define USI_V1_SW_CONF_NONE 0x0
+#define USI_V1_SW_CONF_I2C0 0x1
+#define USI_V1_SW_CONF_I2C1 0x2
+#define USI_V1_SW_CONF_I2C0_1 0x3
+#define USI_V1_SW_CONF_SPI 0x4
+#define USI_V1_SW_CONF_UART 0x8
+#define USI_V1_SW_CONF_UART_I2C1 0xa
+#define USI_V1_SW_CONF_MASK (USI_V1_SW_CONF_I2C0 | USI_V1_SW_CONF_I2C1 | \
+ USI_V1_SW_CONF_I2C0_1 | USI_V1_SW_CONF_SPI | \
+ USI_V1_SW_CONF_UART | USI_V1_SW_CONF_UART_I2C1)
+
/* USIv2: System Register: SW_CONF register bits */
#define USI_V2_SW_CONF_NONE 0x0
#define USI_V2_SW_CONF_UART BIT(0)
@@ -34,7 +46,8 @@
#define USI_OPTION_CLKSTOP_ON BIT(2)
enum exynos_usi_ver {
- USI_VER2 = 2,
+ USI_VER1 = 1,
+ USI_VER2,
};
struct exynos_usi_variant {
@@ -66,19 +79,39 @@ struct exynos_usi_mode {
unsigned int val; /* mode register value */
};
-static const struct exynos_usi_mode exynos_usi_modes[] = {
- [USI_V2_NONE] = { .name = "none", .val = USI_V2_SW_CONF_NONE },
- [USI_V2_UART] = { .name = "uart", .val = USI_V2_SW_CONF_UART },
- [USI_V2_SPI] = { .name = "spi", .val = USI_V2_SW_CONF_SPI },
- [USI_V2_I2C] = { .name = "i2c", .val = USI_V2_SW_CONF_I2C },
+#define USI_MODES_MAX (USI_MODE_UART_I2C1 + 1)
+static const struct exynos_usi_mode exynos_usi_modes[][USI_MODES_MAX] = {
+ [USI_VER1] = {
+ [USI_MODE_NONE] = { .name = "none", .val = USI_V1_SW_CONF_NONE },
+ [USI_MODE_UART] = { .name = "uart", .val = USI_V1_SW_CONF_UART },
+ [USI_MODE_SPI] = { .name = "spi", .val = USI_V1_SW_CONF_SPI },
+ [USI_MODE_I2C] = { .name = "i2c", .val = USI_V1_SW_CONF_I2C0 },
+ [USI_MODE_I2C1] = { .name = "i2c1", .val = USI_V1_SW_CONF_I2C1 },
+ [USI_MODE_I2C0_1] = { .name = "i2c0_1", .val = USI_V1_SW_CONF_I2C0_1 },
+ [USI_MODE_UART_I2C1] = { .name = "uart_i2c1", .val = USI_V1_SW_CONF_UART_I2C1 },
+ }, [USI_VER2] = {
+ [USI_MODE_NONE] = { .name = "none", .val = USI_V2_SW_CONF_NONE },
+ [USI_MODE_UART] = { .name = "uart", .val = USI_V2_SW_CONF_UART },
+ [USI_MODE_SPI] = { .name = "spi", .val = USI_V2_SW_CONF_SPI },
+ [USI_MODE_I2C] = { .name = "i2c", .val = USI_V2_SW_CONF_I2C },
+ },
};
static const char * const exynos850_usi_clk_names[] = { "pclk", "ipclk" };
static const struct exynos_usi_variant exynos850_usi_data = {
.ver = USI_VER2,
.sw_conf_mask = USI_V2_SW_CONF_MASK,
- .min_mode = USI_V2_NONE,
- .max_mode = USI_V2_I2C,
+ .min_mode = USI_MODE_NONE,
+ .max_mode = USI_MODE_I2C,
+ .num_clks = ARRAY_SIZE(exynos850_usi_clk_names),
+ .clk_names = exynos850_usi_clk_names,
+};
+
+static const struct exynos_usi_variant exynos8895_usi_data = {
+ .ver = USI_VER1,
+ .sw_conf_mask = USI_V1_SW_CONF_MASK,
+ .min_mode = USI_MODE_NONE,
+ .max_mode = USI_MODE_UART_I2C1,
.num_clks = ARRAY_SIZE(exynos850_usi_clk_names),
.clk_names = exynos850_usi_clk_names,
};
@@ -88,6 +121,10 @@ static const struct of_device_id exynos_usi_dt_match[] = {
.compatible = "samsung,exynos850-usi",
.data = &exynos850_usi_data,
},
+ {
+ .compatible = "samsung,exynos8895-usi",
+ .data = &exynos8895_usi_data,
+ },
{ } /* sentinel */
};
MODULE_DEVICE_TABLE(of, exynos_usi_dt_match);
@@ -109,14 +146,15 @@ static int exynos_usi_set_sw_conf(struct exynos_usi *usi, size_t mode)
if (mode < usi->data->min_mode || mode > usi->data->max_mode)
return -EINVAL;
- val = exynos_usi_modes[mode].val;
+ val = exynos_usi_modes[usi->data->ver][mode].val;
ret = regmap_update_bits(usi->sysreg, usi->sw_conf,
usi->data->sw_conf_mask, val);
if (ret)
return ret;
usi->mode = mode;
- dev_dbg(usi->dev, "protocol: %s\n", exynos_usi_modes[usi->mode].name);
+ dev_dbg(usi->dev, "protocol: %s\n",
+ exynos_usi_modes[usi->data->ver][usi->mode].name);
return 0;
}
@@ -169,9 +207,12 @@ static int exynos_usi_configure(struct exynos_usi *usi)
return ret;
if (usi->data->ver == USI_VER2)
- return exynos_usi_enable(usi);
+ ret = exynos_usi_enable(usi);
+ else
+ ret = clk_bulk_prepare_enable(usi->data->num_clks,
+ usi->clks);
- return 0;
+ return ret;
}
static int exynos_usi_parse_dt(struct device_node *np, struct exynos_usi *usi)
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v3 4/4] arm64: dts: exynos: update all samsung,mode constants
2025-01-05 16:03 [PATCH v3 0/4] soc: samsung: usi: implement support for USIv1 Ivaylo Ivanov
` (2 preceding siblings ...)
2025-01-05 16:03 ` [PATCH v3 3/4] soc: samsung: usi: implement support for USIv1 and exynos8895 Ivaylo Ivanov
@ 2025-01-05 16:03 ` Ivaylo Ivanov
3 siblings, 0 replies; 15+ messages in thread
From: Ivaylo Ivanov @ 2025-01-05 16:03 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
Sam Protsenko, Peter Griffin
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
Update all samsung,mode property values to account for renaming USI_V2
constants to USI_MODE in the bindings.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
---
arch/arm64/boot/dts/exynos/exynos850.dtsi | 14 +++---
arch/arm64/boot/dts/exynos/exynosautov9.dtsi | 48 +++++++++----------
.../arm64/boot/dts/exynos/exynosautov920.dtsi | 2 +-
.../boot/dts/exynos/google/gs101-oriole.dts | 4 +-
arch/arm64/boot/dts/exynos/google/gs101.dtsi | 2 +-
5 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/arch/arm64/boot/dts/exynos/exynos850.dtsi b/arch/arm64/boot/dts/exynos/exynos850.dtsi
index f1c8b4613..cb55015c8 100644
--- a/arch/arm64/boot/dts/exynos/exynos850.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos850.dtsi
@@ -651,7 +651,7 @@ usi_uart: usi@138200c0 {
compatible = "samsung,exynos850-usi";
reg = <0x138200c0 0x20>;
samsung,sysreg = <&sysreg_peri 0x1010>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -677,7 +677,7 @@ usi_hsi2c_0: usi@138a00c0 {
compatible = "samsung,exynos850-usi";
reg = <0x138a00c0 0x20>;
samsung,sysreg = <&sysreg_peri 0x1020>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -706,7 +706,7 @@ usi_hsi2c_1: usi@138b00c0 {
compatible = "samsung,exynos850-usi";
reg = <0x138b00c0 0x20>;
samsung,sysreg = <&sysreg_peri 0x1030>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -735,7 +735,7 @@ usi_hsi2c_2: usi@138c00c0 {
compatible = "samsung,exynos850-usi";
reg = <0x138c00c0 0x20>;
samsung,sysreg = <&sysreg_peri 0x1040>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -764,7 +764,7 @@ usi_spi_0: usi@139400c0 {
compatible = "samsung,exynos850-usi";
reg = <0x139400c0 0x20>;
samsung,sysreg = <&sysreg_peri 0x1050>;
- samsung,mode = <USI_V2_SPI>;
+ samsung,mode = <USI_MODE_SPI>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -796,7 +796,7 @@ usi_cmgp0: usi@11d000c0 {
compatible = "samsung,exynos850-usi";
reg = <0x11d000c0 0x20>;
samsung,sysreg = <&sysreg_cmgp 0x2000>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -855,7 +855,7 @@ usi_cmgp1: usi@11d200c0 {
compatible = "samsung,exynos850-usi";
reg = <0x11d200c0 0x20>;
samsung,sysreg = <&sysreg_cmgp 0x2010>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
diff --git a/arch/arm64/boot/dts/exynos/exynosautov9.dtsi b/arch/arm64/boot/dts/exynos/exynosautov9.dtsi
index b36292a7d..66628cb32 100644
--- a/arch/arm64/boot/dts/exynos/exynosautov9.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynosautov9.dtsi
@@ -442,7 +442,7 @@ usi_0: usi@103000c0 {
"samsung,exynos850-usi";
reg = <0x103000c0 0x20>;
samsung,sysreg = <&syscon_peric0 0x1000>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -505,7 +505,7 @@ usi_i2c_0: usi@103100c0 {
"samsung,exynos850-usi";
reg = <0x103100c0 0x20>;
samsung,sysreg = <&syscon_peric0 0x1004>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -534,7 +534,7 @@ usi_1: usi@103200c0 {
"samsung,exynos850-usi";
reg = <0x103200c0 0x20>;
samsung,sysreg = <&syscon_peric0 0x1008>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -597,7 +597,7 @@ usi_i2c_1: usi@103300c0 {
"samsung,exynos850-usi";
reg = <0x103300c0 0x20>;
samsung,sysreg = <&syscon_peric0 0x100c>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -626,7 +626,7 @@ usi_2: usi@103400c0 {
"samsung,exynos850-usi";
reg = <0x103400c0 0x20>;
samsung,sysreg = <&syscon_peric0 0x1010>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -689,7 +689,7 @@ usi_i2c_2: usi@103500c0 {
"samsung,exynos850-usi";
reg = <0x103500c0 0x20>;
samsung,sysreg = <&syscon_peric0 0x1014>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -718,7 +718,7 @@ usi_3: usi@103600c0 {
"samsung,exynos850-usi";
reg = <0x103600c0 0x20>;
samsung,sysreg = <&syscon_peric0 0x1018>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -781,7 +781,7 @@ usi_i2c_3: usi@103700c0 {
"samsung,exynos850-usi";
reg = <0x103700c0 0x20>;
samsung,sysreg = <&syscon_peric0 0x101c>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -810,7 +810,7 @@ usi_4: usi@103800c0 {
"samsung,exynos850-usi";
reg = <0x103800c0 0x20>;
samsung,sysreg = <&syscon_peric0 0x1020>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -873,7 +873,7 @@ usi_i2c_4: usi@103900c0 {
"samsung,exynos850-usi";
reg = <0x103900c0 0x20>;
samsung,sysreg = <&syscon_peric0 0x1024>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -902,7 +902,7 @@ usi_5: usi@103a00c0 {
"samsung,exynos850-usi";
reg = <0x103a00c0 0x20>;
samsung,sysreg = <&syscon_peric0 0x1028>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -965,7 +965,7 @@ usi_i2c_5: usi@103b00c0 {
"samsung,exynos850-usi";
reg = <0x103b00c0 0x20>;
samsung,sysreg = <&syscon_peric0 0x102c>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -994,7 +994,7 @@ usi_6: usi@109000c0 {
"samsung,exynos850-usi";
reg = <0x109000c0 0x20>;
samsung,sysreg = <&syscon_peric1 0x1000>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -1057,7 +1057,7 @@ usi_i2c_6: usi@109100c0 {
"samsung,exynos850-usi";
reg = <0x109100c0 0x20>;
samsung,sysreg = <&syscon_peric1 0x1004>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -1086,7 +1086,7 @@ usi_7: usi@109200c0 {
"samsung,exynos850-usi";
reg = <0x109200c0 0x20>;
samsung,sysreg = <&syscon_peric1 0x1008>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -1149,7 +1149,7 @@ usi_i2c_7: usi@109300c0 {
"samsung,exynos850-usi";
reg = <0x109300c0 0x20>;
samsung,sysreg = <&syscon_peric1 0x100c>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -1178,7 +1178,7 @@ usi_8: usi@109400c0 {
"samsung,exynos850-usi";
reg = <0x109400c0 0x20>;
samsung,sysreg = <&syscon_peric1 0x1010>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -1241,7 +1241,7 @@ usi_i2c_8: usi@109500c0 {
"samsung,exynos850-usi";
reg = <0x109500c0 0x20>;
samsung,sysreg = <&syscon_peric1 0x1014>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -1270,7 +1270,7 @@ usi_9: usi@109600c0 {
"samsung,exynos850-usi";
reg = <0x109600c0 0x20>;
samsung,sysreg = <&syscon_peric1 0x1018>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -1333,7 +1333,7 @@ usi_i2c_9: usi@109700c0 {
"samsung,exynos850-usi";
reg = <0x109700c0 0x20>;
samsung,sysreg = <&syscon_peric1 0x101c>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -1362,7 +1362,7 @@ usi_10: usi@109800c0 {
"samsung,exynos850-usi";
reg = <0x109800c0 0x20>;
samsung,sysreg = <&syscon_peric1 0x1020>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -1425,7 +1425,7 @@ usi_i2c_10: usi@109900c0 {
"samsung,exynos850-usi";
reg = <0x109900c0 0x20>;
samsung,sysreg = <&syscon_peric1 0x1024>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -1454,7 +1454,7 @@ usi_11: usi@109a00c0 {
"samsung,exynos850-usi";
reg = <0x109a00c0 0x20>;
samsung,sysreg = <&syscon_peric1 0x1028>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
@@ -1515,7 +1515,7 @@ usi_i2c_11: usi@109b00c0 {
"samsung,exynos850-usi";
reg = <0x109b00c0 0x20>;
samsung,sysreg = <&syscon_peric1 0x102c>;
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
diff --git a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
index c759134c9..6e9007518 100644
--- a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
@@ -223,7 +223,7 @@ usi_0: usi@108800c0 {
"samsung,exynos850-usi";
reg = <0x108800c0 0x20>;
samsung,sysreg = <&syscon_peric0 0x1000>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
diff --git a/arch/arm64/boot/dts/exynos/google/gs101-oriole.dts b/arch/arm64/boot/dts/exynos/google/gs101-oriole.dts
index 387fb779b..b73c152c7 100644
--- a/arch/arm64/boot/dts/exynos/google/gs101-oriole.dts
+++ b/arch/arm64/boot/dts/exynos/google/gs101-oriole.dts
@@ -161,12 +161,12 @@ &usi_uart {
};
&usi8 {
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
status = "okay";
};
&usi12 {
- samsung,mode = <USI_V2_I2C>;
+ samsung,mode = <USI_MODE_I2C>;
status = "okay";
};
diff --git a/arch/arm64/boot/dts/exynos/google/gs101.dtsi b/arch/arm64/boot/dts/exynos/google/gs101.dtsi
index 302c5beb2..473db46aa 100644
--- a/arch/arm64/boot/dts/exynos/google/gs101.dtsi
+++ b/arch/arm64/boot/dts/exynos/google/gs101.dtsi
@@ -825,7 +825,7 @@ usi_uart: usi@10a000c0 {
<&cmu_peric0 CLK_GOUT_PERIC0_PERIC0_TOP1_IPCLK_0>;
clock-names = "pclk", "ipclk";
samsung,sysreg = <&sysreg_peric0 0x1020>;
- samsung,mode = <USI_V2_UART>;
+ samsung,mode = <USI_MODE_UART>;
status = "disabled";
serial_0: serial@10a00000 {
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v3 1/4] dt-bindings: soc: samsung: usi: replace USI_V2 in constants with USI_MODE
2025-01-05 16:03 ` [PATCH v3 1/4] dt-bindings: soc: samsung: usi: replace USI_V2 in constants with USI_MODE Ivaylo Ivanov
@ 2025-01-06 6:24 ` Krzysztof Kozlowski
2025-01-06 7:09 ` Ivaylo Ivanov
2025-01-06 7:36 ` Tudor Ambarus
1 sibling, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-06 6:24 UTC (permalink / raw)
To: Ivaylo Ivanov
Cc: Rob Herring, Conor Dooley, Alim Akhtar, Sam Protsenko,
Peter Griffin, devicetree, linux-arm-kernel, linux-samsung-soc,
linux-kernel
On Sun, Jan 05, 2025 at 06:03:43PM +0200, Ivaylo Ivanov wrote:
> diff --git a/include/dt-bindings/soc/samsung,exynos-usi.h b/include/dt-bindings/soc/samsung,exynos-usi.h
> index a01af169d..b7c1406f3 100644
> --- a/include/dt-bindings/soc/samsung,exynos-usi.h
> +++ b/include/dt-bindings/soc/samsung,exynos-usi.h
> @@ -9,9 +9,9 @@
> #ifndef __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H
> #define __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H
>
> -#define USI_V2_NONE 0
> -#define USI_V2_UART 1
> -#define USI_V2_SPI 2
> -#define USI_V2_I2C 3
> +#define USI_MODE_NONE 0
> +#define USI_MODE_UART 1
> +#define USI_MODE_SPI 2
> +#define USI_MODE_I2C 3
This breaks ABI and does not build. You still need also:
#define USI_V2_NONE USI_MODE_NONE
and same for the rest.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 2/4] dt-bindings: soc: samsung: usi: add USIv1 and samsung,exynos8895-usi
2025-01-05 16:03 ` [PATCH v3 2/4] dt-bindings: soc: samsung: usi: add USIv1 and samsung,exynos8895-usi Ivaylo Ivanov
@ 2025-01-06 6:31 ` Krzysztof Kozlowski
2025-01-06 7:11 ` Ivaylo Ivanov
0 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-06 6:31 UTC (permalink / raw)
To: Ivaylo Ivanov
Cc: Rob Herring, Conor Dooley, Alim Akhtar, Sam Protsenko,
Peter Griffin, devicetree, linux-arm-kernel, linux-samsung-soc,
linux-kernel
On Sun, Jan 05, 2025 at 06:03:44PM +0200, Ivaylo Ivanov wrote:
> samsung,mode:
> $ref: /schemas/types.yaml#/definitions/uint32
> - enum: [0, 1, 2, 3]
> + enum: [0, 1, 2, 3, 4, 5, 6]
> description:
> Selects USI function (which serial protocol to use). Refer to
> <include/dt-bindings/soc/samsung,exynos-usi.h> for valid USI mode values.
> @@ -101,37 +111,62 @@ required:
> - samsung,sysreg
> - samsung,mode
>
> -if:
> - properties:
> - compatible:
> - contains:
> - enum:
> - - samsung,exynos850-usi
> +allOf:
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - google,gs101-usi
> + - samsung,exynos850-usi
> + - samsung,exynosautov9-usi
> + - samsung,exynosautov920-usi
I made mistake during last review - the binding had a confusing "else"
here, but that else was a no-op. All existing compatibles are fallbacked
to samsung,exynos850-usi, so previous code "contains: enum:
samsung,exynos850-usi" was covering everything.
You can drop other variants and keep the original samsung,exynos850-usi
only.
> +
> + then:
> + properties:
> + reg:
> + maxItems: 1
> +
> + clocks:
> + items:
> + - description: Bus (APB) clock
> + - description: Operating clock for UART/SPI/I2C protocol
> +
> + clock-names:
> + maxItems: 2
> +
> + samsung,mode:
> + enum: [0, 1, 2, 3]
> +
> + required:
> + - reg
> + - clocks
> + - clock-names
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - samsung,exynos8895-usi
I don't see where this compatible is documented.
> +
> + then:
> + properties:
> + reg: false
> +
> + clocks:
> + items:
> + - description: Bus (APB) clock
> + - description: Operating clock for UART/SPI protocol
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 3/4] soc: samsung: usi: implement support for USIv1 and exynos8895
2025-01-05 16:03 ` [PATCH v3 3/4] soc: samsung: usi: implement support for USIv1 and exynos8895 Ivaylo Ivanov
@ 2025-01-06 7:02 ` Krzysztof Kozlowski
0 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-06 7:02 UTC (permalink / raw)
To: Ivaylo Ivanov
Cc: Rob Herring, Conor Dooley, Alim Akhtar, Sam Protsenko,
Peter Griffin, devicetree, linux-arm-kernel, linux-samsung-soc,
linux-kernel
On Sun, Jan 05, 2025 at 06:03:45PM +0200, Ivaylo Ivanov wrote:
> @@ -169,9 +207,12 @@ static int exynos_usi_configure(struct exynos_usi *usi)
> return ret;
>
> if (usi->data->ver == USI_VER2)
> - return exynos_usi_enable(usi);
> + ret = exynos_usi_enable(usi);
> + else
> + ret = clk_bulk_prepare_enable(usi->data->num_clks,
> + usi->clks);
You need now exynos_usi_remove() callback and also error path after
populate at end of probe.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 1/4] dt-bindings: soc: samsung: usi: replace USI_V2 in constants with USI_MODE
2025-01-06 6:24 ` Krzysztof Kozlowski
@ 2025-01-06 7:09 ` Ivaylo Ivanov
2025-01-06 7:28 ` Krzysztof Kozlowski
0 siblings, 1 reply; 15+ messages in thread
From: Ivaylo Ivanov @ 2025-01-06 7:09 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Rob Herring, Conor Dooley, Alim Akhtar, Sam Protsenko,
Peter Griffin, devicetree, linux-arm-kernel, linux-samsung-soc,
linux-kernel
On 1/6/25 08:24, Krzysztof Kozlowski wrote:
> On Sun, Jan 05, 2025 at 06:03:43PM +0200, Ivaylo Ivanov wrote:
>> diff --git a/include/dt-bindings/soc/samsung,exynos-usi.h b/include/dt-bindings/soc/samsung,exynos-usi.h
>> index a01af169d..b7c1406f3 100644
>> --- a/include/dt-bindings/soc/samsung,exynos-usi.h
>> +++ b/include/dt-bindings/soc/samsung,exynos-usi.h
>> @@ -9,9 +9,9 @@
>> #ifndef __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H
>> #define __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H
>>
>> -#define USI_V2_NONE 0
>> -#define USI_V2_UART 1
>> -#define USI_V2_SPI 2
>> -#define USI_V2_I2C 3
>> +#define USI_MODE_NONE 0
>> +#define USI_MODE_UART 1
>> +#define USI_MODE_SPI 2
>> +#define USI_MODE_I2C 3
> This breaks ABI and does not build. You still need also:
> #define USI_V2_NONE USI_MODE_NONE
> and same for the rest.
Alright, sounds good to me. That way I shouldn't s/USI_V2/USI_MODE/g
for the other SoC device trees, right? Should I also mention with a
comment that the V2 constants are deprecated?
Best regards,
Ivaylo
>
> Best regards,
> Krzysztof
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 2/4] dt-bindings: soc: samsung: usi: add USIv1 and samsung,exynos8895-usi
2025-01-06 6:31 ` Krzysztof Kozlowski
@ 2025-01-06 7:11 ` Ivaylo Ivanov
0 siblings, 0 replies; 15+ messages in thread
From: Ivaylo Ivanov @ 2025-01-06 7:11 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Rob Herring, Conor Dooley, Alim Akhtar, Sam Protsenko,
Peter Griffin, devicetree, linux-arm-kernel, linux-samsung-soc,
linux-kernel
On 1/6/25 08:31, Krzysztof Kozlowski wrote:
> On Sun, Jan 05, 2025 at 06:03:44PM +0200, Ivaylo Ivanov wrote:
>> samsung,mode:
>> $ref: /schemas/types.yaml#/definitions/uint32
>> - enum: [0, 1, 2, 3]
>> + enum: [0, 1, 2, 3, 4, 5, 6]
>> description:
>> Selects USI function (which serial protocol to use). Refer to
>> <include/dt-bindings/soc/samsung,exynos-usi.h> for valid USI mode values.
>> @@ -101,37 +111,62 @@ required:
>> - samsung,sysreg
>> - samsung,mode
>>
>> -if:
>> - properties:
>> - compatible:
>> - contains:
>> - enum:
>> - - samsung,exynos850-usi
>> +allOf:
>> + - if:
>> + properties:
>> + compatible:
>> + contains:
>> + enum:
>> + - google,gs101-usi
>> + - samsung,exynos850-usi
>> + - samsung,exynosautov9-usi
>> + - samsung,exynosautov920-usi
> I made mistake during last review - the binding had a confusing "else"
> here, but that else was a no-op. All existing compatibles are fallbacked
> to samsung,exynos850-usi, so previous code "contains: enum:
> samsung,exynos850-usi" was covering everything.
>
> You can drop other variants and keep the original samsung,exynos850-usi
> only.
Yeah I thought so too. It's fine, will fix in the next revision.
>
>> +
>> + then:
>> + properties:
>> + reg:
>> + maxItems: 1
>> +
>> + clocks:
>> + items:
>> + - description: Bus (APB) clock
>> + - description: Operating clock for UART/SPI/I2C protocol
>> +
>> + clock-names:
>> + maxItems: 2
>> +
>> + samsung,mode:
>> + enum: [0, 1, 2, 3]
>> +
>> + required:
>> + - reg
>> + - clocks
>> + - clock-names
>> +
>> + - if:
>> + properties:
>> + compatible:
>> + contains:
>> + enum:
>> + - samsung,exynos8895-usi
> I don't see where this compatible is documented.
Right, ommited that. Yet dtbs_check W=1 still didn't catch that.
Thanks for the feedback!
Best regards,
Ivaylo
>
>> +
>> + then:
>> + properties:
>> + reg: false
>> +
>> + clocks:
>> + items:
>> + - description: Bus (APB) clock
>> + - description: Operating clock for UART/SPI protocol
> Best regards,
> Krzysztof
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 1/4] dt-bindings: soc: samsung: usi: replace USI_V2 in constants with USI_MODE
2025-01-06 7:09 ` Ivaylo Ivanov
@ 2025-01-06 7:28 ` Krzysztof Kozlowski
0 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-06 7:28 UTC (permalink / raw)
To: Ivaylo Ivanov
Cc: Rob Herring, Conor Dooley, Alim Akhtar, Sam Protsenko,
Peter Griffin, devicetree, linux-arm-kernel, linux-samsung-soc,
linux-kernel
On 06/01/2025 08:09, Ivaylo Ivanov wrote:
>>>
>>> -#define USI_V2_NONE 0
>>> -#define USI_V2_UART 1
>>> -#define USI_V2_SPI 2
>>> -#define USI_V2_I2C 3
>>> +#define USI_MODE_NONE 0
>>> +#define USI_MODE_UART 1
>>> +#define USI_MODE_SPI 2
>>> +#define USI_MODE_I2C 3
>> This breaks ABI and does not build. You still need also:
>> #define USI_V2_NONE USI_MODE_NONE
>> and same for the rest.
>
> Alright, sounds good to me. That way I shouldn't s/USI_V2/USI_MODE/g
> for the other SoC device trees, right? Should I also mention with a
You can change them as well, because USI_MODE_XXX will be preferred from
now on. The DTS commit will just wait one cycle till bindings get accepted.
> comment that the V2 constants are deprecated?
Yes, this would be good.
Thanks for working on this.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 1/4] dt-bindings: soc: samsung: usi: replace USI_V2 in constants with USI_MODE
2025-01-05 16:03 ` [PATCH v3 1/4] dt-bindings: soc: samsung: usi: replace USI_V2 in constants with USI_MODE Ivaylo Ivanov
2025-01-06 6:24 ` Krzysztof Kozlowski
@ 2025-01-06 7:36 ` Tudor Ambarus
2025-01-06 7:41 ` Ivaylo Ivanov
1 sibling, 1 reply; 15+ messages in thread
From: Tudor Ambarus @ 2025-01-06 7:36 UTC (permalink / raw)
To: Ivaylo Ivanov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alim Akhtar, Sam Protsenko, Peter Griffin
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
Hiya,
On 1/5/25 4:03 PM, Ivaylo Ivanov wrote:
> +#define USI_MODE_NONE 0
> +#define USI_MODE_UART 1
> +#define USI_MODE_SPI 2
> +#define USI_MODE_I2C 3
USI_CONFIG register refers to the protocol selection with USI_I2C,
USI_SPI, USI_UART. How about getting rid of the MODE from the name?
Cheers,
ta
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 1/4] dt-bindings: soc: samsung: usi: replace USI_V2 in constants with USI_MODE
2025-01-06 7:36 ` Tudor Ambarus
@ 2025-01-06 7:41 ` Ivaylo Ivanov
2025-01-06 8:50 ` Krzysztof Kozlowski
0 siblings, 1 reply; 15+ messages in thread
From: Ivaylo Ivanov @ 2025-01-06 7:41 UTC (permalink / raw)
To: Tudor Ambarus, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alim Akhtar, Sam Protsenko, Peter Griffin
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
On 1/6/25 09:36, Tudor Ambarus wrote:
> Hiya,
>
> On 1/5/25 4:03 PM, Ivaylo Ivanov wrote:
>> +#define USI_MODE_NONE 0
>> +#define USI_MODE_UART 1
>> +#define USI_MODE_SPI 2
>> +#define USI_MODE_I2C 3
> USI_CONFIG register refers to the protocol selection with USI_I2C,
> USI_SPI, USI_UART. How about getting rid of the MODE from the name?
I thought about that too but I believe that mentioning that these constants
are for mode selection in their name is generally a good practice. Let me know
if dropping _MODE is really needed.
Best regards,
Ivaylo
>
> Cheers,
> ta
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 1/4] dt-bindings: soc: samsung: usi: replace USI_V2 in constants with USI_MODE
2025-01-06 7:41 ` Ivaylo Ivanov
@ 2025-01-06 8:50 ` Krzysztof Kozlowski
2025-01-06 9:10 ` Tudor Ambarus
0 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-06 8:50 UTC (permalink / raw)
To: Ivaylo Ivanov, Tudor Ambarus, Rob Herring, Conor Dooley,
Alim Akhtar, Sam Protsenko, Peter Griffin
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
On 06/01/2025 08:41, Ivaylo Ivanov wrote:
> On 1/6/25 09:36, Tudor Ambarus wrote:
>> Hiya,
>>
>> On 1/5/25 4:03 PM, Ivaylo Ivanov wrote:
>>> +#define USI_MODE_NONE 0
>>> +#define USI_MODE_UART 1
>>> +#define USI_MODE_SPI 2
>>> +#define USI_MODE_I2C 3
>> USI_CONFIG register refers to the protocol selection with USI_I2C,
>> USI_SPI, USI_UART. How about getting rid of the MODE from the name?
>
> I thought about that too but I believe that mentioning that these constants
> are for mode selection in their name is generally a good practice. Let me know
> if dropping _MODE is really needed.
I am fine with both, MODE feels a bit more descriptive indicating how
the USI should be configured.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v3 1/4] dt-bindings: soc: samsung: usi: replace USI_V2 in constants with USI_MODE
2025-01-06 8:50 ` Krzysztof Kozlowski
@ 2025-01-06 9:10 ` Tudor Ambarus
0 siblings, 0 replies; 15+ messages in thread
From: Tudor Ambarus @ 2025-01-06 9:10 UTC (permalink / raw)
To: Krzysztof Kozlowski, Ivaylo Ivanov, Rob Herring, Conor Dooley,
Alim Akhtar, Sam Protsenko, Peter Griffin
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
On 1/6/25 8:50 AM, Krzysztof Kozlowski wrote:
> On 06/01/2025 08:41, Ivaylo Ivanov wrote:
>> On 1/6/25 09:36, Tudor Ambarus wrote:
>>> Hiya,
>>>
>>> On 1/5/25 4:03 PM, Ivaylo Ivanov wrote:
>>>> +#define USI_MODE_NONE 0
>>>> +#define USI_MODE_UART 1
>>>> +#define USI_MODE_SPI 2
>>>> +#define USI_MODE_I2C 3
>>> USI_CONFIG register refers to the protocol selection with USI_I2C,
>>> USI_SPI, USI_UART. How about getting rid of the MODE from the name?
>>
>> I thought about that too but I believe that mentioning that these constants
>> are for mode selection in their name is generally a good practice. Let me know
>> if dropping _MODE is really needed.
no strong requirement.
> I am fine with both, MODE feels a bit more descriptive indicating how
> the USI should be configured.
Fine by me to keep MODE in the name.
Cheers,
ta
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2025-01-06 9:12 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-05 16:03 [PATCH v3 0/4] soc: samsung: usi: implement support for USIv1 Ivaylo Ivanov
2025-01-05 16:03 ` [PATCH v3 1/4] dt-bindings: soc: samsung: usi: replace USI_V2 in constants with USI_MODE Ivaylo Ivanov
2025-01-06 6:24 ` Krzysztof Kozlowski
2025-01-06 7:09 ` Ivaylo Ivanov
2025-01-06 7:28 ` Krzysztof Kozlowski
2025-01-06 7:36 ` Tudor Ambarus
2025-01-06 7:41 ` Ivaylo Ivanov
2025-01-06 8:50 ` Krzysztof Kozlowski
2025-01-06 9:10 ` Tudor Ambarus
2025-01-05 16:03 ` [PATCH v3 2/4] dt-bindings: soc: samsung: usi: add USIv1 and samsung,exynos8895-usi Ivaylo Ivanov
2025-01-06 6:31 ` Krzysztof Kozlowski
2025-01-06 7:11 ` Ivaylo Ivanov
2025-01-05 16:03 ` [PATCH v3 3/4] soc: samsung: usi: implement support for USIv1 and exynos8895 Ivaylo Ivanov
2025-01-06 7:02 ` Krzysztof Kozlowski
2025-01-05 16:03 ` [PATCH v3 4/4] arm64: dts: exynos: update all samsung,mode constants Ivaylo Ivanov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).