Skip to contentSkip to conversation

Add SPI Driver to HPE GXP Architecture

PATCH Superseded [email protected] 3 participants 9 messages Jul 25, 2022

Subsystems (4)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

v4 cover Add SPI Driver to HPE GXP Architecture

From: Nick Hawkins <[email protected]>

Changes since v4:
*Removed unnecessary quotes in hpe,gxp-spifi.yaml

Changes since v3:
*Fixed indentations in hpe,gxp-spifi.yaml

Changes since v2:
*Changed the CONFIG_SPI_GXP from y to m in defconfig *Removed extra space around < > for reg in hpe,gxp-spifi.yaml *Changed interrupt-parrent to interrupt-parent in hpe,gxp-spifi.yaml *Removed repeated include file in spi-gxp.c
*Removed unnecessary initialization of ret variable in spi-gxp.c *Removed conditional variable checks where failure is not possible in
spi-gxp.c
*Removed unnecessary variable cs in spi-gxp.c
*Removed blank gxp-spifi-remove function in spi-gxp.c *Fixed error messages so they are not repetitive

The GXP supports 3 separate SPI interfaces to accommodate the system flash, core flash, and other functions. The SPI engine supports variable clock frequency, selectable 3-byte or 4-byte addressing and a configurable x1, x2, and x4 command/address/data modes. The memory buffer for reading and writing ranges between 256 bytes and 8KB. This driver supports access to the core flash and bios part.

Nick Hawkins (5):
spi: spi-gxp: Add support for HPE GXP SoCs
spi: dt-bindings: add documentation for hpe,gxp-spifi
ARM: dts: hpe: Add spi driver node
ARM: configs: multi_v7_defconfig: Enable HPE GXP SPI driver
MAINTAINERS: add spi support to GXP

 .../bindings/spi/hpe,gxp-spifi.yaml           |  56 +++
 MAINTAINERS                                   |   2 +
 arch/arm/boot/dts/hpe-bmc-dl360gen10.dts      |  58 ++++
 arch/arm/boot/dts/hpe-gxp.dtsi                |  21 +-
 arch/arm/configs/multi_v7_defconfig           |   1 +
 drivers/spi/Kconfig                           |   7 +
 drivers/spi/Makefile                          |   1 +
 drivers/spi/spi-gxp.c                         | 325 ++++++++++++++++++
 8 files changed, 470 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/spi/hpe,gxp-spifi.yaml
 create mode 100644 drivers/spi/spi-gxp.c
Signature · 1 line
2.17.1
author maintainer
#1 lore raw

PATCH v4 1/5 spi: spi-gxp: Add support for HPE GXP SoCs

From: Nick Hawkins <[email protected]>

The GXP supports 3 separate SPI interfaces to accommodate the system flash, core flash, and other functions. The SPI engine supports variable clock frequency, selectable 3-byte or 4-byte addressing and a configurable x1, x2, and x4 command/address/data modes. The memory buffer for reading and writing ranges between 256 bytes and 8KB. This driver supports access to the core flash and bios part.

---
v4:
*No change
v3:
*No change
v2:
*Removed repeated include file
*Removed unnecessary initialization of ret variable *Removed conditional variable checks where failure is impossible *Removed unecessary variable cs and instead used in the initialization *Removed blank gxp_spifi_remove function
*Fixed error messages so they are not repetitive

---
 drivers/spi/Kconfig   |   7 +
 drivers/spi/Makefile  |   1 +
 drivers/spi/spi-gxp.c | 325 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 333 insertions(+)
 create mode 100644 drivers/spi/spi-gxp.c
drivers/spi/Kconfig +7 -0
index 3b1044ebc400..543e4a5b5ffa 100644
@@ -371,6 +371,13 @@ config SPI_FSL_QUADSPI
 	  This controller does not support generic SPI messages. It only
 	  supports the high-level SPI memory interface.
 
+config SPI_GXP
+	tristate "GXP SPI driver"
+	depends on ARCH_HPE || COMPILE_TEST
+	help
+	 This enables support for the driver for GXP bus attached SPI
+	 controllers.
+
 config SPI_HISI_KUNPENG
 	tristate "HiSilicon SPI Controller for Kunpeng SoCs"
 	depends on (ARM64 && ACPI) || COMPILE_TEST
