Skip to contentSkip to conversation

mfd: Add Renesas R-Car Gen3 RPC-IF MFD & SPI driver

PATCH Superseded Mason Yang 6 participants 34 messages Apr 24, 2019 – May 22, 2019 1 message not in the archive

Subsystems (3)

v12 of 17 Superseded Latest is v17 →

lore
Share & tools
lore

Mason Yang

author
#0 lore raw

v12 cover mfd: Add Renesas R-Car Gen3 RPC-IF MFD & SPI driver

Hi,

V12 patch including:
1) add back "wbuf" in dts example.
2) RPC-IF replace rpc-if in dts.

v11 patch including:
1) Patch mfd include header file.
2) mfd coding style.
3) add back wbuf description in dts.

v10 patch including:
1) Address range for > 64M byte flash.
2) Removed dirmap_write due to WBUF 256 bytes transfer issue.
3) Dummy bytes setting according to spi-nor.c layer.

v9 patch is for RPC MFD driver and RPC SPI driver.

v8 patch including:
1) Supported SoC-specific values in DTS.
2) Rename device node name as flash.

v7 patch is according to Geert and Sergei's comments:
1) Add all R-Car Gen3 model in dts.
2) patch rpc-if child node search.
3) minror coding style.

v6 patch is accroding to Geert, Marek and Sergei's comments:
1) spi_controller for new code.
2) "renesas,rcar-gen3-rpc" instead of "renesas,r8a77995-rpc."
3) patch external address read mode w/o u64 readq().
4) patch dts for write buffer & drop "renesas,rpc-mode".
5) coding style and so on.

v5 patch is accroding to Sergei's comments:
1) Read 6 bytes ID from Sergei's patch.
2) regmap_update_bits().
3) C++ style comment.

v4 patch is according to Sergei's comments including:
1) Drop soc_device_match().
2) Drop unused RPC registers.
3) Use ilog2() instead of fls().
4) Patch read 6 bytes ID w/ one command.
5) Coding style and so on.

v3 patch is according to Marek and Geert's comments including:
1) soc_device_mach() to set up RPC_PHYCNT_STRTIM.
2) get_unaligned().
3) rpc-mode for rpi-spi-flash or rpc-hyperflash.
4) coding style and so on.

v2 patch including:
1) remove RPC clock enable/dis-able control,
2) patch run time PM.
3) add RPC module software reset,
4) add regmap.
5) other coding style and so on.

thanks for your review.

best regards,
Mason

Mason Yang (3):
mfd: Add Renesas R-Car Gen3 RPC-IF MFD driver
spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver
dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

 .../devicetree/bindings/mfd/mfd-renesas-rpc.txt    |  40 ++
 drivers/mfd/Kconfig                                |   9 +
 drivers/mfd/Makefile                               |   1 +
 drivers/mfd/renesas-rpc.c                          | 125 +++++
 drivers/spi/Kconfig                                |   6 +
 drivers/spi/Makefile                               |   1 +
 drivers/spi/spi-renesas-rpc.c                      | 571 +++++++++++++++++++++
 include/linux/mfd/renesas-rpc.h                    | 141 +++++
 8 files changed, 894 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt
 create mode 100644 drivers/mfd/renesas-rpc.c
 create mode 100644 drivers/spi/spi-renesas-rpc.c
 create mode 100644 include/linux/mfd/renesas-rpc.h
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v12 1/3 mfd: Add Renesas R-Car Gen3 RPC-IF MFD driver

Add a driver for Renesas R-Car Gen3 RPC-IF MFD.

---
 drivers/mfd/Kconfig             |   9 +++
 drivers/mfd/Makefile            |   1 +
 drivers/mfd/renesas-rpc.c       | 125 +++++++++++++++++++++++++++++++++++
 include/linux/mfd/renesas-rpc.h | 141 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 276 insertions(+)
 create mode 100644 drivers/mfd/renesas-rpc.c
 create mode 100644 include/linux/mfd/renesas-rpc.h
drivers/mfd/Kconfig +9 -0
index 26ad646..efdb1b9 100644
@@ -978,6 +978,15 @@ config MFD_RDC321X
 	  southbridge which provides access to GPIOs and Watchdog using the
 	  southbridge PCI device configuration space.
 
+config MFD_RENESAS_RPC
+	tristate "Renesas R-Car Gen3 RPC-IF MFD driver"
+	select MFD_CORE
+	depends on ARCH_RENESAS
+	help
+	  This supports Renesas R-Car Gen3 RPC-IF multifunction device
+	  which provides either SPI host or HyperFlash.
+	  You have to select individual components under the corresponding menu.
+
 config MFD_RT5033
 	tristate "Richtek RT5033 Power Management IC"
 	depends on I2C
drivers/mfd/Makefile +1 -0
index b4569ed7..4a49699 100644
@@ -183,6 +183,7 @@ obj-$(CONFIG_MFD_INTEL_QUARK_I2C_GPIO)	+= intel_quark_i2c_gpio.o
 obj-$(CONFIG_LPC_SCH)		+= lpc_sch.o
 obj-$(CONFIG_LPC_ICH)		+= lpc_ich.o
 obj-$(CONFIG_MFD_RDC321X)	+= rdc321x-southbridge.o
+obj-$(CONFIG_MFD_RENESAS_RPC)	+= renesas-rpc.o
 obj-$(CONFIG_MFD_JANZ_CMODIO)	+= janz-cmodio.o
 obj-$(CONFIG_MFD_JZ4740_ADC)	+= jz4740-adc.o
 obj-$(CONFIG_MFD_TPS6586X)	+= tps6586x.o
drivers/mfd/renesas-rpc.c new file +125 -0

125 lines not on this page · raw message

include/linux/mfd/renesas-rpc.h new file +141 -0

141 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#2 lore raw

PATCH v12 2/3 spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver

In reply to Mason Yang

Add a driver for Renesas R-Car Gen3 RPC-IF SPI controller.

---
 drivers/spi/Kconfig           |   6 +
 drivers/spi/Makefile          |   1 +
 drivers/spi/spi-renesas-rpc.c | 571 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 578 insertions(+)
 create mode 100644 drivers/spi/spi-renesas-rpc.c
drivers/spi/Kconfig +6 -0
index f761655..1f52bcf 100644
@@ -564,6 +564,12 @@ config SPI_RSPI
 	help
 	  SPI driver for Renesas RSPI and QSPI blocks.
 
+config SPI_RENESAS_RPC
+	tristate "Renesas R-Car Gen3 RPC-IF controller"
+	depends on ARCH_RENESAS || COMPILE_TEST
+	help
+	  SPI driver for Renesas R-Car Gen3 RPC-IF.
+
 config SPI_QCOM_QSPI
 	tristate "QTI QSPI controller"
 	depends on ARCH_QCOM
drivers/spi/Makefile +1 -0
index d8fc03c..b3a3deb 100644
@@ -86,6 +86,7 @@ obj-$(CONFIG_SPI_QUP)			+= spi-qup.o
 obj-$(CONFIG_SPI_ROCKCHIP)		+= spi-rockchip.o
 obj-$(CONFIG_SPI_RB4XX)			+= spi-rb4xx.o
 obj-$(CONFIG_SPI_RSPI)			+= spi-rspi.o
+obj-$(CONFIG_SPI_RENESAS_RPC)		+= spi-renesas-rpc.o
 obj-$(CONFIG_SPI_S3C24XX)		+= spi-s3c24xx-hw.o
 spi-s3c24xx-hw-y			:= spi-s3c24xx.o
 spi-s3c24xx-hw-$(CONFIG_SPI_S3C24XX_FIQ) += spi-s3c24xx-fiq.o
drivers/spi/spi-renesas-rpc.c new file +571 -0

571 lines not on this page · raw message

Signature · 1 line
1.9.1
#3 lore raw

Re: [PATCH v12 2/3] spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver

Quoted 65 lines · Mason Yang

Add a driver for Renesas R-Car Gen3 RPC-IF SPI controller.

---
 drivers/spi/Kconfig           |   6 +
 drivers/spi/Makefile          |   1 +
 drivers/spi/spi-renesas-rpc.c | 571 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 578 insertions(+)
 create mode 100644 drivers/spi/spi-renesas-rpc.c
drivers/spi/Kconfig +6 -0
index f761655..1f52bcf 100644
@@ -564,6 +564,12 @@ config SPI_RSPI
 	help
 	  SPI driver for Renesas RSPI and QSPI blocks.
 
+config SPI_RENESAS_RPC
+	tristate "Renesas R-Car Gen3 RPC-IF controller"
+	depends on ARCH_RENESAS || COMPILE_TEST
+	help
+	  SPI driver for Renesas R-Car Gen3 RPC-IF.
+
 config SPI_QCOM_QSPI
 	tristate "QTI QSPI controller"
 	depends on ARCH_QCOM
drivers/spi/Makefile +1 -0
index d8fc03c..b3a3deb 100644
@@ -86,6 +86,7 @@ obj-$(CONFIG_SPI_QUP)			+= spi-qup.o
 obj-$(CONFIG_SPI_ROCKCHIP)		+= spi-rockchip.o
 obj-$(CONFIG_SPI_RB4XX)			+= spi-rb4xx.o
 obj-$(CONFIG_SPI_RSPI)			+= spi-rspi.o
+obj-$(CONFIG_SPI_RENESAS_RPC)		+= spi-renesas-rpc.o
 obj-$(CONFIG_SPI_S3C24XX)		+= spi-s3c24xx-hw.o
 spi-s3c24xx-hw-y			:= spi-s3c24xx.o
 spi-s3c24xx-hw-$(CONFIG_SPI_S3C24XX_FIQ) += spi-s3c24xx-fiq.o
drivers/spi/spi-renesas-rpc.c new file +19 -0
new file mode 100644
index 0000000..c2202d4
@@ -0,0 +1,571 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright (C) 2018 ~ 2019 Renesas Solutions Corp.
+// Copyright (C) 2019 Macronix International Co., Ltd.
+//
+// R-Car Gen3 RPC-IF SPI/QSPI/Octa driver
+//
+// Author:
+//	Mason Yang <[email protected]>
+//
+
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/log2.h>
+#include <linux/iopoll.h>
+#include <linux/mfd/renesas-rpc.h>
+#include <linux/module.h>
+#include <linux/mtd/mtd.h>
+#include <linux/platform_device.h>

drivers/spi/spi-renesas-rpc.c line 29

Quoted 10 lines
drivers/spi/spi-renesas-rpc.c new file +10 -0
+#include <linux/pm_runtime.h>
+#include <linux/regmap.h>
+#include <linux/reset.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/spi-mem.h>
+
+#include <asm/unaligned.h>
+
+struct rpc_spi {
+	struct rpc_mfd *mfd;

The term MFD isn't a real thing. What you're obtaining below is driver data and is normally articulated as 'ddata' in drivers.

Quoted 10 lines
drivers/spi/spi-renesas-rpc.c new file +10 -0
+	u32 cur_speed_hz;
+	u32 cmd;
+	u32 addr;
+	u32 dummy;
+	u32 smcr;
+	u32 smenr;
+	u32 xferlen;
+	u32 totalxferlen;
+	enum spi_mem_data_dir xfer_dir;
+};

[...]

drivers/spi/spi-renesas-rpc.c line 65

