Skip to contentSkip to conversation

Silvaco I3C master driver

PATCH Superseded Miquel Raynal 2 participants 7 messages Dec 28, 2020 – Jan 14, 2021

Subsystems (3)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Miquel Raynal

author maintainer
#0 lore raw

v3 cover Silvaco I3C master driver

Hello,

Here is the addition of a driver for the Silvaco I3C master IP.

Changes in v3:
* Fix the MAINTAINERS file.
* Fix the bindings (clocks description, size-cells, etc)
* Add Rob's Ack on one patch.
* Dropped unnecessary locks.
* Used a hardware feature to automatically NACK IBI's during regular data transfers.
* Stopped flushing FIFOs (not needed).
* Entirely reworked the IBI handling logic.
* Dropped the warning when a device does not advertise it's dynamic address during an IBI.
* Moved the IBI logic into the master's workqueue instead of a threaded handler.
* Added a svc_i3c_master_readb() helper.
* Used consistent bit definitions (BIT() vs. FIELD_GET()).

Changes in v2:
* Change the manufacturer name from svc to silvaco.

Miquel Raynal (4):
dt-bindings: Add vendor prefix for Silvaco
dt-bindings: i3c: Describe Silvaco master binding
i3c: master: svc: Add Silvaco I3C master driver
MAINTAINERS: Add Silvaco I3C master

 .../bindings/i3c/silvaco,i3c-master.yaml      |   63 +
 .../devicetree/bindings/vendor-prefixes.yaml  |    2 +
 MAINTAINERS                                   |    8 +
 drivers/i3c/master/Kconfig                    |    8 +
 drivers/i3c/master/Makefile                   |    1 +
 drivers/i3c/master/svc-i3c-master.c           | 1478 +++++++++++++++++
 6 files changed, 1560 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml
 create mode 100644 drivers/i3c/master/svc-i3c-master.c
Signature · 7 lines
2.20.1


-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
author maintainer
#1 lore raw

PATCH v3 1/4 dt-bindings: Add vendor prefix for Silvaco

Silvaco, Inc. is an EDA provider of software tools used for process and device development and for analog/mixed-signal, power IC and memory design [1].

[1] https://www.silvaco.com/company/profile/profile.html

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 041ae90b0d8f..df1b7971c07e 100644
@@ -1075,6 +1075,8 @@ patternProperties:
     description: Shenzhen Sunchip Technology Co., Ltd
   "^SUNW,.*":
     description: Sun Microsystems, Inc
+  "^silvaco,.*":
+    description: Silvaco, Inc.
   "^swir,.*":
     description: Sierra Wireless
   "^syna,.*":
Signature · 7 lines
2.20.1


-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
author maintainer
#2 lore raw

PATCH v3 2/4 dt-bindings: i3c: Describe Silvaco master binding

In reply to Miquel Raynal

Silvaco provide a dual-role I3C master.

Description is rather simple: it needs a register mapping, three clocks and an interrupt.

---
 .../bindings/i3c/silvaco,i3c-master.yaml      | 63 +++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml
Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml new file +63 -0
new file mode 100644
index 000000000000..509de48455b0
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i3c/silvaco,i3c-master.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Silvaco I3C master
+
+maintainers:
+  - Conor Culhane <[email protected]>
+
+properties:
+  compatible:
+    const: silvaco,i3c-master
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: pclk, the system clock
+      - description: fast_clk, for the bus
+      - description: slow_clk, for other events
+
+  clock-names:
+    minItems: 3
+    maxItems: 3
+
+  resets:
+    maxItems: 1
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clock-names
+  - clocks
+  - "#address-cells"
+  - "#size-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    i3c-master@a0000000 {
+        compatible = "silvaco,i3c-master";
+        clocks = <&zynqmp_clk 71>, <&fclk>, <&sclk>;
+        clock-names = "pclk", "fast_clk", "slow_clk";
+        interrupt-parent = <&gic>;
+        interrupts = <0 89 4>;
+        reg = <0xa0000000 0x1000>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+    };
Signature · 7 lines
2.20.1


-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
maintainer
#3 lore raw

Re: [PATCH v3 2/4] dt-bindings: i3c: Describe Silvaco master binding

Quoted 21 lines · Miquel Raynal

Silvaco provide a dual-role I3C master.

Description is rather simple: it needs a register mapping, three clocks and an interrupt.

---
 .../bindings/i3c/silvaco,i3c-master.yaml      | 63 +++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml
Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml new file +4 -0
new file mode 100644
index 000000000000..509de48455b0
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i3c/silvaco,i3c-master.yaml#

Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml line 14

Quoted 10 lines
Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml new file +10 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Silvaco I3C master
+
+maintainers:
+  - Conor Culhane <[email protected]>
+
+properties:
+  compatible:
+    const: silvaco,i3c-master

Kind of generic. Only 1 version?

Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml line 26

Quoted 12 lines
Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml new file +12 -0
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: pclk, the system clock
+      - description: fast_clk, for the bus
+      - description: slow_clk, for other events

The names of the clocks go...

Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml line 30

Quoted 4 lines
Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml new file +4 -0
+
+  clock-names:
+    minItems: 3
+    maxItems: 3

here.

Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml line 39

Quoted 9 lines
Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml new file +9 -0
+
+  resets:
+    maxItems: 1
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0

This 2 should be defined by a bus binding. Care to convert i3c.txt?

Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml line 50