drivers/spi/Makefile +1 -0
index 0f44eb6083a5..ca5f204017ee 100644
@@ -57,6 +57,7 @@ obj-$(CONFIG_SPI_FSL_LPSPI)		+= spi-fsl-lpspi.o
 obj-$(CONFIG_SPI_FSL_QUADSPI)		+= spi-fsl-qspi.o
 obj-$(CONFIG_SPI_FSL_SPI)		+= spi-fsl-spi.o
 obj-$(CONFIG_SPI_GPIO)			+= spi-gpio.o
+obj-$(CONFIG_SPI_GXP)			+= spi-gxp.o
 obj-$(CONFIG_SPI_HISI_KUNPENG)		+= spi-hisi-kunpeng.o
 obj-$(CONFIG_SPI_HISI_SFC_V3XX)		+= spi-hisi-sfc-v3xx.o
 obj-$(CONFIG_SPI_IMG_SPFI)		+= spi-img-spfi.o
drivers/spi/spi-gxp.c new file +325 -0

325 lines not on this page · raw message

Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH v4 1/5] spi: spi-gxp: Add support for HPE GXP SoCs

Hi--

Quoted 5 lines · On 7/25/22 13:13, [email protected] wrote:
drivers/spi/Kconfig +0 -0
index 3b1044ebc400..543e4a5b5ffa 100644

drivers/spi/Kconfig config SPI_FSL_QUADSPI · line 379

Quoted 9 lines
drivers/spi/Kconfig +6 -0
@@ -371,6 +371,13 @@ config SPI_FSL_QUADSPI
 	  This controller does not support generic SPI messages. It only
 	  supports the high-level SPI memory interface.
 
+config SPI_GXP
+	tristate "GXP SPI driver"
+	depends on ARCH_HPE || COMPILE_TEST
+	help
+	 This enables support for the driver for GXP bus attached SPI
+	 controllers.

Documentation/process/coding-style.rst says:

For all of the Kconfig* configuration files throughout the source tree, the indentation is somewhat different. Lines under a ``config`` definition are indented with one tab, while help text is indented an additional two spaces.

thanks.

Signature · 6 lines
~Randy

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

PATCH v4 2/5 spi: dt-bindings: add documentation for hpe,gxp-spifi

In reply to [email protected]

From: Nick Hawkins <[email protected]>

Create documentation for the hpe,gxp-spifi binding to support access to the SPI parts

---
v4:
*Remove uneccessary quotes
v3:
*Fix indentation
v2:
*Removed extra space around < > for reg
*Changed interrupt-parrent to interrupt-parent

---
 .../bindings/spi/hpe,gxp-spifi.yaml           | 56 +++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/hpe,gxp-spifi.yaml
Documentation/devicetree/bindings/spi/hpe,gxp-spifi.yaml new file +56 -0
new file mode 100644
index 000000000000..7797c3123b7e
@@ -0,0 +1,56 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/hpe,gxp-spifi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: HPE GXP spi controller flash interface
+
+maintainers:
+  - Nick Hawkins <[email protected]>
+  - Jean-Marie Verdun <[email protected]>
+
+allOf:
+  - $ref: spi-controller.yaml#
+
+properties:
+  compatible:
+    const: hpe,gxp-spifi
+
+  reg:
+    items:
+      - description: cfg registers
+      - description: data registers
+      - description: mapped memory
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+unevaluatedProperties: false
+
+examples:
+  - |
+
+    spi@200 {
+      compatible = "hpe,gxp-spifi";
+      reg = <0x200 0x80>, <0xc000 0x100>, <0x38000000 0x800000>;
+      interrupts = <20>;
+      interrupt-parent = <&vic0>;
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      flash@0 {
+        reg = <0>;
+        compatible = "jedec,spi-nor";
+      };
+
+      flash@1 {
+        reg = <1>;
+        compatible = "jedec,spi-nor";
+      };
+    };
Signature · 1 line
2.17.1
author maintainer
#5 lore raw

PATCH v4 3/5 ARM: dts: hpe: Add spi driver node

In reply to [email protected]

From: Nick Hawkins <[email protected]>

Add support for the SPI flash interface on the GXP SoC.

---
v4:
*No change
v3:
*No change
v2:
*No change

---
 arch/arm/boot/dts/hpe-bmc-dl360gen10.dts | 58 ++++++++++++++++++++++++
 arch/arm/boot/dts/hpe-gxp.dtsi           | 21 ++++++++-
 2 files changed, 78 insertions(+), 1 deletion(-)
arch/arm/boot/dts/hpe-bmc-dl360gen10.dts +58 -0
index 3a7382ce40ef..d49dcef95c5c 100644
@@ -24,3 +24,61 @@
 		reg = <0x40000000 0x20000000>;
 	};
 };
