Skip to contentSkip to conversation

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

PATCH Superseded Mason Yang 4 participants 13 messages May 21, 2019 – Jun 19, 2019

Subsystems (3)

v13 of 17 Superseded Latest is v17 →

lore
Share & tools
lore

Mason Yang

author
#0 lore raw

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

Hi,

v13 patch including:
1) rename mfd to ddata for SPI driver.
2) Patch RPC-IF devicetree for SPI and HyperFlash.

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 controller
bindings

 .../devicetree/bindings/mfd/renesas-rpc-if.txt     |  65 +++
 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                      | 573 +++++++++++++++++++++
 include/linux/mfd/renesas-rpc.h                    | 141 +++++
 8 files changed, 921 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/renesas-rpc-if.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 v13 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 294d956..cdbde79 100644
@@ -1002,6 +1002,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 controller driver"
+	select MFD_CORE
+	depends on ARCH_RENESAS
+	help
+	  This supports Renesas R-Car Gen3 RPC-IF controller 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 52b1a90..459eb2f 100644
@@ -184,6 +184,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
#2 lore raw

Re: [PATCH v13 1/3] mfd: Add Renesas R-Car Gen3 RPC-IF MFD driver

Quoted 17 lines · Mason Yang

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 +0 -0
index 294d956..cdbde79 100644

drivers/mfd/Kconfig config MFD_RDC321X · line 1006

Quoted 5 lines
drivers/mfd/Kconfig +2 -0
@@ -1002,6 +1002,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 controller driver"

Please expand these short-forms, either here or in the help.

Quoted 28 lines
drivers/mfd/Kconfig +7 -0
+	select MFD_CORE
+	depends on ARCH_RENESAS
+	help
+	  This supports Renesas R-Car Gen3 RPC-IF controller 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 52b1a90..459eb2f 100644
@@ -184,6 +184,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 +0 -0
new file mode 100644
index 0000000..c80c8d1

drivers/mfd/renesas-rpc.c line 6

Quoted 6 lines
drivers/mfd/renesas-rpc.c new file +6 -0
@@ -0,0 +1,125 @@
+// 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 MFD driver

Expand this.

drivers/mfd/renesas-rpc.c line 10

Quoted 3 lines
drivers/mfd/renesas-rpc.c new file +3 -0
+// Author:
+//	Mason Yang <[email protected]>
+//

Why do you have blank commented line here?

By the way, is C++ style throughout the new format?

drivers/mfd/renesas-rpc.c line 19

Quoted 8 lines
drivers/mfd/renesas-rpc.c new file +8 -0
+#include <linux/clk.h>
+#include <linux/mfd/core.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/regmap.h>
+#include <linux/mfd/renesas-rpc.h>
+#include <linux/reset.h>

Alphabetical.

Quoted 19 lines
drivers/mfd/renesas-rpc.c new file +19 -0
+static const struct mfd_cell rpc_hf_ctlr = {
+	.name = "rpc-hf",
+};
+
+static const struct mfd_cell rpc_spi_ctlr = {
+	.name = "rpc-spi",
+};
+
+static const struct regmap_range rpc_mfd_volatile_ranges[] = {
+	regmap_reg_range(RPC_SMRDR0, RPC_SMRDR1),
+	regmap_reg_range(RPC_SMWDR0, RPC_SMWDR1),
+	regmap_reg_range(RPC_CMNSR, RPC_CMNSR),
+};
+
+static const struct regmap_access_table rpc_mfd_volatile_table = {
+	.yes_ranges	= rpc_mfd_volatile_ranges,
+	.n_yes_ranges	= ARRAY_SIZE(rpc_mfd_volatile_ranges),
+};
+

drivers/mfd/renesas-rpc.c line 49

