Skip to contentSkip to conversation

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

PATCH Superseded Mason Yang 4 participants 15 messages Jan 18, 2019 – Jan 21, 2019 3 messages not in the archive

Subsystems (2)

v6 of 17 Superseded Latest is v17 →

lore
Share & tools
lore

Mason Yang

author
#0 lore raw

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

Hi Mark,

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 (2):
spi: Add Renesas R-Car Gen3 RPC-IF SPI controller driver
dt-bindings: spi: Document Renesas R-Car Gen3 RPC-IF controller
bindings

 .../devicetree/bindings/spi/spi-renesas-rpc.txt    |  37 +
 drivers/spi/Kconfig                                |   6 +
 drivers/spi/Makefile                               |   1 +
 drivers/spi/spi-renesas-rpc.c                      | 800 +++++++++++++++++++++
 4 files changed, 844 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt
 create mode 100644 drivers/spi/spi-renesas-rpc.c
Signature · 1 line
1.9.1
author
#1 lore raw

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

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 | 800 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 807 insertions(+)
 create mode 100644 drivers/spi/spi-renesas-rpc.c
drivers/spi/Kconfig +6 -0
index 9f89cb1..6ad1782 100644
@@ -544,6 +544,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 f296270..9150732 100644
@@ -84,6 +84,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 +800 -0

800 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

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

Hi Mason,

Quoted 4 lines · Mason Yang

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

Thanks for the update!

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

Quoted 6 lines
drivers/spi/spi-renesas-rpc.c new file +2 -0
@@ -0,0 +1,800 @@
 
+static int rpc_spi_xfer_message(struct rpc_spi *rpc,
+                               struct spi_transfer *t)

As "t" is not an arbitrary transfer, but the last transfer containing the actual data, I'd call it "last", or "data_xfer".

Quoted 11 lines
drivers/spi/spi-renesas-rpc.c new file +11 -0
+{
+       int ret;
+
+       ret = rpc_spi_set_freq(rpc, t->speed_hz);
+       if (ret)
+               return ret;
+
+       ret = rpc_spi_io_xfer(rpc,
+                             rpc->xfer_dir == SPI_MEM_DATA_OUT ?
+                             t->tx_buf : NULL,
+                             rpc->xfer_dir == SPI_MEM_DATA_IN ?

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

Quoted 10 lines
drivers/spi/spi-renesas-rpc.c new file +10 -0
+                             t->rx_buf : NULL);
+
+       return ret;
+}
+
+static int rpc_spi_transfer_one_message(struct spi_controller *ctlr,
+                                       struct spi_message *msg)
+{
+       struct rpc_spi *rpc = spi_controller_get_devdata(ctlr);
+       struct spi_transfer *t;

Likewise.

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

Quoted 8 lines
drivers/spi/spi-renesas-rpc.c new file +8 -0
+       int ret;
+
+       rpc_spi_transfer_setup(rpc, msg);
+
+       t = list_last_entry(&msg->transfers, struct spi_transfer,
+                           transfer_list);
+
+       ret = rpc_spi_xfer_message(rpc, t);

As this function is small, perhaps just inline it here? IMHO that makes the flow clearer.

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

Quoted 9 lines
drivers/spi/spi-renesas-rpc.c new file +9 -0
+       if (ret)
+               goto out;
+
+       msg->status = 0;
+       msg->actual_length = rpc->totalxferlen;
+out:
+       spi_finalize_current_message(ctlr);
+       return 0;
+}

The rest looks good to me, 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
#3 lore raw

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

In reply to Mason Yang

Hello!

Quoted 4 lines · Mason Yang

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

[...]

Quoted 6 lines
drivers/spi/spi-renesas-rpc.c new file +0 -0
new file mode 100644
index 0000000..692c760
@@ -0,0 +1,800 @@

[...]

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

