Skip to content

Commit 1325b65

Browse files
committed
Merge tag 'spi-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi updates from Mark Brown: "A quiet release, more bug fixes than anything else. A few things do stand out though: - updates to several drivers to move towards the standard GPIO chip select handling in the core. - DMA support for the SH MSIOF driver. - support for Rockchip SPI controllers (their first mainline submission)" * tag 'spi-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (64 commits) spi: davinci: use spi_device.cs_gpio to store gpio cs per spi device spi: davinci: add support to configure gpio cs through dt spi/pl022: Explicitly truncate large bitmask spi/atmel: Fix pointer to int conversion warnings on 64 bit builds spi: davinci: fix to support more than 2 chip selects spi: topcliff-pch: don't hardcode PCI slot to get DMA device spi: orion: fix incorrect handling of cell-index DT property spi: orion: Fix error return code in orion_spi_probe() spi/rockchip: fix error return code in rockchip_spi_probe() spi/rockchip: remove redundant dev_err call in rockchip_spi_probe() spi/rockchip: remove duplicated include from spi-rockchip.c ARM: dts: fix the chip select gpios definition in the SPI nodes spi: s3c64xx: Update binding documentation spi: s3c64xx: use the generic SPI "cs-gpios" property spi: s3c64xx: Revert "spi: s3c64xx: Added provision for dedicated cs pin" spi: atmel: Use dmaengine_prep_slave_sg() API spi: topcliff-pch: Update error messages for dmaengine_prep_slave_sg() API spi: sh-msiof: Use correct device for DMA mapping with IOMMU spi: sh-msiof: Handle dmaengine_prep_slave_single() failures gracefully spi: rspi: Handle dmaengine_prep_slave_sg() failures gracefully ...
2 parents dc7aafb + fab6a04 commit 1325b65

38 files changed

Lines changed: 1725 additions & 245 deletions

‎Documentation/devicetree/bindings/spi/efm32-spi.txt‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ Required properties:
1010
- cs-gpios: see spi-bus.txt
1111

1212
Recommended properties :
13-
- efm32,location: Value to write to the ROUTE register's LOCATION bitfield to
14-
configure the pinmux for the device, see datasheet for values.
15-
If "efm32,location" property is not provided, keeping what is
16-
already configured in the hardware, so its either the reset
17-
default 0 or whatever the bootloader did.
13+
- energymicro,location: Value to write to the ROUTE register's LOCATION
14+
bitfield to configure the pinmux for the device, see
15+
datasheet for values.
16+
If this property is not provided, keeping what is
17+
already configured in the hardware, so its either the
18+
reset default 0 or whatever the bootloader did.
1819

1920
Example:
2021

