Add Mediatek SPI slave driver
Subsystems (3)
v2 cover Add Mediatek SPI slave driver
Quoted 1 line
From
c211d55c612b1fb43e3a5f137e8cacbd347beee5Mon Sep 17 00:00:00 2001
From: Leilk Liu <[email protected]>
Date: Tue, 4 Sep 2018 09:38:00 +0800
Subject: [PATCH v2 0/3] Add Mediatek SPI slave driver
v2:
1. Fix Sean Wang review comment.
2. remove unused register and offset define.
3. update bindings file with assigned-clocks and assigned-clocks-parents.
v1:
This series are based on 4.19-rc1 and provide three patches to add mediatek spi slave driver.
Leilk Liu (3):
spis: mediatek: add bindings for Mediatek MT2712 soc platform
spis: mediatek: add spi slave for Mediatek MT2712
arm64: dts: Add spi slave dts
.../devicetree/bindings/spi/spi-slave-mt27xx.txt | 35 ++ arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 12 + drivers/spi/Kconfig | 8 + drivers/spi/Makefile | 1 + drivers/spi/spi-slave-mt27xx.c | 557 +++++++++++++++++++++ 5 files changed, 613 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt create mode 100644 drivers/spi/spi-slave-mt27xx.c
Signature · 1 line
1.9.1
PATCH v2 1/3 spis: mediatek: add bindings for Mediatek MT2712 soc platform
This patch adds a DT binding documentation for the MT2712 soc.
--- .../devicetree/bindings/spi/spi-slave-mt27xx.txt | 35 ++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt new file +35 -0
@@ -0,0 +1,35 @@ +Binding for MTK SPI Slave controller + +Required properties: +- compatible: should be one of the following. + - mediatek,mt2712-spi-slave: for mt2712 platforms +- reg: Address and length of the register set for the device. +- interrupts: Should contain spi interrupt. +- clocks: phandles to input clocks. + It's clock gate, and should be <&infracfg CLK_INFRA_AO_SPI1>. +- clock-names: should be "spi-clk" for the clock gate. +- spi-slave: Empty property indicating the SPI controller is used in slave mode. + +Optional properties: +- assigned-clocks: it's mux clock, should be <&topckgen CLK_TOP_SPISLV_SEL>. +- assigned-clock-parents: parent of mux clock. + It's PLL, and should be on of the following. + - <&topckgen CLK_TOP_UNIVPLL1_D2>: specify parent clock 312MHZ. + It's the default one. + - <&topckgen CLK_TOP_UNIVPLL1_D4>: specify parent clock 156MHZ. + - <&topckgen CLK_TOP_UNIVPLL2_D4>: specify parent clock 104MHZ. + - <&topckgen CLK_TOP_UNIVPLL1_D8>: specify parent clock 78MHZ. + +Example: +- SoC Specific Portion: +spis1: spi at 10013000 { + compatible = "mediatek,mt2712-spi-slave"; + reg = <0 0x10013000 0 0x100>; + interrupts = <GIC_SPI 283 IRQ_TYPE_LEVEL_LOW>; + clocks = <&infracfg CLK_INFRA_AO_SPI1>; + clock-names = "spi-clk"; + assigned-clocks = <&topckgen CLK_TOP_SPISLV_SEL>; + assigned-clock-parents = <&topckgen CLK_TOP_UNIVPLL1_D2>; + spi-slave; + status = "disabled"; +};
Signature · 1 line
1.7.9.5
PATCH v2 2/3 spis: mediatek: add spi slave for Mediatek MT2712
In reply to Leilk LiuThis patchs add basic spi slave for MT2712.
--- drivers/spi/Kconfig | 8 + drivers/spi/Makefile | 1 + drivers/spi/spi-slave-mt27xx.c | 557 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 566 insertions(+) create mode 100644 drivers/spi/spi-slave-mt27xx.c
drivers/spi/Kconfig +8 -0
@@ -802,6 +802,14 @@ config SPI_SLAVE slave protocol handlers. if SPI_SLAVE +config SPI_SLAVE_MT27XX + tristate "MediaTek SPI slave device" + depends on ARCH_MEDIATEK || COMPILE_TEST + help + This selects the MediaTek(R) SPI slave device driver. + If you want to use MediaTek(R) SPI slave interface, + say Y or M here.If you are not sure, say N. + SPI slave drivers for Mediatek MT27XX series ARM SoCs. config SPI_SLAVE_TIME tristate "SPI slave handler reporting boot up time"
drivers/spi/Makefile +1 -0
@@ -109,5 +109,6 @@ obj-$(CONFIG_SPI_XTENSA_XTFPGA) += spi-xtensa-xtfpga.o obj-$(CONFIG_SPI_ZYNQMP_GQSPI) += spi-zynqmp-gqspi.o # SPI slave protocol handlers +obj-$(CONFIG_SPI_SLAVE_MT27XX) += spi-slave-mt27xx.o obj-$(CONFIG_SPI_SLAVE_TIME) += spi-slave-time.o obj-$(CONFIG_SPI_SLAVE_SYSTEM_CONTROL) += spi-slave-system-control.o
drivers/spi/spi-slave-mt27xx.c new file +557 -0
557 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v2 3/3 arm64: dts: Add spi slave dts
In reply to Leilk LiuThis patch adds MT2712 spi slave into device tree.
--- arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/mediatek/mt2712e.dtsi +12 -0
@@ -301,6 +301,18 @@ status = "disabled"; }; + spis1: spi at 10013000 { + compatible = "mediatek,mt2712-spi-slave"; + reg = <0 0x10013000 0 0x100>; + interrupts = <GIC_SPI 283 IRQ_TYPE_LEVEL_LOW>; + clocks = <&infracfg CLK_INFRA_AO_SPI1>; + clock-names = "spi-clk"; + assigned-clocks = <&topckgen CLK_TOP_SPISLV_SEL>; + assigned-clock-parents = <&topckgen CLK_TOP_UNIVPLL1_D2>; + spi-slave; + status = "disabled"; + }; + apmixedsys: syscon at 10209000 { compatible = "mediatek,mt2712-apmixedsys", "syscon"; reg = <0 0x10209000 0 0x1000>;
Signature · 1 line
1.7.9.5