Skip to contentSkip to conversation

Add ASPEED AST2600 I2C new controller driver

PATCH Superseded ryan_chen 3 participants 14 messages May 16, 2022 – Aug 9, 2022

Subsystems (3)

v3 of 12 Superseded Latest is v12 →

lore
Share & tools
lore

ryan_chen

author reviewer
#0 lore raw

v3 cover Add ASPEED AST2600 I2C new controller driver

This series add AST2600 i2c new register set driver. The i2c new register set have new clock divider option for more flexiable generation. And also have separate i2c master and slave register set for control.

v3:
-fix i2c global clock divide default value
-remove i2c slave no used dev_dbg info.

v2:
-add i2c global ymal file commit
-rename file name from new to ast2600.
aspeed-i2c-new-global.c -> i2c-ast2600-global.c
aspeed-i2c-new-global.h -> i2c-ast2600-global.h
i2c-new-aspeed.c -> i2c-ast2600.c
-rename all driver function name to ast2600

ryan_chen (3):
dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C global register
controller
dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver i2c:aspeed:support ast2600 i2c new register mode driver

 .../i2c/aspeed,i2c-ast2600-global.ymal        |   44 +
 .../bindings/i2c/aspeed,i2c-ast2600.ymal      |   78 +
 drivers/i2c/busses/Kconfig                    |   11 +
 drivers/i2c/busses/Makefile                   |    1 +
 drivers/i2c/busses/i2c-ast2600-global.c       |   94 +
 drivers/i2c/busses/i2c-ast2600-global.h       |   19 +
 drivers/i2c/busses/i2c-ast2600.c              | 1703 +++++++++++++++++
 7 files changed, 1950 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600-global.ymal
 create mode 100644 Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal
 create mode 100644 drivers/i2c/busses/i2c-ast2600-global.c
 create mode 100644 drivers/i2c/busses/i2c-ast2600-global.h
 create mode 100644 drivers/i2c/busses/i2c-ast2600.c
Signature · 1 line
2.17.1
author reviewer
#1 lore raw

PATCH v3 1/3 dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C global register controller

AST2600 I2C global register controller, add bindings document to support driver of i2c global register set

---
 .../i2c/aspeed,i2c-ast2600-global.ymal        | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600-global.ymal
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600-global.ymal new file +44 -0
new file mode 100644
index 000000000000..d92a0878d03b
@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/aspeed,i2c-ast2600-global.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AST2600 I2C Global Register on the AST26XX SoCs Device Tree Bindings
+
+maintainers:
+  - Ryan Chen <[email protected]>
+
+allOf:
+  - $ref: /schemas/i2c/i2c-controller.yaml#
+
+properties:
+  compatible:
+    enum:
+      - aspeed,ast2600-i2c-global
+
+  reg:
+    minItems: 1
+    items:
+      - description: address offset and range of bus
+      - description: address offset and range of bus buffer
+
+  resets:
+    maxItems: 1
+
+required:
+  - reg
+  - compatible
+  - resets
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/ast2600-clock.h>
+
+    i2c_gr: i2c-global-regs at 0 {
+      compatible = "aspeed,ast2600-i2c-global", "syscon";
+      reg = <0x0 0x20>;
+      resets = <&syscon ASPEED_RESET_I2C>;
+    };
Signature · 1 line
2.17.1
author reviewer
#2 lore raw

PATCH v3 2/3 dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

In reply to ryan_chen

AST2600 support new register set for I2C controller, add bindings document to support driver of i2c new register mode controller

---
 .../bindings/i2c/aspeed,i2c-ast2600.ymal      | 78 +++++++++++++++++++
 1 file changed, 78 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +78 -0
new file mode 100644
index 000000000000..7c75f5bac24f
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/aspeed,i2c-ast2600.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AST2600 I2C Controller on the AST26XX SoCs Device Tree Bindings
+
+maintainers:
+  - Ryan Chen <[email protected]>
+
+allOf:
+  - $ref: /schemas/i2c/i2c-controller.yaml#
+
+properties:
+  compatible:
+    enum:
+      - aspeed,ast2600-i2c
+
+  reg:
+    minItems: 1
+    items:
+      - description: address offset and range of bus
+      - description: address offset and range of bus buffer
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+    description:
+      root clock of bus, should reference the APB
+      clock in the second cell
+
+  resets:
+    maxItems: 1
+
+  bus-frequency:
+    minimum: 500
+    maximum: 2000000
+    default: 100000
+    description: frequency of the bus clock in Hz defaults to 100 kHz when not
+      specified
+
+  multi-master:
+    type: boolean
+    description:
+      states that there is another master active on this bus
+
+required:
+  - reg
+  - compatible
+  - clocks
+  - resets
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/ast2600-clock.h>
+
+    i2c_gr: i2c-global-regs at 0 {
+      compatible = "aspeed,ast2600-i2c-global", "syscon";
+      reg = <0x0 0x20>;
+      resets = <&syscon ASPEED_RESET_I2C>;
+    };
+
+    i2c0: i2c-bus at 80 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      #interrupt-cells = <1>;
+      compatible = "aspeed,ast2600-i2c-bus";
+      reg = <0x80 0x80>, <0xC00 0x20>;
+      clocks = <&syscon ASPEED_CLK_APB2>;
+      resets = <&syscon ASPEED_RESET_I2C>;
+      bus-frequency = <100000>;
+    };
Signature · 1 line
2.17.1
#3 lore raw