Quoted 10 lines
drivers/mfd/renesas-rpc.c new file +10 -0
+static const struct regmap_config rpc_mfd_regmap_config = {
+	.reg_bits = 32,
+	.val_bits = 32,
+	.reg_stride = 4,
+	.fast_io = true,
+	.max_register = RPC_PHYOFFSET2,
+	.volatile_table = &rpc_mfd_volatile_table,
+};
+
+static int rpc_mfd_probe(struct platform_device *pdev)

Remove the "mfd" from the nomenclature.

Quoted 10 lines
drivers/mfd/renesas-rpc.c new file +10 -0
+	struct device_node *flash;
+	const struct mfd_cell *cell;
+	struct resource *res;
+	struct rpc_mfd *rpc;
+	void __iomem *base;
+
+	flash = of_get_next_child(pdev->dev.of_node, NULL);
+	if (!flash) {
+		dev_warn(&pdev->dev, "no flash node found\n");
+		return -ENODEV;

drivers/mfd/renesas-rpc.c line 70

Quoted 10 lines
drivers/mfd/renesas-rpc.c new file +10 -0
+	}
+
+	if (of_device_is_compatible(flash, "jedec,spi-nor")) {
+		cell = &rpc_spi_ctlr;
+	} else if (of_device_is_compatible(flash, "cfi-flash")) {
+		cell = &rpc_hf_ctlr;
+	} else {
+		dev_warn(&pdev->dev, "unknown flash type\n");
+		return -ENODEV;
+	}

Are there going to be more children coming?

If not, I'd argue that this is not an MFD.