Quoted 6 lines
drivers/spi/spi-renesas-rpc.c new file +6 -0
+#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_SPIDB(o)	(((o) & 0x3) << 16)

Manual v1.00 calls it DRDB, not SPIDB.

[...]

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

Quoted 6 lines
drivers/spi/spi-renesas-rpc.c new file +6 -0
+#define RPC_SMENR		0x0030	// R/W
+#define RPC_SMENR_CDB(o)	(((o) & 0x2) << 30)
+#define RPC_SMENR_OCDB(o)	(((o) & 0x2) << 28)
+#define RPC_SMENR_ADB(o)	(((o) & 0x2) << 24)
+#define RPC_SMENR_OPDB(o)	(((o) & 0x2) << 20)
+#define RPC_SMENR_SPIDB(o)	(((o) & 0x2) << 16)

Ugh, s/0x2/0x3/! :-/

[...]

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

Quoted 2 lines
drivers/spi/spi-renesas-rpc.c new file +2 -0
+#define RPC_SMDRENR		0x0064	// R/W
+#define RPC_SMDRENR_HYPE	(0x5 << 12)

s/0x5/0x7/, and this is a field, not value.

[...]

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

Quoted 11 lines
drivers/spi/spi-renesas-rpc.c new file +11 -0
+static int rpc_spi_probe(struct platform_device *pdev)
+{
+	struct spi_controller *ctlr;
+	struct resource *res;
+	struct rpc_spi *rpc;
+	const struct regmap_config *regmap_config;
+	struct device_node *rpc_if;
+	int ret;
+
+	rpc_if = of_find_compatible_node(pdev->dev.of_node, NULL,
+					 "jedec,spi-nor");

I doubt that this is a correct function to check for the child node's
"compatible" prop...

[...]

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

Quoted 1 line
drivers/spi/spi-renesas-rpc.c new file +1 -0
+	regmap_config = &rpc_spi_regmap_config;

Doesn't look like this variable is needed...

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

Quoted 4 lines
drivers/spi/spi-renesas-rpc.c new file +4 -0
+	rpc->regmap = devm_regmap_init_mmio(&pdev->dev, rpc->base,
+					    regmap_config);
+	if (IS_ERR(rpc->regmap)) {
+		dev_err(&pdev->dev, "failed to init regmap %ld for rpc-spi\n",

How about:

		dev_err(&pdev->dev, "failed to init regmap for rpc-spi, error %ld\n",

[...]

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

Quoted 3 lines
drivers/spi/spi-renesas-rpc.c new file +3 -0
+	ret = spi_register_controller(ctlr);
+	if (ret) {
+		dev_err(&pdev->dev, "spi_register_master failed\n");

You forgot to update the message. :-)

[...]

MBR, Sergei

A message that is not in the archive (sent off-list or not yet received): OFE50FED81.5C117A38-ON48258389.0012FCE2-48258389.00139BD2@mxic.com.tw

#5 lore raw

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

Hello!

Quoted 16 lines · On 01/21/2019 06:34 AM, [email protected] wrote:
Quoted 9 lines

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

Quoted 6 lines
drivers/spi/spi-renesas-rpc.c new file +6 -0
+#define RPC_SMENR      0x0030   // R/W
+#define RPC_SMENR_CDB(o)   (((o) & 0x2) << 30)
+#define RPC_SMENR_OCDB(o)   (((o) & 0x2) << 28)
+#define RPC_SMENR_ADB(o)   (((o) & 0x2) << 24)
+#define RPC_SMENR_OPDB(o)   (((o) & 0x2) << 20)
+#define RPC_SMENR_SPIDB(o)   (((o) & 0x2) << 16)
   Ugh, s/0x2/0x3/! :-/
Quoted 6 lines

[...]

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

Quoted 2 lines
drivers/spi/spi-renesas-rpc.c new file +2 -0
+#define RPC_SMDRENR      0x0064   // R/W
+#define RPC_SMDRENR_HYPE   (0x5 << 12)

s/0x5/0x7/, and this is a field, not value.

Quoted 3 lines

okay, both 0x2 and 0x5 are just make sure these registers was writing a correct value rather than a prohibited value. anyway, I will patch them.

TIA.

Quoted 15 lines
Quoted 15 lines

[...]

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

Quoted 11 lines
drivers/spi/spi-renesas-rpc.c new file +11 -0
+static int rpc_spi_probe(struct platform_device *pdev)
+{
+   struct spi_controller *ctlr;
+   struct resource *res;
+   struct rpc_spi *rpc;
+   const struct regmap_config *regmap_config;
+   struct device_node *rpc_if;
+   int ret;
+
+   rpc_if = of_find_compatible_node(pdev->dev.of_node, NULL,
+                "jedec,spi-nor");

I doubt that this is a correct function to check for the child node's
"compatible" prop...

You need of_get_next_child() or of_get_next_available_child().

Quoted 7 lines
Quoted 5 lines

[...]

Quoted 1 line

+ regmap_config = &rpc_spi_regmap_config;

Doesn't look like this variable is needed...

why ?

Why not just use &rpc_spi_regmap_config below?

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
drivers/spi/spi-renesas-rpc.c new file +2 -0
+   rpc->regmap = devm_regmap_init_mmio(&pdev->dev, rpc->base,
+                   regmap_config);

[...]

Quoted 1 line

Mason

MBR, Sergei

author
#6 lore raw

PATCH v6 2/2 dt-bindings: spi: 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/spi/spi-renesas-rpc.txt    | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +37 -0
new file mode 100644
index 0000000..9b5001e
@@ -0,0 +1,37 @@
+Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
+----------------------------------------------------------
+
+Required properties:
+- compatible: should be "renesas,rcar-gen3-rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0
+- 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"
+- clock-names: should contain "rpc"
+- clocks: should contain 1 entries for the module's clock
+
+Example:
+
+	rpc: rpc@ee200000 {
+		compatible = "renesas,rcar-gen3-rpc";
+		reg = <0 0xee200000 0 0x7fff>, <0 0x08000000 0 0x4000000>,
+		      <0 0xee208000 0 0x100>;
+		reg-names = "regs", "dirmap", "<wbuf>;
+		clocks = <&cpg CPG_MOD 917>;
+		power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+		resets = <&cpg 917>;
+		clock-names = "rpc";
+		#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
#7 lore raw

Re: [PATCH v6 2/2] dt-bindings: spi: 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/spi/spi-renesas-rpc.txt    | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +10 -0
new file mode 100644
index 0000000..9b5001e
@@ -0,0 +1,37 @@
+Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
+----------------------------------------------------------
+
+Required properties:
+- compatible: should be "renesas,rcar-gen3-rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0
+- reg: should contain three register areas:
+	first for the base address of rpc-if registers,
+	second for the direct mapping read mode and

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt line 20

Quoted 10 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +10 -0
+	third for the write buffer area.
+- reg-names: should contain "regs", "dirmap" and "wbuf"
+- clock-names: should contain "rpc"
+- clocks: should contain 1 entries for the module's clock
+
+Example:
+
+	rpc: rpc@ee200000 {
+		compatible = "renesas,rcar-gen3-rpc";
+		reg = <0 0xee200000 0 0x7fff>, <0 0x08000000 0 0x4000000>,

0x7fff should be 0x8000 , right ?

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt line 21

Quoted 1 line
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +1 -0
+		      <0 0xee208000 0 0x100>;

Isn't the write buffer part of the RPC-IF register set ?

Quoted 17 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +16 -0
+		reg-names = "regs", "dirmap", "<wbuf>;
+		clocks = <&cpg CPG_MOD 917>;
+		power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+		resets = <&cpg 917>;
+		clock-names = "rpc";
+		#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 · 2 lines
Best regards,
Marek Vasut

A message that is not in the archive (sent off-list or not yet received): OF914E6438.79205FE6-ON48258386.002973E8-48258386.002A41F0@mxic.com.tw

#9 lore raw

Re: [PATCH v6 2/2] dt-bindings: spi: Document Renesas R-Car Gen3 RPC-IF controller bindings

Quoted 1 line · On 1/18/19 8:41 AM, [email protected] wrote:

Hi Marek,

Hi,

Quoted 26 lines
Quoted 17 lines

"Marek Vasut" <[email protected]>
2019/01/18 下午 03:10

Quoted 14 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +14 -0
+Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
+----------------------------------------------------------
+
+Required properties:
+- compatible: should be "renesas,rcar-gen3-rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0
+- 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"
+- clock-names: should contain "rpc"
+- clocks: should contain 1 entries for the module's clock
Quoted 8 lines

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt line 20

Quoted 6 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +6 -0
+
+Example:
+
+   rpc: rpc@ee200000 {
+      compatible = "renesas,rcar-gen3-rpc";
+      reg = <0 0xee200000 0 0x7fff>, <0 0x08000000 0 0x4000000>,

0x7fff should be 0x8000 , right ?

Quoted 1 line

RPC write buffer starts at 0xee208000 w/ 256 bytes size.

The size of the RPC-IF block is 0x8000 though, is it not ?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

+            <0 0xee208000 0 0x100>;

Isn't the write buffer part of the RPC-IF register set ?

yep, but by Sergei and Geert's comments, we use a separate reg entry for this write buffer.
---- copy the replied email from Geert ---------------------------------

Quoted 8 lines
Quoted 1 line

Maybe Geert or Marek could comment on it, thanks.

Given the writer buffer is separate from the other registers (it's in a different
4 KiB page, and thus may be at a different offset on future SoCs), and not present on RZ/A1, I think it's a good idea to use a separate reg entry for it.
-----------------------------------------------------------------------

+CC Chris, the RZ/A1 has no write buffer for the RPC ?

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

Re: [PATCH v6 2/2] dt-bindings: spi: Document Renesas R-Car Gen3 RPC-IF controller bindings

In reply to Marek Vasut

Hello!

Quoted 28 lines · Marek Vasut
Quoted 28 lines

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

---
  .../devicetree/bindings/spi/spi-renesas-rpc.txt    | 37 ++++++++++++++++++++++
  1 file changed, 37 insertions(+)

create mode 100644 Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +14 -0
new file mode 100644
index 0000000..9b5001e
@@ -0,0 +1,37 @@
+Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
+----------------------------------------------------------
+
+Required properties:
+- compatible: should be "renesas,rcar-gen3-rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0
+- 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"
+- clock-names: should contain "rpc"
+- clocks: should contain 1 entries for the module's clock
Quoted 8 lines

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt line 20

Quoted 6 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +6 -0
+
+Example:
+
+	rpc: rpc@ee200000 {
+		compatible = "renesas,rcar-gen3-rpc";
+		reg = <0 0xee200000 0 0x7fff>, <0 0x08000000 0 0x4000000>,

0x7fff should be 0x8000 , right ?

Even 0x200.

Quoted 4 lines

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt line 21

Quoted 2 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +1 -0
+		      <0 0xee208000 0 0x100>;

Isn't the write buffer part of the RPC-IF register set ?

No, if you look into the manual.

MBR, Sergei

#11 lore raw

Re: [PATCH v6 2/2] dt-bindings: spi: Document Renesas R-Car Gen3 RPC-IF controller bindings

In reply to Mason Yang

Hi Mason,

Quoted 3 lines · Mason Yang

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

Thanks for the update!

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt line 5

Quoted 8 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +5 -0
@@ -0,0 +1,37 @@
+Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
+----------------------------------------------------------
+
+Required properties:
+- compatible: should be

compatible: should be an SoC-specific compatible value, followed by "renesas,rcar-gen3-rpc" as a fallback.

Examples of the latter are:
- "renesas,r8a7795-rpc" (R-Car H3).

This makes it future-proof, in case the RPC on a specific SoC version needs to be handled specially. We already know that is the case for R-Car V3M.

Quoted 4 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +4 -0
+- #address-cells: should be 1
+- #size-cells: should be 0
+- reg: should contain three register areas:
+       first for the base address of rpc-if registers,

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt line 19

Quoted 10 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +10 -0
+       second for the direct mapping read mode and
+       third for the write buffer area.
+- reg-names: should contain "regs", "dirmap" and "wbuf"
+- clock-names: should contain "rpc"
+- clocks: should contain 1 entries for the module's clock
+
+Example:
+
+       rpc: rpc@ee200000 {
+               compatible = "renesas,rcar-gen3-rpc";

compatible = "renesas,r8a7795-rpc," renesas,rcar-gen3-rpc";

Quoted 8 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +8 -0
+               reg = <0 0xee200000 0 0x7fff>, <0 0x08000000 0 0x4000000>,
+                     <0 0xee208000 0 0x100>;
+               reg-names = "regs", "dirmap", "<wbuf>;
+               clocks = <&cpg CPG_MOD 917>;
+               power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+               resets = <&cpg 917>;
+               clock-names = "rpc";
+               #address-cells = <1>;

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt line 37

Quoted 10 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +10 -0
+               #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>;
+               };
+       };

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
#12 lore raw

Re: [PATCH v6 2/2] dt-bindings: spi: Document Renesas R-Car Gen3 RPC-IF controller bindings

Quoted 27 lines · Geert Uytterhoeven

Hi Mason,

Quoted 3 lines · Mason Yang

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

Thanks for the update!

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt line 5

Quoted 8 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +5 -0
@@ -0,0 +1,37 @@
+Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
+----------------------------------------------------------
+
+Required properties:
+- compatible: should be

compatible: should be an SoC-specific compatible value, followed by "renesas,rcar-gen3-rpc" as a fallback.

Examples of the latter are:
- "renesas,r8a7795-rpc" (R-Car H3).

This makes it future-proof, in case the RPC on a specific SoC version needs to be handled specially. We already know that is the case for R-Car V3M.

Quoted 16 lines
Quoted 4 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +4 -0
+- #address-cells: should be 1
+- #size-cells: should be 0
+- reg: should contain three register areas:
+       first for the base address of rpc-if registers,

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt line 19

Quoted 10 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +10 -0
+       second for the direct mapping read mode and
+       third for the write buffer area.
+- reg-names: should contain "regs", "dirmap" and "wbuf"
+- clock-names: should contain "rpc"
+- clocks: should contain 1 entries for the module's clock
+
+Example:
+
+       rpc: rpc@ee200000 {
+               compatible = "renesas,rcar-gen3-rpc";

compatible = "renesas,r8a7795-rpc," renesas,rcar-gen3-rpc";

Without the extra comma after r8a7795-rpc, of course ;-)

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

Re: [PATCH v6 2/2] dt-bindings: spi: Document Renesas R-Car Gen3 RPC-IF controller bindings

Hi Marek,

Quoted 5 lines · Marek Vasut
Quoted 3 lines · Geert Uytterhoeven
Quoted 2 lines · Mason Yang
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +0 -0
Quoted 8 lines
Quoted 6 lines

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt line 19

Quoted 4 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +4 -0
+Example:
+
+       rpc: rpc@ee200000 {
+               compatible = "renesas,rcar-gen3-rpc";

compatible = "renesas,r8a7795-rpc," renesas,rcar-gen3-rpc";

Without the extra comma after r8a7795-rpc, of course ;-)

Let's move it after the closing double quotes. Would that be OK for you? ^-)

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
#14 lore raw

Re: [PATCH v6 2/2] dt-bindings: spi: Document Renesas R-Car Gen3 RPC-IF controller bindings

Quoted 15 lines · Geert Uytterhoeven

Hi Marek,

Quoted 12 lines · Marek Vasut
Quoted 10 lines · Geert Uytterhoeven

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt line 19

Quoted 7 lines · Mason Yang
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +4 -0
 
+Example:
+
+       rpc: rpc@ee200000 {
+               compatible = "renesas,rcar-gen3-rpc";

compatible = "renesas,r8a7795-rpc," renesas,rcar-gen3-rpc";

Quoted 3 lines
Quoted 1 line

Without the extra comma after r8a7795-rpc, of course ;-)

Let's move it after the closing double quotes. Would that be OK for you? ^-)

Ack

Signature · 2 lines
Best regards,
Marek Vasut

A message that is not in the archive (sent off-list or not yet received): OFBD5366C8.433ADACB-ON48258386.00336667-48258386.00340E20@mxic.com.tw

#16 lore raw

Re: [PATCH v6 2/2] dt-bindings: spi: Document Renesas R-Car Gen3 RPC-IF controller bindings

Hi Mason,

Quoted 8 lines · On Fri, Jan 18, 2019 at 10:28 AM <[email protected]> wrote:

I modified this dts to:

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

Required properties:
- compatible: should be an SoC-specific compatible value, followed by "renesas,rcar-gen3-rpc" as a fallback.

Please list the supported SoC-specific compatible values, so scripts/checkpatch.pl
can validate patches adding RPC device nodes to DTS files.

Quoted 9 lines

- #address-cells: should be 1
- #size-cells: should be 0
- 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"
- clock-names: should contain "rpc"
- clocks: should contain 1 entries for the module's clock

Please revert the order of clocks and clock-names, cfr. reg and reg-names.

Quoted 11 lines

Example:

         rpc: rpc@ee200000 {
                 compatible = "renesas,r8a7795-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>;
                 power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
                 resets = <&cpg 917>;
                 clock-names = "rpc";

Please move clock-names just below clocks.

Quoted 13 lines
                 #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>;
                 };
         };
Quoted 1 line

If it is ok and I will submit it in [PATCH v7 2/2].

Looks good, with the above changes made.

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
#17 lore raw

Re: [PATCH v6 2/2] dt-bindings: spi: Document Renesas R-Car Gen3 RPC-IF controller bindings

In reply to Mason Yang

Hello!

Quoted 24 lines · Mason Yang

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

---
  .../devicetree/bindings/spi/spi-renesas-rpc.txt    | 37 ++++++++++++++++++++++
  1 file changed, 37 insertions(+)

create mode 100644 Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +10 -0
new file mode 100644
index 0000000..9b5001e
@@ -0,0 +1,37 @@
+Renesas R-Car Gen3 RPC-IF controller Device Tree Bindings
+----------------------------------------------------------
+
+Required properties:
+- compatible: should be "renesas,rcar-gen3-rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0
+- reg: should contain three register areas:
+	first for the base address of rpc-if registers,
+	second for the direct mapping read mode and

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt line 20

Quoted 10 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +10 -0
+	third for the write buffer area.
+- reg-names: should contain "regs", "dirmap" and "wbuf"
+- clock-names: should contain "rpc"
+- clocks: should contain 1 entries for the module's clock
+
+Example:
+
+	rpc: rpc@ee200000 {
+		compatible = "renesas,rcar-gen3-rpc";
+		reg = <0 0xee200000 0 0x7fff>, <0 0x08000000 0 0x4000000>,

s/0x7fff/0x8000/. -- that's size, not limit. But in reality, 0x200 would
be enough.

Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt line 22

Quoted 2 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +2 -0
+		      <0 0xee208000 0 0x100>;
+		reg-names = "regs", "dirmap", "<wbuf>;

Why <>?

MBR, Sergei