Re: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Hi Ryan,

Quoted 26 lines · ryan_chen

AST2600 support new register set for I2C controller, add bindings document to support driver of i2c new register mode controller

---
 .../bindings/i2c/aspeed,i2c-ast2600.ymal      | 78 +++++++++++++++++++
 1 file changed, 78 insertions(+)
 create mode 100644 

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal

(quoted diff) +0 -0

a/Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal b/Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file mode 100644
index 000000000000..7c75f5bac24f

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +8 -0
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/aspeed,i2c-ast2600.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AST2600 I2C Controller on the AST26XX SoCs Device Tree Bindings
+

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal line 18

Quoted 10 lines
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +10 -0
+maintainers:
+  - Ryan Chen <[email protected]>
+
+allOf:
+  - $ref: /schemas/i2c/i2c-controller.yaml#
+
+properties:
+  compatible:
+    enum:
+      - aspeed,ast2600-i2c

The original driver uses e.g. aspeed,ast2500-i2c-bus for the subordinate controllers. While the register layout changes, I'd prefer we try to use the existing compatibles rather than introducing a new set and causing some confusion.

Further, what you're proposing here is effectively being used to select the driver implementation, which isn't the purpose of the devicetree.

My preference would be to reuse the existing compatibles and instead select the driver implementation via Kconfig. Or, if we can figure out some way to do so, support both register interfaces in the one driver implementation and fall back to the old register interface where the new one isn't available (I don't think this is feasible though).

Quoted 46 lines
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +24 -0
+
+  reg:
+    minItems: 1
+    items:
+      - description: address offset and range of bus
+      - description: address offset and range of bus buffer
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+    description:
+      root clock of bus, should reference the APB
+      clock in the second cell
+
+  resets:
+    maxItems: 1
+
+  bus-frequency:
+    minimum: 500
+    maximum: 2000000
+    default: 100000
+    description: frequency of the bus clock in Hz defaults to 100 kHz 

when not

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +21 -0
+      specified
+
+  multi-master:
+    type: boolean
+    description:
+      states that there is another master active on this bus
+
+required:
+  - reg
+  - compatible
+  - clocks
+  - resets
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/ast2600-clock.h>
+
+    i2c_gr: i2c-global-regs at 0 {

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal line 73

Quoted 10 lines
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +10 -0
+      compatible = "aspeed,ast2600-i2c-global", "syscon";
+      reg = <0x0 0x20>;
+      resets = <&syscon ASPEED_RESET_I2C>;
+    };
+
+    i2c0: i2c-bus at 80 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      #interrupt-cells = <1>;
+      compatible = "aspeed,ast2600-i2c-bus";

This isn't quite right with respect to your binding description above :)

Andrew

author reviewer
#4 lore raw

RE: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Hello Andrew,

Quoted 57 lines

-----Original Message-----
From: Andrew Jeffery <[email protected]>
Sent: Friday, July 29, 2022 10:29 AM
To: Ryan Chen <[email protected]>; Joel Stanley <[email protected]>; Philipp Zabel <[email protected]>; linux-arm-kernel at lists.infradead.org; linux-aspeed at lists.ozlabs.org; linux-kernel at vger.kernel.org; openbmc at lists.ozlabs.org
Cc: BMC-SW <[email protected]>
Subject: Re: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Hi Ryan,

Quoted 6 lines · ryan_chen

AST2600 support new register set for I2C controller, add bindings document to support driver of i2c new register mode controller

---
 .../bindings/i2c/aspeed,i2c-ast2600.ymal      | 78

+++++++++++++++++++

Quoted 20 lines
 1 file changed, 78 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal

diff --git a/Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal b/Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file mode 100644
index 000000000000..7c75f5bac24f

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +8 -0
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/aspeed,i2c-ast2600.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AST2600 I2C Controller on the AST26XX SoCs Device Tree
+Bindings
+

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal line 18

Quoted 10 lines
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +10 -0
+maintainers:
+  - Ryan Chen <[email protected]>
+
+allOf:
+  - $ref: /schemas/i2c/i2c-controller.yaml#
+
+properties:
+  compatible:
+    enum:
+      - aspeed,ast2600-i2c

The original driver uses e.g. aspeed,ast2500-i2c-bus for the subordinate controllers. While the register layout changes, I'd prefer we try to use the existing compatibles rather than introducing a new set and causing some confusion.

Quoted 9 lines

Further, what you're proposing here is effectively being used to select the driver implementation, which isn't the purpose of the devicetree.

My preference would be to reuse the existing compatibles and instead select the driver implementation via Kconfig. Or, if we can figure out some way to do so, support both register interfaces in the one driver implementation and fall back to the old register interface where the new one isn't available (I don't think this is feasible though).

Yes, that the reason go for another driver ast2600 to implement. Like others SOC driver implement different generation have diff driver in Kconfig and Makefile.
Example :
https://github.com/torvalds/linux/blob/master/drivers/i2c/busses/Makefile#L82-L84

Quoted 50 lines
Quoted 50 lines
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +24 -0
+
+  reg:
+    minItems: 1
+    items:
+      - description: address offset and range of bus
+      - description: address offset and range of bus buffer
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+    description:
+      root clock of bus, should reference the APB
+      clock in the second cell
+
+  resets:
+    maxItems: 1
+
+  bus-frequency:
+    minimum: 500
+    maximum: 2000000
+    default: 100000
+    description: frequency of the bus clock in Hz defaults to 100 kHz

