Porting ASPEED FMC/SPI memory controller driver
Subsystems (3)
v2 cover Porting ASPEED FMC/SPI memory controller driver
This patch series aims to porting ASPEED FMC/SPI memory controller driver with spi-mem interface. Adjust device tree setting of SPI NOR flash in order to fit real AST2600 EVB and new SPI memory controller driver. Also, this patch has been verified on AST2600-A1 EVB.
v2: Fix sparse warnings reported by kernel test robot <[email protected]>.
Chin-Ting Kuo (4):
dt-bindings: spi: Add binding file for ASPEED FMC/SPI memory
controller
ARM: dts: aspeed: ast2600: Update FMC/SPI controller setting for
spi-aspeed.c
ARM: dts: aspeed: ast2600-evb: Adjust SPI flash configuration
spi: aspeed: Add ASPEED FMC/SPI memory controller driver
.../bindings/spi/aspeed,spi-aspeed.yaml | 66 ++ arch/arm/boot/dts/aspeed-ast2600-evb.dts | 26 +- arch/arm/boot/dts/aspeed-g6.dtsi | 18 +- drivers/spi/Kconfig | 10 + drivers/spi/Makefile | 1 + drivers/spi/spi-aspeed.c | 969 ++++++++++++++++++ 6 files changed, 1080 insertions(+), 10 deletions(-) create mode 100644 Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yaml create mode 100644 drivers/spi/spi-aspeed.c
Signature · 1 line
2.17.1
PATCH v2 1/4 dt-bindings: spi: Add binding file for ASPEED FMC/SPI memory controller
Create binding file with YAML syntax for ASPEED FMC/SPI memory controller.
--- .../bindings/spi/aspeed,spi-aspeed.yaml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yaml
Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yaml new file +66 -0
@@ -0,0 +1,66 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/aspeed,spi-aspeed.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SPI memory controller for ASPEED SoCs + +maintainers: + - Chin-Ting Kuo <[email protected]> + +description: | + There are three SPI memory controllers embedded in a ASPEED SoC. + They are usually connected to SPI NOR flashes. Each of them has + more than a chip select. They also support SPI single, dual and + quad IO modes for SPI NOR flash. + +allOf: + - $ref: /spi/spi-controller.yaml# + +properties: + compatible: + oneOf: + - items: + - enum: + - aspeed,ast2600-fmc + - aspeed,ast2600-spi + + reg: + items: + - description: the control register location and length + - description: the flash memory mapping address and length + + clocks: + description: AHB bus clock which will be converted to SPI bus clock + +required: + - compatible + - reg + - clocks + - num-cs + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/clock/ast2600-clock.h> + spi1: spi at 1e630000 { + compatible = "aspeed,ast2600-spi"; + reg = <0x1e630000 0xc4>, <0x30000000 0x10000000>; + reg-names = "spi_ctrl_reg", "spi_mmap"; + clocks = <&syscon ASPEED_CLK_AHB>; + num-cs = <2>; + #address-cells = <1>; + #size-cells = <0>; + flash at 0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + }; + flash at 1 { + compatible = "jedec,spi-nor"; + reg = <1>; + spi-max-frequency = <50000000>; + }; + };
Signature · 1 line
2.17.1
Rob Herring
maintainerRe: [v2 1/4] dt-bindings: spi: Add binding file for ASPEED FMC/SPI memory controller
Quoted 39 lines · Chin-Ting Kuo
Create binding file with YAML syntax for ASPEED FMC/SPI memory controller.
Signed-off-by Chin-Ting Kuo <[email protected]>--- .../bindings/spi/aspeed,spi-aspeed.yaml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yamlDocumentation/devicetree/bindings/spi/aspeed,spi-aspeed.yaml new file +25
-0@@ -0,0 +1,66 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/aspeed,spi-aspeed.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SPI memory controller for ASPEED SoCs + +maintainers: + - Chin-Ting Kuo <[email protected]> + +description: | + There are three SPI memory controllers embedded in a ASPEED SoC. + They are usually connected to SPI NOR flashes. Each of them has + more than a chip select. They also support SPI single, dual and + quad IO modes for SPI NOR flash. + +allOf: + - $ref: /spi/spi-controller.yaml# + +properties: + compatible: + oneOf: + - items: + - enum:
Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yaml line 35
Quoted 10 lines
Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yaml new file +10
-0+ - aspeed,ast2600-fmc + - aspeed,ast2600-spi + + reg: + items: + - description: the control register location and length + - description: the flash memory mapping address and length + + clocks: + description: AHB bus clock which will be converted to SPI bus clock
Need to define how many clocks (maxItems: 1).
Quoted 34 lines
Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yaml new file +31
-0+ +required: + - compatible + - reg + - clocks + - num-cs + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/clock/ast2600-clock.h> + spi1: spi at 1e630000 { + compatible = "aspeed,ast2600-spi"; + reg = <0x1e630000 0xc4>, <0x30000000 0x10000000>; + reg-names = "spi_ctrl_reg", "spi_mmap"; + clocks = <&syscon ASPEED_CLK_AHB>; + num-cs = <2>; + #address-cells = <1>; + #size-cells = <0>; + flash at 0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + }; + flash at 1 { + compatible = "jedec,spi-nor"; + reg = <1>; + spi-max-frequency = <50000000>; + }; + };Signature · 1 line
2.17.1
RE: [v2 1/4] dt-bindings: spi: Add binding file for ASPEED FMC/SPI memory controller
Hi Rob,
Quoted 60 lines
-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Friday, November 6, 2020 2:41 AM
To: Chin-Ting Kuo <[email protected]>
Cc: broonie at kernel.org; joel at jms.id.au; andrew at aj.id.au; clg at kaod.org; bbrezillon at kernel.org; devicetree at vger.kernel.org;
linux-kernel at vger.kernel.org; linux-aspeed at lists.ozlabs.org; linux-spi at vger.kernel.org; BMC-SW <[email protected]>
Subject: Re: [v2 1/4] dt-bindings: spi: Add binding file for ASPEED FMC/SPI memory controllerQuoted 1 line · Chin-Ting Kuo
Create binding file with YAML syntax for ASPEED FMC/SPI memory
controller.
Quoted 4 lines
Signed-off-by Chin-Ting Kuo <[email protected]>--- .../bindings/spi/aspeed,spi-aspeed.yaml | 66+++++++++++++++++++
Quoted 41 lines
1 file changed, 66 insertions(+) create mode 100644
Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yamldiff --git
a/Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yamlb/Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yamlnew file mode 100644
index 000000000000..41b9692c7226Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yaml new file +29
-0@@ -0,0 +1,66 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/aspeed,spi-aspeed.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SPI memory controller for ASPEED SoCs + +maintainers: + - Chin-Ting Kuo <[email protected]> + +description: | + There are three SPI memory controllers embedded in a ASPEED SoC. + They are usually connected to SPI NOR flashes. Each of them has + more than a chip select. They also support SPI single, dual and + quad IO modes for SPI NOR flash. + +allOf: + - $ref: /spi/spi-controller.yaml# + +properties: + compatible: + oneOf: + - items: + - enum: + - aspeed,ast2600-fmc + - aspeed,ast2600-spi + + reg: + items:
Quoted 8 lines
Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yaml
Quoted 6 lines
Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yaml new file +6
-0+ - description: the control register location and length + - description: the flash memory mapping address and length + + clocks: + description: AHB bus clock which will be converted to SPI bus + clockNeed to define how many clocks (maxItems: 1).
Okay, it will be added on the next patch version.
Quoted 26 lines
Quoted 26 lines
Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yaml new file +26
-0+ +required: + - compatible + - reg + - clocks + - num-cs + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/clock/ast2600-clock.h> + spi1: spi at 1e630000 { + compatible = "aspeed,ast2600-spi"; + reg = <0x1e630000 0xc4>, <0x30000000 0x10000000>; + reg-names = "spi_ctrl_reg", "spi_mmap"; + clocks = <&syscon ASPEED_CLK_AHB>; + num-cs = <2>; + #address-cells = <1>; + #size-cells = <0>; + flash at 0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + }; + flash at 1 {
Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/spi/aspeed,spi-aspeed.yaml new file +5
-1+ compatible = "jedec,spi-nor"; + reg = <1>; + spi-max-frequency = <50000000>; + }; + }; --2.17.1
Best Wishes,
Chin-Ting
PATCH v2 2/4 ARM: dts: aspeed: ast2600: Update FMC/SPI controller setting for spi-aspeed.c
In reply to Chin-Ting Kuo- Adjust the value format of "reg" property:
Instead of platform_get_resource(), platform_get_resource_byname() function can be used for more human-readable.
- Add "num-cs" property for FMC/SPI controller:
Each ASPEED FMC/SPI memory controller can support more than a chip select. By "num-cs" property, FMC/SPI controller driver can know how many chip select related registers should be initialized at the probe stage. Besdies, with this property, driver can avoid accessing chip select which CS number is larger than the maximum one supported by the controller.
--- arch/arm/boot/dts/aspeed-g6.dtsi | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
arch/arm/boot/dts/aspeed-g6.dtsi +12 -6
@@ -89,14 +89,16 @@ }; fmc: spi at 1e620000 { - reg = < 0x1e620000 0xc4 - 0x20000000 0x10000000 >; + reg = <0x1e620000 0xc4>, + <0x20000000 0x10000000>; + reg-names = "spi_ctrl_reg", "spi_mmap"; #address-cells = <1>; #size-cells = <0>; compatible = "aspeed,ast2600-fmc"; clocks = <&syscon ASPEED_CLK_AHB>; status = "disabled"; interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>; + num-cs = <3>; flash at 0 { reg = < 0 >; compatible = "jedec,spi-nor";
@@ -118,12 +120,14 @@ }; spi1: spi at 1e630000 { - reg = < 0x1e630000 0xc4 - 0x30000000 0x10000000 >; + reg = <0x1e630000 0xc4>, + <0x30000000 0x10000000>; + reg-names = "spi_ctrl_reg", "spi_mmap"; #address-cells = <1>; #size-cells = <0>; compatible = "aspeed,ast2600-spi"; clocks = <&syscon ASPEED_CLK_AHB>; + num-cs = <2>; status = "disabled"; flash at 0 { reg = < 0 >;
@@ -140,12 +144,14 @@ }; spi2: spi at 1e631000 { - reg = < 0x1e631000 0xc4 - 0x50000000 0x10000000 >; + reg = < 0x1e631000 0xc4>, + <0x50000000 0x10000000>; + reg-names = "spi_ctrl_reg", "spi_mmap"; #address-cells = <1>; #size-cells = <0>; compatible = "aspeed,ast2600-spi"; clocks = <&syscon ASPEED_CLK_AHB>; + num-cs = <3>; status = "disabled"; flash at 0 { reg = < 0 >;
Signature · 1 line
2.17.1
PATCH v2 3/4 ARM: dts: aspeed: ast2600-evb: Adjust SPI flash configuration
In reply to Chin-Ting Kuo- Enable FMC CS1 and SPI2 CS0 SPI NOR flashes since both of these two flashes are mounted on AST2600 EVB by default.
- Remove spi-max-frequency setting: 50MHz is usual SPI bus frequency adopted on AST2600 EVB which has already been configured in aspeed-g6.dtsi.
--- arch/arm/boot/dts/aspeed-ast2600-evb.dts | 26 ++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-)
arch/arm/boot/dts/aspeed-ast2600-evb.dts +22 -4
@@ -96,12 +96,11 @@ &fmc { status = "okay"; + flash at 0 { status = "okay"; m25p,fast-read; label = "bmc"; - spi-max-frequency = <50000000>; - partitions { compatible = "fixed-partitions"; #address-cells = <1>;
@@ -133,18 +132,37 @@ }; }; }; + + flash at 1 { + status = "okay"; + m25p,fast-read; + label = "fmc0:1"; + }; }; &spi1 { status = "okay"; + pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi1_default>; flash at 0 { status = "okay"; m25p,fast-read; - label = "pnor"; - spi-max-frequency = <100000000>; + label = "spi1:0"; + }; +}; + +&spi2 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_spi2_default>; + + flash at 0 { + status = "okay"; + m25p,fast-read; + label = "spi2:0"; }; };
Signature · 1 line
2.17.1
PATCH v2 4/4 spi: aspeed: Add ASPEED FMC/SPI memory controller driver
In reply to Chin-Ting KuoAdd driver for ASPEED BMC FMC/SPI memory controller which supports spi-mem interface.
There are three SPI memory controllers embedded in an ASPEED SoC. Each of them can connect to two or three SPI NOR flashes. The first SPI memory controller is also named as Firmware Memory Controller (FMC), which is similar to SPI memory controller. After device AC on, MCU ROM can fetch device boot code from FMC CS 0. Thus, there exists additional registers for boot process control in FMC.
ASPEED SPI memory controller supports single, dual and quad mode for SPI NOR flash. It also supports two types of command mode, user mode and command read/write mode. User mode is traditional pure SPI operations where all transmission is controlled by CPU. Contrarily, with command read/write mode, SPI controller can send command and address automatically when CPU read/write related remapped address.
Besides, different wafer processes of SPI NOR flash result in different signal response time. This phenomenon will be enlarged when SPI clock frequency increases. ASPEED SPI memory controller provides a mechanism for timing compensation in order to satisfy various SPI NOR flash parts and PCB layout.
---
v2: Fix sparse warnings reported by kernel test robot <[email protected]>.
drivers/spi/Kconfig | 10 + drivers/spi/Makefile | 1 + drivers/spi/spi-aspeed.c | 969 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 980 insertions(+) create mode 100644 drivers/spi/spi-aspeed.c
drivers/spi/Kconfig +10 -0
@@ -70,6 +70,16 @@ config SPI_AR934X This enables support for the SPI controller present on the Qualcomm Atheros AR934X/QCA95XX SoCs. +config SPI_ASPEED + tristate "ASPEED FMC/SPI Memory Controller" + depends on OF && HAS_IOMEM + help + Enable driver for ASPEED FMC/SPI Memory Controller. + + This driver is not a generic pure SPI driver, which + is especially designed for spi-mem framework with + SPI NOR flash direct read and write features. + config SPI_ATH79 tristate "Atheros AR71XX/AR724X/AR913X SPI controller driver" depends on ATH79 || COMPILE_TEST
drivers/spi/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_SPI_LOOPBACK_TEST) += spi-loopback-test.o 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_ASPEED) += spi-aspeed.o obj-$(CONFIG_SPI_ATMEL) += spi-atmel.o obj-$(CONFIG_SPI_ATMEL_QUADSPI) += atmel-quadspi.o obj-$(CONFIG_SPI_AT91_USART) += spi-at91-usart.o
drivers/spi/spi-aspeed.c new file +969 -0
969 lines not on this page · raw message
Signature · 1 line
2.17.1
Mark Brown
maintainerRe: [v2 4/4] spi: aspeed: Add ASPEED FMC/SPI memory controller driver
Quoted 2 lines · Chin-Ting Kuo
Add driver for ASPEED BMC FMC/SPI memory controller which supports spi-mem interface.
This breaks the build for me with an x86 allmodconfig:
/mnt/kernel/drivers/spi/spi-aspeed.c: In function 'aspeed_2600_spi_dma_checksum':/mnt/kernel/drivers/spi/spi-aspeed.c:195:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
writel((uint32_t)ast_ctrl->chips[cs].ahb_base_phy,
^
/mnt/kernel/drivers/spi/spi-aspeed.c: In function 'aspeed_spi_decode_range_config':
/mnt/kernel/drivers/spi/spi-aspeed.c:488:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
chip[cs].ahb_base_phy = (void __iomem *)start_addr_phy;
^In file included from /mnt/kernel/include/linux/printk.h:409,
from /mnt/kernel/include/linux/kernel.h:16,
from /mnt/kernel/include/linux/clk.h:13,
from /mnt/kernel/drivers/spi/spi-aspeed.c:11:/mnt/kernel/drivers/spi/spi-aspeed.c: In function 'aspeed_spi_exec_op':/mnt/kernel/drivers/spi/spi-aspeed.c:619:44: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ctrl_val, addr_mode_reg, addr_data_mask, (uint32_t)op_addr);
^
/mnt/kernel/include/linux/dynamic_debug.h:129:15: note: in definition of macro '__dynamic_func_call'
func(&id, ##__VA_ARGS__); \
^~~~~~~~~~~/mnt/kernel/include/linux/dynamic_debug.h:161:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, \
^~~~~~~~~~~~~~~~~~/mnt/kernel/include/linux/dev_printk.h:123:2: note: in expansion of macro 'dynamic_dev_dbg'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~~~~/mnt/kernel/drivers/spi/spi-aspeed.c:618:2: note: in expansion of macro 'dev_dbg'
dev_dbg(dev, "ctrl: 0x%08x, addr_mode: 0x%x, mask: 0x%x, addr:0x%08x\n",
^~~~~~~/mnt/kernel/drivers/spi/spi-aspeed.c: In function 'aspeed_spi_dirmap_read':/mnt/kernel/drivers/spi/spi-aspeed.c:651:25: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
dev_dbg(ast_ctrl->dev, "read op:0x%x, addr:0x%llx, len:0x%x\n",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mnt/kernel/include/linux/dynamic_debug.h:129:15: note: in definition of macro '__dynamic_func_call'
func(&id, ##__VA_ARGS__); \
^~~~~~~~~~~/mnt/kernel/include/linux/dynamic_debug.h:161:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, \
^~~~~~~~~~~~~~~~~~/mnt/kernel/include/linux/dev_printk.h:123:2: note: in expansion of macro 'dynamic_dev_dbg'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~~~~/mnt/kernel/include/linux/dev_printk.h:123:23: note: in expansion of macro 'dev_fmt'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
/mnt/kernel/drivers/spi/spi-aspeed.c:651:2: note: in expansion of macro 'dev_dbg'
dev_dbg(ast_ctrl->dev, "read op:0x%x, addr:0x%llx, len:0x%x\n",
^~~~~~~/mnt/kernel/drivers/spi/spi-aspeed.c: In function 'aspeed_spi_dirmap_write':/mnt/kernel/drivers/spi/spi-aspeed.c:676:25: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
dev_dbg(ast_ctrl->dev, "write op:0x%x, addr:0x%llx, len:0x%x\n",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mnt/kernel/include/linux/dynamic_debug.h:129:15: note: in definition of macro '__dynamic_func_call'
func(&id, ##__VA_ARGS__); \
^~~~~~~~~~~/mnt/kernel/include/linux/dynamic_debug.h:161:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, \
^~~~~~~~~~~~~~~~~~/mnt/kernel/include/linux/dev_printk.h:123:2: note: in expansion of macro 'dynamic_dev_dbg'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~~~~/mnt/kernel/include/linux/dev_printk.h:123:23: note: in expansion of macro 'dev_fmt'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
/mnt/kernel/drivers/spi/spi-aspeed.c:676:2: note: in expansion of macro 'dev_dbg'
dev_dbg(ast_ctrl->dev, "write op:0x%x, addr:0x%llx, len:0x%x\n",
^~~~~~~/mnt/kernel/drivers/spi/spi-aspeed.c: At top level:/mnt/kernel/drivers/spi/spi-aspeed.c:820:17: error: initialization of 'ssize_t (*)(struct spi_mem_dirmap_desc *, u64, size_t, void *)' {aka 'long int (*)(struct spi_mem_dirmap_desc *, long long unsigned int, long unsigned int, void *)'} from incompatible pointer type 'int (*)(struct spi_mem_dirmap_desc *, uint64_t, size_t, void *)' {aka 'int (*)(struct spi_mem_dirmap_desc *, long long unsigned int, long unsigned int, void *)'} [-Werror=incompatible-pointer-types]
.dirmap_read = aspeed_spi_dirmap_read,
^~~~~~~~~~~~~~~~~~~~~~
/mnt/kernel/drivers/spi/spi-aspeed.c:820:17: note: (near initialization for 'aspeed_spi_mem_ops.dirmap_read')
/mnt/kernel/drivers/spi/spi-aspeed.c:821:18: error: initialization of 'ssize_t (*)(struct spi_mem_dirmap_desc *, u64, size_t, const void *)' {aka 'long int (*)(struct spi_mem_dirmap_desc *, long long unsigned int, long unsigned int, const void *)'} from incompatible pointer type 'int (*)(struct spi_mem_dirmap_desc *, uint64_t, size_t, const void *)' {aka 'int (*)(struct spi_mem_dirmap_desc *, long long unsigned int, long unsigned int, const void *)'} [-Werror=incompatible-pointer-types]
.dirmap_write = aspeed_spi_dirmap_write,
^~~~~~~~~~~~~~~~~~~~~~~/mnt/kernel/drivers/spi/spi-aspeed.c:821:18: note: (near initialization for 'aspeed_spi_mem_ops.dirmap_write')
cc1: some warnings being treated as errors
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20201104/35ff5d1c/attachment.sig>
RE: [v2 4/4] spi: aspeed: Add ASPEED FMC/SPI memory controller driver
Hi Mark,
Thanks for your comment.
Quoted 11 lines
-----Original Message-----
From: Mark Brown <[email protected]>
Sent: Thursday, November 5, 2020 4:40 AM
To: Chin-Ting Kuo <[email protected]>
Cc: robh+dt at kernel.org; joel at jms.id.au; andrew at aj.id.au; clg at kaod.org; bbrezillon at kernel.org; devicetree at vger.kernel.org;
linux-kernel at vger.kernel.org; linux-aspeed at lists.ozlabs.org; linux-spi at vger.kernel.org; BMC-SW <[email protected]>
Subject: Re: [v2 4/4] spi: aspeed: Add ASPEED FMC/SPI memory controller driver
Quoted 5 lines
Quoted 2 lines · Chin-Ting Kuo
Add driver for ASPEED BMC FMC/SPI memory controller which supports spi-mem interface.
This breaks the build for me with an x86 allmodconfig:
I will fix these problems on the next patch version.
Quoted 115 lines
/mnt/kernel/drivers/spi/spi-aspeed.c: In function 'aspeed_2600_spi_dma_checksum':/mnt/kernel/drivers/spi/spi-aspeed.c:195:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
writel((uint32_t)ast_ctrl->chips[cs].ahb_base_phy,^
/mnt/kernel/drivers/spi/spi-aspeed.c: In function 'aspeed_spi_decode_range_config':/mnt/kernel/drivers/spi/spi-aspeed.c:488:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]chip[cs].ahb_base_phy = (void __iomem *)start_addr_phy; ^In file included from
/mnt/kernel/include/linux/printk.h:409,
from/mnt/kernel/include/linux/kernel.h:16, from/mnt/kernel/include/linux/clk.h:13,
from/mnt/kernel/drivers/spi/spi-aspeed.c:11:/mnt/kernel/drivers/spi/spi-aspeed.c: In function 'aspeed_spi_exec_op':/mnt/kernel/drivers/spi/spi-aspeed.c:619:44: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]ctrl_val, addr_mode_reg, addr_data_mask, (uint32_t)op_addr); ^ /mnt/kernel/include/linux/dynamic_debug.h:129:15: note: in definition of macro '__dynamic_func_call' func(&id, ##__VA_ARGS__); \ ^~~~~~~~~~~
/mnt/kernel/include/linux/dynamic_debug.h:161:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, \
^~~~~~~~~~~~~~~~~~/mnt/kernel/include/linux/dev_printk.h:123:2: note: in expansion of macro 'dynamic_dev_dbg'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)^~~~~~~~~~~~~~~/mnt/kernel/drivers/spi/spi-aspeed.c:618:2: note: in expansion of macro 'dev_dbg'
dev_dbg(dev, "ctrl: 0x%08x,addr_mode: 0x%x, mask: 0x%x, addr:0x%08x\n", ^~~~~~~/mnt/kernel/drivers/spi/spi-aspeed.c: In function 'aspeed_spi_dirmap_read':/mnt/kernel/drivers/spi/spi-aspeed.c:651:25: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
dev_dbg(ast_ctrl->dev, "read op:0x%x, addr:0x%llx, len:0x%x\n",^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /mnt/kernel/include/linux/dynamic_debug.h:129:15: note: in definition of macro '__dynamic_func_call' func(&id, ##__VA_ARGS__); \ ^~~~~~~~~~~
/mnt/kernel/include/linux/dynamic_debug.h:161:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, \
^~~~~~~~~~~~~~~~~~/mnt/kernel/include/linux/dev_printk.h:123:2: note: in expansion of macro 'dynamic_dev_dbg'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)^~~~~~~~~~~~~~~/mnt/kernel/include/linux/dev_printk.h:123:23: note: in expansion of macro 'dev_fmt'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)^~~~~~~
/mnt/kernel/drivers/spi/spi-aspeed.c:651:2: note: in expansion of macro 'dev_dbg'
dev_dbg(ast_ctrl->dev, "read op:0x%x, addr:0x%llx, len:0x%x\n", ^~~~~~~/mnt/kernel/drivers/spi/spi-aspeed.c: In function 'aspeed_spi_dirmap_write':/mnt/kernel/drivers/spi/spi-aspeed.c:676:25: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
dev_dbg(ast_ctrl->dev, "write op:0x%x, addr:0x%llx, len:0x%x\n",^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mnt/kernel/include/linux/dynamic_debug.h:129:15: note: in definition of macro '__dynamic_func_call'func(&id, ##__VA_ARGS__); \ ^~~~~~~~~~~
/mnt/kernel/include/linux/dynamic_debug.h:161:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, \
^~~~~~~~~~~~~~~~~~/mnt/kernel/include/linux/dev_printk.h:123:2: note: in expansion of macro 'dynamic_dev_dbg'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)^~~~~~~~~~~~~~~/mnt/kernel/include/linux/dev_printk.h:123:23: note: in expansion of macro 'dev_fmt'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)^~~~~~~
/mnt/kernel/drivers/spi/spi-aspeed.c:676:2: note: in expansion of macro 'dev_dbg'
dev_dbg(ast_ctrl->dev, "write op:0x%x, addr:0x%llx, len:0x%x\n", ^~~~~~~/mnt/kernel/drivers/spi/spi-aspeed.c: At top level:/mnt/kernel/drivers/spi/spi-aspeed.c:820:17: error: initialization of 'ssize_t(*)(structspi_mem_dirmap_desc*, u64,size_t, void *)' {aka 'long int (*)(structspi_mem_dirmap_desc*, long long unsigned int, long unsigned int, void *)'} from incompatible pointer type 'int (*)(structspi_mem_dirmap_desc*,uint64_t,size_t, void *)' {aka 'int (*)(structspi_mem_dirmap_desc*, long long unsigned int, long unsigned int, void *)'} [-Werror=incompatible-pointer-types]
.dirmap_read =aspeed_spi_dirmap_read,^~~~~~~~~~~~~~~~~~~~~~
/mnt/kernel/drivers/spi/spi-aspeed.c:820:17: note: (near initialization for 'aspeed_spi_mem_ops.dirmap_read')/mnt/kernel/drivers/spi/spi-aspeed.c:821:18: error: initialization of 'ssize_t(*)(structspi_mem_dirmap_desc*, u64,size_t, const void *)' {aka 'long int (*)(structspi_mem_dirmap_desc*, long long unsigned int, long unsigned int, const void *)'} from incompatible pointer type 'int (*)(structspi_mem_dirmap_desc*,uint64_t,size_t, const void *)' {aka 'int (*)(structspi_mem_dirmap_desc*, long long unsigned int, long unsigned int, const void *)'} [-Werror=incompatible-pointer-types]
.dirmap_write =aspeed_spi_dirmap_write,^~~~~~~~~~~~~~~~~~~~~~~
/mnt/kernel/drivers/spi/spi-aspeed.c:821:18: note: (near initialization for 'aspeed_spi_mem_ops.dirmap_write')
cc1: some warnings being treated as errors
Mark Brown
maintainerQuoted 8 lines · Chin-Ting Kuo
This patch series aims to porting ASPEED FMC/SPI memory controller driver with spi-mem interface. Adjust device tree setting of SPI NOR flash in order to fit real AST2600 EVB and new SPI memory controller driver. Also, this patch has been verified on AST2600-A1 EVB.
v2: Fix sparse warnings reported by kernel test robot <[email protected]>.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] dt-bindings: spi: Add binding file for ASPEED FMC/SPI memory controller
(no commit info)
[2/2] spi: aspeed: Add ASPEED FMC/SPI memory controller driver
(no commit info)
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Joel Stanley
maintainerQuoted 7 lines · Mark Brown
Quoted 5 lines · Chin-Ting Kuo
This patch series aims to porting ASPEED FMC/SPI memory controller driver with spi-mem interface. Adjust device tree setting of SPI NOR flash in order to fit real AST2600 EVB and new SPI memory controller driver. Also, this patch has been verified on AST2600-A1 EVB.
Quoted 7 lines
Quoted 3 lines
v2: Fix sparse warnings reported by kernel test robot <[email protected]>.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Really? Or is there a bug in one of your scripts :)
Cheers,
Joel
Quoted 26 lines
Thanks!
[1/2] dt-bindings: spi: Add binding file for ASPEED FMC/SPI memory controller
(no commit info)
[2/2] spi: aspeed: Add ASPEED FMC/SPI memory controller driver
(no commit info)All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Mark Brown
maintainerQuoted 7 lines · Joel Stanley
Quoted 3 lines · Mark Brown
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Really? Or is there a bug in one of your scripts :)
Not my scripts, b4!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20201203/007fd885/attachment.sig>