Skip to contentSkip to conversation

Add SPI Driver to HPE GXP Architecture

PATCH In review [email protected] 3 participants 9 messages Jul 28, 2022 – Oct 5, 2022

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

v6 cover Add SPI Driver to HPE GXP Architecture

From: Nick Hawkins <[email protected]>

Changes since v6:
*Removed spaces between tags on commit descriptions

Changes since v5:
*Fixed indentation in Kconfig file

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 v6 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.

---
v6:
*No change
v5:
*Add missing spaces in Kconfig to have proper alignment
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..e3787cd9b475 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
author maintainer
#2 lore raw

PATCH v6 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

---
v6:
*Remove blank line between tags in commit description
v5:
*No change, add Krzysztof review from previous version
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
#3 lore raw

PATCH v6 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.

---
v6:
*No change
v5:
*No change
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
#4 lore raw

RE: [PATCH v6 3/5] ARM: dts: hpe: Add spi driver node

Greetings all,

Was there a particular issue with this patch? I just realized that patches 1,2, and 5 were accepted but not 3 or 4.

Thanks,

-Nick Hawkins

#5 lore raw

Re: [PATCH v6 3/5] ARM: dts: hpe: Add spi driver node

Quoted 3 lines · Nick

Was there a particular issue with this patch? I just realized that patches 1,2, and 5 were accepted but not 3 or 4.

It looks like you sent the patch to a lot of people, without addressing anyone in particular. I certainly did not expect to pick it up like this.

When you resend the missing patches after 6.1-rc1, please send the ones you want to be merged through the soc tree to:[email protected], with reviewers and mailing lists on Cc, but nobody else as the recipient.

For the SoC tree, I usually have separate branches for code changes (usually just Kconfig and MAINTAINERS entries in case of arm64), devicetree changes, defconfig changes and driver (typically drivers/soc, but could be others that have no separate subsystem maintainers), so ideally you send a set of patches or a pull request for each such topic branch.

Arnd

author maintainer
#6 lore raw

PATCH v6 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.

---
v6:
*Remove blank line between tags on commit description
v5:
*No change, add Acked-by from Krzsztof from previous version
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
#7 lore raw

PATCH v6 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

---
v6:
*No change
v5:
*No change
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
maintainer
#8 lore raw

Re: (subset) [PATCH v6 0/5] Add SPI Driver to HPE GXP Architecture

In reply to [email protected]
Quoted 9 lines · On Thu, 28 Jul 2022 11:14:54 -0500, [email protected] wrote:

From: Nick Hawkins <[email protected]>

Changes since v6:
*Removed spaces between tags on commit descriptions

Changes since v5:
*Fixed indentation in Kconfig file

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

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

      commit: 730bc8ba5e9ec103065142975015a793558f09a0
[2/5] spi: dt-bindings: add documentation for hpe,gxp-spifi
      commit: 8cc35b86546dc35fb4f5ff7d1d163c5efc78bf0e
[5/5] MAINTAINERS: add spi support to GXP
      commit: a1848b0fa2517a8d0bbc2783c90aefd4b7e7567a

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark