linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/3] dt-bindings: mtd: mtk-quadspi: update bindings for MT7629 SoC
@ 2019-01-14  5:12 Ryder Lee
  2019-01-14  5:12 ` [PATCH v1 2/3] mtd: spi-nor: mtk-quadspi: add SNOR_HWCAPS_READ for capcity setting Ryder Lee
  2019-01-14  5:12 ` [PATCH v1 3/3] mtd: spi-nor: mtk-quadspi: rename config to a common one Ryder Lee
  0 siblings, 2 replies; 7+ messages in thread
From: Ryder Lee @ 2019-01-14  5:12 UTC (permalink / raw)
  To: Marek Vasut, Brian Norris, Boris Brezillon
  Cc: Rob Herring, Weijie Gao, linux-mtd, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, Ryder Lee

This updates bindings for the MT7629 SPI-NOR controller.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Changes since v1: add a Reviewed-by tag. 
---
 Documentation/devicetree/bindings/mtd/mtk-quadspi.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mtd/mtk-quadspi.txt b/Documentation/devicetree/bindings/mtd/mtk-quadspi.txt
index 56d3668..a12e3b5 100644
--- a/Documentation/devicetree/bindings/mtd/mtk-quadspi.txt
+++ b/Documentation/devicetree/bindings/mtd/mtk-quadspi.txt
@@ -1,4 +1,4 @@
-* Serial NOR flash controller for MTK MT81xx (and similar)
+* Serial NOR flash controller for MediaTek SoCs
 
 Required properties:
 - compatible: 	  For mt8173, compatible should be "mediatek,mt8173-nor",
@@ -10,6 +10,7 @@ Required properties:
 		  "mediatek,mt2712-nor", "mediatek,mt8173-nor"
 		  "mediatek,mt7622-nor", "mediatek,mt8173-nor"
 		  "mediatek,mt7623-nor", "mediatek,mt8173-nor"
+		  "mediatek,mt7629-nor", "mediatek,mt8173-nor"
 		  "mediatek,mt8173-nor"
 - reg: 		  physical base address and length of the controller's register
 - clocks: 	  the phandle of the clocks needed by the nor controller
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v1 2/3] mtd: spi-nor: mtk-quadspi: add SNOR_HWCAPS_READ for capcity setting
  2019-01-14  5:12 [PATCH v1 1/3] dt-bindings: mtd: mtk-quadspi: update bindings for MT7629 SoC Ryder Lee
@ 2019-01-14  5:12 ` Ryder Lee
  2019-01-15  6:59   ` Tudor.Ambarus
  2019-01-14  5:12 ` [PATCH v1 3/3] mtd: spi-nor: mtk-quadspi: rename config to a common one Ryder Lee
  1 sibling, 1 reply; 7+ messages in thread
From: Ryder Lee @ 2019-01-14  5:12 UTC (permalink / raw)
  To: Marek Vasut, Brian Norris, Boris Brezillon
  Cc: Rob Herring, Weijie Gao, linux-mtd, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, Guochun Mao

From: Guochun Mao <guochun.mao@mediatek.com>

SNOR_HWCAPS_READ is a basic read mode for both flash and controller,
it should be supported, so add the capcity for mtk-quadspi.

Signed-off-by: Guochun Mao <guochun.mao@mediatek.com>
---
Changes since v1: none. 
---
 drivers/mtd/spi-nor/mtk-quadspi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi-nor/mtk-quadspi.c b/drivers/mtd/spi-nor/mtk-quadspi.c
index 5442993..d9eed68 100644
--- a/drivers/mtd/spi-nor/mtk-quadspi.c
+++ b/drivers/mtd/spi-nor/mtk-quadspi.c
@@ -431,7 +431,8 @@ static int mtk_nor_init(struct mtk_nor *mtk_nor,
 			struct device_node *flash_node)
 {
 	const struct spi_nor_hwcaps hwcaps = {
-		.mask = SNOR_HWCAPS_READ_FAST |
+		.mask = SNOR_HWCAPS_READ |
+			SNOR_HWCAPS_READ_FAST |
 			SNOR_HWCAPS_READ_1_1_2 |
 			SNOR_HWCAPS_PP,
 	};
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v1 3/3] mtd: spi-nor: mtk-quadspi: rename config to a common one
  2019-01-14  5:12 [PATCH v1 1/3] dt-bindings: mtd: mtk-quadspi: update bindings for MT7629 SoC Ryder Lee
  2019-01-14  5:12 ` [PATCH v1 2/3] mtd: spi-nor: mtk-quadspi: add SNOR_HWCAPS_READ for capcity setting Ryder Lee