Quoted 10 lines
drivers/spi/spi-renesas-rpc.c new file +10 -0
+static void rpc_spi_hw_init(struct rpc_spi *rpc)
+{
+	//
+	// NOTE: The 0x260 are undocumented bits, but they must be set.
+	//	 RPC_PHYCNT_STRTIM is strobe timing adjustment bit,
+	//	 0x0 : the delay is biggest,
+	//	 0x1 : the delay is 2nd biggest,
+	//	 On H3 ES1.x, the value should be 0, while on others,
+	//	 the value should be 6.
+	//

C++ style comments? Is that a thing now?

Quoted 19 lines
drivers/spi/spi-renesas-rpc.c new file +19 -0
+	regmap_write(rpc->mfd->regmap, RPC_PHYCNT, RPC_PHYCNT_CAL |
+				  RPC_PHYCNT_STRTIM(6) | 0x260);
+
+	//
+	// NOTE: The 0x1511144 are undocumented bits, but they must be set
+	//       for RPC_PHYOFFSET1.
+	//	 The 0x31 are undocumented bits, but they must be set
+	//	 for RPC_PHYOFFSET2.
+	//
+	regmap_write(rpc->mfd->regmap, RPC_PHYOFFSET1,
+		     RPC_PHYOFFSET1_DDRTMG(3) | 0x1511144);
+	regmap_write(rpc->mfd->regmap, RPC_PHYOFFSET2, 0x31 |
+		     RPC_PHYOFFSET2_OCTTMG(4));
+	regmap_write(rpc->mfd->regmap, RPC_SSLDR, RPC_SSLDR_SPNDL(7) |
+		     RPC_SSLDR_SLNDL(7) | RPC_SSLDR_SCKDL(7));
+	regmap_write(rpc->mfd->regmap, RPC_CMNCR, RPC_CMNCR_MD |
+		     RPC_CMNCR_SFDE | RPC_CMNCR_MOIIO_HIZ | RPC_CMNCR_IOFV_HIZ |
+		     RPC_CMNCR_BSZ(0));
+}
Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#4 lore raw

Re: [PATCH v12 2/3] spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver

Hi Jones,

Quoted 6 lines

drivers/spi/spi-renesas-rpc.c line 29

Quoted 3 lines
drivers/spi/spi-renesas-rpc.c new file +3 -0
+
+struct rpc_spi {
+   struct rpc_mfd *mfd;

The term MFD isn't a real thing. What you're obtaining below is driver data and is normally articulated as 'ddata' in drivers.

yes, it's just imply that data is from MFD.

Should I rename "mfd" ?

Quoted 14 lines
Quoted 11 lines
drivers/spi/spi-renesas-rpc.c new file +10 -0
+   u32 cur_speed_hz;
+   u32 cmd;
+   u32 addr;
+   u32 dummy;
+   u32 smcr;
+   u32 smenr;
+   u32 xferlen;
+   u32 totalxferlen;
+   enum spi_mem_data_dir xfer_dir;
+};

[...]

Quoted 12 lines

drivers/spi/spi-renesas-rpc.c line 65

Quoted 10 lines
drivers/spi/spi-renesas-rpc.c new file +10 -0
+static void rpc_spi_hw_init(struct rpc_spi *rpc)
+{
+   //
+   // NOTE: The 0x260 are undocumented bits, but they must be set.
+   //    RPC_PHYCNT_STRTIM is strobe timing adjustment bit,
+   //    0x0 : the delay is biggest,
+   //    0x1 : the delay is 2nd biggest,
+   //    On H3 ES1.x, the value should be 0, while on others,
+   //    the value should be 6.
+   //

C++ style comments? Is that a thing now?

It's kind of Mark's previous comments.

Quoted 10 lines
Quoted 10 lines
drivers/spi/spi-renesas-rpc.c new file +9 -0
+   regmap_write(rpc->mfd->regmap, RPC_PHYCNT, RPC_PHYCNT_CAL |
+              RPC_PHYCNT_STRTIM(6) | 0x260);
+
+   //
+   // NOTE: The 0x1511144 are undocumented bits, but they must be set
+   //       for RPC_PHYOFFSET1.
+   //    The 0x31 are undocumented bits, but they must be set
+   //    for RPC_PHYOFFSET2.
+   //
Quoted 8 lines

drivers/spi/spi-renesas-rpc.c

Quoted 8 lines
drivers/spi/spi-renesas-rpc.c new file +8 -0
+   regmap_write(rpc->mfd->regmap, RPC_PHYOFFSET1,
+           RPC_PHYOFFSET1_DDRTMG(3) | 0x1511144);
+   regmap_write(rpc->mfd->regmap, RPC_PHYOFFSET2, 0x31 |
+           RPC_PHYOFFSET2_OCTTMG(4));
+   regmap_write(rpc->mfd->regmap, RPC_SSLDR, RPC_SSLDR_SPNDL(7) |
+           RPC_SSLDR_SLNDL(7) | RPC_SSLDR_SCKDL(7));
+   regmap_write(rpc->mfd->regmap, RPC_CMNCR, RPC_CMNCR_MD |
+           RPC_CMNCR_SFDE | RPC_CMNCR_MOIIO_HIZ | RPC_CMNCR_IOFV_HIZ 

|

Quoted 8 lines
Quoted 2 lines
(quoted diff) +2 -0
+           RPC_CMNCR_BSZ(0));
+}
Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

thanks & best regards,
Mason

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

============================================================================

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

#5 lore raw

Re: [PATCH v12 2/3] spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver

Quoted 10 lines · On Wed, 15 May 2019, [email protected] wrote:

Hi Jones,

Quoted 6 lines

drivers/spi/spi-renesas-rpc.c line 29

