Skip to contentSkip to conversation

Add driver for Synopsys DesignWare I3C master IP

PATCH Superseded Vitor soares 4 participants 10 messages Nov 8, 2018 – Nov 13, 2018

Subsystems (6)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add driver for Synopsys DesignWare I3C master IP

This patch series is a proposal for the I3C master driver for Synopsys IP. This patch is to be applied on top of I3C subsystem RFC V10 submitted by Boris Brezillon.

Supported features:
Regular CCC commands.
I3C private transfers.
I2C transfers.

Missing functionalities:
Support DMA interface.
Support for I3C_BUS_MODE_MIXED_SLOW.
Hot-join.
IBI.

Main change between v2 and v3:
- Minor fixes. They are described in each patch

Main change between v1 and v2:
- Add controller version on dt-binding
- The driver now calls writesl/readsl() instead readl/writel
- Rename some variables in the driver

Vitor soares (3):
i3c: master: Add driver for Synopsys DesignWare IP
dt-bindings: i3c: Document Synopsys DesignWare I3C master bindings
MAINTAINERS: Add myself as the dw-i3c-master module maintainer

 .../devicetree/bindings/i3c/snps,dw-i3c-master.txt |   42 +
 MAINTAINERS                                        |    6 +
 drivers/i3c/master/Kconfig                         |   15 +
 drivers/i3c/master/Makefile                        |    1 +
 drivers/i3c/master/dw-i3c-master.c                 | 1216 ++++++++++++++++++++
 5 files changed, 1280 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt
 create mode 100644 drivers/i3c/master/dw-i3c-master.c
Signature · 1 line
2.7.4
#1 lore raw

PATCH v3 1/3 i3c: master: Add driver for Synopsys DesignWare IP

Add driver for Synopsys DesignWare I3C master IP

---
Change in v3:
- Use struct_size() (suggested by Matthew)

Change in v2:
- Rename some variables
- Remove dw_i3c_master_dev_set_info()
- Ajust code to match the changes made of i3c subsystem
- Use readsl/writesl() to populate TX/RX buffers

 drivers/i3c/master/Kconfig         |   15 +
 drivers/i3c/master/Makefile        |    1 +
 drivers/i3c/master/dw-i3c-master.c | 1216 ++++++++++++++++++++++++++++++++++++
 3 files changed, 1232 insertions(+)
 create mode 100644 drivers/i3c/master/dw-i3c-master.c
drivers/i3c/master/Kconfig +14 -0
index 959b837..2702751 100644
@@ -4,3 +4,18 @@ config CDNS_I3C_MASTER
 	depends on !(ALPHA || PARISC)
 	help
 	  Enable this driver if you want to support Cadence I3C master block.
+
+config DW_I3C_MASTER
+	tristate "Synospsys DesignWare I3C master driver"
+	depends on I3C
+	depends on !(ALPHA || PARISC)
+	# ALPHA and PARISC needs {read,write}sl()
+	help
+	  Support for Synopsys DesignWare MIPI I3C Controller.
+
+	  For details please see
+	  https://www.synopsys.com/dw/ipdir.php?ds=mipi_i3c
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called dw-i3c-master.
drivers/i3c/master/Makefile +1 -0
index 4c4304a..fc53939 100644
@@ -1 +1,2 @@
 obj-$(CONFIG_CDNS_I3C_MASTER)		+= i3c-master-cdns.o
+obj-$(CONFIG_DW_I3C_MASTER)		+= dw-i3c-master.o
drivers/i3c/master/dw-i3c-master.c new file +1216 -0

1,216 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

PATCH v3 2/3 dt-bindings: i3c: Document Synopsys DesignWare I3C master bindings

In reply to Vitor soares

Document Synopsys DesignWare I3C master module

---
Changes in v3:
- Remove dummy characters

Changes in v2:
- Address the changes in Documentation/devicetree/bindings/i3c/i3c.txt
- Add controller version on compatible string

 .../devicetree/bindings/i3c/snps,dw-i3c-master.txt | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt
Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt new file +42 -0
new file mode 100644
index 0000000..b930c09
@@ -0,0 +1,42 @@
+Bindings for Synopsys DesignWare I3C master block
+=================================================
+
+Required properties:
+--------------------
+- compatible: shall be "snps,dw-i3c-master-1.00a"
+- clocks: shall reference the core_clk
+- interrupts: the interrupt line connected to this I3C master
+- reg: Offset and length of I3C master registers
+
+Mandatory properties defined by the generic binding (see
+Documentation/devicetree/bindings/i3c/i3c.txt for more details):
+
+- #address-cells: shall be set to 3
+- #size-cells: shall be set to 0
+
+Optional properties defined by the generic binding (see
+Documentation/devicetree/bindings/i3c/i3c.txt for more details):
+
+- i2c-scl-hz
+- i3c-scl-hz
+
+I3C device connected on the bus follow the generic description (see
+Documentation/devicetree/bindings/i3c/i3c.txt for more details).
+
+Example:
+
+	i3c-master@2000 {
+		compatible = "snps,dw-i3c-master-1.00a";
+		#address-cells = <3>;
+		#size-cells = <0>;
+		reg = <0x02000 0x1000>;
+		interrupts = <0>;
+		clocks = <&i3cclk>;
+
+		eeprom@57{
+			compatible = "atmel,24c01";
+			reg = < 0x57 0x0 0x10>;
+			pagesize = <0x8>;
+		};
+	};
+
Signature · 1 line
2.7.4
#7 lore raw

