Skip to content

Commit 3019400

Browse files
committed
Merge tag 'spi-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi updates from Mark Brown: "A moderately busy release for SPI, the main core update was the merging of support for multiple chip selects, used in some flash configurations. There were also big overhauls for the AXI SPI Engine and PL022 drivers, plus some new device support for ST. There's a few patches for other trees, API updates to allow the multiple chip select support and one of the naming modernisations touched a controller embedded in the USB code. - Support for multiple chip selects. - A big overhaul for the AXI SPI engine driver, modernising it and adding a bunch of new features. - Modernisation of the PL022 driver, fixing some issues with submitting messages while in atomic context in the process. - Many drivers were converted to use new APIs which avoid outdated terminology for devices and controllers. - Support for ST Microelectronics STM32F7 and STM32MP25, and Renesas RZ/Five" * tag 'spi-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (83 commits) spi: stm32: add st,stm32mp25-spi compatible supporting STM32MP25 soc dt-bindings: spi: stm32: add st,stm32mp25-spi compatible spi: stm32: use dma_get_slave_caps prior to configuring dma channel spi: axi-spi-engine: fix struct member doc warnings spi: pl022: update description of internal_cs_control() spi: pl022: delete description of cur_msg spi: dw: Remove Intel Thunder Bay SOC support spi: dw: Remove Intel Thunder Bay SOC support spi: sh-msiof: Enforce fixed DTDL for R-Car H3 spi: ljca: switch to use devm_spi_alloc_host() spi: cs42l43: switch to use devm_spi_alloc_host() spi: zynqmp-gqspi: switch to use modern name spi: zynq-qspi: switch to use modern name spi: xtensa-xtfpga: switch to use modern name spi: xlp: switch to use modern name spi: xilinx: switch to use modern name spi: xcomm: switch to use modern name spi: uniphier: switch to use modern name spi: topcliff-pch: switch to use modern name spi: wpcm-fiu: switch to use devm_spi_alloc_host() ...
2 parents da96801 + f6cd662 commit 3019400

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2156
-1722
lines changed

Documentation/devicetree/bindings/spi/adi,axi-spi-engine.txt

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/spi/adi,axi-spi-engine.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Analog Devices AXI SPI Engine Controller
8+
9+
description: |
10+
The AXI SPI Engine controller is part of the SPI Engine framework[1] and
11+
allows memory mapped access to the SPI Engine control bus. This allows it
12+
to be used as a general purpose software driven SPI controller as well as
13+
some optional advanced acceleration and offloading capabilities.
14+
15+
[1] https://wiki.analog.com/resources/fpga/peripherals/spi_engine
16+
17+
maintainers:
18+
- Michael Hennerich <Michael.Hennerich@analog.com>
19+
- Nuno Sá <nuno.sa@analog.com>
20+
21+
allOf:
22+
- $ref: /schemas/spi/spi-controller.yaml#
23+
24+
properties:
25+
compatible:
26+
const: adi,axi-spi-engine-1.00.a
27+
28+
reg:
29+
maxItems: 1
30+
31+
interrupts:
32+
maxItems: 1
33+
34+
clocks:
35+
items:
36+
- description: The AXI interconnect clock.
37+
- description: The SPI controller clock.
38+
39+
clock-names:
40+
items:
41+
- const: s_axi_aclk
42+
- const: spi_clk
43+
44+
required:
45+
- compatible
46+
- reg
47+
- interrupts
48+
- clocks
49+
- clock-names
50+
51+
unevaluatedProperties: false
52+
53+
examples:
54+
- |
55+
spi@44a00000 {
56+
compatible = "adi,axi-spi-engine-1.00.a";
57+
reg = <0x44a00000 0x1000>;
58+
interrupts = <0 56 4>;
59+
clocks = <&clkc 15>, <&clkc 15>;
60+
clock-names = "s_axi_aclk", "spi_clk";
61+
62+
#address-cells = <1>;
63+
#size-cells = <0>;
64+
65+
/* SPI devices */
66+
};