@ 2019-01-14  5:12 ` Ryder Lee
  2019-01-15  7:34   ` Tudor.Ambarus
  1 sibling, 1 reply; 7+ messages in thread
From: Ryder Lee @ 2019-01-14  5:12 UTC (permalink / raw)
  To: Marek Vasut, Brian Norris, Boris Brezillon
  Cc: Rob Herring, Weijie Gao, linux-mtd, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, Ryder Lee

The quadspi is a generic communication interface which could be shared
with other MediaTek SoCs. Hence rename it to a common one.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
Changes since v1: rebase to v5.0-rc1. 
---
 drivers/mtd/spi-nor/Kconfig  | 16 ++++++++--------
 drivers/mtd/spi-nor/Makefile |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
index b433e5f..99d9d53 100644
--- a/drivers/mtd/spi-nor/Kconfig
+++ b/drivers/mtd/spi-nor/Kconfig
@@ -7,14 +7,6 @@ menuconfig MTD_SPI_NOR
 
 if MTD_SPI_NOR
 
-config MTD_MT81xx_NOR
-	tristate "Mediatek MT81xx SPI NOR flash controller"
-	depends on HAS_IOMEM
-	help
-	  This enables access to SPI NOR flash, using MT81xx SPI NOR flash
-	  controller. This controller does not support generic SPI BUS, it only
-	  supports SPI NOR Flash.
-
 config MTD_SPI_NOR_USE_4K_SECTORS
 	bool "Use small 4096 B erase sectors"
 	default y
@@ -68,6 +60,14 @@ config SPI_NXP_SPIFI
 	  Flash. Enable this option if you have a device with a SPIFI
 	  controller and want to access the Flash as a mtd device.
 
+config SPI_MTK_QUADSPI
+	tristate "MediaTek Quad SPI controller"
+	depends on HAS_IOMEM
+	help
+	  This enables support for the Quad SPI controller in master mode.
+	  This controller does not support generic SPI. It only supports
+	  SPI NOR.
+
 config SPI_INTEL_SPI
 	tristate
 
diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile
index 2adedbe..189a15c 100644
--- a/drivers/mtd/spi-nor/Makefile
+++ b/drivers/mtd/spi-nor/Makefile
@@ -3,7 +3,7 @@ obj-$(CONFIG_MTD_SPI_NOR)	+= spi-nor.o
 obj-$(CONFIG_SPI_ASPEED_SMC)	+= aspeed-smc.o
 obj-$(CONFIG_SPI_CADENCE_QUADSPI)	+= cadence-quadspi.o
 obj-$(CONFIG_SPI_HISI_SFC)	+= hisi-sfc.o
