arm: aspeed: Add eSPI support
Subsystems (2)
v3 cover arm: aspeed: Add eSPI support
This patch series add the driver support for the eSPI controller of Aspeed 5/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.
v3:
- remove the redundant patch "clk: aspeed: Add eSPI reset bit"
- fix missing header inclusion reported by test bot
- fix dt-bindings error reported by yamllint
v2:
- remove irqchip implementation
- merge per-channel drivers into single one to avoid the racing issue among eSPI handshake process and driver probing.
Chia-Wei Wang (4):
dt-bindings: aspeed: Add eSPI controller
MAINTAINER: Add ASPEED eSPI driver entry
soc: aspeed: Add eSPI driver
ARM: dts: aspeed: Add eSPI node
.../devicetree/bindings/soc/aspeed/espi.yaml | 157 +++++ MAINTAINERS | 9 + arch/arm/boot/dts/aspeed-g6.dtsi | 17 + drivers/soc/aspeed/Kconfig | 11 + drivers/soc/aspeed/Makefile | 1 + drivers/soc/aspeed/aspeed-espi-ctrl.c | 205 ++++++ drivers/soc/aspeed/aspeed-espi-ctrl.h | 304 +++++++++ drivers/soc/aspeed/aspeed-espi-flash.h | 380 +++++++++++ drivers/soc/aspeed/aspeed-espi-ioc.h | 153 +++++ drivers/soc/aspeed/aspeed-espi-oob.h | 611 ++++++++++++++++++ drivers/soc/aspeed/aspeed-espi-perif.h | 539 +++++++++++++++ drivers/soc/aspeed/aspeed-espi-vw.h | 142 ++++ 12 files changed, 2529 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/aspeed/espi.yaml create mode 100644 drivers/soc/aspeed/aspeed-espi-ctrl.c create mode 100644 drivers/soc/aspeed/aspeed-espi-ctrl.h create mode 100644 drivers/soc/aspeed/aspeed-espi-flash.h create mode 100644 drivers/soc/aspeed/aspeed-espi-ioc.h create mode 100644 drivers/soc/aspeed/aspeed-espi-oob.h create mode 100644 drivers/soc/aspeed/aspeed-espi-perif.h create mode 100644 drivers/soc/aspeed/aspeed-espi-vw.h
Signature · 1 line
2.17.1
PATCH v3 1/4 dt-bindings: aspeed: Add eSPI controller
Add dt-bindings for Aspeed eSPI controller
--- .../devicetree/bindings/soc/aspeed/espi.yaml | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/aspeed/espi.yaml
Documentation/devicetree/bindings/soc/aspeed/espi.yaml new file +157 -0
@@ -0,0 +1,157 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# # Copyright (c) 2021 Aspeed Technology Inc. +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/soc/aspeed/espi.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Aspeed eSPI Controller + +maintainers: + - Chia-Wei Wang <[email protected]> + - Ryan Chen <[email protected]> + +description: + Aspeed eSPI controller implements a slave side eSPI endpoint device + supporting the four eSPI channels, namely peripheral, virtual wire, + out-of-band, and flash. + +properties: + compatible: + items: + - enum: + - aspeed,ast2500-espi + - aspeed,ast2600-espi + - const: simple-mfd + - const: syscon + + reg: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + + ranges: true + + espi-ctrl: + type: object + + properties: + compatible: + items: + - enum: + - aspeed,ast2500-espi-ctrl + - aspeed,ast2600-espi-ctrl + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + perif,memcyc-enable: + type: boolean + description: Enable memory cycle over eSPI peripheral channel + + perif,memcyc-src-addr: + $ref: /schemas/types.yaml#/definitions/uint32 + description: The Host side address to be decoded into the memory cycle over eSPI peripheral channel + + perif,memcyc-size: + $ref: /schemas/types.yaml#/definitions/uint32 + description: The size of the memory region allocated for the memory cycle over eSPI peripheral channel + minimum: 65536 + + perif,dma-mode: + type: boolean + description: Enable DMA support for eSPI peripheral channel + + oob,dma-mode: + type: boolean + description: Enable DMA support for eSPI out-of-band channel + + oob,dma-tx-desc-num: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 2 + maximum: 1023 + description: The number of TX descriptors available for eSPI OOB DMA engine + + oob,dma-rx-desc-num: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 2 + maximum: 1023 + description: The number of RX descriptors available for eSPI OOB DMA engine + + flash,dma-mode: + type: boolean + description: Enable DMA support for eSPI flash channel + + flash,safs-mode: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [ 0, 1, 2 ] + default: 0 + description: Slave-Attached-Sharing-Flash mode, 0->Mix, 1->SW, 2->HW + + dependencies: + perif,memcyc-src-addr: [ "perif,memcyc-enable" ] + perif,memcyc-size: [ "perif,memcyc-enable" ] + oob,dma-tx-desc-num: [ "oob,dma-mode" ] + oob,dma-rx-desc-num: [ "oob,dma-mode" ] + + required: + - compatible + - interrupts + - clocks + + espi-mmbi: + type: object + + properties: + compatible: + const: aspeed,ast2600-espi-mmbi + + interrupts: + maxItems: 1 + + required: + - compatible + - interrupts + +required: + - compatible + - reg + - "#address-cells" + - "#size-cells" + - ranges + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/clock/ast2600-clock.h> + + espi: espi at 1e6ee000 { + compatible = "aspeed,ast2600-espi", "simple-mfd", "syscon"; + reg = <0x1e6ee000 0x1000>; + + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x1e6ee000 0x1000>; + + espi_ctrl: espi-ctrl at 0 { + compatible = "aspeed,ast2600-espi-ctrl"; + reg = <0x0 0x800>; + interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&syscon ASPEED_CLK_GATE_ESPICLK>; + }; + + espi_mmbi: espi-mmbi at 800 { + compatible = "aspeed,ast2600-espi-mmbi"; + reg = <0x800 0x50>; + interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>; + }; + };
Signature · 1 line
2.17.1
Rob Herring
maintainerRe: [PATCH v3 1/4] dt-bindings: aspeed: Add eSPI controller
Quoted 8 lines · Chia-Wei Wang
Add dt-bindings for Aspeed eSPI controller
Signed-off-by Chia-Wei Wang <[email protected]>--- .../devicetree/bindings/soc/aspeed/espi.yaml | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/aspeed/espi.yaml
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/aspeed/espi.example.dt.yaml: espi at 1e6ee000: 'espi-ctrl at 0', 'espi-mmbi at 800' do not match any of the regexes: 'pinctrl-[0-9]+'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/aspeed/espi.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/patch/1520968
This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit.
RE: [PATCH v3 1/4] dt-bindings: aspeed: Add eSPI controller
Quoted 36 lines
From: Rob Herring <[email protected]>
Sent: Thursday, August 26, 2021 9:26 PMQuoted 10 lines · Chia-Wei Wang
Add dt-bindings for Aspeed eSPI controller
Signed-off-by Chia-Wei Wang <[email protected]>--- .../devicetree/bindings/soc/aspeed/espi.yaml | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644
Documentation/devicetree/bindings/soc/aspeed/espi.yamlMy bot found errors running 'make DT_CHECKER_FLAGS=-m
dt_binding_check'
on your patch (DT_CHECKER_FLAGSis new in v5.13):yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/aspeed/espi.example.dt.yaml: espi at1e6ee000: 'espi-ctrl at 0', 'espi-mmbi at 800' do not match any of the regexes: 'pinctrl-[0-9]+'
From schema:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/aspeed/espi.yamldoc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/patch/1520968
This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.
Quoted 7 lines
If you already ran 'make
dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:pip3 install dtschema --upgrade
Please check and re-submit.
The warning has been fixed by using patternProperties to define the espi-ctrl and the espi-mmbi child nodes. The updated version will be submitted soon. Thanks.
Chiawei
PATCH v3 2/4 MAINTAINER: Add ASPEED eSPI driver entry
In reply to Chia-Wei WangAdd Ryan Chen and myself as the maintainer of Aspeed eSPI driver. Joel Stanley is added as the reviewer.
--- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+)
MAINTAINERS +9 -0
@@ -1713,6 +1713,15 @@ 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: linux-aspeed at lists.ozlabs.org (moderated for non-subscribers) +L: openbmc at lists.ozlabs.org (moderated for non-subscribers) +S: Maintained +F: Documentation/devicetree/bindings/soc/aspeed/espi.yaml + ARM/ASPEED I2C DRIVER M: Brendan Higgins <[email protected]> R: Benjamin Herrenschmidt <[email protected]>
Signature · 1 line
2.17.1
PATCH v3 3/4 soc: aspeed: Add eSPI driver
In reply to Chia-Wei WangThe Aspeed eSPI controller is slave device to communicate with the master through the Enhanced Serial Peripheral Interface (eSPI). All of the four eSPI channels, namely peripheral, virtual wire, out-of-band, and flash are supported.
--- drivers/soc/aspeed/Kconfig | 11 + drivers/soc/aspeed/Makefile | 1 + drivers/soc/aspeed/aspeed-espi-ctrl.c | 205 +++++++++ drivers/soc/aspeed/aspeed-espi-ctrl.h | 304 ++++++++++++ drivers/soc/aspeed/aspeed-espi-flash.h | 380 +++++++++++++++ drivers/soc/aspeed/aspeed-espi-ioc.h | 153 +++++++ drivers/soc/aspeed/aspeed-espi-oob.h | 611 +++++++++++++++++++++++++ drivers/soc/aspeed/aspeed-espi-perif.h | 539 ++++++++++++++++++++++ drivers/soc/aspeed/aspeed-espi-vw.h | 142 ++++++ 9 files changed, 2346 insertions(+) create mode 100644 drivers/soc/aspeed/aspeed-espi-ctrl.c create mode 100644 drivers/soc/aspeed/aspeed-espi-ctrl.h create mode 100644 drivers/soc/aspeed/aspeed-espi-flash.h create mode 100644 drivers/soc/aspeed/aspeed-espi-ioc.h create mode 100644 drivers/soc/aspeed/aspeed-espi-oob.h create mode 100644 drivers/soc/aspeed/aspeed-espi-perif.h create mode 100644 drivers/soc/aspeed/aspeed-espi-vw.h
drivers/soc/aspeed/Kconfig +11 -0
@@ -42,6 +42,17 @@ config ASPEED_SOCINFO help Say yes to support decoding of ASPEED BMC information. +config ASPEED_ESPI + bool "ASPEED eSPI slave driver" + select REGMAP + select MFD_SYSCON + default n + help + Enable driver support for the Aspeed eSPI engine. The eSPI engine + plays as a slave device in BMC to communicate with the Host over + the eSPI interface. The four eSPI channels, namely peripheral, + virtual wire, out-of-band, and flash are supported. + endmenu endif
drivers/soc/aspeed/Makefile +1 -0
@@ -3,3 +3,4 @@ obj-$(CONFIG_ASPEED_LPC_CTRL) += aspeed-lpc-ctrl.o obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o obj-$(CONFIG_ASPEED_P2A_CTRL) += aspeed-p2a-ctrl.o obj-$(CONFIG_ASPEED_SOCINFO) += aspeed-socinfo.o +obj-$(CONFIG_ASPEED_ESPI) += aspeed-espi-ctrl.o
drivers/soc/aspeed/aspeed-espi-ctrl.c new file +205 -0
205 lines not on this page · raw message
drivers/soc/aspeed/aspeed-espi-ctrl.h new file +304 -0
304 lines not on this page · raw message
drivers/soc/aspeed/aspeed-espi-flash.h new file +380 -0
380 lines not on this page · raw message
drivers/soc/aspeed/aspeed-espi-ioc.h new file +153 -0
153 lines not on this page · raw message
drivers/soc/aspeed/aspeed-espi-oob.h new file +611 -0
611 lines not on this page · raw message
drivers/soc/aspeed/aspeed-espi-perif.h new file +539 -0
539 lines not on this page · raw message
drivers/soc/aspeed/aspeed-espi-vw.h new file +142 -0
142 lines not on this page · raw message
Signature · 1 line
2.17.1
kernel test robot
build botRe: [PATCH v3 3/4] soc: aspeed: Add eSPI driver
I love your patch! Perhaps something to improve:
Hi Chia-Wei,
I love your patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on arm/for-next keystone/next soc/for-next rockchip/for-next arm64/for-next/core linus/master joel-aspeed/for-next v5.14-rc7 next-20210826] [cannot apply to xlnx/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Chia-Wei-Wang/arm-aspeed-Add-eSPI-support/20210826-141737 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next config: arm64-randconfig-r025-20210826 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project ea08c4cd1c0869ec5024a8bb3f5cdf06ab03ae83)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/2980a1777c50754fe145f2e73ded8739931c0712
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Chia-Wei-Wang/arm-aspeed-Add-eSPI-support/20210826-141737 git checkout 2980a1777c50754fe145f2e73ded8739931c0712
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
In file included from drivers/soc/aspeed/aspeed-espi-ctrl.c:22:
drivers/soc/aspeed/aspeed-espi-perif.h:446:8: error: incompatible pointer types passing 'phys_addr_t *' (aka 'unsigned long long *') to parameter of type 'u32 *' (aka 'unsigned int *') [-Werror,-Wincompatible-pointer-types]
&espi_perif->mcyc_saddr);
^~~~~~~~~~~~~~~~~~~~~~~
include/linux/of.h:1249:17: note: passing argument to parameter 'out_value' here
u32 *out_value)
^
>> drivers/soc/aspeed/aspeed-espi-ctrl.c:98:23: warning: cast to smaller integer type 'uint32_t' (aka 'unsigned int') from 'const void *' [-Wvoid-pointer-to-int-cast]
espi_ctrl->version = (uint32_t)of_device_get_match_data(dev);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1 warning and 1 error generated.
vim +98 drivers/soc/aspeed/aspeed-espi-ctrl.c
87
88 static int aspeed_espi_ctrl_probe(struct platform_device *pdev)
89 {
90 int rc = 0;
91 struct aspeed_espi_ctrl *espi_ctrl;
92 struct device *dev = &pdev->dev;
93
94 espi_ctrl = devm_kzalloc(dev, sizeof(*espi_ctrl), GFP_KERNEL);
95 if (!espi_ctrl)
96 return -ENOMEM;
97
> 98 espi_ctrl->version = (uint32_t)of_device_get_match_data(dev);
99 100 espi_ctrl->map = syscon_node_to_regmap(dev->parent->of_node);
101 if (IS_ERR(espi_ctrl->map)) {
102 dev_err(dev, "cannot get remap\n");
103 return -ENODEV;
104 }
105
106 espi_ctrl->irq = platform_get_irq(pdev, 0);
107 if (espi_ctrl->irq < 0)
108 return espi_ctrl->irq;
109
110 espi_ctrl->clk = devm_clk_get(dev, NULL);
111 if (IS_ERR(espi_ctrl->clk)) {
112 dev_err(dev, "cannot get clock\n");
113 return -ENODEV;
114 }
115
116 rc = clk_prepare_enable(espi_ctrl->clk);
117 if (rc) {
118 dev_err(dev, "cannot enable clock\n");
119 return rc;
120 }
121
122 espi_ctrl->perif = aspeed_espi_perif_alloc(dev, espi_ctrl);
123 if (IS_ERR(espi_ctrl->perif)) {
124 dev_err(dev, "failed to allocate peripheral channel\n");
125 return PTR_ERR(espi_ctrl->perif);
126 }
127
128 espi_ctrl->vw = aspeed_espi_vw_alloc(dev, espi_ctrl);
129 if (IS_ERR(espi_ctrl->vw)) {
130 dev_err(dev, "failed to allocate virtual wire channel\n");
131 return PTR_ERR(espi_ctrl->vw);
132 }
133
134 espi_ctrl->oob = aspeed_espi_oob_alloc(dev, espi_ctrl);
135 if (IS_ERR(espi_ctrl->oob)) {
136 dev_err(dev, "failed to allocate out-of-band channel\n");
137 return PTR_ERR(espi_ctrl->oob);
138 }
139
140 espi_ctrl->flash = aspeed_espi_flash_alloc(dev, espi_ctrl);
141 if (rc) {
142 dev_err(dev, "failed to allocate flash channel\n");
143 return PTR_ERR(espi_ctrl->flash);
144 }
145
146 regmap_write(espi_ctrl->map, ESPI_SYSEVT_INT_T0, 0x0);
147 regmap_write(espi_ctrl->map, ESPI_SYSEVT_INT_T1, 0x0);
148 regmap_write(espi_ctrl->map, ESPI_SYSEVT_INT_EN, 0xffffffff);
149
150 regmap_write(espi_ctrl->map, ESPI_SYSEVT1_INT_T0, 0x1);
151 regmap_write(espi_ctrl->map, ESPI_SYSEVT1_INT_EN, 0x1);
152
153 rc = devm_request_irq(dev, espi_ctrl->irq,
154 aspeed_espi_ctrl_isr,
155 0, DEVICE_NAME, espi_ctrl);
156 if (rc) {
157 dev_err(dev, "failed to request IRQ\n");
158 return rc;
159 }
160
161 regmap_update_bits(espi_ctrl->map, ESPI_INT_EN,
162 ESPI_INT_EN_HW_RST_DEASSERT,
163 ESPI_INT_EN_HW_RST_DEASSERT);
164
165 dev_set_drvdata(dev, espi_ctrl);
166
167 dev_info(dev, "module loaded\n");
168
169 return 0;
170 }
171
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all at lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 35430 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20210827/0435282b/attachment-0001.gz>
kernel test robot
build botRe: [PATCH v3 3/4] soc: aspeed: Add eSPI driver
In reply to Chia-Wei WangI love your patch! Yet something to improve:
Hi Chia-Wei,
I love your patch! Yet something to improve:
[auto build test ERROR on robh/for-next]
[also build test ERROR on arm/for-next keystone/next soc/for-next rockchip/for-next arm64/for-next/core linus/master joel-aspeed/for-next v5.14-rc7 next-20210826] [cannot apply to xlnx/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Chia-Wei-Wang/arm-aspeed-Add-eSPI-support/20210826-141737 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next config: arm64-randconfig-r002-20210826 (attached as .config) compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/2980a1777c50754fe145f2e73ded8739931c0712
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Chia-Wei-Wang/arm-aspeed-Add-eSPI-support/20210826-141737 git checkout 2980a1777c50754fe145f2e73ded8739931c0712
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
In file included from drivers/soc/aspeed/aspeed-espi-ctrl.c:22:
drivers/soc/aspeed/aspeed-espi-perif.h: In function 'aspeed_espi_perif_alloc':
>> drivers/soc/aspeed/aspeed-espi-perif.h:446:43: error: passing argument 3 of 'of_property_read_u32' from incompatible pointer type [-Werror=incompatible-pointer-types]
446 | &espi_perif->mcyc_saddr);
| ^~~~~~~~~~~~~~~~~~~~~~~
| |
| phys_addr_t * {aka long long unsigned int *}
In file included from include/linux/of_device.h:9,
from drivers/soc/aspeed/aspeed-espi-ctrl.c:9:
include/linux/of.h:1249:45: note: expected 'u32 *' {aka 'unsigned int *'} but argument is of type 'phys_addr_t *' {aka 'long long unsigned int *'}
1249 | u32 *out_value)
| ~~~~~^~~~~~~~~
drivers/soc/aspeed/aspeed-espi-ctrl.c: In function 'aspeed_espi_ctrl_probe':
drivers/soc/aspeed/aspeed-espi-ctrl.c:98:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
98 | espi_ctrl->version = (uint32_t)of_device_get_match_data(dev);
| ^cc1: some warnings being treated as errors
vim +/of_property_read_u32 +446 drivers/soc/aspeed/aspeed-espi-perif.h
422
423 static void *aspeed_espi_perif_alloc(struct device *dev, struct aspeed_espi_ctrl *espi_ctrl)
424 {
425 int rc;
426 struct aspeed_espi_perif *espi_perif;
427 struct aspeed_espi_perif_dma *dma;
428
429 espi_perif = devm_kzalloc(dev, sizeof(*espi_perif), GFP_KERNEL);
430 if (!espi_perif)
431 return ERR_PTR(-ENOMEM);
432
433 espi_perif->ctrl = espi_ctrl;
434
435 init_waitqueue_head(&espi_perif->wq);
436
437 spin_lock_init(&espi_perif->lock);
438
439 mutex_init(&espi_perif->pc_rx_mtx);
440 mutex_init(&espi_perif->pc_tx_mtx);
441 mutex_init(&espi_perif->np_tx_mtx);
442
443 espi_perif->mcyc_enable = of_property_read_bool(dev->of_node, "perif,memcyc-enable");
444 if (espi_perif->mcyc_enable) {
445 rc = of_property_read_u32(dev->of_node, "perif,memcyc-src-addr",
> 446 &espi_perif->mcyc_saddr);
447 if (rc) {
448 dev_err(dev, "cannot get Host source address for memory cycle\n");
449 return ERR_PTR(-ENODEV);
450 }
451
452 rc = of_property_read_u32(dev->of_node, "perif,memcyc-size",
453 &espi_perif->mcyc_size);
454 if (rc) {
455 dev_err(dev, "cannot get size for memory cycle\n");
456 return ERR_PTR(-ENODEV);
457 }
458
459 if (espi_perif->mcyc_size < PERIF_MEMCYC_SIZE_MIN)
460 espi_perif->mcyc_size = PERIF_MEMCYC_SIZE_MIN;
461 else
462 espi_perif->mcyc_size = roundup_pow_of_two(espi_perif->mcyc_size);
463
464 espi_perif->mcyc_mask = ~(espi_perif->mcyc_size - 1);
465 espi_perif->mcyc_virt = dma_alloc_coherent(dev, espi_perif->mcyc_size,
466 &espi_perif->mcyc_taddr, GFP_KERNEL);
467 if (!espi_perif->mcyc_virt) {
468 dev_err(dev, "cannot allocate memory cycle region\n");
469 return ERR_PTR(-ENOMEM);
470 }
471 }
472
473 if (of_property_read_bool(dev->of_node, "perif,dma-mode")) {
474 dma = &espi_perif->dma;
475
476 dma->pc_tx_virt = dma_alloc_coherent(dev, PAGE_SIZE,
477 &dma->pc_tx_addr, GFP_KERNEL);
478 if (!dma->pc_tx_virt) {
479 dev_err(dev, "cannot allocate posted TX DMA buffer\n");
480 return ERR_PTR(-ENOMEM);
481 }
482
483 dma->pc_rx_virt = dma_alloc_coherent(dev, PAGE_SIZE,
484 &dma->pc_rx_addr, GFP_KERNEL);
485 if (!dma->pc_rx_virt) {
486 dev_err(dev, "cannot allocate posted RX DMA buffer\n");
487 return ERR_PTR(-ENOMEM);
488 }
489
490 dma->np_tx_virt = dma_alloc_coherent(dev, PAGE_SIZE,
491 &dma->np_tx_addr, GFP_KERNEL);
492 if (!dma->np_tx_virt) {
493 dev_err(dev, "cannot allocate non-posted TX DMA buffer\n");
494 return ERR_PTR(-ENOMEM);
495 }
496
497 espi_perif->dma_mode = 1;
498 }
499
500 espi_perif->mdev.parent = dev;
501 espi_perif->mdev.minor = MISC_DYNAMIC_MINOR;
502 espi_perif->mdev.name = devm_kasprintf(dev, GFP_KERNEL, "%s", PERIF_MDEV_NAME);
503 espi_perif->mdev.fops = &aspeed_espi_perif_fops;
504 rc = misc_register(&espi_perif->mdev);
505 if (rc) {
506 dev_err(dev, "cannot register device\n");
507 return ERR_PTR(rc);
508 }
509
510 aspeed_espi_perif_enable(espi_perif);
511
512 return espi_perif;
513 }
514
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all at lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 42142 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20210827/b00a950a/attachment-0001.gz>
RE: [PATCH v3 3/4] soc: aspeed: Add eSPI driver
Aspeed 5th and 6th generation SoCs are based on the ARM 32-bits architecture. Should we follow the report to make the driver 64-bits compatible? Or revise the driver to use more specific data types?
Thanks.
Chiawei
Quoted 185 lines
From: kernel test robot <[email protected]>
Sent: Friday, August 27, 2021 7:30 AMHi Chia-Wei,
I love your patch! Yet something to improve:
[auto build test ERROR on robh/for-next] [also build test ERROR on arm/for-next keystone/next soc/for-next rockchip/for-next arm64/for-next/core linus/master joel-aspeed/for-next v5.14-rc7 next-20210826] [cannot apply to xlnx/master] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]url:
https://github.com/0day-ci/linux/commits/Chia-Wei-Wang/arm-aspeed-Add-e
SPI-support/20210826-141737
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: arm64-randconfig-r002-20210826 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0 reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
#
https://github.com/0day-ci/linux/commit/2980a1777c50754fe145f2e73ded8739931c0712
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Chia-Wei-Wang/arm-aspeed-Add-eSPI-support/20210826-141737git checkout 2980a1777c50754fe145f2e73ded8739931c0712 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by kernel test robot <[email protected]>All errors (new ones prefixed by >>):
In file included from
drivers/soc/aspeed/aspeed-espi-ctrl.c:22:
drivers/soc/aspeed/aspeed-espi-perif.h: In function
'aspeed_espi_perif_alloc':Quoted 3 lines
Quoted 3 lines
drivers/soc/aspeed/aspeed-espi-perif.h:446:43: error: passing argument 3 of 'of_property_read_u32' from incompatible pointer type [-Werror=incompatible-pointer-types]446 | &espi_perif->mcyc_saddr); | ^~~~~~~~~~~~~~~~~~~~~~~ | | | phys_addr_t * {aka long long unsigned int *} In file included from include/linux/of_device.h:9, from drivers/soc/aspeed/aspeed-espi-ctrl.c:9: include/linux/of.h:1249:45: note: expected 'u32 *' {aka 'unsigned int *'} but argument is of type 'phys_addr_t *' {aka 'long long unsigned int *'} 1249 | u32 *out_value) | ~~~~~^~~~~~~~~
drivers/soc/aspeed/aspeed-espi-ctrl.c: In function
'aspeed_espi_ctrl_probe':
drivers/soc/aspeed/aspeed-espi-ctrl.c:98:30: warning: cast from pointer to
integer of different size [-Wpointer-to-int-cast]98 | espi_ctrl->version =(uint32_t)of_device_get_match_data(dev);
| ^
cc1: some warnings being treated as errorsvim +/of_property_read_u32 +446
drivers/soc/aspeed/aspeed-espi-perif.h422
423 static void *aspeed_espi_perif_alloc(struct device *dev, structaspeed_espi_ctrl*espi_ctrl)424 { 425 int rc; 426 struct aspeed_espi_perif *espi_perif; 427 struct aspeed_espi_perif_dma *dma; 428 429 espi_perif = devm_kzalloc(dev, sizeof(*espi_perif), GFP_KERNEL); 430 if (!espi_perif) 431 return ERR_PTR(-ENOMEM); 432 433 espi_perif->ctrl = espi_ctrl; 434 435 init_waitqueue_head(&espi_perif->wq); 436 437 spin_lock_init(&espi_perif->lock); 438 439 mutex_init(&espi_perif->pc_rx_mtx); 440 mutex_init(&espi_perif->pc_tx_mtx); 441 mutex_init(&espi_perif->np_tx_mtx); 442 443 espi_perif->mcyc_enable = of_property_read_bool(dev->of_node, "perif,memcyc-enable"); 444 if (espi_perif->mcyc_enable) { 445 rc = of_property_read_u32(dev->of_node,"perif,memcyc-src-addr",
Quoted 1 line
446
&espi_perif->mcyc_saddr);447 if (rc) {
448 dev_err(dev, "cannot get Host source address formemory cycle\n"); 449 return ERR_PTR(-ENODEV); 450 } 451 452 rc = of_property_read_u32(dev->of_node, "perif,memcyc-size", 453 &espi_perif->mcyc_size); 454 if (rc) { 455 dev_err(dev, "cannot get size for memory cycle\n"); 456 return ERR_PTR(-ENODEV); 457 } 458 459 if (espi_perif->mcyc_size < PERIF_MEMCYC_SIZE_MIN) 460 espi_perif->mcyc_size = PERIF_MEMCYC_SIZE_MIN; 461 else 462 espi_perif->mcyc_size = roundup_pow_of_two(espi_perif->mcyc_size); 463 464 espi_perif->mcyc_mask = ~(espi_perif->mcyc_size - 1); 465 espi_perif->mcyc_virt = dma_alloc_coherent(dev,
espi_perif->mcyc_size,
466&espi_perif->mcyc_taddr,GFP_KERNEL);
467 if (!espi_perif->mcyc_virt) {
468 dev_err(dev, "cannot allocate memory cycleregion\n"); 469 return ERR_PTR(-ENOMEM); 470 } 471 } 472 473 if (of_property_read_bool(dev->of_node, "perif,dma-mode")) { 474 dma = &espi_perif->dma; 475 476 dma->pc_tx_virt = dma_alloc_coherent(dev, PAGE_SIZE, 477 &dma->pc_tx_addr, GFP_KERNEL); 478 if (!dma->pc_tx_virt) { 479 dev_err(dev, "cannot allocate posted TX DMA buffer\n"); 480 return ERR_PTR(-ENOMEM); 481 } 482 483 dma->pc_rx_virt = dma_alloc_coherent(dev, PAGE_SIZE, 484 &dma->pc_rx_addr, GFP_KERNEL); 485 if (!dma->pc_rx_virt) { 486 dev_err(dev, "cannot allocate posted RX DMA buffer\n"); 487 return ERR_PTR(-ENOMEM); 488 } 489 490 dma->np_tx_virt = dma_alloc_coherent(dev, PAGE_SIZE, 491 &dma->np_tx_addr, GFP_KERNEL); 492 if (!dma->np_tx_virt) { 493 dev_err(dev, "cannot allocate non-posted TX DMA buffer\n"); 494 return ERR_PTR(-ENOMEM); 495 } 496 497 espi_perif->dma_mode = 1; 498 } 499 500 espi_perif->mdev.parent = dev; 501 espi_perif->mdev.minor = MISC_DYNAMIC_MINOR; 502 espi_perif->mdev.name = devm_kasprintf(dev, GFP_KERNEL, "%s", PERIF_MDEV_NAME); 503 espi_perif->mdev.fops = &aspeed_espi_perif_fops; 504 rc = misc_register(&espi_perif->mdev); 505 if (rc) { 506 dev_err(dev, "cannot register device\n"); 507 return ERR_PTR(rc); 508 } 509 510 aspeed_espi_perif_enable(espi_perif); 511 512 return espi_perif; 513 } 514---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all at lists.01.org
Joel Stanley
maintainerRe: [PATCH v3 3/4] soc: aspeed: Add eSPI driver
Quoted 4 lines · ChiaWei Wang
Aspeed 5th and 6th generation SoCs are based on the ARM 32-bits architecture. Should we follow the report to make the driver 64-bits compatible? Or revise the driver to use more specific data types?
Yes, in general it's expected your driver will compile cleanly for 64-bit architectures. This helps with testing and static analysis, where CI builds all the drivers for x86.
Cheers,
Joel
RE: [PATCH v3 3/4] soc: aspeed: Add eSPI driver
Quoted 6 lines
From: Joel Stanley <[email protected]>
Sent: Friday, August 27, 2021 1:49 PMQuoted 1 line · ChiaWei Wang
Quoted 8 lines
Quoted 1 line
Aspeed 5th and 6th generation SoCs are based on the ARM 32-bits
architecture.
Quoted 2 lines
Should we follow the report to make the driver 64-bits compatible? Or revise the driver to use more specific data types?
Yes, in general it's expected your driver will compile cleanly for 64-bit architectures. This helps with testing and static analysis, where CI builds all the drivers for x86.
Understood. Will fix the data type issue in the next submission. Thanks.
Chiawei
PATCH v3 3/4 soc: aspeed: Add eSPI driver
In reply to Chia-Wei WangHi Chia-Wei,
Quoted 4 lines
The Aspeed eSPI controller is slave device to communicate with the master through the Enhanced Serial Peripheral Interface (eSPI). All of the four eSPI channels, namely peripheral, virtual wire, out-of-band, and flash are supported.
Great to have this added submitted upstream! A few comments though:
Quoted 10 lines
---
?drivers/soc/aspeed/Kconfig???????????? |? 11 + ?drivers/soc/aspeed/Makefile??????????? |?? 1 + ?drivers/soc/aspeed/aspeed-espi-ctrl.c? | 205 +++++++++ ?drivers/soc/aspeed/aspeed-espi-ctrl.h? | 304 ++++++++++++ ?drivers/soc/aspeed/aspeed-espi-flash.h | 380 +++++++++++++++ ?drivers/soc/aspeed/aspeed-espi-ioc.h?? | 153 +++++++ ?drivers/soc/aspeed/aspeed-espi-oob.h?? | 611 +++++++++++++++++++++++++ ?drivers/soc/aspeed/aspeed-espi-perif.h | 539 ++++++++++++++++++++++ ?drivers/soc/aspeed/aspeed-espi-vw.h??? | 142 ++++++
This structure is a bit odd - you have the one -crtl.c file, which defines the actual driver, but then a bunch of headers that contain more code than header-type definitions.
Is there any reason that -flash, -ioc, -oob, -perif and -vw components can't be standard .c files?
Then, for the userspace ABI: it looks like you're exposing everything through new device-specific ioctls. Would it not make more sense to use existing interfaces? For example, the virtual wire bits could be regular GPIOs; the flash interface could be a mtd or block device.
I understand that we'll likely still need some level of custom device control, but the more we can use generic interfaces for, the less custom code (and interfaces) we'll need on the userspace side.
Cheers,
Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20210827/8bb759de/attachment.htm>
Re: [PATCH v3 3/4] soc: aspeed: Add eSPI driver
In reply to Chia-Wei WangHi Chia-Wei,
[apologies for the re-send, dropping HTML part...]
Quoted 4 lines
The Aspeed eSPI controller is slave device to communicate with the master through the Enhanced Serial Peripheral Interface (eSPI). All of the four eSPI channels, namely peripheral, virtual wire, out-of-band, and flash are supported.
Great to have this added submitted upstream! A few comments though:
Quoted 10 lines
---
?drivers/soc/aspeed/Kconfig???????????? |? 11 + ?drivers/soc/aspeed/Makefile??????????? |?? 1 + ?drivers/soc/aspeed/aspeed-espi-ctrl.c? | 205 +++++++++ ?drivers/soc/aspeed/aspeed-espi-ctrl.h? | 304 ++++++++++++ ?drivers/soc/aspeed/aspeed-espi-flash.h | 380 +++++++++++++++ ?drivers/soc/aspeed/aspeed-espi-ioc.h?? | 153 +++++++ ?drivers/soc/aspeed/aspeed-espi-oob.h?? | 611 +++++++++++++++++++++++++ ?drivers/soc/aspeed/aspeed-espi-perif.h | 539 ++++++++++++++++++++++ ?drivers/soc/aspeed/aspeed-espi-vw.h??? | 142 ++++++
This structure is a bit odd - you have the one -crtl.c file, which defines the actual driver, but then a bunch of headers that contain more code than header-type definitions.
Is there any reason that -flash, -ioc, -oob, -perif and -vw components can't be standard .c files?
Then, for the userspace ABI: it looks like you're exposing everything through new device-specific ioctls. Would it not make more sense to use existing interfaces? For example, the virtual wire bits could be regular GPIOs; the flash interface could be a mtd or block device.
I understand that we'll likely still need some level of custom device control, but the more we can use generic interfaces for, the less custom code (and interfaces) we'll need on the userspace side.
Cheers,
Jeremy
RE: [PATCH v3 3/4] soc: aspeed: Add eSPI driver
Hi Jeremy,
Thanks for reviewing the patch.
Quoted 26 lines
From: Jeremy Kerr <[email protected]>
Sent: Friday, August 27, 2021 11:20 AMHi Chia-Wei,
[apologies for the re-send, dropping HTML part...]
Quoted 4 lines
The Aspeed eSPI controller is slave device to communicate with the master through the Enhanced Serial Peripheral Interface (eSPI). All of the four eSPI channels, namely peripheral, virtual wire, out-of-band, and flash are supported.
Great to have this added submitted upstream! A few comments though:
Quoted 11 lines
---
?drivers/soc/aspeed/Kconfig???????????? |? 11 + ?drivers/soc/aspeed/Makefile??????????? |?? 1 + ?drivers/soc/aspeed/aspeed-espi-ctrl.c? | 205 +++++++++ ?drivers/soc/aspeed/aspeed-espi-ctrl.h? | 304 ++++++++++++ ?drivers/soc/aspeed/aspeed-espi-flash.h | 380 +++++++++++++++ ?drivers/soc/aspeed/aspeed-espi-ioc.h?? | 153 +++++++ ?drivers/soc/aspeed/aspeed-espi-oob.h?? | 611+++++++++++++++++++++++++
?drivers/soc/aspeed/aspeed-espi-perif.h | 539 ++++++++++++++++++++++ ?drivers/soc/aspeed/aspeed-espi-vw.h??? | 142 ++++++
Quoted 6 lines
This structure is a bit odd - you have the one
-crtl.cfile, which defines the actual driver, but then a bunch of headers that contain more code than header-type definitions.Is there any reason that -flash, -ioc, -oob, -perif and -vw components can't be standard .c files?
The eSPI slave device comprises four channels, where each of them has individual functionality. Putting the four channels driver code into a single file makes it hard to maintain and trace.
We did consider to make them standard .c files.
But it requires to export channel functions into kernel space although they are dedicated only to this eSPI driver. As espi-ctrl needs to invoke corresponding channel functions when it is interrupted by eSPI events.
To avoid polluting kernel space, we decided to put driver code in header files and make the channel functions 'static'.
BTW, I once encountered .c file inclusion in other projects. Is it proper for Linux driver development?
Quoted 10 lines
Then, for the userspace ABI: it looks like you're exposing everything through new device-specific ioctls. Would it not make more sense to use existing interfaces? For example, the virtual wire bits could be regular GPIOs; the flash interface could be a mtd or block device.
I understand that we'll likely still need some level of custom device control, but the more we can use generic interfaces for, the less custom code (and interfaces) we'll need on the userspace side.
eSPI communication is based on the its cycle packet format.
We intended to let userspace decided how to interpret and compose TX/RX packets including header, tag, length (encoded), and data. IOCTL comes to our first mind as it also works in the 'packet' like paradigm.
Chiawei
Re: [PATCH v3 3/4] soc: aspeed: Add eSPI driver
Hi Chiawei,
Quoted 3 lines
The eSPI slave device comprises four channels, where each of them has individual functionality. Putting the four channels driver code into a single file makes it hard to maintain and trace.
Yep, understood.
Quoted 3 lines
We did consider to make them standard .c files.
But it requires to export channel functions into kernel space although they are dedicated only to this eSPI driver.
What do you mean by "export into kernel space" here? The function prototypes need to be available to your main (-ctrl.c) file, regardless of whether you're putting the entire functions in a header file, or just the prototype. There's doesn't need to be any difference in visibility outside of your own module if you were to do this the usual way.
Quoted 8 lines
As espi-ctrl needs to invoke corresponding channel functions when it is interrupted by eSPI events.
To avoid polluting kernel space, we decided to put driver code in header files and make the channel functions 'static'.
BTW, I once encountered .c file inclusion in other projects. Is it proper for Linux driver development?
It can be, just that in this case it's a bit unusual, and I can't see a good reason for doing so. This could just be a standard multiple-source-file module.
Quoted 5 lines
eSPI communication is based on the its cycle packet format. We intended to let userspace decided how to interpret and compose TX/RX packets including header, tag, length (encoded), and data. IOCTL comes to our first mind as it also works in the 'packet' like paradigm.
But you're not always exposing a packet-like interface for this. For example, your virtual-wire interface just has a get/set interface for bits in a register (plus some PCH event handling, which may not be applicable to all platforms...).
The other channels do look like more of a packet interface though, but in that case I'm not convinced that an ioctl interface is the best way to go for that. You're essentially sending a (length, pointer) pair over the ioctls there, which sounds more like a write() than an ioctl().
Regardless of the choice of interface though, this will definitely need some documentation or description of the API, and the ioc header to be somewhere useful for userspace to consume.
With that documented, we'd have a better idea of how the new ABI is supposed to work.
Cheers,
Jeremy
RE: [PATCH v3 3/4] soc: aspeed: Add eSPI driver
Hi Jeremy
Quoted 9 lines
From: Jeremy Kerr <[email protected]>
Sent: Friday, August 27, 2021 12:37 PMHi Chiawei,
Quoted 3 lines
The eSPI slave device comprises four channels, where each of them has individual functionality. Putting the four channels driver code into a single file makes it hard to maintain and trace.
Quoted 7 lines
Yep, understood.
Quoted 3 lines
We did consider to make them standard .c files.
But it requires to export channel functions into kernel space although they are dedicated only to this eSPI driver.What do you mean by "export into kernel space" here? The function prototypes
The channel functions will be visible to all kernel driver files.
Quoted 4 lines
need to be available to your main (
-ctrl.c) file, regardless of whether you're putting the entire functions in a header file, or just the prototype. There's doesn't need to be any difference in visibility outside of your own module if you were to do this the usual way.
Maybe I was trying to make channels function visible only to espi-ctrl.c too far. I will revise the driver to present in the usual .c way.
Quoted 24 lines
Quoted 9 lines
As espi-ctrl needs to invoke corresponding channel functions when it is interrupted by eSPI events.
To avoid polluting kernel space, we decided to put driver code in header files and make the channel functions 'static'.
BTW, I once encountered .c file inclusion in other projects. Is it proper for Linux driver development?
It can be, just that in this case it's a bit unusual, and I can't see a good reason for doing so. This could just be a standard multiple-source-file module.
Quoted 5 lines
eSPI communication is based on the its cycle packet format. We intended to let userspace decided how to interpret and compose TX/RX packets including header, tag, length (encoded), and data. IOCTL comes to our first mind as it also works in the 'packet' like paradigm.
But you're not always exposing a packet-like interface for this. For example, your virtual-wire interface just has a get/set interface for bits in a register (plus some PCH event handling, which may not be applicable to all platforms...).
Quoted 4 lines
The other channels do look like more of a packet interface though, but in that case I'm not convinced that an ioctl interface is the best way to go for that. You're essentially sending a (length, pointer) pair over the ioctls there, which sounds more like a
write()than anioctl().
In most cases, yes.
Currently only the peripheral channel has more than the 2 (put tx/get rx) IOCTL code. We think it might be a good idea to make the user interfaces of all channels consistent using IOCTL.
Quoted 7 lines
Regardless of the choice of interface though, this will definitely need some documentation or description of the API, and the ioc header to be somewhere useful for userspace to consume.
With that documented, we'd have a better idea of how the new ABI is supposed to work.
Sure. more comments will be added in aspeed-espi-ioc.h to describe the usage and the purpose.
Thanks for your feedback.
Chiawei
PATCH v3 4/4 ARM: dts: aspeed: Add eSPI node
In reply to Chia-Wei WangAdd eSPI to the device tree for Aspeed 5/6th generation SoCs.
--- arch/arm/boot/dts/aspeed-g6.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
arch/arm/boot/dts/aspeed-g6.dtsi +17 -0
@@ -364,6 +364,23 @@ status = "disabled"; }; + espi: espi at 1e6ee000 { + compatible = "aspeed,ast2600-espi", "simple-mfd", "syscon"; + reg = <0x1e6ee000 0x1000>; + + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x1e6ee000 0x1000>; + + espi_ctrl: espi-ctrl at 0 { + compatible = "aspeed,ast2600-espi-ctrl"; + reg = <0x0 0x800>; + interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&syscon ASPEED_CLK_GATE_ESPICLK>; + status = "disabled"; + }; + }; + gpio0: gpio at 1e780000 { #gpio-cells = <2>; gpio-controller;
Signature · 1 line
2.17.1