Documentation/devicetree/bindings/spi/renesas,rspi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ properties:
2121
- enum:
2222
- renesas,rspi-r7s72100 # RZ/A1H
2323
- renesas,rspi-r7s9210 # RZ/A2
24-
- renesas,r9a07g043-rspi # RZ/G2UL
24+
- renesas,r9a07g043-rspi # RZ/G2UL and RZ/Five
2525
- renesas,r9a07g044-rspi # RZ/G2{L,LC}
2626
- renesas,r9a07g054-rspi # RZ/V2L
2727
- const: renesas,rspi-rz

Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ properties:
7272
- const: snps,dw-apb-ssi
7373
- description: Intel Keem Bay SPI Controller
7474
const: intel,keembay-ssi
75-
- description: Intel Thunder Bay SPI Controller
76-
const: intel,thunderbay-ssi
7775
- description: Intel Mount Evans Integrated Management Complex SPI Controller
7876
const: intel,mountevans-imc-ssi
7977
- description: AMD Pensando Elba SoC SPI Controller

Documentation/devicetree/bindings/spi/st,stm32-spi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ properties:
2323
compatible:
2424
enum:
2525
- st,stm32f4-spi
26+
- st,stm32f7-spi
2627
- st,stm32h7-spi
28+
- st,stm32mp25-spi
2729

2830
reg:
2931
maxItems: 1

Documentation/spi/pxa2xx.rst

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ PXA2xx SPI on SSP driver HOWTO
33
==============================
44

55
This a mini HOWTO on the pxa2xx_spi driver. The driver turns a PXA2xx
6-
synchronous serial port into an SPI master controller
6+
synchronous serial port into an SPI host controller
77
(see Documentation/spi/spi-summary.rst). The driver has the following features
88

99
- Support for any PXA2xx and compatible SSP.
1010
- SSP PIO and SSP DMA data transfers.
1111
- External and Internal (SSPFRM) chip selects.
12-
- Per slave device (chip) configuration.
12+
- Per peripheral device (chip) configuration.
1313
- Full suspend, freeze, resume support.
1414

1515
The driver is built around a &struct spi_message FIFO serviced by kernel
1616
thread. The kernel thread, spi_pump_messages(), drives message FIFO and
1717
is responsible for queuing SPI transactions and setting up and launching
1818
the DMA or interrupt driven transfers.
1919

20-
Declaring PXA2xx Master Controllers
21-
-----------------------------------
22-
Typically, for a legacy platform, an SPI master is defined in the
23-
arch/.../mach-*/board-*.c as a "platform device". The master configuration
20+
Declaring PXA2xx host controllers
21+
---------------------------------
22+
Typically, for a legacy platform, an SPI host controller is defined in the
23+
arch/.../mach-*/board-*.c as a "platform device". The host controller configuration
2424
is passed to the driver via a table found in include/linux/spi/pxa2xx_spi.h::
2525

2626
struct pxa2xx_spi_controller {
@@ -30,7 +30,7 @@ is passed to the driver via a table found in include/linux/spi/pxa2xx_spi.h::
3030
};
3131

3232
The "pxa2xx_spi_controller.num_chipselect" field is used to determine the number of
33-
slave device (chips) attached to this SPI master.
33+
peripheral devices (chips) attached to this SPI host controller.
3434

3535
The "pxa2xx_spi_controller.enable_dma" field informs the driver that SSP DMA should
3636
be used. This caused the driver to acquire two DMA channels: Rx channel and
@@ -40,8 +40,8 @@ See the "PXA2xx Developer Manual" section "DMA Controller".
4040
For the new platforms the description of the controller and peripheral devices
4141
comes from Device Tree or ACPI.
4242

43-
NSSP MASTER SAMPLE
44-
------------------
43+
NSSP HOST SAMPLE
44+
----------------
4545
Below is a sample configuration using the PXA255 NSSP for a legacy platform::
4646

4747
static struct resource pxa_spi_nssp_resources[] = {
@@ -57,7 +57,7 @@ Below is a sample configuration using the PXA255 NSSP for a legacy platform::
5757
},
5858
};
5959