PATCH v3 3/3 MAINTAINERS: Add myself as the dw-i3c-master module maintainer

In reply to Vitor soares

---
Change in v3:
- Remove dummy characters

Change in v2:
- None

 MAINTAINERS | 6 ++++++
 1 file changed, 6 insertions(+)
MAINTAINERS +6 -0
index 293c863..39910b3 100644
@@ -6930,6 +6930,12 @@ F:	drivers/i3c/
 F:	include/linux/i3c/
 F:	include/dt-bindings/i3c/
 
+I3C DRIVER FOR SYNOPSYS DESIGNWARE
+M:	Vitor Soares <[email protected]>
+S:	Maintained
+F:	Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt
+F:	drivers/i3c/master/dw*
+
 IA64 (Itanium) PLATFORM
 M:	Tony Luck <[email protected]>
 M:	Fenghua Yu <[email protected]>
Signature · 1 line
2.7.4
#8 lore raw
In reply to Vitor soares
Quoted 3 lines · Vitor soares

This patch series is a proposal for the I3C master driver for Synopsys IP. This patch is to be applied on top of I3C subsystem RFC V10 submitted by Boris Brezillon.

I'd like to get Boris's reviewed/signed-off on these before I take them.

thanks,

greg k-h

#9 lore raw
In reply to Vitor soares
Quoted 3 lines · On Thu, 8 Nov 2018 17:14:08 +0000 Vitor soares <[email protected]>…

This patch series is a proposal for the I3C master driver for Synopsys IP. This patch is to be applied on top of I3C subsystem RFC V10 submitted by Boris Brezillon.

The patch series looks to me. I'm just waiting an ack from Rob on the bindings to queue it to the i3c/next branch.

Thanks,

Boris

Quoted 34 lines

Supported features:
Regular CCC commands.
I3C private transfers.
I2C transfers.

Missing functionalities:
Support DMA interface.
Support for I3C_BUS_MODE_MIXED_SLOW.
Hot-join.
IBI.

Main change between v2 and v3:
- Minor fixes. They are described in each patch

Main change between v1 and v2:
- Add controller version on dt-binding
- The driver now calls writesl/readsl() instead readl/writel
- Rename some variables in the driver

Vitor soares (3):
i3c: master: Add driver for Synopsys DesignWare IP
dt-bindings: i3c: Document Synopsys DesignWare I3C master bindings
MAINTAINERS: Add myself as the dw-i3c-master module maintainer

 .../devicetree/bindings/i3c/snps,dw-i3c-master.txt |   42 +
 MAINTAINERS                                        |    6 +
 drivers/i3c/master/Kconfig                         |   15 +
 drivers/i3c/master/Makefile                        |    1 +
 drivers/i3c/master/dw-i3c-master.c                 | 1216 ++++++++++++++++++++
 5 files changed, 1280 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt
 create mode 100644 drivers/i3c/master/dw-i3c-master.c
#3 lore raw

Re: [PATCH v3 2/3] dt-bindings: i3c: Document Synopsys DesignWare I3C master bindings

In reply to Vitor soares
Quoted 21 lines · On Thu, 8 Nov 2018 17:14:10 +0000 Vitor soares <[email protected]>…

Document Synopsys DesignWare I3C master module

---
Changes in v3:
- Remove dummy characters

Changes in v2:
- Address the changes in Documentation/devicetree/bindings/i3c/i3c.txt
- Add controller version on compatible string

 .../devicetree/bindings/i3c/snps,dw-i3c-master.txt | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt
Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt new file +0 -0
new file mode 100644
index 0000000..b930c09

Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt line 7

Quoted 7 lines
Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt new file +7 -0
@@ -0,0 +1,42 @@
+Bindings for Synopsys DesignWare I3C master block
+=================================================
+
+Required properties:
+--------------------
+- compatible: shall be "snps,dw-i3c-master-1.00a"
+- clocks: shall reference the core_clk

Are you sure this IP only requires only one clock? If you're unsure, you'd better have a clock-names prop.