Quoted 201 lines
drivers/mfd/renesas-rpc.c new file +54 -0
+	rpc = devm_kzalloc(&pdev->dev, sizeof(*rpc), GFP_KERNEL);
+	if (!rpc)
+		return -ENOMEM;
+
+	rpc->clk_rpc = devm_clk_get(&pdev->dev, "rpc");
+	if (IS_ERR(rpc->clk_rpc))
+		return PTR_ERR(rpc->clk_rpc);
+
+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
+	base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
+
+	rpc->regmap = devm_regmap_init_mmio(&pdev->dev, base,
+					    &rpc_mfd_regmap_config);
+	if (IS_ERR(rpc->regmap)) {
+		dev_err(&pdev->dev,
+			"failed to init regmap for rpc-mfd, error %ld\n",
+			PTR_ERR(rpc->regmap));
+		return PTR_ERR(rpc->regmap);
+	}
+
+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dirmap");
+	rpc->dirmap = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(rpc->dirmap))
+		rpc->dirmap = NULL;
+
+	rpc->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
+	if (IS_ERR(rpc->rstc))
+		return PTR_ERR(rpc->rstc);
+
+	platform_set_drvdata(pdev, rpc);
+
+	return devm_mfd_add_devices(&pdev->dev, -1, cell, 1, NULL, 0, NULL);
+}
+
+static const struct of_device_id rpc_mfd_of_match[] = {
+	{ .compatible = "renesas,rcar-gen3-rpc", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, rpc_mfd_of_match);
+
+static struct platform_driver rpc_mfd_driver = {
+	.probe = rpc_mfd_probe,
+	.driver = {
+		.name =	"rpc-mfd",
+		.of_match_table = rpc_mfd_of_match,
+	},
+};
+module_platform_driver(rpc_mfd_driver);
+
+MODULE_AUTHOR("Mason Yang <[email protected]>");
+MODULE_DESCRIPTION("Renesas R-Car Gen3 RPC MFD driver");
+MODULE_LICENSE("GPL v2");
include/linux/mfd/renesas-rpc.h new file +141 -0
new file mode 100644
index 0000000..bc53d02
@@ -0,0 +1,141 @@
+// 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 MFD driver
+//
+// Author:
+//	Mason Yang <[email protected]>
+//
+
+#ifndef __MFD_RENESAS_RPC_H
+#define __MFD_RENESAS_RPC_H
+
+#define RPC_CMNCR		0x0000	// R/W
+#define RPC_CMNCR_MD		BIT(31)
+#define RPC_CMNCR_SFDE		BIT(24) // undocumented bit but must be set
+#define RPC_CMNCR_MOIIO3(val)	(((val) & 0x3) << 22)
+#define RPC_CMNCR_MOIIO2(val)	(((val) & 0x3) << 20)
+#define RPC_CMNCR_MOIIO1(val)	(((val) & 0x3) << 18)
+#define RPC_CMNCR_MOIIO0(val)	(((val) & 0x3) << 16)
+#define RPC_CMNCR_MOIIO_HIZ	(RPC_CMNCR_MOIIO0(3) | RPC_CMNCR_MOIIO1(3) | \
+				 RPC_CMNCR_MOIIO2(3) | RPC_CMNCR_MOIIO3(3))
+#define RPC_CMNCR_IO3FV(val)	(((val) & 0x3) << 14) // undocumented
+#define RPC_CMNCR_IO2FV(val)	(((val) & 0x3) << 12) // undocumented
+#define RPC_CMNCR_IO0FV(val)	(((val) & 0x3) << 8)
+#define RPC_CMNCR_IOFV_HIZ	(RPC_CMNCR_IO0FV(3) | RPC_CMNCR_IO2FV(3) | \
+				 RPC_CMNCR_IO3FV(3))
+#define RPC_CMNCR_BSZ(val)	(((val) & 0x3) << 0)
+
+#define RPC_SSLDR		0x0004	// R/W
+#define RPC_SSLDR_SPNDL(d)	(((d) & 0x7) << 16)
+#define RPC_SSLDR_SLNDL(d)	(((d) & 0x7) << 8)
+#define RPC_SSLDR_SCKDL(d)	(((d) & 0x7) << 0)
+
+#define RPC_DRCR		0x000C	// R/W
+#define RPC_DRCR_SSLN		BIT(24)
+#define RPC_DRCR_RBURST(v)	((((v) - 1) & 0x1F) << 16)
+#define RPC_DRCR_RCF		BIT(9)
+#define RPC_DRCR_RBE		BIT(8)
+#define RPC_DRCR_SSLE		BIT(0)
+
+#define RPC_DRCMR		0x0010	// R/W
+#define RPC_DRCMR_CMD(c)	(((c) & 0xFF) << 16)
+#define RPC_DRCMR_OCMD(c)	(((c) & 0xFF) << 0)
+
+#define RPC_DREAR		0x0014	// R/W
+#define RPC_DREAR_EAV(c)	(((c) & 0xf) << 16)
+#define RPC_DREAR_EAC(c)	(((c) & 0x7) << 0)
+
+#define RPC_DROPR		0x0018	// R/W
+
+#define RPC_DRENR		0x001C	// R/W
+#define RPC_DRENR_CDB(o)	(u32)((((o) & 0x3) << 30))
+#define RPC_DRENR_OCDB(o)	(((o) & 0x3) << 28)
+#define RPC_DRENR_ADB(o)	(((o) & 0x3) << 24)
+#define RPC_DRENR_OPDB(o)	(((o) & 0x3) << 20)
+#define RPC_DRENR_DRDB(o)	(((o) & 0x3) << 16)
+#define RPC_DRENR_DME		BIT(15)
+#define RPC_DRENR_CDE		BIT(14)
+#define RPC_DRENR_OCDE		BIT(12)
+#define RPC_DRENR_ADE(v)	(((v) & 0xF) << 8)
+#define RPC_DRENR_OPDE(v)	(((v) & 0xF) << 4)
+
+#define RPC_SMCR		0x0020	// R/W
+#define RPC_SMCR_SSLKP		BIT(8)
+#define RPC_SMCR_SPIRE		BIT(2)
+#define RPC_SMCR_SPIWE		BIT(1)
+#define RPC_SMCR_SPIE		BIT(0)
+
+#define RPC_SMCMR		0x0024	// R/W
+#define RPC_SMCMR_CMD(c)	(((c) & 0xFF) << 16)
+#define RPC_SMCMR_OCMD(c)	(((c) & 0xFF) << 0)
+
+#define RPC_SMADR		0x0028	// R/W
+#define RPC_SMOPR		0x002C	// R/W
+#define RPC_SMOPR_OPD3(o)	(((o) & 0xFF) << 24)
+#define RPC_SMOPR_OPD2(o)	(((o) & 0xFF) << 16)
+#define RPC_SMOPR_OPD1(o)	(((o) & 0xFF) << 8)
+#define RPC_SMOPR_OPD0(o)	(((o) & 0xFF) << 0)
+
+#define RPC_SMENR		0x0030	// R/W
+#define RPC_SMENR_CDB(o)	(((o) & 0x3) << 30)
+#define RPC_SMENR_OCDB(o)	(((o) & 0x3) << 28)
+#define RPC_SMENR_ADB(o)	(((o) & 0x3) << 24)
+#define RPC_SMENR_OPDB(o)	(((o) & 0x3) << 20)
+#define RPC_SMENR_SPIDB(o)	(((o) & 0x3) << 16)
+#define RPC_SMENR_DME		BIT(15)
+#define RPC_SMENR_CDE		BIT(14)
+#define RPC_SMENR_OCDE		BIT(12)
+#define RPC_SMENR_ADE(v)	(((v) & 0xF) << 8)
+#define RPC_SMENR_OPDE(v)	(((v) & 0xF) << 4)
+#define RPC_SMENR_SPIDE(v)	(((v) & 0xF) << 0)
+
+#define RPC_SMRDR0		0x0038	// R
+#define RPC_SMRDR1		0x003C	// R
+#define RPC_SMWDR0		0x0040	// W
+#define RPC_SMWDR1		0x0044	// W
+
+#define RPC_CMNSR		0x0048	// R
+#define RPC_CMNSR_SSLF		BIT(1)
+#define RPC_CMNSR_TEND		BIT(0)
+
+#define RPC_DRDMCR		0x0058	// R/W
+#define RPC_DRDRENR		0x005C	// R/W
+
+#define RPC_SMDMCR		0x0060	// R/W
+#define RPC_SMDMCR_DMCYC(v)	((((v) - 1) & 0x1F) << 0)
+
+#define RPC_SMDRENR		0x0064	// R/W
+#define RPC_SMDRENR_HYPE	(0x7 << 12)
+#define RPC_SMDRENR_ADDRE	BIT(8)
+#define RPC_SMDRENR_OPDRE	BIT(4)
+#define RPC_SMDRENR_SPIDRE	BIT(0)
+
+#define RPC_PHYCNT		0x007C	// R/W
+#define RPC_PHYCNT_CAL		BIT(31)
+#define PRC_PHYCNT_OCTA_AA	BIT(22)
+#define PRC_PHYCNT_OCTA_SA	BIT(23)
+#define PRC_PHYCNT_EXDS		BIT(21)
+#define RPC_PHYCNT_OCT		BIT(20)
+#define RPC_PHYCNT_STRTIM(v)	(((v) & 0x7) << 15)
+#define RPC_PHYCNT_WBUF2	BIT(4)
+#define RPC_PHYCNT_WBUF		BIT(2)
+#define RPC_PHYCNT_PHYMEM(v)	(((v) & 0x3) << 0)
+
+#define RPC_PHYOFFSET1		0x0080	// R/W
+#define RPC_PHYOFFSET1_DDRTMG(v) (((v) & 0x3) << 28)
+#define RPC_PHYOFFSET2		0x0084	// R/W
+#define RPC_PHYOFFSET2_OCTTMG(v) (((v) & 0x7) << 8)
+
+#define RPC_DIRMAP_SIZE		0x4000000
+
+struct rpc_mfd {
+	struct clk *clk_rpc;
+	void __iomem *dirmap;
+	struct regmap *regmap;
+	struct reset_control *rstc;
+};
+
+#endif // __MFD_RENESAS_RPC_H
Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#3 lore raw