60-
static struct pxa2xx_spi_controller pxa_nssp_master_info = {
60+
static struct pxa2xx_spi_controller pxa_nssp_controller_info = {
6161
.num_chipselect = 1, /* Matches the number of chips attached to NSSP */
6262
.enable_dma = 1, /* Enables NSSP DMA */
6363
};
@@ -68,7 +68,7 @@ Below is a sample configuration using the PXA255 NSSP for a legacy platform::
6868
.resource = pxa_spi_nssp_resources,
6969
.num_resources = ARRAY_SIZE(pxa_spi_nssp_resources),
7070
.dev = {
71-
.platform_data = &pxa_nssp_master_info, /* Passed to driver */
71+
.platform_data = &pxa_nssp_controller_info, /* Passed to driver */
7272
},
7373
};
7474

@@ -81,17 +81,17 @@ Below is a sample configuration using the PXA255 NSSP for a legacy platform::
8181
(void)platform_add_device(devices, ARRAY_SIZE(devices));
8282
}
8383

84-
Declaring Slave Devices
85-
-----------------------
86-
Typically, for a legacy platform, each SPI slave (chip) is defined in the
84+
Declaring peripheral devices
85+
----------------------------
86+
Typically, for a legacy platform, each SPI peripheral device (chip) is defined in the
8787
arch/.../mach-*/board-*.c using the "spi_board_info" structure found in
8888
"linux/spi/spi.h". See "Documentation/spi/spi-summary.rst" for additional
8989
information.
9090

91-
Each slave device attached to the PXA must provide slave specific configuration
91+
Each peripheral device (chip) attached to the PXA2xx must provide specific chip configuration
9292
information via the structure "pxa2xx_spi_chip" found in
93-
"include/linux/spi/pxa2xx_spi.h". The pxa2xx_spi master controller driver
94-
will uses the configuration whenever the driver communicates with the slave
93+
"include/linux/spi/pxa2xx_spi.h". The PXA2xx host controller driver will use
94+
the configuration whenever the driver communicates with the peripheral
9595
device. All fields are optional.
9696

9797
::
@@ -123,7 +123,7 @@ dma_burst_size == 0.
123123
The "pxa2xx_spi_chip.timeout" fields is used to efficiently handle
124124
trailing bytes in the SSP receiver FIFO. The correct value for this field is
125125
dependent on the SPI bus speed ("spi_board_info.max_speed_hz") and the specific
126-
slave device. Please note that the PXA2xx SSP 1 does not support trailing byte
126+
peripheral device. Please note that the PXA2xx SSP 1 does not support trailing byte
127127
timeouts and must busy-wait any trailing bytes.
128128

129129
NOTE: the SPI driver cannot control the chip select if SSPFRM is used, so the
@@ -132,8 +132,8 @@ asserted around the complete message. Use SSPFRM as a GPIO (through a descriptor
132132
to accommodate these chips.
133133

134134

135-
NSSP SLAVE SAMPLE
136-
-----------------
135+
NSSP PERIPHERAL SAMPLE
136+
----------------------
137137
For a legacy platform or in some other cases, the pxa2xx_spi_chip structure
138138
is passed to the pxa2xx_spi driver in the "spi_board_info.controller_data"
139139
field. Below is a sample configuration using the PXA255 NSSP.
@@ -161,16 +161,16 @@ field. Below is a sample configuration using the PXA255 NSSP.
161161
.bus_num = 2, /* Framework bus number */
162162
.chip_select = 0, /* Framework chip select */
163163
.platform_data = NULL; /* No spi_driver specific config */
164-
.controller_data = &cs8415a_chip_info, /* Master chip config */
165-
.irq = STREETRACER_APCI_IRQ, /* Slave device interrupt */
164+
.controller_data = &cs8415a_chip_info, /* Host controller config */
165+
.irq = STREETRACER_APCI_IRQ, /* Peripheral device interrupt */
166166
},
167167
{
168168
.modalias = "cs8405a", /* Name of spi_driver for this device */
169169
.max_speed_hz = 3686400, /* Run SSP as fast a possible */
170170
.bus_num = 2, /* Framework bus number */
171171
.chip_select = 1, /* Framework chip select */
172-
.controller_data = &cs8405a_chip_info, /* Master chip config */
173-
.irq = STREETRACER_APCI_IRQ, /* Slave device interrupt */
172+
.controller_data = &cs8405a_chip_info, /* Host controller config */
173+
.irq = STREETRACER_APCI_IRQ, /* Peripheral device interrupt */
174174
},
175175
};
176176

