Skip to contentSkip to conversation

w1: Add AXI 1-wire host driver for AMD programmable logic IP core

PATCH Applied Kris Chaplin 3 participants 8 messages Nov 7, 2023 – Nov 16, 2023

Subsystems (3)
lore
Share & tools
lore

Kris Chaplin

author maintainer
#0 lore raw

v3 cover w1: Add AXI 1-wire host driver for AMD programmable logic IP core

Changes since v2:
Updated binding patch commit description to specify that version is detected using a register in IP.

Changes since v1:
Updated IP name and binding to axi-1wire-host and filenames to match. Comment pruning where operation obvious, additional comments where not. Unwrapped helper functions for register read/writes. Removed un-necessary device reset on fail to add device. Fixed duplicate clock disable in remove function. Move bus master structure to per instance. Improved hardware testing with multiple w1 instances.

Add a host driver to support the AMD 1-Wire programmable logic IP block. This block guarantees protocol timing for driving off-board devices such as thermal sensors, proms, etc.

Kris Chaplin (2):
dt-bindings: w1: Add YAML DT schema for AMD AXI w1 host and
MAINTAINERS entry
w1: Add AXI 1-wire host driver for AMD programmable logic IP core

 .../bindings/w1/amd,axi-1wire-host.yaml       |  44 ++
 MAINTAINERS                                   |   8 +
 drivers/w1/masters/Kconfig                    |  11 +
 drivers/w1/masters/Makefile                   |   1 +
 drivers/w1/masters/amd_axi_w1.c               | 395 ++++++++++++++++++
 5 files changed, 459 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/w1/amd,axi-1wire-host.yaml
 create mode 100644 drivers/w1/masters/amd_axi_w1.c
Signature · 1 line
2.42.GIT
author maintainer
#1 lore raw

PATCH v3 1/2 dt-bindings: w1: Add YAML DT schema for AMD AXI w1 host and MAINTAINERS entry

Add YAML DT schema for the AMD AXI w1 host IP.

This hardware guarantees protocol timing for driving off-board devices such as thermal sensors, proms, etc using the 1wire protocol. The IP has a register to detect hardware version and so the binding does not have an explict version number.

Add MAINTAINERS entry for DT schema.

---
 .../bindings/w1/amd,axi-1wire-host.yaml       | 44 +++++++++++++++++++
 MAINTAINERS                                   |  7 +++
 2 files changed, 51 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/w1/amd,axi-1wire-host.yaml
Documentation/devicetree/bindings/w1/amd,axi-1wire-host.yaml new file +44 -0
new file mode 100644
index 000000000000..ef70fa2c0c5d
@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/w1/amd,axi-1wire-host.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AMD AXI 1-wire bus host for programmable logic
+
+maintainers:
+  - Kris Chaplin <[email protected]>
+
+properties:
+  compatible:
+    const: amd,axi-1wire-host
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    onewire@a0000000 {
+        compatible = "amd,axi-1wire-host";
+        reg = <0xa0000000 0x10000>;
+        clocks = <&zynqmp_clk 0x47>;
+        interrupts = <GIC_SPI 0x59 IRQ_TYPE_LEVEL_HIGH>;
+    };
+
+...
MAINTAINERS +7 -0
index 375b2c87d099..2b23febfaf72 100644
@@ -891,6 +891,13 @@ Q:	https://patchwork.kernel.org/project/linux-rdma/list/
 F:	drivers/infiniband/hw/efa/
 F:	include/uapi/rdma/efa-abi.h
 
+AMD AXI W1 DRIVER
+M:	Kris Chaplin <[email protected]>
+R:	Thomas Delev <[email protected]>
+R:	Michal Simek <[email protected]>
+S:	Maintained
+F:	Documentation/devicetree/bindings/w1/amd,axi-1wire-host.yaml
+
 AMD CDX BUS DRIVER
 M:	Nipun Gupta <[email protected]>
 M:	Nikhil Agarwal <[email protected]>
Signature · 1 line
2.42.GIT
maintainer Acked-by on v3 1/2
#2 lore raw

Re: [PATCH v3 1/2] dt-bindings: w1: Add YAML DT schema for AMD AXI w1 host and MAINTAINERS entry

Quoted 1 line · Kris Chaplin

Add YAML DT schema for the AMD AXI w1 host IP.

Sorry for not noticing earlier, but if there's another spin, drop 'YAML DT schema for ' from the subject. You already said that with 'dt-bindings'.

Quoted 17 lines

This hardware guarantees protocol timing for driving off-board devices such as thermal sensors, proms, etc using the 1wire protocol. The IP has a register to detect hardware version and so the binding does not have an explict version number.

Add MAINTAINERS entry for DT schema.

---
 .../bindings/w1/amd,axi-1wire-host.yaml       | 44 +++++++++++++++++++
 MAINTAINERS                                   |  7 +++
 2 files changed, 51 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/w1/amd,axi-1wire-host.yaml
#3 lore raw

Re: [PATCH v3 1/2] dt-bindings: w1: Add YAML DT schema for AMD AXI w1 host and MAINTAINERS entry

