Skip to content

Commit 37a1fca

Browse files
committed
spi: sophgo: add Sophgo SPI NOR controller driver
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.
2 parents cf1ba3c + de16c32 commit 37a1fca

File tree

4 files changed

+562
-0
lines changed

4 files changed

+562
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/spi/spi-sg2044-nor.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: SG2044 SPI NOR controller
8+
9+
maintainers:
10+
- Longbin Li <looong.bin@gmail.com>
11+
12+
allOf:
13+
- $ref: spi-controller.yaml#
14+
15+
properties:
16+
compatible:
17+
const: sophgo,sg2044-spifmc-nor
18+
19+
reg:
20+
maxItems: 1
21+
22+
clocks:
23+
maxItems: 1
24+
25+
interrupts:
26+
maxItems: 1
27+
28+
resets:
29+
maxItems: 1
30+
31+
required:
32+
- compatible
33+
- reg
34+
- clocks
35+
- interrupts
36+
- resets
37+
38+
unevaluatedProperties: false
39+
40+
examples:
41+
- |
42+
#include <dt-bindings/interrupt-controller/irq.h>
43+
44+
spi@1000000 {
45+
compatible = "sophgo,sg2044-spifmc-nor";
46+
reg = <0x1000000 0x4000000>;
47+
#address-cells = <1>;
48+
#size-cells = <0>;
49+
clocks = <&clk 0>;
50+
interrupts = <37 IRQ_TYPE_LEVEL_HIGH>;
51+
resets = <&rst 0>;
52+
};

drivers/spi/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,15 @@ config SPI_SN_F_OSPI
10341034
for connecting an SPI Flash memory over up to 8-bit wide bus.
10351035
It supports indirect access mode only.
10361036

1037+
config SPI_SG2044_NOR
1038+
tristate "SG2044 SPI NOR Controller"
1039+
depends on ARCH_SOPHGO || COMPILE_TEST
1040+
help
1041+
This enables support for the SG2044 SPI NOR controller,
1042+
which supports Dual/Quad read and write operations while
1043+
also supporting 3Byte address devices and 4Byte address
1044+
devices.
1045+
10371046
config SPI_SPRD
10381047
tristate "Spreadtrum SPI controller"
10391048
depends on ARCH_SPRD || COMPILE_TEST

drivers/spi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ obj-$(CONFIG_SPI_SH_SCI) += spi-sh-sci.o
136136
obj-$(CONFIG_SPI_SIFIVE) += spi-sifive.o
137137
obj-$(CONFIG_SPI_SLAVE_MT27XX) += spi-slave-mt27xx.o
138138
obj-$(CONFIG_SPI_SN_F_OSPI) += spi-sn-f-ospi.o
139+
obj-$(CONFIG_SPI_SG2044_NOR) += spi-sg2044-nor.o
139140
obj-$(CONFIG_SPI_SPRD) += spi-sprd.o
140141
obj-$(CONFIG_SPI_SPRD_ADI) += spi-sprd-adi.o
141142
obj-$(CONFIG_SPI_STM32) += spi-stm32.o

0 commit comments

Comments
 (0)