Quoted 11 lines
Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml new file +11 -0
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clock-names
+  - clocks
+  - "#address-cells"
+  - "#size-cells"
+
+additionalProperties: false

No, don't you need child nodes?

Quoted 16 lines
Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml new file +13 -0
+
+examples:
+  - |
+    i3c-master@a0000000 {
+        compatible = "silvaco,i3c-master";
+        clocks = <&zynqmp_clk 71>, <&fclk>, <&sclk>;
+        clock-names = "pclk", "fast_clk", "slow_clk";
+        interrupt-parent = <&gic>;
+        interrupts = <0 89 4>;
+        reg = <0xa0000000 0x1000>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+    };
Signature · 1 line
2.20.1
Signature · 3 lines
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
author maintainer
#4 lore raw

Re: [PATCH v3 2/4] dt-bindings: i3c: Describe Silvaco master binding

Hi Rob,

Quoted 5 lines

Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml line 14

Quoted 3 lines
Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml new file +3 -0
+properties:
+  compatible:
+    const: silvaco,i3c-master  

Kind of generic. Only 1 version?

I appended a -v1 because I have no clue of the numbering neither if more versions will actually come.

[...]

Quoted 8 lines

Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml line 26

Quoted 6 lines
Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml new file +6 -0
+
+  clocks:
+    items:
+      - description: pclk, the system clock
+      - description: fast_clk, for the bus
+      - description: slow_clk, for other events  

The names of the clocks go...

Issues corrected.

[...]

Quoted 8 lines

Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml line 39

Quoted 6 lines
Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml new file +6 -0
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0  

This 2 should be defined by a bus binding. Care to convert i3c.txt?

Please see v4 of this series, which includes a converstion attempt to i3c.yaml. I am far from comfortable with yaml schema but, let's see what you think.

Thanks,
Miquèl

Signature · 3 lines
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
author maintainer
#5 lore raw

PATCH v3 3/4 i3c: master: svc: Add Silvaco I3C master driver

In reply to Miquel Raynal

Add support for Silvaco I3C dual-role IP. The master role is supported in SDR mode only. I2C transfers have not been tested but are shared because they are very close to the I3C transfers in terms of register configuration.

The IBI processing follows this logic:
- When a slave advertizes an interrupt (SDA pulled low) an interrupt gets generated by the master. This time is unbounded and may be deferred.
- The IRQ handler itself does not process anything: it only queues a work that will be run in non-atomic context. This is needed because short wait periods must be experienced.
- The IBI job is divided in two parts: the first one is "critical" in the sense that it may not support getting interrupted. If this happens, after this first section the driver checks the master error register and depending on its content either flushes everything and errors out, or ends the processing (this second section may be interrupted).
- If the critical section got interrupted, the slave will automatically respin it's IBI request when it will be allowed to.

---
 drivers/i3c/master/Kconfig          |    8 +
 drivers/i3c/master/Makefile         |    1 +
 drivers/i3c/master/svc-i3c-master.c | 1478 +++++++++++++++++++++++++++
 3 files changed, 1487 insertions(+)
 create mode 100644 drivers/i3c/master/svc-i3c-master.c
drivers/i3c/master/Kconfig +8 -0
index e68f15f4b4d0..eb6ac7aa307b 100644
@@ -22,6 +22,14 @@ config DW_I3C_MASTER
 	  This driver can also be built as a module.  If so, the module
 	  will be called dw-i3c-master.
 
+config SVC_I3C_MASTER
+	tristate "Silvaco I3C Dual-Role Master driver"
+	depends on I3C
+	depends on HAS_IOMEM
+	depends on !(ALPHA || PARISC)
+	help
+	  Support for Silvaco I3C Dual-Role Master Controller.
+
 config MIPI_I3C_HCI
 	tristate "MIPI I3C Host Controller Interface driver (EXPERIMENTAL)"
 	depends on I3C
drivers/i3c/master/Makefile +1 -0
index b892fd4cafad..b3fee0f690b2 100644
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-$(CONFIG_CDNS_I3C_MASTER)		+= i3c-master-cdns.o
 obj-$(CONFIG_DW_I3C_MASTER)		+= dw-i3c-master.o
+obj-$(CONFIG_SVC_I3C_MASTER)		+= svc-i3c-master.o
 obj-$(CONFIG_MIPI_I3C_HCI)		+= mipi-i3c-hci/
drivers/i3c/master/svc-i3c-master.c new file +1478 -0

1,478 lines not on this page · raw message

Signature · 7 lines
2.20.1


-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
author maintainer
#6 lore raw

PATCH v3 4/4 MAINTAINERS: Add Silvaco I3C master

In reply to Miquel Raynal

Add Conor and myself as maintainers.

---
 MAINTAINERS | 8 ++++++++
 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
index 546aa66428c9..caa4e1ea32a7 100644
@@ -16237,6 +16237,14 @@ S:	Maintained
 F:	Documentation/fb/sm712fb.rst
 F:	drivers/video/fbdev/sm712*
 
+SILVACO I3C DUAL-ROLE MASTER
+M:	Miquel Raynal <[email protected]>
+M:	Conor Culhane <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml
+F:	drivers/i3c/master/svc-i3c-master.c
+
 SIMPLE FIRMWARE INTERFACE (SFI)
 S:	Obsolete
 W:	http://simplefirmware.org/
Signature · 7 lines
2.20.1


-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c