Quoted 21 lines
Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt new file +21 -0
+- interrupts: the interrupt line connected to this I3C master
+- reg: Offset and length of I3C master registers
+
+Mandatory properties defined by the generic binding (see
+Documentation/devicetree/bindings/i3c/i3c.txt for more details):
+
+- #address-cells: shall be set to 3
+- #size-cells: shall be set to 0
+
+Optional properties defined by the generic binding (see
+Documentation/devicetree/bindings/i3c/i3c.txt for more details):
+
+- i2c-scl-hz
+- i3c-scl-hz
+
+I3C device connected on the bus follow the generic description (see
+Documentation/devicetree/bindings/i3c/i3c.txt for more details).
+
+Example:
+
+	i3c-master@2000 {

Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt line 38

Quoted 10 lines
Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt new file +10 -0
+		compatible = "snps,dw-i3c-master-1.00a";
+		#address-cells = <3>;
+		#size-cells = <0>;
+		reg = <0x02000 0x1000>;
+		interrupts = <0>;
+		clocks = <&i3cclk>;
+
+		eeprom@57{
+			compatible = "atmel,24c01";
+			reg = < 0x57 0x0 0x10>;

^ remove this white space.

Quoted 4 lines
Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt new file +4 -0
+			pagesize = <0x8>;
+		};
+	};
+
maintainer Reviewed-by on v3 2/3
#5 lore raw

Re: [PATCH v3 2/3] dt-bindings: i3c: Document Synopsys DesignWare I3C master bindings

In reply to Vitor soares
Quoted 3 lines · Vitor soares

Document Synopsys DesignWare I3C master module

Please make your author and S-o-b emails match.

Quoted 11 lines

---
Changes in v3:
- Remove dummy characters

Changes in v2:
- Address the changes in Documentation/devicetree/bindings/i3c/i3c.txt
- Add controller version on compatible string

 .../devicetree/bindings/i3c/snps,dw-i3c-master.txt | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt

Otherwise,

author
#4 lore raw

Re: [PATCH v3 2/3] dt-bindings: i3c: Document Synopsys DesignWare I3C master bindings

In reply to Boris Brezillon

Hi Boris,

Quoted 18 lines · Boris Brezillon
Quoted 15 lines · On Thu, 8 Nov 2018 17:14:10 +0000 Vitor soares <[email protected]>…

Document Synopsys DesignWare I3C master module

---
Changes in v3:
- Remove dummy characters

Changes in v2:
- Address the changes in Documentation/devicetree/bindings/i3c/i3c.txt
- Add controller version on compatible string

  .../devicetree/bindings/i3c/snps,dw-i3c-master.txt | 42 ++++++++++++++++++++++
  1 file changed, 42 insertions(+)

create mode 100644 Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt

Quoted 15 lines

Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt line 7

Quoted 13 lines
Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt new file +7 -0
new file mode 100644
index 0000000..b930c09
@@ -0,0 +1,42 @@
+Bindings for Synopsys DesignWare I3C master block
+=================================================
+
+Required properties:
+--------------------
+- compatible: shall be "snps,dw-i3c-master-1.00a"
+- clocks: shall reference the core_clk

Are you sure this IP only requires only one clock? If you're unsure, you'd better have a clock-names prop.

Yes, the controller only has this clock dependency to configure the SCL.

Quoted 34 lines
Quoted 22 lines
Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt new file +21 -0
+- interrupts: the interrupt line connected to this I3C master
+- reg: Offset and length of I3C master registers
+
+Mandatory properties defined by the generic binding (see
+Documentation/devicetree/bindings/i3c/i3c.txt for more details):
+
+- #address-cells: shall be set to 3
+- #size-cells: shall be set to 0
+
+Optional properties defined by the generic binding (see
+Documentation/devicetree/bindings/i3c/i3c.txt for more details):
+
+- i2c-scl-hz
+- i3c-scl-hz
+
+I3C device connected on the bus follow the generic description (see
+Documentation/devicetree/bindings/i3c/i3c.txt for more details).
+
+Example:
+
+	i3c-master@2000 {

Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt line 38

Quoted 10 lines
Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt new file +10 -0
+		compatible = "snps,dw-i3c-master-1.00a";
+		#address-cells = <3>;
+		#size-cells = <0>;
+		reg = <0x02000 0x1000>;
+		interrupts = <0>;
+		clocks = <&i3cclk>;
+
+		eeprom@57{
+			compatible = "atmel,24c01";
+			reg = < 0x57 0x0 0x10>;

^ remove this white space.

Quoted 4 lines

Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt line 42

Quoted 4 lines
Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt new file +4 -0
+			pagesize = <0x8>;
+		};
+	};
+

Best regards,

Vitor Soares

author
#6 lore raw

Re: [PATCH v3 2/3] dt-bindings: i3c: Document Synopsys DesignWare I3C master bindings

In reply to Rob Herring

Hi Rob,

Quoted 5 lines · Rob Herring
Quoted 3 lines · Vitor soares

Document Synopsys DesignWare I3C master module

Please make your author and S-o-b emails match.

This is an alias and both email will work. Anyway I agree that should be the same that appear in the mailing list and I will change it.

Quoted 8 lines
Quoted 8 lines

---
Changes in v3:
- Remove dummy characters

Changes in v2:
- Address the changes in Documentation/devicetree/bindings/i3c/i3c.txt
- Add controller version on compatible string

Quoted 6 lines
Quoted 3 lines
  .../devicetree/bindings/i3c/snps,dw-i3c-master.txt | 42 ++++++++++++++++++++++
  1 file changed, 42 insertions(+)

create mode 100644 Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.txt

Otherwise,

Thanks for review.

Best regards,

Vitor Soares