Quoted 8 lines · Rob Herring
Quoted 1 line · Kris Chaplin

Add YAML DT schema for the AMD AXI w1 host IP.

Sorry for not noticing earlier, but if there's another spin, drop 'YAML DT schema for ' from the subject. You already said that with 'dt-bindings'.

I can fix it while applying. No need to resend, unless there will be more things to fix.

Anyway this waits till merge window finishes.

Best regards,
Krzysztof

author maintainer
#4 lore raw

Re: [PATCH v3 1/2] dt-bindings: w1: Add YAML DT schema for AMD AXI w1 host and MAINTAINERS entry

Quoted 9 lines
Quoted 6 lines

Sorry for not noticing earlier, but if there's another spin, drop 'YAML DT schema for ' from the subject. You already said that with 'dt-bindings'.

I can fix it while applying. No need to resend, unless there will be more things to fix.

Thank you Krzysztof and Rob. I'll amend locally and if we have any other fixes re-send otherwise hold off.

Regards
Kris

author maintainer
#5 lore raw

PATCH v3 2/2 w1: Add AXI 1-wire host driver for AMD programmable logic IP core

In reply to Kris Chaplin

Add a host driver to support the AMD 1-Wire programmable logic IP block. This block guarantees protocol timing for driving off-board devices such as thermal sensors, proms, etc.

Add file to MAINTAINERS

---
 MAINTAINERS                     |   1 +
 drivers/w1/masters/Kconfig      |  11 +
 drivers/w1/masters/Makefile     |   1 +
 drivers/w1/masters/amd_axi_w1.c | 395 ++++++++++++++++++++++++++++++++
 4 files changed, 408 insertions(+)
 create mode 100644 drivers/w1/masters/amd_axi_w1.c
MAINTAINERS +1 -0
index 2b23febfaf72..d6c6b89a0e66 100644
@@ -897,6 +897,7 @@ R:	Thomas Delev <[email protected]>
 R:	Michal Simek <[email protected]>
 S:	Maintained
 F:	Documentation/devicetree/bindings/w1/amd,axi-1wire-host.yaml
+F:	drivers/w1/masters/amd_axi_w1.c
 
 AMD CDX BUS DRIVER
 M:	Nipun Gupta <[email protected]>
drivers/w1/masters/Kconfig +11 -0
index ad316573288a..513c0b114337 100644
@@ -5,6 +5,17 @@
 
 menu "1-wire Bus Masters"
 
+config W1_MASTER_AMD_AXI
+	tristate "AMD AXI 1-wire bus host"
+	help
+	  Say Y here is you want to support the AMD AXI 1-wire IP core.
+	  This driver makes use of the programmable logic IP to perform
+	  correctly timed 1 wire transactions without relying on GPIO timing
+	  through the kernel.
+
+	  This driver can also be built as a module.  If so, the module will be
+	  called amd_w1_axi.
+
 config W1_MASTER_MATROX
 	tristate "Matrox G400 transport layer for 1-wire"
 	depends on PCI
drivers/w1/masters/Makefile +1 -0
index c5d85a827e52..6c5a21f9b88c 100644
@@ -3,6 +3,7 @@
 # Makefile for 1-wire bus master drivers.
 #
 
+obj-$(CONFIG_W1_MASTER_AMD_AXI)		+= amd_axi_w1.o
 obj-$(CONFIG_W1_MASTER_MATROX)		+= matrox_w1.o
 obj-$(CONFIG_W1_MASTER_DS2490)		+= ds2490.o
 obj-$(CONFIG_W1_MASTER_DS2482)		+= ds2482.o
drivers/w1/masters/amd_axi_w1.c new file +395 -0

395 lines not on this page · raw message

Signature · 1 line
2.42.GIT
#6 lore raw
In reply to Kris Chaplin
Quoted 12 lines · Kris Chaplin

Changes since v2:
Updated binding patch commit description to specify that version is detected using a register in IP.

Changes since v1:
Updated IP name and binding to axi-1wire-host and filenames to match. Comment pruning where operation obvious, additional comments where not. Unwrapped helper functions for register read/writes. Removed un-necessary device reset on fail to add device. Fixed duplicate clock disable in remove function. Move bus master structure to per instance. Improved hardware testing with multiple w1 instances.

Quoted 1 line

[...]

Applied, thanks!

[1/2] dt-bindings: w1: Add YAML DT schema for AMD AXI w1 host and MAINTAINERS entry

      https://git.kernel.org/krzk/linux-w1/c/3427fa5b32bbf54e51a2fde347a88161ff16a641
[2/2] w1: Add AXI 1-wire host driver for AMD programmable logic IP core
      https://git.kernel.org/krzk/linux-w1/c/271c81935801d6449bb7bab5ccfc6cd38238c62b

Best regards,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>
author maintainer
#7 lore raw

Thank you Krzysztof,

Quoted 3 lines · Krzysztof Kozlowski

Applied, thanks!

Really appreciate all the assistance from you, Michal, Thomas, Conor and Rob.

Regards
Kris