Quoted 3 lines
drivers/spi/spi-renesas-rpc.c new file +3 -0
+
+struct rpc_spi {
+   struct rpc_mfd *mfd;

The term MFD isn't a real thing. What you're obtaining below is driver data and is normally articulated as 'ddata' in drivers.

Quoted 3 lines

yes, it's just imply that data is from MFD.

Should I rename "mfd" ?

Yes please.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
author
#6 lore raw

PATCH v12 3/3 dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

In reply to Mason Yang

Document the bindings used by the Renesas R-Car Gen3 RPC-IF MFD.

---
 .../devicetree/bindings/mfd/mfd-renesas-rpc.txt    | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt
Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +40 -0
new file mode 100644
index 0000000..668b822
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------
+
+Required properties:
+- compatible: should be an SoC-specific compatible value, followed by
+		"renesas,rcar-gen3-rpc" as a fallback.
+		supported SoC-specific values are:
+		"renesas,r8a77995-rpc"	(R-Car D3)
+- reg: should contain three register areas:
+	first for the base address of RPC-IF registers,
+	second for the direct mapping read mode and
+	third for the write buffer area.
+- reg-names: should contain "regs", "dirmap" and "wbuf"
+- clocks: should contain 1 entries for the module's clock
+- clock-names: should contain "rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0
+
+Example:
+
+	rpc: rpc-if@ee200000 {
+		compatible = "renesas,r8a77995-rpc", "renesas,rcar-gen3-rpc";
+		reg = <0 0xee200000 0 0x200>, <0 0x08000000 0 0x4000000>,
+		      <0 0xee208000 0 0x100>;
+		reg-names = "regs", "dirmap", "wbuf";
+		clocks = <&cpg CPG_MOD 917>;
+		clock-names = "rpc";
+		power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+		resets = <&cpg 917>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		flash@0 {
+			compatible = "jedec,spi-nor";
+			reg = <0>;
+			spi-max-frequency = <40000000>;
+			spi-tx-bus-width = <1>;
+			spi-rx-bus-width = <1>;
+		};
+	};
Signature · 1 line
1.9.1
maintainer
#7 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Quoted 14 lines · Mason Yang

Document the bindings used by the Renesas R-Car Gen3 RPC-IF MFD.

---
 .../devicetree/bindings/mfd/mfd-renesas-rpc.txt    | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt
Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +0 -0
new file mode 100644
index 0000000..668b822

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt line 2

Quoted 2 lines
Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +2 -0
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What makes it an MFD?

Quoted 41 lines
Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +38 -0
+
+Required properties:
+- compatible: should be an SoC-specific compatible value, followed by
+		"renesas,rcar-gen3-rpc" as a fallback.
+		supported SoC-specific values are:
+		"renesas,r8a77995-rpc"	(R-Car D3)
+- reg: should contain three register areas:
+	first for the base address of RPC-IF registers,
+	second for the direct mapping read mode and
+	third for the write buffer area.
+- reg-names: should contain "regs", "dirmap" and "wbuf"
+- clocks: should contain 1 entries for the module's clock
+- clock-names: should contain "rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0
+
+Example:
+
+	rpc: rpc-if@ee200000 {
+		compatible = "renesas,r8a77995-rpc", "renesas,rcar-gen3-rpc";
+		reg = <0 0xee200000 0 0x200>, <0 0x08000000 0 0x4000000>,
+		      <0 0xee208000 0 0x100>;
+		reg-names = "regs", "dirmap", "wbuf";
+		clocks = <&cpg CPG_MOD 917>;
+		clock-names = "rpc";
+		power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+		resets = <&cpg 917>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		flash@0 {
+			compatible = "jedec,spi-nor";
+			reg = <0>;
+			spi-max-frequency = <40000000>;
+			spi-tx-bus-width = <1>;
+			spi-rx-bus-width = <1>;
+		};
+	};
Signature · 1 line
1.9.1
#8 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Quoted 9 lines · Rob Herring
Quoted 8 lines · Mason Yang

Document the bindings used by the Renesas R-Car Gen3 RPC-IF MFD.

---
 .../devicetree/bindings/mfd/mfd-renesas-rpc.txt    | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt
Quoted 11 lines

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt line 2

Quoted 8 lines
Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +2 -0
new file mode 100644
index 0000000..668b822
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What makes it an MFD?

It supports both SPI NOR and HyperFlash (CFI-compliant flash with different bus interface).

Quoted 41 lines
Quoted 41 lines
Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +38 -0
+
+Required properties:
+- compatible: should be an SoC-specific compatible value, followed by
+		"renesas,rcar-gen3-rpc" as a fallback.
+		supported SoC-specific values are:
+		"renesas,r8a77995-rpc"	(R-Car D3)
+- reg: should contain three register areas:
+	first for the base address of RPC-IF registers,
+	second for the direct mapping read mode and
+	third for the write buffer area.
+- reg-names: should contain "regs", "dirmap" and "wbuf"
+- clocks: should contain 1 entries for the module's clock
+- clock-names: should contain "rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0
+
+Example:
+
+	rpc: rpc-if@ee200000 {
+		compatible = "renesas,r8a77995-rpc", "renesas,rcar-gen3-rpc";
+		reg = <0 0xee200000 0 0x200>, <0 0x08000000 0 0x4000000>,
+		      <0 0xee208000 0 0x100>;
+		reg-names = "regs", "dirmap", "wbuf";
+		clocks = <&cpg CPG_MOD 917>;
+		clock-names = "rpc";
+		power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+		resets = <&cpg 917>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		flash@0 {
+			compatible = "jedec,spi-nor";
+			reg = <0>;
+			spi-max-frequency = <40000000>;
+			spi-tx-bus-width = <1>;
+			spi-rx-bus-width = <1>;
+		};
+	};
Signature · 1 line
1.9.1
Signature · 2 lines
Best regards,
Marek Vasut
maintainer
#9 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Quoted 23 lines · Marek Vasut
Quoted 9 lines · Rob Herring
Quoted 8 lines · Mason Yang

Document the bindings used by the Renesas R-Car Gen3 RPC-IF MFD.

---
 .../devicetree/bindings/mfd/mfd-renesas-rpc.txt    | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt
Quoted 11 lines

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt line 2

Quoted 8 lines
Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +2 -0
new file mode 100644
index 0000000..668b822
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What makes it an MFD?

Quoted 2 lines

It supports both SPI NOR and HyperFlash (CFI-compliant flash with different bus interface).

Not sure that really makes it an MFD. Lee probably has an opinion.

In any case, can we get a complete binding that shows both.

Rob

#10 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Quoted 24 lines · Rob Herring
Quoted 23 lines · Marek Vasut
Quoted 20 lines · Rob Herring
Quoted 14 lines · Mason Yang

Document the bindings used by the Renesas R-Car Gen3 RPC-IF MFD.

---
 .../devicetree/bindings/mfd/mfd-renesas-rpc.txt    | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt
Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +0 -0
new file mode 100644
index 0000000..668b822

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt line 2

Quoted 2 lines
Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +2 -0
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What makes it an MFD?

Quoted 6 lines
Quoted 2 lines

It supports both SPI NOR and HyperFlash (CFI-compliant flash with different bus interface).

Not sure that really makes it an MFD. Lee probably has an opinion.

In any case, can we get a complete binding that shows both.

Presumably that would only mean the flash compatible is some "cfi,nor" or somesuch. But I agree, would be nice to have both in the example.

Signature · 2 lines
Best regards,
Marek Vasut
#11 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

In reply to Marek Vasut
Quoted 22 lines · Marek Vasut
Quoted 9 lines · Rob Herring
Quoted 8 lines · Mason Yang

Document the bindings used by the Renesas R-Car Gen3 RPC-IF MFD.

---
 .../devicetree/bindings/mfd/mfd-renesas-rpc.txt    | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt
Quoted 11 lines

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt line 2

Quoted 8 lines
Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +2 -0
new file mode 100644
index 0000000..668b822
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What makes it an MFD?

Quoted 2 lines

It supports both SPI NOR and HyperFlash (CFI-compliant flash with different bus interface).

Looks like you're registering one OR the other.

Why don't you just do this from DT?

No reason for this to be an MFD IMHO.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#12 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hi Jones,

Quoted 51 lines

"Lee Jones" <[email protected]>
2019/05/07 下午 08:58

To

"Marek Vasut" <[email protected]>,

cc

"Rob Herring" <[email protected]>, "Mason Yang" <[email protected]>, [email protected], linux- [email protected], [email protected], [email protected], [email protected], "Geert Uytterhoeven" <[email protected]>, [email protected], [email protected], [email protected], [email protected], "Simon Horman" <[email protected]>, [email protected]

Subject

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Quoted 7 lines · Marek Vasut
Quoted 6 lines · Rob Herring
Quoted 5 lines · Mason Yang

Document the bindings used by the Renesas R-Car Gen3 RPC-IF MFD.

---
 .../devicetree/bindings/mfd/mfd-renesas-rpc.txt    | 40 ++++++

++++++++++++++++

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/mfd-

renesas-rpc.txt

Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

rpc.txt b/Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt

Quoted 12 lines
Quoted 11 lines

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt line 2

Quoted 7 lines

new file mode 100644
index 0000000..668b822

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +2 -0
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What makes it an

MFD?

Quoted 8 lines
Quoted 2 lines

It supports both SPI NOR and HyperFlash (CFI-compliant flash with different bus interface).

Looks like you're registering one OR the other.

Why don't you just do this from DT?

No reason for this to be an MFD IMHO.

okay, I will patch it back to SPI mode only.

Hi Mark,
I will rebase onto previous patches as bellow:

Quoted 17 lines · Mark Brown

The patch

spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver

has been applied to the spi tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git

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.

Quoted 6 lines

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.

How did that happen when there were still comments and open topics ?

Signature · 6 lines
Best regards,
Marek Vasut


Hi Marek,
Agreed it ? or have other opinion ?
Quoted 6 lines
Signature · 5 lines
-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

thanks & best regards,
Mason

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

============================================================================

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

#13 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Quoted 55 lines · On 5/8/19 4:48 AM, [email protected] wrote:

Hi Jones,

Quoted 53 lines

"Lee Jones" <[email protected]>
2019/05/07 下午 08:58

To

"Marek Vasut" <[email protected]>,

cc

"Rob Herring" <[email protected]>, "Mason Yang" <[email protected]>, [email protected], linux- [email protected], [email protected], [email protected], [email protected], "Geert Uytterhoeven" <[email protected]>, [email protected], [email protected], [email protected], [email protected], "Simon Horman" <[email protected]>, [email protected]

Subject

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Quoted 7 lines · Marek Vasut
Quoted 6 lines · Rob Herring
Quoted 5 lines · Mason Yang

Document the bindings used by the Renesas R-Car Gen3 RPC-IF MFD.

---
 .../devicetree/bindings/mfd/mfd-renesas-rpc.txt    | 40 ++++++

++++++++++++++++

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
 1 file changed, 40 insertions(+)

 create mode 100644 Documentation/devicetree/bindings/mfd/mfd-

renesas-rpc.txt

Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

rpc.txt b/Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt

Quoted 13 lines
Quoted 10 lines

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt line 2

Quoted 7 lines

new file mode 100644
index 0000000..668b822

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +2 -0
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What makes it an MFD?

It supports both SPI NOR and HyperFlash (CFI-compliant flash with different bus interface).

Quoted 8 lines
Quoted 5 lines

Looks like you're registering one OR the other.

Why don't you just do this from DT?

No reason for this to be an MFD IMHO.

okay, I will patch it back to SPI mode only.

I don't think that's what Lee meant . The controller supports _both_ modes , hence it would have the same compatible string. You just need to extract the mode of operation from the DT.

Signature · 2 lines
Best regards,
Marek Vasut
#14 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Quoted 60 lines · Marek Vasut
Quoted 59 lines · On 5/8/19 4:48 AM, [email protected] wrote:

Hi Jones,

Quoted 57 lines

"Lee Jones" <[email protected]>
2019/05/07 下午 08:58

To

"Marek Vasut" <[email protected]>,

cc

"Rob Herring" <[email protected]>, "Mason Yang" <[email protected]>, [email protected], linux- [email protected], [email protected], [email protected], [email protected], "Geert Uytterhoeven" <[email protected]>, [email protected], [email protected], [email protected], [email protected], "Simon Horman" <[email protected]>, [email protected]

Subject

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Quoted 7 lines · Marek Vasut
Quoted 6 lines · Rob Herring
Quoted 5 lines · Mason Yang

Document the bindings used by the Renesas R-Car Gen3 RPC-IF MFD.

---
 .../devicetree/bindings/mfd/mfd-renesas-rpc.txt    | 40 ++++++

++++++++++++++++

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
 1 file changed, 40 insertions(+)

 create mode 100644 Documentation/devicetree/bindings/mfd/mfd-

renesas-rpc.txt

Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

rpc.txt b/Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt

Quoted 11 lines
Quoted 10 lines

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt line 2

Quoted 7 lines

new file mode 100644
index 0000000..668b822

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +2 -0
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What makes it an MFD?

Quoted 2 lines

It supports both SPI NOR and HyperFlash (CFI-compliant flash with different bus interface).

Looks like you're registering one OR the other.

Why don't you just do this from DT?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

No reason for this to be an MFD IMHO.

okay, I will patch it back to SPI mode only.

I don't think that's what Lee meant . The controller supports _both_ modes , hence it would have the same compatible string. You just need to extract the mode of operation from the DT.

HiSilicon attempted to upstream something similar, only their controller provided NAND and NOR functionality. They used different compatible strings to differentiate between the varying technologies.

They too tried to use MFD as a means to select between them (which was also NACKed). Not sure what they ended up doing, but the original submission and (half of) the conversation can be found at [0]. Some more of the thread continues at [1].

Hope that helps.

[0] https://groups.google.com/forum/#!topic/fa.linux.kernel/F6i9o8sfOIw
[1] https://marc.info/?l=devicetree&m=147669165104431&w=2

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#15 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hi Jones,

okay, thanks for your information.

Quoted 17 lines

"Lee Jones" <[email protected]>
2019/05/08 下午 02:11

To

"Marek Vasut" <[email protected]>,

cc

[email protected], [email protected], [email protected], [email protected], "Geert Uytterhoeven" <geert [email protected]>, "Simon Horman" <[email protected]>, [email protected], [email protected], linux-renesas- [email protected], [email protected], [email protected], "Rob Herring" <[email protected]>, [email protected], [email protected]

Quoted 38 lines

Subject

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Quoted 31 lines · Marek Vasut
Quoted 30 lines · On 5/8/19 4:48 AM, [email protected] wrote:

Hi Jones,

Quoted 28 lines

"Lee Jones" <[email protected]>
2019/05/07 下午 08:58

To

"Marek Vasut" <[email protected]>,

cc

"Rob Herring" <[email protected]>, "Mason Yang" <[email protected]>, [email protected], linux- [email protected], [email protected], [email protected], [email protected], "Geert Uytterhoeven" <[email protected]>, [email protected], [email protected], [email protected], [email protected], "Simon Horman" <[email protected]>, [email protected]

Subject

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Quoted 3 lines · Marek Vasut
Quoted 2 lines · Rob Herring
Quoted 1 line · Mason Yang

Document the bindings used by the Renesas R-Car Gen3 RPC-IF

MFD.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
---
 .../devicetree/bindings/mfd/mfd-renesas-rpc.txt    | 40 

++++++

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

++++++++++++++++

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/mfd-

renesas-rpc.txt

Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

a/Documentation/devicetree/bindings/mfd/mfd-renesas-

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

rpc.txt b/Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

new file mode 100644
index 0000000..668b822
--- /dev/null
+++

b/Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Review line 2

Quoted 3 lines
(quoted diff) +2 -0
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What makes

it an

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
Quoted 1 line

MFD?

It supports both SPI NOR and HyperFlash (CFI-compliant flash with different bus interface).

Looks like you're registering one OR the other.

Why don't you just do this from DT?

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

No reason for this to be an MFD IMHO.

okay, I will patch it back to SPI mode only.

I don't think that's what Lee meant . The controller supports _both_ modes , hence it would have the same compatible string. You just need

to

Quoted 12 lines
Quoted 1 line

extract the mode of operation from the DT.

HiSilicon attempted to upstream something similar, only their controller provided NAND and NOR functionality. They used different compatible strings to differentiate between the varying technologies.

They too tried to use MFD as a means to select between them (which was also NACKed). Not sure what they ended up doing, but the original submission and (half of) the conversation can be found at [0]. Some more of the thread continues at [1].

Quoted 4 lines

Hope that helps.

[0] https://groups.google.com/forum/#!topic/fa.linux.kernel/F6i9o8sfOIw
[1] https://marc.info/?l=devicetree&m=147669165104431&w=2

Hi Marek,

By Jones's comments:
--------------------------------------------------------------------------

Quoted 6 lines

From: Shunquan Lin <[email protected]>

This patch adds driver support for HiSilicon Flash Memory Controller(FMC). HiSilicon FMC is a multi-functions device which supports SPI Nor flash controller, SPI nand Flash controller and parallel nand flash controller.

MFDs are for devices which span multiple subsystems.

Please submit this to MTD.

https://marc.info/?l=devicetree&m=147376842210229&w=2
-------------------------------------------------------------------------------------------------

I will patch RPC-IF back to SPI mode according to previous patches:

-----------------------------------------------------------------------

Quoted 17 lines · Mark Brown

The patch

spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver

has been applied to the spi tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git

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.

Quoted 6 lines

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.

------------------------------------------------------------------------

agreed it ?

Quoted 6 lines
Signature · 5 lines
-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

thanks & best regards,
Mason

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

============================================================================

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

#16 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hello!

On 05/09/2019 05:06 AM, [email protected] wrote:

[...]

Quoted 61 lines
Quoted 51 lines
Quoted 32 lines
Quoted 32 lines
Quoted 32 lines
Quoted 7 lines · Rob Herring
Quoted 6 lines · Mason Yang
Quoted 5 lines

Document the bindings used by the Renesas R-Car Gen3 RPC-IF MFD.

---
 .../devicetree/bindings/mfd/mfd-renesas-rpc.txt    | 40 ++++++

++++++++++++++++

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/mfd-

renesas-rpc.txt

Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

rpc.txt b/Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt

Quoted 11 lines
Quoted 10 lines

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt line 2

Quoted 7 lines

new file mode 100644
index 0000000..668b822

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +2 -0
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What makes it an MFD?

Quoted 2 lines

It supports both SPI NOR and HyperFlash (CFI-compliant flash with different bus interface).

Looks like you're registering one OR the other.

Why don't you just do this from DT?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

No reason for this to be an MFD IMHO.

okay, I will patch it back to SPI mode only.

I don't think that's what Lee meant . The controller supports _both_ modes , hence it would have the same compatible string. You just need to extract the mode of operation from the DT.

HiSilicon attempted to upstream something similar, only their controller provided NAND and NOR functionality. They used different compatible strings to differentiate between the varying technologies.

They too tried to use MFD as a means to select between them (which was also NACKed). Not sure what they ended up doing, but the original submission and (half of) the conversation can be found at [0]. Some more of the thread continues at [1].

Quoted 4 lines

Hope that helps.

[0] https://groups.google.com/forum/#!topic/fa.linux.kernel/F6i9o8sfOIw
[1] https://marc.info/?l=devicetree&m=147669165104431&w=2

Hi Marek,

By Jones's comments:
--------------------------------------------------------------------------

Quoted 8 lines
Quoted 6 lines

From: Shunquan Lin <[email protected]>

This patch adds driver support for HiSilicon Flash Memory Controller(FMC). HiSilicon FMC is a multi-functions device which supports SPI Nor flash controller, SPI nand Flash controller and parallel nand flash controller.

MFDs are for devices which span multiple subsystems.

And we do! One of the subdrivers will live under drivers/spi/, the other
under drivers/mtd/...

Quoted 8 lines

Please submit this to MTD.

_https://marc.info/?l=devicetree&m=147376842210229&w=2_
-------------------------------------------------------------------------------------------------

I will patch RPC-IF back to SPI mode according to previous patches:

I still don't see why you want to do this...

Quoted 23 lines

-----------------------------------------------------------------------

Quoted 21 lines · Mark Brown

The patch

spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver

has been applied to the spi tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git

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.

Quoted 5 lines
Quoted 2 lines

Please add any relevant lists and maintainers to the CCs when replying to this mail.

------------------------------------------------------------------------

agreed it ?

No, I don't agree.

[...]

Quoted 2 lines

thanks & best regards,
Mason

MBR, Sergei

#17 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hi Sergei,

Quoted 8 lines

"Sergei Shtylyov" <[email protected]> 2019/05/10 上午 03:24

To

[email protected], "Lee Jones" <[email protected]>, "Marek Vasut" <[email protected]>,

Quoted 8 lines

cc

[email protected], [email protected], [email protected], "Geert Uytterhoeven" <geert [email protected]>, "Simon Horman" <[email protected]>, [email protected], [email protected], linux-renesas- [email protected], [email protected], [email protected], "Rob Herring" <[email protected]>,

[email protected]

Quoted 14 lines

Subject

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hello!

On 05/09/2019 05:06 AM, [email protected] wrote:

[...]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines · Rob Herring
Quoted 2 lines · Mason Yang
Quoted 1 line

Document the bindings used by the Renesas R-Car Gen3 RPC-IF

MFD.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
---
 .../devicetree/bindings/mfd/mfd-renesas-rpc.txt    | 40 

++++++

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

++++++++++++++++

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
 1 file changed, 40 insertions(+)
 create mode 100644 

Documentation/devicetree/bindings/mfd/mfd-

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

renesas-rpc.txt

Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

a/Documentation/devicetree/bindings/mfd/mfd-renesas-

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

rpc.txt

b/Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

new file mode 100644
index 0000000..668b822
--- /dev/null
+++

b/Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt

Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Review line 2

Quoted 3 lines
(quoted diff) +2 -0
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What

makes it an

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

MFD?

It supports both SPI NOR and HyperFlash (CFI-compliant flash

with

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

different bus interface).

Looks like you're registering one OR the other.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Why don't you just do this from DT?

No reason for this to be an MFD IMHO.

okay, I will patch it back to SPI mode only.

I don't think that's what Lee meant . The controller supports

_both_

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

modes , hence it would have the same compatible string. You just

need to

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line

extract the mode of operation from the DT.

HiSilicon attempted to upstream something similar, only their controller provided NAND and NOR functionality. They used different compatible strings to differentiate between the varying technologies.

They too tried to use MFD as a means to select between them (which

was

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

also NACKed). Not sure what they ended up doing, but the original submission and (half of) the conversation can be found at [0]. Some more of the thread continues at [1].

Hope that helps.

[0]

https://groups.google.com/forum/#!topic/fa.linux.kernel/F6i9o8sfOIw

Quoted 7 lines
Quoted 7 lines
Quoted 1 line

[1] https://marc.info/?l=devicetree&m=147669165104431&w=2

Hi Marek,

By Jones's comments:

--------------------------------------------------------------------------

Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

From: Shunquan Lin <[email protected]>

This patch adds driver support for HiSilicon Flash Memory Controller(FMC). HiSilicon FMC is a multi-functions device which supports SPI Nor flash controller, SPI nand Flash controller and parallel nand flash controller.

MFDs are for devices which span multiple subsystems.

And we do! One of the subdrivers will live under drivers/spi/, the

other

Quoted 2 lines

under drivers/mtd/...

From my point of view, I think Jones mean to MFD's subsystems are working simultaneously
at the run-time, one period of time is working for sub-device-1 and later period of time
is working for sub-device-2 and so on.

But for RPC-IF, SPI or HF mode is decided at boot time by pins configure and later in kernel
by dtb, RPC-IF can't switch SPI and HF mode at the run time.

Quoted 6 lines
Quoted 5 lines

Please submit this to MTD.

_https://marc.info/?l=devicetree&m=147376842210229&w=2_

-------------------------------------------------------------------------------------------------

Quoted 7 lines
Quoted 3 lines

I will patch RPC-IF back to SPI mode according to previous patches:

I still don't see why you want to do this...

Quoted 1 line

-----------------------------------------------------------------------

Quoted 10 lines
Quoted 10 lines · Mark Brown
Quoted 9 lines

The patch

spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver

has been applied to the spi tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git

All being well this means that it will be integrated into the

linux-next

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

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

Quoted 1 line
Quoted 1 line
Quoted 1 line

and review of the tree, please engage with people reporting problems

and

Quoted 1 line
Quoted 1 line
Quoted 1 line

send followup patches addressing any issues that are reported if

needed.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

If any updates are required or you are submitting further changes

they

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

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

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

to this mail.

------------------------------------------------------------------------

Quoted 5 lines
Quoted 2 lines

agreed it ?

No, I don't agree.

So far, Jones seems don't agree RPC-IF to MFD and then RPC MFD will not applied
to mfd tree by him !

Quoted 5 lines

[...]

Quoted 2 lines

thanks & best regards,
Mason

MBR, Sergei

thanks & best regards,
Mason

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

============================================================================

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

#18 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hi Mason,

Quoted 85 lines · On Fri, May 10, 2019 at 3:09 AM <[email protected]> wrote:
Quoted 75 lines

"Sergei Shtylyov" <[email protected]>
2019/05/10 上午 03:24
[email protected], "Rob Herring" <[email protected]>, [email protected] On 05/09/2019 05:06 AM, [email protected] wrote:

[...]

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 7 lines · Rob Herring
Quoted 6 lines · Mason Yang
Quoted 5 lines

Document the bindings used by the Renesas R-Car Gen3 RPC-IF MFD.

---
 .../devicetree/bindings/mfd/mfd-renesas-rpc.txt    | 40 ++++++

++++++++++++++++

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/mfd-

renesas-rpc.txt

Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

rpc.txt b/Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt line 2

Quoted 7 lines

new file mode 100644
index 0000000..668b822

Documentation/devicetree/bindings/mfd/mfd-renesas-rpc.txt new file +2 -0
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What

makes it an

Quoted 45 lines
Quoted 28 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
Quoted 1 line

MFD?

It supports both SPI NOR and HyperFlash (CFI-compliant flash with different bus interface).

Looks like you're registering one OR the other.

Why don't you just do this from DT?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

No reason for this to be an MFD IMHO.

okay, I will patch it back to SPI mode only.

I don't think that's what Lee meant . The controller supports _both_ modes , hence it would have the same compatible string. You just need to extract the mode of operation from the DT.

HiSilicon attempted to upstream something similar, only their controller provided NAND and NOR functionality. They used different compatible strings to differentiate between the varying technologies.

They too tried to use MFD as a means to select between them (which was also NACKed). Not sure what they ended up doing, but the original submission and (half of) the conversation can be found at [0]. Some more of the thread continues at [1].

Quoted 4 lines

Hope that helps.

[0] https://groups.google.com/forum/#!topic/fa.linux.kernel/F6i9o8sfOIw
[1] https://marc.info/?l=devicetree&m=147669165104431&w=2

Hi Marek,

By Jones's comments:
--------------------------------------------------------------------------

Quoted 6 lines

From: Shunquan Lin <[email protected]>

This patch adds driver support for HiSilicon Flash Memory Controller(FMC). HiSilicon FMC is a multi-functions device which supports SPI Nor flash controller, SPI nand Flash controller and parallel nand flash controller.

Quoted 5 lines
Quoted 1 line

MFDs are for devices which span multiple subsystems.

And we do! One of the subdrivers will live under drivers/spi/, the other
under drivers/mtd/...

From my point of view, I think Jones mean to MFD's subsystems are working simultaneously at the run-time, one period of time is working for sub-device-1 and later period of time is working for sub-device-2 and so on.

Quoted 5 lines

But for RPC-IF, SPI or HF mode is decided at boot time by pins configure and later in kernel by dtb, RPC-IF can't switch SPI and HF mode at the run time.

So far, Jones seems don't agree RPC-IF to MFD and then RPC MFD will not applied to mfd tree by him !

There's precedence for such constructs being an MFD: please see drivers/mfd/at91-usart.c, which registers a single MFD cell for either serial or SPI.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#19 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hi Geert,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

[...]

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Rob Herring
Quoted 1 line

On Wed, Apr 24, 2019 at 03:55:36PM +0800, Mason Yang

Quoted 15 lines · wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Document the bindings used by the Renesas R-Car

Gen3 RPC-IF MFD.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

---
.../devicetree/bindings/mfd/mfd-renesas-rpc.txt

| 40 ++++++

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

++++++++++++++++

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/

bindings/mfd/mfd-

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

renesas-rpc.txt

Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

mfd-renesas-

Quoted 16 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

rpc.txt b/Documentation/devicetree/bindings/mfd/mfd-

renesas-rpc.txt

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Documentation/devicetree/bindings/mfd/mfd-

Quoted 4 lines

new file mode 100644
index 0000000..668b822

Documentation/devicetree/bindings/mfd/mfd- new file +0 -0

renesas-rpc.txt

Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Documentation/devicetree/bindings/mfd/mfd- line 2

Quoted 3 lines
Documentation/devicetree/bindings/mfd/mfd- new file +2 -0
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What

makes it an

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

MFD?

It supports both SPI NOR and HyperFlash

(CFI-compliantflash with

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

different bus interface).

Looks like you're registering one OR the other.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Why don't you just do this from DT?

No reason for this to be an MFD IMHO.

okay, I will patch it back to SPI mode only.

I don't think that's what Lee meant . The controller supports

_both_

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

modes , hence it would have the same compatible string. You

just need to

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

extract the mode of operation from the DT.

HiSilicon attempted to upstream something similar, only their controller provided NAND and NOR functionality. They used

different

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

compatible strings to differentiate between the varying technologies.

They too tried to use MFD as a means to select between them

(which was

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

also NACKed). Not sure what they ended up doing, but the

original

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

submission and (half of) the conversation can be found at [0].

Some

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

more of the thread continues at [1].

Hope that helps.

[0]

https://groups.google.com/forum/#!topic/fa.linux.kernel/F6i9o8sfOIw

Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

[1] https://marc.info/?l=devicetree&m=147669165104431&w=2

Hi Marek,

By Jones's comments:

--------------------------------------------------------------------------

Quoted 24 lines
Quoted 10 lines
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

From: Shunquan Lin <[email protected]>

This patch adds driver support for HiSilicon Flash Memory Controller(FMC). HiSilicon FMC is a multi-functions device which supports SPI Nor flash controller, SPI nand Flash controller and parallel nand flash controller.

MFDs are for devices which span multiple subsystems.

And we do! One of the subdrivers will live under drivers/

spi/, the other

Quoted 4 lines
Quoted 2 lines

under drivers/mtd/...

From my point of view, I think Jones mean to MFD's subsystems are

working simultaneously

Quoted 1 line

at the run-time, one period of time is working for sub-device-1

and later period of time

Quoted 3 lines

is working for sub-device-2 and so on.

But for RPC-IF, SPI or HF mode is decided at boot time by pins

configure and later in kernel

Quoted 1 line

by dtb, RPC-IF can't switch SPI and HF mode at the run time.

Quoted 7 lines
Quoted 1 line

So far, Jones seems don't agree RPC-IF to MFD and then RPC MFD

will not applied

Quoted 1 line

to mfd tree by him !

There's precedence for such constructs being an MFD: please see drivers/mfd/at91-usart.c, which registers a single MFD cell for either serial or SPI.

okay, many thanks for your information.

How about to patch RPF-IF dts to:
-------------------------------------------------------------->

Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
---------------------------------------------------------

RPC-IF supports both SPI NOR and HyperFlash (CFI-compliant flash)

Required properties:
- compatible: should be an SoC-specific compatible value, followed by "renesas,rcar-gen3-rpc" as a fallback. supported SoC-specific values are:
"renesas,r8a77995-rpc" (R-Car D3)
- reg: should contain three register areas:
first for the base address of RPC-IF registers, second for the direct mapping read mode and
third for the write buffer area.
- reg-names: should contain "regs", "dirmap" and "wbuf"
- clocks: should contain 1 entries for the module's clock
- clock-names: should contain "rpc"

Example:
- SPI mode:

          rpc: rpc-if@ee200000 {
                  compatible = "renesas,r8a77995-rpc", 
"renesas,rcar-gen3-rpc";
                  reg = <0 0xee200000 0 0x200>, <0 0x08000000 0 
0x4000000>,
                        <0 0xee208000 0 0x100>;
                  reg-names = "regs", "dirmap", "wbuf";
                  clocks = <&cpg CPG_MOD 917>;
                  clock-names = "rpc";
                  power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
                  resets = <&cpg 917>;
                  #address-cells = <1>;
                  #size-cells = <0>;
 
                  flash@0 {
                          compatible = "jedec,spi-nor";
                          reg = <0>;
                          spi-max-frequency = <40000000>;
                          spi-tx-bus-width = <1>;
                          spi-rx-bus-width = <1>;
                  };
          };

- HF mode:

          rpc: rpc-if@ee200000 {
                  compatible = "renesas,r8a77995-rpc", 
"renesas,rcar-gen3-rpc";
                  reg = <0 0xee200000 0 0x200>, <0 0x08000000 0 
0x4000000>,
                        <0 0xee208000 0 0x100>;
                  reg-names = "regs", "dirmap", "wbuf";
                  clocks = <&cpg CPG_MOD 917>;
                  clock-names = "rpc";
                  power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
                  resets = <&cpg 917>;
                  #address-cells = <1>;
                  #size-cells = <1>;
 
                  flash@0 {
                          compatible = "cfi-flash";
                          reg = <0 0x4000000>;
                  };
          };

--------------------------------------------------------------<

Is it OK ?

Quoted 10 lines

Gr{oetje,eeting}s,

Geert

Signature · 4 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- 
[email protected]

In personal conversations with technical people, I call myself a hacker. 

But

Quoted 1 line

when I'm talking to journalists I just say "programmer" or somethinglike

that.

Quoted 1 line

-- Linus Torvalds

thanks & best regards,
Mason

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

============================================================================

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

#20 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hi Mason,

Note that if you send multipart/text+html emails, they will be dropped silently by most Linux mailing lists.
Hence I'm quoting your last email fully, to give other people a chance reading it (and commenting).

Quoted 169 lines · On Mon, May 13, 2019 at 11:37 AM <[email protected]> wrote:
Quoted 95 lines
Quoted 4 lines
Quoted 4 lines

[...]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines · Rob Herring
Quoted 2 lines · Mason Yang
Quoted 1 line

Document the bindings used by the Renesas R-Car

Gen3 RPC-IF MFD.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

---
.../devicetree/bindings/mfd/mfd-renesas-rpc.txt

| 40 ++++++

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

++++++++++++++++

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/

bindings/mfd/mfd-

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

renesas-rpc.txt

Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

mfd-renesas-

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

rpc.txt b/Documentation/devicetree/bindings/mfd/mfd-

renesas-rpc.txt

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Documentation/devicetree/bindings/mfd/mfd-

Quoted 4 lines

new file mode 100644
index 0000000..668b822

Documentation/devicetree/bindings/mfd/mfd- new file +0 -0

renesas-rpc.txt

Quoted 15 lines
Quoted 15 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Documentation/devicetree/bindings/mfd/mfd- line 2

Quoted 3 lines
Documentation/devicetree/bindings/mfd/mfd- new file +2 -0
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What

makes it an

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
Quoted 1 line

MFD?

It supports both SPI NOR and HyperFlash (CFI-compliantflash with different bus interface).

Looks like you're registering one OR the other.

Why don't you just do this from DT?

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

No reason for this to be an MFD IMHO.

okay, I will patch it back to SPI mode only.

I don't think that's what Lee meant . The controller supports _both_ modes , hence it would have the same compatible string. You

just need to

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 1 line

extract the mode of operation from the DT.

HiSilicon attempted to upstream something similar, only their controller provided NAND and NOR functionality. They used different compatible strings to differentiate between the varying technologies.

They too tried to use MFD as a means to select between them (which was also NACKed). Not sure what they ended up doing, but the original submission and (half of) the conversation can be found at [0]. Some more of the thread continues at [1].

Hope that helps.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

[0] https://groups.google.com/forum/#!topic/fa.linux.kernel/F6i9o8sfOIw
[1] https://marc.info/?l=devicetree&m=147669165104431&w=2

Hi Marek,

By Jones's comments:

--------------------------------------------------------------------------

Quoted 10 lines
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

From: Shunquan Lin <[email protected]>

This patch adds driver support for HiSilicon Flash Memory Controller(FMC). HiSilicon FMC is a multi-functions device which supports SPI Nor flash controller, SPI nand Flash controller and parallel nand flash controller.

MFDs are for devices which span multiple subsystems.

And we do! One of the subdrivers will live under drivers/

spi/, the other

Quoted 4 lines
Quoted 2 lines

under drivers/mtd/...

From my point of view, I think Jones mean to MFD's subsystems are

working simultaneously

Quoted 1 line

at the run-time, one period of time is working for sub-device-1

and later period of time

Quoted 3 lines

is working for sub-device-2 and so on.

But for RPC-IF, SPI or HF mode is decided at boot time by pins

configure and later in kernel

Quoted 1 line

by dtb, RPC-IF can't switch SPI and HF mode at the run time.

Quoted 7 lines
Quoted 1 line

So far, Jones seems don't agree RPC-IF to MFD and then RPC MFD

will not applied

Quoted 1 line

to mfd tree by him !

There's precedence for such constructs being an MFD: please see drivers/mfd/at91-usart.c, which registers a single MFD cell for either serial or SPI.

okay, many thanks for your information.

How about to patch RPF-IF dts to:
-------------------------------------------------------------->

Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
---------------------------------------------------------

RPC-IF supports both SPI NOR and HyperFlash (CFI-compliant flash)

Required properties:
- compatible: should be an SoC-specific compatible value, followed by "renesas,rcar-gen3-rpc" as a fallback. supported SoC-specific values are:
"renesas,r8a77995-rpc" (R-Car D3)
- reg: should contain three register areas:
first for the base address of RPC-IF registers, second for the direct mapping read mode and
third for the write buffer area.
- reg-names: should contain "regs", "dirmap" and "wbuf"
- clocks: should contain 1 entries for the module's clock
- clock-names: should contain "rpc"

Example:
- SPI mode:

          rpc: rpc-if@ee200000 {
                  compatible = "renesas,r8a77995-rpc", "renesas,rcar-gen3-rpc";
                  reg = <0 0xee200000 0 0x200>, <0 0x08000000 0 0x4000000>,
                        <0 0xee208000 0 0x100>;
                  reg-names = "regs", "dirmap", "wbuf";
                  clocks = <&cpg CPG_MOD 917>;
                  clock-names = "rpc";
                  power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
                  resets = <&cpg 917>;
                  #address-cells = <1>;
                  #size-cells = <0>;

                  flash@0 {
                          compatible = "jedec,spi-nor";
                          reg = <0>;
                          spi-max-frequency = <40000000>;
                          spi-tx-bus-width = <1>;
                          spi-rx-bus-width = <1>;
                  };
          };
  - HF mode:
          rpc: rpc-if@ee200000 {
                  compatible = "renesas,r8a77995-rpc", "renesas,rcar-gen3-rpc";
                  reg = <0 0xee200000 0 0x200>, <0 0x08000000 0 0x4000000>,
                        <0 0xee208000 0 0x100>;
                  reg-names = "regs", "dirmap", "wbuf";
                  clocks = <&cpg CPG_MOD 917>;
                  clock-names = "rpc";
                  power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
                  resets = <&cpg 917>;
                  #address-cells = <1>;
                  #size-cells = <1>;
                  flash@0 {
                          compatible = "cfi-flash";
                          reg = <0 0x4000000>;
                  };
          };
Quoted 3 lines

--------------------------------------------------------------<

Is it OK ?

I'll defer to the MTD experts.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#21 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hi Geert,

Quoted 3 lines

Subject

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF

MFD bindings

Quoted 4 lines

Hi Mason,

Note that if you send multipart/text+html emails, they will be dropped

silently

Quoted 3 lines

by most Linux mailing lists.
Hence I'm quoting your last email fully, to give other people a chance reading it (and commenting).

Thanks for your remind !
I have configured my Lotus Notes to plain text mode only and it should be OK
for Linux mailing lists now.

thanks & best regards,
Mason

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

============================================================================

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

#22 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

In reply to [email protected]

Hello!

Quoted 95 lines · On 05/13/2019 12:37 PM, [email protected] wrote:
Quoted 95 lines
Quoted 4 lines
Quoted 4 lines

[...]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines · Rob Herring
Quoted 2 lines · Mason Yang
Quoted 1 line

Document the bindings used by the Renesas R-Car

Gen3 RPC-IF MFD.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

---
.../devicetree/bindings/mfd/mfd-renesas-rpc.txt

| 40 ++++++

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

++++++++++++++++

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/

bindings/mfd/mfd-

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

renesas-rpc.txt

Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

mfd-renesas-

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

rpc.txt b/Documentation/devicetree/bindings/mfd/mfd-

renesas-rpc.txt

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Documentation/devicetree/bindings/mfd/mfd-

Quoted 4 lines

new file mode 100644
index 0000000..668b822

Documentation/devicetree/bindings/mfd/mfd- new file +0 -0

renesas-rpc.txt

Quoted 15 lines
Quoted 15 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Documentation/devicetree/bindings/mfd/mfd- line 2

Quoted 3 lines
Documentation/devicetree/bindings/mfd/mfd- new file +2 -0
@@ -0,0 +1,40 @@
+Renesas R-Car Gen3 RPC-IF MFD Device Tree Bindings
+--------------------------------------------------

Looks like a SPI flash controller from the example. What

makes it an

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
Quoted 1 line

MFD?

It supports both SPI NOR and HyperFlash (CFI-compliantflash with different bus interface).

Looks like you're registering one OR the other.

Why don't you just do this from DT?

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

No reason for this to be an MFD IMHO.

okay, I will patch it back to SPI mode only.

I don't think that's what Lee meant . The controller supports _both_ modes , hence it would have the same compatible string. You

just need to

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 1 line

extract the mode of operation from the DT.

HiSilicon attempted to upstream something similar, only their controller provided NAND and NOR functionality. They used different compatible strings to differentiate between the varying technologies.

They too tried to use MFD as a means to select between them (which was also NACKed). Not sure what they ended up doing, but the original submission and (half of) the conversation can be found at [0]. Some more of the thread continues at [1].

Hope that helps.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

[0] https://groups.google.com/forum/#!topic/fa.linux.kernel/F6i9o8sfOIw
[1] https://marc.info/?l=devicetree&m=147669165104431&w=2

Hi Marek,

By Jones's comments:

--------------------------------------------------------------------------

Quoted 10 lines
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

From: Shunquan Lin <[email protected]>

This patch adds driver support for HiSilicon Flash Memory Controller(FMC). HiSilicon FMC is a multi-functions device which supports SPI Nor flash controller, SPI nand Flash controller and parallel nand flash controller.

MFDs are for devices which span multiple subsystems.

And we do! One of the subdrivers will live under drivers/

spi/, the other

Quoted 4 lines
Quoted 2 lines

under drivers/mtd/...

From my point of view, I think Jones mean to MFD's subsystems are

working simultaneously

Quoted 1 line

at the run-time, one period of time is working for sub-device-1

and later period of time

Quoted 3 lines

is working for sub-device-2 and so on.

But for RPC-IF, SPI or HF mode is decided at boot time by pins

configure and later in kernel

Quoted 1 line

by dtb, RPC-IF can't switch SPI and HF mode at the run time.

Quoted 7 lines
Quoted 7 lines
Quoted 1 line

So far, Jones seems don't agree RPC-IF to MFD and then RPC MFD

will not applied

Quoted 1 line

to mfd tree by him !

There's precedence for such constructs being an MFD: please see drivers/mfd/at91-usart.c, which registers a single MFD cell for either serial or SPI.

Thanks fir your example, Geert! :-)