+
+&spifi {
+	status = "okay";
+	flash@0 {
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			u-boot@0 {
+				label = "u-boot";
+				reg = <0x0 0x60000>;
+			};
+
+			u-boot-env@60000 {
+				label = "u-boot-env";
+				reg = <0x60000 0x20000>;
+			};
+
+			kernel@80000 {
+				label = "kernel";
+				reg = <0x80000 0x4c0000>;
+			};
+
+			rofs@540000 {
+				label = "rofs";
+				reg = <0x540000 0x1740000>;
+			};
+
+			rwfs@1c80000 {
+				label = "rwfs";
+				reg = <0x1c80000 0x250000>;
+			};
+
+			section@1ed0000{
+				label = "section";
+				reg = <0x1ed0000 0x130000>;
+			};
+		};
+	};
+	flash@1 {
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			host-prime@0 {
+				label = "host-prime";
+				reg = <0x0 0x02000000>;
+			};
+
+			host-second@2000000 {
+				label = "host-second";
+				reg = <0x02000000 0x02000000>;
+			};
+		};
+	};
+};
arch/arm/boot/dts/hpe-gxp.dtsi +20 -1
index cf735b3c4f35..f28349bdeee1 100644
@@ -56,9 +56,28 @@
 			compatible = "simple-bus";
 			#address-cells = <1>;
 			#size-cells = <1>;
-			ranges = <0x0 0xc0000000 0x30000000>;
+			ranges = <0x0 0xc0000000 0x40000000>;
 			dma-ranges;
 
+			spifi: spi@200 {
+				compatible = "hpe,gxp-spifi";
+				reg = <0x200 0x80>, <0xc000 0x100>, <0x38000000 0x8000000>;
+				interrupts = <20>;
+				interrupt-parent = <&vic0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+				flash@0 {
+					reg = <0>;
+					compatible = "jedec,spi-nor";
+				};
+
+				flash@1 {
+					reg = <1>;
+					compatible = "jedec,spi-nor";
+				};
+			};
+
 			vic0: interrupt-controller@eff0000 {
 				compatible = "arm,pl192-vic";
 				reg = <0xeff0000 0x1000>;
Signature · 1 line
2.17.1
author maintainer
#6 lore raw

PATCH v4 4/5 ARM: configs: multi_v7_defconfig: Enable HPE GXP SPI driver

In reply to [email protected]

From: Nick Hawkins <[email protected]>

Enable the SPI driver on the HPE GXP BMC.

---
v4:
*No change
v3:
*No change
v2:
*Change CONFIG_SPI_GXP from y to m

---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/multi_v7_defconfig +1 -0
index ce9826bce29b..ee8a730dabc9 100644
@@ -443,6 +443,7 @@ CONFIG_SPI_CADENCE=y
 CONFIG_SPI_DAVINCI=y
 CONFIG_SPI_FSL_QUADSPI=m
 CONFIG_SPI_GPIO=m
+CONFIG_SPI_GXP=m
 CONFIG_SPI_FSL_DSPI=m
 CONFIG_SPI_OMAP24XX=y
 CONFIG_SPI_ORION=y
Signature · 1 line
2.17.1
author maintainer
#8 lore raw

PATCH v4 5/5 MAINTAINERS: add spi support to GXP

In reply to [email protected]

From: Nick Hawkins <[email protected]>

Add the spi driver and dt-binding documentation

---
v4:
*No change
v3:
*No change
v2:
*No change

---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)
MAINTAINERS +2 -0
index a6d3bd9d2a8d..f87728549ecf 100644
@@ -2140,11 +2140,13 @@ M:	Jean-Marie Verdun <[email protected]>
 M:	Nick Hawkins <[email protected]>
 S:	Maintained
 F:	Documentation/devicetree/bindings/arm/hpe,gxp.yaml
+F:	Documentation/devicetree/bindings/spi/hpe,gxp-spi.yaml
 F:	Documentation/devicetree/bindings/timer/hpe,gxp-timer.yaml
 F:	arch/arm/boot/dts/hpe-bmc*
 F:	arch/arm/boot/dts/hpe-gxp*
 F:	arch/arm/mach-hpe/
 F:	drivers/clocksource/timer-gxp.c
+F:	drivers/spi/spi-gxp.c
 F:	drivers/watchdog/gxp-wdt.c
 
 ARM/IGEP MACHINE SUPPORT
Signature · 1 line
2.17.1