Add i2c/iic support for r8a7743
Subsystems (5)
cover Add i2c/iic support for r8a7743
This patch series aims to add i2c/iic support for r8a7743 SoC.
Backported dt-bindings patch
Backported per-Generation fallbacks
It is tested against linux-v4.4.112-cip18
This patch depends on the below patch series
https://lists.cip-project.org/pipermail/cip-dev/2018-January/000820.html
Biju Das (4):
dt-bindings: i2c: Document r8a7743/5 support
ARM: dts: r8a7743: Add I2C DT support
dt-bindings: i2c: sh_mobile: Document r8a7743/5 support
ARM: dts: r8a7743: Add IIC cores to dtsi
Geert Uytterhoeven (1):
dt-bindings: i2c: Spelling s/propoerty/property/
Simon Horman (2):
i2c: rcar: Add per-Generation fallback bindings
i2c: sh_mobile: Add per-Generation fallback bindings
Documentation/devicetree/bindings/i2c/i2c-imx.txt | 2 +- Documentation/devicetree/bindings/i2c/i2c-rcar.txt | 35 ++++-- .../devicetree/bindings/i2c/i2c-sh_mobile.txt | 20 ++- Documentation/devicetree/bindings/i2c/i2c-sirf.txt | 2 +- arch/arm/boot/dts/r8a7743.dtsi | 137 +++++++++++++++++++++ drivers/i2c/busses/i2c-rcar.c | 5 +- drivers/i2c/busses/i2c-sh_mobile.c | 4 +- 7 files changed, 186 insertions(+), 19 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/7 dt-bindings: i2c: Spelling s/propoerty/property/
From: Geert Uytterhoeven <[email protected]>
--- Documentation/devicetree/bindings/i2c/i2c-imx.txt | 2 +- Documentation/devicetree/bindings/i2c/i2c-rcar.txt | 2 +- Documentation/devicetree/bindings/i2c/i2c-sirf.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/i2c/i2c-imx.txt +1 -1
@@ -11,7 +11,7 @@ Required properties: Optional properties: - clock-frequency : Constains desired I2C/HS-I2C bus clock frequency in Hz. - The absence of the propoerty indicates the default frequency 100 kHz. + The absence of the property indicates the default frequency 100 kHz. - dmas: A list of two dma specifiers, one for each entry in dma-names. - dma-names: should contain "tx" and "rx". - scl-gpios: specify the gpio related to SCL pin
Documentation/devicetree/bindings/i2c/i2c-rcar.txt +1 -1
@@ -17,7 +17,7 @@ Required properties: Optional properties: - clock-frequency: desired I2C bus clock frequency in Hz. The absence of this - propoerty indicates the default frequency 100 kHz. + property indicates the default frequency 100 kHz. - clocks: clock specifier. Examples :
Documentation/devicetree/bindings/i2c/i2c-sirf.txt +1 -1
@@ -8,7 +8,7 @@ Required properties : Optional properties: - clock-frequency : Constains desired I2C/HS-I2C bus clock frequency in Hz. - The absence of the propoerty indicates the default frequency 100 kHz. + The absence of the property indicates the default frequency 100 kHz. Examples :
Signature · 1 line
2.7.4
PATCH 2/7 i2c: rcar: Add per-Generation fallback bindings
In reply to Biju DasFrom: Simon Horman <[email protected]>
In the case of Renesas R-Car hardware we know that there are generations of SoCs, e.g. Gen 2 and Gen 3. But beyond that it's not clear what the relationship between IP blocks might be. For example, I believe that r8a7790 is older than r8a7791 but that doesn't imply that the latter is a descendant of the former or vice versa.
We can, however, by examining the documentation and behaviour of the hardware at run-time observe that the current driver implementation appears to be compatible with the IP blocks on SoCs within a given generation.
For the above reasons and convenience when enabling new SoCs a per-generation fallback compatibility string scheme is being adopted for drivers for Renesas SoCs.
Also:
* Deprecate renesas,i2c-rcar. It seems poorly named as it is only compatible with R-Car Gen 1. It also appears unused in mainline.
* Add some text to describe per-SoC bindings
Conflicts:
Documentation/devicetree/bindings/i2c/i2c-rcar.txt drivers/i2c/busses/i2c-rcar.c
--- Documentation/devicetree/bindings/i2c/i2c-rcar.txt | 30 ++++++++++++++-------- drivers/i2c/busses/i2c-rcar.c | 5 +++- 2 files changed, 23 insertions(+), 12 deletions(-)
Documentation/devicetree/bindings/i2c/i2c-rcar.txt +19 -11
@@ -1,16 +1,24 @@ I2C for R-Car platforms Required properties: -- compatible: Must be one of - "renesas,i2c-rcar" - "renesas,i2c-r8a7778" - "renesas,i2c-r8a7779" - "renesas,i2c-r8a7790" - "renesas,i2c-r8a7791" - "renesas,i2c-r8a7792" - "renesas,i2c-r8a7793" - "renesas,i2c-r8a7794" - "renesas,i2c-r8a7795" +- compatible: + "renesas,i2c-r8a7778" if the device is a part of a R8A7778 SoC. + "renesas,i2c-r8a7779" if the device is a part of a R8A7779 SoC. + "renesas,i2c-r8a7790" if the device is a part of a R8A7790 SoC. + "renesas,i2c-r8a7791" if the device is a part of a R8A7791 SoC. + "renesas,i2c-r8a7792" if the device is a part of a R8A7792 SoC. + "renesas,i2c-r8a7793" if the device is a part of a R8A7793 SoC. + "renesas,i2c-r8a7794" if the device is a part of a R8A7794 SoC. + "renesas,i2c-r8a7795" if the device is a part of a R8A7795 SoC. + "renesas,rcar-gen1-i2c" for a generic R-Car Gen1 compatible device. + "renesas,rcar-gen2-i2c" for a generic R-Car Gen2 compatible device. + "renesas,rcar-gen3-i2c" for a generic R-Car Gen3 compatible device. + "renesas,i2c-rcar" (deprecated) + + When compatible with the generic version, nodes must list the + SoC-specific version corresponding to the platform first followed + by the generic version. + - reg: physical base address of the controller and length of memory mapped region. - interrupts: interrupt specifier.
@@ -25,7 +33,7 @@ Examples : i2c0: i2c at e6508000 { #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,i2c-r8a7791"; + compatible = "renesas,i2c-r8a7791", "renesas,rcar-gen2-i2c"; reg = <0 0xe6508000 0 0x40>; interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp9_clks R8A7791_CLK_I2C0>;
drivers/i2c/busses/i2c-rcar.c +4 -1
@@ -618,7 +618,6 @@ static const struct i2c_algorithm rcar_i2c_algo = { };static const struct of_device_id rcar_i2c_dt_ids[] = { - { .compatible ="renesas,i2c-rcar" , .data = (void *)I2C_RCAR_GEN1 }, { .compatible ="renesas,i2c-r8a7778" , .data = (void *)I2C_RCAR_GEN1 }, { .compatible ="renesas,i2c-r8a7779" , .data = (void *)I2C_RCAR_GEN1 }, { .compatible ="renesas,i2c-r8a7790" , .data = (void *)I2C_RCAR_GEN2 },
@@ -627,6 +626,10 @@ static const struct of_device_id rcar_i2c_dt_ids[] = { { .compatible = "renesas,i2c-r8a7793", .data = (void *)I2C_RCAR_GEN2 }, { .compatible = "renesas,i2c-r8a7794", .data = (void *)I2C_RCAR_GEN2 }, { .compatible = "renesas,i2c-r8a7795", .data = (void *)I2C_RCAR_GEN3 }, + { .compatible = "renesas,i2c-rcar", .data = (void *)I2C_RCAR_GEN1 }, /* Deprecated */ + { .compatible = "renesas,rcar-gen1-i2c", .data = (void *)I2C_RCAR_GEN1 }, + { .compatible = "renesas,rcar-gen2-i2c", .data = (void *)I2C_RCAR_GEN2 }, + { .compatible = "renesas,rcar-gen3-i2c", .data = (void *)I2C_RCAR_GEN3 }, {}, };MODULE_DEVICE_TABLE (of, rcar_i2c_dt_ids);
Signature · 1 line
2.7.4
PATCH 3/7 dt-bindings: i2c: Document r8a7743/5 support
In reply to Biju DasDocument i2c Device Tree support for RZ/G1[ME] (also known as r8aA774[35]) SoCs. They are compatible with R-Car Gen2 SoC family.
--- Documentation/devicetree/bindings/i2c/i2c-rcar.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/i2c/i2c-rcar.txt +4 -1
@@ -2,6 +2,8 @@ I2C for R-Car platforms Required properties: - compatible: + "renesas,i2c-r8a7743" if the device is a part of a R8A7743 SoC. + "renesas,i2c-r8a7745" if the device is a part of a R8A7745 SoC. "renesas,i2c-r8a7778" if the device is a part of a R8A7778 SoC. "renesas,i2c-r8a7779" if the device is a part of a R8A7779 SoC. "renesas,i2c-r8a7790" if the device is a part of a R8A7790 SoC.
@@ -11,7 +13,8 @@ Required properties: "renesas,i2c-r8a7794" if the device is a part of a R8A7794 SoC. "renesas,i2c-r8a7795" if the device is a part of a R8A7795 SoC. "renesas,rcar-gen1-i2c" for a generic R-Car Gen1 compatible device. - "renesas,rcar-gen2-i2c" for a generic R-Car Gen2 compatible device. + "renesas,rcar-gen2-i2c" for a generic R-Car Gen2 or RZ/G1 compatible + device. "renesas,rcar-gen3-i2c" for a generic R-Car Gen3 compatible device. "renesas,i2c-rcar" (deprecated)
Signature · 1 line
2.7.4
PATCH 4/7 ARM: dts: r8a7743: Add I2C DT support
In reply to Biju DasAdd the I2C[0-5] devices to the r8a7743 device tree.
(modified clk property,removed reset property)
--- arch/arm/boot/dts/r8a7743.dtsi | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+)
arch/arm/boot/dts/r8a7743.dtsi +85 -0
@@ -18,6 +18,15 @@ #address-cells = <2>; #size-cells = <2>; + aliases { + i2c0 = &i2c0; + i2c1 = &i2c1; + i2c2 = &i2c2; + i2c3 = &i2c3; + i2c4 = &i2c4; + i2c5 = &i2c5; + }; + cpus { #address-cells = <1>; #size-cells = <0>;
@@ -297,6 +306,82 @@ dma-channels = <15>; }; + /* The memory map in the User's Manual maps the cores to bus + * numbers + */ + i2c0: i2c at e6508000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,i2c-r8a7743", + "renesas,rcar-gen2-i2c"; + reg = <0 0xe6508000 0 0x40>; + interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp9_clks R8A7743_CLK_I2C0>; + power-domains = <&cpg_clocks>; + status = "disabled"; + }; + + i2c1: i2c at e6518000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,i2c-r8a7743", + "renesas,rcar-gen2-i2c"; + reg = <0 0xe6518000 0 0x40>; + interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp9_clks R8A7743_CLK_I2C1>; + power-domains = <&cpg_clocks>; + status = "disabled"; + }; + + i2c2: i2c at e6530000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,i2c-r8a7743", + "renesas,rcar-gen2-i2c"; + reg = <0 0xe6530000 0 0x40>; + interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp9_clks R8A7743_CLK_I2C2>; + power-domains = <&cpg_clocks>; + status = "disabled"; + }; + + i2c3: i2c at e6540000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,i2c-r8a7743", + "renesas,rcar-gen2-i2c"; + reg = <0 0xe6540000 0 0x40>; + interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp9_clks R8A7743_CLK_I2C3>; + power-domains = <&cpg_clocks>; + status = "disabled"; + }; + + i2c4: i2c at e6520000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,i2c-r8a7743", + "renesas,rcar-gen2-i2c"; + reg = <0 0xe6520000 0 0x40>; + interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp9_clks R8A7743_CLK_I2C4>; + power-domains = <&cpg_clocks>; + status = "disabled"; + }; + + i2c5: i2c at e6528000 { + /* doesn't need pinmux */ + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,i2c-r8a7743", + "renesas,rcar-gen2-i2c"; + reg = <0 0xe6528000 0 0x40>; + interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp9_clks R8A7743_CLK_I2C5>; + power-domains = <&cpg_clocks>; + status = "disabled"; + }; + scifa0: serial at e6c40000 { compatible = "renesas,scifa-r8a7743", "renesas,scifa"; reg = <0 0xe6c40000 0 0x40>;
Signature · 1 line
2.7.4
PATCH 5/7 i2c: sh_mobile: Add per-Generation fallback bindings
In reply to Biju DasFrom: Simon Horman <[email protected]>
Add per-Generation fallback bindings for R-Car SoCs.
This is in keeping with the compatibility string scheme is being adopted for drivers for Renesas SoCs.
Also, improve readability by listing the rmobile fallback compatibility string after the more-specific compatibility strings they provide a fallback for.
--- Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt | 17 ++++++++++++++--- drivers/i2c/busses/i2c-sh_mobile.c | 4 +++- 2 files changed, 17 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt +14 -3
@@ -1,8 +1,7 @@ Device tree configuration for Renesas IIC (sh_mobile) driver Required properties: -- compatible : "renesas,iic-<soctype>". "renesas,rmobile-iic" as fallback - Examples with soctypes are: +- compatible : - "renesas,iic-r8a73a4" (R-Mobile APE6) - "renesas,iic-r8a7740" (R-Mobile A1) - "renesas,iic-r8a7790" (R-Car H2)
@@ -12,6 +11,17 @@ Required properties: - "renesas,iic-r8a7794" (R-Car E2) - "renesas,iic-r8a7795" (R-Car H3) - "renesas,iic-sh73a0" (SH-Mobile AG5) + - "renesas,rcar-gen2-iic" (generic R-Car Gen2 compatible device) + - "renesas,rcar-gen3-iic" (generic R-Car Gen3 compatible device) + - "renesas,rmobile-iic" (generic device) + + When compatible with a generic R-Car version, nodes + must list the SoC-specific version corresponding to + the platform first followed by the generic R-Car + version. + + renesas,rmobile-iic must always follow. + - reg : address start and address range size of device - interrupts : interrupt of device - clocks : clock for device
@@ -31,7 +41,8 @@ Pinctrl properties might be needed, too. See there. Example: iic0: i2c at e6500000 { - compatible = "renesas,iic-r8a7790", "renesas,rmobile-iic"; + compatible = "renesas,iic-r8a7790", "renesas,rcar-gen2-iic", + "renesas,rmobile-iic"; reg = <0 0xe6500000 0 0x425>; interrupts = <0 174 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7790_CLK_IIC0>;
drivers/i2c/busses/i2c-sh_mobile.c +3 -1
@@ -828,7 +828,6 @@ static const struct sh_mobile_dt_config r8a7740_dt_config = { };static const struct of_device_id sh_mobile_i2c_dt_ids[] = { - { .compatible ="renesas,rmobile-iic" , .data = &default_dt_config }, { .compatible ="renesas,iic-r8a73a4" , .data = &fast_clock_dt_config }, { .compatible ="renesas,iic-r8a7740" , .data = &r8a7740_dt_config }, { .compatible ="renesas,iic-r8a7790" , .data = &fast_clock_dt_config },
@@ -836,8 +835,11 @@ static const struct of_device_id sh_mobile_i2c_dt_ids[] = { { .compatible = "renesas,iic-r8a7792", .data = &fast_clock_dt_config }, { .compatible = "renesas,iic-r8a7793", .data = &fast_clock_dt_config }, { .compatible = "renesas,iic-r8a7794", .data = &fast_clock_dt_config }, + { .compatible = "renesas,rcar-gen2-iic", .data = &fast_clock_dt_config }, { .compatible = "renesas,iic-r8a7795", .data = &fast_clock_dt_config }, + { .compatible = "renesas,rcar-gen3-iic", .data = &fast_clock_dt_config }, { .compatible = "renesas,iic-sh73a0", .data = &fast_clock_dt_config }, + { .compatible = "renesas,rmobile-iic", .data = &default_dt_config }, {}, };MODULE_DEVICE_TABLE (of, sh_mobile_i2c_dt_ids);
Signature · 1 line
2.7.4
PATCH 6/7 dt-bindings: i2c: sh_mobile: Document r8a7743/5 support
In reply to Biju DasDocument i2c Device Tree support for RZ/G1[ME] (also known as r8a774[35]) SoCs. They are compatible with R-Car Gen2 SoC family. No driver change is required as the initialisation sequence is currently the same as for the R-Car Gen2 fallback binding.
--- Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt +4 -1
@@ -4,6 +4,8 @@ Required properties: - compatible : - "renesas,iic-r8a73a4" (R-Mobile APE6) - "renesas,iic-r8a7740" (R-Mobile A1) + - "renesas,iic-r8a7743" (RZ/G1M) + - "renesas,iic-r8a7745" (RZ/G1E) - "renesas,iic-r8a7790" (R-Car H2) - "renesas,iic-r8a7791" (R-Car M2-W) - "renesas,iic-r8a7792" (R-Car V2H)
@@ -11,7 +13,8 @@ Required properties: - "renesas,iic-r8a7794" (R-Car E2) - "renesas,iic-r8a7795" (R-Car H3) - "renesas,iic-sh73a0" (SH-Mobile AG5) - - "renesas,rcar-gen2-iic" (generic R-Car Gen2 compatible device) + - "renesas,rcar-gen2-iic" (generic R-Car Gen2 or RZ/G1 + compatible device) - "renesas,rcar-gen3-iic" (generic R-Car Gen3 compatible device) - "renesas,rmobile-iic" (generic device)
Signature · 1 line
2.7.4
PATCH 7/7 ARM: dts: r8a7743: Add IIC cores to dtsi
In reply to Biju Das(Modified clocks,power domain property and removed resets property)
--- arch/arm/boot/dts/r8a7743.dtsi | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+)
arch/arm/boot/dts/r8a7743.dtsi +52 -0
@@ -25,6 +25,9 @@ i2c3 = &i2c3; i2c4 = &i2c4; i2c5 = &i2c5; + i2c6 = &iic0; + i2c7 = &iic1; + i2c8 = &iic3; }; cpus {
@@ -382,6 +385,55 @@ status = "disabled"; }; + iic0: i2c at e6500000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,iic-r8a7743", + "renesas,rcar-gen2-iic", + "renesas,rmobile-iic"; + reg = <0 0xe6500000 0 0x425>; + interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp3_clks R8A7743_CLK_IIC0>; + dmas = <&dmac0 0x61>, <&dmac0 0x62>, + <&dmac1 0x61>, <&dmac1 0x62>; + dma-names = "tx", "rx", "tx", "rx"; + power-domains = <&cpg_clocks>; + status = "disabled"; + }; + + iic1: i2c at e6510000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,iic-r8a7743", + "renesas,rcar-gen2-iic", + "renesas,rmobile-iic"; + reg = <0 0xe6510000 0 0x425>; + interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp3_clks R8A7743_CLK_IIC1>; + dmas = <&dmac0 0x65>, <&dmac0 0x66>, + <&dmac1 0x65>, <&dmac1 0x66>; + dma-names = "tx", "rx", "tx", "rx"; + power-domains = <&cpg_clocks>; + status = "disabled"; + }; + + iic3: i2c at e60b0000 { + /* doesn't need pinmux */ + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,iic-r8a7743", + "renesas,rcar-gen2-iic", + "renesas,rmobile-iic"; + reg = <0 0xe60b0000 0 0x425>; + interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp9_clks R8A7743_CLK_IICDVFS>; + dmas = <&dmac0 0x77>, <&dmac0 0x78>, + <&dmac1 0x77>, <&dmac1 0x78>; + dma-names = "tx", "rx", "tx", "rx"; + power-domains = <&cpg_clocks>; + status = "disabled"; + }; + scifa0: serial at e6c40000 { compatible = "renesas,scifa-r8a7743", "renesas,scifa"; reg = <0 0xe6c40000 0 0x40>;
Signature · 1 line
2.7.4
cover Add i2c/iic support for r8a7743
In reply to Biju DasQuoted 9 lines · Biju Das
This patch series aims to add i2c/iic support for r8a7743 SoC.
Backported dt-bindings patch
Backported per-Generation fallbacksIt is tested against linux-v4.4.112-cip18
This patch depends on the below patch series
https://lists.cip-project.org/pipermail/cip-dev/2018-January/000820.html
All looks good to me.??I've applied and pushed these changes.
Ben.
Quoted 22 lines
Biju Das (4):
? dt-bindings: i2c: Document r8a7743/5 support
? ARM: dts: r8a7743: Add I2C DT support
? dt-bindings: i2c:sh_mobile: Document r8a7743/5 support ? ARM: dts: r8a7743: Add IIC cores to dtsiGeert Uytterhoeven (1):
? dt-bindings: i2c: Spelling s/propoerty/property/Simon Horman (2):
? i2c: rcar: Add per-Generation fallback bindings ? i2c:sh_mobile: Add per-Generation fallback bindings?Documentation/devicetree/bindings/i2c/i2c-imx.txt??|???2 +- ?Documentation/devicetree/bindings/i2c/i2c-rcar.txt |??35 ++++-- ?.../devicetree/bindings/i2c/i2c-sh_mobile.txt??????|??20 ++- ?Documentation/devicetree/bindings/i2c/i2c-sirf.txt |???2 +- ?arch/arm/boot/dts/r8a7743.dtsi?????????????????????| 137 +++++++++++++++++++++ ?drivers/i2c/busses/i2c-rcar.c??????????????????????|???5 +- ?drivers/i2c/busses/i2c-sh_mobile.c?????????????????|???4 +-?7 files changed, 186 insertions(+), 19 deletions(-)
Signature · 2 lines
Ben Hutchings Software Developer, Codethink Ltd.