Quoted 10 lines

okay, many thanks for your information.

How about to patch RPF-IF dts to:
-------------------------------------------------------------->

Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
---------------------------------------------------------

RPC-IF supports both SPI NOR and HyperFlash (CFI-compliant flash)

Quoted 7 lines

Required properties:
- compatible: should be an SoC-specific compatible value, followed by "renesas,rcar-gen3-rpc" as a fallback. supported SoC-specific values are:
"renesas,r8a77995-rpc" (R-Car D3)
- reg: should contain three register areas:
first for the base address of RPC-IF registers,

I'd drop "the base address" here.

Quoted 5 lines

second for the direct mapping read mode and third for the write buffer area.
- reg-names: should contain "regs", "dirmap" and "wbuf"
- clocks: should contain 1 entries for the module's clock
- clock-names: should contain "rpc"

I suspect we'd need the RPC/RPCD2 clocks mentioned as well (not sure yet)... And how about "power-domains", "resets" (seen in the example below),
also what about #address-cells & #size-cells?

Quoted 2 lines

Example:

Could you please indent with 1 or 2 tabs where you used 8 or 16 spaces?

Quoted 3 lines

- SPI mode:

          rpc: rpc-if@ee200000 {

The node names should be generic, based on the device class. And in this
case I'd like to use "spi@ee200000" as otherwise dtc keeps bitching like below:

arch/arm64/boot/dts/renesas/r8a77980.dtsi:1344.21-1359.5: Warning (spi_bus_bridge):
/soc/rpc@ee200000: node name for SPI buses should be 'spi'
also defined at arch/arm64/boot/dts/renesas/r8a77980-condor.dts:283.6-343.3
arch/arm64/boot/dts/renesas/r8a77980-condor.dtb: Warning (spi_bus_reg):
Failed prerequisite 'spi_bus_bridge'

Quoted 2 lines

- HF mode:

          rpc: rpc-if@ee200000 {

Again, spi@<...>.

Quoted 5 lines
                  compatible = "renesas,r8a77995-rpc", "renesas,rcar-gen3-rpc";
                  reg = <0 0xee200000 0 0x200>, <0 0x08000000 0 0x4000000>,
                        <0 0xee208000 0 0x100>;
                  reg-names = "regs", "dirmap", "wbuf";
                  clocks = <&cpg CPG_MOD 917>;
Quoted 8 lines
                  clock-names = "rpc";
                  power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
                  resets = <&cpg 917>;
                  #address-cells = <1>;
                  #size-cells = <1>;
 
                  flash@0 {
                          compatible = "cfi-flash";

The working HF implementation has "cypress,hyperflash" before "cfi-flash".

Quoted 7 lines
                          reg = <0 0x4000000>;
                  };
          };

--------------------------------------------------------------<

Is it OK ?

Yeah, seems good (assuming you fix the issues above).

[...]

Quoted 2 lines

thanks & best regards,
Mason

MBR, Sergei

#23 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hello,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

There's precedence for such constructs being an MFD: please see drivers/mfd/at91-usart.c, which registers a single MFD cell for

either

Quoted 16 lines
Quoted 1 line
Quoted 1 line

serial or SPI.

Thanks fir your example, Geert! :-)

