Skip to contentSkip to conversation

spi: Add Renesas R-Car Gen3 RPC SPI driver

PATCH Superseded Mason Yang 4 participants 17 messages Dec 7, 2018 – Dec 21, 2018 2 messages not in the archive

Subsystems (2)

v3 of 17 Superseded Latest is v17 →

lore
Share & tools
lore

Mason Yang

author
#0 lore raw

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

Hi Mark,

This Renesas R-Car Gen3 RPC SPI driver is based on Boris's new spi-mem direct mapping read/write mode [1][2].

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

[1] https://patchwork.kernel.org/patch/10670753
[2] https://patchwork.kernel.org/patch/10670747

Mason Yang (2):
spi: Add Renesas R-Car Gen3 RPC SPI controller driver
dt-binding: spi: Document Renesas R-Car Gen3 RPC controller bindings

 .../devicetree/bindings/spi/spi-renesas-rpc.txt    |  38 +
 drivers/spi/Kconfig                                |   6 +
 drivers/spi/Makefile                               |   1 +
 drivers/spi/spi-renesas-rpc.c                      | 776 +++++++++++++++++++++
 4 files changed, 821 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 v3 1/2 spi: Add Renesas R-Car Gen3 RPC SPI controller driver

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

---
 drivers/spi/Kconfig           |   6 +
 drivers/spi/Makefile          |   1 +
 drivers/spi/spi-renesas-rpc.c | 776 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 783 insertions(+)
 create mode 100644 drivers/spi/spi-renesas-rpc.c
drivers/spi/Kconfig +6 -0
index 7d3a5c9..54b40f8 100644
@@ -528,6 +528,12 @@ config SPI_RSPI
 	help
 	  SPI driver for Renesas RSPI and QSPI blocks.
 
+config SPI_RENESAS_RPC
+	tristate "Renesas R-Car Gen3 RPC SPI controller"
+	depends on ARCH_RENESAS || COMPILE_TEST
+	help
+	  SPI driver for Renesas R-Car Gen3 RPC.
+
 config SPI_QCOM_QSPI
 	tristate "QTI QSPI controller"
 	depends on ARCH_QCOM
drivers/spi/Makefile +1 -0
index 3575205..5d5c523 100644
@@ -81,6 +81,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 +776 -0

776 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

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

Thank you for the patch! Perhaps something to improve:

Hi Mason,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on spi/for-next]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Mason-Yang/spi-Add-Renesas-R-Car-Gen3-RPC-SPI-controller-driver/20181208-081244
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=arm

All warnings (new ones prefixed by >>):

>> WARNING: drivers/spi/spi-renesas-rpc.o(.text+0x155c): Section mismatch in reference from the function rpc_spi_probe() to the (unknown reference) .init.rodata:(unknown)

The function rpc_spi_probe() references
the (unknown reference) __initconst (unknown). This is often because rpc_spi_probe lacks a __initconst annotation or the annotation of (unknown) is wrong.

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#3 lore raw

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

In reply to Mason Yang
Thank you for the patch! Perhaps something to improve:

Hi Mason,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on spi/for-next]
[also build test WARNING on next-20181207]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Mason-Yang/spi-Add-Renesas-R-Car-Gen3-RPC-SPI-controller-driver/20181208-081244
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

>> WARNING: drivers/spi/spi-renesas-rpc.o(.text+0xabd): Section mismatch in reference from the function rpc_spi_probe() to the variable .init.rodata:r8a7795es1

The function rpc_spi_probe() references
the variable __initconst r8a7795es1.
This is often because rpc_spi_probe lacks a __initconst annotation or the annotation of r8a7795es1 is wrong.

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#4 lore raw

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

In reply to Mason Yang
Quoted 3 lines · Mason Yang

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

[...]

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

[...]

Quoted 1 line

