Skip to contentSkip to conversation

arm: rmobile: Stout board support and minor fixes

PATCH New Vladimir Barinov 2 participants 8 messages Jul 20, 2015 – Aug 31, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover arm: rmobile: Stout board support and minor fixes

This patch series adds the following:
1) sh-pfc: fix gpio input read
2) serial-sh: SCIFA interface for R-Car Gen2 SoCs
3) rmobile: add SCIFA port base offsets
4) rmobile: Add Stout board support

---
 arch/arm/cpu/armv7/rmobile/Kconfig            |    8 
 arch/arm/include/asm/arch-rmobile/rcar-base.h |    3 
 board/renesas/stout/Kconfig                   |   12 
 board/renesas/stout/MAINTAINERS               |    6 
 board/renesas/stout/Makefile                  |   11 
 board/renesas/stout/cpld.c                    |  167 +
 board/renesas/stout/cpld.h                    |  183 +
 board/renesas/stout/qos.c                     | 2435 ++++++++++++++++++++++++++
 board/renesas/stout/qos.h                     |   14 
 board/renesas/stout/stout.c                   |  232 ++
 configs/stout_defconfig                       |   21 
 drivers/gpio/sh_pfc.c                         |    3 
 drivers/serial/serial_sh.h                    |   43 
 include/configs/stout.h                       |  112 +
 14 files changed, 3239 insertions(+), 11 deletions(-)
#1 lore raw

PATCH 1/4 gpio: sh-pfc: fix gpio input read

Fix gpio_read: gpio input (INDT) and gpio output (OUTDT) registers have different offset. gpio_read must be performed from INDT.

---
 drivers/gpio/sh_pfc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/sh_pfc.c +2 -1