Re: [PATCH v13 1/3] mfd: Add Renesas R-Car Gen3 RPC-IF MFD driver

Hi Jones,

Quoted 3 lines
Quoted 1 line

+static int rpc_mfd_probe(struct platform_device *pdev)

Remove the "mfd" from the nomenclature.

okay, will fix.

Quoted 15 lines
Quoted 15 lines
drivers/mfd/renesas-rpc.c new file +14 -0
+   struct device_node *flash;
+   const struct mfd_cell *cell;
+   struct resource *res;
+   struct rpc_mfd *rpc;
+   void __iomem *base;
+
+   flash = of_get_next_child(pdev->dev.of_node, NULL);
+   if (!flash) {
+      dev_warn(&pdev->dev, "no flash node found\n");
+      return -ENODEV;
+   }
+
+   if (of_device_is_compatible(flash, "jedec,spi-nor")) {
+      cell = &rpc_spi_ctlr;
Quoted 8 lines

drivers/mfd/renesas-rpc.c line 70

Quoted 6 lines
drivers/mfd/renesas-rpc.c new file +6 -0
+   } else if (of_device_is_compatible(flash, "cfi-flash")) {
+      cell = &rpc_hf_ctlr;
+   } else {
+      dev_warn(&pdev->dev, "unknown flash type\n");
+      return -ENODEV;
+   }