-obj-$(CONFIG_MTD_MT81xx_NOR)    += mtk-quadspi.o
+obj-$(CONFIG_SPI_MTK_QUADSPI)    += mtk-quadspi.o
 obj-$(CONFIG_SPI_NXP_SPIFI)	+= nxp-spifi.o
 obj-$(CONFIG_SPI_INTEL_SPI)	+= intel-spi.o
 obj-$(CONFIG_SPI_INTEL_SPI_PCI)	+= intel-spi-pci.o
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 2/3] mtd: spi-nor: mtk-quadspi: add SNOR_HWCAPS_READ for capcity setting
  2019-01-14  5:12 ` [PATCH v1 2/3] mtd: spi-nor: mtk-quadspi: add SNOR_HWCAPS_READ for capcity setting Ryder Lee
@ 2019-01-15  6:59   ` Tudor.Ambarus
  2019-01-15  7:44     ` Guochun Mao
  0 siblings, 1 reply; 7+ messages in thread
From: Tudor.Ambarus @ 2019-01-15  6:59 UTC (permalink / raw)
  To: ryder.lee, marek.vasut, computersforpeace, boris.brezillon
  Cc: robh+dt, weijie.gao, linux-mtd, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, guochun.mao

Hi, Ryder,

On 01/14/2019 07:12 AM, Ryder Lee wrote:
> From: Guochun Mao <guochun.mao@mediatek.com>
> 
> SNOR_HWCAPS_READ is a basic read mode for both flash and controller,
> it should be supported, so add the capcity for mtk-quadspi.

Since I couldn't find a datasheet for mt8173, I tend to share your assumption -
SNOR_HWCAPS_READ should be supported by this controller. However, it's always
better to test it and not rely on assumptions. You can test it by forcing the
mask to have just SNOR_HWCAPS_READ | SNOR_HWCAPS_PP set. Or you already tested it?

You have a typo in capcity. Maybe substitute it with capability or "add this
flag to spi_nor_hwcaps mask"

> 
> Signed-off-by: Guochun Mao <guochun.mao@mediatek.com>

You should add your SoB tag, because you are sending a patch that is not yours.

Cheers,
ta

> ---
> Changes since v1: none. 
> ---
>  drivers/mtd/spi-nor/mtk-quadspi.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/spi-nor/mtk-quadspi.c b/drivers/mtd/spi-nor/mtk-quadspi.c
> index 5442993..d9eed68 100644
> --- a/drivers/mtd/spi-nor/mtk-quadspi.c
> +++ b/drivers/mtd/spi-nor/mtk-quadspi.c
> @@ -431,7 +431,8 @@ static int mtk_nor_init(struct mtk_nor *mtk_nor,
>  			struct device_node *flash_node)
>  {
>  	const struct spi_nor_hwcaps hwcaps = {
> -		.mask = SNOR_HWCAPS_READ_FAST |
> +		.mask = SNOR_HWCAPS_READ |
> +			SNOR_HWCAPS_READ_FAST |
>  			SNOR_HWCAPS_READ_1_1_2 |
>  			SNOR_HWCAPS_PP,
>  	};
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 3/3] mtd: spi-nor: mtk-quadspi: rename config to a common one
  2019-01-14  5:12 ` [PATCH v1 3/3] mtd: spi-nor: mtk-quadspi: rename config to a common one Ryder Lee
@ 2019-01-15  7:34   ` Tudor.Ambarus
  2019-01-15  7:57     ` Ryder Lee
  0 siblings, 1 reply; 7+ messages in thread
From: Tudor.Ambarus @ 2019-01-15  7:34 UTC (permalink / raw)
  To: ryder.lee, marek.vasut, computersforpeace, boris.brezillon
  Cc: robh+dt, weijie.gao, linux-mtd, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek

Hi, Ryder,

On 01/14/2019 07:12 AM, Ryder Lee wrote:
> The quadspi is a generic communication interface which could be shared
> with other MediaTek SoCs. Hence rename it to a common one.
> 
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> ---
> Changes since v1: rebase to v5.0-rc1. 

The patch doesn't apply on v5.0-rc1 or rc2.

> ---
>  drivers/mtd/spi-nor/Kconfig  | 16 ++++++++--------
>  drivers/mtd/spi-nor/Makefile |  2 +-
>  2 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
> index b433e5f..99d9d53 100644
> --- a/drivers/mtd/spi-nor/Kconfig
> +++ b/drivers/mtd/spi-nor/Kconfig
> @@ -7,14 +7,6 @@ menuconfig MTD_SPI_NOR
>  
>  if MTD_SPI_NOR
>  
> -config MTD_MT81xx_NOR
> -	tristate "Mediatek MT81xx SPI NOR flash controller"
> -	depends on HAS_IOMEM
> -	help
> -	  This enables access to SPI NOR flash, using MT81xx SPI NOR flash
> -	  controller. This controller does not support generic SPI BUS, it only
> -	  supports SPI NOR Flash.
> -
>  config MTD_SPI_NOR_USE_4K_SECTORS
>  	bool "Use small 4096 B erase sectors"
>  	default y
> @@ -68,6 +60,14 @@ config SPI_NXP_SPIFI
>  	  Flash. Enable this option if you have a device with a SPIFI
>  	  controller and want to access the Flash as a mtd device.
>  
> +config SPI_MTK_QUADSPI

Since you are moving the config into the file, would you mind to put your config
in an alphabetical order?

Thanks,
ta