Quoted 12 lines

okay, many thanks for your information.

How about to patch RPF-IF dts to:
-------------------------------------------------------------->

Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
---------------------------------------------------------

RPC-IF supports both SPI NOR and HyperFlash (CFI-compliant flash)

Required properties:
- compatible: should be an SoC-specific compatible value, followed

by

Quoted 7 lines
Quoted 5 lines

"renesas,rcar-gen3-rpc" as a fallback. supported SoC-specific values are:
"renesas,r8a77995-rpc" (R-Car D3)
- reg: should contain three register areas:
first for the base address of RPC-IF registers,

I'd drop "the base address" here.

okay.

Quoted 8 lines
Quoted 6 lines

second for the direct mapping read mode and third for the write buffer area.
- reg-names: should contain "regs", "dirmap" and "wbuf"
- clocks: should contain 1 entries for the module's clock
- clock-names: should contain "rpc"

I suspect we'd need the RPC/RPCD2 clocks mentioned as well (not sure

yet)...

Need it ?
RPCD2 is derived from RPC and it's value is half of RPC, i.e., RPC = 160MHz, RPCD2 = 80 MHz

Quoted 7 lines

And how about "power-domains", "resets" (seen in the example below),
also what about #address-cells & #size-cells?

Quoted 2 lines

Example:

Could you please indent with 1 or 2 tabs where you used 8 or 16

spaces?

Quoted 6 lines
Quoted 4 lines

- SPI mode:

          rpc: rpc-if@ee200000 {

The node names should be generic, based on the device class. And in

this

Quoted 1 line

case I'd like to use "spi@ee200000" as otherwise dtc keeps bitching like

below:

okay, patch to

rpc_if: spi@<...>

Quoted 2 lines

arch/arm64/boot/dts/renesas/r8a77980.dtsi:1344.21-1359.5: Warning

(spi_bus_bridge):

Quoted 2 lines

/soc/rpc@ee200000: node name for SPI buses should be 'spi'
also defined at

arch/arm64/boot/dts/renesas/r8a77980-condor.dts:283.6-343.3

Quoted 8 lines

arch/arm64/boot/dts/renesas/r8a77980-condor.dtb: Warning (spi_bus_reg):
Failed prerequisite 'spi_bus_bridge'

Quoted 2 lines

- HF mode:

          rpc: rpc-if@ee200000 {
   Again, spi@<...>.

what about rpc_if: hf@<...>

Quoted 2 lines
Quoted 2 lines
                  compatible = "renesas,r8a77995-rpc", 

"renesas,rcar-gen3-rpc";

Quoted 1 line
Quoted 1 line
                  reg = <0 0xee200000 0 0x200>, <0 0x08000000 0 

0x4000000>,

Quoted 9 lines
Quoted 9 lines
                        <0 0xee208000 0 0x100>;
                  reg-names = "regs", "dirmap", "wbuf";
                  clocks = <&cpg CPG_MOD 917>;
                  clock-names = "rpc";
                  power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
                  resets = <&cpg 917>;
                  #address-cells = <1>;
                  #size-cells = <1>;
Quoted 4 lines
Quoted 2 lines
                  flash@0 {
                          compatible = "cfi-flash";

The working HF implementation has "cypress,hyperflash" before

"cfi-flash".

Quoted 10 lines
Quoted 8 lines
                          reg = <0 0x4000000>;
                  };
          };

--------------------------------------------------------------<

Is it OK ?

Yeah, seems good (assuming you fix the issues above).

Patch new DTS to ===============================================================>

+Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
+---------------------------------------------------------
+
+RPC-IF supports both SPI NOR and HyperFlash (CFI-compliant flash) +
+Required properties:

+- compatible: should be an SoC-specific compatible value, followed by
+                                "renesas,rcar-gen3-rpc" as a fallback.
+                                supported SoC-specific values are:
+                                "renesas,r8a77995-rpc"          (R-Car 
D3)
+- reg: should contain three register areas:
+                first for RPC-IF registers,
+                second for the direct mapping read mode and
+                third for the write buffer area.
+- reg-names: should contain "regs", "dirmap" and "wbuf"
+- clocks: should contain 1 entries for the module's clock
+- clock-names: should contain "rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0

+
+Example:
+- SPI mode:
+
+ rpc_if: spi@ee200000 {
+ compatible = "renesas,r8a77995-rpc",
"renesas,rcar-gen3-rpc";
+ reg = <0 0xee200000 0 0x200>, <0
0x08000000 0 0x4000000>,
+ <0 0xee208000 0 0x100>;

+                                reg-names = "regs", "dirmap", "wbuf";
+                                clocks = <&cpg CPG_MOD 917>;
+                                clock-names = "rpc";
+                                power-domains = <&sysc 
R8A77995_PD_ALWAYS_ON>;
+                                resets = <&cpg 917>;
+                                #address-cells = <1>;
+                                #size-cells = <0>;

+
+ flash@0 {
+ compatible =
"jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency =
<40000000>;
+ spi-tx-bus-width = <1>;
+ spi-rx-bus-width = <1>;
+ };
+ };
+

+- HF mode:
+                rpc_if: hf@ee200000 {
+                                compatible = "renesas,r8a77995-rpc", 

"renesas,rcar-gen3-rpc";
+ reg = <0 0xee200000 0 0x200>, <0
0x08000000 0 0x4000000>,
+ <0 0xee208000 0 0x100>;

+                                reg-names = "regs", "dirmap", "wbuf";
+                                clocks = <&cpg CPG_MOD 917>;
+                                clock-names = "rpc";
+                                power-domains = <&sysc 
R8A77995_PD_ALWAYS_ON>;
+                                resets = <&cpg 917>;
+                                #address-cells = <1>;
+                                #size-cells = <0>;

+
+ flash@0 {
+ compatible =
"cypress,hyperflash", "cfi-flash";
+ reg = <0>;
+ };
+ };

=======================================================================<

OK ?

thanks & best regards,
Mason

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

============================================================================

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

#24 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hi Mason,

Quoted 8 lines · On Tue, May 14, 2019 at 11:46 AM <[email protected]> wrote:
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

There's precedence for such constructs being an MFD: please see drivers/mfd/at91-usart.c, which registers a single MFD cell for

second for the direct mapping read mode and third for the write buffer area.
- reg-names: should contain "regs", "dirmap" and "wbuf"
- clocks: should contain 1 entries for the module's clock
- clock-names: should contain "rpc"

Quoted 6 lines
Quoted 1 line

I suspect we'd need the RPC/RPCD2 clocks mentioned as well (not sure

yet)...

Need it ?
RPCD2 is derived from RPC and it's value is half of RPC, i.e., RPC = 160MHz, RPCD2 = 80 MHz

That hierarchy depends on the actual SoC, right?
AFAIU, both are derived from RPCSRC, and can be controlled individually on some SoCs.

BTW, I still haven't seen a patch for drivers/clk/renesas/r8a77995-cpg-mssr.c adding RPC-related clocks, so I have no idea what's the Linux view of the hierarchy on your system.

Thanks!

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#25 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

In reply to [email protected]
Quoted 6 lines · On 05/14/2019 12:46 PM, [email protected] wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

There's precedence for such constructs being an MFD: please see drivers/mfd/at91-usart.c, which registers a single MFD cell for

either

Quoted 3 lines
Quoted 1 line
Quoted 1 line

serial or SPI.

Thanks fir your example, Geert! :-)

s/fir/for/, not the firtree season anymore. :-)

Quoted 29 lines
Quoted 5 lines
Quoted 5 lines

okay, many thanks for your information.

How about to patch RPF-IF dts to:
-------------------------------------------------------------->

Quoted 7 lines
Quoted 7 lines

Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
---------------------------------------------------------

RPC-IF supports both SPI NOR and HyperFlash (CFI-compliant flash)

Required properties:
- compatible: should be an SoC-specific compatible value, followed

by

Quoted 7 lines
Quoted 5 lines

"renesas,rcar-gen3-rpc" as a fallback. supported SoC-specific values are:
"renesas,r8a77995-rpc" (R-Car D3)
- reg: should contain three register areas:
first for the base address of RPC-IF registers,