Are there going to be more children coming?

No, just spi-nor or cfi-flash.

The operation mode is decided at booting time by HW pin configuration. Can't change spi-nor or cfi-flash mode at run-time.

Quoted 3 lines

If not, I'd argue that this is not an MFD.

umm, agreed.

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.

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

author
#4 lore raw

PATCH v13 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 | 573 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 580 insertions(+)
 create mode 100644 drivers/spi/spi-renesas-rpc.c
drivers/spi/Kconfig +6 -0
index 0fba8f4..229f6d7 100644
@@ -570,6 +570,12 @@ config SPI_RSPI
 	help
 	  SPI driver for Renesas RSPI and QSPI blocks.
 
+config SPI_RENESAS_RPC
+	tristate "Renesas R-Car Gen3 RPC-IF SPI 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 f2f78d0..2a6e052 100644
@@ -87,6 +87,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 +573 -0

573 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#5 lore raw

PATCH v13 3/3 dt-bindings: mfd: Document Renesas R-Car Gen3 RPC-IF controller bindings

In reply to Mason Yang

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

---
 .../devicetree/bindings/mfd/renesas-rpc-if.txt     | 65 ++++++++++++++++++++++
 1 file changed, 65 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +65 -0
new file mode 100644
index 0000000..20ec85b
@@ -0,0 +1,65 @@
+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>;
+		};
+	};
Signature · 1 line
1.9.1
#6 lore raw

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

Quoted 24 lines · Mason Yang

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

---
 .../devicetree/bindings/mfd/renesas-rpc-if.txt     | 65 ++++++++++++++++++++++
 1 file changed, 65 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +10 -0
new file mode 100644
index 0000000..20ec85b
@@ -0,0 +1,65 @@
+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)

Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt line 20

Quoted 10 lines
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +10 -0
+- 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

That's just some nonsense, sorry...
I suggest that you stop reposting your patches as I'm going to post
my version of this patchset RSN (based on your patches, of course) and I'm going to take care of fixing this file as well.

Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt line 22

Quoted 2 lines
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +2 -0
+- #address-cells: should be 1
+- #size-cells: should be 0

[...]

MBR, Sergei

#7 lore raw

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

Hi Sergei,

Quoted 3 lines · Mason Yang
Quoted 2 lines

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

controller.

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

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

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

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

Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

b/

Quoted 16 lines

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