when not

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +25 -0
+      specified
+
+  multi-master:
+    type: boolean
+    description:
+      states that there is another master active on this bus
+
+required:
+  - reg
+  - compatible
+  - clocks
+  - resets
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/ast2600-clock.h>
+
+    i2c_gr: i2c-global-regs at 0 {
+      compatible = "aspeed,ast2600-i2c-global", "syscon";
+      reg = <0x0 0x20>;
+      resets = <&syscon ASPEED_RESET_I2C>;
+    };
Quoted 8 lines

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal line 73

Quoted 6 lines
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +6 -0
+
+    i2c0: i2c-bus at 80 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      #interrupt-cells = <1>;
+      compatible = "aspeed,ast2600-i2c-bus";

This isn't quite right with respect to your binding description above :)

Yes, the compatible need to be " aspeed,ast2600-i2c" is that your point ? If yes, I will start for v4.

Quoted 1 line

Andrew

#5 lore raw

Re: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Quoted 134 lines · Ryan Chen

Hello Andrew,

Quoted 57 lines

-----Original Message-----
From: Andrew Jeffery <[email protected]>
Sent: Friday, July 29, 2022 10:29 AM
To: Ryan Chen <[email protected]>; Joel Stanley <[email protected]>; Philipp Zabel <[email protected]>; linux-arm-kernel at lists.infradead.org; linux-aspeed at lists.ozlabs.org; linux-kernel at vger.kernel.org; openbmc at lists.ozlabs.org
Cc: BMC-SW <[email protected]>
Subject: Re: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Hi Ryan,

Quoted 6 lines · ryan_chen

AST2600 support new register set for I2C controller, add bindings document to support driver of i2c new register mode controller

---
 .../bindings/i2c/aspeed,i2c-ast2600.ymal      | 78

+++++++++++++++++++

Quoted 20 lines
 1 file changed, 78 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal

diff --git a/Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal b/Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file mode 100644
index 000000000000..7c75f5bac24f

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +8 -0
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/aspeed,i2c-ast2600.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AST2600 I2C Controller on the AST26XX SoCs Device Tree
+Bindings
+

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal line 18

Quoted 10 lines
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +10 -0
+maintainers:
+  - Ryan Chen <[email protected]>
+
+allOf:
+  - $ref: /schemas/i2c/i2c-controller.yaml#
+
+properties:
+  compatible:
+    enum:
+      - aspeed,ast2600-i2c

The original driver uses e.g. aspeed,ast2500-i2c-bus for the subordinate controllers. While the register layout changes, I'd prefer we try to use the existing compatibles rather than introducing a new set and causing some confusion.

Quoted 9 lines

Further, what you're proposing here is effectively being used to select the driver implementation, which isn't the purpose of the devicetree.

My preference would be to reuse the existing compatibles and instead select the driver implementation via Kconfig. Or, if we can figure out some way to do so, support both register interfaces in the one driver implementation and fall back to the old register interface where the new one isn't available (I don't think this is feasible though).

Yes, that the reason go for another driver ast2600 to implement. Like others SOC driver implement different generation have diff driver in Kconfig
and Makefile.
Example :
https://github.com/torvalds/linux/blob/master/drivers/i2c/busses/Makefile#L82-L84

Quoted 50 lines
Quoted 50 lines
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +24 -0
+
+  reg:
+    minItems: 1
+    items:
+      - description: address offset and range of bus
+      - description: address offset and range of bus buffer
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+    description:
+      root clock of bus, should reference the APB
+      clock in the second cell
+
+  resets:
+    maxItems: 1
+
+  bus-frequency:
+    minimum: 500
+    maximum: 2000000
+    default: 100000
+    description: frequency of the bus clock in Hz defaults to 100 kHz

when not

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +25 -0
+      specified
+
+  multi-master:
+    type: boolean
+    description:
+      states that there is another master active on this bus
+
+required:
+  - reg
+  - compatible
+  - clocks
+  - resets
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/ast2600-clock.h>
+
+    i2c_gr: i2c-global-regs at 0 {
+      compatible = "aspeed,ast2600-i2c-global", "syscon";
+      reg = <0x0 0x20>;
+      resets = <&syscon ASPEED_RESET_I2C>;
+    };
Quoted 8 lines

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal line 73

Quoted 6 lines
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +6 -0
+
+    i2c0: i2c-bus at 80 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      #interrupt-cells = <1>;
+      compatible = "aspeed,ast2600-i2c-bus";

This isn't quite right with respect to your binding description above :)

Quoted 1 line

Yes, the compatible need to be " aspeed,ast2600-i2c" is that your point ?

Yes, but only if we agree that we should have different compatibles for the different drivers. I'm not convinced about that yet.

I think it's enough to have different Kconfig symbols, and select the old driver in aspeed_g4_defconfig, and the new driver in aspeed_g5_defconfig. Won't that gives us the right outcome without requiring a new set of compatibles?

Andrew

author reviewer
#6 lore raw

RE: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Hello,

Quoted 152 lines

-----Original Message-----
From: Andrew Jeffery <[email protected]>
Sent: Friday, July 29, 2022 11:13 AM
To: Ryan Chen <[email protected]>; Joel Stanley <[email protected]>; Philipp Zabel <[email protected]>; linux-arm-kernel at lists.infradead.org; linux-aspeed at lists.ozlabs.org; linux-kernel at vger.kernel.org; openbmc at lists.ozlabs.org
Cc: BMC-SW <[email protected]>
Subject: Re: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Quoted 138 lines · Ryan Chen