index 7a5af20..95f5b2a 100644
@@ -75,7 +75,8 @@ static int gpio_read_bit(struct pinmux_data_reg *dr,
 	debug("read_bit: addr = %lx, pos = %ld, "
 		 "r_width = %ld\n", dr->reg, pos, dr->reg_width);
 
-	return (gpio_read_raw_reg(dr->mapped_reg, dr->reg_width) >> pos) & 1;
+	return
+	    (gpio_read_raw_reg(dr->mapped_reg + 0x4, dr->reg_width) >> pos) & 1;
 }
 
 static void gpio_write_bit(struct pinmux_data_reg *dr,
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/4 serial: serial-sh: SCIFA interface for R-Car Gen2 SoCs

In reply to Vladimir Barinov

Add SCIFA console interface for R-Car Gen2 SoCs.
SCIFA has different registers offsets and sizes then SCI. Hence it needs to put it's macro definitions separately.

---
 drivers/serial/serial_sh.h | 43 ++++++++++++++++++++++++++++++++++---------
 1 file changed, 34 insertions(+), 9 deletions(-)
drivers/serial/serial_sh.h +34 -9
index 941e6ed..cbc2929 100644
@@ -226,7 +226,11 @@ struct uart_port {
 # define SCSCR_INIT(port)	0x38	/* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
 #elif defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \
 	defined(CONFIG_R8A7793) || defined(CONFIG_R8A7794)
-# define SCIF_ORER	0x0001
+# if defined(CONFIG_SCIF_A)
+#  define SCIF_ORER	0x0200
+# else
+#  define SCIF_ORER	0x0001
+# endif
 # define SCSCR_INIT(port)	(port->clk_mode == EXT_CLK ? 0x32 : 0x30)
 				/* TIE=0,RIE=0,TE=1,RE=1,REIE=0, */
 #else
@@ -306,7 +310,11 @@ struct uart_port {
 #elif defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \
 	defined(CONFIG_R8A7793) || defined(CONFIG_R8A7794)
 # define SCIF_ERRORS (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK)
-# define SCIF_RFDC_MASK	0x003f
+# if defined(CONFIG_SCIF_A)
+#  define SCIF_RFDC_MASK	0x007f
+# else
+#  define SCIF_RFDC_MASK	0x001f
+# endif
 #else
 # define SCIF_ERRORS (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK)
 # define SCIF_RFDC_MASK 0x001f
@@ -557,6 +565,25 @@ SCIF_FNS(SCFCR,  0x18, 16)
 SCIF_FNS(SCFDR,  0x1c, 16)
 SCIF_FNS(SCLSR,  0x24, 16)
 SCIF_FNS(DL,	 0x00,  0) /* dummy */
+#elif defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \
+	defined(CONFIG_R8A7793) || defined(CONFIG_R8A7794)
+/* SCIFA and SCIF register offsets and size */
+SCIx_FNS(SCSMR,  0,  0, 0x00, 16, 0,  0, 0x00, 16, 0,  0)
+SCIx_FNS(SCBRR,  0,  0, 0x04,  8, 0,  0, 0x04,  8, 0,  0)
+SCIx_FNS(SCSCR,  0,  0, 0x08, 16, 0,  0, 0x08, 16, 0,  0)
+SCIx_FNS(SCxTDR, 0,  0, 0x20,  8, 0,  0, 0x0C,  8, 0,  0)
+SCIx_FNS(SCxSR,  0,  0, 0x14, 16, 0,  0, 0x10, 16, 0,  0)
+SCIx_FNS(SCxRDR, 0,  0, 0x24,  8, 0,  0, 0x14,  8, 0,  0)
+SCIF_FNS(SCFCR,  0,  0, 0x18, 16)
+SCIF_FNS(SCFDR,  0,  0, 0x1C, 16)
+SCIF_FNS(SCSPTR, 0,  0, 0x20, 16)
+SCIF_FNS(DL,     0,  0, 0x30, 16)
+SCIF_FNS(CKS,    0,  0, 0x34, 16)
+#if defined(CONFIG_SCIF_A)
+SCIF_FNS(SCLSR,  0,  0, 0x14, 16)
+#else
+SCIF_FNS(SCLSR,  0,  0, 0x24, 16)
+#endif
 #else
 /*      reg      SCI/SH3   SCI/SH4  SCIF/SH3   SCIF/SH4  SCI/H8*/
 /*      name     off  sz   off  sz   off  sz   off  sz   off  sz*/
@@ -594,14 +621,8 @@ SCIF_FNS(SCSPTR,                        0,  0, 0x20, 16)
 #endif
 SCIF_FNS(SCLSR,                         0,  0, 0x24, 16)
 #endif
-#if defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \
-	defined(CONFIG_R8A7793) || defined(CONFIG_R8A7794)
-SCIF_FNS(DL,				0,  0, 0x30, 16)
-SCIF_FNS(CKS,				0,  0, 0x34, 16)
-#else
 SCIF_FNS(DL,				0,  0, 0x0,  0) /* dummy */
 #endif
-#endif
 #define sci_in(port, reg) sci_##reg##_in(port)
 #define sci_out(port, reg, value) sci_##reg##_out(port, value)
 
@@ -743,7 +764,11 @@ static inline int scbrr_calc(struct uart_port *port, int bps, int clk)
 #elif defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \
 	defined(CONFIG_R8A7793) || defined(CONFIG_R8A7794)
 #define DL_VALUE(bps, clk) (clk / bps / 16) /* External Clock */
-#define SCBRR_VALUE(bps, clk) (clk / bps / 32 - 1) /* Internal Clock */
+ #if defined(CONFIG_SCIF_A)
+  #define SCBRR_VALUE(bps, clk) (clk / bps / 16 - 1) /* Internal Clock */
+ #else
+  #define SCBRR_VALUE(bps, clk) (clk / bps / 32 - 1) /* Internal Clock */
+ #endif
 #else /* Generic SH */
 #define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(32*bps)-1)
 #endif
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/4 arch: rmobile: add SCIFA port base offsets

In reply to Vladimir Barinov

add SCIFA port base offsets

---
 arch/arm/include/asm/arch-rmobile/rcar-base.h | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/include/asm/arch-rmobile/rcar-base.h +3 -0
index d594cd7..53ead26 100644
@@ -28,6 +28,9 @@
 #define SCIF3_BASE		0xE6EA8000
 #define SCIF4_BASE		0xE6EE0000
 #define SCIF5_BASE		0xE6EE8000
+#define SCIFA0_BASE		0xE6C40000
+#define SCIFA1_BASE		0xE6C50000
+#define SCIFA2_BASE		0xE6C60000
 
 /* Module stop status register */
 #define MSTPSR0			0xE6150030
Signature · 1 line
1.9.1
#4 lore raw

PATCH 4/4 arm: rmobile: Add Stout board support

In reply to Vladimir Barinov

Stout is an entry level development board based on R-Car H2 SoC (R8A7790)

This commit supports the following peripherals:
- SCIFA, I2C, Ethernet, QSPI, SDHI0/2, CPLD

---
 arch/arm/cpu/armv7/rmobile/Kconfig |    8 +-
 board/renesas/stout/Kconfig        |   12 +
 board/renesas/stout/MAINTAINERS    |    6 +
 board/renesas/stout/Makefile       |   11 +
 board/renesas/stout/cpld.c         |  167 +++
 board/renesas/stout/cpld.h         |  183 +++
 board/renesas/stout/qos.c          | 2435 ++++++++++++++++++++++++++++++++++++
 board/renesas/stout/qos.h          |   14 +
 board/renesas/stout/stout.c        |  232 ++++
 configs/stout_defconfig            |   21 +
 include/configs/stout.h            |  112 ++
 11 files changed, 3200 insertions(+), 1 deletion(-)
 create mode 100644 board/renesas/stout/Kconfig
 create mode 100644 board/renesas/stout/MAINTAINERS
 create mode 100644 board/renesas/stout/Makefile
 create mode 100644 board/renesas/stout/cpld.c
 create mode 100644 board/renesas/stout/cpld.h
 create mode 100644 board/renesas/stout/qos.c
 create mode 100644 board/renesas/stout/qos.h
 create mode 100644 board/renesas/stout/stout.c
 create mode 100644 configs/stout_defconfig
 create mode 100644 include/configs/stout.h
arch/arm/cpu/armv7/rmobile/Kconfig +7 -1
index ef56286..85c06eb 100644
@@ -40,6 +40,11 @@ config TARGET_PORTER
 	select DM
 	select DM_SERIAL
 
+config TARGET_STOUT
+	bool "Stout board"
+	select DM
+	select DM_SERIAL
+
 endchoice
 
 config SYS_SOC
@@ -47,7 +52,7 @@ config SYS_SOC
 
 config RMOBILE_EXTRAM_BOOT
 	bool "Enable boot from RAM"
-	depends on TARGET_ALT || TARGET_KOELSCH || TARGET_LAGER || TARGET_PORTER || TARGET_SILK
+	depends on TARGET_ALT || TARGET_KOELSCH || TARGET_LAGER || TARGET_PORTER || TARGET_SILK || TARGET_STOUT
 	default n
 
 choice
@@ -80,5 +85,6 @@ source "board/kmc/kzm9g/Kconfig"
 source "board/renesas/alt/Kconfig"
 source "board/renesas/silk/Kconfig"
 source "board/renesas/porter/Kconfig"
+source "board/renesas/stout/Kconfig"
 
 endif
board/renesas/stout/Kconfig new file +12 -0
new file mode 100644
index 0000000..cbbc6dd
@@ -0,0 +1,12 @@
+if TARGET_STOUT
+
+config SYS_BOARD
+	default "stout"
+
+config SYS_VENDOR
+	default "renesas"
+
+config SYS_CONFIG_NAME
+	default "stout"
+
+endif
board/renesas/stout/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000..b7098e7
@@ -0,0 +1,6 @@
+STOUT BOARD
+M:	Cogent Embedded, Inc. <[email protected]>
+S:	Maintained
+F:	board/renesas/stout/
+F:	include/configs/stout.h
+F:	configs/stout_defconfig
board/renesas/stout/Makefile new file +11 -0
new file mode 100644
index 0000000..e78f80c
@@ -0,0 +1,11 @@
+#
+# board/renesas/stout/Makefile
+#
+# Copyright (C) 2015 Renesas Electronics Europe GmbH
+# Copyright (C) 2015 Renesas Electronics Corporation
+# Copyright (C) 2015 Cogent Embedded, Inc.
+#
+# SPDX-License-Identifier: GPL-2.0
+#
+
+obj-y	:= stout.o cpld.o qos.o ../rcar-gen2-common/common.o
board/renesas/stout/cpld.c new file +167 -0

167 lines not on this page · raw message

board/renesas/stout/cpld.h new file +183 -0

183 lines not on this page · raw message

board/renesas/stout/qos.c new file +2435 -0

2,435 lines not on this page · raw message

board/renesas/stout/qos.h new file +14 -0
new file mode 100644
index 0000000..645a5b0
@@ -0,0 +1,14 @@
+/*
+ * Copyright (C) 2015 Renesas Electronics Europe GmbH
+ * Copyright (C) 2015 Renesas Electronics Corporation
+ * Copyright (C) 2015 Cogent Embedded, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef __QOS_H__
+#define __QOS_H__
+
+void qos_init(void);
+
+#endif
board/renesas/stout/stout.c new file +232 -0

147 lines not on this page · raw message

configs/stout_defconfig new file +21 -0
new file mode 100644
index 0000000..fbfe919

Lines of this file are not shown. View the raw message.

include/configs/stout.h new file +112 -0

112 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.9.1

Part of the diff is not shown here. View the raw message.

#5 lore raw

cover arm: rmobile: Stout board support and minor fixes

In reply to Vladimir Barinov

+ Nobuhiro Iwamatsu <[email protected]>

Sorry, seem that I've added old maintainer email.

Quoted 24 lines · Vladimir Barinov

This patch series adds the following:
1) sh-pfc: fix gpio input read
2) serial-sh: SCIFA interface for R-Car Gen2 SoCs
3) rmobile: add SCIFA port base offsets
4) rmobile: Add Stout board support

---
  arch/arm/cpu/armv7/rmobile/Kconfig            |    8
  arch/arm/include/asm/arch-rmobile/rcar-base.h |    3
  board/renesas/stout/Kconfig                   |   12
  board/renesas/stout/MAINTAINERS               |    6
  board/renesas/stout/Makefile                  |   11
  board/renesas/stout/cpld.c                    |  167 +
  board/renesas/stout/cpld.h                    |  183 +
  board/renesas/stout/qos.c                     | 2435 ++++++++++++++++++++++++++
  board/renesas/stout/qos.h                     |   14
  board/renesas/stout/stout.c                   |  232 ++
  configs/stout_defconfig                       |   21
  drivers/gpio/sh_pfc.c                         |    3
  drivers/serial/serial_sh.h                    |   43
  include/configs/stout.h                       |  112 +
  14 files changed, 3239 insertions(+), 11 deletions(-)
#6 lore raw

cover arm: rmobile: Stout board support and minor fixes

In reply to Vladimir Barinov

Hello Nobuhiro-san,

Could you provide any response for this patchset.

TIA,
Vladimir

Quoted 24 lines · Vladimir Barinov

This patch series adds the following:
1) sh-pfc: fix gpio input read
2) serial-sh: SCIFA interface for R-Car Gen2 SoCs
3) rmobile: add SCIFA port base offsets
4) rmobile: Add Stout board support

---
  arch/arm/cpu/armv7/rmobile/Kconfig            |    8
  arch/arm/include/asm/arch-rmobile/rcar-base.h |    3
  board/renesas/stout/Kconfig                   |   12
  board/renesas/stout/MAINTAINERS               |    6
  board/renesas/stout/Makefile                  |   11
  board/renesas/stout/cpld.c                    |  167 +
  board/renesas/stout/cpld.h                    |  183 +
  board/renesas/stout/qos.c                     | 2435 ++++++++++++++++++++++++++
  board/renesas/stout/qos.h                     |   14
  board/renesas/stout/stout.c                   |  232 ++
  configs/stout_defconfig                       |   21
  drivers/gpio/sh_pfc.c                         |    3
  drivers/serial/serial_sh.h                    |   43
  include/configs/stout.h                       |  112 +
  14 files changed, 3239 insertions(+), 11 deletions(-)
#7 lore raw

cover arm: rmobile: Stout board support and minor fixes

Hi, Vladimir.

Sorry about this.
I just applied my repository.

Best regards,
Nobuhiro

2015-08-21 4:57 GMT+09:00 Vladimir Barinov
<[email protected]>:

Quoted 35 lines

Hello Nobuhiro-san,

Could you provide any response for this patchset.

TIA,
Vladimir

Quoted 26 lines · Vladimir Barinov

This patch series adds the following:
1) sh-pfc: fix gpio input read
2) serial-sh: SCIFA interface for R-Car Gen2 SoCs
3) rmobile: add SCIFA port base offsets
4) rmobile: Add Stout board support

---
  arch/arm/cpu/armv7/rmobile/Kconfig            |    8
  arch/arm/include/asm/arch-rmobile/rcar-base.h |    3
  board/renesas/stout/Kconfig                   |   12
  board/renesas/stout/MAINTAINERS               |    6
  board/renesas/stout/Makefile                  |   11
  board/renesas/stout/cpld.c                    |  167 +
  board/renesas/stout/cpld.h                    |  183 +
  board/renesas/stout/qos.c                     | 2435
++++++++++++++++++++++++++
  board/renesas/stout/qos.h                     |   14
  board/renesas/stout/stout.c                   |  232 ++
  configs/stout_defconfig                       |   21
  drivers/gpio/sh_pfc.c                         |    3
  drivers/serial/serial_sh.h                    |   43
  include/configs/stout.h                       |  112 +
  14 files changed, 3239 insertions(+), 11 deletions(-)
Signature · 3 lines
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6