2021-01-06 06:03:46

by ChiaWei Wang

[permalink] [raw]
Subject: [PATCH 0/6] arm: aspeed: Add eSPI support

This patch series add the driver support for the eSPI controller
of Aspeed 6th generation SoCs. This controller is a slave device
communicating with a master over Enhanced Serial Peripheral Interface (eSPI).
It supports all of the 4 eSPI channels, namely peripheral, virtual wire,
out-of-band, and flash, and operates at max frequency of 66MHz.

Chia-Wei, Wang (6):
dt-bindings: aspeed: Add eSPI controller
MAINTAINER: Add ASPEED eSPI driver entry
clk: ast2600: Add eSPI reset bit
irqchip/aspeed: Add Aspeed eSPI interrupt controller
soc: aspeed: Add eSPI driver
ARM: dts: aspeed: Add AST2600 eSPI nodes

.../devicetree/bindings/soc/aspeed/espi.yaml | 252 +++++++
MAINTAINERS | 14 +
arch/arm/boot/dts/aspeed-g6.dtsi | 57 ++
drivers/irqchip/Makefile | 2 +-
drivers/irqchip/irq-aspeed-espi-ic.c | 251 +++++++
drivers/soc/aspeed/Kconfig | 49 ++
drivers/soc/aspeed/Makefile | 5 +
drivers/soc/aspeed/aspeed-espi-ctrl.c | 197 +++++
drivers/soc/aspeed/aspeed-espi-flash.c | 490 ++++++++++++
drivers/soc/aspeed/aspeed-espi-oob.c | 706 ++++++++++++++++++
drivers/soc/aspeed/aspeed-espi-peripheral.c | 613 +++++++++++++++
drivers/soc/aspeed/aspeed-espi-vw.c | 211 ++++++
include/dt-bindings/clock/ast2600-clock.h | 1 +
.../interrupt-controller/aspeed-espi-ic.h | 15 +
include/soc/aspeed/espi.h | 279 +++++++
include/uapi/linux/aspeed-espi.h | 160 ++++
16 files changed, 3301 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/soc/aspeed/espi.yaml
create mode 100644 drivers/irqchip/irq-aspeed-espi-ic.c
create mode 100644 drivers/soc/aspeed/aspeed-espi-ctrl.c
create mode 100644 drivers/soc/aspeed/aspeed-espi-flash.c
create mode 100644 drivers/soc/aspeed/aspeed-espi-oob.c
create mode 100644 drivers/soc/aspeed/aspeed-espi-peripheral.c
create mode 100644 drivers/soc/aspeed/aspeed-espi-vw.c
create mode 100644 include/dt-bindings/interrupt-controller/aspeed-espi-ic.h
create mode 100644 include/soc/aspeed/espi.h
create mode 100644 include/uapi/linux/aspeed-espi.h

--
2.17.1


2021-01-06 06:04:10

by ChiaWei Wang

[permalink] [raw]
Subject: [PATCH 2/6] MAINTAINER: Add ASPEED eSPI driver entry

Add myself and Ryan Chen as maintainer of the Aspeed eSPI
driver and the associated eSPI interrupt controller.
Joel Stanley is also added as the reviewer.

Signed-off-by: Chia-Wei, Wang <[email protected]>
---
MAINTAINERS | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7c1e45c416b1..d5f9205a5439 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1639,6 +1639,20 @@ F: drivers/crypto/axis
F: drivers/mmc/host/usdhi6rol0.c
F: drivers/pinctrl/pinctrl-artpec*

+ARM/ASPEED ESPI DRIVER
+M: Chia-Wei Wang <[email protected]>
+M: Ryan Chen <[email protected]>
+R: Joel Stanley <[email protected]>
+L: [email protected] (moderated for non-subscribers)
+L: [email protected] (moderated for non-subscribers)
+S: Maintained
+F: Documentation/devicetree/bindings/soc/aspeed/espi.yaml
+F: drivers/irqchip/irq-aspeed-espi-ic.c
+F: drivers/soc/aspeed/aspeed-espi*
+F: include/dt-bindings/interrupt-controller/aspeed-espi-ic.h
+F: include/soc/aspeed/espi.h
+F: include/uapi/linux/aspeed-espi.h
+
ARM/ASPEED I2C DRIVER
M: Brendan Higgins <[email protected]>
R: Benjamin Herrenschmidt <[email protected]>
--
2.17.1

2021-01-06 06:05:24

by ChiaWei Wang

[permalink] [raw]
Subject: [PATCH 3/6] clk: ast2600: Add eSPI reset bit