Hello Andrew,

Quoted 59 lines

-----Original Message-----
From: Andrew Jeffery <[email protected]>
Sent: Friday, July 29, 2022 10:29 AM
To: Ryan Chen <[email protected]>; Joel Stanley <[email protected]>; Philipp Zabel <[email protected]>; linux-arm-kernel at lists.infradead.org;
linux-aspeed at lists.ozlabs.org; linux-kernel at vger.kernel.org; openbmc at lists.ozlabs.org
Cc: BMC-SW <[email protected]>
Subject: Re: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Hi Ryan,

Quoted 6 lines · ryan_chen

AST2600 support new register set for I2C controller, add bindings document to support driver of i2c new register mode controller

---
 .../bindings/i2c/aspeed,i2c-ast2600.ymal      | 78

+++++++++++++++++++

Quoted 21 lines
 1 file changed, 78 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal

diff --git a/Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal b/Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file mode 100644
index 000000000000..7c75f5bac24f

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +9 -0
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML
+1.2
+---
+$id: http://devicetree.org/schemas/i2c/aspeed,i2c-ast2600.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AST2600 I2C Controller on the AST26XX SoCs Device Tree
+Bindings
+

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal line 19

Quoted 10 lines
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +10 -0
+maintainers:
+  - Ryan Chen <[email protected]>
+
+allOf:
+  - $ref: /schemas/i2c/i2c-controller.yaml#
+
+properties:
+  compatible:
+    enum:
+      - aspeed,ast2600-i2c

The original driver uses e.g. aspeed,ast2500-i2c-bus for the subordinate controllers. While the register layout changes, I'd prefer we try to use the existing compatibles rather than introducing a new set and causing some confusion.

Quoted 9 lines

Further, what you're proposing here is effectively being used to select the driver implementation, which isn't the purpose of the devicetree.

My preference would be to reuse the existing compatibles and instead select the driver implementation via Kconfig. Or, if we can figure out some way to do so, support both register interfaces in the one driver implementation and fall back to the old register interface where the new one isn't available (I don't think this is feasible though).

Yes, that the reason go for another driver ast2600 to implement. Like others SOC driver implement different generation have diff driver in Kconfig and Makefile.
Example :
https://github.com/torvalds/linux/blob/master/drivers/i2c/busses/Makef
ile#L82-L84

Quoted 60 lines
Quoted 47 lines
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +25 -0
+
+  reg:
+    minItems: 1
+    items:
+      - description: address offset and range of bus
+      - description: address offset and range of bus buffer
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+    description:
+      root clock of bus, should reference the APB
+      clock in the second cell
+
+  resets:
+    maxItems: 1
+
+  bus-frequency:
+    minimum: 500
+    maximum: 2000000
+    default: 100000
+    description: frequency of the bus clock in Hz defaults to 100
+ kHz

when not

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +21 -0
+      specified
+
+  multi-master:
+    type: boolean
+    description:
+      states that there is another master active on this bus
+
+required:
+  - reg
+  - compatible
+  - clocks
+  - resets
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/ast2600-clock.h>
+
+    i2c_gr: i2c-global-regs at 0 {

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal line 73

Quoted 10 lines
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +10 -0
+      compatible = "aspeed,ast2600-i2c-global", "syscon";
+      reg = <0x0 0x20>;
+      resets = <&syscon ASPEED_RESET_I2C>;
+    };
+
+    i2c0: i2c-bus at 80 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      #interrupt-cells = <1>;
+      compatible = "aspeed,ast2600-i2c-bus";

This isn't quite right with respect to your binding description above :)

Quoted 9 lines
Quoted 1 line

Yes, the compatible need to be " aspeed,ast2600-i2c" is that your point ?

Yes, but only if we agree that we should have different compatibles for the different drivers. I'm not convinced about that yet.

I think it's enough to have different Kconfig symbols, and select the old driver in aspeed_g4_defconfig, and the new driver in aspeed_g5_defconfig. Won't that gives us the right outcome without requiring a new set of compatibles?

The new driver in aspeed_g5_defconfig. And different compatible string claim will Load the new or legacy driver, it should ok like the different generation SOC. Have different design.
Am I right?

Quoted 1 line

Andrew

#7 lore raw

Re: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Quoted 43 lines · Ryan Chen

Hello,

Quoted 41 lines

-----Original Message-----
From: Andrew Jeffery <[email protected]>
Sent: Friday, July 29, 2022 11:13 AM
To: Ryan Chen <[email protected]>; Joel Stanley <[email protected]>; Philipp Zabel <[email protected]>; linux-arm-kernel at lists.infradead.org; linux-aspeed at lists.ozlabs.org; linux-kernel at vger.kernel.org; openbmc at lists.ozlabs.org
Cc: BMC-SW <[email protected]>
Subject: Re: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Quoted 26 lines · Ryan Chen

Hello Andrew,

Quoted 15 lines

-----Original Message-----
From: Andrew Jeffery <[email protected]>
Sent: Friday, July 29, 2022 10:29 AM
To: Ryan Chen <[email protected]>; Joel Stanley <[email protected]>; Philipp Zabel <[email protected]>; linux-arm-kernel at lists.infradead.org;
linux-aspeed at lists.ozlabs.org; linux-kernel at vger.kernel.org; openbmc at lists.ozlabs.org
Cc: BMC-SW <[email protected]>
Subject: Re: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Hi Ryan,