Quoted 15 lines

new file mode 100644
index 0000000..20ec85b

Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +10 -0
@@ -0,0 +1,65 @@
+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)
Quoted 8 lines

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

Quoted 8 lines
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +8 -0
+- 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

Quoted 6 lines

Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt line 20

Quoted 2 lines
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +2 -0
+- resets: should contain clock pulse generator(cpg) for reset-cell,
+     power-domain-cell and clock-cell

That's just some nonsense, sorry...
I suggest that you stop reposting your patches as I'm going to post
my version of this patchset RSN (based on your patches, of course) and

I'm

Quoted 1 line

going to take care of fixing this file as well.

okay, just let me know your patch then.

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.

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

#8 lore raw

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

In reply to Sergei Shtylyov
Quoted 33 lines · Sergei Shtylyov
Quoted 31 lines · Mason Yang

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

---
 .../devicetree/bindings/mfd/renesas-rpc-if.txt     | 65 ++++++++++++++++++++++
 1 file changed, 65 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +17 -0
new file mode 100644
index 0000000..20ec85b
@@ -0,0 +1,65 @@
+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"
Quoted 8 lines

Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt line 20

Quoted 3 lines
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +3 -0
+- 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

That's just some nonsense, sorry...
I suggest that you stop reposting your patches as I'm going to post
my version of this patchset RSN (based on your patches, of course) and I'm going to take care of fixing this file as well.

Why is this necessary?

Why not just provide some constructive feedback instead?

Quoted 5 lines

Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt line 22

Quoted 2 lines
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +2 -0
+- #address-cells: should be 1
+- #size-cells: should be 0

[...]

MBR, Sergei

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

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

Hello!

Quoted 40 lines · Lee Jones
Quoted 31 lines
Quoted 31 lines

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

---
 .../devicetree/bindings/mfd/renesas-rpc-if.txt     | 65 ++++++++++++++++++++++
 1 file changed, 65 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +17 -0
new file mode 100644
index 0000000..20ec85b
@@ -0,0 +1,65 @@
+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"
Quoted 8 lines

Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt line 20

Quoted 3 lines
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +3 -0
+- 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

That's just some nonsense, sorry...
I suggest that you stop reposting your patches as I'm going to post
my version of this patchset RSN (based on your patches, of course) and I'm going to take care of fixing this file as well.

Quoted 1 line

Why is this necessary?

Because Mason doesn't want to develop the HyperFlash driver (or even move his code
in preparation to this driver being developed). I must develop this driver, and I'd like to avoid the extra churn of mving the code between the MFD and SPI drivers.

Quoted 1 line

Why not just provide some constructive feedback instead?

I was providing the feedback during these 13 revisions... unfortunately, it wasn't
fully considered.

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +2 -0
+- #address-cells: should be 1
+- #size-cells: should be 0

[...]

MBR, Sergei

#10 lore raw

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

Hi Jones,

Quoted 11 lines

Subject

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

controller bindings

Hello!

Quoted 1 line · Lee Jones
Quoted 1 line
Quoted 1 line

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

controller.

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

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

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

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

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

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

Quoted 13 lines

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

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

new file mode 100644
index 0000000..20ec85b

Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +0 -0
Quoted 8 lines
Quoted 8 lines

Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt line 7

Quoted 8 lines
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +7 -0
@@ -0,0 +1,65 @@
+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 11 lines
Quoted 11 lines
Quoted 11 lines

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

Quoted 11 lines
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +11 -0
+      "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

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt line 20

Quoted 2 lines
Documentation/devicetree/bindings/mfd/renesas-rpc-if.txt new file +2 -0
+- resets: should contain clock pulse generator(cpg) for reset-cell,
+     power-domain-cell and clock-cell

That's just some nonsense, sorry...
I suggest that you stop reposting your patches as I'm going to

post

Quoted 1 line
Quoted 1 line
Quoted 1 line