I'd drop "the base address" here.

okay.

Quoted 6 lines
Quoted 5 lines

second for the direct mapping read mode and third for the write buffer area.
- reg-names: should contain "regs", "dirmap" and "wbuf"
- clocks: should contain 1 entries for the module's clock
- clock-names: should contain "rpc"

Quoted 4 lines
Quoted 1 line

I suspect we'd need the RPC/RPCD2 clocks mentioned as well (not sure

yet)...

Need it ?

You seem to call clk_get_rate() on the module clock, I doubt that's
correct topologically...

Quoted 2 lines

RPCD2 is derived from RPC and it's value is half of RPC, i.e., RPC = 160MHz, RPCD2 = 80 MHz

I know.

Quoted 13 lines
Quoted 7 lines

And how about "power-domains", "resets" (seen in the example below),
also what about #address-cells & #size-cells?

Quoted 2 lines

Example:

Could you please indent with 1 or 2 tabs where you used 8 or 16

spaces?

Quoted 5 lines
Quoted 4 lines

- SPI mode:

          rpc: rpc-if@ee200000 {
Quoted 8 lines
Quoted 1 line

The node names should be generic, based on the device class. And in

this

Quoted 1 line

case I'd like to use "spi@ee200000" as otherwise dtc keeps bitching like

below:

okay, patch to

rpc_if: spi@<...>

That, or just keep the node label.

Quoted 9 lines
Quoted 1 line

arch/arm64/boot/dts/renesas/r8a77980.dtsi:1344.21-1359.5: Warning

(spi_bus_bridge):

Quoted 2 lines

/soc/rpc@ee200000: node name for SPI buses should be 'spi'
also defined at

arch/arm64/boot/dts/renesas/r8a77980-condor.dts:283.6-343.3

Quoted 4 lines

arch/arm64/boot/dts/renesas/r8a77980-condor.dtb: Warning (spi_bus_reg):
Failed prerequisite 'spi_bus_bridge'

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

- HF mode:

          rpc: rpc-if@ee200000 {
   Again, spi@<...>.

what about rpc_if: hf@<...>

Can't change the node name, as it's declared in the .dtsi files, not *.dts
ones. And "spi" works for the HF case as well -- no complaints from dtc. :-)

Quoted 44 lines
Quoted 1 line
Quoted 1 line
                  compatible = "renesas,r8a77995-rpc", 

"renesas,rcar-gen3-rpc";

Quoted 1 line
Quoted 1 line
                  reg = <0 0xee200000 0 0x200>, <0 0x08000000 0 

0x4000000>,

Quoted 9 lines
Quoted 9 lines
                        <0 0xee208000 0 0x100>;
                  reg-names = "regs", "dirmap", "wbuf";
                  clocks = <&cpg CPG_MOD 917>;
                  clock-names = "rpc";
                  power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
                  resets = <&cpg 917>;
                  #address-cells = <1>;
                  #size-cells = <1>;
Quoted 4 lines
Quoted 2 lines
                  flash@0 {
                          compatible = "cfi-flash";

The working HF implementation has "cypress,hyperflash" before

"cfi-flash".

Quoted 10 lines
Quoted 8 lines
                          reg = <0 0x4000000>;
                  };
          };

--------------------------------------------------------------<

Is it OK ?

Yeah, seems good (assuming you fix the issues above).

Patch new DTS to ===============================================================>

(quoted diff) +10 -0
+Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
+---------------------------------------------------------
+
+RPC-IF supports both SPI NOR and HyperFlash (CFI-compliant flash)
+
+Required properties:
+- compatible: should be an SoC-specific compatible value, followed by
+                                "renesas,rcar-gen3-rpc" as a fallback.
+                                supported SoC-specific values are:
+                                "renesas,r8a77995-rpc"          (R-Car 

D3)
+- reg: should contain three register areas:

Review

Quoted 8 lines
(quoted diff) +8 -0
+                first for RPC-IF registers,
+                second for the direct mapping read mode and
+                third for the write buffer area.
+- reg-names: should contain "regs", "dirmap" and "wbuf"
+- clocks: should contain 1 entries for the module's clock
+- clock-names: should contain "rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0

Still nothing about the "oower-domains" and "resets" props... :-(

Quoted 18 lines
(quoted diff) +6 -0
+
+Example:
+- SPI mode:
+
+                rpc_if: spi@ee200000 {
+                                compatible = "renesas,r8a77995-rpc", 

"renesas,rcar-gen3-rpc";
+ reg = <0 0xee200000 0 0x200>, <0
0x08000000 0 0x4000000>,

(quoted diff) +5 -0
+                                      <0 0xee208000 0 0x100>;
+                                reg-names = "regs", "dirmap", "wbuf";
+                                clocks = <&cpg CPG_MOD 917>;
+                                clock-names = "rpc";
+                                power-domains = <&sysc 

R8A77995_PD_ALWAYS_ON>;

(quoted diff) +3 -0
+                                resets = <&cpg 917>;
+                                #address-cells = <1>;
+                                #size-cells = <0>;

[...]

Quoted 3 lines

=======================================================================<

OK ?

Yes, with the remaining issue fixed.

Quoted 2 lines

thanks & best regards,
Mason

[...]

MBR, Sergei

#26 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hi Sergei,

Quoted 21 lines
Quoted 21 lines
Quoted 9 lines
Quoted 9 lines

-------------------------------------------------------------->

Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
---------------------------------------------------------

RPC-IF supports both SPI NOR and HyperFlash (CFI-compliant flash)

Required properties:
- compatible: should be an SoC-specific compatible value, followed

by

Quoted 7 lines
Quoted 5 lines

"renesas,rcar-gen3-rpc" as a fallback. supported SoC-specific values are:
"renesas,r8a77995-rpc" (R-Car D3)
- reg: should contain three register areas:
first for the base address of RPC-IF registers,

I'd drop "the base address" here.

okay.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

second for the direct mapping read mode and third for the write buffer area.
- reg-names: should contain "regs", "dirmap" and "wbuf"
- clocks: should contain 1 entries for the module's clock
- clock-names: should contain "rpc"

I suspect we'd need the RPC/RPCD2 clocks mentioned as well (not

sure

Quoted 6 lines
Quoted 3 lines

yet)...

Need it ?

You seem to call clk_get_rate() on the module clock, I doubt that's
correct topologically...

I think it's correct but just like Geert mentioned that there is no any patch
in drivers/clk/renesas/r8a77995-cpg-mssr.c adding RPC-related clocks.

I patched dt-bindings/clock/r8a77995-cpg-mssr.h for some simple testing

-#define R8A77995_CLK_RPC               29
-#define R8A77995_CLK_RPCD2             30
+#define R8A77995_CLK_RPC               31
+#define R8A77995_CLK_RPCD2             32

by clk_prepare_enable() & clk_disable_unprepare() with CPG_MOD 917 on D3 draak board, it is working fine.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

- SPI mode:git

          rpc: rpc-if@ee200000 {

The node names should be generic, based on the device class. And

in

Quoted 2 lines
Quoted 2 lines

this

Quoted 1 line

case I'd like to use "spi@ee200000" as otherwise dtc keeps bitching

like

Quoted 7 lines
Quoted 5 lines

below:

okay, patch to

rpc_if: spi@<...>

That, or just keep the node label.

okay.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

- HF mode:

          rpc: rpc-if@ee200000 {
   Again, spi@<...>.

what about rpc_if: hf@<...>

Can't change the node name, as it's declared in the .dtsi files, not

*.dts

Quoted 1 line

ones. And "spi" works for the HF case as well -- no complaints from dtc.

:-)

okay,

Patch DTS to ===============================================================> +Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
+---------------------------------------------------------
+
+RPC-IF supports both SPI NOR and HyperFlash (CFI-compliant flash) +
+Required properties:

+- compatible: should be an SoC-specific compatible value, followed by
+                                "renesas,rcar-gen3-rpc" as a fallback.
+                                supported SoC-specific values are:
+                                "renesas,r8a77995-rpc"          (R-Car 
D3)
+- reg: should contain three register areas:
+                first for RPC-IF registers,
+                second for the direct mapping read mode and
+                third for the write buffer area.
+- reg-names: should contain "regs", "dirmap" and "wbuf"
+- clocks: should contain 1 entries for the module's clock
+- clock-names: should contain "rpc"
+- power-domains: should contain system-controller(sysc) for 
power-domain-cell
+- resets: should contain clock pulse generator(cpg) for reset-cell,
+                  power-domain-cell and clock-cell
+- #address-cells: should be 1
+- #size-cells: should be 0

+
+Example:
+- SPI mode:
+
+ rpc: spi@ee200000 {
+ compatible = "renesas,r8a77995-rpc",
"renesas,rcar-gen3-rpc";
+ reg = <0 0xee200000 0 0x200>, <0
0x08000000 0 0x4000000>,
+ <0 0xee208000 0 0x100>;

+                                reg-names = "regs", "dirmap", "wbuf";
+                                clocks = <&cpg CPG_MOD 917>;
+                                clock-names = "rpc";
+                                power-domains = <&sysc 
R8A77995_PD_ALWAYS_ON>;
+                                resets = <&cpg 917>;
+                                #address-cells = <1>;
+                                #size-cells = <0>;

+
+ flash@0 {
+ compatible =
"jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency =
<40000000>;
+ spi-tx-bus-width = <1>;
+ spi-rx-bus-width = <1>;
+ };
+ };
+

+- HF mode:
+                rpc: spi@ee200000 {
+                                compatible = "renesas,r8a77995-rpc", 

"renesas,rcar-gen3-rpc";
+ reg = <0 0xee200000 0 0x200>, <0
0x08000000 0 0x4000000>,
+ <0 0xee208000 0 0x100>;

+                                reg-names = "regs", "dirmap", "wbuf";
+                                clocks = <&cpg CPG_MOD 917>;
+                                clock-names = "rpc";
+                                power-domains = <&sysc 
R8A77995_PD_ALWAYS_ON>;
+                                resets = <&cpg 917>;
+                                #address-cells = <1>;
+                                #size-cells = <0>;

+
+ flash@0 {
+ compatible =
"cypress,hyperflash", "cfi-flash";
+ reg = <0>;
+ };
+ };
===============================================================<

thanks & best regards,
Mason

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

============================================================================

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

#27 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hi Mason,

Quoted 19 lines · On Mon, May 20, 2019 at 9:24 AM <[email protected]> wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

- clocks: should contain 1 entries for the module's clock
- clock-names: should contain "rpc"

I suspect we'd need the RPC/RPCD2 clocks mentioned as well (not

sure

Quoted 6 lines
Quoted 3 lines

yet)...

Need it ?

You seem to call clk_get_rate() on the module clock, I doubt that's
correct topologically...

I think it's correct but just like Geert mentioned that there is no any patch
in drivers/clk/renesas/r8a77995-cpg-mssr.c adding RPC-related clocks.

I patched dt-bindings/clock/r8a77995-cpg-mssr.h for some simple testing

Review

Quoted 4 lines
(quoted diff) +2 -2
-#define R8A77995_CLK_RPC               29
-#define R8A77995_CLK_RPCD2             30
+#define R8A77995_CLK_RPC               31
+#define R8A77995_CLK_RPCD2             32

That change doesn't make sense to me...

Quoted 2 lines

by clk_prepare_enable() & clk_disable_unprepare() with CPG_MOD 917 on D3 draak board, it is working fine.

... and is not sufficient to allow the above two calls.

Besides, making explicit clk_prepare_enable() calls bypasses Runtime PM and the automatic disabling of unused clocks, thus hiding bugs related to Runtime PM. Which is probably why your driver doesn't work for Sergei...

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#28 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hi Geert,

Quoted 6 lines · On Mon, May 20, 2019 at 9:24 AM <[email protected]> wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

- clocks: should contain 1 entries for the module's clock
- clock-names: should contain "rpc"

I suspect we'd need the RPC/RPCD2 clocks mentioned as well

(not

Quoted 6 lines
Quoted 6 lines

sure

Quoted 5 lines
Quoted 3 lines

yet)...

Need it ?

You seem to call clk_get_rate() on the module clock, I doubt

that's

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

correct topologically...

I think it's correct but just like Geert mentioned that there is no

any

Quoted 5 lines
Quoted 5 lines

patch
in drivers/clk/renesas/r8a77995-cpg-mssr.c adding RPC-related clocks.

I patched dt-bindings/clock/r8a77995-cpg-mssr.h for some simple

testing

Quoted 8 lines

Review

Quoted 5 lines
(quoted diff) +2 -2
-#define R8A77995_CLK_RPC               29
-#define R8A77995_CLK_RPCD2             30
+#define R8A77995_CLK_RPC               31
+#define R8A77995_CLK_RPCD2             32

That change doesn't make sense to me...

Quoted 7 lines
Quoted 2 lines

by clk_prepare_enable() & clk_disable_unprepare() with CPG_MOD 917 on D3 draak board, it is working fine.

... and is not sufficient to allow the above two calls.

Besides, making explicit clk_prepare_enable() calls bypasses Runtime PM and the automatic disabling of unused clocks, thus hiding bugs related

to

Quoted 1 line

Runtime PM. Which is probably why your driver doesn't work for

Sergei...

Quoted 1 line

Got it, thanks for your explanation.

best regards,
Mason

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

============================================================================

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

#29 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

In reply to [email protected]
Quoted 21 lines · On 05/20/2019 10:23 AM, [email protected] wrote:
Quoted 21 lines
Quoted 21 lines
Quoted 9 lines
Quoted 9 lines

-------------------------------------------------------------->

Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
---------------------------------------------------------

RPC-IF supports both SPI NOR and HyperFlash (CFI-compliant flash)

Required properties:
- compatible: should be an SoC-specific compatible value, followed

by

Quoted 7 lines
Quoted 5 lines

"renesas,rcar-gen3-rpc" as a fallback. supported SoC-specific values are:
"renesas,r8a77995-rpc" (R-Car D3)
- reg: should contain three register areas:
first for the base address of RPC-IF registers,

I'd drop "the base address" here.

okay.

Quoted 14 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

second for the direct mapping read mode and third for the write buffer area.
- reg-names: should contain "regs", "dirmap" and "wbuf"
- clocks: should contain 1 entries for the module's clock
- clock-names: should contain "rpc"

I suspect we'd need the RPC/RPCD2 clocks mentioned as well (not

sure

Quoted 6 lines
Quoted 3 lines

yet)...