@@ -26,7 +27,7 @@ spi1: spi@0x4000c400 { /* USART1 */
2627
interrupts = <15 16>;
2728
clocks = <&cmu 20>;
2829
cs-gpios = <&gpio 51 1>; // D3
29-
efm32,location = <1>;
30+
energymicro,location = <1>;
3031
status = "ok";
3132

3233
ks8851@0 {

‎Documentation/devicetree/bindings/spi/qcom,spi-qup.txt‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ SPI in master mode supports up to 50MHz, up to four chip selects, programmable
77
data path from 4 bits to 32 bits and numerous protocol variants.
88

99
Required properties:
10-
- compatible: Should contain "qcom,spi-qup-v2.1.1" or "qcom,spi-qup-v2.2.1"
10+
- compatible: Should contain:
11+
"qcom,spi-qup-v1.1.1" for 8660, 8960 and 8064.
12+
"qcom,spi-qup-v2.1.1" for 8974 and later
13+
"qcom,spi-qup-v2.2.1" for 8974 v2 and later.
14+
1115
- reg: Should contain base register location and length
1216
- interrupts: Interrupt number used by this controller
1317

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Synopsys DesignWare AMBA 2.0 Synchronous Serial Interface.
2+
3+
Required properties:
4+
- compatible : "snps,dw-apb-ssi"
5+
- reg : The register base for the controller.
6+
- interrupts : One interrupt, used by the controller.
7+
- #address-cells : <1>, as required by generic SPI binding.
8+
- #size-cells : <0>, also as required by generic SPI binding.
9+
10+
Optional properties:
11+
- cs-gpios : Specifies the gpio pis to be used for chipselects.
12+
- num-cs : The number of chipselects. If omitted, this will default to 4.
13+
14+
Child nodes as per the generic SPI binding.
15+
16+
Example:
17+
18+
spi@fff00000 {
19+
compatible = "snps,dw-apb-ssi";
20+
reg = <0xfff00000 0x1000>;
21+
interrupts = <0 154 4>;
22+
#address-cells = <1>;
23+
#size-cells = <0>;
24+
num-cs = <2>;
25+
cs-gpios = <&gpio0 13 0>,
26+
<&gpio0 14 0>;
27+
};
28+

‎Documentation/devicetree/bindings/spi/spi-davinci.txt‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Required properties:
88
- "ti,dm6441-spi" for SPI used similar to that on DM644x SoC family
99
- "ti,da830-spi" for SPI used similar to that on DA8xx SoC family
1010
- reg: Offset and length of SPI controller register space
11-
- num-cs: Number of chip selects
11+
- num-cs: Number of chip selects. This includes internal as well as
12+
GPIO chip selects.
1213
- ti,davinci-spi-intr-line: interrupt line used to connect the SPI
1314
IP to the interrupt controller within the SoC. Possible values
1415
are 0 and 1. Manual says one of the two possible interrupt
@@ -17,6 +18,12 @@ Required properties:
1718
- interrupts: interrupt number mapped to CPU.
1819
- clocks: spi clk phandle
1920

21+
Optional:
22+
- cs-gpios: gpio chip selects
23+
For example to have 3 internal CS and 2 GPIO CS, user could define
24+
cs-gpios = <0>, <0>, <0>, <&gpio1 30 0>, <&gpio1 31 0>;
25+
where first three are internal CS and last two are GPIO CS.
26+
2027
Example of a NOR flash slave device (n25q032) connected to DaVinci
2128
SPI controller device over the SPI bus.
2229

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
* Rockchip SPI Controller
2+
3+
The Rockchip SPI controller is used to interface with various devices such as flash
4+
and display controllers using the SPI communication interface.
5+
6+
Required Properties:
7+
8+
- compatible: should be one of the following.
9+
"rockchip,rk3066-spi" for rk3066.
10+
"rockchip,rk3188-spi", "rockchip,rk3066-spi" for rk3188.
11+
"rockchip,rk3288-spi", "rockchip,rk3066-spi" for rk3288.
12+
- reg: physical base address of the controller and length of memory mapped
13+
region.
14+
- interrupts: The interrupt number to the cpu. The interrupt specifier format
15+
depends on the interrupt controller.
16+
- clocks: Must contain an entry for each entry in clock-names.
17+
- clock-names: Shall be "spiclk" for the transfer-clock, and "apb_pclk" for
18+
the peripheral clock.
19+
- dmas: DMA specifiers for tx and rx dma. See the DMA client binding,
20+
Documentation/devicetree/bindings/dma/dma.txt
21+
- dma-names: DMA request names should include "tx" and "rx" if present.
22+
- #address-cells: should be 1.
23+
- #size-cells: should be 0.
24+
25+
Example:
26+
27+
spi0: spi@ff110000 {
28+
compatible = "rockchip,rk3066-spi";
29+
reg = <0xff110000 0x1000>;
30+
dmas = <&pdma1 11>, <&pdma1 12>;
31+
dma-names = "tx", "rx";
32+
#address-cells = <1>;
33+
#size-cells = <0>;
34+
interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
35+
clocks = <&cru SCLK_SPI0>, <&cru PCLK_SPI0>;
36+
clock-names = "spiclk", "apb_pclk";
37+
};

‎Documentation/devicetree/bindings/spi/spi-samsung.txt‎

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@ Required SoC Specific Properties:
1818
- interrupts: The interrupt number to the cpu. The interrupt specifier format
1919
depends on the interrupt controller.
2020

21-
[PRELIMINARY: the dma channel allocation will change once there are
22-
official DMA bindings]
21+
- dmas : Two or more DMA channel specifiers following the convention outlined
22+
in bindings/dma/dma.txt
2323

24-
- tx-dma-channel: The dma channel specifier for tx operations. The format of
25-
the dma specifier depends on the dma controller.
26-
27-
- rx-dma-channel: The dma channel specifier for rx operations. The format of
28-
the dma specifier depends on the dma controller.
24+
- dma-names: Names for the dma channels. There must be at least one channel
25+
named "tx" for transmit and named "rx" for receive.
2926

3027
Required Board Specific Properties:
3128

@@ -42,15 +39,13 @@ Optional Board Specific Properties:
4239
- num-cs: Specifies the number of chip select lines supported. If
4340
not specified, the default number of chip select lines is set to 1.
4441

42+
- cs-gpios: should specify GPIOs used for chipselects (see spi-bus.txt)
43+
4544
SPI Controller specific data in SPI slave nodes:
4645

4746
- The spi slave nodes should provide the following information which is required
4847
by the spi controller.
4948

50-
- cs-gpio: A gpio specifier that specifies the gpio line used as
51-
the slave select line by the spi controller. The format of the gpio
52-
specifier depends on the gpio controller.
53-
5449
- samsung,spi-feedback-delay: The sampling phase shift to be applied on the
5550
miso line (to account for any lag in the miso line). The following are the
5651
valid values.
@@ -74,8 +69,11 @@ Example:
7469
compatible = "samsung,exynos4210-spi";
7570
reg = <0x12d20000 0x100>;
7671
interrupts = <0 66 0>;
77-
tx-dma-channel = <&pdma0 5>;
78-
rx-dma-channel = <&pdma0 4>;
72+
dmas = <&pdma0 5
73+
&pdma0 4>;
74+
dma-names = "tx", "rx";
75+
#address-cells = <1>;
76+
#size-cells = <0>;
7977
};
8078

8179
- Board Specific Portion:
@@ -85,6 +83,7 @@ Example:
8583
#size-cells = <0>;
8684
pinctrl-names = "default";
8785
pinctrl-0 = <&spi0_bus>;
86+
cs-gpios = <&gpa2 5 0>;
8887

8988
w25q80bw@0 {
9089
#address-cells = <1>;
@@ -94,7 +93,6 @@ Example:
9493
spi-max-frequency = <10000>;
9594

9695
controller-data {
97-
cs-gpio = <&gpa2 5 1 0 3>;
9896
samsung,spi-feedback-delay = <0>;
9997
};
10098

‎arch/arm/boot/dts/exynos4210-smdkv310.dts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168
};
169169

170170
spi_2: spi@13940000 {
171+
cs-gpios = <&gpc1 2 0>;
171172
status = "okay";
172173

173174
w25x80@0 {
@@ -178,7 +179,6 @@
178179
spi-max-frequency = <1000000>;
179180

180181
controller-data {
181-
cs-gpio = <&gpc1 2 0>;
182182
samsung,spi-feedback-delay = <0>;
183183
};
184184

‎arch/arm/boot/dts/exynos4412-trats2.dts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,14 +589,14 @@
589589
spi_1: spi@13930000 {
590590
pinctrl-names = "default";
591591
pinctrl-0 = <&spi1_bus>;
592+
cs-gpios = <&gpb 5 0>;
592593
status = "okay";
593594

594595
s5c73m3_spi: s5c73m3 {
595596
compatible = "samsung,s5c73m3";
596597
spi-max-frequency = <50000000>;
597598
reg = <0>;
598599
controller-data {
599-
cs-gpio = <&gpb 5 0>;
600600
samsung,spi-feedback-delay = <2>;
601601
};
602602
};

‎arch/arm/boot/dts/exynos5250-smdk5250.dts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@
316316
};
317317

318318
spi_1: spi@12d30000 {
319+
cs-gpios = <&gpa2 5 0>;
319320
status = "okay";
320321

321322
w25q80bw@0 {
@@ -326,7 +327,6 @@
326327
spi-max-frequency = <1000000>;
327328

328329
controller-data {
329-
cs-gpio = <&gpa2 5 0>;
330330
samsung,spi-feedback-delay = <0>;
331331
};
332332

‎drivers/spi/Kconfig‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,21 @@ config SPI_PXA2XX
382382
config SPI_PXA2XX_PCI
383383
def_tristate SPI_PXA2XX && PCI
384384

385+
config SPI_ROCKCHIP
386+
tristate "Rockchip SPI controller driver"
387+
depends on ARM || ARM64 || AVR32 || HEXAGON || MIPS || SUPERH
388+
help
389+
This selects a driver for Rockchip SPI controller.
390+
391+
If you say yes to this option, support will be included for
392+
RK3066, RK3188 and RK3288 families of SPI controller.
393+
Rockchip SPI controller support DMA transport and PIO mode.
394+
The main usecase of this controller is to use spi flash as boot
395+
device.
396+
385397
config SPI_RSPI
386398
tristate "Renesas RSPI/QSPI controller"
387-
depends on (SUPERH && SH_DMAE_BASE) || ARCH_SHMOBILE
399+
depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST
388400
help
389401
SPI driver for Renesas RSPI and QSPI blocks.
390402

@@ -434,7 +446,7 @@ config SPI_SC18IS602
434446

435447
config SPI_SH_MSIOF
436448
tristate "SuperH MSIOF SPI controller"
437-
depends on HAVE_CLK
449+
depends on HAVE_CLK && HAS_DMA
438450
depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST
439451
help
440452
SPI driver for SuperH and SH Mobile MSIOF blocks.

0 commit comments

Comments
 (0)