On Mon, 16 May 2022, at 16:18, ryan_chen wrote:

Quoted 8 lines

Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal line 73

Quoted 5 lines
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +5 -0
+    i2c0: i2c-bus at 80 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      #interrupt-cells = <1>;
+      compatible = "aspeed,ast2600-i2c-bus";

This isn't quite right with respect to your binding description above :)

Yes, the compatible need to be " aspeed,ast2600-i2c" is that your point ?

Quoted 8 lines
Quoted 7 lines

Yes, but only if we agree that we should have different compatibles for the different drivers. I'm not convinced about that yet.

I think it's enough to have different Kconfig symbols, and select the old driver in aspeed_g4_defconfig, and the new driver in aspeed_g5_defconfig. Won't that gives us the right outcome without requiring a new set of compatibles?

The new driver in aspeed_g5_defconfig.

Right, behind a new Kconfig option.

Quoted 3 lines

And different compatible string
claim will
Load the new or legacy driver,

I don't think we need this. It's enough to enable the new driver in the defconfig (and possibly disable the config option for the old driver).

Quoted 4 lines

it should ok like the different
generation SOC. Have
different design.
Am I right?

We have SoC-specific compatibles already, so the new driver can just bind on the compatibles for the SoC revisions that have the new register interface. The old driver just binds to the device in the SoCs that have the old register interface.

There's an overlap in support between the two drivers, but for people who care about which implementation they use they can choose to exclude that driver from their kernel config.

None of this requires more compatibles be added.

Does that help?

Andrew

author reviewer
#8 lore raw

RE: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Hello,

Quoted 88 lines

-----Original Message-----
From: Andrew Jeffery <[email protected]>
Sent: Tuesday, August 9, 2022 8:35 AM
To: Ryan Chen <[email protected]>; Joel Stanley <[email protected]>; Philipp Zabel <[email protected]>; linux-arm-kernel at lists.infradead.org; linux-aspeed at lists.ozlabs.org; linux-kernel at vger.kernel.org; openbmc at lists.ozlabs.org
Cc: BMC-SW <[email protected]>
Subject: Re: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Quoted 51 lines · Ryan Chen

Hello,

Quoted 49 lines

-----Original Message-----
From: Andrew Jeffery <[email protected]>
Sent: Friday, July 29, 2022 11:13 AM
To: Ryan Chen <[email protected]>; Joel Stanley <[email protected]>; Philipp Zabel <[email protected]>; linux-arm-kernel at lists.infradead.org;
linux-aspeed at lists.ozlabs.org; linux-kernel at vger.kernel.org; openbmc at lists.ozlabs.org
Cc: BMC-SW <[email protected]>
Subject: Re: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Quoted 23 lines · Ryan Chen

Hello Andrew,

Quoted 21 lines

-----Original Message-----
From: Andrew Jeffery <[email protected]>
Sent: Friday, July 29, 2022 10:29 AM
To: Ryan Chen <[email protected]>; Joel Stanley <[email protected]>; Philipp Zabel <[email protected]>; linux-arm-kernel at lists.infradead.org;
linux-aspeed at lists.ozlabs.org; linux-kernel at vger.kernel.org; openbmc at lists.ozlabs.org
Cc: BMC-SW <[email protected]>
Subject: Re: [PATCH v3 2/3] dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver

Hi Ryan,

Quoted 5 lines · ryan_chen
Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal new file +5 -0
+    i2c0: i2c-bus at 80 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      #interrupt-cells = <1>;
+      compatible = "aspeed,ast2600-i2c-bus";
Quoted 4 lines
Quoted 3 lines

This isn't quite right with respect to your binding description above
:)

Yes, the compatible need to be " aspeed,ast2600-i2c" is that your point ?

Yes, but only if we agree that we should have different compatibles for the different drivers. I'm not convinced about that yet.

I think it's enough to have different Kconfig symbols, and select the old driver in aspeed_g4_defconfig, and the new driver in aspeed_g5_defconfig. Won't that gives us the right outcome without

requiring a new set of compatibles?

Quoted 2 lines
Quoted 1 line

The new driver in aspeed_g5_defconfig.

Right, behind a new Kconfig option.

Quoted 3 lines

And different compatible string
claim will
Load the new or legacy driver,

I don't think we need this. It's enough to enable the new driver in the defconfig (and possibly disable the config option for the old driver).

Quoted 4 lines

it should ok like the different
generation SOC. Have
different design.
Am I right?

We have SoC-specific compatibles already, so the new driver can just bind on the compatibles for the SoC revisions that have the new register interface. The old driver just binds to the device in the SoCs that have the old register interface.

Quoted 7 lines

There's an overlap in support between the two drivers, but for people who care about which implementation they use they can choose to exclude that driver from their kernel config.

None of this requires more compatibles be added.

Does that help?

The kernel device tree driver use compatibles string to separate the driver, like currently aspeed_g5_defconfig include the ast2500/ast2600.
So use dtsi/dts to separate which driver to loaded. Use can use dts to choice which driver to loaded.

So keep the dtsi/dts for user implement to loaded should be good, right?

Quoted 2 lines

Andrew

author reviewer
#9 lore raw

PATCH v3 3/3 i2c:aspeed:support ast2600 i2c new register mode driver

In reply to ryan_chen