> +	tristate "MediaTek Quad SPI controller"
> +	depends on HAS_IOMEM
> +	help
> +	  This enables support for the Quad SPI controller in master mode.
> +	  This controller does not support generic SPI. It only supports
> +	  SPI NOR.
> +
>  config SPI_INTEL_SPI
>  	tristate
>  
> diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile
> index 2adedbe..189a15c 100644
> --- a/drivers/mtd/spi-nor/Makefile
> +++ b/drivers/mtd/spi-nor/Makefile
> @@ -3,7 +3,7 @@ obj-$(CONFIG_MTD_SPI_NOR)	+= spi-nor.o
>  obj-$(CONFIG_SPI_ASPEED_SMC)	+= aspeed-smc.o
>  obj-$(CONFIG_SPI_CADENCE_QUADSPI)	+= cadence-quadspi.o
>  obj-$(CONFIG_SPI_HISI_SFC)	+= hisi-sfc.o
> -obj-$(CONFIG_MTD_MT81xx_NOR)    += mtk-quadspi.o
> +obj-$(CONFIG_SPI_MTK_QUADSPI)    += mtk-quadspi.o
>  obj-$(CONFIG_SPI_NXP_SPIFI)	+= nxp-spifi.o
>  obj-$(CONFIG_SPI_INTEL_SPI)	+= intel-spi.o
>  obj-$(CONFIG_SPI_INTEL_SPI_PCI)	+= intel-spi-pci.o
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 2/3] mtd: spi-nor: mtk-quadspi: add SNOR_HWCAPS_READ for capcity setting
  2019-01-15  6:59   ` Tudor.Ambarus
@ 2019-01-15  7:44     ` Guochun Mao
  0 siblings, 0 replies; 7+ messages in thread
From: Guochun Mao @ 2019-01-15  7:44 UTC (permalink / raw)
  To: Tudor.Ambarus
  Cc: ryder.lee, marek.vasut, computersforpeace, boris.brezillon,
	robh+dt, weijie.gao, linux-mtd, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek

On Tue, 2019-01-15 at 06:59 +0000, Tudor.Ambarus@microchip.com wrote:
> Hi, Ryder,
> 
> On 01/14/2019 07:12 AM, Ryder Lee wrote:
> > From: Guochun Mao <guochun.mao@mediatek.com>
> > 
> > SNOR_HWCAPS_READ is a basic read mode for both flash and controller,
> > it should be supported, so add the capcity for mtk-quadspi.
> 
> Since I couldn't find a datasheet for mt8173, I tend to share your assumption -
> SNOR_HWCAPS_READ should be supported by this controller. However, it's always
> better to test it and not rely on assumptions. You can test it by forcing the
> mask to have just SNOR_HWCAPS_READ | SNOR_HWCAPS_PP set. Or you already tested it?

Our IPs all support SNOR_HWCAPS_READ, Ryedr and I have test it.

> 
> You have a typo in capcity. Maybe substitute it with capability or "add this
> flag to spi_nor_hwcaps mask"

Ok, we'll correct it next version.

Thanks.
Guochun
> 
> > 
> > Signed-off-by: Guochun Mao <guochun.mao@mediatek.com>
> 
> You should add your SoB tag, because you are sending a patch that is not yours.
> 
> Cheers,
> ta
> 
> > ---
> > Changes since v1: none. 
> > ---
> >  drivers/mtd/spi-nor/mtk-quadspi.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/mtd/spi-nor/mtk-quadspi.c b/drivers/mtd/spi-nor/mtk-quadspi.c
> > index 5442993..d9eed68 100644
> > --- a/drivers/mtd/spi-nor/mtk-quadspi.c
> > +++ b/drivers/mtd/spi-nor/mtk-quadspi.c
> > @@ -431,7 +431,8 @@ static int mtk_nor_init(struct mtk_nor *mtk_nor,
> >  			struct device_node *flash_node)
> >  {
> >  	const struct spi_nor_hwcaps hwcaps = {
> > -		.mask = SNOR_HWCAPS_READ_FAST |
> > +		.mask = SNOR_HWCAPS_READ |
> > +			SNOR_HWCAPS_READ_FAST |
> >  			SNOR_HWCAPS_READ_1_1_2 |
> >  			SNOR_HWCAPS_PP,
> >  	};
> > 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 3/3] mtd: spi-nor: mtk-quadspi: rename config to a common one
  2019-01-15  7:34   ` Tudor.Ambarus
@ 2019-01-15  7:57     ` Ryder Lee
  0 siblings, 0 replies; 7+ messages in thread
From: Ryder Lee @ 2019-01-15  7:57 UTC (permalink / raw)
  To: Tudor.Ambarus
  Cc: marek.vasut, computersforpeace, boris.brezillon, robh+dt,
	weijie.gao, linux-mtd, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek

On Tue, 2019-01-15 at 07:34 +0000, Tudor.Ambarus@microchip.com wrote:
> Hi, Ryder,
> 
> On 01/14/2019 07:12 AM, Ryder Lee wrote:
> > The quadspi is a generic communication interface which could be shared
> > with other MediaTek SoCs. Hence rename it to a common one.
> > 
> > Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> > ---
> > Changes since v1: rebase to v5.0-rc1. 
> 
> The patch doesn't apply on v5.0-rc1 or rc2.
> > ---
> >  drivers/mtd/spi-nor/Kconfig  | 16 ++++++++--------
> >  drivers/mtd/spi-nor/Makefile |  2 +-
> >  2 files changed, 9 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
> > index b433e5f..99d9d53 100644
> > --- a/drivers/mtd/spi-nor/Kconfig
> > +++ b/drivers/mtd/spi-nor/Kconfig
> > @@ -7,14 +7,6 @@ menuconfig MTD_SPI_NOR
> >  
> >  if MTD_SPI_NOR
> >  
> > -config MTD_MT81xx_NOR
> > -	tristate "Mediatek MT81xx SPI NOR flash controller"
> > -	depends on HAS_IOMEM
> > -	help
> > -	  This enables access to SPI NOR flash, using MT81xx SPI NOR flash
> > -	  controller. This controller does not support generic SPI BUS, it only
> > -	  supports SPI NOR Flash.
> > -
> >  config MTD_SPI_NOR_USE_4K_SECTORS
> >  	bool "Use small 4096 B erase sectors"
> >  	default y
> > @@ -68,6 +60,14 @@ config SPI_NXP_SPIFI
> >  	  Flash. Enable this option if you have a device with a SPIFI
> >  	  controller and want to access the Flash as a mtd device.
> >  
> > +config SPI_MTK_QUADSPI
> 
> Since you are moving the config into the file, would you mind to put your config
> in an alphabetical order?
> 
> Thanks,
> ta

Okay, I will send a new one to fix them.

Thanks,
Ryder

> > +	tristate "MediaTek Quad SPI controller"
> > +	depends on HAS_IOMEM
> > +	help
> > +	  This enables support for the Quad SPI controller in master mode.
> > +	  This controller does not support generic SPI. It only supports
> > +	  SPI NOR.
> > +
> >  config SPI_INTEL_SPI
> >  	tristate
> >  
> > diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile
> > index 2adedbe..189a15c 100644
> > --- a/drivers/mtd/spi-nor/Makefile
> > +++ b/drivers/mtd/spi-nor/Makefile
> > @@ -3,7 +3,7 @@ obj-$(CONFIG_MTD_SPI_NOR)	+= spi-nor.o
> >  obj-$(CONFIG_SPI_ASPEED_SMC)	+= aspeed-smc.o
> >  obj-$(CONFIG_SPI_CADENCE_QUADSPI)	+= cadence-quadspi.o
> >  obj-$(CONFIG_SPI_HISI_SFC)	+= hisi-sfc.o
> > -obj-$(CONFIG_MTD_MT81xx_NOR)    += mtk-quadspi.o
> > +obj-$(CONFIG_SPI_MTK_QUADSPI)    += mtk-quadspi.o
> >  obj-$(CONFIG_SPI_NXP_SPIFI)	+= nxp-spifi.o
> >  obj-$(CONFIG_SPI_INTEL_SPI)	+= intel-spi.o
> >  obj-$(CONFIG_SPI_INTEL_SPI_PCI)	+= intel-spi-pci.o
> > 



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-01-15  7:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-14  5:12 [PATCH v1 1/3] dt-bindings: mtd: mtk-quadspi: update bindings for MT7629 SoC Ryder Lee
2019-01-14  5:12 ` [PATCH v1 2/3] mtd: spi-nor: mtk-quadspi: add SNOR_HWCAPS_READ for capcity setting Ryder Lee
2019-01-15  6:59   ` Tudor.Ambarus
2019-01-15  7:44     ` Guochun Mao
2019-01-14  5:12 ` [PATCH v1 3/3] mtd: spi-nor: mtk-quadspi: rename config to a common one Ryder Lee
2019-01-15  7:34   ` Tudor.Ambarus
2019-01-15  7:57     ` Ryder Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).