Skip to content

Commit

Permalink
spi: sophgo: add Sophgo SPI NOR controller driver
Browse files Browse the repository at this point in the history
Merge series from Longbin Li <looong.bin@gmail.com>:

Add SPI NOR driver for Sophgo, including read, write operations.
This driver is only suitable for NOR flash.
  • Loading branch information
Mark Brown committed Mar 11, 2025
2 parents cf1ba3c + de16c32 commit 37a1fca
Show file tree
Hide file tree
Showing 4 changed files with 562 additions and 0 deletions.
52 changes: 52 additions & 0 deletions Documentation/devicetree/bindings/spi/spi-sg2044-nor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/spi/spi-sg2044-nor.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: SG2044 SPI NOR controller

maintainers:
- Longbin Li <looong.bin@gmail.com>

allOf:
- $ref: spi-controller.yaml#

properties:
compatible:
const: sophgo,sg2044-spifmc-nor

reg:
maxItems: 1

clocks:
maxItems: 1

interrupts:
maxItems: 1

resets:
maxItems: 1

required:
- compatible
- reg
- clocks
- interrupts
- resets

unevaluatedProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
spi@1000000 {
compatible = "sophgo,sg2044-spifmc-nor";
reg = <0x1000000 0x4000000>;
#address-cells = <1>;
#size-cells = <0>;
clocks = <&clk 0>;
interrupts = <37 IRQ_TYPE_LEVEL_HIGH>;
resets = <&rst 0>;
};
9 changes: 9 additions & 0 deletions drivers/spi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,15 @@ config SPI_SN_F_OSPI
for connecting an SPI Flash memory over up to 8-bit wide bus.
It supports indirect access mode only.

config SPI_SG2044_NOR
tristate "SG2044 SPI NOR Controller"
depends on ARCH_SOPHGO || COMPILE_TEST
help
This enables support for the SG2044 SPI NOR controller,
which supports Dual/Quad read and write operations while
also supporting 3Byte address devices and 4Byte address
devices.

config SPI_SPRD
tristate "Spreadtrum SPI controller"
depends on ARCH_SPRD || COMPILE_TEST
Expand Down
1 change: 1 addition & 0 deletions drivers/spi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ obj-$(CONFIG_SPI_SH_SCI) += spi-sh-sci.o
obj-$(CONFIG_SPI_SIFIVE) += spi-sifive.o
obj-$(CONFIG_SPI_SLAVE_MT27XX) += spi-slave-mt27xx.o
obj-$(CONFIG_SPI_SN_F_OSPI) += spi-sn-f-ospi.o
obj-$(CONFIG_SPI_SG2044_NOR) += spi-sg2044-nor.o
obj-$(CONFIG_SPI_SPRD) += spi-sprd.o
obj-$(CONFIG_SPI_SPRD_ADI) += spi-sprd-adi.o
obj-$(CONFIG_SPI_STM32) += spi-stm32.o
Expand Down
Loading

0 comments on commit 37a1fca

Please sign in to comment.