my version of this patchset RSN (based on your patches, of course)

and I'm

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

going to take care of fixing this file as well.

Why is this necessary?

Because Mason doesn't want to develop the HyperFlash driver (or even

move his code

Quoted 1 line

in preparation to this driver being developed). I must develop this

driver, and I'd

Quoted 1 line

like to avoid the extra churn of mving the code between the MFD and SPI

drivers.

Quoted 1 line

There might be some misunderstandings.

I had been requested to boot R-CAR from the OctaFlash and finally I have achieved it
by patching SPI framework for OctaFlash operation and RPC-IF SPI driver.

We were aware of the lacking support of RPC-IF in the Linux kernel at that time and
I though I could contribute what I had developed.

At that time for my first submission of RPC-IF SPI on 15 NOv 2018, there was no any
HyperFlash (or Hyper Bus) patches. And we did not consider it because the resource
of HyperFlash was shortage to us.

RPC-IF SPI was applied by Mark on 12,Feb 2019 but Marek comment to add supporting
MFD for RPC-IF and then I patched RPC-IF to MFD and SPI till this v13.

I always think about:

Is RPC-IF really good/suitable for MFD ?
RPC-IF works either in SPI or HyperFlash is decided by external hardware pins
configuration and it can NOT switch it's operation mode in the run time. This is not like my understanding of MFD.

As your comments:
------------------------------------------------------------------------>

Review

Quoted 3 lines
(quoted diff) +3 -0
+              flash = of_get_next_child(pdev->dev.of_node, NULL);
+              if (!flash) {
+                              dev_warn(&pdev->dev, "no flash node 

found\n");

Review

Quoted 9 lines
(quoted diff) +9 -0
+                              return -ENODEV;
+              }
+
+              if (of_device_is_compatible(flash, "jedec,spi-nor")) {
+                              cell = &rpc_spi_ctlr;
+              } else if (of_device_is_compatible(flash, "cfi-flash")) {
+                              cell = &rpc_hf_ctlr;
+              } else {
+                              dev_warn(&pdev->dev, "unknown flash 

type\n");

Review

Quoted 2 lines
(quoted diff) +2 -0
+                              return -ENODEV;
+              }

Are there going to be more children coming?

If not, I'd argue that this is not an MFD. <-------------------------------------------------------------------

I agreed with your opinion and I will resubmit RPC-IF in SPI only if you also agree with it.

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.

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

#11 lore raw

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

On 6/6/19 9:40 AM, [email protected] wrote:
[...]

Quoted 4 lines

RPC-IF works either in SPI or HyperFlash is decided by external hardware pins
configuration and it can NOT switch it's operation mode in the run time. This is not like my understanding of MFD.

Which external hardware pins decide the RPC configuration ?

It seems to me like PHYCNT register, PHYMEM bitfield, selects what device is connected, and then a couple of other bits control the communication, but I see nothing which would be tied to any external configuration pins.

[...]

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

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

Hi Marek,

Quoted 10 lines

Subject

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

controller bindings

On 6/6/19 9:40 AM, [email protected] wrote:
[...]

Quoted 1 line

RPC-IF works either in SPI or HyperFlash is decided by external

hardware

Quoted 2 lines
Quoted 2 lines

pins
configuration and it can NOT switch it's operation mode in the run

time.

Quoted 9 lines
Quoted 1 line

This is not like my understanding of MFD.

Which external hardware pins decide the RPC configuration ?

It seems to me like PHYCNT register, PHYMEM bitfield, selects what device is connected, and then a couple of other bits control the communication, but I see nothing which would be tied to any external configuration pins.

You may refer to R-Car D3 Draak Eva. board hardware manual and start-up guide, i.e.,
Table 2.12 Pin Multiplexing of R-Car D3 Mode setting pins and set by hardware switch 1, 2, 3, 13, 31 and 10 to configure booting from SPI mode or HyperFlash mode.

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.

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