Add i2c new register mode driver to support AST2600 i2c new register set. AST2600 i2c controller have legacy and new register mode. The new register mode have global register support 4 base clock for scl clock selection, and new clock divider mode. And i2c new register mode have separate register set to control i2c master and slave.

---
 drivers/i2c/busses/Kconfig              |   11 +
 drivers/i2c/busses/Makefile             |    1 +
 drivers/i2c/busses/i2c-ast2600-global.c |   94 ++
 drivers/i2c/busses/i2c-ast2600-global.h |   19 +
 drivers/i2c/busses/i2c-ast2600.c        | 1703 +++++++++++++++++++++++
 5 files changed, 1828 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-ast2600-global.c
 create mode 100644 drivers/i2c/busses/i2c-ast2600-global.h
 create mode 100644 drivers/i2c/busses/i2c-ast2600.c
drivers/i2c/busses/Kconfig +11 -0
index a1bae59208e3..c667200d7923 100644
@@ -387,6 +387,17 @@ config I2C_ALTERA
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-altera.
 
+config I2C_AST2600
+	tristate "Aspeed AST2600 I2C Controller"
+	depends on ARCH_ASPEED || MACH_ASPEED_G6 || COMPILE_TEST
+	select I2C_SMBUS
+	help
+	  If you say yes to this option, support will be included for the
+	  Aspeed I2C controller with new register set.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called i2c-new-aspeed.
+
 config I2C_ASPEED
 	tristate "Aspeed I2C Controller"
 	depends on ARCH_ASPEED || COMPILE_TEST
drivers/i2c/busses/Makefile +1 -0
index 479f60e4ee3d..00276d533288 100644
@@ -38,6 +38,7 @@ obj-$(CONFIG_I2C_POWERMAC)	+= i2c-powermac.o
 obj-$(CONFIG_I2C_ALTERA)	+= i2c-altera.o
 obj-$(CONFIG_I2C_AMD_MP2)	+= i2c-amd-mp2-pci.o i2c-amd-mp2-plat.o
 obj-$(CONFIG_I2C_ASPEED)	+= i2c-aspeed.o
+obj-$(CONFIG_I2C_AST2600)	+= i2c-ast2600-global.o i2c-ast2600.o
 obj-$(CONFIG_I2C_AT91)		+= i2c-at91.o
 i2c-at91-objs			:= i2c-at91-core.o i2c-at91-master.o
 ifeq ($(CONFIG_I2C_AT91_SLAVE_EXPERIMENTAL),y)
drivers/i2c/busses/i2c-ast2600-global.c new file +94 -0

94 lines not on this page · raw message

drivers/i2c/busses/i2c-ast2600-global.h new file +19 -0
new file mode 100644
index 000000000000..c2c55971f32a
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef I2C_AST2600_GLOBAL_H
+#define I2C_AST2600_GLOBAL_H
+
+#include <linux/bits.h>
+
+#define AST2600_I2CG_ISR			0x00
+#define AST2600_I2CG_SLAVE_ISR		0x04
+#define AST2600_I2CG_OWNER		0x08
+#define AST2600_I2CG_CTRL		0x0C
+#define AST2600_I2CG_CLK_DIV_CTRL	0x10
+
+#define AST2600_I2CG_SLAVE_PKT_NAK	BIT(4)
+#define AST2600_I2CG_M_S_SEPARATE_INTR	BIT(3)
+#define AST2600_I2CG_CTRL_NEW_REG	BIT(2)
+#define AST2600_I2CG_CTRL_NEW_CLK_DIV	BIT(1)
+
+#endif /* I2C_AST2600_GLOBAL_H */
drivers/i2c/busses/i2c-ast2600.c new file +1703 -0

1,703 lines not on this page · raw message

Signature · 1 line
2.17.1
#10 lore raw
In reply to ryan_chen
Quoted 7 lines · ryan_chen

This series add AST2600 i2c new register set driver. The i2c new register set have new clock divider option for more flexiable generation. And also have separate i2c master and slave register set for control.

Hey Ryan, thanks for this work! This is a little bit off-topic, but are you or anyone else at Aspeed working on an equivalent QEMU patch series? Without it, I don?t think QEMU will work with this series right? I think QEMU only supports the old register set right now.

Thanks,
Peter

Quoted 37 lines

v3:

(quoted diff) +0 -2
-fix i2c global clock divide default value
-remove i2c slave no used dev_dbg info.

v2:

(quoted diff) +0 -2
-add i2c global ymal file commit
-rename file name from new to ast2600.

aspeed-i2c-new-global.c -> i2c-ast2600-global.c
aspeed-i2c-new-global.h -> i2c-ast2600-global.h
i2c-new-aspeed.c -> i2c-ast2600.c
-rename all driver function name to ast2600

ryan_chen (3):
dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C global register
controller
dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver i2c:aspeed:support ast2600 i2c new register mode driver

.../i2c/aspeed,i2c-ast2600-global.ymal        |   44 +
.../bindings/i2c/aspeed,i2c-ast2600.ymal      |   78 +
drivers/i2c/busses/Kconfig                    |   11 +
drivers/i2c/busses/Makefile                   |    1 +
drivers/i2c/busses/i2c-ast2600-global.c       |   94 +
drivers/i2c/busses/i2c-ast2600-global.h       |   19 +
drivers/i2c/busses/i2c-ast2600.c              | 1703 +++++++++++++++++
7 files changed, 1950 insertions(+)

