From: Sam Protsenko <semen.protsenko@linaro.org> Date: 2021-12-01 19:05:04
Modern ARM64 Samsung Exynos SoCs (like Exynos Auto V9 and Exynos850) use
pretty much the same High-Speed I2C controller supported in i2c-exynos5
driver ("samsung,exynos7-hsi2c" variant), but with some differences:
- timings are now calculated and configured a bit differently
- two clocks are now provided to HSI2C controller (and must be
asserted during I2C operation and register access)
This patch series implements these changes, making it possible to use
HSI2C driver on modern Exynos SoCs.
Another change in mentioned SoCs is that HSI2C controller is now a part
of USIv2 IP-core. But no USI modifications are needed in HSI2C driver,
as all USI related configuration is done in USI driver independently.
USI driver is added in [1] series (or its later revision, if available).
To make HSI2C functional, both patch series (this one and [1]) have to
be applied, but those can be applied independently.
[1] https://patchwork.kernel.org/project/linux-samsung-soc/cover/20211130111325.29328-1-semen.protsenko@linaro.org/
Jaewon Kim (2):
dt-bindings: i2c: exynos5: Add exynosautov9-hsi2c compatible
i2c: exynos5: Add support for ExynosAutoV9 SoC
Sam Protsenko (4):
dt-bindings: i2c: exynos5: Convert to dtschema
dt-bindings: i2c: exynos5: Add bus clock
i2c: exynos5: Add bus clock support
i2c: exynos5: Mention Exynos850 and ExynosAutoV9 in Kconfig
.../devicetree/bindings/i2c/i2c-exynos5.txt | 53 ---------
.../devicetree/bindings/i2c/i2c-exynos5.yaml | 91 +++++++++++++++
drivers/i2c/busses/Kconfig | 2 +-
drivers/i2c/busses/i2c-exynos5.c | 108 +++++++++++++++---
4 files changed, 183 insertions(+), 71 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-exynos5.txt
create mode 100644 Documentation/devicetree/bindings/i2c/i2c-exynos5.yaml
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Sam Protsenko <semen.protsenko@linaro.org> Date: 2021-12-01 19:05:21
Convert Samsung Exynos High Speed I2C bindings doc to DT schema format.
Changes during bindings conversion:
1. Added missing required clock properties (driver fails when it's
unable to get the clock)
2. Removed properties and descriptions that can be found in
schemas/i2c/i2c-controller.yaml [1]
3. Fixed the example so it can be validated by dtschema
[1] https://github.com/robherring/dt-schema/blob/master/schemas/i2c/i2c-controller.yaml
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
.../devicetree/bindings/i2c/i2c-exynos5.txt | 53 ------------
.../devicetree/bindings/i2c/i2c-exynos5.yaml | 80 +++++++++++++++++++
2 files changed, 80 insertions(+), 53 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-exynos5.txt
create mode 100644 Documentation/devicetree/bindings/i2c/i2c-exynos5.yaml
@@ -1,53 +0,0 @@-* Samsung's High Speed I2C controller--The Samsung's High Speed I2C controller is used to interface with I2C devices-at various speeds ranging from 100khz to 3.4Mhz.--Required properties:- - compatible: value should be.- -> "samsung,exynos5-hsi2c", (DEPRECATED)- for i2c compatible with HSI2C available- on Exynos5250 and Exynos5420 SoCs.- -> "samsung,exynos5250-hsi2c", for i2c compatible with HSI2C available- on Exynos5250 and Exynos5420 SoCs.- -> "samsung,exynos5260-hsi2c", for i2c compatible with HSI2C available- on Exynos5260 SoCs.- -> "samsung,exynos7-hsi2c", for i2c compatible with HSI2C available- on Exynos7 SoCs.-- - reg: physical base address of the controller and length of memory mapped- region.- - interrupts: interrupt number to the cpu.- - #address-cells: always 1 (for i2c addresses)- - #size-cells: always 0-- - Pinctrl:- - pinctrl-0: Pin control group to be used for this controller.- - pinctrl-names: Should contain only one value - "default".--Optional properties:- - clock-frequency: Desired operating frequency in Hz of the bus.- -> If not specified, the bus operates in fast-speed mode at- at 100khz.- -> If specified, the bus operates in high-speed mode only if the- clock-frequency is >= 1Mhz.--Example:--hsi2c@12ca0000 {- compatible = "samsung,exynos5250-hsi2c";- reg = <0x12ca0000 0x100>;- interrupts = <56>;- clock-frequency = <100000>;-- pinctrl-0 = <&i2c4_bus>;- pinctrl-names = "default";-- #address-cells = <1>;- #size-cells = <0>;-- s2mps11_pmic@66 {- compatible = "samsung,s2mps11-pmic";- reg = <0x66>;- };-};
@@ -0,0 +1,80 @@+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)+%YAML1.2+---+$id:http://devicetree.org/schemas/i2c/i2c-exynos5.yaml#+$schema:http://devicetree.org/meta-schemas/core.yaml#++title:Samsung's High Speed I2C controller++maintainers:+-Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>++description:|+The Samsung's High Speed I2C controller is used to interface with I2C devices+at various speeds ranging from 100kHz to 3.4MHz.++allOf:+-$ref:/schemas/i2c/i2c-controller.yaml#++properties:+compatible:+oneOf:+-enum:+-"samsung,exynos5250-hsi2c"# Exynos5250 and Exynos5420+-"samsung,exynos5260-hsi2c"# Exynos5260+-"samsung,exynos7-hsi2c"# Exynos7+-const:"samsung,exynos5-hsi2c"# Exynos5250 and Exynos5420+deprecated:true++reg:+maxItems:1++interrupts:+maxItems:1++clock-frequency:+default:100000+description:+Desired operating frequency in Hz of the bus.++If not specified, the bus operates in fast-speed mode at 100kHz.++If specified, the bus operates in high-speed mode only if the+clock-frequency is >= 1MHz.++clocks:+maxItems:1+description:I2C operating clock++clock-names:+const:hsi2c++required:+-compatible+-reg+-interrupts+-clocks++unevaluatedProperties:false++examples:+-|+#include <dt-bindings/clock/exynos5420.h>+#include <dt-bindings/interrupt-controller/arm-gic.h>+#include <dt-bindings/interrupt-controller/irq.h>++hsi2c_8:i2c@12e00000 {+compatible = "samsung,exynos5250-hsi2c";+reg = <0x12e00000 0x1000>;+interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;+#address-cells = <1>;+#size-cells = <0>;+clock-frequency = <100000>;+clocks = <&clock CLK_USI4>;+clock-names = "hsi2c";++pmic@66 {+/* compatible = "samsung,s2mps11-pmic"; */+reg = <0x66>;+};+};
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Sam Protsenko <semen.protsenko@linaro.org> Date: 2021-12-01 19:05:26
From: Jaewon Kim <redacted>
This patch adds new "samsung,exynosautov9-hsi2c" compatible.
It is for i2c compatible with HSI2C available on Exynos SoC with USI.
Signed-off-by: Jaewon Kim <redacted>
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
Documentation/devicetree/bindings/i2c/i2c-exynos5.yaml | 6 ++++++
1 file changed, 6 insertions(+)
@@ -13,6 +13,11 @@ description: |The Samsung's High Speed I2C controller is used to interface with I2C devicesat various speeds ranging from 100kHz to 3.4MHz.+In case the HSI2C controller is encapsulated within USI block (it's the case+e.g. for Exynos850 and Exynos Auto V9 SoCs), it might be also necessary to+define USI node in device tree file, choosing "i2c" configuration. Please see+Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml for details.+allOf:-$ref:/schemas/i2c/i2c-controller.yaml#
@@ -23,6 +28,7 @@ properties:-"samsung,exynos5250-hsi2c"# Exynos5250 and Exynos5420-"samsung,exynos5260-hsi2c"# Exynos5260-"samsung,exynos7-hsi2c"# Exynos7+-"samsung,exynosautov9-hsi2c"# ExynosAutoV9-const:"samsung,exynos5-hsi2c"# Exynos5250 and Exynos5420deprecated:true
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Sam Protsenko <semen.protsenko@linaro.org> Date: 2021-12-01 19:05:33
In new Exynos SoCs (like Exynos850) where HSI2C is implemented as a
part of USIv2 block, there are two clocks provided to HSI2C controller:
- PCLK: bus clock (APB), provides access to register interface
- IPCLK: operating IP-core clock; SCL is derived from this one
Both clocks have to be asserted for HSI2C to be functional in that case.
Modify bindings doc to allow specifying bus clock in addition to
already described operating clock. Make it optional though, as older
Exynos SoC variants only have one HSI2C clock.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
.../devicetree/bindings/i2c/i2c-exynos5.yaml | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
From: Sam Protsenko <semen.protsenko@linaro.org> Date: 2021-12-01 19:05:52
From: Jaewon Kim <redacted>
ExynosAutoV9 functioning logic mostly follows I2C_TYPE_EXYNOS7, but
timing calculation and configuration procedure is changed: e.g. only
timing_s3 has to be set now.
Another change of HSI2C controller in ExynosAutoV9 SoC is that it's now
a part of USIv2 IP-core. No changes is needed for I2C driver though, as
all USI related configuration is done in USI driver.
Signed-off-by: Jaewon Kim <redacted>
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
drivers/i2c/busses/i2c-exynos5.c | 62 +++++++++++++++++++++++++++-----
1 file changed, 53 insertions(+), 9 deletions(-)
@@ -422,7 +456,10 @@ static irqreturn_t exynos5_i2c_irq(int irqno, void *dev_id)writel(int_status,i2c->regs+HSI2C_INT_STATUS);/* handle interrupt related to the transfer status */-if(i2c->variant->hw==I2C_TYPE_EXYNOS7){+switch(i2c->variant->hw){+caseI2C_TYPE_EXYNOSAUTOV9:+fallthrough;+caseI2C_TYPE_EXYNOS7:if(int_status&HSI2C_INT_TRANS_DONE){i2c->trans_done=1;i2c->state=0;
From: Sam Protsenko <semen.protsenko@linaro.org> Date: 2021-12-01 19:05:57
In new Exynos SoCs (like Exynos850) where HSI2C is implemented as a
part of USIv2 block, there are two clocks provided to HSI2C controller:
- PCLK: bus clock (APB), provides access to register interface
- IPCLK: operating IP-core clock; SCL is derived from this one
Both clocks have to be asserted for HSI2C to be functional in that case.
Add code to obtain and enable/disable PCLK in addition to already
handled operating clock. Make it optional though, as older Exynos SoC
variants only have one HSI2C clock.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
drivers/i2c/busses/i2c-exynos5.c | 46 ++++++++++++++++++++++++++------
1 file changed, 38 insertions(+), 8 deletions(-)
From: Sam Protsenko <semen.protsenko@linaro.org> Date: 2021-12-01 19:06:04
I2C controller chosen by I2C_EXYNOS5 config option is also suitable for
Exynos850 and ExynosAutoV9 SoCs. State that specifically in I2C_EXYNOS5
symbol help section.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
drivers/i2c/busses/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Krzysztof Kozlowski <hidden> Date: 2021-12-02 08:22:53
On 01/12/2021 20:04, Sam Protsenko wrote:
Convert Samsung Exynos High Speed I2C bindings doc to DT schema format.
Changes during bindings conversion:
1. Added missing required clock properties (driver fails when it's
unable to get the clock)
2. Removed properties and descriptions that can be found in
schemas/i2c/i2c-controller.yaml [1]
3. Fixed the example so it can be validated by dtschema
[1] https://github.com/robherring/dt-schema/blob/master/schemas/i2c/i2c-controller.yaml
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
.../devicetree/bindings/i2c/i2c-exynos5.txt | 53 ------------
.../devicetree/bindings/i2c/i2c-exynos5.yaml | 80 +++++++++++++++++++
2 files changed, 80 insertions(+), 53 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-exynos5.txt
create mode 100644 Documentation/devicetree/bindings/i2c/i2c-exynos5.yaml
Reviewed-by: Krzysztof Kozlowski <redacted>
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Krzysztof Kozlowski <hidden> Date: 2021-12-02 08:23:37
On 01/12/2021 20:04, Sam Protsenko wrote:
From: Jaewon Kim <redacted>
This patch adds new "samsung,exynosautov9-hsi2c" compatible.
It is for i2c compatible with HSI2C available on Exynos SoC with USI.
Signed-off-by: Jaewon Kim <redacted>
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
Documentation/devicetree/bindings/i2c/i2c-exynos5.yaml | 6 ++++++
1 file changed, 6 insertions(+)
Reviewed-by: Krzysztof Kozlowski <redacted>
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Krzysztof Kozlowski <hidden> Date: 2021-12-02 08:25:16
On 01/12/2021 20:04, Sam Protsenko wrote:
In new Exynos SoCs (like Exynos850) where HSI2C is implemented as a
part of USIv2 block, there are two clocks provided to HSI2C controller:
- PCLK: bus clock (APB), provides access to register interface
- IPCLK: operating IP-core clock; SCL is derived from this one
Both clocks have to be asserted for HSI2C to be functional in that case.
Modify bindings doc to allow specifying bus clock in addition to
already described operating clock. Make it optional though, as older
Exynos SoC variants only have one HSI2C clock.
I understand that it is required on newer SoCs, so you need "if:" adding
it to required properties on Autov8 or 850.
From: Krzysztof Kozlowski <hidden> Date: 2021-12-02 08:28:24
On 01/12/2021 20:04, Sam Protsenko wrote:
In new Exynos SoCs (like Exynos850) where HSI2C is implemented as a
part of USIv2 block, there are two clocks provided to HSI2C controller:
- PCLK: bus clock (APB), provides access to register interface
- IPCLK: operating IP-core clock; SCL is derived from this one
Both clocks have to be asserted for HSI2C to be functional in that case.
Add code to obtain and enable/disable PCLK in addition to already
handled operating clock. Make it optional though, as older Exynos SoC
variants only have one HSI2C clock.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
drivers/i2c/busses/i2c-exynos5.c | 46 ++++++++++++++++++++++++++------
1 file changed, 38 insertions(+), 8 deletions(-)
You could use clk_bulk API, but for two clocks, where one is optional,
it won't reduce much of code, so I am fine here:
Reviewed-by: Krzysztof Kozlowski <redacted>
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Krzysztof Kozlowski <hidden> Date: 2021-12-02 08:29:21
On 01/12/2021 20:04, Sam Protsenko wrote:
From: Jaewon Kim <redacted>
ExynosAutoV9 functioning logic mostly follows I2C_TYPE_EXYNOS7, but
timing calculation and configuration procedure is changed: e.g. only
timing_s3 has to be set now.
Another change of HSI2C controller in ExynosAutoV9 SoC is that it's now
a part of USIv2 IP-core. No changes is needed for I2C driver though, as
all USI related configuration is done in USI driver.
Signed-off-by: Jaewon Kim <redacted>
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
drivers/i2c/busses/i2c-exynos5.c | 62 +++++++++++++++++++++++++++-----
1 file changed, 53 insertions(+), 9 deletions(-)
Reviewed-by: Krzysztof Kozlowski <redacted>
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Krzysztof Kozlowski <hidden> Date: 2021-12-02 08:29:41
On 01/12/2021 20:04, Sam Protsenko wrote:
I2C controller chosen by I2C_EXYNOS5 config option is also suitable for
Exynos850 and ExynosAutoV9 SoCs. State that specifically in I2C_EXYNOS5
symbol help section.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
drivers/i2c/busses/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Krzysztof Kozlowski <redacted>
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Chanho Park <hidden> Date: 2021-12-02 09:33:32
I2C controller chosen by I2C_EXYNOS5 config option is also suitable for
Exynos850 and ExynosAutoV9 SoCs. State that specifically in I2C_EXYNOS5
symbol help section.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
From: Chanho Park <hidden> Date: 2021-12-02 10:30:21
In new Exynos SoCs (like Exynos850) where HSI2C is implemented as a part
of USIv2 block, there are two clocks provided to HSI2C controller:
- PCLK: bus clock (APB), provides access to register interface
- IPCLK: operating IP-core clock; SCL is derived from this one
Both clocks have to be asserted for HSI2C to be functional in that case.
Add code to obtain and enable/disable PCLK in addition to already handled
operating clock. Make it optional though, as older Exynos SoC variants
only have one HSI2C clock.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>