@@ -193,17 +193,14 @@ mode supports both coherent and stream based DMA mappings.
193193
The following logic is used to determine the type of I/O to be used on
194194
a per "spi_transfer" basis::
195195

196-
if !enable_dma then
197-
always use PIO transfers
196+
if spi_message.len > 65536 then
197+
if spi_message.is_dma_mapped or rx_dma_buf != 0 or tx_dma_buf != 0 then
198+
reject premapped transfers
198199

199-
if spi_message.len > 8191 then
200200
print "rate limited" warning
201201
use PIO transfers
202202

203-
if spi_message.is_dma_mapped and rx_dma_buf != 0 and tx_dma_buf != 0 then
204-
use coherent DMA mode
205-
206-
if rx_buf and tx_buf are aligned on 8 byte boundary then
203+
if enable_dma and the size is in the range [DMA burst size..65536] then
207204
use streaming DMA mode
208205

209206
otherwise

MAINTAINERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3408,6 +3408,16 @@ W: https://ez.analog.com/linux-software-drivers
34083408
F: Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml
34093409
F: drivers/hwmon/axi-fan-control.c
34103410

3411+
AXI SPI ENGINE
3412+
M: Michael Hennerich <michael.hennerich@analog.com>
3413+
M: Nuno Sá <nuno.sa@analog.com>
3414+
R: David Lechner <dlechner@baylibre.com>
3415+
L: linux-spi@vger.kernel.org
3416+
S: Supported
3417+
W: https://ez.analog.com/linux-software-drivers
3418+
F: Documentation/devicetree/bindings/spi/adi,axi-spi-engine.yaml
3419+
F: drivers/spi/spi-axi-spi-engine.c
3420+
34113421
AXXIA I2C CONTROLLER
34123422
M: Krzysztof Adamski <krzysztof.adamski@nokia.com>
34133423
L: linux-i2c@vger.kernel.org

drivers/input/rmi4/rmi_spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ static int rmi_spi_probe(struct spi_device *spi)
375375
struct rmi_device_platform_data *spi_pdata = spi->dev.platform_data;
376376
int error;
377377

378-
if (spi->master->flags & SPI_MASTER_HALF_DUPLEX)
378+
if (spi->master->flags & SPI_CONTROLLER_HALF_DUPLEX)
379379
return -EINVAL;
380380

381381
rmi_spi = devm_kzalloc(&spi->dev, sizeof(struct rmi_spi_xport),

drivers/mfd/tps6594-spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static int tps6594_spi_probe(struct spi_device *spi)
9898
spi_set_drvdata(spi, tps);
9999

100100
tps->dev = dev;
101-
tps->reg = spi->chip_select;
101+
tps->reg = spi_get_chipselect(spi, 0);
102102
tps->irq = spi->irq;
103103

104104
tps->regmap = devm_regmap_init(dev, NULL, spi, &tps6594_spi_regmap_config);

drivers/mmc/host/mmc_spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,7 @@ static int mmc_spi_probe(struct spi_device *spi)
13221322
/* We rely on full duplex transfers, mostly to reduce
13231323
* per-transfer overheads (by making fewer transfers).
13241324
*/
1325-
if (spi->master->flags & SPI_MASTER_HALF_DUPLEX)
1325+
if (spi->master->flags & SPI_CONTROLLER_HALF_DUPLEX)
13261326
return -EINVAL;
13271327

13281328
/* MMC and SD specs only seem to care that sampling is on the

0 commit comments

Comments
 (0)