Need it ?

You seem to call clk_get_rate() on the module clock, I doubt that's
correct topologically...

clk_set_rate(), sorry.

Review

Quoted 12 lines

I think it's correct but just like Geert mentioned that there is no any patch
in drivers/clk/renesas/r8a77995-cpg-mssr.c adding RPC-related clocks.

I patched dt-bindings/clock/r8a77995-cpg-mssr.h for some simple testing

(quoted diff) +2 -2
-#define R8A77995_CLK_RPC               29
-#define R8A77995_CLK_RPCD2             30
+#define R8A77995_CLK_RPC               31
+#define R8A77995_CLK_RPCD2             32

Hm, what does this do?

Quoted 23 lines

by clk_prepare_enable() & clk_disable_unprepare() with CPG_MOD 917 on D3 draak board, it is working fine.

Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines

- SPI mode:git

          rpc: rpc-if@ee200000 {

The node names should be generic, based on the device class. And in
this
case I'd like to use "spi@ee200000" as otherwise dtc keeps bitching like below:

Quoted 5 lines
Quoted 3 lines

okay, patch to

rpc_if: spi@<...>

That, or just keep the node label.

okay.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

- HF mode:

          rpc: rpc-if@ee200000 {
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
   Again, spi@<...>.

what about rpc_if: hf@<...>

Can't change the node name, as it's declared in the .dtsi files, not *.dts
ones. And "spi" works for the HF case as well -- no complaints from dtc.

:-)

Maybe it's possible using the "name" prop, don't know...

Quoted 16 lines

okay,

Patch DTS to ===============================================================>

(quoted diff) +10 -0
+Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
+---------------------------------------------------------
+
+RPC-IF supports both SPI NOR and HyperFlash (CFI-compliant flash)
+
+Required properties:
+- compatible: should be an SoC-specific compatible value, followed by
+                                "renesas,rcar-gen3-rpc" as a fallback.
+                                supported SoC-specific values are:
+                                "renesas,r8a77995-rpc"          (R-Car 

D3)
+- reg: should contain three register areas:

Review

Quoted 5 lines
(quoted diff) +5 -0
+                first for RPC-IF registers,
+                second for the direct mapping read mode and
+                third for the write buffer area.
+- reg-names: should contain "regs", "dirmap" and "wbuf"
+- clocks: should contain 1 entries for the module's clock

1 entry (clock node phandle and specifier).

Quoted 3 lines
+- clock-names: should contain "rpc"
+- power-domains: should contain system-controller(sysc) for 

power-domain-cell

What's "power-domain-cell"? I know "#power-domain-cells". I'd like this
to be "the power domain node's phandle and specifier".

Quoted 1 line

+- resets: should contain clock pulse generator(cpg) for reset-cell,

It's "#reset-cells" again. I'd like this to be "the reset node's phandle
and specifier".

Quoted 1 line

+ power-domain-cell and clock-cell

Why mntion clock-cell at all here?

Quoted 27 lines
+- #address-cells: should be 1
+- #size-cells: should be 0
(quoted diff) +6 -0
+
+Example:
+- SPI mode:
+
+                rpc: spi@ee200000 {
+                                compatible = "renesas,r8a77995-rpc", 

"renesas,rcar-gen3-rpc";
+ reg = <0 0xee200000 0 0x200>, <0
0x08000000 0 0x4000000>,

(quoted diff) +5 -0
+                                      <0 0xee208000 0 0x100>;
+                                reg-names = "regs", "dirmap", "wbuf";
+                                clocks = <&cpg CPG_MOD 917>;
+                                clock-names = "rpc";
+                                power-domains = <&sysc 

R8A77995_PD_ALWAYS_ON>;

(quoted diff) +6 -0
+                                resets = <&cpg 917>;
+                                #address-cells = <1>;
+                                #size-cells = <0>;
+
+                                flash@0 {
+                                                compatible = 

"jedec,spi-nor";

(quoted diff) +2 -0
+                                                reg = <0>;
+                                                spi-max-frequency = 

<40000000>;

Review

Quoted 6 lines
(quoted diff) +6 -0
+                                                spi-tx-bus-width = <1>;
+                                                spi-rx-bus-width = <1>;
+                                };
+                };
+
+- HF mode:

HyperFlash, please.

Quoted 11 lines
(quoted diff) +2 -0
+                rpc: spi@ee200000 {
+                                compatible = "renesas,r8a77995-rpc", 

"renesas,rcar-gen3-rpc";
+ reg = <0 0xee200000 0 0x200>, <0
0x08000000 0 0x4000000>,

(quoted diff) +5 -0
+                                      <0 0xee208000 0 0x100>;
+                                reg-names = "regs", "dirmap", "wbuf";
+                                clocks = <&cpg CPG_MOD 917>;
+                                clock-names = "rpc";
+                                power-domains = <&sysc 

R8A77995_PD_ALWAYS_ON>;

Review

Quoted 3 lines
(quoted diff) +3 -0
+                                resets = <&cpg 917>;
+                                #address-cells = <1>;
+                                #size-cells = <0>;

And I don't think duplicating the same device node is a good idea...

Quoted 10 lines
(quoted diff) +2 -0
+                                flash@0 {
+                                                compatible = 

"cypress,hyperflash", "cfi-flash";

(quoted diff) +3 -0
+                                                reg = <0>;
+                                };
+                };

===============================================================<

thanks & best regards,
Mason

[...]

MBR, Sergei

#30 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hi Sergei,

Quoted 4 lines · Sergei Shtylyov
Quoted 1 line · On 05/20/2019 10:23 AM, [email protected] wrote:

+- clocks: should contain 1 entries for the module's clock

1 entry (clock node phandle and specifier).

Doesn't "specifier" mean "phandle + optional arguments"?

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#31 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Quoted 6 lines · Geert Uytterhoeven
Quoted 4 lines · On 05/20/2019 10:23 AM, [email protected] wrote:
Quoted 1 line

+- clocks: should contain 1 entries for the module's clock

1 entry (clock node phandle and specifier).

Doesn't "specifier" mean "phandle + optional arguments"?

No.
E.g. when specifying the IRQs, the "interrupts" prop contains one or more
interrupt specifiers, the phandle is specified in the "interrupt-parent" prop (see the DT spec).

Quoted 3 lines

Gr{oetje,eeting}s,

Geert

MBR, Sergei

#32 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hi Sergei,

Quoted 4 lines · Sergei Shtylyov
Quoted 3 lines · Geert Uytterhoeven
Quoted 3 lines · On 05/20/2019 10:23 AM, [email protected] wrote:
Quoted 1 line

+- clocks: should contain 1 entries for the module's clock

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

1 entry (clock node phandle and specifier).

Doesn't "specifier" mean "phandle + optional arguments"?

No.
E.g. when specifying the IRQs, the "interrupts" prop contains one or more
interrupt specifiers, the phandle is specified in the "interrupt-parent" prop (see the DT spec).

Mea culpa, I stand corrected.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

A message that is not in the archive (sent off-list or not yet received): OFAD9AA573.86373900-ON482583FA.0034781A-482583FA.0035B40C@LocalDomain

#34 lore raw

Re: [PATCH v12 3/3] dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF MFD bindings

Hi Sergei,

Quoted 2 lines
Quoted 2 lines

Could you please indent with 1 or 2 tabs where you used 8 or 16

spaces?

Sorry, I just copy this new DTS from git to my Notes email system, therefore, the "tabs space" is not alignment with original file.

Quoted 67 lines

Patch new DTS to ===============================================================>

(quoted diff) +62 -0
+Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
+---------------------------------------------------------
+
+RPC-IF supports both SPI NOR and HyperFlash (CFI-compliant flash)
+
+Required properties:
+- compatible: should be an SoC-specific compatible value, followed by
+      "renesas,rcar-gen3-rpc" as a fallback.
+      supported SoC-specific values are:
+      "renesas,r8a77995-rpc"   (R-Car D3)
+- reg: should contain three register areas:
+   first for RPC-IF registers,
+   second for the direct mapping read mode and
+   third for the write buffer area.
+- reg-names: should contain "regs", "dirmap" and "wbuf"
+- clocks: should contain 1 entries for the module's clock
+- clock-names: should contain "rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0
+
+Example:
+- SPI mode:
+
+   rpc_if: spi@ee200000 {
+      compatible = "renesas,r8a77995-rpc", "renesas,rcar-gen3-rpc";
+      reg = <0 0xee200000 0 0x200>, <0 0x08000000 0 0x4000000>,
+            <0 0xee208000 0 0x100>;
+      reg-names = "regs", "dirmap", "wbuf";
+      clocks = <&cpg CPG_MOD 917>;
+      clock-names = "rpc";
+      power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+      resets = <&cpg 917>;
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      flash@0 {
+         compatible = "jedec,spi-nor";
+         reg = <0>;
+         spi-max-frequency = <40000000>;
+         spi-tx-bus-width = <1>;
+         spi-rx-bus-width = <1>;
+      };
+   };
+
+- HF mode:
+   rpc_if: hf@ee200000 {
+      compatible = "renesas,r8a77995-rpc", "renesas,rcar-gen3-rpc";
+      reg = <0 0xee200000 0 0x200>, <0 0x08000000 0 0x4000000>,
+            <0 0xee208000 0 0x100>;
+      reg-names = "regs", "dirmap", "wbuf";
+      clocks = <&cpg CPG_MOD 917>;
+      clock-names = "rpc";
+      power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+      resets = <&cpg 917>;
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      flash@0 {
+         compatible = "cypress,hyperflash", "cfi-flash";
+         reg = <0>;
+      };
+   };
Quoted 1 line

=======================================================================<

thanks for your review.

best regards,
Mason

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================

============================================================================

CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=====================================================================