create mode 100644 Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600-global.ymal create mode 100644 Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal create mode 100644 drivers/i2c/busses/i2c-ast2600-global.c
create mode 100644 drivers/i2c/busses/i2c-ast2600-global.h
create mode 100644 drivers/i2c/busses/i2c-ast2600.c

Signature · 1 line
2.17.1
author reviewer
#11 lore raw

Hello,

Quoted 15 lines

-----Original Message-----
From: Peter Delevoryas <[email protected]>
Sent: Friday, May 20, 2022 3:56 AM
Cc: Joel Stanley <[email protected]>; Andrew Jeffery <[email protected]>; Philipp Zabel <[email protected]>; linux-arm-kernel at lists.infradead.org; linux-aspeed at lists.ozlabs.org; linux-kernel at vger.kernel.org; OpenBMC List <[email protected]>; BMC-SW <[email protected]>; Peter Delevoryas <[email protected]>; Ryan Chen <[email protected]>
Subject: Re: [PATCH v3 0/3] Add ASPEED AST2600 I2C new controller driver

Quoted 1 line

On May 15, 2022, at 11:48 PM, ryan_chen <[email protected]>

Quoted 1 line · wrote:
Quoted 9 lines
Quoted 3 lines

This series add AST2600 i2c new register set driver. The i2c new register set have new clock divider option for more flexiable generation. And also have separate i2c master and slave register set for control.

Hey Ryan, thanks for this work! This is a little bit off-topic, but are you or anyone else at Aspeed working on an equivalent QEMU patch series? Without it, I don?t think QEMU will work with this series right? I think QEMU only supports the old register set right now.

No, there are two submit in QEMU about i2c new register mode.
One is ASPEED submit : https://patchwork.kernel.org/project/qemu-devel/list/?series=626028&archive=both
Another is GOOGLE : https://patchwork.kernel.org/project/qemu-devel/list/?series=627706&archive=both

Quoted 40 lines
Quoted 19 lines

v3:
-fix i2c global clock divide default value -remove i2c slave no used dev_dbg info.

v2:

(quoted diff) +0 -2
-add i2c global ymal file commit
-rename file name from new to ast2600.

aspeed-i2c-new-global.c -> i2c-ast2600-global.c aspeed-i2c-new-global.h -> i2c-ast2600-global.h i2c-new-aspeed.c -> i2c-ast2600.c -rename all driver function name to ast2600

ryan_chen (3):
dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C global register
controller
dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver
i2c:aspeed:support ast2600 i2c new register mode driver

Quoted 7 lines
.../i2c/aspeed,i2c-ast2600-global.ymal        |   44 +
.../bindings/i2c/aspeed,i2c-ast2600.ymal      |   78 +
drivers/i2c/busses/Kconfig                    |   11 +
drivers/i2c/busses/Makefile                   |    1 +
drivers/i2c/busses/i2c-ast2600-global.c       |   94 +
drivers/i2c/busses/i2c-ast2600-global.h       |   19 +
drivers/i2c/busses/i2c-ast2600.c              | 1703

+++++++++++++++++

Quoted 13 lines
7 files changed, 1950 insertions(+)

create mode 100644 Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600-global.ymal create mode 100644 Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal create mode 100644 drivers/i2c/busses/i2c-ast2600-global.c create mode 100644 drivers/i2c/busses/i2c-ast2600-global.h create mode 100644 drivers/i2c/busses/i2c-ast2600.c

--
2.17.1

#12 lore raw
Quoted 25 lines · Ryan Chen

Hello,

Quoted 19 lines

-----Original Message-----
From: Peter Delevoryas <[email protected]>
Sent: Friday, May 20, 2022 3:56 AM
Cc: Joel Stanley <[email protected]>; Andrew Jeffery <[email protected]>; Philipp Zabel <[email protected]>; linux-arm-kernel at lists.infradead.org; linux-aspeed at lists.ozlabs.org; linux-kernel at vger.kernel.org; OpenBMC List <[email protected]>; BMC-SW <[email protected]>; Peter Delevoryas <[email protected]>; Ryan Chen <[email protected]>
Subject: Re: [PATCH v3 0/3] Add ASPEED AST2600 I2C new controller driver

Quoted 1 line

On May 15, 2022, at 11:48 PM, ryan_chen <[email protected]>

Quoted 4 lines · wrote:

This series add AST2600 i2c new register set driver. The i2c new register set have new clock divider option for more flexiable generation. And also have separate i2c master and slave register set for control.

Quoted 8 lines
Quoted 5 lines

Hey Ryan, thanks for this work! This is a little bit off-topic, but are you or anyone else at Aspeed working on an equivalent QEMU patch series? Without it, I don?t think QEMU will work with this series right? I think QEMU only supports the old register set right now.

No, there are two submit in QEMU about i2c new register mode.
One is ASPEED submit : https://patchwork.kernel.org/project/qemu-devel/list/?series=626028&archive=both
Another is GOOGLE : https://patchwork.kernel.org/project/qemu-devel/list/?series=627706&archive=both

Oh great, thanks. I just tried the Aspeed QEMU series and it worked for me with Zephyr, very helpful!

Quoted 39 lines
Quoted 39 lines
Quoted 20 lines

v3:
-fix i2c global clock divide default value -remove i2c slave no used dev_dbg info.

v2:

(quoted diff) +0 -2
-add i2c global ymal file commit
-rename file name from new to ast2600.