Add bit field definition for the eSPI reset control.

Signed-off-by: Chia-Wei, Wang <[email protected]>
---
include/dt-bindings/clock/ast2600-clock.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/dt-bindings/clock/ast2600-clock.h b/include/dt-bindings/clock/ast2600-clock.h
index 62b9520a00fd..964934b1caef 100644
--- a/include/dt-bindings/clock/ast2600-clock.h
+++ b/include/dt-bindings/clock/ast2600-clock.h
@@ -89,6 +89,7 @@
#define ASPEED_CLK_MAC4RCLK 70

/* Only list resets here that are not part of a gate */
+#define ASPEED_RESET_ESPI 57
#define ASPEED_RESET_ADC 55
#define ASPEED_RESET_JTAG_MASTER2 54
#define ASPEED_RESET_I3C_DMA 39
--
2.17.1

2021-01-06 06:06:55

by ChiaWei Wang

[permalink] [raw]
Subject: [PATCH 6/6] ARM: dts: aspeed: Add AST2600 eSPI nodes

Add eSPI nodes for the device tree of Aspeed 6th generation SoCs.

Signed-off-by: Chia-Wei, Wang <[email protected]>
---
arch/arm/boot/dts/aspeed-g6.dtsi | 57 ++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed-g6.dtsi
index 810b0676ab03..d457baf11e37 100644
--- a/arch/arm/boot/dts/aspeed-g6.dtsi
+++ b/arch/arm/boot/dts/aspeed-g6.dtsi
@@ -3,7 +3,9 @@

#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/aspeed-scu-ic.h>
+#include <dt-bindings/interrupt-controller/aspeed-espi-ic.h>
#include <dt-bindings/clock/ast2600-clock.h>
+#include <dt-bindings/gpio/aspeed-gpio.h>

/ {
model = "Aspeed BMC";
@@ -75,6 +77,61 @@
interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
};

+ espi: espi@1e6ee000 {
+ compatible = "aspeed,ast2600-espi", "simple-mfd", "syscon";
+ reg = <0x1e6ee000 0x1000>;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <0x0 0x1e6ee000 0x1000>;
+
+ espi_ic: espi-ic {
+ #interrupt-cells = <1>;
+ compatible = "aspeed,ast2600-espi-ic";
+ interrupts-extended = <&gic GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>,
+ <&gpio0 ASPEED_GPIO(W, 7) IRQ_TYPE_EDGE_FALLING>;
+ interrupt-controller;
+ status = "disabled";
+ };
+
+ espi_ctrl: espi-ctrl {
+ compatible = "aspeed,ast2600-espi-ctrl";
+ interrupts-extended = <&espi_ic ASPEED_ESPI_IC_CTRL_EVENT>,
+ <&espi_ic ASPEED_ESPI_IC_CTRL_RESET>;
+ clocks = <&syscon ASPEED_CLK_GATE_ESPICLK>;
+ resets = <&syscon ASPEED_RESET_ESPI>;
+ status = "disabled";
+ };
+
+ espi_peripheral: espi-peripheral-channel {
+ compatible = "aspeed,ast2600-espi-peripheral";
+ interrupts-extended = <&espi_ic ASPEED_ESPI_IC_PERIF_EVENT>,
+ <&espi_ic ASPEED_ESPI_IC_CHAN_RESET>;
+ status = "disabled";
+ };
+
+ espi_vw: espi-vw-channel {
+ compatible = "aspeed,ast2600-espi-vw";
+ interrupts-extended = <&espi_ic ASPEED_ESPI_IC_VW_EVENT>,
+ <&espi_ic ASPEED_ESPI_IC_CHAN_RESET>;
+ status = "disabled";
+ };
+
+ espi_oob: espi-oob-channel {
+ compatible = "aspeed,ast2600-espi-oob";
+ interrupts-extended = <&espi_ic ASPEED_ESPI_IC_OOB_EVENT>,
+ <&espi_ic ASPEED_ESPI_IC_CHAN_RESET>;
+ status = "disabled";
+ };
+
+ espi_flash: espi-flash-channel {
+ compatible = "aspeed,ast2600-espi-flash";
+ interrupts-extended = <&espi_ic ASPEED_ESPI_IC_FLASH_EVENT>,
+ <&espi_ic ASPEED_ESPI_IC_CHAN_RESET>;
+ status = "disabled";
+ };
+ };
+
ahb {
compatible = "simple-bus";
#address-cells = <1>;
--
2.17.1