+static const struct soc_device_attribute r8a7795es1[] __initconst = {

This __initconst shouldn't be there, it causes a build warning.

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

Quoted 1 line
drivers/spi/spi-renesas-rpc.c new file +1 -0
+	{ .soc_id = "r8a7795", .revision = "ES1.*" },

Wait, the driver doesn't really probe on R8A7795 yet!

Quoted 18 lines
drivers/spi/spi-renesas-rpc.c new file +18 -0
+	{ /* sentinel */ }
+};
+
+static void rpc_spi_hw_init(struct rpc_spi *rpc)
+{
+	int strtim;
+	/*
+	 * 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.
+	 */
+	if (soc_device_match(r8a7795es1))
+		strtim = 0;
+	else
+		strtim = 6;

[...]

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

Quoted 2 lines
drivers/spi/spi-renesas-rpc.c new file +2 -0
+static const struct of_device_id rpc_spi_of_ids[] = {
+	{ .compatible = "renesas,r8a77995-rpc", },

We only support R8A77995 now.

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

Quoted 3 lines
drivers/spi/spi-renesas-rpc.c new file +3 -0
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, rpc_spi_of_ids);

[...]

MBR, Sergei

A message that is not in the archive (sent off-list or not yet received): OFC335F545.7543A0F2-ON4825836A.0007E65A-4825836A.0008428D@mxic.com.tw

#6 lore raw

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

Hello!

Quoted 13 lines · On 12/21/2018 04:30 AM, [email protected] wrote:
Quoted 13 lines
Quoted 6 lines
drivers/spi/spi-renesas-rpc.c new file +0 -0
new file mode 100644
index 0000000..cec5669
@@ -0,0 +1,776 @@

[...]

Quoted 1 line

+static const struct soc_device_attribute r8a7795es1[] __initconst = {

This __initconst shouldn't be there, it causes a build warning.

Quoted 1 line

+ { .soc_id = "r8a7795", .revision = "ES1.*" },

Quoted 7 lines
Quoted 1 line

Wait, the driver doesn't really probe on R8A7795 yet!

yup, this is for RPC_PHYCNT_STRTIM setting by Marek's comments.

On H3 ES1.x, the value should be 0, while on others, the value should be 6.

ES1.x is r8a7795.

Why care if we don't support H3 yet? Add this when the R8A77950 support is added.

Quoted 19 lines
Quoted 19 lines
Quoted 18 lines
drivers/spi/spi-renesas-rpc.c new file +18 -0
+   { /* sentinel */ }
+};
+
+static void rpc_spi_hw_init(struct rpc_spi *rpc)
+{
+   int strtim;
+   /*
+    * 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.
+    */
+   if (soc_device_match(r8a7795es1))
+      strtim = 0;
+   else
+      strtim = 6;

[...]

Quoted 6 lines
Quoted 4 lines

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

Quoted 2 lines
drivers/spi/spi-renesas-rpc.c new file +2 -0
+static const struct of_device_id rpc_spi_of_ids[] = {
+   { .compatible = "renesas,r8a77995-rpc", },

We only support R8A77995 now.

see above !

There's difference between R8A77995 and R8A77950, right?

[...]

Quoted 2 lines

thanks & best regards,
Mason

MBR, Sergei

#7 lore raw

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

In reply to Mason Yang
Quoted 14 lines · Mason Yang

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

---
 drivers/spi/Kconfig           |   6 +
 drivers/spi/Makefile          |   1 +
 drivers/spi/spi-renesas-rpc.c | 776 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 783 insertions(+)
 create mode 100644 drivers/spi/spi-renesas-rpc.c
drivers/spi/Kconfig +0 -0
index 7d3a5c9..54b40f8 100644

[...]

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

[...]

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

Quoted 9 lines
drivers/spi/spi-renesas-rpc.c new file +9 -0
+static int rpc_spi_do_reset(struct rpc_spi *rpc)
+{
+	int ret;
+
+	ret = reset_control_reset(rpc->rstc);
+	if (ret)
+		return ret;
+
+	return 0;

This degrades to:

{
	return reset_control_reset(rpc->rstc);
}

So, we hardly need this function now...

[...]

Quoted 41 lines
drivers/spi/spi-renesas-rpc.c new file +41 -0
+static int rpc_spi_io_xfer(struct rpc_spi *rpc,
+			   const void *tx_buf, void *rx_buf)
+{
+	u32 smenr, smcr, data, pos = 0;
+	int ret = 0;
+
+	regmap_write(rpc->regmap, RPC_CMNCR, RPC_CMNCR_MD | RPC_CMNCR_SFDE |
+				  RPC_CMNCR_MOIIO_HIZ | RPC_CMNCR_IOFV_HIZ |
+				  RPC_CMNCR_BSZ(0));
+	regmap_write(rpc->regmap, RPC_SMDRENR, 0x0);
+	regmap_write(rpc->regmap, RPC_SMCMR, rpc->cmd);
+	regmap_write(rpc->regmap, RPC_SMDMCR, rpc->dummy);
+	regmap_write(rpc->regmap, RPC_SMADR, rpc->addr);
+
+	if (tx_buf) {
+		smenr = rpc->smenr;
+
+		while (pos < rpc->xferlen) {
+			u32 nbytes = rpc->xferlen  - pos;
+
+			regmap_write(rpc->regmap, RPC_SMWDR0,
+				     get_unaligned((u32 *)(tx_buf + pos)));
+
+			if (nbytes > 4) {
+				nbytes = 4;
+				smcr = rpc->smcr |
+				       RPC_SMCR_SPIE | RPC_SMCR_SSLKP;
+			} else {
+				smcr = rpc->smcr | RPC_SMCR_SPIE;
+			}
+
+			regmap_write(rpc->regmap, RPC_SMENR, smenr);
+			regmap_write(rpc->regmap, RPC_SMCR, smcr);
+			ret = wait_msg_xfer_end(rpc);
+			if (ret)
+				goto out;
+
+			pos += nbytes;
+			smenr = rpc->smenr & ~RPC_SMENR_CDE &
+					     ~RPC_SMENR_ADE(0xf);
+		}

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

Quoted 10 lines
drivers/spi/spi-renesas-rpc.c new file +10 -0
+	} else if (rx_buf) {
+		while (pos < rpc->xferlen) {
+			u32 nbytes = rpc->xferlen  - pos;
+
+			if (nbytes > 4)
+				nbytes = 4;
+
+			regmap_write(rpc->regmap, RPC_SMENR, rpc->smenr);
+			regmap_write(rpc->regmap, RPC_SMCR,
+				     rpc->smcr | RPC_SMCR_SPIE);

Hm... our flash chip (Spansion S25FS512S) doesn't get detected; it sends
JEDEC ID bytes 0..3 repeatedly, unless I copy the SSLKP logic from the writing branch above...

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

Quoted 7 lines
drivers/spi/spi-renesas-rpc.c new file +7 -0
+			ret = wait_msg_xfer_end(rpc);
+			if (ret)
+				goto out;
+
+			regmap_read(rpc->regmap, RPC_SMRDR0, &data);
+			memcpy_fromio(rx_buf + pos, (void *)&data, nbytes);
+			pos += nbytes;

... and it skips byte 4 unless I copy the code from the end of the writing
branch, clearing CDE/ADE. But even then the byte 4 reads as 0x03 instead of 0.

Quoted 6 lines
drivers/spi/spi-renesas-rpc.c new file +6 -0
+			regmap_write(rpc->regmap, RPC_SMCMR, rpc->cmd);
+			regmap_write(rpc->regmap, RPC_SMDMCR, rpc->dummy);
+			regmap_write(rpc->regmap, RPC_SMADR, rpc->addr + pos);
+		}
+	} else {
+		regmap_write(rpc->regmap, RPC_SMENR, rpc->smenr);

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

Quoted 10 lines
drivers/spi/spi-renesas-rpc.c new file +10 -0
+		regmap_write(rpc->regmap, RPC_SMCR, rpc->smcr | RPC_SMCR_SPIE);
+		ret = wait_msg_xfer_end(rpc);
+		if (ret)
+			goto out;
+	}
+
+	return ret;
+out:
+	return rpc_spi_do_reset(rpc);
+}

[...]

MBR, Sergei

A message that is not in the archive (sent off-list or not yet received): OFAE786891.A102E46D-ON48258366.002779D7-48258366.002A5C36@mxic.com.tw

#9 lore raw

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

Quoted 56 lines · On 12/17/2018 08:42 AM, [email protected] wrote:

Hi Sergei,

Quoted 45 lines
Quoted 45 lines
drivers/spi/spi-renesas-rpc.c new file +45 -0
+static int rpc_spi_io_xfer(struct rpc_spi *rpc,
+            const void *tx_buf, void *rx_buf)
+{
+   u32 smenr, smcr, data, pos = 0;
+   int ret = 0;
+
+   regmap_write(rpc->regmap, RPC_CMNCR, RPC_CMNCR_MD | RPC_CMNCR_SFDE |
+              RPC_CMNCR_MOIIO_HIZ | RPC_CMNCR_IOFV_HIZ |
+              RPC_CMNCR_BSZ(0));
+   regmap_write(rpc->regmap, RPC_SMDRENR, 0x0);
+   regmap_write(rpc->regmap, RPC_SMCMR, rpc->cmd);
+   regmap_write(rpc->regmap, RPC_SMDMCR, rpc->dummy);
+   regmap_write(rpc->regmap, RPC_SMADR, rpc->addr);
+
+   if (tx_buf) {
+      smenr = rpc->smenr;
+
+      while (pos < rpc->xferlen) {
+         u32 nbytes = rpc->xferlen  - pos;
+
+         regmap_write(rpc->regmap, RPC_SMWDR0,
+                 get_unaligned((u32 *)(tx_buf + pos)));
+
+         if (nbytes > 4) {
+            nbytes = 4;
+            smcr = rpc->smcr |
+                   RPC_SMCR_SPIE | RPC_SMCR_SSLKP;
+         } else {
+            smcr = rpc->smcr | RPC_SMCR_SPIE;
+         }
+
+         regmap_write(rpc->regmap, RPC_SMENR, smenr);
+         regmap_write(rpc->regmap, RPC_SMCR, smcr);
+         ret = wait_msg_xfer_end(rpc);
+         if (ret)
+            goto out;
+
+         pos += nbytes;
+         smenr = rpc->smenr & ~RPC_SMENR_CDE &
+                    ~RPC_SMENR_ADE(0xf);
+      }
+   } else if (rx_buf) {
+      while (pos < rpc->xferlen) {
+         u32 nbytes = rpc->xferlen  - pos;
+
Quoted 8 lines
Quoted 6 lines

+         if (nbytes > 4)
+            nbytes = 4;
+
+         regmap_write(rpc->regmap, RPC_SMENR, rpc->smenr);
+         regmap_write(rpc->regmap, RPC_SMCR,
+                 rpc->smcr | RPC_SMCR_SPIE);

   Hm... our flash chip (Spansion S25FS512S) doesn't get detected; it

Quoted 8 lines

sends

Quoted 1 line

JEDEC ID bytes 0..3 repeatedly, unless I copy the SSLKP logic from the

writing

Quoted 1 line

branch above...

Do you switch the SW1, SW2, SW3, SW13, SW31 and SW10 to on-board QSPI mode ?
Because R-Car D3 Draak board default is booting from HyperFlsah.

So this puts us back to the original discussion -- the driver should support HF mode as well IMO.

Quoted 31 lines

what follows is my booting log, FYI.
------------------------------------------------------------------
[    1.625053] m25p80 spi5.0: s25fl129p1 (16384 Kbytes)
[    1.634391] 12 fixed-partitions partitions found on MTD device spi5.0 [    1.642198] Creating 12 MTD partitions on "spi5.0":
[    1.647598] 0x000000000000-0x000000040000 : "Bank 1 - Boot parameter" [    1.660893] 0x000000040000-0x000000180000 : "Bank 1 - Loader-BL2" [    1.671287] 0x000000180000-0x0000001c0000 : "Bank 1 - Certification"
-----------------------------------------------------------------------

Quoted 10 lines
Quoted 8 lines

+         ret = wait_msg_xfer_end(rpc);
+         if (ret)
+            goto out;
+
+         regmap_read(rpc->regmap, RPC_SMRDR0, &data);
+         memcpy_fromio(rx_buf + pos, (void *)&data, nbytes);
+         pos += nbytes;

   ... and it skips byte 4 unless I copy the code from the end of the

writing

Quoted 1 line

branch, clearing CDE/ADE. But even then the byte 4 reads as 0x03

instead of 0.

yup, I think this is some kind of RPC HW limitation,
in RPC manual I/O mode, it only could read 4 bytes data w/ one command.

That is, one command + read 4 bytes data + read 4 bytes data + read 4 bytes data + ...
will get the incorrect data.

Quoted 6 lines

That's why RPC in manual I/O mode, driver only could do,
one command + read 4 bytes data; one command + read 4 bytes data and so on.

But RPC in external address space read mode(here we call it direct mapping read mode)
is ok for one command + read 4 bytes data + read 4 bytes data + ....

I think the U-Boot driver solves those problems, since it works in both RPC and HF mode on all of Gen3 boards , not just D3 in non-standard SPI boot configuration. Please take a look.

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

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

In reply to a message not in the archive

Hello!

Quoted 56 lines · On 12/17/2018 10:42 AM, [email protected] wrote:
Quoted 47 lines
Quoted 47 lines
drivers/spi/spi-renesas-rpc.c new file +47 -0
+static int rpc_spi_io_xfer(struct rpc_spi *rpc,
+            const void *tx_buf, void *rx_buf)
+{
+   u32 smenr, smcr, data, pos = 0;
+   int ret = 0;
+
+   regmap_write(rpc->regmap, RPC_CMNCR, RPC_CMNCR_MD | RPC_CMNCR_SFDE |
+              RPC_CMNCR_MOIIO_HIZ | RPC_CMNCR_IOFV_HIZ |
+              RPC_CMNCR_BSZ(0));
+   regmap_write(rpc->regmap, RPC_SMDRENR, 0x0);
+   regmap_write(rpc->regmap, RPC_SMCMR, rpc->cmd);
+   regmap_write(rpc->regmap, RPC_SMDMCR, rpc->dummy);
+   regmap_write(rpc->regmap, RPC_SMADR, rpc->addr);
+
+   if (tx_buf) {
+      smenr = rpc->smenr;
+
+      while (pos < rpc->xferlen) {
+         u32 nbytes = rpc->xferlen  - pos;
+
+         regmap_write(rpc->regmap, RPC_SMWDR0,
+                 get_unaligned((u32 *)(tx_buf + pos)));
+
+         if (nbytes > 4) {
+            nbytes = 4;
+            smcr = rpc->smcr |
+                   RPC_SMCR_SPIE | RPC_SMCR_SSLKP;
+         } else {
+            smcr = rpc->smcr | RPC_SMCR_SPIE;
+         }
+
+         regmap_write(rpc->regmap, RPC_SMENR, smenr);
+         regmap_write(rpc->regmap, RPC_SMCR, smcr);
+         ret = wait_msg_xfer_end(rpc);
+         if (ret)
+            goto out;
+
+         pos += nbytes;
+         smenr = rpc->smenr & ~RPC_SMENR_CDE &
+                    ~RPC_SMENR_ADE(0xf);
+      }
+   } else if (rx_buf) {
+      while (pos < rpc->xferlen) {
+         u32 nbytes = rpc->xferlen  - pos;
+
+         if (nbytes > 4)
+            nbytes = 4;
Quoted 8 lines

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

Quoted 4 lines
drivers/spi/spi-renesas-rpc.c new file +4 -0
+
+         regmap_write(rpc->regmap, RPC_SMENR, rpc->smenr);
+         regmap_write(rpc->regmap, RPC_SMCR,
+                 rpc->smcr | RPC_SMCR_SPIE);

Hm... our flash chip (Spansion S25FS512S) doesn't get detected; it sends
JEDEC ID bytes 0..3 repeatedly, unless I copy the SSLKP logic from the writing branch above...

Quoted 2 lines

Do you switch the SW1, SW2, SW3, SW13, SW31 and SW10 to on-board QSPI mode ? Because R-Car D3 Draak board default is booting from HyperFlsah.

I was testing your patch on the V3H-based Condor and Starter Kit boards --
it should have worked without much ado...
It works with *our* driver, living under drivers/mtd/spi-nor/ (which makes
it outdated, AFAIU) and I was going to push it upstream before I learned about your driver. :-)

Quoted 3 lines

what follows is my booting log, FYI.
------------------------------------------------------------------

[    1.625053] m25p80 spi5.0: s25fl129p1 (16384 Kbytes)

So another Spansion flash?

Quoted 16 lines
[    1.634391] 12 fixed-partitions partitions found on MTD device spi5.0
[    1.642198] Creating 12 MTD partitions on "spi5.0":
[    1.647598] 0x000000000000-0x000000040000 : "Bank 1 - Boot parameter"
[    1.660893] 0x000000040000-0x000000180000 : "Bank 1 - Loader-BL2"
[    1.671287] 0x000000180000-0x0000001c0000 : "Bank 1 - Certification"

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

Quoted 9 lines
Quoted 8 lines
drivers/spi/spi-renesas-rpc.c new file +7 -0
+         ret = wait_msg_xfer_end(rpc);
+         if (ret)
+            goto out;
+
+         regmap_read(rpc->regmap, RPC_SMRDR0, &data);
+         memcpy_fromio(rx_buf + pos, (void *)&data, nbytes);
+         pos += nbytes;
Quoted 5 lines
Quoted 2 lines

... and it skips byte 4 unless I copy the code from the end of the writing
branch, clearing CDE/ADE. But even then the byte 4 reads as 0x03 instead of 0.

yup, I think this is some kind of RPC HW limitation,
in RPC manual I/O mode, it only could read 4 bytes data w/ one command.

Thank for the info -- seems worth a comment though...

Quoted 2 lines

That is, one command + read 4 bytes data + read 4 bytes data + read 4 bytes data + ... will get the incorrect data.

What if we want to read less than 4 bytes (the ID read requests SPI_NOR_MAX_ID_LEN
(6) bytes, i.e. 4 + 2)? You seem to always expect 4 bytes...

Quoted 2 lines

That's why RPC in manual I/O mode, driver only could do,
one command + read 4 bytes data; one command + read 4 bytes data and so on.

The question is why it just duplicates the ID bytes 0..3 on the 2nd iteration
in our case...

Quoted 2 lines

But RPC in external address space read mode(here we call it direct mapping read mode) is ok for one command + read 4 bytes data + read 4 bytes data + ....

Sounds promising... if only we could make the probing work. :-)

Quoted 2 lines

thanks & best regards,
Mason

MBR, Sergei

#11 lore raw

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

In reply to a message not in the archive
Quoted 55 lines · On 12/17/2018 10:42 AM, [email protected] wrote:
Quoted 55 lines
Quoted 41 lines
drivers/spi/spi-renesas-rpc.c new file +41 -0
+static int rpc_spi_io_xfer(struct rpc_spi *rpc,
+            const void *tx_buf, void *rx_buf)
+{
+   u32 smenr, smcr, data, pos = 0;
+   int ret = 0;
+
+   regmap_write(rpc->regmap, RPC_CMNCR, RPC_CMNCR_MD | RPC_CMNCR_SFDE |
+              RPC_CMNCR_MOIIO_HIZ | RPC_CMNCR_IOFV_HIZ |
+              RPC_CMNCR_BSZ(0));
+   regmap_write(rpc->regmap, RPC_SMDRENR, 0x0);
+   regmap_write(rpc->regmap, RPC_SMCMR, rpc->cmd);
+   regmap_write(rpc->regmap, RPC_SMDMCR, rpc->dummy);
+   regmap_write(rpc->regmap, RPC_SMADR, rpc->addr);
+
+   if (tx_buf) {
+      smenr = rpc->smenr;
+
+      while (pos < rpc->xferlen) {
+         u32 nbytes = rpc->xferlen  - pos;
+
+         regmap_write(rpc->regmap, RPC_SMWDR0,
+                 get_unaligned((u32 *)(tx_buf + pos)));
+
+         if (nbytes > 4) {
+            nbytes = 4;
+            smcr = rpc->smcr |
+                   RPC_SMCR_SPIE | RPC_SMCR_SSLKP;
+         } else {
+            smcr = rpc->smcr | RPC_SMCR_SPIE;
+         }
+
+         regmap_write(rpc->regmap, RPC_SMENR, smenr);
+         regmap_write(rpc->regmap, RPC_SMCR, smcr);
+         ret = wait_msg_xfer_end(rpc);
+         if (ret)
+            goto out;
+
+         pos += nbytes;
+         smenr = rpc->smenr & ~RPC_SMENR_CDE &
+                    ~RPC_SMENR_ADE(0xf);
+      }

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

Quoted 10 lines
drivers/spi/spi-renesas-rpc.c new file +10 -0
+   } else if (rx_buf) {
+      while (pos < rpc->xferlen) {
+         u32 nbytes = rpc->xferlen  - pos;
+
+         if (nbytes > 4)
+            nbytes = 4;
+
+         regmap_write(rpc->regmap, RPC_SMENR, rpc->smenr);
+         regmap_write(rpc->regmap, RPC_SMCR,
+                 rpc->smcr | RPC_SMCR_SPIE);

Hm... our flash chip (Spansion S25FS512S) doesn't get detected; it sends
JEDEC ID bytes 0..3 repeatedly, unless I copy the SSLKP logic from the writing branch above...

[...]

Quoted 3 lines

what follows is my booting log, FYI.
------------------------------------------------------------------

[    1.625053] m25p80 spi5.0: s25fl129p1 (16384 Kbytes)

Looking at the spi_nor_ids[], this chip has 0x01 in both byte 0 and byte 4...

Quoted 19 lines
[    1.634391] 12 fixed-partitions partitions found on MTD device spi5.0
[    1.642198] Creating 12 MTD partitions on "spi5.0":
[    1.647598] 0x000000000000-0x000000040000 : "Bank 1 - Boot parameter"
[    1.660893] 0x000000040000-0x000000180000 : "Bank 1 - Loader-BL2"
[    1.671287] 0x000000180000-0x0000001c0000 : "Bank 1 - Certification"

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

Quoted 11 lines

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

Quoted 8 lines
drivers/spi/spi-renesas-rpc.c new file +7 -0
+         ret = wait_msg_xfer_end(rpc);
+         if (ret)
+            goto out;
+
+         regmap_read(rpc->regmap, RPC_SMRDR0, &data);
+         memcpy_fromio(rx_buf + pos, (void *)&data, nbytes);
+         pos += nbytes;

... and it skips byte 4 unless I copy the code from the end of the writing
branch, clearing CDE/ADE. But even then the byte 4 reads as 0x03 instead of 0.

Quoted 8 lines

yup, I think this is some kind of RPC HW limitation,
in RPC manual I/O mode, it only could read 4 bytes data w/ one command.

That is, one command + read 4 bytes data + read 4 bytes data + read 4 bytes data + ... will get the incorrect data.

That's why RPC in manual I/O mode, driver only could do,
one command + read 4 bytes data; one command + read 4 bytes data and so on.

Yes. But the problem is you can't work around by reading 4 bytes at most
for the RDID command -- it has no address phase. Every time you "restart" reading, you get bytes 0..3 again, like me. It seems that this approach works for you only by chance...

Quoted 2 lines

thanks & best regards,
Mason

MBR, Sergei

author
#12 lore raw

PATCH v3 2/2 dt-binding: spi: Document Renesas R-Car Gen3 RPC controller bindings

In reply to Mason Yang

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

---
 .../devicetree/bindings/spi/spi-renesas-rpc.txt    | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +38 -0
new file mode 100644
index 0000000..a191f70
@@ -0,0 +1,38 @@
+Renesas R-Car Gen3 RPC controller Device Tree Bindings
+------------------------------------------------------
+
+Required properties:
+- compatible: should be "renesas,r8a77995-rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0
+- reg: should contain 2 entries, one for the registers and one for the direct
+       mapping area
+- reg-names: should contain "rpc_regs" and "dirmap"
+- interrupts: interrupt line connected to the RPC controller
+- clock-names: should contain "clk_rpc"
+- clocks: should contain 1 entries for the module's clock
+- rpc-mode: should contain "rpc-spi-flash" for rpc spi mode or
+			   "rpc-hyperflash" for rpc hyerflash mode.
+
+Example:
+
+	rpc: rpc@ee200000 {
+		compatible = "renesas,r8a77995-rpc";
+		reg = <0 0xee200000 0 0x8100>, <0 0x08000000 0 0x4000000>;
+		reg-names = "rpc_regs", "dirmap";
+		clocks = <&cpg CPG_MOD 917>;
+		power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+		resets = <&cpg 917>;
+		clock-names = "clk_rpc";
+		rpc-mode = "rpc-spi-flash";
+		#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
#13 lore raw

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

Hello!

Quoted 14 lines · Mason Yang

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

---
 .../devicetree/bindings/spi/spi-renesas-rpc.txt    | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +0 -0
new file mode 100644
index 0000000..a191f70

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

Quoted 10 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +10 -0
@@ -0,0 +1,38 @@
+Renesas R-Car Gen3 RPC controller Device Tree Bindings
+------------------------------------------------------
+
+Required properties:
+- compatible: should be "renesas,r8a77995-rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0
+- reg: should contain 2 entries, one for the registers and one for the direct
+       mapping area
+- reg-names: should contain "rpc_regs" and "dirmap"

Please drop this "rpc_" thing, I think "regs" should be enough.

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

Quoted 2 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +2 -0
+- interrupts: interrupt line connected to the RPC controller
+- clock-names: should contain "clk_rpc"

Please drop this "clk_" thing. BTW, what's with the RPCD2 clock?

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

Quoted 3 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +3 -0
+- clocks: should contain 1 entries for the module's clock
+- rpc-mode: should contain "rpc-spi-flash" for rpc spi mode or
+			   "rpc-hyperflash" for rpc hyerflash mode.

I think the prop should be called "renesas,rpc-mode" and the values should be
just "spi" and "hyperflash".

[...]

MBR, Sergei

#14 lore raw

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

Quoted 34 lines · Sergei Shtylyov

Hello!

Quoted 14 lines · Mason Yang

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

---
 .../devicetree/bindings/spi/spi-renesas-rpc.txt    | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +0 -0
new file mode 100644
index 0000000..a191f70

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

Quoted 10 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +10 -0
@@ -0,0 +1,38 @@
+Renesas R-Car Gen3 RPC controller Device Tree Bindings
+------------------------------------------------------
+
+Required properties:
+- compatible: should be "renesas,r8a77995-rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0
+- reg: should contain 2 entries, one for the registers and one for the direct
+       mapping area
+- reg-names: should contain "rpc_regs" and "dirmap"

Please drop this "rpc_" thing, I think "regs" should be enough.

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

Quoted 2 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +2 -0
+- interrupts: interrupt line connected to the RPC controller
+- clock-names: should contain "clk_rpc"
Quoted 8 lines

Please drop this "clk_" thing. BTW, what's with the RPCD2 clock?

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

Quoted 3 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +3 -0
+- clocks: should contain 1 entries for the module's clock
+- rpc-mode: should contain "rpc-spi-flash" for rpc spi mode or
+			   "rpc-hyperflash" for rpc hyerflash mode.

I think the prop should be called "renesas,rpc-mode" and the values should be
just "spi" and "hyperflash".

Like I said before, you can determine the mode from the subnode attached to the controller, we don't need special prop for that.

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

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

In reply to Mason Yang
Quoted 15 lines · Mason Yang

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

---
 .../devicetree/bindings/spi/spi-renesas-rpc.txt    | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +1 -0
new file mode 100644
index 0000000..a191f70
@@ -0,0 +1,38 @@
+Renesas R-Car Gen3 RPC controller Device Tree Bindings

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

Quoted 10 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +10 -0
+------------------------------------------------------
+
+Required properties:
+- compatible: should be "renesas,r8a77995-rpc"
+- #address-cells: should be 1
+- #size-cells: should be 0
+- reg: should contain 2 entries, one for the registers and one for the direct
+       mapping area
+- reg-names: should contain "rpc_regs" and "dirmap"
+- interrupts: interrupt line connected to the RPC controller

Required prop but it's missing in your example below...

Quoted 8 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +8 -0
+- clock-names: should contain "clk_rpc"
+- clocks: should contain 1 entries for the module's clock
+- rpc-mode: should contain "rpc-spi-flash" for rpc spi mode or
+			   "rpc-hyperflash" for rpc hyerflash mode.
+
+Example:
+
+	rpc: rpc@ee200000 {

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

Quoted 10 lines
Documentation/devicetree/bindings/spi/spi-renesas-rpc.txt new file +10 -0
+		compatible = "renesas,r8a77995-rpc";
+		reg = <0 0xee200000 0 0x8100>, <0 0x08000000 0 0x4000000>;
+		reg-names = "rpc_regs", "dirmap";
+		clocks = <&cpg CPG_MOD 917>;
+		power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+		resets = <&cpg 917>;
+		clock-names = "clk_rpc";
+		rpc-mode = "rpc-spi-flash";
+		#address-cells = <1>;
+		#size-cells = <0>;

[...]

MBR, Sergei

#17 lore raw
In reply to Mason Yang
Quoted 22 lines · Mason Yang

This Renesas R-Car Gen3 RPC SPI driver is based on Boris's new spi-mem direct mapping read/write mode [1][2].

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

Quoted 7 lines

[1] https://patchwork.kernel.org/patch/10670753
[2] https://patchwork.kernel.org/patch/10670747

Mason Yang (2):
spi: Add Renesas R-Car Gen3 RPC SPI controller driver
dt-binding: spi: Document Renesas R-Car Gen3 RPC controller bindings

Probably a stupid question: how did you test this driver (especially
the dirmap related parts)?

MBR, Sergei

#18 lore raw

Hi Sergei,

Thanks for your review.

Quoted 47 lines

"Sergei Shtylyov" <[email protected]> 2018/12/09 下午 11:38

To

"Mason Yang" <[email protected]>, [email protected], [email protected], [email protected], linux- [email protected], [email protected], linux-renesas- [email protected], "Geert Uytterhoeven" <[email protected]>,

cc

[email protected], "Simon Horman" <[email protected]>, [email protected]

Subject

Re: [PATCH v3 0/2] spi: Add Renesas R-Car Gen3 RPC SPI driver

Quoted 26 lines · Mason Yang

This Renesas R-Car Gen3 RPC SPI driver is based on Boris's new spi-mem direct mapping read/write mode [1][2].

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

[1] https://patchwork.kernel.org/patch/10670753
[2] https://patchwork.kernel.org/patch/10670747

Quoted 8 lines
Quoted 3 lines

Mason Yang (2):
spi: Add Renesas R-Car Gen3 RPC SPI controller driver
dt-binding: spi: Document Renesas R-Car Gen3 RPC controller bindings

Probably a stupid question: how did you test this driver (especially
the dirmap related parts)?

MBR, Sergei

I got two R-Car D3 Draak board, patch it's IPL code for booting from MXIC Octa-Flash as follows log:

NOTICE:  BL2: R-Car D3 Initial Program Loader(CA53) Rev.0.5.1
NOTICE:  BL2: PRR is R-Car D3 Ver1.0
NOTICE:  BL2: Boot device is MXIC_OctaFlash
NOTICE:  BL2: LCM state is CM
NOTICE:  BL2: DDR3L-1866(rev.0.02)
NOTICE:  BL2: QoS is default setting(rev.0.07)
NOTICE:  BL2: v1.3(release):
NOTICE:  BL2: Built : 09:56:31, Sep 26 2018
NOTICE:  BL2: Normal boot
NOTICE:  BL2: dst=0xe63111f0 src=0x8180000 len=512(0x200)
NOTICE:  BL2: dst=0x43f00000 src=0x8180400 len=6144(0x1800)
NOTICE:  BL2: dst=0x44000000 src=0x81c0000 len=65536(0x10000)
NOTICE:  BL2: dst=0x50000000 src=0x8640000 len=1048576(0x100000)

I also patch Boris's new spi-mem direct mapping read/write based on Kernel 4.19 as follows log:

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 4.19.0-rc1-arm64-renesas-00015-g134e651-dirty 
(sys6@sys1-mpvm96) (gcc version 5.1.1 20150608 (Linaro GCC 5.1-2015.08)) 
#350 SMP PREEMPT Fri Dec 7 14:22:26 CST 2018
[    0.000000] Machine model: Renesas Draak board based on r8a77995
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created CMA memory pool at 
0x0000000058000000, size 128 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id 
shared-dma-pool
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.0 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.0
[    0.000000] random: get_random_bytes called from 
start_kernel+0xb0/0x47c with crng_init=0
[    0.000000] percpu: Embedded 25 pages/cpu @(____ptrval____) s64576 
r8192 d29632 u102400
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for ARM erratum 845719
[    0.000000] CPU features: detected: Kernel page table isolation (KPTI)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 
96768
[    0.000000] Kernel command line: rw root=/dev/sda2 rootwait
[    0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 
bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 
bytes)
[    0.000000] Memory: 217388K/393216K available (9660K kernel code, 1170K 
rwdata, 3156K rodata, 704K init, 12232K bss, 44756K reserved, 131072K 
cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Running RCU self tests
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU lockdep checking is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=64 to 
nr_cpu_ids=1.
[    0.000000]  Tasks RCU enabled.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, 
nr_cpu_ids=1
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff 
max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000007] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 
4398046511097ns
[    0.000374] Console: colour dummy device 80x25
[    0.002508] console [tty0] enabled
[    0.002560] Lock dependency validator: Copyright (c) 2006 Red Hat, 
Inc., Ingo Molnar
[    0.002644] ... MAX_LOCKDEP_SUBCLASSES:  8
[    0.002696] ... MAX_LOCK_DEPTH:          48
[    0.002748] ... MAX_LOCKDEP_KEYS:        8191
[    0.002801] ... CLASSHASH_SIZE:          4096
[    0.002854] ... MAX_LOCKDEP_ENTRIES:     32768
[    0.002909] ... MAX_LOCKDEP_CHAINS:      65536
[    0.002962] ... CHAINHASH_SIZE:          32768
[    0.003016]  memory used by lock dependency info: 7391 kB
[    0.003078]  per task-struct memory footprint: 1920 bytes
[    0.003237] Calibrating delay loop (skipped), value calculated using 
timer frequency.. 48.00 BogoMIPS (lpj=96000)
[    0.003357] pid_max: default: 32768 minimum: 301
[    0.003988] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
[    0.004088] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 
bytes)
[    0.032668] ASID allocator initialised with 32768 entries
[    0.040648] rcu: Hierarchical SRCU implementation.
[    0.049733] Detected Renesas R-Car Gen3 r8a77995 ES1.0
[    0.050704] EFI services will not be available.
[    0.056923] smp: Bringing up secondary CPUs ...
[    0.057036] smp: Brought up 1 node, 1 CPU
[    0.057097] SMP: Total of 1 processors activated.
[    0.057175] CPU features: detected: 32-bit EL0 Support
[    0.061554] CPU: All CPU(s) started at EL1
[    0.061702] alternatives: patching kernel code
[    0.065172] devtmpfs: initialized
[    0.094874] clocksource: jiffies: mask: 0xffffffff max_cycles: 
0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.095086] futex hash table entries: 256 (order: 3, 32768 bytes)
[    0.100662] pinctrl core: initialized pinctrl subsystem
[    0.103831] DMI not present or invalid.
[    0.105380] NET: Registered protocol family 16
[    0.106899] audit: initializing netlink subsys (disabled)
[    0.109917] audit: type=2000 audit(0.104:1): state=initialized 
audit_enabled=0 res=1
[    0.110141] cpuidle: using governor menu
[    0.110822] vdso: 2 pages (1 code @ (____ptrval____), 1 data @ 
(____ptrval____))
[    0.110965] hw-breakpoint: found 6 breakpoint and 4 watchpoint 
registers.
[    0.114630] DMA: preallocated 256 KiB pool for atomic allocations
[    0.125457] sh-pfc e6060000.pin-controller: r8a77995_pfc support 
registered
[    0.182113] HugeTLB registered 2.00 MiB page size, pre-allocated 0 
pages
[    0.184878] cryptd: max_cpu_qlen set to 1000
[    0.201992] vgaarb: loaded
[    0.202936] SCSI subsystem initialized
[    0.206481] usbcore: registered new interface driver usbfs
[    0.206817] usbcore: registered new interface driver hub
[    0.207184] usbcore: registered new device driver usb
[    0.209078] media: Linux media interface: v0.10
[    0.209412] videodev: Linux video capture interface: v2.00
[    0.209568] pps_core: LinuxPPS API ver. 1 registered
[    0.209637] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo 
Giometti <[email protected]>
[    0.209778] PTP clock support registered
[    0.209920] EDAC MC: Ver: 3.0.0
[    0.212192] Advanced Linux Sound Architecture Driver Initialized.
[    0.214497] Bluetooth: Core ver 2.22
[    0.214780] NET: Registered protocol family 31
[    0.214857] Bluetooth: HCI device and connection manager initialized
[    0.215059] Bluetooth: HCI socket layer initialized
[    0.215140] Bluetooth: L2CAP socket layer initialized
[    0.215397] Bluetooth: SCO socket layer initialized
[    0.217116] clocksource: Switched to clocksource arch_sys_counter
[    0.396363] VFS: Disk quotas dquot_6.6.0
[    0.396700] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 
bytes)
[    0.428928] NET: Registered protocol family 2
[    0.432741] tcp_listen_portaddr_hash hash table entries: 256 (order: 2, 
18432 bytes)
[    0.432966] TCP established hash table entries: 4096 (order: 3, 32768 
bytes)
[    0.433613] TCP bind hash table entries: 4096 (order: 6, 262144 bytes)
[    0.434215] TCP: Hash tables configured (established 4096 bind 4096)
[    0.435166] UDP hash table entries: 256 (order: 3, 40960 bytes)
[    0.435385] UDP-Lite hash table entries: 256 (order: 3, 40960 bytes)
[    0.436120] NET: Registered protocol family 1
[    0.451874] RPC: Registered named UNIX socket transport module.
[    0.452024] RPC: Registered udp transport module.
[    0.452092] RPC: Registered tcp transport module.
[    0.452159] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.455558] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 
counters available
[    0.456462] kvm [1]: HYP mode not available
[    0.480595] workingset: timestamp_bits=46 max_order=17 bucket_order=0
[    0.507019] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.513977] NFS: Registering the id_resolver key type
[    0.514390] Key type id_resolver registered
[    0.514493] Key type id_legacy registered
[    0.514607] nfs4filelayout_init: NFSv4 File Layout Driver 
Registering...
[    0.534938] Block layer SCSI generic (bsg) driver version 0.4 loaded 
(major 246)
[    0.535345] io scheduler noop registered
[    0.535961] io scheduler cfq registered (default)
[    0.536055] io scheduler mq-deadline registered
[    0.536121] io scheduler kyber registered
[    0.546570] gpio_rcar e6050000.gpio: driving 9 GPIOs
[    0.548400] gpio_rcar e6051000.gpio: driving 32 GPIOs
[    0.550489] gpio_rcar e6052000.gpio: driving 32 GPIOs
[    0.552193] gpio_rcar e6053000.gpio: driving 10 GPIOs
[    0.554227] gpio_rcar e6054000.gpio: driving 32 GPIOs
[    0.555923] gpio_rcar e6055000.gpio: driving 21 GPIOs
[    0.557961] gpio_rcar e6055400.gpio: driving 14 GPIOs
[    0.784707] SuperH (H)SCI(F) driver initialized
[    0.787201] e6e88000.serial: ttySC0 at MMIO 0xe6e88000 (irq = 96, 
base_baud = 0) is a scif
[    1.526253] console [ttySC0] enabled
[    1.564691] loop: module loaded
[    1.576670] m25p80 spi5.0: mx25um51245g (65536 Kbytes)
[    1.586708] 12 fixed-partitions partitions found on MTD device spi5.0
[    1.594383] Creating 12 MTD partitions on "spi5.0":
[    1.599746] 0x000000000000-0x000000040000 : "Bank 1 - Boot parameter"
[    1.612900] 0x000000040000-0x000000180000 : "Bank 1 - Loader-BL2"
[    1.622992] 0x000000180000-0x0000001c0000 : "Bank 1 - Certification"
[    1.632897] 0x0000001c0000-0x000000240000 : "Bank 1 - ARM Trusted FW"
[    1.643133] 0x000000240000-0x000000640000 : "Bank 1 - Reserved-1"
[    1.652875] 0x000000640000-0x000000940000 : "Bank 1 - U-Boot"
[    1.662370] 0x000000940000-0x000000b40000 : "Bank 1 - Reserved-2"
[    1.672049] 0x000000b40000-0x000000fc0000 : "Bank 1 - Splash"
[    1.681513] 0x000000fc0000-0x000001000000 : "Bank 1 - Device Tree"
[    1.691377] 0x000001000000-0x000002000000 : "Bank 2 - Linux Kernel"
[    1.701393] 0x000002000000-0x000003000000 : "Bank 3 - User App I"
[    1.711160] 0x000003000000-0x000004000000 : "Bank 4 - User App II"
[    1.723892] libphy: Fixed MDIO Bus: probed

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.

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