aspeed-i2c-new-global.c -> i2c-ast2600-global.c aspeed-i2c-new-global.h -> i2c-ast2600-global.h i2c-new-aspeed.c -> i2c-ast2600.c -rename all driver function name to ast2600

ryan_chen (3):
dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C global register controller
dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver i2c:aspeed:support ast2600 i2c new register mode driver

Quoted 7 lines

.../i2c/aspeed,i2c-ast2600-global.ymal | 44 +
.../bindings/i2c/aspeed,i2c-ast2600.ymal | 78 +
drivers/i2c/busses/Kconfig | 11 +
drivers/i2c/busses/Makefile | 1 +
drivers/i2c/busses/i2c-ast2600-global.c | 94 +
drivers/i2c/busses/i2c-ast2600-global.h | 19 +
drivers/i2c/busses/i2c-ast2600.c | 1703

+++++++++++++++++

Quoted 11 lines
7 files changed, 1950 insertions(+)

create mode 100644 Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600-global.ymal create mode 100644 Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal create mode 100644 drivers/i2c/busses/i2c-ast2600-global.c create mode 100644 drivers/i2c/busses/i2c-ast2600-global.h create mode 100644 drivers/i2c/busses/i2c-ast2600.c

--
2.17.1

author reviewer
#13 lore raw
Quoted 51 lines

-----Original Message-----
From: Peter Delevoryas <[email protected]>
Sent: Friday, May 20, 2022 11:02 AM
Cc: Joel Stanley <[email protected]>; Andrew Jeffery <[email protected]>; Philipp Zabel <[email protected]>; linux-arm-kernel at lists.infradead.org; linux-aspeed at lists.ozlabs.org; linux-kernel at vger.kernel.org; OpenBMC List <[email protected]>; BMC-SW <[email protected]>; Ryan Chen <[email protected]>; Peter Delevoryas <[email protected]>
Subject: Re: [PATCH v3 0/3] Add ASPEED AST2600 I2C new controller driver

Quoted 1 line

On May 19, 2022, at 7:46 PM, Ryan Chen <[email protected]>

Quoted 12 lines · wrote:

Hello,

Quoted 9 lines

-----Original Message-----
From: Peter Delevoryas <[email protected]>
Sent: Friday, May 20, 2022 3:56 AM
Cc: Joel Stanley <[email protected]>; Andrew Jeffery <[email protected]>; Philipp Zabel <[email protected]>;
linux-arm-kernel at lists.infradead.org;
linux-aspeed at lists.ozlabs.org; linux-kernel at vger.kernel.org; OpenBMC List <[email protected]>; BMC-SW <[email protected]>; Peter Delevoryas <[email protected]>; Ryan Chen

<[email protected]>

Quoted 17 lines
Quoted 8 lines

Subject: Re: [PATCH v3 0/3] Add ASPEED AST2600 I2C new controller driver

Quoted 1 line

On May 15, 2022, at 11:48 PM, ryan_chen <[email protected]>

Quoted 1 line · wrote:
Quoted 9 lines
Quoted 3 lines

This series add AST2600 i2c new register set driver. The i2c new register set have new clock divider option for more flexiable generation. And also have separate i2c master and slave register set for control.

Hey Ryan, thanks for this work! This is a little bit off-topic, but are you or anyone else at Aspeed working on an equivalent QEMU patch series? Without it, I don?t think QEMU will work with this series right? I think QEMU only supports the old register set right now.

Quoted 6 lines

No, there are two submit in QEMU about i2c new register mode. One is ASPEED submit :
https://patchwork.kernel.org/project/qemu-devel/list/?series=626028&ar
chive=both Another is GOOGLE :
https://patchwork.kernel.org/project/qemu-devel/list/?series=627706&ar
chive=both

Quoted 2 lines

Oh great, thanks. I just tried the Aspeed QEMU series and it worked for me with Zephyr, very helpful!

Thanks your feedback, it check ok, please let me know.

Quoted 39 lines
Quoted 39 lines
Quoted 39 lines
Quoted 21 lines

v3:
-fix i2c global clock divide default value -remove i2c slave no used dev_dbg info.

v2:

(quoted diff) +0 -2
-add i2c global ymal file commit
-rename file name from new to ast2600.

aspeed-i2c-new-global.c -> i2c-ast2600-global.c aspeed-i2c-new-global.h -> i2c-ast2600-global.h i2c-new-aspeed.c -> i2c-ast2600.c -rename all driver function name to ast2600

ryan_chen (3):
dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C global register controller
dt-bindings: i2c-ast2600: Add bindings for AST2600 i2C driver i2c:aspeed:support ast2600 i2c new register mode driver

Quoted 6 lines

.../i2c/aspeed,i2c-ast2600-global.ymal | 44 + .../bindings/i2c/aspeed,i2c-ast2600.ymal | 78 + drivers/i2c/busses/Kconfig | 11 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-ast2600-global.c | 94 + drivers/i2c/busses/i2c-ast2600-global.h | 19 + drivers/i2c/busses/i2c-ast2600.c | 1703

+++++++++++++++++

Quoted 11 lines
7 files changed, 1950 insertions(+)

create mode 100644 Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600-global.ymal create mode 100644 Documentation/devicetree/bindings/i2c/aspeed,i2c-ast2600.ymal create mode 100644 drivers/i2c/busses/i2c-ast2600-global.c create mode 100644 drivers/i2c/busses/i2c-ast2600-global.h create mode 100644 drivers/i2c/busses/i2c-ast2600.c

--
2.17.1