spi: add driver for ar934x spi controller
Subsystems (2)
v2 cover spi: add driver for ar934x spi controller
This controller is a superset of the already supported qca,ar7100-spi. Besides the bit-bang mode in spi-ath79.c, this new controller added a new "shift register" mode, allowing faster spi operations. This mode doesn't need all the bit-bang code in spi-ath79.c and needs a different clock setup, so I decided to write a new driver for it instead of extending current spi-ath79 driver.
Changes since v1:
1. change comment at the beginning to C++ style
2. rename ar934x_spi_transfer_one to ar934x_spi_transfer_one_message
Chuanhong Guo (2):
spi: add driver for ar934x spi controller
dt-binding: spi: add bindings for spi-ar934x
.../bindings/spi/qca,ar934x-spi.yaml | 40 +++ drivers/spi/Kconfig | 7 + drivers/spi/Makefile | 1 + drivers/spi/spi-ar934x.c | 229 ++++++++++++++++++ 4 files changed, 277 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/qca,ar934x-spi.yaml create mode 100644 drivers/spi/spi-ar934x.c
Signature · 1 line
2.24.1
PATCH v2 1/2 spi: add driver for ar934x spi controller
This patch adds driver for SPI controller found in Qualcomm Atheros AR934x/QCA95xx SoCs.
This controller is a superset of the already supported qca,ar7100-spi. Besides the bit-bang mode in spi-ath79.c, this new controller added a new "shift register" mode, allowing faster spi operations.
---
Changes since v1:
1. change comment at the beginning to C++ style
2. rename ar934x_spi_transfer_one to ar934x_spi_transfer_one_message
drivers/spi/Kconfig | 7 ++ drivers/spi/Makefile | 1 + drivers/spi/spi-ar934x.c | 229 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 237 insertions(+) create mode 100644 drivers/spi/spi-ar934x.c
drivers/spi/Kconfig +7 -0
@@ -62,6 +62,13 @@ config SPI_ALTERA help This is the driver for the Altera SPI Controller. +config SPI_AR934X + tristate "Qualcomm Atheros AR934X/QCA95XX SPI controller driver" + depends on ATH79 || COMPILE_TEST + help + This enables support for the SPI controller present on the + Qualcomm Atheros AR934X/QCA95XX SoCs. + config SPI_ATH79 tristate "Atheros AR71XX/AR724X/AR913X SPI controller driver" depends on ATH79 || COMPILE_TEST
drivers/spi/Makefile +1 -0
@@ -14,6 +14,7 @@ obj-$(CONFIG_SPI_LOOPBACK_TEST) += spi-loopback-test.o # SPI master controller drivers (bus) obj-$(CONFIG_SPI_ALTERA) += spi-altera.o +obj-$(CONFIG_SPI_AR934X) += spi-ar934x.o obj-$(CONFIG_SPI_ARMADA_3700) += spi-armada-3700.o obj-$(CONFIG_SPI_ATMEL) += spi-atmel.o obj-$(CONFIG_SPI_ATMEL_QUADSPI) += atmel-quadspi.o
drivers/spi/spi-ar934x.c new file +229 -0
229 lines not on this page · raw message
Signature · 1 line
2.24.1
PATCH v2 2/2 dt-binding: spi: add bindings for spi-ar934x
In reply to Chuanhong GuoAdd binding documentation for SPI controller in Qualcomm Atheros AR934x/QCA95xx SoCs.
---
Changes since v1: none
.../bindings/spi/qca,ar934x-spi.yaml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/qca,ar934x-spi.yaml
Documentation/devicetree/bindings/spi/qca,ar934x-spi.yaml new file +40 -0
@@ -0,0 +1,40 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/qca,ar934x-spi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Atheros AR934x/QCA95xx SoC SPI controller + +maintainers: + - Chuanhong Guo <[email protected]> + +allOf: + - $ref: spi-controller.yaml# + +properties: + compatible: + const: qca,ar934x-spi + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + +required: + - compatible + - reg + - clocks + - '#address-cells' + - '#size-cells' + +examples: + - | + spi: spi@1f000000 { + compatible = "qca,ar934x-spi"; + reg = <0x1f000000 0x1c>; + clocks = <&pll ATH79_CLK_AHB>; + #address-cells = <1>; + #size-cells = <0>; + };
Signature · 1 line
2.24.1
Rob Herring
maintainerRe: [PATCH v2 2/2] dt-binding: spi: add bindings for spi-ar934x
Quoted 10 lines · Chuanhong Guo
Add binding documentation for SPI controller in Qualcomm Atheros AR934x/QCA95xx SoCs.
Signed-off-by Chuanhong Guo <[email protected]>---
Changes since v1: none.../bindings/spi/qca,ar934x-spi.yaml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/qca,ar934x-spi.yaml
My bot found errors running 'make dt_binding_check' on your patch:
Documentation/devicetree/bindings/display/simple-framebuffer.example.dts:21.16-37.11: Warning (chosen_node_is_root): /example-0/chosen: chosen node must be at root node
Error: Documentation/devicetree/bindings/spi/qca,ar934x-spi.example.dts:20.28-29 syntax error
FATAL ERROR: Unable to parse input treescripts/Makefile.lib:300: recipe for target 'Documentation/devicetree/bindings/spi/qca,ar934x-spi.example.dt.yaml' failed
make[1]: *** [Documentation/devicetree/bindings/spi/qca,ar934x-spi.example.dt.yaml] Error 1
Makefile:1263: recipe for target 'dt_binding_check' failed
make: *** [dt_binding_check] Error 2
See https://patchwork.ozlabs.org/patch/1234394
Please check and re-submit.
Re: [PATCH v2 2/2] dt-binding: spi: add bindings for spi-ar934x
Quoted 23 lines · Rob Herring
Quoted 10 lines · Chuanhong Guo
Add binding documentation for SPI controller in Qualcomm Atheros AR934x/QCA95xx SoCs.
Signed-off-by Chuanhong Guo <[email protected]>---
Changes since v1: none.../bindings/spi/qca,ar934x-spi.yaml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/qca,ar934x-spi.yamlMy bot found errors running 'make
dt_binding_check' on your patch:Documentation/devicetree/bindings/display/simple-framebuffer.example.dts:21.16-37.11: Warning (
chosen_node_is_root): /example-0/chosen: chosen node must be at root node
Error: Documentation/devicetree/bindings/spi/qca,ar934x-spi.example.dts:20.28-29 syntax error
FATAL ERROR: Unable to parse input treescripts/Makefile.lib:300: recipe for target 'Documentation/devicetree/bindings/spi/qca,ar934x-spi.example.dt.yaml' failed
make[1]: *** [Documentation/devicetree/bindings/spi/qca,ar934x-spi.example.dt.yaml] Error 1
Makefile:1263: recipe for target 'dt_binding_check' failed
make: *** [dt_binding_check] Error 2
Quoted 2 lines
See https://patchwork.ozlabs.org/patch/1234394
Please check and re-submit.
It's caused by "clocks = <&pll ATH79_CLK_AHB>" where ATH79_CLK_AHB isn't defined without a include of dt-bindings/clock/ath79-clk.h I'll replace this with a bogus "clocks = <&spi_clock>" instead in v3.
Regards,
Chuanhong Guo
Re: [PATCH v2 2/2] dt-binding: spi: add bindings for spi-ar934x
Quoted 24 lines · Chuanhong Guo
Quoted 23 lines · Rob Herring
Quoted 10 lines · Chuanhong Guo
Add binding documentation for SPI controller in Qualcomm Atheros AR934x/QCA95xx SoCs.
Signed-off-by Chuanhong Guo <[email protected]>---
Changes since v1: none.../bindings/spi/qca,ar934x-spi.yaml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/qca,ar934x-spi.yamlMy bot found errors running 'make
dt_binding_check' on your patch:Documentation/devicetree/bindings/display/simple-framebuffer.example.dts:21.16-37.11: Warning (
chosen_node_is_root): /example-0/chosen: chosen node must be at root node
Error: Documentation/devicetree/bindings/spi/qca,ar934x-spi.example.dts:20.28-29 syntax error
FATAL ERROR: Unable to parse input treescripts/Makefile.lib:300: recipe for target 'Documentation/devicetree/bindings/spi/qca,ar934x-spi.example.dt.yaml' failed
make[1]: *** [Documentation/devicetree/bindings/spi/qca,ar934x-spi.example.dt.yaml] Error 1
Makefile:1263: recipe for target 'dt_binding_check' failed
make: *** [dt_binding_check] Error 2
Quoted 6 lines
Quoted 2 lines
See https://patchwork.ozlabs.org/patch/1234394
Please check and re-submit.It's caused by "clocks = <&pll
ATH79_CLK_AHB>" whereATH79_CLK_AHBisn't defined without a include ofdt-bindings/clock/ath79-clk.hI'll replace this with a bogus "clocks = <&spi_clock>" instead in v3.
You can include ath79-clk.h in your example, see for instance Documentation/devicetree/bindings/pci/intel-gw-pcie.yaml
Signature · 1 line
Florian
Re: [PATCH v2 2/2] dt-binding: spi: add bindings for spi-ar934x
Quoted 7 lines · Florian Fainelli
Quoted 3 lines · Chuanhong Guo
It's caused by "clocks = <&pll
ATH79_CLK_AHB>" whereATH79_CLK_AHBisn't defined without a include ofdt-bindings/clock/ath79-clk.hI'll replace this with a bogus "clocks = <&spi_clock>" instead in v3.You can include
ath79-clk.hin your example, see for instanceDocumentation/devicetree/bindings/pci/intel-gw-pcie.yaml
Oh. But I've already sent v3 out yesterday :(
I think this is just cosmetic changes and doesn't make much difference so I'd like to keep v3 as-is now and if there are other comments for me to send a v4 I'll change this one as well.
Regards,
Chuanhong Guo